0x3b13…50da

All memos sent from and to 0x3b13…50da.

|i.bodyA&&i.bodyA.isStatic,a=!i.bodyB||i.bodyB&&i.bodyB.isStatic,r||a||se.solve(e[o],n)},solve:(e,t)=>{var n=e.bodyA,o=e.bodyB,i=e.pointA,r=e.pointB;if(n||o){n&&!n.isStatic&&(j.rotate(i,n.angle-e.angleA,i),e.angleA=n.angle),o&&!o.isStatic&&(j.rotate(r,o.angle-e.angleB,r),e.angleB=o.angle);var a=i,s=r;if(n&&(a=j.add(n.position,i)),o&&(s=j.add(o.position,r)),a&&s){var c=j.sub(a,s),l=j.magnitude(c);l<se._ml&&(l=se._ml);var v,p,x,d,m,u=(l-e.length)/l,y=1<=e.stiffness||0===e.length?e.stiffness*t:e.stiffness*t*t,f=e.damping*t,g=j.mult(c,u*y),b=(n?n.inverseMass:0)+(o?o.inverseMass:0),h=b+((n?n.inverseInertia:0)+(o?o.inverseInertia:0));if(0<f){var _=j.create();x=j.div(c,l),m=j.sub(o&&j.sub(o.position,o.positionPrev)||_,n&&j.sub(n.position,n.positionPrev)||_),d=j.dot(x,m)}n&&!n.isStatic&&(p=n.inverseMass/b,n.constraintIp.x-=g.x*p,n.constraintIp.y-=g.y*p,n.position.x-=g.x*p,n.position.y-=g.y*p,0<f&&(n.positionPrev.x-=f*x.x*d*p,n.positionPrev.y-=f*x.y*d*p),v=j.cross(i,g)/h*se._td*n.inverseInertia*(1-e.angularStiffness),n.constraintIp.angle-=v,n.angle-=v),o&&!o.isStatic&&(p=o.inverseMass/b,o.constraintIp.x+=g.x*p,o.constraintIp.y+=g.y*p,o.position.x+=g.x*p,o.position.y+=g.y*p,0<f&&(o.positionPrev.x+=f*x.x*d*p,o.positionPrev.y+=f*x.y*d*p),v=j.cross(r,g)/h*se._td*o.inverseInertia*(1-e.angularStiffness),o.constraintIp.angle+=v,o.angle+=v)}}},postSolveAll:e=>{for(var t=0;t<e.length;t++){var n=e[t],o=n.constraintIp;if(!(n.isStatic||0===o.x&&0===o.y&&0===o.angle)){for(var i,r=0;r<n.parts.length;r++)i=n.parts[r],H.translate(i.vertices,o),0<r&&(i.position.x+=o.x,i.position.y+=o.y),0!==o.angle&&(H.rotate(i.vertices,o.angle,n.position),K(i.axes,o.angle),0<r&&j.rotateAbout(i.position,o.angle,n.position,i.position)),Z.update(i.bounds,i.vertices,n.vel);o.angle*=se._w,o.x*=se._w,o.y*=se._w}}}},ce={create:e=>q.extend({bodies:[],pairs:null},e),setBodies:(e,t)=>{e.bodies=t.slice(0)},collisions:e=>{var t,n,o=[],i=e.pairs,r=e.bodies,a=r.length,s=ce.canCollide,c=ne.collides;for(r.sort(ce._compareBoundsX),t=0;t<a;t++){var l=r[t],v=l.bounds,p=l.bounds.max.x,x=l.bounds.max.y,d=l.bounds.min.y,m=l.isStatic,u=l.parts.length,y=1===u;for(n=t+1;n<a;n++){var f=r[n];if((R=f.bounds).min.x>p)break;if(!(x<R.min.y||d>R.max.y)&&(!m||!f.isStatic)&&s(l.filter,f.filter)){var g=f.parts.length;if(y&&1===g)(w=c(l,f,i))&&o.push(w);else for(var b=1<g?1:0,h=1<u?1:0;h<u;h++)for(var _=l.parts[h],S=(v=_.bounds,b);S<g;S++){var w,A=f.parts[S],R=A.bounds;v.min.x>R.max.x||v.max.x<R.min.x||v.max.y<R.min.y||v.min.y>R.max.y||(w=c(_,A,i))&&o.push(w)}}}}return o},canCollide:(e,t)=>e.group===t.group&&0!==e.group?0<e.group:0!=(e.mask&t.category)&&0!=(t.mask&e.category),_compareBoundsX:(e,t)=>e.bounds.min.x-t.bounds.min.x},le={_rt:2};le._rtt=r(6),le._pd=.9,le._pw=.8,le._fnm=5,le._fms=e,le.preSolvePosition=e=>{var t,n,o,i=e.length;for(t=0;t<i;t++)(n=e[t]).isActive&&(o=n.activeContacts.length,n.collision.parentA.totalContacts+=o,n.collision.parentB.totalContacts+=o)},le.solvePosition=(e,t,n)=>{var o,i,r,a,s,c,l,v,p=le._pd*(n||1),x=q.clamp(t/q._bd,0,1),d=e.length;for(o=0;o<d;o++)(i=e[o]).isActive&&!i.isSensor&&(a=(r=i.collision).parentA,s=r.parentB,c=r.normal,i.separation=c.x*(s.positionIp.x+r.penetration.x-a.positionIp.x)+c.y*(s.positionIp.y+r.penetration.y-a.positionIp.y));for(o=0;o<d;o++)(i=e[o]).isActive&&!i.isSensor&&(a=(r=i.collision).parentA,s=r.parentB,c=r.normal,v=i.separation-i.slop*x,(a.isStatic||s.isStatic)&&(v*=2),a.isStatic||(l=p/a.totalContacts,a.positionIp.x+=c.x*v*l,a.positionIp.y+=c.y*v*l),s.isStatic||(l=p/s.totalContacts,s.positionIp.x-=c.x*v*l,s.positionIp.y-=c.y*v*l))},le.postSolvePosition=e=>{for(var t=le._pw,n=e.length,o=H.translate,i=Z.update,r=0;r<n;r++){var a=e[r],s=a.positionIp,c=s.x,l=s.y,v=a.vel;if(a.totalContacts=0,0!==c||0!==l){for(var p,x=0;x<a.parts.length;x++)o((p=a.parts[x]).vertices,s),i(p.bounds,p.vertices,v),p.position.x+=c,p.position.y+=l;a.positionPrev.x+=c,a.positionPrev.y+=l,0>c*v.x+l*v.y?(s.x=0,s.y=0):(s.x*=t,s.y*=t)}}},le.preSolveVel=e=>{var t,n,o=e.length;for(t=0;t<o;t++){var i=e[t];if(i.isActive&&!i.isSensor){var r=i.activeContacts,a=r.length,s=i.collision,c=s.parentA,l=s.parentB,v=s.normal,p=s.tangent;for(n=0;n<a;n++){var x=r[n],d=x.vertex,m=x.normalIp,u=x.tangentIp;if(0!==m||0!==u){var y=v.x*m+p.x*u,f=v.y*m+p.y*u;c.isStatic||(c.positionPrev.x+=y*c.inverseMass,c.positionPrev.y+=f*c.inverseMass,c.anglePrev+=c.inverseInertia*((d.x-c.position.x)*f-(d.y-c.position.y)*y)),l.isStatic||(l.positionPrev.x-=y*l.inverseMass,l.positionPrev.y-=f*l.inverseMass,l.anglePrev-=l.inverseInertia*((d.x-l.position.x)*f-(d.y-l.position.y)*y))}}}}},le.solveVel=(e,t)=>{var n,o,i,r,a=t/q._bd,c=a*a*a,l=-le._rt*a,v=le._rtt,p=le._fnm*a,x=le._fms,d=e.length;for(i=0;i<d;i++){var m=e[i];if(m.isActive&&!m.isSensor){var u=m.collision,y=u.parentA,f=u.parentB,g=y.vel,b=f.vel,h=u.normal.x,_=u.normal.y,S=u.tangent.x,w=u.tangent.y,A=m.activeContacts,R=A.length,P=1/R,E=y.inverseMass+f.inverseMass,I=m.friction*m.frictionStatic*p;for(g.x=y.position.x-y.positionPrev.x,g.y=y.position.y-y.positionPrev.y,b.x=f.position.x-f.positionPrev.x,b.y=f.position.y-f.positionPrev.y,y.angularVel=y.angle-y.anglePrev,f.angularVel=f.angle-f.anglePrev,r=0;r<R;r++){var C=A[r],B=C.vertex,T=B.x-y.position.x,M=B.y-y.position.y,U=B.x-f.position.x,z=B.y-f.position.y,V=g.x-M*y.angularVel,F=g.y+T*y.angularVel,k=V-(b.x-z*f.angularVel),L=F-(b.y+U*f.angularVel),O=h*k+_*L,D=S*k+w*L,X=m.separation+O,N=s(X,1),$=(N=0>X?0:N)*I;D<-$||D>$?(o=0<D?D:-D,(n=m.friction*(0<D?1:-1)*c)<-o?n=-o:n>o&&(n=o)):(n=D,o=x);var Y=T*_-M*h,G=U*_-z*h,W=P/(E+y.inverseInertia*Y*Y+f.inverseInertia*G*G),j=(1+m.restitution)*O*W;if(n*=W,O<l)C.normalIp=0;else{var K=C.normalIp;C.normalIp+=j,0<C.normalIp&&(C.normalIp=0),j=C.normalIp-K}if(D<-v||D>v)C.tangentIp=0;else{var H=C.tangentIp;C.tangentIp+=n,C.tangentIp<-o&&(C.tangentIp=-o),C.tangentIp>o&&(C.tangentIp=o),n=C.tangentIp-H}var Z=h*j+S*n,J=_*j+w*n;y.isStatic||(y.positionPrev.x+=Z*y.inverseMass,y.positionPrev.y+=J*y.inverseMass,y.anglePrev+=(T*J-M*Z)*y.inverseInertia),f.isStatic||(f.positionPrev.x-=Z*f.inverseMass,f.positionPrev.y-=J*f.inverseMass,f.anglePrev-=(U*J-z*Z)*f.inverseInertia)}}}};var ve={create:e=>{e=e||{};var t=q.extend({posIt:6,velIt:4,conIt:2,gravity:{x:0,y:1,scale:.001},timing:{timestamp:0,timeScale:1,lastDelta:0,lastElapsed:0}},e);return t.world=e.world||ae.create(),t.pairs=e.pairs||(e=>q.extend({table:{},list:[],collisionStart:[],collisionActive:[],collisionEnd:[]},e))(),t.detector=e.detector||ce.create(),t.grid={buckets:[]},t.world.gravity=t.gravity,t.broadphase=t.grid,t.metrics={},t},update:(e,t)=>{var n,o=q.now(),i=e.world,r=e.detector,a=e.pairs,s=e.timing,c=s.timestamp;t=void 0===t?q._bd:t,t*=s.timeScale,s.timestamp+=t,s.lastDelta=t;var l=ae.allBodies(i),v=ae.allConstraints(i);for(i.isModified&&(ce.setBodies(r,l),ae.setModified(i,!1,!1,!0)),ve._bag(l,e.gravity),0<t&&ve._bu(l,t),se.preSolveAll(l),n=0;n<e.conIt;n++)se.solveAll(v,t);se.postSolveAll(l),r.pairs=e.pairs,((e,t,n)=>{var o,i,r,a,s=e.list,c=s.length,l=e.table,v=t.length,p=e.collisionStart,x=e.collisionEnd,d=e.collisionActive;for(p.length=0,x.length=0,d.length=0,a=0;a<c;a++)s[a].confirmedActive=!1;for(a=0;a<v;a++)(r=(o=t[a]).pair)?(r.isActive?d.push(r):p.push(r),te.update(r,o,n),r.confirmedActive=!0):(l[(r=te.create(o,n)).id]=r,p.push(r),s.push(r));var m=[];for(c=s.length,a=0;a<c;a++)(r=s[a]).confirmedActive||(te.setActive(r,!1,n),x.push(r),m.push(a));for(a=0;a<m.length;a++)r=s[i=m[a]-a],s.splice(i,1),delete l[r.id]})(a,ce.collisions(r),c);var p=q.clamp(20/e.posIt,0,1);for(le.preSolvePosition(a.list),n=0;n<e.posIt;n++)le.solvePosition(a.list,t,p);for(le.postSolvePosition(l),se.preSolveAll(l),n=0;n<e.conIt;n++)se.solveAll(v,t);for(se.postSolveAll(l),le.preSolveVel(a.list),n=0;n<e.velIt;n++)le.solveVel(a.list,t);return ve._buv(l),ve._bcf(l),e.timing.lastElapsed=q.now()-o,e},_bcf:e=>{for(var t,n=e.length,o=0;o<n;o++)(t=e[o]).force.x=0,t.force.y=0,t.torque=0},_bag:(e,t)=>{var n=void 0===t.scale?.001:t.scale,o=e.length;if((0!==t.x||0!==t.y)&&0!==n)for(var i,r=0;r<o;r++)(i=e[r]).isStatic||(i.force.y+=i.mass*t.y*n,i.force.x+=i.mass*t.x*n)},_bu:(e,t)=>{for(var n,o=e.length,i=0;i<o;i++)(n=e[i]).isStatic||J.update(n,t)},_buv:e=>{for(var t=e.length,n=0;n<t;n++)J.updateVelocities(e[n])}};const pe=(e,t,n,o,i)=>{e.width=t,e.height=n,W(e,{width:`${o}px`,height:`${i}px`})},xe=(e,t)=>{e.save(),t(),e.restore()},de=(e,t,n=[1,1])=>{e.moveTo(t[0].x*n[0],t[0].y*n[1]);for(let o=1,i=t.length;o<i;o++)e.lineTo(t[o].x*n[0],t[o].y*n[1])},me=e=>e.clearRect(0,0,e.canvas.width,e.canvas.height),ue=(e,t,n)=>{const o=e.createShader(t);return e.shaderSource(o,n),e.compileShader(o),e.getShaderParameter(o,e.COMPILE_STATUS)?o:void e.deleteShader(o)},ye=(e,t,n=0,o=e.CLAMP_TO_EDGE,i=e.NEAREST)=>{const r=e.createTexture();return e.activeTexture(e.TEXTURE0+n),e.bindTexture(e.TEXTURE_2D,r),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,o),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,o),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,i),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,i),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t),r};var fe=(e,t,n,o,i=!0)=>{const r=e.getContext("webgl2",o);i&&(r.drawingBufferColorSpace="display-p3"),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!0);const a=((e,t,n)=>{const o=e.createProgram();return e.attachShader(o,t),e.attachShader(o,n),e.linkProgram(o),e.getProgramParameter(o,e.LINK_STATUS)?o:void e.deleteProgram(o)})(r,ue(r,r.VERTEX_SHADER,t),ue(r,r.FRAGMENT_SHADER,n)),s=r.getAttribLocation(a,"aPos"),c=r.createBuffer();r.bindBuffer(r.ARRAY_BUFFER,c),r.bufferData(r.ARRAY_BUFFER,new Float32Array([-1,-1,-1,3,3,-1]),r.STATIC_DRAW);const l=r.createVertexArray();r.bindVertexArray(l),r.enableVertexAttribArray(s),r.bindBuffer(r.ARRAY_BUFFER,c),r.vertexAttribPointer(s,2,r.FLOAT,!1,0,0),r.bindVertexArray(null);const v=[];let p;const x=()=>r.clear(r.COLOR_BUFFER_BIT);return{resize:(t,n,o,i)=>{pe(e,t,n,o||t,i||n),p=[t,n,t/n],x()},frame:(e=[0,0],t=[])=>{r.viewport(0,0,p[0],p[1]),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),r.useProgram(a),r.bindVertexArray(l);let n=0;[["uVp","v3",p],["uT","f",e[1]],...t.map((e=>("t"===e[1]&&(v[e[0]]=[ye(r,e[2],n,r[e[3]],r[e[4]]),n++]),"t[]"===e[1]&&(v[e[0]]=[[],[]],e[2].forEach((t=>{v[e[0]][0].push(ye(r,t,n,r[e[3]],r[e[4]])),v[e[0]][1].push(n++)}))),e)))].forEach((([e,t,n])=>((e,[t,n,o,i])=>{"b"===t?e.uniform1i(o,!0===n?1:0):"i"===t?e.uniform1i(o,n):"i[]"===t?e.uniform1iv(o,n):"f"===t?e.uniform1f(o,n):"f[]"===t?e.uniform1fv(o,n):"v2"===t?e.uniform2f(o,...n):"v2[]"===t?e.uniform2fv(o,n):"v3"===t?e.uniform3f(o,...n):"v3[]"===t?e.uniform3fv(o,n):"v4"===t?e.uniform4f(o,...n):"v4[]"===t?e.uniform4fv(o,n):"t"===t?e.uniform1i(o,i):"t[]"===t&&e.uniform1iv(o,i)})(r,[t,"t"===t||"t[]"===t?v[e][0]:n,r.getUniformLocation(a,e),"t"===t||"t[]"===t?v[e][1]:-1]))),r.drawArrays(r.TRIANGLES,0,3)},clear:x}};const ge="#version 300 es\nin vec2 aPos;\nout vec2 vUv;\nvoid main(){gl_Position=vec4(aPos*2.-1.,0.,1.);vUv=aPos;}\n";var be=(e,o,i)=>{const r=m[i[1][2]],v=u[i[1][2]]*y[i[0][2]],x=s(1+c((r-1)/8),4);let d,f,g,b,h,_,S,w,A,R=!1,P=0,I=[p,p],C=[],M=[],U=[],z=[],L=[],O=!1,X=0,N=[],$=[];const Y=T(.4,.6),G=T(.2,.3),W=(t=!1,n=!1)=>ae.allBodies(e.world).filter((e=>(t||!e.__cursor)&&(n||!e.__bound))),q=(e=0,t=0,n,o)=>ee.rectangle(e,t,n,o,{isStatic:!0,friction:.5,filter:{category:2},__bound:!0}),K=(e,t,n,o,i,r,a,c,l,p)=>{const x=s(...I)*v*r,d=ee.rectangle(e,t,x*o,x*i,{restitution:.5,friction:.9,density:2e-4,color:"blue"});return J.setVertices(d,d.vertices.map(((e,t)=>{let n=[e.x-d.position.x,e.y-d.position.y];return 2<=t&&(e.x-=a*n[0]),e}))),J.setAngle(d,n),d.__pos=[e,t,n],d.__src=[o,1,r,a,c],d.__anim=[l,p,0],d},H=()=>{const e=T(.2,.8)*b,n=T(-1.1,-.1)*_,o=[1,Y,G,T(.2,.8),B()?T(.1,.3):T(.4,.6)][i[0][2]],r=E()*t*2,a=i[1][1]===F?.4+.6*l(E(),2):i[1][1]===k&&B(.7)?.5:1,s=.07*l(E(),4),c=2+V([1,8,4,1]),v=E();return K(e,n,r,o,1,a,s,c,v,0)};let Z=()=>{};return{config:()=>[r,v,x],resize:(...t)=>Z=((t,n)=>{Z(),O=!1,X=0;const i=!!U.length;d=t[4],g=1<=d,b=p*(g?d:1),h=b/2,_=p/(g?1:d),S=_/2,w=.015*s(b,_);const r=d>f?1:-1;if(f=d,I=[b,_],!i||n){C=[q(-h+w,S,b,4*_),q(b+h-w,S,b,4*_),q(h,-(_+S)+w,2*b,_),q(h,_+S-w,2*b,_)],ae.add(e.world,C),M=[];for(let e=0;e<P;e++){const t=i?K(U[e][0]*b,U[e][1]*_,U[e][2],...z[e],...L[e]):H();M.push(t);const n=.2*t.m*r;J.applyForce(t,t.position,j.create((2*E()-1)*n,-E()*n))}ae.add(e.world,M)}A=((e=document.body)=>{let t=!1,n=!1,o=[1,1],i=[];const r=t=>{i=[],((e,t)=>{for(var n=0,o=e.length;n<o;n++)t(Array.isArray(e)?e.at(n):e.item(n),n)})(t,((t,n)=>{const r=((e,t)=>{const n=t.getBoundingClientRect(),o=document.documentElement||document.body.parentNode||document.body,i=void 0===window.pageXOffset?o.scrollLeft:window.pageXOffset,r=void 0===window.pageYOffset?o.scrollTop:window.pageYOffset,a=e.pageX-n.left-i,s=e.pageY-n.top-r;return[a/(t.clientWidth/(t.width||t.clientWidth)),s/(t.clientHeight/(t.height||t.clientHeight))]})(t,e),a=r[0]*o[0],s=r[1]*o[1],c=t.identifier||0;i[n]={x:a,y:s,id:c}}))};return{positions:()=>i,setScale:([e,t])=>{o=[e,t]},touchstart:e=>{t=!0,r(e.targetTouches)},touchmove:e=>{r(e.targetTouches)},touchend:e=>{r(e.targetTouches)},mousedown:e=>{t||(n=!0,r([e]))},mousemove:e=>{t||n&&r([e])},mouseup:e=>{t||(n=!1,r([]))}}})(o),A.setScale([b/t[0],_/t[1]]);for(let e=0;e<64;e++)$[e]=ee.circle(0,0,.02*s(b,_),{color:"#0f0",filter:{category:2,mask:1},density:.01,__cursor:!0});return()=>{U=M.map((e=>[e.position.x/b,e.position.y/_,e.angle])),z=M.map((e=>e.__src)),L=M.map((e=>e.__anim)),n&&ae.remove(e.world,[...C,...M])}})(...t),frame:([t,o,i],c,v,p)=>{if(O=!0,X=o===t?1e3-t:c?0:X+t,0<o&&X<=1e3&&(O=!1),ae.remove(e.world,$),A.positions().forEach((t=>{const o=n(t.id%64);J.setPosition($[o],j.create($[o].position.x+.05*(t.x-$[o].position.x),$[o].position.y+.05*(t.y-$[o].position.y)),!0),ae.add(e.world,$[o])})),W().forEach(((e,t)=>{const o=D([e.position.x,e.position.y],[...e.__pos]),i=e.angle-e.__pos[2];(o>.2||n(i)>.002)&&(O=!1,X=0),e.__pos=[e.position.x,e.position.y,e.angle],e.__invalid=!v&&(e=>{for(let t=0,n=e.vertices.length;t<n;t++)if(e.vertices[t].y<w/2)return!0;return!1})(e),e.__anim[1]+=3e-4*e.speed+s(e.angularSpeed,.01),p&&(J.applyForce(e,e.position,j.create(0,.5*((e,t,n)=>a(s(e,30),10))(e.mass)*l(a(0,e.position.y/_),3)*e.__anim[2]*-1)),e.__anim[2]*=.97,B(1/s(r,36)*.004)&&(e.__anim[2]+=1))})),!R){if(!(i%30)){const t=H();M.push(t),ae.add(e.world,t),P++}P>=r&&(R=!0)}},size:()=>[...I],bodies:W,resting:()=>O,populated:()=>R,pointerDown:()=>{if(A.positions().length)for(let e=0;e<A.positions().length;e++){const t=A.positions()[e],o=n(t.id%64);N.find((({id:e})=>t.id===e))||J.setPosition($[o],t,!1)}N=[...A.positions()]},pointerUp:()=>{N=[...A.positions()]},mousedown:e=>A.mousedown(e),mousemove:e=>A.mousemove(e),mouseup:e=>A.mouseup(e),touchstart:e=>A.touchstart(e),touchmove:e=>A.touchmove(e),touchend:e=>A.touchend(e)}};const he=window,_e=document,Se=_e.body,we=new URLSearchParams(he.location.search),Ae=e=>we.get(e),Re=e=>null!==Ae(e),Pe=()=>{try{return he.self!==he.top}catch(e){return!0}},Ee="undefined"==typeof tokenData?Ae("seed")||(()=>{let e="0x";for(let t=64;0<t;--t)e+="0123456789abcdef"[~~(16*Math.random())];return e})():"string"==typeof tokenData?tokenData:tokenData.hash;C(Ee);const Ie=O.map((e=>{const t=e[1].map((e=>e[1])),n=V(t);return[e[0],e[1][n][0],n]}));console.log(`${Ee}\n`,...Ie.map((e=>`\n${e[0]}: ${e[1]}`)),Pe()?"\n\niframe":"");const Ce=$(Se,N("main")),Be=$(Ce,N("canvas")),Te=$(Ce,N("canvas")),Me=$(Se,N("canvas")),Ue=Ie[3][1]===L;let ze,Ve=Re("expand"),Fe=Re("expose"),ke=Re("excess"),Le=Re("excite"),Oe=0;(()=>{let e;const t=()=>{e&&e.cleanup(),e=(()=>{C(Ee);const e=ve.create(),t=be(e,Ce,Ie),n=(e=>{const t=e.getContext("2d");return{resize:(t,n,o,i)=>pe(e,t,n,o,i),frame:(e,n,o,i,r,a,c)=>{me(t),c&&xe(t,(()=>{t.fillStyle=a?g:f,t.globalAlpha=.3,t.fillRect(0,0,n,o)}));for(let l=0,v=r.length;l<v;l++){const v=r[l];xe(t,(()=>{c&&(t.scale(.5,.5),t.translate(n/2,o)),t.beginPath(),de(t,[...v.vertices,v.vertices[0]],i),t.closePath(),c?(t.globalAlpha=.8,t.fillStyle=v.__invalid?"red":v.color,t.fill()):(v.__cursor||v.__invalid)&&100<e&&(t.strokeStyle=a?f:g,t.lineWidth=.002*s(n,o),t.stroke())}))}},clear:()=>me(t)}})(Te),o=fe(Be,ge,(([e,t,n])=>`#version 300 es\nprecision highp float;\n#define COUNT ${e}\n#define TILE ${n}.0\n#define BASE ${t}\n#define PI 3.1415926535\n#define F .0006\nin vec2 vUv;\nuniform vec4 uBdS[COUNT],uBdP[COUNT];\nuniform vec3 uVp,uCl,uCd,uBdA[COUNT];\nuniform float uT,uI;\nuniform sampler2D uTx[8];\nout vec4 fc;\nmat2 r2d(float t){return mat2(cos(t),sin(t),-sin(t),cos(t));}\nvec2 rUV(vec2 st,float t){float sr=sin(t),cr=cos(t);return vec2(cr*(st.x)+sr*(st.y)+.5,cr*(st.y)-sr*(st.x)+.5);}\nfloat rand(vec2 st){return fract(sin(dot(st,vec2(12.9898,78.233)))*43758.5453);}\nvec2 gO(vec4 bdP){\nvec2 pos=bdP.xy/uVp.xy;\npos.y=(1.-pos.y)/uVp.z;\nreturn pos;\n}\nfloat rect(vec2 st,vec4 bdP,vec4 bdS,float f){\nfloat x=(1.-bdS.x/max(uVp.z,1.)/(1./BASE))/2.; \nfloat y=(1.-bdS.y/max(uVp.z,1.)/(1./BASE))/2.;\nx*=1.-.5*bdS.z*bdS.x;\nx*=1.0015;y*=1.0015;\nst=rUV(st-gO(bdP),PI-bdP.z);\nvec2 wBl=st,wTr=st;\nwBl.x-=bdS.z*st.y*bdS.x*.5;\nwTr.x+=bdS.z*st.y*bdS.x*.5;\nwBl.y-=bdS.z*st.y*.11;\nwTr.y-=bdS.z*st.y*.05;\nvec2 bl=smoothstep(vec2(x-f,y-f),vec2(x+f,y+f),wBl);\nvec2 tr=smoothstep(vec2(x-f,y-f),vec2(x+f,y+f),1.-wTr);\nreturn bl.x*bl.y*tr.x*tr.y;\n}\nvec2 tU(vec2 st,vec4 bdP,vec4 bdS,int i){\nreturn rUV((st-gO(bdP))*(1./BASE)*max(uVp.z, 1.),PI*.5-bdP.z)\n*vec2(1./TILE,1.)\n*vec2((1./(3.0+1.))*(bdS.w-1.),1.)\n+vec2(.5*max(1.-TILE,0.)+(1./TILE)*float(i/8),0.);\n}\nfloat tM(int i,int o){return step(float(i+o&7),0.);}\nvoid main(){\nvec2 uv=vUv;\nuv.y/=uVp.z;\nvec4 b=vec4(uCd,1.);\nvec4 w=vec4(uCl,1.);\nvec4 c=mix(w,b,uI);\nfor (int i=0;i<COUNT;i++){\nvec4 bdP=uBdP[i];\nvec4 bdS=uBdS[i];\nvec3 bdA=uBdA[i];\nfloat r=.93*rect(uv,bdP,bdS,F)*bdP.w;\nc = max(c-r,0.);\nvec2 tO=vec2(-.7*pow(1.-bdS.y,4.),0.); \nvec2 tA=vec2(0.,\nsin(uT*.00005*(.1+.9*pow(bdA.y,4.)))+.5*mod(bdA.z,999.)\n)*r2d(bdP.z);\nvec2 tUV=uv+vec2(0.,.035*bdS.z)*r2d(bdP.z)+tO+tA*bdA.x;\nc+=r*tM(i,0)*texture(uTx[0],tU(tUV,bdP,bdS,i));\nc+=r*tM(i,1)*texture(uTx[1],tU(tUV,bdP,bdS,i));\nc+=r*tM(i,2)*texture(uTx[2],tU(tUV,bdP,bdS,i));\nc+=r*tM(i,3)*texture(uTx[3],tU(tUV,bdP,bdS,i));\nc+=r*tM(i,4)*texture(uTx[4],tU(tUV,bdP,bdS,i));\nc+=r*tM(i,5)*texture(uTx[5],tU(tUV,bdP,bdS,i));\nc+=r*tM(i,6)*texture(uTx[6],tU(tUV,bdP,bdS,i));\nc+=r*tM(i,7)*texture(uTx[7],tU(tUV,bdP,bdS,i));\n}\nc+=(rand(uv*10.)*2.-1.)*.025;\nfc=c;\n}\n`)(t.config()),v),i=fe(Me,ge,(([e,t,n])=>`#version 300 es\nprecision highp float;\n#define S 5\n#define ST ${5*n}\n#define PI 3.141592653589793\n#define F .0001\nin vec2 vUv;\nuniform int uCn;\nuniform float uT;\nuniform vec3 uVp, uC[ST];\nout vec4 fc;\nvec3 mod289(vec3 x){return x-floor(x*(1./289.))*289.;}vec2 mod289(vec2 x){return x-floor(x*(1./289.))*289.;}vec3 permute(vec3 x){return mod289(((x*34.)+1.)*x);}float noise(vec2 v){const vec4 C=vec4(.211324865405187,.366025403784439,-.577350269189626,.024390243902439);vec2 i=floor(v+dot(v,C.yy));vec2 x0=v-i+dot(i,C.xx);vec2 i1;i1=(x0.x>x0.y)?vec2(1.,0.):vec2(0.,1.);vec4 x12=x0.xyxy+C.xxzz;x12.xy-=i1;i=mod289(i);vec3 p=permute(permute(i.y+vec3(0.,i1.y,1.))+i.x+vec3(0.,i1.x,1.));vec3 m=max(.5-vec3(dot(x0,x0),dot(x12.xy,x12.xy),dot(x12.zw,x12.zw)),0.);m=m*m;m=m*m;vec3 x=2.*fract(p*C.www)-1.;vec3 h=abs(x)-.5;vec3 ox=floor(x+.5);vec3 a0=x-ox;m*=1.79284291400159-.85373472095314*(a0*a0+h*h);vec3 g;g.x=a0.x*x0.x+h.x*x0.y;g.yz=a0.yz*x12.xz+h.yz*x12.yw;return 130.*dot(m,g);}\nfloat g1(float x,float k){x=clamp(x,0.,1.);float s=sign(x-.5);float o=(1.+s)/2.;return o-.5*s*pow(2.*(o-s*x),k);}\nfloat gN(float x,float a){return g1(x,1.2+.8*a);}\n\n// Copyright (c) 2022 Adam Lastowka (MIT License)\n#define D65 vec3(.950456,1.,1.089058)\nvec3 rgb2xyz(vec3 rgb){return rgb*mat3(.4124,.3576,.1805,.2126,.7152,.0722,.0193,.1192,.9505);}\nvec3 xyz2rgb(vec3 xyz){return xyz*mat3(3.2406255,-1.5372080,-.4986286,-.9689307,1.8757561,.0415175,.0557101,-.2040211,1.0569959);}\nfloat xyz2labF(float x){return x>.00885645167?pow(x,1./3.):7.78703703704*x+.13793103448;}\nvec3 xyz2lab(vec3 xyz){\nvec3 s=xyz/D65;\ns=vec3(xyz2labF(s.x),xyz2labF(s.y),xyz2labF(s.z));\nreturn vec3((116.*s.y)-16.,500.*(s.x-s.y),200.*(s.y-s.z));\n}\nfloat lab2xyzF(float x){return x>.206897?x*x*x:(.12841854934*(x-0.137931034));}\nvec3 lab2xyz(vec3 lab){\nfloat w=(lab.x+16.)/116.;\nreturn D65*vec3(lab2xyzF(w+lab.y/500.),lab2xyzF(w),lab2xyzF(w-lab.z/200.));\n}\nvec3 rgb2lab(vec3 rgb){return xyz2lab(rgb2xyz(rgb));}\nvec3 lab2rgb(vec3 lab){retu
rn xyz2rgb(lab2xyz(lab));}\n\n\n// Copyright (c) 2020 Björn Ottosson (MIT License)\nvec3 oklab_mix(vec3 cA,vec3 cB,float h){\nconst mat3 mA=mat3(.4121656120,.2118591070,.0883097947,.5362752080,.6807189584,.2818474174,.0514575653,.1074065790,.6302613616);\nconst mat3 mB=mat3(4.0767245293,-1.2681437731,-.0041119885,-3.3072168827,2.6093323231,-.7034763098,.2307590544,-.3411344290,1.7068625689); \nvec3 lA=pow(mA*cA,vec3(1./3.));\nvec3 lB=pow(mA*cB,vec3(1./3.));\nvec3 l=mix(lA,lB,h);\nreturn mB*(l*l*l);\n}\n\n// Copyright (c) 2023 Ronald van Wijnen (MIT License)\n#define S_S 38\n#define S_G 2.4\n#define S_E.0001\nfloat s_uc(float x){return (x<.04045)?x/12.92:pow((x+.055)/1.055,S_G);}\nfloat s_c(float x){return (x<.0031308)?x*12.92:1.055*pow(x,1./S_G)-.055;}\nvec3 s_s2l(vec3 s){return vec3(s_uc(s[0]),s_uc(s[1]),s_uc(s[2]));}\nvec3 s_l2s(vec3 l){return clamp(vec3(s_c(l[0]),s_c(l[1]),s_c(l[2])),.0,1.);}\nvoid s_up(vec3 l,out float w,out float c,out float m,out float y,out float r,out float g,out float b){\nw=min(l.r,min(l.g,l.b));\nl-=w;\nc=min(l.g,l.b);\nm=min(l.r,l.b);\ny=min(l.r,l.g);\nr=min(max(0.,l.r-l.b),max(0.,l.r-l.g));\ng=min(max(0.,l.g-l.b),max(0.,l.g-l.r));\nb=min(max(0.,l.b-l.g),max(0.,l.b-l.r));\n}\nvoid s_l2r(vec3 l,inout float R[S_S]){\nfloat w,c,m,y,r,g,b;\ns_up(l,w,c,m,y,r,g,b); \nR[0]=max(S_E,w+c*.96853629+m*.51567122+y*.02055257+r*.03147571+g*.49108579+b*.97901834);\nR[1]=max(S_E,w+c*.96855103+m*.54015520+y*.02059936+r*.03146636+g*.46944057+b*.97901649);\nR[2]=max(S_E,w+c*.96859338+m*.62645502+y*.02062723+r*.03140624+g*.40165780+b*.97901118);\nR[3]=max(S_E,w+c*.96877345+m*.75595012+y*.02073387+r*.03119611+g*.24490420+b*.97892146);\nR[4]=max(S_E,w+c*.96942204+m*.92826996+y*.02114202+r*.03053888+g*.06826880+b*.97858555);\nR[5]=max(S_E,w+c*.97143709+m*.97223624+y*.02233154+r*.02856855+g*.02732883+b*.97743705);\nR[6]=max(S_E,w+c*.97541862+m*.98616174+y*.02556857+r*.02459485+g*.01360600+b*.97428075);\nR[7]=max(S_E,w+c*.98074186+m*.98955255+y*.03330189+r*.01929520+g*.01000187+b*.96663223);\nR[8]=max(S_E,w+c*.98580992+m*.98676237+y*.05185294+r*.01423112+g*.01284127+b*.94822893);\nR[9]=max(S_E,w+c*.98971194+m*.97312575+y*.10087639+r*.01033111+g*.02636635+b*.89937713);\nR[10]=max(S_E,w+c*.99238027+m*.91944277+y*.24000413+r*.00765876+g*.07058713+b*.76070164);\nR[11]=max(S_E,w+c*.99409844+m*.32564851+y*.53589066+r*.00593693+g*.70421692+b*.46420440);\nR[12]=max(S_E,w+c*.99517200+m*.13820628+y*.79874659+r*.00485616+g*.85473994+b*.20123039);\nR[13]=max(S_E,w+c*.99576545+m*.05015143+y*.91186529+r*.00426186+g*.95081565+b*.08808402);\nR[14]=max(S_E,w+c*.99593552+m*.02912336+y*.95399623+r*.00409039+g*.97170370+b*.04592894);\nR[15]=max(S_E,w+c*.99564041+m*.02421691+y*.97137099+r*.00438375+g*.97651888+b*.02860373);\nR[16]=max(S_E,w+c*.99464769+m*.02660696+y*.97939505+r*.00537525+g*.97429245+b*.02060067);\nR[17]=max(S_E,w+c*.99229579+m*.03407586+y*.98345207+r*.00772962+g*.97012917+b*.01656701);\nR[18]=max(S_E,w+c*.98638762+m*.04835936+y*.98553736+r*.01366120+g*.94258630+b*.01451549);\nR[19]=max(S_E,w+c*.96829712+m*.00011720+y*.98648905+r*.03181352+g*.99989207+b*.01357964);\nR[20]=max(S_E,w+c*.89228016+m*.00008554+y*.98674535+r*.10791525+g*.99989891+b*.01331243);\nR[21]=max(S_E,w+c*.53740239+m*.85267882+y*.98657555+r*.46249516+g*.13823139+b*.01347661);\nR[22]=max(S_E,w+c*.15360445+m*.93188793+y*.98611877+r*.84604333+g*.06968113+b*.01387181);\nR[23]=max(S_E,w+c*.05705719+m*.94810268+y*.98559942+r*.94275572+g*.05628787+b*.01435472);\nR[24]=max(S_E,w+c*.03126539+m*.94200977+y*.98507063+r*.96860996+g*.06111561+b*.01479836);\nR[25]=max(S_E,w+c*.02205445+m*.91478045+y*.98460039+r*.97783966+g*.08987709+b*.01515250);\nR[26]=max(S_E,w+c*.01802271+m*.87065445+y*.98425301+r*.98187757+g*.13656016+b*.01540513);\nR[27]=max(S_E,w+c*.01613460+m*.78827548+y*.98403909+r*.98377315+g*.22169624+b*.01557233);\nR[28]=max(S_E,w+c*.01520947+m*.65738359+y*.98388535+r*.98470202+g*.32176956+b*.01565710);\nR[29]=max(S_E,w+c*.01475977+m*.59909403+y*.98376116+r*.98515481+g*.36157329+b*.01571025);\nR[30]=max(S_E,w+c*.01454263+m*.56817268+y*.98368246+r*.98537114+g*.48361920+b*.01571916);\nR[31]=max(S_E,w+c*.01444459+m*.54031997+y*.98365023+r*.98546685+g*.46488579+b*.01572133);\nR[32]=max(S_E,w+c*.01439897+m*.52110241+y*.98361309+r*.98550011+g*.47440306+b*.01572502);\nR[33]=max(S_E,w+c*.01437620+m*.51041094+y*.98357259+r*.98551031+g*.48576990+b*.01571717);\nR[34]=max(S_E,w+c*.01436343+m*.50526577+y*.98353856+r*.98550741+g*.49267971+b*.01571905);\nR[35]=max(S_E,w+c*.01435687+m*.50255080+y*.98351247+r*.98551323+g*.49625685+b*.01571059);\nR[36]=max(S_E,w+c*.01435370+m*.50126452+y*.98350101+r*.98551563+g*.49807754+b*.01569728);\nR[37]=max(S_E,w+c*.01435408+m*.50083021+y*.98350852+r*.98551547+g*.49889859+b*.01570020);\n}\nvec3 s_x2s(vec3 v){\nmat3 m;\nm[0]=vec3(3.24306333,-1.53837619,-.49893282);\nm[1]=vec3(-.96896309,1.87542451,.04154303);\nm[2]=vec3(.05568392,-.20417438,1.05799454);\nreturn s_l2s(vec3(dot(m[0],v),dot(m[1],v),dot(m[2],v)));\n}\nvec3 s_r2x(float R[S_S]){\nvec3 v=vec3(0.);\nv+=R[0]*vec3(.00006469,.00000184,.00030502);\nv+=R[1]*vec3(.00021941,.00000621,.00103681);\nv+=R[2]*vec3(.00112057,.00003101,.00531314);\nv+=R[3]*vec3(.00376661,.00010475,.01795439);\nv+=R[4]*vec3(.01188055,.00035364,.05707758);\nv+=R[5]*vec3(.02328644,.00095147,.11365162);\nv+=R[6]*vec3(.03455942,.00228226,.17335873);\nv+=R[7]*vec3(.03722379,.00420733,.19620658);\nv+=R[8]*vec3(.03241838,.00668880,.18608237);\nv+=R[9]*vec3(.02123321,.00988840,.13995048);\nv+=R[10]*vec3(.01049099,.01524945,.08917453);\nv+=R[11]*vec3(.00329584,.02141831,.04789621);\nv+=R[12]*vec3(.00050704,.03342293,.02814563);\nv+=R[13]*vec3(.00094867,.05131001,.01613766);\nv+=R[14]*vec3(.00627372,.07040208,.00775910);\nv+=R[15]*vec3(.01686462,.08783871,.00429615);\nv+=R[16]*vec3(.02868965,.09424905,.00200551);\nv+=R[17]*vec3(.04267481,.09795667,.00086147);\nv+=R[18]*vec3(.05625475,.09415219,.00036904);\nv+=R[19]*vec3(.06947040,.08678102,.00019143);\nv+=R[20]*vec3(.08305315,.07885653,.00014956);\nv+=R[21]*vec3(.08612610,.06352670,.00009231);\nv+=R[22]*vec3(.09046614,.05374142,.00006813);\nv+=R[23]*vec3(.08500387,.04264606,.00002883);\nv+=R[24]*vec3(.07090667,.03161735,.00001577);\nv+=R[25]*vec3(.05062889,.02088521,.00000394);\nv+=R[26]*vec3(.03547396,.01386011,.00000158);\nv+=R[27]*vec3(.02146821,.00810264,.0);\nv+=R[28]*vec3(.01251646,.00463010,.0);\nv+=R[29]*vec3(.00680458,.00249138,.0);\nv+=R[30]*vec3(.00346457,.00125930,.0);\nv+=R[31]*vec3(.00149761,.00054165,.0);\nv+=R[32]*vec3(.00076970,.00027795,.0);\nv+=R[33]*vec3(.00040737,.00014711,.0);\nv+=R[34]*vec3(.00016901,.00006103,.0);\nv+=R[35]*vec3(.00009522,.00003439,.0);\nv+=R[36]*vec3(.00004903,.00001771,.0);\nv+=R[37]*vec3(.00002000,.00000722,.0);\nreturn v;\n}\nfloat s_l2c(float l1,float l2,float t){\nfloat t1=l1*pow(1.-t,2.);\nfloat t2=l2*pow(t,2.);\nreturn t2/(t1+t2);\n}\nvec3 spectral_mix(vec3 c1,vec3 c2,float t){\nvec3 lrgb1=s_s2l(c1);\nvec3 lrgb2=s_s2l(c2);\nfloat R1[S_S];\nfloat R2[S_S];\ns_l2r(lrgb1,R1);\ns_l2r(lrgb2,R2);\nfloat l1=s_r2x(R1)[1];\nfloat l2=s_r2x(R2)[1];\nt=s_l2c(l1,l2,t);\nfloat R[S_S];\nfor (int i=0;i<S_S;i++){\nfloat KS=(1.-t)*(pow(1.-R1[i],2.)/(2.*R1[i]))+t*(pow(1.-R2[i],2.)/(2.*R2[i]));\nfloat KM=1.+KS-sqrt(pow(KS,2.)+2.*KS);\nR[i] = KM;\n}\nreturn s_x2s(s_r2x(R));\n}\nvec4 spectral_mix(vec4 c1,vec4 c2,float t){\nreturn vec4(spectral_mix(c1.rgb,c2.rgb,t),mix(c1.a,c2.a,t));\n}\n\nint cM(int i) {return i%uCn;}\nvoid main(){\nvec2 uv=vUv;\nvec4 cl=vec4(vec3(0.),1.);\nvec4 cieCl=cl,okCl=cl,spcCl=cl;\nfor(int i=0;i<ST-1;i++){\nfloat sR=1./float(ST-(S+(${n}-S)));\nfloat sP=sR*float(i);\nfloat sW=.01*sin(uv.x*PI*2.*${n}.0);\nfloat pos=uv.x+sW;\nfloat sM=smoothstep(sP-F,sP+F,pos)*smoothstep(pos-F,pos+F,sP+sR);\nfloat bM=pow(noise(uv*uVp.xy*.181),2.)*2.-1.;\nfloat bF=.02*sin(fract(pos/sR)*PI);\nfloat sA=gN(\n(pos-sP)/sR,\nmod(sP,sR*3.)\n)+bM*bF;\ncieCl.xyz+=sM*lab2rgb(mix(rgb2lab(uC[cM(i)]),rgb2lab(uC[cM(i)+1]),sA));\nokCl.xyz+=sM*oklab_mix(uC[cM(i)],uC[cM(i)+1],sA);\nspcCl.xyz+=sM*spectral_mix(uC[cM(i)],uC[cM(i)+1],sA);\n}\ncl+=((.1*cieCl+.25*okCl+.7*spcCl));\nfc=cl;\n}\n`)(t.config()),v);let r,a,c,l,p,m,u,y,S,w=!1,A=!1,R=!1,P=!1,E=0,I=0,B=0,T=0,F=[[0,0],[0,0],[0,0]];const k=(e=>{const t=e=>{const t=_[_.indexOf(e)];return[t[2].map((e=>_[e])),t[3].map((e=>_[e]))]},n=(e,n)=>0<t(e)[0].filter((e=>e[0]===n[0])).length,o=[],i=h[e[2][2]],r=M(i[0],i[1]);for(let e=0;e<r/2;e++){const e=_.filter((e=>{let t=0;for(let n=0;n<o.length;n++)if(e===o[n]&&(t++,t>3))return!1;return!0})),n=e[V(e.map((e=>e[1])))];o.push(n,U(t(n)[1]))}return Array(8).fill().map((()=>{const e=z(o),i=[e.splice(0,1)[0]];for(let r=0;999>r&&e.length;r++){const r=i[i.length-1];let a;for(let o=0;o<e.length;o++){const i=e[o];if(i[0]===r[0])continue;if(n(r,i))continue;const s=z(t(r)[1]);for(let t=0;t<s.length;t++){const n=e.indexOf(s[t]);if(-1<n){if(a)continue;a=e.splice(n,1)[0]}}if(!a){a=e.splice(o,1)[0];break}}a||(a=z(o).filter((e=>e[0]!==r[0]&&!n(r,e)))[0]),a||(a=_[0]),i.push(a)}const r=i.map((e=>e[0]));return[["uCn","i",r.length],["uC","v3[]",Float32Array.from([...r,r[0]].flatMap(X))]]}))})(Ie),L=[],O=n=>{ve.update(e,1e3/60),t.frame(n,P,ke,Le),B++},N=()=>{A=!1},$=e=>[e.__src[0]*e.__src[2],e.__src[1]*e.__src[2],e.__src[3],e.__src[4]],Y=e=>[e.position.x*y[0],e.position.y*y[1],e.angle,e.__invalid?0:1],j=e=>[ke?1:0,e.__anim[0],e.__anim[1]],q=(e=!1,v=!1,f)=>{var g=Math.round;if(r=he.innerWidth,c=he.innerHeight,e||v||Ve||r!==a||c!==l){if(a=r,l=c,p=r/c,Ve||(p>=x?r=g(c*x):c=g(r/x),p=x),m=Ae("dpr")||s(he.devicePixelRatio,2),u=[r,c,r*m,c*m,p,m],v){const e=1>p?d*p:d,t=1>p?d:d/p;e/m>r&&(u[2]=e,u[3]=t)}t.resize(u,Ve),y=[u[2]/t.size()[0],u[3]/t.size()[1]],n.resize(u[2],u[3],u[0],u[1]),o.resize(u[2],u[3],u[0],u[1]),v||W(Ce,{width:`${r}px`,height:`${c}px`}),(e=>{const n=s(16384,u[2]*t.config()[1]*t.config()[2]*2);i.resize(n,3,.9*r,.9*c);let o=0;const a=()=>{o++,o===L.length&&G(e)};k.forEach(((e,t)=>{i.frame([E,I],e),L[t]=new Image,L[t].onload=a,L[t].src=Me.toDataURL()}))})((()=>{w||(w=!0,S=G(K)),N(),v&&G(f)}))}},K=()=>{const e=performance.now();var i;E=s(e-T,1e3/30),T=e,I+=E,A||(O([E,I,B]),R=t.resting(),!R||P||ke?(o.frame([E,I],(i=t.bodies(),[["uCl","v3",X(b[Ie[3][2]])],["uCd","v3",X(g)],["uBdS","v4[]",Float32Array.from(i.flatMap($))],["uBdP","v4[]",Float32Array.from(i.flatMap(Y))],["uBdA","v3[]",Float32Array.from(i.flatMap(j))],["uTx","t[]",L,"MIRRORED_REPEAT","LINEAR"],["uI","f",Ue?1:0]])),I>E&&n.frame(I,u[2],u[3],y,t.bodies(!0,!0),Ue,1===Oe)):(A=!0,n.clear())),S=G(K)},H=({target:e,clientX:n,clientY:o},i,r)=>{e instanceof HTMLButtonElement||(F[0]=[n/u[0],o/u[1]],i&&(N(),F[1]=F[0],P=!0,t.pointerDown()),F[2]=[F[0][0]-F[1][0],F[0][1]-F[1][1]],r&&(D(F[2]),P=!1,G(t.pointerUp)))},Z=e=>H(e,!0),J=e=>H(e),Q=e=>H(e,!1,!0);return q(),Fe||(()=>{for(let e=0;e<120&&B<7200;)O([0,0,B]),e=t.resting()?e+1:0})(),{resize:q,save:()=>{q(!0,!0,(()=>Be.toBlob((async e=>{await(async(e,t)=>{const n=document;console.log("Downloading...");const o=window.URL.createObjectURL(e),i=n.body.appendChild(n.createElement("a"));i.href=o,i.download=t,i.click(),n.body.removeChild(i),window.URL.revokeObjectURL(o)})(e,`balance-${Date.now()}-${Ee}.png`),q(!0)}))))},mousedown:e=>{t.mousedown(e),Z(e)},mousemove:e=>{t.mousemove(e),J(e)},mouseup:e=>{t.mouseup(e),Q(e)},touchstart:e=>{e.clientX=e.touches[0].clientX,e.clientY=e.touches[0].clientY,t.touchstart(e),Z(e)},touchmove:e=>{e.clientX=e.touches[0].clientX,e.clientY=e.touches[0].clientY,t.touchmove(e),J(e)},touchend:e=>{e.clientX=e.changedTouches[0].clientX,e.clientY=e.changedTouches[0].clientY,t.touchend(e),Q(e)},cleanup:()=>{he.cancelAnimationFrame(S)}}})()};t(),W(Se,{touchAction:"none",margin:0,display:"flex",alignItems:"center",background:g}),W(Ce,{position:"relative",margin:"0 auto"}),W(Te,{pointerEvents:"none",position:"absolute",inset:0}),W(Be,{background:Ue?g:b[Ie[3][2]]}),W(Me,{position:"absolute",right:0,bottom:0,display:"none"}),Y(he,"resize",(()=>e.resize())),Y(he,"keyup",(t=>{S();const n=t.key.toLowerCase();"s"===n&&e.save(),"`"===n&&(Oe=++Oe%3,W(Me,{display:2===Oe?"block":"none"}))}));let n=!1;const o=$(Se,N("nav")),i=$(o,N("button")),r=$(o,N("button")),a=$(o,N("div")),c=$(a,N("button")),l=$(a,N("button")),p=$(a,N("button")),m=$(a,N("button")),u=$(a,N("button"));W(o,{position:"absolute",right:0,top:0,padding:"10px",opacity:0,textAlign:"right",fontSize:"20px",fontFamily:"monospace",transition:"opacity 0.2s",transform:"translateZ(0)"}),W(a,{display:"none",flexDirection:"column",margin:"5px 0 0",fontSize:"17px"});const y=()=>{W(o,{opacity:0})},S=()=>{W(o,{opacity:1}),clearTimeout(ze),ze=setTimeout(y,3e3)},w=(e,t)=>(e?we.delete(t):we.set(t,""),Pe()||he.history.replaceState({},"",he.location.pathname+`?${we}`.replace(/=(?=&|$)/g,"")),!e),A=()=>{Le=w(Le,"excite"),P(),t()};Y(Ce,"mousedown",(t=>{S(),e.mousedown(t)})),Y(_e,"mousemove",(t=>{S(),e.mousemove(t)})),Y(_e,"mouseup",(t=>{S(),e.mouseup(t)})),Y(Ce,"touchstart",(t=>{S(),e.touchstart(t)})),Y(_e,"touchmove",(t=>{S(),e.touchmove(t)})),Y(_e,"touchend",(t=>{S(),e.touchend(t)}));const R=[[i,()=>"+",()=>{n=!n,n?(i.innerText="-",W(a,{display:"flex"})):(i.innerText="+",W(a,{display:"none"}))}],[r,()=>"×",()=>W(o,{display:"none"})],[c,()=>(Ve?"☑":"☐")+" expand",()=>{Ve=w(Ve,"expand"),P(),t()}],[l,()=>(Fe?"☑":"☐")+" expose",()=>{Fe=w(Fe,"expose"),P(),t()}],[p,()=>(ke?"☑":"☐")+" excess",()=>{ke=w(ke,"excess"),Le&&A(),P(),t()}],[m,()=>(Le?"☑":"☐")+" excite",A,()=>!ke],[u,()=>"↓ export",()=>e.save()]];R.forEach((e=>{W(e[0],{fontSize:"inherit",fontFamily:"inherit",color:g,padding:"5px 10px",margin:"4px 2px 0",textAlign:"left"}),Y(e[0],"click",e[2])}));const P=()=>{R.forEach((e=>{e[0].innerText=e[1](),e[3]&&(e[0].disabled=e[3]()?"disabled":"")}))};P()})()})();
|i.bodyA&&i.bodyA.isStatic,a=!i.bodyB||i.bodyB&&i.bodyB.isStatic,r||a||se.solve(e[o],n)},solve:(e,t)=>{var n=e.bodyA,o=e.bodyB,i=e.pointA,r=e.pointB;if(n||o){n&&!n.isStatic&&(j.rotate(i,n.angle-e.angleA,i),e.angleA=n.angle),o&&!o.isStatic&&(j.rotate(r,o.angle-e.angleB,r),e.angleB=o.angle);var a=i,s=r;if(n&&(a=j.add(n.position,i)),o&&(s=j.add(o.position,r)),a&&s){var c=j.sub(a,s),l=j.magnitude(c);l<se._ml&&(l=se._ml);var v,p,x,d,m,u=(l-e.length)/l,y=1<=e.stiffness||0===e.length?e.stiffness*t:e.stiffness*t*t,f=e.damping*t,g=j.mult(c,u*y),b=(n?n.inverseMass:0)+(o?o.inverseMass:0),h=b+((n?n.inverseInertia:0)+(o?o.inverseInertia:0));if(0<f){var _=j.create();x=j.div(c,l),m=j.sub(o&&j.sub(o.position,o.positionPrev)||_,n&&j.sub(n.position,n.positionPrev)||_),d=j.dot(x,m)}n&&!n.isStatic&&(p=n.inverseMass/b,n.constraintIp.x-=g.x*p,n.constraintIp.y-=g.y*p,n.position.x-=g.x*p,n.position.y-=g.y*p,0<f&&(n.positionPrev.x-=f*x.x*d*p,n.positionPrev.y-=f*x.y*d*p),v=j.cross(i,g)/h*se._td*n.inverseInertia*(1-e.angularStiffness),n.constraintIp.angle-=v,n.angle-=v),o&&!o.isStatic&&(p=o.inverseMass/b,o.constraintIp.x+=g.x*p,o.constraintIp.y+=g.y*p,o.position.x+=g.x*p,o.position.y+=g.y*p,0<f&&(o.positionPrev.x+=f*x.x*d*p,o.positionPrev.y+=f*x.y*d*p),v=j.cross(r,g)/h*se._td*o.inverseInertia*(1-e.angularStiffness),o.constraintIp.angle+=v,o.angle+=v)}}},postSolveAll:e=>{for(var t=0;t<e.length;t++){var n=e[t],o=n.constraintIp;if(!(n.isStatic||0===o.x&&0===o.y&&0===o.angle)){for(var i,r=0;r<n.parts.length;r++)i=n.parts[r],H.translate(i.vertices,o),0<r&&(i.position.x+=o.x,i.position.y+=o.y),0!==o.angle&&(H.rotate(i.vertices,o.angle,n.position),K(i.axes,o.angle),0<r&&j.rotateAbout(i.position,o.angle,n.position,i.position)),Z.update(i.bounds,i.vertices,n.vel);o.angle*=se._w,o.x*=se._w,o.y*=se._w}}}},ce={create:e=>q.extend({bodies:[],pairs:null},e),setBodies:(e,t)=>{e.bodies=t.slice(0)},collisions:e=>{var t,n,o=[],i=e.pairs,r=e.bodies,a=r.length,s=ce.canCollide,c=ne.collides;for(r.sort(ce._compareBoundsX),t=0;t<a;t++){var l=r[t],v=l.bounds,p=l.bounds.max.x,x=l.bounds.max.y,d=l.bounds.min.y,m=l.isStatic,u=l.parts.length,y=1===u;for(n=t+1;n<a;n++){var f=r[n];if((R=f.bounds).min.x>p)break;if(!(x<R.min.y||d>R.max.y)&&(!m||!f.isStatic)&&s(l.filter,f.filter)){var g=f.parts.length;if(y&&1===g)(w=c(l,f,i))&&o.push(w);else for(var b=1<g?1:0,h=1<u?1:0;h<u;h++)for(var _=l.parts[h],S=(v=_.bounds,b);S<g;S++){var w,A=f.parts[S],R=A.bounds;v.min.x>R.max.x||v.max.x<R.min.x||v.max.y<R.min.y||v.min.y>R.max.y||(w=c(_,A,i))&&o.push(w)}}}}return o},canCollide:(e,t)=>e.group===t.group&&0!==e.group?0<e.group:0!=(e.mask&t.category)&&0!=(t.mask&e.category),_compareBoundsX:(e,t)=>e.bounds.min.x-t.bounds.min.x},le={_rt:2};le._rtt=r(6),le._pd=.9,le._pw=.8,le._fnm=5,le._fms=e,le.preSolvePosition=e=>{var t,n,o,i=e.length;for(t=0;t<i;t++)(n=e[t]).isActive&&(o=n.activeContacts.length,n.collision.parentA.totalContacts+=o,n.collision.parentB.totalContacts+=o)},le.solvePosition=(e,t,n)=>{var o,i,r,a,s,c,l,v,p=le._pd*(n||1),x=q.clamp(t/q._bd,0,1),d=e.length;for(o=0;o<d;o++)(i=e[o]).isActive&&!i.isSensor&&(a=(r=i.collision).parentA,s=r.parentB,c=r.normal,i.separation=c.x*(s.positionIp.x+r.penetration.x-a.positionIp.x)+c.y*(s.positionIp.y+r.penetration.y-a.positionIp.y));for(o=0;o<d;o++)(i=e[o]).isActive&&!i.isSensor&&(a=(r=i.collision).parentA,s=r.parentB,c=r.normal,v=i.separation-i.slop*x,(a.isStatic||s.isStatic)&&(v*=2),a.isStatic||(l=p/a.totalContacts,a.positionIp.x+=c.x*v*l,a.positionIp.y+=c.y*v*l),s.isStatic||(l=p/s.totalContacts,s.positionIp.x-=c.x*v*l,s.positionIp.y-=c.y*v*l))},le.postSolvePosition=e=>{for(var t=le._pw,n=e.length,o=H.translate,i=Z.update,r=0;r<n;r++){var a=e[r],s=a.positionIp,c=s.x,l=s.y,v=a.vel;if(a.totalContacts=0,0!==c||0!==l){for(var p,x=0;x<a.parts.length;x++)o((p=a.parts[x]).vertices,s),i(p.bounds,p.vertices,v),p.position.x+=c,p.position.y+=l;a.positionPrev.x+=c,a.positionPrev.y+=l,0>c*v.x+l*v.y?(s.x=0,s.y=0):(s.x*=t,s.y*=t)}}},le.preSolveVel=e=>{var t,n,o=e.length;for(t=0;t<o;t++){var i=e[t];if(i.isActive&&!i.isSensor){var r=i.activeContacts,a=r.length,s=i.collision,c=s.parentA,l=s.parentB,v=s.normal,p=s.tangent;for(n=0;n<a;n++){var x=r[n],d=x.vertex,m=x.normalIp,u=x.tangentIp;if(0!==m||0!==u){var y=v.x*m+p.x*u,f=v.y*m+p.y*u;c.isStatic||(c.positionPrev.x+=y*c.inverseMass,c.positionPrev.y+=f*c.inverseMass,c.anglePrev+=c.inverseInertia*((d.x-c.position.x)*f-(d.y-c.position.y)*y)),l.isStatic||(l.positionPrev.x-=y*l.inverseMass,l.positionPrev.y-=f*l.inverseMass,l.anglePrev-=l.inverseInertia*((d.x-l.position.x)*f-(d.y-l.position.y)*y))}}}}},le.solveVel=(e,t)=>{var n,o,i,r,a=t/q._bd,c=a*a*a,l=-le._rt*a,v=le._rtt,p=le._fnm*a,x=le._fms,d=e.length;for(i=0;i<d;i++){var m=e[i];if(m.isActive&&!m.isSensor){var u=m.collision,y=u.parentA,f=u.parentB,g=y.vel,b=f.vel,h=u.normal.x,_=u.normal.y,S=u.tangent.x,w=u.tangent.y,A=m.activeContacts,R=A.length,P=1/R,E=y.inverseMass+f.inverseMass,I=m.friction*m.frictionStatic*p;for(g.x=y.position.x-y.positionPrev.x,g.y=y.position.y-y.positionPrev.y,b.x=f.position.x-f.positionPrev.x,b.y=f.position.y-f.positionPrev.y,y.angularVel=y.angle-y.anglePrev,f.angularVel=f.angle-f.anglePrev,r=0;r<R;r++){var C=A[r],B=C.vertex,T=B.x-y.position.x,M=B.y-y.position.y,U=B.x-f.position.x,z=B.y-f.position.y,V=g.x-M*y.angularVel,F=g.y+T*y.angularVel,k=V-(b.x-z*f.angularVel),L=F-(b.y+U*f.angularVel),O=h*k+_*L,D=S*k+w*L,X=m.separation+O,N=s(X,1),$=(N=0>X?0:N)*I;D<-$||D>$?(o=0<D?D:-D,(n=m.friction*(0<D?1:-1)*c)<-o?n=-o:n>o&&(n=o)):(n=D,o=x);var Y=T*_-M*h,G=U*_-z*h,W=P/(E+y.inverseInertia*Y*Y+f.inverseInertia*G*G),j=(1+m.restitution)*O*W;if(n*=W,O<l)C.normalIp=0;else{var K=C.normalIp;C.normalIp+=j,0<C.normalIp&&(C.normalIp=0),j=C.normalIp-K}if(D<-v||D>v)C.tangentIp=0;else{var H=C.tangentIp;C.tangentIp+=n,C.tangentIp<-o&&(C.tangentIp=-o),C.tangentIp>o&&(C.tangentIp=o),n=C.tangentIp-H}var Z=h*j+S*n,J=_*j+w*n;y.isStatic||(y.positionPrev.x+=Z*y.inverseMass,y.positionPrev.y+=J*y.inverseMass,y.anglePrev+=(T*J-M*Z)*y.inverseInertia),f.isStatic||(f.positionPrev.x-=Z*f.inverseMass,f.positionPrev.y-=J*f.inverseMass,f.anglePrev-=(U*J-z*Z)*f.inverseInertia)}}}};var ve={create:e=>{e=e||{};var t=q.extend({posIt:6,velIt:4,conIt:2,gravity:{x:0,y:1,scale:.001},timing:{timestamp:0,timeScale:1,lastDelta:0,lastElapsed:0}},e);return t.world=e.world||ae.create(),t.pairs=e.pairs||(e=>q.extend({table:{},list:[],collisionStart:[],collisionActive:[],collisionEnd:[]},e))(),t.detector=e.detector||ce.create(),t.grid={buckets:[]},t.world.gravity=t.gravity,t.broadphase=t.grid,t.metrics={},t},update:(e,t)=>{var n,o=q.now(),i=e.world,r=e.detector,a=e.pairs,s=e.timing,c=s.timestamp;t=void 0===t?q._bd:t,t*=s.timeScale,s.timestamp+=t,s.lastDelta=t;var l=ae.allBodies(i),v=ae.allConstraints(i);for(i.isModified&&(ce.setBodies(r,l),ae.setModified(i,!1,!1,!0)),ve._bag(l,e.gravity),0<t&&ve._bu(l,t),se.preSolveAll(l),n=0;n<e.conIt;n++)se.solveAll(v,t);se.postSolveAll(l),r.pairs=e.pairs,((e,t,n)=>{var o,i,r,a,s=e.list,c=s.length,l=e.table,v=t.length,p=e.collisionStart,x=e.collisionEnd,d=e.collisionActive;for(p.length=0,x.length=0,d.length=0,a=0;a<c;a++)s[a].confirmedActive=!1;for(a=0;a<v;a++)(r=(o=t[a]).pair)?(r.isActive?d.push(r):p.push(r),te.update(r,o,n),r.confirmedActive=!0):(l[(r=te.create(o,n)).id]=r,p.push(r),s.push(r));var m=[];for(c=s.length,a=0;a<c;a++)(r=s[a]).confirmedActive||(te.setActive(r,!1,n),x.push(r),m.push(a));for(a=0;a<m.length;a++)r=s[i=m[a]-a],s.splice(i,1),delete l[r.id]})(a,ce.collisions(r),c);var p=q.clamp(20/e.posIt,0,1);for(le.preSolvePosition(a.list),n=0;n<e.posIt;n++)le.solvePosition(a.list,t,p);for(le.postSolvePosition(l),se.preSolveAll(l),n=0;n<e.conIt;n++)se.solveAll(v,t);for(se.postSolveAll(l),le.preSolveVel(a.list),n=0;n<e.velIt;n++)le.solveVel(a.list,t);return ve._buv(l),ve._bcf(l),e.timing.lastElapsed=q.now()-o,e},_bcf:e=>{for(var t,n=e.length,o=0;o<n;o++)(t=e[o]).force.x=0,t.force.y=0,t.torque=0},_bag:(e,t)=>{var n=void 0===t.scale?.001:t.scale,o=e.length;if((0!==t.x||0!==t.y)&&0!==n)for(var i,r=0;r<o;r++)(i=e[r]).isStatic||(i.force.y+=i.mass*t.y*n,i.force.x+=i.mass*t.x*n)},_bu:(e,t)=>{for(var n,o=e.length,i=0;i<o;i++)(n=e[i]).isStatic||J.update(n,t)},_buv:e=>{for(var t=e.length,n=0;n<t;n++)J.updateVelocities(e[n])}};const pe=(e,t,n,o,i)=>{e.width=t,e.height=n,W(e,{width:`${o}px`,height:`${i}px`})},xe=(e,t)=>{e.save(),t(),e.restore()},de=(e,t,n=[1,1])=>{e.moveTo(t[0].x*n[0],t[0].y*n[1]);for(let o=1,i=t.length;o<i;o++)e.lineTo(t[o].x*n[0],t[o].y*n[1])},me=e=>e.clearRect(0,0,e.canvas.width,e.canvas.height),ue=(e,t,n)=>{const o=e.createShader(t);return e.shaderSource(o,n),e.compileShader(o),e.getShaderParameter(o,e.COMPILE_STATUS)?o:void e.deleteShader(o)},ye=(e,t,n=0,o=e.CLAMP_TO_EDGE,i=e.NEAREST)=>{const r=e.createTexture();return e.activeTexture(e.TEXTURE0+n),e.bindTexture(e.TEXTURE_2D,r),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,o),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,o),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,i),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,i),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t),r};var fe=(e,t,n,o,i=!0)=>{const r=e.getContext("webgl2",o);i&&(r.drawingBufferColorSpace="display-p3"),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!0);const a=((e,t,n)=>{const o=e.createProgram();return e.attachShader(o,t),e.attachShader(o,n),e.linkProgram(o),e.getProgramParameter(o,e.LINK_STATUS)?o:void e.deleteProgram(o)})(r,ue(r,r.VERTEX_SHADER,t),ue(r,r.FRAGMENT_SHADER,n)),s=r.getAttribLocation(a,"aPos"),c=r.createBuffer();r.bindBuffer(r.ARRAY_BUFFER,c),r.bufferData(r.ARRAY_BUFFER,new Float32Array([-1,-1,-1,3,3,-1]),r.STATIC_DRAW);const l=r.createVertexArray();r.bindVertexArray(l),r.enableVertexAttribArray(s),r.bindBuffer(r.ARRAY_BUFFER,c),r.vertexAttribPointer(s,2,r.FLOAT,!1,0,0),r.bindVertexArray(null);const v=[];let p;const x=()=>r.clear(r.COLOR_BUFFER_BIT);return{resize:(t,n,o,i)=>{pe(e,t,n,o||t,i||n),p=[t,n,t/n],x()},frame:(e=[0,0],t=[])=>{r.viewport(0,0,p[0],p[1]),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),r.useProgram(a),r.bindVertexArray(l);let n=0;[["uVp","v3",p],["uT","f",e[1]],...t.map((e=>("t"===e[1]&&(v[e[0]]=[ye(r,e[2],n,r[e[3]],r[e[4]]),n++]),"t[]"===e[1]&&(v[e[0]]=[[],[]],e[2].forEach((t=>{v[e[0]][0].push(ye(r,t,n,r[e[3]],r[e[4]])),v[e[0]][1].push(n++)}))),e)))].forEach((([e,t,n])=>((e,[t,n,o,i])=>{"b"===t?e.uniform1i(o,!0===n?1:0):"i"===t?e.uniform1i(o,n):"i[]"===t?e.uniform1iv(o,n):"f"===t?e.uniform1f(o,n):"f[]"===t?e.uniform1fv(o,n):"v2"===t?e.uniform2f(o,...n):"v2[]"===t?e.uniform2fv(o,n):"v3"===t?e.uniform3f(o,...n):"v3[]"===t?e.uniform3fv(o,n):"v4"===t?e.uniform4f(o,...n):"v4[]"===t?e.uniform4fv(o,n):"t"===t?e.uniform1i(o,i):"t[]"===t&&e.uniform1iv(o,i)})(r,[t,"t"===t||"t[]"===t?v[e][0]:n,r.getUniformLocation(a,e),"t"===t||"t[]"===t?v[e][1]:-1]))),r.drawArrays(r.TRIANGLES,0,3)},clear:x}};const ge="#version 300 es\nin vec2 aPos;\nout vec2 vUv;\nvoid main(){gl_Position=vec4(aPos*2.-1.,0.,1.);vUv=aPos;}\n";var be=(e,o,i)=>{const r=m[i[1][2]],v=u[i[1][2]]*y[i[0][2]],x=s(1+c((r-1)/8),4);let d,f,g,b,h,_,S,w,A,R=!1,P=0,I=[p,p],C=[],M=[],U=[],z=[],L=[],O=!1,X=0,N=[],$=[];const Y=T(.4,.6),G=T(.2,.3),W=(t=!1,n=!1)=>ae.allBodies(e.world).filter((e=>(t||!e.__cursor)&&(n||!e.__bound))),q=(e=0,t=0,n,o)=>ee.rectangle(e,t,n,o,{isStatic:!0,friction:.5,filter:{category:2},__bound:!0}),K=(e,t,n,o,i,r,a,c,l,p)=>{const x=s(...I)*v*r,d=ee.rectangle(e,t,x*o,x*i,{restitution:.5,friction:.9,density:2e-4,color:"blue"});return J.setVertices(d,d.vertices.map(((e,t)=>{let n=[e.x-d.position.x,e.y-d.position.y];return 2<=t&&(e.x-=a*n[0]),e}))),J.setAngle(d,n),d.__pos=[e,t,n],d.__src=[o,1,r,a,c],d.__anim=[l,p,0],d},H=()=>{const e=T(.2,.8)*b,n=T(-1.1,-.1)*_,o=[1,Y,G,T(.2,.8),B()?T(.1,.3):T(.4,.6)][i[0][2]],r=E()*t*2,a=i[1][1]===F?.4+.6*l(E(),2):i[1][1]===k&&B(.7)?.5:1,s=.07*l(E(),4),c=2+V([1,8,4,1]),v=E();return K(e,n,r,o,1,a,s,c,v,0)};let Z=()=>{};return{config:()=>[r,v,x],resize:(...t)=>Z=((t,n)=>{Z(),O=!1,X=0;const i=!!U.length;d=t[4],g=1<=d,b=p*(g?d:1),h=b/2,_=p/(g?1:d),S=_/2,w=.015*s(b,_);const r=d>f?1:-1;if(f=d,I=[b,_],!i||n){C=[q(-h+w,S,b,4*_),q(b+h-w,S,b,4*_),q(h,-(_+S)+w,2*b,_),q(h,_+S-w,2*b,_)],ae.add(e.world,C),M=[];for(let e=0;e<P;e++){const t=i?K(U[e][0]*b,U[e][1]*_,U[e][2],...z[e],...L[e]):H();M.push(t);const n=.2*t.m*r;J.applyForce(t,t.position,j.create((2*E()-1)*n,-E()*n))}ae.add(e.world,M)}A=((e=document.body)=>{let t=!1,n=!1,o=[1,1],i=[];const r=t=>{i=[],((e,t)=>{for(var n=0,o=e.length;n<o;n++)t(Array.isArray(e)?e.at(n):e.item(n),n)})(t,((t,n)=>{const r=((e,t)=>{const n=t.getBoundingClientRect(),o=document.documentElement||document.body.parentNode||document.body,i=void 0===window.pageXOffset?o.scrollLeft:window.pageXOffset,r=void 0===window.pageYOffset?o.scrollTop:window.pageYOffset,a=e.pageX-n.left-i,s=e.pageY-n.top-r;return[a/(t.clientWidth/(t.width||t.clientWidth)),s/(t.clientHeight/(t.height||t.clientHeight))]})(t,e),a=r[0]*o[0],s=r[1]*o[1],c=t.identifier||0;i[n]={x:a,y:s,id:c}}))};return{positions:()=>i,setScale:([e,t])=>{o=[e,t]},touchstart:e=>{t=!0,r(e.targetTouches)},touchmove:e=>{r(e.targetTouches)},touchend:e=>{r(e.targetTouches)},mousedown:e=>{t||(n=!0,r([e]))},mousemove:e=>{t||n&&r([e])},mouseup:e=>{t||(n=!1,r([]))}}})(o),A.setScale([b/t[0],_/t[1]]);for(let e=0;e<64;e++)$[e]=ee.circle(0,0,.02*s(b,_),{color:"#0f0",filter:{category:2,mask:1},density:.01,__cursor:!0});return()=>{U=M.map((e=>[e.position.x/b,e.position.y/_,e.angle])),z=M.map((e=>e.__src)),L=M.map((e=>e.__anim)),n&&ae.remove(e.world,[...C,...M])}})(...t),frame:([t,o,i],c,v,p)=>{if(O=!0,X=o===t?1e3-t:c?0:X+t,0<o&&X<=1e3&&(O=!1),ae.remove(e.world,$),A.positions().forEach((t=>{const o=n(t.id%64);J.setPosition($[o],j.create($[o].position.x+.05*(t.x-$[o].position.x),$[o].position.y+.05*(t.y-$[o].position.y)),!0),ae.add(e.world,$[o])})),W().forEach(((e,t)=>{const o=D([e.position.x,e.position.y],[...e.__pos]),i=e.angle-e.__pos[2];(o>.2||n(i)>.002)&&(O=!1,X=0),e.__pos=[e.position.x,e.position.y,e.angle],e.__invalid=!v&&(e=>{for(let t=0,n=e.vertices.length;t<n;t++)if(e.vertices[t].y<w/2)return!0;return!1})(e),e.__anim[1]+=3e-4*e.speed+s(e.angularSpeed,.01),p&&(J.applyForce(e,e.position,j.create(0,.5*((e,t,n)=>a(s(e,30),10))(e.mass)*l(a(0,e.position.y/_),3)*e.__anim[2]*-1)),e.__anim[2]*=.97,B(1/s(r,36)*.004)&&(e.__anim[2]+=1))})),!R){if(!(i%30)){const t=H();M.push(t),ae.add(e.world,t),P++}P>=r&&(R=!0)}},size:()=>[...I],bodies:W,resting:()=>O,populated:()=>R,pointerDown:()=>{if(A.positions().length)for(let e=0;e<A.positions().length;e++){const t=A.positions()[e],o=n(t.id%64);N.find((({id:e})=>t.id===e))||J.setPosition($[o],t,!1)}N=[...A.positions()]},pointerUp:()=>{N=[...A.positions()]},mousedown:e=>A.mousedown(e),mousemove:e=>A.mousemove(e),mouseup:e=>A.mouseup(e),touchstart:e=>A.touchstart(e),touchmove:e=>A.touchmove(e),touchend:e=>A.touchend(e)}};const he=window,_e=document,Se=_e.body,we=new URLSearchParams(he.location.search),Ae=e=>we.get(e),Re=e=>null!==Ae(e),Pe=()=>{try{return he.self!==he.top}catch(e){return!0}},Ee="undefined"==typeof tokenData?Ae("seed")||(()=>{let e="0x";for(let t=64;0<t;--t)e+="0123456789abcdef"[~~(16*Math.random())];return e})():"string"==typeof tokenData?tokenData:tokenData.hash;C(Ee);const Ie=O.map((e=>{const t=e[1].map((e=>e[1])),n=V(t);return[e[0],e[1][n][0],n]}));console.log(`${Ee}\n`,...Ie.map((e=>`\n${e[0]}: ${e[1]}`)),Pe()?"\n\niframe":"");const Ce=$(Se,N("main")),Be=$(Ce,N("canvas")),Te=$(Ce,N("canvas")),Me=$(Se,N("canvas")),Ue=Ie[3][1]===L;let ze,Ve=Re("expand"),Fe=Re("expose"),ke=Re("excess"),Le=Re("excite"),Oe=0;(()=>{let e;const t=()=>{e&&e.cleanup(),e=(()=>{C(Ee);const e=ve.create(),t=be(e,Ce,Ie),n=(e=>{const t=e.getContext("2d");return{resize:(t,n,o,i)=>pe(e,t,n,o,i),frame:(e,n,o,i,r,a,c)=>{me(t),c&&xe(t,(()=>{t.fillStyle=a?g:f,t.globalAlpha=.3,t.fillRect(0,0,n,o)}));for(let l=0,v=r.length;l<v;l++){const v=r[l];xe(t,(()=>{c&&(t.scale(.5,.5),t.translate(n/2,o)),t.beginPath(),de(t,[...v.vertices,v.vertices[0]],i),t.closePath(),c?(t.globalAlpha=.8,t.fillStyle=v.__invalid?"red":v.color,t.fill()):(v.__cursor||v.__invalid)&&100<e&&(t.strokeStyle=a?f:g,t.lineWidth=.002*s(n,o),t.stroke())}))}},clear:()=>me(t)}})(Te),o=fe(Be,ge,(([e,t,n])=>`#version 300 es\nprecision highp float;\n#define COUNT ${e}\n#define TILE ${n}.0\n#define BASE ${t}\n#define PI 3.1415926535\n#define F .0006\nin vec2 vUv;\nuniform vec4 uBdS[COUNT],uBdP[COUNT];\nuniform vec3 uVp,uCl,uCd,uBdA[COUNT];\nuniform float uT,uI;\nuniform sampler2D uTx[8];\nout vec4 fc;\nmat2 r2d(float t){return mat2(cos(t),sin(t),-sin(t),cos(t));}\nvec2 rUV(vec2 st,float t){float sr=sin(t),cr=cos(t);return vec2(cr*(st.x)+sr*(st.y)+.5,cr*(st.y)-sr*(st.x)+.5);}\nfloat rand(vec2 st){return fract(sin(dot(st,vec2(12.9898,78.233)))*43758.5453);}\nvec2 gO(vec4 bdP){\nvec2 pos=bdP.xy/uVp.xy;\npos.y=(1.-pos.y)/uVp.z;\nreturn pos;\n}\nfloat rect(vec2 st,vec4 bdP,vec4 bdS,float f){\nfloat x=(1.-bdS.x/max(uVp.z,1.)/(1./BASE))/2.; \nfloat y=(1.-bdS.y/max(uVp.z,1.)/(1./BASE))/2.;\nx*=1.-.5*bdS.z*bdS.x;\nx*=1.0015;y*=1.0015;\nst=rUV(st-gO(bdP),PI-bdP.z);\nvec2 wBl=st,wTr=st;\nwBl.x-=bdS.z*st.y*bdS.x*.5;\nwTr.x+=bdS.z*st.y*bdS.x*.5;\nwBl.y-=bdS.z*st.y*.11;\nwTr.y-=bdS.z*st.y*.05;\nvec2 bl=smoothstep(vec2(x-f,y-f),vec2(x+f,y+f),wBl);\nvec2 tr=smoothstep(vec2(x-f,y-f),vec2(x+f,y+f),1.-wTr);\nreturn bl.x*bl.y*tr.x*tr.y;\n}\nvec2 tU(vec2 st,vec4 bdP,vec4 bdS,int i){\nreturn rUV((st-gO(bdP))*(1./BASE)*max(uVp.z, 1.),PI*.5-bdP.z)\n*vec2(1./TILE,1.)\n*vec2((1./(3.0+1.))*(bdS.w-1.),1.)\n+vec2(.5*max(1.-TILE,0.)+(1./TILE)*float(i/8),0.);\n}\nfloat tM(int i,int o){return step(float(i+o&7),0.);}\nvoid main(){\nvec2 uv=vUv;\nuv.y/=uVp.z;\nvec4 b=vec4(uCd,1.);\nvec4 w=vec4(uCl,1.);\nvec4 c=mix(w,b,uI);\nfor (int i=0;i<COUNT;i++){\nvec4 bdP=uBdP[i];\nvec4 bdS=uBdS[i];\nvec3 bdA=uBdA[i];\nfloat r=.93*rect(uv,bdP,bdS,F)*bdP.w;\nc = max(c-r,0.);\nvec2 tO=vec2(-.7*pow(1.-bdS.y,4.),0.); \nvec2 tA=vec2(0.,\nuT*.00005*(.1+.9*pow(bdA.y,4.))\n+.5*bdA.z\n)*r2d(bdP.z);\nvec2 tUV=uv+vec2(0.,.035*bdS.z)*r2d(bdP.z)+tO+tA*bdA.x;\nc+=r*tM(i,0)*texture(uTx[0],tU(tUV,bdP,bdS,i));\nc+=r*tM(i,1)*texture(uTx[1],tU(tUV,bdP,bdS,i));\nc+=r*tM(i,2)*texture(uTx[2],tU(tUV,bdP,bdS,i));\nc+=r*tM(i,3)*texture(uTx[3],tU(tUV,bdP,bdS,i));\nc+=r*tM(i,4)*texture(uTx[4],tU(tUV,bdP,bdS,i));\nc+=r*tM(i,5)*texture(uTx[5],tU(tUV,bdP,bdS,i));\nc+=r*tM(i,6)*texture(uTx[6],tU(tUV,bdP,bdS,i));\nc+=r*tM(i,7)*texture(uTx[7],tU(tUV,bdP,bdS,i));\n}\nc+=(rand(uv*10.)*2.-1.)*.025;\nfc=c;\n}\n`)(t.config()),v),i=fe(Me,ge,(([e,t,n])=>`#version 300 es\nprecision highp float;\n#define S 5\n#define ST ${5*n}\n#define PI 3.141592653589793\n#define F .0001\nin vec2 vUv;\nuniform int uCn;\nuniform float uT;\nuniform vec3 uVp, uC[ST];\nout vec4 fc;\nvec3 mod289(vec3 x){return x-floor(x*(1./289.))*289.;}vec2 mod289(vec2 x){return x-floor(x*(1./289.))*289.;}vec3 permute(vec3 x){return mod289(((x*34.)+1.)*x);}float noise(vec2 v){const vec4 C=vec4(.211324865405187,.366025403784439,-.577350269189626,.024390243902439);vec2 i=floor(v+dot(v,C.yy));vec2 x0=v-i+dot(i,C.xx);vec2 i1;i1=(x0.x>x0.y)?vec2(1.,0.):vec2(0.,1.);vec4 x12=x0.xyxy+C.xxzz;x12.xy-=i1;i=mod289(i);vec3 p=permute(permute(i.y+vec3(0.,i1.y,1.))+i.x+vec3(0.,i1.x,1.));vec3 m=max(.5-vec3(dot(x0,x0),dot(x12.xy,x12.xy),dot(x12.zw,x12.zw)),0.);m=m*m;m=m*m;vec3 x=2.*fract(p*C.www)-1.;vec3 h=abs(x)-.5;vec3 ox=floor(x+.5);vec3 a0=x-ox;m*=1.79284291400159-.85373472095314*(a0*a0+h*h);vec3 g;g.x=a0.x*x0.x+h.x*x0.y;g.yz=a0.yz*x12.xz+h.yz*x12.yw;return 130.*dot(m,g);}\nfloat g1(float x,float k){x=clamp(x,0.,1.);float s=sign(x-.5);float o=(1.+s)/2.;return o-.5*s*pow(2.*(o-s*x),k);}\nfloat gN(float x,float a){return g1(x,1.2+.8*a);}\n\n// Copyright (c) 2022 Adam Lastowka (MIT License)\n#define D65 vec3(.950456,1.,1.089058)\nvec3 rgb2xyz(vec3 rgb){return rgb*mat3(.4124,.3576,.1805,.2126,.7152,.0722,.0193,.1192,.9505);}\nvec3 xyz2rgb(vec3 xyz){return xyz*mat3(3.2406255,-1.5372080,-.4986286,-.9689307,1.8757561,.0415175,.0557101,-.2040211,1.0569959);}\nfloat xyz2labF(float x){return x>.00885645167?pow(x,1./3.):7.78703703704*x+.13793103448;}\nvec3 xyz2lab(vec3 xyz){\nvec3 s=xyz/D65;\ns=vec3(xyz2labF(s.x),xyz2labF(s.y),xyz2labF(s.z));\nreturn vec3((116.*s.y)-16.,500.*(s.x-s.y),200.*(s.y-s.z));\n}\nfloat lab2xyzF(float x){return x>.206897?x*x*x:(.12841854934*(x-0.137931034));}\nvec3 lab2xyz(vec3 lab){\nfloat w=(lab.x+16.)/116.;\nreturn D65*vec3(lab2xyzF(w+lab.y/500.),lab2xyzF(w),lab2xyzF(w-lab.z/200.));\n}\nvec3 rgb2lab(vec3 rgb){return xyz2lab(rgb2xyz(rgb));}\nvec3 lab2rgb(vec3 lab){retu
/* With special thanks: - matter-js: Copyright (c) Liam Brummitt and contributors (MIT License) - spectral.js: Copyright (c) 2023 Ronald van Wijnen (MIT License) - Oklab: Copyright (c) 2020 Björn Ottosson (MIT License) - GLSL-Color-Functions: Copyright (c) 2022 Adam Lastowka (MIT License) - tiny-artblocks: Copyright (c) 2017 Matt DesLauriers (MIT License) - noise2d: Copyright (C) 2011 Ian McEwan, Ashima Arts (MIT License) */ (()=>{"use strict";var e=Number.MAX_VALUE,t=Math.PI,n=Math.abs,o=Math.sin,i=Math.cos,r=Math.sqrt,a=Math.max,s=Math.min,c=Math.floor,l=Math.pow;const v={antialias:!1,preserveDrawingBuffer:!0},p=2048,x=3/4,d=1920,m=[72,48,24,16,8,36,36],u=[.2,.3,.37,.45,.59,.5,.45],y=[.6,.8,1,.8,1],f="#eae7e1",g="#1f1e1c",b=[f,"#e6d2af","#dedbd0",g],h=[[4,8],[9,13],[14,20]],_=[["#f7f6f1",4,[1],[7,8,9,18,19]],["#001220",1,[0,5,7,10],[6,9,13,14,19]],["#be8156",1,[11,19],[4,5,8,9,15]],["#854d40",1,[],[2,4,5,8,9]],["#6d3334",2,[],[5,7,8,9,10]],["#a9223e",4,[1,12,14],[2,8,9,15,18]],["#cd4e9a",2,[11,12,14,19],[1,7,8,9,14]],["#d8353e",4,[1,11,12,14,17],[8,9,14,15,19]],["#e67347",4,[],[6,7,9,14,15]],["#f0b945",4,[],[0,5,8,16,18]],["#fcf456",1,[1,19],[6,7,11,16,17]],["#419142",1,[2,6,7,19],[0,10,14,16,19]],["#357848",1,[5,6,7],[0,9,14,17,19]],["#36766f",1,[],[5,8,9,17,19]],["#2b5964",2,[5,6,7],[2,6,9,15,16]],["#283061",1,[],[5,7,8,14,19]],["#306cb3",2,[],[9,10,14,15,17]],["#6bc5d9",1,[7],[5,10,16,18,19]],["#7895d5",2,[],[0,5,14,15,17]],["#8d7ac4",4,[2,6,10,11],[1,7,15,16,17]]],S=l(2,-32),w=32557,A=19605,R=new Uint16Array(4),P=new DataView(R.buffer),E=()=>{const e=R[0],t=R[1],n=R[2],o=R[3],i=0|33103+w*e,r=0|63335+w*t+(A*e+(i>>>16)),a=0|31614+w*n+A*t+(62509*e+(r>>>16)),s=5125+w*o+(A*n+62509*t)+(22609*e+(a>>>16));R[0]=i,R[1]=r,R[2]=a,R[3]=s;const c=(o<<21)+((o>>2^n)<<5)+((n>>2^t)>>11);return S*((c>>>(o>>11)|c<<(31&-(o>>11)))>>>0)},I=(e,t=0)=>{const n=16,o=65535,i=255;for(var r,a=1540483477,s=e.length,c=t^s,l=0;4<=s;)r=((r=e[l]&i|(e[++l]&i)<<8|(e[++l]&i)<<16|(e[++l]&i)<<24)&o)*a+(((r>>>n)*a&o)<<n),c=(c&o)*a+(((c>>>n)*a&o)<<n)^(r=((r^=r>>>24)&o)*a+(((r>>>n)*a&o)<<n)),s-=4,++l;switch(s){case 3:c^=(e[l+2]&i)<<n;case 2:c^=(e[l+1]&i)<<8;case 1:c=((c^=e[l]&i)&o)*a+(((c>>>n)*a&o)<<n)}return c=((c^=c>>>13)&o)*a+(((c>>>16)*a&o)<<16),(c^=c>>>15)>>>0},C=e=>{const t=~~((e.length-2)/2),n=[];for(let o=0;o<t;o++){const t=2+2*o;n.push(parseInt(e.slice(t,t+2),16))}const o=I(n,1690382925),i=I(n,72970470);P.setUint32(0,o),P.setUint32(4,i)},B=(e=.5)=>E()<e,T=(e,t)=>(void 0===t&&(t=e,e=0),E()*(t-e)+e),M=(e,t)=>c(T(e,t)),U=(e,t=[])=>e.length?e.filter((e=>{for(let n=0;n<t.length;n++)if(e===t[n])return!1;return!0}))[M(e.length)]:void 0,z=e=>{for(var t,n,o=e.length,i=[...e];o;)t=~~(E()*o--),n=i[o],i[o]=i[t],i[t]=n;return i},V=e=>{var t,n=0;for(t=0;t<e.length;t++)n+=e[t];var o=E()*n;for(t=0;t<e.length;t++){if(o<e[t])return t;o-=e[t]}return 0},F="Mixed",k="Split",L="Dark",O=[["Profile",[["Square",20],["Thick",30],["Skinny",5],["Mixed",25],["Split",20]]],["Scale",[["Tiny",5],["Small",5],["Medium",10],["Large",25],["Huge",35],[F,10],[k,10]]],["Spectrum",[["Narrow",15],["Wide",60],["Full",25]]],["Background",[["Light",15],["Cream",60],["Stone",15],[L,10]]]],D=(e,t=[0,0])=>r((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])),X=e=>{var t=parseInt(e.replace("#",""),16);return[t>>16,255&t>>8,255&t].map((e=>e/255))},N=(e="div")=>document.createElement(e),$=(e,t)=>e.appendChild(t),Y=(e,t,n,o={passive:!0})=>(e.addEventListener(t,n,o),()=>e.removeEventListener(t,n,o)),G=e=>window.requestAnimationFrame(e),W=(e,t)=>{const n=Object.keys(t);for(let o=0;o<n.length;o++)e.style[n[o]]=t[n[o]]};var j={create:(e,t)=>({x:e||0,y:t||0}),clone:e=>({x:e.x,y:e.y}),magnitude:e=>r(e.x*e.x+e.y*e.y),rotate:(e,t,n)=>{var r=i(t),a=o(t);n||(n={});var s=e.x*r-e.y*a;return n.y=e.x*a+e.y*r,n.x=s,n},rotateAbout:(e,t,n,r)=>{var a=i(t),s=o(t);r||(r={});var c=n.x+((e.x-n.x)*a-(e.y-n.y)*s);return r.y=n.y+((e.x-n.x)*s+(e.y-n.y)*a),r.x=c,r},normalise:e=>{var t=j.magnitude(e);return 0===t?{x:0,y:0}:{x:e.x/t,y:e.y/t}},dot:(e,t)=>e.x*t.x+e.y*t.y,cross:(e,t)=>e.x*t.y-e.y*t.x,cross3:(e,t,n)=>(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),add:(e,t,n)=>(n||(n={}),n.x=e.x+t.x,n.y=e.y+t.y,n),sub:(e,t,n)=>(n||(n={}),n.x=e.x-t.x,n.y=e.y-t.y,n),mult:(e,t)=>({x:e.x*t,y:e.y*t}),div:(e,t)=>({x:e.x/t,y:e.y/t}),angle:(e,t)=>Math.atan2(t.y-e.y,t.x-e.x)},q={_bd:1e3/60,_nextId:0,_seed:0};q._now=+new Date,q.extend=function(e,t){var n,o;"boolean"==typeof t?(n=2,o=t):(n=1,o=!0);for(var i,r=n;r<arguments.length;r++)if(i=arguments[r])for(var a in i)o&&i[a]&&i[a].constructor===Object?e[a]&&e[a].constructor!==Object?e[a]=i[a]:(e[a]=e[a]||{},q.extend(e[a],o,i[a])):e[a]=i[a];return e},q.clone=(e,t)=>q.extend({},t,e),q.values=e=>{var t=[];if(Object.keys){for(var n=Object.keys(e),o=0;o<n.length;o++)t.push(e[n[o]]);return t}for(var i in e)t.push(e[i]);return t},q.clamp=(e,t,n)=>e<t?t:e>n?n:e,q.sign=e=>0>e?-1:1,q.now=()=>{if("undefined"!=typeof window&&window.performance){if(window.performance.now)return window.performance.now();if(window.performance.webkitNow)return window.performance.webkitNow()}return Date.now?Date.now():new Date-q._now},q.nextId=()=>q._nextId++,q.indexOf=(e,t)=>{if(e.indexOf)return e.indexOf(t);for(var n=0;n<e.length;n++)if(e[n]===t)return n;return-1};var K=(e,t)=>{if(0!==t)for(var n=i(t),r=o(t),a=0;a<e.length;a++){var s,c=e[a];s=c.x*n-c.y*r,c.y=c.x*r+c.y*n,c.x=s}},H={create:(e,t)=>{for(var n=[],o=0;o<e.length;o++){var i=e[o],r={x:i.x,y:i.y,index:o,body:t,isInternal:!1};n.push(r)}return n},fromPath:(e,t)=>{var n=[];return e.replace(/L?\s*([-\d.e]+)[\s,]*([-\d.e]+)*/gi,((e,t,o)=>{n.push({x:parseFloat(t),y:parseFloat(o)})})),H.create(n,t)},centre:e=>{for(var t,n,o,i=H.area(e,!0),r={x:0,y:0},a=0;a<e.length;a++)o=(a+1)%e.length,t=j.cross(e[a],e[o]),n=j.mult(j.add(e[a],e[o]),t),r=j.add(r,n);return j.div(r,6*i)},mean:e=>{for(var t={x:0,y:0},n=0;n<e.length;n++)t.x+=e[n].x,t.y+=e[n].y;return j.div(t,e.length)},area:(e,t)=>{for(var o=0,i=e.length-1,r=0;r<e.length;r++)o+=(e[i].x-e[r].x)*(e[i].y+e[r].y),i=r;return t?o/2:n(o)/2},inertia:(e,t)=>{for(var o,i,r=0,a=0,s=e,c=0;c<s.length;c++)i=(c+1)%s.length,r+=(o=n(j.cross(s[i],s[c])))*(j.dot(s[i],s[i])+j.dot(s[i],s[c])+j.dot(s[c],s[c])),a+=o;return t/6*(r/a)},translate:(e,t,n)=>{n=void 0===n?1:n;var o,i=e.length,r=t.x*n,a=t.y*n;for(o=0;o<i;o++)e[o].x+=r,e[o].y+=a;return e},rotate:(e,t,n)=>{if(0!==t){var r,a,s,c,l=i(t),v=o(t),p=n.x,x=n.y,d=e.length;for(c=0;c<d;c++)a=(r=e[c]).x-p,s=r.y-x,r.x=p+(a*l-s*v),r.y=x+(a*v+s*l);return e}},contains:(e,t)=>{for(var n,o=t.x,i=t.y,r=e.length,a=e[r-1],s=0;s<r;s++){if(n=e[s],0<(o-a.x)*(n.y-a.y)+(i-a.y)*(a.x-n.x))return!1;a=n}return!0},scale:(e,t,n,o)=>{if(1===t&&1===n)return e;o=o||H.centre(e);for(var i,r,a=0;a<e.length;a++)i=e[a],r=j.sub(i,o),e[a].x=o.x+r.x*t,e[a].y=o.y+r.y*n;return e},clockwiseSort:e=>{var t=H.mean(e);return e.sort(((e,n)=>j.angle(t,e)-j.angle(t,n))),e}},Z={create:e=>{var t={min:{x:0,y:0},max:{x:0,y:0}};return e&&Z.update(t,e),t},update:(e,t,n)=>{e.min.x=1/0,e.max.x=-1/0,e.min.y=1/0,e.max.y=-1/0;for(var o,i=0;i<t.length;i++)(o=t[i]).x>e.max.x&&(e.max.x=o.x),o.x<e.min.x&&(e.min.x=o.x),o.y>e.max.y&&(e.max.y=o.y),o.y<e.min.y&&(e.min.y=o.y);n&&(0<n.x?e.max.x+=n.x:e.min.x+=n.x,0<n.y?e.max.y+=n.y:e.min.y+=n.y)},contains:(e,t)=>t.x>=e.min.x&&t.x<=e.max.x&&t.y>=e.min.y&&t.y<=e.max.y,overlaps:(e,t)=>e.min.x<=t.max.x&&e.max.x>=t.min.x&&e.max.y>=t.min.y&&e.min.y<=t.max.y,translate:(e,t)=>{e.min.x+=t.x,e.max.x+=t.x,e.min.y+=t.y,e.max.y+=t.y},shift:(e,t)=>{var n=e.max.x-e.min.x,o=e.max.y-e.min.y;e.min.x=t.x,e.max.x=t.x+n,e.min.y=t.y,e.max.y=t.y+o}},J={_tc:!0,_is:4,_nid:1,_nnid:-1,_nc:1,_bd:1e3/60,create:e=>{var t={id:q.nextId(),type:"body",parts:[],angle:0,vertices:H.fromPath("L 0 0 L 40 0 L 40 40 L 0 40"),position:{x:0,y:0},force:{x:0,y:0},torque:0,positionIp:{x:0,y:0},constraintIp:{x:0,y:0,angle:0},totalContacts:0,speed:0,angularSpeed:0,vel:{x:0,y:0},angularVel:0,isSensor:!1,isStatic:!1,motion:0,density:.001,restitution:0,friction:.1,frictionStatic:.5,frictionAir:.01,filter:{category:1,mask:4294967295,group:0},slop:.05,timeScale:1,bounds:null,positionPrev:null,anglePrev:0,parent:null,axes:null,area:0,mass:0,inertia:0,deltaTime:1e3/60,_o:null},n=q.extend(t,e);return Q(n,e),n},nextGroup:e=>e?J._nnid--:J._nid++,nextCategory:()=>(J._nc<<=1,J._nc)},Q=(e,t)=>{t=t||{},J.set(e,{bounds:e.bounds||Z.create(e.vertices),positionPrev:e.positionPrev||j.clone(e.position),anglePrev:e.anglePrev||e.angle,vertices:e.vertices,parts:e.parts||[e],isStatic:e.isStatic,parent:e.parent||e}),H.rotate(e.vertices,e.angle,e.position),K(e.axes,e.angle),Z.update(e.bounds,e.vertices,e.vel),J.set(e,{axes:t.axes||e.axes,area:t.area||e.area,mass:t.mass||e.mass,inertia:t.inertia||e.inertia})};J.set=(e,t,n)=>{var o;for(o in"string"==typeof t&&(o=t,(t={})[o]=n),t)Object.prototype.hasOwnProperty.call(t,o)&&(n=t[o],"isStatic"===o?J.setStatic(e,n):"mass"===o?J.setMass(e,n):"density"===o?J.setDensity(e,n):"inertia"===o?J.setInertia(e,n):"vertices"===o?J.setVertices(e,n):"position"===o?J.setPosition(e,n):"angle"===o?J.setAngle(e,n):"vel"===o?J.setVel(e,n):"angularVel"===o?J.setAngularVel(e,n):"speed"===o?J.setSpeed(e,n):"angularSpeed"===o?J.setAngularSpeed(e,n):"parts"===o?J.setParts(e,n):"centre"===o?J.setCentre(e,n):e[o]=n)},J.setStatic=(e,t)=>{for(var n,o=0;o<e.parts.length;o++)n=e.parts[o],t?(!n.isStatic&&(n._o={restitution:n.restitution,friction:n.friction,mass:n.mass,inertia:n.inertia,density:n.density,inverseMass:n.inverseMass,inverseInertia:n.inverseInertia}),n.restitution=0,n.friction=1,n.mass=n.inertia=n.density=1/0,n.inverseMass=n.inverseInertia=0,n.positionPrev.x=n.position.x,n.positionPrev.y=n.position.y,n.anglePrev=n.angle,n.angularVel=0,n.speed=0,n.angularSpeed=0,n.motion=0):n._o&&(n.restitution=n._o.restitution,n.friction=n._o.friction,n.mass=n._o.mass,n.inertia=n._o.inertia,n.density=n._o.density,n.inverseMass=n._o.inverseMass,n.inverseInertia=n._o.inverseInertia,n._o=null),n.isStatic=t},J.setMass=(e,t)=>{var n=e.inertia/(e.mass/6);e.inertia=n*(t/6),e.inverseInertia=1/e.inertia,e.mass=t,e.inverseMass=1/e.mass,e.density=e.mass/e.area},J.setDensity=(e,t)=>{J.setMass(e,t*e.area),e.density=t},J.setInertia=(e,t)=>{e.inertia=t,e.inverseInertia=1/e.inertia},J.setVertices=(e,t)=>{e.vertices=t[0].body===e?t:H.create(t,e),e.axes=(e=>{for(var t={},n=0;n<e.length;n++){var o=(n+1)%e.length,i=j.normalise({x:e[o].y-e[n].y,y:e[n].x-e[o].x}),r=0===i.y?1/0:i.x/i.y;t[r=r.toFixed(3).toString()]=i}return q.values(t)})(e.vertices),e.area=H.area(e.vertices),J.setMass(e,e.density*e.area);var n=H.centre(e.vertices);H.translate(e.vertices,n,-1),J.setInertia(e,J._is*H.inertia(e.vertices,e.mass)),H.translate(e.vertices,e.position),Z.update(e.bounds,e.vertices,e.vel)},J.setParts=(e,t)=>{var n;for(t=t.slice(0),e.parts.length=0,e.parts.push(e),e.parent=e,n=0;n<t.length;n++){var o=t[n];o!==e&&(o.parent=e,e.parts.push(o))}if(1!==e.parts.length){var i=J._totalProperties(e);e.area=i.area,e.parent=e,e.position.x=i.centre.x,e.position.y=i.centre.y,e.positionPrev.x=i.centre.x,e.positionPrev.y=i.centre.y,J.setMass(e,i.mass),J.setInertia(e,i.inertia),J.setPosition(e,i.centre)}},J.setCentre=(e,t,n)=>{n?(e.positionPrev.x+=t.x,e.positionPrev.y+=t.y,e.position.x+=t.x,e.position.y+=t.y):(e.positionPrev.x=t.x-(e.position.x-e.positionPrev.x),e.positionPrev.y=t.y-(e.position.y-e.positionPrev.y),e.position.x=t.x,e.position.y=t.y)},J.setPosition=(e,t,n)=>{var o=j.sub(t,e.position);n?(e.positionPrev.x=e.position.x,e.positionPrev.y=e.position.y,e.vel.x=o.x,e.vel.y=o.y,e.speed=j.magnitude(o)):(e.positionPrev.x+=o.x,e.positionPrev.y+=o.y);for(var i,r=0;r<e.parts.length;r++)(i=e.parts[r]).position.x+=o.x,i.position.y+=o.y,H.translate(i.vertices,o),Z.update(i.bounds,i.vertices,e.vel)},J.setAngle=(e,t,o)=>{var i=t-e.angle;o?(e.anglePrev=e.angle,e.angularVel=i,e.angularSpeed=n(i)):e.anglePrev+=i;for(var r,a=0;a<e.parts.length;a++)(r=e.parts[a]).angle+=i,H.rotate(r.vertices,i,e.position),K(r.axes,i),Z.update(r.bounds,r.vertices,e.vel),0<a&&j.rotateAbout(r.position,i,e.position,r.position)},J.update=(e,t)=>{var n=(t=(void 0===t?1e3/60:t)*e.timeScale)*t,o=J._tc?t/(e.deltaTime||t):1,i=1-e.frictionAir*(t/q._bd),r=(e.position.x-e.positionPrev.x)*o,a=(e.position.y-e.positionPrev.y)*o;e.vel.x=r*i+e.force.x/e.mass*n,e.vel.y=a*i+e.force.y/e.mass*n,e.positionPrev.x=e.position.x,e.positionPrev.y=e.position.y,e.position.x+=e.vel.x,e.position.y+=e.vel.y,e.deltaTime=t,e.angularVel=(e.angle-e.anglePrev)*i*o+e.torque/e.inertia*n,e.anglePrev=e.angle,e.angle+=e.angularVel;for(var s,c=0;c<e.parts.length;c++)s=e.parts[c],H.translate(s.vertices,e.vel),0<c&&(s.position.x+=e.vel.x,s.position.y+=e.vel.y),0!==e.angularVel&&(H.rotate(s.vertices,e.angularVel,e.position),K(s.axes,e.angularVel),0<c&&j.rotateAbout(s.position,e.angularVel,e.position,s.position)),Z.update(s.bounds,s.vertices,e.vel)},J.updateVelocities=e=>{var t=J._bd/e.deltaTime,o=e.vel;o.x=(e.position.x-e.positionPrev.x)*t,o.y=(e.position.y-e.positionPrev.y)*t,e.speed=r(o.x*o.x+o.y*o.y),e.angularVel=(e.angle-e.anglePrev)*t,e.angularSpeed=n(e.angularVel)},J.applyForce=(e,t,n)=>{var o=t.x-e.position.x,i=t.y-e.position.y;e.force.x+=n.x,e.force.y+=n.y,e.torque+=o*n.y-i*n.x},J._totalProperties=e=>{for(var t={mass:0,area:0,inertia:0,centre:{x:0,y:0}},n=1===e.parts.length?0:1;n<e.parts.length;n++){var o=e.parts[n],i=o.mass===1/0?1:o.mass;t.mass+=i,t.area+=o.area,t.inertia+=o.inertia,t.centre=j.add(t.centre,j.mult(o.position,i))}return t.centre=j.div(t.centre,t.mass),t};var ee={rectangle:(e,t,n,o,i)=>{i=i||{};var r={position:{x:e,y:t},vertices:H.fromPath("L 0 0 L "+n+" 0 L "+n+" "+o+" L 0 "+o)};return J.create(q.extend({},r,i))},circle:(e,t,n,o,i)=>{o=o||{};var r=(0,Math.ceil)(a(10,s(i=i||25,n)));return 1==r%2&&(r+=1),ee.polygon(e,t,r,n,q.extend({},o))},polygon:(e,n,r,a,s)=>{if(s=s||{},3>r)return ee.circle(e,n,a,s);for(var c=2*t/r,l="",v=.5*c,p=0;p<r;p+=1){var x=v+p*c,d=i(x)*a,m=o(x)*a;l+="L "+d.toFixed(3)+" "+m.toFixed(3)+" "}var u={position:{x:e,y:n},vertices:H.fromPath(l)};return J.create(q.extend({},u,s))}},te={create:(e,t)=>{var n=e.bodyA,o=e.bodyB,i={id:te.id(n,o),bodyA:n,bodyB:o,collision:e,contacts:[],activeContacts:[],separation:0,isActive:!0,confirmedActive:!0,isSensor:n.isSensor||o.isSensor,timeCreated:t,timeUpdated:t,inverseMass:0,friction:0,frictionStatic:0,restitution:0,slop:0};return te.update(i,e,t),i},update:(e,t,n)=>{var o=e.contacts,i=t.supports,r=e.activeContacts,a=t.parentA,s=t.parentB,c=a.vertices.length;e.isActive=!0,e.timeUpdated=n,e.collision=t,e.separation=t.depth,e.inverseMass=a.inverseMass+s.inverseMass,e.friction=a.friction<s.friction?a.friction:s.friction,e.frictionStatic=a.frictionStatic>s.frictionStatic?a.frictionStatic:s.frictionStatic,e.restitution=a.restitution>s.restitution?a.restitution:s.restitution,e.slop=a.slop>s.slop?a.slop:s.slop,t.pair=e,r.length=0;for(var l=0;l<i.length;l++){var v=i[l],p=v.body===a?v.index:c+v.index,x=o[p];x?r.push(x):r.push(o[p]={vertex:v,normalIp:0,tangentIp:0})}},setActive:(e,t,n)=>{t?(e.isActive=!0,e.timeUpdated=n):(e.isActive=!1,e.activeContacts.length=0)},id:(e,t)=>e.id<t.id?"A"+e.id+"B"+t.id:"A"+t.id+"B"+e.id},ne={},oe=[],ie={overlap:0,axis:null},re={overlap:0,axis:null};ne.create=(e,t)=>({pair:null,collided:!1,bodyA:e,bodyB:t,parentA:e.parent,parentB:t.parent,depth:0,normal:{x:0,y:0},tangent:{x:0,y:0},penetration:{x:0,y:0},supports:[]}),ne.collides=(e,t,n)=>{if(ne._oa(ie,e.vertices,t.vertices,e.axes),0>=ie.overlap)return null;if(ne._oa(re,t.vertices,e.vertices,t.axes),0>=re.overlap)return null;var o,i,r=n&&n.table[te.id(e,t)];r?o=r.collision:((o=ne.create(e,t)).collided=!0,o.bodyA=e.id<t.id?e:t,o.bodyB=e.id<t.id?t:e,o.parentA=o.bodyA.parent,o.parentB=o.bodyB.parent),e=o.bodyA,t=o.bodyB,i=ie.overlap<re.overlap?ie:re;var a=o.normal,s=o.supports,c=i.axis,l=c.x,v=c.y;0>l*(t.position.x-e.position.x)+v*(t.position.y-e.position.y)?(a.x=l,a.y=v):(a.x=-l,a.y=-v),o.tangent.x=-a.y,o.tangent.y=a.x,o.depth=i.overlap,o.penetration.x=a.x*o.depth,o.penetration.y=a.y*o.depth;var p=ne._fs(e,t,a,1),x=0;if(H.contains(e.vertices,p[0])&&(s[x++]=p[0]),H.contains(e.vertices,p[1])&&(s[x++]=p[1]),2>x){var d=ne._fs(t,e,a,-1);H.contains(t.vertices,d[0])&&(s[x++]=d[0]),2>x&&H.contains(t.vertices,d[1])&&(s[x++]=d[1])}return 0==x&&(s[x++]=p[0]),s.length=x,o},ne._oa=(t,n,o,i)=>{var r,a,s,c,l,v,p=n.length,x=o.length,d=n[0].x,m=n[0].y,u=o[0].x,y=o[0].y,f=i.length,g=e,b=0;for(l=0;l<f;l++){var h=i[l],_=h.x,S=h.y,w=d*_+m*S,A=u*_+y*S,R=w,P=A;for(v=1;v<p;v+=1)(c=n[v].x*_+n[v].y*S)>R?R=c:c<w&&(w=c);for(v=1;v<x;v+=1)(c=o[v].x*_+o[v].y*S)>P?P=c:c<A&&(A=c);if((r=(a=R-A)<(s=P-w)?a:s)<g&&(g=r,b=l,0>=r))break}t.axis=i[b],t.overlap=g},ne._pta=(e,t,n)=>{for(var o,i=t[0].x*n.x+t[0].y*n.y,r=i,a=1;a<t.length;a+=1)(o=t[a].x*n.x+t[a].y*n.y)>r?r=o:o<i&&(i=o);e.min=i,e.max=r},ne._fs=(t,n,o,i)=>{var r,a,s,c,l,v=n.vertices,p=v.length,x=t.position.x,d=t.position.y,m=o.x*i,u=o.y*i,y=e;for(l=0;l<p;l+=1)(c=m*(x-(a=v[l]).x)+u*(d-a.y))<y&&(y=c,r=a);return y=m*(x-(s=v[(p+r.index-1)%p]).x)+u*(d-s.y),m*(x-(a=v[(r.index+1)%p]).x)+u*(d-a.y)<y?(oe[0]=r,oe[1]=a,oe):(oe[0]=r,oe[1]=s,oe)};var ae={create:e=>q.extend({id:q.nextId(),type:"composite",parent:null,isModified:!1,bodies:[],constraints:[],composites:[],cache:{allBodies:null,allConstraints:null,allComposites:null}},e),setModified:(e,t,n,o)=>{if(e.isModified=t,t&&e.cache&&(e.cache.allBodies=null,e.cache.allConstraints=null,e.cache.allComposites=null),n&&e.parent&&ae.setModified(e.parent,t,n,o),o)for(var i,r=0;r<e.composites.length;r++)i=e.composites[r],ae.setModified(i,t,n,o)},add:(e,t)=>{for(var n,o=[].concat(t),i=0;i<o.length;i++)switch(n=o[i],n.type){case"body":if(n.parent!==n)break;ae.addBody(e,n);break;case"constraint":ae.addConstraint(e,n);break;case"composite":ae.addComposite(e,n);break;case"mouseConstraint":ae.addConstraint(e,n.constraint)}return e},remove:(e,t,n)=>{for(var o,i=[].concat(t),r=0;r<i.length;r++)switch(o=i[r],o.type){case"body":ae.removeBody(e,o,n);break;case"constraint":ae.removeConstraint(e,o,n);break;case"composite":ae.removeComposite(e,o,n);break;case"mouseConstraint":ae.removeConstraint(e,o.constraint)}return e},addComposite:(e,t)=>(e.composites.push(t),t.parent=e,ae.setModified(e,!0,!0,!1),e),removeComposite:(e,t,n)=>{var o=q.indexOf(e.composites,t);if(-1!==o&&ae.removeCompositeAt(e,o),n)for(var i=0;i<e.composites.length;i++)ae.removeComposite(e.composites[i],t,!0);return e},removeCompositeAt:(e,t)=>(e.composites.splice(t,1),ae.setModified(e,!0,!0,!1),e),addBody:(e,t)=>(e.bodies.push(t),ae.setModified(e,!0,!0,!1),e),removeBody:(e,t,n)=>{var o=q.indexOf(e.bodies,t);if(-1!==o&&ae.removeBodyAt(e,o),n)for(var i=0;i<e.composites.length;i++)ae.removeBody(e.composites[i],t,!0);return e},removeBodyAt:(e,t)=>(e.bodies.splice(t,1),ae.setModified(e,!0,!0,!1),e),addConstraint:(e,t)=>(e.constraints.push(t),ae.setModified(e,!0,!0,!1),e),removeConstraint:(e,t,n)=>{var o=q.indexOf(e.constraints,t);if(-1!==o&&ae.removeConstraintAt(e,o),n)for(var i=0;i<e.composites.length;i++)ae.removeConstraint(e.composites[i],t,!0);return e},removeConstraintAt:(e,t)=>(e.constraints.splice(t,1),ae.setModified(e,!0,!0,!1),e),allBodies:e=>{if(e.cache&&e.cache.allBodies)return e.cache.allBodies;for(var t=[].concat(e.bodies),n=0;n<e.composites.length;n++)t=t.concat(ae.allBodies(e.composites[n]));return e.cache&&(e.cache.allBodies=t),t},allConstraints:e=>{if(e.cache&&e.cache.allConstraints)return e.cache.allConstraints;for(var t=[].concat(e.constraints),n=0;n<e.composites.length;n++)t=t.concat(ae.allConstraints(e.composites[n]));return e.cache&&(e.cache.allConstraints=t),t}},se={_w:.4,_td:1,_ml:1e-6,create:e=>{var t=e;t.bodyA&&!t.pointA&&(t.pointA={x:0,y:0}),t.bodyB&&!t.pointB&&(t.pointB={x:0,y:0});var n=t.bodyA?j.add(t.bodyA.position,t.pointA):t.pointA,o=t.bodyB?j.add(t.bodyB.position,t.pointB):t.pointB,i=j.magnitude(j.sub(n,o));return t.length=void 0===t.length?i:t.length,t.id=t.id||q.nextId(),t.label=t.label||"Constraint",t.type="constraint",t.stiffness=t.stiffness||(0<t.length?1:.7),t.damping=t.damping||0,t.angularStiffness=t.angularStiffness||0,t.angleA=t.bodyA?t.bodyA.angle:t.angleA,t.angleB=t.bodyB?t.bodyB.angle:t.angleB,t},preSolveAll:e=>{for(var t=0;t<e.length;t+=1){var n=e[t],o=n.constraintIp;n.isStatic||0===o.x&&0===o.y&&0===o.angle||(n.position.x+=o.x,n.position.y+=o.y,n.angle+=o.angle)}},solveAll:(e,t)=>{for(var n=q.clamp(t/q._bd,0,1),o=0;o<e.length;o+=1){var i=e[o],r=!i.bodyA||i.bodyA&&i.bodyA.isStatic,a=!i.bodyB||i.bodyB&&i.bodyB.isStatic;(r||a)&&se.solve(e[o],n)}for(o=0;o<e.length;o+=1)r=!(i=e[o]).bodyA|
_Balance_ is a generative collaboration between Kelly Milligan and Amber Vittoria. This series nods to the ever-changing composition of harmony by leveraging Milligan's movement through code and Vittoria's colorful play on equilibrium. Even though the composition is set upon mint, the collector can temporarily change the composition of the piece, further speaking to the idea of balance constantly moving. Over the course of 2023, Milligan and Vittoria chatted about color, theory, and how to translate Vittoria's painted palette on screen in a textural way. The theme of balance is seen overtly in the composition, but also subtly in the use of gradients and color relationships, creating tension and stability. Every decision in this collection builds to the idea of finding, and changing, one's footing in life.
The exploitation of natural resources presents an inherent imbalance. While profits stack up, the true costs distribute. _StackSlash_ utilizes a 2D rigid-body physics engine for composition. Rectangular bodies are placed within a scene and the forces of gravity and collision guide them into a stable resting state. The rendering of the system occurs in two parts: While interacting, the bodies are rendered in a 2D canvas to allow fluid manipulation. Once the system arrives in a stable configuration, a heavier WebGL rendering step creates and applies surface textures to the bodies. The system is fully responsive and can extend to any viewport size upon interaction. The composition is initially presented in its default 3:4 deterministic state.
turn vec2(cr*(st.x)+sr*(st.y)+.5,cr*(st.y)-sr*(st.x)+.5);}\nfloat rand(vec2 st){return fract(sin(dot(st,vec2(12.9898,78.233)))*43758.5453);}\nvec2 gO(vec3 bdP){\nvec2 pos=bdP.xy/uVp.xy;\npos.y=(1.-pos.y)/uVp.z;\nreturn pos;\n}\nfloat rect(vec2 st,vec3 bdP,vec2 bdS){\nfloat x=(1.-bdS.x/max(uVp.z,1.)/(1./uB))/2.; \nfloat y=(1.-bdS.y/max(uVp.z,1.)/(1./uB))/2.;\nst=rUV(st-gO(bdP),PI-bdP.z);\nvec2 bl=smoothstep(vec2(x-F,y-F),vec2(x+F,y+F),st);\nvec2 tr=smoothstep(vec2(x-F,y-F),vec2(x+F,y+F),1.-st);\nreturn bl.x*bl.y*tr.x*tr.y;\n}\nvec2 tU(vec2 st,vec3 bdP,vec2 bdS,int i){\nreturn rUV((st-gO(bdP))*(1./uB)*max(uVp.z, 1.),PI*.5-bdP.z)*vec2(1.,1./uBr)*vec2(1./uTl,1.)+vec2(.5*max(1.-uTl,0.)+(1./uTl)*floor(float(i/8)),0.); \n}\nfloat tM(int i,int offset){return step(float(i+offset&7),0.);}\nvoid main(){\nvec2 uv=vUv;\nuv.y/=uVp.z;\nvec4 b=vec4(31./255.,30./255.,28./255.,1.);\nvec4 w=vec4(249./255.,241./255.,234./255.,1.);\nvec4 c=mix(w,b,uI);\nfor (int i=0;i<COUNT;i++){\nvec3 bdP=uBdP[i];\nvec2 bdS=uBdS[i];\nfloat r=rect(uv,bdP,bdS);\nc = max(c-r,0.);\nc+=r*tM(i,0)*texture(uTx[0],tU(uv,bdP,bdS,i));\nc+=r*tM(i,1)*texture(uTx[1],tU(uv,bdP,bdS,i));\nc+=r*tM(i,2)*texture(uTx[2],tU(uv,bdP,bdS,i));\nc+=r*tM(i,3)*texture(uTx[3],tU(uv,bdP,bdS,i));\nc+=r*tM(i,4)*texture(uTx[4],tU(uv,bdP,bdS,i));\nc+=r*tM(i,5)*texture(uTx[5],tU(uv,bdP,bdS,i));\nc+=r*tM(i,6)*texture(uTx[6],tU(uv,bdP,bdS,i));\nc+=r*tM(i,7)*texture(uTx[7],tU(uv,bdP,bdS,i));\n}\nc=clamp(c,b,w)+.18*max(c-w,0.);\nc+=(rand(uv*10.)*2.-1.)*.025;\nfc=c;\n}\n`,u),_=tt(h,et,"#version 300 es\nprecision highp float;\n#define PI 3.1415926535\nin vec2 vUv;\nuniform vec2 uS;\nuniform vec3 uVp,uSu;\nuniform vec4 uCl;\nuniform float uT,uZ,uA,uM,uC,uTn,uTl,uI;\nout vec4 fc;\nmat2 r2d(float t){return mat2(cos(t),sin(t),-sin(t),cos(t));}\n// Noise, Copyright (C) 2011 Ian McEwan, Ashima Arts, MIT License\nfloat rand(vec2 st){return fract(sin(dot(st,vec2(12.9898,78.233)))*43758.5453);}\nvec3 mod289(vec3 x){return x-floor(x*(1./289.))*289.;}vec2 mod289(vec2 x){return x-floor(x*(1./289.))*289.;}vec3 permute(vec3 x){return mod289(((x*34.)+1.)*x);}float noise(vec2 v){const vec4 C=vec4(.211324865405187,.366025403784439,-.577350269189626,.024390243902439);vec2 i=floor(v+dot(v,C.yy));vec2 x0=v-i+dot(i,C.xx);vec2 i1;i1=(x0.x>x0.y)?vec2(1.,0.):vec2(0.,1.);vec4 x12=x0.xyxy+C.xxzz;x12.xy-=i1;i=mod289(i);vec3 p=permute(permute(i.y+vec3(0.,i1.y,1.))+i.x+vec3(0.,i1.x,1.));vec3 m=max(.5-vec3(dot(x0,x0),dot(x12.xy,x12.xy),dot(x12.zw,x12.zw)),0.);m=m*m;m=m*m;vec3 x=2.*fract(p*C.www)-1.;vec3 h=abs(x)-.5;vec3 ox=floor(x+.5);vec3 a0=x-ox;m*=1.79284291400159-.85373472095314*(a0*a0+h*h);vec3 g;g.x=a0.x*x0.x+h.x*x0.y;g.yz=a0.yz*x12.xz+h.yz*x12.yw;return 130.*dot(m,g);}\n#define O 6\nfloat fbm(vec2 uv){\nfloat v=0.,a=.16+.04*uA;\nmat2 rot=mat2(cos(.5),sin(.5),-sin(.5),cos(.5));\nfor(int i=0;i<O;++i){\nv+=a*noise(uv+(uS*2.-1.));\nuv=rot*uv*-2.;a*=.46+.04*uM;\n}\nreturn v;\n}\nfloat frm(vec2 p,float s){return fbm(p+fbm(p+fbm(p+fbm(p+fbm(p+fbm(p+fbm(p+fbm(p+fbm(p+fbm(p*s))))))))));}\nvoid main(){\nvec2 uv=vUv;\nuv.x+=10.*sin(uT*.00001);\nuv.x*=uTl;\nuv*=r2d(PI*-.5);\nvec3 c=vec3(uTn);\nfloat rib=sin((uv.x+uSu.z)*uSu.x+uv.y*uSu.y)*.5+.5;\nuv+=vec2(rib,uv.y+.33*uv.x)*.2;\nc.rgb+=pow(rib,1.5)*.18;\nfloat zoom=.5+.5*uZ;\nc+=(1.3+.2*uC+1.5*uI)*frm(uv,zoom);\nc*=1.-.6*uI;\nc+=2.*vec3(.6,.3+.5*pow(uCl.g,3.)*uCl.a,.15+.5*pow(uCl.b,3.)*uCl.a)*frm(uv*.17,zoom*.88);\nc+=2.*vec3(.6+.4*pow(uCl.r,3.)*uCl.a,.4,.2)*frm(uv*.66,zoom*1.93);\nc+=(rand(uv*10.)*2.-1.)*.025;\nfc=vec4(c,1.);\n}\n",u);let I=!1,T=!1,M=!1,U=!1,R=!1,L=!1,D=!1;const k=Ct[7][1]===wt;let F,O,V,z,X,N,Y,G,W,$=0,J=0,Q=0,nt=[[0,0],[0,0],[0,0]];const at=[];for(let t=0;8>t;t++)at.push([...w(.05)?[0,0,0]:w(.05)?[1,1,1]:[B(.2,1),B(.2,1),B(.2,1)],(ot=Ct[4][1],ot===ft?B(0,.25):ot===yt?B(.25,.5):ot===mt?B(.6,.75):ot===ht?B(.85,.95):B(.05,1))]);var ot;const st=(t=>{for(var e,r,n=t.length,a=[...t];n;)e=~~(A()*n--),r=a[n],a[n]=a[e],a[e]=r;return a})(x).slice(0,2),it=t=>{const e=[x[0],0,0];return t===ct?(e[0]=x[1],e[2]=.28):t===pt?e[0]=x[2]:t===xt?e[0]=x[3]:t===ut?e[0]=x[4]:t===vt?e[0]=x[0]+(x[~~(A()*x.length)]-x[0]):t===dt&&(e[0]=st[w()?0:1]),e},lt=at.map((([t,e,r,n])=>[["uS","v2",[B(1,2),B(1,2)]],["uZ","f",A()],["uA","f",A()],["uM","f",A()],["uC","f",A()],["uTn","f",n],["uCl","v4",[t,e,r,Ct[4][1]===bt?1:0]],["uSu","v3",it(Ct[3][1])],["uTl","f",P.config[2]],["uI","f",k?1:0]])),Bt=[],_t=t=>{j.ud(S,t[0]||1e3/120),P.frame(t,L),J++},It=()=>{U=!1},Tt=t=>t.__size,Mt=t=>[t.pos.x*G[0],t.pos.y*G[1],t.a],Ut=()=>{zt(!0),U=!0,c((()=>{(t=>{const e=Y[2]*P.config[1]*P.config[2],r=.2*e;_.resize(e,r,e/2,r/2);let n=0;const a=()=>{n++,n===Bt.length&&c(t)};lt.forEach(((t,e)=>{_.frame([W,$],t),Bt[e]=new Image,Bt[e].onload=a,Bt[e].src=h.toDataURL()}))})((()=>{C.frame([W,$],[["uB","f",P.config[1]],["uBr","f",.2],["uBdS","v2[]",Float32Array.from(P.bodies().flatMap(Tt))],["uBdP","v3[]",Float32Array.from(P.bodies().flatMap(Mt))],["uTx","t[]",Bt,"REPEAT","LINEAR"],["uTl","f",P.config[2]],["uI","f",k?1:0]]),E.clear(),zt(!1)}))}))},Rt=()=>{F=t.innerWidth,V=t.innerHeight,(M||F!==O||V!==z)&&(O=F,z=V,X=F/V,!M&&(X>=l?F=~~(V*l):V=~~(F/l),X=l),N=s(t.devicePixelRatio,2),Y=[F,V,F*N,V*N,X,N],f(p,{width:`${F}px`,height:`${V}px`}),P.resize(Y),G=[Y[2]/P.size()[0],Y[3]/P.size()[1]],E.resize(Y[2],Y[3],Y[0],Y[1]),C.resize(Y[2],Y[3],Y[0],Y[1]),It())},Lt=()=>{const t=performance.now();W=s(t-Q,1e3/30),Q=t,$+=W,U||(_t([W,$,J]),R=P.resting(),R&&!L?!D&&(Ut(),D=!0):(E.frame(Y[2],Y[3],G,P.bodies(),k),D=!1)),c(Lt)},Dt=({clientX:t,clientY:e},r,n)=>{nt[0]=[t/Y[0],e/Y[1]],r&&(nt[1]=nt[0],L=!0,M||(M=!0,Rt()),It()),nt[2]=[nt[0][0]-nt[1][0],nt[0][1]-nt[1][1]],n&&(((t,e=[0,0])=>{o((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))})(nt[2]),L=!1)},kt=t=>Dt(t,!0),Ft=t=>Dt(t),Ot=t=>Dt(t,!1,!0);i(t,"resize",Rt),i(t,"keydown",(t=>{" "===t.key.toLowerCase()&&((t=>{t.preventDefault()})(t),U=!U)})),i(t,"keyup",(t=>{const e=t.key.toLowerCase();"r"===e&&Ut(),"s"===e&&(async(t,e)=>{(async(t,e)=>{const r=document,n=window.URL.createObjectURL(t),a=r.body.appendChild(r.createElement("a"));a.href=n,a.download=e,a.click(),r.body.removeChild(a),window.URL.revokeObjectURL(n)})((t=>{let e=window.atob(t.split(",")[1]),r=new ArrayBuffer(e.length),n=new Uint8Array(r);for(let t=0;t<e.length;t++)n[t]=e.charCodeAt(t);return new Blob([new DataView(r)],{type:t.split(",")[0].split(":")[1].split(";")[0]})})(t),e)})(y.toDataURL("image/png"),`stackslash-${Date.now()}-${Et}.png`),"`"===e&&Vt(!I)})),i(p,"mousedown",kt),i(e,"mousemove",Ft),i(e,"mouseup",Ot),i(p,"touchstart",(t=>{t.clientX=t.touches[0].clientX,t.clientY=t.touches[0].clientY,kt(t)})),i(e,"touchmove",(t=>{t.clientX=t.touches[0].clientX,t.clientY=t.touches[0].clientY,Ft(t)})),i(e,"touchend",(t=>{t.clientX=t.changedTouches[0].clientX,t.clientY=t.changedTouches[0].clientY,Ot(t)})),f(r,{touchAction:"none",margin:0,display:"flex",alignItems:"center",background:d}),f(p,{position:"relative",margin:"0 auto"}),f(m,{pointerEvents:"none",position:"absolute",inset:0}),f(y,{background:k?d:v}),f(h,{pointerEvents:"none",position:"absolute",right:0,bottom:0}),f(b,{position:"absolute",inset:0,background:"rgba(31, 30, 28, 0.2)"}),f(g,{position:"absolute",inset:"50%",width:"20px",height:"80px",margin:"-40px 0 0 -10px",background:v,animation:"3s linear infinite spin"}),a(e.head,n("style")).innerHTML="@keyframes spin{from{transform:none}to{transform:rotate(360deg)}}";const Vt=t=>{I=t,f(h,{display:I?"block":"none"})},zt=t=>{T=t,f(b,{display:T?"block":"none"})};Vt(!1),Rt(),(()=>{for(let t=0;t<1800;t++)_t([0,0,J]);Ut()})(),c(Lt)})()})();
.t=0},_bdAG:(t,e)=>{var r=void 0===e.scl?.001:e.scl;if((0!==e.x||0!==e.y)&&0!==r)for(var n,a=0;a<t.length;a++)(n=t[a]).iSt||(n.f.y+=n.m*e.y*r,n.f.x+=n.m*e.x*r)},_bdU:(t,e,r,n)=>{for(var a,o=0;o<t.length;o++)(a=t[o]).iSt||M.ud(a,e,r,n)}},W={cr:t=>{var e={};return e.el=t||document.body,e.abs={x:0,y:0},e.pos={x:0,y:0},e.md={x:0,y:0},e.mu={x:0,y:0},e.offset={x:0,y:0},e.scl={x:1,y:1},e.button=-1,e.pixelRatio=parseInt(e.el.getAttribute("data-pixel-ratio"),10)||1,e.sourceEvents={mousemove:null,mousedown:null,mouseup:null},e.mousemove=t=>{var r=W._gRlM(t,e.el,e.pixelRatio);t.changedTouches&&(e.button=0,t.preventDefault()),e.abs.x=r.x,e.abs.y=r.y,e.pos.x=e.abs.x*e.scl.x+e.offset.x,e.pos.y=e.abs.y*e.scl.y+e.offset.y,e.sourceEvents.mousemove=t},e.mousedown=t=>{var r=W._gRlM(t,e.el,e.pixelRatio);t.changedTouches?(e.button=0,t.preventDefault()):e.button=t.button,e.abs.x=r.x,e.abs.y=r.y,e.pos.x=e.abs.x*e.scl.x+e.offset.x,e.pos.y=e.abs.y*e.scl.y+e.offset.y,e.md.x=e.pos.x,e.md.y=e.pos.y,e.sourceEvents.mousedown=t},e.mouseup=t=>{var r=W._gRlM(t,e.el,e.pixelRatio);t.changedTouches&&t.preventDefault(),e.button=-1,e.abs.x=r.x,e.abs.y=r.y,e.pos.x=e.abs.x*e.scl.x+e.offset.x,e.pos.y=e.abs.y*e.scl.y+e.offset.y,e.mu.x=e.pos.x,e.mu.y=e.pos.y,e.sourceEvents.mouseup=t},W.sEl(e,e.el),e},sEl:(t,e)=>{t.el=e,e.addEventListener("mousedown",t.mousedown),document.addEventListener("mousemove",t.mousemove),document.addEventListener("mouseup",t.mouseup),e.addEventListener("touchstart",t.mousedown),document.addEventListener("touchmove",t.mousemove),document.addEventListener("touchend",t.mouseup)},clSrcE:t=>{t.sourceEvents.mousemove=null,t.sourceEvents.mousedown=null,t.sourceEvents.mouseup=null},sO:(t,e)=>{t.offset.x=e.x,t.offset.y=e.y,t.pos.x=t.abs.x*t.scl.x+t.offset.x,t.pos.y=t.abs.y*t.scl.y+t.offset.y},sScl:(t,e)=>{t.scl.x=e.x,t.scl.y=e.y,t.pos.x=t.abs.x*t.scl.x+t.offset.x,t.pos.y=t.abs.y*t.scl.y+t.offset.y},_gRlM:(t,e,r)=>{var n,a,o=e.getBoundingClientRect(),s=document.documentElement||document.body.prNode||document.body,i=void 0===window.pageXOffset?s.scrollLeft:window.pageXOffset,l=void 0===window.pageYOffset?s.scrollTop:window.pageYOffset,c=t.changedTouches;return c?(n=c[0].pageX-o.left-i,a=c[0].pageY-o.top-l):(n=t.pageX-o.left-i,a=t.pageY-o.top-l),{x:n/(e.clientWidth/(e.width||e.clientWidth)*r),y:a/(e.clientHeight/(e.height||e.clientHeight)*r)}}},$={cr:(t,e)=>{var r=(t?t.mouse:null)||(e?e.mouse:null);r||(r=t&&t.render&&t.render.canvas?W.cr(t.render.canvas):e&&e.el?W.cr(e.el):W.cr());var n={type:"mouseConstraint",mouse:r,el:null,body:null,constraint:N.cr({l:"Mouse Constraint",ptA:r.pos,ptB:{x:0,y:0},length:.01,st:.1,aSt:1}),cF:{category:1,mask:4294967295,group:0}},a=C.xt(n,e);return((t,e,r)=>{for(var n,a=e.split(" "),o=0;o<a.length;o++)n=a[o],t.events=t.events||{},t.events[n]=t.events[n]||[],t.events[n].push(r)})(t,"beforeUpdate",(()=>{var e=X.allBd(t.world);$.ud(a,e),$._tE(a)})),a},ud:(t,e)=>{var r=t.mouse,n=t.constraint,a=t.body;if(0!==r.button)n.bdB=t.body=null,n.ptB=null,a&&z(t,"enddrag",{mouse:r,body:a});else if(n.bdB)n.ptA=r.pos;else for(var o=0;o<e.length;o++)if(a=e[o],T.cont(a.b,r.pos)&&Y.cCol(a.cF,t.cF))for(var s,i=1<a.pt.length?1:0;i<a.pt.length;i++)if(s=a.pt[i],I.cont(s.vt,r.pos)){n.ptA=r.pos,n.bdB=t.body=a,n.ptB={x:r.pos.x-a.pos.x,y:r.pos.y-a.pos.y},n.aB=a.a,z(t,"startdrag",{mouse:r,body:a});break}},_tE:t=>{var e=t.mouse,r=e.sourceEvents;r.mousemove&&z(t,"mousemove",{mouse:e}),r.mousedown&&z(t,"mousedown",{mouse:e}),r.mouseup&&z(t,"mouseup",{mouse:e}),W.clSrcE(e)}};const H=(t,e,r,n,a)=>{t.width=e,t.height=r,f(t,{width:`${n}px`,height:`${a}px`})},q=(t,e)=>{t.save(),e(),t.restore()},K=(t,e,r=[1,1])=>{t.moveTo(e[0].x*r[0],e[0].y*r[1]);for(let n=1,a=e.length;n<a;n++)t.lineTo(e[n].x*r[0],e[n].y*r[1])},Z=t=>t.clearRect(0,0,t.canvas.width,t.canvas.height);const J=(t,e,r)=>{const n=t.createShader(e);return t.shaderSource(n,r),t.compileShader(n),t.getShaderParameter(n,t.COMPILE_STATUS)?n:void t.deleteShader(n)},Q=(t,e,r=0,n=t.CLAMP_TO_EDGE,a=t.NEAREST)=>{const o=t.createTexture();return t.activeTexture(t.TEXTURE0+r),t.bindTexture(t.TEXTURE_2D,o),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,n),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,n),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,a),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,a),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e),o};var tt=(t,e,r,n)=>{const a=t.getContext("webgl2",n);a.drawingBufferColorSpace="display-p3",a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!0);const o=((t,e,r)=>{const n=t.createProgram();return t.attachShader(n,e),t.attachShader(n,r),t.linkProgram(n),t.getProgramParameter(n,t.LINK_STATUS)?n:void t.deleteProgram(n)})(a,J(a,a.VERTEX_SHADER,e),J(a,a.FRAGMENT_SHADER,r)),s=a.getAttribLocation(o,"aPos"),i=a.createBuffer();a.bindBuffer(a.ARRAY_BUFFER,i),a.bufferData(a.ARRAY_BUFFER,new Float32Array([-1,-1,-1,3,3,-1]),a.STATIC_DRAW);const l=a.createVertexArray();a.bindVertexArray(l),a.enableVertexAttribArray(s),a.bindBuffer(a.ARRAY_BUFFER,i),a.vertexAttribPointer(s,2,a.FLOAT,!1,0,0),a.bindVertexArray(null);const c=[];let p,x=()=>{},u=()=>{};const v=()=>a.clear(a.COLOR_BUFFER_BIT);return{resize:(...e)=>x=((e,r,n,a)=>(x(),H(t,e,r,n||e,a||r),p=[e,r,e/r],v(),()=>{}))(...e),frame:(...t)=>u=((t,e)=>{u(),a.viewport(0,0,p[0],p[1]),a.clearColor(0,0,0,0),a.clear(a.COLOR_BUFFER_BIT),a.useProgram(o),a.bindVertexArray(l);let r=0;return[["uVp","v3",p],["uT","f",t[1]],...e.map((t=>("t"===t[1]&&(c[t[0]]=[Q(a,t[2],r,a[t[3]],a[t[4]]),r++]),"t[]"===t[1]&&(c[t[0]]=[[],[]],t[2].forEach((e=>{c[t[0]][0].push(Q(a,e,r,a[t[3]],a[t[4]])),c[t[0]][1].push(r++)}))),t)))].forEach((([t,e,r])=>((t,[e,r,n,a])=>{"b"===e?t.uniform1i(n,!0===r?1:0):"i"===e?t.uniform1i(n,r):"i[]"===e?t.uniform1iv(n,r):"f"===e?t.uniform1f(n,r):"f[]"===e?t.uniform1fv(n,r):"v2"===e?t.uniform2f(n,...r):"v2[]"===e?t.uniform2fv(n,r):"v3"===e?t.uniform3f(n,...r):"v3[]"===e?t.uniform3fv(n,r):"v4"===e?t.uniform4f(n,...r):"v4[]"===e?t.uniform4fv(n,r):"t"===e?t.uniform1i(n,a):"t[]"===e&&t.uniform1iv(n,a)})(a,[e,"t"===e||"t[]"===e?c[t][0]:r,a.getUniformLocation(o,t),"t"===e||"t[]"===e?c[t][1]:-1]))),a.drawArrays(a.TRIANGLES,0,3),()=>{}})(...t),clear:v}};const et="#version 300 es\nin vec2 aPos;\nout vec2 vUv;\nvoid main(){gl_Position=vec4(aPos*2.-1.,0.,1.);vUv=aPos;}\n",rt={FEW:"Few",SOME:"Some",MANY:"Many",LOADED:"Loaded",GREEDY:"Greedy"},nt="Full",at="Uniform",ot="Split",st="Full",it="Uniform",lt="Split",ct="Crystal",pt="Ribbed",xt="Knurly",ut="Lenticular",vt="Mixed",dt="Split",ft="Dark",yt="Amber",mt="Bright",ht="Crystal",bt="Colour",gt="None",At="Left",St="Right",wt="Dark",Bt=[["Count",[[rt.FEW,40],[rt.SOME,40],[rt.MANY,10],[rt.LOADED,7],[rt.GREEDY,3]]],["Lengths",[["Mixed",50],[nt,30],[at,10],[ot,10]]],["Breadths",[[st,80],[it,5],["Mixed",5],[lt,10]]],["Surfaces",[["Squared",40],[ct,20],[pt,5],[xt,5],[ut,5],[vt,15],[dt,10]]],["Tint",[["Mixed",20],[ft,10],[yt,5],[mt,20],[ht,5],[bt,40]]],["Side",[["None",90],[At,5],[St,5]]],["Gravity",[["Down",70],[gt,25],["Up",5]]],["Base",[["Light",60],[wt,40]]]];var Pt=(t,e,r)=>{const n=(t=>{const e=Object.values(rt).indexOf(t),r=0<e?((t,e,r)=>Math.max(s(t,4),2))(e*e):1;return[c[e],p[e],r]})(r[0][1]),[a,o]=n,l=()=>X.allBd(t.world).filter((t=>!t.iSt));let x,u,v,d,f,y,m,h,b=[i,i],g=[],S=[],P=[],C=[],_=!1,I=0,T=()=>{};let U=()=>{};return{config:n,resize:(...n)=>T=(n=>{T(),_=!1,I=0;const l=!!S.length;x=n[4],v=1<=x,d=i*(v?x:1),f=d/2,y=i/(v?1:x),m=y/2,h=.1*s(d,y);const c=x>u?1:-1;u=x,b=[d,y];const p=(t=0,e=0,r,n)=>R(t,e,r,n,{iSt:!0,fr:0});g=[p(-f+h,m,d,4*y),p(d+f-h,m,d,4*y),p(f,-m+h,2*d,y),p(f,y+m-h,2*d,y)],X.add(t.world,g);const U=B(.75,.9),L=B(.75,.9),D=t=>{var e=Math.PI;const n=s(...b)*o,a=l?C[t][1]:(u=r[1][1])===nt?1:u===at?U:u===ot?w()?.4:1:B(.33,1),i=l?C[t][0]:.2*(t=>t===st?1:t===it?L:t===lt?w()?B(.75,.8):B(.95,1):B(.75,1))(r[2][1]),p=l?[S[t][0]*d,S[t][1]*y]:[B(0,d),B(0,y)],x=R(...p,n*i,n*a,{r:.2,fr:.2,a:l?P[t]:A()*e*2});var u;return x.__index=t,x.__size=[i,a],l&&M.af(x,x.pos,E.cr(0,-(0<c?.02:.005)*x.m*B(.5,1))),x},k=[];for(let t=0;t<a;t++)k.push(D(t));X.add(t.world,k);const F=W.cr(e),O=$.cr(t,{mouse:F,constraint:{st:.05,da:.9}});return W.sScl(F,E.cr(d/n[0],y/n[1])),X.add(t.world,O),()=>{S=k.map((t=>[t.pos.x/d,t.pos.y/y])),P=k.map((t=>t.a)),C=k.map((t=>t.__size)),X.rm(t.world,[...g,...k,O])}})(...n),frame:(...t)=>U=((t,e)=>{U();const r=l();_=!0,I=e?0:I+t[0],I<=1e3&&(_=!1);for(let e=0,n=r.length;e<n;e++){const n=r[e];if(n.s>.5){_=!1,I=0;break}t[2]<450&&M.af(n,n.pos,E.cr(.03*d*B(-1,1),.03*d*B(-1,1)))}return()=>{}})(...t),size:()=>[...b],bodies:l,resting:()=>_}};const Et="undefined"==typeof tokenData?(()=>{let t="0x";for(let e=64;0<e;--e)t+="0123456789abcdef"[~~(16*Math.random())];return t})():"string"==typeof tokenData?tokenData:tokenData.hash;(t=>{const e=~~((t.length-2)/2),r=[];for(let n=0;n<e;n++){const e=2+2*n;r.push(parseInt(t.slice(e,e+2),16))}const n=S(r,1690382925),a=S(r,72970470);g.setUint32(0,n),g.setUint32(4,a)})(Et);const Ct=Bt.map((t=>{const e=t[1].map((t=>t[1]));return[t[0],t[1][P(e)][0]]}));console.log(`${Et}\n`,...Ct.map((t=>`\n${t[0]}: ${t[1]}`))),(()=>{const t=window,e=document,r=e.body,n=(t="canvas")=>e.createElement(t),a=(t,e)=>t.appendChild(e),i=(t,e,r)=>t.addEventListener(e,r),c=e=>t.requestAnimationFrame(e),p=a(r,n("main")),y=a(p,n()),m=a(p,n()),h=a(r,n()),b=a(r,n("div")),g=a(b,n("div")),S=j.cr({gravity:((t,e,r)=>{const n=r===rt.GREEDY?.2:r===rt.LOADED?.33:1;return{x:n*(t===At?-1:t===St?1:0),y:n*(e===gt?0:"Up"===e?-1:1)}})(Ct[5][1],Ct[6][1],Ct[0][1])}),P=Pt(S,p,Ct),E=(t=>{const e=t.getContext("2d");let r=()=>{},n=()=>{};return{resize:(...e)=>r=((e,n,a,o)=>(r(),H(t,e,n,a,o),()=>{}))(...e),frame:(...t)=>n=((t,r,a,o,s)=>{n(),Z(e),q(e,(()=>{e.fillStyle=s?d:v,e.globalAlpha=.7,e.fillRect(0,0,t,r)}));for(let t=0,r=o.length;t<r;t++){const r=o[t];q(e,(()=>{r.iSt||(e.beginPath(),K(e,[...r.vt,r.vt[0]],a),e.closePath(),e.fillStyle=s?v:d,e.fill())}))}return()=>{}})(...t),clear:()=>Z(e)}})(m),C=tt(y,et,`#version 300 es\nprecision highp float;\n#define COUNT ${P.config[0]}\n#define PI 3.1415926535\n#define F .0005\nin vec2 vUv;\nuniform vec2 uBdS[COUNT];\nuniform vec3 uVp,uBdP[COUNT];\nuniform float uT,uB,uBr,uTl,uI;\nuniform sampler2D uTx[8];\nout vec4 fc;\nvec2 rUV(vec2 st,float t){float sr=sin(t),cr=cos(t);re
.pnt.x=s.x*n.dpt,n.pnt.y=s.y*n.dpt;var x=k._fs(t,e,s,1),u=0;if(I.cont(t.vt,x[0])&&(i[u++]=x[0]),I.cont(t.vt,x[1])&&(i[u++]=x[1]),2>u){var v=k._fs(e,t,s,-1);I.cont(e.vt,v[0])&&(i[u++]=v[0]),2>u&&I.cont(e.vt,v[1])&&(i[u++]=v[1])}return 0==u&&(i[u++]=x[0]),i.length=u,n},k._oA=(e,r,n,a)=>{var o,s,i,l,c,p,x=r.length,u=n.length,v=r[0].x,d=r[0].y,f=n[0].x,y=n[0].y,m=a.length,h=t,b=0;for(c=0;c<m;c++){var g=a[c],A=g.x,S=g.y,w=v*A+d*S,B=f*A+y*S,P=w,E=B;for(p=1;p<x;p+=1)(l=r[p].x*A+r[p].y*S)>P?P=l:l<w&&(w=l);for(p=1;p<u;p+=1)(l=n[p].x*A+n[p].y*S)>E?E=l:l<B&&(B=l);if((o=(s=P-B)<(i=E-w)?s:i)<h&&(h=o,b=c,0>=o))break}e.axis=a[b],e.ovlp=h},k._pTA=(t,e,r)=>{for(var n,a=e[0].x*r.x+e[0].y*r.y,o=a,s=1;s<e.length;s+=1)(n=e[s].x*r.x+e[s].y*r.y)>o?o=n:n<a&&(a=n);t.min=a,t.max=o},k._fs=(e,r,n,a)=>{var o,s,i,l,c,p=r.vt,x=p.length,u=e.pos.x,v=e.pos.y,d=n.x*a,f=n.y*a,y=t;for(c=0;c<x;c+=1)(l=d*(u-(s=p[c]).x)+f*(v-s.y))<y&&(y=l,o=s);return y=d*(u-(i=p[(x+o.index-1)%x]).x)+f*(v-i.y),d*(u-(s=p[(o.index+1)%x]).x)+f*(v-s.y)<y?(F[0]=o,F[1]=s,F):(F[0]=o,F[1]=i,F)};var z=(t,e,r)=>{var n,a,o,s,i=t.events;if(i&&0<C.ky(i).length){r||(r={}),n=e.split(" ");for(var l=0;l<n.length;l++)if(o=i[a=n[l]]){(s=C.cl(r,!1)).name=a,s.source=t;for(var c=0;c<o.length;c++)o[c].apply(t,[s])}}},X={cr:t=>C.xt({id:C.nxI(),type:"composite",pr:null,iMd:!1,bodies:[],cn:[],cm:[],l:"Composite",cache:{allBd:null,allCn:null,allCm:null}},t),stM:(t,e,r,n)=>{if(t.iMd=e,e&&t.cache&&(t.cache.allBd=null,t.cache.allCn=null,t.cache.allCm=null),r&&t.pr&&X.stM(t.pr,e,r,n),n)for(var a,o=0;o<t.cm.length;o++)a=t.cm[o],X.stM(a,e,r,n)},add:(t,e)=>{var r=[].concat(e);z(t,"beforeAdd",{object:e});for(var n,a=0;a<r.length;a++)switch(n=r[a],n.type){case"body":if(n.pr!==n)break;X.addB(t,n);break;case"constraint":X.addCn(t,n);break;case"composite":X.addC(t,n);break;case"mouseConstraint":X.addCn(t,n.constraint)}return z(t,"afterAdd",{object:e}),t},rm:(t,e,r)=>{var n=[].concat(e);z(t,"beforeRemove",{object:e});for(var a,o=0;o<n.length;o++)switch(a=n[o],a.type){case"body":X.rmB(t,a,r);break;case"constraint":X.rmCn(t,a,r);break;case"composite":X.rmC(t,a,r);break;case"mouseConstraint":X.rmCn(t,a.constraint)}return z(t,"afterRemove",{object:e}),t},addC:(t,e)=>(t.cm.push(e),e.pr=t,X.stM(t,!0,!0,!1),t),rmC:(t,e,r)=>{var n=C.io(t.cm,e);if(-1!==n&&X.rmCa(t,n),r)for(var a=0;a<t.cm.length;a++)X.rmC(t.cm[a],e,!0);return t},rmCa:(t,e)=>(t.cm.splice(e,1),X.stM(t,!0,!0,!1),t),addB:(t,e)=>(t.bodies.push(e),X.stM(t,!0,!0,!1),t),rmB:(t,e,r)=>{var n=C.io(t.bodies,e);if(-1!==n&&X.rmBa(t,n),r)for(var a=0;a<t.cm.length;a++)X.rmB(t.cm[a],e,!0);return t},rmBa:(t,e)=>(t.bodies.splice(e,1),X.stM(t,!0,!0,!1),t),addCn:(t,e)=>(t.cn.push(e),X.stM(t,!0,!0,!1),t),rmCn:(t,e,r)=>{var n=C.io(t.cn,e);if(-1!==n&&X.rmCna(t,n),r)for(var a=0;a<t.cm.length;a++)X.rmCn(t.cm[a],e,!0);return t},rmCna:(t,e)=>(t.cn.splice(e,1),X.stM(t,!0,!0,!1),t),allBd:t=>{if(t.cache&&t.cache.allBd)return t.cache.allBd;for(var e=[].concat(t.bodies),r=0;r<t.cm.length;r++)e=e.concat(X.allBd(t.cm[r]));return t.cache&&(t.cache.allBd=e),e},allCn:t=>{if(t.cache&&t.cache.allCn)return t.cache.allCn;for(var e=[].concat(t.cn),r=0;r<t.cm.length;r++)e=e.concat(X.allCn(t.cm[r]));return t.cache&&(t.cache.allCn=e),e}},N={_w:.4,_td:1,_ml:1e-6,cr:t=>{var e=t;e.bdA&&!e.ptA&&(e.ptA={x:0,y:0}),e.bdB&&!e.ptB&&(e.ptB={x:0,y:0});var r=e.bdA?E.add(e.bdA.pos,e.ptA):e.ptA,n=e.bdB?E.add(e.bdB.pos,e.ptB):e.ptB,a=E.mag(E.sub(r,n));return e.length=void 0===e.length?a:e.length,e.id=e.id||C.nxI(),e.l=e.l||"Constraint",e.type="constraint",e.st=e.st||(0<e.length?1:.7),e.da=e.da||0,e.aSt=e.aSt||0,e.aA=e.bdA?e.bdA.a:e.aA,e.aB=e.bdB?e.bdB.a:e.aB,e},prsa:t=>{for(var e=0;e<t.length;e+=1){var r=t[e],n=r.cI;r.iSt||0===n.x&&0===n.y&&0===n.a||(r.pos.x+=n.x,r.pos.y+=n.y,r.a+=n.a)}},slvA:(t,e)=>{for(var r=0;r<t.length;r+=1){var n=t[r],a=!n.bdA||n.bdA&&n.bdA.iSt,o=!n.bdB||n.bdB&&n.bdB.iSt;(a||o)&&N.slv(t[r],e)}for(r=0;r<t.length;r+=1)a=!(n=t[r]).bdA||n.bdA&&n.bdA.iSt,o=!n.bdB||n.bdB&&n.bdB.iSt,a||o||N.slv(t[r],e)},slv:(t,e)=>{var r=t.bdA,n=t.bdB,a=t.ptA,o=t.ptB;if(r||n){r&&!r.iSt&&(E.rot(a,r.a-t.aA,a),t.aA=r.a),n&&!n.iSt&&(E.rot(o,n.a-t.aB,o),t.aB=n.a);var s=a,i=o;if(r&&(s=E.add(r.pos,a)),n&&(i=E.add(n.pos,o)),s&&i){var l=E.sub(s,i),c=E.mag(l);c<N._ml&&(c=N._ml);var p,x,u,v,d,f=(c-t.length)/c,y=1>t.st?t.st*e:t.st,m=E.mult(l,f*y),h=(r?r.iM:0)+(n?n.iM:0),b=h+((r?r.iIa:0)+(n?n.iIa:0));if(t.da){var g=E.cr();u=E.div(l,c),d=E.sub(n&&E.sub(n.pos,n.pP)||g,r&&E.sub(r.pos,r.pP)||g),v=E.dot(u,d)}r&&!r.iSt&&(x=r.iM/h,r.cI.x-=m.x*x,r.cI.y-=m.y*x,r.pos.x-=m.x*x,r.pos.y-=m.y*x,t.da&&(r.pP.x-=t.da*u.x*v*x,r.pP.y-=t.da*u.y*v*x),p=E.cross(a,m)/b*N._td*r.iIa*(1-t.aSt),r.cI.a-=p,r.a-=p),n&&!n.iSt&&(x=n.iM/h,n.cI.x+=m.x*x,n.cI.y+=m.y*x,n.pos.x+=m.x*x,n.pos.y+=m.y*x,t.da&&(n.pP.x+=t.da*u.x*v*x,n.pP.y+=t.da*u.y*v*x),p=E.cross(o,m)/b*N._td*n.iIa*(1-t.aSt),n.cI.a+=p,n.a+=p)}}},psa:t=>{for(var e=0;e<t.length;e++){var r=t[e],n=r.cI;if(!(r.iSt||0===n.x&&0===n.y&&0===n.a)){for(var a,o=0;o<r.pt.length;o++)a=r.pt[o],I.tran(a.vt,n),0<o&&(a.pos.x+=n.x,a.pos.y+=n.y),0!==n.a&&(I.rot(a.vt,n.a,r.pos),_(a.ax,n.a),0<o&&E.rotA(a.pos,n.a,r.pos,a.pos)),T.ud(a.b,a.vt,r.v);n.a*=N._w,n.x*=N._w,n.y*=N._w}}},ptAW:t=>({x:(t.bdA?t.bdA.pos.x:0)+(t.ptA?t.ptA.x:0),y:(t.bdA?t.bdA.pos.y:0)+(t.ptA?t.ptA.y:0)}),ptBW:t=>({x:(t.bdB?t.bdB.pos.x:0)+(t.ptB?t.ptB.x:0),y:(t.bdB?t.bdB.pos.y:0)+(t.ptB?t.ptB.y:0)})},Y={cr:t=>C.xt({bodies:[],pairs:null},t),sBd:(t,e)=>{t.bodies=e.slice(0)},clr:t=>{t.bodies=[]},cols:t=>{var e,r,n=[],a=t.pairs,o=t.bodies,s=o.length,i=Y.cCol,l=k.cld;for(o.sort(Y._cBX),e=0;e<s;e++){var c=o[e],p=c.b,x=c.b.max.x,u=c.b.max.y,v=c.b.min.y,d=c.iSt,f=c.pt.length,y=1===f;for(r=e+1;r<s;r++){var m=o[r];if((P=m.b).min.x>x)break;if(!(u<P.min.y||v>P.max.y)&&(!d||!m.iSt)&&i(c.cF,m.cF)){var h=m.pt.length;if(y&&1===h)(w=l(c,m,a))&&n.push(w);else for(var b=1<h?1:0,g=1<f?1:0;g<f;g++)for(var A=c.pt[g],S=(p=A.b,b);S<h;S++){var w,B=m.pt[S],P=B.b;p.min.x>P.max.x||p.max.x<P.min.x||p.max.y<P.min.y||p.min.y>P.max.y||(w=l(A,B,a))&&n.push(w)}}}}return n},cCol:(t,e)=>t.group===e.group&&0!==t.group?0<t.group:0!=(t.mask&e.category)&&0!=(e.mask&t.category),_cBX:(t,e)=>t.b.min.x-e.b.min.x},G={_rT:4,_rTt:6,_posD:.9,_posW:.8,_frNmlM:5,prsp:t=>{var e,r,n,a=t.length;for(e=0;e<a;e++)(r=t[e]).iA&&(n=r.aCn.length,r.col.prA.tC+=n,r.col.prB.tC+=n)},slvp:(t,e)=>{var r,n,a,o,s,i,l,c,p=G._posD,x=t.length;for(r=0;r<x;r++)(n=t[r]).iA&&!n.iSn&&(o=(a=n.col).prA,s=a.prB,i=a.nml,n.sep=i.x*(s.pI.x+a.pnt.x-o.pI.x)+i.y*(s.pI.y+a.pnt.y-o.pI.y));for(r=0;r<x;r++)(n=t[r]).iA&&!n.iSn&&(o=(a=n.col).prA,s=a.prB,i=a.nml,c=(n.sep-n.sp)*e,(o.iSt||s.iSt)&&(c*=2),o.iSt||(l=p/o.tC,o.pI.x+=i.x*c*l,o.pI.y+=i.y*c*l),s.iSt||(l=p/s.tC,s.pI.x-=i.x*c*l,s.pI.y-=i.y*c*l))},pSp:t=>{for(var e=G._posW,r=t.length,n=I.tran,a=T.ud,o=0;o<r;o++){var s=t[o],i=s.pI,l=i.x,c=i.y,p=s.v;if(s.tC=0,0!==l||0!==c){for(var x,u=0;u<s.pt.length;u++)n((x=s.pt[u]).vt,i),a(x.b,x.vt,p),x.pos.x+=l,x.pos.y+=c;s.pP.x+=l,s.pP.y+=c,0>l*p.x+c*p.y?(i.x=0,i.y=0):(i.x*=e,i.y*=e)}}},prSv:t=>{var e,r,n=t.length;for(e=0;e<n;e++){var a=t[e];if(a.iA&&!a.iSn){var o=a.aCn,s=o.length,i=a.col,l=i.prA,c=i.prB,p=i.nml,x=i.tg;for(r=0;r<s;r++){var u=o[r],v=u.vertex,d=u.nmlI,f=u.tgI;if(0!==d||0!==f){var y=p.x*d+x.x*f,m=p.y*d+x.y*f;l.iSt||(l.pP.x+=y*l.iM,l.pP.y+=m*l.iM,l.aP+=l.iIa*((v.x-l.pos.x)*m-(v.y-l.pos.y)*y)),c.iSt||(c.pP.x-=y*c.iM,c.pP.y-=m*c.iM,c.aP-=c.iIa*((v.x-c.pos.x)*m-(v.y-c.pos.y)*y))}}}}},slvv:(e,r)=>{var n,a,o,i,l=r*r,c=G._rT*l,p=G._frNmlM,x=G._rTt*l,u=e.length;for(o=0;o<u;o++){var v=e[o];if(v.iA&&!v.iSn){var d=v.col,f=d.prA,y=d.prB,m=f.v,h=y.v,b=d.nml.x,g=d.nml.y,A=d.tg.x,S=d.tg.y,w=v.aCn,B=w.length,P=1/B,E=f.iM+y.iM,C=v.fr*v.fS*p*l;for(m.x=f.pos.x-f.pP.x,m.y=f.pos.y-f.pP.y,h.x=y.pos.x-y.pP.x,h.y=y.pos.y-y.pP.y,f.aV=f.a-f.aP,y.aV=y.a-y.aP,i=0;i<B;i++){var _=w[i],I=_.vertex,T=I.x-f.pos.x,M=I.y-f.pos.y,U=I.x-y.pos.x,R=I.y-y.pos.y,L=m.x-M*f.aV,D=m.y+T*f.aV,k=L-(h.x-R*y.aV),F=D-(h.y+U*y.aV),O=b*k+g*F,V=A*k+S*F,z=v.sep+O,X=s(z,1),N=(X=0>z?0:X)*C;V>N||-V>N?(a=0<V?V:-V,(n=v.fr*(0<V?1:-1)*l)<-a?n=-a:n>a&&(n=a)):(n=V,a=t);var Y=T*g-M*b,j=U*g-R*b,W=P/(E+f.iIa*Y*Y+y.iIa*j*j),$=(1+v.r)*O*W;if(n*=W,O*O>c&&0>O)_.nmlI=0;else{var H=_.nmlI;_.nmlI+=$,_.nmlI=s(_.nmlI,0),$=_.nmlI-H}if(V*V>x)_.tgI=0;else{var q=_.tgI;_.tgI+=n,_.tgI<-a&&(_.tgI=-a),_.tgI>a&&(_.tgI=a),n=_.tgI-q}var K=b*$+A*n,Z=g*$+S*n;f.iSt||(f.pP.x+=K*f.iM,f.pP.y+=Z*f.iM,f.aP+=(T*Z-M*K)*f.iIa),y.iSt||(y.pP.x-=K*y.iM,y.pP.y-=Z*y.iM,y.aP-=(U*Z-R*K)*y.iIa)}}}}},j={cr:t=>{t=t||{};var e=C.xt({posIt:6,vIt:4,cnIt:2,events:[],gravity:{x:0,y:1,scale:.001},timing:{tm:0,tS:1,lD:0,lE:0}},t);return e.world=t.world||X.cr({l:"World"}),e.pairs=t.pairs||(t=>C.xt({table:{},list:[],colStart:[],colActive:[],colEnd:[]},t))(),e.detector=t.detector||Y.cr(),e},ud:(t,e,r)=>{var n=C.now();e=e||1e3/60,r=r||1;var a,o=t.world,s=t.detector,i=t.pairs,l=t.timing,c=l.tm;l.tm+=e*l.tS,l.lD=e*l.tS;var p={tm:l.tm};z(t,"beforeUpdate",p);var x=X.allBd(o),u=X.allCn(o);for(o.iMd&&Y.sBd(s,x),o.iMd&&X.stM(o,!1,!1,!0),j._bdAG(x,t.gravity),j._bdU(x,e,l.tS,r,o.b),N.prsa(x),a=0;a<t.cnIt;a++)N.slvA(u,l.tS);for(N.psa(x),s.pairs=t.pairs,((t,e,r)=>{var n,a,o,s,i=t.list,l=i.length,c=t.table,p=e.length,x=t.colStart,u=t.colEnd,v=t.colActive;for(x.length=0,u.length=0,v.length=0,s=0;s<l;s++)i[s].cfmA=!1;for(s=0;s<p;s++)(o=(n=e[s]).pair)?(o.iA?v.push(o):x.push(o),D.ud(o,n,r),o.cfmA=!0):(c[(o=D.cr(n,r)).id]=o,x.push(o),i.push(o));var d=[];for(l=i.length,s=0;s<l;s++)(o=i[s]).cfmA||(D.sAc(o,!1,r),u.push(o));for(s=0;s<d.length;s++)o=i[a=d[s]-s],i.splice(a,1),delete c[o.id]})(i,Y.cols(s),c),0<i.colStart.length&&z(t,"colStart",{pairs:i.colStart}),G.prsp(i.list),a=0;a<t.posIt;a++)G.slvp(i.list,l.tS);for(G.pSp(x),N.prsa(x),a=0;a<t.cnIt;a++)N.slvA(u,l.tS);for(N.psa(x),G.prSv(i.list),a=0;a<t.vIt;a++)G.slvv(i.list,l.tS);return 0<i.colActive.length&&z(t,"colActive",{pairs:i.colActive}),0<i.colEnd.length&&z(t,"colEnd",{pairs:i.colEnd}),j._bdClfs(x),z(t,"afterUpdate",p),t.timing.lE=C.now()-n,t},merge:(t,e)=>{if(C.xt(t,e),e.world){t.world=e.world,j.clr(t);for(var r=X.allBd(t.world),n=0;n<r.length;n++)r[n].id=C.nxI()}},clr:t=>{var e;(e=t.pairs).table={},e.list.length=0,e.colStart.length=0,e.colActive.length=0,e.colEnd.length=0,Y.clr(t.detector)},_bdClfs:t=>{for(var e,r=0;r<t.length;r++)(e=t[r]).f.x=0,e.f.y=0,e
(()=>{"use strict";var t=Number.MAX_VALUE,e=Math.abs,r=Math.sin,n=Math.cos,a=Math.pow,o=Math.sqrt,s=Math.min;const i=2048,l=3/4,c=[8,16,32,64,128],p=[.58,.42,.3,.21,.15],x=[12.5,13,32,80,125],u={antialias:!1,dpt:!1,stencil:!1,preserveDrawingBuffer:!0},v="#f9f1ea",d="#1f1e1c",f=(t,e)=>{const r=Object.keys(e);for(let n=0;n<r.length;n++)t.style[r[n]]=e[r[n]]},y=a(2,-32),m=32557,h=19605,b=new Uint16Array(4),g=new DataView(b.buffer),A=()=>{const t=b[0],e=b[1],r=b[2],n=b[3],a=0|33103+m*t,o=0|63335+m*e+(h*t+(a>>>16)),s=0|31614+m*r+h*e+(62509*t+(o>>>16));b[0]=a,b[1]=o,b[2]=s,b[3]=5125+m*n+(h*r+62509*e)+(22609*t+(s>>>16));const i=(n<<21)+((n>>2^r)<<5)+((r>>2^e)>>11);return y*((i>>>(n>>11)|i<<(31&-(n>>11)))>>>0)},S=(t,e=0)=>{const r=16,n=65535,a=255;for(var o,s=1540483477,i=t.length,l=e^i,c=0;4<=i;)o=((o=t[c]&a|(t[++c]&a)<<8|(t[++c]&a)<<16|(t[++c]&a)<<24)&n)*s+(((o>>>r)*s&n)<<r),l=(l&n)*s+(((l>>>r)*s&n)<<r)^(o=((o^=o>>>24)&n)*s+(((o>>>r)*s&n)<<r)),i-=4,++c;switch(i){case 3:l^=(t[c+2]&a)<<r;case 2:l^=(t[c+1]&a)<<8;case 1:l=((l^=t[c]&a)&n)*s+(((l>>>r)*s&n)<<r)}return l=((l^=l>>>13)&n)*s+(((l>>>16)*s&n)<<16),(l^=l>>>15)>>>0},w=(t=.5)=>A()<t,B=(t,e)=>(void 0===e&&(e=t,t=0),A()*(e-t)+t),P=t=>{var e,r=0;for(e=0;e<t.length;e++)r+=t[e];var n=A()*r;for(e=0;e<t.length;e++){if(n<t[e])return e;n-=t[e]}return 0};var E={cr:(t,e)=>({x:t||0,y:e||0}),cl:t=>({x:t.x,y:t.y}),mag:t=>o(t.x*t.x+t.y*t.y),mag2:t=>t.x*t.x+t.y*t.y,rot:(t,e,a)=>{var o=n(e),s=r(e);a||(a={});var i=t.x*o-t.y*s;return a.y=t.x*s+t.y*o,a.x=i,a},rotA:(t,e,a,o)=>{var s=n(e),i=r(e);o||(o={});var l=a.x+((t.x-a.x)*s-(t.y-a.y)*i);return o.y=a.y+((t.x-a.x)*i+(t.y-a.y)*s),o.x=l,o},nmlz:t=>{var e=E.mag(t);return 0===e?{x:0,y:0}:{x:t.x/e,y:t.y/e}},dot:(t,e)=>t.x*e.x+t.y*e.y,cross:(t,e)=>t.x*e.y-t.y*e.x,cross3:(t,e,r)=>(e.x-t.x)*(r.y-t.y)-(e.y-t.y)*(r.x-t.x),add:(t,e,r)=>(r||(r={}),r.x=t.x+e.x,r.y=t.y+e.y,r),sub:(t,e,r)=>(r||(r={}),r.x=t.x-e.x,r.y=t.y-e.y,r),mult:(t,e)=>({x:t.x*e,y:t.y*e}),div:(t,e)=>({x:t.x/e,y:t.y/e}),perp:(t,e)=>({x:(e=!0===e?-1:1)*-t.y,y:e*t.x}),neg:t=>({x:-t.x,y:-t.y}),a:(t,e)=>Math.atan2(e.y-t.y,e.x-t.x)};E._temp=[E.cr(),E.cr(),E.cr(),E.cr(),E.cr(),E.cr()];var C={_nxi:0,_sd:0};C._nwst=+new Date,C.xt=function(t,e){var r,n;"boolean"==typeof e?(r=2,n=e):(r=1,n=!0);for(var a,o=r;o<arguments.length;o++)if(a=arguments[o])for(var s in a)n&&a[s]&&a[s].constructor===Object?t[s]&&t[s].constructor!==Object?t[s]=a[s]:(t[s]=t[s]||{},C.xt(t[s],n,a[s])):t[s]=a[s];return t},C.cl=(t,e)=>C.xt({},e,t),C.ky=t=>{if(Object.keys)return Object.keys(t);var e=[];for(var r in t)e.push(r);return e},C.values=t=>{var e=[];if(Object.keys){for(var r=Object.keys(t),n=0;n<r.length;n++)e.push(t[r[n]]);return e}for(var a in t)e.push(t[a]);return e},C.gt=(t,e,r,n)=>{e=e.split(".").slice(r,n);for(var a=0;a<e.length;a+=1)t=t[e[a]];return t},C.st=(t,e,r,n,a)=>{var o=e.split(".").slice(n,a);return C.gt(t,e,0,-1)[o[o.length-1]]=r,r},C.now=()=>{if("undefined"!=typeof window&&window.performance){if(window.performance.now)return window.performance.now();if(window.performance.webkitNow)return window.performance.webkitNow()}return Date.now?Date.now():new Date-C._nwst},C.nxI=()=>C._nxi++,C.io=(t,e)=>{if(t.indexOf)return t.indexOf(e);for(var r=0;r<t.length;r++)if(t[r]===e)return r;return-1};var _=(t,e)=>{if(0!==e)for(var a=n(e),o=r(e),s=0;s<t.length;s++){var i,l=t[s];i=l.x*a-l.y*o,l.y=l.x*o+l.y*a,l.x=i}},I={cr:(t,e)=>{for(var r=[],n=0;n<t.length;n++){var a=t[n],o={x:a.x,y:a.y,index:n,body:e,isInternal:!1};r.push(o)}return r},frPth:(t,e)=>{var r=[];return t.replace(/L?\s*([-\d.e]+)[\s,]*([-\d.e]+)*/gi,((t,e,n)=>{r.push({x:parseFloat(e),y:parseFloat(n)})})),I.cr(r,e)},centre:t=>{for(var e,r,n,a=I.aa(t,!0),o={x:0,y:0},s=0;s<t.length;s++)n=(s+1)%t.length,e=E.cross(t[s],t[n]),r=E.mult(E.add(t[s],t[n]),e),o=E.add(o,r);return E.div(o,6*a)},mean:t=>{for(var e={x:0,y:0},r=0;r<t.length;r++)e.x+=t[r].x,e.y+=t[r].y;return E.div(e,t.length)},aa:(t,r)=>{for(var n=0,a=t.length-1,o=0;o<t.length;o++)n+=(t[a].x-t[o].x)*(t[a].y+t[o].y),a=o;return r?n/2:e(n)/2},ia:(t,r)=>{for(var n,a,o=0,s=0,i=t,l=0;l<i.length;l++)a=(l+1)%i.length,o+=(n=e(E.cross(i[a],i[l])))*(E.dot(i[a],i[a])+E.dot(i[a],i[l])+E.dot(i[l],i[l])),s+=n;return r/6*(o/s)},tran:(t,e,r)=>{r=void 0===r?1:r;var n,a=t.length,o=e.x*r,s=e.y*r;for(n=0;n<a;n++)t[n].x+=o,t[n].y+=s;return t},rot:(t,e,a)=>{if(0!==e){var o,s,i,l,c=n(e),p=r(e),x=a.x,u=a.y,v=t.length;for(l=0;l<v;l++)s=(o=t[l]).x-x,i=o.y-u,o.x=x+(s*c-i*p),o.y=u+(s*p+i*c);return t}},cont:(t,e)=>{for(var r,n=e.x,a=e.y,o=t.length,s=t[o-1],i=0;i<o;i++){if(r=t[i],0<(n-s.x)*(r.y-s.y)+(a-s.y)*(s.x-r.x))return!1;s=r}return!0},scl:(t,e,r,n)=>{if(1===e&&1===r)return t;n=n||I.centre(t);for(var a,o,s=0;s<t.length;s++)a=t[s],o=E.sub(a,n),t[s].x=n.x+o.x*e,t[s].y=n.y+o.y*r;return t},cwSrt:t=>{var e=I.mean(t);return t.sort(((t,r)=>E.a(e,t)-E.a(e,r))),t},iCvx:t=>{var e,r,n,a,o=0,s=t.length;if(3>s)return null;for(e=0;e<s;e++)if(n=(e+2)%s,a=(t[r=(e+1)%s].x-t[e].x)*(t[n].y-t[r].y),0>(a-=(t[r].y-t[e].y)*(t[n].x-t[r].x))?o|=1:0<a&&(o|=2),3===o)return!1;return 0!=o||null},hull:t=>{var e,r,n=[],a=[];for((t=t.slice(0)).sort(((t,e)=>{var r=t.x-e.x;return 0==r?t.y-e.y:r})),r=0;r<t.length;r+=1){for(e=t[r];2<=a.length&&0>=E.cross3(a[a.length-2],a[a.length-1],e);)a.pop();a.push(e)}for(r=t.length-1;0<=r;r-=1){for(e=t[r];2<=n.length&&0>=E.cross3(n[n.length-2],n[n.length-1],e);)n.pop();n.push(e)}return n.pop(),a.pop(),n.concat(a)}},T={cr:t=>{var e={min:{x:0,y:0},max:{x:0,y:0}};return t&&T.ud(e,t),e},ud:(t,e,r)=>{t.min.x=1/0,t.max.x=-1/0,t.min.y=1/0,t.max.y=-1/0;for(var n,a=0;a<e.length;a++)(n=e[a]).x>t.max.x&&(t.max.x=n.x),n.x<t.min.x&&(t.min.x=n.x),n.y>t.max.y&&(t.max.y=n.y),n.y<t.min.y&&(t.min.y=n.y);r&&(0<r.x?t.max.x+=r.x:t.min.x+=r.x,0<r.y?t.max.y+=r.y:t.min.y+=r.y)},cont:(t,e)=>e.x>=t.min.x&&e.x<=t.max.x&&e.y>=t.min.y&&e.y<=t.max.y,overlaps:(t,e)=>t.min.x<=e.max.x&&t.max.x>=e.min.x&&t.max.y>=e.min.y&&t.min.y<=e.max.y,tran:(t,e)=>{t.min.x+=e.x,t.max.x+=e.x,t.min.y+=e.y,t.max.y+=e.y},shift:(t,e)=>{var r=t.max.x-t.min.x,n=t.max.y-t.min.y;t.min.x=e.x,t.max.x=e.x+r,t.min.y=e.y,t.max.y=e.y+n}},M={_iaScale:4,_nextCollidingGroupId:1,_nextNonCollidingGroupId:-1,_nextCategory:1,cr:t=>{var e={id:C.nxI(),type:"body",l:"Body",pt:[],a:0,vt:I.frPth("L 0 0 L 40 0 L 40 40 L 0 40"),pos:{x:0,y:0},f:{x:0,y:0},t:0,pI:{x:0,y:0},cI:{x:0,y:0,a:0},tC:0,s:0,aS:0,v:{x:0,y:0},aV:0,iSn:!1,iSt:!1,mt:0,d:.001,r:0,fr:.1,fS:.5,fA:.01,cF:{category:1,mask:4294967295,group:0},sp:.05,tS:1,events:null,b:null,cR:0,pP:null,aP:0,pr:null,ax:null,aa:0,m:0,ia:0,_og:null},r=C.xt(e,t);return U(r,t),r}},U=(t,e)=>{e=e||{},M.set(t,{b:t.b||T.cr(t.vt),pP:t.pP||E.cl(t.pos),aP:t.aP||t.a,vt:t.vt,pt:t.pt||[t],iSt:t.iSt,pr:t.pr||t}),I.rot(t.vt,t.a,t.pos),_(t.ax,t.a),T.ud(t.b,t.vt,t.v),M.set(t,{ax:e.ax||t.ax,aa:e.aa||t.aa,m:e.m||t.m,ia:e.ia||t.ia})};M.set=(t,e,r)=>{for(var n in"string"==typeof e&&(n=e,(e={})[n]=r),e)Object.prototype.hasOwnProperty.call(e,n)&&(r=e[n],"m"===n?M.setm(t,r):"ia"===n?M.setia(t,r):"vt"===n?M.setVt(t,r):"pos"===n?M.setpos(t,r):"pt"===n?M.setpt(t,r):t[n]=r)},M.setm=(t,e)=>{var r=t.ia/(t.m/6);t.ia=r*(e/6),t.iIa=1/t.ia,t.m=e,t.iM=1/t.m,t.d=t.m/t.aa},M.setia=(t,e)=>{t.ia=e,t.iIa=1/t.ia},M.setVt=(t,e)=>{t.vt=e[0].body===t?e:I.cr(e,t),t.ax=(t=>{for(var e={},r=0;r<t.length;r++){var n=(r+1)%t.length,a=E.nmlz({x:t[n].y-t[r].y,y:t[r].x-t[n].x}),o=0===a.y?1/0:a.x/a.y;e[o=o.toFixed(3).toString()]=a}return C.values(e)})(t.vt),t.aa=I.aa(t.vt),M.setm(t,t.d*t.aa);var r=I.centre(t.vt);I.tran(t.vt,r,-1),M.setia(t,M._iaScale*I.ia(t.vt,t.m)),I.tran(t.vt,t.pos),T.ud(t.b,t.vt,t.v)},M.setpt=(t,e)=>{var r;for(e=e.slice(0),t.pt.length=0,t.pt.push(t),t.pr=t,r=0;r<e.length;r++){var n=e[r];n!==t&&(n.pr=t,t.pt.push(n))}if(1!==t.pt.length){var a=M._ttP(t);t.aa=a.aa,t.pr=t,t.pos.x=a.centre.x,t.pos.y=a.centre.y,t.pP.x=a.centre.x,t.pP.y=a.centre.y,M.setm(t,a.m),M.setia(t,a.ia),M.setpos(t,a.centre)}},M.setpos=(t,e)=>{var r=E.sub(e,t.pos);t.pP.x+=r.x,t.pP.y+=r.y;for(var n,a=0;a<t.pt.length;a++)(n=t.pt[a]).pos.x+=r.x,n.pos.y+=r.y,I.tran(n.vt,r),T.ud(n.b,n.vt,t.v)},M.ud=(t,r,n,o)=>{var s=a(r*n*t.tS,2),i=1-t.fA*n*t.tS,l=t.pos.x-t.pP.x,c=t.pos.y-t.pP.y;t.v.x=l*i*o+t.f.x/t.m*s,t.v.y=c*i*o+t.f.y/t.m*s,t.pP.x=t.pos.x,t.pP.y=t.pos.y,t.pos.x+=t.v.x,t.pos.y+=t.v.y,t.aV=(t.a-t.aP)*i*o+t.t/t.ia*s,t.aP=t.a,t.a+=t.aV,t.s=E.mag(t.v),t.aS=e(t.aV);for(var p,x=0;x<t.pt.length;x++)p=t.pt[x],I.tran(p.vt,t.v),0<x&&(p.pos.x+=t.v.x,p.pos.y+=t.v.y),0!==t.aV&&(I.rot(p.vt,t.aV,t.pos),_(p.ax,t.aV),0<x&&E.rotA(p.pos,t.aV,t.pos,p.pos)),T.ud(p.b,p.vt,t.v)},M.af=(t,e,r)=>{t.f.x+=r.x,t.f.y+=r.y;var n=e.x-t.pos.x,a=e.y-t.pos.y;t.t+=n*r.y-a*r.x},M._ttP=t=>{for(var e={m:0,aa:0,ia:0,centre:{x:0,y:0}},r=1===t.pt.length?0:1;r<t.pt.length;r++){var n=t.pt[r],a=n.m===1/0?1:n.m;e.m+=a,e.aa+=n.aa,e.ia+=n.ia,e.centre=E.add(e.centre,E.mult(n.pos,a))}return e.centre=E.div(e.centre,e.m),e};var R=(t,e,r,n,a)=>{a=a||{};var o={l:"rect",pos:{x:t,y:e},vt:I.frPth("L 0 0 L "+r+" 0 L "+r+" "+n+" L 0 "+n)};return M.cr(C.xt({},o,a))},L=t=>({vertex:t,nmlI:0,tgI:0}),D={cr:(t,e)=>{var r=t.bdA,n=t.bdB,a={id:D.id(r,n),bdA:r,bdB:n,col:t,contacts:[],aCn:[],sep:0,iA:!0,cfmA:!0,iSn:r.iSn||n.iSn,tCr:e,tUp:e,iM:0,fr:0,fS:0,r:0,sp:0};return D.ud(a,t,e),a},ud:(t,e,r)=>{var n=t.contacts,a=e.spt,o=t.aCn,s=e.prA,i=e.prB,l=s.vt.length;t.iA=!0,t.tUp=r,t.col=e,t.sep=e.dpt,t.iM=s.iM+i.iM,t.fr=s.fr<i.fr?s.fr:i.fr,t.fS=s.fS>i.fS?s.fS:i.fS,t.r=s.r>i.r?s.r:i.r,t.sp=s.sp>i.sp?s.sp:i.sp,e.pair=t,o.length=0;for(var c=0;c<a.length;c++){var p=a[c],x=p.body===s?p.index:l+p.index,u=n[x];u?o.push(u):o.push(n[x]=L(p))}},sAc:(t,e,r)=>{e?(t.iA=!0,t.tUp=r):(t.iA=!1,t.aCn.length=0)},id:(t,e)=>t.id<e.id?"A"+t.id+"B"+e.id:"A"+e.id+"B"+t.id},k={},F=[],O={ovlp:0,axis:null},V={ovlp:0,axis:null};k.cr=(t,e)=>({pair:null,cold:!1,bdA:t,bdB:e,prA:t.pr,prB:e.pr,dpt:0,nml:{x:0,y:0},tg:{x:0,y:0},pnt:{x:0,y:0},spt:[]}),k.cld=(t,e,r)=>{if(k._oA(O,t.vt,e.vt,t.ax),0>=O.ovlp)return null;if(k._oA(V,e.vt,t.vt,e.ax),0>=V.ovlp)return null;var n,a=r&&r.table[D.id(t,e)];a?n=a.col:((n=k.cr(t,e)).cold=!0,n.bdA=t.id<e.id?t:e,n.bdB=t.id<e.id?e:t,n.prA=n.bdA.pr,n.prB=n.bdB.pr),t=n.bdA,e=n.bdB;var o=O.ovlp<V.ovlp?O:V,s=n.nml,i=n.spt,l=o.axis,c=l.x,p=l.y;0>c*(e.pos.x-t.pos.x)+p*(e.pos.y-t.pos.y)?(s.x=c,s.y=p):(s.x=-c,s.y=-p),n.tg.x=-s.y,n.tg.y=s.x,n.dpt=o.ovlp,n
0x3b1383e0…50da·#16,296,269·0x1c52ef36…dfc2e0
RoKelly Milligan E`Address: call to non-contractAddress: call to non-contractAddress: low-level delegate call failedAddress: low-level delegate call failed
0x3b1383e0…50da·#16,296,242·0x7d18a2d6…3342a0
RoKelly Milligan C`Address: call to non-contractAddress: call to non-contractAddress: low-level delegate call failedAddress: low-level delegate call failed
0x3b1383e0…50da·#16,296,170·0x389c9b9c…1e7f1a
RoKelly Milligan A`Address: call to non-contractAddress: call to non-contractAddress: low-level delegate call failedAddress: low-level delegate call failed
0x3b1383e0…50da·#16,282,312·0x7c55f418…a45742
Editions by Kelly MilliganAddress: call to non-contractAddress: call to non-contractAddress: low-level delegate call failedAddress: low-level delegate call failed
0x3b1383e0…50da·#16,282,251·0x9bc826c3…5586e6
Works by Kelly MilliganAddress: call to non-contractAddress: call to non-contractAddress: low-level delegate call failedAddress: low-level delegate call failed
_Act of Emotion_ investigates digitally-facilitated abstract expressionism: the act of painting itself as a means of expression, extended into mechanical reach. A reflection upon the future of automation, machine consciousness, creativity, and humankind’s inevitable consequences. As we await the next leap, we cling desperately to our belief that emotive art is an exclusively human experience. Inspired by those that came before—pioneering expressionists and contemporaries alike—the system engages in new methods of painting, free from traditionally accepted physical boundaries and artistic expectations. Action painting for the Connected Age; the system is in perpetual concert, recited in real-time and on-demand. Questioned by Colin McCahon, and recontextualised here through a generative lens: _How to make a painting beat like, and with, a human heart._ The machine’s movements are precise by default, grounded in mathematics. Organic expression must be introduced by twisting and destabilising; a process of broadening bounds that probes the subconscious of both artist and audience. Confrontingly minimal abstract compositions highlight the tension between rigid mechanical precision and fluid human intuition. Striping and stippling, swooping and darting; noisy automatism contrasted with coded instinct. Gestural abstraction applied with simulation of brush and emulation of media. Presence discovered through colour, texture, light and space; the works emerge as physically-manifested in digital form. Are these painted works analogous to physical counterparts? Can a machine successfully emotionally connect through this practice? Let us consider both the intent and the act that realise a painted artwork. _“Painting is a state of being. Painting is self-discovery.”_ — Jackson Pollock # Controls: - **[spacebar]** Pause/resume exhibit - **[escape]** Reset exhibit - **[S]** Export a still image at the current render size - **_Double Click/Tap_** to provide a human touch # Automatic: - Render resolution upscales with viewport dimensions. Future exhibits will enhance alongside hardware advance. - Playback cadence is hardware-dependent and downscales when limited by hardware. - "**Perpetual**" tokens continue their performance indefinitely # Printing: Generatively signed giclée print renditions available up to 36x48" / A0.
()=>{let e="0x";for(let t=64;0<t;--t)e+="0123456789abcdef"[~~(16*Math.random())];return e})():"string"==typeof tokenData?tokenData:tokenData.hash;T(ve);const pe=w(.33),he=pe?"Dark":"Light",me=Object.keys(G)[~~(g()*Object.keys(G).length)],de=(e=>{const t=[[ue,"Ridge",11],[ae,"Range",4],[ce,"Pillar",11],[ie,"Poplar",4],[oe,"Dapple",8],[se,"Pitter",11],[re,"Patter",11],[le,"Jazz",33],[fe,"Improvised",7]],n=(e=>{var t,n=0;for(t=0;t<e.length;t++)n+=e[t];var o=g()*n;for(t=0;t<e.length;t++){if(o<e[t])return t;o-=e[t]}return 0})(t.map((e=>e[2])));return[t[n][1],...t[n][0]([1,C],e)]})(G[me]);de[2][0]||de[2][1];const xe=[[g(),g()],[g(),g(),g()],[g(),g(),g(),g()],w(.18)],ge=[g()];!xe[3]&&xe[2][2];const be=w(.02),ye=w(.1);console.log(ve);(async()=>{const o=window,c=document,i=c.body,f=(e,t="canvas")=>e.appendChild(c.createElement(t)),v=(e,t,n)=>e.addEventListener(t,n),p=e=>o.requestAnimationFrame(e),h=()=>performance.now(),m=f(i,"main"),d=f(m),x=f(m),g=f(m),b=f(m),y=((e,[t,n,o,r,s])=>{T(t);const u=[["uS","v2",n],["uW","v3",o],["uP","v4",r],["uD","f",s?1:0],["uL","v3",[0,1,0]],["uI","f",0],["uG","f",1],["uT","f",0],["uM","f",0],["uA","f",0]],{setup:a,update:c}=e(U,`\n${P}\nvarying vec2 vUv;\nuniform vec2 uRes,uS;\nuniform vec3 uW,uL;\nuniform vec4 uP;\nuniform float uD,uI,uG,uT,uM,uA;\n${D}\n${F}\nfloat fbm(vec2 uv){float v=.0,a=.5+.15*uW.y;mat2 r=mat2(cos(.5),sin(.5),-sin(.5),cos(.5));for(int i=0;i<6;i++){v+=a*noise(uv+(uS*10.-5.));uv=r*uv*-2.;a*=.4+.1*uW.z;}return v;}\nfloat frm(vec2 p,float s){return fbm(p+fbm(p+fbm(p+fbm(p+fbm(p+fbm(p+fbm(p+fbm(p+fbm(p+fbm(p*s))))))))));}\n${M}\nvoid main(){\nfloat ar=uRes.x/uRes.y;\nvec2 uv=(vUv-1.)*2.;\nvec2 pos=(uv+1.)*(.35+.1*uW.x)*max(ar,1.);\npos.y/=ar;\nfloat t=uT+PI*.05*${_};\npos*=r2d(PI*.75+t);\npos+=uA*uM*.17+.04*sign(uT+PI)*vec2(cos(t),sin(t))+500.*fract(PI*uI*.0007);\nvec3 b=vec3(uP.r-0.8*pow(uP.b,15.),.4*uP.g,.2*uP.b+.7*pow(uP.b,15.));\nvec3 c=b;\nfloat z=.25+.5*uW.x;\nc+=(.5+.5*uP.a)*1.8*frm(pos,z);\nc+=2.5*vec3(.6,.3,.15)*frm(pos*.17,z*.71);\nc+=2.5*vec3(uP.r*.8-0.6*pow(uP.b,15.),uP.g*.4,uP.b*.2)*frm(pos*.66,z*1.73);\nc*=.7;\nc=mix(c,min(max(c.rrr*c.ggg/c.bbb,.1),1.),uD);\nvec2 f=pos*r2d(PI*.25);\nc*=.7+.3*(noise(vec2(f.y*(90.+30.*(sin(uT)*.5+.5)),uA*uM*2.))*.5+.5);\nfloat w=1.-uG;\nfloat ls=vUv.x*uL.x+vUv.y*uL.y+(1.-vUv.x)*uL.z;\nfloat l=pow(1.-(ls-.12-.22*w),20.);\nc.rgb+=.07*l;\nc.rgb*=1.+clamp(.15*l-.5*pow((ls+.06+.27*w),8.),-1.,1.);\nc=clamp(c,.85*vec3(.122,.118,.11),vec3(.918,.906,.882)*1.06);\ngl_FragColor=vec4(c,1.);\n}\n`);return{setup:a,update:e=>c(I(u,e))}})(k,[ve,...xe]),w=((e,[t,n])=>{const o=[["uPalette","t",t,10497,9729],["uP","v2",[0,0]],["uI","f",0],["uG","f",1],["uT","f",0],["uTv","f",0],["uM","f",0],["uA","f",0],["uS","f",n],["uD","f",0]],{setup:r,update:s}=e(U,`\n${P}\nvarying vec2 vUv;\nuniform int uFrame;\nuniform sampler2D uBuffer,uPalette;\nuniform vec2 uRes,uP;\nuniform float uI,uG,uT,uTv,uA,uM,uS,uD;\n${D}\n#define F .001\n#define MIN_D .015\n#define MAX_D .04\n#define MIN_W .10\n#define MAX_W .24\n${F}\n${M}\nvec2 rUV(vec2 uv, float t){float sr=sin(t),cr=cos(t); return vec2(cr*(uv.x-.5)+sr*(uv.y-.5)+.5,cr*(uv.y-.5)-sr*(uv.x-.5)+.5);}\nfloat fbm(vec2 uv){float v=.0,a=.5;for(int i=0;i<6;i++){v+=a*noise(uv);uv=uv*-2.;a*=.4;}return v;}\nfloat head(vec2 st,vec2 o,vec3 d,vec4 l){\nd.x*=(.5+.5*l.x*pow(l.y,8.))*l.z;\nd.y*=(l.x*l.y)*l.z*(.93+.07*l.w);\nfloat x=(1.-d.x)/2.,y=((1.-d.y)/2.);\nst=rUV(st-o,d.z);\nvec2 hUV=vec2(clamp((st.x-x)/(1.-x*2.),.0,1.),clamp((st.y-y)/(1.-y*2.),.0,1.));\nvec2 ends=vec2(1.-pow(abs(hUV.x*2.-1.),2.),1.-pow(abs(hUV.y*2.-1.),2.));\nvec2 bl=smoothstep(vec2(x-F,y-F),vec2(x+F,y+F),st);\nvec2 tr=smoothstep(vec2(x-F,y-F),vec2(x+F,y+F),1.-st);\nfloat r=bl.x*bl.y*tr.x*tr.y*smoothstep(.0,.02,(ends.x+ends.y)*ends.y);\nfloat br=10.+10.*pow(uG,1.5);\nfloat n=pow(abs(sin(hUV.y*br+uS*uI+uT*-2.+uA*12.5)),8.);\nr=smoothstep(.0,.25,r-((1.-l.x)+(1.-l.y))*n*2.5);\nreturn r;\n}\nvoid main(){\nfloat ar=uRes.x/uRes.y;\nvec2 uv=vUv;\nuv.y/=ar;\nvec4 c=texture2D(uBuffer,vUv);\nvec4 b=vec4(.0);\nvec4 s=vec4(.0);\nif (uFrame<1){\nvec2 o=(uv+.5)+uS;\nc+=(.5+.3*uD)*smoothstep(.48,.6+.6*uD,abs(fbm(o*(89.))));\nc+=(.1+.4*uD)*vec4(.0,.0,.0,smoothstep(.48,.52,(fbm(o*109.)*.5+.5)*(fbm(o*118.)*.5+.5)));\nfloat f=(smoothstep(.33,1.,1.-pow(abs(fbm(o*14.)),.1))+smoothstep(.33,1.,1.-pow(abs(fbm(o*16.)),.1))+smoothstep(.33,1.,1.-pow(abs(fbm(o*19.)),.1)))\n*pow(abs(fbm(o*35.)),3.);\nc+=(1.-uD)*6.*vec4(vec3(.0),f);\nc+=uD*5.*f;\n}\nvec2 pt=uP*.5+.5+.003*${_};\npt.y/=ar;\nfloat w=MIN_W+(MAX_W-MIN_W)*uG;\nfloat d=MIN_D+(MAX_D-MIN_D)*uG;\nfloat t=(uT+PI*.05*${_});\nvec4 p=texture2D(uPalette,(uv+vec2(.125))*4.-pt*4.);\nb+=head(uv,pt-.5,vec3(d,w,t),vec4(\n1.-pow(1.-min((uA*uM)*10.,1.),8.),\n1.-pow(uA,5.+60.*uM),\n1.-pow(uTv,8.),\n1.-(${_}*.5+.5)\n));\nb=min(b,vec4(1.));\ns+=b*p;\nc-=b*.03;\nc=max(c,s);\nc=mix(c,s,b*.05);\ngl_FragColor=c;\n}\n`);return{setup:r,update:e=>s(I(o,e))}})(k,[g,...ge]);let A,S,L,X,q,J=N()?3:4,Q=0,Z=0,te=0,ne=1,oe=b.getContext("2d"),re=d.getContext("2d",{preserveDrawingBuffer:!0}),se=[],ue=[],ae=0,ce=!1,ie=!0,le=!0,fe=!1,Te=!1,we=!1,Ae=!1,Re=!1,Ee=[],Pe=[],Ue=[0,1,0],De=!1;o.Act={};const Me=()=>Pe=se.map((e=>j(e))),Fe=(e=!1)=>{Y(re,(()=>{var t;$(re),t=z[he],re.fillStyle=t,re.fillRect(0,0,...W(re)),e||re.drawImage(x,0,0,...W(re))}))},_e=async({stepping:n=!1,exporting:o=!1,shift:r=!1}={})=>{var s=Math.abs;if(n){const n=ne/(se[te].length/2-1),o=te+n,r=e=>[se[te][2*e],se[te][2*e+1]],a=r(ne),c=r(ne-1),i=e(c[1]-a[1],(c[0]-a[0])*C);let l=i-ae;l=s(l)>2*t*.998?0:l,ae=i;const f=u(s(l)/.033,1);y.update([["uL","v3",Ue],["uI","f",te],["uG","f",G[me]],["uT","f",i],["uM","f",Pe[te]],["uA","f",o]]),w.update([["uP","v2",a],["uI","f",te],["uG","f",G[me]],["uT","f",i],["uTv","f",f],["uM","f",Pe[te]],["uA","f",n],["uD","f",pe?1:0]]),ne++}o&&(!r&&Fe(),await(async(e,t)=>{const n=document,o=(e=>{let t=window.atob(e.split(",")[1]),n=new ArrayBuffer(t.length),o=new Uint8Array(n);for(let e=0;e<t.length;e++)o[e]=t.charCodeAt(e);return new Blob([new DataView(n)],{type:e.split(",")[0].split(":")[1].split(";")[0]})})(e),r=window.URL.createObjectURL(o),s=n.body.appendChild(n.createElement("a"));s.href=r,s.download=t,s.click(),n.body.removeChild(s),window.URL.revokeObjectURL(r)})((r?x:d).toDataURL("image/png"),`act-${ve}.png`),Fe(!0))},Ie=async(e=!1)=>{const t=A,c=S;A=o.innerWidth,S=o.innerHeight;const l=o.devicePixelRatio,f=u(l,2);if(A/S>=C?(S-=S%16,A=~~(S*C)):(A-=A%12,S=~~(A/C)),A===t&&S===c&&!e)return;const v=2*f,[p,h,T]=((e=0,t=0)=>{const o=s(e,t),c=256+a(o-4096,0,2048),i=N()?256:s(128,(m=(o-c)/4,1<<31-Math.clz32(m))),l=N()?2400:16384,f=C*l*l,v=u(e,~~r(f*C)),p=u(t,~~r(f/C)),h=a(n(o/4096*4)/4,.5,1);var m;return[v*h,p*h,i]})(A*v,S*v);H(i,{display:"flex",alignItems:"center"}),H(m,{position:"relative",width:`${A}px`,height:`${S}px`,margin:"0 auto",touchAction:"none"}),setTimeout((()=>{L=m.offsetLeft,X=m.offsetTop}),0),g.width=T,g.height=T,H(g,{position:"absolute",inset:"auto 0 0 auto",width:T+"px",maxWidth:"33%"}),x.width=d.width=p,x.height=d.height=h,b.width=1.5*A,b.height=1.5*S,[x,b,d].map((e=>H(e,{width:"100%",pointerEvents:"none"}))),y.setup(g),w.setup(x),Fe(!0),te=0,ne=1},Se=()=>{if(le&&se.length){const e=h();(e-Z)/(1e3/60)>1.5&&e>500?Q++:Q=0,ie&&1<J&&Q>8&&!N()&&(Q=0,J=s(1,J-1));const t=se[te].length/2;if(ne<t)for(let e=0;e<J&&!(ne>=t);e++)_e({stepping:!0});else te<se.length-1?(te+=1,ne=1):we||(be?ke():we=!0);Z=e}fe||Re?(H(b,{display:"block"}),((e,t,n,o)=>{const[r,s]=W(e);$(e),Y(e,(()=>{((e,t=1,n="")=>{e.globalAlpha=t,e.globalCompositeOperation=n})(e,.5),e.fillRect(0,0,r,s)})),Y(e,(()=>{e.translate(r/2,s/2),e.lineWidth=.004*r,e.strokeStyle="#0ff",t.map((t=>{V(e,t),e.stroke()})),e.lineWidth=.002*r,e.strokeStyle="#ff0",n.map((t=>{V(e,t),e.stroke()})),e.strokeStyle="#0f0",V(e,o),e.stroke(),e.fillStyle="#ff0",((e,t)=>{const[n,o]=W(e);for(let r=0,s=t.length;r<s;r+=2){const s=t[r]*n*.5+.5,u=t[r+1]*o*.5+.5;O(e,s,u,.004*n),e.fill()}})(e,o),e.stroke()}))})(oe,se,ue,Ee)):(H(b,{display:"none"}),$(oe)),p(Se)},Le=e=>{J=e,ie=!1};o.Act.setRate=Le;const Xe=()=>{H(g,{visibility:ce?"visible":"hidden"})},ke=()=>{se.push(ee([se[se.length-1],E(2,5),[R(.2,1),R(.2,1)]])),Me()},Ce=e=>{e.preventDefault(),e.stopPropagation()};v(o,"resize",(()=>!N()&&Ie())),v(o,"keydown",(e=>{const t=e.key.toLowerCase();var n;"s"===t&&(Ce(e),!Te&&(Te=!0,n=e.shiftKey,_e({exporting:!0,shift:n}),Te=!1))," "===t&&Ce(e)})),v(o,"keyup",(e=>{const t=e.key.toLowerCase(),n=parseInt(t,10);!isNaN(n)&&n&&Le(n)," "===t&&(Z=h(),le=!le),"\\"!==t||be||(fe=!fe),"escape"===t&&Ie(!0),"backspace"!==t||be||((e=!1)=>{e?(se=[],ue=[]):(se.pop(),ue.pop()),Ee=[],Ie(!0)})(e.shiftKey),"`"===t&&(ce=!ce,Xe())}));const Be=e=>[(e.clientX-L)/A*2-1,(e.clientY-X)/S*2-1],ze=e=>{const t=Be(e),n=Ee.slice(-2);return[t,l(...t,...n)]},Ge=()=>{clearTimeout(q),q=setTimeout((()=>{De=!1}),300)},Ne=e=>{De?(clearTimeout(q),Ae=!0):(De=!0,Ge()),Ae&&(Re=!0,Ee=[...Be(e)])},We=e=>{if(Re){const[t,n]=ze(e);n>.12&&Ee.push(...t)}},Ye=e=>{if(Ae||Ge(),Re){if(Re=!1,4>Ee.length)return;const[t,n]=ze(e);n>.0804&&Ee.push(...t),ue.push(Ee),se.push(K(Ee,.5,B/Ee.length*8.333333333333334*2*j(Ee),!1)),Me(),ye&&(()=>{const e=se.push(ee([ue[ue.length-1],E(1,3),[R(.2,.8),R(.2,.8)]]));se.push(e),ue.push(e),Me()})()}};be||(v(m,"mousedown",Ne),v(c,"mousemove",We),v(c,"mouseup",Ye),v(m,"touchstart",(e=>{e.clientX=e.touches[0].clientX,e.clientY=e.touches[0].clientY,Ne(e)})),v(c,"touchmove",(e=>{e.clientX=e.touches[0].clientX,e.clientY=e.touches[0].clientY,We(e)})),v(c,"touchend",(e=>{e.clientX=e.changedTouches[0].clientX,e.clientY=e.changedTouches[0].clientY,Ye(e)}))),be?ke():(e=>{se.push(...e[1]),Me(),Ue=e[2]})(de),Xe(),Ie(!0),p(Se)})()})();
(()=>{"use strict";var e=Math.atan2,t=Math.PI,n=Math.ceil,o=Math.pow,r=Math.sqrt,s=Math.max,u=Math.min;const a=(e,t,n)=>s(u(e,n),t),c=(e,t,n)=>e*(1-n)+t*n,i=(e,t,n)=>[e[0]+n*(t[0]-e[0]),e[1]+n*(t[1]-e[1])],l=(e,t,n,o)=>r((n-e)*(n-e)+(o-t)*(o-t)),f=(e=1,t=0,n=[0,0],o=[1,1])=>[n[0]+e*Math.cos(t)*o[0],n[1]+e*Math.sin(t)*o[1]],v=(e,t)=>[e[0]*t[0],e[1]*t[1]],p=o(2,-32),h=32557,m=19605,d=new Uint16Array(4),x=new DataView(d.buffer),g=()=>{const e=d[0],t=d[1],n=d[2],o=d[3],r=0|33103+h*e,s=0|63335+h*t+(m*e+(r>>>16)),u=0|31614+h*n+m*t+(62509*e+(s>>>16));d[0]=r,d[1]=s,d[2]=u,d[3]=5125+h*o+(m*n+62509*t)+(22609*e+(u>>>16));const a=(o<<21)+((o>>2^n)<<5)+((n>>2^t)>>11);return p*((a>>>(o>>11)|a<<(31&-(o>>11)))>>>0)},b=()=>2*g()-1,y=(e,t=0)=>{const n=16,o=65535,r=255;for(var s,u=1540483477,a=e.length,c=t^a,i=0;4<=a;)s=((s=e[i]&r|(e[++i]&r)<<8|(e[++i]&r)<<16|(e[++i]&r)<<24)&o)*u+(((s>>>n)*u&o)<<n),c=(c&o)*u+(((c>>>n)*u&o)<<n)^(s=((s^=s>>>24)&o)*u+(((s>>>n)*u&o)<<n)),a-=4,++i;switch(a){case 3:c^=(e[i+2]&r)<<n;case 2:c^=(e[i+1]&r)<<8;case 1:c=((c^=e[i]&r)&o)*u+(((c>>>n)*u&o)<<n)}return c=((c^=c>>>13)&o)*u+(((c>>>16)*u&o)<<16),(c^=c>>>15)>>>0},T=e=>{const t=~~((e.length-2)/2),n=[];for(let o=0;o<t;o++){const t=2+2*o;n.push(parseInt(e.slice(t,t+2),16))}const o=y(n,1690382925),r=y(n,72970470);x.setUint32(0,o),x.setUint32(4,r)},w=(e=.5)=>g()<e,A=(e=.5)=>g()<e?-1:1,R=(e,t)=>c(e,t,g()),E=(e,t)=>~~R(e,t+1),P="precision highp float;",U="\nattribute vec2 aPos;\nuniform vec2 uRes;\nuniform float uFlipY;\nvarying vec2 vUv;\nvoid main(){\nvec2 uv=aPos/uRes;\ngl_Position=vec4((uv*2.-1.)*vec2(1.,uFlipY),0.,1.);\nvUv=uv;\n}\n",D="#define PI 3.1415926535",M="mat2 r2d(float t){return mat2(cos(t),sin(t),-sin(t),cos(t));}",F="\n// Ian McEwan, Ashima Arts. Copyright (C) 2011 Ashima Arts. All rights reserved. MIT License.\nvec3 mod289(vec3 x){return x-floor(x*(1./289.))*289.;}\nvec2 mod289(vec2 x){return x-floor(x*(1./289.))*289.;}\nvec3 permute(vec3 x){return mod289(((x*34.)+1.)*x);}\nfloat noise(vec2 v){const vec4 C=vec4(.211324865405187,.366025403784439,-.577350269189626,.24390243902439);vec2 i=floor(v+dot(v,C.yy));vec2 x0=v-i+dot(i,C.xx);vec2 i1;i1=(x0.x>x0.y)?vec2(1.,0.):vec2(0.,1.);vec4 x12=x0.xyxy+C.xxzz;x12.xy-=i1;i=mod289(i);vec3 p=permute(permute(i.y+vec3(0.,i1.y,1.))+i.x+vec3(0.,i1.x,1.));vec3 m=max(.5-vec3(dot(x0,x0),dot(x12.xy,x12.xy),dot(x12.zw,x12.zw)),0.);m=m*m;m=m*m;vec3 x=2.*fract(p*C.www)-1.;vec3 h=abs(x)-.5;vec3 ox=floor(x+.5);vec3 a0=x-ox;m*=1.79284291400159-.85373472095314*(a0*a0+h*h);vec3 g;g.x=a0.x*x0.x+h.x*x0.y;g.yz =a0.yz*x12.xz+h.yz*x12.yw;return 130.*dot(m,g);}\n",_="noise(vec2(uA*uM*2.,uI))",I=(e,t=[])=>{const n=[...e];return t.map((e=>{let t=n.find((t=>e[0]===t[0]));t?Object.assign(t,e):n.push(e)})),n},S=(e,t,n)=>{const o=e.createShader(t);return e.shaderSource(o,n),e.compileShader(o),e.getShaderParameter(o,e.COMPILE_STATUS)?o:void e.deleteShader(o)},L=(e,t=33071,n=9728)=>{const o=e.createTexture();return e.bindTexture(e.TEXTURE_2D,o),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,n),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,n),o},X=(e,t)=>{e.bindFramebuffer(e.FRAMEBUFFER,t)};var k=(e,t)=>{let n,o,r,s,u,a,c,i=[],l=[],f=0;return{setup:v=>{n=v.getContext("webgl",{depth:!1,antialias:!1,preserveDrawingBuffer:!0}),a=v.width,c=v.height,o=((e,t,n)=>{const o=e.createProgram();return e.attachShader(o,t),e.attachShader(o,n),e.linkProgram(o),e.getProgramParameter(o,e.LINK_STATUS)?o:void e.deleteProgram(o)})(n,S(n,n.VERTEX_SHADER,e),S(n,n.FRAGMENT_SHADER,t)),r=n.getAttribLocation(o,"aPos"),s=n.getUniformLocation(o,"uFlipY"),u=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,u),((e,t,n,o,r)=>{e.bufferData(e.ARRAY_BUFFER,new Float32Array([0,0,0+o,0,0,0+r,0,0+r,0+o,0,0+o,0+r]),e.STATIC_DRAW)})(n,0,0,a,c);for(let e=0;2>e;++e)i[e]=L(n),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,a,c,0,n.RGBA,n.UNSIGNED_BYTE,null),l[e]=n.createFramebuffer(),n.bindFramebuffer(n.FRAMEBUFFER,l[e]),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,i[e],0);f=0},update:e=>{n.useProgram(o),n.enableVertexAttribArray(r),n.bindBuffer(n.ARRAY_BUFFER,u),n.vertexAttribPointer(r,2,n.FLOAT,!1,0,0),n.viewport(0,0,a,c);const t=()=>n.drawArrays(n.TRIANGLES,0,6),v=e=>e instanceof WebGLTexture;n.uniform1f(s,1),X(n,l[f%2]),t();const p=[["uRes","v2",[a,c]],["uFrame","i",f],["uBuffer","t",i[f%2]],...e.map(((e,t)=>{if("t"===e[1]&&!v(e[2])){const o=L(n,e[3],e[4]);n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,e[2]),i[t+2]=o}return e}))];let h=0;p.map((([e,t,r])=>{const s=[t,r,n.getUniformLocation(o,e),h];return"t"===t&&(0<h&&!v(s[2])&&(s[1]=i[h+1]),h++),s})).map((e=>{((e,[t,n,o,r])=>{"b"===t?e.uniform1i(o,!0===n?1:0):"i"===t?e.uniform1i(o,n):"f"===t?e.uniform1f(o,n):"v2"===t?e.uniform2f(o,...n):"v3"===t?e.uniform3f(o,...n):"v4"===t?e.uniform4f(o,...n):"t"===t&&(e.uniform1i(o,r),e.activeTexture(e.TEXTURE0+r),e.bindTexture(e.TEXTURE_2D,n))})(n,e)})),X(n,null),n.uniform1f(s,-1),t(),f++}}};const C=3/4,B=100,z={Light:"#eae7e1",Dark:"#1f1e1c"},G={Tiny:0,Small:.2,Medium:.4,Large:.6,Huge:.8,Epic:1},N=()=>navigator.userAgent.match(/HeadlessChrome/i),W=e=>[e.canvas.width,e.canvas.height],Y=(e,t)=>{e.save(),t(),e.restore()},$=e=>{Y(e,(()=>{e.clearRect(0,0,W(e)[0],W(e)[1])}))},O=(e,n=0,o=0,r=1)=>{e.beginPath(),e.arc(n,o,r,0,2*t),e.closePath()},V=(e,t)=>{const[n,o]=W(e);e.beginPath(),e.moveTo(t[0]*n*.5+.5,t[1]*o*.5+.5);for(let r=2,s=t.length;r<s;r+=2)e.lineTo(t[r]*n*.5+.5,t[r+1]*o*.5+.5)},j=e=>{let t=0,n=e[0],o=e[1];for(let s=2,u=e.length-1;s<u;s+=2){const u=e[s],a=e[s+1],c=u-n,i=a-o;t+=r(c*c+i*i),n=u,o=a}return t},H=(e,t)=>{const n=Object.keys(t);for(let o=0;o<n.length;o++)e.style[n[o]]=t[n[o]]},K=(e,t=.5,n=25,o=!1,r=!1)=>{n=2*~~(n/2);const s=e.length,u=new Float32Array((s-2)*n+2+(o?2*n:0));let a=0;const c=new Float32Array(4*(n+2));let i=4,l=[...e];o?(l.unshift(e[s-1]),l.unshift(e[s-2]),l.push(e[0],e[1])):(l.unshift(e[1]),l.unshift(e[0]),l.push(e[s-2],e[s-1])),c[0]=1;for(let e=1;e<n;e++){const t=e/n,o=t*t,r=o*t,s=2*r,u=3*o;c[i++]=s-u+1,c[i++]=u-s,c[i++]=r-2*o+t,c[i++]=r-o}c[++i]=1;const f=(e,o,r)=>{for(let s=2;s<r;s+=2){const r=e[s],c=e[s+1],i=e[s+2],l=e[s+3],f=(i-e[s-2])*t,v=(l-e[s-1])*t,p=(e[s+4]-r)*t,h=(e[s+5]-c)*t;for(let e=0;e<n;e++){const t=e<<2,n=o[t],s=o[t+1],m=o[t+2],d=o[t+3];u[a++]=n*r+s*i+m*f+d*p,u[a++]=n*c+s*l+m*v+d*h}}};f(l,c,s),o&&(l=[],l.push(e[s-4],e[s-3],e[s-2],e[s-1]),l.push(e[0],e[1],e[2],e[3]),f(l,c,4));const v=o?0:e.length-2;u[a++]=e[v],u[a]=e[v+1];const p=~~(1.33*n+30*t),h=p-p%2;return r?u.slice(h,u.length-h):u},q=()=>{const e=[0,0,0];return e[E(0,2)]=1,e},J=()=>{const e=w();return[e,!e&&w(.33)]},Q=([e=[0,0],n=0,o=1,r=1])=>{const s=[],u=-.5*t;return s.push(...f(o/2,u+n+.025*t*r*R(.5,1)*A(),e),...f(o/4,u+n,e),...f(o/4,u+n+t,e),...f(o/2,u+n+t+.035*t*r*R(.5,1)*A(),e)),K(s,.5,B*j(s)*4,!1)},Z=([e,t,n=[0,1],r=12,s=0,u=!0,a=!1],f)=>{const p=[],h=[],m=c(.33,12,s);let d=[...e],x=-1;p.push(...v(d,f));for(let o=0;o<r;o++){const s=(o+1)/(r+1),[a,c]=i(e,t,s),p=l(a,c,d[0],d[1]),m=[(c-d[1])/p,-(a-d[0])/p],g=R(n[0],n[1])*(u?x*=-1:A());h.push(...v([a+m[0]*g,c+m[1]*g],f)),d=[a,c]}p.push(...h),p.push(...v(t,f));const g=B/r*4*o(j(p),1.15)*(1+8*o(s,1.33));return K(p,m,g,!1,a)},ee=([e,t,n=[1,1],r,s,u])=>{const a=()=>[R(-.9,.9),R(-.9,.9)],i=e?e.slice(-4):[],l=e?[i[2]-i[0],i[3]-i[1]]:[0,0],f=e?[i[2]+-.2*l[0],i[3]+-.2*l[1]]:r||a();return(([e,t=[0,0],n=[0,0],o=[1,1],r,s=!1])=>{const u=[t[0]-.25*n[0],t[1]-.25*n[1]],a=[u[0]+2*n[0],u[1]+2*n[1]],i=[...u,...a],l=r||.33*g(),f=c(.5,6,l);for(let t=0;t<e;t++){const e=i.slice(-2);i.push(e[0]+(o[0]+n[0])*b(),e[1]+(o[1]+n[1])*b())}return K(i,f,B*j(i)*2*(1+2*l),!1,s)})([e?t:3,((e,t)=>-1<=e&&1>=e&&-1<=t&&1>=t)(...f)?f:a(),l,[o(n[0],2),o(n[1],2)],s,u])},te=([e,n,r,s=0,u=[1,1],a=1,c=!1],i)=>{const l=[],f=.03*o(g(),3),p=w(.67);for(let m=0,d=e*n*(c?2:1);m<d;m++){const d=~~(m/n),x=m%n;l.push(Q([v([c?b()*o(g(),.7)*(p?1.33:2)*u[0]:-u[0]+2*u[0]*(x/(n-1))+A()*f,c?b()*o(g(),.7)*(p?1.33:2)*u[1]:-u[1]+2*u[1]*(d/(e-1))+A()*f],i),(h=r,isNaN(h)?2*t*g():r),.09+.03*g()+.35*s,a]))}var h;return l},ne=([e,t=[1,1,5],n=!1,r=!1,s=!1],a)=>{const i=[];let l=w();for(let f=0;f<e;f++){const v=1-.04*g(),p=(r||s)&&l?-1:1,h=1<e?t[n?0:1]*c(-1,1,f/(e-1))*u(e/t[2],1):0;i.push(Z([[n?h:-t[0]*v*p,n?-t[1]*v*p:h],[n?h:t[0]*v*p,n?t[1]*v*p:h],[0,o(R(.01,.05),1.2)],E(4,n?12:9),R(.015,.03)],a)),l=r||s&&w()?!l:l}return i},oe=(o,r)=>{const a=[],c=[],i=w(.33),l=((e,o,r=1,a=30)=>{const c=r*Math.SQRT1_2,i=n(e/c),l=n(o/c),v=Array(i*l),p=[],h=(t,n)=>0<t&&t<e&&0<n&&n<o,m=(e,t)=>[~~(e/c),~~(t/c)],d=(e,t)=>{const n=m(e,t),o=s(n[0]-2,0),a=s(n[1]-2,0),c=u(n[0]+3,i),f=u(n[1]+3,l);for(let n=a;n<f;++n){const s=n*i;for(let n=o;n<c;++n){const o=v[s+n];if(o){const n=o[0]-e,s=o[1]-t;if(n*n+s*s<r*r)return!1}}}return!0},x=(e,t)=>{const n=[e,t],o=m(e,t);return p.push(n),v[i*o[1]+o[0]]=n,n};return()=>{if(!p.length)return x(g()*e,g()*o);do{const e=~~(g()*p.length),n=p[e];for(let e=0;e<a;++e){const[e,o]=f(R(r,2*r),2*t*g(),n);if(h(e,o)&&d(e,o))return x(e,o)}p.splice(e,1)}while(p.length)}})(2,2,R(.1,.3)*(1+r)*(i?.57:1)),p=w(.67)?0:.2+.1*r;let h;do{h=l(),h&&c.push(h)}while(h);for(let n=0,r=c.length;n<r;n++){const r=v(c[n].map((e=>e-1)),[1-p,1-p*o[1]]);a.push(Q([r,i?e(r[1],r[0])+t/2:2*t*g(),R(.09,.18),R(1,2)]))}return[a,q()]},re=e=>[te([E(4,14),E(3,8),0,.12,[.6,.7/e[1]],R(.5,1.5),w(.2)],e),w()?[1,0,0]:[0,0,1]],se=e=>[te([E(4,12),E(3,10),-t/2,0,[.6,.67/e[1]],1.67,w(.2)],e),[0,1,0]],ue=e=>[ne([E(1,10),[.75,1/e[1]*.7,5],!1,...J()],e),[0,1,0]],ae=e=>[ne([E(1,18),[1.1,1/e[1]*.95,7],!1,...J()],e),[0,1,0]],ce=e=>[ne([E(1,5),[.5,1/e[1]*.8,3],!0,...J()],e),w()?[1,0,0]:[0,0,1]],ie=e=>[ne([E(1,8),[.95,1/e[1]*1.1,6],!0,...J()],e),w()?[1,0,0]:[0,0,1]],le=e=>{const t=w(.8)?1:w(.8)?2:3,n=[];for(let r=0;r<t;r++){const t=w(.33),r=g(),s=t?c(0,.1,r)+.25*w(.2):c(.4,1,o(r,2)),u=A()*R(0,.4)*(1+.5*(1-r)),a=A(),i=t?w(.2)?0:-1.25:w(.33)?1:0;n.push(Z([[u,-(1-.33*i-.25*(t?1:0))*(1/e[1])*a],[-u,(1-.33*i-.25*(t?1:0))*(1/e[1])*a],[.15,.35+.15*(t?1:0)],t?E(8,14):E(4,9),s,t,!t],e))}return[n,q()]},fe=()=>{const e=E(8,12),t=[];for(let n=0;n<e;n++)t.push(ee([t[t.length-1],3,[R(.3,.9),R(.3,.9)],[R(-.5,.5),R(-.5,.5)],1,!0]));return[t,q()]},ve="undefined"==typeof tokenData?(
_Act of Emotion_ investigates digitally-facilitated abstract expressionism: the act of painting itself as a means of expression, extended into mechanical reach. A reflection upon the future of automation, machine consciousness, creativity, and humankind’s inevitable consequences. As we await the next leap, we cling desperately to our belief that emotive art is an exclusively human experience. Inspired by those that came before—pioneering expressionists and contemporaries alike—the system engages in new methods of painting, free from traditionally accepted physical boundaries and artistic expectations. Action painting for the Connected Age; the system is in perpetual concert, recited in real-time and on-demand. Questioned by Colin McCahon, and recontextualised here through a generative lens: _How to make a painting beat like, and with, a human heart._ The machine’s movements are precise by default, grounded in mathematics. Organic expression must be introduced by twisting and destabilising; a process of broadening bounds that probes the subconscious of both artist and audience. Confrontingly minimal abstract compositions highlight the tension between rigid mechanical precision and fluid human intuition. Striping and stippling, swooping and darting; noisy automatism contrasted with coded instinct. Gestural abstraction applied with simulation of brush and emulation of media. Presence discovered through colour, texture, light and space; the works emerge as physically-manifested in digital form. Are these painted works analogous to physical counterparts? Can a machine successfully emotionally connect through this practice? Let us consider both the intent and the act that realise a painted artwork. _“Painting is a state of being. Painting is self-discovery.”_ — Jackson Pollock &nbsp; --- &nbsp; # Controls: - **[spacebar]** Pause/resume exhibit - **[escape]** Reset exhibit - **[S]** Export a still image at the current render size - **_Double Click/Tap_** to provide a human touch # Automatic: - Render resolution upscales with viewport dimensions. Future exhibits will enhance alongside hardware advance. - Playback cadence is hardware-dependent and downscales when limited by hardware. - "**Perpetual**" tokens continue their performance indefinitely &nbsp; --- &nbsp; # Printing: Generatively signed giclée print renditions available up to 36x48" / A0. &nbsp; --- &nbsp;