<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d22c889"],{f449:function(t,e,r){"use strict";r.r(e);var o=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("v-dialog",{attrs:{scrollable:"",persistent:"","max-width":"500px",transition:"dialog-transition"},scopedSlots:t._u([{key:"activator",fn:function(e){var o=e.on;return[r("v-tooltip",{attrs:{left:""},scopedSlots:t._u([{key:"activator",fn:function(e){var n=e.on;return[r("v-btn",t._g({staticClass:"mr-2",attrs:{color:"color3 color3Text--text",small:"",fab:""}},Object.assign({},n,o)),[r("v-icon",{attrs:{small:""}},[t._v("fas fa-map-marker-plus")])],1)]}}],null,!0)},[r("span",[t._v("Add Courts")])])]}}]),model:{value:t.dialog,callback:function(e){t.dialog=e},expression:"dialog"}},[r("v-card",{attrs:{color:"grey lighten-3"}},[r("div",[r("v-toolbar",{attrs:{color:"color2 color2Text--text"}},[r("v-toolbar-title",[t._v(t._s("wi"===t.mode?"Work-In Courts":"Courts By Round"))]),r("v-spacer"),r("v-btn",{attrs:{color:"color1 color1Text--text",fab:"",small:"",loading:t.loading},on:{click:function(e){e.stopPropagation(),t.dialog=!1}}},[r("v-icon",[t._v("fas fa-times")])],1)],1)],1),r("v-card-text",[r("v-btn",{attrs:{color:"color3","x-small":"",text:"",disabled:"wi"===t.mode},on:{click:function(e){e.stopPropagation(),t.mode="wi"}}},[t._v("work in")]),r("v-btn",{attrs:{color:"color3","x-small":"",text:"",disabled:"br"===t.mode},on:{click:function(e){e.stopPropagation(),t.mode="br"}}},[t._v("By round")]),r("v-btn",{attrs:{color:"color3","x-small":"",text:"",disabled:"io"===t.mode},on:{click:function(e){e.stopPropagation(),t.mode="io"}}},[t._v("In Order")]),r("v-btn",{attrs:{color:"color3","x-small":"",text:"",disabled:"xx"===t.mode},on:{click:function(e){e.stopPropagation(),t.mode="xx"}}},[t._v("Clear All")])],1),r("v-window",{model:{value:t.window,callback:function(e){t.window=e},expression:"window"}},[r("v-window-item",{key:0},[r("v-card-text",{staticClass:"text-center"},[r("v-text-field",{attrs:{label:"Courts"},on:{paste:t.onPaste},model:{value:t.courts,callback:function(e){t.courts=e},expression:"courts"}}),r("v-expand-transition",["br"===t.mode?r("div",[r("v-select",{attrs:{label:"Round",items:t.rounds},model:{value:t.round,callback:function(e){t.round=e},expression:"round"}}),r("date-time-picker",{attrs:{datetime:t.startTime,label:"Play Start"},on:{"update:datetime":function(e){t.startTime=e}}})],1):"io"===t.mode?[r("div",[r("v-checkbox",{attrs:{label:"Repeat",value:!0},model:{value:t.repeat,callback:function(e){t.repeat=e},expression:"repeat"}}),r("v-checkbox",{attrs:{label:"Skip Already Courted Matches",value:!0},model:{value:t.skipCourted,callback:function(e){t.skipCourted=e},expression:"skipCourted"}})],1)]:r("v-checkbox",{attrs:{label:"Straight Down",value:!0},model:{value:t.str8Down,callback:function(e){t.str8Down=e},expression:"str8Down"}})],2),r("v-btn",{attrs:{color:"success",disabled:!t.valid,loading:t.loading},on:{click:function(e){return e.stopPropagation(),t.go(e)}}},[t._v("go")]),"wi"===t.mode?r("div",{staticClass:"caption",class:t.valid?null:"error--text"},[t._v("This courting method currently only supports the following number of courts: "+t._s(t._f("formatArray")(t.validCounts)))]):t._e()],1)],1),r("v-window-item",{key:1},[r("v-card-text",{staticClass:"text-center"},[r("div",{staticClass:"d-flex justify-center"},[r("v-checkbox",{staticClass:"shrink",attrs:{label:"Clear All Courts",color:"success","hide-details":""},model:{value:t.clearCourts,callback:function(e){t.clearCourts=e},expression:"clearCourts"}})],1),r("div",{staticClass:"d-flex justify-center"},[r("v-checkbox",{staticClass:"shrink",attrs:{label:"Clear All Times",color:"success","hide-details":""},model:{value:t.clearTimes,callback:function(e){t.clearTimes=e},expression:"clearTimes"}})],1),r("div",{staticClass:"d-flex justify-center"},[r("v-checkbox",{staticClass:"shrink ",attrs:{label:"I am sure",color:"success"},model:{value:t.sure,callback:function(e){t.sure=e},expression:"sure"}})],1),r("v-btn",{attrs:{color:"success",disabled:!t.clearReady},on:{click:function(e){return e.stopPropagation(),t.doClearing(e)}}},[t._v("Clear All")])],1)],1)],1)],1)],1)},n=[],a=(r("4de4"),r("7db0"),r("c740"),r("4160"),r("caad"),r("d81d"),r("d3b7"),r("ac1f"),r("6062"),r("2532"),r("3ca3"),r("466d"),r("38cf"),r("1276"),r("498a"),r("159b"),r("ddb0"),r("2909")),i=r("ceca"),s=r("c32c"),c=r("c1df"),u=r.n(c),l=function(t,e){return t===e?0:t&lt;e?-1:1},d={props:["bracket"],data:function(){return{dialog:!1,loading:!1,courts:null,mode:"wi",round:null,startTime:null,window:0,clearCourts:!1,clearTimes:!1,sure:!1,str8Down:!1,pasted:!1,repeat:!1,skipCourted:!1}},computed:{clearReady:function(){return this.sure&amp;&amp;(this.clearCourts||this.clearTimes)},rounds:function(){return Object(a["a"])(new Set(this.bracket.matches.map((function(t){return t.round+1}))))},validCounts:function(){return this.bracket.winners.map((function(t){return t.matches.length}))},calcCourts:function(){if(!this.courts)return[];var t=this.courts.includes(",")?this.courts.split(","):this.courts.split(" "),e=t.filter((function(t){return t.includes("-")}));return e.forEach((function(e){t=t.filter((function(t){return t!==e}));var r=e.split("-"),o=+r[0],n=+r[1];if(!isNaN(o)&amp;&amp;!isNaN(n))if(o&lt;n)for(o;o&lt;=n;o++)t.push("".concat(o).trim());else for(o;o&gt;=n;o--)t.push("".concat(o).trim())})),t},valid:function(){return"wi"!==this.mode||this.validCounts.includes(this.calcCourts.length)}},methods:{go:function(){return"wi"===this.mode?this.str8Down?this.goStr8():this.goWi():"io"===this.mode?this.goIo():this.goBr()},goStr8:function(){var t=this,e=function e(r,o,n,a,i){var s=a.findIndex((function(t){return t.number===o.number}))&gt;-1;if(!s){a.push({number:o.number,court:r,courtOrder:n++,bracketId:o.bracketId,id:o.id});var c=t.bracket.matches.find((function(t){return t.homeFeeder===o.number}));return c&amp;&amp;e(r,c,n,a,i),c=t.bracket.matches.find((function(t){return t.awayFeeder===o.number})),c&amp;&amp;e(r,c,n,a,i),a}},r=[];this.bracket.matches.forEach((function(t){if(!t.isBye)if(t.homeFeeder||t.awayFeeder){var e=t.homeFeeder&amp;&amp;r.find((function(e){return e.number===t.homeFeeder})),o=t.awayFeeder&amp;&amp;r.find((function(e){return e.number===t.awayFeeder}));e&amp;&amp;!e.isBye||o&amp;&amp;!o.isBye||r.push(t)}else r.push(t)})),r.sort(Object(i["firstBy"])("number")),console.log(r);var o=Object(a["a"])(this.calcCourts),n=[],s=0;for(s;s&lt;o.length;s++)if(s&lt;r.length){var c=o[s],u=r[s],l=1;e(c,u,l,n,r)}console.log(n),this.saveEdit(n)},goWi:function(){var t=this,e=this.bracket.winners.find((function(e){return e.matches.length===t.calcCourts.length}));console.log(e);var r=function e(r,o){if(o.add(r.number),r.awayFeeder){var n=t.bracket.matches.find((function(t){return t.number===r.awayFeeder}));n&amp;&amp;e(n,o)}if(r.homeFeeder){var a=t.bracket.matches.find((function(t){return t.number===r.homeFeeder}));a&amp;&amp;e(a,o)}},o=e.matches.map((function(e){var o=new Set;r(e,o);var n=Object(a["a"])(o).map((function(e){var r=t.bracket.matches.find((function(t){return t.number===e})),o=[r.homeSeed,r.awaySeed,r.loserMap.hi].filter((function(t){return t&gt;0})),n=Math.min.apply(Math,Object(a["a"])(o));return{n:e,match:r,seed:n,round:r.round}}));return{matches:n,seed:Math.min.apply(Math,Object(a["a"])(n.map((function(t){return t.seed}))))}}));this.bracket.matches.filter((function(t){return t.round&gt;e.number})).forEach((function(t){var e=Math.min.apply(Math,Object(a["a"])([t.homeSeed,t.awaySeed,t.loserMap.hi].filter((function(t){return t&gt;0})))),r=o.find((function(t){return t.seed===e}));r&amp;&amp;r.matches.push({n:t.number,match:t,seed:e,round:t.round})})),o.forEach((function(t){t.matches=t.matches.filter((function(t){return!t.match.isBye})).sort((function(t,e){return l(t.round,e.round)||l(t.seed,e.seed)}))})),o.sort((function(t,e){return l(t.seed,e.seed)})),console.log(o);var n=[];o.forEach((function(e,r){var o=1;n.push.apply(n,Object(a["a"])(e.matches.map((function(e){return{number:e.n,court:t.calcCourts[r],courtOrder:o++,bracketId:e.match.bracketId,id:e.match.id}}))))})),console.log(n),this.saveEdit(n)},goBr:function(){var t=this,e=this.bracket.matches.filter((function(e){return e.round===t.round-1&amp;&amp;!e.isBye})).sort(Object(i["firstBy"])("number")),r=[],o=0,n=0===this.calcCourts.length,a=!this.startTime;e.forEach((function(e,i){if(r.push({number:e.number,court:n?null:t.calcCourts[o++],bracketId:t.bracket.id,id:e.id,startTime:a?null:t.startTime}),o===t.calcCourts.length&amp;&amp;!n){o=0;var s=t.bracket.winnersMatchSettings.minutesPerMatch,c=u()(t.startTime).add(s,"m");t.startTime=c.format("YYYY-MM-DDTHH:mm:ss")}})),console.log(r),this.saveEdit(r)},goIo:function(){var t=this,e=this.bracket.matches.filter((function(t){return!t.isBye})).map((function(t){return{number:t.number,court:t.court,courtOrder:t.courtOrder,bracketId:t.bracketId,id:t.id}}));e.sort(Object(i["firstBy"])("number"));var r=Object(a["a"])(this.calcCourts),o=0;e.forEach((function(e){!(o&lt;r.length)||t.skipCourted&amp;&amp;e.court||(e.court=r[o++],o&gt;=r.length&amp;&amp;t.repeat&amp;&amp;(o=0))})),this.autoOrder(e),console.log(e),this.saveEdit(e)},autoOrder:function(t){var e=Object(a["a"])(new Set(t.filter((function(t){return t.court})).map((function(t){return t.court}))));e.forEach((function(e){var r=t.filter((function(t){return t.court===e})).sort((function(t,e){return l(t.courtOrder,e.courtOrder)||l(t.number,e.number)}));r.forEach((function(t,e){t.courtOrder=e+1}))}))},saveEdit:function(t){var e=this;this.loading=!0,this.$VBL.post.matches(t).then((function(t){e.reset()})).catch((function(t){return console.log(t.response)})).finally((function(){e.loading=!1}))},reset:function(){this.courts=null,this.dialog=!1,this.window=0,this.sure=!1,this.clearCourts=!1,this.clearTimes=!1,this.round=null,this.startTime=null},doClearing:function(){var t=this;this.loading=!0,this.$VBL.post.matcheReset(this.bracket.id,this.clearCourts,this.clearTimes).then((function(e){t.reset()})).catch((function(t){return console.log(t.response)})).finally((function(){t.loading=!1}))},onPaste:function(){this.pasted=!0}},watch:{mode:function(t,e){"xx"===t?this.window=1:"xx"===e&amp;&amp;(this.window=0)},courts:function(t){if(this.pasted){var e=this.courts||"";this.courts=e.replaceAll(" ",""),this.pasted=!1}}},components:{DateTimePicker:s["default"]}},f=d,h=r("2877"),m=r("6544"),b=r.n(m),v=r("8336"),p=r("b0af"),k=r("99d9"),g=r("ac7c"),w=r("169a"),x=r("0789"),C=r("132d"),y=r("b974"),T=r("2fa4"),O=r("8654"),_=r("71d9"),j=r("2a7f"),S=r("3a2f"),V=r("f665"),B=r("1e6c"),E=Object(h["a"])(f,o,n,!1,null,null,null);e["default"]=E.exports;b()(E,{VBtn:v["a"],VCard:p["a"],VCardText:k["b"],VCheckbox:g["a"],VDialog:w["a"],VExpandTransition:x["a"],VIcon:C["a"],VSelect:y["a"],VSpacer:T["a"],VTextField:O["a"],VToolbar:_["a"],VToolbarTitle:j["a"],VTooltip:S["a"],VWindow:V["a"],VWindowItem:B["a"]})}}]);
//# sourceMappingURL=chunk-2d22c889.e0b25681.js.map</pre></body></html>