0x51664b04…8e63sent to0x14578924…b707·#16,723,583·view on Etherscan
Pe=[0,775.903,20.023,724.176,58.401,637.409,98.448,565.658,160.186,473.885,161.855,487.234,146.838,525.612,136.826,570.664,128.483,627.397,123.477,679.124,123.477,720.839,126.814,754.211,135.157,755.88,151.843,740.862,165.192,714.165,186.884,659.1,216.919,594.025,250.291,533.955,287.001,475.553,318.704,427.164,358.751,367.094,390.454,318.704,412.146,292.007,418.821,302.018,393.792,350.408,377.106,402.135,355.414,470.548,327.047,568.996,293.675,695.81,256.966,829.299,230.268,952.776,208.576,1059.567,193.559,1161.352,181.878,1256.462,190.221,1328.213],Re=[589.019,103.454,590.687,118.471,580.676,163.524,552.309,250.291,527.28,323.71,498.914,410.478,477.222,490.571,450.524,594.025,430.501,699.147,418.821,769.229,412.146,814.281,415.484,829.299,427.164,824.293,445.519,785.915,478.891,714.165,510.594,647.42,545.635,582.344,585.682,503.92,635.74,410.478,687.467,323.71,730.851,258.634,742.531,238.611,752.543,248.623,712.496,340.396,645.752,468.879,604.036,545.635,574.001,612.379,550.641,679.124,537.292,714.165,532.286,735.856,553.978,745.868,575.67,734.188,610.711,710.827,640.746,700.816,667.443,690.804,677.455,664.106,694.141,667.443,697.478,692.473,694.141,730.851,704.153,762.554,734.188,790.921,750.874,819.287,769.229,887.7,779.24,977.805,782.577,1057.898,780.909,1144.666,769.229,1243.113,744.199,1329.881,712.496,1396.625,687.467,1426.66,667.443,1436.672,644.083,1426.66,629.065,1396.625,627.397,1344.899,632.403,1261.468,645.752,1183.044,662.438,1097.945,687.467,1011.177,715.833,916.066,740.862,850.99,780.909,732.519,817.618,635.74,862.671,528.949,907.723,427.164,946.101,342.065,986.148,258.634,1021.189,196.896,1052.892,143.5,1064.572,126.814,1072.915,130.151,1066.241,145.169,1017.851,213.582,971.13,303.687,934.421,390.454,902.717,472.216,881.025,542.298,862.671,622.391,859.333,670.781,861.002,715.833,872.682,745.868,886.031,755.88,902.717,752.543,924.409,735.856,951.107,700.816,979.473,660.769,994.491,629.065,1004.502,612.379,1016.183,620.722,1001.165,657.432,989.485,700.816,994.491,727.513,1021.189,749.205,1049.555,734.188,1062.904,715.833,1056.229,694.141,1036.206,689.135,1036.206,675.787,1069.578,684.13,1096.276,680.792,1121.305,662.438,1136.323,644.083,1148.003,647.42,1154.677,659.1,1151.34,689.135,1149.671,719.17,1159.683,735.856,1173.032,737.525,1188.049,725.845,1201.398,665.775,1226.427,575.67,1256.462,478.891,1291.503,373.768,1326.544,278.658,1356.579,205.239,1379.939,140.163,1409.974,75.087,1433.335,25.029,1448.352,0,1456.695,3.337,1451.69,23.361,1429.998,65.076,1386.614,165.192,1356.579,251.96,1331.55,323.71,1311.526,382.111,1294.84,452.193,1281.491,532.286,1276.486,614.048,1276.486,665.775,1278.154,697.478,1289.835,725.845,1303.183,739.194,1319.869,739.194,1333.218,727.513,1349.904,697.478,1371.596,660.769,1398.294,625.728,1424.992,600.699,1441.678,589.019,1448.352,597.362,1443.347,615.717,1436.672,649.089,1435.003,674.118,1441.678,697.478,1456.695,709.159,1478.387,710.827,1511.759,702.484,1538.457,697.478,1561.818,704.153,1576.835,712.496,1591.853,719.17,1605.202,717.502,1620.219,712.496],Ce=[1563.486,590.687,1605.202,580.676,1653.591,577.339,1695.306,580.676,1742.027,584.013,1787.08,587.35,1838.807,587.35,1887.196,582.344,1923.906,577.339,1948.935,570.664],Ee="0xd41b2ae5027c6dfbf",Be="922a90723773ff2d7da06c",Le="9a37c3d6faea34c6579e360d3";var Se,Te;function ke(e){var t=e+=1831565813;return t=Math.imul(t^t>>>15,1|t),(((t^=t+Math.imul(t^t>>>7,61|t))^t>>>14)>>>0)/4294967296}const Me=new Proxy(new URLSearchParams(window.location.search),{get:(e,t)=>e.get(t)});let Ae;function Ie(){if("oilBorder"==Ae)for(let e=te.length-1;e>=Math.max(0,te.length-100);e--)if(te[e].length>2&&te[e].length<16){let t=nt(te[e]);if(qe(t[0],-.95,.95)&&qe(t[1],-1.4,1.4)){let e=Qt(4,.004,tr(t));new o(e,I,Ot("tiny"))}}}let We=-1;function Ne(e,t,r,n=!0,o=0,i=null){null==i&&(i=O);let l,s=We>0?We:ar(.2,.6),a="dome"==e?.5*s:"pillar"==e?0:ar(.4,.8),h=n?t.y-.5*a-r[3][1]:ar(.5,.9);switch(e){case"dome":l=function(e,t,r,n,o,i,l,s){let a=[[.5*-t+e.x,.5*-t-n+e.y],[.5*-t+e.x,-t+e.y]],h=fr();for(let r=F-F/12;r>0;r-=F/12)h.set(.5*t,0),h.rotateAround(O,r),h.x+=e.x,h.y+=e.y-.5*t,a.push([h.x,h.y]);return a.push([.5*t+e.x,-t+e.y],[.5*t+e.x,.5*-t-n+e.y]),Fe(a,o,i,l,s)}(t,s,0,h,o,i,n,r);break;case"crown":l=function(e,t,r,n,o,i,l,s){let a=[[.5*-t+e.x,-r+e.y],[0+e.x,0+e.y],[.5*t+e.x,-r+e.y]];return Fe(a,o,i,l,s)}(t,s,a,0,o,i,n,r);break;case"trough":l=function(e,t,r,n,o,i,l,s){let a=[[.5*-t+e.x,e.y],[e.x,-r+e.y],[.5*t+e.x,e.y]];return Fe(a,o,i,l,s)}(t,s,a,0,o,i,n,r);break;case"m":l=function(e,t,r,n,o,i,l,s){let a=[[.5*-t+e.x,-r+e.y],[.5*-t+e.x,e.y],[e.x,.75*(-r+e.y)],[.5*t+e.x,e.y],[.5*t+e.x,-r+e.y]];ar()<.5?a.shift():a.pop();return Fe(a,o,i,l,s)}(t,s,a,0,o,i,n,r);break;case"x":l=function(e,t,r,n,o,i,l,s){let a=[[.5*-t+e.x,-r+e.y],[0+e.x,0+e.y],[.5*t+e.x,-r+e.y]],h=Fe(a,o,i,l,s),u=[[.5*-t+e.x,r+e.y],[0+e.x,0+e.y],[.5*t+e.x,r+e.y]],c=Fe(u,o,i,l,s),f=kt([h,c]);null!=f&&f.length>0&&(h=f[0]);return h}(t,s,a,0,o,i,n,r);break;case"obelisk":l=function(e,t,r,n,o,i,l,s){let a=[[.5*-t+e.x,-r-n+e.y],[.5*-t+e.x,-r+e.y],[0+e.x,0+e.y],[.5*t+e.x,-r+e.y],[.5*t+e.x,-r-n+e.y]];return Fe(a,o,i,l,s)}(t,s,a,h,o,i,n,r);break;case"yArc":l=function(e,t,r,n,o,i,l,s){let a=e.clone().add(fr(.5*-t,0)),h=e.clone().add(fr(.5*t,0)),u=e.clone(),c=e.clone().add(fr(0,-r)),f=c.clone().lerp(a,.5),d=c.clone().lerp(h,.5),p=u.clone().lerp(f,.5),g=u.clone().lerp(d,.5),y=gr(c.x,c.y,u.x,u.y),v=gr(u.x,u.y,a.x,a.y),x=(y+v)*ar(.25,.75),b=Je(c,p,a,x),m=Je(c,g,h,x),w=[b,m],P=null;if(n>0){let e=_e([[[c.x,c.y],[c.x,c.y-n]]],.012);null!=e&&e.length>0&&(P=e[0])}let R=_e(w,.012);R=kt(R);let C=[[100,100],[101,101]];null!=R&&R.length>0&&(C=R[0]);St(C,o,i,!1);let E=C;if(null!=P){St(P,o,i,!1);let e=kt([C,P]);null!=e&&e.length>0&&(E=e[0])}return E}(t,s,a,h,o,i);break;case"pillar":l=function(e,t,r,n,o,i,l,s){let a=[[e.x,e.y],[e.x,.5*-n+e.y],[e.x,-n+e.y]],h=Fe(a,o,i,l,s,1);return h}(t,0,0,h,o,i,n,r)}return l}function Fe(e,t,r,n,o,i=0){let l=e;if(St(l,t,r,!1,!1),n){let e=Oe(l[0],l[1],o),t=Oe(l[l.length-1],l[l.length-2],o);null==e||0!=i&&-1!=i||l.unshift(e),null==t||0!=i&&1!=i||l.push(t)}let s=_e([l],.012),a=[[100,100],[101,101]];return null!=s&&s.length>0&&(a=s[0]),a}function Oe(e,t,r){let n=tr(e),o=tr(t),i=n.clone().sub(o).normalize().multiplyScalar(5).add(n);return function(e,t,r=!1){Nt(t);let n=[];for(let o=0;o<t.length-1;o++){let i=t[o],l=t[o+1],s=Kt(e[0],e[1],i,l);if(null!=s&&null!=s&&(n.push(s),r))break}return n}([rr(n),rr(i)],r,!0)[0]}function _e(e,t){let r=[];for(let n=0;n<e.length;n++){let o=t;try{Tt(e[n]);let t=u.data(e[n]).arcSegments(3).offsetLines(o);t.length;let i=0;for(let e=1;e<t.length;e++)t[e].length>t[i].length&&(i=e);let l=Mr(t[i],.001);Tt(l),r.push(l)}catch(e){}}return r}let De=.01;function qe(e,t,r){return e<=r&&e>=t}function Ve(e,t,r){let n,o,i,l,s,a,h,u,c=new dt(0),f=e.bL,d=e.tR,p=e.center,g=d.x-f.x,y=d.y-f.y;switch(Pt(e.poly,c,0,"bg"),t){case"qCircle":n=e.tL,a=Qt(32,g-.001,n,O,0,O,_,r,p),Pt(a,c,0,"obj");break;case"tri":o=rr(e.tL.clone().rotateAround(p,r)),i=rr(e.tR.clone().rotateAround(p,r)),l=rr(e.bR.clone().rotateAround(p,r)),s=rr(e.tL.clone().rotateAround(p,r)),a=[o,i,l,s],Pt(a,c,0,"obj");break;case"tallTri":o=rr(e.tL.clone().rotateAround(p,r)),i=rr(e.tR.clone().rotateAround(p,r)),l=rr(e.bR.clone().lerp(f,.5).rotateAround(p,r)),s=rr(e.tL.clone().rotateAround(p,r)),a=[o,i,l,s],Pt(a,c,0,"obj");break;case"halfCircles":a=Qt(8,.5*g-.001,p.clone().add(fr(.5*g,0)),O,0,O,_),h=Qt(8,.5*g-.001,p.clone().add(fr(-.5*g,0)),O,0,O,_),St(a,r,p,!1),St(h,r,p,!1),Pt(a,c,0,"obj"),Pt(h,c,0,"obj");break;case"diagonal":a=Jt(fr(2*g,.04),p,r+.25*F),Pt(a,c,0,"obj");break;case"straight":a=Jt(fr(2*g,.04),p,r),Pt(a,c,0,"obj");break;case"x":a=Jt(fr(2*g,.04),p,r+.25*F),h=Jt(fr(2*g,.04),p,r+.75*F);let t=kt([a,h]);t.length>0?Pt(t[0],c,0,"obj"):(Pt(a,c,0,"obj"),Pt(h,c,0,"obj"));break;case"plus":a=Jt(fr(2*g,.04),p,r),h=Jt(fr(2*g,.04),p,r+.5*F);let d=kt([a,h]);d.length>0?Pt(d[0],c,0,"obj"):(Pt(a,c,0,"obj"),Pt(h,c,0,"obj"));break;case"lines":let v=p.clone().sub(fr(.5*g,0)),x=fr(g/4,0);a=Jt(fr(g/8,y),v.add(x),0),h=Jt(fr(g/8,y),v.add(x),0),u=Jt(fr(g/8,y),v.add(x),0),St(a,r,p,!1),St(h,r,p,!1),St(u,r,p,!1),Pt(a,c,0,"obj"),Pt(h,c,0,"obj"),Pt(u,c,0,"obj");break;case"circle":a=Qt(24,.5*g-.001,p,O,0,O,_),Pt(a,c,0,"obj")}return c.externallyMaskWithPoly(e.poly),c.allExistingPolys}function ze(e){let t=[];for(let r=0;r<e.edges.length;r++)t.push([...e.edges[r]]);return{face:[...e.face],edges:t}}function je(e){let t=null;return t=ar()<.6?function(e){let t=[],r=sr(0,6,.85),n=sr(0,7,.85);0==r&&0==n&&(ar()>.5?r++:n++);(1==r&&0==n||1==n&&0==r)&&ar()>.25&&(ar()>.5?r++:n++);let o=.0015,i=e+o,l=gt(1),s=l[1].x-l[3].x,a=l[1].y-l[3].y,h=ar(-.25,.25)*F,u=ar(-.25,.25)*F;ar()<.15&&(h=0);ar()<.15&&(u=0);let c=s/(r+1),f=!1,d=5;1!=subIdInt&&subIdInt!=ne||(d=.5);let p=.1;for(let e=0;e<r;e++){if(!(ar()<p&&r>1&&!f)){let r=fr(c*(e+1)-.5*s+ar(.4*-c,.4*c),0),n=$t(fr(o,9),r,h,d,_,0,0,r),l=$t(fr(i,9),r,h,d,_,0,0,r);t.push({skinny:n,thick:l,slope:h,pos:r})}}let g=a/(n+1),y=!1,v=1!=subIdInt&&subIdInt!=ne&&ar()<.5;for(let e=0;e<n;e++){if(!(ar()<p&&n>1&&!y)){let r=g*(e+1)-.5*a;v&&1!=subIdInt&&subIdInt!=ne&&(r+=ar(.4*-g,.4*g));let n=fr(0,r),l=$t(fr(9,o),n,u,d,_,0,0,n),s=$t(fr(9,i),n,u,d,_,0,0,n);t.push({skinny:l,thick:s,slope:u,pos:n})}}return t}(e):function(e){let t=[],r=sr(3,10),n=.0015,o=e+n,i=gt(1),l=i[1].x-i[3].x,s=i[1].y-i[3].y,a=fr(ar(-1e3,1e3),ar(-1e3,1e3));for(let e=0;e<r;e++){let e=fr(ar(.5*-l*.8,.5*l*.8),ar(.5*-s*.75,.5*s*.75)),r=2*yr(e,.1,1,a)*F,i=fr(1,0).rotateAround(O,r).normalize(),h=5;1!=subIdInt&&subIdInt!=ne||(h=.5);let u=$t(fr(n,10),e,r,h,_,0,O,O),c=$t(fr(o,10),e,r,h,_,0,O,O),f=!1;for(let r=0;r<t.length;r++){let n=t[r].slope.distanceTo(i),o=t[r].pos.distanceTo(e);n<.15&&o<.25&&(f=!0)}f||t.push({skinny:u,thick:c,slope:i,pos:e})}return t}(e),t}function Ue(e,t,r,n){let o=er(new t3.EllipseCurve(e.x,e.y,t,t,0,1.9*Math.PI,!1,n+F).getPoints(Math.floor(500*t))),i=null;try{let e=u.data(o).arcSegments(3).offsetLines(r);e.length;let t=Mr(e[0],.002);Tt(t),i=t}catch(e){}return i}function He(e,t,r){let n=[],o=0;for(let i=0;i<e.length;i++){let l={ramp:null,roundabout:null},s=ar(t,r);try{let t=u.data(e[i]).arcSegments(3).offsetLines(s);if(t.length>1)continue;let r=Mr(t[0],.001);if(Tt(r),l.ramp=r,ar()<.1&&o<2){let t=Math.floor(e[i].length/2),r=ar(.07,.14),n=tr(e[i][t]),a=tr(e[i][t+1]),h=tr(e[i][t-1]),u=a.clone().sub(h);u.set(u.y,-u.x),u.normalize();let c=Math.atan2(u.y,u.x);u.multiplyScalar(r+.1*s),n.add(u);let f=null;f=ar()<.2?Ue(n,r,s,c):Qt(24,r,n,O,0,O),null!=f&&(o++,l.roundabout=f)}n.push(l)}catch(e){}}return n}function Xe(e,t,r){var n=fr();return n.x=e[0]+r*(t[0]-e[0]),n.y=e[1]+r*(t[1]-e[1]),n}function Ye(e){Nt(e);let t=[];for(let r=0;r<e.length-1;r++){let n=r,o=r+1,i=r+2;i>=e.length-1&&(i-=e.length-1),o>=e.length-1&&(o-=e.length-1);let l=e[n],s=e[o],a=e[i],h=gr(l[0],l[1],s[0],s[1]),u=gr(s[0],s[1],a[0],a[1]);if(h<.1||u<.1)continue;let c=tr(a).clone().sub(tr(s)),f=tr(l).clone().sub(tr(s)),d=f.clone().normalize(),p=c.clone().normalize(),g=rr(d),y=rr(p),v=fr(),x=fr();c.multiplyScalar(.5),f.multiplyScalar(.5);let b=h+u,m=ar(),w=sr(0,4,5);for(let e=0;e<w;e++){let r,n=.2*(e+1);v.set(d.x,d.y),v.multiplyScalar(n).add(tr(s)).add(f),x.set(p.x,p.y),x.multiplyScalar(n).add(tr(s)).add(c),g=rr(v),y=rr(x);let o=ar()<.05,i=ar()<.05;if(m>.5||i){r=Ge(v,Xe(g,s,ar(.3,.7)),Xe(s,y,ar(.3,.7)),x,b)}else if(m<=.5||o){r=Je(v,tr(s),x,b)}t.push(r)}}return t}function Je(e,t,r,n){const o=new t3.QuadraticBezierCurve(e,t,r),i=Math.round(n/.02);let l=er(o.getPoints(i));return 1!=subIdInt&&subIdInt!=ne&&(l=Mr(l,.001)),l}function Ge(e,t,r,n,o){const i=new t3.CubicBezierCurve(e,t,r,n),l=Math.round(o/.04);let s=er(i.getPoints(l));return 1!=subIdInt&&subIdInt!=ne&&(s=Mr(s,.001)),s}function Qe(e,t){for(let r=0;r<e.length;r++){let n=tr(e[r]),o=2*yr(n,1,1,O)*F,i=fr(.15*t,0).rotateAround(O,o);n.add(i),e[r][0]=n.x,e[r][1]=n.y}}function $e(e,t,r,n,o){let i=new dt(0),l=r,s=Zt(e.verts),a=2*Math.max(e.ww,e.hh),h=2*yr(e.center,.05,1,O)*F,u=Jt(fr(a,t),e.center,h);i.addPoly(s),i.slicePolysWithPoly(Zt(u));for(let e=0;e<r;e++){let r;if(r=t>0?Ft(s,t):[s],null==r||r.length<=0)break;s=Mr(r[0],.001);let n="translation";e==l-1&&(n="lastTranslation"),Pt(s,i,0,n),i.slicePolysWithPoly(Zt(u))}return i.externallyMaskWithPoly(e.verts),i.allExistingPolys}function Ke(e,t,r,n,o,i,l,s){let a=new dt(0),h=n,u=Zt(e.verts);a.addPoly(u);Math.max(e.ww,e.hh);for(let n=0;n<h;n++){let i=t;l&&(i*=ar(.75,1.5));let u=fr(i*(n+1),0).rotateAround(O,r),d=Zt(e.verts);if(s){Qe(d,dr().clamp((n+1)/6,0,1))}null!=o&&St(d,o*F*(n+1),e.avgCenter,!0),Lt(d,u);let p=Mt(d),g={bL:p[3],tR:p[1]};if(c=e,(f=g).bL.x>c.tR.x||f.tR.x<c.bL.x||f.tR.y<c.bL.y||f.bL.y>c.tR.y)break;let y="translation";n==h-1&&(y="lastTranslation"),Pt(d,a,0,y)}var c,f;return a.externallyMaskWithPoly(e.verts),a.allExistingPolys}function Ze(e,t,r,n,o,i,l,s,a){let h,u,c=Zt(e.verts);if(h=null!=e.center.x?e.avgCenter:fr(e.center[0],e.center[1]),u=n>0?Ft(c,n):[c],null==u||u.length<=0)return{allExistingPolys:[e]};let f=u[0];if(Wt(f)<P)return{allExistingPolys:[e]};let d=yr(h,.05,2*F,O),p=F-d-.5*F,g=at(Bt(c,2,e.avgCenter,!0,!0),d);Nt(g);let y=tr(g[0]),v=(tr(g[1]),tr(g[2])),x=tr(g[3]),b=1*gr(x.x,x.y,v.x,v.y),m=1*gr(x.x,x.y,y.x,y.y),w=Math.floor(m/t);0==w&&(w=1);let R=b/1,C=fr();C.subVectors(v,x);let E=C.clone().normalize().multiplyScalar(.5*R),B=.5*(m-(w-1)*t);0==B&&(B=.5*t);let L=fr();L.subVectors(y,x).normalize().multiplyScalar(t);let S=fr();S.subVectors(y,x).normalize(),S.multiplyScalar(B);let T=new dt(0);"internal"==a?T.addPolyNoIntersection(f,wt(f,0,"subBG")):T.addPolyNoIntersection(c,wt(c,0,"subBG"));let k=x.clone();if(k.add(S),"solid"!=a)for(let e=0;e<w;e++){for(let e=0;e<1;e++)if(ar()<o){const e=k.clone().add(E),t=$t(fr(1*R,r),e,-d,.05,l,s,O,O,i);Nt(t),T.addPolyNoIntersection(t,wt(t,0,"subLine"))}k.add(L)}let M=new dt;if("internal"==a){T.externallyMaskWithPoly(f),Pt(c,M,0,"subBorder"),Pt(Jt(fr(2*R,.05),e.avgCenter,p),M,0,"subBorder");for(let e=0;e<T.allExistingPolys.length;e++){let t=T.allExistingPolys[e];M.addPolyNoIntersection(t.verts,wt(t.verts,0,t.vars.type))}M.externallyMaskWithPoly(e.verts)}else if("external"==a){T.externallyMaskWithPoly(c);for(let e=0;e<T.allExistingPolys.length;e++){let t=T.allExistingPolys[e];M.addPolyNoIntersection(t.verts,wt(t.verts,0,t.vars.type))}M.addPolyNoIntersection(f,wt(f,0,"subLine")),M.externallyMaskWithPoly(e.verts)}else if("solid"==a){Pt(c,M,0,"subBorder"),Pt(Jt(fr(1.5*R,.04),e.avgCenter,p),M,0,"subBorder"),Pt(f,M,0,"subSolid"),M.externallyMaskWithPoly(e.verts)}return M}function et(e){let t=.015;"inverted"==Ae&&(t=.04);let r=[],n=Ft(e.verts,t);if(null==n)return[];if(e.area>.03)for(let t=0;t<n.length;t++){if(n[t].length<3)continue;e.verts=n[t];let o=rt(e);for(let e=0;e<o.length;e++){let t=o[e];r.push([...t])}}return r}function tt(e,t=null,r=null){let n=At(e),o=(e.area,yt(n[3],n[1],.3));o.length<1&&o.push(rr(e.center));let i=new dt(.5);for(let e=0;e<o.length;e++){Pt(Qt(7,.405,fr(o[e][0],o[e][1]),fr(1,1),.01,O),i,0,"subzone")}return i.externallyMaskWithPoly(e.verts),i.allExistingPolys}function rt(e,t=null,r=null){let n=At(e),o=(e.area,yt(n[3],n[1],.015)),i=new dt(0);for(let e=0;e<o.length;e++){let t=Qt(3,.0015,fr(o[e][0],o[e][1]),fr(1,1),0,O);i.addPolyNoIntersection(t,null)}return i.externallyMaskWithPoly(e.verts,1,null,!0),i.getPlainPolys()}function nt(e){let t=e[0][0]==e[e.length-1][0]&&e[0][1]==e[e.length-1][1]?1:0,r=[0,0];for(let n=0;n<e.length-t;n++)r[0]+=e[n][0],r[1]+=e[n][1];return r[0]/=e.length-t,r[1]/=e.length-t,r}function ot(){return"lines"!=Ae&&"offsetLines"!=Ae}let it=[];function lt(e,t=null){let r;if(null==t){let e=ar();r=e<.01?"middle":e<.13?"LoR":e<.25?"ToB":e<.45?"TaB":e<.675?"LaR":e<.95?"LaRaTaB":"noise"}else r=t;let n,o,i,l=e[1].x,s=e[1].y,a=l*(ar()<.5?-1.05:1.05),h=s*(ar()<.5?-1.05:1.05),u=null,c=null,f=null,d=null,p=1;if("noise"!=r)if("LaRaTaB"!=r){if("middle"==r)if(p=1.5,ar()>.5){o=fr(ar(-.2,.2),ar(.5*e[3].y,.5*e[0].y)),n=1,i=fr(ar(2,3),ar(.2,.4))}else{let t=ar(-.2,.2);o=fr(ar(.5*e[3].x,.5*e[2].x),t),n=1,i=fr(ar(.1,.2),ar(2,3))}else if("ToB"==r||"TaB"==r){o=fr(ar(e[3].x,e[2].x),h),n=1,i=fr(ar(1,3),.6)}else if("LoR"==r||"LaR"==r){o=fr(a,ar(e[3].y,e[0].y)),n=1,i=fr(.5,ar(1,3))}let t=ar(.02,.1)*p;if(u=Qt(24,n,o,_,t,O,i),"LaR"==r||"TaB"==r||"LaRaTaB"==r){if("LaR"==r){o=fr(-1*a,ar(e[3].y,e[0].y)),n=1,i=fr(.5,ar(1,3))}else if("TaB"==r){o=fr(ar(e[3].x,e[2].x),-1*h),n=1,i=fr(ar(1,3),.6)}c=Qt(24,n,o,_,t,O,i)}}else{let t=ar(e[3].x,e[2].x),r=h;o=fr(t,r),n=1,i=fr(ar(1,3),.4);let l=ar(.02,.1);u=Qt(24,n,o,_,l,O,i),t=ar(e[3].x,e[2].x),r=-1*h,o=fr(t,r),n=1,i=fr(ar(1,3),.4),c=Qt(24,n,o,_,l,O,i),t=a,r=ar(e[3].y,e[0].y),o=fr(t,r),i=fr(.4,ar(1,4)),f=Qt(24,n,o,_,l,O,i),t=-1*a,r=ar(e[3].y,e[0].y),o=fr(t,r),n=1,i=fr(.4,ar(1,4)),d=Qt(24,n,o,_,l,O,i)}else u="noise",c="noise",f="noise",d="noise";null!=u&&it.push(u),null!=c&&it.push(c),null!=f&&it.push(f),null!=d&&it.push(d)}function st(e){if("noise"==it[0]){return yr(e,.5,1,O)>.5}for(let t=0;t<it.length;t++)if(It([e.x,e.y],it[t]))return!0;return!1}function at(e,t){let r=nt(e),n=er(Mt(St(e,t,r,!0,!0)));return St(n,-t,r,!0,!1),Tt(n),n}function ht(e){let t=[];for(let r=0;r<e.length;r++)t.push(fr(e[r].x,e[r].y));return t}class ut{constructor(e,t,r){this.rawVerts=ht(e);let n=Mt(this.rawVerts,!0);this.tL=n[0],this.tR=n[1],this.bR=n[2],this.bL=n[3],this.ww=n[1].x-n[3].x,this.hh=n[1].y-n[3].y,this.transform=t,this.rOffset=O,this.center=fr(dr().lerp(this.bL.x,this.tR.x,.5),dr().lerp(this.bL.y,this.tR.y,.5)),this.tArr=ht(e),this.utArr=ht(e);let o=t.ls,i=t.lo;null!=o&&1!=o&&this.setLocalScaleOfPoints(this.tArr,this.center,o);let l=t.lr;if(null!=l&&r>0)if("noise"==l){let e=yr(this.center,.035,2*F,O);this.setLocalRotOfPoints(this.tArr,this.center,e)}else this.setLocalRotOfPoints(this.tArr,this.center,l);let s=t.r;0!=s&&(this.rotatePoints(this.tArr,s),this.rotatePoints(this.utArr,s));let a=t.s;this.scalePoints(this.tArr,a),this.scalePoints(this.utArr,a);let h=t.t;this.translatePoints(this.tArr,h),this.translatePoints(this.utArr,h),null!=i&&0!=i&&(this.tArr=this.offsetPoints(er(this.tArr),i)),this.tArr.length>3&&(this.tTL=this.tArr[0],this.tTR=this.tArr[1],this.tBR=this.tArr[2],this.tBL=this.tArr[3],this.utTL=this.utArr[0],this.utTR=this.utArr[1],this.utBR=this.utArr[2],this.utBL=this.utArr[3],this.tCenter=fr(dr().lerp(this.tBL.x,this.tTR.x,.5),dr().lerp(this.tBL.y,this.tTR.y,.5))),this.lowestPoint=this.getLowestPoint(),this.poly=er(this.tArr),Tt(this.poly),Nt(this.poly),this.tArea=Wt(this.poly),this.unscaledPoly=er(this.utArr),Tt(this.unscaledPoly),Nt(this.poly)}addNoiseToPoints(e,t,r){for(let r=0;r<e.length;r++){let n=yr(e[r],.1,2*F,bt),o=(yr(e[r],.01,t,xt),fr(t,0));o.rotateAround(O,n),e[r].add(o)}}offsetPoints(e,t){let r=Ft(e,t);if(null!=r){let t=0;for(let e=0;e<r.length;e++)Wt(r[e])>Wt(r[t])&&(t=e);if(r[t].length>2){e=Mr(r[t],.005)}}return lr(e)}setLocalScaleOfPoints(e,t,r){for(let n=0;n<e.length;n++)e[n].sub(t),e[n].multiplyScalar(r),e[n].add(t)}setLocalRotOfPoints(e,t,r){for(let n=0;n<e.length;n++)e[n].sub(t),e[n].rotateAround(O,r),e[n].add(t)}translatePoints(e,t){for(let r=0;r<e.length;r++)e[r].add(t)}rotatePoints(e,t){for(let r=0;r<e.length;r++)e[r].rotateAround(O,t)}scalePoints(e,t){for(let r=0;r<e.length;r++)e[r].multiply(t)}getLowestPoint(){let e=this.tArr[0];for(let t=1;t<this.tArr.length;t++)this.tArr[t].y<e.y&&(e=this.tArr[t]);return e}}function ct(e,t,r,n,o,i,l=.75,s=1){let a=o,h=i;if(r<s&&(a=1,h=1),r<=n){let u=ar()<a,c=ar()<h,f=r+1;if(u&&c){let a=new ut([e.tL,fr(e.center.x,e.tR.y),e.center,fr(e.bL.x,e.center.y)],e.transform,r),h=new ut([fr(e.center.x,e.tL.y),e.tR,fr(e.bR.x,e.center.y),e.center],e.transform,r),u=new ut([e.center,fr(e.tR.x,e.center.y),e.bR,fr(e.center.x,e.bL.y)],e.transform,r),c=new ut([fr(e.tL.x,e.center.y),e.center,fr(e.center.x,e.bR.y),e.bL],e.transform,r);ct(a,t,f,n,o*l,i*l,l,s),ct(h,t,f,n,o*l,i*l,l,s),ct(u,t,f,n,o*l,i*l,l,s),ct(c,t,f,n,o*l,i*l,l,s)}else if(c){let a=new ut([e.tL,fr(e.center.x,e.tR.y),fr(e.center.x,e.bR.y),e.bL],e.transform,r),h=new ut([fr(e.center.x,e.tL.y),e.tR,e.bR,fr(e.center.x,e.bL.y)],e.transform,r);ct(a,t,f,n,o*l,i*l,l,s),ct(h,t,f,n,o*l,i*l,l,s)}else if(u){let a=new ut([e.tL,e.tR,fr(e.bR.x,e.center.y),fr(e.bL.x,e.center.y)],e.transform,r),h=new ut([fr(e.tL.x,e.center.y),fr(e.tR.x,e.center.y),e.bR,e.bL],e.transform,r);ct(a,t,f,n,o*l,i*l,l,s),ct(h,t,f,n,o*l,i*l,l,s)}else t.push(e)}else t.push(e)}class ft{constructor(e,t,r=null,n=!1){this.verts,this.verts=n?e:Zt(e);let o=t;null==o&&(o={colors:null,tier:0,type:null}),this.vars=o,this.verts.length>8&&Mr(this.verts,.001),Tt(this.verts),Nt(this.verts),this.area=null==r?Wt(this.verts):r,this.center=fr(),this.tL,this.tR,this.bR,this.bL,this.avgCenter,this.ww,this.hh,this.calculateBounds(),this.small=this.area<Z,this.thinAndLong=this.small&&(this.ww>.12||this.hh>.12),null==this.vars.colors&&(this.vars.colors=x.getNColor(this.verts,0,this.center))}calculateBounds(){var e=1e3,t=-1e3,r=1e3,n=-1e3;this.avgCenter=fr();for(let i=0;i<this.verts.length;i++){var o=this.verts[i];0!=i&&(this.avgCenter.x+=o[0],this.avgCenter.y+=o[1]),e=Math.min(o[0],e),t=Math.max(o[0],t),r=Math.min(o[1],r),n=Math.max(o[1],n)}this.avgCenter.divideScalar(this.verts.length-1),this.tL=fr(e,n),this.tR=fr(t,n),this.bR=fr(t,r),this.bL=fr(e,r),this.ww=this.tR.x-this.bL.x,this.hh=this.tR.y-this.bL.y,this.center=this.bL.clone().lerp(this.tR,.5)}}class dt{constructor(e){this.allExistingPolys=[],this.likelihood=e}recalculateAllVars(){for(let e=0;e<this.allExistingPolys.length;e++)this.allExistingPolys[e].calculateBounds(),this.allExistingPolys[e].vars.colors=x.getNColor(this.allExistingPolys[e].verts,0,this.allExistingPolys[e].center)}addPolyNoIntersection(e,t){let r=new ft(e,t);this.allExistingPolys.push(r)}addPoly(e,t,r=!0,n=!1){let o=new ft(e,t);if(0==this.allExistingPolys.length)return void(r&&this.allExistingPolys.push(o));let i=[],l=[];for(let e=0;e<this.allExistingPolys.length;e++)this.bbsTouching(o,this.allExistingPolys[e])?l.push(this.allExistingPolys[e]):i.push(this.allExistingPolys[e]);let s=[],a=!1;for(let e=0;e<l.length;e++){if(s.length>1e3){s.push(l[e]);continue}let t,r=Ct(o.verts),n=Ct(l[e].verts);try{t=PolyBool.intersect(r,n)}catch(t){a=!0,s.push(l[e]);continue}if(t.regions.length>0){let t=PolyBool.difference(n,r);for(let r=0;r<t.regions.length;r++){let n=t.regions[r],o=Wt(n);n.length>0&&o>P?s.push(new ft(n,l[e].vars,o,!0)):o<P&&o>ee&&te.push(n)}}else s.push(l[e])}let h=[];r&&h.push(o);let u=[];if(r&&(ar()<this.likelihood||n)&&!a)for(let e=0;e<l.length;e++){let n=[];for(let o=0;o<h.length&&!(n.length>1e3);o++){let i=Ct(h[o].verts),s=Ct(l[e].verts),a=null;try{a=PolyBool.intersect(i,s)}catch(t){u.push(l[e]),n.push(h[o]);continue}if(null!=a&&a.regions.length>0&&r){for(let r=0;r<a.regions.length;r++){let n=a.regions[r],o=Wt(n);if(n.length>0&&o>P){let r=ar()>.5?t:l[e].vars;u.push(new ft(n,r,o,!0))}else o<P&&o>ee&&te.push(n)}let r=PolyBool.difference(i,s);if(r.regions.length>0)for(let e=0;e<r.regions.length;e++){let o=r.regions[e],i=Wt(o);o.length>0&&i>P?n.push(new ft(o,t,i,!0)):i<P&&i>ee&&te.push(o)}}else r&&n.push(h[o])}h=[...n]}this.allExistingPolys=[...s],this.allExistingPolys.push(...i),this.allExistingPolys.push(...u),this.allExistingPolys.push(...h)}getPlainPolys(){let e=[];for(let t=0;t<this.allExistingPolys.length;t++)e.push(this.allExistingPolys[t].verts);return e}bbsTouching(e,t){return!(t.bL.x>e.tR.x||t.tR.x<e.bL.x||t.tR.y<e.bL.y||t.bL.y>e.tR.y)}externallyMaskWithPoly(e,t=1,r=[],n=!1){let o=Ct(e),i=[];for(let e=0;e<this.allExistingPolys.length;e++)if(ar()<=t||!r.includes(this.allExistingPolys[e].vars.type)){let t,r=Ct(this.allExistingPolys[e].verts);try{t=PolyBool.intersect(o,r)}catch(e){continue}if(t.regions.length>0)for(let r=0;r<t.regions.length;r++){let o=t.regions[r],l=Wt(o);n&&l>0||l>P?i.push(new ft(o,this.allExistingPolys[e].vars,l,!0)):l<P&&l>ee&&te.push(o)}}else i.push(this.allExistingPolys[e]);this.allExistingPolys=[...i]}slicePolysWithPoly(e,t=!1,r=0){let n=Ct(e),o=[];for(let e=0;e<this.allExistingPolys.length;e++){let t,i=Ct(this.allExistingPolys[e].verts);try{t=PolyBool.intersect(n,i)}catch(e){continue}if(t.regions.length>0){for(let n=0;n<t.regions.length;n++){let i=t.regions[n],l=Wt(i);if(i.length>0&&l>P){let t=ar()<.9?wt(i,r):this.allExistingPolys[e].vars,n=new ft(i,t,l,!0);o.push(n)}else l<P&&l>ee&&te.push(i)}