Vue.component('target',{template:` `,props:{svgid:String,shots:Array,practice:{type:Boolean,default:!1},type:{type:String,default:"a10"},average:{type:Number,default:10},secondary:{type:Boolean,default:!1},lane:{type:Number,default:0},name:{type:String,default:""},team:{type:String,default:""},showall:{type:Boolean,default:!1}},data:()=>({internalshots:[],hl:void 0,s:void 0,pr:void 0,mi:void 0,mil:void 0,mic:void 0,mit:void 0,tbb:void 0,tbl:void 0,tbn:void 0,tbt:void 0,defaultZoom:"-25,-25,50,50",defaultBorder:5,shotSize:4.5,zoomSize:0,centerX:0,centerY:0}),watch:{shots:function(e,t){if(e.length===0&&this.calculateZoom(!1),e!=null&&t!=null&&e.length===t.length){let n=!0;for(let s=0;s0)for(let e=0;e99?.6:.75)),e.Index).attr({"font-size":e.Index>99?"2.2px":"3px","text-anchor":"middle",fill:"#ddd"});e.svgText=n;let s=this.s.text(e.X,-(e.Y-1.75),this.secondary?Math.floor(e.Score).toFixed():e.Score.toFixed(1)).attr({"font-size":"1px","text-anchor":"middle",fill:"#fff"});if(e.svgTextScore=s,e.Practice){let t=this.s.path("M "+(e.X+this.shotSize*.5)+" "+-e.Y+" A "+this.shotSize*.5+" "+this.shotSize*.5+" 0 0 0 "+e.X+" "+-(e.Y+this.shotSize*.5)+" L "+(e.X+this.shotSize*.5)+" "+-e.Y);t.attr({fill:e.InnerTen?"#ffd700":"#000",stroke:e.InnerTen?"#ffd700":"#000",strokeWidth:.01}),e.svgPractice=t}this.internalshots.length>0&&(this.internalshots[this.internalshots.length-1].svg.attr({fill:"#0064aa",stroke:this.internalshots[this.internalshots.length-1].InnerTen?"#cca400":"#333",strokeWidth:.25,fillOpacity:"0.7"}),this.internalshots[this.internalshots.length-1].Practice&&this.internalshots[this.internalshots.length-1].svgPractice.attr({fill:this.internalshots[this.internalshots.length-1].InnerTen?"#cca400":"#333",stroke:this.internalshots[this.internalshots.length-1].InnerTen?"#cca400":"#333",strokeWidth:.01})),this.internalshots.push(e)},redrawShots:function(e){if(this.internalshots.forEach(e=>{e.svg.remove(),e.svgPractice!==void 0&&e.svgPractice.remove(),e.svgText.remove(),e.svgTextScore.remove()}),this.removeOverlays(),this.internalshots=[],e.length>0){let t=!1;!this.showall&&!e[e.length-1].Practice&&(t=!0);for(let n=0;n0;t*=.95)if(this.tbn.attr({"font-size":t*e+"px"}),n=this.tbn.getBBox(),n.width0;t*=.95)if(this.tbl.attr({"font-size":t*e+"px"}),n=this.tbl.getBBox(),n.width0;t*=.95)if(this.tbt.attr({"font-size":t*e+"px"}),n=this.tbt.getBBox(),n.widtha&&(a=this.internalshots[e].X),-this.internalshots[e].Yr&&(r=-this.internalshots[e].Y)),e>=this.internalshots.length-this.average&&(t.X+=this.internalshots[e].X,t.Y+=-this.internalshots[e].Y,c++);c>0&&(t.X/=c,t.Y/=c),o-=this.defaultBorder,a+=this.defaultBorder,i-=this.defaultBorder,r+=this.defaultBorder;let n=(o+a)*.5,s=(i+r)*.5,e=Math.max(a-o,r-i);if(l&&d==mina.elastic&&this.zoomSize==e&&(e*=1.1),this.zoomSize=e,this.centerX=n,this.centerY=s,this.removeOverlays(),this.practice&&(this.pr=this.s.path("M "+(n+e*.5)+" "+(s-e*.5)+" L "+(n+e*.25)+" "+(s-e*.5)+" L "+(n+e*.5)+" "+(s-e*.25)+" Z"),this.pr.attr({fill:"#000",opacity:"0.8"})),c>0){this.mil=this.s.polyline(t.X,t.Y,0,t.Y,0,0),this.mil.attr({stroke:"#0f0",fill:"none",strokeWidth:e*.01,display:'',opacity:"0.6"}),this.mic=this.s.circle(0,0,e*.015),this.mic.attr({fill:"#a00",stroke:"#a00",strokeWidth:.01,display:'',opacity:"1"}),this.mi=this.s.circle(t.X,t.Y,e*.025),this.mi.attr({fill:"#0f0",stroke:"#0f0",strokeWidth:.01,display:'',opacity:"1"});let o=(t.X<0?"◀":"▶")+Math.abs(t.X).toFixed(2)+(t.Y<0?"▲":"▼")+Math.abs(t.Y).toFixed(2);this.mit=this.s.text(n-e*.48,s-e*.44,o).attr({"font-size":.07*e+"px","font-weight":"bold","text-anchor":"start",fill:"#0f0"})}l?this.s.animate({viewBox:n-e*.5+" "+(s-e*.5)+" "+e+" "+e},900,d):this.s.attr({viewBox:n-e*.5+","+(s-e*.5)+","+e+","+e})},initA10:function(){this.s.circle(0,0,22.75).attr({fill:"#fff",stroke:"#000",strokeWidth:.1}),this.s.circle(0,0,20.25).attr({fill:"#fff",stroke:"#000",strokeWidth:.1}),this.s.circle(0,0,17.75).attr({fill:"#fff",stroke:"#000",strokeWidth:.1}),this.s.circle(0,0,15.25).attr({fill:"#aaa",stroke:"#000",strokeWidth:.1}),this.s.circle(0,0,12.75).attr({fill:"#aaa",stroke:"#000",strokeWidth:.1}),this.s.circle(0,0,10.25).attr({fill:"#aaa",stroke:"#000",strokeWidth:.1}),this.s.circle(0,0,7.75).attr({fill:"#aaa",stroke:"#000",strokeWidth:.1}),this.s.circle(0,0,5.25).attr({fill:"#aaa",stroke:"#000",strokeWidth:.1}),this.s.circle(0,0,2.75).attr({fill:"#aaa",stroke:"#000",strokeWidth:.1}),this.s.circle(0,0,.25).attr({fill:"#fff",stroke:"#fff",strokeWidth:.1});for(let e=1;e<9;e++)this.s.text(0,-23.2+e*2.5,e).attr({"font-size":"2px","text-anchor":"middle"}),this.s.text(0,24.8-e*2.5,e).attr({"font-size":"2px","text-anchor":"middle"}),this.s.text(-24+e*2.5,.8,e).attr({"font-size":"2px","text-anchor":"middle"}),this.s.text(24-e*2.5,.8,e).attr({"font-size":"2px","text-anchor":"middle"});this.defaultZoom="-25,-25,50,50",this.shotSize=4.5},initAP10:function(){this.s.circle(0,0,77.75).attr({fill:"#fff",stroke:"#000",strokeWidth:.1}),this.s.circle(0,0,69.75).attr({fill:"#fff",stroke:"#000",strokeWidth:.1}),this.s.circle(0,0,61.75).attr({fill:"#fff",stroke:"#000",strokeWidth:.1}),this.s.circle(0,0,53.75).attr({fill:"#fff",stroke:"#000",strokeWidth:.1}),this.s.circle(0,0,45.75).attr({fill:"#fff",stroke:"#000",strokeWidth:.1}),this.s.circle(0,0,37.75).attr({fill:"#fff",stroke:"#000",strokeWidth:.1}),this.s.circle(0,0,29.75).attr({fill:"#aaa",stroke:"#000",strokeWidth:.1}),this.s.circle(0,0,21.75).attr({fill:"#aaa",stroke:"#000",strokeWidth:.1}),this.s.circle(0,0,13.75).attr({fill:"#aaa",stroke:"#000",strokeWidth:.1}),this.s.circle(0,0,5.75).attr({fill:"#aaa",stroke:"#000",strokeWidth:.1}),this.s.circle(0,0,2.5).attr({fill:"#aaa",stroke:"#000",strokeWidth:.1});for(let e=1;e<9;e++)this.s.text(0,-79.2+e*8,e).attr({"font-size":"6px","text-anchor":"middle"}),this.s.text(0,84.2-e*8,e).attr({"font-size":"6px","text-anchor":"middle"}),this.s.text(-81.5+e*8,2.5,e).attr({"font-size":"6px","text-anchor":"middle"}),this.s.text(81.5-e*8,2.5,e).attr({"font-size":"6px","text-anchor":"middle"});this.defaultZoom="-85,-85,170,170",this.shotSize=4.5},initR50:function(){this.s.circle(0,0,77.2).attr({fill:"#fff",stroke:"#000",strokeWidth:.2}),this.s.circle(0,0,69.2).attr({fill:"#fff",stroke:"#000",strokeWidth:.2}),this.s.circle(0,0,61.2).attr({fill:"#fff",stroke:"#000",strokeWidth:.2}),this.s.circle(0,0,56.2).attr({fill:"#aaa",stroke:"#aaa",strokeWidth:.2}),this.s.circle(0,0,53.2).attr({fill:"#aaa",stroke:"#000",strokeWidth:.2}),this.s.circle(0,0,45.2).attr({fill:"#aaa",stroke:"#000",strokeWidth:.2}),this.s.circle(0,0,37.2).attr({fill:"#aaa",stroke:"#000",strokeWidth:.2}),this.s.circle(0,0,29.2).attr({fill:"#aaa",stroke:"#000",strokeWidth:.2}),this.s.circle(0,0,21.2).attr({fill:"#aaa",stroke:"#000",strokeWidth:.2}),this.s.circle(0,0,13.2).attr({fill:"#aaa",stroke:"#000",strokeWidth:.2}),this.s.circle(0,0,5.2).attr({fill:"#aaa",stroke:"#000",strokeWidth:.2}),this.s.circle(0,0,2.5).attr({fill:"#aaa",stroke:"#000",strokeWidth:.2});for(let e=1;e<9;e++)this.s.text(0,-79.2+e*8,e).attr({"font-size":"6px","text-anchor":"middle"}),this.s.text(0,82.8-e*8,e).attr({"font-size":"6px","text-anchor":"middle"}),this.s.text(-81+e*8,1.8,e).attr({"font-size":"6px","text-anchor":"middle"}),this.s.text(81-e*8,1.8,e).attr({"font-size":"6px","text-anchor":"middle"});this.defaultZoom="-85,-85,170,170",this.shotSize=5.6},initR300:function(){this.s.circle(0,0,500).attr({fill:"#fff",stroke:"#000",strokeWidth:.5}),this.s.circle(0,0,450).attr({fill:"#fff",stroke:"#000",strokeWidth:.5}),this.s.circle(0,0,400).attr({fill:"#fff",stroke:"#000",strokeWidth:.5}),this.s.circle(0,0,350).attr({fill:"#fff",stroke:"#000",strokeWidth:.5}),this.s.circle(0,0,300).attr({fill:"#aaa",stroke:"#000",strokeWidth:.5}),this.s.circle(0,0,250).attr({fill:"#aaa",stroke:"#000",strokeWidth:.5}),this.s.circle(0,0,200).attr({fill:"#aaa",stroke:"#000",strokeWidth:.5}),this.s.circle(0,0,150).attr({fill:"#aaa",stroke:"#000",strokeWidth:.5}),this.s.circle(0,0,100).attr({fill:"#aaa",stroke:"#000",strokeWidth:.5}),this.s.circle(0,0,50).attr({fill:"#aaa",stroke:"#000",strokeWidth:.5}),this.s.circle(0,0,25).attr({fill:"#aaa",stroke:"#000",strokeWidth:.5});for(let e=1;e<=9;e++)this.s.text(0,-15-e*50,10-e).attr({"font-size":"32px","text-anchor":"middle",transform:"rotate(-45)"}),this.s.text(0,-15-e*50,10-e).attr({"font-size":"32px","text-anchor":"middle",transform:"rotate(45)"}),this.s.text(0,-15-e*50,10-e).attr({"font-size":"32px","text-anchor":"middle",transform:"rotate(-135)"}),this.s.text(0,-15-e*50,10-e).attr({"font-size":"32px","text-anchor":"middle",transform:"rotate(135)"});this.defaultZoom="-550,-550,1100,1100",this.shotSize=6.5,this.defaultBorder=20}}}),Vue.component('targetheader',{template:` `,props:{svgid:String,lane:{type:Number,default:1},name:{type:String,default:""},team:{type:String,default:""},group:{type:String,default:""},average:{type:Number,default:0},innertens:{type:Number,default:0},score:{type:Number,default:0},secondary:{type:Boolean,default:!1}},data:()=>({s:void 0,dlaneBackground:void 0,dlane:void 0,dname:void 0,dgroup:void 0,daverage:void 0,dinnerTens:void 0,dscoreBackground:void 0,dscore:void 0}),watch:{name:function(){this.redraw()},lane:function(){this.redraw()},group:function(){this.redraw()},team:function(){this.redraw()},average:function(){this.redraw()},innertens:function(){this.redraw()},score:function(){this.redraw()},secondary:function(){this.redraw()}},mounted:function(){this.s=Snap("#"+this.svgid),this.dlaneBackground=this.s.circle(-10,-10,6),this.dlaneBackground.attr({fill:"#0064aa",stroke:"#0064aa",strokeWidth:0}),this.dlane=this.s.text(-10,-10,this.lane),this.dname=this.s.text(-10,-10,this.name),this.dteam=this.s.text(-10,-10,this.team),this.dgroup=this.s.text(-10,-10,this.group),this.daverage=this.s.text(-10,-10,this.average),this.dinnerTens=this.s.text(-10,-10,"★ "+this.innertens),this.dscoreBackground=this.s.rect(-10,-10,10,5),this.dscore=this.s.text(-10,-10,this.score),this.redraw(),this.s.attr({viewBox:"0,0,100,20"})},methods:{redraw:function(){this.dlane.attr({text:this.lane}),this.dname.attr({text:this.name}),this.dteam.attr({text:this.team}),this.dgroup.attr({text:this.group}),this.daverage.attr({text:this.average}),this.dinnerTens.attr({text:"★ "+this.innertens}),this.dscore.attr({text:this.score}),this.score==0?(this.dlaneBackground.attr({cx:7,cy:7}),this.dlane.attr({x:7,y:this.lane<10?10.5:9.5,"text-anchor":"middle",fill:"#fff","font-size":this.lane<10?"10":"8","font-weight":"bold"}),this.dname.attr({x:13.5,y:9.5,fill:"#000","font-size":"8"}),this.dteam.attr({x:13.5,y:18,fill:"#000","font-size":"6"}),this.dgroup.attr({x:98.5,y:18,fill:"#000","font-size":"6","text-anchor":"end"}),this.daverage.attr({x:-10,y:-10}),this.dinnerTens.attr({x:-10,y:-10}),this.dscoreBackground.attr({x:-73.5,y:12}),this.dscore.attr({x:-10,y:-10})):(this.dlaneBackground.attr({cx:2,cy:2}),this.dlane.attr({x:this.lane<10?3.5:3,y:this.lane<10?5.5:5,"text-anchor":"middle",fill:"#fff","font-size":this.lane<10?"6":"5","font-weight":"bold"}),this.dname.attr({x:10,y:5.5,fill:"#000","font-size":"6"}),this.dteam.attr({x:10,y:11,fill:"#000","font-size":"5"}),this.dgroup.attr({x:98.5,y:11,fill:"#000","font-size":"5","text-anchor":"end"}),this.daverage.attr({x:10,y:19,fill:"#000","font-size":"5"}),this.dinnerTens.attr({x:50,y:19,fill:"#000","font-size":"5","text-anchor":"middle"}),this.dscoreBackground.attr({x:73.5,y:12,width:25,height:8,rx:3,fill:"#000"}),this.dscore.attr({x:86,y:18.5,fill:"#fff","font-size":"7","text-anchor":"middle","font-weight":"bold"}))}}}),Vue.component('targetfooter',{template:` `,props:{svgid:String,shots:Array,matchshotsgrouped:Array,usesecondary:{type:Boolean,default:!1}},data:()=>({s:void 0,dscore:Array(),dscoreRectangle:Array(),dpractice:Array(),dgroupScore:Array(),dgroupScoreRectangle:Array(),dredrect:void 0}),watch:{shots:function(){this.redraw()},matchshotsgrouped:function(){this.redraw()},usesecondary:function(){this.redraw()}},mounted:function(){this.s=Snap("#"+this.svgid),this.dredrect=this.s.rect(-10,-10,5,5),this.dredrect.attr({stroke:"red","stroke-width":"1px",rx:"2"}),this.redraw()},methods:{redraw:function(){if(this.shots.length==0){this.s.attr({viewBox:"0,0,100,1"});return}for(let e=0;e3&&(t=0,e+=8);if(this.matchshotsgrouped.length `,props:{svgid:String,shots:Array},data:()=>({internalshots:[],s:void 0,medLine:null,sparkLine:null,sparkLineFill:null,tts:[]}),watch:{shots:function(){this.internalshots.forEach(e=>{e.svg.remove(),e.svgText.remove(),e.svgLine.remove()}),this.tts.forEach(e=>{e.remove()}),this.medLine!=null&&this.medLine.remove(),this.sparkLine!=null&&this.sparkLine.remove(),this.sparkLineFill!=null&&this.sparkLineFill.remove(),this.internalshots=[],this.draw()}},mounted:function(){this.s=Snap("#"+this.svgid);let e=this.s.line(0,55,200,55);e.attr({stroke:"#000",strokeWidth:.25});for(let t=0;t<=200;t+=20)e=this.s.line(t,55,t,57),e.attr({stroke:"#000",strokeWidth:.25});let t=this.s.gradient("L(0,0,0,45)#0e0-#f00");this.s.line(202,0,202,45).attr({stroke:t,strokeWidth:1}),this.draw()},methods:{getGradientColor:function(e){let t=Math.round(255+e*(0-255)).toString(16),n=Math.round(0+e*238).toString(16),s="00";return"#"+(t.length==1?"0":"")+t+(n.length==1?"0":"")+n+s},draw:function(){let e=this.shots;if(e.length<1)return;let s=-1,o=-1,n=-1,r=-1,d=[];for(let t=0;ts)&&(s=e[t].Score),(o==-1||e[t].Scorer)&&(r=e[t].SinceLastRaw),d.push(e[t].SinceLastRaw)}d.sort();let a=d[Math.floor(d.length/2)-1];n*=.9,r*=1.05;let c=200/(r-n),u=45/(o-s),l=[[],[],[],[],[],[],[],[],[],[],[],[]];for(let t=0;t0){let n=0;l[e].forEach(function(e){n+=e}),t.push({X:20*e+10,Y:(n/l[e].length-s)*u})}for(let e=0;e `,props:{svgid:String,data:Array,buckets:{type:Number,default:30}},data:()=>({colors:{a10:"#0064aa",r50:"#aa6400"}}),watch:{data:function(){this.draw()}},mounted:function(){this.s=Snap("#"+this.svgid),this.draw()},methods:{getVals:function(t,n){let e=[];return t.forEach(t=>{e.push(t[n])}),e},draw:function(){this.s.clear();let c=this.data;if(c===void 0||c.length<1)return;let i=[];c.forEach(e=>{e.Average!==void 0&&e.Average>0&&i.push({Average:e.Average,Time:new Date(e.Start),Track:e.Track})});let a=i.length50;)o+=.5;for(;o<=e;o+=.5)this.s.line(-5,(e-o)*s,205,(e-o)*s).attr({stroke:"#000",strokeWidth:.25,strokeDasharray:"2,2"}),o<10.9&&this.s.text(-6,(e-o)*s+1.2,o.toFixed(1)).attr({"font-size":"2.8px","text-anchor":"end"});let l=Math.floor(30/t);l<2&&(l=2);for(let e=0;e<=a;e++)this.s.line(e*t,50,e*t,52).attr({stroke:"#000",strokeWidth:.25}),e%l==1&&(this.s.line(e*t,0,e*t,50).attr({stroke:"#555",strokeWidth:.25,strokeDasharray:"2,2"}),this.s.text(e*t,53,new Date(r+f*e).toLocaleDateString()).attr({"font-size":"2.8px","text-anchor":"end",transform:"rotate(-45,"+e*t+",53)"}));this.s.line(-5,50,205,50).attr({stroke:"#000",strokeWidth:.25}),this.s.line(-5,0,-5,50).attr({stroke:"#000",strokeWidth:.25});let p=(u-r)/a,n=[];i.forEach(e=>{let t=Math.floor((e.Time-r)/p);n[e.Track]===void 0&&(n[e.Track]=[]),n[e.Track][t]===void 0&&(n[e.Track][t]={data:[]}),n[e.Track][t].data.push(e)}),Object.keys(n).forEach(o=>{for(let i=0;ie+t,0)/a.length)*s,c,(e-r.reduce((e,t)=>e+t,0)/r.length)*s).attr({stroke:this.colors[o],strokeWidth:1,strokeLinecap:"round"})}})}}}),Vue.component('badge',{template:` `,props:{svgid:String,data:Object,done:Boolean},data:()=>({s:null}),watch:{data:function(){this.draw()}},mounted:function(){this.s=Snap("#"+this.svgid),this.draw()},methods:{getColor:function(i){let[t,n,s,o]=i.match(/\w\w/g).map(e=>parseInt(e,16));if(this.done)return"rgb("+t+","+n+","+s+","+o/255+")";let e=0;return e+=t*.89,e+=n*1.77,e+=s*.33,e=Math.ceil(e/3),"rgb("+e+","+e+","+e+","+o/255+")"},star:function(t,n,e,o){let s="M "+t+" "+(n-e)+" ";s+="L "+(t+.59*e)+" "+(n+.81*e)+" ",s+="L "+(t-.95*e)+" "+(n-.31*e)+" ",s+="L "+(t+.95*e)+" "+(n-.31*e)+" ",s+="L "+(t-.59*e)+" "+(n+.81*e)+" ",s+="L "+t+" "+(n-e),this.s.path(s).attr({fill:this.getColor(o)})},target:function(t,n,e,o){this.s.circle(t,n,e).attr({strokeWidth:1,stroke:this.getColor(o),fill:"none"}),this.s.circle(t,n,e*.7).attr({strokeWidth:1,stroke:this.getColor(o),fill:"none"});let s="M "+t+" "+(n-.4*e);s+=" A "+.4*e+" "+.4*e+" 0 1 0 "+t+" "+(n+.4*e),s+=" A "+.4*e+" "+.4*e+" 0 1 0 "+t+" "+(n-.4*e),s+=" Z ",s+="M "+t+" "+(n-.1*e),s+=" A "+.1*e+" "+.1*e+" 0 1 1 "+t+" "+(n+.1*e),s+=" A "+.1*e+" "+.1*e+" 0 1 1 "+t+" "+(n-.1*e),s+=" Z",this.s.path(s).attr({strokeWidth:0,fill:this.getColor(o)})},crown:function(t,n,e,o){let s="M "+t+" "+(n-.6*e);s+=" L "+(t-.4*e)+" "+(n-.1*e),s+=" L "+(t-.2*e)+" "+(n+.15*e),s+=" L "+(t-.7*e)+" "+(n+.15*e),s+=" L "+(t-.6*e)+" "+(n-.1*e),s+=" L "+(t-1*e)+" "+(n-.5*e),s+=" L "+(t-.8*e)+" "+(n+.7*e),s+=" L "+(t+.8*e)+" "+(n+.7*e),s+=" L "+(t+1*e)+" "+(n-.5*e),s+=" L "+(t+.6*e)+" "+(n-.1*e),s+=" L "+(t+.7*e)+" "+(n+.15*e),s+=" L "+(t+.2*e)+" "+(n+.15*e),s+=" L "+(t+.4*e)+" "+(n-.1*e),this.s.path(s).attr({strokeWidth:0,fill:this.getColor(o)})},rifle:function(t,n,e,i,a=!0){let s=a?1:-1,o=' M '+(t+s*(.897870978069473*e))+' '+(n+-1*e);o+=' L '+(t+s*(1*e))+' '+(n+-.914437370300832*e),o+=' L '+(t+s*(.446808152123545*e))+' '+(n+-.447414486779508*e),o+=' L '+(t+s*(.476599293976898*e))+' '+(n+-.383246043734206*e),o+=' L '+(t+s*(.161702880540554*e))+' '+(n+-.0481316261275886*e),o+=' L '+(t+s*(-.174466902007701*e))+' '+(n+.254902099185454*e),o+=' L '+(t+s*(-.229786086795346*e))+' '+(n+.251330519361351*e),o+=' L '+(t+s*(-.255322554826317*e))+' '+(n+.265595663283313*e),o+=' L '+(t+s*(-.246804782084874*e))+' '+(n+.294111834210935*e),o+=' L '+(t+s*(-.2170220653282*e))+' '+(n+.315506020864803*e),o+=' L '+(t+s*(-.276595923938227*e))+' '+(n+.301247935400991*e),o+=' L '+(t+s*(-.293614619227756*e))+' '+(n+.286982791479029*e),o+=' L '+(t+s*(-.327660434903491*e))+' '+(n+.336893149060519*e),o+=' L '+(t+s*(-.331915108725873*e))+' '+(n+.429584821491594*e),o+=' L '+(t+s*(-.263831902471081*e))+' '+(n+.497324844360998*e),o+=' L '+(t+s*(-.459572173590692*e))+' '+(n+.57575137287011*e),o+=' L '+(t+s*(-.668084891274128*e))+' '+(n+.95008258396036*e),o+=' L '+(t+s*(-.731913423706537*e))+' '+(n+1*e),o+=' L '+(t+s*(-1*e))+' '+(n+.764699239098212*e),o+=' L '+(t+s*(-.582974564633129*e))+' '+(n+.422455778759688*e),o+=' L '+(t+s*(-.510636684555955*e))+' '+(n+.436713864223499*e),o+=' L '+(t+s*(-.468081521235456*e))+' '+(n+.393939607832065*e),o+=' L '+(t+s*(-.446808152123546*e))+' '+(n+.283418270113076*e),o+=' L '+(t+s*(-.472336195057838*e))+' '+(n+.304812456766944*e),o+=' L '+(t+s*(-.510636684555955*e))+' '+(n+.276289227381171*e),o+=' L '+(t+s*(-.442553478301164*e))+' '+(n+.219249827067776*e),o+=' L '+(t+s*(-.502127336911191*e))+' '+(n+.172903990852238*e),o+=' L '+(t+s*(-.399998314980664*e))+' '+(n+.140816240100513*e),o+=' L '+(t+s*(-.36595249930493*e))+' '+(n+.172903990852238*e),o+=' L '+(t+s*(.889361630424709*e))+' '+(n+-.878792156641303*e),o+=' L '+(t+s*(.868088261312798*e))+' '+(n+-.90017928483702*e),o+=' L '+(t+s*(.837311383148122*e))+' '+(n+-.878573344438641*e),o+=' L '+(t+s*(.804251303783711*e))+' '+(n+-.921573471490887*e),this.s.path(o).attr({strokeWidth:0,fill:this.getColor(i)})},path:function(e,t){this.s.path(e).attr({strokeWidth:0,fill:this.getColor(t)})},line:function(e,t,n,s,o,i){this.s.line(e,t,n,s).attr({strokeWidth:o,stroke:this.getColor(i)})},circle:function(e,t,n,s){this.s.circle(e,t,n).attr({strokeWidth:0,fill:this.getColor(s),stroke:"none"})},rectangle:function(e,t,n,s,o){this.s.rect(e,t,n,s).attr({strokeWidth:0,fill:this.getColor(o),stroke:"none"})},draw:function(){this.s!==null&&this.s.clear();let e=this.data;if(e===void 0)return;(!e.base.top||!e.base.bottom)&&this.s.circle(50,50,40).attr({strokeWidth:5,stroke:this.getColor(e.base.color),fill:this.getColor(e.base.fill)}),e.base.top&&this.s.path("M 10 51 L 10 5 L 90 5 L 90 51").attr({strokeWidth:5,stroke:this.getColor(e.base.color),fill:this.getColor(e.base.fill)}),e.base.bottom&&this.s.path("M 10 49 L 10 95 L 90 95 L 90 49").attr({strokeWidth:5,stroke:this.getColor(e.base.color),fill:this.getColor(e.base.fill)}),e.items.forEach(e=>{e.text!==void 0?this.s.text(e.text.x,e.text.y,e.text.data).attr({fontSize:e.text.size,textAnchor:"middle",fill:this.getColor(e.text.color),fontWeight:e.text.bold!==void 0&&e.text.bold==!0?"bold":""}):e.star!==void 0?this.star(e.star.x,e.star.y,e.star.size,e.star.color):e.target!==void 0?this.target(e.target.x,e.target.y,e.target.size,e.target.color):e.crowns!==void 0?(this.crown(e.crowns.x,e.crowns.y+e.crowns.size*.4,e.crowns.size*.45,e.crowns.color),this.crown(e.crowns.x-e.crowns.size*.55,e.crowns.y-e.crowns.size*.5,e.crowns.size*.45,e.crowns.color),this.crown(e.crowns.x+e.crowns.size*.55,e.crowns.y-e.crowns.size*.5,e.crowns.size*.45,e.crowns.color)):e.crown!==void 0?this.crown(e.crown.x,e.crown.y,e.crown.size,e.crown.color):e.rifle!==void 0?this.rifle(e.rifle.x,e.rifle.y,e.rifle.size,e.rifle.color,e.rifle.left===void 0||e.rifle.left===!1):e.path!==void 0?this.path(e.path.data,e.path.color):e.line!==void 0?this.line(e.line.x1,e.line.y1,e.line.x2,e.line.y2,e.line.size,e.line.color):e.circle!==void 0?this.circle(e.circle.x,e.circle.y,e.circle.size,e.circle.color):e.rectangle!==void 0&&this.rectangle(e.rectangle.x,e.rectangle.y,e.rectangle.width,e.rectangle.height,e.rectangle.color)}),this.done||this.s.rect(0,0,100,100).attr({fill:"#555555",fillOpacity:"0.3"})}}}),Vue.component('confirmdlg',{template:` {{title}} Avbryt OK `,data:function(){return{dialog:!1,resolve:null,reject:null,message:null,title:null,options:{noconfirm:!1}}},methods:{open(e,t,n){return this.dialog=!0,this.title=e,this.message=t,this.options=Object.assign(this.options,n),new Promise((e,t)=>{this.resolve=e,this.reject=t})},agree(){this.resolve(!0),this.dialog=!1},cancel(){this.resolve(!1),this.dialog=!1}}}),function(h){'use strict';var x='Compound',P='Identifier',O='MemberExpression',j='Literal',R='ThisExpression',L='CallExpression',N='UnaryExpression',D='BinaryExpression',z='LogicalExpression',C='ConditionalExpression',F='ArrayExpression',r=46,w=44,M=39,S=34,g=40,f=41,v=91,b=93,A=63,k=59,E=58,t=function(t,n){var e=new Error(t+' at character '+n);throw e.index=n,e.description=t,e},s=!0,o={'-':s,'!':s,'~':s,'+':s},n={'||':1,'&&':2,'|':3,'^':4,'&':5,'==':6,'!=':6,'===':6,'!==':6,'<':7,'>':7,'<=':7,'>=':7,'<<':8,'>>':8,'>>>':8,'+':9,'-':9,'*':10,'/':10,'%':10},m={$:s,_:s},u=function(t){var e=0,n,s;for(s in t)(n=s.length)>e&&t.hasOwnProperty(s)&&(e=n);return e},i=u(o),a=u(n),c={true:!0,false:!1,null:null},T='this',y=function(e){return n[e]||0},_=function(e,t,n){var s=e==='||'||e==='&&'?z:D;return{type:s,operator:e,left:t,right:n}},d=function(e){return e>=48&&e<=57},l=function(e){return e>=65&&e<=90||e>=97&&e<=122||e>=128&&!n[String.fromCharCode(e)]||m.hasOwnProperty(String.fromCharCode(e))},p=function(e){return e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e>=128&&!n[String.fromCharCode(e)]||m.hasOwnProperty(String.fromCharCode(e))},e=function(m){for(var e=0,Z=m.charAt,Q=m.charCodeAt,u=function(e){return Z.call(m,e)},s=function(e){return Q.call(m,e)},D=m.length,h=function(){for(var t=s(e);t===32||t===9||t===10||t===13;)t=s(++e)},z=function(){var i=K(),n,o;if(h(),s(e)===A){if(e++,n=z(),n||t('Expected expression',e),h(),s(e)===E)return e++,o=z(),o||t('Expected expression',e),{type:C,test:i,consequent:n,alternate:o};t('Expected :',e)}else return i},W=function(){h();for(var i,t=m.substr(e,a),o=t.length;o>0;){if(n.hasOwnProperty(t)&&(!l(s(e))||e+t.length2&&c<=n[n.length-2].prec;)r=n.pop(),s=n.pop().value,a=n.pop(),o=_(s,a,r),n.push(o);o=H(),o||t("Expected expression after "+d,e),n.push(l,o)}for(i=n.length-1,o=n[i];i>1;)o=_(n[i-1].value,n[i-2],o),i-=2;return o},H=function(){if(h(),n=s(e),d(n)||n===r)return q();if(n===M||n===S)a=Y();else if(n===v)a=X();else{c=m.substr(e,i),u=c.length;for(var n,c,u,a;u>0;){if(o.hasOwnProperty(c)&&(!l(s(e))||e+c.length=o.length&&t('Unexpected token '+String.fromCharCode(n),e);break}if(r===w){if(e++,i++,i!==o.length)if(n===f)t('Unexpected token ,',e);else if(n===b)for(l=o.length;l',e.toString=function(){return'JavaScript Expression Parser (JSEP) v'+e.version},e.addUnaryOp=function(e){return i=Math.max(e.length,i),o[e]=s,this},e.addBinaryOp=function(e,t){return a=Math.max(e.length,a),n[e]=t,this},e.addIdentifierChar=function(e){return m[e]=s,this},e.addLiteral=function(e,t){return c[e]=t,this},e.removeUnaryOp=function(e){return delete o[e],e.length===i&&(i=u(o)),this},e.removeAllUnaryOps=function(){return o={},i=0,this},e.removeIdentifierChar=function(e){return delete m[e],this},e.removeBinaryOp=function(e){return delete n[e],e.length===a&&(a=u(n)),this},e.removeAllBinaryOps=function(){return n={},a=0,this},e.removeLiteral=function(e){return delete c[e],this},e.removeAllLiterals=function(){return c={},this},typeof exports=='undefined'?(H=h.jsep,h.jsep=e,e.noConflict=function(){return h.jsep===e&&(h.jsep=H),e}):typeof module!='undefined'&&module.exports?exports=module.exports=e:exports.parse=e}(this),function(e){if(sortvalue=function(e,t){this.calcValue(e,t)},sortvalue.calcValue=function(t,e){switch(t.type){case"Literal":return t.value;break;case"UnaryExpression":if(t.operator=="-"){let n=sortvalue.calcValue(t.argument,e);if(n!=void 0)return-n}break;case"BinaryExpression":let n=sortvalue.calcValue(t.left,e),o=sortvalue.calcValue(t.right,e);switch(t.operator){case"+":return n+o;case"-":return n-o;case"*":return n*o;case"/":return n/o;case"%":return n%o}break;case"Identifier":switch(t.name){case"first":return e.MatchShots[0];case"innertens":return e.InnerTens;case"last":return e.MatchShots[e.MatchShots.length-1];case"score":return e.Score;case"secondaryscore":return e.SecondaryScore;case"shots":return e.MatchShots;case"start":return new Date(e.Start)/1e3;case"stop":return new Date(e.Stop)/1e3}break;case"ArrayExpression":let i=[];for(let n=0;ns&&n++;return n}break;case"below":if(e.MatchShots!==void 0){let s=sortvalue.calcValue(t.arguments[0],e),n=0;for(let t=0;tn.push(e)):n.push(s)}return Math.max(...n);case"min":let o=[];for(let s=0;so.push(e)):o.push(n)}return Math.min(...o);case"serie":if(t.arguments.length==1){let n=sortvalue.calcValue(t.arguments[0],e);if(e.MatchShotsGrouped!==void 0&&e.MatchShotsGrouped[n-1]!==void 0)return e.MatchShotsGrouped[n-1].Score}break;case"shot":let i=sortvalue.calcValue(t.arguments[0],e);if(e.MatchShots[s-1]!==void 0)return e.MatchShots[i-1];break}break}},sortvalue.parse=function(t,n){let s=jsep(t),e=sortvalue.calcValue(s,n);return e==void 0||isNaN(e)?void 0:e},sortvalue.test=function(e){try{let t=sortvalue.parse(e,{Score:189.1,SecondaryScore:180,Count:20,InnerTens:5,Average:9.455,SecondaryAverage:9,Lane:3,Start:"2022-06-21T14:52:56.343Z",Stop:"2022-06-21T15:09:27.94Z",MatchShots:[8.9,10.1,10.6,9.8,10.3,9.6,10.6,9.6,10.6,8.1,9,9,7.5,9.6,10.6,9.1,9.8,9.3,8.1,8.9],MatchShotsGrouped:[[8.9,10.1,10.6,9.8,10.3],[9.6,10.6,9.6,10.6,8.1],[9,9,7.5,9.6,10.6,9.1],[9.1,9.8,9.3,8.1,8.9]]});return t!="-"}catch(e){return!1}},typeof exports=='undefined'){var t=e.sortvalue;e.sortvalue=sortvalue,sortvalue.noConflict=function(){return e.sortvalue===sortvalue&&(e.sortvalue=t),sortvalue}}else typeof module!='undefined'&&module.exports?exports=module.exports=sortvalue:exports.parse=sortvalue}(this),Vue.component('stairline',{template:` `,props:{svgid:String,steps:Array,levels:Number},data:()=>({lines:[],s:void 0}),watch:{steps:function(){this.draw()},levels:function(){this.draw()}},mounted:function(){this.s=Snap("#"+this.svgid),this.draw()},methods:{clear:function(){for(let e=0;e0){let t=this.s.line(e*5,this.levels*5-this.steps[e-1]*5,e*5,this.levels*5-this.steps[e]*5);t.attr({stroke:"#0064aa",strokeWidth:1}),this.lines.push(t)}let t=this.s.line(e*5,this.levels*5-this.steps[e]*5,(e+1)*5,this.levels*5-this.steps[e]*5);t.attr({stroke:"#0064aa",strokeWidth:1}),this.lines.push(t)}this.s.attr({viewBox:"-5,0,"+(e+10)+","+(5+this.levels*5)})}}}),!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.printJS=e():t.printJS=e()}(window,function(){return function(n){var t={};function e(s){if(t[s])return t[s].exports;var o=t[s]={i:s,l:!1,exports:{}};return n[s].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=n,e.c=t,e.d=function(t,n,s){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:s})},e.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var s=Object.create(null),o;if(e.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(o in t)e.d(s,o,function(e){return t[e]}.bind(null,o));return s},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},e.p="",e(e.s=4)}([function(l,n,s){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var e,i=s(2),o=(e=i)&&e.__esModule?e:{default:e},a=s(1),r={send:function(e,s){document.getElementsByTagName("body")[0].appendChild(s);var n=document.getElementById(e.frameId);n.onload=function(){if("pdf"!==e.type){var s=n.contentWindow||n.contentDocument,o,i;s.document&&(s=s.document),s.body.appendChild(e.printableElement),"pdf"!==e.type&&e.style&&(o=document.createElement("style"),o.innerHTML=e.style,s.head.appendChild(o)),i=s.getElementsByTagName("img"),0'+t+""},e.capitalizePrint=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},e.collectStyles=t,e.loopNodesCollectStyles=function l(r,n){for(o=0;o]*>(.*?)").test(e)}},function(n,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t={isFirefox:function(){return"undefined"!=typeof InstallTrigger},isIE:function(){return-1!==navigator.userAgent.indexOf("MSIE")||!!document.documentMode},isEdge:function(){return!t.isIE()&&!!window.StyleMedia},isChrome:function(){return!!(0"+e.documentTitle+"",null!==e.css&&(Array.isArray(e.css)||(e.css=[e.css]),e.css.forEach(function(e){s.srcdoc+=''})),s.srcdoc+=""),e.type){case"pdf":if(n.default.isFirefox()||n.default.isEdge()||n.default.isIE())try{console.info("PrintJS currently doesn't support PDF printing in Firefox, Internet Explorer and Edge."),!0===e.onBrowserIncompatible()&&(window.open(e.fallbackPrintable,"_blank").focus(),e.onPdfOpen&&e.onPdfOpen())}catch(t){e.onError(t)}finally{e.showModal&&i.default.close(),e.onLoadingEnd&&e.onLoadingEnd()}else a.default.print(e,s);break;case"image":l.default.print(e,s);break;case"html":r.default.print(e,s);break;case"raw-html":c.default.print(e,s);break;case"json":d.default.print(e,s)}}}},function(r,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e,o=n(0),i=(e=o)&&e.__esModule?e:{default:e},a=n(1);function s(n,t,s){var e=new window.Blob([s],{type:"application/pdf"});e=window.URL.createObjectURL(e),t.setAttribute("src",e),i.default.send(n,t)}t.default={print:function(e,n){if(e.base64){var o=Uint8Array.from(atob(e.printable),function(e){return e.charCodeAt(0)}),t;s(e,n,o)}else e.printable=/^(blob|http)/i.test(e.printable)?e.printable:window.location.origin+("/"!==e.printable.charAt(0)?"/"+e.printable:e.printable),t=new window.XMLHttpRequest,t.responseType="arraybuffer",t.addEventListener("load",function(){if(-1===[200,201].indexOf(t.status))return(0,a.cleanUp)(e),void e.onError(t.statusText);s(e,n,t.response)}),t.open("GET",e.printable,!0),t.send()}}},function(a,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e,s=n(1),o=n(0),i=(e=o)&&e.__esModule?e:{default:e};t.default={print:function(e,n){var t=document.getElementById(e.printable);t?(e.printableElement=function l(e,o){var t=e.cloneNode(),r,s,c,d,n=!0,i=!1,a=void 0;try{for(s=e.childNodes[Symbol.iterator]();!(n=(r=s.next()).done);n=!0)c=r.value,-1===o.ignoreElements.indexOf(c.id)&&(d=l(c,o),t.appendChild(d))}catch(e){i=!0,a=e}finally{try{!n&&s.return&&s.return()}finally{if(i)throw a}}switch(e.tagName){case"SELECT":t.value=e.value;break;case"CANVAS":t.getContext("2d").drawImage(e,0,0)}return t}(t,e),e.header&&(0,s.addHeader)(e.printableElement,e),i.default.send(e,n)):window.console.error("Invalid HTML element id: "+e.printable)}}},function(i,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e,s=n(0),o=(e=s)&&e.__esModule?e:{default:e};t.default={print:function(e,t){e.printableElement=document.createElement("div"),e.printableElement.setAttribute("style","width:100%"),e.printableElement.innerHTML=e.printable,o.default.send(e,t)}}},function(a,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e,s=n(1),o=n(0),i=(e=o)&&e.__esModule?e:{default:e};t.default={print:function(e,t){e.printable.constructor!==Array&&(e.printable=[e.printable]),e.printableElement=document.createElement("div"),e.printable.forEach(function(s){var t=document.createElement("img"),n;t.setAttribute("style",e.imageStyle),t.src=s,n=document.createElement("div"),n.appendChild(t),e.printableElement.appendChild(n)}),e.header&&(0,s.addHeader)(e.printableElement,e),i.default.send(e,t)}}},function(r,n,s){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var e,t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=s(1),i=s(0),a=(e=i)&&e.__esModule?e:{default:e};n.default={print:function(e,n){if("object"!==t(e.printable))throw new Error("Invalid javascript data object (JSON).");if("boolean"!=typeof e.repeatTableHeader)throw new Error("Invalid value for repeatTableHeader attribute (JSON).");if(!e.properties||!Array.isArray(e.properties))throw new Error("Invalid properties array for your JSON data.");e.properties=e.properties.map(function(n){return{field:"object"===(void 0===n?"undefined":t(n))?n.field:n,displayName:"object"===(void 0===n?"undefined":t(n))?n.displayName:n,columnSize:"object"===(void 0===n?"undefined":t(n))&&n.columnSize?n.columnSize+";":100/e.properties.length+"%;"}}),e.printableElement=document.createElement("div"),e.header&&(0,o.addHeader)(e.printableElement,e),e.printableElement.innerHTML+=function(n){var d=n.printable,t=n.properties,e='',a,r,s,i,c,l;n.repeatTableHeader&&(e+=""),e+="";for(a=0;a'+(0,o.capitalizePrint)(t[a].displayName)+"";e+="",n.repeatTableHeader&&(e+=""),e+="";for(r=0;r";for(s=0;s'+i+""}e+=""}return e+="
"}(e),a.default.send(e,n)}}}]).default})