PageSourceSearch

https://axethrowing.org/assets/siteTournaments-CO6YaowD.js

js axethrowing.org collected 2026-09-24 11:39:08 UTC 11,011 bytes, 1 lines download raw bytes

1import{_ as e,d as t,w as a,r as n,e as l,g as s,t as o,q as u,z as r,f as i,x as c,n as d,a4 as m,F as p,v,aa as y,y as g,W as h,T as f,at as k,k as b,j as T,u as _,a3 as w,c as S,b9 as x,ba as j,M as C,N as E,m as U,a5 as I,bb as O,X as P,a6 as V,ar as A,o as F,ao as Y,a9 as D,b as z,Q as B,ai as M,h as N}from"./index-Ce7SucYs.js";import{F as q,C as H}from"./featuredEvents-BLAvz7M9.js";import{P as R,A as W,E as J}from"./index-CVbg0aVH.js";import{f as K}from"./dateTimeFormater-C88j8ARD.js";const X={class:"mb-5"},Q={class:"mb-5"},$={key:0,class:"mb-5"},G={key:1},L={class:"topThrowers"},Z={key:0,class:"throwersNumber"},ee=e({__name:"tournamentMapCard",props:{tournament:Object,isDialog:{type:Boolean,default:!1}},setup(e){const k=t(),b=e;return a(()=>b.tournament,async e=>{e.players=await async function(e,t){return await h(f("/venues/".concat(t,"/league/").concat(e,"/Session1/standings"))).then(e=>{if(!e.exists())return;let t=Object.values(e.val());return t.sort((e,t)=>t.win-e.win),t})}(e.slug,e.venue)},{immediate:!0}),(t,a)=>{var h,f;const T=n("v-icon"),_=n("v-img"),w=n("v-avatar"),S=n("v-tooltip");return s(),l("div",{class:g(["tournament",{dialog:e.isDialog}])},[o("p",{class:"tournamentTitle",onClick:a[0]||(a[0]=e=>{k.push({path:"/"+b.tournament.venue+"/tournament/view/"+b.tournament.slug,query:{tournamentStatus:"explore",tournamentVenue:b.tournament.venue,tournamentSlug:b.tournament.slug,tournamentId:b.tournament.id}})})},r(e.tournament.title),1),o("p",X,[i(T,{class:"tournamentIcon"},{default:d(()=>[...a[1]||(a[1]=[c("mdi-map-marker-outline",-1)])]),_:1}),c(" "+r(e.tournament.venueName),1)]),o("p",Q,[i(T,{class:"tournamentIcon"},{default:d(()=>[...a[2]||(a[2]=[c("mdi-calendar-month-outline",-1)])]),_:1}),c(" "+r(m(K)(e.tournament.dateStart))+" - "+r(m(K)(e.tournament.dateEnd)),1)]),e.tournament.price?(s(),l("p",$,[i(T,{class:"tournamentIcon"},{default:d(()=>[...a[3]||(a[3]=[c("mdi-cash-multiple",-1)])]),_:1}),c(" $ "+r(e.tournament.price),1)])):u("",!0),!e.tournament.players||e.isDialog||e.tournament.hideParticipants?u("",!0):(s(),l("div",G,[a[4]||(a[4]=o("p",{class:"tournamentPlayers"},"Attendees",-1)),o("div",L,[(s(!0),l(p,null,v(e.tournament.players.slice(0,3),(e,t)=>(s(),l("div",{key:t,class:"thrower"},[i(S,{location:"top"},{activator:d(({props:t})=>[i(w,y({ref_for:!0},t,{size:"40px",color:"#cbcbcb"}),{default:d(()=>[i(_,{src:e.pic,alt:""},null,8,["src"])]),_:2},1040)]),default:d(()=>[o("p",null,r(e.name||"".concat(e.first," ").concat(e.last)),1)]),_:2},1024)]))),128)),(null==(h=e.tournament.players)?void 0:h.length)>3?(s(),l("div",Z," +"+r((null==(f=e.tournament.players)?void 0:f.length)-3),1)):u("",!0)])]))],2)}}},[["__scopeId","data-v-26e060a1"]]),te={key:0,class:"tournamentMap"},ae={key:0,class:"tournamentCards"},ne={key:1,class:"tournamentCards"},le={key:1,class:"tournaments"},se={key:2,class:"w-100 text-center mt-5"},oe=e({__name:"siteTournamentMap",props:{secondaryTabs:Number},setup(e){const{mdAndUp:t}=k(),a=b(),n=T(),r=_();let c=w(null),y=w([]),g=w({});const h=S(()=>{var e,t;return{lat:null==(e=n.location)?void 0:e.lat,lng:null==(t=n.location)?void 0:t.lon}});let f=S(()=>Object.keys(r.venues).map(e=>{var t,a;return{id:e,...r.venues[e],distance:x(h.value.lat,h.value.lng,null==(t=r.venues[e].geocode)?void 0:t.lat,null==(a=r.venues[e].geocode)?void 0:a.lon)}}).sort((e,t)=>e.distance-t.distance));j(()=>{f.value.length&&f.value.forEach(e=>{const t=C("/venues/"+e.id+"/event-list/tournament");E(t,t=>{let n=t.val();if(n){let t=Object.keys(n).map(t=>({id:t,venue:e.id,venueName:e.company,geocode:e.geocode,...n[t]}));e.tournaments=t.filter(e=>e.dateStart>=a.dateToday&&!e.archive)}})})});let P=S(()=>{let e=[];return f.value.forEach(t=>{var a;(null==(a=t.tournaments)?void 0:a.length)>0&&e.push(t)}),e});return(a,r)=>Object.keys(m(n).location).length?(s(),l("div",te,[m(P).length&&1==e.secondaryTabs?(s(),l(p,{key:0},[m(y).length&&m(t)?(s(),l("div",ae,[(s(!0),l(p,null,v(m(y),e=>(s(),l(p,{key:e.id},[(s(!0),l(p,null,v(e.tournaments,e=>
1(s(),U(ee,{key:e.id,tournament:e},null,8,["tournament"]))),128))],64))),128))])):m(t)?(s(),l("div",ne,[...r[2]||(r[2]=[o("h3",{class:"ma-2"}," There are no tournaments around you. Please zoom out or move the map to explore more! ",-1)])])):u("",!0),i(m(J),{ref_key:"googleMap",ref:g,"api-key":m("AIzaSyAwpV6ag4hS-W5ae4bk_v31kO6f3575y9g"),style:{width:"100%",height:"500px"},center:h.value,zoom:5,onClick:r[0]||(r[0]=e=>I(c)?c.value=null:c=null),onBounds_changed:r[1]||(r[1]=e=>{y.value=P.value.filter(e=>g.value.map.getBounds().contains({lat:e.geocode.lat,lng:e.geocode.lon}))})},{default:d(()=>[(s(!0),l(p,null,v(m(P),e=>(s(),U(m(R),{key:e.id,options:{position:{lat:e.geocode.lat,lng:e.geocode.lon},label:"X",title:"".concat(e.company," - ").concat(e.tournaments.length," tournaments")},onClick:t=>function(e){c.value=e,event.stopPropagation()}(e)},null,8,["options","onClick"]))),128)),m(c)?(s(),U(m(W),{key:0,options:{position:{lat:m(c).geocode.lat,lng:m(c).geocode.lon}}},{default:d(()=>[(s(!0),l(p,null,v(m(c).tournaments,e=>
1(s(),U(ee,{key:e.id,tournament:e,isDialog:!0},null,8,["tournament"]))),128))]),_:1},8,["options"])):u("",!0)]),_:1},8,["api-key","center"])],64)):m(P).length&&0==e.secondaryTabs?(s(),l("div",le,[(s(!0),l(p,null,v(m(P),e=>(s(),l(p,{key:e.id},[(s(!0),l(p,null,v(e.tournaments,e=>(s(),U(O,{key:e.id,tournament:e,tournamentStatus:"explore"},null,8,["tournament"]))),128))],64))),128))])):(s(),l("p",se," There are no upcoming tournaments around you "))])):u("",!0)}},[["__scopeId","data-v-d8ee8c83"]]),ue={class:"tournamentsWrapper newContainer"},re={class:"filters"},ie={class:"disciplineFilters"},ce={class:"yearFilter"},de={class:"typeFilter"},me={class:"tabs"},pe={key:0,class:"secondaryTabs"},ve={class:"d-flex align-center justify-center"},ye={key:1,class:"tournaments"},ge={key:2,class:"mt-5"},he={key:3,class:"map"},fe=e({__name:"siteTournaments",setup(e){const y=_(),b=P(),x=T(),j=t(),C=z(),{mdAndUp:E}=k(),R=Y("postHog");let W=w([]),J=V(0);const K=A({discipline:"",tournamentType:"tournamentsUpcoming",selectedYear:""});let X=[{icon:"mdi-format-list-bulleted",value:"list"},{icon:"mdi-map-outline",value:"map"}];function Q(e){j.push("/"+y.venue.locationSlug+"/tournament/view/"+e.slug)}const $=S(()=>{const e="custom"!==y.venue.type?"wktl":"knifeThrowing",t="custom"!==y.venue.type?"watl":"axeThrowing";return[{title:"Hatchet",value:"".concat(t,"_standard-league"),disabled:!1},{title:"Big Axe",value:"".concat(t,"_big-axe-league"),disabled:!1},{title:"Hatchet Duals",value:"".concat(t,"_duals-league"),disabled:!1},{title:"Knife",value:"".concat(e,"_standard-league"),disabled:!1},{title:"Knife Duals",value:"".concat(e,"_duals-league"),disabled:!1}]}),G=S(()=>{let e=E.value?3:2;return y.featuredTournaments.slice(0,e)});let L=V(!1),Z=V(!1);const ee=[{title:"Upcoming",value:"tournamentsUpcoming",disabled:!1},{title:"Past",value:"tournamentsFinished",disabled:!1},{title:"Explore",value:"explore",disabled:!1}];function te(e){if(!0===e.selfRegisterAllowed){const t={playerId:x.user[".key"],playerEmail:x.user.email,venue:e.venue||y.venue.locationSlug,eventSlug:e.slug,eventType:"tournament",selfSignUp:!0};M(t.playerId,t.playerEmail,t.venue,t.eventSlug,t.eventType,t.selfSignUp).then(t=>{"works"===t.data.appendParticiant&&console.warn("Cloud Function returned 'works' but may not have completed the database write"),x.getPlayerCareer(x.user[".key"]),N(()=>{j.push("/".concat(y.venue.locationSlug,"/tournament/view/").concat(e.slug))},"Congrats! You've Joined the Tournament!","info","Ok",!0)}).catch(e=>{console.error("Error joining event: ",e),N(()=>{})})}}const ae=S(()=>{let e=[];for(let t of Object.values(b.seasonYears))e.push({title:t,value:String(t)});return e});async function ne(e){let t=C.params.locationSlug;return await h(B(f("/venues/".concat(t,"/league/").concat(e,"/Session1/standings")))).then(e=>{if(!e.exists())return;let t=Object.values(e.val());return t.sort((e,t)=>t.win-e.win),t})}ae.value.forEach(e=>{e.title===+b.currentYear&&(K.selectedYear=e.value)});const le=S(()=>y.listTournaments);return a(y.venue,e=>{if(Object.keys(e).length){let t="custom"===e.type?"axeThrowing_standard-league":"watl_standard-league";K.discipline=t}},{immediate:!0}),a([K,()=>le.value],([e])=>{if("explore"!==e.tournamentType){Z.value=!1;let t=e.tournamentType;R.capture("tournamentsTabs",{currentTournamentType:t});let a=[...y[t]].filter(t=>t.date.includes(e.selectedYear)&&!t.archive&&"".concat(t.rules,"_").concat(t.leagueType)===e.discipline);a.length&&(L.value=!0),a=a.map(async e=>{let t=await ne(e.slug);return{...e,players:t}}),Promise.all(a).then(e=>{W.value=e,L.value=!1})}else Z.value=!0}),F(()=>{if(j.currentRoute.value.query.tournamentStatus&&(K.tournamentsUpcoming=j.currentRoute.value.query.tournamentStatus),"explore"!==K.tournamentType){let e=K.tournamentType;R.capture("tournamentsTabs",{currentTournamentType:e});let t=[...y[e]].filter(e=>e.date.includes(K.selectedYear)&&!e.archive);t.length&&(L.value=!0),t=t.map(async e=>{let t=await ne(e.slug);return{...e,players:t}}),Promise.all(t).then(e=>{W.value=e,L.value=!1})}}),(e,t)=>{const a=n("v-icon"),y=n("v-tab"),h=n("v-progress-circular");return s(),l("div",ue,[t[5]||(t[5]=o("h1",{class:"title"},"Tournaments",-1)),G.value.length?(s(),l(p,{key:0},[t[4]||(t[4]=o("h3",{class:"subTitle"},"featured",-1)),i(q,{featuredEvents:G.value,onSelectEvent:Q,onJoinEvent:te},null,8,["featuredEvents"])],64)):u("",!0),t[6]||(t[6]=o("h3",{class:"subTitle"},"All tournaments",-1)),o("div",re,[o("div",ie,[m(E)?(s(),U(H,{key:1,class:"chipFilter",items:$.value,modelValue:K.discipline,"onUpdate:modelValue":t[1]||(t[1]=e=>K.discipline=e)},null,8,["items","modelValue"])):(s(),U(D,{key:0,items:$.value,value:K.discipline,onUpdatedSelectValue:t[0]||(t[0]=e=>K.discipline=e)},null,8,["items","value"]))]),o("div",ce,[i(D,{width:"150px",items:ae.value,value:K.selectedYear,class:"yearSelect",onUpdatedSelectValue:t[2]||(t[2]=e=>K.selectedYear=e)},null,8,["items","value"])]),o("div",de,[i(H,{items:ee,modelValue:K.tournamentType,"onUpdate:modelValue":t[3]||(t[3]=e=>K.tournamentType=e)},null,8,["modelValue"])])]),o("div",me,["explore"===K.tournamentType?(s(),l("div",pe,[(s(!0),l(p,null,v(m(X),(e,t)=>(s(),U(y,{key:t,class:g(["customTab",{active:m(J)===t}]),onClick:e=>I(J)?J.value=t:J=t},{default:d(()=>[i(a,{size:"24"},{default:d(()=>[c(r(e.icon),1)]),_:2},1024)]),_:2},1032,["class","onClick"]))),128))])):u("",!0)]),o("div",ve,[m(L)?(s(),U(h,{key:0,indeterminate:"",color:"#0B2E7D"})):m(L)||!m(W).length||m(Z)?m(L)||m(W).length||m(Z)?m(Z)?(s(),l("div",he,[i(oe,{secondaryTabs:m(J)},null,8,["secondaryTabs"])])):u("",!0):(s(),l("p",ge," There are no "+r("tournamentsUpcoming"===K.tournamentType?"upcoming":"past")+" tournaments in this venue ",1)):(s(),l("div",ye,[(s(!0),l(p,null,v(m(W),e=>(s(),l("div",{key:e.slug,class:"tournamentItem"},[i(O,{tournament:e,tournamentStatus:K.tournamentType},null,8,["tournament","tournamentStatus"])]))),128))]))])])}}},[["__scopeId","data-v-35d86952"]]);export{fe 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.