courthive-components 0.8.6 → 0.8.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19267,7 +19267,7 @@ function oW(e, t) {
19267
19267
  }, 100);
19268
19268
  }
19269
19269
  function JW() {
19270
- return "0.8.5";
19270
+ return "0.8.7";
19271
19271
  }
19272
19272
  function Qi(e) {
19273
19273
  return typeof e == "function";
@@ -34,7 +34,7 @@
34
34
  <div>${c}</div>
35
35
  <div style="font-weight: bold">${o}</div>
36
36
  </div>
37
- `;return a.innerHTML=u||"",a}const yC=Ve({flexDirection:"column",display:"flex"}),O$=Ve({flexDirection:"row",display:"flex"}),UC=Ve({justifyContent:"space-around",marginInlineStart:"16px",marginInlineEnd:"16px",flexDirection:"column",height:"100%",display:"flex",variants:{variant:{adHoc:{justifyContent:"flex-start"}}}}),k$=Ve({borderTop:"solid 1px black",marginRight:"-1em",marginLeft:"-1em",paddingTop:".5em",marginTop:".2em",variants:{variant:{0:{marginTop:"1em",borderTop:"none",paddingTop:"0px"}},roundOrder:{first:{marginLeft:"0em"},last:{marginRight:"0em"}}}}),x$=Ve({fontWeight:"bold",color:"blue",height:"1em"}),SC=Ve({width:"$score$setWidth",display:"inline-block",fontSize:9,variants:{variant:{set:{textAlign:"center"},points:{marginInlineEnd:3}}}}),F$=Ve({transform:"translateY(-50%)",textTransform:"uppercase",backgroundColor:"#fff",position:"absolute",textAlign:"center",top:"calc(50%)",color:"#bbb",fontSize:0,right:4});function L$(){return Ve({backgroundColor:"magenta",position:"absolute",opacity:"0.2",height:"100%",width:"100%",top:0})()}const _$=Ve({});function B$({configuration:e}){const t={backgroundColor:"$matchUpBackgroundColor",WebkitTransition:"all 0.30s linear",boxShadow:"$matchUp$boxShadow",transition:"all 0.30s linear",border:"solid $border",marginBottom:"$space$1",marginTop:"$space$1",position:"relative",display:"grid",width:"100%",borderInlineStartWidth:"$borderWidths$borderInlineStart"};if(e?.matchUpHover){const r=typeof e.matchUpHover=="string"?e.matchUpHover:"cyan";t["&:hover"]={backgroundColor:r}}else t["&:hover"]={borderColor:"$borderHover"};return Ve(t)()}function V$({variant:e}){return Ve({borderBottom:"solid 1px lightgray",backgroundColor:"$matchUp",position:"relative",width:"100%",height:"$lineHeights$centerInfo",variants:{variant:{1:{borderBottom:"solid 1px black"},2:{borderBottom:"solid 1px lightgray"}}}})({variant:e})}const j$=Ve({justifyContent:"center",alignContent:"center",flexDirection:"column",height:"100%",display:"flex"}),G$=Ve({fontFamily:"Lato,Arial,Helvetica,sans-serif",WebkitFontSmooting:"antialiased",marginInlineStart:"calc(20%)",WebkitBoxOrient:"horizontal",WebKitBoxDirection:"normal",WebkitBoxPack:"center",boxSizing:"inherit",flexDirection:"row",display:"flex"}),vC=Ve({alignContent:"center",boxSizing:"inherit",fontFamily:"Lato",fontWeight:900,fontSize:9});function $$({eventHandlers:e,entryStatus:t,sideNumber:r,className:i,matchUp:n}){const a=document.createElement("div");Bi(e?.centerInfoClick)&&(a.onclick=l=>e.centerInfoClick({matchUp:n,sideNumber:r,pointerEvent:l})),a.className=La(V$({variant:r}),i),a.classList.add("tmx-ci"),a.setAttribute("sideNumber",String(r));const s=document.createElement("div");s.className=j$();const o=document.createElement("div");o.className=G$();const c=document.createElement("div");c.className=vC(),c.innerHTML=t?"Entry status:&nbsp;":"",o.appendChild(c);const u=document.createElement("div");return u.className=vC(),u.innerHTML=t||"",o.appendChild(u),s.appendChild(o),a.appendChild(s),{element:a}}const Kl={scheduleInfo:1.8,centerInfo:1.5,gameScore:2};function W$({composition:e,isDoubles:t,roundFactor:r=1}){const i=parseInt(window.getComputedStyle(document.body).getPropertyValue("font-size")),n=e?.configuration||{},a=n?.connectorWidth||16,s=n.centerInfo?Kl.centerInfo*i:0,o=n.scheduleInfo?Kl.scheduleInfo*i:0,u=(60+(n.showAddress?i:0))*(t?1.3:1)+s,l=u*r,d=(u+o)*r;return Ve({"&::before":{borderBlockStart:"$borderWidths$matchUp solid #999",left:-a,width:a,position:"absolute",borderRadius:2,top:-1},"&::after":{width:a,position:"absolute",borderRadius:2,left:"100%"},"&::after, &::before":{borderWidth:"$borderWidths$matchUp",borderColor:"$connector",display:"block",content:""},variants:{isFirstRound:{true:{"&::before":{height:0,width:0,borderWidth:0}}},link:{m1:{"&::after":{borderInlineEnd:"$borderWidths$matchUp solid $connector",borderTopStyle:"solid",height:l,top:-1}},m2:{"&::after":{bottom:"calc(100%)",borderInlineEnd:"$borderWidths$matchUp solid $connector",borderBottomStyle:"solid",height:d}},m0:{"&::after":{borderTopStyle:"solid",borderColor:"$connector",top:-1}},mr:{"&::before":{height:0,width:0,borderWidth:0},"&::after":{height:0,width:0,borderWidth:0}},noProgression:{true:{"&::after":{height:0,width:0,borderWidth:0}}}}}})}const wC=e=>Ve({display:"flex",alignItems:"center",height:e,justifyContent:"flex-end",backgroundColor:"$matchUp",variants:{sideNumber:{1:{borderBottom:"1px solid $internalDividers"}},fontSize:{small:{fontSize:"smaller",paddingRight:"1em",color:"blue"}}}}),q$=Ve({lineHeight:"0.75rem",fontSize:"0.625rem",left:"1.1rem",top:".4rem"}),DC=Ve({lineHeight:"$lineHeights$gameScore",justifyContent:"center",width:"$score$setWidth",position:"relative",textAlign:"center",cursor:"pointer",fontWeight:500,fontSize:"$1",display:"flex",margin:0,variants:{variant:{winner:{color:"$winner!important",fontWeight:700},loser:{color:"$loser!important"}}}}),H$=Ve({marginInlineEnd:"$space$gameMarginInlineEnd",justifyContent:"flex-end",alignItems:"center",display:"flex"});function z$({value:e}={}){const t=document.createElement("input");return t.onclick=r=>r.target.select(),t.className=DC(),t.value=String(e||""),t}function Y$({gameScoreOnly:e,scoreStripes:t,set:r,sideNumber:i}){const a=i===r?.winningSide||r?.winningSide?"loser":void 0,s=i===2?r.side2Score:r.side1Score,o=r.side2TiebreakScore||r.side1TiebreakScore,c=i===2?r.side2TiebreakScore:r.side1TiebreakScore,u=s===void 0&&c,l=u||s,d=t&&r.setNumber%2?"lightgray":"transparent",m=r.editing?r.editing===i:void 0;let f;if(m)f=z$({value:l});else if(f=document.createElement("p"),f.className=DC({variant:a}),f.classList.add("tmx-st"),f.setAttribute("setNumber",r.setNumber),f.style.backgroundColor=d,f.innerHTML=isNaN(l)?"":l,!e){const h=document.createElement("span");h.className=q$(),h.innerHTML=o&&!u?String(c):"",f.appendChild(h)}return f}function K$({participantHeight:e,eventHandlers:t,composition:r,sideNumber:i,matchUp:n}){const a=r?.configuration?.winnerChevron,s=r?.configuration?.gameScoreOnly,o=n?.score?.sets||[],c=r?.configuration?.scoreBox,u=e?i===2?e:e-1:void 0,l=m=>{Bi(t?.scoreClick)&&(m.stopPropagation(),t.scoreClick({pointerEvent:m,matchUp:n}))},d=document.createElement("div");d.className=wC(u)({...!c&&i===1&&{sideNumber:1},fontSize:"small"}),d.classList.add("sideScore"),d.classList.add("tmx-scr"),d.onclick=l;const p=document.createElement("div");p.className=H$();for(const m of o||[]){const f=Y$({gameScoreOnly:s,scoreStripes:a,sideNumber:i,set:m});p.appendChild(f)}return d.appendChild(p),d}const X$=Ve({height:"$lineHeights$scheduleInfo",borderBottom:"1px solid darkgray",justifyContent:"space-between",backgroundColor:"#F8F9F9",boxSizing:"border-box",paddingRight:"0.2rem",paddingLeft:"0.5rem",alignItems:"center",cursor:"pointer",color:"#7F8080",display:"flex",width:"100%"});var Sf={exports:{}},Q$=Sf.exports,TC;function J$(){return TC||(TC=1,(function(e,t){(function(r,i){e.exports=i()})(Q$,(function(){var r=1e3,i=6e4,n=36e5,a="millisecond",s="second",o="minute",c="hour",u="day",l="week",d="month",p="quarter",m="year",f="date",h="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,I=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,y={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(A){var N=["th","st","nd","rd"],C=A%100;return"["+A+(N[(C-20)%10]||N[C]||N[0])+"]"}},U=function(A,N,C){var k=String(A);return!k||k.length>=N?A:""+Array(N+1-k.length).join(C)+A},D={s:U,z:function(A){var N=-A.utcOffset(),C=Math.abs(N),k=Math.floor(C/60),O=C%60;return(N<=0?"+":"-")+U(k,2,"0")+":"+U(O,2,"0")},m:function A(N,C){if(N.date()<C.date())return-A(C,N);var k=12*(C.year()-N.year())+(C.month()-N.month()),O=N.clone().add(k,d),L=C-O<0,_=N.clone().add(k+(L?-1:1),d);return+(-(k+(C-O)/(L?O-_:_-O))||0)},a:function(A){return A<0?Math.ceil(A)||0:Math.floor(A)},p:function(A){return{M:d,y:m,w:l,d:u,D:f,h:c,m:o,s,ms:a,Q:p}[A]||String(A||"").toLowerCase().replace(/s$/,"")},u:function(A){return A===void 0}},v="en",w={};w[v]=y;var S="$isDayjsObject",T=function(A){return A instanceof R||!(!A||!A[S])},b=function A(N,C,k){var O;if(!N)return v;if(typeof N=="string"){var L=N.toLowerCase();w[L]&&(O=L),C&&(w[L]=C,O=L);var _=N.split("-");if(!O&&_.length>1)return A(_[0])}else{var B=N.name;w[B]=N,O=B}return!k&&O&&(v=O),O||!k&&v},P=function(A,N){if(T(A))return A.clone();var C=typeof N=="object"?N:{};return C.date=A,C.args=arguments,new R(C)},M=D;M.l=b,M.i=T,M.w=function(A,N){return P(A,{locale:N.$L,utc:N.$u,x:N.$x,$offset:N.$offset})};var R=(function(){function A(C){this.$L=b(C.locale,null,!0),this.parse(C),this.$x=this.$x||C.x||{},this[S]=!0}var N=A.prototype;return N.parse=function(C){this.$d=(function(k){var O=k.date,L=k.utc;if(O===null)return new Date(NaN);if(M.u(O))return new Date;if(O instanceof Date)return new Date(O);if(typeof O=="string"&&!/Z$/i.test(O)){var _=O.match(g);if(_){var B=_[2]-1||0,G=(_[7]||"0").substring(0,3);return L?new Date(Date.UTC(_[1],B,_[3]||1,_[4]||0,_[5]||0,_[6]||0,G)):new Date(_[1],B,_[3]||1,_[4]||0,_[5]||0,_[6]||0,G)}}return new Date(O)})(C),this.init()},N.init=function(){var C=this.$d;this.$y=C.getFullYear(),this.$M=C.getMonth(),this.$D=C.getDate(),this.$W=C.getDay(),this.$H=C.getHours(),this.$m=C.getMinutes(),this.$s=C.getSeconds(),this.$ms=C.getMilliseconds()},N.$utils=function(){return M},N.isValid=function(){return this.$d.toString()!==h},N.isSame=function(C,k){var O=P(C);return this.startOf(k)<=O&&O<=this.endOf(k)},N.isAfter=function(C,k){return P(C)<this.startOf(k)},N.isBefore=function(C,k){return this.endOf(k)<P(C)},N.$g=function(C,k,O){return M.u(C)?this[k]:this.set(O,C)},N.unix=function(){return Math.floor(this.valueOf()/1e3)},N.valueOf=function(){return this.$d.getTime()},N.startOf=function(C,k){var O=this,L=!!M.u(k)||k,_=M.p(C),B=function(q,K){var X=M.w(O.$u?Date.UTC(O.$y,K,q):new Date(O.$y,K,q),O);return L?X:X.endOf(u)},G=function(q,K){return M.w(O.toDate()[q].apply(O.toDate("s"),(L?[0,0,0,0]:[23,59,59,999]).slice(K)),O)},$=this.$W,j=this.$M,V=this.$D,H="set"+(this.$u?"UTC":"");switch(_){case m:return L?B(1,0):B(31,11);case d:return L?B(1,j):B(0,j+1);case l:var W=this.$locale().weekStart||0,Y=($<W?$+7:$)-W;return B(L?V-Y:V+(6-Y),j);case u:case f:return G(H+"Hours",0);case c:return G(H+"Minutes",1);case o:return G(H+"Seconds",2);case s:return G(H+"Milliseconds",3);default:return this.clone()}},N.endOf=function(C){return this.startOf(C,!1)},N.$set=function(C,k){var O,L=M.p(C),_="set"+(this.$u?"UTC":""),B=(O={},O[u]=_+"Date",O[f]=_+"Date",O[d]=_+"Month",O[m]=_+"FullYear",O[c]=_+"Hours",O[o]=_+"Minutes",O[s]=_+"Seconds",O[a]=_+"Milliseconds",O)[L],G=L===u?this.$D+(k-this.$W):k;if(L===d||L===m){var $=this.clone().set(f,1);$.$d[B](G),$.init(),this.$d=$.set(f,Math.min(this.$D,$.daysInMonth())).$d}else B&&this.$d[B](G);return this.init(),this},N.set=function(C,k){return this.clone().$set(C,k)},N.get=function(C){return this[M.p(C)]()},N.add=function(C,k){var O,L=this;C=Number(C);var _=M.p(k),B=function(j){var V=P(L);return M.w(V.date(V.date()+Math.round(j*C)),L)};if(_===d)return this.set(d,this.$M+C);if(_===m)return this.set(m,this.$y+C);if(_===u)return B(1);if(_===l)return B(7);var G=(O={},O[o]=i,O[c]=n,O[s]=r,O)[_]||1,$=this.$d.getTime()+C*G;return M.w($,this)},N.subtract=function(C,k){return this.add(-1*C,k)},N.format=function(C){var k=this,O=this.$locale();if(!this.isValid())return O.invalidDate||h;var L=C||"YYYY-MM-DDTHH:mm:ssZ",_=M.z(this),B=this.$H,G=this.$m,$=this.$M,j=O.weekdays,V=O.months,H=O.meridiem,W=function(K,X,Q,Z){return K&&(K[X]||K(k,L))||Q[X].slice(0,Z)},Y=function(K){return M.s(B%12||12,K,"0")},q=H||function(K,X,Q){var Z=K<12?"AM":"PM";return Q?Z.toLowerCase():Z};return L.replace(I,(function(K,X){return X||(function(Q){switch(Q){case"YY":return String(k.$y).slice(-2);case"YYYY":return M.s(k.$y,4,"0");case"M":return $+1;case"MM":return M.s($+1,2,"0");case"MMM":return W(O.monthsShort,$,V,3);case"MMMM":return W(V,$);case"D":return k.$D;case"DD":return M.s(k.$D,2,"0");case"d":return String(k.$W);case"dd":return W(O.weekdaysMin,k.$W,j,2);case"ddd":return W(O.weekdaysShort,k.$W,j,3);case"dddd":return j[k.$W];case"H":return String(B);case"HH":return M.s(B,2,"0");case"h":return Y(1);case"hh":return Y(2);case"a":return q(B,G,!0);case"A":return q(B,G,!1);case"m":return String(G);case"mm":return M.s(G,2,"0");case"s":return String(k.$s);case"ss":return M.s(k.$s,2,"0");case"SSS":return M.s(k.$ms,3,"0");case"Z":return _}return null})(K)||_.replace(":","")}))},N.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},N.diff=function(C,k,O){var L,_=this,B=M.p(k),G=P(C),$=(G.utcOffset()-this.utcOffset())*i,j=this-G,V=function(){return M.m(_,G)};switch(B){case m:L=V()/12;break;case d:L=V();break;case p:L=V()/3;break;case l:L=(j-$)/6048e5;break;case u:L=(j-$)/864e5;break;case c:L=j/n;break;case o:L=j/i;break;case s:L=j/r;break;default:L=j}return O?L:M.a(L)},N.daysInMonth=function(){return this.endOf(d).$D},N.$locale=function(){return w[this.$L]},N.locale=function(C,k){if(!C)return this.$L;var O=this.clone(),L=b(C,k,!0);return L&&(O.$L=L),O},N.clone=function(){return M.w(this.$d,this)},N.toDate=function(){return new Date(this.valueOf())},N.toJSON=function(){return this.isValid()?this.toISOString():null},N.toISOString=function(){return this.$d.toISOString()},N.toString=function(){return this.$d.toUTCString()},A})(),E=R.prototype;return P.prototype=E,[["$ms",a],["$s",s],["$m",o],["$H",c],["$W",u],["$M",d],["$y",m],["$D",f]].forEach((function(A){E[A[1]]=function(N){return this.$g(N,A[0],A[1])}})),P.extend=function(A,N){return A.$i||(A(N,R,P),A.$i=!0),P},P.locale=b,P.isDayjs=T,P.unix=function(A){return P(1e3*A)},P.en=w[v],P.Ls=w,P.p={},P}))})(Sf)),Sf.exports}var Z$=J$();const eW=Lf(Z$);function tW({matchUp:e,eventHandlers:t}){const{scheduledTime:r,scheduledDate:i,venueAbbreviation:n,courtName:a}=e?.schedule||{},{dateTime:{extractDate:s,extractTime:o}}=gS,c=o(r);let l=s(i),d="ddd D MMMM";c&&(d+=", hh:mm A",l+=`T${c}`);const p=i?eW(l).format(d):"Not scheduled",m=n&&a?.toString().startsWith(n)&&a||n&&a&&`${n} ${a}`||a||n||"",f=document.createElement("div");f.className=X$(),f.classList.add("tmx-sch"),Bi(t?.scheduleClick)&&(f.onclick=U=>t.scheduleClick({matchUp:e,pointerEvent:U}));const h=document.createElement("div");h.innerHTML=p,f.append(h);const g=U=>{Bi(t?.venueClick)&&(U.stopPropagation(),t.venueClick({pointerEvent:U,matchUp:e}))},I=document.createElement("div");I.style="display: flex; flex-direction: row";const y=document.createElement("div");if(y.style.paddingRight=".2rem",y.onclick=g,y.innerHTML=m,I.append(y),f.append(I),f.onclick){const U=document.createElement("div");U.innerHTML="⋮",I.append(U)}return f}function PC({initialRoundNumber:e=1,eventHandlers:t,composition:r,sideNumber:i,className:n,matchUp:a}){const o=(r?.configuration||{})?.scheduleInfo,c=a?.score?.scoreStringSide1,u=r?.configuration?.scoreBox&&c,l=a?.readyToScore&&t?.scoreClick&&!fC.checkScoreHasValue({matchUp:a}),d=document.createElement("div");if(d.className=La(R$(),n),d.classList.add("tmx-sd"),d.setAttribute("sideNumber",String(i)),o&&i===1){const f=tW({matchUp:a,eventHandlers:t});d.appendChild(f)}const p=document.createElement("div");p.className=N$();const m=gC({sideContainer:!0,initialRoundNumber:e,eventHandlers:t,composition:r,sideNumber:i,matchUp:a});if(p.appendChild(m),u){const f=document.createElement("div");f.style.border="1px solid lightgray",p.appendChild(f)}if(c){const f=K$({eventHandlers:t,composition:r,sideNumber:i,matchUp:a});p.appendChild(f)}if(l){const f=g=>{Bi(t?.scoreClick)&&(g.stopPropagation(),t.scoreClick({pointerEvent:g,matchUp:a}))},h=document.createElement("div");h.className=wC(void 0)({...!u&&i===1&&{sideNumber:1},fontSize:"small"}),h.onclick=f,h.innerHTML="[Score]",p.appendChild(h)}return d.appendChild(p),d}function bC(e){const{composition:t,initialRoundNumber:r=1,matchUp:i,moiety:n,selectedMatchUpId:a,searchActive:s}=e,{roundFactor:o,roundNumber:c,finishingRound:u,matchUpType:l,preFeedRound:d,stage:p}=i,m=e.isFinalRound||(u?Number.parseInt(String(u))===1:!1),f=p==="QUALIFYING"&&m,h=m,g=c?Number.parseInt(String(c))===r:!1,I=l==="DOUBLES",y=(s||i.isRoundRobin||i.collectionId||e.isLucky||e.isAdHoc)&&"mr"||h&&"noProgression"||(f||d)&&"m0"||n&&"m1"||"m2",U=W$({composition:t,isDoubles:I,roundFactor:o})({isFirstRound:g,link:y}),D=t?.configuration||{},{resultsInfo:v,centerInfo:w}=D||{},S=e.eventHandlers||{},T=A=>{Bi(S?.matchUpClick)&&S.matchUpClick({pointerEvent:A,matchUp:i})},b=document.createElement("div");b.className=La(t?.theme,e?.className,"matchup",_$()),b.classList.add("tmx-m"),b.setAttribute("id",i?.matchUpId),b.onclick=T;const P=document.createElement("div");P.className=B$({configuration:D});const M=({sideNumber:A})=>{const N=i?.sides?.find(k=>k.sideNumber===A)?.participant?.entryStatus?.replace("_"," ");return $$({eventHandlers:S,entryStatus:N,sideNumber:A,className:A===2?U:void 0,matchUp:i})},R=PC({initialRoundNumber:r,eventHandlers:S,sideNumber:1,composition:t,matchUp:i}),E=PC({className:!w&&U,initialRoundNumber:r,eventHandlers:S,sideNumber:2,composition:t,matchUp:i});if(P.appendChild(R),w){const A=M({sideNumber:1}),N=M({sideNumber:2});P.appendChild(A.element),P.appendChild(N.element)}if(P.appendChild(E),v){const A=rW({score:i.score});P.appendChild(A)}if(b.appendChild(P),a===i.matchUpId){const A=document.createElement("div");A.className=L$(),b.appendChild(A)}return b}function rW({score:e}){const t=e?.sets?.filter(Boolean).sort((a,s)=>(a.setNumber||0)-(s.setNumber||0)),r=t?.at(-1),i=r?.side1PointsScore||r?.side2PointsScore,n=document.createElement("div");if(n.className=F$(),i){const a=document.createElement("div");a.className=SC({variant:"points"}),a.innerHTML="PTS",n.appendChild(a)}for(const a of t||[]){const s=document.createElement("div");s.setAttribute("key",String(a.setNumber)),s.className=SC({variant:"set"}),s.innerHTML=String(a.setNumber),n.appendChild(s)}return n}function MC({initialRoundNumber:e=1,selectedMatchUpId:t,eventHandlers:r,isFinalRound:i,isRoundRobin:n,searchActive:a,composition:s,roundFactor:o,roundNumber:c,roundProfile:u,minWidth:l,matchUps:d,context:p,isLucky:m}){const f=d.filter(P=>P.roundNumber===c).sort((P,M)=>(P.roundPosition||0)-(M.roundPosition||0)),h=f.every(({roundPosition:P,drawPositions:M})=>!P&&!M),g=s?.configuration||{},I=document.createElement("div");if(I.className=yC(),I.classList.add("tmx-rd"),I.setAttribute("roundNumber",String(c)),g.roundHeader){const P=IC({roundProfile:u,roundMatchUps:f,roundNumber:c,eventHandlers:r,context:p});I.appendChild(P)}const y=document.createElement("div");y.className=UC({variant:h?"adHoc":void 0}),l&&(y.style.minWidth=l);let U,D,v;if(n){const P=R=>(R||[]).reduce((E,A)=>A+E,0);f.sort((R,E)=>{const A=P(R.drawPositions)-P(E.drawPositions),N=R.drawPositions||[],C=E.drawPositions||[],k=(N.length?Math.min.apply(null,N):0)-(C.length?Math.min.apply(null,C):0);return A||k});const M=f.reduce((R,E)=>(R[E.structureId]=E.structureName,R),{});U=Object.values(M),D=Object.keys(M),v=Object.keys(gS.instanceCount(f.map(({structureId:R})=>R))).length}else h&&f.sort((P,M)=>(P.roundOrder??0)-(M.roundOrder??0));const w=v&&f.length/v,S=Object.keys(u).map(P=>parseInt(P)),T=S.indexOf(c),b=T===0&&"first"||T===S.length-1&&"last";return f.forEach((P,M)=>{const R=w&&!(M%w),E=w&&Math.floor(M/w),A=w&&U[E];if(R){const k=document.createElement("div");k.className=k$({...E===0&&{variant:0},...b&&{roundOrder:b}}),y.appendChild(k);const O=document.createElement("div");if(O.className=x$(),Bi(r?.groupHeaderClick)){const{drawId:L,containerStructureId:_}=f[0];y.onclick=B=>r.groupHeaderClick({structureId:D[E],containerStructureId:_,pointerEvent:B,drawId:L})}c===e&&(O.innerHTML=A),y.appendChild(O)}const N=M%2===0;o?P.roundFactor=o:e>1&&(P.roundFactor=Math.pow(2,c-e));const C=bC({initialRoundNumber:e,selectedMatchUpId:t,eventHandlers:r,isFinalRound:i,searchActive:a,composition:s,isAdHoc:h,isLucky:m,matchUp:P,moiety:N});y.appendChild(C)}),I.appendChild(y),I}function iW({initialRoundNumber:e=1,selectedMatchUpId:t,eventHandlers:r,searchActive:i,composition:n,structureId:a,finalColumn:s,matchUps:o,minWidth:c,context:u}){const{roundNumbers:l,roundProfile:d,hasOddMatchUpsCount:p,isNotEliminationStructure:m}=fC.getRoundMatchUps({matchUps:o});a=a||u?.structureId||o?.[0]?.structureId;const f=o.some(({isRoundRobin:y})=>y),h=p||m,g=document.createElement("div");g.className=O$(),g.classList.add("tmx-str"),g.setAttribute("id",a||"");const I=l.length?Math.max.apply(null,l):0;for(const y of l){if(y<e)continue;const D=MC({initialRoundNumber:e,selectedMatchUpId:t,eventHandlers:r,isFinalRound:y===I,isRoundRobin:f,searchActive:i,composition:n,roundNumber:y,roundProfile:d,matchUps:o,minWidth:c,context:u,isLucky:h});g.appendChild(D)}if(s&&typeof s!="boolean"){const y=document.createElement("div");y.className=yC();const U=document.createElement("div");U.className=UC(),U.appendChild(s),y.appendChild(U),g.appendChild(y)}return g}const RC=Ve({backgroundColor:"$colors$backgroundColor",color:"$colors$color",overflowX:"auto",height:1e3});function nW({content:e,theme:t}){const r=document.createElement("div");return r.className=t?La(RC(),t):RC(),t&&r.classList.add(t),typeof e=="string"?r.innerHTML=e:r.appendChild(e),r}const{createTheme:Do}=HS({theme:{lineHeights:{scheduleInfo:`${Kl.scheduleInfo}rem`,centerInfo:`${Kl.centerInfo}rem`,gameScore:`${Kl.gameScore}rem`},borderWidths:{matchUpInline:"1px 1px",matchUp:"1px"},space:{1:"10px",2:"0.375rem",gameMarginInlineEnd:"0.25rem"},fontSizes:{1:"0.875rem"},colors:{internalDividers:"lightgray",backgroundColor:"white",connector:"lightgray",border:"darkgray",color:"black"},participant:{textTransform:"capitalize",minHeight:"2rem",seed:"gray"},score:{setWidth:"1.3rem"}}}),NC=Do("australian-theme",{colors:{borderHover:"#0091d2",connector:"#999"}}),aW=Do("wimbledon-theme",{borderWidths:{borderInlineStart:"10px"},colors:{connector:"transparent",borderHover:"darkgrey",border:"#00703c",matchUp:"#fff"},participant:{textTransform:"uppercase"}}),sW=Do("french-theme",{colors:{winnerName:"#01503d!important",winner:"#01503d!important",borderHover:"#0091d2",border:"#F8F9F9"},matchUp:{boxShadow:"0 0 30px 0 hsla(0,0%,89%,9)"}}),oW=Do("usopen-theme",{colors:{matchUpBackgroundColor:"#F8F9F9",internalDividers:"darkgray",borderHover:"#0091d2",connector:"#999"}}),EC=Do("basic-theme",{colors:{internalDividers:"transparent",winner:"#50B649!important",loser:"#E61A1A!important",connector:"#999"},space:{gameMarginInlineEnd:"0.75rem"},participant:{seed:"transparent"},fontSizes:{1:"1.5rem"}}),cW=Do("dark-theme",{colors:{backgroundColor:"#333333",borderHover:"#0091d2",color:"white"},participant:{seed:"cyan"}}),uW=Do("itf-theme",{colors:{borderHover:"#0091d2",connector:"#999",matchUp:"#fff"},participant:{textTransform:"uppercase",seed:"gray"}}),lW={Australian:{configuration:{flags:!0},theme:NC},Basic:{configuration:{gameScoreOnly:!0,teamLogo:!1,roundHeader:!0,placeHolders:{tbd:"-",bye:"Bye"}},theme:EC},DrawPositions:{configuration:{gameScoreOnly:!0,drawPositions:!0,teamLogo:!1},theme:EC},French:{configuration:{bracketedSeeds:!0,flags:!0},theme:sW},Wimbledon:{configuration:{resultsInfo:!0,flags:!0},theme:aW},"US Open":{configuration:{scoreBox:!0,flags:!0},theme:oW},ITF:{configuration:{winnerChevron:!0,centerInfo:!0,flags:!0,roundHeader:!0},theme:uW},National:{configuration:{bracketedSeeds:"square",allDrawPositions:!0,drawPositions:!0,scheduleInfo:!0,roundHeader:!0,showAddress:!0,scaleAttributes:{scaleColor:"red",scaleType:"RATING",scaleName:"WTN",accessor:"wtnRating"}},theme:NC},Night:{configuration:{flags:!0},theme:cW}},AC=[{key:"custom",name:"Custom",desc:""},{key:"standard",name:"Standard Advantage",format:"SET3-S:6/TB7",desc:"Best of 3 Sets to 6 with Advantage"},{key:"atpd",name:"Standard Doubles",format:"SET3-S:6/TB7-F:TB10",desc:"Best of 3 Sets to 6, no Ad",desc2:"Final Set Tiebreak to 10"},{key:"standard1",name:"One Standard Set",format:"SET1-S:6/TB7",desc:"1 Set to 6 Games, Tiebreak to 7"},{key:"wimbledon2018",name:"Wimbledon 2018",format:"SET5-S:6/TB7-F:6",desc:"Best of 5 tiebreak sets, final set no tiebreak"},{key:"wimbledon2019",name:"Wimbledon 2019",format:"SET5-S:6/TB7-F:6/TB7@12",desc:"Best of 5 tiebreak sets, final set tiebreak at 12"},{key:"Aus2019",name:"Australian Open 2019",format:"SET5-S:6/TB7-F:6/TB10",desc:"Best of 5 tiebreak sets, final set tiebreak at 12"},{key:"short",name:"Short Sets TB7@4",format:"SET3-S:4/TB7",desc:"Best of 3 Sets to 4, tiebreak to 7 at 4-4"},{key:"short1",name:"Fast 4",format:"SET3-S:4/TB5@3",desc:"Best of 3 Sets to 4, tiebreak to 5 at 3-3"},{key:"short2",name:"One Short Set TB7",format:"SET1-S:4/TB7",desc:"One Set to 4, tiebreak to 7 at 4-4"},{key:"short3",name:"One Short Set TB5",format:"SET1-S:4/TB5@3",desc:"One Set to 4, tiebreak to 5 at 3-3"},{key:"short4",name:"Short Sets w/ 3rd TB10",format:"SET3-S:4/TB7-F:TB10",desc:"Best of 3 Sets to 4 Games, tiebreak to 10",desc2:"3rd Set Tiebreak to 7"},{key:"short5",name:"Short Sets w/ 3rd TB7",format:"SET3-S:4/TB7-F:TB7",desc:"Best of 3 Sets to 4 Games, tiebreak to 7",desc2:"3rd Set Tiebreak to 7"},{key:"pro",name:"Pro Set",format:"SET1-S:8/TB7",desc:"One Set to 8 with Advantage, tiebreak at 8-8"},{key:"cps",name:"College Pro Set",format:"SET1-S:8/TB7@7"},{key:"tbsets1",name:"Best of 3 TB7",format:"SET3-S:TB7",desc:"Two tiebreak sets",desc2:"7-point match tiebreak at one set all"},{key:"tbsets2",name:"Best of 3 TB10",format:"SET3-S:TB10",desc:"Best of 3 tiebreaks to 10"},{key:"tbsets3",name:"One Tiebreak to 10",format:"SET1-S:TB10",desc:"One Match Tiebreak to 10 with Advantage"},{key:"tbsets4",name:"Two TB7 w/ 3rd TB10",format:"SET3-S:TB7-F:TB10",desc:"Two 7 point tiebreak sets",desc2:"10 point tiebreak at one set all"},{key:"timed10",name:"Timed 10 minute game - game based",format:"SET1-S:T10"}],Qr="none",ua="▾";function vf(e){return typeof e=="function"}let Ss,qt;const wf="Timed set",Xl="Tiebreak",TS="No-Ad",_i="Set",Ql="Ad",Bt={setFormat:{descriptor:"Best of",bestOf:3,advantage:Ql,what:_i,setTo:6,tiebreakAt:6,tiebreakTo:7,winBy:2,minutes:10},finalSetFormat:{descriptor:"Final set",advantage:Ql,what:_i,setTo:6,tiebreakAt:6,tiebreakTo:7,winBy:2,minutes:10}};function CC(e){const t=e?"finalSetFormat":"setFormat",r=Bt[t].what,i={setTo:Bt[t].setTo};return r===_i&&Bt[t].advantage===TS&&(i.NoAD=!0),r===_i&&document.getElementById(e?"finalSetTiebreak":"setTiebreak")?.checked&&(i.tiebreakAt=Bt[t].tiebreakAt,i.tiebreakFormat={tiebreakTo:Bt[t].tiebreakTo},r===_i&&Bt[t].winBy===1&&(i.tiebreakFormat.NoAD=!0)),r===wf&&(i.minutes=Bt[t].minutes,i.timed=!0),r===Xl&&(i.tiebreakSet={tiebreakTo:Bt[t].tiebreakTo},Bt[t].winBy===1&&(i.tiebreakSet.NoAD=!0)),i}function OC(){const e=CC();qt={bestOf:Bt.setFormat.bestOf,setFormat:e},document.getElementById("finalSetOption")?.checked&&(qt.finalSetFormat=CC(1));const r=Vf.scoreGovernor.stringifyMatchUpFormat(qt),i=AC.some(a=>a.format===r),n=document.getElementById("matchUpFormatSelector");if(n){const a=n.value,s=i?r:"Custom";if(a!==s){const o=n.onchange;n.onchange=null,n.value=s,n.onchange=o}}return r}function Yi(e){const t=e||OC(),r=document.getElementById("matchUpFormatString");r&&(r.innerHTML=t)}const To=(e,t)=>t&&e.finalSetFormat||e.setFormat,$c=[{getValue:e=>e.bestOf>1?"Best of":"Exactly",options:["Best of","Exactly"],id:"descriptor",value:"Best of",finalSet:!1},{getValue:e=>e.bestOf,finalSet:!1,id:"bestOf",options:[1,3,5],onChange:"pluralize",onChangeCallback:"updateFinalSetVisibility",value:3},{getValue:(e,t)=>{const r=To(e,t),i=r?.NoAD?TS:Ql;return r?.timed||r?.tiebreakSet?void 0:i},options:[Ql,TS],onChange:"changeAdvantage",defaultValue:Ql,id:"advantage",whats:[_i]},{getValue:(e,t)=>{const r=To(e,t);return r||console.log({pmf:e}),r?.timed?wf:r?.tiebreakSet?Xl:_i},options:[_i,Xl,wf],finalSetLabel:`${_i}${ua}`,onChange:"changeWhat",onChangeCallback:"updateWhatValue",pluralize:!0,id:"what"},{getValue:(e,t)=>To(e,t).setTo,options:[1,2,3,4,5,6,7,8,9],onChange:"changeCount",defaultValue:6,whats:[_i],prefix:"to ",id:"setTo"},{getValue:(e,t)=>{const r=To(e,t);return r.tiebreakFormat?.tiebreakTo||r.tiebreakSet?.tiebreakTo},options:[5,7,9,10,12],onChange:"changeTiebreakTo",whats:[_i,Xl],id:"tiebreakTo",defaultValue:7,prefix:"TB to ",tbSet:!0,value:7,tb:!0},{getValue:(e,t)=>To(e,t).tiebreakAt,options:e=>{const t=Bt[e?"finalSetFormat":"setFormat"].setTo;return t>1?[t-1,t]:[]},onChange:"changeTiebreakAt",id:"tiebreakAt",defaultValue:6,whats:[_i],prefix:"@",value:6,tb:!0},{getValue:(e,t)=>{const r=To(e,t);if(r.tiebreakFormat)return r.tiebreakFormat?.NoAD?1:2},whats:[_i,Xl],onChange:"changeWinBy",prefix:"Win by ",options:[1,2],defaultValue:2,tbSet:!0,id:"winBy",tb:!0},{getValue:(e,t)=>{const r=To(e,t);return r.timed&&r.minutes||void 0},options:[10,15,20,25,30,45,60,90],onChange:"changeMinutes",whats:[wf],suffix:" Minutes",defaultValue:10,id:"minutes",timed:!0}],Df={changeWhat:(e,t,r)=>{const i=r===_i,n=t?"finalSetTiebreakToggle":"setTiebreakToggle",a=document.getElementById(n);a.style.display=i?"":Qr,$c.forEach(s=>{if(s.whats){const{prefix:o="",suffix:c="",pluralize:u}=s,l=s.whats.includes(r),d=t?`${s.id}-${t}`:s.id,p=document.getElementById(d);if(p.style.display===Qr&&l){const m=qt.bestOf,f=!t&&u&&m>1?"s":"",h=s.defaultValue;p.innerHTML=`${o}${h}${f}${c}${ua}`,Bt[t?"finalSetFormat":"setFormat"][s.id]=h}p.style.display=l?"":Qr}}),Yi()},changeCount:(e,t,r)=>{const i=t?"finalSetFormat":"setFormat";Bt[i].setTo=r;const n=Bt[i].tiebreakAt;if(!(r>1?[r-1,r]:[]).includes(n)){Bt[i].tiebreakAt=r;const s=document.getElementById(t?`tiebreakAt-${t}`:"tiebreakAt");s&&(s.innerHTML=`@${r}${ua}`)}Yi()},changeTiebreakAt:(e,t,r)=>{Bt[t?"finalSetFormat":"setFormat"].tiebreakAt=r,Yi()},updateWhatValue:(e,t,r)=>{Bt[t?"finalSetFormat":"setFormat"].what=r},changeAdvantage:(e,t,r)=>{Bt[t?"finalSetFormat":"setFormat"].advantage=r,Yi()},changeTiebreakTo:(e,t,r)=>{Bt[t?"finalSetFormat":"setFormat"].tiebreakTo=r,Yi()},changeWinBy:(e,t,r)=>{Bt[t?"finalSetFormat":"setFormat"].winBy=r,Yi()},changeMinutes:(e,t,r)=>{Bt[t?"finalSetFormat":"setFormat"].minutes=r,Yi()},pluralize:(e,t,r)=>{const i=Bt[t?"finalSetFormat":"setFormat"].what,n=t?`what-${t}`:"what",a=document.getElementById(n),s=r>1?"s":"";a.innerHTML=`${i}${s}${ua}`,Yi()},updateFinalSetVisibility:(e,t,r)=>{const i=r>1,n=document.getElementById("finalSetOption"),a=document.querySelector('label[for="finalSetOption"]');n&&a&&(i?(n.style.display="",a.style.display=""):(n.checked&&(n.checked=!1,n.dispatchEvent(new Event("change"))),n.style.display="none",a.style.display="none"))}};function dW({existingMatchUpFormat:e="SET3-S:6/TB7",callback:t,config:r,modalConfig:i}={}){Ss=e,qt=qm.parse(Ss);const a=[{onClick:()=>t?.(""),label:"Cancel",intent:"none",close:!0},{label:"Select",intent:"is-info",close:!0,onClick:()=>{const P=document.getElementById("matchUpFormatSelector"),R=P?.value&&P.value!=="Custom"?Ss:OC();vf(t)&&t(R)}}],s="switch is-rounded is-danger",o=document.createElement("div"),c=document.createElement("div");c.id="matchUpFormatString",c.innerHTML=Ss,c.style.fontSize="1.5em",c.style.color="blue",c.style.marginBottom="1em",o.appendChild(c);const u=document.createElement("div");u.style.marginBlockEnd="1em";const l={options:[{value:"Custom",label:"Custom",selected:!1},...AC.filter(P=>P.format).map(P=>({selected:P.format===Ss,value:P.format,label:P.name}))]},d=document.createElement("select");d.id="matchUpFormatSelector",d.className="input",d.style.width="100%",d.style.backgroundColor="#ffffff",d.style.color="#363636",d.style.border="1px solid #b5b5b5";for(const P of l.options){const M=document.createElement("option");M.value=P.value||"",M.text=P.label||"",M.style.backgroundColor="#ffffff",M.style.color="#363636",P.selected&&(M.selected=!0),d.appendChild(M)}d.onchange=P=>{Ss=P.target.value,Yi(Ss),qt=qm.parse(Ss),Bt.setFormat=qt.setFormat,Bt.setFormat.bestOf=qt.bestOf,qt.finalSetFormat&&(Bt.finalSetFormat=qt.finalSetFormat);const M=qt.finalSetFormat;U.style.display=M?"":Qr,D.style.display=M?"":Qr,I.checked=M,v.checked=!!M?.tiebreakFormat,f.checked=qt.setFormat.tiebreakFormat,$c.forEach(R=>{if(R.getValue){const E=R.getValue(qt),A=document.getElementById(R.id);if(A&&E){const{prefix:N="",suffix:C="",pluralize:k}=R,O=qt.bestOf,L=k&&O>1?"s":"";A.innerHTML=`${N}${E}${L}${C}${ua}`,A.style.display=""}else A&&(A.style.display=Qr);if(M){const N=R.getValue(qt,!0),C=document.getElementById(`${R.id}-1`);if(C&&N){const{prefix:k="",suffix:O="",pluralize:L}=R,_=qt.bestOf,B=L&&_>1?"s":"";C.innerHTML=`${k}${N}${B}${O}${ua}`,C.style.display=""}else C&&(C.style.display=Qr)}}})},u.appendChild(d),o.appendChild(u);const p=document.createElement("div");p.style.display="flex",p.style.flexWrap="wrap",p.style.gap="0.5em",p.style.marginBottom="1em",$c.map(P=>{const M=P.getValue?P.getValue(qt):void 0;return kC({...P,value:M})}).forEach(P=>p.appendChild(P)),p.id="setFormat",o.appendChild(p);const m=document.createElement("div");m.className="field",m.style.fontSize="1em";const f=document.createElement("input");f.className=s,f.name="setTiebreak",f.id="setTiebreak",f.type="checkbox",f.checked=!!qt.setFormat.tiebreakFormat,f.onchange=P=>{const M=P.target.checked;$c.filter(({tb:R})=>R).forEach(R=>{const E=document.getElementById(R.id);if(E){if(E.style.display===Qr&&M){const{prefix:A="",suffix:N="",pluralize:C,defaultValue:k}=R,O=qt.bestOf,L=C&&O>1?"s":"";E.innerHTML=`${A}${k}${L}${N}${ua}`}E.style.display=M?"":Qr}}),Yi()},m.appendChild(f);const h=document.createElement("label");h.setAttribute("for","setTiebreak"),h.id="setTiebreakToggle",h.innerHTML="Tiebreak",h.style.marginRight="1em",m.appendChild(h);const g=qt.bestOf>1,I=document.createElement("input");I.className="switch is-rounded is-info",I.type="checkbox",I.name="finalSetOption",I.checked=!!qt.finalSetFormat,I.id="finalSetOption",I.style.display=g?"":"none",I.onchange=P=>{const M=P.target.checked;U.style.display=M?"":Qr,D.style.display=M?"":Qr,Yi()},m.appendChild(I);const y=document.createElement("label");y.setAttribute("for","finalSetOption"),y.innerHTML="Final set",y.style.display=g?"":"none",m.appendChild(y),o.appendChild(m);const U=document.createElement("div");U.style.display=qt.finalSetFormat?"flex":Qr,U.style.flexWrap="wrap",U.style.gap="0.5em",U.style.marginBottom="1em",U.id="finalSetFormat",[{label:"<div style='font-weight: bold'>Final set</div>",options:[],finalSet:!0}].concat($c.map(P=>{const M=P.getValue?P.getValue(qt,!0):void 0;return{...P,value:M}})).filter(P=>P.finalSet!==!1).map(P=>kC({...P,index:1})).forEach(P=>U.appendChild(P)),o.appendChild(U);const D=document.createElement("div");D.id="finalSetConfig",D.style.display=qt.finalSetFormat?"":Qr,D.className="field",D.style.fontSize="1em";const v=document.createElement("input");v.className=s,v.name="finalSetTiebreak",v.id="finalSetTiebreak",v.type="checkbox",v.checked=qt.finalSetFormat?.tiebreakFormat,D.onchange=P=>{const M=P.target.checked;$c.filter(({tb:R})=>R).forEach(R=>{const E=document.getElementById(`${R.id}-1`);if(E.style.display===Qr&&M){const{prefix:A="",suffix:N="",pluralize:C,defaultValue:k}=R,O=qt.bestOf,L=C&&O>1?"s":"";E.innerHTML=`${A}${k}${L}${N}${ua}`}E.style.display=M?"":Qr}),Yi()},D.appendChild(v);const w=document.createElement("label");w.setAttribute("for","finalSetTiebreak"),w.id="finalSetTiebreakToggle",w.innerHTML="Tiebreak",w.style.marginRight="1em",D.appendChild(w),o.appendChild(D);const S={content:{padding:"1.5"},maxWidth:480,fontSize:"14px",style:{backgroundColor:"#f8f9fa",borderRadius:"8px",boxShadow:"0 8px 16px rgba(0, 102, 204, 0.2)"}},T=i?.fontSize||i?.style?.fontSize||S.fontSize,b={...S,...i,fontSize:T,style:{...S.style,...r?.style||{},...i?.style||{}}};return pd.open({title:"Score format",content:o,buttons:a,config:b})}function pW({index:e,finalSetLabel:t,label:r,prefix:i="",suffix:n="",value:a,pluralize:s}){const o=!e&&s&&(Bt.setFormat.bestOf||1)>1?"s":"";return r||e&&t||`${i}${a}${o}${n}${ua}`}function kC(e){const{id:t,initiallyHidden:r,index:i,value:n}=e,a=document.createElement("button");return a.className="mfcButton",a.id=i?`${t}-${i}`:t,a.innerHTML=pW(e),a.onclick=s=>mW({e:s,button:a,...e}),a.style.display=n||e.label?"":Qr,r&&(a.style.display=Qr),a.style.transition="all .2s ease-in-out",a.style.backgroundColor="inherit",a.style.border="none",a.style.color="inherit",a.style.padding=".3em",a.style.textAlign="center",a.style.textDecoration="none",a.style.fontSize="1em",a.style.cursor="pointer",a}function mW(e){const{e:t,id:r,button:i,pluralize:n,options:a,onChange:s,onChangeCallback:o,index:c,prefix:u="",suffix:l=""}=e,d=Bt.setFormat.bestOf||1,p=!c&&n&&d>1?"s":"",f=(vf(a)?a(c):a).map(h=>({text:`${h}${p}`,onClick:()=>{i.innerHTML=`${u}${h}${p}${l}${ua}`,s&&vf(Df[s])&&Df[s](t,c,h),o&&vf(Df[o])&&Df[o](t,c,h),Bt[c?"finalSetFormat":"setFormat"][r]=h,Yi()}}));fW(t,f)}let Jl=null,Zl=null;function xC(){Jl&&document.body.contains(Jl)&&Jl.remove(),Zl&&(document.removeEventListener("click",Zl),Zl=null),Jl=null}function fW(e,t){xC();const r=document.createElement("div");r.className="dropdown is-active",r.style.position="absolute",r.style.zIndex="10000";const i=document.createElement("div");i.className="dropdown-menu",i.style.backgroundColor="white",i.style.border="1px solid #ddd",i.style.borderRadius="4px",i.style.boxShadow="0 2px 8px rgba(0,0,0,0.15)";const n=()=>{xC()};t.forEach(s=>{const o=document.createElement("div");o.style.padding="0.5em 1em",o.style.cursor="pointer",o.style.backgroundColor="white",o.style.color="#363636",o.style.fontSize="1rem",o.style.lineHeight="1.5",o.textContent=s.text,o.onclick=c=>{c.preventDefault(),c.stopPropagation(),n(),setTimeout(()=>{s.onClick()},0)},o.onmouseenter=()=>{o.style.backgroundColor="#f5f5f5",o.style.color="#363636"},o.onmouseleave=()=>{o.style.backgroundColor="white",o.style.color="#363636"},i.appendChild(o)}),r.appendChild(i);const a=e.target.getBoundingClientRect();r.style.left=`${a.left}px`,r.style.top=`${a.bottom}px`,document.body.appendChild(r),Jl=r,setTimeout(()=>{Zl=s=>{r.contains(s.target)||n()},document.addEventListener("click",Zl)},100)}function hW(){return"0.8.5"}function hn(e){return typeof e=="function"}function gW(e,t,r){if(!e)return{elements:{}};const i={};for(const n of t||[]){if(!n?.label||n.hide)continue;const a=document.createElement("button");n.id&&(i[n.id]=a,a.id=n.id),a.style.marginRight=".5em",a.className="button font-medium",n.intent&&a.classList.add(n.intent),a.innerHTML=n.label,n.disabled&&(a.disabled=!0),a.onclick=s=>{s.stopPropagation(),!s.target.disabled&&hn(n.onClick)&&n.onClick(),r&&hn(r)&&r()},e.appendChild(a)}return{elements:i}}var PS={exports:{}},FC;function IW(){return FC||(FC=1,(function(e){(function(){var t=function(c,u){var l=this;t.count=(t.count||0)+1,this.count=t.count,this.isOpened=!1,this.input=a(c),this.input.setAttribute("autocomplete","off"),this.input.setAttribute("aria-autocomplete","list"),this.input.setAttribute("aria-expanded","false"),this.input.setAttribute("aria-controls","awesomplete_list_"+this.count),this.input.setAttribute("aria-owns","awesomplete_list_"+this.count),this.input.setAttribute("role","combobox"),this.options=u=u||{},i(this,{minChars:2,maxItems:10,autoFirst:!1,data:t.DATA,filter:t.FILTER_CONTAINS,sort:u.sort===!1?!1:t.SORT_BYLENGTH,container:t.CONTAINER,item:t.ITEM,replace:t.REPLACE,tabSelect:!1,listLabel:"Results List",statusNoResults:"No results found",statusXResults:"{0} results found",statusTypeXChar:"Type {0} or more characters for results"},u),this.index=-1,this.container=this.container(c),this.ul=a.create("ul",{hidden:"hidden",role:"listbox",id:"awesomplete_list_"+this.count,inside:this.container,"aria-label":this.listLabel}),this.status=a.create("span",{className:"visually-hidden",role:"status","aria-live":"assertive","aria-atomic":!0,inside:this.container,textContent:""}),this._events={input:{input:this.evaluate.bind(this),blur:this.close.bind(this,{reason:"blur"}),keydown:function(d){var p=d.keyCode;l.opened&&(p===13&&l.selected||p===9&&l.selected&&l.tabSelect?(d.preventDefault(),l.select(void 0,void 0,d)):p===27?l.close({reason:"esc"}):(p===38||p===40)&&(d.preventDefault(),l[p===38?"previous":"next"]()))}},form:{submit:this.close.bind(this,{reason:"submit"})},ul:{mousedown:function(d){d.preventDefault()},click:function(d){var p=d.target;if(p!==this){for(;p&&!/li/i.test(p.nodeName);)p=p.parentNode;p&&d.button===0&&(d.preventDefault(),l.select(p,d.target,d))}}}},a.bind(this.input,this._events.input),a.bind(this.input.form,this._events.form),a.bind(this.ul,this._events.ul),this.input.hasAttribute("list")?(this.list="#"+this.input.getAttribute("list"),this.input.removeAttribute("list")):this.list=this.input.getAttribute("data-list")||u.list||[],t.all.push(this)};t.prototype={set list(c){if(Array.isArray(c))this._list=c;else if(typeof c=="string"&&c.indexOf(",")>-1)this._list=c.split(/\s*,\s*/);else if(c=a(c),c&&c.children){var u=[];n.apply(c.children).forEach(function(l){if(!l.disabled){var d=l.textContent.trim(),p=l.value||d,m=l.label||d;p!==""&&u.push({label:m,value:p})}}),this._list=u}document.activeElement===this.input&&this.evaluate()},get selected(){return this.index>-1},get opened(){return this.isOpened},close:function(c){this.opened&&(this.input.setAttribute("aria-expanded","false"),this.ul.setAttribute("hidden",""),this.isOpened=!1,this.index=-1,this.status.setAttribute("hidden",""),this.input.setAttribute("aria-activedescendant",""),a.fire(this.input,"awesomplete-close",c||{}))},open:function(){this.input.setAttribute("aria-expanded","true"),this.ul.removeAttribute("hidden"),this.isOpened=!0,this.status.removeAttribute("hidden"),this.autoFirst&&this.index===-1&&this.goto(0),a.fire(this.input,"awesomplete-open")},destroy:function(){if(a.unbind(this.input,this._events.input),a.unbind(this.input.form,this._events.form),!this.options.container){var c=this.container.parentNode;c.insertBefore(this.input,this.container),c.removeChild(this.container)}this.input.removeAttribute("autocomplete"),this.input.removeAttribute("aria-autocomplete"),this.input.removeAttribute("aria-expanded"),this.input.removeAttribute("aria-controls"),this.input.removeAttribute("aria-owns"),this.input.removeAttribute("role");var u=t.all.indexOf(this);u!==-1&&t.all.splice(u,1)},next:function(){var c=this.ul.children.length;this.goto(this.index<c-1?this.index+1:c?0:-1)},previous:function(){var c=this.ul.children.length,u=this.index-1;this.goto(this.selected&&u!==-1?u:c-1)},goto:function(c){var u=this.ul.children;this.selected&&u[this.index].setAttribute("aria-selected","false"),this.index=c,c>-1&&u.length>0&&(u[c].setAttribute("aria-selected","true"),this.input.setAttribute("aria-activedescendant",this.ul.id+"_item_"+this.index),this.ul.scrollTop=u[c].offsetTop-this.ul.clientHeight+u[c].clientHeight,a.fire(this.input,"awesomplete-highlight",{text:this.suggestions[this.index]}))},select:function(c,u,l){if(c?this.index=a.siblingIndex(c):c=this.ul.children[this.index],c){var d=this.suggestions[this.index],p=a.fire(this.input,"awesomplete-select",{text:d,origin:u||c,originalEvent:l});p&&(this.replace(d),this.close({reason:"select"}),a.fire(this.input,"awesomplete-selectcomplete",{text:d,originalEvent:l}))}},evaluate:function(){var c=this,u=this.input.value;u.length>=this.minChars&&this._list&&this._list.length>0?(this.index=-1,this.ul.innerHTML="",this.suggestions=this._list.map(function(l){return new r(c.data(l,u))}).filter(function(l){return c.filter(l,u)}),this.sort!==!1&&(this.suggestions=this.suggestions.sort(this.sort)),this.suggestions=this.suggestions.slice(0,this.maxItems),this.suggestions.forEach(function(l,d){c.ul.appendChild(c.item(l,u,d))}),this.ul.children.length===0?(this.status.textContent=this.statusNoResults,this.close({reason:"nomatches"})):(this.input.setAttribute("aria-activedescendant",""),this.open(),this.status.textContent=this.statusXResults.replaceAll("{0}",this.ul.children.length))):(this.close({reason:"nomatches"}),this.minChar<=1||u.length>=this.minChars?this.status.textContent=this.statusNoResults:this.status.textContent=this.statusTypeXChar.replaceAll("{0}",this.minChars))}},t.all=[],t.FILTER_CONTAINS=function(c,u){return RegExp(a.regExpEscape(u.trim()),"i").test(c)},t.FILTER_STARTSWITH=function(c,u){return RegExp("^"+a.regExpEscape(u.trim()),"i").test(c)},t.SORT_BYLENGTH=function(c,u){return c.length!==u.length?c.length-u.length:c<u?-1:1},t.CONTAINER=function(c){return a.create("div",{className:"awesomplete",around:c})},t.ITEM=function(c,u,l){var d=u.trim()===""?c:c.replace(RegExp(a.regExpEscape(u.trim()),"gi"),"<mark>$&</mark>");return a.create("li",{innerHTML:d,role:"option","aria-selected":"false",tabindex:"-1",id:"awesomplete_list_"+this.count+"_item_"+l})},t.REPLACE=function(c){this.input.value=c.value},t.DATA=function(c){return c};function r(c){var u=Array.isArray(c)?{label:c[0],value:c[1]}:typeof c=="object"&&"label"in c&&"value"in c?c:{label:c,value:c};this.label=u.label||u.value,this.value=u.value}Object.defineProperty(r.prototype=Object.create(String.prototype),"length",{get:function(){return this.label.length}}),r.prototype.toString=r.prototype.valueOf=function(){return""+this.label};function i(c,u,l){for(var d in u){var p=u[d],m=c.input.getAttribute("data-"+d.toLowerCase());typeof p=="number"?c[d]=parseInt(m):p===!1?c[d]=m!==null:p instanceof Function?c[d]=null:c[d]=m,!c[d]&&c[d]!==0&&(c[d]=d in l?l[d]:p)}}var n=Array.prototype.slice;function a(c,u){return typeof c=="string"?(u||document).querySelector(c):c||null}function s(c,u){return n.call((u||document).querySelectorAll(c))}a.create=function(c,u){var l=document.createElement(c);for(var d in u){var p=u[d];if(d==="inside")a(p).appendChild(l);else if(d==="around"){var m=a(p);m.parentNode.insertBefore(l,m),l.appendChild(m),m.getAttribute("autofocus")!=null&&m.focus()}else d in l?l[d]=p:l.setAttribute(d,p)}return l},a.bind=function(c,u){if(c)for(var l in u){var d=u[l];l.split(/\s+/).forEach(function(p){c.addEventListener(p,d)})}},a.unbind=function(c,u){if(c)for(var l in u){var d=u[l];l.split(/\s+/).forEach(function(p){c.removeEventListener(p,d)})}},a.fire=function(c,u,l){var d=document.createEvent("HTMLEvents");d.initEvent(u,!0,!0);for(var p in l)d[p]=l[p];return c.dispatchEvent(d)},a.regExpEscape=function(c){return c.replace(/[-\\^$*+?.()|[\]{}]/g,"\\$&")},a.siblingIndex=function(c){for(var u=0;c=c.previousElementSibling;u++);return u};function o(){s("input.awesomplete").forEach(function(c){new t(c)})}return typeof self<"u"&&(self.Awesomplete=t),typeof Document<"u"&&(document.readyState!=="loading"?o():document.addEventListener("DOMContentLoaded",o)),t.$=a,t.$$=s,e.exports&&(e.exports=t),t})()})(PS)),PS.exports}var yW=IW();const UW=Lf(yW);function SW({list:e,element:t,callback:r,currentValue:i,withCatchTab:n,onChange:a}){const s=new UW(t,{list:e});t.parentElement&&(t.parentElement.style.width="100%");let o=!1;const c=u=>{o=!0,hn(r)&&r(u.text.value),t.value=u.text.label,s.suggestions=[]};if(n){const u=l=>l.key==="Tab"&&l.preventDefault();t.addEventListener("keydown",u,!1),t.addEventListener("keyup",u,!1)}if(typeof a=="function"&&t.addEventListener("change",a),t.setAttribute("autocomplete","off"),t.addEventListener("awesomplete-selectcomplete",u=>c(u),!1),t.addEventListener("keyup",function(u){(u.key==="Enter"||u.key==="Tab")&&!o&&s.suggestions?.length&&(s.next(),s.select(0)),o=!1}),i){const u=e.find(l=>l.value===i)?.label;u&&(t.value=u)}return{typeAhead:s}}function bS(e){return e[e.length-1]}function ed(e,...t){return t.forEach(r=>{e.includes(r)||e.push(r)}),e}function LC(e,t){return e?e.split(t):[]}function MS(e,t,r){const i=t===void 0||e>=t,n=r===void 0||e<=r;return i&&n}function _C(e,t,r){return e<t?t:e>r?r:e}function Wc(e,t,r={},i=0,n=""){const a=Object.keys(r).reduce((o,c)=>{let u=r[c];return typeof u=="function"&&(u=u(i)),`${o} ${c}="${u}"`},e);n+=`<${a}></${e}>`;const s=i+1;return s<t?Wc(e,t,r,s,n):n}function RS(e){return e.replace(/>\s+/g,">").replace(/\s+</,"<")}function NS(e){return new Date(e).setHours(0,0,0,0)}function Po(){return new Date().setHours(0,0,0,0)}function qc(...e){switch(e.length){case 0:return Po();case 1:return NS(e[0])}const t=new Date(0);return t.setFullYear(...e),t.setHours(0,0,0,0)}function td(e,t){const r=new Date(e);return r.setDate(r.getDate()+t)}function vW(e,t){return td(e,t*7)}function Tf(e,t){const r=new Date(e),i=r.getMonth()+t;let n=i%12;n<0&&(n+=12);const a=r.setMonth(i);return r.getMonth()!==n?r.setDate(0):a}function rd(e,t){const r=new Date(e),i=r.getMonth(),n=r.setFullYear(r.getFullYear()+t);return i===1&&r.getMonth()===2?r.setDate(0):n}function BC(e,t){return(e-t+7)%7}function bo(e,t,r=0){const i=new Date(e).getDay();return td(e,BC(t,r)-BC(i,r))}function VC(e,t){return Math.round((e-t)/6048e5)+1}function wW(e){const t=bo(e,4,1),r=bo(new Date(t).setMonth(0,4),4,1);return VC(t,r)}function jC(e,t){const r=bo(new Date(e).setMonth(0,1),t,t),i=bo(e,t,t),n=VC(i,r);if(n<53)return n;const a=bo(new Date(e).setDate(32),t,t);return i===a?1:n}function DW(e){return jC(e,0)}function TW(e){return jC(e,6)}function Hc(e,t){const r=new Date(e).getFullYear();return Math.floor(r/t)*t}function vs(e,t,r){if(t!==1&&t!==2)return e;const i=new Date(e);return t===1?r?i.setMonth(i.getMonth()+1,0):i.setDate(1):r?i.setFullYear(i.getFullYear()+1,0,0):i.setMonth(0,1),i.setHours(0,0,0,0)}const ES=/dd?|DD?|mm?|MM?|yy?(?:yy)?/,PW=/[\s!-/:-@[-`{-~年月日]+/;let AS={};const GC={y(e,t){return new Date(e).setFullYear(parseInt(t,10))},m(e,t,r){const i=new Date(e);let n=parseInt(t,10)-1;if(isNaN(n)){if(!t)return NaN;const a=t.toLowerCase(),s=o=>o.toLowerCase().startsWith(a);if(n=r.monthsShort.findIndex(s),n<0&&(n=r.months.findIndex(s)),n<0)return NaN}return i.setMonth(n),i.getMonth()!==$C(n)?i.setDate(0):i.getTime()},d(e,t){return new Date(e).setDate(parseInt(t,10))}},bW={d(e){return e.getDate()},dd(e){return Pf(e.getDate(),2)},D(e,t){return t.daysShort[e.getDay()]},DD(e,t){return t.days[e.getDay()]},m(e){return e.getMonth()+1},mm(e){return Pf(e.getMonth()+1,2)},M(e,t){return t.monthsShort[e.getMonth()]},MM(e,t){return t.months[e.getMonth()]},y(e){return e.getFullYear()},yy(e){return Pf(e.getFullYear(),2).slice(-2)},yyyy(e){return Pf(e.getFullYear(),4)}};function $C(e){return e>-1?e%12:$C(e+12)}function Pf(e,t){return e.toString().padStart(t,"0")}function WC(e){if(typeof e!="string")throw new Error("Invalid date format.");if(e in AS)return AS[e];const t=e.split(ES),r=e.match(new RegExp(ES,"g"));if(t.length===0||!r)throw new Error("Invalid date format.");const i=r.map(a=>bW[a]),n=Object.keys(GC).reduce((a,s)=>(r.find(c=>c[0]!=="D"&&c[0].toLowerCase()===s)&&a.push(s),a),[]);return AS[e]={parser(a,s){const o=a.split(PW).reduce((c,u,l)=>{if(u.length>0&&r[l]){const d=r[l][0];d==="M"?c.m=u:d!=="D"&&(c[d]=u)}return c},{});return n.reduce((c,u)=>{const l=GC[u](c,o[u],s);return isNaN(l)?c:l},Po())},formatter(a,s){let o=i.reduce((c,u,l)=>c+=`${t[l]}${u(a,s)}`,"");return o+=bS(t)}}}function Mo(e,t,r){if(e instanceof Date||typeof e=="number"){const i=NS(e);return isNaN(i)?void 0:i}if(e){if(e==="today")return Po();if(t&&t.toValue){const i=t.toValue(e,t,r);return isNaN(i)?void 0:NS(i)}return WC(t).parser(e,r)}}function id(e,t,r){if(isNaN(e)||!e&&e!==0)return"";const i=typeof e=="number"?new Date(e):e;return t.toDisplay?t.toDisplay(i,t,r):WC(t).formatter(i,r)}const MW=document.createRange();function Fa(e){return MW.createContextualFragment(e)}function qC(e){return e.parentElement||(e.parentNode instanceof ShadowRoot?e.parentNode.host:void 0)}function bf(e){return e.getRootNode().activeElement===e}function nd(e){e.style.display!=="none"&&(e.style.display&&(e.dataset.styleDisplay=e.style.display),e.style.display="none")}function ad(e){e.style.display==="none"&&(e.dataset.styleDisplay?(e.style.display=e.dataset.styleDisplay,delete e.dataset.styleDisplay):e.style.display="")}function Mf(e){e.firstChild&&(e.removeChild(e.firstChild),Mf(e))}function RW(e,t){Mf(e),t instanceof DocumentFragment?e.appendChild(t):typeof t=="string"?e.appendChild(Fa(t)):typeof t.forEach=="function"&&t.forEach(r=>{e.appendChild(r)})}const Rf=new WeakMap,{addEventListener:NW,removeEventListener:EW}=EventTarget.prototype;function Nf(e,t){let r=Rf.get(e);r||(r=[],Rf.set(e,r)),t.forEach(i=>{NW.call(...i),r.push(i)})}function HC(e){let t=Rf.get(e);t&&(t.forEach(r=>{EW.call(...r)}),Rf.delete(e))}if(!Event.prototype.composedPath){const e=(t,r=[])=>{r.push(t);let i;return t.parentNode?i=t.parentNode:t.host?i=t.host:t.defaultView&&(i=t.defaultView),i?e(i,r):r};Event.prototype.composedPath=function(){return e(this.target)}}function zC(e,t,r){const[i,...n]=e;if(t(i))return i;if(!(i===r||i.tagName==="HTML"||n.length===0))return zC(n,t,r)}function YC(e,t){const r=typeof t=="function"?t:i=>i instanceof Element&&i.matches(t);return zC(e.composedPath(),r,e.currentTarget)}const sd={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear",titleFormat:"MM y"}},CS={autohide:!1,beforeShowDay:null,beforeShowDecade:null,beforeShowMonth:null,beforeShowYear:null,clearButton:!1,dateDelimiter:",",datesDisabled:[],daysOfWeekDisabled:[],daysOfWeekHighlighted:[],defaultViewDate:void 0,disableTouchKeyboard:!1,enableOnReadonly:!0,format:"mm/dd/yyyy",language:"en",maxDate:null,maxNumberOfDates:1,maxView:3,minDate:null,nextArrow:"»",orientation:"auto",pickLevel:0,prevArrow:"«",showDaysOfWeek:!0,showOnClick:!0,showOnFocus:!0,startView:0,title:"",todayButton:!1,todayButtonMode:0,todayHighlight:!1,updateOnBlur:!0,weekNumbers:0,weekStart:0},{language:OS,format:AW,weekStart:CW}=CS;function KC(e,t){return e.length<6&&t>=0&&t<7?ed(e,t):e}function XC(e,t){switch(e===4?t===6?3:!t+1:e){case 1:return wW;case 2:return DW;case 3:return TW}}function QC(e,t,r){return t.weekStart=e,t.weekEnd=(e+6)%7,r===4&&(t.getWeekNumber=XC(4,e)),e}function JC(e,t,r,i){const n=Mo(e,t,r);return n!==void 0?n:i}function kS(e,t,r=3){const i=parseInt(e,10);return i>=0&&i<=r?i:t}function Ef(e,t,r,i=void 0){t in e&&(r in e||(e[r]=i?i(e[t]):e[t]),delete e[t])}function xS(e,t){const r=Object.assign({},e),i={},n=t.constructor.locales,a=!!t.rangeSideIndex;let{datesDisabled:s,format:o,language:c,locale:u,maxDate:l,maxView:d,minDate:p,pickLevel:m,startView:f,weekNumbers:h,weekStart:g}=t.config||{};if(Ef(r,"calendarWeeks","weekNumbers",w=>w?1:0),Ef(r,"clearBtn","clearButton"),Ef(r,"todayBtn","todayButton"),Ef(r,"todayBtnMode","todayButtonMode"),r.language){let w;if(r.language!==c&&(n[r.language]?w=r.language:(w=r.language.split("-")[0],n[w]||(w=!1))),delete r.language,w){c=i.language=w;const S=u||n[OS];u=Object.assign({format:AW,weekStart:CW},n[OS]),c!==OS&&Object.assign(u,n[c]),i.locale=u,o===S.format&&(o=i.format=u.format),g===S.weekStart&&(g=QC(u.weekStart,i,h))}}if(r.format){const w=typeof r.format.toDisplay=="function",S=typeof r.format.toValue=="function",T=ES.test(r.format);(w&&S||T)&&(o=i.format=r.format),delete r.format}let I=m;"pickLevel"in r&&(I=kS(r.pickLevel,m,2),delete r.pickLevel),I!==m&&(I>m&&("minDate"in r||(r.minDate=p),"maxDate"in r||(r.maxDate=l)),s&&!r.datesDisabled&&(r.datesDisabled=[]),m=i.pickLevel=I);let y=p,U=l;if("minDate"in r){const w=qc(0,0,1);y=r.minDate===null?w:JC(r.minDate,o,u,y),y!==w&&(y=vs(y,m,!1)),delete r.minDate}if("maxDate"in r&&(U=r.maxDate===null?void 0:JC(r.maxDate,o,u,U),U!==void 0&&(U=vs(U,m,!0)),delete r.maxDate),U<y?(p=i.minDate=U,l=i.maxDate=y):(p!==y&&(p=i.minDate=y),l!==U&&(l=i.maxDate=U)),r.datesDisabled){const w=r.datesDisabled;if(typeof w=="function")i.datesDisabled=null,i.checkDisabled=(S,T)=>w(new Date(S),T,a);else{const S=i.datesDisabled=w.reduce((T,b)=>{const P=Mo(b,o,u);return P!==void 0?ed(T,vs(P,m,a)):T},[]);i.checkDisabled=T=>S.includes(T)}delete r.datesDisabled}if("defaultViewDate"in r){const w=Mo(r.defaultViewDate,o,u);w!==void 0&&(i.defaultViewDate=w),delete r.defaultViewDate}if("weekStart"in r){const w=Number(r.weekStart)%7;isNaN(w)||(g=QC(w,i,h)),delete r.weekStart}if(r.daysOfWeekDisabled&&(i.daysOfWeekDisabled=r.daysOfWeekDisabled.reduce(KC,[]),delete r.daysOfWeekDisabled),r.daysOfWeekHighlighted&&(i.daysOfWeekHighlighted=r.daysOfWeekHighlighted.reduce(KC,[]),delete r.daysOfWeekHighlighted),"weekNumbers"in r){let w=r.weekNumbers;if(w){const S=typeof w=="function"?(T,b)=>w(new Date(T),b):XC(w=parseInt(w,10),g);S&&(h=i.weekNumbers=w,i.getWeekNumber=S)}else h=i.weekNumbers=0,i.getWeekNumber=null;delete r.weekNumbers}if("maxNumberOfDates"in r){const w=parseInt(r.maxNumberOfDates,10);w>=0&&(i.maxNumberOfDates=w,i.multidate=w!==1),delete r.maxNumberOfDates}r.dateDelimiter&&(i.dateDelimiter=String(r.dateDelimiter),delete r.dateDelimiter);let D=d;"maxView"in r&&(D=kS(r.maxView,d),delete r.maxView),D=m>D?m:D,D!==d&&(d=i.maxView=D);let v=f;if("startView"in r&&(v=kS(r.startView,v),delete r.startView),v<m?v=m:v>d&&(v=d),v!==f&&(i.startView=v),r.prevArrow){const w=Fa(r.prevArrow);w.childNodes.length>0&&(i.prevArrow=w.childNodes),delete r.prevArrow}if(r.nextArrow){const w=Fa(r.nextArrow);w.childNodes.length>0&&(i.nextArrow=w.childNodes),delete r.nextArrow}if("disableTouchKeyboard"in r&&(i.disableTouchKeyboard="ontouchstart"in document&&!!r.disableTouchKeyboard,delete r.disableTouchKeyboard),r.orientation){const w=r.orientation.toLowerCase().split(/\s+/g);i.orientation={x:w.find(S=>S==="left"||S==="right")||"auto",y:w.find(S=>S==="top"||S==="bottom")||"auto"},delete r.orientation}if("todayButtonMode"in r){switch(r.todayButtonMode){case 0:case 1:i.todayButtonMode=r.todayButtonMode}delete r.todayButtonMode}return Object.entries(r).forEach(([w,S])=>{S!==void 0&&w in CS&&(i[w]=S)}),i}const ZC={show:{key:"ArrowDown"},hide:null,toggle:{key:"Escape"},prevButton:{key:"ArrowLeft",ctrlOrMetaKey:!0},nextButton:{key:"ArrowRight",ctrlOrMetaKey:!0},viewSwitch:{key:"ArrowUp",ctrlOrMetaKey:!0},clearButton:{key:"Backspace",ctrlOrMetaKey:!0},todayButton:{key:".",ctrlOrMetaKey:!0},exitEditMode:{key:"ArrowDown",ctrlOrMetaKey:!0}};function OW(e){return Object.keys(ZC).reduce((t,r)=>{const i=e[r]===void 0?ZC[r]:e[r],n=i&&i.key;if(!n||typeof n!="string")return t;const a={key:n,ctrlOrMetaKey:!!(i.ctrlOrMetaKey||i.ctrlKey||i.metaKey)};return n.length>1&&(a.altKey=!!i.altKey,a.shiftKey=!!i.shiftKey),t[r]=a,t},{})}const e0=e=>e.map(t=>`<button type="button" class="%buttonClass% ${t}" tabindex="-1"></button>`).join(""),kW=RS(`<div class="datepicker">
37
+ `;return a.innerHTML=u||"",a}const yC=Ve({flexDirection:"column",display:"flex"}),O$=Ve({flexDirection:"row",display:"flex"}),UC=Ve({justifyContent:"space-around",marginInlineStart:"16px",marginInlineEnd:"16px",flexDirection:"column",height:"100%",display:"flex",variants:{variant:{adHoc:{justifyContent:"flex-start"}}}}),k$=Ve({borderTop:"solid 1px black",marginRight:"-1em",marginLeft:"-1em",paddingTop:".5em",marginTop:".2em",variants:{variant:{0:{marginTop:"1em",borderTop:"none",paddingTop:"0px"}},roundOrder:{first:{marginLeft:"0em"},last:{marginRight:"0em"}}}}),x$=Ve({fontWeight:"bold",color:"blue",height:"1em"}),SC=Ve({width:"$score$setWidth",display:"inline-block",fontSize:9,variants:{variant:{set:{textAlign:"center"},points:{marginInlineEnd:3}}}}),F$=Ve({transform:"translateY(-50%)",textTransform:"uppercase",backgroundColor:"#fff",position:"absolute",textAlign:"center",top:"calc(50%)",color:"#bbb",fontSize:0,right:4});function L$(){return Ve({backgroundColor:"magenta",position:"absolute",opacity:"0.2",height:"100%",width:"100%",top:0})()}const _$=Ve({});function B$({configuration:e}){const t={backgroundColor:"$matchUpBackgroundColor",WebkitTransition:"all 0.30s linear",boxShadow:"$matchUp$boxShadow",transition:"all 0.30s linear",border:"solid $border",marginBottom:"$space$1",marginTop:"$space$1",position:"relative",display:"grid",width:"100%",borderInlineStartWidth:"$borderWidths$borderInlineStart"};if(e?.matchUpHover){const r=typeof e.matchUpHover=="string"?e.matchUpHover:"cyan";t["&:hover"]={backgroundColor:r}}else t["&:hover"]={borderColor:"$borderHover"};return Ve(t)()}function V$({variant:e}){return Ve({borderBottom:"solid 1px lightgray",backgroundColor:"$matchUp",position:"relative",width:"100%",height:"$lineHeights$centerInfo",variants:{variant:{1:{borderBottom:"solid 1px black"},2:{borderBottom:"solid 1px lightgray"}}}})({variant:e})}const j$=Ve({justifyContent:"center",alignContent:"center",flexDirection:"column",height:"100%",display:"flex"}),G$=Ve({fontFamily:"Lato,Arial,Helvetica,sans-serif",WebkitFontSmooting:"antialiased",marginInlineStart:"calc(20%)",WebkitBoxOrient:"horizontal",WebKitBoxDirection:"normal",WebkitBoxPack:"center",boxSizing:"inherit",flexDirection:"row",display:"flex"}),vC=Ve({alignContent:"center",boxSizing:"inherit",fontFamily:"Lato",fontWeight:900,fontSize:9});function $$({eventHandlers:e,entryStatus:t,sideNumber:r,className:i,matchUp:n}){const a=document.createElement("div");Bi(e?.centerInfoClick)&&(a.onclick=l=>e.centerInfoClick({matchUp:n,sideNumber:r,pointerEvent:l})),a.className=La(V$({variant:r}),i),a.classList.add("tmx-ci"),a.setAttribute("sideNumber",String(r));const s=document.createElement("div");s.className=j$();const o=document.createElement("div");o.className=G$();const c=document.createElement("div");c.className=vC(),c.innerHTML=t?"Entry status:&nbsp;":"",o.appendChild(c);const u=document.createElement("div");return u.className=vC(),u.innerHTML=t||"",o.appendChild(u),s.appendChild(o),a.appendChild(s),{element:a}}const Kl={scheduleInfo:1.8,centerInfo:1.5,gameScore:2};function W$({composition:e,isDoubles:t,roundFactor:r=1}){const i=parseInt(window.getComputedStyle(document.body).getPropertyValue("font-size")),n=e?.configuration||{},a=n?.connectorWidth||16,s=n.centerInfo?Kl.centerInfo*i:0,o=n.scheduleInfo?Kl.scheduleInfo*i:0,u=(60+(n.showAddress?i:0))*(t?1.3:1)+s,l=u*r,d=(u+o)*r;return Ve({"&::before":{borderBlockStart:"$borderWidths$matchUp solid #999",left:-a,width:a,position:"absolute",borderRadius:2,top:-1},"&::after":{width:a,position:"absolute",borderRadius:2,left:"100%"},"&::after, &::before":{borderWidth:"$borderWidths$matchUp",borderColor:"$connector",display:"block",content:""},variants:{isFirstRound:{true:{"&::before":{height:0,width:0,borderWidth:0}}},link:{m1:{"&::after":{borderInlineEnd:"$borderWidths$matchUp solid $connector",borderTopStyle:"solid",height:l,top:-1}},m2:{"&::after":{bottom:"calc(100%)",borderInlineEnd:"$borderWidths$matchUp solid $connector",borderBottomStyle:"solid",height:d}},m0:{"&::after":{borderTopStyle:"solid",borderColor:"$connector",top:-1}},mr:{"&::before":{height:0,width:0,borderWidth:0},"&::after":{height:0,width:0,borderWidth:0}},noProgression:{true:{"&::after":{height:0,width:0,borderWidth:0}}}}}})}const wC=e=>Ve({display:"flex",alignItems:"center",height:e,justifyContent:"flex-end",backgroundColor:"$matchUp",variants:{sideNumber:{1:{borderBottom:"1px solid $internalDividers"}},fontSize:{small:{fontSize:"smaller",paddingRight:"1em",color:"blue"}}}}),q$=Ve({lineHeight:"0.75rem",fontSize:"0.625rem",left:"1.1rem",top:".4rem"}),DC=Ve({lineHeight:"$lineHeights$gameScore",justifyContent:"center",width:"$score$setWidth",position:"relative",textAlign:"center",cursor:"pointer",fontWeight:500,fontSize:"$1",display:"flex",margin:0,variants:{variant:{winner:{color:"$winner!important",fontWeight:700},loser:{color:"$loser!important"}}}}),H$=Ve({marginInlineEnd:"$space$gameMarginInlineEnd",justifyContent:"flex-end",alignItems:"center",display:"flex"});function z$({value:e}={}){const t=document.createElement("input");return t.onclick=r=>r.target.select(),t.className=DC(),t.value=String(e||""),t}function Y$({gameScoreOnly:e,scoreStripes:t,set:r,sideNumber:i}){const a=i===r?.winningSide||r?.winningSide?"loser":void 0,s=i===2?r.side2Score:r.side1Score,o=r.side2TiebreakScore||r.side1TiebreakScore,c=i===2?r.side2TiebreakScore:r.side1TiebreakScore,u=s===void 0&&c,l=u||s,d=t&&r.setNumber%2?"lightgray":"transparent",m=r.editing?r.editing===i:void 0;let f;if(m)f=z$({value:l});else if(f=document.createElement("p"),f.className=DC({variant:a}),f.classList.add("tmx-st"),f.setAttribute("setNumber",r.setNumber),f.style.backgroundColor=d,f.innerHTML=isNaN(l)?"":l,!e){const h=document.createElement("span");h.className=q$(),h.innerHTML=o&&!u?String(c):"",f.appendChild(h)}return f}function K$({participantHeight:e,eventHandlers:t,composition:r,sideNumber:i,matchUp:n}){const a=r?.configuration?.winnerChevron,s=r?.configuration?.gameScoreOnly,o=n?.score?.sets||[],c=r?.configuration?.scoreBox,u=e?i===2?e:e-1:void 0,l=m=>{Bi(t?.scoreClick)&&(m.stopPropagation(),t.scoreClick({pointerEvent:m,matchUp:n}))},d=document.createElement("div");d.className=wC(u)({...!c&&i===1&&{sideNumber:1},fontSize:"small"}),d.classList.add("sideScore"),d.classList.add("tmx-scr"),d.onclick=l;const p=document.createElement("div");p.className=H$();for(const m of o||[]){const f=Y$({gameScoreOnly:s,scoreStripes:a,sideNumber:i,set:m});p.appendChild(f)}return d.appendChild(p),d}const X$=Ve({height:"$lineHeights$scheduleInfo",borderBottom:"1px solid darkgray",justifyContent:"space-between",backgroundColor:"#F8F9F9",boxSizing:"border-box",paddingRight:"0.2rem",paddingLeft:"0.5rem",alignItems:"center",cursor:"pointer",color:"#7F8080",display:"flex",width:"100%"});var Sf={exports:{}},Q$=Sf.exports,TC;function J$(){return TC||(TC=1,(function(e,t){(function(r,i){e.exports=i()})(Q$,(function(){var r=1e3,i=6e4,n=36e5,a="millisecond",s="second",o="minute",c="hour",u="day",l="week",d="month",p="quarter",m="year",f="date",h="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,I=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,y={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(A){var N=["th","st","nd","rd"],C=A%100;return"["+A+(N[(C-20)%10]||N[C]||N[0])+"]"}},U=function(A,N,C){var k=String(A);return!k||k.length>=N?A:""+Array(N+1-k.length).join(C)+A},D={s:U,z:function(A){var N=-A.utcOffset(),C=Math.abs(N),k=Math.floor(C/60),O=C%60;return(N<=0?"+":"-")+U(k,2,"0")+":"+U(O,2,"0")},m:function A(N,C){if(N.date()<C.date())return-A(C,N);var k=12*(C.year()-N.year())+(C.month()-N.month()),O=N.clone().add(k,d),L=C-O<0,_=N.clone().add(k+(L?-1:1),d);return+(-(k+(C-O)/(L?O-_:_-O))||0)},a:function(A){return A<0?Math.ceil(A)||0:Math.floor(A)},p:function(A){return{M:d,y:m,w:l,d:u,D:f,h:c,m:o,s,ms:a,Q:p}[A]||String(A||"").toLowerCase().replace(/s$/,"")},u:function(A){return A===void 0}},v="en",w={};w[v]=y;var S="$isDayjsObject",T=function(A){return A instanceof R||!(!A||!A[S])},b=function A(N,C,k){var O;if(!N)return v;if(typeof N=="string"){var L=N.toLowerCase();w[L]&&(O=L),C&&(w[L]=C,O=L);var _=N.split("-");if(!O&&_.length>1)return A(_[0])}else{var B=N.name;w[B]=N,O=B}return!k&&O&&(v=O),O||!k&&v},P=function(A,N){if(T(A))return A.clone();var C=typeof N=="object"?N:{};return C.date=A,C.args=arguments,new R(C)},M=D;M.l=b,M.i=T,M.w=function(A,N){return P(A,{locale:N.$L,utc:N.$u,x:N.$x,$offset:N.$offset})};var R=(function(){function A(C){this.$L=b(C.locale,null,!0),this.parse(C),this.$x=this.$x||C.x||{},this[S]=!0}var N=A.prototype;return N.parse=function(C){this.$d=(function(k){var O=k.date,L=k.utc;if(O===null)return new Date(NaN);if(M.u(O))return new Date;if(O instanceof Date)return new Date(O);if(typeof O=="string"&&!/Z$/i.test(O)){var _=O.match(g);if(_){var B=_[2]-1||0,G=(_[7]||"0").substring(0,3);return L?new Date(Date.UTC(_[1],B,_[3]||1,_[4]||0,_[5]||0,_[6]||0,G)):new Date(_[1],B,_[3]||1,_[4]||0,_[5]||0,_[6]||0,G)}}return new Date(O)})(C),this.init()},N.init=function(){var C=this.$d;this.$y=C.getFullYear(),this.$M=C.getMonth(),this.$D=C.getDate(),this.$W=C.getDay(),this.$H=C.getHours(),this.$m=C.getMinutes(),this.$s=C.getSeconds(),this.$ms=C.getMilliseconds()},N.$utils=function(){return M},N.isValid=function(){return this.$d.toString()!==h},N.isSame=function(C,k){var O=P(C);return this.startOf(k)<=O&&O<=this.endOf(k)},N.isAfter=function(C,k){return P(C)<this.startOf(k)},N.isBefore=function(C,k){return this.endOf(k)<P(C)},N.$g=function(C,k,O){return M.u(C)?this[k]:this.set(O,C)},N.unix=function(){return Math.floor(this.valueOf()/1e3)},N.valueOf=function(){return this.$d.getTime()},N.startOf=function(C,k){var O=this,L=!!M.u(k)||k,_=M.p(C),B=function(q,K){var X=M.w(O.$u?Date.UTC(O.$y,K,q):new Date(O.$y,K,q),O);return L?X:X.endOf(u)},G=function(q,K){return M.w(O.toDate()[q].apply(O.toDate("s"),(L?[0,0,0,0]:[23,59,59,999]).slice(K)),O)},$=this.$W,j=this.$M,V=this.$D,H="set"+(this.$u?"UTC":"");switch(_){case m:return L?B(1,0):B(31,11);case d:return L?B(1,j):B(0,j+1);case l:var W=this.$locale().weekStart||0,Y=($<W?$+7:$)-W;return B(L?V-Y:V+(6-Y),j);case u:case f:return G(H+"Hours",0);case c:return G(H+"Minutes",1);case o:return G(H+"Seconds",2);case s:return G(H+"Milliseconds",3);default:return this.clone()}},N.endOf=function(C){return this.startOf(C,!1)},N.$set=function(C,k){var O,L=M.p(C),_="set"+(this.$u?"UTC":""),B=(O={},O[u]=_+"Date",O[f]=_+"Date",O[d]=_+"Month",O[m]=_+"FullYear",O[c]=_+"Hours",O[o]=_+"Minutes",O[s]=_+"Seconds",O[a]=_+"Milliseconds",O)[L],G=L===u?this.$D+(k-this.$W):k;if(L===d||L===m){var $=this.clone().set(f,1);$.$d[B](G),$.init(),this.$d=$.set(f,Math.min(this.$D,$.daysInMonth())).$d}else B&&this.$d[B](G);return this.init(),this},N.set=function(C,k){return this.clone().$set(C,k)},N.get=function(C){return this[M.p(C)]()},N.add=function(C,k){var O,L=this;C=Number(C);var _=M.p(k),B=function(j){var V=P(L);return M.w(V.date(V.date()+Math.round(j*C)),L)};if(_===d)return this.set(d,this.$M+C);if(_===m)return this.set(m,this.$y+C);if(_===u)return B(1);if(_===l)return B(7);var G=(O={},O[o]=i,O[c]=n,O[s]=r,O)[_]||1,$=this.$d.getTime()+C*G;return M.w($,this)},N.subtract=function(C,k){return this.add(-1*C,k)},N.format=function(C){var k=this,O=this.$locale();if(!this.isValid())return O.invalidDate||h;var L=C||"YYYY-MM-DDTHH:mm:ssZ",_=M.z(this),B=this.$H,G=this.$m,$=this.$M,j=O.weekdays,V=O.months,H=O.meridiem,W=function(K,X,Q,Z){return K&&(K[X]||K(k,L))||Q[X].slice(0,Z)},Y=function(K){return M.s(B%12||12,K,"0")},q=H||function(K,X,Q){var Z=K<12?"AM":"PM";return Q?Z.toLowerCase():Z};return L.replace(I,(function(K,X){return X||(function(Q){switch(Q){case"YY":return String(k.$y).slice(-2);case"YYYY":return M.s(k.$y,4,"0");case"M":return $+1;case"MM":return M.s($+1,2,"0");case"MMM":return W(O.monthsShort,$,V,3);case"MMMM":return W(V,$);case"D":return k.$D;case"DD":return M.s(k.$D,2,"0");case"d":return String(k.$W);case"dd":return W(O.weekdaysMin,k.$W,j,2);case"ddd":return W(O.weekdaysShort,k.$W,j,3);case"dddd":return j[k.$W];case"H":return String(B);case"HH":return M.s(B,2,"0");case"h":return Y(1);case"hh":return Y(2);case"a":return q(B,G,!0);case"A":return q(B,G,!1);case"m":return String(G);case"mm":return M.s(G,2,"0");case"s":return String(k.$s);case"ss":return M.s(k.$s,2,"0");case"SSS":return M.s(k.$ms,3,"0");case"Z":return _}return null})(K)||_.replace(":","")}))},N.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},N.diff=function(C,k,O){var L,_=this,B=M.p(k),G=P(C),$=(G.utcOffset()-this.utcOffset())*i,j=this-G,V=function(){return M.m(_,G)};switch(B){case m:L=V()/12;break;case d:L=V();break;case p:L=V()/3;break;case l:L=(j-$)/6048e5;break;case u:L=(j-$)/864e5;break;case c:L=j/n;break;case o:L=j/i;break;case s:L=j/r;break;default:L=j}return O?L:M.a(L)},N.daysInMonth=function(){return this.endOf(d).$D},N.$locale=function(){return w[this.$L]},N.locale=function(C,k){if(!C)return this.$L;var O=this.clone(),L=b(C,k,!0);return L&&(O.$L=L),O},N.clone=function(){return M.w(this.$d,this)},N.toDate=function(){return new Date(this.valueOf())},N.toJSON=function(){return this.isValid()?this.toISOString():null},N.toISOString=function(){return this.$d.toISOString()},N.toString=function(){return this.$d.toUTCString()},A})(),E=R.prototype;return P.prototype=E,[["$ms",a],["$s",s],["$m",o],["$H",c],["$W",u],["$M",d],["$y",m],["$D",f]].forEach((function(A){E[A[1]]=function(N){return this.$g(N,A[0],A[1])}})),P.extend=function(A,N){return A.$i||(A(N,R,P),A.$i=!0),P},P.locale=b,P.isDayjs=T,P.unix=function(A){return P(1e3*A)},P.en=w[v],P.Ls=w,P.p={},P}))})(Sf)),Sf.exports}var Z$=J$();const eW=Lf(Z$);function tW({matchUp:e,eventHandlers:t}){const{scheduledTime:r,scheduledDate:i,venueAbbreviation:n,courtName:a}=e?.schedule||{},{dateTime:{extractDate:s,extractTime:o}}=gS,c=o(r);let l=s(i),d="ddd D MMMM";c&&(d+=", hh:mm A",l+=`T${c}`);const p=i?eW(l).format(d):"Not scheduled",m=n&&a?.toString().startsWith(n)&&a||n&&a&&`${n} ${a}`||a||n||"",f=document.createElement("div");f.className=X$(),f.classList.add("tmx-sch"),Bi(t?.scheduleClick)&&(f.onclick=U=>t.scheduleClick({matchUp:e,pointerEvent:U}));const h=document.createElement("div");h.innerHTML=p,f.append(h);const g=U=>{Bi(t?.venueClick)&&(U.stopPropagation(),t.venueClick({pointerEvent:U,matchUp:e}))},I=document.createElement("div");I.style="display: flex; flex-direction: row";const y=document.createElement("div");if(y.style.paddingRight=".2rem",y.onclick=g,y.innerHTML=m,I.append(y),f.append(I),f.onclick){const U=document.createElement("div");U.innerHTML="⋮",I.append(U)}return f}function PC({initialRoundNumber:e=1,eventHandlers:t,composition:r,sideNumber:i,className:n,matchUp:a}){const o=(r?.configuration||{})?.scheduleInfo,c=a?.score?.scoreStringSide1,u=r?.configuration?.scoreBox&&c,l=a?.readyToScore&&t?.scoreClick&&!fC.checkScoreHasValue({matchUp:a}),d=document.createElement("div");if(d.className=La(R$(),n),d.classList.add("tmx-sd"),d.setAttribute("sideNumber",String(i)),o&&i===1){const f=tW({matchUp:a,eventHandlers:t});d.appendChild(f)}const p=document.createElement("div");p.className=N$();const m=gC({sideContainer:!0,initialRoundNumber:e,eventHandlers:t,composition:r,sideNumber:i,matchUp:a});if(p.appendChild(m),u){const f=document.createElement("div");f.style.border="1px solid lightgray",p.appendChild(f)}if(c){const f=K$({eventHandlers:t,composition:r,sideNumber:i,matchUp:a});p.appendChild(f)}if(l){const f=g=>{Bi(t?.scoreClick)&&(g.stopPropagation(),t.scoreClick({pointerEvent:g,matchUp:a}))},h=document.createElement("div");h.className=wC(void 0)({...!u&&i===1&&{sideNumber:1},fontSize:"small"}),h.onclick=f,h.innerHTML="[Score]",p.appendChild(h)}return d.appendChild(p),d}function bC(e){const{composition:t,initialRoundNumber:r=1,matchUp:i,moiety:n,selectedMatchUpId:a,searchActive:s}=e,{roundFactor:o,roundNumber:c,finishingRound:u,matchUpType:l,preFeedRound:d,stage:p}=i,m=e.isFinalRound||(u?Number.parseInt(String(u))===1:!1),f=p==="QUALIFYING"&&m,h=m,g=c?Number.parseInt(String(c))===r:!1,I=l==="DOUBLES",y=(s||i.isRoundRobin||i.collectionId||e.isLucky||e.isAdHoc)&&"mr"||h&&"noProgression"||(f||d)&&"m0"||n&&"m1"||"m2",U=W$({composition:t,isDoubles:I,roundFactor:o})({isFirstRound:g,link:y}),D=t?.configuration||{},{resultsInfo:v,centerInfo:w}=D||{},S=e.eventHandlers||{},T=A=>{Bi(S?.matchUpClick)&&S.matchUpClick({pointerEvent:A,matchUp:i})},b=document.createElement("div");b.className=La(t?.theme,e?.className,"matchup",_$()),b.classList.add("tmx-m"),b.setAttribute("id",i?.matchUpId),b.onclick=T;const P=document.createElement("div");P.className=B$({configuration:D});const M=({sideNumber:A})=>{const N=i?.sides?.find(k=>k.sideNumber===A)?.participant?.entryStatus?.replace("_"," ");return $$({eventHandlers:S,entryStatus:N,sideNumber:A,className:A===2?U:void 0,matchUp:i})},R=PC({initialRoundNumber:r,eventHandlers:S,sideNumber:1,composition:t,matchUp:i}),E=PC({className:!w&&U,initialRoundNumber:r,eventHandlers:S,sideNumber:2,composition:t,matchUp:i});if(P.appendChild(R),w){const A=M({sideNumber:1}),N=M({sideNumber:2});P.appendChild(A.element),P.appendChild(N.element)}if(P.appendChild(E),v){const A=rW({score:i.score});P.appendChild(A)}if(b.appendChild(P),a===i.matchUpId){const A=document.createElement("div");A.className=L$(),b.appendChild(A)}return b}function rW({score:e}){const t=e?.sets?.filter(Boolean).sort((a,s)=>(a.setNumber||0)-(s.setNumber||0)),r=t?.at(-1),i=r?.side1PointsScore||r?.side2PointsScore,n=document.createElement("div");if(n.className=F$(),i){const a=document.createElement("div");a.className=SC({variant:"points"}),a.innerHTML="PTS",n.appendChild(a)}for(const a of t||[]){const s=document.createElement("div");s.setAttribute("key",String(a.setNumber)),s.className=SC({variant:"set"}),s.innerHTML=String(a.setNumber),n.appendChild(s)}return n}function MC({initialRoundNumber:e=1,selectedMatchUpId:t,eventHandlers:r,isFinalRound:i,isRoundRobin:n,searchActive:a,composition:s,roundFactor:o,roundNumber:c,roundProfile:u,minWidth:l,matchUps:d,context:p,isLucky:m}){const f=d.filter(P=>P.roundNumber===c).sort((P,M)=>(P.roundPosition||0)-(M.roundPosition||0)),h=f.every(({roundPosition:P,drawPositions:M})=>!P&&!M),g=s?.configuration||{},I=document.createElement("div");if(I.className=yC(),I.classList.add("tmx-rd"),I.setAttribute("roundNumber",String(c)),g.roundHeader){const P=IC({roundProfile:u,roundMatchUps:f,roundNumber:c,eventHandlers:r,context:p});I.appendChild(P)}const y=document.createElement("div");y.className=UC({variant:h?"adHoc":void 0}),l&&(y.style.minWidth=l);let U,D,v;if(n){const P=R=>(R||[]).reduce((E,A)=>A+E,0);f.sort((R,E)=>{const A=P(R.drawPositions)-P(E.drawPositions),N=R.drawPositions||[],C=E.drawPositions||[],k=(N.length?Math.min.apply(null,N):0)-(C.length?Math.min.apply(null,C):0);return A||k});const M=f.reduce((R,E)=>(R[E.structureId]=E.structureName,R),{});U=Object.values(M),D=Object.keys(M),v=Object.keys(gS.instanceCount(f.map(({structureId:R})=>R))).length}else h&&f.sort((P,M)=>(P.roundOrder??0)-(M.roundOrder??0));const w=v&&f.length/v,S=Object.keys(u).map(P=>parseInt(P)),T=S.indexOf(c),b=T===0&&"first"||T===S.length-1&&"last";return f.forEach((P,M)=>{const R=w&&!(M%w),E=w&&Math.floor(M/w),A=w&&U[E];if(R){const k=document.createElement("div");k.className=k$({...E===0&&{variant:0},...b&&{roundOrder:b}}),y.appendChild(k);const O=document.createElement("div");if(O.className=x$(),Bi(r?.groupHeaderClick)){const{drawId:L,containerStructureId:_}=f[0];y.onclick=B=>r.groupHeaderClick({structureId:D[E],containerStructureId:_,pointerEvent:B,drawId:L})}c===e&&(O.innerHTML=A),y.appendChild(O)}const N=M%2===0;o?P.roundFactor=o:e>1&&(P.roundFactor=Math.pow(2,c-e));const C=bC({initialRoundNumber:e,selectedMatchUpId:t,eventHandlers:r,isFinalRound:i,searchActive:a,composition:s,isAdHoc:h,isLucky:m,matchUp:P,moiety:N});y.appendChild(C)}),I.appendChild(y),I}function iW({initialRoundNumber:e=1,selectedMatchUpId:t,eventHandlers:r,searchActive:i,composition:n,structureId:a,finalColumn:s,matchUps:o,minWidth:c,context:u}){const{roundNumbers:l,roundProfile:d,hasOddMatchUpsCount:p,isNotEliminationStructure:m}=fC.getRoundMatchUps({matchUps:o});a=a||u?.structureId||o?.[0]?.structureId;const f=o.some(({isRoundRobin:y})=>y),h=p||m,g=document.createElement("div");g.className=O$(),g.classList.add("tmx-str"),g.setAttribute("id",a||"");const I=l.length?Math.max.apply(null,l):0;for(const y of l){if(y<e)continue;const D=MC({initialRoundNumber:e,selectedMatchUpId:t,eventHandlers:r,isFinalRound:y===I,isRoundRobin:f,searchActive:i,composition:n,roundNumber:y,roundProfile:d,matchUps:o,minWidth:c,context:u,isLucky:h});g.appendChild(D)}if(s&&typeof s!="boolean"){const y=document.createElement("div");y.className=yC();const U=document.createElement("div");U.className=UC(),U.appendChild(s),y.appendChild(U),g.appendChild(y)}return g}const RC=Ve({backgroundColor:"$colors$backgroundColor",color:"$colors$color",overflowX:"auto",height:1e3});function nW({content:e,theme:t}){const r=document.createElement("div");return r.className=t?La(RC(),t):RC(),t&&r.classList.add(t),typeof e=="string"?r.innerHTML=e:r.appendChild(e),r}const{createTheme:Do}=HS({theme:{lineHeights:{scheduleInfo:`${Kl.scheduleInfo}rem`,centerInfo:`${Kl.centerInfo}rem`,gameScore:`${Kl.gameScore}rem`},borderWidths:{matchUpInline:"1px 1px",matchUp:"1px"},space:{1:"10px",2:"0.375rem",gameMarginInlineEnd:"0.25rem"},fontSizes:{1:"0.875rem"},colors:{internalDividers:"lightgray",backgroundColor:"white",connector:"lightgray",border:"darkgray",color:"black"},participant:{textTransform:"capitalize",minHeight:"2rem",seed:"gray"},score:{setWidth:"1.3rem"}}}),NC=Do("australian-theme",{colors:{borderHover:"#0091d2",connector:"#999"}}),aW=Do("wimbledon-theme",{borderWidths:{borderInlineStart:"10px"},colors:{connector:"transparent",borderHover:"darkgrey",border:"#00703c",matchUp:"#fff"},participant:{textTransform:"uppercase"}}),sW=Do("french-theme",{colors:{winnerName:"#01503d!important",winner:"#01503d!important",borderHover:"#0091d2",border:"#F8F9F9"},matchUp:{boxShadow:"0 0 30px 0 hsla(0,0%,89%,9)"}}),oW=Do("usopen-theme",{colors:{matchUpBackgroundColor:"#F8F9F9",internalDividers:"darkgray",borderHover:"#0091d2",connector:"#999"}}),EC=Do("basic-theme",{colors:{internalDividers:"transparent",winner:"#50B649!important",loser:"#E61A1A!important",connector:"#999"},space:{gameMarginInlineEnd:"0.75rem"},participant:{seed:"transparent"},fontSizes:{1:"1.5rem"}}),cW=Do("dark-theme",{colors:{backgroundColor:"#333333",borderHover:"#0091d2",color:"white"},participant:{seed:"cyan"}}),uW=Do("itf-theme",{colors:{borderHover:"#0091d2",connector:"#999",matchUp:"#fff"},participant:{textTransform:"uppercase",seed:"gray"}}),lW={Australian:{configuration:{flags:!0},theme:NC},Basic:{configuration:{gameScoreOnly:!0,teamLogo:!1,roundHeader:!0,placeHolders:{tbd:"-",bye:"Bye"}},theme:EC},DrawPositions:{configuration:{gameScoreOnly:!0,drawPositions:!0,teamLogo:!1},theme:EC},French:{configuration:{bracketedSeeds:!0,flags:!0},theme:sW},Wimbledon:{configuration:{resultsInfo:!0,flags:!0},theme:aW},"US Open":{configuration:{scoreBox:!0,flags:!0},theme:oW},ITF:{configuration:{winnerChevron:!0,centerInfo:!0,flags:!0,roundHeader:!0},theme:uW},National:{configuration:{bracketedSeeds:"square",allDrawPositions:!0,drawPositions:!0,scheduleInfo:!0,roundHeader:!0,showAddress:!0,scaleAttributes:{scaleColor:"red",scaleType:"RATING",scaleName:"WTN",accessor:"wtnRating"}},theme:NC},Night:{configuration:{flags:!0},theme:cW}},AC=[{key:"custom",name:"Custom",desc:""},{key:"standard",name:"Standard Advantage",format:"SET3-S:6/TB7",desc:"Best of 3 Sets to 6 with Advantage"},{key:"atpd",name:"Standard Doubles",format:"SET3-S:6/TB7-F:TB10",desc:"Best of 3 Sets to 6, no Ad",desc2:"Final Set Tiebreak to 10"},{key:"standard1",name:"One Standard Set",format:"SET1-S:6/TB7",desc:"1 Set to 6 Games, Tiebreak to 7"},{key:"wimbledon2018",name:"Wimbledon 2018",format:"SET5-S:6/TB7-F:6",desc:"Best of 5 tiebreak sets, final set no tiebreak"},{key:"wimbledon2019",name:"Wimbledon 2019",format:"SET5-S:6/TB7-F:6/TB7@12",desc:"Best of 5 tiebreak sets, final set tiebreak at 12"},{key:"Aus2019",name:"Australian Open 2019",format:"SET5-S:6/TB7-F:6/TB10",desc:"Best of 5 tiebreak sets, final set tiebreak at 12"},{key:"short",name:"Short Sets TB7@4",format:"SET3-S:4/TB7",desc:"Best of 3 Sets to 4, tiebreak to 7 at 4-4"},{key:"short1",name:"Fast 4",format:"SET3-S:4/TB5@3",desc:"Best of 3 Sets to 4, tiebreak to 5 at 3-3"},{key:"short2",name:"One Short Set TB7",format:"SET1-S:4/TB7",desc:"One Set to 4, tiebreak to 7 at 4-4"},{key:"short3",name:"One Short Set TB5",format:"SET1-S:4/TB5@3",desc:"One Set to 4, tiebreak to 5 at 3-3"},{key:"short4",name:"Short Sets w/ 3rd TB10",format:"SET3-S:4/TB7-F:TB10",desc:"Best of 3 Sets to 4 Games, tiebreak to 10",desc2:"3rd Set Tiebreak to 7"},{key:"short5",name:"Short Sets w/ 3rd TB7",format:"SET3-S:4/TB7-F:TB7",desc:"Best of 3 Sets to 4 Games, tiebreak to 7",desc2:"3rd Set Tiebreak to 7"},{key:"pro",name:"Pro Set",format:"SET1-S:8/TB7",desc:"One Set to 8 with Advantage, tiebreak at 8-8"},{key:"cps",name:"College Pro Set",format:"SET1-S:8/TB7@7"},{key:"tbsets1",name:"Best of 3 TB7",format:"SET3-S:TB7",desc:"Two tiebreak sets",desc2:"7-point match tiebreak at one set all"},{key:"tbsets2",name:"Best of 3 TB10",format:"SET3-S:TB10",desc:"Best of 3 tiebreaks to 10"},{key:"tbsets3",name:"One Tiebreak to 10",format:"SET1-S:TB10",desc:"One Match Tiebreak to 10 with Advantage"},{key:"tbsets4",name:"Two TB7 w/ 3rd TB10",format:"SET3-S:TB7-F:TB10",desc:"Two 7 point tiebreak sets",desc2:"10 point tiebreak at one set all"},{key:"timed10",name:"Timed 10 minute game - game based",format:"SET1-S:T10"}],Qr="none",ua="▾";function vf(e){return typeof e=="function"}let Ss,qt;const wf="Timed set",Xl="Tiebreak",TS="No-Ad",_i="Set",Ql="Ad",Bt={setFormat:{descriptor:"Best of",bestOf:3,advantage:Ql,what:_i,setTo:6,tiebreakAt:6,tiebreakTo:7,winBy:2,minutes:10},finalSetFormat:{descriptor:"Final set",advantage:Ql,what:_i,setTo:6,tiebreakAt:6,tiebreakTo:7,winBy:2,minutes:10}};function CC(e){const t=e?"finalSetFormat":"setFormat",r=Bt[t].what,i={setTo:Bt[t].setTo};return r===_i&&Bt[t].advantage===TS&&(i.NoAD=!0),r===_i&&document.getElementById(e?"finalSetTiebreak":"setTiebreak")?.checked&&(i.tiebreakAt=Bt[t].tiebreakAt,i.tiebreakFormat={tiebreakTo:Bt[t].tiebreakTo},r===_i&&Bt[t].winBy===1&&(i.tiebreakFormat.NoAD=!0)),r===wf&&(i.minutes=Bt[t].minutes,i.timed=!0),r===Xl&&(i.tiebreakSet={tiebreakTo:Bt[t].tiebreakTo},Bt[t].winBy===1&&(i.tiebreakSet.NoAD=!0)),i}function OC(){const e=CC();qt={bestOf:Bt.setFormat.bestOf,setFormat:e},document.getElementById("finalSetOption")?.checked&&(qt.finalSetFormat=CC(1));const r=Vf.scoreGovernor.stringifyMatchUpFormat(qt),i=AC.some(a=>a.format===r),n=document.getElementById("matchUpFormatSelector");if(n){const a=n.value,s=i?r:"Custom";if(a!==s){const o=n.onchange;n.onchange=null,n.value=s,n.onchange=o}}return r}function Yi(e){const t=e||OC(),r=document.getElementById("matchUpFormatString");r&&(r.innerHTML=t)}const To=(e,t)=>t&&e.finalSetFormat||e.setFormat,$c=[{getValue:e=>e.bestOf>1?"Best of":"Exactly",options:["Best of","Exactly"],id:"descriptor",value:"Best of",finalSet:!1},{getValue:e=>e.bestOf,finalSet:!1,id:"bestOf",options:[1,3,5],onChange:"pluralize",onChangeCallback:"updateFinalSetVisibility",value:3},{getValue:(e,t)=>{const r=To(e,t),i=r?.NoAD?TS:Ql;return r?.timed||r?.tiebreakSet?void 0:i},options:[Ql,TS],onChange:"changeAdvantage",defaultValue:Ql,id:"advantage",whats:[_i]},{getValue:(e,t)=>{const r=To(e,t);return r||console.log({pmf:e}),r?.timed?wf:r?.tiebreakSet?Xl:_i},options:[_i,Xl,wf],finalSetLabel:`${_i}${ua}`,onChange:"changeWhat",onChangeCallback:"updateWhatValue",pluralize:!0,id:"what"},{getValue:(e,t)=>To(e,t).setTo,options:[1,2,3,4,5,6,7,8,9],onChange:"changeCount",defaultValue:6,whats:[_i],prefix:"to ",id:"setTo"},{getValue:(e,t)=>{const r=To(e,t);return r.tiebreakFormat?.tiebreakTo||r.tiebreakSet?.tiebreakTo},options:[5,7,9,10,12],onChange:"changeTiebreakTo",whats:[_i,Xl],id:"tiebreakTo",defaultValue:7,prefix:"TB to ",tbSet:!0,value:7,tb:!0},{getValue:(e,t)=>To(e,t).tiebreakAt,options:e=>{const t=Bt[e?"finalSetFormat":"setFormat"].setTo;return t>1?[t-1,t]:[]},onChange:"changeTiebreakAt",id:"tiebreakAt",defaultValue:6,whats:[_i],prefix:"@",value:6,tb:!0},{getValue:(e,t)=>{const r=To(e,t);if(r.tiebreakFormat)return r.tiebreakFormat?.NoAD?1:2},whats:[_i,Xl],onChange:"changeWinBy",prefix:"Win by ",options:[1,2],defaultValue:2,tbSet:!0,id:"winBy",tb:!0},{getValue:(e,t)=>{const r=To(e,t);return r.timed&&r.minutes||void 0},options:[10,15,20,25,30,45,60,90],onChange:"changeMinutes",whats:[wf],suffix:" Minutes",defaultValue:10,id:"minutes",timed:!0}],Df={changeWhat:(e,t,r)=>{const i=r===_i,n=t?"finalSetTiebreakToggle":"setTiebreakToggle",a=document.getElementById(n);a.style.display=i?"":Qr,$c.forEach(s=>{if(s.whats){const{prefix:o="",suffix:c="",pluralize:u}=s,l=s.whats.includes(r),d=t?`${s.id}-${t}`:s.id,p=document.getElementById(d);if(p.style.display===Qr&&l){const m=qt.bestOf,f=!t&&u&&m>1?"s":"",h=s.defaultValue;p.innerHTML=`${o}${h}${f}${c}${ua}`,Bt[t?"finalSetFormat":"setFormat"][s.id]=h}p.style.display=l?"":Qr}}),Yi()},changeCount:(e,t,r)=>{const i=t?"finalSetFormat":"setFormat";Bt[i].setTo=r;const n=Bt[i].tiebreakAt;if(!(r>1?[r-1,r]:[]).includes(n)){Bt[i].tiebreakAt=r;const s=document.getElementById(t?`tiebreakAt-${t}`:"tiebreakAt");s&&(s.innerHTML=`@${r}${ua}`)}Yi()},changeTiebreakAt:(e,t,r)=>{Bt[t?"finalSetFormat":"setFormat"].tiebreakAt=r,Yi()},updateWhatValue:(e,t,r)=>{Bt[t?"finalSetFormat":"setFormat"].what=r},changeAdvantage:(e,t,r)=>{Bt[t?"finalSetFormat":"setFormat"].advantage=r,Yi()},changeTiebreakTo:(e,t,r)=>{Bt[t?"finalSetFormat":"setFormat"].tiebreakTo=r,Yi()},changeWinBy:(e,t,r)=>{Bt[t?"finalSetFormat":"setFormat"].winBy=r,Yi()},changeMinutes:(e,t,r)=>{Bt[t?"finalSetFormat":"setFormat"].minutes=r,Yi()},pluralize:(e,t,r)=>{const i=Bt[t?"finalSetFormat":"setFormat"].what,n=t?`what-${t}`:"what",a=document.getElementById(n),s=r>1?"s":"";a.innerHTML=`${i}${s}${ua}`,Yi()},updateFinalSetVisibility:(e,t,r)=>{const i=r>1,n=document.getElementById("finalSetOption"),a=document.querySelector('label[for="finalSetOption"]');n&&a&&(i?(n.style.display="",a.style.display=""):(n.checked&&(n.checked=!1,n.dispatchEvent(new Event("change"))),n.style.display="none",a.style.display="none"))}};function dW({existingMatchUpFormat:e="SET3-S:6/TB7",callback:t,config:r,modalConfig:i}={}){Ss=e,qt=qm.parse(Ss);const a=[{onClick:()=>t?.(""),label:"Cancel",intent:"none",close:!0},{label:"Select",intent:"is-info",close:!0,onClick:()=>{const P=document.getElementById("matchUpFormatSelector"),R=P?.value&&P.value!=="Custom"?Ss:OC();vf(t)&&t(R)}}],s="switch is-rounded is-danger",o=document.createElement("div"),c=document.createElement("div");c.id="matchUpFormatString",c.innerHTML=Ss,c.style.fontSize="1.5em",c.style.color="blue",c.style.marginBottom="1em",o.appendChild(c);const u=document.createElement("div");u.style.marginBlockEnd="1em";const l={options:[{value:"Custom",label:"Custom",selected:!1},...AC.filter(P=>P.format).map(P=>({selected:P.format===Ss,value:P.format,label:P.name}))]},d=document.createElement("select");d.id="matchUpFormatSelector",d.className="input",d.style.width="100%",d.style.backgroundColor="#ffffff",d.style.color="#363636",d.style.border="1px solid #b5b5b5";for(const P of l.options){const M=document.createElement("option");M.value=P.value||"",M.text=P.label||"",M.style.backgroundColor="#ffffff",M.style.color="#363636",P.selected&&(M.selected=!0),d.appendChild(M)}d.onchange=P=>{Ss=P.target.value,Yi(Ss),qt=qm.parse(Ss),Bt.setFormat=qt.setFormat,Bt.setFormat.bestOf=qt.bestOf,qt.finalSetFormat&&(Bt.finalSetFormat=qt.finalSetFormat);const M=qt.finalSetFormat;U.style.display=M?"":Qr,D.style.display=M?"":Qr,I.checked=M,v.checked=!!M?.tiebreakFormat,f.checked=qt.setFormat.tiebreakFormat,$c.forEach(R=>{if(R.getValue){const E=R.getValue(qt),A=document.getElementById(R.id);if(A&&E){const{prefix:N="",suffix:C="",pluralize:k}=R,O=qt.bestOf,L=k&&O>1?"s":"";A.innerHTML=`${N}${E}${L}${C}${ua}`,A.style.display=""}else A&&(A.style.display=Qr);if(M){const N=R.getValue(qt,!0),C=document.getElementById(`${R.id}-1`);if(C&&N){const{prefix:k="",suffix:O="",pluralize:L}=R,_=qt.bestOf,B=L&&_>1?"s":"";C.innerHTML=`${k}${N}${B}${O}${ua}`,C.style.display=""}else C&&(C.style.display=Qr)}}})},u.appendChild(d),o.appendChild(u);const p=document.createElement("div");p.style.display="flex",p.style.flexWrap="wrap",p.style.gap="0.5em",p.style.marginBottom="1em",$c.map(P=>{const M=P.getValue?P.getValue(qt):void 0;return kC({...P,value:M})}).forEach(P=>p.appendChild(P)),p.id="setFormat",o.appendChild(p);const m=document.createElement("div");m.className="field",m.style.fontSize="1em";const f=document.createElement("input");f.className=s,f.name="setTiebreak",f.id="setTiebreak",f.type="checkbox",f.checked=!!qt.setFormat.tiebreakFormat,f.onchange=P=>{const M=P.target.checked;$c.filter(({tb:R})=>R).forEach(R=>{const E=document.getElementById(R.id);if(E){if(E.style.display===Qr&&M){const{prefix:A="",suffix:N="",pluralize:C,defaultValue:k}=R,O=qt.bestOf,L=C&&O>1?"s":"";E.innerHTML=`${A}${k}${L}${N}${ua}`}E.style.display=M?"":Qr}}),Yi()},m.appendChild(f);const h=document.createElement("label");h.setAttribute("for","setTiebreak"),h.id="setTiebreakToggle",h.innerHTML="Tiebreak",h.style.marginRight="1em",m.appendChild(h);const g=qt.bestOf>1,I=document.createElement("input");I.className="switch is-rounded is-info",I.type="checkbox",I.name="finalSetOption",I.checked=!!qt.finalSetFormat,I.id="finalSetOption",I.style.display=g?"":"none",I.onchange=P=>{const M=P.target.checked;U.style.display=M?"":Qr,D.style.display=M?"":Qr,Yi()},m.appendChild(I);const y=document.createElement("label");y.setAttribute("for","finalSetOption"),y.innerHTML="Final set",y.style.display=g?"":"none",m.appendChild(y),o.appendChild(m);const U=document.createElement("div");U.style.display=qt.finalSetFormat?"flex":Qr,U.style.flexWrap="wrap",U.style.gap="0.5em",U.style.marginBottom="1em",U.id="finalSetFormat",[{label:"<div style='font-weight: bold'>Final set</div>",options:[],finalSet:!0}].concat($c.map(P=>{const M=P.getValue?P.getValue(qt,!0):void 0;return{...P,value:M}})).filter(P=>P.finalSet!==!1).map(P=>kC({...P,index:1})).forEach(P=>U.appendChild(P)),o.appendChild(U);const D=document.createElement("div");D.id="finalSetConfig",D.style.display=qt.finalSetFormat?"":Qr,D.className="field",D.style.fontSize="1em";const v=document.createElement("input");v.className=s,v.name="finalSetTiebreak",v.id="finalSetTiebreak",v.type="checkbox",v.checked=qt.finalSetFormat?.tiebreakFormat,D.onchange=P=>{const M=P.target.checked;$c.filter(({tb:R})=>R).forEach(R=>{const E=document.getElementById(`${R.id}-1`);if(E.style.display===Qr&&M){const{prefix:A="",suffix:N="",pluralize:C,defaultValue:k}=R,O=qt.bestOf,L=C&&O>1?"s":"";E.innerHTML=`${A}${k}${L}${N}${ua}`}E.style.display=M?"":Qr}),Yi()},D.appendChild(v);const w=document.createElement("label");w.setAttribute("for","finalSetTiebreak"),w.id="finalSetTiebreakToggle",w.innerHTML="Tiebreak",w.style.marginRight="1em",D.appendChild(w),o.appendChild(D);const S={content:{padding:"1.5"},maxWidth:480,fontSize:"14px",style:{backgroundColor:"#f8f9fa",borderRadius:"8px",boxShadow:"0 8px 16px rgba(0, 102, 204, 0.2)"}},T=i?.fontSize||i?.style?.fontSize||S.fontSize,b={...S,...i,fontSize:T,style:{...S.style,...r?.style||{},...i?.style||{}}};return pd.open({title:"Score format",content:o,buttons:a,config:b})}function pW({index:e,finalSetLabel:t,label:r,prefix:i="",suffix:n="",value:a,pluralize:s}){const o=!e&&s&&(Bt.setFormat.bestOf||1)>1?"s":"";return r||e&&t||`${i}${a}${o}${n}${ua}`}function kC(e){const{id:t,initiallyHidden:r,index:i,value:n}=e,a=document.createElement("button");return a.className="mfcButton",a.id=i?`${t}-${i}`:t,a.innerHTML=pW(e),a.onclick=s=>mW({e:s,button:a,...e}),a.style.display=n||e.label?"":Qr,r&&(a.style.display=Qr),a.style.transition="all .2s ease-in-out",a.style.backgroundColor="inherit",a.style.border="none",a.style.color="inherit",a.style.padding=".3em",a.style.textAlign="center",a.style.textDecoration="none",a.style.fontSize="1em",a.style.cursor="pointer",a}function mW(e){const{e:t,id:r,button:i,pluralize:n,options:a,onChange:s,onChangeCallback:o,index:c,prefix:u="",suffix:l=""}=e,d=Bt.setFormat.bestOf||1,p=!c&&n&&d>1?"s":"",f=(vf(a)?a(c):a).map(h=>({text:`${h}${p}`,onClick:()=>{i.innerHTML=`${u}${h}${p}${l}${ua}`,s&&vf(Df[s])&&Df[s](t,c,h),o&&vf(Df[o])&&Df[o](t,c,h),Bt[c?"finalSetFormat":"setFormat"][r]=h,Yi()}}));fW(t,f)}let Jl=null,Zl=null;function xC(){Jl&&document.body.contains(Jl)&&Jl.remove(),Zl&&(document.removeEventListener("click",Zl),Zl=null),Jl=null}function fW(e,t){xC();const r=document.createElement("div");r.className="dropdown is-active",r.style.position="absolute",r.style.zIndex="10000";const i=document.createElement("div");i.className="dropdown-menu",i.style.backgroundColor="white",i.style.border="1px solid #ddd",i.style.borderRadius="4px",i.style.boxShadow="0 2px 8px rgba(0,0,0,0.15)";const n=()=>{xC()};t.forEach(s=>{const o=document.createElement("div");o.style.padding="0.5em 1em",o.style.cursor="pointer",o.style.backgroundColor="white",o.style.color="#363636",o.style.fontSize="1rem",o.style.lineHeight="1.5",o.textContent=s.text,o.onclick=c=>{c.preventDefault(),c.stopPropagation(),n(),setTimeout(()=>{s.onClick()},0)},o.onmouseenter=()=>{o.style.backgroundColor="#f5f5f5",o.style.color="#363636"},o.onmouseleave=()=>{o.style.backgroundColor="white",o.style.color="#363636"},i.appendChild(o)}),r.appendChild(i);const a=e.target.getBoundingClientRect();r.style.left=`${a.left}px`,r.style.top=`${a.bottom}px`,document.body.appendChild(r),Jl=r,setTimeout(()=>{Zl=s=>{r.contains(s.target)||n()},document.addEventListener("click",Zl)},100)}function hW(){return"0.8.7"}function hn(e){return typeof e=="function"}function gW(e,t,r){if(!e)return{elements:{}};const i={};for(const n of t||[]){if(!n?.label||n.hide)continue;const a=document.createElement("button");n.id&&(i[n.id]=a,a.id=n.id),a.style.marginRight=".5em",a.className="button font-medium",n.intent&&a.classList.add(n.intent),a.innerHTML=n.label,n.disabled&&(a.disabled=!0),a.onclick=s=>{s.stopPropagation(),!s.target.disabled&&hn(n.onClick)&&n.onClick(),r&&hn(r)&&r()},e.appendChild(a)}return{elements:i}}var PS={exports:{}},FC;function IW(){return FC||(FC=1,(function(e){(function(){var t=function(c,u){var l=this;t.count=(t.count||0)+1,this.count=t.count,this.isOpened=!1,this.input=a(c),this.input.setAttribute("autocomplete","off"),this.input.setAttribute("aria-autocomplete","list"),this.input.setAttribute("aria-expanded","false"),this.input.setAttribute("aria-controls","awesomplete_list_"+this.count),this.input.setAttribute("aria-owns","awesomplete_list_"+this.count),this.input.setAttribute("role","combobox"),this.options=u=u||{},i(this,{minChars:2,maxItems:10,autoFirst:!1,data:t.DATA,filter:t.FILTER_CONTAINS,sort:u.sort===!1?!1:t.SORT_BYLENGTH,container:t.CONTAINER,item:t.ITEM,replace:t.REPLACE,tabSelect:!1,listLabel:"Results List",statusNoResults:"No results found",statusXResults:"{0} results found",statusTypeXChar:"Type {0} or more characters for results"},u),this.index=-1,this.container=this.container(c),this.ul=a.create("ul",{hidden:"hidden",role:"listbox",id:"awesomplete_list_"+this.count,inside:this.container,"aria-label":this.listLabel}),this.status=a.create("span",{className:"visually-hidden",role:"status","aria-live":"assertive","aria-atomic":!0,inside:this.container,textContent:""}),this._events={input:{input:this.evaluate.bind(this),blur:this.close.bind(this,{reason:"blur"}),keydown:function(d){var p=d.keyCode;l.opened&&(p===13&&l.selected||p===9&&l.selected&&l.tabSelect?(d.preventDefault(),l.select(void 0,void 0,d)):p===27?l.close({reason:"esc"}):(p===38||p===40)&&(d.preventDefault(),l[p===38?"previous":"next"]()))}},form:{submit:this.close.bind(this,{reason:"submit"})},ul:{mousedown:function(d){d.preventDefault()},click:function(d){var p=d.target;if(p!==this){for(;p&&!/li/i.test(p.nodeName);)p=p.parentNode;p&&d.button===0&&(d.preventDefault(),l.select(p,d.target,d))}}}},a.bind(this.input,this._events.input),a.bind(this.input.form,this._events.form),a.bind(this.ul,this._events.ul),this.input.hasAttribute("list")?(this.list="#"+this.input.getAttribute("list"),this.input.removeAttribute("list")):this.list=this.input.getAttribute("data-list")||u.list||[],t.all.push(this)};t.prototype={set list(c){if(Array.isArray(c))this._list=c;else if(typeof c=="string"&&c.indexOf(",")>-1)this._list=c.split(/\s*,\s*/);else if(c=a(c),c&&c.children){var u=[];n.apply(c.children).forEach(function(l){if(!l.disabled){var d=l.textContent.trim(),p=l.value||d,m=l.label||d;p!==""&&u.push({label:m,value:p})}}),this._list=u}document.activeElement===this.input&&this.evaluate()},get selected(){return this.index>-1},get opened(){return this.isOpened},close:function(c){this.opened&&(this.input.setAttribute("aria-expanded","false"),this.ul.setAttribute("hidden",""),this.isOpened=!1,this.index=-1,this.status.setAttribute("hidden",""),this.input.setAttribute("aria-activedescendant",""),a.fire(this.input,"awesomplete-close",c||{}))},open:function(){this.input.setAttribute("aria-expanded","true"),this.ul.removeAttribute("hidden"),this.isOpened=!0,this.status.removeAttribute("hidden"),this.autoFirst&&this.index===-1&&this.goto(0),a.fire(this.input,"awesomplete-open")},destroy:function(){if(a.unbind(this.input,this._events.input),a.unbind(this.input.form,this._events.form),!this.options.container){var c=this.container.parentNode;c.insertBefore(this.input,this.container),c.removeChild(this.container)}this.input.removeAttribute("autocomplete"),this.input.removeAttribute("aria-autocomplete"),this.input.removeAttribute("aria-expanded"),this.input.removeAttribute("aria-controls"),this.input.removeAttribute("aria-owns"),this.input.removeAttribute("role");var u=t.all.indexOf(this);u!==-1&&t.all.splice(u,1)},next:function(){var c=this.ul.children.length;this.goto(this.index<c-1?this.index+1:c?0:-1)},previous:function(){var c=this.ul.children.length,u=this.index-1;this.goto(this.selected&&u!==-1?u:c-1)},goto:function(c){var u=this.ul.children;this.selected&&u[this.index].setAttribute("aria-selected","false"),this.index=c,c>-1&&u.length>0&&(u[c].setAttribute("aria-selected","true"),this.input.setAttribute("aria-activedescendant",this.ul.id+"_item_"+this.index),this.ul.scrollTop=u[c].offsetTop-this.ul.clientHeight+u[c].clientHeight,a.fire(this.input,"awesomplete-highlight",{text:this.suggestions[this.index]}))},select:function(c,u,l){if(c?this.index=a.siblingIndex(c):c=this.ul.children[this.index],c){var d=this.suggestions[this.index],p=a.fire(this.input,"awesomplete-select",{text:d,origin:u||c,originalEvent:l});p&&(this.replace(d),this.close({reason:"select"}),a.fire(this.input,"awesomplete-selectcomplete",{text:d,originalEvent:l}))}},evaluate:function(){var c=this,u=this.input.value;u.length>=this.minChars&&this._list&&this._list.length>0?(this.index=-1,this.ul.innerHTML="",this.suggestions=this._list.map(function(l){return new r(c.data(l,u))}).filter(function(l){return c.filter(l,u)}),this.sort!==!1&&(this.suggestions=this.suggestions.sort(this.sort)),this.suggestions=this.suggestions.slice(0,this.maxItems),this.suggestions.forEach(function(l,d){c.ul.appendChild(c.item(l,u,d))}),this.ul.children.length===0?(this.status.textContent=this.statusNoResults,this.close({reason:"nomatches"})):(this.input.setAttribute("aria-activedescendant",""),this.open(),this.status.textContent=this.statusXResults.replaceAll("{0}",this.ul.children.length))):(this.close({reason:"nomatches"}),this.minChar<=1||u.length>=this.minChars?this.status.textContent=this.statusNoResults:this.status.textContent=this.statusTypeXChar.replaceAll("{0}",this.minChars))}},t.all=[],t.FILTER_CONTAINS=function(c,u){return RegExp(a.regExpEscape(u.trim()),"i").test(c)},t.FILTER_STARTSWITH=function(c,u){return RegExp("^"+a.regExpEscape(u.trim()),"i").test(c)},t.SORT_BYLENGTH=function(c,u){return c.length!==u.length?c.length-u.length:c<u?-1:1},t.CONTAINER=function(c){return a.create("div",{className:"awesomplete",around:c})},t.ITEM=function(c,u,l){var d=u.trim()===""?c:c.replace(RegExp(a.regExpEscape(u.trim()),"gi"),"<mark>$&</mark>");return a.create("li",{innerHTML:d,role:"option","aria-selected":"false",tabindex:"-1",id:"awesomplete_list_"+this.count+"_item_"+l})},t.REPLACE=function(c){this.input.value=c.value},t.DATA=function(c){return c};function r(c){var u=Array.isArray(c)?{label:c[0],value:c[1]}:typeof c=="object"&&"label"in c&&"value"in c?c:{label:c,value:c};this.label=u.label||u.value,this.value=u.value}Object.defineProperty(r.prototype=Object.create(String.prototype),"length",{get:function(){return this.label.length}}),r.prototype.toString=r.prototype.valueOf=function(){return""+this.label};function i(c,u,l){for(var d in u){var p=u[d],m=c.input.getAttribute("data-"+d.toLowerCase());typeof p=="number"?c[d]=parseInt(m):p===!1?c[d]=m!==null:p instanceof Function?c[d]=null:c[d]=m,!c[d]&&c[d]!==0&&(c[d]=d in l?l[d]:p)}}var n=Array.prototype.slice;function a(c,u){return typeof c=="string"?(u||document).querySelector(c):c||null}function s(c,u){return n.call((u||document).querySelectorAll(c))}a.create=function(c,u){var l=document.createElement(c);for(var d in u){var p=u[d];if(d==="inside")a(p).appendChild(l);else if(d==="around"){var m=a(p);m.parentNode.insertBefore(l,m),l.appendChild(m),m.getAttribute("autofocus")!=null&&m.focus()}else d in l?l[d]=p:l.setAttribute(d,p)}return l},a.bind=function(c,u){if(c)for(var l in u){var d=u[l];l.split(/\s+/).forEach(function(p){c.addEventListener(p,d)})}},a.unbind=function(c,u){if(c)for(var l in u){var d=u[l];l.split(/\s+/).forEach(function(p){c.removeEventListener(p,d)})}},a.fire=function(c,u,l){var d=document.createEvent("HTMLEvents");d.initEvent(u,!0,!0);for(var p in l)d[p]=l[p];return c.dispatchEvent(d)},a.regExpEscape=function(c){return c.replace(/[-\\^$*+?.()|[\]{}]/g,"\\$&")},a.siblingIndex=function(c){for(var u=0;c=c.previousElementSibling;u++);return u};function o(){s("input.awesomplete").forEach(function(c){new t(c)})}return typeof self<"u"&&(self.Awesomplete=t),typeof Document<"u"&&(document.readyState!=="loading"?o():document.addEventListener("DOMContentLoaded",o)),t.$=a,t.$$=s,e.exports&&(e.exports=t),t})()})(PS)),PS.exports}var yW=IW();const UW=Lf(yW);function SW({list:e,element:t,callback:r,currentValue:i,withCatchTab:n,onChange:a}){const s=new UW(t,{list:e});t.parentElement&&(t.parentElement.style.width="100%");let o=!1;const c=u=>{o=!0,hn(r)&&r(u.text.value),t.value=u.text.label,s.suggestions=[]};if(n){const u=l=>l.key==="Tab"&&l.preventDefault();t.addEventListener("keydown",u,!1),t.addEventListener("keyup",u,!1)}if(typeof a=="function"&&t.addEventListener("change",a),t.setAttribute("autocomplete","off"),t.addEventListener("awesomplete-selectcomplete",u=>c(u),!1),t.addEventListener("keyup",function(u){(u.key==="Enter"||u.key==="Tab")&&!o&&s.suggestions?.length&&(s.next(),s.select(0)),o=!1}),i){const u=e.find(l=>l.value===i)?.label;u&&(t.value=u)}return{typeAhead:s}}function bS(e){return e[e.length-1]}function ed(e,...t){return t.forEach(r=>{e.includes(r)||e.push(r)}),e}function LC(e,t){return e?e.split(t):[]}function MS(e,t,r){const i=t===void 0||e>=t,n=r===void 0||e<=r;return i&&n}function _C(e,t,r){return e<t?t:e>r?r:e}function Wc(e,t,r={},i=0,n=""){const a=Object.keys(r).reduce((o,c)=>{let u=r[c];return typeof u=="function"&&(u=u(i)),`${o} ${c}="${u}"`},e);n+=`<${a}></${e}>`;const s=i+1;return s<t?Wc(e,t,r,s,n):n}function RS(e){return e.replace(/>\s+/g,">").replace(/\s+</,"<")}function NS(e){return new Date(e).setHours(0,0,0,0)}function Po(){return new Date().setHours(0,0,0,0)}function qc(...e){switch(e.length){case 0:return Po();case 1:return NS(e[0])}const t=new Date(0);return t.setFullYear(...e),t.setHours(0,0,0,0)}function td(e,t){const r=new Date(e);return r.setDate(r.getDate()+t)}function vW(e,t){return td(e,t*7)}function Tf(e,t){const r=new Date(e),i=r.getMonth()+t;let n=i%12;n<0&&(n+=12);const a=r.setMonth(i);return r.getMonth()!==n?r.setDate(0):a}function rd(e,t){const r=new Date(e),i=r.getMonth(),n=r.setFullYear(r.getFullYear()+t);return i===1&&r.getMonth()===2?r.setDate(0):n}function BC(e,t){return(e-t+7)%7}function bo(e,t,r=0){const i=new Date(e).getDay();return td(e,BC(t,r)-BC(i,r))}function VC(e,t){return Math.round((e-t)/6048e5)+1}function wW(e){const t=bo(e,4,1),r=bo(new Date(t).setMonth(0,4),4,1);return VC(t,r)}function jC(e,t){const r=bo(new Date(e).setMonth(0,1),t,t),i=bo(e,t,t),n=VC(i,r);if(n<53)return n;const a=bo(new Date(e).setDate(32),t,t);return i===a?1:n}function DW(e){return jC(e,0)}function TW(e){return jC(e,6)}function Hc(e,t){const r=new Date(e).getFullYear();return Math.floor(r/t)*t}function vs(e,t,r){if(t!==1&&t!==2)return e;const i=new Date(e);return t===1?r?i.setMonth(i.getMonth()+1,0):i.setDate(1):r?i.setFullYear(i.getFullYear()+1,0,0):i.setMonth(0,1),i.setHours(0,0,0,0)}const ES=/dd?|DD?|mm?|MM?|yy?(?:yy)?/,PW=/[\s!-/:-@[-`{-~年月日]+/;let AS={};const GC={y(e,t){return new Date(e).setFullYear(parseInt(t,10))},m(e,t,r){const i=new Date(e);let n=parseInt(t,10)-1;if(isNaN(n)){if(!t)return NaN;const a=t.toLowerCase(),s=o=>o.toLowerCase().startsWith(a);if(n=r.monthsShort.findIndex(s),n<0&&(n=r.months.findIndex(s)),n<0)return NaN}return i.setMonth(n),i.getMonth()!==$C(n)?i.setDate(0):i.getTime()},d(e,t){return new Date(e).setDate(parseInt(t,10))}},bW={d(e){return e.getDate()},dd(e){return Pf(e.getDate(),2)},D(e,t){return t.daysShort[e.getDay()]},DD(e,t){return t.days[e.getDay()]},m(e){return e.getMonth()+1},mm(e){return Pf(e.getMonth()+1,2)},M(e,t){return t.monthsShort[e.getMonth()]},MM(e,t){return t.months[e.getMonth()]},y(e){return e.getFullYear()},yy(e){return Pf(e.getFullYear(),2).slice(-2)},yyyy(e){return Pf(e.getFullYear(),4)}};function $C(e){return e>-1?e%12:$C(e+12)}function Pf(e,t){return e.toString().padStart(t,"0")}function WC(e){if(typeof e!="string")throw new Error("Invalid date format.");if(e in AS)return AS[e];const t=e.split(ES),r=e.match(new RegExp(ES,"g"));if(t.length===0||!r)throw new Error("Invalid date format.");const i=r.map(a=>bW[a]),n=Object.keys(GC).reduce((a,s)=>(r.find(c=>c[0]!=="D"&&c[0].toLowerCase()===s)&&a.push(s),a),[]);return AS[e]={parser(a,s){const o=a.split(PW).reduce((c,u,l)=>{if(u.length>0&&r[l]){const d=r[l][0];d==="M"?c.m=u:d!=="D"&&(c[d]=u)}return c},{});return n.reduce((c,u)=>{const l=GC[u](c,o[u],s);return isNaN(l)?c:l},Po())},formatter(a,s){let o=i.reduce((c,u,l)=>c+=`${t[l]}${u(a,s)}`,"");return o+=bS(t)}}}function Mo(e,t,r){if(e instanceof Date||typeof e=="number"){const i=NS(e);return isNaN(i)?void 0:i}if(e){if(e==="today")return Po();if(t&&t.toValue){const i=t.toValue(e,t,r);return isNaN(i)?void 0:NS(i)}return WC(t).parser(e,r)}}function id(e,t,r){if(isNaN(e)||!e&&e!==0)return"";const i=typeof e=="number"?new Date(e):e;return t.toDisplay?t.toDisplay(i,t,r):WC(t).formatter(i,r)}const MW=document.createRange();function Fa(e){return MW.createContextualFragment(e)}function qC(e){return e.parentElement||(e.parentNode instanceof ShadowRoot?e.parentNode.host:void 0)}function bf(e){return e.getRootNode().activeElement===e}function nd(e){e.style.display!=="none"&&(e.style.display&&(e.dataset.styleDisplay=e.style.display),e.style.display="none")}function ad(e){e.style.display==="none"&&(e.dataset.styleDisplay?(e.style.display=e.dataset.styleDisplay,delete e.dataset.styleDisplay):e.style.display="")}function Mf(e){e.firstChild&&(e.removeChild(e.firstChild),Mf(e))}function RW(e,t){Mf(e),t instanceof DocumentFragment?e.appendChild(t):typeof t=="string"?e.appendChild(Fa(t)):typeof t.forEach=="function"&&t.forEach(r=>{e.appendChild(r)})}const Rf=new WeakMap,{addEventListener:NW,removeEventListener:EW}=EventTarget.prototype;function Nf(e,t){let r=Rf.get(e);r||(r=[],Rf.set(e,r)),t.forEach(i=>{NW.call(...i),r.push(i)})}function HC(e){let t=Rf.get(e);t&&(t.forEach(r=>{EW.call(...r)}),Rf.delete(e))}if(!Event.prototype.composedPath){const e=(t,r=[])=>{r.push(t);let i;return t.parentNode?i=t.parentNode:t.host?i=t.host:t.defaultView&&(i=t.defaultView),i?e(i,r):r};Event.prototype.composedPath=function(){return e(this.target)}}function zC(e,t,r){const[i,...n]=e;if(t(i))return i;if(!(i===r||i.tagName==="HTML"||n.length===0))return zC(n,t,r)}function YC(e,t){const r=typeof t=="function"?t:i=>i instanceof Element&&i.matches(t);return zC(e.composedPath(),r,e.currentTarget)}const sd={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear",titleFormat:"MM y"}},CS={autohide:!1,beforeShowDay:null,beforeShowDecade:null,beforeShowMonth:null,beforeShowYear:null,clearButton:!1,dateDelimiter:",",datesDisabled:[],daysOfWeekDisabled:[],daysOfWeekHighlighted:[],defaultViewDate:void 0,disableTouchKeyboard:!1,enableOnReadonly:!0,format:"mm/dd/yyyy",language:"en",maxDate:null,maxNumberOfDates:1,maxView:3,minDate:null,nextArrow:"»",orientation:"auto",pickLevel:0,prevArrow:"«",showDaysOfWeek:!0,showOnClick:!0,showOnFocus:!0,startView:0,title:"",todayButton:!1,todayButtonMode:0,todayHighlight:!1,updateOnBlur:!0,weekNumbers:0,weekStart:0},{language:OS,format:AW,weekStart:CW}=CS;function KC(e,t){return e.length<6&&t>=0&&t<7?ed(e,t):e}function XC(e,t){switch(e===4?t===6?3:!t+1:e){case 1:return wW;case 2:return DW;case 3:return TW}}function QC(e,t,r){return t.weekStart=e,t.weekEnd=(e+6)%7,r===4&&(t.getWeekNumber=XC(4,e)),e}function JC(e,t,r,i){const n=Mo(e,t,r);return n!==void 0?n:i}function kS(e,t,r=3){const i=parseInt(e,10);return i>=0&&i<=r?i:t}function Ef(e,t,r,i=void 0){t in e&&(r in e||(e[r]=i?i(e[t]):e[t]),delete e[t])}function xS(e,t){const r=Object.assign({},e),i={},n=t.constructor.locales,a=!!t.rangeSideIndex;let{datesDisabled:s,format:o,language:c,locale:u,maxDate:l,maxView:d,minDate:p,pickLevel:m,startView:f,weekNumbers:h,weekStart:g}=t.config||{};if(Ef(r,"calendarWeeks","weekNumbers",w=>w?1:0),Ef(r,"clearBtn","clearButton"),Ef(r,"todayBtn","todayButton"),Ef(r,"todayBtnMode","todayButtonMode"),r.language){let w;if(r.language!==c&&(n[r.language]?w=r.language:(w=r.language.split("-")[0],n[w]||(w=!1))),delete r.language,w){c=i.language=w;const S=u||n[OS];u=Object.assign({format:AW,weekStart:CW},n[OS]),c!==OS&&Object.assign(u,n[c]),i.locale=u,o===S.format&&(o=i.format=u.format),g===S.weekStart&&(g=QC(u.weekStart,i,h))}}if(r.format){const w=typeof r.format.toDisplay=="function",S=typeof r.format.toValue=="function",T=ES.test(r.format);(w&&S||T)&&(o=i.format=r.format),delete r.format}let I=m;"pickLevel"in r&&(I=kS(r.pickLevel,m,2),delete r.pickLevel),I!==m&&(I>m&&("minDate"in r||(r.minDate=p),"maxDate"in r||(r.maxDate=l)),s&&!r.datesDisabled&&(r.datesDisabled=[]),m=i.pickLevel=I);let y=p,U=l;if("minDate"in r){const w=qc(0,0,1);y=r.minDate===null?w:JC(r.minDate,o,u,y),y!==w&&(y=vs(y,m,!1)),delete r.minDate}if("maxDate"in r&&(U=r.maxDate===null?void 0:JC(r.maxDate,o,u,U),U!==void 0&&(U=vs(U,m,!0)),delete r.maxDate),U<y?(p=i.minDate=U,l=i.maxDate=y):(p!==y&&(p=i.minDate=y),l!==U&&(l=i.maxDate=U)),r.datesDisabled){const w=r.datesDisabled;if(typeof w=="function")i.datesDisabled=null,i.checkDisabled=(S,T)=>w(new Date(S),T,a);else{const S=i.datesDisabled=w.reduce((T,b)=>{const P=Mo(b,o,u);return P!==void 0?ed(T,vs(P,m,a)):T},[]);i.checkDisabled=T=>S.includes(T)}delete r.datesDisabled}if("defaultViewDate"in r){const w=Mo(r.defaultViewDate,o,u);w!==void 0&&(i.defaultViewDate=w),delete r.defaultViewDate}if("weekStart"in r){const w=Number(r.weekStart)%7;isNaN(w)||(g=QC(w,i,h)),delete r.weekStart}if(r.daysOfWeekDisabled&&(i.daysOfWeekDisabled=r.daysOfWeekDisabled.reduce(KC,[]),delete r.daysOfWeekDisabled),r.daysOfWeekHighlighted&&(i.daysOfWeekHighlighted=r.daysOfWeekHighlighted.reduce(KC,[]),delete r.daysOfWeekHighlighted),"weekNumbers"in r){let w=r.weekNumbers;if(w){const S=typeof w=="function"?(T,b)=>w(new Date(T),b):XC(w=parseInt(w,10),g);S&&(h=i.weekNumbers=w,i.getWeekNumber=S)}else h=i.weekNumbers=0,i.getWeekNumber=null;delete r.weekNumbers}if("maxNumberOfDates"in r){const w=parseInt(r.maxNumberOfDates,10);w>=0&&(i.maxNumberOfDates=w,i.multidate=w!==1),delete r.maxNumberOfDates}r.dateDelimiter&&(i.dateDelimiter=String(r.dateDelimiter),delete r.dateDelimiter);let D=d;"maxView"in r&&(D=kS(r.maxView,d),delete r.maxView),D=m>D?m:D,D!==d&&(d=i.maxView=D);let v=f;if("startView"in r&&(v=kS(r.startView,v),delete r.startView),v<m?v=m:v>d&&(v=d),v!==f&&(i.startView=v),r.prevArrow){const w=Fa(r.prevArrow);w.childNodes.length>0&&(i.prevArrow=w.childNodes),delete r.prevArrow}if(r.nextArrow){const w=Fa(r.nextArrow);w.childNodes.length>0&&(i.nextArrow=w.childNodes),delete r.nextArrow}if("disableTouchKeyboard"in r&&(i.disableTouchKeyboard="ontouchstart"in document&&!!r.disableTouchKeyboard,delete r.disableTouchKeyboard),r.orientation){const w=r.orientation.toLowerCase().split(/\s+/g);i.orientation={x:w.find(S=>S==="left"||S==="right")||"auto",y:w.find(S=>S==="top"||S==="bottom")||"auto"},delete r.orientation}if("todayButtonMode"in r){switch(r.todayButtonMode){case 0:case 1:i.todayButtonMode=r.todayButtonMode}delete r.todayButtonMode}return Object.entries(r).forEach(([w,S])=>{S!==void 0&&w in CS&&(i[w]=S)}),i}const ZC={show:{key:"ArrowDown"},hide:null,toggle:{key:"Escape"},prevButton:{key:"ArrowLeft",ctrlOrMetaKey:!0},nextButton:{key:"ArrowRight",ctrlOrMetaKey:!0},viewSwitch:{key:"ArrowUp",ctrlOrMetaKey:!0},clearButton:{key:"Backspace",ctrlOrMetaKey:!0},todayButton:{key:".",ctrlOrMetaKey:!0},exitEditMode:{key:"ArrowDown",ctrlOrMetaKey:!0}};function OW(e){return Object.keys(ZC).reduce((t,r)=>{const i=e[r]===void 0?ZC[r]:e[r],n=i&&i.key;if(!n||typeof n!="string")return t;const a={key:n,ctrlOrMetaKey:!!(i.ctrlOrMetaKey||i.ctrlKey||i.metaKey)};return n.length>1&&(a.altKey=!!i.altKey,a.shiftKey=!!i.shiftKey),t[r]=a,t},{})}const e0=e=>e.map(t=>`<button type="button" class="%buttonClass% ${t}" tabindex="-1"></button>`).join(""),kW=RS(`<div class="datepicker">
38
38
  <div class="datepicker-picker">
39
39
  <div class="datepicker-header">
40
40
  <div class="datepicker-title"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "courthive-components",
3
- "version": "0.8.6",
3
+ "version": "0.8.7",
4
4
  "engines": {
5
5
  "node": ">=16.16.0 < 25"
6
6
  },
@@ -35,9 +35,11 @@
35
35
  "homepage": "https://courthive.github.io/courthive-component",
36
36
  "scripts": {
37
37
  "commits": "git log $(git describe --tags --abbrev=0)..HEAD --oneline --no-merges --pretty=format:'%s: %h' | sed '/courthive-components/d'",
38
- "release": "npm run build && npm run commits && npm run release:patch",
38
+ "release": "npm run release:patch",
39
39
  "dev": "vite",
40
- "build": "vite build && ./addVersion $npm_package_version",
40
+ "build": "vite build",
41
+ "postbuild": "./addVersion $npm_package_version",
42
+ "prepublishOnly": "npm run build",
41
43
  "preview": "vite preview",
42
44
  "storybook": "storybook dev -p 6006",
43
45
  "build-storybook": "storybook build",
@@ -48,9 +50,9 @@
48
50
  "lint": "eslint src --fix --cache",
49
51
  "lint:report": "eslint src & eslint --cache src -f json > eslint-report.json",
50
52
  "format": "prettier --write src",
51
- "release:major": "npm run build && npm run commits && npm version $(semver $npm_package_version -i major) && npm publish --tag latest",
52
- "release:minor": "npm run build && npm run commits && npm version $(semver $npm_package_version -i minor) && npm publish --tag latest",
53
- "release:patch": "npm version $(semver $npm_package_version -i patch) && npm publish --tag latest"
53
+ "release:major": "npm run commits && npm version $(semver $npm_package_version -i major) && npm publish --tag latest",
54
+ "release:minor": "npm run commits && npm version $(semver $npm_package_version -i minor) && npm publish --tag latest",
55
+ "release:patch": "npm run commits && npm version $(semver $npm_package_version -i patch) && npm publish --tag latest"
54
56
  },
55
57
  "lint-staged": {
56
58
  "*.{js,ts}": "eslint --cache --fix",