PageSourceSearch

https://bolingbrooksoccerclub.org/chunk-ZDGMLQYG.js

js bolingbrooksoccerclub.org collected 2026-10-04 20:32:54 UTC 463,150 bytes, 3,070 lines download raw bytes

1import{a as qa,b as Wa,c as Qa}from"./chunk-4GML6CLG.js";import{a as za,e as ee}from"./chunk-KSBAJSOE.js";import{a as Ha,b as Ai,c as Ga,d as Ya,e as Ja}from"./chunk-FJ27CXOF.js";import{a as Vi}from"./chunk-SVSLCSVL.js";import"./chunk-QIETH6AN.js";import{b as Ba,c as ja}from"./chunk-56A7BQAL.js";import{a as Nt}from"./chunk-MORY5OOD.js";import{a as At}from"./chunk-FLFERWGO.js";import{a as re}from"./chunk-3I6OB7K2.js";import{b as Gt}from"./chunk-CJOMWIKP.js";import{a as Ua,b as Oa}from"./chunk-PSOULVZL.js";import"./chunk-XAXLMUF6.js";import{b as Na,c as La,d as Fi,e as $a}from"./chunk-RXHK7XE4.js";import{k as ki}from"./chunk-O3BD2LYL.js";import"./chunk-6ORYOOUQ.js";import"./chunk-ZB44PIZA.js";import{c as Aa}from"./chunk-YBFQQSLW.js";import"./chunk-XDUT5FQR.js";import"./chunk-BT6MT7GL.js";import"./chunk-4CVZBQNN.js";import{Zb as Ea,hc as Ma,jc as Pa,lc as Ri,qc as Ra}from"./chunk-PXZNPNHI.js";import"./chunk-KWNDGQWR.js";import"./chunk-2ZFY6MCW.js";import"./chunk-KQ7PEKEE.js";import"./chunk-KVMIYEBS.js";import"./chunk-DLHY2JKF.js";import"./chunk-WLMRFXCZ.js";import"./chunk-WN3UI2QV.js";import"./chunk-YVLOHBDK.js";import{a as Ft}from"./chunk-Z3AXU4EF.js";import"./chunk-TP3A6IN2.js";import{$ as kt,U as Pi,X as Pt,Y as Da,_ as Rt,aa as Vt,ba as Ia}from"./chunk-XNFXA3ZT.js";import"./chunk-QLTRNXEK.js";import"./chunk-TEFEWVO6.js";import{a as Ie}from"./chunk-ZB64W4XA.js";import"./chunk-SVABVB5X.js";import{a as Ta,b as st,c as lt,f as Ne,g as on,i as Ht}from"./chunk-CMY6WAF3.js";import"./chunk-FUY7HSJY.js";import"./chunk-JTYXZXFU.js";import"./chunk-7MK6I7GJ.js";import"./chunk-3HFTO6XY.js";import"./chunk-XNSH6ILV.js";import"./chunk-IZKA562T.js";import"./chunk-BROSYERN.js";import"./chunk-Y2KCFOCP.js";import"./chunk-Z52L74DH.js";import{a as wt}from"./chunk-JKMNVQUA.js";import{f as ya,h as wa,i as an,j as ka,q as Va}from"./chunk-QH3IRCHN.js";import"./chunk-PLEH3NAH.js";import"./chunk-GXCJ5QS4.js";import{b as Y}from"./chunk-4D5SN44G.js";import{e as Ii,f as Mi,j as Fa}from"./chunk-22ACI5KU.js";import{a as Ei}from"./chunk-FXUQQQIE.js";import{b as Di}from"./chunk-FSUBAQYH.js";import{a as Je}from"./chunk-7CVCGK4Q.js";import"./chunk-FWW3IJT2.js";import"./chunk-B6LCWWQX.js";import"./chunk-HYGNXZJR.js";import{a as Sa}from"./chunk-B6XXRKU5.js";import"./chunk-6Q5DDO7R.js";import"./chunk-RW2MVE4O.js";import{a as va,d as ba}from"./chunk-3ZVRFUA4.js";import{a as Wt,i as Ca}from"./chunk-H4PCL6BZ.js";import"./chunk-NXTJBJRP.js";import"./chunk-U22BTVEZ.js";import{$b as Se,$f as yi,Ac as Gn,B as ni,Cc as ui,Ce as Ci,Ec as Fe,Ed as fi,Eg as da,Ff as X,Gb as oe,Gc as _i,Gd as Dt,Hb as zn,Hc as hi,Hd as he,Hg as ma,Ia as Bn,Je as na,Kb as be,Ke as aa,Le as oa,Mb as ce,Ne as ra,Od as Zn,Pe as sa,Qc as Yn,Rc as Qn,Rd as Xn,Sc as Tt,Ue as vi,Uf as Mt,Wc as gi,Wg as ca,Xe as la,Xg as pa,Yg as ua,Zg as _a,_f as Si,_g as ha,ag as wi,ah as ga,b as Ct,be as ea,bf as bi,bg as Ti,cc as qn,ch as fa,d as De,e as Rn,ed as Jn,ee as Et,fe as je,ge as tn,h as kn,he as nn,id as Ve,jb as jn,jc as pi,jd as Kn,je as ta,k as Ee,kd as _e,kh as xa,l as Fn,le as It,mb as Ye,oe as ia,qe as Ae,sc as Wn,ua as ve,vc as Hn,ve as xi,xa as yt,xb as Qe,ya as On,za as qt}from"./chunk-X5J6QTCG.js";import{$ as Zt,$a as p,$c as Pn,Aa as Ue,Ac as ft,Ad as Xi,C as hn,Db as Re,E as ge,Eb as Sn,Ee as An,Fa as l,Fb as ie,G as gn,Gb as Oe,H as fn,Hb as nt,I as Ki,Ib as e,Ie as Yo,Jb as T,Jc as En,Jf as li,Ka as C,Kb as w,L as we,Lb as z,Lc as ue,Lf as di,Ma as D,Mb as yn,Na as ei,Nb as wn,Ni as me,Pf as rt,Qb as M,R as xn,Rb as P,Rh as en,Sa as A,Sb as R,Sc as In,T as ht,Tc as Mn,Th as W,U as S,Ve as ri,W as Kt,Wc as xt,Xa as ye,Xb as Tn,Xi as Un,Zh as Nn,_ as gt,_a as ti,_h as Ln,ab as vn,ad as ii,ba as it,bb as u,bc as Dn,be as ke,bg as mi,cb as bn,cc as Q,ci as Be,d as U,db as $,dc as L,di as ae,eb as F,ec as pe,fa as g,fb as V,fc as at,fi as ci,fj as Ce,ga as f,gb as _,gf as bt,hb as s,hd as ot,ib as o,j as _n,jb as x,k as Z,kf as si,lc as N,ma as fe,mc as xe,na as Cn,nb as J,nc as B,ne as Ge,ob as K,pb as Zi,pj as E,q as et,qb as y,qc as ne,ra as Xt,re as Vn,ri as $n,sb as v,tb as m,td as ai,u as j,vd as I,wd as vt,wg as St,x as _t,xb as Te,xd as H,yb as se,yd as de,z as tt,zb as le,zd as oi}from"./chunk-SMW7PHYX.js";import{a as Pe,b as Ji,h as Go,j as ut}from"./chunk-BMIYOSOG.js";function Qo(a,d){if(a&1&&(e(0,`
2  `),s(1,"div",5),e(2,`
3    `),s(3,"h3",6)(4,"strong"),e(5),o()(),e(6,`
4    `),e(7,`
5`),o(),e(8,`
6`)),a&2){let i=m();l(5),w("",i.teamName," Team Chat")}}function Jo(a,d){if(a&1&&(e(0,`
7      `),x(1,"app-team-channel-message",7),e(2,`
8    `)),a&2){let i=m();l(),_("teamChannelID",i.viewingTeamChannelID)}}function Ko(a,d){a&1&&(e(0,`
9      `),x(1,"app-message"),e(2,`
10    `))}function Zo(a,d){a&1&&(e(0,`
11      `),x(1,"app-team-message"),e(2,`
12    `))}var Yt=(()=>{let d=class d{constructor(t,n,r,c,h,b,k){this.siteDataService=t,this.route=n,this.messageService=r,this.router=c,this.teamService=h,this.staffService=b,this.changeDetectorRef=k,this.unsubscribe$=new U,this.viewingTeamThread=!1,this.adminView=!1,this.currentMessageThreadID=void 0,this.teamThreadData$=this.messageService.teamThreadData$;let te=this.router.getCurrentNavigation()??this.router.lastSuccessfulNavigation();te?.extras.state&&(this.teamName=te.extras.state.teamName)}
12ngOnInit(){this.teamID=+this.route.snapshot.parent.params.id,this.programID=+this.route.snapshot.parent.params.programID,this.adminView=this.route.snapshot.data?.adminView,console.log("admin view: ",this.adminView);let t=this.messageService.shouldOpenNewMessageModalOnLoad;this.messageService.shouldOpenNewMessageModalOnLoad=!1;let n=this.messageService.openTeamChannelIdOnLoad;this.messageService.openTeamChannelIdOnLoad=void 0,this.messageService.messageThread$.pipe(S(this.unsubscribe$)).subscribe(r=>{r?(this.messageThreadID=r.messageThreadID,this.currentMessageThreadID=r.messageThreadID,this.viewingTeamThread=!1,this.viewingTeamChannelID=void 0):(this.messageThreadID=void 0,this.currentMessageThreadID=void 0)}),this.messageService.teamThread$.pipe(S(this.unsubscribe$)).subscribe(r=>{console.log("[DEBUG] teamThread$ subscription received:",r,"viewingTeamThread set to:",r),r&&(this.messageThreadID=void 0,this.currentMessageThreadID=void 0,this.viewingTeamThread=r,this.viewingTeamChannelID=void 0,this.changeDetectorRef.detectChanges())}),n&&(this.viewingTeamChannelID=n,this.viewingTeamThread=!1,this.currentMessageThreadID=void 0),!this.adminView&&!this.teamName?this.staffService.getAssignedTeams().pipe(S(this.unsubscribe$)).subscribe(r=>{let c=r?.find(h=>h.teamID===this.teamID);this.teamName=c?.team?.name||""}):this.teamName||this.teamService.getTeam(this.teamID).pipe(S(this.unsubscribe$)).subscribe(r=>{this.teamName=r?.name||""}),this.siteDataService.hideSiteLoader(),t&&setTimeout(()=>{this.messageService.triggerNewMessageModal()}
12,0)}ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete()}};d.\u0275fac=function(n){return new(n||d)(C(E),C(I),C(re),C(H),C(X),C(Ie),C(ft))},d.\u0275cmp=D({type:d,selectors:[["app-messages-view"]],standalone:!1,decls:18,vars:4,consts:[[1,"card","edit-card","p-0"],[1,"row","no-gutters","p-0","message-view-container"],[1,"col-6","channel-list-panel","pr-0","pt-2"],[3,"adminView","messagesViewComponent"],[1,"col-6","message-panel","no-gutters"],[1,"messages-header"],[1,"p-2"],[3,"teamChannelID"]],template:function(n,r){n&1&&(s(0,"div",0),e(1,`
13  `),e(2,`
14`),p(3,Qo,9,1),s(4,"div",1),e(5,`
15  `),s(6,"div",2),e(7,`
16    `),x(8,"app-message-thread",3),e(9,`
17  `),o(),e(10,`
18  `),s(11,"div",4),e(12,`
19    `),p(13,Jo,3,1)(14,Ko,3,0)(15,Zo,3,0),o(),e(16,`
20`),o(),e(17,`
21`),o()),n&2&&(l(3),u(!r.adminView&&r.teamName?3:-1),l(5),_("adminView",r.adminView)("messagesViewComponent",r),l(5),u(r.viewingTeamChannelID?13:!r.viewingTeamThread&&!r.adminView?14:r.viewingTeamThread||r.adminView?15:-1))},styles:[".messages-header[_ngcontent-%COMP%]     .admin-header h1 span.header--page-label, .messages-header[_ngcontent-%COMP%]     .admin-header .heading span.header--page-label{font-size:unset}.messages-header[_ngcontent-%COMP%]     .admin-header>.row.align-items-center.mb-3{margin:.5rem 0!important}.message-content[_ngcontent-%COMP%]{max-height:400px;overflow-y:auto}.footer-form[_ngcontent-%COMP%]{position:sticky;bottom:0;color:var(--color-white);border-top:1px solid var(--border-color);padding:1rem}.conversation-disabled[_ngcontent-%COMP%]{opacity:.5;pointer-events:none}"]});let a=d;return a})();var Lt=(()=>{let d=class d{constructor(t){this.webAPI=t}getChannelsForTeam(t,n){return this.webAPI.getData(`private/team-channels/team/${t}/program/${n}`)}getChannel(t){return this.webAPI.getData(`private/team-channels/${t}`)}createChannel(t){return this.webAPI.postData("private/team-channels",t)}updateChannel(t,n){return this.webAPI.putData(`private/team-channels/${t}`,n)}deleteChannel(t){return this.webAPI.deleteData(`private/team-channels/${t}`)}getSelectableRoles(t,n){let r=new ot().set("teamID",t).set("programID",n);return this.webAPI.getData("private/team-channels/roles",r)}getFormMetadata(t,n){let r=new ot().set("teamID",t).set("programID",n);return this.webAPI.getData("private/team-channels/metadata",r)}previewRecipients(t){return this.webAPI.postData("private/team-channels/preview",t)}getMessages(t,n,r=50){let c=new ot().set("page",n).set("rows",r);return this.webAPI.getData(`private/team-channels/${t}/messages`,c)}sendMessage(t,n){return this.webAPI.postData(`private/team-channels/${t}/messages`,n)}sendMessageWithPoll(t,n){return this.webAPI.postData(`private/team-channels/${t}/messages/poll`,n)}editMessage(t,n,r){return this.webAPI.putData(`private/team-channels/${t}/messages/${n}`,r)}deleteMessage(t,n){return this.webAPI.deleteData(`private/team-channels/${t}/messages/${n}`)}getPinnedMessages(t,n,r=25,c=0){let h=new ot().set("page",n).set("rows",r).set("current",c);return this.webAPI.getData(`private/team-channels/${t}/messages/pinned`,h)}pinMessage(t,n,r){return this.webAPI.putData(`private/team-channels/${t}/messages/${n}/pin`,{isPinned:r})}reactToMessage(t,n){return this.webAPI.postData(`private/team-channels/${t}/messages/react`,n)}updateReaction(t,n,r){return this.webAPI.putData(`private/team-channels/${t}/messages/react/${n}`,r)}deleteReaction(t,n){return this.webAPI.deleteData(`private/team-channels/${t}/messages/react/${n}`)}uploadPhoto(t,n){return this.webAPI.postData(`private/team-channels/${t}/photo`,n,void 0,!0)}};d.\u0275fac=function(n){return new(n||d)(it(ci))},d.\u0275prov=gt({token:d,factory:d.\u0275fac,providedIn:"root"});let a=d;return a})();var sn=Go(Yo());var er=["channelForm"],tr=(a,d)=>d.clubUserID;function ir(a,d){a&1&&(e(0,`
22        `),s(1,"div",3),e(2,`
23            `),x(3,"span",4),e(4,`
24        `),o(),e(5,`
25    `))}function nr(a,d){a&1&&(e(0,`
26                    `),x(1,"span",15),e(2,`
27                `))}function ar(a,d){if(a&1&&e(0),a&2){let i=m(3);w(" \xB7 ",i.preview.staffCount," staff ")}}function or(a,d){if(a&1&&e(0),a&2){let i=m(3);w(" \xB7 ",i.preview.playerCount," player(s) ")}}function rr(a,d){if(a&1&&e(0),a&2){let i=m(3);w(" \xB7 ",i.preview.parentCount," parent(s) ")}}function sr(a,d){a&1&&(e(0,`
28                    `),s(1,"div",17),e(2,"No one matches yet \u2014 pick role(s) or include players/parents."),o(),e(3,`
29                `))}function lr(a,d){a&1&&(e(0,`
30                                            `),x(1,"i",23),e(2,`
31                                        `))}function dr(a,d){a&1&&(e(0,`
32                                            `),x(1,"i",24),e(2,`
33                                        `))}function mr(a,d){if(a&1&&(e(0,`
34                                `),s(1,"li",21),e(2,`
35                                    `),s(3,"span"),e(4),o(),e(5,`
36                                    `),s(6,"span",14),e(7,`
37                                        `),s(8,"span",22),e(9),o(),e(10,`
38                                        `),p(11,lr,3,0)(12,dr,3,0),o(),e(13,`
39                                `),o(),e(14,`
40                            `)),a&2){let i=d.$implicit;l(4),T(i.fullName),l(5),T(i.roleName||i.kind),l(2),u(i.hasAccount?11:12)}}function cr(a,d){if(a&1&&(e(0,`
41                        `),s(1,"ul",20),e(2,`
42                            `),F(3,mr,15,3,null,null,tr),o(),e(5,`
43                    `)),a&2){let i=m(4);l(3),V(i.preview.members)}}function pr(a,d){if(a&1){let i=y();e(0,`
44                    `),s(1,"button",18),v("click",function(){g(i);let n=m(3);return f(n.showMembers=!n.showMembers)}),e(2,`
45                        `),x(3,"i",19),e(4),o(),e(5,`
46                    `),p(6,cr,6,0)}if(a&2){let i=m(3);l(3),ie("fa-chevron-right",!i.showMembers)("fa-chevron-down",i.showMembers),l(),w(`
47                        `,i.showMembers?"Hide who's included":"Show who's included",`
48                    `),l(2),u(i.showMembers?6:-1)}}function ur(a,d){if(a&1&&(e(0,`
49                `),s(1,"div",16),e(2),p(3,ar,1,1),p(4,or,1,1),p(5,rr,1,1),o(),e(6,`
50                `),p(7,sr,4,0)(8,pr,7,6)),a&2){let i=m(2);l(2),w(`
51                    `,i.preview.totalCount,` member(s)
52                    `),l(),u(i.preview.staffCount?3:-1),l(),u(i.preview.playerCount?4:-1),l(),u(i.preview.parentCount?5:-1),l(2),u(i.preview.totalCount===0?7:8)}}function _r(a,d){if(a&1){let i=y();e(0,`
53            `),s(1,"app-inline-alert",25),e(2,`
54                A channel with this audience already exists: `),s(3,"strong"),e(4),o(),e(5,`. 
55                `),s(6,"button",26),v("click",function(){g(i);let n=m(2);return f(n.goToDuplicateChannel())}),e(7,`
56                    `),x(8,"i",27),e(9,`Go to channel
57                `),o(),e(10,`
58            `),o(),e(11,`
59        `)}if(a&2){let i=m(2);l(),_("isInline",!1),l(3),T(i.duplicateChannel.name)}}function hr(a,d){if(a&1){let i=y();e(0,`
60        `),s(1,"app-dynamic-form",5,1),v("valueChanges",function(n){g(i);let r=m();return f(r.onFormValueChanges(n))}),e(3,`
61
62            `),x(4,"app-dynamic-form-field",6),e(5,`
63            `),x(6,"app-dynamic-form-field",7),e(7,`
64            `),e(8,`
65            `),s(9,"div",8),e(10,`
66                `),x(11,"app-dynamic-form-field",9),e(12,`
67            `),o(),e(13,`
68            `),x(14,"app-dynamic-form-field",10),e(15,`
69            `),x(16,"app-dynamic-form-field",11),e(17,`
70            `),x(18,"app-dynamic-form-field",12),e(19,`
71        `),o(),e(20,`
72
73        `),s(21,"div",13),e(22,`
74            `),s(23,"div",14),e(24,`
75                `),s(25,"strong"),e(26,"Who will be in this channel"),o(),e(27,`
76                `),p(28,nr,3,0),o(),e(29,`
77            `),p(30,ur,9,5),o(),e(31,`
78
79        `),p(32,_r,12,2)}if(a&2){let i=m();l(),_("fields",i.metadata.fields)("entity",i.entity)("contentFieldsMode",!0)("showSubmitButton",!1)("showCancelButton",!1)("modalContent",!0)("formID",i.formID),l(3),_("formID",i.formID),l(2),_("formID",i.formID),l(3),_("hidden",i.includeAllStaffValue),l(2),_("formID",i.formID),l(3),_("formID",i.formID),l(2),_("formID",i.formID),l(2),_("formID",i.formID),l(10),u(i.loadingPreview?28:-1),l(2),u(i.preview?30:-1),l(2),u(i.duplicateChannel?32:-1)}}function gr(a,d){a&1&&(e(0,`
80        `),s(1,"div",28),e(2,"Unable to load the channel form."),o(),e(3,`
81    `))}function fr(a,d){if(a&1){let i=y();e(0,`
82        `),s(1,"app-dialog-footer"),e(2,`
83            `),J(3,29),e(4,`
84                `),s(5,"button",30),v("click",function(){g(i);let n=m();return f(n.onCancel())}),e(6,"Cancel"),o(),e(7,`
85            `),K(),e(8,`
86            `),J(9,31),e(10,`
87                `),s(11,"button",32),v("click",function(){g(i);let n=m();return f(n.save())}),e(12,`
88                    `),x(13,"i"),e(14),o(),e(15,`
89            `),K(),e(16,`
90        `),o(),e(17,`
91    `)}if(a&2){let i=m();l(11),_("disabled",i.saving||i.loadingMetadata||!i.metadata),l(2),nt(i.saving?"fa fa-spinner fa-spin mr-1":"fa-regular fa-check mr-1"),l(),w("",i.isEdit?"Save":"Create",`
92                `)}}var Li=(()=>{let d=class d{get isEdit(){return!!this.channelToEdit}get dialogHeader(){return this.isEdit?"Edit Channel":"Create Channel"}constructor(t,n,r){this.channelService=t,this.siteDataService=n,this.teamService=r,this.saved=new fe,this.cancel=new fe,this.navigateToChannel=new fe,this.unsubscribe$=new U,this.previewTrigger$=new U,this.lastAudienceKey="",this.autoNamingEnabled=!1,this.lastAutoName="",this.formID="team-channel-form",this.show=!0,this.entity={},this.loadingMetadata=!0,this.includeAllStaffValue=!1,this.loadingPreview=!1,this.saving=!1,this.showMembers=!1,this.minorSafeguardMessage="A channel that includes players must have at least 2 adult recipients (staff or additional recipients)."}ngOnInit(){let t=this.channelToEdit?.teamID??this.teamID,n=this.channelToEdit?.programID??this.programID;this.entity={name:this.channelToEdit?.name??"",includeAllStaff:this.channelToEdit?.includeAllStaff??!1,roleIDs:this.channelToEdit?.roleIDs??[],includePlayers:this.channelToEdit?.includePlayers??!1,includeParents:this.channelToEdit?.includeParents??!1,additionalRecipientClubUserIDs:this.channelToEdit?.additionalRecipientClubUserIDs??[]},this.isEdit||this.teamService.getTeam(t).pipe(S(this.unsubscribe$)).subscribe({next:r=>{this.teamName=r?.name??"",this.autoNamingEnabled=!0,this.applyAutoName(this.buildAutoChannelName(this.currentFilter()))},error:()=>{}}),this.includeAllStaffValue=!!this.entity.includeAllStaff,this.lastAudienceKey=JSON.stringify(this.filterFrom(this.entity)),this.previewTrigger$.pipe(gn(400),S(this.unsubscribe$)).subscribe({next:()=>this.refreshPreview(),error:()=>{}}),this.channelService.getFormMetadata(t,n).pipe(S(this.unsubscribe$)).subscribe({next:r=>{this.metadata=r,this.applyEditModeLocks(),this.applyCreateModeDefaults(),this.loadingMetadata=!1,this.isEdit||this.loadExistingChannels()},error:()=>{this.loadingMetadata=!1,this.siteDataService.showSiteErrorAlert("Unable to load the channel form.")}}),this.refreshPreview()}applyEditModeLocks(){if(!this.isEdit||!this.metadata?.fields)return;let t=["includeAllStaff","includePlayers","includeParents"];for(let n of t)if(this.channelToEdit[n]){let r=this.metadata.fields.find(c=>(c.controlName??c.key)===n);r&&(r.disabled=!0)}if(this.channelToEdit.roleIDs?.length){let n=this.metadata.fields.find(r=>(r.controlName??r.key)==="roleIDs");n?.options&&(n.options=n.options.map(r=>Ji(Pe({},r),{disabled:this.channelToEdit.roleIDs.includes(r.value)})))}if(this.channelToEdit.additionalRecipientClubUserIDs?.length){let n=this.metadata.fields.find(r=>(r.controlName??r.key)==="additionalRecipientClubUserIDs");n?.options&&(n.options=n.options.map(r=>Ji(Pe({},r),{disabled:this.channelToEdit.additionalRecipientClubUserIDs.includes(r.value)})))}}applyCreateModeDefaults(){if(this.isEdit||!this.metadata?.fields)return;this.entity.includePlayers=!0,this.metadata.fields.find(n=>(n.controlName??n.key)==="roleIDs")?.options?.some(n=>n.value===Be.COACH)&&(this.entity.roleIDs=[Be.COACH]),this.autoNamingEnabled&&this.applyAutoName(this.buildAutoChannelName(this.currentFilter())),this.refreshPreview()}onFormValueChanges(t){if(!t)return;this.includeAllStaffValue=!!t.includeAllStaff||this.isEdit&&!!this.channelToEdit.includeAllStaff;let n=this.filterFrom(t);this.updateAutoName(t.name,n);let r=JSON.stringify(n);r!==this.lastAudienceKey&&(this.lastAudienceKey=r,this.previewTrigger$.next(),this.duplicateChannel=void 0)}buildAutoChannelName(t){let n=this.teamName??"",r=[];if(t.includeAllStaff)r.push("Staff");else if(t.roleIDs.length){let c=this.metadata?.fields.find(b=>(b.controlName??b.key)==="roleIDs"),h=t.roleIDs.map(b=>c?.options?.find(k=>k.value===b)?.label).filter(b=>!!b);h.length&&r.push(h.join("/"))}return t.includePlayers&&r.push("Players"),t.includeParents&&r.push("Parents"),t.additionalRecipientClubUserIDs.length&&r.push("Additional"),r.length?`${n}
92 + ${r.join(" + ")}`:n}updateAutoName(t,n){if(!this.autoNamingEnabled)return;if((t??"")!==this.lastAutoName){this.autoNamingEnabled=!1;return}let r=this.buildAutoChannelName(n);r!==t&&this.applyAutoName(r)}applyAutoName(t){this.entity.name=t,this.lastAutoName=t,this.channelForm?.form?.get("name")?.setValue(t,{emitEvent:!1})}filterFrom(t){let n=!!t.includeAllStaff||this.isEdit&&!!this.channelToEdit.includeAllStaff;return{includeAllStaff:n,roleIDs:n?[]:t.roleIDs??[],includePlayers:!!t.includePlayers||this.isEdit&&!!this.channelToEdit.includePlayers,includeParents:!!t.includeParents||this.isEdit&&!!this.channelToEdit.includeParents,additionalRecipientClubUserIDs:t.additionalRecipientClubUserIDs??[]}}currentFilter(){return this.filterFrom(this.channelForm?.value??this.entity)}loadExistingChannels(){if(!this.teamID||!this.programID)return;let t=this.teamID,n=this.programID;this.channelService.getChannelsForTeam(this.teamID,this.programID).pipe(S(this.unsubscribe$)).subscribe({next:r=>{this.teamID!==t||this.programID!==n||(this.existingChannels=r??[])},error:()=>{}})}isSameAudience(t,n){if(t.teamID!==this.teamID||t.programID!==this.programID||!!t.includeAllStaff!==n.includeAllStaff||!!t.includePlayers!==n.includePlayers||!!t.includeParents!==n.includeParents)return!1;let r=[...n.includeAllStaff?[]:t.roleIDs??[]].sort(),c=[...n.roleIDs??[]].sort();return JSON.stringify(r)===JSON.stringify(c)}goToDuplicateChannel(){this.duplicateChannel&&this.navigateToChannel.emit(this.duplicateChannel)}refreshPreview(){let t=this.channelToEdit?.teamID??this.teamID,n=this.channelToEdit?.programID??this.programID,r=this.currentFilter();this.loadingPreview=!0,this.channelService.previewRecipients({teamID:t,programID:n,includeAllStaff:r.includeAllStaff,roleIDs:r.roleIDs,includePlayers:r.includePlayers,includeParents:r.includeParents,additionalRecipientClubUserIDs:r.additionalRecipientClubUserIDs}).pipe(S(this.unsubscribe$)).subscribe({next:c=>{this.preview=c,this.loadingPreview=!1},error:()=>{this.loadingPreview=!1}})}save(){if(!this.channelForm)return;if(!this.channelForm.isValid){this.channelForm.submitForm();return}let t=this.channelForm.value,n=this.currentFilter();if(!this.isEdit){let r=this.existingChannels?.find(c=>this.isSameAudience(c,n));if(r){this.duplicateChannel=r;return}}if(this.saving=!0,this.isEdit){let r={name:t.name,includeAllStaff:n.includeAllStaff,roleIDs:n.roleIDs,includePlayers:n.includePlayers,includeParents:n.includeParents,additionalRecipientClubUserIDs:n.additionalRecipientClubUserIDs};this.channelService.updateChannel(this.channelToEdit.teamChannelID,r).pipe(S(this.unsubscribe$)).subscribe({next:c=>{this.saving=!1,this.siteDataService.showSiteSuccessAlert("Channel updated."),this.saved.emit(c)},error:()=>{this.saving=!1,this.siteDataService.showSiteErrorAlert("Unable to update channel.")}})}else{let r={name:t.name,teamID:this.teamID,programID:this.programID,includeAllStaff:n.includeAllStaff,roleIDs:n.roleIDs,includePlayers:n.includePlayers,includeParents:n.includeParents,additionalRecipientClubUserIDs:n.additionalRecipientClubUserIDs};this.channelService.createChannel(r).pipe(S(this.unsubscribe$)).subscribe({next:c=>{this.saving=!1,this.siteDataService.showSiteSuccessAlert("Channel created."),this.saved.emit(c)},error:c=>{this.saving=!1,this.siteDataService.showSiteErrorAlert(c?.status===400?this.minorSafeguardMessage:"Unable to create channel.")}})}}onCancel(){this.cancel.emit()}ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete()}};d.\u0275fac=function(n){return new(n||d)(C(Lt),C(E),C(X))},d.\u0275cmp=D({type:d,selectors:[["app-team-channel-modal"]],viewQuery:function(n,r){if(n&1&&Te(er,5),n&2){let c;se(c=le())&&(r.channelForm=c.first)}},inputs:{teamID:"teamID",programID:"programID",channelToEdit:"channelToEdit"},outputs:{saved:"saved",cancel:"cancel",navigateToChannel:"navigateToChannel"},decls:9,vars:6,consts:[["footer",""],["channelForm",""],["styleClass","standardWidthDialog",3,"visibleChange","onHide","visible","modal","draggable","closable","header"],[1,"full-width","d-flex","justify-content-center","p-4"],[1,"spinner-border","spinner-border-sm"],[3,"valueChanges","fields","entity","contentFieldsMode","showSubmitButton","showCancelButton","modalContent","formID"],["fieldName","name",3,"formID"],["fieldName","includeAllStaff",3,"formID"],[1,"mb-2",3,"hidden"],["fieldName","roleIDs",3,"formID"],["fieldName","includePlayers",3,"formID"],["fieldName","includeParents",3,"formID"],["fieldName","additionalRecipientClubUserIDs",3,"formID"],[1,"border-top","pt-2","mt-2"],[1,"d-flex","align-items-center"],[1,"spinner-border","spinner-border-sm","ml-2"],[1,"text-muted","text-small","mt-1"],[1,"text-warning","text-small","mt-1"],["type","button",1,"btn","btn-naked","btn-sm","pl-0","mt-1",3,"click"],[1,"fa-regular","mr-1"],[1,"list-unstyled","mb-0","mt-1"],[1,"d-flex","justify-content-between","align-items-center","py-1"],[1,"text-muted","text-small","mr-2"],["pTooltip","User has account","tooltipPosition","left",1,"fa-regular","fa-check","text-success"],["pTooltip","User has no account","tooltipPosition","left",1,"fa-regular","fa-triangle-exclamation","text-warning"],["alertType","warning",1,"mt-2",3,"isInline"],["type","button",1,"btn","mb-3","right",2,"margin-top","1em",3,"click"],[1,"fa-regular","fa-arrow-right","mr-1"],[1,"text-danger","text-small","p-3"],["slot","secondary"],["type","button",1,"btn","btn-secondary",3,"click"],["slot","primary"],["type","button",1,"btn","btn-primary",3,"click","disabled"]],template:function(n,r){if(n&1){let c=y();s(0,"p-dialog",2),R("visibleChange",function(b){return g(c),P(r.show,b)||(r.show=b),f(b)}),v("onHide",function(){return r.onCancel()}),e(1,`
93
94    `),p(2,ir,6,0)(3,hr,33,17)(4,gr,4,0),A(5,fr,18,4,"ng-template",null,0,ne),e(7,`
95`),o(),e(8,`
96`)}n&2&&(M("visible",r.show),_("modal",!0)("draggable",!1)("closable",!0)("header",r.dialogHeader),l(2),u(r.loadingMetadata?2:r.metadata?3:4))},dependencies:[ii,zn,oe,ma,he,_e,da,ce,Tt],encapsulation:2});let a=d;return a})();var vr=a=>({card:a});function br(a,d){if(a&1){let i=y();e(0,`
97                        `),s(1,"div",6),e(2,`
98                            `),s(3,"label")(4,"input",8),v("change",function(n){g(i);let r=m(2);return f(r.allCoachesClicked(n))}),o(),e(5,`
99                                Staff`),o(),e(6,`
100                        `),o(),e(7,`
101                        `)}if(a&2){let i=m(2);l(4),_("disabled",i.allSelected)("checked",i.coachesSelected)}}function Sr(a,d){if(a&1){let i=y();e(0,`
102                        `),s(1,"div",6),e(2,`
103                            `),s(3,"label")(4,"input",9),v("change",function(n){g(i);let r=m(2);return f(r.allParentsClicked(n))}),o(),e(5,`
104                                Parents`),o(),e(6,`
105                        `),o(),e(7,`
106                        `)}if(a&2){let i=m(2);l(4),_("disabled",i.allSelected)("checked",i.parentsSelected)}}function yr(a,d){if(a&1){let i=y();e(0,`
107                        `),s(1,"div",6),e(2,`
108                            `),s(3,"label")(4,"input",10),v("change",function(n){g(i);let r=m(2);return f(r.allPlayersClicked(n))}),o(),e(5,`
109                                Players`),o(),e(6,`
110                        `),o(),e(7,`
111                        `)}if(a&2){let i=m(2);l(4),_("disabled",i.allSelected)("checked",i.playersSelected)}}function wr(a,d){if(a&1){let i=y();e(0,`
112            `),s(1,"p-accordion-panel",4),e(2,`
113                `),s(3,"p-accordion-header"),e(4,"Groups"),o(),e(5,`
114                `),s(6,"p-accordion-content"),e(7,`
115                    `),s(8,"div",5),e(9,`
116                        `),s(10,"div",6),e(11,`
117                            `),s(12,"label")(13,"input",7),v("change",function(n){g(i);let r=m();return f(r.allClicked(n))}),o(),e(14,`
118                                All`),o(),e(15,`
119                        `),o(),e(16,`
120                        `),p(17,br,8,2),p(18,Sr,8,2),p(19,yr,8,2),o(),e(20,`
121                `),o(),e(21,`
122            `),o(),e(22,`
123            `)}if(a&2){let i=m();l(13),_("disabled",i.coachesSelected||i.parentsSelected||i.playersSelected)("checked",i.allSelected),l(4),u(i.coaches&&i.c
123oaches.length>0?17:-1),l(),u(i.playerParents&&i.playerParents.length>0?18:-1),l(),u(i.players&&i.players.length>0?19:-1)}}function Tr(a,d){if(a&1){let i=y();e(0,`
124                        `),s(1,"div",6),e(2,`
125                            `),s(3,"label",12)(4,"input",13),v("change",function(n){let r=g(i).$implicit,c=m(2);return f(c.coachSelected(n,r.clubUserID))}),o(),e(5),o(),e(6,`
126                            `),s(7,"app-pill",14),e(8),o(),e(9,`
127                        `),o(),e(10,`
128                        `)}if(a&2){let i=d.$implicit,t=m(2);l(4),_("id",i.clubUserID)("disabled",t.CommunicationTypeLV.MESSAGE===t.communicationType&&(t.disabledMembers[i.clubUserID]||t.isCoachPlayerParent(i.clubUserID)))("checked",t.disabledMembers[i.clubUserID]||t.recipientSelected(i.clubUserID)),l(),z(`
129                                `,i.firstName," ",i.lastName),l(3),T(i.programRole)}}function Dr(a,d){if(a&1&&(e(0,`
130            `),s(1,"p-accordion-panel",11),e(2,`
131                `),s(3,"p-accordion-header"),e(4,"Staff"),o(),e(5,`
132                `),s(6,"p-accordion-content"),e(7,`
133                    `),s(8,"div",5),e(9,`
134                        `),F(10,Tr,11,6,null,null,$),o(),e(12,`
135                `),o(),e(13,`
136            `),o(),e(14,`
137            `)),a&2){let i=m();l(10),V(i.coaches)}}function Er(a,d){if(a&1){let i=y();e(0,`
138                                    `),s(1,"div",18),e(2,`
139                                        `),s(3,"label")(4,"input",13),v("change",function(n){let r=g(i).$implicit,c=m(3);return f(c.parentSelected(n,r.clubUserID))}),o(),e(5),o(),e(6,`
140                                    `),o(),e(7,`
141                                    `)}if(a&2){let i=d.$implicit,t=m(3);l(4),_("id",i.clubUserID)("disabled",t.requiredParent(i.clubUserID)||t.requiredStaffParent(i.clubUserID)||t.CommunicationTypeLV.MESSAGE===t.communicationType&&t.disabledMembers[i.clubUserID])("checked",t.disabledMembers[i.clubUserID]||t.recipientSelected(i.clubUserID)),l(),z(`
142                                            `,i.firstName," ",i.lastName,`
143                                        `)}}function Ir(a,d){if(a&1&&(e(0,`
144                            `),s(1,"p-accordion-panel",17),e(2,`
145                                `),s(3,"p-accordion-header"),e(4),o(),e(5,`
146                                `),s(6,"p-accordion-content"),e(7,`
147                                    `),F(8,Er,8,5,null,null,$),o(),e(10,`
148                            `),o(),e(11,`
149                            `)),a&2){let i=d.$implicit;l(),_("value",i.playerID),l(3),T(i.firstName+" "+i.lastName),l(4),V(i.additionalRecipients)}}function Mr(a,d){if(a&1&&(e(0,`
150            `),s(1,"p-accordion-panel",15),e(2,`
151                `),s(3,"p-accordion-header"),e(4,"Parents"),o(),e(5,`
152                `),s(6,"p-accordion-content"),e(7,`
153                    `),s(8,"div",5),e(9,`
154                        `),s(10,"p-accordion",16),e(11,`
155                            `),F(12,Ir,12,2,null,null,$),o(),e(14,`
156                    `),o(),e(15,`
157                `),o(),e(16,`
158            `),o(),e(17,`
159            `)),a&2){let i=m();l(10),_("multiple",!0),l(2),V(i.playerParents)}}function Pr(a,d){if(a&1){let i=y();e(0,`
160                        `),s(1,"div",6),e(2,`
161                            `),s(3,"label")(4,"input",13),v("change",function(n){let r=g(i).$implicit,c=m(2);return f(c.playerSelected(n,r.clubUserID))}),o(),e(5),o(),e(6,`
162                        `),o(),e(7,`
163                        `)}if(a&2){let i=d.$implicit,t=m(2);l(4),_("id",i.clubUserID)("disabled",t.CommunicationTypeLV.MESSAGE===t.communicationType&&t.disabledMembers[i.clubUserID])("checked",t.disabledMembers[i.clubUserID]||t.recipientSelected(i.clubUserID)),l(),z(`
164                                `,i.firstName," ",i.lastName)}}function Rr(a,d){if(a&1&&(e(0,`
165            `),s(1,"p-accordion-panel",19),e(2,`
166                `),s(3,"p-accordion-header"),e(4,"Players"),o(),e(5,`
167                `),s(6,"p-accordion-content"),e(7,`
168                    `),s(8,"div",5),e(9,`
169                        `),F(10,Pr,8,5,null,null,$),o(),e(12,`
170                `),o(),e(13,`
171            `),o(),e(14,`
172            `)),a&2){let i=m();l(10),V(i.players)}}var Ut=(()=>{let d=class d{constructor(t,n,r,c,h,b){this.teamService=t,this.router=n,this.route=r,this.messageService=c,this.staffService=h,this.siteDataService=b,this.unsubscribe$=new U,this.modalView=!1,this.modalClose=new fe,this.parents=[],this.allSelected=!1,this.coachesSelected=!1,this.parentsSelected=!1,this.playersSelected=!1,this.showGroups=!0,this.disabledMembers=[],this.requiredParents=[],this.CommunicationTypeLV=Ht,this.selectedParents=[],this.selectedPlayers=[],this.selectedCoaches=[],this.activeState=[]}ngOnInit(){this.route.params.subscribe(t=>{t.communicationType&&(this.communicationType=+t.communicationType)}),this.messageService.selectedRecipients?.length>
1720&&(this.messageService.selectedRecipients.forEach(t=>{this.disabledMembers[t.clubUserID]=!0}),this.showGroups=!1),this.teamID||(this.messageService.selectedRecipients=[],this.teamID=+this.route.snapshot.parent.params.id,this.programID=+this.route.snapshot.parent.params.programID),this.getData(),this.siteDataService.hideSiteLoader()}getData(){this.staffService.getTeamAssignment(this.teamID).pipe(ge(t=>this.teamService.getTeamMessageRecipients(this.teamID,this.programID||t.programID))).pipe(S(this.unsubscribe$)).subscribe(t=>{t&&(this.playerParents=t.parents,this.playerParents.forEach(n=>{n.additionalRecipients.forEach(r=>{this.parents.push(r),this.activeState[r.playerID]=!1})}),this.coaches=t.coaches,this.players=t.players)})}mapFromService(){this.messageService.selectedRecipients?(console.log("Closed event current recips: ",event),this.selectedCoaches=this.selectedCoaches?.filter(t=>this.messageService.selectedRecipients.some(n=>n.clubUserID===t.clubUserID))):this.messageService.selectedRecipients=[]}isCoachPlayerParent(t){return this.requiredParents?this.requiredParents.some(n=>n.clubUserID===t):!1}cancel(){this.modalView?this.modalClose.emit():this.router.navigate([`/admin/manage-team/${this.teamID}/program/${this.programID}/communication/`])}next(){console.log("Selected Coaches: ",this.selectedCoaches),this.selectedCoaches?.length&&this.messageService.selectedRecipients.push(...this.selectedCoaches),console.log("Selected Parents: ",this.selectedParents),this.selectedParents?.length&&this.messageService.selectedRecipients.push(...this.selectedParents),console.log("Selected Players: ",this.selectedPlayers),this.selectedPlayers?.length&&this.messageService.selectedRecipients.push(...this.selectedPlayers),this.messageService.selectedRecipients.length>1&&(this.messageService.selectedRecipients=[...new Map(this.messageService.selectedRecipients.map(n=>[n.clubUserID,n])).values()]),this.messageService.setRecipientList();let t="";this.communicationType===Ht.MESSAGE?(this.messageThreadID&&this.messageService.updateMessageRecipients(this.teamID,this.messageThreadID,this.messageService.selectedRecipients).subscribe({next:()=>this.messageService.refreshMessageThreads()}),t=`/admin/manage-team/${this.teamID}/program/${this.programID}/communication/messages-view`):t=`/admin/manage-team/${this.teamID}/program/${this.programID}/communication/email-compose`,this.modalView?this.modalClose.emit():this.router.navigate([t])}allClicked(t){this.messageService.selectedRecipients=[],t.target.checked?(this.allSelected=!0,this.selectedParents=[...this.parents],this.selectedPlayers=[...this.players],this.selectedCoaches=[...this.coaches],this.accordionsOpen(),console.log(this.messageService.selectedRecipients)):this.selectedParents.length===this.parents.length&&this.selectedPlayers.length===this.players.length&&this.selectedCoaches.length===this.coaches.length&&(this.requiredParents=[],this.selectedParents=[],this.selectedPlayers=[],this.selectedCoaches=[],this.allSelected=!1,this.allAccordionsClosed())}allParentsClicked(t){t.target.checked?(this.parentsSelected=!0,this.selectedParents=this.parents,this.accordionsOpen()):(this.parents.forEach(n=>{this.parentSelected(t,n.clubUserID)}),this.parentsSelected=!1,this.playersSelected&&(this.selectedParents=[...this.requiredParents]),this.accordionsOpen())}allPlayersClicked(t){t.target.checked?(this.playersSelected=!0,this.selectedPlayers=[...this.players],this.players&&this.players.forEach(n=>{let r=this.parents.filter(c=>c.playerID===n.playerID);r&&r.forEach(c=>{this.selectedParents.some(h=>h.clubUserID===c.clubUserID)||this.selectedParents.push(c),this.requiredParents.some(h=>h.clubUserID===c.clubUserID)||this.requiredParents.push(c)})}),this.requiredParents=this.parents.filter(n=>this.players.map(r=>r.playerID).includes(n.playerID)),this.parentsSelected||this.accordionsOpen()):this.selectedPlayers.length===this.players.length&&(this.playersSelected=!1,this.parentsSelected||this.selectedPlayers.forEach(n=>{this.selectedParents.forEach((r,c)=>{n.playerID===r.playerID&&this.selectedParents.splice(c,1)})}),this.selectedPlayers=[],this.requiredParents=[],this.parentsSelected||this.accordionsOpen())}allCoachesClicked(t){t.target.checked?(this.selectedCoaches=this.coaches,this.coachesSelected=!0):this.selectedCoaches.length===this.coaches.length&&(this.coaches.forEac
172h(n=>{this.coachSelected(t,n.clubUserID)}),this.coachesSelected=!1)}parentSelected(t,n){t.target.checked?this.selectedParents.some(r=>r.clubUserID===n)||this.selectedParents.push(this.parents.find(r=>r.clubUserID===n)):(this.selectedParents=this.selectedParents.filter(r=>r.clubUserID!==n),this.coachesSelected||this.recipientSelected(n)&&(this.selectedCoaches=this.selectedCoaches.filter(r=>r.clubUserID!==n)),this.checkAllSelected(),this.checkAllParentsSelected())}playerSelected(t,n){let r=this.players.find(h=>h.clubUserID===n),c=r.additionalRecipients;t.target.checked?(this.selectedPlayers.find(h=>h===r)||this.selectedPlayers.push(r),c&&c.forEach(h=>{this.requiredParents.some(b=>h.clubUserID===b.clubUserID)||this.requiredParents.push(h),this.selectedParents.some(b=>h.clubUserID===b.clubUserID)||this.selectedParents.push(h)})):(this.selectedPlayers=this.selectedPlayers.filter(h=>h.clubUserID!==n),c&&c.forEach(h=>{this.requiredParents.some(b=>h.clubUserID===b.clubUserID)&&(this.requiredParents=this.requiredParents.filter(b=>b.clubUserID!==h.clubUserID))}),this.checkAllSelected(),this.checkAllPlayersSelected())}coachSelected(t,n){t.target.checked?this.selectedCoaches.some(r=>r.clubUserID===n)||this.selectedCoaches.push(this.coaches.find(r=>r.clubUserID===n)):(this.selectedCoaches=this.selectedCoaches.filter(r=>r.clubUserID!==n),this.parentsSelected||this.recipientSelected(n)&&(this.selectedParents=this.selectedParents.filter(r=>r.clubUserID!==n)),this.checkAllSelected(),this.checkAllCoachesSelected())}recipientSelected(t){return this.selectedParents.some(n=>n.clubUserID===t)||this.selectedPlayers.some(n=>n.clubUserID===t)||this.selectedCoaches.some(n=>n.clubUserID===t)}requiredParent(t){return this.requiredParents.some(n=>n.clubUserID===t)}requiredStaffParent(t){return this.coachesSelected?this.coaches.some(n=>n.clubUserID===t):!1}accordionsOpen(){this.activeState.forEach((t,n,r)=>{this.activeState[n]=!!this.selectedParents.filter(c=>c.playerID===n)})}allAccordionsClosed(){this.activeState.forEach((t,n,r)=>{this.activeState[n]=!1})}checkAllSelected(){(this.selectedParents.length!==this.parents.length||this.selectedPlayers.length!==this.players.length||this.selectedCoaches.length!==this.coaches.length)&&(this.allSelected=!1)}checkAllParentsSelected(){this.selectedParents.length!==this.parents.length&&(this.parentsSelected=!1)}checkAllCoachesSelected(){this.selectedCoaches.length!==this.coaches.length&&(this.coachesSelected=!1)}checkAllPlayersSelected(){this.selectedPlayers.length!==this.players.length&&(this.playersSelected=!1)}ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete()}};d.\u0275fac=function(n){return new(n||d)(C(X),C(H),C(I),C(re),C(Ie),C(E))},d.\u0275cmp=D({type:d,selectors:[["app-team-communication-recipient"]],inputs:{messageThreadID:"messageThreadID",teamID:"teamID",programID:"programID",modalView:"modalView",communicationType:"communicationType"},outputs:{modalClose:"modalClose"},standalone:!1,decls:27,vars:10,consts:[[1,"message-groups","edit-card","p-0",3,"ngClass"],[1,"card-header","p-3","d-flex","justify-content-between","align-items-center"],[1,"btn","btn-naked",3,"click"],[1,"btn","btn-primary","btn-icon-fal-arrow-right-after",3,"click","disabled"],["value","groups"],[1,"pl-3","pr-3","pb-3"],[1,"ml-3"],["type","checkbox","id","all",3,"change","disabled","checked"],["type","checkbox","id","allCoaches",3,"change","disabled","checked"],["type","checkbox","id","allParents",3,"change","disabled","checked"],["type","checkbox","id","allPlayers",3,"change","disabled","checked"],["value","coaches"],[1,"mr-1"],["type","checkbox",3,"change","id","disabled","checked"],["variant","tag"],["value","parents"],["expandIcon","fa-regular fa-chevron-down","collapseIcon","fa-regular fa-chevron-up",1,"p-accordion-naked",3,"multiple"],[3,"value"],[1,"ml-5"],["value","players"]],template:function(n,r){n&1&&(J(0),e(1,`
173    `),s(2,"div",0),e(3,`
174        `),s(4,"div",1),e(5,`
175            `),s(6,"h3"),e(7,"Select Recipients"),o(),e(8,`
176            `),s(9,"span"),e(10,`
177                `),s(11,"button",2),v("click",function(){return r.cancel()}),e(12,"Cancel"),o(),e(13,`
178                `),s(14,"button",3),v("click",function(){return r.next()}),e(15,"Next"),o(),e(16,`
179            `),o(),e(17,`
180        `),o(),e(18,`
181        `),s(19,"p-accordion"),e(20,`
182            `),p(21,wr,23,5),p(22,Dr,15,0),p(23,Mr,18,1),p(24,Rr,15,0),o(),e(25,`
183    `),o(),e(26,`
184`),K()),n&2&&(l(2),ie("col-xl-9",!r.modalView),_("ngClass",L(8,vr,!r.modalView)),l(12),_("disabled",!((r.selectedParents==null?null:r.selectedParents.length)>0||(r.selectedPlayers==null?null:r.selectedPlayers.length)>0||(r.selectedCoaches==null?null:r.selectedCoaches.length)>0||(r.messageService==null||r.messageService.selectedRecipients==null?null:r.messageService.selectedRecipients.length)>0)),l(7),u(r.showGroups?21:-1),l(),u(r.coaches&&r.coaches.length>0?22:-1),l(),u(r.playerParents&&r.playerParents.length>0?23:-1),l(),u(r.players&&r.players.length>0?24:-1))},dependencies:[ue,be,Ti,Si,yi,wi],encapsulation:2});let a=d;return a})();var eo=a=>({highlight:a}),Fr=a=>({"border-bottom":!0,highlight:a}),to=(a,d)=>({"border-bottom":a,highlight:d}),Vr=(a,d)=>d.teamChannelID;function Ar(a,d){a&1&&(e(0,`
185      `),s(1,"div",5),e(2,`
186        `),s(3,"h3",6)(4,"strong"),e(5,"Channels"),o()(),e(6,`
187      `),o(),e(7,`
188    `))}function Nr(a,d){if(a&1&&(e(0,`
189            `),s(1,"div",15),e(2,`
190              `),x(3,"img",16),e(4,`
191            `),o(),e(5,`
192          `)),a&2){let i=m(2);l(3),_("src",i.logoURL,Ue)}}function Lr(a,d){if(a&1&&e(0),a&2){let i=m(2);z(`
193                      `,i.firstName,": ",i.message,`
194                    `)}}function $r(a,d){if(a&1&&(e(0,`
195                    `),p(1,Lr,1,2)),a&2){let i=m();l(),u(i.message?1:-1)}}function Ur(a,d){a&1&&(e(0,`
196                  `),s(1,"i"),e(2,"This message was deleted"),o(),e(3,`
197                `))}function Or(a,d){if(a&1&&(e(0,`
198                `),s(1,"div",17),e(2,`
199                  `),p(3,$r,2,1),p(4,Ur,4,0),o(),e(5,`
200            `)),a&2){let i=d;l(3),u(i.isDeleted?-1:3),l(),u(i.isDeleted?4:-1)}}function Br(a,d){a&1&&(e(0,`
201              `),s(1,"div",17),e(2,"No Messages - Click To Start The Conversation!"),o(),e(3,`
202            `))}
202function jr(a,d){if(a&1&&(e(0,`
203              `),s(1,"div",18),e(2),N(3,"async"),x(4,"i",19),e(5,`
204              `),o(),e(6,`
205            `)),a&2){let i,t=m(2);l(2),w(`
206                `,t.formatMessageDate((i=xe(3,1,t.teamThreadData$))==null?null:i.savedOn),`
207                `)}}function zr(a,d){if(a&1){let i=y();e(0,`
208      `),s(1,"div",7),v("click",function(){g(i);let n=m();return f(n.goToTeamThread())}),e(2,`
209        `),s(3,"div",8),e(4,`
210          `),p(5,Nr,6,1),o(),e(6,`
211        `),s(7,"div",9),e(8,`
212          `),s(9,"div",10),e(10,`
213            `),s(11,"div",11),e(12,`
214              `),s(13,"div",12),e(14,`
215                `),s(15,"div",13),e(16,`
216                  `),s(17,"strong"),e(18,"All Team Chat"),o(),e(19,`
217                `),o(),e(20,`
218              `),o(),e(21,`
219              `),p(22,Or,6,2),N(23,"async"),vn(24,Br,4,0),o(),e(25,`
220          `),s(26,"div",14),e(27,`
221            `),p(28,jr,7,3),N(29,"async"),o(),e(30,`
222        `),o(),e(31,`
223      `),o(),e(32,`
224    `),o(),e(33,`
225  `)}if(a&2){let i,t,n=m();l(3),_("ngClass",L(9,eo,n.viewingTeamThread)),l(2),u(n.logoURL?5:-1),l(2),_("ngClass",L(11,Fr,n.viewingTeamThread)),l(15),u((i=xe(23,5,n.teamThreadData$))?22:24,i),l(6),u((t=xe(29,7,n.teamThreadData$))!=null&&t.message?28:-1)}}function qr(a,d){a&1&&(e(0,`
226    `),s(1,"div",20),e(2,`
227      `),x(3,"span",21),e(4,`
228    `),o(),e(5,`
229  `))}function Wr(a,d){a&1&&e(0,`
230            No channels yet. Click Channel to create one.
231          `)}function Hr(a,d){a&1&&e(0,`
232            No channels yet.
233          `)}function Gr(a,d){if(a&1&&(e(0,`
234      `),s(1,"div",24),e(2,`
235        `),s(3,"div",25),e(4,`
236          `),p(5,Wr,1,0)(6,Hr,1,0),o(),e(7,`
237      `),o(),e(8,`
238    `)),a&2){let i=m(2);l(5),u(i.channelCreationAllowed?5:6)}}function Yr(a,d){a&1&&(e(0,`
239                  `),s(1,"span"),e(2,"All staff"),o(),e(3,`
240                `))}function Qr(a,d){if(a&1&&(e(0,`
241                  `),s(1,"span"),e(2),o(),e(3,`
242                `)),a&2){let i=m().$implicit;l(2),T(i.roleNames.join(", "))}}function Jr(a,d){a&1&&(e(0," "),s(1,"span"),e(2," \xB7 Players"),o(),e(3," "))}function Kr(a,d){a&1&&(e(0," "),s(1,"span"),e(2," \xB7 Parents"),o(),e(3," "))}function Zr(a,d){if(a&1){let i=y();e(0,`
243      `),s(1,"div",26),v("click",function(){let n=g(i).$implicit,r=m(2);return f(r.goToChannel(n))}),e(2,`
244        `),s(3,"div",9),e(4,`
245          `),s(5,"div",27),e(6,`
246            `),s(7,"div",28),e(8,`
247              `),s(9,"div",29),e(10,`
248                `),x(11,"i",30),e(12),o(),e(13,`
249              `),s(14,"div",31),e(15,`
250                `),p(16,Yr,4,0)(17,Qr,4,1),p(18,Jr,4,0),p(19,Kr,4,0),o(),e(20,`
251            `),o(),e(21,`
252            `),s(22,"div",5),e(23,`
253              `),s(24,"button",32),v("click",function(n){let r=g(i).$implicit,c=m(2);return n.stopPropagation(),f(c.editChannel(r))}),e(25,`
254                `),x(26,"i",33),e(27,`
255              `),o(),e(28,`
256              `),s(29,"button",34),v("click",function(n){let r=g(i).$implicit,c=m(2);return n.stopPropagation(),f(c.deleteChannel(r.teamChannelID))}),e(30,`
257                `),x(31,"i",35),e(32,`
258              `),o(),e(33,`
259            `),o(),e(34,`
260          `),o(),e(35,`
261        `),o(),e(36,`
262      `),o(),e(37,`
263    `)}if(a&2){let i=d.$implicit,t=d.$index,n=d.$count,r=m(2);l(3),_("ngClass",pe(5,to,t!==n-1,i.teamChannelID===r.currentTeamChannelID)),l(9),w("",i.name,`
264              `),l(4),u(i.includeAllStaff?16:i.roleNames!=null&&i.roleNames.length?17:-1),l(2),u(i.includePlayers?18:-1),l(),u(i.includeParents?19:-1)}}function Xr(a,d){if(a&1){let i=y();e(0,`
265  `),s(1,"div",1),e(2,`
266    `),s(3,"div",5),e(4,`
267      `),s(5,"h3",6),e(6,"Team Channels"),o(),e(7,`
268    `),o(),e(8,`
269    `),s(9,"div",22),e(10,`
270        `),s(11,"button",23),v("click",function(){g(i);let n=m();return f(n.showCreateChannel=!0)}),e(12,"Channel"),o(),e(13,`
271    `),o(),e(14,`
272  `),o(),e(15,`
273  `),s(16,"section",2),e(17,`
274    `),p(18,Gr,9,1),F(19,Zr,38,8,null,null,Vr),o(),e(21,`
275`)}if(a&2){let i=m();l(18),u(i.channels.length===0?18:-1),l(),V(i.channels)}}function es(a,d){a&1&&(e(0,`
276        `),s(1,"div",5),e(2,`
277          `),s(3,"h3",6),e(4,"Direct Messages"),o(),e(5,`
278        `),o(),e(6,`
279      `))}function ts(a,d){if(a&1&&(e(0,`
280                    `),x(1,"app-user-initials",44),e(2,`
281                  `)),a&2){let i=m().$implicit;l(),_("firstName",i.participants[0].clubUser.user.firstName)("lastName",i.participants[0].clubUser.user.lastName)}}function is(a,d){a&1&&(e(0,`
282                    `),x(1,"app-user-initials",45),e(2,`
283                  `)),a&2&&(l(),_("iconClass","fa fa-user-friends"))}function ns(a,d){if(a&1&&(e(0,`
284                                  `),s(1,"span"),e(2),o(),e(3,`
285                                `)),a&2){let i=m().$implicit;l(2),w("",i.clubUser.user.firstName,",")}}function as(a,d){if(a&1&&(e(0,`
286                                  `),s(1,"span"),e(2),o(),e(3,`
287                                `)),a&2){let i=m().$implicit;l(2),T(i.clubUser.user.firstName)}}function os(a,d){if(a&1&&(e(0,`
288                                `),p(1,ns,4,1),p(2,as,4,1)),a&2){let i=d.$index,t=d.$count;l(),u(i!==t-1&&t>1?1:-1),l(),u(i===t-1||t===1?2:-1)}}function rs(a,d){if(a&1&&(e(0,`
289                              `),F(1,os,3,2,null,null,$)),a&2){let i=m().$implicit;l(),V(i.participants)}}function ss(a,d){if(a&1&&e(0),a&2){let i=m().$implicit;w(`
290                              `,i.title,`
291                            `)}}function ls(a,d){a&1&&(e(0,`
292                            `),s(1,"em"),e(2,"This message was deleted"),o(),e(3,`
293                          `))}function ds(a,d){if(a&1&&e(0),a&2){let i=m(2).$implicit;z(`
294                            `,i.messages[0].sentClubUser.user.firstName,`:
295                            `,i.messages[0].text,`
296                          `)}}function ms(a,d){if(a&1&&(e(0,`
297                        `),s(1,"div",17),e(2,`
298                          `),p(3,ls,4,0)(4,ds,1,2),o(),e(5,`
299                      `)),a&2){let i=m().$implicit;l(3),u(i.messages[0].isDeleted?3:4)}}function cs(a,d){if(a&1&&(e(0,`
300                        `),s(1,"div",46),e(2),x(3,"i",19),e(4,`
301                        `),o(),e(5,`
302                      `)),a&2){let i=m().$implicit,t=m(5);l(2),w(`
303                          `,t.formatMessageDate(i.messages[0].sentDate),`
304                          `)}}function ps(a,d){if(a&1){let i=y();e(0,`
305              `),s(1,"div",7),v("click",function(){let n=g(i).$implicit,r=m(5);return f(r.goToThread(n))}),e(2,`
306                `),s(3,"div",38),e(4,`
307                  `),p(5,ts,3,2)(6,is,3,1),o(),e(7,`
308                `),s(8,"div",9),e(9,`
309                  `),s(10,"div",10),e(11,`
310                    `),s(12,"button",39),v("click",function(n){let r=g(i).$implicit,c=m(5);return n.stopPropagation(),f(c.deleteThread(r.messageThreadID))}),e(13,`
311                      `),x(14,"i",40),e(15,`
312                    `),o(),e(16,`
313                    `),s(17,"div",41),e(18,`
314                      `),s(19,"div",42),e(20,`
315                        `),s(21,"div",43),e(22,`
316                          `),s(23,"strong"),e(24,`
317                            `),p(25,rs,3,0)(26,ss,1,1),o(),e(27,`
318                        `),o(),e(28,`
319                      `),o(),e(29,`
320                      `),p(30,ms,6,1),o(),e(31,`
321                    `),s(32,"div",14),e(33,`
322                      `),p(34,cs,6,1),o(),e(35,`
323                  `),o(),e(36,`
324                `),o(),e(37,`
325              `),o(),e(38,`
326            `)}if(a&2){let i=d.$implicit,t=d.$index,n=d.$count,r=m(5);l(3),_("ngClass",L(6,eo,i.messageThreadID===r.currentMessageThreadID)),l(2),u((i.participants==null?null:i.participants.length)===1?5:6),l(3),_("ngClass",pe(8,to,t!==n-1,i.messageThreadID===r.currentMessageThreadID)),l(17),u(i.title?26:25),l(5),u(i.messages?30:-1),l(4),u(i.messages?34:-1)}}function us(a,d){if(a&1&&(e(0,`
327          `),s(1,"div"),e(2,`
328            `),F(3,ps,39,11,null,null,$),o(),e(5,`
329        `)),a&2){let i=m(4);l(3),V(i.messageService.threads)}}function _s(a,d){if(a&1){let i=y();e(0,`
330          `),s(1,"div",47),e(2,`
331            `),s(3,"div",48),e(4,`
332              Looks like you don't have any conversations started.
333              `),s(5,"a",49),v("click",function(){g(i);let n=m(4);return f(n.startMessage())}),e(6,"Start a new thread"),o(),e(7,`
334            `),o(),e(8,`
335          `),o(),e(9,`
336        `)}}function hs(a,d){if(a&1&&(e(0,`
337        `),p(1,us,6,0)(2,_s,10,0)),a&2){let i=m(3);l(),u(i.messageService.threads&&(i.messageService.threads==null?null:i.messageService.threads.length)>0?1:2)}}function gs(a,d){a&1&&(e(0,`
338        `),s(1,"div",20),e(2,`
339          `),x(3,"span",21),e(4,`
340        `),o(),e(5,`
341      `))}function fs(a,d){if(a&1){let i=y();e(0,`
342    `),s(1,"div",1),e(2,`
343      `),p(3,es,7,0),s(4,"div",22),e(5,`
344        `),s(6,"button",36),v("click",function(){g(i);let n=m(2);return f(n.startMessage())}),e(7,"Chat"),o(),e(8,`
345      `),o(),e(9,`
346    `),o(),e(10,`
347    `),s(11,"section",37),e(12,`
348      `),p(13,hs,3,1)(14,gs,6,0),o(),e(15,`
349  `)}if(a&2){let i=m(2);l(3),u(i.includeHeader?3:-1),l(10),u(i.loadingThreads?14:13)}}function xs(a,d){a&1&&(e(0,`
350    `),s(1,"div",20),e(2,`
351      `),x(3,"span",21),e(4,`
352    `),o(),e(5,`
353  `))}function Cs(a,d){if(a&1&&(e(0,`
354  `),p(1,fs,16,2)(2,xs,6,0)),a&2){let i=m();l(),u(i.loadingThreads?2:1)}}function vs(a,d){if(a&1){let i=y();e(0,`
355      `),s(1,"app-team-communication-recipient",50),v("modalClose",function(n){g(i);let r=m();return f(r.recipientModalClosed(n))}),o(),e(2,`
356    `)}if(a&2){let i=m();l(),_("communicationType",2)("modalView",!0)("teamID",i.teamID)("programID",i.programID)}}function bs(a,d){if(a&1){let i=y();e(0,`
357  `),s(1,"app-yes-no-modal",51),v("onYesSelect",function(){g(i);let n=m();return f(n.confirmDeleteThread())})("onNoSelect",function(){g(i);let n=m();return f(n.cancelDeleteThread())}),o(),e(2,`
358`)}a&2&&(l(),_("headerText","Delete Thread")("modalText","Are you sure you want to delete this thread? This action is irreversible and cannot be undone.")("yesButtonText","Delete")("noButtonText","Cancel")("alertType","warning"))}function Ss(a,d){if(a&1){let i=y();e(0,`
359  `),s(1,"app-team-channel-modal",52),v("saved",function(n){g(i);let r=m();return f(r.onChannelSaved(n))})("cancel",function(){g(i);let n=m();return f(n.cancelChannelModal())})("navigateToChannel",function(n){g(i);let r=m();return f(r.onNavigateToExistingChannel(n))}),e(2,`
360  `),o(),e(3,`
361`)}if(a&2){let i=m();l(),_("teamID",i.teamID)("programID",i.programID)}}function ys(a,d){if(a&1){let i=y();e(0,`
362  `),s(1,"app-team-channel-modal",53),v("saved",function(n){g(i);let r=m();return f(r.onChannelSaved(n))})("cancel",function(){g(i);let n=m();return f(n.cancelChannelModal())}),e(2,`
363  `),o(),e(3,`
364`)}if(a&2){let i=m();l(),_("channelToEdit",i.channelToEdit)}}var Ui=(()=>{let d=class d{constructor(t,n,r,c,h,b,k){this.messageService=t,this.route=n,this.router=r,this.teamService=c,this.channelService=h,this.userService=b,this.siteDataService=k,this.unsubscribe$=new U,this.initialStyleCounter=0,this.loadingThreads=!0,this.showModal=!1,this.viewingTeamThread=!1,this.isClubAdmin=!1,this.channelCreationAllowed=!1,this.showChannels=!1,this.channels=[],this.showCreateChannel=!1,this.showDeleteConfirmation=!1,this.currentMessageThreadID=void 0,this.includeHeader=!0,this.adminView=!1,this.teamThreadData$=this.messageService.teamThreadData$}
364ngOnInit(){this.teamID=+this.route.snapshot.parent.params.id,this.programID=+this.route.snapshot.parent.params.programID,this.messageService.openNewMessageModal$.pipe(S(this.unsubscribe$)).subscribe({next:()=>{this.showModal=!0}}),this.messageService.refreshThreads$.pipe(S(this.unsubscribe$)).subscribe({next:()=>this.loadThreads(),error:t=>{console.error("Error refreshing threads:",t),this.siteDataService.showSiteErrorAlert("Unable to refresh message threads."),this.loadingThreads=!1}}),this.messageService.messageThread$.pipe(S(this.unsubscribe$)).subscribe({next:t=>{t&&(this.currentMessageThreadID=+t.messageThreadID,this.viewingTeamThread=!1)},error:t=>{console.error("Error loading message thread:",t),this.siteDataService.showSiteErrorAlert("Unable to load message thread.")}}),this.messageService.teamThread$.pipe(S(this.unsubscribe$)).subscribe({next:t=>{t&&(this.currentMessageThreadID=void 0,this.viewingTeamThread=t)},error:t=>{console.error("Error loading team thread:",t),this.siteDataService.showSiteErrorAlert("Unable to load team thread.")}}),this.loadThreads(),this.siteDataService.getClubOptions([me.DISABLE_CHANNEL_CREATION]).pipe(S(this.unsubscribe$)).subscribe({next:t=>{this.showChannels=!t.some(n=>n.optionID===me.DISABLE_CHANNEL_CREATION&&n.boolValue===!0),this.showChannels&&this.loadChannels()},error:()=>{this.showChannels=!1}})}loadChannels(){this.channelService.getChannelsForTeam(this.teamID,this.programID).pipe(S(this.unsubscribe$)).subscribe({next:t=>{this.channels=t??[]},error:()=>{this.channels=[]}})}onChannelSaved(t){let n=this.channels.findIndex(r=>r.teamChannelID===t.teamChannelID);n>=0?this.channels[n]=t:this.channels.push(t),this.showCreateChannel=!1,this.channelToEdit=void 0}editChannel(t){this.channelToEdit=t}cancelChannelModal(){this.showCreateChannel=!1,this.channelToEdit=void 0}onNavigateToExistingChannel(t){this.cancelChannelModal(),this.goToChannel(t)}deleteChannel(t){this.channelService.deleteChannel(t).pipe(S(this.unsubscribe$)).subscribe({next:()=>{this.channels=this.channels.filter(n=>n.teamChannelID!==t),this.currentTeamChannelID===t&&(this.currentTeamChannelID=void 0),this.siteDataService.showSiteSuccessAlert("Channel deleted.")},error:()=>this.siteDataService.showSiteErrorAlert("Unable to delete channel.")})}goToChannel(t){if(this.currentTeamChannelID=t.teamChannelID,this.currentMessageThreadID=void 0,this.viewingTeamThread=!1,this.messagesViewComponent)this.messagesViewComponent.viewingTeamChannelID=t.teamChannelID,this.messagesViewComponent.viewingTeamThread=!1,this.messagesViewComponent.currentMessageThreadID=void 0;else{this.messageService.clearChatState(),this.messageService.openTeamChannelIdOnLoad=t.teamChannelID;let n=this.route.snapshot.parent.params.id,r=this.route.snapshot.parent.params.programID;this.router.navigate([`/admin/manage-team/${n}/program/${r}/communication/messages-view`])}}loadThreads(){j({teamThreads:this.adminView?Z(void 0):this.messageService.getMessageThreadsForTeam(this.teamID,this.programID),teamChannel:this.teamService.getTeamMessages(this.teamID,this.programID,1,1),club:this.siteDataService.getClubSettings()}).pipe(S(this.unsubscribe$)).subscribe({next:t=>{t&&(this.messageService.threads=t.teamThreads,this.messageService.setTeamThreadData(t.teamChannel?.results[0]),this.loadingThreads=!1,this.logoURL=t.club.theme.logoURL,this.siteDataService.hideSiteLoader())},error:t=>{console.error("Error loading message threads:",t),this.siteDataService.showSiteErrorAlert("Unable to load message threads."),this.loadingThreads=!1,this.siteDataService.hideSiteLoader()}})}startMessage(){if(this.currentMessageThreadID=void 0,this.viewingTeamThread=!1,this.messageService.forceNewThread=!0,this.messageService.selectedRecipients=[],this.messageService.clearMessageCache(),this.messageService.clearTeamThreadData(),this.messageService.messageThreadUpdated(null),this.router.url.includes("/communication/messages-view"))this.showModal=!0;else{let n=this.route.snapshot.parent.params.id,r=this.route.snapshot.parent.params.programID;this.messageService.shouldOpenNewMessageModalOnLoad=!0,this.router.navigate([`/admin/manage-team/${n}/program/${r}/communication/messages-view`])}}recipientModalClosed(t){this.showModal=!1,t&&(this.messageService.setRecipientList(),this.messageService.forceNewThread=!1,this.messageService.messageThreadUpdated(void 0))}goToThread(t){this.currentTeamChannelID=void 0,this.messageService.forceNewThread=!1,this.messageService.selectedRecipients=[],t.participants.forEac
364h((n,r,c)=>{this.messageService.selectedRecipients.push(St(n.clubUser,n.teamID,n.programID)),r===c.length-1&&(this.messageService.setRecipientList(),this.messageService.loadTeamThread(!1),this.messageService.messageThreadUpdated(t))})}goToTeamThread(){this.adminView||(this.currentTeamChannelID=void 0,this.messageService.loadTeamThread(!0),this.messagesViewComponent&&(this.messagesViewComponent.viewingTeamThread=!0))}isConversationDisabled(){return this.currentMessageThreadID===void 0&&!this.viewingTeamThread}deleteThread(t){this.threadIdToDelete=t,this.showDeleteConfirmation=!0}confirmDeleteThread(){this.threadIdToDelete&&this.messageService.deleteMessageThread(this.teamID,this.threadIdToDelete).pipe(S(this.unsubscribe$)).subscribe({next:()=>{this.messageService.threads=this.messageService.threads.filter(t=>t.messageThreadID!==this.threadIdToDelete),this.currentMessageThreadID=void 0,this.viewingTeamThread=!1,this.messageService.resetMessageThread(),this.showDeleteConfirmation=!1,this.threadIdToDelete=null,this.siteDataService.showSiteSuccessAlert("Thread deleted successfully."),this.messageService.threads&&this.messageService.threads.length>0&&this.goToThread(this.messageService.threads[0])},error:t=>{console.error("Error deleting thread:",t),this.siteDataService.showSiteErrorAlert("Unable to delete thread."),this.showDeleteConfirmation=!1,this.threadIdToDelete=null}})}cancelDeleteThread(){this.showDeleteConfirmation=!1,this.threadIdToDelete=null}formatMessageDate(t){if(!t)return"";let n=sn.default.utc(t).local(),r=(0,sn.default)().startOf("day"),c=n.clone().startOf("day");if(c.isSame(r))return n.format("h:mm a");let h=r.diff(c,"days");return h>0&&h<7?n.format("ddd"):n.format("MM/DD/YY")}ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete()}};d.\u0275fac=function(n){return new(n||d)(C(re),C(I),C(H),C(Je),C(Lt),C(ve),C(E))},d.\u0275cmp=D({type:d,selectors:[["app-message-thread"]],inputs:{teamID:"teamID",programID:"programID",currentMessageThreadID:"currentMessageThreadID",includeHeader:"includeHeader",adminView:"adminView",messagesViewComponent:"messagesViewComponent"},standalone:!1,decls:24,vars:13,consts:[[1,"interior-message-view"],[1,"row","align-items-center","pt-3","m-0"],[1,"mb-4"],["header","Select Recipients","styleClass","standardWidthDialog",3,"visibleChange","visible","showHeader","closable","modal","draggable"],[1,"full-width"],[1,"col-auto"],[1,"text-header-4"],[1,"row","message-thread-wrapper","mb-0","pl-0","pr-0","ml-0","mr-0","flex-nowrap",3,"click"],[1,"col-auto","pt-1","pb-1",3,"ngClass"],[1,"col","pt-2",3,"ngClass"],[1,"row","flex-nowrap"],[1,"col","ml-3","px-0"],[1,"message-label-and-date","row","line-height-md"],[1,"col","truncate","pl-0","fw-600","text-default"],[1,"col-auto","align-self-center"],[1,"logo-wrapper"],["alt","Club Logo",1,"club-logo",3,"src"],[1,"message-content-preview","pb-1"],[1,"text-small","text-grey-lt"],[1,"fa-solid","fa-chevron-right","ml-2"],[1,"full-width","d-flex","justify-content-center"],[1,"spinner-border","spinner-border-sm"],[1,"col","right"],[1,"btn","btn-icon-plus","mb-3","right",3,"click"],[1,"row","m-2"],[1,"col","text-muted","text-small"],[1,"row","message-thread-wrapper","mb-0","pl-0","pr-0","ml-0","mr-0","flex-nowrap",2,"cursor","pointer",3,"click"],[1,"row","flex-nowrap","align-items-center"],[1,"col","px-0","ml-3"],[1,"fw-600","line-clamp-1","text-default"],[1,"fa-regular","fa-hashtag","mr-1","text-primary"],[1,"text-small","text-muted","truncate"],["title","Edit channel",1,"btn","btn-naked","text-muted","btn-sm","mr-1",3,"click"],[1,"fa-regular","fa-pencil"],["title","Delete channel",1,"btn","btn-naked","text-danger","btn-sm",3,"click"],[1,"fa-regular","fa-trash"],[1,"btn","btn-icon-comments","mb-3","right",3,"click"],[1,"mb-4","direct-messages-section"],[1,"ml-3","pt-1","pb-1",3,"ngClass"],["title","Delete this thread","aria-label","Delete this thread",1,"vertical-align","delete-thread-button",3,"click"],[1,"fa-solid","fa-trash"],[1,"col","px-0"],[1,"message-label-and-date","line-height-md"],[1,"col","truncate","pl-0","fw-600"],[3,"firstName","lastName"],[3,"iconClass"],[1,"col-auto","text-small","text-grey-lt"],[1,"row","m-2","border-top"],[1,"col","mb-3"],["href","javascript:void(0);",1,"d-block",3,"click"],[3,"modalClose","communicationType","modalView","teamID","programID"],[3,"onYesSelect","onNoSelect","headerText","modalText","yesButtonText","noButtonText","alertType"],[3,"saved","cancel","navigateToChannel","teamID","programID"],[3,"saved","cancel","channelToEdit"]],template:function(n,r){n&1&&(s(0,"div",0),e(1,`
365  `),s(2,"div",1),e(3,`
366    `),p(4,Ar,8,0),o(),e(5,`
367  `),s(6,"section",2),e(7,`
368    `),p(8,zr,34,13)(9,qr,6,0),o(),e(10,`
369`),p(11,Xr,22,1),p(12,Cs,3,1),o(),e(13,`
370
371`),s(14,"p-dialog",3),R("visibleChange",function(h){return P(r.showModal,h)||(r.showModal=h),h}),e(15,`
372  `),s(16,"div",4),e(17,`
373    `),p(18,vs,3,4),o(),e(19,`
374`),o(),e(20,`
375
376`),p(21,bs,3,5),p(22,Ss,4,2),p(23,ys,4,1)),n&2&&(l(4),u(r.includeHeader?4:-1),l(4),u(r.loadingThreads?9:8),l(3),u(r.showChannels&&!r.adminView?11:-1),l(),u(r.adminView?-1:12),l(2),M("visible",r.showModal),_("showHeader",!0)("closable",!1)("modal",!0)("draggable",!1),l(4),u(r.showModal?18:-1),l(3),u(r.showDeleteConfirmation?21:-1),l(),u(r.showCreateChannel?22:-1),l(),u(r.channelToEdit?23:-1))},dependencies:[ue,Ae,Ci,oe,Li,Ut,Mn],styles:[".direct-messages-section[_ngcontent-%COMP%]{max-height:calc(100vh - 200px);overflow-y:auto}.message-label-and-date[_ngcontent-%COMP%]{margin-bottom:.25rem}.message-thread-wrapper[_ngcontent-%COMP%]{cursor:pointer;transition:all .25s ease-in-out}.message-thread-wrapper[_ngcontent-%COMP%]   .delete-thread-button[_ngcontent-%COMP%]{overflow:hidden;opacity:0;transition:opacity .2s ease-in-out;display:flex;align-items:center;justify-content:center;border:0;background:transparent;cursor:pointer;transition:all .2s ease-in-out;transform:translate3d(0,1em,0) scale(.8)}.message-thread-wrapper[_ngcontent-%COMP%]   .fa-chevron-right[_ngcontent-%COMP%]{transform:translateZ(0);transition:.25s ease-in-out}.message-thread-wrapper[_ngcontent-%COMP%]:hover{background-color:#f0f8ff}.message-thread-wrapper[_ngcontent-%COMP%]:hover   .fa-chevron-right[_ngcontent-%COMP%]{transform:translate3d(10px,0,0)}.message-thread-wrapper[_ngcontent-%COMP%]   .highlight[_ngcontent-%COMP%]{background-color:#f0f8ff}.message-thread-wrapper[_ngcontent-%COMP%]   .highlight[_ngcontent-%COMP%]   .delete-thread-button[_ngcontent-%COMP%]{opacity:1;transform:translateZ(0) scale(.8)}.message-thread-wrapper[_ngcontent-%COMP%]   .highlight[_ngcontent-%COMP%]   .fa-chevron-right[_ngcontent-%COMP%]{transform:translate3d(10px,0,0)}.message-thread-wrapper[_ngcontent-%COMP%]   .highlight[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]:hover{color:var(--red-700);transform:translateZ(0) scale(1)}.logo-wrapper[_ngcontent-%COMP%]{max-width:3rem;height:3rem;display:flex;align-items:center;justify-content:center}.club-logo[_ngcontent-%COMP%]{max-height:3rem;display:block}.message-content-preview[_ngcontent-%COMP%]{text-overflow:ellipsis;overflow:hidden;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical}"]});let a=d;return a})();var ln=a=>({"border-bottom":a});function Ts(a,d){a&1&&e(0,`
377                                ,
378                                `)}function Ds(a,d){if(a&1&&(e(0,`
379                            `),s(1,"span"),e(2),p(3,Ts,1,0),o(),e(4,`
380                            `)),a&2){let i=d.$implicit,t=d.$index,n=d.$count,r=m(2).$implicit,c=m(4);l(2),w(`
381                                `,!(i.clubUser==null||i.clubUser.user==null)&&i.clubUser.user.firstName?(i.clubUser==null||i.clubUser.user==null?null:i.clubUser.user.firstName)+" "+((i.clubUser==null||i.clubUser.user==null?null:i.clubUser.user.lastName)||""):i.emailAddress?i.emailAddress:i.teamName?i.teamName+c.getEmailTo(r):i.userGroupName),l(),u(t!==n-1?3:-1)}}function Es(a,d){if(a&1&&(e(0,`
382                        `),s(1,"strong"),e(2,`
383                            `),F(3,Ds,5,2,null,null,$),o(),e(5,`
384                        `)),a&2){let i=m().$implicit;l(3),V(i.to)}}function Is(a,d){if(a&1&&(e(0,`
385                        `),s(1,"strong"),e(2,`
386                            `),s(3,"span"),e(4),o(),e(5,`
387                        `),o(),e(6,`
388                        `)),a&2){let i=m().$implicit;l(4),w("Additional Recipients: ",i.toAddress)}}function Ms(a,d){if(a&1&&(e(0),N(1,"utcDate"),N(2,"utcDate")),a&2){let i=m().$implicit;z(`
389                        `,B(1,2,i.sentDate,"h:mm"),"",B(2,5,i.sentDate,"a"),`
390                        `)}}function Ps(a,d){if(a&1&&(e(0),N(1,"utcDate")),a&2){let i=m().$implicit;w(`
391                        `,B(1,1,i.sentDate,"M/d"),`
392                        `)}}function Rs(a,d){if(a&1){let i=y();e(0,`
393            `),s(1,"div",6),v("click",function(){let n=g(i).$implicit,r=m(4);return f(r.goToEmail(n,!0))}),e(2,`
394                `),s(3,"div",7),e(4,`
395                    `),s(5,"div",8),e(6,`
396                        `),p(7,Es,6,0),p(8,Is,7,1),o(),e(9,`
397                    `),s(10,"div",9),e(11,`
398                        `),p(12,Ms,3,8)(13,Ps,2,4),o(),e(14,`
399                `),o(),e(15,`
400                `),s(16,"div",7),e(17,`
401                    `),s(18,"div",10),e(19,`
402                        `),s(20,"span",11),e(21,`
403                            `),J(22),e(23),K(),e(24,`
404                        `),o(),e(25,`
405                    `),o(),e(26,`
406                `),o(),e(27,`
407            `),o(),e(28,`
408            `)}if(a&2){let i=d.$implicit,t=d.$index,n=d.$count,r=m(4);l(),_("ngClass",L(5,ln,t!==n-1)),l(6),u((i.to==null?null:i.to.length)>0?7:-1),l(),u((i.toAddress==null?null:i.toAddress.length)>0?8:-1),l(4),u(r.messageService.isToday(i.sentDate)?12:13),l(11),w(`
409                                `,i.subject||"(no subject)",`
410                            `)}}function ks(a,d){if(a&1&&(e(0,`
411            `),F(1,Rs,29,7,null,null,$)),a&2){let i=m(3);l(),V(i.sentEmails)}}function Fs(a,d){a&1&&(e(0,`
412            `),s(1,"div",12),e(2,`
413                `),s(3,"div",10),e(4,`
414                    `),s(5,"app-inline-alert",13),e(6,"You haven't sent any emails yet."),o(),e(7,`
415                `),o(),e(8,`
416            `),o(),e(9,`
417            `)),a&2&&(l(5),_("isInline",!0))}function Vs(a,d){if(a&1&&(e(0,`
418            `),p(1,ks,3,0)(2,Fs,10,1)),a&2){let i=m(2);l(),u(i.sentEmails&&i.sentEmails.length>0?1:2)}}function As(a,d){a&1&&(e(0,`
419            `),s(1,"div",14),e(2,`
420                `),s(3,"span",15),e(4,`
421                `),o(),e(5,`
422            `),o(),e(6,`
423            `))}function Ns(a,d){a&1&&e(0,`
424                                ,
425                                `)}function Ls(a,d){if(a&1&&(e(0,`
426                            `),s(1,"span"),e(2),p(3,Ns,1,0),o(),e(4,`
427                            `)),a&2){let i=d.$implicit,t=d.$index,n=d.$count,r=m(2).$implicit,c=m(4);l(2),w(`
428                                `,!(i.clubUser==null||i.clubUser.user==null)&&i.clubUser.user.firstName?(i.clubUser==null||i.clubUser.user==null?null:i.clubUser.user.firstName)+" "+((i.clubUser==null||i.clubUser.user==null?null:i.clubUser.user.lastName)||""):i.emailAddress?i.emailAddress:i.teamName?i.teamName+c.getEmailTo(r):i.userGroupName),l(),u(t!==n-1?3:-1)}}function $s(a,d){if(a&1&&(e(0,`
429                        `),s(1,"strong"),e(2,`
430                            `),F(3,Ls,5,2,null,null,$),o(),e(5,`
431                        `)),a&2){let i=m().$implicit;l(3),V(i.to)}}function Us(a,d){if(a&1&&(e(0,`
432                        `),s(1,"strong"),e(2,`
433                            `),s(3,"span"),e(4),o(),e(5,`
434                        `),o(),e(6,`
435                        `)),a&2){let i=m().$implicit;l(4),w("Additional Recipients: ",i.toAddress)}}function Os(a,d){if(a&1){let i=y();e(0,`
436            `),s(1,"div",6),v("click",function(){let n=g(i).$implicit,r=m(4);return f(r.goToEmail(n,!1))}),e(2,`
437                `),s(3,"div",7),e(4,`
438                    `),s(5,"div",8),e(6,`
439                        `),p(7,$s,6,0),p(8,Us,7,1),o(),e(9,`
440                    `),s(10,"div",9),e(11),N(12,"utcDate"),o(),e(13,`
441                `),o(),e(14,`
442                `),s(15,"div",7),e(16,`
443                    `),s(17,"div",10),e(18,`
444                        `),s(19,"span",11),e(20,`
445                            `),J(21),e(22),K(),e(23,`
446                        `),o(),e(24,`
447                    `),o(),e(25,`
448                `),o(),e(26,`
449            `),o(),e(27,`
450            `)}if(a&2){let i=d.$implicit,t=d.$index,n=d.$count;l(),_("ngClass",L(8,ln,t!==n-1)),l(6),u((i.to==null?null:i.to.length)>0?7:-1),l(),u((i.toAddress==null?null:i.toAddress.length)>0?8:-1),l(3),w(`
451                        `,B(12,5,i.sendAt,"M/d/yyy h:mm a"),`
452                    `),l(11),w(`
453                                `,i.subject||"(no subject)",`
454                            `)}}function Bs(a,d){if(a&1&&(e(0,`
455            `),F(1,Os,28,10,null,null,$)),a&2){let i=m(3);l(),V(i.scheduledEmails)}}function js(a,d){a&1&&(e(0,`
456            `),s(1,"div",12),e(2,`
457                `),s(3,"div",10),e(4,`
458                    `),s(5,"app-inline-alert",13),e(6,"You haven't scheduled any emails yet."),o(),e(7,`
459                `),o(),e(8,`
460            `),o(),e(9,`
461            `)),a&2&&(l(5),_("isInline",!0))}function zs(a,d){if(a&1&&(e(0,`
462            `),p(1,Bs,3,0)(2,js,10,1)),a&2){let i=m(2);l(),u(i.scheduledEmails&&i.scheduledEmails.length>0?1:2)}}function qs(a,d){a&1&&(e(0,`
463            `),s(1,"div",14),e(2,`
464                `),s(3,"span",15),e(4,`
465                `),o(),e(5,`
466            `),o(),e(6,`
467            `))}function Ws(a,d){if(a&1&&(e(0),N(1,"utcDate"),N(2,"utcDate")),a&2){let i=m().$implicit;z(`
468                        `,B(1,2,i.savedOn,"h:mm"),"",B(2,5,i.savedOn,"a"),`
469                        `)}}function Hs(a,d){if(a&1&&(e(0),N(1,"utcDate")),a&2){let i=m().$implicit;w(`
470                        `,B(1,1,i.savedOn,"M/d"),`
471                        `)}}function Gs(a,d){if(a&1){let i=y();e(0,`
472            `),s(1,"div",6),v("click",function(){let n=g(i).$implicit,r=m(4);return f(r.goToEmail(n,!1))}),e(2,`
473                `),s(3,"div",0),e(4,`
474                    `),s(5,"div",10),e(6,`
475                        `),s(7,"strong")(8,"span"),e(9),o()(),e(10,`
476                    `),o(),e(11,`
477                    `),s(12,"div",16),e(13,`
478                        `),p(14,Ws,3,8)(15,Hs,2,4),o(),e(16,`
479                `),o(),e(17,`
480            `),o(),e(18,`
481            `)}if(a&2){let i=d.$implicit,t=d.$index,n=d.$count,r=m(4);l(),_("ngClass",L(3,ln,t!==n-1)),l(8),T(i.subject||"(no subject)"),l(5),u(r.messageService.isToday(i.savedOn)?14:15)}}function Ys(a,d){if(a&1&&(e(0,`
482            `),F(1,Gs,19,5,null,null,$)),a&2){let i=m(3);l(),V(i.drafts)}}function Qs(a,d){a&1&&(e(0,`
483            `),s(1,"div",12),e(2,`
484                `),s(3,"div",10),e(4,`
485                    `),s(5,"app-inline-alert",13),e(6,"You haven't created any email drafts yet."),o(),e(7,`
486                `),o(),e(8,`
487            `),o(),e(9,`
488            `)),a&2&&(l(5),_("isInline",!0))}function Js(a,d){if(a&1&&(e(0,`
489            `),p(1,Ys,3,0)(2,Qs,10,1)),a&2){let i=m(2);l(),u(i.drafts&&i.drafts.length>0?1:2)}}function Ks(a,d){a&1&&(e(0,`
490            `),s(1,"div",14),e(2,`
491                `),s(3,"span",15),e(4,`
492                `),o(),e(5,`
493            `),o(),e(6,`
494            `))}function Zs(a,d){if(a&1&&(e(0,`
495`),s(1,"p-tabs",5),e(2,`
496    `),s(3,"p-tablist"),e(4,`
497        `),s(5,"p-tab",5),e(6,"Sent"),o(),e(7,`
498        `),s(8,"p-tab",5),e(9,"Scheduled"),o(),e(10,`
499        `),s(11,"p-tab",5),e(12,"Drafts"),o(),e(13,`
500    `),o(),e(14,`
501    `),s(15,"p-tabpanels"),e(16,`
502        `),s(17,"p-tabpanel",5),e(18,`
503            `),p(19,Vs,3,1)(20,As,7,0),o(),e(21,`
504        `),s(22,"p-tabpanel",5),e(23,`
505            `),p(24,zs,3,1)(25,qs,7,0),o(),e(26,`
506        `),s(27,"p-tabpanel",5),e(28,`
507            `),p(29,Js,3,1)(30,Ks,7,0),o(),e(31,`
508    `),o(),e(32,`
509`),o(),e(33,`
510`)),a&2){let i=m();l(),_("value",0),l(4),_("value",0),l(3),_("value",1),l(3),_("value",2),l(6),_("value",0),l(2),u(i.loading?20:19),l(3),_("value",1),l(2),u(i.loading?25:24),l(3),_("value",2),l(2),u(i.loading?30:29)}}var io=(()=>{let d=class d{constructor(t,n,r,c){this.router=t,this.userService=n,this.route=r,this.messageService=c,this.unsubscribe$=new U,this.sentEmails=[],this.scheduledEmails=[],this.drafts=[],this.loading=!0,this.emailRecipientType=Ge}ngOnInit(){j({sent:this.userService.getUserEmailsSentToTeam(this.teamID),scheduled:this.userService.getUserScheduledEmails(this.teamID),drafts:this.userService.getUserEmailDrafts(this.teamID)}).pipe(S(this.unsubscribe$)).subscribe(t=>{this.sentEmails=t.sent,this.scheduledEmails=t.scheduled,this.drafts=t.drafts,this.loading=!1})}composeNewEmail(){this.messageService.selectedRecipients=[],this.router.navigate(["email-compose"],{relativeTo:this.route})}goToEmail(t,n){this.router.navigate(["email-compose"],{relativeTo:this.route,queryParams:{emailLogID:t.emailLogID,viewOnly:n}})}getEmailTo(t){if(t.sendTo)switch(t.sendTo){case Ge.ALL:return" (All Members) ";case Ge.PARENTS_AND_PLAYERS:return" (Parents and Players) ";case Ge.PARENTS_ONLY:return" (Parents Only) ";case Ge.PLAYERS_ONLY:return" (Players and Parents) ";case Ge.STAFF_ONLY:return" (Staff Only) ";case Ge.TEAM_CAPTAINS_ONLY:return" (Captains Only) ";default:return""}return""}ngOnDestroy(){this.unsubscribe$.next(null),this.unsubscribe$.complete()}};d.\u0275fac=function(n){return new(n||d)(C(H),C(ve),C(I),C(re))},d.\u0275cmp=D({type:d,selectors:[["app-team-email"]],inputs:{teamID:"teamID"},standalone:!1,decls:19,vars:1,consts:[[1,"row","align-items-center"],[1,"col-auto"],[1,"admin-heading"],[1,"col","right"],[1,"btn","btn-icon-edit","mb-3",3,"click"],[3,"value"],[1,"email-row","p-2",3,"click","ngClass"],[1,"row"],[1,"col","truncate"],[1,"col-auto","text-small","text-grey-lt"],[1,"col"],[1,"text-grey-lt"],[1,"email-row","p-2"],[3,"isInline"],[1,"full-width","d-flex","justify-content-center"],[1,"spinner-border","spinner-border-sm"],[1,"col-auto","text-small"]],template:function(n,r){n&1&&(s(0,"div",0),e(1,`
511    `),s(2,"div",1),e(3,`
512        `),s(4,"h2",2),e(5,"Team Email"),o(),e(6,`
513    `),o(),e(7,`
514    `),s(8,"div",3),e(9,`
515        `),s(10,"button",4),v("click",function(){return r.composeNewEmail()}),e(11,`
516            `),s(12,"span"),e(13,"Email"),o(),e(14,`
517        `),o(),e(15,`
518    `),o(),e(16,`
519`),o(),e(17,`
520`),p(18,Zs,34,10)),n&2&&(l(18),u(r.loading?-1:18))},dependencies:[ue,ce,ca,ha,_a,pa,ua,Ve],styles:[".email-tabs[_ngcontent-%COMP%]   .p-tabview-panels[_ngcontent-%COMP%]{min-height:10rem;background:var(--grey-50);padding:0;border-right:none;border-left:none;border-bottom:none}.email-row[_ngcontent-%COMP%]{background:var(--grey-50);cursor:pointer}.email-row[_ngcontent-%COMP%]:hover{background:#f0f8ff}"]});let a=d;return a})();var no=(()=>{let d=class d{constructor(t,n,r,c,h){this.siteDataService=t,this.route=n,this.router=r,this.messageService=c,this.manageTeamService=h,this.firstPageLoad=!0,this.unsubscribe$=new U}
520ngOnInit(){this.teamID=+this.route.snapshot.parent.params.id,this.siteDataService.hideSiteLoader(),this.manageTeamService.activeTab="communication",this.messageService.messageThread$.pipe(S(this.unsubscribe$)).subscribe(t=>{this.firstPageLoad||t&&this.router.navigate(["messages-view"],{relativeTo:this.route}),this.firstPageLoad=!1}),this.messageService.teamThread$.pipe(S(this.unsubscribe$)).subscribe(t=>{this.firstPageLoad||t&&this.router.navigate(["messages-view"],{relativeTo:this.route}),this.firstPageLoad=!1})}ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete(),this.firstPageLoad=!0}};d.\u0275fac=function(n){return new(n||d)(C(E),C(I),C(H),C(re),C(ee))},d.\u0275cmp=D({type:d,selectors:[["app-communication"]],standalone:!1,decls:19,vars:2,consts:[[1,"row"],[1,"col-6"],[1,"card","p-0"],[3,"includeHeader"],[1,"card"],[3,"teamID"]],template:function(n,r){n&1&&(s(0,"div",0),e(1,`
521  `),s(2,"div",1),e(3,`
522    `),s(4,"div",2),e(5,`
523      `),x(6,"app-message-thread",3),e(7,`
524    `),o(),e(8,`
525  `),o(),e(9,`
526  `),s(10,"div",1),e(11,`
527    `),s(12,"div",4),e(13,`
528      `),x(14,"app-team-email",5),e(15,`
529    `),o(),e(16,`
530  `),o(),e(17,` 
531`),o(),e(18,`
532`)),n&2&&(l(6),_("includeHeader",!0),l(8),_("teamID",r.teamID))},dependencies:[Ui,io],encapsulation:2});let a=d;return a})();var ao=(()=>{let d=class d{constructor(t,n,r,c){this.route=t,this.router=n,this.siteDataService=r,this.messageService=c,this.EmailCategoryLV=Aa,this.viewOnly=!1}ngOnInit(){this.teamID=+this.route.snapshot.parent.params.id,this.programID=+this.route.snapshot.parent.params.programID,this.route.queryParams.subscribe(t=>{this.emailLogID=+t.emailLogID,this.viewOnly=t.viewOnly==="true",this.messageService.getTeamRecipients(this.teamID,this.programID).subscribe(n=>{if(n){let r=[];n.parents.forEach(c=>{c.recipients.forEach(h=>{r.push(h)})}),this.viewOnly||(this.initialRecipients=[...n.coaches,...r,...n.players])}})}),this.siteDataService.hideSiteLoader()}navBack(){this.router.navigate([`/admin/manage-team/${this.teamID}/program/${this.programID}/communication/`])}};d.\u0275fac=function(n){return new(n||d)(C(I),C(H),C(E),C(re))},d.\u0275cmp=D({type:d,selectors:[["ng-component"]],standalone:!1,decls:1,vars:9,consts:[[3,"cancel","send","viewOnly","showHeader","recipients","emailCategoryID","emailLogID","showSaveDraftButton","teamID","programID","showSteps"]],template:function(n,r){n&1&&(s(0,"app-email-compose",0),v("cancel",function(){return r.navBack()})("send",function(){return r.navBack()}),o()),n&2&&_("viewOnly",r.viewOnly)("showHeader",!1)("recipients",r.initialRecipients)("emailCategoryID",r.EmailCategoryLV.TEAM_NOTIFICATIONS)("emailLogID",r.emailLogID)("showSaveDraftButton",!0)("teamID",r.teamID)("programID",r.programID)("showSteps",!1)},dependencies:[Ua],encapsulation:2});let a=d;return a})();var il=["optionsMenu"],nl=()=>({width:"auto"}),al=(a,d,i)=>({"border-bottom":a,"py-2":d,"pb-2":i}
532),ro=(a,d)=>[a,"players",d],ol=a=>["ranking",a],rl=a=>["rating",a];function sl(a,d){a&1&&(e(0,`
533                                        `),x(1,"app-button-loader"),e(2,`
534                                        `),s(3,"span"),e(4,"Notifying..."),o(),e(5,`
535                                        `))}function ll(a,d){a&1&&e(0,`
536                                        Notify Completed Forms
537                                        `)}function dl(a,d){if(a&1){let i=y();e(0,`
538                                `),s(1,"div",25),e(2,`
539                                    `),s(3,"button",26),v("click",function(n){g(i);let r=m().$implicit;return m(2).notifyCompleted(r.surveyID),f(n.stopPropagation())}),e(4,`
540                                        `),p(5,sl,6,0)(6,ll,1,0),o(),e(7,`
541                                `),o(),e(8,`
542                                `)}if(a&2){let i=m().$implicit,t=m(2);l(3),ie("btn-icon-paper-plane",t.notifyingSurveyID!==i.surveyID),_("disabled",t.notifyingSurveyID===i.surveyID),l(2),u(t.notifyingSurveyID===i.surveyID?5:6)}}function ml(a,d){a&1&&(e(0,`
543                                `),s(1,"div",27),e(2,`
544                                    `),x(3,"i",28),e(4,`
545                                `),o(),e(5,`
546                                `))}function cl(a,d){if(a&1&&(e(0,`
547                                `),p(1,ml,6,0)),a&2){let i=m().$implicit;l(),u(i.isComplete?1:-1)}}function pl(a,d){if(a&1&&(e(0,`
548                            `),s(1,"div",3),e(2,`
549                                `),s(3,"div",29),e(4,`
550                                    `),s(5,"strong"),e(6),o(),e(7,`
551                                `),o(),e(8,`
552                                `),s(9,"div",30),e(10,`
553                                    `),s(11,"span",31),e(12,"Players Notified"),o(),e(13,`
554                                `),o(),e(14,`
555                            `),o(),e(15,`
556                            `),s(16,"div",32),e(17,`
557                                `),s(18,"p-progressBar",33),e(19,`
558                                `),o(),e(20,`
559                            `),o(),e(21,`
560                            `)),a&2){let i=m(2).$implicit;l(6),w("",i.reviewNotifiedPercentage,"%"),l(12),_("value",i.reviewNotifiedPercentage)("showValue",!1)}}function ul(a,d){if(a&1&&(e(0,`
561                            `),s(1,"div",3),e(2,`
562                                `),s(3,"div",29),e(4,`
563                                    `),s(5,"strong"),e(6),o(),e(7,`
564                                `),o(),e(8,`
565                                `),s(9,"div",30),e(10,`
566                                    `),s(11,"span",31),e(12,`
567                                        Player Responses Received
568                                    `),o(),e(13,`
569                                `),o(),e(14,`
570                            `),o(),e(15,`
571                            `),s(16,"div",32),e(17,`
572                                `),s(18,"p-progressBar",33),e(19,`
573                                `),o(),e(20,`
574                            `),o(),e(21,`
575                            `),s(22,"div",3),e(23,`
576                                `),s(24,"div",29),e(25,`
577                                    `),s(26,"strong"),e(27),o(),e(28,`
578                                `),o(),e(29,`
579                                `),s(30,"div",30),e(31,`
580                                    `),s(32,"span",31),e(33,"Coach Reviews Completed"),o(),e(34,`
581                                `),o(),e(35,`
582                            `),o(),e(36,`
583                            `),s(37,"div",32),e(38,`
584                                `),s(39,"p-progressBar",33),e(40,`
585                                `),o(),e(41,`
586                            `),o(),e(42,`
587                            `),p(43,pl,22,3)),a&2){let i=m().$implicit;l(6),w("",i.userSubmissionPercentage,"%"),l(12),_("value",i.userSubmissionPercentage)("showValue",!1),l(9),w("",i.userReviewPercentage,"%"),l(12),_("value",i.userReviewPercentage)("showValue",!1),l(4),u(i.showNotifiedStatus?43:-1)}}function _l(a,d){if(a&1&&(e(0,`
588                            `),s(1,"div",3),e(2,`
589                                `),s(3,"div",29),e(4,`
590                                    `),s(5,"strong"),e(6),o(),e(7,`
591                                `),o(),e(8,`
592                                `),s(9,"div",30),e(10,`
593                                    `),s(11,"span",31),e(12,"Players Notified"),o(),e(13,`
594                                `),o(),e(14,`
595                            `),o(),e(15,`
596                            `),s(16,"div",32),e(17,`
597                                `),s(18,"p-progressBar",33),e(19,`
598                                `),o(),e(20,`
599                            `),o(),e(21,`
600                            `)),a&2){let i=m(2).$implicit;l(6),w("",i.responseNotifiedPercentage,"%"),l(12),_("value",i.responseNotifiedPercentage)("showValue",!1)}}function hl(a,d){if(a&1&&(e(0,`
601                            `),s(1,"div",3),e(2,`
602                                `),s(3,"div",29),e(4,`
603                                    `),s(5,"strong"),e(6),o(),e(7,`
604                                `),o(),e(8,`
605                                `),s(9,"div",30),e(10,`
606                                    `),s(11,"span",31),e(12,`
607                                        Coach Reviews Completed
608                                    `),o(),e(13,`
609                                `),o(),e(14,`
610                            `),o(),e(15,`
611                            `),s(16,"div",32),e(17,`
612                                `),s(18,"p-progressBar",33),e(19,`
613                                `),o(),e(20,`
614                            `),o(),e(21,`
615                            `),p(22,_l,22,3)),a&2){let i=m().$implicit;l(6),w("",i.userSubmissionPercentage,"%"),l(12),_("value",i.userSubmissionPercentage)("showValue",!1),l(4),u(i.showNotifiedStatus?22:-1)}}function gl(a,d){if(a&1&&e(0),a&2){let i=m().$implicit;w(`
616                                    #`,i.playerNumber,`
617                                    `)}}function fl(a,d){a&1&&(e(0,`
618                                        `),s(1,"app-status-indicator",42),e(2,`
619                                        `),o(),e(3,`
620                                        `)),a&2&&(l(),_("dots",!0))}function xl(a,d){a&1&&(e(0,`
621                                        `),s(1,"app-status-indicator",43),e(2,`
622                                        `),o(),e(3,`
623                                        `)),a&2&&(l(),_("dots",!0))}function Cl(a,d){a&1&&(e(0,`
624                                        `),s(1,"app-status-indicator",44),e(2,`
625                                        `),o(),e(3,`
626                                        `)),a&2&&(l(),_("dots",!0))}function vl(a,d){if(a&1&&(e(0,`
627                                        `),p(1,xl,4,1),p(2,Cl,4,1)),a&2){let i=m(2).$implicit;l(),u(i.responseSubmissionDate?-1:1),l(),u(i.responseSubmissionDate?2:-1)}}function bl(a,d){a&1&&(e(0,`
628                                        `),s(1,"app-status-indicator",45),e(2,`
629                                        `),o(),e(3,`
630                                        `)),a&2&&(l(),_("dots",!0))}function Sl(a,d){a&1&&(e(0,`
631                                        `),s(1,"app-status-indicator",46),e(2,`
632                                        `),o(),e(3,`
633                                        `)),a&2&&(l(),_("dots",!0))}function yl(a,d){a&1&&(e(0,`
634                                        `),s(1,"app-status-indicator",47),e(2,`
635                                        `),o(),e(3,`
636                                        `)),a&2&&(l(),_("dots",!0))}function wl(a,d){a&1&&(e(0,`
637                                        `),s(1,"app-status-indicator",48),e(2,`
638                                        `),o(),e(3,`
639                                        `)),a&2&&(l(),_("dots",!0))}function Tl(a,d){if(a&1&&(e(0,`
640                                        `),p(1,yl,4,1),p(2,wl,4,1)),a&2){let i=m(4).$implicit;l(),u(i.reviewNotifiedDate?-1:1),l(),u(i.reviewNotifiedDate?2:-1)}}function Dl(a,d){a&1&&(e(0,`
641                                        `),s(1,"app-status-indicator",49),e(2,`
642                                        `),o(),e(3,`
643                                        `)),a&2&&(l(),_("dots",!0))}function El(a,d){if(a&1&&(e(0,`
644                                        `),p(1,Tl,3,2),p(2,Dl,4,1)),a&2){let i=m(4).$implicit;l(),u(i.showNotifiedStatus?1:-1),l(),u(i.showNotifiedStatus?-1:2)}}function Il(a,d){if(a&1&&(e(0,`
645                                        `),p(1,Sl,4,1),p(2,El,3,2)),a&2){let i=m(2).$implicit;l(),u(i.reviewCompletedDate?-1:1),l(),u(i.reviewCompletedDate?2:-1)}}function Ml(a,d){if(a&1&&(e(0,`
646                                    `),s(1,"div",32),e(2,`
647                                        `),p(3,fl,4,1),p(4,vl,3,2),o(),e(5,`
648                                    `),s(6,"div",32),e(7,`
649                                        `),p(8,bl,4,1),p(9,Il,3,2),o(),e(10,`
650                                    `)),a&2){let i=m().$implicit;l(3),u(i.surveyResponseID?-1:3),l(),u(i.surveyResponseID?4:-1),l(4),u(i.surveyReviewID?-1:8),l(),u(i.surveyReviewID?9:-1)}}function Pl(a,d){a&1&&(e(0,`
651                                        `),s(1,"app-status-indicator",50),e(2,`
652                                        `),o(),e(3,`
653                                        `)),a&2&&(l(),_("dots",!0))}function Rl(a,d){a&1&&(e(0,`
654                                        `),s(1,"app-status-indicator",51),e(2,`
655                                        `),o(),e(3,`
656                                        `)),a&2&&(l(),_("dots",!0))}function kl(a,d){a&1&&(e(0,`
657                                        `),s(1,"app-status-indicator",52),e(2,`
658                                        `),o(),e(3,`
659                                        `)),a&2&&(l(),_("dots",!0))}function Fl(a,d){a&1&&(e(0,`
660                                        `),s(1,"app-status-indicator",53),e(2,`
661                                        `),o(),e(3,`
662                                        `)),a&2&&(l(),_("dots",!0))}function Vl(a,d){if(a&1&&(e(0,`
663                                        `),p(1,kl,4,1),p(2,Fl,4,1)),a&2){let i=m(4).$implicit;l(),u(i.responseNotifiedDate?-1:1),l(),u(i.responseNotifiedDate?2:-1)}}function Al(a,d){a&1&&(e(0,`
664                                        `),s(1,"app-status-indicator",54),e(2,`
665                                        `),o(),e(3,`
666                                        `)),a&2&&(l(),_("dots",!0))}function Nl(a,d){if(a&1&&(e(0,`
667                                        `),p(1,Vl,3,2),p(2,Al,4,1)),a&2){let i=m(4).$implicit;l(),u(i.showNotifiedStatus?1:-1),l(),u(i.showNotifiedStatus?-1:2)}}function Ll(a,d){if(a&1&&(e(0,`
668                                        `),p(1,Rl,4,1),p(2,Nl,3,2)),a&2){let i=m(2).$implicit;l(),u(i.responseSubmissionDate?-1:1),l(),u(i.responseSubmissionDate?2:-1)}}function $l(a,d){if(a&1&&(e(0,`
669                                    `),s(1,"div",32),e(2,`
670                                        `),p(3,Pl,4,1),p(4,Ll,3,2),o(),e(5,`
671                                    `)),a&2){let i=m().$implicit;l(3),u(i.surveyResponseID?-1:3),l(),u(i.surveyResponseID?4:-1)}}function Ul(a,d){a&1&&Zi(0)}function Ol(a,d){if(a&1&&(e(0,`
672                                    `),s(1,"a",55),e(2,`
673                                        `),A(3,Ul,1,0,"ng-container",56),e(4,`
674                                    `),o(),e(5,`
675                                    `)),a&2){let i=m().$implicit,t=
675Re(29),n=m().$implicit;l(),_("routerLink",pe(2,ro,n.surveyID,i.playerID)),l(2),_("ngTemplateOutlet",t)}}function Bl(a,d){a&1&&Zi(0)}function jl(a,d){if(a&1&&(e(0,`
676                                    `),s(1,"a",55),e(2,`
677                                        `),A(3,Bl,1,0,"ng-container",56),e(4,`
678                                    `),o(),e(5,`
679                                    `)),a&2){let i=m().$implicit,t=Re(29),n=m().$implicit;l(),_("routerLink",pe(2,ro,n.surveyID,i.playerID)),l(2),_("ngTemplateOutlet",t)}}function zl(a,d){a&1&&e(0,`
680                                        Edit
681                                        `)}function ql(a,d){a&1&&e(0,`
682                                        View
683                                        `)}function Wl(a,d){if(a&1&&(e(0,`
684                                        `),p(1,zl,1,0),p(2,ql,1,0)),a&2){let i=m(2).$implicit;l(),u(i.isActive?1:-1),l(),u(i.isActive?-1:2)}}function Hl(a,d){if(a&1&&(e(0,`
685                            `),s(1,"div",34),e(2,`
686                                `),s(3,"div",35),e(4,`
687                                    `),s(5,"span",36),e(6,`
688                                        `),s(7,"app-player-profile-photo",37),e(8,`
689                                        `),o(),e(9,`
690                                    `),o(),e(10,`
691                                    `),s(11,"span",38),e(12),o(),e(13,`
692                                `),o(),e(14,`
693                                `),s(15,"div",39),e(16,`
694                                    `),p(17,gl,1,1),o(),e(18,`
695                                `),s(19,"div",40),e(20,`
696                                    `),p(21,Ml,11,4),p(22,$l,6,2),o(),e(23,`
697                                `),s(24,"div",41),e(25,`
698                                    `),p(26,Ol,6,5),p(27,jl,6,5),A(28,Wl,3,2,"ng-template",null,2,ne),e(30,`
699                                `),o(),e(31,`
700                            `),o(),e(32,`
701                            `)),a&2){let i=d.$implicit,t=d.$index,n=d.$count,r=m().$implicit,c=m(2);l(),_("ngClass",at(13,al,t!==n-1,t!==0,t===0)),l(6),_("player",i)("userID",i.userID)("firstName",i.userFirstName)("lastName",i.userLastName)("initialsOnly",c.hidePlayerPhotos),l(5),z(`
702                                        `,i.userFirstName," ",i.userLastName,`
703                                    `),l(5),u(i.playerNumber?17:-1),l(4),u(r.surveyTypeID===c.SurveyType.PLAYER_RESPONSE_COACH_REVIEW?21:-1),l(),u(r.surveyTypeID===c.SurveyType.COACH_PLAYER_ASSESSMENT?22:-1),l(4),u(i.responseSubmissionDate&&r.surveyTypeID===c.SurveyType.PLAYER_RESPONSE_COACH_REVIEW?26:-1),l(),u(r.surveyTypeID===c.SurveyType.COACH_PLAYER_ASSESSMENT?27:-1)}}function Gl(a,d){if(a&1&&(e(0,`
704        `),s(1,"div",16),e(2,`
705            `),s(3,"p-accordion",17),e(4,`
706                `),s(5,"p-accordion-panel",18),e(6,`
707                    `),s(7,"p-accordion-header",19),e(8,`
708                        `),s(9,"div",20),e(10,`
709                            `),s(11,"div",21),e(12,`
710                                `),s(13,"div"),e(14,`
711                                    `),s(15,"div",22),e(16),o(),e(17,`
712                                    `),s(18,"div",23),e(19,`
713                                        `),s(20,"app-pill",24),e(21,`
714                                        `),o(),e(22,`
715                                        `),s(23,"span"),e(24),N(25,"date"),N(26,"date"),o(),e(27,`
716                                    `),o(),e(28,`
717                                `),o(),e(29,`
718                                `),p(30,dl,9,4)(31,cl,2,1),o(),e(32,`
719                            `),p(33,ul,44,7),p(34,hl,23,4),o(),e(35,`
720                    `),o(),e(36,`
721                    `),s(37,"p-accordion-content"),e(38,`
722
723                            `),F(39,Hl,33,17,null,null,$),o(),e(41,`
724                `),o(),e(42,`
725            `),o(),e(43,`
726        `),o(),e(44,`
727        `)),a&2){let i=d.$implicit,t=d.$index,n=m(2);l(),_("id","form-"+i.surveyID),l(2),_("value",t===0?i.surveyID:null),l(2),_("value",i.surveyID),l(11),w(`
728                                        `,i.title,`
729                                    `),l(4),_("status",i.isActive?"active":"default")("text",i.isActive?"open":"closed")("flex",!0),l(4),z(`
730                                            `,xe(25,12,i.startDate)," - ",xe(26,14,i.endDate),`
731                                        `),l(6),u(i.showNotify&&i.showNotifiedStatus?30:31),l(3),u(i.surveyTypeID===n.SurveyType.P
731LAYER_RESPONSE_COACH_REVIEW?33:-1),l(),u(i.surveyTypeID===n.SurveyType.COACH_PLAYER_ASSESSMENT?34:-1),l(5),V(i.submissions)}}function Yl(a,d){if(a&1&&(e(0,`
732        `),F(1,Gl,45,16,null,null,$)),a&2){let i=m();l(),V(i.forms)}}function Ql(a,d){a&1&&(e(0,`
733            `),s(1,"div",57),e(2,`
734                No forms are available for this team
735            `),o(),e(3,`
736        `))}function Jl(a,d){if(a&1){let i=y();e(0,`
737            `),s(1,"div",58),e(2,`
738                `),s(3,"div",59),e(4,`
739                    `),s(5,"a",60),e(6),o(),e(7,`
740                    `),s(8,"span",61),e(9),N(10,"date"),o(),e(11,`
741                `),o(),e(12,`
742                `),s(13,"div",29),e(14,`
743                    `),s(15,"button",62),v("click",function(n){let r=g(i).$implicit,c=m(2);return f(c.toggleRankingOptionsMenu(r.programTeamRankingID,n))}),e(16,`
744                        `),x(17,"i",63),e(18,`
745                        `),s(19,"div",64),e(20,"Options"),o(),e(21,`
746                    `),o(),e(22,`
747                `),o(),e(23,`
748            `),o(),e(24,`
749            `)}if(a&2){let i=d.$implicit,t=d.$index,n=d.$count;l(),ie("border-bottom",t!==n-1),l(4),_("routerLink",L(9,ol,i.programTeamRankingID)),l(),T(i.name),l(3),z("Saved By ",i.savedByName,` on
750                        `,B(10,6,i.savedOn,"M/d/y"))}}function Kl(a,d){if(a&1&&(e(0,`
751            `),F(1,Jl,25,11,null,null,$)),a&2){let i=m();l(),V(i.rankingSessions)}}function Zl(a,d){if(a&1){let i=y();e(0,`
752            `),s(1,"div",58),e(2,`
753                `),s(3,"div",59),e(4,`
754                    `),s(5,"a",60),e(6),o(),e(7,`
755                    `),s(8,"span",61),e(9),N(10,"date"),o(),e(11,`
756                `),o(),e(12,`
757                `),s(13,"div",29),e(14,`
758                    `),s(15,"button",62),v("click",function(n){let r=g(i).$implicit,c=m(2);return f(c.toggleRatingOptionsMenu(r.programTeamRatingID,n))}),e(16,`
759                        `),x(17,"i",63),e(18,`
760                        `),s(19,"div",64),e(20,"Options"),o(),e(21,`
761                    `),o(),e(22,`
762                `),o(),e(23,`
763            `),o(),e(24,`
764            `)}if(a&2){let i=d.$implicit,t=d.$index,n=d.$count;l(),ie("border-bottom",t!==n-1),l(4),_("routerLink",L(9,rl,i.programTeamRatingID)),l(),T(i.name),l(3),z("Saved By ",i.savedByName,` on
765                        `,B(10,6,i.savedOn,"M/d/y"))}}function Xl(a,d){if(a&1&&(e(0,`
766            `),F(1,Zl,25,11,null,null,$)),a&2){let i=m();l(),V(i.ratingSessions)}}function ed(a,d){if(a&1){let i=y();e(0,`
767        `),s(1,"app-dynamic-form",65),v("onSubmit",function(n){g(i);let r=m();return f(r.saveRatingSession(n))})("onCancel",function(){g(i);let n=m();return f(n.showRatingSessionModal=!1)}),e(2,`
768            `),s(3,"div",66),e(4,`
769                `),x(5,"app-dynamic-form-field",67),e(6,`
770            `),o(),e(7,`
771        `),o(),e(8,`
772        `)}if(a&2){let i=m();l(),_("fields",i.ratingSessionFields)("entity",i.ratingSession)("horizontalForm",!0)("contentFieldsMode",!0)}}function td(a,d){if(a&1){let i=y();e(0,`
773        `),s(1,"app-dynamic-form",65),v("onSubmit",function(n){g(i);let r=m();return f(r.saveRankingSession(n))})("onCancel",function(){g(i);let n=m();return f(n.showRankingSessionModal=!1)}),e(2,`
774            `),s(3,"div",66),e(4,`
775                `),x(5,"app-dynamic-form-field",67),e(6,`
776            `),o(),e(7,`
777        `),o(),e(8,`
778        `)}if(a&2){let i=m();l(),_("fields",i.rankingSessionFields)("entity",i.rankingSession)("horizontalForm",!0)("contentFieldsMode",!0)}}function id(a,d){if(a&1){let i=y();e(0,`
779`),s(1,"app-yes-no-modal",68),v("onYesSelect",function(){g(i);let n=m();return f(n.deleteRankingSession())})("onNoSelect",function(){g(i);let n=m();return f(n.showRemoveRanking=!1)}),e(2,`
780    `),s(3,"div",69),e(4,`
781        `),s(5,"app-inline-alert",70),e(6,`
782            `),s(7,"div",71),e(8,`
783                `),s(9,"div",72),e(10,"Are you sure you want to delete this item?"),o(),e(11,`
784            `),o(),e(12,`
785        `),o(),e(13,`
786    `),o(),e(14,`
787`),o(),e(15,`
788`)}a&2&&(l(),_("showModalText",!1),l(4),_("isInline",!0))}function nd(a,d){if(a&1){let i=y();e(0,`
789`),s(1,"app-yes-no-modal",68),v("onYesSelect",function(){g(i);let n=m();return f(n.deleteRatingSession())})("onNoSelect",function(){g(i);let n=m();return f(n.showRemoveRating=!1)}),e(2,`
790    `),s(3,"div",69),e(4,`
791        `),s(5,"app-inline-alert",70),e(6,`
792            `),s(7,"div",71),e(8,`
793                `),s(9,"div",72),e(10,"Are you sure you want to delete this item?"),o(),e(11,`
794            `),o(),e(12,`
795        `),o(),e(13,`
796    `),o(),e(14,`
797`),o(),e(15,`
798`)}
798a&2&&(l(),_("showModalText",!1),l(4),_("isInline",!0))}var so=(()=>{let d=class d{constructor(t,n,r,c,h){this.route=t,this.siteDataService=n,this.manageTeamService=r,this.dynamicFormService=c,this.teamService=h,this.SurveyType=Wt,this.showRemoveRanking=!1,this.showRemoveRating=!1,this.hidePlayerPhotos=!1,this.options=[],this.unsubscribe$=new U}ngOnInit(){this.teamID=+this.route.snapshot.parent.params.id,this.programID=+this.route.snapshot.parent.params.programID,this.teamID&&(this.teamService.teamID=this.teamID,this.route.queryParams.pipe(Kt(t=>{this.surveyID=+t.formID}),ge(()=>j({surveys:this.teamService.getTeamSurveysAndResponses(this.programID),rankingSessions:this.manageTeamService.getTeamRankingSessions(this.teamID,this.programID),ratingSessions:this.manageTeamService.getTeamRatingSessions(this.teamID,this.programID),clubSettings:this.siteDataService.getClubSettings()})),S(this.unsubscribe$)).subscribe(t=>{this.forms=t.surveys,this.rankingSessions=t.rankingSessions,this.ratingSessions=t.ratingSessions,this.hidePlayerPhotos=t.clubSettings.clubOptions?.find(n=>n.optionID===me.HIDE_PLAYER_PROFILE_PHOTO)?.boolValue||!1,this.siteDataService.hideSiteLoader(),this.surveyID&&setTimeout(()=>{document.getElementById("form-"+this.surveyID).scrollIntoView({behavior:"smooth"})},1e3)}))}editRankingSession(t){this.copyRankingSessionID=null,this.rankingSessionID=t,j({session:this.manageTeamService.getTeamRankingSession(this.teamID,this.programID,t),metadata:this.rankingSessionFields?Z(null):this.manageTeamService.getTeamRankingMetadata()}).pipe(S(this.unsubscribe$)).subscribe(n=>{this.rankingSession=n.session,n.metadata&&(this.rankingSessionFields=n.metadata.fields),this.showRankingSessionModal=!0})}editRatingSession(t){this.copyRatingSessionID=null,this.ratingSessionID=t,j({session:this.manageTeamService.getTeamRatingSession(this.teamID,this.programID,t),metadata:this.ratingSessionFields?Z(null):this.manageTeamService.getTeamRatingMetadata()}).pipe(S(this.unsubscribe$)).subscribe(n=>{this.ratingSession=n.session,n.metadata&&(this.ratingSessionFields=n.metadata.fields),this.showRatingSessionModal=!0})}addRosterRanking(){(this.rankingSessionFields?Z(null):this.manageTeamService.getTeamRankingMetadata()).pipe(S(this.unsubscribe$)).subscribe(t=>{t&&(this.rankingSessionFields=t.fields),this.rankingSessionID=null,this.rankingSession=null,this.showRankingSessionModal=!0})}addRosterRating(){(this.ratingSessionFields?Z(null):this.manageTeamService.getTeamRatingMetadata()).pipe(S(this.unsubscribe$)).subscribe(t=>{t&&(this.ratingSessionFields=t.fields),this.ratingSessionID=null,this.copyRatingSessionID=null,this.ratingSession=null,this.showRatingSessionModal=!0})}copyRosterRating(t){(this.ratingSessionFields?Z(null):this.manageTeamService.getTeamRatingMetadata()).pipe(S(this.unsubscribe$)).subscribe(n=>{n&&(this.ratingSessionFields=n.fields),this.ratingSessionID=null,this.copyRatingSessionID=t,this.ratingSession=void 0,this.showRatingSessionModal=!0})}saveRankingSession(t){(this.copyRankingSessionID?this.manageTeamService.copyTeamRankingSession(this.teamID,this.programID,this.copyRankingSessionID,t):this.manageTeamService.saveTeamRankingSession(this.teamID,this.programID,this.rankingSessionID,t)).pipe(ge(()=>this.manageTeamService.getTeamRankingSessions(this.teamID,this.programID)),S(this.unsubscribe$)).subscribe(n=>{this.rankingSessions=n,this.dynamicFormService.hideFormLoader(),this.showRankingSessionModal=!1})}saveRatingSession(t){(this.copyRatingSessionID?this.manageTeamService.copyTeamRatingSession(this.teamID,this.programID,this.copyRatingSessionID,t):this.manageTeamService.saveTeamRatingSession(this.teamID,this.programID,this.ratingSessionID,t)).pipe(ge(()=>this.manageTeamService.getTeamRatingSessions(this.teamID,this.programID)),S(this.unsubscribe$)).subscribe(n=>{this.ratingSessions=n,this.dynamicFormService.hideFormLoader(),this.showRatingSessionModal=!1})}deleteRankingSession(){this.manageTeamService.deleteTeamRankingSession(this.teamID,this.programID,this.rankingSessionID).pipe(S(this.unsubscribe$)).subscribe(()=>{this.rankingSessions=this.rankingSessions.filter(t=>t.programTeamRankingID!==this.rankingSessionID),this.showRemoveRanking=!1})}deleteRatingSession(){this.manageTeamService.deleteTeamRatingSession(this.teamID,this.programID,this.ratingSessionID).pipe(S(this.unsubscribe$)).subscribe(()=>{this.ratingSessions=this.ratingSessions.filter(t=>t.programTeamRatingID!==this.ratingSessionID),this.showRemoveRating=!1})}toggleRankingOptionsMenu(t,n){let r=[];this.rankingSessionID=t,r.push({label:"Edit Name",icon:"fa fa-pencil",command:()=>{this.editRankingSession(t)}}),r.push({label:"Duplicate",icon:"fa fa-clone",command:()=>{this.copyRankingSessionID=t,this.addRosterRanking()}}),this.rankingSessions.find(c=>c.programTeamRankingID===t).hasPlayerTeamRankings||r.push({label:"Delete",icon:"fa fa-times",command:()=>{this.showRemoveRanking=!0}}),this.options=[{label:"Options",items:r}],this.optionsMenu.toggle(n)}toggleRatingOptionsMenu(t,n){let r=[];this.ratingSessionID=t,r.push({label:"Edit Name",icon:"fa fa-pencil",command:()=>{this.editRatingSession(t)}}),r.push({label:"Duplicate",icon:"fa fa-clone",command:()=>{this.copyRosterRating(t)}}),this.ratingSessions.find(c=>c.programTeamRatingID===t).hasPlayerTeamRatings||r.push({label:"Delete",icon:"fa fa-times",command:()=>{this.showRemoveRating=!0}}),this.options=[{label:"Options",items:r}],this.optionsMenu.toggle(n)}notifyCompleted(t){this.notifyingSurveyID=t,this.teamService.surveyID=t,this.teamService.teamID=this.teamID,this.teamService.emailUnnotifiedSubmissions().pipe(ge(n=>n?this.teamService.getTeamSurveysAndResponses(this.programID,t):Z(null)),S(this.unsubscribe$)).subscribe({next:n=>{if(n?.length){let r=this.forms.findIndex(c=>c.surveyID===t);this.forms.splice(r,1,n[0]),this.siteDataService.showSiteSuccessAlert("Completed forms notified successfully")}else this.siteDataService.showSiteErrorAlert("There was a problem notifying");this.notifyingSurveyID=null},error:()=>{this.notifyingSurveyID=null,this.siteDataService.showSiteErrorAlert("There was a problem notifying")}})}ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete()}};d.\u0275fac=function(n){return new(n||d)(C(I),C(E),C(ee),C(Se),C(Nt))},d.\u0275cmp=D({type:d,selectors:[["app-evaluations"]],viewQuery:function(n,r){if(n&1&&Te(il,5),n&2){let c;se(c=le())&&(r.optionsMenu=c.first)}},standalone:!1,decls:67,vars:20,consts:[["noForms",""],["optionsMenu",""],["linkText",""],[1,"row"],[1,"col-md-8"],[1,"col-md-4"],[1,"card","admin-card","pb-0"],[1,"card-header"],[1,"fa-regular","fa-stars","mr-2"],[1,"card-footer","py-2"],["type","button",1,"btn","btn-naked","btn-icon-plus","pl-0",3,"click"],[1,"fa-light","fa-ranking-star","mr-2"],["header","Roster Rating","styleClass","shortWidthDialog",3,"visibleChange","visible","modal","showHeader","draggable"],[1,"my-3"],["header","Roster Ranking","styleClass","shortWidthDialog",3,"visibleChange","visible","modal","showHeader","draggable"],["appendTo","body",3,"model","popup"],[3,"id"],["expandIcon","p-icon ml-3 fa-thin fa-square-chevron-down  text-jumbo text-grey-lt align-self-start","collapseIcon","p-icon ml-3 fa-thin fa-square-chevron-up text-jumbo text-grey-lt align-self-start",1,"mb-3","p-accordion-naked","p-0","accordion-toggle-first",3,"value"],[1,"card","p-0","pt-2","mb-3",3,"value"],[1,"p-0","pr-2","accordion-border-bottom"],[1,"full-width","pl-3","pr-2","pb-3"],[1,"full-width","form-header","d-flex","align-items-center"],[1,"text-large","fw-600","form-title"],[1,"d-flex","align-items-center"],[3,"status","text","flex"],[1,"ml-auto"],["type","button",1,"btn","btn-tertiary","btn-sm",3,"click","disabled"],[1,"ml-auto","text-largest","text-green"],[1,"fa","fa-circle-check"],[1,"col-auto"],[1,"col","d-flex","justify-content-end","align-items-end"],[1,"text-small"],[1,"full-width"],[1,"highlight-green",3,"value","showValue"],[1,"row","participant-row","align-items-center",3,"ngClass"],[1,"col-md-6","d-flex","align-items-center"],[1,"mr-2"],[3,"player","userID","firstName","lastName","
798initialsOnly"],[1,"fw-500","text-medium"],[1,"col-md-1","text-center","text-medium"],[1,"col-md-3","text-medium"],[1,"col-md-2","d-flex","justify-content-end","text-medium"],["status","default","text","Response Not Started",3,"dots"],["status","warning","text","Response Started, Not Finished",3,"dots"],["status","active","text","Response Completed",3,"dots"],["status","default","text","Review Not Started",3,"dots"],["status","warning","text","Review Started, Not Finished",3,"dots"],["status","warning","text","Review Completed",3,"dots"],["status","active","text","Review Completed & Notified",3,"dots"],["status","active","text","Review Completed",3,"dots"],["status","default","text","Not Started",3,"dots"],["status","warning","text","Started, Not Finished",3,"dots"],["status","warning","text","Completed",3,"dots"],["status","active","text","Completed & Notified",3,"dots"],["status","active","text","Completed",3,"dots"],[1,"btn-naked","btn-icon-chevron-right-after",3,"routerLink"],[4,"ngTemplateOutlet"],[1,"card"],[1,"row","no-gutters","d-flex","align-items-center","line-height-0","py-2"],[1,"col"],[1,"text-medium",3,"routerLink"],[1,"d-block","text-small","text-grey-lt"],["type","button",1,"btn","btn-sm","btn-tertiary","ml-3",3,"click"],[1,"fa-solid","fa-ellipsis"],[1,"sr-only"],["submitButtonText","Save","buttonsPosition","left",3,"onSubmit","onCancel","fields","entity","horizontalForm","contentFieldsMode"],[1,"form-row"],["fieldName","name"],["headerText","Delete Item","dialogClass","standardWidthDialog","yesButtonText","Yes, Delete","yesButtonLoadingText","Deleting...","noButtonText","Cancel",3,"onYesSelect","onNoSelect","showModalText"],[1,"text-medium","fw-600"],["alertType","warning",3,"isInline"],[1,"text-default","fw-400","ml-3"],[1,"mb-3"]],template:function(n,r){if(n&1){let c=y();s(0,"div",3),e(1,`
799    `),s(2,"div",4),e(3,`
800        `),p(4,Yl,3,0),A(5,Ql,4,0,"ng-template",null,0,ne),e(7,`
801    `),o(),e(8,`
802    `),s(9,"div",5),e(10,`
803
804
805        `),s(11,"section",6),e(12,`
806            `),s(13,"div",7),e(14,`
807                `),s(15,"h3"),x(16,"i",8),e(17," Roster Ranking"),o(),e(18,`
808            `),o(),e(19,`
809            `),p(20,Kl,3,0),s(21,"div",9),e(22,`
810                `),s(23,"button",10),v("click",function(){return r.addRosterRanking()}),e(24,`
811                    Roster Ranking
812                `),o(),e(25,`
813            `),o(),e(26,`
814        `),o(),e(27,`
815
816        `),s(28,"section",6),e(29,`
817            `),s(30,"div",7),e(31,`
818                `),s(32,"h3"),x(33,"i",11),e(34," Roster Tiers"),o(),e(35,`
819            `),o(),e(36,`
820            `),p(37,Xl,3,0),s(38,"div",9),e(39,`
821                `),s(40,"button",10),v("click",function(){return r.addRosterRating()}),e(41,`
822                    Roster Tiers
823                `),o(),e(42,`
824            `),o(),e(43,`
825        `),o(),e(44,`
826    `),o(),e(45,`
827`),o(),e(46,`
828`),s(47,"p-dialog",12),R("visibleChange",function(b){return g(c),P(r.showRatingSessionModal,b)||(r.showRatingSessionModal=b),f(b)}),e(48,`
829
830    `),s(49,"div",13),e(50,`
831        `),p(51,ed,9,4),o(),e(52,`
832`),o(),e(53,`
833`),s(54,"p-dialog",14),R("visibleChange",function(b){return g(c),P(r.showRankingSessionModal,b)||(r.showRankingSessionModal=b),f(b)}),e(55,`
834
835    `),s(56,"div",13),e(57,`
836        `),p(58,td,9,4),o(),e(59,`
837`),o(),e(60,`
838`),s(61,"p-menu",15,1),e(63,`
839`),o(),e(64,`
840`),p(65,id,16,2),p(66,nd,16,2)}n&2&&(l(4),u(r.forms&&r.forms.length>0?4:-1),l(16),u((r.rankingSessions==null?null:r.rankingSessions.length)>0?20:-1),l(17),u((r.ratingSessions==null?null:r.ratingSessions.length)>0?37:-1),l(10),M("visible",r.showRatingSessionModal),_("modal",!0)("showHeader",!0)("draggable",!1),l(4),u(r.ratingSessionFields&&r.showRatingSessionModal?51:-1),l(3),M("visible",r.showRankingSessionModal),_("modal",!0)("showHeader",!0)("draggable",!1),l(4),u(r.rankingSessionFields&&r.showRankingSessionModal?58:-1),l(3),Oe(Q(19,nl)),_("model",r.options)("popup",!0),l(4),u(r.showRemoveRanking?65:-1),l(),u(r.showRemoveRating?66:-1))},dependencies:[ue,In,de,he,_e,Qn,be,ce,Dt,Ci,oe,Ye,Wn,Ti,Si,yi,wi,Di,xt],encapsulation:2});let a=d;return a})();var sd=a=>["/admin/users",a,"profile"],mn=a=>({adminView:a}),ld=(a,d,i)=>[a,d,i],dd=()=>
840["schedule/volunteer-settings"];function md(a,d){if(a&1&&e(0),a&2){let i=m(2);w(`
841              `,i.currentTeam.name,`
842            `)}}function cd(a,d){a&1&&e(0,`
843              Select a team
844            `)}function pd(a,d){if(a&1){let i=y();e(0,`
845    `),s(1,"div",2),e(2,`
846      `),s(3,"div",3),e(4,`
847        `),s(5,"div",4),e(6,`
848          `),s(7,"a",5),e(8,`
849            `),x(9,"i",6),s(10,"span",7),e(11,"Back"),o(),e(12,`
850          `),o(),e(13,`
851        `),o(),e(14,`
852        `),s(15,"div",8),e(16,`
853          `),s(17,"h1",9),e(18,`Teams
854            `),s(19,"span",10),e(20,"\xA0/\xA0"),o(),s(21,"span",11),v("click",function(n){g(i);let r=Re(29);return f(r.toggle(n))}),e(22,`
855            `),p(23,md,1,1)(24,cd,1,0),o(),e(25,`
856        `),o(),e(26,`
857      `),o(),e(27,`
858      `),x(28,"p-menu",12,0),e(30,`
859    `),o(),e(31,`
860  `),o(),e(32,`
861`)}if(a&2){let i=m();l(7),_("routerLink","/admin/dashboard"),l(16),u(i.currentTeam?23:24),l(5),_("model",i.menuItems)("popup",!0)}}function ud(a,d){if(a&1&&(e(0,`
862    `),x(1,"app-admin-header",13),e(2,`
863  `)),a&2){let i=m(2);l(),_("pageTitle",i.currentTeam.name)}}function _d(a,d){if(a&1&&(e(0,`
864      `),s(1,"div",15),e(2,`
865        `),s(3,"div",16),e(4,"Registered By:"),o(),e(5,`
866        `),s(6,"div",17),e(7,`
867          `),s(8,"a",18),e(9),o(),e(10,`
868        `),o(),e(11,`
869      `),o(),e(12,`
870    `)),a&2){let i=m(3);l(),ie("mb-2",!i.divisions),l(7),_("routerLink",L(5,sd,i.registeredBy.clubUserID)),l(),z(`
871          `,i.registeredBy.firstName," ",i.registeredBy.lastName)}}function hd(a,d){a&1&&e(0,`
872              ,
873            `)}function gd(a,d){if(a&1&&(e(0,`
874            `),s(1,"span"),e(2),p(3,hd,1,0),o(),e(4,`
875        `)),a&2){let i=d.$implicit,t=d.$index,n=d.$count;l(2),w(`
876              `,i.name),l(),u(t!==n-1?3:-1)}}function fd(a,d){if(a&1&&(e(0,`
877      `),s(1,"div",15),e(2,`
878        `),s(3,"div",16),e(4,"Division(s):"),o(),e(5,`
879        `),s(6,"div",17),e(7,`
880          `),F(8,gd,5,2,null,null,$),o(),e(10,`
881    `),o(),e(11,`
882  `)),a&2){let i=m(3);l(8),V(i.divisions)}}function xd(a,d){if(a&1&&(e(0,`
883    `),x(1,"app-admin-header",14),e(2,`
884    `),p(3,_d,13,7),p(4,fd,12,0)),a&2){let i=m(2);l(),_("pageTitle",i.programName+": "+i.teamName)("parentLinkText","Manage Teams")("showBackButton",!0)("parentLinkUrl","../../../.."),l(2),u(i.hasTeamRegistrations&&i.registeredBy?3:-1),l(),u(i.programTypeID===i.ProgramType.LEAGUE&&(i.divisions==null?null:i.divisions.length)>0?4:-1)}}function Cd(a,d){if(a&1&&(e(0,`
885  `),p(1,ud,3,1),p(2,xd,5,6)),a&2){let i=m();l(),u(i.currentTeam?1:-1),l(),u(!i.currentTeam&&i.showTabs?2:-1)}}function vd(a,d){if(a&1){let i=y();e(0,`
886          `),s(1,"li",22),e(2,`
887            `),s(3,"a",27),v("click",function(){g(i);let n=m(3);return f(n.goToTab("communication"))}),e(4,"Communications"),o(),e(5,`
888          `),o(),e(6,`
889        `)}a&2&&(l(3),_("routerLink","./communication"))}function bd(a,d){if(a&1){let i=y();e(0,`
890          `),s(1,"li",22),e(2,`
891            `),s(3,"a",28),v("click",function(){g(i);let n=m(3);return f(n.goToTab("team-message"))}),e(4,"Team Chat"),o(),e(5,`
892          `),o(),e(6,`
893        `)}a&2&&(l(3),_("routerLink","./team-message"))}function Sd(a,d){a&1&&(e(0,`
894          `),s(1,"li",22),e(2,`
895            `),s(3,"a",29),e(4,`
896              Progress
897            `),o(),e(5,`
898          `),o(),e(6,`
899        `)),a&2&&(l(3),_("routerLink","./forms"))}function yd(a,d){if(a&1){let i=y();e(0,`
900          `),s(1,"li",22),e(2,`
901            `),s(3,"a",30),v("click",function(){g(i);let n=m(3);return f(n.goToTab("team-contact"))}),e(4,"Team Information"),o(),e(5,`
902          `),o(),e(6,`
903        `)}a&2&&(l(3),_("routerLink","./team-contact"))}function wd(a,d){if(a&1){let i=y();e(0,`
904          `),s(1,"li",22),e(2,`
905            `),s(3,"a",31),v("click",function(){g(i);let n=m(3);return f(n.goToTab("invitations"))}),e(4,"Invitations"),o(),e(5,`
906          `),o(),e(6,`
907        `)}}function Td(a,d){a&1&&(e(0,`
908          `),s(1,"li",22),e(2,`
909            `),s(3,"a",29),e(4,`
910              External Connections
911            `),o(),e(5,`
912          `),o(),e(6,`
913        `)),a&2&&(l(3),_("routerLink","./external-conections"))}function Dd(a,d){if(a&1){let i=y();e(0,`
914          `),s(1,"li",22),e(2,`
915            `),s(3,"a",32),v("click",function(){g(i);let n=m(3);return f(n.goToTab("tournament-registration"))}),e(4,`
916              Tournament Registration `),x(5,"app-pill",33),e(6,`
917            `),o(),e(7,`
918          `),o(),e(8,`
919        `)}
919a&2&&(l(3),_("routerLink","./tournament-registration"))}function Ed(a,d){a&1&&(e(0,`
920          `),s(1,"li",22),e(2,`
921            `),s(3,"a",29),e(4,`
922              Overview Page
923            `),o(),e(5,`
924          `),o(),e(6,`
925        `)),a&2&&(l(3),_("routerLink","./team-overview-page"))}function Id(a,d){a&1&&(e(0,`
926            `),s(1,"a",34),e(2,`
927              `),s(3,"span",35),e(4,`
928                `),x(5,"i",36),e(6,` Volunteer Settings
929              `),o(),e(7,`
930            `),o(),e(8,`
931          `)),a&2&&(l(),_("routerLink",Q(1,dd)))}function Md(a,d){if(a&1&&(e(0,`
932            `),x(1,"app-split-button",37),e(2,`
933          `)),a&2){let i=m(3);l(),_("menuItems",i.actionMenuItems)}}function Pd(a,d){if(a&1){let i=y();e(0,`
934            `),s(1,"button",38),v("click",function(){g(i);let n=m(3);return f(n.publish())}),e(2,"Publish"),o(),e(3,`
935          `)}}function Rd(a,d){if(a&1){let i=y();e(0,`
936    `),s(1,"div",20),e(2,`
937      `),s(3,"ul",21),e(4,`
938        `),s(5,"li",22),e(6,`
939          `),s(7,"a",23),v("click",function(){g(i);let n=m(2);return f(n.goToTab("roster"))}),e(8,"Roster"),o(),e(9,`
940        `),o(),e(10,`
941        `),s(11,"li",22),e(12,`
942          `),s(13,"a",24),v("click",function(){g(i);let n=m(2);return f(n.goToTab("staff"))}),e(14,"Staff"),o(),e(15,`
943        `),o(),e(16,`
944        `),s(17,"li",22),e(18,`
945          `),s(19,"a",25),v("click",function(){g(i);let n=m(2);return f(n.goToTab("schedule"))}),e(20,"Schedule"),o(),e(21,`
946        `),o(),e(22,`
947        `),p(23,vd,7,1),p(24,bd,7,1),p(25,Sd,7,1),p(26,yd,7,1),p(27,wd,7,0),p(28,Td,7,1),p(29,Dd,9,1),p(30,Ed,7,1),s(31,"li",26),e(32,`
948          `),p(33,Id,9,2),p(34,Md,3,1),p(35,Pd,4,0),o(),e(36,`
949      `),o(),e(37,`
950    `),o(),e(38,`
951  `)}if(a&2){let i=m(2);l(7),_("routerLink","./roster")("state",L(17,mn,i.adminView)),l(6),_("routerLink","./staff")("state",L(19,mn,i.adminView)),l(6),_("routerLink","./schedule")("state",L(21,mn,i.adminView)),l(4),u(i.user&&i.user[i.Permission.TeamManagerCommunications]?23:-1),l(),u(i.adminView&&i.user&&i.user[i.Permission.TeamManagerCommunications]?24:-1),l(),u(i.formsEnabled&&i.user[i.Permission.PlayerProgress]&&at(23,ld,i.ProgramType.TEAM,i.ProgramType.SUPPLEMENTAL,i.ProgramType.LEAGUE).includes(i.programTypeID)&&!i.isAdultProgram&&i.programTeamTypeID!==i.ProgramTeamType.GROUP?25:-1),l(),u(i.adminView&&i.hasTeamRegistrations&&i.optionEnabled(i.FieldOption.TEAM_CONTACT_INFORMATION)?26:-1),l(),u(i.programTypeID===i.ProgramType.LEAGUE&&i.hasPlayerRegistrations&&i.programInvitationTypeID!==i.ProgramInvitationType.OPEN?27:-1),l(),u(i.programTypeID===i.ProgramType.TEAM?28:-1),l(),u(i.tournamentRegistrationEnabled&&i.adminView&&i.user[i.Permission.Teams]?29:-1),l(),u(i.programTypeID===i.ProgramType.TEAM&&i.user[i.Permission.Teams]?30:-1),l(3),u(i.enableVolunteerTasks&&i.isScheduleRoute()&&i.user[i.Permission.VolunteerEvents]?33:-1),l(),u(i.actionMenuItems!=null&&i.actionMenuItems.length&&i.isScheduleRoute()?34:-1),l(),u(i.showPublish?35:-1)}}function kd(a,d){if(a&1&&(e(0,`
952  `),p(1,Rd,39,27),s(2,"div",19),e(3,`
953    `),x(4,"router-outlet"),e(5,`
954  `),o(),e(6,`
955`)),a&2){let i=m();l(),u(i.showTabs?1:-1)}}function Fd(a,d){a&1&&(e(0,`
956  `),s(1,"app-inline-alert"),e(2,"Please select a team above to get started"),o(),e(3,`
957`))}var mo=(()=>{let d=class d{constructor(t,n,r,c,h,b,k,te,$e,Xe){this.siteDataService=t,this.clubCalendarService=n,this.route=r,this.staffService=c,this.router=h,this.authorizeService=b,this.programService=k,this.teamService=te,this.leagueService=$e,this.manageTeamService=Xe,this.unsubscribe$=new U,this.teams=[],this.loading=!0,this.menuItems=[],this.currentTeam=void 0,this.adminView=!1,this.Permission=W,this.ProgramType=yt,this.ProgramTeamType=On,this.ProgramInvitationType=qt,this.showTabs=!0,this.formsEnabled=!1,this.enableVolunteerTasks=!0,this.tournamentRegistrationEnabled=!1,this.showPublish=!1,this.hasPlayerRegistrations=!1,this.hasTeamRegistrations=!1,this.FieldOption=Ce;let pt=this.router.getCurrentNavigation()??this.router.lastSuccessfulNavigation();pt?.extras.state&&(this.programName=pt.extras.state.programName,this.teamName=pt.extras.state.teamName)}
957ngOnInit(){this.adminView=this.route.snapshot.data?.admin||!1,this.showTabs=!this.route.firstChild?.firstChild?.snapshot.data?.profileView,this.authorizeService.getUser().subscribe(t=>{t&&(this.user=t)}),this.route.params.subscribe(t=>{t&&(this.teamID=+t.id,this.manageTeamService.programID=+t.programID,this.manageTeamService.teamID=+t.id,this.createMenuItems(this.manageTeamService.programID,this.manageTeamService.teamID)),this.adminView?((!this.programName||!this.programTypeID||!this.teamName)&&j({program:this.programService.getProgram(this.manageTeamService.programID),team:this.teamService.getTeam(this.teamID),club:this.siteDataService.getClubSettings(),hasPlayerRegistrations:this.programService.getProgramHasPlayerRegistrations(this.manageTeamService.programID),hasTeamRegistrations:this.programService.getProgramHasTeamRegistrations(this.manageTeamService.programID),registeredBy:this.teamService.getTeamRegisteredBy(this.teamID),divisions:this.user[W.Leagues]?this.leagueService.getTeamDivisions(this.manageTeamService.programID,this.teamID):Z(null),fieldOptions:this.siteDataService.getClubFieldOptions()}).pipe(S(this.unsubscribe$)).subscribe({next:n=>{n.program&&(this.programName=n.program.name,this.programTypeID=n.program.programTypeID,this.programTeamTypeID=n.program.programTeamTypeID,this.programInvitationTypeID=n.program.programInvitationTypeID,this.isAdultProgram=n.program.isAdultProgram),this.hasPlayerRegistrations=n.hasPlayerRegistrations,this.hasTeamRegistrations=n.hasTeamRegistrations,this.teamName=n.team?n.team?.name:"",this.registeredBy=n.registeredBy,this.fieldOptions=n.fieldOptions,n.divisions&&(this.divisions=n.divisions.results),this.formsEnabled=n.club?n.club.clubOptions.find(r=>r.optionID===me.PLAYER_PROGRESS)?.boolValue:!1,this.enableVolunteerTasks=n.club?!!n.club.clubOptions.find(r=>r.optionID===me.ENABLE_VOLUNTEER_TASKS)?.boolValue:!0,this.tournamentRegistrationEnabled=n.club?!!n.club.clubOptions.find(r=>r.optionID===me.ENABLE_EXTERNAL_TOURNAMENT_REGISTRATION)?.boolValue:!1,this.siteDataService.getClubFieldOptions()},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem loading team details."),this.siteDataService.hideSiteLoader()}}),this.siteDataService.hideSiteLoader()):j({programs:this.staffService.getAssignedProgramsAndTeams([yt.TEAM,yt.SUPPLEMENTAL,yt.TOURNAMENT,yt.LEAGUE]),club:this.siteDataService.getClubSettings()}).subscribe(n=>{this.buildMenu(n.programs);let r=n.programs.find(c=>c.programID===this.manageTeamService.programID).program;this.programTypeID=r.programTypeID,this.programTeamTypeID=r.programTeamTypeID,this.programInvitationTypeID=r.programInvitationTypeID,this.formsEnabled=n.club.clubOptions.find(c=>c.optionID===me.PLAYER_PROGRESS)?.boolValue,this.enableVolunteerTasks=!!n.club.clubOptions.find(c=>c.optionID===me.ENABLE_VOLUNTEER_TASKS)?.boolValue,this.siteDataService.hideSiteLoader()})}),this.router.events.pipe(S(this.unsubscribe$)).subscribe(t=>{if(t instanceof ai){this.currentRoute=t.url;let n=this.route.firstChild;for(this.showTabs=!0,this.updateShowPublish();n;)n.snapshot.data&&n.snapshot.data?.profileView&&(this.showTabs=!1),n.firstChild?n=n.firstChild:n=null}})}optionEnabled(t){return this.fieldOptions?.find(n=>n.fieldOptionID===t)!==void 0}updateShowPublish(){let t=this.route;for(this.showPublish=!1;t.firstChild;)t=t.firstChild,t.snapshot.data&&(console.log("Route data:",t.snapshot.data),t.snapshot.data.showPublish&&(this.showPublish=!0));t.snapshot.data&&(console.log("Final Route data:",t.snapshot.data),t.snapshot.data.showPublish&&(this.showPublish=!0))}isScheduleRoute(){return this.router.url.includes("/schedule")}publish(){console.log("publish"),this.clubCalendarService.publishEventsClicked()}buildMenu(t){this.staffService.staffProgramAssignments=t;let n=this.staffService.staffProgramAssignments.map(r=>({team:r.team,programID:r.programID}));this.currentTeam=n.find(r=>r.team.teamID===this.teamID).team,this.staffService.staffProgramAssignments?.length>1&&(this.menuItems=[],n.filter(r=>r.programID===this.manageTeamService.programID).forEach(r=>this.menuItems.push({label:r.team.name,id:r.team.teamID.toString(),command:()=>{this.manageTeamService.goToTeam(r.team.teamID,r.programID)}}))),this.loading=!1}
957createMenuItems(t,n){this.actionMenuItems=[],this.actionMenuItems.push({label:"Import/Export",command:()=>{this.router.navigate([`/admin/teams/manage-team/${n}/program/${t}/schedule/import`])}}),this.actionMenuItems.push({label:"Bulk Cancel",command:()=>{this.router.navigate([`/admin/teams/manage-team/${n}/program/${t}/schedule/bulk-edit`])}}),this.user[W.CalendarBulkEdit]&&this.actionMenuItems.push({label:"Bulk Editing",command:()=>{this.router.navigate([`/admin/teams/manage-team/${n}/program/${t}/schedule/bulk-edit`],{queryParams:{advancedView:!0}})}})}goToTab(t){this.manageTeamService.activeTab=t}ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete()}};d.\u0275fac=function(n){return new(n||d)(C(E),C(It),C(I),C(Ie),C(H),C(ae),C(Ft),C(X),C(Vi),C(ee))},d.\u0275cmp=D({type:d,selectors:[["app-manage-team"]],standalone:!1,decls:6,vars:2,consts:[["teamMenu",""],["role","main"],[1,"admin-header","d-flex","justify-content-between"],[1,"row","align-items-center","breadcrumbs-wrapper","mb-3"],[1,"col-auto","border-right"],[1,"text-grey","text-large",3,"routerLink"],[1,"far","fa-arrow-left"],[1,"sr-only"],[1,"col","breadcrumbs-inner-wrapper"],[1,"align-self-center","mb-0"],[1,"header-separator"],[1,"btn","team-toggle","btn-naked","btn-icon-chevron-down-after",3,"click"],["appendTo","body",3,"model","popup"],[3,"pageTitle"],[3,"pageTitle","parentLinkText","showBackButton","parentLinkUrl"],[1,"row"],[1,"col-md-2"],[1,"col-md-10"],[3,"routerLink"],[1,"ml-0","pl-0"],[1,"tabs"],["role","tablist",1,"tab-nav","no-bullets","inline-list","d-flex"],["routerLinkActive","active",1,"nav-item"],["role","tab","aria-controls","Roster","aria-selected","true",1,"nav-link",3,"click","routerLink","state"],["role","tab","aria-controls","Staff","aria-selected","true",1,"nav-link",3,"click","routerLink","state"],["role","tab","aria-controls","Schedule","aria-selected","true",1,"nav-link",3,"click","routerLink","state"],[1,"flex-grow-1","text-right"],["role","tab","aria-controls","Communication","aria-selected","true",1,"nav-link",3,"click","routerLink"],["role","tab","aria-controls","Team Chat","aria-selected","true",1,"nav-link",3,"click","routerLink"],["role","tab","aria-controls","forms","aria-selected","true",1,"nav-link",3,"routerLink"],["role","tab","aria-controls","Team Information","aria-selected","true",1,"nav-link",3,"click","routerLink"],["routerLink","invitations","role","tab","aria-controls","Invitations","aria-selected","true",1,"nav-link",3,"click"],["role","tab","aria-controls","Tournament Registration","aria-selected","true",1,"nav-link",3,"click","routerLink"],["status","color1","text","Beta"],["routerLinkActive","d-none",1,"btn-a11y","mr-3","opacity-100",3,"routerLink"],[1,"text-primary-link","opacity-100"],[1,"fa-regular","fa-gear"],["buttonClass","btn-sm",3,"menuItems"],["type","button",1,"ml-3","btn","btn-primary","btn-sm",3,"click"]],template:function(n,r){n&1&&(s(0,"main",1),e(1,`
958
959  `),p(2,pd,33,4)(3,Cd,3,2),p(4,kd,7,1)(5,Fd,4,0),o()),n&2&&(l(2),u((r.menuItems==null?null:r.menuItems.length)>0?2:3),l(2),u(r.teamID?4:5))},dependencies:[vt,de,oi,be,ce,xi,vi,Ye],styles:[".team-toggle[_ngcontent-%COMP%]{cursor:pointer;text-decoration:none;color:var(--blue-1000);padding:0}.team-toggle[_ngcontent-%COMP%]:after{color:var(--primary-link)}.tab-nav[_ngcontent-%COMP%]   .nav-item[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]{min-width:7rem;display:inline-block;text-align:center}"]});let a=d;return a})();var co=(()=>{let d=class d{constructor(t,n,r){this.route=t,this.staffService=n,this.siteDataService=r,this.loading=!0}ngOnInit(){this.teamID=+this.route.snapshot.parent.params.id,this.siteDataService.hideSiteLoader()}};d.\u0275fac=function(n){return new(n||d)(C(I),C(Ie),C(E))},d.\u0275cmp=D({type:d,selectors:[["app-resources"]],standalone:!1,decls:3,vars:0,template:function(n,r){n&1&&(s(0,"p"),e(1,"resources works!"),o(),e(2,`
960`))},encapsulation:2});let a=d;return a})();var Bi=class{};var jt=(()=>{let d=class d{constructor(t){this.webAPI=t}getPlayerFeedbackMetadata(){return this.webAPI.getData("admin/players/teams/feedback/metadata")}getPlayerFeedback(t,n,r,c=10){let h=new ot;
960return h=h.append("page",r.toString()),h=h.append("rows",c.toString()),h=h.append("includeCount","true"),this.webAPI.getData(`admin/players/${t}/teams/${n}/feedback`,h)}getPlayerFeedbackItem(t,n,r){return this.webAPI.getData(`admin/players/${t}/teams/${n}/feedback/${r}`)}savePlayerFeedback(t,n,r){return r.playerFeedbackID?this.webAPI.putData(`admin/players/${t}/teams/${n}/feedback/${r.playerFeedbackID}`,r):this.webAPI.postData(`admin/players/${t}/teams/${n}/feedback`,r)}deletePlayerFeedback(t,n,r){return this.webAPI.deleteData(`admin/players/${t}/teams/${n}/feedback/${r}`)}};d.\u0275fac=function(n){return new(n||d)(it(ci))},d.\u0275prov=gt({token:d,factory:d.\u0275fac});let a=d;return a})();function Ad(a,d){if(a&1){let i=y();e(0,`
961    `),s(1,"app-dynamic-form",1),v("onCancel",function(){g(i);let n=m();return f(n.cancel.emit())})("onSubmit",function(n){g(i);let r=m();return f(r.saveFeedback(n))})("onDelete",function(){g(i);let n=m();return f(n.deleteFeedback())}),e(2,`
962      `),x(3,"app-dynamic-form-field",2),e(4,`
963      `),x(5,"app-dynamic-form-field",3),e(6,`
964    `),o(),e(7,`
965  `)}if(a&2){let i=m();l(),_("fields",i.feedbackFields)("entity",i.playerFeedback)("horizontalForm",!0)("contentFieldsMode",!0)("showSaveAndAddButton",!1)("showSubmitButton",!0)("showCancelButton",!0)("showDeleteButton",!!i.playerFeedbackID)}}function Nd(a,d){a&1&&(e(0,`
966    `),x(1,"app-skeleton-template",4),e(2,`
967  `))}var ji=(()=>{let d=class d{constructor(t,n,r){this.playerFeedbackService=t,this.siteDataService=n,this.formService=r,this.save=new fe,this.delete=new fe,this.cancel=new fe,this.loadingFeedbackModal=!1,this.unsubsribe$=new U}ngOnInit(){this.loadingFeedbackModal=!0,this.playerFeedbackID?j([this.playerFeedbackService.getPlayerFeedbackMetadata(),this.playerFeedbackService.getPlayerFeedbackItem(this.playerID,this.teamID,this.playerFeedbackID)]).pipe(Ki(500),S(this.unsubsribe$)).subscribe(t=>{this.feedbackFields=t[0].fields,this.playerFeedback=t[1],this.loadingFeedbackModal=!1},()=>{this.siteDataService.showSiteErrorAlert("There was a problem getting data")}):this.playerFeedbackService.getPlayerFeedbackMetadata().pipe(Ki(500),S(this.unsubsribe$)).subscribe(t=>{this.feedbackFields=t.fields,this.playerFeedback=new Bi,this.loadingFeedbackModal=!1},()=>{this.siteDataService.showSiteErrorAlert("There was a problem getting data")})}saveFeedback(t){t.playerFeedbackID=this.playerFeedbackID,this.playerFeedbackService.savePlayerFeedback(this.playerID,this.teamID,t).pipe(S(this.unsubsribe$)).subscribe(n=>{this.siteDataService.showSiteSuccessAlert("Player feedback saved successfully"),n?(this.playerFeedback=n,this.playerFeedbackID=n.playerFeedbackID):this.playerFeedback=Pe(Pe({},this.playerFeedback),n),this.save.emit(this.playerFeedback)},()=>{this.siteDataService.showSiteErrorAlert("There was a problem saving player feedback"),this.formService.hideFormLoader()})}deleteFeedback(){this.playerFeedbackService.deletePlayerFeedback(this.playerID,this.teamID,this.playerFeedbackID).pipe(S(this.unsubsribe$)).subscribe(()=>{this.siteDataService.showSiteSuccessAlert("Player feedback deleted successfully"),this.delete.emit()},()=>{this.siteDataService.showSiteErrorAlert("There was a problem deleting player feedback")})}ngOnDestroy(){this.unsubsribe$.next(),this.unsubsribe$.complete()}};d.\u0275fac=function(n){return new(n||d)(C(jt),C(E),C(Se))},d.\u0275cmp=D({type:d,selectors:[["app-feedback-edit"]],inputs:{playerID:"playerID",teamID:"teamID",playerFeedbackID:"playerFeedbackID"},outputs:{save:"save",delete:"delete",cancel:"cancel"},standalone:!1,decls:4,vars:5,consts:[["styleClass","mediumWidthDialog",3,"visible","modal","closable","header"],["buttonsPosition","left","formID","feedback-form",3,"onCancel","onSubmit","onDelete","fields","entity","horizontalForm","contentFieldsMode","showSaveAndAddButton","showSubmitButton","showCancelButton","showDeleteButton"],["fieldName","playerFeedbackCategoryID","formID","feedback-form"],["fieldName","feedbackText","formID","feedback-form"],["skeletonType","form"]],template:function(n,r){n&1&&(s(0,"p-dialog",0),e(1,`
968  `),p(2,Ad,8,8)(3,Nd,3,0),o()),n&2&&(_("visible",!0)("modal",!0)("closable",!1)("header",r.playerFeedbackID?"Edit Feedback":"Add Feedback"),l(2),u(!r.loadingFeedbackModal&&r.feedbackFields?2:3))},dependencies:[he,_e,gi,oe],encapsulation:2});let a=d;return a})();var Bd=()=>({"min-width":"50%"}),zi=a=>[a],jd=(a,d,i)=>[a,d,i],pn=a=>["admin-view",a,"overview"],un=a=>[a,"profile"],zd=()=>[1,2,3,4,5,6,7,8],qi=a=>({active:a}),Gi=a=>({"col-md-7":a}),qd=a=>["/admin/teams/assign-players/programs",a,"all"],Wd=(a,d,i)=>({inviteStatusID:a,teamID:d,invitationOption:i}),Hd=()=>[];function Gd(a,d){if(a&1&&(e(0,`
969            `),s(1,"app-split-button",27,1),e(3,`
970            `),o(),e(4,`
971            `)),a&2){let i=m(4);l(),_("menuItems",i.actionMenuItems)}}function Yd(a,d){if(a&1){let i=y();e(0,`
972    `),s(1,"div",28),e(2,`
973        `),s(3,"span")(4,"strong")(5,"a",29),v("click",function(){g(i);let n=m(4);return n.modalRosteringData=n.getPlayerRoster([n.InviteStatus.ACCEPTED]),n.inviteStatusID=n.InviteStatus.ACCEPTED,n.invitationOption=void 0,f(n.showDetail
973sModal=!0)}),e(6),o()(),e(7,"Accepted"),o(),e(8,`
974        `),s(9,"span")(10,"strong")(11,"a",29),v("click",function(){g(i);let n=m(4);return n.modalRosteringData=n.getRosterInvited(n.getPlayerRoster([n.InviteStatus.INVITED])),n.inviteStatusID=n.InviteStatus.INVITED,n.invitationOption=1,f(n.showDetailsModal=!0)}),e(12),o()(),e(13,"Invited"),o(),e(14,`
975        `),s(15,"span")(16,"strong")(17,"a",29),v("click",function(){g(i);let n=m(4);return n.modalRosteringData=n.getPlayerRoster([n.InviteStatus.DECLINED]),n.inviteStatusID=n.InviteStatus.DECLINED,n.invitationOption=void 0,f(n.showDetailsModal=!0)}),e(18),o()(),e(19,"Declined"),o(),e(20,`
976        `),s(21,"span")(22,"strong")(23,"a",29),v("click",function(){g(i);let n=m(4);return n.modalRosteringData=n.getRosterExpired(n.getPlayerRoster([n.InviteStatus.INVITED])),n.inviteStatusID=n.InviteStatus.INVITED,n.invitationOption=3,f(n.showDetailsModal=!0)}),e(24),o()(),e(25,"Expired"),o(),e(26,`
977        `),s(27,"span")(28,"strong")(29,"a",29),v("click",function(){g(i);let n=m(4);return n.modalRosteringData=n.getPlayerRoster([n.InviteStatus.ACCEPTED,n.InviteStatus.INVITED,n.InviteStatus.DECLINED]),n.inviteStatusID=void 0,n.invitationOption=void 0,f(n.showDetail
977sModal=!0)}),e(30),o()(),e(31,"Total"),o(),e(32,`
978    `),o(),e(33,`
979    `)}if(a&2){let i,t,n,r=m(4);l(6),T((i=r.getPlayerRoster(L(5,zi,r.InviteStatus.ACCEPTED)))==null?null:i.length),l(6),T(r.getRosterTotalInvited(r.getPlayerRoster(L(7,zi,r.InviteStatus.INVITED)))),l(6),T((t=r.getPlayerRoster(L(9,zi,r.InviteStatus.DECLINED)))==null?null:t.length),l(6),T(r.getRosterTotalExpired(r.getPlayerRoster(L(11,zi,r.InviteStatus.INVITED)))),l(6),T((n=r.getPlayerRoster(at(13,jd,r.InviteStatus.ACCEPTED,r.InviteStatus.INVITED,r.InviteStatus.DECLINED)))==null?null:n.length)}}function Qd(a,d){if(a&1&&(e(0,`
980                    `),s(1,"div",44),e(2),o(),e(3,`
981                    `)),a&2){let i=m().$implicit;l(2),T((i.playerClubData==null||i.playerClubData.position==null?null:i.playerClubData.position.name)||"\xA0")}}function Jd(a,d){a&1&&(e(0,`
982                    `),x(1,"i",45),e(2,`
983                    `))}function Kd(a,d){a&1&&(e(0,`
984                    `),s(1,"app-pill",46),e(2,`
985                    `),o(),e(3,`
986                    `))}function Zd(a,d){if(a&1){let i=y();e(0,`
987                        `),s(1,"a",47),v("click",function(){g(i);let n=m(2).$implicit,r=m(4);return f(r.toggleVolunteering(n))}),e(2),o(),e(3,`
988                        `)}if(a&2){let i=m(2).$implicit;l(2),z(`Volunteer
989                            Requirement:
990                            `,(i==null||i.programTeamVolunteerSummary==null?null:i.programTeamVolunteerSummary.completedVolunteering)||0," / ",(i==null||i.programTeamVolunteerSummary==null?null:i.programTeamVolunteerSummary.requiredHours)||0)}}function Xd(a,d){if(a&1&&(e(0,`
991                        `),s(1,"span"),e(2),o(),e(3,`
992                        `)),a&2){let i=m(2).$implicit;l(2),z(`Volunteer
993                            Requirement: `,(i==null||i.programTeamVolunteerSummary==null?null:i.programTeamVolunteerSummary.completedVolunteering)||0,` /
994                            `,(i==null||i.programTeamVolunteerSummary==null?null:i.programTeamVolunteerSummary.requiredHours)||0)}}function em(a,d){if(a&1&&(e(0,`
995                    `),s(1,"div",44),e(2,`
996                        `),p(3,Zd,4,2),p(4,Xd,4,2),o(),e(5,`
997                    `)),a&2){let i=m().$implicit;l(3),u((i.programTeamVolunteerSummary==null||i.programTeamVolunteerSummary.completedRoles==null?null:i.programTeamVolunteerSummary.completedRoles.length)>0?3:-1),l(),u((i.programTeamVolunteerSummary==null||i.programTeamVolunteerSummary.completedRoles==null?null:i.programTeamVolunteerSummary.completedRoles.length)===0?4:-1)}}function tm(a,d){if(a&1&&(e(0,`
998                    `),x(1,"i",48),e(2)),a&2){let i=m().$implicit;l(2),w(`
999                    `,i.playerFeedbackCount,`
1000                    `)}}function im(a,d){if(a&1&&e(0),a&2){let i=m(3).$implicit;w(`
1001                            #`,i.playerClubData.number,`
1002                            `)}}function nm(a,d){if(a&1&&(e(0,`
1003                    `),s(1,"div"),e(2,`
1004                        `),s(3,"div",49),e(4,`
1005                            `),p(5,im,1,1),o(),e(6,`
1006                    `),o(),e(7,`
1007                    `)),a&2){let i=m(2).$implicit;l(5),u(i.playerClubData!=null&&i.playerClubData.number?5:-1)}}function am(a,d){if(a&1){let i=y();e(0,`
1008                    `),s(1,"div"),e(2,`
1009                        `),s(3,"label",50),e(4),o(),e(5,`
1010                        `),s(6,"input",51),v("ngModelChange",function(n){g(i);let r=m(2).$implicit,c=m(4);return f(c.updatePlayerData(r,n))}),o(),e(7,`
1011                    `),o(),e(8,`
1012                    `)}if(a&2){let i=m(2).$implicit,t=m(4);l(4),T(t.fieldName(t.FieldOption.JERSEY_NUMBER)),l(2),_("ngModel",i.playerClubData==null?null:i.playerClubData.number)("name",i.playerID.toString())}}function om(a,d){if(a&1&&(e(0,`
1013                    `),p(1,nm,8,1)(2,am,9,3)),a&2){let i=m(5);l(),u(i.playerEditMode?2:1)}}function rm(a,d){if(a&1){let i=y();e(0,`
1014                    `),s(1,"button",52),v("click",function(){g(i);let n=m().$implicit,r=m(4);return f(r.addFeedback(n.playerID))}),e(2,`
1015                        Add Feedback
1016                    `),o(),e(3,`
1017                    `)}}function sm(a,d){a&1&&(e(0,`
1018                    `),s(1,"tr"),e(2,`
1019                        `),s(3,"th"),e(4,"Task"),o(),e(5,`
1020                        `),s(6,"th"),e(7,"Description"),o(),e(8,`
1021                        `),s(9,"th"),e(10,"Points"),o(),e(11,`
1022                        `),s(12,"th"),e(13,"Completed By"),o(),e(14,`
1023                        `),s(15,"th"),e(16,"Date"),o(),e(17,`
1024                        `),s(18,"th"),e(19,"Time"),o(),e(20,`
1025                        `),s(21,"th"),e(22,"Attendance"),o(),e(23,`
1026                        `),s(24,"th"),e(25,"Description"),o(),e(26,`
1027                        `),s(27,"th"),e(28,"Notes"),o(),e(29,`
1028                        `),s(30,"th"),e(31,"Type"),o(),e(32,`
1029                    `),o(),e(33,`
1030                `))}function lm(a,d){a&1&&(e(0,`
1031                            `),s(1,"span"),e(2,"Custom"),o(),e(3,`
1032                            `))}function dm(a,d){a&1&&(e(0,`
1033                            `),s(1,"span"),e(2,"Event"),o(),e(3,`
1034                            `))}function mm(a,d){if(a&1&&(e(0,`
1035                    `),s(1,"tr"),e(2,`
1036                        `),s(3,"td"),e(4),o(),e(5,`
1037                        `),s(6,"td"),e(7),o(),e(8,`
1038                        `),s(9,"td"),e(10),o(),e(11,`
1039                        `),s(12,"td"),e(13),o(),e(14,`
1040                        `),s(15,"td"),e(16),N(17,"date"),o(),e(18,`
1041                        `),s(19,"td"),e(20),N(21,"timeOnly"),N(22,"timeOnly"),o(),e(23,`
1042                        `),s(24,"td"),e(25),o(),e(26,`
1043                        `),s(27,"td"),e(28,`
1044                            `),x(29,"i",54),e(30,`
1045                        `),o(),e(31,`
1046                        `),s(32,"td"),e(33,`
1047                            `),x(34,"i",54),e(35,`
1048                        `),o(),e(36,`
1049                        `),s(37,"td"),e(38,`
1050                            `),p(39,lm,4,0),p(40,dm,4,0),o(),e(41,`
1051                    `),o(),e(42,`
1052                `)),a&2){let i=d.$implicit;l(4),w(`
1053                            `,i.roleName,`
1054                        `),l(3),T(i.description),l(3),T(i.points),l(3),T(i.completedBy),l(3),T(B(17,16,i.startDate,"MMM d, y")),l(4),z("",xe(21,19,i.startTime)," - ",xe(22,21,i.endTime)),l(5),T(i.isVerifiedAsCompleted?"Approved":""),l(4),nt(i.description?"fas fa-info":"far fa-info"),_("pTooltip",i.description),l(5),nt(i.notes?"fas fa-note":"far fa-note"),_("pTooltip",i.notes),l(5),u(i.customVolunteerID?39:-1),l(),u(i.customVolunteerID?-1:40)}}function cm(a,d){if(a&1&&(e(0,`
1055        `),s(1,"div"),e(2,`
1056            `),s(3,"p-table",53),e(4,`
1057                `),A(5,sm,34,0,"ng-template",11),e(6,`
1058                `),A(7,mm,43,23,"ng-template",12),e(8,`
1059            `),o(),e(9,`
1060        `),o(),e(10,`
1061        `)),a&2){let i=m().$implicit;l(3),_("value",i.programTeamVolunteerSummary.completedRoles)}}function pm(a,d){if(a&1&&(e(0,`
1062    `),s(1,"div",30),e(2,`
1063        `),s(3,"div",31),e(4,`
1064            `),s(5,"div",32),e(6,`
1065                `),e(7,`
1066                `),s(8,"div",33),e(9,`
1067                    `),s(10,"app-player-profile-photo",34),e(11,`
1068                    `),o(),e(12,`
1069                `),o(),e(13,`
1070                `),e(14,`
1071                `),s(15,"div",35),e(16),p(17,Qd,4,1),o(),e(18,`
1072            `),o(),e(19,`
1073            `),s(20,"div",36),e(21,`
1074                `),e(22,`
1075                `),s(23,"div",37),e(24,`
1076                    `),p(25,Jd,3,0),p(26,Kd,4,0),o(),e(27,`
1077                `),e(28,`
1078                `),s(29,"div",38),e(30,`
1079                    `),p(31,em,6,2),o(),e(32,`
1080                `),e(33,`
1081                `),s(34,"div",39),e(35,`
1082                    `),p(36,tm,3,1),o(),e(37,`
1083                `),e(38,`
1084                `),s(39,"div",40),e(40,`
1085                    `),p(41,om,3,1),o(),e(42,`
1086                `),e(43,`
1087                `),s(44,"div",41),e(45,`
1088                    `),p(46,rm,4,0),o(),e(47,`
1089                `),e(48,`
1090                `),s(49,"div",42),e(50,`
1091                    `),s(51,"a",43),e(52,`
1092                        Profile
1093                    `),o(),e(53,`
1094                `),o(),e(54,`
1095            `),o(),e(55,`
1096        `),o(),e(56,`
1097        `),p(57,cm,11,1),o(),e(58,`
1098    `)),a&2){let i=d.$implicit,t=m(4);l(10),_("player",i)("largeCircle",!1)("initialsOnly",t.hidePlayerPhotos),l(6),w(`
1099                    `,i.user.lastName+", "+i.user.firstName,`
1100                    `),l(),u(!(i.playerClubData==null||i.playerClubData.position==null)&&i.playerClubData.position.name?17:-1),l(8),u(i.isCoCaptain?25:-1),l(),u(i.secondary?26:-1),l(5),u(t.volunteerSettings&&t.volunteerSettings.volunteerRequirement>0?31:-1),l(5),u(t.user[t.Permission.PlayerFeedback]&&i.playerFeedbackCount>0?36:-1),l(3),ie("list-row-item-sm",!t.playerEditMode),l(2),u(t.fieldEnabled(t.FieldOption.JERSEY_NUMBER)?41:-1),l(5),u(t.user[t.Permission.PlayerFeedback]&&!t.adminView?46:-1),l(5),_("routerLink",t.adminView?L(15,pn,i.playerID):L(17,un,i.playerID)),l(6),u(i.showVolunteering?57:-1)}}function um(a,d){a&1&&(e(0,`
1101                    `),s(1,"app-pill",46),e(2,`
1102                    `),o(),e(3,`
1103                    `))}function _m(a,d){if(a&1&&(e(0,`
1104                    `),s(1,"span"),e(2,`
1105                        `),x(3,"i",48),e(4),o(),e(5,`
1106                    `)),a&2){let i=m(2).$implicit;l(4),w(`
1107                        `,i.playerFeedbackCount,`
1108                    `)}}function hm(a,d){if(a&1&&(e(0,`
1109                    `),p(1,_m,6,1)),a&2){let i=m().$implicit;l(),u(i.playerFeedbackCount>0?1:-1)}}function gm(a,d){if(a&1&&(e(0,`
1110                        `),s(1,"div",56),e(2),o(),e(3,`
1111                        `)),a&2){let i=m(3).$implicit;l(2),w(`
1112                            #`,i.playerClubData.number,`
1113                        `)}}function fm(a,d){if(a&1&&(e(0,`
1114                    `),s(1,"div"),e(2,`
1115                        `),p(3,gm,4,1),o(),e(4,`
1116                    `)),a&2){let i=m(2).$implicit;l(3),u(i.playerClubData!=null&&i.playerClubData.number?3:-1)}}function xm(a,d){if(a&1){let i=y();e(0,`
1117                    `),s(1,"div"),e(2,`
1118                        `),s(3,"label",50),e(4),o(),e(5,`
1119                        `),s(6,"input",51),v("ngModelChange",function(n){g(i);let r=m(2).$implicit,c=m(5);return f(c.updatePlayerData(r,n))}),o(),e(7,`
1120                    `),o(),e(8,`
1121                    `)}if(a&2){let i=m(2).$implicit,t=m(5);l(4),T(t.fieldName(t.FieldOption.JERSEY_NUMBER)),l(2),_("ngModel",i.playerClubData==null?null:i.playerClubData.number)("name",i==null||i.playerID==null?null:i.playerID.toString())}}function Cm(a,d){if(a&1&&(e(0,`
1122                    `),p(1,fm,5,1)(2,xm,9,3)),a&2){let i=m(6);l(),u(i.playerEditMode?2:1)}}function vm(a,d){if(a&1){let i=y();e(0,`
1123                    `),s(1,"button",52),v("click",function(){g(i);let n=m().$implicit,r=m(5);return f(r.addFeedback(n.playerID))}),e(2,`
1124                        Add Feedback
1125                    `),o(),e(3,`
1126                    `)}}function bm(a,d){if(a&1&&(e(0,`
1127    `),s(1,"div",30),e(2,`
1128        `),s(3,"div",31),e(4,`
1129            `),s(5,"div",32),e(6,`
1130                `),e(7,`
1131                `),s(8,"div",33),e(9,`
1132                    `),s(10,"app-player-profile-photo",34),e(11,`
1133                    `),o(),e(12,`
1134                `),o(),e(13,`
1135                `),e(14,`
1136                `),s(15,"div",35),e(16),s(17,"div",44),e(18),o(),e(19,`
1137                `),o(),e(20,`
1138            `),o(),e(21,`
1139            `),s(22,"div",36),e(23,`
1140                `),e(24,`
1141                `),s(25,"div",37),e(26,`
1142                    `),p(27,um,4,0),o(),e(28,`
1143                `),e(29,`
1144                `),x(30,"div",38),e(31,`
1145                `),e(32,`
1146                `),s(33,"div",39),e(34,`
1147                    `),p(35,hm,2,1),o(),e(36,`
1148                `),e(37,`
1149                `),s(38,"div",40),e(39,`
1150                    `),p(40,Cm,3,1),o(),e(41,`
1151                `),e(42,`
1152                `),s(43,"div",41),e(44,`
1153                    `),p(45,vm,4,0),o(),e(46,`
1154                `),e(47,`
1155                `),s(48,"div",42),e(49,`
1156                    `),s(50,"a",43),e(51,`
1157                        Profile
1158                    `),o(),e(52,`
1159                `),o(),e(53,`
1160            `),o(),e(54,`
1161        `),o(),e(55,`
1162    `),o(),e(56,`
1163    `)),a&2){let i=d.$implicit,t=m(5);l(10),_("player",i)("largeCircle",!1)("initialsOnly",t.hidePlayerPhotos),l(6),w(`
1164                    `,i.user.firstName+" "+i.user.lastName,`
1165                    `),l(2),T(i.playerClubData==null||i.playerClubData.position==null?null:i.playerClubData.position.name),l(9),u(i.secondary?27:-1),l(8),u(t.user[t.Permission.PlayerFeedback]?35:-1),l(3),ie("list-row-item-sm",!t.playerEditMode),l(2),u(t.fieldEnabled(t.FieldOption.JERSEY_NUMBER)?40:-1),l(5),u(t.user[t.Permission.PlayerFeedback]&&!t.adminView?45:-1),l(5),_("routerLink",t.adminView?L(12,pn,i.playerID):L(14,un,i.playerID))}}function Sm(a,d){if(a&1&&(e(0,`
1166    `),s(1,"h2",55),e(2,"Suspended Players"),o(),e(3,`
1167    `),F(4,bm,57,16,null,null,$)),a&2){let i=m(4);l(4),V(i.suspendedPlayers)}}function ym(a,d){if(a&1&&(e(0,`
1168                        `),s(1,"span"),e(2,`
1169                            `),x(3,"i",48),e(4),o(),e(5,`
1170                        `)),a&2){let i=m().$implicit;l(4),w(`
1171                            `,i.playerFeedbackCount,`
1172                        `)}}function wm(a,d){if(a&1&&(e(0,`
1173                            `),s(1,"div",56),e(2),o(),e(3,`
1174                            `)),a&2){let i=m(3).$implicit;l(2),w(`
1175                                #`,i.playerClubData.number,`
1176                            `)}}function Tm(a,d){if(a&1&&(e(0,`
1177                        `),s(1,"div"),e(2,`
1178                            `),p(3,wm,4,1),o(),e(4,`
1179                        `)),a&2){let i=m(2).$implicit;l(3),u(i.playerClubData!=null&&i.playerClubData.number?3:-1)}}function Dm(a,d){if(a&1){let i=y();e(0,`
1180                        `),s(1,"div"),e(2,`
1181                            `),s(3,"label",50),e(4),o(),e(5,`
1182                            `),s(6,"input",51),v("ngModelChange",function(n){g(i);let r=m(2).$implicit,c=m(5);return f(c.updatePlayerData(r,n))}),o(),e(7,`
1183                        `),o(),e(8,`
1184                        `)}if(a&2){let i=m(2).$implicit,t=m(5);l(4),T(t.fieldName(t.FieldOption.JERSEY_NUMBER)),l(2),_("ngModel",i.playerClubData==null?null:i.playerClubData.number)("name",i==null||i.playerID==null?null:i.playerID.toString())}}function Em(a,d){if(a&1&&(e(0,`
1185                        `),p(1,Tm,5,1)(2,Dm,9,3)),a&2){let i=m(6);l(),u(i.playerEditMode?2:1)}}function Im(a,d){if(a&1){let i=y();e(0,`
1186                        `),s(1,"button",52),v("click",function(){g(i);let n=m().$implicit,r=m(5);return f(r.addFeedback(n.playerID))}),e(2,`
1187                            Add Feedback
1188                        `),o(),e(3,`
1189                        `)}}function Mm(a,d){if(a&1&&(e(0,`
1190                    `),s(1,"span"),e(2,`Guest for
1191                        `),s(3,"strong"),e(4),o()(),e(5,`
1192                    `)),a&2){let i=m(2).$implicit;l(4),w("",i.guestEventsCount," event(s)")}}function Pm(a,d){if(a&1&&(e(0,`
1193                    `),s(1,"span"),e(2,`
1194                        Guest from `),s(3,"strong"),e(4),N(5,"date"),o(),e(6,`
1195                        through
1196                        `),s(7,"strong"),e(8),N(9,"date"),o(),e(10,`
1197                    `),o(),e(11,`
1198                    `)),a&2){let i=m(2).$implicit;l(4),T(B(5,2,i.guestStartDate,"M/d/yy")),l(4),T(B(9,5,i.guestEndDate,"M/d/yy"))}}function Rm(a,d){if(a&1&&(e(0,`
1199            `),s(1,"div",65),e(2,`
1200                `),s(3,"div",66),e(4,`
1201                    `),p(5,Mm,6,1),p(6,Pm,12,8),o(),e(7,`
1202            `),o(),e(8,`
1203            `)),a&2){let i=m().$implicit;l(5),u(i.guestEventsCount?5:-1),l(),u(!i.guestEventsCount&&i.guestStartDate&&i.guestEndDate?6:-1)}}function km(a,d){if(a&1){let i=y();e(0,`
1204        `),s(1,"div",59),e(2,`
1205            `),s(3,"div",60),e(4,`
1206                `),s(5,"div",32),e(6,`
1207                    `),e(7,`
1208                    `),s(8,"div",33),e(9,`
1209                        `),s(10,"app-player-profile-photo",34),e(11,`
1210                        `),o(),e(12,`
1211                    `),o(),e(13,`
1212                    `),e(14,`
1213                    `),s(15,"div",35),e(16),s(17,"div",44),e(18),o(),e(19,`
1214                    `),o(),e(20,`
1215                `),o(),e(21,`
1216                `),s(22,"div",36),e(23,`
1217                    `),e(24,`
1218                    `),x(25,"div",37),e(26,`
1219                    `),e(27,`
1220                    `),x(28,"div",38),e(29,`
1221                    `),e(30,`
1222                    `),s(31,"div",39),e(32,`
1223                        `),p(33,ym,6,1),o(),e(34,`
1224                    `),e(35,`
1225                    `),s(36,"div",40),e(37,`
1226                        `),p(38,Em,3,1),o(),e(39,`
1227                    `),e(40,`
1228                    `),s(41,"div",41),e(42,`
1229                        `),p(43,Im,4,0),o(),e(44,`
1230                    `),e(45,`
1231                    `),s(46,"div",42),e(47,`
1232                        `),s(48,"a",43),e(49,`
1233                            Profile
1234                        `),o(),e(50,`
1235                    `),o(),e(51,`
1236                    `),s(52,"div",61),e(53,`
1237                        `),s(54,"button",62),v("click",function(n){let r=g(i).$implicit;m();let c=Re(9),h=m(4);return c.toggle(n),f(h.selectedPlayerID=r.playerID)}),e(55,`
1238                            `),x(56,"i",63),e(57,`
1239                            `),s(58,"span",64),e(59,"more"),o(),e(60,`
1240                        `),o(),e(61,`
1241                    `),o(),e(62,`
1242                `),o(),e(63,`
1243            `),o(),e(64,`
1244            `),p(65,Rm,9,2),o(),e(66,`
1245        `)}if(a&2){let i=d.$implicit,t=m(5);l(10),_("player",i)("largeCircle",!1)("initialsOnly",t.hidePlayerPhotos),l(6),w(`
1246                        `,i.user.firstName+" "+i.user.lastName,`
1247                        `),l(2),T(i.playerClubData==null||i.playerClubData.position==null?null:i.playerClubData.position.name),l(15),u(t.user[t.Permission.PlayerFeedback]&&i.playerFeedbackCount>0?33:-1),l(3),ie("list-row-item-sm",!t.playerEditMode),l(2),u(t.fieldEnabled(t.FieldOption.JERSEY_NUMBER)?38:-1),l(5),u(t.user[t.Permission.PlayerFeedback]&&!t.adminView?43:-1),l(5),_("routerLink",t.adminView?L(12,pn,i.playerID):L(14,un,i.playerID)),l(17),u(i.guestEventsCount||i.guestStartDate&&i.guestEndDate?65:-1)}}function Fm(a,d){if(a&1&&(e(0,`
1248    `),s(1,"div",57),e(2,`
1249        `),s(3,"h2",22),e(4,"Guest Players"),o(),e(5,`
1250        `),F(6,km,67,16,null,null,$),s(8,"p-menu",58,2),e(10,`
1251        `),o(),e(11,`
1252    `),o(),e(12,`
1253    `)),a&2){let i=m(4);
1253l(6),V(i.guestPlayers),l(2),_("popup",!0)("model",i.menuOptions)}}function Vm(a,d){if(a&1){let i=y();e(0,`
1254    `),s(1,"div",67),e(2,`
1255        `),s(3,"a",68),v("click",function(){g(i);let n=m(4);return f(n.savePlayerData())}),e(4,`
1256            Save
1257        `),o(),e(5,`
1258        `),s(6,"a",69),v("click",function(){g(i);let n=m(4);return f(n.exitPlayerEditMode())}),e(7,`
1259            Cancel
1260        `),o(),e(8,`
1261    `),o(),e(9,`
1262    `)}}function Am(a,d){if(a&1){let i=y();e(0,`
1263`),s(1,"div",20),e(2,`
1264    `),s(3,"div",21),e(4,`
1265        `),s(5,"h2",22),e(6),o(),e(7,`
1266        `),s(8,"div",23),e(9,`
1267            `),s(10,"div",24),e(11,`
1268                `),s(12,"label",25),e(13,"Sort"),o(),e(14,`
1269                `),s(15,"p-select",26),v("onChange",function(){g(i);let n=m(3);return f(n.getRoster())}),R("ngModelChange",function(n){g(i);let r=m(3);return P(r.orderBy,n)||(r.orderBy=n),f(n)}),e(16,`
1270                `),o(),e(17,`
1271            `),o(),e(18,`
1272            `),p(19,Gd,5,1),o(),e(20,`
1273    `),o(),e(21,`
1274    `),p(22,Yd,34,17),F(23,pm,59,19,null,null,$),p(25,Sm,6,0),p(26,Fm,13,2),p(27,Vm,10,0),o(),e(28,`
1275`)}if(a&2){let i=m(3);l(6),w("Roster (",i.rosterPlayers==null?null:i.rosterPlayers.length,")"),l(9),M("ngModel",i.orderBy),_("options",i.options)("filter",!1),l(4),u(i.actionMenuItems!=null&&i.actionMenuItems.length&&!i.playerEditMode?19:-1),l(3),u(i.program.programInvitationTypeID===i.ProgramInvitationType.INVITATIONAL_WITH_REGISTRATION&&i.rosteringData?22:-1),l(),V(i.rosterPlayers),l(2),u((i.suspendedPlayers==null?null:i.suspendedPlayers.length)>0?25:-1),l(),u((i.guestPlayers==null?null:i.guestPlayers.length)>0?26:-1),l(),u(i.playerEditMode?27:-1)}}function Nm(a,d){a&1&&(e(0,`
1276`),s(1,"div",70),e(2,`
1277    `),s(3,"app-inline-alert",71),e(4,`Please select a team to see their roster.
1278    `),o(),e(5,`
1279`),o(),e(6,`
1280`)),a&2&&(l(3),_("isInline",!0))}function Lm(a,d){if(a&1&&(e(0,`
1281`),p(1,Am,29,9)(2,Nm,7,1)),a&2){let i=m(2);l(),u(i.roster?1:2)}}function $m(a,d){if(a&1&&(e(0,`
1282`),p(1,Lm,3,1)),a&2){let i=m();l(),u(i.selectTimeframe?-1:1)}}function Um(a,d){a&1&&(e(0,`
1283`),s(1,"div",72),e(2,`
1284    `),x(3,"app-skeleton-template",74),e(4,`
1285`),o(),e(5,`
1286`))}function Om(a,d){a&1&&(e(0,`
1287`),s(1,"div",72),e(2,`
1288    `),x(3,"app-skeleton-template",73),e(4,`
1289`),o(),e(5,`
1290`),F(6,Um,6,0,null,null,$)),a&2&&(l(6),V(Q(0,zd)))}function Bm(a,d){if(a&1){let i=y();e(0,`
1291`),s(1,"app-feedback-edit",75),v("save",function(){g(i);let n=m();return f(n.feedbackSave())})("cancel",function(){g(i);let n=m();return f(n.showFeedbackModal=!1)}),e(2,`
1292`),o(),e(3,`
1293`)}if(a&2){let i=m();l(),_("playerID",i.playerID)("teamID",i.teamID)}}function jm(a,d){a&1&&(e(0,`
1294                `),s(1,"app-pill",46),e(2,`
1295                `),o(),e(3,`
1296                `))}function zm(a,d){if(a&1&&(e(0,`
1297                `),s(1,"span"),e(2,`
1298                    `),x(3,"i",48),e(4),o(),e(5,`
1299                `)),a&2){let i=m(3);l(4),w(`
1300                    `,i.selectedPlayer.playerFeedbackCount,`
1301                `)}}function qm(a,d){if(a&1&&(e(0,`
1302                `),p(1,zm,6,1)),a&2){let i=m(2);l(),u(i.selectedPlayer.playerFeedbackCount>0?1:-1)}}function Wm(a,d){if(a&1&&(e(0,`
1303                    `),s(1,"div",56),e(2),o(),e(3,`
1304                    `)),a&2){let i=m(3);l(2),w(`
1305                        #`,i.selectedPlayer.playerClubData.number,`
1306                    `)}}function Hm(a,d){if(a&1&&(e(0,`
1307                `),s(1,"div"),e(2,`
1308                    `),p(3,Wm,4,1),o(),e(4,`
1309                `)),a&2){let i=m(2);l(3),u(i.selectedPlayer.playerClubData!=null&&i.selectedPlayer.playerClubData.number?3:-1)}}function Gm(a,d){if(a&1){let i=y();e(0,`
1310                `),s(1,"div",92),e(2,`
1311                    `),s(3,"div",93),e(4,`
1312                        `),s(5,"label",94),e(6,"FROM"),o(),e(7,`
1313                        `),s(8,"p-datepicker",95),R("ngModelChange",function(n){g(i);let r=m(2);return P(r.guestStartDate,n)||(r.guestStartDate=n),f(n)}),v("onSelect",function(){g(i);let n=m(2);return f(n.guestEndDate=null)}),e(9,`
1314                        `),o(),e(10,`
1315                    `),o(),e(11,`
1316                    `),s(12,"div",93),e(13,`
1317                        `),s(14,"label",96),e(15,"TO"),o(),e(16,`
1318                        `),s(17,"p-datepicker",97),R("ngModelChange",function(n){g(i);let r=m(2);return P(r.guestEndDate,n)||(r.guestEndDate=n),f(n)}),e(18,`
1319                        `),o(),e(19,`
1320                    `),o(),e(20,`
1321                `),o(),e(21,`
1322                `)}if(a&2){let i=m(2);l(8),M("ngModel",i.guestStartDate),_("showIcon",!0),l(9),M("ngModel",i.guestEndDate),_("showIcon",!0)("minDate",i.guestStartDate)}}function Ym(a,d){a&1&&e(0,`
1323                                        Time TBD
1324                                        `)}function Qm(a,d){if(a&1&&(e(0,`
1325                                        `),s(1,"div",104),e(2),N(3,"date"),N(4,"date"),o(),e(5,`
1326                                        `)),a&2){let i=m(2).$implicit;l(),_("ngClass",L(9,Gi,i.clubEventType==null?null:i.clubEventType.description)),l(),z(`
1327                                            `,B(3,3,i.startDate,"h:mmaaaaa"),` -
1328                                            `,B(4,6,i.endDate,"h:mmaaaaa"),`
1329                                        `)}}function Jm(a,d){if(a&1&&(e(0,`
1330                                        `),s(1,"div",104),e(2),N(3,"date"),o(),e(4,`
1331                                        `)),a&2){let i=m(2).$implicit;l(),_("ngClass",L(5,Gi,i.clubEventType==null?null:i.clubEventType.description)),l(),w(`
1332                                            `,B(3,2,i.startDate,"E M/d"),`
1333                                        `)}}function Km(a,d){if(a&1&&(e(0,`
1334                                        `),s(1,"div",104),e(2),N(3,"date"),N(4,"date"),N(5,"date"),N(6,"date"),o(),e(7,`
1335                                        `)),a&2){let i=m(2).$implicit;l(),_("ngClass",L(17,Gi,i.clubEventType==null?null:i.clubEventType.description)),l(),wn(`
1336                                            `,B(3,5,i.startDate,"E M/d"),` -
1337                                            `,B(4,8,i.endDate,"E M/d"),`,
1338                                            `,B(5,11,i.startDate,"h:mmaaaaa"),` -
1339                                            `,B(6,14,i.endDate,"h:mmaaaaa"),`
1340                                        `)}}function Zm(a,d){if(a&1&&(e(0,`
1341                                        `),s(1,"div",104),e(2),N(3,"date"),N(4,"date"),o(),e(5,`
1342                                        `)),a&2){let i=m(2).$implicit;l(),_("ngClass",L(9,Gi,i.clubEventType==null?null:i.clubEventType.description)),l(),z(`
1343                                            `,B(3,3,i.startDate,"E M/d"),` -
1344                                            `,B(4,6,i.endDate,"E M/d"),`
1345                                        `)}}function Xm(a,d){if(a&1&&(e(0,`
1346                                        `),e(1,`
1347                                        `),p(2,Qm,6,11),p(3,Jm,5,7),p(4,Km,8,19),p(5,Zm,6,11)),a&2){let i=m().$implicit,t=m(4);l(2),u(t.sameDay(i.endDate,i.startDate)&&!i.isAllDayEvent?2:-1),l(),u(t.sameDay(i.endDate,i.startDate)&&i.isAllDayEvent?3:-1),l(),u(!t.sameDay(i.endDate,i.startDate)&&!i.isAllDayEvent?4:-1),l(),u(!t.sameDay(i.endDate,i.startDate)&&i.isAllDayEvent?5:-1)}}function e0(a,d){if(a&1&&e(0),a&2){let i=m(2).$implicit;w(`
1348                                        `,i.team.name+" @ "+i.opponent,`
1349                                        `)}}function t0(a,d){if(a&1&&e(0),a&2){let i=m(2).$implicit;w(`
1350                                        `,i.team.name+" vs "+i.opponent,`
1351                                        `)}}function i0(a,d){if(a&1&&(e(0,`
1352                                        `),p(1,e0,1,1)(2,t0,1,1)),a&2){let i=m().$implicit;l(),u(i.awayGame?1:2)}}function n0(a,d){if(a&1&&e(0),a&2){let i=m().$implicit;z(`
1353                                        `,i==null||i.team==null?null:i.team.name," ",i.title,`
1354                                        `)}}function a0(a,d){if(a&1){let i=y();e(0,`
1355                                `),s(1,"tr"),e(2,`
1356                                    `),s(3,"td"),e(4,`
1357                                        `),x(5,"app-calendar-card",101),e(6,`
1358                                    `),o(),e(7,`
1359                                    `),s(8,"td",66),e(9,`
1360                                        `),p(10,Ym,1,0)(11,Xm,6,4),o(),e(12,`
1361                                    `),s(13,"td",66),e(14,`
1362                                        `),p(15,i0,3,1)(16,n0,1,2),o(),e(17,`
1363                                    `),s(18,"td")(19,"button",102),v("click",function(){let n=g(i).$implicit,r=m(4);return f(r.removeEvent(n.id))}),e(20,`
1364                                            `),x(21,"i",103),o()(),e(22,`
1365                                `),o(),e(23,`
1366                                `)}if(a&2){let i=d.$implicit,t=m(4);l(5),_("startDate",i.startDate)("endDate",i.endDate)("clubEventTypeID",i.clubEventTypeID),l(5),u(i.showTimeTBD?10:11),l(5),u(i.clubEventTypeID===t.CalendarEventType.GAME?15:16)}}function o0(a,d){a&1&&(e(0,`
1367                                `),s(1,"tr"),e(2,`
1368                                    `),s(3,"td",105),e(4,`
1369                                        `),s(5,"i"),e(6,"No events selected"),o(),e(7,`
1370                                    `),o(),e(8,`
1371                                `),o(),e(9,`
1372                                `))}function r0(a,d){if(a&1&&(e(0,`
1373                    `),s(1,"div",99),e(2,`
1374                        `),s(3,"table",100),e(4,`
1375                            `),s(5,"thead"),e(6,`
1376                                `),s(7,"tr"),e(8,`
1377                                    `),s(9,"th"),e(10,"Date"),o(),e(11,`
1378                                    `),s(12,"th"),e(13,"Time"),o(),e(14,`
1379                                    `),s(15,"th"),e(16,"Title"),o(),e(17,`
1380                                    `),x(18,"th"),e(19,`
1381                                `),o(),e(20,`
1382                            `),o(),e(21,`
1383                            `),s(22,"tbody"),e(23,`
1384                                `),F(24,a0,24,5,null,null,$),p(26,o0,10,0),o(),e(27,`
1385                        `),o(),e(28,`
1386                    `),o(),e(29,`
1387                    `)),a&2){let i=m(3);l(24),V(i.selectedCalendarEvents),l(2),u(!i.selectedCalendarEvents||i.selectedCalendarEvents.length===0?26:-1)}}function s0(a,d){if(a&1){let i=y();e(0,`
1388                `),s(1,"div"),e(2,`
1389                    `),p(3,r0,30,1),s(4,"div",98),e(5,`
1390                        `),s(6,"button",69),v("click",function(){g(i);let n=m(2);return f(n.showCalendarEventsDialog=!0)}),e(7,"Add Events"),o(),e(8,`
1391                    `),o(),e(9,`
1392                `),o(),e(10,`
1393                `)}if(a&2){let i=m(2);l(3),u(i.selectedCalendarEvents&&i.selectedCalendarEvents.length!==0?3:-1)}}function l0(a,d){if(a&1){let i=y();e(0,`
1394`),s(1,"div",76),e(2,`
1395    `),s(3,"div",31),e(4,`
1396        `),s(5,"div",32),e(6,`
1397            `),e(7,`
1398            `),s(8,"div",33),e(9,`
1399                `),s(10,"app-player-profile-photo",34),e(11,`
1400                `),o(),e(12,`
1401            `),o(),e(13,`
1402            `),e(14,`
1403            `),s(15,"div",35),e(16),s(17,"div",44),e(18),o(),e(19,`
1404            `),o(),e(20,`
1405        `),o(),e(21,`
1406        `),s(22,"div",36),e(23,`
1407            `),e(24,`
1408            `),s(25,"div",37),e(26,`
1409                `),p(27,jm,4,0),o(),e(28,`
1410            `),e(29,`
1411            `),x(30,"div",38),e(31,`
1412            `),e(32,`
1413            `),s(33,"div",39),e(34,`
1414                `),p(35,qm,2,1),o(),e(36,`
1415            `),e(37,`
1416            `),s(38,"div",40),e(39,`
1417                `),p(40,Hm,5,1),o(),e(41,`
1418        `),o(),e(42,`
1419    `),o(),e(43,`
1420`),o(),e(44,`
1421`),s(45,"div",77),e(46,`
1422    `),s(47,"h3",78),e(48,"Player Timeframe"),o(),e(49,`
1423    `),s(50,"div",79),e(51,`
1424        `),s(52,"p"),e(53,`Players are added to the roster and messaging immediately, with schedule access for the timeframe you
1425            choose:`),o(),e(54,`
1426        `),s(55,"div",80),e(56,`
1427            `),s(57,"p-radioButton",81),R("ngModelChange",function(n){g(i);let r=m();return P(r.guestTimeframeOption,n)||(r.guestTimeframeOption=n),f(n)}),e(58,`
1428            `),o(),e(59,`
1429            `),s(60,"label",82),e(61,`
1430                `),s(62,"div",83),e(63,"Indefinite"),o(),e(64,`
1431                `),s(65,"div",66),e(66,`
1432                    Until the program ends (unless removed earlier).
1433                `),o(),e(67,`
1434            `),o(),e(68,`
1435        `),o(),e(69,`
1436        `),s(70,"div",80),e(71,`
1437            `),s(72,"p-radioButton",84),R("ngModelChange",function(n){g(i);let r=m();return P(r.guestTimeframeOption,n)||(r.guestTimeframeOption=n),f(n)}),e(73,`
1438            `),o(),e(74,`
1439            `),s(75,"label",85),e(76,`
1440                `),s(77,"div",83),e(78,"Specific Dates"),o(),e(79,`
1441                `),s(80,"div",86),e(81,`
1442                    From the selected start date through the end date.
1443                `),o(),e(82,`
1444                `),p(83,Gm,22,5),o(),e(84,`
1445        `),o(),e(85,`
1446        `),s(86,"div",80),e(87,`
1447            `),s(88,"p-radioButton",87),R("ngModelChange",function(n){g(i);let r=m();return P(r.guestTimeframeOption,n)||(r.guestTimeframeOption=n),f(n)}),e(89,`
1448            `),o(),e(90,`
1449            `),s(91,"label",88),e(92,`
1450                `),s(93,"div",83),e(94,"Selected Events"),o(),e(95,`
1451                `),s(96,"div",86),e(97,`
1452                    Only for chosen events, ending one day after the last event.
1453                `),o(),e(98,`
1454                `),p(99,s0,11,1),o(),e(100,`
1455        `),o(),e(101,`
1456    `),o(),e(102,`
1457    `),s(103,"div",89),e(104,`
1458        `),s(105,"button",90),v("click",function(){g(i);let n=m();return f(n.assignPlayer(!1))}),e(106,"Save"),o(),e(107,`
1459        `),s(108,"button",91),v("click",function(){g(i);let n=m();return f(n.assignPlayer(!0))}),e(109,`Save &
1460            Notify`),o(),e(110,`
1461        `),s(111,"button",69),v("click",function(){g(i);let n=m();return n.selectTimeframe=!1,f(n.selectPlayerModal=!1)}),e(112,"Cancel"),o(),e(113,`
1462    `),o(),e(114,`
1463`),o(),e(115,`
1464`)}if(a&2){let i=m();l(10),_("player",i.selectedPlayer)("largeCircle",!1)("initialsOnly",i.hidePlayerPhotos),l(6),w(`
1465                `,i.selectedPlayer.user.firstName+" "+i.selectedPlayer.user.lastName,`
1466                `),l(2),T(i.selectedPlayer.playerClubData==null||i.selectedPlayer.playerClubData.position==null?null:i.selectedPlayer.playerClubData.position.name),l(9),u(i.selectedPlayer.secondary?27:-1),l(8),u(i.user[i.Permission.PlayerFeedback]?35:-1),l(3),ie("list-row-item-sm",!i.playerEditMode),l(2),u(i.fieldEnabled(i.FieldOption.JERSEY_NUMBER)?40:-1),l(15),_("ngClass",L(20,qi,i.guestTimeframeOption==="programDuration")),l(2),M("ngModel",i.guestTimeframeOption),l(13),_("ngClass",L(22,qi,i.guestTimeframeOption==="specificDates")),l(2),M("ngModel",i.guestTimeframeOption),l(11),u(i.guestTimeframeOption==="specificDates"?83:-1),l(3),_("ngClass",L(24,qi,i.guestTimeframeOption==="selectedEvents")),l(2),M("ngModel",i.guestTimeframeOption),l(11),u(i.guestTimeframeOption==="selectedEvents"?99:-1),l(6),_("disabled",!i.isTimeframeValid()),l(3),_("disabled",!i.isTimeframeValid())}}function d0(a,d){if(a&1&&(e(0,`
1467                                            `),s(1,"app-pill",122),e(2,`
1468                                            `),o(),e(3,`
1469                                            `)),a&2){let i=d.$implicit;l(),_("text",i.user.firstName+" "+i.user.lastName)}}function m0(a,d){if(a&1&&(e(0,`
1470                                        `),s(1,"div",121),e(2,`
1471                                            `),F(3,d0,4,1,null,null,$),o(),e(5,`
1472                                        `)),a&2){let i=m().$implicit;l(3),V(i.family.players)}}function c0(a,d){if(a&1&&(e(0,`
1473                                    `),s(1,"div",118),e(2,`
1474                                        `),s(3,"div",119),e(4,`
1475                                            `),s(5,"div",120),e(6),o(),e(7,`
1476                                        `),o(),e(8,`
1477                                        `),p(9,m0,6,0),o(),e(10,`
1478                                `)),a&2){let i=d.$implicit;l(6),z("",i.user.firstName,`
1479                                                `,i.user.lastName,`
1480                                            `),l(3),u(i.family.players.length>0?9:-1)}}function p0(a,d){a&1&&x(0,"i",113)}function u0(a,d){if(a&1){let i=y();e(0,`
1481    `),s(1,"div"),e(2,`
1482        `),s(3,"div",106),e(4,`
1483            `),s(5,"div",93),e(6,`
1484                `),x(7,"i",107),e(8,`
1485            `),o(),e(9,`
1486            `),s(10,"div",108),e(11,`
1487                `),s(12,"h3"),e(13,"Find an existing member"),o(),e(14,`
1488                `),s(15,"div",66),e(16,`
1489                    `),s(17,"p"),e(18,"Enter at least the first two characters of member's Last Name to get results."),o(),e(19,`
1490                    `),s(20,"label",109),e(21,"Parent/Player Last Name"),o(),e(22,`
1491                    `),s(23,"div"),e(24,`
1492                        `),s(25,"span",110),e(26,`
1493                            `),s(27,"p-autoComplete",111),v("completeMethod",function(n){g(i);let r=m();return f(r.search(n))})("onSelect",function(n){g(i);let r=m();return f(r.selectMember(n))}),e(28,`
1494                                `),A(29,c0,11,3,"ng-template",112),e(30,`
1495                            `),o(),e(31,`
1496                            `),p(32,p0,1,0,"i",113),o(),e(33,`
1497                    `),o(),e(34,`
1498                `),o(),e(35,`
1499            `),o(),e(36,`
1500        `),o(),e(37,`
1501        `),x(38,"hr"),e(39,`
1502        `),s(40,"div",114),e(41,`
1503            `),s(42,"div",93),e(43,`
1504                `),x(44,"i",115),e(45,`
1505            `),o(),e(46,`
1506            `),s(47,"div",108),e(48,`
1507                `),s(49,"h3"),e(50,"Create a new club account"),o(),e(51,`
1508                `),s(52,"button",69),v("click",function(){g(i);let n=m();return f(n.showCreateParent())}),e(53,"Create New Account"),o(),e(54,`
1509            `),o(),e(55,`
1510        `),o(),e(56,`
1511        `),s(57,"div",116),e(58,`
1512            `),s(59,"button",117),v("click",function(){g(i);let n=m();return f(n.showAddPlayerModal=!1)}),e(60,"Cancel"),o(),e(61,`
1513        `),o(),e(62,`
1514    `),o(),e(63,`
1515    `)}if(a&2){let i=m();l(27),_("suggestions",i.parentList)("showEmptyMessage",!0)("emptyMessage","No members found")("forceSelection",!0)("delay",1e3),l(5),u(i.searching?-1:32)}}function _0(a,d){a&1&&(e(0,`
1516                `),s(1,"div",128),e(2,`
1517                    `),s(3,"app-pill",129),e(4,`
1518                    `),o(),e(5,`
1519                `),o(),e(6,`
1520                `))}function h0(a,d){if(a&1){let i=y();e(0,`
1521        `),s(1,"div",80),e(2,`
1522            `),s(3,"p-radioButton",125),R("ngModelChange",function(n){g(i);let r=m(3);return P(r.selectedPlayerID,n)||(r.selectedPlayerID=n),f(n)}),v("onClick",function(){let n=g(i).$implicit,r=m(3);return f(r.selectExistingPlayer(n))}),e(4,`
1523            `),o(),e(5,`
1524            `),s(6,"label",126),e(7,`
1525                `),s(8,"div",127),e(9,`
1526                    `),s(10,"span"),e(11),o(),e(12,` |
1527                    `),s(13,"span"),e(14),o(),e(15,` |
1528                    `),s(16,"span"),e(17),N(18,"date"),o(),e(19,`
1529                `),o(),e(20,`
1530                `),p(21,_0,7,0),o(),e(22,`
1531        `),o(),e(23,`
1532        `)}if(a&2){let i=d.$implicit,t=m(3);l(),_("ngClass",L(13,qi,t.selectedPlayerID===i.playerID)),l(2),_("value",i.playerID),M("ngModel",t.selectedPlayerID),_("inputId",i.playerID.toString())("disabled",(i.playerProgramAssignments==null?null:i.playerProgramAssignments.length)>0),l(3),_("for",i.playerID),l(5),T(i.user.firstName+" "+i.user.lastName),l(3),w("Gender: ",i.user.genderID===1?"Male":i.user.genderID===2?"Female":"Other"),l(3),w("DOB: ",B(18,10,i.user.dob,"M/d/y")," "),l(4),u((i.playerProgramAssignments==null?null:i.playerProgramAssignments.length)>0?21:-1)}}function g0(a,d){if(a&1&&(e(0,`
1533        `),F(1,h0,24,15,null,null,$)),a&2){let i=m(2);l(),V(i.selectedParent.family.players)}}function f0(a,d){a&1&&(e(0,`
1534        `),s(1,"div",130),e(2,`
1535            `),x(3,"img",131),e(4,`
1536            `),s(5,"p",132),e(6,`
1537                This user has no associated players,`),x(7,"br"),e(8,`
1538                click the 'Add a new player' button to add a player.
1539            `),o(),e(9,`
1540        `),o(),e(10,`
1541        `))}function x0(a,d){if(a&1){let i=y();e(0,`
1542    `),s(1,"div",72),e(2,`
1543        `),p(3,g0,3,0)(4,f0,11,0),s(5,"button",123),v("click",function(){g(i);let n=m();return f(n.showCreatePlayer())}),e(6,"Add a new player"),o(),e(7,`
1544    `),o(),e(8,`
1545    `),s(9,"div",124),e(10,`
1546        `),s(11,"button",69),v("click",function(){g(i);let n=m();return n.selectPlayerModal=!1,f(n.showAddPlayerModal=!1)}),e(12,"Cancel"),o(),e(13,`
1547        `),s(14,"button",90),v("click",function(){g(i);let n=m();return n.showAddPlayerModal=!1,f(n.selectTimeframe=!0)}),e(15,`
1548            Continue
1549        `),o(),e(16,`
1550    `),o(),e(17,`
1551    `)}if(a&2){let i=m();l(3),u(i.selectedParent.family.players.length>0?3:4),l(11),_("disabled",!i.selectedPlayerID)}}function C0(a,d){if(a&1){let i=y();e(0,`
1552        `),s(1,"app-dynamic-form",134),v("onCancel",function(){g(i);let n=m(2);
1552return n.showAddPlayerModal=!1,f(n.createParentModal=!1)})("onSubmit",function(n){g(i);let r=m(2);return f(r.createUser(n))}),e(2,`
1553            `),s(3,"app-dynamic-form-field",135),e(4,`
1554            `),o(),e(5,`
1555            `),s(6,"app-dynamic-form-field",136),e(7,`
1556            `),o(),e(8,`
1557            `),s(9,"app-dynamic-form-field",137),e(10,`
1558            `),o(),e(11,`
1559            `),s(12,"app-dynamic-form-field",138),e(13,`
1560            `),o(),e(14,`
1561        `),o(),e(15,`
1562        `)}if(a&2){let i=m(2);l(),_("fields",i.fields)("contentFieldsMode",!0)("horizontalForm",!0)("showCancelButton",!0)("showSubmitButton",!0)("buttonsPosition","spread")("entity",i.parent)}}function v0(a,d){if(a&1&&(e(0,`
1563    `),s(1,"div",133),e(2,`
1564        `),s(3,"h5"),e(4,"Parent Information"),o(),e(5,`
1565        `),p(6,C0,16,7),o(),e(7,`
1566    `)),a&2){let i=m();l(6),u(i.fields?6:-1)}}function b0(a,d){a&1&&(e(0,`
1567                `),s(1,"tr"),e(2,`
1568                    `),s(3,"td",139),e(4,`
1569                        `),s(5,"i"),e(6,"No players assigned"),o(),e(7,`
1570                    `),o(),e(8,`
1571                `),o(),e(9,`
1572            `))}function S0(a,d){if(a&1&&(e(0,`
1573                    `),s(1,"th",140),e(2),x(3,"p-sortIcon",141),e(4,`
1574                    `),o(),e(5,`
1575                    `)),a&2){let i=d.$implicit,t=m(2);l(),_("pSortableColumn",i.field),ye("aria-label",t.AriaLabels.ACTIVATE_SORT),l(),w(`
1576                        `,i.header,`
1577                        `),l(),_("field",i.field)}}function y0(a,d){if(a&1&&(e(0,`
1578                `),s(1,"tr"),e(2,`
1579                    `),F(3,S0,6,4,null,null,$),o(),e(5,`
1580            `)),a&2){let i=m();l(3),V(i.rosterColumns)}}function w0(a,d){if(a&1&&(e(0,`
1581                    `),s(1,"td"),e(2),o(),e(3,`
1582                    `)),a&2){let i=m().$implicit;l(2),w(" ",i.number)}}function T0(a,d){if(a&1&&(e(0,`
1583                    `),s(1,"td"),e(2),o(),e(3,`
1584                    `)),a&2){let i=m().$implicit;l(2),T(i.position)}}function D0(a,d){if(a&1){let i=y();e(0,`
1585                            `),s(1,"span",144),e(2,`
1586                                `),s(3,"i",145),v("click",function(n){g(i);let r=m().$implicit,c=m();return Re(32).toggle(n),f(c.setPlayerItems(r.assignments[0],r.playerID))}),o(),e(4,`
1587                            `),o(),e(5,`
1588                            `)}}function E0(a,d){if(a&1&&(e(0,`
1589                `),s(1,"tr"),e(2,`
1590                    `),s(3,"td"),e(4),o(),e(5,`
1591                    `),s(6,"td"),e(7),N(8,"date"),o(),e(9,`
1592                    `),s(10,"td"),e(11),o(),e(12,`
1593                    `),p(13,w0,4,1),p(14,T0,4,1),s(15,"td"),e(16,`
1594                        `),s(17,"div",142),e(18,`
1595                            `),s(19,"app-player-status-styler",143),e(20,`
1596                            `),o(),e(21,`
1597                            `),p(22,D0,6,0),o(),e(23,`
1598                    `),o(),e(24,`
1599                    `),s(25,"td"),e(26),N(27,"utcDate"),o(),e(28,`
1600                    `),s(29,"td"),e(30),N(31,"date"),o(),e(32,`
1601                    `),s(33,"td"),e(34),o(),e(35,`
1602                `),o(),e(36,`
1603            `)),a&2){let i=d.$implicit,t=m();l(4),T(i.playerName),l(3),T(B(8,11,i.birthDate,"y")),l(4),T(i.genderName),l(2),u(t.fieldEnabled(t.FieldOption.JERSEY_NUMBER)?13:-1),l(),u(t.fieldEnabled(t.FieldOption.PRIMARY_POSITION)?14:-1),l(5),_("statusID",i.assignments[0].inviteStatusID)("statusTitle",i.assignments[0].inviteStatus),l(3),u(i.assignments[0].inviteStatusID===t.InviteStatus.DECLINED?22:-1),l(4),T(B(27,14,i.assignments[0].savedOn,"M/d/y")),l(4),T(B(31,17,i.assignments[0].acceptBy,"M/d/y h:mm a")),l(4),T(t.getTeamAssignmentLabel(i.assignments[0]))}}function I0(a,d){if(a&1&&(e(0,`
1604    `),s(1,"div",124),e(2,`
1605        `),s(3,"button",146),e(4,`Go To
1606            Assign Players`),o(),e(5,`
1607    `),o(),e(6,`
1608    `)),a&2){let i=m();l(3),_("routerLink",L(2,qd,i.program==null?null:i.program.programID))("state",at(4,Wd,i.inviteStatusID,i.teamID,i.invitationOption))}}function M0(a,d){if(a&1&&(e(0,`
1609        `),s(1,"div",148),e(2,`
1610            `),s(3,"app-field-view-only-row",149),e(4,`
1611            `),o(),e(5,`
1612            `),s(6,"app-field-view-only-row",149),e(7,`
1613            `),o(),e(8,`
1614        `),o(),e(9,`
1615        `)),a&2){let i=m(2);l(3),_("field",i.getField(i.declineFields,"declineReasonID"))("entity",i.declineAssignment),l(3),_("field",i.getField(i.declineFields,"declineReasonText"))("entity",i.declineAssignment)}}function P0(a,d){if(a&1){let i=y();e(0,`
1616            `),s(1,"app-dynamic-form",150,3),v("onSubmit",function(n){g(i);let r=m(2);return f(r.rejectInvite(n))})("onCancel",function(){g(i);let n=m(2);return f(n.showDeclineModal=!1)}),e(3,`
1617                `),s(4,"app-dynamic-form-field",151),v("onChange",function(n){g(i);let r=m(2);return f(r.updateDeclineFields(n))}),e(5,`
1618                `),o(),e(6,`
1619                `),s(7,"app-dynamic-form-field",152),e(8,`
1620                `),o(),e(9,`
1621            `),o(),e(10,`
1622            `)}if(a&2){let i=m(2);l(),_("fields",i.activeDeclineFields)("entity",i.declineAssignment)("c
1622ontentFieldsMode",!0)("horizontalForm",!0)("buttonsPosition","left")}}function R0(a,d){if(a&1&&(e(0,`
1623    `),s(1,"div",147),e(2,`
1624        `),p(3,M0,10,4),s(4,"div"),e(5,`
1625            `),p(6,P0,11,5),o(),e(7,`
1626    `),o(),e(8,`
1627    `)),a&2){let i=m();l(3),u(i.declineAssignment.inviteStatusID===i.InviteStatus.DECLINED?3:-1),l(3),u(i.showDeclineModal&&i.activeDeclineFields?6:-1)}}function k0(a,d){if(a&1){let i=y();e(0,`
1628        `),s(1,"app-dialog-footer"),e(2,`
1629            `),J(3,153),e(4,`
1630                `),s(5,"button",154),v("click",function(){g(i);let n=m();return f(n.showCollegeProfileLinkDialog=!1)}),e(6,"Close"),o(),e(7,`
1631            `),K(),e(8,`
1632            `),J(9,155),e(10,`
1633                `),s(11,"button",68),v("click",function(){g(i);let n=m();return f(n.copyCollegeProfileLink())}),e(12,"Copy Link"),o(),e(13,`
1634            `),K(),e(14,`
1635        `),o(),e(15,`
1636    `)}}function F0(a,d){if(a&1&&(e(0,`
1637    `),s(1,"p"),e(2,`
1638        `),s(3,"strong"),e(4),N(5,"date"),o(),e(6,`
1639        Re-sending only pushes new or changed players.
1640    `),o(),e(7,`
1641    `)),a&2){let i=m();l(4),w("Roster last sent ",B(5,1,i.rosterSyncStatus.lastSentOn,"M/d/yyyy h:mm a"),".")}}function V0(a,d){if(a&1){let i=y();e(0,`
1642        `),s(1,"app-dialog-footer"),e(2,`
1643            `),J(3,153),e(4,`
1644                `),s(5,"button",91),v("click",function(){g(i);let n=m();return f(n.displaySendRosterModal=!1)}),e(6,"Close"),o(),e(7,`
1645            `),K(),e(8,`
1646            `),J(9,155),e(10,`
1647                `),s(11,"button",90),v("click",function(){g(i);let n=m();return f(n.sendRosterToSoccerCom())}),e(12),o(),e(13,`
1648            `),K(),e(14,`
1649        `),o(),e(15,`
1650    `)}if(a&2){let i=m();l(5),_("disabled",i.sendingRoster),l(6),_("disabled",i.sendingRoster),l(),w(`
1651                    `,i.sendingRoster?"Sending...":i.rosterSyncStatus!=null&&i.rosterSyncStatus.sent?"Re-send Roster":"Send Roster",`
1652                `)}}function A0(a,d){if(a&1){let i=y();e(0,`
1653    `),s(1,"app-advanced-bulk-edit-calendar",156),v("eventsUpdated",function(n){g(i);let r=m();return f(r.selectedCalendarEvents=n)}),o(),e(2,`
1654    `)}if(a&2){let i=m();l(),_("advancedView",!0)("teamID",i.teamID)("programID",i.programID)("selectedEvents",i.selectedCalendarEvents||Q(6,Hd))("allowActions",!1)("guestCalendarEventsMode",!0)}}function N0(a,d){if(a&1){let i=y();e(0,`
1655        `),s(1,"app-dialog-footer"),e(2,`
1656            `),J(3,155),e(4,`
1657                `),s(5,"button",68),v("click",function(){g(i);let n=m();return f(n.showCalendarEventsDialog=!1)}),e(6,"Continue"),o(),e(7,`
1658            `),K(),e(8,`
1659        `),o(),e(9,`
1660    `)}}var _o=(()=>{let d=class d{constructor(t,n,r,c,h,b,k,te,$e,Xe,pt,Qi,Ho){this.route=t,this.teamService=n,this.adminProgramService=r,this.programService=c,this.siteDataService=h,this.adminUserService=b,this.userService=k,this.playerService=te,this.formService=$e,this.collegeProfileService=Xe,this.calendarService=pt,this.authorize=Qi,this.clipboard=Ho,this.orderBy="lastName",this.Permission=W,this.showFeedbackModal=!1,this.adminView=!1,this.showAddPlayerModal=!1,this.playerEditMode=!1,this.selectPlayerModal=!1,this.selectTimeframe=!1,this.createPlayerModal=!1,this.createParentModal=!1,this.showDetail
1660sModal=!1,this.showDeclineModal=!1,this.rosterColumns=[],this.downloadingPDF=!1,this.InviteStatus=Gt,this.ProgramInvitationType=qt,this.AriaLabels=mi,this.FieldOption=Ce,this.playerMenuItems=[],this.disableAddGuest=!0,this.showSendRosterToSoccerCom=!1,this.displaySendRosterModal=!1,this.sendingRoster=!1,this.rosterSyncStatus=null,this.volunteerPermission=!1,this.hidePlayerPhotos=!1,this.loading=!0,this.showCollegeProfileLinkDialog=!1,this.guestTimeframeOption="programDuration",this.upcomingEvents=[],this.today=new Date,this.showCalendarEventsDialog=!1,this.CalendarEventType=$n,this.unsubsribe$=new U,this.searching=!1,this.menuOptions=[{label:"Remove",command:()=>{this.removeGuestPlayer()}},{label:"Edit",command:()=>{this.editGuestPlayer()}}],this.actionMenuItems=[],this.options=[{label:"Last Name",value:"lastName"},{label:"First Name",value:"firstName"},{label:"Position",value:"position"},{label:"Gender",value:"gender"}]}ngOnInit(){this.authorize.getUser().subscribe(t=>{this.user=t}),this.adminView=this.route.snapshot.parent.data?.adminView,this.collegeProfileLink=`${window.location.origin}/college-profile/team/${this.teamID}/program/${this.programID}`,j({clubSettings:this.siteDataService.getClubSettings(),fieldOptions:this.siteDataService.getClubFieldOptions(),roles:this.userService.getRoles(),volunteerSettings:this.calendarService.getAllClubVolunteerSettings()}).subscribe(t=>{this.clubFieldOptions=t.fieldOptions,this.disableAddGuest=t.clubSettings.clubOptions?.find(n=>n.optionID===me.DISABLE_ADD_GUEST)?.boolValue||!1,this.hidePlayerPhotos=t.clubSettings.clubOptions?.find(n=>n.optionID===me.HIDE_PLAYER_PROFILE_PHOTO)?.boolValue||!1,this.disableAddGuest&&t.roles&&t.roles.some(n=>n===Be.CLUB_ADMIN||n===Be.SUPER_ADMIN)&&(this.disableAddGuest=!1),this.showSendRosterToSoccerCom=t.clubSettings.clubOptions?.find(n=>n.optionID===me.PLAYER_PASS_CONNECT)?.boolValue||!1,this.showSendRosterToSoccerCom&&t.clubSettings.clubOptions?.find(n=>n.optionID===me.DISABLE_SOCCER_COM_ROSTER_SEND_FOR_COACHES)?.boolValue&&(!t.roles||!t.roles.some(n=>n===Be.CLUB_ADMIN||n===Be.SUPER_ADMIN||n===Be.DIRECTOR))&&(this.showSendRosterToSoccerCom=!1),t.volunteerSettings&&t.volunteerSettings.programTeamSettings&&(this.volunteerSettings=t.volunteerSettings.programTeamSettings.find(n=>n.programID===this.programID&&n.teamID===this.teamID)),this.setRosterColumns(),this.fieldEnabled(Ce.JERSEY_NUMBER)&&this.options.push({label:this.fieldName(Ce.JERSEY_NUMBER),value:"number"}),this.buildActionMenuItems()}),this.getRoster()}ngOnChanges(t){(t.teamID&&!t.teamID.firstChange||t.programID&&!t.programID.firstChange)&&this.getRoster()}getRoster(){this.loading=!0,j({roster:this.teamService.getTeamRoster(this.teamID,this.programID,this.orderBy),program:this.programService.getProgram(this.programID)}).pipe(S(this.unsubsribe$)).subscribe(t=>{this.roster=t.roster,this.program=t.program,this.rosterPlayers=this.roster.filter(n=>!n.isGuest&&!n.isSuspended&&!n.isRestricted),this.guestPlayers=this.roster.filter(n=>n.isGuest&&!n.isSuspended&&!n.isRestricted),this.suspendedPlayers=this.roster.filter(n=>n.isSuspended||n.isRestricted),this.buildActionMenuItems(),this.program.programInvitationTypeID===qt.INVITATIONAL_WITH_REGISTRATION?this.teamService.getTeamRosteringData(this.programID,this.teamID,1).pipe(S(this.unsubsribe$)).subscribe(n=>{this.rosteringData=n,this.loading=!1}):this.loading=!1})}buildActionMenuItems(){this.actionMenuItems=[],!this.disableAddGuest&&!this.playerEditMode&&this.actionMenuItems.push({label:"Add Guest Player",command:()=>{this.showAddGuestPlayer()}}),this.fieldEnabled(Ce.JERSEY_NUMBER)&&!this.playerEditMode&&this.actionMenuItems.push({label:"Edit Player Details",command:()=>{this.enterPlayerEditMode()}}),this.roster?.length>0&&!this.playerEditMode&&this.actionMenuItems.push({label:"Export",command:()=>{this.exportCSV()}}),this.showCollegeProfile()&&!this.playerEditMode&&(this.actionMenuItems.push({label:"Download Team College Profiles PDF",command:()=>{this.downloadCollegeProfiles()}}),this.actionMenuItems.push({label:"Copy/View Team College Profiles Link",command:()=>{this.showCollegeProfileLinkDialog=!0}})),this.showSendRosterToSoccerCom&&!this.playerEditMode&&this.actionMenuItems.push({label:"Send Team/Roster to Soccer.com",command:()=>{this.showSendRosterModal()}})}showSendRosterModal(){this.rosterSyncStatus=null,this.displaySendRosterModal=!0,this.teamService.getRosterSyncStatus(this.teamID,this.programID).subscribe(t=>{this.rosterSyncStatus=t},()=>{})}sendRosterToSoccerCom(){this.sendingRoster=!0,this.teamService.sendRosterToSoccerCom(this.teamID,this.programID).subscribe(t=>{this.sendingRoster=!1,t?.teamSynced?(this.displaySendRosterModal=!1,this.siteDataService.showSiteSuccessAlert(t.message||"Roster sent to soccer.com.")):this.siteDataService.showSiteErrorAlert(t?.message||"There was a problem sending the roster to soccer.com.")},t=>{this.sendingRoster=!1,t?.status===400&&typeof t?.error=="string"&&t.error?this.siteDataService.showSiteErrorAlert(t.error):this.siteDataService.showSiteErrorAlert("There was a problem sending the roster to soccer.com.")})}toggleVolunteering(t){t.showVolunteering=!t.showVolunteering}getPlayerRoster(t){return this.rosteringData.filter(n=>n.assignments.some(r=>t.includes(r.inviteStatusID)))}getRosterTotalInvited(t){let n=new Date;return n.setHours(0,0,0,0),t.filter(r=>r.assignments.some(c=>c.acceptBy===null||new Date(c.acceptBy)>n)).length}getRosterInvited(t){let n=new Date;return n.setHours(0,0,0,0),t.filter(r=>r.assignments.some(c=>c.acceptBy===null||new Date(c.acceptBy)>n))}getRosterTotalExpired(t){let n=new Date;return n.setHours(0,0,0,0),t.filter(r=>r.assignments.some(c=>c.acceptBy!==null&&new Date(c.acceptBy)<=n)).length}getRosterExpired(t){let n=new Date;return n.setHours(0,0,0,0),t.filter(r=>r.assignments.some(c=>c.acceptBy!==null&&new Date(c.acceptBy)<=n))}
1660addFeedback(t){this.playerID=t,this.showFeedbackModal=!0}feedbackSave(){this.roster.find(t=>t.playerID===this.playerID).playerFeedbackCount++,this.showFeedbackModal=!1}removeGuestPlayer(){this.adminProgramService.unassignGuestPlayerFromTeam(this.programID,this.selectedPlayerID,this.teamID).subscribe({next:()=>{this.guestPlayers=this.guestPlayers.filter(t=>t.playerID!==this.selectedPlayerID),this.siteDataService.showSiteSuccessAlert("Player removed from team successfully."),this.selectedPlayerID=void 0},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem processing your request.")}})}editGuestPlayer(){this.selectedPlayer=this.guestPlayers.find(t=>t.playerID===this.selectedPlayerID),this.guestTimeframeOption=this.selectedPlayer.guestEventsCount>0?"selectedEvents":this.selectedPlayer.guestStartDate?"specificDates":"programDuration",this.guestStartDate=this.selectedPlayer.guestStartDate?new Date(this.selectedPlayer.guestStartDate):new Date,this.guestEndDate=this.selectedPlayer.guestEndDate?new Date(this.selectedPlayer.guestEndDate):null,this.selectedPlayer.guestEventsCount>0?this.adminProgramService.getGuestPlayerEvents(this.programID,this.selectedPlayer.playerID,this.teamID).subscribe({next:t=>{this.selectedCalendarEvents=t,this.selectTimeframe=!0}}):this.selectTimeframe=!0}showAddGuestPlayer(){this.guestTimeframeOption="programDuration",this.guestStartDate=new Date,this.guestEndDate=null,this.selectedCalendarEvents=[],this.loadUpcomingEvents(),this.showAddPlayerModal=!0}loadUpcomingEvents(){this.upcomingEvents=[]}isTimeframeValid(){return this.guestTimeframeOption==="programDuration"?!0:this.guestTimeframeOption==="specificDates"?!!(this.guestStartDate&&this.guestEndDate):this.guestTimeframeOption==="selectedEvents"?this.selectedCalendarEvents?.length>0:!1}enterPlayerEditMode(){this.currentGuestPlayers=JSON.parse(JSON.stringify(this.guestPlayers)),this.currentRosterPlayers=JSON.parse(JSON.stringify(this.rosterPlayers)),this.currentSuspendedPlayers=JSON.parse(JSON.stringify(this.suspendedPlayers)),this.playerEditMode=!0}updatePlayerData(t,n){t.playerClubData?t.playerClubData.number=n||null:t.playerClubData={number:n},t.updated=!0}exitPlayerEditMode(){this.guestPlayers=JSON.parse(JSON.stringify(this.currentGuestPlayers)),this.rosterPlayers=JSON.parse(JSON.stringify(this.currentRosterPlayers)),this.suspendedPlayers=JSON.parse(JSON.stringify(this.currentSuspendedPlayers)),this.playerEditMode=!1}savePlayerData(){this.roster.some(t=>t.updated)?this.playerService.savePlayersClubData(this.roster.filter(t=>t.updated).map(t=>({playerID:t.playerID,playerClubData:t.playerClubData}))).subscribe({next:()=>{this.playerEditMode=!1,this.siteDataService.showSiteSuccessAlert("Player details updated successfully")},error:t=>{this.siteDataService.showSiteErrorAlert(t.error)}}):this.playerEditMode=!1}showCollegeProfile(){return!!this.program&&!this.program.isAdultProgram&&this.optionEnabled(Ce.COLLEGE_PROFILE)&&this.roster?.some(t=>si(t.user.dob)>=13)}optionEnabled(t){return this.clubFieldOptions?.find(n=>n.fieldOptionID===t)!==void 0}showCreateParent(){(this.fields?Z(null):this.adminUserService.getUserCreateMetadata()).subscribe(t=>{t&&(this.fields=t.fields),this.createParentModal=!0})}exportCSV(){this.teamService.getTeamRoster(this.teamID,this.programID,this.orderBy,!0).subscribe({next:t=>{rt(t)},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem exporting data.")}})}createUser(t){this.adminUserService.createClubUser(t,!0).subscribe({next:n=>{this.selectedParent=n,this.parent=void 0,this.siteDataService.showSiteSuccessAlert("Parent created successfully"),this.formService.hideFormLoader(),this.showCreatePlayer()},error:n=>{this.formService.hideFormLoader(),this.siteDataService.showSiteErrorAlert(n.error?.message??"There was a problem saving this user.")}})}showCreatePlayer(){this.showAddPlayerModal=!1,this.createPlayerModal=!0,this.createParentModal=!1}search(t){this.searching=!0,t.query.length>1?this.adminUserService.getUsersForTeam(this.programID,this.teamID,t.query).subscribe({next:n=>{this.parentList=n,this.searching=!1},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem getting data."),this.searching=!1}}):(this.parentList=[],this.searching=!1)}selectMember(t){let n=t instanceof Vn?t:t?.value;n&&(this.selectedParent=n,this.selectPlayerModal=!0)}selectExistingPlayer(t){this.selectedPlayer=t}handlePlayerAdded(t){this.selectedPlayer=t,this.selectedPlayerID=t.playerID,this.createPlayerModal=!1,this.selectTimeframe=!0}assignPlayer(t){let n=null,r=null,c=null;this.guestTimeframeOption==="specificDates"?(n=this.guestStartDate,r=this.guestEndDate):this.guestTimeframeOption==="selectedEvents"&&(c=this.selectedCalendarEvents.map(h=>h.id)),this.adminProgramService.assignGuestPlayerToTeam(this.programID,this.teamID,this.selectedPlayerID,n,r,c,t).pipe(ge(()=>this.adminProgramService.acceptGuestPlayerToTeam(this.programID,this.teamID,this.selectedPlayerID)),ge(()=>this.teamService.getTeamRoster(this.teamID,this.programID))).subscribe({next:h=>{this.roster=h,this.guestPlayers=this.roster.filter(b=>b.isGuest),this.siteDataService.showSiteSuccessAlert("Guest player information saved successfully.")},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem processing your request.")}}),this.selectPlayerModal=!1,this.selectTimeframe=!1,this.showAddPlayerModal=!1}downloadCollegeProfiles(){this.downloadingPDF=!0,this.collegeProfileService.getTeamCollegeProfile(this.teamID,this.programID).subscribe({next:t=>{rt(t),this.downloadingPDF=!1},error:()=>{this.downloadingPDF=!1,this.siteDataService.showSiteErrorAlert("There was a problem generating college profile.")}})}setRosterColumns(){this.rosterColumns=[{field:"playerName",header:"Player"},{field:"birthDate",header:"Birth Year"},{field:"genderName",header:"Gender"}],this.fieldEnabled(Ce.JERSEY_NUMBER)&&(this.rosterColumns=[...this.rosterColumns,{field:"number",header:this.fieldName(Ce.JERSEY_NUMBER)}]),this.fieldEnabled(Ce.PRIMARY_POSITION)&&(this.rosterColumns=[...this.rosterColumns,{field:"position",header:this.fieldName(Ce.PRIMARY_POSITION)}]),this.rosterColumns=[...this.rosterColumns,{field:"inviteStatus",header:"Status"},{field:"savedOn",header:"Status Date"},{field:"acceptBy",header:"Accept By Date"},{field:"secondary",header:"Team Type"}]}fieldEnabled(t){return this.clubFieldOptions?.find(n=>n.fieldOptionID===t)!==void 0}fieldName(t){return this.clubFieldOptions?.find(n=>n.fieldOptionID===t).fieldName}getTeamAssignmentLabel(t){return t.isGuest?"Guest":t.secondary?"Secondary":"Primary"}customSort(t){t.data.sort((n,r)=>{let c=n[t.field],h=r[t.field];t.field==="inviteStatus"?(c=n[t.field]=n.assignments[0].inviteStatus,h=r[t.field]=r.assignments[0].inviteStatus):t.field==="savedOn"?(c=n[t.field]=n.assignments[0].savedOn,h=r[t.field]=r.assignments[0].savedOn):t.field==="acceptBy"?(c=n[t.field]=n.assignments[0].acceptBy,h=r[t.field]=r.assignments[0].acceptBy):t.field==="secondary"&&(c=n[t.field]=n.assignments[0].secondary,h=r[t.field]=r.assignments[0].secondary);let b=null;return c===null&&h!==null?b=-1:c!==null&&h===null?b=1:c===null&&h===null?b=0:!isNaN(c)&&!isNaN(h)?b=Number(c)<Number(h)?
1660-1:Number(c)>Number(h)?1:0:typeof c=="string"&&typeof h=="string"?b=c.localeCompare(h):b=c<h?-1:c>h?1:0,t.order*b})}getField(t,n){return t.find(r=>r.controlName===n)}rejectInvite(t){(this.declineAssignment.inviteStatusID===Gt.INVITED?this.adminProgramService.declineInvite(this.playerID,this.programID,this.declineAssignment.teamID,t):this.adminProgramService.updateDeclineReason(this.playerID,this.programID,this.declineAssignment.teamID,t)).subscribe({next:()=>{let n=this.modalRosteringData?.find(r=>r.playerID===this.playerID);if(n){let r=n.assignments?.find(c=>c.teamID===this.declineAssignment.teamID&&c.inviteStatusID!==Gt.CANCELLED);r&&(r.inviteStatusID=Gt.DECLINED,r.inviteStatus="Declined",r.adminDeclineReasonID=t.adminDeclineReasonID,r.adminDeclineReasonText=t.adminDeclineReasonText,r.savedOn=new Date)}this.showDeclineModal=!1,this.siteDataService.showSiteSuccessAlert("Player decline reason saved successfully.")},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem processing your request."),this.showDeclineModal=!1}})}updateDeclineFields(t){t!==en.AnotherClubOther&&t!==en.NotInterestedOther?this.activeDeclineFields=this.declineFields?.filter(n=>n.controlName!=="adminDeclineReasonText"):this.activeDeclineFields=this.declineFields}setPlayerItems(t,n){let r=[{label:"Edit Exit Reason (Staff Only View)",command:()=>{this.openDecline(t,n)}}];this.playerMenuItems=Array.from(r)}openDecline(t,n){this.declineAssignment=t,this.playerID=n,this.declineFields?(this.updateDeclineFields(null),this.showDeclineModal=!0):this.adminProgramService.getDeclineInviteMetadata().subscribe({next:r=>{this.declineFields=r.fields,this.updateDeclineFields(null),this.showDeclineModal=!0},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem getting data.")}})}copyCollegeProfileLink(){this.siteDataService.copyToClipboard(this.collegeProfileLink)}sameDay(t,n){return new Date(t).getDate()===new Date(n).getDate()}removeEvent(t){this.selectedCalendarEvents=this.selectedCalendarEvents.filter(n=>n.id!==t)}ngOnDestroy(){this.unsubsribe$.next(),this.unsubsribe$.complete()}};d.\u0275fac=function(n){return new(n||d)(C(I),C(X),C(Sa),C(Ft),C(E),C(ki),C(ve),C(At),C(Se),C(wa),C(It),C(ae),C(Un))},d.\u0275cmp=D({type:d,selectors:[["app-roster-panel"]],inputs:{teamID:"teamID",programID:"programID"},standalone:!1,features:[Xt],decls:68,vars:54,consts:[["unassignMenu",""],["actions",""],["menu",""],["form",""],["header","Add guest player","styleClass","standardWidthDialog",3,"visibleChange","visible","modal","showHeader","draggable","closable"],["header","Add Player","styleClass","standardWidthDialog",3,"visible","showHeader","closable","modal","draggable"],["saveButtonText","Continue",3,"cancel","add","clubUserID","guest"],["header","Roster Details","styleClass","largeWidthDialog",3,"visibleChange","onHide","visible","showHeader","closable","modal","draggable"],[1,"table-responsive"],["sortField","playerName","styleClass","mb-3",1,"table","table-striped","table-sm",3,"sortFunction","value","columns","customSort"],["pTemplate","emptymessage"],["pTemplate","header"],["pTemplate","body"],["appendTo","body","styleClass","text-medium",3,"model","popup"],["header","Decline Reason",3,"visibleChange","visible","closable","modal"],["header","College Profile Link","styleClass","standardWidthDialog",3,"visibleChange","visible","showHeader","closable","modal","draggable"],[1,"card"],["pTemplate","footer"],["header","Send Roster to Soccer.com","styleClass","standardWidthDialog",3,"visibleChange","visible","showHeader","closable","modal","draggable"],["header","Calendar Events","styleClass","mediumWidthDialog fixed-form-action-dialog",3,"visibleChange","visible","showHeader","closable","modal","draggable"],[1,"col-xl-9"],[1,"d-flex","justify-content-between","align-items-center","my-3"],[1,"text-h3","my-0"],[1,"form-group","mb-0","d-flex"],[1,"mr-4"],["for","orderBy",1,"mr-2"],["inputId","orderBy",3,"onChange","ngModelChange","ngModel","options","filter"],["buttonText","Actions",3,"menuItems"],[1,"border-all","border-radius","col-xl-12","roster-totals-data","d-flex","align-items-end","mb-3"],[3,"click"],[1,"border-all","border-radius","px-3","col-xl-12","mb-3"],[1,"list-row","py-2","text-medium"],[1,"list-row-body","d-flex","align-items-center"],[1,"profile-image","align-self-center"],[3,"player","largeCircle","initialsOnly"],[1,"text-default","pl-2"],[1,"list-row-meta"],[1,"list-row-item","list-row-item-md"],[1,"list-row-item","list-row-item-lg"],[1,"list-row-item","list-row-item-sm","feedback-count"],[1,"list-row-item"],[1,"list-row-item","list-row-item-lg","add-feedback-container"],[1,"list-row-item","list-row-item-md","profile-button"],[1,"btn","btn-icon-user","btn-sm","btn-tertiary",3,"routerLink"],[1,"text-smallest"],[1,"fa-light","fa-circle-c"],["text","Secondary"],["href","javascript:void(0);",3,"click"],[1,"fal","fa-clipboard"],[1,"fw-700","text-center"],[1,"text-small","mr-2"],["type","text",1,"player-number-input","center",3,"ngModelChange","ngModel","name"],["type","button",1,"btn","btn-icon-clipboard","btn-sm","btn-tertiary",3,"click"],["responsiveLayout","scroll",3,"value"],["tooltipStyleClass","sp-tooltip",3,"pTooltip"],[1,"mt-3"],[1,"fw-700","mx-4"],[1,"mb-4","mt-3"],["appendTo","body",3,"popup","model"],[1,"border-all","p-0","border-radius","col-xl-12","mb-3"],[1,"list-row","py-2","text-medium","px-3"],[1,"list-row-item","list-row-item-sm","more"],[1,"btn","btn-sm","btn-tertiary",3,"click"],[1,"fa-solid","fa-ellipsis"],[1,"sr-only"],[1,"border-top","mt-0","py-2","px-3"],[1,"text-medium"],["appStickyFormButtons","",1,"pb-1","pt-3"],[1,"btn","btn-primary",3,"click"],[1,"btn",3,"click"],[1,"mt-3","text-small"],["alertType","info",3,"isInline"],[1,"mb-3"],["height","2rem","width","10rem"],["height","2rem"],[3,"save","cancel","playerID","teamID"],[1,"border-all","pt-1","col-xl-10","mb-2"],[1,"col-xl-10","p-0"],[1,"mb-2","mt-4"],[1,"my-3"],[1,"radio-group",3,"ngClass"],["name","timeframeOption","value","programDuration","inputId","programDuration",3,"ngModelChange","ngModel"],["for","programDuration",1,"full-width"],[1,"mb-2","fw-700"],["name","timeframeOption","value","specificDates","inputId","specificDates",3,"ngModelChange","ngModel"],["for","specificDates",1,"full-width"],[1,"text-medium","mb-3"],["name","timeframeOption","value","selectedEvents","inputId","selectedEvents",3,"ngModelChange","ngModel"],["for","selectedEvents",1,"full-width"],[1,"row","form-action","no-gutters"],[1,"btn","btn-primary",3,"click","disabled"],[1,"btn","btn-secondary",3,"click","disabled"],[1,"row","no-gutters"],[1,"col-auto"],["for","startDate",1,"mr-2","ml-0"],["inputId","startDate","dateFormat","mm/dd/yy","placeholder","Select Date",3,"ngModelChange","onSelect","ngModel","showIcon"],["for","endDate",1,"mr-2","ml-0"],["inputId","endDate","dateFormat","mm/dd/yy","placeholder","Select Date",3,"ngModelChange","ngModel","showIcon","minDate"],[1,"text-small","text-muted","mt-2"],[1,"table-responsive","mt-4"],[1,"table","table-sm"],[3,"startDate","endDate","clubEventTypeID"],[1,"btn-a11y","text-primary-link","text-small","text-red","d-block",3,"click"],[1,"fal","fa-tras
1660h","mr-2","icon-wrapper"],[1,"event-date",3,"ngClass"],["colspan","5",1,"text-center","text-muted"],[1,"row","pb-3"],[1,"fa-solid","fa-magnifying-glass","text-blue","icon-with-circle","fa-width-auto","text-large"],[1,"col"],[1,"fw-800","pb-1"],[1,"input-icon-wrapper"],["field","name","appendTo","body",3,"completeMethod","onSelect","suggestions","showEmptyMessage","emptyMessage","forceSelection","delay"],["pTemplate","item"],[1,"far","fa-search"],[1,"row"],[1,"fa-duotone","fa-user-plus","text-blue","icon-with-circle","fa-width-auto","text-large"],[1,"row","mt-4","form-action","no-gutters","justify-content-between"],[1,"btn","btn-lg",3,"click"],[1,"parent-search-results-row"],[1,"mr-5"],[1,"line-height-1"],[1,"parent-search-results-row--players"],[3,"text"],[1,"btn","btn-large",3,"click"],[1,"row","form-action","no-gutters","justify-content-between"],["name","selectPlayer",3,"ngModelChange","onClick","value","ngModel","inputId","disabled"],[1,"row","d-flex","full-width",3,"for"],[1,"col","d-flex","justify-content-between","pr-5","mr-5","fw-700"],[1,"col-auto","right"],["text","Rostered"],[1,"center"],["src","/assets/img/icon-empty-player.png",1,"mt-2","mb-2",2,"height","70px"],[1,"mb-4","text-medium"],[1,"horizontal-form"],["formID","player-basic-info-form",3,"onCancel","onSubmit","fields","contentFieldsMode","horizontalForm","showCancelButton","showSubmitButton","buttonsPosition","entity"],["fieldName","firstName","autoComplete","off"],["fieldName","lastName","autoComplete","off"],["fieldName","email","autoComplete","off"],["fieldName","cellPhone","autoComplete","off"],["colspan","13",1,"align-left"],[3,"pSortableColumn"],[3,"field"],[1,"roster-status-wrapper"],[3,"statusID","statusTitle"],[1,"unassign-toggle"],[1,"fas","fa-cog",3,"click"],[1,"btn",3,"routerLink","state"],[1,"form-wrapper"],[1,"card-body"],[3,"field","entity"],["formID","player-decline-reason-form",3,"onSubmit","onCancel","fields","entity","contentFieldsMode","horizontalForm","buttonsPosition"],["fieldName","adminDeclineReasonID",3,"onChange"],["fieldName","adminDeclineReasonText"],["slot","secondary"],[1,"btn","btn-secondary",3,"click"],["slot","primary"],[3,"eventsUpdated","advancedView","teamID","programID","selectedEvents","allowActions","guestCalendarEventsMode"]],template:function(n,r){if(n&1){let c=y();p(0,$m,2,1)(1,Om,8,1),p(2,Bm,4,2),p(3,l0,116,26),s(4,"p-dialog",4),R("visibleChange",function(b){return g(c),P(r.showAddPlayerModal,b)||(r.showAddPlayerModal=b),f(b)}),e(5,`
1661    `),p(6,u0,64,6),p(7,x0,18,2),p(8,v0,8,1),o(),e(9,`
1662
1663`),s(10,"p-dialog",5),e(11,`
1664    `),s(12,"app-add-player",6),v("cancel",function(){return g(c),r.selectPlayerModal=!1,r.createPlayerModal=!1,f(r.showAddPlayerModal=!1)})("add",function(b){return r.handlePlayerAdded(b)}),e(13,`
1665    `),o(),e(14,`
1666`),o(),e(15,`
1667
1668`),s(16,"p-dialog",7),R("visibleChange",function(b){return g(c),P(r.showDetailsModal,b)||(r.showDetailsModal=b),f(b)}),v("onHide",function(){return r.showDetailsModal=!1}),e(17,`
1669    `),s(18,"div",8),e(19,`
1670        `),s(20,"p-table",9),v("sortFunction",function(b){return r.customSort(b)}),e(21,`
1671            `),A(22,b0,10,0,"ng-template",10),e(23,`
1672            `),A(24,y0,6,0,"ng-template",11),e(25,`
1673            `),A(26,E0,37,20,"ng-template",12),e(27,`
1674        `),o(),e(28,`
1675    `),o(),e(29,`
1676    `),p(30,I0,7,8),s(31,"p-menu",13,0),e(33,`
1677    `),o(),e(34,`
1678`),o(),e(35,`
1679`),s(36,"p-dialog",14),R("visibleChange",function(b){return g(c),P(r.showDeclineModal,b)||(r.showDeclineModal=b),f(b)}),e(37,`
1680    `),p(38,R0,9,2),o(),e(39,`
1681
1682`),s(40,"p-dialog",15),R("visibleChange",function(b){return g(c),P(r.showCollegeProfileLinkDialog,b)||(r.showCollegeProfileLinkDialog=b),f(b)}),e(41,`
1683    `),s(42,"p"),e(43,`
1684        Here is the link to this team's college profiles:
1685    `),o(),e(44,`
1686    `),s(45,"div",16),e(46,`
1687        `),s(47,"strong"),e(48),o(),e(49,`
1688    `),o(),e(50,`
1689    `),A(51,k0,16,0,"ng-template",17),e(52,`
1690`),o(),e(53,`
1691
1692`),s(54,"p-dialog",18),R("visibleChange",function(b){return g(c),P(r.displaySendRosterModal,b)||(r.displaySendRosterModal=b),f(b)}),e(55,`
1693    `),s(56,"p"),e(57,`
1694        Once your roster is complete and you are ready to send the team to soccer.com, please click the button
1695        below. Please do not do this until your roster is finalized.
1696    `),o(),e(58,`
1697    `),p(59,F0,8,4),A(60,V0,16,3,"ng-template",17),e(61,`
1698`),o(),e(62,`
1699
1700`),s(63,"p-dialog",19),R("visibleChange",function(b){return g(c),P(r.showCalendarEventsDialog,b)||(r.showCalendarEventsDialog=b),f(b)}),e(64,`
1701    `),p(65,A0,3,7),A(66,N0,10,0,"ng-template",17),e(67,`
1702`),o()}n&2&&(u(r.loading?1:0),l(2),u(r.showFeedbackModal?2:-1),l(),u(r.selectTimeframe?3:-1),l(),M("visible",r.showAddPlayerModal),_("modal",!0)("showHeader",!0)("draggable",!1)("closable",!1),l(2),u(!r.selectPlayerModal&&!r.createPlayerModal&&!r.createParentModal?6:-1),l(),u(r.selectPlayerModal?7:-1),l(),u(r.createParentModal?8:-1),l(2),_("visible",r.createPlayerModal)("showHeader",!0)("closable",!1)("modal",!0)("draggable",!1),l(2),_("clubUserID",r.selectedParent==null?null:r.selectedParent.clubUserID)("guest",!0),l(4),M("visible",r.showDetailsModal),_("showHeader",!0)("closable",!0)("modal",!0)("draggable",!1),l(4),_("value",r.modalRosteringData)("columns",r.rosterColumns)("customSort",!0),l(10),u(r.user[r.Permission.AssignPlayers]?30:-1),l(),_("model",r.playerMenuItems)("popup",!0),l(5),Oe(Q(53,Bd)),M("visible",r.showDeclineModal),_("closable",!1)("modal",!0),l(2),u(r.showDeclineModal?38:-1),l(2),M("visible",r.showCollegeProfileLinkDialog),_("showHeader",!0)("closable",!0)("modal",!0)("draggable",!1),l(8),T(r.collegeProfileLink),l(6),M("visible",r.displaySendRosterModal),_("showHeader",!0)("closable",!0)("modal",!0)("draggable",!1),l(5),u(r.rosterSyncStatus!=null&&r.rosterSyncStatus.sent?59:-1),l(4),M("visible",r.showCalendarEventsDialog),_("showHeader",!0)("closable",!1)("modal",!0)("draggable",!1),l(2),u(r.showCalendarEventsDialog?65:-1))},dependencies:[ue,de,he,_e,Ct,De,Ee,ke,be,ea,ta,gi,ce,vi,la,Tt,fi,Fe,_i,hi,pi,oe,Qe,jn,Ye,Gn,Jn,ka,Di,Ri,ji,xt,Ve,Kn],styles:[".roster-totals-data[_ngcontent-%COMP%]{display:flex;padding:0 1rem}.roster-totals-data[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{display:flex;justify-content:center;flex-direction:column;align-items:center;text-transform:uppercase;font-size:var(--text-small);color:var(--grey-700);margin-top:.5rem;margin-bottom:.5rem}.roster-totals-data[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]   strong[_ngcontent-%COMP%]{display:block;font-size:var(--text-large);font-weight:500;line-height:1;text-transform:none;color:var(--base-text)}.player-number-input[_ngcontent-%COMP%]{width:7ch;box-sizing:content-box;font-size:var(--text-small);padding:0}.parent-search-results-row[_ngcontent-%COMP%]{width:450px;display:flex;align-items:center;justify-content:space-between;padding:5px 0}.parent-search-results-row[_ngcontent-%COMP%]   .parent-search-results-row--players[_ngcontent-%COMP%]{flex-wrap:wrap;display:flex;justify-content:flex-end;line-height:1.4em}",".radio-group[_ngcontent-%COMP%]{border:1px solid var(--border-color);padding:1rem;display:flex;align-items:center;border-radius:8px;margin-bottom:1rem}.radio-group[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{margin-left:1rem}.radio-group.active[_ngcontent-%COMP%]{border-color:var(--green-400);background-color:var(--blue-25)}"]});let a=d;return a})();var ho=(()=>{let d=class d{constructor(t,n,r){this.route=t,this.siteDataService=n,this.manageTeamService=r}ngOnInit(){this.manageTeamService.activeTab="roster",this.route.parent.params.subscribe(t=>{this.teamID=+t.id,this.programID=+t.programID,this.siteDataService.hideSiteLoader()})}};d.\u0275fac=function(n){return new(n||d)(C(I),C(E),C(ee))},d.\u0275cmp=D({type:d,selectors:[["app-roster"]],standalone:!1,decls:3,vars:2,consts:[[3,"teamID","programID"]],template:function(n,r){n&1&&(e(0,`    
1703`),x(1,"app-roster-panel",0),e(2,`
1704`)),n&2&&(l(),_("teamID",r.teamID)("programID",r.programID))},dependencies:[_o],styles:[".roster-totals-data[_ngcontent-%COMP%]{display:flex;padding:0 1rem}.roster-totals-data[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{display:flex;justify-content:center;flex-direction:column;align-items:center;text-transform:uppercase;font-size:var(--text-small);color:var(--grey-700);margin-top:.5rem;margin-bottom:.5rem}.roster-totals-data[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]   strong[_ngcontent-%COMP%]{display:block;font-size:var(--text-large);font-weight:500;line-height:1;text-transform:none;color:var(--base-text)}.player-number-input[_ngcontent-%COMP%]{width:7ch;box-sizing:content-box;font-size:var(--text-small);padding:0}.parent-search-results-row[_ngcontent-%COMP%]{width:450px;display:flex;align-items:center;justify-content:space-between;padding:5px 0}.parent-search-results-row[_ngcontent-%COMP%]   .parent-search-results-row--players[_ngcontent-%COMP%]{flex-wrap:wrap;display:flex;justify-content:flex-end;line-height:1.4em}"]});let a=d;return a})();function U0(a,d){if(a&1){let i=y();e(0,`
1705          `),s(1,"p-selectButton",4),R("ngModelChange",function(n){g(i);let r=m();
1705return P(r.selectedSection,n)||(r.selectedSection=n),f(n)}),v("onChange",function(n){g(i);let r=m();return f(r.onSectionChange(n.value))}),o(),e(2,`
1706        `)}if(a&2){let i=m();l(),_("options",i.sectionOptions),M("ngModel",i.selectedSection),_("allowEmpty",!1)}}var go=(()=>{let d=class d{constructor(t,n,r,c,h,b){this.router=t,this.clubCalendarService=n,this.route=r,this.authorizeService=c,this.manageTeamService=h,this.siteDataService=b,this.unsubscribe$=new U,this.Permission=W,this.showPublish=!1,this.sectionOptions=[],this.selectedSection=null}ngOnInit(){this.siteDataService.hideSiteLoader(),this.manageTeamService.activeTab="schedule",this.siteDataService.getClubSettings().pipe(S(this.unsubscribe$)).subscribe({next:t=>{this.clubSettings=t,this.buildSectionOptions()}}),this.authorizeService.getUser().pipe(S(this.unsubscribe$)).subscribe(t=>{t&&(this.user=t,this.buildSectionOptions())}),this.route.parent.params.pipe(S(this.unsubscribe$)).subscribe({next:t=>{console.log("params",t),this.programID=+t.programID,this.teamID=+t.id,this.siteDataService.hideSiteLoader()},error:t=>{console.error(t),this.siteDataService.hideSiteLoader()}}),this.router.events.pipe(tt(t=>t instanceof ai)).subscribe(()=>{this.updateShowPublish()}),this.updateShowPublish()}updateShowPublish(){let t=this.route;for(this.showPublish=!1;t.firstChild;)t=t.firstChild,t.snapshot.data&&t.snapshot.data.showPublish&&(this.showPublish=!0);t.snapshot.data&&t.snapshot.data.showPublish&&(this.showPublish=!0),this.setSelectedSectionFromRoute()}buildSectionOptions(){let t=[{label:"Calendar",value:"calendar"}];this.user?.[W.FieldCalendar]&&t.push({label:`${this.clubSettings?.club?.sport?.locationType||"Field"} Schedule`,value:"field-schedule"}),this.sectionOptions=t}setSelectedSectionFromRoute(){this.selectedSection=this.router.url.includes("/field-schedule")?"field-schedule":"calendar"}onSectionChange(t){this.router.navigate([t==="field-schedule"?"field-schedule":"./"],{relativeTo:this.route})}publish(){console.log("publish"),this.clubCalendarService.publishEventsClicked()}ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete()}};d.\u0275fac=function(n){return new(n||d)(C(H),C(It),C(I),C(ae),C(ee),C(E))},d.\u0275cmp=D({type:d,selectors:[["app-schedule"]],standalone:!1,decls:15,vars:1,consts:[["role","main"],[1,"calendar-header-navigation"],[1,"mb-3"],[1,"full-width","d-flex","justify-content-center"],["optionLabel","label","optionValue","value",3,"ngModelChange","onChange","options","ngModel","allowEmpty"]],template:function(n,r){n&1&&(s(0,"main",0),e(1,`
1707  `),s(2,"div",1),e(3,`
1708    `),s(4,"div",2),e(5,`
1709      `),s(6,"div",3),e(7,`
1710        `),e(8,`
1711        `),p(9,U0,3,3),o(),e(10,`
1712    `),o(),e(11,`
1713  `),o(),e(12,`
1714  `),x(13,"router-outlet"),e(14,`
1715`),o()),n&2&&(l(9),u(r.showPublish?9:-1))},dependencies:[vt,De,Ee,ui],styles:["h2[_ngcontent-%COMP%]:not(:first-child){margin-top:1.5rem}.border-left-lg.event-type-1[_ngcontent-%COMP%]{border-left-color:var(--red-700)}.border-left-lg.event-type-2[_ngcontent-%COMP%]{border-left-color:var(--yellow-500)}.border-left-lg.event-type-4[_ngcontent-%COMP%]{border-left-color:var(--blue-1000)}.border-left-lg.event-type-3[_ngcontent-%COMP%]{border-left-color:var(--red-700)}",".calendar-header-navigation[_ngcontent-%COMP%]{max-width:calc(100vw - 90px);position:sticky!important;left:0;margin-bottom:1rem}"]});let a=d;return a})();var O0=()=>["/admin/teams/assign-staff"],B0=(a,d)=>({programID:a,teamID:d}),j0=a=>["admin-view",a,"profile"];function z0(a,d){if(a&1&&(e(0,`
1716    `),s(1,"a",3),e(2,`
1717        Edit Staff Assignments
1718    `),o(),e(3,`
1719    `)),a&2){let i=m();l(),_("routerLink",Q(2,O0))("state",pe(3,B0,i.programID,i.teamID))}}function q0(a,d){a&1&&(e(0,`
1720                            `),s(1,"span",14),e(2,`
1721                                `),x(3,"i",15),e(4,`
1722                            `),o(),e(5,`
1723                            `))}function W0(a,d){if(a&1){let i=y();e(0,`
1724                        `),s(1,"button",16),v("click",function(){g(i);let n=m().$implicit,r=m(2);return f(r.goToMessages(n))}),e(2,"Message"),o(),e(3,`
1725                        `)}}function H0(a,d){if(a&1&&(e(0,`
1726                        `),s(1,"a",17),e(2,`
1727                            Profile
1728                        `),o(),e(3,`
1729                        `)),a&2){let i=m().$implicit;l(),_("routerLink",L(1,j0,i.clubUserID))}}function G0(a,d){if(a&1&&(e(0,`
1730        `),s(1,"div",4),e(2,`
1731            `),s(3,"div",5),e(4,`
1732                `),s(5,"div",6),e(6,`
1733                    `),e(7,`
1734                    `),s(8,"div",7),e(9,`
1735                        `),s(10,"span"),N(11,"slice"),e(12),o(),e(13,`
1736                    `),o(),e(14,`
1737                    `),e(15,`
1738                    `),s(16,"div",8),e(17,`
1739                        `),s(18,"div",9),e(19),o(),e(20,`
1740                        `),s(21,"div",10),e(22,`
1741                            `),s(23,"span",11),e(24),o(),e(25,`
1742                            `),p(26,q0,6,0),o(),e(27,`
1743                    `),o(),e(28,`
1744                `),o(),e(29,`
1745                `),s(30,"div",12),e(31,`
1746                    `),e(32,`
1747                    `),s(33,"div",13),e(34,`
1748                        `),p(35,W0,4,0),p(36,H0,4,3),o(),e(37,`
1749                `),o(),e(38,`
1750            `),o(),e(39,`
1751        `),o(),e(40,`
1752        `)),a&2){let i=d.$implicit,t=m(2);l(10),nt(Tn("user-initials default-circle user",B(11,11,i.clubUser.user==null?null:i.clubUser.user.userID.toString(),-1))),l(2),z(`
1753                            `,i.clubUser.user==null||i.clubUser.user.firstName==null?null:i.clubUser.user.firstName.charAt(0),"",i.clubUser.user==null||i.clubUser.user.lastName==null?null:i.clubUser.user.lastName.charAt(0),`
1754                        `),l(7),z(`
1755                            `,i.clubUser.user.firstName," ",i.clubUser.user.lastName,`
1756                        `),l(5),T(i.roleName),l(2),u(i.roleID===3&&!i.secondary?26:-1),l(9),u(t.currentClubUser.clubUserID!==i.clubUserID&&!t.adminView?35:-1),l(),u(t.adminView?36:-1)}}function Y0(a,d){if(a&1&&(e(0,`
1757        `),F(1,G0,41,14,null,null,$)),a&2){let i=m();l(),V(i.teamStaff)}}function Q0(a,d){a&1&&(e(0,`
1758        `),s(1,"div",18),e(2,`
1759            `),s(3,"app-inline-alert",19),e(4,`This team doesn't have any staff assigned to it.
1760            `),o(),e(5,`
1761        `),o(),e(6,`
1762        `)),a&2&&(l(3),_("isInline",!0))}var fo=(()=>{let d=class d{constructor(t,n,r,c,h,b,k,te){this.route=t,this.siteDataService=n,this.teamService=r,this.messageService=c,this.userService=h,this.authorizeService=b,this.router=k,this.manageTeamService=te,this.loading=!0,this.teamStaff=[],this.adminView=!1,this.Permission=W}ngOnInit(){this.adminView=this.route.snapshot.parent.data?.adminView,this.teamID=+this.route.snapshot.parent.params.id,this.programID=+this.route.snapshot.parent.params.programID,this.manageTeamService.activeTab="staff",this.teamService.getStaffAssignmentsToTeam(this.teamID,this.programID).subscribe(t=>{this.teamStaff=t,this.currentClubUser=this.userService.loggedInClubUser,this.siteDataService.hideSiteLoader()}),this.authorizeService.getUser().pipe(fn(1)).subscribe(t=>{this.user=t})}goToMessages(t){this.messageService.selectedRecipients=[],this.messageService.selectedRecipients.push(St(t.clubUser,this.teamID,this.programID)),this.router.navigate([`/admin/manage-team/${this.teamID}/program/${this.programID}/communication/messages-view`])}};d.\u0275fac=function(n){return new(n||d)(C(I),C(E),C(X),C(re),C(ve),C(ae),C(H),C(ee))},d.\u0275cmp=D({type:d,selectors:[["app-staff"]],standalone:!1,decls:11,vars:2,consts:[[1,"mb-3"],[1,"row"],[1,"col-xl-12"],[1,"btn","btn-icon-user",3,"routerLink","state"],[1,"border-bottom","pt-0","pb-0"],[1,"list-row","py-2","text-medium"],[1,"list-row-body","d-flex","align-items-center"],[1,"profile-image","align-self-center"],[1,"pl-2"],[1,"text-default"],[1,"text-medium"],[1,"text-grey"],[1,"list-row-meta"],[1,"list-row-item","list-row-item-lg"],[1,"ml-1"],[1,"fas","fa-flag","ng-star-inserted"],[1,"btn","btn-sm","btn-icon-comment-dots",3,"click"],[1,"btn","btn-icon-user","btn-sm","btn-tertiary",3,"routerLink"],[1,"mt-3","text-small"],["alertType","info",3,"isInline"]],template:function(n,r){n&1&&(s(0,"div",0),e(1,`
1763    `),p(2,z0,4,6),o(),e(3,`
1764`),s(4,"div",1),e(5,`
1765    `),s(6,"div",2),e(7,`
1766        `),p(8,Y0,3,0)(9,Q0,7,1),o(),e(10,`
1767`),o()),n&2&&(l(2),u(r.user[r.Permission.AssignStaff]?2:-1),l(6),u((r.teamStaff==null?null:r.teamStaff.length)>0?8:9))},dependencies:[de,ce,Pn],encapsulation:2});let a=d;return a})();var zt=(()=>{let d=class d{constructor(t,n){this.siteDataService=t,this.playerFeedbackService=n,this.editable=!0,this.selectable=!1,this.onEdit=new fe,this.onSelect=new fe,this.searching=!0,this.feedback=[],this.totalCount=0,this.rows=5,this.unsubscribe$=new U}loadData(t){this.lastSearchData=t,this.searching=!0;let n=t.first/this.rows+1;this.playerFeedbackService.getPlayerFeedback(this.playerID,this.teamID,n,this.rows).pipe(S(this.unsubscribe$)).subscribe(r=>{r&&(this.feedback=r.results,this.totalCount=r.count),this.searching=!1,this.siteDataService.hideSiteLoader()},()=>{this.siteDataService.showSiteErrorAlert("There was a problem getting data.")})}search(){this.loadData(this.lastSearchData)}ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete()}};d.\u0275fac=function(n){return new(n||d)(C(E),C(jt))},d.\u0275cmp=D({type:d,selectors:[["app-feedback"]],inputs:{playerID:"playerID",teamID:"teamID",editable:"editable",selectable:"selectable"},outputs:{onEdit:"onEdit",onSelect:"onSelect"},standalone:!1,decls:2,vars:7,consts:[[3,"loadData","onEdit","onSelect","feedback","rows","totalCount","searching","editable","showTeam","selectable"]],template:function(n,r){n&1&&(s(0,"app-player-feedback",0),v("loadData",function(h){return r.loadData(h)})("onEdit",function(h){return r.onEdit.emit(h)})("onSelect",function(h){return r.onSelect.emit(h)}),e(1,`
1768`),o()),n&2&&_("feedback",r.feedback)("rows",r.rows)("totalCount",r.totalCount)("searching",r.searching)("editable",r.editable)("showTeam",!1)("selectable",r.selectable)},dependencies:[ya],encapsulation:2});let a=d;return a})();var J0=()=>({field:"lastName",order:1}),K0=()=>({field:"firstName",order:1}),Z0=(a,d)=>[a,d],X0=a=>["/admin/users",a,"profile"];function ec(a,d){if(a&1&&(e(0,`
1769        `),s(1,"app-user-info-view-only-card",4),e(2,`
1770        `),o(),e(3,`
1771      `)),a&2){let i=m(2);l(),_("entity",i.player.user)("fields",i.userFields)}}function tc(a,d){if(a&1){let i=y();e(0,`
1772        `),s(1,"app-user-info-view-only-card",5),v("edit",function(){g(i);let n=m(2);return f(n.showEditPlayerInfo=!0)}),e(2,`
1773        `),o(),e(3,`
1774      `)}if(a&2){let i=m(2);l(),_("entity",i.player.playerClubData)("fields",i.playerClubDataFields)("isEditable",!0)}}function ic(a,d){if(a&1&&(e(0,`
1775        `),s(1,"app-user-info-view-only-card",6),e(2,`
1776        `),o(),e(3,`
1777      `)),a&2){let i=m(2);l(),_("entity",i.player.user.userEmergencyContactInfo)("fields",i.emergencyContactFields)}}function nc(a,d){a&1&&(e(0,`
1778          `),s(1,"tr"),e(2,`
1779            `),s(3,"th"),e(4,"Last Name"),o(),e(5,`
1780            `),s(6,"th"),e(7,"First Name"),o(),e(8,`
1781            `),s(9,"th"),e(10,"Email"),o(),e(11,`
1782            `),s(12,"th"),e(13,"Phone"),o(),e(14,`
1783          `),o(),e(15,`
1784        `))}function ac(a,d){if(a&1&&(e(0,`
1785              `),s(1,"a",11),e(2),o(),e(3,`
1786            `)),a&2){let i=m().$implicit;l(),_("routerLink",L(2,X0,i.clubUserID)),l(),w(`
1787                `,i.user.lastName,`
1788              `)}}function oc(a,d){if(a&1&&e(0),a&2){let i=m().$implicit;w(`
1789              `,i.user.lastName,`
1790            `)}}function rc(a,d){if(a&1&&(e(0,`
1791          `),s(1,"tr"),e(2,`
1792            `),s(3,"td"),p(4,ac,4,4)(5,oc,1,1),o(),e(6,`
1793          `),s(7,"td"),e(8),o(),e(9,`
1794          `),s(10,"td"),e(11),o(),e(12,`
1795          `),s(13,"td"),e(14),o(),e(15,`
1796        `),o(),e(16,`
1797      `)),a&2){let i=d.$implicit,t=m(3);l(4),u(t.user[t.Permission.UserAdmin]?4:5),l(4),T(i.user.firstName),l(3),T(i.user.email),l(3),T(i.user.cellPhone?i.user.cellPhone:i.user.homePhone)}}function sc(a,d){if(a&1&&(e(0,`
1798    `),s(1,"section",7),e(2,`
1799      `),s(3,"h4"),e(4,"Parents/Legal Guardians"),o(),e(5,`
1800      `),s(6,"p-table",8),e(7,`
1801        `),A(8,nc,16,0,"ng-template",9),e(9,`
1802        `),A(10,rc,17,4,"ng-template",10),e(11,`
1803    `),o(),e(12,`
1804  `),o(),e(13,`
1805`)),a&2){let i=m(2);l(6),_("value",i.parents)("multiSortMeta",pe(4,Z0,Q(2,J0),Q(3,K0)))}}function lc(a,d){if(a&1){let i=y();e(0,`
1806  `),s(1,"div",12),e(2,`
1807    `),s(3,"div",13),e(4,`
1808      `),s(5,"h4"),e(6,"Feedback"),o(),e(7,`
1809      `),s(8,"button",14),v("click",function(){g(i);let n=m(2);return f(n.editFeedback())}),e(9,`
1810        Add Feedback
1811      `),o(),e(10,`
1812    `),o(),e(11,`
1813    `),s(12,"div",15),e(13,`
1814      `),s(14,"app-feedback",16),v("onEdit",function(n){g(i);let r=m(2);return f(r.editFeedback(n))}),o(),e(15,`
1815    `),o(),e(16,`
1816  `),o(),e(17,`
1817`)}if(a&2){let i=m(2);l(14),_("playerID",i.playerID)("teamID",i.teamID)}}function dc(a,d){if(a&1&&(e(0,`
1818  `),s(1,"app-admin-header",1),e(2,`
1819  `),o(),e(3,`
1820  `),s(4,"div",2),e(5,`
1821    `),s(6,"div",3),e(7,`
1822      `),p(8,ec,4,2),p(9,tc,4,3),o(),e(10,`
1823    `),s(11,"div",3),e(12,`
1824      `),p(13,ic,4,2),o(),e(14,`
1825  `),o(),e(15,`
1826  `),p(16,sc,14,7),p(17,lc,18,2)),a&2){let i=m();l(),_("pageTitle",(i.player==null||i.player.user==null?null:i.player.user.firstName)+" "+(i.player==null||i.player.user==null?null:i.player.user.lastName))("parentLinkUrl","../..")("parentLinkText","Roster")("showBackButton",!0),l(7),u(i.player?8:-1),l(),u(i.player.playerClubData?9:-1),l(4),u(i.player?13:-1),l(3),u(i.parents&&i.parents.length>0?16:-1),l(),u(i.user[i.Permission.PlayerFeedback]?17:-1)}}function mc(a,d){if(a&1){let i=y();e(0,`
1827  `),s(1,"app-feedback-edit",17),v("save",function(){g(i);let n=m();return f(n.feedbackSave())})("delete",function(){g(i);let n=m();return f(n.feedbackSave())})("cancel",function(){g(i);let n=m();return f(n.showFeedbackModal=!1)}),e(2,`
1828  `),o(),e(3,`
1829`)}if(a&2){let i=m();l(),_("playerID",i.playerID)("teamID",i.teamID)("playerFeedbackID",i.playerFeedbackID)}}function cc(a,d){if(a&1){let i=y();e(0,`
1830    `),s(1,"app-dynamic-form",18),v("onSubmit",function(n){g(i);let r=m();
1830return r.savePlayerClubData(n),f(r.showEditPlayerInfo=!1)})("onCancel",function(){g(i);let n=m();return f(n.showEditPlayerInfo=!1)}),e(2,`
1831      `),x(3,"app-dynamic-form-field",19),e(4,`
1832      `),x(5,"app-dynamic-form-field",20),e(6,`
1833      `),x(7,"app-dynamic-form-field",21),e(8,`
1834      `),s(9,"app-dynamic-form-field",22),e(10,`
1835      `),o(),e(11,`
1836      `),s(12,"app-dynamic-form-field",23),e(13,`
1837      `),o(),e(14,`
1838      `),s(15,"app-dynamic-form-field",24),e(16,`
1839      `),o(),e(17,`
1840      `),s(18,"app-dynamic-form-field",25),e(19,`
1841      `),o(),e(20,`
1842      `),s(21,"app-dynamic-form-field",26),e(22,`
1843      `),o(),e(23,`
1844      `),s(24,"app-dynamic-form-field",27),e(25,`
1845      `),o(),e(26,`
1846      `),s(27,"app-dynamic-form-field",28),e(28,`
1847      `),o(),e(29,`
1848      `),x(30,"app-dynamic-form-field",29),e(31,`
1849      `),x(32,"app-dynamic-form-field",30),e(33,`
1850      `),x(34,"app-dynamic-form-field",31),e(35,`
1851      `),x(36,"app-dynamic-form-field",32),e(37,`
1852      `),x(38,"app-dynamic-form-field",33),e(39,`
1853      `),x(40,"app-dynamic-form-field",34),e(41,`
1854      `),x(42,"app-dynamic-form-field",35),e(43,`
1855      `),x(44,"app-dynamic-form-field",36),e(45,`
1856      `),x(46,"app-dynamic-form-field",37),e(47,`
1857      `),x(48,"app-dynamic-form-field",38),e(49,`
1858      `),x(50,"app-dynamic-form-field",39),e(51,`
1859      `),x(52,"app-dynamic-form-field",40),e(53,`
1860      `),x(54,"app-dynamic-form-field",41),e(55,`
1861      `),x(56,"app-dynamic-form-field",42),e(57,`
1862      `),x(58,"app-dynamic-form-field",43),e(59,`
1863      `),x(60,"app-dynamic-form-field",44),e(61,`
1864      `),x(62,"app-dynamic-form-field",45),e(63,`
1865      `),x(64,"app-dynamic-form-field",46),e(65,`
1866      `),x(66,"app-dynamic-form-field",47),e(67,`
1867      `),x(68,"app-dynamic-form-field",48),e(69,`
1868      `),x(70,"app-dynamic-form-field",49),e(71,`
1869      `),x(72,"app-dynamic-form-field",50),e(73,`
1870      `),x(74,"app-dynamic-form-field",51),e(75,`
1871      `),x(76,"app-dynamic-form-field",52),e(77,`
1872      `),x(78,"app-dynamic-form-field",53),e(79,`
1873      `),x(80,"app-dynamic-form-field",54),e(81,`
1874      `),s(82,"app-dynamic-form-field",55),e(83,`
1875      `),o(),e(84,`
1876      `),s(85,"app-dynamic-form-field",56),e(86,`
1877      `),o(),e(87,`
1878      `),s(88,"app-dynamic-form-field",57),e(89,`
1879      `),o(),e(90,`
1880      `),s(91,"app-dynamic-form-field",58),e(92,`
1881      `),o(),e(93,`
1882      `),s(94,"app-dynamic-form-field",59),e(95,`
1883      `),o(),e(96,`
1884      `),s(97,"app-dynamic-form-field",60),e(98,`
1885      `),o(),e(99,`
1886      `),s(100,"app-dynamic-form-field",61),e(101,`
1887      `),o(),e(102,`
1888      `),s(103,"app-dynamic-form-field",62),e(104,`
1889      `),o(),e(105,`
1890    `),o(),e(106,`
1891  `)}if(a&2){let i=m();l(),_("fields",i.playerClubDataFields)("entity",i.player.playerClubData)("horizontalForm",!0)("showCancelButton",!0)("showSubmitButton",!0)("contentFieldsMode",!0)}}var Co=(()=>{let d=class d{constructor(t,n,r,c,h,b,k){this.userService=t,this.teamService=n,this.route=r,this.siteDataService=c,this.authorize=h,this.playerService=b,this.formService=k,this.loading=!0,this.showFeedbackModal=!1,this.showEditPlayerInfo=!1,this.Permission=W,this.unsubscribe$=new U}ngOnInit(){this.teamID=+this.route.snapshot.parent.parent.params.id,this.playerID=+this.route.snapshot.parent.params.playerID,j([this.userService.getRosterPlayerUserMetadata(),this.teamService.getTeamRosterPlayer(this.teamID,this.playerID),this.userService.getUserEmergencyContactInfoMetadata(),this.playerService.getParents(this.playerID),this.playerService.getPlayerClubDataMetadata()]).pipe(S(this.unsubscribe$)).subscribe(t=>{this.userFields=t[0].fields,this.player=t[1],this.emergencyContactFields=t[2].fields,this.parents=t[3],this.playerClubDataFields=t[4].fields,this.loading=!1,this.siteDataService.hideSiteLoader()}),this.authorize.getUser().subscribe(t=>{this.user=t})}editFeedback(t){this.playerFeedbackID=t,this.showFeedbackModal=!0}feedbackSave(){this.showFeedbackModal=!1,this.feedbackComponent.search()}savePlayerClubData(t){this.playerService.savePlayerClubData(this.playerID,t,this.player.playerClubData!==null).subscribe({next:()=>{this.player.playerClubData=Pe({},t),this.formService.hideFormLoader(),this.siteDataService.showSiteSuccessAlert("Player information saved successfully")},error:()=>{this.formService.hideFormLoader(),this.siteDataService.showSiteErrorAlert("There was a problem saving player information.")}})}ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete()}};d.\u0275fac=function(n){return new(n||d)(C(ve),C(X),C(I),C(E),C(ae),C(At),C(Se))},d.\u0275cmp=D({type:d,selectors:[["app-roster-player-profile"]],viewQuery:function(n,r){if(n&1&&Te(zt,5),n&2){let c;se(c=le())&&(r.feedbackComponent=c.first)}},standalone:!1,decls:5,vars:8,consts:[["header","Player Info","styleClass","standardWidthDialog",3,"visibleChange","visible","showHeader","closable","modal","draggable"],[3,"pageTitle","parentLinkUrl","parentLinkText","showBackButton"],[1,"row"],[1,"col-md-6"],["headerText","Basic Info",3,"entity","fields"],["headerText","Player Info",3,"edit","entity","fields","isEditable"],["headerText","Emergency Contact Info",3,"entity","fields"],[1,"card"],["sortMode","multiple",1,"table","table-striped","table-sm",3,"value","multiSortMeta"],["pTemplate","header"],["pTemplate","body"],[3,"routerLink"],[1,"card","edit-card"],[1,"card-header"],[1,"btn","btn-sm","btn-edit","header-action","btn-icon-clipboard",3,"click"],[1,"card-body"],[3,"onEdit","playerID","teamID"],[3,"save","delete","cancel","playerID","teamID","playerFeedbackID"],["formID","player-club-data","submitButtonText","Save",3,"onSubmit","onCancel","fields","entity","horizontalForm","showCancelButton","showSubmitButton","contentFieldsMode"],["fieldName","schoolName","formID","player-club-data"],["fieldName","gradeID","formID","player-club-data"],["fieldName","playsForSchool","formID","player-club-data"],["fieldName","schoolTeamLevelID","formID","player-club-data"],["fieldName","isGoalkeeper","formID","player-club-data-form"],["fieldName","goalkeeperStatusID","formID","player-club-data-form"],["fieldName","positionID","formID","player-club-data"],["fieldName","secondaryPositionID","formID","player-club-data"],["fieldName","preferredPositionID","formID","player-club-data"],["fieldName","preferredSecondaryPositionID","formID","player-club-data"],["fieldName","preferredNumber","formID","player-club-data"],["fieldName","preferredNumber2","formID","player-club-data"],["fieldName","preferredNumber3","formID","player-club-data"],["fieldName","number","formID","player-club-data"],["fieldName","tryoutNumber","formID","player-club-data"],["fieldName","tShirtSizeID","formID","player-club-data"],["fieldName","referralOptionID","formID","player-club-data"],["fieldName","referralOptionFollowUp","formID","player-club-data"],["fieldName","previousClub","formID","player-club-data"],["fieldName","interestedInRefereeProgram","formID","player-club-data"],["fieldName","certifiedAsReferee","formID","player-club-data"],["fieldName","namesOfFriends","formID","player-club-data"],["fieldName","friendGroup","formID","player-club-data"],["fieldName","coachRequest","formID","player-club-data"],["fieldName","highSchoolLevelID","formID","player-club-data"],["fieldName","playedWithUsLastYear","formID","player-club-data"],["fieldName","playedWithUsLastYearFollowUp","formID","player-club-data"],["fieldName","levelID","formID","player-club-data"],["fieldName","comments","formID","player-club-data"],["fieldName","roommatePreferences","formID","player-club-data"],["fieldName","playOtherSports","formID","player-club-data"],["fieldName","otherSports","formID","player-club-data"],["fieldName","graduationYear","formID","player-club-data"],["fieldName","playingExperienceID","formID","player-club-data"],["fieldName","playingExperienceFollowUp","formID","player-club-data"],["fieldName","experienceYears","formID","player-club-data"],["fieldName","collegeGraduationYear","formID","player-club-data"],["fieldName","collegeAttended","formID","player-club-data"],["fieldName","trappedPlayerStatusID","formID","player-club-data"],["fieldName","playerCardID","formID","player-club-data"],["fieldName","playerCardID2","formID","player-club-data"],["fieldName","playerCardID3","formID","player-club-data"],["fieldName","playerCardID4","formID","player-club-data"],["fieldName","playerCardID5","formID","player-club-data"]],template:function(n,r){n&1&&(p(0,dc,18,9),p(1,mc,4,3),s(2,"p-dialog",0),R("visibleChange",function(h){return P(r.showEditPlayerInfo,h)||(r.showEditPlayerInfo=h),h}),e(3,`
1892  `),p(4,cc,107,6),o()),n&2&&(u(r.loading?-1:0),l(),u(r.user[r.Permission.PlayerFeedback]&&r.showFeedbackModal?1:-1),l(),M("visible",r.showEditPlayerInfo),_("showHeader",!0)("closable",!0)("modal",!0)("draggable",!1),l(2),u(r.playerClubDataFields&&r.showEditPlayerInfo?4:-1))},dependencies:[de,he,_e,ke,ia,xi,Fe,oe,ji,zt],encapsulation:2});let a=d;return a})();var pc=["optionsMenu"],uc=()=>({width:"100%"}),_c=()=>["../../.."],hc=()=>["./"],gc=a=>({formID:a}),fc=()=>({}),xc=()=>({width:"auto"});function Cc(a,d){if(a&1&&(e(0,`
1893              `),s(1,"span",12),e(2),o(),e(3,`
1894            `)),a&2){let i=m(2);l(2),w("#",i.player.playerClubData==null?null:i.player.playerClubData.number)}}function vc(a,d){if(a&1){let i=y();e(0,`
1895            `),s(1,"div",13),e(2,`
1896              `),s(3,"div",14),e(4,`
1897                `),s(5,"p-select",15),R("ngModelChange",function(n){g(i);let r=m(2);return P(r.selectedRosterPlayer,n)||(r.selectedRosterPlayer=n),f(n)}),v("ngModelChange",function(n){g(i);let r=m(2);return f(r.changePlayer(n,!1))}),e(6,`
1898                `),o(),e(7,`
1899              `),o(),e(8,`
1900            `),o(),e(9,`
1901          `)}if(a&2){let i=m(2);l(5),Oe(Q(5,uc)),M("ngModel",i.selectedRosterPlayer),_("options",i.roster)("filter",!1)}}function bc(a,d){if(a&1){let i=y();e(0,`
1902    `),s(1,"app-shared-survey-response-edit",16),v("onSave",function(n){g(i);let r=m(2);return f(r.onResponseSave(n))})("onCancel",function(){g(i);let n=m(2);return f(n.cancel())})("onCopyFeedback",function(){g(i);let n=m(2);return f(n.openAddFeedbackModal())}),e(2,`
1903    `),o(),e(3,`
1904  `)}if(a&2){let i=m(2);l(),_("surveyID",i.surveyID)("showBackButton",!1)("showTitle",!0)("isEvaluator",!0)("showAIAssistant",!0)("playerID",i.playerID)("teamID",i.teamID)("survey",i.survey)("surveyResponse",i.surveyResponse)("showCopy
1904Feedback",i.user[i.Permission.PlayerFeedback]&&i.player.playerFeedbackCount>0)}}function Sc(a,d){if(a&1){let i=y();e(0,`
1905      `),s(1,"app-shared-survey-response",17),v("onCopyFeedback",function(){g(i);let n=m(3);return f(n.openAddFeedbackModal())}),e(2,`
1906      `),o(),e(3,`
1907    `)}if(a&2){let i=m(3);l(),_("isEvaluator",!0)("survey",i.survey)("surveyID",i.surveyID)("surveyResponse",i.surveyResponse)("surveyReview",i.surveyReview)("editable",!i.formExpired)("showCopyFeedback",i.user[i.Permission.PlayerFeedback]&&i.player.playerFeedbackCount>0)}}function yc(a,d){a&1&&(e(0,`
1908                `),x(1,"span",22),e(2,`
1909              `))}function wc(a,d){if(a&1){let i=y();e(0,`
1910            `),s(1,"button",20),v("click",function(n){g(i);let r=m(5);return f(r.toggleOptionsMenu(n))}),e(2,`
1911              `),p(3,yc,3,0),e(4),o(),e(5,`
1912            `),s(6,"p-menu",21,0),e(8,`
1913            `),o(),e(9,`
1914          `)}if(a&2){let i=m(5);l(),_("disabled",i.loading||i.saving||i.savingFinishLater),l(2),u(i.saving?3:-1),l(),w(`
1915              `,i.saving?"Saving...":"Save",`
1916            `),l(2),Oe(Q(7,xc)),_("model",i.options)("popup",!0)}}function Tc(a,d){a&1&&(e(0,`
1917                `),x(1,"span",22),e(2,`
1918              `))}function Dc(a,d){a&1&&e(0,`
1919                Saving...
1920              `)}function Ec(a,d){a&1&&e(0,`
1921                  Save
1922                `)}function Ic(a,d){a&1&&e(0,`
1923                  Save & Complete
1924                `)}function Mc(a,d){if(a&1&&(e(0,`
1925                `),p(1,Ec,1,0)(2,Ic,1,0)),a&2){let i=m(6);l(),u(i.surveyReview!=null&&i.surveyReview.isCompleted?1:2)}}function Pc(a,d){if(a&1){let i=y();e(0,`
1926            `),s(1,"button",20),v("click",function(){g(i);let n=m(5);return f(n.save(!0,!1))}),e(2,`
1927              `),p(3,Tc,3,0),p(4,Dc,1,0)(5,Mc,3,1),o(),e(6,`
1928          `)}if(a&2){let i=m(5);l(),_("disabled",i.loading||i.saving||i.savingFinishLater),l(2),u(i.saving?3:-1),l(),u(i.saving?4:5)}}function Rc(a,d){a&1&&(e(0,`
1929                `),x(1,"span",22),e(2,`
1930              `))}function kc(a,d){a&1&&e(0,`
1931                Saving...
1932              `)}function Fc(a,d){a&1&&e(0,`
1933                Save & Finish Later
1934              `)}function Vc(a,d){if(a&1){let i=y();e(0,`
1935            `),s(1,"button",23),v("click",function(){g(i);let n=m(5);return f(n.save(!1,!1))}),e(2,`
1936              `),p(3,Rc,3,0),p(4,kc,1,0),p(5,Fc,1,0),o(),e(6,`
1937          `)}if(a&2){let i=m(5);l(),_("disabled",i.saving||i.savingFinishLater),l(2),u(i.savingFinishLater?3:-1),l(),u(i.savingFinishLater?4:-1),l(),u(i.savingFinishLater?-1:5)}}function Ac(a,d){if(a&1&&(e(0,`
1938          `),p(1,wc,10,8)(2,Pc,7,3),p(3,Vc,7,4)),a&2){let i=m(4);l(),u(i.showNotify&&(!i.surveyReview||!i.surveyReview.isNotified)?1:2),l(2),u(!i.surveyReview||!i.surveyReview.isCompleted?3:-1)}}function Nc(a,d){if(a&1&&(e(0,`
1939      `),s(1,"div",18),e(2,`
1940        `),p(3,Ac,4,2),s(4,"a",19),e(5,`
1941          Cancel
1942        `),o(),e(6,`
1943      `),o(),e(7,`
1944    `)),a&2){let i=m(3);l(3),u(i.formExpired?-1:3),l(),ie("text-grey",i.saving),_("routerLink",i.saving?Q(6,hc):Q(5,_c))("queryParams",i.saving?Q(9,fc):L(7,gc,i.surveyID))}}function Lc(a,d){if(a&1&&(e(0,`
1945    `),p(1,Sc,4,7),p(2,Nc,8,10)),a&2){let i=m(2);l(),u(i.survey&&i.surveyResponse?1:-1),l(),u(i.survey?2:-1)}}function $c(a,d){if(a&1&&(e(0,`
1946  `),s(1,"div",3),e(2,`
1947    `),s(3,"div",4),e(4,`
1948      `),s(5,"div",5),e(6,`
1949        `),s(7,"div",6),e(8,`
1950          `),s(9,"div",7),e(10,`
1951            `),s(11,"span",8),e(12,`
1952              `),s(13,"app-user-initials",9),e(14,`
1953              `),o(),e(15,`
1954            `),o(),e(16,`
1955          `),o(),e(17,`
1956          `),s(18,"div",10),e(19,`
1957            `),e(20,`
1958            `),p(21,Cc,4,1),s(22,"span",11),e(23),o(),e(24,`
1959          `),o(),e(25,`
1960          `),p(26,vc,10,6),o(),e(27,`
1961      `),o(),e(28,`
1962    `),o(),e(29,`
1963  `),o(),e(30,`
1964  `),p(31,bc,4,10),p(32,Lc,3,2)),a&2){let i=m();l(13),_("firstName",i.player.user==null?null:i.player.user.firstName)("lastName",i.player.user==null?null:i.player.user.lastName)("size","large")("id",i.player.playerID),l(8),u(i.player.playerClubData!=null&&i.player.playerClubData.number?21:-1),l(2),z("",i.player.user.firstName," ",i.player.user.lastName),l(3),u((i.roster==null?null:i.roster.length)>1?26:-1),l(5),u(i.survey.surveyTypeID===i.SurveyType.COACH_PLAYER_ASSESSMENT?31:-1),l(),u(i.survey.surveyTypeID===i.SurveyType.P
1964LAYER_RESPONSE_COACH_REVIEW?32:-1)}}function Uc(a,d){if(a&1){let i=y();e(0,`
1965    `),s(1,"app-dialog-footer"),e(2,`
1966      `),J(3,24),e(4,`
1967        `),s(5,"button",25),v("click",function(){g(i);let n=m();return f(n.cancelChangePlayer())}),e(6,"No"),o(),e(7,`
1968      `),K(),e(8,`
1969      `),J(9,26),e(10,`
1970        `),s(11,"button",27),v("click",function(){g(i);let n=m();return f(n.changePlayer(n.switchPlayerID,!0))}),e(12,"Yes"),o(),e(13,`
1971      `),K(),e(14,`
1972    `),o(),e(15,`
1973  `)}}function Oc(a,d){if(a&1){let i=y();e(0,`
1974      `),s(1,"app-dialog-footer"),e(2,`
1975        `),J(3,24),e(4,`
1976            `),s(5,"button",25),v("click",function(){g(i);let n=m(2);return f(n.closeAddFeedbackModal())}),e(6,"Done"),o(),e(7,`
1977        `),K(),e(8,`
1978        `),J(9,26),e(10,`
1979        `),K(),e(11,`
1980      `),o(),e(12,`
1981    `)}}function Bc(a,d){if(a&1){let i=y();e(0,`
1982  `),s(1,"p-dialog",28),R("visibleChange",function(n){g(i);let r=m();return P(r.showFeedbackModal,n)||(r.showFeedbackModal=n),f(n)}),e(2,`
1983    `),s(3,"app-feedback",29),v("onSelect",function(n){g(i);let r=m();return f(r.copyFeedback(n))}),o(),e(4,`
1984    `),A(5,Oc,13,0,"ng-template",2),e(6,`
1985  `),o(),e(7,`
1986`)}if(a&2){let i=m();l(),M("visible",i.showFeedbackModal),_("modal",!0),l(2),_("playerID",i.playerID)("teamID",i.teamID)("editable",!1)("selectable",!0)}}var Yi=(()=>{let d=class d{constructor(t,n,r,c,h,b){this.teamSurveyService=t,this.route=n,this.siteDataService=r,this.router=c,this.authorizeService=h,this.sharedSurveyService=b,this.unsubscribe$=new U,this.SurveyType=Wt,this.loading=!0,this.saving=!1,this.savingFinishLater=!1,this.showSwitchPlayerConfirm=!1,this.showFeedbackModal=!1,this.showNotify=!1,this.Permission=W,this.options=[],this.formExpired=!1}ngOnInit(){this.teamID=+this.route.snapshot.parent.params.id,this.programID=+this.route.snapshot.parent.params.programID,this.authorizeService.getUser().subscribe(t=>{t&&(this.user=t)}),this.route.params.subscribe(t=>{t.surveyID&&t.playerID&&(this.surveyID=+t.surveyID,this.playerID=+t.playerID,this.teamSurveyService.teamID=this.teamID,this.teamSurveyService.surveyID=this.surveyID,this.teamSurveyService.playerID=this.playerID,j({roster:this.teamSurveyService.getTeamSurveySubmissionRoster(this.programID),survey:this.teamSurveyService.getTeamSurvey(),surveyResponse:this.teamSurveyService.getPlayerTeamSurveyResponse()}).pipe(ge(n=>j({roster:Z(n.roster),survey:Z(n.survey),surveyResponse:Z(n.surveyResponse),surveyReview:n.survey?.surveyTypeID===Wt.PLAYER_RESPONSE_COACH_REVIEW&&n.surveyResponse?.isCompleted?this.teamSurveyService.getPlayerTeamSurveyReview():Z(null)})),S(this.unsubscribe$)).subscribe(n=>{n.roster&&(this.player=n.roster.find(r=>r.playerID===this.playerID),this.roster=n.roster.map(r=>({value:r.playerID,label:r.user.fullName})),this.selectedRosterPlayer=this.playerID),this.survey=n.survey,this.survey&&(this.formExpired=new Date>new Date(this.survey.endDate)),this.surveyResponse=n.surveyResponse,this.surveyResponse||(this.surveyResponse=new va,this.surveyResponse.playerID=this.playerID,this.surveyResponse.surveyID=this.surveyID,this.surveyResponse.teamID=this.teamID),this.surveyReview=n.surveyReview,this.showNotify=this.survey?.criteriaGroups?.some(r=>r.surveyCriteriaGroupVisibilityOptionID===Ca.EVALUATOR_AND_EVALUATEE),this.loading=!1,this.siteDataService.hideSiteLoader()}))}),this.sharedSurveyService.downloadDocument$.pipe(S(this.unsubscribe$)).subscribe({next:t=>{this.teamSurveyService.downloadSurveyResponseDocument(t.surveyResponseID,t.surveyDocumentID).pipe(S(this.unsubscribe$)).subscribe({next:n=>{rt(n)},error:()=>{this.siteDataService.showSiteErrorAlert("The requested file could not be found.")}})}}),this.sharedSurveyService.deleteDocument$.pipe(S(this.unsubscribe$)).subscribe({next:t=>{this.teamSurveyService.deleteSurveyResponseDocument(t.surveyResponseID,t.surveyDocumentID).pipe(S(this.unsubscribe$)).subscribe({next:()=>{this.siteDataService.showSiteSuccessAlert("Document deleted succesfully"),this.sharedSurveyService.documentDeleted(t.surveyResponseID,t.surveyDocumentID)},error:()=>{this.siteDataService.showSiteErrorAlert("The requested file could not be found.")}})}}),this.sharedSurveyService.saveDocument$.pipe(S(this.unsubscribe$)).subscribe({next:t=>{this.teamSurveyService.saveSurveyResponseDocument(t.surveyResponseID,t.document.file).pipe(S(this.unsubscribe$)).subscribe({next:n=>{this.siteDataService.showSiteSuccessAlert("Document uploaded successfully"),this.sharedSurveyService.documentSaved(t.surveyResponseID,t.document,n)},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem uploading the document.")}})}})}changePlayer(t,n){n?this.switchPlayer(t):this.responseComponent&&this.responseComponent.dirty||this.editComponent&&!this.editComponent.pristine?(this.switchPlayerID=t,this.showSwitchPlayerConfirm=!0):this.switchPlayer(t)}switchPlayer(t){this.selectedRosterPlayer=t,this.router.navigate(["..",t],{relativeTo:this.route}),this.loading=!0,this.showSwitchPlayerConfirm=!1}cancelChangePlayer(){this.showSwitchPlayerConfirm=!1,this.selectedRosterPlayer=this.playerID}onResponseSave(t){this.teamSurveyService.saveSurveyResponse(t.response).pipe(ge(n=>{if(n&&(this.surveyResponse.surveyResponseID=n.surveyResponseID),t.documentsToUpload?.length){let r=[];
1986return t.documentsToUpload.forEach(c=>{let h=this.teamSurveyService.saveSurveyResponseDocument(this.surveyResponse.surveyResponseID,c.file);r.push(h)}),j(r)}else return Z(n)}),ge(()=>this.teamSurveyService.getSurveyResponse().pipe(Kt(n=>{this.surveyResponse=n})))).subscribe({next:()=>{this.siteDataService.showSiteSuccessAlert("Responses saved successfully"),this.sharedSurveyService.surveyResponseSaved(this.surveyResponse),this.roster?.length>1||this.cancel()},error:n=>{console.error(n),this.siteDataService.showSiteErrorAlert("There was a problem saving data.")}})}save(t,n){let r=this.surveyReview||new ba;t?(this.saving=!0,r.isCompleted=!0,r.isNotified||(r.isNotified=n)):this.savingFinishLater=!0,r.surveyQuestionReviews=this.responseComponent.surveyQuestionReviews.filter(c=>c.commentText),r.surveyCriteriaReviews=this.responseComponent.surveyCriteriaReviews.filter(c=>c.commentText),r.surveyCriteriaValues=this.responseComponent.reviewSurveyCriteriaValues,r.surveyCriteriaGroupComments=this.responseComponent.reviewSurveyCriteriaGroupComments.filter(c=>c.comments),this.teamSurveyService.savePlayerTeamSurveyReview(this.surveyResponse.surveyResponseID,r).pipe(ge(()=>this.teamSurveyService.getPlayerTeamSurveyReview()),S(this.unsubscribe$)).subscribe({next:c=>{this.surveyReview=c,this.saving=!1,this.savingFinishLater=!1,this.siteDataService.showSiteSuccessAlert("Responses saved successfully")},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem saving the responses."),this.saving=!1,this.savingFinishLater=!1}})}openAddFeedbackModal(){this.showFeedbackModal=!0}closeAddFeedbackModal(){this.showFeedbackModal=!1,this.sharedSurveyService.feedbackDone()}copyFeedback(t){this.sharedSurveyService.feedbackAdded(t),this.siteDataService.showSiteSuccessAlert("Feedback copied!",1e3)}toggleOptionsMenu(t){this.options=[{label:this.surveyResponse?.isCompleted?"Save":"Save & Complete",icon:"fa fa-check",command:()=>{this.save(!0,!1)}},{label:"Save & Notify",icon:"fa fa-paper-plane",command:()=>{this.save(!0,!0)}}],this.optionsMenu.toggle(t)}cancel(){this.router.navigate(["../../.."],{relativeTo:this.route,queryParams:{formID:this.surveyID}})}ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete()}};d.\u0275fac=function(n){return new(n||d)(C(Nt),C(I),C(E),C(H),C(ae),C(Ei))},d.\u0275cmp=D({type:d,selectors:[["app-form-review"]],viewQuery:function(n,r){if(n&1&&Te(Ii,5)(Mi,5)(pc,5),n&2){let c;se(c=le())&&(r.responseComponent=c.first),se(c=le())&&(r.editComponent=c.first),se(c=le())&&(r.optionsMenu=c.first)}},standalone:!1,decls:7,vars:4,consts:[["optionsMenu",""],["header","Confirm Switch Players",3,"visibleChange","visible","modal"],["pTemplate","footer"],[1,"mb-3"],[1,"card-content"],[1,"player-section"],[1,"row","no-gutters","border-bottom","pb-3"],[1,"col-auto"],[1,"profile-image","align-self-center","mr-2"],[3,"firstName","lastName","size","id"],[1,"player-info","justify-content-start","d-flex","align-items-center","col"],[1,"player-name"],[1,"player-number","mr-3"],[1,"col-auto","d-flex","align-items-center"],[1,"full-width"],[3,"ngModelChange","ngModel","options","filter"],[3,"onSave","onCancel","onCopyFeedback","surveyID","showBackButton","showTitle","isEvaluator","showAIAssistant","playerID","teamID","survey","surveyResponse","showCopyFeedback"],[3,"onCopyFeedback","isEvaluator","survey","surveyID","surveyResponse","surveyReview","editable","showCopyFeedback"],["appStickyFormButtons","",1,"sticky-buttons"],[1,"btn","btn-naked","btn-lg",3,"routerLink","queryParams"],["type","button",1,"btn","btn-lg","btn-primary",3,"click","disabled"],["appendTo","body",3,"model","popup"],["role","status","aria-hidden","true",1,"spinner-border","spinner-border-sm"],["type","button",1,"btn","btn-lg",3,"click","disabled"],["slot","secondary"],[1,"btn","btn-secondary",3,"click"],["slot","primary"],[1,"btn","btn-primary",3,"click"],["header","Select Feedback","styleClass","mediumWidthDialog mediumHeightDialog",3,"visibleChange","visible","modal"],[3,"onSelect","playerID","teamID","editable","selectable"]],template:function(n,r){n&1&&(p(0,$c,33,10),s(1,"p-dialog",1),R("visibleChange",function(h){return P(r.showSwitchPlayerConfirm,h)||(r.showSwitchPlayerConfirm=h),h}),e(2,`
1987  This form has unsaved changes. Are you sure you want to abandon those changes?
1988  `),A(3,Uc,16,0,"ng-template",2),e(4,`
1989`),o(),e(5,`
1990
1991`),p(6,Bc,8,6)),n&2&&(u(r.loading?-1:0),l(),M("visible",r.showSwitchPlayerConfirm),_("modal",!0),l(5),u(r.showFeedbackModal?6:-1))},dependencies:[de,De,Ee,ke,Ae,Tt,fi,oe,Qe,Ye,Mi,Ii,zt],styles:[".player-info[_ngcontent-%COMP%]{font-size:1.4rem}
1991.player-name[_ngcontent-%COMP%]{font-weight:700}.sticky-buttons[_ngcontent-%COMP%]{z-index:5}"]});let a=d;return a})();var vo=(()=>{let d=class d{constructor(t,n){this.siteDataService=t,this.router=n}canActivate(){return this.checkAccess()}checkAccess(){return this.siteDataService.getClubSettings().pipe(et(t=>t?.clubOptions?.find(r=>r.optionID===me.ENABLE_EXTERNAL_TOURNAMENT_REGISTRATION)?.boolValue??!1?!0:this.router.createUrlTree(["/error/unauthorized"])),hn(()=>[this.router.createUrlTree(["/error/unauthorized"])]))}};d.\u0275fac=function(n){return new(n||d)(it(E),it(H))},d.\u0275prov=gt({token:d,factory:d.\u0275fac,providedIn:"root"});let a=d;return a})();function jc(a,d){a&1&&(e(0,`
1992    `),s(1,"ul",1),e(2,`
1993      `),s(3,"li",2),e(4,`
1994        `),s(5,"a",3),e(6,"Profile"),o(),e(7,`
1995      `),o(),e(8,`
1996      `),s(9,"li",2),e(10,`
1997        `),s(11,"a",4),e(12,`
1998          College Profile
1999        `),o(),e(13,`
2000      `),o(),e(14,`
2001    `),o(),e(15,`
2002  `))}var bo=(()=>{let d=class d{constructor(t,n,r,c){this.teamService=t,this.route=n,this.siteDataService=r,this.authorizeService=c,this.Permission=W,this.adminView=!1,this.showTabs=!1}ngOnInit(){this.route.params.subscribe(t=>{t.playerID&&(this.teamID=+this.route.snapshot.parent.params.id,this.playerID=+t.playerID,j({player:this.teamService.getTeamRosterPlayer(this.teamID,this.playerID),options:this.siteDataService.getClubFieldOptions()}).subscribe(n=>{this.player=n.player,this.clubFieldOptions=n.options,this.showTabs=this.optionEnabled(Ce.COLLEGE_PROFILE)&&this.over13(this.player.user.dob)&&this.profile[W.CollegeProfile]}))}),this.authorizeService.getUser().subscribe(t=>{t&&(this.profile=t)})}optionEnabled(t){return this.clubFieldOptions?.find(n=>n.fieldOptionID===t)!==void 0}over13(t){return si(t)>=13}};d.\u0275fac=function(n){return new(n||d)(C(X),C(I),C(E),C(ae))},d.\u0275cmp=D({type:d,selectors:[["ng-component"]],standalone:!1,decls:5,vars:1,consts:[[1,"tabs"],["role","tablist",1,"tab-nav","no-bullets","inline-list"],["routerLinkActive","active",1,"nav-item"],["routerLink","profile","role","tab","aria-controls","home","aria-selected","true",1,"nav-link"],["routerLink","college-profile","role","tab","aria-controls","home",1,"nav-link"]],template:function(n,r){n&1&&(s(0,"div",0),e(1,`
2003  `),p(2,jc,16,0),o(),e(3,`
2004`),x(4,"router-outlet")),n&2&&(l(2),u(r.showTabs?2:-1))},dependencies:[vt,de,oi],encapsulation:2});let a=d;return a})();function zc(a,d){a&1&&(e(0,`
2005        `),s(1,"tr"),e(2,`
2006          `),s(3,"th"),e(4,`
2007            External Link
2008          `),o(),e(5,`
2009          `),s(6,"th"),e(7,`
2010            Last Synced
2011          `),o(),e(8,`
2012          `),s(9,"th"),e(10,`
2013            Sync Status
2014          `),o(),e(11,`
2015          `),s(12,"th"),e(13,`
2016            Test Connection
2017          `),o(),e(14,`
2018          `),s(15,"th"),e(16,`
2019            Sync Data
2020          `),o(),e(17,`
2021          `),s(18,"th"),e(19,`
2022            Edit
2023          `),o(),e(20,`
2024          `),s(21,"th"),e(22,`
2025            Delete
2026          `),o(),e(23,`
2027        `),o(),e(24,`
2028      `))}function qc(a,d){if(a&1&&(e(0,`
2029              `),x(1,"app-pill",19),e(2,`
2030            `)),a&2){let i=m().$implicit;l(),_("status",i.isArchived?"disabled":i.hasSyncSuccess?"success":"error")("text",i.isArchived?"Archived":i.hasSyncSuccess?"Synced":"Failed")}}function Wc(a,d){a&1&&(e(0,`
2031                `),x(1,"app-button-loader"),e(2,`
2032              `))}function Hc(a,d){a&1&&(e(0,`
2033                `),x(1,"app-button-loader"),e(2,`
2034              `))}function Gc(a,d){a&1&&(e(0,`
2035                `),x(1,"app-button-loader"),e(2,`
2036              `))}function Yc(a,d){a&1&&(e(0,`
2037                `),x(1,"app-button-loader"),e(2,`
2038              `))}function Qc(a,d){if(a&1){let i=y();e(0,`
2039        `),s(1,"tr"),e(2,`
2040          `),s(3,"td"),e(4,`
2041            `),s(5,"a",14),e(6),o(),e(7,`
2042          `),o(),e(8,`
2043          `),s(9,"td"),e(10),N(11,"date"),o(),e(12,`
2044          `),s(13,"td"),e(14,`
2045            `),p(15,qc,3,2),o(),e(16,`
2046          `),s(17,"td"),e(18,`
2047            `),s(19,"button",15),v("click",function(){let n=g(i).$implicit,r=m(2);return f(r.testConnection(n.teamExternalConnectionID))}),e(20,`
2048              `),p(21,Wc,3,0),o(),e(22,`
2049          `),o(),e(23,`
2050          `),s(24,"td"),e(25,`
2051            `),s(26,"button",16),v("click",function(){let n=g(i).$implicit,r=m(2);return f(r.runSync(n.teamExternalConnectionID))}),e(27,`
2052              `),p(28,Hc,3,0),o(),e(29,`
2053          `),o(),e(30,`
2054          `),s(31,"td"),e(32,`
2055            `),s(33,"button",17),v("click",function(){let n=g(i).$implicit,r=m(2);return f(r.openEditModal(n))}),e(34,`
2056              `),p(35,Gc,3,0),o(),e(36,`
2057          `),o(),e(37,`
2058          `),s(38,"td"),e(39,`
2059            `),s(40,"button",18),v("click",function(){let n=g(i).$implicit,r=m(2);return f(r.delete(n.teamExternalConnectionID))}),e(41,`
2060              `),p(42,Yc,3,0),o(),e(43,`
2061          `),o(),e(44,`
2062        `),o(),e(45,`
2063      `)}if(a&2){let i=d.$implicit,t=m(2);l(5),_("href",i.externalLink,Ue),l(),w(`
2064              `,i.externalLink,`
2065            `),l(4),w(`
2066            `,xe(11,12,i.lastSynced),`
2067          `),l(5),u(i.lastSynced||i.isArchived?15:-1),l(4),_("disabled",t.disabled),l(2),u(t.disabled?21:-1),l(5),_("disabled",t.disabled||i.isArchived),l(2),u(t.disabled?28:-1),l(5),_("disabled",t.disabled),l(2),u(t.disabled?35:-1),l(5),_("disabled",t.disabled),l(2),u(t.disabled?42:-1)}}
2067function Jc(a,d){a&1&&(e(0,`
2068        `),s(1,"tr"),e(2,`
2069          `),s(3,"td",20),e(4,`
2070            No Existing Connections
2071          `),o(),e(5,`
2072        `),o(),e(6,`
2073      `)),a&2&&(l(3),ye("colspan",7))}function Kc(a,d){if(a&1&&(e(0,`
2074  `),s(1,"div",9),e(2,`
2075    `),s(3,"p-table",10),e(4,`
2076      `),A(5,zc,25,0,"ng-template",11),e(6,`
2077      `),A(7,Qc,46,14,"ng-template",12),e(8,`
2078      `),A(9,Jc,7,1,"ng-template",13),e(10,`
2079    `),o(),e(11,`
2080  `),o(),e(12,`
2081`)),a&2){let i=m();l(3),_("value",i.entities)("lazy",!1)("paginator",!1)("totalRecords",i.entities.length)("rows",100)("loading",i.loading)}}function Zc(a,d){if(a&1){let i=y();e(0,`
2082    `),s(1,"app-dynamic-form",21,0),v("onDelete",function(){g(i);let n=m();return f(n.delete(n.entity.teamExternalConnectionID))})("onSubmit",function(n){g(i);let r=m();return f(r.save(n))}),e(3,`
2083      `),x(4,"app-dynamic-form-field",22),e(5,`
2084      `),x(6,"app-dynamic-form-field",23),e(7,`
2085      `),e(8,`
2086  `),o(),e(9,`
2087`)}if(a&2){let i=m();l(),_("fields",i.fields)("entity",i.entity)("contentFieldsMode",!0)("showCancelButton",!1)("showSubmitButton",!0)("showDeleteButton",!!(i.entity&&i.entity.teamExternalConnectionID))("buttonsPosition","left")}}function Xc(a,d){a&1&&(e(0,`
2088                `),x(1,"app-button-loader"),e(2,`
2089              `))}function ep(a,d){if(a&1){let i=y();e(0,`
2090        `),s(1,"div",29),e(2,`
2091          `),s(3,"div",26),e(4,`
2092            `),s(5,"p"),e(6,"Syncing events will apply the changes you see below to your calendar instantly"),o(),e(7,`
2093          `),o(),e(8,`
2094          `),s(9,"div",26),e(10,`
2095            `),s(11,"button",30),v("click",function(){g(i);let n=m(2);return f(n.runSync(n.externalConnectData.teamExternalConnectionID))}),e(12,`
2096              `),p(13,Xc,3,0),e(14,`
2097              Sync Events
2098            `),o(),e(15,`
2099          `),o(),e(16,`
2100        `),o(),e(17,`
2101      `)}if(a&2){let i=m(2);l(11),_("disabled",i.disabled),l(2),u(i.disabled?13:-1)}}function tp(a,d){if(a&1&&(e(0,`
2102          `),s(1,"div",26),e(2,`
2103            `),s(3,"div",27),e(4),o(),e(5,`
2104            `),s(6,"div",28),e(7,"Events"),x(8,"br"),e(9," Created"),o(),e(10,`
2105          `),o(),e(11,`
2106          `),s(12,"div",26),e(13,`
2107            `),s(14,"div",27),e(15),o(),e(16,`
2108            `),s(17,"div",28),e(18,"Events"),x(19,"br"),e(20," Modified"),o(),e(21,`
2109          `),o(),e(22,`
2110          `),s(23,"div",26),e(24,`
2111            `),s(25,"div",27),e(26),o(),e(27,`
2112            `),s(28,"div",28),e(29,"Facilities"),x(30,"br"),e(31," Added"),o(),e(32,`
2113          `),o(),e(33,`
2114        `)),a&2){let i=m(2);l(4),T(i.externalConnectData.eventsCreated),l(11),T(i.externalConnectData.eventsModified),l(11),T(i.externalConnectData.facilitiesAdded)}}function ip(a,d){if(a&1&&(e(0,`
2115        `),s(1,"div",1),e(2,`
2116          `),s(3,"div",26),e(4,`
2117            `),s(5,"div",28),e(6,"Error(s)"),o(),e(7,`
2118            `),s(8,"div",27),e(9),o(),e(10,`
2119          `),o(),e(11,`
2120        `),o(),e(12,`
2121      `)),a&2){let i=m(2);l(9),T(i.externalConnectData.errorMessage)}}function np(a,d){if(a&1&&(e(0,`
2122    `),s(1,"div",24),e(2,`
2123      `),p(3,ep,18,2),s(4,"div",25),e(5,`
2124        `),s(6,"div",26),e(7,`
2125          `),s(8,"div",27),e(9),o(),e(10,`
2126          `),s(11,"div",28),e(12,"Events"),x(13,"br"),e(14," Retrieved"),o(),e(15,`
2127        `),o(),e(16,`
2128        `),s(17,"div",26),e(18,`
2129          `),s(19,"div",27),e(20),o(),e(21,`
2130          `),s(22,"div",28),e(23,"Failed"),x(24,"br"),e(25," Events"),o(),e(26,`
2131        `),o(),e(27,`
2132        `),p(28,tp,34,3),o(),e(29,`
2133      `),p(30,ip,13,1),o(),e(31,`
2134  `)),a&2){let i=m();l(3),u(i.testing?3:-1),l(6),T(i.externalConnectData.eventsRetrieved),l(11),T(i.externalConnectData.failedEventMaps),l(8),u(i.testing?-1:28),l(2),u(i.externalConnectData.errorMessage?30:-1)}}function ap(a,d){a&1&&(e(0,`
2135          `),s(1,"tr"),e(2,`
2136            `),s(3,"th"),e(4,`
2137              Match Number
2138            `),o(),e(5,`
2139            `),s(6,"th"),e(7,`
2140              Time
2141            `),o(),e(8,`
2142            `),s(9,"th"),e(10,`
2143              Home Team
2144            `),o(),e(11,`
2145            `),s(12,"th"),e(13,`
2146              Results
2147            `),o(),e(14,`
2148            `),s(15,"th"),e(16,`
2149              Away team
2150            `),o(),e(17,`
2151            `),s(18,"th"),e(19,`
2152              Location
2153            `),o(),e(20,`
2154          `),o(),e(21,`
2155        `))}function op(a,d){if(a&1&&(e(0,`
2156                  `),x(1,"app-pill",32),e(2,`
2157                `)),a&2){let i=m().$implicit;l(),_("text",i.scheduledStatus)}}function rp(a,d){if(a&1&&(e(0,`
2158          `),s(1,"tr"),e(2,`
2159            `),s(3,"td"),e(4),o(),e(5,`
2160            `),s(6,"td"),e(7),s(8,"span"),e(9,`
2161                `),p(10,op,3,1),o(),e(11,`
2162            `),o(),e(12,`
2163            `),s(13,"td"),e(14),o(),e(15,`
2164            `),s(16,"td"),e(17),o(),e(18,`
2165            `),s(19,"td"),e(20),o(),e(21,`
2166            `),s(22,"td"),e(23),o(),e(24,`
2167          `),o(),e(25,`
2168        `)),a&2){let i=d.$implicit;l(4),w(`
2169              `,i.matchNumber,`
2170            `),l(3),z(`
2171              `,i.eventDate," ",i.time,`
2172              `),l(3),u(i.scheduledStatus?10:-1),l(4),w(`
2173              `,i.homeTeamName,`
2174            `),l(3),w(`
2175              `,i.results,`
2176            `),l(3),w(`
2177              `,i.awayTeamName,`
2178            `),l(3),w(`
2179              `,i.locationName,`
2180            `)}}function sp(a,d){a&1&&(e(0,`
2181          `),s(1,"tr"),e(2,`
2182            `),s(3,"td",20),e(4,`
2183              `),s(5,"app-inline-alert",33),e(6,"No data found"),o(),e(7,`
2184            `),o(),e(8,`
2185          `),o(),e(9,`
2186        `)),a&2&&(l(3),ye("colspan",6),l(2),_("isInline",!0))}function lp(a,d){if(a&1&&(e(0,`
2187    `),s(1,"div",9),e(2,`
2188      `),s(3,"p-table",31),e(4,`
2189        `),A(5,ap,22,0,"ng-template",11),e(6,`
2190        `),A(7,rp,26,8,"ng-template",12),e(8,`
2191        `),A(9,sp,10,2,"ng-template",13),e(10,`
2192      `),o(),e(11,`
2193    `),o(),e(12,`
2194  `)),a&2){let i=m();l(3),_("value",i.externalConnectData==null?null:i.externalConnectData.externalConnectionCells)("lazy",!1)("paginator",!1)("totalRecords",i.externalConnectData==null?null:i.externalConnectData.externalConnectionCells.length)("rows",100)}}var So=(()=>{let d=class d{constructor(t,n,r,c){this.route=t,this.formService=n,this.teamService=r,this.siteDataService=c,this.loading=!0,this.disabled=!1,this.showData=!1,this.testing=!1,this.showEntityModal=!1}
2194ngOnInit(){console.log("r snap: ",this.route.snapshot.parent.params),j({connection:this.teamService.getTeamExternalConnections(this.teamService.teamID,this.teamService.programID),meta:this.teamService.getTeamExternalConnectionMetadata()}).subscribe({next:t=>{this.entities=t.connection,this.fields=t.meta.fields,this.loading=!1,this.siteDataService.hideSiteLoader()}})}createDefault(){this.entity=new za,this.entity.externalLink="https://system.gotsport.com/org_event/events/{replaceWithEventID}/schedules?team={replaceWithTeamID}"}openEditModal(t){t?this.entity=t:this.createDefault(),this.showEntityModal=!0}refreshChart(){this.loading=!0,this.teamService.getTeamExternalConnections(this.teamService.teamID,this.teamService.programID).subscribe({next:t=>{this.entities=t,this.loading=!1}})}save(t){this.disabled=!0,t.programID=this.teamService.programID,t.teamID=this.teamService.teamID,t.teamExternalConnectionID=this.entity.teamExternalConnectionID,this.teamService.saveTeamExternalConnection(t).subscribe({next:n=>{n?this.entities.push(n):this.entities=this.entities.map(r=>r.teamExternalConnectionID===this.entity.teamExternalConnectionID?t:r),this.showEntityModal=!1,this.disabled=!1,this.siteDataService.showSiteSuccessAlert("Connection Created"),this.formService.hideFormLoader()}})}runSync(t){this.disabled=!0,this.teamService.syncSchedule(t).subscribe({next:n=>{this.externalConnectData=n,this.refreshChart(),this.disabled=!1,this.showData=!0,this.testing=!1,this.siteDataService.showSiteSuccessAlert("Schedule Updated From External Connection")},error:()=>{this.disabled=!1,this.siteDataService.showSiteErrorAlert("Failed to update from external connection")}})}testConnection(t){this.disabled=!0,this.teamService.testConnection(t).subscribe({next:n=>{this.externalConnectData=n,this.testing=!0,this.disabled=!1,this.showData=!0}})}delete(t){this.disabled=!0,this.teamService.deleteTeamExternalConnection(t).subscribe({next:()=>{this.entities=this.entities.filter(n=>n.teamExternalConnectionID!==t),this.siteDataService.showSiteSuccessAlert("Connection Removed"),this.disabled=!1,this.formService.hideFormLoader()}})}};d.\u0275fac=function(n){return new(n||d)(C(I),C(Se),C(ee),C(E))},d.\u0275cmp=D({type:d,selectors:[["app-resources"]],standalone:!1,decls:36,vars:13,consts:[["form",""],[1,"row"],[1,"col-10"],[1,"col-2","right"],["href","javascript:void(0);",1,"btn","btn-add","btn-primary",3,"click"],[1,"col-xl-9"],["alertType","info",3,"isInline"],[1,"d-inline-block"],["styleClass","standardWidthDialog",3,"visibleChange","onHide","modal","closable","visible","header"],[1,"card","table-card"],[1,"table","table-striped","table-sm",3,"value","lazy","paginator","totalRecords","rows","loading"],["pTemplate","header"],["pTemplate","body"],["pTemplate","emptymessage"],["target","_blank","rel","noopener noreferrer",3,"href"],["type","button",1,"btn","btn-naked","btn-icon-plug",3,"click","disabled"],["type","button",1,"btn","btn-naked","btn-icon-sync",3,"click","disabled"],["type","button",1,"btn","btn-naked","btn-icon-edit",3,"click","disabled"],["type","button",1,"btn","btn-naked","btn-icon-trash",3,"click","disabled"],[3,"status","text"],[2,"text-align","left"],["formID","external-connection-form","deleteButtonText","Remove Connection",3,"onDelete","onSubmit","fields","entity","contentFieldsMode","showCancelButton","showSubmitButton","showDeleteButton","buttonsPosition"],["fieldName","externalLink"],["fieldName","isArchived"],[1,"team-details-window","full-height","py-3","mb-3"],[1,"row","full-width","mb-4"],[1,"col","center"],[1,"text-largest","line-height-1"],[1,"text-small","text-uppercase"],[1,"card"],["type","button","href","javascript:void(0);",1,"btn","btn-lg","btn-icon-sync",3,"click","disabled"],[1,"table","table-striped","table-sm",3,"value","lazy","paginator","totalRecords","rows"],["status","warning",3,"text"],[3,"isInline"]],template:function(n,r){n&1&&(s(0,"div",1),e(1,`
2195  `),s(2,"div",2),e(3,`
2196    `),s(4,"h4"),e(5,"Manage External Connections"),o(),e(6,`
2197  `),o(),e(7,`
2198  `),s(8,"div",3),e(9,`
2199    `),s(10,"a",4),v("click",function(){return r.openEditModal()}),e(11,"Connection"),o(),e(12,`
2200  `),o(),e(13,`
2201`),o(),e(14,`
2202`),s(15,"div",1),e(16,`
2203  `),s(17,"div",5),e(18,`
2204    `),s(19,"app-inline-alert",6),e(20,`
2205      `),s(21,"span",7),e(22,`
2206        Retrieve events from external schedules and sync to your team's calendar. Once the events are added,
2207        the
2208        connection will refresh once a day to get new and updated events. The sync events button allows
2209        events
2210        to be retrieved instantly.
2211      `),o(),e(23,`
2212    `),o(),e(24,`
2213  `),o(),e(25,`
2214`),o(),e(26,`
2215
2216
2217`),p(27,Kc,13,6),s(28,"p-dialog",8),R("visibleChange",function(h){return P(r.showEntityModal,h)||(r.showEntityModal=h),h}),v("onHide",function(){return r.entity=void 0,r.showEntityModal=!1}),e(29,`
2218  `),p(30,Zc,10,7),o(),e(31,`
2219
2220`),s(32,"p-dialog",8),R("visibleChange",function(h){return P(r.showData,h)||(r.showData=h),h}),v("onHide",function(){return r.showData=!1}),e(33,`
2221  `),p(34,np,32,5),p(35,lp,13,5),o()),n&2&&(l(19),_("isInline",!0),l(8),u(r.entities!=null&&r.entities.length?27:-1),l(),_("modal",!0)("closable",!0),M("visible",r.showEntityModal),_("header",r.entity!=null&&r.entity.teamExternalConnectionID?"Edit Connection":"Create Connection"),l(2),u(r.fields&&r.entity?30:-1),l(2),_("modal",!0)("closable",!0),M("visible",r.showData),_("header",r.testing?"Data Found At External Connection":"Sync Results"),l(2),u(r.externalConnectData?34:-1),l(),u(!(r.externalConnectData==null||r.externalConnectData.externalConnectionCells==null)&&r.externalConnectData.externalConnectionCells.length?35:-1))},dependencies:[he,_e,ke,be,ce,Dt,Fe,oe,xt],encapsulation:2});let a=d;return a})();var ct=(function(a){return a[a.Event=0]="Event",a[a.Team=1]="Team",a[a.Coach=2]="Coach",a[a.Contact=3]="Contact",a[a.Player=4]="Player",a})(ct||{}),Me=(function(a){return a[a.Filled=0]="Filled",a[a.NeedsReview=1]="NeedsReview",a[a.Missing=2]="Missing",a})(Me||{});function dp(a,d){if(a&1&&(e(0,`
2222        `),x(1,"app-pill",8),e(2,`
2223      `)),a&2){let i=m();l(),_("text","Installed"+(i.version?" \xB7 v"+i.version:""))}}function mp(a,d){a&1&&(e(0,`
2224    `),s(1,"div",9),e(2,`
2225      `),s(3,"div",10),e(4,`
2226        `),s(5,"div",11),e(6,"What it does"),o(),e(7,`
2227        `),s(8,"ul",12),e(9,`
2228          `),s(10,"li")(11,"strong"),e(12,"One-click autofill"),o(),e(13," of team, coach, contact, and per-player roster fields."),o(),e(14,`
2229          `),s(15,"li")(16,"strong"),e(17,"Auto-detects the form"),o(),e(18," you're on and maps your data to its fields \u2014 even oddly worded ones."),o(),e(19,`
2230          `),s(20,"li")(21,"strong"),e(22,"Formats to the site"),o(),e(23," \u2014 dates, division/age group, and phone numbers the way it expects."),o(),e(24,`
2231          `),s(25,"li")(26,"strong"),e(27,"Review before you submit"),o(),e(28," \u2014 every value is editable and flagged Ready / Review."),o(),e(29,`
2232          `),s(30,"li")(31,"strong"),e(32,"Flags gaps"),o(),e(33," \u2014 what to add (e.g. a missing US Soccer ID) before you register."),o(),e(34,`
2233          `),s(35,"li")(36,"strong"),e(37,"Works on the sites you use"),o(),e(38," \u2014 GotSport, TourneyCentral, HTGSports, SincSports, Athletes2Events, Matchpro.AI, and more."),o(),e(39,`
2234        `),o(),e(40,`
2235      `),o(),e(41,`
2236      `),s(42,"div",10),e(43,`
2237        `),s(44,"div",11),e(45,"You stay in control"),o(),e(46,`
2238        `),s(47,"ul",12),e(48,`
2239          `),s(49,"li"),e(50,"You log in, pass any CAPTCHA, agree to the site's terms, and pay \u2014 "),s(51,"strong"),e(52,"the extension never does those"),o(),e(53,"."),o(),e(54,`
2240          `),s(55,"li"),e(56,"It "),s(57,"strong"),e(58,"never"),o(),e(59," stores a tournament site's password and "),s(60,"strong"),e(61,"never"),o(),e(62," submits for you."),o(),e(63,`
2241          `),s(64,"li"),e(65,"It only uses your own SprocketSports data, for teams you already manage."),o(),e(66,`
2242        `),o(),e(67,`
2243      `),o(),e(68,`
2244    `),o(),e(69,`
2245  `))}function cp(a,d){a&1&&(e(0,`
2246        `),s(1,"span",13),e(2,"Checking for the extension\u2026"),o(),e(3,`
2247      `))}function pp(a,d){a&1&&(e(0,`
2248        `),s(1,"span",14),e(2,`
2249          `),s(3,"strong"),e(4,"Ready to use:"),o(),e(5,` open the tournament site's registration form in another tab, click the
2250          extension icon, and pick this team (it's already selected from this page).
2251        `),o(),e(6,`
2252      `))}function up(a,d){if(a&1&&(e(0,`
2253          `),s(1,"a",15),e(2,`
2254            Add to Chrome
2255          `),o(),e(3,`
2256        `)),a&2){let i=m(2);l(),_("href",i.chromeStoreUrl,Ue)}}function _p(a,d){if(a&1&&(e(0,`
2257          `),s(1,"a",16),e(2,`
2258            Edge
2259          `),o(),e(3,`
2260        `)),a&2){let i=m(2);l(),_("href",i.edgeStoreUrl,Ue)}}function hp(a,d){a&1&&(e(0,`
2261          `),s(1,"span",17),e(2,"Free \xB7 installs in seconds \xB7 works with your existing login."),o(),e(3,`
2262        `))}function gp(a,d){a&1&&(e(0,`
2263          `),s(1,"span",13),e(2,"Coming soon to the Chrome and Edge web stores."),o(),e(3,`
2264        `))}function fp(a,d){if(a&1&&(e(0,`
2265        `),e(1,`
2266        `),p(2,up,4,1),p(3,_p,4,1),p(4,hp,4,0)(5,gp,4,0)),a&2){let i=m();l(2),u(i.chromeStoreUrl?2:-1),l(),u(i.edgeStoreUrl?3:-1),l(),u(i.chromeStoreUrl||i.edgeStoreUrl?4:5)}}var yo=(()=>{let d=class d{constructor(t){this.zone=t,this.state="checking",this.version="",this.showDetail
2266s=!1,this.chromeStoreUrl="",this.edgeStoreUrl="",this.messageListener=n=>{if(n.source!==window)return;let r=n.data;r?.source==="ss-tournament-extension"&&r.type==="PONG"&&this.zone.run(()=>{this.state="connected",this.version=r.version||""})}}ngOnInit(){window.addEventListener("message",this.messageListener),window.postMessage({source:"ss-tournament-extension-page",type:"PING"},window.location.origin),this.timeoutHandle=setTimeout(()=>{this.state==="checking"&&this.zone.run(()=>this.state="notInstalled")},1200)}ngOnDestroy(){window.removeEventListener("message",this.messageListener),clearTimeout(this.timeoutHandle)}};d.\u0275fac=function(n){return new(n||d)(C(Cn))},d.\u0275cmp=D({type:d,selectors:[["app-extension-promo"]],standalone:!1,decls:30,vars:4,consts:[[1,"card","dashboard-card","pb-0","mb-3"],[1,"card-header"],[1,"fa-regular","fa-bolt","mr-2"],[1,"d-flex","align-items-center"],["status","color1","text","Beta"],["type","button",1,"btn","btn-naked","btn-sm","ml-2",3,"click"],[1,"text-small","mt-1"],[1,"card-footer","py-2"],["status","success",1,"ml-1",3,"text"],[1,"row","mt-2"],[1,"col-md-6"],[1,"fw-600","text-small"],[1,"text-small","mb-2"],[1,"text-small","text-muted"],[1,"text-small"],["target","_blank","rel","noopener noreferrer",1,"btn","btn-primary","btn-sm",3,"href"],["target","_blank","rel","noopener noreferrer",1,"btn","btn-sm","ml-2",3,"href"],[1,"text-small","text-muted","ml-2"]],template:function(n,r){if(n&1&&(s(0,"section",0),e(1,`
2267  `),s(2,"div",1),e(3,`
2268    `),s(4,"h3"),x(5,"i",2),e(6,"Autofill tournament forms"),o(),e(7,`
2269    `),s(8,"div",3),e(9,`
2270      `),x(10,"app-pill",4),e(11,`
2271      `),p(12,dp,3,1),s(13,"button",5),v("click",function(){return r.showDetails=!r.showDetails}),e(14),o(),e(15,`
2272    `),o(),e(16,`
2273  `),o(),e(17,`
2274
2275  `),s(18,"div",6),e(19,`
2276    Skip the copy-paste: open the tournament site's registration form in your browser, click our extension, and fill
2277    it from this team's roster in one click. You review every value and submit the form yourself.
2278  `),o(),e(20,`
2279
2280  `),p(21,mp,70,0),s(22,"div",7),e(23,`
2281    `),p(24,cp,4,0)(25,pp,7,0)(26,fp,6,3),e(27,`
2282  `),o(),e(28,`
2283`),o(),e(29,`
2284`)),n&2){let c;l(12),u(r.state==="connected"?12:-1),l(2),w(`
2285        `,r.showDetails?"Hide details":"What can it do?",`
2286      `),l(7),u(r.showDetails?21:-1),l(3),u((c=r.state)==="checking"?24:c==="connected"?25:c==="notInstalled"?26:-1)}},dependencies:[be],encapsulation:2});let a=d;return a})();var Cp=(a,d)=>d.title,wo=(a,d)=>d.key;function vp(a,d){if(a&1){let i=y();e(0,`
2287    `),s(1,"div",10),e(2,`
2288      `),s(3,"button",11),v("click",function(){g(i);let n=m();return f(n.startOver())}),e(4,"Start Over"),o(),e(5,`
2289    `),o(),e(6,`
2290  `)}}function bp(a,d){a&1&&(e(0,`
2291    `),x(1,"app-loader"),e(2,`
2292  `))}function Sp(a,d){if(a&1&&(e(0,`
2293        `),s(1,"div",31),e(2),o(),e(3,`
2294      `)),a&2){let i=m(4);l(2),T(i.selectedPlatform.description)}}function yp(a,d){a&1&&(e(0,`
2295            `),x(1,"app-button-loader"),e(2,`
2296          `))}function wp(a,d){if(a&1){let i=y();e(0,`
2297    `),s(1,"div",14),e(2,`
2298      `),s(3,"div",4),e(4,`
2299        `),s(5,"div",15),e(6,`
2300          `),s(7,"div",16),e(8,`
2301            `),s(9,"label"),e(10,"Target platform "),s(11,"span",17),e(12,"*"),o()(),e(13,`
2302            `),s(14,"p-select",18),R("ngModelChange",function(n){g(i);let r=m(3);return P(r.selectedPlatformId,n)||(r.selectedPlatformId=n),f(n)}),o(),e(15,`
2303          `),o(),e(16,`
2304        `),o(),e(17,`
2305        `),s(18,"div",15),e(19,`
2306          `),s(20,"div",16),e(21,`
2307            `),s(22,"label",19),e(23,"Tournament name"),o(),e(24,`
2308            `),s(25,"input",20),R("ngModelChange",function(n){g(i);let r=m(3);return P(r.tournamentName,n)||(r.tournamentName=n),f(n)}),o(),e(26,`
2309          `),o(),e(27,`
2310        `),o(),e(28,`
2311        `),s(29,"div",21),e(30,`
2312          `),s(31,"div",16),e(32,`
2313            `),s(33,"label",22),e(34,"Division / age group"),o(),e(35,`
2314            `),s(36,"input",23),R("ngModelChange",function(n){g(i);let r=m(3);return P(r.division,n)||(r.division=n),f(n)}),o(),e(37,`
2315          `),o(),e(38,`
2316        `),o(),e(39,`
2317        `),s(40,"div",21),e(41,`
2318          `),s(42,"div",16),e(43,`
2319            `),s(44,"label"),e(45,"Tournament date"),o(),e(46,`
2320            `),s(47,"p-datepicker",24),R("ngModelChange",function(n){g(i);let r=m(3);return P(r.tournamentDate,n)||(r.tournamentDate=n),f(n)}),o(),e(48,`
2321          `),o(),e(49,`
2322        `),o(),e(50,`
2323        `),s(51,"div",21),e(52,`
2324          `),s(53,"div",16),e(54,`
2325            `),s(55,"label",25),e(56,"Tournament link"),o(),e(57,`
2326            `),s(58,"input",26),R("ngModelChange",function(n){g(i);let r=m(3);return P(r.tournamentUrl,n)||(r.tournamentUrl=n),f(n)}),o(),e(59,`
2327          `),o(),e(60,`
2328        `),o(),e(61,`
2329        `),s(62,"div",15),e(63,`
2330          `),s(64,"div",16),e(65,`
2331            `),s(66,"label"),e(67,`
2332              Include directors on the staff list
2333              `),x(68,"app-tooltip",27),e(69,`
2334            `),o(),e(70,`
2335            `),s(71,"p-checkbox",28),R("ngModelChange",function(n){g(i);let r=m(3);return P(r.includeDirectors,n)||(r.includeDirectors=n),f(n)}),o(),e(72,`
2336          `),o(),e(73,`
2337        `),o(),e(74,`
2338      `),o(),e(75,`
2339      `),p(76,Sp,4,1),s(77,"div",29),e(78,`
2340        `),s(79,"button",30),v("click",function(){g(i);let n=m(3);return f(n.generate())}),e(80,`
2341          `),p(81,yp,3,0),e(82,`
2342          Generate Packet
2343        `),o(),e(83,`
2344      `),o(),e(84,`
2345    `),o(),e(85,`
2346    `)}if(a&2){let i=m(3);l(14),_("options",i.platforms),M("ngModel",i.selectedPlatformId),l(11),M("ngModel",i.tournamentName),l(11),M("ngModel",i.division),l(11),M("ngModel",i.tournamentDate),_("showButtonBar",!0),l(11),M("ngModel",i.tournamentUrl),l(13),_("binary",!0),M("ngModel",i.includeDirectors),l(5),u(i.selectedPlatform?76:-1),l(3),_("disabled",i.generating),l(2),u(i.generating?81:-1)}}function Tp(a,d){if(a&1&&(e(0,`
2347                `),s(1,"div",41),e(2),o(),e(3,`
2348              `)),a&2){let i=m(5);l(2),T(i.formFileName)}}function Dp(a,d){a&1&&(e(0,`
2349              `),x(1,"app-button-loader"),e(2,`
2350            `))}function Ep(a,d){if(a&1){let i=y();e(0,`
2351      `),s(1,"div",32),e(2,`
2352        `),s(3,"div",4),e(4,`
2353          `),s(5,"div",33),e(6,`
2354            `),s(7,"div",16),e(8,`
2355              `),s(9,"label",34),e(10,"Upload the form (screenshot or PDF)"),o(),e(11,`
2356              `),s(12,"input",35),v("change",function(n){g(i);let r=m(4);
2356return f(r.onFormFileSelected(n))}),o(),e(13,`
2357              `),p(14,Tp,4,1),o(),e(15,`
2358          `),o(),e(16,`
2359          `),s(17,"div",33),e(18,`
2360            `),s(19,"div",16),e(20,`
2361              `),s(21,"label"),e(22,"Which site is it? (optional)"),o(),e(23,`
2362              `),s(24,"p-select",36),R("ngModelChange",function(n){g(i);let r=m(4);return P(r.selectedPlatformId,n)||(r.selectedPlatformId=n),f(n)}),o(),e(25,`
2363            `),o(),e(26,`
2364          `),o(),e(27,`
2365        `),o(),e(28,`
2366        `),s(29,"div",4),e(30,`
2367          `),s(31,"div",37),e(32,`
2368            `),s(33,"div",16),e(34,`
2369              `),s(35,"label",38),e(36,"\u2026or paste the form's text"),o(),e(37,`
2370              `),s(38,"textarea",39),R("ngModelChange",function(n){g(i);let r=m(4);return P(r.formPastedText,n)||(r.formPastedText=n),f(n)}),o(),e(39,`
2371            `),o(),e(40,`
2372          `),o(),e(41,`
2373        `),o(),e(42,`
2374        `),s(43,"div",40),e(44,`
2375          `),s(45,"button",30),v("click",function(){g(i);let n=m(4);return f(n.extractForm())}),e(46,`
2376            `),p(47,Dp,3,0),e(48,`
2377            Read the form
2378          `),o(),e(49,`
2379        `),o(),e(50,`
2380      `),o(),e(51,`
2381    `)}if(a&2){let i=m(4);l(14),u(i.formFileName?14:-1),l(10),_("options",i.platforms),M("ngModel",i.selectedPlatformId),_("showClear",!0),l(14),M("ngModel",i.formPastedText),l(7),_("disabled",i.extracting),l(2),u(i.extracting?47:-1)}}function Ip(a,d){if(a&1&&(e(0,`
2382            `),x(1,"app-pill",52),e(2,`
2383          `)),a&2){let i=m(5);l(),_("text","Looks like "+i.detectedPlatformName)}}function Mp(a,d){a&1&&(e(0,`
2384            `),s(1,"span",43),e(2,"Detected Fields"),o(),e(3,`
2385          `))}function Pp(a,d){a&1&&(e(0,`
2386            `),s(1,"tr"),e(2,`
2387              `),s(3,"th"),e(4,"Form asks for"),o(),e(5,`
2388              `),s(6,"th"),e(7,"We'll fill it from"),o(),e(8,`
2389              `),s(9,"th"),e(10,"Section"),o(),e(11,`
2390            `),o(),e(12,`
2391          `))}function Rp(a,d){a&1&&(e(0," "),s(1,"span",17),e(2,"*"),o(),e(3," "))}function kp(a,d){if(a&1&&(e(0," "),s(1,"div",54),e(2),o(),e(3," ")),a&2){let i=m().$implicit;l(2),T(i.formatHint)}}function Fp(a,d){a&1&&(e(0,`
2392                  `),s(1,"div",55),e(2,"Confirm this match"),o(),e(3,`
2393                `))}function Vp(a,d){a&1&&(e(0,`
2394                  `),x(1,"app-pill",56),e(2,`
2395                `))}function Ap(a,d){a&1&&(e(0,`
2396                  `),s(1,"span",54),e(2,"Team"),o(),e(3,`
2397                `))}function Np(a,d){if(a&1){let i=y();e(0,`
2398            `),s(1,"tr"),e(2,`
2399              `),s(3,"td"),e(4),p(5,Rp,4,0),p(6,kp,4,1),o(),e(7,`
2400              `),s(8,"td"),e(9,`
2401                `),s(10,"p-select",53),R("ngModelChange",function(n){let r=g(i).$implicit;return P(r.resolvedKey,n)||(r.resolvedKey=n),f(n)}),o(),e(11,`
2402                `),p(12,Fp,4,0),o(),e(13,`
2403              `),s(14,"td"),e(15,`
2404                `),p(16,Vp,3,0)(17,Ap,4,0),o(),e(18,`
2405            `),o(),e(19,`
2406          `)}if(a&2){let i=d.$implicit,t=m(5);l(4),w(`
2407                `,i.rawLabel,`
2408                `),l(),u(i.required?5:-1),l(),u(i.formatHint?6:-1),l(4),_("options",t.canonicalFieldOptions),M("ngModel",i.resolvedKey),_("showClear",!0)("filter",!0),l(2),u(i.resolvedKey&&i.matchConfidence<.85?12:-1),l(4),u(i.scope===t.Category.Player?16:17)}}function Lp(a,d){a&1&&(e(0,`
2409            `),s(1,"tr"),e(2,`
2410              `),s(3,"td"),e(4,`
2411                No fields were detected on the form.
2412              `),o(),e(5,`
2413            `),o(),e(6,`
2414          `)),a&2&&(l(3),ye("colspan",3))}function $p(a,d){a&1&&(e(0,`
2415            `),x(1,"app-button-loader"),e(2,`
2416          `))}function Up(a,d){if(a&1){let i=y();e(0,`
2417      `),s(1,"div",42),e(2,`
2418        `),s(3,"div"),e(4,`
2419          `),s(5,"span",43),e(6),o(),e(7,`
2420          `),p(8,Ip,3,1),e(9,`
2421          Check each mapping, add any event details, then generate.
2422        `),o(),e(10,`
2423        `),s(11,"button",44),v("click",function(){g(i);let n=m(4);return f(n.resetFormExtraction())}),e(12,`
2424          Choose a different form
2425        `),o(),e(13,`
2426      `),o(),e(14,`
2427
2428      `),s(15,"div",32),e(16,`
2429        `),s(17,"div",4),e(18,`
2430          `),s(19,"div",45),e(20,`
2431            `),s(21,"div",16),e(22,`
2432              `),s(23,"label",46),e(24,"Tournament name"),o(),e(25,`
2433              `),s(26,"input",47),R("ngModelChange",function(n){g(i);let r=m(4);return P(r.tournamentName,n)||(r.tournamentName=n),f(n)}),o(),e(27,`
2434            `),o(),e(28,`
2435          `),o(),e(29,`
2436          `),s(30,"div",45),e(31,`
2437            `),s(32,"div",16),e(33,`
2438              `),s(34,"label",48),e(35,"Division / age group"),o(),e(36,`
2439              `),s(37,"input",49),R("ngModelChange",function(n){g(i);let r=m(4);return P(r.division,n)||(r.division=n),f(n)}),o(),e(38,`
2440            `),o(),e(39,`
2441          `),o(),e(40,`
2442          `),s(41,"div",45),e(42,`
2443            `),s(43,"div",16),e(44,`
2444              `),s(45,"label"),e(46,"Tournament date"),o(),e(47,`
2445              `),s(48,"p-datepicker",24),R("ngModelChange",function(n){g(i);let r=m(4);return P(r.tournamentDate,n)||(r.tournamentDate=n),f(n)}),o(),e(49,`
2446            `),o(),e(50,`
2447          `),o(),e(51,`
2448          `),s(52,"div",45),e(53,`
2449            `),s(54,"div",16),e(55,`
2450              `),s(56,"label"),e(57,`
2451                Include directors on the staff list
2452                `),x(58,"app-tooltip",27),e(59,`
2453              `),o(),e(60,`
2454              `),s(61,"p-checkbox",28),R("ngModelChange",function(n){g(i);let r=m(4);return P(r.includeDirectors,n)||(r.includeDirectors=n),f(n)}),o(),e(62,`
2455            `),o(),e(63,`
2456          `),o(),e(64,`
2457        `),o(),e(65,`
2458      `),o(),e(66,`
2459
2460      `),s(67,"div",50),e(68,`
2461        `),s(69,"p-table",51),e(70,`
2462          `),A(71,Mp,4,0,"ng-template",null,0,ne),e(73,`
2463          `),A(74,Pp,13,0,"ng-template",null,1,ne),e(76,`
2464          `),A(77,Np,20,9,"ng-template",null,2,ne),e(79,`
2465          `),A(80,Lp,7,1,"ng-template",null,3,ne),e(82,`
2466        `),o(),e(83,`
2467      `),o(),e(84,`
2468
2469      `),s(85,"div",29),e(86,`
2470        `),s(87,"button",30),v("click",function(){g(i);let n=m(4);return f(n.generateFromForm())}),e(88,`
2471          `),p(89,$p,3,0),e(90,`
2472          Generate Packet from this form
2473        `),o(),e(91,`
2474      `),o(),e(92,`
2475    `)}if(a&2){let i=m(4);l(6),w("",i.schema.fields.length," field(s) detected."),l(2),u(i.detectedPlatformName?8:-1),l(18),M("ngModel",i.tournamentName),l(11),M("ngModel",i.division),l(11),M("ngModel",i.tournamentDate),_("showButtonBar",!0),l(13),_("binary",!0),M("ngModel",i.includeDirectors),l(8),_("value",i.schema.fields)("lazy",!1)("paginator",!1)("totalRecords",i.schema.fields.length)("rows",300),l(18),_("disabled",i.generating),l(2),u(i.generating?89:-1)}}function Op(a,d){if(a&1&&(e(0,`
2476    `),e(1,`
2477    `),s(2,"div",4),e(3,`
2478      `),s(4,"div",7),e(5,`
2479        `),s(6,"app-inline-alert",8),e(7,`
2480          `),s(8,"span",9),e(9,`
2481            Show us the exact form you're filling out \u2014 upload a screenshot or PDF, or paste its text \u2014 and we map
2482            this team's data onto `),s(10,"em"),e(11,"its"),o(),e(12," fields. "),s(13,"strong"),e(14,`We never open the tournament site; you show us the
2483            form, and you still submit it yourself.`),o(),e(15,`
2484          `),o(),e(16,`
2485        `),o(),e(17,`
2486      `),o(),e(18,`
2487    `),o(),e(19,`
2488
2489    `),p(20,Ep,52,7)(21,Up,93,15)),a&2){let i=m(3);
2489l(6),_("isInline",!0),l(14),u(i.schema?21:20)}}function Bp(a,d){if(a&1){let i=y();e(0,`
2490    `),s(1,"div",12),e(2,`
2491      `),e(3,`
2492      `),s(4,"p-selectButton",13),v("onChange",function(n){g(i);let r=m(2);return f(r.setInputMode(n.value))}),o(),e(5,`
2493    `),o(),e(6,`
2494
2495    `),p(7,wp,86,12)(8,Op,22,2)}if(a&2){let i=m(2);l(4),_("options",i.inputModeOptions)("ngModel",i.inputMode)("allowEmpty",!1),l(3),u(i.inputMode==="platform"?7:8)}}function jp(a,d){if(a&1&&(e(0,`
2496  `),p(1,bp,3,0)(2,Bp,9,4)),a&2){let i=m();l(),u(i.loading?1:2)}}function zp(a,d){a&1&&(e(0,`
2497      `),x(1,"app-pill",66),e(2,`
2498    `))}function qp(a,d){if(a&1&&(e(0,`
2499        `),s(1,"app-inline-alert",8),e(2,`
2500          `),s(3,"span",9),e(4),o(),e(5,`
2501        `),o(),e(6,`
2502      `)),a&2){let i=m(2);l(),_("isInline",!0),l(3),T(i.packet.summary)}}function Wp(a,d){if(a&1&&(e(0,`
2503        `),s(1,"app-inline-alert",67),e(2,`
2504          `),s(3,"span",9)(4,"strong"),e(5),o(),e(6),o(),e(7,`
2505        `),o(),e(8,`
2506      `)),a&2){let i=m(2);l(),_("isInline",!0),l(4),w("How you submit on ",i.packet.platformName,":"),l(),w(`
2507            `,i.packet.platformAutomationNote)}}function Hp(a,d){if(a&1&&(e(0,`
2508            `),s(1,"li"),e(2),o(),e(3,`
2509          `)),a&2){let i=d.$implicit;l(2),T(i)}}function Gp(a,d){if(a&1&&(e(0,`
2510        `),s(1,"ul",40),e(2,`
2511          `),F(3,Hp,4,1,null,null,bn),o(),e(5,`
2512      `)),a&2){let i=m(2);l(3),V(i.packet.platformTips)}}function Yp(a,d){if(a&1&&(e(0,`
2513                `),s(1,"li"),e(2),o(),e(3,`
2514              `)),a&2){let i=d.$implicit;l(2),yn("",i.field," \u2014 ",i.subject,". ",i.reason)}}function Qp(a,d){if(a&1&&(e(0,`
2515        `),s(1,"app-inline-alert",67),e(2,`
2516          `),s(3,"div",9),e(4,`
2517            `),s(5,"strong"),e(6),o(),e(7,`
2518            `),s(8,"ul",68),e(9,`
2519              `),F(10,Yp,4,3,null,null,$),o(),e(12,`
2520          `),o(),e(13,`
2521        `),o(),e(14,`
2522      `)),a&2){let i=m(2);l(),_("isInline",!0),l(5),w("Still needs your attention (",i.packet.gaps.length,"):"),l(4),V(i.packet.gaps)}}function Jp(a,d){if(a&1){let i=y();e(0,`
2523      `),s(1,"button",69),v("click",function(){g(i);let n=m(2);return f(n.copyFullRoster())}),e(2),o(),e(3,`
2524    `)}if(a&2){let i=m(2);l(2),w(`
2525        Copy Roster (`,i.packet.playerRows.length,`)
2526      `)}}function Kp(a,d){a&1&&(e(0," "),x(1,"app-button-loader"),e(2," "))}function Zp(a,d){a&1&&(e(0," "),x(1,"app-button-loader"),e(2," "))}function Xp(a,d){if(a&1&&(e(0,`
2527          `),s(1,"span",43),e(2),o(),e(3,`
2528        `)),a&2){let i=m().$implicit;l(2),T(i.title)}}function eu(a,d){a&1&&(e(0,`
2529          `),s(1,"tr"),e(2,`
2530            `),s(3,"th"),e(4,"Field"),o(),e(5,`
2531            `),s(6,"th"),e(7,"Value"),o(),e(8,`
2532            `),s(9,"th"),e(10,"Status"),o(),e(11,`
2533            `),x(12,"th"),e(13,`
2534          `),o(),e(14,`
2535        `))}function tu(a,d){a&1&&(e(0," "),s(1,"span",17),e(2,"*"),o(),e(3," "))}function iu(a,d){if(a&1&&(e(0," "),s(1,"div",54),e(2),o(),e(3," ")),a&2){let i=m().$implicit;l(2),T(i.formatHint)}}function nu(a,d){if(a&1&&(e(0," "),s(1,"div",41),e(2),o(),e(3," ")),a&2){let i=m().$implicit;l(2),T(i.note)}}function au(a,d){if(a&1&&(e(0,`
2536                `),s(1,"div",41),e(2),o(),e(3,`
2537              `)),a&2){let i=m().$implicit;l(2),w("Also accepted as: ",i.alternates==null?null:i.alternates.join(" / "))}}function ou(a,d){if(a&1){let i=y();e(0,`
2538          `),s(1,"tr"),e(2,`
2539            `),s(3,"td"),e(4),p(5,tu,4,0),p(6,iu,4,1),o(),e(7,`
2540            `),s(8,"td"),e(9,`
2541              `),s(10,"input",70),R("ngModelChange",function(n){let r=g(i).$implicit;return P(r.value,n)||(r.value=n),f(n)}),v("ngModelChange",function(){let n=g(i).$implicit,r=m(3);return f(r.onTeamFieldEdit(n))}),o(),e(11,`
2542              `),p(12,nu,4,1),p(13,au,4,1),o(),e(14,`
2543            `),s(15,"td"),e(16,`
2544              `),x(17,"app-pill",71),e(18,`
2545            `),o(),e(19,`
2546            `),s(20,"td"),e(21,`
2547              `),s(22,"button",72),v("click",function(){let n=g(i).$implicit,r=m(3);return f(r.copyValue(n.value))}),e(23,`
2548                `),s(24,"span",73),e(25,"Copy value"),o(),e(26,`
2549              `),o(),e(27,`
2550            `),o(),e(28,`
2551          `),o(),e(29,`
2552        `)}if(a&2){let i=d.$implicit,t=m(3);l(4),w(`
2553              `,i.label,`
2554              `),l(),u(i.required?5:-1),l(),u(i.formatHint?6:-1),l(4),M("ngModel",i.value),_("placeholder",i.required?"Required \u2014 add on the site":""),l(2),u(i.note?12:-1),l(),u(i.alternates!=null&&i.alternates.length?13:-1),l(4),_("status",t.statusPill(i.status))("text",t.statusText(i.status)),l(5),_("disabled",!i.value)}}function ru(a,d){if(a&1&&(e(0,`
2555    `),s(1,"div",50),e(2,`
2556      `),s(3,"p-table",51),e(4,`
2557        `),A(5,Xp,4,1,"ng-template",null,0,ne),e(7,`
2558        `),A(8,eu,15,0,"ng-template",null,1,ne),e(10,`
2559        `),A(11,ou,30,10,"ng-template",null,2,ne),e(13,`
2560      `),o(),e(14,`
2561    `),o(),e(15,`
2562  `)),a&2){let i=d.$implicit;l(3),_("value",i.fields)("lazy",!1)("paginator",!1)("totalRecords",i.fields.length)("rows",100)}}function su(a,d){if(a&1&&(e(0,`
2563          `),s(1,"span",43),e(2),o(),e(3,`
2564        `)),a&2){let i=m(3);l(2),w("Roster (",i.packet.playerRows.length,")")}}function lu(a,d){if(a&1&&(e(0,`
2565              `),s(1,"th"),e(2),o(),e(3,`
2566            `)),a&2){let i=d.$implicit;l(2),T(i.label)}}function du(a,d){if(a&1&&(e(0,`
2567          `),s(1,"tr"),e(2,`
2568            `),F(3,lu,4,1,null,null,wo),x(5,"th"),e(6,`
2569          `),o(),e(7,`
2570        `)),a&2){let i=m(3);l(3),V(i.packet.playerRows[0].fields)}}function mu(a,d){if(a&1&&(e(0,`
2571              `),s(1,"td"),e(2),o(),e(3,`
2572            `)),a&2){let i=d.$implicit;l(),ie("text-danger",i.required&&!i.value),l(),w(`
2573                `,i.value||"\u2014",`
2574              `)}}function cu(a,d){if(a&1){let i=y();e(0,`
2575          `),s(1,"tr"),e(2,`
2576            `),F(3,mu,4,3,null,null,wo),s(5,"td"),e(6,`
2577              `),s(7,"button",75),v("click",function(){let n=g(i).$implicit,r=m(3);return f(r.copyPlayerRow(n.fields))}),e(8,`
2578                `),s(9,"span",73),e(10,"Copy row"),o(),e(11,`
2579              `),o(),e(12,`
2580            `),o(),e(13,`
2581          `),o(),e(14,`
2582        `)}if(a&2){let i=d.$implicit;l(3),V(i.fields)}}function pu(a,d){if(a&1&&(e(0,`
2583    `),s(1,"div",74),e(2,`
2584      `),s(3,"p-table",51),e(4,`
2585        `),A(5,su,4,1,"ng-template",null,0,ne),e(7,`
2586        `),A(8,du,8,0,"ng-template",null,1,ne),e(10,`
2587        `),A(11,cu,15,0,"ng-template",null,2,ne),e(13,`
2588      `),o(),e(14,`
2589    `),o(),e(15,`
2590  `)),a&2){let i=m(2);l(3),_("value",i.packet.playerRows)("lazy",!1)("paginator",!1)("totalRecords",i.packet.playerRows.length)("rows",100)}}function uu(a,d){if(a&1&&(e(0,`
2591          `),s(1,"span",43),e(2),o(),e(3,`
2592        `)),a&2){let i=m(3);l(2),w("Staff (",i.packet.staffRows.length,")")}}function _u(a,d){a&1&&(e(0,`
2593          `),s(1,"tr"),e(2,`
2594            `),s(3,"th"),e(4,"Name"),o(),e(5,`
2595            `),s(6,"th"),e(7,"Role"),o(),e(8,`
2596            `),s(9,"th"),e(10,"Email"),o(),e(11,`
2597            `),s(12,"th"),e(13,"Phone"),o(),e(14,`
2598          `),o(),e(15,`
2599        `))}function hu(a,d){if(a&1&&(e(0,`
2600          `),s(1,"tr"),e(2,`
2601            `),s(3,"td"),e(4),o(),e(5,`
2602            `),s(6,"td"),e(7),o(),e(8,`
2603            `),s(9,"td"),e(10),o(),e(11,`
2604            `),s(12,"td"),e(13),o(),e(14,`
2605          `),o(),e(15,`
2606        `)),a&2){let i=d.$implicit,t=m(3);l(4),T(i.displayName),l(3),T(i.role),l(3),T(t.staffField(i,t.staffEmailKey)||"\u2014"),l(3),T(t.staffField(i,t.staffPhoneKey)||"\u2014")}}function gu(a,d){if(a&1&&(e(0,`
2607    `),s(1,"div",74),e(2,`
2608      `),s(3,"p-table",51),e(4,`
2609        `),A(5,uu,4,1,"ng-template",null,0,ne),e(7,`
2610        `),A(8,_u,16,0,"ng-template",null,1,ne),e(10,`
2611        `),A(11,hu,16,4,"ng-template",null,2,ne),e(13,`
2612      `),o(),e(14,`
2613    `),o(),e(15,`
2614  `)),a&2){let i=m(2);l(3),_("value",i.packet.staffRows)("lazy",!1)("paginator",!1)("totalRecords",i.packet.staffRows.length)("rows",100)}}function fu(a,d){if(a&1){let i=y();e(0,`
2615  `),s(1,"div",57),e(2,`
2616    `),s(3,"span",58),e(4),o(),e(5,`
2617    `),s(6,"span",59),e(7),o(),e(8,`
2618    `),p(9,zp,3,0),x(10,"app-pill",60),e(11,`
2619    `),s(12,"span",61),e(13),o(),e(14,`
2620  `),o(),e(15,`
2621
2622  `),s(16,"div",4),e(17,`
2623    `),s(18,"div",7),e(19,`
2624      `),p(20,qp,7,2),p(21,Wp,9,3),p(22,Gp,6,0),p(23,Qp,15,2),o(),e(24,`
2625  `),o(),e(25,`
2626
2627  `),s(26,"div",62),e(27,`
2628    `),s(28,"button",63),v("click",function(){g(i);let n=m();return f(n.copyAllTeamFields())}),e(29,`
2629      Copy Team Info
2630    `),o(),e(30,`
2631    `),p(31,Jp,4,1),s(32,"button",64),v("click",function(){g(i);let n=m();return f(n.downloadPdf())}),e(33,`
2632      `),p(34,Kp,3,0),e(35,`
2633      Download PDF
2634    `),o(),e(36,`
2635    `),s(37,"button",65),v("click",function(){g(i);let n=m();return f(n.downloadCsv())}),e(38,`
2636      `),p(39,Zp,3,0),e(40,`
2637      Download Spreadsheet (CSV)
2638    `),o(),e(41,`
2639  `),o(),e(42,`
2640
2641  `),e(43,`
2642  `),F(44,ru,16,5,null,null,Cp),p(46,pu,16,5),p(47,gu,16,5)}
2642if(a&2){let i=m();l(4),T(i.packet.teamName),l(3),w(" \u2192 ",i.packet.platformName),l(2),u(i.packet.aiApplied?9:-1),l(),_("status",i.readinessPercent===100?"success":"warning")("text",i.readinessPercent+"% ready"),l(3),z(`
2643      `,i.readyRequiredCount," of ",i.totalRequiredCount,` required values on file
2644    `),l(7),u(i.packet.summary?20:-1),l(),u(i.packet.platformAutomationNote?21:-1),l(),u(i.packet.platformTips!=null&&i.packet.platformTips.length?22:-1),l(),u(i.packet.gaps!=null&&i.packet.gaps.length?23:-1),l(8),u(i.packet.playerRows!=null&&i.packet.playerRows.length?31:-1),l(),ie("btn-icon-file-pdf",!i.downloadingPdf),_("disabled",i.downloadingPdf),l(2),u(i.downloadingPdf?34:-1),l(3),ie("btn-icon-file-csv",!i.downloadingCsv),_("disabled",i.downloadingCsv),l(2),u(i.downloadingCsv?39:-1),l(5),V(i.teamFieldGroups),l(2),u(i.packet.playerRows!=null&&i.packet.playerRows.length?46:-1),l(),u(i.packet.staffRows!=null&&i.packet.staffRows.length?47:-1)}}var To=(()=>{let d=class d{constructor(t,n){this.teamService=t,this.siteDataService=n,this.platforms=[],this.selectedPlatformId=null,this.tournamentName="",this.tournamentUrl="",this.tournamentDate=null,this.division="",this.includeDirectors=!1,this.packet=null,this.loading=!0,this.generating=!1,this.downloadingPdf=!1,this.downloadingCsv=!1,this.teamFieldGroups=[],this.readinessPercent=0,this.readyRequiredCount=0,this.totalRequiredCount=0,this.inputMode="platform",this.inputModeOptions=[{label:"Pick a known platform",value:"platform"},{label:"Show us the exact form",value:"form"}],this.formFile=null,this.formFileName="",this.formPastedText="",this.extracting=!1,this.schema=null,this.detectedPlatformName="",this.canonicalFieldOptions=[],this.Status=Me,this.Category=ct,this.staffEmailKey="staff.email",this.staffPhoneKey="staff.phone",this.extractRequestId=0,this.unsubscribe$=new U}ngOnInit(){this.teamService.getTournamentRegistrationPlatforms().pipe(S(this.unsubscribe$)).subscribe({next:t=>{this.platforms=t||[],this.canonicalFieldOptions=this.buildCanonicalFieldOptions(),this.loading=!1,this.siteDataService.hideSiteLoader()},error:()=>{this.loading=!1,this.siteDataService.hideSiteLoader(),this.siteDataService.showSiteErrorAlert("Could not load the list of tournament platforms.")}})}ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete()}get selectedPlatform(){return this.platforms.find(t=>t.platformID===this.selectedPlatformId)}setPacket(t){this.packet=t,this.teamFieldGroups=this.buildTeamFieldGroups(),this.recomputeReadiness()}buildTeamFieldGroups(){return this.packet?[{title:"Event",fields:this.byCategory(ct.Event)},{title:"Team",fields:this.byCategory(ct.Team)},{title:"Coach",fields:this.byCategory(ct.Coach)},{title:"Contacts",fields:this.byCategory(ct.Contact)}].filter(n=>n.fields.length>0):[]}byCategory(t){return this.packet.teamFields.filter(n=>n.category===t)}recomputeReadiness(){if(!this.packet){this.readinessPercent=0,this.readyRequiredCount=0,this.totalRequiredCount=0;return}let t=this.packet.teamFields.filter(c=>c.required),n=t.filter(c=>c.status!==Me.Missing).length,r=t.length;for(let c of this.packet.playerRows||[])for(let h of c.fields)h.required&&(r++,h.status!==Me.Missing&&n++);this.readyRequiredCount=n,this.totalRequiredCount=r,this.readinessPercent=r===0?100:Math.round(n/r*100)}buildCanonicalFieldOptions(){let t=new Map;for(let n of this.platforms)for(let r of n.fields||[])t.has(r.key)||t.set(r.key,`${r.label} (${r.key})`);return Array.from(t,([n,r])=>({key:n,label:r}))}tournamentDateForPost(){return this.tournamentDate?En(this.tournamentDate,"yyyy-MM-dd","en-US"):null}generate(){if(this.selectedPlatformId===null||this.selectedPlatformId===void 0){this.siteDataService.showSiteErrorAlert("Please choose a tournament platform first.");return}this.generating=!0;let t={platformID:this.selectedPlatformId,tournamentName:this.tournamentName?.trim(),tournamentUrl:this.tournamentUrl?.trim(),tournamentDate:this.tournamentDateForPost(),division:this.division?.trim(),includeDirectors:this.includeDirectors};this.teamService.generateTournamentRegistrationPacket(this.teamService.teamID,this.teamService.programID,t).pipe(S(this.unsubscribe$)).subscribe({next:n=>{this.setPacket(n),this.generating=!1},error:()=>{this.generating=!1,this.siteDataService.showSiteErrorAlert("We could not build the registration packet. Please try again.")}})}startOver(){this.setPacket(null)}setInputMode(t){this.extractRequestId++,this.extracting=!1,this.inputMode=t,this.schema=null,this.detectedPlatformName=""}onFormFileSelected(t){let n=t.target,r=n.files&&n.files.length?n.files[0]:null;this.formFile=r,this.formFileName=r?r.name:""}resetFormExtraction(){this.extractRequestId++,this.extracting=!1,this.schema=null,this.detectedPlatformName="",this.formFile=null,this.formFileName="",this.formPastedText=""}extractForm(){if(!this.formFile&&!this.formPastedText?.trim()){this.siteDataService.showSiteErrorAlert("Upload a screenshot or PDF of the form, or paste the form text.");return}this.extracting=!0;let t=++this.extractRequestId,n={pastedText:this.formPastedText?.trim(),platformHint:this.selectedPlatformId??void 0};this.teamService.extractTournamentForm(this.teamService.teamID,this.teamService.programID,this.formFile,n).pipe(S(this.unsubscribe$)).subscribe({next:r=>
2644{if(t===this.extractRequestId){if(this.extracting=!1,!r||!r.applied){this.schema=null,this.detectedPlatformName="",this.siteDataService.showSiteErrorAlert(r?.readerNote||"We could not read that form. Try a clearer screenshot or paste the form text.");return}this.schema=r,this.detectedPlatformName=this.platforms.find(c=>c.platformID===r.detectedPlatform)?.name||""}},error:r=>{if(t!==this.extractRequestId)return;this.extracting=!1;let c=r?.status===429?"The daily AI limit has been reached. Try the known-platform option, or try again tomorrow.":this.serverMessage(r)||"We could not read that form. Please try again.";this.siteDataService.showSiteErrorAlert(c)}})}generateFromForm(){if(!this.schema)return;this.generating=!0;let t={platformID:this.schema.detectedPlatform??this.selectedPlatformId??0,tournamentName:this.tournamentName?.trim(),tournamentUrl:this.tournamentUrl?.trim(),tournamentDate:this.tournamentDateForPost(),division:this.division?.trim(),includeDirectors:this.includeDirectors,fields:this.schema.fields};this.teamService.generateTournamentRegistrationPacketFromForm(this.teamService.teamID,this.teamService.programID,t).pipe(S(this.unsubscribe$)).subscribe({next:n=>{this.setPacket(n),this.generating=!1},error:n=>{this.generating=!1,this.siteDataService.showSiteErrorAlert(this.serverMessage(n)||"We could not build the packet from that form. Please try again.")}})}serverMessage(t){if(t?.status!==400)return null;let n=typeof t?.error=="string"?t.error:t?.responseText;if(typeof n!="string"||!n.trim())return null;try{let r=JSON.parse(n);n=typeof r=="string"?r:null}catch(r){}return n?.trim()?n:null}onTeamFieldEdit(t){!t.value||!t.value.trim()?t.status=Me.Missing:t.status===Me.Missing&&(t.status=Me.Filled),this.recomputeReadiness()}copyValue(t){t&&t.trim()&&this.siteDataService.copyToClipboard(t,"Copied!")}copyAllTeamFields(){if(!this.packet)return;let t=this.packet.teamFields.filter(n=>n.value&&n.value.trim()).map(n=>`${n.label}: ${n.value}`);if(t.length===0){this.siteDataService.showSiteErrorAlert("There are no filled team fields to copy yet.");return}this.siteDataService.copyToClipboard(t.join(`
2645`),"Team info copied!")}copyPlayerRow(t){this.siteDataService.copyToClipboard(t.map(n=>n.value||"").join("	"),"Row copied!")}copyFullRoster(){if(!this.packet?.playerRows?.length)return;let t=this.packet.playerRows[0].fields.map(r=>r.label).join("	"),n=this.packet.playerRows.map(r=>r.fields.map(c=>c.value||"").join("	"));this.siteDataService.copyToClipboard([t,...n].join(`
2646`),"Roster copied!")}downloadPdf(){this.download("pdf")}downloadCsv(){this.download("csv")}download(t){if(!this.packet)return;this.setDownloading(t,!0),(t==="pdf"?this.teamService.downloadTournamentRegistrationPacketPdf(this.packet):this.teamService.downloadTournamentRegistrationPacketCsv(this.packet)).pipe(S(this.unsubscribe$)).subscribe({next:r=>{rt(r),this.setDownloading(t,!1)},error:()=>{this.setDownloading(t,!1),this.siteDataService.showSiteErrorAlert("The download failed. Please try again.")}})}setDownloading(t,n){t==="pdf"?this.downloadingPdf=n:this.downloadingCsv=n}staffField(t,n){return t?.fields?.find(r=>r.key===n)?.value||""}statusText(t){switch(t){case Me.Filled:return"Ready";case Me.NeedsReview:return"Review";default:return"Missing"}}statusPill(t){switch(t){case Me.Filled:return"success";case Me.NeedsReview:return"warning";default:return"error"}}};d.\u0275fac=function(n){return new(n||d)(C(ee),C(E))},d.\u0275cmp=D({type:d,selectors:[["app-tournament-registration"]],standalone:!1,decls:32,vars:4,consts:[["caption",""],["header",""],["body",""],["emptymessage",""],[1,"row"],[1,"col-10"],["status","color1","text","Beta"],[1,"col-xl-9"],["alertType","info",3,"isInline"],[1,"d-inline-block"],[1,"col-2","right"],["type","button",1,"btn","btn-naked","btn-icon-redo-alt",3,"click"],[1,"assign-tabs"],["optionLabel","label","optionValue","value",3,"onChange","options","ngModel","allowEmpty"],[1,"report-filters"],[1,"col-md-5","col-lg-3"],[1,"form-group"],[1,"text-danger"],["optionLabel","name","optionValue","platformID","placeholder","Choose a tournament site","styleClass","full-width","appendTo","body",3,"ngModelChange","options","ngModel"],["for","tournamentName"],["id","tournamentName","type","text","maxlength","200","placeholder","e.g. Spring Cup 2026",1,"full-width",3,"ngModelChange","ngModel"],[1,"col-md-5","col-lg-2"],["for","division"],["id","division","type","text","maxlength","150","placeholder","Blank = AI suggestion",1,"full-width",3,"ngModelChange","ngModel"],["dateFormat","mm/dd/yy","placeholder","MM/DD/YYYY","appendTo","body","styleClass","full-width",3,"ngModelChange","ngModel","showButtonBar"],["for","tournamentUrl"],["id","tournamentUrl","type","text","maxlength","500","placeholder","https://...",1,"full-width",3,"ngModelChange","ngModel"],["tooltipText","Many clubs assign a director to every team for oversight. Tournaments usually only want the coaches and manager, so directors are left off the staff list unless you turn this on."],[3,"ngModelChange","binary","ngModel"],[1,"mt-3"],["type","button",1,"btn","btn-primary",3,"click","disabled"],[1,"text-small","text-muted","mb-2"],[1,"report-filters","mt-2"],[1,"col-md-6"],["for","formFile"],["id","formFile","type","file","accept","image/png,image/jpeg,application/pdf",1,"full-width",3,"change"],["o
2646ptionLabel","name","optionValue","platformID","placeholder","Let us detect it","styleClass","full-width","appendTo","body",3,"ngModelChange","options","ngModel","showClear"],[1,"col-12"],["for","formText"],["id","formText","rows","4","maxlength","20000","placeholder","Paste the questions the form asks (one per line is fine).",1,"full-width",3,"ngModelChange","ngModel"],[1,"mt-2"],[1,"text-small","text-muted","mt-1"],[1,"d-flex","justify-content-between","align-items-center","mt-2"],[1,"fw-600"],["type","button",1,"btn","btn-naked","btn-sm","btn-icon-chevron-left",3,"click"],[1,"col-md-6","col-lg-4"],["for","ttName"],["id","ttName","type","text","maxlength","200","placeholder","e.g. Spring Cup 2026",1,"full-width",3,"ngModelChange","ngModel"],["for","ttDivision"],["id","ttDivision","type","text","maxlength","150","placeholder","Blank = AI suggestion",1,"full-width",3,"ngModelChange","ngModel"],[1,"card","table-card","mt-2"],[1,"table","table-striped","table-sm",3,"value","lazy","paginator","totalRecords","rows"],["status","info",1,"ml-1",3,"text"],["optionLabel","label","optionValue","key","placeholder","Leave for me to fill on the site","filterBy","label","appendTo","body","styleClass","full-width",3,"ngModelChange","options","ngModel","showClear","filter"],[1,"text-small","text-muted"],[1,"text-small","text-warning","mt-1"],["status","info","text","Per player"],[1,"d-flex","align-items-center","mt-2"],[1,"text-large","fw-600"],[1,"text-muted","ml-1"],[1,"ml-2",3,"status","text"],[1,"text-small","text-muted","ml-1"],[1,"d-flex","mt-3","mb-2"],["type","button",1,"btn","btn-tertiary","btn-sm","btn-icon-copy","mr-2",3,"click"],["type","button",1,"btn","btn-tertiary","btn-sm","mr-2",3,"click","disabled"],["type","button",1,"btn","btn-tertiary","btn-sm",3,"click","disabled"],["status","success","text","AI-assisted",1,"ml-2"],["alertType","warning",3,"isInline"],[1,"mb-0","mt-1"],["type","button","title","Copy the whole roster as a table (paste into a spreadsheet or grid)",1,"btn","btn-tertiary","btn-sm","btn-icon-copy","mr-2",3,"click"],["type","text",1,"full-width",3,"ngModelChange","ngModel","placeholder"],[3,"status","text"],["type","button","title","Copy value",1,"btn","btn-naked","btn-icon-copy",3,"click","disabled"],[1,"sr-only"],[1,"card","table-card","mt-3"],["type","button","title","Copy row (tab-separated)",1,"btn","btn-naked","btn-icon-copy",3,"click"]],template:function(n,r){n&1&&(s(0,"div",4),e(1,`
2647  `),s(2,"div",5),e(3,`
2648    `),s(4,"h4"),e(5,"External Tournament Registration "),x(6,"app-pill",6),o(),e(7,`
2649  `),o(),e(8,`
2650  `),p(9,vp,7,0),o(),e(10,`
2651`),s(11,"div",4),e(12,`
2652  `),s(13,"div",7),e(14,`
2653    `),s(15,"app-inline-alert",8),e(16,`
2654      `),s(17,"span",9),e(18,`
2655        Build a ready-to-copy registration packet from this team's data for a third-party tournament site. We map and
2656        format your players, coaches, and contacts to the site's fields and flag anything we don't have on file.
2657        `),s(19,"strong"),e(20,"SprocketSports never logs in, submits, or pays on your behalf"),o(),e(21,` \u2014 you complete the registration
2658        yourself as the account holder.
2659      `),o(),e(22,`
2660    `),o(),e(23,`
2661  `),o(),e(24,`
2662`),o(),e(25,`
2663
2664`),e(26,`
2665`),x(27,"app-extension-promo"),e(28,`
2666
2667`),e(29,`
2668`),p(30,jp,3,1),p(31,fu,48,22)),n&2&&(l(9),u(r.packet?9:-1),l(6),_("isInline",!0),l(15),u(r.packet?-1:30),l(),u(r.packet?31:-1))},dependencies:[Ct,De,ni,Ee,Bn,Yn,be,ce,Dt,Zn,Fe,pi,qn,Qe,ui,yo],encapsulation:2});let a=d;return a})();var Do=a=>[a];function xu(a,d){a&1&&e(0,`
2669                          #
2670                          `)}function Cu(a,d){if(a&1){let i=y();e(0,`
2671          `),s(1,"div"),e(2,`
2672            `),s(3,"div",13),e(4,`
2673              `),s(5,"div",14),e(6,`
2674                `),x(7,"i",15),e(8,`
2675              `),o(),e(9,`
2676              `),s(10,"div",16),e(11,`
2677                `),s(12,"div",17),e(13,`
2678                  `),s(14,"div",18),e(15),o(),e(16,`
2679                  `),s(17,"div",4),e(18,`
2680                    `),s(19,"div",17),e(20,`
2681                      `),s(21,"div",19),e(22,`
2682                        `),s(23,"span",20),e(24,"position"),o(),e(25,`
2683                        `),s(26,"span"),e(27),o(),e(28,`
2684                      `),o(),e(29,`
2685                      `),s(30,"div",19),e(31,`
2686                        `),p(32,xu,1,0),e(33),o(),e(34,`
2687                      `),o(),e(35,`
2688                    `),o(),e(36,`
2689                  `),o(),e(37,`
2690                `),o(),e(38,`
2691                `),s(39,"div",21),e(40,`
2692                  `),s(41,"a",22),v("click",function(){let n=g(i).$implicit,r=m();return f(r.moveToRanked(n))}),x(42,"i",23),o(),e(43,`
2693                `),o(),e(44,`
2694              `),o(),e(45,`
2695            `),o(),e(46,`
2696          `)}if(a&2){let i=d.$implicit;l(15),T(i.playerName),l(12),w(`
2697                          `,(i.position==null?null:i.position.charAt(0))||"\u2013",`
2698                        `),l(5),u(i.number?32:-1),l(),w("",i.number,`
2699                        `)}}function vu(a,d){if(a&1){let i=y();e(0,`
2700            `),s(1,"div",24),e(2,`
2701              `),s(3,"div",25),e(4,`
2702                `),s(5,"a",26),v("click",function(){let n=g(i).$implicit,r=m();return f(r.moveToUnranked(n))}),x(6,"i",27),o(),e(7,`
2703              `),o(),e(8,`
2704              `),s(9,"div",28),x(10,"i",15),o(),e(11,`
2705              `),s(12,"div",29),e(13),o(),e(14,`
2706              `),s(15,"div",30),e(16),o(),e(17,`
2707              `),s(18,"div",8),e(19,`
2708                `),s(20,"span"),e(21),o(),e(22,`
2709              `),o(),e(23,`
2710              `),s(24,"div",8),e(25),o(),e(26,`
2711            `),o(),e(27,`
2712          `)}if(a&2){let i=d.$implicit,t=d.$index;l(13),T(t+1),l(3),T(i.playerName),l(5),w(`
2713                  `,(i.position==null?null:i.position.charAt(0))||"\u2013",`
2714                `),l(4),w(`
2715                `,i.number||"\u2013",`
2716              `)}}var Eo=(()=>{let d=class d{constructor(t,n,r){this.siteDataService=t,this.manageTeamService=n,this.route=r,this.closeParentMod
2716al=new fe}ngOnInit(){this.teamID=+this.route.snapshot.parent.params.id,this.programID=+this.route.snapshot.parent.params.programID,this.sessionID=+this.route.snapshot.params.sessionID,j({session:this.manageTeamService.getTeamRankingSession(this.teamID,this.programID,this.sessionID),values:this.manageTeamService.getTeamRankingSessionValues(this.teamID,this.programID,this.sessionID)}).subscribe({next:t=>{this.playerRankings=t.values,this.sessionName=t.session.name,this.unrankedPlayers=this.playerRankings.filter(n=>!n.rank),this.rankedPlayers=this.playerRankings.filter(n=>n.rank).sort((n,r)=>n.rank>r.rank?1:-1),this.siteDataService.hideSiteLoader()},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem getting data.")}})}save(){this.unrankedPlayers.forEach(t=>t.rank=null),this.rankedPlayers.forEach((t,n)=>{t.rank=n+1}),this.manageTeamService.saveTeamRankingSessionValues(this.teamID,this.programID,this.sessionID,this.rankedPlayers).subscribe({next:()=>{this.siteDataService.showSiteSuccessAlert("Ranking information was saved successfully.")},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem saving data.")}})}drop(t){t.previousContainer===t.container?na(t.container.data,t.previousIndex,t.currentIndex):aa(t.previousContainer.data,t.container.data,t.previousIndex,t.currentIndex)}moveToRanked(t){this.rankedPlayers.push(t),this.unrankedPlayers=this.unrankedPlayers.filter(n=>n.playerID!==t.playerID)}moveToUnranked(t){this.unrankedPlayers.push(t),this.rankedPlayers=this.rankedPlayers.filter(n=>n.playerID!==t.playerID)}};d.\u0275fac=function(n){return new(n||d)(C(E),C(ee),C(I))},d.\u0275cmp=D({type:d,selectors:[["ng-component"]],outputs:{closeParentModal:"closeParentModal"},standalone:!1,decls:66,vars:10,consts:[["unrankedPlayersView","cdkDropList"],["rankedPlayersView","cdkDropList"],["role","main"],[1,"row","mb-5"],[1,"col-6"],["cdkDropList","",3,"cdkDropListDropped","cdkDropListData","cdkDropListConnectedTo"],[1,"player-rank-grid","text-small","border-bottom","fw-800","text-navy"],[1,"text-center"],[1,"text-center","d-none","d-md-block"],[1,"row"],[1,"col","left-buttons"],[1,"btn","btn-lg","btn-primary",3,"click"],[1,"btn","btn-lg",3,"routerLink"],["cdkDrag","","cdkDragPreviewContainer","parent",1,"bg-navy","row","border-radius","mb-1","py-2"],["cdkDragHandle","",1,"col-auto","opacity-60","d-flex","align-items-center","pr-0"],[1,"fa-light","fa-bars","text-larger"],[1,"col"],[1,"row","align-me-center"],[1,"col-6","player-name"],[1,"col-4","align-me-center","d-none","d-md-block"],[1,"opacity-60","text-smallest","d-inline-block","mr-1"],[1,"col-auto","border-left","d-flex","align-items-center","px-2"],[1,"d-flex",3,"click"],[1,"fa-solid","fa-circle-arrow-right","text-large"],["cdkDrag","","cdkDragPreviewContainer","parent",1,"player-rank-grid"],[1,"col-auto","d-flex","align-items-center","px-0"],[3,"click"],[1,"fa-solid","fa-circle-arrow-left","text-large"],["cdkDragHandle",""],[1,"text-center","text-green-alt","fw-800"],[1,"player-name"]],template:function(n,r){if(n&1&&(s(0,"main",2),e(1,`
2717
2718  `),s(2,"h2"),e(3),o(),e(4,`
2719  `),s(5,"p"),e(6,"Drag your players from the left column to the right column in the order you would like them to be ranked."),o(),e(7,`
2720
2721  `),s(8,"div",3),e(9,`
2722    `),s(10,"div",4),e(11,`
2723      `),s(12,"div",5,0),v("cdkDropListDropped",function(h){return r.drop(h)}),e(14,`
2724        `),s(15,"div"),e(16,"\xA0"),o(),e(17,`
2725        `),F(18,Cu,47,4,null,null,$),o(),e(20,`
2726      `),o(),e(21,`
2727
2728      `),s(22,"div",4),e(23,`
2729
2730        `),s(24,"div",6),e(25,`
2731          `),x(26,"div"),e(27,`
2732          `),x(28,"div"),e(29,`
2733          `),s(30,"div",7),e(31,"Rank"),o(),e(32,`
2734          `),s(33,"div"),e(34,"Player Name"),o(),e(35,`
2735          `),s(36,"div",8),e(37,"POS"),o(),e(38,`
2736          `),s(39,"div",8),e(40,"#"),o(),e(41,`
2737        `),o(),e(42,`
2738        `),s(43,"div",5,1),v("cdkDropListDropped",function(h){return r.drop(h)}),e(45,`
2739          `),s(46,"div"),e(47,"\xA0"),o(),e(48,`
2740          `),F(49,vu,28,4,null,null,$),o(),e(51,`
2741      `),o(),e(52,`
2742    `),o(),e(53,`
2743    `),s(54,"div",9),e(55,`
2744      `),s(56,"div",10),e(57,`
2745        `),s(58,"button",11),v("click",function(){return r.save()}),e(59,"Save"),o(),e(60,`
2746        `),s(61,"button",12),e(62,"Cancel"),o(),e(63,`
2747      `),o(),e(64,`
2748    `),o(),e(65,`
2749  `),o()),n&2){let c=Re(13),h=Re(44);l(3),T(r.sessionName),l(9),_("cdkDropListData",r.unrankedPlayers)("cdkDropListConnectedTo",L(6,Do,h)),l(6),V(r.unrankedPlayers),l(25),_("cdkDropListData",r.rankedPlayers)("cdkDropListConnectedTo",L(8,Do,c)),l(6),V(r.rankedPlayers),l(12),_("routerLink","../..")}},dependencies:[de,sa,ra,oa],styles:[".first-letter-only[_ngcontent-%COMP%]{display:inline-block;overflow:hidden;white-space:nowrap;width:1ch}.align-me-center[_ngcontent-%COMP%]{display:flex;align-items:center;padding:0}.player-name[_ngcontent-%COMP%]{line-height:1em}@media(max-width:1024px){.player-name[_ngcontent-%COMP%]{font-size:var(--text-medium)}}.player-rank-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:30px 30px 35px 1fr 40px 40px;background-color:var(--color-white);border-bottom:var(--border);padding:.5rem .5rem 0}.player-rank-grid[_ngcontent-%COMP%]   .player-name[_ngcontent-%COMP%]{font-weight:600}.form-action[_ngcontent-%COMP%]{position:fixed;bottom:0;width:75%;background-color:var(--color-white)}.settings-card[_ngcontent-%COMP%]   .p-datatable-wrapper[_ngcontent-%COMP%]{margin-top:16px}"]});let a=d;return a})();function bu(a,d){a&1&&(e(0,`
2750                  `),s(1,"span",12),e(2,"Players:"),o(),e(3,`
2751                `))}function Su(a,d){if(a&1&&(e(0,`
2752                  `),s(1,"span",13),e(2),o(),e(3,`
2753                `)),a&2){let i=m(2).$implicit;l(2),w("",i.ratings==null?null:i.ratings.length,"\xA0\xA0\xA0")}}function yu(a,d){if(a&1&&(e(0,`
2754              `),s(1,"div",11),e(2,`
2755                `),p(3,bu,4,0),p(4,Su,4,1),o(),e(5,`
2756            `)),a&2){let i=m().$implicit;l(3),u(i.ratings.length?3:-1),l(),u(i.ratings.length?4:-1)}}function wu(a,d){if(a&1&&(e(0,`
2757              `),s(1,"tr"),e(2,`
2758                `),s(3,"th",17),e(4,`
2759                  Player Name `),x(5,"p-sortIcon",18),e(6,`
2760                `),o(),e(7,`
2761                `),s(8,"th"),e(9,"Number"),o(),e(10,`
2762                `),s(11,"th"),e(12,"Position"),o(),e(13,`
2763                `),s(14,"th"),e(15,"Tier"),o(),e(16,`
2764              `),o(),e(17,`
2765            `)),a&2){let i=m(3);l(3),ye("aria-label",i.AriaLabels.ACTIVATE_SORT)}}function Tu(a,d){if(a&1){let i=y();e(0,`
2766              `),s(1,"tr"),e(2,`
2767                `),s(3,"td"),e(4),o(),e(5,`
2768                `),s(6,"td"),e(7),o(),e(8,`
2769                `),s(9,"td"),e(10),o(),e(11,`
2770                `),s(12,"td")(13,"p-select",19),R("ngModelChange",function(n){let r=g(i).$implicit;return P(r.tier,n)||(r.tier=n),f(n)}),v("onChange",function(){g(i);let n=m(3);return f(n.setupTiers())}),o()(),e(14,`
2771              `),o(),e(15,`
2772            `)}if(a&2){let i=d.$implicit,t=m(3);l(4),T(i.playerName),l(3),T(i.number),l(3),T(i.position),l(3),M("ngModel",i.tier),_("options",t.tiers)}}function Du(a,d){if(a&1&&(e(0,`
2773          `),s(1,"p-table",14),e(2,`
2774            `),A(3,wu,18,1,"ng-template",15),e(4,`
2775            `),A(5,Tu,16,5,"ng-template",16),e(6,`
2776          `),o(),e(7,`
2777        `)),a&2){let i=m().$implicit,t=m();l(),_("columns",t.columns)("value",i.ratings)}}function Eu(a,d){if(a&1&&(e(0,`
2778        `),s(1,"div",6),e(2,`
2779          `),s(3,"div",7),e(4,`
2780            `),s(5,"div",1),e(6,`
2781              `),s(7,"div",8),e(8,`
2782                `),s(9,"h2",9),x(10,"i",10),e(11),o(),e(12,`
2783            `),o(),e(13,`
2784            `),p(14,yu,6,2),o(),e(15,`
2785        `),o(),e(16,`
2786        `),p(17,Du,8,2),o(),e(18,`
2787    `)),a&2){let i=d.$implicit;l(11),w(`
2788                `,i.tierID?"Tier "+i.tierID:"Unassigned Players",`
2789              `),l(3),u(i.tierID?14:-1),l(3),u((i.ratings==null?null:i.ratings.length)>0?17:-1)}}var Io=(()=>{let d=class d{constructor(t,n,r){this.siteDataService=t,this.manageTeamService=n,this.route=r,this.columns=[{field:"playerName",header:"Player Name"},{field:"number",header:"Number"},{field:"position",header:"Position"}],this.tiers=[{label:"Unassigned",value:0},{label:"Tier 1",value:1},{label:"Tier 2",value:2},{label:"Tier 3",value:3},{label:"Tier 4",value:4},{label:"Tier 5",value:5}],this.AriaLabels=mi}
2789ngOnInit(){this.teamID=+this.route.snapshot.parent.params.id,this.programID=+this.route.snapshot.parent.params.programID,this.sessionID=+this.route.snapshot.params.sessionID,j({session:this.manageTeamService.getTeamRatingSession(this.teamID,this.programID,this.sessionID),values:this.manageTeamService.getTeamRatingSessionValues(this.teamID,this.programID,this.sessionID)}).subscribe({next:t=>{this.playerRatings=t.values,this.sessionName=t.session.name,this.setupTiers(),this.siteDataService.hideSiteLoader()},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem getting data.")}})}setupTiers(){this.tierRatings=[],[0,1,2,3,4,5].forEach(t=>{let n=this.playerRatings.filter(r=>r.tier===t);this.tierRatings.push({tierID:t,ratings:n})})}save(){this.manageTeamService.saveTeamRatingSessionValues(this.teamID,this.programID,this.sessionID,this.playerRatings.filter(t=>t.tier!==0)).subscribe({next:()=>{this.siteDataService.showSiteSuccessAlert("Rating information was saved successfully.")},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem saving data.")}})}};d.\u0275fac=function(n){return new(n||d)(C(E),C(ee),C(I))},d.\u0275cmp=D({type:d,selectors:[["ng-component"]],standalone:!1,decls:25,vars:2,consts:[["role","main"],[1,"row"],[1,"col-xl-12"],[1,"col","left-buttons"],[1,"btn","btn-lg","btn-primary",3,"click"],[1,"btn","btn-lg",3,"routerLink"],[1,"card","settings-card","mb-3"],[1,"card-header"],[1,"col"],[1,"text-large","mb-0"],[1,"fa-duotone","fa-users","d-inline-block","mr-2"],[1,"col","align-items-center","text-right","d-flex","justify-content-end"],[1,"text-uppercase","text-medium","opacity-60","d-inline-block","mr-2"],[1,"fw-800"],["sortField","playerName","responsiveLayout","scroll",3,"columns","value"],["pTemplate","header"],["pTemplate","body"],["pSortableColumn","playerName"],["field","playerName"],["optionLabel","label","optionValue","value","appendTo","body",3,"ngModelChange","onChange","ngModel","options"]],template:function(n,r){n&1&&(s(0,"main",0),e(1,`
2790  `),s(2,"h2"),e(3),o(),e(4,`
2791  `),s(5,"div",1),e(6,`
2792    `),s(7,"div",2),e(8,`
2793      `),F(9,Eu,19,3,null,null,$),o(),e(11,`
2794`),o(),e(12,`
2795`),s(13,"div",1),e(14,`
2796  `),s(15,"div",3),e(16,`
2797    `),s(17,"button",4),v("click",function(){return r.save()}),e(18,"Save"),o(),e(19,`
2798    `),s(20,"button",5),e(21,"Cancel"),o(),e(22,`
2799  `),o(),e(23,`
2800`),o(),e(24,`
2801`),o()),n&2&&(l(3),T(r.sessionName),l(6),V(r.tierRatings),l(11),_("routerLink","../.."))},dependencies:[de,De,Ee,ke,Fe,_i,hi,Qe],encapsulation:2});let a=d;return a})();function Mu(a,d){if(a&1&&(e(0,`
2802  `),x(1,"app-calendar",0),e(2,`
2803`)),a&2){let i=m();l(),_("calendarViewLocation","TEAM_CALENDAR_"+i.teamID+"_"+i.programID)("teamViewTeamID",i.teamID)("programViewProgramID",i.programID)}}function Pu(a,d){a&1&&(e(0,`
2804  `),s(1,"div",1),e(2,`
2805    `),s(3,"div",2),e(4,`
2806      `),x(5,"app-null-card",3),e(6,`
2807    `),o(),e(7,`
2808  `),o(),e(8,`
2809`)),a&2&&(l(5),_("text","Team and Program not recognized"))}var Mo=(()=>{let d=class d{constructor(t,n){this.route=t,this.siteDataService=n}ngOnInit(){this.teamID=+this.route.snapshot.parent.parent.params.id,this.programID=+this.route.snapshot.parent.parent.params.programID,console.log("Taeam ID:",this.teamID,"Program ID:",this.programID),this.siteDataService.hideSiteLoader()}};d.\u0275fac=function(n){return new(n||d)(C(I),C(E))},d.\u0275cmp=D({type:d,selectors:[["app-admin-team-calendar"]],standalone:!1,decls:2,vars:2,consts:[[3,"calendarViewLocation","teamViewTeamID","programViewProgramID"],[1,"full-width","full-height"],[1,"container","p-5"],[3,"text"]],template:function(n,r){n&1&&(p(0,Mu,3,3),p(1,Pu,9,1)),n&2&&(u(r.programID&&r.teamID?0:-1),l(),u(!r.programID||!r.teamID?1:-1))},dependencies:[bi,Ea],encapsulation:2});let a=d;return a})();function Ru(a,d){if(a&1&&(e(0,`
2810  `),s(1,"app-field-calendar",0),e(2,`
2811  `),o(),e(3,`
2812`)),a&2){let i=m();l(),_("teamViewTeamID",i.teamID)("programViewProgramID",i.programID)}}function ku(a,d){a&1&&(e(0,`
2813  `),s(1,"div",1),e(2,`
2814    `),s(3,"div",2),e(4,`
2815      `),x(5,"app-null-card",3),e(6,`
2816    `),o(),e(7,`
2817  `),o(),e(8,`
2818`)),a&2&&(l(5),_("text","Team and Program not recognized"))}var Po=(()=>{let d=class d{constructor(t,n){this.route=t,this.siteDataService=n}ngOnInit(){this.teamID=+this.route.snapshot.parent.parent.params.id,this.programID=+this.route.snapshot.parent.parent.params.programID,this.siteDataService.hideSiteLoader()}};d.\u0275fac=function(n){return new(n||d)(C(I),C(E))},d.\u0275cmp=D({type:d,selectors:[["app-admin-team-field-schedule"]],standalone:!1,decls:2,vars:2,consts:[[3,"teamViewTeamID","programViewProgramID"],[1,"full-width","full-height"],[1,"container","p-5"],[3,"text"]],template:function(n,r){n&1&&(p(0,Ru,4,2),p(1,ku,9,1)),n&2&&(u(r.programID&&r.teamID?0:-1),l(),u(!r.programID||!r.teamID?1:-1))},dependencies:[bi,Ba],encapsulation:2});let a=d;return a})();var Ro=(()=>{let d=class d{constructor(t,n){this.route=t,this.siteDataService=n}ngOnInit(){this.teamID=+this.route.snapshot.parent.parent.params.id,this.programID=+this.route.snapshot.parent.parent.params.programID,this.siteDataService.hideSiteLoader()}};d.\u0275fac=function(n){return new(n||d)(C(I),C(E))},d.\u0275cmp=D({type:d,selectors:[["app-import-team-calendar"]],standalone:!1,decls:7,vars:4,consts:[["role","main"],[3,"programID","teamID"]],template:function(n,r){n&1&&(s(0,"main",0),e(1,`
2819    `),x(2,"app-import-calendar",1),e(3,`
2820    `),x(4,"app-import-volunteer",1),e(5,`
2821`),o(),e(6,`
2822
2823`)),n&2&&(l(2),_("programID",r.programID)("teamID",r.teamID),l(2),_("programID",r.programID)("teamID",r.teamID))},dependencies:[Pa,Fi],encapsulation:2});let a=d;return a})();var ko=(()=>{let d=class d{constructor(t,n){this.route=t,this.siteDataService=n,this.advancedView=!1,this.routeSub$=null}ngOnInit(){this.routeSub$=this.route.parent.parent.params.subscribe(t=>{this.teamID=+t.id,this.programID=+t.programID}),this.route.parent.queryParams.subscribe(t=>{this.advancedView=t.advancedView,this.siteDataService.hideSiteLoader(),console.log("publish view: ",this.advancedView)})}ngOnDestroy(){this.routeSub$&&this.routeSub$.unsubscribe()}};d.\u0275fac=function(n){return new(n||d)(C(I),C(E))},d.\u0275cmp=D({type:d,selectors:[["ng-component"]],standalone:!1,decls:1,vars:3,consts:[[3,"advancedView","teamID","programID"]],template:function(n,r){n&1&&x(0,"app-advanced-bulk-edit-calendar",0),n&2&&_("advancedView",r.advancedView)("teamID",r.teamID)("programID",r.programID)},dependencies:[Ri],encapsulation:2});let a=d;return a})();var Fo=(()=>{let d=class d{constructor(t,n,r){this.route=t,this.teamService=n,this.siteDataService=r,this.routeSub$=null}
2823ngOnInit(){this.teamID=+this.route.snapshot.parent.parent.params.id,this.programID=+this.route.snapshot.parent.parent.params.programID,this.route.parent.parent.params.subscribe(t=>{console.log("params",t),this.programID=+t.programID,this.teamID=+t.id,this.siteDataService.hideSiteLoader(),console.log("Program ID:",this.programID,"TeamID: ",this.teamID)})}ngOnDestroy(){this.routeSub$&&this.routeSub$.unsubscribe()}};d.\u0275fac=function(n){return new(n||d)(C(I),C(X),C(E))},d.\u0275cmp=D({type:d,selectors:[["app-team-volunteer-settings"]],standalone:!1,decls:33,vars:6,consts:[["role","main"],[1,"row"],[1,"col-lg-6"],[1,"card","horizontal-form"],[1,"card-heading"],[3,"programID","teamID"]],template:function(n,r){n&1&&(s(0,"main",0),e(1,`
2824    `),e(2,`
2825    `),s(3,"div",1),e(4,`
2826        `),s(5,"div",2),e(6,`
2827            `),s(7,"section",3),e(8,`
2828                `),s(9,"h2",4),e(10,"Team Volunteer Tasks"),o(),e(11,`
2829                `),s(12,"app-volunteer-roles",5),e(13,`
2830                `),o(),e(14,`
2831            `),o(),e(15,`
2832        `),o(),e(16,`
2833        `),s(17,"div",2),e(18,`
2834            `),s(19,"section",3),e(20,`
2835                `),s(21,"h2",4),e(22,"Team Volunteer Settings"),o(),e(23,`
2836                `),s(24,"app-volunteer-settings",5),e(25,`
2837                `),o(),e(26,`
2838            `),o(),e(27,`
2839        `),o(),e(28,`
2840    `),o(),e(29,`
2841    `),s(30,"app-import-volunteer",5),e(31,`
2842    `),o(),e(32,`
2843`),o()),n&2&&(l(12),_("programID",r.programID)("teamID",r.teamID),l(12),_("programID",r.programID)("teamID",r.teamID),l(6),_("programID",r.programID)("teamID",r.teamID))},dependencies:[Na,La,Fi],encapsulation:2});let a=d;return a})();function Vu(a,d){if(a&1){let i=y();e(0,`
2844        `),s(1,"app-dynamic-form",3),v("onSubmit",function(n){g(i);let r=m();return f(r.saveTeamContact(n))}),e(2,`
2845          `),x(3,"app-dynamic-form-field",4),e(4,`
2846          `),x(5,"app-dynamic-form-field",5),e(6,`
2847          `),x(7,"app-dynamic-form-field",6),e(8,`
2848          `),x(9,"app-dynamic-form-field",7),e(10,`
2849          `),x(11,"app-dynamic-form-field",8),e(12,`
2850          `),x(13,"app-dynamic-form-field",9),e(14,`
2851          `),x(15,"app-dynamic-form-field",10),e(16,`
2852          `),x(17,"app-dynamic-form-field",11),e(18,`
2853          `),x(19,"app-dynamic-form-field",12),e(20,`
2854          `),x(21,"app-dynamic-form-field",13),e(22,`
2855          `),x(23,"app-dynamic-form-field",14),e(24,`
2856          `),x(25,"app-dynamic-form-field",15),e(26,`
2857          `),x(27,"app-dynamic-form-field",16),e(28,`
2858          `),x(29,"app-dynamic-form-field",17),e(30,`
2859          `),x(31,"app-dynamic-form-field",18),e(32,`
2860        `),o(),e(33,`
2861      `)}if(a&2){let i=m();l(),_("fields",i.teamContactFields)("entity",i.teamContact)("horizontalForm",!0)("contentFieldsMode",!0)("showCancelButton",!1)}}var Vo=(()=>{let d=class d{constructor(t,n,r,c,h){this.teamService=t,this.route=n,this.formService=r,this.siteDataService=c,this.router=h,this.unsubscribe$=new U}ngOnInit(){this.route.parent.params.subscribe(t=>{this.teamID=+t.id,this.programID=+t.programID,j({teamContactMetadata:this.teamService.getTeamContactMetadata(),teamContact:this.teamService.getTeamContact(this.teamID)}).subscribe(n=>{this.teamContactFields=n.teamContactMetadata.fields,this.teamContact=n.teamContact,this.siteDataService.hideSiteLoader()})})}saveTeamContact(t){this.teamService.saveTeamContact(this.teamID,t,this.teamContact!==null).subscribe({next:()=>{this.formService.hideFormLoader(),this.siteDataService.showSiteSuccessAlert("Team Information saved successfully")},error:n=>{this.formService.hideFormLoader(),this.siteDataService.showSiteErrorAlert(`There was a problem saving Team Information. ${n.error}`)}})}ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete()}};d.\u0275fac=function(n){return new(n||d)(C(X),C(I),C(Se),C(E),C(H))},d.\u0275cmp=D({type:d,selectors:[["ng-component"]],standalone:!1,decls:9,vars:1,consts:[[1,"row"],[1,"col-md-7"],[1,"card","horizontal-form","compact-form"],["formID"," user-form","submitButtonText","Save","buttonsPosition","left",3,"onSubmit","fields","entity","horizontalForm","contentFieldsMode","showCancelButton"],["fieldName","directorName"],["fieldName","directorEmail"],["fieldName","directorPhone"],["fieldName","teamContactName"],["fieldName","teamContactEmail"],["fieldName","teamContactPhone"],["fieldName","secondaryTeamContactName"],["fieldName","secondaryTeamContactEmail"],["fieldName","secondaryTeamContactPhone"],["fieldName","customTextField1"],["fieldName","customTextField2"],["fieldName","customTextField3"],["fieldName","customDropdownField1ID"],["fieldName","customDropdownField2ID"],["fieldName","customDropdownField3ID"]],template:function(n,r){n&1&&(s(0,"div",0),e(1,`
2862  `),s(2,"div",1),e(3,`
2863    `),s(4,"section",2),e(5,`
2864      `),p(6,Vu,34,5),o(),e(7,`
2865  `),o(),e(8,`
2866`),o()),n&2&&(l(6),u(r.teamContactFields?6:-1))},dependencies:[he,_e],encapsulation:2});let a=d;return a})();var Au=()=>({"text-align":"center"});function Nu(a,d){if(a&1){let i=y();e(0,`
2867        `),s(1,"app-dynamic-form",6),v("onSubmit",function(n){g(i);let r=m();return f(r.saveOverviewPage(n))})("onDelete",function(){g(i);let n=m();return f(n.deleteOverviewPage())}),e(2,`
2868          `),s(3,"div",1),e(4,`
2869            `),s(5,"div",7),e(6,`
2870              `),x(7,"app-dynamic-form-field",8),e(8,`
2871            `),o(),e(9,`
2872          `),o(),e(10,`
2873          `),J(11,9),e(12,`
2874            `),s(13,"div",10),e(14,`
2875              `),s(15,"app-inline-alert",11),e(16,`
2876                `),s(17,"span",12),e(18,`
2877                  Add photos/text on a team by team basis to display on the 'Overview' tab of system
2878                  generated team
2879                  pages.
2880                `),o(),e(19,`
2881              `),o(),e(20,`
2882            `),o(),e(21,`
2883          `),K(),e(22,`
2884        `),o(),e(23,`
2885      `)}if(a&2){let i=m();l(),_("fields",i.overviewPageFields)("entity",i.overviewPage)("horizontalForm",!0)("contentFieldsMode",!0)("showCancelButton",!1)("showDeleteButton",!0),l(6),_("tinySettings",i.getTinySettings())("hideLabel",!0),l(8),_("isInline",!0)}}function Lu(a,d){if(a&1){let i=y();e(0,`
2886      `),s(1,"div",13),e(2,`
2887        `),s(3,"p-panel"),e(4,`
2888          `),x(5,"img",14)(6,"br")(7,"br"),e(8,`
2889          `),s(9,"div")(10,"button",15),v("click",function(){let n=g(i).$implicit,r=m(2);return f(r.pickImage(n))}),e(11,"Select"),o(),e(12,`\xA0
2890          `),s(13,"button",16),v("click",function(){let n=g(i).$implicit,r=m(2);return f(r.deleteImage(n))}),e(14,"Delete"),o(),e(15,`
2891        `),o(),e(16,`
2892      `),o(),e(17,`
2893    `),o(),e(18,`
2894    `)}if(a&2){let i=d.$implicit;l(3),Oe(Q(3,Au)),l(2),_("src",i,Ue)}}function $u(a,d){if(a&1&&(e(0,`
2895      `),F(1,Lu,19,4,null,null,$)),a&2){let i=d.$implicit;l(),V(i)}}var Ao=(()=>{let d=class d{constructor(t,n,r,c,h){this.teamService=t,this.route=n,this.formService=r,this.siteDataService=c,this.router=h,this.showImageModal=!1,this.tinySettingsLoaded=!1,this.tinyLinks=[],this.unsubscribe$=new U}ngOnInit(){this.route.parent.params.subscribe(t=>{this.teamID=+t.id,this.programID=+t.programID,j({metadata:this.teamService.getOverviewPageMetadata(),overviewPage:this.teamService.getTeamOverviewPage(this.teamID,this.programID)}).pipe(S(this.unsubscribe$)).subscribe(n=>{this.overviewPageFields=n.metadata.fields,n.overviewPage?this.overviewPage=n.overviewPage:this.overviewPage=new nn,this.siteDataService.hide
2895SiteLoader()})})}saveOverviewPage(t){t=Pe(Pe({},this.overviewPage),t),this.teamService.saveTeamOverviewPage(this.teamID,this.programID,t).pipe(S(this.unsubscribe$)).subscribe({next:()=>{this.formService.hideFormLoader(),this.siteDataService.showSiteSuccessAlert("Overview page saved successfully")},error:()=>{this.formService.hideFormLoader(),this.siteDataService.showSiteErrorAlert("There was a problem saving this Overview page.")}})}deleteOverviewPage(){this.teamService.deleteTeamOverviewPage(this.teamID,this.programID).pipe(S(this.unsubscribe$)).subscribe({next:()=>{this.siteDataService.showSiteSuccessAlert("Overview page deleted successfully"),this.overviewPage=new nn},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem deleting this Overview page.")}})}pickImage(t){this.showImageModal=!1,this.imageCBfunction(t)}deleteImage(t){this.teamService.deleteContent(t.split("/").pop()).pipe(S(this.unsubscribe$)).subscribe(()=>{this.teamService.content.splice(this.teamService.content.findIndex(n=>n===t),1),this.teamService.content=Array.from(this.teamService.content)})}getTinySettings(t=!1){return this.tinySettingsLoaded||(this.teamService.tinySettings.file_picker_callback=(n,r,c)=>{c.filetype==="image"&&(this.imageCBfunction=n,this.showImageModal=!0)},this.teamService.tinySettings.link_list=this.tinyLinks,this.teamService.tinySettings.readonly=!0,this.teamService.tinySettings.toolbar="undo redo | blocks | fontsizeinput | bold italic forecolor backcolor | alignleft aligncenter alignright al
2895ignjustify | bullist numlist outdent indent | table link code removeformat preview"),this.tinySettingsLoaded=!0,this.teamService.tinySettings}ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete()}};d.\u0275fac=function(n){return new(n||d)(C(X),C(I),C(Se),C(E),C(H))},d.\u0275cmp=D({type:d,selectors:[["ng-component"]],standalone:!1,decls:18,vars:10,consts:[["grid",""],[1,"row"],[1,"col-md-12"],[1,"horizontal-form","compact-form"],[3,"visibleChange","visible","closable","modal","baseZIndex","resizable"],["paginatorPosition","bottom","layout","grid","emptyMessage","No Images Found",3,"value","paginator","alwaysShowPaginator","rows"],["formID"," user-form","submitButtonText","Save","buttonsPosition","left",3,"onSubmit","onDelete","fields","entity","horizontalForm","contentFieldsMode","showCancelButton","showDeleteButton"],[1,"col-md-12","details-row"],["fieldName","mainContent",3,"tinySettings","hideLabel"],["beforeSubmitButtonsContent",""],[1,"mb-4","mt-4","col-xl-9"],["alertType","info",3,"isInline"],[1,"d-inline-block"],[1,"p-col-12","p-md-3",2,"padding",".5em"],["width","200","alt","",3,"src"],[1,"btn","btn-primary","btn-sm",3,"click"],[1,"btn","btn-sm",3,"click"]],template:function(n,r){if(n&1){let c=y();s(0,"div",1),e(1,`
2896  `),s(2,"div",2),e(3,`
2897    `),s(4,"section",3),e(5,`
2898      `),p(6,Nu,24,9),o(),e(7,`
2899  `),o(),e(8,`
2900`),o(),e(9,`
2901
2902`),s(10,"p-dialog",4),R("visibleChange",function(b){return g(c),P(r.showImageModal,b)||(r.showImageModal=b),f(b)}),e(11,`
2903  `),s(12,"p-dataView",5),e(13,`
2904    `),A(14,$u,3,0,"ng-template",null,0,ne),e(16,`
2905`),o(),e(17,`
2906`),o()}n&2&&(l(6),u(r.overviewPageFields?6:-1),l(4),M("visible",r.showImageModal),_("closable",!0)("modal",!0)("baseZIndex",1e6)("resizable",!0),l(2),_("value",r.teamService.content)("paginator",!0)("alwaysShowPaginator",!1)("rows",20))},dependencies:[he,_e,ce,oe,ga,fa],encapsulation:2});let a=d;return a})();var No=(()=>{let d=class d{};d.\u0275fac=function(n){return new(n||d)},d.\u0275mod=ei({type:d}),d.\u0275inj=Zt({imports:[Xi.forChild([{path:":id/program/:programID",component:mo,children:[{path:"roster",component:ho,canActivate:[Y],data:{metaTitle:"Team Roster"}},{path:"roster/:playerID",component:bo,canActivate:[Y],children:[{path:"profile",component:Co,canActivate:[Y],data:{metaTitle:"Team Roster Player Profile",profileView:!0}},{path:"college-profile",component:an,canActivate:[Y],data:{metaTitle:"Team Roster Player College Profile",profileView:!0}}]},{path:"roster/admin-view",loadChildren:()=>import("./chunk-QGSWBW5M.js").then(t=>t.PlayerModule),data:{profileView:!0}},{path:"staff/admin-view",loadChildren:()=>import("./chunk-Z2KVK37I.js").then(t=>t.StaffModule),data:{profileView:!0}},{path:"staff",component:fo,canActivate:[Y],data:{metaTitle:"Team Staff"}},{path:"invitations",component:qa,canActivate:[Y],data:{metaTitle:"Invitations"}},{path:"invitations/create",component:Wa,canActivate:[Y],data:{metaTitle:"Invite Players",adminView:!0}},{path:"external-conections",component:So,canActivate:[Y],data:{metaTitle:"Team External Connections"}},{path:"tournament-registration",component:To,canActivate:[wt,vo,Y],data:{metaTitle:"External Tournament Registration",permissions:[W.Teams]}},{path:"team-overview-page",component:Ao,canActivate:[Y],data:{metaTitle:"Team Overview"}},{path:"schedule",component:go,canActivate:[Y],data:{metaTitle:"Team Schedule",admin:!0},children:[{path:"field-schedule",component:Po,data:{admin:!0,metaTitle:"Facility Calendar",permissions:[W.FieldCalendar],showPublish:!0,bodyClass:"field-calendar"}},{path:"import",component:Ro,data:{admin:!0,metaTitle:"Import & Export"}},{path:"bulk-edit",component:ko,canActivate:[Y],data:{metaTitle:"Bulk Actions",admin:!0}},{path:"volunteer-settings",component:Fo,data:{admin:!0,permissions:[W.VolunteerEvents],metaTitle:"Volunteer Settings"}},{path:"",component:Mo,data:{admin:!0,permissions:[W.ClubCalendar],showPublish:!0,metaTitle:"Calendar"}}]},{path:"communication",component:no,canActivate:[Y],data:{metaTitle:"Team Communication"}},{path:"communication/email-compose",component:ao,canActivate:[Y],data:{metaTitle:"Create Message"}},{path:"communication/recipients/:communicationType",component:Ut,canActivate:[Y],data:{metaTitle:"Message"}},{path:"communication/messages-view",canActivate:[Y],component:Yt,data:{metaTitle:"Message"}},{path:"team-message",canActivate:[Y],component:Yt,data:{metaTitle:"Message",adminView:!0}},{path:"team-contact",canActivate:[Y],component:Vo,data:{metaTitle:"Team Information",adminView:!0}},{path:"resources",component:co,canActivate:[Y],data:{metaTitle:"Team Resources"}},{path:"forms",canActivate:[wt,Y],component:so,data:{metaTitle:"Team Forms",permissions:[W.PlayerProgress]}},{path:"forms/ranking/:sessionID",canActivate:[wt,Y],component:Eo,data:{metaTitle:"Team Ranking",permissions:[W.PlayerProgress]}},{path:"forms/rating/:sessionID",canActivate:[wt,Y],component:Io,data:{metaTitle:"Team Ranking",permissions:[W.PlayerProgress]}},{path:"forms/:surveyID/players/:playerID",canActivate:[wt,Y],component:Yi,data:{metaTitle:"Team Form Review",permissions:[W.PlayerProgress]}},{path:"college-profile",component:an,canActivate:[Y],data:{metaTitle:"College Profile"}}
2906]}]),Xi]});let a=d;return a})();var Jt=class{constructor(d,i,t){this.programID=d,this.teamID=i,this.playerID=t}};var Ou=["messageContent"],Bu=["uploadedFiles"],Lo=()=>({overflow:"visible"}),ju=(a,d)=>({sender:a,"mb-3 ":d});function zu(a,d){if(a&1){let i=y();e(0,`
2907    `),s(1,"app-pinned-messages-panel",8),v("togglePanel",function(){g(i);let n=m();return f(n.togglePinnedPanel())})("messageClicked",function(n){g(i);let r=m();return f(r.onPinnedMessageClicked(n))})("unpinClicked",function(n){g(i);let r=m();return f(r.onPinnedMessageUnpin(n))}),o(),e(2,`
2908    `)}if(a&2){let i=m();l(),_("pinnedMessages",i.pinnedMessages)("totalPinned",i.totalPinned)("showPanel",i.showPinnedPanel)}}function qu(a,d){if(a&1){let i=y();e(0,`
2909                `),s(1,"app-message-bubble",12),N(2,"utcDate"),v("replyClicked",function(){g(i);let n=m().$implicit,r=m(2);return f(r.replyToMessage(n))})("editClicked",function(){g(i);let n=m().$implicit,r=m(2);return f(r.editMessage(n))})("reactClicked",function(n){g(i);let r=m().$implicit,c=m(2);return c.longPressedMessage=r,f(c.reactionClicked(n))})("reactionTapped",function(n){g(i);let r=m().$implicit,c=m(2);return c.longPressedMessage=r,f(c.reactionClicked(n))})("pinClicked",function(){g(i);let n=m().$implicit,r=m(2);return f(r.togglePinMessage(n))})("deleteMessageClicked",function(){g(i);let n=m().$implicit,r=m(2);return r.longPressedMessage=n,f(r.deleteMessageLongPress())})("reportClicked",function(){g(i);let n=m().$implicit,r=m(2);return f(r.openReportModal(n))})("messageTextClicked",function(n){g(i);let r=m().$implicit,c=m(2);return f(c.messageClicked(r,!0,n))})("messageReactionsClicked",function(){g(i);let n=m().$implicit,r=m(2);return f(r.messageClicked(n,!0))})("quotedMessageClicked",function(){g(i);let n=m().$implicit,r=m(2);return f(r.scrollToQuotedMessage(n.quotedMessage))})("voteSubmitted",function(n){g(i);let r=m().$implicit,c=m(2);return f(c.onPollVote(r.pollID,n))})("refreshPollRequested",function(){g(i);let n=m().$implicit,r=m(2);return f(r.onPollRefresh(n.pollID))})("pollUpdated",function(n){g(i);let r=m(3);return f(r.onPollUpdated(n))}),e(3,`
2910                    `),x(4,"app-user-initials",13),e(5,`
2911                `),o(),e(6,`
2912                `)}if(a&2){let i=m(),t=i.$implicit,n=i.$index,r=i.$count,c=m(2);l(),_("isSender",c.isSender(t.sentClubUserID))("firstName",t.sentClubUser.user.firstName)("lastName",t.sentClubUser.user.lastName)("isLastMessage",n===r-1)("sentDate",t.sentClubUserID===(c.messages[n-1]==null?null:c.messages[n-1].sentClubUserID)&&c.getTimeBetweenDates(c.messages[n-1]==null?null:c.messages[n-1].sentDate,t.sentDate)<120?"":B(2,29,t.sentDate,"h:mm a"))("messageID",t.messageID)("currentClubUser",c.currentClubUser)("currentUserEmoji",c.getCurrentUserEmoji(t))("messageText",t.text)("file",t.file)("fileName",t.fileName)("isDeleted",t.isDeleted)("wasEdited",t.wasEdited)("reactions",t.reactions)("isPinned",c.isPinned(t))("canEdit",c.currentClubUserID===t.sentClubUserID&&!t.isDeleted)("canDelete",c.currentClubUserID===t.sentClubUserID||c.currentClubUser[c.Permission.DeleteTeamMessages])("canPin",!0)("canReply",!0)("canReact",!0)("canReport",c.currentClubUserID!==t.sentClubUserID)("pollID",t.pollID)("poll",c.getPoll(t.pollID))("pollContext",c.pollContext)("isRefreshing",c.isRefreshingPoll(t.pollID))("quotedMessage",t.quotedMessage),l(3),_("firstName",t==null||t.sentClubUser==null||t.sentClubUser.user==null?null:t.sentClubUser.user.firstName)("lastName",t==null||t.sentClubUser==null||t.sentClubUser.user==null?null:t.sentClubUser.user.lastName)("id",t.sentClubUserID)}}function Wu(a,d){if(a&1&&(e(0,`
2913                `),s(1,"div",14),e(2,`
2914                    `),s(3,"em",15),e(4),o(),e(5,`
2915                `),o(),e(6,`
2916                `)),a&2){let i=m().$implicit;l(4),T(i.text)}}function Hu(a,d){if(a&1&&(e(0,`
2917            `),x(1,"app-message-time-tag",10),e(2,`
2918            `),s(3,"div",11),e(4,`
2919                `),p(5,qu,7,32),p(6,Wu,7,1),o(),e(7,`
2920            `)),a&2){let i=d.$implicit,t=d.$index,n=d.$count,r=m(2);l(),_("start",i.sentDate)("end",t>0?r.messages[t-1].sentDate:null),l(2),_("ngClass",pe(5,ju,r.currentClubUserID===i.sentClubUser.clubUserID&&!i.isClubMessage,t!==n-1)),l(2),u(!i.messageTypeID||i.messageTypeID===r.MessageType.DEFAULT?5:-1),l(),u(i.messageTypeID===r.MessageType.THREAD_PARTICIPANT_CHANGE||i.messageTypeID===r.MessageType.MESSAGE_PINNED?6:-1)}}function Gu(a,d){a&1&&(e(0,`
2921            `),s(1,"div",16),e(2,`
2922                `),x(3,"span",17),e(4,`
2923            `),o(),e(5,`
2924            `))}function Yu(a,d){if(a&1&&(e(0,`
2925        `),J(1,9),e(2,`
2926            `),F(3,Hu,8,8,null,null,$),p(5,Gu,6,0),K(),e(6,`
2927        `)),a&2){let i=m();l(3),V(i.messages),l(2),u(i.showSendingSpinner?5:-1)}}function Qu(a,d){if(a&1){let i=y();e(0,`
2928    `),s(1,"div",18),e(2,`
2929        `),s(3,"app-message-form",19),v("sendMessage",function(n){g(i);let r=m();return f(r.sendMessage(n))})("deleteQuote",function(){g(i);let n=m();return f(n.cancelReply())})("pollCreated",function(n){g(i);let r=m();return f(r.onPollCreated(n))}),o(),e(4,`
2930    `),o(),e(5,`
2931    `)}if(a&2){let i=m();l(3),_("sendEnabled",!i.showSendingSpinner)("clubUserMessageThreadType",i.ClubUserMessageThreadType.TeamMessage)("quotedMessage",i.quotedMessage)}}function Ju(a,d){if(a&1){let i=y();e(0,`
2932    `),s(1,"app-team-communication-recipient",20),v("modalClose",function(){g(i);let n=m();return f(n.recipientModalClosed())}),o(),e(2,`
2933    `)}if(a&2){let i=m();l(),_("communicationType",i.CommunicationTypeLV.MESSAGE)("modalView",!0)("teamID",i.teamID)("programID",i.programID)("messageThreadID",i.messageThreadID)}}function Ku(a,d){a&1&&(e(0,`
2934        `),s(1,"h5",26),e(2,"Title limit is 50 characters."),o(),e(3,`
2935        `))}function Zu(a,d){a&1&&(e(0,`
2936                `),x(1,"span",27),e(2,`
2937                `))}function Xu(a,d){a&1&&(e(0,`
2938                `),x(1,"i",28),e(2,`
2939                `))}function e_(a,d){if(a&1){let i=y();e(0,`
2940    `),s(1,"form",21),v("ngSubmit",function(){g(i);let n=m();return f(n.updateTitle())}),e(2,`
2941        `),s(3,"input",22,1),R("ngModelChange",function(n){g(i);let r=m();return P(r.editingTitle,n)||(r.editingTitle=n),f(n)}),o(),e(5,`
2942        `),p(6,Ku,4,0),s(7,"div",23),e(8,`
2943            `),s(9,"button",24),v("click",function(){g(i);let n=m();return f(n.cancelTitleEdit())}),e(10,"Cancel"),o(),e(11,`
2944            `),s(12,"button",25),e(13,`
2945                `),p(14,Zu,3,0),p(15,Xu,3,0),e(16,`
2946                Save Title
2947            `),o(),e(17,`
2948        `),o(),e(18,`
2949    `),o(),e(19,`
2950    `)}if(a&2){let i=m();l(3),M("ngModel",i.editingTitle),_("disabled",i.showSendingSpinner),l(3),u(i.editingTitle&&i.editingTitle.length>=50?6:-1),l(6),_("disabled",!i.editingTitle||i.editingTitle.trim().length===0||i.editingTitle.length>50||i.showSendingSpinner),l(2),u(i.showSendingSpinner?14:-1),l(),u(i.showSendingSpinner?-1:15)}}var zo=(()=>{let d=class d{constructor(t,n,r,c,h,b,k,te,$e,Xe){this.messageService=t,this.route=n,this.siteDataService=r,this.pollService=c,this.staffService=h,this.router=b,this.authorizeService=k,this.userService=te,this.cdr=$e,this.teamService=Xe,this.unsubscribe$=new U,this.messages=[],this.showSendingSpinner=!1,this.showModal=!1,this.CommunicationTypeLV=Ht,this.timer=_t(6e4),this.recipientListLimit=7,this.isRecipientListExpanded=!1,this.MessageType=st,this.Permission=W,this.ClubUserMessageThreadType=lt,this.getTimeBetweenDates=bt,this.longPressedMessage=void 0,this.reactingMessageIds=new Set,this.longPressedLinkList=[],this.pinnedMessages=[],this.viewImage=!1,this.pollCache=new Map,this.refreshingPolls=new Set,this.replyingToMessage=null,this.quotedMessage=null,this.totalPinned=0,this.showPinnedPanel=!1,this.isPinningMessage=!1,this.editingMessage=void 0,this.showEditModal=!1,this.showTitleEditModal=!1,this.originalTitle="",this.editingTitle="",this.isReportModalVisible=!1,this.messageToReport=void 0,this.reportNotes="",this.reportSeverityRating=50,this.reportReasons=[{id:1,description:"Bullying/Harassment"},{id:2,description:"Inappropriate Language"},{id:3,description:"Threatening Behavior"},{id:4,description:"Other"}],this.isSubmittingReport=!1,this.trackByPinnedId=(pt,Qi)=>Qi.messageID}
2950ngOnInit(){this.teamID=+this.route.snapshot.parent.params.id,this.programID=+this.route.snapshot.parent.params.programID,this.messageService.forceNewThread&&(this.messages=[],this.messageThreadID=void 0),this.route.params.pipe(S(this.unsubscribe$)).subscribe(t=>{t.id==="new"&&this.messageService.forceNewThread&&(this.messages=[],this.messageThreadID=void 0)}),this.pollContext=Ai.createTeamContext(this.teamID,this.programID),this.userService.getClubUser().pipe(S(this.unsubscribe$)).subscribe(t=>{this.currentClubUser=t,this.siteDataService.hideSiteLoader()}),(!this.messageService.threads||!this.messageService.selectedRecipients)&&this.router.navigate([`/admin/manage-team/${this.teamID}/message-thread`]),this.authorizeService.getUser().subscribe(t=>{t&&(this.currentClubUserID=+t.userID)}),this.staffService.getTeamAssignment(this.teamID).pipe(S(this.unsubscribe$)).subscribe(t=>{this.staffProgramAssignment=t}),this.messageService.setRecipientList(),this.messageService.messageThread$.pipe(S(this.unsubscribe$)).subscribe(t=>{let n=this.messageThreadID;t?(this.messageThread=t,this.messageThreadID=+t.messageThreadID):this.messageService.forceNewThread&&this.messageService.selectedRecipients?.length>0?(this.messageThread={messageThreadID:0,title:"",participants:this.messageService.selectedRecipients.map(r=>({clubUserID:r.clubUserID,clubUser:{clubUserID:r.clubUserID,user:{firstName:r.firstName,lastName:r.lastName}}})),messages:[],staffParticipants:this.messageService.selectedRecipients},this.messageThreadID=void 0):(this.messageThread=void 0,this.messageThreadID=void 0),!this.messageThreadID&&!this.messageService.forceNewThread&&this.existingMessageWithSameRecipients(),this.messageThreadID!==n&&(this.cancelReply(),this.editingMessage=void 0,this.showEditModal=!1),this.messageThreadID?(this.getMessages(),this.loadPinnedMessages(),this.clearUserMessageNotifications()):(this.messages=[],this.inputValue="",this.editingMessage=void 0,this.replyingToMessage=null,this.quotedMessage=null,this.pinnedMessages=[],this.totalPinned=0,this.showPinnedPanel=!1,this.total=void 0),this.cdr.markForCheck()}),this.messageService.messageSent$.pipe(S(this.unsubscribe$)).subscribe({next:t=>{if(console.log("message.component message sent subscription: ",t),t.clubUserMessageThreadType===lt.Message){let n=t.message;if(!n.messageID||n.messageTypeID===st.MESSAGE_PINNED.valueOf())this.messages.push(n),this.total||(this.total=0),this.total++;else{let r=this.messages.findIndex(c=>!c.messageID&&c.tempID===n.tempID);r>-1&&(this.messages[r].messageID=n.messageID,this.messages[r].sentDate=n.sentDate,this.messages[r].sentClubUser=n.sentClubUser,this.messages[r].sentClubUserID=n.sentClubUserID,n.file&&(this.messages[r].file=n.file))}this.doScrollToBottom()}}}),this.timer.pipe(S(this.unsubscribe$)).subscribe({next:()=>{this.messageThreadID&&this.getMessages()}}),this.loadReportReasons(),this.siteDataService.hideSiteLoader()}recipientModalClosed(){this.showModal=!1}isSender(t){return t===this.currentClubUser.clubUserID}clearUserMessageNotifications(){this.messageThreadID&&this.userService.getUserNotifications().pipe(S(this.unsubscribe$),et(t=>t?.filter(n=>Ln.includes(n.zNotificationTypeID)&&n.dataID===this.messageThreadID)),tt(t=>!!t?.length),ht(t=>{let n=t.map(r=>r.clubUserNotificationID);return this.userService.markNotificationsAsViewed(n)})).subscribe()}getMessages(){(!this.messageService.selectedRecipients||this.messageService.selectedRecipients.length===0)&&this.messageService.getMessageRecipients(this.teamID,this.messageThreadID).pipe(S(this.unsubscribe$)).subscribe(t=>{this.messageService.selectedRecipients=t.map(n=>new An(n.clubUserID,n.user?.firstName||"",n.user?.lastName||"",this.programID,this.teamID)),this.messageService.setRecipientList(),this.cdr.markForCheck()}),this.messageService.getMessages(this.teamID,this.messageThreadID).pipe(S(this.unsubscribe$)).subscribe(t=>{let n=this.messages.length,c=(this.messages.length>0?this.messages[0]?.messageThreadID:void 0)!==this.messageThreadID;(t.length!==n||c)&&(this.messages=t,this.messages.filter(h=>
2950h.pollID).forEach(h=>this.loadPoll(h.pollID)),this.doScrollToBottom())})}existingMessageWithSameRecipients(){let t;return this.messageService.threads.forEach(n=>{n.participants?.length===this.messageService.selectedRecipients?.length&&(t=[],n.participants.forEach(r=>{this.messageService.selectedRecipients.some(c=>c.clubUserID===r.clubUserID)&&t.push(r)}),t.length===this.messageService.selectedRecipients?.length&&(this.messageThreadID=n.messageThreadID))})}sendMessage(t){if(!t)return;this.showSendingSpinner=!0,this.doScrollToBottom();let n=new FormData;if(t.blob){let h=t.fileName??"file";n.append(h,t.blob,t.fileName??h)}let r=t.text??"";if(this.quotedMessage&&n.append("quotedMessageID",this.quotedMessage.messageID.toString()),!(this.messageService.forceNewThread||!this.messageThreadID||this.messageThreadID<=0)&&this.messageThreadID>0)n.append("text",r),n.append("messageThreadID",this.messageThreadID.toString()),this.messageService.createMessage(this.teamID,n).pipe(S(this.unsubscribe$)).subscribe({next:h=>{this.messages.push(h),this.showSendingSpinner=!1,this.cancelReply()},error:h=>this.handleSendFailure(h,!0)});else{let h=this.createThread(r);this.messageService.createClubUserMessageThread(this.teamID,h).pipe(S(this.unsubscribe$)).subscribe({next:b=>{this.messageThreadID=b.messageThreadID,this.messageService.threads.unshift(b),this.messageService.forceNewThread=!1,b.participants&&b.participants.length>0&&(this.messageService.selectedRecipients=b.participants.map(k=>St(k.clubUser,k.teamID,k.programID))),this.messageService.setRecipientList(),this.messageService.messageThreadUpdated(b),this.cdr.markForCheck(),this.messages.push(...b.messages),this.showSendingSpinner=!1,this.cancelReply()},error:b=>this.handleSendFailure(b,!1)})}this.doScrollToBottom()}handleSendFailure(t,n){this.showSendingSpinner=!1,this.cdr.markForCheck();let r=t?.status;if(n&&r===410){this.messageService.refreshMessageThreads(),this.siteDataService.showSiteErrorAlert("This conversation is no longer available. Please reopen it from your message list and try again.");return}this.siteDataService.showSiteErrorAlert("Unable to send message. Please try again.")}createThread(t){let n=new Jt(this.programID,this.teamID);n.messageThread=new Ha,n.messageThread.messages=[];let r=new Ta;return r.text=t,n.messageThread.messages.push(r),n.messageThread.participants=[],this.messageService.selectedRecipients.forEach(c=>{let h=new Jt(c.programID,c.teamID,c.playerID);h.clubUserID=c.clubUserID,n.messageThread.participants.push(h)}),n}messageSize(t){return typeof t=="number"&&(t=t.toString()),t.length}doScrollToBottom(){setTimeout(()=>{let t=document.getElementById("messages-wrap");window.scrollTo(0,document.body.scrollHeight),t.scrollTo({top:t.scrollHeight})},500)}messageClicked(t,n,r){t.messageID&&!t.isDeleted&&(this.modalView=n,this.longPressedMessage=t,r?.length>0&&(this.longPressedLinkList=r))}getCurrentUserEmoji(t){if(!t?.reactions||!this.currentClubUser?.clubUserID)return;let n=t.reactions.find(r=>r.savedBy===this.currentClubUser.clubUserID);return n?Ne(n):void 0}reactionClicked(t){let n=this.longPressedMessage.messageID;if(!this.reactingMessageIds.has(n))if(this.reactingMessageIds.add(n),this.longPressedMessage.reactions?.length&&this.longPressedMessage.reactions.some(r=>r.savedBy===this.currentClubUser.clubUserID)){let r=this.longPressedMessage.reactions.find(c=>c.savedBy===this.currentClubUser.clubUserID);if(this.modalView&&this.closeLongPress(),Ne(r)===t)this.messages.find(c=>c.messageID===n).reactions=this.messages.find(c=>c.messageID===n).reactions.filter(c=>c.id!==r.id),this.messageService.deleteMessageReaction(this.teamID,r.id).pipe(we(()=>this.reactingMessageIds.delete(n))).subscribe({next:()=>{},error:()=>{this.messages.find(c=>c.messageID===n).reactions.push(r),this.siteDataService.showSiteErrorAlert("Failed to remove reaction")}});else{let c=Ne(r);r.emoji=t;let h=this.messages.find(k=>k.messageID===n)?.reactions.find(k=>k.id===r.id);h&&(h.emoji=t);let b=new on;b.messageID=n,b.emoji=t,this.messageService.updateMessageReaction(this.teamID,r.id,b).pipe(we(()=>this.reactingMessageIds.delete(n))).subscribe({next:()=>{},error:()=>{r.emoji=c,h&&(h.emoji=c),this.siteDataService.showSiteErrorAlert("Failed to update reaction")}})}}else{this.modalView&&this.closeLongPress();let r=new on;r.messageID=n,r.emoji=t;
2950let c={id:Math.random(),messageID:n,emoji:t,savedBy:this.currentClubUser.clubUserID,savedByClubUser:this.currentClubUser,savedOn:new Date().toISOString()},h=this.messages.find(b=>b.messageID===n);h&&(h.reactions||(h.reactions=[]),h.reactions.push(c)),this.messageService.reactToMessage(this.teamID,r).pipe(we(()=>this.reactingMessageIds.delete(n))).subscribe({next:b=>{let k=this.messages.find(te=>te.messageID===n);if(k){let te=k.reactions.findIndex($e=>$e.id===c.id);te>-1&&(k.reactions[te]=b)}},error:()=>{let b=this.messages.find(k=>k.messageID===n);b&&(b.reactions=b.reactions.filter(k=>k.id!==c.id)),this.siteDataService.showSiteErrorAlert("This message or user has been removed from the thread")}})}}closeLongPress(){this.longPressedMessage=void 0,this.longPressedLinkList=[]}deleteMessageLongPress(){this.longPressedMessage&&this.messageService.markMessageAsDeleted(this.teamID,this.longPressedMessage).subscribe({next:t=>{this.handleDeletedMessage(t);let n=this.messageService.threads?.find(r=>r.messageThreadID===t.messageThreadID);n&&n.messages?.length&&n.messages[0].messageID===t.messageID&&(this.messageService.threads.find(r=>r.messageThreadID===t.messageThreadID).messages[0].isDeleted=!0)},error:()=>{this.siteDataService.showSiteErrorAlert("You don't have access to delete this message, or it has already been removed")}})}handleDeletedMessage(t){this.messages.find(h=>h.messageID===t.messageID).isDeleted=!0;let n=this.messages.find(h=>h.quotedMessage?.messageID==t.messageID);n&&(n.quotedMessage.isDeleted=!0);let r=this.pinnedMessages?.find(h=>h.messageID===t.messageID);r&&(r.isDeleted=!0);let c=this.pinnedMessages?.find(h=>h.quotedMessage?.messageID==t.messageID);c&&(c.quotedMessage.isDeleted=!0),this.viewImage&&(this.viewImage=!1),this.closeLongPress()}openImage(t){this.currentMessage=t,this.longPressedMessage=t,this.viewImage=!0,this.modalView=!1}getPoll(t){return this.pollCache.get(t)}isRefreshingPoll(t){return this.refreshingPolls.has(t)}loadPoll(t){!t||this.pollCache.has(t)||this.refreshingPolls.has(t)||(this.refreshingPolls.add(t),this.pollService.getPoll(this.pollContext,t).pipe(S(this.unsubscribe$)).subscribe({next:n=>{this.pollCache.set(t,n),this.refreshingPolls.delete(t)},error:()=>{this.refreshingPolls.delete(t)}}))}onPollRefresh(t){t&&(this.refreshingPolls.add(t),this.pollService.getPoll(this.pollContext,t).pipe(S(this.unsubscribe$)).subscribe({next:n=>{this.pollCache.set(t,n),this.refreshingPolls.delete(t)},error:()=>{this.refreshingPolls.delete(t)}}))}onPollVote(t,n,r){this.pollService.voteInPoll(this.pollContext,{pollId:t,pollOptionId:n,messageId:r||0}).pipe(S(this.unsubscribe$)).subscribe({next:c=>{this.onPollRefresh(t)}})}onPollUpdated(t){t?.id&&this.pollCache.set(t.id,t),this.getMessages()}replyToMessage(t){!t||t.isDeleted||(this.replyingToMessage=t,this.quotedMessage={messageID:t.messageID,text:t.text,file:t.file,fileName:t.fileName,sentClubUserID:t.sentClubUser?.clubUserID,sentClubUser:t.sentClubUser,sentDate:t.sentDate,isPinned:!1,isDeleted:t.isDeleted})}cancelReply(){this.replyingToMessage=null,this.quotedMessage=null}scrollToQuotedMessage(t){if(!t?.messageID)return;let n=document.querySelector(`[data-message-id="${t.messageID}"]`);n&&(n.scrollIntoView({behavior:"smooth",block:"center"}),n.classList.add("highlight-message"),setTimeout(()=>{n.classList.remove("highlight-message")},2e3))}loadPinnedMessages(){this.messageThreadID&&this.messageService.getPinnedMessages(this.teamID,this.messageThreadID,1,50).pipe(S(this.unsubscribe$)).subscribe({next:t=>{this.pinnedMessages=t.results||[],this.totalPinned=t.count||0},error:t=>{console.error("Failed to load pinned messages",t)}})}togglePinnedPanel(){this.showPinnedPanel=!this.showPinnedPanel}onPinnedMessageClicked(t){let n="messageID"in t?t.messageID:t.id;this.scrollToPinnedMessage({messageID:n})}onPinnedMessageUnpin(t){let n="messageID"in t?t.messageID:t.id;this.togglePinMessage({messageID:n})}togglePinMessage(t,n){if(n&&n.stopPropagation(),!t||!t.messageID||this.isPinningMessage||!this.messageThreadID)return;this.isPinningMessage=!0;let r=!this.isPinned(t);this.messageService.updateMessagePinStatus(this.teamID,this.messageThreadID,t.messageID,r).pipe(S(this.unsubscribe$)).subscribe({next:()=>{if(r){let c={messageID:t.messageID,text:t.text,file:t.file,fileName:t.fileName,sentClubUserID:t.sentClubUser?.clubUserID,sentClubUser:t.sentClubUser,sentDate:t.sentDate,isPinned:!0,isDeleted:t.isDeleted,pinnedDate:new Date,pinnedByClubUserID:this.currentClubUserID,pinnedByClubUser:null,quotedMessageID:t.quotedMessageID,quotedMessage:null};this.pinnedMessages.unshift(c),this.totalPinned++,this.siteDataService.showSiteSuccessAlert("Message pinned successfully.")}else this.pinnedMessages=this.pinnedMessages.filter(c=>c.messageID!==t.messageID),this.totalPinned=Math.max(0,this.totalPinned-1),this.siteDataService.showSiteSuccessAlert("Message unpinned.");this.isPinningMessage=!1},error:c=>{console.error("Failed to update pin status",c),this.siteDataService.showSiteErrorAlert("Failed to update pin status."),this.isPinningMessage=!1}})}isPinned(t){return this.pinnedMessages.some(n=>n.messageID===t.messageID)}scrollToPinnedMessage(t){let n=t.messageID;if(this.messages.find(c=>c.messageID===n)){let c=document.querySelector(`[data-message-id="${n}"]`);c&&(c.scrollIntoView({behavior:"smooth",block:"center"}),c.classList.add("highlight-message"),setTimeout(()=>{c.classList.remove("highlight-message")},2e3))}this.showPinnedPanel=!1}editMessage(t){t&&!t.isDeleted&&t.sentClubUserID===this.currentClubUserID&&(this.editingMessage=t,this.showEditModal=!0)}updateMessage(){this.siteDataService.showSiteErrorAlert("Message editing is not yet available for direct messages."),this.showEditModal=!1,this.editingMessage=void 0}deleteMessage(){!this.editingMessage||!this.editingMessage.messageID||(this.showEditModal=!1,this.messageService.markMessageAsDeleted(this.teamID,this.editingMessage).subscribe({next:t=>{this.handleDeletedMessage(t);let n=this.messageService.threads?.find(r=>r.messageThreadID===t.messageThreadID);n&&n.messages?.length&&n.messages[0].messageID===t.messageID&&(this.messageService.threads.find(r=>r.messageThreadID===t.messageThreadID).messages[0].isDeleted=!0),this.editingMessage=void 0},error:()=>this.siteDataService.showSiteErrorAlert("You don't have access to delete this message, or it has already been removed")}))}onPollCreated(t){return ut(this,null,function*(){if(!this.pollContext){this.siteDataService.showSiteErrorAlert("Poll context not initialized");return}try{let n={message:{},question:t.question,options:t.options,durationInDays:t.durationInDays}
2950,[r,c]=yield this.pollService.createPoll(this.pollContext,n);if(c&&c.messageID){r&&r.id&&this.pollCache.set(r.id,r);let h=this.messages.findIndex(b=>b.messageID===c.messageID);h>=0?(console.log("[POLL] Message already exists from polling, updating it"),this.messages[h]=c):this.messages.push(c)}this.getMessages(),this.siteDataService.showSiteSuccessAlert("Poll created successfully")}catch(n){this.siteDataService.showSiteErrorAlert("Unable to create poll")}})}openTitleEditModal(){this.messageThreadID&&(this.originalTitle=this.messageThread?.title||"",this.editingTitle=this.messageThread?.title||"",this.showTitleEditModal=!0)}updateTitle(){if(!this.editingTitle||this.editingTitle.trim().length===0)return;this.showSendingSpinner=!0;let t={messageThreadID:this.messageThreadID,title:this.editingTitle.trim()};this.messageService.updateMessageThreadSettings(this.teamID,t).subscribe({next:()=>{this.messageThread||(this.messageThread={messageThreadID:this.messageThreadID}),this.messageThread.title=this.editingTitle.trim(),this.messageService.messageThreadUpdated(this.messageThread),this.showSendingSpinner=!1,this.showTitleEditModal=!1},error:()=>{this.siteDataService.showSiteErrorAlert("Failed to update chat title"),this.showSendingSpinner=!1}})}cancelTitleEdit(){this.editingTitle="",this.showTitleEditModal=!1}loadReportReasons(){this.teamService.getMessageReportReasons().pipe(S(this.unsubscribe$)).subscribe({next:t=>{this.reportReasons=t},error:t=>{console.error("Failed to load report reasons",t)}})}openReportModal(t){if(t){if(t.sentClubUserID===this.currentClubUserID){this.siteDataService.showSiteErrorAlert("You cannot report your own message.");return}this.messageToReport=t,this.editingMessage=t,this.selectedReportReasonID=void 0,this.reportNotes="",this.reportSeverityRating=50,this.isReportModalVisible=!0,this.showEditModal=!0,this.cdr.detectChanges()}}submitReport(t){if(t){if(!this.editingMessage){this.showEditModal=!1;return}let r={zMessageReportReasonID:t.zMessageReportReasonID,notes:t.notes,severityRating:t.severityRating};this.teamService.reportTeamMessage(this.teamID,this.programID,this.editingMessage.messageID,r).pipe(S(this.unsubscribe$)).subscribe({next:()=>{this.showEditModal=!1,this.editingMessage=void 0,this.siteDataService.showSiteSuccessAlert("Message reported successfully. Thank you for helping keep our community safe.")},error:c=>{console.error("Failed to report message",c);let h="Failed to report message. Please try again.";typeof c?.error=="string"?h=c.error.replace(/^"|"$/g,""):c?.error?.message&&(h=c.error.message),this.siteDataService.showSiteErrorAlert(h)}});return}if(!this.selectedReportReasonID){this.siteDataService.showSiteErrorAlert("Please select a reason for reporting.");return}if(!this.messageToReport){this.isReportModalVisible=!1;return}this.isSubmittingReport=!0;let n={zMessageReportReasonID:this.selectedReportReasonID,notes:this.reportNotes||void 0,severityRating:this.reportSeverityRating};this.teamService.reportTeamMessage(this.teamID,this.programID,this.messageToReport.messageID,n).pipe(S(this.unsubscribe$)).subscribe({next:()=>{this.isSubmittingReport=!1,this.isReportModalVisible=!1,this.messageToReport=void 0,this.siteDataService.showSiteSuccessAlert("Message reported successfully. Thank you for helping keep our community safe.")},error:r=>{this.isSubmittingReport=!1,console.error("Failed to report message",r);let c="Failed to report message. Please try again.";typeof r?.error=="string"?c=r.error.replace(/^"|"$/g,""):r?.error?.message&&(c=r.error.message),this.siteDataService.showSiteErrorAlert(c)}})}cancelReport(){this.isReportModalVisible=!1,this.selectedReportReasonID=void 0,this.reportNotes="",this.reportSeverityRating=50,this.messageToReport=void 0,this.isSubmittingReport=!1}ngOnDestroy(){this.messageService.selectedRecipients=[],this.messageService.recipientList=[],this.messageService.messageThreadUpdated(void 0),this.unsubscribe$.next(),this.unsubscribe$.complete()}};d.\u0275fac=function(n){return new(n||d)(C(re),C(I),C(E),C(Pi),C(Ie),C(H),C(ae),C(ve),C(ft),C(Je))},d.\u0275cmp=D({type:d,selectors:[["app-message"]],viewQuery:function(n,r){if(n&1&&Te(Ou,5)(Bu,5),n&2){let c;se(c=le())&&(r.content=c.first),se(c=le())&&(r.uploadedFiles=c.first)}},standalone:!1,decls:24,vars:34,consts:[["messageContent",""],["editTitleInput",""],[1,"bg-grey-lt","full-height"],[3,"startConversation","toggleRecipientList","addParticipants","editTitle","messageThread","messages","re
2950cipientList","isRecipientListExpanded"],["id","messages-wrap",1,"bg-grey-lt","messages-wrap"],[3,"close","save","delete","pin","report","messageChange","isVisible","message","canEdit","canDelete","canPin","canReport","isSending","isPinning","reportReasons","messageType","showReportForm"],["header","Select Recipients","styleClass","standardWidthDialog",3,"visibleChange","visible","showHeader","closable","modal","draggable","contentStyle"],["header","Edit Chat Title","styleClass","standardWidthDialog mb-1",3,"visibleChange","visible","showHeader","closable","modal","draggable","contentStyle"],[3,"togglePanel","messageClicked","unpinClicked","pinnedMessages","totalPinned","showPanel"],[1,"conversation","m-0","pt-3","pr-3","pl-3","pb-0"],[3,"start","end"],[1,"message","row","mt-3","ml-0","mr-0",3,"ngClass"],[3,"replyClicked","editClicked","reactClicked","reactionTapped","pinClicked","deleteMessageClicked","reportClicked","messageTextClicked","messageReactionsClicked","quotedMessageClicked","voteSubmitted","refreshPollRequested","pollUpdated","isSender","firstName","lastName","isLastMessage","sentDate","messageID","currentClubUser","currentUserEmoji","messageText","file","fileName","isDeleted","wasEdited","reactions","isPinned","canEdit","canDelete","canPin","canReply","canReact","canReport","pollID","poll","pollContext","isRefreshing","quotedMessage"],[3,"firstName","lastName","id"],[1,"d-flex","justify-content-center","full-width"],[1,"text-grey-lt","text-smallest","nowrap"],[1,"spinner-wrap","full-width","center"],["role","status","aria-hidden","true",1,"spinner-border","spinner-border-sm"],[1,"message-footer","p-1"],[3,"sendMessage","deleteQuote","pollCreated","sendEnabled","clubUserMessageThreadType","quotedMessage"],[3,"modalClose","communicationType","modalView","teamID","programID","messageThreadID"],[1,"edit-form",3,"ngSubmit"],["type","text","placeholder","Enter conversation title","maxlength","50","name","titleValue",1,"form-control","mb-3",2,"width","100%",3,"ngModelChange","ngModel","disabled"],[1,"position-static","title-actions","d-flex","justify-content-end","flex-wrap","gap-2"],["type","button",1,"btn","btn-lg","btn-secondary",3,"click"],["type","submit",1,"btn","btn-lg","btn-primary",3,"disabled"],[1,"title-length-warning","text-danger"],[1,"spinner-border","spinner-border-sm","mr-2"],[1,"far","fa-save","mr-2"]],template:function(n,r){if(n&1){let c=y();s(0,"div",2),e(1,`
2951
2952    `),s(2,"app-message-header",3),v("startConversation",function(){return r.showModal=!0})("toggleRecipientList",function(b){return r.isRecipientListExpanded=b})("addParticipants",function(){return r.showModal=!0})("editTitle",function(){return r.openTitleEditModal()}),o(),e(3,`
2953
2954
2955
2956
2957
2958
2959
2960    `),e(4,`
2961    `),p(5,zu,3,3),s(6,"div",4,0),e(8,`
2962        `),p(9,Yu,7,1),o(),e(10,`
2963 `),p(11,Qu,6,3),s(12,"app-message-edit-bubble",5),v("close",function(){return g(c),r.showEditModal=!1,f(r.isReportModalVisible=!1)})("save",function(){return r.updateMessage()})("delete",function(){return r.deleteMessage()})("pin",function(b){return r.togglePinMessage(b)})("report",function(b){return r.submitReport(b)})("messageChange",function(b){return r.editingMessage=b}),e(13,`
2964    `),o(),e(14,`
2965`),o(),e(15,`
2966
2967`),s(16,"p-dialog",6),R("visibleChange",function(b){return g(c),P(r.showModal,b)||(r.showModal=b),f(b)}),e(17,`
2968    `),p(18,Ju,3,5),o(),e(19,`
2969
2970`),e(20,`
2971`),s(21,"p-dialog",7),R("visibleChange",function(b){return g(c),P(r.showTitleEditModal,b)||(r.showTitleEditModal=b),f(b)}),e(22,`
2972    `),p(23,e_,20,6),o()}n&2&&(l(2),_("messageThread",r.messageThread)("messages",r.messages)("recipientList",r.messageService.recipientList)("isRecipientListExpanded",r.isRecipientListExpanded),l(3),u((r.messages==null?null:r.messages.length)>0||r.totalPinned>0&&r.messageThreadID?5:-1),l(4),u(r.messages?9:-1),l(2),u((r.messageService.recipientList==null?null:r.messageService.recipientList.length)>0||r.messageThreadID?11:-1),l(),_("isVisible",r.showEditModal)("message",r.editingMessage)("canEdit",r.currentClubUserID===(r.editingMessage==null?null:r.editingMessage.sentClubUserID))("canDelete",r.currentClubUserID===(r.editingMessage==null?null:r.editingMessage.sentClubUserID))("canPin",!0)("canReport",r.currentClubUserID!==(r.editingMessage==null?null:r.editingMessage.sentClubUserID)&&(r.reportReasons==null?null:r.reportReasons.length)>0)("isSending",r.showSendingSpinner)("isPinning",r.isPinningMessage)("reportReasons",r.reportReasons)("messageType","direct")("showReportForm",r.isReportModalVisible),l(4),M("visible",r.showModal),_("showHeader",!0)("closable",!1)("modal",!0)("draggable",!1)("contentStyle",Q(32,Lo)),l(2),u(r.showModal?18:-1),l(3),M("visible",r.showTitleEditModal),_("showHeader",!0)("closable",!0)("modal",!0)("draggable",!1)("contentStyle",Q(33,Lo)),l(2),u(r.messageThreadID&&r.showTitleEditModal?23:-1))},dependencies:[ue,Fn,Ct,De,Rn,ni,Ee,kn,Ae,Mt,oe,Ga,Pt,Rt,kt,Vt,Ut,Ve],styles:[`.messages-wrap{height:calc(100vh - 400px);overflow-y:auto;overflow-x:hidden}.message-footer{position:relative}.message-footer.disabled{pointer-events:none;opacity:.6}
2973`],encapsulation:2});let a=d;return a})();var t_=["messageContent"],i_=["messageText"],n_=["editMessageText"],a_=["uploadedFiles"],o_=(a,d)=>({sender:a,"mb-3 ":d});function r_(a,d){if(a&1){let i=y();e(0,`
2974    `),s(1,"app-pinned-messages-panel",8),v("togglePanel",function(){g(i);let n=m();return f(n.togglePinnedPanel())})("messageClicked",function(n){g(i);let r=m();return f(r.scrollToPinnedMessage(n))})("unpinClicked",function(n){g(i);let r=m();return f(r.unpinMessage(n))}),o(),e(2,`
2975    `)}if(a&2){let i=m();l(),_("pinnedMessages",i.pinnedMessages)("totalPinned",i.totalPinned)("showPanel",i.showPinnedPanel)}}function s_(a,d){a&1&&(e(0,`
2976        `),s(1,"div",10),e(2,`
2977            `),x(3,"span",11),e(4,`
2978            `),s(5,"span"),e(6,"Loading older messages..."),o(),e(7,`
2979        `),o(),e(8,`
2980        `))}function l_(a,d){a&1&&(e(0,`
2981        `),s(1,"div",12),e(2,`
2982            `),s(3,"span"),e(4,"Scroll up to load more"),o(),e(5,`
2983        `),o(),e(6,`
2984        `))}function d_(a,d){a&1&&(e(0,`
2985        `),s(1,"div",14),e(2,`
2986            `),x(3,"span",15),e(4,`
2987            `),s(5,"span",16),e(6,"New Messages"),o(),e(7,`
2988            `),x(8,"span",15),e(9,`
2989        `),o(),e(10,`
2990        `))}function m_(a,d){if(a&1&&(e(0,`
2991        `),x(1,"app-message-time-tag",17),e(2,`
2992        `)),a&2){let i=m(),t=i.$implicit,n=i.$index,r=m(2);l(),_("start",t.savedOn)("end",n>0?r.messages[n-1].savedOn:null)}}function c_(a,d){if(a&1&&(e(0,`
2993                `),x(1,"app-user-initials",19),e(2,`
2994                `)),a&2){let i=m(3).$implicit;l(),_("firstName",i==null?null:i.firstName)("lastName",i==null?null:i.lastName)("id",i.savedBy)}}function p_(a,d){if(a&1&&(e(0,`
2995                `),x(1,"div",20),N(2,"safeStyle"),e(3,`
2996                `)),a&2){let i=m(5);l(),Sn("background-image",xe(2,2,"url("+i.logoURL+")"))}}function u_(a,d){if(a&1&&(e(0,`
2997                `),p(1,c_,3,3),p(2,p_,4,4)),a&2){let i=m(2).$implicit,t=m(2);l(),u(i.isClubMessage?-1:1),l(),u(t.logoURL&&i.isClubMessage?2:-1)}}function __(a,d){if(a&1){let i=y();e(0,`
2998            `),s(1,"app-message-bubble",18),N(2,"utcDate"),v("replyClicked",function(){g(i);let n=m().$implicit,r=m(2);return f(r.replyToMessage(n))})("reactClicked",function(n){g(i);let r=m().$implicit,c=m(2);return f(c.reactionClicked(n,r))})("reactionTapped",function(n){g(i);let r=m().$implicit,c=m(2);return f(c.reactionClicked(n,r))})("pinClicked",function(){g(i);let n=m().$implicit,r=m(2);return f(r.togglePinMessage(n))})("editClicked",function(){g(i);let n=m().$implicit,r=m(2);return f(r.editMessage(n))})("deleteMessageClicked",function(){g(i);let n=m().$implicit,r=m(2);return r.editingMessage=n,f(r.deleteMessage())})("reportClicked",function(){g(i);let n=m().$implicit,r=m(2);return f(r.openReportModal(n))})("quotedMessageClicked",function(){g(i);let n=m().$implicit,r=m(2);return f(r.scrollToQuotedMessage(n.quotedMessage))})("voteSubmitted",function(n){g(i);let r=m().$implicit,c=m(2);return f(c.onPollVote(r.pollID,n,r.id))})("refreshPollRequested",function(){g(i);let n=m().$implicit,r=m(2);return f(r.onPollRefresh(n.pollID))})("pollUpdated",function(n){g(i);let r=m(3);return f(r.onPollUpdated(n))}),e(3,`
2999                `),p(4,u_,3,2),o(),e(5,`
3000            `)}if(a&2){let i=m(),t=i.$implicit,n=i.$index,r=i.$count,c=m(2);l(),_("messageTypeID",t.messageTypeID)("isSender",c.isSender(t))("firstName",t.firstName)("lastName",t.lastName)("isLastMessage",n===r-1)("isClubMessage",t.isClubMessage)("sentDate",t.savedBy===(c.messages[n-1]==null?null:c.messages[n-1].savedBy)&&c.getTimeBetweenDates(c.messages[n-1]==null?null:c.messages[n-1].savedOn,t.savedOn)<120?"":B(2,31,t.savedOn,"h:mm a"))("messageID",t.id)("currentClubUser",c.currentClubUser)("messageText",t.message)("file",t.file)("fileName",t.fileName)("isDeleted",t.isDeleted)("wasEdited",t.w
3000asEdited)("reactions",t.reactions)("isPinned",t.isPinned)("currentUserEmoji",c.getUserReactionEmoji(t))("canEdit",c.currentClubUserID===t.savedBy&&!t.isDeleted)("canDelete",c.adminView||c.currentClubUserID===t.savedBy&&!t.isDeleted||c.currentClubUser[c.Permission.DeleteTeamMessages])("canPin",!0)("canReply",!0)("canReact",!t.isClubMessage)("canReport",c.canReportMessages&&c.currentClubUserID!==t.savedBy&&!t.isClubMessage)("pollID",t.pollID)("poll",c.getPoll(t.pollID))("pollContext",c.pollContext)("isRefreshing",c.isRefreshingPoll(t.pollID))("pollStatusMessage",c.getPollStatusMessage(t.pollID))("quotedMessage",t.quotedMessage)("hideName",t.isClubMessage),l(3),u(c.currentClubUser.clubUserID!==t.savedBy||t.isClubMessage?4:-1)}}function h_(a,d){if(a&1&&(e(0,`
3001            `),s(1,"div",21),e(2,`
3002                `),s(3,"em",22),e(4),o(),e(5,`
3003            `),o(),e(6,`
3004            `)),a&2){let i=m().$implicit;l(4),T(i.message)}}function g_(a,d){if(a&1&&(e(0,`
3005        `),e(1,`
3006        `),p(2,d_,11,0),p(3,m_,3,2),s(4,"div",13),e(5,`
3007            `),p(6,__,6,34),p(7,h_,7,1),o(),e(8,`
3008        `)),a&2){let i=d.$implicit,t=d.$index,n=d.$count,r=m(2);l(2),u(t===r.lastReadIndex&&r.lastReadIndex>0?2:-1),l(),u(r.shouldShowTimeTag(i,t)!==null||t===0?3:-1),l(),_("ngClass",pe(6,o_,r.currentClubUserID===i.savedBy&&!i.isClubMessage,t!==n-1)),ye("data-message-id",i.id),l(2),u(!i.messageTypeID||i.messageTypeID===r.MessageType.DEFAULT?6:-1),l(),u(i.messageTypeID===r.MessageType.THREAD_PARTICIPANT_CHANGE||i.messageTypeID===r.MessageType.MESSAGE_PINNED?7:-1)}}function f_(a,d){a&1&&(e(0,`
3009        `),s(1,"div",23),e(2,`
3010            `),x(3,"span",24),e(4,`
3011        `),o(),e(5,`
3012        `))}function x_(a,d){if(a&1){let i=y();e(0,`
3013    `),s(1,"div",9,0),v("click",function(){g(i);let n=m();return f(n.closeReactionPicker())})("scroll",function(n){g(i);let r=m();return f(r.onScroll(n))}),e(3,`
3014        `),e(4,`
3015        `),p(5,s_,9,0),p(6,l_,7,0),F(7,g_,9,9,null,null,ti().trackByMessageId,!0),p(9,f_,6,0),o(),e(10,`
3016    `)}if(a&2){let i=m();l(5),u(i.isLoadingMore?5:-1),l(),u(i.hasMoreMessages&&!i.isLoadingMore?6:-1),l(),V(i.messages),l(2),u(i.showSendingSpinner?9:-1)}}var qo=(()=>{let d=class d{constructor(t,n,r,c,h,b,k,te,$e,Xe){this.messageService=t,this.route=n,this.siteDataService=r,this.authorizeService=c,this.teamService=h,this.router=b,this.pollService=k,this.lastReadService=te,this.changeDetectorRef=$e,this.userService=Xe,this.unsubscribe$=new U,this.initialLoadComplete=!1,this.messages=[],this.reactingMessageIds=new Set,this.showSendingSpinner=!1,this.ClubUserMessageThreadType=lt,this.timer=_t(2e4),this.adminView=!1,this.editingMessage=void 0,this.showEditModal=!1,this.getTimeBetweenDates=bt,this.MessageType=st,this.Permission=W,this.canReportMessages=!0,this.isReportModalVisible=!1,this.reportReasons=[{id:1,description:"Bullying/Harassment"},{id:2,description:"Inappropriate Language"},{id:3,description:"Threatening Behavior"},{id:4,description:"Other"}],this.reportNotes="",this.reportSeverityRating=50,this.isSubmittingReport=!1,this.ReactionType=je,this.showReactionPicker=!1,this.reactionPickerMessageId=null,this.reactionIcons={[je.HEART]:{icon:"fas fa-heart",label:"Love"},[je.THUMBS_UP]:{icon:"fas fa-thumbs-up",label:"Like"},[je.HAPPY]:{icon:"fas fa-smile",label:"Happy"},[je.ALERT]:{icon:"fas fa-exclamation-triangle",label:"Alert"},[je.SAD]:{icon:"fas fa-sad-tear",label:"Sad"}},this.pinnedMessages=[],this.totalPinned=0,this.showPinnedPanel=!1,this.isPinningMessage=!1,this.replyingToMessage=null,this.quotedMessage=null,this.page=1,this.rows=50,this.totalMessages=0,this.isLoadingMore=!1,this.hasMoreMessages=!0,this.isSameDay=ri,this.lastViewed=null,this.lastReadIndex=-1,this.showGifPicker=!1,this.selectedFile=null,this.selectedGIF=null,this.selectedFileURL=null,this.acceptedFileTypes=li,this.maxFileSizeBytes=di,this.pollCache=new Map,this.refreshingPolls=new Set,this.pollStatusMessages=new Map,this.pollRetryAttempts=new Map,this.inboxTestLoading=!1,this.inboxTestResult=null,this.cachedSeverityLabel="",this.cachedSeverityRating=-1}testInboxApi(){this.inboxTestLoading=!0,this.inboxTestResult=null,this.teamService.test().pipe(S(this.unsubscribe$)).subscribe({next:t=>{this.inboxTestResult=JSON.stringify(t,null,2),this.inboxTestLoading=!1},error:t=>{this.inboxTestResult="ERROR: "+JSON.stringify(t,null,2),this.inboxTestLoading=!1}})}
3016ngOnInit(){let t=this.route.snapshot.parent;this.teamID=t?+t.params.id:null,this.programID=t?+t.params.programID:null,this.adminView=t?.data?.adminView??!1,this.pollContext=Ai.createTeamContext(this.teamID,this.programID),this.initializeLastViewed(),this.authorizeService.getUser().subscribe(n=>{n&&(this.currentClubUserID=+n.userID,this.currentClubUser=n)}),console.log("[DEBUG] TeamMessageComponent ngOnInit, teamID:",this.teamID,"programID:",this.programID),this.getMessages(!0),this.clearTeamNotifications(),this.messageService.teamThread$.pipe(S(this.unsubscribe$),xn(1),tt(n=>n===!0)).subscribe(()=>{this.getMessages(!0)}),this.timer.pipe(S(this.unsubscribe$)).subscribe({next:()=>{this.checkForNewMessages()}}),this.siteDataService.getClubSettings().subscribe({next:n=>{this.logoURL=n.theme.logoURL,this.siteDataService.hideSiteLoader()}}),this.adminView&&(this.canReportMessages=!0,this.loadReportReasons()),this.loadPinnedMessages()}getMessages(t=!1){t&&(this.page=1,this.hasMoreMessages=!0),this.teamService.getTeamMessages(this.teamID,this.programID,this.page,this.rows).pipe(S(this.unsubscribe$)).subscribe(n=>{let r=this.messages.length;if(this.totalMessages=n.count,t||this.page===1){this.messages=n.results;let c=this.messages.filter(h=>h.pollID).map(h=>h.pollID);c.length>0?this.waitForPollsToLoad(c).subscribe({next:()=>{t&&this.lastViewed&&this.calculateLastReadIndex(),this.doScrollToBottom()}}):(t&&this.lastViewed&&this.calculateLastReadIndex(),this.doScrollToBottom())}this.messages.length<this.totalMessages&&this.doScrollToBottom(),t&&this.updateLastViewed()})}isSender(t){return this.currentClubUserID===t.savedBy&&!t.isClubMessage}loadMoreMessages(){if(this.isLoadingMore||!this.hasMoreMessages)return;this.isLoadingMore=!0,this.page++;let t=this.content?.nativeElement,n=t?.scrollHeight||0;this.teamService.getTeamMessages(this.teamID,this.programID,this.page,this.rows).pipe(S(this.unsubscribe$)).subscribe({next:r=>{let c=r.results.length;this.messages=[...r.results,...this.messages],this.totalMessages=r.count,this.hasMoreMessages=this.messages.length<this.totalMessages,setTimeout(()=>{if(t){let h=t.scrollHeight;t.scrollTop=h-n}this.isLoadingMore=!1},50)},error:()=>{this.isLoadingMore=!1}})}onScroll(t){}shouldShowTimeTag(t,n){if(n===0)return null;let r=this.messages[n-1];if(!r)return null;let c=new Date(t.savedOn),h=new Date(r.savedOn);return this.isSameDay(c,h)?null:h}checkForNewMessages(){this.teamService.getTeamMessages(this.teamID,this.programID,1,10).pipe(S(this.unsubscribe$)).subscribe(t=>{if(t.results?.length){let n=new Set(this.messages.filter(c=>c.id>0).map(c=>c.id)),r=t.results.filter(c=>c.id&&!n.has(c.id));if(r.length>0){let c=r.filter(b=>!this.messages.some(k=>k.id===b.id));c.length>0&&(console.log("[POLL] Adding messages from polling:",{count:c.length,ids:c.map(b=>b.id),totalBefore:this.messages.length,totalAfter:this.messages.length+c.length}),this.messages.push(...c)),this.totalMessages=t.count,this.clearTeamNotifications();let h=c.filter(b=>b.pollID).map(b=>b.pollID);h.length>0?this.waitForPollsToLoad(h).subscribe({next:()=>{this.doScrollToBottom()}}):this.doScrollToBottom()}}})}clearTeamNotifications(){this.teamID&&this.userService.getUserNotifications().pipe(S(this.unsubscribe$),et(t=>t?.filter(n=>Nn.includes(n.zNotificationTypeID)&&n.dataID===this.teamID)),tt(t=>!!t?.length),ht(t=>{let n=t.map(r=>r.clubUserNotificationID);return this.userService.markNotificationsAsViewed(n)})).subscribe()}initializeLastViewed(){this.threadKey=this.lastReadService.getThreadKey("team",this.teamID,[this.programID]),this.lastViewed=this.lastReadService.getLastViewed(this.threadKey)}updateLastViewed(){this.lastReadService.updateLastViewed(this.threadKey)}calculateLastReadIndex(){this.lastReadIndex=this.lastReadService.calculateLastReadIndex(this.messages,this.lastViewed,t=>new Date(t.savedOn))}ngAfterViewInit(){}editMessage(t){this.adminView&&!t.isDeleted&&(this.editingMessage=t,this.showEditModal=!0)}deleteMessage(){this.showEditModal=!1,this.teamService.markTeamMessageAsDeleted(this.teamID,this.programID,this.editingMessage).subscribe({next:t=>{this.messages.find(n=>n.id===t.id).isDeleted=!0,this.editingMessage=void 0,this.messageService.teamThread&&this.messageService.teamThread.id===t.id&&(this.messageService.teamThread.isDeleted=!0),this.showEditModal=!1},error:()=>this.siteDataService.showSiteErrorAlert("You don't have access to delete this message")})}updateMessage(){this.showSendingSpinner=!0,this.teamService.updateTeamMessage(this.teamID,this.programID,this.editingMessage).subscribe({next:t=>{let n=this.messages.findIndex(r=>
3016r.id===t.id);this.messages[n].message=t.message,this.messages[n].file=t.file,this.messages[n].wasEdited=!0,this.editingMessage=void 0,this.messageService.teamThread&&this.messageService.teamThread.id===t.id&&(this.messageService.teamThread.message=t.message),this.showSendingSpinner=!1,this.showEditModal=!1},error:()=>this.siteDataService.showSiteErrorAlert("You don't have access to edit this message")})}sendMessage(){return ut(this,null,function*(){if(!(!this.inputValue&&!this.selectedFile&&!this.selectedGIF))if(this.showSendingSpinner=!0,this.doScrollToBottom(),this.selectedFile||this.selectedGIF){let t=new FormData;if(this.inputValue&&t.append("message",this.inputValue),this.replyingToMessage&&t.append("quotedMessageID",this.replyingToMessage.id.toString()),this.selectedFile)t.append(this.selectedFile.name,this.selectedFile,this.selectedFile.name);else if(this.selectedGIF)try{let r=yield(yield fetch(this.selectedGIF)).blob();t.append("giphy.gif",r,"giphy.gif")}catch(n){console.error("Error fetching GIF blob:",n),this.showSendingSpinner=!1,this.siteDataService.showSiteErrorAlert("Failed to upload GIF. Please try again.");return}this.messageService.createTeamMessageWithAttachment(this.teamID,this.programID,t).subscribe({next:n=>{this.messages.push(n),this.showSendingSpinner=!1,this.messageTxt.nativeElement.value="",this.inputValue="",this.removeAttachment(),this.cancelReply()},error:n=>{this.showSendingSpinner=!1,console.error("Failed to send message with attachment",n),this.siteDataService.showSiteErrorAlert("Failed to send message. Please try again.")}})}else{let t=new Et;t.message=this.inputValue,this.replyingToMessage&&this.quotedMessage&&(t.quotedMessageID=this.replyingToMessage.id,t.quotedMessage=this.quotedMessage),this.messageService.createTeamMessage(this.teamID,this.programID,t).subscribe({next:n=>{this.messages.push(n),this.showSendingSpinner=!1,this.messageTxt.nativeElement.value="",this.inputValue="",this.cancelReply()},error:n=>{this.showSendingSpinner=!1,console.error("Failed to send message",n),this.siteDataService.showSiteErrorAlert("Failed to send message. Please try again.")}})}})}handleSendMessage(t){return ut(this,null,function*(){if(t&&!(!t.text&&!t.blob&&!t.selectedFileURL))if(this.showSendingSpinner=!0,this.doScrollToBottom(),t.blob||t.selectedFileURL){let n=new FormData;if(t.text&&n.append("message",t.text),this.replyingToMessage&&n.append("quotedMessageID",this.replyingToMessage.id.toString()),t.blob){let r=t.fileName||`file.${t.format||"png"}`;n.append(r,t.blob,r)}this.messageService.createTeamMessageWithAttachment(this.teamID,this.programID,n).subscribe({next:r=>{console.log("[SEND] Adding message from attachment endpoint:",{id:r.id,text:r.message,totalInArray:this.messages.length+1});let c=this.messages.findIndex(h=>h.id===r.id);c>=0?(console.log("[SEND] Message already exists from polling, updating it"),this.messages[c]=r):this.messages.push(r),this.showSendingSpinner=!1,this.cancelReply(),this.doScrollToBottom()},error:r=>{this.showSendingSpinner=!1,console.error("Failed to send message with attachment",r),this.siteDataService.showSiteErrorAlert("Failed to send message. Please try again.")}})}else{let n=new Et;n.message=t.text,this.replyingToMessage&&this.quotedMessage&&(n.quotedMessageID=this.replyingToMessage.id,n.quotedMessage=this.quotedMessage),this.messageService.createTeamMessage(this.teamID,this.programID,n).subscribe({next:r=>{console.log("[SEND] Adding message from text endpoint:",{id:r.id,text:r.message,totalInArray:this.messages.length+1});let c=this.messages.findIndex(h=>h.id===r.id);c>=0?(console.log("[SEND] Message already exists from polling, updating it"),this.messages[c]=r):this.messages.push(r),this.showSendingSpinner=!1,this.cancelReply(),this.doScrollToBottom()},error:r=>{this.showSendingSpinner=!1,this.siteDataService.showSiteErrorAlert("Failed to send message. Please try again.")}})}})}onFileSelected(t){let n=t.target;if(n.files&&n.files.length>0){let r=n.files[0];if(r.size>this.maxFileSizeBytes){this.siteDataService.showSiteErrorAlert(`File size exceeds the limit of ${this.maxFileSizeBytes/(1024*1024)}MB.`);return}this.selectedFile=r,this.selectedFileURL=URL.createObjectURL(r),this.selectedGIF=null}}onGifSelected(t){this.selectedGIF=t,this.selectedFileURL=t,this.selectedFile=null,this.showGifPicker=!1}removeAttachment(){this.selectedFileURL&&this.selectedFile&&URL.revokeObjectURL(this.selectedFileURL),this.selectedFile=null,this.selectedGIF=null,this.selectedFileURL=null}handlePaste(t){let n=t.clipboardData?.items;if(n)for(let r=0;r<n.length;r++){let c=n[r];if(c.type.indexOf("image")===0){let h=c.getAsFile();if(h){if(h.size>this.maxFileSizeBytes){this.siteDataService.showSiteErrorAlert(`File size exceeds the limit of ${this.maxFileSizeBytes/(1024*1024)}MB.`);return}let b=h.type?.split("/")[1]||"png",k=`pasted-image-${Da()}.${b}`;this.selectedFile=new File([h],k,{type:h.type}),this.selectedFileURL=URL.createObjectURL(this.selectedFile),this.selectedGIF=null,t.preventDefault();break}}}}messageSize(t){return typeof t=="number"&&(t=t.toString()),t.length}doScrollToBottom(){setTimeout(()=>{let t=document.getElementById("messages-wrap");window.scrollTo(0,document.body.scrollHeight),t.scrollTo({top:t.scrollHeight,behavior:"instant"})},500)}loadReportReasons(){this.teamService.getMessageReportReasons().pipe(S(this.unsubscribe$)).subscribe({next:t=>{this.reportReasons=t},error:t=>{console.error("Failed to load report reasons",t)}})}openReportModal(t){if(t){if(t.savedBy===this.currentClubUserID){this.siteDataService.showSiteErrorAlert("You cannot report your own message.");return}if(t.isClubMessage){this.siteDataService.showSiteErrorAlert("Club announcements cannot be reported.");return}this.messageToReport=t,this.editingMessage=t,this.selectedReportReasonID=void 0,this.reportNotes="",this.reportSeverityRating=50,this.isReportModalVisible=!0,this.showEditModal=!0,this.changeDetectorRef.detectChanges()}}get severityLabel(){return this.cachedSeverityRating===this.reportSeverityRating?this.cachedSeverityLabel:(this.reportSeverityRating>=90?this.cachedSeverityLabel="Critical":this.reportSeverityRating>=70?this.cachedSeverityLabel="High":this.reportSeverityRating>=50?this.cachedSeverityLabel="Moderate":this.reportSeverityRating>=25?this.cachedSeverityLabel="Low":this.cachedSeverityLabel="Informational",this.cachedSeverityRating=this.reportSeverityRating,this.cachedSeverityLabel)}submitReport(t){if(t){if(!this.editingMessage){this.showEditModal=!1;return}let r={zMessageReportReasonID:t.zMessageReportReasonID,notes:t.notes,severityRating:t.severityRating};this.teamService.reportTeamMessage(this.teamID,this.programID,this.editingMessage.id,r).pipe(S(this.unsubscribe$)).subscribe({next:()=>{this.showEditModal=!1,this.editingMessage=void 0,this.siteDataService.showSiteSuccessAlert("Message reported successfully. Thank y
3016ou for helping keep our community safe.")},error:c=>{console.error("Failed to report message",c);let h="Failed to report message. Please try again.";typeof c?.error=="string"?h=c.error.replace(/^"|"$/g,""):c?.error?.message&&(h=c.error.message),this.siteDataService.showSiteErrorAlert(h)}});return}if(!this.selectedReportReasonID){this.siteDataService.showSiteErrorAlert("Please select a reason for reporting.");return}if(!this.messageToReport){this.isReportModalVisible=!1;return}this.isSubmittingReport=!0;let n={zMessageReportReasonID:this.selectedReportReasonID,notes:this.reportNotes||void 0,severityRating:this.reportSeverityRating};this.teamService.reportTeamMessage(this.teamID,this.programID,this.messageToReport.id,n).pipe(S(this.unsubscribe$)).subscribe({next:()=>{this.isSubmittingReport=!1,this.isReportModalVisible=!1,this.messageToReport=void 0,this.siteDataService.showSiteSuccessAlert("Message reported successfully. Thank you for helping keep our community safe.")},error:r=>{this.isSubmittingReport=!1,console.error("Failed to report message",r);let c="Failed to report message. Please try again.";typeof r?.error=="string"?c=r.error.replace(/^"|"$/g,""):r?.error?.message&&(c=r.error.message),this.siteDataService.showSiteErrorAlert(c)}})}cancelReport(){this.isReportModalVisible=!1,this.selectedReportReasonID=void 0,this.reportNotes="",this.reportSeverityRating=50,this.messageToReport=void 0,this.isSubmittingReport=!1}toggleReactionPicker(t,n){n&&n.stopPropagation(),this.reactionPickerMessageId===t?(this.showReactionPicker=!1,this.reactionPickerMessageId=null):(this.showReactionPicker=!0,this.reactionPickerMessageId=t)}closeReactionPicker(){this.showReactionPicker=!1,this.reactionPickerMessageId=null}getUserReactionEmoji(t){let n=this.getUserReaction(t);return n?Ne(n):void 0}getUserReaction(t){if(!(!t.reactions||!this.currentClubUserID))return t.reactions.find(n=>n.savedBy===this.currentClubUserID)}reactionClicked(t,n){if(!n||!n.id||n.isClubMessage||this.reactingMessageIds.has(n.id))return;this.closeReactionPicker();let r=this.getUserReaction(n);this.reactingMessageIds.add(n.id);let c=()=>{this.reactingMessageIds.delete(n.id)};if(r)if(Ne(r)===t)this.teamService.deleteTeamMessageReaction(this.teamID,r.id).pipe(S(this.unsubscribe$),we(c)).subscribe({next:()=>{let h=this.messages.find(b=>b.id===n.id);h&&(h.reactions=h.reactions.filter(b=>b.id!==r.id))},error:()=>{this.siteDataService.showSiteErrorAlert("Failed to remove reaction.")}});else{let h=new tn;h.teamMessageID=n.id,h.emoji=t,this.teamService.updateTeamMessageReaction(this.teamID,r.id,h).pipe(S(this.unsubscribe$),we(c)).subscribe({next:()=>{let b=this.messages.find(k=>k.id===n.id);if(b){let k=b.reactions.find(te=>te.id===r.id);k&&(k.emoji=t)}},error:()=>{this.siteDataService.showSiteErrorAlert("Failed to update reaction.")}})}else{let h=new tn;h.teamMessageID=n.id,h.emoji=t,this.teamService.reactToTeamMessage(this.teamID,h).pipe(S(this.unsubscribe$),we(c)).subscribe({next:b=>{let k=this.messages.find(te=>te.id===n.id);k&&(k.reactions||(k.reactions=[]),k.reactions.push(b))},error:()=>{this.siteDataService.showSiteErrorAlert("Failed to add reaction.")}})}}loadPinnedMessages(){this.teamService.getPinnedTeamMessages(this.teamID,this.programID,1,50).pipe(S(this.unsubscribe$)).subscribe({next:t=>{this.pinnedMessages=t.results||[],this.totalPinned=t.count||0},error:t=>{console.error("Failed to load pinned messages",t)}})}togglePinnedPanel(){this.showPinnedPanel=!this.showPinnedPanel}togglePinMessage(t,n){if(n&&n.stopPropagation(),!t||!t.id||this.isPinningMessage)return;this.isPinningMessage=!0;let r=!t.isPinned;this.teamService.updateMessagePinStatus(this.teamID,this.programID,t.id,r).pipe(S(this.unsubscribe$)).subscribe({next:c=>{let h=this.messages.find(b=>b.id===t.id);h&&(h.isPinned=r,h.pinnedDate=c.pinnedDate,h.pinnedByClubUserID=c.pinnedByClubUserID),r?(this.loadPinnedMessages(),this.siteDataService.showSiteSuccessAlert("Message pinned successfully.")):(this.pinnedMessages=this.pinnedMessages.filter(b=>("messageID"in b?b.messageID:b.id)!==t.id),this.totalPinned=Math.max(0,this.totalPinned-1),this.siteDataService.showSiteSuccessAlert("Message unpinned.")),this.isPinningMessage=!1,this.showEditModal=!1},error:c=>{console.error("Failed to update pin status",c),this.siteDataService.showSiteErrorAlert("Failed to update pin status."),this.isPinningMessage=!1}})}unpinMessage(t,n){if(n&&n.stopPropagation(),!t||this.isPinningMessage)return;let r="messageID"in t?t.messageID:t.id;r&&(this.isPinningMessage=!0,this.teamService.updateMessagePinStatus(this.teamID,this.programID,r,!1).pipe(S(this.unsubscribe$)).subscribe({next:()=>{let c=this.messages.find(h=>h.id===r);c&&(c.isPinned=!1,c.pinnedDate=null,c.pinnedByClubUserID=null),this.pinnedMessages=this.pinnedMessages.filter(h=>("messageID"in h?h.messageID:h.id)!==r),this.totalPinned=Math.max(0,this.totalPinned-1),this.siteDataService.showSiteSuccessAlert("Message unpinned."),this.isPinningMessage=!1},error:c=>{console.error("Failed to unpin message",c),this.siteDataService.showSiteErrorAlert("Failed to unpin message."),this.isPinningMessage=!1}}))}scrollToPinnedMessage(t){let n="messageID"in t?t.messageID:t.id;if(this.messages.find(c=>c.id===n)){let c=document.querySelector(`[data-message-id="${n}"]`);c&&(c.scrollIntoView({behavior:"smooth",block:"center"}),c.classList.add("highlight-message"),setTimeout(()=>{c.classList.remove("highlight-message")},2e3))}this.showPinnedPanel=!1}replyToMessage(t,n){n&&n.stopPropagation(),!(!t||t.isDeleted)&&(this.replyingToMessage=t,this.quotedMessage=Et.createQuotedMessage(t),this.showEditModal=!1,setTimeout(()=>{this.messageTxt?.nativeElement&&this.messageTxt.nativeElement.focus()},100))}cancelReply(){this.replyingToMessage=null,this.quotedMessage=null}scrollToQuotedMessage(t){if(!t?.messageID)return;let n=document.querySelector(`[data-message-id="${t.messageID}"]`);n&&(n.scrollIntoView({behavior:"smooth",block:"center"}),n.classList.add("highlight-message"),setTimeout(()=>{n.classList.remove("highlight-message")},2e3))}waitForPollsToLoad(t){if(!t||t.length===0)return Z(void 0);let n=t.filter(c=>!this.pollCache.has(c)&&!this.refreshingPolls.has(c));if(n.length===0)return Z(void 0);let r=n.map(c=>new Promise(h=>{if(this.pollCache.has(c)){h();return}this.refreshingPolls.add(c),this.pollService.getPoll(this.pollContext,c).pipe(S(this.unsubscribe$)).subscribe({next:b=>{this.pollCache.set(c,b),this.refreshingPolls.delete(c),h()},error:()=>{this.refreshingPolls.delete(c),h()}})}));
3016return _n(Promise.all(r)).pipe(et(()=>{}))}getPoll(t){return this.pollCache.get(t)}isRefreshingPoll(t){return this.refreshingPolls.has(t)}getPollStatusMessage(t){return this.pollStatusMessages.get(t)}loadPoll(t){!t||this.pollCache.has(t)||this.refreshingPolls.has(t)||(this.refreshingPolls.add(t),this.pollService.getPoll(this.pollContext,t).pipe(S(this.unsubscribe$)).subscribe({next:n=>{this.pollCache.set(t,n),this.refreshingPolls.delete(t),this.changeDetectorRef.detectChanges()},error:()=>{this.refreshingPolls.delete(t)}}))}onPollRefresh(t,n=0,r=3){t&&(this.refreshingPolls.add(t),this.pollRetryAttempts.set(t,n),n===0?this.pollStatusMessages.set(t,"Fetching poll results..."):this.pollStatusMessages.set(t,`Waiting for server response... (attempt ${n+1}/${r+1})`),this.pollService.getPoll(this.pollContext,t).pipe(S(this.unsubscribe$)).subscribe({next:c=>{let h=this.pollCache.get(t);if(!(JSON.stringify(h)!==JSON.stringify(c))&&n<r&&h){this.pollStatusMessages.set(t,`Poll processing on server... retry ${n+1}/${r}`),setTimeout(()=>{this.onPollRefresh(t,n+1,r)},1e3);return}this.pollCache.set(t,c),this.refreshingPolls.delete(t),this.pollStatusMessages.delete(t),this.pollRetryAttempts.delete(t),this.changeDetectorRef.detectChanges()},error:c=>{this.refreshingPolls.delete(t),this.pollStatusMessages.set(t,"Error loading poll results"),this.changeDetectorRef.detectChanges(),setTimeout(()=>{this.pollStatusMessages.delete(t),this.changeDetectorRef.detectChanges()},3e3)}}))}onPollVote(t,n,r){this.pollService.voteInPoll(this.pollContext,{pollId:t,pollOptionId:n,messageId:r||0}).pipe(S(this.unsubscribe$)).subscribe({next:()=>{this.onPollRefresh(t)},error:c=>{console.error("Error voting in poll:",c),this.onPollRefresh(t)}})}onPollUpdated(t){if(t?.id){let n=this.pollCache.get(t.id);this.pollCache.set(t.id,t),this.changeDetectorRef.detectChanges(),this.isLastMessagePoll(t.id)&&this.doScrollToBottom()}}isLastMessagePoll(t){return!this.messages||this.messages.length===0?!1:this.messages[this.messages.length-1]?.pollID===t}trackByMessageId(t,n){return n.id||t}trackByPinnedId(t,n){return n.id||t}trackByReactionType(t,n){return n.typeId}onPollCreated(t){return ut(this,null,function*(){if(!this.pollContext){this.siteDataService.showSiteErrorAlert("Poll context not initialized");return}try{let n={message:{},question:t.question,options:t.options,durationInDays:t.durationInDays},[r,c]=yield this.pollService.createPoll(this.pollContext,n);if(c&&c.id){r&&r.id&&this.pollCache.set(r.id,r);let h=this.messages.findIndex(b=>b.id===c.id);h>=0?(console.log("[POLL] Message already exists from polling, updating it"),this.messages[h]=c):this.messages.push(c),this.messages=[...this.messages],this.doScrollToBottom()}this.siteDataService.showSiteSuccessAlert("Poll created successfully")}catch(n){this.siteDataService.showSiteErrorAlert("Unable to create poll")}})}ngOnDestroy(){this.updateLastViewed(),this.lastReadService.cleanupScrollingState(this.threadKey),this.messageService.loadTeamThread(!1),this.unsubscribe$.next(),this.unsubscribe$.complete()}};d.\u0275fac=function(n){return new(n||d)(C(re),C(I),C(E),C(ae),C(Je),C(H),C(Pi),C(Ya),C(ft),C(ve))},d.\u0275cmp=D({type:d,selectors:[["app-team-message"]],viewQuery:function(n,r){if(n&1&&Te(t_,5)(i_,5)(n_,5)(a_,5),n&2){let c;se(c=le())&&(r.content=c.first),se(c=le())&&(r.messageTxt=c.first),se(c=le())&&(r.editMessageTxt=c.first),se(c=le())&&(r.uploadedFiles=c.first)}},standalone:!1,decls:24,vars:21,consts:[["messageContent",""],[1,"interior-message-view","bg-grey-lt","full-height"],[1,"recipient-list-wrapper","row","m-0","p-3"],[1,"recipientList"],[1,"full-width","title"],[1,"message-footer"],[3,"pollCreated","sendMessage","deleteQuote","sendEnabled","canAddPoll","clubUserMessageThreadType","quotedMessage","showQuotePreview","showFileUpload","showGifUpload","messageLimit"],[3,"close","save","delete","pin","report","messageChange","isVisible","message","canEdit","canDelete","canPin","canReport","isSending","isPinning","reportReasons","messageType","showReportForm"],[3,"togglePanel","messageClicked","unpinClicked","pinnedMessages","totalPinned","showPanel"],["id","messages-wrap",1,"conversation","m-0",3,"click","
3016scroll"],[1,"load-more-indicator"],["role","status",1,"spinner-border","spinner-border-sm"],[1,"load-more-hint"],[1,"message","row","mt-3","ml-0","mr-0",3,"ngClass"],["id","lastReadIndicator",1,"last-read-indicator"],[1,"last-read-line"],[1,"last-read-text"],[3,"start","end"],[3,"replyClicked","reactClicked","reactionTapped","pinClicked","editClicked","deleteMessageClicked","reportClicked","quotedMessageClicked","voteSubmitted","refreshPollRequested","pollUpdated","messageTypeID","isSender","firstName","lastName","isLastMessage","isClubMessage","sentDate","messageID","currentClubUser","messageText","file","fileName","isDeleted","wasEdited","reactions","isPinned","currentUserEmoji","canEdit","canDelete","canPin","canReply","canReact","canReport","pollID","poll","pollContext","isRefreshing","pollStatusMessage","quotedMessage","hideName"],[3,"firstName","lastName","id"],["alt","",1,"player-profile-image","user-image","default-circle","no-bg"],[1,"d-flex","justify-content-center","full-width"],[1,"text-grey-lt","text-smallest","nowrap"],[1,"spinner-wrap","full-width","center"],["role","status","aria-hidden","true",1,"spinner-border","spinner-border-sm"]],template:function(n,r){n&1&&(s(0,"div",1),e(1,`
3017    `),e(2,`
3018    `),e(3,`
3019    `),s(4,"div",2),e(5,`
3020        `),s(6,"div",3),e(7,`
3021            `),s(8,"h3",4),e(9,"To: All Active Team Members"),o(),e(10,`
3022        `),o(),e(11,`
3023    `),o(),e(12,`
3024
3025    `),e(13,`
3026    `),p(14,r_,3,3),p(15,x_,11,3),s(16,"div",5),e(17,`
3027        `),s(18,"app-message-form",6),v("pollCreated",function(h){return r.onPollCreated(h)})("sendMessage",function(h){return r.handleSendMessage(h)})("deleteQuote",function(){return r.cancelReply()}),o(),e(19,`
3028    `),o(),e(20,`
3029
3030    `),e(21,`
3031    `),s(22,"app-message-edit-bubble",7),v("close",function(){return r.showEditModal=!1,r.isReportModalVisible=!1})("save",function(){return r.updateMessage()})("delete",function(){return r.deleteMessage()})("pin",function(h){return r.togglePinMessage(h)})("report",function(h){return r.submitReport(h)})("messageChange",function(h){return r.editingMessage=h}),o(),e(23,`
3032`),o()),n&2&&(l(14),u((r.messages==null?null:r.messages.length)>0||r.totalPinned>0?14:-1),l(),u(r.messages!=null&&r.messages.length?15:-1),l(3),_("sendEnabled",!r.showSendingSpinner)("canAddPoll",!0)("clubUserMessageThreadType",r.ClubUserMessageThreadType.TeamMessage)("quotedMessage",r.quotedMessage)("showQuotePreview",!0)("showFileUpload",!0)("showGifUpload",!0)("messageLimit",1e3),l(4),_("isVisible",r.showEditModal)("message",r.editingMessage)("canEdit",r.currentClubUserID===(r.editingMessage==null?null:r.editingMessage.savedBy))("canDelete",!0)("canPin",!0)("canReport",r.canReportMessages&&r.currentClubUserID!==(r.editingMessage==null?null:r.editingMessage.savedBy)&&!(r.editingMessage!=null&&r.editingMessage.isClubMessage))("isSending",r.showSendingSpinner)("isPinning",r.isPinningMessage)("reportReasons",r.reportReasons)("messageType","team")("showReportForm",r.isReportModalVisible))},dependencies:[ue,Ae,Mt,Pt,Rt,kt,Vt,Ve,Xn],styles:[`:host{display:flex;flex-direction:column;height:100%;min-height:0}.interior-message-view{display:flex;flex-direction:column;height:calc(100vh - 200px);min-height:400px;max-height:calc(100vh - 150px)}.card .title{font-size:var(--text-default);font-weight:500;margin-bottom:0}.card-header.recipient-list-wrapper{background:var(--white, #fff);border-bottom:1px solid var(--grey-200, #e5e7eb);padding:1rem 1.5rem!important}.card-header.recipient-list-wrapper .message-to{font-weight:600;color:var(--grey-600, #4b5563)}.card-header.recipient-list-wrapper .recipient-bubble{background:var(--primary-100, #e0e7ff);color:var(--primary-700, #4338ca);padding:.375rem .75rem;border-radius:1rem;font-weight:500}.conversation{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;scroll-behavior:smooth}.conversation::-webkit-scrollbar{width:6px}.conversation::-webkit-scrollbar-track{background:transparent}.conversation::-webkit-scrollbar-thumb{background:var(--grey-300, #d1d5db);border-radius:3px}.conversation::-webkit-scrollbar-thumb:hover{background:var(--grey-400, #9ca3af)}.load-more-indicator,.load-more-hint{display:flex;align-items:center;justify-content:center;gap:.5rem;padding:.75rem 1rem;margin-bottom:1rem;font-size:.875rem;color:var(--grey-500, #6b7280);background:var(--grey-50, #f9fafb);border-radius:.5rem;text-align:center}.load-more-indicator{animation:pulse 1.5s ease-in-out infinite}.load-more-hint{opacity:.7;font-style:italic}@keyframes pulse{0%,to{opacity:1}50%{opacity:.5}}.last-read-indicator{display:flex;align-items:center;justify-content:center;gap:.75rem;margin:1.5rem 0;padding:0 1rem;animation:fadeIn .3s ease-out}.last-read-indicator .last-read-line{flex:1;height:1px;background:linear-gradient(to right,transparent,var(--primary-300, #a5b4fc),transparent)}.last-read-indicator .last-read-text{background:var(--primary-50, #eef2ff);color:var(--primary-600, #4f46e5);padding:.375rem 1rem;border-radius:1rem;font-size:.75rem;font-weight:600;text-transform:uppercase;letter-spacing:.05em;white-space:nowrap;box-shadow:0 1px 3px #4f46e526}@keyframes fadeIn{0%{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:translateY(0)}}.message-bubble-outer-wrapper{max-width:70%;margin-bottom:.5rem;cursor:pointer;transition:transform .15s ease;position:relative}.message-bubble-outer-wrapper:hover{transform:translateY(-1px)}.message-bubble-outer-wrapper:hover .reply-trigger-btn{opacity:1}.reply-trigger-btn{position:absolute;top:50%;transform:translateY(-50%);width:32px;height:32px;border:none;background:var(--white, #fff);border-radius:50%;box-shadow:0 2px 8px #00000026;cursor:pointer;display:flex;align-items:center;justify-content:center;opacity:0;transition:all .2s ease;z-index:5}.reply-trigger-btn i{font-size:.875rem;color:var(--grey-600, #4b5563);transition:color .15s ease}.reply-trigger-btn:hover{background:var(--primary-link, #4f46e5)}.reply-trigger-btn:hover i{color:var(--white, #fff)}.sender .reply-trigger-btn{left:-40px}.d-flex:not(.sender) .reply-trigger-btn{right:-40px}.quoted-message-inline{margin-bottom:.5rem;cursor:pointer;transition:opacity .15s ease}.quoted-message-inline:hover{opacity:.85}.quoted-message-inline .quoted-message-container{background:#00000014;border-left-color:#0003}.sender .quoted-message-inline .quoted-message-container{background:#ffffff26;border-left-color:#fff6}.sender .quoted-message-inline .quoted-author,.sender .quoted-message-inline .quoted-message-text,.sender .quoted-message-inline .quoted-message-file{color:#ffffffe6}.message-bubble-wrapper .message-bubble{padding:.75rem 1rem;border-radius:1rem;background:var(--grey-100, #f3f4f6);color:var(--grey-900, #111827);font-size:.9375rem;line-height:1.5;word-wrap:break-word;box-shadow:0 1px 2px #0000000d}.message-bubble-wrapper .message-bubble--img{padding:.5rem;background:var(--grey-100, #f3f4f6)}.message-bubble-wrapper .message-bubble--img img{max-width:100%;max-height:300px;border-radius:.75rem;object-fit:cover}.sender{flex-direction:row-reverse}.sender .message-bubble-outer-wrapper{margin-left:auto}.sender .message-bubble-wrapper .message-bubble{background:var(--primary-link, #4f46e5);color:var(--white, #fff);border-bottom-right-radius:.25rem}.sender .text-smallest{text-align:right}.d-flex:not(.sender) .message-bubble-wrapper .message-bubble{border-bottom-left-radius:.25rem}.club-message .message-bubble-wrapper .message-bubble{background:linear-gradient(135deg,var(--yellow-300, #fcd34d) 0%,var(--yellow-400, #fbbf24) 100%);color:var(--grey-900, #111827);border:1px solid var(--yellow-500, #f59e0b)}.club-message .club-logo-avatar-wrapper{height:32px;width:32px;margin-bottom:.5rem}
3032.club-message .club-logo-avatar-wrapper img{width:100%;height:100%;object-fit:contain;border-radius:50%}.text-smallest{font-size:.75rem;color:var(--grey-500, #6b7280);margin-bottom:.25rem;padding:0 .5rem}.message-footer{background:var(--white, #fff);border-top:1px solid var(--grey-200, #e5e7eb);position:relative}.message-footer .message-form{width:100%}.message-footer .reply-preview-container{background:var(--grey-50, #f9fafb);border:1px solid var(--grey-200, #e5e7eb);border-radius:.75rem;padding:.75rem;margin-bottom:.75rem;animation:slideDown .2s ease-out}.message-footer .reply-preview-container .reply-preview-header{display:flex;align-items:center;gap:.5rem;margin-bottom:.5rem;font-size:.875rem;color:var(--primary-link, #4f46e5);font-weight:500}.message-footer .reply-preview-container .reply-preview-header i.fa-reply{font-size:.75rem}.message-footer .reply-preview-container .reply-preview-header span{flex:1}.message-footer .reply-preview-container .cancel-reply-btn{width:24px;height:24px;border:none;background:var(--grey-200, #e5e7eb);border-radius:50%;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .15s ease;color:var(--grey-600, #4b5563)}.message-footer .reply-preview-container .cancel-reply-btn:hover{background:var(--red-100, #fee2e2);color:var(--red-500, #ef4444)}.message-footer .reply-preview-container .cancel-reply-btn i{font-size:.75rem}.message-footer .reply-preview-container .reply-preview-content{padding-left:1.25rem}.message-footer .message-input-container{display:flex;align-items:flex-end;gap:1rem;background:var(--grey-50, #f9fafb);border:2px solid var(--grey-200, #e5e7eb);border-radius:1rem;padding:.75rem 1rem;transition:border-color .2s ease,box-shadow .2s ease}.message-footer .message-input-container:focus-within{border-color:var(--primary-link, #4f46e5);box-shadow:0 0 0 3px #4f46e51a;background:var(--white, #fff)}.message-footer .message-input{flex:1;border:none;background:transparent;resize:none;font-size:1rem;line-height:1.5;min-height:44px;max-height:150px;padding:.5rem 0 .5rem .75rem;color:var(--grey-900, #111827)}.message-footer .message-input::placeholder{color:var(--grey-400, #9ca3af)}.message-footer .message-input:focus{outline:none}.message-footer .message-input:disabled{opacity:.6;cursor:not-allowed}.message-footer .message-input-actions{display:flex;align-items:center;gap:.75rem;flex-shrink:0}.message-footer .attachment-buttons{display:flex;align-items:center;gap:.5rem;flex-shrink:0}.message-footer .attachment-buttons .attachment-btn{display:flex;align-items:center;justify-content:center;width:36px;height:36px;border:none;background:transparent;color:var(--grey-500, #6b7280);border-radius:.5rem;cursor:pointer;transition:all .2s ease}.message-footer .attachment-buttons .attachment-btn:hover{background:var(--grey-100, #f3f4f6);color:var(--primary-link, #4f46e5)}.message-footer .attachment-buttons .attachment-btn:disabled{opacity:.5;cursor:not-allowed}.message-footer .attachment-buttons .attachment-btn i{font-size:1.125rem}.message-footer .attachment-buttons input[type=file]{display:none}.message-footer .attachment-preview{display:flex;align-items:flex-start;gap:.75rem;padding:.75rem;background:var(--grey-50, #f9fafb);border:1px solid var(--grey-200, #e5e7eb);border-radius:.75rem;margin-bottom:.75rem;animation:slideDown .2s ease}.message-footer .attachment-preview .preview-image{width:80px;height:80px;object-fit:cover;border-radius:.5rem;border:1px solid var(--grey-200, #e5e7eb)}.message-footer .attachment-preview .preview-info{flex:1;display:flex;flex-direction:column;gap:.25rem}.message-footer .attachment-preview .preview-info .preview-name{font-size:.875rem;font-weight:500;color:var(--grey-900, #111827);word-break:break-word}.message-footer .attachment-preview .preview-info .preview-type{font-size:.75rem;color:var(--grey-500, #6b7280)}.message-footer .attachment-preview .preview-remove{display:flex;align-items:center;justify-content:center;width:28px;height:28px;border:none;background:var(--grey-100, #f3f4f6);color:var(--grey-500, #6b7280);border-radius:50%;cursor:pointer;transition:all .2s ease;flex-shrink:0}.message-footer .attachment-preview .preview-remove:hover{background:var(--red-100, #fee2e2);color:var(--red-500, #ef4444)}.message-footer .attachment-preview .preview-remove i{font-size:.875rem}.message-footer .character-count{font-size:.75rem;color:var(--grey-400, #9ca3af);font-variant-numeric:tabular-nums}.message-footer .character-count.warning{color:var(--yellow-600, #ca8a04)}.message-footer .character-count.danger{color:var(--red-500, #ef4444);font-weight:600}.message-footer .btn-send{display:flex;align-items:center;gap:.5rem;padding:.625rem 1.25rem;border-radius:.75rem;font-weight:600;font-size:.875rem;transition:all .2s ease}.message-footer .btn-send:hover:not(:disabled){transform:translateY(-1px);box-shadow:0 4px 12px #4f46e54d}.message-footer .btn-send:disabled{opacity:.5;cursor:not-allowed}.message-footer .btn-send i{font-size:1rem}.message-footer .message-length-warning{font-size:.8125rem;margin-top:.5rem;display:flex;align-items:center;gap:.375rem}.message-footer .message-length-warning i{font-size:.875rem}.gif-picker-modal{position:absolute;bottom:100%;left:0;right:0;max-height:400px;margin-bottom:.5rem;background:var(--white, #fff);border:1px solid var(--grey-200, #e5e7eb);border-radius:1rem;box-shadow:0 10px 40px #00000026;overflow:hidden;z-index:100;animation:slideUp .2s ease}@keyframes slideUp{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.gif-picker-modal .gif-picker-header{display:flex;align-items:center;justify-content:space-between;padding:.75rem 1rem;background:var(--grey-50, #f9fafb);border-bottom:1px solid var(--grey-200, #e5e7eb)}.gif-picker-modal .gif-picker-header .gif-picker-title{font-weight:600;font-size:.875rem;color:var(--grey-900, #111827)}.gif-picker-modal .gif-picker-header .gif-picker-close{display:flex;align-items:center;justify-content:center;width:28px;height:28px;border:none;background:transparent;color:var(--grey-500, #6b7280);border-radius:50%;cursor:pointer;transition:all .2s ease}
3032.gif-picker-modal .gif-picker-header .gif-picker-close:hover{background:var(--grey-200, #e5e7eb);color:var(--grey-700, #374151)}.gif-picker-modal .gif-picker-content{max-height:340px;overflow-y:auto}.gif-picker-modal .gif-picker-content app-gif-picker{display:block}.message-bubble-spinner .message-bubble{background:var(--grey-100, #f3f4f6);padding:1rem 1.5rem}.standardWidthDialog{height:80%}.edit-form{height:100%;display:flex;flex-direction:column}.edit-form .edit-message-meta{display:flex;align-items:center;gap:.75rem;padding:.75rem 1rem;background:var(--grey-50, #f9fafb);border-radius:.5rem;border:1px solid var(--grey-200, #e5e7eb)}.edit-form .edit-message-meta .edit-message-author{font-weight:600;color:var(--grey-800, #1f2937)}.edit-form .edit-message-meta .edit-message-time{font-size:.875rem;color:var(--grey-500, #6b7280)}.edit-form textarea{flex-grow:1;margin-bottom:1rem;border:2px solid var(--grey-200, #e5e7eb);border-radius:.75rem;padding:1rem;font-size:1rem;resize:none}.edit-form textarea:focus{border-color:var(--primary-link, #4f46e5);outline:none;box-shadow:0 0 0 3px #4f46e51a}@keyframes fadeInUp{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.d-flex{animation:fadeInUp .3s ease-out}.profile-image{margin-right:.75rem;flex-shrink:0}.sender .profile-image{margin-right:0;margin-left:.75rem}.no-messages{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding:3rem;text-align:center;color:var(--grey-500, #6b7280)}.no-messages i{font-size:3rem;margin-bottom:1rem;color:var(--grey-300, #d1d5db)}.no-messages h3{margin-bottom:.5rem;color:var(--grey-700, #374151)}.report-form .form-group{margin-bottom:1.25rem}.report-form .form-label{display:block;font-weight:500;color:var(--grey-700, #374151);margin-bottom:.5rem;font-size:.875rem}.report-form .message-preview-box{background:var(--grey-50, #f9fafb);border:1px solid var(--grey-200, #e5e7eb);border-radius:.5rem;padding:1rem;font-size:.875rem}.report-form .message-preview-box p{color:var(--grey-700, #374151);line-height:1.5}.report-form .severity-labels{font-size:.75rem}.report-form textarea.form-control{width:100%;border:1px solid var(--grey-300, #d1d5db);border-radius:.5rem;padding:.75rem 1rem;font-size:.9375rem;resize:vertical}.report-form textarea.form-control:focus{border-color:var(--primary-link, #4f46e5);outline:none;box-shadow:0 0 0 3px #4f46e51a}.message-row .message-bubble-wrapper{position:relative}.reaction-trigger-btn{position:absolute;top:50%;transform:translateY(-50%);background:var(--white, #fff);border:1px solid var(--grey-200, #e5e7eb);border-radius:50%;width:28px;height:28px;display:flex;align-items:center;justify-content:center;cursor:pointer;opacity:0;transition:opacity .2s ease,background-color .2s ease,transform .2s ease;box-shadow:0 1px 3px #0000001a;z-index:5;outline:none}.reaction-trigger-btn:focus{outline:none}.reaction-trigger-btn i{font-size:.875rem;color:var(--grey-500, #6b7280);transition:color .2s ease}.reaction-trigger-btn:hover{background:var(--grey-50, #f9fafb);border-color:var(--grey-300, #d1d5db);transform:translateY(-50%) scale(1.1)}.reaction-trigger-btn:hover i{color:var(--primary-link, #4f46e5)}.message-row:hover .reaction-trigger-btn{opacity:1}.sender .reaction-trigger-btn{left:-36px;right:auto}.message-row:not(.sender) .reaction-trigger-btn{right:-36px;left:auto}@keyframes fadeInScale{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}.reactions-display{display:flex;flex-wrap:wrap;gap:.375rem;margin-top:.375rem;padding:0 .25rem}.reaction-badge{display:inline-flex;align-items:center;gap:.25rem;background:var(--grey-100, #f3f4f6);border:1px solid var(--grey-200, #e5e7eb);border-radius:1rem;padding:.25rem .5rem;cursor:pointer;transition:background-color .2s ease,border-color .2s ease,transform .2s ease}.reaction-badge i{font-size:.875rem}.reaction-badge .fa-heart{color:#ef4444}.reaction-badge .fa-thumbs-up{color:#3b82f6}.reaction-badge .fa-smile{color:#f59e0b}.reaction-badge .fa-exclamation-triangle{color:#f97316}.reaction-badge .fa-sad-tear{color:#8b5cf6}.reaction-badge .reaction-count{font-size:.75rem;font-weight:600;color:var(--grey-600, #4b5563)}.reaction-badge:hover{background:var(--grey-200, #e5e7eb);transform:scale(1.05)}.reaction-badge.user-reacted{background:var(--primary-100, #e0e7ff)}.reaction-badge.user-reacted .reaction-count{color:var(--primary-700, #4338ca)}.pinned-toggle-row{display:flex;justify-content:flex-start;padding:.5rem 1rem;background:var(--grey-50, #f9fafb);border-bottom:1px solid var(--grey-200, #e5e7eb)}.pinned-toggle-container{display:flex;align-items:center}.pinned-toggle-btn{display:flex;align-items:center;gap:.5rem;background:var(--primary-50, #eef2ff);border:1px solid var(--primary-200, #c7d2fe);border-radius:.5rem;padding:.375rem .75rem;font-size:.875rem;color:var(--primary-700, #4338ca);cursor:pointer;transition:all .2s ease}.pinned-toggle-btn i.fa-thumbtack{color:var(--primary-500, #6366f1)}.pinned-toggle-btn .pinned-count{font-weight:600;background:var(--primary-500, #6366f1);color:#fff;padding:.125rem .375rem;border-radius:.75rem;font-size:.75rem;min-width:1.25rem;text-align:center}.pinned-toggle-btn .chevron{font-size:.75rem;transition:transform .2s ease}.pinned-toggle-btn .chevron.rotated{transform:rotate(180deg)}.pinned-messages-panel{background:var(--white, #fff);border-bottom:1px solid var(--grey-200, #e5e7eb);box-shadow:0 4px 6px -1px #0000001a;animation:slideDown .2s ease-out}@keyframes slideDown{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}.pinned-panel-header{display:flex;align-items:center;gap:.5rem;padding:.75rem 1rem;background:var(--primary-50, #eef2ff);border-bottom:1px solid var(--primary-100, #e0e7ff);font-weight:600;color:var(--primary-700, #4338ca)}.pinned-panel-header i.fa-thumbtack{color:var(--primary-500, #6366f1)}.pinned-panel-header .close-panel-btn{margin-left:auto;background:none;border:none;cursor:pointer;padding:.25rem .5rem;color:var(--grey-500, #6b7280)}.pinned-panel-header .close-panel-btn:hover{color:var(--grey-700, #374151)}.pinned-messages-list{max-height:200px;overflow-y:auto}.pinned-message-item{display:flex;align-items:flex-start;gap:.75rem;padding:.75rem 1rem;border-bottom:1px solid var(--grey-100, #f3f4f6);cursor:pointer;transition:background-color .15s ease}.pinned-message-item:hover{background:var(--grey-50, #f9fafb)}.pinned-message-item:last-child{border-bottom:none}.pinned-message-content{flex:1;min-width:0}.pinned-message-author{font-weight:500;font-size:.875rem;color:var(--grey-900, #111827);margin-bottom:.25rem}.pinned-message-author .pinned-message-date{font-weight:400;color:var(--grey-500, #6b7280);font-size:.75rem;margin-left:.5rem}.pinned-message-text{font-size:.875rem;color:var(--grey-600, #4b5563);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.pinned-message-image{font-size:.875rem;color:var(--grey-500, #6b7280)}.pinned-message-image i{margin-right:.25rem}.unpin-btn{background:none;border:none;color:var(--grey-400, #9ca3af);padding:.25rem;cursor:pointer;opacity:0;transition:opacity .15s ease,color .15s ease}.unpin-btn:hover{color:var(--danger, #ef4444)}.pinned-message-item:hover .unpin-btn{opacity:1}.pin-indicator{color:var(--primary-500, #6366f1);font-size:.7rem}.message-row.is-pinned{position:relative}.message-row.is-pinned:before{content:"";position:absolute;
3032left:0;top:0;bottom:0;width:3px;background:var(--primary-500, #6366f1);border-radius:0 2px 2px 0}.message-row.is-pinned .message-bubble{box-shadow:0 0 0 1px var(--primary-200, #c7d2fe)}.pin-trigger-btn{position:absolute;top:50%;transform:translateY(-50%);background:var(--white, #fff);border:1px solid var(--grey-200, #e5e7eb);border-radius:50%;width:28px;height:28px;display:flex;align-items:center;justify-content:center;cursor:pointer;opacity:0;transition:opacity .2s ease,background-color .2s ease,transform .2s ease;box-shadow:0 1px 3px #0000001a;z-index:5}.pin-trigger-btn i{font-size:.75rem;color:var(--grey-500, #6b7280);transition:color .2s ease}.pin-trigger-btn:hover{transform:translateY(-50%) scale(1.1)}.pin-trigger-btn:hover i{color:var(--primary-500, #6366f1)}.pin-trigger-btn.is-pinned{opacity:1;background:var(--primary-100, #e0e7ff);border-color:var(--primary-300, #a5b4fc)}.pin-trigger-btn.is-pinned i{color:var(--primary-500, #6366f1)}.message-row:hover .pin-trigger-btn{opacity:1}.sender .pin-trigger-btn{left:-72px;right:auto}.message-row:not(.sender) .pin-trigger-btn{right:-72px;left:auto}.highlight-message{animation:highlightPulse 2s ease-out}@keyframes highlightPulse{0%,to{background-color:transparent}25%,75%{background-color:var(--primary-100, #e0e7ff)}}
3033`],encapsulation:2});let a=d;return a})();var C_=(a,d)=>({sender:a,"mb-3 ":d});function v_(a,d){if(a&1){let i=y();e(0,`
3034        `),s(1,"app-pinned-messages-panel",8),v("togglePanel",function(){g(i);let n=m();return f(n.togglePinnedPanel())})("messageClicked",function(n){g(i);let r=m();return f(r.scrollToPinnedMessage(n))})("unpinClicked",function(n){g(i);let r=m();return f(r.unpinMessage(n))}),o(),e(2,`
3035    `)}if(a&2){let i=m();l(),_("pinnedMessages",i.pinnedMessages)("totalPinned",i.totalPinned)("showPanel",i.showPinnedPanel)}}function b_(a,d){if(a&1&&(e(0,`
3036                    `),x(1,"app-message-time-tag",11),e(2,`
3037                `)),a&2){let i=m(),t=i.$implicit,n=i.$index,r=m(2);l(),_("start",t.savedOn)("end",n>0?r.messages[n-1].savedOn:null)}}function S_(a,d){if(a&1&&(e(0,`
3038                                `),x(1,"app-user-initials",13),e(2,`
3039                            `)),a&2){let i=m(2).$implicit;l(),_("firstName",i==null?null:i.firstName)("lastName",i==null?null:i.lastName)("id",i.savedBy)}}function y_(a,d){if(a&1){let i=y();e(0,`
3040                        `),s(1,"app-message-bubble",12),N(2,"utcDate"),v("replyClicked",function(){g(i);let n=m().$implicit,r=m(2);return f(r.replyToMessage(n))})("reactClicked",function(n){g(i);let r=m().$implicit,c=m(2);return f(c.reactionClicked(n,r))})("reactionTapped",function(n){g(i);let r=m().$implicit,c=m(2);return f(c.reactionClicked(n,r))})("pinClicked",function(){g(i);let n=m().$implicit,r=m(2);return f(r.togglePinMessage(n))})("editClicked",function(){g(i);let n=m().$implicit,r=m(2);return f(r.editMessage(n))})("deleteMessageClicked",function(){g(i);let n=m().$implicit,r=m(2);return r.editingMessage=n,f(r.deleteMessage())})("quotedMessageClicked",function(){g(i);let n=m().$implicit,r=m(2);return f(r.scrollToQuotedMessage(n.quotedMessage))}),e(3,`
3041                            `),p(4,S_,3,3),o(),e(5,`
3042                    `)}if(a&2){let i=m(),t=i.$implicit,n=i.$index,r=i.$count,c=m(2);l(),_("messageTypeID",t.messageTypeID)("isSender",c.isSender(t))("firstName",t.firstName)("lastName",t.lastName)("isLastMessage",n===r-1)("sentDate",t.savedBy===(c.messages[n-1]==null?null:c.messages[n-1].savedBy)&&c.getTimeBetweenDates(c.messages[n-1]==null?null:c.messages[n-1].savedOn,t.savedOn)<120?"":B(2,24,t.savedOn,"h:mm a"))("messageID",t.id)("currentClubUser",c.currentClubUser)("messageText",t.message)("file",t.file)("fileName",t.fileName)("isDeleted",t.isDeleted)("wasEdited",t.wasEdited)("reactions",t.reactions)("isPinned",t.isPinned)("currentUserEmoji",c.getUserReactionEmoji(t))("canEdit",c.isSender(t)&&!t.isDeleted)("canDelete",c.isSender(t)&&!t.isDeleted)("canPin",!0)("canReply",!0)("canReact",!0)("canReport",!1)("quotedMessage",t.quotedMessage),l(3),u(c.isSender(t)?-1:4)}}function w_(a,d){if(a&1&&(e(0,`
3043                        `),s(1,"div",14),e(2,`
3044                            `),s(3,"em",15),e(4),o(),e(5,`
3045                        `),o(),e(6,`
3046                    `)),a&2){let i=m().$implicit;l(4),T(i.message)}}function T_(a,d){if(a&1&&(e(0,`
3047                `),p(1,b_,3,2),s(2,"div",10),e(3,`
3048                    `),p(4,y_,6,27),p(5,w_,7,1),o(),e(6,`
3049            `)),a&2){let i=d.$implicit,t=d.$index,n=d.$count,r=m(2);l(),u(r.shouldShowTimeTag(i,t)!==null||t===0?1:-1),l(),_("ngClass",pe(5,C_,r.isSender(i),t!==n-1)),ye("data-message-id",i.id),l(2),u(!i.messageTypeID||i.messageTypeID===r.MessageType.DEFAULT?4:-1),l(),u(i.messageTypeID===r.MessageType.THREAD_PARTICIPANT_CHANGE||i.messageTypeID===r.MessageType.MESSAGE_PINNED?5:-1)}}function D_(a,d){a&1&&(e(0,`
3050                `),s(1,"div",16),e(2,`
3051                    `),x(3,"span",17),e(4,`
3052                `),o(),e(5,`
3053            `))}function E_(a,d){if(a&1&&(e(0,`
3054        `),s(1,"div",9),e(2,`
3055            `),F(3,T_,7,8,null,null,ti().trackByMessageId,!0),p(5,D_,6,0),o(),e(6,`
3056    `)),a&2){let i=m();l(3),V(i.messages),l(2),u(i.showSendingSpinner?5:-1)}}var Wo=(()=>{let d=class d{constructor(t,n,r){this.channelService=t,this.siteDataService=n,this.authorizeService=r,this.unsubscribe$=new U,this.messages=[],this.reactingMessageIds=new Set,this.channelName="",this.showSendingSpinner=!1,this.page=1,this.rows=50,this.totalMessages=0,this.ReactionType=je,this.pinnedMessages=[],this.totalPinned=0,this.showPinnedPanel=!1,this.isPinningMessage=!1,this.replyingToMessage=null,this.quotedMessage=null,this.editingMessage=void 0,this.showEditModal=!1,this.acceptedFileTypes=li,this.maxFileSizeBytes=di,this.MessageType=st,this.ClubUserMessageThreadType=lt,this.getTimeBetweenDates=bt,this.isSameDay=ri,this.timer=_t(2e4)}ngOnInit(){this.authorizeService.getUser().pipe(S(this.unsubscribe$)).subscribe({next:t=>{t&&(this.currentClubUserID=+t.userID,this.currentClubUser=t)}}),this.load(),this.timer.pipe(S(this.unsubscribe$)).subscribe({next:()=>this.checkForNewMessages()})}ngOnChanges(t){t.teamChannelID&&!t.teamChannelID.firstChange&&this.teamChannelID&&(this.resetConversationState(),this.load())}resetConversationState(){this.replyingToMessage=null,this.quotedMessage=null,this.editingMessage=void 0,this.showEditModal=!1,this.showSendingSpinner=!1,this.showPinnedPanel=!1}load(){this.channelService.getChannel(this.teamChannelID).pipe(S(this.unsubscribe$)).subscribe({next:t=>this.channelName=t?.name??"",error:()=>{}}),this.getMessages(!0),this.loadPinnedMessages()}getMessages(t=!1){t&&(this.page=1,this.messages=[]),this.channelService.getMessages(this.teamChannelID,this.page,this.rows).pipe(S(this.unsubscribe$)).subscribe({next:n=>{this.totalMessages=n.count,this.messages=n.results??[],this.doScrollToBottom()},error:()=>{}})}checkForNewMessages(){this.teamChannelID&&this.channelService.getMessages(this.teamChannelID,1,10).pipe(S(this.unsubscribe$)).subscribe({next:t=>{if(!t.results?.length)return;let n=new Set(this.messages.filter(c=>c.id>0).map(c=>c.id)),r=t.results.filter(c=>c.id&&!n.has(c.id));r.length>0&&(this.messages.push(...r),this.totalMessages=t.count,this.doScrollToBottom())}})}isSender(t){return!!t&&this.currentClubUserID===t.savedBy}shouldShowTimeTag(t,n){if(n===0)return null;let r=this.messages[n-1];if(!r)return null;
3056let c=new Date(t.savedOn),h=new Date(r.savedOn);return this.isSameDay(c,h)?null:h}handleSendMessage(t){if(!t||!t.text&&!t.blob&&!t.selectedFileURL)return;this.showSendingSpinner=!0,this.doScrollToBottom();let n=this.replyingToMessage?this.replyingToMessage.id:void 0;(t.blob?this.channelService.uploadPhoto(this.teamChannelID,this.buildAttachmentFormData(t)).pipe(ht(c=>this.channelService.sendMessage(this.teamChannelID,{message:t.text,file:c,fileName:t.fileName,quotedMessageID:n}))):this.channelService.sendMessage(this.teamChannelID,{message:t.text,quotedMessageID:n})).pipe(S(this.unsubscribe$)).subscribe({next:c=>{let h=this.messages.findIndex(b=>b.id===c.id);h>=0?this.messages[h]=c:this.messages.push(c),this.showSendingSpinner=!1,this.cancelReply(),this.doScrollToBottom()},error:()=>{this.showSendingSpinner=!1,this.siteDataService.showSiteErrorAlert("Failed to send message. Please try again.")}})}buildAttachmentFormData(t){let n=new FormData,r=t.fileName||`file.${t.format||"png"}`;return n.append(r,t.blob,r),n}editMessage(t){this.isSender(t)&&!t.isDeleted&&(this.editingMessage=t,this.showEditModal=!0)}updateMessage(){this.editingMessage&&(this.showSendingSpinner=!0,this.channelService.editMessage(this.teamChannelID,this.editingMessage.id,this.editingMessage).pipe(S(this.unsubscribe$)).subscribe({next:t=>{let n=this.messages.findIndex(r=>
3056r.id===t.id);n>=0&&(this.messages[n].message=t.message,this.messages[n].file=t.file,this.messages[n].wasEdited=!0),this.editingMessage=void 0,this.showSendingSpinner=!1,this.showEditModal=!1},error:()=>{this.showSendingSpinner=!1,this.siteDataService.showSiteErrorAlert("You don't have access to edit this message")}}))}deleteMessage(){if(!this.editingMessage)return;this.showEditModal=!1;let t=this.editingMessage.id;this.channelService.deleteMessage(this.teamChannelID,t).pipe(S(this.unsubscribe$)).subscribe({next:()=>{let n=this.messages.find(r=>r.id===t);n&&(n.isDeleted=!0),this.editingMessage=void 0},error:()=>this.siteDataService.showSiteErrorAlert("You don't have access to delete this message")})}getUserReactionEmoji(t){let n=this.getUserReaction(t);return n?Ne(n):void 0}getUserReaction(t){if(!(!t.reactions||!this.currentClubUserID))return t.reactions.find(n=>n.savedBy===this.currentClubUserID)}reactionClicked(t,n){if(!n||!n.id||this.reactingMessageIds.has(n.id))return;let r=this.getUserReaction(n);this.reactingMessageIds.add(n.id);let c=()=>{this.reactingMessageIds.delete(n.id)};r&&Ne(r)===t?this.channelService.deleteReaction(this.teamChannelID,r.id).pipe(S(this.unsubscribe$),we(c)).subscribe({next:()=>{let h=this.messages.find(b=>b.id===n.id);h&&(h.reactions=h.reactions.filter(b=>b.id!==r.id))},error:()=>this.siteDataService.showSiteErrorAlert("Failed to remove reaction.")}):r?this.channelService.updateReaction(this.teamChannelID,r.id,{teamChannelMessageID:n.id,emoji:t}).pipe(S(this.unsubscribe$),we(c)).subscribe({next:()=>{let b=this.messages.find(k=>k.id===n.id)?.reactions.find(k=>k.id===r.id);b&&(b.emoji=t)},error:()=>this.siteDataService.showSiteErrorAlert("Failed to update reaction.")}):this.channelService.reactToMessage(this.teamChannelID,{teamChannelMessageID:n.id,emoji:t}).pipe(S(this.unsubscribe$),we(c)).subscribe({next:h=>{let b=this.messages.find(k=>k.id===n.id);b&&(b.reactions=b.reactions||[],b.reactions.push(h))},error:()=>this.siteDataService.showSiteErrorAlert("Failed to add reaction.")})}loadPinnedMessages(){this.channelService.getPinnedMessages(this.teamChannelID,0,50).pipe(S(this.unsubscribe$)).subscribe({next:t=>{this.pinnedMessages=t.results||[],this.totalPinned=t.count||0},error:()=>{}})}togglePinnedPanel(){this.showPinnedPanel=!this.showPinnedPanel}togglePinMessage(t){if(!t||!t.id||this.isPinningMessage)return;this.isPinningMessage=!0;let n=!t.isPinned;this.channelService.pinMessage(this.teamChannelID,t.id,n).pipe(S(this.unsubscribe$)).subscribe({next:r=>{let c=this.messages.find(h=>h.id===t.id);c&&(c.isPinned=n,c.pinnedDate=r?.pinnedDate),n?(this.loadPinnedMessages(),this.siteDataService.showSiteSuccessAlert("Message pinned.")):(this.removeFromPinned(t.id),this.siteDataService.showSiteSuccessAlert("Message unpinned.")),this.isPinningMessage=!1,this.showEditModal=!1},error:()=>{this.isPinningMessage=!1,this.siteDataService.showSiteErrorAlert("Failed to update pin status.")}})}unpinMessage(t){if(!t||this.isPinningMessage)return;let n="messageID"in t?t.messageID:t.id;n&&(this.isPinningMessage=!0,this.channelService.pinMessage(this.teamChannelID,n,!1).pipe(S(this.unsubscribe$)).subscribe({next:()=>{let r=this.messages.find(c=>c.id===n);r&&(r.isPinned=!1),this.removeFromPinned(n),this.isPinningMessage=!1},error:()=>{this.isPinningMessage=!1,this.siteDataService.showSiteErrorAlert("Failed to unpin message.")}}))}removeFromPinned(t){this.pinnedMessages=this.pinnedMessages.filter(n=>("messageID"in n?n.messageID:n.id)!==t),this.totalPinned=Math.max(0,this.totalPinned-1)}scrollToPinnedMessage(t){let n="messageID"in t?t.messageID:t.id;this.scrollToMessageElement(n),this.showPinnedPanel=!1}replyToMessage(t){!t||t.isDeleted||(this.replyingToMessage=t,this.quotedMessage=Et.createQuotedMessage(t),this.showEditModal=!1)}cancelReply(){this.replyingToMessage=null,this.quotedMessage=null}scrollToQuotedMessage(t){t?.messageID&&this.scrollToMessageElement(t.messageID)}scrollToMessageElement(t){let n=document.querySelector(`[data-message-id="${t}"]`);n&&(n.scrollIntoView({behavior:"smooth",block:"center"}),n.classList.add("highlight-message"),setTimeout(()=>n.classList.remove("highlight-message"),2e3))}doScrollToBottom(){setTimeout(()=>{let t=document.getElementById("channel-messages-wrap");t&&t.scrollTo({top:t.scrollHeight,behavior:"instant"})},200)}trackByMessageId(t,n){return n.id||t}
3056ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete()}};d.\u0275fac=function(n){return new(n||d)(C(Lt),C(E),C(ae))},d.\u0275cmp=D({type:d,selectors:[["app-team-channel-message"]],inputs:{teamChannelID:"teamChannelID"},standalone:!1,features:[Xt],decls:22,vars:20,consts:[[1,"interior-message-view","bg-grey-lt","full-height"],[1,"recipient-list-wrapper","row","m-0","p-3"],[1,"recipientList"],[1,"full-width","title"],[1,"fa-regular","fa-hashtag","mr-1"],[1,"message-footer"],[3,"sendMessage","deleteQuote","sendEnabled","canAddPoll","clubUserMessageThreadType","quotedMessage","showQuotePreview","showFileUpload","showGifUpload","messageLimit"],[3,"close","save","delete","pin","messageChange","isVisible","message","canEdit","canDelete","canPin","canReport","isSending","isPinning","messageType"],[3,"togglePanel","messageClicked","unpinClicked","pinnedMessages","totalPinned","showPanel"],["id","channel-messages-wrap",1,"conversation","m-0"],[1,"message","row","mt-3","ml-0","mr-0",3,"ngClass"],[3,"start","end"],[3,"replyClicked","reactClicked","reactionTapped","pinClicked","editClicked","deleteMessageClicked","quotedMessageClicked","messageTypeID","isSender","firstName","lastName","isLastMessage","sentDate","messageID","currentClubUser","messageText","file","fileName","isDeleted","wasEdited","reactions","isPinned","currentUserEmoji","canEdit","canDelete","canPin","canReply","canReact","canReport","quotedMessage"],[3,"firstName","lastName","id"],[1,"d-flex","justify-content-center","full-width"],[1,"text-grey-lt","text-smallest","nowrap"],[1,"spinner-wrap","full-width","center"],["role","status","aria-hidden","true",1,"spinner-border","spinner-border-sm"]],template:function(n,r){n&1&&(s(0,"div",0),e(1,`
3057    `),s(2,"div",1),e(3,`
3058        `),s(4,"div",2),e(5,`
3059            `),s(6,"h3",3),x(7,"i",4),e(8),o(),e(9,`
3060        `),o(),e(10,`
3061    `),o(),e(11,`
3062
3063    `),p(12,v_,3,3),p(13,E_,7,1),s(14,"div",5),e(15,`
3064        `),s(16,"app-message-form",6),v("sendMessage",function(h){return r.handleSendMessage(h)})("deleteQuote",function(){return r.cancelReply()}),o(),e(17,`
3065    `),o(),e(18,`
3066
3067    `),s(19,"app-message-edit-bubble",7),v("close",function(){return r.showEditModal=!1})("save",function(){return r.updateMessage()})("delete",function(){return r.deleteMessage()})("pin",function(h){return r.togglePinMessage(h)})("messageChange",function(h){return r.editingMessage=h}),o(),e(20,`
3068`),o(),e(21,`
3069`)),n&2&&(l(8),T(r.channelName||"Channel"),l(4),u((r.messages==null?null:r.messages.length)>0||r.totalPinned>0?12:-1),l(),u(r.messages!=null&&r.messages.length?13:-1),l(3),_("sendEnabled",!r.showSendingSpinner)("canAddPoll",!1)("clubUserMessageThreadType",r.ClubUserMessageThreadType.TeamChannel)("quotedMessage",r.quotedMessage)("showQuotePreview",!0)("showFileUpload",!0)("showGifUpload",!1)("messageLimit",1e3),l(3),_("isVisible",r.showEditModal)("message",r.editingMessage)("canEdit",r.isSender(r.editingMessage))("canDelete",r.isSender(r.editingMessage))("canPin",!0)("canReport",!1)("isSending",r.showSendingSpinner)("isPinning",r.isPinningMessage)("messageType","team"))},dependencies:[ue,Ae,Mt,Pt,Rt,kt,Vt,Ve],styles:[`:host{display:flex;flex-direction:column;height:100%;min-height:0}.interior-message-view{display:flex;flex-direction:column;height:calc(100vh - 200px);min-height:400px;max-height:calc(100vh - 150px)}.card .title{font-size:var(--text-default);font-weight:500;margin-bottom:0}.card-header.recipient-list-wrapper{background:var(--white, #fff);border-bottom:1px solid var(--grey-200, #e5e7eb);padding:1rem 1.5rem!important}.card-header.recipient-list-wrapper .message-to{font-weight:600;color:var(--grey-600, #4b5563)}.card-header.recipient-list-wrapper .recipient-bubble{background:var(--primary-100, #e0e7ff);color:var(--primary-700, #4338ca);padding:.375rem .75rem;border-radius:1rem;font-weight:500}.conversation{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;scroll-behavior:smooth}.conversation::-webkit-scrollbar{width:6px}.conversation::-webkit-scrollbar-track{background:transparent}.conversation::-webkit-scrollbar-thumb{background:var(--grey-300, #d1d5db);border-radius:3px}.conversation::-webkit-scrollbar-thumb:hover{background:var(--grey-400, #9ca3af)}.load-more-indicator,.load-more-hint{display:flex;align-items:center;justify-content:center;gap:.5rem;padding:.75rem 1rem;margin-bottom:1rem;font-size:.875rem;color:var(--grey-500, #6b7280);background:var(--grey-50, #f9fafb);border-radius:.5rem;text-align:center}.load-more-indicator{animation:pulse 1.5s ease-in-out infinite}.load-more-hint{opacity:.7;font-style:italic}@keyframes pulse{0%,to{opacity:1}50%{opacity:.5}}.last-read-indicator{display:flex;align-items:center;justify-content:center;gap:.75rem;margin:1.5rem 0;padding:0 1rem;animation:fadeIn .3s ease-out}.last-read-indicator .last-read-line{flex:1;height:1px;background:linear-gradient(to right,transparent,var(--primary-300, #a5b4fc),transparent)}.last-read-indicator .last-read-text{background:var(--primary-50, #eef2ff);color:var(--primary-600, #4f46e5);padding:.375rem 1rem;border-radius:1rem;font-size:.75rem;font-weight:600;text-transform:uppercase;letter-spacing:.05em;white-space:nowrap;box-shadow:0 1px 3px #4f46e526}@keyframes fadeIn{0%{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:translateY(0)}}.message-bubble-outer-wrapper{max-width:70%;margin-bottom:.5rem;cursor:pointer;transition:transform .15s ease;position:relative}.message-bubble-outer-wrapper:hover{transform:translateY(-1px)}.message-bubble-outer-wrapper:hover .reply-trigger-btn{opacity:1}.reply-trigger-btn{position:absolute;top:50%;transform:translateY(-50%);width:32px;height:32px;border:none;background:var(--white, #fff);border-radius:50%;box-shadow:0 2px 8px #00000026;cursor:pointer;display:flex;align-items:center;justify-content:center;opacity:0;transition:all .2s ease;z-index:5}.reply-trigger-btn i{font-size:.875rem;color:var(--grey-600, #4b5563);transition:color .15s ease}.reply-trigger-btn:hover{background:var(--primary-link, #4f46e5)}.reply-trigger-btn:hover i{color:var(--white, #fff)}.sender .reply-trigger-btn{left:-40px}.d-flex:not(.sender) .reply-trigger-btn{right:-40px}.quoted-message-inline{margin-bottom:.5rem;cursor:pointer;transition:opacity .15s ease}.quoted-message-inline:hover{opacity:.85}.quoted-message-inline .quoted-message-container{background:#00000014;border-left-color:#0003}.sender .quoted-message-inline .quoted-message-container{background:#ffffff26;border-left-color:#fff6}.sender .quoted-message-inline .quoted-author,.sender .quoted-message-inline .quoted-message-text,.sender .quoted-message-inline .quoted-message-file{color:#ffffffe6}.message-bubble-wrapper .message-bubble{padding:.75rem 1rem;border-radius:1rem;background:var(--grey-100, #f3f4f6);color:var(--grey-900, #111827);font-size:.9375rem;line-height:1.5;word-wrap:break-word;box-shadow:0 1px 2px #0000000d}.message-bubble-wrapper .message-bubble--img{padding:.5rem;background:var(--grey-100, #f3f4f6)}.message-bubble-wrapper .message-bubble--img img{max-width:100%;max-height:300px;border-radius:.75rem;object-fit:cover}.sender{flex-direction:row-reverse}.sender .message-bubble-outer-wrapper{margin-left:auto}.sender .message-bubble-wrapper .message-bubble{background:var(--primary-link, #4f46e5);color:var(--white, #fff);border-bottom-right-radius:.25rem}.sender .text-smallest{text-align:right}.d-flex:not(.sender) .message-bubble-wrapper .message-bubble{border-bottom-left-radius:.25rem}.club-message .message-bubble-wrapper .message-bubble{background:linear-gradient(135deg,var(--yellow-300, #fcd34d) 0%,var(--yellow-400, #fbbf24) 100%);color:var(--grey-900, #111827);border:1px solid var(--yellow-500, #f59e0b)}.club-message .club-logo-avatar-wrapper{height:32px;width:32px;margin-bottom:.5rem}
3069.club-message .club-logo-avatar-wrapper img{width:100%;height:100%;object-fit:contain;border-radius:50%}.text-smallest{font-size:.75rem;color:var(--grey-500, #6b7280);margin-bottom:.25rem;padding:0 .5rem}.message-footer{background:var(--white, #fff);border-top:1px solid var(--grey-200, #e5e7eb);position:relative}.message-footer .message-form{width:100%}.message-footer .reply-preview-container{background:var(--grey-50, #f9fafb);border:1px solid var(--grey-200, #e5e7eb);border-radius:.75rem;padding:.75rem;margin-bottom:.75rem;animation:slideDown .2s ease-out}.message-footer .reply-preview-container .reply-preview-header{display:flex;align-items:center;gap:.5rem;margin-bottom:.5rem;font-size:.875rem;color:var(--primary-link, #4f46e5);font-weight:500}.message-footer .reply-preview-container .reply-preview-header i.fa-reply{font-size:.75rem}.message-footer .reply-preview-container .reply-preview-header span{flex:1}.message-footer .reply-preview-container .cancel-reply-btn{width:24px;height:24px;border:none;background:var(--grey-200, #e5e7eb);border-radius:50%;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .15s ease;color:var(--grey-600, #4b5563)}.message-footer .reply-preview-container .cancel-reply-btn:hover{background:var(--red-100, #fee2e2);color:var(--red-500, #ef4444)}.message-footer .reply-preview-container .cancel-reply-btn i{font-size:.75rem}.message-footer .reply-preview-container .reply-preview-content{padding-left:1.25rem}.message-footer .message-input-container{display:flex;align-items:flex-end;gap:1rem;background:var(--grey-50, #f9fafb);border:2px solid var(--grey-200, #e5e7eb);border-radius:1rem;padding:.75rem 1rem;transition:border-color .2s ease,box-shadow .2s ease}.message-footer .message-input-container:focus-within{border-color:var(--primary-link, #4f46e5);box-shadow:0 0 0 3px #4f46e51a;background:var(--white, #fff)}.message-footer .message-input{flex:1;border:none;background:transparent;resize:none;font-size:1rem;line-height:1.5;min-height:44px;max-height:150px;padding:.5rem 0 .5rem .75rem;color:var(--grey-900, #111827)}.message-footer .message-input::placeholder{color:var(--grey-400, #9ca3af)}.message-footer .message-input:focus{outline:none}.message-footer .message-input:disabled{opacity:.6;cursor:not-allowed}.message-footer .message-input-actions{display:flex;align-items:center;gap:.75rem;flex-shrink:0}.message-footer .attachment-buttons{display:flex;align-items:center;gap:.5rem;flex-shrink:0}.message-footer .attachment-buttons .attachment-btn{display:flex;align-items:center;justify-content:center;width:36px;height:36px;border:none;background:transparent;color:var(--grey-500, #6b7280);border-radius:.5rem;cursor:pointer;transition:all .2s ease}.message-footer .attachment-buttons .attachment-btn:hover{background:var(--grey-100, #f3f4f6);color:var(--primary-link, #4f46e5)}.message-footer .attachment-buttons .attachment-btn:disabled{opacity:.5;cursor:not-allowed}.message-footer .attachment-buttons .attachment-btn i{font-size:1.125rem}.message-footer .attachment-buttons input[type=file]{display:none}.message-footer .attachment-preview{display:flex;align-items:flex-start;gap:.75rem;padding:.75rem;background:var(--grey-50, #f9fafb);border:1px solid var(--grey-200, #e5e7eb);border-radius:.75rem;margin-bottom:.75rem;animation:slideDown .2s ease}.message-footer .attachment-preview .preview-image{width:80px;height:80px;object-fit:cover;border-radius:.5rem;border:1px solid var(--grey-200, #e5e7eb)}.message-footer .attachment-preview .preview-info{flex:1;display:flex;flex-direction:column;gap:.25rem}.message-footer .attachment-preview .preview-info .preview-name{font-size:.875rem;font-weight:500;color:var(--grey-900, #111827);word-break:break-word}.message-footer .attachment-preview .preview-info .preview-type{font-size:.75rem;color:var(--grey-500, #6b7280)}.message-footer .attachment-preview .preview-remove{display:flex;align-items:center;justify-content:center;width:28px;height:28px;border:none;background:var(--grey-100, #f3f4f6);color:var(--grey-500, #6b7280);border-radius:50%;cursor:pointer;transition:all .2s ease;flex-shrink:0}.message-footer .attachment-preview .preview-remove:hover{background:var(--red-100, #fee2e2);color:var(--red-500, #ef4444)}.message-footer .attachment-preview .preview-remove i{font-size:.875rem}.message-footer .character-count{font-size:.75rem;color:var(--grey-400, #9ca3af);font-variant-numeric:tabular-nums}.message-footer .character-count.warning{color:var(--yellow-600, #ca8a04)}.message-footer .character-count.danger{color:var(--red-500, #ef4444);font-weight:600}.message-footer .btn-send{display:flex;align-items:center;gap:.5rem;padding:.625rem 1.25rem;border-radius:.75rem;font-weight:600;font-size:.875rem;transition:all .2s ease}.message-footer .btn-send:hover:not(:disabled){transform:translateY(-1px);box-shadow:0 4px 12px #4f46e54d}.message-footer .btn-send:disabled{opacity:.5;cursor:not-allowed}.message-footer .btn-send i{font-size:1rem}.message-footer .message-length-warning{font-size:.8125rem;margin-top:.5rem;display:flex;align-items:center;gap:.375rem}.message-footer .message-length-warning i{font-size:.875rem}.gif-picker-modal{position:absolute;bottom:100%;left:0;right:0;max-height:400px;margin-bottom:.5rem;background:var(--white, #fff);border:1px solid var(--grey-200, #e5e7eb);border-radius:1rem;box-shadow:0 10px 40px #00000026;overflow:hidden;z-index:100;animation:slideUp .2s ease}@keyframes slideUp{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.gif-picker-modal .gif-picker-header{display:flex;align-items:center;justify-content:space-between;padding:.75rem 1rem;background:var(--grey-50, #f9fafb);border-bottom:1px solid var(--grey-200, #e5e7eb)}.gif-picker-modal .gif-picker-header .gif-picker-title{font-weight:600;font-size:.875rem;color:var(--grey-900, #111827)}.gif-picker-modal .gif-picker-header .gif-picker-close{display:flex;align-items:center;justify-content:center;width:28px;height:28px;border:none;background:transparent;color:var(--grey-500, #6b7280);border-radius:50%;cursor:pointer;transition:all .2s ease}
3069.gif-picker-modal .gif-picker-header .gif-picker-close:hover{background:var(--grey-200, #e5e7eb);color:var(--grey-700, #374151)}.gif-picker-modal .gif-picker-content{max-height:340px;overflow-y:auto}.gif-picker-modal .gif-picker-content app-gif-picker{display:block}.message-bubble-spinner .message-bubble{background:var(--grey-100, #f3f4f6);padding:1rem 1.5rem}.standardWidthDialog{height:80%}.edit-form{height:100%;display:flex;flex-direction:column}.edit-form .edit-message-meta{display:flex;align-items:center;gap:.75rem;padding:.75rem 1rem;background:var(--grey-50, #f9fafb);border-radius:.5rem;border:1px solid var(--grey-200, #e5e7eb)}.edit-form .edit-message-meta .edit-message-author{font-weight:600;color:var(--grey-800, #1f2937)}.edit-form .edit-message-meta .edit-message-time{font-size:.875rem;color:var(--grey-500, #6b7280)}.edit-form textarea{flex-grow:1;margin-bottom:1rem;border:2px solid var(--grey-200, #e5e7eb);border-radius:.75rem;padding:1rem;font-size:1rem;resize:none}.edit-form textarea:focus{border-color:var(--primary-link, #4f46e5);outline:none;box-shadow:0 0 0 3px #4f46e51a}@keyframes fadeInUp{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.d-flex{animation:fadeInUp .3s ease-out}.profile-image{margin-right:.75rem;flex-shrink:0}.sender .profile-image{margin-right:0;margin-left:.75rem}.no-messages{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding:3rem;text-align:center;color:var(--grey-500, #6b7280)}.no-messages i{font-size:3rem;margin-bottom:1rem;color:var(--grey-300, #d1d5db)}.no-messages h3{margin-bottom:.5rem;color:var(--grey-700, #374151)}.report-form .form-group{margin-bottom:1.25rem}.report-form .form-label{display:block;font-weight:500;color:var(--grey-700, #374151);margin-bottom:.5rem;font-size:.875rem}.report-form .message-preview-box{background:var(--grey-50, #f9fafb);border:1px solid var(--grey-200, #e5e7eb);border-radius:.5rem;padding:1rem;font-size:.875rem}.report-form .message-preview-box p{color:var(--grey-700, #374151);line-height:1.5}.report-form .severity-labels{font-size:.75rem}.report-form textarea.form-control{width:100%;border:1px solid var(--grey-300, #d1d5db);border-radius:.5rem;padding:.75rem 1rem;font-size:.9375rem;resize:vertical}.report-form textarea.form-control:focus{border-color:var(--primary-link, #4f46e5);outline:none;box-shadow:0 0 0 3px #4f46e51a}.message-row .message-bubble-wrapper{position:relative}.reaction-trigger-btn{position:absolute;top:50%;transform:translateY(-50%);background:var(--white, #fff);border:1px solid var(--grey-200, #e5e7eb);border-radius:50%;width:28px;height:28px;display:flex;align-items:center;justify-content:center;cursor:pointer;opacity:0;transition:opacity .2s ease,background-color .2s ease,transform .2s ease;box-shadow:0 1px 3px #0000001a;z-index:5;outline:none}.reaction-trigger-btn:focus{outline:none}.reaction-trigger-btn i{font-size:.875rem;color:var(--grey-500, #6b7280);transition:color .2s ease}.reaction-trigger-btn:hover{background:var(--grey-50, #f9fafb);border-color:var(--grey-300, #d1d5db);transform:translateY(-50%) scale(1.1)}.reaction-trigger-btn:hover i{color:var(--primary-link, #4f46e5)}.message-row:hover .reaction-trigger-btn{opacity:1}.sender .reaction-trigger-btn{left:-36px;right:auto}.message-row:not(.sender) .reaction-trigger-btn{right:-36px;left:auto}@keyframes fadeInScale{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}.reactions-display{display:flex;flex-wrap:wrap;gap:.375rem;margin-top:.375rem;padding:0 .25rem}.reaction-badge{display:inline-flex;align-items:center;gap:.25rem;background:var(--grey-100, #f3f4f6);border:1px solid var(--grey-200, #e5e7eb);border-radius:1rem;padding:.25rem .5rem;cursor:pointer;transition:background-color .2s ease,border-color .2s ease,transform .2s ease}.reaction-badge i{font-size:.875rem}.reaction-badge .fa-heart{color:#ef4444}.reaction-badge .fa-thumbs-up{color:#3b82f6}.reaction-badge .fa-smile{color:#f59e0b}.reaction-badge .fa-exclamation-triangle{color:#f97316}.reaction-badge .fa-sad-tear{color:#8b5cf6}.reaction-badge .reaction-count{font-size:.75rem;font-weight:600;color:var(--grey-600, #4b5563)}.reaction-badge:hover{background:var(--grey-200, #e5e7eb);transform:scale(1.05)}.reaction-badge.user-reacted{background:var(--primary-100, #e0e7ff)}.reaction-badge.user-reacted .reaction-count{color:var(--primary-700, #4338ca)}.pinned-toggle-row{display:flex;justify-content:flex-start;padding:.5rem 1rem;background:var(--grey-50, #f9fafb);border-bottom:1px solid var(--grey-200, #e5e7eb)}.pinned-toggle-container{display:flex;align-items:center}.pinned-toggle-btn{display:flex;align-items:center;gap:.5rem;background:var(--primary-50, #eef2ff);border:1px solid var(--primary-200, #c7d2fe);border-radius:.5rem;padding:.375rem .75rem;font-size:.875rem;color:var(--primary-700, #4338ca);cursor:pointer;transition:all .2s ease}.pinned-toggle-btn i.fa-thumbtack{color:var(--primary-500, #6366f1)}.pinned-toggle-btn .pinned-count{font-weight:600;background:var(--primary-500, #6366f1);color:#fff;padding:.125rem .375rem;border-radius:.75rem;font-size:.75rem;min-width:1.25rem;text-align:center}.pinned-toggle-btn .chevron{font-size:.75rem;transition:transform .2s ease}.pinned-toggle-btn .chevron.rotated{transform:rotate(180deg)}.pinned-messages-panel{background:var(--white, #fff);border-bottom:1px solid var(--grey-200, #e5e7eb);box-shadow:0 4px 6px -1px #0000001a;animation:slideDown .2s ease-out}@keyframes slideDown{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}.pinned-panel-header{display:flex;align-items:center;gap:.5rem;padding:.75rem 1rem;background:var(--primary-50, #eef2ff);border-bottom:1px solid var(--primary-100, #e0e7ff);font-weight:600;color:var(--primary-700, #4338ca)}.pinned-panel-header i.fa-thumbtack{color:var(--primary-500, #6366f1)}.pinned-panel-header .close-panel-btn{margin-left:auto;background:none;border:none;cursor:pointer;padding:.25rem .5rem;color:var(--grey-500, #6b7280)}.pinned-panel-header .close-panel-btn:hover{color:var(--grey-700, #374151)}.pinned-messages-list{max-height:200px;overflow-y:auto}.pinned-message-item{display:flex;align-items:flex-start;gap:.75rem;padding:.75rem 1rem;border-bottom:1px solid var(--grey-100, #f3f4f6);cursor:pointer;transition:background-color .15s ease}.pinned-message-item:hover{background:var(--grey-50, #f9fafb)}.pinned-message-item:last-child{border-bottom:none}.pinned-message-content{flex:1;min-width:0}.pinned-message-author{font-weight:500;font-size:.875rem;color:var(--grey-900, #111827);margin-bottom:.25rem}.pinned-message-author .pinned-message-date{font-weight:400;color:var(--grey-500, #6b7280);font-size:.75rem;margin-left:.5rem}.pinned-message-text{font-size:.875rem;color:var(--grey-600, #4b5563);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.pinned-message-image{font-size:.875rem;color:var(--grey-500, #6b7280)}.pinned-message-image i{margin-right:.25rem}.unpin-btn{background:none;border:none;color:var(--grey-400, #9ca3af);padding:.25rem;cursor:pointer;opacity:0;transition:opacity .15s ease,color .15s ease}.unpin-btn:hover{color:var(--danger, #ef4444)}.pinned-message-item:hover .unpin-btn{opacity:1}.pin-indicator{color:var(--primary-500, #6366f1);font-size:.7rem}.message-row.is-pinned{position:relative}.message-row.is-pinned:before{content:"";position:absolute;
3069left:0;top:0;bottom:0;width:3px;background:var(--primary-500, #6366f1);border-radius:0 2px 2px 0}.message-row.is-pinned .message-bubble{box-shadow:0 0 0 1px var(--primary-200, #c7d2fe)}.pin-trigger-btn{position:absolute;top:50%;transform:translateY(-50%);background:var(--white, #fff);border:1px solid var(--grey-200, #e5e7eb);border-radius:50%;width:28px;height:28px;display:flex;align-items:center;justify-content:center;cursor:pointer;opacity:0;transition:opacity .2s ease,background-color .2s ease,transform .2s ease;box-shadow:0 1px 3px #0000001a;z-index:5}.pin-trigger-btn i{font-size:.75rem;color:var(--grey-500, #6b7280);transition:color .2s ease}.pin-trigger-btn:hover{transform:translateY(-50%) scale(1.1)}.pin-trigger-btn:hover i{color:var(--primary-500, #6366f1)}.pin-trigger-btn.is-pinned{opacity:1;background:var(--primary-100, #e0e7ff);border-color:var(--primary-300, #a5b4fc)}.pin-trigger-btn.is-pinned i{color:var(--primary-500, #6366f1)}.message-row:hover .pin-trigger-btn{opacity:1}.sender .pin-trigger-btn{left:-72px;right:auto}.message-row:not(.sender) .pin-trigger-btn{right:-72px;left:auto}.highlight-message{animation:highlightPulse 2s ease-out}@keyframes highlightPulse{0%,to{background-color:transparent}25%,75%{background-color:var(--primary-100, #e0e7ff)}}
3070`],encapsulation:2});let a=d;return a})();var iy=(()=>{let d=class d{};d.\u0275fac=function(n){return new(n||d)},d.\u0275mod=ei({type:d}),d.\u0275inj=Zt({providers:[Ie,re,jt,At,Nt,Yi,Ft,ee,ki,Je,Ei,Vi],imports:[ii,No,xa,Oa,Hn,Ja,Fa,Va,Ma,Ra,ja,Qa,$a,Ia,Li]});let a=d;return a})();Dn(Yt,[Ui,zo,qo,Wo],[]);export{iy as ManageTeamModule};

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.