i)return t.ONE;var o=e(),s=e(),l=n.convert(this),p=r(i)-1;for(l.copyTo(o);0<=--p;)if(n.sqrTo(o,s),0<(i&1<this.s)return"-"+this.negate().toString(t);if(16==t)t=4;else if(8==t)t=3;else if(2==t)t=1;else if(32==t)t=5;else{if(4!=t)return this.toRadix(t);t=2}var e,i=(1<>s)&&(n=!0,r="0123456789abcdefghijklmnopqrstuvwxyz".charAt(e));0<=o;)s>(s+=this.DB-t):(e=this[o]>>(s-=t)&i,0>=s&&(s+=this.DB,--o)),0this.s?this.negate():this},t.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var i=this.t;if(0!=(e=i-t.t))return 0>this.s?-e:e;for(;0<=--i;)if(0!=(e=this[i]-t[i]))return e;return 0},t.prototype.bitLength=function(){return 0>=this.t?0:this.DB*(this.t-1)+r(this[this.t-1]^this.s&this.DM)},t.prototype.mod=function(i){var n=e();return this.abs().divRemTo(i,null,n),0>this.s&&0t||e.isEven()?new o(e):new s(e);return this.exp(t,i)},t.ZERO=n(0),t.ONE=n(1),a.prototype.convert=f,a.prototype.revert=f,a.prototype.mulTo=function(t,e,i){t.multiplyTo(e,i)},a.prototype.sqrTo=function(t,e){t.squareTo(e)},d.prototype.convert=function(t){if(0>t.s||t.t>2*this.m.t)return t.mod(this.m);if(0>t.compareTo(this.m))return t;var i=e();return t.copyTo(i),this.reduce(i),i},d.prototype.revert=function(t){return t},d.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);0>t.compareTo(this.r2);)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);0<=t.compareTo(this.m);)t.subTo(this.m,t)},d.prototype.mulTo=function(t,e,i){t.multiplyTo(e,i),this.reduce(i)},d.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)};var T=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],X=67108864/T[T.length-1];t.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},t.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||2>t||36u?"-"==e.charAt(h)&&0==this.signum()&&(s=!0):(p=n*p+u,++l>=r&&(this.dMultiply(o),this.dAddOffset(p,0),p=l=0))}0e)this.fromInt(1);else for(this.fromNumber(e,n),this.testBit(e-1)||this.bitwiseTo(t.ONE.shiftLeft(e-1),p,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(i);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(t.ONE.shiftLeft(e-1),this)}else{var r=7&e;(n=[]).length=(e>>3)+1,i.nextBytes(n),n[0]=0>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;i>=this.DB;n+=t.s}e.s=0>n?-1:0,0n&&(e[i++]=this.DV+n),e.t=i,e.clamp()},t.prototype.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},t.prototype.dAddOffset=function(t,e){if(0!=t){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}},t.prototype.multiplyLowerTo=function(t,e,i){var n,r=Math.min(this.t+t.t,e);for(i.s=0,i.t=r;0=t)return 0;var e=this.DV%t,i=0>this.s?t-1:0;if(0=r)return!1;var o=n.shiftRight(r);(i=i+1>>1)>T.length&&(i=T.length);for(var s=e(),l=0;lthis.s){if(1==this.t)return this[0]-this.DV;if(0==this.t)return -1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<>24},t.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},t.prototype.signum=function(){return 0>this.s?-1:0>=this.t||1==this.t&&0>=this[0]?0:1},t.prototype.toByteArray=function(){var t=this.t,e=[];e[0]=this.s;var i,n=this.DB-t*this.DB%8,r=0;if(0>n)!=(this.s&this.DM)>>n&&(e[r++]=i|this.s<n?i=(this[t]&(1<>(n+=this.DB-8):(i=this[t]>>(n-=8)&255,0>=n&&(n+=this.DB,--t)),0!=(128&i)&&(i|=-256),0==r&&(128&this.s)!=(128&i)&&++r,(0this.compareTo(t)?this:t},t.prototype.max=function(t){return 0t?this.rShiftTo(-t,i):this.lShiftTo(t,i),i},t.prototype.shiftRight=function(t){var i=e();return 0>t?this.lShiftTo(-t,i):this.rShiftTo(t,i),i},t.prototype.getLowestSetBit=function(){for(var t=0;t>=16,i+=16),0==(255&t)&&(t>>=8,i+=8),0==(15&t)&&(t>>=4,i+=4),0==(3&t)&&(t>>=2,i+=2),0==(1&t)&&++i,t=i}return e+t}return 0>this.s?this.t*this.DB:-1},t.prototype.bitCount=function(){for(var t=0,e=this.s&this.DM,i=0;i=this.t?0!=this.s:0!=(this[e]&1<=l)return p;var h=18>l?1:48>l?3:144>l?4:768>l?5:6,u=8>l?new o(i):i.isEven()?new d(i):new s(i),a=[],f=3,P=h-1,c=(1<=P)var x=t[y]>>l-P&c;else x=(t[y]&(1<>this.DB+l-P);for(f=h;0==(1&x);)x>>=1,--f;if(0>(l-=f)&&(l+=this.DB,--y),m)a[x].copyTo(p),m=!1;else{for(;1--l&&(l=this.DB-1,--y)}return u.revert(p)},t.prototype.modInverse=function(e){var i=e.isEven();if(this.isEven()&&i||0==e.signum())return t.ZERO;for(var r=e.clone(),o=this.clone(),s=n(1),l=n(0),p=n(0),h=n(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),i?(s.isEven()&&l.isEven()||(s.addTo(this,s),l.subTo(e,l)),s.rShiftTo(1,s)):l.isEven()||l.subTo(e,l),l.rShiftTo(1,l);for(;o.isEven();)o.rShiftTo(1,o),i?(p.isEven()&&h.isEven()||(p.addTo(this,p),h.subTo(e,h)),p.rShiftTo(1,p)):h.isEven()||h.subTo(e,h),h.rShiftTo(1,h);0<=r.compareTo(o)?(r.subTo(o,r),i&&s.subTo(p,s),l.subTo(h,l)):(o.subTo(r,o),i&&p.subTo(s,p),h.subTo(l,h))}return 0!=o.compareTo(t.ONE)?t.ZERO:0<=h.compareTo(e)?h.subtract(e):0>h.signum()?(h.addTo(e,h),0>h.signum()?h.add(e):h):h},t.prototype.pow=function(t){return this.exp(t,new a)},t.prototype.gcd=function(t){var e=0>this.s?this.negate():this.clone();if(t=0>t.s?t.negate():t.clone(),0>e.compareTo(t)){var i=e;e=t,t=i}i=e.getLowestSetBit();var n=t.getLowestSetBit();if(0>n)return e;for(it.compareTo(e)},t.op_Addition=function(e,i){return new t(e,void 0,void 0).add(new t(i,void 0,void 0))},t.op_Subtraction=function(e,i){return new t(e,void 0,void 0).subtract(new t(i,void 0,void 0))},t.Int128Mul=function(e,i){return new t(e,void 0,void 0).multiply(new t(i,void 0,void 0))},t.op_Division=function(t,e){return t.divide(e)},t.prototype.ToDouble=function(){return parseFloat(this.toString())},m=function(t,e){var i;if(void 0===Object.getOwnPropertyNames)for(i in e.prototype)(void 0===t.prototype[i]||t.prototype[i]===Object.prototype[i])&&(t.prototype[i]=e.prototype[i]);else for(var n=Object.getOwnPropertyNames(e.prototype),r=0;rt||2147483647t?Math.ceil(t):Math.floor(t):~~t}:I&&"function"==typeof Number.toInteger?function(t){return Number.toInteger(t)}:_||g?function(t){return parseInt(t,10)}:y?function(t){return -2147483648>t||2147483647t?Math.ceil(t):Math.floor(t):0|t}:function(t){return 0>t?Math.ceil(t):Math.floor(t)},P.Clear=function(t){t.length=0},P.PI=3.141592653589793,P.PI2=6.283185307179586,P.IntPoint=function(){var t=arguments,e=t.length;this.Y=this.X=0,P.use_xyz?(this.Z=0,3===e?(this.X=t[0],this.Y=t[1],this.Z=t[2]):2===e?(this.X=t[0],this.Y=t[1],this.Z=0):1===e?t[0]instanceof P.DoublePoint?(t=t[0],this.X=P.Clipper.Round(t.X),this.Y=P.Clipper.Round(t.Y),this.Z=0):(void 0===(t=t[0]).Z&&(t.Z=0),this.X=t.X,this.Y=t.Y,this.Z=t.Z):this.Z=this.Y=this.X=0):2===e?(this.X=t[0],this.Y=t[1]):1===e?t[0]instanceof P.DoublePoint?(t=t[0],this.X=P.Clipper.Round(t.X),this.Y=P.Clipper.Round(t.Y)):(t=t[0],this.X=t.X,this.Y=t.Y):this.Y=this.X=0},P.IntPoint.op_Equality=function(t,e){return t.X===e.X&&t.Y===e.Y},P.IntPoint.op_Inequality=function(t,e){return t.X!==e.X||t.Y!==e.Y},P.IntPoint0=function(){this.Y=this.X=0,P.use_xyz&&(this.Z=0)},P.IntPoint0.prototype=P.IntPoint.prototype,P.IntPoint1=function(t){this.X=t.X,this.Y=t.Y,P.use_xyz&&(this.Z=void 0===t.Z?0:t.Z)},P.IntPoint1.prototype=P.IntPoint.prototype,P.IntPoint1dp=function(t){this.X=P.Clipper.Round(t.X),this.Y=P.Clipper.Round(t.Y),P.use_xyz&&(this.Z=0)},P.IntPoint1dp.prototype=P.IntPoint.prototype,P.IntPoint2=function(t,e,i){this.X=t,this.Y=e,P.use_xyz&&(this.Z=void 0===i?0:i)},P.IntPoint2.prototype=P.IntPoint.prototype,P.IntRect=function(){var t=arguments,e=t.length;4===e?(this.left=t[0],this.top=t[1],this.right=t[2],this.bottom=t[3]):1===e?(t=t[0],this.left=t.left,this.top=t.top,this.right=t.right,this.bottom=t.bottom):this.bottom=this.right=this.top=this.left=0},P.IntRect0=function(){this.bottom=this.right=this.top=this.left=0},P.IntRect0.prototype=P.IntRect.prototype,P.IntRect1=function(t){this.left=t.left,this.top=t.top,this.right=t.right,this.bottom=t.bottom},P.IntRect1.prototype=P.IntRect.prototype,P.IntRect4=function(t,e,i,n){this.left=t,this.top=e,this.right=i,this.bottom=n},P.IntRect4.prototype=P.IntRect.prototype,P.ClipType={ctIntersection:0,ctUnion:1,ctDifference:2,ctXor:3},P.PolyType={ptSubject:0,ptClip:1},P.PolyFillType={pftEvenOdd:0,pftNonZero:1,pftPositive:2,pftNegative:3},P.JoinType={jtSquare:0,jtRound:1,jtMiter:2},P.EndType={etOpenSquare:0,etOpenRound:1,etOpenButt:2,etClosedLine:3,etClosedPolygon:4},P.EdgeSide={esLeft:0,esRight:1},P.Direction={dRightToLeft:0,dLeftToRight:1},P.TEdge=function(){this.Bot=new P.IntPoint0,this.Curr=new P.IntPoint0,this.Top=new P.IntPoint0,this.Delta=new P.IntPoint0,this.Dx=0,this.PolyTyp=P.PolyType.ptSubject,this.Side=P.EdgeSide.esLeft,this.OutIdx=this.WindCnt2=this.WindCnt=this.WindDelta=0,this.PrevInSEL=this.NextInSEL=this.PrevInAEL=this.NextInAEL=this.NextInLML=this.Prev=this.Next=null},P.IntersectNode=function(){this.Edge2=this.Edge1=null,this.Pt=new P.IntPoint0},P.MyIntersectNodeSort=function(){},P.MyIntersectNodeSort.Compare=function(t,e){var i=e.Pt.Y-t.Pt.Y;return 0i?-1:0},P.LocalMinima=function(){this.Y=0,this.Next=this.RightBound=this.LeftBound=null},P.Scanbeam=function(){this.Y=0,this.Next=null},P.Maxima=function(){this.X=0,this.Prev=this.Next=null},P.OutRec=function(){this.Idx=0,this.IsOpen=this.IsHole=!1,this.PolyNode=this.BottomPt=this.Pts=this.FirstLeft=null},P.OutPt=function(){this.Idx=0,this.Pt=new P.IntPoint0,this.Prev=this.Next=null},P.Join=function(){this.OutPt2=this.OutPt1=null,this.OffPt=new P.IntPoint0},P.ClipperBase=function(){this.m_CurrentLM=this.m_MinimaList=null,this.m_edges=[],this.PreserveCollinear=this.m_HasOpenPaths=this.m_UseFullRange=!1,this.m_ActiveEdges=this.m_PolyOuts=this.m_Scanbeam=null},P.ClipperBase.horizontal=-9007199254740992,P.ClipperBase.Skip=-2,P.ClipperBase.Unassigned=-1,P.ClipperBase.tolerance=1e-20,P.ClipperBase.loRange=47453132,P.ClipperBase.hiRange=0xfffffffffffff,P.ClipperBase.near_zero=function(t){return t>-P.ClipperBase.tolerance&&ti.X==e.Xi.Y==e.Yi.X==e.Xi.Y==e.YP.ClipperBase.hiRange||t.Y>P.ClipperBase.hiRange||-t.X>P.ClipperBase.hiRange||-t.Y>P.ClipperBase.hiRange)&&P.Error("Coordinate outside allowed range in RangeTest()."):(t.X>P.ClipperBase.loRange||t.Y>P.ClipperBase.loRange||-t.X>P.ClipperBase.loRange||-t.Y>P.ClipperBase.loRange)&&(e.Value=!0,this.RangeTest(t,e))},P.ClipperBase.prototype.InitEdge=function(t,e,i,n){t.Next=e,t.Prev=i,t.Curr.X=n.X,t.Curr.Y=n.Y,P.use_xyz&&(t.Curr.Z=n.Z),t.OutIdx=-1},P.ClipperBase.prototype.InitEdge2=function(t,e){t.Curr.Y>=t.Next.Curr.Y?(t.Bot.X=t.Curr.X,t.Bot.Y=t.Curr.Y,P.use_xyz&&(t.Bot.Z=t.Curr.Z),t.Top.X=t.Next.Curr.X,t.Top.Y=t.Next.Curr.Y,P.use_xyz&&(t.Top.Z=t.Next.Curr.Z)):(t.Top.X=t.Curr.X,t.Top.Y=t.Curr.Y,P.use_xyz&&(t.Top.Z=t.Curr.Z),t.Bot.X=t.Next.Curr.X,t.Bot.Y=t.Next.Curr.Y,P.use_xyz&&(t.Bot.Z=t.Next.Curr.Z)),this.SetDx(t),t.PolyTyp=e},P.ClipperBase.prototype.FindNextLocMin=function(t){for(var e;;){for(;P.IntPoint.op_Inequality(t.Bot,t.Prev.Bot)||P.IntPoint.op_Equality(t.Curr,t.Top);)t=t.Next;if(t.Dx!==P.ClipperBase.horizontal&&t.Prev.Dx!==P.ClipperBase.horizontal)break;for(;t.Prev.Dx===P.ClipperBase.horizontal;)t=t.Prev;for(e=t;t.Dx===P.ClipperBase.horizontal;)t=t.Next;if(t.Top.Y!==t.Prev.Bot.Y){e.Prev.Bot.Xn.Next.Top.X&&(n=i.Prev)}for(;t!==n;)t.NextInLML=t.Next,t.Dx===P.ClipperBase.horizontal&&t!==r&&t.Bot.X!==t.Prev.Top.X&&this.ReverseHorizontal(t),t=t.Next;t.Dx===P.ClipperBase.horizontal&&t!==r&&t.Bot.X!==t.Prev.Top.X&&this.ReverseHorizontal(t),n=n.Next}else{for(;n.Top.Y===n.Prev.Bot.Y&&n.Prev.OutIdx!==P.ClipperBase.Skip;)n=n.Prev;if(n.Dx===P.ClipperBase.horizontal&&n.Prev.OutIdx!==P.ClipperBase.Skip){for(i=n;i.Next.Dx===P.ClipperBase.horizontal;)i=i.Next;(i.Next.Top.X===n.Prev.Top.X||i.Next.Top.X>n.Prev.Top.X)&&(n=i.Next)}for(;t!==n;)t.NextInLML=t.Prev,t.Dx===P.ClipperBase.horizontal&&t!==r&&t.Bot.X!==t.Next.Top.X&&this.ReverseHorizontal(t),t=t.Prev;t.Dx===P.ClipperBase.horizontal&&t!==r&&t.Bot.X!==t.Next.Top.X&&this.ReverseHorizontal(t),n=n.Prev}return n},P.ClipperBase.prototype.AddPath=function(t,e,i){P.use_lines?i||e!==P.PolyType.ptClip||P.Error("AddPath: Open paths must be subject."):i||P.Error("AddPath: Open paths have been disabled.");var n=t.length-1;if(i)for(;0n||!i&&1>n)return!1;for(var r=[],o=0;o<=n;o++)r.push(new P.TEdge);var s=!0;r[1].Curr.X=t[1].X,r[1].Curr.Y=t[1].Y,P.use_xyz&&(r[1].Curr.Z=t[1].Z);var l={Value:this.m_UseFullRange};for(this.RangeTest(t[0],l),this.m_UseFullRange=l.Value,l.Value=this.m_UseFullRange,this.RangeTest(t[n],l),this.m_UseFullRange=l.Value,this.InitEdge(r[0],r[1],r[n],t[0]),this.InitEdge(r[n],r[0],r[n-1],t[n]),o=n-1;1<=o;--o)l.Value=this.m_UseFullRange,this.RangeTest(t[o],l),this.m_UseFullRange=l.Value,this.InitEdge(r[o],r[o+1],r[o-1],t[o]);for(o=t=n=r[0];;)if(t.Curr===t.Next.Curr&&(i||t.Next!==n)){if(t===t.Next)break;t===n&&(n=t.Next),o=t=this.RemoveEdge(t)}else{if(t.Prev===t.Next)break;if(i&&P.ClipperBase.SlopesEqual4(t.Prev.Curr,t.Curr,t.Next.Curr,this.m_UseFullRange)&&(!this.PreserveCollinear||!this.Pt2IsBetweenPt1AndPt3(t.Prev.Curr,t.Curr,t.Next.Curr))){t===n&&(n=t.Next),o=t=(t=this.RemoveEdge(t)).Prev;continue}if((t=t.Next)===o||!i&&t.Next===n)break}if(!i&&t===t.Next||i&&t.Prev===t.Next)return!1;i||(this.m_HasOpenPaths=!0,n.Prev.OutIdx=P.ClipperBase.Skip),t=n;do this.InitEdge2(t,e),t=t.Next,s&&t.Curr.Y!==n.Curr.Y&&(s=!1);while(t!==n)if(s){if(i)return!1;for(t.Prev.OutIdx=P.ClipperBase.Skip,(e=new P.LocalMinima).Next=null,e.Y=t.Bot.Y,e.LeftBound=null,e.RightBound=t,e.RightBound.Side=P.EdgeSide.esRight,e.RightBound.WindDelta=0;t.Bot.X!==t.Prev.Top.X&&this.ReverseHorizontal(t),t.Next.OutIdx!==P.ClipperBase.Skip;)t=t.NextInLML=t.Next;return this.InsertLocalMinima(e),this.m_edges.push(r),!0}for(this.m_edges.push(r),s=null,P.IntPoint.op_Equality(t.Prev.Bot,t.Prev.Top)&&(t=t.Next);(t=this.FindNextLocMin(t))!==s;)null===s&&(s=t),(e=new P.LocalMinima).Next=null,e.Y=t.Bot.Y,t.Dxt.X==e.Xt.Y==e.Y=this.m_MinimaList.Y)t.Next=this.m_MinimaList,this.m_MinimaList=t;else{for(var e=this.m_MinimaList;null!==e.Next&&t.Ythis.m_Scanbeam.Y){var e=new P.Scanbeam;e.Y=t,e.Next=this.m_Scanbeam,this.m_Scanbeam=e}else{for(e=this.m_Scanbeam;null!==e.Next&&t<=e.Next.Y;)e=e.Next;if(t!==e.Y){var i=new P.Scanbeam;i.Y=t,i.Next=e.Next,e.Next=i}}},P.ClipperBase.prototype.PopScanbeam=function(t){return null===this.m_Scanbeam?(t.v=0,!1):(t.v=this.m_Scanbeam.Y,this.m_Scanbeam=this.m_Scanbeam.Next,!0)},P.ClipperBase.prototype.LocalMinimaPending=function(){return null!==this.m_CurrentLM},P.ClipperBase.prototype.CreateOutRec=function(){var t=new P.OutRec;return t.Idx=P.ClipperBase.Unassigned,t.IsHole=!1,t.IsOpen=!1,t.FirstLeft=null,t.Pts=null,t.BottomPt=null,t.PolyNode=null,this.m_PolyOuts.push(t),t.Idx=this.m_PolyOuts.length-1,t},P.ClipperBase.prototype.DisposeOutRec=function(t){this.m_PolyOuts[t].Pts=null,this.m_PolyOuts[t]=null},P.ClipperBase.prototype.UpdateEdgeIntoAEL=function(t){null===t.NextInLML&&P.Error("UpdateEdgeIntoAEL: invalid call");var e=t.PrevInAEL,i=t.NextInAEL;return t.NextInLML.OutIdx=t.OutIdx,null!==e?e.NextInAEL=t.NextInLML:this.m_ActiveEdges=t.NextInLML,null!==i&&(i.PrevInAEL=t.NextInLML),t.NextInLML.Side=t.Side,t.NextInLML.WindDelta=t.WindDelta,t.NextInLML.WindCnt=t.WindCnt,t.NextInLML.WindCnt2=t.WindCnt2,(t=t.NextInLML).Curr.X=t.Bot.X,t.Curr.Y=t.Bot.Y,t.PrevInAEL=e,t.NextInAEL=i,P.ClipperBase.IsHorizontal(t)||this.InsertScanbeam(t.Top.Y),t},P.ClipperBase.prototype.SwapPositionsInAEL=function(t,e){if(t.NextInAEL!==t.PrevInAEL&&e.NextInAEL!==e.PrevInAEL){if(t.NextInAEL===e){var i=e.NextInAEL;null!==i&&(i.PrevInAEL=t);var n=t.PrevInAEL;null!==n&&(n.NextInAEL=e),e.PrevInAEL=n,e.NextInAEL=t,t.PrevInAEL=e,t.NextInAEL=i}else e.NextInAEL===t?(null!==(i=t.NextInAEL)&&(i.PrevInAEL=e),null!==(n=e.PrevInAEL)&&(n.NextInAEL=t),t.PrevInAEL=n,t.NextInAEL=e,e.PrevInAEL=t,e.NextInAEL=i):(i=t.NextInAEL,n=t.PrevInAEL,t.NextInAEL=e.NextInAEL,null!==t.NextInAEL&&(t.NextInAEL.PrevInAEL=t),t.PrevInAEL=e.PrevInAEL,null!==t.PrevInAEL&&(t.PrevInAEL.NextInAEL=t),e.NextInAEL=i,null!==e.NextInAEL&&(e.NextInAEL.PrevInAEL=e),e.PrevInAEL=n,null!==e.PrevInAEL&&(e.PrevInAEL.NextInAEL=e));null===t.PrevInAEL?this.m_ActiveEdges=t:null===e.PrevInAEL&&(this.m_ActiveEdges=e)}},P.ClipperBase.prototype.DeleteFromAEL=function(t){var e=t.PrevInAEL,i=t.NextInAEL;(null!==e||null!==i||t===this.m_ActiveEdges)&&(null!==e?e.NextInAEL=i:this.m_ActiveEdges=i,null!==i&&(i.PrevInAEL=e),t.NextInAEL=null,t.PrevInAEL=null)},P.Clipper=function(t){void 0===t&&(t=0),this.m_PolyOuts=null,this.m_ClipType=P.ClipType.ctIntersection,this.m_IntersectNodeComparer=this.m_IntersectList=this.m_SortedEdges=this.m_ActiveEdges=this.m_Maxima=this.m_Scanbeam=null,this.m_ExecuteLocked=!1,this.m_SubjFillType=this.m_ClipFillType=P.PolyFillType.pftEvenOdd,this.m_GhostJoins=this.m_Joins=null,this.StrictlySimple=this.ReverseSolution=this.m_UsingPolyTree=!1,P.ClipperBase.call(this),this.m_SortedEdges=this.m_ActiveEdges=this.m_Maxima=this.m_Scanbeam=null,this.m_IntersectList=[],this.m_IntersectNodeComparer=P.MyIntersectNodeSort.Compare,this.m_UsingPolyTree=this.m_ExecuteLocked=!1,this.m_PolyOuts=[],this.m_Joins=[],this.m_GhostJoins=[],this.ReverseSolution=0!=(1&t),this.StrictlySimple=0!=(2&t),this.PreserveCollinear=0!=(4&t),P.use_xyz&&(this.ZFillFunction=null)},P.Clipper.ioReverseSolution=1,P.Clipper.ioStrictlySimple=2,P.Clipper.ioPreserveCollinear=4,P.Clipper.prototype.Clear=function(){0!==this.m_edges.length&&(this.DisposeAllPolyPts(),P.ClipperBase.prototype.Clear.call(this))},P.Clipper.prototype.InsertMaxima=function(t){var e=new P.Maxima;if(e.X=t,null===this.m_Maxima)this.m_Maxima=e,this.m_Maxima.Next=null,this.m_Maxima.Prev=null;else if(t=i.Next.X;)i=i.Next;t!==i.X&&(e.Next=i.Next,e.Prev=i,null!==i.Next&&(i.Next.Prev=e),i.Next=e)}},P.Clipper.prototype.Execute=function(){var t,e=arguments,i=e.length,n=e[1]instanceof P.PolyTree;if(4!==i||n){if(4===i&&n){i=e[0];var r=e[1];if(n=e[2],e=e[3],this.m_ExecuteLocked)return!1;this.m_ExecuteLocked=!0,this.m_SubjFillType=n,this.m_ClipFillType=e,this.m_ClipType=i,this.m_UsingPolyTree=!0;try{(t=this.ExecuteInternal())&&this.BuildResult2(r)}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1}return t}if(2===i&&!n||2===i&&n)return i=e[0],r=e[1],this.Execute(i,r,P.PolyFillType.pftEvenOdd,P.PolyFillType.pftEvenOdd)}else{if(i=e[0],r=e[1],n=e[2],e=e[3],this.m_ExecuteLocked)return!1;this.m_HasOpenPaths&&P.Error("Error: PolyTree struct is needed for open path clipping."),this.m_ExecuteLocked=!0,P.Clear(r),this.m_SubjFillType=n,this.m_ClipFillType=e,this.m_ClipType=i,this.m_UsingPolyTree=!1;try{(t=this.ExecuteInternal())&&this.BuildResult(r)}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1}return t}},P.Clipper.prototype.FixHoleLinkage=function(t){if(null!==t.FirstLeft&&(t.IsHole===t.FirstLeft.IsHole||null===t.FirstLeft.Pts)){for(var e=t.FirstLeft;null!==e&&(e.IsHole===t.IsHole||null===e.Pts);)e=e.FirstLeft;t.FirstLeft=e}},P.Clipper.prototype.ExecuteInternal=function(){try{this.Reset(),this.m_Maxima=this.m_SortedEdges=null;var t,e={},i={};if(!this.PopScanbeam(e))return!1;for(this.InsertLocalMinimaIntoAEL(e.v);this.PopScanbeam(i)||this.LocalMinimaPending();){if(this.ProcessHorizontals(),this.m_GhostJoins.length=0,!this.ProcessIntersections(i.v))return!1;this.ProcessEdgesAtTopOfScanbeam(i.v),e.v=i.v,this.InsertLocalMinimaIntoAEL(e.v)}var n=0;for(t=this.m_PolyOuts.length;nt.Top.Y?e.Top.XP.Clipper.TopX(e,t.Top.Y):e.Curr.Xt.WindCnt2}case P.ClipType.ctUnion:switch(i){case P.PolyFillType.pftEvenOdd:case P.PolyFillType.pftNonZero:return 0===t.WindCnt2;case P.PolyFillType.pftPositive:return 0>=t.WindCnt2;default:return 0<=t.WindCnt2}case P.ClipType.ctDifference:if(t.PolyTyp===P.PolyType.ptSubject)switch(i){case P.PolyFillType.pftEvenOdd:case P.PolyFillType.pftNonZero:return 0===t.WindCnt2;case P.PolyFillType.pftPositive:return 0>=t.WindCnt2;default:return 0<=t.WindCnt2}else switch(i){case P.PolyFillType.pftEvenOdd:case P.PolyFillType.pftNonZero:return 0!==t.WindCnt2;case P.PolyFillType.pftPositive:return 0t.WindCnt2}case P.ClipType.ctXor:if(0===t.WindDelta)switch(i){case P.PolyFillType.pftEvenOdd:case P.PolyFillType.pftNonZero:return 0===t.WindCnt2;case P.PolyFillType.pftPositive:return 0>=t.WindCnt2;default:return 0<=t.WindCnt2}}return!0},P.Clipper.prototype.SetWindingCount=function(t){for(var e=t.PrevInAEL;null!==e&&(e.PolyTyp!==t.PolyTyp||0===e.WindDelta);)e=e.PrevInAEL;if(null===e)e=t.PolyTyp===P.PolyType.ptSubject?this.m_SubjFillType:this.m_ClipFillType,t.WindCnt=0===t.WindDelta?e===P.PolyFillType.pftNegative?-1:1:t.WindDelta,t.WindCnt2=0,e=this.m_ActiveEdges;else{if(0===t.WindDelta&&this.m_ClipType!==P.ClipType.ctUnion)t.WindCnt=1;else if(this.IsEvenOddFillType(t)){if(0===t.WindDelta){for(var i=!0,n=e.PrevInAEL;null!==n;)n.PolyTyp===e.PolyTyp&&0!==n.WindDelta&&(i=!i),n=n.PrevInAEL;t.WindCnt=i?0:1}else t.WindCnt=t.WindDelta}else t.WindCnt=0>e.WindCnt*e.WindDelta?1e.WindDelta*t.WindDelta?e.WindCnt:e.WindCnt+t.WindDelta:0===t.WindDelta?1:t.WindDelta:0===t.WindDelta?0>e.WindCnt?e.WindCnt-1:e.WindCnt+1:0>e.WindDelta*t.WindDelta?e.WindCnt:e.WindCnt+t.WindDelta;t.WindCnt2=e.WindCnt2,e=e.NextInAEL}if(this.IsEvenOddAltFillType(t))for(;e!==t;)0!==e.WindDelta&&(t.WindCnt2=0===t.WindCnt2?1:0),e=e.NextInAEL;else for(;e!==t;)t.WindCnt2+=e.WindDelta,e=e.NextInAEL},P.Clipper.prototype.AddEdgeToSEL=function(t){null===this.m_SortedEdges?(this.m_SortedEdges=t,t.PrevInSEL=null,t.NextInSEL=null):(t.NextInSEL=this.m_SortedEdges,t.PrevInSEL=null,this.m_SortedEdges=this.m_SortedEdges.PrevInSEL=t)},P.Clipper.prototype.PopEdgeFromSEL=function(t){if(t.v=this.m_SortedEdges,null===t.v)return!1;var e=t.v;return this.m_SortedEdges=t.v.NextInSEL,null!==this.m_SortedEdges&&(this.m_SortedEdges.PrevInSEL=null),e.NextInSEL=null,e.PrevInSEL=null,!0},P.Clipper.prototype.CopyAELToSEL=function(){var t=this.m_ActiveEdges;for(this.m_SortedEdges=t;null!==t;)t.PrevInSEL=t.PrevInAEL,t=t.NextInSEL=t.NextInAEL},P.Clipper.prototype.SwapPositionsInSEL=function(t,e){if((null!==t.NextInSEL||null!==t.PrevInSEL)&&(null!==e.NextInSEL||null!==e.PrevInSEL)){if(t.NextInSEL===e){var i=e.NextInSEL;null!==i&&(i.PrevInSEL=t);var n=t.PrevInSEL;null!==n&&(n.NextInSEL=e),e.PrevInSEL=n,e.NextInSEL=t,t.PrevInSEL=e,t.NextInSEL=i}else e.NextInSEL===t?(null!==(i=t.NextInSEL)&&(i.PrevInSEL=e),null!==(n=e.PrevInSEL)&&(n.NextInSEL=t),t.PrevInSEL=n,t.NextInSEL=e,e.PrevInSEL=t,e.NextInSEL=i):(i=t.NextInSEL,n=t.PrevInSEL,t.NextInSEL=e.NextInSEL,null!==t.NextInSEL&&(t.NextInSEL.PrevInSEL=t),t.PrevInSEL=e.PrevInSEL,null!==t.PrevInSEL&&(t.PrevInSEL.NextInSEL=t),e.NextInSEL=i,null!==e.NextInSEL&&(e.NextInSEL.PrevInSEL=e),e.PrevInSEL=n,null!==e.PrevInSEL&&(e.PrevInSEL.NextInSEL=e));null===t.PrevInSEL?this.m_SortedEdges=t:null===e.PrevInSEL&&(this.m_SortedEdges=e)}},P.Clipper.prototype.AddLocalMaxPoly=function(t,e,i){this.AddOutPt(t,i),0===e.WindDelta&&this.AddOutPt(e,i),t.OutIdx===e.OutIdx?(t.OutIdx=-1,e.OutIdx=-1):t.OutIdxe.Dx){var n=this.AddOutPt(t,i);e.OutIdx=t.OutIdx,t.Side=P.EdgeSide.esLeft,e.Side=P.EdgeSide.esRight;var r=t;t=r.PrevInAEL===e?e.PrevInAEL:r.PrevInAEL}else n=this.AddOutPt(e,i),t.OutIdx=e.OutIdx,t.Side=P.EdgeSide.esRight,e.Side=P.EdgeSide.esLeft,t=(r=e).PrevInAEL===t?t.PrevInAEL:r.PrevInAEL;if(null!==t&&0<=t.OutIdx&&t.Top.Yt.OutIdx){var i=this.CreateOutRec();i.IsOpen=0===t.WindDelta;var n=new P.OutPt;i.Pts=n,n.Idx=i.Idx,n.Pt.X=e.X,n.Pt.Y=e.Y,P.use_xyz&&(n.Pt.Z=e.Z),n.Next=n,n.Prev=n,i.IsOpen||this.SetHoleState(t,i),t.OutIdx=i.Idx}else{var r=(i=this.m_PolyOuts[t.OutIdx]).Pts,o=t.Side===P.EdgeSide.esLeft;if(o&&P.IntPoint.op_Equality(e,r.Pt))return r;if(!o&&P.IntPoint.op_Equality(e,r.Prev.Pt))return r.Prev;(n=new P.OutPt).Idx=i.Idx,n.Pt.X=e.X,n.Pt.Y=e.Y,P.use_xyz&&(n.Pt.Z=e.Z),n.Next=r,n.Prev=r.Prev,n.Prev.Next=n,r.Prev=n,o&&(i.Pts=n)}return n},P.Clipper.prototype.GetLastOutPt=function(t){var e=this.m_PolyOuts[t.OutIdx];return t.Side===P.EdgeSide.esLeft?e.Pts:e.Pts.Prev},P.Clipper.prototype.SwapPoints=function(t,e){var i=new P.IntPoint1(t.Value);t.Value.X=e.Value.X,t.Value.Y=e.Value.Y,P.use_xyz&&(t.Value.Z=e.Value.Z),e.Value.X=i.X,e.Value.Y=i.Y,P.use_xyz&&(e.Value.Z=i.Z)},P.Clipper.prototype.HorzSegmentsOverlap=function(t,e,i,n){if(t>e){var r=t;t=e,e=r}return i>n&&(r=i,i=n,n=r),t=o&&n>=i||r>=o&&r>=i},P.Clipper.prototype.GetBottomPt=function(t){for(var e=null,i=t.Next;i!==t;)i.Pt.Y>t.Pt.Y?(t=i,e=null):i.Pt.Y===t.Pt.Y&&i.Pt.X<=t.Pt.X&&(i.Pt.Xn.Pt.Y?t:i.Pt.Yn.Pt.X?e:i.Next===i?e:n.Next===n?t:this.FirstIsBottomPt(i,n)?t:e},P.Clipper.prototype.OutRec1RightOfOutRec2=function(t,e){do if((t=t.FirstLeft)===e)return!0;while(null!==t)return!1},P.Clipper.prototype.GetOutRec=function(t){for(t=this.m_PolyOuts[t];t!==this.m_PolyOuts[t.Idx];)t=this.m_PolyOuts[t.Idx];return t},P.Clipper.prototype.AppendPolygon=function(t,e){var i=this.m_PolyOuts[t.OutIdx],n=this.m_PolyOuts[e.OutIdx],r=this.OutRec1RightOfOutRec2(i,n)?n:this.OutRec1RightOfOutRec2(n,i)?i:this.GetLowermostRec(i,n),o=i.Pts,s=o.Prev,l=n.Pts,p=l.Prev;for(t.Side===P.EdgeSide.esLeft?e.Side===P.EdgeSide.esLeft?(this.ReversePolyPtLinks(l),l.Next=o,o.Prev=l,s.Next=p,p.Prev=s,i.Pts=p):(p.Next=o,o.Prev=p,l.Prev=s,s.Next=l,i.Pts=l):e.Side===P.EdgeSide.esRight?(this.ReversePolyPtLinks(l),s.Next=p,p.Prev=s,l.Next=o,o.Prev=l):(s.Next=l,l.Prev=s,o.Prev=p,p.Next=o),i.BottomPt=null,r===n&&(n.FirstLeft!==i&&(i.FirstLeft=n.FirstLeft),i.IsHole=n.IsHole),n.Pts=null,n.BottomPt=null,n.FirstLeft=i,r=t.OutIdx,o=e.OutIdx,t.OutIdx=-1,e.OutIdx=-1,s=this.m_ActiveEdges;null!==s;){if(s.OutIdx===o){s.OutIdx=r,s.Side=t.Side;break}s=s.NextInAEL}n.Idx=i.Idx},P.Clipper.prototype.ReversePolyPtLinks=function(t){if(null!==t){var e=t;do{var i=e.Next;e.Next=e.Prev,e=e.Prev=i}while(e!==t)}},P.Clipper.SwapSides=function(t,e){var i=t.Side;t.Side=e.Side,e.Side=i},P.Clipper.SwapPolyIndexes=function(t,e){var i=t.OutIdx;t.OutIdx=e.OutIdx,e.OutIdx=i},P.Clipper.prototype.IntersectEdges=function(t,e,i){var n=0<=t.OutIdx,r=0<=e.OutIdx;if(P.use_xyz&&this.SetZ(i,t,e),P.use_lines&&(0===t.WindDelta||0===e.WindDelta))(0!==t.WindDelta||0!==e.WindDelta)&&(t.PolyTyp===e.PolyTyp&&t.WindDelta!==e.WindDelta&&this.m_ClipType===P.ClipType.ctUnion?0===t.WindDelta?r&&(this.AddOutPt(t,i),n&&(t.OutIdx=-1)):n&&(this.AddOutPt(e,i),r&&(e.OutIdx=-1)):t.PolyTyp!==e.PolyTyp&&(0!==t.WindDelta||1!==Math.abs(e.WindCnt)||this.m_ClipType===P.ClipType.ctUnion&&0!==e.WindCnt2?0!==e.WindDelta||1!==Math.abs(t.WindCnt)||this.m_ClipType===P.ClipType.ctUnion&&0!==t.WindCnt2||(this.AddOutPt(e,i),r&&(e.OutIdx=-1)):(this.AddOutPt(t,i),n&&(t.OutIdx=-1))));else{if(t.PolyTyp===e.PolyTyp){if(this.IsEvenOddFillType(t)){var o=t.WindCnt;t.WindCnt=e.WindCnt,e.WindCnt=o}else t.WindCnt=0===t.WindCnt+e.WindDelta?-t.WindCnt:t.WindCnt+e.WindDelta,e.WindCnt=0==e.WindCnt-t.WindDelta?-e.WindCnt:e.WindCnt-t.WindDelta}else this.IsEvenOddFillType(e)?t.WindCnt2=0===t.WindCnt2?1:0:t.WindCnt2+=e.WindDelta,this.IsEvenOddFillType(t)?e.WindCnt2=0===e.WindCnt2?1:0:e.WindCnt2-=t.WindDelta;if(t.PolyTyp===P.PolyType.ptSubject)var s=this.m_SubjFillType,l=this.m_ClipFillType;else s=this.m_ClipFillType,l=this.m_SubjFillType;if(e.PolyTyp===P.PolyType.ptSubject){var p=this.m_SubjFillType;o=this.m_ClipFillType}else p=this.m_ClipFillType,o=this.m_SubjFillType;switch(s){case P.PolyFillType.pftPositive:s=t.WindCnt;break;case P.PolyFillType.pftNegative:s=-t.WindCnt;break;default:s=Math.abs(t.WindCnt)}switch(p){case P.PolyFillType.pftPositive:p=e.WindCnt;break;case P.PolyFillType.pftNegative:p=-e.WindCnt;break;default:p=Math.abs(e.WindCnt)}if(n&&r)0!==s&&1!==s||0!==p&&1!==p||t.PolyTyp!==e.PolyTyp&&this.m_ClipType!==P.ClipType.ctXor?this.AddLocalMaxPoly(t,e,i):(this.AddOutPt(t,i),this.AddOutPt(e,i),P.Clipper.SwapSides(t,e),P.Clipper.SwapPolyIndexes(t,e));else if(n)(0===p||1===p)&&(this.AddOutPt(t,i),P.Clipper.SwapSides(t,e),P.Clipper.SwapPolyIndexes(t,e));else if(r)(0===s||1===s)&&(this.AddOutPt(e,i),P.Clipper.SwapSides(t,e),P.Clipper.SwapPolyIndexes(t,e));else if(!(0!==s&&1!==s||0!==p&&1!==p)){switch(l){case P.PolyFillType.pftPositive:n=t.WindCnt2;break;case P.PolyFillType.pftNegative:n=-t.WindCnt2;break;default:n=Math.abs(t.WindCnt2)}switch(o){case P.PolyFillType.pftPositive:r=e.WindCnt2;break;case P.PolyFillType.pftNegative:r=-e.WindCnt2;break;default:r=Math.abs(e.WindCnt2)}if(t.PolyTyp!==e.PolyTyp)this.AddLocalMinPoly(t,e,i);else if(1===s&&1===p)switch(this.m_ClipType){case P.ClipType.ctIntersection:0=n&&0>=r&&this.AddLocalMinPoly(t,e,i);break;case P.ClipType.ctDifference:(t.PolyTyp===P.PolyType.ptClip&&0=n&&0>=r)&&this.AddLocalMinPoly(t,e,i);break;case P.ClipType.ctXor:this.AddLocalMinPoly(t,e,i)}else P.Clipper.SwapSides(t,e)}}},P.Clipper.prototype.DeleteFromSEL=function(t){var e=t.PrevInSEL,i=t.NextInSEL;(null!==e||null!==i||t===this.m_SortedEdges)&&(null!==e?e.NextInSEL=i:this.m_SortedEdges=i,null!==i&&(i.PrevInSEL=e),t.NextInSEL=null,t.PrevInSEL=null)},P.Clipper.prototype.ProcessHorizontals=function(){for(var t={};this.PopEdgeFromSEL(t);)this.ProcessHorizontal(t.v)},P.Clipper.prototype.GetHorzDirection=function(t,e){t.Bot.X=s.Top.X&&(p=null)}else{for(;null!==p.Next&&p.Next.Xa.Curr.X;)0<=t.OutIdx&&!o&&this.AddOutPt(t,new P.IntPoint2(p.X,t.Bot.Y)),p=p.Prev}if(n===P.Direction.dLeftToRight&&a.Curr.X>i||n===P.Direction.dRightToLeft&&a.Curr.Xn.Top.Y&&P.ClipperBase.SlopesEqual3(t,n,this.m_UseFullRange)?(f=this.AddOutPt(n,t.Bot),this.AddJoin(h,f,t.Top)):null!==f&&f.Curr.X===t.Bot.X&&f.Curr.Y===t.Bot.Y&&0!==f.WindDelta&&0<=f.OutIdx&&f.Curr.Y>f.Top.Y&&P.ClipperBase.SlopesEqual3(t,f,this.m_UseFullRange)&&(f=this.AddOutPt(f,t.Bot),this.AddJoin(h,f,t.Top)))):this.UpdateEdgeIntoAEL(t):(0<=t.OutIdx&&this.AddOutPt(t,t.Top),this.DeleteFromAEL(t))},P.Clipper.prototype.GetNextInAEL=function(t,e){return e===P.Direction.dLeftToRight?t.NextInAEL:t.PrevInAEL},P.Clipper.prototype.IsMinima=function(t){return null!==t&&t.Prev.NextInLML!==t&&t.Next.NextInLML!==t},P.Clipper.prototype.IsMaxima=function(t,e){return null!==t&&t.Top.Y===e&&null===t.NextInLML},P.Clipper.prototype.IsIntermediate=function(t,e){return t.Top.Y===e&&null!==t.NextInLML},P.Clipper.prototype.GetMaximaPair=function(t){return P.IntPoint.op_Equality(t.Next.Top,t.Top)&&null===t.Next.NextInLML?t.Next:P.IntPoint.op_Equality(t.Prev.Top,t.Top)&&null===t.Prev.NextInLML?t.Prev:null},P.Clipper.prototype.GetMaximaPairEx=function(t){return null!==(t=this.GetMaximaPair(t))&&t.OutIdx!==P.ClipperBase.Skip&&(t.NextInAEL!==t.PrevInAEL||P.ClipperBase.IsHorizontal(t))?t:null},P.Clipper.prototype.ProcessIntersections=function(t){if(null===this.m_ActiveEdges)return!0;try{if(this.BuildIntersectList(t),0===this.m_IntersectList.length)return!0;if(!(1===this.m_IntersectList.length||this.FixupIntersectionOrder()))return!1;this.ProcessIntersectList()}catch(t){this.m_SortedEdges=null,this.m_IntersectList.length=0,P.Error("ProcessIntersections error")}return this.m_SortedEdges=null,!0},P.Clipper.prototype.BuildIntersectList=function(t){if(null!==this.m_ActiveEdges){var e=this.m_ActiveEdges;for(this.m_SortedEdges=e;null!==e;)e.PrevInSEL=e.PrevInAEL,e.NextInSEL=e.NextInAEL,e.Curr.X=P.Clipper.TopX(e,t),e=e.NextInAEL;for(var i=!0;i&&null!==this.m_SortedEdges;){for(i=!1,e=this.m_SortedEdges;null!==e.NextInSEL;){var n=e.NextInSEL,r=new P.IntPoint0;e.Curr.X>n.Curr.X?(this.IntersectPoint(e,n,r),r.Yt?Math.ceil(t-.5):Math.round(t)},I=function(t){return 0>t?Math.ceil(t-.5):Math.floor(t+.5)},C=function(t){return 0>t?-Math.round(Math.abs(t)):Math.round(t)},g=function(t){return 0>t?-2147483648>(t-=.5)?Math.ceil(t):0|t:2147483647<(t+=.5)?Math.floor(t):0|t},P.Clipper.Round=y?v:c?C:x?g:I,P.Clipper.TopX=function(t,e){return e===t.Top.Y?t.Top.X:t.Bot.X+P.Clipper.Round(t.Dx*(e-t.Bot.Y))},P.Clipper.prototype.IntersectPoint=function(t,e,i){if(i.X=0,i.Y=0,t.Dx===e.Dx)i.Y=t.Curr.Y,i.X=P.Clipper.TopX(t,i.Y);else{if(0===t.Delta.X){if(i.X=t.Bot.X,P.ClipperBase.IsHorizontal(e))i.Y=e.Bot.Y;else{var n=e.Bot.Y-e.Bot.X/e.Dx;i.Y=P.Clipper.Round(i.X/e.Dx+n)}}else if(0===e.Delta.X){if(i.X=e.Bot.X,P.ClipperBase.IsHorizontal(t))i.Y=t.Bot.Y;else{var r=t.Bot.Y-t.Bot.X/t.Dx;i.Y=P.Clipper.Round(i.X/t.Dx+r)}}else{r=t.Bot.X-t.Bot.Y*t.Dx;var o=((n=e.Bot.X-e.Bot.Y*e.Dx)-r)/(t.Dx-e.Dx);i.Y=P.Clipper.Round(o),i.X=Math.abs(t.Dx)e.Top.Y)return i.Y=t.Top.Y,i.X=P.Clipper.TopX(e,t.Top.Y),i.Xt.Curr.Y&&(i.Y=t.Curr.Y,i.X=Math.abs(t.Dx)>Math.abs(e.Dx)?P.Clipper.TopX(e,i.Y):P.Clipper.TopX(t,i.Y))}},P.Clipper.prototype.ProcessEdgesAtTopOfScanbeam=function(t){for(var e,i,n=this.m_ActiveEdges;null!==n;)if((i=this.IsMaxima(n,t))&&(i=null===(i=this.GetMaximaPairEx(n))||!P.ClipperBase.IsHorizontal(i)),i)this.StrictlySimple&&this.InsertMaxima(n.Top.X),e=n.PrevInAEL,this.DoMaxima(n),n=null===e?this.m_ActiveEdges:e.NextInAEL;else{if(this.IsIntermediate(n,t)&&P.ClipperBase.IsHorizontal(n.NextInLML)?(0<=(n=this.UpdateEdgeIntoAEL(n)).OutIdx&&this.AddOutPt(n,n.Bot),this.AddEdgeToSEL(n)):(n.Curr.X=P.Clipper.TopX(n,t),n.Curr.Y=t),P.use_xyz&&(n.Curr.Z=n.Top.Y===t?n.Top.Z:n.Bot.Y===t?n.Bot.Z:0),this.StrictlySimple&&(e=n.PrevInAEL,0<=n.OutIdx&&0!==n.WindDelta&&null!==e&&0<=e.OutIdx&&e.Curr.X===n.Curr.X&&0!==e.WindDelta)){var r=new P.IntPoint1(n.Curr);P.use_xyz&&this.SetZ(r,e,n),i=this.AddOutPt(e,r),e=this.AddOutPt(n,r),this.AddJoin(i,e,r)}n=n.NextInAEL}for(this.ProcessHorizontals(),this.m_Maxima=null,n=this.m_ActiveEdges;null!==n;)this.IsIntermediate(n,t)&&(i=null,0<=n.OutIdx&&(i=this.AddOutPt(n,n.Top)),e=(n=this.UpdateEdgeIntoAEL(n)).PrevInAEL,r=n.NextInAEL,null!==e&&e.Curr.X===n.Bot.X&&e.Curr.Y===n.Bot.Y&&null!==i&&0<=e.OutIdx&&e.Curr.Y===e.Top.Y&&P.ClipperBase.SlopesEqual5(n.Curr,n.Top,e.Curr,e.Top,this.m_UseFullRange)&&0!==n.WindDelta&&0!==e.WindDelta?(e=this.AddOutPt(ePrev2,n.Bot),this.AddJoin(i,e,n.Top)):null!==r&&r.Curr.X===n.Bot.X&&r.Curr.Y===n.Bot.Y&&null!==i&&0<=r.OutIdx&&r.Curr.Y===r.Top.Y&&P.ClipperBase.SlopesEqual5(n.Curr,n.Top,r.Curr,r.Top,this.m_UseFullRange)&&0!==n.WindDelta&&0!==r.WindDelta&&(e=this.AddOutPt(r,n.Bot),this.AddJoin(i,e,n.Top))),n=n.NextInAEL},P.Clipper.prototype.DoMaxima=function(t){var e=this.GetMaximaPairEx(t);if(null===e)0<=t.OutIdx&&this.AddOutPt(t,t.Top),this.DeleteFromAEL(t);else{for(var i=t.NextInAEL;null!==i&&i!==e;)this.IntersectEdges(t,i,t.Top),this.SwapPositionsInAEL(t,i),i=t.NextInAEL;-1===t.OutIdx&&-1===e.OutIdx?(this.DeleteFromAEL(t),this.DeleteFromAEL(e)):0<=t.OutIdx&&0<=e.OutIdx?(0<=t.OutIdx&&this.AddLocalMaxPoly(t,e,t.Top),this.DeleteFromAEL(t),this.DeleteFromAEL(e)):P.use_lines&&0===t.WindDelta?(0<=t.OutIdx&&(this.AddOutPt(t,t.Top),t.OutIdx=P.ClipperBase.Unassigned),this.DeleteFromAEL(t),0<=e.OutIdx&&(this.AddOutPt(e,t.Top),e.OutIdx=P.ClipperBase.Unassigned),this.DeleteFromAEL(e)):P.Error("DoMaxima error")}},P.Clipper.ReversePaths=function(t){for(var e=0,i=t.length;er)){for(var o=Array(r),s=0;sr||!n.IsOpen&&3>r)){this.FixHoleLinkage(n);var o=new P.PolyNode;t.m_AllPolys.push(o),n.PolyNode=o,o.m_polygon.length=r,n=n.Pts.Prev;for(var s=0;se.Pt.X?P.Direction.dRightToLeft:P.Direction.dLeftToRight;if(s===(n=i.Pt.X>n.Pt.X?P.Direction.dRightToLeft:P.Direction.dLeftToRight))return!1;if(s===P.Direction.dLeftToRight){for(;t.Next.Pt.X<=r.X&&t.Next.Pt.X>=t.Pt.X&&t.Next.Pt.Y===r.Y;)t=t.Next;o&&t.Pt.X!==r.X&&(t=t.Next),e=this.DupOutPt(t,!o),P.IntPoint.op_Inequality(e.Pt,r)&&((t=e).Pt.X=r.X,t.Pt.Y=r.Y,P.use_xyz&&(t.Pt.Z=r.Z),e=this.DupOutPt(t,!o))}else{for(;t.Next.Pt.X>=r.X&&t.Next.Pt.X<=t.Pt.X&&t.Next.Pt.Y===r.Y;)t=t.Next;o||t.Pt.X===r.X||(t=t.Next),e=this.DupOutPt(t,o),P.IntPoint.op_Inequality(e.Pt,r)&&((t=e).Pt.X=r.X,t.Pt.Y=r.Y,P.use_xyz&&(t.Pt.Z=r.Z),e=this.DupOutPt(t,o))}if(n===P.Direction.dLeftToRight){for(;i.Next.Pt.X<=r.X&&i.Next.Pt.X>=i.Pt.X&&i.Next.Pt.Y===r.Y;)i=i.Next;o&&i.Pt.X!==r.X&&(i=i.Next),n=this.DupOutPt(i,!o),P.IntPoint.op_Inequality(n.Pt,r)&&((i=n).Pt.X=r.X,i.Pt.Y=r.Y,P.use_xyz&&(i.Pt.Z=r.Z),n=this.DupOutPt(i,!o))}else{for(;i.Next.Pt.X>=r.X&&i.Next.Pt.X<=i.Pt.X&&i.Next.Pt.Y===r.Y;)i=i.Next;o||i.Pt.X===r.X||(i=i.Next),n=this.DupOutPt(i,o),P.IntPoint.op_Inequality(n.Pt,r)&&((i=n).Pt.X=r.X,i.Pt.Y=r.Y,P.use_xyz&&(i.Pt.Z=r.Z),n=this.DupOutPt(i,o))}return s===P.Direction.dLeftToRight===o?(t.Prev=i,i.Next=t,e.Next=n,n.Prev=e):(t.Next=i,i.Prev=t,e.Prev=n,n.Next=e),!0},P.Clipper.prototype.JoinPoints=function(t,e,i){var n,r=t.OutPt1;new P.OutPt;var o,s=t.OutPt2;if(new P.OutPt,(o=t.OutPt1.Pt.Y===t.OffPt.Y)&&P.IntPoint.op_Equality(t.OffPt,t.OutPt1.Pt)&&P.IntPoint.op_Equality(t.OffPt,t.OutPt2.Pt)){if(e!==i)return!1;for(n=t.OutPt1.Next;n!==r&&P.IntPoint.op_Equality(n.Pt,t.OffPt);)n=n.Next;for(n=n.Pt.Y>t.OffPt.Y,o=t.OutPt2.Next;o!==s&&P.IntPoint.op_Equality(o.Pt,t.OffPt);)o=o.Next;return n!==o.Pt.Y>t.OffPt.Y&&(n?(n=this.DupOutPt(r,!1),o=this.DupOutPt(s,!0),r.Prev=s,s.Next=r,n.Next=o,o.Prev=n):(n=this.DupOutPt(r,!0),o=this.DupOutPt(s,!1),r.Next=s,s.Prev=r,n.Prev=o,o.Next=n),t.OutPt1=r,t.OutPt2=n,!0)}if(o){for(n=r;r.Prev.Pt.Y===r.Pt.Y&&r.Prev!==n&&r.Prev!==s;)r=r.Prev;for(;n.Next.Pt.Y===n.Pt.Y&&n.Next!==r&&n.Next!==s;)n=n.Next;if(n.Next===r||n.Next===s)return!1;for(o=s;s.Prev.Pt.Y===s.Pt.Y&&s.Prev!==o&&s.Prev!==n;)s=s.Prev;for(;o.Next.Pt.Y===o.Pt.Y&&o.Next!==s&&o.Next!==r;)o=o.Next;if(o.Next===s||o.Next===r||(i={Left:null,Right:null},!this.GetOverlap(r.Pt.X,n.Pt.X,s.Pt.X,o.Pt.X,i)))return!1;e=i.Left;var l=i.Right;return i=new P.IntPoint0,r.Pt.X>=e&&r.Pt.X<=l?(i.X=r.Pt.X,i.Y=r.Pt.Y,P.use_xyz&&(i.Z=r.Pt.Z),e=r.Pt.X>n.Pt.X):s.Pt.X>=e&&s.Pt.X<=l?(i.X=s.Pt.X,i.Y=s.Pt.Y,P.use_xyz&&(i.Z=s.Pt.Z),e=s.Pt.X>o.Pt.X):n.Pt.X>=e&&n.Pt.X<=l?(i.X=n.Pt.X,i.Y=n.Pt.Y,P.use_xyz&&(i.Z=n.Pt.Z),e=n.Pt.X>r.Pt.X):(i.X=o.Pt.X,i.Y=o.Pt.Y,P.use_xyz&&(i.Z=o.Pt.Z),e=o.Pt.X>s.Pt.X),t.OutPt1=r,t.OutPt2=s,this.JoinHorz(r,n,s,o,i,e)}for(n=r.Next;P.IntPoint.op_Equality(n.Pt,r.Pt)&&n!==r;)n=n.Next;if(l=n.Pt.Y>r.Pt.Y||!P.ClipperBase.SlopesEqual4(r.Pt,n.Pt,t.OffPt,this.m_UseFullRange)){for(n=r.Prev;P.IntPoint.op_Equality(n.Pt,r.Pt)&&n!==r;)n=n.Prev;if(n.Pt.Y>r.Pt.Y||!P.ClipperBase.SlopesEqual4(r.Pt,n.Pt,t.OffPt,this.m_UseFullRange))return!1}for(o=s.Next;P.IntPoint.op_Equality(o.Pt,s.Pt)&&o!==s;)o=o.Next;var p=o.Pt.Y>s.Pt.Y||!P.ClipperBase.SlopesEqual4(s.Pt,o.Pt,t.OffPt,this.m_UseFullRange);if(p){for(o=s.Prev;P.IntPoint.op_Equality(o.Pt,s.Pt)&&o!==s;)o=o.Prev;if(o.Pt.Y>s.Pt.Y||!P.ClipperBase.SlopesEqual4(s.Pt,o.Pt,t.OffPt,this.m_UseFullRange))return!1}return n!==r&&o!==s&&n!==o&&(e!==i||l!==p)&&(l?(n=this.DupOutPt(r,!1),o=this.DupOutPt(s,!0),r.Prev=s,s.Next=r,n.Next=o,o.Prev=n):(n=this.DupOutPt(r,!0),o=this.DupOutPt(s,!1),r.Next=s,s.Prev=r,n.Prev=o,o.Next=n),t.OutPt1=r,t.OutPt2=n,!0)},P.Clipper.GetBounds=function(t){for(var e=0,i=t.length;en.right&&(n.right=t[e][r].X),t[e][r].Yn.bottom&&(n.bottom=t[e][r].Y);return n},P.Clipper.prototype.GetBounds2=function(t){var e=t,i=new P.IntRect;for(i.left=t.Pt.X,i.right=t.Pt.X,i.top=t.Pt.Y,i.bottom=t.Pt.Y,t=t.Next;t!==e;)t.Pt.Xi.right&&(i.right=t.Pt.X),t.Pt.Yi.bottom&&(i.bottom=t.Pt.Y),t=t.Next;return i},P.Clipper.PointInPolygon=function(t,e){var i=0,n=e.length;if(3>n)return 0;for(var r=e[0],o=1;o<=n;++o){var s=o===n?e[0]:e[o];if(s.Y===t.Y&&(s.X===t.X||r.Y===t.Y&&s.X>t.X==r.X=t.X){if(s.X>t.X)i=1-i;else{var l=(r.X-t.X)*(s.Y-t.Y)-(s.X-t.X)*(r.Y-t.Y);if(0===l)return -1;0r.Y&&(i=1-i)}}else if(s.X>t.X){if(0==(l=(r.X-t.X)*(s.Y-t.Y)-(s.X-t.X)*(r.Y-t.Y)))return -1;0r.Y&&(i=1-i)}}r=s}return i},P.Clipper.prototype.PointInPolygon=function(t,e){var i=0,n=e,r=t.X,o=t.Y,s=e.Pt.X,l=e.Pt.Y;do{var p=(e=e.Next).Pt.X,h=e.Pt.Y;if(h===o&&(p===r||l===o&&p>r==s=r){if(p>r)i=1-i;else{if(0==(s=(s-r)*(h-o)-(p-r)*(l-o)))return -1;0l&&(i=1-i)}}else if(p>r){if(0==(s=(s-r)*(h-o)-(p-r)*(l-o)))return -1;0l&&(i=1-i)}}s=p,l=h}while(n!==e)return i},P.Clipper.prototype.Poly2ContainsPoly1=function(t,e){var i=t;do{var n=this.PointInPolygon(i.Pt,e);if(0<=n)return 0e)return 0;for(var i=0,n=0,r=e-1;nMath.abs(t.Y-e.Y)?t.X>e.X==t.Xt.X==e.Xe.Y==t.Yt.Y==e.Yi&&(i=0);var o=Array(i);for(r=0;rn)){var r=new P.PolyNode;if(r.m_jointype=e,r.m_endtype=i,i===P.EndType.etClosedLine||i===P.EndType.etClosedPolygon)for(;0r.m_polygon[e].Y||t[s].Y===r.m_polygon[e].Y&&t[s].Xo)&&(this.m_polyNodes.AddChild(r),i===P.EndType.etClosedPolygon)&&(0>this.m_lowest.X?this.m_lowest=new P.IntPoint2(this.m_polyNodes.ChildCount()-1,e):(t=this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon[this.m_lowest.Y],(r.m_polygon[e].Y>t.Y||r.m_polygon[e].Y===t.Y&&r.m_polygon[e].X=this.ArcTolerance?P.ClipperOffset.def_arc_tolerance:this.ArcTolerance>Math.abs(t)*P.ClipperOffset.def_arc_tolerance?Math.abs(t)*P.ClipperOffset.def_arc_tolerance:this.ArcTolerance)/Math.abs(t));for(this.m_sin=Math.sin(P.ClipperOffset.two_pi/r),this.m_cos=Math.cos(P.ClipperOffset.two_pi/r),this.m_StepsPerRad=r/P.ClipperOffset.two_pi,0>t&&(this.m_sin=-this.m_sin),i=0;i=t&&(3>o||n.m_endtype!==P.EndType.etClosedPolygon))){if(this.m_destPoly=[],1===o){if(n.m_jointype===P.JoinType.jtRound)for(o=1,n=0,e=1;e<=r;e++){this.m_destPoly.push(new P.IntPoint2(P.ClipperOffset.Round(this.m_srcPoly[0].X+o*t),P.ClipperOffset.Round(this.m_srcPoly[0].Y+n*t)));var s=o;o=o*this.m_cos-this.m_sin*n,n=s*this.m_sin+n*this.m_cos}else for(n=o=-1,e=0;4>e;++e)this.m_destPoly.push(new P.IntPoint2(P.ClipperOffset.Round(this.m_srcPoly[0].X+o*t),P.ClipperOffset.Round(this.m_srcPoly[0].Y+n*t))),0>o?o=1:0>n?n=1:o=-1}else{for(e=this.m_normals.length=0;eMath.abs(this.m_sinA*this.m_delta)){if(0this.m_sinA&&(this.m_sinA=-1);if(0>this.m_sinA*this.m_delta)this.m_destPoly.push(new P.IntPoint2(P.ClipperOffset.Round(this.m_srcPoly[t].X+this.m_normals[e].X*this.m_delta),P.ClipperOffset.Round(this.m_srcPoly[t].Y+this.m_normals[e].Y*this.m_delta))),this.m_destPoly.push(new P.IntPoint1(this.m_srcPoly[t])),this.m_destPoly.push(new P.IntPoint2(P.ClipperOffset.Round(this.m_srcPoly[t].X+this.m_normals[t].X*this.m_delta),P.ClipperOffset.Round(this.m_srcPoly[t].Y+this.m_normals[t].Y*this.m_delta)));else switch(i){case P.JoinType.jtMiter:(i=1+(this.m_normals[t].X*this.m_normals[e].X+this.m_normals[t].Y*this.m_normals[e].Y))>=this.m_miterLim?this.DoMiter(t,e,i):this.DoSquare(t,e);break;case P.JoinType.jtSquare:this.DoSquare(t,e);break;case P.JoinType.jtRound:this.DoRound(t,e)}return t},P.ClipperOffset.prototype.DoSquare=function(t,e){var i=Math.tan(Math.atan2(this.m_sinA,this.m_normals[e].X*this.m_normals[t].X+this.m_normals[e].Y*this.m_normals[t].Y)/4);this.m_destPoly.push(new P.IntPoint2(P.ClipperOffset.Round(this.m_srcPoly[t].X+this.m_delta*(this.m_normals[e].X-this.m_normals[e].Y*i)),P.ClipperOffset.Round(this.m_srcPoly[t].Y+this.m_delta*(this.m_normals[e].Y+this.m_normals[e].X*i)))),this.m_destPoly.push(new P.IntPoint2(P.ClipperOffset.Round(this.m_srcPoly[t].X+this.m_delta*(this.m_normals[t].X+this.m_normals[t].Y*i)),P.ClipperOffset.Round(this.m_srcPoly[t].Y+this.m_delta*(this.m_normals[t].Y-this.m_normals[t].X*i))))},P.ClipperOffset.prototype.DoMiter=function(t,e,i){i=this.m_delta/i,this.m_destPoly.push(new P.IntPoint2(P.ClipperOffset.Round(this.m_srcPoly[t].X+(this.m_normals[e].X+this.m_normals[t].X)*i),P.ClipperOffset.Round(this.m_srcPoly[t].Y+(this.m_normals[e].Y+this.m_normals[t].Y)*i)))},P.ClipperOffset.prototype.DoRound=function(t,e){for(var i,n=Math.max(P.Cast_Int32(P.ClipperOffset.Round(this.m_StepsPerRad*Math.abs(Math.atan2(this.m_sinA,this.m_normals[e].X*this.m_normals[t].X+this.m_normals[e].Y*this.m_normals[t].Y)))),1),r=this.m_normals[e].X,o=this.m_normals[e].Y,s=0;se)return t;i||(t=[t]);for(var n,r,o,s,l,p,h,u=t.length,a=[],f=0;fn)o=r,a.push(o);else{for(o=r,s=e*e,l=r[0],h=p=1;he)return P.JS.Clone(t);var i=t[0]instanceof Array;i||(t=[t]);var n,r,o,s=t.length,l=e*e,p=[];for(n=0;no;o++){var a=[];if(u=h.length,h[u-1].X!==h[0].X||h[u-1].Y!==h[0].Y){var f=1;h.push({X:h[0].X,Y:h[0].Y}),u=h.length}else f=0;var d=[];for(r=0;ro)return 0;for(e&&(t[o]=t[0],o++);--o;){var s=t[o],l=s.X;s=s.Y;var p=t[o-1],h=p.X;r+=n((l-h)*(l-h)+(s-(p=p.Y))*(s-p))}return e&&t.pop(),r/i},P.JS.PerimeterOfPaths=function(t,e,i){i||(i=1);for(var n=0,r=0;rtA(function(t,e){if(t.length!==e.length)throw new l({expectedLength:t.length,givenLength:e.length});let i=[];for(let n=0;n>1]>>4>=8&&r[t]&&(r[t]=r[t].toUpperCase()),(15&n[t>>1])>=8&&r[t+1]&&(r[t+1]=r[t+1].toUpperCase());let o=`0x${r.join("")}`;return tB.set(`${t}.${e}`,o),o}(t)===t);return tD.set(n,r),r}(i))throw new u({address:i});return d(i.toLowerCase(),{size:n?32:null})}if("string"===e)return g(i);if("bytes"===e)return i;if("bool"===e)return d(v(i),{size:n?32:1});let r=e.match(tz);if(r){let[t,e,o="256"]=r,s=Number.parseInt(o)/8;return I(i,{size:n?32:s,signed:"int"===e})}let o=e.match(tF);if(o){let[t,e]=o;if(Number.parseInt(e)!==(i.length-2)/2)throw new p({expectedSize:Number.parseInt(e),givenSize:(i.length-2)/2});return d(i,{dir:"right",size:n?32:null})}let s=e.match(tR);if(s&&Array.isArray(i)){let[e,n]=s,r=[];for(let e=0;e1&&parseInt(tH[1]);t$>3&&(t$=!1),tZ||(tZ=Math.floor(150*Math.random())+1);let tj=tk(["uint256"],[tZ]);if(1==tZ&&"0xb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6"!==tj)throw Error("invalid token id should be 0xb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6");let tJ=new class{constructor(t){this.useA=!1;let e=function(t){let e=parseInt(t.substr(0,8),16),i=parseInt(t.substr(8,8),16),n=parseInt(t.substr(16,8),16),r=parseInt(t.substr(24,8),16);return function(){e|=0,i|=0,n|=0,r|=0;let t=(e+i|0)+r|0;return r=r+1|0,e=i^i>>>9,i=n+(n<<3)|0,n=(n=n<<21|n>>>11)+t|0,(t>>>0)/4294967296}};this.prngA=new e(t.substr(2,32)),this.prngB=new e(t.substr(34,32));for(let t=0;t<1e6;t+=2)this.prngA(),this.prngB()}float(){return this.useA=!this.useA,this.useA?this.prngA():this.prngB()}int(t=0,e=1){return Math.round(t+this.float()*(e-t))}bell(t=1,e){let i=0,n=0;for(;0===i;)i=this.float();for(;0===n;)n=this.float();let r=Math.sqrt(-2*Math.log(i))*Math.cos(2*Math.PI*n);return(r=r/10+.5)>1||r<0?this.bell(e):(e&&(r>=0&&r<.5?r+=.5:r-=.5),Math.round(r*t))}}(tj),tV=window.innerWidth,tG=window.innerHeight,tK=tV>=tG?tV:tG;var tQ=tJ.int(3,10),t0=parseInt(tK/tQ),t1=tJ.int(100,500),t2=tJ.int(2,300),t3=tJ.int(2,300),t4=tJ.int(0,360);let t5=0==tq(0,10,tj),t6=tk(["bytes32"],[tj]),t8=t5||0==tq(0,1,t6);t6=tk(["bytes32"],[t6]);let t7=t5||!t8||0==tq(0,1,t6),t9=0==tq(0,3,t6=tk(["bytes32"],[t6])),et=0==tq(0,15,t6=tk(["bytes32"],[t6])),ee=0==tq(0,3,t6=tk(["bytes32"],[t6])),ei=0==tq(0,1,t6=tk(["bytes32"],[t6])),en=tJ.int(5,10),er=tJ.int(1,3),eo=tJ.int(0,2),es=tJ.int(4,50),el={x:tJ.int(t0,tV-2*t0),y:tJ.int(t0,tG-2*t0)},ep=function(){let t=[];for(let e=0;e<1e3;e++){let e=new eu;t.push(e)}return t}(),eh=function(){let t=[];for(let e=0;e<1;e++){let e=new ea;e.createRn(),t.push(e)}return t}();function eu(){this.x=0,this.y=0,this.w=0,this.h=0,this.xR=tJ.float(),this.yR=tJ.float(),this.wR=tJ.float(),this.hR=tJ.float(),this.getPath=function(){return this.marginize(),[[{X:this.x,Y:this.y},{X:this.x+this.w,Y:this.y},{X:this.x+this.w,Y:this.y+this.h},{X:this.x,Y:this.y+this.h}]]},this.setValue=function(t,e){this[t]=parseInt(e)},this.marginize=function(){this.x+this.w>tV&&(this.x=tV-this.w),this.x<0&&(this.x=0),this.y+this.h>tG&&(this.y=tG-this.h),this.y<0&&(this.y=0)}}function ea(){this.startX=tJ.int(t0,tV-t0),this.startY=tJ.int(t0,tG-t0),this.polyLength=tJ.int(400,1e3),this.stepVar=tJ.int(100,1e3),this.rnArray=[],this.path,this.marginVar=tJ.int(1,30),this.applyMargin=0!=tJ.int(0,2),this.makePolygon=function(){this.path=[[]];let t=parseInt(this.startX),e=parseInt(this.startY);this.path[0].push({X:t,Y:e});let i=0!=Math.round(this.rnArray[0]);for(let n=0;ntV-t0?t=tV-t0-this.marginVar+parseInt(this.rnArray[2*i]*this.marginVar*2):ttG-t0&&(t=tG-t0-this.marginVar+parseInt(this.rnArray[2*i+1]*this.marginVar*2)),t=tG?tV:tG,e=t/en;for(let i=0;i<=t/e;i++)for(let r=0;r<=t/e;r++)n=ed(n,[[{X:i*e,Y:r*e},{X:i+e,Y:r},{X:i+e,Y:r+e},{X:i,Y:r+e}]],"union")}if(ee||t){let t=[[]];for(let e=0;e255?255:r+h,o=o+h>255?255:o+h,s=s+h>255?255:s+h):(r=r-h<0?0:r-h,o=o-h<0?0:o-h,s=s-h<0?0:s-h);let u=`rgb(${r},${o},${s})`;e=`background: linear-gradient(${i}deg, ${l} 0%, ${u} 100%)`}}else e=1==p?"background-color: white":2==p?"background-color: black":`background-image: linear-gradient(45deg, #cbcccb 25%, transparent 25%), linear-gradient(-45deg, #cbcccb 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #cbcccb 75%), linear-gradient(-45deg, transparent 75%, #cbcccb 75%);
background-size: 8px 8px;
- background-position: 0 0, 0 4px, 4px -4px, -4px 0px;`;document.getElementsByTagName("svg")[0].style=e}function ey(){tV=window.innerWidth,tG=window.innerHeight,t0=parseInt((tK=tV>=tG?tV:tG)/tQ),ef()}window.onload=function(){document.querySelector("svg").onclick=function(){tU++,ec(tj)},ec(tj),ef()},window.onresize=function(){clearTimeout(t),t=setTimeout(ey,500)}}();