1import{w as Le,r as I,b as je,ab as pe,C as v,D as _,E as e,G as K,N as r,z as $e,dP as ze,F as ie,u as l,ag as q,aa as ne,H as U,aA as ue,J as Q,j as A,a7 as Ue,a8 as qe,a9 as Ye,n as Qe,a1 as Be,O as we,dF as Ze,f as Je,bq as et,c7 as tt,Q as ot,I as Re,dQ as lt,c4 as st,bs as at}from"./index-CUDJvzyL.js";const nt=640,it=(d,a,t)=>d<=0?null:d<=nt?t:a,Ne=d=>{const a=I(!1),t=I(!1);return Le(d,k=>{t.value||k===null||k===void 0||(a.value=k==="vertical",t.value=!0)},{immediate:!0}),{isRotated:a,toggleRotation:()=>{a.value=!a.value,t.value=!0}}},Fe=d=>{const{t:a,te:t}=je();return{tSport:k=>{const S=`shot_plot.${d}.${k}`;return t(S)?a(S):a(`shot_plot.${k}`)}}},Se=10,ye=4,Xe=d=>{const{cursorX:a,cursorY:t,containerWidth:T,containerHeight:k,tooltipWidth:S,tooltipHeight:H,viewportWidth:x,wrapperOffsetLeft:i=0}=d,c=a+Se,Y=c+S+ye<=T;let C=c;if(!Y){const N=T+ye;C=x!=null&&i+N+S>x-ye?a-S-Se:N}C=Math.max(ye,C);const D=Math.min(Math.max(t-Se,ye),Math.max(k-H-ye,ye));return{x:C,y:D}},rt={class:"shot-plot-toolbar"},ct=["aria-pressed","aria-label"],ut={viewBox:"0 0 28 20",width:"20",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},dt=pe({__name:"ShotPlotRotateButton",props:{isRotated:{type:Boolean}},emits:["toggle"],setup(d){return(a,t)=>(v(),_("div",rt,[e("button",{type:"button",class:"shot-plot-rotate-btn","aria-pressed":d.isRotated,"aria-label":a.$t("shot_plot.rotate_view"),onClick:t[0]||(t[0]=T=>a.$emit("toggle"))},[(v(),_("svg",ut,[d.isRotated?(v(),_(K,{key:0},[t[1]||(t[1]=e("rect",{x:"1",y:"2",width:"6",height:"16",rx:"1.5"},null,-1)),t[2]||(t[2]=e("path",{d:"M9 10h4"},null,-1)),t[3]||(t[3]=e("path",{d:"M11.5 7.5l2.5 2.5-2.5 2.5"},null,-1)),t[4]||(t[4]=e("rect",{x:"15",y:"6",width:"12",height:"8",rx:"1.5"},null,-1))],64)):(v(),_(K,{key:1},[t[5]||(t[5]=e("rect",{x:"1",y:"6",width:"12",height:"8",rx:"1.5"},null,-1)),t[6]||(t[6]=e("path",{d:"M15 10h4"},null,-1)),t[7]||(t[7]=e("path",{d:"M17.5 7.5l2.5 2.5-2.5 2.5"},null,-1)),t[8]||(t[8]=e("rect",{x:"21",y:"2",width:"6",height:"16",rx:"1.5"},null,-1))],64))])),e("span",null,r(a.$t("shot_plot.rotate_view")),1)],8,ct)]))}}),Ve=$e(dt,[["__scopeId","data-v-5f145e6f"]]),ht={class:"w-full"},pt=["viewBox","aria-label"],yt=["transform"],vt=["clip-path"],mt={opacity:"0.45"},gt=["y2"],_t=["x1","x2","y2"],$t=["x1","x2","y2"],ft=["cx","cy"],wt=["x1","y1","x2","y2"],bt=["x1","y1","x2","y2"],kt=["cx","cy"],xt=["cx","cy"],Ct=["x1","y1","x2","y2"],Lt=["x1","y1","x2","y2"],St=["cx","cy"],Mt=["cx","cy"],Tt=["cx","cy"],Rt=["x1","y1","y2"],Pt=["x1","y1","y2"],Ot=["x1","y1","x2","y2"],Ht=["x1","y1","x2","y2"],At=["x1","x2","y2"],Yt=["d"],Bt=["x","y"],Nt=["x1","x2","y2"],Ft=["d"],Xt=["x","y"],Vt=["d"],Et=["transform"],It=["x","y","fill"],Kt=["transform"],Dt=["x","y","fill"],Wt=["x1","y1","x2","y2","stroke"],Gt=["x1","y1","x2","y2","stroke"],jt=["cx","cy","aria-label","onMouseenter","onFocus","onClick"],zt=["x","y","fill"],Ut=["cx","cy","aria-label","onMouseenter","onFocus","onClick"],qt=["points","fill"],Qt=["cx","cy","aria-label","onMouseenter","onFocus","onClick"],Zt=["cx","cy","fill"],Jt=["cx","cy","aria-label","onMouseenter","onFocus","onClick"],eo=["cx","cy","fill","aria-label","onMouseenter","onFocus","onClick"],to=["transform"],oo=["x","y"],lo={class:"font-semibold"},so={class:"text-[#bcd] text-[10px]"},ao={class:"text-[#99aacc] text-[10px]"}
1,ge=620,E=20,z="#f1563f",be="#0044bb",no=155,io=100,ro=pe({__name:"HockeyRinkSvg",props:{homeCode:{},awayCode:{},homeColor:{},awayColor:{},shots:{},defaultOrientation:{}},setup(d){const a=`rink-clip-${ze()}`,t=d,{isRotated:T,toggleRotation:k}=Ne(A(()=>t.defaultOrientation)),S=A(()=>{const O={goal:[],on_goal:[],blocked:[],wide:[],post:[]};for(const b of t.shots)O[b.outcome].push(b);return O}),H=(ge-2*E)/60,x=60*H,i=30*H,c=i+2*E,Y=E+x/2,C=E+i/2,D=A(()=>T.value?`translate(0, ${ge}) rotate(-90)`:""),N=O=>E+O/60*x,L=O=>E+O/30*i,$=N(4),g=N(56),B=N(22.5),W=N(37.5),ee=N(24),te=N(36),F=8.5*H,Z=4.5*H,X=4.5*H,n=X*.35,s=1.83*H,h=.76*H,M=L(13.775),le=L(16.225),se=1.36*H,ae=1.83*H,de=[{cx:N(50),cy:L(8)},{cx:N(50),cy:L(22)}],re=[{cx:N(10),cy:L(8)},{cx:N(10),cy:L(22)}],P=[L(8),L(22)],f=I(null),p=I({x:0,y:0}),V=I(null),u=()=>{var O;return((O=V.value)==null?void 0:O.getBoundingClientRect())??null},y=(O,b,o)=>Xe({cursorX:O,cursorY:b,containerWidth:o.width,containerHeight:o.height,tooltipWidth:no,tooltipHeight:io,viewportWidth:window.innerWidth,wrapperOffsetLeft:o.left}),m=(O,b)=>{const o=u();o&&(f.value=O,p.value=y(b.clientX-o.left,b.clientY-o.top,o))},R=O=>{if(!f.value)return;const b=u();b&&(p.value=y(O.clientX-b.left,O.clientY-b.top,b))},G=(O,b)=>{const o=b.currentTarget,J=u();if(!J)return;const w=o.getBoundingClientRect();f.value=O,p.value=y(w.left+w.width/2-J.left,w.top-J.top,J)};return(O,b)=>(v(),_("div",ht,[ie(Ve,{"is-rotated":l(T),onToggle:l(k)},null,8,["is-rotated","onToggle"]),e("div",{ref_key:"wrapperRef",ref:V,class:"relative w-full"},[(v(),_("svg",{viewBox:l(T)?`0 0 ${c} ${ge}`:`0 0 ${ge} ${c}`,class:ne(l(T)?"block mx-auto max-h-[82vh] w-auto":"block w-full"),style:q({aspectRatio:l(T)?`${c} / ${ge}`:`${ge} / ${c}`}),role:"group","aria-label":O.$t("shot_plot.hockey.rink_aria"),onMouseleave:b[15]||(b[15]=o=>f.value=null),onFocusout:b[16]||(b[16]=o=>f.value=null),onClick:b[17]||(b[17]=o=>f.value=null)},[e("defs",null,[e("clipPath",{id:a},[e("rect",{x:E,y:E,width:x,height:i,rx:F,ry:F})])]),e("g",{transform:D.value},[e("rect",{x:E,y:E,width:x,height:i,rx:F,ry:F,fill:"#e8f4fb"}),e("rect",{x:E,y:E,width:x,height:i,rx:F,ry:F,fill:"none",stroke:"#7ab3d4","stroke-width":"4"}),e("g",{"clip-path":`url(#${a})`},[e("g",mt,[e("line",{x1:Y,y1:E,x2:Y,y2:E+i,stroke:z,"stroke-width":"4"},null,8,gt),e("circle",{cx:Y,cy:C,r:Z,fill:"none",stroke:be,"stroke-width":"2"}),e("circle",{cx:Y,cy:C,r:"4",fill:be}),e("line",{x1:l(W),y1:E,x2:l(W),y2:E+i,stroke:be,"stroke-width":"4"},null,8,_t),e("line",{x1:l(B),y1:E,x2:l(B),y2:E+i,stroke:be,"stroke-width":"4"},null,8,$t),(v(),_(K,null,U(de,o=>e("g",{key:`for-${o.cy}`},[e("circle",{cx:o.cx,cy:o.cy,r:X,fill:"none",stroke:z,"stroke-width":"2"},null,8,ft),e("line",{x1:o.cx-n,y1:o.cy-X,x2:o.cx+n,y2:o.cy-X,stroke:z,"stroke-width":"2"},null,8,wt),e("line",{x1:o.cx-n,y1:o.cy+X,x2:o.cx+n,y2:o.cy+X,stroke:z,"stroke-width":"2"},null,8,bt),e("circle",{cx:o.cx,cy:o.cy,r:"4",fill:z},null,8,kt)])),64)),(v(),_(K,null,U(re,o=>e("g",{key:`fol-${o.cy}`},[e("circle",{cx:o.cx,cy:o.cy,r:X,fill:"none",stroke:z,"stroke-width":"2"},null,8,xt),e("line",{x1:o.cx-n,y1:o.cy-X,x2:o.cx+n,y2:o.cy-X,stroke:z,"stroke-width":"2"},null,8,Ct),e("line",{x1:o.cx-n,y1:o.cy+X,x2:o.cx+n,y2:o.cy+X,stroke:z,"stroke-width":"2"},null,8,Lt),e("circle",{cx:o.cx,cy:o.cy,r:"4",fill:z},null,8,St)])),64)),(v(),_(K,null,U(P,o=>e("circle",{key:`nzr-${o}`,cx:l(te),cy:o,r:"4",fill:z},null,8,Mt)),64)),(v(),_(K,null,U(P,o=>e("circle",{key:`nzl-${o}`,cx:l(ee),cy:o,r:"4",fill:z},null,8,Tt)),64)),e("line",{x1:l($),y1:L(11.6),x2:E,y2:L(10.7),stroke:z,"stroke-width":"2"},null,8,Rt),e("line",{x1:l($),y1:L(18.54),x2:E,y2:L(19.3),stroke:z,"stroke-width":"2"},null,8,Pt),e("line",{x1:l(g),y1:L(11.6),x2:E+x,y2:L(10.7),stroke:z,"stroke-width":"2"},null,8,Ot),e("line",{x1:l(g),y1:L(18.54),x2:E+x,y2:L(19.3),stroke:z,"stroke-width":"2"},null,8,Ht),e("line",{x1:l(g),y1:E,x2:l(g),y2:E+i,stroke:z,"stroke-width":"3"},null,8,At),e("path",{d:`M ${l(g)} ${l(M)} L ${l(g)-se} ${l(M)} A ${ae} ${ae} 0 0 0 ${l(g)-se} ${l(le)} L ${l(g)} ${l(le)} Z`,fill:"#bce4ea","fill-opacity":"0.7",stroke:z,"stroke-width":"1.5"}
1,null,8,Yt),e("rect",{x:l(g),y:C-s/2,width:h,height:s,fill:"#dce8f0",stroke:"#444","stroke-width":"2"},null,8,Bt),e("line",{x1:l($),y1:E,x2:l($),y2:E+i,stroke:z,"stroke-width":"3"},null,8,Nt),e("path",{d:`M ${l($)} ${l(M)} L ${l($)+se} ${l(M)} A ${ae} ${ae} 0 0 1 ${l($)+se} ${l(le)} L ${l($)} ${l(le)} Z`,fill:"#bce4ea","fill-opacity":"0.7",stroke:z,"stroke-width":"1.5"},null,8,Ft),e("rect",{x:l($)-h,y:C-s/2,width:h,height:s,fill:"#dce8f0",stroke:"#444","stroke-width":"2"},null,8,Xt),e("path",{d:`M ${N(27)} ${E+i} A ${3*H} ${3*H} 0 0 0 ${N(33)} ${E+i}`,fill:"none",stroke:z,"stroke-width":"2"},null,8,Vt)]),e("g",{transform:l(T)?`rotate(90 ${l(g)+h+8} ${C+4})`:void 0},[e("text",{x:l(g)+h+8,y:C+4,"text-anchor":"start","font-size":"11","font-weight":"bold",fill:t.homeColor},r(t.homeCode),9,It)],8,Et),e("g",{transform:l(T)?`rotate(90 ${l($)-h-8} ${C+4})`:void 0},[e("text",{x:l($)-h-8,y:C+4,"text-anchor":"end","font-size":"11","font-weight":"bold",fill:t.awayColor},r(t.awayCode),9,Dt)],8,Kt),(v(!0),_(K,null,U(S.value.wide,(o,J)=>(v(),_("g",{key:`wide${J}`},[e("line",{x1:o.svgX-5,y1:o.svgY-5,x2:o.svgX+5,y2:o.svgY+5,stroke:o.isHome?t.homeColor:t.awayColor,"stroke-width":"2.5","stroke-linecap":"round","stroke-opacity":"0.78"},null,8,Wt),e("line",{x1:o.svgX+5,y1:o.svgY-5,x2:o.svgX-5,y2:o.svgY+5,stroke:o.isHome?t.homeColor:t.awayColor,"stroke-width":"2.5","stroke-linecap":"round","stroke-opacity":"0.78"},null,8,Gt),e("circle",{cx:o.svgX,cy:o.svgY,r:"9",fill:"transparent",class:"cursor-pointer transition-opacity duration-100 hover:opacity-85 hover:drop-shadow-[0_0_4px_rgba(0,0,0,0.5)]",tabindex:"0",role:"button","aria-label":`${o.isHome?t.homeCode:t.awayCode} - ${o.player||O.$t("shot_plot.unknown_player")} - ${O.$t("shot_plot.hockey.wide")} - ${O.$t("shot_plot.period_abbr")}${o.period} ${o.time}'`,onMouseenter:w=>m(o,w),onMousemove:b[0]||(b[0]=w=>R(w)),onMouseleave:b[1]||(b[1]=w=>f.value=null),onFocus:w=>G(o,w),onBlur:b[2]||(b[2]=w=>f.value=null),onClick:ue(w=>m(o,w),["stop"])},null,40,jt)]))),128)),(v(!0),_(K,null,U(S.value.blocked,(o,J)=>(v(),_("g",{key:`blk${J}`,class:"group"},[e("rect",{x:o.svgX-5,y:o.svgY-5,width:"10",height:"10",fill:o.isHome?t.homeColor:t.awayColor,"fill-opacity":"0.82",stroke:"white","stroke-width":"1.5",class:"transition-opacity duration-100 group-hover:opacity-85 group-hover:drop-shadow-[0_0_4px_rgba(0,0,0,0.5)]",style:{"pointer-events":"none"}},null,8,zt),e("circle",{cx:o.svgX,cy:o.svgY,r:"9",fill:"transparent",class:"cursor-pointer",tabindex:"0",role:"button","aria-label":`${o.isHome?t.homeCode:t.awayCode} - ${o.player||O.$t("shot_plot.unknown_player")} - ${O.$t("shot_plot.hockey.blocked")} - ${O.$t("shot_plot.period_abbr")}${o.period} ${o.time}'`,onMouseenter:w=>m(o,w),onMousemove:b[3]||(b[3]=w=>R(w)),onMouseleave:b[4]||(b[4]=w=>f.value=null),onFocus:w=>G(o,w),onBlur:b[5]||(b[5]=w=>f.value=null),onClick:ue(w=>m(o,w),["stop"])},null,40,Ut)]))),128)),(v(!0),_(K,null,U(S.value.post,(o,J)=>(v(),_("g",{key:`post${J}`,class:"group"},[e("polygon",{points:`${o.svgX},${o.svgY-6} ${o.svgX+6},${o.svgY+5} ${o.svgX-6},${o.svgY+5}`,fill:o.isHome?t.homeColor:t.awayColor,"fill-opacity":"0.82",stroke:"white","stroke-width":"1.5",class:"transition-opacity duration-100 group-hover:opacity-85 group-hover:drop-shadow-[0_0_4px_rgba(0,0,0,0.5)]",style:{"pointer-events":"none"}},null,8,qt),e("circle",{cx:o.svgX,cy:o.svgY,r:"9",fill:"transparent",class:"cursor-pointer",tabindex:"0",role:"button","aria-label":`${o.isHome?t.homeCode:t.awayCode} - ${o.player||O.$t("shot_plot.unknown_player")} - ${O.$t("shot_plot.hockey.post")} - ${O.$t("shot_plot.period_abbr")}${o.period} ${o.time}'`,onMouseenter:w=>m(o,w),onMousemove:b[6]||(b[6]=w=>R(w)),onMouseleave:b[7]||(b[7]=w=>f.value=null),onFocus:w=>G(o,w),onBlur:b[8]||(b[8]=w=>f.value=null),onClick:ue(w=>m(o,w),["stop"])},null,40,Qt)]))),128)),(v(!0),_(K,null,U(S.value.on_goal,(o,J)=>(v(),_("g",{key:`og${J}`,class:"group"},[e("circle",{cx:o.svgX,cy:o.svgY,r:"5",fill:o.isHome?t.homeColor:t.awayColor,"fill-opacity":"0.85",stroke:"white","stroke-width":"1.5",class:"transition-opacity duration-100 group-hover:opacity-85 group-hover:drop-shadow-[0_0_4px_rgba(0,0,0,0.5)]",style:{"pointer-events":"none"}},null,8,Zt),e("circle",{cx:o.svgX,cy:o.svgY,r:"9",fill:"transparent",class:"cursor-pointer",tabindex:"0",role:"button","aria-label":`${o.isHome?t.homeCode:t.awayCode} - ${o.player||O.$t("shot_plot.unknown_player")}
1 - ${O.$t("shot_plot.hockey.on_goal")} - ${O.$t("shot_plot.period_abbr")}${o.period} ${o.time}'`,onMouseenter:w=>m(o,w),onMousemove:b[9]||(b[9]=w=>R(w)),onMouseleave:b[10]||(b[10]=w=>f.value=null),onFocus:w=>G(o,w),onBlur:b[11]||(b[11]=w=>f.value=null),onClick:ue(w=>m(o,w),["stop"])},null,40,Jt)]))),128)),(v(!0),_(K,null,U(S.value.goal,(o,J)=>(v(),_("g",{key:`goal${J}`},[e("circle",{cx:o.svgX,cy:o.svgY,r:"9",fill:o.isHome?t.homeColor:t.awayColor,stroke:"white","stroke-width":"2",class:"cursor-pointer transition-opacity duration-100 hover:opacity-85 hover:drop-shadow-[0_0_4px_rgba(0,0,0,0.5)] drop-shadow-[0_1px_3px_rgba(0,0,0,0.4)]",tabindex:"0",role:"button","aria-label":`${o.isHome?t.homeCode:t.awayCode} - ${o.player||O.$t("shot_plot.unknown_player")} - ${O.$t("shot_plot.hockey.goal")} ${o.homeScore}-${o.awayScore} - ${O.$t("shot_plot.period_abbr")}${o.period} ${o.time}'`,onMouseenter:w=>m(o,w),onMousemove:b[12]||(b[12]=w=>R(w)),onMouseleave:b[13]||(b[13]=w=>f.value=null),onFocus:w=>G(o,w),onBlur:b[14]||(b[14]=w=>f.value=null),onClick:ue(w=>m(o,w),["stop"])},null,40,eo),e("g",{transform:l(T)?`rotate(90 ${o.svgX} ${o.svgY})`:void 0},[e("text",{x:o.svgX,y:o.svgY,dy:"0.35em","text-anchor":"middle","font-size":"8","font-weight":"bold",fill:"white",style:{"pointer-events":"none"}},"G",8,oo)],8,to)]))),128))],8,vt)],8,yt)],46,pt)),f.value?(v(),_("div",{key:0,class:"pointer-events-none absolute z-10 max-w-[155px] bg-[rgba(15,15,25,0.93)] rounded-lg py-2 px-2.5 text-white text-[11px] leading-[1.55] break-words shadow-[0_4px_14px_rgba(0,0,0,0.4)]",style:q({left:`${p.value.x}px`,top:`${p.value.y}px`})},[e("div",{class:"font-bold text-xs uppercase",style:q({color:f.value.isHome?t.homeColor:t.awayColor})},r(f.value.isHome?t.homeCode:t.awayCode),5),e("div",lo,r(f.value.player||O.$t("shot_plot.unknown_player")),1),e("div",so,r(O.$t(`shot_plot.hockey.${f.value.outcome}`)),1),e("div",ao,r(O.$t("shot_plot.period_abbr"))+r(f.value.period)+" · "+r(f.value.time)+"' ",1)],4)):Q("",!0)],512)]))}}),co=["id","aria-expanded","aria-label"],uo={class:"player-select-label"},ho={key:0,class:"player-dropdown"},po={class:"player-search-wrap"},yo=["placeholder","aria-controls"],vo=["id"],mo=["aria-selected"],go={class:"player-group-header"},_o=["src"],$o=["aria-selected","onClick"],fo={class:"player-group-header"},wo=["src"],bo=["aria-selected","onClick"],ko={key:2,class:"player-no-results"},xo=pe({__name:"ShotPlotPlayerSelect",props:{id:{},ariaLabel:{},modelValue:{},allPlayersLabel:{},searchPlaceholder:{},noResultsLabel:{},homeCode:{},awayCode:{},homeLogo:{},awayLogo:{},homeOptions:{},awayOptions:{}},emits:["update:modelValue"],setup(d,{emit:a}){const t=d,T=a,k=I(!1),S=I(null),H=I(null),x=I(""),i=A(()=>[...t.homeOptions,...t.awayOptions]),c=A(()=>{if(t.modelValue==="all")return t.allPlayersLabel;const $=i.value.find(g=>g.value===t.modelValue);return($==null?void 0:$.label)??t.modelValue}),Y=($,g)=>$.label.toLowerCase().includes(g),C=A(()=>{const $=x.value.trim().toLowerCase();return $?t.homeOptions.filter(g=>Y(g,$)):t.homeOptions}),D=A(()=>{const $=x.value.trim().toLowerCase();return $?t.awayOptions.filter(g=>Y(g,$)):t.awayOptions}),N=$=>{T("update:modelValue",$),k.value=!1},L=$=>{var B;const g=$.relatedTarget;(!g||!((B=S.value)!=null&&B.contains(g)))&&(k.value=!1)};return Le(k,async $=>{var g;$&&(x.value="",await Qe(),(g=H.value)==null||g.focus())}),($,g)=>(v(),_("div",{ref_key:"wrapperRef",ref:S,class:"relative",onFocusout:L},[e("button",{id:d.id,type:"button",class:"player-select-btn","aria-expanded":k.value,"aria-label":d.ariaLabel,"aria-haspopup":"listbox",onClick:g[0]||(g[0]=B=>k.value=!k.value)},[e("span",uo,r(c.value),1),g[7]||(g[7]=e("svg",{class:"shrink-0 ml-1 opacity-50",width:"10",height:"6",viewBox:"0 0 10 6","aria-hidden":"true"}
1,[e("path",{d:"M0 0l5 6 5-6z",fill:"currentColor"})],-1))],8,co),k.value?(v(),_("div",ho,[e("div",po,[g[8]||(g[8]=e("svg",{class:"player-search-icon",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","aria-hidden":"true"},[e("circle",{cx:"8.5",cy:"8.5",r:"6"}),e("line",{x1:"13",y1:"13",x2:"17",y2:"17"})],-1)),Ue(e("input",{ref_key:"searchInputRef",ref:H,"onUpdate:modelValue":g[1]||(g[1]=B=>x.value=B),type:"text",class:"player-search-input",placeholder:d.searchPlaceholder,role:"combobox","aria-controls":`${d.id}-listbox`,"aria-expanded":"true","aria-autocomplete":"list",onKeydown:g[2]||(g[2]=Ye(B=>k.value=!1,["esc"]))},null,40,yo),[[qe,x.value]])]),e("div",{id:`${d.id}-listbox`,role:"listbox"},[e("button",{class:ne(["player-option",{selected:d.modelValue==="all"}]),type:"button",role:"option","aria-selected":d.modelValue==="all",onMousedown:g[3]||(g[3]=ue(()=>{},["prevent"])),onClick:g[4]||(g[4]=B=>N("all"))},r(d.allPlayersLabel),43,mo),C.value.length?(v(),_(K,{key:0},[e("div",go,[d.homeLogo?(v(),_("img",{key:0,src:d.homeLogo,class:"w-4 h-4 object-contain shrink-0 rounded-sm",alt:""},null,8,_o)):Q("",!0),e("span",null,r(d.homeCode),1)]),(v(!0),_(K,null,U(C.value,B=>(v(),_("button",{key:B.value,class:ne(["player-option pl-3",{selected:d.modelValue===B.value}]),type:"button",role:"option","aria-selected":d.modelValue===B.value,onMousedown:g[5]||(g[5]=ue(()=>{},["prevent"])),onClick:W=>N(B.value)},r(B.label),43,$o))),128))],64)):Q("",!0),D.value.length?(v(),_(K,{key:1},[e("div",fo,[d.awayLogo?(v(),_("img",{key:0,src:d.awayLogo,class:"w-4 h-4 object-contain shrink-0 rounded-sm",alt:""},null,8,wo)):Q("",!0),e("span",null,r(d.awayCode),1)]),(v(!0),_(K,null,U(D.value,B=>(v(),_("button",{key:B.value,class:ne(["player-option pl-3",{selected:d.modelValue===B.value}]),type:"button",role:"option","aria-selected":d.modelValue===B.value,onMousedown:g[6]||(g[6]=ue(()=>{},["prevent"])),onClick:W=>N(B.value)},r(B.label),43,bo))),128))],64)):Q("",!0),x.value&&!C.value.length&&!D.value.length?(v(),_("p",ko,r(d.noResultsLabel),1)):Q("",!0)],8,vo)])):Q("",!0)],544))}}),Ee=$e(xo,[["__scopeId","data-v-2e7a91e1"]]),Co=["id","aria-expanded","aria-label","aria-controls"],Lo={class:"filter-select-label"},So=["id"],Mo=["aria-selected","onClick"],To=pe({__name:"ShotPlotFilterSelect",props:{id:{},ariaLabel:{},modelValue:{},options:{}},emits:["update:modelValue"],setup(d,{emit:a}){const t=d,T=a,k=I(!1),S=I(null),H=A(()=>{const c=t.options.find(Y=>Y.value===t.modelValue);return(c==null?void 0:c.label)??String(t.modelValue)}),x=c=>{T("update:modelValue",c),k.value=!1},i=c=>{var C;const Y=c.relatedTarget;(!Y||!((C=S.value)!=null&&C.contains(Y)))&&(k.value=!1)};return(c,Y)=>(v(),_("div",{ref_key:"wrapperRef",ref:S,class:"relative w-full",onFocusout:i,onKeydown:Y[2]||(Y[2]=Ye(C=>k.value=!1,["esc"]))},[e("button",{id:d.id,type:"button",class:"filter-select-btn","aria-expanded":k.value,"aria-label":d.ariaLabel,"aria-haspopup":"listbox","aria-controls":`${d.id}-listbox`,onClick:Y[0]||(Y[0]=C=>k.value=!k.value)},[e("span",Lo,r(H.value),1),Y[3]||(Y[3]=e("svg",{class:"shrink-0 ml-1 opacity-50",width:"10",height:"6",viewBox:"0 0 10 6","aria-hidden":"true"}
1,[e("path",{d:"M0 0l5 6 5-6z",fill:"currentColor"})],-1))],8,Co),k.value?(v(),_("div",{key:0,id:`${d.id}-listbox`,class:"filter-select-dropdown",role:"listbox"},[(v(!0),_(K,null,U(d.options,C=>(v(),_("button",{key:C.value,class:ne(["filter-select-option",{selected:d.modelValue===C.value}]),type:"button",role:"option","aria-selected":d.modelValue===C.value,onMousedown:Y[1]||(Y[1]=ue(()=>{},["prevent"])),onClick:D=>x(C.value)},r(C.label),43,Mo))),128))],8,So)):Q("",!0)],544))}}),Te=$e(To,[["__scopeId","data-v-d46c177a"]]),Ie="#1a56db",Ke="#d62020",ce=d=>{var a;(a=d.currentTarget)==null||a.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})},De=(d,a,t,T)=>{const k=[...new Set(d)].sort((S,H)=>{const x=T==null?void 0:T(S,H);if(x!=null)return x;const i=Number(S),c=Number(H);return!Number.isNaN(i)&&!Number.isNaN(c)?i-c:String(S).localeCompare(String(H))});return[{value:"all",label:a},...k.map(S=>({value:S,label:t(S)}))]},We=d=>({hasActiveFilters:A(()=>d.some(([T,k])=>T.value!==k)),resetFilters:()=>{d.forEach(([T,k])=>{T.value=k})}}),Ge=(d,a,t)=>{const T=H=>{const x=new Map;return d.value.forEach(i=>{if(i.isHome!==H||!i.player||x.has(i.playerKey))return;const c=i.jerseyNumber?parseInt(i.jerseyNumber,10):null,Y=i.jerseyNumber?`#${i.jerseyNumber} ${i.player}`:i.player;x.set(i.playerKey,{value:i.playerKey,label:Y,isHome:H,jerseyNum:c})}),[...x.values()].sort((i,c)=>i.jerseyNum!==null&&c.jerseyNum!==null?i.jerseyNum-c.jerseyNum:i.jerseyNum!==null?-1:c.jerseyNum!==null?1:i.label.localeCompare(c.label))},k=A(()=>T(!0)),S=A(()=>T(!1));return Le(a,H=>{if(H==="all"||t.value==="all")return;(H==="home"?k.value:S.value).some(i=>i.value===t.value)||(t.value="all")}),{homePlayerOptions:k,awayPlayerOptions:S}},Ro={class:"w-full"},Po={class:"shot-plot-controls"},Oo={class:"shot-plot-reset-row"},Ho=["disabled"],Ao={class:"shot-plot-controls-row"},Yo={class:"filter-group",role:"group","aria-labelledby":"hockey-period-label"},Bo={id:"hockey-period-label",class:"filter-label"},No={class:"pill-row pill-row--desktop-only"},Fo=["aria-pressed","onClick"],Xo={class:"filter-select-mobile"},Vo={class:"filter-group",role:"group","aria-labelledby":"hockey-team-label"},Eo={id:"hockey-team-label",class:"filter-label"},Io={class:"pill-row"},Ko=["aria-pressed"],Do=["aria-pressed"],Wo=["src"],Go=["aria-pressed"],jo=["src"],zo={class:"filter-group",role:"group","aria-labelledby":"hockey-shot-type-label"},Uo={id:"hockey-shot-type-label",class:"filter-label"},qo={class:"pill-row pill-row--desktop-only"},Qo=["aria-pressed","onClick"],Zo={class:"filter-select-mobile"},Jo={class:"shot-plot-controls-row shot-plot-controls-row--secondary"},el={class:"filter-group",role:"group","aria-labelledby":"hockey-situation-label"},tl={id:"hockey-situation-label",class:"filter-label"},ol={class:"pill-row"},ll=["aria-pressed","onClick"],sl={class:"filter-group filter-group--own-row"},al={class:"shot-stats-bar"},nl={class:"shot-stats-team"},il={class:"shot-stats-values"},rl={class:"shot-stats-cell"},cl={class:"shot-stats-num"},ul={class:"shot-stats-label"},dl={class:"shot-stats-cell"},hl={class:"shot-stats-num"},pl={class:"shot-stats-label"},yl={class:"shot-stats-cell"},vl={class:"shot-stats-num"},ml={class:"shot-stats-label"},gl={class:"shot-stats-team"},_l={class:"shot-stats-values"},$l={class:"shot-stats-cell"},fl={class:"shot-stats-num"},wl={class:"shot-stats-label"},bl={class:"shot-stats-cell"},kl={class:"shot-stats-num"},xl={class:"shot-stats-label"},Cl={class:"shot-stats-cell"},Ll={class:"shot-stats-num"},Sl={class:"shot-stats-label"},Ml={class:"shot-plot-rink-wrapper"},Tl={class:"shot-plot-legend"},Rl={class:"flex items-center gap-2 text-sm font-medium text-grey-xxDark"},Pl={class:"flex items-center gap-2 text-sm font-medium text-grey-xxDark"},Ol={class:"flex items-center gap-2 text-sm font-medium text-grey-xxDark"},Hl={class:"flex items-center gap-2 text-sm font-medium text-grey-xxDark"},Al={class:"flex items-center gap-2 text-sm font-medium text-grey-xxDark"},Yl={class:"legend-team-chip flex items-center gap-2 text-sm font-bold text-grey-xxDark"},Bl=["src"],Nl={class:"legend-team-chip flex items-center gap-2 text-sm font-bold text-grey-xxDark"},Fl=["src"],Xl=620,Me=20,Pe=200,ke=130,Oe="shots_on_goal",Vl=pe({__name:"HockeyShotPlotMap",props:{events:{},homeCode:{},awayCode:{},homeColor:{},awayColor:{},homeLogo:{},awayLogo:{},isPlayoffs:{type:Boolean},defaultOrientation:{}},setup(d){const{tSport:a}=Fe("hockey"),t=d,T=(Xl-2*Me)/60,k=60*T,S=30*T,H=u=>Me+u/60*k,x=H(4),i=H(56),c=H(22.5),Y=H(37.5),C=u=>{const y=Math.max(u,0)/Pe;return i-y*(i-Y)},D=u=>{const y=Math.max(u,0)/Pe;return x+y*(c-x)},N=u=>{const y=Math.min(Math.max(u,-ke),ke);return Me+(y+ke)/(ke*2)*S},L=I("all"),$=I("all"),g=I(Oe),B=I("all"),W=I("all"),{hasActiveFilters:ee,resetFilters:te}=We([[L,"all"],[$,"all"],[g,Oe],[W,"all"],[B,"all"]]),F=A(()=>t.homeColor??Ie),Z=A(()=>t.awayColor??Ke),X=u=>{const y=(u.type??"").toLowerCase(),m=(u.class??"").toLowerCase();return y==="goal"||m==="goal"?"goal":u.goalSection!=null?u.goalSection>0?"on_goal":u.goalSection===-1?"post":u.goalSection===-3?"blocked":"wide":m==="shotblocked"?"blocked":m==="shotwide"?"wide":m==="shotiron"?"post":"on_goal"},n=u=>{const y=(u.type??"").toLowerCase(),m=(u.class??"").toLowerCase();return y==="goal"||m==="goal"},s=u=>{const y=(u.type??"").toLowerCase(),m=(u.class??"").toLowerCase();return n(u)?!0:(y==="shot"||m==="shot"||m==="shotblocked"||m==="shotwide"||m==="shotiron")&&u.locationX!=null&&u.locationY!=null},h=u=>{if(typeof u=="string"&&u.toLowerCase()==="shootout")return"SO";const y=Number(u);
1if(!Number.isNaN(y)&&y>3){if(t.isPlayoffs)return`P${y}`;const m=y-3;return m===1?"OT":`OT${m}`}return`P${u}`},M=A(()=>De(t.events.map(u=>u.period),a("all"),h,(u,y)=>typeof u=="string"&&u.toLowerCase()==="shootout"?1:typeof y=="string"&&y.toLowerCase()==="shootout"?-1:null)),le=[{value:"all",labelKey:"all"},{value:"shots_on_goal",labelKey:"shots_on_goal"},{value:"goal",labelKey:"goal"},{value:"on_goal",labelKey:"on_goal"},{value:"blocked",labelKey:"blocked"},{value:"post",labelKey:"post"},{value:"wide",labelKey:"wide"}],se=[{value:"all",labelKey:"all"},{value:"EQ",labelKey:"situation_eq"},{value:"PP",labelKey:"situation_pp"},{value:"SH",labelKey:"situation_sh"}],ae=A(()=>le.map(u=>({value:u.value,label:a(u.labelKey)}))),de=A(()=>t.events.filter(s).flatMap(u=>{var w;const y=String(((w=u.eventTeam)==null?void 0:w.place)??"").toLowerCase();if(y!=="home"&&y!=="away")return[];const m=y==="home",R=u.player,G=typeof R=="object"&&R?`${(R==null?void 0:R.firstName)??""} ${(R==null?void 0:R.familyName)??""}`.trim():R??"",O=typeof R=="object"&&R?String((R==null?void 0:R.jerseyToday)??""):"",b=typeof R=="object"&&R?(R==null?void 0:R.id)??(R==null?void 0:R.playerId):void 0,o=b!=null?String(b):`${y}::${O}::${G}`,J=(u.locationY??0)*.87;return[{svgX:m?C(u.locationX??0):D(u.locationX??0)+7,svgY:N(m?J:-J),outcome:X(u),isHome:m,player:G,playerKey:o,jerseyNumber:O,period:u.period,time:u.time??"",homeScore:u.homeTeamValue??"",awayScore:u.awayTeamValue??"",situation:(u.goalStatus??"").toUpperCase()}]})),re=A(()=>de.value.filter(u=>{if(L.value!=="all"&&u.period!==L.value||$.value==="home"&&!u.isHome||$.value==="away"&&u.isHome)return!1;if(g.value==="shots_on_goal"){if(u.outcome!=="goal"&&u.outcome!=="on_goal")return!1}else if(g.value!=="all"&&u.outcome!==g.value)return!1;return!(W.value!=="all"&&!u.situation.startsWith(W.value)||B.value!=="all"&&u.playerKey!==B.value)})),{homePlayerOptions:P,awayPlayerOptions:f}=Ge(de,$,B),p=A(()=>{const u=re.value.filter(G=>G.isHome),y=u.filter(G=>G.outcome==="goal").length,m=u.filter(G=>G.outcome==="on_goal"||G.outcome==="goal").length,R=u.length;return{goals:y,onGoal:m,total:R,pct:R>0?Math.round(y/R*100):0}}),V=A(()=>{const u=re.value.filter(G=>!G.isHome),y=u.filter(G=>G.outcome==="goal").length,m=u.filter(G=>G.outcome==="on_goal"||G.outcome==="goal").length,R=u.length;return{goals:y,onGoal:m,total:R,pct:R>0?Math.round(y/R*100):0}});return(u,y)=>(v(),_("div",Ro,[e("div",Po,[e("div",Oo,[e("button",{type:"button",class:"shot-plot-reset-btn",disabled:!l(ee),onClick:y[0]||(y[0]=(...m)=>l(te)&&l(te)(...m))},[ie(Be,{icon:"refresh",size:14}),e("span",null,r(l(a)("reset_filters")),1)],8,Ho)]),e("div",Ao,[e("div",Yo,[e("span",Bo,r(l(a)("period")),1),e("div",No,[(v(!0),_(K,null,U(M.value,m=>(v(),_("button",{key:m.value,class:ne(["pill",{active:L.value===m.value}]),"aria-pressed":L.value===m.value,type:"button",onClick:R=>{L.value=m.value,l(ce)(R)}},r(m.label),11,Fo))),128))]),e("div",Xo,[ie(Te,{id:"hockey-period-select",modelValue:L.value,"onUpdate:modelValue":y[1]||(y[1]=m=>L.value=m),"aria-label":l(a)("period"),options:M.value},null,8,["modelValue","aria-label","options"])])]),e("div",Vo,[e("span",Eo,r(l(a)("team")),1),e("div",Io,[e("button",{class:ne(["pill",{active:$.value==="all"}]),"aria-pressed":$.value==="all",type:"button",onClick:y[2]||(y[2]=m=>{$.value="all",l(ce)(m)})},r(l(a)("all")),11,Ko),e("button",{class:"pill team-pill",style:q($.value==="home"?{background:F.value,borderColor:F.value,color:"white"}:{borderColor:F.value,color:F.value}),"aria-pressed":$.value==="home",type:"button",onClick:y[3]||(y[3]=m=>{$.value="home",l(ce)(m)})},[t.homeLogo?(v(),_("img",{key:0,src:t.homeLogo,class:"w-4 h-4 object-contain rounded-sm shrink-0",alt:""},null,8,Wo)):Q("",!0),we(" "+r(d.homeCode),1)],12,Do),e("button",{class:"pill team-pill",style:q($.value==="away"?{background:Z.value,borderColor:Z.value,color:"white"}:{borderColor:Z.value,color:Z.value}),"aria-pressed":$.value==="away",type:"button",onClick:y[4]||(y[4]=m=>{$.value="away",l(ce)(m)})},[t.awayLogo?(v(),_("img",{key:0,src:t.awayLogo,class:"w-4 h-4 object-contain rounded-sm shrink-0",alt:""},null,8,jo)):Q("",!0),we(" "+r(d.awayCode),1)],12,Go)])]),e("div",zo,[e("span",Uo,r(l(a)("shot_type")),1),e("div",qo,[(v(),_(K,null,U(le,m=>e("button",{key:m.value,class:ne(["pill",{active:g.value===m.value}]),"aria-pressed":g.value===m.value,type:"button",onClick:R=>{g.value=m.value,l(ce)(R)}},r(l(a)(m.labelKey)),11,Qo)),64))]),e("div",Zo,[ie(Te,{id:"hockey-shot-type-select",modelValue:g.value,"onUpdate:modelValue":y[5]||(y[5]=m=>g.value=m),"aria-label":l(a)("shot_type"),options:ae.value},null,8,["modelValue","aria-label","options"])])])]),e("div",Jo,[e("div",el,[e("span",tl,r(l(a)("situation")),1),e("div",ol,[(v(),_(K,null,U(se,m=>e("button",{key:m.value,class:ne(["pill",{active:W.value===m.value}]),"aria-pressed":W.value===m.value,type:"button",onClick:R=>{W.value=m.value,l(ce)(R)}},r(l(a)(m.labelKey)),11,ll)),64))])]),e("div",sl,[ie(Ee,{id:"hockey-player-select",modelValue:B.value,"onUpdate:modelValue":y[6]||(y[6]=m=>B.value=m),"aria-label":l(a)("player"),"all-players-label":l(a)("all_players"),"search-placeholder":l(a)("search_player_placeholder"),"no-results-label":l(a)("no_players_found"),"home-code":t.homeCode,"away-code":t.awayCode,"home-logo":t.homeLogo,"away-logo":t.awayLogo,"home-options":$.value==="away"?[]:l(P),"away-options":$.value==="home"?[]:l(f)},null,8,["modelValue","aria-label","all-players-label","search-placeholder","no-results-label","home-code","away-code","home-logo","away-logo","home-options","away-options"])])])]),e("div",al,[e("div",nl,[e("span",{class:"shot-stats-code",style:q({color:F.value})},r(d.homeCode),5),e("div",il,[e("div",rl,[e("span",cl,r(p.value.goals),1),e("span",ul,r(l(a)("goals")),1)]),e("div",dl,[e("span",hl,r(p.value.total),1),e("span",pl,r(l(a)("shots")),1)]),y[7]||(y[7]=e("div",{class:"shot-stats-divider-v"},null,-1)),e("div",yl,[e("span",vl,r(p.value.pct)+"%",1),e("span",ml,r(l(a)("goal_percentage")),1)])])]),y[9]||(y[9]=e("div",{class:"shot-stats-divider-h"},null,-1)),e("div",gl,[e("span",{class:"shot-stats-code",style:q({color:Z.value})},r(d.awayCode),5),e("div",_l,[e("div",$l,[e("span",fl,r(V.value.goals),1),e("span",wl,r(l(a)("goals")),1)]),e("div",bl,[e("span",kl,r(V.value.total),1),e("span",xl,r(l(a)("shots")),1)]),y[8]||(y[8]=e("div",{class:"shot-stats-divider-v"},null,-1)),e("div",Cl,[e("span",Ll,r(V.value.pct)+"%",1),e("span",Sl,r(l(a)("goal_percentage")),1)])])])]),e("div",Ml,[ie(ro,{"home-color":F.value,"away-color":Z.value,"home-code":t.homeCode,"away-code":t.awayCode,shots:re.value,"default-orientation":t.defaultOrientation},null,8,["home-color","away-color","home-code","away-code","shots","default-orientation"])]),e("div",Tl,[e("div",Rl,[y[10]||(y[10]=e("svg",{width:"16",height:"16",viewBox:"0 0 14 14","aria-hidden":"true"},[e("circle",{cx:"7",cy:"7",r:"5.5",fill:"#374151",stroke:"white","stroke-width":"1.5"})],-1)),e("span",null,r(l(a)("on_goal")),1)]),e("div",Pl,[y[11]||(y[11]=e("svg",{width:"20",height:"20",viewBox:"0 0 18 18","aria-hidden":"true"}
1,[e("circle",{cx:"9",cy:"9",r:"8",fill:"#374151",stroke:"white","stroke-width":"2"}),e("text",{x:"9",y:"9","text-anchor":"middle","dominant-baseline":"central","font-size":"8","font-weight":"bold",fill:"white"},"G")],-1)),e("span",null,r(l(a)("goal")),1)]),e("div",Ol,[y[12]||(y[12]=e("svg",{width:"14",height:"14",viewBox:"0 0 12 12","aria-hidden":"true"},[e("rect",{x:"1",y:"1",width:"10",height:"10",rx:"1",fill:"#374151",stroke:"white","stroke-width":"1.5"})],-1)),e("span",null,r(l(a)("blocked")),1)]),e("div",Hl,[y[13]||(y[13]=e("svg",{width:"16",height:"16",viewBox:"0 0 14 14","aria-hidden":"true"},[e("polygon",{points:"7,1 13,13 1,13",fill:"#374151",stroke:"white","stroke-width":"1.5","stroke-linejoin":"round"})],-1)),e("span",null,r(l(a)("post")),1)]),e("div",Al,[y[14]||(y[14]=e("svg",{width:"16",height:"16",viewBox:"0 0 14 14","aria-hidden":"true"},[e("line",{x1:"2",y1:"2",x2:"12",y2:"12",stroke:"#374151","stroke-width":"3","stroke-linecap":"round"}),e("line",{x1:"12",y1:"2",x2:"2",y2:"12",stroke:"#374151","stroke-width":"3","stroke-linecap":"round"})],-1)),e("span",null,r(l(a)("wide")),1)]),y[15]||(y[15]=e("div",{class:"legend-divider w-px h-5 bg-grey-light mx-1"},null,-1)),e("div",Yl,[e("span",{class:"inline-block w-3 h-3 rounded-full shrink-0 ring-1 ring-white shadow-sm",style:q({background:F.value})},null,4),t.homeLogo?(v(),_("img",{key:0,src:t.homeLogo,class:"w-5 h-5 object-contain shrink-0",alt:""},null,8,Bl)):Q("",!0),e("span",null,r(d.homeCode),1)]),e("div",Nl,[e("span",{class:"inline-block w-3 h-3 rounded-full shrink-0 ring-1 ring-white shadow-sm",style:q({background:Z.value})},null,4),t.awayLogo?(v(),_("img",{key:0,src:t.awayLogo,class:"w-5 h-5 object-contain shrink-0",alt:""},null,8,Fl)):Q("",!0),e("span",null,r(d.awayCode),1)])])]))}}),El=$e(Vl,[["__scopeId","data-v-36069322"]]),Il={class:"w-full"},Kl=["viewBox","aria-label"],Dl=["transform"],Wl=["y2"],Gl=["y","width","height"],jl=["x1","y1","x2","y2"],zl=["d"],Ul=["d"],ql=["y1","x2","y2"],Ql=["y1","x2","y2"],Zl=["d"],Jl=["d"],es=["y1","y2"],ts=["cx","cy"],os=["x","y","width","height"],ls=["x1","y1","x2","y2"],ss=["d"],as=["d"],ns=["x1","y1","x2","y2"],is=["x1","y1","x2","y2"],rs=["d"],cs=["d"],us=["x1","y1","x2","y2"],ds=["cx","cy"],hs=["x1","y1","x2","y2","stroke"],ps=["x1","y1","x2","y2","stroke"],ys=["cx","cy","aria-label","onMouseenter","onFocus","onClick"],vs=["cx","cy","aria-label","fill","onMouseenter","onFocus","onClick"],ms=["transform"],gs=["x","y"],_s={class:"font-semibold"},$s={class:"text-[#bcd] text-[10px]"},fs={class:"text-[#99aacc] text-[10px]"},ve=620,_e=350,j=22,He=1.575/28*100,oe=50,he=5.8/28*100,Ae=2.45/15*100,fe=2.989/28*100,me=.9/15*100,xe=.915/15*100,ws=165,bs=90,ks=pe({__name:"BasketballCourtSvg",props:{homeCode:{},awayCode:{},homeColor:{},awayColor:{},shots:{},defaultOrientation:{}},setup(d){const a=d,t=ve-2*j,T=_e-2*j,k=t/28,{isRotated:S,toggleRotation:H}=Ne(A(()=>a.defaultOrientation)),x=A(()=>S.value?`translate(0, ${ve}) rotate(-90)`:""),i=P=>j+P/100*t,c=P=>j+P/100*T,Y=100-He,C=100-he,D=oe-Ae,N=oe+Ae,L=100-fe,$=100-me,g=ve/2,B=_e/2,W={x:i(He),y:c(oe)},ee={x:i(Y),y:c(oe)},te=6.75*k,F=1.8*k,Z=1.8*k,X=1.25*k,n=.23*k,s=I(null),h=I({x:0,y:0}),M=I(null),le=()=>{var P;return((P=M.value)==null?void 0:P.getBoundingClientRect())??null},se=(P,f,p)=>Xe({cursorX:P,cursorY:f,containerWidth:p.width,containerHeight:p.height,tooltipWidth:ws,tooltipHeight:bs,viewportWidth:window.innerWidth,wrapperOffsetLeft:p.left}),ae=(P,f)=>{const p=le();p&&(s.value=P,h.value=se(f.clientX-p.left,f.clientY-p.top,p))},de=P=>{if(!s.value)return;const f=le();f&&(h.value=se(P.clientX-f.left,P.clientY-f.top,f))},re=(P,f)=>{const p=f.currentTarget,V=le();if(!V)return;const u=p.getBoundingClientRect();s.value=P,h.value=se(u.left+u.width/2-V.left,u.top-V.top,V)};return(P,f)=>(v(),_("div",Il,[ie(Ve,{"is-rotated":l(S),onToggle:l(H)},null,8,["is-rotated","onToggle"]),e("div",{ref_key:"wrapperRef",ref:M,class:"relative w-full"},[(v(),_("svg",{viewBox:l(S)?`0 0 ${_e} ${ve}`:`0 0 ${ve} ${_e}`,class:ne(l(S)?"block mx-auto max-h-[82vh] w-auto":"block w-full"),style:q({aspectRatio:l(S)?`${_e} / ${ve}`:`${ve} / ${_e}`}),role:"group","aria-label":P.$t("shot_plot.basketball.court_aria"),onMouseleave:f[6]||(f[6]=p=>s.value=null),onFocusout:f[7]||(f[7]=p=>s.value=null),onClick:f[8]||(f[8]=p=>s.value=null)},[e("g",{transform:x.value},[e("rect",{x:j,y:j,width:t,height:T,fill:"#f5e9c9"}),e("rect",{x:j,y:j,width:t,height:T,fill:"none",stroke:"#8b6020","stroke-width":"3"}),e("line",{x1:g,y1:j,x2:g,y2:j+T,stroke:"#8b6020","stroke-width":"2"},null,8,Wl),e("circle",{cx:g,cy:B,r:Z,fill:"none",stroke:"#8b6020","stroke-width":"2"}),e("circle",{cx:g,cy:B,r:"4",fill:"#8b6020"}),e("rect",{x:j,y:c(D),width:i(he)-j,height:c(N)-c(D),fill:"#e8d5a3",stroke:"#8b6020","stroke-width":"2"},null,8,Gl),e("line",{x1:i(he),y1:c(D),x2:i(he),y2:c(N),stroke:"#8b6020","stroke-width":"2"},null,8,jl),e("path",{d:`M ${i(he)} ${c(oe)-F} 2 A ${F} ${F} 0 0 1 3 ${i(he)} ${c(oe)+F}`,fill:"none",stroke:"#8b6020","stroke-width":"2"},null,8,zl),e("path",{d:`M ${i(he)} ${c(oe)-F} 4 A ${F} ${F} 0 0 0 5 ${i(he)} ${c(oe)+F}`,fill:"none",stroke:"#8b6020","stroke-width":"2","stroke-dasharray":"5 4"},null,8,Ul),e("line",{x1:j,y1:c(me),x2:i(fe),y2:c(me),stroke:"#8b6020","stroke-width":"2"},null,8,ql),e("line",{x1:j,y1:c($),x2:i(fe),y2:c($),stroke:"#8b6020","stroke-width":"2"},null,8,Ql),e("path",{d:`M ${i(fe)} ${c(me)} 6 A ${te} ${te} 0 0 1 7 ${i(fe)} ${c($)}`,fill:"none",stroke:"#8b6020","stroke-width":"2"},null,8,Zl),e("path",{d:`M ${W.x} ${W.y-X} 8 A ${X} ${X} 0 0 1 9 ${W.x} ${W.y+X}`,fill:"none",stroke:"#8b6020","stroke-width":"1.5"},null,8,Jl),e("line",{x1:j,y1:c(oe-xe),x2:j,y2:c(oe+xe),stroke:"#444","stroke-width":"5"},null,8,es),e("circle",{cx:W.x,cy:W.y,r:n,fill:"none",stroke:"#cc4400","stroke-width":"2.5"},null,8,ts),e("rect",{x:i(C),y:c(D),width:j+t-i(C),height:c(N)-c(D),fill:"#e8d5a3",stroke:"#8b6020","stroke-width":"2"},null,8,os),e("line",{x1:i(C),y1:c(D),x2:i(C),y2:c(N),stroke:"#8b6020","stroke-width":"2"},null,8,ls),e("path",{d:`M ${i(C)} ${c(oe)-F} 10 A ${F} ${F} 0 0 0 11 ${i(C)} ${c(oe)+F}`,fill:"none",stroke:"#8b6020","stroke-width":"2"},null,8,ss),e("path",{d:`M ${i(C)} ${c(oe)-F} 12 A ${F} ${F} 0 0 1 13 ${i(C)} ${c(oe)+F}`,fill:"none",stroke:"#8b6020","stroke-width":"2","stroke-dasharray":"5 4"},null,8,as),e("line",{x1:j+t,y1:c(me),x2:i(L),y2:c(me),stroke:"#8b6020","stroke-width":"2"},null,8,ns),e("line",{x1:j+t,y1:c($),x2:i(L),y2:c($),stroke:"#8b6020","stroke-width":"2"},null,8,is),e("path",{d:`M ${i(L)} ${c(me)} 14 A ${te} ${te} 0 0 0 15 ${i(L)} ${c($)}`,fill:"none",stroke:"#8b6020","stroke-width":"2"},null,8,rs),e("path",{d:`M ${ee.x} ${ee.y-X} 16 A ${X} ${X} 0 0 0 17 ${ee.x} ${ee.y+X}`,fill:"none",stroke:"#8b6020","stroke-width":"1.5"},null,8,cs),e("line",{x1:j+t,y1:c(oe-xe),x2:j+t,y2:c(oe+xe),stroke:"#444","stroke-width":"5"},null,8,us),e("circle",{cx:ee.x,cy:ee.y,r:n,fill:"none",stroke:"#cc4400","stroke-width":"2.5"},null,8,ds),(v(!0),_(K,null,U(a.shots.filter(p=>!p.isMade),p=>(v(),_("g",{key:`miss-${p.period}-${p.time}-${p.svgX}-${p.svgY}-${p.type}`},[e("line",{x1:p.svgX-4,y1:p.svgY-4,x2:p.svgX+4,y2:p.svgY+4,stroke:p.isHome?a.homeColor:a.awayColor,"stroke-width":"2","stroke-opacity":"0.75"},null,8,hs),e("line",{x1:p.svgX+4,y1:p.svgY-4,x2:p.svgX-4,y2:p.svgY+4,stroke:p.isHome?a.homeColor:a.awayColor,"stroke-width":"2","stroke-opacity":"0.75"},null,8,ps),e("circle",{cx:p.svgX,cy:p.svgY,r:"9",role:"button","aria-label":`${p.player||P.$t("shot_plot.unknown_player")} · ${p.type==="3pt"?P.$t("shot_plot.basketball.three_pt"):P.$t("shot_plot.basketball.two_pt")} · ${p.isMade?P.$t("shot_plot.basketball.made"):P.$t("shot_plot.basketball.missed")}`,fill:"transparent",class:"cursor-pointer transition-opacity duration-100 hover:opacity-80 hover:drop-shadow-[0_0_4px_rgba(0,0,0,0.45)]",tabindex:"0",onMouseenter:V=>ae(p,V),onMousemove:f[0]||(f[0]=V=>de(V)),onMouseleave:f[1]||(f[1]=V=>s.value=null),onFocus:V=>re(p,V),onBlur:f[2]||(f[2]=V=>s.value=null),onClick:ue(V=>ae(p,V),["stop"])},null,40,ys)]))),128)),(v(!0),_(K,null,U(a.shots.filter(p=>p.isMade),p=>(v(),_("g",{key:`made-${p.period}-${p.time}-${p.svgX}-${p.svgY}-${p.type}`},[e("circle",{cx:p.svgX,cy:p.svgY,r:"7",role:"button","aria-label":`${p.player||P.$t("shot_plot.unknown_player")} · ${p.type==="3pt"?P.$t("shot_plot.basketball.three_pt"):P.$t("shot_plot.basketball.two_pt")} · ${p.isMade?P.$t("shot_plot.basketball.made"):P.$t("shot_plot.basketball.missed")}`,fill:p.isHome?a.homeColor:a.awayColor,"fill-opacity":"0.88",stroke:"white","stroke-width":"1.5",class:"cursor-pointer transition-opacity duration-100 hover:opacity-80 hover:drop-shadow-[0_0_4px_rgba(0,0,0,0.45)]",tabindex:"0",onMouseenter:V=>ae(p,V),onMousemove:f[3]||(f[3]=V=>de(V)),onMouseleave:f[4]||(f[4]=V=>s.value=null),onFocus:V=>
17re(p,V),onBlur:f[5]||(f[5]=V=>s.value=null),onClick:ue(V=>ae(p,V),["stop"])},null,40,vs),e("g",{transform:l(S)?`rotate(90 ${p.svgX} ${p.svgY})`:void 0},[e("text",{x:p.svgX,y:p.svgY,dy:"0.35em","text-anchor":"middle","font-size":"8","font-weight":"bold",fill:"white",style:{"pointer-events":"none"}},r(p.type==="3pt"?"3":"2"),9,gs)],8,ms)]))),128))],8,Dl)],46,Kl)),s.value?(v(),_("div",{key:0,class:"pointer-events-none absolute z-10 max-w-[165px] bg-[rgba(15,15,25,0.93)] rounded-lg py-2 px-2.5 text-white text-[11px] leading-[1.55] break-words shadow-[0_4px_14px_rgba(0,0,0,0.4)]",style:q({left:`${h.value.x}px`,top:`${h.value.y}px`})},[e("div",{class:"font-bold text-xs uppercase",style:q({color:s.value.isHome?a.homeColor:a.awayColor})},r(s.value.isHome?a.homeCode:a.awayCode),5),e("div",_s,r(s.value.player||P.$t("shot_plot.unknown_player")),1),e("div",$s,r(s.value.type==="3pt"?P.$t("shot_plot.basketball.three_pt"):P.$t("shot_plot.basketball.two_pt"))+" · "+r(s.value.isMade?P.$t("shot_plot.basketball.made"):P.$t("shot_plot.basketball.missed")),1),e("div",fs,r(P.$t("shot_plot.basketball.period_abbr"))+r(s.value.period)+" · "+r(s.value.time),1)],4)):Q("",!0)],512)]))}}),xs={class:"w-full"},Cs={class:"shot-plot-controls"},Ls={class:"shot-plot-reset-row"},Ss=["disabled"],Ms={class:"shot-plot-controls-row"},Ts={class:"filter-group",role:"group","aria-labelledby":"bball-period-label"},Rs={id:"bball-period-label",class:"filter-label"},Ps={class:"pill-row pill-row--desktop-only"},Os=["aria-pressed","onClick"],Hs={class:"filter-select-mobile"},As={class:"filter-group",role:"group","aria-labelledby":"bball-team-label"},Ys={id:"bball-team-label",class:"filter-label"},Bs={class:"pill-row"},Ns=["aria-pressed"],Fs=["aria-pressed"],Xs=["src"],Vs=["aria-pressed"],Es=["src"],Is={class:"filter-group",role:"group","aria-labelledby":"bball-shot-type-label"},Ks={id:"bball-shot-type-label",class:"filter-label"},Ds={class:"pill-row"},Ws=["aria-pressed","onClick"],Gs={class:"shot-plot-controls-row shot-plot-controls-row--secondary"},js={class:"filter-group filter-group--own-row"},zs={class:"shot-stats-bar"},Us={class:"shot-stats-team"},qs={class:"shot-stats-values"},Qs={class:"shot-stats-cell"},Zs={class:"shot-stats-num"},Js={class:"shot-stats-label"},ea={class:"shot-stats-cell"},ta={class:"shot-stats-num"},oa={class:"shot-stats-label"},la={class:"shot-stats-cell"},sa={class:"shot-stats-num"},aa={class:"shot-stats-label"},na={class:"shot-stats-team"},ia={class:"shot-stats-values"},ra={class:"shot-stats-cell"},ca={class:"shot-stats-num"},ua={class:"shot-stats-label"},da={class:"shot-stats-cell"},ha={class:"shot-stats-num"},pa={class:"shot-stats-label"},ya={class:"shot-stats-cell"},va={class:"shot-stats-num"},ma={class:"shot-stats-label"},ga={class:"shot-plot-rink-wrapper"},_a={class:"shot-plot-legend"},$a={class:"flex items-center gap-2 text-sm font-medium text-grey-xxDark"},fa={class:"flex items-center gap-2 text-sm font-medium text-grey-xxDark"},wa={class:"flex items-center gap-2 text-sm font-medium text-grey-xxDark"},ba={class:"legend-team-chip flex items-center gap-2 text-sm font-bold text-grey-xxDark"},ka=["src"],xa={class:"legend-team-chip flex items-center gap-2 text-sm font-bold text-grey-xxDark"},Ca=["src"],La={class:"flex items-center justify-center gap-[5px] mt-[10px] text-[11px] text-[#888] italic text-center leading-[1.4]"},Sa=620,Ma=350,Ce=22,Ta=pe({__name:"BasketballShotPlotMap",props:{events:{},homeCode:{},awayCode:{},homeColor:{},awayColor:{},homeLogo:{},awayLogo:{},defaultOrientation:{}},setup(d){const a=d,{tSport:t}=Fe("basketball"),T=Sa-2*Ce,k=Ma-2*Ce,S=n=>Ce+n/100*T,H=n=>Ce+n/100*k,x=I("all"),i=I("all"),c=I("all"),Y=I("all"),{hasActiveFilters:C,resetFilters:D}=We([[x,"all"],[i,"all"],[c,"all"],[Y,"all"]]),N=A(()=>a.homeColor??Ie),L=A(()=>a.awayColor??Ke),$=n=>{const s=Number(n);return!Number.isNaN(s)&&s>=1&&s<=4?`P${s}`:String(n).toUpperCase()},g=A(()=>De(a.events.map(n=>n.period),t("all"),$)),B=[{value:"all",labelKey:"all"},{value:"3pt",labelKey:"three_pt"},{value:"2pt",labelKey:"two_pt"},{value:"missed",labelKey:"missed"}],W=A(()=>a.events.filter(n=>{var h,M;const s=(n.type??"").toLowerCase();return(s==="2pt"||s==="3pt")&&((h=n.coordinates)==null?void 0:h.x)!=null&&((M=n.coordinates)==null?void 0:M.y)!=null}).flatMap(n=>{var de,re,P;const s=String(((de=n.eventTeam)==null?void 0:de.place)??"").toLowerCase();if(s!=="home"&&s!=="away")return[];const h=s==="home",M=n.player,le=typeof M=="object"&&M?`${(M==null?void 0:M.firstName)??""} ${(M==null?void 0:M.familyName)??""}`.trim():M??"",se=typeof M=="object"&&M?String((M==null?void 0:M.jerseyToday)??""):"",ae=`${s}::${se}::${le}`;return[{svgX:S((re=n.coordinates)==null?void 0:re.x),svgY:H((P=n.coordinates)==null?void 0:P.y),isMade:n.isSuccessful===1||n.isSuccessful===!0,isHome:h,type:(n.type??"").toLowerCase(),player:le,playerKey:ae,jerseyNumber:se,period:n.period,time:n.time??""}]})),ee=A(()=>W.value.filter(n=>{if(x.value!=="all"&&n.period!==x.value||i.value==="home"&&!n.isHome||i.value==="away"&&n.isHome)return!1;if(c.value==="missed"){if(n.isMade)return!1}else if(c.value!=="all"&&n.type!==c.value)return!1;return!(Y.value!=="all"&&n.playerKey!==Y.value)})),{homePlayerOptions:te,awayPlayerOptions:F}=Ge(W,i,Y),Z=A(()=>{const n=ee.value.filter(M=>M.isHome),s=n.filter(M=>M.isMade).length,h=n.length;return{made:s,total:h,pct:h>0?Math.round(s/h*100):0}}),X=A(()=>{const n=ee.value.filter(M=>!M.isHome),s=n.filter(M=>M.isMade).length,h=n.length;return{made:s,total:h,pct:h>0?Math.round(s/h*100):0}});return(n,s)=>(v(),_("div",xs,[e("div",Cs,[e("div",Ls,[e("button",{type:"button",class:"shot-plot-reset-btn",disabled:!l(C),onClick:s[0]||(s[0]=(...h)=>
17l(D)&&l(D)(...h))},[ie(Be,{icon:"refresh",size:14}),e("span",null,r(l(t)("reset_filters")),1)],8,Ss)]),e("div",Ms,[e("div",Ts,[e("span",Rs,r(l(t)("period")),1),e("div",Ps,[(v(!0),_(K,null,U(g.value,h=>(v(),_("button",{key:h.value,class:ne(["pill",{active:x.value===h.value}]),"aria-pressed":x.value===h.value,type:"button",onClick:M=>{x.value=h.value,l(ce)(M)}},r(h.label),11,Os))),128))]),e("div",Hs,[ie(Te,{id:"bball-period-select",modelValue:x.value,"onUpdate:modelValue":s[1]||(s[1]=h=>x.value=h),"aria-label":l(t)("period"),options:g.value},null,8,["modelValue","aria-label","options"])])]),e("div",As,[e("span",Ys,r(l(t)("team")),1),e("div",Bs,[e("button",{class:ne(["pill",{active:i.value==="all"}]),"aria-pressed":i.value==="all",type:"button",onClick:s[2]||(s[2]=h=>{i.value="all",l(ce)(h)})},r(l(t)("all")),11,Ns),e("button",{class:"pill team-pill",style:q(i.value==="home"?{background:N.value,borderColor:N.value,color:"white"}:{borderColor:N.value,color:N.value}),"aria-pressed":i.value==="home",type:"button",onClick:s[3]||(s[3]=h=>{i.value="home",l(ce)(h)})},[a.homeLogo?(v(),_("img",{key:0,src:a.homeLogo,class:"w-4 h-4 object-contain rounded-sm shrink-0",alt:""},null,8,Xs)):Q("",!0),we(" "+r(d.homeCode),1)],12,Fs),e("button",{class:"pill team-pill",style:q(i.value==="away"?{background:L.value,borderColor:L.value,color:"white"}:{borderColor:L.value,color:L.value}),"aria-pressed":i.value==="away",type:"button",onClick:s[4]||(s[4]=h=>{i.value="away",l(ce)(h)})},[a.awayLogo?(v(),_("img",{key:0,src:a.awayLogo,class:"w-4 h-4 object-contain rounded-sm shrink-0",alt:""},null,8,Es)):Q("",!0),we(" "+r(d.awayCode),1)],12,Vs)])]),e("div",Is,[e("span",Ks,r(l(t)("shot_type")),1),e("div",Ds,[(v(),_(K,null,U(B,h=>e("button",{key:h.value,class:ne(["pill",{active:c.value===h.value}]),"aria-pressed":c.value===h.value,type:"button",onClick:M=>{c.value=h.value,l(ce)(M)}},r(l(t)(h.labelKey)),11,Ws)),64))])])]),e("div",Gs,[e("div",js,[ie(Ee,{id:"bball-player-select",modelValue:Y.value,"onUpdate:modelValue":s[5]||(s[5]=h=>Y.value=h),"aria-label":l(t)("player"),"all-players-label":l(t)("all_players"),"search-placeholder":l(t)("search_player_placeholder"),"no-results-label":l(t)("no_players_found"),"home-code":a.homeCode,"away-code":a.awayCode,"home-logo":a.homeLogo,"away-logo":a.awayLogo,"home-options":i.value==="away"?[]:l(te),"away-options":i.value==="home"?[]:l(F)},null,8,["modelValue","aria-label","all-players-label","search-placeholder","no-results-label","home-code","away-code","home-logo","away-logo","home-options","away-options"])])])]),e("div",zs,[e("div",Us,[e("span",{class:"shot-stats-code",style:q({color:N.value})},r(d.homeCode),5),e("div",qs,[e("div",Qs,[e("span",Zs,r(Z.value.made),1),e("span",Js,r(l(t)("made")),1)]),e("div",ea,[e("span",ta,r(Z.value.total),1),e("span",oa,r(l(t)("attempt")),1)]),s[6]||(s[6]=e("div",{class:"shot-stats-divider-v"},null,-1)),e("div",la,[e("span",sa,r(Z.value.pct)+"%",1),e("span",aa,r(l(t)("fg_pct")),1)])])]),s[8]||(s[8]=e("div",{class:"shot-stats-divider-h"},null,-1)),e("div",na,[e("span",{class:"shot-stats-code",style:q({color:L.value})},r(d.awayCode),5),e("div",ia,[e("div",ra,[e("span",ca,r(X.value.made),1),e("span",ua,r(l(t)("made")),1)]),e("div",da,[e("span",ha,r(X.value.total),1),e("span",pa,r(l(t)("attempt")),1)]),s[7]||(s[7]=e("div",{class:"shot-stats-divider-v"},null,-1)),e("div",ya,[e("span",va,r(X.value.pct)+"%",1),e("span",ma,r(l(t)("fg_pct")),1)])])])]),e("div",ga,[ie(ks,{"home-color":N.value,"away-color":L.value,"home-code":a.homeCode,"away-code":a.awayCode,shots:ee.value,"default-orientation":a.defaultOrientation},null,8,["home-color","away-color","home-code","away-code","shots","default-orientation"])]),e("div",_a,[e("div",$a,[s[9]||(s[9]=e("svg",{width:"18",height:"18",viewBox:"0 0 16 16","aria-hidden":"true"},[e("circle",{cx:"8",cy:"8",r:"7",fill:"#374151",stroke:"white","stroke-width":"1.5"}),e("text",{x:"8",y:"8","text-anchor":"middle","dominant-baseline":"central","font-size":"8","font-weight":"bold",fill:"white"},"2")],-1)),e("span",null,r(l(t)("two_pt")),1)]),e("div",fa,[s[10]||(s[10]=e("svg",{width:"18",height:"18",viewBox:"0 0 16 16","aria-hidden":"true"},[e("circle",{cx:"8",cy:"8",r:"7",fill:"#374151",stroke:"white","stroke-width":"1.5"}),e("text",{x:"8",y:"8","text-anchor":"middle","dominant-baseline":"central","font-size":"8","font-weight":"bold",fill:"white"},"3")],-1)),e("span",null,r(l(t)("three_pt")),1)]),e("div",wa,[s[11]||(s[11]=e("svg",{width:"16",height:"16",viewBox:"0 0 14 14","aria-hidden":"true"},[e("line",{x1:"2",y1:"2",x2:"12",y2:"12",stroke:"#374151","stroke-width":"3","stroke-linecap":"round"}),e("line",{x1:"12",y1:"2",x2:"2",y2:"12",stroke:"#374151","stroke-width":"3","stroke-linecap":"round"})],-1)),e("span",null,r(l(t)("missed_attempt")),1)]),s[12]||(s[12]=e("div",{class:"legend-divider w-px h-5 bg-grey-light mx-1"},null,-1)),e("div",ba,[e("span",{class:"inline-block w-3 h-3 rounded-full shrink-0 ring-1 ring-white shadow-sm",style:q({background:N.value})},null,4),a.homeLogo?(v(),_("img",{key:0,src:a.homeLogo,class:"w-5 h-5 object-contain shrink-0",alt:""},null,8,ka)):Q("",!0),e("span",null,r(d.homeCode),1)]),e("div",xa,[e("span",{class:"inline-block w-3 h-3 rounded-full shrink-0 ring-1 ring-white shadow-sm",style:q({background:L.value})},null,4),a.awayLogo?(v(),_("img",{key:0,src:a.awayLogo,class:"w-5 h-5 object-contain shrink-0",alt:""},null,8,Ca)):Q("",!0),e("span",null,r(d.awayCode),1)])]),e("p",La,[s[13]||(s[13]=e("svg",{width:"13",height:"13",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",class:"shrink-0 text-[#aaa]"},[e("circle",{cx:"10",cy:"10",r:"9",stroke:"currentColor","stroke-width":"2"}),e("line",{x1:"10",y1:"8.5",x2:"10",y2:"14",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"}
17),e("circle",{cx:"10",cy:"6",r:"1.2",fill:"currentColor"})],-1)),we(" "+r(l(t)("ft_note")),1)])]))}}),Ra=$e(Ta,[["__scopeId","data-v-9cea1a20"]]),Pa={key:0,class:"shot-plot-loading"},Oa={class:"text-center"},Ha={key:2,class:"shot-plot-empty"},Aa=pe({__name:"ShotPlot",props:{gameCenterInfo:{},heading:{default:""},defaultOrientationDesktop:{default:"horizontal"},defaultOrientationMobile:{default:"vertical"}},setup(d){const a=d,t=I(null),T=I(0);Ze(t,([n])=>{T.value=n.contentRect.width});const k=A(()=>it(T.value,a.defaultOrientationDesktop,a.defaultOrientationMobile)),S=Je(),H=et(),x=A(()=>S.isFeatureFlagEnabledForCurrentSite(at.LIVE_GAMES_V2)),i=I([]),c=I(!0),Y=A(()=>S.getSport==="basketball"),C=A(()=>S.getSport==="hockey"),D=A(()=>{var n,s;return((s=(n=a.gameCenterInfo)==null?void 0:n.homeTeam)==null?void 0:s.code)??""}),N=A(()=>{var n,s;return((s=(n=a.gameCenterInfo)==null?void 0:n.awayTeam)==null?void 0:s.code)??""}),L=A(()=>{var n,s;return((s=(n=a.gameCenterInfo)==null?void 0:n.homeTeam)==null?void 0:s.icon)??""}),$=A(()=>{var n,s;return((s=(n=a.gameCenterInfo)==null?void 0:n.awayTeam)==null?void 0:s.icon)??""}),g=A(()=>{var h;const n=(h=a.gameCenterInfo)==null?void 0:h.gameInfo,s=Array.isArray(n)?n[0]:n;return lt(s==null?void 0:s.roundNumber,s==null?void 0:s.roundLabel)}),B=()=>{var s,h;const n=(s=a.gameCenterInfo)==null?void 0:s.gameInfo;return Array.isArray(n)?(h=n[0])==null?void 0:h.gameUuid:n==null?void 0:n.gameUuid},W=()=>{var h;const n=(h=a.gameCenterInfo)==null?void 0:h.gameInfo,s=Array.isArray(n)?n[0]:n;return s==null?void 0:s.state},ee=A(()=>{var n;return!x.value||W()===st.POST_GAME||!((n=H.getLiveGame(B()))!=null&&n.isLive)}),te=A(()=>{var s;if(ee.value)return i.value;const n=(s=H.getLiveGame(B()))==null?void 0:s.rawPlayByPlay;return n&&n.length?n:i.value}),F=A(()=>Y.value?te.value.some(n=>{var h,M;const s=(n.type??"").toLowerCase();return(s==="2pt"||s==="3pt")&&((h=n.coordinates)==null?void 0:h.x)!=null&&((M=n.coordinates)==null?void 0:M.y)!=null}):C.value?te.value.some(n=>{const s=(n.type??"").toLowerCase(),h=(n.class??"").toLowerCase();return(s==="shot"||s==="goal"||h==="shot"||h==="goal"||h==="shotblocked"||h==="shotwide"||h==="shotiron")&&n.locationX!=null&&n.locationY!=null}):!1),Z=tt();let X=0;return Le(B,async n=>{if(!n){i.value=[],c.value=!1;return}X+=1;const s=X;c.value=!0;try{const h=await Z.getPbpInitialEventsV2(n);s===X&&(i.value=Array.isArray(h)?h:[])}catch{s===X&&(i.value=[])}finally{s===X&&(c.value=!1)}},{immediate:!0}),(n,s)=>(v(),_("div",{ref_key:"sectionRef",ref:t,class:"shot-plot-section"},[c.value?(v(),_("div",Pa,[...s[0]||(s[0]=[e("div",{class:"loading-spinner"},null,-1)])])):F.value?(v(),_(K,{key:1},[e("div",Oa,[ie(ot,{uppercase:"","is-section-heading":"","heading-level":"h2","has-rectangle":!1,"heading-label":d.heading||n.$t("shot_plot.title"),"custom-label-class":"text-grey-xxDark tracking-wide"},null,8,["heading-label"])]),Y.value?(v(),Re(Ra,{key:0,events:te.value,"home-code":D.value,"away-code":N.value,"home-logo":L.value,"away-logo":$.value,"default-orientation":k.value},null,8,["events","home-code","away-code","home-logo","away-logo","default-orientation"])):C.value?(v(),Re(El,{key:1,events:te.value,"home-code":D.value,"away-code":N.value,"home-logo":L.value,"away-logo":$.value,"is-playoffs":g.value,"default-orientation":k.value},null,8,["events","home-code","away-code","home-logo","away-logo","is-playoffs","default-orientation"])):Q("",!0)],64)):(v(),_("div",Ha,r(n.$t("shot_plot.no_data")),1))],512))}}),Ba=$e(Aa,[["__scopeId","data-v-7b3a1be0"]]);export{Ba as default};
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.