@luceosports/play-rendering 2.5.4 → 2.5.5

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.
@@ -20,5 +20,5 @@
20
20
  * Copyright (c) 2022 Michael Mclaughlin <M8ch88l@gmail.com>
21
21
  * MIT Licence
22
22
  */
23
- var zr,Or,Er=9e15,Ar="0123456789abcdef",fr="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",pr="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Ur={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-Er,maxE:Er,crypto:!1},dr=!0,Cr="[DecimalError] Invalid argument: ",Qr="[object Decimal]",wr=Math.floor,Lr=Math.pow,Sr=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,kr=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,vr=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Yr=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,mr=1e7,Rr=fr.length-1,Fr=pr.length-1,br={toStringTag:Qr};function Zr(t){var n,e,r,i=t.length-1,u="",o=t[0];if(i>0){for(u+=o,n=1;n<i;n++)(e=7-(r=t[n]+"").length)&&(u+=_r(e)),u+=r;(e=7-(r=(o=t[n])+"").length)&&(u+=_r(e))}else if(0===o)return"0";for(;o%10==0;)o/=10;return u+o}function Br(t,n,e){if(t!==~~t||t<n||t>e)throw Error(Cr+t)}function Vr(t,n,e,r){var i,u,o,M;for(u=t[0];u>=10;u/=10)--n;return--n<0?(n+=7,i=0):(i=Math.ceil((n+1)/7),n%=7),u=Lr(10,7-n),M=t[i]%u|0,null==r?n<3?(0==n?M=M/100|0:1==n&&(M=M/10|0),o=e<4&&99999==M||e>3&&49999==M||5e4==M||0==M):o=(e<4&&M+1==u||e>3&&M+1==u/2)&&(t[i+1]/u/100|0)==Lr(10,n-2)-1||(M==u/2||0==M)&&0==(t[i+1]/u/100|0):n<4?(0==n?M=M/1e3|0:1==n?M=M/100|0:2==n&&(M=M/10|0),o=(r||e<4)&&9999==M||!r&&e>3&&4999==M):o=((r||e<4)&&M+1==u||!r&&e>3&&M+1==u/2)&&(t[i+1]/u/1e3|0)==Lr(10,n-3)-1,o}function Wr(t,n,e){for(var r,i,u=[0],o=0,M=t.length;o<M;){for(i=u.length;i--;)u[i]*=n;for(u[0]+=Ar.indexOf(t.charAt(o++)),r=0;r<u.length;r++)u[r]>e-1&&(void 0===u[r+1]&&(u[r+1]=0),u[r+1]+=u[r]/e|0,u[r]%=e)}return u.reverse()}br.absoluteValue=br.abs=function(){var t=new this.constructor(this);return t.s<0&&(t.s=1),Pr(t)},br.ceil=function(){return Pr(new this.constructor(this),this.e+1,2)},br.clampedTo=br.clamp=function(t,n){var e=this,r=e.constructor;if(t=new r(t),n=new r(n),!t.s||!n.s)return new r(NaN);if(t.gt(n))throw Error(Cr+n);return e.cmp(t)<0?t:e.cmp(n)>0?n:new r(e)},br.comparedTo=br.cmp=function(t){var n,e,r,i,u=this,o=u.d,M=(t=new u.constructor(t)).d,c=u.s,N=t.s;if(!o||!M)return c&&N?c!==N?c:o===M?0:!o^c<0?1:-1:NaN;if(!o[0]||!M[0])return o[0]?c:M[0]?-N:0;if(c!==N)return c;if(u.e!==t.e)return u.e>t.e^c<0?1:-1;for(n=0,e=(r=o.length)<(i=M.length)?r:i;n<e;++n)if(o[n]!==M[n])return o[n]>M[n]^c<0?1:-1;return r===i?0:r>i^c<0?1:-1},br.cosine=br.cos=function(){var t,n,e=this,r=e.constructor;return e.d?e.d[0]?(t=r.precision,n=r.rounding,r.precision=t+Math.max(e.e,e.sd())+7,r.rounding=1,e=function(t,n){var e,r,i;if(n.isZero())return n;(r=n.d.length)<32?(e=Math.ceil(r/3),i=(1/ci(4,e)).toString()):(e=16,i="2.3283064365386962890625e-10");t.precision+=e,n=Mi(t,1,n.times(i),new t(1));for(var u=e;u--;){var o=n.times(n);n=o.times(o).minus(o).times(8).plus(1)}return t.precision-=e,n}(r,Ni(r,e)),r.precision=t,r.rounding=n,Pr(2==Or||3==Or?e.neg():e,t,n,!0)):new r(1):new r(NaN)},br.cubeRoot=br.cbrt=function(){var t,n,e,r,i,u,o,M,c,N,a=this,s=a.constructor;if(!a.isFinite()||a.isZero())return new s(a);for(dr=!1,(u=a.s*Lr(a.s*a,1/3))&&Math.abs(u)!=1/0?r=new s(u.toString()):(e=Zr(a.d),(u=((t=a.e)-e.length+1)%3)&&(e+=1==u||-2==u?"0":"00"),u=Lr(e,1/3),t=wr((t+1)/3)-(t%3==(t<0?-1:2)),(r=new s(e=u==1/0?"5e"+t:(e=u.toExponential()).slice(0,e.indexOf("e")+1)+t)).s=a.s),o=(t=s.precision)+3;;)if(N=(c=(M=r).times(M).times(M)).plus(a),r=Gr(N.plus(a).times(M),N.plus(c),o+2,1),Zr(M.d).slice(0,o)===(e=Zr(r.d)).slice(0,o)){if("9999"!=(e=e.slice(o-3,o+1))&&(i||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(Pr(r,t+1,1),n=!r.times(r).times(r).eq(a));break}if(!i&&(Pr(M,t+1,0),M.times(M).times(M).eq(a))){r=M;break}o+=4,i=1}return dr=!0,Pr(r,t,s.rounding,n)},br.decimalPlaces=br.dp=function(){var t,n=this.d,e=NaN;if(n){if(e=7*((t=n.length-1)-wr(this.e/7)),t=n[t])for(;t%10==0;t/=10)e--;e<0&&(e=0)}return e},br.dividedBy=br.div=function(t){return Gr(this,new this.constructor(t))},br.dividedToIntegerBy=br.divToInt=function(t){var n=this.constructor;return Pr(Gr(this,new n(t),0,1,1),n.precision,n.rounding)},br.equals=br.eq=function(t){return 0===this.cmp(t)},br.floor=function(){return Pr(new this.constructor(this),this.e+1,3)},br.greaterThan=br.gt=function(t){return this.cmp(t)>0},br.greaterThanOrEqualTo=br.gte=function(t){var n=this.cmp(t);return 1==n||0===n},br.hyperbolicCosine=br.cosh=function(){var t,n,e,r,i,u=this,o=u.constructor,M=new o(1);if(!u.isFinite())return new o(u.s?1/0:NaN);if(u.isZero())return M;e=o.precision,r=o.rounding,o.precision=e+Math.max(u.e,u.sd())+4,o.rounding=1,(i=u.d.length)<32?n=(1/ci(4,t=Math.ceil(i/3))).toString():(t=16,n="2.3283064365386962890625e-10"),u=Mi(o,1,u.times(n),new o(1),!0);for(var c,N=t,a=new o(8);N--;)c=u.times(u),u=M.minus(c.times(a.minus(c.times(a))));return Pr(u,o.precision=e,o.rounding=r,!0)},br.hyperbolicSine=br.sinh=function(){var t,n,e,r,i=this,u=i.constructor;if(!i.isFinite()||i.isZero())return new u(i);if(n=u.precision,e=u.rounding,u.precision=n+Math.max(i.e,i.sd())+4,u.rounding=1,(r=i.d.length)<3)i=Mi(u,2,i,i,!0);else{t=(t=1.4*Math.sqrt(r))>16?16:0|t,i=Mi(u,2,i=i.times(1/ci(5,t)),i,!0);for(var o,M=new u(5),c=new u(16),N=new u(20);t--;)o=i.times(i),i=i.times(M.plus(o.times(c.times(o).plus(N))))}return u.precision=n,u.rounding=e,Pr(i,n,e,!0)},br.hyperbolicTangent=br.tanh=function(){var t,n,e=this,r=e.constructor;return e.isFinite()?e.isZero()?new r(e):(t=r.precision,n=r.rounding,r.precision=t+7,r.rounding=1,Gr(e.sinh(),e.cosh(),r.precision=t,r.rounding=n)):new r(e.s)},br.inverseCosine=br.acos=function(){var t,n=this,e=n.constructor,r=n.abs().cmp(1),i=e.precision,u=e.rounding;return-1!==r?0===r?n.isNeg()?Xr(e,i,u):new e(0):new e(NaN):n.isZero()?Xr(e,i+4,u).times(.5):(e.precision=i+6,e.rounding=1,n=n.asin(),t=Xr(e,i+4,u).times(.5),e.precision=i,e.rounding=u,t.minus(n))},br.inverseHyperbolicCosine=br.acosh=function(){var t,n,e=this,r=e.constructor;return e.lte(1)?new r(e.eq(1)?0:NaN):e.isFinite()?(t=r.precision,n=r.rounding,r.precision=t+Math.max(Math.abs(e.e),e.sd())+4,r.rounding=1,dr=!1,e=e.times(e).minus(1).sqrt().plus(e),dr=!0,r.precision=t,r.rounding=n,e.ln()):new r(e)},br.inverseHyperbolicSine=br.asinh=function(){var t,n,e=this,r=e.constructor;return!e.isFinite()||e.isZero()?new r(e):(t=r.precision,n=r.rounding,r.precision=t+2*Math.max(Math.abs(e.e),e.sd())+6,r.rounding=1,dr=!1,e=e.times(e).plus(1).sqrt().plus(e),dr=!0,r.precision=t,r.rounding=n,e.ln())},br.inverseHyperbolicTangent=br.atanh=function(){var t,n,e,r,i=this,u=i.constructor;return i.isFinite()?i.e>=0?new u(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(t=u.precision,n=u.rounding,r=i.sd(),Math.max(r,t)<2*-i.e-1?Pr(new u(i),t,n,!0):(u.precision=e=r-i.e,i=Gr(i.plus(1),new u(1).minus(i),e+t,1),u.precision=t+4,u.rounding=1,i=i.ln(),u.precision=t,u.rounding=n,i.times(.5))):new u(NaN)},br.inverseSine=br.asin=function(){var t,n,e,r,i=this,u=i.constructor;return i.isZero()?new u(i):(n=i.abs().cmp(1),e=u.precision,r=u.rounding,-1!==n?0===n?((t=Xr(u,e+4,r).times(.5)).s=i.s,t):new u(NaN):(u.precision=e+6,u.rounding=1,i=i.div(new u(1).minus(i.times(i)).sqrt().plus(1)).atan(),u.precision=e,u.rounding=r,i.times(2)))},br.inverseTangent=br.atan=function(){var t,n,e,r,i,u,o,M,c,N=this,a=N.constructor,s=a.precision,D=a.rounding;if(N.isFinite()){if(N.isZero())return new a(N);if(N.abs().eq(1)&&s+4<=Fr)return(o=Xr(a,s+4,D).times(.25)).s=N.s,o}else{if(!N.s)return new a(NaN);if(s+4<=Fr)return(o=Xr(a,s+4,D).times(.5)).s=N.s,o}for(a.precision=M=s+10,a.rounding=1,t=e=Math.min(28,M/7+2|0);t;--t)N=N.div(N.times(N).plus(1).sqrt().plus(1));for(dr=!1,n=Math.ceil(M/7),r=1,c=N.times(N),o=new a(N),i=N;-1!==t;)if(i=i.times(c),u=o.minus(i.div(r+=2)),i=i.times(c),void 0!==(o=u.plus(i.div(r+=2))).d[n])for(t=n;o.d[t]===u.d[t]&&t--;);return e&&(o=o.times(2<<e-1)),dr=!0,Pr(o,a.precision=s,a.rounding=D,!0)},br.isFinite=function(){return!!this.d},br.isInteger=br.isInt=function(){return!!this.d&&wr(this.e/7)>this.d.length-2},br.isNaN=function(){return!this.s},br.isNegative=br.isNeg=function(){return this.s<0},br.isPositive=br.isPos=function(){return this.s>0},br.isZero=function(){return!!this.d&&0===this.d[0]},br.lessThan=br.lt=function(t){return this.cmp(t)<0},br.lessThanOrEqualTo=br.lte=function(t){return this.cmp(t)<1},br.logarithm=br.log=function(t){var n,e,r,i,u,o,M,c,N=this.constructor,a=N.precision,s=N.rounding;if(null==t)t=new N(10),n=!0;else{if(e=(t=new N(t)).d,t.s<0||!e||!e[0]||t.eq(1))return new N(NaN);n=t.eq(10)}if(e=this.d,this.s<0||!e||!e[0]||this.eq(1))return new N(e&&!e[0]?-1/0:1!=this.s?NaN:e?0:1/0);if(n)if(e.length>1)u=!0;else{for(i=e[0];i%10==0;)i/=10;u=1!==i}if(dr=!1,o=ri(this,M=a+5),r=n?Kr(N,M+10):ri(t,M),Vr((c=Gr(o,r,M,1)).d,i=a,s))do{if(o=ri(this,M+=10),r=n?Kr(N,M+10):ri(t,M),c=Gr(o,r,M,1),!u){+Zr(c.d).slice(i+1,i+15)+1==1e14&&(c=Pr(c,a+1,0));break}}while(Vr(c.d,i+=10,s));return dr=!0,Pr(c,a,s)},br.minus=br.sub=function(t){var n,e,r,i,u,o,M,c,N,a,s,D,T=this,g=T.constructor;if(t=new g(t),!T.d||!t.d)return T.s&&t.s?T.d?t.s=-t.s:t=new g(t.d||T.s!==t.s?T:NaN):t=new g(NaN),t;if(T.s!=t.s)return t.s=-t.s,T.plus(t);if(N=T.d,D=t.d,M=g.precision,c=g.rounding,!N[0]||!D[0]){if(D[0])t.s=-t.s;else{if(!N[0])return new g(3===c?-0:0);t=new g(T)}return dr?Pr(t,M,c):t}if(e=wr(t.e/7),a=wr(T.e/7),N=N.slice(),u=a-e){for((s=u<0)?(n=N,u=-u,o=D.length):(n=D,e=a,o=N.length),u>(r=Math.max(Math.ceil(M/7),o)+2)&&(u=r,n.length=1),n.reverse(),r=u;r--;)n.push(0);n.reverse()}else{for((s=(r=N.length)<(o=D.length))&&(o=r),r=0;r<o;r++)if(N[r]!=D[r]){s=N[r]<D[r];break}u=0}for(s&&(n=N,N=D,D=n,t.s=-t.s),o=N.length,r=D.length-o;r>0;--r)N[o++]=0;for(r=D.length;r>u;){if(N[--r]<D[r]){for(i=r;i&&0===N[--i];)N[i]=mr-1;--N[i],N[r]+=mr}N[r]-=D[r]}for(;0===N[--o];)N.pop();for(;0===N[0];N.shift())--e;return N[0]?(t.d=N,t.e=Hr(N,e),dr?Pr(t,M,c):t):new g(3===c?-0:0)},br.modulo=br.mod=function(t){var n,e=this,r=e.constructor;return t=new r(t),!e.d||!t.s||t.d&&!t.d[0]?new r(NaN):!t.d||e.d&&!e.d[0]?Pr(new r(e),r.precision,r.rounding):(dr=!1,9==r.modulo?(n=Gr(e,t.abs(),0,3,1)).s*=t.s:n=Gr(e,t,0,r.modulo,1),n=n.times(t),dr=!0,e.minus(n))},br.naturalExponential=br.exp=function(){return ei(this)},br.naturalLogarithm=br.ln=function(){return ri(this)},br.negated=br.neg=function(){var t=new this.constructor(this);return t.s=-t.s,Pr(t)},br.plus=br.add=function(t){var n,e,r,i,u,o,M,c,N,a,s=this,D=s.constructor;if(t=new D(t),!s.d||!t.d)return s.s&&t.s?s.d||(t=new D(t.d||s.s===t.s?s:NaN)):t=new D(NaN),t;if(s.s!=t.s)return t.s=-t.s,s.minus(t);if(N=s.d,a=t.d,M=D.precision,c=D.rounding,!N[0]||!a[0])return a[0]||(t=new D(s)),dr?Pr(t,M,c):t;if(u=wr(s.e/7),r=wr(t.e/7),N=N.slice(),i=u-r){for(i<0?(e=N,i=-i,o=a.length):(e=a,r=u,o=N.length),i>(o=(u=Math.ceil(M/7))>o?u+1:o+1)&&(i=o,e.length=1),e.reverse();i--;)e.push(0);e.reverse()}for((o=N.length)-(i=a.length)<0&&(i=o,e=a,a=N,N=e),n=0;i;)n=(N[--i]=N[i]+a[i]+n)/mr|0,N[i]%=mr;for(n&&(N.unshift(n),++r),o=N.length;0==N[--o];)N.pop();return t.d=N,t.e=Hr(N,r),dr?Pr(t,M,c):t},br.precision=br.sd=function(t){var n,e=this;if(void 0!==t&&t!==!!t&&1!==t&&0!==t)throw Error(Cr+t);return e.d?(n=qr(e.d),t&&e.e+1>n&&(n=e.e+1)):n=NaN,n},br.round=function(){var t=this,n=t.constructor;return Pr(new n(t),t.e+1,n.rounding)},br.sine=br.sin=function(){var t,n,e=this,r=e.constructor;return e.isFinite()?e.isZero()?new r(e):(t=r.precision,n=r.rounding,r.precision=t+Math.max(e.e,e.sd())+7,r.rounding=1,e=function(t,n){var e,r=n.d.length;if(r<3)return n.isZero()?n:Mi(t,2,n,n);e=(e=1.4*Math.sqrt(r))>16?16:0|e,n=n.times(1/ci(5,e)),n=Mi(t,2,n,n);for(var i,u=new t(5),o=new t(16),M=new t(20);e--;)i=n.times(n),n=n.times(u.plus(i.times(o.times(i).minus(M))));return n}(r,Ni(r,e)),r.precision=t,r.rounding=n,Pr(Or>2?e.neg():e,t,n,!0)):new r(NaN)},br.squareRoot=br.sqrt=function(){var t,n,e,r,i,u,o=this,M=o.d,c=o.e,N=o.s,a=o.constructor;if(1!==N||!M||!M[0])return new a(!N||N<0&&(!M||M[0])?NaN:M?o:1/0);for(dr=!1,0==(N=Math.sqrt(+o))||N==1/0?(((n=Zr(M)).length+c)%2==0&&(n+="0"),N=Math.sqrt(n),c=wr((c+1)/2)-(c<0||c%2),r=new a(n=N==1/0?"5e"+c:(n=N.toExponential()).slice(0,n.indexOf("e")+1)+c)):r=new a(N.toString()),e=(c=a.precision)+3;;)if(r=(u=r).plus(Gr(o,u,e+2,1)).times(.5),Zr(u.d).slice(0,e)===(n=Zr(r.d)).slice(0,e)){if("9999"!=(n=n.slice(e-3,e+1))&&(i||"4999"!=n)){+n&&(+n.slice(1)||"5"!=n.charAt(0))||(Pr(r,c+1,1),t=!r.times(r).eq(o));break}if(!i&&(Pr(u,c+1,0),u.times(u).eq(o))){r=u;break}e+=4,i=1}return dr=!0,Pr(r,c,a.rounding,t)},br.tangent=br.tan=function(){var t,n,e=this,r=e.constructor;return e.isFinite()?e.isZero()?new r(e):(t=r.precision,n=r.rounding,r.precision=t+10,r.rounding=1,(e=e.sin()).s=1,e=Gr(e,new r(1).minus(e.times(e)).sqrt(),t+10,0),r.precision=t,r.rounding=n,Pr(2==Or||4==Or?e.neg():e,t,n,!0)):new r(NaN)},br.times=br.mul=function(t){var n,e,r,i,u,o,M,c,N,a=this,s=a.constructor,D=a.d,T=(t=new s(t)).d;if(t.s*=a.s,!(D&&D[0]&&T&&T[0]))return new s(!t.s||D&&!D[0]&&!T||T&&!T[0]&&!D?NaN:D&&T?0*t.s:t.s/0);for(e=wr(a.e/7)+wr(t.e/7),(c=D.length)<(N=T.length)&&(u=D,D=T,T=u,o=c,c=N,N=o),u=[],r=o=c+N;r--;)u.push(0);for(r=N;--r>=0;){for(n=0,i=c+r;i>r;)M=u[i]+T[r]*D[i-r-1]+n,u[i--]=M%mr|0,n=M/mr|0;u[i]=(u[i]+n)%mr|0}for(;!u[--o];)u.pop();return n?++e:u.shift(),t.d=u,t.e=Hr(u,e),dr?Pr(t,s.precision,s.rounding):t},br.toBinary=function(t,n){return ai(this,2,t,n)},br.toDecimalPlaces=br.toDP=function(t,n){var e=this,r=e.constructor;return e=new r(e),void 0===t?e:(Br(t,0,1e9),void 0===n?n=r.rounding:Br(n,0,8),Pr(e,t+e.e+1,n))},br.toExponential=function(t,n){var e,r=this,i=r.constructor;return void 0===t?e=Jr(r,!0):(Br(t,0,1e9),void 0===n?n=i.rounding:Br(n,0,8),e=Jr(r=Pr(new i(r),t+1,n),!0,t+1)),r.isNeg()&&!r.isZero()?"-"+e:e},br.toFixed=function(t,n){var e,r,i=this,u=i.constructor;return void 0===t?e=Jr(i):(Br(t,0,1e9),void 0===n?n=u.rounding:Br(n,0,8),e=Jr(r=Pr(new u(i),t+i.e+1,n),!1,t+r.e+1)),i.isNeg()&&!i.isZero()?"-"+e:e},br.toFraction=function(t){var n,e,r,i,u,o,M,c,N,a,s,D,T=this,g=T.d,l=T.constructor;if(!g)return new l(T);if(N=e=new l(1),r=c=new l(0),o=(u=(n=new l(r)).e=qr(g)-T.e-1)%7,n.d[0]=Lr(10,o<0?7+o:o),null==t)t=u>0?n:N;else{if(!(M=new l(t)).isInt()||M.lt(N))throw Error(Cr+M);t=M.gt(n)?u>0?n:N:M}for(dr=!1,M=new l(Zr(g)),a=l.precision,l.precision=u=7*g.length*2;s=Gr(M,n,0,1,1),1!=(i=e.plus(s.times(r))).cmp(t);)e=r,r=i,i=N,N=c.plus(s.times(i)),c=i,i=n,n=M.minus(s.times(i)),M=i;return i=Gr(t.minus(e),r,0,1,1),c=c.plus(i.times(N)),e=e.plus(i.times(r)),c.s=N.s=T.s,D=Gr(N,r,u,1).minus(T).abs().cmp(Gr(c,e,u,1).minus(T).abs())<1?[N,r]:[c,e],l.precision=a,dr=!0,D},br.toHexadecimal=br.toHex=function(t,n){return ai(this,16,t,n)},br.toNearest=function(t,n){var e=this,r=e.constructor;if(e=new r(e),null==t){if(!e.d)return e;t=new r(1),n=r.rounding}else{if(t=new r(t),void 0===n?n=r.rounding:Br(n,0,8),!e.d)return t.s?e:t;if(!t.d)return t.s&&(t.s=e.s),t}return t.d[0]?(dr=!1,e=Gr(e,t,0,n,1).times(t),dr=!0,Pr(e)):(t.s=e.s,e=t),e},br.toNumber=function(){return+this},br.toOctal=function(t,n){return ai(this,8,t,n)},br.toPower=br.pow=function(t){var n,e,r,i,u,o,M=this,c=M.constructor,N=+(t=new c(t));if(!(M.d&&t.d&&M.d[0]&&t.d[0]))return new c(Lr(+M,N));if((M=new c(M)).eq(1))return M;if(r=c.precision,u=c.rounding,t.eq(1))return Pr(M,r,u);if((n=wr(t.e/7))>=t.d.length-1&&(e=N<0?-N:N)<=9007199254740991)return i=$r(c,M,e,r),t.s<0?new c(1).div(i):Pr(i,r,u);if((o=M.s)<0){if(n<t.d.length-1)return new c(NaN);if(0==(1&t.d[n])&&(o=1),0==M.e&&1==M.d[0]&&1==M.d.length)return M.s=o,M}return(n=0!=(e=Lr(+M,N))&&isFinite(e)?new c(e+"").e:wr(N*(Math.log("0."+Zr(M.d))/Math.LN10+M.e+1)))>c.maxE+1||n<c.minE-1?new c(n>0?o/0:0):(dr=!1,c.rounding=M.s=1,e=Math.min(12,(n+"").length),(i=ei(t.times(ri(M,r+e)),r)).d&&Vr((i=Pr(i,r+5,1)).d,r,u)&&(n=r+10,+Zr((i=Pr(ei(t.times(ri(M,n+e)),n),n+5,1)).d).slice(r+1,r+15)+1==1e14&&(i=Pr(i,r+1,0))),i.s=o,dr=!0,c.rounding=u,Pr(i,r,u))},br.toPrecision=function(t,n){var e,r=this,i=r.constructor;return void 0===t?e=Jr(r,r.e<=i.toExpNeg||r.e>=i.toExpPos):(Br(t,1,1e9),void 0===n?n=i.rounding:Br(n,0,8),e=Jr(r=Pr(new i(r),t,n),t<=r.e||r.e<=i.toExpNeg,t)),r.isNeg()&&!r.isZero()?"-"+e:e},br.toSignificantDigits=br.toSD=function(t,n){var e=this.constructor;return void 0===t?(t=e.precision,n=e.rounding):(Br(t,1,1e9),void 0===n?n=e.rounding:Br(n,0,8)),Pr(new e(this),t,n)},br.toString=function(){var t=this,n=t.constructor,e=Jr(t,t.e<=n.toExpNeg||t.e>=n.toExpPos);return t.isNeg()&&!t.isZero()?"-"+e:e},br.truncated=br.trunc=function(){return Pr(new this.constructor(this),this.e+1,1)},br.valueOf=br.toJSON=function(){var t=this,n=t.constructor,e=Jr(t,t.e<=n.toExpNeg||t.e>=n.toExpPos);return t.isNeg()?"-"+e:e};var Gr=function(){function t(t,n,e){var r,i=0,u=t.length;for(t=t.slice();u--;)r=t[u]*n+i,t[u]=r%e|0,i=r/e|0;return i&&t.unshift(i),t}function n(t,n,e,r){var i,u;if(e!=r)u=e>r?1:-1;else for(i=u=0;i<e;i++)if(t[i]!=n[i]){u=t[i]>n[i]?1:-1;break}return u}function e(t,n,e,r){for(var i=0;e--;)t[e]-=i,i=t[e]<n[e]?1:0,t[e]=i*r+t[e]-n[e];for(;!t[0]&&t.length>1;)t.shift()}return function(r,i,u,o,M,c){var N,a,s,D,T,g,l,I,y,h,j,x,z,O,E,A,f,p,U,d,C=r.constructor,Q=r.s==i.s?1:-1,w=r.d,L=i.d;if(!(w&&w[0]&&L&&L[0]))return new C(r.s&&i.s&&(w?!L||w[0]!=L[0]:L)?w&&0==w[0]||!L?0*Q:Q/0:NaN);for(c?(T=1,a=r.e-i.e):(c=mr,T=7,a=wr(r.e/T)-wr(i.e/T)),U=L.length,f=w.length,h=(y=new C(Q)).d=[],s=0;L[s]==(w[s]||0);s++);if(L[s]>(w[s]||0)&&a--,null==u?(O=u=C.precision,o=C.rounding):O=M?u+(r.e-i.e)+1:u,O<0)h.push(1),g=!0;else{if(O=O/T+2|0,s=0,1==U){for(D=0,L=L[0],O++;(s<f||D)&&O--;s++)E=D*c+(w[s]||0),h[s]=E/L|0,D=E%L|0;g=D||s<f}else{for((D=c/(L[0]+1)|0)>1&&(L=t(L,D,c),w=t(w,D,c),U=L.length,f=w.length),A=U,x=(j=w.slice(0,U)).length;x<U;)j[x++]=0;(d=L.slice()).unshift(0),p=L[0],L[1]>=c/2&&++p;do{D=0,(N=n(L,j,U,x))<0?(z=j[0],U!=x&&(z=z*c+(j[1]||0)),(D=z/p|0)>1?(D>=c&&(D=c-1),1==(N=n(l=t(L,D,c),j,I=l.length,x=j.length))&&(D--,e(l,U<I?d:L,I,c))):(0==D&&(N=D=1),l=L.slice()),(I=l.length)<x&&l.unshift(0),e(j,l,x,c),-1==N&&(N=n(L,j,U,x=j.length))<1&&(D++,e(j,U<x?d:L,x,c)),x=j.length):0===N&&(D++,j=[0]),h[s++]=D,N&&j[0]?j[x++]=w[A]||0:(j=[w[A]],x=1)}while((A++<f||void 0!==j[0])&&O--);g=void 0!==j[0]}h[0]||h.shift()}if(1==T)y.e=a,zr=g;else{for(s=1,D=h[0];D>=10;D/=10)s++;y.e=s+a*T-1,Pr(y,M?u+y.e+1:u,o,g)}return y}}();function Pr(t,n,e,r){var i,u,o,M,c,N,a,s,D,T=t.constructor;t:if(null!=n){if(!(s=t.d))return t;for(i=1,M=s[0];M>=10;M/=10)i++;if((u=n-i)<0)u+=7,o=n,c=(a=s[D=0])/Lr(10,i-o-1)%10|0;else if((D=Math.ceil((u+1)/7))>=(M=s.length)){if(!r)break t;for(;M++<=D;)s.push(0);a=c=0,i=1,o=(u%=7)-7+1}else{for(a=M=s[D],i=1;M>=10;M/=10)i++;c=(o=(u%=7)-7+i)<0?0:a/Lr(10,i-o-1)%10|0}if(r=r||n<0||void 0!==s[D+1]||(o<0?a:a%Lr(10,i-o-1)),N=e<4?(c||r)&&(0==e||e==(t.s<0?3:2)):c>5||5==c&&(4==e||r||6==e&&(u>0?o>0?a/Lr(10,i-o):0:s[D-1])%10&1||e==(t.s<0?8:7)),n<1||!s[0])return s.length=0,N?(n-=t.e+1,s[0]=Lr(10,(7-n%7)%7),t.e=-n||0):s[0]=t.e=0,t;if(0==u?(s.length=D,M=1,D--):(s.length=D+1,M=Lr(10,7-u),s[D]=o>0?(a/Lr(10,i-o)%Lr(10,o)|0)*M:0),N)for(;;){if(0==D){for(u=1,o=s[0];o>=10;o/=10)u++;for(o=s[0]+=M,M=1;o>=10;o/=10)M++;u!=M&&(t.e++,s[0]==mr&&(s[0]=1));break}if(s[D]+=M,s[D]!=mr)break;s[D--]=0,M=1}for(u=s.length;0===s[--u];)s.pop()}return dr&&(t.e>T.maxE?(t.d=null,t.e=NaN):t.e<T.minE&&(t.e=0,t.d=[0])),t}function Jr(t,n,e){if(!t.isFinite())return ii(t);var r,i=t.e,u=Zr(t.d),o=u.length;return n?(e&&(r=e-o)>0?u=u.charAt(0)+"."+u.slice(1)+_r(r):o>1&&(u=u.charAt(0)+"."+u.slice(1)),u=u+(t.e<0?"e":"e+")+t.e):i<0?(u="0."+_r(-i-1)+u,e&&(r=e-o)>0&&(u+=_r(r))):i>=o?(u+=_r(i+1-o),e&&(r=e-i-1)>0&&(u=u+"."+_r(r))):((r=i+1)<o&&(u=u.slice(0,r)+"."+u.slice(r)),e&&(r=e-o)>0&&(i+1===o&&(u+="."),u+=_r(r))),u}function Hr(t,n){var e=t[0];for(n*=7;e>=10;e/=10)n++;return n}function Kr(t,n,e){if(n>Rr)throw dr=!0,e&&(t.precision=e),Error("[DecimalError] Precision limit exceeded");return Pr(new t(fr),n,1,!0)}function Xr(t,n,e){if(n>Fr)throw Error("[DecimalError] Precision limit exceeded");return Pr(new t(pr),n,e,!0)}function qr(t){var n=t.length-1,e=7*n+1;if(n=t[n]){for(;n%10==0;n/=10)e--;for(n=t[0];n>=10;n/=10)e++}return e}function _r(t){for(var n="";t--;)n+="0";return n}function $r(t,n,e,r){var i,u=new t(1),o=Math.ceil(r/7+4);for(dr=!1;;){if(e%2&&si((u=u.times(n)).d,o)&&(i=!0),0===(e=wr(e/2))){e=u.d.length-1,i&&0===u.d[e]&&++u.d[e];break}si((n=n.times(n)).d,o)}return dr=!0,u}function ti(t){return 1&t.d[t.d.length-1]}function ni(t,n,e){for(var r,i=new t(n[0]),u=0;++u<n.length;){if(!(r=new t(n[u])).s){i=r;break}i[e](r)&&(i=r)}return i}function ei(t,n){var e,r,i,u,o,M,c,N=0,a=0,s=0,D=t.constructor,T=D.rounding,g=D.precision;if(!t.d||!t.d[0]||t.e>17)return new D(t.d?t.d[0]?t.s<0?0:1/0:1:t.s?t.s<0?0:t:NaN);for(null==n?(dr=!1,c=g):c=n,M=new D(.03125);t.e>-2;)t=t.times(M),s+=5;for(c+=r=Math.log(Lr(2,s))/Math.LN10*2+5|0,e=u=o=new D(1),D.precision=c;;){if(u=Pr(u.times(t),c,1),e=e.times(++a),Zr((M=o.plus(Gr(u,e,c,1))).d).slice(0,c)===Zr(o.d).slice(0,c)){for(i=s;i--;)o=Pr(o.times(o),c,1);if(null!=n)return D.precision=g,o;if(!(N<3&&Vr(o.d,c-r,T,N)))return Pr(o,D.precision=g,T,dr=!0);D.precision=c+=10,e=u=M=new D(1),a=0,N++}o=M}}function ri(t,n){var e,r,i,u,o,M,c,N,a,s,D,T=1,g=t,l=g.d,I=g.constructor,y=I.rounding,h=I.precision;if(g.s<0||!l||!l[0]||!g.e&&1==l[0]&&1==l.length)return new I(l&&!l[0]?-1/0:1!=g.s?NaN:l?0:g);if(null==n?(dr=!1,a=h):a=n,I.precision=a+=10,r=(e=Zr(l)).charAt(0),!(Math.abs(u=g.e)<15e14))return N=Kr(I,a+2,h).times(u+""),g=ri(new I(r+"."+e.slice(1)),a-10).plus(N),I.precision=h,null==n?Pr(g,h,y,dr=!0):g;for(;r<7&&1!=r||1==r&&e.charAt(1)>3;)r=(e=Zr((g=g.times(t)).d)).charAt(0),T++;for(u=g.e,r>1?(g=new I("0."+e),u++):g=new I(r+"."+e.slice(1)),s=g,c=o=g=Gr(g.minus(1),g.plus(1),a,1),D=Pr(g.times(g),a,1),i=3;;){if(o=Pr(o.times(D),a,1),Zr((N=c.plus(Gr(o,new I(i),a,1))).d).slice(0,a)===Zr(c.d).slice(0,a)){if(c=c.times(2),0!==u&&(c=c.plus(Kr(I,a+2,h).times(u+""))),c=Gr(c,new I(T),a,1),null!=n)return I.precision=h,c;if(!Vr(c.d,a-10,y,M))return Pr(c,I.precision=h,y,dr=!0);I.precision=a+=10,N=o=g=Gr(s.minus(1),s.plus(1),a,1),D=Pr(g.times(g),a,1),i=M=1}c=N,i+=2}}function ii(t){return String(t.s*t.s/0)}function ui(t,n){var e,r,i;for((e=n.indexOf("."))>-1&&(n=n.replace(".","")),(r=n.search(/e/i))>0?(e<0&&(e=r),e+=+n.slice(r+1),n=n.substring(0,r)):e<0&&(e=n.length),r=0;48===n.charCodeAt(r);r++);for(i=n.length;48===n.charCodeAt(i-1);--i);if(n=n.slice(r,i)){if(i-=r,t.e=e=e-r-1,t.d=[],r=(e+1)%7,e<0&&(r+=7),r<i){for(r&&t.d.push(+n.slice(0,r)),i-=7;r<i;)t.d.push(+n.slice(r,r+=7));r=7-(n=n.slice(r)).length}else r-=i;for(;r--;)n+="0";t.d.push(+n),dr&&(t.e>t.constructor.maxE?(t.d=null,t.e=NaN):t.e<t.constructor.minE&&(t.e=0,t.d=[0]))}else t.e=0,t.d=[0];return t}function oi(t,n){var e,r,i,u,o,M,c,N,a;if(n.indexOf("_")>-1){if(n=n.replace(/(\d)_(?=\d)/g,"$1"),Yr.test(n))return ui(t,n)}else if("Infinity"===n||"NaN"===n)return+n||(t.s=NaN),t.e=NaN,t.d=null,t;if(kr.test(n))e=16,n=n.toLowerCase();else if(Sr.test(n))e=2;else{if(!vr.test(n))throw Error(Cr+n);e=8}for((u=n.search(/p/i))>0?(c=+n.slice(u+1),n=n.substring(2,u)):n=n.slice(2),o=(u=n.indexOf("."))>=0,r=t.constructor,o&&(u=(M=(n=n.replace(".","")).length)-u,i=$r(r,new r(e),u,2*u)),u=a=(N=Wr(n,e,mr)).length-1;0===N[u];--u)N.pop();return u<0?new r(0*t.s):(t.e=Hr(N,a),t.d=N,dr=!1,o&&(t=Gr(t,i,4*M)),c&&(t=t.times(Math.abs(c)<54?Lr(2,c):_i.pow(2,c))),dr=!0,t)}function Mi(t,n,e,r,i){var u,o,M,c,N=t.precision,a=Math.ceil(N/7);for(dr=!1,c=e.times(e),M=new t(r);;){if(o=Gr(M.times(c),new t(n++*n++),N,1),M=i?r.plus(o):r.minus(o),r=Gr(o.times(c),new t(n++*n++),N,1),void 0!==(o=M.plus(r)).d[a]){for(u=a;o.d[u]===M.d[u]&&u--;);if(-1==u)break}u=M,M=r,r=o,o=u}return dr=!0,o.d.length=a+1,o}function ci(t,n){for(var e=t;--n;)e*=t;return e}function Ni(t,n){var e,r=n.s<0,i=Xr(t,t.precision,1),u=i.times(.5);if((n=n.abs()).lte(u))return Or=r?4:1,n;if((e=n.divToInt(i)).isZero())Or=r?3:2;else{if((n=n.minus(e.times(i))).lte(u))return Or=ti(e)?r?2:3:r?4:1,n;Or=ti(e)?r?1:4:r?3:2}return n.minus(i).abs()}function ai(t,n,e,r){var i,u,o,M,c,N,a,s,D,T=t.constructor,g=void 0!==e;if(g?(Br(e,1,1e9),void 0===r?r=T.rounding:Br(r,0,8)):(e=T.precision,r=T.rounding),t.isFinite()){for(g?(i=2,16==n?e=4*e-3:8==n&&(e=3*e-2)):i=n,(o=(a=Jr(t)).indexOf("."))>=0&&(a=a.replace(".",""),(D=new T(1)).e=a.length-o,D.d=Wr(Jr(D),10,i),D.e=D.d.length),u=c=(s=Wr(a,10,i)).length;0==s[--c];)s.pop();if(s[0]){if(o<0?u--:((t=new T(t)).d=s,t.e=u,s=(t=Gr(t,D,e,r,0,i)).d,u=t.e,N=zr),o=s[e],M=i/2,N=N||void 0!==s[e+1],N=r<4?(void 0!==o||N)&&(0===r||r===(t.s<0?3:2)):o>M||o===M&&(4===r||N||6===r&&1&s[e-1]||r===(t.s<0?8:7)),s.length=e,N)for(;++s[--e]>i-1;)s[e]=0,e||(++u,s.unshift(1));for(c=s.length;!s[c-1];--c);for(o=0,a="";o<c;o++)a+=Ar.charAt(s[o]);if(g){if(c>1)if(16==n||8==n){for(o=16==n?4:3,--c;c%o;c++)a+="0";for(c=(s=Wr(a,i,n)).length;!s[c-1];--c);for(o=1,a="1.";o<c;o++)a+=Ar.charAt(s[o])}else a=a.charAt(0)+"."+a.slice(1);a=a+(u<0?"p":"p+")+u}else if(u<0){for(;++u;)a="0"+a;a="0."+a}else if(++u>c)for(u-=c;u--;)a+="0";else u<c&&(a=a.slice(0,u)+"."+a.slice(u))}else a=g?"0p+0":"0";a=(16==n?"0x":2==n?"0b":8==n?"0o":"")+a}else a=ii(t);return t.s<0?"-"+a:a}function si(t,n){if(t.length>n)return t.length=n,!0}function Di(t){return new this(t).abs()}function Ti(t){return new this(t).acos()}function gi(t){return new this(t).acosh()}function li(t,n){return new this(t).plus(n)}function Ii(t){return new this(t).asin()}function yi(t){return new this(t).asinh()}function hi(t){return new this(t).atan()}function ji(t){return new this(t).atanh()}function xi(t,n){t=new this(t),n=new this(n);var e,r=this.precision,i=this.rounding,u=r+4;return t.s&&n.s?t.d||n.d?!n.d||t.isZero()?(e=n.s<0?Xr(this,r,i):new this(0)).s=t.s:!t.d||n.isZero()?(e=Xr(this,u,1).times(.5)).s=t.s:n.s<0?(this.precision=u,this.rounding=1,e=this.atan(Gr(t,n,u,1)),n=Xr(this,u,1),this.precision=r,this.rounding=i,e=t.s<0?e.minus(n):e.plus(n)):e=this.atan(Gr(t,n,u,1)):(e=Xr(this,u,1).times(n.s>0?.25:.75)).s=t.s:e=new this(NaN),e}function zi(t){return new this(t).cbrt()}function Oi(t){return Pr(t=new this(t),t.e+1,2)}function Ei(t,n,e){return new this(t).clamp(n,e)}function Ai(t){if(!t||"object"!=typeof t)throw Error("[DecimalError] Object expected");var n,e,r,i=!0===t.defaults,u=["precision",1,1e9,"rounding",0,8,"toExpNeg",-Er,0,"toExpPos",0,Er,"maxE",0,Er,"minE",-Er,0,"modulo",0,9];for(n=0;n<u.length;n+=3)if(e=u[n],i&&(this[e]=Ur[e]),void 0!==(r=t[e])){if(!(wr(r)===r&&r>=u[n+1]&&r<=u[n+2]))throw Error(Cr+e+": "+r);this[e]=r}if(e="crypto",i&&(this[e]=Ur[e]),void 0!==(r=t[e])){if(!0!==r&&!1!==r&&0!==r&&1!==r)throw Error(Cr+e+": "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error("[DecimalError] crypto unavailable");this[e]=!0}else this[e]=!1}return this}function fi(t){return new this(t).cos()}function pi(t){return new this(t).cosh()}function Ui(t,n){return new this(t).div(n)}function di(t){return new this(t).exp()}function Ci(t){return Pr(t=new this(t),t.e+1,3)}function Qi(){var t,n,e=new this(0);for(dr=!1,t=0;t<arguments.length;)if((n=new this(arguments[t++])).d)e.d&&(e=e.plus(n.times(n)));else{if(n.s)return dr=!0,new this(1/0);e=n}return dr=!0,e.sqrt()}function wi(t){return t instanceof _i||t&&t.toStringTag===Qr||!1}function Li(t){return new this(t).ln()}function Si(t,n){return new this(t).log(n)}function ki(t){return new this(t).log(2)}function vi(t){return new this(t).log(10)}function Yi(){return ni(this,arguments,"lt")}function mi(){return ni(this,arguments,"gt")}function Ri(t,n){return new this(t).mod(n)}function Fi(t,n){return new this(t).mul(n)}function bi(t,n){return new this(t).pow(n)}function Zi(t){var n,e,r,i,u=0,o=new this(1),M=[];if(void 0===t?t=this.precision:Br(t,1,1e9),r=Math.ceil(t/7),this.crypto)if(crypto.getRandomValues)for(n=crypto.getRandomValues(new Uint32Array(r));u<r;)(i=n[u])>=429e7?n[u]=crypto.getRandomValues(new Uint32Array(1))[0]:M[u++]=i%1e7;else{if(!crypto.randomBytes)throw Error("[DecimalError] crypto unavailable");for(n=crypto.randomBytes(r*=4);u<r;)(i=n[u]+(n[u+1]<<8)+(n[u+2]<<16)+((127&n[u+3])<<24))>=214e7?crypto.randomBytes(4).copy(n,u):(M.push(i%1e7),u+=4);u=r/4}else for(;u<r;)M[u++]=1e7*Math.random()|0;for(t%=7,(r=M[--u])&&t&&(i=Lr(10,7-t),M[u]=(r/i|0)*i);0===M[u];u--)M.pop();if(u<0)e=0,M=[0];else{for(e=-1;0===M[0];e-=7)M.shift();for(r=1,i=M[0];i>=10;i/=10)r++;r<7&&(e-=7-r)}return o.e=e,o.d=M,o}function Bi(t){return Pr(t=new this(t),t.e+1,this.rounding)}function Vi(t){return(t=new this(t)).d?t.d[0]?t.s:0*t.s:t.s||NaN}function Wi(t){return new this(t).sin()}function Gi(t){return new this(t).sinh()}function Pi(t){return new this(t).sqrt()}function Ji(t,n){return new this(t).sub(n)}function Hi(){var t=0,n=arguments,e=new this(n[t]);for(dr=!1;e.s&&++t<n.length;)e=e.plus(n[t]);return dr=!0,Pr(e,this.precision,this.rounding)}function Ki(t){return new this(t).tan()}function Xi(t){return new this(t).tanh()}function qi(t){return Pr(t=new this(t),t.e+1,1)}br[Symbol.for("nodejs.util.inspect.custom")]=br.toString,br[Symbol.toStringTag]="Decimal";var _i=br.constructor=function t(n){var e,r,i;function u(t){var n,e,r,i=this;if(!(i instanceof u))return new u(t);if(i.constructor=u,wi(t))return i.s=t.s,void(dr?!t.d||t.e>u.maxE?(i.e=NaN,i.d=null):t.e<u.minE?(i.e=0,i.d=[0]):(i.e=t.e,i.d=t.d.slice()):(i.e=t.e,i.d=t.d?t.d.slice():t.d));if("number"===(r=typeof t)){if(0===t)return i.s=1/t<0?-1:1,i.e=0,void(i.d=[0]);if(t<0?(t=-t,i.s=-1):i.s=1,t===~~t&&t<1e7){for(n=0,e=t;e>=10;e/=10)n++;return void(dr?n>u.maxE?(i.e=NaN,i.d=null):n<u.minE?(i.e=0,i.d=[0]):(i.e=n,i.d=[t]):(i.e=n,i.d=[t]))}return 0*t!=0?(t||(i.s=NaN),i.e=NaN,void(i.d=null)):ui(i,t.toString())}if("string"!==r)throw Error(Cr+t);return 45===(e=t.charCodeAt(0))?(t=t.slice(1),i.s=-1):(43===e&&(t=t.slice(1)),i.s=1),Yr.test(t)?ui(i,t):oi(i,t)}if(u.prototype=br,u.ROUND_UP=0,u.ROUND_DOWN=1,u.ROUND_CEIL=2,u.ROUND_FLOOR=3,u.ROUND_HALF_UP=4,u.ROUND_HALF_DOWN=5,u.ROUND_HALF_EVEN=6,u.ROUND_HALF_CEIL=7,u.ROUND_HALF_FLOOR=8,u.EUCLID=9,u.config=u.set=Ai,u.clone=t,u.isDecimal=wi,u.abs=Di,u.acos=Ti,u.acosh=gi,u.add=li,u.asin=Ii,u.asinh=yi,u.atan=hi,u.atanh=ji,u.atan2=xi,u.cbrt=zi,u.ceil=Oi,u.clamp=Ei,u.cos=fi,u.cosh=pi,u.div=Ui,u.exp=di,u.floor=Ci,u.hypot=Qi,u.ln=Li,u.log=Si,u.log10=vi,u.log2=ki,u.max=Yi,u.min=mi,u.mod=Ri,u.mul=Fi,u.pow=bi,u.random=Zi,u.round=Bi,u.sign=Vi,u.sin=Wi,u.sinh=Gi,u.sqrt=Pi,u.sub=Ji,u.sum=Hi,u.tan=Ki,u.tanh=Xi,u.trunc=qi,void 0===n&&(n={}),n&&!0!==n.defaults)for(i=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],e=0;e<i.length;)n.hasOwnProperty(r=i[e++])||(n[r]=this[r]);return u.config(n),u}(Ur);fr=new _i(fr),pr=new _i(pr);var $i=_i;function tu(t){return"boolean"==typeof t||!!isFinite(t)&&t===Math.round(t)}var nu=Math.sign||function(t){return t>0?1:t<0?-1:0},eu=Math.log2||function(t){return Math.log(t)/Math.LN2},ru=Math.log10||function(t){return Math.log(t)/Math.LN10},iu=(Math.log1p,Math.cbrt||function(t){if(0===t)return t;var n,e=t<0;return e&&(t=-t),n=isFinite(t)?(t/((n=Math.exp(Math.log(t)/3))*n)+2*n)/3:t,e?-n:n}),uu=Math.expm1||function(t){return t>=2e-4||t<=-2e-4?Math.exp(t)-1:t+t*t/2+t*t*t/6};function ou(t,n,e){var r={2:"0b",8:"0o",16:"0x"}[n],i="";if(e){if(e<1)throw new Error("size must be in greater than 0");if(!tu(e))throw new Error("size must be an integer");if(t>2**(e-1)-1||t<-(2**(e-1)))throw new Error("Value must be in range [-2^".concat(e-1,", 2^").concat(e-1,"-1]"));if(!tu(t))throw new Error("Value must be an integer");t<0&&(t+=2**e),i="i".concat(e)}var u="";return t<0&&(t=-t,u="-"),"".concat(u).concat(r).concat(t.toString(n)).concat(i)}function Mu(t,n){if("function"==typeof n)return n(t);if(t===1/0)return"Infinity";if(t===-1/0)return"-Infinity";if(isNaN(t))return"NaN";var{notation:e,precision:r,wordSize:i}=cu(n);switch(e){case"fixed":return au(t,r);case"exponential":return su(t,r);case"engineering":return function(t,n){if(isNaN(t)||!isFinite(t))return String(t);var e=Du(Nu(t),n),r=e.exponent,i=e.coefficients,u=r%3==0?r:r<0?r-3-r%3:r-r%3;if(de(n))for(;n>i.length||r-u+1>i.length;)i.push(0);else for(var o=Math.abs(r-u)-(i.length-1),M=0;M<o;M++)i.push(0);var c=Math.abs(r-u),N=1;for(;c>0;)N++,c--;var a=i.slice(N).join(""),s=de(n)&&a.length||a.match(/[1-9]/)?"."+a:"",D=i.slice(0,N).join("")+s+"e"+(r>=0?"+":"")+u.toString();return e.sign+D}(t,r);case"bin":return ou(t,2,i);case"oct":return ou(t,8,i);case"hex":return ou(t,16,i);case"auto":return function(t,n,e){if(isNaN(t)||!isFinite(t))return String(t);var r=zu(null==e?void 0:e.lowerExp,-3),i=zu(null==e?void 0:e.upperExp,5),u=Nu(t),o=n?Du(u,n):u;if(o.exponent<r||o.exponent>=i)return su(t,n);var M=o.coefficients,c=o.exponent;M.length<n&&(M=M.concat(Tu(n-M.length))),M=M.concat(Tu(c-M.length+1+(M.length<n?n-M.length:0))),M=Tu(-c).concat(M);var N=c>0?c:0;return N<M.length-1&&M.splice(N+1,0,"."),o.sign+M.join("")}(t,r,n).replace(/((\.\d*?)(0+))($|e)/,(function(){var t=arguments[2],n=arguments[4];return"."!==t?t+n:n}));default:throw new Error('Unknown notation "'+e+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function cu(t){var n,e,r="auto";if(void 0!==t)if(de(t))n=t;else if(Ce(t))n=t.toNumber();else{if(!Je(t))throw new Error("Unsupported type of options, number, BigNumber, or object expected");void 0!==t.precision&&(n=xu(t.precision,()=>{throw new Error('Option "precision" must be a number or BigNumber')})),void 0!==t.wordSize&&(e=xu(t.wordSize,()=>{throw new Error('Option "wordSize" must be a number or BigNumber')})),t.notation&&(r=t.notation)}return{notation:r,precision:n,wordSize:e}}function Nu(t){var n=String(t).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!n)throw new SyntaxError("Invalid number "+t);var e=n[1],r=n[2],i=parseFloat(n[4]||"0"),u=r.indexOf(".");i+=-1!==u?u-1:r.length-1;var o=r.replace(".","").replace(/^0*/,(function(t){return i-=t.length,""})).replace(/0*$/,"").split("").map((function(t){return parseInt(t)}));return 0===o.length&&(o.push(0),i++),{sign:e,coefficients:o,exponent:i}}function au(t,n){if(isNaN(t)||!isFinite(t))return String(t);var e=Nu(t),r="number"==typeof n?Du(e,e.exponent+1+n):e,i=r.coefficients,u=r.exponent+1,o=u+(n||0);return i.length<o&&(i=i.concat(Tu(o-i.length))),u<0&&(i=Tu(1-u).concat(i),u=1),u<i.length&&i.splice(u,0,0===u?"0.":"."),r.sign+i.join("")}function su(t,n){if(isNaN(t)||!isFinite(t))return String(t);var e=Nu(t),r=n?Du(e,n):e,i=r.coefficients,u=r.exponent;i.length<n&&(i=i.concat(Tu(n-i.length)));var o=i.shift();return r.sign+o+(i.length>0?"."+i.join(""):"")+"e"+(u>=0?"+":"")+u}function Du(t,n){for(var e={sign:t.sign,coefficients:t.coefficients,exponent:t.exponent},r=e.coefficients;n<=0;)r.unshift(0),e.exponent++,n++;if(r.length>n&&r.splice(n,r.length-n)[0]>=5){var i=n-1;for(r[i]++;10===r[i];)r.pop(),0===i&&(r.unshift(0),e.exponent++,i++),r[--i]++}return e}function Tu(t){for(var n=[],e=0;e<t;e++)n.push(0);return n}var gu=Number.EPSILON||2220446049250313e-31;function lu(t,n,e){if(null==e)return t===n;if(t===n)return!0;if(isNaN(t)||isNaN(n))return!1;if(isFinite(t)&&isFinite(n)){var r=Math.abs(t-n);return r<=gu||r<=Math.max(Math.abs(t),Math.abs(n))*e}return!1}var Iu=Math.acosh||function(t){return Math.log(Math.sqrt(t*t-1)+t)},yu=Math.asinh||function(t){return Math.log(Math.sqrt(t*t+1)+t)},hu=Math.atanh||function(t){return Math.log((1+t)/(1-t))/2},ju=(Math.cosh,Math.sinh||function(t){return(Math.exp(t)-Math.exp(-t))/2});Math.tanh;function xu(t,n){return de(t)?t:Ce(t)?t.toNumber():void n()}function zu(t,n){return de(t)?t:Ce(t)?t.toNumber():n}function Ou(t,n,e){var r=new(0,t.constructor)(2),i="";if(e){if(e<1)throw new Error("size must be in greater than 0");if(!tu(e))throw new Error("size must be an integer");if(t.greaterThan(r.pow(e-1).sub(1))||t.lessThan(r.pow(e-1).mul(-1)))throw new Error("Value must be in range [-2^".concat(e-1,", 2^").concat(e-1,"-1]"));if(!t.isInteger())throw new Error("Value must be an integer");t.lessThan(0)&&(t=t.add(r.pow(e))),i="i".concat(e)}switch(n){case 2:return"".concat(t.toBinary()).concat(i);case 8:return"".concat(t.toOctal()).concat(i);case 16:return"".concat(t.toHexadecimal()).concat(i);default:throw new Error("Base ".concat(n," not supported "))}}function Eu(t,n){if("function"==typeof n)return n(t);if(!t.isFinite())return t.isNaN()?"NaN":t.gt(0)?"Infinity":"-Infinity";var{notation:e,precision:r,wordSize:i}=cu(n);switch(e){case"fixed":return function(t,n){return t.toFixed(n)}(t,r);case"exponential":return Au(t,r);case"engineering":return function(t,n){var e=t.e,r=e%3==0?e:e<0?e-3-e%3:e-e%3,i=t.mul(Math.pow(10,-r)).toPrecision(n);if(-1!==i.indexOf("e")){var u=t.constructor;i=new u(i).toFixed()}return i+"e"+(e>=0?"+":"")+r.toString()}(t,r);case"bin":return Ou(t,2,i);case"oct":return Ou(t,8,i);case"hex":return Ou(t,16,i);case"auto":var u=fu(null==n?void 0:n.lowerExp,-3),o=fu(null==n?void 0:n.upperExp,5);if(t.isZero())return"0";var M=t.toSignificantDigits(r),c=M.e;return(c>=u&&c<o?M.toFixed():Au(t,r)).replace(/((\.\d*?)(0+))($|e)/,(function(){var t=arguments[2],n=arguments[4];return"."!==t?t+n:n}));default:throw new Error('Unknown notation "'+e+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function Au(t,n){return void 0!==n?t.toExponential(n-1):t.toExponential()}function fu(t,n){return de(t)?t:Ce(t)?t.toNumber():n}function pu(t,n){var e=function(t,n){if("number"==typeof t)return Mu(t,n);if(Ce(t))return Eu(t,n);if(function(t){return t&&"object"==typeof t&&"number"==typeof t.s&&"number"==typeof t.n&&"number"==typeof t.d||!1}(t))return n&&"decimal"===n.fraction?t.toString():t.s*t.n+"/"+t.d;if(Array.isArray(t))return function t(n,e){if(Array.isArray(n)){for(var r="[",i=n.length,u=0;u<i;u++)0!==u&&(r+=", "),r+=t(n[u],e);return r+="]"}return pu(n,e)}(t,n);if(Se(t))return Uu(t);if("function"==typeof t)return t.syntax?String(t.syntax):"function";if(t&&"object"==typeof t){return"function"==typeof t.format?t.format(n):t&&t.toString(n)!=={}.toString()?t.toString(n):"{"+Object.keys(t).map(e=>Uu(e)+": "+pu(t[e],n)).join(", ")+"}"}return String(t)}(t,n);return n&&"object"==typeof n&&"truncate"in n&&e.length>n.truncate?e.substring(0,n.truncate-3)+"...":e}function Uu(t){for(var n=String(t),e="",r=0;r<n.length;){var i=n.charAt(r);e+=i in du?du[i]:i,r++}return'"'+e+'"'}var du={'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"};function Cu(t,n){if(!Se(t))throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: "+Tr(t)+", index: 0)");if(!Se(n))throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: "+Tr(n)+", index: 1)");return t===n?0:t>n?1:-1}function Qu(t,n,e){if(!(this instanceof Qu))throw new SyntaxError("Constructor must be called with the new operator");this.actual=t,this.expected=n,this.relation=e,this.message="Dimension mismatch ("+(Array.isArray(t)?"["+t.join(", ")+"]":t)+" "+(this.relation||"!=")+" "+(Array.isArray(n)?"["+n.join(", ")+"]":n)+")",this.stack=(new Error).stack}function wu(t,n,e){if(!(this instanceof wu))throw new SyntaxError("Constructor must be called with the new operator");this.index=t,arguments.length<3?(this.min=0,this.max=n):(this.min=n,this.max=e),void 0!==this.min&&this.index<this.min?this.message="Index out of range ("+this.index+" < "+this.min+")":void 0!==this.max&&this.index>=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=(new Error).stack}function Lu(t){for(var n=[];Array.isArray(t);)n.push(t.length),t=t[0];return n}function Su(t,n){if(0===n.length){if(Array.isArray(t))throw new Qu(t.length,0)}else!function t(n,e,r){var i,u=n.length;if(u!==e[r])throw new Qu(u,e[r]);if(r<e.length-1){var o=r+1;for(i=0;i<u;i++){var M=n[i];if(!Array.isArray(M))throw new Qu(e.length-1,e.length,"<");t(n[i],e,o)}}else for(i=0;i<u;i++)if(Array.isArray(n[i]))throw new Qu(e.length+1,e.length,">")}(t,n,0)}function ku(t,n){if(void 0!==t){if(!de(t)||!tu(t))throw new TypeError("Index must be an integer (value: "+t+")");if(t<0||"number"==typeof n&&t>=n)throw new wu(t,n)}}function vu(t,n,e){if(!Array.isArray(n))throw new TypeError("Array expected");if(0===n.length)throw new Error("Resizing to scalar is not supported");return n.forEach((function(t){if(!de(t)||!tu(t)||t<0)throw new TypeError("Invalid size, must contain positive integers (size: "+pu(n)+")")})),(de(t)||Ce(t))&&(t=[t]),function t(n,e,r,i){var u,o,M=n.length,c=e[r],N=Math.min(M,c);if(n.length=c,r<e.length-1){var a=r+1;for(u=0;u<N;u++)o=n[u],Array.isArray(o)||(o=[o],n[u]=o),t(o,e,a,i);for(u=N;u<c;u++)o=[],n[u]=o,t(o,e,a,i)}else{for(u=0;u<N;u++)for(;Array.isArray(n[u]);)n[u]=n[u][0];for(u=N;u<c;u++)n[u]=i}}(t,n,0,void 0!==e?e:0),t}function Yu(t,n){var e=bu(t),r=e.length;if(!Array.isArray(t)||!Array.isArray(n))throw new TypeError("Array expected");if(0===n.length)throw new Qu(0,r,"!=");var i=Ru(n=mu(n,r));if(r!==i)throw new Qu(i,r,"!=");try{return function(t,n){for(var e,r=t,i=n.length-1;i>0;i--){var u=n[i];e=[];for(var o=r.length/u,M=0;M<o;M++)e.push(r.slice(M*u,(M+1)*u));r=e}return r}(e,n)}catch(t){if(t instanceof Qu)throw new Qu(i,r,"!=");throw t}}function mu(t,n){var e=Ru(t),r=t.slice(),i=t.indexOf(-1);if(t.indexOf(-1,i+1)>=0)throw new Error("More than one wildcard in sizes");if(i>=0){if(!(n%e==0))throw new Error("Could not replace wildcard, since "+n+" is no multiple of "+-e);r[i]=-n/e}return r}function Ru(t){return t.reduce((t,n)=>t*n,1)}function Fu(t,n,e,r){var i=r||Lu(t);if(e)for(var u=0;u<e;u++)t=[t],i.unshift(1);for(t=function t(n,e,r){var i,u;if(Array.isArray(n)){var o=r+1;for(i=0,u=n.length;i<u;i++)n[i]=t(n[i],e,o)}else for(var M=r;M<e;M++)n=[n];return n}(t,n,0);i.length<n;)i.push(1);return t}function bu(t){if(!Array.isArray(t))return t;var n=[];return t.forEach((function t(e){Array.isArray(e)?e.forEach(t):n.push(e)})),n}function Zu(t,n){for(var e,r=0,i=0;i<t.length;i++){var u=t[i],o=Array.isArray(u);if(0===i&&o&&(r=u.length),o&&u.length!==r)return;var M=o?Zu(u,n):n(u);if(void 0===e)e=M;else if(e!==M)return"mixed"}return e}function Bu(t,n,e,r){if(r<e){if(t.length!==n.length)throw new Qu(t.length,n.length);for(var i=[],u=0;u<t.length;u++)i[u]=Bu(t[u],n[u],e,r+1);return i}return t.concat(n)}function Vu(){var t=Array.prototype.slice.call(arguments,0,-1),n=Array.prototype.slice.call(arguments,-1);if(1===t.length)return t[0];if(t.length>1)return t.slice(1).reduce((function(t,e){return Bu(t,e,n,0)}),t[0]);throw new Error("Wrong number of arguments in function concat")}function Wu(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++)n[e]=arguments[e];for(var r=n.map(t=>t.length),i=Math.max(...r),u=new Array(i).fill(null),o=0;o<n.length;o++)for(var M=n[o],c=r[o],N=0;N<c;N++){var a=i-c+N;M[N]>u[a]&&(u[a]=M[N])}for(var s=0;s<n.length;s++)Gu(n[s],u);return u}function Gu(t,n){for(var e=n.length,r=t.length,i=0;i<r;i++){var u=e-r+i;if(t[i]<n[u]&&t[i]>1||t[i]>n[u])throw new Error("shape missmatch: missmatch is found in arg with shape (".concat(t,") not possible to broadcast dimension ").concat(r," with size ").concat(t[i]," to size ").concat(n[u]))}}function Pu(t,n){var e=Lu(t);if(Ir(e,n))return t;Gu(e,n);var r,i,u,o=Wu(e,n),M=o.length,c=[...Array(M-e.length).fill(1),...e],N=function(t){return pe()([],t)}(t);e.length<M&&(e=Lu(N=Yu(N,c)));for(var a=0;a<M;a++)e[a]<o[a]&&(r=N,i=o[a],u=a,e=Lu(N=Vu(...Array(i).fill(r),u)));return N}function Ju(t,n,e,r){function i(r){var i=function(t,n){for(var e={},r=0;r<n.length;r++){var i=n[r],u=t[i];void 0!==u&&(e[i]=u)}return e}(r,n.map(Hu));return function(t,n,e){if(!n.filter(t=>!function(t){return t&&"?"===t[0]}(t)).every(t=>void 0!==e[t])){var r=n.filter(t=>void 0===e[t]);throw new Error('Cannot create function "'.concat(t,'", ')+"some dependencies are missing: ".concat(r.map(t=>'"'.concat(t,'"')).join(", "),"."))}}(t,n,r),e(i)}return i.isFactory=!0,i.fn=t,i.dependencies=n.slice().sort(),r&&(i.meta=r),i}function Hu(t){return t&&"?"===t[0]?t.slice(1):t}Qu.prototype=new RangeError,Qu.prototype.constructor=RangeError,Qu.prototype.name="DimensionError",Qu.prototype.isDimensionError=!0,wu.prototype=new RangeError,wu.prototype.constructor=RangeError,wu.prototype.name="IndexError",wu.prototype.isIndexError=!0;var Ku=Ju("BigNumber",["?on","config"],t=>{var{on:n,config:e}=t,r=$i.clone({precision:e.precision,modulo:$i.EUCLID});return r.prototype=Object.create(r.prototype),r.prototype.type="BigNumber",r.prototype.isBigNumber=!0,r.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},r.fromJSON=function(t){return new r(t.value)},n&&n("config",(function(t,n){t.precision!==n.precision&&r.config({precision:t.precision})})),r},{isClass:!0}),Xu=e(10),qu=e.n(Xu),_u=Ju("Complex",[],()=>(Object.defineProperty(qu.a,"name",{value:"Complex"}),qu.a.prototype.constructor=qu.a,qu.a.prototype.type="Complex",qu.a.prototype.isComplex=!0,qu.a.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},qu.a.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},qu.a.prototype.format=function(t){var n=this.im,e=this.re,r=Mu(this.re,t),i=Mu(this.im,t),u=de(t)?t:t?t.precision:null;if(null!==u){var o=Math.pow(10,-u);Math.abs(e/n)<o&&(e=0),Math.abs(n/e)<o&&(n=0)}return 0===n?r:0===e?1===n?"i":-1===n?"-i":i+"i":n<0?-1===n?r+" - i":r+" - "+i.substring(1)+"i":1===n?r+" + i":r+" + "+i+"i"},qu.a.fromPolar=function(t){switch(arguments.length){case 1:var n=arguments[0];if("object"==typeof n)return qu()(n);throw new TypeError("Input has to be an object with r and phi keys.");case 2:var e=arguments[0],r=arguments[1];if(de(e)){if(Le(r)&&r.hasBase("ANGLE")&&(r=r.toNumber("rad")),de(r))return new qu.a({r:e,phi:r});throw new TypeError("Phi is not a number nor an angle unit.")}throw new TypeError("Radius r is not a number.");default:throw new SyntaxError("Wrong number of arguments in function fromPolar")}},qu.a.prototype.valueOf=qu.a.prototype.toString,qu.a.fromJSON=function(t){return new qu.a(t)},qu.a.compare=function(t,n){return t.re>n.re?1:t.re<n.re?-1:t.im>n.im?1:t.im<n.im?-1:0},qu.a),{isClass:!0});function $u(t){var n=0,e=1,r=Object.create(null),i=Object.create(null),u=0,o=function(t){var o=i[t];if(o&&(delete r[o],delete i[t],--n,e===o)){if(!n)return u=0,void(e=1);for(;!Object.prototype.hasOwnProperty.call(r,++e););}};return t=Math.abs(t),{hit:function(M){var c=i[M],N=++u;if(r[N]=M,i[M]=N,!c){if(++n<=t)return;return M=r[e],o(M),M}if(delete r[c],e===c)for(;!Object.prototype.hasOwnProperty.call(r,++e););},delete:o,clear:function(){n=u=0,e=1,r=Object.create(null),i=Object.create(null)}}}function to(t){var{hasher:n,limit:e}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e=null==e?Number.POSITIVE_INFINITY:e,n=null==n?JSON.stringify:n,function r(){"object"!=typeof r.cache&&(r.cache={values:new Map,lru:$u(e||Number.POSITIVE_INFINITY)});for(var i=[],u=0;u<arguments.length;u++)i[u]=arguments[u];var o=n(i);if(r.cache.values.has(o))return r.cache.lru.hit(o),r.cache.values.get(o);var M=t.apply(t,i);return r.cache.values.set(o,M),r.cache.values.delete(r.cache.lru.hit(o)),M}}function no(t){return Object.keys(t.signatures||{}).reduce((function(t,n){var e=(n.match(/,/g)||[]).length+1;return Math.max(t,e)}),-1)}to((function(t){return new t(1).exp()}),{hasher:ro}),to((function(t){return new t(1).plus(new t(5).sqrt()).div(2)}),{hasher:ro});var eo=to((function(t){return t.acos(-1)}),{hasher:ro});to((function(t){return eo(t).times(2)}),{hasher:ro});function ro(t){return t[0].precision}Math.PI,Math.PI,Math.E;io("fineStructure",.0072973525693),io("weakMixingAngle",.2229),io("efimovFactor",22.7),io("sackurTetrode",-1.16487052358);function io(t,n){return Ju(t,["config","BigNumber"],t=>{var{config:e,BigNumber:r}=t;return"BigNumber"===e.number?new r(n):n})}var uo=e(16),oo=e.n(uo),Mo=Ju("Fraction",[],()=>(Object.defineProperty(oo.a,"name",{value:"Fraction"}),oo.a.prototype.constructor=oo.a,oo.a.prototype.type="Fraction",oo.a.prototype.isFraction=!0,oo.a.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},oo.a.fromJSON=function(t){return new oo.a(t)},oo.a),{isClass:!0}),co=Ju("Matrix",[],()=>{function t(){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator")}return t.prototype.type="Matrix",t.prototype.isMatrix=!0,t.prototype.storage=function(){throw new Error("Cannot invoke storage on a Matrix interface")},t.prototype.datatype=function(){throw new Error("Cannot invoke datatype on a Matrix interface")},t.prototype.create=function(t,n){throw new Error("Cannot invoke create on a Matrix interface")},t.prototype.subset=function(t,n,e){throw new Error("Cannot invoke subset on a Matrix interface")},t.prototype.get=function(t){throw new Error("Cannot invoke get on a Matrix interface")},t.prototype.set=function(t,n,e){throw new Error("Cannot invoke set on a Matrix interface")},t.prototype.resize=function(t,n){throw new Error("Cannot invoke resize on a Matrix interface")},t.prototype.reshape=function(t,n){throw new Error("Cannot invoke reshape on a Matrix interface")},t.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},t.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},t.prototype.map=function(t,n){throw new Error("Cannot invoke map on a Matrix interface")},t.prototype.forEach=function(t){throw new Error("Cannot invoke forEach on a Matrix interface")},t.prototype[Symbol.iterator]=function(){throw new Error("Cannot iterate a Matrix interface")},t.prototype.toArray=function(){throw new Error("Cannot invoke toArray on a Matrix interface")},t.prototype.valueOf=function(){throw new Error("Cannot invoke valueOf on a Matrix interface")},t.prototype.format=function(t){throw new Error("Cannot invoke format on a Matrix interface")},t.prototype.toString=function(){throw new Error("Cannot invoke toString on a Matrix interface")},t},{isClass:!0}),No=Ju("DenseMatrix",["Matrix"],t=>{var{Matrix:n}=t;function e(t,n){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");if(n&&!Se(n))throw new Error("Invalid datatype: "+n);if(ve(t))"DenseMatrix"===t.type?(this._data=gr(t._data),this._size=gr(t._size),this._datatype=n||t._datatype):(this._data=t.toArray(),this._size=t.size(),this._datatype=n||t._datatype);else if(t&&ke(t.data)&&ke(t.size))this._data=t.data,this._size=t.size,Su(this._data,this._size),this._datatype=n||t.datatype;else if(ke(t))this._data=M(t),this._size=Lu(this._data),Su(this._data,this._size),this._datatype=n;else{if(t)throw new TypeError("Unsupported type of data ("+Tr(t)+")");this._data=[],this._size=[0],this._datatype=n}}function r(t,n){if(!be(n))throw new TypeError("Invalid index");if(n.isScalar())return t.get(n.min());var r=n.size();if(r.length!==t._size.length)throw new Qu(r.length,t._size.length);for(var i=n.min(),u=n.max(),o=0,M=t._size.length;o<M;o++)ku(i[o],t._size[o]),ku(u[o],t._size[o]);return new e(function t(n,e,r,i){var u=i===r-1,o=e.dimension(i);return u?o.map((function(t){return ku(t,n.length),n[t]})).valueOf():o.map((function(u){ku(u,n.length);var o=n[u];return t(o,e,r,i+1)})).valueOf()}(t._data,n,r.length,0),t._datatype)}function i(t,n,e,r){if(!n||!0!==n.isIndex)throw new TypeError("Invalid index");var i,u=n.size(),M=n.isScalar();if(ve(e)?(i=e.size(),e=e.valueOf()):i=Lu(e),M){if(0!==i.length)throw new TypeError("Scalar expected");t.set(n.min(),e,r)}else{if(!Ir(i,u))try{i=Lu(e=0===i.length?Pu([e],u):Pu(e,u))}catch(t){}if(u.length<t._size.length)throw new Qu(u.length,t._size.length,"<");if(i.length<u.length){for(var c=0,N=0;1===u[c]&&1===i[c];)c++;for(;1===u[c];)N++,c++;e=Fu(e,u.length,N,i)}if(!Ir(u,i))throw new Qu(u,i,">");o(t,n.max().map((function(t){return t+1})),r);var a=u.length;!function t(n,e,r,i,u){var o=u===i-1,M=e.dimension(u);o?M.forEach((function(t,e){ku(t),n[t]=r[e[0]]})):M.forEach((function(o,M){ku(o),t(n[o],e,r[M[0]],i,u+1)}))}(t._data,n,e,a,0)}return t}function u(t,n,e){if(0===n.length){for(var r=t._data;ke(r);)r=r[0];return r}return t._size=n.slice(0),t._data=vu(t._data,t._size,e),t}function o(t,n,e){for(var r=t._size.slice(0),i=!1;r.length<n.length;)r.push(0),i=!0;for(var o=0,M=n.length;o<M;o++)n[o]>r[o]&&(r[o]=n[o],i=!0);i&&u(t,r,e)}function M(t){return ve(t)?M(t.valueOf()):ke(t)?t.map(M):t}return e.prototype=new n,e.prototype.createDenseMatrix=function(t,n){return new e(t,n)},Object.defineProperty(e,"name",{value:"DenseMatrix"}),e.prototype.constructor=e,e.prototype.type="DenseMatrix",e.prototype.isDenseMatrix=!0,e.prototype.getDataType=function(){return Zu(this._data,Tr)},e.prototype.storage=function(){return"dense"},e.prototype.datatype=function(){return this._datatype},e.prototype.create=function(t,n){return new e(t,n)},e.prototype.subset=function(t,n,e){switch(arguments.length){case 1:return r(this,t);case 2:case 3:return i(this,t,n,e);default:throw new SyntaxError("Wrong number of arguments")}},e.prototype.get=function(t){if(!ke(t))throw new TypeError("Array expected");if(t.length!==this._size.length)throw new Qu(t.length,this._size.length);for(var n=0;n<t.length;n++)ku(t[n],this._size[n]);for(var e=this._data,r=0,i=t.length;r<i;r++){var u=t[r];ku(u,e.length),e=e[u]}return e},e.prototype.set=function(t,n,e){if(!ke(t))throw new TypeError("Array expected");if(t.length<this._size.length)throw new Qu(t.length,this._size.length,"<");var r,i,u;o(this,t.map((function(t){return t+1})),e);var M=this._data;for(r=0,i=t.length-1;r<i;r++)ku(u=t[r],M.length),M=M[u];return ku(u=t[t.length-1],M.length),M[u]=n,this},e.prototype.resize=function(t,n,e){if(!Ye(t))throw new TypeError("Array or Matrix expected");var r=t.valueOf().map(t=>Array.isArray(t)&&1===t.length?t[0]:t);return u(e?this.clone():this,r,n)},e.prototype.reshape=function(t,n){var e=n?this.clone():this;e._data=Yu(e._data,t);var r=e._size.reduce((t,n)=>t*n);return e._size=mu(t,r),e},e.prototype.clone=function(){return new e({data:gr(this._data),size:gr(this._size),datatype:this._datatype})},e.prototype.size=function(){return this._size.slice(0)},e.prototype.map=function(t){var n=this,r=no(t),i=function e(i,u){return ke(i)?i.map((function(t,n){return e(t,u.concat(n))})):1===r?t(i):2===r?t(i,u):t(i,u,n)}(this._data,[]);return new e(i,void 0!==this._datatype?Zu(i,Tr):void 0)},e.prototype.forEach=function(t){var n=this;!function e(r,i){ke(r)?r.forEach((function(t,n){e(t,i.concat(n))})):t(r,i,n)}(this._data,[])},e.prototype[Symbol.iterator]=function*(){yield*function*t(n,e){if(ke(n))for(var r=0;r<n.length;r++)yield*t(n[r],e.concat(r));else yield{value:n,index:e}}(this._data,[])},e.prototype.rows=function(){var t=[];if(2!==this.size().length)throw new TypeError("Rows can only be returned for a 2D matrix.");var n=this._data;for(var r of n)t.push(new e([r],this._datatype));return t},e.prototype.columns=function(){var t=this,n=[],r=this.size();if(2!==r.length)throw new TypeError("Rows can only be returned for a 2D matrix.");for(var i=this._data,u=function(r){var u=i.map(t=>[t[r]]);n.push(new e(u,t._datatype))},o=0;o<r[1];o++)u(o);return n},e.prototype.toArray=function(){return gr(this._data)},e.prototype.valueOf=function(){return this._data},e.prototype.format=function(t){return pu(this._data,t)},e.prototype.toString=function(){return pu(this._data)},e.prototype.toJSON=function(){return{mathjs:"DenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},e.prototype.diagonal=function(t){if(t){if(Ce(t)&&(t=t.toNumber()),!de(t)||!tu(t))throw new TypeError("The parameter k must be an integer number")}else t=0;for(var n=t>0?t:0,r=t<0?-t:0,i=this._size[0],u=this._size[1],o=Math.min(i-r,u-n),M=[],c=0;c<o;c++)M[c]=this._data[c+r][c+n];return new e({data:M,size:[o],datatype:this._datatype})},e.diagonal=function(t,n,r,i){if(!ke(t))throw new TypeError("Array expected, size parameter");if(2!==t.length)throw new Error("Only two dimensions matrix are supported");if(t=t.map((function(t){if(Ce(t)&&(t=t.toNumber()),!de(t)||!tu(t)||t<1)throw new Error("Size values must be positive integers");return t})),r){if(Ce(r)&&(r=r.toNumber()),!de(r)||!tu(r))throw new TypeError("The parameter k must be an integer number")}else r=0;var u,o=r>0?r:0,M=r<0?-r:0,c=t[0],N=t[1],a=Math.min(c-M,N-o);if(ke(n)){if(n.length!==a)throw new Error("Invalid value array length");u=function(t){return n[t]}}else if(ve(n)){var s=n.size();if(1!==s.length||s[0]!==a)throw new Error("Invalid matrix length");u=function(t){return n.get([t])}}else u=function(){return n};i||(i=Ce(u(0))?u(0).mul(0):0);var D=[];if(t.length>0){D=vu(D,t,i);for(var T=0;T<a;T++)D[T+M][T+o]=u(T)}return new e({data:D,size:[c,N]})},e.fromJSON=function(t){return new e(t)},e.prototype.swapRows=function(t,n){if(!(de(t)&&tu(t)&&de(n)&&tu(n)))throw new Error("Row index must be positive integers");if(2!==this._size.length)throw new Error("Only two dimensional matrix is supported");return ku(t,this._size[0]),ku(n,this._size[0]),e._swapRows(t,n,this._data),this},e._swapRows=function(t,n,e){var r=e[t];e[t]=e[n],e[n]=r},e},{isClass:!0});function ao(){return!0}function so(){return!1}function Do(){}var To=function t(){function n(t){return"object"==typeof t&&null!==t&&t.constructor===Object}const e=[{name:"number",test:function(t){return"number"==typeof t}},{name:"string",test:function(t){return"string"==typeof t}},{name:"boolean",test:function(t){return"boolean"==typeof t}},{name:"Function",test:function(t){return"function"==typeof t}},{name:"Array",test:Array.isArray},{name:"Date",test:function(t){return t instanceof Date}},{name:"RegExp",test:function(t){return t instanceof RegExp}},{name:"Object",test:n},{name:"null",test:function(t){return null===t}},{name:"undefined",test:function(t){return void 0===t}}],r={name:"any",test:ao,isAny:!0};let i,u,o=0,M={createCount:0};function c(t){const n=i.get(t);if(n)return n;let e='Unknown type "'+t+'"';const r=t.toLowerCase();let o;for(o of u)if(o.toLowerCase()===r){e+='. Did you mean "'+o+'" ?';break}throw new TypeError(e)}function N(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"any";const e=n?c(n).index:u.length,r=[];for(let n=0;n<t.length;++n){if(!t[n]||"string"!=typeof t[n].name||"function"!=typeof t[n].test)throw new TypeError("Object with properties {name: string, test: function} expected");const u=t[n].name;if(i.has(u))throw new TypeError('Duplicate type name "'+u+'"');r.push(u),i.set(u,{name:u,test:t[n].test,isAny:t[n].isAny,index:e+n,conversionsTo:[]})}const o=u.slice(e);u=u.slice(0,e).concat(r).concat(o);for(let t=e+r.length;t<u.length;++t)i.get(u[t]).index=t}function a(){i=new Map,u=[],o=0,N([r],!1)}function s(t){const n=u.filter(n=>{const e=i.get(n);return!e.isAny&&e.test(t)});return n.length?n:["any"]}function D(t){return t&&"function"==typeof t&&"_typedFunctionData"in t}function T(t,n,e){if(!D(t))throw new TypeError("Argument is not a typed-function.");const r=e&&e.exact,i=h(Array.isArray(n)?n.join(","):n),u=g(i);if(!r||u in t.signatures){const n=t._typedFunctionData.signatureMap.get(u);if(n)return n}const o=i.length;let M,c;if(r){let n;for(n in M=[],t.signatures)M.push(t._typedFunctionData.signatureMap.get(n))}else M=t._typedFunctionData.signatures;for(let t=0;t<o;++t){const n=i[t],e=[];let r;for(r of M){const i=O(r.params,t);if(i&&(!n.restParam||i.restParam)){if(!i.hasAny){const t=y(i);if(n.types.some(n=>!t.has(n.name)))continue}e.push(r)}}if(M=e,0===M.length)break}for(c of M)if(c.params.length<=o)return c;throw new TypeError("Signature not found (signature: "+(t.name||"unnamed")+"("+g(i,", ")+"))")}function g(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:",";return t.map(t=>t.name).join(n)}function l(t){const n=0===t.indexOf("..."),e=(n?t.length>3?t.slice(3):"any":t).split("|").map(t=>c(t.trim()));let r=!1,i=n?"...":"";return{types:e.map((function(t){return r=t.isAny||r,i+=t.name+"|",{name:t.name,typeIndex:t.index,test:t.test,isAny:t.isAny,conversion:null,conversionIndex:-1}})),name:i.slice(0,-1),hasAny:r,hasConversion:!1,restParam:n}}function I(t){const n=function(t){if(0===t.length)return[];const n=t.map(c);t.length>1&&n.sort((t,n)=>t.index-n.index);let e=n[0].conversionsTo;if(1===t.length)return e;e=e.concat([]);const r=new Set(t);for(let t=1;t<n.length;++t){let i;for(i of n[t].conversionsTo)r.has(i.from)||(e.push(i),r.add(i.from))}return e}(t.types.map(t=>t.name));let e=t.hasAny,r=t.name;const i=n.map((function(t){const n=c(t.from);return e=n.isAny||e,r+="|"+t.from,{name:t.from,typeIndex:n.index,test:n.test,isAny:n.isAny,conversion:t,conversionIndex:t.index}}));return{types:t.types.concat(i),name:r,hasAny:e,hasConversion:i.length>0,restParam:t.restParam}}function y(t){return t.typeSet||(t.typeSet=new Set,t.types.forEach(n=>t.typeSet.add(n.name))),t.typeSet}function h(t){const n=[];if("string"!=typeof t)throw new TypeError("Signatures must be strings");const e=t.trim();if(""===e)return n;const r=e.split(",");for(let t=0;t<r.length;++t){const e=l(r[t].trim());if(e.restParam&&t!==r.length-1)throw new SyntaxError('Unexpected rest parameter "'+r[t]+'": only allowed for the last parameter');if(0===e.types.length)return null;n.push(e)}return n}function j(t){const n=b(t);return!!n&&n.restParam}function x(t){if(t&&0!==t.types.length){if(1===t.types.length)return c(t.types[0].name).test;if(2===t.types.length){const n=c(t.types[0].name).test,e=c(t.types[1].name).test;return function(t){return n(t)||e(t)}}{const n=t.types.map((function(t){return c(t.name).test}));return function(t){for(let e=0;e<n.length;e++)if(n[e](t))return!0;return!1}}}return ao}function z(t){let n,e,r;if(j(t)){n=F(t).map(x);const e=n.length,r=x(b(t)),i=function(t){for(let n=e;n<t.length;n++)if(!r(t[n]))return!1;return!0};return function(t){for(let e=0;e<n.length;e++)if(!n[e](t[e]))return!1;return i(t)&&t.length>=e+1}}return 0===t.length?function(t){return 0===t.length}:1===t.length?(e=x(t[0]),function(t){return e(t[0])&&1===t.length}):2===t.length?(e=x(t[0]),r=x(t[1]),function(t){return e(t[0])&&r(t[1])&&2===t.length}):(n=t.map(x),function(t){for(let e=0;e<n.length;e++)if(!n[e](t[e]))return!1;return t.length===n.length})}function O(t,n){return n<t.length?t[n]:j(t)?b(t):null}function E(t,n){const e=O(t,n);return e?y(e):new Set}function A(t){return null===t.conversion||void 0===t.conversion}function f(t,n){const e=new Set;return t.forEach(t=>{const r=E(t.params,n);let i;for(i of r)e.add(i)}),e.has("any")?["any"]:Array.from(e)}function p(t,n,e){let r,i;const u=t||"unnamed";let o,M=e;for(o=0;o<n.length;o++){const t=[];if(M.forEach(e=>{const r=x(O(e.params,o));(o<e.params.length||j(e.params))&&r(n[o])&&t.push(e)}),0===t.length){if(i=f(M,o),i.length>0){const t=s(n[o]);return r=new TypeError("Unexpected type of argument in function "+u+" (expected: "+i.join(" or ")+", actual: "+t.join(" | ")+", index: "+o+")"),r.data={category:"wrongType",fn:u,index:o,actual:t,expected:i},r}}else M=t}const c=M.map((function(t){return j(t.params)?1/0:t.params.length}));if(n.length<Math.min.apply(null,c))return i=f(M,o),r=new TypeError("Too few arguments in function "+u+" (expected: "+i.join(" or ")+", index: "+n.length+")"),r.data={category:"tooFewArgs",fn:u,index:n.length,expected:i},r;const N=Math.max.apply(null,c);if(n.length>N)return r=new TypeError("Too many arguments in function "+u+" (expected: "+N+", actual: "+n.length+")"),r.data={category:"tooManyArgs",fn:u,index:n.length,expectedLength:N},r;const a=[];for(let t=0;t<n.length;++t)a.push(s(n[t]).join("|"));return r=new TypeError('Arguments of type "'+a.join(", ")+'" do not match any of the defined signatures of function '+u+"."),r.data={category:"mismatch",actual:a},r}function U(t){let n=u.length+1;for(let e=0;e<t.types.length;e++)A(t.types[e])&&(n=Math.min(n,t.types[e].typeIndex));return n}function d(t){let n=o+1;for(let e=0;e<t.types.length;e++)A(t.types[e])||(n=Math.min(n,t.types[e].conversionIndex));return n}function C(t,n){if(t.hasAny){if(!n.hasAny)return 1}else if(n.hasAny)return-1;if(t.restParam){if(!n.restParam)return 1}else if(n.restParam)return-1;if(t.hasConversion){if(!n.hasConversion)return 1}else if(n.hasConversion)return-1;const e=U(t)-U(n);if(e<0)return-1;if(e>0)return 1;const r=d(t)-d(n);return r<0?-1:r>0?1:0}function Q(t,n){const e=t.params,r=n.params,i=b(e),u=b(r),o=j(e),M=j(r);if(o&&i.hasAny){if(!M||!u.hasAny)return 1}else if(M&&u.hasAny)return-1;let c,N=0,a=0;for(c of e)c.hasAny&&++N,c.hasConversion&&++a;let s=0,D=0;for(c of r)c.hasAny&&++s,c.hasConversion&&++D;if(N!==s)return N-s;if(o&&i.hasConversion){if(!M||!u.hasConversion)return 1}else if(M&&u.hasConversion)return-1;if(a!==D)return a-D;if(o){if(!M)return 1}else if(M)return-1;const T=(e.length-r.length)*(o?-1:1);if(0!==T)return T;const g=[];let l,I=0;for(let t=0;t<e.length;++t){const n=C(e[t],r[t]);g.push(n),I+=n}if(0!==I)return I;for(l of g)if(0!==l)return l;return 0}function w(t,n){let e=n;if(t.some(t=>t.hasConversion)){const r=j(t),i=t.map(L);e=function(){const t=[],e=r?arguments.length-1:arguments.length;for(let n=0;n<e;n++)t[n]=i[n](arguments[n]);return r&&(t[e]=arguments[e].map(i[e])),n.apply(this,t)}}let r=e;if(j(t)){const n=t.length-1;r=function(){return e.apply(this,Z(arguments,0,n).concat([Z(arguments,n)]))}}return r}function L(t){let n,e,r,i;const u=[],o=[];switch(t.types.forEach((function(t){t.conversion&&(u.push(c(t.conversion.from).test),o.push(t.conversion.convert))})),o.length){case 0:return function(t){return t};case 1:return n=u[0],r=o[0],function(t){return n(t)?r(t):t};case 2:return n=u[0],e=u[1],r=o[0],i=o[1],function(t){return n(t)?r(t):e(t)?i(t):t};default:return function(t){for(let n=0;n<o.length;n++)if(u[n](t))return o[n](t);return t}}}function S(t){return function t(n,e,r){if(e<n.length){const o=n[e];let M=[];if(o.restParam){const t=o.types.filter(A);t.length<o.types.length&&M.push({types:t,name:"..."+t.map(t=>t.name).join("|"),hasAny:t.some(t=>t.isAny),hasConversion:!1,restParam:!0}),M.push(o)}else M=o.types.map((function(t){return{types:[t],name:t.name,hasAny:t.isAny,hasConversion:t.conversion,restParam:!1}}));return i=M,u=function(i){return t(n,e+1,r.concat([i]))},Array.prototype.concat.apply([],i.map(u))}return[r];var i,u}(t,0,[])}function k(t,n){const e=Math.max(t.length,n.length);for(let r=0;r<e;r++){const e=E(t,r),i=E(n,r);let u,o=!1;for(u of i)if(e.has(u)){o=!0;break}if(!o)return!1}const r=t.length,i=n.length,u=j(t),o=j(n);return u?o?r===i:i>=r:o?r>=i:r===i}function v(t,n,e){const r=[];let i;for(i of t){let t=e[i];if("number"!=typeof t)throw new TypeError('No definition for referenced signature "'+i+'"');if(t=n[t],"function"!=typeof t)return!1;r.push(t)}return r}function Y(t,n,e){const r=function(t){return t.map(t=>G(t)?V(t.referToSelf.callback):W(t)?B(t.referTo.references,t.referTo.callback):t)}(t),i=new Array(r.length).fill(!1);let u=!0;for(;u;){u=!1;let t=!0;for(let o=0;o<r.length;++o){if(i[o])continue;const M=r[o];if(G(M))r[o]=M.referToSelf.callback(e),r[o].referToSelf=M.referToSelf,i[o]=!0,t=!1;else if(W(M)){const e=v(M.referTo.references,r,n);e?(r[o]=M.referTo.callback.apply(this,e),r[o].referTo=M.referTo,i[o]=!0,t=!1):u=!0}}if(t&&u)throw new SyntaxError("Circular reference detected in resolving typed.referTo")}return r}function m(t,n){if(M.createCount++,0===Object.keys(n).length)throw new SyntaxError("No signatures provided");M.warnAgainstDeprecatedThis&&function(t){const n=/\bthis(\(|\.signatures\b)/;Object.keys(t).forEach(e=>{const r=t[e];if(n.test(r.toString()))throw new SyntaxError("Using `this` to self-reference a function is deprecated since typed-function@3. Use typed.referTo and typed.referToSelf instead.")})}(n);const e=[],r=[],i={},u=[];let o;for(o in n){if(!Object.prototype.hasOwnProperty.call(n,o))continue;const t=h(o);if(!t)continue;e.forEach((function(n){if(k(n,t))throw new TypeError('Conflicting signatures "'+g(n)+'" and "'+g(t)+'".')})),e.push(t);const M=r.length;r.push(n[o]);const c=t.map(I);let N;for(N of S(c)){const t=g(N);u.push({params:N,name:t,fn:M}),N.every(t=>!t.hasConversion)&&(i[t]=M)}}u.sort(Q);const c=Y(r,i,ut);let N;for(N in i)Object.prototype.hasOwnProperty.call(i,N)&&(i[N]=c[i[N]]);const a=[],s=new Map;for(N of u)s.has(N.name)||(N.fn=c[N.fn],a.push(N),s.set(N.name,N));const D=a[0]&&a[0].params.length<=2&&!j(a[0].params),T=a[1]&&a[1].params.length<=2&&!j(a[1].params),l=a[2]&&a[2].params.length<=2&&!j(a[2].params),y=a[3]&&a[3].params.length<=2&&!j(a[3].params),O=a[4]&&a[4].params.length<=2&&!j(a[4].params),E=a[5]&&a[5].params.length<=2&&!j(a[5].params),A=D&&T&&l&&y&&O&&E;for(let t=0;t<a.length;++t)a[t].test=z(a[t].params);const f=D?x(a[0].params[0]):so,p=T?x(a[1].params[0]):so,U=l?x(a[2].params[0]):so,d=y?x(a[3].params[0]):so,C=O?x(a[4].params[0]):so,L=E?x(a[5].params[0]):so,v=D?x(a[0].params[1]):so,m=T?x(a[1].params[1]):so,R=l?x(a[2].params[1]):so,F=y?x(a[3].params[1]):so,b=O?x(a[4].params[1]):so,Z=E?x(a[5].params[1]):so;for(let t=0;t<a.length;++t)a[t].implementation=w(a[t].params,a[t].fn);const B=D?a[0].implementation:Do,V=T?a[1].implementation:Do,W=l?a[2].implementation:Do,G=y?a[3].implementation:Do,P=O?a[4].implementation:Do,J=E?a[5].implementation:Do,H=D?a[0].params.length:-1,K=T?a[1].params.length:-1,X=l?a[2].params.length:-1,q=y?a[3].params.length:-1,_=O?a[4].params.length:-1,$=E?a[5].params.length:-1,tt=A?6:0,nt=a.length,et=a.map(t=>t.test),rt=a.map(t=>t.implementation),it=function(){for(let t=tt;t<nt;t++)if(et[t](arguments))return rt[t].apply(this,arguments);return M.onMismatch(t,arguments,a)};function ut(t,n){return arguments.length===H&&f(t)&&v(n)?B.apply(this,arguments):arguments.length===K&&p(t)&&m(n)?V.apply(this,arguments):arguments.length===X&&U(t)&&R(n)?W.apply(this,arguments):arguments.length===q&&d(t)&&F(n)?G.apply(this,arguments):arguments.length===_&&C(t)&&b(n)?P.apply(this,arguments):arguments.length===$&&L(t)&&Z(n)?J.apply(this,arguments):it.apply(this,arguments)}try{Object.defineProperty(ut,"name",{value:t})}catch(t){}return ut.signatures=i,ut._typedFunctionData={signatures:a,signatureMap:s},ut}function R(t,n,e){throw p(t,n,e)}function F(t){return Z(t,0,t.length-1)}function b(t){return t[t.length-1]}function Z(t,n,e){return Array.prototype.slice.call(t,n,e)}function B(t,n){return{referTo:{references:t,callback:n}}}function V(t){if("function"!=typeof t)throw new TypeError("Callback function expected as first argument");return{referToSelf:{callback:t}}}function W(t){return t&&"object"==typeof t.referTo&&Array.isArray(t.referTo.references)&&"function"==typeof t.referTo.callback}function G(t){return t&&"object"==typeof t.referToSelf&&"function"==typeof t.referToSelf.callback}function P(t,n){if(!t)return n;if(n&&n!==t){const e=new Error("Function names do not match (expected: "+t+", actual: "+n+")");throw e.data={actual:n,expected:t},e}return t}function J(t){let n;for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(D(t[e])||"string"==typeof t[e].signature)&&(n=P(n,t[e].name));return n}function H(t,n){let e;for(e in n)if(Object.prototype.hasOwnProperty.call(n,e)){if(e in t&&n[e]!==t[e]){const r=new Error('Signature "'+e+'" is defined twice');throw r.data={signature:e,sourceFunction:n[e],destFunction:t[e]},r}t[e]=n[e]}}a(),N(e);const K=M;function X(t){if(!t||"string"!=typeof t.from||"string"!=typeof t.to||"function"!=typeof t.convert)throw new TypeError("Object with properties {from: string, to: string, convert: function} expected");if(t.to===t.from)throw new SyntaxError('Illegal to define conversion from "'+t.from+'" to itself.')}return M=function(t){const e="string"==typeof t,r=e?1:0;let i=e?t:"";const u={};for(let t=r;t<arguments.length;++t){const r=arguments[t];let o,M={};if("function"==typeof r?(o=r.name,"string"==typeof r.signature?M[r.signature]=r:D(r)&&(M=r.signatures)):n(r)&&(M=r,e||(o=J(r))),0===Object.keys(M).length){const n=new TypeError("Argument to 'typed' at index "+t+" is not a (typed) function, nor an object with signatures as keys and functions as values.");throw n.data={index:t,argument:r},n}e||(i=P(i,o)),H(u,M)}return m(i||"",u)},M.create=t,M.createCount=K.createCount,M.onMismatch=R,M.throwMismatchError=R,M.createError=p,M.clear=a,M.clearConversions=function(){let t;for(t of u)i.get(t).conversionsTo=[];o=0},M.addTypes=N,M._findType=c,M.referTo=function(){const t=F(arguments).map(t=>g(h(t))),n=b(arguments);if("function"!=typeof n)throw new TypeError("Callback function expected as last argument");return B(t,n)},M.referToSelf=V,M.convert=function(t,n){const e=c(n);if(e.test(t))return t;const r=e.conversionsTo;if(0===r.length)throw new Error("There are no conversions to "+n+" defined.");for(let n=0;n<r.length;n++){if(c(r[n].from).test(t))return r[n].convert(t)}throw new Error("Cannot convert "+t+" to "+n)},M.findSignature=T,M.find=function(t,n,e){return T(t,n,e).implementation},M.isTypedFunction=D,M.warnAgainstDeprecatedThis=!0,M.addType=function(t,n){let e="any";!1!==n&&i.has("Object")&&(e="Object"),M.addTypes([t],e)},M.addConversion=function(t){X(t);const n=c(t.to);if(!n.conversionsTo.every((function(n){return n.from!==t.from})))throw new Error('There is already a conversion from "'+t.from+'" to "'+n.name+'"');n.conversionsTo.push({from:t.from,convert:t.convert,index:o++})},M.addConversions=function(t){t.forEach(M.addConversion)},M.removeConversion=function(t){X(t);const n=c(t.to),e=function(t,n){for(let e=0;e<t.length;e++)if(n(t[e]))return t[e]}(n.conversionsTo,n=>n.from===t.from);if(!e)throw new Error("Attempt to remove nonexistent conversion from "+t.from+" to "+t.to);if(e.convert!==t.convert)throw new Error("Conversion to remove does not match existing conversion");const r=n.conversionsTo.indexOf(e);n.conversionsTo.splice(r,1)},M.resolve=function(t,n){if(!D(t))throw new TypeError("Argument is not a typed-function.");const e=t._typedFunctionData.signatures;for(let t=0;t<e.length;++t)if(e[t].test(n))return e[t];return null},M}();function go(t,n){if(ho(t)&&Io(t,n))return t[n];if("function"==typeof t[n]&&yo(t,n))throw new Error('Cannot access method "'+n+'" as a property');throw new Error('No access to property "'+n+'"')}function lo(t,n,e){if(ho(t)&&Io(t,n))return t[n]=e,e;throw new Error('No access to property "'+n+'"')}function Io(t,n){return!(!t||"object"!=typeof t)&&(!!yr(jo,n)||!(n in Object.prototype)&&!(n in Function.prototype))}function yo(t,n){return null!=t&&"function"==typeof t[n]&&(!(yr(t,n)&&Object.getPrototypeOf&&n in Object.getPrototypeOf(t))&&(!!yr(xo,n)||!(n in Object.prototype)&&!(n in Function.prototype)))}function ho(t){return"object"==typeof t&&t&&t.constructor===Object}var jo={length:!0,name:!0},xo={toString:!0,valueOf:!0,toLocaleString:!0};class zo{constructor(t){this.wrappedObject=t,this[Symbol.iterator]=this.entries}keys(){return Object.keys(this.wrappedObject).values()}get(t){return go(this.wrappedObject,t)}set(t,n){return lo(this.wrappedObject,t,n),this}has(t){return n=this.wrappedObject,t in n;var n}entries(){return Oo(this.keys(),t=>[t,this.get(t)])}forEach(t){for(var n of this.keys())t(this.get(n),n,this)}delete(t){delete this.wrappedObject[t]}clear(){for(var t of this.keys())this.delete(t)}get size(){return Object.keys(this.wrappedObject).length}}function Oo(t,n){return{next:()=>{var e=t.next();return e.done?e:{value:n(e.value),done:!1}}}}function Eo(t){return!!t&&(t instanceof Map||t instanceof zo||"function"==typeof t.set&&"function"==typeof t.get&&"function"==typeof t.keys&&"function"==typeof t.has)}var Ao=function(){return Ao=To.create,To},fo=Ju("typed",["?BigNumber","?Complex","?DenseMatrix","?Fraction"],(function(t){var{BigNumber:n,Complex:e,DenseMatrix:r,Fraction:i}=t,u=Ao();return u.clear(),u.addTypes([{name:"number",test:de},{name:"Complex",test:Qe},{name:"BigNumber",test:Ce},{name:"Fraction",test:we},{name:"Unit",test:Le},{name:"identifier",test:t=>Se&&/^(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])*$/.test(t)},{name:"string",test:Se},{name:"Chain",test:Dr},{name:"Array",test:ke},{name:"Matrix",test:ve},{name:"DenseMatrix",test:me},{name:"SparseMatrix",test:Re},{name:"Range",test:Fe},{name:"Index",test:be},{name:"boolean",test:Ze},{name:"ResultSet",test:Be},{name:"Help",test:Ve},{name:"function",test:We},{name:"Date",test:Ge},{name:"RegExp",test:Pe},{name:"null",test:He},{name:"undefined",test:Ke},{name:"AccessorNode",test:Xe},{name:"ArrayNode",test:qe},{name:"AssignmentNode",test:_e},{name:"BlockNode",test:$e},{name:"ConditionalNode",test:tr},{name:"ConstantNode",test:nr},{name:"FunctionNode",test:rr},{name:"FunctionAssignmentNode",test:er},{name:"IndexNode",test:ir},{name:"Node",test:ur},{name:"ObjectNode",test:or},{name:"OperatorNode",test:Mr},{name:"ParenthesisNode",test:cr},{name:"RangeNode",test:Nr},{name:"RelationalNode",test:ar},{name:"SymbolNode",test:sr},{name:"Map",test:Eo},{name:"Object",test:Je}]),u.addConversions([{from:"number",to:"BigNumber",convert:function(t){if(n||po(t),t.toExponential().replace(/e.*$/,"").replace(/^0\.?0*|\./,"").length>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+t+"). Use function bignumber(x) to convert to BigNumber.");return new n(t)}},{from:"number",to:"Complex",convert:function(t){return e||Uo(t),new e(t,0)}},{from:"BigNumber",to:"Complex",convert:function(t){return e||Uo(t),new e(t.toNumber(),0)}},{from:"Fraction",to:"BigNumber",convert:function(t){throw new TypeError("Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.")}},{from:"Fraction",to:"Complex",convert:function(t){return e||Uo(t),new e(t.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(t){i||Co(t);var n=new i(t);if(n.valueOf()!==t)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+t+"). Use function fraction(x) to convert to Fraction.");return n}},{from:"string",to:"number",convert:function(t){var n=Number(t);if(isNaN(n))throw new Error('Cannot convert "'+t+'" to a number');return n}},{from:"string",to:"BigNumber",convert:function(t){n||po(t);try{return new n(t)}catch(n){throw new Error('Cannot convert "'+t+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(t){i||Co(t);try{return new i(t)}catch(n){throw new Error('Cannot convert "'+t+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(t){e||Uo(t);try{return new e(t)}catch(n){throw new Error('Cannot convert "'+t+'" to Complex')}}},{from:"boolean",to:"number",convert:function(t){return+t}},{from:"boolean",to:"BigNumber",convert:function(t){return n||po(t),new n(+t)}},{from:"boolean",to:"Fraction",convert:function(t){return i||Co(t),new i(+t)}},{from:"boolean",to:"string",convert:function(t){return String(t)}},{from:"Array",to:"Matrix",convert:function(t){return r||function(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}(),new r(t)}},{from:"Matrix",to:"Array",convert:function(t){return t.valueOf()}}]),u.onMismatch=(t,n,e)=>{var r=u.createError(t,n,e);if(["wrongType","mismatch"].includes(r.data.category)&&1===n.length&&Ye(n[0])&&e.some(t=>!t.params.includes(","))){var i=new TypeError("Function '".concat(t,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(t,")'."));throw i.data=r.data,i}throw r},u.onMismatch=(t,n,e)=>{var r=u.createError(t,n,e);if(["wrongType","mismatch"].includes(r.data.category)&&1===n.length&&Ye(n[0])&&e.some(t=>!t.params.includes(","))){var i=new TypeError("Function '".concat(t,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(t,")'."));throw i.data=r.data,i}throw r},u}));function po(t){throw new Error("Cannot convert value ".concat(t," into a BigNumber: no class 'BigNumber' provided"))}function Uo(t){throw new Error("Cannot convert value ".concat(t," into a Complex number: no class 'Complex' provided"))}function Co(t){throw new Error("Cannot convert value ".concat(t," into a Fraction, no class 'Fraction' provided."))}function Qo(t,n,e){return t&&"function"==typeof t.map?t.map((function(t){return Qo(t,n,e)})):n(t)}var wo="number",Lo="number, number";function So(t){return Math.abs(t)}function ko(t,n){return t+n}function vo(t,n){return t-n}function Yo(t,n){return t*n}function mo(t){return-t}function Ro(t){return t}function Fo(t){return iu(t)}function bo(t){return t*t*t}function Zo(t){return Math.exp(t)}function Bo(t){return uu(t)}function Vo(t,n){if(!tu(t)||!tu(n))throw new Error("Parameters in function lcm must be integer numbers");if(0===t||0===n)return 0;for(var e,r=t*n;0!==n;)n=t%(e=n),t=e;return Math.abs(r/t)}function Wo(t){return ru(t)}function Go(t){return eu(t)}function Po(t){return nu(t)}function Jo(t){return t*t}function Ho(t,n){var e,r,i,u=0,o=1,M=1,c=0;if(!tu(t)||!tu(n))throw new Error("Parameters in function xgcd must be integer numbers");for(;n;)i=t-(r=Math.floor(t/n))*n,e=u,u=o-r*u,o=e,e=M,M=c-r*M,c=e,t=n,n=i;return t<0?[-t,-o,-c]:[t,t?o:0,c]}function Ko(t,n){return t*t<1&&n===1/0||t*t>1&&n===-1/0?0:Math.pow(t,n)}So.signature=wo,ko.signature=Lo,vo.signature=Lo,Yo.signature=Lo,mo.signature=wo,Ro.signature=wo,Fo.signature=wo,bo.signature=wo,Zo.signature=wo,Bo.signature=wo,Vo.signature=Lo,Wo.signature=wo,Go.signature=wo,Po.signature=wo,Jo.signature=wo,Ho.signature=Lo,Ko.signature=Lo;function Xo(t){return Iu(t)}function qo(t){return Math.atan(1/t)}function _o(t){return isFinite(t)?(Math.log((t+1)/t)+Math.log(t/(t-1)))/2:0}function $o(t){return Math.asin(1/t)}function tM(t){var n=1/t;return Math.log(n+Math.sqrt(n*n+1))}function nM(t){return Math.acos(1/t)}function eM(t){var n=1/t,e=Math.sqrt(n*n-1);return Math.log(e+n)}function rM(t){return yu(t)}function iM(t){return hu(t)}function uM(t){return 1/Math.tan(t)}function oM(t){var n=Math.exp(2*t);return(n+1)/(n-1)}function MM(t){return 1/Math.sin(t)}function cM(t){return 0===t?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(t)-Math.exp(-t)))*nu(t)}function NM(t){return 1/Math.cos(t)}function aM(t){return 2/(Math.exp(t)+Math.exp(-t))}function sM(t){return ju(t)}Xo.signature="number",qo.signature="number",_o.signature="number",$o.signature="number",tM.signature="number",nM.signature="number",eM.signature="number",rM.signature="number",iM.signature="number",uM.signature="number",oM.signature="number",MM.signature="number",cM.signature="number",NM.signature="number",aM.signature="number",sM.signature="number";var DM=Ju("addScalar",["typed"],t=>{var{typed:n}=t;return n("addScalar",{"number, number":ko,"Complex, Complex":function(t,n){return t.add(n)},"BigNumber, BigNumber":function(t,n){return t.plus(n)},"Fraction, Fraction":function(t,n){return t.add(n)},"Unit, Unit":n.referToSelf(t=>(e,r)=>{if(null===e.value||void 0===e.value)throw new Error("Parameter x contains a unit with undefined value");if(null===r.value||void 0===r.value)throw new Error("Parameter y contains a unit with undefined value");if(!e.equalBase(r))throw new Error("Units do not match");var i=e.clone();return i.value=n.find(t,[i.valueType(),r.valueType()])(i.value,r.value),i.fixPrefix=!1,i})})});var TM="number, number";function gM(t,n){if(!tu(t)||!tu(n))throw new Error("Integers expected in function bitAnd");return t&n}function lM(t){if(!tu(t))throw new Error("Integer expected in function bitNot");return~t}function IM(t,n){if(!tu(t)||!tu(n))throw new Error("Integers expected in function bitOr");return t|n}function yM(t,n){if(!tu(t)||!tu(n))throw new Error("Integers expected in function bitXor");return t^n}function hM(t,n){if(!tu(t)||!tu(n))throw new Error("Integers expected in function leftShift");return t<<n}function jM(t,n){if(!tu(t)||!tu(n))throw new Error("Integers expected in function rightArithShift");return t>>n}function xM(t,n){if(!tu(t)||!tu(n))throw new Error("Integers expected in function rightLogShift");return t>>>n}gM.signature=TM,lM.signature="number",IM.signature=TM,yM.signature=TM,hM.signature=TM,jM.signature=TM,xM.signature=TM;function zM(t,n){if(n<t)return 1;if(n===t)return n;var e=n+t>>1;return zM(t,e)*zM(e+1,n)}function OM(t,n){if(!tu(t)||t<0)throw new TypeError("Positive integer value expected in function combinations");if(!tu(n)||n<0)throw new TypeError("Positive integer value expected in function combinations");if(n>t)throw new TypeError("k must be less than or equal to n");for(var e=t-n,r=1,i=2,u=n<e?n:e,o=n<e?e+1:n+1;o<=t;++o)for(r*=o;i<=u&&r%i==0;)r/=i,++i;return i<=u&&(r/=zM(i,u)),r}OM.signature="number, number";var EM=Ju("conj",["typed"],t=>{var{typed:n}=t;return n("conj",{"number | BigNumber | Fraction":t=>t,Complex:t=>t.conjugate(),"Array | Matrix":n.referToSelf(t=>n=>Qo(n,t))})});function AM(t,n,e){if(null==e)return t.eq(n);if(t.eq(n))return!0;if(t.isNaN()||n.isNaN())return!1;if(t.isFinite()&&n.isFinite()){var r=t.minus(n).abs();if(r.isZero())return!0;var i=t.constructor.max(t.abs(),n.abs());return r.lte(i.times(e))}return!1}var fM=Ju("compareUnits",["typed"],t=>{var{typed:n}=t;return{"Unit, Unit":n.referToSelf(t=>(e,r)=>{if(!e.equalBase(r))throw new Error("Cannot compare units with different base");return n.find(t,[e.valueType(),r.valueType()])(e.value,r.value)})}}),pM=Ju("equalScalar",["typed","config"],t=>{var{typed:n,config:e}=t;return n("equalScalar",{"boolean, boolean":function(t,n){return t===n},"number, number":function(t,n){return lu(t,n,e.epsilon)},"BigNumber, BigNumber":function(t,n){return t.eq(n)||AM(t,n,e.epsilon)},"Fraction, Fraction":function(t,n){return t.equals(n)},"Complex, Complex":function(t,n){return function(t,n,e){return lu(t.re,n.re,e)&&lu(t.im,n.im,e)}(t,n,e.epsilon)}},fM({typed:n}))});Ju("equalScalar",["typed","config"],t=>{var{typed:n,config:e}=t;return n("equalScalar",{"number, number":function(t,n){return lu(t,n,e.epsilon)}})}),Math.pow(2,53);Ju("hex",["typed","format"],t=>{var{typed:n,format:e}=t;return n("hex",{"number | BigNumber":function(t){return e(t,{notation:"hex"})},"number | BigNumber, number | BigNumber":function(t,n){return e(t,{notation:"hex",wordSize:n})}})});function UM(t){return t<0}function dM(t){return t>0}function CM(t){return 0===t}function QM(t){return Number.isNaN(t)}UM.signature="number",dM.signature="number",CM.signature="number",QM.signature="number";function wM(t){var n;if(tu(t))return t<=0?isFinite(t)?1/0:NaN:t>171?1/0:zM(1,t-1);if(t<.5)return Math.PI/(Math.sin(Math.PI*t)*wM(1-t));if(t>=171.35)return 1/0;if(t>85){var e=t*t,r=e*t,i=r*t,u=i*t;return Math.sqrt(2*Math.PI/t)*Math.pow(t/Math.E,t)*(1+1/(12*t)+1/(288*e)-139/(51840*r)-571/(2488320*i)+163879/(209018880*u)+5246819/(75246796800*u*t))}--t,n=SM[0];for(var o=1;o<SM.length;++o)n+=SM[o]/(t+o);var M=t+LM+.5;return Math.sqrt(2*Math.PI)*Math.pow(M,t+.5)*Math.exp(-M)*n}wM.signature="number";var LM=4.7421875,SM=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22],kM=[1.000000000190015,76.18009172947146,-86.50532032941678,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18];function vM(t){if(t<0)return NaN;if(0===t)return 1/0;if(!isFinite(t))return t;if(t<.5)return Math.log(Math.PI/Math.sin(Math.PI*t))-vM(1-t);for(var n=(t-=1)+5+.5,e=kM[0],r=6;r>=1;r--)e+=kM[r]/(t+r);return.9189385332046728+(t+.5)*Math.log(n)-n+Math.log(e)}vM.signature="number";var YM=Ju("multiplyScalar",["typed"],t=>{var{typed:n}=t;return n("multiplyScalar",{"number, number":Yo,"Complex, Complex":function(t,n){return t.mul(n)},"BigNumber, BigNumber":function(t,n){return t.times(n)},"Fraction, Fraction":function(t,n){return t.mul(n)},"number | Fraction | BigNumber | Complex, Unit":(t,n)=>n.multiply(t),"Unit, number | Fraction | BigNumber | Complex | Unit":(t,n)=>t.multiply(n)})});function mM(t){return!t}function RM(t,n){return!(!t&&!n)}function FM(t,n){return!!t!=!!n}function bM(t,n){return!(!t||!n)}mM.signature="number",RM.signature="number, number",FM.signature="number, number",bM.signature="number, number";Ju("oct",["typed","format"],t=>{var{typed:n,format:e}=t;return n("oct",{"number | BigNumber":function(t){return e(t,{notation:"oct"})},"number | BigNumber, number | BigNumber":function(t,n){return e(t,{notation:"oct",wordSize:n})}})});var ZM=e(22),BM=e.n(ZM);Date.now();var VM=Ju("SparseMatrix",["typed","equalScalar","Matrix"],t=>{var{typed:n,equalScalar:e,Matrix:r}=t;function i(t,n){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if(n&&!Se(n))throw new Error("Invalid datatype: "+n);if(ve(t))!function(t,n,e){"SparseMatrix"===n.type?(t._values=n._values?gr(n._values):void 0,t._index=gr(n._index),t._ptr=gr(n._ptr),t._size=gr(n._size),t._datatype=e||n._datatype):u(t,n.valueOf(),e||n._datatype)}(this,t,n);else if(t&&ke(t.index)&&ke(t.ptr)&&ke(t.size))this._values=t.values,this._index=t.index,this._ptr=t.ptr,this._size=t.size,this._datatype=n||t.datatype;else if(ke(t))u(this,t,n);else{if(t)throw new TypeError("Unsupported type of data ("+Tr(t)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=n}}function u(t,r,i){t._values=[],t._index=[],t._ptr=[],t._datatype=i;var u=r.length,o=0,M=e,c=0;if(Se(i)&&(M=n.find(e,[i,i])||e,c=n.convert(0,i)),u>0){var N=0;do{t._ptr.push(t._index.length);for(var a=0;a<u;a++){var s=r[a];if(ke(s)){if(0===N&&o<s.length&&(o=s.length),N<s.length){var D=s[N];M(D,c)||(t._values.push(D),t._index.push(a))}}else 0===N&&o<1&&(o=1),M(s,c)||(t._values.push(s),t._index.push(a))}N++}while(N<o)}t._ptr.push(t._index.length),t._size=[u,o]}function o(t,n){if(!be(n))throw new TypeError("Invalid index");if(n.isScalar())return t.get(n.min());var e,r,u,o,M=n.size();if(M.length!==t._size.length)throw new Qu(M.length,t._size.length);var c=n.min(),N=n.max();for(e=0,r=t._size.length;e<r;e++)ku(c[e],t._size[e]),ku(N[e],t._size[e]);var a=t._values,s=t._index,D=t._ptr,T=n.dimension(0),g=n.dimension(1),l=[],I=[];T.forEach((function(t,n){I[t]=n[0],l[t]=!0}));var y=a?[]:void 0,h=[],j=[];return g.forEach((function(t){for(j.push(h.length),u=D[t],o=D[t+1];u<o;u++)e=s[u],!0===l[e]&&(h.push(I[e]),y&&y.push(a[u]))})),j.push(h.length),new i({values:y,index:h,ptr:j,size:M,datatype:t._datatype})}function M(t,n,e,r){if(!n||!0!==n.isIndex)throw new TypeError("Invalid index");var i,u=n.size(),o=n.isScalar();if(ve(e)?(i=e.size(),e=e.toArray()):i=Lu(e),o){if(0!==i.length)throw new TypeError("Scalar expected");t.set(n.min(),e,r)}else{if(1!==u.length&&2!==u.length)throw new Qu(u.length,t._size.length,"<");if(i.length<u.length){for(var M=0,c=0;1===u[M]&&1===i[M];)M++;for(;1===u[M];)c++,M++;e=Fu(e,u.length,c,i)}if(!Ir(u,i))throw new Qu(u,i,">");if(1===u.length){n.dimension(0).forEach((function(n,i){ku(n),t.set([n,0],e[i[0]],r)}))}else{var N=n.dimension(0),a=n.dimension(1);N.forEach((function(n,i){ku(n),a.forEach((function(u,o){ku(u),t.set([n,u],e[i[0]][o[0]],r)}))}))}}return t}function c(t,n,e,r){if(e-n==0)return e;for(var i=n;i<e;i++)if(r[i]===t)return i;return n}function N(t,n,e,r,i,u,o){i.splice(t,0,r),u.splice(t,0,n);for(var M=e+1;M<o.length;M++)o[M]++}function a(t,r,i,u){var o=u||0,M=e,c=0;Se(t._datatype)&&(M=n.find(e,[t._datatype,t._datatype])||e,c=n.convert(0,t._datatype),o=n.convert(o,t._datatype));var N,a,s,D=!M(o,c),T=t._size[0],g=t._size[1];if(i>g){for(a=g;a<i;a++)if(t._ptr[a]=t._values.length,D)for(N=0;N<T;N++)t._values.push(o),t._index.push(N);t._ptr[i]=t._values.length}else i<g&&(t._ptr.splice(i+1,g-i),t._values.splice(t._ptr[i],t._values.length),t._index.splice(t._ptr[i],t._index.length));if(g=i,r>T){if(D){var l=0;for(a=0;a<g;a++){t._ptr[a]=t._ptr[a]+l,s=t._ptr[a+1]+l;var I=0;for(N=T;N<r;N++,I++)t._values.splice(s+I,0,o),t._index.splice(s+I,0,N),l++}t._ptr[g]=t._values.length}}else if(r<T){var y=0;for(a=0;a<g;a++){t._ptr[a]=t._ptr[a]-y;var h=t._ptr[a],j=t._ptr[a+1]-y;for(s=h;s<j;s++)(N=t._index[s])>r-1&&(t._values.splice(s,1),t._index.splice(s,1),y++)}t._ptr[a]=t._values.length}return t._size[0]=r,t._size[1]=i,t}function s(t,n,e,r,i){var u,o,M=r[0],c=r[1],N=[];for(u=0;u<M;u++)for(N[u]=[],o=0;o<c;o++)N[u][o]=0;for(o=0;o<c;o++)for(var a=e[o],s=e[o+1],D=a;D<s;D++)N[u=n[D]][o]=t?i?gr(t[D]):t[D]:1;return N}return i.prototype=new r,i.prototype.createSparseMatrix=function(t,n){return new i(t,n)},Object.defineProperty(i,"name",{value:"SparseMatrix"}),i.prototype.constructor=i,i.prototype.type="SparseMatrix",i.prototype.isSparseMatrix=!0,i.prototype.getDataType=function(){return Zu(this._values,Tr)},i.prototype.storage=function(){return"sparse"},i.prototype.datatype=function(){return this._datatype},i.prototype.create=function(t,n){return new i(t,n)},i.prototype.density=function(){var t=this._size[0],n=this._size[1];return 0!==t&&0!==n?this._index.length/(t*n):0},i.prototype.subset=function(t,n,e){if(!this._values)throw new Error("Cannot invoke subset on a Pattern only matrix");switch(arguments.length){case 1:return o(this,t);case 2:case 3:return M(this,t,n,e);default:throw new SyntaxError("Wrong number of arguments")}},i.prototype.get=function(t){if(!ke(t))throw new TypeError("Array expected");if(t.length!==this._size.length)throw new Qu(t.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");var n=t[0],e=t[1];ku(n,this._size[0]),ku(e,this._size[1]);var r=c(n,this._ptr[e],this._ptr[e+1],this._index);return r<this._ptr[e+1]&&this._index[r]===n?this._values[r]:0},i.prototype.set=function(t,r,i){if(!ke(t))throw new TypeError("Array expected");if(t.length!==this._size.length)throw new Qu(t.length,this._size.length);if(!this._values)throw new Error("Cannot invoke set on a Pattern only matrix");var u=t[0],o=t[1],M=this._size[0],s=this._size[1],D=e,T=0;Se(this._datatype)&&(D=n.find(e,[this._datatype,this._datatype])||e,T=n.convert(0,this._datatype)),(u>M-1||o>s-1)&&(a(this,Math.max(u+1,M),Math.max(o+1,s),i),M=this._size[0],s=this._size[1]),ku(u,M),ku(o,s);var g=c(u,this._ptr[o],this._ptr[o+1],this._index);return g<this._ptr[o+1]&&this._index[g]===u?D(r,T)?function(t,n,e,r,i){e.splice(t,1),r.splice(t,1);for(var u=n+1;u<i.length;u++)i[u]--}(g,o,this._values,this._index,this._ptr):this._values[g]=r:D(r,T)||N(g,u,o,r,this._values,this._index,this._ptr),this},i.prototype.resize=function(t,n,e){if(!Ye(t))throw new TypeError("Array or Matrix expected");var r=t.valueOf().map(t=>Array.isArray(t)&&1===t.length?t[0]:t);if(2!==r.length)throw new Error("Only two dimensions matrix are supported");return r.forEach((function(t){if(!de(t)||!tu(t)||t<0)throw new TypeError("Invalid size, must contain positive integers (size: "+pu(r)+")")})),a(e?this.clone():this,r[0],r[1],n)},i.prototype.reshape=function(t,n){if(!ke(t))throw new TypeError("Array expected");if(2!==t.length)throw new Error("Sparse matrices can only be reshaped in two dimensions");t.forEach((function(n){if(!de(n)||!tu(n)||n<=-2||0===n)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+pu(t)+")")}));var e=this._size[0]*this._size[1];if(e!==(t=mu(t,e))[0]*t[1])throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var r=n?this.clone():this;if(this._size[0]===t[0]&&this._size[1]===t[1])return r;for(var i=[],u=0;u<r._ptr.length;u++)for(var o=0;o<r._ptr[u+1]-r._ptr[u];o++)i.push(u);for(var M=r._values.slice(),a=r._index.slice(),s=0;s<r._index.length;s++){var D=a[s],T=i[s],g=D*r._size[1]+T;i[s]=g%t[1],a[s]=Math.floor(g/t[1])}r._values.length=0,r._index.length=0,r._ptr.length=t[1]+1,r._size=t.slice();for(var l=0;l<r._ptr.length;l++)r._ptr[l]=0;for(var I=0;I<M.length;I++){var y=a[I],h=i[I],j=M[I];N(c(y,r._ptr[h],r._ptr[h+1],r._index),y,h,j,r._values,r._index,r._ptr)}return r},i.prototype.clone=function(){return new i({values:this._values?gr(this._values):void 0,index:gr(this._index),ptr:gr(this._ptr),size:gr(this._size),datatype:this._datatype})},i.prototype.size=function(){return this._size.slice(0)},i.prototype.map=function(t,r){if(!this._values)throw new Error("Cannot invoke map on a Pattern only matrix");var u=this,o=this._size[0],M=this._size[1],c=no(t);return function(t,r,u,o,M,c,N){var a=[],s=[],D=[],T=e,g=0;Se(t._datatype)&&(T=n.find(e,[t._datatype,t._datatype])||e,g=n.convert(0,t._datatype));for(var l=function(t,n,e){t=c(t,n,e),T(t,g)||(a.push(t),s.push(n))},I=o;I<=M;I++){D.push(a.length);var y=t._ptr[I],h=t._ptr[I+1];if(N)for(var j=y;j<h;j++){var x=t._index[j];x>=r&&x<=u&&l(t._values[j],x-r,I-o)}else{for(var z={},O=y;O<h;O++){var E=t._index[O];z[E]=t._values[O]}for(var A=r;A<=u;A++){var f=A in z?z[A]:0;l(f,A-r,I-o)}}}return D.push(a.length),new i({values:a,index:s,ptr:D,size:[u-r+1,M-o+1]})}(this,0,o-1,0,M-1,(function(n,e,r){return 1===c?t(n):2===c?t(n,[e,r]):t(n,[e,r],u)}),r)},i.prototype.forEach=function(t,n){if(!this._values)throw new Error("Cannot invoke forEach on a Pattern only matrix");for(var e=this._size[0],r=this._size[1],i=0;i<r;i++){var u=this._ptr[i],o=this._ptr[i+1];if(n)for(var M=u;M<o;M++){var c=this._index[M];t(this._values[M],[c,i],this)}else{for(var N={},a=u;a<o;a++){N[this._index[a]]=this._values[a]}for(var s=0;s<e;s++){t(s in N?N[s]:0,[s,i],this)}}}},i.prototype[Symbol.iterator]=function*(){if(!this._values)throw new Error("Cannot iterate a Pattern only matrix");for(var t=this._size[1],n=0;n<t;n++)for(var e=this._ptr[n],r=this._ptr[n+1],i=e;i<r;i++){var u=this._index[i];yield{value:this._values[i],index:[u,n]}}},i.prototype.toArray=function(){return s(this._values,this._index,this._ptr,this._size,!0)},i.prototype.valueOf=function(){return s(this._values,this._index,this._ptr,this._size,!1)},i.prototype.format=function(t){for(var n=this._size[0],e=this._size[1],r=this.density(),i="Sparse Matrix ["+pu(n,t)+" x "+pu(e,t)+"] density: "+pu(r,t)+"\n",u=0;u<e;u++)for(var o=this._ptr[u],M=this._ptr[u+1],c=o;c<M;c++){i+="\n ("+pu(this._index[c],t)+", "+pu(u,t)+") ==> "+(this._values?pu(this._values[c],t):"X")}return i},i.prototype.toString=function(){return pu(this.toArray())},i.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},i.prototype.diagonal=function(t){if(t){if(Ce(t)&&(t=t.toNumber()),!de(t)||!tu(t))throw new TypeError("The parameter k must be an integer number")}else t=0;var n=t>0?t:0,e=t<0?-t:0,r=this._size[0],u=this._size[1],o=Math.min(r-e,u-n),M=[],c=[],N=[];N[0]=0;for(var a=n;a<u&&M.length<o;a++)for(var s=this._ptr[a],D=this._ptr[a+1],T=s;T<D;T++){var g=this._index[T];if(g===a-n+e){M.push(this._values[T]),c[M.length-1]=g-e;break}}return N.push(M.length),new i({values:M,index:c,ptr:N,size:[o,1]})},i.fromJSON=function(t){return new i(t)},i.diagonal=function(t,r,u,o,M){if(!ke(t))throw new TypeError("Array expected, size parameter");if(2!==t.length)throw new Error("Only two dimensions matrix are supported");if(t=t.map((function(t){if(Ce(t)&&(t=t.toNumber()),!de(t)||!tu(t)||t<1)throw new Error("Size values must be positive integers");return t})),u){if(Ce(u)&&(u=u.toNumber()),!de(u)||!tu(u))throw new TypeError("The parameter k must be an integer number")}else u=0;var c=e,N=0;Se(M)&&(c=n.find(e,[M,M])||e,N=n.convert(0,M));var a,s=u>0?u:0,D=u<0?-u:0,T=t[0],g=t[1],l=Math.min(T-D,g-s);if(ke(r)){if(r.length!==l)throw new Error("Invalid value array length");a=function(t){return r[t]}}else if(ve(r)){var I=r.size();if(1!==I.length||I[0]!==l)throw new Error("Invalid matrix length");a=function(t){return r.get([t])}}else a=function(){return r};for(var y=[],h=[],j=[],x=0;x<g;x++){j.push(y.length);var z=x-s;if(z>=0&&z<l){var O=a(z);c(O,N)||(h.push(z+D),y.push(O))}}return j.push(y.length),new i({values:y,index:h,ptr:j,size:[T,g]})},i.prototype.swapRows=function(t,n){if(!(de(t)&&tu(t)&&de(n)&&tu(n)))throw new Error("Row index must be positive integers");if(2!==this._size.length)throw new Error("Only two dimensional matrix is supported");return ku(t,this._size[0]),ku(n,this._size[0]),i._swapRows(t,n,this._size[1],this._values,this._index,this._ptr),this},i._forEachRow=function(t,n,e,r,i){for(var u=r[t],o=r[t+1],M=u;M<o;M++)i(e[M],n[M])},i._swapRows=function(t,n,e,r,i,u){for(var o=0;o<e;o++){var M=u[o],N=u[o+1],a=c(t,M,N,i),s=c(n,M,N,i);if(a<N&&s<N&&i[a]===t&&i[s]===n){if(r){var D=r[a];r[a]=r[s],r[s]=D}}else if(a<N&&i[a]===t&&(s>=N||i[s]!==n)){var T=r?r[a]:void 0;i.splice(s,0,n),r&&r.splice(s,0,T),i.splice(s<=a?a+1:a,1),r&&r.splice(s<=a?a+1:a,1)}else if(s<N&&i[s]===n&&(a>=N||i[a]!==t)){var g=r?r[s]:void 0;i.splice(a,0,t),r&&r.splice(a,0,g),i.splice(a<=s?s+1:s,1),r&&r.splice(a<=s?s+1:s,1)}}},i},{isClass:!0});Ju("bin",["typed","format"],t=>{var{typed:n,format:e}=t;return n("bin",{"number | BigNumber":function(t){return e(t,{notation:"bin"})},"number | BigNumber, number | BigNumber":function(t,n){return e(t,{notation:"bin",wordSize:n})}})});var WM=Ju("matrix",["typed","Matrix","DenseMatrix","SparseMatrix"],t=>{var{typed:n,Matrix:e,DenseMatrix:r,SparseMatrix:i}=t;return n("matrix",{"":function(){return u([])},string:function(t){return u([],t)},"string, string":function(t,n){return u([],t,n)},Array:function(t){return u(t)},Matrix:function(t){return u(t,t.storage())},"Array | Matrix, string":u,"Array | Matrix, string, string":u});function u(t,n,e){if("dense"===n||"default"===n||void 0===n)return new r(t,e);if("sparse"===n)return new i(t,e);throw new TypeError("Unknown matrix type "+JSON.stringify(n)+".")}});function GM(){throw new Error('No "matrix" implementation available')}var PM=Ju("size",["typed","config","?matrix"],t=>{var{typed:n,config:e,matrix:r}=t;return n("size",{Matrix:function(t){return t.create(t.size())},Array:Lu,string:function(t){return"Array"===e.matrix?[t.length]:r([t.length])},"number | Complex | BigNumber | Unit | boolean | null":function(t){return"Array"===e.matrix?[]:r?r([]):GM()}})}),JM=Ju("matAlgo11xS0s",["typed","equalScalar"],t=>{var{typed:n,equalScalar:e}=t;return function(t,r,i,u){var o=t._values,M=t._index,c=t._ptr,N=t._size,a=t._datatype;if(!o)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var s,D=N[0],T=N[1],g=e,l=0,I=i;"string"==typeof a&&(s=a,g=n.find(e,[s,s]),l=n.convert(0,s),r=n.convert(r,s),I=n.find(i,[s,s]));for(var y=[],h=[],j=[],x=0;x<T;x++){j[x]=h.length;for(var z=c[x],O=c[x+1],E=z;E<O;E++){var A=M[E],f=u?I(r,o[E]):I(o[E],r);g(f,l)||(h.push(A),y.push(f))}}return j[T]=h.length,t.createSparseMatrix({values:y,index:h,ptr:j,size:[D,T],datatype:s})}}),HM=Ju("matAlgo14xDs",["typed"],t=>{var{typed:n}=t;return function(t,e,r,i){var u,o=t._data,M=t._size,c=t._datatype,N=r;"string"==typeof c&&(u=c,e=n.convert(e,u),N=n.find(r,[u,u]));var a=M.length>0?function t(n,e,r,i,u,o,M){var c=[];if(e===r.length-1)for(var N=0;N<i;N++)c[N]=M?n(o,u[N]):n(u[N],o);else for(var a=0;a<i;a++)c[a]=t(n,e+1,r,r[e+1],u[a],o,M);return c}(N,0,M,M[0],o,e,i):[];return t.createDenseMatrix({data:a,size:gr(M),datatype:u})}});Ju("equal",["typed","equalScalar"],t=>{var{typed:n,equalScalar:e}=t;return n("equal",{"any, any":function(t,n){return null===t?null===n:null===n?null===t:void 0===t?void 0===n:void 0===n?void 0===t:e(t,n)}})});var KM=Ju("ones",["typed","config","matrix","BigNumber"],t=>{var{typed:n,config:e,matrix:r,BigNumber:i}=t;return n("ones",{"":function(){return"Array"===e.matrix?u([]):u([],"default")},"...number | BigNumber | string":function(t){if("string"==typeof t[t.length-1]){var n=t.pop();return u(t,n)}return"Array"===e.matrix?u(t):u(t,"default")},Array:u,Matrix:function(t){var n=t.storage();return u(t.valueOf(),n)},"Array | Matrix, string":function(t,n){return u(t.valueOf(),n)}});function u(t,n){var e=function(t){var n=!1;return t.forEach((function(t,e,r){Ce(t)&&(n=!0,r[e]=t.toNumber())})),n}(t)?new i(1):1;if(function(t){t.forEach((function(t){if("number"!=typeof t||!tu(t)||t<0)throw new Error("Parameters in function ones must be positive integers")}))}(t),n){var u=r(n);return t.length>0?u.resize(t,e):u}var o=[];return t.length>0?vu(o,t,e):o}});function XM(t,n,e,r){if(!(this instanceof XM))throw new SyntaxError("Constructor must be called with the new operator");this.fn=t,this.count=n,this.min=e,this.max=r,this.message="Wrong number of arguments in function "+t+" ("+n+" provided, "+e+(null!=r?"-"+r:"")+" expected)",this.stack=(new Error).stack}XM.prototype=new Error,XM.prototype.constructor=Error,XM.prototype.name="ArgumentsError",XM.prototype.isArgumentsError=!0;Ju("unequal",["typed","equalScalar"],t=>{var{typed:n,equalScalar:e}=t;return n("unequal",{"any, any":function(t,n){return null===t?null!==n:null===n?null!==t:void 0===t?void 0!==n:void 0===n?void 0!==t:!e(t,n)}})});Cu.signature="any, any";var qM=Ju("dot",["typed","addScalar","multiplyScalar","conj","size"],t=>{var{typed:n,addScalar:e,multiplyScalar:r,conj:i,size:u}=t;return n("dot",{"Array | DenseMatrix, Array | DenseMatrix":function(t,u){var c=o(t,u),N=ve(t)?t._data:t,a=ve(t)?t._datatype||t.getDataType():void 0,s=ve(u)?u._data:u,D=ve(u)?u._datatype||u.getDataType():void 0,T=2===M(t).length,g=2===M(u).length,l=e,I=r;if(a&&D&&a===D&&"string"==typeof a&&"mixed"!==a){var y=a;l=n.find(e,[y,y]),I=n.find(r,[y,y])}if(!T&&!g){for(var h=I(i(N[0]),s[0]),j=1;j<c;j++)h=l(h,I(i(N[j]),s[j]));return h}if(!T&&g){for(var x=I(i(N[0]),s[0][0]),z=1;z<c;z++)x=l(x,I(i(N[z]),s[z][0]));return x}if(T&&!g){for(var O=I(i(N[0][0]),s[0]),E=1;E<c;E++)O=l(O,I(i(N[E][0]),s[E]));return O}if(T&&g){for(var A=I(i(N[0][0]),s[0][0]),f=1;f<c;f++)A=l(A,I(i(N[f][0]),s[f][0]));return A}},"SparseMatrix, SparseMatrix":function(t,n){o(t,n);var i=t._index,u=t._values,M=n._index,c=n._values,N=0,a=e,s=r,D=0,T=0;for(;D<i.length&&T<M.length;){var g=i[D],l=M[T];g<l?D++:g>l?T++:g===l&&(N=a(N,s(u[D],c[T])),D++,T++)}return N}});function o(t,n){var e,r,i=M(t),u=M(n);if(1===i.length)e=i[0];else{if(2!==i.length||1!==i[1])throw new RangeError("Expected a column vector, instead got a matrix of size ("+i.join(", ")+")");e=i[0]}if(1===u.length)r=u[0];else{if(2!==u.length||1!==u[1])throw new RangeError("Expected a column vector, instead got a matrix of size ("+u.join(", ")+")");r=u[0]}if(e!==r)throw new RangeError("Vectors must have equal length ("+e+" != "+r+")");if(0===e)throw new RangeError("Cannot calculate the dot product of empty vectors");return e}function M(t){return ve(t)?t.size():u(t)}}),_M="number | BigNumber | Fraction | Matrix | Array";"".concat(_M,", ").concat(_M,", ...").concat(_M);var $M=Ju("multiply",["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],t=>{var{typed:n,matrix:e,addScalar:r,multiplyScalar:i,equalScalar:u,dot:o}=t,M=JM({typed:n,equalScalar:u}),c=HM({typed:n});function N(t,n){switch(t.length){case 1:switch(n.length){case 1:if(t[0]!==n[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(t[0]!==n[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+t[0]+") must match Matrix rows ("+n[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+n.length+" dimensions)")}break;case 2:switch(n.length){case 1:if(t[1]!==n[0])throw new RangeError("Dimension mismatch in multiplication. Matrix columns ("+t[1]+") must match Vector length ("+n[0]+")");break;case 2:if(t[1]!==n[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+t[1]+") must match Matrix B rows ("+n[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+n.length+" dimensions)")}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+t.length+" dimensions)")}}function a(t,e){if("dense"!==e.storage())throw new Error("Support for SparseMatrix not implemented");return function(t,e){var u,o=t._data,M=t._size,c=t._datatype||t.getDataType(),N=e._data,a=e._size,s=e._datatype||e.getDataType(),D=M[0],T=a[1],g=r,l=i;c&&s&&c===s&&"string"==typeof c&&"mixed"!==c&&(u=c,g=n.find(r,[u,u]),l=n.find(i,[u,u]));for(var I=[],y=0;y<T;y++){for(var h=l(o[0],N[0][y]),j=1;j<D;j++)h=g(h,l(o[j],N[j][y]));I[y]=h}return t.createDenseMatrix({data:I,size:[T],datatype:c===t._datatype&&s===e._datatype?u:void 0})}(t,e)}var s=n("_multiplyMatrixVector",{"DenseMatrix, any":function(t,e){var u,o=t._data,M=t._size,c=t._datatype||t.getDataType(),N=e._data,a=e._datatype||e.getDataType(),s=M[0],D=M[1],T=r,g=i;c&&a&&c===a&&"string"==typeof c&&"mixed"!==c&&(u=c,T=n.find(r,[u,u]),g=n.find(i,[u,u]));for(var l=[],I=0;I<s;I++){for(var y=o[I],h=g(y[0],N[0]),j=1;j<D;j++)h=T(h,g(y[j],N[j]));l[I]=h}return t.createDenseMatrix({data:l,size:[s],datatype:c===t._datatype&&a===e._datatype?u:void 0})},"SparseMatrix, any":function(t,e){var o=t._values,M=t._index,c=t._ptr,N=t._datatype||void 0===t._data?t._datatype:t.getDataType();if(!o)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var a,s=e._data,D=e._datatype||e.getDataType(),T=t._size[0],g=e._size[0],l=[],I=[],y=[],h=r,j=i,x=u,z=0;N&&D&&N===D&&"string"==typeof N&&"mixed"!==N&&(a=N,h=n.find(r,[a,a]),j=n.find(i,[a,a]),x=n.find(u,[a,a]),z=n.convert(0,a));var O=[],E=[];y[0]=0;for(var A=0;A<g;A++){var f=s[A];if(!x(f,z))for(var p=c[A],U=c[A+1],d=p;d<U;d++){var C=M[d];E[C]?O[C]=h(O[C],j(f,o[d])):(E[C]=!0,I.push(C),O[C]=j(f,o[d]))}}for(var Q=I.length,w=0;w<Q;w++){var L=I[w];l[w]=O[L]}return y[1]=I.length,t.createSparseMatrix({values:l,index:I,ptr:y,size:[T,1],datatype:N===t._datatype&&D===e._datatype?a:void 0})}}),D=n("_multiplyMatrixMatrix",{"DenseMatrix, DenseMatrix":function(t,e){var u,o=t._data,M=t._size,c=t._datatype||t.getDataType(),N=e._data,a=e._size,s=e._datatype||e.getDataType(),D=M[0],T=M[1],g=a[1],l=r,I=i;c&&s&&c===s&&"string"==typeof c&&"mixed"!==c&&"mixed"!==c&&(u=c,l=n.find(r,[u,u]),I=n.find(i,[u,u]));for(var y=[],h=0;h<D;h++){var j=o[h];y[h]=[];for(var x=0;x<g;x++){for(var z=I(j[0],N[0][x]),O=1;O<T;O++)z=l(z,I(j[O],N[O][x]));y[h][x]=z}}return t.createDenseMatrix({data:y,size:[D,g],datatype:c===t._datatype&&s===e._datatype?u:void 0})},"DenseMatrix, SparseMatrix":function(t,e){var o=t._data,M=t._size,c=t._datatype||t.getDataType(),N=e._values,a=e._index,s=e._ptr,D=e._size,T=e._datatype||void 0===e._data?e._datatype:e.getDataType();if(!N)throw new Error("Cannot multiply Dense Matrix times Pattern only Matrix");var g,l=M[0],I=D[1],y=r,h=i,j=u,x=0;c&&T&&c===T&&"string"==typeof c&&"mixed"!==c&&(g=c,y=n.find(r,[g,g]),h=n.find(i,[g,g]),j=n.find(u,[g,g]),x=n.convert(0,g));for(var z=[],O=[],E=[],A=e.createSparseMatrix({values:z,index:O,ptr:E,size:[l,I],datatype:c===t._datatype&&T===e._datatype?g:void 0}),f=0;f<I;f++){E[f]=O.length;var p=s[f],U=s[f+1];if(U>p)for(var d=0,C=0;C<l;C++){for(var Q=C+1,w=void 0,L=p;L<U;L++){var S=a[L];d!==Q?(w=h(o[C][S],N[L]),d=Q):w=y(w,h(o[C][S],N[L]))}d!==Q||j(w,x)||(O.push(C),z.push(w))}}return E[I]=O.length,A},"SparseMatrix, DenseMatrix":function(t,e){var o=t._values,M=t._index,c=t._ptr,N=t._datatype||void 0===t._data?t._datatype:t.getDataType();if(!o)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var a,s=e._data,D=e._datatype||e.getDataType(),T=t._size[0],g=e._size[0],l=e._size[1],I=r,y=i,h=u,j=0;N&&D&&N===D&&"string"==typeof N&&"mixed"!==N&&(a=N,I=n.find(r,[a,a]),y=n.find(i,[a,a]),h=n.find(u,[a,a]),j=n.convert(0,a));for(var x=[],z=[],O=[],E=t.createSparseMatrix({values:x,index:z,ptr:O,size:[T,l],datatype:N===t._datatype&&D===e._datatype?a:void 0}),A=[],f=[],p=0;p<l;p++){O[p]=z.length;for(var U=p+1,d=0;d<g;d++){var C=s[d][p];if(!h(C,j))for(var Q=c[d],w=c[d+1],L=Q;L<w;L++){var S=M[L];f[S]!==U?(f[S]=U,z.push(S),A[S]=y(C,o[L])):A[S]=I(A[S],y(C,o[L]))}}for(var k=O[p],v=z.length,Y=k;Y<v;Y++){var m=z[Y];x[Y]=A[m]}}return O[l]=z.length,E},"SparseMatrix, SparseMatrix":function(t,e){var u,o=t._values,M=t._index,c=t._ptr,N=t._datatype||void 0===t._data?t._datatype:t.getDataType(),a=e._values,s=e._index,D=e._ptr,T=e._datatype||void 0===e._data?e._datatype:e.getDataType(),g=t._size[0],l=e._size[1],I=o&&a,y=r,h=i;N&&T&&N===T&&"string"==typeof N&&"mixed"!==N&&(u=N,y=n.find(r,[u,u]),h=n.find(i,[u,u]));for(var j,x,z,O,E,A,f,p,U=I?[]:void 0,d=[],C=[],Q=t.createSparseMatrix({values:U,index:d,ptr:C,size:[g,l],datatype:N===t._datatype&&T===e._datatype?u:void 0}),w=I?[]:void 0,L=[],S=0;S<l;S++){C[S]=d.length;var k=S+1;for(E=D[S],A=D[S+1],O=E;O<A;O++)if(p=s[O],I)for(x=c[p],z=c[p+1],j=x;j<z;j++)f=M[j],L[f]!==k?(L[f]=k,d.push(f),w[f]=h(a[O],o[j])):w[f]=y(w[f],h(a[O],o[j]));else for(x=c[p],z=c[p+1],j=x;j<z;j++)f=M[j],L[f]!==k&&(L[f]=k,d.push(f));if(I)for(var v=C[S],Y=d.length,m=v;m<Y;m++){var R=d[m];U[m]=w[R]}}return C[l]=d.length,Q}});return n("multiply",i,{"Array, Array":n.referTo("Matrix, Matrix",t=>(n,r)=>{N(Lu(n),Lu(r));var i=t(e(n),e(r));return ve(i)?i.valueOf():i}),"Matrix, Matrix":function(t,n){var e=t.size(),r=n.size();return N(e,r),1===e.length?1===r.length?function(t,n,e){if(0===e)throw new Error("Cannot multiply two empty vectors");return o(t,n)}(t,n,e[0]):a(t,n):1===r.length?s(t,n):D(t,n)},"Matrix, Array":n.referTo("Matrix,Matrix",t=>(n,r)=>t(n,e(r))),"Array, Matrix":n.referToSelf(t=>(n,r)=>t(e(n,r.storage()),r)),"SparseMatrix, any":function(t,n){return M(t,n,i,!1)},"DenseMatrix, any":function(t,n){return c(t,n,i,!1)},"any, SparseMatrix":function(t,n){return M(n,t,i,!0)},"any, DenseMatrix":function(t,n){return c(n,t,i,!0)},"Array, any":function(t,n){return c(e(t),n,i,!1).valueOf()},"any, Array":function(t,n){return c(e(n),t,i,!0).valueOf()},"any, any":i,"any, any, ...any":n.referToSelf(t=>(n,e,r)=>{for(var i=t(n,e),u=0;u<r.length;u++)i=t(i,r[u]);return i})})});e(17);var tc=Ku({config:xr}),nc=_u({}),ec=Mo({}),rc=co({}),ic=No({Matrix:rc}),uc=fo({BigNumber:tc,Complex:nc,DenseMatrix:ic,Fraction:ec}),oc=DM({typed:uc}),Mc=EM({typed:uc}),cc=pM({config:xr,typed:uc}),Nc=YM({typed:uc}),ac=VM({Matrix:rc,equalScalar:cc,typed:uc}),sc=WM({DenseMatrix:ic,Matrix:rc,SparseMatrix:ac,typed:uc}),Dc=PM({matrix:sc,config:xr,typed:uc}),Tc=KM({BigNumber:tc,config:xr,matrix:sc,typed:uc}),gc=qM({addScalar:oc,conj:Mc,multiplyScalar:Nc,size:Dc,typed:uc}),lc=$M({addScalar:oc,dot:gc,equalScalar:cc,matrix:sc,multiplyScalar:Nc,typed:uc});function Ic(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,u=Ee()(t);if(n&&e){var o=Oc(t),M=xc(o,e,n),c=hc(t,M);u=Ee()(c).pop()}if(r&&i){var N=[].concat(u).reverse(),a=Oc(N),s=xc(a,i,r),D=1-s,T=hc(u,D);u=T[0]}return u}function yc(t,n){var e=t.x-n.x,r=t.y-n.y;return Math.sqrt(e*e+r*r)}function hc(t,n){switch(t.length){case 2:return function(t,n){var e=jc(t,n);return[[t[0],e],[e,Ee()(t).pop()]]}(t,n);case 3:return function(t,n){var e=[t[0],t[1]],r=[t[1],t[2]],i=jc(e,n),u=jc(r,n),o=jc([i,u],n);return[[t[0],i,o],[o,u,t[2]]]}(t,n);case 4:return function(t,n){var e=[t[0],t[1]],r=[t[1],t[2]],i=[t[2],t[3]],u=jc(e,n),o=jc(r,n),M=jc(i,n),c=jc([u,o],n),N=jc([o,M],n),a=jc([c,N],n);return[[t[0],u,c,a],[a,N,M,t[3]]]}(t,n);default:return null}}function jc(t,n){var e=je()(t,1)[0],r=Ee()(t).pop(),i=e.x+(r.x-e.x)*n;return{y:e.y+(r.y-e.y)*n,x:i}}function xc(t,n,e){for(var r=t.size(),i=function(t){switch(t){case 1:return lc(zc(1e3,1),sc([[1,0],[-1,1]]));case 2:return lc(zc(1e3,2),sc([[1,0,0],[-2,2,0],[1,-2,1]]));case 3:return lc(zc(1e3,3),sc([[1,0,0,0],[-3,3,0,0],[3,-6,3,0],[-1,3,-3,1]]));default:return null}}(je()(r,1)[0]-1),u=function(t,n){var e=-t.x,r=-t.y,i=[],u=[];n.forEach((function(t,n){switch(je()(n,2)[1]){case 0:i.push(t+e);break;case 1:u.push(t+r)}}));for(var o=[],M=0;M<i.length;M++)o.push(Math.sqrt(i[M]*i[M]+u[M]*u[M]));return o}(n,lc(i,t)),o=u.length-1,M=0;M<u.length;M++)if(u[M]>=e){o=M;break}return.001*o}function zc(t,n){var e=1/t,r=0,i=Tc(t+1,n+1).map((function(t,n){var i=null;switch(je()(n,2)[1]){case 0:i=1;break;case 1:i=r;break;case 2:i=r*r;break;case 3:i=r*r*r}return r+=e,i}));return sc(i)}function Oc(t){var n=t.map((function(t){return[t.x,t.y]}));return sc(n)}function Ec(t){if(3===t.length)throw new Error("bezierBoundingBox function supports only linear and cubic bezier curves for now");var n,e,r,i,u,o,M=2===t.length?(n=t,e=je()(n,2),r=e[0],i=e[1],u=[r.x,i.x],o=[r.y,i.y],{min:{x:Math.min.apply(0,u),y:Math.min.apply(0,o)},max:{x:Math.max.apply(0,u),y:Math.max.apply(0,o)}}):function(t){for(var n,e,r,i,u,o,M,c,N=je()(t,4),a=N[0],s=N[1],D=N[2],T=N[3],g=[],l=[],I=[],y=0;y<2;++y)if(0===y?(e=6*a.x-12*s.x+6*D.x,n=-3*a.x+9*s.x-9*D.x+3*T.x,r=3*s.x-3*a.x):(e=6*a.y-12*s.y+6*D.y,n=-3*a.y+9*s.y-9*D.y+3*T.y,r=3*s.y-3*a.y),Math.abs(n)<1e-12){if(Math.abs(e)<1e-12)continue;(i=-r/e)>0&&i<1&&g.push(i)}else(M=e*e-4*r*n)<0?Math.abs(M)<1e-12&&(i=-e/(2*n))>0&&i<1&&g.push(i):(c=Math.sqrt(M),(u=(-e+c)/(2*n))>0&&u<1&&g.push(u),(o=(-e-c)/(2*n))>0&&o<1&&g.push(o));var h,j=g.length;for(;j--;)i=g[j],h=1-i,l[j]=h*h*h*a.x+3*h*h*i*s.x+3*h*i*i*D.x+i*i*i*T.x,I[j]=h*h*h*a.y+3*h*h*i*s.y+3*h*i*i*D.y+i*i*i*T.y;return l.push(a.x,T.x),I.push(a.y,T.y),{min:{x:Math.min.apply(0,l),y:Math.min.apply(0,I)},max:{x:Math.max.apply(0,l),y:Math.max.apply(0,I)}}}(t),c=2===t.length?1:0;return[{x:M.min.x,y:M.min.y-c},{x:M.max.x,y:M.min.y-c},{x:M.max.x,y:M.max.y+c},{x:M.min.x,y:M.max.y+c}]}var Ac=e(3),fc=e.n(Ac),pc=e(0),Uc=e.n(pc),dc=e(4),Cc=e.n(dc),Qc=function(){function t(n){pt()(this,t),Qt()(this,"ctx",void 0),Qt()(this,"playData",void 0),Qt()(this,"options",void 0),Qt()(this,"courtTypeConstants",void 0),this.ctx=n.ctx,this.playData=n.playData,this.options=n.options?n.options:{},this.courtTypeConstants=n.courtTypeConstants}return dt()(t,[{key:"apply",value:function(){this.ctx.save(),this.drawLogic(),this.ctx.restore()}},{key:"drawLogic",value:function(){}}]),t}();function wc(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Lc=function(t){Cc()(e,t);var n=wc(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"apply",value:function(){this.original()&&(this.ctx.save(),this.drawLogic(),this.ctx.restore()),this.reflection()&&(this.ctx.save(),this.verticalFlipAndRotation(),this.drawLogic(),this.ctx.restore())}},{key:"original",value:function(){return!0}},{key:"reflection",value:function(){return!1}},{key:"verticalFlipAndRotation",value:function(){var t=this.courtTypeConstants.COURT_RECT_HEIGHT;this.ctx.scale(1,-1),this.ctx.translate(0,-Math.abs(t))}},{key:"setColor",value:function(t){var n="transparent"===this.options.lineColor?"transparent":t;this.ctx.strokeStyle=n,this.ctx.fillStyle=n}},{key:"courtCenter",get:function(){return{x:this.courtTypeConstants.COURT_RECT_WIDTH/2,y:this.courtTypeConstants.COURT_RECT_HEIGHT/2}}}]),e}(Qc);function Sc(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var kc=function(t){Cc()(e,t);var n=Sc(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.rect(0,0,this.courtTypeConstants.COURT_RECT_WIDTH,this.courtTypeConstants.COURT_RECT_HEIGHT),this.ctx.stroke()}}]),e}(Lc),vc=.1667,Yc=1.5,mc=2.4,Rc=.55,Fc=!1,bc=480,Zc=460,Bc="#C49463",Vc=60.5,Wc=127.28125,Gc=60,Pc=1.41667,Jc=26,Hc=.5,Kc=4,Xc=6,qc=5,_c=3.58333,$c=5,tN=37,nN=15,eN=20,rN=5,iN=2,uN=.5,oN=1.5,MN=18,cN=95,NN=390,aN=330,sN=90,DN=2.5,TN=13;function gN(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var lN=function(t){Cc()(e,t);var n=gN(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:Gc},n={x:this.courtCenter.x,y:Gc+Vc},e="transparent"===this.options.lineColor?"transparent":Bc;this.ctx.fillStyle=e,this.ctx.strokeStyle=e;var r=Math.PI/11,i=Math.PI-Math.PI/11;this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(n.x,n.y,cN,r,i,!1);var u=IN(n,cN,i),o=IN(n,cN,r);this.ctx.moveTo(u.x,u.y),this.ctx.lineTo(t.x,t.y-Math.sqrt(18)),this.ctx.lineTo(o.x,o.y),this.ctx.lineTo(u.x,u.y),this.ctx.translate(t.x,t.y),this.ctx.rotate(Math.PI/4),this.ctx.moveTo(3,3),this.ctx.lineTo(3,sN-3),this.ctx.lineTo(sN-3,sN-3),this.ctx.lineTo(sN-3,3),this.ctx.lineTo(3,3),this.ctx.fill(),this.ctx.restore(),this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(n.x,n.y-oN,MN/2,0,2*Math.PI,!0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore(),this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(t.x,t.y,Jc/2,0,2*Math.PI,!0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore(),this.ctx.save(),this.ctx.translate(t.x,t.y),this.ctx.rotate(Math.PI/4),this.ctx.beginPath(),this.ctx.arc(sN,0,TN,Math.PI/4,Math.PI+Math.PI/20,!1),this.ctx.stroke(),this.ctx.fill(),this.ctx.beginPath(),this.ctx.arc(sN,sN,TN,0,2*Math.PI,!0),this.ctx.stroke(),this.ctx.fill(),this.ctx.beginPath(),this.ctx.arc(0,sN,TN,Math.PI/4,Math.PI+Math.PI/2.2,!0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(Lc);function IN(t,n,e){return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}}function yN(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var hN=function(t){Cc()(e,t);var n=yN(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this,n={x:this.courtCenter.x,y:Gc};this.ctx.lineWidth=3*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.save(),this.ctx.translate(n.x,n.y),this.ctx.rotate(Math.PI/4),this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(sN,0),this.ctx.stroke(),this.drawBaseSquare(sN,0),this.drawBaseSquare(sN+DN/2,sN-DN/2),this.drawBaseSquare(DN,sN-DN),this.ctx.beginPath(),this.ctx.lineTo(0,0),this.ctx.stroke(),this.ctx.restore(),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(n.x,n.y),t.ctx.rotate(e*(Math.PI/4)),t.ctx.beginPath(),t.ctx.moveTo(0,0),t.ctx.lineTo(e*aN,0),t.ctx.stroke(),t.ctx.restore()}));var e=Math.PI/8.1,r=Math.PI-Math.PI/8.1;this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(n.x,n.y+138,NN-138,e,r,!1),this.ctx.stroke(),this.ctx.restore()}},{key:"drawBaseSquare",value:function(t,n){this.ctx.save(),this.ctx.lineCap="square",this.ctx.beginPath(),this.ctx.translate(t,n),this.ctx.moveTo(0,0),this.ctx.lineTo(0,DN),this.ctx.lineTo(-DN,DN),this.ctx.lineTo(-DN,0),this.ctx.lineTo(0,0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(Lc);function jN(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var xN=function(t){Cc()(e,t);var n=jN(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this,n={x:this.courtCenter.x,y:Gc},e={x:n.x-Pc/2,y:n.y+Pc},r={x:n.x+Pc/2,y:n.y+Pc};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(r.x,r.y),this.ctx.lineTo(r.x,r.y-Pc/2),this.ctx.lineTo(n.x,n.y),this.ctx.lineTo(e.x,e.y-Pc/2),this.ctx.lineTo(e.x,e.y),this.ctx.stroke(),this.ctx.fill(),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(n.x,n.y+Pc/2),t.ctx.beginPath();var r=Pc/2+Hc;t.ctx.moveTo(e*r,0),t.ctx.lineTo(e*r,Pc/2),t.ctx.lineTo(e*(r+Kc),Pc/2),t.ctx.lineTo(e*(r+Kc),Pc/2-Xc),t.ctx.lineTo(e*r,Pc/2-Xc),t.ctx.lineTo(e*r,0),t.ctx.lineTo(e*r,0),t.ctx.stroke(),t.ctx.restore()}));var i=n.y+Pc/2-Xc+Pc/2;[-1,1].forEach((function(n){t.ctx.save(),t.ctx.translate(t.courtCenter.x,i-qc),t.ctx.beginPath(),t.ctx.moveTo(0,0),t.ctx.lineTo(n*(_c/2),0),t.ctx.lineTo(n*(_c/2),qc),t.ctx.stroke(),t.ctx.restore()})),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(t.courtCenter.x,n.y-Jc/2),t.ctx.beginPath(),t.ctx.arc(e*tN,0,$c/2,0,2*Math.PI,!0),t.ctx.stroke(),t.ctx.restore()})),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(n.x,n.y),t.ctx.rotate(e*(Math.PI/4)),t.ctx.beginPath(),t.ctx.moveTo(e*sN,-(nN+rN)),t.ctx.lineTo(e*sN,-nN),t.ctx.lineTo(e*(sN-eN),-nN),t.ctx.lineTo(e*(sN-eN),-(nN+rN)),t.ctx.stroke(),t.ctx.restore()}))}}]),e}(Lc);function zN(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var ON=function(t){Cc()(e,t);var n=zN(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:Gc+Vc};this.ctx.save(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.translate(t.x,t.y),this.ctx.moveTo(0,0),this.ctx.lineTo(iN/2,0),this.ctx.lineTo(iN/2,uN),this.ctx.lineTo(-iN/2,uN),this.ctx.lineTo(-iN/2,0),this.ctx.lineTo(0,0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(Lc);function EN(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var AN=function(t){Cc()(e,t);var n=EN(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.rect(0,0,this.courtTypeConstants.COURT_RECT_WIDTH,this.courtTypeConstants.COURT_RECT_HEIGHT),this.ctx.stroke()}}]),e}(Lc),fN=.1667,pN=1.5,UN=2.4,dN=.55,CN=!1,QN=280,wN=260,LN="#C49463",SN="#E4CCB7",kN=43,vN=127.28125,YN=25,mN=1.41667,RN=26,FN=.5,bN=4,ZN=6,BN=5,VN=3.58333,WN=5,GN=37,PN=8,JN=15,HN=3,KN=5,XN=1,qN=0,_N=16,$N=60,ta=220,na=190,ea=60,ra=2.5,ia=13;function ua(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var oa=function(t){Cc()(e,t);var n=ua(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:YN},n={x:this.courtCenter.x,y:YN+kN},e="transparent"===this.options.lineColor?"transparent":LN;this.ctx.fillStyle=e,this.ctx.strokeStyle=e;var r=Math.PI/15,i=Math.PI-Math.PI/15;this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(n.x,n.y,$N,r,i,!1);var u=Ma(n,$N,i),o=Ma(n,$N,r);this.ctx.moveTo(u.x,u.y),this.ctx.lineTo(t.x,t.y-Math.sqrt(18)),this.ctx.lineTo(o.x,o.y),this.ctx.lineTo(u.x,u.y),this.ctx.fill(),this.ctx.restore(),this.ctx.save(),this.ctx.strokeStyle="transparent"===this.options.lineColor?"transparent":"#FFFFFF",this.ctx.fillStyle="transparent"===this.options.lineColor?"transparent":SN,this.ctx.beginPath(),this.ctx.arc(n.x,n.y-qN,_N/2,0,2*Math.PI,!0),this.ctx.fill(),this.ctx.stroke(),this.ctx.restore(),this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(t.x,t.y,RN/2,0,2*Math.PI,!0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(Lc);function Ma(t,n,e){return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}}function ca(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Na=function(t){Cc()(e,t);var n=ca(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this,n={x:this.courtCenter.x,y:YN};this.ctx.lineWidth=3*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.save(),this.ctx.translate(n.x,n.y),this.ctx.rotate(Math.PI/4),this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(ea,0),this.ctx.stroke(),this.drawBaseSquare(ea,0),this.drawBaseSquare(ea+ra/2,ea-ra/2),this.drawBaseSquare(ra,ea-ra),this.ctx.beginPath(),this.ctx.lineTo(0,0),this.ctx.stroke(),this.ctx.restore(),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(n.x,n.y),t.ctx.rotate(e*(Math.PI/4)),t.ctx.beginPath(),t.ctx.moveTo(0,0),t.ctx.lineTo(e*na,0),t.ctx.stroke(),t.ctx.restore()}));var e=Math.PI/7.8,r=Math.PI-Math.PI/7.8;this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(n.x,n.y+77,ta-77+3,e,r,!1),this.ctx.stroke(),this.ctx.restore()}},{key:"drawBaseSquare",value:function(t,n){this.ctx.save(),this.ctx.lineCap="square",this.ctx.beginPath(),this.ctx.translate(t,n),this.ctx.moveTo(0,0),this.ctx.lineTo(0,ra),this.ctx.lineTo(-ra,ra),this.ctx.lineTo(-ra,0),this.ctx.lineTo(0,0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(Lc);function aa(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var sa=function(t){Cc()(e,t);var n=aa(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this,n={x:this.courtCenter.x,y:YN},e={x:n.x-mN/2,y:n.y+mN},r={x:n.x+mN/2,y:n.y+mN};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(r.x,r.y),this.ctx.lineTo(r.x,r.y-mN/2),this.ctx.lineTo(n.x,n.y),this.ctx.lineTo(e.x,e.y-mN/2),this.ctx.lineTo(e.x,e.y),this.ctx.stroke(),this.ctx.fill(),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(n.x,n.y+mN/2),t.ctx.beginPath();var r=mN/2+FN;t.ctx.moveTo(e*r,0),t.ctx.lineTo(e*r,mN/2),t.ctx.lineTo(e*(r+bN),mN/2),t.ctx.lineTo(e*(r+bN),mN/2-ZN),t.ctx.lineTo(e*r,mN/2-ZN),t.ctx.lineTo(e*r,0),t.ctx.lineTo(e*r,0),t.ctx.stroke(),t.ctx.restore()}));var i=n.y+mN/2-ZN+mN/2;[-1,1].forEach((function(n){t.ctx.save(),t.ctx.translate(t.courtCenter.x,i-BN),t.ctx.beginPath(),t.ctx.moveTo(0,0),t.ctx.lineTo(n*(VN/2),0),t.ctx.lineTo(n*(VN/2),BN),t.ctx.stroke(),t.ctx.restore()})),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(t.courtCenter.x,n.y-RN/2),t.ctx.beginPath(),t.ctx.arc(e*GN,0,WN/2,0,2*Math.PI,!0),t.ctx.stroke(),t.ctx.restore()})),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(n.x,n.y),t.ctx.rotate(e*(Math.PI/4)),t.ctx.beginPath(),t.ctx.moveTo(e*ea,-(PN+HN)),t.ctx.lineTo(e*ea,-PN),t.ctx.lineTo(e*(ea-JN),-PN),t.ctx.lineTo(e*(ea-JN),-(PN+HN)),t.ctx.stroke(),t.ctx.restore()}))}}]),e}(Lc);function Da(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Ta=function(t){Cc()(e,t);var n=Da(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:YN+kN-XN/2};this.ctx.save(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.translate(t.x,t.y),this.ctx.moveTo(0,0),this.ctx.lineTo(KN/2,0),this.ctx.lineTo(KN/2,XN),this.ctx.lineTo(-KN/2,XN),this.ctx.lineTo(-KN/2,0),this.ctx.lineTo(0,0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(Lc),ga=300,la=260,Ia="#C49463",ya="#E4CCB7",ha=40,ja=127.28125,xa=25,za=1.41667,Oa=26,Ea=.5,Aa=4,fa=6,pa=5,Ua=3.58333,da=5,Ca=37,Qa=8,wa=15,La=3,Sa=5,ka=1,va=0,Ya=16,ma=60,Ra=225,Fa=200,ba=60,Za=2.5,Ba=13;function Va(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Wa=function(t){Cc()(e,t);var n=Va(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:xa},n={x:this.courtCenter.x,y:xa+ha},e="transparent"===this.options.lineColor?"transparent":Ia;this.ctx.fillStyle=e,this.ctx.strokeStyle=e;var r=Math.PI/13,i=Math.PI-Math.PI/13;this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(n.x,n.y,ma,r,i,!1);var u=Ga(n,ma,i),o=Ga(n,ma,r);this.ctx.moveTo(u.x,u.y),this.ctx.lineTo(t.x,t.y-Math.sqrt(18)),this.ctx.lineTo(o.x,o.y),this.ctx.lineTo(u.x,u.y),this.ctx.fill(),this.ctx.restore(),this.ctx.save(),this.ctx.strokeStyle="transparent"===this.options.lineColor?"transparent":"#FFFFFF",this.ctx.fillStyle="transparent"===this.options.lineColor?"transparent":ya,this.ctx.beginPath(),this.ctx.arc(n.x,n.y-va,Ya/2,0,2*Math.PI,!0),this.ctx.fill(),this.ctx.stroke(),this.ctx.restore(),this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(t.x,t.y,Oa/2,0,2*Math.PI,!0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(Lc);function Ga(t,n,e){return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}}function Pa(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Ja=function(t){Cc()(e,t);var n=Pa(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this,n={x:this.courtCenter.x,y:xa};this.ctx.lineWidth=3*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.save(),this.ctx.translate(n.x,n.y),this.ctx.rotate(Math.PI/4),this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(ba,0),this.ctx.stroke(),this.drawBaseSquare(ba,0),this.drawBaseSquare(ba+Za/2,ba-Za/2),this.drawBaseSquare(Za,ba-Za),this.ctx.beginPath(),this.ctx.lineTo(0,0),this.ctx.stroke(),this.ctx.restore(),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(n.x,n.y),t.ctx.rotate(e*(Math.PI/4)),t.ctx.beginPath(),t.ctx.moveTo(0,0),t.ctx.lineTo(e*Fa,0),t.ctx.stroke(),t.ctx.restore()}));var e=Math.PI/6.8,r=Math.PI-Math.PI/6.8;this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(n.x,n.y+71,Ra-71+4,e,r,!1),this.ctx.stroke(),this.ctx.restore()}},{key:"drawBaseSquare",value:function(t,n){this.ctx.save(),this.ctx.lineCap="square",this.ctx.beginPath(),this.ctx.translate(t,n),this.ctx.moveTo(0,0),this.ctx.lineTo(0,Za),this.ctx.lineTo(-Za,Za),this.ctx.lineTo(-Za,0),this.ctx.lineTo(0,0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(Lc);function Ha(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Ka=function(t){Cc()(e,t);var n=Ha(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this,n={x:this.courtCenter.x,y:xa},e={x:n.x-za/2,y:n.y+za},r={x:n.x+za/2,y:n.y+za};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(r.x,r.y),this.ctx.lineTo(r.x,r.y-za/2),this.ctx.lineTo(n.x,n.y),this.ctx.lineTo(e.x,e.y-za/2),this.ctx.lineTo(e.x,e.y),this.ctx.stroke(),this.ctx.fill(),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(n.x,n.y+za/2),t.ctx.beginPath();var r=za/2+Ea;t.ctx.moveTo(e*r,0),t.ctx.lineTo(e*r,za/2),t.ctx.lineTo(e*(r+Aa),za/2),t.ctx.lineTo(e*(r+Aa),za/2-fa),t.ctx.lineTo(e*r,za/2-fa),t.ctx.lineTo(e*r,0),t.ctx.lineTo(e*r,0),t.ctx.stroke(),t.ctx.restore()}));var i=n.y+za/2-fa+za/2;[-1,1].forEach((function(n){t.ctx.save(),t.ctx.translate(t.courtCenter.x,i-pa),t.ctx.beginPath(),t.ctx.moveTo(0,0),t.ctx.lineTo(n*(Ua/2),0),t.ctx.lineTo(n*(Ua/2),pa),t.ctx.stroke(),t.ctx.restore()})),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(t.courtCenter.x,n.y-Oa/2),t.ctx.beginPath(),t.ctx.arc(e*Ca,0,da/2,0,2*Math.PI,!0),t.ctx.stroke(),t.ctx.restore()})),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(n.x,n.y),t.ctx.rotate(e*(Math.PI/4)),t.ctx.beginPath(),t.ctx.moveTo(e*ba,-(Qa+La)),t.ctx.lineTo(e*ba,-Qa),t.ctx.lineTo(e*(ba-wa),-Qa),t.ctx.lineTo(e*(ba-wa),-(Qa+La)),t.ctx.stroke(),t.ctx.restore()}))}}]),e}(Lc);function Xa(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var qa=function(t){Cc()(e,t);var n=Xa(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:xa+ha-ka/2};this.ctx.save(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.translate(t.x,t.y),this.ctx.moveTo(0,0),this.ctx.lineTo(Sa/2,0),this.ctx.lineTo(Sa/2,ka),this.ctx.lineTo(-Sa/2,ka),this.ctx.lineTo(-Sa/2,0),this.ctx.lineTo(0,0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(Lc);function _a(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var $a=function(t){Cc()(e,t);var n=_a(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){if(this.courtTypeConstants.BENCH_MARKING){var t={x:this.courtCenter.x-11,y:0},n={x:this.courtCenter.x-11,y:.5},e={x:this.courtCenter.x+11,y:0},r={x:this.courtCenter.x+11,y:.5};this.ctx.beginPath(),this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(r.x,r.y),this.ctx.stroke()}}}]),e}(Lc);function ts(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var ns=function(t){Cc()(e,t);var n=ts(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=0,n=28,e=3,r=28,i={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:28},u={x:this.courtTypeConstants.COURT_RECT_WIDTH-3,y:28};this.ctx.beginPath(),this.ctx.moveTo(t,n),this.ctx.lineTo(e,r),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(i.x,i.y),this.ctx.lineTo(u.x,u.y),this.ctx.stroke()}}]),e}(Lc);function es(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var rs=function(t){Cc()(e,t);var n=es(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.rect(0,0,this.courtTypeConstants.COURT_RECT_WIDTH,this.courtTypeConstants.COURT_RECT_HEIGHT),this.ctx.stroke()}}]),e}(Lc);function is(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var us=function(t){Cc()(e,t);var n=is(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){if(this.options.showHalfCourtCircle){this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtCenter.y,6,0,2*Math.PI,!0),this.courtTypeConstants.CENTER_INNER_CIRCLE&&this.ctx.arc(this.courtCenter.x,this.courtCenter.y,2,0,2*Math.PI,!0),this.ctx.stroke()}}}]),e}(Lc);function os(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Ms=function(t){Cc()(e,t);var n=os(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){var t={x:0,y:this.courtCenter.y},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke()}}]),e}(Lc);function cs(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Ns=function(t){Cc()(e,t);var n=cs(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:19},n=this.courtTypeConstants.FREE_THROW_INNER_WIDTH/2;this.ctx.beginPath(),this.ctx.arc(t.x,t.y,n,0,Math.PI,!1),this.ctx.stroke(),this.courtTypeConstants.FREE_THROW_INNER_DASHED_CIRCLE&&(this.ctx.setLineDash([1,.5]),this.ctx.beginPath(),this.ctx.arc(t.x,t.y,n,0,Math.PI,!0),this.ctx.stroke())}}]),e}(Lc);function as(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var ss=function(t){Cc()(e,t);var n=as(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:5.25},n={x:t.x-3,y:4},e={x:t.x+3,y:4};this.ctx.beginPath(),this.ctx.moveTo(n.x,n.y),this.ctx.lineTo(e.x,e.y),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.arc(t.x,t.y,.75,0,2*Math.PI,!0),this.ctx.stroke()}}]),e}(Lc);function Ds(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Ts=function(t){Cc()(e,t);var n=Ds(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this.courtTypeConstants.FREE_THROW_INNER_WIDTH,n=this.courtTypeConstants.FREE_THROW_OUTER_WIDTH,e={x:this.courtCenter.x-t/2,y:0},r={x:this.courtCenter.x-n/2,y:0};this.ctx.beginPath(),this.ctx.rect(e.x,e.y,t,19),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.rect(r.x,r.y,n,19),this.ctx.stroke()}}]),e}(Lc);function gs(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var ls=function(t){Cc()(e,t);var n=gs(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:5.25},n={x:this.courtCenter.x+4,y:4},e={x:this.courtCenter.x+4,y:5.25},r={x:this.courtCenter.x-4,y:4};this.ctx.beginPath(),this.ctx.moveTo(n.x,n.y),this.ctx.lineTo(e.x,e.y),this.ctx.arc(t.x,t.y,4,0,Math.PI,!1),this.ctx.lineTo(r.x,r.y),this.ctx.stroke()}}]),e}(Lc);function Is(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var ys=function(t){Cc()(e,t);var n=Is(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this.courtCenter.x-this.courtTypeConstants.HOOP_CORNER_DISTANCE,n=this.courtTypeConstants.COURT_RECT_WIDTH-t,e={x:t,y:0},r={x:t,y:this.courtTypeConstants.THREE_POINT_OFFSET_ORIGIN_Y_APPROX},i={x:n,y:0},u={x:this.courtCenter.x,y:5.25},o=Math.asin((this.courtTypeConstants.THREE_POINT_ASIN_APPROX-.75-.5)/this.courtTypeConstants.THREE_POINT_ARC_RADIUS),M=Math.PI-o;this.ctx.beginPath(),this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(r.x,r.y),this.ctx.arc(u.x,u.y,this.courtTypeConstants.THREE_POINT_ARC_RADIUS,M,o,!0),this.ctx.lineTo(i.x,i.y),this.ctx.stroke()}}]),e}(Lc),hs=.1667,js=1.5,xs=1,zs=.33,Os=!0;function Es(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var As=function(t){Cc()(e,t);var n=Es(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){var t=this,n=this.courtCenter.x,e=5.25,r={x:this.courtCenter.x,y:e+30},i=[{x:n-30*Math.cos(50*Math.PI/180),y:e+30*Math.sin(50*Math.PI/180)},r,{x:n+30*Math.cos(50*Math.PI/180),y:e+30*Math.sin(50*Math.PI/180)}];this.ctx.lineWidth=3*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.font="".concat(4,"px Helvetica"),i.forEach((function(n){t.ctx.beginPath(),t.ctx.arc(n.x,n.y,2,0,2*Math.PI,!0),t.ctx.stroke(),"transparent"!==t.options.lineColor&&(t.ctx.fillStyle="#001c4f",t.ctx.fill()),t.ctx.fillStyle=t.options.lineColor,t.ctx.fillText("4",n.x-1.1,n.y+1.4)}))}}]),e}(Lc),fs={drawLogic:function(){var t=this,n=this.courtTypeConstants.FREE_THROW_OUTER_WIDTH/2,e=this.courtCenter.x-n,r=this.courtCenter.x+n,i=this.courtCenter.x-5,u=this.courtCenter.x+5;[7,8,11,14].forEach((function(n){t.ctx.beginPath(),t.ctx.moveTo(e,n),t.ctx.lineTo(e-.667,n),t.ctx.moveTo(r,n),t.ctx.lineTo(r+.667,n),t.ctx.stroke()})),this.ctx.beginPath(),this.ctx.moveTo(i,13),this.ctx.lineTo(i+.5,13),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(u,13),this.ctx.lineTo(u-.5,13),this.ctx.stroke()}};function ps(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Us=function(t){Cc()(e,t);var n=ps(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}}]),e}(Lc);Object.assign(Us.prototype,fs);var ds=50,Cs=94,Qs=22,ws=23.6762,Ls=10,Ss=14,ks=12,vs=16,Ys=!0,ms=!0,Rs=!0;function Fs(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var bs=function(t){Cc()(e,t);var n=Fs(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this,n=this.courtTypeConstants.FREE_THROW_OUTER_WIDTH/2,e=this.courtCenter.x-n,r=this.courtCenter.x+n;[5.9,13.6,16.5].forEach((function(n){t.ctx.beginPath(),t.ctx.moveTo(e,n),t.ctx.lineTo(e-.333,n),t.ctx.moveTo(r,n),t.ctx.lineTo(r+.333,n),t.ctx.stroke()})),this.ctx.beginPath(),this.ctx.rect(e,8.8,-.333,1.9),this.ctx.fill(),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.rect(r,8.8,.333,1.9),this.ctx.fill(),this.ctx.stroke()}}]),e}(Lc),Zs=49.21,Bs=91.86,Vs=21.65,Ws=22.15,Gs=6,Ps=8,Js=12,Hs=16.08,Ks=!1,Xs=!1,qs=!1;function _s(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var $s=function(t){Cc()(e,t);var n=_s(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}}]),e}(Lc);Object.assign($s.prototype,fs);var tD=50,nD=94,eD=22,rD=23.6762,iD=10,uD=14,oD=12,MD=16,cD=!0,ND=!0,aD=!0,sD={drawLogic:function(){var t=this,n=this.courtTypeConstants.FREE_THROW_OUTER_WIDTH/2,e=this.courtCenter.x-n,r=this.courtCenter.x+n;[11,14,17].forEach((function(n){t.ctx.beginPath(),t.ctx.moveTo(e,n),t.ctx.lineTo(e-.667,n),t.ctx.moveTo(r,n),t.ctx.lineTo(r+.667,n),t.ctx.stroke()})),this.ctx.beginPath(),this.ctx.rect(e,7,-1.2,.8),this.ctx.fill(),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.rect(r,7,1.2,.8),this.ctx.fill(),this.ctx.stroke()}};function DD(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var TD=function(t){Cc()(e,t);var n=DD(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}}]),e}(Lc);Object.assign(TD.prototype,sD);var gD=50,lD=94,ID=20.75,yD=20.75,hD=2,jD=6,xD=12,zD=12,OD=!1,ED=!1,AD=!1;function fD(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var pD=function(t){Cc()(e,t);var n=fD(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}}]),e}(Lc);Object.assign(pD.prototype,sD);var UD=50,dD=94,CD=20.75,QD=20.75,wD=2,LD=6,SD=12,kD=12,vD=!1,YD=!1,mD=!0;function RD(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var FD=function(t){Cc()(e,t);var n=RD(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}}]),e}(Lc);Object.assign(FD.prototype,sD);var bD=50,ZD=84,BD=19.75,VD=19.75,WD=2,GD=6,PD=12,JD=12,HD=!1,KD=!1,XD=!1;function qD(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var _D=function(t){Cc()(e,t);var n=qD(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}}]),e}(Lc);Object.assign(_D.prototype,sD);var $D=42,tT=74,nT=19.75,eT=19.75,rT=2,iT=6,uT=12,oT=12,MT=!1,cT=!1,NT=!1;function aT(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var sT=function(t){Cc()(e,t);var n=aT(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}}]),e}(Lc);Object.assign(sT.prototype,fs);var DT=50,TT=94,gT=21.65,lT=22.15,IT=6,yT=9,hT=12,jT=16,xT=!0,zT=!0,OT=!0;function ET(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var AT=function(t){Cc()(e,t);var n=ET(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.rect(0,0,this.courtTypeConstants.COURT_RECT_WIDTH,this.courtTypeConstants.COURT_RECT_HEIGHT),this.ctx.stroke()}}]),e}(Lc);function fT(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var pT=function(t){Cc()(e,t);var n=fT(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){var t={x:0,y:this.courtCenter.y},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke()}}]),e}(Lc);function UT(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var dT=function(t){Cc()(e,t);var n=UT(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=0,n=30,e={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:30};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t,n),this.ctx.lineTo(e.x,e.y),this.ctx.stroke()}}]),e}(Lc);function CT(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var QT=function(t){Cc()(e,t);var n=CT(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){var t=this.courtTypeConstants.END_ZONE_HEIGHT,n=String.fromCharCode(8202);this.ctx.fillStyle=this.options.lineColor,this.ctx.translate(20,t);for(var e=1;e<10;e++){var r="".concat(e<=5?e:10-e).concat(n,"0");this.ctx.translate(0,this.courtTypeConstants.END_ZONE_HEIGHT),this.ctx.save(),this.ctx.rotate(Math.PI/2),this.ctx.fillText(r,-6,0),this.ctx.translate(0,40-this.courtTypeConstants.COURT_RECT_WIDTH),this.ctx.rotate(Math.PI),this.ctx.fillText(r,-6,0),this.ctx.restore()}}}]),e}(Lc);function wT(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var LT=function(t){Cc()(e,t);var n=wT(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this,n=[3,this.courtTypeConstants.HASH_MARK_FROM_SIDELINE_DISTANCE,this.courtTypeConstants.COURT_RECT_WIDTH-this.courtTypeConstants.HASH_MARK_FROM_SIDELINE_DISTANCE-3,this.courtTypeConstants.COURT_RECT_WIDTH-3-3];this.ctx.save(),this.ctx.lineWidth=this.courtTypeConstants.COURT_LINE_WIDTH;for(var e=function(e){n.forEach((function(n){for(var r=0;r<4;r++){var i=3+3*r,u={x:n,y:e-i},o={x:n+3,y:e-i};t.ctx.beginPath(),t.ctx.moveTo(u.x,u.y),t.ctx.lineTo(o.x,o.y),t.ctx.stroke()}}))},r=this.courtTypeConstants.END_ZONE_HEIGHT+15;r<=this.courtCenter.y;r+=15)e(r);this.ctx.restore()}}]),e}(Lc);function ST(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var kT=function(t){Cc()(e,t);var n=ST(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){for(var t=this.courtTypeConstants.END_ZONE_HEIGHT;t<=this.courtCenter.y;t+=15){var n={x:0,y:t},e={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:t};this.ctx.beginPath(),this.ctx.lineWidth=t%30==0?2*this.courtTypeConstants.COURT_LINE_WIDTH:this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(n.x,n.y),this.ctx.lineTo(e.x,e.y),this.ctx.stroke()}}}]),e}(Lc),vT=.32,YT=1.5,mT=2,RT=.55,FT=!1,bT=160,ZT=360,BT=30,VT=53,WT=160,GT=360,PT=30,JT=70.916,HT=160,KT=360,XT=30,qT=60;function _T(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var $T=function(t){Cc()(e,t);var n=_T(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.setColor("#000"),this.ctx.lineWidth=4*this.courtTypeConstants.COURT_LINE_WIDTH;var t=this.courtCenter.y-this.courtTypeConstants.NEUTRAL_ZONE_LENGTH-this.courtTypeConstants.END_ZONE_LENGTH,n=(this.courtTypeConstants.COURT_RECT_WIDTH-this.courtTypeConstants.FACE_OFF_SPOTS_DISTANCE)/2,e=[{x:0,y:this.courtCenter.y},{x:0,y:t}],r=[{x:n,y:0},{x:this.courtTypeConstants.COURT_RECT_WIDTH-n,y:0}],i=[{x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y},{x:this.courtTypeConstants.COURT_RECT_WIDTH,y:t}];this.ctx.beginPath(),this.ctx.moveTo(e[0].x,e[0].y),this.ctx.lineTo(e[1].x,e[1].y),this.ctx.bezierCurveTo(0,0,10,0,r[0].x,r[0].y),this.ctx.lineTo(r[1].x,r[1].y),this.ctx.bezierCurveTo(this.courtTypeConstants.COURT_RECT_WIDTH-10,0,this.courtTypeConstants.COURT_RECT_WIDTH,0,i[1].x,i[1].y),this.ctx.lineTo(i[0].x,i[0].y),this.ctx.stroke()}}]),e}(Lc);function tg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var ng=function(t){Cc()(e,t);var n=tg(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){this.setColor(this.courtTypeConstants.LINE_COLOR_BLUE),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtCenter.y,15,0,2*Math.PI,!0),this.ctx.stroke()}}]),e}(Lc);function eg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var rg=function(t){Cc()(e,t);var n=eg(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){this.setColor(this.courtTypeConstants.LINE_COLOR_RED),this.ctx.setLineDash([2,1]),this.ctx.lineWidth=4*this.courtTypeConstants.COURT_LINE_WIDTH;var t={x:0,y:this.courtCenter.y},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y};this.ctx.beginPath(),this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke()}}]),e}(Lc);function ig(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var ug=function(t){Cc()(e,t);var n=ig(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){this.setColor(this.courtTypeConstants.LINE_COLOR_BLUE),this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtCenter.y,1,0,2*Math.PI,!0),this.ctx.fill()}}]),e}(Lc);function og(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Mg=function(t){Cc()(e,t);var n=og(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this;this.setColor(this.courtTypeConstants.LINE_COLOR_RED),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH;var n=(this.courtTypeConstants.COURT_RECT_WIDTH-this.courtTypeConstants.FACE_OFF_SPOTS_DISTANCE)/2,e=this.courtCenter.y-this.courtTypeConstants.NEUTRAL_ZONE_LENGTH-this.courtTypeConstants.END_ZONE_LENGTH+22;[{x:n,y:e},{x:this.courtTypeConstants.COURT_RECT_WIDTH-n,y:e}].forEach((function(n){t.ctx.beginPath(),t.ctx.arc(n.x,n.y,t.courtTypeConstants.FACE_OFF_SPOT_RADIUS,0,2*Math.PI,!0),t.ctx.fill(),t.ctx.beginPath(),t.ctx.arc(n.x,n.y,t.courtTypeConstants.FACE_OFF_SPOT_CIRCLE_RADIUS,0,2*Math.PI,!0),t.ctx.stroke(),[{ox:n.x-t.courtTypeConstants.FACE_OFF_SPOT_CIRCLE_RADIUS,tx:n.x-(t.courtTypeConstants.FACE_OFF_SPOT_CIRCLE_RADIUS+1)},{ox:n.x+t.courtTypeConstants.FACE_OFF_SPOT_CIRCLE_RADIUS,tx:n.x+(t.courtTypeConstants.FACE_OFF_SPOT_CIRCLE_RADIUS+1)}].forEach((function(e){[n.y-1,n.y+1].forEach((function(n){t.ctx.beginPath(),t.ctx.moveTo(e.ox,n),t.ctx.lineTo(e.tx,n),t.ctx.stroke()}))}))}))}}]),e}(Lc);function cg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Ng=function(t){Cc()(e,t);var n=cg(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.setColor(this.courtTypeConstants.LINE_COLOR_RED),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH;var t=this.courtCenter.y-this.courtTypeConstants.NEUTRAL_ZONE_LENGTH-this.courtTypeConstants.END_ZONE_LENGTH;this.ctx.beginPath(),this.ctx.moveTo(0,t),this.ctx.lineTo(this.courtTypeConstants.COURT_RECT_WIDTH,t),this.ctx.stroke()}}]),e}(Lc);function ag(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var sg=function(t){Cc()(e,t);var n=ag(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.setColor(this.courtTypeConstants.LINE_COLOR_BLUE),this.ctx.lineWidth=4*this.courtTypeConstants.COURT_LINE_WIDTH;var t={x:0,y:this.courtCenter.y-this.courtTypeConstants.NEUTRAL_ZONE_LENGTH},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y-this.courtTypeConstants.NEUTRAL_ZONE_LENGTH};this.ctx.beginPath(),this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke(),this.setColor(this.courtTypeConstants.LINE_COLOR_RED);var e=(this.courtTypeConstants.COURT_RECT_WIDTH-this.courtTypeConstants.FACE_OFF_SPOTS_DISTANCE)/2,r=this.courtCenter.y-this.courtTypeConstants.NEUTRAL_ZONE_LENGTH+5,i={x:e,y:r},u={x:this.courtTypeConstants.COURT_RECT_WIDTH-e,y:r};this.ctx.beginPath(),this.ctx.arc(i.x,i.y,this.courtTypeConstants.FACE_OFF_SPOT_RADIUS,0,2*Math.PI,!0),this.ctx.fill(),this.ctx.beginPath(),this.ctx.arc(u.x,u.y,this.courtTypeConstants.FACE_OFF_SPOT_RADIUS,0,2*Math.PI,!0),this.ctx.fill()}}]),e}(Lc);function Dg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Tg=function(t){Cc()(e,t);var n=Dg(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){this.setColor(this.courtTypeConstants.LINE_COLOR_RED),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(0,this.courtCenter.y,10,-Math.PI/2,Math.PI/2,!1),this.ctx.stroke()}}]),e}(Lc),gg=.1667,lg=1.5,Ig=2,yg=.55,hg=!0;function jg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var xg=function(t){Cc()(e,t);var n=jg(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.setColor(this.courtTypeConstants.LINE_COLOR_RED),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH;var t=this.courtCenter.y-this.courtTypeConstants.NEUTRAL_ZONE_LENGTH-this.courtTypeConstants.END_ZONE_LENGTH;this.ctx.beginPath(),this.ctx.moveTo(this.courtCenter.x-this.courtTypeConstants.GOAL_CREASE_ARC_RADIUS,t),this.ctx.lineTo(this.courtCenter.x-this.courtTypeConstants.GOAL_CREASE_ARC_RADIUS,t+this.courtTypeConstants.GOAL_CREASE_ARC_RADIUS),this.ctx.lineTo(this.courtCenter.x+this.courtTypeConstants.GOAL_CREASE_ARC_RADIUS,t+this.courtTypeConstants.GOAL_CREASE_ARC_RADIUS),this.ctx.lineTo(this.courtCenter.x+this.courtTypeConstants.GOAL_CREASE_ARC_RADIUS,t),this.ctx.stroke(),this.setColor("#000"),this.ctx.beginPath(),this.ctx.moveTo(this.courtCenter.x-this.courtTypeConstants.GOAL_CAGE_LENGTH/2,t),this.ctx.lineTo(this.courtCenter.x-this.courtTypeConstants.GOAL_CAGE_LENGTH/2,t-this.courtTypeConstants.GOAL_CAGE_DEPTH),this.ctx.lineTo(this.courtCenter.x+this.courtTypeConstants.GOAL_CAGE_LENGTH/2,t-this.courtTypeConstants.GOAL_CAGE_DEPTH),this.ctx.lineTo(this.courtCenter.x+this.courtTypeConstants.GOAL_CAGE_LENGTH/2,t),this.ctx.stroke()}}]),e}(Lc),zg=85,Og=200,Eg="#C8102E",Ag="#0032A0",fg=64,pg=25,Ug=44,dg=.75,Cg=15,Qg=6,wg=3,Lg=4;function Sg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var kg=function(t){Cc()(e,t);var n=Sg(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.setColor(this.courtTypeConstants.LINE_COLOR_RED),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH;var t=this.courtCenter.y-this.courtTypeConstants.NEUTRAL_ZONE_LENGTH-this.courtTypeConstants.END_ZONE_LENGTH;this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,t,this.courtTypeConstants.GOAL_CREASE_ARC_RADIUS,0,Math.PI,!1),this.ctx.stroke(),this.setColor("#000"),this.ctx.beginPath(),this.ctx.moveTo(this.courtCenter.x-this.courtTypeConstants.GOAL_CAGE_LENGTH/2,t),this.ctx.lineTo(this.courtCenter.x-this.courtTypeConstants.GOAL_CAGE_LENGTH/2,t-this.courtTypeConstants.GOAL_CAGE_DEPTH),this.ctx.lineTo(this.courtCenter.x+this.courtTypeConstants.GOAL_CAGE_LENGTH/2,t-this.courtTypeConstants.GOAL_CAGE_DEPTH),this.ctx.lineTo(this.courtCenter.x+this.courtTypeConstants.GOAL_CAGE_LENGTH/2,t),this.ctx.stroke()}}]),e}(Lc),vg=100,Yg=200,mg="#C8102E",Rg="#0032A0",Fg=58,bg=29,Zg=44,Bg=.75,Vg=15,Wg=6,Gg=3,Pg=5.8;function Jg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Hg=function(t){Cc()(e,t);var n=Jg(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.rect(0,0,this.courtTypeConstants.COURT_RECT_WIDTH,this.courtTypeConstants.COURT_RECT_HEIGHT),this.ctx.stroke()}}]),e}(Lc);function Kg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Xg=function(t){Cc()(e,t);var n=Kg(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:0,y:this.courtCenter.y-this.courtTypeConstants.RESTRAINING_CENTER_OFFSET_Y},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y-this.courtTypeConstants.RESTRAINING_CENTER_OFFSET_Y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke()}}]),e}(Lc),qg=.1667,_g=1.5,$g=1,tl=.33,nl=!0;function el(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var rl=function(t){Cc()(e,t);var n=el(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){var t={x:0,y:this.courtCenter.y},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke();var e=[{x:this.courtCenter.x-1,y:this.courtCenter.y-1},{x:this.courtCenter.x+1,y:this.courtCenter.y-1},{x:this.courtCenter.x+1,y:this.courtCenter.y+1},{x:this.courtCenter.x-1,y:this.courtCenter.y+1}];this.ctx.beginPath(),this.ctx.moveTo(e[0].x,e[0].y),this.ctx.lineTo(e[2].x,e[2].y),this.ctx.moveTo(e[1].x,e[1].y),this.ctx.lineTo(e[3].x,e[3].y),this.ctx.stroke()}}]),e}(Lc);function il(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var ul=function(t){Cc()(e,t);var n=il(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtTypeConstants.WING_OFFSET_X,y:0},n={x:this.courtTypeConstants.WING_OFFSET_X,y:this.courtCenter.y-this.courtTypeConstants.RESTRAINING_CENTER_OFFSET_Y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke();var e={x:this.courtTypeConstants.COURT_RECT_WIDTH-this.courtTypeConstants.WING_OFFSET_X,y:0},r={x:this.courtTypeConstants.COURT_RECT_WIDTH-this.courtTypeConstants.WING_OFFSET_X,y:this.courtCenter.y-this.courtTypeConstants.RESTRAINING_CENTER_OFFSET_Y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(r.x,r.y),this.ctx.stroke();var i={x:this.courtCenter.x,y:15};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(i.x-1,i.y),this.ctx.lineTo(i.x+1,i.y),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.arc(i.x,i.y,3,0,2*Math.PI,!0),this.ctx.stroke()}}]),e}(Lc);function ol(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Ml=function(t){Cc()(e,t);var n=ol(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtTypeConstants.WING_OFFSET_X,y:this.courtCenter.y-10},n={x:this.courtTypeConstants.WING_OFFSET_X,y:this.courtCenter.y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke();var e={x:this.courtTypeConstants.COURT_RECT_WIDTH-this.courtTypeConstants.WING_OFFSET_X,y:this.courtCenter.y-10},r={x:this.courtTypeConstants.COURT_RECT_WIDTH-this.courtTypeConstants.WING_OFFSET_X,y:this.courtCenter.y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(r.x,r.y),this.ctx.stroke()}}]),e}(Lc),cl=60,Nl=110,al=10,sl=20;function Dl(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Tl=function(t){Cc()(e,t);var n=Dl(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){var t={x:this.courtCenter.x-1.5,y:this.courtCenter.y},n={x:this.courtCenter.x+1.5,y:this.courtCenter.y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtCenter.y,10,0,2*Math.PI,!0),this.ctx.stroke()}}]),e}(Lc);function gl(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var ll=function(t){Cc()(e,t);var n=gl(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this,n={x:this.courtCenter.x,y:this.courtCenter.y-this.courtTypeConstants.RESTRAINING_CENTER_OFFSET_Y-30};this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(n.x,n.y,2.84,0,2*Math.PI,!1),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.arc(n.x,n.y,15.97,0,Math.PI,!1),this.ctx.stroke();var e={x:n.x-15.97,y:n.y},r={x:n.x-2.84,y:n.y},i={x:n.x+15.97,y:n.y},u={x:n.x+2.84,y:n.y};this.ctx.beginPath(),this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(r.x,r.y),this.ctx.moveTo(i.x,i.y),this.ctx.lineTo(u.x,u.y),this.ctx.stroke();var o={x:n.x,y:n.y-2.84},M=Math.PI/4,c=Math.PI/2+Math.PI/4;this.ctx.beginPath(),this.ctx.arc(o.x,o.y,14.43,M,c,!1),this.ctx.stroke();var N=Il(o,14.43,c),a=Il(o,14.43,M),s=n.x-2.84,D=n.x+2.84;this.ctx.beginPath(),this.ctx.moveTo(N.x,N.y),this.ctx.lineTo(s,n.y),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(a.x,a.y),this.ctx.lineTo(D,n.y),this.ctx.stroke();var T={x:s-8.75,y:n.y},g={x:D+8.75,y:n.y};this.ctx.beginPath(),this.ctx.moveTo(T.x,T.y),this.ctx.lineTo(T.x,T.y+1),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(g.x,g.y),this.ctx.lineTo(g.x,g.y+1),this.ctx.stroke();var l=Il(o,14.43,Math.PI/2);this.ctx.beginPath(),this.ctx.moveTo(l.x,l.y-1),this.ctx.lineTo(l.x,l.y+1),this.ctx.stroke();for(var I=function(n){[1,-1].forEach((function(e){var r=Math.PI/2+Math.PI/10*e*n,i=Il(o,14.43,r);t.ctx.save(),t.ctx.translate(i.x,i.y),t.ctx.rotate(Math.PI/10*e*n),t.ctx.beginPath(),t.ctx.moveTo(0,-1),t.ctx.lineTo(0,1),t.ctx.stroke(),t.ctx.restore()}))},y=1;y<=3;y++)I(y);var h={x:T.x,y:T.y-5},j={x:g.x,y:g.y-5};this.ctx.beginPath(),this.ctx.arc(h.x,h.y,.5,0,2*Math.PI,!1),this.ctx.arc(j.x,j.y,.5,0,2*Math.PI,!1),this.ctx.fill();var x={x:n.x-1,y:n.y},z={x:n.x+1,y:n.y},O={x:n.x,y:n.y-1};this.ctx.beginPath(),this.ctx.moveTo(x.x,x.y),this.ctx.lineTo(z.x,z.y),this.ctx.lineTo(O.x,O.y),this.ctx.closePath(),this.ctx.stroke()}}]),e}(Lc);function Il(t,n,e){return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}}var yl=60,hl=130,jl=20;function xl(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var zl=function(t){Cc()(e,t);var n=xl(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH;var t=[{x:0,y:this.courtCenter.y},{x:0,y:this.courtTypeConstants.GOAL_LINE_Y}],n=[{x:this.courtTypeConstants.TOP_SIDE_CURVE_OFFSET,y:0},{x:this.courtTypeConstants.COURT_RECT_WIDTH-this.courtTypeConstants.TOP_SIDE_CURVE_OFFSET,y:0}],e=[{x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y},{x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtTypeConstants.GOAL_LINE_Y}];this.ctx.beginPath(),this.ctx.moveTo(t[0].x,t[0].y),this.ctx.lineTo(t[1].x,t[1].y),this.ctx.bezierCurveTo(0,0,10,0,n[0].x,n[0].y),this.ctx.lineTo(n[1].x,n[1].y),this.ctx.bezierCurveTo(this.courtTypeConstants.COURT_RECT_WIDTH-10,0,this.courtTypeConstants.COURT_RECT_WIDTH,0,e[1].x,e[1].y),this.ctx.lineTo(e[0].x,e[0].y),this.ctx.stroke()}}]),e}(Lc),Ol=.1667,El=1.5,Al=1,fl=.33,pl=!0;function Ul(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var dl=function(t){Cc()(e,t);var n=Ul(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtCenter.y,11,0,2*Math.PI,!0),this.ctx.stroke(),this.ctx.setLineDash([.8,.5]),this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtCenter.y,1.41667,0,2*Math.PI,!0),this.ctx.stroke()}}]),e}(Lc);function Cl(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Ql=function(t){Cc()(e,t);var n=Cl(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){var t={x:0,y:this.courtCenter.y},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(this.courtTypeConstants.COURT_RECT_WIDTH,this.courtCenter.y-this.courtTypeConstants.RESTRAINING_LINE_OFFSET_Y+5),this.ctx.lineTo(this.courtTypeConstants.COURT_RECT_WIDTH-5,this.courtCenter.y-this.courtTypeConstants.RESTRAINING_LINE_OFFSET_Y+5),this.ctx.lineTo(this.courtTypeConstants.COURT_RECT_WIDTH-5,this.courtCenter.y+this.courtTypeConstants.RESTRAINING_LINE_OFFSET_Y-5),this.ctx.lineTo(this.courtTypeConstants.COURT_RECT_WIDTH,this.courtCenter.y+this.courtTypeConstants.RESTRAINING_LINE_OFFSET_Y-5),this.ctx.stroke()}}]),e}(Lc);function wl(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Ll=function(t){Cc()(e,t);var n=wl(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:0,y:this.courtCenter.y-this.courtTypeConstants.RESTRAINING_LINE_OFFSET_Y},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y-this.courtTypeConstants.RESTRAINING_LINE_OFFSET_Y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke();var e=this.courtCenter.y-this.courtTypeConstants.RESTRAINING_LINE_OFFSET_Y/2;this.ctx.beginPath(),this.ctx.moveTo(this.courtTypeConstants.COURT_RECT_WIDTH,e-12),this.ctx.lineTo(this.courtTypeConstants.COURT_RECT_WIDTH+5,e-12),this.ctx.lineTo(this.courtTypeConstants.COURT_RECT_WIDTH+5,e+12),this.ctx.lineTo(this.courtTypeConstants.COURT_RECT_WIDTH,e+12),this.ctx.stroke()}}]),e}(Lc);function Sl(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var kl=function(t){Cc()(e,t);var n=Sl(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:this.courtTypeConstants.GOAL_LINE_Y};this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.moveTo(t.x-9.25,t.y),this.ctx.lineTo(t.x+9.25,t.y),this.ctx.stroke();var n=Math.PI/4.5;this.ctx.beginPath(),this.ctx.arc(t.x,t.y,9.25,-n,Math.PI+n,!1),this.ctx.stroke();this.ctx.beginPath(),this.ctx.moveTo(t.x-7.25,t.y-6),this.ctx.lineTo(t.x+7.25,t.y-6),this.ctx.stroke();var e={x:t.x-2.375,y:t.y},r={x:t.x+2.375,y:t.y},i={x:t.x,y:t.y-2.375};this.ctx.beginPath(),this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(r.x,r.y),this.ctx.lineTo(i.x,i.y),this.ctx.closePath(),this.ctx.stroke()}}]),e}(Lc);function vl(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Yl=function(t){Cc()(e,t);var n=vl(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(0,this.courtCenter.y,10,Math.PI/2,-Math.PI/2,!0),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(0,this.courtCenter.y-10),this.ctx.bezierCurveTo(0,this.courtCenter.y-10,-2.5,this.courtCenter.y-10,-5,this.courtCenter.y-10),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(0,this.courtCenter.y+10),this.ctx.bezierCurveTo(0,this.courtCenter.y+10,-2.5,this.courtCenter.y+10,-5,this.courtCenter.y+10),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(0,this.courtCenter.y-12),this.ctx.lineTo(-5,this.courtCenter.y-12),this.ctx.lineTo(-5,this.courtCenter.y+12),this.ctx.lineTo(0,this.courtCenter.y+12),this.ctx.stroke()}}]),e}(Lc),ml=85,Rl=180,Fl=12,bl=12,Zl=42.5;function Bl(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Vl=2,Wl=function(t){Cc()(e,t);var n=Bl(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){var t=this;this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtCenter.y,.5,0,2*Math.PI,!0),this.ctx.fill(),this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtCenter.y,Vl,0,2*Math.PI,!0),this.ctx.stroke(),[Vl,-Vl].forEach((function(n){t.ctx.beginPath(),t.ctx.moveTo(t.courtCenter.x+n,t.courtCenter.y-3),t.ctx.lineTo(t.courtCenter.x+n,t.courtCenter.y+3),t.ctx.stroke()}))}}]),e}(Lc);function Gl(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Pl=function(t){Cc()(e,t);var n=Gl(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:0,y:this.courtCenter.y-this.courtTypeConstants.RESTRAINING_LINE_OFFSET_Y},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y-this.courtTypeConstants.RESTRAINING_LINE_OFFSET_Y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke();var e=this.courtCenter.y-5;this.ctx.beginPath(),this.ctx.moveTo(this.courtTypeConstants.COURT_RECT_WIDTH,e),this.ctx.lineTo(this.courtTypeConstants.COURT_RECT_WIDTH+5,e),this.ctx.lineTo(this.courtTypeConstants.COURT_RECT_WIDTH+5,e-30),this.ctx.lineTo(this.courtTypeConstants.COURT_RECT_WIDTH,e-30),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(this.courtTypeConstants.COURT_RECT_WIDTH-4,this.courtCenter.y),this.ctx.lineTo(this.courtTypeConstants.COURT_RECT_WIDTH-4,this.courtCenter.y-30-5+.5),this.ctx.lineTo(this.courtTypeConstants.COURT_RECT_WIDTH,this.courtCenter.y-30-5+.5),this.ctx.stroke();var r=this.courtCenter.y-this.courtTypeConstants.RESTRAINING_LINE_OFFSET_Y;this.ctx.beginPath(),this.ctx.moveTo(0,r),this.ctx.lineTo(-5,r),this.ctx.lineTo(-5,r-12),this.ctx.lineTo(0,r-12),this.ctx.stroke()}}]),e}(Lc);function Jl(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Hl=function(t){Cc()(e,t);var n=Jl(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:this.courtTypeConstants.GOAL_LINE_Y};this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.moveTo(t.x-9.25,t.y),this.ctx.lineTo(t.x+9.25,t.y),this.ctx.stroke();var n=Math.PI/4.5;this.ctx.beginPath(),this.ctx.arc(t.x,t.y,9.25,-n,Math.PI+n,!1),this.ctx.stroke(),this.ctx.save(),this.ctx.setLineDash([1.2,.4]),this.ctx.beginPath(),this.ctx.arc(t.x,t.y,24,0,Math.PI,!1),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(t.x-9.25,t.y),this.ctx.lineTo(t.x-24,t.y),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(t.x+9.25,t.y),this.ctx.lineTo(t.x+24,t.y),this.ctx.stroke(),this.ctx.restore();this.ctx.beginPath(),this.ctx.moveTo(t.x-7.25,t.y-6),this.ctx.lineTo(t.x+7.25,t.y-6),this.ctx.stroke();var e={x:t.x-2.375,y:t.y},r={x:t.x+2.375,y:t.y},i={x:t.x,y:t.y-2.375};this.ctx.beginPath(),this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(r.x,r.y),this.ctx.lineTo(i.x,i.y),this.ctx.closePath(),this.ctx.stroke()}}]),e}(Lc);function Kl(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Xl=function(t){Cc()(e,t);var n=Kl(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(0,this.courtCenter.y,10,Math.PI/2,-Math.PI/2,!0),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(0,this.courtCenter.y-10),this.ctx.lineTo(-5,this.courtCenter.y-10),this.ctx.lineTo(-5,this.courtCenter.y+10),this.ctx.lineTo(0,this.courtCenter.y+10),this.ctx.stroke()}}]),e}(Lc),ql=85,_l=180,$l=12,tI=12,nI=11,eI="Concrete";function rI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var iI=function(t){Cc()(e,t);var n=rI(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.rect(0,0,this.courtTypeConstants.COURT_RECT_WIDTH,this.courtTypeConstants.COURT_RECT_HEIGHT),this.ctx.stroke()}}]),e}(Lc);function uI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var oI=function(t){Cc()(e,t);var n=uI(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtCenter.y,this.courtTypeConstants.CENTER_CIRCLE_RADIUS,0,2*Math.PI,!0),this.ctx.stroke()}}]),e}(Lc);function MI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var cI=function(t){Cc()(e,t);var n=MI(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){var t={x:0,y:this.courtCenter.y},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke()}}]),e}(Lc);function NI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var aI=function(t){Cc()(e,t);var n=NI(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtCenter.y,.25,0,2*Math.PI,!0),this.ctx.fill()}}]),e}(Lc);function sI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var DI=function(t){Cc()(e,t);var n=sI(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=0,n=0,e={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:0};this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(t,n,1,0,Math.PI/2,!1),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.arc(e.x,e.y,1,Math.PI,Math.PI/2,!0),this.ctx.stroke()}}]),e}(Lc);function TI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var gI=function(t){Cc()(e,t);var n=TI(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtTypeConstants.PENALTY_SPOT_OFFSET_Y,this.courtTypeConstants.CENTER_CIRCLE_RADIUS,Math.PI/5,Math.PI-Math.PI/5,!1),this.ctx.stroke()}}]),e}(Lc);function lI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var II=function(t){Cc()(e,t);var n=lI(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.rect(this.courtCenter.x-this.courtTypeConstants.PENALTY_AREA.width/2,0,this.courtTypeConstants.PENALTY_AREA.width,this.courtTypeConstants.PENALTY_AREA.height),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.rect(this.courtCenter.x-this.courtTypeConstants.GOAL_AREA.width/2,0,this.courtTypeConstants.GOAL_AREA.width,this.courtTypeConstants.GOAL_AREA.height),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.rect(this.courtCenter.x-this.courtTypeConstants.GOAL.width/2,-this.courtTypeConstants.GOAL.height,this.courtTypeConstants.GOAL.width,this.courtTypeConstants.GOAL.height),this.ctx.stroke()}}]),e}(Lc);function yI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var hI=function(t){Cc()(e,t);var n=yI(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtTypeConstants.PENALTY_SPOT_OFFSET_Y,.25,0,2*Math.PI,!1),this.ctx.fill()}}]),e}(Lc),jI=.1667,xI=1.5,zI=1,OI=.33,EI=!0,AI=60,fI=110,pI=10,UI=12,dI={width:44,height:18},CI={width:8,height:2.66},QI={width:20,height:6},wI=60,LI=110,SI=10,kI=12,vI={width:44,height:18},YI={width:8,height:2.66},mI={width:20,height:6};function RI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var FI=function(t){Cc()(e,t);var n=RI(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){var t=[{x:this.courtCenter.x-1,y:this.courtCenter.y-1},{x:this.courtCenter.x+1,y:this.courtCenter.y-1},{x:this.courtCenter.x+1,y:this.courtCenter.y+1},{x:this.courtCenter.x-1,y:this.courtCenter.y+1}];this.ctx.beginPath(),this.ctx.moveTo(t[0].x,t[0].y),this.ctx.lineTo(t[2].x,t[2].y),this.ctx.moveTo(t[1].x,t[1].y),this.ctx.lineTo(t[3].x,t[3].y),this.ctx.stroke()}}]),e}(Lc);function bI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var ZI=function(t){Cc()(e,t);var n=bI(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=11,n=0,e={x:this.courtTypeConstants.COURT_RECT_WIDTH-11,y:0};this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.moveTo(t,n),this.ctx.lineTo(t,n-1),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(e.x,e.y-1),this.ctx.stroke()}}]),e}(Lc);function BI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var VI=function(t){Cc()(e,t);var n=BI(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.moveTo(this.courtCenter.x-.33,12),this.ctx.lineTo(this.courtCenter.x+.33,12),this.ctx.stroke()}}]),e}(Lc),WI=70,GI=115,PI=10,JI=12,HI={width:44,height:18},KI={width:8,height:2.66},XI={width:20,height:6};function qI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var _I=function(t){Cc()(e,t);var n=qI(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=11,n=0,e={x:this.courtTypeConstants.COURT_RECT_WIDTH-11,y:0};this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.moveTo(t,n),this.ctx.lineTo(t,n-1),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(e.x,e.y-1),this.ctx.stroke()}}]),e}(Lc);function $I(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var ty=function(t){Cc()(e,t);var n=$I(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.moveTo(this.courtCenter.x-.33,12),this.ctx.lineTo(this.courtCenter.x+.33,12),this.ctx.stroke()}}]),e}(Lc),ny=60,ey=100,ry=10,iy=12,uy={width:44,height:18},oy={width:8,height:2.66},My={width:20,height:6};function cy(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Ny=function(t){Cc()(e,t);var n=cy(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH;var t={x:0,y:this.courtTypeConstants.COURT_RECT_HEIGHT/3},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtTypeConstants.COURT_RECT_HEIGHT/3};this.ctx.beginPath(),this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke()}}]),e}(Lc);function ay(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var sy=function(t){Cc()(e,t);var n=ay(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtTypeConstants.PENALTY_SPOT_OFFSET_Y,this.courtTypeConstants.CENTER_CIRCLE_RADIUS,Math.PI/12,Math.PI-Math.PI/12,!1),this.ctx.stroke()}}]),e}(Lc),Dy=45,Ty=65,gy=8,ly=10,Iy={width:24,height:12},yy={width:6,height:2},hy={width:8,height:4};function jy(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var xy=function(t){Cc()(e,t);var n=jy(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtTypeConstants.PENALTY_SPOT_OFFSET_Y,this.courtTypeConstants.CENTER_CIRCLE_RADIUS,Math.PI/6,Math.PI-Math.PI/6,!1),this.ctx.stroke()}}]),e}(Lc),zy=55,Oy=80,Ey=8,Ay=10,fy={width:36,height:14},py={width:6.16,height:2.16},Uy={width:12,height:5};function dy(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Cy=function(t){Cc()(e,t);var n=dy(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:0,y:this.courtCenter.y-9.8},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y-9.8};this.ctx.beginPath(),this.ctx.lineWidth=this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke();for(var e=.574,r=0;r<5;r++)this.ctx.beginPath(),this.ctx.moveTo(t.x-e,t.y),this.ctx.lineTo(t.x-e-.574,n.y),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(n.x+e,t.y),this.ctx.lineTo(n.x+e+.574,n.y),this.ctx.stroke(),e+=1.148}}]),e}(Lc);function Qy(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var wy=function(t){Cc()(e,t);var n=Qy(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.rect(0,0,this.courtTypeConstants.COURT_RECT_WIDTH,this.courtTypeConstants.COURT_RECT_HEIGHT),this.ctx.stroke()}}]),e}(Lc);function Ly(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Sy=function(t){Cc()(e,t);var n=Ly(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){var t={x:0,y:this.courtCenter.y},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke(),this.ctx.beginPath()}}]),e}(Lc);function ky(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var vy,Yy,my,Ry,Fy,by,Zy,By,Vy,Wy,Gy,Py=function(t){Cc()(e,t);var n=ky(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this.courtTypeConstants.COURT_RECT_WIDTH;this.ctx.beginPath(),this.ctx.moveTo(0,-.574),this.ctx.lineTo(0,-1.148),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(t,-.574),this.ctx.lineTo(t,-1.148),this.ctx.stroke()}}]),e}(Lc),Jy=.1667,Hy=1.5,Ky=1,Xy=.33,qy=!0,_y=29.5,$y=59.1,th=(vy={},Qt()(vy,jn,o),Qt()(vy,xn,a),Qt()(vy,Dn,I),Qt()(vy,gn,k),Qt()(vy,hn,F),Qt()(vy,ln,G),Qt()(vy,In,q),Qt()(vy,yn,rt),Qt()(vy,Tn,lt),vy),nh=(By={},Qt()(By,jn,Qt()({},Pn,N)),Qt()(By,xn,(Yy={},Qt()(Yy,Jn,T),Qt()(Yy,Hn,l),Yy)),Qt()(By,Dn,(my={},Qt()(my,zn,h),Qt()(my,On,x),Qt()(my,En,O),Qt()(my,An,A),Qt()(my,fn,p),Qt()(my,pn,d),Qt()(my,Un,Q),Qt()(my,dn,L),my)),Qt()(By,gn,{}),Qt()(By,hn,(Ry={},Qt()(Ry,Wn,Z),Qt()(Ry,Gn,V),Ry)),Qt()(By,ln,(Fy={},Qt()(Fy,kn,J),Qt()(Fy,vn,K),Fy)),Qt()(By,In,(by={},Qt()(by,Yn,$),Qt()(by,mn,nt),by)),Qt()(By,yn,(Zy={},Qt()(Zy,Fn,Mt),Qt()(Zy,bn,Nt),Qt()(Zy,Zn,st),Qt()(Zy,Bn,Tt),Zy)),Qt()(By,Tn,{}),By),eh=(Vy={},Qt()(Vy,jn,M),Qt()(Vy,xn,s),Qt()(Vy,Dn,y),Qt()(Vy,gn,v),Qt()(Vy,hn,b),Qt()(Vy,ln,P),Qt()(Vy,In,_),Qt()(Vy,yn,it),Qt()(Vy,Tn,It),Vy),rh=(Wy={},Qt()(Wy,Pn,c),Qt()(Wy,Jn,D),Qt()(Wy,Hn,g),Qt()(Wy,zn,j),Qt()(Wy,On,z),Qt()(Wy,En,E),Qt()(Wy,An,f),Qt()(Wy,fn,U),Qt()(Wy,pn,C),Qt()(Wy,Un,w),Qt()(Wy,dn,S),Qt()(Wy,Cn,R),Qt()(Wy,Qn,m),Qt()(Wy,Ln,Y),Qt()(Wy,wn,Y),Qt()(Wy,Wn,B),Qt()(Wy,Gn,W),Qt()(Wy,kn,H),Qt()(Wy,vn,X),Qt()(Wy,Yn,tt),Qt()(Wy,mn,et),Qt()(Wy,Rn,ot),Qt()(Wy,Fn,ct),Qt()(Wy,bn,at),Qt()(Wy,Zn,Dt),Qt()(Wy,Bn,gt),Qt()(Wy,Vn,ut),Qt()(Wy,Sn,yt),Wy),ih=(Gy={},Qt()(Gy,jn,{courtTypes:[Pn]}),Qt()(Gy,xn,{courtTypes:[Jn,Hn]}),Qt()(Gy,Dn,{courtTypes:[zn,On,En,An,fn,pn,Un,dn]}),Qt()(Gy,gn,{courtTypes:[wn,Cn,Qn]}),Qt()(Gy,hn,{courtTypes:[Wn,Gn]}),Qt()(Gy,ln,{courtTypes:[kn,vn]}),Qt()(Gy,In,{courtTypes:[Yn,mn]}),Qt()(Gy,yn,{courtTypes:[Rn,Fn,bn,Zn,Bn,Vn]}),Qt()(Gy,Tn,{courtTypes:[Sn]}),Gy);function uh(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,r)}return e}var oh=function(){function t(n,e,r){pt()(this,t),this.ctx=n,this.playData=e,this.options=r}return dt()(t,[{key:"disableMirrorMode",value:function(){this.ctx.setTransform(1,0,0,1,0,0),this.ctx.scale(this.options.scale,this.options.scale),this.ctx.translate(-this.playData.court.courtRect.origin.x,-this.playData.court.courtRect.origin.y)}},{key:"courtTypeConstants",get:function(){if(!eh[this.playData.sport])throw new Error("unknown sport type constants");if(!rh[this.playData.court.type])throw new Error("unknown court type constants");return function(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?uh(Object(e),!0).forEach((function(n){Qt()(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):uh(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}({},eh[this.playData.sport],{},rh[this.playData.court.type])}}]),t}();function Mh(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,r)}return e}function ch(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Nh=function(t){Cc()(e,t);var n=ch(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"apply",value:function(){var t=this;this.init(),this.ctx.save(),this.ctx.lineWidth=this.courtTypeConstants.COURT_LINE_WIDTH,this.setColor(),Object.values(this.courtTypeLayers).forEach((function(n){new n(t).apply()})),this.ctx.restore()}},{key:"init",value:function(){this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.setBackground(),this.setWatermark(),this.ctx.restore()}},{key:"setColor",value:function(){var t=this.options.lineColor||"#fff";this.ctx.strokeStyle=t,this.ctx.fillStyle=t}},{key:"setBackground",value:function(){var t;t=this.background,void 0!==(ye.backgroundOptions||{})[t]&&this.staticData.backgroundOptions&&this.staticData.backgroundOptions[this.background]?(this.ctx.fillStyle=this.ctx.createPattern(this.staticData.backgroundOptions[this.background],"repeat"),this.ctx.fillRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height)):0===this.background.indexOf("#")&&(this.ctx.save(),this.ctx.fillStyle=this.background,this.ctx.fillRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore())}},{key:"setWatermark",value:function(){var t=this.options.watermark?this.staticData.watermark[this.options.watermark]:null;if(t){var n=t.width/t.height,e=this.frameWidth/5,r={width:e,height:e*t.height/t.width};n<1&&(r.width=e*t.width/t.height,r.height=e);var i=this.playData.court.courtRect.size.height>this.courtTypeConstants.COURT_RECT_HEIGHT?Math.abs(this.playData.court.courtRect.origin.y):0,u=(1+Math.abs(this.playData.court.courtRect.origin.x))*this.scale,o=(this.playData.court.courtRect.size.height-i-1)*this.scale-r.height;this.ctx.drawImage(t,0,0,t.width,t.height,u,o,r.width,r.height)}}},{key:"frameWidth",get:function(){return this.options.width}},{key:"scale",get:function(){return this.options.scale}},{key:"staticData",get:function(){return this.options.staticData}},{key:"courtTypeLayers",get:function(){if(!th[this.playData.sport])throw new Error("unknown sport type layer");return function(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?Mh(Object(e),!0).forEach((function(n){Qt()(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Mh(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}({},th[this.playData.sport],{},(nh[this.playData.sport]||{})[this.playData.court.type]||{})}},{key:"background",get:function(){return this.options.background||this.courtTypeConstants.BACKGROUND||this.playData.sport}}]),e}(oh),ah=e(11),sh=e.n(ah),Dh={drawLineFromControlPoints:function(){var t=this;this.ctx.save(),this.setLineOptions(),this.ctx.lineJoin="round",this.getProcessedLinePaths().forEach((function(n){t.ctx.save(),n.alpha&&t.setColor(n.alpha),t.ctx.beginPath();var e=n.controlPoints;t.ctx.moveTo(e[0].x,e[0].y),2===e.length&&("DRIBBLE"===(t.line||t.shape||{}).type&&(t.ctx.lineCap="round"),t.ctx.lineTo(e[1].x,e[1].y)),3===e.length&&t.ctx.quadraticCurveTo(e[1].x,e[1].y,e[2].x,e[2].y),4===e.length&&t.ctx.bezierCurveTo(e[1].x,e[1].y,e[2].x,e[2].y,e[3].x,e[3].y),t.ctx.stroke(),t.ctx.restore()})),this.ctx.restore()},drawArrowLineCap:function(t){var n=t||this.arrowTipPoint();this.ctx.save();var e=this.angleBetweenLastTwoPoints(),r=n,i={x:r.x-1.4/1.3,y:r.y},u={x:r.x-1.4-1.4/6,y:r.y-.7},o={x:r.x-1.4-1.4/6,y:r.y+.7};this.ctx.beginPath(),this.ctx.translate(r.x,r.y),this.ctx.rotate(e),this.ctx.translate(-r.x,-r.y),this.ctx.moveTo(i.x,i.y),this.ctx.lineTo(u.x,u.y),this.ctx.lineTo(r.x,r.y),this.ctx.lineTo(o.x,o.y),this.ctx.lineTo(i.x,i.y),this.ctx.fill(),this.ctx.stroke(),this.ctx.restore()},drawPerpendicularLineCap:function(){this.drawPerpendicularLineAtCourtPoint(this.arrowTipPoint(),this.angleBetweenLastTwoPoints())},drawPerpendicularLineAtCourtPoint:function(t,n){this.ctx.save();var e={x:t.x,y:t.y-1.5},r={x:t.x,y:t.y+1.5};this.ctx.beginPath(),this.ctx.translate(t.x,t.y),this.ctx.rotate(n),this.ctx.translate(-t.x,-t.y),this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(r.x,r.y),this.ctx.fill(),this.ctx.stroke(),this.ctx.restore()},handOffLineCap:function(t){var n=this;this.ctx.save(),t.forEach((function(t){var e=t.controlPoints,r=n.calcMidPoint(e[0],e[e.length-1]),i=n.angleBetweenLastTwoPoints(),u=.5*Math.cos(i),o=.5*Math.sin(i),M={x:r.x+u,y:r.y+o},c={x:r.x-u,y:r.y-o};n.drawPerpendicularLineAtCourtPoint(M,i),n.drawPerpendicularLineAtCourtPoint(c,i),n.ctx.stroke()})),this.ctx.restore()},calcMidPoint:function(t,n){return{x:t.x+(n.x-t.x)/2,y:t.y+(n.y-t.y)/2}},angleBetweenLastTwoPoints:function(){var t=Ee()(this.getProcessedLinePaths()).pop().controlPoints,n=t[t.length-1],e=t[t.length-2];return this.angleBetweenTwoPoints(e,n)},angleBetweenTwoPoints:function(t,n){var e=n.x-t.x,r=n.y-t.y;return Math.atan2(r,e)},arrowTipPoint:function(){var t=Ee()(this.getProcessedLinePaths()).pop().controlPoints;return t[t.length-1]},setLineOptions:function(){}};function Th(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,r)}return e}function gh(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?Th(Object(e),!0).forEach((function(n){Qt()(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Th(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}function lh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Ih=function(t){Cc()(e,t);var n=lh(e);function e(t,r){var i;return pt()(this,e),(i=n.call(this,t)).line=r,Qt()(sh()(i),"lineWidth",void 0),Qt()(sh()(i),"debugMasking",void 0),Qt()(sh()(i),"startMaskSettings",void 0),Qt()(sh()(i),"endMaskSettings",void 0),i.lineWidth=t.lineWidth,i.debugMasking=!1,i.startMaskSettings=null,i.endMaskSettings=null,i}return dt()(e,[{key:"drawLineFromControlPoints",value:function(){}},{key:"drawArrowLineCap",value:function(t){}},{key:"handOffLineCap",value:function(t){}},{key:"drawPerpendicularLineCap",value:function(){}},{key:"angleBetweenLastTwoPoints",value:function(){return 0}}]),dt()(e,[{key:"drawLogic",value:function(){!this.options.animationGlobalProgress&&this.courtTypeConstants.LINE_MASKING&&(this.setLineMasking(),this.applyMasking()),this.setColor(),this.drawLineFromControlPoints(),this.drawLineCap()}},{key:"setColor",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=!1;if(this.options.position){var e=this.line.originalData,r=e.playerPositionOrigin,i=e.playerPositionTerminus;r!==this.options.position&&i!==this.options.position||(n=!0)}(this.options.linesHighlightedIds||[]).includes(this.line.id)&&(n=!0);var u=this.line.color,o=u.alpha,M=u.blue,c=u.green,N=u.red,a=n?0:Math.ceil(255*N),s=n?0:Math.ceil(255*c),D=n?255:Math.ceil(255*M),T="rgba(".concat(a,", ").concat(s,", ").concat(D,", ").concat(t||o,")");this.ctx.fillStyle=T,this.ctx.strokeStyle=T}},{key:"getProcessedLinePaths",value:function(){return this.line.getLineParts()}},{key:"applyMasking",value:function(){var t=this;this.line.getLineParts().forEach((function(n,e){var r=n.controlPoints;t.startMaskSettings&&(r=Ic(r,t.startMaskSettings.radius,t.startMaskSettings.centerPoint),t.line.setLinePartsAdjustedAtIndex(e,gh({},n,{controlPoints:r}))),t.endMaskSettings&&(r=Ic(r,null,null,t.endMaskSettings.radius,t.endMaskSettings.centerPoint),t.line.setLinePartsAdjustedAtIndex(e,gh({},n,{controlPoints:r})))}))}},{key:"setLineMasking",value:function(){if(this.line.playerPositionOrigin){var t=this.line.playerPositionOrigin,n=this.line.playerLineSequence;if(0===n){var e=this.playData.players.find((function(n){return n.position===t}));if(e){var r=e.possession?1.5:1;"HANDOFF"!==this.line.type||e.possession||(r=.7),this.startMaskSettings={centerPoint:e.location,radius:r}}}else if(t){var i=this.playData.lines.filter((function(e){return e.playerPositionOrigin===t&&e.playerLineSequence===n-1&&["PASS","HANDOFF"].indexOf(e.type)<0}));if(i.length){var u=je()(i,1)[0];if(u.lineParts.length){var o=Ee()(u.lineParts).pop(),M=Ee()(o.controlPoints).pop();this.startMaskSettings={centerPoint:M,radius:3}}}}}if(this.line.playerPositionTerminus&&"SCREEN"!==this.line.type){var c=3.7,N=Ee()(this.line.getLineParts()).pop(),a=Ee()(N.controlPoints).pop();["PASS","HANDOFF"].indexOf(this.line.type)>=0&&(c=1.75),this.endMaskSettings={centerPoint:a,radius:c}}this.showMaskingDebug()}},{key:"showMaskingDebug",value:function(){if(!1!==this.debugMasking){if(this.ctx.save(),this.ctx.lineWidth=.04,null!==this.startMaskSettings){var t=this.startMaskSettings.centerPoint,n=t.x,e=t.y;this.ctx.strokeStyle="green",this.ctx.moveTo(n,e),this.ctx.beginPath(),this.ctx.arc(n,e,this.startMaskSettings.radius,0,2*Math.PI,!0),this.ctx.stroke()}if(null!==this.endMaskSettings){var r=this.endMaskSettings.centerPoint,i=r.x,u=r.y;this.ctx.strokeStyle="red",this.ctx.moveTo(i,u),this.ctx.beginPath(),this.ctx.arc(i,u,this.endMaskSettings.radius,0,2*Math.PI,!0),this.ctx.stroke()}this.ctx.restore()}}},{key:"drawLineCap",value:function(){}}]),e}(Qc);function yh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}Object.assign(Ih.prototype,Dh);var hh=function(t){Cc()(e,t);var n=yh(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"allowDrawLineCap",value:function(){return!this.line.hideLineTip&&!(this.options.magnetMode&&!this.options.animationGlobalProgress)}}]),e}(Ih);function jh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var xh=function(t){Cc()(e,t);var n=jh(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLineCap",value:function(){this.allowDrawLineCap()&&this.drawArrowLineCap()}}]),e}(hh),zh={convertLinePartsToDribble:function(t){var n=[];return t.forEach((function(e,r){var i=Array(4);e.controlPoints.forEach((function(t,n){i[n]=t}));for(var u=new Ae(i[0],i[1],i[2],i[3]),o=[],M=0,c=1/u.length;M<=1;)o.push({x:u.mx(M),y:u.my(M),time:M}),M+=c;for(var N=[],a=[],s=0;s<o.length;s++)a.push(o[s]),a.length>1&&(N.push(a),a=[o[s]]);N.forEach((function(e,i){var u=je()(e,2),o=u[0],M=u[1],c={x:1.2*(M.x-o.x),y:1.2*(M.y-o.y)},a=(o.x+M.x)/2,s=(o.y+M.y)/2,D={x:-c.y,y:c.x};i%2&&(D={x:c.y,y:-c.x});var T=[o,{x:a+D.x,y:s+D.y},M];1!==t.length&&r!==t.length-1||i===N.length-1&&(T=[o,M]),n.push({controlPoints:T,lpIndex:r})}))})),n}};function Oh(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,r)}return e}function Eh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Ah=function(t){Cc()(e,t);var n=Eh(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"convertLinePartsToDribble",value:function(t){return[]}},{key:"drawLineCap",value:function(){this.allowDrawLineCap()&&this.drawArrowLineCap()}},{key:"setLineOptions",value:function(){var t=this,n=Ee()(this.line.getLineParts()),e=this.convertLinePartsToDribble(n);this.line.setLinePartsAdjusted([]),e.forEach((function(e){var r=e.controlPoints,i=e.lpIndex,u=je()(r,1)[0],o=n[i].alpha||t.line.color.alpha;if(t.options.animationGlobalProgress){var M=je()(t.line.animationKeyTimeChunks[i],2),c=M[0],N=M[1];Lt.a.inRange(t.options.animationGlobalProgress,c,N)&&St(t.options.animationGlobalProgress,c,N)>u.time&&(o=.1)}t.line.addLinePartAdjusted(function(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?Oh(Object(e),!0).forEach((function(n){Qt()(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Oh(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}({},e,{controlPoints:r,alpha:o}))}))}}]),e}(hh);function fh(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,r)}return e}function ph(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}Object.assign(Ah.prototype,zh);var Uh=function(t){Cc()(e,t);var n=ph(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLineCap",value:function(){this.handOffLineCap(this.line.baseLineParts())}},{key:"getProcessedLinePaths",value:function(){return this.line.getLineParts().map((function(t){var n=t.controlPoints;return function(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?fh(Object(e),!0).forEach((function(n){Qt()(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):fh(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}({},t,{controlPoints:[n[0],n[n.length-1]]})}))}}]),e}(Ih);function dh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Ch=function(t){Cc()(e,t);var n=dh(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"setLineOptions",value:function(){this.ctx.setLineDash([1,.5])}},{key:"drawLineCap",value:function(){this.drawArrowLineCap()}}]),e}(Ih);function Qh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var wh=function(t){Cc()(e,t);var n=Qh(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLineCap",value:function(){this.allowDrawLineCap()&&this.drawPerpendicularLineCap()}}]),e}(hh);function Lh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Sh=function(t){Cc()(e,t);var n=Lh(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLineCap",value:function(){if(this.allowDrawLineCap()){var t=this.line.lastLinePartControlPoint,n={x:.6,y:0},e=this.angleBetweenLastTwoPoints(),r={x:Math.cos(e)*n.x-Math.sin(e)*n.y,y:Math.sin(e)*n.x-Math.cos(e)*n.y},i={x:t.x+r.x,y:t.y+r.y};this.drawArrowLineCap(i)}}},{key:"setLineOptions",value:function(){this.ctx.lineWidth=.7*this.lineWidth}},{key:"drawLineFromControlPoints",value:function(){var t=this;this.ctx.save(),this.setLineOptions(),this.ctx.lineJoin="round",this.getProcessedLinePaths().forEach((function(n){t.ctx.save(),n.alpha&&t.setColor(n.alpha),t.ctx.beginPath();var e=n.controlPoints;[-.3,.3].forEach((function(n){var r=e[0].x-e[e.length-1].x,i=e[0].y-e[e.length-1].y,u=n/Math.pow(r*r+i*i,.5),o=-i*u,M=r*u,c=e.map((function(t){return{x:t.x+o,y:t.y+M}}));t.ctx.moveTo(c[0].x,c[0].y),2===e.length&&t.ctx.lineTo(c[1].x,c[1].y),3===e.length&&t.ctx.quadraticCurveTo(c[1].x,c[1].y,c[2].x,c[2].y),4===e.length&&t.ctx.bezierCurveTo(c[1].x,c[1].y,c[2].x,c[2].y,c[3].x,c[3].y),t.ctx.stroke()})),t.ctx.restore()})),this.ctx.restore()}}]),e}(hh);function kh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var vh=function(t){Cc()(e,t);var n=kh(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"apply",value:function(){var t=this;"HIDDEN"!==this.options.linesDisplay&&("START_HIDDEN"!==this.options.linesDisplay||this.options.animationGlobalProgress)&&(this.ctx.save(),this.ctx.lineWidth=this.lineWidth,this.playData.lines.forEach((function(n){if(!(t.options.linesHiddenIds.indexOf(n.id)>=0)){var e="".concat(Lt.a.capitalize(n.type),"LineLayer");ht[e]&&new ht[e](t,n).apply()}})),this.ctx.restore())}},{key:"lineWidth",get:function(){return this.courtTypeConstants.LINE_WIDTH}}]),e}(oh);function Yh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var mh=function(t){Cc()(e,t);var n=Yh(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"apply",value:function(){var t=this;this.playData.players.length&&(this.ctx.save(),this.playData.players.forEach((function(n){if(!(t.options.playersHiddenPositions.findIndex((function(t){return t===n.position}))>=0)){var e=n.location,r=e.x,i=e.y;if(t.setPlayerPuckStyle(n),t.drawPlayerPuck(n),t.setPlayerLabel(n),t.staticData.playerHats&&t.staticData.playerHats.length){var u=t.options.playersMap.find((function(t){return t.position===n.position})),o=t.staticData.playerHats.find((function(t){return!!(null==u?void 0:u.playerHatKey)&&t.key===u.playerHatKey}));if(o){!0===o.reverse&&(t.ctx.save(),t.ctx.translate(2*r,0),t.ctx.scale(-1,1));var M=o.dX,c=o.dY;t.ctx.drawImage(o.image,r-(2-4*M),i-(1.4+2*t.radius+2.8*c),4,2.8),!0===o.reverse&&t.ctx.restore()}}}})),this.ctx.restore())}},{key:"setPlayerPuckStyle",value:function(t){var n=t.color,e=n.red,r=n.green,i=n.blue,u=n.alpha,o=0===e&&0===r&&0===i&&1===u,M=this.options.position&&t.position===this.options.position,c=M?0:Math.ceil(255*e),N=M?0:Math.ceil(255*r),a=M?255:Math.ceil(255*i),s="rgba(".concat(c,", ").concat(N,", ").concat(a,", ").concat(u,")");t.isDefender&&!M&&o&&(s="#bb271b"),t.possession&&o&&(s="#ff8000"),this.options.legacyPrintStyle&&(this.ctx.lineWidth=this.courtTypeConstants.LINE_WIDTH),this.ctx.fillStyle=this.options.legacyPrintStyle?"#FFFFFF":s,this.ctx.strokeStyle=this.options.legacyPrintStyle?"#000000":s}},{key:"drawPlayerPuck",value:function(t){var n=t.location,e=n.x,r=n.y,i=this.options.legacyPrintStyle?1.2:1;this.ctx.beginPath(),this.ctx.arc(e,r,i*this.radius,0,2*Math.PI,!0),this.options.legacyPrintStyle&&t.possession&&this.ctx.stroke(),this.ctx.fill()}},{key:"setPlayerLabel",value:function(t){var n=t.location,e=n.x,r=n.y,i=this.options.playersMap.find((function(n){return n.position===t.position}));if(this.staticData.playerHeadshots&&"Headshot"===this.options.labelsOverrideType){var u=this.staticData.playerHeadshots.find((function(t){return t.id===(null==i?void 0:i.teamPlayerId)}));if(this.ctx.save(),this.ctx.translate(e,r),u){this.ctx.save();var o=u.image.width<u.image.height,M=u.image.height<u.image.width,c=o?u.image.height/u.image.width:M?u.image.width/u.image.height:1,N=2*this.radius*(o?u.image.width/u.image.height:1)*c,a=2*this.radius*(M?u.image.height/u.image.width:1)*c,s=0-(M?N/2:this.radius),D=0-(o?a/2:this.radius);this.options.flipPlayerLabels&&this.ctx.rotate(Math.PI),this.ctx.arc(0,0,this.radius,0,2*Math.PI,!0),this.ctx.clip(),this.ctx.drawImage(u.image,s,D,N,a),this.ctx.restore()}if(this.ctx.beginPath(),this.ctx.lineWidth=this.courtTypeConstants.LINE_WIDTH,this.ctx.arc(0,0,this.radius,0,2*Math.PI,!0),this.ctx.stroke(),this.ctx.restore(),u)return}var T=t.textLabel;if(i&&(i.textOverride&&(T=i.textOverride),i.teamPlayerId&&this.options.labelsOverrideType)){var g=this.staticData.teamPlayers.find((function(t){return t.id===i.teamPlayerId}));if(g){var l=g.User_Name.split(" ").map((function(t){return t[0]})).join("").slice(0,2);T=g.Initials||l,"Jersey number"===this.options.labelsOverrideType&&g.jersey_number&&(T="".concat(g.jersey_number))}}var I=t.color.alpha,y=(3-.5*T.length)*(this.options.legacyPrintStyle?1.3:1)*this.playerScale,h=(1-.15*T.length)*(this.options.legacyPrintStyle?1.4:1)*this.playerScale;if(I){this.ctx.fillStyle=this.options.legacyPrintStyle?"#000000":"#ffffff",this.ctx.textAlign="center",this.ctx.font="".concat(y,"px Helvetica"),this.options.mirror&&(this.ctx.save(),this.ctx.translate(2*e,0),this.ctx.scale(-1,1));var j=e,x=r;this.options.flipPlayerLabels&&(j=0,x=0,this.ctx.save(),this.ctx.translate(e,r),this.ctx.rotate(Math.PI)),this.ctx.fillText(T,j,x+h),this.options.flipPlayerLabels&&this.ctx.restore(),this.options.mirror&&this.ctx.restore()}}},{key:"staticData",get:function(){return this.options.staticData}},{key:"playerScale",get:function(){return this.courtTypeConstants.PLAYER_TOKEN_SCALE*this.options.playerTokenScale}},{key:"radius",get:function(){return this.courtTypeConstants.PLAYER_TOKEN_RADIUS*this.playerScale}}]),e}(oh);function Rh(t,n){var e=t.hideForStatic&&!n.inDrawingState?0:1;n.animationGlobalProgress&&(e=0,t.animations.map((function(t){var n=je()(t.keyTimes,2);return[n[0],n[1]]})).forEach((function(t){var r=je()(t,2),i=r[0],u=r[1],o=i-.03,M=i,c=u,N=u+.03;Lt.a.inRange(n.animationGlobalProgress,o,M)&&(e=10*(.03-(M-n.animationGlobalProgress))),Lt.a.inRange(n.animationGlobalProgress,i,u)&&(e=1),Lt.a.inRange(n.animationGlobalProgress,c,N)&&(e=10*(N-n.animationGlobalProgress))})));return e}function Fh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var bh=function(t){Cc()(e,t);var n=Fh(e);function e(t,r){var i;return pt()(this,e),i=n.call(this,t),Qt()(sh()(i),"shape",void 0),Qt()(sh()(i),"animationAlpha",void 0),i.shape=r,i.animationAlpha=Rh(r,t.options),i}return dt()(e,[{key:"drawLogic",value:function(){var t=this.shape,n=t.location,e=t.scale,r=t.angleRad;this.ctx.translate(n.x,n.y),this.ctx.rotate(r),this.ctx.scale(e.x,e.y),this.setLineWidth(),this.setColor(),this.drawShape(),this.drawShapeWrapPoints()}},{key:"setLineWidth",value:function(){this.ctx.lineWidth=this.courtTypeConstants.COURT_LINE_WIDTH}},{key:"setColor",value:function(){var t=this.shape.color,n=t.alpha,e=t.blue,r=t.green,i=t.red,u=Math.ceil(255*i),o=Math.ceil(255*r),M=Math.ceil(255*e);this.ctx.fillStyle="rgba(".concat(u,", ").concat(o,", ").concat(M,", ").concat(n*this.animationAlpha,")"),this.ctx.strokeStyle="rgba(".concat(u,", ").concat(o,", ").concat(M,", ").concat(n?this.animationAlpha:0,")")}},{key:"drawShapeWrapPoints",value:function(){}},{key:"drawShape",value:function(){this.ctx.save(),this.drawShapeLogic(),this.drawShapeBorder(),this.ctx.restore()}},{key:"drawShapeBorder",value:function(){this.shape.showBorder&&this.ctx.stroke()}},{key:"drawShapeLogic",value:function(){}},{key:"staticData",get:function(){return this.options.staticData}}]),e}(Qc);function Zh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Bh=function(t){Cc()(e,t);var n=Zh(e);function e(t,r){return pt()(this,e),n.call(this,t,r)}return dt()(e,[{key:"drawLineFromControlPoints",value:function(){}},{key:"drawArrowLineCap",value:function(t){}},{key:"handOffLineCap",value:function(t){}},{key:"drawPerpendicularLineCap",value:function(){}},{key:"angleBetweenLastTwoPoints",value:function(){return 0}}]),dt()(e,[{key:"setLineWidth",value:function(){this.ctx.lineWidth=this.courtTypeConstants.LINE_WIDTH}},{key:"getProcessedLinePaths",value:function(){return[this.shape.linePart]}},{key:"drawShapeLogic",value:function(){this.drawLine(),this.drawLineCap()}},{key:"drawLine",value:function(){}},{key:"drawLineCap",value:function(){}}]),e}(bh);function Vh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}Object.assign(Bh.prototype,Dh);var Wh=function(t){Cc()(e,t);var n=Vh(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLine",value:function(){this.drawLineFromControlPoints()}},{key:"drawLineCap",value:function(){this.drawArrowLineCap()}}]),e}(Bh);function Gh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Ph=function(t){Cc()(e,t);var n=Gh(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"convertLinePartsToDribble",value:function(t){return[]}},{key:"drawLine",value:function(){this.drawLineFromControlPoints()}},{key:"drawLineCap",value:function(){this.drawArrowLineCap()}},{key:"getProcessedLinePaths",value:function(){return this.convertLinePartsToDribble(Ee()(this.shape.linePart?[this.shape.linePart]:[]))}}]),e}(Bh);function Jh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}Object.assign(Ph.prototype,zh);var Hh=function(t){Cc()(e,t);var n=Jh(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLine",value:function(){this.drawLineFromControlPoints()}},{key:"drawLineCap",value:function(){this.handOffLineCap(this.getProcessedLinePaths())}}]),e}(Bh);function Kh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Xh=function(t){Cc()(e,t);var n=Kh(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLine",value:function(){this.drawLineFromControlPoints()}},{key:"drawLineCap",value:function(){this.drawArrowLineCap()}},{key:"setLineOptions",value:function(){this.ctx.setLineDash([1,.5])}}]),e}(Bh);function qh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var _h=function(t){Cc()(e,t);var n=qh(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLine",value:function(){this.drawLineFromControlPoints()}},{key:"drawLineCap",value:function(){this.drawPerpendicularLineCap()}}]),e}(Bh);function $h(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var tj=function(t){Cc()(e,t);var n=$h(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawShapeLogic",value:function(){var t=this.shape.outerCircleRadius;this.ctx.beginPath(),this.ctx.arc(0,0,t,0,2*Math.PI),this.ctx.fill()}}]),e}(bh);function nj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var ej=function(t){Cc()(e,t);var n=nj(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawShapeLogic",value:function(){var t=this.shape,n=t.color,e=t.outerCircleRadius;if(0!==n.alpha&&this.staticData.shapes&&this.staticData.shapes.length){var r=this.staticData.shapes.find((function(t){return"cone"===t.key}));r&&(this.ctx.globalAlpha=this.animationAlpha,this.ctx.drawImage(r.image,-e/2,-e/2,e,e))}}}]),e}(bh);function rj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var ij=function(t){Cc()(e,t);var n=rj(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawShapeLogic",value:function(){var t=this.shape.shapeControlPoints;this.ctx.rotate(Math.PI),this.ctx.beginPath(),this.ctx.moveTo(t[0].x,t[0].y),this.ctx.lineTo(t[1].x,t[1].y),this.ctx.lineTo(t[2].x,t[2].y),this.ctx.lineTo(t[0].x,t[0].y),this.ctx.fill()}}]),e}(bh);function uj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var oj=function(t){Cc()(e,t);var n=uj(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawShapeLogic",value:function(){var t=this.shape.outerCircleRadius;this.ctx.beginPath(),this.ctx.rect(-t/2,-t/2,t,t),this.ctx.fill()}}]),e}(bh);function Mj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var cj=function(t){Cc()(e,t);var n=Mj(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawShapeLogic",value:function(){var t=this.shape.shapeControlPoints;this.ctx.beginPath(),this.ctx.moveTo(t[0].x,t[0].y),this.ctx.lineTo(t[1].x,t[1].y),this.ctx.lineTo(t[2].x,t[2].y),this.ctx.lineTo(t[3].x,t[3].y),this.ctx.lineTo(t[0].x,t[0].y),this.ctx.fill()}}]),e}(bh);function Nj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var aj=function(t){Cc()(e,t);var n=Nj(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawShapeLogic",value:function(){var t=this.shape.shapeControlPoints;this.ctx.beginPath(),this.ctx.moveTo(t[0].x,t[0].y),this.ctx.lineTo(t[1].x,t[1].y),this.ctx.lineTo(t[2].x,t[2].y),this.ctx.lineTo(t[0].x,t[0].y),this.ctx.fill()}}]),e}(bh);function sj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Dj=function(t){Cc()(e,t);var n=sj(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawShapeLogic",value:function(){var t=this.shape.shapeControlPoints;this.ctx.beginPath(),this.ctx.moveTo(t[0].x,t[0].y),this.ctx.lineTo(t[0].x+1,t[0].y),this.ctx.lineTo(0,-1),this.ctx.lineTo(t[1].x-1,t[1].y),this.ctx.lineTo(t[1].x,t[1].y),this.ctx.lineTo(1,0),this.ctx.lineTo(t[2].x,t[2].y),this.ctx.lineTo(t[2].x-1,t[2].y),this.ctx.lineTo(0,1),this.ctx.lineTo(t[3].x+1,t[2].y),this.ctx.lineTo(t[3].x,t[3].y),this.ctx.lineTo(-1,0),this.ctx.lineTo(t[0].x,t[0].y),this.ctx.fill()}}]),e}(bh);function Tj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var gj=function(t){Cc()(e,t);var n=Tj(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"apply",value:function(){var t=this;this.ctx.save(),this.playData.shapes.forEach((function(n){var e=n.type.match("LINE.")?"".concat(Lt.a.capitalize(n.type.replace("LINE.","")),"Line"):Lt.a.capitalize(n.type),r="".concat(e,"ShapeLayer");jt[r]&&new jt[r](t,n).apply()})),this.ctx.restore()}}]),e}(oh),lj=function(){function t(n){pt()(this,t),Qt()(this,"originalData",void 0),Qt()(this,"adjustedData",void 0),this.originalData=JSON.parse(JSON.stringify(n)),this.adjustedData=JSON.parse(JSON.stringify(n))}return dt()(t,[{key:"_getAttrOriginal",value:function(t){return this.originalData[t]}},{key:"_getAttr",value:function(t){return this.adjustedData[t]}},{key:"_setAttr",value:function(t,n){this.adjustedData[t]=n}}]),t}();function Ij(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var yj={red:.502,green:.502,blue:.502,alpha:.35},hj=function(t){Cc()(e,t);var n=Ij(e);function e(t){var r;return pt()(this,e),r=n.call(this,t),Qt()(sh()(r),"internalCanvas",void 0),r.internalCanvas=document.createElement("canvas"),r}return dt()(e,[{key:"preProcessedTextForContext",value:function(){var t=this._getLines(),n=t.reduce((function(t,n){return t.width>n.width?t:n})).width;return{lines:t,box:{width:n+2*e.NOTE_WRAP_PADDING,height:t.length*this.lineHeight+2*e.NOTE_WRAP_PADDING}}}},{key:"_getLines",value:function(){this.internalCtx.font=this.fontComputed,this.internalCtx.textBaseline=this.textBaseline;for(var t=e.NOTE_WRAP_MAX_WIDTH-2*e.NOTE_WRAP_PADDING,n=[],r=this.text.split(" ").reduce((function(t,n){if(!n.match(/\n/))return t.push(n),t;for(var e=[],r="",i=0;i<n.length;i++){var u=n[i];"\n"!==u?r+=u:(r.length&&e.push(r),e.push(""),r="")}return r.length&&e.push(r),e.forEach((function(n,r){if(!n)return t.push("\n");t.push(n),e[r+1]&&t.push("\n")})),t}),[]),i=1;r.length>0;){var u=r.slice(0,i),o=this._getLineInfo(u);if(o.width<t&&i<=r.length&&!o.hasLineBreak)i++;else{1!==i&&i--;var M=r.splice(0,i),c=this._getLineInfo(M);n.push(c),i=1;var N=!r.some((function(t){return"\n"!==t}));c.width&&o.hasLineBreak&&!N&&r.splice(0,1)}}return n}},{key:"_getLineInfo",value:function(t){var n=this,e=0,r=!1,i=[];return t.forEach((function(u,o){if("\n"!==u){var M=Ee()(u.matchAll(/(<player=(\d*)>)/gi)),c={text:u,width:M.length?n.internalCtx.measureText(u.replace(/<player=(\d*)>/,"")).width+2*n.playerTokenRadius:n.internalCtx.measureText(u).width};e+=c.width,o!==t.length-1&&(e+=n.internalCtx.measureText(" ").width),i.push(c)}else r=!0})),{words:i,width:e,hasLineBreak:r}}},{key:"noteWrapperContains",value:function(t){var n=t.x,e=t.y,r=this.preProcessedTextForContext().box,i=this.location,u={x:i.x+r.width,y:i.y},o=u.y+r.height;return i.x<=n&&n<=u.x&&i.y<=e&&e<=o}},{key:"id",get:function(){return this._getAttr("id")}},{key:"text",get:function(){return this._getAttr("text")}},{key:"location",get:function(){return this._getAttr("location")}},{key:"color",get:function(){return this._getAttr("color")||yj}},{key:"showBorder",get:function(){return this._getAttr("showBorder")}},{key:"animations",get:function(){return this._getAttr("animations")||[]}},{key:"hideForStatic",get:function(){return this._getAttr("hideForStatic")}},{key:"font",get:function(){return this._getAttr("font")||{bold:!1,italic:!1,underline:!1,strikethrough:!1,fontSize:12}}},{key:"fontSize",get:function(){return this.font.fontSize/10}},{key:"lineHeight",get:function(){return this.fontSize+this.lineHeightOffset}},{key:"lineHeightOffset",get:function(){return.3*this.fontSize}},{key:"baseLineOffset",get:function(){return.1*this.fontSize}},{key:"playerTokenRadius",get:function(){return this.fontSize/2}},{key:"fontComputed",get:function(){var t=[];return this.font.bold&&t.push("bold"),this.font.italic&&t.push("italic"),t.push("".concat(this.fontSize,"px")),t.push("Arial"),t.join(" ")}},{key:"textBaseline",get:function(){return"alphabetic"}},{key:"internalCtx",get:function(){return this.internalCanvas.getContext("2d")}}],[{key:"NOTE_WRAP_MAX_WIDTH",get:function(){return 40}},{key:"NOTE_WRAP_PADDING",get:function(){return.43}}]),e}(lj);function jj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var xj=function(t){Cc()(e,t);var n=jj(e);function e(){var t;pt()(this,e);for(var r=arguments.length,i=new Array(r),u=0;u<r;u++)i[u]=arguments[u];return t=n.call.apply(n,[this].concat(i)),Qt()(sh()(t),"animationAlpha",void 0),t}return dt()(e,[{key:"apply",value:function(){var t=this;this.ctx.save(),this.disableMirrorMode(),this.playData.notes.forEach((function(n){t.ctx.save(),t.animationAlpha=Rh(n,t.options),t.setColor(n);var e=n.location;t.ctx.translate(e.x,e.y);var r=n.preProcessedTextForContext(),i=r.lines,u=r.box;t.setFont(n),t.drawBubble(n,u),t.drawText(n,i),t.ctx.restore()})),this.ctx.restore()}},{key:"setColor",value:function(t){if(void 0===this.animationAlpha)throw new Error("animationAlpha is not set");var n=t.color,e=n.alpha,r=n.blue,i=n.green,u=n.red,o=Math.ceil(255*u),M=Math.ceil(255*i),c=Math.ceil(255*r);this.ctx.fillStyle="rgba(".concat(o,", ").concat(M,", ").concat(c,", ").concat(e*this.animationAlpha,")"),this.ctx.strokeStyle="rgba(".concat(o,", ").concat(M,", ").concat(c,", ").concat(this.animationAlpha,")"),this.options.noteSelectedId===t.id&&(this.ctx.setLineDash([.5,.5]),this.ctx.strokeStyle="rgba(28, 127, 181, ".concat(this.animationAlpha,")"))}},{key:"setFont",value:function(t){this.ctx.font=t.fontComputed,this.ctx.textBaseline=t.textBaseline}},{key:"drawBubble",value:function(t,n){var e=n.width,r=n.height;this.ctx.lineWidth=this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.rect(0,0,e,r),this.ctx.fill(),(t.showBorder||this.options.noteSelectedId===t.id)&&this.ctx.stroke()}},{key:"drawText",value:function(t,n){var e=this;n.forEach((function(n,r){var i=n.words;e.ctx.save(),e.ctx.translate(hj.NOTE_WRAP_PADDING,t.fontSize+hj.NOTE_WRAP_PADDING+t.lineHeight*r);var u=0;i.forEach((function(n,r){var o=Ee()(n.text.matchAll(/(<player=(\d*)>)/gi));o.length&&0===o[0].index&&(e.drawPlayerToken(t,u,o[0][2]),u+=2*t.playerTokenRadius),e.ctx.fillStyle="rgba(0, 0, 0, ".concat(e.animationAlpha,")");var M=o.length?n.text.replace(/(<player=(\d*)>)/gi,""):n.text;e.ctx.fillText(M,u,-t.baseLineOffset),u+=n.width,o.length&&(u-=2*t.playerTokenRadius),o.length&&o[0].index>0&&(e.drawPlayerToken(t,u,o[0][2]),u+=2*t.playerTokenRadius),r!==i.length-1&&(e.ctx.fillText(" ",u,-t.baseLineOffset),u+=e.ctx.measureText(" ").width)})),(t.font.underline||t.font.strikethrough)&&(e.ctx.lineWidth=.07*t.fontSize,e.ctx.strokeStyle="rgba(0, 0, 0, ".concat(e.animationAlpha,")"),e.ctx.beginPath(),t.font.underline&&(e.ctx.moveTo(0,t.baseLineOffset),e.ctx.lineTo(u,t.baseLineOffset)),t.font.strikethrough&&(e.ctx.moveTo(0,-t.fontSize/2+t.baseLineOffset),e.ctx.lineTo(u,-t.fontSize/2+t.baseLineOffset)),e.ctx.stroke()),e.ctx.restore()}))}},{key:"drawPlayerToken",value:function(t,n,e){this.ctx.save(),this.ctx.translate(n+t.playerTokenRadius,0),this.ctx.beginPath(),this.ctx.strokeStyle="rgba(255, 255, 255, ".concat(this.animationAlpha,")"),this.ctx.fillStyle="rgba(243, 111, 33, ".concat(this.animationAlpha,")"),this.ctx.arc(0,-t.fontSize/2,t.playerTokenRadius,0,2*Math.PI),this.ctx.fill(),this.ctx.stroke();var r=.8*t.fontSize;this.ctx.font="".concat(r,"px Arial");var i=-this.ctx.measureText(e).width/2,u=-r/4;this.ctx.fillStyle="rgba(255, 255, 255, ".concat(this.animationAlpha,")"),this.ctx.fillText(e,i,u),this.ctx.restore()}},{key:"scale",value:function(t){return t/this.options.scale}}]),e}(oh);function zj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Oj=function(t){Cc()(e,t);var n=zj(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"apply",value:function(){var t=this;"HIDDEN"!==this.options.linesDisplay&&("START_HIDDEN"!==this.options.linesDisplay||this.options.animationGlobalProgress)&&(this.ctx.save(),this.playData.lines.forEach((function(n){t.options.linesSelectedIds.includes(n.id)&&n.baseLineParts().forEach((function(n){t.ctx.save(),t.ctx.fillStyle="blue",n.controlPoints.forEach((function(n){t.ctx.beginPath(),t.ctx.arc(n.x,n.y,.4,0,2*Math.PI,!0),t.ctx.fill()})),t.ctx.restore()}))})),this.ctx.restore())}}]),e}(oh);function Ej(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Aj=function(t){Cc()(e,t);var n=Ej(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"apply",value:function(){var t=this;this.ctx.save(),this.ctx.fillStyle="blue",this.playData.shapes.forEach((function(n){var e=n.id,r=n.color,i=n.controlPointsTranslated;t.options.shapeSelectedId===e&&0!==r.alpha&&i.forEach((function(n){t.ctx.beginPath(),t.ctx.arc(n.x,n.y,.4,0,2*Math.PI,!0),t.ctx.fill()}))})),this.ctx.restore()}}]),e}(oh);function fj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var pj=function(t){Cc()(e,t);var n=fj(e);function e(t){var r;return pt()(this,e),r=n.call(this,t),Qt()(sh()(r),"lineParts",void 0),Qt()(sh()(r),"linePartsAdjusted",void 0),r.lineParts=t.lineParts,r.linePartsAdjusted=Ee()(t.lineParts),r}return dt()(e,[{key:"baseLineParts",value:function(){return this.lineParts}},{key:"setLinePartsAdjusted",value:function(t){this.linePartsAdjusted=t}},{key:"setLinePartsAdjustedAtIndex",value:function(t,n){switch(t){case"fist":this.linePartsAdjusted[0]=n;break;case"last":this.linePartsAdjusted[this.linePartsAdjusted.length-1]=n;break;default:this.linePartsAdjusted[t]=n}}},{key:"setAnimationKeyTimesChunked",value:function(t){var n=this,e=[];if(this.animations[0].keyTimes.forEach((function(t,r){r&&e.push([n.animations[0].keyTimes[r-1],t])})),e.length!==this.getLineParts().length){var r=e,i=je()(r,1),u=je()(i[0],2),o=u[0],M=u[1],c=je()(t.animations,1)[0],N=c.keyTimes.indexOf(o),a=c.keyTimes.indexOf(M);if(N>=0&&a>=0){var s=c.keyTimes.slice(N,a+1);e=[],s.forEach((function(t,n){n&&e.push([s[n-1],t])}))}}this.animationKeyTimeChunks=e}},{key:"addLinePartAdjusted",value:function(t){this.linePartsAdjusted.push(t)}},{key:"getLineParts",value:function(){return this.linePartsAdjusted.length?this.linePartsAdjusted:this.lineParts}},{key:"id",get:function(){return this._getAttr("id")}},{key:"color",get:function(){return this._getAttr("color")},set:function(t){this._setAttr("color",t)}},{key:"type",get:function(){return this._getAttr("type")}},{key:"phase",get:function(){return this._getAttr("phase")}},{key:"playerPositionOrigin",get:function(){return this._getAttr("playerPositionOrigin")}},{key:"playerPositionTerminus",get:function(){return this._getAttr("playerPositionTerminus")}},{key:"playerLineSequence",get:function(){return this._getAttr("playerLineSequence")}},{key:"hideLineTip",get:function(){return this._getAttr("hideLineTip")}},{key:"animations",get:function(){return this._getAttr("animations")}},{key:"animationsByEndTime",get:function(){return this._getAttr("animations").map((function(t){return Lt.a.last(t.keyTimes)}))}},{key:"animationKeyTimeChunks",get:function(){return this._getAttr("animationKeyTimeChunks")||[]},set:function(t){this._setAttr("animationKeyTimeChunks",t)}},{key:"lastAnimEndTime",get:function(){return Lt.a.max(this.animationsByEndTime)}},{key:"firstLinePartControlPoint",get:function(){return this.lineParts[0].controlPoints[0]}},{key:"lastLinePartControlPoint",get:function(){return Ee()(Ee()(this.lineParts).pop().controlPoints).pop()}}]),e}(lj);function Uj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var dj=function(t){Cc()(e,t);var n=Uj(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"setPossession",value:function(t){var n=this;if(t.length){var e=this.possession?1:0;e+=t.filter((function(t){return t.playerPositionTerminus===n.position})).length,e-=t.filter((function(t){return t.playerPositionOrigin===n.position})).length,this.possession=e>0}}},{key:"id",get:function(){return this._getAttr("id")}},{key:"textOverride",get:function(){return this._getAttr("textOverride")},set:function(t){this._setAttr("textOverride",t)}},{key:"textLabel",get:function(){return this._getAttr("textOverride")||this.position}},{key:"isDefender",get:function(){return this.position.indexOf("x")>=0}},{key:"possession",get:function(){return this._getAttr("possession")},set:function(t){this._setAttr("possession",t)}},{key:"position",get:function(){return this._getAttr("position")}},{key:"location",get:function(){return this._getAttr("location")},set:function(t){this._setAttr("location",t)}},{key:"color",get:function(){return this._getAttr("color")}},{key:"animations",get:function(){return this._getAttr("animations")}},{key:"animationsByEndTime",get:function(){return this._getAttr("animations").map((function(t){return Lt.a.last(t.keyTimes)}))}},{key:"lastAnimEndTime",get:function(){return Lt.a.max(this.animationsByEndTime)}},{key:"lastAnimation",get:function(){return Ee()(this.animations).pop()}},{key:"lastAnimationLastLinePartControlPoint",get:function(){return Ee()(Ee()(this.lastAnimation.lineParts).pop().controlPoints).pop()}}]),e}(lj);function Cj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Qj=function(t){Cc()(e,t);var n=Cj(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"rectWrapperContains",value:function(t){var n=je()(this.rectWrapPointsTranslated,4),e=n[0],r=n[1],i=n[2],u=n[3];return+[[e,t,r],[r,t,i],[i,t,u],[u,t,e]].reduce((function(t,n){var e=je()(n,3),r=e[0],i=e[1],u=e[2];return t+Math.abs(i.x*r.y-r.x*i.y+(u.x*i.y-i.x*u.y)+(r.x*u.y-u.x*r.y))/2}),0).toFixed(2)<=this.rectWrapAreaTranslated}},{key:"computeCenterForRect",value:function(t){var n=je()(t,4),e=n[0],r=n[1],i=n[2],u=n[3];return{x:(e.x+i.x)/2,y:(r.y+u.y)/2}}},{key:"computeShapeAreaForPointAtIndex",value:function(t,n){var e=je()(this.rectWrapPointsTranslated,3),r=e[0],i=e[1],u=e[2],o=this.computeRectWrapPointsTranslatedForPointAtIndex(t,n),M=je()(o,4),c=M[0],N=M[1],a=M[2],s=M[3];return{scale:{x:yc(c,N)*this.scale.x/yc(r,i),y:yc(N,a)*this.scale.y/yc(i,u)},location:this.computeCenterForRect([c,N,a,s])}}},{key:"computeRectWrapPointsTranslatedForPointAtIndex",value:function(t,n){var e=this,r=kt(t.x,t.y,this.location.x,this.location.y,-this.angle),i=this.rectWrapPointsTranslated.map((function(t){return kt(t.x,t.y,e.location.x,e.location.y,-e.angle)})).map((function(t,e){return n===e?r:t}));return 0===n&&(i[1].y=r.y,i[3].x=r.x),1===n&&(i[0].y=r.y,i[2].x=r.x),2===n&&(i[1].x=r.x,i[3].y=r.y),3===n&&(i[0].x=r.x,i[2].y=r.y),i.map((function(t){return kt(t.x,t.y,e.location.x,e.location.y,e.angle)}))}},{key:"revertPointTranslation",value:function(t){var n={x:t.x-this.location.x,y:t.y-this.location.y};return kt(n.x,n.y,0,0,-this.angle)}},{key:"id",get:function(){return this._getAttr("id")}},{key:"location",get:function(){return this._getAttr("location")}},{key:"scale",get:function(){return this._getAttr("scale")}},{key:"angle",get:function(){return this._getAttr("angle")||0}},{key:"angleRad",get:function(){return this.angle*Math.PI/180}},{key:"color",get:function(){return this._getAttr("color")}},{key:"type",get:function(){return this._getAttr("type")}},{key:"showBorder",get:function(){return this._getAttr("showBorder")}},{key:"outerCircleRadius",get:function(){return 10}},{key:"linePart",get:function(){return this._getAttr("linePart")}},{key:"animations",get:function(){return this._getAttr("animations")||[]}},{key:"hideForStatic",get:function(){return this._getAttr("hideForStatic")}},{key:"rectWrapPointsPure",get:function(){return[{x:-this.outerCircleRadius/2,y:-this.outerCircleRadius/2},{x:this.outerCircleRadius/2,y:-this.outerCircleRadius/2},{x:this.outerCircleRadius/2,y:this.outerCircleRadius/2},{x:-this.outerCircleRadius/2,y:this.outerCircleRadius/2}]}},{key:"rectWrapPointsTranslated",get:function(){var t=this;return this.rectWrapPointsPure.map((function(n){var e={x:n.x*t.scale.x,y:n.y*t.scale.y},r=kt(e.x,e.y,0,0,t.angle);return{x:r.x+t.location.x,y:r.y+t.location.y}}))}},{key:"controlPointsTranslated",get:function(){return this.rectWrapPointsTranslated}},{key:"rectWrapAreaTranslated",get:function(){var t=je()(this.rectWrapPointsTranslated,3),n=t[0],e=t[1],r=t[2];return+(yc(n,e)*yc(e,r)).toFixed(2)}}]),e}(lj);function wj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Lj=function(t){Cc()(e,t);var n=wj(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"rectWrapPointsPure",get:function(){return Ec(this.linePart.controlPoints)}},{key:"controlPointsTranslated",get:function(){var t=this;return this.linePart.controlPoints.map((function(n){var e={x:n.x*t.scale.x,y:n.y*t.scale.y},r=kt(e.x,e.y,0,0,t.angle);return{x:r.x+t.location.x,y:r.y+t.location.y}}))}},{key:"shapeControlPoints",get:function(){return[]}}]),e}(Qj);function Sj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var kj=function(t){Cc()(e,t);var n=Sj(e);function e(){return pt()(this,e),n.apply(this,arguments)}return e}(Lj);function vj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Yj=function(t){Cc()(e,t);var n=vj(e);function e(){return pt()(this,e),n.apply(this,arguments)}return e}(Lj);function mj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Rj=function(t){Cc()(e,t);var n=mj(e);function e(){return pt()(this,e),n.apply(this,arguments)}return e}(Lj);function Fj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var bj=function(t){Cc()(e,t);var n=Fj(e);function e(){return pt()(this,e),n.apply(this,arguments)}return e}(Lj);function Zj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Bj=function(t){Cc()(e,t);var n=Zj(e);function e(){return pt()(this,e),n.apply(this,arguments)}return e}(Lj);function Vj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Wj=function(t){Cc()(e,t);var n=Vj(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"outerCircleRadius",get:function(){return 5}},{key:"rectWrapPointsPure",get:function(){return[{x:-this.outerCircleRadius,y:-this.outerCircleRadius},{x:this.outerCircleRadius,y:-this.outerCircleRadius},{x:this.outerCircleRadius,y:this.outerCircleRadius},{x:-this.outerCircleRadius,y:this.outerCircleRadius}]}},{key:"shapeControlPoints",get:function(){return[]}}]),e}(Qj);function Gj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Pj=function(t){Cc()(e,t);var n=Gj(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"outerCircleRadius",get:function(){return 5}},{key:"shapeControlPoints",get:function(){return this.rectWrapPointsPure}}]),e}(Qj);function Jj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Hj=function(t){Cc()(e,t);var n=Jj(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"outerCircleRadius",get:function(){return 8}},{key:"shapeControlPoints",get:function(){return[{x:0,y:-this.outerCircleRadius},{x:-this.outerCircleRadius*Math.cos(220)/2,y:this.outerCircleRadius*Math.sin(240)},{x:this.outerCircleRadius*Math.cos(220)/2,y:this.outerCircleRadius*Math.sin(240)}]}},{key:"rectWrapPointsPure",get:function(){return[{x:-this.outerCircleRadius,y:-this.outerCircleRadius},{x:this.outerCircleRadius,y:-this.outerCircleRadius},{x:this.outerCircleRadius,y:this.outerCircleRadius},{x:-this.outerCircleRadius,y:this.outerCircleRadius}]}}]),e}(Qj);function Kj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Xj=function(t){Cc()(e,t);var n=Kj(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"outerCircleRadius",get:function(){return 10}},{key:"shapeControlPoints",get:function(){return this.rectWrapPointsPure}}]),e}(Qj);function qj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var _j=function(t){Cc()(e,t);var n=qj(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"outerCircleRadius",get:function(){return 10}},{key:"shapeControlPoints",get:function(){return this.rectWrapPointsPure}},{key:"rectWrapPointsPure",get:function(){return[{x:-this.outerCircleRadius,y:-.5},{x:this.outerCircleRadius,y:-.5},{x:this.outerCircleRadius,y:.5},{x:-this.outerCircleRadius,y:.5}]}}]),e}(Qj);function $j(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var tx=function(t){Cc()(e,t);var n=$j(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"outerCircleRadius",get:function(){return 10}},{key:"shapeControlPoints",get:function(){return[{x:0,y:-this.outerCircleRadius},{x:this.outerCircleRadius*Math.cos(210),y:this.outerCircleRadius*Math.sin(210)},{x:-this.outerCircleRadius*Math.cos(210),y:this.outerCircleRadius*Math.sin(210)}]}},{key:"rectWrapPointsPure",get:function(){return[{x:-this.outerCircleRadius,y:-this.outerCircleRadius},{x:this.outerCircleRadius,y:-this.outerCircleRadius},{x:this.outerCircleRadius,y:this.outerCircleRadius},{x:-this.outerCircleRadius,y:this.outerCircleRadius}]}}]),e}(Qj);function nx(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var ex=function(t){Cc()(e,t);var n=nx(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"outerCircleRadius",get:function(){return 10}},{key:"shapeControlPoints",get:function(){return this.rectWrapPointsPure}}]),e}(Qj);function rx(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,r)}return e}function ix(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?rx(Object(e),!0).forEach((function(n){Qt()(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):rx(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}var ux=function(){function t(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;pt()(this,t),this.play=n,this.phase=e,this.animationGlobalProgress=r,Qt()(this,"ctx",void 0),Qt()(this,"animationGlobalProgressPrev",void 0),this.animationGlobalProgressPrev=r,this.ctx=null}return dt()(t,[{key:"draw",value:function(){if(!this.ctx)throw new Error("Canvas context is not provided. Please use setContext() method.");this.ctx.clearRect(0,0,this.frameWidth,this.frameHeight),this._init();var t=this.frameData,n=this.frameDataOptions;return new Nh(this.ctx,t,n).apply(),new gj(this.ctx,t,n).apply(),new vh(this.ctx,t,n).apply(),new mh(this.ctx,t,n).apply(),new Oj(this.ctx,t,n).apply(),new Aj(this.ctx,t,n).apply(),new xj(this.ctx,t,n).apply(),this}},{key:"_init",value:function(){if(!this.ctx)throw new Error("Canvas context is not provided. Please use setContext() method.");this.ctx.canvas.width=this.frameWidth,this.ctx.canvas.height=this.frameHeight,this.ctx.scale(this.play.scale,this.play.scale),this.ctx.translate(-this.court.courtRect.origin.x,-this.court.courtRect.origin.y),this.play.options.mirror&&(this.ctx.scale(-1,1),this.ctx.translate(2*Math.abs(this.court.courtRect.origin.x)-this.court.courtRect.size.width,0))}},{key:"setContext",value:function(t){return this.ctx=t,this}},{key:"setPhase",value:function(t){return this.phase=t,this}},{key:"setAnimationGlobalProgress",value:function(t){return this.animationGlobalProgressPrev=this.animationGlobalProgress,this.animationGlobalProgress=t,this}},{key:"animationProgress",value:function(t,n){return St(this.animationGlobalProgress,t,n)}},{key:"closestObjectToPoint",value:function(t,n){var e=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3?arguments[3]:void 0,i=e?this.convertViewPointToCourtPoint(t):t;return"player"===n?this.closestPlayerToPoint(i,r):"shape"===n?this.closestShapeToPoint(i):"note"===n?this.closestNoteToPoint(i):"line"===n?this.closestLineToPoint(i,r):"lineVertex"===n?this.closestLineVertexToPoint(i,r):null}},{key:"closestLineToPoint",value:function(t,n){var e=this,r=this.lines.filter((function(t){return!n||n(t)})).reduce((function(n,r){return r.lineParts.forEach((function(i){for(var u=ze()(Ae,Ee()(i.controlPoints)),o=1;o<=100;o++){var M=o/100,c=e.prepareCourtPoint({x:u.x(M),y:u.y(M)});n.push({object:r,objectPoint:c,distance:yc(c,t)})}})),n}),[]);return Lt.a.minBy(r,"distance")}},{key:"closestLineVertexToPoint",value:function(t,n){var e=this,r=this.lines.filter((function(t){return!n||n(t)})).reduce((function(n,r){if(!r.id.length)return n;var i=e.prepareCourtPoint(r.firstLinePartControlPoint),u=e.prepareCourtPoint(r.lastLinePartControlPoint);return n.push({object:r,objectPoint:i,distance:yc(i,t)}),n.push({object:r,objectPoint:u,distance:yc(u,t)}),n}),[]);return Lt.a.minBy(r,"distance")}},{key:"closestPlayerToPoint",value:function(t,n){var e=this,r=this.players.filter((function(t){return!n||n(t)})).reduce((function(n,r){var i=e.prepareCourtPoint(r.location);return n.push({object:r,objectPoint:i,distance:yc(i,t)}),n}),[]);return Lt.a.minBy(r,"distance")}},{key:"closestShapeToPoint",value:function(t){var n=this,e=this.shapes.filter((function(n){return n.rectWrapperContains(t)})).reduce((function(e,r){var i=n.prepareCourtPoint(r.location);return e.push({object:r,objectPoint:i,distance:yc(i,t)}),e}),[]);return Lt.a.minBy(e,"distance")}},{key:"closestNoteToPoint",value:function(t){var n=this,e=this.notes.filter((function(n){return n.noteWrapperContains(t)})).reduce((function(e,r){var i=n.prepareCourtPoint(r.location);return e.push({object:r,objectPoint:i,distance:yc(i,t)}),e}),[]);return e.length?Lt.a.minBy(e,"distance"):null}},{key:"prepareCourtPoint",value:function(t){var n=this.play.options.mirror,e=this.play.playData.court.courtRect.size.width,r=this.play.playData.court.courtRect.origin;return{x:n?e+r.x-(t.x-r.x):t.x,y:t.y}}},{key:"convertViewPointToCourtPoint",value:function(t){var n=this.play.playData.court.courtRect.origin,e=n.x,r=n.y;return{x:t.x/this.play.scale+e,y:t.y/this.play.scale+r}}},{key:"sport",get:function(){var t=this.play.playData,n=t.court,e=t.sport;return e||([Ln,wn].includes(n.type)?gn:Dn)}},{key:"court",get:function(){var t=this.play.playData.court;return ix({},t,{type:t.type===Ln?wn:t.type})}},{key:"frameWidth",get:function(){return this.play.width}},{key:"frameHeight",get:function(){return this.play.height}},{key:"frameData",get:function(){return{sport:this.sport,court:this.court,lines:this.lines,players:this.players,shapes:this.shapes,notes:this.notes}}},{key:"frameDataOptions",get:function(){return ix({},this.play.options,{staticData:this.play.staticData,scale:this.play.scale,animationGlobalProgress:this.animationGlobalProgress,playAnimationDuration:this.playAnimationDuration})}},{key:"playAnimationDuration",get:function(){return this.play.playData.lines.reduce((function(t,n){var e=new pj(n).lastAnimEndTime;return t>e?t:e}),0)}},{key:"lines",get:function(){return this.animationGlobalProgress?this.animationProgressLines:this.currentPhaseLines}},{key:"players",get:function(){return this.animationGlobalProgress?this.animationProgressPlayers:this.currentPhasePlayers}},{key:"shapes",get:function(){return this.play.playData.shapes?this.play.playData.shapes.filter((function(t){return void 0!==xt[vt(t.type)]})).map((function(t){return new(xt[vt(t.type)])(t)})):[]}},{key:"notes",get:function(){return this.play.playData.notes?this.play.playData.notes.filter((function(t){return!t.displayModes||t.displayModes.includes("onCourt")})).map((function(t){return new hj(t)})):[]}},{key:"currentPhasePlayers",get:function(){var t=this,n=this.currentPhaseLines,e=this.play.options,r=e.huddleMode,i=e.magnetMode,u=r||i?this.playDataLines:this.prevPhaseLines,o=u.filter((function(t){return["PASS","HANDOFF"].includes(t.type)}));return this.play.playData.players.map((function(e){var M=new dj(e);M.setPossession(o);var c=u.filter((function(e){return!r||!(t.phase<e.phase)&&!n.find((function(t){return t.id===e.id}))})).filter((function(t){return t.playerPositionOrigin===M.position&&t.playerPositionTerminus===M.position})),N=n.filter((function(t){return i&&t.playerPositionOrigin===M.position&&t.playerPositionTerminus===M.position})),a=N.length?N:c;if(a.length){var s=Lt.a.maxBy(a,(function(t){return t.lastAnimEndTime}));if(s){var D=s.lastLinePartControlPoint;D&&(M.location=D)}}return M}))}},{key:"currentPhaseLines",get:function(){var t=this,n=this.play.playData.lines.filter((function(n){return n.phase===t.phase}));return this.play.options.huddleMode&&(n=Lt.a.takeRight(n,2)),n.map((function(t){return new pj(t)}))}},{key:"animationProgressPlayers",get:function(){var t=this,n=this.prevAnimationLines.filter((function(t){return["PASS","HANDOFF","SHOT"].includes(t.type)}));return this.play.playData.players.map((function(e){var r=new dj(e);return r.setPossession(n),r.animations.length?(r.animations.forEach((function(n){var e=[];n.keyTimes.forEach((function(t,r){r&&e.push([n.keyTimes[r-1],t])})),e.forEach((function(e,i){var u=je()(e,2),o=u[0],M=u[1];if(Lt.a.inRange(t.animationGlobalProgress,o,M)){var c=t.animationProgress(o,M),N=ze()(Ae,Ee()(n.lineParts[i].controlPoints));r.location={x:N.x(c),y:N.y(c)}}}))})),t.animationGlobalProgress>=r.lastAnimEndTime&&(r.location=r.lastAnimationLastLinePartControlPoint),r):r}))}},{key:"animationProgressLines",get:function(){var t=this,n=this.play.options.linesDisplayOnMoveOnly;return this.play.playData.lines.map((function(n){var e=new pj(n);e.setAnimationKeyTimesChunked(t.play.playData.players.find((function(t){return t.position===e.playerPositionOrigin})));var r=[];return e.animationKeyTimeChunks.forEach((function(n,i){var u=je()(n,2),o=u[0],M=u[1];if(t.animationGlobalProgressPrev<M&&t.animationGlobalProgress>=M&&window.dispatchEvent(new CustomEvent("@luceosports/play-rendering:lineAnimationFinished",{detail:{id:e.id}})),Lt.a.inRange(t.animationGlobalProgress,o,M)){if("DRIBBLE"===e.type)return r.push(ix({},e.getLineParts()[i]));var c=hc(e.getLineParts()[i].controlPoints,t.animationProgress(o,M));r.push({controlPoints:c[0],alpha:.1}),r.push({controlPoints:c[1],alpha:e.color.alpha})}else t.animationGlobalProgress>M?r.push(ix({},e.getLineParts()[i],{alpha:.1})):r.push(ix({},e.getLineParts()[i]))})),e.setLinePartsAdjusted(r),t.animationGlobalProgress>e.lastAnimEndTime&&(e.color=ix({},e.color,{alpha:.1})),e})).filter((function(e){var r=je()(e.animations,1)[0].keyTimes,i=je()(r,1)[0],u=r.reverse(),o=je()(u,1)[0],M=Lt.a.inRange(t.animationGlobalProgress,i,o);return n?M:M||t.animationGlobalProgress>o||e.phase===t.phase}))}},{key:"playDataLines",get:function(){return this.play.playData.lines.map((function(t){return new pj(t)}))}},{key:"prevPhaseLines",get:function(){var t=this;return this.playDataLines.filter((function(n){return n.phase<t.phase}))}},{key:"prevAnimationLines",get:function(){var t=this;return this.playDataLines.filter((function(n){return t.animationGlobalProgress>=n.lastAnimEndTime}))}}]),t}(),ox=function(){function t(n,e){pt()(this,t),this.ctx=n,Qt()(this,"play",void 0),Qt()(this,"playBase",void 0),Qt()(this,"animationFrame",void 0),Qt()(this,"loopId",void 0),Qt()(this,"running",void 0),Qt()(this,"framesLoadTime",void 0),Qt()(this,"timeStart",void 0),Qt()(this,"timeElapsed",void 0),Qt()(this,"timeElapsedSaved",void 0),this.play=Lt.a.cloneDeep(e),this.playBase=Lt.a.cloneDeep(e),this.animationFrame=new ux(this.play,this.currentPlayPhase,this.globalProgress).setContext(this.ctx),this.loopId=null,this.running=!1,this.framesLoadTime=[],this.timeStart=null,this.timeElapsed=0,this.timeElapsedSaved=0}return dt()(t,[{key:"start",value:function(t,n){this.running=!0,this.loopId=requestAnimationFrame(this.drawFrame.bind(this,t,n))}},{key:"pause",value:function(){cancelAnimationFrame(this.loopId),this.running=!1,this.timeStart=null,this.timeElapsedSaved=this.timeElapsed}},{key:"setProgress",value:function(t){var n=this.countTimeElapsedFromProgress(t);return this.timeElapsed=n,this.timeElapsedSaved=n,this.refreshAnimationFrameProgress(),this}},{key:"refreshAnimationFrameProgress",value:function(){this.animationFrame.setPhase(this.currentPlayPhase).setAnimationGlobalProgress(this.globalProgress)}},{key:"drawPreviewFrame",value:function(){new ux(this.play,this.currentPlayPhase,this.globalProgress).setContext(this.ctx).draw()}},{key:"reset",value:function(){this.timeStart=null,this.timeElapsed=null,this.timeElapsedSaved=null,this.play=Lt.a.cloneDeep(this.playBase)}},{key:"countTimeElapsedFromProgress",value:function(t){return 1e3*this.animationDuration*t}},{key:"drawFrame",value:function(t,n,e){if(this.running){if(this.globalProgress>=this.lastLineAnimationMax)return n(this.lastLineAnimationMax),this.reset(),cancelAnimationFrame(this.loopId),void setTimeout((function(){t()}),1e3);n(this.globalProgress),this.timeStart||(this.timeStart=e);var r=e-this.timeStart+(this.timeElapsedSaved||0)-(this.timeElapsed||0);this.framesLoadTime.push(r),this.timeElapsed=e-this.timeStart+(this.timeElapsedSaved||0),this.animationFrame.setPhase(this.currentPlayPhase).setAnimationGlobalProgress(this.globalProgress).draw(),requestAnimationFrame(this.drawFrame.bind(this,t,n))}}},{key:"animationDuration",get:function(){return this.play.playData.animationDuration/this.play.options.speed}},{key:"globalProgress",get:function(){return(this.timeElapsed||0)/(1e3*this.animationDuration)}},{key:"currentPlayPhase",get:function(){var t=this,n=Object.entries(this.linesPhaseIntervals).find((function(n){var e=je()(n,2)[1];return Lt.a.inRange(t.globalProgress,e.min,e.max)}));return parseInt(n?n[0]:Object.keys(this.linesPhaseIntervals).pop())}},{key:"linesPhaseIntervals",get:function(){var t={};return this.play.playData.lines.forEach((function(n){t[n.phase]||(t[n.phase]={min:0,max:0}),n.animations.forEach((function(e){var r=e.keyTimes,i=je()(r,1)[0],u=Ee()(r).pop();(i<t[n.phase].min||!t[n.phase].min&&n.phase>1)&&(t[n.phase].min=i),u>t[n.phase].max&&(t[n.phase].max=u)}))})),t}},{key:"lastLineAnimationMax",get:function(){return this.play.playData.lines.reduce((function(t,n){var e=new pj(n);return t>e.lastAnimEndTime?t:e.lastAnimEndTime}),0)}}]),t}()}])}));
23
+ var zr,Or,Er=9e15,Ar="0123456789abcdef",fr="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",pr="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Ur={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-Er,maxE:Er,crypto:!1},dr=!0,Cr="[DecimalError] Invalid argument: ",Qr="[object Decimal]",wr=Math.floor,Lr=Math.pow,Sr=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,kr=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,vr=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Yr=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,mr=1e7,Rr=fr.length-1,Fr=pr.length-1,br={toStringTag:Qr};function Zr(t){var n,e,r,i=t.length-1,u="",o=t[0];if(i>0){for(u+=o,n=1;n<i;n++)(e=7-(r=t[n]+"").length)&&(u+=_r(e)),u+=r;(e=7-(r=(o=t[n])+"").length)&&(u+=_r(e))}else if(0===o)return"0";for(;o%10==0;)o/=10;return u+o}function Br(t,n,e){if(t!==~~t||t<n||t>e)throw Error(Cr+t)}function Vr(t,n,e,r){var i,u,o,M;for(u=t[0];u>=10;u/=10)--n;return--n<0?(n+=7,i=0):(i=Math.ceil((n+1)/7),n%=7),u=Lr(10,7-n),M=t[i]%u|0,null==r?n<3?(0==n?M=M/100|0:1==n&&(M=M/10|0),o=e<4&&99999==M||e>3&&49999==M||5e4==M||0==M):o=(e<4&&M+1==u||e>3&&M+1==u/2)&&(t[i+1]/u/100|0)==Lr(10,n-2)-1||(M==u/2||0==M)&&0==(t[i+1]/u/100|0):n<4?(0==n?M=M/1e3|0:1==n?M=M/100|0:2==n&&(M=M/10|0),o=(r||e<4)&&9999==M||!r&&e>3&&4999==M):o=((r||e<4)&&M+1==u||!r&&e>3&&M+1==u/2)&&(t[i+1]/u/1e3|0)==Lr(10,n-3)-1,o}function Wr(t,n,e){for(var r,i,u=[0],o=0,M=t.length;o<M;){for(i=u.length;i--;)u[i]*=n;for(u[0]+=Ar.indexOf(t.charAt(o++)),r=0;r<u.length;r++)u[r]>e-1&&(void 0===u[r+1]&&(u[r+1]=0),u[r+1]+=u[r]/e|0,u[r]%=e)}return u.reverse()}br.absoluteValue=br.abs=function(){var t=new this.constructor(this);return t.s<0&&(t.s=1),Pr(t)},br.ceil=function(){return Pr(new this.constructor(this),this.e+1,2)},br.clampedTo=br.clamp=function(t,n){var e=this,r=e.constructor;if(t=new r(t),n=new r(n),!t.s||!n.s)return new r(NaN);if(t.gt(n))throw Error(Cr+n);return e.cmp(t)<0?t:e.cmp(n)>0?n:new r(e)},br.comparedTo=br.cmp=function(t){var n,e,r,i,u=this,o=u.d,M=(t=new u.constructor(t)).d,c=u.s,N=t.s;if(!o||!M)return c&&N?c!==N?c:o===M?0:!o^c<0?1:-1:NaN;if(!o[0]||!M[0])return o[0]?c:M[0]?-N:0;if(c!==N)return c;if(u.e!==t.e)return u.e>t.e^c<0?1:-1;for(n=0,e=(r=o.length)<(i=M.length)?r:i;n<e;++n)if(o[n]!==M[n])return o[n]>M[n]^c<0?1:-1;return r===i?0:r>i^c<0?1:-1},br.cosine=br.cos=function(){var t,n,e=this,r=e.constructor;return e.d?e.d[0]?(t=r.precision,n=r.rounding,r.precision=t+Math.max(e.e,e.sd())+7,r.rounding=1,e=function(t,n){var e,r,i;if(n.isZero())return n;(r=n.d.length)<32?(e=Math.ceil(r/3),i=(1/ci(4,e)).toString()):(e=16,i="2.3283064365386962890625e-10");t.precision+=e,n=Mi(t,1,n.times(i),new t(1));for(var u=e;u--;){var o=n.times(n);n=o.times(o).minus(o).times(8).plus(1)}return t.precision-=e,n}(r,Ni(r,e)),r.precision=t,r.rounding=n,Pr(2==Or||3==Or?e.neg():e,t,n,!0)):new r(1):new r(NaN)},br.cubeRoot=br.cbrt=function(){var t,n,e,r,i,u,o,M,c,N,a=this,s=a.constructor;if(!a.isFinite()||a.isZero())return new s(a);for(dr=!1,(u=a.s*Lr(a.s*a,1/3))&&Math.abs(u)!=1/0?r=new s(u.toString()):(e=Zr(a.d),(u=((t=a.e)-e.length+1)%3)&&(e+=1==u||-2==u?"0":"00"),u=Lr(e,1/3),t=wr((t+1)/3)-(t%3==(t<0?-1:2)),(r=new s(e=u==1/0?"5e"+t:(e=u.toExponential()).slice(0,e.indexOf("e")+1)+t)).s=a.s),o=(t=s.precision)+3;;)if(N=(c=(M=r).times(M).times(M)).plus(a),r=Gr(N.plus(a).times(M),N.plus(c),o+2,1),Zr(M.d).slice(0,o)===(e=Zr(r.d)).slice(0,o)){if("9999"!=(e=e.slice(o-3,o+1))&&(i||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(Pr(r,t+1,1),n=!r.times(r).times(r).eq(a));break}if(!i&&(Pr(M,t+1,0),M.times(M).times(M).eq(a))){r=M;break}o+=4,i=1}return dr=!0,Pr(r,t,s.rounding,n)},br.decimalPlaces=br.dp=function(){var t,n=this.d,e=NaN;if(n){if(e=7*((t=n.length-1)-wr(this.e/7)),t=n[t])for(;t%10==0;t/=10)e--;e<0&&(e=0)}return e},br.dividedBy=br.div=function(t){return Gr(this,new this.constructor(t))},br.dividedToIntegerBy=br.divToInt=function(t){var n=this.constructor;return Pr(Gr(this,new n(t),0,1,1),n.precision,n.rounding)},br.equals=br.eq=function(t){return 0===this.cmp(t)},br.floor=function(){return Pr(new this.constructor(this),this.e+1,3)},br.greaterThan=br.gt=function(t){return this.cmp(t)>0},br.greaterThanOrEqualTo=br.gte=function(t){var n=this.cmp(t);return 1==n||0===n},br.hyperbolicCosine=br.cosh=function(){var t,n,e,r,i,u=this,o=u.constructor,M=new o(1);if(!u.isFinite())return new o(u.s?1/0:NaN);if(u.isZero())return M;e=o.precision,r=o.rounding,o.precision=e+Math.max(u.e,u.sd())+4,o.rounding=1,(i=u.d.length)<32?n=(1/ci(4,t=Math.ceil(i/3))).toString():(t=16,n="2.3283064365386962890625e-10"),u=Mi(o,1,u.times(n),new o(1),!0);for(var c,N=t,a=new o(8);N--;)c=u.times(u),u=M.minus(c.times(a.minus(c.times(a))));return Pr(u,o.precision=e,o.rounding=r,!0)},br.hyperbolicSine=br.sinh=function(){var t,n,e,r,i=this,u=i.constructor;if(!i.isFinite()||i.isZero())return new u(i);if(n=u.precision,e=u.rounding,u.precision=n+Math.max(i.e,i.sd())+4,u.rounding=1,(r=i.d.length)<3)i=Mi(u,2,i,i,!0);else{t=(t=1.4*Math.sqrt(r))>16?16:0|t,i=Mi(u,2,i=i.times(1/ci(5,t)),i,!0);for(var o,M=new u(5),c=new u(16),N=new u(20);t--;)o=i.times(i),i=i.times(M.plus(o.times(c.times(o).plus(N))))}return u.precision=n,u.rounding=e,Pr(i,n,e,!0)},br.hyperbolicTangent=br.tanh=function(){var t,n,e=this,r=e.constructor;return e.isFinite()?e.isZero()?new r(e):(t=r.precision,n=r.rounding,r.precision=t+7,r.rounding=1,Gr(e.sinh(),e.cosh(),r.precision=t,r.rounding=n)):new r(e.s)},br.inverseCosine=br.acos=function(){var t,n=this,e=n.constructor,r=n.abs().cmp(1),i=e.precision,u=e.rounding;return-1!==r?0===r?n.isNeg()?Xr(e,i,u):new e(0):new e(NaN):n.isZero()?Xr(e,i+4,u).times(.5):(e.precision=i+6,e.rounding=1,n=n.asin(),t=Xr(e,i+4,u).times(.5),e.precision=i,e.rounding=u,t.minus(n))},br.inverseHyperbolicCosine=br.acosh=function(){var t,n,e=this,r=e.constructor;return e.lte(1)?new r(e.eq(1)?0:NaN):e.isFinite()?(t=r.precision,n=r.rounding,r.precision=t+Math.max(Math.abs(e.e),e.sd())+4,r.rounding=1,dr=!1,e=e.times(e).minus(1).sqrt().plus(e),dr=!0,r.precision=t,r.rounding=n,e.ln()):new r(e)},br.inverseHyperbolicSine=br.asinh=function(){var t,n,e=this,r=e.constructor;return!e.isFinite()||e.isZero()?new r(e):(t=r.precision,n=r.rounding,r.precision=t+2*Math.max(Math.abs(e.e),e.sd())+6,r.rounding=1,dr=!1,e=e.times(e).plus(1).sqrt().plus(e),dr=!0,r.precision=t,r.rounding=n,e.ln())},br.inverseHyperbolicTangent=br.atanh=function(){var t,n,e,r,i=this,u=i.constructor;return i.isFinite()?i.e>=0?new u(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(t=u.precision,n=u.rounding,r=i.sd(),Math.max(r,t)<2*-i.e-1?Pr(new u(i),t,n,!0):(u.precision=e=r-i.e,i=Gr(i.plus(1),new u(1).minus(i),e+t,1),u.precision=t+4,u.rounding=1,i=i.ln(),u.precision=t,u.rounding=n,i.times(.5))):new u(NaN)},br.inverseSine=br.asin=function(){var t,n,e,r,i=this,u=i.constructor;return i.isZero()?new u(i):(n=i.abs().cmp(1),e=u.precision,r=u.rounding,-1!==n?0===n?((t=Xr(u,e+4,r).times(.5)).s=i.s,t):new u(NaN):(u.precision=e+6,u.rounding=1,i=i.div(new u(1).minus(i.times(i)).sqrt().plus(1)).atan(),u.precision=e,u.rounding=r,i.times(2)))},br.inverseTangent=br.atan=function(){var t,n,e,r,i,u,o,M,c,N=this,a=N.constructor,s=a.precision,D=a.rounding;if(N.isFinite()){if(N.isZero())return new a(N);if(N.abs().eq(1)&&s+4<=Fr)return(o=Xr(a,s+4,D).times(.25)).s=N.s,o}else{if(!N.s)return new a(NaN);if(s+4<=Fr)return(o=Xr(a,s+4,D).times(.5)).s=N.s,o}for(a.precision=M=s+10,a.rounding=1,t=e=Math.min(28,M/7+2|0);t;--t)N=N.div(N.times(N).plus(1).sqrt().plus(1));for(dr=!1,n=Math.ceil(M/7),r=1,c=N.times(N),o=new a(N),i=N;-1!==t;)if(i=i.times(c),u=o.minus(i.div(r+=2)),i=i.times(c),void 0!==(o=u.plus(i.div(r+=2))).d[n])for(t=n;o.d[t]===u.d[t]&&t--;);return e&&(o=o.times(2<<e-1)),dr=!0,Pr(o,a.precision=s,a.rounding=D,!0)},br.isFinite=function(){return!!this.d},br.isInteger=br.isInt=function(){return!!this.d&&wr(this.e/7)>this.d.length-2},br.isNaN=function(){return!this.s},br.isNegative=br.isNeg=function(){return this.s<0},br.isPositive=br.isPos=function(){return this.s>0},br.isZero=function(){return!!this.d&&0===this.d[0]},br.lessThan=br.lt=function(t){return this.cmp(t)<0},br.lessThanOrEqualTo=br.lte=function(t){return this.cmp(t)<1},br.logarithm=br.log=function(t){var n,e,r,i,u,o,M,c,N=this.constructor,a=N.precision,s=N.rounding;if(null==t)t=new N(10),n=!0;else{if(e=(t=new N(t)).d,t.s<0||!e||!e[0]||t.eq(1))return new N(NaN);n=t.eq(10)}if(e=this.d,this.s<0||!e||!e[0]||this.eq(1))return new N(e&&!e[0]?-1/0:1!=this.s?NaN:e?0:1/0);if(n)if(e.length>1)u=!0;else{for(i=e[0];i%10==0;)i/=10;u=1!==i}if(dr=!1,o=ri(this,M=a+5),r=n?Kr(N,M+10):ri(t,M),Vr((c=Gr(o,r,M,1)).d,i=a,s))do{if(o=ri(this,M+=10),r=n?Kr(N,M+10):ri(t,M),c=Gr(o,r,M,1),!u){+Zr(c.d).slice(i+1,i+15)+1==1e14&&(c=Pr(c,a+1,0));break}}while(Vr(c.d,i+=10,s));return dr=!0,Pr(c,a,s)},br.minus=br.sub=function(t){var n,e,r,i,u,o,M,c,N,a,s,D,T=this,g=T.constructor;if(t=new g(t),!T.d||!t.d)return T.s&&t.s?T.d?t.s=-t.s:t=new g(t.d||T.s!==t.s?T:NaN):t=new g(NaN),t;if(T.s!=t.s)return t.s=-t.s,T.plus(t);if(N=T.d,D=t.d,M=g.precision,c=g.rounding,!N[0]||!D[0]){if(D[0])t.s=-t.s;else{if(!N[0])return new g(3===c?-0:0);t=new g(T)}return dr?Pr(t,M,c):t}if(e=wr(t.e/7),a=wr(T.e/7),N=N.slice(),u=a-e){for((s=u<0)?(n=N,u=-u,o=D.length):(n=D,e=a,o=N.length),u>(r=Math.max(Math.ceil(M/7),o)+2)&&(u=r,n.length=1),n.reverse(),r=u;r--;)n.push(0);n.reverse()}else{for((s=(r=N.length)<(o=D.length))&&(o=r),r=0;r<o;r++)if(N[r]!=D[r]){s=N[r]<D[r];break}u=0}for(s&&(n=N,N=D,D=n,t.s=-t.s),o=N.length,r=D.length-o;r>0;--r)N[o++]=0;for(r=D.length;r>u;){if(N[--r]<D[r]){for(i=r;i&&0===N[--i];)N[i]=mr-1;--N[i],N[r]+=mr}N[r]-=D[r]}for(;0===N[--o];)N.pop();for(;0===N[0];N.shift())--e;return N[0]?(t.d=N,t.e=Hr(N,e),dr?Pr(t,M,c):t):new g(3===c?-0:0)},br.modulo=br.mod=function(t){var n,e=this,r=e.constructor;return t=new r(t),!e.d||!t.s||t.d&&!t.d[0]?new r(NaN):!t.d||e.d&&!e.d[0]?Pr(new r(e),r.precision,r.rounding):(dr=!1,9==r.modulo?(n=Gr(e,t.abs(),0,3,1)).s*=t.s:n=Gr(e,t,0,r.modulo,1),n=n.times(t),dr=!0,e.minus(n))},br.naturalExponential=br.exp=function(){return ei(this)},br.naturalLogarithm=br.ln=function(){return ri(this)},br.negated=br.neg=function(){var t=new this.constructor(this);return t.s=-t.s,Pr(t)},br.plus=br.add=function(t){var n,e,r,i,u,o,M,c,N,a,s=this,D=s.constructor;if(t=new D(t),!s.d||!t.d)return s.s&&t.s?s.d||(t=new D(t.d||s.s===t.s?s:NaN)):t=new D(NaN),t;if(s.s!=t.s)return t.s=-t.s,s.minus(t);if(N=s.d,a=t.d,M=D.precision,c=D.rounding,!N[0]||!a[0])return a[0]||(t=new D(s)),dr?Pr(t,M,c):t;if(u=wr(s.e/7),r=wr(t.e/7),N=N.slice(),i=u-r){for(i<0?(e=N,i=-i,o=a.length):(e=a,r=u,o=N.length),i>(o=(u=Math.ceil(M/7))>o?u+1:o+1)&&(i=o,e.length=1),e.reverse();i--;)e.push(0);e.reverse()}for((o=N.length)-(i=a.length)<0&&(i=o,e=a,a=N,N=e),n=0;i;)n=(N[--i]=N[i]+a[i]+n)/mr|0,N[i]%=mr;for(n&&(N.unshift(n),++r),o=N.length;0==N[--o];)N.pop();return t.d=N,t.e=Hr(N,r),dr?Pr(t,M,c):t},br.precision=br.sd=function(t){var n,e=this;if(void 0!==t&&t!==!!t&&1!==t&&0!==t)throw Error(Cr+t);return e.d?(n=qr(e.d),t&&e.e+1>n&&(n=e.e+1)):n=NaN,n},br.round=function(){var t=this,n=t.constructor;return Pr(new n(t),t.e+1,n.rounding)},br.sine=br.sin=function(){var t,n,e=this,r=e.constructor;return e.isFinite()?e.isZero()?new r(e):(t=r.precision,n=r.rounding,r.precision=t+Math.max(e.e,e.sd())+7,r.rounding=1,e=function(t,n){var e,r=n.d.length;if(r<3)return n.isZero()?n:Mi(t,2,n,n);e=(e=1.4*Math.sqrt(r))>16?16:0|e,n=n.times(1/ci(5,e)),n=Mi(t,2,n,n);for(var i,u=new t(5),o=new t(16),M=new t(20);e--;)i=n.times(n),n=n.times(u.plus(i.times(o.times(i).minus(M))));return n}(r,Ni(r,e)),r.precision=t,r.rounding=n,Pr(Or>2?e.neg():e,t,n,!0)):new r(NaN)},br.squareRoot=br.sqrt=function(){var t,n,e,r,i,u,o=this,M=o.d,c=o.e,N=o.s,a=o.constructor;if(1!==N||!M||!M[0])return new a(!N||N<0&&(!M||M[0])?NaN:M?o:1/0);for(dr=!1,0==(N=Math.sqrt(+o))||N==1/0?(((n=Zr(M)).length+c)%2==0&&(n+="0"),N=Math.sqrt(n),c=wr((c+1)/2)-(c<0||c%2),r=new a(n=N==1/0?"5e"+c:(n=N.toExponential()).slice(0,n.indexOf("e")+1)+c)):r=new a(N.toString()),e=(c=a.precision)+3;;)if(r=(u=r).plus(Gr(o,u,e+2,1)).times(.5),Zr(u.d).slice(0,e)===(n=Zr(r.d)).slice(0,e)){if("9999"!=(n=n.slice(e-3,e+1))&&(i||"4999"!=n)){+n&&(+n.slice(1)||"5"!=n.charAt(0))||(Pr(r,c+1,1),t=!r.times(r).eq(o));break}if(!i&&(Pr(u,c+1,0),u.times(u).eq(o))){r=u;break}e+=4,i=1}return dr=!0,Pr(r,c,a.rounding,t)},br.tangent=br.tan=function(){var t,n,e=this,r=e.constructor;return e.isFinite()?e.isZero()?new r(e):(t=r.precision,n=r.rounding,r.precision=t+10,r.rounding=1,(e=e.sin()).s=1,e=Gr(e,new r(1).minus(e.times(e)).sqrt(),t+10,0),r.precision=t,r.rounding=n,Pr(2==Or||4==Or?e.neg():e,t,n,!0)):new r(NaN)},br.times=br.mul=function(t){var n,e,r,i,u,o,M,c,N,a=this,s=a.constructor,D=a.d,T=(t=new s(t)).d;if(t.s*=a.s,!(D&&D[0]&&T&&T[0]))return new s(!t.s||D&&!D[0]&&!T||T&&!T[0]&&!D?NaN:D&&T?0*t.s:t.s/0);for(e=wr(a.e/7)+wr(t.e/7),(c=D.length)<(N=T.length)&&(u=D,D=T,T=u,o=c,c=N,N=o),u=[],r=o=c+N;r--;)u.push(0);for(r=N;--r>=0;){for(n=0,i=c+r;i>r;)M=u[i]+T[r]*D[i-r-1]+n,u[i--]=M%mr|0,n=M/mr|0;u[i]=(u[i]+n)%mr|0}for(;!u[--o];)u.pop();return n?++e:u.shift(),t.d=u,t.e=Hr(u,e),dr?Pr(t,s.precision,s.rounding):t},br.toBinary=function(t,n){return ai(this,2,t,n)},br.toDecimalPlaces=br.toDP=function(t,n){var e=this,r=e.constructor;return e=new r(e),void 0===t?e:(Br(t,0,1e9),void 0===n?n=r.rounding:Br(n,0,8),Pr(e,t+e.e+1,n))},br.toExponential=function(t,n){var e,r=this,i=r.constructor;return void 0===t?e=Jr(r,!0):(Br(t,0,1e9),void 0===n?n=i.rounding:Br(n,0,8),e=Jr(r=Pr(new i(r),t+1,n),!0,t+1)),r.isNeg()&&!r.isZero()?"-"+e:e},br.toFixed=function(t,n){var e,r,i=this,u=i.constructor;return void 0===t?e=Jr(i):(Br(t,0,1e9),void 0===n?n=u.rounding:Br(n,0,8),e=Jr(r=Pr(new u(i),t+i.e+1,n),!1,t+r.e+1)),i.isNeg()&&!i.isZero()?"-"+e:e},br.toFraction=function(t){var n,e,r,i,u,o,M,c,N,a,s,D,T=this,g=T.d,l=T.constructor;if(!g)return new l(T);if(N=e=new l(1),r=c=new l(0),o=(u=(n=new l(r)).e=qr(g)-T.e-1)%7,n.d[0]=Lr(10,o<0?7+o:o),null==t)t=u>0?n:N;else{if(!(M=new l(t)).isInt()||M.lt(N))throw Error(Cr+M);t=M.gt(n)?u>0?n:N:M}for(dr=!1,M=new l(Zr(g)),a=l.precision,l.precision=u=7*g.length*2;s=Gr(M,n,0,1,1),1!=(i=e.plus(s.times(r))).cmp(t);)e=r,r=i,i=N,N=c.plus(s.times(i)),c=i,i=n,n=M.minus(s.times(i)),M=i;return i=Gr(t.minus(e),r,0,1,1),c=c.plus(i.times(N)),e=e.plus(i.times(r)),c.s=N.s=T.s,D=Gr(N,r,u,1).minus(T).abs().cmp(Gr(c,e,u,1).minus(T).abs())<1?[N,r]:[c,e],l.precision=a,dr=!0,D},br.toHexadecimal=br.toHex=function(t,n){return ai(this,16,t,n)},br.toNearest=function(t,n){var e=this,r=e.constructor;if(e=new r(e),null==t){if(!e.d)return e;t=new r(1),n=r.rounding}else{if(t=new r(t),void 0===n?n=r.rounding:Br(n,0,8),!e.d)return t.s?e:t;if(!t.d)return t.s&&(t.s=e.s),t}return t.d[0]?(dr=!1,e=Gr(e,t,0,n,1).times(t),dr=!0,Pr(e)):(t.s=e.s,e=t),e},br.toNumber=function(){return+this},br.toOctal=function(t,n){return ai(this,8,t,n)},br.toPower=br.pow=function(t){var n,e,r,i,u,o,M=this,c=M.constructor,N=+(t=new c(t));if(!(M.d&&t.d&&M.d[0]&&t.d[0]))return new c(Lr(+M,N));if((M=new c(M)).eq(1))return M;if(r=c.precision,u=c.rounding,t.eq(1))return Pr(M,r,u);if((n=wr(t.e/7))>=t.d.length-1&&(e=N<0?-N:N)<=9007199254740991)return i=$r(c,M,e,r),t.s<0?new c(1).div(i):Pr(i,r,u);if((o=M.s)<0){if(n<t.d.length-1)return new c(NaN);if(0==(1&t.d[n])&&(o=1),0==M.e&&1==M.d[0]&&1==M.d.length)return M.s=o,M}return(n=0!=(e=Lr(+M,N))&&isFinite(e)?new c(e+"").e:wr(N*(Math.log("0."+Zr(M.d))/Math.LN10+M.e+1)))>c.maxE+1||n<c.minE-1?new c(n>0?o/0:0):(dr=!1,c.rounding=M.s=1,e=Math.min(12,(n+"").length),(i=ei(t.times(ri(M,r+e)),r)).d&&Vr((i=Pr(i,r+5,1)).d,r,u)&&(n=r+10,+Zr((i=Pr(ei(t.times(ri(M,n+e)),n),n+5,1)).d).slice(r+1,r+15)+1==1e14&&(i=Pr(i,r+1,0))),i.s=o,dr=!0,c.rounding=u,Pr(i,r,u))},br.toPrecision=function(t,n){var e,r=this,i=r.constructor;return void 0===t?e=Jr(r,r.e<=i.toExpNeg||r.e>=i.toExpPos):(Br(t,1,1e9),void 0===n?n=i.rounding:Br(n,0,8),e=Jr(r=Pr(new i(r),t,n),t<=r.e||r.e<=i.toExpNeg,t)),r.isNeg()&&!r.isZero()?"-"+e:e},br.toSignificantDigits=br.toSD=function(t,n){var e=this.constructor;return void 0===t?(t=e.precision,n=e.rounding):(Br(t,1,1e9),void 0===n?n=e.rounding:Br(n,0,8)),Pr(new e(this),t,n)},br.toString=function(){var t=this,n=t.constructor,e=Jr(t,t.e<=n.toExpNeg||t.e>=n.toExpPos);return t.isNeg()&&!t.isZero()?"-"+e:e},br.truncated=br.trunc=function(){return Pr(new this.constructor(this),this.e+1,1)},br.valueOf=br.toJSON=function(){var t=this,n=t.constructor,e=Jr(t,t.e<=n.toExpNeg||t.e>=n.toExpPos);return t.isNeg()?"-"+e:e};var Gr=function(){function t(t,n,e){var r,i=0,u=t.length;for(t=t.slice();u--;)r=t[u]*n+i,t[u]=r%e|0,i=r/e|0;return i&&t.unshift(i),t}function n(t,n,e,r){var i,u;if(e!=r)u=e>r?1:-1;else for(i=u=0;i<e;i++)if(t[i]!=n[i]){u=t[i]>n[i]?1:-1;break}return u}function e(t,n,e,r){for(var i=0;e--;)t[e]-=i,i=t[e]<n[e]?1:0,t[e]=i*r+t[e]-n[e];for(;!t[0]&&t.length>1;)t.shift()}return function(r,i,u,o,M,c){var N,a,s,D,T,g,l,I,y,h,j,x,z,O,E,A,f,p,U,d,C=r.constructor,Q=r.s==i.s?1:-1,w=r.d,L=i.d;if(!(w&&w[0]&&L&&L[0]))return new C(r.s&&i.s&&(w?!L||w[0]!=L[0]:L)?w&&0==w[0]||!L?0*Q:Q/0:NaN);for(c?(T=1,a=r.e-i.e):(c=mr,T=7,a=wr(r.e/T)-wr(i.e/T)),U=L.length,f=w.length,h=(y=new C(Q)).d=[],s=0;L[s]==(w[s]||0);s++);if(L[s]>(w[s]||0)&&a--,null==u?(O=u=C.precision,o=C.rounding):O=M?u+(r.e-i.e)+1:u,O<0)h.push(1),g=!0;else{if(O=O/T+2|0,s=0,1==U){for(D=0,L=L[0],O++;(s<f||D)&&O--;s++)E=D*c+(w[s]||0),h[s]=E/L|0,D=E%L|0;g=D||s<f}else{for((D=c/(L[0]+1)|0)>1&&(L=t(L,D,c),w=t(w,D,c),U=L.length,f=w.length),A=U,x=(j=w.slice(0,U)).length;x<U;)j[x++]=0;(d=L.slice()).unshift(0),p=L[0],L[1]>=c/2&&++p;do{D=0,(N=n(L,j,U,x))<0?(z=j[0],U!=x&&(z=z*c+(j[1]||0)),(D=z/p|0)>1?(D>=c&&(D=c-1),1==(N=n(l=t(L,D,c),j,I=l.length,x=j.length))&&(D--,e(l,U<I?d:L,I,c))):(0==D&&(N=D=1),l=L.slice()),(I=l.length)<x&&l.unshift(0),e(j,l,x,c),-1==N&&(N=n(L,j,U,x=j.length))<1&&(D++,e(j,U<x?d:L,x,c)),x=j.length):0===N&&(D++,j=[0]),h[s++]=D,N&&j[0]?j[x++]=w[A]||0:(j=[w[A]],x=1)}while((A++<f||void 0!==j[0])&&O--);g=void 0!==j[0]}h[0]||h.shift()}if(1==T)y.e=a,zr=g;else{for(s=1,D=h[0];D>=10;D/=10)s++;y.e=s+a*T-1,Pr(y,M?u+y.e+1:u,o,g)}return y}}();function Pr(t,n,e,r){var i,u,o,M,c,N,a,s,D,T=t.constructor;t:if(null!=n){if(!(s=t.d))return t;for(i=1,M=s[0];M>=10;M/=10)i++;if((u=n-i)<0)u+=7,o=n,c=(a=s[D=0])/Lr(10,i-o-1)%10|0;else if((D=Math.ceil((u+1)/7))>=(M=s.length)){if(!r)break t;for(;M++<=D;)s.push(0);a=c=0,i=1,o=(u%=7)-7+1}else{for(a=M=s[D],i=1;M>=10;M/=10)i++;c=(o=(u%=7)-7+i)<0?0:a/Lr(10,i-o-1)%10|0}if(r=r||n<0||void 0!==s[D+1]||(o<0?a:a%Lr(10,i-o-1)),N=e<4?(c||r)&&(0==e||e==(t.s<0?3:2)):c>5||5==c&&(4==e||r||6==e&&(u>0?o>0?a/Lr(10,i-o):0:s[D-1])%10&1||e==(t.s<0?8:7)),n<1||!s[0])return s.length=0,N?(n-=t.e+1,s[0]=Lr(10,(7-n%7)%7),t.e=-n||0):s[0]=t.e=0,t;if(0==u?(s.length=D,M=1,D--):(s.length=D+1,M=Lr(10,7-u),s[D]=o>0?(a/Lr(10,i-o)%Lr(10,o)|0)*M:0),N)for(;;){if(0==D){for(u=1,o=s[0];o>=10;o/=10)u++;for(o=s[0]+=M,M=1;o>=10;o/=10)M++;u!=M&&(t.e++,s[0]==mr&&(s[0]=1));break}if(s[D]+=M,s[D]!=mr)break;s[D--]=0,M=1}for(u=s.length;0===s[--u];)s.pop()}return dr&&(t.e>T.maxE?(t.d=null,t.e=NaN):t.e<T.minE&&(t.e=0,t.d=[0])),t}function Jr(t,n,e){if(!t.isFinite())return ii(t);var r,i=t.e,u=Zr(t.d),o=u.length;return n?(e&&(r=e-o)>0?u=u.charAt(0)+"."+u.slice(1)+_r(r):o>1&&(u=u.charAt(0)+"."+u.slice(1)),u=u+(t.e<0?"e":"e+")+t.e):i<0?(u="0."+_r(-i-1)+u,e&&(r=e-o)>0&&(u+=_r(r))):i>=o?(u+=_r(i+1-o),e&&(r=e-i-1)>0&&(u=u+"."+_r(r))):((r=i+1)<o&&(u=u.slice(0,r)+"."+u.slice(r)),e&&(r=e-o)>0&&(i+1===o&&(u+="."),u+=_r(r))),u}function Hr(t,n){var e=t[0];for(n*=7;e>=10;e/=10)n++;return n}function Kr(t,n,e){if(n>Rr)throw dr=!0,e&&(t.precision=e),Error("[DecimalError] Precision limit exceeded");return Pr(new t(fr),n,1,!0)}function Xr(t,n,e){if(n>Fr)throw Error("[DecimalError] Precision limit exceeded");return Pr(new t(pr),n,e,!0)}function qr(t){var n=t.length-1,e=7*n+1;if(n=t[n]){for(;n%10==0;n/=10)e--;for(n=t[0];n>=10;n/=10)e++}return e}function _r(t){for(var n="";t--;)n+="0";return n}function $r(t,n,e,r){var i,u=new t(1),o=Math.ceil(r/7+4);for(dr=!1;;){if(e%2&&si((u=u.times(n)).d,o)&&(i=!0),0===(e=wr(e/2))){e=u.d.length-1,i&&0===u.d[e]&&++u.d[e];break}si((n=n.times(n)).d,o)}return dr=!0,u}function ti(t){return 1&t.d[t.d.length-1]}function ni(t,n,e){for(var r,i=new t(n[0]),u=0;++u<n.length;){if(!(r=new t(n[u])).s){i=r;break}i[e](r)&&(i=r)}return i}function ei(t,n){var e,r,i,u,o,M,c,N=0,a=0,s=0,D=t.constructor,T=D.rounding,g=D.precision;if(!t.d||!t.d[0]||t.e>17)return new D(t.d?t.d[0]?t.s<0?0:1/0:1:t.s?t.s<0?0:t:NaN);for(null==n?(dr=!1,c=g):c=n,M=new D(.03125);t.e>-2;)t=t.times(M),s+=5;for(c+=r=Math.log(Lr(2,s))/Math.LN10*2+5|0,e=u=o=new D(1),D.precision=c;;){if(u=Pr(u.times(t),c,1),e=e.times(++a),Zr((M=o.plus(Gr(u,e,c,1))).d).slice(0,c)===Zr(o.d).slice(0,c)){for(i=s;i--;)o=Pr(o.times(o),c,1);if(null!=n)return D.precision=g,o;if(!(N<3&&Vr(o.d,c-r,T,N)))return Pr(o,D.precision=g,T,dr=!0);D.precision=c+=10,e=u=M=new D(1),a=0,N++}o=M}}function ri(t,n){var e,r,i,u,o,M,c,N,a,s,D,T=1,g=t,l=g.d,I=g.constructor,y=I.rounding,h=I.precision;if(g.s<0||!l||!l[0]||!g.e&&1==l[0]&&1==l.length)return new I(l&&!l[0]?-1/0:1!=g.s?NaN:l?0:g);if(null==n?(dr=!1,a=h):a=n,I.precision=a+=10,r=(e=Zr(l)).charAt(0),!(Math.abs(u=g.e)<15e14))return N=Kr(I,a+2,h).times(u+""),g=ri(new I(r+"."+e.slice(1)),a-10).plus(N),I.precision=h,null==n?Pr(g,h,y,dr=!0):g;for(;r<7&&1!=r||1==r&&e.charAt(1)>3;)r=(e=Zr((g=g.times(t)).d)).charAt(0),T++;for(u=g.e,r>1?(g=new I("0."+e),u++):g=new I(r+"."+e.slice(1)),s=g,c=o=g=Gr(g.minus(1),g.plus(1),a,1),D=Pr(g.times(g),a,1),i=3;;){if(o=Pr(o.times(D),a,1),Zr((N=c.plus(Gr(o,new I(i),a,1))).d).slice(0,a)===Zr(c.d).slice(0,a)){if(c=c.times(2),0!==u&&(c=c.plus(Kr(I,a+2,h).times(u+""))),c=Gr(c,new I(T),a,1),null!=n)return I.precision=h,c;if(!Vr(c.d,a-10,y,M))return Pr(c,I.precision=h,y,dr=!0);I.precision=a+=10,N=o=g=Gr(s.minus(1),s.plus(1),a,1),D=Pr(g.times(g),a,1),i=M=1}c=N,i+=2}}function ii(t){return String(t.s*t.s/0)}function ui(t,n){var e,r,i;for((e=n.indexOf("."))>-1&&(n=n.replace(".","")),(r=n.search(/e/i))>0?(e<0&&(e=r),e+=+n.slice(r+1),n=n.substring(0,r)):e<0&&(e=n.length),r=0;48===n.charCodeAt(r);r++);for(i=n.length;48===n.charCodeAt(i-1);--i);if(n=n.slice(r,i)){if(i-=r,t.e=e=e-r-1,t.d=[],r=(e+1)%7,e<0&&(r+=7),r<i){for(r&&t.d.push(+n.slice(0,r)),i-=7;r<i;)t.d.push(+n.slice(r,r+=7));r=7-(n=n.slice(r)).length}else r-=i;for(;r--;)n+="0";t.d.push(+n),dr&&(t.e>t.constructor.maxE?(t.d=null,t.e=NaN):t.e<t.constructor.minE&&(t.e=0,t.d=[0]))}else t.e=0,t.d=[0];return t}function oi(t,n){var e,r,i,u,o,M,c,N,a;if(n.indexOf("_")>-1){if(n=n.replace(/(\d)_(?=\d)/g,"$1"),Yr.test(n))return ui(t,n)}else if("Infinity"===n||"NaN"===n)return+n||(t.s=NaN),t.e=NaN,t.d=null,t;if(kr.test(n))e=16,n=n.toLowerCase();else if(Sr.test(n))e=2;else{if(!vr.test(n))throw Error(Cr+n);e=8}for((u=n.search(/p/i))>0?(c=+n.slice(u+1),n=n.substring(2,u)):n=n.slice(2),o=(u=n.indexOf("."))>=0,r=t.constructor,o&&(u=(M=(n=n.replace(".","")).length)-u,i=$r(r,new r(e),u,2*u)),u=a=(N=Wr(n,e,mr)).length-1;0===N[u];--u)N.pop();return u<0?new r(0*t.s):(t.e=Hr(N,a),t.d=N,dr=!1,o&&(t=Gr(t,i,4*M)),c&&(t=t.times(Math.abs(c)<54?Lr(2,c):_i.pow(2,c))),dr=!0,t)}function Mi(t,n,e,r,i){var u,o,M,c,N=t.precision,a=Math.ceil(N/7);for(dr=!1,c=e.times(e),M=new t(r);;){if(o=Gr(M.times(c),new t(n++*n++),N,1),M=i?r.plus(o):r.minus(o),r=Gr(o.times(c),new t(n++*n++),N,1),void 0!==(o=M.plus(r)).d[a]){for(u=a;o.d[u]===M.d[u]&&u--;);if(-1==u)break}u=M,M=r,r=o,o=u}return dr=!0,o.d.length=a+1,o}function ci(t,n){for(var e=t;--n;)e*=t;return e}function Ni(t,n){var e,r=n.s<0,i=Xr(t,t.precision,1),u=i.times(.5);if((n=n.abs()).lte(u))return Or=r?4:1,n;if((e=n.divToInt(i)).isZero())Or=r?3:2;else{if((n=n.minus(e.times(i))).lte(u))return Or=ti(e)?r?2:3:r?4:1,n;Or=ti(e)?r?1:4:r?3:2}return n.minus(i).abs()}function ai(t,n,e,r){var i,u,o,M,c,N,a,s,D,T=t.constructor,g=void 0!==e;if(g?(Br(e,1,1e9),void 0===r?r=T.rounding:Br(r,0,8)):(e=T.precision,r=T.rounding),t.isFinite()){for(g?(i=2,16==n?e=4*e-3:8==n&&(e=3*e-2)):i=n,(o=(a=Jr(t)).indexOf("."))>=0&&(a=a.replace(".",""),(D=new T(1)).e=a.length-o,D.d=Wr(Jr(D),10,i),D.e=D.d.length),u=c=(s=Wr(a,10,i)).length;0==s[--c];)s.pop();if(s[0]){if(o<0?u--:((t=new T(t)).d=s,t.e=u,s=(t=Gr(t,D,e,r,0,i)).d,u=t.e,N=zr),o=s[e],M=i/2,N=N||void 0!==s[e+1],N=r<4?(void 0!==o||N)&&(0===r||r===(t.s<0?3:2)):o>M||o===M&&(4===r||N||6===r&&1&s[e-1]||r===(t.s<0?8:7)),s.length=e,N)for(;++s[--e]>i-1;)s[e]=0,e||(++u,s.unshift(1));for(c=s.length;!s[c-1];--c);for(o=0,a="";o<c;o++)a+=Ar.charAt(s[o]);if(g){if(c>1)if(16==n||8==n){for(o=16==n?4:3,--c;c%o;c++)a+="0";for(c=(s=Wr(a,i,n)).length;!s[c-1];--c);for(o=1,a="1.";o<c;o++)a+=Ar.charAt(s[o])}else a=a.charAt(0)+"."+a.slice(1);a=a+(u<0?"p":"p+")+u}else if(u<0){for(;++u;)a="0"+a;a="0."+a}else if(++u>c)for(u-=c;u--;)a+="0";else u<c&&(a=a.slice(0,u)+"."+a.slice(u))}else a=g?"0p+0":"0";a=(16==n?"0x":2==n?"0b":8==n?"0o":"")+a}else a=ii(t);return t.s<0?"-"+a:a}function si(t,n){if(t.length>n)return t.length=n,!0}function Di(t){return new this(t).abs()}function Ti(t){return new this(t).acos()}function gi(t){return new this(t).acosh()}function li(t,n){return new this(t).plus(n)}function Ii(t){return new this(t).asin()}function yi(t){return new this(t).asinh()}function hi(t){return new this(t).atan()}function ji(t){return new this(t).atanh()}function xi(t,n){t=new this(t),n=new this(n);var e,r=this.precision,i=this.rounding,u=r+4;return t.s&&n.s?t.d||n.d?!n.d||t.isZero()?(e=n.s<0?Xr(this,r,i):new this(0)).s=t.s:!t.d||n.isZero()?(e=Xr(this,u,1).times(.5)).s=t.s:n.s<0?(this.precision=u,this.rounding=1,e=this.atan(Gr(t,n,u,1)),n=Xr(this,u,1),this.precision=r,this.rounding=i,e=t.s<0?e.minus(n):e.plus(n)):e=this.atan(Gr(t,n,u,1)):(e=Xr(this,u,1).times(n.s>0?.25:.75)).s=t.s:e=new this(NaN),e}function zi(t){return new this(t).cbrt()}function Oi(t){return Pr(t=new this(t),t.e+1,2)}function Ei(t,n,e){return new this(t).clamp(n,e)}function Ai(t){if(!t||"object"!=typeof t)throw Error("[DecimalError] Object expected");var n,e,r,i=!0===t.defaults,u=["precision",1,1e9,"rounding",0,8,"toExpNeg",-Er,0,"toExpPos",0,Er,"maxE",0,Er,"minE",-Er,0,"modulo",0,9];for(n=0;n<u.length;n+=3)if(e=u[n],i&&(this[e]=Ur[e]),void 0!==(r=t[e])){if(!(wr(r)===r&&r>=u[n+1]&&r<=u[n+2]))throw Error(Cr+e+": "+r);this[e]=r}if(e="crypto",i&&(this[e]=Ur[e]),void 0!==(r=t[e])){if(!0!==r&&!1!==r&&0!==r&&1!==r)throw Error(Cr+e+": "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error("[DecimalError] crypto unavailable");this[e]=!0}else this[e]=!1}return this}function fi(t){return new this(t).cos()}function pi(t){return new this(t).cosh()}function Ui(t,n){return new this(t).div(n)}function di(t){return new this(t).exp()}function Ci(t){return Pr(t=new this(t),t.e+1,3)}function Qi(){var t,n,e=new this(0);for(dr=!1,t=0;t<arguments.length;)if((n=new this(arguments[t++])).d)e.d&&(e=e.plus(n.times(n)));else{if(n.s)return dr=!0,new this(1/0);e=n}return dr=!0,e.sqrt()}function wi(t){return t instanceof _i||t&&t.toStringTag===Qr||!1}function Li(t){return new this(t).ln()}function Si(t,n){return new this(t).log(n)}function ki(t){return new this(t).log(2)}function vi(t){return new this(t).log(10)}function Yi(){return ni(this,arguments,"lt")}function mi(){return ni(this,arguments,"gt")}function Ri(t,n){return new this(t).mod(n)}function Fi(t,n){return new this(t).mul(n)}function bi(t,n){return new this(t).pow(n)}function Zi(t){var n,e,r,i,u=0,o=new this(1),M=[];if(void 0===t?t=this.precision:Br(t,1,1e9),r=Math.ceil(t/7),this.crypto)if(crypto.getRandomValues)for(n=crypto.getRandomValues(new Uint32Array(r));u<r;)(i=n[u])>=429e7?n[u]=crypto.getRandomValues(new Uint32Array(1))[0]:M[u++]=i%1e7;else{if(!crypto.randomBytes)throw Error("[DecimalError] crypto unavailable");for(n=crypto.randomBytes(r*=4);u<r;)(i=n[u]+(n[u+1]<<8)+(n[u+2]<<16)+((127&n[u+3])<<24))>=214e7?crypto.randomBytes(4).copy(n,u):(M.push(i%1e7),u+=4);u=r/4}else for(;u<r;)M[u++]=1e7*Math.random()|0;for(t%=7,(r=M[--u])&&t&&(i=Lr(10,7-t),M[u]=(r/i|0)*i);0===M[u];u--)M.pop();if(u<0)e=0,M=[0];else{for(e=-1;0===M[0];e-=7)M.shift();for(r=1,i=M[0];i>=10;i/=10)r++;r<7&&(e-=7-r)}return o.e=e,o.d=M,o}function Bi(t){return Pr(t=new this(t),t.e+1,this.rounding)}function Vi(t){return(t=new this(t)).d?t.d[0]?t.s:0*t.s:t.s||NaN}function Wi(t){return new this(t).sin()}function Gi(t){return new this(t).sinh()}function Pi(t){return new this(t).sqrt()}function Ji(t,n){return new this(t).sub(n)}function Hi(){var t=0,n=arguments,e=new this(n[t]);for(dr=!1;e.s&&++t<n.length;)e=e.plus(n[t]);return dr=!0,Pr(e,this.precision,this.rounding)}function Ki(t){return new this(t).tan()}function Xi(t){return new this(t).tanh()}function qi(t){return Pr(t=new this(t),t.e+1,1)}br[Symbol.for("nodejs.util.inspect.custom")]=br.toString,br[Symbol.toStringTag]="Decimal";var _i=br.constructor=function t(n){var e,r,i;function u(t){var n,e,r,i=this;if(!(i instanceof u))return new u(t);if(i.constructor=u,wi(t))return i.s=t.s,void(dr?!t.d||t.e>u.maxE?(i.e=NaN,i.d=null):t.e<u.minE?(i.e=0,i.d=[0]):(i.e=t.e,i.d=t.d.slice()):(i.e=t.e,i.d=t.d?t.d.slice():t.d));if("number"===(r=typeof t)){if(0===t)return i.s=1/t<0?-1:1,i.e=0,void(i.d=[0]);if(t<0?(t=-t,i.s=-1):i.s=1,t===~~t&&t<1e7){for(n=0,e=t;e>=10;e/=10)n++;return void(dr?n>u.maxE?(i.e=NaN,i.d=null):n<u.minE?(i.e=0,i.d=[0]):(i.e=n,i.d=[t]):(i.e=n,i.d=[t]))}return 0*t!=0?(t||(i.s=NaN),i.e=NaN,void(i.d=null)):ui(i,t.toString())}if("string"!==r)throw Error(Cr+t);return 45===(e=t.charCodeAt(0))?(t=t.slice(1),i.s=-1):(43===e&&(t=t.slice(1)),i.s=1),Yr.test(t)?ui(i,t):oi(i,t)}if(u.prototype=br,u.ROUND_UP=0,u.ROUND_DOWN=1,u.ROUND_CEIL=2,u.ROUND_FLOOR=3,u.ROUND_HALF_UP=4,u.ROUND_HALF_DOWN=5,u.ROUND_HALF_EVEN=6,u.ROUND_HALF_CEIL=7,u.ROUND_HALF_FLOOR=8,u.EUCLID=9,u.config=u.set=Ai,u.clone=t,u.isDecimal=wi,u.abs=Di,u.acos=Ti,u.acosh=gi,u.add=li,u.asin=Ii,u.asinh=yi,u.atan=hi,u.atanh=ji,u.atan2=xi,u.cbrt=zi,u.ceil=Oi,u.clamp=Ei,u.cos=fi,u.cosh=pi,u.div=Ui,u.exp=di,u.floor=Ci,u.hypot=Qi,u.ln=Li,u.log=Si,u.log10=vi,u.log2=ki,u.max=Yi,u.min=mi,u.mod=Ri,u.mul=Fi,u.pow=bi,u.random=Zi,u.round=Bi,u.sign=Vi,u.sin=Wi,u.sinh=Gi,u.sqrt=Pi,u.sub=Ji,u.sum=Hi,u.tan=Ki,u.tanh=Xi,u.trunc=qi,void 0===n&&(n={}),n&&!0!==n.defaults)for(i=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],e=0;e<i.length;)n.hasOwnProperty(r=i[e++])||(n[r]=this[r]);return u.config(n),u}(Ur);fr=new _i(fr),pr=new _i(pr);var $i=_i;function tu(t){return"boolean"==typeof t||!!isFinite(t)&&t===Math.round(t)}var nu=Math.sign||function(t){return t>0?1:t<0?-1:0},eu=Math.log2||function(t){return Math.log(t)/Math.LN2},ru=Math.log10||function(t){return Math.log(t)/Math.LN10},iu=(Math.log1p,Math.cbrt||function(t){if(0===t)return t;var n,e=t<0;return e&&(t=-t),n=isFinite(t)?(t/((n=Math.exp(Math.log(t)/3))*n)+2*n)/3:t,e?-n:n}),uu=Math.expm1||function(t){return t>=2e-4||t<=-2e-4?Math.exp(t)-1:t+t*t/2+t*t*t/6};function ou(t,n,e){var r={2:"0b",8:"0o",16:"0x"}[n],i="";if(e){if(e<1)throw new Error("size must be in greater than 0");if(!tu(e))throw new Error("size must be an integer");if(t>2**(e-1)-1||t<-(2**(e-1)))throw new Error("Value must be in range [-2^".concat(e-1,", 2^").concat(e-1,"-1]"));if(!tu(t))throw new Error("Value must be an integer");t<0&&(t+=2**e),i="i".concat(e)}var u="";return t<0&&(t=-t,u="-"),"".concat(u).concat(r).concat(t.toString(n)).concat(i)}function Mu(t,n){if("function"==typeof n)return n(t);if(t===1/0)return"Infinity";if(t===-1/0)return"-Infinity";if(isNaN(t))return"NaN";var{notation:e,precision:r,wordSize:i}=cu(n);switch(e){case"fixed":return au(t,r);case"exponential":return su(t,r);case"engineering":return function(t,n){if(isNaN(t)||!isFinite(t))return String(t);var e=Du(Nu(t),n),r=e.exponent,i=e.coefficients,u=r%3==0?r:r<0?r-3-r%3:r-r%3;if(de(n))for(;n>i.length||r-u+1>i.length;)i.push(0);else for(var o=Math.abs(r-u)-(i.length-1),M=0;M<o;M++)i.push(0);var c=Math.abs(r-u),N=1;for(;c>0;)N++,c--;var a=i.slice(N).join(""),s=de(n)&&a.length||a.match(/[1-9]/)?"."+a:"",D=i.slice(0,N).join("")+s+"e"+(r>=0?"+":"")+u.toString();return e.sign+D}(t,r);case"bin":return ou(t,2,i);case"oct":return ou(t,8,i);case"hex":return ou(t,16,i);case"auto":return function(t,n,e){if(isNaN(t)||!isFinite(t))return String(t);var r=zu(null==e?void 0:e.lowerExp,-3),i=zu(null==e?void 0:e.upperExp,5),u=Nu(t),o=n?Du(u,n):u;if(o.exponent<r||o.exponent>=i)return su(t,n);var M=o.coefficients,c=o.exponent;M.length<n&&(M=M.concat(Tu(n-M.length))),M=M.concat(Tu(c-M.length+1+(M.length<n?n-M.length:0))),M=Tu(-c).concat(M);var N=c>0?c:0;return N<M.length-1&&M.splice(N+1,0,"."),o.sign+M.join("")}(t,r,n).replace(/((\.\d*?)(0+))($|e)/,(function(){var t=arguments[2],n=arguments[4];return"."!==t?t+n:n}));default:throw new Error('Unknown notation "'+e+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function cu(t){var n,e,r="auto";if(void 0!==t)if(de(t))n=t;else if(Ce(t))n=t.toNumber();else{if(!Je(t))throw new Error("Unsupported type of options, number, BigNumber, or object expected");void 0!==t.precision&&(n=xu(t.precision,()=>{throw new Error('Option "precision" must be a number or BigNumber')})),void 0!==t.wordSize&&(e=xu(t.wordSize,()=>{throw new Error('Option "wordSize" must be a number or BigNumber')})),t.notation&&(r=t.notation)}return{notation:r,precision:n,wordSize:e}}function Nu(t){var n=String(t).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!n)throw new SyntaxError("Invalid number "+t);var e=n[1],r=n[2],i=parseFloat(n[4]||"0"),u=r.indexOf(".");i+=-1!==u?u-1:r.length-1;var o=r.replace(".","").replace(/^0*/,(function(t){return i-=t.length,""})).replace(/0*$/,"").split("").map((function(t){return parseInt(t)}));return 0===o.length&&(o.push(0),i++),{sign:e,coefficients:o,exponent:i}}function au(t,n){if(isNaN(t)||!isFinite(t))return String(t);var e=Nu(t),r="number"==typeof n?Du(e,e.exponent+1+n):e,i=r.coefficients,u=r.exponent+1,o=u+(n||0);return i.length<o&&(i=i.concat(Tu(o-i.length))),u<0&&(i=Tu(1-u).concat(i),u=1),u<i.length&&i.splice(u,0,0===u?"0.":"."),r.sign+i.join("")}function su(t,n){if(isNaN(t)||!isFinite(t))return String(t);var e=Nu(t),r=n?Du(e,n):e,i=r.coefficients,u=r.exponent;i.length<n&&(i=i.concat(Tu(n-i.length)));var o=i.shift();return r.sign+o+(i.length>0?"."+i.join(""):"")+"e"+(u>=0?"+":"")+u}function Du(t,n){for(var e={sign:t.sign,coefficients:t.coefficients,exponent:t.exponent},r=e.coefficients;n<=0;)r.unshift(0),e.exponent++,n++;if(r.length>n&&r.splice(n,r.length-n)[0]>=5){var i=n-1;for(r[i]++;10===r[i];)r.pop(),0===i&&(r.unshift(0),e.exponent++,i++),r[--i]++}return e}function Tu(t){for(var n=[],e=0;e<t;e++)n.push(0);return n}var gu=Number.EPSILON||2220446049250313e-31;function lu(t,n,e){if(null==e)return t===n;if(t===n)return!0;if(isNaN(t)||isNaN(n))return!1;if(isFinite(t)&&isFinite(n)){var r=Math.abs(t-n);return r<=gu||r<=Math.max(Math.abs(t),Math.abs(n))*e}return!1}var Iu=Math.acosh||function(t){return Math.log(Math.sqrt(t*t-1)+t)},yu=Math.asinh||function(t){return Math.log(Math.sqrt(t*t+1)+t)},hu=Math.atanh||function(t){return Math.log((1+t)/(1-t))/2},ju=(Math.cosh,Math.sinh||function(t){return(Math.exp(t)-Math.exp(-t))/2});Math.tanh;function xu(t,n){return de(t)?t:Ce(t)?t.toNumber():void n()}function zu(t,n){return de(t)?t:Ce(t)?t.toNumber():n}function Ou(t,n,e){var r=new(0,t.constructor)(2),i="";if(e){if(e<1)throw new Error("size must be in greater than 0");if(!tu(e))throw new Error("size must be an integer");if(t.greaterThan(r.pow(e-1).sub(1))||t.lessThan(r.pow(e-1).mul(-1)))throw new Error("Value must be in range [-2^".concat(e-1,", 2^").concat(e-1,"-1]"));if(!t.isInteger())throw new Error("Value must be an integer");t.lessThan(0)&&(t=t.add(r.pow(e))),i="i".concat(e)}switch(n){case 2:return"".concat(t.toBinary()).concat(i);case 8:return"".concat(t.toOctal()).concat(i);case 16:return"".concat(t.toHexadecimal()).concat(i);default:throw new Error("Base ".concat(n," not supported "))}}function Eu(t,n){if("function"==typeof n)return n(t);if(!t.isFinite())return t.isNaN()?"NaN":t.gt(0)?"Infinity":"-Infinity";var{notation:e,precision:r,wordSize:i}=cu(n);switch(e){case"fixed":return function(t,n){return t.toFixed(n)}(t,r);case"exponential":return Au(t,r);case"engineering":return function(t,n){var e=t.e,r=e%3==0?e:e<0?e-3-e%3:e-e%3,i=t.mul(Math.pow(10,-r)).toPrecision(n);if(-1!==i.indexOf("e")){var u=t.constructor;i=new u(i).toFixed()}return i+"e"+(e>=0?"+":"")+r.toString()}(t,r);case"bin":return Ou(t,2,i);case"oct":return Ou(t,8,i);case"hex":return Ou(t,16,i);case"auto":var u=fu(null==n?void 0:n.lowerExp,-3),o=fu(null==n?void 0:n.upperExp,5);if(t.isZero())return"0";var M=t.toSignificantDigits(r),c=M.e;return(c>=u&&c<o?M.toFixed():Au(t,r)).replace(/((\.\d*?)(0+))($|e)/,(function(){var t=arguments[2],n=arguments[4];return"."!==t?t+n:n}));default:throw new Error('Unknown notation "'+e+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function Au(t,n){return void 0!==n?t.toExponential(n-1):t.toExponential()}function fu(t,n){return de(t)?t:Ce(t)?t.toNumber():n}function pu(t,n){var e=function(t,n){if("number"==typeof t)return Mu(t,n);if(Ce(t))return Eu(t,n);if(function(t){return t&&"object"==typeof t&&"number"==typeof t.s&&"number"==typeof t.n&&"number"==typeof t.d||!1}(t))return n&&"decimal"===n.fraction?t.toString():t.s*t.n+"/"+t.d;if(Array.isArray(t))return function t(n,e){if(Array.isArray(n)){for(var r="[",i=n.length,u=0;u<i;u++)0!==u&&(r+=", "),r+=t(n[u],e);return r+="]"}return pu(n,e)}(t,n);if(Se(t))return Uu(t);if("function"==typeof t)return t.syntax?String(t.syntax):"function";if(t&&"object"==typeof t){return"function"==typeof t.format?t.format(n):t&&t.toString(n)!=={}.toString()?t.toString(n):"{"+Object.keys(t).map(e=>Uu(e)+": "+pu(t[e],n)).join(", ")+"}"}return String(t)}(t,n);return n&&"object"==typeof n&&"truncate"in n&&e.length>n.truncate?e.substring(0,n.truncate-3)+"...":e}function Uu(t){for(var n=String(t),e="",r=0;r<n.length;){var i=n.charAt(r);e+=i in du?du[i]:i,r++}return'"'+e+'"'}var du={'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"};function Cu(t,n){if(!Se(t))throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: "+Tr(t)+", index: 0)");if(!Se(n))throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: "+Tr(n)+", index: 1)");return t===n?0:t>n?1:-1}function Qu(t,n,e){if(!(this instanceof Qu))throw new SyntaxError("Constructor must be called with the new operator");this.actual=t,this.expected=n,this.relation=e,this.message="Dimension mismatch ("+(Array.isArray(t)?"["+t.join(", ")+"]":t)+" "+(this.relation||"!=")+" "+(Array.isArray(n)?"["+n.join(", ")+"]":n)+")",this.stack=(new Error).stack}function wu(t,n,e){if(!(this instanceof wu))throw new SyntaxError("Constructor must be called with the new operator");this.index=t,arguments.length<3?(this.min=0,this.max=n):(this.min=n,this.max=e),void 0!==this.min&&this.index<this.min?this.message="Index out of range ("+this.index+" < "+this.min+")":void 0!==this.max&&this.index>=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=(new Error).stack}function Lu(t){for(var n=[];Array.isArray(t);)n.push(t.length),t=t[0];return n}function Su(t,n){if(0===n.length){if(Array.isArray(t))throw new Qu(t.length,0)}else!function t(n,e,r){var i,u=n.length;if(u!==e[r])throw new Qu(u,e[r]);if(r<e.length-1){var o=r+1;for(i=0;i<u;i++){var M=n[i];if(!Array.isArray(M))throw new Qu(e.length-1,e.length,"<");t(n[i],e,o)}}else for(i=0;i<u;i++)if(Array.isArray(n[i]))throw new Qu(e.length+1,e.length,">")}(t,n,0)}function ku(t,n){if(void 0!==t){if(!de(t)||!tu(t))throw new TypeError("Index must be an integer (value: "+t+")");if(t<0||"number"==typeof n&&t>=n)throw new wu(t,n)}}function vu(t,n,e){if(!Array.isArray(n))throw new TypeError("Array expected");if(0===n.length)throw new Error("Resizing to scalar is not supported");return n.forEach((function(t){if(!de(t)||!tu(t)||t<0)throw new TypeError("Invalid size, must contain positive integers (size: "+pu(n)+")")})),(de(t)||Ce(t))&&(t=[t]),function t(n,e,r,i){var u,o,M=n.length,c=e[r],N=Math.min(M,c);if(n.length=c,r<e.length-1){var a=r+1;for(u=0;u<N;u++)o=n[u],Array.isArray(o)||(o=[o],n[u]=o),t(o,e,a,i);for(u=N;u<c;u++)o=[],n[u]=o,t(o,e,a,i)}else{for(u=0;u<N;u++)for(;Array.isArray(n[u]);)n[u]=n[u][0];for(u=N;u<c;u++)n[u]=i}}(t,n,0,void 0!==e?e:0),t}function Yu(t,n){var e=bu(t),r=e.length;if(!Array.isArray(t)||!Array.isArray(n))throw new TypeError("Array expected");if(0===n.length)throw new Qu(0,r,"!=");var i=Ru(n=mu(n,r));if(r!==i)throw new Qu(i,r,"!=");try{return function(t,n){for(var e,r=t,i=n.length-1;i>0;i--){var u=n[i];e=[];for(var o=r.length/u,M=0;M<o;M++)e.push(r.slice(M*u,(M+1)*u));r=e}return r}(e,n)}catch(t){if(t instanceof Qu)throw new Qu(i,r,"!=");throw t}}function mu(t,n){var e=Ru(t),r=t.slice(),i=t.indexOf(-1);if(t.indexOf(-1,i+1)>=0)throw new Error("More than one wildcard in sizes");if(i>=0){if(!(n%e==0))throw new Error("Could not replace wildcard, since "+n+" is no multiple of "+-e);r[i]=-n/e}return r}function Ru(t){return t.reduce((t,n)=>t*n,1)}function Fu(t,n,e,r){var i=r||Lu(t);if(e)for(var u=0;u<e;u++)t=[t],i.unshift(1);for(t=function t(n,e,r){var i,u;if(Array.isArray(n)){var o=r+1;for(i=0,u=n.length;i<u;i++)n[i]=t(n[i],e,o)}else for(var M=r;M<e;M++)n=[n];return n}(t,n,0);i.length<n;)i.push(1);return t}function bu(t){if(!Array.isArray(t))return t;var n=[];return t.forEach((function t(e){Array.isArray(e)?e.forEach(t):n.push(e)})),n}function Zu(t,n){for(var e,r=0,i=0;i<t.length;i++){var u=t[i],o=Array.isArray(u);if(0===i&&o&&(r=u.length),o&&u.length!==r)return;var M=o?Zu(u,n):n(u);if(void 0===e)e=M;else if(e!==M)return"mixed"}return e}function Bu(t,n,e,r){if(r<e){if(t.length!==n.length)throw new Qu(t.length,n.length);for(var i=[],u=0;u<t.length;u++)i[u]=Bu(t[u],n[u],e,r+1);return i}return t.concat(n)}function Vu(){var t=Array.prototype.slice.call(arguments,0,-1),n=Array.prototype.slice.call(arguments,-1);if(1===t.length)return t[0];if(t.length>1)return t.slice(1).reduce((function(t,e){return Bu(t,e,n,0)}),t[0]);throw new Error("Wrong number of arguments in function concat")}function Wu(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++)n[e]=arguments[e];for(var r=n.map(t=>t.length),i=Math.max(...r),u=new Array(i).fill(null),o=0;o<n.length;o++)for(var M=n[o],c=r[o],N=0;N<c;N++){var a=i-c+N;M[N]>u[a]&&(u[a]=M[N])}for(var s=0;s<n.length;s++)Gu(n[s],u);return u}function Gu(t,n){for(var e=n.length,r=t.length,i=0;i<r;i++){var u=e-r+i;if(t[i]<n[u]&&t[i]>1||t[i]>n[u])throw new Error("shape missmatch: missmatch is found in arg with shape (".concat(t,") not possible to broadcast dimension ").concat(r," with size ").concat(t[i]," to size ").concat(n[u]))}}function Pu(t,n){var e=Lu(t);if(Ir(e,n))return t;Gu(e,n);var r,i,u,o=Wu(e,n),M=o.length,c=[...Array(M-e.length).fill(1),...e],N=function(t){return pe()([],t)}(t);e.length<M&&(e=Lu(N=Yu(N,c)));for(var a=0;a<M;a++)e[a]<o[a]&&(r=N,i=o[a],u=a,e=Lu(N=Vu(...Array(i).fill(r),u)));return N}function Ju(t,n,e,r){function i(r){var i=function(t,n){for(var e={},r=0;r<n.length;r++){var i=n[r],u=t[i];void 0!==u&&(e[i]=u)}return e}(r,n.map(Hu));return function(t,n,e){if(!n.filter(t=>!function(t){return t&&"?"===t[0]}(t)).every(t=>void 0!==e[t])){var r=n.filter(t=>void 0===e[t]);throw new Error('Cannot create function "'.concat(t,'", ')+"some dependencies are missing: ".concat(r.map(t=>'"'.concat(t,'"')).join(", "),"."))}}(t,n,r),e(i)}return i.isFactory=!0,i.fn=t,i.dependencies=n.slice().sort(),r&&(i.meta=r),i}function Hu(t){return t&&"?"===t[0]?t.slice(1):t}Qu.prototype=new RangeError,Qu.prototype.constructor=RangeError,Qu.prototype.name="DimensionError",Qu.prototype.isDimensionError=!0,wu.prototype=new RangeError,wu.prototype.constructor=RangeError,wu.prototype.name="IndexError",wu.prototype.isIndexError=!0;var Ku=Ju("BigNumber",["?on","config"],t=>{var{on:n,config:e}=t,r=$i.clone({precision:e.precision,modulo:$i.EUCLID});return r.prototype=Object.create(r.prototype),r.prototype.type="BigNumber",r.prototype.isBigNumber=!0,r.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},r.fromJSON=function(t){return new r(t.value)},n&&n("config",(function(t,n){t.precision!==n.precision&&r.config({precision:t.precision})})),r},{isClass:!0}),Xu=e(10),qu=e.n(Xu),_u=Ju("Complex",[],()=>(Object.defineProperty(qu.a,"name",{value:"Complex"}),qu.a.prototype.constructor=qu.a,qu.a.prototype.type="Complex",qu.a.prototype.isComplex=!0,qu.a.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},qu.a.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},qu.a.prototype.format=function(t){var n=this.im,e=this.re,r=Mu(this.re,t),i=Mu(this.im,t),u=de(t)?t:t?t.precision:null;if(null!==u){var o=Math.pow(10,-u);Math.abs(e/n)<o&&(e=0),Math.abs(n/e)<o&&(n=0)}return 0===n?r:0===e?1===n?"i":-1===n?"-i":i+"i":n<0?-1===n?r+" - i":r+" - "+i.substring(1)+"i":1===n?r+" + i":r+" + "+i+"i"},qu.a.fromPolar=function(t){switch(arguments.length){case 1:var n=arguments[0];if("object"==typeof n)return qu()(n);throw new TypeError("Input has to be an object with r and phi keys.");case 2:var e=arguments[0],r=arguments[1];if(de(e)){if(Le(r)&&r.hasBase("ANGLE")&&(r=r.toNumber("rad")),de(r))return new qu.a({r:e,phi:r});throw new TypeError("Phi is not a number nor an angle unit.")}throw new TypeError("Radius r is not a number.");default:throw new SyntaxError("Wrong number of arguments in function fromPolar")}},qu.a.prototype.valueOf=qu.a.prototype.toString,qu.a.fromJSON=function(t){return new qu.a(t)},qu.a.compare=function(t,n){return t.re>n.re?1:t.re<n.re?-1:t.im>n.im?1:t.im<n.im?-1:0},qu.a),{isClass:!0});function $u(t){var n=0,e=1,r=Object.create(null),i=Object.create(null),u=0,o=function(t){var o=i[t];if(o&&(delete r[o],delete i[t],--n,e===o)){if(!n)return u=0,void(e=1);for(;!Object.prototype.hasOwnProperty.call(r,++e););}};return t=Math.abs(t),{hit:function(M){var c=i[M],N=++u;if(r[N]=M,i[M]=N,!c){if(++n<=t)return;return M=r[e],o(M),M}if(delete r[c],e===c)for(;!Object.prototype.hasOwnProperty.call(r,++e););},delete:o,clear:function(){n=u=0,e=1,r=Object.create(null),i=Object.create(null)}}}function to(t){var{hasher:n,limit:e}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e=null==e?Number.POSITIVE_INFINITY:e,n=null==n?JSON.stringify:n,function r(){"object"!=typeof r.cache&&(r.cache={values:new Map,lru:$u(e||Number.POSITIVE_INFINITY)});for(var i=[],u=0;u<arguments.length;u++)i[u]=arguments[u];var o=n(i);if(r.cache.values.has(o))return r.cache.lru.hit(o),r.cache.values.get(o);var M=t.apply(t,i);return r.cache.values.set(o,M),r.cache.values.delete(r.cache.lru.hit(o)),M}}function no(t){return Object.keys(t.signatures||{}).reduce((function(t,n){var e=(n.match(/,/g)||[]).length+1;return Math.max(t,e)}),-1)}to((function(t){return new t(1).exp()}),{hasher:ro}),to((function(t){return new t(1).plus(new t(5).sqrt()).div(2)}),{hasher:ro});var eo=to((function(t){return t.acos(-1)}),{hasher:ro});to((function(t){return eo(t).times(2)}),{hasher:ro});function ro(t){return t[0].precision}Math.PI,Math.PI,Math.E;io("fineStructure",.0072973525693),io("weakMixingAngle",.2229),io("efimovFactor",22.7),io("sackurTetrode",-1.16487052358);function io(t,n){return Ju(t,["config","BigNumber"],t=>{var{config:e,BigNumber:r}=t;return"BigNumber"===e.number?new r(n):n})}var uo=e(16),oo=e.n(uo),Mo=Ju("Fraction",[],()=>(Object.defineProperty(oo.a,"name",{value:"Fraction"}),oo.a.prototype.constructor=oo.a,oo.a.prototype.type="Fraction",oo.a.prototype.isFraction=!0,oo.a.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},oo.a.fromJSON=function(t){return new oo.a(t)},oo.a),{isClass:!0}),co=Ju("Matrix",[],()=>{function t(){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator")}return t.prototype.type="Matrix",t.prototype.isMatrix=!0,t.prototype.storage=function(){throw new Error("Cannot invoke storage on a Matrix interface")},t.prototype.datatype=function(){throw new Error("Cannot invoke datatype on a Matrix interface")},t.prototype.create=function(t,n){throw new Error("Cannot invoke create on a Matrix interface")},t.prototype.subset=function(t,n,e){throw new Error("Cannot invoke subset on a Matrix interface")},t.prototype.get=function(t){throw new Error("Cannot invoke get on a Matrix interface")},t.prototype.set=function(t,n,e){throw new Error("Cannot invoke set on a Matrix interface")},t.prototype.resize=function(t,n){throw new Error("Cannot invoke resize on a Matrix interface")},t.prototype.reshape=function(t,n){throw new Error("Cannot invoke reshape on a Matrix interface")},t.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},t.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},t.prototype.map=function(t,n){throw new Error("Cannot invoke map on a Matrix interface")},t.prototype.forEach=function(t){throw new Error("Cannot invoke forEach on a Matrix interface")},t.prototype[Symbol.iterator]=function(){throw new Error("Cannot iterate a Matrix interface")},t.prototype.toArray=function(){throw new Error("Cannot invoke toArray on a Matrix interface")},t.prototype.valueOf=function(){throw new Error("Cannot invoke valueOf on a Matrix interface")},t.prototype.format=function(t){throw new Error("Cannot invoke format on a Matrix interface")},t.prototype.toString=function(){throw new Error("Cannot invoke toString on a Matrix interface")},t},{isClass:!0}),No=Ju("DenseMatrix",["Matrix"],t=>{var{Matrix:n}=t;function e(t,n){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");if(n&&!Se(n))throw new Error("Invalid datatype: "+n);if(ve(t))"DenseMatrix"===t.type?(this._data=gr(t._data),this._size=gr(t._size),this._datatype=n||t._datatype):(this._data=t.toArray(),this._size=t.size(),this._datatype=n||t._datatype);else if(t&&ke(t.data)&&ke(t.size))this._data=t.data,this._size=t.size,Su(this._data,this._size),this._datatype=n||t.datatype;else if(ke(t))this._data=M(t),this._size=Lu(this._data),Su(this._data,this._size),this._datatype=n;else{if(t)throw new TypeError("Unsupported type of data ("+Tr(t)+")");this._data=[],this._size=[0],this._datatype=n}}function r(t,n){if(!be(n))throw new TypeError("Invalid index");if(n.isScalar())return t.get(n.min());var r=n.size();if(r.length!==t._size.length)throw new Qu(r.length,t._size.length);for(var i=n.min(),u=n.max(),o=0,M=t._size.length;o<M;o++)ku(i[o],t._size[o]),ku(u[o],t._size[o]);return new e(function t(n,e,r,i){var u=i===r-1,o=e.dimension(i);return u?o.map((function(t){return ku(t,n.length),n[t]})).valueOf():o.map((function(u){ku(u,n.length);var o=n[u];return t(o,e,r,i+1)})).valueOf()}(t._data,n,r.length,0),t._datatype)}function i(t,n,e,r){if(!n||!0!==n.isIndex)throw new TypeError("Invalid index");var i,u=n.size(),M=n.isScalar();if(ve(e)?(i=e.size(),e=e.valueOf()):i=Lu(e),M){if(0!==i.length)throw new TypeError("Scalar expected");t.set(n.min(),e,r)}else{if(!Ir(i,u))try{i=Lu(e=0===i.length?Pu([e],u):Pu(e,u))}catch(t){}if(u.length<t._size.length)throw new Qu(u.length,t._size.length,"<");if(i.length<u.length){for(var c=0,N=0;1===u[c]&&1===i[c];)c++;for(;1===u[c];)N++,c++;e=Fu(e,u.length,N,i)}if(!Ir(u,i))throw new Qu(u,i,">");o(t,n.max().map((function(t){return t+1})),r);var a=u.length;!function t(n,e,r,i,u){var o=u===i-1,M=e.dimension(u);o?M.forEach((function(t,e){ku(t),n[t]=r[e[0]]})):M.forEach((function(o,M){ku(o),t(n[o],e,r[M[0]],i,u+1)}))}(t._data,n,e,a,0)}return t}function u(t,n,e){if(0===n.length){for(var r=t._data;ke(r);)r=r[0];return r}return t._size=n.slice(0),t._data=vu(t._data,t._size,e),t}function o(t,n,e){for(var r=t._size.slice(0),i=!1;r.length<n.length;)r.push(0),i=!0;for(var o=0,M=n.length;o<M;o++)n[o]>r[o]&&(r[o]=n[o],i=!0);i&&u(t,r,e)}function M(t){return ve(t)?M(t.valueOf()):ke(t)?t.map(M):t}return e.prototype=new n,e.prototype.createDenseMatrix=function(t,n){return new e(t,n)},Object.defineProperty(e,"name",{value:"DenseMatrix"}),e.prototype.constructor=e,e.prototype.type="DenseMatrix",e.prototype.isDenseMatrix=!0,e.prototype.getDataType=function(){return Zu(this._data,Tr)},e.prototype.storage=function(){return"dense"},e.prototype.datatype=function(){return this._datatype},e.prototype.create=function(t,n){return new e(t,n)},e.prototype.subset=function(t,n,e){switch(arguments.length){case 1:return r(this,t);case 2:case 3:return i(this,t,n,e);default:throw new SyntaxError("Wrong number of arguments")}},e.prototype.get=function(t){if(!ke(t))throw new TypeError("Array expected");if(t.length!==this._size.length)throw new Qu(t.length,this._size.length);for(var n=0;n<t.length;n++)ku(t[n],this._size[n]);for(var e=this._data,r=0,i=t.length;r<i;r++){var u=t[r];ku(u,e.length),e=e[u]}return e},e.prototype.set=function(t,n,e){if(!ke(t))throw new TypeError("Array expected");if(t.length<this._size.length)throw new Qu(t.length,this._size.length,"<");var r,i,u;o(this,t.map((function(t){return t+1})),e);var M=this._data;for(r=0,i=t.length-1;r<i;r++)ku(u=t[r],M.length),M=M[u];return ku(u=t[t.length-1],M.length),M[u]=n,this},e.prototype.resize=function(t,n,e){if(!Ye(t))throw new TypeError("Array or Matrix expected");var r=t.valueOf().map(t=>Array.isArray(t)&&1===t.length?t[0]:t);return u(e?this.clone():this,r,n)},e.prototype.reshape=function(t,n){var e=n?this.clone():this;e._data=Yu(e._data,t);var r=e._size.reduce((t,n)=>t*n);return e._size=mu(t,r),e},e.prototype.clone=function(){return new e({data:gr(this._data),size:gr(this._size),datatype:this._datatype})},e.prototype.size=function(){return this._size.slice(0)},e.prototype.map=function(t){var n=this,r=no(t),i=function e(i,u){return ke(i)?i.map((function(t,n){return e(t,u.concat(n))})):1===r?t(i):2===r?t(i,u):t(i,u,n)}(this._data,[]);return new e(i,void 0!==this._datatype?Zu(i,Tr):void 0)},e.prototype.forEach=function(t){var n=this;!function e(r,i){ke(r)?r.forEach((function(t,n){e(t,i.concat(n))})):t(r,i,n)}(this._data,[])},e.prototype[Symbol.iterator]=function*(){yield*function*t(n,e){if(ke(n))for(var r=0;r<n.length;r++)yield*t(n[r],e.concat(r));else yield{value:n,index:e}}(this._data,[])},e.prototype.rows=function(){var t=[];if(2!==this.size().length)throw new TypeError("Rows can only be returned for a 2D matrix.");var n=this._data;for(var r of n)t.push(new e([r],this._datatype));return t},e.prototype.columns=function(){var t=this,n=[],r=this.size();if(2!==r.length)throw new TypeError("Rows can only be returned for a 2D matrix.");for(var i=this._data,u=function(r){var u=i.map(t=>[t[r]]);n.push(new e(u,t._datatype))},o=0;o<r[1];o++)u(o);return n},e.prototype.toArray=function(){return gr(this._data)},e.prototype.valueOf=function(){return this._data},e.prototype.format=function(t){return pu(this._data,t)},e.prototype.toString=function(){return pu(this._data)},e.prototype.toJSON=function(){return{mathjs:"DenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},e.prototype.diagonal=function(t){if(t){if(Ce(t)&&(t=t.toNumber()),!de(t)||!tu(t))throw new TypeError("The parameter k must be an integer number")}else t=0;for(var n=t>0?t:0,r=t<0?-t:0,i=this._size[0],u=this._size[1],o=Math.min(i-r,u-n),M=[],c=0;c<o;c++)M[c]=this._data[c+r][c+n];return new e({data:M,size:[o],datatype:this._datatype})},e.diagonal=function(t,n,r,i){if(!ke(t))throw new TypeError("Array expected, size parameter");if(2!==t.length)throw new Error("Only two dimensions matrix are supported");if(t=t.map((function(t){if(Ce(t)&&(t=t.toNumber()),!de(t)||!tu(t)||t<1)throw new Error("Size values must be positive integers");return t})),r){if(Ce(r)&&(r=r.toNumber()),!de(r)||!tu(r))throw new TypeError("The parameter k must be an integer number")}else r=0;var u,o=r>0?r:0,M=r<0?-r:0,c=t[0],N=t[1],a=Math.min(c-M,N-o);if(ke(n)){if(n.length!==a)throw new Error("Invalid value array length");u=function(t){return n[t]}}else if(ve(n)){var s=n.size();if(1!==s.length||s[0]!==a)throw new Error("Invalid matrix length");u=function(t){return n.get([t])}}else u=function(){return n};i||(i=Ce(u(0))?u(0).mul(0):0);var D=[];if(t.length>0){D=vu(D,t,i);for(var T=0;T<a;T++)D[T+M][T+o]=u(T)}return new e({data:D,size:[c,N]})},e.fromJSON=function(t){return new e(t)},e.prototype.swapRows=function(t,n){if(!(de(t)&&tu(t)&&de(n)&&tu(n)))throw new Error("Row index must be positive integers");if(2!==this._size.length)throw new Error("Only two dimensional matrix is supported");return ku(t,this._size[0]),ku(n,this._size[0]),e._swapRows(t,n,this._data),this},e._swapRows=function(t,n,e){var r=e[t];e[t]=e[n],e[n]=r},e},{isClass:!0});function ao(){return!0}function so(){return!1}function Do(){}var To=function t(){function n(t){return"object"==typeof t&&null!==t&&t.constructor===Object}const e=[{name:"number",test:function(t){return"number"==typeof t}},{name:"string",test:function(t){return"string"==typeof t}},{name:"boolean",test:function(t){return"boolean"==typeof t}},{name:"Function",test:function(t){return"function"==typeof t}},{name:"Array",test:Array.isArray},{name:"Date",test:function(t){return t instanceof Date}},{name:"RegExp",test:function(t){return t instanceof RegExp}},{name:"Object",test:n},{name:"null",test:function(t){return null===t}},{name:"undefined",test:function(t){return void 0===t}}],r={name:"any",test:ao,isAny:!0};let i,u,o=0,M={createCount:0};function c(t){const n=i.get(t);if(n)return n;let e='Unknown type "'+t+'"';const r=t.toLowerCase();let o;for(o of u)if(o.toLowerCase()===r){e+='. Did you mean "'+o+'" ?';break}throw new TypeError(e)}function N(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"any";const e=n?c(n).index:u.length,r=[];for(let n=0;n<t.length;++n){if(!t[n]||"string"!=typeof t[n].name||"function"!=typeof t[n].test)throw new TypeError("Object with properties {name: string, test: function} expected");const u=t[n].name;if(i.has(u))throw new TypeError('Duplicate type name "'+u+'"');r.push(u),i.set(u,{name:u,test:t[n].test,isAny:t[n].isAny,index:e+n,conversionsTo:[]})}const o=u.slice(e);u=u.slice(0,e).concat(r).concat(o);for(let t=e+r.length;t<u.length;++t)i.get(u[t]).index=t}function a(){i=new Map,u=[],o=0,N([r],!1)}function s(t){const n=u.filter(n=>{const e=i.get(n);return!e.isAny&&e.test(t)});return n.length?n:["any"]}function D(t){return t&&"function"==typeof t&&"_typedFunctionData"in t}function T(t,n,e){if(!D(t))throw new TypeError("Argument is not a typed-function.");const r=e&&e.exact,i=h(Array.isArray(n)?n.join(","):n),u=g(i);if(!r||u in t.signatures){const n=t._typedFunctionData.signatureMap.get(u);if(n)return n}const o=i.length;let M,c;if(r){let n;for(n in M=[],t.signatures)M.push(t._typedFunctionData.signatureMap.get(n))}else M=t._typedFunctionData.signatures;for(let t=0;t<o;++t){const n=i[t],e=[];let r;for(r of M){const i=O(r.params,t);if(i&&(!n.restParam||i.restParam)){if(!i.hasAny){const t=y(i);if(n.types.some(n=>!t.has(n.name)))continue}e.push(r)}}if(M=e,0===M.length)break}for(c of M)if(c.params.length<=o)return c;throw new TypeError("Signature not found (signature: "+(t.name||"unnamed")+"("+g(i,", ")+"))")}function g(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:",";return t.map(t=>t.name).join(n)}function l(t){const n=0===t.indexOf("..."),e=(n?t.length>3?t.slice(3):"any":t).split("|").map(t=>c(t.trim()));let r=!1,i=n?"...":"";return{types:e.map((function(t){return r=t.isAny||r,i+=t.name+"|",{name:t.name,typeIndex:t.index,test:t.test,isAny:t.isAny,conversion:null,conversionIndex:-1}})),name:i.slice(0,-1),hasAny:r,hasConversion:!1,restParam:n}}function I(t){const n=function(t){if(0===t.length)return[];const n=t.map(c);t.length>1&&n.sort((t,n)=>t.index-n.index);let e=n[0].conversionsTo;if(1===t.length)return e;e=e.concat([]);const r=new Set(t);for(let t=1;t<n.length;++t){let i;for(i of n[t].conversionsTo)r.has(i.from)||(e.push(i),r.add(i.from))}return e}(t.types.map(t=>t.name));let e=t.hasAny,r=t.name;const i=n.map((function(t){const n=c(t.from);return e=n.isAny||e,r+="|"+t.from,{name:t.from,typeIndex:n.index,test:n.test,isAny:n.isAny,conversion:t,conversionIndex:t.index}}));return{types:t.types.concat(i),name:r,hasAny:e,hasConversion:i.length>0,restParam:t.restParam}}function y(t){return t.typeSet||(t.typeSet=new Set,t.types.forEach(n=>t.typeSet.add(n.name))),t.typeSet}function h(t){const n=[];if("string"!=typeof t)throw new TypeError("Signatures must be strings");const e=t.trim();if(""===e)return n;const r=e.split(",");for(let t=0;t<r.length;++t){const e=l(r[t].trim());if(e.restParam&&t!==r.length-1)throw new SyntaxError('Unexpected rest parameter "'+r[t]+'": only allowed for the last parameter');if(0===e.types.length)return null;n.push(e)}return n}function j(t){const n=b(t);return!!n&&n.restParam}function x(t){if(t&&0!==t.types.length){if(1===t.types.length)return c(t.types[0].name).test;if(2===t.types.length){const n=c(t.types[0].name).test,e=c(t.types[1].name).test;return function(t){return n(t)||e(t)}}{const n=t.types.map((function(t){return c(t.name).test}));return function(t){for(let e=0;e<n.length;e++)if(n[e](t))return!0;return!1}}}return ao}function z(t){let n,e,r;if(j(t)){n=F(t).map(x);const e=n.length,r=x(b(t)),i=function(t){for(let n=e;n<t.length;n++)if(!r(t[n]))return!1;return!0};return function(t){for(let e=0;e<n.length;e++)if(!n[e](t[e]))return!1;return i(t)&&t.length>=e+1}}return 0===t.length?function(t){return 0===t.length}:1===t.length?(e=x(t[0]),function(t){return e(t[0])&&1===t.length}):2===t.length?(e=x(t[0]),r=x(t[1]),function(t){return e(t[0])&&r(t[1])&&2===t.length}):(n=t.map(x),function(t){for(let e=0;e<n.length;e++)if(!n[e](t[e]))return!1;return t.length===n.length})}function O(t,n){return n<t.length?t[n]:j(t)?b(t):null}function E(t,n){const e=O(t,n);return e?y(e):new Set}function A(t){return null===t.conversion||void 0===t.conversion}function f(t,n){const e=new Set;return t.forEach(t=>{const r=E(t.params,n);let i;for(i of r)e.add(i)}),e.has("any")?["any"]:Array.from(e)}function p(t,n,e){let r,i;const u=t||"unnamed";let o,M=e;for(o=0;o<n.length;o++){const t=[];if(M.forEach(e=>{const r=x(O(e.params,o));(o<e.params.length||j(e.params))&&r(n[o])&&t.push(e)}),0===t.length){if(i=f(M,o),i.length>0){const t=s(n[o]);return r=new TypeError("Unexpected type of argument in function "+u+" (expected: "+i.join(" or ")+", actual: "+t.join(" | ")+", index: "+o+")"),r.data={category:"wrongType",fn:u,index:o,actual:t,expected:i},r}}else M=t}const c=M.map((function(t){return j(t.params)?1/0:t.params.length}));if(n.length<Math.min.apply(null,c))return i=f(M,o),r=new TypeError("Too few arguments in function "+u+" (expected: "+i.join(" or ")+", index: "+n.length+")"),r.data={category:"tooFewArgs",fn:u,index:n.length,expected:i},r;const N=Math.max.apply(null,c);if(n.length>N)return r=new TypeError("Too many arguments in function "+u+" (expected: "+N+", actual: "+n.length+")"),r.data={category:"tooManyArgs",fn:u,index:n.length,expectedLength:N},r;const a=[];for(let t=0;t<n.length;++t)a.push(s(n[t]).join("|"));return r=new TypeError('Arguments of type "'+a.join(", ")+'" do not match any of the defined signatures of function '+u+"."),r.data={category:"mismatch",actual:a},r}function U(t){let n=u.length+1;for(let e=0;e<t.types.length;e++)A(t.types[e])&&(n=Math.min(n,t.types[e].typeIndex));return n}function d(t){let n=o+1;for(let e=0;e<t.types.length;e++)A(t.types[e])||(n=Math.min(n,t.types[e].conversionIndex));return n}function C(t,n){if(t.hasAny){if(!n.hasAny)return 1}else if(n.hasAny)return-1;if(t.restParam){if(!n.restParam)return 1}else if(n.restParam)return-1;if(t.hasConversion){if(!n.hasConversion)return 1}else if(n.hasConversion)return-1;const e=U(t)-U(n);if(e<0)return-1;if(e>0)return 1;const r=d(t)-d(n);return r<0?-1:r>0?1:0}function Q(t,n){const e=t.params,r=n.params,i=b(e),u=b(r),o=j(e),M=j(r);if(o&&i.hasAny){if(!M||!u.hasAny)return 1}else if(M&&u.hasAny)return-1;let c,N=0,a=0;for(c of e)c.hasAny&&++N,c.hasConversion&&++a;let s=0,D=0;for(c of r)c.hasAny&&++s,c.hasConversion&&++D;if(N!==s)return N-s;if(o&&i.hasConversion){if(!M||!u.hasConversion)return 1}else if(M&&u.hasConversion)return-1;if(a!==D)return a-D;if(o){if(!M)return 1}else if(M)return-1;const T=(e.length-r.length)*(o?-1:1);if(0!==T)return T;const g=[];let l,I=0;for(let t=0;t<e.length;++t){const n=C(e[t],r[t]);g.push(n),I+=n}if(0!==I)return I;for(l of g)if(0!==l)return l;return 0}function w(t,n){let e=n;if(t.some(t=>t.hasConversion)){const r=j(t),i=t.map(L);e=function(){const t=[],e=r?arguments.length-1:arguments.length;for(let n=0;n<e;n++)t[n]=i[n](arguments[n]);return r&&(t[e]=arguments[e].map(i[e])),n.apply(this,t)}}let r=e;if(j(t)){const n=t.length-1;r=function(){return e.apply(this,Z(arguments,0,n).concat([Z(arguments,n)]))}}return r}function L(t){let n,e,r,i;const u=[],o=[];switch(t.types.forEach((function(t){t.conversion&&(u.push(c(t.conversion.from).test),o.push(t.conversion.convert))})),o.length){case 0:return function(t){return t};case 1:return n=u[0],r=o[0],function(t){return n(t)?r(t):t};case 2:return n=u[0],e=u[1],r=o[0],i=o[1],function(t){return n(t)?r(t):e(t)?i(t):t};default:return function(t){for(let n=0;n<o.length;n++)if(u[n](t))return o[n](t);return t}}}function S(t){return function t(n,e,r){if(e<n.length){const o=n[e];let M=[];if(o.restParam){const t=o.types.filter(A);t.length<o.types.length&&M.push({types:t,name:"..."+t.map(t=>t.name).join("|"),hasAny:t.some(t=>t.isAny),hasConversion:!1,restParam:!0}),M.push(o)}else M=o.types.map((function(t){return{types:[t],name:t.name,hasAny:t.isAny,hasConversion:t.conversion,restParam:!1}}));return i=M,u=function(i){return t(n,e+1,r.concat([i]))},Array.prototype.concat.apply([],i.map(u))}return[r];var i,u}(t,0,[])}function k(t,n){const e=Math.max(t.length,n.length);for(let r=0;r<e;r++){const e=E(t,r),i=E(n,r);let u,o=!1;for(u of i)if(e.has(u)){o=!0;break}if(!o)return!1}const r=t.length,i=n.length,u=j(t),o=j(n);return u?o?r===i:i>=r:o?r>=i:r===i}function v(t,n,e){const r=[];let i;for(i of t){let t=e[i];if("number"!=typeof t)throw new TypeError('No definition for referenced signature "'+i+'"');if(t=n[t],"function"!=typeof t)return!1;r.push(t)}return r}function Y(t,n,e){const r=function(t){return t.map(t=>G(t)?V(t.referToSelf.callback):W(t)?B(t.referTo.references,t.referTo.callback):t)}(t),i=new Array(r.length).fill(!1);let u=!0;for(;u;){u=!1;let t=!0;for(let o=0;o<r.length;++o){if(i[o])continue;const M=r[o];if(G(M))r[o]=M.referToSelf.callback(e),r[o].referToSelf=M.referToSelf,i[o]=!0,t=!1;else if(W(M)){const e=v(M.referTo.references,r,n);e?(r[o]=M.referTo.callback.apply(this,e),r[o].referTo=M.referTo,i[o]=!0,t=!1):u=!0}}if(t&&u)throw new SyntaxError("Circular reference detected in resolving typed.referTo")}return r}function m(t,n){if(M.createCount++,0===Object.keys(n).length)throw new SyntaxError("No signatures provided");M.warnAgainstDeprecatedThis&&function(t){const n=/\bthis(\(|\.signatures\b)/;Object.keys(t).forEach(e=>{const r=t[e];if(n.test(r.toString()))throw new SyntaxError("Using `this` to self-reference a function is deprecated since typed-function@3. Use typed.referTo and typed.referToSelf instead.")})}(n);const e=[],r=[],i={},u=[];let o;for(o in n){if(!Object.prototype.hasOwnProperty.call(n,o))continue;const t=h(o);if(!t)continue;e.forEach((function(n){if(k(n,t))throw new TypeError('Conflicting signatures "'+g(n)+'" and "'+g(t)+'".')})),e.push(t);const M=r.length;r.push(n[o]);const c=t.map(I);let N;for(N of S(c)){const t=g(N);u.push({params:N,name:t,fn:M}),N.every(t=>!t.hasConversion)&&(i[t]=M)}}u.sort(Q);const c=Y(r,i,ut);let N;for(N in i)Object.prototype.hasOwnProperty.call(i,N)&&(i[N]=c[i[N]]);const a=[],s=new Map;for(N of u)s.has(N.name)||(N.fn=c[N.fn],a.push(N),s.set(N.name,N));const D=a[0]&&a[0].params.length<=2&&!j(a[0].params),T=a[1]&&a[1].params.length<=2&&!j(a[1].params),l=a[2]&&a[2].params.length<=2&&!j(a[2].params),y=a[3]&&a[3].params.length<=2&&!j(a[3].params),O=a[4]&&a[4].params.length<=2&&!j(a[4].params),E=a[5]&&a[5].params.length<=2&&!j(a[5].params),A=D&&T&&l&&y&&O&&E;for(let t=0;t<a.length;++t)a[t].test=z(a[t].params);const f=D?x(a[0].params[0]):so,p=T?x(a[1].params[0]):so,U=l?x(a[2].params[0]):so,d=y?x(a[3].params[0]):so,C=O?x(a[4].params[0]):so,L=E?x(a[5].params[0]):so,v=D?x(a[0].params[1]):so,m=T?x(a[1].params[1]):so,R=l?x(a[2].params[1]):so,F=y?x(a[3].params[1]):so,b=O?x(a[4].params[1]):so,Z=E?x(a[5].params[1]):so;for(let t=0;t<a.length;++t)a[t].implementation=w(a[t].params,a[t].fn);const B=D?a[0].implementation:Do,V=T?a[1].implementation:Do,W=l?a[2].implementation:Do,G=y?a[3].implementation:Do,P=O?a[4].implementation:Do,J=E?a[5].implementation:Do,H=D?a[0].params.length:-1,K=T?a[1].params.length:-1,X=l?a[2].params.length:-1,q=y?a[3].params.length:-1,_=O?a[4].params.length:-1,$=E?a[5].params.length:-1,tt=A?6:0,nt=a.length,et=a.map(t=>t.test),rt=a.map(t=>t.implementation),it=function(){for(let t=tt;t<nt;t++)if(et[t](arguments))return rt[t].apply(this,arguments);return M.onMismatch(t,arguments,a)};function ut(t,n){return arguments.length===H&&f(t)&&v(n)?B.apply(this,arguments):arguments.length===K&&p(t)&&m(n)?V.apply(this,arguments):arguments.length===X&&U(t)&&R(n)?W.apply(this,arguments):arguments.length===q&&d(t)&&F(n)?G.apply(this,arguments):arguments.length===_&&C(t)&&b(n)?P.apply(this,arguments):arguments.length===$&&L(t)&&Z(n)?J.apply(this,arguments):it.apply(this,arguments)}try{Object.defineProperty(ut,"name",{value:t})}catch(t){}return ut.signatures=i,ut._typedFunctionData={signatures:a,signatureMap:s},ut}function R(t,n,e){throw p(t,n,e)}function F(t){return Z(t,0,t.length-1)}function b(t){return t[t.length-1]}function Z(t,n,e){return Array.prototype.slice.call(t,n,e)}function B(t,n){return{referTo:{references:t,callback:n}}}function V(t){if("function"!=typeof t)throw new TypeError("Callback function expected as first argument");return{referToSelf:{callback:t}}}function W(t){return t&&"object"==typeof t.referTo&&Array.isArray(t.referTo.references)&&"function"==typeof t.referTo.callback}function G(t){return t&&"object"==typeof t.referToSelf&&"function"==typeof t.referToSelf.callback}function P(t,n){if(!t)return n;if(n&&n!==t){const e=new Error("Function names do not match (expected: "+t+", actual: "+n+")");throw e.data={actual:n,expected:t},e}return t}function J(t){let n;for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(D(t[e])||"string"==typeof t[e].signature)&&(n=P(n,t[e].name));return n}function H(t,n){let e;for(e in n)if(Object.prototype.hasOwnProperty.call(n,e)){if(e in t&&n[e]!==t[e]){const r=new Error('Signature "'+e+'" is defined twice');throw r.data={signature:e,sourceFunction:n[e],destFunction:t[e]},r}t[e]=n[e]}}a(),N(e);const K=M;function X(t){if(!t||"string"!=typeof t.from||"string"!=typeof t.to||"function"!=typeof t.convert)throw new TypeError("Object with properties {from: string, to: string, convert: function} expected");if(t.to===t.from)throw new SyntaxError('Illegal to define conversion from "'+t.from+'" to itself.')}return M=function(t){const e="string"==typeof t,r=e?1:0;let i=e?t:"";const u={};for(let t=r;t<arguments.length;++t){const r=arguments[t];let o,M={};if("function"==typeof r?(o=r.name,"string"==typeof r.signature?M[r.signature]=r:D(r)&&(M=r.signatures)):n(r)&&(M=r,e||(o=J(r))),0===Object.keys(M).length){const n=new TypeError("Argument to 'typed' at index "+t+" is not a (typed) function, nor an object with signatures as keys and functions as values.");throw n.data={index:t,argument:r},n}e||(i=P(i,o)),H(u,M)}return m(i||"",u)},M.create=t,M.createCount=K.createCount,M.onMismatch=R,M.throwMismatchError=R,M.createError=p,M.clear=a,M.clearConversions=function(){let t;for(t of u)i.get(t).conversionsTo=[];o=0},M.addTypes=N,M._findType=c,M.referTo=function(){const t=F(arguments).map(t=>g(h(t))),n=b(arguments);if("function"!=typeof n)throw new TypeError("Callback function expected as last argument");return B(t,n)},M.referToSelf=V,M.convert=function(t,n){const e=c(n);if(e.test(t))return t;const r=e.conversionsTo;if(0===r.length)throw new Error("There are no conversions to "+n+" defined.");for(let n=0;n<r.length;n++){if(c(r[n].from).test(t))return r[n].convert(t)}throw new Error("Cannot convert "+t+" to "+n)},M.findSignature=T,M.find=function(t,n,e){return T(t,n,e).implementation},M.isTypedFunction=D,M.warnAgainstDeprecatedThis=!0,M.addType=function(t,n){let e="any";!1!==n&&i.has("Object")&&(e="Object"),M.addTypes([t],e)},M.addConversion=function(t){X(t);const n=c(t.to);if(!n.conversionsTo.every((function(n){return n.from!==t.from})))throw new Error('There is already a conversion from "'+t.from+'" to "'+n.name+'"');n.conversionsTo.push({from:t.from,convert:t.convert,index:o++})},M.addConversions=function(t){t.forEach(M.addConversion)},M.removeConversion=function(t){X(t);const n=c(t.to),e=function(t,n){for(let e=0;e<t.length;e++)if(n(t[e]))return t[e]}(n.conversionsTo,n=>n.from===t.from);if(!e)throw new Error("Attempt to remove nonexistent conversion from "+t.from+" to "+t.to);if(e.convert!==t.convert)throw new Error("Conversion to remove does not match existing conversion");const r=n.conversionsTo.indexOf(e);n.conversionsTo.splice(r,1)},M.resolve=function(t,n){if(!D(t))throw new TypeError("Argument is not a typed-function.");const e=t._typedFunctionData.signatures;for(let t=0;t<e.length;++t)if(e[t].test(n))return e[t];return null},M}();function go(t,n){if(ho(t)&&Io(t,n))return t[n];if("function"==typeof t[n]&&yo(t,n))throw new Error('Cannot access method "'+n+'" as a property');throw new Error('No access to property "'+n+'"')}function lo(t,n,e){if(ho(t)&&Io(t,n))return t[n]=e,e;throw new Error('No access to property "'+n+'"')}function Io(t,n){return!(!t||"object"!=typeof t)&&(!!yr(jo,n)||!(n in Object.prototype)&&!(n in Function.prototype))}function yo(t,n){return null!=t&&"function"==typeof t[n]&&(!(yr(t,n)&&Object.getPrototypeOf&&n in Object.getPrototypeOf(t))&&(!!yr(xo,n)||!(n in Object.prototype)&&!(n in Function.prototype)))}function ho(t){return"object"==typeof t&&t&&t.constructor===Object}var jo={length:!0,name:!0},xo={toString:!0,valueOf:!0,toLocaleString:!0};class zo{constructor(t){this.wrappedObject=t,this[Symbol.iterator]=this.entries}keys(){return Object.keys(this.wrappedObject).values()}get(t){return go(this.wrappedObject,t)}set(t,n){return lo(this.wrappedObject,t,n),this}has(t){return n=this.wrappedObject,t in n;var n}entries(){return Oo(this.keys(),t=>[t,this.get(t)])}forEach(t){for(var n of this.keys())t(this.get(n),n,this)}delete(t){delete this.wrappedObject[t]}clear(){for(var t of this.keys())this.delete(t)}get size(){return Object.keys(this.wrappedObject).length}}function Oo(t,n){return{next:()=>{var e=t.next();return e.done?e:{value:n(e.value),done:!1}}}}function Eo(t){return!!t&&(t instanceof Map||t instanceof zo||"function"==typeof t.set&&"function"==typeof t.get&&"function"==typeof t.keys&&"function"==typeof t.has)}var Ao=function(){return Ao=To.create,To},fo=Ju("typed",["?BigNumber","?Complex","?DenseMatrix","?Fraction"],(function(t){var{BigNumber:n,Complex:e,DenseMatrix:r,Fraction:i}=t,u=Ao();return u.clear(),u.addTypes([{name:"number",test:de},{name:"Complex",test:Qe},{name:"BigNumber",test:Ce},{name:"Fraction",test:we},{name:"Unit",test:Le},{name:"identifier",test:t=>Se&&/^(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])*$/.test(t)},{name:"string",test:Se},{name:"Chain",test:Dr},{name:"Array",test:ke},{name:"Matrix",test:ve},{name:"DenseMatrix",test:me},{name:"SparseMatrix",test:Re},{name:"Range",test:Fe},{name:"Index",test:be},{name:"boolean",test:Ze},{name:"ResultSet",test:Be},{name:"Help",test:Ve},{name:"function",test:We},{name:"Date",test:Ge},{name:"RegExp",test:Pe},{name:"null",test:He},{name:"undefined",test:Ke},{name:"AccessorNode",test:Xe},{name:"ArrayNode",test:qe},{name:"AssignmentNode",test:_e},{name:"BlockNode",test:$e},{name:"ConditionalNode",test:tr},{name:"ConstantNode",test:nr},{name:"FunctionNode",test:rr},{name:"FunctionAssignmentNode",test:er},{name:"IndexNode",test:ir},{name:"Node",test:ur},{name:"ObjectNode",test:or},{name:"OperatorNode",test:Mr},{name:"ParenthesisNode",test:cr},{name:"RangeNode",test:Nr},{name:"RelationalNode",test:ar},{name:"SymbolNode",test:sr},{name:"Map",test:Eo},{name:"Object",test:Je}]),u.addConversions([{from:"number",to:"BigNumber",convert:function(t){if(n||po(t),t.toExponential().replace(/e.*$/,"").replace(/^0\.?0*|\./,"").length>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+t+"). Use function bignumber(x) to convert to BigNumber.");return new n(t)}},{from:"number",to:"Complex",convert:function(t){return e||Uo(t),new e(t,0)}},{from:"BigNumber",to:"Complex",convert:function(t){return e||Uo(t),new e(t.toNumber(),0)}},{from:"Fraction",to:"BigNumber",convert:function(t){throw new TypeError("Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.")}},{from:"Fraction",to:"Complex",convert:function(t){return e||Uo(t),new e(t.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(t){i||Co(t);var n=new i(t);if(n.valueOf()!==t)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+t+"). Use function fraction(x) to convert to Fraction.");return n}},{from:"string",to:"number",convert:function(t){var n=Number(t);if(isNaN(n))throw new Error('Cannot convert "'+t+'" to a number');return n}},{from:"string",to:"BigNumber",convert:function(t){n||po(t);try{return new n(t)}catch(n){throw new Error('Cannot convert "'+t+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(t){i||Co(t);try{return new i(t)}catch(n){throw new Error('Cannot convert "'+t+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(t){e||Uo(t);try{return new e(t)}catch(n){throw new Error('Cannot convert "'+t+'" to Complex')}}},{from:"boolean",to:"number",convert:function(t){return+t}},{from:"boolean",to:"BigNumber",convert:function(t){return n||po(t),new n(+t)}},{from:"boolean",to:"Fraction",convert:function(t){return i||Co(t),new i(+t)}},{from:"boolean",to:"string",convert:function(t){return String(t)}},{from:"Array",to:"Matrix",convert:function(t){return r||function(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}(),new r(t)}},{from:"Matrix",to:"Array",convert:function(t){return t.valueOf()}}]),u.onMismatch=(t,n,e)=>{var r=u.createError(t,n,e);if(["wrongType","mismatch"].includes(r.data.category)&&1===n.length&&Ye(n[0])&&e.some(t=>!t.params.includes(","))){var i=new TypeError("Function '".concat(t,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(t,")'."));throw i.data=r.data,i}throw r},u.onMismatch=(t,n,e)=>{var r=u.createError(t,n,e);if(["wrongType","mismatch"].includes(r.data.category)&&1===n.length&&Ye(n[0])&&e.some(t=>!t.params.includes(","))){var i=new TypeError("Function '".concat(t,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(t,")'."));throw i.data=r.data,i}throw r},u}));function po(t){throw new Error("Cannot convert value ".concat(t," into a BigNumber: no class 'BigNumber' provided"))}function Uo(t){throw new Error("Cannot convert value ".concat(t," into a Complex number: no class 'Complex' provided"))}function Co(t){throw new Error("Cannot convert value ".concat(t," into a Fraction, no class 'Fraction' provided."))}function Qo(t,n,e){return t&&"function"==typeof t.map?t.map((function(t){return Qo(t,n,e)})):n(t)}var wo="number",Lo="number, number";function So(t){return Math.abs(t)}function ko(t,n){return t+n}function vo(t,n){return t-n}function Yo(t,n){return t*n}function mo(t){return-t}function Ro(t){return t}function Fo(t){return iu(t)}function bo(t){return t*t*t}function Zo(t){return Math.exp(t)}function Bo(t){return uu(t)}function Vo(t,n){if(!tu(t)||!tu(n))throw new Error("Parameters in function lcm must be integer numbers");if(0===t||0===n)return 0;for(var e,r=t*n;0!==n;)n=t%(e=n),t=e;return Math.abs(r/t)}function Wo(t){return ru(t)}function Go(t){return eu(t)}function Po(t){return nu(t)}function Jo(t){return t*t}function Ho(t,n){var e,r,i,u=0,o=1,M=1,c=0;if(!tu(t)||!tu(n))throw new Error("Parameters in function xgcd must be integer numbers");for(;n;)i=t-(r=Math.floor(t/n))*n,e=u,u=o-r*u,o=e,e=M,M=c-r*M,c=e,t=n,n=i;return t<0?[-t,-o,-c]:[t,t?o:0,c]}function Ko(t,n){return t*t<1&&n===1/0||t*t>1&&n===-1/0?0:Math.pow(t,n)}So.signature=wo,ko.signature=Lo,vo.signature=Lo,Yo.signature=Lo,mo.signature=wo,Ro.signature=wo,Fo.signature=wo,bo.signature=wo,Zo.signature=wo,Bo.signature=wo,Vo.signature=Lo,Wo.signature=wo,Go.signature=wo,Po.signature=wo,Jo.signature=wo,Ho.signature=Lo,Ko.signature=Lo;function Xo(t){return Iu(t)}function qo(t){return Math.atan(1/t)}function _o(t){return isFinite(t)?(Math.log((t+1)/t)+Math.log(t/(t-1)))/2:0}function $o(t){return Math.asin(1/t)}function tM(t){var n=1/t;return Math.log(n+Math.sqrt(n*n+1))}function nM(t){return Math.acos(1/t)}function eM(t){var n=1/t,e=Math.sqrt(n*n-1);return Math.log(e+n)}function rM(t){return yu(t)}function iM(t){return hu(t)}function uM(t){return 1/Math.tan(t)}function oM(t){var n=Math.exp(2*t);return(n+1)/(n-1)}function MM(t){return 1/Math.sin(t)}function cM(t){return 0===t?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(t)-Math.exp(-t)))*nu(t)}function NM(t){return 1/Math.cos(t)}function aM(t){return 2/(Math.exp(t)+Math.exp(-t))}function sM(t){return ju(t)}Xo.signature="number",qo.signature="number",_o.signature="number",$o.signature="number",tM.signature="number",nM.signature="number",eM.signature="number",rM.signature="number",iM.signature="number",uM.signature="number",oM.signature="number",MM.signature="number",cM.signature="number",NM.signature="number",aM.signature="number",sM.signature="number";var DM=Ju("addScalar",["typed"],t=>{var{typed:n}=t;return n("addScalar",{"number, number":ko,"Complex, Complex":function(t,n){return t.add(n)},"BigNumber, BigNumber":function(t,n){return t.plus(n)},"Fraction, Fraction":function(t,n){return t.add(n)},"Unit, Unit":n.referToSelf(t=>(e,r)=>{if(null===e.value||void 0===e.value)throw new Error("Parameter x contains a unit with undefined value");if(null===r.value||void 0===r.value)throw new Error("Parameter y contains a unit with undefined value");if(!e.equalBase(r))throw new Error("Units do not match");var i=e.clone();return i.value=n.find(t,[i.valueType(),r.valueType()])(i.value,r.value),i.fixPrefix=!1,i})})});var TM="number, number";function gM(t,n){if(!tu(t)||!tu(n))throw new Error("Integers expected in function bitAnd");return t&n}function lM(t){if(!tu(t))throw new Error("Integer expected in function bitNot");return~t}function IM(t,n){if(!tu(t)||!tu(n))throw new Error("Integers expected in function bitOr");return t|n}function yM(t,n){if(!tu(t)||!tu(n))throw new Error("Integers expected in function bitXor");return t^n}function hM(t,n){if(!tu(t)||!tu(n))throw new Error("Integers expected in function leftShift");return t<<n}function jM(t,n){if(!tu(t)||!tu(n))throw new Error("Integers expected in function rightArithShift");return t>>n}function xM(t,n){if(!tu(t)||!tu(n))throw new Error("Integers expected in function rightLogShift");return t>>>n}gM.signature=TM,lM.signature="number",IM.signature=TM,yM.signature=TM,hM.signature=TM,jM.signature=TM,xM.signature=TM;function zM(t,n){if(n<t)return 1;if(n===t)return n;var e=n+t>>1;return zM(t,e)*zM(e+1,n)}function OM(t,n){if(!tu(t)||t<0)throw new TypeError("Positive integer value expected in function combinations");if(!tu(n)||n<0)throw new TypeError("Positive integer value expected in function combinations");if(n>t)throw new TypeError("k must be less than or equal to n");for(var e=t-n,r=1,i=2,u=n<e?n:e,o=n<e?e+1:n+1;o<=t;++o)for(r*=o;i<=u&&r%i==0;)r/=i,++i;return i<=u&&(r/=zM(i,u)),r}OM.signature="number, number";var EM=Ju("conj",["typed"],t=>{var{typed:n}=t;return n("conj",{"number | BigNumber | Fraction":t=>t,Complex:t=>t.conjugate(),"Array | Matrix":n.referToSelf(t=>n=>Qo(n,t))})});function AM(t,n,e){if(null==e)return t.eq(n);if(t.eq(n))return!0;if(t.isNaN()||n.isNaN())return!1;if(t.isFinite()&&n.isFinite()){var r=t.minus(n).abs();if(r.isZero())return!0;var i=t.constructor.max(t.abs(),n.abs());return r.lte(i.times(e))}return!1}var fM=Ju("compareUnits",["typed"],t=>{var{typed:n}=t;return{"Unit, Unit":n.referToSelf(t=>(e,r)=>{if(!e.equalBase(r))throw new Error("Cannot compare units with different base");return n.find(t,[e.valueType(),r.valueType()])(e.value,r.value)})}}),pM=Ju("equalScalar",["typed","config"],t=>{var{typed:n,config:e}=t;return n("equalScalar",{"boolean, boolean":function(t,n){return t===n},"number, number":function(t,n){return lu(t,n,e.epsilon)},"BigNumber, BigNumber":function(t,n){return t.eq(n)||AM(t,n,e.epsilon)},"Fraction, Fraction":function(t,n){return t.equals(n)},"Complex, Complex":function(t,n){return function(t,n,e){return lu(t.re,n.re,e)&&lu(t.im,n.im,e)}(t,n,e.epsilon)}},fM({typed:n}))});Ju("equalScalar",["typed","config"],t=>{var{typed:n,config:e}=t;return n("equalScalar",{"number, number":function(t,n){return lu(t,n,e.epsilon)}})}),Math.pow(2,53);Ju("hex",["typed","format"],t=>{var{typed:n,format:e}=t;return n("hex",{"number | BigNumber":function(t){return e(t,{notation:"hex"})},"number | BigNumber, number | BigNumber":function(t,n){return e(t,{notation:"hex",wordSize:n})}})});function UM(t){return t<0}function dM(t){return t>0}function CM(t){return 0===t}function QM(t){return Number.isNaN(t)}UM.signature="number",dM.signature="number",CM.signature="number",QM.signature="number";function wM(t){var n;if(tu(t))return t<=0?isFinite(t)?1/0:NaN:t>171?1/0:zM(1,t-1);if(t<.5)return Math.PI/(Math.sin(Math.PI*t)*wM(1-t));if(t>=171.35)return 1/0;if(t>85){var e=t*t,r=e*t,i=r*t,u=i*t;return Math.sqrt(2*Math.PI/t)*Math.pow(t/Math.E,t)*(1+1/(12*t)+1/(288*e)-139/(51840*r)-571/(2488320*i)+163879/(209018880*u)+5246819/(75246796800*u*t))}--t,n=SM[0];for(var o=1;o<SM.length;++o)n+=SM[o]/(t+o);var M=t+LM+.5;return Math.sqrt(2*Math.PI)*Math.pow(M,t+.5)*Math.exp(-M)*n}wM.signature="number";var LM=4.7421875,SM=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22],kM=[1.000000000190015,76.18009172947146,-86.50532032941678,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18];function vM(t){if(t<0)return NaN;if(0===t)return 1/0;if(!isFinite(t))return t;if(t<.5)return Math.log(Math.PI/Math.sin(Math.PI*t))-vM(1-t);for(var n=(t-=1)+5+.5,e=kM[0],r=6;r>=1;r--)e+=kM[r]/(t+r);return.9189385332046728+(t+.5)*Math.log(n)-n+Math.log(e)}vM.signature="number";var YM=Ju("multiplyScalar",["typed"],t=>{var{typed:n}=t;return n("multiplyScalar",{"number, number":Yo,"Complex, Complex":function(t,n){return t.mul(n)},"BigNumber, BigNumber":function(t,n){return t.times(n)},"Fraction, Fraction":function(t,n){return t.mul(n)},"number | Fraction | BigNumber | Complex, Unit":(t,n)=>n.multiply(t),"Unit, number | Fraction | BigNumber | Complex | Unit":(t,n)=>t.multiply(n)})});function mM(t){return!t}function RM(t,n){return!(!t&&!n)}function FM(t,n){return!!t!=!!n}function bM(t,n){return!(!t||!n)}mM.signature="number",RM.signature="number, number",FM.signature="number, number",bM.signature="number, number";Ju("oct",["typed","format"],t=>{var{typed:n,format:e}=t;return n("oct",{"number | BigNumber":function(t){return e(t,{notation:"oct"})},"number | BigNumber, number | BigNumber":function(t,n){return e(t,{notation:"oct",wordSize:n})}})});var ZM=e(22),BM=e.n(ZM);Date.now();var VM=Ju("SparseMatrix",["typed","equalScalar","Matrix"],t=>{var{typed:n,equalScalar:e,Matrix:r}=t;function i(t,n){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if(n&&!Se(n))throw new Error("Invalid datatype: "+n);if(ve(t))!function(t,n,e){"SparseMatrix"===n.type?(t._values=n._values?gr(n._values):void 0,t._index=gr(n._index),t._ptr=gr(n._ptr),t._size=gr(n._size),t._datatype=e||n._datatype):u(t,n.valueOf(),e||n._datatype)}(this,t,n);else if(t&&ke(t.index)&&ke(t.ptr)&&ke(t.size))this._values=t.values,this._index=t.index,this._ptr=t.ptr,this._size=t.size,this._datatype=n||t.datatype;else if(ke(t))u(this,t,n);else{if(t)throw new TypeError("Unsupported type of data ("+Tr(t)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=n}}function u(t,r,i){t._values=[],t._index=[],t._ptr=[],t._datatype=i;var u=r.length,o=0,M=e,c=0;if(Se(i)&&(M=n.find(e,[i,i])||e,c=n.convert(0,i)),u>0){var N=0;do{t._ptr.push(t._index.length);for(var a=0;a<u;a++){var s=r[a];if(ke(s)){if(0===N&&o<s.length&&(o=s.length),N<s.length){var D=s[N];M(D,c)||(t._values.push(D),t._index.push(a))}}else 0===N&&o<1&&(o=1),M(s,c)||(t._values.push(s),t._index.push(a))}N++}while(N<o)}t._ptr.push(t._index.length),t._size=[u,o]}function o(t,n){if(!be(n))throw new TypeError("Invalid index");if(n.isScalar())return t.get(n.min());var e,r,u,o,M=n.size();if(M.length!==t._size.length)throw new Qu(M.length,t._size.length);var c=n.min(),N=n.max();for(e=0,r=t._size.length;e<r;e++)ku(c[e],t._size[e]),ku(N[e],t._size[e]);var a=t._values,s=t._index,D=t._ptr,T=n.dimension(0),g=n.dimension(1),l=[],I=[];T.forEach((function(t,n){I[t]=n[0],l[t]=!0}));var y=a?[]:void 0,h=[],j=[];return g.forEach((function(t){for(j.push(h.length),u=D[t],o=D[t+1];u<o;u++)e=s[u],!0===l[e]&&(h.push(I[e]),y&&y.push(a[u]))})),j.push(h.length),new i({values:y,index:h,ptr:j,size:M,datatype:t._datatype})}function M(t,n,e,r){if(!n||!0!==n.isIndex)throw new TypeError("Invalid index");var i,u=n.size(),o=n.isScalar();if(ve(e)?(i=e.size(),e=e.toArray()):i=Lu(e),o){if(0!==i.length)throw new TypeError("Scalar expected");t.set(n.min(),e,r)}else{if(1!==u.length&&2!==u.length)throw new Qu(u.length,t._size.length,"<");if(i.length<u.length){for(var M=0,c=0;1===u[M]&&1===i[M];)M++;for(;1===u[M];)c++,M++;e=Fu(e,u.length,c,i)}if(!Ir(u,i))throw new Qu(u,i,">");if(1===u.length){n.dimension(0).forEach((function(n,i){ku(n),t.set([n,0],e[i[0]],r)}))}else{var N=n.dimension(0),a=n.dimension(1);N.forEach((function(n,i){ku(n),a.forEach((function(u,o){ku(u),t.set([n,u],e[i[0]][o[0]],r)}))}))}}return t}function c(t,n,e,r){if(e-n==0)return e;for(var i=n;i<e;i++)if(r[i]===t)return i;return n}function N(t,n,e,r,i,u,o){i.splice(t,0,r),u.splice(t,0,n);for(var M=e+1;M<o.length;M++)o[M]++}function a(t,r,i,u){var o=u||0,M=e,c=0;Se(t._datatype)&&(M=n.find(e,[t._datatype,t._datatype])||e,c=n.convert(0,t._datatype),o=n.convert(o,t._datatype));var N,a,s,D=!M(o,c),T=t._size[0],g=t._size[1];if(i>g){for(a=g;a<i;a++)if(t._ptr[a]=t._values.length,D)for(N=0;N<T;N++)t._values.push(o),t._index.push(N);t._ptr[i]=t._values.length}else i<g&&(t._ptr.splice(i+1,g-i),t._values.splice(t._ptr[i],t._values.length),t._index.splice(t._ptr[i],t._index.length));if(g=i,r>T){if(D){var l=0;for(a=0;a<g;a++){t._ptr[a]=t._ptr[a]+l,s=t._ptr[a+1]+l;var I=0;for(N=T;N<r;N++,I++)t._values.splice(s+I,0,o),t._index.splice(s+I,0,N),l++}t._ptr[g]=t._values.length}}else if(r<T){var y=0;for(a=0;a<g;a++){t._ptr[a]=t._ptr[a]-y;var h=t._ptr[a],j=t._ptr[a+1]-y;for(s=h;s<j;s++)(N=t._index[s])>r-1&&(t._values.splice(s,1),t._index.splice(s,1),y++)}t._ptr[a]=t._values.length}return t._size[0]=r,t._size[1]=i,t}function s(t,n,e,r,i){var u,o,M=r[0],c=r[1],N=[];for(u=0;u<M;u++)for(N[u]=[],o=0;o<c;o++)N[u][o]=0;for(o=0;o<c;o++)for(var a=e[o],s=e[o+1],D=a;D<s;D++)N[u=n[D]][o]=t?i?gr(t[D]):t[D]:1;return N}return i.prototype=new r,i.prototype.createSparseMatrix=function(t,n){return new i(t,n)},Object.defineProperty(i,"name",{value:"SparseMatrix"}),i.prototype.constructor=i,i.prototype.type="SparseMatrix",i.prototype.isSparseMatrix=!0,i.prototype.getDataType=function(){return Zu(this._values,Tr)},i.prototype.storage=function(){return"sparse"},i.prototype.datatype=function(){return this._datatype},i.prototype.create=function(t,n){return new i(t,n)},i.prototype.density=function(){var t=this._size[0],n=this._size[1];return 0!==t&&0!==n?this._index.length/(t*n):0},i.prototype.subset=function(t,n,e){if(!this._values)throw new Error("Cannot invoke subset on a Pattern only matrix");switch(arguments.length){case 1:return o(this,t);case 2:case 3:return M(this,t,n,e);default:throw new SyntaxError("Wrong number of arguments")}},i.prototype.get=function(t){if(!ke(t))throw new TypeError("Array expected");if(t.length!==this._size.length)throw new Qu(t.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");var n=t[0],e=t[1];ku(n,this._size[0]),ku(e,this._size[1]);var r=c(n,this._ptr[e],this._ptr[e+1],this._index);return r<this._ptr[e+1]&&this._index[r]===n?this._values[r]:0},i.prototype.set=function(t,r,i){if(!ke(t))throw new TypeError("Array expected");if(t.length!==this._size.length)throw new Qu(t.length,this._size.length);if(!this._values)throw new Error("Cannot invoke set on a Pattern only matrix");var u=t[0],o=t[1],M=this._size[0],s=this._size[1],D=e,T=0;Se(this._datatype)&&(D=n.find(e,[this._datatype,this._datatype])||e,T=n.convert(0,this._datatype)),(u>M-1||o>s-1)&&(a(this,Math.max(u+1,M),Math.max(o+1,s),i),M=this._size[0],s=this._size[1]),ku(u,M),ku(o,s);var g=c(u,this._ptr[o],this._ptr[o+1],this._index);return g<this._ptr[o+1]&&this._index[g]===u?D(r,T)?function(t,n,e,r,i){e.splice(t,1),r.splice(t,1);for(var u=n+1;u<i.length;u++)i[u]--}(g,o,this._values,this._index,this._ptr):this._values[g]=r:D(r,T)||N(g,u,o,r,this._values,this._index,this._ptr),this},i.prototype.resize=function(t,n,e){if(!Ye(t))throw new TypeError("Array or Matrix expected");var r=t.valueOf().map(t=>Array.isArray(t)&&1===t.length?t[0]:t);if(2!==r.length)throw new Error("Only two dimensions matrix are supported");return r.forEach((function(t){if(!de(t)||!tu(t)||t<0)throw new TypeError("Invalid size, must contain positive integers (size: "+pu(r)+")")})),a(e?this.clone():this,r[0],r[1],n)},i.prototype.reshape=function(t,n){if(!ke(t))throw new TypeError("Array expected");if(2!==t.length)throw new Error("Sparse matrices can only be reshaped in two dimensions");t.forEach((function(n){if(!de(n)||!tu(n)||n<=-2||0===n)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+pu(t)+")")}));var e=this._size[0]*this._size[1];if(e!==(t=mu(t,e))[0]*t[1])throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var r=n?this.clone():this;if(this._size[0]===t[0]&&this._size[1]===t[1])return r;for(var i=[],u=0;u<r._ptr.length;u++)for(var o=0;o<r._ptr[u+1]-r._ptr[u];o++)i.push(u);for(var M=r._values.slice(),a=r._index.slice(),s=0;s<r._index.length;s++){var D=a[s],T=i[s],g=D*r._size[1]+T;i[s]=g%t[1],a[s]=Math.floor(g/t[1])}r._values.length=0,r._index.length=0,r._ptr.length=t[1]+1,r._size=t.slice();for(var l=0;l<r._ptr.length;l++)r._ptr[l]=0;for(var I=0;I<M.length;I++){var y=a[I],h=i[I],j=M[I];N(c(y,r._ptr[h],r._ptr[h+1],r._index),y,h,j,r._values,r._index,r._ptr)}return r},i.prototype.clone=function(){return new i({values:this._values?gr(this._values):void 0,index:gr(this._index),ptr:gr(this._ptr),size:gr(this._size),datatype:this._datatype})},i.prototype.size=function(){return this._size.slice(0)},i.prototype.map=function(t,r){if(!this._values)throw new Error("Cannot invoke map on a Pattern only matrix");var u=this,o=this._size[0],M=this._size[1],c=no(t);return function(t,r,u,o,M,c,N){var a=[],s=[],D=[],T=e,g=0;Se(t._datatype)&&(T=n.find(e,[t._datatype,t._datatype])||e,g=n.convert(0,t._datatype));for(var l=function(t,n,e){t=c(t,n,e),T(t,g)||(a.push(t),s.push(n))},I=o;I<=M;I++){D.push(a.length);var y=t._ptr[I],h=t._ptr[I+1];if(N)for(var j=y;j<h;j++){var x=t._index[j];x>=r&&x<=u&&l(t._values[j],x-r,I-o)}else{for(var z={},O=y;O<h;O++){var E=t._index[O];z[E]=t._values[O]}for(var A=r;A<=u;A++){var f=A in z?z[A]:0;l(f,A-r,I-o)}}}return D.push(a.length),new i({values:a,index:s,ptr:D,size:[u-r+1,M-o+1]})}(this,0,o-1,0,M-1,(function(n,e,r){return 1===c?t(n):2===c?t(n,[e,r]):t(n,[e,r],u)}),r)},i.prototype.forEach=function(t,n){if(!this._values)throw new Error("Cannot invoke forEach on a Pattern only matrix");for(var e=this._size[0],r=this._size[1],i=0;i<r;i++){var u=this._ptr[i],o=this._ptr[i+1];if(n)for(var M=u;M<o;M++){var c=this._index[M];t(this._values[M],[c,i],this)}else{for(var N={},a=u;a<o;a++){N[this._index[a]]=this._values[a]}for(var s=0;s<e;s++){t(s in N?N[s]:0,[s,i],this)}}}},i.prototype[Symbol.iterator]=function*(){if(!this._values)throw new Error("Cannot iterate a Pattern only matrix");for(var t=this._size[1],n=0;n<t;n++)for(var e=this._ptr[n],r=this._ptr[n+1],i=e;i<r;i++){var u=this._index[i];yield{value:this._values[i],index:[u,n]}}},i.prototype.toArray=function(){return s(this._values,this._index,this._ptr,this._size,!0)},i.prototype.valueOf=function(){return s(this._values,this._index,this._ptr,this._size,!1)},i.prototype.format=function(t){for(var n=this._size[0],e=this._size[1],r=this.density(),i="Sparse Matrix ["+pu(n,t)+" x "+pu(e,t)+"] density: "+pu(r,t)+"\n",u=0;u<e;u++)for(var o=this._ptr[u],M=this._ptr[u+1],c=o;c<M;c++){i+="\n ("+pu(this._index[c],t)+", "+pu(u,t)+") ==> "+(this._values?pu(this._values[c],t):"X")}return i},i.prototype.toString=function(){return pu(this.toArray())},i.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},i.prototype.diagonal=function(t){if(t){if(Ce(t)&&(t=t.toNumber()),!de(t)||!tu(t))throw new TypeError("The parameter k must be an integer number")}else t=0;var n=t>0?t:0,e=t<0?-t:0,r=this._size[0],u=this._size[1],o=Math.min(r-e,u-n),M=[],c=[],N=[];N[0]=0;for(var a=n;a<u&&M.length<o;a++)for(var s=this._ptr[a],D=this._ptr[a+1],T=s;T<D;T++){var g=this._index[T];if(g===a-n+e){M.push(this._values[T]),c[M.length-1]=g-e;break}}return N.push(M.length),new i({values:M,index:c,ptr:N,size:[o,1]})},i.fromJSON=function(t){return new i(t)},i.diagonal=function(t,r,u,o,M){if(!ke(t))throw new TypeError("Array expected, size parameter");if(2!==t.length)throw new Error("Only two dimensions matrix are supported");if(t=t.map((function(t){if(Ce(t)&&(t=t.toNumber()),!de(t)||!tu(t)||t<1)throw new Error("Size values must be positive integers");return t})),u){if(Ce(u)&&(u=u.toNumber()),!de(u)||!tu(u))throw new TypeError("The parameter k must be an integer number")}else u=0;var c=e,N=0;Se(M)&&(c=n.find(e,[M,M])||e,N=n.convert(0,M));var a,s=u>0?u:0,D=u<0?-u:0,T=t[0],g=t[1],l=Math.min(T-D,g-s);if(ke(r)){if(r.length!==l)throw new Error("Invalid value array length");a=function(t){return r[t]}}else if(ve(r)){var I=r.size();if(1!==I.length||I[0]!==l)throw new Error("Invalid matrix length");a=function(t){return r.get([t])}}else a=function(){return r};for(var y=[],h=[],j=[],x=0;x<g;x++){j.push(y.length);var z=x-s;if(z>=0&&z<l){var O=a(z);c(O,N)||(h.push(z+D),y.push(O))}}return j.push(y.length),new i({values:y,index:h,ptr:j,size:[T,g]})},i.prototype.swapRows=function(t,n){if(!(de(t)&&tu(t)&&de(n)&&tu(n)))throw new Error("Row index must be positive integers");if(2!==this._size.length)throw new Error("Only two dimensional matrix is supported");return ku(t,this._size[0]),ku(n,this._size[0]),i._swapRows(t,n,this._size[1],this._values,this._index,this._ptr),this},i._forEachRow=function(t,n,e,r,i){for(var u=r[t],o=r[t+1],M=u;M<o;M++)i(e[M],n[M])},i._swapRows=function(t,n,e,r,i,u){for(var o=0;o<e;o++){var M=u[o],N=u[o+1],a=c(t,M,N,i),s=c(n,M,N,i);if(a<N&&s<N&&i[a]===t&&i[s]===n){if(r){var D=r[a];r[a]=r[s],r[s]=D}}else if(a<N&&i[a]===t&&(s>=N||i[s]!==n)){var T=r?r[a]:void 0;i.splice(s,0,n),r&&r.splice(s,0,T),i.splice(s<=a?a+1:a,1),r&&r.splice(s<=a?a+1:a,1)}else if(s<N&&i[s]===n&&(a>=N||i[a]!==t)){var g=r?r[s]:void 0;i.splice(a,0,t),r&&r.splice(a,0,g),i.splice(a<=s?s+1:s,1),r&&r.splice(a<=s?s+1:s,1)}}},i},{isClass:!0});Ju("bin",["typed","format"],t=>{var{typed:n,format:e}=t;return n("bin",{"number | BigNumber":function(t){return e(t,{notation:"bin"})},"number | BigNumber, number | BigNumber":function(t,n){return e(t,{notation:"bin",wordSize:n})}})});var WM=Ju("matrix",["typed","Matrix","DenseMatrix","SparseMatrix"],t=>{var{typed:n,Matrix:e,DenseMatrix:r,SparseMatrix:i}=t;return n("matrix",{"":function(){return u([])},string:function(t){return u([],t)},"string, string":function(t,n){return u([],t,n)},Array:function(t){return u(t)},Matrix:function(t){return u(t,t.storage())},"Array | Matrix, string":u,"Array | Matrix, string, string":u});function u(t,n,e){if("dense"===n||"default"===n||void 0===n)return new r(t,e);if("sparse"===n)return new i(t,e);throw new TypeError("Unknown matrix type "+JSON.stringify(n)+".")}});function GM(){throw new Error('No "matrix" implementation available')}var PM=Ju("size",["typed","config","?matrix"],t=>{var{typed:n,config:e,matrix:r}=t;return n("size",{Matrix:function(t){return t.create(t.size())},Array:Lu,string:function(t){return"Array"===e.matrix?[t.length]:r([t.length])},"number | Complex | BigNumber | Unit | boolean | null":function(t){return"Array"===e.matrix?[]:r?r([]):GM()}})}),JM=Ju("matAlgo11xS0s",["typed","equalScalar"],t=>{var{typed:n,equalScalar:e}=t;return function(t,r,i,u){var o=t._values,M=t._index,c=t._ptr,N=t._size,a=t._datatype;if(!o)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var s,D=N[0],T=N[1],g=e,l=0,I=i;"string"==typeof a&&(s=a,g=n.find(e,[s,s]),l=n.convert(0,s),r=n.convert(r,s),I=n.find(i,[s,s]));for(var y=[],h=[],j=[],x=0;x<T;x++){j[x]=h.length;for(var z=c[x],O=c[x+1],E=z;E<O;E++){var A=M[E],f=u?I(r,o[E]):I(o[E],r);g(f,l)||(h.push(A),y.push(f))}}return j[T]=h.length,t.createSparseMatrix({values:y,index:h,ptr:j,size:[D,T],datatype:s})}}),HM=Ju("matAlgo14xDs",["typed"],t=>{var{typed:n}=t;return function(t,e,r,i){var u,o=t._data,M=t._size,c=t._datatype,N=r;"string"==typeof c&&(u=c,e=n.convert(e,u),N=n.find(r,[u,u]));var a=M.length>0?function t(n,e,r,i,u,o,M){var c=[];if(e===r.length-1)for(var N=0;N<i;N++)c[N]=M?n(o,u[N]):n(u[N],o);else for(var a=0;a<i;a++)c[a]=t(n,e+1,r,r[e+1],u[a],o,M);return c}(N,0,M,M[0],o,e,i):[];return t.createDenseMatrix({data:a,size:gr(M),datatype:u})}});Ju("equal",["typed","equalScalar"],t=>{var{typed:n,equalScalar:e}=t;return n("equal",{"any, any":function(t,n){return null===t?null===n:null===n?null===t:void 0===t?void 0===n:void 0===n?void 0===t:e(t,n)}})});var KM=Ju("ones",["typed","config","matrix","BigNumber"],t=>{var{typed:n,config:e,matrix:r,BigNumber:i}=t;return n("ones",{"":function(){return"Array"===e.matrix?u([]):u([],"default")},"...number | BigNumber | string":function(t){if("string"==typeof t[t.length-1]){var n=t.pop();return u(t,n)}return"Array"===e.matrix?u(t):u(t,"default")},Array:u,Matrix:function(t){var n=t.storage();return u(t.valueOf(),n)},"Array | Matrix, string":function(t,n){return u(t.valueOf(),n)}});function u(t,n){var e=function(t){var n=!1;return t.forEach((function(t,e,r){Ce(t)&&(n=!0,r[e]=t.toNumber())})),n}(t)?new i(1):1;if(function(t){t.forEach((function(t){if("number"!=typeof t||!tu(t)||t<0)throw new Error("Parameters in function ones must be positive integers")}))}(t),n){var u=r(n);return t.length>0?u.resize(t,e):u}var o=[];return t.length>0?vu(o,t,e):o}});function XM(t,n,e,r){if(!(this instanceof XM))throw new SyntaxError("Constructor must be called with the new operator");this.fn=t,this.count=n,this.min=e,this.max=r,this.message="Wrong number of arguments in function "+t+" ("+n+" provided, "+e+(null!=r?"-"+r:"")+" expected)",this.stack=(new Error).stack}XM.prototype=new Error,XM.prototype.constructor=Error,XM.prototype.name="ArgumentsError",XM.prototype.isArgumentsError=!0;Ju("unequal",["typed","equalScalar"],t=>{var{typed:n,equalScalar:e}=t;return n("unequal",{"any, any":function(t,n){return null===t?null!==n:null===n?null!==t:void 0===t?void 0!==n:void 0===n?void 0!==t:!e(t,n)}})});Cu.signature="any, any";var qM=Ju("dot",["typed","addScalar","multiplyScalar","conj","size"],t=>{var{typed:n,addScalar:e,multiplyScalar:r,conj:i,size:u}=t;return n("dot",{"Array | DenseMatrix, Array | DenseMatrix":function(t,u){var c=o(t,u),N=ve(t)?t._data:t,a=ve(t)?t._datatype||t.getDataType():void 0,s=ve(u)?u._data:u,D=ve(u)?u._datatype||u.getDataType():void 0,T=2===M(t).length,g=2===M(u).length,l=e,I=r;if(a&&D&&a===D&&"string"==typeof a&&"mixed"!==a){var y=a;l=n.find(e,[y,y]),I=n.find(r,[y,y])}if(!T&&!g){for(var h=I(i(N[0]),s[0]),j=1;j<c;j++)h=l(h,I(i(N[j]),s[j]));return h}if(!T&&g){for(var x=I(i(N[0]),s[0][0]),z=1;z<c;z++)x=l(x,I(i(N[z]),s[z][0]));return x}if(T&&!g){for(var O=I(i(N[0][0]),s[0]),E=1;E<c;E++)O=l(O,I(i(N[E][0]),s[E]));return O}if(T&&g){for(var A=I(i(N[0][0]),s[0][0]),f=1;f<c;f++)A=l(A,I(i(N[f][0]),s[f][0]));return A}},"SparseMatrix, SparseMatrix":function(t,n){o(t,n);var i=t._index,u=t._values,M=n._index,c=n._values,N=0,a=e,s=r,D=0,T=0;for(;D<i.length&&T<M.length;){var g=i[D],l=M[T];g<l?D++:g>l?T++:g===l&&(N=a(N,s(u[D],c[T])),D++,T++)}return N}});function o(t,n){var e,r,i=M(t),u=M(n);if(1===i.length)e=i[0];else{if(2!==i.length||1!==i[1])throw new RangeError("Expected a column vector, instead got a matrix of size ("+i.join(", ")+")");e=i[0]}if(1===u.length)r=u[0];else{if(2!==u.length||1!==u[1])throw new RangeError("Expected a column vector, instead got a matrix of size ("+u.join(", ")+")");r=u[0]}if(e!==r)throw new RangeError("Vectors must have equal length ("+e+" != "+r+")");if(0===e)throw new RangeError("Cannot calculate the dot product of empty vectors");return e}function M(t){return ve(t)?t.size():u(t)}}),_M="number | BigNumber | Fraction | Matrix | Array";"".concat(_M,", ").concat(_M,", ...").concat(_M);var $M=Ju("multiply",["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],t=>{var{typed:n,matrix:e,addScalar:r,multiplyScalar:i,equalScalar:u,dot:o}=t,M=JM({typed:n,equalScalar:u}),c=HM({typed:n});function N(t,n){switch(t.length){case 1:switch(n.length){case 1:if(t[0]!==n[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(t[0]!==n[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+t[0]+") must match Matrix rows ("+n[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+n.length+" dimensions)")}break;case 2:switch(n.length){case 1:if(t[1]!==n[0])throw new RangeError("Dimension mismatch in multiplication. Matrix columns ("+t[1]+") must match Vector length ("+n[0]+")");break;case 2:if(t[1]!==n[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+t[1]+") must match Matrix B rows ("+n[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+n.length+" dimensions)")}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+t.length+" dimensions)")}}function a(t,e){if("dense"!==e.storage())throw new Error("Support for SparseMatrix not implemented");return function(t,e){var u,o=t._data,M=t._size,c=t._datatype||t.getDataType(),N=e._data,a=e._size,s=e._datatype||e.getDataType(),D=M[0],T=a[1],g=r,l=i;c&&s&&c===s&&"string"==typeof c&&"mixed"!==c&&(u=c,g=n.find(r,[u,u]),l=n.find(i,[u,u]));for(var I=[],y=0;y<T;y++){for(var h=l(o[0],N[0][y]),j=1;j<D;j++)h=g(h,l(o[j],N[j][y]));I[y]=h}return t.createDenseMatrix({data:I,size:[T],datatype:c===t._datatype&&s===e._datatype?u:void 0})}(t,e)}var s=n("_multiplyMatrixVector",{"DenseMatrix, any":function(t,e){var u,o=t._data,M=t._size,c=t._datatype||t.getDataType(),N=e._data,a=e._datatype||e.getDataType(),s=M[0],D=M[1],T=r,g=i;c&&a&&c===a&&"string"==typeof c&&"mixed"!==c&&(u=c,T=n.find(r,[u,u]),g=n.find(i,[u,u]));for(var l=[],I=0;I<s;I++){for(var y=o[I],h=g(y[0],N[0]),j=1;j<D;j++)h=T(h,g(y[j],N[j]));l[I]=h}return t.createDenseMatrix({data:l,size:[s],datatype:c===t._datatype&&a===e._datatype?u:void 0})},"SparseMatrix, any":function(t,e){var o=t._values,M=t._index,c=t._ptr,N=t._datatype||void 0===t._data?t._datatype:t.getDataType();if(!o)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var a,s=e._data,D=e._datatype||e.getDataType(),T=t._size[0],g=e._size[0],l=[],I=[],y=[],h=r,j=i,x=u,z=0;N&&D&&N===D&&"string"==typeof N&&"mixed"!==N&&(a=N,h=n.find(r,[a,a]),j=n.find(i,[a,a]),x=n.find(u,[a,a]),z=n.convert(0,a));var O=[],E=[];y[0]=0;for(var A=0;A<g;A++){var f=s[A];if(!x(f,z))for(var p=c[A],U=c[A+1],d=p;d<U;d++){var C=M[d];E[C]?O[C]=h(O[C],j(f,o[d])):(E[C]=!0,I.push(C),O[C]=j(f,o[d]))}}for(var Q=I.length,w=0;w<Q;w++){var L=I[w];l[w]=O[L]}return y[1]=I.length,t.createSparseMatrix({values:l,index:I,ptr:y,size:[T,1],datatype:N===t._datatype&&D===e._datatype?a:void 0})}}),D=n("_multiplyMatrixMatrix",{"DenseMatrix, DenseMatrix":function(t,e){var u,o=t._data,M=t._size,c=t._datatype||t.getDataType(),N=e._data,a=e._size,s=e._datatype||e.getDataType(),D=M[0],T=M[1],g=a[1],l=r,I=i;c&&s&&c===s&&"string"==typeof c&&"mixed"!==c&&"mixed"!==c&&(u=c,l=n.find(r,[u,u]),I=n.find(i,[u,u]));for(var y=[],h=0;h<D;h++){var j=o[h];y[h]=[];for(var x=0;x<g;x++){for(var z=I(j[0],N[0][x]),O=1;O<T;O++)z=l(z,I(j[O],N[O][x]));y[h][x]=z}}return t.createDenseMatrix({data:y,size:[D,g],datatype:c===t._datatype&&s===e._datatype?u:void 0})},"DenseMatrix, SparseMatrix":function(t,e){var o=t._data,M=t._size,c=t._datatype||t.getDataType(),N=e._values,a=e._index,s=e._ptr,D=e._size,T=e._datatype||void 0===e._data?e._datatype:e.getDataType();if(!N)throw new Error("Cannot multiply Dense Matrix times Pattern only Matrix");var g,l=M[0],I=D[1],y=r,h=i,j=u,x=0;c&&T&&c===T&&"string"==typeof c&&"mixed"!==c&&(g=c,y=n.find(r,[g,g]),h=n.find(i,[g,g]),j=n.find(u,[g,g]),x=n.convert(0,g));for(var z=[],O=[],E=[],A=e.createSparseMatrix({values:z,index:O,ptr:E,size:[l,I],datatype:c===t._datatype&&T===e._datatype?g:void 0}),f=0;f<I;f++){E[f]=O.length;var p=s[f],U=s[f+1];if(U>p)for(var d=0,C=0;C<l;C++){for(var Q=C+1,w=void 0,L=p;L<U;L++){var S=a[L];d!==Q?(w=h(o[C][S],N[L]),d=Q):w=y(w,h(o[C][S],N[L]))}d!==Q||j(w,x)||(O.push(C),z.push(w))}}return E[I]=O.length,A},"SparseMatrix, DenseMatrix":function(t,e){var o=t._values,M=t._index,c=t._ptr,N=t._datatype||void 0===t._data?t._datatype:t.getDataType();if(!o)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var a,s=e._data,D=e._datatype||e.getDataType(),T=t._size[0],g=e._size[0],l=e._size[1],I=r,y=i,h=u,j=0;N&&D&&N===D&&"string"==typeof N&&"mixed"!==N&&(a=N,I=n.find(r,[a,a]),y=n.find(i,[a,a]),h=n.find(u,[a,a]),j=n.convert(0,a));for(var x=[],z=[],O=[],E=t.createSparseMatrix({values:x,index:z,ptr:O,size:[T,l],datatype:N===t._datatype&&D===e._datatype?a:void 0}),A=[],f=[],p=0;p<l;p++){O[p]=z.length;for(var U=p+1,d=0;d<g;d++){var C=s[d][p];if(!h(C,j))for(var Q=c[d],w=c[d+1],L=Q;L<w;L++){var S=M[L];f[S]!==U?(f[S]=U,z.push(S),A[S]=y(C,o[L])):A[S]=I(A[S],y(C,o[L]))}}for(var k=O[p],v=z.length,Y=k;Y<v;Y++){var m=z[Y];x[Y]=A[m]}}return O[l]=z.length,E},"SparseMatrix, SparseMatrix":function(t,e){var u,o=t._values,M=t._index,c=t._ptr,N=t._datatype||void 0===t._data?t._datatype:t.getDataType(),a=e._values,s=e._index,D=e._ptr,T=e._datatype||void 0===e._data?e._datatype:e.getDataType(),g=t._size[0],l=e._size[1],I=o&&a,y=r,h=i;N&&T&&N===T&&"string"==typeof N&&"mixed"!==N&&(u=N,y=n.find(r,[u,u]),h=n.find(i,[u,u]));for(var j,x,z,O,E,A,f,p,U=I?[]:void 0,d=[],C=[],Q=t.createSparseMatrix({values:U,index:d,ptr:C,size:[g,l],datatype:N===t._datatype&&T===e._datatype?u:void 0}),w=I?[]:void 0,L=[],S=0;S<l;S++){C[S]=d.length;var k=S+1;for(E=D[S],A=D[S+1],O=E;O<A;O++)if(p=s[O],I)for(x=c[p],z=c[p+1],j=x;j<z;j++)f=M[j],L[f]!==k?(L[f]=k,d.push(f),w[f]=h(a[O],o[j])):w[f]=y(w[f],h(a[O],o[j]));else for(x=c[p],z=c[p+1],j=x;j<z;j++)f=M[j],L[f]!==k&&(L[f]=k,d.push(f));if(I)for(var v=C[S],Y=d.length,m=v;m<Y;m++){var R=d[m];U[m]=w[R]}}return C[l]=d.length,Q}});return n("multiply",i,{"Array, Array":n.referTo("Matrix, Matrix",t=>(n,r)=>{N(Lu(n),Lu(r));var i=t(e(n),e(r));return ve(i)?i.valueOf():i}),"Matrix, Matrix":function(t,n){var e=t.size(),r=n.size();return N(e,r),1===e.length?1===r.length?function(t,n,e){if(0===e)throw new Error("Cannot multiply two empty vectors");return o(t,n)}(t,n,e[0]):a(t,n):1===r.length?s(t,n):D(t,n)},"Matrix, Array":n.referTo("Matrix,Matrix",t=>(n,r)=>t(n,e(r))),"Array, Matrix":n.referToSelf(t=>(n,r)=>t(e(n,r.storage()),r)),"SparseMatrix, any":function(t,n){return M(t,n,i,!1)},"DenseMatrix, any":function(t,n){return c(t,n,i,!1)},"any, SparseMatrix":function(t,n){return M(n,t,i,!0)},"any, DenseMatrix":function(t,n){return c(n,t,i,!0)},"Array, any":function(t,n){return c(e(t),n,i,!1).valueOf()},"any, Array":function(t,n){return c(e(n),t,i,!0).valueOf()},"any, any":i,"any, any, ...any":n.referToSelf(t=>(n,e,r)=>{for(var i=t(n,e),u=0;u<r.length;u++)i=t(i,r[u]);return i})})});e(17);var tc=Ku({config:xr}),nc=_u({}),ec=Mo({}),rc=co({}),ic=No({Matrix:rc}),uc=fo({BigNumber:tc,Complex:nc,DenseMatrix:ic,Fraction:ec}),oc=DM({typed:uc}),Mc=EM({typed:uc}),cc=pM({config:xr,typed:uc}),Nc=YM({typed:uc}),ac=VM({Matrix:rc,equalScalar:cc,typed:uc}),sc=WM({DenseMatrix:ic,Matrix:rc,SparseMatrix:ac,typed:uc}),Dc=PM({matrix:sc,config:xr,typed:uc}),Tc=KM({BigNumber:tc,config:xr,matrix:sc,typed:uc}),gc=qM({addScalar:oc,conj:Mc,multiplyScalar:Nc,size:Dc,typed:uc}),lc=$M({addScalar:oc,dot:gc,equalScalar:cc,matrix:sc,multiplyScalar:Nc,typed:uc});function Ic(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,u=Ee()(t);if(n&&e){var o=Oc(t),M=xc(o,e,n),c=hc(t,M);u=Ee()(c).pop()}if(r&&i){var N=[].concat(u).reverse(),a=Oc(N),s=xc(a,i,r),D=1-s,T=hc(u,D);u=T[0]}return u}function yc(t,n){var e=t.x-n.x,r=t.y-n.y;return Math.sqrt(e*e+r*r)}function hc(t,n){switch(t.length){case 2:return function(t,n){var e=jc(t,n);return[[t[0],e],[e,Ee()(t).pop()]]}(t,n);case 3:return function(t,n){var e=[t[0],t[1]],r=[t[1],t[2]],i=jc(e,n),u=jc(r,n),o=jc([i,u],n);return[[t[0],i,o],[o,u,t[2]]]}(t,n);case 4:return function(t,n){var e=[t[0],t[1]],r=[t[1],t[2]],i=[t[2],t[3]],u=jc(e,n),o=jc(r,n),M=jc(i,n),c=jc([u,o],n),N=jc([o,M],n),a=jc([c,N],n);return[[t[0],u,c,a],[a,N,M,t[3]]]}(t,n);default:return null}}function jc(t,n){var e=je()(t,1)[0],r=Ee()(t).pop(),i=e.x+(r.x-e.x)*n;return{y:e.y+(r.y-e.y)*n,x:i}}function xc(t,n,e){for(var r=t.size(),i=function(t){switch(t){case 1:return lc(zc(1e3,1),sc([[1,0],[-1,1]]));case 2:return lc(zc(1e3,2),sc([[1,0,0],[-2,2,0],[1,-2,1]]));case 3:return lc(zc(1e3,3),sc([[1,0,0,0],[-3,3,0,0],[3,-6,3,0],[-1,3,-3,1]]));default:return null}}(je()(r,1)[0]-1),u=function(t,n){var e=-t.x,r=-t.y,i=[],u=[];n.forEach((function(t,n){switch(je()(n,2)[1]){case 0:i.push(t+e);break;case 1:u.push(t+r)}}));for(var o=[],M=0;M<i.length;M++)o.push(Math.sqrt(i[M]*i[M]+u[M]*u[M]));return o}(n,lc(i,t)),o=u.length-1,M=0;M<u.length;M++)if(u[M]>=e){o=M;break}return.001*o}function zc(t,n){var e=1/t,r=0,i=Tc(t+1,n+1).map((function(t,n){var i=null;switch(je()(n,2)[1]){case 0:i=1;break;case 1:i=r;break;case 2:i=r*r;break;case 3:i=r*r*r}return r+=e,i}));return sc(i)}function Oc(t){var n=t.map((function(t){return[t.x,t.y]}));return sc(n)}function Ec(t){if(3===t.length)throw new Error("bezierBoundingBox function supports only linear and cubic bezier curves for now");var n,e,r,i,u,o,M=2===t.length?(n=t,e=je()(n,2),r=e[0],i=e[1],u=[r.x,i.x],o=[r.y,i.y],{min:{x:Math.min.apply(0,u),y:Math.min.apply(0,o)},max:{x:Math.max.apply(0,u),y:Math.max.apply(0,o)}}):function(t){for(var n,e,r,i,u,o,M,c,N=je()(t,4),a=N[0],s=N[1],D=N[2],T=N[3],g=[],l=[],I=[],y=0;y<2;++y)if(0===y?(e=6*a.x-12*s.x+6*D.x,n=-3*a.x+9*s.x-9*D.x+3*T.x,r=3*s.x-3*a.x):(e=6*a.y-12*s.y+6*D.y,n=-3*a.y+9*s.y-9*D.y+3*T.y,r=3*s.y-3*a.y),Math.abs(n)<1e-12){if(Math.abs(e)<1e-12)continue;(i=-r/e)>0&&i<1&&g.push(i)}else(M=e*e-4*r*n)<0?Math.abs(M)<1e-12&&(i=-e/(2*n))>0&&i<1&&g.push(i):(c=Math.sqrt(M),(u=(-e+c)/(2*n))>0&&u<1&&g.push(u),(o=(-e-c)/(2*n))>0&&o<1&&g.push(o));var h,j=g.length;for(;j--;)i=g[j],h=1-i,l[j]=h*h*h*a.x+3*h*h*i*s.x+3*h*i*i*D.x+i*i*i*T.x,I[j]=h*h*h*a.y+3*h*h*i*s.y+3*h*i*i*D.y+i*i*i*T.y;return l.push(a.x,T.x),I.push(a.y,T.y),{min:{x:Math.min.apply(0,l),y:Math.min.apply(0,I)},max:{x:Math.max.apply(0,l),y:Math.max.apply(0,I)}}}(t),c=2===t.length?1:0;return[{x:M.min.x,y:M.min.y-c},{x:M.max.x,y:M.min.y-c},{x:M.max.x,y:M.max.y+c},{x:M.min.x,y:M.max.y+c}]}var Ac=e(3),fc=e.n(Ac),pc=e(0),Uc=e.n(pc),dc=e(4),Cc=e.n(dc),Qc=function(){function t(n){pt()(this,t),Qt()(this,"ctx",void 0),Qt()(this,"playData",void 0),Qt()(this,"options",void 0),Qt()(this,"courtTypeConstants",void 0),this.ctx=n.ctx,this.playData=n.playData,this.options=n.options?n.options:{},this.courtTypeConstants=n.courtTypeConstants}return dt()(t,[{key:"apply",value:function(){this.ctx.save(),this.drawLogic(),this.ctx.restore()}},{key:"drawLogic",value:function(){}}]),t}();function wc(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Lc=function(t){Cc()(e,t);var n=wc(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"apply",value:function(){this.original()&&(this.ctx.save(),this.drawLogic(),this.ctx.restore()),this.reflection()&&(this.ctx.save(),this.verticalFlipAndRotation(),this.drawLogic(),this.ctx.restore())}},{key:"original",value:function(){return!0}},{key:"reflection",value:function(){return!1}},{key:"verticalFlipAndRotation",value:function(){var t=this.courtTypeConstants.COURT_RECT_HEIGHT;this.ctx.scale(1,-1),this.ctx.translate(0,-Math.abs(t))}},{key:"setColor",value:function(t){var n="transparent"===this.options.lineColor?"transparent":t;this.ctx.strokeStyle=n,this.ctx.fillStyle=n}},{key:"courtCenter",get:function(){return{x:this.courtTypeConstants.COURT_RECT_WIDTH/2,y:this.courtTypeConstants.COURT_RECT_HEIGHT/2}}}]),e}(Qc);function Sc(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var kc=function(t){Cc()(e,t);var n=Sc(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.rect(0,0,this.courtTypeConstants.COURT_RECT_WIDTH,this.courtTypeConstants.COURT_RECT_HEIGHT),this.ctx.stroke()}}]),e}(Lc),vc=.1667,Yc=1.5,mc=2.4,Rc=.55,Fc=!1,bc=480,Zc=460,Bc="#C49463",Vc=60.5,Wc=127.28125,Gc=60,Pc=1.41667,Jc=26,Hc=.5,Kc=4,Xc=6,qc=5,_c=3.58333,$c=5,tN=37,nN=15,eN=20,rN=5,iN=2,uN=.5,oN=1.5,MN=18,cN=95,NN=390,aN=330,sN=90,DN=2.5,TN=13;function gN(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var lN=function(t){Cc()(e,t);var n=gN(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:Gc},n={x:this.courtCenter.x,y:Gc+Vc},e="transparent"===this.options.lineColor?"transparent":Bc;this.ctx.fillStyle=e,this.ctx.strokeStyle=e;var r=Math.PI/11,i=Math.PI-Math.PI/11;this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(n.x,n.y,cN,r,i,!1);var u=IN(n,cN,i),o=IN(n,cN,r);this.ctx.moveTo(u.x,u.y),this.ctx.lineTo(t.x,t.y-Math.sqrt(18)),this.ctx.lineTo(o.x,o.y),this.ctx.lineTo(u.x,u.y),this.ctx.translate(t.x,t.y),this.ctx.rotate(Math.PI/4),this.ctx.moveTo(3,3),this.ctx.lineTo(3,sN-3),this.ctx.lineTo(sN-3,sN-3),this.ctx.lineTo(sN-3,3),this.ctx.lineTo(3,3),this.ctx.fill(),this.ctx.restore(),this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(n.x,n.y-oN,MN/2,0,2*Math.PI,!0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore(),this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(t.x,t.y,Jc/2,0,2*Math.PI,!0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore(),this.ctx.save(),this.ctx.translate(t.x,t.y),this.ctx.rotate(Math.PI/4),this.ctx.beginPath(),this.ctx.arc(sN,0,TN,Math.PI/4,Math.PI+Math.PI/20,!1),this.ctx.stroke(),this.ctx.fill(),this.ctx.beginPath(),this.ctx.arc(sN,sN,TN,0,2*Math.PI,!0),this.ctx.stroke(),this.ctx.fill(),this.ctx.beginPath(),this.ctx.arc(0,sN,TN,Math.PI/4,Math.PI+Math.PI/2.2,!0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(Lc);function IN(t,n,e){return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}}function yN(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var hN=function(t){Cc()(e,t);var n=yN(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this,n={x:this.courtCenter.x,y:Gc};this.ctx.lineWidth=3*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.save(),this.ctx.translate(n.x,n.y),this.ctx.rotate(Math.PI/4),this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(sN,0),this.ctx.stroke(),this.drawBaseSquare(sN,0),this.drawBaseSquare(sN+DN/2,sN-DN/2),this.drawBaseSquare(DN,sN-DN),this.ctx.beginPath(),this.ctx.lineTo(0,0),this.ctx.stroke(),this.ctx.restore(),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(n.x,n.y),t.ctx.rotate(e*(Math.PI/4)),t.ctx.beginPath(),t.ctx.moveTo(0,0),t.ctx.lineTo(e*aN,0),t.ctx.stroke(),t.ctx.restore()}));var e=Math.PI/8.1,r=Math.PI-Math.PI/8.1;this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(n.x,n.y+138,NN-138,e,r,!1),this.ctx.stroke(),this.ctx.restore()}},{key:"drawBaseSquare",value:function(t,n){this.ctx.save(),this.ctx.lineCap="square",this.ctx.beginPath(),this.ctx.translate(t,n),this.ctx.moveTo(0,0),this.ctx.lineTo(0,DN),this.ctx.lineTo(-DN,DN),this.ctx.lineTo(-DN,0),this.ctx.lineTo(0,0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(Lc);function jN(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var xN=function(t){Cc()(e,t);var n=jN(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this,n={x:this.courtCenter.x,y:Gc},e={x:n.x-Pc/2,y:n.y+Pc},r={x:n.x+Pc/2,y:n.y+Pc};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(r.x,r.y),this.ctx.lineTo(r.x,r.y-Pc/2),this.ctx.lineTo(n.x,n.y),this.ctx.lineTo(e.x,e.y-Pc/2),this.ctx.lineTo(e.x,e.y),this.ctx.stroke(),this.ctx.fill(),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(n.x,n.y+Pc/2),t.ctx.beginPath();var r=Pc/2+Hc;t.ctx.moveTo(e*r,0),t.ctx.lineTo(e*r,Pc/2),t.ctx.lineTo(e*(r+Kc),Pc/2),t.ctx.lineTo(e*(r+Kc),Pc/2-Xc),t.ctx.lineTo(e*r,Pc/2-Xc),t.ctx.lineTo(e*r,0),t.ctx.lineTo(e*r,0),t.ctx.stroke(),t.ctx.restore()}));var i=n.y+Pc/2-Xc+Pc/2;[-1,1].forEach((function(n){t.ctx.save(),t.ctx.translate(t.courtCenter.x,i-qc),t.ctx.beginPath(),t.ctx.moveTo(0,0),t.ctx.lineTo(n*(_c/2),0),t.ctx.lineTo(n*(_c/2),qc),t.ctx.stroke(),t.ctx.restore()})),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(t.courtCenter.x,n.y-Jc/2),t.ctx.beginPath(),t.ctx.arc(e*tN,0,$c/2,0,2*Math.PI,!0),t.ctx.stroke(),t.ctx.restore()})),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(n.x,n.y),t.ctx.rotate(e*(Math.PI/4)),t.ctx.beginPath(),t.ctx.moveTo(e*sN,-(nN+rN)),t.ctx.lineTo(e*sN,-nN),t.ctx.lineTo(e*(sN-eN),-nN),t.ctx.lineTo(e*(sN-eN),-(nN+rN)),t.ctx.stroke(),t.ctx.restore()}))}}]),e}(Lc);function zN(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var ON=function(t){Cc()(e,t);var n=zN(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:Gc+Vc};this.ctx.save(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.translate(t.x,t.y),this.ctx.moveTo(0,0),this.ctx.lineTo(iN/2,0),this.ctx.lineTo(iN/2,uN),this.ctx.lineTo(-iN/2,uN),this.ctx.lineTo(-iN/2,0),this.ctx.lineTo(0,0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(Lc);function EN(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var AN=function(t){Cc()(e,t);var n=EN(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.rect(0,0,this.courtTypeConstants.COURT_RECT_WIDTH,this.courtTypeConstants.COURT_RECT_HEIGHT),this.ctx.stroke()}}]),e}(Lc),fN=.1667,pN=1.5,UN=2.4,dN=.55,CN=!1,QN=280,wN=260,LN="#C49463",SN="#E4CCB7",kN=43,vN=127.28125,YN=25,mN=1.41667,RN=26,FN=.5,bN=4,ZN=6,BN=5,VN=3.58333,WN=5,GN=37,PN=8,JN=15,HN=3,KN=5,XN=1,qN=0,_N=16,$N=60,ta=220,na=190,ea=60,ra=2.5,ia=13;function ua(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var oa=function(t){Cc()(e,t);var n=ua(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:YN},n={x:this.courtCenter.x,y:YN+kN},e="transparent"===this.options.lineColor?"transparent":LN;this.ctx.fillStyle=e,this.ctx.strokeStyle=e;var r=Math.PI/15,i=Math.PI-Math.PI/15;this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(n.x,n.y,$N,r,i,!1);var u=Ma(n,$N,i),o=Ma(n,$N,r);this.ctx.moveTo(u.x,u.y),this.ctx.lineTo(t.x,t.y-Math.sqrt(18)),this.ctx.lineTo(o.x,o.y),this.ctx.lineTo(u.x,u.y),this.ctx.fill(),this.ctx.restore(),this.ctx.save(),this.ctx.strokeStyle="transparent"===this.options.lineColor?"transparent":"#FFFFFF",this.ctx.fillStyle="transparent"===this.options.lineColor?"transparent":SN,this.ctx.beginPath(),this.ctx.arc(n.x,n.y-qN,_N/2,0,2*Math.PI,!0),this.ctx.fill(),this.ctx.stroke(),this.ctx.restore(),this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(t.x,t.y,RN/2,0,2*Math.PI,!0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(Lc);function Ma(t,n,e){return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}}function ca(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Na=function(t){Cc()(e,t);var n=ca(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this,n={x:this.courtCenter.x,y:YN};this.ctx.lineWidth=3*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.save(),this.ctx.translate(n.x,n.y),this.ctx.rotate(Math.PI/4),this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(ea,0),this.ctx.stroke(),this.drawBaseSquare(ea,0),this.drawBaseSquare(ea+ra/2,ea-ra/2),this.drawBaseSquare(ra,ea-ra),this.ctx.beginPath(),this.ctx.lineTo(0,0),this.ctx.stroke(),this.ctx.restore(),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(n.x,n.y),t.ctx.rotate(e*(Math.PI/4)),t.ctx.beginPath(),t.ctx.moveTo(0,0),t.ctx.lineTo(e*na,0),t.ctx.stroke(),t.ctx.restore()}));var e=Math.PI/7.8,r=Math.PI-Math.PI/7.8;this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(n.x,n.y+77,ta-77+3,e,r,!1),this.ctx.stroke(),this.ctx.restore()}},{key:"drawBaseSquare",value:function(t,n){this.ctx.save(),this.ctx.lineCap="square",this.ctx.beginPath(),this.ctx.translate(t,n),this.ctx.moveTo(0,0),this.ctx.lineTo(0,ra),this.ctx.lineTo(-ra,ra),this.ctx.lineTo(-ra,0),this.ctx.lineTo(0,0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(Lc);function aa(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var sa=function(t){Cc()(e,t);var n=aa(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this,n={x:this.courtCenter.x,y:YN},e={x:n.x-mN/2,y:n.y+mN},r={x:n.x+mN/2,y:n.y+mN};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(r.x,r.y),this.ctx.lineTo(r.x,r.y-mN/2),this.ctx.lineTo(n.x,n.y),this.ctx.lineTo(e.x,e.y-mN/2),this.ctx.lineTo(e.x,e.y),this.ctx.stroke(),this.ctx.fill(),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(n.x,n.y+mN/2),t.ctx.beginPath();var r=mN/2+FN;t.ctx.moveTo(e*r,0),t.ctx.lineTo(e*r,mN/2),t.ctx.lineTo(e*(r+bN),mN/2),t.ctx.lineTo(e*(r+bN),mN/2-ZN),t.ctx.lineTo(e*r,mN/2-ZN),t.ctx.lineTo(e*r,0),t.ctx.lineTo(e*r,0),t.ctx.stroke(),t.ctx.restore()}));var i=n.y+mN/2-ZN+mN/2;[-1,1].forEach((function(n){t.ctx.save(),t.ctx.translate(t.courtCenter.x,i-BN),t.ctx.beginPath(),t.ctx.moveTo(0,0),t.ctx.lineTo(n*(VN/2),0),t.ctx.lineTo(n*(VN/2),BN),t.ctx.stroke(),t.ctx.restore()})),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(t.courtCenter.x,n.y-RN/2),t.ctx.beginPath(),t.ctx.arc(e*GN,0,WN/2,0,2*Math.PI,!0),t.ctx.stroke(),t.ctx.restore()})),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(n.x,n.y),t.ctx.rotate(e*(Math.PI/4)),t.ctx.beginPath(),t.ctx.moveTo(e*ea,-(PN+HN)),t.ctx.lineTo(e*ea,-PN),t.ctx.lineTo(e*(ea-JN),-PN),t.ctx.lineTo(e*(ea-JN),-(PN+HN)),t.ctx.stroke(),t.ctx.restore()}))}}]),e}(Lc);function Da(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Ta=function(t){Cc()(e,t);var n=Da(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:YN+kN-XN/2};this.ctx.save(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.translate(t.x,t.y),this.ctx.moveTo(0,0),this.ctx.lineTo(KN/2,0),this.ctx.lineTo(KN/2,XN),this.ctx.lineTo(-KN/2,XN),this.ctx.lineTo(-KN/2,0),this.ctx.lineTo(0,0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(Lc),ga=300,la=260,Ia="#C49463",ya="#E4CCB7",ha=40,ja=127.28125,xa=25,za=1.41667,Oa=26,Ea=.5,Aa=4,fa=6,pa=5,Ua=3.58333,da=5,Ca=37,Qa=8,wa=15,La=3,Sa=5,ka=1,va=0,Ya=16,ma=60,Ra=225,Fa=200,ba=60,Za=2.5,Ba=13;function Va(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Wa=function(t){Cc()(e,t);var n=Va(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:xa},n={x:this.courtCenter.x,y:xa+ha},e="transparent"===this.options.lineColor?"transparent":Ia;this.ctx.fillStyle=e,this.ctx.strokeStyle=e;var r=Math.PI/13,i=Math.PI-Math.PI/13;this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(n.x,n.y,ma,r,i,!1);var u=Ga(n,ma,i),o=Ga(n,ma,r);this.ctx.moveTo(u.x,u.y),this.ctx.lineTo(t.x,t.y-Math.sqrt(18)),this.ctx.lineTo(o.x,o.y),this.ctx.lineTo(u.x,u.y),this.ctx.fill(),this.ctx.restore(),this.ctx.save(),this.ctx.strokeStyle="transparent"===this.options.lineColor?"transparent":"#FFFFFF",this.ctx.fillStyle="transparent"===this.options.lineColor?"transparent":ya,this.ctx.beginPath(),this.ctx.arc(n.x,n.y-va,Ya/2,0,2*Math.PI,!0),this.ctx.fill(),this.ctx.stroke(),this.ctx.restore(),this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(t.x,t.y,Oa/2,0,2*Math.PI,!0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(Lc);function Ga(t,n,e){return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}}function Pa(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Ja=function(t){Cc()(e,t);var n=Pa(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this,n={x:this.courtCenter.x,y:xa};this.ctx.lineWidth=3*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.save(),this.ctx.translate(n.x,n.y),this.ctx.rotate(Math.PI/4),this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(ba,0),this.ctx.stroke(),this.drawBaseSquare(ba,0),this.drawBaseSquare(ba+Za/2,ba-Za/2),this.drawBaseSquare(Za,ba-Za),this.ctx.beginPath(),this.ctx.lineTo(0,0),this.ctx.stroke(),this.ctx.restore(),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(n.x,n.y),t.ctx.rotate(e*(Math.PI/4)),t.ctx.beginPath(),t.ctx.moveTo(0,0),t.ctx.lineTo(e*Fa,0),t.ctx.stroke(),t.ctx.restore()}));var e=Math.PI/6.8,r=Math.PI-Math.PI/6.8;this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(n.x,n.y+71,Ra-71+4,e,r,!1),this.ctx.stroke(),this.ctx.restore()}},{key:"drawBaseSquare",value:function(t,n){this.ctx.save(),this.ctx.lineCap="square",this.ctx.beginPath(),this.ctx.translate(t,n),this.ctx.moveTo(0,0),this.ctx.lineTo(0,Za),this.ctx.lineTo(-Za,Za),this.ctx.lineTo(-Za,0),this.ctx.lineTo(0,0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(Lc);function Ha(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Ka=function(t){Cc()(e,t);var n=Ha(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this,n={x:this.courtCenter.x,y:xa},e={x:n.x-za/2,y:n.y+za},r={x:n.x+za/2,y:n.y+za};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(r.x,r.y),this.ctx.lineTo(r.x,r.y-za/2),this.ctx.lineTo(n.x,n.y),this.ctx.lineTo(e.x,e.y-za/2),this.ctx.lineTo(e.x,e.y),this.ctx.stroke(),this.ctx.fill(),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(n.x,n.y+za/2),t.ctx.beginPath();var r=za/2+Ea;t.ctx.moveTo(e*r,0),t.ctx.lineTo(e*r,za/2),t.ctx.lineTo(e*(r+Aa),za/2),t.ctx.lineTo(e*(r+Aa),za/2-fa),t.ctx.lineTo(e*r,za/2-fa),t.ctx.lineTo(e*r,0),t.ctx.lineTo(e*r,0),t.ctx.stroke(),t.ctx.restore()}));var i=n.y+za/2-fa+za/2;[-1,1].forEach((function(n){t.ctx.save(),t.ctx.translate(t.courtCenter.x,i-pa),t.ctx.beginPath(),t.ctx.moveTo(0,0),t.ctx.lineTo(n*(Ua/2),0),t.ctx.lineTo(n*(Ua/2),pa),t.ctx.stroke(),t.ctx.restore()})),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(t.courtCenter.x,n.y-Oa/2),t.ctx.beginPath(),t.ctx.arc(e*Ca,0,da/2,0,2*Math.PI,!0),t.ctx.stroke(),t.ctx.restore()})),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(n.x,n.y),t.ctx.rotate(e*(Math.PI/4)),t.ctx.beginPath(),t.ctx.moveTo(e*ba,-(Qa+La)),t.ctx.lineTo(e*ba,-Qa),t.ctx.lineTo(e*(ba-wa),-Qa),t.ctx.lineTo(e*(ba-wa),-(Qa+La)),t.ctx.stroke(),t.ctx.restore()}))}}]),e}(Lc);function Xa(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var qa=function(t){Cc()(e,t);var n=Xa(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:xa+ha-ka/2};this.ctx.save(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.translate(t.x,t.y),this.ctx.moveTo(0,0),this.ctx.lineTo(Sa/2,0),this.ctx.lineTo(Sa/2,ka),this.ctx.lineTo(-Sa/2,ka),this.ctx.lineTo(-Sa/2,0),this.ctx.lineTo(0,0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(Lc);function _a(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var $a=function(t){Cc()(e,t);var n=_a(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){if(this.courtTypeConstants.BENCH_MARKING){var t={x:this.courtCenter.x-11,y:0},n={x:this.courtCenter.x-11,y:.5},e={x:this.courtCenter.x+11,y:0},r={x:this.courtCenter.x+11,y:.5};this.ctx.beginPath(),this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(r.x,r.y),this.ctx.stroke()}}}]),e}(Lc);function ts(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var ns=function(t){Cc()(e,t);var n=ts(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=0,n=28,e=3,r=28,i={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:28},u={x:this.courtTypeConstants.COURT_RECT_WIDTH-3,y:28};this.ctx.beginPath(),this.ctx.moveTo(t,n),this.ctx.lineTo(e,r),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(i.x,i.y),this.ctx.lineTo(u.x,u.y),this.ctx.stroke()}}]),e}(Lc);function es(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var rs=function(t){Cc()(e,t);var n=es(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.rect(0,0,this.courtTypeConstants.COURT_RECT_WIDTH,this.courtTypeConstants.COURT_RECT_HEIGHT),this.ctx.stroke()}}]),e}(Lc);function is(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var us=function(t){Cc()(e,t);var n=is(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){if(this.options.showHalfCourtCircle){this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtCenter.y,6,0,2*Math.PI,!0),this.courtTypeConstants.CENTER_INNER_CIRCLE&&this.ctx.arc(this.courtCenter.x,this.courtCenter.y,2,0,2*Math.PI,!0),this.ctx.stroke()}}}]),e}(Lc);function os(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Ms=function(t){Cc()(e,t);var n=os(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){var t={x:0,y:this.courtCenter.y},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke()}}]),e}(Lc);function cs(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Ns=function(t){Cc()(e,t);var n=cs(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:19},n=this.courtTypeConstants.FREE_THROW_INNER_WIDTH/2;this.ctx.beginPath(),this.ctx.arc(t.x,t.y,n,0,Math.PI,!1),this.ctx.stroke(),this.courtTypeConstants.FREE_THROW_INNER_DASHED_CIRCLE&&(this.ctx.setLineDash([1,.5]),this.ctx.beginPath(),this.ctx.arc(t.x,t.y,n,0,Math.PI,!0),this.ctx.stroke())}}]),e}(Lc);function as(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var ss=function(t){Cc()(e,t);var n=as(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:5.25},n={x:t.x-3,y:4},e={x:t.x+3,y:4};this.ctx.beginPath(),this.ctx.moveTo(n.x,n.y),this.ctx.lineTo(e.x,e.y),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.arc(t.x,t.y,.75,0,2*Math.PI,!0),this.ctx.stroke()}}]),e}(Lc);function Ds(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Ts=function(t){Cc()(e,t);var n=Ds(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this.courtTypeConstants.FREE_THROW_INNER_WIDTH,n=this.courtTypeConstants.FREE_THROW_OUTER_WIDTH,e={x:this.courtCenter.x-t/2,y:0},r={x:this.courtCenter.x-n/2,y:0};this.ctx.beginPath(),this.ctx.rect(e.x,e.y,t,19),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.rect(r.x,r.y,n,19),this.ctx.stroke()}}]),e}(Lc);function gs(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var ls=function(t){Cc()(e,t);var n=gs(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:5.25},n={x:this.courtCenter.x+4,y:4},e={x:this.courtCenter.x+4,y:5.25},r={x:this.courtCenter.x-4,y:4};this.ctx.beginPath(),this.ctx.moveTo(n.x,n.y),this.ctx.lineTo(e.x,e.y),this.ctx.arc(t.x,t.y,4,0,Math.PI,!1),this.ctx.lineTo(r.x,r.y),this.ctx.stroke()}}]),e}(Lc);function Is(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var ys=function(t){Cc()(e,t);var n=Is(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this.courtCenter.x-this.courtTypeConstants.HOOP_CORNER_DISTANCE,n=this.courtTypeConstants.COURT_RECT_WIDTH-t,e={x:t,y:0},r={x:t,y:this.courtTypeConstants.THREE_POINT_OFFSET_ORIGIN_Y_APPROX},i={x:n,y:0},u={x:this.courtCenter.x,y:5.25},o=Math.asin((this.courtTypeConstants.THREE_POINT_ASIN_APPROX-.75-.5)/this.courtTypeConstants.THREE_POINT_ARC_RADIUS),M=Math.PI-o;this.ctx.beginPath(),this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(r.x,r.y),this.ctx.arc(u.x,u.y,this.courtTypeConstants.THREE_POINT_ARC_RADIUS,M,o,!0),this.ctx.lineTo(i.x,i.y),this.ctx.stroke()}}]),e}(Lc),hs=.1667,js=1.5,xs=1,zs=.33,Os=!0;function Es(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var As=function(t){Cc()(e,t);var n=Es(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){var t=this,n=this.courtCenter.x,e=5.25,r={x:this.courtCenter.x,y:e+30},i=[{x:n-30*Math.cos(50*Math.PI/180),y:e+30*Math.sin(50*Math.PI/180)},r,{x:n+30*Math.cos(50*Math.PI/180),y:e+30*Math.sin(50*Math.PI/180)}];this.ctx.lineWidth=3*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.font="".concat(4,"px Helvetica"),i.forEach((function(n){t.ctx.beginPath(),t.ctx.arc(n.x,n.y,2,0,2*Math.PI,!0),t.ctx.stroke(),"transparent"!==t.options.lineColor&&(t.ctx.fillStyle="#001c4f",t.ctx.fill()),t.ctx.fillStyle=t.options.lineColor,t.ctx.fillText("4",n.x-1.1,n.y+1.4)}))}}]),e}(Lc),fs={drawLogic:function(){var t=this,n=this.courtTypeConstants.FREE_THROW_OUTER_WIDTH/2,e=this.courtCenter.x-n,r=this.courtCenter.x+n,i=this.courtCenter.x-5,u=this.courtCenter.x+5;[7,8,11,14].forEach((function(n){t.ctx.beginPath(),t.ctx.moveTo(e,n),t.ctx.lineTo(e-.667,n),t.ctx.moveTo(r,n),t.ctx.lineTo(r+.667,n),t.ctx.stroke()})),this.ctx.beginPath(),this.ctx.moveTo(i,13),this.ctx.lineTo(i+.5,13),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(u,13),this.ctx.lineTo(u-.5,13),this.ctx.stroke()}};function ps(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Us=function(t){Cc()(e,t);var n=ps(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}}]),e}(Lc);Object.assign(Us.prototype,fs);var ds=50,Cs=94,Qs=22,ws=23.6762,Ls=10,Ss=14,ks=12,vs=16,Ys=!0,ms=!0,Rs=!0;function Fs(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var bs=function(t){Cc()(e,t);var n=Fs(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this,n=this.courtTypeConstants.FREE_THROW_OUTER_WIDTH/2,e=this.courtCenter.x-n,r=this.courtCenter.x+n;[5.9,13.6,16.5].forEach((function(n){t.ctx.beginPath(),t.ctx.moveTo(e,n),t.ctx.lineTo(e-.333,n),t.ctx.moveTo(r,n),t.ctx.lineTo(r+.333,n),t.ctx.stroke()})),this.ctx.beginPath(),this.ctx.rect(e,8.8,-.333,1.9),this.ctx.fill(),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.rect(r,8.8,.333,1.9),this.ctx.fill(),this.ctx.stroke()}}]),e}(Lc),Zs=49.21,Bs=91.86,Vs=21.65,Ws=22.15,Gs=6,Ps=8,Js=12,Hs=16.08,Ks=!1,Xs=!1,qs=!1;function _s(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var $s=function(t){Cc()(e,t);var n=_s(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}}]),e}(Lc);Object.assign($s.prototype,fs);var tD=50,nD=94,eD=22,rD=23.6762,iD=10,uD=14,oD=12,MD=16,cD=!0,ND=!0,aD=!0,sD={drawLogic:function(){var t=this,n=this.courtTypeConstants.FREE_THROW_OUTER_WIDTH/2,e=this.courtCenter.x-n,r=this.courtCenter.x+n;[11,14,17].forEach((function(n){t.ctx.beginPath(),t.ctx.moveTo(e,n),t.ctx.lineTo(e-.667,n),t.ctx.moveTo(r,n),t.ctx.lineTo(r+.667,n),t.ctx.stroke()})),this.ctx.beginPath(),this.ctx.rect(e,7,-1.2,.8),this.ctx.fill(),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.rect(r,7,1.2,.8),this.ctx.fill(),this.ctx.stroke()}};function DD(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var TD=function(t){Cc()(e,t);var n=DD(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}}]),e}(Lc);Object.assign(TD.prototype,sD);var gD=50,lD=94,ID=20.75,yD=20.75,hD=2,jD=6,xD=12,zD=12,OD=!1,ED=!1,AD=!1;function fD(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var pD=function(t){Cc()(e,t);var n=fD(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}}]),e}(Lc);Object.assign(pD.prototype,sD);var UD=50,dD=94,CD=20.75,QD=20.75,wD=2,LD=6,SD=12,kD=12,vD=!1,YD=!1,mD=!0;function RD(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var FD=function(t){Cc()(e,t);var n=RD(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}}]),e}(Lc);Object.assign(FD.prototype,sD);var bD=50,ZD=84,BD=19.75,VD=19.75,WD=2,GD=6,PD=12,JD=12,HD=!1,KD=!1,XD=!1;function qD(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var _D=function(t){Cc()(e,t);var n=qD(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}}]),e}(Lc);Object.assign(_D.prototype,sD);var $D=42,tT=74,nT=19.75,eT=19.75,rT=2,iT=6,uT=12,oT=12,MT=!1,cT=!1,NT=!1;function aT(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var sT=function(t){Cc()(e,t);var n=aT(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}}]),e}(Lc);Object.assign(sT.prototype,fs);var DT=50,TT=94,gT=21.65,lT=22.15,IT=6,yT=9,hT=12,jT=16,xT=!0,zT=!0,OT=!0;function ET(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var AT=function(t){Cc()(e,t);var n=ET(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.rect(0,0,this.courtTypeConstants.COURT_RECT_WIDTH,this.courtTypeConstants.COURT_RECT_HEIGHT),this.ctx.stroke()}}]),e}(Lc);function fT(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var pT=function(t){Cc()(e,t);var n=fT(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){var t={x:0,y:this.courtCenter.y},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke()}}]),e}(Lc);function UT(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var dT=function(t){Cc()(e,t);var n=UT(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=0,n=30,e={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:30};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t,n),this.ctx.lineTo(e.x,e.y),this.ctx.stroke()}}]),e}(Lc);function CT(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var QT=function(t){Cc()(e,t);var n=CT(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){var t=this.courtTypeConstants.END_ZONE_HEIGHT,n=String.fromCharCode(8202);this.ctx.fillStyle=this.options.lineColor,this.ctx.translate(20,t);for(var e=1;e<10;e++){var r="".concat(e<=5?e:10-e).concat(n,"0");this.ctx.translate(0,this.courtTypeConstants.END_ZONE_HEIGHT),this.ctx.save(),this.ctx.rotate(Math.PI/2),this.ctx.fillText(r,-6,0),this.ctx.translate(0,40-this.courtTypeConstants.COURT_RECT_WIDTH),this.ctx.rotate(Math.PI),this.ctx.fillText(r,-6,0),this.ctx.restore()}}}]),e}(Lc);function wT(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var LT=function(t){Cc()(e,t);var n=wT(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this,n=[3,this.courtTypeConstants.HASH_MARK_FROM_SIDELINE_DISTANCE,this.courtTypeConstants.COURT_RECT_WIDTH-this.courtTypeConstants.HASH_MARK_FROM_SIDELINE_DISTANCE-3,this.courtTypeConstants.COURT_RECT_WIDTH-3-3];this.ctx.save(),this.ctx.lineWidth=this.courtTypeConstants.COURT_LINE_WIDTH;for(var e=function(e){n.forEach((function(n){for(var r=0;r<4;r++){var i=3+3*r,u={x:n,y:e-i},o={x:n+3,y:e-i};t.ctx.beginPath(),t.ctx.moveTo(u.x,u.y),t.ctx.lineTo(o.x,o.y),t.ctx.stroke()}}))},r=this.courtTypeConstants.END_ZONE_HEIGHT+15;r<=this.courtCenter.y;r+=15)e(r);this.ctx.restore()}}]),e}(Lc);function ST(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var kT=function(t){Cc()(e,t);var n=ST(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){for(var t=this.courtTypeConstants.END_ZONE_HEIGHT;t<=this.courtCenter.y;t+=15){var n={x:0,y:t},e={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:t};this.ctx.beginPath(),this.ctx.lineWidth=t%30==0?2*this.courtTypeConstants.COURT_LINE_WIDTH:this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(n.x,n.y),this.ctx.lineTo(e.x,e.y),this.ctx.stroke()}}}]),e}(Lc),vT=.32,YT=1.5,mT=2,RT=.55,FT=!1,bT=160,ZT=360,BT=30,VT=53,WT=160,GT=360,PT=30,JT=70.916,HT=160,KT=360,XT=30,qT=60;function _T(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var $T=function(t){Cc()(e,t);var n=_T(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.setColor("#000"),this.ctx.lineWidth=4*this.courtTypeConstants.COURT_LINE_WIDTH;var t=this.courtCenter.y-this.courtTypeConstants.NEUTRAL_ZONE_LENGTH-this.courtTypeConstants.END_ZONE_LENGTH,n=(this.courtTypeConstants.COURT_RECT_WIDTH-this.courtTypeConstants.FACE_OFF_SPOTS_DISTANCE)/2,e=[{x:0,y:this.courtCenter.y},{x:0,y:t}],r=[{x:n,y:0},{x:this.courtTypeConstants.COURT_RECT_WIDTH-n,y:0}],i=[{x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y},{x:this.courtTypeConstants.COURT_RECT_WIDTH,y:t}];this.ctx.beginPath(),this.ctx.moveTo(e[0].x,e[0].y),this.ctx.lineTo(e[1].x,e[1].y),this.ctx.bezierCurveTo(0,0,10,0,r[0].x,r[0].y),this.ctx.lineTo(r[1].x,r[1].y),this.ctx.bezierCurveTo(this.courtTypeConstants.COURT_RECT_WIDTH-10,0,this.courtTypeConstants.COURT_RECT_WIDTH,0,i[1].x,i[1].y),this.ctx.lineTo(i[0].x,i[0].y),this.ctx.stroke()}}]),e}(Lc);function tg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var ng=function(t){Cc()(e,t);var n=tg(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){this.setColor(this.courtTypeConstants.LINE_COLOR_BLUE),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtCenter.y,15,0,2*Math.PI,!0),this.ctx.stroke()}}]),e}(Lc);function eg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var rg=function(t){Cc()(e,t);var n=eg(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){this.setColor(this.courtTypeConstants.LINE_COLOR_RED),this.ctx.setLineDash([2,1]),this.ctx.lineWidth=4*this.courtTypeConstants.COURT_LINE_WIDTH;var t={x:0,y:this.courtCenter.y},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y};this.ctx.beginPath(),this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke()}}]),e}(Lc);function ig(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var ug=function(t){Cc()(e,t);var n=ig(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){this.setColor(this.courtTypeConstants.LINE_COLOR_BLUE),this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtCenter.y,1,0,2*Math.PI,!0),this.ctx.fill()}}]),e}(Lc);function og(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Mg=function(t){Cc()(e,t);var n=og(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this;this.setColor(this.courtTypeConstants.LINE_COLOR_RED),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH;var n=(this.courtTypeConstants.COURT_RECT_WIDTH-this.courtTypeConstants.FACE_OFF_SPOTS_DISTANCE)/2,e=this.courtCenter.y-this.courtTypeConstants.NEUTRAL_ZONE_LENGTH-this.courtTypeConstants.END_ZONE_LENGTH+22;[{x:n,y:e},{x:this.courtTypeConstants.COURT_RECT_WIDTH-n,y:e}].forEach((function(n){t.ctx.beginPath(),t.ctx.arc(n.x,n.y,t.courtTypeConstants.FACE_OFF_SPOT_RADIUS,0,2*Math.PI,!0),t.ctx.fill(),t.ctx.beginPath(),t.ctx.arc(n.x,n.y,t.courtTypeConstants.FACE_OFF_SPOT_CIRCLE_RADIUS,0,2*Math.PI,!0),t.ctx.stroke(),[{ox:n.x-t.courtTypeConstants.FACE_OFF_SPOT_CIRCLE_RADIUS,tx:n.x-(t.courtTypeConstants.FACE_OFF_SPOT_CIRCLE_RADIUS+1)},{ox:n.x+t.courtTypeConstants.FACE_OFF_SPOT_CIRCLE_RADIUS,tx:n.x+(t.courtTypeConstants.FACE_OFF_SPOT_CIRCLE_RADIUS+1)}].forEach((function(e){[n.y-1,n.y+1].forEach((function(n){t.ctx.beginPath(),t.ctx.moveTo(e.ox,n),t.ctx.lineTo(e.tx,n),t.ctx.stroke()}))}))}))}}]),e}(Lc);function cg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Ng=function(t){Cc()(e,t);var n=cg(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.setColor(this.courtTypeConstants.LINE_COLOR_RED),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH;var t=this.courtCenter.y-this.courtTypeConstants.NEUTRAL_ZONE_LENGTH-this.courtTypeConstants.END_ZONE_LENGTH;this.ctx.beginPath(),this.ctx.moveTo(0,t),this.ctx.lineTo(this.courtTypeConstants.COURT_RECT_WIDTH,t),this.ctx.stroke()}}]),e}(Lc);function ag(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var sg=function(t){Cc()(e,t);var n=ag(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.setColor(this.courtTypeConstants.LINE_COLOR_BLUE),this.ctx.lineWidth=4*this.courtTypeConstants.COURT_LINE_WIDTH;var t={x:0,y:this.courtCenter.y-this.courtTypeConstants.NEUTRAL_ZONE_LENGTH},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y-this.courtTypeConstants.NEUTRAL_ZONE_LENGTH};this.ctx.beginPath(),this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke(),this.setColor(this.courtTypeConstants.LINE_COLOR_RED);var e=(this.courtTypeConstants.COURT_RECT_WIDTH-this.courtTypeConstants.FACE_OFF_SPOTS_DISTANCE)/2,r=this.courtCenter.y-this.courtTypeConstants.NEUTRAL_ZONE_LENGTH+5,i={x:e,y:r},u={x:this.courtTypeConstants.COURT_RECT_WIDTH-e,y:r};this.ctx.beginPath(),this.ctx.arc(i.x,i.y,this.courtTypeConstants.FACE_OFF_SPOT_RADIUS,0,2*Math.PI,!0),this.ctx.fill(),this.ctx.beginPath(),this.ctx.arc(u.x,u.y,this.courtTypeConstants.FACE_OFF_SPOT_RADIUS,0,2*Math.PI,!0),this.ctx.fill()}}]),e}(Lc);function Dg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Tg=function(t){Cc()(e,t);var n=Dg(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){this.setColor(this.courtTypeConstants.LINE_COLOR_RED),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(0,this.courtCenter.y,10,-Math.PI/2,Math.PI/2,!1),this.ctx.stroke()}}]),e}(Lc),gg=.1667,lg=1.5,Ig=2,yg=.55,hg=!0;function jg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var xg=function(t){Cc()(e,t);var n=jg(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.setColor(this.courtTypeConstants.LINE_COLOR_RED),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH;var t=this.courtCenter.y-this.courtTypeConstants.NEUTRAL_ZONE_LENGTH-this.courtTypeConstants.END_ZONE_LENGTH;this.ctx.beginPath(),this.ctx.moveTo(this.courtCenter.x-this.courtTypeConstants.GOAL_CREASE_ARC_RADIUS,t),this.ctx.lineTo(this.courtCenter.x-this.courtTypeConstants.GOAL_CREASE_ARC_RADIUS,t+this.courtTypeConstants.GOAL_CREASE_ARC_RADIUS),this.ctx.lineTo(this.courtCenter.x+this.courtTypeConstants.GOAL_CREASE_ARC_RADIUS,t+this.courtTypeConstants.GOAL_CREASE_ARC_RADIUS),this.ctx.lineTo(this.courtCenter.x+this.courtTypeConstants.GOAL_CREASE_ARC_RADIUS,t),this.ctx.stroke(),this.setColor("#000"),this.ctx.beginPath(),this.ctx.moveTo(this.courtCenter.x-this.courtTypeConstants.GOAL_CAGE_LENGTH/2,t),this.ctx.lineTo(this.courtCenter.x-this.courtTypeConstants.GOAL_CAGE_LENGTH/2,t-this.courtTypeConstants.GOAL_CAGE_DEPTH),this.ctx.lineTo(this.courtCenter.x+this.courtTypeConstants.GOAL_CAGE_LENGTH/2,t-this.courtTypeConstants.GOAL_CAGE_DEPTH),this.ctx.lineTo(this.courtCenter.x+this.courtTypeConstants.GOAL_CAGE_LENGTH/2,t),this.ctx.stroke()}}]),e}(Lc),zg=85,Og=200,Eg="#C8102E",Ag="#0032A0",fg=64,pg=25,Ug=44,dg=.75,Cg=15,Qg=6,wg=3,Lg=4;function Sg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var kg=function(t){Cc()(e,t);var n=Sg(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.setColor(this.courtTypeConstants.LINE_COLOR_RED),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH;var t=this.courtCenter.y-this.courtTypeConstants.NEUTRAL_ZONE_LENGTH-this.courtTypeConstants.END_ZONE_LENGTH;this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,t,this.courtTypeConstants.GOAL_CREASE_ARC_RADIUS,0,Math.PI,!1),this.ctx.stroke(),this.setColor("#000"),this.ctx.beginPath(),this.ctx.moveTo(this.courtCenter.x-this.courtTypeConstants.GOAL_CAGE_LENGTH/2,t),this.ctx.lineTo(this.courtCenter.x-this.courtTypeConstants.GOAL_CAGE_LENGTH/2,t-this.courtTypeConstants.GOAL_CAGE_DEPTH),this.ctx.lineTo(this.courtCenter.x+this.courtTypeConstants.GOAL_CAGE_LENGTH/2,t-this.courtTypeConstants.GOAL_CAGE_DEPTH),this.ctx.lineTo(this.courtCenter.x+this.courtTypeConstants.GOAL_CAGE_LENGTH/2,t),this.ctx.stroke()}}]),e}(Lc),vg=100,Yg=200,mg="#C8102E",Rg="#0032A0",Fg=58,bg=29,Zg=44,Bg=.75,Vg=15,Wg=6,Gg=3,Pg=5.8;function Jg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Hg=function(t){Cc()(e,t);var n=Jg(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.rect(0,0,this.courtTypeConstants.COURT_RECT_WIDTH,this.courtTypeConstants.COURT_RECT_HEIGHT),this.ctx.stroke()}}]),e}(Lc);function Kg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Xg=function(t){Cc()(e,t);var n=Kg(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:0,y:this.courtCenter.y-this.courtTypeConstants.RESTRAINING_CENTER_OFFSET_Y},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y-this.courtTypeConstants.RESTRAINING_CENTER_OFFSET_Y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke()}}]),e}(Lc),qg=.1667,_g=1.5,$g=1,tl=.33,nl=!0;function el(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var rl=function(t){Cc()(e,t);var n=el(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){var t={x:0,y:this.courtCenter.y},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke();var e=[{x:this.courtCenter.x-1,y:this.courtCenter.y-1},{x:this.courtCenter.x+1,y:this.courtCenter.y-1},{x:this.courtCenter.x+1,y:this.courtCenter.y+1},{x:this.courtCenter.x-1,y:this.courtCenter.y+1}];this.ctx.beginPath(),this.ctx.moveTo(e[0].x,e[0].y),this.ctx.lineTo(e[2].x,e[2].y),this.ctx.moveTo(e[1].x,e[1].y),this.ctx.lineTo(e[3].x,e[3].y),this.ctx.stroke()}}]),e}(Lc);function il(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var ul=function(t){Cc()(e,t);var n=il(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtTypeConstants.WING_OFFSET_X,y:0},n={x:this.courtTypeConstants.WING_OFFSET_X,y:this.courtCenter.y-this.courtTypeConstants.RESTRAINING_CENTER_OFFSET_Y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke();var e={x:this.courtTypeConstants.COURT_RECT_WIDTH-this.courtTypeConstants.WING_OFFSET_X,y:0},r={x:this.courtTypeConstants.COURT_RECT_WIDTH-this.courtTypeConstants.WING_OFFSET_X,y:this.courtCenter.y-this.courtTypeConstants.RESTRAINING_CENTER_OFFSET_Y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(r.x,r.y),this.ctx.stroke();var i={x:this.courtCenter.x,y:15};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(i.x-1,i.y),this.ctx.lineTo(i.x+1,i.y),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.arc(i.x,i.y,3,0,2*Math.PI,!0),this.ctx.stroke()}}]),e}(Lc);function ol(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Ml=function(t){Cc()(e,t);var n=ol(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtTypeConstants.WING_OFFSET_X,y:this.courtCenter.y-10},n={x:this.courtTypeConstants.WING_OFFSET_X,y:this.courtCenter.y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke();var e={x:this.courtTypeConstants.COURT_RECT_WIDTH-this.courtTypeConstants.WING_OFFSET_X,y:this.courtCenter.y-10},r={x:this.courtTypeConstants.COURT_RECT_WIDTH-this.courtTypeConstants.WING_OFFSET_X,y:this.courtCenter.y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(r.x,r.y),this.ctx.stroke()}}]),e}(Lc),cl=60,Nl=110,al=10,sl=20;function Dl(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Tl=function(t){Cc()(e,t);var n=Dl(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){var t={x:this.courtCenter.x-1.5,y:this.courtCenter.y},n={x:this.courtCenter.x+1.5,y:this.courtCenter.y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtCenter.y,10,0,2*Math.PI,!0),this.ctx.stroke()}}]),e}(Lc);function gl(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var ll=function(t){Cc()(e,t);var n=gl(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this,n={x:this.courtCenter.x,y:this.courtCenter.y-this.courtTypeConstants.RESTRAINING_CENTER_OFFSET_Y-30};this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(n.x,n.y,2.84,0,2*Math.PI,!1),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.arc(n.x,n.y,15.97,0,Math.PI,!1),this.ctx.stroke();var e={x:n.x-15.97,y:n.y},r={x:n.x-2.84,y:n.y},i={x:n.x+15.97,y:n.y},u={x:n.x+2.84,y:n.y};this.ctx.beginPath(),this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(r.x,r.y),this.ctx.moveTo(i.x,i.y),this.ctx.lineTo(u.x,u.y),this.ctx.stroke();var o={x:n.x,y:n.y-2.84},M=Math.PI/4,c=Math.PI/2+Math.PI/4;this.ctx.beginPath(),this.ctx.arc(o.x,o.y,14.43,M,c,!1),this.ctx.stroke();var N=Il(o,14.43,c),a=Il(o,14.43,M),s=n.x-2.84,D=n.x+2.84;this.ctx.beginPath(),this.ctx.moveTo(N.x,N.y),this.ctx.lineTo(s,n.y),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(a.x,a.y),this.ctx.lineTo(D,n.y),this.ctx.stroke();var T={x:s-8.75,y:n.y},g={x:D+8.75,y:n.y};this.ctx.beginPath(),this.ctx.moveTo(T.x,T.y),this.ctx.lineTo(T.x,T.y+1),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(g.x,g.y),this.ctx.lineTo(g.x,g.y+1),this.ctx.stroke();var l=Il(o,14.43,Math.PI/2);this.ctx.beginPath(),this.ctx.moveTo(l.x,l.y-1),this.ctx.lineTo(l.x,l.y+1),this.ctx.stroke();for(var I=function(n){[1,-1].forEach((function(e){var r=Math.PI/2+Math.PI/10*e*n,i=Il(o,14.43,r);t.ctx.save(),t.ctx.translate(i.x,i.y),t.ctx.rotate(Math.PI/10*e*n),t.ctx.beginPath(),t.ctx.moveTo(0,-1),t.ctx.lineTo(0,1),t.ctx.stroke(),t.ctx.restore()}))},y=1;y<=3;y++)I(y);var h={x:T.x,y:T.y-5},j={x:g.x,y:g.y-5};this.ctx.beginPath(),this.ctx.arc(h.x,h.y,.5,0,2*Math.PI,!1),this.ctx.arc(j.x,j.y,.5,0,2*Math.PI,!1),this.ctx.fill();var x={x:n.x-1,y:n.y},z={x:n.x+1,y:n.y},O={x:n.x,y:n.y-1};this.ctx.beginPath(),this.ctx.moveTo(x.x,x.y),this.ctx.lineTo(z.x,z.y),this.ctx.lineTo(O.x,O.y),this.ctx.closePath(),this.ctx.stroke()}}]),e}(Lc);function Il(t,n,e){return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}}var yl=60,hl=130,jl=20;function xl(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var zl=function(t){Cc()(e,t);var n=xl(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH;var t=[{x:0,y:this.courtCenter.y},{x:0,y:this.courtTypeConstants.GOAL_LINE_Y}],n=[{x:this.courtTypeConstants.TOP_SIDE_CURVE_OFFSET,y:0},{x:this.courtTypeConstants.COURT_RECT_WIDTH-this.courtTypeConstants.TOP_SIDE_CURVE_OFFSET,y:0}],e=[{x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y},{x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtTypeConstants.GOAL_LINE_Y}];this.ctx.beginPath(),this.ctx.moveTo(t[0].x,t[0].y),this.ctx.lineTo(t[1].x,t[1].y),this.ctx.bezierCurveTo(0,0,10,0,n[0].x,n[0].y),this.ctx.lineTo(n[1].x,n[1].y),this.ctx.bezierCurveTo(this.courtTypeConstants.COURT_RECT_WIDTH-10,0,this.courtTypeConstants.COURT_RECT_WIDTH,0,e[1].x,e[1].y),this.ctx.lineTo(e[0].x,e[0].y),this.ctx.stroke()}}]),e}(Lc),Ol=.1667,El=1.5,Al=1,fl=.33,pl=!0;function Ul(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var dl=function(t){Cc()(e,t);var n=Ul(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtCenter.y,11,0,2*Math.PI,!0),this.ctx.stroke(),this.ctx.setLineDash([.8,.5]),this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtCenter.y,1.41667,0,2*Math.PI,!0),this.ctx.stroke()}}]),e}(Lc);function Cl(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Ql=function(t){Cc()(e,t);var n=Cl(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){var t={x:0,y:this.courtCenter.y},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(this.courtTypeConstants.COURT_RECT_WIDTH,this.courtCenter.y-this.courtTypeConstants.RESTRAINING_LINE_OFFSET_Y+5),this.ctx.lineTo(this.courtTypeConstants.COURT_RECT_WIDTH-5,this.courtCenter.y-this.courtTypeConstants.RESTRAINING_LINE_OFFSET_Y+5),this.ctx.lineTo(this.courtTypeConstants.COURT_RECT_WIDTH-5,this.courtCenter.y+this.courtTypeConstants.RESTRAINING_LINE_OFFSET_Y-5),this.ctx.lineTo(this.courtTypeConstants.COURT_RECT_WIDTH,this.courtCenter.y+this.courtTypeConstants.RESTRAINING_LINE_OFFSET_Y-5),this.ctx.stroke()}}]),e}(Lc);function wl(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Ll=function(t){Cc()(e,t);var n=wl(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:0,y:this.courtCenter.y-this.courtTypeConstants.RESTRAINING_LINE_OFFSET_Y},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y-this.courtTypeConstants.RESTRAINING_LINE_OFFSET_Y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke();var e=this.courtCenter.y-this.courtTypeConstants.RESTRAINING_LINE_OFFSET_Y/2;this.ctx.beginPath(),this.ctx.moveTo(this.courtTypeConstants.COURT_RECT_WIDTH,e-12),this.ctx.lineTo(this.courtTypeConstants.COURT_RECT_WIDTH+5,e-12),this.ctx.lineTo(this.courtTypeConstants.COURT_RECT_WIDTH+5,e+12),this.ctx.lineTo(this.courtTypeConstants.COURT_RECT_WIDTH,e+12),this.ctx.stroke()}}]),e}(Lc);function Sl(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var kl=function(t){Cc()(e,t);var n=Sl(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:this.courtTypeConstants.GOAL_LINE_Y};this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.moveTo(t.x-9.25,t.y),this.ctx.lineTo(t.x+9.25,t.y),this.ctx.stroke();var n=Math.PI/4.5;this.ctx.beginPath(),this.ctx.arc(t.x,t.y,9.25,-n,Math.PI+n,!1),this.ctx.stroke();this.ctx.beginPath(),this.ctx.moveTo(t.x-7.25,t.y-6),this.ctx.lineTo(t.x+7.25,t.y-6),this.ctx.stroke();var e={x:t.x-2.375,y:t.y},r={x:t.x+2.375,y:t.y},i={x:t.x,y:t.y-2.375};this.ctx.beginPath(),this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(r.x,r.y),this.ctx.lineTo(i.x,i.y),this.ctx.closePath(),this.ctx.stroke()}}]),e}(Lc);function vl(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Yl=function(t){Cc()(e,t);var n=vl(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(0,this.courtCenter.y,10,Math.PI/2,-Math.PI/2,!0),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(0,this.courtCenter.y-10),this.ctx.bezierCurveTo(0,this.courtCenter.y-10,-2.5,this.courtCenter.y-10,-5,this.courtCenter.y-10),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(0,this.courtCenter.y+10),this.ctx.bezierCurveTo(0,this.courtCenter.y+10,-2.5,this.courtCenter.y+10,-5,this.courtCenter.y+10),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(0,this.courtCenter.y-12),this.ctx.lineTo(-5,this.courtCenter.y-12),this.ctx.lineTo(-5,this.courtCenter.y+12),this.ctx.lineTo(0,this.courtCenter.y+12),this.ctx.stroke()}}]),e}(Lc),ml=85,Rl=180,Fl=12,bl=12,Zl=42.5;function Bl(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Vl=2,Wl=function(t){Cc()(e,t);var n=Bl(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){var t=this;this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtCenter.y,.5,0,2*Math.PI,!0),this.ctx.fill(),this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtCenter.y,Vl,0,2*Math.PI,!0),this.ctx.stroke(),[Vl,-Vl].forEach((function(n){t.ctx.beginPath(),t.ctx.moveTo(t.courtCenter.x+n,t.courtCenter.y-3),t.ctx.lineTo(t.courtCenter.x+n,t.courtCenter.y+3),t.ctx.stroke()}))}}]),e}(Lc);function Gl(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Pl=function(t){Cc()(e,t);var n=Gl(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:0,y:this.courtCenter.y-this.courtTypeConstants.RESTRAINING_LINE_OFFSET_Y},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y-this.courtTypeConstants.RESTRAINING_LINE_OFFSET_Y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke();var e=this.courtCenter.y-5;this.ctx.beginPath(),this.ctx.moveTo(this.courtTypeConstants.COURT_RECT_WIDTH,e),this.ctx.lineTo(this.courtTypeConstants.COURT_RECT_WIDTH+5,e),this.ctx.lineTo(this.courtTypeConstants.COURT_RECT_WIDTH+5,e-30),this.ctx.lineTo(this.courtTypeConstants.COURT_RECT_WIDTH,e-30),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(this.courtTypeConstants.COURT_RECT_WIDTH-4,this.courtCenter.y),this.ctx.lineTo(this.courtTypeConstants.COURT_RECT_WIDTH-4,this.courtCenter.y-30-5+.5),this.ctx.lineTo(this.courtTypeConstants.COURT_RECT_WIDTH,this.courtCenter.y-30-5+.5),this.ctx.stroke();var r=this.courtCenter.y-this.courtTypeConstants.RESTRAINING_LINE_OFFSET_Y;this.ctx.beginPath(),this.ctx.moveTo(0,r),this.ctx.lineTo(-5,r),this.ctx.lineTo(-5,r-12),this.ctx.lineTo(0,r-12),this.ctx.stroke()}}]),e}(Lc);function Jl(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Hl=function(t){Cc()(e,t);var n=Jl(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:this.courtTypeConstants.GOAL_LINE_Y};this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.moveTo(t.x-9.25,t.y),this.ctx.lineTo(t.x+9.25,t.y),this.ctx.stroke();var n=Math.PI/4.5;this.ctx.beginPath(),this.ctx.arc(t.x,t.y,9.25,-n,Math.PI+n,!1),this.ctx.stroke(),this.ctx.save(),this.ctx.setLineDash([1.2,.4]),this.ctx.beginPath(),this.ctx.arc(t.x,t.y,24,0,Math.PI,!1),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(t.x-9.25,t.y),this.ctx.lineTo(t.x-24,t.y),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(t.x+9.25,t.y),this.ctx.lineTo(t.x+24,t.y),this.ctx.stroke(),this.ctx.restore();this.ctx.beginPath(),this.ctx.moveTo(t.x-7.25,t.y-6),this.ctx.lineTo(t.x+7.25,t.y-6),this.ctx.stroke();var e={x:t.x-2.375,y:t.y},r={x:t.x+2.375,y:t.y},i={x:t.x,y:t.y-2.375};this.ctx.beginPath(),this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(r.x,r.y),this.ctx.lineTo(i.x,i.y),this.ctx.closePath(),this.ctx.stroke()}}]),e}(Lc);function Kl(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Xl=function(t){Cc()(e,t);var n=Kl(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(0,this.courtCenter.y,10,Math.PI/2,-Math.PI/2,!0),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(0,this.courtCenter.y-10),this.ctx.lineTo(-5,this.courtCenter.y-10),this.ctx.lineTo(-5,this.courtCenter.y+10),this.ctx.lineTo(0,this.courtCenter.y+10),this.ctx.stroke()}}]),e}(Lc),ql=85,_l=180,$l=12,tI=12,nI=11,eI="Concrete";function rI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var iI=function(t){Cc()(e,t);var n=rI(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.rect(0,0,this.courtTypeConstants.COURT_RECT_WIDTH,this.courtTypeConstants.COURT_RECT_HEIGHT),this.ctx.stroke()}}]),e}(Lc);function uI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var oI=function(t){Cc()(e,t);var n=uI(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtCenter.y,this.courtTypeConstants.CENTER_CIRCLE_RADIUS,0,2*Math.PI,!0),this.ctx.stroke()}}]),e}(Lc);function MI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var cI=function(t){Cc()(e,t);var n=MI(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){var t={x:0,y:this.courtCenter.y},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke()}}]),e}(Lc);function NI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var aI=function(t){Cc()(e,t);var n=NI(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtCenter.y,.25,0,2*Math.PI,!0),this.ctx.fill()}}]),e}(Lc);function sI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var DI=function(t){Cc()(e,t);var n=sI(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=0,n=0,e={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:0};this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(t,n,1,0,Math.PI/2,!1),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.arc(e.x,e.y,1,Math.PI,Math.PI/2,!0),this.ctx.stroke()}}]),e}(Lc);function TI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var gI=function(t){Cc()(e,t);var n=TI(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtTypeConstants.PENALTY_SPOT_OFFSET_Y,this.courtTypeConstants.CENTER_CIRCLE_RADIUS,Math.PI/5,Math.PI-Math.PI/5,!1),this.ctx.stroke()}}]),e}(Lc);function lI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var II=function(t){Cc()(e,t);var n=lI(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.rect(this.courtCenter.x-this.courtTypeConstants.PENALTY_AREA.width/2,0,this.courtTypeConstants.PENALTY_AREA.width,this.courtTypeConstants.PENALTY_AREA.height),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.rect(this.courtCenter.x-this.courtTypeConstants.GOAL_AREA.width/2,0,this.courtTypeConstants.GOAL_AREA.width,this.courtTypeConstants.GOAL_AREA.height),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.rect(this.courtCenter.x-this.courtTypeConstants.GOAL.width/2,-this.courtTypeConstants.GOAL.height,this.courtTypeConstants.GOAL.width,this.courtTypeConstants.GOAL.height),this.ctx.stroke()}}]),e}(Lc);function yI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var hI=function(t){Cc()(e,t);var n=yI(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtTypeConstants.PENALTY_SPOT_OFFSET_Y,.25,0,2*Math.PI,!1),this.ctx.fill()}}]),e}(Lc),jI=.1667,xI=1.5,zI=1,OI=.33,EI=!0,AI=60,fI=110,pI=10,UI=12,dI={width:44,height:18},CI={width:8,height:2.66},QI={width:20,height:6},wI=60,LI=110,SI=10,kI=12,vI={width:44,height:18},YI={width:8,height:2.66},mI={width:20,height:6};function RI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var FI=function(t){Cc()(e,t);var n=RI(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){var t=[{x:this.courtCenter.x-1,y:this.courtCenter.y-1},{x:this.courtCenter.x+1,y:this.courtCenter.y-1},{x:this.courtCenter.x+1,y:this.courtCenter.y+1},{x:this.courtCenter.x-1,y:this.courtCenter.y+1}];this.ctx.beginPath(),this.ctx.moveTo(t[0].x,t[0].y),this.ctx.lineTo(t[2].x,t[2].y),this.ctx.moveTo(t[1].x,t[1].y),this.ctx.lineTo(t[3].x,t[3].y),this.ctx.stroke()}}]),e}(Lc);function bI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var ZI=function(t){Cc()(e,t);var n=bI(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=11,n=0,e={x:this.courtTypeConstants.COURT_RECT_WIDTH-11,y:0};this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.moveTo(t,n),this.ctx.lineTo(t,n-1),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(e.x,e.y-1),this.ctx.stroke()}}]),e}(Lc);function BI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var VI=function(t){Cc()(e,t);var n=BI(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.moveTo(this.courtCenter.x-.33,12),this.ctx.lineTo(this.courtCenter.x+.33,12),this.ctx.stroke()}}]),e}(Lc),WI=70,GI=115,PI=10,JI=12,HI={width:44,height:18},KI={width:8,height:2.66},XI={width:20,height:6};function qI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var _I=function(t){Cc()(e,t);var n=qI(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=11,n=0,e={x:this.courtTypeConstants.COURT_RECT_WIDTH-11,y:0};this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.moveTo(t,n),this.ctx.lineTo(t,n-1),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(e.x,e.y-1),this.ctx.stroke()}}]),e}(Lc);function $I(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var ty=function(t){Cc()(e,t);var n=$I(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.moveTo(this.courtCenter.x-.33,12),this.ctx.lineTo(this.courtCenter.x+.33,12),this.ctx.stroke()}}]),e}(Lc),ny=60,ey=100,ry=10,iy=12,uy={width:44,height:18},oy={width:8,height:2.66},My={width:20,height:6};function cy(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Ny=function(t){Cc()(e,t);var n=cy(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH;var t={x:0,y:this.courtTypeConstants.COURT_RECT_HEIGHT/3},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtTypeConstants.COURT_RECT_HEIGHT/3};this.ctx.beginPath(),this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke()}}]),e}(Lc);function ay(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var sy=function(t){Cc()(e,t);var n=ay(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtTypeConstants.PENALTY_SPOT_OFFSET_Y,this.courtTypeConstants.CENTER_CIRCLE_RADIUS,Math.PI/12,Math.PI-Math.PI/12,!1),this.ctx.stroke()}}]),e}(Lc),Dy=45,Ty=65,gy=8,ly=10,Iy={width:24,height:12},yy={width:6,height:2},hy={width:8,height:4};function jy(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var xy=function(t){Cc()(e,t);var n=jy(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtTypeConstants.PENALTY_SPOT_OFFSET_Y,this.courtTypeConstants.CENTER_CIRCLE_RADIUS,Math.PI/6,Math.PI-Math.PI/6,!1),this.ctx.stroke()}}]),e}(Lc),zy=55,Oy=80,Ey=8,Ay=10,fy={width:36,height:14},py={width:6.16,height:2.16},Uy={width:12,height:5};function dy(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Cy=function(t){Cc()(e,t);var n=dy(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:0,y:this.courtCenter.y-9.8},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y-9.8};this.ctx.beginPath(),this.ctx.lineWidth=this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke();for(var e=.574,r=0;r<5;r++)this.ctx.beginPath(),this.ctx.moveTo(t.x-e,t.y),this.ctx.lineTo(t.x-e-.574,n.y),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(n.x+e,t.y),this.ctx.lineTo(n.x+e+.574,n.y),this.ctx.stroke(),e+=1.148}}]),e}(Lc);function Qy(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var wy=function(t){Cc()(e,t);var n=Qy(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.rect(0,0,this.courtTypeConstants.COURT_RECT_WIDTH,this.courtTypeConstants.COURT_RECT_HEIGHT),this.ctx.stroke()}}]),e}(Lc);function Ly(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Sy=function(t){Cc()(e,t);var n=Ly(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLogic",value:function(){var t={x:0,y:this.courtCenter.y},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke(),this.ctx.beginPath()}}]),e}(Lc);function ky(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var vy,Yy,my,Ry,Fy,by,Zy,By,Vy,Wy,Gy,Py=function(t){Cc()(e,t);var n=ky(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this.courtTypeConstants.COURT_RECT_WIDTH;this.ctx.beginPath(),this.ctx.moveTo(0,-.574),this.ctx.lineTo(0,-1.148),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(t,-.574),this.ctx.lineTo(t,-1.148),this.ctx.stroke()}}]),e}(Lc),Jy=.1667,Hy=1.5,Ky=1,Xy=.33,qy=!0,_y=29.5,$y=59.1,th=(vy={},Qt()(vy,jn,o),Qt()(vy,xn,a),Qt()(vy,Dn,I),Qt()(vy,gn,k),Qt()(vy,hn,F),Qt()(vy,ln,G),Qt()(vy,In,q),Qt()(vy,yn,rt),Qt()(vy,Tn,lt),vy),nh=(By={},Qt()(By,jn,Qt()({},Pn,N)),Qt()(By,xn,(Yy={},Qt()(Yy,Jn,T),Qt()(Yy,Hn,l),Yy)),Qt()(By,Dn,(my={},Qt()(my,zn,h),Qt()(my,On,x),Qt()(my,En,O),Qt()(my,An,A),Qt()(my,fn,p),Qt()(my,pn,d),Qt()(my,Un,Q),Qt()(my,dn,L),my)),Qt()(By,gn,{}),Qt()(By,hn,(Ry={},Qt()(Ry,Wn,Z),Qt()(Ry,Gn,V),Ry)),Qt()(By,ln,(Fy={},Qt()(Fy,kn,J),Qt()(Fy,vn,K),Fy)),Qt()(By,In,(by={},Qt()(by,Yn,$),Qt()(by,mn,nt),by)),Qt()(By,yn,(Zy={},Qt()(Zy,Fn,Mt),Qt()(Zy,bn,Nt),Qt()(Zy,Zn,st),Qt()(Zy,Bn,Tt),Zy)),Qt()(By,Tn,{}),By),eh=(Vy={},Qt()(Vy,jn,M),Qt()(Vy,xn,s),Qt()(Vy,Dn,y),Qt()(Vy,gn,v),Qt()(Vy,hn,b),Qt()(Vy,ln,P),Qt()(Vy,In,_),Qt()(Vy,yn,it),Qt()(Vy,Tn,It),Vy),rh=(Wy={},Qt()(Wy,Pn,c),Qt()(Wy,Jn,D),Qt()(Wy,Hn,g),Qt()(Wy,zn,j),Qt()(Wy,On,z),Qt()(Wy,En,E),Qt()(Wy,An,f),Qt()(Wy,fn,U),Qt()(Wy,pn,C),Qt()(Wy,Un,w),Qt()(Wy,dn,S),Qt()(Wy,Cn,R),Qt()(Wy,Qn,m),Qt()(Wy,Ln,Y),Qt()(Wy,wn,Y),Qt()(Wy,Wn,B),Qt()(Wy,Gn,W),Qt()(Wy,kn,H),Qt()(Wy,vn,X),Qt()(Wy,Yn,tt),Qt()(Wy,mn,et),Qt()(Wy,Rn,ot),Qt()(Wy,Fn,ct),Qt()(Wy,bn,at),Qt()(Wy,Zn,Dt),Qt()(Wy,Bn,gt),Qt()(Wy,Vn,ut),Qt()(Wy,Sn,yt),Wy),ih=(Gy={},Qt()(Gy,jn,{courtTypes:[Pn]}),Qt()(Gy,xn,{courtTypes:[Jn,Hn]}),Qt()(Gy,Dn,{courtTypes:[zn,On,En,An,fn,pn,Un,dn]}),Qt()(Gy,gn,{courtTypes:[wn,Cn,Qn]}),Qt()(Gy,hn,{courtTypes:[Wn,Gn]}),Qt()(Gy,ln,{courtTypes:[kn,vn]}),Qt()(Gy,In,{courtTypes:[Yn,mn]}),Qt()(Gy,yn,{courtTypes:[Rn,Fn,bn,Zn,Bn,Vn]}),Qt()(Gy,Tn,{courtTypes:[Sn]}),Gy);function uh(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,r)}return e}var oh=function(){function t(n,e,r){pt()(this,t),this.ctx=n,this.playData=e,this.options=r}return dt()(t,[{key:"disableMirrorMode",value:function(){this.ctx.setTransform(1,0,0,1,0,0),this.ctx.scale(this.options.scale,this.options.scale),this.ctx.translate(-this.playData.court.courtRect.origin.x,-this.playData.court.courtRect.origin.y)}},{key:"courtTypeConstants",get:function(){if(!eh[this.playData.sport])throw new Error("unknown sport type constants");if(!rh[this.playData.court.type])throw new Error("unknown court type constants");return function(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?uh(Object(e),!0).forEach((function(n){Qt()(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):uh(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}({},eh[this.playData.sport],{},rh[this.playData.court.type])}}]),t}();function Mh(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,r)}return e}function ch(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Nh=function(t){Cc()(e,t);var n=ch(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"apply",value:function(){var t=this;this.init(),this.ctx.save(),this.ctx.lineWidth=this.courtTypeConstants.COURT_LINE_WIDTH,this.setColor(),Object.values(this.courtTypeLayers).forEach((function(n){new n(t).apply()})),this.ctx.restore()}},{key:"init",value:function(){this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.setBackground(),this.setWatermark(),this.ctx.restore()}},{key:"setColor",value:function(){var t=this.options.lineColor||"#fff";this.ctx.strokeStyle=t,this.ctx.fillStyle=t}},{key:"setBackground",value:function(){var t;t=this.background,void 0!==(ye.backgroundOptions||{})[t]&&this.staticData.backgroundOptions&&this.staticData.backgroundOptions[this.background]?(this.ctx.fillStyle=this.ctx.createPattern(this.staticData.backgroundOptions[this.background],"repeat"),this.ctx.fillRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height)):0===this.background.indexOf("#")&&(this.ctx.save(),this.ctx.fillStyle=this.background,this.ctx.fillRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore())}},{key:"setWatermark",value:function(){var t=this.options.watermark?this.staticData.watermark[this.options.watermark]:null;if(t){var n=t.width/t.height,e=this.frameWidth/5,r={width:e,height:e*t.height/t.width};n<1&&(r.width=e*t.width/t.height,r.height=e);var i=this.playData.court.courtRect.size.height>this.courtTypeConstants.COURT_RECT_HEIGHT?Math.abs(this.playData.court.courtRect.origin.y):0,u=(1+Math.abs(this.playData.court.courtRect.origin.x))*this.scale,o=(this.playData.court.courtRect.size.height-i-1)*this.scale-r.height;this.ctx.drawImage(t,0,0,t.width,t.height,u,o,r.width,r.height)}}},{key:"frameWidth",get:function(){return this.options.width}},{key:"scale",get:function(){return this.options.scale}},{key:"staticData",get:function(){return this.options.staticData}},{key:"courtTypeLayers",get:function(){if(!th[this.playData.sport])throw new Error("unknown sport type layer");return function(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?Mh(Object(e),!0).forEach((function(n){Qt()(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Mh(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}({},th[this.playData.sport],{},(nh[this.playData.sport]||{})[this.playData.court.type]||{})}},{key:"background",get:function(){return this.options.background||this.courtTypeConstants.BACKGROUND||this.playData.sport}}]),e}(oh),ah=e(11),sh=e.n(ah),Dh={drawLineFromControlPoints:function(){var t=this;this.ctx.save(),this.setLineOptions(),this.ctx.lineJoin="round",this.getProcessedLinePaths().forEach((function(n){t.ctx.save(),n.alpha&&t.setColor(n.alpha),t.ctx.beginPath();var e=n.controlPoints;t.ctx.moveTo(e[0].x,e[0].y),2===e.length&&("DRIBBLE"===(t.line||t.shape||{}).type&&(t.ctx.lineCap="round"),t.ctx.lineTo(e[1].x,e[1].y)),3===e.length&&t.ctx.quadraticCurveTo(e[1].x,e[1].y,e[2].x,e[2].y),4===e.length&&t.ctx.bezierCurveTo(e[1].x,e[1].y,e[2].x,e[2].y,e[3].x,e[3].y),t.ctx.stroke(),t.ctx.restore()})),this.ctx.restore()},drawArrowLineCap:function(t){var n=t||this.arrowTipPoint();this.ctx.save();var e=this.angleBetweenLastTwoPoints(),r=n,i={x:r.x-1.4/1.3,y:r.y},u={x:r.x-1.4-1.4/6,y:r.y-.7},o={x:r.x-1.4-1.4/6,y:r.y+.7};this.ctx.beginPath(),this.ctx.translate(r.x,r.y),this.ctx.rotate(e),this.ctx.translate(-r.x,-r.y),this.ctx.moveTo(i.x,i.y),this.ctx.lineTo(u.x,u.y),this.ctx.lineTo(r.x,r.y),this.ctx.lineTo(o.x,o.y),this.ctx.lineTo(i.x,i.y),this.ctx.fill(),this.ctx.stroke(),this.ctx.restore()},drawPerpendicularLineCap:function(){this.drawPerpendicularLineAtCourtPoint(this.arrowTipPoint(),this.angleBetweenLastTwoPoints())},drawPerpendicularLineAtCourtPoint:function(t,n){this.ctx.save();var e={x:t.x,y:t.y-1.5},r={x:t.x,y:t.y+1.5};this.ctx.beginPath(),this.ctx.translate(t.x,t.y),this.ctx.rotate(n),this.ctx.translate(-t.x,-t.y),this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(r.x,r.y),this.ctx.fill(),this.ctx.stroke(),this.ctx.restore()},handOffLineCap:function(t){var n=this;this.ctx.save(),t.forEach((function(t){var e=t.controlPoints,r=n.calcMidPoint(e[0],e[e.length-1]),i=n.angleBetweenLastTwoPoints(),u=.5*Math.cos(i),o=.5*Math.sin(i),M={x:r.x+u,y:r.y+o},c={x:r.x-u,y:r.y-o};n.drawPerpendicularLineAtCourtPoint(M,i),n.drawPerpendicularLineAtCourtPoint(c,i),n.ctx.stroke()})),this.ctx.restore()},calcMidPoint:function(t,n){return{x:t.x+(n.x-t.x)/2,y:t.y+(n.y-t.y)/2}},angleBetweenLastTwoPoints:function(){var t=Ee()(this.getProcessedLinePaths()).pop().controlPoints,n=t[t.length-1],e=t[t.length-2];return this.angleBetweenTwoPoints(e,n)},angleBetweenTwoPoints:function(t,n){var e=n.x-t.x,r=n.y-t.y;return Math.atan2(r,e)},arrowTipPoint:function(){var t=Ee()(this.getProcessedLinePaths()).pop().controlPoints;return t[t.length-1]},setLineOptions:function(){}};function Th(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,r)}return e}function gh(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?Th(Object(e),!0).forEach((function(n){Qt()(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Th(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}function lh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Ih=function(t){Cc()(e,t);var n=lh(e);function e(t,r){var i;return pt()(this,e),(i=n.call(this,t)).line=r,Qt()(sh()(i),"lineWidth",void 0),Qt()(sh()(i),"debugMasking",void 0),Qt()(sh()(i),"startMaskSettings",void 0),Qt()(sh()(i),"endMaskSettings",void 0),i.lineWidth=t.lineWidth,i.debugMasking=!1,i.startMaskSettings=null,i.endMaskSettings=null,i}return dt()(e,[{key:"drawLineFromControlPoints",value:function(){}},{key:"drawArrowLineCap",value:function(t){}},{key:"handOffLineCap",value:function(t){}},{key:"drawPerpendicularLineCap",value:function(){}},{key:"angleBetweenLastTwoPoints",value:function(){return 0}}]),dt()(e,[{key:"drawLogic",value:function(){!this.options.animationGlobalProgress&&this.courtTypeConstants.LINE_MASKING&&(this.setLineMasking(),this.applyMasking()),this.setColor(),this.drawLineFromControlPoints(),this.drawLineCap()}},{key:"setColor",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=!1;if(this.options.position){var e=this.line.originalData,r=e.playerPositionOrigin,i=e.playerPositionTerminus;r!==this.options.position&&i!==this.options.position||(n=!0)}(this.options.linesHighlightedIds||[]).includes(this.line.id)&&(n=!0);var u=this.line.color,o=u.alpha,M=u.blue,c=u.green,N=u.red,a=n?0:Math.ceil(255*N),s=n?0:Math.ceil(255*c),D=n?255:Math.ceil(255*M),T="rgba(".concat(a,", ").concat(s,", ").concat(D,", ").concat(t||o,")");this.ctx.fillStyle=T,this.ctx.strokeStyle=T}},{key:"getProcessedLinePaths",value:function(){return this.line.getLineParts()}},{key:"applyMasking",value:function(){var t=this;this.line.getLineParts().forEach((function(n,e){var r=n.controlPoints;t.startMaskSettings&&(r=Ic(r,t.startMaskSettings.radius,t.startMaskSettings.centerPoint),t.line.setLinePartsAdjustedAtIndex(e,gh({},n,{controlPoints:r}))),t.endMaskSettings&&(r=Ic(r,null,null,t.endMaskSettings.radius,t.endMaskSettings.centerPoint),t.line.setLinePartsAdjustedAtIndex(e,gh({},n,{controlPoints:r})))}))}},{key:"setLineMasking",value:function(){if(this.line.playerPositionOrigin){var t=this.line.playerPositionOrigin,n=this.line.playerLineSequence;if(0===n){var e=this.playData.players.find((function(n){return n.position===t}));if(e){var r=e.possession?1.5:1;"HANDOFF"!==this.line.type||e.possession||(r=.7),this.startMaskSettings={centerPoint:e.location,radius:r}}}else if(t){var i=this.playData.lines.filter((function(e){return e.playerPositionOrigin===t&&e.playerLineSequence===n-1&&["PASS","HANDOFF"].indexOf(e.type)<0}));if(i.length){var u=je()(i,1)[0];if(u.lineParts.length){var o=Ee()(u.lineParts).pop(),M=Ee()(o.controlPoints).pop();this.startMaskSettings={centerPoint:M,radius:3}}}}}if(this.line.playerPositionTerminus&&"SCREEN"!==this.line.type){var c=3.7,N=Ee()(this.line.getLineParts()).pop(),a=Ee()(N.controlPoints).pop();["PASS","HANDOFF"].indexOf(this.line.type)>=0&&(c=1.75),this.endMaskSettings={centerPoint:a,radius:c}}this.showMaskingDebug()}},{key:"showMaskingDebug",value:function(){if(!1!==this.debugMasking){if(this.ctx.save(),this.ctx.lineWidth=.04,null!==this.startMaskSettings){var t=this.startMaskSettings.centerPoint,n=t.x,e=t.y;this.ctx.strokeStyle="green",this.ctx.moveTo(n,e),this.ctx.beginPath(),this.ctx.arc(n,e,this.startMaskSettings.radius,0,2*Math.PI,!0),this.ctx.stroke()}if(null!==this.endMaskSettings){var r=this.endMaskSettings.centerPoint,i=r.x,u=r.y;this.ctx.strokeStyle="red",this.ctx.moveTo(i,u),this.ctx.beginPath(),this.ctx.arc(i,u,this.endMaskSettings.radius,0,2*Math.PI,!0),this.ctx.stroke()}this.ctx.restore()}}},{key:"drawLineCap",value:function(){}}]),e}(Qc);function yh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}Object.assign(Ih.prototype,Dh);var hh=function(t){Cc()(e,t);var n=yh(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"allowDrawLineCap",value:function(){return!this.line.hideLineTip&&!(this.options.magnetMode&&!this.options.animationGlobalProgress)}}]),e}(Ih);function jh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var xh=function(t){Cc()(e,t);var n=jh(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLineCap",value:function(){this.allowDrawLineCap()&&this.drawArrowLineCap()}}]),e}(hh),zh={convertLinePartsToDribble:function(t){var n=[];return t.forEach((function(e,r){var i=Array(4);e.controlPoints.forEach((function(t,n){i[n]=t}));for(var u=new Ae(i[0],i[1],i[2],i[3]),o=[],M=0,c=1/u.length;M<=1;)o.push({x:u.mx(M),y:u.my(M),time:M}),M+=c;for(var N=[],a=[],s=0;s<o.length;s++)a.push(o[s]),a.length>1&&(N.push(a),a=[o[s]]);N.forEach((function(e,i){var u=je()(e,2),o=u[0],M=u[1],c={x:1.2*(M.x-o.x),y:1.2*(M.y-o.y)},a=(o.x+M.x)/2,s=(o.y+M.y)/2,D={x:-c.y,y:c.x};i%2&&(D={x:c.y,y:-c.x});var T=[o,{x:a+D.x,y:s+D.y},M];1!==t.length&&r!==t.length-1||i===N.length-1&&(T=[o,M]),n.push({controlPoints:T,lpIndex:r})}))})),n}};function Oh(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,r)}return e}function Eh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Ah=function(t){Cc()(e,t);var n=Eh(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"convertLinePartsToDribble",value:function(t){return[]}},{key:"drawLineCap",value:function(){this.allowDrawLineCap()&&this.drawArrowLineCap()}},{key:"setLineOptions",value:function(){var t=this,n=Ee()(this.line.getLineParts()),e=this.convertLinePartsToDribble(n);this.line.setLinePartsAdjusted([]),e.forEach((function(e){var r=e.controlPoints,i=e.lpIndex,u=je()(r,1)[0],o=n[i].alpha||t.line.color.alpha;if(t.options.animationGlobalProgress){var M=je()(t.line.animationKeyTimeChunks[i],2),c=M[0],N=M[1];Lt.a.inRange(t.options.animationGlobalProgress,c,N)&&St(t.options.animationGlobalProgress,c,N)>u.time&&(o=.1)}t.line.addLinePartAdjusted(function(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?Oh(Object(e),!0).forEach((function(n){Qt()(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Oh(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}({},e,{controlPoints:r,alpha:o}))}))}}]),e}(hh);function fh(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,r)}return e}function ph(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}Object.assign(Ah.prototype,zh);var Uh=function(t){Cc()(e,t);var n=ph(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLineCap",value:function(){this.handOffLineCap(this.line.baseLineParts())}},{key:"getProcessedLinePaths",value:function(){return this.line.getLineParts().map((function(t){var n=t.controlPoints;return function(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?fh(Object(e),!0).forEach((function(n){Qt()(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):fh(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}({},t,{controlPoints:[n[0],n[n.length-1]]})}))}}]),e}(Ih);function dh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Ch=function(t){Cc()(e,t);var n=dh(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"setLineOptions",value:function(){this.ctx.setLineDash([1,.5])}},{key:"drawLineCap",value:function(){this.drawArrowLineCap()}}]),e}(Ih);function Qh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var wh=function(t){Cc()(e,t);var n=Qh(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLineCap",value:function(){this.allowDrawLineCap()&&this.drawPerpendicularLineCap()}}]),e}(hh);function Lh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Sh=function(t){Cc()(e,t);var n=Lh(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLineCap",value:function(){if(this.allowDrawLineCap()){var t=this.line.lastLinePartControlPoint,n={x:.6,y:0},e=this.angleBetweenLastTwoPoints(),r={x:Math.cos(e)*n.x-Math.sin(e)*n.y,y:Math.sin(e)*n.x-Math.cos(e)*n.y},i={x:t.x+r.x,y:t.y+r.y};this.drawArrowLineCap(i)}}},{key:"setLineOptions",value:function(){this.ctx.lineWidth=.7*this.lineWidth}},{key:"drawLineFromControlPoints",value:function(){var t=this;this.ctx.save(),this.setLineOptions(),this.ctx.lineJoin="round",this.getProcessedLinePaths().forEach((function(n){t.ctx.save(),n.alpha&&t.setColor(n.alpha),t.ctx.beginPath();var e=n.controlPoints;[-.3,.3].forEach((function(n){var r=e[0].x-e[e.length-1].x,i=e[0].y-e[e.length-1].y,u=n/Math.pow(r*r+i*i,.5),o=-i*u,M=r*u,c=e.map((function(t){return{x:t.x+o,y:t.y+M}}));t.ctx.moveTo(c[0].x,c[0].y),2===e.length&&t.ctx.lineTo(c[1].x,c[1].y),3===e.length&&t.ctx.quadraticCurveTo(c[1].x,c[1].y,c[2].x,c[2].y),4===e.length&&t.ctx.bezierCurveTo(c[1].x,c[1].y,c[2].x,c[2].y,c[3].x,c[3].y),t.ctx.stroke()})),t.ctx.restore()})),this.ctx.restore()}}]),e}(hh);function kh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var vh=function(t){Cc()(e,t);var n=kh(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"apply",value:function(){var t=this;"HIDDEN"!==this.options.linesDisplay&&("START_HIDDEN"!==this.options.linesDisplay||this.options.animationGlobalProgress)&&(this.ctx.save(),this.ctx.lineWidth=this.lineWidth,this.playData.lines.forEach((function(n){if(!(t.options.linesHiddenIds.indexOf(n.id)>=0)){var e="".concat(Lt.a.capitalize(n.type),"LineLayer");ht[e]&&new ht[e](t,n).apply()}})),this.ctx.restore())}},{key:"lineWidth",get:function(){return this.courtTypeConstants.LINE_WIDTH}}]),e}(oh);function Yh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var mh=function(t){Cc()(e,t);var n=Yh(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"apply",value:function(){var t=this;this.playData.players.length&&(this.ctx.save(),this.playData.players.forEach((function(n){if(!(t.options.playersHiddenPositions.findIndex((function(t){return t===n.position}))>=0)){var e=n.location,r=e.x,i=e.y;if(t.setPlayerPuckStyle(n),t.drawPlayerPuck(n),t.setPlayerLabel(n),t.staticData.playerHats&&t.staticData.playerHats.length){var u=t.options.playersMap.find((function(t){return t.position===n.position})),o=t.staticData.playerHats.find((function(t){return!!(null==u?void 0:u.playerHatKey)&&t.key===u.playerHatKey}));if(o){!0===o.reverse&&(t.ctx.save(),t.ctx.translate(2*r,0),t.ctx.scale(-1,1));var M=o.dX,c=o.dY;t.ctx.drawImage(o.image,r-(2-4*M),i-(1.4+2*t.radius+2.8*c),4,2.8),!0===o.reverse&&t.ctx.restore()}}}})),this.ctx.restore())}},{key:"setPlayerPuckStyle",value:function(t){var n=t.color,e=n.red,r=n.green,i=n.blue,u=n.alpha,o=0===e&&0===r&&0===i&&1===u,M=this.options.position&&t.position===this.options.position,c=M?0:Math.ceil(255*e),N=M?0:Math.ceil(255*r),a=M?255:Math.ceil(255*i),s="rgba(".concat(c,", ").concat(N,", ").concat(a,", ").concat(u,")");t.isDefender&&!M&&o&&(s="#bb271b"),t.possession&&(s="#ff8000"),this.options.legacyPrintStyle&&(this.ctx.lineWidth=this.courtTypeConstants.LINE_WIDTH),this.ctx.fillStyle=this.options.legacyPrintStyle?"#FFFFFF":s,this.ctx.strokeStyle=this.options.legacyPrintStyle?"#000000":s}},{key:"drawPlayerPuck",value:function(t){var n=t.location,e=n.x,r=n.y,i=this.options.legacyPrintStyle?1.2:1;this.ctx.beginPath(),this.ctx.arc(e,r,i*this.radius,0,2*Math.PI,!0),this.options.legacyPrintStyle&&t.possession&&this.ctx.stroke(),this.ctx.fill()}},{key:"setPlayerLabel",value:function(t){var n=t.location,e=n.x,r=n.y,i=this.options.playersMap.find((function(n){return n.position===t.position}));if(this.staticData.playerHeadshots&&"Headshot"===this.options.labelsOverrideType){var u=this.staticData.playerHeadshots.find((function(t){return t.id===(null==i?void 0:i.teamPlayerId)}));if(this.ctx.save(),this.ctx.translate(e,r),u){this.ctx.save();var o=u.image.width<u.image.height,M=u.image.height<u.image.width,c=o?u.image.height/u.image.width:M?u.image.width/u.image.height:1,N=2*this.radius*(o?u.image.width/u.image.height:1)*c,a=2*this.radius*(M?u.image.height/u.image.width:1)*c,s=0-(M?N/2:this.radius),D=0-(o?a/2:this.radius);this.options.flipPlayerLabels&&this.ctx.rotate(Math.PI),this.ctx.arc(0,0,this.radius,0,2*Math.PI,!0),this.ctx.clip(),this.ctx.drawImage(u.image,s,D,N,a),this.ctx.restore()}if(this.ctx.beginPath(),this.ctx.lineWidth=this.courtTypeConstants.LINE_WIDTH,this.ctx.arc(0,0,this.radius,0,2*Math.PI,!0),this.ctx.stroke(),this.ctx.restore(),u)return}var T=t.textLabel;if(i&&(i.textOverride&&(T=i.textOverride),i.teamPlayerId&&this.options.labelsOverrideType)){var g=this.staticData.teamPlayers.find((function(t){return t.id===i.teamPlayerId}));if(g){var l=g.User_Name.split(" ").map((function(t){return t[0]})).join("").slice(0,2);T=g.Initials||l,"Jersey number"===this.options.labelsOverrideType&&g.jersey_number&&(T="".concat(g.jersey_number))}}var I=t.color.alpha,y=(3-.5*T.length)*(this.options.legacyPrintStyle?1.3:1)*this.playerScale,h=(1-.15*T.length)*(this.options.legacyPrintStyle?1.4:1)*this.playerScale;if(I){this.ctx.fillStyle=this.options.legacyPrintStyle?"#000000":"#ffffff",this.ctx.textAlign="center",this.ctx.font="".concat(y,"px Helvetica"),this.options.mirror&&(this.ctx.save(),this.ctx.translate(2*e,0),this.ctx.scale(-1,1));var j=e,x=r;this.options.flipPlayerLabels&&(j=0,x=0,this.ctx.save(),this.ctx.translate(e,r),this.ctx.rotate(Math.PI)),this.ctx.fillText(T,j,x+h),this.options.flipPlayerLabels&&this.ctx.restore(),this.options.mirror&&this.ctx.restore()}}},{key:"staticData",get:function(){return this.options.staticData}},{key:"playerScale",get:function(){return this.courtTypeConstants.PLAYER_TOKEN_SCALE*this.options.playerTokenScale}},{key:"radius",get:function(){return this.courtTypeConstants.PLAYER_TOKEN_RADIUS*this.playerScale}}]),e}(oh);function Rh(t,n){var e=t.hideForStatic&&!n.inDrawingState?0:1;n.animationGlobalProgress&&(e=0,t.animations.map((function(t){var n=je()(t.keyTimes,2);return[n[0],n[1]]})).forEach((function(t){var r=je()(t,2),i=r[0],u=r[1],o=i-.03,M=i,c=u,N=u+.03;Lt.a.inRange(n.animationGlobalProgress,o,M)&&(e=10*(.03-(M-n.animationGlobalProgress))),Lt.a.inRange(n.animationGlobalProgress,i,u)&&(e=1),Lt.a.inRange(n.animationGlobalProgress,c,N)&&(e=10*(N-n.animationGlobalProgress))})));return e}function Fh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var bh=function(t){Cc()(e,t);var n=Fh(e);function e(t,r){var i;return pt()(this,e),i=n.call(this,t),Qt()(sh()(i),"shape",void 0),Qt()(sh()(i),"animationAlpha",void 0),i.shape=r,i.animationAlpha=Rh(r,t.options),i}return dt()(e,[{key:"drawLogic",value:function(){var t=this.shape,n=t.location,e=t.scale,r=t.angleRad;this.ctx.translate(n.x,n.y),this.ctx.rotate(r),this.ctx.scale(e.x,e.y),this.setLineWidth(),this.setColor(),this.drawShape(),this.drawShapeWrapPoints()}},{key:"setLineWidth",value:function(){this.ctx.lineWidth=this.courtTypeConstants.COURT_LINE_WIDTH}},{key:"setColor",value:function(){var t=this.shape.color,n=t.alpha,e=t.blue,r=t.green,i=t.red,u=Math.ceil(255*i),o=Math.ceil(255*r),M=Math.ceil(255*e);this.ctx.fillStyle="rgba(".concat(u,", ").concat(o,", ").concat(M,", ").concat(n*this.animationAlpha,")"),this.ctx.strokeStyle="rgba(".concat(u,", ").concat(o,", ").concat(M,", ").concat(n?this.animationAlpha:0,")")}},{key:"drawShapeWrapPoints",value:function(){}},{key:"drawShape",value:function(){this.ctx.save(),this.drawShapeLogic(),this.drawShapeBorder(),this.ctx.restore()}},{key:"drawShapeBorder",value:function(){this.shape.showBorder&&this.ctx.stroke()}},{key:"drawShapeLogic",value:function(){}},{key:"staticData",get:function(){return this.options.staticData}}]),e}(Qc);function Zh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Bh=function(t){Cc()(e,t);var n=Zh(e);function e(t,r){return pt()(this,e),n.call(this,t,r)}return dt()(e,[{key:"drawLineFromControlPoints",value:function(){}},{key:"drawArrowLineCap",value:function(t){}},{key:"handOffLineCap",value:function(t){}},{key:"drawPerpendicularLineCap",value:function(){}},{key:"angleBetweenLastTwoPoints",value:function(){return 0}}]),dt()(e,[{key:"setLineWidth",value:function(){this.ctx.lineWidth=this.courtTypeConstants.LINE_WIDTH}},{key:"getProcessedLinePaths",value:function(){return[this.shape.linePart]}},{key:"drawShapeLogic",value:function(){this.drawLine(),this.drawLineCap()}},{key:"drawLine",value:function(){}},{key:"drawLineCap",value:function(){}}]),e}(bh);function Vh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}Object.assign(Bh.prototype,Dh);var Wh=function(t){Cc()(e,t);var n=Vh(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLine",value:function(){this.drawLineFromControlPoints()}},{key:"drawLineCap",value:function(){this.drawArrowLineCap()}}]),e}(Bh);function Gh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Ph=function(t){Cc()(e,t);var n=Gh(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"convertLinePartsToDribble",value:function(t){return[]}},{key:"drawLine",value:function(){this.drawLineFromControlPoints()}},{key:"drawLineCap",value:function(){this.drawArrowLineCap()}},{key:"getProcessedLinePaths",value:function(){return this.convertLinePartsToDribble(Ee()(this.shape.linePart?[this.shape.linePart]:[]))}}]),e}(Bh);function Jh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}Object.assign(Ph.prototype,zh);var Hh=function(t){Cc()(e,t);var n=Jh(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLine",value:function(){this.drawLineFromControlPoints()}},{key:"drawLineCap",value:function(){this.handOffLineCap(this.getProcessedLinePaths())}}]),e}(Bh);function Kh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Xh=function(t){Cc()(e,t);var n=Kh(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLine",value:function(){this.drawLineFromControlPoints()}},{key:"drawLineCap",value:function(){this.drawArrowLineCap()}},{key:"setLineOptions",value:function(){this.ctx.setLineDash([1,.5])}}]),e}(Bh);function qh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var _h=function(t){Cc()(e,t);var n=qh(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawLine",value:function(){this.drawLineFromControlPoints()}},{key:"drawLineCap",value:function(){this.drawPerpendicularLineCap()}}]),e}(Bh);function $h(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var tj=function(t){Cc()(e,t);var n=$h(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawShapeLogic",value:function(){var t=this.shape.outerCircleRadius;this.ctx.beginPath(),this.ctx.arc(0,0,t,0,2*Math.PI),this.ctx.fill()}}]),e}(bh);function nj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var ej=function(t){Cc()(e,t);var n=nj(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawShapeLogic",value:function(){var t=this.shape,n=t.color,e=t.outerCircleRadius;if(0!==n.alpha&&this.staticData.shapes&&this.staticData.shapes.length){var r=this.staticData.shapes.find((function(t){return"cone"===t.key}));r&&(this.ctx.globalAlpha=this.animationAlpha,this.ctx.drawImage(r.image,-e/2,-e/2,e,e))}}}]),e}(bh);function rj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var ij=function(t){Cc()(e,t);var n=rj(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawShapeLogic",value:function(){var t=this.shape.shapeControlPoints;this.ctx.rotate(Math.PI),this.ctx.beginPath(),this.ctx.moveTo(t[0].x,t[0].y),this.ctx.lineTo(t[1].x,t[1].y),this.ctx.lineTo(t[2].x,t[2].y),this.ctx.lineTo(t[0].x,t[0].y),this.ctx.fill()}}]),e}(bh);function uj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var oj=function(t){Cc()(e,t);var n=uj(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawShapeLogic",value:function(){var t=this.shape.outerCircleRadius;this.ctx.beginPath(),this.ctx.rect(-t/2,-t/2,t,t),this.ctx.fill()}}]),e}(bh);function Mj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var cj=function(t){Cc()(e,t);var n=Mj(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawShapeLogic",value:function(){var t=this.shape.shapeControlPoints;this.ctx.beginPath(),this.ctx.moveTo(t[0].x,t[0].y),this.ctx.lineTo(t[1].x,t[1].y),this.ctx.lineTo(t[2].x,t[2].y),this.ctx.lineTo(t[3].x,t[3].y),this.ctx.lineTo(t[0].x,t[0].y),this.ctx.fill()}}]),e}(bh);function Nj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var aj=function(t){Cc()(e,t);var n=Nj(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawShapeLogic",value:function(){var t=this.shape.shapeControlPoints;this.ctx.beginPath(),this.ctx.moveTo(t[0].x,t[0].y),this.ctx.lineTo(t[1].x,t[1].y),this.ctx.lineTo(t[2].x,t[2].y),this.ctx.lineTo(t[0].x,t[0].y),this.ctx.fill()}}]),e}(bh);function sj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Dj=function(t){Cc()(e,t);var n=sj(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"drawShapeLogic",value:function(){var t=this.shape.shapeControlPoints;this.ctx.beginPath(),this.ctx.moveTo(t[0].x,t[0].y),this.ctx.lineTo(t[0].x+1,t[0].y),this.ctx.lineTo(0,-1),this.ctx.lineTo(t[1].x-1,t[1].y),this.ctx.lineTo(t[1].x,t[1].y),this.ctx.lineTo(1,0),this.ctx.lineTo(t[2].x,t[2].y),this.ctx.lineTo(t[2].x-1,t[2].y),this.ctx.lineTo(0,1),this.ctx.lineTo(t[3].x+1,t[2].y),this.ctx.lineTo(t[3].x,t[3].y),this.ctx.lineTo(-1,0),this.ctx.lineTo(t[0].x,t[0].y),this.ctx.fill()}}]),e}(bh);function Tj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var gj=function(t){Cc()(e,t);var n=Tj(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"apply",value:function(){var t=this;this.ctx.save(),this.playData.shapes.forEach((function(n){var e=n.type.match("LINE.")?"".concat(Lt.a.capitalize(n.type.replace("LINE.","")),"Line"):Lt.a.capitalize(n.type),r="".concat(e,"ShapeLayer");jt[r]&&new jt[r](t,n).apply()})),this.ctx.restore()}}]),e}(oh),lj=function(){function t(n){pt()(this,t),Qt()(this,"originalData",void 0),Qt()(this,"adjustedData",void 0),this.originalData=JSON.parse(JSON.stringify(n)),this.adjustedData=JSON.parse(JSON.stringify(n))}return dt()(t,[{key:"_getAttrOriginal",value:function(t){return this.originalData[t]}},{key:"_getAttr",value:function(t){return this.adjustedData[t]}},{key:"_setAttr",value:function(t,n){this.adjustedData[t]=n}}]),t}();function Ij(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var yj={red:.502,green:.502,blue:.502,alpha:.35},hj=function(t){Cc()(e,t);var n=Ij(e);function e(t){var r;return pt()(this,e),r=n.call(this,t),Qt()(sh()(r),"internalCanvas",void 0),r.internalCanvas=document.createElement("canvas"),r}return dt()(e,[{key:"preProcessedTextForContext",value:function(){var t=this._getLines(),n=t.reduce((function(t,n){return t.width>n.width?t:n})).width;return{lines:t,box:{width:n+2*e.NOTE_WRAP_PADDING,height:t.length*this.lineHeight+2*e.NOTE_WRAP_PADDING}}}},{key:"_getLines",value:function(){this.internalCtx.font=this.fontComputed,this.internalCtx.textBaseline=this.textBaseline;for(var t=e.NOTE_WRAP_MAX_WIDTH-2*e.NOTE_WRAP_PADDING,n=[],r=this.text.split(" ").reduce((function(t,n){if(!n.match(/\n/))return t.push(n),t;for(var e=[],r="",i=0;i<n.length;i++){var u=n[i];"\n"!==u?r+=u:(r.length&&e.push(r),e.push(""),r="")}return r.length&&e.push(r),e.forEach((function(n,r){if(!n)return t.push("\n");t.push(n),e[r+1]&&t.push("\n")})),t}),[]),i=1;r.length>0;){var u=r.slice(0,i),o=this._getLineInfo(u);if(o.width<t&&i<=r.length&&!o.hasLineBreak)i++;else{1!==i&&i--;var M=r.splice(0,i),c=this._getLineInfo(M);n.push(c),i=1;var N=!r.some((function(t){return"\n"!==t}));c.width&&o.hasLineBreak&&!N&&r.splice(0,1)}}return n}},{key:"_getLineInfo",value:function(t){var n=this,e=0,r=!1,i=[];return t.forEach((function(u,o){if("\n"!==u){var M=Ee()(u.matchAll(/(<player=(\d*)>)/gi)),c={text:u,width:M.length?n.internalCtx.measureText(u.replace(/<player=(\d*)>/,"")).width+2*n.playerTokenRadius:n.internalCtx.measureText(u).width};e+=c.width,o!==t.length-1&&(e+=n.internalCtx.measureText(" ").width),i.push(c)}else r=!0})),{words:i,width:e,hasLineBreak:r}}},{key:"noteWrapperContains",value:function(t){var n=t.x,e=t.y,r=this.preProcessedTextForContext().box,i=this.location,u={x:i.x+r.width,y:i.y},o=u.y+r.height;return i.x<=n&&n<=u.x&&i.y<=e&&e<=o}},{key:"id",get:function(){return this._getAttr("id")}},{key:"text",get:function(){return this._getAttr("text")}},{key:"location",get:function(){return this._getAttr("location")}},{key:"color",get:function(){return this._getAttr("color")||yj}},{key:"showBorder",get:function(){return this._getAttr("showBorder")}},{key:"animations",get:function(){return this._getAttr("animations")||[]}},{key:"hideForStatic",get:function(){return this._getAttr("hideForStatic")}},{key:"font",get:function(){return this._getAttr("font")||{bold:!1,italic:!1,underline:!1,strikethrough:!1,fontSize:12}}},{key:"fontSize",get:function(){return this.font.fontSize/10}},{key:"lineHeight",get:function(){return this.fontSize+this.lineHeightOffset}},{key:"lineHeightOffset",get:function(){return.3*this.fontSize}},{key:"baseLineOffset",get:function(){return.1*this.fontSize}},{key:"playerTokenRadius",get:function(){return this.fontSize/2}},{key:"fontComputed",get:function(){var t=[];return this.font.bold&&t.push("bold"),this.font.italic&&t.push("italic"),t.push("".concat(this.fontSize,"px")),t.push("Arial"),t.join(" ")}},{key:"textBaseline",get:function(){return"alphabetic"}},{key:"internalCtx",get:function(){return this.internalCanvas.getContext("2d")}}],[{key:"NOTE_WRAP_MAX_WIDTH",get:function(){return 40}},{key:"NOTE_WRAP_PADDING",get:function(){return.43}}]),e}(lj);function jj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var xj=function(t){Cc()(e,t);var n=jj(e);function e(){var t;pt()(this,e);for(var r=arguments.length,i=new Array(r),u=0;u<r;u++)i[u]=arguments[u];return t=n.call.apply(n,[this].concat(i)),Qt()(sh()(t),"animationAlpha",void 0),t}return dt()(e,[{key:"apply",value:function(){var t=this;this.ctx.save(),this.disableMirrorMode(),this.playData.notes.forEach((function(n){t.ctx.save(),t.animationAlpha=Rh(n,t.options),t.setColor(n);var e=n.location;t.ctx.translate(e.x,e.y);var r=n.preProcessedTextForContext(),i=r.lines,u=r.box;t.setFont(n),t.drawBubble(n,u),t.drawText(n,i),t.ctx.restore()})),this.ctx.restore()}},{key:"setColor",value:function(t){if(void 0===this.animationAlpha)throw new Error("animationAlpha is not set");var n=t.color,e=n.alpha,r=n.blue,i=n.green,u=n.red,o=Math.ceil(255*u),M=Math.ceil(255*i),c=Math.ceil(255*r);this.ctx.fillStyle="rgba(".concat(o,", ").concat(M,", ").concat(c,", ").concat(e*this.animationAlpha,")"),this.ctx.strokeStyle="rgba(".concat(o,", ").concat(M,", ").concat(c,", ").concat(this.animationAlpha,")"),this.options.noteSelectedId===t.id&&(this.ctx.setLineDash([.5,.5]),this.ctx.strokeStyle="rgba(28, 127, 181, ".concat(this.animationAlpha,")"))}},{key:"setFont",value:function(t){this.ctx.font=t.fontComputed,this.ctx.textBaseline=t.textBaseline}},{key:"drawBubble",value:function(t,n){var e=n.width,r=n.height;this.ctx.lineWidth=this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.rect(0,0,e,r),this.ctx.fill(),(t.showBorder||this.options.noteSelectedId===t.id)&&this.ctx.stroke()}},{key:"drawText",value:function(t,n){var e=this;n.forEach((function(n,r){var i=n.words;e.ctx.save(),e.ctx.translate(hj.NOTE_WRAP_PADDING,t.fontSize+hj.NOTE_WRAP_PADDING+t.lineHeight*r);var u=0;i.forEach((function(n,r){var o=Ee()(n.text.matchAll(/(<player=(\d*)>)/gi));o.length&&0===o[0].index&&(e.drawPlayerToken(t,u,o[0][2]),u+=2*t.playerTokenRadius),e.ctx.fillStyle="rgba(0, 0, 0, ".concat(e.animationAlpha,")");var M=o.length?n.text.replace(/(<player=(\d*)>)/gi,""):n.text;e.ctx.fillText(M,u,-t.baseLineOffset),u+=n.width,o.length&&(u-=2*t.playerTokenRadius),o.length&&o[0].index>0&&(e.drawPlayerToken(t,u,o[0][2]),u+=2*t.playerTokenRadius),r!==i.length-1&&(e.ctx.fillText(" ",u,-t.baseLineOffset),u+=e.ctx.measureText(" ").width)})),(t.font.underline||t.font.strikethrough)&&(e.ctx.lineWidth=.07*t.fontSize,e.ctx.strokeStyle="rgba(0, 0, 0, ".concat(e.animationAlpha,")"),e.ctx.beginPath(),t.font.underline&&(e.ctx.moveTo(0,t.baseLineOffset),e.ctx.lineTo(u,t.baseLineOffset)),t.font.strikethrough&&(e.ctx.moveTo(0,-t.fontSize/2+t.baseLineOffset),e.ctx.lineTo(u,-t.fontSize/2+t.baseLineOffset)),e.ctx.stroke()),e.ctx.restore()}))}},{key:"drawPlayerToken",value:function(t,n,e){this.ctx.save(),this.ctx.translate(n+t.playerTokenRadius,0),this.ctx.beginPath(),this.ctx.strokeStyle="rgba(255, 255, 255, ".concat(this.animationAlpha,")"),this.ctx.fillStyle="rgba(243, 111, 33, ".concat(this.animationAlpha,")"),this.ctx.arc(0,-t.fontSize/2,t.playerTokenRadius,0,2*Math.PI),this.ctx.fill(),this.ctx.stroke();var r=.8*t.fontSize;this.ctx.font="".concat(r,"px Arial");var i=-this.ctx.measureText(e).width/2,u=-r/4;this.ctx.fillStyle="rgba(255, 255, 255, ".concat(this.animationAlpha,")"),this.ctx.fillText(e,i,u),this.ctx.restore()}},{key:"scale",value:function(t){return t/this.options.scale}}]),e}(oh);function zj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Oj=function(t){Cc()(e,t);var n=zj(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"apply",value:function(){var t=this;"HIDDEN"!==this.options.linesDisplay&&("START_HIDDEN"!==this.options.linesDisplay||this.options.animationGlobalProgress)&&(this.ctx.save(),this.playData.lines.forEach((function(n){t.options.linesSelectedIds.includes(n.id)&&n.baseLineParts().forEach((function(n){t.ctx.save(),t.ctx.fillStyle="blue",n.controlPoints.forEach((function(n){t.ctx.beginPath(),t.ctx.arc(n.x,n.y,.4,0,2*Math.PI,!0),t.ctx.fill()})),t.ctx.restore()}))})),this.ctx.restore())}}]),e}(oh);function Ej(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Aj=function(t){Cc()(e,t);var n=Ej(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"apply",value:function(){var t=this;this.ctx.save(),this.ctx.fillStyle="blue",this.playData.shapes.forEach((function(n){var e=n.id,r=n.color,i=n.controlPointsTranslated;t.options.shapeSelectedId===e&&0!==r.alpha&&i.forEach((function(n){t.ctx.beginPath(),t.ctx.arc(n.x,n.y,.4,0,2*Math.PI,!0),t.ctx.fill()}))})),this.ctx.restore()}}]),e}(oh);function fj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var pj=function(t){Cc()(e,t);var n=fj(e);function e(t){var r;return pt()(this,e),r=n.call(this,t),Qt()(sh()(r),"lineParts",void 0),Qt()(sh()(r),"linePartsAdjusted",void 0),r.lineParts=t.lineParts,r.linePartsAdjusted=Ee()(t.lineParts),r}return dt()(e,[{key:"baseLineParts",value:function(){return this.lineParts}},{key:"setLinePartsAdjusted",value:function(t){this.linePartsAdjusted=t}},{key:"setLinePartsAdjustedAtIndex",value:function(t,n){switch(t){case"fist":this.linePartsAdjusted[0]=n;break;case"last":this.linePartsAdjusted[this.linePartsAdjusted.length-1]=n;break;default:this.linePartsAdjusted[t]=n}}},{key:"setAnimationKeyTimesChunked",value:function(t){var n=this,e=[];if(this.animations[0].keyTimes.forEach((function(t,r){r&&e.push([n.animations[0].keyTimes[r-1],t])})),e.length!==this.getLineParts().length){var r=e,i=je()(r,1),u=je()(i[0],2),o=u[0],M=u[1],c=je()(t.animations,1)[0],N=c.keyTimes.indexOf(o),a=c.keyTimes.indexOf(M);if(N>=0&&a>=0){var s=c.keyTimes.slice(N,a+1);e=[],s.forEach((function(t,n){n&&e.push([s[n-1],t])}))}}this.animationKeyTimeChunks=e}},{key:"addLinePartAdjusted",value:function(t){this.linePartsAdjusted.push(t)}},{key:"getLineParts",value:function(){return this.linePartsAdjusted.length?this.linePartsAdjusted:this.lineParts}},{key:"id",get:function(){return this._getAttr("id")}},{key:"color",get:function(){return this._getAttr("color")},set:function(t){this._setAttr("color",t)}},{key:"type",get:function(){return this._getAttr("type")}},{key:"phase",get:function(){return this._getAttr("phase")}},{key:"playerPositionOrigin",get:function(){return this._getAttr("playerPositionOrigin")}},{key:"playerPositionTerminus",get:function(){return this._getAttr("playerPositionTerminus")}},{key:"playerLineSequence",get:function(){return this._getAttr("playerLineSequence")}},{key:"hideLineTip",get:function(){return this._getAttr("hideLineTip")}},{key:"animations",get:function(){return this._getAttr("animations")}},{key:"animationsByEndTime",get:function(){return this._getAttr("animations").map((function(t){return Lt.a.last(t.keyTimes)}))}},{key:"animationKeyTimeChunks",get:function(){return this._getAttr("animationKeyTimeChunks")||[]},set:function(t){this._setAttr("animationKeyTimeChunks",t)}},{key:"lastAnimEndTime",get:function(){return Lt.a.max(this.animationsByEndTime)}},{key:"firstLinePartControlPoint",get:function(){return this.lineParts[0].controlPoints[0]}},{key:"lastLinePartControlPoint",get:function(){return Ee()(Ee()(this.lineParts).pop().controlPoints).pop()}}]),e}(lj);function Uj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var dj=function(t){Cc()(e,t);var n=Uj(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"setPossession",value:function(t){var n=this;if(t.length){var e=this.possession?1:0;e+=t.filter((function(t){return t.playerPositionTerminus===n.position})).length,e-=t.filter((function(t){return t.playerPositionOrigin===n.position})).length,this.possession=e>0}}},{key:"id",get:function(){return this._getAttr("id")}},{key:"textOverride",get:function(){return this._getAttr("textOverride")},set:function(t){this._setAttr("textOverride",t)}},{key:"textLabel",get:function(){return this._getAttr("textOverride")||this.position}},{key:"isDefender",get:function(){return this.position.indexOf("x")>=0}},{key:"possession",get:function(){return this._getAttr("possession")},set:function(t){this._setAttr("possession",t)}},{key:"position",get:function(){return this._getAttr("position")}},{key:"location",get:function(){return this._getAttr("location")},set:function(t){this._setAttr("location",t)}},{key:"color",get:function(){return this._getAttr("color")}},{key:"animations",get:function(){return this._getAttr("animations")}},{key:"animationsByEndTime",get:function(){return this._getAttr("animations").map((function(t){return Lt.a.last(t.keyTimes)}))}},{key:"lastAnimEndTime",get:function(){return Lt.a.max(this.animationsByEndTime)}},{key:"lastAnimation",get:function(){return Ee()(this.animations).pop()}},{key:"lastAnimationLastLinePartControlPoint",get:function(){return Ee()(Ee()(this.lastAnimation.lineParts).pop().controlPoints).pop()}}]),e}(lj);function Cj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Qj=function(t){Cc()(e,t);var n=Cj(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"rectWrapperContains",value:function(t){var n=je()(this.rectWrapPointsTranslated,4),e=n[0],r=n[1],i=n[2],u=n[3];return+[[e,t,r],[r,t,i],[i,t,u],[u,t,e]].reduce((function(t,n){var e=je()(n,3),r=e[0],i=e[1],u=e[2];return t+Math.abs(i.x*r.y-r.x*i.y+(u.x*i.y-i.x*u.y)+(r.x*u.y-u.x*r.y))/2}),0).toFixed(2)<=this.rectWrapAreaTranslated}},{key:"computeCenterForRect",value:function(t){var n=je()(t,4),e=n[0],r=n[1],i=n[2],u=n[3];return{x:(e.x+i.x)/2,y:(r.y+u.y)/2}}},{key:"computeShapeAreaForPointAtIndex",value:function(t,n){var e=je()(this.rectWrapPointsTranslated,3),r=e[0],i=e[1],u=e[2],o=this.computeRectWrapPointsTranslatedForPointAtIndex(t,n),M=je()(o,4),c=M[0],N=M[1],a=M[2],s=M[3];return{scale:{x:yc(c,N)*this.scale.x/yc(r,i),y:yc(N,a)*this.scale.y/yc(i,u)},location:this.computeCenterForRect([c,N,a,s])}}},{key:"computeRectWrapPointsTranslatedForPointAtIndex",value:function(t,n){var e=this,r=kt(t.x,t.y,this.location.x,this.location.y,-this.angle),i=this.rectWrapPointsTranslated.map((function(t){return kt(t.x,t.y,e.location.x,e.location.y,-e.angle)})).map((function(t,e){return n===e?r:t}));return 0===n&&(i[1].y=r.y,i[3].x=r.x),1===n&&(i[0].y=r.y,i[2].x=r.x),2===n&&(i[1].x=r.x,i[3].y=r.y),3===n&&(i[0].x=r.x,i[2].y=r.y),i.map((function(t){return kt(t.x,t.y,e.location.x,e.location.y,e.angle)}))}},{key:"revertPointTranslation",value:function(t){var n={x:t.x-this.location.x,y:t.y-this.location.y};return kt(n.x,n.y,0,0,-this.angle)}},{key:"id",get:function(){return this._getAttr("id")}},{key:"location",get:function(){return this._getAttr("location")}},{key:"scale",get:function(){return this._getAttr("scale")}},{key:"angle",get:function(){return this._getAttr("angle")||0}},{key:"angleRad",get:function(){return this.angle*Math.PI/180}},{key:"color",get:function(){return this._getAttr("color")}},{key:"type",get:function(){return this._getAttr("type")}},{key:"showBorder",get:function(){return this._getAttr("showBorder")}},{key:"outerCircleRadius",get:function(){return 10}},{key:"linePart",get:function(){return this._getAttr("linePart")}},{key:"animations",get:function(){return this._getAttr("animations")||[]}},{key:"hideForStatic",get:function(){return this._getAttr("hideForStatic")}},{key:"rectWrapPointsPure",get:function(){return[{x:-this.outerCircleRadius/2,y:-this.outerCircleRadius/2},{x:this.outerCircleRadius/2,y:-this.outerCircleRadius/2},{x:this.outerCircleRadius/2,y:this.outerCircleRadius/2},{x:-this.outerCircleRadius/2,y:this.outerCircleRadius/2}]}},{key:"rectWrapPointsTranslated",get:function(){var t=this;return this.rectWrapPointsPure.map((function(n){var e={x:n.x*t.scale.x,y:n.y*t.scale.y},r=kt(e.x,e.y,0,0,t.angle);return{x:r.x+t.location.x,y:r.y+t.location.y}}))}},{key:"controlPointsTranslated",get:function(){return this.rectWrapPointsTranslated}},{key:"rectWrapAreaTranslated",get:function(){var t=je()(this.rectWrapPointsTranslated,3),n=t[0],e=t[1],r=t[2];return+(yc(n,e)*yc(e,r)).toFixed(2)}}]),e}(lj);function wj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Lj=function(t){Cc()(e,t);var n=wj(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"rectWrapPointsPure",get:function(){return Ec(this.linePart.controlPoints)}},{key:"controlPointsTranslated",get:function(){var t=this;return this.linePart.controlPoints.map((function(n){var e={x:n.x*t.scale.x,y:n.y*t.scale.y},r=kt(e.x,e.y,0,0,t.angle);return{x:r.x+t.location.x,y:r.y+t.location.y}}))}},{key:"shapeControlPoints",get:function(){return[]}}]),e}(Qj);function Sj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var kj=function(t){Cc()(e,t);var n=Sj(e);function e(){return pt()(this,e),n.apply(this,arguments)}return e}(Lj);function vj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Yj=function(t){Cc()(e,t);var n=vj(e);function e(){return pt()(this,e),n.apply(this,arguments)}return e}(Lj);function mj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Rj=function(t){Cc()(e,t);var n=mj(e);function e(){return pt()(this,e),n.apply(this,arguments)}return e}(Lj);function Fj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var bj=function(t){Cc()(e,t);var n=Fj(e);function e(){return pt()(this,e),n.apply(this,arguments)}return e}(Lj);function Zj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Bj=function(t){Cc()(e,t);var n=Zj(e);function e(){return pt()(this,e),n.apply(this,arguments)}return e}(Lj);function Vj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Wj=function(t){Cc()(e,t);var n=Vj(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"outerCircleRadius",get:function(){return 5}},{key:"rectWrapPointsPure",get:function(){return[{x:-this.outerCircleRadius,y:-this.outerCircleRadius},{x:this.outerCircleRadius,y:-this.outerCircleRadius},{x:this.outerCircleRadius,y:this.outerCircleRadius},{x:-this.outerCircleRadius,y:this.outerCircleRadius}]}},{key:"shapeControlPoints",get:function(){return[]}}]),e}(Qj);function Gj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Pj=function(t){Cc()(e,t);var n=Gj(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"outerCircleRadius",get:function(){return 5}},{key:"shapeControlPoints",get:function(){return this.rectWrapPointsPure}}]),e}(Qj);function Jj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Hj=function(t){Cc()(e,t);var n=Jj(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"outerCircleRadius",get:function(){return 8}},{key:"shapeControlPoints",get:function(){return[{x:0,y:-this.outerCircleRadius},{x:-this.outerCircleRadius*Math.cos(220)/2,y:this.outerCircleRadius*Math.sin(240)},{x:this.outerCircleRadius*Math.cos(220)/2,y:this.outerCircleRadius*Math.sin(240)}]}},{key:"rectWrapPointsPure",get:function(){return[{x:-this.outerCircleRadius,y:-this.outerCircleRadius},{x:this.outerCircleRadius,y:-this.outerCircleRadius},{x:this.outerCircleRadius,y:this.outerCircleRadius},{x:-this.outerCircleRadius,y:this.outerCircleRadius}]}}]),e}(Qj);function Kj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var Xj=function(t){Cc()(e,t);var n=Kj(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"outerCircleRadius",get:function(){return 10}},{key:"shapeControlPoints",get:function(){return this.rectWrapPointsPure}}]),e}(Qj);function qj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var _j=function(t){Cc()(e,t);var n=qj(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"outerCircleRadius",get:function(){return 10}},{key:"shapeControlPoints",get:function(){return this.rectWrapPointsPure}},{key:"rectWrapPointsPure",get:function(){return[{x:-this.outerCircleRadius,y:-.5},{x:this.outerCircleRadius,y:-.5},{x:this.outerCircleRadius,y:.5},{x:-this.outerCircleRadius,y:.5}]}}]),e}(Qj);function $j(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var tx=function(t){Cc()(e,t);var n=$j(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"outerCircleRadius",get:function(){return 10}},{key:"shapeControlPoints",get:function(){return[{x:0,y:-this.outerCircleRadius},{x:this.outerCircleRadius*Math.cos(210),y:this.outerCircleRadius*Math.sin(210)},{x:-this.outerCircleRadius*Math.cos(210),y:this.outerCircleRadius*Math.sin(210)}]}},{key:"rectWrapPointsPure",get:function(){return[{x:-this.outerCircleRadius,y:-this.outerCircleRadius},{x:this.outerCircleRadius,y:-this.outerCircleRadius},{x:this.outerCircleRadius,y:this.outerCircleRadius},{x:-this.outerCircleRadius,y:this.outerCircleRadius}]}}]),e}(Qj);function nx(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Uc()(t);if(n){var i=Uc()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return fc()(this,e)}}var ex=function(t){Cc()(e,t);var n=nx(e);function e(){return pt()(this,e),n.apply(this,arguments)}return dt()(e,[{key:"outerCircleRadius",get:function(){return 10}},{key:"shapeControlPoints",get:function(){return this.rectWrapPointsPure}}]),e}(Qj);function rx(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,r)}return e}function ix(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?rx(Object(e),!0).forEach((function(n){Qt()(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):rx(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}var ux=function(){function t(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;pt()(this,t),this.play=n,this.phase=e,this.animationGlobalProgress=r,Qt()(this,"ctx",void 0),Qt()(this,"animationGlobalProgressPrev",void 0),this.animationGlobalProgressPrev=r,this.ctx=null}return dt()(t,[{key:"draw",value:function(){if(!this.ctx)throw new Error("Canvas context is not provided. Please use setContext() method.");this.ctx.clearRect(0,0,this.frameWidth,this.frameHeight),this._init();var t=this.frameData,n=this.frameDataOptions;return new Nh(this.ctx,t,n).apply(),new gj(this.ctx,t,n).apply(),new vh(this.ctx,t,n).apply(),new mh(this.ctx,t,n).apply(),new Oj(this.ctx,t,n).apply(),new Aj(this.ctx,t,n).apply(),new xj(this.ctx,t,n).apply(),this}},{key:"_init",value:function(){if(!this.ctx)throw new Error("Canvas context is not provided. Please use setContext() method.");this.ctx.canvas.width=this.frameWidth,this.ctx.canvas.height=this.frameHeight,this.ctx.scale(this.play.scale,this.play.scale),this.ctx.translate(-this.court.courtRect.origin.x,-this.court.courtRect.origin.y),this.play.options.mirror&&(this.ctx.scale(-1,1),this.ctx.translate(2*Math.abs(this.court.courtRect.origin.x)-this.court.courtRect.size.width,0))}},{key:"setContext",value:function(t){return this.ctx=t,this}},{key:"setPhase",value:function(t){return this.phase=t,this}},{key:"setAnimationGlobalProgress",value:function(t){return this.animationGlobalProgressPrev=this.animationGlobalProgress,this.animationGlobalProgress=t,this}},{key:"animationProgress",value:function(t,n){return St(this.animationGlobalProgress,t,n)}},{key:"closestObjectToPoint",value:function(t,n){var e=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3?arguments[3]:void 0,i=e?this.convertViewPointToCourtPoint(t):t;return"player"===n?this.closestPlayerToPoint(i,r):"shape"===n?this.closestShapeToPoint(i):"note"===n?this.closestNoteToPoint(i):"line"===n?this.closestLineToPoint(i,r):"lineVertex"===n?this.closestLineVertexToPoint(i,r):null}},{key:"closestLineToPoint",value:function(t,n){var e=this,r=this.lines.filter((function(t){return!n||n(t)})).reduce((function(n,r){return r.lineParts.forEach((function(i){for(var u=ze()(Ae,Ee()(i.controlPoints)),o=1;o<=100;o++){var M=o/100,c=e.prepareCourtPoint({x:u.x(M),y:u.y(M)});n.push({object:r,objectPoint:c,distance:yc(c,t)})}})),n}),[]);return Lt.a.minBy(r,"distance")}},{key:"closestLineVertexToPoint",value:function(t,n){var e=this,r=this.lines.filter((function(t){return!n||n(t)})).reduce((function(n,r){if(!r.id.length)return n;var i=e.prepareCourtPoint(r.firstLinePartControlPoint),u=e.prepareCourtPoint(r.lastLinePartControlPoint);return n.push({object:r,objectPoint:i,distance:yc(i,t)}),n.push({object:r,objectPoint:u,distance:yc(u,t)}),n}),[]);return Lt.a.minBy(r,"distance")}},{key:"closestPlayerToPoint",value:function(t,n){var e=this,r=this.players.filter((function(t){return!n||n(t)})).reduce((function(n,r){var i=e.prepareCourtPoint(r.location);return n.push({object:r,objectPoint:i,distance:yc(i,t)}),n}),[]);return Lt.a.minBy(r,"distance")}},{key:"closestShapeToPoint",value:function(t){var n=this,e=this.shapes.filter((function(n){return n.rectWrapperContains(t)})).reduce((function(e,r){var i=n.prepareCourtPoint(r.location);return e.push({object:r,objectPoint:i,distance:yc(i,t)}),e}),[]);return Lt.a.minBy(e,"distance")}},{key:"closestNoteToPoint",value:function(t){var n=this,e=this.notes.filter((function(n){return n.noteWrapperContains(t)})).reduce((function(e,r){var i=n.prepareCourtPoint(r.location);return e.push({object:r,objectPoint:i,distance:yc(i,t)}),e}),[]);return e.length?Lt.a.minBy(e,"distance"):null}},{key:"prepareCourtPoint",value:function(t){var n=this.play.options.mirror,e=this.play.playData.court.courtRect.size.width,r=this.play.playData.court.courtRect.origin;return{x:n?e+r.x-(t.x-r.x):t.x,y:t.y}}},{key:"convertViewPointToCourtPoint",value:function(t){var n=this.play.playData.court.courtRect.origin,e=n.x,r=n.y;return{x:t.x/this.play.scale+e,y:t.y/this.play.scale+r}}},{key:"sport",get:function(){var t=this.play.playData,n=t.court,e=t.sport;return e||([Ln,wn].includes(n.type)?gn:Dn)}},{key:"court",get:function(){var t=this.play.playData.court;return ix({},t,{type:t.type===Ln?wn:t.type})}},{key:"frameWidth",get:function(){return this.play.width}},{key:"frameHeight",get:function(){return this.play.height}},{key:"frameData",get:function(){return{sport:this.sport,court:this.court,lines:this.lines,players:this.players,shapes:this.shapes,notes:this.notes}}},{key:"frameDataOptions",get:function(){return ix({},this.play.options,{staticData:this.play.staticData,scale:this.play.scale,animationGlobalProgress:this.animationGlobalProgress,playAnimationDuration:this.playAnimationDuration})}},{key:"playAnimationDuration",get:function(){return this.play.playData.lines.reduce((function(t,n){var e=new pj(n).lastAnimEndTime;return t>e?t:e}),0)}},{key:"lines",get:function(){return this.animationGlobalProgress?this.animationProgressLines:this.currentPhaseLines}},{key:"players",get:function(){return this.animationGlobalProgress?this.animationProgressPlayers:this.currentPhasePlayers}},{key:"shapes",get:function(){return this.play.playData.shapes?this.play.playData.shapes.filter((function(t){return void 0!==xt[vt(t.type)]})).map((function(t){return new(xt[vt(t.type)])(t)})):[]}},{key:"notes",get:function(){return this.play.playData.notes?this.play.playData.notes.filter((function(t){return!t.displayModes||t.displayModes.includes("onCourt")})).map((function(t){return new hj(t)})):[]}},{key:"currentPhasePlayers",get:function(){var t=this,n=this.currentPhaseLines,e=this.play.options,r=e.huddleMode,i=e.magnetMode,u=r||i?this.playDataLines:this.prevPhaseLines,o=u.filter((function(t){return["PASS","HANDOFF"].includes(t.type)}));return this.play.playData.players.map((function(e){var M=new dj(e);M.setPossession(o);var c=u.filter((function(e){return!r||!(t.phase<e.phase)&&!n.find((function(t){return t.id===e.id}))})).filter((function(t){return t.playerPositionOrigin===M.position&&t.playerPositionTerminus===M.position})),N=n.filter((function(t){return i&&t.playerPositionOrigin===M.position&&t.playerPositionTerminus===M.position})),a=N.length?N:c;if(a.length){var s=Lt.a.maxBy(a,(function(t){return t.lastAnimEndTime}));if(s){var D=s.lastLinePartControlPoint;D&&(M.location=D)}}return M}))}},{key:"currentPhaseLines",get:function(){var t=this,n=this.play.playData.lines.filter((function(n){return n.phase===t.phase}));return this.play.options.huddleMode&&(n=Lt.a.takeRight(n,2)),n.map((function(t){return new pj(t)}))}},{key:"animationProgressPlayers",get:function(){var t=this,n=this.prevAnimationLines.filter((function(t){return["PASS","HANDOFF","SHOT"].includes(t.type)}));return this.play.playData.players.map((function(e){var r=new dj(e);return r.setPossession(n),r.animations.length?(r.animations.forEach((function(n){var e=[];n.keyTimes.forEach((function(t,r){r&&e.push([n.keyTimes[r-1],t])})),e.forEach((function(e,i){var u=je()(e,2),o=u[0],M=u[1];if(Lt.a.inRange(t.animationGlobalProgress,o,M)){var c=t.animationProgress(o,M),N=ze()(Ae,Ee()(n.lineParts[i].controlPoints));r.location={x:N.x(c),y:N.y(c)}}}))})),t.animationGlobalProgress>=r.lastAnimEndTime&&(r.location=r.lastAnimationLastLinePartControlPoint),r):r}))}},{key:"animationProgressLines",get:function(){var t=this,n=this.play.options.linesDisplayOnMoveOnly;return this.play.playData.lines.map((function(n){var e=new pj(n);e.setAnimationKeyTimesChunked(t.play.playData.players.find((function(t){return t.position===e.playerPositionOrigin})));var r=[];return e.animationKeyTimeChunks.forEach((function(n,i){var u=je()(n,2),o=u[0],M=u[1];if(t.animationGlobalProgressPrev<M&&t.animationGlobalProgress>=M&&window.dispatchEvent(new CustomEvent("@luceosports/play-rendering:lineAnimationFinished",{detail:{id:e.id}})),Lt.a.inRange(t.animationGlobalProgress,o,M)){if("DRIBBLE"===e.type)return r.push(ix({},e.getLineParts()[i]));var c=hc(e.getLineParts()[i].controlPoints,t.animationProgress(o,M));r.push({controlPoints:c[0],alpha:.1}),r.push({controlPoints:c[1],alpha:e.color.alpha})}else t.animationGlobalProgress>M?r.push(ix({},e.getLineParts()[i],{alpha:.1})):r.push(ix({},e.getLineParts()[i]))})),e.setLinePartsAdjusted(r),t.animationGlobalProgress>e.lastAnimEndTime&&(e.color=ix({},e.color,{alpha:.1})),e})).filter((function(e){var r=je()(e.animations,1)[0].keyTimes,i=je()(r,1)[0],u=r.reverse(),o=je()(u,1)[0],M=Lt.a.inRange(t.animationGlobalProgress,i,o);return n?M:M||t.animationGlobalProgress>o||e.phase===t.phase}))}},{key:"playDataLines",get:function(){return this.play.playData.lines.map((function(t){return new pj(t)}))}},{key:"prevPhaseLines",get:function(){var t=this;return this.playDataLines.filter((function(n){return n.phase<t.phase}))}},{key:"prevAnimationLines",get:function(){var t=this;return this.playDataLines.filter((function(n){return t.animationGlobalProgress>=n.lastAnimEndTime}))}}]),t}(),ox=function(){function t(n,e){pt()(this,t),this.ctx=n,Qt()(this,"play",void 0),Qt()(this,"playBase",void 0),Qt()(this,"animationFrame",void 0),Qt()(this,"loopId",void 0),Qt()(this,"running",void 0),Qt()(this,"framesLoadTime",void 0),Qt()(this,"timeStart",void 0),Qt()(this,"timeElapsed",void 0),Qt()(this,"timeElapsedSaved",void 0),this.play=Lt.a.cloneDeep(e),this.playBase=Lt.a.cloneDeep(e),this.animationFrame=new ux(this.play,this.currentPlayPhase,this.globalProgress).setContext(this.ctx),this.loopId=null,this.running=!1,this.framesLoadTime=[],this.timeStart=null,this.timeElapsed=0,this.timeElapsedSaved=0}return dt()(t,[{key:"start",value:function(t,n){this.running=!0,this.loopId=requestAnimationFrame(this.drawFrame.bind(this,t,n))}},{key:"pause",value:function(){cancelAnimationFrame(this.loopId),this.running=!1,this.timeStart=null,this.timeElapsedSaved=this.timeElapsed}},{key:"setProgress",value:function(t){var n=this.countTimeElapsedFromProgress(t);return this.timeElapsed=n,this.timeElapsedSaved=n,this.refreshAnimationFrameProgress(),this}},{key:"refreshAnimationFrameProgress",value:function(){this.animationFrame.setPhase(this.currentPlayPhase).setAnimationGlobalProgress(this.globalProgress)}},{key:"drawPreviewFrame",value:function(){new ux(this.play,this.currentPlayPhase,this.globalProgress).setContext(this.ctx).draw()}},{key:"reset",value:function(){this.timeStart=null,this.timeElapsed=null,this.timeElapsedSaved=null,this.play=Lt.a.cloneDeep(this.playBase)}},{key:"countTimeElapsedFromProgress",value:function(t){return 1e3*this.animationDuration*t}},{key:"drawFrame",value:function(t,n,e){if(this.running){if(this.globalProgress>=this.lastLineAnimationMax)return n(this.lastLineAnimationMax),this.reset(),cancelAnimationFrame(this.loopId),void setTimeout((function(){t()}),1e3);n(this.globalProgress),this.timeStart||(this.timeStart=e);var r=e-this.timeStart+(this.timeElapsedSaved||0)-(this.timeElapsed||0);this.framesLoadTime.push(r),this.timeElapsed=e-this.timeStart+(this.timeElapsedSaved||0),this.animationFrame.setPhase(this.currentPlayPhase).setAnimationGlobalProgress(this.globalProgress).draw(),requestAnimationFrame(this.drawFrame.bind(this,t,n))}}},{key:"animationDuration",get:function(){return this.play.playData.animationDuration/this.play.options.speed}},{key:"globalProgress",get:function(){return(this.timeElapsed||0)/(1e3*this.animationDuration)}},{key:"currentPlayPhase",get:function(){var t=this,n=Object.entries(this.linesPhaseIntervals).find((function(n){var e=je()(n,2)[1];return Lt.a.inRange(t.globalProgress,e.min,e.max)}));return parseInt(n?n[0]:Object.keys(this.linesPhaseIntervals).pop())}},{key:"linesPhaseIntervals",get:function(){var t={};return this.play.playData.lines.forEach((function(n){t[n.phase]||(t[n.phase]={min:0,max:0}),n.animations.forEach((function(e){var r=e.keyTimes,i=je()(r,1)[0],u=Ee()(r).pop();(i<t[n.phase].min||!t[n.phase].min&&n.phase>1)&&(t[n.phase].min=i),u>t[n.phase].max&&(t[n.phase].max=u)}))})),t}},{key:"lastLineAnimationMax",get:function(){return this.play.playData.lines.reduce((function(t,n){var e=new pj(n);return t>e.lastAnimEndTime?t:e.lastAnimEndTime}),0)}}]),t}()}])}));
24
24
  //# sourceMappingURL=play-rendering.js.map