0x62e3…923b

All memos sent from and to 0x62e3…923b.

Realities overlap and are reflected in the shards of hope for the proper world of geometric shapes. An endless loop of time, seeming changes, the absorption of one space by another, and futile attempts to make sense of and structure the reflection of the world within oneself. This is the concept of this project. It's a living infinite art. It responds to touches and mouse movements. Press space to pause. Press “s” to save png.
Factors:new Array(5).fill(null).map((()=>i(.8,1))),sSpeeds:new Array(5).fill(null).map((()=>i(10))),M:O})),v=F[0],F=[h[0]],B+=1}for(let t=0;t<W;t+=1)if(E){const{x:t,y:e}=E;let s=[];A[0]&&(s=p(R.points.filter((({x:i,y:s})=>{const h=B%4!=0||e<s;return y=B%2==1?.1*width:.001*width,dist(t,e,i,s)>y&&dist(t,e,i,s)<k&&dist(A[0].x,A[0].y,i,s)>y&&dist(A[0].x,A[0].y,i,s)<k&&h})))),A.length>0&&s.length>0&&R.triangles2.push(new m(Y,[E,A[0],s[0]],{opacity:i(.1,.7),sColor:R.backColor,bColor:R.backColor3,sFactor:i(.8,1),sSpeed:i(10),strokeSpeed:i(50,100),M:O})),E=A[0],A=[s[0]],B+=1}R.circles=new Array(h(1,7)).fill(null).map((()=>{const e=i(.05*width,.3*width),s=i(.05*width,.3*width);return new b(Y,{center:o(R.triangles).points[0],color:o(R.lerpColors),backColor:o(R.backColors),size1:e,size2:s,offsetX:i(.05*-e,.05*e),offsetY:i(.05*-e,.05*e),isColored:t()>.5,isOutside:t()>.7,outsideNoFill:t()>.5,speed1:i(10,30),speed2:i(10,30),diff:t()>.5})}));const L=i(.5*width),M=i(.5*height),X=i(width-L,.5*width),I=i(height-X,.5*height),P=X*i(.02,.05);R.rects=[],R.gridShearX=i(-5,5),R.gridShearY=i(-5,5);for(let t=L;t<X;t+=P)for(let e=M;e<I;e+=P)R.rects.push({x:t,y:e,w:P,h:P});R.ld=[i(5*O,30*O),i(5*O,20*O)],G=i(.1)},M()}function draw(){const{backColor:t,backColorN:e,backColor2:i,backColor3:s,rects:h,ld:o,gridShearX:r,gridShearY:n,circles:p,triangles:a,triangles2:l}=R,{mOffsetX:d,mOffsetY:c}=N,w=width/2+sin(100*G)*(width/2.2),f=height/2+cos(100*G)*(width/2.2),g=constrain(map(w-width/2,-width/2,width/2,-d,d),-d,d),x=constrain(map(f-height/2,-height/2,height/2,-c,c),-c,c),u=constrain(map(mouseX-width/2,-width/2,width/2,-d,d),-d,d),y=constrain(map(mouseY-height/2,-height/2,height/2,-c,c),-c,c),C=g+u,k=x+y;Y.background(255),Y.push(),Y.noStroke(),Y.fill(s),Y.rect(0,0,width,height),Y.pop();const b=map(cos(G*$+1),-1,1,.3,0),S=map(cos(G*z+1),-1,1,.5,1.2),m=map(cos(G*D+1),-1,1,5,0),v={x:width*b-C*m,y:width*b-k*m},E={x:width*(1-b)-C*m,y:width*b-k*m},F={x:width*(1-b)-C*m,y:height-width*b-k*m},A={x:width*b-C*m,y:height-width*b-k*m},W=map(sin(20*G),-1,1,0,v.y),B=map(sin(20*G),-1,1,height,A.y),L=map(sin(20*G),-1,1,0,v.x),M=map(sin(20*G),-1,1,width,E.x);Y.push(),Y.noStroke(),Y.fill(t),Y.beginShape(),Y.vertex(0,0),Y.vertex(L,W),Y.vertex(M,W),Y.vertex(Y.width,0),Y.endShape(CLOSE),Y.pop(),Y.push(),Y.stroke(0),Y.strokeWeight(2*O),Y.line(L,W,M,W),Y.pop(),Y.push(),Y.noStroke(),Y.fill(t),Y.beginShape(),Y.vertex(Y.width,0),Y.vertex(M,W),Y.vertex(M,B),Y.vertex(Y.width,Y.height),Y.endShape(CLOSE),Y.pop(),Y.push(),Y.stroke(0),Y.strokeWeight(2*O),Y.line(M,W,M,B),Y.pop(),Y.push(),Y.noStroke(),Y.fill(t),Y.beginShape(),Y.vertex(Y.width,Y.height),Y.vertex(M,B),Y.vertex(L,B),Y.vertex(0,Y.height),Y.endShape(CLOSE),Y.pop(),Y.push(),Y.stroke(0),Y.strokeWeight(2*O),Y.line(L,B,M,B),Y.pop(),Y.push(),Y.noStroke(),Y.fill(t),Y.beginShape(),Y.vertex(0,Y.height),Y.vertex(L,B),Y.vertex(L,W),Y.vertex(0,0),Y.endShape(CLOSE),Y.pop(),Y.push(),Y.stroke(0),Y.strokeWeight(2*O),Y.line(L,W,L,B),Y.pop(),Y.push(),Y.stroke(0),Y.strokeWeight(2*O),Y.line(0,0,v.x,v.y),Y.line(width,0,E.x,E.y),Y.line(width,height,F.x,F.y),Y.line(0,height,A.x,A.y),Y.fill(t),Y.rect(v.x,v.y,width*(1-2*b),height-width*b*2),Y.pop(),h.forEach((({x:e,y:s,w:h,h:o},p)=>{Y.push(),Y.strokeWeight(O),Y.shearX(r),Y.shearY(n),Math.round(p+400*G)%10==0?(Y.drawingContext.shadowColor=i,Y.drawingContext.shadowBlur=O,Y.drawingContext.shadowOffsetX=-g,Y.drawingContext.shadowOffsetY=-x,Y.fill(0)):Y.fill(t),Y.stroke(0),Y.rect(e,s,h,o),Y.pop()})),a.forEach(((t,e)=>{e%2==1&&t.draw(G,C,k)})),Y.push(),Y.drawingContext.shadowColor="black",Y.drawingContext.shadowBlur=O,Y.drawingContext.shadowOffsetX=2*-g,Y.drawingContext.shadowOffsetY=2*-x,Y.noFill(),Y.stroke(i),Y.strokeWeight(40*O),Y.rect(0,0,width,height),Y.pop(),Y.push(),Y.noFill(),Y.stroke(0),Y.strokeWeight(20*O),Y.rect(0,0,width,height),Y.strokeWeight(2*O),Y.rect(20*O,20*O,width-40*O,height-40*O),Y.pop(),p.forEach(((t,e)=>{e%3==2&&t.draw(G,C,k)})),p.forEach(((t,e)=>{e%3==1&&t.draw(G,C,k)})),Y.push(),Y.noFill(),Y.drawingContext.setLineDash(o),Y.drawingContext.lineDashOffset=1e3*G,Y.stroke(0),Y.strokeWeight(O),Y.beginShape();for(let t=0;t<a.length;t+=1)if(t%15==0){const[e,i,s]=a[t].points;Y.vertex(e.x-C,e.y+k),Y.vertex(i.x-C,i.y+k),Y.vertex(s.x-C,s.y+k)}Y.endShape(),Y.pop(),p.forEach(((t,e)=>{e%3==0&&t.draw(G,C,k)})),a.forEach(((t,e)=>{e%2==0&&t.draw(G)})),push(),noStroke(),rect(0,0,width,height),drawingContext.clip(),image(Y,0,0),pop(),push(),noFill(),stroke(0),strokeWeight(20*O),rect(0,0,width,height),strokeWeight(O),rect(20*O,20*O,width-40*O,height-40*O),pop();const I=map(cos(G*H),-1,1,0,255);l.forEach(((t,e)=>{e%2==0&&t.draw(C,k,G)})),e.setAlpha(I),push(),stroke(0,I),strokeWeight(O),line(0,0,v.x,v.y),line(width,0,E.x,E.y),line(width,height,F.x,F.y),line(0,height,A.x,A.y),fill(e),rect(v.x,v.y,width*(1-2*b),height-width*b*2),translate(width/2-C,height/2-k),scale(S),translate(-(width/2-C),-(height/2-k)),drawingContext.clip(),image(X,0,0),pop(),p.forEach(((t,e)=>{e%3==0&&t.draw2(G,C,k,map(cos(100*G),-1,1,0,255))})),l.forEach(((t,e)=>{e%2==1&&t.draw(-C,-k,G)})),G+=5e-5}const I=()=>{console.log("click")};window.addEventListener("click",I),window.addEventListener("touchstart",I);let P=!0;function windowResized(){const t=void 0,e=X.canvas.style;let i,s;.75*window.innerHeight>=window.innerWidth?(i=window.innerWidth,s=window.innerWidth/.75):(s=window.innerHeight,i=.75*window.innerHeight),e.position="absolute",e.display="block",e.top=e.left=e.right=e.structure="0",e.width=`${i}px`,e.height=`${s}px`}window.addEventListener("keydown",(t=>{"s"===t.key&&saveCanvas(tokenData.hash,"png")," "===t.key&&(P?(noLoop(),P=!1):(loop(),P=!0))}));
const t=void 0;var e=t=>{const e=Uint32Array.from([0,0,0,0].map(((e,i)=>parseInt(t.substr(8*i+2,8),16)))),i=()=>{let t,i=e[3];return e[3]=e[2],e[2]=e[1],e[1]=t=e[0],i^=i<<11,i^=i>>>8,e[0]=i^t^t>>>19,e[0]/4294967296},s=(t=.5)=>i()<t,h=void 0,o=(t,e)=>e?i()*(e-t)+t:i()*t,r=(t,e)=>Math.floor(o(t,e)),n=t=>t.length?t[r(0,t.length)]:void 0,p=t=>{let e=t.reduce(((t,e)=>t+e)),s=i()*e;for(let e=0;e<t.length;e++){if(s<t[e])return e;s-=t[e]}return 0};let a=!1,l=null;const d=(t,e)=>{if(a){a=!1;let i=l;return l=null,t+e*i}{let s=0,h=0,o=0;do{s=2*i()-1,h=2*i()-1,o=s*s+h*h}while(o>=1||0===o);let r=Math.sqrt(-2*Math.log(o)/o);return l=h*r,a=!0,t+e*(s*r)}},c=(t,e)=>{let i;return w(t).slice(0,e)},w=t=>{let e,s,h=t.length,o=t.slice();for(;h;)e=Math.floor(i()*h--),s=o[h],o[h]=o[e],o[e]=s;return o};return{rnd:i,chance:s,bool:s,range:o,rangeFloor:r,pick:n,pickSome:c,weighted:p,shuffleArray:w,gaussian:d}};const i=void 0;var s=[["#5E1C9F",["#4375E2","#5CF7F5","#EC37DB","#FAEE44","#FF636A"]],["#0B0835",["#3F8A8C","#E5340B","#FFE7BD"]],["#4C0082",["#F14A39","#AA0067","#D6BC4B","#1E67AF"]],["#252422",["#fffcf2","#ccc5b9","#403d39","#eb5e28"]],["#032b43",["#d00000","#ffba08","#3f88c5"]],["#000000",["#ffffff","#dddddd","#ffffff","#999999"]],["#100c08",["#ff206e","#fbff12","#41ead4"]],["#00204a",["#d9faff","#00bbf0","#005792"]],["#2d2d2d",["#ffffff","#fec3f0","#fa110d","#54282a"]],["#2289b6",["#94afc0","#f7bd40","#e0160a"]],["#102E4D",["#E3E3E3","#B7181E","#E4AA11","#09678A"]],["#202532",["#047af6","#7401df","#32fa00","#ff00d5"]],["#323031",["#177e89","#084c61","#db3a34","#ffc857"]],["#4B1351",["#AC314B","#DFE5E4","#285599","#E0AB56"]],["#001524",["#15616d","#ffecd1","#ff7d00","#78290f"]],["#001427",["#708d81","#f4d58d","#bf0603","#8d0801"]],["#0d0b0b",["#d80056","#ff8c01","#ecedef","#5cb8d7"]],["#0e0e0e",["#d9322b","#f3a606","#075ea8","#e1d2b3"]],["#075ea8",["#d9322b","#f3a606","#e1d2b3"]],["#2138ff",["#FEC23B","#EAE8D5","#DA292C"]]];const h=(t,e,i)=>t.map(((s,h)=>lerp(t[h],e[h],i))),o=t=>[...t.substr(1)].reduce(((t,e,i,s)=>i%2?t.concat(parseInt(`${s[i-1]}${s[i]}`,16)):t),[]),r=(t,e)=>{const i=[],s=Math.ceil(e/t.length),r=1/s,n=t.map((t=>o(t)));for(let t=0;t<n.length;t+=1)for(let e=0;e<s;e+=1){const s=n[t],o=n[(t+1)%n.length];i.push(h(s,o,(e+1)*r))}return i},n=(t,e,i)=>Array.isArray(e)?e[t*e.length|0]:e||0===e?i||0===i?(e>i&&([e,i]=[i,e]),e+t()*(i-e)):t()*e:t(),p=(t,e,i,s,h,o,r,a,l,d)=>{if(h--,(d-=1)>0||h>=0&&n(l)<r)if(i>=s){let c=i*n(l,a[0],a[1]);p(t,e,c,s,h,o,r,a,l,d),p(t+c,e,i-c,s,h,o,r,a,l,d)}else{let c=s*n(l,a[0],a[1]);p(t,e,i,c,h,o,r,a,l,d),p(t,e+c,i,s-c,h,o,r,a,l,d)}else o.push({x:t,y:e,w:i,h:s,n:h})},a=(t,e,i,s,h,o,r=.7,n,p)=>{if(h--,p||h>=0&&n()<r){let p=i/2,l=s/2;a(t,e,p,l,h,o,r,n),a(t+p,e,p,l,h,o,r,n),a(t+p,e+l,p,l,h,o,r,n),a(t,e+l,p,l,h,o,r,n)}else o.push({x:t,y:e,w:i,h:s,n:h})},l=(t,e,i,s,h,o,r)=>{const n=t.drawingContext.createLinearGradient(e,i,s,h);return o.forEach(((t,e)=>n.addColorStop(t,r[e]))),t.drawingContext.fillStyle=n,n},d=(t,e,i,s,h,o)=>{const r=drawingContext.createLinearGradient(t,e,i,s);return h.forEach(((t,e)=>r.addColorStop(t,o[e]))),drawingContext.fillStyle=r,r},c=(t,e,i,s,h,o)=>{const r=t.drawingContext.createRadialGradient(e,i,0,e,i,s);return h.forEach(((t,e)=>r.addColorStop(t,o[e]))),t.drawingContext.fillStyle=r,r},w=(t,e,i,s,h)=>{const o=[];for(let r=0;r<h-1;r+=1){const n=lerp(t,i,r/(h-1)),p=lerp(e,s,r/(h-1));o.push({x:n,y:p})}return o.push({x:i,y:s}),o},f=(t,e,i,s,h)=>{const o=[];for(let r=0;r<i;r+=1)o.push({x:t+s*cos(h),y:e+s*sin(h)}),h+=360/i;return o},g=(t,e,i,s,h,o)=>{const r=f(t,e,s,h,o),n=i/s,p=[];for(let t=0;t<s;t+=1)for(let e=0;e<n;e+=1){const i=lerp(r[t].x,r[(t+1)%r.length].x,e/n),s=lerp(r[t].y,r[(t+1)%r.length].y,e/n);p.push({x:i,y:s})}return p},x=void 0;var u=(t,e,i,s,h,o,r,n,p)=>{const a=[];for(let l=0;l<=p;l+=1){const d=l/p,c=bezierPoint(t,i,h,r,d),w=bezierPoint(e,s,o,n,d);a.push({x:c,y:w})}return a};class y{constructor(t,e,i){this.p=t,this.points=e,this.opts=i}draw(t,e,i){const[s,h,o]=this.points,{r:r,backColor:n,isBlack:p,isCircle:a,circle1:d,circle2:c,circle3:w,col:f,speed1:g,offsetX:x,offsetY:u,circleSw:y,sFactors:C,sSpeeds:k,M:b}=this.opts,S=map(cos(t*g),-1,1,0,1.5);this.p.push(),r>.9?(this.p.push(),this.p.translate(this.p.width/2,this.p.height/2),this.p.scale(map(cos(t*k[0]),-1,1,1,C[0])),this.p.translate(-this.p.width/2,-this.p.height/2),this.p.stroke(0),this.p.noFill(),this.p.beginShape(),this.p.vertex(s.x,s.y),this.p.vertex(h.x,h.y),this.p.vertex(o.x,o.y),this.p.endShape(CLOSE),this.p.fill(0),this.p.circle(s.x,s.y,.01*width),this.p.circle(h.x,h.y,.01*width),this.p.circle(o.x,o.y,.01*width),this.p.pop(),a&&(this.p.push(),this.p.translate(this.p.width/2,this.p.height/2),this.p.scale(map(cos(t*k[1]),-1,1,1,C[1])),this.p.translate(-this.p.width/2,-this.p.height/2),this.p.stroke(0),this.p.strokeWeight(y),this.p.fill(0),this.p.circle(s.x+i,s.y+e,d),this.p.noFill(),this.p.circle(s.x+i,s.y+e,c),this.p.pop())):r>.7?(this.p.push(),this.p.translate(this.p.width/2,this.p.height/2),this.p.scale(map(cos(t*k[2]),-1,1,1,C[2])),this.p.translate(-this.p.width/2,-this.p.height/2),this.p.drawingContext.shadowColor="rgba(0, 0, 0, 0.5)",this.p.drawingContext.shadowBlur=b,this.p.drawingContext.shadowOffsetX=x+e,this.p.drawingContext.shadowOffsetY=u+i,this.p.noStroke(),l(this.p,s.x,s.y,lerp(h.x,o.x,S),lerp(h.y,o.y,S),[0,1],[f,n]),this.p.beginShape(),this.p.vertex(s.x+e,s.y+i),this.p.vertex(h.x+e,h.y+i),this.p.vertex(o.x+e,o.y+i),this.p.endShape(CLOSE),this.p.pop()):r>.65?(this.p.push(),this.p.translate(this.p.width/2,this.p.height/2),this.p.scale(map(cos(t*k[3]),-1,1,1,C[3])),this.p.translate(-this.p.width/2,-this.p.height/2),this.p.noStroke(),this.p.fill(p?0:n),this.p.beginShape(),this.p.vertex(s.x-e,s.y-i),this.p.vertex(h.x-e,h.y-i),this.p.vertex(o.x-e,o.y-i),this.p.endShape(CLOSE),this.p.pop()):r>.4&&(this.p.push(),this.p.translate(this.p.width/2,this.p.height/2),this.p.scale(map(cos(t*k[4]),-1,1,1,C[4])),this.p.translate(-this.p.width/2,-this.p.height/2),this.p.fill(0,255),this.p.circle(s.x-e,s.y+i,w),this.p.pop()),this.p.pop()}}var C=y;class k{constructor(t,e){this.p=t,this.opts=e}draw(t,e,i){const{center:s,color:h,backColor:o,offsetX:r,offsetY:n,size1:p,size2:a,isColored:l,isOutside:d,outsideNoFill:c,speed1:w,speed2:f,diff:g}=this.opts;this.p.push(),this.p.stroke(0),l?this.p.fill(h):this.p.fill(0),this.p.circle(s.x+map(sin(t*w),-1,1,-r,r)-e,s.y+map(cos(t*f),-1,1,-n,n)-i,p),g&&(this.p.drawingContext.globalCompositeOperation="difference"),this.p.fill(o),this.p.circle(s.x,s.y,p),this.p.pop(),d&&(this.p.push(),this.p.stroke(0),c?this.p.noFill():this.p.fill(o),this.p.circle(s.x+map(sin(t*f),-1,1,-r,r)-e,s.y+map(cos(t*w),-1,1,-n,n)-i,a),this.p.pop())}draw2(t,e,i,s){const{center:h,offsetX:o,offsetY:r,size1:n,size2:p,isOutside:a,speed1:l,speed2:d}=this.opts;push(),stroke(0,s),noFill(),circle(h.x+map(sin(t*l),-1,1,-o,o)-e,h.y+map(cos(t*d),-1,1,-r,r)-i,n),circle(h.x,h.y,n),pop(),a&&(push(),noFill(),circle(h.x+map(sin(t*d),-1,1,-o,o)-e,h.y+map(cos(t*l),-1,1,-r,r)-i,p),pop())}}var b=k;class S{constructor(t,e,i){this.p=t,this.points=e,this.opts=i}draw(t,e,i){const[s,h,o]=this.points,{sColor:r,bColor:n,opacity:p,sFactor:a,sSpeed:l,strokeSpeed:d,M:c}=this.opts;push(),translate(width/2,height/2),scale(map(cos(i*l),-1,1,1,a)),translate(-width/2,-height/2),noStroke(),strokeWeight(2*c),stroke(0,map(cos(i*d),-1,1,0,255)),beginShape(),drawingContext.shadowColor=`rgba(0, 0, 0, ${p})`,drawingContext.shadowColor=r,drawingContext.shadowBlur=c,drawingContext.shadowOffsetX=-t,drawingContext.shadowOffsetY=-e,fill(n),vertex(s.x,s.y),vertex(h.x,h.y),vertex(o.x,o.y),endShape(CLOSE),drawingContext.clip(),image(this.p,t/2,e/2),pop()}}var m=S;let v=1e3,E=window.innerWidth,F=window.innerHeight,A,O=Math.min(E,F)/1e3,W,B;const L=.75;let M,X,Y,$,D,z,H,G;.75*window.innerHeight>=window.innerWidth?(W=window.innerWidth,B=window.innerWidth/.75):(B=window.innerHeight,W=.75*window.innerHeight);const N={count:1e4,mOffsetX:5*O,mOffsetY:5*O*1.25},R={};function setup(){X=createCanvas(W,B),strokeWeight(O),Y=createGraphics(W,B),Y.strokeWeight(2*O),Y.angleMode(DEGREES),Y.strokeCap(SQUARE),Y.strokeWeight(2*O),M=()=>{const{rnd:t,range:i,rangeFloor:h,pick:o,pickSome:r,gaussian:n,shuffleArray:p}=e(tokenData.hash),calculateFeatures=()=>{const t={},e=h(s.length-1),i=s[e];return t.palette=i,t},{palette:a}=calculateFeatures(),l=[a[0],...p(a[1])],{count:d}=N;R.lerpColors=l.map((t=>color(t))),R.backColors=a[1].map((t=>{const e=color(t);return e.setAlpha(255),e}));const[c,w]=r(R.backColors);$=i(3,6),D=i(3,7.5),z=i(3,9),H=i(30,200),R.backColor=color(`hsb(${Math.round(hue(c))}, ${saturation(c)/2}%, ${2*lightness(c)}%)`),R.backColorN=color(`hsb(${Math.round(hue(c))}, ${saturation(c)/2}%, ${2*lightness(c)}%)`),R.backColor3=color(`hsb(${Math.round(1.1*hue(c))}, ${saturation(c)/2}%, ${2*lightness(c)}%)`),R.backColor2=w,R.points=[];const f=i(.1*width,.9*width),g=width-f;let x=u(f,i(.2*height,.4*height),g,.25*height,f,.75*height,g,i(.9*height,height),d);t()>.5&&(x=x.reverse());for(let t=0;t<x.length;t+=1){const{x:e,y:i}=x[t],s=e+n(0,10)*width*.02,h=i+n(0,10)*width*.02;R.points.push({x:s,y:h})}R.triangles=[],R.triangles2=[];let y=.01*width,k=.6*width;const S=R.points.filter((({y:t})=>t<.03*height));let v=o(S),E=o(S),F,A;if(v){const{x:t,y:e}=v;F=p(R.points.filter((({x:i,y:s})=>dist(t,e,i,s)>y&&dist(t,e,i,s)<k&&s>e))),A=p(R.points.filter((({x:i,y:s})=>dist(t,e,i,s)>y&&dist(t,e,i,s)<k&&s>e)))}const W=20;let B=0;for(let e=0;e<W;e+=1)if(v){const{x:e,y:s}=v;let h=[];F[0]&&(h=p(R.points.filter((({x:t,y:i})=>{const h=B%4!=0||s<i;return y=B%2==1?.1*width:.001*width,dist(e,s,t,i)>y&&dist(e,s,t,i)<k&&dist(F[0].x,F[0].y,t,i)>y&&dist(F[0].x,F[0].y,t,i)<k&&h})))),F.length>0&&h.length>0&&R.triangles.push(new C(Y,[v,F[0],h[0]],{r:t(),isBlack:t()>.5,isCircle:t()>.8,circle1:i(.01*width,.04*width),circle2:i(.07*width,.12*width),circle3:i(.01*width),col:o(R.lerpColors),backColor:R.backColor,speed1:i(10,30),offsetX:i(.01*-width,.01*width),offsetY:i(.01*-width,.01*width),circleSw:i(O,3*O),s
ass"===_.shape){for(let e=.05*-width;e<1.1*width;e+=.2*width){const t=w(e,height*M(.1,.7),e,height,200);o=[...o,...t]}for(let e=.15*-width;e<1.1*width;e+=.2*width){const t=w(e,height*M(.1,.7),e,height,200);a=[...a,...t]}o=A(o),a=A(a)}if("tree"===_.shape){const e=u(width/2,height/3.5,400,400,.2*width,90);o=[...o,...e]}let p=_.divider,x=_.angle;const{lerpColors:y,backColors:k,backColors2:v}=_;R.background(255);const C=E(v),m=M(.2,.8),F=M(.05,.15);"grass"===_.shape?(R.push(),R.noStroke(),l(R,width*M(.1,.9),height*M(.1,.3),width/2,[0,m-F,m,m+F,1],[E(v),C,C,C,E(v)]),R.rect(0,0,width,height),R.pop()):"spiral"===_.shape?(R.push(),R.noStroke(),l(R,.5*width,.5*height,width/2,[0,1],[E(v),E(v)]),R.rect(0,0,width,height),R.pop()):"structure"===_.shape?(R.fill(E(v)),R.rect(0,0,width,height)):(R.push(),R.noStroke(),c(R,width/2,0,width/2,height,[0,m-F,m,m+F,1],[E(v),C,C,C,E(v)]),R.rect(0,0,width,height),R.pop());const G=E(y),N=E(y);R.push(),R.noFill(),R.strokeWeight(20*H),R.stroke(G),R.rect(0,0,width,height),R.pop(),R.push(),R.noFill(),R.strokeWeight(2*H),R.stroke(N),R.rect(5*H,5*H,width-10*H,height-10*H),R.pop();for(let e=0;e<o.length;e+=1){const t=r,h=r,i=Math.max(t,h);let s=map(cos(e*_.waveR),-1,1,0,_.size),n,d;"tree"===_.shape?(n=P(o[e].x,o[e].y,s,t,x,width,0,1.1*height,1.1*height),d=P(o[e].x,o[e].y,s,h,x,1.1*width,.1*-width,height,.1*-height)):"grass"===_.shape?(n=P(o[e].x,o[e].y,s,t,x,width,0,1.1*height,1.1*height),d=P(a[e].x,a[e].y,s,h,x,width,0,1.1*height,1.1*height)):"structure"===_.shape?(n=P(o[e].x,o[e].y,s,t,x,width,0,height,0),d=P(o[e].x,o[e].y,s,h,x,width,0,height,0)):(n=P(o[e].x,o[e].y,s,t,x,1.1*width,.1*-width,1.1*height,_.roots?1.1*height:0),d=P(o[e].x,o[e].y,s,h,x,1.1*width,.1*-width,height,.1*-height));for(let t=0;t<i-20;t+=1)e%p==0?(R.push(),R.beginShape(),R.fill(y[t%y.length]),_.noFill&&R.noFill(),R.strokeWeight(.5*H),R.stroke(y[(t+Math.round(.1*y.length))%y.length]),_.blackStroke&&R.stroke(0),R.vertex(n[t%n.length].x,n[t%n.length].y),R.bezierVertex(n[t%n.length].x,n[t%n.length].y,n[(t+W(10))%n.length].x,n[(t+W(10))%n.length].y,n[(t+20)%n.length].x,n[(t+20)%n.length].y),R.vertex(n[t%n.length].x,n[(t+1)%n.length].y),R.vertex(n[t%n.length].x,n[(t+2)%n.length].y),R.endShape(CLOSE),e%10==0&&(R.push(),R.strokeWeight(.5*H),R.stroke(k[0]),n[t%d.length].y>0&&n[t%d.length].y<height&&R.stroke(k[Math.round(map(n[t%n.length].y,height,0,0,k.length-1))]),R.fill(k[Math.round(map(sin(5*t),-1,1,0,k.length-1))]),R.circle(n[t%n.length].x,n[t%n.length].y,M(1,5)*H),R.pop()),R.pop()):(R.push(),R.beginShape(),R.fill(k[t%k.length]),R.fill(k[Math.round(map(sin(5*t),-1,1,0,k.length-1))]),R.strokeWeight(.5*H),R.stroke(k[(t+Math.round(.1*k.length))%k.length]),R.stroke(k[0]),d[t%d.length].y>0&&d[t%d.length].y<height&&R.stroke(k[Math.round(map(d[t%d.length].y,0,height,0,k.length-1))]),"tree"!==_.shape&&"structure"!==_.shape||R.stroke(k[(t+Math.round(.1*k.length))%k.length]),R.strokeWeight(S()*H),_.bigStroke&&(R.strokeWeight(5*H),R.stroke(k[(t+Math.round(.1*k.length))%k.length])),R.vertex(d[t%d.length].x,d[t%d.length].y),R.vertex(d[(t+1)%d.length].x,d[(t+1)%d.length].y),R.vertex(d[(t+2)%d.length].x,d[(t+2)%d.length].y),R.endShape(CLOSE),R.pop()),e%10==0&&(R.push(),R.strokeWeight(.5*H),R.stroke(y[(t+Math.round(.1*y.length))%y.length]),R.fill(k[t%k.length]),"wall"===_.shape?R.circle(n[t%n.length].x,n[t%n.length].y,map(sin(10*t),-1,1,1,s/2)):R.circle(n[t%n.length].x,n[t%n.length].y,M(H,s)),R.pop())}R.push(),R.noFill(),R.strokeWeight(2*H),R.stroke(N),R.rect(5*H,5*H,width-10*H,height-10*H),R.pop(),push(),noStroke(),rect(0,0,width,height),drawingContext.clip(),image(R,0,0),pop()},G()}function B(){const e=void 0,t=D.canvas.style;let h,i;.75*window.innerHeight>=window.innerWidth?(h=window.innerWidth,i=window.innerWidth/.75):(i=window.innerHeight,h=.75*window.innerHeight),t.position="absolute",t.display="block",t.top=t.left=t.right=t.structure="0",t.width=`${h}px`,t.height=`${i}px`}function windowResized(){B()}.75*window.innerHeight>=window.innerWidth?(N=window.innerWidth,z=window.innerWidth/.75):(z=window.innerHeight,N=.75*window.innerHeight);const L=[1,2,3,4,5,6,7,8,9];window.addEventListener("keydown",(e=>{L.includes(Number(e.key))&&(R.pixelDensity(Number(e.key)),pixelDensity(Number(e.key)),F.setSeed(C),G()),"s"===e.key&&saveCanvas(tokenData.tokenId,"png")}));const P=(e,t,h,i,s,n,r,d,o)=>{const a=[];let f={x:e,y:t},l=0;for(let e=0;e<i;e+=1){let t;t=$(f,e%2==0?h:h*_.weeds,l,n,r,d,o),f=t,a.push(t),l+=s}return a},$=(e,t,h,i,s,n,r)=>{const d={};return e.x+t>i?d.x=e.x-t:e.x-t<s?d.x=e.x+t:d.x=e.x+E([t*cos(h),t*sin(h)]),e.y+t>n?d.y=e.y-t:e.y-t<r?d.y=e.y+t:d.y=e.y+E([t*cos(h),t*sin(h)]),d},I=(e,t,h,i,s,n)=>{const r=[];let d=0,o=n;for(let a=0;a<s;a+=1)r.push({x:e+h*R.cos(d)*o,y:t+h*R.sin(d)*o}),d+=i/s,o+=n;return r},O=(e,t,h,i,s,n)=>{const r=[];let d=0;for(let o=0;o<s;o+=1)r.push({x:e+h*R.sin(d)*R.cos(d),y:t+h*R.cos(d*n)}),d+=i/s;return r},q=(e,t,h,i,s)=>{const n=[];let r=0;for(let d=0;d<s;d+=1)n.push({x:e+h*R.cos(r),y:t+h*R.sin(r)*R.cos(r)}),r+=i/s;return n},Q=(e,t,h,i,s,n)=>{const r=[];let d=0;for(let o=0;o<s;o+=1)r.push({x:e+h*R.sin(d*n)*R.cos(d*n),y:t+h*R.cos(d)}),d+=i/s;return r};
class e{constructor(e){this.seed=e,this.rnd=this.rnd.bind(this),this.range=this.range.bind(this),this.rangeFloor=this.rangeFloor.bind(this),this.pick=this.pick.bind(this),this.shuffleArray=this.shuffleArray.bind(this),this.gaussian=this.gaussian.bind(this),this._hasNextGaussian=!1,this._nextGaussian=null}setSeed(e){this.seed=e}rnd(){return this.seed^=this.seed<<13,this.seed^=this.seed>>17,this.seed^=this.seed<<5,(this.seed<0?1+~this.seed:this.seed)%1e3/1e3}range(e,t){return t?this.rnd()*(t-e)+e:this.rnd()*e}rangeFloor(e,t){return Math.floor(this.range(e,t))}pick(e){return e[this.rangeFloor(0,e.length)]}shuffleArray(e){for(var t,h,i=e.length,s=e.slice();i;)t=Math.floor(this.rnd()*i--),h=s[i],s[i]=s[t],s[t]=h;return s}gaussian(e,t){if(this._hasNextGaussian){this._hasNextGaussian=!1;var h=this._nextGaussian;return this._nextGaussian=null,e+t*h}var i=0,s=0,n=0;do{n=(i=2*this.rnd()-1)*i+(s=2*this.rnd()-1)*s}while(n>=1||0===n);var r=Math.sqrt(-2*Math.log(n)/n);return this._nextGaussian=s*r,this._hasNextGaussian=!0,e+t*(i*r)}pickSome(e,t){let h;return this.shuffleArray(e).slice(0,t)}}const t=(e,t,i,s=!1)=>s?h(e+(t-e)*i,0,1):e+(t-e)*i,h=(e,t,h)=>e<t?t:e>h?h:e,i=(e,t,h)=>Array.isArray(t)?t[e*t.length|0]:t||0===t?h||0===h?(t>h&&([t,h]=[h,t]),t+e()*(h-t)):e()*t:e(),s=(e,t,h,n,r,d,o,a,f,l)=>{if(r--,l||r>=0&&i(f)<o)if(h>=n){let l=h*i(f,a[0],a[1]);s(e,t,l,n,r,d,o,a,f),s(e+l,t,h-l,n,r,d,o,a,f)}else{let l=n*i(f,a[0],a[1]);s(e,t,h,l,r,d,o,a,f),s(e,t+l,h,n-l,r,d,o,a,f)}else d.push({x:e,y:t,w:h,h:n,n:r})},n=(e,t,h,s,r,d,o,a,f,l)=>{if(r--,l||r>=0&&i(f)<o){let l=h*i(f,a[0],a[1]);n(e,t,l,s,r,d,o,a,f),n(e+l,t,h-l,s,r,d,o,a,f)}else d.push({x:e,y:t,w:h,h:s,n:r})},r=(e,t,h,s,n,d,o,a,f,l)=>{if(n--,l||n>=0&&i(f)<o){let l=s*i(f,a[0],a[1]);r(e,t,h,l,n,d,o,a,f),r(e,t+l,h,s-l,n,d,o,a,f)}else d.push({x:e,y:t,w:h,h:s,n:n})},d=(e,t,h,i,s,n,r=.7,o,a)=>{if(s--,a||s>=0&&o()<r){let a=h/2,f=i/2;d(e,t,a,f,s,n,r,o),d(e+a,t,a,f,s,n,r,o),d(e+a,t+f,a,f,s,n,r,o),d(e,t+f,a,f,s,n,r,o)}else n.push({x:e,y:t,w:h,h:i,n:s})},o=(e,h,i)=>e.map(((s,n)=>t(e[n],h[n],i))),a=e=>[...e.substr(1)].reduce(((e,t,h,i)=>h%2?e.concat(parseInt(`${i[h-1]}${i[h]}`,16)):e),[]),f=(e,t)=>{const h=[],i=Math.ceil(t/e.length),s=1/i,n=e.map((e=>a(e)));for(let e=0;e<n.length;e+=1)for(let t=0;t<i;t+=1){const i=n[e],r=n[(e+1)%n.length];h.push(o(i,r,(t+1)*s))}return h},l=(e,t,h,i,s,n)=>{const r=i>=0?i:0,d=e.drawingContext.createRadialGradient(t,h,0,t,h,r);return s.forEach(((e,t)=>d.addColorStop(e,n[t]))),e.drawingContext.fillStyle=d,d},c=(e,t,h,i,s,n,r)=>{const d=e.drawingContext.createLinearGradient(t,h,i,s);return n.forEach(((e,t)=>d.addColorStop(e,r[t]))),e.drawingContext.fillStyle=d,d},g=(e,t,h,i,s,n,r,d,o)=>{const a=[];for(let f=0;f<=o;f+=1){const l=f/o,c=bezierPoint(e,h,s,r,l),g=bezierPoint(t,i,n,d,l);a.push({x:c,y:g})}return a},p=(e,t,h,i,s)=>{const n=[];for(let r=0;r<h;r+=1)n.push({x:e+i*cos(s),y:t+i*sin(s)}),s+=360/h;return n},u=(e,h,i,s,n,r)=>{const d=p(e,h,s,n,r),o=i/s,a=[];for(let e=0;e<s;e+=1)for(let h=0;h<o;h+=1){const i=t(d[e].x,d[(e+1)%d.length].x,h/o),s=t(d[e].y,d[(e+1)%d.length].y,h/o);a.push({x:i,y:s})}return a},w=(e,h,i,s,n)=>{const r=[];for(let d=0;d<n-1;d+=1){const o=t(e,i,d/(n-1)),a=t(h,s,d/(n-1));r.push({x:o,y:a})}return r.push({x:i,y:s}),r},b=[["#7400b8","#6930c3","#5e60ce","#5390d9","#4ea8de","#80ffdb"],["#F9FBFF","#212121","#F9FBFF","#212121","#F9FBFF","#212121"],["#efffff","#f20082","#5db1ff","#ff00ca","#3a0bba"],["#521262","#6639a6","#3490de","#6fe7dd","#ff7c38","#e03e36","#b80d57","#700961"],["#a7ff83","#17b978","#086972","#071a52","#80d6ff","#edf798","#fab57a","#f06868"],["#01608F","#EF91A9","#EB4626","#F4BA10","#34A096","#2C2F8C"],["#264653","#2a9d8f","#e9c46a","#f4a261","#e76f51"],["#e63946","#f1faee","#a8dadc","#457b9d","#1d3557"],["#2b2d42","#8d99ae","#edf2f4","#ef233c","#d90429"],["#003049","#d62828","#f77f00","#fcbf49","#eae2b7"],["#3d5a80","#98c1d9","#e0fbfc","#ee6c4d","#293241"],["#011627","#fdfffc","#2ec4b6","#e71d36","#ff9f1c"],["#283d3b","#197278","#edddd4","#c44536","#772e25"],["#2b2d42","#8d99ae","#edf2f4","#ef233c","#d80032"],["#50514f","#f25f5c","#ffe066","#247ba0","#70c1b3"],["#fffcf2","#ccc5b9","#403d39","#252422","#eb5e28"],["#177e89","#084c61","#db3a34","#ffc857","#323031"],["#002642","#840032","#e59500","#e5dada","#02040f"],["#0c0a3e","#7b1e7a","#b33f62","#f9564f","#f3c677"],["#b80c09","#0b4f6c","#01baef","#fbfbff","#040f16"],["#001427","#708d81","#f4d58d","#bf0603","#8d0801"],["#1f271b","#19647e","#28afb0","#f4d35e","#ee964b"],["#06aed5","#086788","#f0c808","#fff1d0","#dd1c1a"],["#011627","#fdfffc","#2ec4b6","#e71d36","#ff9f1c"],["#001524","#15616d","#ffecd1","#ff7d00","#78290f"],["#dad2d8","#143642","#0f8b8d","#ec9a29","#a8201a"],["#003049","#d62828","#f77f00","#fcbf49"],["#001427","#708d81","#f4d58d","#bf0603","#8d0801"],["#55dde0","#33658a","#2f4858","#f6ae2d","#f26419"],["#010417","#0029c1","#2bb59c","#f7dc09","#e22b00"],["#0c090d","#e01a4f","#f15946","#f9c22e","#53b3cb"],["#01638d","#abcecc","#fff2cd","#ff004c","#610d4b"],["#2d728f","#3b8ea5","#f5ee9e","#f49e4c","#ab3428"],["#d00000","#ffba08","#3f88c5","#032b43","#032b43"],["#e63946","#f1faee","#a8dadc","#457b9d","#1d3557"],["#083d77","#f4d35e","#ee964b","#f95738"],["#177e89","#084c61","#db3a34","#ffc857","#323031"],["#010000","#a74c00","#ffa100","#ffd300","#f1f2f1"],["#e6eed6","#bbc5aa","#a72608","#090c02"],["#011627","#fdfffc","#2ec4b6","#e71d36","#ff9f1c"],["#fff2cd","#abcecc","#01638d","#ff004c","#610d4b"],["#33658a","#86bbd8","#2f4858","#f6ae2d","#f26419"],["#001427","#708d81","#f4d58d","#bf0603","#8d0801"],["#820263","#d90368","#eadeda","#2e294e","#ffd400"],["#a832a0","#7d32a8","#598fb5","#fffb00"],["#335c67","#fff3b0","#e09f3e","#9e2a2b","#540b0e"],["#003f88","#00509d","#fdc500","#ffd500"],["#001427","#708d81","#f4d58d","#bf0603","#8d0801"],["#0d1b2a","#1b263b","#415a77","#778da9","#e0e1dd"],["#0c0f0a","#ff206e","#fbff12","#41ead4"],["#000000","#2f4550","#586f7c","#b8dbd9","#f4f4f9"],["#970005","#ed0101","#0c44ac","#000052"],["#ff6d69","#fecc50","#0be7fb","#010b8b","#1e0521"],["#c9e4ca","#87bba2","#55828b","#3b6064","#364958"]];let x;var y;console.log("\nmade by\n█▀▀ █░░█ ▀█░█▀ █▀▀ █▀▄▀█ █▀▀▄ █░░ █▀▀▄ █▀▀█\n▀▀█ █▀▀█ ░█▄█░ █▀▀ █░▀░█ █▀▀▄ █░░ █░░█ █▄▄▀\n▀▀▀ ▀░░▀ ░░▀░░ ▀▀▀ ▀░░░▀ ▀▀▀░ ▀▀▀ ▀▀▀░ ▀░▀▀\n ");const k=void 0;let v=(m=tokenData,parseInt(m.hash.slice(0,16),16)),C=v;var m;const F=new e(v),{rnd:S,range:M,rangeFloor:W,pick:E,shuffleArray:A}=F;let G,R;const _={};let N,z,D,H;function setup(){D=createCanvas(N,z),angleMode(DEGREES),R=createGraphics(N,z),G=()=>{H=.001*width,R.strokeCap(SQUARE),R.angleMode(DEGREES);const e=W(b.length-1);_.currentPalette=b[e];const t=S();_.shape=t<.05?"structure":t>=.05&&t<.08?"plexus":t>=.08&&t<.11?"tree":t>=.11&&t<.15?"grass":E(["unity","v-streams","h-streams","spiral","oscillations","curls","wall","v-storm","h-storm"]),_.size=10*H,"tree"===_.shape&&(_.size=12*H),_.waveR=M(.1,1),"tree"===_.shape&&(_.waveR=0),"v-streams"===_.shape&&(_.waveR=S()>.95?.9:M(.6,2)),"h-streams"===_.shape&&(_.waveR=M(.4,2)),"spiral"===_.shape&&(_.waveR=M(1,4)),"curls"===_.shape&&(_.waveR=M(.2,1.5)),"plexus"===_.shape&&(_.waveR=M(.3,4)),_.roots="structure"!==_.shape&&S()>.2,_.noFill=_.roots&&S()>.9;const h=S()>.8;_.roots?_.angle=h?M(20,180):E([30,60,90,120,150,180]):_.angle=h?M(20,100):E([30,60,90]),_.blackStroke=_.roots&&S()>.7,_.divider=_.roots?W(3,21):W(3,9),"tree"===_.shape&&(_.divider=W(3,6)),_.bigStroke="structure"!==_.shape&&S()>.95,_.longColors=S()>.7,_.rCount=200;const i=void 0,s=!["curls","plexus"].includes(_.shape)&&S()>.9;_.weeds=s?M(1,2):1,"wall"===_.shape&&(_.waveR=0,_.roots=!0),"unity"===_.shape&&(_.roots=S()>.1),"tree"===_.shape&&(_.rCount=1e3),_.colorCount=Math.round(map(S(),0,1,.5*_.rCount,1.5*_.rCount)),_.longColors&&(_.colorCount=Math.round(map(S(),0,1,1.5*_.rCount,3*_.rCount))),"structure"===_.shape&&(_.rCount=100,_.colorCount=Math.round(map(S(),0,1,100,300)));const{colorCount:n,rCount:r}=_,d=A(_.currentPalette);_.lerpColors=f(A(d),n).map((e=>color(e))),_.backColors=f(A(d),n/2).map((e=>color(e))),_.backColors2=f(A(d),n).map((e=>{const t=color(e);return t.setAlpha(100),t}));let o=[],a=[];if("h-storm"===_.shape)for(let e=.1*-height;e<1.1*height;e+=.2*height){const t=M(.25,.75),h=g(0,e,width*t,e+height*t,width*t,e-height*t,width,e,400);o=[...o,...h]}if("v-storm"===_.shape)for(let e=.1*-width;e<1.1*width;e+=.2*width){const t=M(.25,.75),h=g(e,0,e+width*t,height*t,e-width*t,height*t,e,height,400);o=[...o,...h]}if("wall"===_.shape){const e=new Array(200).fill(null).map((()=>({x:M(width),y:M(height)})));o=[...w(0,.05*height,width,.05*height,800),...w(0,1.2*height,width,1.2*height,800),...e]}if("plexus"===_.shape&&(o=[...q(width/2,.25*height,.6*width,180,400),...q(width/2,.5*height,.6*width,180,400),...q(width/2,.75*height,.6*width,180,400),...q(width/2,.25*height,.6*width,-180,400),...q(width/2,.5*height,.6*width,-180,400),...q(width/2,.75*height,.6*width,-180,400)]),"oscillations"===_.shape){const e=M(.8,1.2);o=[...O(width/2,height/2,width,360,1600,e),...O(width/2,height/2,.6*width,360,800,e)]}if("curls"===_.shape&&(o=Q(width/2,height/2,.7*width,360,1600,W(3,10))),"spiral"===_.shape){const e=I(width/2,height/2,width*M(.01,.005),1440,1600,.1);o=S()>.5?e.reverse():e}if("v-streams"===_.shape)for(let e=.1*width;e<width;e+=.2*width){const t=w(e,0,e,height,400);o=[...o,...t]}if("h-streams"===_.shape)for(let e=.1*height;e<height;e+=.2*height){const t=w(0,e,width,e,400);o=[...o,...t]}if("unity"===_.shape){const e=M(360),t=u(.5*width,.33*height,400,400,.3*width,e),h=u(.5*width,.66*height,400,400,.3*width,e);o=S()>.95?A([...t,...h]):[...t,...h]}if("structure"===_.shape){for(let e=.2*width;e<width;e+=.2*width){const t=w(e,.1*height,e,.9*height,400);o=[...o,...t]}for(let e=.2*height;e<height;e+=.2*height){const t=w(.1*width,e,.9*width,e,400);o=[...o,...t]}}if("gr
ass"===_.shape){for(let e=.05*-width;e<1.1*width;e+=.2*width){const t=w(e,height*M(.1,.7),e,height,200);o=[...o,...t]}for(let e=.15*-width;e<1.1*width;e+=.2*width){const t=w(e,height*M(.1,.7),e,height,200);a=[...a,...t]}o=A(o),a=A(a)}if("tree"===_.shape){const e=u(width/2,height/3.5,400,400,.2*width,90);o=[...o,...e]}let p=_.divider,x=_.angle;const{lerpColors:y,backColors:k,backColors2:v}=_;R.background(255);const C=E(v),m=M(.2,.8),F=M(.05,.15);"grass"===_.shape?(R.push(),R.noStroke(),l(R,width*M(.1,.9),height*M(.1,.3),width/2,[0,m-F,m,m+F,1],[E(v),C,C,C,E(v)]),R.rect(0,0,width,height),R.pop()):"spiral"===_.shape?(R.push(),R.noStroke(),l(R,.5*width,.5*height,width/2,[0,1],[E(v),E(v)]),R.rect(0,0,width,height),R.pop()):"structure"===_.shape?R.background(E(v)):(R.push(),R.noStroke(),c(R,width/2,0,width/2,height,[0,m-F,m,m+F,1],[E(v),C,C,C,E(v)]),R.rect(0,0,width,height),R.pop());const G=E(y),N=E(y);R.push(),R.noFill(),R.strokeWeight(20*H),R.stroke(G),R.rect(0,0,width,height),R.pop(),R.push(),R.noFill(),R.strokeWeight(2*H),R.stroke(N),R.rect(5*H,5*H,width-10*H,height-10*H),R.pop();for(let e=0;e<o.length;e+=1){const t=r,h=r,i=Math.max(t,h);let s=map(cos(e*_.waveR),-1,1,0,_.size),n,d;"tree"===_.shape?(n=P(o[e].x,o[e].y,s,t,x,width,0,1.1*height,1.1*height),d=P(o[e].x,o[e].y,s,h,x,1.1*width,.1*-width,height,.1*-height)):"grass"===_.shape?(n=P(o[e].x,o[e].y,s,t,x,width,0,1.1*height,1.1*height),d=P(a[e].x,a[e].y,s,h,x,width,0,1.1*height,1.1*height)):"structure"===_.shape?(n=P(o[e].x,o[e].y,s,t,x,width,0,height,0),d=P(o[e].x,o[e].y,s,h,x,width,0,height,0)):(n=P(o[e].x,o[e].y,s,t,x,1.1*width,.1*-width,1.1*height,_.roots?1.1*height:0),d=P(o[e].x,o[e].y,s,h,x,1.1*width,.1*-width,height,.1*-height));for(let t=0;t<i-20;t+=1)e%p==0?(R.push(),R.beginShape(),R.fill(y[t%y.length]),_.noFill&&R.noFill(),R.strokeWeight(.5*H),R.stroke(y[(t+Math.round(.1*y.length))%y.length]),_.blackStroke&&R.stroke(0),R.vertex(n[t%n.length].x,n[t%n.length].y),R.bezierVertex(n[t%n.length].x,n[t%n.length].y,n[(t+W(10))%n.length].x,n[(t+W(10))%n.length].y,n[(t+20)%n.length].x,n[(t+20)%n.length].y),R.vertex(n[t%n.length].x,n[(t+1)%n.length].y),R.vertex(n[t%n.length].x,n[(t+2)%n.length].y),R.endShape(CLOSE),e%10==0&&(R.push(),R.strokeWeight(.5*H),R.stroke(k[0]),n[t%d.length].y>0&&n[t%d.length].y<height&&R.stroke(k[Math.round(map(n[t%n.length].y,height,0,0,k.length-1))]),R.fill(k[Math.round(map(sin(5*t),-1,1,0,k.length-1))]),R.circle(n[t%n.length].x,n[t%n.length].y,M(1,5)*H),R.pop()),R.pop()):(R.push(),R.beginShape(),R.fill(k[t%k.length]),R.fill(k[Math.round(map(sin(5*t),-1,1,0,k.length-1))]),R.strokeWeight(.5*H),R.stroke(k[(t+Math.round(.1*k.length))%k.length]),R.stroke(k[0]),d[t%d.length].y>0&&d[t%d.length].y<height&&R.stroke(k[Math.round(map(d[t%d.length].y,0,height,0,k.length-1))]),"tree"!==_.shape&&"structure"!==_.shape||R.stroke(k[(t+Math.round(.1*k.length))%k.length]),R.strokeWeight(S()*H),_.bigStroke&&(R.strokeWeight(5*H),R.stroke(k[(t+Math.round(.1*k.length))%k.length])),R.vertex(d[t%d.length].x,d[t%d.length].y),R.vertex(d[(t+1)%d.length].x,d[(t+1)%d.length].y),R.vertex(d[(t+2)%d.length].x,d[(t+2)%d.length].y),R.endShape(CLOSE),R.pop()),e%10==0&&(R.push(),R.strokeWeight(.5*H),R.stroke(y[(t+Math.round(.1*y.length))%y.length]),R.fill(k[t%k.length]),"wall"===_.shape?R.circle(n[t%n.length].x,n[t%n.length].y,map(sin(10*t),-1,1,1,s/2)):R.circle(n[t%n.length].x,n[t%n.length].y,M(H,s)),R.pop())}R.push(),R.noFill(),R.strokeWeight(2*H),R.stroke(N),R.rect(5*H,5*H,width-10*H,height-10*H),R.pop(),push(),noStroke(),rect(0,0,width,height),drawingContext.clip(),image(R,0,0),pop()},G()}function B(){const e=void 0,t=D.canvas.style;let h,i;.75*window.innerHeight>=window.innerWidth?(h=window.innerWidth,i=window.innerWidth/.75):(i=window.innerHeight,h=.75*window.innerHeight),t.position="absolute",t.display="block",t.top=t.left=t.right=t.structure="0",t.width=`${h}px`,t.height=`${i}px`}function windowResized(){B()}.75*window.innerHeight>=window.innerWidth?(N=window.innerWidth,z=window.innerWidth/.75):(z=window.innerHeight,N=.75*window.innerHeight);const L=[1,2,3,4,5,6,7,8,9];window.addEventListener("keydown",(e=>{L.includes(Number(e.key))&&(R.pixelDensity(Number(e.key)),pixelDensity(Number(e.key)),F.setSeed(C),G()),"s"===e.key&&saveCanvas(tokenData.tokenId,"png")}));const P=(e,t,h,i,s,n,r,d,o)=>{const a=[];let f={x:e,y:t},l=0;for(let e=0;e<i;e+=1){let t;t=$(f,e%2==0?h:h*_.weeds,l,n,r,d,o),f=t,a.push(t),l+=s}return a},$=(e,t,h,i,s,n,r)=>{const d={};return e.x+t>i?d.x=e.x-t:e.x-t<s?d.x=e.x+t:d.x=e.x+E([t*cos(h),t*sin(h)]),e.y+t>n?d.y=e.y-t:e.y-t<r?d.y=e.y+t:d.y=e.y+E([t*cos(h),t*sin(h)]),d},I=(e,t,h,i,s,n)=>{const r=[];let d=0,o=n;for(let a=0;a<s;a+=1)r.push({x:e+h*R.cos(d)*o,y:t+h*R.sin(d)*o}),d+=i/s,o+=n;return r},O=(e,t,h,i,s,n)=>{const r=[];let d=0;for(let o=0;o<s;o+=1)r.push({x:e+h*R.sin(d)*R.cos(d),y:t+h*R.cos(d*n)}),d+=i/s;return r},q=(e,t,h,i,s)=>{const n=[];let r=0;for(let d=0;d<s;d+=1)n.push({x:e+h*R.cos(r),y:t+h*R.sin(r)*R.cos(r)}),r+=i/s;return n},Q=(e,t,h,i,s,n)=>{const r=[];let d=0;for(let o=0;o<s;o+=1)r.push({x:e+h*R.sin(d*n)*R.cos(d*n),y:t+h*R.cos(d)}),d+=i/s;return r};
class e{constructor(e){this.seed=e,this.rnd=this.rnd.bind(this),this.range=this.range.bind(this),this.rangeFloor=this.rangeFloor.bind(this),this.pick=this.pick.bind(this),this.shuffleArray=this.shuffleArray.bind(this),this.gaussian=this.gaussian.bind(this),this._hasNextGaussian=!1,this._nextGaussian=null}setSeed(e){this.seed=e}rnd(){return this.seed^=this.seed<<13,this.seed^=this.seed>>17,this.seed^=this.seed<<5,(this.seed<0?1+~this.seed:this.seed)%1e3/1e3}range(e,t){return t?this.rnd()*(t-e)+e:this.rnd()*e}rangeFloor(e,t){return Math.floor(this.range(e,t))}pick(e){return e[this.rangeFloor(0,e.length)]}shuffleArray(e){for(var t,h,i=e.length,s=e.slice();i;)t=Math.floor(this.rnd()*i--),h=s[i],s[i]=s[t],s[t]=h;return s}gaussian(e,t){if(this._hasNextGaussian){this._hasNextGaussian=!1;var h=this._nextGaussian;return this._nextGaussian=null,e+t*h}var i=0,s=0,n=0;do{n=(i=2*this.rnd()-1)*i+(s=2*this.rnd()-1)*s}while(n>=1||0===n);var r=Math.sqrt(-2*Math.log(n)/n);return this._nextGaussian=s*r,this._hasNextGaussian=!0,e+t*(i*r)}pickSome(e,t){let h;return this.shuffleArray(e).slice(0,t)}}const t=(e,t,i,s=!1)=>s?h(e+(t-e)*i,0,1):e+(t-e)*i,h=(e,t,h)=>e<t?t:e>h?h:e,i=(e,t,h)=>Array.isArray(t)?t[e*t.length|0]:t||0===t?h||0===h?(t>h&&([t,h]=[h,t]),t+e()*(h-t)):e()*t:e(),s=(e,t,h,n,r,d,o,a,f,l)=>{if(r--,l||r>=0&&i(f)<o)if(h>=n){let l=h*i(f,a[0],a[1]);s(e,t,l,n,r,d,o,a,f),s(e+l,t,h-l,n,r,d,o,a,f)}else{let l=n*i(f,a[0],a[1]);s(e,t,h,l,r,d,o,a,f),s(e,t+l,h,n-l,r,d,o,a,f)}else d.push({x:e,y:t,w:h,h:n,n:r})},n=(e,t,h,s,r,d,o,a,f,l)=>{if(r--,l||r>=0&&i(f)<o){let l=h*i(f,a[0],a[1]);n(e,t,l,s,r,d,o,a,f),n(e+l,t,h-l,s,r,d,o,a,f)}else d.push({x:e,y:t,w:h,h:s,n:r})},r=(e,t,h,s,n,d,o,a,f,l)=>{if(n--,l||n>=0&&i(f)<o){let l=s*i(f,a[0],a[1]);r(e,t,h,l,n,d,o,a,f),r(e,t+l,h,s-l,n,d,o,a,f)}else d.push({x:e,y:t,w:h,h:s,n:n})},d=(e,t,h,i,s,n,r=.7,o,a)=>{if(s--,a||s>=0&&o()<r){let a=h/2,f=i/2;d(e,t,a,f,s,n,r,o),d(e+a,t,a,f,s,n,r,o),d(e+a,t+f,a,f,s,n,r,o),d(e,t+f,a,f,s,n,r,o)}else n.push({x:e,y:t,w:h,h:i,n:s})},o=(e,h,i)=>e.map(((s,n)=>t(e[n],h[n],i))),a=e=>[...e.substr(1)].reduce(((e,t,h,i)=>h%2?e.concat(parseInt(`${i[h-1]}${i[h]}`,16)):e),[]),f=(e,t)=>{const h=[],i=Math.ceil(t/e.length),s=1/i,n=e.map((e=>a(e)));for(let e=0;e<n.length;e+=1)for(let t=0;t<i;t+=1){const i=n[e],r=n[(e+1)%n.length];h.push(o(i,r,(t+1)*s))}return h},l=(e,t,h,i,s,n)=>{const r=i>=0?i:0,d=e.drawingContext.createRadialGradient(t,h,0,t,h,r);return s.forEach(((e,t)=>d.addColorStop(e,n[t]))),e.drawingContext.fillStyle=d,d},c=(e,t,h,i,s,n,r)=>{const d=e.drawingContext.createLinearGradient(t,h,i,s);return n.forEach(((e,t)=>d.addColorStop(e,r[t]))),e.drawingContext.fillStyle=d,d},g=(e,t,h,i,s,n,r,d,o)=>{const a=[];for(let f=0;f<=o;f+=1){const l=f/o,c=bezierPoint(e,h,s,r,l),g=bezierPoint(t,i,n,d,l);a.push({x:c,y:g})}return a},p=(e,t,h,i,s)=>{const n=[];for(let r=0;r<h;r+=1)n.push({x:e+i*cos(s),y:t+i*sin(s)}),s+=360/h;return n},u=(e,h,i,s,n,r)=>{const d=p(e,h,s,n,r),o=i/s,a=[];for(let e=0;e<s;e+=1)for(let h=0;h<o;h+=1){const i=t(d[e].x,d[(e+1)%d.length].x,h/o),s=t(d[e].y,d[(e+1)%d.length].y,h/o);a.push({x:i,y:s})}return a},w=(e,h,i,s,n)=>{const r=[];for(let d=0;d<n-1;d+=1){const o=t(e,i,d/(n-1)),a=t(h,s,d/(n-1));r.push({x:o,y:a})}return r.push({x:i,y:s}),r},b=[["#7400b8","#6930c3","#5e60ce","#5390d9","#4ea8de","#80ffdb"],["#F9FBFF","#212121","#F9FBFF","#212121","#F9FBFF","#212121"],["#efffff","#f20082","#5db1ff","#ff00ca","#3a0bba"],["#521262","#6639a6","#3490de","#6fe7dd","#ff7c38","#e03e36","#b80d57","#700961"],["#a7ff83","#17b978","#086972","#071a52","#80d6ff","#edf798","#fab57a","#f06868"],["#01608F","#EF91A9","#EB4626","#F4BA10","#34A096","#2C2F8C"],["#264653","#2a9d8f","#e9c46a","#f4a261","#e76f51"],["#e63946","#f1faee","#a8dadc","#457b9d","#1d3557"],["#2b2d42","#8d99ae","#edf2f4","#ef233c","#d90429"],["#003049","#d62828","#f77f00","#fcbf49","#eae2b7"],["#3d5a80","#98c1d9","#e0fbfc","#ee6c4d","#293241"],["#011627","#fdfffc","#2ec4b6","#e71d36","#ff9f1c"],["#283d3b","#197278","#edddd4","#c44536","#772e25"],["#2b2d42","#8d99ae","#edf2f4","#ef233c","#d80032"],["#50514f","#f25f5c","#ffe066","#247ba0","#70c1b3"],["#fffcf2","#ccc5b9","#403d39","#252422","#eb5e28"],["#177e89","#084c61","#db3a34","#ffc857","#323031"],["#002642","#840032","#e59500","#e5dada","#02040f"],["#0c0a3e","#7b1e7a","#b33f62","#f9564f","#f3c677"],["#b80c09","#0b4f6c","#01baef","#fbfbff","#040f16"],["#001427","#708d81","#f4d58d","#bf0603","#8d0801"],["#1f271b","#19647e","#28afb0","#f4d35e","#ee964b"],["#06aed5","#086788","#f0c808","#fff1d0","#dd1c1a"],["#011627","#fdfffc","#2ec4b6","#e71d36","#ff9f1c"],["#001524","#15616d","#ffecd1","#ff7d00","#78290f"],["#dad2d8","#143642","#0f8b8d","#ec9a29","#a8201a"],["#003049","#d62828","#f77f00","#fcbf49"],["#001427","#708d81","#f4d58d","#bf0603","#8d0801"],["#55dde0","#33658a","#2f4858","#f6ae2d","#f26419"],["#010417","#0029c1","#2bb59c","#f7dc09","#e22b00"],["#0c090d","#e01a4f","#f15946","#f9c22e","#53b3cb"],["#01638d","#abcecc","#fff2cd","#ff004c","#610d4b"],["#2d728f","#3b8ea5","#f5ee9e","#f49e4c","#ab3428"],["#d00000","#ffba08","#3f88c5","#032b43","#032b43"],["#e63946","#f1faee","#a8dadc","#457b9d","#1d3557"],["#083d77","#f4d35e","#ee964b","#f95738"],["#177e89","#084c61","#db3a34","#ffc857","#323031"],["#010000","#a74c00","#ffa100","#ffd300","#f1f2f1"],["#e6eed6","#bbc5aa","#a72608","#090c02"],["#011627","#fdfffc","#2ec4b6","#e71d36","#ff9f1c"],["#fff2cd","#abcecc","#01638d","#ff004c","#610d4b"],["#33658a","#86bbd8","#2f4858","#f6ae2d","#f26419"],["#001427","#708d81","#f4d58d","#bf0603","#8d0801"],["#820263","#d90368","#eadeda","#2e294e","#ffd400"],["#a832a0","#7d32a8","#598fb5","#fffb00"],["#335c67","#fff3b0","#e09f3e","#9e2a2b","#540b0e"],["#003f88","#00509d","#fdc500","#ffd500"],["#001427","#708d81","#f4d58d","#bf0603","#8d0801"],["#0d1b2a","#1b263b","#415a77","#778da9","#e0e1dd"],["#0c0f0a","#ff206e","#fbff12","#41ead4"],["#000000","#2f4550","#586f7c","#b8dbd9","#f4f4f9"],["#970005","#ed0101","#0c44ac","#000052"],["#ff6d69","#fecc50","#0be7fb","#010b8b","#1e0521"],["#c9e4ca","#87bba2","#55828b","#3b6064","#364958"]];let x;var y;console.log("\nmade by\n█▀▀ █░░█ ▀█░█▀ █▀▀ █▀▄▀█ █▀▀▄ █░░ █▀▀▄ █▀▀█\n▀▀█ █▀▀█ ░█▄█░ █▀▀ █░▀░█ █▀▀▄ █░░ █░░█ █▄▄▀\n▀▀▀ ▀░░▀ ░░▀░░ ▀▀▀ ▀░░░▀ ▀▀▀░ ▀▀▀ ▀▀▀░ ▀░▀▀\n ");const k=void 0;let v=(m=tokenData,parseInt(m.hash.slice(0,16),16)),C=v;var m;const F=new e(v),{rnd:S,range:M,rangeFloor:W,pick:E,shuffleArray:A}=F;let G,R;const _={};let N,z,D,H;function setup(){D=createCanvas(N,z),angleMode(DEGREES),R=createGraphics(N,z),G=()=>{H=.001*width,R.strokeCap(SQUARE),R.angleMode(DEGREES);const e=W(b.length-1);_.currentPalette=b[e];const t=S();_.shape=t<.05?"structure":t>=.05&&t<.08?"plexus":t>=.08&&t<.11?"tree":t>=.11&&t<.15?"grass":E(["unity","v-streams","h-streams","spiral","oscillations","curls","wall","v-storm","h-storm"]),_.size=10*H,"tree"===_.shape&&(_.size=12*H),_.waveR=M(.1,1),"tree"===_.shape&&(_.waveR=0),"v-streams"===_.shape&&(_.waveR=S()>.95?.9:M(.6,2)),"h-streams"===_.shape&&(_.waveR=M(.4,2)),"spiral"===_.shape&&(_.waveR=M(1,4)),"curls"===_.shape&&(_.waveR=M(.2,1.5)),"plexus"===_.shape&&(_.waveR=M(.3,4)),_.roots="structure"!==_.shape&&S()>.8,_.noFill=_.roots&&S()>.9;const h=S()>.8;_.roots?_.angle=h?M(20,180):E([30,60,90,120,150,180]):_.angle=h?M(20,100):E([30,60,90]),_.blackStroke=_.roots&&S()>.7,_.divider=_.roots?W(3,21):W(3,9),"tree"===_.shape&&(_.divider=W(3,6)),_.bigStroke="structure"!==_.shape&&S()>.95,_.longColors=S()>.7,_.rCount=200;const i=void 0,s=!["curls","plexus"].includes(_.shape)&&S()>.9;_.weeds=s?M(1,2):1,"wall"===_.shape&&(_.waveR=0,_.roots=!0),"unity"===_.shape&&(_.roots=S()>.1),"tree"===_.shape&&(_.rCount=1e3),_.colorCount=Math.round(map(S(),0,1,.5*_.rCount,1.5*_.rCount)),_.longColors&&(_.colorCount=Math.round(map(S(),0,1,1.5*_.rCount,3*_.rCount))),"structure"===_.shape&&(_.rCount=100,_.colorCount=Math.round(map(S(),0,1,100,300)));const{colorCount:n,rCount:r}=_,d=A(_.currentPalette);_.lerpColors=f(A(d),n).map((e=>color(e))),_.backColors=f(A(d),n/2).map((e=>color(e))),_.backColors2=f(A(d),n).map((e=>{const t=color(e);return t.setAlpha(100),t}));let o=[],a=[];if("h-storm"===_.shape)for(let e=.1*-height;e<1.1*height;e+=.2*height){const t=M(.25,.75),h=g(0,e,width*t,e+height*t,width*t,e-height*t,width,e,400);o=[...o,...h]}if("v-storm"===_.shape)for(let e=.1*-width;e<1.1*width;e+=.2*width){const t=M(.25,.75),h=g(e,0,e+width*t,height*t,e-width*t,height*t,e,height,400);o=[...o,...h]}if("wall"===_.shape){const e=new Array(200).fill(null).map((()=>({x:M(width),y:M(height)})));o=[...w(0,.05*height,width,.05*height,800),...w(0,1.2*height,width,1.2*height,800),...e]}if("plexus"===_.shape&&(o=[...q(width/2,.25*height,.6*width,180,400),...q(width/2,.5*height,.6*width,180,400),...q(width/2,.75*height,.6*width,180,400),...q(width/2,.25*height,.6*width,-180,400),...q(width/2,.5*height,.6*width,-180,400),...q(width/2,.75*height,.6*width,-180,400)]),"oscillations"===_.shape){const e=M(.8,1.2);o=[...O(width/2,height/2,width,360,1600,e),...O(width/2,height/2,.6*width,360,800,e)]}if("curls"===_.shape&&(o=Q(width/2,height/2,.7*width,360,1600,W(3,10))),"spiral"===_.shape){const e=I(width/2,height/2,width*M(.01,.005),1440,1600,.1);o=S()>.5?e.reverse():e}if("v-streams"===_.shape)for(let e=.1*width;e<width;e+=.2*width){const t=w(e,0,e,height,400);o=[...o,...t]}if("h-streams"===_.shape)for(let e=.1*height;e<height;e+=.2*height){const t=w(0,e,width,e,400);o=[...o,...t]}if("unity"===_.shape){const e=M(360),t=u(.5*width,.33*height,400,400,.3*width,e),h=u(.5*width,.66*height,400,400,.3*width,e);o=S()>.95?A([...t,...h]):[...t,...h]}if("structure"===_.shape){for(let e=.2*width;e<width;e+=.2*width){const t=w(e,.1*height,e,.9*height,400);o=[...o,...t]}for(let e=.2*height;e<height;e+=.2*height){const t=w(.1*width,e,.9*width,e,400);o=[...o,...t]}}if("gr
class e{constructor(e){this.seed=e,this.rnd=this.rnd.bind(this),this.range=this.range.bind(this),this.rangeFloor=this.rangeFloor.bind(this),this.pick=this.pick.bind(this),this.shuffleArray=this.shuffleArray.bind(this),this.gaussian=this.gaussian.bind(this),this._hasNextGaussian=!1,this._nextGaussian=null}setSeed(e){this.seed=e}rnd(){return this.seed^=this.seed<<13,this.seed^=this.seed>>17,this.seed^=this.seed<<5,(this.seed<0?1+~this.seed:this.seed)%1e3/1e3}range(e,t){return t?this.rnd()*(t-e)+e:this.rnd()*e}rangeFloor(e,t){return Math.floor(this.range(e,t))}pick(e){return e[this.rangeFloor(0,e.length)]}shuffleArray(e){for(var t,h,i=e.length,s=e.slice();i;)t=Math.floor(this.rnd()*i--),h=s[i],s[i]=s[t],s[t]=h;return s}gaussian(e,t){if(this._hasNextGaussian){this._hasNextGaussian=!1;var h=this._nextGaussian;return this._nextGaussian=null,e+t*h}var i=0,s=0,n=0;do{n=(i=2*this.rnd()-1)*i+(s=2*this.rnd()-1)*s}while(n>=1||0===n);var r=Math.sqrt(-2*Math.log(n)/n);return this._nextGaussian=s*r,this._hasNextGaussian=!0,e+t*(i*r)}pickSome(e,t){let h;return this.shuffleArray(e).slice(0,t)}}const t=(e,t,i,s=!1)=>s?h(e+(t-e)*i,0,1):e+(t-e)*i,h=(e,t,h)=>e<t?t:e>h?h:e,i=(e,t,h)=>Array.isArray(t)?t[e*t.length|0]:t||0===t?h||0===h?(t>h&&([t,h]=[h,t]),t+e()*(h-t)):e()*t:e(),s=(e,t,h,n,r,d,o,a,f,l)=>{if(r--,l||r>=0&&i(f)<o)if(h>=n){let l=h*i(f,a[0],a[1]);s(e,t,l,n,r,d,o,a,f),s(e+l,t,h-l,n,r,d,o,a,f)}else{let l=n*i(f,a[0],a[1]);s(e,t,h,l,r,d,o,a,f),s(e,t+l,h,n-l,r,d,o,a,f)}else d.push({x:e,y:t,w:h,h:n,n:r})},n=(e,t,h,s,r,d,o,a,f,l)=>{if(r--,l||r>=0&&i(f)<o){let l=h*i(f,a[0],a[1]);n(e,t,l,s,r,d,o,a,f),n(e+l,t,h-l,s,r,d,o,a,f)}else d.push({x:e,y:t,w:h,h:s,n:r})},r=(e,t,h,s,n,d,o,a,f,l)=>{if(n--,l||n>=0&&i(f)<o){let l=s*i(f,a[0],a[1]);r(e,t,h,l,n,d,o,a,f),r(e,t+l,h,s-l,n,d,o,a,f)}else d.push({x:e,y:t,w:h,h:s,n:n})},d=(e,t,h,i,s,n,r=.7,o,a)=>{if(s--,a||s>=0&&o()<r){let a=h/2,f=i/2;d(e,t,a,f,s,n,r,o),d(e+a,t,a,f,s,n,r,o),d(e+a,t+f,a,f,s,n,r,o),d(e,t+f,a,f,s,n,r,o)}else n.push({x:e,y:t,w:h,h:i,n:s})},o=(e,h,i)=>e.map(((s,n)=>t(e[n],h[n],i))),a=e=>[...e.substr(1)].reduce(((e,t,h,i)=>h%2?e.concat(parseInt(`${i[h-1]}${i[h]}`,16)):e),[]),f=(e,t)=>{const h=[],i=Math.ceil(t/e.length),s=1/i,n=e.map((e=>a(e)));for(let e=0;e<n.length;e+=1)for(let t=0;t<i;t+=1){const i=n[e],r=n[(e+1)%n.length];h.push(o(i,r,(t+1)*s))}return h},l=(e,t,h,i,s,n)=>{const r=i>=0?i:0,d=e.drawingContext.createRadialGradient(t,h,0,t,h,r);return s.forEach(((e,t)=>d.addColorStop(e,n[t]))),e.drawingContext.fillStyle=d,d},c=(e,t,h,i,s,n,r)=>{const d=e.drawingContext.createLinearGradient(t,h,i,s);return n.forEach(((e,t)=>d.addColorStop(e,r[t]))),e.drawingContext.fillStyle=d,d},g=(e,t,h,i,s,n,r,d,o)=>{const a=[];for(let f=0;f<=o;f+=1){const l=f/o,c=bezierPoint(e,h,s,r,l),g=bezierPoint(t,i,n,d,l);a.push({x:c,y:g})}return a},p=(e,t,h,i,s)=>{const n=[];for(let r=0;r<h;r+=1)n.push({x:e+i*cos(s),y:t+i*sin(s)}),s+=360/h;return n},u=(e,h,i,s,n,r)=>{const d=p(e,h,s,n,r),o=i/s,a=[];for(let e=0;e<s;e+=1)for(let h=0;h<o;h+=1){const i=t(d[e].x,d[(e+1)%d.length].x,h/o),s=t(d[e].y,d[(e+1)%d.length].y,h/o);a.push({x:i,y:s})}return a},w=(e,h,i,s,n)=>{const r=[];for(let d=0;d<n-1;d+=1){const o=t(e,i,d/(n-1)),a=t(h,s,d/(n-1));r.push({x:o,y:a})}return r.push({x:i,y:s}),r},b=[["#7400b8","#6930c3","#5e60ce","#5390d9","#4ea8de","#80ffdb"],["#F9FBFF","#212121","#F9FBFF","#212121","#F9FBFF","#212121"],["#efffff","#f20082","#5db1ff","#ff00ca","#3a0bba"],["#521262","#6639a6","#3490de","#6fe7dd","#ff7c38","#e03e36","#b80d57","#700961"],["#a7ff83","#17b978","#086972","#071a52","#80d6ff","#edf798","#fab57a","#f06868"],["#01608F","#EF91A9","#EB4626","#F4BA10","#34A096","#2C2F8C"],["#264653","#2a9d8f","#e9c46a","#f4a261","#e76f51"],["#e63946","#f1faee","#a8dadc","#457b9d","#1d3557"],["#2b2d42","#8d99ae","#edf2f4","#ef233c","#d90429"],["#003049","#d62828","#f77f00","#fcbf49","#eae2b7"],["#3d5a80","#98c1d9","#e0fbfc","#ee6c4d","#293241"],["#011627","#fdfffc","#2ec4b6","#e71d36","#ff9f1c"],["#283d3b","#197278","#edddd4","#c44536","#772e25"],["#2b2d42","#8d99ae","#edf2f4","#ef233c","#d80032"],["#50514f","#f25f5c","#ffe066","#247ba0","#70c1b3"],["#fffcf2","#ccc5b9","#403d39","#252422","#eb5e28"],["#177e89","#084c61","#db3a34","#ffc857","#323031"],["#002642","#840032","#e59500","#e5dada","#02040f"],["#0c0a3e","#7b1e7a","#b33f62","#f9564f","#f3c677"],["#b80c09","#0b4f6c","#01baef","#fbfbff","#040f16"],["#001427","#708d81","#f4d58d","#bf0603","#8d0801"],["#1f271b","#19647e","#28afb0","#f4d35e","#ee964b"],["#06aed5","#086788","#f0c808","#fff1d0","#dd1c1a"],["#011627","#fdfffc","#2ec4b6","#e71d36","#ff9f1c"],["#001524","#15616d","#ffecd1","#ff7d00","#78290f"],["#dad2d8","#143642","#0f8b8d","#ec9a29","#a8201a"],["#003049","#d62828","#f77f00","#fcbf49"],["#001427","#708d81","#f4d58d","#bf0603","#8d0801"],["#55dde0","#33658a","#2f4858","#f6ae2d","#f26419"],["#010417","#0029c1","#2bb59c","#f7dc09","#e22b00"],["#0c090d","#e01a4f","#f15946","#f9c22e","#53b3cb"],["#01638d","#abcecc","#fff2cd","#ff004c","#610d4b"],["#2d728f","#3b8ea5","#f5ee9e","#f49e4c","#ab3428"],["#d00000","#ffba08","#3f88c5","#032b43","#032b43"],["#e63946","#f1faee","#a8dadc","#457b9d","#1d3557"],["#083d77","#f4d35e","#ee964b","#f95738"],["#177e89","#084c61","#db3a34","#ffc857","#323031"],["#010000","#a74c00","#ffa100","#ffd300","#f1f2f1"],["#e6eed6","#bbc5aa","#a72608","#090c02"],["#011627","#fdfffc","#2ec4b6","#e71d36","#ff9f1c"],["#fff2cd","#abcecc","#01638d","#ff004c","#610d4b"],["#33658a","#86bbd8","#2f4858","#f6ae2d","#f26419"],["#001427","#708d81","#f4d58d","#bf0603","#8d0801"],["#820263","#d90368","#eadeda","#2e294e","#ffd400"],["#a832a0","#7d32a8","#598fb5","#fffb00"],["#335c67","#fff3b0","#e09f3e","#9e2a2b","#540b0e"],["#003f88","#00509d","#fdc500","#ffd500"],["#001427","#708d81","#f4d58d","#bf0603","#8d0801"],["#0d1b2a","#1b263b","#415a77","#778da9","#e0e1dd"],["#0c0f0a","#ff206e","#fbff12","#41ead4"],["#000000","#2f4550","#586f7c","#b8dbd9","#f4f4f9"],["#970005","#ed0101","#0c44ac","#000052"],["#ff6d69","#fecc50","#0be7fb","#010b8b","#1e0521"],["#c9e4ca","#87bba2","#55828b","#3b6064","#364958"]];var x;console.log("\nmade by\n█▀▀ █░░█ ▀█░█▀ █▀▀ █▀▄▀█ █▀▀▄ █░░ █▀▀▄ █▀▀█\n▀▀█ █▀▀█ ░█▄█░ █▀▀ █░▀░█ █▀▀▄ █░░ █░░█ █▄▄▀\n▀▀▀ ▀░░▀ ░░▀░░ ▀▀▀ ▀░░░▀ ▀▀▀░ ▀▀▀ ▀▀▀░ ▀░▀▀\n ");const y=void 0;let k=(C=tokenData,parseInt(C.hash.slice(0,16),16)),v=k;var C;const m=new e(k),{rnd:F,range:S,rangeFloor:M,pick:W,shuffleArray:E}=m;let A,G;const R={};let _,N,z,D;function setup(){z=createCanvas(_,N),angleMode(DEGREES),G=createGraphics(_,N),A=()=>{D=.001*width,G.strokeCap(SQUARE),G.angleMode(DEGREES);const e=M(b.length-1);R.currentPalette=b[e];const t=F();R.shape=t<.05?"structure":t>=.05&&t<.08?"plexus":t>=.08&&t<.11?"tree":t>=.11&&t<.15?"grass":W(["unity","v-streams","h-streams","spiral","oscillations","curls","wall","v-storm","h-storm"]),R.size=10*D,"tree"===R.shape&&(R.size=12*D),R.waveR=S(.1,1),"tree"===R.shape&&(R.waveR=0),"v-streams"===R.shape&&(R.waveR=F()>.95?.9:S(.6,2)),"h-streams"===R.shape&&(R.waveR=S(.4,2)),"spiral"===R.shape&&(R.waveR=S(1,4)),"curls"===R.shape&&(R.waveR=S(.2,1.5)),"plexus"===R.shape&&(R.waveR=S(.3,4)),R.roots="structure"!==R.shape&&F()>.8,R.noFill=R.roots&&F()>.9;const h=F()>.8;R.roots?R.angle=h?S(20,180):W([30,60,90,120,150,180]):R.angle=h?S(20,100):W([30,60,90]),R.blackStroke=R.roots&&F()>.7,R.divider=R.roots?M(3,21):M(3,9),"tree"===R.shape&&(R.divider=M(3,6)),R.bigStroke="structure"!==R.shape&&F()>.95,R.longColors=F()>.7,R.rCount=200;const i=void 0,s=!["curls","plexus"].includes(R.shape)&&F()>.9;R.weeds=s?S(1,2):1,"wall"===R.shape&&(R.waveR=0,R.roots=!0),"tree"===R.shape&&(R.rCount=1e3),R.colorCount=Math.round(map(F(),0,1,.5*R.rCount,1.5*R.rCount)),R.longColors&&(R.colorCount=Math.round(map(F(),0,1,1.5*R.rCount,3*R.rCount))),"structure"===R.shape&&(R.rCount=100,R.colorCount=Math.round(map(F(),0,1,100,300)));const{colorCount:n,rCount:r}=R,d=E(R.currentPalette);R.lerpColors=f(E(d),n).map((e=>color(e))),R.backColors=f(E(d),n/2).map((e=>color(e))),R.backColors2=f(E(d),n).map((e=>{const t=color(e);return t.setAlpha(100),t}));let o=[],a=[];if("h-storm"===R.shape)for(let e=.1*-height;e<1.1*height;e+=.2*height){const t=S(.25,.75),h=g(0,e,width*t,e+height*t,width*t,e-height*t,width,e,400);o=[...o,...h]}if("v-storm"===R.shape)for(let e=.1*-width;e<1.1*width;e+=.2*width){const t=S(.25,.75),h=g(e,0,e+width*t,height*t,e-width*t,height*t,e,height,400);o=[...o,...h]}if("wall"===R.shape){const e=new Array(200).fill(null).map((()=>({x:S(width),y:S(height)})));o=[...w(0,.05*height,width,.05*height,800),...w(0,1.2*height,width,1.2*height,800),...e]}if("plexus"===R.shape&&(o=[...O(width/2,.25*height,.6*width,180,400),...O(width/2,.5*height,.6*width,180,400),...O(width/2,.75*height,.6*width,180,400),...O(width/2,.25*height,.6*width,-180,400),...O(width/2,.5*height,.6*width,-180,400),...O(width/2,.75*height,.6*width,-180,400)]),"oscillations"===R.shape){const e=S(.8,1.2);o=[...I(width/2,height/2,width,360,1600,e),...I(width/2,height/2,.6*width,360,800,e)]}if("curls"===R.shape&&(o=q(width/2,height/2,.7*width,360,1600,M(3,10))),"spiral"===R.shape){const e=$(width/2,height/2,width*S(.01,.005),1440,1600,.1);o=F()>.5?e.reverse():e}if("v-streams"===R.shape)for(let e=.1*width;e<width;e+=.2*width){const t=w(e,0,e,height,400);o=[...o,...t]}if("h-streams"===R.shape)for(let e=.1*height;e<height;e+=.2*height){const t=w(0,e,width,e,400);o=[...o,...t]}if("unity"===R.shape){const e=S(360),t=u(.5*width,.33*height,400,400,.3*width,e),h=u(.5*width,.66*height,400,400,.3*width,e);o=F()>.95?E([...t,...h]):[...t,...h]}if("structure"===R.shape){for(let e=.2*width;e<width;e+=.2*width){const t=w(e,.1*height,e,.9*height,400);o=[...o,...t]}for(let e=.2*height;e<height;e+=.2*height){const t=w(.1*width,e,.9*width,e,400);o=[...o,...t]}}if("grass"===R.shape){for(let e=.05*-width;e<1.1
*width;e+=.2*width){const t=w(e,height*S(.1,.7),e,height,200);o=[...o,...t]}for(let e=.15*-width;e<1.1*width;e+=.2*width){const t=w(e,height*S(.1,.7),e,height,200);a=[...a,...t]}o=E(o),a=E(a)}if("tree"===R.shape){const e=u(width/2,height/3.5,400,400,.2*width,90);o=[...o,...e]}let p=R.divider,x=R.angle;const{lerpColors:y,backColors:k,backColors2:v}=R;G.background(255);const C=W(v),m=S(.2,.8),A=S(.05,.15);"grass"===R.shape?(G.push(),G.noStroke(),l(G,width*S(.1,.9),height*S(.1,.3),width/2,[0,m-A,m,m+A,1],[W(v),C,C,C,W(v)]),G.rect(0,0,width,height),G.pop()):"spiral"===R.shape?(G.push(),G.noStroke(),l(G,.5*width,.5*height,width/2,[0,1],[W(v),W(v)]),G.rect(0,0,width,height),G.pop()):"structure"===R.shape?G.background(W(v)):(G.push(),G.noStroke(),c(G,width/2,0,width/2,height,[0,m-A,m,m+A,1],[W(v),C,C,C,W(v)]),G.rect(0,0,width,height),G.pop());const _=W(y),N=W(y);G.push(),G.noFill(),G.strokeWeight(20*D),G.stroke(_),G.rect(0,0,width,height),G.pop(),G.push(),G.noFill(),G.strokeWeight(2*D),G.stroke(N),G.rect(5*D,5*D,width-10*D,height-10*D),G.pop();for(let e=0;e<o.length;e+=1){const t=r,h=r,i=Math.max(t,h);let s=map(cos(e*R.waveR),-1,1,0,R.size),n,d;"tree"===R.shape?(n=L(o[e].x,o[e].y,s,t,x,width,0,1.1*height,1.1*height),d=L(o[e].x,o[e].y,s,h,x,1.1*width,.1*-width,height,.1*-height)):"grass"===R.shape?(n=L(o[e].x,o[e].y,s,t,x,width,0,1.1*height,1.1*height),d=L(a[e].x,a[e].y,s,h,x,width,0,1.1*height,1.1*height)):"structure"===R.shape?(n=L(o[e].x,o[e].y,s,t,x,width,0,height,0),d=L(o[e].x,o[e].y,s,h,x,width,0,height,0)):(n=L(o[e].x,o[e].y,s,t,x,1.1*width,.1*-width,1.1*height,R.roots?1.1*height:0),d=L(o[e].x,o[e].y,s,h,x,1.1*width,.1*-width,height,.1*-height));for(let t=0;t<i-20;t+=1)e%p==0?(G.push(),G.beginShape(),G.fill(y[t%y.length]),R.noFill&&G.noFill(),G.strokeWeight(.5*D),G.stroke(y[(t+Math.round(.1*y.length))%y.length]),R.blackStroke&&G.stroke(0),G.vertex(n[t%n.length].x,n[t%n.length].y),G.bezierVertex(n[t%n.length].x,n[t%n.length].y,n[(t+M(10))%n.length].x,n[(t+M(10))%n.length].y,n[(t+20)%n.length].x,n[(t+20)%n.length].y),G.vertex(n[t%n.length].x,n[(t+1)%n.length].y),G.vertex(n[t%n.length].x,n[(t+2)%n.length].y),G.endShape(CLOSE),e%10==0&&(G.push(),G.strokeWeight(.5*D),G.stroke(k[0]),n[t%d.length].y>0&&n[t%d.length].y<height&&G.stroke(k[Math.round(map(n[t%n.length].y,height,0,0,k.length-1))]),G.fill(k[Math.round(map(sin(5*t),-1,1,0,k.length-1))]),G.circle(n[t%n.length].x,n[t%n.length].y,S(1,5)*D),G.pop()),G.pop()):(G.push(),G.beginShape(),G.fill(k[t%k.length]),G.fill(k[Math.round(map(sin(5*t),-1,1,0,k.length-1))]),G.strokeWeight(.5*D),G.stroke(k[(t+Math.round(.1*k.length))%k.length]),G.stroke(k[0]),d[t%d.length].y>0&&d[t%d.length].y<height&&G.stroke(k[Math.round(map(d[t%d.length].y,0,height,0,k.length-1))]),"tree"!==R.shape&&"structure"!==R.shape||G.stroke(k[(t+Math.round(.1*k.length))%k.length]),G.strokeWeight(F()*D),R.bigStroke&&(G.strokeWeight(5*D),G.stroke(k[(t+Math.round(.1*k.length))%k.length])),G.vertex(d[t%d.length].x,d[t%d.length].y),G.vertex(d[(t+1)%d.length].x,d[(t+1)%d.length].y),G.vertex(d[(t+2)%d.length].x,d[(t+2)%d.length].y),G.endShape(CLOSE),G.pop()),e%10==0&&(G.push(),G.strokeWeight(.5*D),G.stroke(y[(t+Math.round(.1*y.length))%y.length]),G.fill(k[t%k.length]),"wall"===R.shape?G.circle(n[t%n.length].x,n[t%n.length].y,map(sin(10*t),-1,1,1,s/2)):G.circle(n[t%n.length].x,n[t%n.length].y,S(D,s)),G.pop())}G.push(),G.noFill(),G.strokeWeight(2*D),G.stroke(N),G.rect(5*D,5*D,width-10*D,height-10*D),G.pop(),push(),noStroke(),rect(0,0,width,height),drawingContext.clip(),image(G,0,0),pop()},A()}function H(){const e=void 0,t=z.canvas.style;let h,i;.75*window.innerHeight>=window.innerWidth?(h=window.innerWidth,i=window.innerWidth/.75):(i=window.innerHeight,h=.75*window.innerHeight),t.position="absolute",t.display="block",t.top=t.left=t.right=t.structure="0",t.width=`${h}px`,t.height=`${i}px`}function windowResized(){H()}.75*window.innerHeight>=window.innerWidth?(_=window.innerWidth,N=window.innerWidth/.75):(N=window.innerHeight,_=.75*window.innerHeight);const B=[1,2,3,4,5,6,7,8,9];window.addEventListener("keydown",(e=>{B.includes(Number(e.key))&&(G.pixelDensity(Number(e.key)),pixelDensity(Number(e.key)),m.setSeed(v),A()),"s"===e.key&&saveCanvas(tokenData.tokenId,"png")}));const L=(e,t,h,i,s,n,r,d,o)=>{const a=[];let f={x:e,y:t},l=0;for(let e=0;e<i;e+=1){let t;t=P(f,e%2==0?h:h*R.weeds,l,n,r,d,o),f=t,a.push(t),l+=s}return a},P=(e,t,h,i,s,n,r)=>{const d={};return e.x+t>i?d.x=e.x-t:e.x-t<s?d.x=e.x+t:d.x=e.x+W([t*cos(h),t*sin(h)]),e.y+t>n?d.y=e.y-t:e.y-t<r?d.y=e.y+t:d.y=e.y+W([t*cos(h),t*sin(h)]),d},$=(e,t,h,i,s,n)=>{const r=[];let d=0,o=n;for(let a=0;a<s;a+=1)r.push({x:e+h*G.cos(d)*o,y:t+h*G.sin(d)*o}),d+=i/s,o+=n;return r},I=(e,t,h,i,s,n)=>{const r=[];let d=0;for(let o=0;o<s;o+=1)r.push({x:e+h*G.sin(d)*G.cos(d),y:t+h*G.cos(d*n)}),d+=i/s;return r},O=(e,t,h,i,s)=>{const n=[];let r=0;for(let d=0;d<s;d+=1)n.push({x:e+h*G.cos(r),y:t+h*G.sin(r)*G.cos(r)}),r+=i/s;return n},q=(e,t,h,i,s,n)=>{const r=[];let d=0;for(let o=0;o<s;o+=1)r.push({x:e+h*G.sin(d*n)*G.cos(d*n),y:t+h*G.cos(d)}),d+=i/s;return r};
class e{constructor(e){this.seed=e,this.rnd=this.rnd.bind(this),this.range=this.range.bind(this),this.rangeFloor=this.rangeFloor.bind(this),this.pick=this.pick.bind(this),this.shuffleArray=this.shuffleArray.bind(this),this.gaussian=this.gaussian.bind(this),this._hasNextGaussian=!1,this._nextGaussian=null}setSeed(e){this.seed=e}rnd(){return this.seed^=this.seed<<13,this.seed^=this.seed>>17,this.seed^=this.seed<<5,(this.seed<0?1+~this.seed:this.seed)%1e3/1e3}range(e,t){return t?this.rnd()*(t-e)+e:this.rnd()*e}rangeFloor(e,t){return Math.floor(this.range(e,t))}pick(e){return e[this.rangeFloor(0,e.length)]}shuffleArray(e){for(var t,h,i=e.length,s=e.slice();i;)t=Math.floor(this.rnd()*i--),h=s[i],s[i]=s[t],s[t]=h;return s}gaussian(e,t){if(this._hasNextGaussian){this._hasNextGaussian=!1;var h=this._nextGaussian;return this._nextGaussian=null,e+t*h}var i=0,s=0,n=0;do{n=(i=2*this.rnd()-1)*i+(s=2*this.rnd()-1)*s}while(n>=1||0===n);var r=Math.sqrt(-2*Math.log(n)/n);return this._nextGaussian=s*r,this._hasNextGaussian=!0,e+t*(i*r)}pickSome(e,t){let h;return this.shuffleArray(e).slice(0,t)}}const t=(e,t,i,s=!1)=>s?h(e+(t-e)*i,0,1):e+(t-e)*i,h=(e,t,h)=>e<t?t:e>h?h:e,i=(e,t,h)=>Array.isArray(t)?t[e*t.length|0]:t||0===t?h||0===h?(t>h&&([t,h]=[h,t]),t+e()*(h-t)):e()*t:e(),s=(e,t,h,n,r,d,o,a,f,l)=>{if(r--,l||r>=0&&i(f)<o)if(h>=n){let l=h*i(f,a[0],a[1]);s(e,t,l,n,r,d,o,a,f),s(e+l,t,h-l,n,r,d,o,a,f)}else{let l=n*i(f,a[0],a[1]);s(e,t,h,l,r,d,o,a,f),s(e,t+l,h,n-l,r,d,o,a,f)}else d.push({x:e,y:t,w:h,h:n,n:r})},n=(e,t,h,s,r,d,o,a,f,l)=>{if(r--,l||r>=0&&i(f)<o){let l=h*i(f,a[0],a[1]);n(e,t,l,s,r,d,o,a,f),n(e+l,t,h-l,s,r,d,o,a,f)}else d.push({x:e,y:t,w:h,h:s,n:r})},r=(e,t,h,s,n,d,o,a,f,l)=>{if(n--,l||n>=0&&i(f)<o){let l=s*i(f,a[0],a[1]);r(e,t,h,l,n,d,o,a,f),r(e,t+l,h,s-l,n,d,o,a,f)}else d.push({x:e,y:t,w:h,h:s,n:n})},d=(e,t,h,i,s,n,r=.7,o,a)=>{if(s--,a||s>=0&&o()<r){let a=h/2,f=i/2;d(e,t,a,f,s,n,r,o),d(e+a,t,a,f,s,n,r,o),d(e+a,t+f,a,f,s,n,r,o),d(e,t+f,a,f,s,n,r,o)}else n.push({x:e,y:t,w:h,h:i,n:s})},o=(e,h,i)=>e.map(((s,n)=>t(e[n],h[n],i))),a=e=>[...e.substr(1)].reduce(((e,t,h,i)=>h%2?e.concat(parseInt(`${i[h-1]}${i[h]}`,16)):e),[]),f=(e,t)=>{const h=[],i=Math.ceil(t/e.length),s=1/i,n=e.map((e=>a(e)));for(let e=0;e<n.length;e+=1)for(let t=0;t<i;t+=1){const i=n[e],r=n[(e+1)%n.length];h.push(o(i,r,(t+1)*s))}return h},l=(e,t,h,i,s,n)=>{const r=i>=0?i:0,d=e.drawingContext.createRadialGradient(t,h,0,t,h,r);return s.forEach(((e,t)=>d.addColorStop(e,n[t]))),e.drawingContext.fillStyle=d,d},c=(e,t,h,i,s,n,r)=>{const d=e.drawingContext.createLinearGradient(t,h,i,s);return n.forEach(((e,t)=>d.addColorStop(e,r[t]))),e.drawingContext.fillStyle=d,d},g=(e,t,h,i,s,n,r,d,o)=>{const a=[];for(let f=0;f<=o;f+=1){const l=f/o,c=bezierPoint(e,h,s,r,l),g=bezierPoint(t,i,n,d,l);a.push({x:c,y:g})}return a},p=(e,t,h,i,s)=>{const n=[];for(let r=0;r<h;r+=1)n.push({x:e+i*cos(s),y:t+i*sin(s)}),s+=360/h;return n},u=(e,h,i,s,n,r)=>{const d=p(e,h,s,n,r),o=i/s,a=[];for(let e=0;e<s;e+=1)for(let h=0;h<o;h+=1){const i=t(d[e].x,d[(e+1)%d.length].x,h/o),s=t(d[e].y,d[(e+1)%d.length].y,h/o);a.push({x:i,y:s})}return a},w=(e,h,i,s,n)=>{const r=[];for(let d=0;d<n-1;d+=1){const o=t(e,i,d/(n-1)),a=t(h,s,d/(n-1));r.push({x:o,y:a})}return r.push({x:i,y:s}),r},b=[["#7400b8","#6930c3","#5e60ce","#5390d9","#4ea8de","#80ffdb"],["#F9FBFF","#212121","#F9FBFF","#212121","#F9FBFF","#212121"],["#efffff","#f20082","#5db1ff","#ff00ca","#3a0bba"],["#521262","#6639a6","#3490de","#6fe7dd","#ff7c38","#e03e36","#b80d57","#700961"],["#a7ff83","#17b978","#086972","#071a52","#80d6ff","#edf798","#fab57a","#f06868"],["#01608F","#EF91A9","#EB4626","#F4BA10","#34A096","#2C2F8C"],["#264653","#2a9d8f","#e9c46a","#f4a261","#e76f51"],["#e63946","#f1faee","#a8dadc","#457b9d","#1d3557"],["#2b2d42","#8d99ae","#edf2f4","#ef233c","#d90429"],["#003049","#d62828","#f77f00","#fcbf49","#eae2b7"],["#3d5a80","#98c1d9","#e0fbfc","#ee6c4d","#293241"],["#011627","#fdfffc","#2ec4b6","#e71d36","#ff9f1c"],["#283d3b","#197278","#edddd4","#c44536","#772e25"],["#2b2d42","#8d99ae","#edf2f4","#ef233c","#d80032"],["#50514f","#f25f5c","#ffe066","#247ba0","#70c1b3"],["#fffcf2","#ccc5b9","#403d39","#252422","#eb5e28"],["#177e89","#084c61","#db3a34","#ffc857","#323031"],["#002642","#840032","#e59500","#e5dada","#02040f"],["#0c0a3e","#7b1e7a","#b33f62","#f9564f","#f3c677"],["#b80c09","#0b4f6c","#01baef","#fbfbff","#040f16"],["#001427","#708d81","#f4d58d","#bf0603","#8d0801"],["#1f271b","#19647e","#28afb0","#f4d35e","#ee964b"],["#06aed5","#086788","#f0c808","#fff1d0","#dd1c1a"],["#011627","#fdfffc","#2ec4b6","#e71d36","#ff9f1c"],["#001524","#15616d","#ffecd1","#ff7d00","#78290f"],["#dad2d8","#143642","#0f8b8d","#ec9a29","#a8201a"],["#003049","#d62828","#f77f00","#fcbf49"],["#001427","#708d81","#f4d58d","#bf0603","#8d0801"],["#55dde0","#33658a","#2f4858","#f6ae2d","#f26419"],["#010417","#0029c1","#2bb59c","#f7dc09","#e22b00"],["#0c090d","#e01a4f","#f15946","#f9c22e","#53b3cb"],["#01638d","#abcecc","#fff2cd","#ff004c","#610d4b"],["#2d728f","#3b8ea5","#f5ee9e","#f49e4c","#ab3428"],["#d00000","#ffba08","#3f88c5","#032b43","#032b43"],["#e63946","#f1faee","#a8dadc","#457b9d","#1d3557"],["#083d77","#f4d35e","#ee964b","#f95738"],["#177e89","#084c61","#db3a34","#ffc857","#323031"],["#010000","#a74c00","#ffa100","#ffd300","#f1f2f1"],["#e6eed6","#bbc5aa","#a72608","#090c02"],["#011627","#fdfffc","#2ec4b6","#e71d36","#ff9f1c"],["#fff2cd","#abcecc","#01638d","#ff004c","#610d4b"],["#33658a","#86bbd8","#2f4858","#f6ae2d","#f26419"],["#001427","#708d81","#f4d58d","#bf0603","#8d0801"],["#820263","#d90368","#eadeda","#2e294e","#ffd400"],["#a832a0","#7d32a8","#598fb5","#fffb00"],["#335c67","#fff3b0","#e09f3e","#9e2a2b","#540b0e"],["#003f88","#00509d","#fdc500","#ffd500"],["#001427","#708d81","#f4d58d","#bf0603","#8d0801"],["#0d1b2a","#1b263b","#415a77","#778da9","#e0e1dd"],["#0c0f0a","#ff206e","#fbff12","#41ead4"],["#000000","#2f4550","#586f7c","#b8dbd9","#f4f4f9"],["#970005","#ed0101","#0c44ac","#000052"],["#ff6d69","#fecc50","#0be7fb","#010b8b","#1e0521"],["#c9e4ca","#87bba2","#55828b","#3b6064","#364958"]];var x;console.log("\nmade by\n█▀▀ █░░█ ▀█░█▀ █▀▀ █▀▄▀█ █▀▀▄ █░░ █▀▀▄ █▀▀█\n▀▀█ █▀▀█ ░█▄█░ █▀▀ █░▀░█ █▀▀▄ █░░ █░░█ █▄▄▀\n▀▀▀ ▀░░▀ ░░▀░░ ▀▀▀ ▀░░░▀ ▀▀▀░ ▀▀▀ ▀▀▀░ ▀░▀▀\n ");const y=void 0;let k=(C=tokenData,parseInt(C.hash.slice(0,16),16)),v=k;var C;const m=new e(k),{rnd:F,range:S,rangeFloor:M,pick:W,shuffleArray:E}=m;let A,G;const R={};let _,N,z,D;function setup(){z=createCanvas(_,N),angleMode(DEGREES),G=createGraphics(_,N),A=()=>{D=.001*width,G.strokeCap(SQUARE),G.angleMode(DEGREES);const e=M(b.length-1);R.currentPalette=b[e];const t=F();R.shape=t<.05?"structure":t>=.05&&t<.08?"plexus":t>=.08&&t<.11?"tree":t>=.11&&t<.15?"grass":W(["unity","v-streams","h-streams","spiral","oscillations","curls","wall","v-storm","h-storm"]),R.size=10*D,"tree"===R.shape&&(R.size=12*D),R.waveR=S(.1,1),"tree"===R.shape&&(R.waveR=0),"v-streams"===R.shape&&(R.waveR=F()>.95?.9:S(.6,2)),"h-streams"===R.shape&&(R.waveR=S(.4,2)),"spiral"===R.shape&&(R.waveR=S(1,4)),"curls"===R.shape&&(R.waveR=S(.2,1.5)),"plexus"===R.shape&&(R.waveR=S(.3,4)),R.roots="structure"!==R.shape&&F()>.5,R.noFill=R.roots&&F()>.9;const h=F()>.8;R.roots?R.angle=h?S(20,180):W([30,60,90,120,150,180]):R.angle=h?S(20,100):W([30,60,90]),R.blackStroke=R.roots&&F()>.7,R.divider=R.roots?M(3,21):M(3,9),"tree"===R.shape&&(R.divider=M(3,6)),R.bigStroke="structure"!==R.shape&&F()>.95,R.longColors=F()>.7,R.rCount=200;const i=void 0,s=!["curls","plexus"].includes(R.shape)&&F()>.9;R.weeds=s?S(1,2):1,"wall"===R.shape&&(R.waveR=0,R.roots=!0),"tree"===R.shape&&(R.rCount=1e3),R.colorCount=Math.round(map(F(),0,1,.5*R.rCount,1.5*R.rCount)),R.longColors&&(R.colorCount=Math.round(map(F(),0,1,1.5*R.rCount,3*R.rCount))),"structure"===R.shape&&(R.rCount=100,R.colorCount=Math.round(map(F(),0,1,100,300)));const{colorCount:n,rCount:r}=R,d=E(R.currentPalette);R.lerpColors=f(E(d),n).map((e=>color(e))),R.backColors=f(E(d),n/2).map((e=>color(e))),R.backColors2=f(E(d),n).map((e=>{const t=color(e);return t.setAlpha(100),t}));let o=[],a=[];if("h-storm"===R.shape)for(let e=.1*-height;e<1.1*height;e+=.2*height){const t=S(.25,.75),h=g(0,e,width*t,e+height*t,width*t,e-height*t,width,e,400);o=[...o,...h]}if("v-storm"===R.shape)for(let e=.1*-width;e<1.1*width;e+=.2*width){const t=S(.25,.75),h=g(e,0,e+width*t,height*t,e-width*t,height*t,e,height,400);o=[...o,...h]}if("wall"===R.shape){const e=new Array(200).fill(null).map((()=>({x:S(width),y:S(height)})));o=[...w(0,.05*height,width,.05*height,800),...w(0,1.2*height,width,1.2*height,800),...e]}if("plexus"===R.shape&&(o=[...O(width/2,.25*height,.6*width,180,400),...O(width/2,.5*height,.6*width,180,400),...O(width/2,.75*height,.6*width,180,400),...O(width/2,.25*height,.6*width,-180,400),...O(width/2,.5*height,.6*width,-180,400),...O(width/2,.75*height,.6*width,-180,400)]),"oscillations"===R.shape){const e=S(.8,1.2);o=[...I(width/2,height/2,width,360,1600,e),...I(width/2,height/2,.6*width,360,800,e)]}if("curls"===R.shape&&(o=q(width/2,height/2,.7*width,360,1600,M(3,10))),"spiral"===R.shape){const e=$(width/2,height/2,width*S(.01,.005),1440,1600,.1);o=F()>.5?e.reverse():e}if("v-streams"===R.shape)for(let e=.1*width;e<width;e+=.2*width){const t=w(e,0,e,height,400);o=[...o,...t]}if("h-streams"===R.shape)for(let e=.1*height;e<height;e+=.2*height){const t=w(0,e,width,e,400);o=[...o,...t]}if("unity"===R.shape){const e=S(360),t=u(.5*width,.33*height,400,400,.3*width,e),h=u(.5*width,.66*height,400,400,.3*width,e);o=F()>.95?E([...t,...h]):[...t,...h]}if("structure"===R.shape){for(let e=.2*width;e<width;e+=.2*width){const t=w(e,.1*height,e,.9*height,400);o=[...o,...t]}for(let e=.2*height;e<height;e+=.2*height){const t=w(.1*width,e,.9*width,e,400);o=[...o,...t]}}if("grass"===R.shape){for(let e=.05*-width;e<1.1
It is a form of plant that exists on a planet with constantly changing gravitational flows. They exist in united colonies, floating endlessly in the air taking bizarre shapes and constantly changing color under the influence of temperature, different gases, and radiation of the stars surrounding the planet. Each colony goes through many cycles, migrating along the entire surface of the planet. In places where gravity weakens, plants put down "roots" and attach themselves to the planet's surface. There is still debate about the intelligence (collective intelligence) of AIXXA plants. They are listed as an inheritance of the Vtolmr planetary system and are protected by an intergalactic convention. Only 600 images of these plants were allowed, after which access to the planet was denied to all but the inhabitants of this planetary system. These images depict various forms, phases, and states of AIXXA plant colonies. Unfortunately, some of them are so rare that only a few specimens could be captured. It is believed that anyone who has such an image in their collection can draw endless inspiration from it because these plants are ascribed magical properties. But there is no scientific proof of it. Nevertheless, the hunt for these images by collectors has become legendary and has been described in many works of literature after the 34th century when they were released. This is the TBOA club's first on-chain project.
It is a form of plant that exists on a planet with constantly changing gravitational flows. They exist in united colonies, floating endlessly in the air taking bizarre shapes and constantly changing color under the influence of temperature, different gases and radiation of the stars surrounding the planet. Each colony goes through many cycles, migrating along the entire surface of the planet. In places where gravity weakens, plants put down "roots" and attach themselves to the planet's surface. There is still debate about the intelligence (collective intelligence) of AIXXA plants. They are listed as an inheritance of the Vtolmr planetary system and are protected by an intergalactic convention. Only 600 images of these plants were allowed, after which access to the planet was denied to all but the inhabitants of this planetary system. These images depict various forms, phases, and states of AIXXA plant colonies. Unfortunately some of them are so rare that only a few specimens could be captured. It is believed that anyone who has such an image in their collection can draw endless inspiration from it because these plants are ascribed magical properties. But there is no scientific proof of it. Nevertheless, the hunt for these images by collectors has become legendary and has been described in many works of literature after the 34th century when they were released. This is the TBOA club's first on-chain project.
1200,.1);a=S()>.5?e.reverse():e}if("v-streams"===P.shape)for(let e=.1*width;e<width;e+=.2*width){const t=y(e,0,e,height,400);a=[...a,...t]}if("h-streams"===P.shape)for(let e=.1*height;e<height;e+=.2*height){const t=y(0,e,width,e,400);a=[...a,...t]}if("unity"===P.shape){const e=M(360),t=x(.5*width,.33*height,400,400,.3*width,e),h=x(.5*width,.66*height,400,400,.3*width,e);a=S()>.95?G([...t,...h]):[...t,...h]}if("structure"===P.shape){for(let e=.2*width;e<width;e+=.2*width){const t=y(e,.1*height,e,.9*height,400);a=[...a,...t]}for(let e=.2*height;e<height;e+=.2*height){const t=y(.1*width,e,.9*width,e,400);a=[...a,...t]}}if("grass"===P.shape){for(let e=.05*-width;e<1.1*width;e+=.2*width){const t=y(e,height*M(.1,.7),e,height,200);a=[...a,...t]}for(let e=.15*-width;e<1.1*width;e+=.2*width){const t=y(e,height*M(.1,.7),e,height,200);d=[...d,...t]}a=G(a),d=G(d)}if("tree"===P.shape){const e=x(width/2,height/3.5,400,400,.2*width,90);a=[...a,...e]}let f=P.divider,l=P.angle;const{lerpColors:c,backColors:b,backColors2:k}=P;L.background(255);const m=_(k),C=M(.2,.8),F=M(.05,.15);"grass"===P.shape?(L.push(),L.noStroke(),u(L,width*M(.1,.9),height*M(.1,.3),width/2,[0,C-F,C,C+F,1],[_(k),m,m,m,_(k)]),L.rect(0,0,width,height),L.pop()):"spiral"===P.shape?(L.push(),L.noStroke(),u(L,.5*width,.5*height,width/2,[0,1],[_(k),_(k)]),L.rect(0,0,width,height),L.pop()):"structure"===P.shape?L.background(_(k)):(L.push(),L.noStroke(),p(L,width/2,0,width/2,height,[0,C-F,C,C+F,1],[_(k),m,m,m,_(k)]),L.rect(0,0,width,height),L.pop());const W=_(c),R=_(c);L.push(),L.noFill(),L.strokeWeight(20*B),L.stroke(W),L.rect(0,0,width,height),L.pop(),L.push(),L.noFill(),L.strokeWeight(2*B),L.stroke(R),L.rect(5*B,5*B,width-10*B,height-10*B),L.pop();for(let e=0;e<a.length;e+=1){const t=r,h=r,i=Math.max(t,h);let n=map(cos(e*P.waveR),-1,1,0,P.size),s,o;"tree"===P.shape?(s=$(a[e].x,a[e].y,n,t,l,width,0,1.1*height,1.1*height),o=$(a[e].x,a[e].y,n,h,l,1.1*width,.1*-width,height,.1*-height)):"grass"===P.shape?(s=$(a[e].x,a[e].y,n,t,l,width,0,1.1*height,1.1*height),o=$(d[e].x,d[e].y,n,h,l,width,0,1.1*height,1.1*height)):"structure"===P.shape?(s=$(a[e].x,a[e].y,n,t,l,width,0,height,0),o=$(a[e].x,a[e].y,n,h,l,width,0,height,0)):(s=$(a[e].x,a[e].y,n,t,l,1.1*width,.1*-width,1.1*height,P.roots?1.1*height:0),o=$(a[e].x,a[e].y,n,h,l,1.1*width,.1*-width,height,.1*-height));for(let t=0;t<i-20;t+=1)e%f==0?(L.push(),L.beginShape(),L.fill(c[t%c.length]),P.noFill&&L.noFill(),L.strokeWeight(.5*B),L.stroke(c[(t+Math.round(.1*c.length))%c.length]),P.blackStroke&&L.stroke(0),L.vertex(s[t%s.length].x,s[t%s.length].y),L.bezierVertex(s[t%s.length].x,s[t%s.length].y,s[(t+E(10))%s.length].x,s[(t+E(10))%s.length].y,s[(t+20)%s.length].x,s[(t+20)%s.length].y),L.vertex(s[t%s.length].x,s[(t+1)%s.length].y),L.vertex(s[t%s.length].x,s[(t+2)%s.length].y),L.endShape(CLOSE),e%10==0&&(L.push(),L.strokeWeight(.5*B),L.stroke(b[0]),s[t%o.length].y>0&&s[t%o.length].y<height&&L.stroke(b[Math.round(map(s[t%s.length].y,height,0,0,b.length-1))]),L.fill(b[Math.round(map(sin(5*t),-1,1,0,b.length-1))]),L.circle(s[t%s.length].x,s[t%s.length].y,M(1,5)*B),L.pop()),L.pop()):(L.push(),L.beginShape(),L.fill(b[t%b.length]),L.fill(b[Math.round(map(sin(5*t),-1,1,0,b.length-1))]),L.strokeWeight(.5*B),L.stroke(b[(t+Math.round(.1*b.length))%b.length]),L.stroke(b[0]),o[t%o.length].y>0&&o[t%o.length].y<height&&L.stroke(b[Math.round(map(o[t%o.length].y,0,height,0,b.length-1))]),"tree"!==P.shape&&"structure"!==P.shape||L.stroke(b[(t+Math.round(.1*b.length))%b.length]),L.strokeWeight(S()*B),P.bigStroke&&(L.strokeWeight(5*B),L.stroke(b[(t+Math.round(.1*b.length))%b.length])),L.vertex(o[t%o.length].x,o[t%o.length].y),L.vertex(o[(t+1)%o.length].x,o[(t+1)%o.length].y),L.vertex(o[(t+2)%o.length].x,o[(t+2)%o.length].y),L.endShape(CLOSE),L.pop()),e%10==0&&(L.push(),L.strokeWeight(.5*B),L.stroke(c[(t+Math.round(.1*c.length))%c.length]),L.fill(b[t%b.length]),"wall"===P.shape?L.circle(s[t%s.length].x,s[t%s.length].y,map(sin(10*t),-1,1,1,n/2)):L.circle(s[t%s.length].x,s[t%s.length].y,M(B,n)),L.pop())}L.push(),L.noFill(),L.strokeWeight(2*B),L.stroke(R),L.rect(5*B,5*B,width-10*B,height-10*B),L.pop(),push(),shader(A),A.setUniform("p",L),A.setUniform("rr",random()),A.setUniform("resolution",[width,height]),A.setUniform("pd",pixelDensity()),quad(-1,-1,1,-1,1,1,-1,1),pop()},R()}function H(){const e=void 0,t=z.canvas.style;let h,i;.75*window.innerHeight>=window.innerWidth?(h=window.innerWidth,i=window.innerWidth/.75):(i=window.innerHeight,h=.75*window.innerHeight),t.position="absolute",t.display="block",t.top=t.left=t.right=t.structure="0",t.width=`${h}px`,t.height=`${i}px`}function windowResized(){H()}.75*window.innerHeight>=window.innerWidth?(D=window.innerWidth,N=window.innerWidth/.75):(N=window.innerHeight,D=.75*window.innerHeight);const U=()=>{console.log("click")};window.addEventListener("click",U),window.addEventListener("touchstart",U);const I=[1,2,3,4,5,6,7,8,9];window.addEventListener("keydown",(e=>{I.includes(Number(e.key))&&(L.pixelDensity(Number(e.key)),pixelDensity(Number(e.key)),R()),"s"===e.key&&saveCanvas(tokenData.structure,"png")}));const $=(e,t,h,i,n,s,r,o,a)=>{const d=[];let f={x:e,y:t},l=0;for(let e=0;e<i;e+=1){let t;t=q(f,e%2==0?h:h*P.weeds,l,s,r,o,a),f=t,d.push(t),l+=n}return d},q=(e,t,h,i,n,s,r)=>{const o={};return e.x+t>i?o.x=e.x-t:e.x-t<n?o.x=e.x+t:o.x=e.x+_([t*cos(h),t*sin(h)]),e.y+t>s?o.y=e.y-t:e.y-t<r?o.y=e.y+t:o.y=e.y+_([t*cos(h),t*sin(h)]),o},O=(e,t,h,i,n,s)=>{const r=[];let o=0,a=s;for(let d=0;d<n;d+=1)r.push({x:e+h*L.cos(o)*a,y:t+h*L.sin(o)*a}),o+=i/n,a+=s;return r},Y=(e,t,h,i,n,s)=>{const r=[];let o=0;for(let a=0;a<n;a+=1)r.push({x:e+h*L.sin(o)*L.cos(o),y:t+h*L.cos(o*s)}),o+=i/n;return r},Q=(e,t,h,i,n)=>{const s=[];let r=0;for(let o=0;o<n;o+=1)s.push({x:e+h*L.cos(r),y:t+h*L.sin(r)*L.cos(r)}),r+=i/n;return s},V=(e,t,h,i,n,s)=>{const r=[];let o=0;for(let a=0;a<n;a+=1)r.push({x:e+h*L.sin(o*s)*L.cos(o*s),y:t+h*L.cos(o)}),o+=i/n;return r};
function e(e){return e&&e.__esModule?e.default:e}var t={};t="precision highp float;\n#define GLSLIFY 1\nvarying vec2 vPos;\nuniform sampler2D p;\nuniform float rr;\nuniform float pd;\nuniform vec2 resolution;\n\nfloat rnd(vec2 co)\n{\n highp float a = 12.9898;\n highp float b = 78.233;\n highp float c = 43758.5453;\n highp float dt = dot(co.xy, vec2(a, b));\n highp float sn = mod(dt, 3.14);\n return fract(sin(sn) * c);\n}\n\nvoid main() {\n vec2 uv = vPos * .5 + .5;\n gl_FragColor.rgb = texture2D(p, vec2(uv.x, 1. - uv.y)).rgb;\n\n vec2 uvSand = gl_FragCoord.xy/min(resolution.x,resolution.y);\n uvSand = floor(uvSand * 2048. / pd);\n uvSand += vec2(123.456, 31.171);\n uvSand += rr;\n gl_FragColor.rgb += .1 * rnd(uvSand);\n\n gl_FragColor.a = 1.;\n gl_FragColor = clamp(gl_FragColor, 0., 1.);\n}\n";var h={};h="precision highp float;\n#define GLSLIFY 1\nvarying vec2 vPos;\nattribute vec3 aPosition;\nvoid main() {\n vPos = (gl_Position = vec4(aPosition,1.0)).xy;\n}\n";class i{constructor(e){this.seed=e,this.rnd=this.rnd.bind(this),this.range=this.range.bind(this),this.rangeFloor=this.rangeFloor.bind(this),this.pick=this.pick.bind(this),this.shuffleArray=this.shuffleArray.bind(this),this.gaussian=this.gaussian.bind(this),this._hasNextGaussian=!1,this._nextGaussian=null}rnd(){return this.seed^=this.seed<<13,this.seed^=this.seed>>17,this.seed^=this.seed<<5,(this.seed<0?1+~this.seed:this.seed)%1e3/1e3}range(e,t){return t?this.rnd()*(t-e)+e:this.rnd()*e}rangeFloor(e,t){return Math.floor(this.range(e,t))}pick(e){return e[this.rangeFloor(0,e.length)]}shuffleArray(e){for(var t,h,i=e.length,n=e.slice();i;)t=Math.floor(this.rnd()*i--),h=n[i],n[i]=n[t],n[t]=h;return n}gaussian(e,t){if(this._hasNextGaussian){this._hasNextGaussian=!1;var h=this._nextGaussian;return this._nextGaussian=null,e+t*h}var i=0,n=0,s=0;do{s=(i=2*this.rnd()-1)*i+(n=2*this.rnd()-1)*n}while(s>=1||0===s);var r=Math.sqrt(-2*Math.log(s)/s);return this._nextGaussian=n*r,this._hasNextGaussian=!0,e+t*(i*r)}pickSome(e,t){let h;return this.shuffleArray(e).slice(0,t)}}const n=(e,t,h,i=!1)=>i?s(e+(t-e)*h,0,1):e+(t-e)*h,s=(e,t,h)=>e<t?t:e>h?h:e,r=(e,t,h)=>Array.isArray(t)?t[e*t.length|0]:t||0===t?h||0===h?(t>h&&([t,h]=[h,t]),t+e()*(h-t)):e()*t:e(),o=(e,t,h,i,n,s,a,d,f,l)=>{if(n--,l||n>=0&&r(f)<a)if(h>=i){let l=h*r(f,d[0],d[1]);o(e,t,l,i,n,s,a,d,f),o(e+l,t,h-l,i,n,s,a,d,f)}else{let l=i*r(f,d[0],d[1]);o(e,t,h,l,n,s,a,d,f),o(e,t+l,h,i-l,n,s,a,d,f)}else s.push({x:e,y:t,w:h,h:i,n:n})},a=(e,t,h,i,n,s,o,d,f,l)=>{if(n--,l||n>=0&&r(f)<o){let l=h*r(f,d[0],d[1]);a(e,t,l,i,n,s,o,d,f),a(e+l,t,h-l,i,n,s,o,d,f)}else s.push({x:e,y:t,w:h,h:i,n:n})},d=(e,t,h,i,n,s,o,a,f,l)=>{if(n--,l||n>=0&&r(f)<o){let l=i*r(f,a[0],a[1]);d(e,t,h,l,n,s,o,a,f),d(e,t+l,h,i-l,n,s,o,a,f)}else s.push({x:e,y:t,w:h,h:i,n:n})},f=(e,t,h,i,n,s,r=.7,o,a)=>{if(n--,a||n>=0&&o()<r){let a=h/2,d=i/2;f(e,t,a,d,n,s,r,o),f(e+a,t,a,d,n,s,r,o),f(e+a,t+d,a,d,n,s,r,o),f(e,t+d,a,d,n,s,r,o)}else s.push({x:e,y:t,w:h,h:i,n:n})},l=(e,t,h)=>e.map(((i,s)=>n(e[s],t[s],h))),c=e=>[...e.substr(1)].reduce(((e,t,h,i)=>h%2?e.concat(parseInt(`${i[h-1]}${i[h]}`,16)):e),[]),g=(e,t)=>{const h=[],i=Math.ceil(t/e.length),n=1/i,s=e.map((e=>c(e)));for(let e=0;e<s.length;e+=1)for(let t=0;t<i;t+=1){const i=s[e],r=s[(e+1)%s.length];h.push(l(i,r,(t+1)*n))}return h},u=(e,t,h,i,n,s)=>{const r=i>=0?i:0,o=e.drawingContext.createRadialGradient(t,h,0,t,h,r);return n.forEach(((e,t)=>o.addColorStop(e,s[t]))),e.drawingContext.fillStyle=o,o},p=(e,t,h,i,n,s,r)=>{const o=e.drawingContext.createLinearGradient(t,h,i,n);return s.forEach(((e,t)=>o.addColorStop(e,r[t]))),e.drawingContext.fillStyle=o,o},w=(e,t,h,i,n,s,r,o,a)=>{const d=[];for(let f=0;f<=a;f+=1){const l=f/a,c=bezierPoint(e,h,n,r,l),g=bezierPoint(t,i,s,o,l);d.push({x:c,y:g})}return d},b=(e,t,h,i,n)=>{const s=[];for(let r=0;r<h;r+=1)s.push({x:e+i*cos(n),y:t+i*sin(n)}),n+=360/h;return s},x=(e,t,h,i,s,r)=>{const o=b(e,t,i,s,r),a=h/i,d=[];for(let e=0;e<i;e+=1)for(let t=0;t<a;t+=1){const h=n(o[e].x,o[(e+1)%o.length].x,t/a),i=n(o[e].y,o[(e+1)%o.length].y,t/a);d.push({x:h,y:i})}return d},y=(e,t,h,i,s)=>{const r=[];for(let o=0;o<s-1;o+=1){const a=n(e,h,o/(s-1)),d=n(t,i,o/(s-1));r.push({x:a,y:d})}return r.push({x:h,y:i}),r},v=[["#7400b8","#6930c3","#5e60ce","#5390d9","#4ea8de","#80ffdb"],["#F9FBFF","#212121","#F9FBFF","#212121","#F9FBFF","#212121"],["#efffff","#f20082","#5db1ff","#ff00ca","#3a0bba"],["#521262","#6639a6","#3490de","#6fe7dd","#ff7c38","#e03e36","#b80d57","#700961"],["#a7ff83","#17b978","#086972","#071a52","#80d6ff","#edf798","#fab57a","#f06868"],["#01608F","#EF91A9","#EB4626","#F4BA10","#34A096","#2C2F8C"],["#264653","#2a9d8f","#e9c46a","#f4a261","#e76f51"],["#e63946","#f1faee","#a8dadc","#457b9d","#1d3557"],["#2b2d42","#8d99ae","#edf2f4","#ef233c","#d90429"],["#003049","#d62828","#f77f00","#fcbf49","#eae2b7"],["#3d5a80","#98c1d9","#e0fbfc","#ee6c4d","#293241"],["#011627","#fdfffc","#2ec4b6","#e71d36","#ff9f1c"],["#283d3b","#197278","#edddd4","#c44536","#772e25"],["#2b2d42","#8d99ae","#edf2f4","#ef233c","#d80032"],["#50514f","#f25f5c","#ffe066","#247ba0","#70c1b3"],["#fffcf2","#ccc5b9","#403d39","#252422","#eb5e28"],["#177e89","#084c61","#db3a34","#ffc857","#323031"],["#002642","#840032","#e59500","#e5dada","#02040f"],["#0c0a3e","#7b1e7a","#b33f62","#f9564f","#f3c677"],["#b80c09","#0b4f6c","#01baef","#fbfbff","#040f16"],["#001427","#708d81","#f4d58d","#bf0603","#8d0801"],["#1f271b","#19647e","#28afb0","#f4d35e","#ee964b"],["#06aed5","#086788","#f0c808","#fff1d0","#dd1c1a"],["#011627","#fdfffc","#2ec4b6","#e71d36","#ff9f1c"],["#001524","#15616d","#ffecd1","#ff7d00","#78290f"],["#dad2d8","#143642","#0f8b8d","#ec9a29","#a8201a"],["#003049","#d62828","#f77f00","#fcbf49"],["#001427","#708d81","#f4d58d","#bf0603","#8d0801"],["#55dde0","#33658a","#2f4858","#f6ae2d","#f26419"],["#010417","#0029c1","#2bb59c","#f7dc09","#e22b00"],["#0c090d","#e01a4f","#f15946","#f9c22e","#53b3cb"],["#01638d","#abcecc","#fff2cd","#ff004c","#610d4b"],["#2d728f","#3b8ea5","#f5ee9e","#f49e4c","#ab3428"],["#d00000","#ffba08","#3f88c5","#032b43","#032b43"],["#e63946","#f1faee","#a8dadc","#457b9d","#1d3557"],["#083d77","#f4d35e","#ee964b","#f95738"],["#177e89","#084c61","#db3a34","#ffc857","#323031"],["#010000","#a74c00","#ffa100","#ffd300","#f1f2f1"],["#e6eed6","#bbc5aa","#a72608","#090c02"],["#011627","#fdfffc","#2ec4b6","#e71d36","#ff9f1c"],["#fff2cd","#abcecc","#01638d","#ff004c","#610d4b"],["#33658a","#86bbd8","#2f4858","#f6ae2d","#f26419"],["#001427","#708d81","#f4d58d","#bf0603","#8d0801"],["#820263","#d90368","#eadeda","#2e294e","#ffd400"],["#a832a0","#7d32a8","#598fb5","#fffb00"],["#335c67","#fff3b0","#e09f3e","#9e2a2b","#540b0e"],["#003f88","#00509d","#fdc500","#ffd500"],["#001427","#708d81","#f4d58d","#bf0603","#8d0801"],["#0d1b2a","#1b263b","#415a77","#778da9","#e0e1dd"],["#0c0f0a","#ff206e","#fbff12","#41ead4"],["#000000","#2f4550","#586f7c","#b8dbd9","#f4f4f9"],["#970005","#ed0101","#0c44ac","#000052"],["#ff6d69","#fecc50","#0be7fb","#010b8b","#1e0521"],["#c9e4ca","#87bba2","#55828b","#3b6064","#364958"]];var k;const m=void 0;let C;const F=new i((W=tokenData,parseInt(W.hash.slice(0,16),16))),{rnd:S,range:M,rangeFloor:E,pick:_,shuffleArray:G}=F;var W;let A,R,L;const P={};let D,N,z,B;function setup(){z=createCanvas(D,N,WEBGL),A=createShader(e(h),e(t)),angleMode(DEGREES),L=createGraphics(D,N),R=()=>{B=.001*width,L.strokeCap(SQUARE),L.angleMode(DEGREES);const e=E(v.length-1);console.log(v.length-1),P.currentPalette=v[e];const t=S();P.shape=t<.05?"structure":t>=.05&&t<.08?"plexus":t>=.08&&t<.11?"tree":t>=.11&&t<.15?"grass":_(["unity","v-streams","h-streams","spiral","oscillations","curls","wall","v-storm","h-storm"]),P.size=10*B,"tree"===P.shape&&(P.size=12*B),P.waveR=M(.1,1),"tree"===P.shape&&(P.waveR=0),"v-streams"===P.shape&&(P.waveR=S()>.95?.9:M(.6,2)),"h-streams"===P.shape&&(P.waveR=M(.4,2)),"spiral"===P.shape&&(P.waveR=M(1,4)),"curls"===P.shape&&(P.waveR=M(.2,1.5)),"plexus"===P.shape&&(P.waveR=M(.3,4)),P.roots="structure"!==P.shape&&S()>.5,P.noFill=P.roots&&S()>.9;const h=S()>.8;P.roots?P.angle=h?M(20,180):_([30,60,90,120,150,180]):P.angle=h?M(20,100):_([30,60,90]),P.blackStroke=P.roots&&S()>.7,P.divider=P.roots?E(3,21):E(3,9),"tree"===P.shape&&(P.divider=E(3,6)),P.bigStroke="structure"!==P.shape&&S()>.95,P.longColors=S()>.7,P.rCount=200;const i=void 0,n=!["curls","plexus"].includes(P.shape)&&S()>.9;P.weeds=n?M(1,2):1,"wall"===P.shape&&(P.waveR=0,P.roots=!0),"tree"===P.shape&&(P.rCount=1e3),P.colorCount=Math.round(map(S(),0,1,.5*P.rCount,1.5*P.rCount)),P.longColors&&(P.colorCount=Math.round(map(S(),0,1,1.5*P.rCount,3*P.rCount))),"structure"===P.shape&&(P.rCount=100,P.colorCount=Math.round(map(S(),0,1,100,300)));const{colorCount:s,rCount:r}=P,o=G(P.currentPalette);P.lerpColors=g(G(o),s).map((e=>color(e))),P.backColors=g(G(o),s/2).map((e=>color(e))),P.backColors2=g(G(o),s).map((e=>{const t=color(e);return t.setAlpha(100),t}));let a=[],d=[];if("h-storm"===P.shape)for(let e=.1*-height;e<1.1*height;e+=.2*height){const t=M(.25,.75),h=w(0,e,width*t,e+height*t,width*t,e-height*t,width,e,400);a=[...a,...h]}if("v-storm"===P.shape)for(let e=.1*-width;e<1.1*width;e+=.2*width){const t=M(.25,.75),h=w(e,0,e+width*t,height*t,e-width*t,height*t,e,height,400);a=[...a,...h]}if("wall"===P.shape){const e=new Array(200).fill(null).map((()=>({x:M(width),y:M(height)})));a=[...y(0,.05*height,width,.05*height,800),...y(0,1.2*height,width,1.2*height,800),...e]}if("plexus"===P.shape&&(a=[...Q(width/2,.25*height,.6*width,180,400),...Q(width/2,.5*height,.6*width,180,400),...Q(width/2,.75*height,.6*width,180,400),...Q(width/2,.25*height,.6*width,-180,400),...Q(width/2,.5*height,.6*width,-180,400),...Q(width/2,.75*height,.6*width,-180,400)]),"oscillations"===P.shape){const e=M(.8,1.2);a=[...Y(width/2,height/2,width,360,1600,e),...Y(width/2,height/2,.6*width,360,800,e)]}if("curls"===P.shape&&(a=V(width/2,height/2,.7*width,360,1600,E(3,10))),"spiral"===P.shape){const e=O(width/2,height/2,.01*width,1440,