1import{a as K}from"./chunk-EXRXO7EI.js";import{b as kt}from"./chunk-Y2RYLQWS.js";import{a as Ie,c as yt,e as St,f as wt,g as Se,h as Ne}from"./chunk-NOWLVWF6.js";import{a as Ct}from"./chunk-UU623VRN.js";import{a as xt}from"./chunk-BF2YCTPO.js";import{c as bt,d as gt}from"./chunk-YPNUJAUO.js";import{a as ht,r as ft}from"./chunk-RE4JJFV5.js";import"./chunk-COEKBYWO.js";import"./chunk-E2K2LIS4.js";import{a as ye}from"./chunk-KJKRX6VS.js";import{n as mt,q as _t}from"./chunk-YWHNFDXQ.js";import{f as ot}from"./chunk-GW33KQPR.js";import{T as Ce,U as ke}from"./chunk-TUEKBDZZ.js";import"./chunk-RLPOKPIS.js";import{a as ut}from"./chunk-TPES7EAS.js";import{C as dt,G as pt,b as rt,c as at,h as st,m as lt,p as ct}from"./chunk-QXJM3TTT.js";import{F as G,s as it}from"./chunk-TMOIAHHX.js";import{$a as v,Ba as Xe,Db as Me,Fa as xe,Fb as k,H as Ge,Hb as ee,Ib as l,Jb as f,Kb as H,Lb as X,Mb as Ee,Nb as Be,Rb as F,Sa as L,Sb as z,Tb as j,Wa as g,Xa as x,Yb as oe,Za as U,Zb as Ze,_a as P,aa as ve,ab as w,bb as o,bc as et,cb as a,cc as Re,d as Qe,db as W,eb as M,fa as Ye,fb as V,ga as d,h as qe,jb as Oe,kb as b,la as $,ma as Je,mc as tt,o as m,p as _,qb as u,qc as nt,rc as D,sa as J,sb as ce,tb as c,xb as E,yb as B,za as q,zb as R}from"./chunk-DJNWGYMM.js";import{ea as ie,f as be,g as ge,s as Y}from"./chunk-VOZAGDK7.js";import{a as A,b as ne,j as S}from"./chunk-E5QWB6YB.js";function Q(i){let s=new Set(i.filter(e=>e.type==="UNDO"&&e.undoes).map(e=>e.undoes));return i.filter(e=>e.type!=="UNDO"&&!s.has(e.actionID)).sort((e,n)=>e.seq-n.seq||e.ts-n.ts||e.actionID.localeCompare(n.actionID))}function Le(i){let s=Q(i),e={away:Tt("away"),home:Tt("home"),actionCount:s.length},n={away:new Map,home:new Map},t=new Map;s.filter(p=>p.type==="ROSTER_REBIND"&&p.roster?.binding).forEach(p=>t.set(p.roster.placeholderID,p.roster.binding));for(let p of s){if(p.type==="TEAM_SET"){p.side&&p.team&&(e[p.side].name=Gt(p.team));continue}if(p.type==="ROSTER_BIND"&&p.side&&p.roster?.binding){let C=vt(n[p.side],p.roster.binding);C.label=p.roster.binding.label||C.label,C.jersey=p.roster.binding.jersey||C.jersey;continue}if(!p.side||!p.period)continue;let h=e[p.side],y=Yt(p.person,t),T=()=>vt(n[p.side],y);switch(p.type){case"SHOT":{if(!p.shot)break;let C=T(),O=p.shot.value;O===1&&(C.fta++,p.shot.made&&C.ftm++),O>1&&(C.fga++,p.shot.made&&C.fgm++),O===2&&(C.twoPa++,p.shot.made&&C.twoPm++),O===3&&(C.threePa++,p.shot.made&&C.threePm++);let I=p.shot.made?O:0;C.pts+=I,h.playerPoints+=I,h.score+=I,h.pointsByPeriod[p.period]+=I,h.shots.push({actionID:p.actionID,identityID:C.identityID,period:p.period,value:O,made:p.shot.made,courtX:p.courtX,courtY:p.courtY});break}case"REBOUND":{let C=T();p.kind==="OREB"&&C.oreb++,p.kind==="DREB"&&C.dreb++,C.reb=C.oreb+C.dreb;break}case"ASSIST":T().ast++;break;case"STEAL":T().stl++;break;case"BLOCK":T().blk++;break;case"TURNOVER":T().turnovers++;break;case"PERSONAL_FOUL":T().pf++,h.teamFoulsByPool[Ot(p.period)]++;break;case"TECHNICAL_FOUL":{let C=e[p.side==="home"?"away":"home"];
1C.score+=2,C.teamTechnicalPoints+=2,C.pointsByPeriod[p.period]+=2,h.teamFoulsByPool[Ot(p.period)]++,p.technical?.countsAsPersonalFoul&&p.technical.targetType==="player"&&T().pf++,h.technicals.push(p);break}case"TIMEOUT":h.timeoutsUsedByPool[Jt(p.period)]++;break;case"EJECTION":h.ejections.push(ne(A({},p),{person:y}));break}}let r=[...e.away.shots,...e.home.shots];for(let p of s.filter(h=>h.type==="SHOT_LOCATION_SET")){let h=r.find(y=>y.actionID===p.targetActionID);h&&(h.courtX=p.courtX,h.courtY=p.courtY)}return Pt(e.away,n.away),Pt(e.home,n.home),e}function Gt(i){return i?.shortName?.trim()||i?.name?.trim()||void 0}function Et(i){let s={};for(let e of Q(i))e.type==="TEAM_SET"&&e.side&&e.team&&(s[e.side]=e.team);return s}function Tt(i){return{side:i,score:0,playerPoints:0,teamTechnicalPoints:0,pointsByPeriod:{H1:0,H2:0,OT1:0,OT2:0},teamFoulsByPool:{H1:0,H2:0},bonusByPeriod:{H1:null,H2:null,OT1:null,OT2:null},timeoutsUsedByPool:{REG:0,OT1:0,OT2:0},timeoutsRemainingByPool:{REG:3,OT1:1,OT2:1},players:[],shots:[],technicals:[],ejections:[]}}function Pt(i,s){i.players=[...s.values()].sort((e,n)=>(e.jersey||"").localeCompare(n.jersey||"",void 0,{numeric:!0})),i.timeoutsRemainingByPool.REG=Math.max(0,3-i.timeoutsUsedByPool.REG),i.timeoutsRemainingByPool.OT1=Math.max(0,1-i.timeoutsUsedByPool.OT1),i.timeoutsRemainingByPool.OT2=Math.max(0,1-i.timeoutsUsedByPool.OT2),i.bonusByPeriod.H1=Mt(i.teamFoulsByPool.H1),i.bonusByPeriod.H2=Mt(i.teamFoulsByPool.H2),i.bonusByPeriod.OT1=i.bonusByPeriod.H2,i.bonusByPeriod.OT2=i.bonusByPeriod.H2}function Yt(i,s){return i?.placeholderID&&s.has(i.placeholderID)?s.get(i.placeholderID):i}function te(i){return i?.ptKey?`pt:${i.ptKey}`:i?.playerID?`player:${i.playerID}`:i?.placeholderID?`placeholder:${i.placeholderID}`:i?.personID?`person:${i.personID}`:"unknown"}function vt(i,s){let e=te(s),n=i.get(e);return n||(n={identityID:e,playerID:s?.playerID,label:s?.label||"Unknown player",jersey:s?.jersey,pts:0,fgm:0,fga:0,twoPm:0,twoPa:0,threePm:0,threePa:0,ftm:0,fta:0,oreb:0,dreb:0,reb:0,ast:0,stl:0,blk:0,turnovers:0,pf:0},i.set(e,n)),n}function Ot(i){return i==="H1"?"H1":"H2"}function Jt(i){return i==="OT1"?"OT1":i==="OT2"?"OT2":"REG"}function Mt(i){return i>=10?"Double bonus":i>=7?"Bonus":null}var de=20,Zt=40;function Ve(i,s){let e=(s??"").trim(),n=(i??"").trim();return e||(n?`#${n}`:"")}function en(i){let s=(i??"").replace(/[,\t()]+/g," ").trim();if(!s)return null;let e=s.split(/\s+/).filter(Boolean),n=null,t=/^#?(\d{1,3})$/.exec(e[0]);t&&(n=t[1],e.shift());let r=e.join(" ").slice(0,Zt).trim();return!n&&!r?null:{raw:i,jersey:n,name:r,label:Ve(n,r)}}function pe(i,s){let e=[],n=new Map;for(let p of s){let h=(p.jersey??"").trim();h&&n.set(h,(n.get(h)??0)+1)}let t=new Set(i.map(p=>(p.jersey??"").trim()).filter(Boolean));for(let[p,h]of n)h===2?e.push(`#${p} is used twice`):h>2?e.push(`#${p} is used ${h} times`):t.has(p)&&e.push(`#${p} is already on this team`);let r=i.length+s.length-de;return r>0&&e.push(s.length===1?`This team already has ${de} players`:`Only ${de} players per team \u2014 remove ${r} line${r===1?"":"s"}`),e}function Bt(i,s=[]){let e=[],n=[];for(let r of(i??"").split(/\r?\n/)){if(!r.trim())continue;let p=en(r);p?e.push(p):n.push(r.trim())}let t=pe(s,e);return{lines:e,errors:t,skipped:n,valid:t.length===0}}function Rt(i,s){return{placeholderID:`${i}:${K()}`,label:s.label,jersey:s.jersey??void 0,role:"player"}}function It(i){return i.map(s=>{let e=(s.jersey??"").trim(),n=s.label===`#${e}`?"":s.label;return[e,n].filter(Boolean).join(" ")}).join(` 2`)}var De=[{action:{type:"SHOT",value:1,made:!0},value:"+1",caption:"Made FT",aria:"Made free throw",tone:"green"},{action:{type:"SHOT",value:2,made:!0},value:"+2",caption:"Made 2",aria:"Made two-point shot",tone:"green"},{action:{type:"SHOT",value:3,made:!0},value:"+3",caption:"Made 3",aria:"Made three-point shot",tone:"green"},{action:{type:"SHOT",value:1,made:!1},value:"\u20131",caption:"Miss FT",aria:"Missed free throw",tone:"red"},{action:{type:"SHOT",value:2,made:!1},value:"\u20132",caption:"Miss 2",aria:"Missed two-point shot",tone:"red"},{action:{type:"SHOT",value:3,made:!1},value:"\u20133",caption:"Miss 3",aria:"Missed three-point shot",tone:"red"}],Nt=[{action:{type:"REBOUND",kind:"OREB"},value:"OREB",aria:"Offensive rebound",tone:"green"},{action:{type:"REBOUND",kind:"DREB"},value:"DREB",aria:"Defensive rebound",tone:"green"},{action:{type:"ASSIST"},value:"AST",aria:"Assist",tone:"green"},{action:{type:"STEAL"}
2,value:"STL",aria:"Steal",tone:"green"},{action:{type:"BLOCK"},value:"BLK",aria:"Block",tone:"green"},{action:{type:"TURNOVER"},value:"TO",aria:"Turnover",tone:"red"},{action:{type:"PERSONAL_FOUL"},value:"FOUL",aria:"Personal foul",tone:"red"}];function me(i,s){return!i||!s||i.type!==s.type?!1:i.type==="SHOT"&&s.type==="SHOT"?i.value===s.value&&i.made===s.made:i.type==="REBOUND"&&s.type==="REBOUND"?i.kind===s.kind:!0}function Ae(i){switch(i.type){case"SHOT":return`${i.made?"MADE":"MISS"} ${i.value===1?"FT":i.value}`;case"REBOUND":return i.kind==="OREB"?"OFF. REBOUND":"DEF. REBOUND";case"ASSIST":return"ASSIST";case"STEAL":return"STEAL";case"BLOCK":return"BLOCK";case"TURNOVER":return"TURNOVER";case"PERSONAL_FOUL":return"FOUL"}}function Lt(i){return i.type==="SHOT"?i.made?"green":"red":i.type==="TURNOVER"||i.type==="PERSONAL_FOUL"?"red":"green"}function _e(i){switch(i.type){case"SHOT":return{type:"SHOT",shot:{value:i.value,made:i.made}};case"REBOUND":return{type:"REBOUND",kind:i.kind};default:return{type:i.type}}}var Vt=new Set(["SHOT","REBOUND","ASSIST","STEAL","BLOCK","TURNOVER","PERSONAL_FOUL"]);function Dt(i,s){let e=i.person,n=e?`${e.jersey?"#"+e.jersey+" ":""}${e.label}`.trim():"",t=s?.players.find(p=>p.identityID===te(e)),r="";switch(i.type){case"SHOT":{let p=i.shot?.value??0;r=i.shot?.made?`+${p} \xB7 ${t?.pts??p} PTS`:`\u2013${p===1?"FT":p} \xB7 ${p===1?`${t?.ftm??0}/${t?.fta??0} FT`:`${t?.fgm??0}/${t?.fga??0} FG`}`;break}case"REBOUND":r=`${i.kind==="OREB"?"OREB":"DREB"} \xB7 ${t?.reb??1} REB`;break;case"ASSIST":r=`AST \xB7 ${t?.ast??1} AST`;break;case"STEAL":r=`STL \xB7 ${t?.stl??1} STL`;break;case"BLOCK":r=`BLK \xB7 ${t?.blk??1} BLK`;break;case"TURNOVER":r=`TO \xB7 ${t?.turnovers??1} TO`;break;case"PERSONAL_FOUL":r=`FOUL \xB7 ${t?.pf??1} PF`;break;default:r=i.type.replaceAll("_"," ").toLowerCase()}return{who:n,what:r}}var $e=5;function ue(i){let s=(i||"").trim().split(/\s+/).filter(Boolean);return s.length?s.length===1?s[0].slice(0,2).toUpperCase():(s[0][0]+s[s.length-1][0]).toUpperCase():"?"}function tn(i){let s=(i||"").trim().split(/\s+/).filter(Boolean);return s.length<2?ue(i):(s[0].slice(0,2)+s[s.length-1][0]).toUpperCase()}function nn(i,s){let e=(i.jersey||"").trim(),n=(s.jersey||"").trim(),t=e&&/^\d+$/.test(e)?parseInt(e,10):NaN,r=n&&/^\d+$/.test(n)?parseInt(n,10):NaN;return!isNaN(t)&&!isNaN(r)?t-r||e.localeCompare(n):isNaN(t)?isNaN(r)?e&&n?e.localeCompare(n):e?-1:n?1:ue(i.label).localeCompare(ue(s.label))||(i.label||"").localeCompare(s.label||""):1:-1}function Fe(i,s,e=[],n=$e){let t=[...i].sort(nn),r=new Set((s?.ejections||[]).map(C=>te(C.person))),p=new Set((e||[]).map(C=>C.personID).filter(Boolean)),h=new Map,y=new Set;for(let C of t)if((C.jersey||"").trim()){let O=C.jersey.trim();h.set(C,O),y.add(O)}let T=new Map;for(let C of t){if(h.has(C))continue;let O=ue(C.label);if(y.has(O)&&(O=tn(C.label)),y.has(O)){let I=ue(C.label),N=(T.get(I)||1)+1;T.set(I,N),O=`${I}${N}`}h.set(C,O),y.add(O)}return t.map(C=>{let O=s?.players.find(Pe=>Pe.identityID===te(C)),I=O?.pf??0,N=I>=n,he=r.has(te(C)),se=!!C.personID&&p.has(C.personID),le=!!(C.jersey||"").trim(),fe=le&&C.label===`#${C.jersey}`?"":C.label,Z=[le?`Number ${C.jersey}`:"",fe,I?`${I} ${I===1?"foul":"fouls"}`:""];return N&&Z.push("fouled out"),he&&Z.push("ejected"),se&&Z.push("discipline warning"),{person:C,label:h.get(C),numbered:le,line:O,fouls:I,fouledOut:N,ejected:he,warned:se,aria:Z.filter(Boolean).join(", ")}})}var we=(()=>{class i{api;state$=new ge("synced");pendingCount$=new ge(0);response$=new be;error$=new ge(null);session;chain=Promise.resolve();inFlight=!1;idleTimer;retryTimer;retryCount=0;wasOffline=!1;destroyed=!1;onlineHandler=()=>this.resume(!0);offlineHandler=()=>{this.wasOffline=!0,this.state$.next("offline")};constructor(e){this.api=e,typeof window<"u"&&(window.addEventListener("online",this.onlineHandler),window.addEventListener("offline",this.offlineHandler))}initialize(e,n,t,r,p,h,y){return S(this,null,function*(){return this.serialize(()=>this.initializeSession(e,n,t,r,p,h,y))})}initializeSession(e,n,t,r,p,h,y){return S(this,null,function*(){let T=yield this.read(e),C=new Set(y.map(N=>N.actionID)),O=T?.actions.some(N=>!N.synced);this.session=T&&O?T:{gameID:e,scoreID:n,clientID:t,profileID:r,profileVersion:p,homeIsTo
2pTeam:h,actions:T?.scoreID===n?T.actions:[]},this.session.scoreID=O?this.session.scoreID:n,O||(this.session.clientID=t,this.session.profileID=r,this.session.profileVersion=p,this.session.homeIsTopTeam=h);for(let N of this.session.actions)C.has(N.action.actionID)&&(N.synced=!0);yield this.write(),this.publishPending();let I=this.session.actions.filter(N=>!C.has(N.action.actionID)).map(N=>N.action);return this.pendingCount$.value&&this.schedule(),I})}enqueue(e,n=!1){return this.serialize(()=>S(this,null,function*(){if(!this.session)throw new Error("Basketball sync is not initialized.");let t=Array.isArray(e)?e:[e],r=this.session.actions,p=new Set(r.map(y=>y.action.actionID)),h=[...r];for(let y of t)p.has(y.actionID)||(h.push({action:y,synced:!1}),p.add(y.actionID));h.sort((y,T)=>y.action.seq-T.action.seq),this.session.actions=h;try{yield this.write()}catch(y){throw this.session.actions=r,y}this.publishPending(),n||this.pendingCount$.value>=5?this.flush():this.schedule()}))}configure(e,n,t){return this.serialize(()=>S(this,null,function*(){if(!this.session)throw new Error("Basketball sync is not initialized.");this.session.profileID=e,this.session.profileVersion=n,this.session.homeIsTopTeam=t,yield this.write()}))}serialize(e){let n=this.chain.then(e,e);return this.chain=n.catch(()=>{}),n}resume(e=!1){this.error$.next(null),this.retryCount=0,this.wasOffline||=e,this.flush()}schedule(){this.idleTimer&&clearTimeout(this.idleTimer),this.idleTimer=setTimeout(()=>{this.flush()},1e3)}flush(){return S(this,null,function*(){if(this.destroyed||this.inFlight||!this.session)return;if(typeof navigator<"u"&&!navigator.onLine){this.wasOffline=!0,this.state$.next("offline");return}let e=this.session.actions.filter(r=>!r.synced);if(!e.length){this.state$.next("synced"),this.error$.next(null);return}let n=this.wasOffline||e.length>100,t=e.slice(0,rn(this.wasOffline,e.length));this.inFlight=!0,this.state$.next("saving");try{let r=yield Y(this.api.post(`BasketballScoring/sync/${this.session.gameID}`,{scoreID:this.session.scoreID,clientID:this.session.clientID,profileID:this.session.profileID,profileVersion:this.session.profileVersion,homeIsTopTeam:this.session.homeIsTopTeam,actions:t.map(h=>h.action)})),p=new Set(r.ackedActionIDs||[]);yield this.serialize(()=>S(this,null,function*(){for(let h of this.session.actions)p.has(h.action.actionID)&&(h.synced=!0);yield this.write()})),this.retryCount=0,this.error$.next(r.retryable?r.reason||"Publication needs another try.":null),this.response$.next(r),this.publishPending(),this.wasOffline=this.pendingCount$.value>5&&n,this.state$.next(this.pendingCount$.value?"saving":r.retryable?"error":"synced"),this.pendingCount$.value&&setTimeout(()=>{this.flush()},0)}catch(r){this.retryCount++;let p=typeof r?.error=="string"?r.error:"The score is safe on this device. Sync will retry.";if(this.error$.next(p),typeof navigator<"u"&&!navigator.onLine)this.wasOffline=!0,this.state$.next("offline");else if(this.retryCount<=5){this.state$.next("saving");let h=Math.min(15e3,1e3*2**(this.retryCount-1));this.retryTimer=setTimeout(()=>{this.flush()},h)}else this.state$.next("error")}finally{this.inFlight=!1}})}publishPending(){let e=this.session?.actions.filter(n=>!n.synced).length||0;this.pendingCount$.next(e)}read(e){return S(this,null,function*(){if(typeof indexedDB>"u")return;let n=yield At();return new Promise((t,r)=>{let p=n.transaction("sessions","readonly").objectStore("sessions").get(e);p.onsuccess=()=>t(p.result),p.onerror=()=>r(p.error)})})}write(){return S(this,null,function*(){if(!this.session||typeof indexedDB>"u")return;let e=yield At();yield new Promise((n,t)=>{let r=e.transaction("sessions","readwrite").objectStore("sessions").put(this.session);r.onsuccess=()=>n(),r.onerror=()=>t(r.error)})})}ngOnDestroy(){this.destroyed=!0,this.idleTimer&&clearTimeout(this.idleTimer),this.retryTimer&&clearTimeout(this.retryTimer),typeof window<"u"&&(window.removeEventListener("online",this.onlineHandler),window.removeEventListener("offline",this.offlineHandler)),this.state$.complete(),this.pendingCount$.complete(),this.response$.complete(),this.error$.complete()}static \u0275fac=function(n){return new(n||i)(qe(ye))};static \u0275prov=Qe({token:i,factory:i.\u0275fac})}return i})(),ze;function At(){return ze||(ze=new Promise((i,s)=>{let e=indexedDB.open("rp-basketball-scoring",1);e.onupgradeneeded=()=>{e.result.objectStoreNames.contains("sessions")||e.result.createObjectStore("sessions",{keyPath:"gameID"})},e.onsuccess=()=>i(e.result),e.onerror=()=>s(e.error)})),ze}function rn(i,s){return i||s>100?100:5}function sn(i,s){if(i&1&&(M(0,"th"),l(1),V()),i&2){let e=s.$implicit,n=c();k("bls-now",!n.ended&&e===n.period),d(),f(e)}}function ln(i,s){if(i&1&&(M(0,"td"),l(1),V()),i&2){let e=s.$implicit,n=c().$implicit,t=c();
2k("bls-now",!t.ended&&e===t.period),d(),f(t.stats[n].pointsByPeriod[e])}}function cn(i,s){if(i&1&&(M(0,"tr")(1,"td",1),l(2),V(),P(3,ln,2,3,"td",2,U),M(5,"td",3),l(6),V()()),i&2){let e=s.$implicit,n=c();d(2),f(e==="away"?n.awayName:n.homeName),d(),v(n.periods),d(2),k("bls-now",n.ended),d(),f(n.stats[e].score)}}var $t=(()=>{class i{stats;period="H1";ended=!1;awayName="Away";homeName="Home";theme="dark";sides=["away","home"];get periods(){let e=["H1","H2"],n=t=>this.period===t||this.stats.away.pointsByPeriod[t]>0||this.stats.home.pointsByPeriod[t]>0;return(n("OT1")||n("OT2"))&&e.push("OT1"),n("OT2")&&e.push("OT2"),e}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=q({type:i,selectors:[["rp-basketball-line-score"]],inputs:{stats:"stats",period:"period",ended:"ended",awayName:"awayName",homeName:"homeName",theme:"theme"},decls:12,vars:5,consts:[[1,"bls"],[1,"bls-team"],[3,"bls-now"],[1,"bls-total"]],template:function(n,t){n&1&&(M(0,"table",0)(1,"thead")(2,"tr")(3,"th",1),l(4,"Team"),V(),P(5,sn,2,3,"th",2,U),M(7,"th",3),l(8),V()()(),M(9,"tbody"),P(10,cn,7,4,"tr",null,U),V()()),n&2&&(k("bls--dark",t.theme==="dark"),d(5),v(t.periods),d(2),k("bls-now",t.ended),d(),f(t.ended?"FINAL":"T"),d(2),v(t.sides))},dependencies:[G],styles:["[_nghost-%COMP%]{display:block}.bls[_ngcontent-%COMP%]{width:100%;border-collapse:collapse;font-variant-numeric:tabular-nums;font-size:12px}.bls[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .bls[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:3px 6px;text-align:center;white-space:nowrap}.bls[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{font-size:10px;font-weight:800;letter-spacing:.06em;opacity:.75}.bls[_ngcontent-%COMP%] .bls-team[_ngcontent-%COMP%]{text-align:left;font-weight:600;max-width:140px;overflow:hidden;text-overflow:ellipsis}.bls[_ngcontent-%COMP%] .bls-total[_ngcontent-%COMP%]{font-weight:800}.bls[_ngcontent-%COMP%] .bls-now[_ngcontent-%COMP%]{background:#ffd60038;border-radius:4px}.bls--dark[_ngcontent-%COMP%]{color:#fff}"]})}return i})();function pn(i,s){if(i&1&&(o(0,"span",6),l(1),a()),i&2){let e=c();k("bsb-tag--practice",e.kindTone==="practice")("bsb-tag--profile",e.kindTone==="profile"),d(),f(e.kindLabel)}}function mn(i,s){i&1&&(o(0,"b",9),l(1),a()),i&2&&(d(),f(s))}function _n(i,s){if(i&1&&(o(0,"div",2)(1,"span",7),l(2),tt(3,"truncateMiddle"),a(),o(4,"span",8),g(5,mn,2,1,"b",9),l(6),a(),o(7,"span",10),l(8),a()()),i&2){let e,n=s.$implicit,t=c();d(2),f(nt(3,4,t.name(n),t.nameLimit,!1,"\u2026")),d(3),x((e=t.started&&t.bonus(n))?5:-1,e),d(),H(" ",t.meta(n)," "),d(2),f(t.stats[n].score)}}function un(i,s){if(i&1&&(o(0,"span",12),l(1),a()),i&2){let e=c(2);d(),f(e.expanded?"\u25B4":"\u25BE")}}function hn(i,s){i&1&&(o(0,"span",13),l(1),a()),i&2&&(d(),f(s))}function fn(i,s){if(i&1){let e=b();o(0,"div",3)(1,"button",11),u("click",function(){m(e);let t=c();return _(t.toggle.emit())}),g(2,un,2,1,"span",12),o(3,"span"),l(4),a()(),g(5,hn,2,1,"span",13),o(6,"button",14),u("click",function(){m(e);let t=c();return _(t.syncTap.emit())}),l(7),a(),o(8,"span",15)(9,"button",16),u("click",function(){m(e);let t=c();return _(t.undo.emit())}),o(10,"mat-icon"),l(11,"undo"),a()(),o(12,"button",17),u("click",function(){m(e);let t=c();return _(t.redo.emit())}),o(13,"mat-icon"),l(14,"redo"),a()()()()}if(i&2){let e,n=c();d(),w("disabled",!n.expandable),L("aria-expanded",n.expandable?n.expanded:null)("aria-label",n.expandable?n.toggleLabel:null),d(),x(n.expandable?2:-1),d(2),f(n.period),d(),x((e=n.previousPeriodHint)?5:-1,e),d(),k("bsb-sync--offline",n.syncState==="offline")("bsb-sync--error",n.syncState==="error"),d(),f(n.syncLabel),d(2),w("disabled",!n.canUndo||n.undoLocked),d(3),w("disabled",!n.canRedo||n.undoLocked)}}function bn(i,s){if(i&1){let e=b();o(0,"div",4)(1,"span",18),l(2),a(),o(3,"button",14),u("click",function(){m(e);let t=c();return _(t.syncTap.emit())}),l(4),a()()}if(i&2){let e=c();d(2),f(e.staticLabel),d(),k("bsb-sync--offline",e.syncState==="offline")("bsb-sync--error",e.syncState==="error"),d(),f(e.syncLabel)}}function gn(i,s){if(i&1&&(o(0,"div",5),W(1,"rp-basketball-line-score",19),a()),i&2){let e=c();d(),w("stats",e.stats)("period",e.period)("ended",e.ended)("awayName",e.awayName)("homeName",e.homeName)}}var Ft=(()=>
2{class i{stats;awayName="Away";homeName="Home";period="H1";started=!1;ended=!1;floating=!1;expanded=!1;expandable=!0;nameLimit=24;canUndo=!1;canRedo=!1;undoLocked=!1;syncState="synced";syncLabel="Saved";kindLabel=null;kindTone="profile";undo=new $;redo=new $;toggle=new $;syncTap=new $;sides=["away","home"];name(e){return e==="away"?this.awayName:this.homeName}meta(e){let n=this.stats[e],t=n.teamFoulsByPool[this.period==="H1"?"H1":"H2"],r=n.timeoutsRemainingByPool[this.period==="OT1"?"OT1":this.period==="OT2"?"OT2":"REG"];return`${t} ${t===1?"foul":"fouls"} \xB7 ${r} TO`}bonus(e){let n=this.stats[e].bonusByPeriod[this.period];return n==="Double bonus"?"DBL BONUS":n?"BONUS":null}get previousPeriodHint(){let n={H2:"H1",OT1:"H2",OT2:"OT1"}[this.period];return n?`${n} \xB7 ${this.stats.away.pointsByPeriod[n]}\u2013${this.stats.home.pointsByPeriod[n]}`:null}get staticLabel(){return this.ended?"FINAL":"SETUP"}get toggleLabel(){return this.expanded?"Hide the scoring by period":"Show the scoring by period"}get live(){return this.started&&!this.ended}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=q({type:i,selectors:[["rp-basketball-scoreboard"]],inputs:{stats:"stats",awayName:"awayName",homeName:"homeName",period:"period",started:"started",ended:"ended",floating:"floating",expanded:"expanded",expandable:"expandable",nameLimit:"nameLimit",canUndo:"canUndo",canRedo:"canRedo",undoLocked:"undoLocked",syncState:"syncState",syncLabel:"syncLabel",kindLabel:"kindLabel",kindTone:"kindTone"},outputs:{undo:"undo",redo:"redo",toggle:"toggle",syncTap:"syncTap"},decls:7,vars:5,consts:[["role","region","aria-label","Scoreboard",1,"bsb"],[1,"bsb-tag",3,"bsb-tag--practice","bsb-tag--profile"],[1,"bsb-row"],[1,"bsb-status"],[1,"bsb-status","bsb-status--static"],[1,"bsb-linescore"],[1,"bsb-tag"],[1,"bsb-name"],[1,"bsb-meta"],[1,"bsb-bonus"],[1,"bsb-pts"],["type","button",1,"bsb-period",3,"click","disabled"],["aria-hidden","true",1,"bsb-chev"],[1,"bsb-hint"],["type","button",1,"bsb-sync",3,"click"],[1,"bsb-undo"],["type","button","aria-label","Undo the last action",1,"bsb-tool",3,"click","disabled"],["type","button","aria-label","Redo the undone action",1,"bsb-tool",3,"click","disabled"],[1,"bsb-final"],["theme","dark",3,"stats","period","ended","awayName","homeName"]],template:function(n,t){n&1&&(o(0,"section",0),g(1,pn,2,5,"span",1),P(2,_n,9,9,"div",2,U),g(4,fn,15,13,"div",3)(5,bn,5,6,"div",4),g(6,gn,2,5,"div",5),a()),n&2&&(k("bsb--floating",t.floating),d(),x(t.kindLabel?1:-1),d(),v(t.sides),d(2),x(t.live?4:5),d(2),x(t.expanded&&t.started?6:-1))},dependencies:[G,ke,Ce,$t,kt],styles:['[_ngcontent-%COMP%]:root{--rp-navy-900: #10243f;--rp-navy-800: #143b67;--rp-navy-700: #1a3668;--rp-navy-600: #244f7e;--rp-text: #122033;--rp-text-muted: #64798c;--rp-text-subtle: #667085;--rp-divider: #dce5ee;--rp-divider-soft: #e8edf3;--rp-border-control: #8792a5;--rp-surface: #ffffff;--rp-surface-tint: #f2f7fc;--rp-surface-head: #eef2f6;--rp-surface-sunken: #f7f9fc;--rp-ok-bg: #eaf6ea;--rp-ok-border: #7fb583;--rp-ok-fg: #2e7d32;--rp-warn-bg: #fff3e0;--rp-warn-border: #c9922f;--rp-warn-fg: #9a4a00;--rp-danger-bg: #ffebee;--rp-danger-border: #d97b7b;--rp-danger-fg: #c62828;--rp-info-bg: #eef2fb;--rp-info-border: #8fa6cf;--rp-info-fg: #244f7e;--rp-neutral-bg: #f1f3f6;--rp-neutral-border: #9aa4b2;--rp-neutral-fg: #5a6b7d;--rp-gold-bg: #fdf6e3;--rp-gold-ring: #d4a531;--rp-gold-fg: #6b4700;--rp-silver-bg: #f1f3f6;--rp-silver-ring: #9ba5b1;--rp-silver-fg: #48535f;--rp-bronze-bg: #f8ede6;--rp-bronze-ring: #c4855f;--rp-bronze-fg: #6e3b1d;--rp-focus-ring: #244f7e;--rp-radius-control: 6px;--rp-radius-card: 8px;--rp-radius-row: 10px;--rp-radius-panel: 16px;--rp-shadow-card: 0 1px 3px rgba(15, 31, 53, .05);--rp-shadow-panel: 0 1px 3px rgba(15, 31, 53, .04), 0 8px 32px rgba(15, 31, 53, .07)}.bsb[_ngcontent-%COMP%]{position:relative;background:#10243fed;color:#fff;border-radius:16px;-webkit-user-select:none;user-select:none;padding:8px 8px 6px}.bsb--floating[_ngcontent-%COMP%]{position:relative;background:#10243fed;color:#fff;border-radius:16px;-webkit-user-select:none;user-select:none;box-shadow:0 6px 20px #0006;backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);padding:8px 8px 6px}.bsb-tag[_ngcontent-%COMP%]{position:absolute;top:-9px;left:12px;padding:2px 9px;border-radius:999px;font-size:9px;font-weight:800;letter-spacing:.08em;background:#7b1fa2;color:#fff;border:1px solid rgba(255,255,255,.35);white-space:nowrap}.bsb-tag--practice[_ngcontent-%COMP%]{background:#455a64}.bsb-tag--profile[_ngcontent-%COMP%]{background:#244f7e}.bsb-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:10px;padding:2px 8px;min-height:30px}
2.bsb-name[_ngcontent-%COMP%]{font-size:15px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bsb-meta[_ngcontent-%COMP%]{font-size:10px;font-weight:700;opacity:.8;white-space:nowrap;letter-spacing:.02em}.bsb-bonus[_ngcontent-%COMP%]{display:inline-block;margin-right:4px;padding:1px 5px;border-radius:999px;background:#ffd600;color:#10243f;font-size:8px;font-weight:900;letter-spacing:.04em;opacity:1}.bsb-pts[_ngcontent-%COMP%]{font-size:24px;font-weight:800;font-variant-numeric:tabular-nums;min-width:34px;text-align:right;line-height:1}.bsb-status[_ngcontent-%COMP%]{display:flex;align-items:center;gap:9px;padding:5px 8px 0;font-size:11px;font-weight:800;letter-spacing:.04em}.bsb-status--static[_ngcontent-%COMP%]{justify-content:space-between;padding-top:6px}.bsb-period[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:3px;border:none;background:transparent;color:inherit;font:inherit;font-size:16px;font-weight:800;letter-spacing:0;padding:4px 4px 4px 0;margin:-4px 0;cursor:pointer}.bsb-period[_ngcontent-%COMP%] .bsb-chev[_ngcontent-%COMP%]{font-size:10px;opacity:.7}.bsb-period[_ngcontent-%COMP%]:disabled{cursor:default}.bsb-period[_ngcontent-%COMP%]:focus{outline:none}.bsb-period[_ngcontent-%COMP%]:focus-visible{outline:2px solid #ffffff;outline-offset:2px}.bsb-hint[_ngcontent-%COMP%]{opacity:.75}.bsb-sync[_ngcontent-%COMP%]{border:none;border-radius:999px;font-size:11px;font-weight:700;padding:4px 10px;background:#2e7d32;color:#fff}.bsb-sync--offline[_ngcontent-%COMP%]{background:#ef6c00}.bsb-sync--error[_ngcontent-%COMP%]{background:#c62828;cursor:pointer}.bsb-sync[_ngcontent-%COMP%]{margin-left:auto;font-size:10px;padding:3px 9px}.bsb-undo[_ngcontent-%COMP%]{display:inline-flex;gap:6px}.bsb-tool[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border:none;border-radius:50%;background:#ffffff24;color:#fff;cursor:pointer;position:relative}.bsb-tool[_ngcontent-%COMP%]:before{content:"";position:absolute;inset:-8px}.bsb-tool[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px}.bsb-tool[_ngcontent-%COMP%]:disabled{opacity:.35;cursor:default}.bsb-tool[_ngcontent-%COMP%]:active{background:#ffffff3d}.bsb-tool[_ngcontent-%COMP%]:focus{outline:none}.bsb-tool[_ngcontent-%COMP%]:focus-visible{outline:2px solid #ffffff;outline-offset:2px}.bsb-final[_ngcontent-%COMP%]{font-size:13px;letter-spacing:1px;color:#ffd600}.bsb-linescore[_ngcontent-%COMP%]{margin-top:6px;border-top:1px solid rgba(255,255,255,.15);padding-top:6px}']})}return i})();var xn=400,Cn=150,zt=10,jt=(()=>{class i{el;rpLongPressDisabled=!1;rpLongPress=new $;held=!1;pressTimer=null;holdTimer=null;origin=null;captured=null;pressFired=!1;swallowClick=e=>{this.pressFired&&(this.pressFired=!1,e.stopImmediatePropagation(),e.preventDefault())};constructor(e){this.el=e,e.nativeElement.addEventListener("click",this.swallowClick,!0)}onPressStart(e){if(this.rpLongPressDisabled||e.button!==0||!e.isPrimary)return;e.preventDefault(),this.cancelPress(),this.pressFired=!1,this.origin={x:e.clientX,y:e.clientY};let n=e.currentTarget;if(n?.setPointerCapture)try{n.setPointerCapture(e.pointerId),this.captured={el:n,pointerId:e.pointerId}}catch{}this.holdTimer=setTimeout(()=>{this.holdTimer=null,this.held=!0},Cn),this.pressTimer=setTimeout(()=>{this.pressTimer=null,this.pressFired=!0,this.cancelPress(),this.rpLongPress.emit(e)},xn)}onPressMove(e){if(!this.origin||this.pressTimer===null)return;let n=e.clientX-this.origin.x,t=e.clientY-this.origin.y;n*n+t*t>zt*zt&&this.cancelPress()}onPressEnd(){this.cancelPress()}onContextMenu(e){(this.origin||this.pressFired)&&e.preventDefault()}ngOnDestroy(){this.cancelPress(),this.el.nativeElement.removeEventListener("click",this.swallowClick,!0)}cancelPress(){this.pressTimer!==null&&(clearTimeout(this.pressTimer),this.pressTimer=null),this.holdTimer!==null&&(clearTimeout(this.holdTimer),this.holdTimer=null),this.held=!1,this.origin=null;let e=this.captured;if(e){this.captured=null;try{e.el.releasePointerCapture(e.pointerId)}catch{}}}static \u0275fac=function(n){return new(n||i)(J(Ge))};static \u0275dir=Xe({type:i,selectors:[["","rpLongPress",""]],hostVars:2,hostBindings:function(n,t){n&1&&u("pointerdown",function(p){return t.onPressStart(p)})("pointermove",function(p){return t.onPressMove(p)})("pointerup",function(){return t.onPressEnd()})("pointercancel",function(){return t.onPressEnd()})("contextmenu",function(p){return t.onContextMenu(p)}),n&2&&k("rp-held",t.held)},inputs:{rpLongPressDisabled:"rpLongPressDisabled"},outputs:{rpLongPress:"rpLongPress"}})}return i})();var kn=["list"];function yn(i,s){if(i&1&&(o(0,"span",5),l(1),a()),i&2){let e=c();d(),f(e.bonus)}}function Sn(i,s){i&1&&(o(0,"span",12),l(1,"EJ"),a())}function wn(i,s){if(i&1&&(o(0,"span",13),l(1),a()),i&2){let e=c().$implicit;d(),f(e.fouls)}}function Tn(i,s){i&1&&(o(0,"span",14),l(1,"!"),a())}function Pn(i,s){if(i&1){let e=b();o(0,"button",10),u("rpLongPress",function(){let t=m(e).$implicit,r=c();return _(r.longPress.emit(t))})("click",function(){let t=m(e).$implicit,r=c();return _(r.pick.emit(t))}),o(1,"span",11),l(2),a(),g(3,Sn,2,0,"span",12)(4,wn,2,1,"span",13),g(5,Tn,2,0,"span",14),a()}if(i&2){let e=s.$implicit;k("chip--out",e.fouledOut||e.ejected)("chip--initials",!e.numbered)("chip--long",e.label.length>2),L("aria-label",e.aria),d(2),f(e.label),d(),x(e.ejected?3:e.fouls?4:-1),d(2),x(e.warned?5:-1)}}var Ht=(()=>
2{class i{side;shortName="";chips=[];fouls=0;bonus=null;timeoutsLeft=0;hot=!1;pick=new $;longPress=new $;add=new $;timeout=new $;header=new $;list;overflowing=!1;observer;ngAfterViewInit(){let e=this.list?.nativeElement;!e||typeof ResizeObserver>"u"||(this.observer=new ResizeObserver(()=>this.measure()),this.observer.observe(e),this.measure())}ngOnDestroy(){this.observer?.disconnect()}measure(){let e=this.list?.nativeElement;if(!e)return;let n=e.scrollHeight>e.clientHeight+1;n!==this.overflowing&&(this.overflowing=n,e.classList.toggle("is-overflowing",n))}get sideLabel(){return this.side==="away"?"Away":"Home"}get headerAria(){let e=[`${this.shortName||this.sideLabel} bench`,`${this.fouls} ${this.fouls===1?"foul":"fouls"}`];return this.bonus&&e.push(this.bonus==="DBL BONUS"?"double bonus":"bonus"),`${e.join(", ")}. Open the roster`}trackChip(e,n){return n.person.ptKey||n.person.playerID||n.person.placeholderID||n.person.personID||n.person.label}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=q({type:i,selectors:[["rp-basketball-bench"]],viewQuery:function(n,t){if(n&1&&E(kn,5),n&2){let r;B(r=R())&&(t.list=r.first)}},inputs:{side:"side",shortName:"shortName",chips:"chips",fouls:"fouls",bonus:"bonus",timeoutsLeft:"timeoutsLeft",hot:"hot"},outputs:{pick:"pick",longPress:"longPress",add:"add",timeout:"timeout",header:"header"},decls:18,vars:12,consts:[["list",""],["role","group",1,"bench"],["type","button",1,"bench-head",3,"click"],[1,"bench-team"],[1,"bench-fouls"],[1,"bench-bonus"],[1,"bench-chips"],["type","button","rpLongPress","",1,"chip",3,"chip--out","chip--initials","chip--long"],["type","button",1,"chip","chip--add",3,"click"],["type","button",1,"bench-to",3,"click"],["type","button","rpLongPress","",1,"chip",3,"rpLongPress","click"],[1,"chip-label"],["aria-hidden","true",1,"chip-badge","chip-badge--ej"],["aria-hidden","true",1,"chip-badge"],["aria-hidden","true",1,"chip-badge","chip-badge--warn"]],template:function(n,t){if(n&1){let r=b();o(0,"div",1)(1,"button",2),u("click",function(){return m(r),_(t.header.emit())}),o(2,"span",3),l(3),a(),o(4,"span",4),l(5),a(),g(6,yn,2,1,"span",5),a(),o(7,"div",6,0),P(9,Pn,6,10,"button",7,t.trackChip,!0),o(11,"button",8),u("click",function(){return m(r),_(t.add.emit())}),l(12,"+"),a()(),o(13,"button",9),u("click",function(){return m(r),_(t.timeout.emit())}),o(14,"span"),l(15,"T.Out"),a(),o(16,"small"),l(17),a()()()}n&2&&(k("bench--hot",t.hot),L("aria-label",(t.shortName||t.sideLabel)+" bench"),d(),L("aria-label",t.headerAria),d(2),f(t.shortName||t.sideLabel),d(2),H("",t.fouls," F"),d(),x(t.bonus?6:-1),d(3),v(t.chips),d(2),L("aria-label","Add a player to the "+(t.shortName||t.sideLabel)+" bench"),d(2),k("bench-to--none",t.timeoutsLeft<=0),L("aria-label","Timeout, "+(t.shortName||t.sideLabel)+", "+t.timeoutsLeft+" left"),d(4),H("",t.timeoutsLeft," left"))},dependencies:[G,jt],styles:["[_ngcontent-%COMP%]:root{--rp-navy-900: #10243f;--rp-navy-800: #143b67;--rp-navy-700: #1a3668;--rp-navy-600: #244f7e;--rp-text: #122033;--rp-text-muted: #64798c;--rp-text-subtle: #667085;--rp-divider: #dce5ee;--rp-divider-soft: #e8edf3;--rp-border-control: #8792a5;--rp-surface: #ffffff;--rp-surface-tint: #f2f7fc;--rp-surface-head: #eef2f6;--rp-surface-sunken: #f7f9fc;--rp-ok-bg: #eaf6ea;--rp-ok-border: #7fb583;--rp-ok-fg: #2e7d32;--rp-warn-bg: #fff3e0;--rp-warn-border: #c9922f;--rp-warn-fg: #9a4a00;--rp-danger-bg: #ffebee;--rp-danger-border: #d97b7b;--rp-danger-fg: #c62828;--rp-info-bg: #eef2fb;--rp-info-border: #8fa6cf;--rp-info-fg: #244f7e;--rp-neutral-bg: #f1f3f6;--rp-neutral-border: #9aa4b2;--rp-neutral-fg: #5a6b7d;--rp-gold-bg: #fdf6e3;--rp-gold-ring: #d4a531;--rp-gold-fg: #6b4700;--rp-silver-bg: #f1f3f6;--rp-silver-ring: #9ba5b1;--rp-silver-fg: #48535f;--rp-bronze-bg: #f8ede6;--rp-bronze-ring: #c4855f;--rp-bronze-fg: #6e3b1d;--rp-focus-ring: #244f7e;--rp-radius-control: 6px;--rp-radius-card: 8px;--rp-radius-row: 10px;--rp-radius-panel: 16px;--rp-shadow-card: 0 1px 3px rgba(15, 31, 53, .05);--rp-shadow-panel: 0 1px 3px rgba(15, 31, 53, .04), 0 8px 32px rgba(15, 31, 53, .07)}[_nghost-%COMP%]{display:block}.bench[_ngcontent-%COMP%]{background:#10243f7a;border:1px solid rgba(255,255,255,.22);border-radius:14px;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);height:100%;display:flex;flex-direction:column;gap:6px;padding:5px;box-sizing:border-box}.bench-head[_ngcontent-%COMP%]{flex:0 0 auto;display:flex;flex-direction:column;align-items:center;gap:1px;width:100%;min-height:44px;border:none;background:transparent;color:#fff;padding:2px 0 1px;font:inherit;cursor:pointer;border-radius:8px}.bench-head[_ngcontent-%COMP%]:focus{outline:none}.bench-head[_ngcontent-%COMP%]:focus-visible{outline:2px solid #ffffff;outline-offset:-2px}.bench-team[_ngcontent-%COMP%]{max-width:100%;font-size:9px;font-weight:800;letter-spacing:.05em;text-transform:uppercase;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bench-fouls[_ngcontent-%COMP%]{font-size:9px;font-weight:700;opacity:.85}.bench-bonus[_ngcontent-%COMP%]{margin-top:1px;padding:1px 5px;border-radius:999px;background:#ffd600;color:#10243f;font-size:7.5px;font-weight:900;letter-spacing:.04em;white-space:nowrap}.bench-chips[_ngcontent-%COMP%]{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;align-items:center;gap:6px;overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch;scrollbar-width:none}.bench-chips[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}.bench-chips.is-overflowing[_ngcontent-%COMP%]{-webkit-mask-image:linear-gradient(to bottom,#000 calc(100% - 24px),transparent);mask-image:linear-gradient(to bottom,#000 calc(100% - 24px),transparent)}.chip[_ngcontent-%COMP%]{position:relative;flex:0 0 auto;width:44px;height:44px;border-radius:50%;background:#10243f9e;border:2px solid rgba(255,255,255,.7);color:#fff;font:inherit;font-weight:800;font-size:16px;font-variant-numeric:tabular-nums;display:flex;align-items:center;justify-content:center;padding:0;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;transition:transform .12s ease-out}.chip[_ngcontent-%COMP%]:focus{outline:none}.chip[_ngcontent-%COMP%]:focus-visible{outline:2px solid #ffffff;outline-offset:2px}.chip--long[_ngcontent-%COMP%]{font-size:13px}.chip--initials[_ngcontent-%COMP%]{font-size:14px;letter-spacing:.02em}.chip--out[_ngcontent-%COMP%]{border-style:dashed;border-color:#ffffff8c}.chip--add[_ngcontent-%COMP%]{border-style:dashed;border-color:#ffffff80;background:#ffffff14;font-size:20px;font-weight:600}.chip.rp-held[_ngcontent-%COMP%]{transform:scale(1.1);background:#fff;color:#10243f;border-color:#fff}@media(prefers-reduced-motion:reduce){.chip[_ngcontent-%COMP%]{transition:none}.chip.rp-held[_ngcontent-%COMP%]{transform:none}}
2.bench--hot[_ngcontent-%COMP%] .chip[_ngcontent-%COMP%]:not(.chip--add){border-color:#fff;box-shadow:0 0 0 3px #ffffff47,0 0 14px #ffffff59}.bench--hot[_ngcontent-%COMP%] .bench-to[_ngcontent-%COMP%]{box-shadow:none}.chip-badge[_ngcontent-%COMP%]{position:absolute;right:-5px;top:-5px;min-width:16px;height:16px;padding:0 4px;border-radius:8px;background:#b0213a;color:#fff;font-size:9px;font-weight:900;line-height:14px;border:1px solid rgba(255,255,255,.6)}.chip-badge--ej[_ngcontent-%COMP%]{font-size:8px}.chip-badge--warn[_ngcontent-%COMP%]{right:auto;left:-5px;background:#f9a825;color:#10243f}.bench-to[_ngcontent-%COMP%]{position:relative;border:1px solid rgba(255,255,255,.22);border-radius:10px;min-height:46px;min-width:0;font-size:15px;font-weight:700;line-height:1.05;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;padding:0 8px;background:#f1f3f6;color:#122033;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;box-shadow:inset 0 1px #ffffff1f,0 1px 2px #00000040;background:#ffffffe6;color:#10243f;border-color:#10243f2e}.bench-to[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{font-size:9px;font-weight:700;opacity:.8;letter-spacing:.1em;text-transform:uppercase}.bench-to[_ngcontent-%COMP%]:active{transform:scale(.97)}.bench-to[_ngcontent-%COMP%]:disabled{opacity:.35;cursor:default}.bench-to[_ngcontent-%COMP%]:focus{outline:none}.bench-to[_ngcontent-%COMP%]:focus-visible{outline:2px solid #ffffff;outline-offset:2px}@media(prefers-reduced-motion:reduce){.bench-to[_ngcontent-%COMP%]:active{transform:none}}.bench-to[_ngcontent-%COMP%]{flex:0 0 auto;min-height:46px;width:100%;font-size:12px;font-weight:800;padding:0 2px;line-height:1.1}.bench-to[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{font-size:8px;letter-spacing:.04em;margin-top:1px}.bench-to--none[_ngcontent-%COMP%]{background:#fff9;box-shadow:none}"]})}return i})();function vn(i,s){if(i&1){let e=b();M(0,"button",7),ce("click",function(){let t=m(e).$implicit,r=c();return _(r.arm.emit(t.action))}),M(1,"span"),l(2),V(),M(3,"small"),l(4),V()()}if(i&2){let e=s.$implicit,n=s.$index,t=c();ee(oe("tbtn tbtn--shot tbtn--mk",n+1)),k("tbtn--on",t.isArmed(e))("tbtn--flat",t.isFlat(e)),L("aria-pressed",t.isArmed(e))("aria-label",e.aria),d(2),f(e.value),d(2),f(e.caption)}}function On(i,s){if(i&1){let e=b();M(0,"button",7),ce("click",function(){let t=m(e).$implicit,r=c();return _(r.arm.emit(t.action))}),M(1,"span"),l(2),V(),M(3,"small"),l(4),V()()}if(i&2){let e=s.$implicit,n=s.$index,t=c();ee(oe("tbtn tbtn--miss tbtn--ms",n+1)),k("tbtn--on",t.isArmed(e))("tbtn--flat",t.isFlat(e)),L("aria-pressed",t.isArmed(e))("aria-label",e.aria),d(2),f(e.value),d(2),f(e.caption)}}function Mn(i,s){if(i&1){let e=b();M(0,"button",8),ce("click",function(){let t=m(e).$implicit,r=c();return _(r.arm.emit(t.action))}),l(1),V()}if(i&2){let e=s.$implicit,n=c();k("tbtn--foul",e.value==="FOUL")("tbtn--on",n.isArmed(e))("tbtn--flat",n.isFlat(e)),L("aria-pressed",n.isArmed(e))("aria-label",e.aria),d(),f(e.value)}}var Ut=(()=>{class i{armed;arm=new $;more=new $;makes=De.slice(0,3);misses=De.slice(3);stats=Nt;isArmed(e){return me(this.armed,e.action)}isFlat(e){return!!this.armed&&!this.isArmed(e)}trackButton(e,n){return n.value}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=q({type:i,selectors:[["rp-basketball-tray"]],inputs:{armed:"armed"},outputs:{arm:"arm",more:"more"},decls:12,vars:4,consts:[["role","group","aria-label","Actions",1,"tray"],[1,"tray-row","tray-row--shots"],["type","button",3,"class","tbtn--on","tbtn--flat"],[1,"tray-row","tray-row--misses"],[1,"tray-row","tray-row--stats"],["type","button",1,"tbtn","tbtn--stat",3,"tbtn--foul","tbtn--on","tbtn--flat"],["type","button","aria-haspopup","dialog",1,"tbtn","tbtn--stat","tbtn--more",3,"click"],["type","button",3,"click"],["type","button",1,"tbtn","tbtn--stat",3,"click"]],template:function(n,t){n&1&&(M(0,"div",0)(1,"div",1),P(2,vn,5,11,"button",2,t.trackButton,!0),V(),M(4,"div",3),P(5,On,5,11,"button",2,t.trackButton,!0),V(),M(7,"div",4),P(8,Mn,2,9,"button",5,t.trackButton,!0),M(10,"button",6),ce("click",function(){return t.more.emit()}),l(11,"More \u25BE"),V()()()),n&2&&(k("tray--armed",!!t.armed),d(2),v(t.makes),d(3),v(t.misses),d(3),v(t.stats),d(2),k("tbtn--flat",!!t.armed))}
2,dependencies:[G],styles:["[_ngcontent-%COMP%]:root{--rp-navy-900: #10243f;--rp-navy-800: #143b67;--rp-navy-700: #1a3668;--rp-navy-600: #244f7e;--rp-text: #122033;--rp-text-muted: #64798c;--rp-text-subtle: #667085;--rp-divider: #dce5ee;--rp-divider-soft: #e8edf3;--rp-border-control: #8792a5;--rp-surface: #ffffff;--rp-surface-tint: #f2f7fc;--rp-surface-head: #eef2f6;--rp-surface-sunken: #f7f9fc;--rp-ok-bg: #eaf6ea;--rp-ok-border: #7fb583;--rp-ok-fg: #2e7d32;--rp-warn-bg: #fff3e0;--rp-warn-border: #c9922f;--rp-warn-fg: #9a4a00;--rp-danger-bg: #ffebee;--rp-danger-border: #d97b7b;--rp-danger-fg: #c62828;--rp-info-bg: #eef2fb;--rp-info-border: #8fa6cf;--rp-info-fg: #244f7e;--rp-neutral-bg: #f1f3f6;--rp-neutral-border: #9aa4b2;--rp-neutral-fg: #5a6b7d;--rp-gold-bg: #fdf6e3;--rp-gold-ring: #d4a531;--rp-gold-fg: #6b4700;--rp-silver-bg: #f1f3f6;--rp-silver-ring: #9ba5b1;--rp-silver-fg: #48535f;--rp-bronze-bg: #f8ede6;--rp-bronze-ring: #c4855f;--rp-bronze-fg: #6e3b1d;--rp-focus-ring: #244f7e;--rp-radius-control: 6px;--rp-radius-card: 8px;--rp-radius-row: 10px;--rp-radius-panel: 16px;--rp-shadow-card: 0 1px 3px rgba(15, 31, 53, .05);--rp-shadow-panel: 0 1px 3px rgba(15, 31, 53, .04), 0 8px 32px rgba(15, 31, 53, .07)}[_nghost-%COMP%]{display:block}.tray[_ngcontent-%COMP%]{background:#10243f7a;border:1px solid rgba(255,255,255,.22);border-radius:16px;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);display:flex;flex-direction:column;gap:6px;padding:6px;box-sizing:border-box}.tray-row[_ngcontent-%COMP%]{display:grid;gap:6px}.tray-row--shots[_ngcontent-%COMP%], .tray-row--misses[_ngcontent-%COMP%]{grid-template-columns:repeat(3,minmax(0,1fr))}.tray-row--stats[_ngcontent-%COMP%]{grid-template-columns:repeat(4,minmax(0,1fr))}.tbtn[_ngcontent-%COMP%]{position:relative;border:1px solid rgba(255,255,255,.22);border-radius:10px;min-height:46px;min-width:0;font-size:15px;font-weight:700;line-height:1.05;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;padding:0 8px;background:#f1f3f6;color:#122033;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;box-shadow:inset 0 1px #ffffff1f,0 1px 2px #00000040}.tbtn[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{font-size:9px;font-weight:700;opacity:.8;letter-spacing:.1em;text-transform:uppercase}.tbtn[_ngcontent-%COMP%]:active{transform:scale(.97)}.tbtn[_ngcontent-%COMP%]:disabled{opacity:.35;cursor:default}.tbtn[_ngcontent-%COMP%]:focus{outline:none}.tbtn[_ngcontent-%COMP%]:focus-visible{outline:2px solid #ffffff;outline-offset:2px}@media(prefers-reduced-motion:reduce){.tbtn[_ngcontent-%COMP%]:active{transform:none}}.tbtn[_ngcontent-%COMP%]{padding:0 4px}.tbtn--shot[_ngcontent-%COMP%]{min-height:56px;font-size:20px;font-weight:800}.tbtn--miss[_ngcontent-%COMP%]{min-height:48px;font-size:18px;font-weight:800}.tbtn--stat[_ngcontent-%COMP%]{background:#ffffffe6;color:#10243f;border-color:#10243f2e;min-height:40px;font-size:11px;font-weight:800;letter-spacing:.02em}.tbtn[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{font-size:9px}.tbtn--mk1[_ngcontent-%COMP%]{background:#e8f5e9;color:#1b5e20;border-color:#10243f2e;box-shadow:inset 0 4px #2e7d32,inset 0 1px #ffffff1f,0 1px 2px #00000040}.tbtn--mk2[_ngcontent-%COMP%]{background:#c8e6c9;color:#1b5e20;border-color:#10243f2e;box-shadow:inset 0 4px #2e7d32,inset 0 1px #ffffff1f,0 1px 2px #00000040}.tbtn--mk3[_ngcontent-%COMP%]{background:#a5d6a7;color:#1b5e20;border-color:#10243f2e;box-shadow:inset 0 4px #2e7d32,inset 0 1px #ffffff1f,0 1px 2px #00000040}.tbtn--ms1[_ngcontent-%COMP%]{background:#ffebee;color:#b71c1c;border-color:#10243f2e;box-shadow:inset 0 -4px #b0213a,inset 0 1px #ffffff1f,0 1px 2px #00000040}.tbtn--ms2[_ngcontent-%COMP%]{background:#ffcdd2;color:#b71c1c;border-color:#10243f2e;box-shadow:inset 0 -4px #b0213a,inset 0 1px #ffffff1f,0 1px 2px #00000040}.tbtn--ms3[_ngcontent-%COMP%]{background:#ef9a9a;color:#7f0000;border-color:#10243f2e;box-shadow:inset 0 -4px #b0213a,inset 0 1px #ffffff1f,0 1px 2px #00000040}.tbtn--foul[_ngcontent-%COMP%]{border:2px solid #b0213a;color:#b0213a}.tbtn--more[_ngcontent-%COMP%]{background:#10243fb8;color:#fff;border-color:#ffffff38;font-size:12px}.tbtn--on[_ngcontent-%COMP%]{outline:3px solid #fff;outline-offset:1px;box-shadow:0 2px 8px #00000059}.tbtn--flat[_ngcontent-%COMP%]{box-shadow:none}"]})}return i})();var En=["stage"],Bn=["hud"],Rn=["moreTpl"],In=["rostersTpl"],Nn=["playerTpl"],Ln=["tempPlayerTpl"],Vn=["rosterSheetTpl"],Dn=["teamRosterTpl"],An=["teamNamesTpl"],$n=["adminTpl"],Fn=["timeoutWarningTpl"],zn=["shotLocationTpl"],jn=["endPeriodTpl"],Hn=["endReviewTpl"],Un=["playlogTpl"],Wn=["boxscoreTpl"],Kn=["claimTpl"],Qn=()=>[],qn=()=>["GAME_START","PERIOD_START"],Gn=(i,s)=>s.placeholderID,Yn=(i,s)=>s.id,Jn=(i,s)=>s.label,Xn=(i,s)=>s.text,Zn=(i,s)=>s.ptKey||s.playerID||s.placeholderID,ei=(i,s)=>s.actionID,ti=(i,s)=>s.ptKey||s.personID||s.placeholderID,ni=(i,s)=>s.value,ii=(i,s)=>s._key,oi=(i,s)=>s.ptKey,ri=(i,s)=>s.scoreID;function ai(i,s){i&1&&(o(0,"div",19),l(1,"Loading basketball game\u2026"),a())}function si(i,s){if(i&1){let e=b();o(0,"div",20)(1,"p"),l(2),a(),o(3,"button",21),u("click",function(){m(e);let t=c();return _(t.ngOnInit())}),l(4,"Try again"),a()()}if(i&2){let e=c();d(2),f(e.loadError)}}function li(i,s){i&1&&Oe(0)}function ci(i,s){if(i&1){let e=b();o(0,"div",22)(1,"rp-basketball-scoreboard",25),u("syncTap",function(){m(e);let t=c(2);return _(t.syncTap())}),a(),xe(2,li,1,0,"ng-container",26),a()}if(i&2){let e=c(2),n=Me(5);d(),w("stats",e.stats)("awayName",e.game.awayTeam.name)("homeName",e.game.homeTeam.name)("period",e.period)("started",e.started)("ended",e.ended)("expanded",e.scoreboardExpanded)("expandable",!1)("nameLimit",e.nameLimit)("syncState",e.syncState)("syncLabel",e.syncLabel)("kindLabel",e.kindLabel)("kindTone",e.kindTone),d(),w("ngTemplateOutlet",n)}}function di(i,s){if(i&1&&(o(0,"span"),l(1),a()),i&2){let e=c().$implicit,n=c(5);d(),f(n.personName(e))}}function pi(i,s){if(i&1){let e=b();o(0,"span",37)(1,"strong"),l(2),a(),g(3,di,2,1,"span"),o(4,"button",41),u("click",function(){let t=m(e).$implicit,r=c().$implicit,p=c(4);return _(p.removeDraftPlayer(r,t))}),o(5,"mat-icon"),l(6,"close"),a()()()}if(i&2){let e=s.$implicit,n=c(5);d(2),f(e.jersey||"\u2014"),d(),x(n.personName(e)?3:-1),d(),L("aria-label","Remove "+e.label)}}function mi(i,s){i&1&&(o(0,"p",38),l(1,"No players yet. You can add them during the game."),a())}function _i(i,s){if(i&1){let e=b();o(0,"section",34)(1,"p",27),l(2),a(),o(3,"label"),l(4,"Team name "),o(5,"input",35),j("ngModelChange",function(t){let r=m(e).$implicit,p=c(4);return z(p.setupNames[r].name,t)||(p.setupNames[r].name=t),_(t)}),a()(),o(6,"label"),l(7,"Short name "),o(8,"small"),l(9,"shown on the bench"),a(),o(10,"input",35),j("ngModelChange",function(t){let r=m(e).$implicit,p=c(4);
2return z(p.setupNames[r].shortName,t)||(p.setupNames[r].shortName=t),_(t)}),a()(),o(11,"div",36),P(12,pi,7,3,"span",37,Gn,!1,mi,2,0,"p",38),a(),o(15,"div",39)(16,"button",40),u("click",function(){let t=m(e).$implicit,r=c(4);return _(r.openRosterSheet(t))}),o(17,"mat-icon"),l(18,"edit_note"),a(),l(19," Type roster"),a(),o(20,"button",40),u("click",function(){let t=m(e).$implicit,r=c(4);return _(r.openTempPlayer(t))}),o(21,"mat-icon"),l(22,"person_add"),a(),l(23," Add player"),a(),o(24,"button",40),u("click",function(){let t=m(e).$implicit,r=c(4);return _(r.openTeamRoster(t))}),o(25,"mat-icon"),l(26,"groups"),a(),l(27," Use my team's roster"),a()()()}if(i&2){let e=s.$implicit,n=c(4);d(2),f(n.sideLabel(e)),d(3),F("ngModel",n.setupNames[e].name),w("name",e+"Name")("maxlength",n.maxTeamName)("placeholder",n.docNames[e].name||n.sideLabel(e)+" Team"),d(5),F("ngModel",n.setupNames[e].shortName),w("name",e+"ShortName")("maxlength",n.maxShortName)("placeholder",n.derivedShortName(e)),d(),L("aria-label",n.sideLabel(e)+" roster"),d(),v(n.draftRoster[e])}}function ui(i,s){if(i&1&&P(0,_i,28,11,"section",34,U),i&2){let e=c(3);v(e.sides)}}function hi(i,s){if(i&1){let e=b();o(0,"section",23)(1,"p",27),l(2),a(),o(3,"h1"),l(4,"Ready to keep the book?"),a(),o(5,"p"),l(6,"No game clock is in this app. Follow the court clock and record only the period."),a(),g(7,ui,2,0),o(8,"label",28)(9,"input",29),j("ngModelChange",function(t){m(e);let r=c(2);return z(r.setupProfile,t)||(r.setupProfile=t),_(t)}),a(),o(10,"span")(11,"strong"),l(12,"Running time"),a(),o(13,"small"),l(14,"Use the MYBA running-time rules."),a()()(),o(15,"label",28)(16,"input",30),j("ngModelChange",function(t){m(e);let r=c(2);return z(r.setupProfile,t)||(r.setupProfile=t),_(t)}),a(),o(17,"span")(18,"strong"),l(19,"Stop time"),a(),o(20,"small"),l(21,"Use the MYBA stop-time rules."),a()()(),o(22,"label",31)(23,"input",32),j("ngModelChange",function(t){m(e);let r=c(2);return z(r.shotLocationEnabled,t)||(r.shotLocationEnabled=t),_(t)}),a(),o(24,"span")(25,"strong"),l(26,"Shot locations"),a(),o(27,"small"),l(28,"Optional. A court appears after each shot."),a()()(),o(29,"button",33),u("click",function(){m(e);let t=c(2);return _(t.startGame())}),l(30,"Start first half"),a()()}if(i&2){let e=c(2);d(2),f(e.isPractice?"Practice game":"MYBA 2025\u201326"),d(5),x(e.isPractice?7:-1),d(),k("is-selected",e.setupProfile==="MYBA_2025_26_RUNNING"),d(),F("ngModel",e.setupProfile),d(6),k("is-selected",e.setupProfile==="MYBA_2025_26_STOP"),d(),F("ngModel",e.setupProfile),d(7),F("ngModel",e.shotLocationEnabled),d(6),w("disabled",e.committing)}}function fi(i,s){if(i&1){let e=b();o(0,"section",24)(1,"div",42)(2,"strong"),l(3,"Final score"),a(),o(4,"button",43),u("click",function(){m(e);let t=c(2);return _(t.reopenGame())}),l(5,"Reopen and correct"),a()(),W(6,"rp-basketball-box-score",44),o(7,"button",45),u("click",function(){m(e);let t=c(2);return _(t.showLog=!0)}),o(8,"mat-icon"),l(9,"receipt_long"),a(),l(10," Play log"),a()()}if(i&2){let e=c(2);d(6),w("stats",e.stats)("awayName",e.game.awayTeam.shortName||e.game.awayTeam.name)("homeName",e.game.homeTeam.shortName||e.game.homeTeam.name)}}function bi(i,s){i&1&&(o(0,"div",61),W(1,"img",78),a())}function gi(i,s){if(i&1){let e=b();o(0,"img",79),u("load",function(){m(e);let t=c(3);return _(t.artLoaded=!0)}),a()}if(i&2){let e=c(3);k("bk1-art--in",e.artLoaded),w("src",e.artUrl,ve)}}function xi(i,s){i&1&&Oe(0)}function Ci(i,s){if(i&1&&(o(0,"span",71),l(1),a()),i&2){let e=c(3);d(),f(e.playChip.what)}}function ki(i,s){if(i&1){let e=b();o(0,"button",80),u("click",function(){m(e);let t=c(3);return _(t.cancelArmed())}),l(1,"\xD7"),a()}}function yi(i,s){if(i&1){let e=b();o(0,"div",46,16)(2,"div",47),W(3,"div",48)(4,"div",49)(5,"div",50)(6,"div",51),o(7,"div",52),W(8,"div",53)(9,"div",54)(10,"div",55)(11,"div",56)(12,"div",57),a(),W(13,"div",58),o(14,"div",59),W(15,"img",60),a(),g(16,bi,2,0,"div",61),W(17,"div",62),g(18,gi,1,3,"img",63),a(),o(19,"div",64,17)(21,"rp-basketball-scoreboard",65),u("undo",function(){m(e);let t=c(2);return _(t.undo())})("redo",function(){m(e);let t=c(2);return _(t.redo())})("toggle",function(){m(e);let t=c(2);return _(t.toggleScoreboard())})("syncTap",function(){m(e);let t=c(2);return _(t.syncTap())}),a(),xe(22,xi,1,0,"ng-container",26),a(),o(23,"rp-basketball-bench",66),u("pick",function(t){m(e);let r=c(2);return _(r.onChipPick("away",t))})("longPress",function(t){m(e);let r=c(2);return _(r.onChipLongPress("away",t))})("add",function(){m(e);let t=c(2);return _(t.onBenchAdd("away"))})("timeout",function(){m(e);let t=c(2);return _(t.onBenchTimeout("away"))})("header",function(){m(e);let t=c(2);return _(t.onBenchHeader("away"))}),a(),o(24,"div",67)(25,"div",68)(26,"span",69),l(27),a(),o(28,"span",70),l(29),a(),g(30,Ci,2,1,"span",71),g(31,ki,2,0,"button",72),a()(),o(32,"rp-basketball-tray",73),u("arm",function(t){m(e);let r=c(2);return _(r.arm(t))})("more",function(){m(e);let t=c(2);return _(t.openMore())}),a(),o(33,"rp-basketball-bench",74),u("pick",function(t){m(e);let r=c(2);return _(r.onChipPick("home",t))})("longPress",function(t){m(e);let r=c(2);return _(r.onChipLongPress("home",t))})("add",function(){m(e);let t=c(2);return _(t.onBenchAdd("home"))})("timeout",function(){m(e);let t=c(2);return _(t.onBenchTimeout("home"))})("header",function(){m(e);let t=c(2);return _(t.onBenchHeader("home"))}),a()(),o(34,"nav",75)(35,"button",76),u("click",function(){m(e);let t=c(2);return _(t.openRosters())}),o(36,"mat-icon"),l(37,"groups"),a(),o(38,"span"),l(39,"Rosters"),a()(),o(40,"button",76),u("click",function(){m(e);let t=c(2);return t.cancelArmed(),_(t.showLog=!0)}),o(41,"mat-icon"),l(42,"receipt_long"),a(),o(43,"span"),l(44,"Play log"),a()(),o(45,"button",76),u("click",function(){m(e);let t=c(2);return t.cancelArmed(),_(t.showBoxScore=!0)}),o(46,"mat-icon"),l(47,"grid_on"),a(),o(48,"span"),l(49,"Box score"),a()(),o(50,"button",77),u("click",function(){m(e);let t=c(2);return _(t.askEndPeriod())}),o(51,"mat-icon"),l(52,"skip_next"),a(),o(53,"span"),l(54),a()()()}if(i&2){let e,n,t=c(2),r=Me(5);d(15),w("src",t.courtLogo,ve),d(),x(t.courtSponsor?16:-1),d(2),x(t.artUrl?18:-1),d(3),w("stats",t.stats)("awayName",t.game.awayTeam.name)("homeName",t.game.homeTeam.name)("period",t.period)("started",!0)("ended",!1)("floating",!0)("expanded",t.scoreboardExpanded)("nameLimit",t.nameLimit)("canUndo",t.canUndo)("canRedo",t.canRedo)("undoLocked",t.undoLocked)("syncState",t.syncState)("syncLabel",t.syncLabel)("kindLabel",t.kindLabel)("kindTone",t.kindTone),d(),w("ngTemplateOutlet",r),d(),w("shortName",((e=t.teamOf("away"))==null?null:e.shortName)||t.sideLabel("away"))("chips",t.chips.away)("fouls",t.benchFouls("away"))("bonus",t.benchBonus("away"))("timeoutsLeft",t.benchTimeouts("away"))("hot",!!t.armed),d(2),ee(Ze("bk1-chip bk1-chip--",t.playChip.state," bk1-chip--",t.playChip.tone)),d(2),f(t.playChip.cap),d(2),f(t.playChip.who),d(),x(t.playChip.what?30:-1),d(),x(t.playChip.state==="armed"?31:-1),d(),w("armed",t.armed),d(),w("shortName",((n=t.teamOf("home"))==null?null:n.short
2Name)||t.sideLabel("home"))("chips",t.chips.home)("fouls",t.benchFouls("home"))("bonus",t.benchBonus("home"))("timeoutsLeft",t.benchTimeouts("home"))("hot",!!t.armed),d(2),k("bk1-bar-btn--active",t.rostersOpen),d(5),k("bk1-bar-btn--active",t.showLog),d(5),k("bk1-bar-btn--active",t.showBoxScore),d(9),f(t.endPeriodLabel)}}function Si(i,s){if(i&1&&(g(0,ci,3,14,"div",22),g(1,hi,31,10,"section",23)(2,fi,11,3,"section",24)(3,yi,55,48)),i&2){let e=c();x(e.live?-1:0),d(),x(e.started?e.ended?2:3:1)}}function wi(i,s){if(i&1){let e=b();o(0,"button",21),u("click",function(){m(e);let t=c().$implicit,r=c(2);return _(r.bannerAction(t))}),l(1),a()}if(i&2){let e=c().$implicit;d(),f(e.action==="retry"?"Retry":"Review")}}function Ti(i,s){if(i&1){let e=b();o(0,"div",82)(1,"span"),l(2),a(),g(3,wi,2,1,"button",83),o(4,"button",84),u("click",function(){let t=m(e).$implicit,r=c(2);return _(r.dismissBanner(t.id))}),l(5,"\xD7"),a()()}if(i&2){let e=s.$implicit;ee(oe("bk1-banner bk1-banner--",e.tone)),d(2),f(e.text),d(),x(e.action?3:-1)}}function Pi(i,s){if(i&1&&P(0,Ti,6,5,"div",81,Yn),i&2){let e=c();v(e.banners)}}function vi(i,s){if(i&1){let e=b();o(0,"button",43),u("click",function(){let t=m(e).$implicit,r=c(3);return _(r.sheetSide=t)}),l(1),a()}if(i&2){let e,n=s.$implicit,t=c(3);k("is-active",t.sheetSide===n),d(),f(((e=t.teamOf(n))==null?null:e.shortName)||t.sideLabel(n))}}function Oi(i,s){if(i&1){let e=b();o(0,"button",91),u("click",function(){m(e);let t=c(3);return _(t.openRosterSheetFromMore())}),l(1,"Type roster"),a()}}function Mi(i,s){if(i&1){let e=b();o(0,"button",91),u("click",function(){m(e);let t=c(3);return _(t.openTeamRosterFromMore())}),l(1,"My team's roster"),a()}}function Ei(i,s){if(i&1){let e=b();o(0,"button",91),u("click",function(){m(e);let t=c(3);return _(t.openTeamNamesFromMore())}),l(1,"Team names"),a()}}function Bi(i,s){if(i&1){let e=b();o(0,"div",85)(1,"p",27),l(2,"More"),a(),o(3,"h2",86),l(4,"Discipline and rosters"),a(),o(5,"div",87),P(6,vi,2,3,"button",88,U),a(),o(8,"p",27),l(9,"Discipline"),a(),o(10,"div",89)(11,"button",90),u("click",function(){m(e);let t=c(2);return _(t.openAdmin("technical"))}),l(12,"Technical foul"),a(),o(13,"button",90),u("click",function(){m(e);let t=c(2);return _(t.openAdmin("ejection"))}),l(14,"Ejection"),a()(),o(15,"p",27),l(16,"Rosters"),a(),o(17,"div",89)(18,"button",91),u("click",function(){m(e);let t=c(2);return _(t.openTempPlayerFromMore())}),l(19,"Temp player"),a(),g(20,Oi,2,0,"button",92),g(21,Mi,2,0,"button",92),g(22,Ei,2,0,"button",92),a(),o(23,"button",93),u("click",function(){m(e);let t=c(2);return _(t.moreOpen=!1)}),l(24,"Close"),a()()}if(i&2){let e=c(2);d(6),v(e.sides),d(14),x(e.isPractice?20:-1),d(),x(e.isPractice?21:-1),d(),x(e.isPractice?22:-1)}}function Ri(i,s){if(i&1&&g(0,Bi,25,3,"div",85),i&2){let e=c();x(e.moreOpen?0:-1)}}function Ii(i,s){if(i&1&&(o(0,"small"),l(1),a()),i&2){let e=c().$implicit;d(),Ee("",e.line.pts," PTS \xB7 ",e.line.reb," REB \xB7 ",e.line.pf," PF")}}function Ni(i,s){if(i&1){let e=b();o(0,"button",98),u("click",function(){m(e);let t=c().$implicit,r=c().$implicit,p=c(3);return _(p.openPlayerSheet(r,t.person,"resolve"))}),l(1,"Resolve"),a()}}function Li(i,s){if(i&1){let e=b();o(0,"div",99)(1,"strong"),l(2),a(),o(3,"span",100),l(4),g(5,Ii,2,3,"small"),a(),o(6,"button",98),u("click",function(){let t=m(e).$implicit,r=c().$implicit,p=c(3);return _(p.openPlayerSheet(r,t.person,"jersey"))}),l(7,"Jersey"),a(),g(8,Ni,2,0,"button",101),a()}if(i&2){let e=s.$implicit,n=c().$implicit,t=c(3);d(2),f(e.label),d(2),H("",t.personName(e.person)||e.person.label," "),d(),x(e.line?5:-1),d(3),x(e.person.placeholderID&&t.hasPlatformPlayersOn(n)?8:-1)}}function Vi(i,s){i&1&&(o(0,"p",38),l(1,"No players yet."),a())}function Di(i,s){if(i&1){let e=b();o(0,"div",96)(1,"div",97)(2,"div")(3,"p",27),l(4),a(),o(5,"h3"),l(6),a()(),o(7,"button",98),u("click",function(){let t=m(e).$implicit,r=c(3);return _(r.openTempPlayer(t))}),l(8,"+ Player"),a()(),P(9,Li,9,4,"div",99,Jn,!1,Vi,2,0,"p",38),a()}if(i&2){let e,n=s.$implicit,t=c(3);k("is-current",n===t.sheetSide),d(4),f(t.sideLabel(n)),d(2),f((e=t.teamOf(n))==null?null:e.name),d(3),v(t.chips[n])}}function Ai(i,s){if(i&1){let e=b();o(0,"div",85)(1,"p",27),l(2,"Rosters"),a(),o(3,"h2",94),l(4,"Both benches"),a(),P(5,Di,12,5,"div",95,U),o(7,"button",93),u("click",function(){m(e);let t=c(2);return _(t.rostersOpen=!1)}),l(8,"Close"),a()()}if(i&2){let e=c(2);d(5),v(e.sides)}}function $i(i,s){if(i&1&&g(0,Ai,9,0,"div",85),i&2){let e=c();x(e.rostersOpen?0:-1)}}function Fi(i,s){if(i&1&&(o(0,"p"),l(1),a()),i&2){let e=s.$implicit;ee(oe("bks-hint bks-hint--",e.tone)),d(),f(e.text)}}function zi(i,s){if(i&1){let e=b();o(0,"button",104),u("click",function(){m(e);let t=c(4);return _(t.openResolvePlayer())}),o(1,"mat-icon"),l(2,"swap_horiz"),a(),l(3," Resolve to a roster player"),a()}}function ji(i,s){if(i&1){let e=b();o(0,"button",104),u("click",function(){m(e);let t=c(3);return _(t.openJerseyCorrection())}),o(1,"mat-icon"),l(2,"edit"),a(),l(3," Correct jersey number"),a(),g(4,zi,4,0,"button",105)}if(i&2){let e=c(),n=c(2);d(4),x(e.person.placeholderID&&n.hasPlatformPlayersOn(e.side)?4:-1)}}function Hi(i,s){if(i&1){let e=b();o(0,"label"),l(1,"Jersey number"),o(2,"input",106),j("ngModelChange",function(t){m(e);let r=c(3);return z(r.editedJersey,t)||(r.editedJersey=t),_(t)}),a()(),o(3,"button",33),u("click",function(){m(e);let t=c(3);return _(t.saveJerseyCorrection())}),l(4,"Save correction"),a()}if(i&2){let e=c(3);d(2),F("ngModel",e.editedJersey),d(),w("disabled",e.committing)}}function Ui(i,s){if(i&1){let e=b();o(0,"button",43),u("click",function(){m(e);let t=c().$implicit,r=c(4);return _(r.rebindTemporaryPlayer(t))}),o(1,"strong"),l(2),a(),o(3,"span"),l(4),a()()}if(i&2){let e=c().$implicit;d(2),f(e.jersey||"\u2014"),d(2),f(e.label)}}function Wi(i,s){if(i&1&&g(0,Ui,5,2,"button"),i&2){let e=s.$implicit;x(e.placeholderID?-1:0)}}function Ki(i,s){if(i&1&&(o(0,"p"),l(1,"Select the roster person who owns the temporary player statistics."),a(),o(2,"div",107),P(3,W
2i,1,1,null,null,Zn),a()),i&2){let e,n=c(),t=c(2);d(3),v(((e=t.teamOf(n.side))==null?null:e.roster)||Re(0,Qn))}}function Qi(i,s){if(i&1){let e=b();o(0,"div",85)(1,"p",27),l(2),a(),o(3,"h2",102),l(4),a(),o(5,"p",38),l(6),a(),P(7,Fi,2,4,"p",103,Xn),g(9,ji,5,1)(10,Hi,5,2)(11,Ki,5,1),o(12,"button",93),u("click",function(){m(e);let t=c(2);return _(t.closePlayerSheet())}),l(13,"Cancel"),a()()}if(i&2){let e,n=s,t=c(2);d(2),f(((e=t.teamOf(n.side))==null?null:e.shortName)||t.sideLabel(n.side)),d(2),X("",n.person.jersey?"#"+n.person.jersey+" ":"","",t.personName(n.person)||n.person.label),d(2),f(t.playerSheetLine),d(),v(t.playerSheetBadges),d(2),x(n.mode==="menu"?9:n.mode==="jersey"?10:11)}}function qi(i,s){if(i&1&&g(0,Qi,14,5,"div",85),i&2){let e,n=c();x((e=n.playerSheet)?0:-1,e)}}function Gi(i,s){if(i&1){let e=b();o(0,"button",43),u("click",function(){m(e);let t=c().$implicit,r=c(3);return _(r.correctTimeout(t))}),l(1,"Change team"),a()}}function Yi(i,s){if(i&1){let e=b();o(0,"button",115),u("click",function(){m(e);let t=c().$implicit,r=c(3);return _(r.undo(t))}),l(1,"Undo"),a()}}function Ji(i,s){if(i&1&&(o(0,"article",110)(1,"span",112),l(2),a(),o(3,"span",113),l(4),a(),g(5,Gi,2,0,"button"),g(6,Yi,2,0,"button",114),a()),i&2){let e=s.$implicit,n=c(3);d(2),f(e.period||"\u2014"),d(2),f(n.describe(e)),d(),x(e.type==="TIMEOUT"?5:-1),d(),x(Re(4,qn).includes(e.type)?-1:6)}}function Xi(i,s){i&1&&(o(0,"div",111),l(1,"No actions yet."),a())}function Zi(i,s){if(i&1){let e=b();o(0,"div",85)(1,"div",97)(2,"div")(3,"p",27),l(4,"Audit trail"),a(),o(5,"h2",108),l(6,"Play log"),a()(),o(7,"button",109),u("click",function(){m(e);let t=c(2);return _(t.redo())}),o(8,"mat-icon"),l(9,"redo"),a(),o(10,"span"),l(11,"Redo"),a()()(),P(12,Ji,7,5,"article",110,ei,!1,Xi,2,0,"div",111),o(15,"button",93),u("click",function(){m(e);let t=c(2);return _(t.showLog=!1)}),l(16,"Close"),a()()}if(i&2){let e=c(2);d(7),w("disabled",!e.redoAction),d(5),v(e.activeActions)}}function eo(i,s){if(i&1&&g(0,Zi,17,2,"div",85),i&2){let e=c();x(e.showLog?0:-1)}}function to(i,s){if(i&1){let e=b();o(0,"div",85)(1,"p",27),l(2,"Box score"),a(),o(3,"h2",116),l(4),a(),W(5,"rp-basketball-box-score",44),o(6,"button",93),u("click",function(){m(e);let t=c(2);return _(t.showBoxScore=!1)}),l(7,"Close"),a()()}if(i&2){let e=c(2);d(4),Be("",e.game==null||e.game.awayTeam==null?null:e.game.awayTeam.shortName," ",e.stats.away.score," \xB7 ",e.game==null||e.game.homeTeam==null?null:e.game.homeTeam.shortName," ",e.stats.home.score),d(),w("stats",e.stats)("awayName",(e.game==null||e.game.awayTeam==null?null:e.game.awayTeam.shortName)||(e.game==null||e.game.awayTeam==null?null:e.game.awayTeam.name))("homeName",(e.game==null||e.game.homeTeam==null?null:e.game.homeTeam.shortName)||(e.game==null||e.game.homeTeam==null?null:e.game.homeTeam.name))}}function no(i,s){if(i&1&&g(0,to,8,7,"div",85),i&2){let e=c();x(e.showBoxScore?0:-1)}}function io(i,s){if(i&1){let e=b();o(0,"div",85)(1,"p",27),l(2,"Confirm"),a(),o(3,"h2",117),l(4),a(),o(5,"p"),l(6),a(),o(7,"button",33),u("click",function(){m(e);let t=c(2);return _(t.confirmEndPeriod())}),l(8),a(),o(9,"button",93),u("click",function(){m(e);let t=c(2);return _(t.endPeriodConfirm=!1)}),l(10,"Keep scoring"),a()()}if(i&2){let e=c(2);d(4),f(e.endPeriodLabel),d(2),f(e.endPeriodQuestion),d(),w("disabled",e.committing),d(),f(e.endPeriodLabel)}}function oo(i,s){if(i&1&&g(0,io,11,4,"div",85),i&2){let e=c();x(e.endPeriodConfirm?0:-1)}}function ro(i,s){if(i&1){let e=b();o(0,"div",85)(1,"p",27),l(2,"Timeout check"),a(),o(3,"h2"),l(4,"No timeouts remain"),a(),o(5,"p"),l(6,"The court official granted this timeout. You can review and correct an earlier timeout, or record this one anyway."),a(),o(7,"button",118),u("click",function(){m(e);let t=c(2);return _(t.reviewTimeouts())}),l(8,"Review timeouts"),a(),o(9,"button",119),u("click",function(){m(e);let t=c(2);return _(t.recordTimeout())}),l(10,"Record timeout anyway"),a(),o(11,"button",93),u("click",function(){m(e);let t=c(2);return _(t.timeoutWarningSide=void 0)}),l(12,"Cancel"),a()()}if(i&2){let e=c(2);d(9),w("disabled",e.committing)}}function ao(i,s){if(i&1&&g(0,ro,13,1,"div",85),i&2){let e=c();x(e.timeoutWarningSide?0:-1)}}function so(i,s){if(i&1){let e=b();o(0,"button",43),u("click",function(){let t=m(e).$implicit,r=c(3);return r.sheetSide=t,_(r.adminPerson=void 0)}),l(1),a()}if(i&2){let e,n=s.$implicit,t=c(3);k("is-active",t.sheetSide===n),d(),f(((e=t.teamOf(n))==null?null:e.shortName)||t.sideLabel(n))}}function lo(i,s){if(i&1){let e=b();o(0,"button",43),u("click",function(){m(e);let t=c(3);return t.adminTarget="team",_(t.adminPerson=void 0)}),l(1,"Team"),a()}if(i&2){let e=c(3);k("is-active",e.adminTarget==="team")}}function co(i,s){if(i&1){let e=b();o(0,"button",43),u("click",function(){let t=m(e).$implicit,r=c(4);return _(r.adminPerson=t)}),o(1,"strong"),l(2),a(),o(3,"span"),l(4),a()()}if(i&2){let e=s.$implicit,n=c(4);k("is-selected",n.adminPerson===e),d(2),f(e.jersey||e.role||"\u2014"),d(2),f(e.label)}}function po(i,s){i&1&&(o(0,"div",111),l(1,"Nobody is on this list yet."),a())}function mo(i,s){if(i&1&&(o(0,"div",107),P(1,co,5,4,"button",121,ti,!1,po,2,0,"div",111),a()),i&2){let e=c(3);d(),v(e.adminPeople)}}function _o(i,s){if(i&1){let e=b();o(0,"label",31)(1,"input",122),j("ngModelChange",function(t){m(e);let r=c(3);return z(r.technicalCountsPersonal,t)||(r.technicalCountsPersonal=t),_(t)}),a(),o(2,"span")(3,"strong"),l(4,"Also a personal foul"),a(),o(5,"small"),l(6,"Use only when the court official directs it."),a()()()}if(i&2){let e=c(3);d(),F("ngModel",e.technicalCountsPersonal)}}function uo(i,s){if(i&1){let e=b();o(0,"div",87)(1,"button",43),u("click",function(){m(e);let t=c(3);return _(t.ejectionScope="STANDARD")}),l(2,"Next game"),a(),o(3,"button",43),u("click",function(){m(e);let t=c(3);return _(t.ejectionScope="FLAGRANT")}),l(4,"Rest of event"),a()()}if(i&2){let e=c(3);d(),k("is-active",e.ejectionScope==="STANDARD"),d(2),k("is-active",e.ejectionScope==="FLAGRANT")}}function ho(i,s){if(i&1){let e=b();o(0,"div",85)(1,"p",27),l(2,"Confirm before saving"),a(),o(3,"h2"),l(4),a(),o(5,"div",87),P(6,so,2,3,"button",88,U),a(),o(8,"div",87)(9,"button",43),u("click",function(){m(e);let t=c(2);return t.adminTarget="player",_(t.adminPerson=void 0)}),l(10,"Player"),a(),o(11,"button",43),u("click",function(){m(e);let t=c(2);return t.adminTarget="coach",_(t.adminPerson=void 0)}),l(12,"Coach"),a(),g(13,lo,2,2,"button",88),a(),g(14,mo,4,1,"div",107),g(15,_o,7,1,"label",31),g(16,uo,5,4,"div",87),o(17,"button",120),u("click",function(){m(e);let t=c(2);return _(t.saveAdmin())}),l(18),a(),o(19,"button",93),u("click",function(){m(e);let t=c(2);return _(t.adminMode=void 0)}),l(20,"Cancel"),a()()}if(i&2){let e=c(2);d(4),f(e.adminMode==="technical"?"Technical foul":"Ejection"),d(2),v(e.sides),d(3),k("is-active",e.adminTarget==="player"),d(2),k("is-active",e.adminTarget==="coach"),d(2),x(e.adminMode==="technical"?13:-1),d(),x(e.adminTarget!=="team"?14:-1),d(),x(e.adminMode==="technical"&&e.adminTarget==="player"?15:-1),d(),x(e.adminMode==="ejection"?16:-1),d(),w("disabled",e.committing),d(),H("Record ",e.adminMode==="technical"?"technical":"ejection")}}function fo(i,s){if(i&1&&g(0,ho,21,11,"div",85),i&2){let e=c();x(e.adminMode?0:-1)}}function bo(i,s){if(i&1){let e=b();o(0,"div",85)(1,"p",27),l(2,"Optional"),a(),o(3,"h2"),l(4,"Where was the shot?"),a(),o(5,"button",123),u("click",function(t){m(e);let r=c(2);return _(r.placeShot(t))}),W(6,"span",124)(7,"span",125)(8,"span",126),a(),o(9,"button",93),u("click",function(){m(e);let t=c(2);return _(t.pendingShotID=void 0)}),l(10,"Skip location"),a()()}}function go(i,s){if(i&1&&g(0,bo,11,0,"div",85),i&2){let e=c();x(e.pendingShotID?0:-1)}}function xo(i,s){i&1&&(o(0,"div",127),l(1,"A scheduled MYBA game must have a winner. Continue to overtime."),a())}function Co(i,s){if(i&1){let e=b();o(0,"button",41),u("click",function(){let t=m(e).$implicit,r=c(4);return _(r.endReason=t.value)}),l(1),a()}if(i&2){let e=s.$implicit,n=c(4);k("is-active",n.endReason===e.value),L("aria-pressed",n.endReason===e.value),d(),f(e.label)}}function ko(i,s){if(i&1){let e=b();o(0,"p",27),l(1,"Outcome"),a(),o(2,"div",128),P(3,Co,2,4,"button",129,ni),a(),o(5,"label"),l(6,"Reason "),o(7,"textarea",130),j("ngModelChange",function(t){m(e);let r=c(3);return z(r.endNote,t)||(r.endNote=t),_(t)}),a()()}if(i&2){let e=c(3);d(3),v(e.endReasons),d(4),F("ngModel",e.endNote)}}function yo(i,s){if(i&1){let e=b();o(0,"div",85)(1,"p",27),l(2,"Final review"),a(),o(3,"h2"),l(4),a(),o(5,"p"),l(6),a(),g(7,xo,2,0,"div",127),g(8,ko,8,1),o(9,"button",33),u("click",function(){m(e);let t=c(2);return _(t.endGame())}),l(10,"Confirm final score"),a(),o(11,"button",93),u("click",function(){m(e);let t=c(2);return _(t.endOpen=!1)}),l(12,"Keep scoring"),a()()}if(i&2){let e=c(2);d(4),X("",e.stats.away.score," \u2013 ",e.stats.home.score),d(2),Be("",e.game==null||e.game.awayTeam==null?null:e.game.awayTeam.shortName," ",e.stats.away.score,", ",e.game==null||e.game.homeTeam==null?null:e.game.homeTeam.shortName," ",e.stats.home.score),d(),x(e.canEndScheduled?-1:7),d(),x(e.game!=null&&e.game.gameKind?8:-1),d(),w("disabled",!e.canEndScheduled||e.committing)}}function So(i,s){if(i&1&&g(0,yo,13,9,"div",85),i&2){let e=c();x(e.endOpen?0:-1)}}function wo(i,s){if(i&1){let e=b();o(0,"div",85)(1,"p",27),l(2),a(),o(3,"h2",131),l(4),a(),o(5,"p"),l(6,"A jersey number or a name is enough."),a(),o(7,"label"),l(8,"Jersey number"),o(9,"input",132),j("ngModelChange",function(t){m(e);let r=c(2);return z(r.tempJersey,t)||(r.tempJersey=t),_(t)}),a()(),o(10,"label"),l(11,"Player name"),o(12,"input",133),j("ngModelChange",function(t){m(e);let r=c(2);return z(r.tempName,t)||(r.tempName=t),_(t)}),a()(),o(13,"button",33),u("click",function(){m(e);let t=c(2);return _(t.addTemporaryPlayer())}),l(14),a(),o(15,"button",93),u("click",function(){m(e);let t=c(2);return _(t.closeTempPlayer())}),l(16,"Cancel"),a()()}if(i&2){let e,n=s,t=c(2);d(2),X("",t.started?"This game only":t.sideLabel(n.side),"",n.credit?" \xB7 then "+t.tempPlayerAddLabel.replace("Add and credit ",""):""),d(2),f(t.started?"Add a player to "+(((e=t.teamOf(n.side))==null?null:e.shortName)||t.sideLabel(n.side)):"Add player"),d(5),F("ngModel",t.tempJersey),d(3),F("ngModel",t.tempName),d(),w("disabled",!t.canAddTempPlayer||t.committing),d(),f(t.tempPlayerAddLabel)}}function To(i,s){if(i&1&&g(0,wo,17,7,"div",85),i&2){let e,n=c();x((e=n.tempPlayerSheet)?0:-1,e)}}function Po(i,s){if(i&1&&(o(0,"p",38),l(1),a()),i&2){let e=c(3);d(),X("",e.rosterSheetKept(e.rosterSheetSide).length," ",e.rosterSheetKept(e.rosterSheetSide).length===1?"player":"players"," added from your team stay as they are.")}}function vo(i,s){if(i&1&&(o(0,"div",136)(1,"span"),l(2),a()()),i&2){let e=c(3);d(2),f(e.rosterSheet.errors.join(" \xB7 "))}}function Oo(i,s){if(i&1){let e=b();o(0,"div",85)(1,"p",27),l(2),a(),o(3,"h2",134),l(4,"Type roster"),a(),o(5,"p"),l(6,"One player per line: "),o(7,"code"),l(8,"4 Ava Stone"),a(),l(9,", "),o(10,"code"),l(11,"#11 Bo Reyes"),a(),l(12,", "),o(13,"code"),l(14,"Cam Okafor"),a(),l(15,", or just "),o(16,"code"),l(17,"23"),a(),l(18),a(),g(19,Po,2,2,"p",38),o(20,"label"),l(21,"Players "),o(22,"textarea",135),j("ngModelChange",function(t){m(e);let r=c(2);return z(r.rosterSheetText,t)||(r.rosterSheetText=t),_(t)}),u("ngModelChange",function(){m(e);let t=c(2);return _(t.parseRosterSheetText())}),a()(),g(23,vo,3,1,"div",136),o(24,"p",38),l(25),a(),o(26,"button",33),u("click",function(){m(e);let t=c(2);return _(t.applyRosterSheet())}),l(27),a(),o(28,"button",93),u("click",function(){m(e);let t=c(2);return _(t.rosterSheetSide=void 0)}),l(29,"Cancel"),a()()}if(i&2){let e=c(2);d(2),X("",e.sideLabel(e.rosterSheetSide),"",e.started?" \xB7 adds to the roster":""),d(16),H(". Up to ",e.maxRosterLines," players."),d(),x(!e.started&&e.rosterSheetKept(e.rosterSheetSide).length?19:-1),d(3),F("ngModel",e.rosterSheetText),d(),x(e.rosterSheet.errors.length?23:-1),d(2),X("",e.rosterSheet.lines.length," ",e.rosterSheet.lines.length===1?"player":"players"),d(),w("disabled",!e.rosterSheet.valid||!e.rosterSheet.lines.length||e.committing),d(),X(" ",e.started?"Add to":"Use as"," ",e.sideLabel(e.rosterSheetSide)," roster ")}}function Mo(i,s){if(i&1&&g(0,Oo,30,11,"div",85),i&2){let e=c();x(e.rosterSheetSide?0:-1)}}function Eo(i,s){i&1&&(o(0,"div",111),l(1,"Loading your teams\u2026"),a())}function Bo(i,s){if(i&1){let e=b();o(0,"div",138)(1,"span"),l(2,"Your teams could not be loaded."),a(),o(3,"button",43),u("click",function(){m(e);let t=c(3);return _(t.loadMyTeams())}),l(4,"Try again"),a()()}}function Ro(i,s){i&1&&(o(0,"div",111),l(1,"No basketball team is on your account. Type the roster instead."),a())}function Io(i,s){if(i&1){let e=b();o(0,"button",141),u("click",function(){let t=m(e).$implicit,r=c(4);return _(r.pickTeamRosterTeam(t))}),l(1),a()}if(i&2){let e=s.$implicit,n=c(4);k("is-selected",(n.teamRosterTeam==null?null:n.teamRosterTeam._key)===e._key),L("aria-pressed",(n.teamRosterTeam==null?null:n.teamRosterTeam._key)===e._key),d(),f(e.shortName||e.name)}}function No(i,s){if(i&1&&(o(0,"div",139),P(1,Io,2,4,"button",140,ii),a()),i&2){let e=c(3);d(),v(e.teamRosterTeams)}}function Lo(i,s){i&1&&(o(0,"div",111),l(1,"Loading the roster\u2026"),a())}function Vo(i,s){if(i&1){let e=b();o(0,"div",138)(1,"span"),l(2,"The roster could not be loaded."),a(),o(3,"button",43),u("click",function(){m(e);let t=c(4);return _(t.pickTeamRosterTeam(t.teamRosterTeam))}),l(4,"Try again"),a()()}}function Do(i,s){i&1&&(o(0,"div",111),l(1,"This team has no roster players yet."),a())}function Ao(i,s){i&1&&(o(0,"small"),l(1,"already on this side"),a())}function $o(i,s){if(i&1&&(o(0,"small"),l(1),a()),i&2){let e=c(6);d(),H("on the ",e.sideLabel(s)," team")}}function Fo(i,s){if(i&1){let e=b();o(0,"label",145)(1,"input",146),u("change",function(){let t=m(e).$implicit,r=c(5);return _(r.togglePick(t))}),a(),o(2,"strong"),l(3),a(),o(4,"span"),l(5),a(),g(6,Ao,2,0,"small")(7,$o,2,1,"small"),a()}if(i&2){let e,n=s.$implicit,t=c(5);k("is-disabled",t.onThisSide(n)),d(),w("checked",t.isPicked(n))("disabled",t.onThisSide(n)),d(2),f(n.jersey||"\u2014"),d(2),f(n.label),d(),x(t.onThisSide(n)?6:(e=t.onOtherSide(n))?7:-1,e)}}function zo(i,s){if(i&1){let e=b();o(0,"div",142)(1,"span"),l(2),a(),o(3,"button",40),u("click",function(){m(e);let t=c(4);return _(t.pickAll())}),l(4,"Select all"),a(),o(5,"button",40),u("click",function(){m(e);let t=c(4);return _(t.pickNone())}),l(6,"Clear"),a()(),o(7,"div",143),P(8,Fo,8,7,"label",144,oi),a()}if(i&2){let e=c(4);d(2),H("",e.teamRosterSelection.length," picked"),d(6),v(e.teamRosterPlayers)}}function jo(i,s){if(i&1&&g(0,Lo,2,0,"div",111)(1,Vo,5,0,"div",138)(2,Do,2,0,"div",111)(3,zo,10,1),i&2){let e=c(3);x(e.teamRosterPlayersLoading?0:e.teamRosterPlayersError?1:e.teamRosterPlayers.length?3:2)}}function Ho(i,s){if(i&1&&(o(0,"div",136)(1,"span"),l(2),a()()),i&2){let e=c(3);d(2),f(e.teamRosterMessage)}}function Uo(i,s){if(i&1){let e=b();o(0,"div",85)(1,"p",27),l(2),a(),o(3,"h2",137),l(4,"Use my team's roster"),a(),o(5,"p"),l(6,"Pick the players for this side. A player can be on one side only. Nothing counts toward stats."),a(),g(7,Eo,2,0,"div",111)(8,Bo,5,0,"div",138)(9,Ro,2,0,"div",111)(10,No,3,0,"div",139),g(11,jo,4,1),g(12,Ho,3,1,"div",136),o(13,"button",33),u("click",function(){m(e);let t=c(2);
2return _(t.applyTeamRoster())}),l(14),a(),o(15,"button",93),u("click",function(){m(e);let t=c(2);return _(t.teamRosterSide=void 0)}),l(16,"Cancel"),a()()}if(i&2){let e=c(2);d(2),f(e.sideLabel(e.teamRosterSide)),d(5),x(e.teamRosterLoading?7:e.teamRosterError?8:e.teamRosterTeams.length?10:9),d(4),x(e.teamRosterTeam?11:-1),d(),x(e.teamRosterMessage?12:-1),d(),w("disabled",!e.teamRosterSelection.length||e.committing),d(),Ee(" Add ",e.teamRosterSelection.length||""," ",e.teamRosterSelection.length===1?"player":"players"," to ",e.sideLabel(e.teamRosterSide)," ")}}function Wo(i,s){if(i&1&&g(0,Uo,17,8,"div",85),i&2){let e=c();x(e.teamRosterSide?0:-1)}}function Ko(i,s){if(i&1){let e=b();o(0,"label"),l(1),o(2,"input",148),j("ngModelChange",function(t){let r=m(e).$implicit,p=c(3);return z(p.teamNamesDraft[r].name,t)||(p.teamNamesDraft[r].name=t),_(t)}),a()(),o(3,"label"),l(4),o(5,"input",35),j("ngModelChange",function(t){let r=m(e).$implicit,p=c(3);return z(p.teamNamesDraft[r].shortName,t)||(p.teamNamesDraft[r].shortName=t),_(t)}),a()()}if(i&2){let e=s.$implicit,n=c(3);d(),H("",n.sideLabel(e)," team"),d(),F("ngModel",n.teamNamesDraft[e].name),w("name",e+"RenameName")("maxlength",n.maxTeamName),d(2),H("",n.sideLabel(e)," short name"),d(),F("ngModel",n.teamNamesDraft[e].shortName),w("name",e+"RenameShort")("maxlength",n.maxShortName)("placeholder",n.renameDerivedShort(e))}}function Qo(i,s){if(i&1){let e=b();o(0,"div",85)(1,"p",27),l(2,"Practice game"),a(),o(3,"h2",147),l(4,"Team names"),a(),P(5,Ko,6,9,null,null,U),o(7,"button",33),u("click",function(){m(e);let t=c(2);return _(t.saveTeamNames())}),l(8,"Save names"),a(),o(9,"button",93),u("click",function(){m(e);let t=c(2);return _(t.teamNamesOpen=!1)}),l(10,"Cancel"),a()()}if(i&2){let e=c(2);d(5),v(e.sides),d(2),w("disabled",e.committing)}}function qo(i,s){if(i&1&&g(0,Qo,11,1,"div",85),i&2){let e=c();x(e.teamNamesOpen?0:-1)}}function Go(i,s){i&1&&l(0," \xB7 Team parent ")}function Yo(i,s){i&1&&l(0," \xB7 Team staff ")}function Jo(i,s){if(i&1){let e=b();o(0,"button",43),u("click",function(){let t=m(e).$implicit,r=c(3);return _(r.claimScorebook(t))}),o(1,"strong"),l(2),g(3,Go,1,0)(4,Yo,1,0),a(),o(5,"span"),l(6),a()()}if(i&2){let e=s.$implicit;d(2),f(e.scorerName||"Unknown scorer"),d(),x(e.scorerRole==="parent"?3:e.scorerRole==="team"?4:-1),d(3),f(e.isMine?"Your scorebook":e.scoreID)}}function Xo(i,s){i&1&&(o(0,"div",111),l(1,"No completed bk1 scorebooks are available."),a())}function Zo(i,s){if(i&1){let e=b();o(0,"div",85)(1,"p",27),l(2,"Event scoring staff"),a(),o(3,"h2"),l(4,"Select the official scorebook"),a(),o(5,"p"),l(6,"Publishing one scorebook does not merge or change the others."),a(),o(7,"div",149),P(8,Jo,7,3,"button",null,ri,!1,Xo,2,0,"div",111),a(),o(11,"button",93),u("click",function(){m(e);let t=c(2);return _(t.claimCandidates=void 0)}),l(12,"Cancel"),a()()}if(i&2){let e=c(2);d(8),v(e.claimCandidates)}}function er(i,s){if(i&1&&g(0,Zo,13,1,"div",85),i&2){let e=c();x(e.claimCandidates?0:-1)}}var je="MYBA-2025-10-27",Wt="rp-basketball-clientID",He=new Set(["PERIOD_END","TECHNICAL_FOUL","EJECTION","GAME_END"]),Kt="bk1.linescore",tr=4e3,nr=70,ir=214,or=40,rr=46,ar=46,sr=150,lr=1100,cr=250,dr=.45,pr=null,Ue="assets/images/basketball-court-logo.png",Pa=(()=>{class i{route;api;notify;sync;bottomSheet;zone;periods=["H1","H2","OT1","OT2"];artUrl=pr;artLoaded=!1;courtLogo=Ue;courtSponsor=!1;loading=!0;loadError;game;actions=[];stats=Le([]);period="H1";setupProfile="MYBA_2025_26_RUNNING";shotLocationEnabled=!1;syncState="synced";pendingCount=0;syncError;armed;committing=!1;lastPlay;chips={away:[],home:[]};warnedThisLoad=new Set;sheetSide="away";showLog=!1;showBoxScore=!1;moreOpen=!1;rostersOpen=!1;endPeriodConfirm=!1;timeoutWarningSide;adminMode;adminTarget="player";adminPerson;technicalCountsPersonal=!1;ejectionScope="STANDARD";pendingShotID;endOpen=!1;endReason="";endReasons=[{value:"",label:"Final"},{value:"TIED",label:"Tied"},{value:"INCOMPLETE",label:"Incomplete"}];endNote="";tempPlayerSheet;playerSheet;editedJersey="";claimCandidates;tempName="";tempJersey="";dismissedBanners=new Set;nameLimit=24;linescorePref=i.loadLinescorePref();peek=!1;peekTimer=null;stageEl;hudEl;resizeObserver;onWindowResize=()=>this.measureStage();set stageRef(e){this.stageEl=e?.nativeElement,this.observeStage()}set hudRef(e){this.hudEl=e?.nativeElement,this.observeStage()}moreTpl;rostersTpl;playerTpl;tempPlayerTpl;rosterSheetTpl;teamRosterTpl;teamNamesTpl;adminTpl;timeoutWarningTpl;shotLocationTpl;endPeriodTpl;endReviewTpl;playlogTpl;boxscoreTpl;claimTpl;sheetRef;currentSheet=null;sheetOpQueued=!1;sides=["away","home"];maxTeamName=St;maxShortName=wt;maxRosterLines=de;setupNames=Ke();draftRoster={away:[],home:[]};rosterSheetSide;rosterSheetText="";rosterSheet={lines:[],errors:[],skipped:[],valid:!0};teamNamesOpen=!1;teamNamesDraft=Ke();teamRosterSide;teamRosterTeams=[];teamRosterTeamsLoaded=!1;teamRosterLoading=!1;teamRosterError=!1;teamRosterTeam;teamRosterPlayers=[];teamRosterPlayersLoading=!1;teamRosterPlayersError=!1;teamRosterPicked=new Set;teamRosterMessage;docRosters={away:[],home:[]};docNames=Ke();scoreID="";clientID="";seq=0;redoAction;destroy$=new be;constructor(e,n,t,r,p,h){this.route=e,this.api=n,this.notify=t,this.sync=r,this.bottomSheet=p,this.zone=h}ngDoCheck(){this.reconcileSheet()}ngOnInit(){this.sync.state$.pipe(ie(this.destroy$)).subscribe(e=>this.syncState=e),this.sync.pendingCount$.pipe(ie(this.destroy$)).subscribe(e=>this.pendingCount=e),this.sync.error$.pipe(ie(this.destroy$)).subscribe(e=>this.syncError=e||void 0),this.sync.response$.pipe(ie(this.destroy$)).subscribe(e=>this.handleSyncResponse(e)),this.route.paramMap.pipe(ie(this.destroy$)).subscribe(e=>{let n=e.get("gameID");n&&this.load(n)}),this.artUrl&&typeof Image<"u"&&(new Image().src=this.artUrl)}load(e){return S(this,null,function*(){this.loading=!0,this.loadError=void 0;try{this.game=yield Y(this.api.get(`BasketballScoring/game/${e}`)),this.courtLogo=this.game.eventLogo?`${new xt().prefix}${this.game.eventLogo}&w=160&h=160&fit=contain`:ut.siteName=="myas"?"assets/logos/MYBALogo.webp":Ue,this.courtSponsor=this.courtLogo!=Ue,this.docNames=this.isPractice?{away:A({},Ie.away),home:A({},Ie.home)}:{away:{name:this.game.awayTeam.name,shortName:this.game.awayTeam.shortName},home:{name:this.game.homeTeam.name,shortName:this.game.homeTeam.shortName}},this.docRosters={away:(this.game.awayTeam.roster||[]).map(h=>A({},h)),home:(this.game.homeTeam.roster||[]).map(h=>A({},h))},this.draftRoster={away:[],home:[]},this.setupProfile=this.game.profileID||"MYBA_2025_26_RUNNING",this.scoreID=this.game.scoreID||`bk1-${K()}`,this.clientID=this.getClientID();let n=this.game.actions||[],t=Q(n).find(h=>h.type==="GAME_START");this.shotLocationEnabled=t?.gameStart?.shotLocationEnabled||!1;let r=yield this.sync.initialize(e,this.scoreID,this.clientID,this.setupProfile,je,this.game.homeIsTo
2pTeam,n);this.actions=We(n,r),this.rebuildRosters(),this.applyTeamNames(),this.setupNames={away:Te(this.game.awayTeam,this.docNames.away),home:Te(this.game.homeTeam,this.docNames.home)};let p=Q(this.actions).find(h=>h.type==="GAME_START");p?.gameStart&&(this.setupProfile=p.gameStart.profileID,this.shotLocationEnabled=p.gameStart.shotLocationEnabled),this.seq=Math.max(0,...this.actions.map(h=>h.seq)),this.period=mr(this.actions),this.armed=void 0,this.warnedThisLoad.clear(),this.recalculate(),this.loading=!1}catch(n){this.loadError=typeof n?.error=="string"?n.error:"The basketball game could not be loaded.",this.loading=!1}})}get started(){return Q(this.actions).some(e=>e.type==="GAME_START")}get ended(){return Q(this.actions).some(e=>e.type==="GAME_END")}get live(){return this.started&&!this.ended}get isPractice(){return yt(this.game?.gameID)}hasPlatformPlayersOn(e){return!!this.teamOf(e)?.roster.some(n=>!n.placeholderID)}get hasPlatformPlayers(){return this.hasPlatformPlayersOn(this.sheetSide)}get canAddTempPlayer(){return!!(this.tempJersey.trim()||this.tempName.trim())}sideLabel(e){return e==="away"?"Away":"Home"}sideRoster(e){return[...this.teamOf(e)?.roster??[],...this.draftRoster[e]]}personName(e){return e.jersey&&e.label===`#${e.jersey}`?"":e.label}teamOf(e){return e==="away"?this.game?.awayTeam:this.game?.homeTeam}get sheetTeam(){return this.teamOf(this.sheetSide)}derivedShortName(e){return this.shortNameFor(e,this.setupNames[e].name||this.docNames[e].name,"")}renameDerivedShort(e){return this.shortNameFor(e,this.teamNamesDraft[e].name||this.docNames[e].name,"")}shortNameFor(e,n,t){let r=(t??"").trim();return r||(n.trim()===this.docNames[e].name?this.docNames[e].shortName:Se(n))}get timeoutPool(){return this.period==="OT1"?"OT1":this.period==="OT2"?"OT2":"REG"}get syncLabel(){return this.syncState==="offline"?`Offline \xB7 ${this.pendingCount} safe`:this.syncState==="saving"?`Saving \xB7 ${this.pendingCount}`:this.syncState==="error"?`Retry \xB7 ${this.pendingCount}`:"Saved"}get canEndScheduled(){return!!this.game?.gameKind||this.stats.away.score!==this.stats.home.score}get activeActions(){return Q(this.actions).slice().reverse()}get kindLabel(){return this.game?.gameKind==="PRACTICE"?"PRACTICE \xB7 NOT COUNTED IN STATS":this.game?.gameKind==="EXHIBITION"?"EXHIBITION \xB7 NOT COUNTED IN STATS":`MYBA \xB7 ${this.setupProfile==="MYBA_2025_26_STOP"?"STOP TIME":"RUNNING TIME"}`}get kindTone(){return this.game?.gameKind==="PRACTICE"?"practice":this.game?.gameKind==="EXHIBITION"?"exhibition":"profile"}get canUndo(){return this.activeActions.some(e=>!["GAME_START","PERIOD_START"].includes(e.type))}get canRedo(){return!!this.redoAction}get undoLocked(){return!!this.armed||this.sheetOpen||this.committing}get sheetOpen(){return this.showLog||this.showBoxScore||this.moreOpen||this.rostersOpen||this.endPeriodConfirm||!!this.timeoutWarningSide||!!this.adminMode||!!this.pendingShotID||this.endOpen||!!this.tempPlayerSheet||!!this.playerSheet||!!this.claimCandidates||!!this.rosterSheetSide||!!this.teamRosterSide||this.teamNamesOpen}get endPeriodLabel(){return this.period==="OT2"?"Review final":`End ${this.period}`}get endPeriodQuestion(){return this.period==="H1"?"End the first half? The second half starts when you confirm.":this.period==="H2"?"End the second half? A tie goes to overtime; otherwise you review the final score.":this.period==="OT1"?"End the first overtime? A tie goes to a second overtime; otherwise you review the final score.":"End the second overtime and review the final score?"}benchFouls(e){return this.stats[e].teamFoulsByPool[this.period==="H1"?"H1":"H2"]}benchBonus(e){let n=this.stats[e].bonusByPeriod[this.period];return n==="Double bonus"?"DBL BONUS":n?"BONUS":null}benchTimeouts(e){return this.stats[e].timeoutsRemainingByPool[this.timeoutPool]}get playChip(){if(this.armed)return{state:"armed",cap:Ae(this.armed),who:"tap the player",what:"",tone:Lt(this.armed)};if(this.lastPlay?.person){let e=Dt(this.lastPlay,this.lastPlay.side?this.stats[this.lastPlay.side]:void 0);return{state:"last",cap:"LAST",who:e.who,what:e.what,tone:"none"}}return{state:"idle",cap:"READY",who:"Tap what happened",what:"",tone:"none"}}get playChipAnnouncement(){let e=this.playChip;return e.state==="armed"?`${e.cap.toLowerCase()}. Choose the player.`:e.state==="last"?`${e.who}, ${e.what}`:""}static loadLinescorePref(){try{let e=localStorage.getItem(Kt);if(e==="1")return!0;
2if(e==="0")return!1}catch{}return typeof window<"u"&&window.innerWidth>=600}get scoreboardExpanded(){return this.ended?!0:this.started?this.linescorePref||this.peek:!1}toggleScoreboard(){this.peek?(this.endPeek(),this.linescorePref=!0):this.linescorePref=!this.linescorePref;try{localStorage.setItem(Kt,this.linescorePref?"1":"0")}catch{}}onPeriodChanged(){this.armed=void 0,!(this.linescorePref||this.armed||this.sheetOpen||!this.live)&&(this.endPeek(),this.peek=!0,this.peekTimer=setTimeout(()=>{this.peekTimer=null,this.peek=!1},tr))}endPeek(){this.peekTimer!==null&&(clearTimeout(this.peekTimer),this.peekTimer=null),this.peek=!1}get banners(){let e=[];if(this.syncError&&e.push({id:"sync",tone:"error",text:this.syncError,action:"retry"}),this.game?.disciplineWarnings?.length&&e.push({id:"discipline",tone:"warn",text:`Roster warning: ${this.game.disciplineWarnings[0].message}`}),this.game?.claim&&!this.game.claim.isMine){let n=this.game.claim.scorerName?`: ${this.game.claim.scorerName}${this.game.claim.scorerRole==="parent"?" (team parent)":""}`:"";e.push({id:"claim",tone:"info",text:`Another scorebook is official${n}. Your log stays separate.`})}return this.game?.pendingScoreReview&&e.push({id:"review",tone:"warn",text:"A completed scorebook needs event staff review.",action:"review"}),e.filter(n=>!this.dismissedBanners.has(n.id))}dismissBanner(e){this.dismissedBanners.add(e)}bannerAction(e){e.action==="retry"?this.resumeSync():e.action==="review"&&this.reviewScorebooks()}syncTap(){this.syncState==="error"&&this.resumeSync()}observeStage(){if(this.resizeObserver?.disconnect(),this.resizeObserver=void 0,typeof window<"u"&&window.removeEventListener("resize",this.onWindowResize),!(!this.stageEl||typeof window>"u")){if(typeof ResizeObserver<"u"){this.resizeObserver=new ResizeObserver(()=>this.zone?this.zone.run(()=>this.measureStage()):this.measureStage()),this.resizeObserver.observe(this.stageEl),this.hudEl&&this.resizeObserver.observe(this.hudEl);let e=this.stageEl.querySelector(".bk1-tray");e&&this.resizeObserver.observe(e)}window.addEventListener("resize",this.onWindowResize),Promise.resolve().then(()=>this.measureStage())}}measureStage(){let e=this.stageEl;if(!e||typeof window>"u")return;let n=e.clientWidth;if(!n)return;let t=e.getBoundingClientRect(),r=t.top+window.scrollY,p=window.innerHeight-r-nr,h=this.hudEl?this.hudEl.offsetHeight:107,y=14+h,T=(Pe,qt)=>e.querySelector(Pe)?.offsetHeight||qt,C=T(".bk1-tray",ir),O=T(".bk1-chip",or),I=8+C+8+O,N=T(".bench-head",rr)+sr+T(".bench-to",ar)+12+8,he=8+Math.max(I,N),se=Math.round(Math.max(Math.min(p,lr),y+he));e.style.height=`${se}px`,e.style.setProperty("--bk1-hud-h",`${h}px`),e.style.setProperty("--bk1-tray-h",`${C}px`);let le=se-(C+16+O)-(y+6)-12;e.style.setProperty("--bk1-court",`${Math.min(1,Math.max(dr,le/cr)).toFixed(3)}`);let fe=document.documentElement.style;fe.setProperty("--sbd-stage-left",`${Math.max(0,t.left)}px`),fe.setProperty("--sbd-stage-width",`${n}px`);let Z=n<375?20:n<414?24:n<560?28:32;Z!==this.nameLimit&&(this.nameLimit=Z)}startGame(){return S(this,null,function*(){try{yield this.sync.configure(this.setupProfile,je,this.game?.homeIsTopTeam||!1)}catch{this.notify.openWarningModal("The rule profile could not be saved on the device. Try again before play continues.");return}let e=[];if(this.isPractice){for(let n of this.sides){let t=this.setupNames[n].name.trim()||this.docNames[n].name,r=Ne(t,this.shortNameFor(n,t,this.setupNames[n].shortName));r&&e.push(this.makeAction("TEAM_SET",{side:n,team:r}))}for(let n of this.sides)for(let t of this.draftRoster[n])e.push(this.makeAction("ROSTER_BIND",{side:n,roster:{placeholderID:t.placeholderID,binding:t}}))}e.push(this.makeAction("GAME_START",{gameStart:{profileID:this.setupProfile,profileVersion:je,shotLocationEnabled:this.shotLocationEnabled}})),e.push(this.makeAction("PERIOD_START",{period:"H1"})),(yield this.commit(e,!0))&&this.isPractice&&(this.draftRoster={away:[],home:[]})})}openRosterSheet(e){this.cancelArmed(),this.rosterSheetSide=e,this.rosterSheetText=this.started?"":It(this.draftRoster[e].filter(n=>!!n.placeholderID)),this.parseRosterSheetText()}rosterSheetKept(e){return this.started?this.sideRoster(e):[...this.teamOf(e)?.roster??[],...this.draftRoster[e].filter(n=>!n.placeholderID)]}parseRosterSheetText(){let e=this.rosterSheetSide;e&&(this.rosterSheet=Bt(this.rosterSheetText,this.rosterSheetKept(e)))}applyRosterSheet(){return S(this,null,function*(){let e=this.rosterSheetSide;if(!e||!this.rosterSheet.valid||!this.rosterSheet.lines.length)return;let n=this.rosterSheet.lines.map(t=>Rt(e,t));if(!this.started)this.draftRoster[e]=[...this.draftRoster[e].filter(t=>!t.placeholderID),...n];else if(!(yield this.commit(n.map(r=>this.makeAction("ROSTER_BIND",{side:e,roster:{placeholderID:r.placeholderID,binding:r}}
2)),!0)))return;this.rosterSheetSide=void 0,this.rosterSheetText=""})}removeDraftPlayer(e,n){this.draftRoster[e]=this.draftRoster[e].filter(t=>t!==n)}openTempPlayer(e){let n=this.live?this.armed:void 0;this.armed=void 0,this.tempPlayerSheet={side:e,credit:n},this.tempName="",this.tempJersey=""}closeTempPlayer(){let e=this.tempPlayerSheet?.credit;this.tempPlayerSheet=void 0,e&&this.live&&(this.armed=e)}get tempPlayerAddLabel(){let e=this.tempPlayerSheet?.credit;return e?`Add and credit ${Ae(e).toLowerCase()}`:"Add player"}addTemporaryPlayer(){return S(this,null,function*(){let e=this.tempPlayerSheet;if(!e||this.committing)return;let n=e.side,t=this.tempJersey.trim(),r=this.tempName.trim();if(!t&&!r)return;let p={placeholderID:`${n}:${K()}`,label:Ve(t,r),jersey:t||void 0,role:"player"};if(this.isPractice){let h=pe(this.sideRoster(n),[p]);if(h.length){this.notify.openErrorModal(h[0]);return}}if(!this.started)this.draftRoster[n].push(p);else{let h=[this.makeAction("ROSTER_BIND",{side:n,roster:{placeholderID:p.placeholderID,binding:p}})],y=e.credit?this.makeAction(_e(e.credit).type,A({period:this.period,side:n,person:p},_e(e.credit))):void 0;if(y&&h.push(y),!(yield this.commit(h,!0)))return;y&&this.afterCredit(n,this.findOnRoster(n,p)??p,y)}this.tempName="",this.tempJersey="",this.tempPlayerSheet=void 0})}openTeamRoster(e){return S(this,null,function*(){this.cancelArmed(),this.teamRosterSide=e,this.teamRosterTeam=void 0,this.teamRosterPlayers=[],this.teamRosterPicked=new Set,this.teamRosterMessage=void 0,this.teamRosterTeamsLoaded||(yield this.loadMyTeams())})}loadMyTeams(){return S(this,null,function*(){this.teamRosterLoading=!0,this.teamRosterError=!1;try{let e=yield Y(this.api.get("Team/myTeams/false/false"));this.teamRosterTeams=(e.myTeams||[]).filter(n=>n.sport==="BK"),this.teamRosterTeamsLoaded=!0}catch{this.teamRosterError=!0}finally{this.teamRosterLoading=!1}})}pickTeamRosterTeam(e){return S(this,null,function*(){this.teamRosterTeam=e,this.teamRosterPlayers=[],this.teamRosterPicked=new Set,this.teamRosterMessage=void 0,this.teamRosterPlayersLoading=!0,this.teamRosterPlayersError=!1;try{let n=yield Y(this.api.get(`BasketballScoring/team-roster/${e._key}`));this.teamRosterPlayers=n.roster||[]}catch{this.teamRosterPlayersError=!0}finally{this.teamRosterPlayersLoading=!1}})}onThisSide(e){return!!this.teamRosterSide&&this.sideRoster(this.teamRosterSide).some(n=>!!n.ptKey&&n.ptKey===e.ptKey)}onOtherSide(e){if(!this.teamRosterSide)return;let n=this.teamRosterSide==="away"?"home":"away";return this.sideRoster(n).some(t=>!!t.ptKey&&t.ptKey===e.ptKey)?n:void 0}isPicked(e){return!!e.ptKey&&this.teamRosterPicked.has(e.ptKey)}togglePick(e){!e.ptKey||this.onThisSide(e)||(this.teamRosterPicked.has(e.ptKey)?this.teamRosterPicked.delete(e.ptKey):this.teamRosterPicked.add(e.ptKey),this.teamRosterMessage=void 0)}pickAll(){this.teamRosterPicked=new Set(this.teamRosterPlayers.filter(e=>e.ptKey&&!this.onThisSide(e)&&!this.onOtherSide(e)).map(e=>e.ptKey)),this.teamRosterMessage=void 0}pickNone(){this.teamRosterPicked=new Set}get teamRosterSelection(){return this.teamRosterPlayers.filter(e=>this.isPicked(e)&&!this.onThisSide(e))}applyTeamRoster(){return S(this,null,function*(){let e=this.teamRosterSide,n=this.teamRosterSelection;if(!e||!n.length)return;let t=n.find(h=>this.onOtherSide(h));if(t){let h=this.onOtherSide(t);this.teamRosterMessage=`${t.jersey?"#"+t.jersey+" ":""}${t.label} is already on the ${this.sideLabel(h)} team.`;return}let r=pe(this.sideRoster(e),n);if(r.length){this.teamRosterMessage=r[0];return}let p=n.map(h=>ne(A({},h),{role:"player"}));if(!this.started)this.draftRoster[e]=[...this.draftRoster[e],...p];else if(!(yield this.commit(p.map(y=>this.makeAction("ROSTER_BIND",{side:e,roster:{placeholderID:y.ptKey,binding:y}})),!0)))return;this.teamRosterSide=void 0})}openTeamNames(){this.game&&(this.cancelArmed(),this.teamNamesDraft={away:Te(this.game.awayTeam,this.docNames.away),home:Te(this.game.homeTeam,this.docNames.home)},this.teamNamesOpen=!0)}saveTeamNames(){return S(this,null,function*(){if(!this.game)return;let e=[];for(let n of this.sides){let t=this.teamNamesDraft[n].name.trim()||this.docNames[n].name,r=Ne(t,this.shortNameFor(n,t,this.teamNamesDraft[n].shortName)),p=this.teamOf(n);r&&(r.name!==p.name||r.shortName!==p.shortName)&&e.push(this.makeAction("TEAM_SET",{side:n,team:r}))}e.length&&!(yield this.commit(e,!0))||(this.teamNamesOpen=!1)})}arm(e){this.live&&(this.armed=me(this.armed,e)?void 0:e)}cancelArmed(){this.armed=void 0}onEscape(){this.armed&&!this.sheetOpen&&this.cancelArmed()}onChipPick(e,n){this.pickPlayer(e,n.person)}pickPlayer(e,n){return S(this,null,function*(){let t=this.armed;if(!t||this.committing||!this.live)return!1;let r=this.makeAction(_e(t).type,A({period:this.period,side:e,person:n},_e(t)));return(yield this.commit(r))?(me(this.armed,t)&&(this.armed=void 0),this.afterCredit(e,n,r),!0):!1})}afterCredit(e,n,t){let r=n.personID?this.game?.disciplineWarnings?.find(p=>p.personID===n.personID):void 0;if(r&&!this.warnedThisLoad.has(n.personID)){this.warnedThisLoad.add(n.personID),this.notify.openAlertModal(r.message,ht.WARNING,()=>this.maybeShotLocation(t));return}this.maybeShotLocation(t)}maybeShotLocation(e){e.type==="SHOT"&&this.shotLocationEnabled&&this.live&&(this.pendingShotID=e.actionID)}onChipLongPress(e,n){this.cancelArmed(),this.openPlayerSheet(e,n.person)}onBenchAdd(e){this.openTempPlayer(e)}onBenchTimeout(e){this.cancelArmed(),this.timeout(e)}onBenchHeader(e){this.openRosters(e)}openPlayerSheet(e,n,t="menu"){this.cancelArmed(),this.rostersOpen=!1,this.playerSheet={side:e,person:n,mode:t},t==="jersey"&&(this.editedJersey=n.jersey||"")}closePlayerSheet(){this.playerSheet=void 0}get playerSheetChip(){let e=this.playerSheet;return e&&this.chips[e.side].find(n=>n.person===e.person)}get playerSheetLine(){if(!this.playerSheet)return"";let e=this.playerSheetChip?.line;return e?`${e.pts} PTS \xB7 ${e.reb} REB \xB7 ${e.ast} AST \xB7 ${e.pf} PF \xB7 ${e.fgm}/${e.fga} FG`:"No actions yet"}get playerSheetBadges(){let e=this.playerSheetChip;if(!e)return[];let n=[];return e.ejected?n.push({tone:"red",text:"Red EJ badge \u2014 ejected from this game."}):e.fouledOut?n.push({tone:"red",text:`Red ${e.fouls} badge \u2014 fouled out on ${e.fouls} personal fouls.`}):e.fouls&&n.push({tone:"red",text:`Red ${e.fouls} badge \u2014 ${e.fouls} personal ${e.fouls===1?"foul":"fouls"}, ${$e-e.fouls} from fouling out.`}),e.warned&&n.push({tone:"amber",text:"Amber ! badge \u2014 discipline warning from an earlier game."}),n}openJerseyCorrection(){let e=this.playerSheet;e&&(this.editedJersey=e.person.jersey||"",e.mode="jersey")}saveJerseyCorrection(){return S(this,null,function*(){let e=this.playerSheet;if(!e)return;let n=ne(A({},e.person),{jersey:this.editedJersey.trim()||void 0});if(this.isPractice&&n.jersey){let r=this.sideRoster(e.side).filter(h=>h!==e.person),p=pe(r,[n]);if(p.length){this.notify.openErrorModal(p[0]);return}}(yield this.commit(this.makeAction("ROSTER_BIND",{side:e.side,roster:{placeholderID:n.placeholderID||n.ptKey||n.playerID||"",binding:n}}),!0))&&(this.playerSheet=void 0)})}openResolvePlayer(){this.playerSheet&&(this.playerSheet.mode="resolve")}rebindTemporaryPlayer(e){return S(this,null,function*(){let n=this.playerSheet;!n?.person.placeholderID||!(yield this.commit(this.makeAction("ROSTER_REBIND",{side:n.side,roster:{placeholderID:n.person.placeholderID,binding:e}}),!0))||(this.playerSheet=void 0)})}openMore(){this.cancelArmed(),this.moreOpen=!0}openRosters(e="away"){this.cancelArmed(),this.moreOpen=!1,this.sheetSide=e,this.rostersOpen=!0}openTempPlayerFromMore(){this.moreOpen=!1,this.openTempPlayer(this.sheetSide)}openRosterSheetFromMore(){this.moreOpen=!1,this.openRosterSheet(this.sheetSide)}openTeamRosterFromMore(){this.moreOpen=!1,this.openTeamRoster(this.sheetSide)}openTeamNamesFromMore(){this.moreOpen=!1,this.openTeamNames()}timeout(e){return S(this,null,function*(){if(this.stats[e].timeoutsRemainingByPool[this.timeoutPool]<=0){this.timeoutWarningSide=e;return}yield this.recordTimeout(e)})}recordTimeout(){return S(this,arguments,function*(e=this.timeoutWarningSide){this.timeoutWarningSide=void 0,yield this.commit(this.makeAction("TIMEOUT",{period:this.period,side:e}),!0)})}reviewTimeouts(){this.timeoutWarningSide=void 0,this.showLog=!0}openAdmin(e){this.cancelArmed(),this.moreOpen=!1,this.adminMode=e,this.adminTarget=e==="technical"?"team":"player",this.adminPerson=void 0,this.technicalCountsPersonal=!1}get adminPeople(){return this.sheetTeam?this.adminTarget==="coach"?this.sheetTeam.coaches:this.sheetTeam.roster:[]}saveAdmin(){return S(this,null,function*(){if(this.adminMode){if(this.adminTarget!=="team"&&!this.adminPerson){this.notify.openWarningModal("Select the player or coach.");return}this.adminMode==="technical"?yield this.commit(this.makeAction("TECHNICAL_FOUL",{period:this.period,side:this.sheetSide,person:this.adminTarget==="team"?void 0:this.adminPerson,technical:{targetType:this.adminTarget,technicalClass:"MYBA",countsAsPersonalFoul:this.adminTarget==="player"&&this.technicalCountsPersonal}}),!0):yield this.commit(this.makeAction("EJECTION",{period:this.period,side:this.sheetSide,person:this.adminPerson,ejection:{targetType:this.adminTarget,scope:this.ejectionScope}}),!0),this.adminMode=void 0}})}placeShot(e){return S(this,null,function*(){if(!this.pendingShotID)return;let n=e.currentTarget.getBoundingClientRect(),t=this.makeAction("SHOT_LOCATION_
2SET",{period:this.period,targetActionID:this.pendingShotID,courtX:Qt((e.clientX-n.left)/n.width),courtY:Qt((e.clientY-n.top)/n.height)});this.pendingShotID=void 0,yield this.commit(t)})}undo(e){return S(this,null,function*(){let n=e||this.activeActions.find(t=>!["GAME_START","PERIOD_START"].includes(t.type));n&&(this.redoAction=n,yield this.commit(this.makeAction("UNDO",{period:n.period||this.period,undoes:n.actionID,groupID:K(),note:`Undo ${n.type}`}),He.has(n.type)))})}redo(){return S(this,null,function*(){if(!this.redoAction)return;let e=this.redoAction;this.redoAction=void 0;let n=ne(A({},e),{actionID:K(),seq:++this.seq,ts:Date.now(),clientID:this.clientID,groupID:K()});yield this.commit(n,He.has(n.type))})}correctTimeout(e){return S(this,null,function*(){if(!e.side)return;let n=K(),t=this.makeAction("UNDO",{period:e.period,undoes:e.actionID,groupID:n,note:"Correct timeout team"}),r=this.makeAction("TIMEOUT",{period:e.period,side:e.side==="home"?"away":"home",groupID:n});yield this.commit([t,r],!0)})}askEndPeriod(){this.cancelArmed(),this.endPeriodConfirm=!0}confirmEndPeriod(){return S(this,null,function*(){this.endPeriodConfirm=!1,yield this.advancePeriod()})}advancePeriod(){return S(this,null,function*(){let e=this.makeAction("PERIOD_END",{period:this.period});if(this.period==="H1"){let n=this.makeAction("PERIOD_START",{period:"H2"});if(!(yield this.commit([e,n],!0)))return;this.period="H2",this.onPeriodChanged();return}(yield this.commit(e,!0))&&(this.stats.home.score===this.stats.away.score&&this.period!=="OT2"?(this.period=this.period==="H2"?"OT1":"OT2",yield this.commit(this.makeAction("PERIOD_START",{period:this.period}),!0),this.onPeriodChanged()):this.endOpen=!0)})}endGame(){return S(this,null,function*(){if(!this.canEndScheduled)return;let e=this.stats.away.score===this.stats.home.score;if(this.game?.gameKind&&(e||this.endReason==="INCOMPLETE")&&!this.endNote.trim()){this.notify.openWarningModal("Enter a reason for a tied or incomplete game.");return}let n=this.game?.gameKind?this.endReason||(e?"TIED":"FINAL"):"FINAL";yield this.commit(this.makeAction("GAME_END",{period:this.period,gameEnd:{awayScore:this.stats.away.score,homeScore:this.stats.home.score,reason:n,note:this.endNote.trim()||void 0}}),!0),this.endOpen=!1,this.armed=void 0})}reopenGame(){return S(this,null,function*(){let e=Q(this.actions).filter(t=>t.type==="GAME_END").at(-1);if(!e||!this.game)return;if(!this.game.publishedScoreID){yield this.undo(e);return}let n=this.makeAction("UNDO",{period:e.period||this.period,undoes:e.actionID,groupID:K(),note:"Reopen final score"});try{yield Y(this.api.post(`BasketballScoring/reopen/${this.game.gameID}`,{scoreID:this.game.publishedScoreID,activeGameEndID:e.actionID,undoAction:n})),yield this.sync.enqueue(n,!0),this.actions=We(this.actions,[n]),this.game.publishedScoreID=void 0,this.recalculate()}catch(t){this.notify.openErrorModal(typeof t?.error=="string"?t.error:"The official game could not be reopened.")}})}resumeSync(){this.sync.resume()}reviewScorebooks(){return S(this,null,function*(){if(this.game)try{this.claimCandidates=yield Y(this.api.get(`BasketballScoring/claim-candidates/${this.game.gameID}`))}catch(e){this.notify.openErrorModal(typeof e?.error=="string"?e.error:"Scorebooks could not be loaded.")}})}claimScorebook(e){return S(this,null,function*(){if(this.game)try{yield Y(this.api.post(`BasketballScoring/claim/${this.game.gameID}`,{scoreID:e.scoreID})),this.claimCandidates=void 0,yield this.load(this.game.gameID)}catch(n){this.notify.openErrorModal(typeof n?.error=="string"?n.error:"The scorebook could not be published.")}})}describe(e){let n=e.side==="away"?this.game?.awayTeam.shortName:e.side==="home"?this.game?.homeTeam.shortName:"",t=e.person?.jersey?`#${e.person.jersey}`:e.person?.label||"";if(e.type==="TEAM_SET"){let r=e.team?.shortName&&e.team.shortName!==e.team.name?` (${e.team.shortName})`:"";return`${this.sideLabel(e.side||"away")} team is now ${e.team?.name}${r}`}return e.type==="ROSTER_BIND"?`${n} ${e.roster?.binding?.jersey?"#"+e.roster.binding.jersey+" ":""}${e.roster?.binding?.label||""} added`:e.type==="SHOT"?`${n} ${t} ${e.shot?.made?"+":"miss "} ${e.shot?.value}
2`:e.type==="TIMEOUT"?`${n} timeout`:e.type==="TECHNICAL_FOUL"?`${n} technical \xB7 ${e.person?.label||"team"}`:e.type==="EJECTION"?`${n} ejection \xB7 ${e.person?.label||""}`:`${n} ${t} ${e.type.replaceAll("_"," ").toLowerCase()}`.trim()}desiredSheet(){return this.claimCandidates?"claim":this.endOpen?"endReview":this.endPeriodConfirm?"endPeriod":this.timeoutWarningSide?"timeoutWarning":this.pendingShotID?"shotLocation":this.adminMode?"admin":this.playerSheet?"player":this.tempPlayerSheet?"tempPlayer":this.rosterSheetSide?"rosterSheet":this.teamRosterSide?"teamRoster":this.teamNamesOpen?"teamNames":this.rostersOpen?"rosters":this.moreOpen?"more":this.showBoxScore?"boxscore":this.showLog?"playlog":null}reconcileSheet(){!this.bottomSheet||this.sheetOpQueued||this.desiredSheet()!==this.currentSheet&&(this.sheetOpQueued=!0,Promise.resolve().then(()=>{this.sheetOpQueued=!1;let e=this.desiredSheet();if(e!==this.currentSheet){if(this.currentSheet!==null){let n=this.sheetRef;this.sheetRef=void 0,this.currentSheet=null,n?.dismiss(),e!==null&&this.reconcileSheet();return}e!==null&&this.openSheet(e)}}))}sheetTemplate(e){switch(e){case"more":return this.moreTpl;case"rosters":return this.rostersTpl;case"player":return this.playerTpl;case"tempPlayer":return this.tempPlayerTpl;case"rosterSheet":return this.rosterSheetTpl;case"teamRoster":return this.teamRosterTpl;case"teamNames":return this.teamNamesTpl;case"admin":return this.adminTpl;case"timeoutWarning":return this.timeoutWarningTpl;case"shotLocation":return this.shotLocationTpl;case"endPeriod":return this.endPeriodTpl;case"endReview":return this.endReviewTpl;case"playlog":return this.playlogTpl;case"boxscore":return this.boxscoreTpl;case"claim":return this.claimTpl}}sheetVariant(e){switch(e){case"admin":case"timeoutWarning":case"shotLocation":case"endPeriod":case"endReview":return"stage";case"player":case"tempPlayer":case"rosterSheet":case"teamRoster":case"teamNames":case"rosters":return"edit";case"playlog":case"boxscore":return"log";default:return"more"}}openSheet(e){let n=this.sheetTemplate(e);if(!n||!this.bottomSheet)return;let t=this.bottomSheet.open(n,{panelClass:["sbd-sheet",`sbd-sheet--${this.sheetVariant(e)}`],hasBackdrop:!0,autoFocus:"first-tabbable",restoreFocus:!0,closeOnNavigation:!0});this.sheetRef=t,this.currentSheet=e,t.afterDismissed().subscribe(()=>{this.sheetRef===t&&(this.sheetRef=void 0,this.currentSheet=null),this.onSheetDismissed(e)})}onSheetDismissed(e){switch(e){case"more":this.moreOpen=!1;break;case"rosters":this.rostersOpen=!1;break;case"player":this.playerSheet=void 0;break;case"tempPlayer":this.tempPlayerSheet&&this.closeTempPlayer();break;case"rosterSheet":this.rosterSheetSide=void 0;break;case"teamRoster":this.teamRosterSide=void 0;break;case"teamNames":this.teamNamesOpen=!1;break;case"admin":this.adminMode=void 0;break;case"timeoutWarning":this.timeoutWarningSide=void 0;break;case"shotLocation":this.pendingShotID=void 0;break;case"endPeriod":this.endPeriodConfirm=!1;break;case"endReview":this.endOpen=!1;break;case"playlog":this.showLog=!1;break;case"boxscore":this.showBoxScore=!1;break;case"claim":this.claimCandidates=void 0;break}}commit(e,n=!1){return S(this,null,function*(){if(this.committing)return!1;let t=Array.isArray(e)?e:[e];this.committing=!0;try{return yield this.sync.enqueue(t,n||t.some(r=>He.has(r.type))),this.actions=We(this.actions,t),this.recalculate(),this.rebuildRosters(),this.applyTeamNames(),this.refreshBench(),!0}catch{return this.notify.openErrorModal("This action could not be saved on the device. Try again before play continues."),!1}finally{this.committing=!1}})}makeAction(e,n){return A({actionID:K(),seq:++this.seq,ts:Date.now(),clientID:this.clientID,type:e},n)}recalculate(){this.stats=Le(this.actions),this.lastPlay=Q(this.actions).filter(e=>Vt.has(e.type)&&e.person).at(-1),this.refreshBench()}refreshBench(){this.game&&(this.chips={away:Fe(this.game.awayTeam.roster,this.stats.away,this.game.disciplineWarnings),home:Fe(this.game.homeTeam.roster,this.stats.home,this.game.disciplineWarnings)})}rebuildRosters(){if(!this.game)return;let e=Q(this.actions),n=new Set(e.filter(t=>t.type==="ROSTER_REBIND"&&t.roster?.placeholderID).map(t=>t.roster.placeholderID));for(let t of this.sides){let r=new Map;for(let h of this.docRosters[t])r.set(ae(h),A({},h));for(let h of e){if(h.type!=="ROSTER_BIND"&&h.type!=="ROSTER_REBIND"||h.side!==t||!h.roster?.binding)continue;let y=h.roster.binding;if(h.type==="ROSTER_BIND"&&y.placeholderID&&n.has(y.placeholderID))continue;let T=ae(y);r.set(T,A(A({},r.get(T)??{}),y))}let p=this.teamOf(t).roster;for(let h=p.length-1;h>=0;h--)r.has(ae(p[h]))||p.splice(h,1);for(let[h,y]of r){let T=p.find(C=>ae(C)===h);T?Object.assign(T,y):p.push(y)}}this.adminPerson&&!this.adminPeople.includes(this.adminPerson)&&(this.adminPerson=void 0),this.playerSheet&&!this.teamOf(this.playerSheet.side)?.roster.includes(this.playerSheet.person)&&(this.playerSheet=void 0)}findOnRoster(e,n){return this.teamOf(e)?.roster.find(t=>ae(t)===ae(n))}applyTeamNames(){if(!this.game)return;let e=Et(this.actions);for(let n of this.sides){let t=this.teamOf(n),r=e[n]??this.docNames[n];t.name=r.name,t.shortName=r.shortName||Se(r.name)}}handleSyncResponse(e){e.reason&&(e.retryable||!e.finalized)&&(this.syncError=e.reason)}getClientID(){let e=localStorage.getItem(Wt);if(e)return e;let n=K();return localStorage.setItem(Wt,n),n}ngOnDestroy(){this.sheetRef?.dismiss(),this.endPeek(),this.resizeObserver?.disconnect(),typeof window<"u"&&window.removeEventListener("resize",this.onWindowResize),this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(n){return new(n||i)(J(ot),J(ye),J(ft),J(we),J(bt),J(Je))};static \u0275cmp=q({type:i,selectors:[["rp-scoring-basketball"]],viewQuery:function(n,t){if(n&1&&(E(En,5),E(Bn,5),E(Rn,5),E(In,5),E(Nn,5),E(Ln,5),E(Vn,5),E(Dn,5),E(An,5),E($n,5),E(Fn,5),E(zn,5),E(jn,5),E(Hn,5),E(Un,5),E(Wn,5),E(Kn,5)),n&2){let r;B(r=R())&&(t.stageRef=r.first),B(r=R())&&(t.hudRef=r.first),B(r=R())&&(t.moreTpl=r.first),B(r=R())&&(t.rostersTpl=r.first),B(r=R())&&(t.playerTpl=r.first),B(r=R())&&(t.tempPlayerTpl=r.first),B(r=R())&&(t.rosterSheetTpl=r.first),B(r=R())&&(t.teamRosterTpl=r.first),B(r=R())&&(t.teamNamesTpl=r.first),B(r=R())&&(t.adminTpl=r.first),B(r=R())&&(t.timeoutWarningTpl=r.first),B(r=R())&&(t.shotLocationTpl=r.first),B(r=R())&&(t.endPeriodTpl=r.first),B(r=R())&&(t.endReviewTpl=r.first),B(r=R())&&(t.playlogTpl=r.first),B(r=R())&&(t.boxscoreTpl=r.first),B(r=R())&&(t.claimTpl=r.first)}},hostBindings:function(n,t){n&1&&u("keydown.escape",function(){return t.onEscape()},Ye)},features:[et([we])],decls:36,vars:3,consts:[["bannersTpl",""],["moreTpl",""],["rostersTpl",""],["playerTpl",""],["playlogTpl",""],["boxscoreTpl",""],["endPeriodTpl",""],["t
2imeoutWarningTpl",""],["adminTpl",""],["shotLocationTpl",""],["endReviewTpl",""],["tempPlayerTpl",""],["rosterSheetTpl",""],["teamRosterTpl",""],["teamNamesTpl",""],["claimTpl",""],["stage",""],["hud",""],[1,"bk1-page"],[1,"bks-state"],[1,"bks-state","bks-state--error"],["mat-stroked-button","",3,"click"],[1,"bk1-static"],[1,"bks-setup"],[1,"bk1-ended"],[3,"syncTap","stats","awayName","homeName","period","started","ended","expanded","expandable","nameLimit","syncState","syncLabel","kindLabel","kindTone"],[4,"ngTemplateOutlet"],[1,"bks-eyebrow"],[1,"bks-choice"],["type","radio","name","profile","value","MYBA_2025_26_RUNNING",3,"ngModelChange","ngModel"],["type","radio","name","profile","value","MYBA_2025_26_STOP",3,"ngModelChange","ngModel"],[1,"bks-toggle"],["type","checkbox","name","shotLocation",3,"ngModelChange","ngModel"],[1,"bks-primary",3,"click","disabled"],[1,"bks-team-card"],["autocomplete","off",3,"ngModelChange","ngModel","name","maxlength","placeholder"],[1,"bks-chips"],[1,"bks-chip"],[1,"bks-hint"],[1,"bks-card-actions"],["type","button",1,"bks-small",3,"click"],["type","button",3,"click"],[1,"bks-final-actions"],[3,"click"],[3,"stats","awayName","homeName"],["type","button",1,"bks-secondary",3,"click"],[1,"bk1-stage"],["aria-hidden","true",1,"bk1-arena"],[1,"bk1-floor"],[1,"bk1-far"],[1,"bk1-cl","bk1-cl--side-l"],[1,"bk1-cl","bk1-cl--side-r"],[1,"bk1-basket"],[1,"bk1-cl","bk1-cl--arc"],[1,"bk1-cl","bk1-cl--key"],[1,"bk1-cl","bk1-cl--ft"],[1,"bk1-board"],[1,"bk1-hoop"],[1,"bk1-cl","bk1-cl--half"],[1,"bk1-disc"],["alt","","loading","lazy",3,"src"],[1,"bk1-sponsor"],[1,"bk1-ground"],["alt","",1,"bk1-art",3,"src","bk1-art--in"],[1,"bk1-hud"],[3,"undo","redo","toggle","syncTap","stats","awayName","homeName","period","started","ended","floating","expanded","nameLimit","canUndo","canRedo","undoLocked","syncState","syncLabel","kindLabel","kindTone"],["side","away",1,"bk1-bench","bk1-bench--away",3,"pick","longPress","add","timeout","header","shortName","chips","fouls","bonus","timeoutsLeft","hot"],[1,"bk1-playrow"],["aria-live","polite","aria-atomic","true"],[1,"bk1-chip-cap"],[1,"bk1-chip-who"],[1,"bk1-chip-what"],["type","button","aria-label","Cancel",1,"bk1-chip-x"],[1,"bk1-tray",3,"arm","more","armed"],["side","home",1,"bk1-bench","bk1-bench--home",3,"pick","longPress","add","timeout","header","shortName","chips","fouls","bonus","timeoutsLeft","hot"],["aria-label","Scoring",1,"bk1-bar"],["type","button",1,"bk1-bar-btn",3,"click"],["type","button",1,"bk1-bar-btn","bk1-bar-btn--e
2nd",3,"click"],["src","assets/logos/RPLogo4BKCourt.webp","alt","","loading","lazy"],["alt","",1,"bk1-art",3,"load","src"],["type","button","aria-label","Cancel",1,"bk1-chip-x",3,"click"],["role","status",3,"class"],["role","status"],["mat-stroked-button",""],["type","button","aria-label","Dismiss this notice",1,"bk1-banner-x",3,"click"],[1,"bk1-sheet-body"],["id","bks-more-title"],[1,"bks-segment"],[3,"is-active"],[1,"bks-more-grid"],[1,"bks-more-btn","is-red",3,"click"],[1,"bks-more-btn",3,"click"],[1,"bks-more-btn"],[1,"bks-quiet",3,"click"],["id","bks-rosters-title"],[1,"bks-roster-block",3,"is-current"],[1,"bks-roster-block"],[1,"bks-section-head"],[1,"bks-small",3,"click"],[1,"bks-roster-row"],[1,"bks-roster-name"],[1,"bks-small"],["id","bks-player-title"],[3,"class"],[1,"bks-secondary",3,"click"],[1,"bks-secondary"],["name","editedJersey","inputmode","numeric","maxlength","3",3,"ngModelChange","ngModel"],[1,"bks-person-list"],["id","bks-log-title"],[1,"bks-icon",3,"click","disabled"],[1,"bks-log-row"],[1,"bks-empty"],[1,"bks-log-period"],[1,"bks-log-copy"],[1,"bks-log-undo"],[1,"bks-log-undo",3,"click"],["id","bks-box-title"],["id","bks-end-period-title"],[1,"bks-primary",3,"click"],[1,"bks-secondary",3,"click","disabled"],[1,"bks-primary","bks-danger",3,"click","disabled"],[3,"is-selected"],["type","checkbox","name","technicalPersonal",3,"ngModelChange","ngModel"],["aria-label","Select shot location",1,"bks-court",3,"click"],[1,"bks-hoop"],[1,"bks-key"],[1,"bks-arc"],[1,"bks-notice","bks-notice--warning"],["role","group","aria-label","Outcome",1,"bks-segment"],["type","button",3,"is-active"],["name","endNote","rows","3","placeholder","Required for tied or incomplete games",3,"ngModelChange","ngModel"],["id","bks-temp-title"],["name","tempJersey","inputmode","numeric","maxlength","3",3,"ngModelChange","ngModel"],["name","tempName","maxlength","40",3,"ngModelChange","ngModel"],["id","bks-roster-sheet-title"],["name","rosterSheet","rows","9","autocomplete","off","placeholder",`4 Ava Stone 3#11 Bo Reyes 4Cam Okafor 523`,3,"ngModelChange","ngModel"],["role","alert",1,"bks-notice","bks-notice--error"],["id","bks-team-roster-title"],[1,"bks-notice","bks-notice--error"],["role","group","aria-label","Your basketball teams",1,"bks-team-chips"],["type","button",1,"bks-team-chip",3,"is-selected"],["type","button",1,"bks-team-chip",3,"click"],[1,"bks-pick-tools"],[1,"bks-pick-list"],[1,"bks-pick",3,"is-disabled"],[1,"bks-pick"],["type","checkbox",3,"change","checked","disabled"],["id","bks-team-names-title"],["autocomplete","off",3,"ngModelChange","ngModel","name","maxlength"],[1,"bks-claim-list"]],template:function(n,t){n&1&&(o(0,"main",18),g(1,ai,2,0,"div",19)(2,si,5,1,"div",20)(3,Si,4,2),a(),xe(4,Pi,2,0,"ng-template",null,0,D)(6,Ri,1,1,"ng-template",null,1,D)(8,$i,1,1,"ng-template",null,2,D)(10,qi,1,1,"ng-template",null,3,D)(12,eo,1,1,"ng-template",null,4,D)(14,no,1,1,"ng-template",null,5,D)(16,oo,1,1,"ng-template",null,6,D)(18,ao,1,1,"ng-template",null,7,D)(20,fo,1,1,"ng-template",null,8,D)(22,go,1,1,"ng-template",null,9,D)(24,So,1,1,"ng-template",null,10,D)(26,To,1,1,"ng-template",null,11,D)(28,Mo,1,1,"ng-template",null,12,D)(30,Wo,1,1,"ng-template",null,13,D)(32,qo,1,1,"ng-template",null,14,D)(34,er,1,1,"ng-template",null,15,D)),n&2&&(k("bk1-page--live",t.live),d(),x(t.loading?1:t.loadError?2:t.game?3:-1))},dependencies:[G,it,pt,at,rt,ct,st,dt,lt,_t,mt,ke,Ce,gt,Ct,Ft,Ht,Ut],styles:['[_ngcontent-%COMP%]:root{--rp-navy-900: #10243f;--rp-navy-800: #143b67;--rp-navy-700: #1a3668;--rp-navy-600: #244f7e;--rp-text: #122033;--rp-text-muted: #64798c;--rp-text-subtle: #667085;--rp-divider: #dce5ee;--rp-divider-soft: #e8edf3;--rp-border-control: #8792a5;--rp-surface: #ffffff;--rp-surface-tint: #f2f7fc;--rp-surface-head: #eef2f6;--rp-surface-sunken: #f7f9fc;--rp-ok-bg: #eaf6ea;--rp-ok-border: #7fb583;--rp-ok-fg: #2e7d32;--rp-warn-bg: #fff3e0;--rp-warn-border: #c9922f;--rp-warn-fg: #9a4a00;--rp-danger-bg: #ffebee;--rp-danger-border: #d97b7b;--rp-danger-fg: #c62828;--rp-info-bg: #eef2fb;--rp-info-border: #8fa6cf;--rp-info-fg: #244f7e;--rp-neutral-bg: #f1f3f6;--rp-neutral-border: #9aa4b2;--rp-neutral-fg: #5a6b7d;--rp-gold-bg: #fdf6e3;--rp-gold-ring: #d4a531;--rp-gold-fg: #6b4700;--rp-silver-bg: #f1f3f6;--rp-silver-ring: #9ba5b1;--rp-silver-fg: #48535f;--rp-bronze-bg: #f8ede6;--rp-bronze-ring: #c4855f;--rp-bronze-fg: #6e3b1d;--rp-focus-ring: #244f7e;--rp-radius-control: 6px;--rp-radius-card: 8px;--rp-radius-row: 10px;--rp-radius-panel: 16px;--rp-shadow-card: 0 1px 3px rgba(15, 31, 53, .05);
5--rp-shadow-panel: 0 1px 3px rgba(15, 31, 53, .04), 0 8px 32px rgba(15, 31, 53, .07)}[_nghost-%COMP%]{display:block;min-height:100dvh;background:#10243f;color:#122033}button[_ngcontent-%COMP%], input[_ngcontent-%COMP%], select[_ngcontent-%COMP%], textarea[_ngcontent-%COMP%]{font:inherit}button[_ngcontent-%COMP%]{touch-action:manipulation}.bk1-page[_ngcontent-%COMP%]{max-width:560px;min-height:100dvh;margin:0 auto;background:#f7f9fc;padding-bottom:24px;--mat-button-outlined-outline-color: var(--rp-navy-600)}.bk1-page--live[_ngcontent-%COMP%]{background:#10243f;padding-bottom:0;display:flex;flex-direction:column}@media(min-width:600px){.bk1-page--live[_ngcontent-%COMP%]{border-radius:16px;overflow:hidden;margin-top:8px;min-height:calc(100dvh - 16px)}}.bks-state[_ngcontent-%COMP%]{min-height:70dvh;display:grid;place-content:center;gap:16px;padding:24px;text-align:center;color:#64798c}.bks-state--error[_ngcontent-%COMP%]{color:#c62828}.bk1-static[_ngcontent-%COMP%]{padding:18px 8px 0;display:flex;flex-direction:column;gap:8px}.bk1-stage[_ngcontent-%COMP%]{position:relative;width:100%;min-height:420px;overflow:hidden;background:#10243f;-webkit-user-select:none;user-select:none;--bk1-hud-h: 107px;--bk1-tray-h: 214px;--bk1-court: 1}.bk1-arena[_ngcontent-%COMP%]{position:absolute;inset:0;z-index:0;overflow:hidden}.bk1-floor[_ngcontent-%COMP%]{position:absolute;inset:0;background:repeating-linear-gradient(90deg,#0000000d 0 9px,#0000 9px 18px),linear-gradient(to bottom,#a3743f,#c7955a 22%,#b7834b 55%,#8d6338)}.bk1-far[_ngcontent-%COMP%]{position:absolute;left:0;right:0;top:0;height:34%;background:linear-gradient(to bottom,#10243ff0,#10243fcc 30%,#10243f00)}.bk1-cl[_ngcontent-%COMP%]{position:absolute;border:2px solid rgba(255,255,255,.55)}.bk1-cl--side-l[_ngcontent-%COMP%]{left:15%;top:0;bottom:0;width:0;border-width:0 0 0 2px}.bk1-cl--side-r[_ngcontent-%COMP%]{right:15%;top:0;bottom:0;width:0;border-width:0 2px 0 0}.bk1-cl--key[_ngcontent-%COMP%]{left:50%;top:calc(var(--bk1-hud-h) + 20px);width:26%;height:140px;transform:translate(-50%);border-top:0}.bk1-cl--ft[_ngcontent-%COMP%]{left:50%;top:calc(var(--bk1-hud-h) + 160px);width:26%;height:60px;transform:translate(-50%);border-top:0;border-radius:0 0 200px 200px/0 0 120px 120px}.bk1-cl--arc[_ngcontent-%COMP%]{left:50%;top:calc(var(--bk1-hud-h) + 20px);width:70%;height:250px;transform:translate(-50%);border-top:0;border-radius:0 0 260px 260px/0 0 200px 200px}.bk1-hoop[_ngcontent-%COMP%]{position:absolute;left:50%;top:calc(var(--bk1-hud-h) + 34px);width:24px;height:24px;transform:translate(-50%);border:3px solid #d9541e;border-radius:50%}.bk1-basket[_ngcontent-%COMP%]{position:absolute;inset:0;transform:scale(var(--bk1-court));transform-origin:50% calc(var(--bk1-hud-h) + 20px)}.bk1-board[_ngcontent-%COMP%]{position:absolute;left:50%;top:calc(var(--bk1-hud-h) + 26px);width:15%;height:7px;transform:translate(-50%);border-radius:2px;background:#ffffffd9;box-shadow:0 2px 4px #0000004d}.bk1-cl--half[_ngcontent-%COMP%]{left:15%;right:15%;bottom:min(340px,100% - var(--bk1-hud-h) - 300px);height:0;border-width:2px 0 0 0}.bk1-disc[_ngcontent-%COMP%]{position:absolute;left:50%;bottom:min(285px,100% - var(--bk1-hud-h) - 390px);width:110px;height:110px;transform:translate(-50%);border-radius:50%;background:#fff;box-shadow:inset 0 0 0 1px #00000014;z-index:1;display:flex;align-items:center;justify-content:center}.bk1-disc[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:64%;height:64%;object-fit:contain}.bk1-sponsor[_ngcontent-%COMP%]{position:absolute;z-index:1;width:28px;height:120px;left:max(15% + 8px,70px);bottom:calc(min(285px,100% - var(--bk1-hud-h) - 390px) - 5px)}.bk1-sponsor[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{position:absolute;left:50%;top:50%;width:120px;height:auto;transform:translate(-50%,-50%) rotate(-90deg);filter:drop-shadow(1px 0 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 1px 0 #fff) drop-shadow(0 -1px 0 #fff)}.bk1-ground[_ngcontent-%COMP%]{position:absolute;left:0;right:0;bottom:0;height:55%;background:linear-gradient(to bottom,#10243f00,#10243f80 45%,#10243fd9)}.bk1-art[_ngcontent-%COMP%]{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center bottom;z-index:2;opacity:0;transition:opacity .2s ease-out}.bk1-art--in[_ngcontent-%COMP%]{opacity:1}@media(prefers-reduced-data:reduce){.bk1-art[_ngcontent-%COMP%]{display:none}}@media(prefers-reduced-motion:reduce){.bk1-art[_ngcontent-%COMP%]{transition:none}}.bk1-hud[_ngcontent-%COMP%]{position:absolute;z-index:4;
5left:8px;right:8px;top:14px;display:flex;flex-direction:column;gap:8px}.bk1-hud[_ngcontent-%COMP%] rp-basketball-scoreboard[_ngcontent-%COMP%]{display:block;width:100%}.bk1-banner[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;flex-wrap:wrap;border-radius:10px;padding:8px 10px;font-size:13px;box-shadow:0 4px 16px #0000004d;--mat-button-outlined-outline-color: var(--rp-navy-600)}.bk1-banner[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{flex:1 1 160px}.bk1-banner--warn[_ngcontent-%COMP%]{background:#fff3e0;color:#5d4037}.bk1-banner--error[_ngcontent-%COMP%]{background:#fdecea;color:#c62828}.bk1-banner--info[_ngcontent-%COMP%]{background:#eef2fb;color:#244f7e}.bk1-banner-x[_ngcontent-%COMP%]{width:32px;height:32px;border:none;border-radius:50%;background:#10243f14;color:inherit;font-size:18px;font-weight:800;cursor:pointer;display:inline-flex;align-items:center;justify-content:center}.bk1-banner-x[_ngcontent-%COMP%]:focus-visible{outline:2px solid #244f7e;outline-offset:2px}.bk1-bench[_ngcontent-%COMP%]{position:absolute;z-index:3;width:56px;top:calc(var(--bk1-hud-h) + 22px);bottom:8px}.bk1-bench--away[_ngcontent-%COMP%]{left:8px}.bk1-bench--home[_ngcontent-%COMP%]{right:8px}.bk1-playrow[_ngcontent-%COMP%]{position:absolute;z-index:3;left:70px;right:70px;bottom:calc(var(--bk1-tray-h, 214px) + 16px);display:flex;justify-content:center}.bk1-chip[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;height:40px;border:none;border-radius:999px;background:#ffffffeb;color:#10243f;box-shadow:0 2px 8px #00000040;white-space:nowrap;transition:background-color .12s ease-out,box-shadow .12s ease-out;gap:7px;padding:0 11px;max-width:100%;overflow:hidden}@media(prefers-reduced-motion:reduce){.bk1-chip[_ngcontent-%COMP%]{transition:none}}.bk1-chip[_ngcontent-%COMP%] .bk1-chip-cap[_ngcontent-%COMP%]{flex:0 0 auto;font-size:9px;font-weight:800;letter-spacing:.06em;color:#64798c}.bk1-chip[_ngcontent-%COMP%] .bk1-chip-who[_ngcontent-%COMP%]{flex:0 1 auto;min-width:0;font-size:14px;font-weight:800;overflow:hidden;text-overflow:ellipsis}.bk1-chip[_ngcontent-%COMP%] .bk1-chip-what[_ngcontent-%COMP%]{flex:0 0 auto;font-size:10px;font-weight:700;color:#64798c;font-variant-numeric:tabular-nums}.bk1-chip--idle[_ngcontent-%COMP%]{background:#ffffff24;color:#fff;border:1px dashed rgba(255,255,255,.5);box-shadow:none}.bk1-chip--idle[_ngcontent-%COMP%] .bk1-chip-cap[_ngcontent-%COMP%]{color:#ffffffb3}.bk1-chip--armed[_ngcontent-%COMP%]{box-shadow:0 0 0 3px #ffffff59,0 2px 8px #00000040}.bk1-chip--armed[_ngcontent-%COMP%] .bk1-chip-who[_ngcontent-%COMP%]{font-size:14px;font-weight:700}.bk1-chip--armed.bk1-chip--green[_ngcontent-%COMP%]{background:#c8e6c9;color:#1b5e20}.bk1-chip--armed.bk1-chip--green[_ngcontent-%COMP%] .bk1-chip-cap[_ngcontent-%COMP%]{color:#1b5e20;opacity:.8}.bk1-chip--armed.bk1-chip--red[_ngcontent-%COMP%]{background:#ffcdd2;color:#b71c1c}.bk1-chip--armed.bk1-chip--red[_ngcontent-%COMP%] .bk1-chip-cap[_ngcontent-%COMP%]{color:#b71c1c;opacity:.8}.bk1-chip-x[_ngcontent-%COMP%]{position:relative;flex:0 0 auto;margin-left:2px;width:22px;height:22px;border:none;border-radius:50%;background:#10243f1f;color:inherit;font-size:13px;font-weight:800;cursor:pointer;padding:0}.bk1-chip-x[_ngcontent-%COMP%]:before{content:"";position:absolute;inset:-11px}.bk1-chip-x[_ngcontent-%COMP%]:focus-visible{outline:2px solid #244f7e;outline-offset:2px}.bk1-tray[_ngcontent-%COMP%]{position:absolute;z-index:2;left:70px;right:70px;bottom:8px}.bk1-bar[_ngcontent-%COMP%]{position:sticky;bottom:0;z-index:5;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;padding:8px;background:#10243f;border-top:1px solid rgba(255,255,255,.12)}.bk1-bar-btn[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;border:1px solid rgba(255,255,255,.2);background:#ffffff14;border-radius:10px;padding:6px 4px;min-height:54px;font-size:11px;font-weight:700;color:#ffffffd9;cursor:pointer}.bk1-bar-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:22px;width:22px;height:22px}.bk1-bar-btn[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.bk1-bar-btn[_ngcontent-%COMP%]:active{background:#fff3}.bk1-bar-btn[_ngcontent-%COMP%]:disabled{opacity:.4}.bk1-bar-btn[_ngcontent-%COMP%]:focus{outline:none}.bk1-bar-btn[_ngcontent-%COMP%]:focus-visible{outline:2px solid #ffffff;outline-offset:-2px}.bk1-bar-btn--active[_ngcontent-%COMP%]{background:#ffffff38;border-color:#ffffff73;color:#fff}
5.bk1-bar-btn--end[_ngcontent-%COMP%]{background:#ff8a8024;border-color:#ff8a8073;color:#ff8a80}.bk1-ended[_ngcontent-%COMP%]{padding:12px;display:flex;flex-direction:column;gap:12px}.bks-notice[_ngcontent-%COMP%]{margin:10px 12px 0;border-left:4px solid #2e7d32;background:#eaf6ea;padding:10px 12px;display:flex;align-items:center;gap:9px;font-size:13px}.bks-notice[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{margin-left:auto;border:0;background:transparent;color:#143b67;font-weight:800}.bks-notice--warning[_ngcontent-%COMP%]{border-color:#d59b2b;background:#fff3e0}.bks-notice--error[_ngcontent-%COMP%]{border-color:#c62828;background:#ffebee}.bks-setup[_ngcontent-%COMP%]{padding:24px 20px 40px;max-width:560px;margin:0 auto}.bks-team-card[_ngcontent-%COMP%]{margin:14px 0;border:1px solid #dce5ee;border-radius:16px;background:#fff;padding:14px}.bks-team-card[_ngcontent-%COMP%] > label[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:5px;margin:8px 0;font-weight:750}.bks-team-card[_ngcontent-%COMP%] > label[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{color:#64798c;font-weight:500}.bks-team-card[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{min-height:44px;border:1px solid #8792a5;border-radius:8px;background:#fff;padding:9px 11px}.bks-chips[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:6px;margin:10px 0 4px}.bks-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;min-height:32px;border:1px solid #dce5ee;border-radius:999px;background:#f7f9fc;padding:2px 4px 2px 10px;font-size:13px;color:#122033}.bks-chip[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-variant-numeric:tabular-nums}.bks-chip[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border:0;border-radius:50%;background:transparent;color:#64798c;padding:0}.bks-chip[_ngcontent-%COMP%] button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px}.bks-chip[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover{background:#dce5ee}.bks-hint[_ngcontent-%COMP%]{margin:6px 0;color:#64798c;font-size:13px}.bks-hint--red[_ngcontent-%COMP%]{color:#c62828;font-weight:700}.bks-hint--amber[_ngcontent-%COMP%]{color:#9a4a00;font-weight:700}.bks-card-actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:4px;margin-top:4px}.bks-card-actions[_ngcontent-%COMP%] .bks-small[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:4px;min-height:40px;padding:6px 10px}.bks-team-chips[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0}.bks-team-chip[_ngcontent-%COMP%]{min-height:40px;border:1px solid #dce5ee;border-radius:999px;background:#fff;color:#122033;padding:6px 14px;font-weight:750}.bks-team-chip.is-selected[_ngcontent-%COMP%]{border-color:#244f7e;background:#eef2fb;box-shadow:inset 0 0 0 1px #244f7e}.bks-pick-tools[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;margin:10px 0 4px;color:#64798c;font-size:13px;font-weight:750}.bks-pick-tools[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{margin-right:auto}.bks-pick-list[_ngcontent-%COMP%]{display:grid;gap:6px;max-height:320px;overflow-y:auto}.bks-pick[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;min-height:44px;border:1px solid #dce5ee;border-radius:10px;background:#fff;padding:6px 10px;cursor:pointer}.bks-pick[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{width:20px;height:20px;margin:0;accent-color:#244f7e}.bks-pick[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{min-width:28px;font-variant-numeric:tabular-nums}.bks-pick[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{margin-left:auto;color:#64798c}.bks-pick.is-disabled[_ngcontent-%COMP%]{color:#64798c;background:#f7f9fc;cursor:default}code[_ngcontent-%COMP%]{border-radius:5px;background:#f1f3f6;color:#122033;padding:1px 5px;font-size:12px}.bk1-page[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:focus-visible, .bk1-page[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:focus-visible, .bk1-page[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]:focus-visible, .bk1-page[_ngcontent-%COMP%] select[_ngcontent-%COMP%]:focus-visible, .bk1-sheet-body[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:focus-visible, .bk1-sheet-body[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:focus-visible, .bk1-sheet-body[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]:focus-visible, .bk1-sheet-body[_ngcontent-%COMP%] select[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--rp-navy-600);outline-offset:2px}
5.bk1-page--live[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:focus-visible{outline-color:#fff}.bks-eyebrow[_ngcontent-%COMP%]{margin:0 0 4px;color:#64798c;font-size:11px;font-weight:900;letter-spacing:.14em;text-transform:uppercase}h1[_ngcontent-%COMP%], h2[_ngcontent-%COMP%], h3[_ngcontent-%COMP%], p[_ngcontent-%COMP%]{margin-top:0}h1[_ngcontent-%COMP%]{font-size:32px;letter-spacing:-.04em;margin-bottom:10px}h2[_ngcontent-%COMP%]{font-size:20px;margin-bottom:4px}h3[_ngcontent-%COMP%]{font-size:16px;margin:0}.bks-choice[_ngcontent-%COMP%], .bks-toggle[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px;margin:10px 0;border:1px solid #dce5ee;border-radius:16px;background:#fff;padding:14px;cursor:pointer}.bks-choice.is-selected[_ngcontent-%COMP%]{border-color:#244f7e;box-shadow:inset 0 0 0 1px #244f7e}.bks-choice[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .bks-toggle[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:flex;flex-direction:column}.bks-choice[_ngcontent-%COMP%] small[_ngcontent-%COMP%], .bks-toggle[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{color:#64798c;margin-top:2px}.bks-primary[_ngcontent-%COMP%], .bks-secondary[_ngcontent-%COMP%], .bks-quiet[_ngcontent-%COMP%]{width:100%;min-height:48px;border-radius:10px;font-weight:850;display:flex;align-items:center;justify-content:center;gap:6px}.bks-primary[_ngcontent-%COMP%]{margin-top:18px;border:0;background:#244f7e;color:#fff}.bks-primary[_ngcontent-%COMP%]:disabled{opacity:.45}.bks-secondary[_ngcontent-%COMP%]{margin-top:9px;border:1px solid #244f7e;background:#fff;color:#143b67}.bks-quiet[_ngcontent-%COMP%]{margin-top:7px;border:0;background:transparent;color:#64798c}.bks-danger[_ngcontent-%COMP%]{background:#b0213a}.bks-segment[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,1fr);gap:6px;margin-bottom:12px}.bks-segment[_ngcontent-%COMP%]:has(button:nth-child(3)){grid-template-columns:repeat(3,1fr)}.bks-segment[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{border:0;border-radius:8px;background:#f1f3f6;padding:10px;font-weight:800;color:#64798c}.bks-segment[_ngcontent-%COMP%] button.is-active[_ngcontent-%COMP%]{background:#244f7e;color:#fff}.bks-section-head[_ngcontent-%COMP%]{display:flex;align-items:flex-end;justify-content:space-between;margin:14px 0 8px}.bks-section-head[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0}.bks-small[_ngcontent-%COMP%]{border:0;background:transparent;color:#244f7e;font-weight:850;padding:8px}.bks-icon[_ngcontent-%COMP%]{display:inline-flex;flex-direction:column;align-items:center;border:0;background:transparent;color:#244f7e;font-size:10px}.bks-icon[_ngcontent-%COMP%]:disabled{opacity:.3}.bks-empty[_ngcontent-%COMP%]{grid-column:1/-1;padding:28px 14px;border:1px dashed #8792a5;border-radius:10px;color:#64798c;text-align:center}.bks-more-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin:4px 0 12px}.bks-more-btn[_ngcontent-%COMP%]{min-height:46px;border:1px solid #dce5ee;border-radius:10px;background:#f1f3f6;color:#122033;font-weight:800;font-size:13px;padding:6px 8px}.bks-more-btn.is-red[_ngcontent-%COMP%]{background:#ffebee;color:#b71c1c;border:2px solid #b0213a}.bks-roster-block[_ngcontent-%COMP%]{margin:4px 0 10px}.bks-roster-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:44px minmax(0,1fr) auto auto;align-items:center;gap:6px;min-height:46px;border-bottom:1px solid #e8edf3}.bks-roster-row[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-variant-numeric:tabular-nums;font-size:15px}.bks-roster-name[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-width:0;font-size:14px}.bks-roster-name[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{color:#64798c;font-size:11px}.bks-log-row[_ngcontent-%COMP%]{min-height:52px;display:flex;align-items:center;gap:8px;border-bottom:1px solid #e8edf3}.bks-log-period[_ngcontent-%COMP%]{width:30px;color:#64798c;font-size:11px;font-weight:800}.bks-log-copy[_ngcontent-%COMP%]{flex:1;font-size:13px}.bks-log-row[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{border:0;background:transparent;color:#244f7e;font-size:11px;font-weight:850}.bks-log-row[_ngcontent-%COMP%] .bks-log-undo[_ngcontent-%COMP%]{color:#c62828}.bks-final-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;border-radius:10px;background:#eaf6ea;padding:12px}.bks-final-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{border:0;background:transparent;color:#c62828;font-weight:850}.bk1-sheet-body[_ngcontent-%COMP%]{display:flex;flex-direction:column;color:#122033;padding:4px 6px 0;--mat-button-outlined-outline-color: var(--rp-navy-600)}.bk1-sheet-body[_ngcontent-%COMP%] > label[_ngcontent-%COMP%]:not(.bks-toggle){display:flex;flex-direction:column;gap:5px;margin:12px 0;font-weight:750}.bk1-sheet-body[_ngcontent-%COMP%] input[_ngcontent-%COMP%], .bk1-sheet-body[_ngcontent-%COMP%] select[_ngcontent-%COMP%], .bk1-sheet-body[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{border:1px solid #8792a5;border-radius:8px;background:#fff;padding:11px}.bks-person-list[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(3,1fr);gap:7px;max-height:260px;overflow-y:auto;margin:10px 0}.bks-person-list[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{min-height:72px;border:1px solid #dce5ee;border-radius:10px;background:#fff;color:#122033;padding:7px;display:flex;flex-direction:column;align-items:center;justify-content:center}.bks-person-list[_ngcontent-%COMP%] button[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-size:22px;line-height:1}.bks-person-list[_ngcontent-%COMP%] button[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{max-width:100%;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bks-person-list[_ngcontent-%COMP%] button.is-selected[_ngcontent-%COMP%]{border-color:#244f7e;background:#eef2fb;box-shadow:inset 0 0 0 1px #244f7e}@media(max-width:400px),(max-height:720px){.bks-person-list[_ngcontent-%COMP%]{gap:5px;max-height:200px}.bks-person-list[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{min-height:54px;padding:4px}.bks-person-list[_ngcontent-%COMP%] button[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-size:17px}.bks-person-list[_ngcontent-%COMP%] button[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:10px}}.bks-claim-list[_ngcontent-%COMP%]{display:grid;gap:8px}.bks-claim-list[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{border:1px solid #dce5ee;border-radius:10px;background:#fff;padding:12px;display:flex;flex-direction:column;text-align:left}.bks-claim-list[_ngcontent-%COMP%] button[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#64798c;font-size:11px}.bks-court[_ngcontent-%COMP%]{position:relative;width:100%;aspect-ratio:1.55;overflow:hidden;border:3px solid #244f7e;border-radius:10px;background:#d7ad73}.bks-hoop[_ngcontent-%COMP%]{position:absolute;top:12%;left:50%;width:26px;height:26px;border:3px solid #d9541e;border-radius:50%;transform:translate(-50%)}.bks-key[_ngcontent-%COMP%]{position:absolute;top:0;left:50%;width:34%;height:55%;border:3px solid rgba(255,255,255,.5333333333);transform:translate(-50%)}.bks-arc[_ngcontent-%COMP%]{position:absolute;top:25%;left:50%;width:70%;height:85%;border:3px solid rgba(255,255,255,.5333333333);border-radius:50%;transform:translate(-50%)}']})}return i})();function We(i,s){let e=new Map(i.map(n=>[n.actionID,n]));
5return s.forEach(n=>e.set(n.actionID,n)),[...e.values()].sort((n,t)=>n.seq-t.seq||n.ts-t.ts||n.actionID.localeCompare(t.actionID))}function mr(i){return Q(i).filter(e=>e.type==="PERIOD_START").at(-1)?.period||"H1"}function Qt(i){return Math.max(0,Math.min(1,i))}function Ke(){return{away:{name:"",shortName:""},home:{name:"",shortName:""}}}function ae(i){return i.ptKey||i.playerID||i.personID||i.placeholderID||""}function Te(i,s){if(i.name===s.name&&i.shortName===s.shortName)return{name:i.name,shortName:""};let e=Se(i.name);return{name:i.name,shortName:i.shortName&&i.shortName!==e?i.shortName:""}}export{pr as BASKETBALL_ART_URL,Pa as ScoringBasketballComponent};
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.