0x35ed…9501

All memos sent from and to 0x35ed…9501.

0x35ed1634…9501·#16,305,834·0xf54e2f86…12ba18
William Mapan EditionsAddress: call to non-contractAddress: call to non-contractAddress: low-level delegate call failedAddress: low-level delegate call failed
Anni, in 1935, you came here in Mexico. The first trip of a long series that inspired you. As a human. As an artist. It was an important step in your artistic journey. You learned and discovered so much from this culture. Its influence awakened you even further. Your craft evolved. Now I wonder, Anni… what did you find there? How can I evolve myself? How to awake? With this series, inspired by you, my practice and my own experience , I found something, too. Like you, I like to explore "tactile sensibility" along with colors. How can I connect with someone else with those things alone? Do we really need to touch things to feel them? I wonder… Have you ever tried to weave with algorithmic paint, Anni? Maybe you did actually? I saw you were already using paint to sketch your pieces… I'm curious what you would be able to do with the tools of my times… So many questions but so little time, isn't it? Best, William
e:"base",c:["#dfd9b9","#025ef2"],w:[.0234375,.640625]}]},{}],40:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=_(e("./lib/nanogl/program")),o=e("./settings"),i=_(e("./glsl/base.vert")),s=(_(e("./glsl/artwork.frag")),_(e("./glsl/artwork_pass1.frag"))),a=_(e("./glsl/artwork/grain.frag")),l=_(e("./glsl/artwork/curl.frag")),c=_(e("./glsl/artwork/flow.frag")),d=_(e("./glsl/artwork/perlin.frag")),u=(_(e("./glsl/square.vert")),_(e("./glsl/square.frag")),_(e("./glsl/math/math.glsl"))),f=_(e("./glsl/math/transform.glsl")),h=_(e("./glsl/noise/common.glsl")),g=_(e("./glsl/noise/curl.glsl")),v=_(e("./glsl/noise/pnoise3d.glsl")),p=_(e("./glsl/noise/snoise3d.glsl")),b=_(e("./glsl/noise/cell2d.glsl")),m=_(e("./glsl/effects/ptdepth.glsl")),x=_(e("./glsl/effects/grain.glsl")),y=_(e("./glsl/blending/blending.glsl"));function _(e){return e&&e.__esModule?e:{default:e}}const w={math:u.default,transform:f.default,noisecommon:h.default,curl:g.default,pnoise3d:v.default,snoise3d:p.default,cell2d:b.default,ptdepth:m.default,grain:x.default,blending:y.default};r.default.debug=!o.settings.isBuild;let S=-1;const R=(e=>{let t=null,n=null,o={};const u=e=>{for(const t of Object.keys(w))e=e.replace(`<${t}>`,w[t]);return e},f=()=>{const e=h();for(const t of Object.keys(o)){const n=o[t],r=u(n.vert),i=u(n.frag);n.prg.compile(r,i,e)}},h=()=>{let e="#version 300 es\n";return e+="precision "+(n?"highp":"mediump")+" float;\n",e};return{init:e=>{t=e,n=(e=>{const t=e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT);return e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0&&t.precision>0})(e),o={artwork_pass1:{prg:new r.default(t),vert:i.default,frag:s.default},grain:{prg:new r.default(t),vert:i.default,frag:a.default},curl:{prg:new r.default(t),vert:i.default,frag:l.default},flow:{prg:new r.default(t),vert:i.default,frag:c.default},perlin:{prg:new r.default(t),vert:i.default,frag:d.default}},f()},makeProgram:(e,n,i)=>{const s=i.name||"program_"+S++,a=new r.default(t);let l=h();l+=i.defs||"";const c=u(e),d=u(n);return a.compile(c,d,l),o[s]={prg:a},a},get:e=>o[e].prg}})();n.default=R},{"./glsl/artwork.frag":5,"./glsl/artwork/curl.frag":6,"./glsl/artwork/flow.frag":7,"./glsl/artwork/grain.frag":8,"./glsl/artwork/perlin.frag":9,"./glsl/artwork_pass1.frag":10,"./glsl/base.vert":11,"./glsl/blending/blending.glsl":12,"./glsl/effects/grain.glsl":13,"./glsl/effects/ptdepth.glsl":14,"./glsl/math/math.glsl":15,"./glsl/math/transform.glsl":16,"./glsl/noise/cell2d.glsl":17,"./glsl/noise/common.glsl":18,"./glsl/noise/curl.glsl":19,"./glsl/noise/pnoise3d.glsl":20,"./glsl/noise/snoise3d.glsl":21,"./glsl/square.frag":22,"./glsl/square.vert":23,"./lib/nanogl/program":30,"./settings":43}],41:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.R=void 0;let r=tokenData||function(e){let t={},n="0x";for(var r=0;r<64;r++)n+=Math.floor(16*Math.random()).toString(16);return t.hash=n,t.tokenId=(1e6*e+Math.floor(1e3*Math.random())).toString(),t}(123);const o=new class{constructor(){this.useA=!1,this.tk=r,console.log("hash",this.tk.hash);let e=function(e){let t=parseInt(e.substr(0,8),16),n=parseInt(e.substr(8,8),16),r=parseInt(e.substr(16,8),16),o=parseInt(e.substr(24,8),16);return function(){t|=0,n|=0,r|=0,o|=0;let e=(t+n|0)+o|0;return o=o+1|0,t=n^n>>>9,n=r+(r<<3)|0,r=r<<21|r>>>11,r=r+e|0,(e>>>0)/4294967296}};this.prngA=new e(r.hash.substr(2,32)),this.prngB=new e(r.hash.substr(34,32));for(let e=0;e<1e6;e+=2)this.prngA(),this.prngB()}random(){return this.useA=!this.useA,this.useA?this.prngA():this.prngB()}range(e,t){return e+(t-e)*this.random()}int(e,t){return Math.floor(this.range(e,t+1))}bool(e){return this.random()<e}pick(e){return e[this.int(0,e.length-1)]}};n.R=o},{}],42:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Renderer=void 0;var r=e("./settings");n.Renderer=class{constructor(e={}){const t=document.createElement("canvas");t.id="artwork",t.style.boxShadow=r.settings.isBuild?"":"0px 2px 12px -2px rgb(0 0 0 / 15%)",this.dpr=r.settings.dpr,this.width=e.width||window.innerWidth,this.height=e.height||window.innerHeight,this.heightPadding=r.settings.isBuild?0:80,this._isPlaying=!1,this._displayWidth=this.width,this._displayHeight=this.height,this.canvas=t,t.width=this.width*this.dpr,t.height=this.height*this.dpr,this.gl=t.getContext("webgl2",{preserveDrawingBuffer:!1,premultipliedAlpha:!1}),this._frame=this._frame.bind(this),this._resize=this._resize.bind(this),this._rafId=0,this._init()}play(){this._isPlaying||(this._isPlaying=!0,this._frame())}pause(){this._isPlaying&&(this._isPlaying=!1)}_frame(){this._isPlaying&&(this._rafId=requestAnimationFrame(this._frame),this.render())}_init(){this._bindEvents(),this._resize(),this.init()}_resize(){window;const e=window.innerHeight,t=this.width,n=this.height,r=this.canvas;this._displayWidth=t*(e-this.heightPadding)/n,this._displayHeight=e-this.heightPadding,r.width=t*this.dpr,r.height=n*this.dpr,r.style.width=`${this._displayWidth}px`,r.style.height=`${this._displayHeight}px`}_bindEvents(){window.addEventListener("resize",this._resize)}init(){}render(){}resize(){}}},{"./settings":43}],43:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.settings=void 0;var r=e("./random"),o=e("./palettes");let i=Math.floor(r.R.random()*o.palettes.length);r.R.random()>.96&&(i=0);let s=o.palettes[i];console.log("palette:",s.name);const a=r.R.random()>.3?1:-1;let l=[r.R.pick([2.5,4,6]),r.R.pick([.5,1])];if(-1==a){const e=l[0];l[0]=l[1],l[1]=e}let c=r.R.random()>.4,d=[.3,.5,r.R.range(.1,.2),r.R.range(.4,.55)];r.R.random()>.7&&(d=[.3,.5,.1,100]);const u=[r.R.range(-1,1),r.R.range(-1,1)],f=[r.R.range(-1,1),r.R.range(-1,1)];let h=r.R.random()>.5?.7:1,g=r.R.random()>.5||0==i?.5:1;h<1&&(g=r.R.range(.7,1));let v=.1,p=[.025,.05,v];r.R.random()>.5&&1==h&&p.push(.05),r.R.random()>.95&&0!==i&&(g=.5,h=.5,v=.7,p=[.025,.05,v]);let b=250,m=r.R.range(1.2,1.5);r.R.random()>.5&&(b=2500,m=1.1);const x=r.R.random()>.85?0:1;let y=null;r.R.random()>.7&&.7!==v&&(y=r.R.pick([.001,.002,.003]));const _=[r.R.range(1,10),r.R.range(1,3)];r.R.random()>.8&&(_[0]=r.R.range(40,60),_[1]=10,d[0]=r.R.range(.3,.7)),r.R.random()>9&&.7!=v&&(_[0]=r.R.range(4,10),_[1]=r.R.range(20,300)),r.R.random()>.92&&.7!=v&&(_[0]=r.R.range(1e3,2e3));let w=r.R.range(2.5,4);(r.R.random()>.85||0==i)&&(w=0);const S=r.R.random()>.4,R={isBuild:true,dimensions:[576,1024],dpr:2,dprDimensions:[],bgColor:"beige",animated:!0,palette:s,paletteIdx:i,glbSpeedScale:g,brushSizeScl:h,brushSizeOpts:p,brushMaxSize:v,brushMaxSize:v,brushSVarMax:m,brushRotationScl:x,eraserFreq:r.R.pick([2,3,4,5]),useEraser:c,shouldSlowDown:S,smoothOverride:y,pivotPaintForce:r.R.random()>.1?r.R.range(2,4):1,prevScale:l,pushForce:_,pivotScl:w,currentY:0,flow1Offset:u,flow2Offset:f,flowsFreq:d,rnd:r.R.random()};n.settings=R,R.dprDimensions=R.dimensions.map((e=>e*R.dpr))},{"./palettes":39,"./random":41}],44:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.rgbToHex=n.lerp=n.isBetween=n.hslToRgb=n.hexToHSL=n.fit=n.clamp=n.absPxToRel=void 0;var r=e("../settings");n.clamp=(e,t,n)=>Math.min(Math.max(e,t),n);n.fit=(e,t,n,r,o)=>r+(o-r)*(e-t)/(n-t);n.lerp=(e,t,n)=>e*(1-n)+t*n;n.rgbToHex=(e,t,n)=>"#"+((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1);n.hslToRgb=(e,t,n)=>{t/=100,n/=100;let r=(1-Math.abs(2*n-1))*t,o=r*(1-Math.abs(e/60%2-1)),i=n-r/2,s=0,a=0,l=0;return 0<=e&&e<60?(s=r,a=o,l=0):60<=e&&e<120?(s=o,a=r,l=0):120<=e&&e<180?(s=0,a=r,l=o):180<=e&&e<240?(s=0,a=o,l=r):240<=e&&e<300?(s=o,a=0,l=r):300<=e&&e<360&&(s=r,a=0,l=o),s=Math.round(255*(s+i)),a=Math.round(255*(a+i)),l=Math.round(255*(l+i)),{r:s,g:a,b:l}};n.hexToHSL=e=>{if(e.s)return e;let t=0,n=0,r=0;4==e.length?(t="0x"+e[1]+e[1],n="0x"+e[2]+e[2],r="0x"+e[3]+e[3]):7==e.length&&(t="0x"+e[1]+e[2],n="0x"+e[3]+e[4],r="0x"+e[5]+e[6]),t/=255,n/=255,r/=255;let o=Math.min(t,n,r),i=Math.max(t,n,r),s=i-o,a=0,l=0,c=0;return a=0==s?0:i==t?(n-r)/s%6:i==n?(r-t)/s+2:(t-n)/s+4,a=Math.round(60*a),a<0&&(a+=360),c=(i+o)/2,l=0==s?0:s/(1-Math.abs(2*c-1)),l=+(100*l).toFixed(1),c=+(100*c).toFixed(1),{h:a,s:l,l:c}};n.absPxToRel=e=>r.SETTINGS.WIDTH*e/4961;n.isBetween=(e,t,n)=>e>=t&&e<=n},{"../settings":43}],45:[function(e,t,n){(function(e){(function(){e.CANVAS_SKETCH_DEFAULT_STORAGE_KEY=window.location.href}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[38,45]);
ze(e,t){this.width===e&&this.height===t||(this.width=e,this.height=t,this._valid=!1)}allocate(){!this._valid&&this.width>0&&this.height>0&&(this._storage(),this._valid=!0)}bind(){this.gl.bindRenderbuffer(i,this.id)}dispose(){this.gl.deleteRenderbuffer(this.id)}_storage(){const e=this.gl;e.bindRenderbuffer(i,this.id),this.samples>0&&(0,r.isWebgl2)(e)?e.renderbufferStorageMultisample(i,this.samples,this.format,this.width,this.height):e.renderbufferStorage(i,this.format,this.width,this.height),e.bindRenderbuffer(i,null)}}},{"./types":34}],32:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=o(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var a=i?Object.getOwnPropertyDescriptor(e,s):null;a&&(a.get||a.set)?Object.defineProperty(r,s,a):r[s]=e[s]}r.default=e,n&&n.set(e,r);return r}(e("./texture-base"));function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(o=function(e){return e?n:t})(e)}const i=3553;n.default=class extends r.default{constructor(e,t,n,o){super(e,t,n,o),this.textureType=r.TextureType.TEXTURE_2D,this._target=i,e.bindTexture(i,this.id),this.setFilter(!0)}fromImage(e){const t=this.gl;this.width=e.width,this.height=e.height,t.bindTexture(i,this.id),t.texImage2D(i,0,this.internal,this.format,this.type,e)}fromData(e,t,n=null){const r=this.gl;this.width=e,this.height=t,n=n||null,r.bindTexture(i,this.id),r.texImage2D(i,0,this.internal,e,t,0,this.format,this.type,n)}}},{"./texture-base":33}],33:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.TextureType=void 0;var r=e("./utils");let o=0;var i;n.TextureType=i,function(e){e[e.NONE=0]="NONE",e[e.TEXTURE_2D=3553]="TEXTURE_2D",e[e.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",e[e.TEXTURE_CUBE=34067]="TEXTURE_CUBE",e[e.TEXTURE_3D=32879]="TEXTURE_3D"}(i||(n.TextureType=i={}));n.default=class{constructor(e,t,n,r){this.textureType=i.NONE,this.format=0,this.internal=0,this.type=0,this._uid=o++,this.gl=e,this.id=e.createTexture(),this.width=0,this.height=0,this.setFormat(t,n,r)}setFormat(e,t,n){this.format=e||this.gl.RGB,this.internal=n||this.format,this.type=t||this.gl.UNSIGNED_BYTE}bind(e){const t=this.gl;void 0!==e&&t.activeTexture(t.TEXTURE0+(0|e)),t.bindTexture(this._target,this.id)}setFilter(e=!1,t=!1,n=!1){const o=this.gl;return o.texParameteri(this._target,o.TEXTURE_MAG_FILTER,(0,r.getTextureFiltering)(!!e,!1,!1)),o.texParameteri(this._target,o.TEXTURE_MIN_FILTER,(0,r.getTextureFiltering)(!!e,!!t,!!n)),this}repeat(){return this.wrap(this.gl.REPEAT),this}clamp(){return this.wrap(this.gl.CLAMP_TO_EDGE),this}mirror(){return this.wrap(this.gl.MIRRORED_REPEAT),this}wrap(e){const t=this.gl;return t.texParameteri(this._target,t.TEXTURE_WRAP_S,e),t.texParameteri(this._target,t.TEXTURE_WRAP_T,e),this}}},{"./utils":35}],34:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.isWebgl2=function(e){return void 0!==e.fenceSync}},{}],35:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.getComponentSize=function(e){switch(e){case 5120:case 5121:return 1;case 5122:case 5123:return 2;case 5124:case 5125:case 5126:return 4;default:throw new Error(`unknown type ${e}`)}},n.getTextureFiltering=function(e,t,n){return 9728|+e|+t<<8|+(t&&n)<<1},n.isBufferSource=function(e){return void 0!==e.byteLength}},{}],36:[function(e,t,n){"use strict";const r=function(e){return e&&e.__esModule?e:{default:e}}(e("./simplex-noise.js"));r.default.SimplexNoise=r.default,t.exports=r.default},{"./simplex-noise.js":37}],37:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.buildPermutationTable=n.SimplexNoise=void 0;const r=.5*(Math.sqrt(3)-1),o=(3-Math.sqrt(3))/6,i=(Math.sqrt(5),Math.sqrt(5),new Float32Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0,1,0,1,-1,0,1,1,0,-1,-1,0,-1,0,1,1,0,-1,1,0,1,-1,0,-1,-1]));new Float32Array([0,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,1,0,1,1,1,0,1,-1,1,0,-1,1,1,0,-1,-1,-1,0,1,1,-1,0,1,-1,-1,0,-1,1,-1,0,-1,-1,1,1,0,1,1,1,0,-1,1,-1,0,1,1,-1,0,-1,-1,1,0,1,-1,1,0,-1,-1,-1,0,1,-1,-1,0,-1,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,0]);class s{constructor(e=Math.random){const t="function"==typeof e?e:function(e){let t=0,n=0,r=0,o=1;const i=function(){let e=4022871197;return function(t){t=t.toString();for(let n=0;n<t.length;n++){e+=t.charCodeAt(n);let r=.02519603282416938*e;e=r>>>0,r-=e,r*=e,e=r>>>0,r-=e,e+=4294967296*r}return 2.3283064365386963e-10*(e>>>0)}}();t=i(" "),n=i(" "),r=i(" "),t-=i(e),t<0&&(t+=1);n-=i(e),n<0&&(n+=1);r-=i(e),r<0&&(r+=1);return function(){const e=2091639*t+2.3283064365386963e-10*o;return t=n,n=r,r=e-(o=0|e)}}(e);this.p=a(t),this.perm=new Uint8Array(512),this.permMod12=new Uint8Array(512);for(let e=0;e<512;e++)this.perm[e]=this.p[255&e],this.permMod12[e]=this.perm[e]%12}noise2D(e,t){const n=this.permMod12,s=this.perm;let a=0,l=0,c=0;const d=(e+t)*r,u=Math.floor(e+d),f=Math.floor(t+d),h=(u+f)*o,g=e-(u-h),v=t-(f-h);let p,b;g>v?(p=1,b=0):(p=0,b=1);const m=g-p+o,x=v-b+o,y=g-1+2*o,_=v-1+2*o,w=255&u,S=255&f;let R=.5-g*g-v*v;if(R>=0){const e=3*n[w+s[S]];R*=R,a=R*R*(i[e]*g+i[e+1]*v)}let C=.5-m*m-x*x;if(C>=0){const e=3*n[w+p+s[S+b]];C*=C,l=C*C*(i[e]*m+i[e+1]*x)}let T=.5-y*y-_*_;if(T>=0){const e=3*n[w+1+s[S+1]];T*=T,c=T*T*(i[e]*y+i[e+1]*_)}return 70*(a+l+c)}}function a(e){const t=new Uint8Array(256);for(let e=0;e<256;e++)t[e]=e;for(let n=0;n<255;n++){const r=n+~~(e()*(256-n)),o=t[n];t[n]=t[r],t[r]=o}return t}n.SimplexNoise=s,n.default=s,n.buildPermutationTable=a},{}],38:[function(e,t,n){"use strict";var r,o=e("./renderer_prod"),i=e("./settings"),s=(r=e("./programs"))&&r.__esModule?r:{default:r},a=e("./artwork/artwork"),l=e("./utils/math"),c=e("./random");let d=null,u=null,f=0,h=Date.now(),g=0,v=h,p=0,b=null,m=null,x=null,y=!0;const _=(e=!1)=>{if(i.settings.currentY>1&&i.settings.isBuild)return void d.pause();y&&(y=!1,document.body.removeChild(x)),h=Date.now(),g=(h-v)/1e3,v=h;let t=Math.sin(f);t=(0,l.fit)(t,.5,1,1,.7),t=(0,l.clamp)(t,1,.7),f+=.0016,b&&(b.textContent=parseInt(f));const n=1e-4*(0,l.fit)(Math.sin(10*f),-1,1,.2,.2);p+=n,u.update(p),u.renderArtwork(),e||u.render()};(()=>{if(d=new o.Renderer({width:i.settings.dimensions[0],height:i.settings.dimensions[1]}),d.render=_,!i.settings.isBuild&&(b=document.createElement("div"),b.style.position="absolute",b.style.bottom="10px",b.style.right="10px",document.body.appendChild(b),m=document.createElement("div"),m.style.position="absolute",m.style.bottom="10px",m.style.left="10px",m.textContent=c.R.random(),document.body.appendChild(m)),x=document.createElement("div"),x.style.position="absolute",x.style.top=x.style.left="10px",x.style.fontSize="10px",x.style.color="black",x.textContent="Initializing the painting",document.body.appendChild(x),s.default.init(d.gl),u=(0,a.Artwork)(d.gl),i.settings.animated)d.play(),console.log("start code-painting");else{const e=3600;for(let t=0;t<e;t++)_(!0);u.render(),d.play()}document.body.appendChild(d.canvas),document.body.style.backgroundColor=i.settings.bgColor})()},{"./artwork/artwork":1,"./programs":40,"./random":41,"./renderer_prod":42,"./settings":43,"./utils/math":44}],39:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.palettes=void 0;n.palettes=[{name:"Monte Albàn",c:["#e1bf8d","#8c7f7d","#585751","#2d2c2a"],w:[.02734375,.24609375,.54296875,.7421875]},{name:"1947",c:["#fac200","#679e42","#2b85ab"],w:[.03125,.19140625,.578125]},{name:"1954",c:["#1c3608","#69213e","#d33e13"],w:[.0234375,.09765625,.53515625]},{name:"1949a",c:["#dbd0b2","#928c76","#5d5644","#191315"],w:[.01953125,.140625,.6640625,.875]},{name:"1949b",c:["#faebe0","#cd7448","#d17d50"],w:[.00390625,.42578125,.82421875]},{name:"1957a",c:["#ededeb","#e68751","#ab5d34","#bf4f18","#f7cd8b"],w:[0,.12890625,.26171875,.80078125,.8828125]},{name:"1957b",c:["#eae3cd","#fac200","#ffbd2e","#679e42","#227396"],w:[.01953125,.171875,.34375,.640625,.6875]},{name:"1958a",c:["#dde0cd","#18433b","#ce4b27"],w:[.0244293212890625,.09765625,.45703125]},{name:"1958b",c:["#dfd9b9","#a26c1a","#0d78c9"],w:[.0234375,.296875,.640625]},{name:"1958c",c:["#dfd9b9","#a26c1a","#0b5b99"],w:[.0234375,.296875,.640625]},{name:"1958d",c:["#e9e3d8","#e1cac8","#eb6d37","#829c49"],w:[.01953125,.15234375,.2890625,.640625]},{name:"1959",c:["#4d4c4c","#5c5c5c","#cacabf"],w:[.09765625,.33203125,.4921875]},{name:"1962",c:["#e7d8cd","#8e5e65","#2b5f94","#3167a5","#e85626"],w:[.05078125,.0546875,.28515625,.44921875,.8203125]},{name:"1967",c:["#f3b5a5","#d12733","#69213e","#7b7c46"],w:[.0234375,.2265625,.5234375,.640625]},{name:"1968",c:["#cd2633","#c32431","#981a28"],w:[.01171875,.14453125,.640625]},{name:"1969a",c:["#eae4dc","#2b6934","#4e4e55","#5c5c5c"],w:[.015625,.125,.4921875,.96875]},{name:"1969b",c:["#6cbee4","#f86019","#d17d50","#fd5c12"],w:[.05078125,.4453125,.765625,.9765625]},{name:"1970a",c:["#eae4dc","#ead7d2","#0080bd","#ead8d2"],w:[.0703125,.0703125,.390625,.99609375]},{name:"1970b",c:["#47270a","#b12a1b","#ab5d34","#bf4f18"],w:[.01171875,.125,.26171875,.6953125]},{name:"1970c",c:["#9b371a","#5e366b","#2a38a7"],w:[.015625,.09375,.31640625]},{name:"1970d",c:["#f8eac5","#b0624f","#818074","#c04330"],w:[0,.1328125,.65625,.94921875]},{name:"1973",c:["#c9c3b3","#827f79","#73874f"],w:[.015625,.30859375,.70703125]},{name:"1974a",c:["#352a03","#802d1e","#832a33"],w:[.01171875,.23046875,.55859375]},{name:"1974b",c:["#c9c3b3","#802d1e","#832a33"],w:[.01171875,.23046875,.55859375]},{name:"1983",c:["#eae4dc","#585555","#4e4e55","#5c5c5c"],w:[.015625,.125,.4921875,.96875]},{name:"2017",c:["#f3b5a5","#d12733","#69213e"],w:[.0234375,.2265625,.65625]},{name:"base",c:["#e9e6d2","#ece4e5"],w:[.015625,.4375]},{name:"base",c:["#bf9e76","#171717","#110906","#080808"],w:[.23828125,.24609375,.53515625,.70703125]},{name:"base",c:["#eae4dc","#fac200"],w:[.00390625,.26171875]},{name:"base",c:["#eae4dc","#ead7d2","#f02c49"],w:[.0703125,.0703125,.390625]},{nam
() {\n\n vec2 scale = vec2(1., 1.);\n vec2 pos = aPosition;\n vec2 center = aCenter ;//+ vec2(0., -aCenter.y*scale.y);\n pos *= scale;\n\n pos -= center;\n pos = rotate(pos, aCenter.x);\n pos += center;\n\n // // translate\n // vec2 translate = pos;\n // st -= translate;\n \n // // rotate\n // st -= center;\n // st = rotate2d(rot) * st;\n // st += center;\n\n gl_Position = vec4(pos, 0., 1.);\n\n vTexCoord = aTexCoord;\n}"},{}],24:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.CONSTS=void 0;n.CONSTS={MARKER_WIDTH:12,MARKER_HEIGHT:12,SPACE_CANVAS_STOPS:12}},{}],25:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ColorRamp=void 0;var r=e("./const"),o=e("./stop_prod"),i=e("../../settings");n.ColorRamp=class{constructor(){this.width=256,this.height=16+r.CONSTS.MARKER_HEIGHT+r.CONSTS.SPACE_CANVAS_STOPS,this.cvs=document.createElement("canvas"),this.cvs.style.width=`${this.width}px`,this.cvs.style.height=`${this.height}px`,this.cvs.style.boxShadow="none",this.cvs.width=this.width,this.cvs.height=this.height,this.ctx=this.cvs.getContext("2d"),this.cvsMetrics={},this.paddingX=10;const e=this.height-r.CONSTS.MARKER_HEIGHT-r.CONSTS.SPACE_CANVAS_STOPS;this.grdCvs=document.createElement("canvas"),this.grdCvs.style.width=`${this.width}px`,this.grdCvs.style.height=`${e}px`,this.grdCvs.width=this.width,this.grdCvs.height=e,this.grdCtx=this.grdCvs.getContext("2d"),this.palette=i.settings.palette,this.colors=this.palette.c,this.domains=this.palette.w,this.stops=[],this._populateStops()}_makeStop(e,t){const n=new o.Stop({cvs:this.cvs,pos:e,color:t});this.stops.push(n)}_populateStops(){const e=this.domains.length>0;for(let t=0;t<this.colors.length;t++){this._makeStop(e?this.domains[t]:t/this.colors.length,this.colors[t])}}_renderGradient(e){const t=this.grdCvs.width,n=this.grdCvs.height,r=this.grdCtx,o=r.createLinearGradient(20,0,220,0);this.stops.forEach((e=>{o.addColorStop(e.pos,e.color)})),r.clearRect(0,0,t,n),r.fillStyle=o,r.fillRect(0,0,this.grdCvs.width,this.grdCvs.height)}_render(){this._renderGradient();this.ctx.drawImage(this.grdCvs,0,0),this.onChange()}getEl(){return this.container}getCanvas(){return this.grdCvs}onAppendedToDOM(){this._render()}onChange(){}}},{"../../settings":43,"./const":24,"./stop_prod":26}],26:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Stop=void 0;let r=-1;n.Stop=class{constructor(e){this.id=r++,this.color=e.color||"#000000",this.pos=e.pos||0}}},{}],27:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r,o=(r=e("./basebuffer"))&&r.__esModule?r:{default:r},i=e("./utils");const s=34962;n.default=class extends o.default{constructor(e,t,n=e.STATIC_DRAW,r){super(),this.gl=e,this.usage=n,this.buffer=void 0!==r?r:e.createBuffer(),this.attribs=[],this.stride=0,this.byteLength=0,this.length=0,t&&this.data(t)}bind(){this.gl.bindBuffer(s,this.buffer)}attrib(e,t,n,r=!1){return this.attribs.push({name:e,type:0|n,size:0|t,normalize:r,offset:this.stride,stride:0}),this.stride+=(0,i.getComponentSize)(n)*t,this._computeLength(),this}data(e){const t=this.gl;t.bindBuffer(s,this.buffer),t.bufferData(s,e,this.usage),t.bindBuffer(s,null),this.byteLength=(0,i.isBufferSource)(e)?e.byteLength:e,this._computeLength()}subData(e,t){const n=this.gl;n.bindBuffer(s,this.buffer),n.bufferSubData(s,t,e),n.bindBuffer(s,null)}attribPointer(e){const t=this.gl;t.bindBuffer(s,this.buffer);for(var n=0;n<this.attribs.length;n++){var r=this.attribs[n];if(void 0!==e[r.name]){var o=e[r.name]();t.enableVertexAttribArray(o),t.vertexAttribPointer(o,r.size,r.type,r.normalize,r.stride||this.stride,r.offset)}}}draw(e,t=this.length,n=0){this.gl.drawArrays(e,n,0|t)}dispose(){this.gl.deleteBuffer(this.buffer)}_computeLength(){this.stride>0&&(this.length=this.byteLength/this.stride)}}},{"./basebuffer":28,"./utils":35}],28:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;n.default=class{drawPoints(e,t){this.draw(0,e,t)}drawLines(e,t){this.draw(1,e,t)}drawLineLoop(e,t){this.draw(2,e,t)}drawLineStrip(e,t){this.draw(3,e,t)}drawTriangles(e,t){this.draw(4,e,t)}drawTriangleStrip(e,t){this.draw(5,e,t)}drawTriangleFan(e,t){this.draw(6,e,t)}}},{}],29:[function(e,t,n){"use strict";function r(e){return e.id instanceof WebGLTexture}Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Attachment=void 0;class o{constructor(e){this.target=e,this.level=0,this._isTexture=r(e)}isTexture(){return this._isTexture}_resize(e,t){e>0&&t>0&&(r(this.target)?this.target.fromData(e,t,null):(this.target.resize(e,t),this.target.allocate()))}_attach(e){var t=this.target.gl;this._isTexture?t.framebufferTexture2D(t.FRAMEBUFFER,e,t.TEXTURE_2D,this.target.id,this.level):t.framebufferRenderbuffer(t.FRAMEBUFFER,e,t.RENDERBUFFER,this.target.id)}_detach(e){var t=this.target.gl;this._isTexture?t.framebufferTexture2D(t.FRAMEBUFFER,e,t.TEXTURE_2D,null,this.level):t.framebufferRenderbuffer(t.FRAMEBUFFER,e,t.RENDERBUFFER,null)}}n.Attachment=o;n.default=class{constructor(e){this.gl=e,this.width=0,this.height=0,this.fbo=e.createFramebuffer(),this.bind(),this.attachments={},this.attachmentsList=[]}attach(e,t){const n=new o(t);return this.detach(e|=0),this.attachments[e.toString()]=n,this.attachmentsList.push(n),n._resize(this.width,this.height),n._attach(e),n}detach(e){const t=this.attachments[e.toString()];if(void 0!==t){const n=this.attachmentsList.indexOf(t);this.attachmentsList.splice(n,1),t._detach(e)}delete this.attachments[e.toString()]}getAttachment(e){const t=this.attachments[e.toString()];return void 0!==t?t:null}getColor(e=0){const t=this.getAttachment(36064+e);return t?t.target:null}resize(e,t){this.width===e&&this.height===t||(this.width=0|e,this.height=0|t,this._allocate())}bind(){const e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,this.fbo)}clear(){this.gl.clear(17664)}isValid(){const e=this.gl;return e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE}_allocate(){for(var e of this.attachmentsList)e._resize(this.width,this.height)}}},{}],30:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=e("./types");let o=0;class i{constructor(e,t,n,r){this.gl=e,this.program=e.createProgram(),this.vShader=e.createShader(e.VERTEX_SHADER),this.fShader=e.createShader(e.FRAGMENT_SHADER),this.dyns=[],this.ready=!1,e.attachShader(this.program,this.vShader),e.attachShader(this.program,this.fShader),this._uid=0|o++,this._cuid=0|o++,void 0!==t&&void 0!==n&&this.compile(t,n,r)}use(){this.ready||this._grabParameters(),this.gl.useProgram(this.program)}bind(){this.use()}compile(e,t,n){this.ready=!1;const r=this.gl;if(!u(r,this.fShader,(n=void 0===n?"":n+"\n")+t)||!u(r,this.vShader,n+e))return!1;if(r.linkProgram(this.program),!r.getProgramParameter(this.program,r.LINK_STATUS))return i.debug&&s(r.getProgramInfoLog(this.program)),!1;for(;this.dyns.length>0;)delete this[this.dyns.pop()];return this._cuid=0|o++,!0}dispose(){null!==this.gl&&(this.gl.deleteProgram(this.program),this.gl.deleteShader(this.fShader),this.gl.deleteShader(this.vShader))}_grabParameters(){const e=this.gl,t=this.program,n={texIndex:0,ublockIndex:0},o=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(var i=0;i<o;++i){var s=e.getActiveUniform(t,i);if(null!==s){var a=s.name,l=a.indexOf("[");l>=0&&(a=a.substring(0,l));var c=e.getUniformLocation(t,s.name);null!==c&&(this[a]=g(s.type,c,e,n),this.dyns.push(a))}else e.getError()}const d=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(var u=0;u<d;++u){var f=e.getActiveAttrib(t,u).name,h=e.getAttribLocation(t,f);this[f]=p(h),this.dyns.push(f)}if((0,r.isWebgl2)(e)){const r=e.getProgramParameter(t,e.ACTIVE_UNIFORM_BLOCKS);for(var b=0;b<r;++b){var m=e.getActiveUniformBlockName(t,b);this[m]=v(b,e,n),this.dyns.push(m)}}this.ready=!0}}function s(e){console.warn(e)}i.debug=!1;const a=[""," "," "," ",""];function l(e,t){return a[String(t+1).length]+(t+1)+": "+e}const c=/^ERROR:\s?(\d+):(\d+)/;function d(e,t){const n=t.split("\n");e=e.split("\n").map((e=>{const t=c.exec(e);return t&&(e+="\n > "+n[parseInt(t[2])-1]),e})).join("\n"),t=t.split("\n").map(l).join("\n"),s(e),s(t)}function u(e,t,n){return e.shaderSource(t,n),e.compileShader(t),!!e.getShaderParameter(t,e.COMPILE_STATUS)||(i.debug&&d(e.getShaderInfoLog(t),n),!1)}const f={};function h(e){return"uniform"+f[String(e)]}function g(e,t,n,r){switch(e){case n.FLOAT_MAT2:case n.FLOAT_MAT3:case n.FLOAT_MAT4:return function(e,t,n,r){const o=h(e);return function(){arguments.length>0&&void 0!==arguments[0].length&&n[o+"v"](t,arguments.length>1&&!!arguments[1],arguments[0]);return t}}(e,t,n);case n.SAMPLER_2D:case n.SAMPLER_CUBE:case 35682:case 35679:return function(e,t,n,r){const o=r.texIndex++;return function(){return 1===arguments.length&&(void 0!==arguments[0].bind?(arguments[0].bind(o),n.uniform1i(t,o)):n.uniform1i(t,arguments[0])),t}}(0,t,n,r);default:return function(e,t,n,r){const o=h(e);return function(...e){return 1===e.length&&null!=e[0].length?n[o+"v"](t,e[0]):e.length>0&&n[o](t,...e),t}}(e,t,n)}}function v(e,t,n){const r=n.ublockIndex++;return function(){return 1===arguments.length&&(arguments[0]instanceof WebGLBuffer?(t.uniformBlockBinding(this.program,e,r),t.bindBufferBase(t.UNIFORM_BUFFER,r,arguments[0])):t.uniformBlockBinding(this.program,e,arguments[0])),e}}function p(e){return function(){return e}}f[String(5126)]="1f",f[String(35664)]="2f",f[String(35665)]="3f",f[String(35666)]="4f",f[String(35670)]=f[String(5124)]=f[String(35678)]=f[String(35680)]="1i",f[String(35671)]=f[String(35667)]="2i",f[String(35672)]=f[String(35668)]="3i",f[String(35673)]=f[String(35669)]="4i",f[String(35674)]="Matrix2f",f[String(35675)]="Matrix3f",f[String(35676)]="Matrix4f",n.default=i},{"./types":34}],31:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=e("./types");let o=0;const i=36161;n.default=class{constructor(e,t,n=0){if(this.samples=0,this._uid=o++,this.gl=e,this.id=e.createRenderbuffer(),n>0&&(0,r.isWebgl2)(e)){const t=e.getParameter(e.MAX_SAMPLES);this.samples=n>t?t:n}this.width=0,this.height=0,this.format=t||e.DEPTH_COMPONENT16,this._valid=!1,this._storage()}resi
(1.0 - opacity));}\n\nvec3 blendAverage(vec3 base, vec3 blend) {return (base+blend)/2.0;}\nvec3 blendAverage(vec3 base, vec3 blend, float opacity) {return (blendAverage(base, blend) * opacity + base * (1.0 - opacity));}\n\nvec3 blendDifference(vec3 base, vec3 blend) {return abs(base-blend);}\nvec3 blendDifference(vec3 base, vec3 blend, float opacity) {return (blendDifference(base, blend) * opacity + base * (1.0 - opacity));}\n\nvec3 blendExclusion(vec3 base, vec3 blend) {return base+blend-2.0*base*blend;}\nvec3 blendExclusion(vec3 base, vec3 blend, float opacity) {return (blendExclusion(base, blend) * opacity + base * (1.0 - opacity));}\n\nvec3 blendNegation(vec3 base, vec3 blend) {return vec3(1.0)-abs(vec3(1.0)-base-blend);}\nvec3 blendNegation(vec3 base, vec3 blend, float opacity) {return (blendNegation(base, blend) * opacity + base * (1.0 - opacity));}\n\nfloat blendSoftLight(float base, float blend) {return (blend<0.5)?(2.0*base*blend+base*base*(1.0-2.0*blend)):(sqrt(base)*(2.0*blend-1.0)+2.0*base*(1.0-blend));}\nvec3 blendSoftLight(vec3 base, vec3 blend) {return vec3(blendSoftLight(base.r,blend.r),blendSoftLight(base.g,blend.g),blendSoftLight(base.b,blend.b));}\nvec3 blendSoftLight(vec3 base, vec3 blend, float opacity) {return (blendSoftLight(base, blend) * opacity + base * (1.0 - opacity));}\n"},{}],13:[function(e,t,n){t.exports="#define GLSLIFY 1\nfloat grain(vec2 texCoord, vec2 resolution, float frame, float multiplier) {\n vec2 mult = texCoord * resolution;\n float offset = snoise3d(vec3(mult / multiplier, frame));\n float n1 = pnoise3D(vec3(mult, offset), vec3(1.0/texCoord * resolution, 1.0));\n return n1 / 2.0 + 0.5;\n}\n\nfloat grain(vec2 texCoord, vec2 resolution, float frame) {\n return grain(texCoord, resolution, frame, 2.5);\n}\n\nfloat grain(vec2 texCoord, vec2 resolution) {\n return grain(texCoord, resolution, 0.0);\n}"},{}],14:[function(e,t,n){t.exports="#define GLSLIFY 1\nvec3 ptdepth( sampler2D tInput, vec2 coords, float res, float thickness ) {\n vec2 onePixel = vec2(1.0 / res, 1.0 / res);\n vec4 color;\n color.rgb = vec3(0.);\n color -= texture(tInput, coords - onePixel) * thickness;\n color += texture(tInput, coords + onePixel) * thickness;\n color.rgb = vec3((color.r + color.g + color.b) / 6.0);\n return color.rgb;\n\n}"},{}],15:[function(e,t,n){t.exports="#define GLSLIFY 1\nfloat fit(float value, float min1, float max1, float min2, float max2) {\n return min2 + (value - min1) * (max2 - min2) / (max1 - min1);\n}"},{}],16:[function(e,t,n){t.exports="#define GLSLIFY 1\nmat2 rotate2d(float _angle){\n return mat2(cos(_angle),-sin(_angle),\n sin(_angle),cos(_angle));\n}\n\nvec2 scale(vec2 uv, vec2 scale, vec2 origin) {\n return (uv - origin) * scale + origin;\n}"},{}],17:[function(e,t,n){t.exports="#define GLSLIFY 1\nvec2 cell2d(vec2 P) {\n#define K 0.142\n#define Ko 0.42\n#define jitter 1.0 \n\tvec2 Pi = mod289(floor(P));\n \tvec2 Pf = fract(P);\n\tvec3 oi = vec3(-1.0, 0.0, 1.0);\n\tvec3 of = vec3(-0.5, 0.5, 1.5);\n\tvec3 px = permute(Pi.x + oi);\n\tvec3 p = permute(px.x + Pi.y + oi); \n\tvec3 ox = fract(p*K) - Ko;\n\tvec3 oy = mod7(floor(p*K))*K - Ko;\n\tvec3 dx = Pf.x + 0.5 + jitter*ox;\n\tvec3 dy = Pf.y - of + jitter*oy;\n\tvec3 d1 = dx * dx + dy * dy; \n\tp = permute(px.y + Pi.y + oi); \n\tox = fract(p*K) - Ko;\n\toy = mod7(floor(p*K))*K - Ko;\n\tdx = Pf.x - 0.5 + jitter*ox;\n\tdy = Pf.y - of + jitter*oy;\n\tvec3 d2 = dx * dx + dy * dy; \n\tp = permute(px.z + Pi.y + oi); \n\tox = fract(p*K) - Ko;\n\toy = mod7(floor(p*K))*K - Ko;\n\tdx = Pf.x - 1.5 + jitter*ox;\n\tdy = Pf.y - of + jitter*oy;\n\tvec3 d3 = dx * dx + dy * dy; \n\t\n\tvec3 d1a = min(d1, d2);\n\td2 = max(d1, d2); \n\td2 = min(d2, d3); \n\td1 = min(d1a, d2); \n\td2 = max(d1a, d2); \n\td1.xy = (d1.x < d1.y) ? d1.xy : d1.yx; \n\td1.xz = (d1.x < d1.z) ? d1.xz : d1.zx; \n\td1.yz = min(d1.yz, d2.yz); \n\td1.y = min(d1.y, d1.z); \n\td1.y = min(d1.y, d2.x); \n\treturn sqrt(d1.xy);\n}"},{}],18:[function(e,t,n){t.exports="#define GLSLIFY 1\nvec2 mod289(vec2 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec3 mod289(vec3 x)\n{\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 mod289(vec4 x)\n{\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\n// Modulo 7 without a division\nvec3 mod7(vec3 x) {\n return x - floor(x * (1.0 / 7.0)) * 7.0;\n}\n\nvec3 permute(vec3 x) {\n return mod289(((x*34.0)+10.0)*x);\n}\n\nvec4 permute(vec4 x)\n{\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 taylorInvSqrt(vec4 r)\n{\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nvec3 fade(vec3 t) {\n return t*t*t*(t*(t*6.0-15.0)+10.0);\n}"},{}],19:[function(e,t,n){t.exports="#define GLSLIFY 1\nvec3 snoiseVec3( vec3 x ){\n\n float s = snoise3d(vec3( x ));\n float s1 = snoise3d(vec3( x.y - 19.1 , x.z + 33.4 , x.x + 47.2 ));\n float s2 = snoise3d(vec3( x.z + 74.2 , x.x - 124.5 , x.y + 99.4 ));\n vec3 c = vec3( s , s1 , s2 );\n return c;\n\n}\n\nvec3 curlNoise( vec3 p ){\n \n const float e = 200.1;\n vec3 dx = vec3( e , 0.0 , 0.0 );\n vec3 dy = vec3( 0.0 , e * 1000. , 0.0 );\n vec3 dz = vec3( 0.0 , 0.0 , e );\n\n vec3 p_x0 = snoiseVec3( p - dx );\n vec3 p_x1 = snoiseVec3( p + dx );\n vec3 p_y0 = snoiseVec3( p - dy );\n vec3 p_y1 = snoiseVec3( p + dy );\n vec3 p_z0 = snoiseVec3( p - dz );\n vec3 p_z1 = snoiseVec3( p + dz );\n\n float x = p_y1.z - p_y0.z - p_z1.y + p_z0.y;\n float y = p_z1.x - p_z0.x - p_x1.z + p_x0.z;\n float z = p_x1.y - p_x0.y - p_y1.x + p_y0.x;\n\n const float divisor = 1.0 / ( 2.0 * e );\n return normalize( vec3( x , y , z ) * divisor );\n\n}"},{}],20:[function(e,t,n){t.exports="#define GLSLIFY 1\nfloat pnoise3D(vec3 P, vec3 rep)\n{\n vec3 Pi0 = mod(floor(P), rep);\n vec3 Pi1 = mod(Pi0 + vec3(1.0), rep);\n Pi0 = mod289(Pi0);\n Pi1 = mod289(Pi1);\n vec3 Pf0 = fract(P);\n vec3 Pf1 = Pf0 - vec3(1.0);\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = Pi0.zzzz;\n vec4 iz1 = Pi1.zzzz;\n\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n\n vec4 gx0 = ixy0 * (1.0 / 7.0);\n vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5;\n gx0 = fract(gx0);\n vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\n vec4 sz0 = step(gz0, vec4(0.0));\n gx0 -= sz0 * (step(0.0, gx0) - 0.5);\n gy0 -= sz0 * (step(0.0, gy0) - 0.5);\n\n vec4 gx1 = ixy1 * (1.0 / 7.0);\n vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5;\n gx1 = fract(gx1);\n vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\n vec4 sz1 = step(gz1, vec4(0.0));\n gx1 -= sz1 * (step(0.0, gx1) - 0.5);\n gy1 -= sz1 * (step(0.0, gy1) - 0.5);\n\n vec3 g000 = vec3(gx0.x,gy0.x,gz0.x);\n vec3 g100 = vec3(gx0.y,gy0.y,gz0.y);\n vec3 g010 = vec3(gx0.z,gy0.z,gz0.z);\n vec3 g110 = vec3(gx0.w,gy0.w,gz0.w);\n vec3 g001 = vec3(gx1.x,gy1.x,gz1.x);\n vec3 g101 = vec3(gx1.y,gy1.y,gz1.y);\n vec3 g011 = vec3(gx1.z,gy1.z,gz1.z);\n vec3 g111 = vec3(gx1.w,gy1.w,gz1.w);\n\n vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\n g000 *= norm0.x;\n g010 *= norm0.y;\n g100 *= norm0.z;\n g110 *= norm0.w;\n vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\n g001 *= norm1.x;\n g011 *= norm1.y;\n g101 *= norm1.z;\n g111 *= norm1.w;\n\n float n000 = dot(g000, Pf0);\n float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\n float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\n float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\n float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\n float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\n float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\n float n111 = dot(g111, Pf1);\n\n vec3 fade_xyz = fade(Pf0);\n vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\n vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\n float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);\n return 2.2 * n_xyz;\n}\n"},{}],21:[function(e,t,n){t.exports="#define GLSLIFY 1\nfloat snoise3d(vec3 v) {\n const vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\n const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n vec3 i = floor(v + dot(v, C.yyy) );\n vec3 x0 = v - i + dot(i, C.xxx) ;\n\n vec3 g = step(x0.yzx, x0.xyz);\n vec3 l = 1.0 - g;\n vec3 i1 = min( g.xyz, l.zxy );\n vec3 i2 = max( g.xyz, l.zxy );\n\n vec3 x1 = x0 - i1 + C.xxx;\n vec3 x2 = x0 - i2 + C.yyy; \n vec3 x3 = x0 - D.yyy; \n\n i = mod289(i);\n vec4 p = permute( permute( permute(\n i.z + vec4(0.0, i1.z, i2.z, 1.0 ))\n + i.y + vec4(0.0, i1.y, i2.y, 1.0 ))\n + i.x + vec4(0.0, i1.x, i2.x, 1.0 ));\n\n float n_ = 0.142857142857; \n vec3 ns = n_ * D.wyz - D.xzx;\n\n vec4 j = p - 49.0 * floor(p * ns.z * ns.z); \n\n vec4 x_ = floor(j * ns.z);\n vec4 y_ = floor(j - 7.0 * x_ );\n\n vec4 x = x_ *ns.x + ns.yyyy;\n vec4 y = y_ *ns.x + ns.yyyy;\n vec4 h = 1.0 - abs(x) - abs(y);\n\n vec4 b0 = vec4( x.xy, y.xy );\n vec4 b1 = vec4( x.zw, y.zw );\n vec4 s0 = floor(b0)*2.0 + 1.0;\n vec4 s1 = floor(b1)*2.0 + 1.0;\n vec4 sh = -step(h, vec4(0.0));\n\n vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;\n vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;\n\n vec3 p0 = vec3(a0.xy,h.x);\n vec3 p1 = vec3(a0.zw,h.y);\n vec3 p2 = vec3(a1.xy,h.z);\n vec3 p3 = vec3(a1.zw,h.w);\n\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n\n vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);\n m = m * m;\n return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),\n dot(p2,x2), dot(p3,x3) ) );\n }\n\n"},{}],22:[function(e,t,n){t.exports="#define GLSLIFY 1\nin vec2 vTexCoord;\n\nuniform float uTime;\n\nout vec4 FragColor;\n\nvoid main() {\n\n vec3 color = vec3(uTime, 0., 1.);\n float opacity = .3;\n\n FragColor = vec4(color, opacity);\n}"},{}],23:[function(e,t,n){t.exports="#define GLSLIFY 1\nin vec2 aPosition;\nin vec2 aTexCoord;\nin vec2 aSize;\nin vec2 aCenter;\n\nuniform float uTime;\n\nout vec2 vTexCoord;\n\nvec2 rotate(vec2 v, float a) {\n\tfloat s = sin(a);\n\tfloat c = cos(a);\n\tmat2 m = mat2(c, -s, s, c);\n\treturn m * v;\n}\n\nvoid main
me, uv).a, 0., 1., 50000., 100000.);\n float prevuvPertubX = ( ( texture(tCurl, vTexCoord + vec2(uTime*shakeSpeed)).r ) - .5 ) * 2. * prevPertubScl; // uTime * 10000 -> 100000\n float prevuvPertubY = ( ( texture(tCurl, vTexCoord + vec2(uTime*shakeSpeed)).g ) - .5 ) * 2. * prevPertubScl;\n \n \n vec2 prevScaleDir = vec2(prevuvPertubX, prevuvPertubY) * 1.2;\n float prevScaleComp = curl1.r + 0.0005;\n vec2 pushForce = mix(-uPushForce, uPushForce, curl2.r) * .1;\n vec2 prevScale = vec2(prevScaleComp, prevScaleComp * curl1.g) * pushForce;\n vec2 force1 = texture(tGradientMap, prevColor.rb).rb * 5.;\n vec2 force2 = curl2.rg * 1.02 * fit(curl1.b, 0., 1., .1, 1.);\n vec2 pivot = texture(tFlow1, uv * 1. + vec2(steppedUV.y, 0.)).rg * uPivotScl;\n vec2 prevuv = scale(uv, prevScale + prevScaleDir + force1 * force2, pivot );\n\n float prevuvMixFactorScl = .00005;\n float prevuvMixFactor = .000001 + texture(tPrevFrame, prevuv).a * prevuvMixFactorScl;\n\n // if (uRects[0].y < 1.) { prevuvMixFactor *= 0.; }\n\n prevuv = mix(uv, prevuv, prevuvMixFactor);\n prevuv = clamp(prevuv, 0., 1.);\n prevColor = texture(tPrevFrame, prevuv).rgb * 1.;\n float prevColorAlpha = texture(tPrevFrame, prevuv).a;\n\n vec2 center = vec2(0.5);\n\n // to accumulate\n vec3 color = vec3(0.);\n float alpha = 0.;\n \n float t = uTime + uTimeOffsets[0];\n \n // shape params\n float thickness = uRectsThickness[0] * .00025 * 1.;\n float size = uRects[0].z;\n \n float height = size;\n vec2 outerSize = vec2(size, height * screenRatio);\n vec2 innerSize = vec2(outerSize.x - thickness, outerSize.y - thickness );\n \n\n float x = uRects[0].x + outerSize.x/2.;\n float y = uRects[0].y + outerSize.y/2.;\n vec2 pos = vec2(x,y);\n pos -= vec2(0.5);\n \n vec2 st = uv;\n st -= pos;\n st -= center;\n st = rotate2d(uRotation) * st * vec2(1., 1.*screenRatio);\n st += center;\n\n // shape\n float smoothness = uSmoothness * 2.;\n float shape = rect(st, outerSize, smoothness);\n shape -= rect(st, innerSize, smoothness);\n\n float isCircle = curl1.r;\n if (isCircle > .0) {\n\n float circleSize = size * .5;//0.005;\n float circle = step( distance(uv, pos + center), circleSize);\n circle -= step( distance(uv, pos + center), circleSize * 0.5);\n }\n\n color = blendExclusion( color, vec3(shape), 1.);\n alpha += shape * fit(cos(t*200.), -1., 1., 0., 3.);\n\n // up mask\n float stopVariance = texture(tPerlin, uv * .1).g * .01;\n float eedge = .01;\n float stop = upMaskVal + stopVariance;\n float upMask = 1. - smoothstep(stop - eedge, stop + eedge, uv.y);\n color *= upMask;\n\n // blend with prev\n if (uBlendingMode == 6.) {\n color = blendDifference(prevColor, color, 1.);\n }\n else if (uBlendingMode == 16.) {\n color = blendNegation( prevColor, color, 1.);\n }\n alpha = prevColorAlpha + alpha;\n\n FragColor = vec4( color, alpha );\n\n // FragColor = texture(tFlow1, uv);\n}"},{}],6:[function(e,t,n){t.exports="#define GLSLIFY 1\nuniform float uSeed;\nuniform float uTime;\nuniform float uFboRes;\n\nin vec2 vTexCoord;\n\nout vec4 FragColor;\n\n<noisecommon>\n<snoise3d>\n<curl>\n\nvoid main() {\n\n vec2 freq = vec2(1., 1.)*1.3 * uFboRes;\n vec2 t = vec2(uTime*1000.)*.2;\n vec2 offset = vec2(uSeed*100.);\n vec3 curl = curlNoise( vec3(vTexCoord*freq+offset+t, uTime*100.) );\n float r = curl.r * curl.b;\n float g = curl.g;\n float b = curl.b;\n float a = (curlNoise(vec3((vTexCoord + vec2(uSeed*100.)) * 0.9, 0.)) * .01).r;\n\n vec3 color = vec3(r, g, curl.z);\n\n FragColor = vec4(color, a);\n\n}"},{}],7:[function(e,t,n){t.exports="#define GLSLIFY 1\nuniform float uSeed;\nuniform float uFboRes;\nuniform vec2 uFreq;\nuniform vec2 uOffset;\n\nin vec2 vTexCoord;\n\nout vec4 FragColor;\n\n<noisecommon>\n<snoise3d>\n<curl>\n<cell2d>\n\nvoid main() {\n\n vec2 uv = vTexCoord * vec2(1., 2.);\n\n vec2 freq = uFreq * uFboRes;\n vec3 curl = curlNoise(vec3(uv * freq + uOffset, 0.));\n\n float perlin = snoise3d(vec3(uv * 1000. + vec2(uSeed*100.), 0.));\n curl += vec3(perlin);\n\n vec2 cell = cell2d(uv*1.);\n curl += cell.r;\n \n vec3 color = curl;\n\n // color = vec3(cell, 0.);\n FragColor = vec4(color, 1.);\n \n}\n"},{}],8:[function(e,t,n){t.exports="#define GLSLIFY 1\nuniform float uSeed;\nuniform vec2 uResolution;\n\nin vec2 vTexCoord;\n\nout vec4 FragColor;\n\n<noisecommon>\n<snoise3d>\n<pnoise3d>\n<grain>\n\nvoid main() {\n\n float baseGrain = grain(vTexCoord+vec2(uSeed), vec2(10000.) * 2., 0.);\n float bgGrain = grain(vTexCoord, vec2(5500.) * 2., 0.);\n\n vec3 color = vec3(baseGrain, bgGrain, 0.);\n\n FragColor = vec4(color, 1.);\n\n}"},{}],9:[function(e,t,n){t.exports="#define GLSLIFY 1\nuniform float uSeed;\n\nin vec2 vTexCoord;\n\nout vec4 FragColor;\n\n<noisecommon>\n<snoise3d>\n\nvoid main() {\n\n // r\n float ampl = 10.;\n vec2 scl = vec2(200., 20.);\n float r = snoise3d( vec3(vTexCoord*scl+vec2(uSeed*10.), 0.));\n\n // g\n ampl = 1.;\n scl = vec2(20., 20.);\n float g = snoise3d( vec3(vTexCoord*scl+vec2(uSeed*10.), 0.));\n\n float b = snoise3d( vec3(vTexCoord+vec2(uSeed*10., 0.), 0.) * .35 );\n \n vec3 color = vec3(r, g, b);\n\n FragColor = vec4(color, 1.);\n\n}"},{}],10:[function(e,t,n){t.exports="#define GLSLIFY 1\nuniform sampler2D tTex;\nuniform sampler2D tGrain;\nuniform sampler2D tGradientMap;\nuniform sampler2D tPerlin;\nuniform sampler2D tCurl;\nuniform float uSeed;\nuniform vec2 uResolution;\n\nin vec2 vTexCoord;\n\nout vec4 FragColor;\n\n<math>\n<noisecommon>\n<snoise3d>\n<pnoise3d>\n<curl>\n<ptdepth>\n<grain>\n<blending>\n\nvoid main() {\n\n vec2 uv = gl_FragCoord.xy/uResolution;\n vec2 wrapuv = uv;\n\n vec3 tGrainCol = texture(tGrain, uv).rgb;\n \n vec3 curl = texture(tCurl, uv).aaa;\n float wrapuvOffsetY = curl.r;\n wrapuv.y += wrapuvOffsetY;\n\n vec4 tex = texture(tTex, wrapuv);\n vec3 color = tex.rgb;\n float alpha = tex.a;\n float baseGrain = tGrainCol.r;\n float bgGrain = tGrainCol.g;\n\n vec3 finalColor = texture(tTex, uv).rgb;\n\n finalColor = blendSoftLight(finalColor, vec3(baseGrain), .3);\n finalColor = blendAverage(finalColor, vec3(bgGrain), (1.-alpha) * .1);\n\n // perlin ptdepth\n float ptdepthRes = 2000.;\n float ptdepthThickness = 1.5;\n vec2 perlinCoords = wrapuv * vec2(2., 4.) * 2.;\n vec3 perlinptdepth = ptdepth(tPerlin, perlinCoords, ptdepthRes, ptdepthThickness);\n finalColor = blendOverlay(finalColor, perlinptdepth, -.155);\n\n // input ptdepth\n ptdepthRes = 4000.;\n ptdepthThickness = 5.;\n vec2 coords = wrapuv;\n vec3 inputptdepth = ptdepth(tTex, coords, ptdepthRes, ptdepthThickness);\n finalColor = blendAdd(finalColor, inputptdepth, .15 * alpha);\n\n // finer input ptdepth\n ptdepthRes = 8000.;\n ptdepthThickness = 3.2;\n vec3 finerInputptdepth = ptdepth(tTex, coords, ptdepthRes, -ptdepthThickness);\n\n // tint\n vec3 col = texture(tGradientMap, vec2(clamp(finalColor.r, 0., .99), 1.)).rgb;\n finalColor = mix(finalColor, col, 1.);\n\n finalColor = blendAdd(finalColor, finerInputptdepth, .625 * alpha);\n finalColor = blendExclusion( finalColor, perlinptdepth * texture(tGradientMap, vec2(0., 0.)).rgb, .5);\n\n // hashes grid\n float pertub = 0.;\n float yhashPertub = texture(tCurl, uv).r;\n float xhashOffset = (floor((uv.y*10.))/10.);\n float hashRes = 200.;\n float xhashes = smoothstep(.1, .15, fract((uv.x+xhashOffset * 20.) * hashRes*.5));\n float yhashes = smoothstep(.1, .15 + pertub * .3, fract(uv.y * hashRes + yhashPertub * .1 )) + .2;\n float hashes = xhashes * yhashes;\n finalColor = blendColorBurn(finalColor, vec3(hashes), 0.4 * (max(.1, 1.-alpha)) * max(.2, abs(curl.b) ));\n\n // finalColor = texture(tTex, uv).rgb;\n FragColor = vec4(finalColor, 1.);\n}"},{}],11:[function(e,t,n){t.exports="#define GLSLIFY 1\nin vec2 aPosition;\nin vec2 aTexCoord;\n\nout vec2 vTexCoord;\n\nvoid main() {\n gl_Position = vec4(aPosition, 0., 1.);\n\n vTexCoord = aTexCoord;\n}"},{}],12:[function(e,t,n){t.exports="#define GLSLIFY 1\nfloat blendReflect(float base, float blend) {return (blend==1.0)?blend:min(base*base/(1.0-blend),1.0);}\nvec3 blendReflect(vec3 base, vec3 blend) {return vec3(blendReflect(base.r,blend.r),blendReflect(base.g,blend.g),blendReflect(base.b,blend.b));}\nvec3 blendReflect(vec3 base, vec3 blend, float opacity) {return (blendReflect(base, blend) * opacity + base * (1.0 - opacity));}\n\nfloat blendOverlay(float base, float blend) {return base<0.5?(2.0*base*blend):(1.0-2.0*(1.0-base)*(1.0-blend));}\nvec3 blendOverlay(vec3 base, vec3 blend) {return vec3(blendOverlay(base.r,blend.r),blendOverlay(base.g,blend.g),blendOverlay(base.b,blend.b));}\nvec3 blendOverlay(vec3 base, vec3 blend, float opacity) {return (blendOverlay(base, blend) * opacity + base * (1.0 - opacity));}\n\nfloat blendColorBurn(float base, float blend) {return (blend==0.0)?blend:max((1.0-((1.0-base)/blend)),0.0);}\nvec3 blendColorBurn(vec3 base, vec3 blend) {return vec3(blendColorBurn(base.r,blend.r),blendColorBurn(base.g,blend.g),blendColorBurn(base.b,blend.b));}\nvec3 blendColorBurn(vec3 base, vec3 blend, float opacity) {return (blendColorBurn(base, blend) * opacity + base * (1.0 - opacity));}\n\nfloat blendColorDodge(float base, float blend) {return (blend==1.0)?blend:min(base/(1.0-blend),1.0);}\nvec3 blendColorDodge(vec3 base, vec3 blend) {return vec3(blendColorDodge(base.r,blend.r),blendColorDodge(base.g,blend.g),blendColorDodge(base.b,blend.b));}\nvec3 blendColorDodge(vec3 base, vec3 blend, float opacity) {return (blendColorDodge(base, blend) * opacity + base * (1.0 - opacity));}\n\nfloat blendVividLight(float base, float blend) {return (blend<0.5)?blendColorBurn(base,(2.0*blend)):blendColorDodge(base,(2.0*(blend-0.5)));}\nvec3 blendVividLight(vec3 base, vec3 blend) {return vec3(blendVividLight(base.r,blend.r),blendVividLight(base.g,blend.g),blendVividLight(base.b,blend.b));}\nvec3 blendVividLight(vec3 base, vec3 blend, float opacity) {return (blendVividLight(base, blend) * opacity + base * (1.0 - opacity));}\n\nfloat blendAdd(float base, float blend){return min(base+blend,1.0);}\nvec3 blendAdd(vec3 base, vec3 blend){return min(base+blend,vec3(1.0));}\nvec3 blendAdd(vec3 base, vec3 blend, float opacity){return (blendAdd(base, blend) * opacity + base *
!function e(t,n,r){function o(s,a){if(!n[s]){if(!t[s]){var l="function"==typeof require&&require;if(!a&&l)return l(s,!0);if(i)return i(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var d=n[s]={exports:{}};t[s][0].call(d.exports,(function(e){return o(t[s][1][e]||e)}),d,d.exports,e,t,n,r)}return n[s].exports}for(var i="function"==typeof require&&require,s=0;s<r.length;s++)o(r[s]);return o}({1:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Artwork=void 0;var r=p(e("../lib/nanogl/fbo")),o=p(e("../lib/nanogl/texture-2d")),i=(p(e("../lib/nanogl/renderbuffer")),p(e("../programs"))),s=p(e("../lib/simplex-noise")),a=e("../random"),l=e("../gl/geoms/rect"),c=e("../utils/math"),d=e("../settings"),u=p(e("../glsl/base.vert")),f=p(e("../glsl/artwork.frag")),h=e("./grain"),g=e("./noises"),v=e("../lib/colorramp/index_prod");function p(e){return e&&e.__esModule?e:{default:e}}const b=a.R.random(),m=new s.default(b),x=d.settings.dpr,y=[d.settings.dimensions[0]*x,d.settings.dimensions[1]*x],_=d.settings.timeLimit;let w=null;n.Artwork=e=>{a.R.random(),a.R.random();const t=[];let n=[];const s=[],p=[];let x=0;const S=e,R=new l.Rect(S);let C=null;const T=i.default.get("artwork_pass1"),P=(0,h.Grain)(S),z=(0,g.Noises)(S);let E,F,M,A=null,O=null,L=null;const D=d.settings.brushSizeScl;let B=d.settings.brushSizeOpts;B=B.map((e=>e*D));let I=a.R.pick(B),k=I/2,G=I/2+20/d.settings.dimensions[1],N=16,U=6,j=a.R.range(-1,1)*Math.PI*2,Y=5,H=1,q=0,V=0,K=!1;const X=()=>{L.bind(),L.fromImage(w.getCanvas())};return(()=>{let e="\n";e+="#define NB_RECTS 1\n",C=i.default.makeProgram(u.default,f.default,{name:"artwork",defs:"\n#define NB_RECTS 1\n"})})(),P.render(),z.renderPerlin(x),z.renderFlows(x),z.renderCurl(0),(()=>{for(let e=0;e<1;e++){const e=0,r=0,o=I,i=1,l=0,c=a.R.pick([2,5,10,20,50]);t.push(e,r,o,i),n.push(e,r,o,i),s.push(l),p.push(c)}})(),w=new v.ColorRamp,w.onChange=X,L=new o.default(S),d.settings.isBuild?w.onAppendedToDOM():(document.body.appendChild(w.getEl()),setTimeout(w.onAppendedToDOM,0)),(()=>{let e=new o.default(S,S.RGBA,S.UNSIGNED_BYTE);e.bind(),E=new r.default(S),E.attach(S.COLOR_ATTACHMENT0,e),E.resize(y[0],y[1]),e=new o.default(S,S.RGBA,S.UNSIGNED_BYTE),e.bind(),F=new r.default(S),F.attach(S.COLOR_ATTACHMENT0,e),F.resize(y[0],y[1]),O=E,M=F;e=new o.default(S,S.RGBA,S.UNSIGNED_BYTE),e.bind(),e.clamp(),A=new r.default(S),A.attach(S.COLOR_ATTACHMENT0,e),A.resize(1024,1024)})(),{update:e=>{x=.5*e+100*b;for(let e=0;e<t.length;e+=4){const n=x;let r=m.noise2D(100*G,100*G+1e3*b);r=(0,c.fit)(r,-1,1,.005,.008),j=m.noise2D(2e3*G+n*Y*d.settings.brushRotationScl,2e3*G+1e3*b)*Math.PI*2,I==d.settings.brushMaxSize&&(j*=.2);let o=m.noise2D(1e3*G+500*n,1e4*G+1e3*b);o=(0,c.fit)(o,-1,1,2,4)*d.settings.glbSpeedScale,k+=r*o*H;const i=.7;let s=m.noise2D(k*i+n*d.settings.brushSVarSpeed+500*b,G*i*3+1e3*b);s=(0,c.fit)(s,-1,1,1,d.settings.brushSVarMax);let l=I/2,u=1-1.5*I;if(.35==I&&.5==d.settings.brushSizeScl&&(u=a.R.range(u,1+I)),k>u){V++;const t=a.R.pick(B);let n=d.settings.brushSizeScl<1?.9:1,r=a.R.random()>n?a.R.pick([.5,.5]):1;G+=I*r,d.settings.currentY=G,K=d.settings.useEraser&&V%d.settings.eraserFreq==0,U=6,N=K?U:16,Y=a.R.range(5,20),I=t,k=l*a.R.range(.7,1.5),I==d.settings.brushMaxSize&&.7==d.settings.brushMaxSize&&(k=a.R.range(-I,0));const o=1,i=a.R.pick([2,5,10,20,50])*o;p[e]=i,q=a.R.pick([0,.001,.003,.005]),d.settings.smoothOverride&&(q=d.settings.smoothOverride);const s=.3;H=a.R.random()<s&&d.settings.shouldSlowDown&&.5==d.settings.glbSpeedScale?.5:1}t[e]=k,t[e+1]=G,t[e+2]=I*s}},render:()=>{x-100*b>_||(S.bindFramebuffer(S.FRAMEBUFFER,null),S.clearColor(0,0,0,0),S.clear(S.COLOR_BUFFER_BIT),T.use(),T.use(),T.tTex(O.getColor()),T.tGrain(P.getColor()),T.tGradientMap(L),T.tPerlin(z.getPerlinColor()),T.tCurl(z.getCurlColor()),T.uResolution(d.settings.dprDimensions),T.uSeed&&T.uSeed(b),R.bind(),R.attribPointer(T),R.render())},renderArtwork:()=>{if(x-100*b>_)return;const e=x-100*b;S.bindFramebuffer(S.FRAMEBUFFER,null);var n=O;O=M,M=n,M.bind(),S.clearColor(0,0,0,1),S.clear(S.COLOR_BUFFER_BIT),C.use(),C.tPrevFrame(O.getColor()),C.uRects(t),C.uTime(e),C.uTimeOffsets(s),C.uRectsThickness(p),C.uResolution(d.settings.dprDimensions),C.tCurl(z.getCurlColor()),C.tPerlin(z.getPerlinColor()),C.tFlow1(z.getFlow1Color()),C.tFlow2(z.getFlow2Color()),C.uBlendingMode(N),C.uRotation(j),C.uSmoothness(q),C.tGradientMap(L),C.uPushForce(d.settings.pushForce),C.uPivotScl(d.settings.pivotScl),C.uShapeType&&C.uShapeType(0),R.bind(),R.attribPointer(C),R.render()}}}},{"../gl/geoms/rect":4,"../glsl/artwork.frag":5,"../glsl/base.vert":11,"../lib/colorramp/index_prod":25,"../lib/nanogl/fbo":29,"../lib/nanogl/renderbuffer":31,"../lib/nanogl/texture-2d":32,"../lib/simplex-noise":36,"../programs":40,"../random":41,"../settings":43,"../utils/math":44,"./grain":2,"./noises":3}],2:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Grain=void 0;var r=a(e("../programs")),o=e("../gl/geoms/rect"),i=a(e("../lib/nanogl/fbo")),s=a(e("../lib/nanogl/texture-2d"));function a(e){return e&&e.__esModule?e:{default:e}}const l=e("../random").R.random(),c=1024;n.Grain=e=>{let t=e,n=null,a=null,d=null;return n=r.default.get("grain"),a=new o.Rect(t),d=new i.default(t),d.attach(t.COLOR_ATTACHMENT0,new s.default(t,t.RGBA,t.UNSIGNED_BYTE)),d.resize(c,c),{getColor:()=>d.getColor(),render:()=>{d.bind(),n.use(),n.uSeed(l),n.uResolution&&n.uResolution([c,c]),a.bind(),a.attribPointer(n),a.render()}}}},{"../gl/geoms/rect":4,"../lib/nanogl/fbo":29,"../lib/nanogl/texture-2d":32,"../programs":40,"../random":41}],3:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Noises=void 0;var r=l(e("../programs")),o=e("../gl/geoms/rect"),i=l(e("../lib/nanogl/fbo")),s=l(e("../lib/nanogl/texture-2d")),a=(e("../random"),e("../settings"));function l(e){return e&&e.__esModule?e:{default:e}}const c=1/16,d=a.settings.dimensions[1]*a.settings.dpr*c;n.Noises=e=>{let t,n,l,c,u,f=e,h=null,g=null,v=null;const p=[a.settings.flowsFreq[0],a.settings.flowsFreq[1]],b=[a.settings.flowsFreq[2],a.settings.flowsFreq[3]],m=e=>{f.viewport(0,0,16*d,16*d),c.bind(),h.use(),h.uSeed(a.settings.rnd),h.uFreq(p),h.uOffset(a.settings.flow1Offset),h.uFboRes(16),h.uResolution&&h.uResolution([d,d]),g.bind(),g.attribPointer(h),g.render(),u.bind(),h.uFreq(b),h.uOffset(a.settings.flow2Offset),g.render()},x=e=>{f.viewport(0,0,16*d,16*d),l.bind(),t.use(),t.uSeed(a.settings.rnd),t.uTime(e),t.uFboRes(16),t.uResolution&&t.uResolution([d,d]),g.bind(),g.attribPointer(t),g.render()},y=e=>{f.viewport(0,0,16*d,16*d),v.bind(),n.use(),n.uSeed(a.settings.rnd),n.uResolution&&n.uResolution([d,d]),g.bind(),g.attribPointer(n),g.render()};return(()=>{t=r.default.get("curl"),n=r.default.get("perlin"),h=r.default.get("flow"),g=new o.Rect(f);let e=new s.default(f,f.RGBA,f.UNSIGNED_BYTE);e.bind(),e.repeat(),l=new i.default(f),l.attach(f.COLOR_ATTACHMENT0,new s.default(f,f.RGBA,f.UNSIGNED_BYTE)),l.resize(d,d),e=new s.default(f,f.RGBA,f.UNSIGNED_BYTE),e.bind(),e.repeat(),c=new i.default(f),c.attach(f.COLOR_ATTACHMENT0,new s.default(f,f.RGBA,f.UNSIGNED_BYTE)),c.resize(8*d,8*d),e=new s.default(f,f.RGBA,f.UNSIGNED_BYTE),e.bind(),e.repeat(),u=new i.default(f),u.attach(f.COLOR_ATTACHMENT0,new s.default(f,f.RGBA,f.UNSIGNED_BYTE)),u.resize(8*d,8*d),e=new s.default(f,f.RGBA,f.UNSIGNED_BYTE),e.bind(),e.repeat(),v=new i.default(f),v.attach(f.COLOR_ATTACHMENT0,e),v.resize(16*d,16*d)})(),{getCurlColor:()=>l.getColor(),getPerlinColor:()=>v.getColor(),getFlow1Color:()=>c.getColor(),getFlow2Color:()=>u.getColor(),render:e=>{x(e),y(),m()},renderCurl:x,renderPerlin:y,renderFlows:m}}},{"../gl/geoms/rect":4,"../lib/nanogl/fbo":29,"../lib/nanogl/texture-2d":32,"../programs":40,"../random":41,"../settings":43}],4:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Rect=void 0;var r,o=(r=e("../../lib/nanogl/arraybuffer"))&&r.__esModule?r:{default:r};e("../../utils/math");n.Rect=class extends o.default{constructor(e,t=-1,n=-1,r=2,o=2){super(e),this.d=new Float32Array([-1,-1,0,0,-1,1,0,1,1,-1,1,0,1,1,1,1]);const i=this.d;i[0]=i[4]=t,i[1]=i[9]=n,i[8]=i[12]=t+r,i[5]=i[13]=n+o,this.data(i),this.attrib("aPosition",2,e.FLOAT),this.attrib("aTexCoord",2,e.FLOAT),this.d=i}setPosAndSize(e,t,n,r){const o=this.d;o[0]=o[4]=e,o[1]=o[9]=t,o[8]=o[12]=e+n,o[5]=o[13]=t+r,this.subData(o),this.d=o}render(){this.drawTriangleStrip()}}},{"../../lib/nanogl/arraybuffer":27,"../../utils/math":44}],5:[function(e,t,n){t.exports="#define GLSLIFY 1\n#define PI 3.1415926538\n\nuniform vec2 uPos;\nuniform float uTime;\nuniform vec2 uResolution;\nuniform sampler2D tPrevFrame;\nuniform sampler2D tCurl;\nuniform sampler2D tPerlin;\nuniform sampler2D tFlow1;\nuniform sampler2D tFlow2;\nuniform sampler2D tGradientMap;\nuniform float uBlendingMode;\nuniform float uShapeType;\nuniform float uRotation;\nuniform float uSmoothness;\nuniform vec2 uPushForce;\nuniform float uPivotScl;\n\nin vec2 vTexCoord;\n\nuniform vec4 uRects[NB_RECTS];\nuniform float uRectsThickness[NB_RECTS];\nuniform float uTimeOffsets[NB_RECTS];\n\nout vec4 FragColor;\n\n<transform>\n<math>\n<blending>\n\nfloat rect(in vec2 _st, in vec2 _size, float smoothness){\n _size = vec2(0.5) - _size*0.5;\n float smoothing = smoothness; // 0.001\n vec2 uv = smoothstep(_size,\n _size+vec2(smoothing),\n _st);\n uv *= smoothstep(_size,\n _size+vec2(smoothing),\n vec2(1.0)-_st);\n return uv.x*uv.y;\n}\n\nvoid main() {\n float screenRatio = uResolution.x/uResolution.y;\n vec2 uv = gl_FragCoord.xy/uResolution;\n \n\n vec3 prevColor = texture(tPrevFrame, uv).rgb;\n\n float snoisePertub1 = texture(tPerlin, vTexCoord * .1).r;\n\n float upMaskVal = .98;\n \n \n float steps = 10.;\n vec2 steppedUV = floor(uv * steps) / steps; \n\n vec3 curl1 = texture(tFlow1, uv ).rgb;\n\n vec2 curl2Coords = uv;//rotate2d(.5) * uv * fit( curl1.b, 0., 1., .2, 4. );\n vec3 curl2 = texture(tFlow2, curl2Coords).rgb;\n vec3 curl = normalize(mix(curl1, curl2, snoisePertub1));\n\n float prevPertubScl = curl2.g * 5. * fit(curl2.b, 0., 1., -1., 1.);\n float shakeSpeed = fit(texture(tPrevFra
0x35ed1634…9501·#15,777,665·0x26a2598e…59965b
RqWilliam Mapan 1/1s`pAddress: delegate call to non-co`DAddress: delegate call to non-co`DAddress: low-level delegate call failedAddress: low-level delegate call failed
tensions.derivatives=!0,i=new THREE.ShaderMaterial({uniforms:{tInput:{value:R.texture},uflp:{value:new THREE.Vector2(e.flip.x,e.flip.y)},ungt:{value:new THREE.Vector2(e.night[0],e.night[1])},uSunColor:{value:new THREE.Vector4(e.sunColor[0],e.sunColor[1],e.sunColor[2],e.sunColor[3])},uStep:{value:1}},vertexShader:j,fragmentShader:Lt}),u=new THREE.PlaneBufferGeometry(2,2),f=new THREE.Mesh(u,t),a.add(f)},E=x=>{console.log("render step",e.step),c.render(x),s.render(x),e.step>5&&e.night[0]==1?(t.uniforms.ungt.value.x=1,e.artcntrst=3.75,e.artbrhtnss=2,e.artstrtn=1.2,e.scrch.x=.01):e.night[0]==1&&(t.uniforms.ungt.value.x=0,e.artcntrst=3,e.artbrhtnss=1.15,e.artxpsr=-.65,e.artstrtn=-1);let p=oe(e.bgColor);p=ne(p.h,p.s,p.l);let I=oe(e.darkenColor);I=ne(I.h,I.s,I.l),Ze.set(p.r/255,p.g/255,p.b/255,e.bgColorScale),t.uniforms.ubg.value=Ze,t.uniforms.udkncl.value.x=I.r/255,t.uniforms.udkncl.value.y=I.g/255,t.uniforms.udkncl.value.z=I.b/255,t.uniforms.uDebug.value=e.debugView,t.uniforms.uarthsft.value=e.arthsft,t.uniforms.uartcbse.value.x=e.artcntrst,t.uniforms.uartcbse.value.y=e.artbrhtnss,t.uniforms.uartcbse.value.z=e.artstrtn,t.uniforms.uartcbse.value.w=e.artxpsr,t.uniforms.ucbse.value.x=e.cntrst,t.uniforms.ucbse.value.y=e.brhtnss,t.uniforms.ucbse.value.z=e.strtn,t.uniforms.ucbse.value.w=e.xpsr,t.uniforms.uptscl.value=e.pertubScale,t.uniforms.uptuvscl.value=e.pertubUVScale,t.uniforms.uptuvtrlt.value.x=e.pertubUVTranslateX,t.uniforms.uptuvtrlt.value.y=e.pertubUVTranslateY,t.uniforms.uclddgrtrlt.value.x=e.clddegtrslt.x,t.uniforms.uclddgrtrlt.value.y=e.clddegtrslt.y,t.uniforms.uclattscl.value=e.clattScale,t.uniforms.ugrnscl.value=e.grainResScale,t.uniforms.ucntr.value.x=1,t.uniforms.ucntr.value.y=e.contourWidth,t.uniforms.ucntr.value.z=1,t.uniforms.unblns.value.x=e.nbLinesX,t.uniforms.unblns.value.y=e.nbLinesY,t.uniforms.ucrl.value.x=e.curl.pos.x,t.uniforms.ucrl.value.y=e.curl.pos.y,t.uniforms.ucrl.value.z=e.curl.scl.x,t.uniforms.ucrl.value.w=e.curl.scl.y,t.uniforms.uscrch.value.x=e.scrch.x,t.uniforms.uwrsz.value.x=e.wearSize.x,t.uniforms.uwrsz.value.y=e.wearSize.y,t.uniforms.uwrsz.value.z=e.wearSize.z,t.uniforms.uwrsz.value.w=e.wearSize.w,t.uniforms.upclskint.value=e.pclstkIntensity,t.uniforms.unseclint.value=e.nsyclIntensity,t.uniforms.uhstkint.value=e.hstkIntensity,t.uniforms.uogclint.value=e.isDark?0:e.ogclint,t.uniforms.udkn.value=e.isDark?1:0,t.uniforms.uglrt.value=e.globalRot,t.uniforms.ufllcll.value.x=e.fllclls.x?1:0,t.uniforms.ufllcll.value.y=e.fllclls.y;let te=[],J=[];for(let q=0;q<e.dirts.length;q++){const A=e.dirts[q];te.push(A.scale.x,A.scale.y,A.levels.x,A.levels.y),J.push(A.intensity,A.freq)}t.uniforms.uDirts.value=te,t.uniforms.udtintfq.value=J,t.uniforms.udtbld.value=e.dirtBlend,t.uniforms.uStep.value=e.step,i.uniforms.uStep.value=e.step,f.material=t,x.setRenderTarget(R),x.render(a,o),f.material=i,x.setRenderTarget(null),x.render(a,o)};return $(),T(),{render:E}};let O=null,Qe=null;const Xt=()=>{O.gl,Qe=Ot()},et=()=>{Qe.render(O.r)};window.render=et;const Gt=()=>{O=new Vt({width:e.width,height:e.height}),e.nbShapes=O.maxUniforms<1024?100:400,O.render=et,new THREE.Scene,new THREE.PerspectiveCamera(45,e.width/e.height,.01,100),Xt(),O.play(),O.pause(),document.body.appendChild(O.canvas)};Gt();
ngth(c)));}float cllgdtinst = .12 + simplex * .05;float xcllgdt = smoothstep(0., cllgdtinst, cellUv.x) - smoothstep(1.-cllgdtinst, 1., cellUv.x) ;float ycllgdt = smoothstep(0., cllgdtinst, cellUv.y) - smoothstep(1.-cllgdtinst, 1., cellUv.y) ;float cllgdt = xcllgdt * ycllgdt * frame;if(empty == 0.) {c = bldmt(c, vec3(cllgdt), -.2 * (1.-length(c)) * frame);} vec3 cDark = texture2D(tDarkInput, wrapuv).rgb;float cDarkMask = 1.-step(cDark.r, 0.);cDark = strtn(cDark, -1.);float clatt = noise( vec3(vUv * uclattscl , 1.) );if (uStep > 7.) {c = bldsftlgt(c, vec3(clatt), .5);}float maskMixer = length(c);vec3 mask = mix(vec3(1.0, 0., 0.), vec3(0., 1., 0.), maskMixer);vec3 ppr = bgColor;float ydistrt = sn3d( vec3( vUv * vec2(100., 100.), 0. ));float pprnseyscl = map(ydistrt, -1., 1., 3., 6.);float pprnse = sn3d( vec3(vUv * vec2(200., 50.) * pprnseyscl, 0.));ppr = bgColor * .9;if (uStep > 10.) {ppr = bldovl( bgColor, vec3(1.-pprnse), .2 );}if (uStep > 16.) {ppr = bldmt( ppr, vec3(stains), .025 );}c = bldmt(c, ppr, 1.);if (ungt.x == 0.) {c = mix(c, ppr, mask.r);}float drtcld = fm1(vUv*10.);float att = noise(vec3((vUv*7.)+c.rb*2.+uppruvfsst, 1.));att = clamp(att, 0., 1.);if (uStep > 8.) {c = bldscn(c, cnoise, 1.);}if (uStep > 17.) {float attInt = .02;if (usqss.x == 1.) {attInt = .003;}c = bldmt(c, vec3(att), attInt);}if (uStep > 8.) {c = bldovl(c, vec3(drtcld), .2);c = clamp(c, 0., 1.);}if (udkn == 1.) {c = strtn(c, -1. * cDarkMask * frame);vec3 cntrstedC = cntrst(c, .997);c = mix( c, cntrstedC, cDarkMask) ;c = bldovl(c, c*4., udkint*cDarkMask*frame);}float cloud = fm1(vUv*50.);float clcld = fm1(vUv*1.+uclddgrtrlt);if (uStep > 8.) {c = bldovl(c, vec3(clcld), .2);}float squsse = 0.;for (int i = 0; i < 10; i++ ) {float idx = float(i);float rnd = map( random( vec2(idx) ), 0., 1., -1.1, 1.1 );squsse = edge(tContourInput, wrapuv + vec2(rnd, 0.) + vec2(simplex2) * .1 + rnd , vec2(ures.x, ures.y) * .1 );squsse = max(0., min(squsse, .2 + abs(rnd)));c = bldovl(c, vec3(1.), squsse * ufzzstkint * float(i) * .1);}squsse = clamp(squsse, 0., 1.);vec4 cbse = ucbse;vec4 cbse2 = vec4(cbse.x, cbse.y, -.5, cbse.w);vec3 c0 = applycbse(c, cbse);vec3 c1 = applycbse(c, cbse2);float lutMixer = 0.;if (usqss.x == 1.) {lutMixer = cntrdge;}c = mix(c0, c1, lutMixer);if (unblns.x == 1. && cellId.y < clltsh) {c = bldovl(c, vec3(-1.0), cntrdge * .2);}float dirt = 1.;for (int i = 0; i < nbdrts; i++) {vec2 coords = vUv - vec2(.5);coords = scale(coords, vec2(uDirts[i].x, uDirts[i].y), vec2(.5));coords += uptuvtrlt;float d = gtdt(coords*udtintfq[i].y, vec2(uDirts[i].z, uDirts[i].w));dirt = bldmt(vec3(dirt), vec3(d), udtintfq[i].x).r;}if (upidx == 6.) {vec3 woffset = vec3(0.);float key = chrky( c, vec3(133., 106., 30.) / 255., woffset );c = mix(c, vec3(175.,179.,193.) / 255., key * frame * fllcll * (1.-cmask));}if (usqss.y == 1.) {c *= ubg.rgb;}gl_FragColor = vec4(c, 1.);}",Lt=`uniform sampler2D tInput;uniform vec2 uflp;uniform vec2 ungt;uniform float uStep;varying vec2 vUv; vec3 brhtnss(vec3 color, float value) {return color + value;} vec2 rotate(vec2 uv, float rotation){float mid = 0.5;return vec2(cos(rotation) * (uv.x - mid) + sin(rotation) * (uv.y - mid) + mid,cos(rotation) * (uv.y - mid) - sin(rotation) * (uv.x - mid) + mid);}vec2 rotate(vec2 uv, float rotation, vec2 mid){return vec2(cos(rotation) * (uv.x - mid.x) + sin(rotation) * (uv.y - mid.y) + mid.x,cos(rotation) * (uv.y - mid.y) - sin(rotation) * (uv.x - mid.x) + mid.y);}vec2 rotate(vec2 uv, float rotation, float mid){return vec2(cos(rotation) * (uv.x - mid) + sin(rotation) * (uv.y - mid) + mid,cos(rotation) * (uv.y - mid) - sin(rotation) * (uv.x - mid) + mid);}vec2 scale(vec2 uv, float scale, vec2 origin) {return (uv - origin) * scale + origin;}vec2 scale(vec2 uv, vec2 scale, vec2 origin) {return (uv - origin) * scale + origin;} void main() {float uvx = vUv.x;float uvy = vUv.y;if (uflp.x == 1.) {uvx = 1.-vUv.x;}if (uflp.y == 1.) {uvy = 1.-vUv.y;}vec2 uv = vec2(uvx, uvy);vec3 c = texture2D(tInput, uv).rgb;gl_FragColor = vec4(c, 1.);}`;const Nt=` vec2 wrapuv = vec2(vUv.x, vUv.y) * -10.;float fllcll = 1.;if (uStep == 0. ) { wrapuv.x *= .5;}float nbStripes = 1.;if (uStep > 3.) { nbStripes = unblns.x;}float cellIdOffset = urnd * 10.;if (unblns.x == 10.) { cellIdOffset *= step(.35, urnd);}vec2 cellId = floor( (mod(vUv, 1.))*nbStripes)/nbStripes;cellId += vec2(random(vec2(cellId.x*cellIdOffset+cellId.y+ucllff.x*10.)));cellId = mod(cellId, 1.);vec2 cellUv = mod(vUv, vec2(1./nbStripes)) * nbStripes;float v = rnduv(floor(vUv * 1.));float stripes = floor(( fract( vUv.y + v ) *nbStripes))/nbStripes;stripes *= floor(vUv.y *nbStripes)/nbStripes*1000.;float offset = 0.;offset += pertub * .5;float xstripes = floor(( fract( vUv.x + v ) *nbStripes))/nbStripes;stripes *= xstripes;if (uStep > 0.) { wrapuv.x *= offset * .2; wrapuv.x += offset * 30.; wrapuv.x += stripes * 10.5; wrapuv.x += stripes - noise(vec3(stripes*100.)) - 1.;}float rot = 0.;float direction = curl.r < -1. ? 1. : -1.;if (uStep > 2.) { rot = #rtfmla; rot += #rtaddfmla;}float ffctrd = 1.;float ffcagl = 2. * PI;vec2 swlCenter = uswl.xy;vec2 swlUv = vUv * 1. - swlCenter;float dstctr = distance(vUv, swlCenter) - .1;dstctr = clamp(dstctr, 0., 1.);float len = uswl.z + length(swlUv * vec2(ratio, 1.));float angle = atan(swlUv.y, swlUv.x) + ffcagl * smoothstep(ffctrd, 0., len);#rtswlfmla; rot += uglrt;vec2 centeredUV = rotate(vUv, rot, vec2(0.));if (uStep > 1.) { wrapuv.x += #wrapx;}wrapuv = scale(wrapuv, vec2(.2, 1.), vec2(0.)); `,D=e.form;let w=Ne;w=w.replace("#crlchnk1",D.crlchnk1);w=w.replace("#crlchnks",D.crlchnks);w=w.replace("#crlchnks1",D.crlchnks1);w=w.replace("#crlchnks2",D.crlchnks2);w=w.replace("#crlchnk2",D.crlchnk2);w=w.replace("#crlbse",D.crlbse);w=w.replace("#curlExp0",D.crlxps[0]);w=w.replace("#curlExp1",D.crlxps[1]);w=w.replace("#curlExp2",D.crlxps[2]);let d=At;d=d.replace("${curl}",w);d=d.replace("${noisecommon}",Te);d=d.replace("${pnoise}",Oe);d=d.replace("${snoise}",Ue);d=d.replace("${grain}",Xe);d=d.replace("${noise}",Ge);d=d.replace("${fm}",Ye);d=d.replace("${adjust}",Je);d=d.replace("${blend}",Re);d=d.replace("${edge}",je);d=d.replace("${wrapuv}",Nt);d=d.replace("#rtfmla",D.rtfmla);d=d.replace("#rtaddfmla",D.rtaddfmla);d=d.replace("#rtswlfmla",D.rtswlfmla);d=d.replace("#wrapx",D.wrapx);new THREE.Vector2;new THREE.Vector3;const Ze=new THREE.Vector4,Ot=l=>{let c=null,s=null,a,o,t,i,u,f=null,R=ze(4096);const $=()=>{c=Bt(),s=Wt(c.getColorTexture())},T=()=>{a=new THREE.Scene,o=new THREE.PerspectiveCamera(45,e.width/e.height,.01,100);let x=oe(e.bgColor);x=ne(x.h,x.s,x.l);let p=[],I=[];t=new THREE.ShaderMaterial({defines:{nbdrts:e.dirts.length},uniforms:{ures:{value:new THREE.Vector2(e.width,e.height)},uDebug:{value:e.debugView},tInput:{value:c.getColorTexture()},tWrap:{value:c.getWrapTexture()},tDirtInput:{value:c.gtdtColorTexture()},tDarkInput:{value:c.getColorSelectionTexture()},tContourInput:{value:c.getContourTexture()},tRotationInput:{value:c.getRotationTexture()},tEmpties:{value:c.getEmptiesTexture()},tStrokesInput:{value:s.getColorTexture()},ubg:{value:new THREE.Vector4(x.r/255,x.g/255,x.b/255,e.bgColorScale)},upprCBSE:{value:new THREE.Vector4(e.pprcntrst,e.pprbrhtnss,e.pprstrtn,e.pprxpsr)},uartcbse:{value:new THREE.Vector4(e.artcntrst,e.artbrhtnss,e.artstrtn,e.artxpsr)},uarthsft:{value:e.arthsft},ucbse:{value:new THREE.Vector4(e.cntrst,e.brhtnss,e.strtn,e.xpsr)},uptscl:{value:e.pertubScale},uptuvscl:{value:e.pertubUVScale},uptuvtrlt:{value:new THREE.Vector2(e.pertubUVTranslateX,e.pertubUVTranslateY)},uclddgrtrlt:{value:new THREE.Vector2(e.clddegtrslt.x,e.clddegtrslt.y)},uclattscl:{value:e.clattScale},ugrnscl:{value:e.grainResScale},ucntr:{value:new THREE.Vector3(1,e.contourWidth,1)},unblns:{value:new THREE.Vector2(e.nbLinesX,e.nbLinesY)},ucllbrdsz:{value:e.cellBorderSize},ucrl:{value:new THREE.Vector4(e.curl.pos.x,e.curl.pos.y,e.curl.scl.x,e.curl.scl.y)},ucrlwrp:{value:new THREE.Vector2(e.curl.wrap.x,e.curl.wrap.y)},ucrlscl:{value:e.form.crlsck2},upclskint:{value:e.pclstkIntensity},unseclint:{value:e.nsyclIntensity},uogclint:{value:e.isDark?0:e.ogclint},uhstkint:{value:e.hstkIntensity},ufzzstkint:{value:e.fzzstkint},udkint:{value:e.darkIntensity},uswl:{value:new THREE.Vector3(e.swl[0],e.swl[1],e.swl[2])},ucllff:{value:new THREE.Vector2(e.ucllff.x,e.ucllff.y)},udkn:{value:e.isDark?1:0},udkncl:{value:new THREE.Vector4(x.r/255,x.g/255,x.b/255,e.bgColorScale)},upprtp:{value:new THREE.Vector2(e.pprType.x,e.pprType.y)},uscrch:{value:new THREE.Vector2(e.scrch.x,e.scrch.y)},uwrsz:{value:new THREE.Vector4(e.wearSize.x,e.wearSize.y,e.wearSize.y,e.wearSize.w)},uglrt:{value:e.globalRot},ufllcll:{value:new THREE.Vector2(e.fllclls.x?1:0,e.fllclls.y)},uframeprm:{value:new THREE.Vector4(e.frameParams.x,e.frameParams.y,e.frameParams.z,e.frameParams.w)},ungt:{value:new THREE.Vector2(e.night[0],e.night[1])},uDirts:{value:p},udtintfq:{value:I},udtbld:{value:e.dirtBlend},usqss:{value:new THREE.Vector2(e.issqusse[0],e.issqusse[1])},urnd:{value:e.rnd},upidx:{value:e.paletteIdx},uWRes:{value:e.scl},urt:{value:e.rotate},urtfq:{value:e.rotateFreq},uedgwdh:{value:e.edgeWidth},uflp:{value:new THREE.Vector2(e.flip.x,e.flip.y)},uStep:{value:1}},vertexShader:j,fragmentShader:d}),t.ex
.x) + mid.y);}vec2 rotate(vec2 uv, float rotation, float mid){return vec2(cos(rotation) * (uv.x - mid) + sin(rotation) * (uv.y - mid) + mid,cos(rotation) * (uv.y - mid) - sin(rotation) * (uv.x - mid) + mid);}vec2 scale(vec2 uv, float scale, vec2 origin) {return (uv - origin) * scale + origin;}vec2 scale(vec2 uv, vec2 scale, vec2 origin) {return (uv - origin) * scale + origin;}\n${edge}${noisecommon}${pnoise}${snoise}${grain}${noise}${curl}${adjust}${blend}${fm}\nfloat rnduv(vec2 uv){float seed = uv.y * 100000.;float r = abs(tan(sin(uv.y * seed) * seed));return sqrt(1. - r) * 2. - 1.;}vec3 gtgrn() {float grainPertub = noise(vec3(vUv * vec2(4., 80.), 0.));grainPertub /= noise(vec3(vUv * vec2(40., 8.), 0.));vec3 cnoise = vec3(grain(vUv, vec2(2100., 2800.) * ugrnscl + grainPertub*.3));return cnoise;}float gtstns(vec2 offset) {float stains = 1. - vec3(grain(vUv + vec2(offset), vec2(2100., 2800.) * .0025)).r;float stainsEdges = 0.1;float stainsThreshold = .7;stains = smoothstep(stainsThreshold + stainsEdges, stainsThreshold - stainsEdges, stains);stains = clamp(stains, 0., 1.);return stains;}vec3 gtnsycl(float offset) {float scly = 1000.;if (ungt.x == 1.) {scly = 100000.;}vec2 tinywrapUV = scale(vUv, vec2(50., scly) + vec2(0., urnd * 500.), vec2(0.5));float tinywrap = noise(vec3(tinywrapUV, offset));vec2 tinyuv = vUv * vec2(tinywrap);vec3 nsycl = texture2D(tInput, tinyuv).rgb;return nsycl;}vec3 gtpclstk(float offset) {vec2 pencilstkuv = vUv + vec2(0., urnd);pencilstkuv = scale(pencilstkuv, vec2(5., 1000.), vec2(.5));vec3 curl = crlnse(vec3( (vUv*ucrl.z*1.1)+vec2(ucrl.y, ucrl.x), 0.));pencilstkuv = rotate(pencilstkuv, curl.r * .5);float pclstkPertub = noise(vec3(pencilstkuv, offset));vec2 pencilStrokeUv = vUv + vec2(pclstkPertub) * .2;vec3 c = texture2D(tInput, pencilStrokeUv).rgb * 10.;return c;}vec3 applycbse(vec3 c, vec4 cbse) {c = cntrst(c, cbse.r);c = brhtnss(c, cbse.g);c = strtn(c, cbse.b);c = xpsr(c, cbse.a);return c;}float gtdt(vec2 coords, vec2 levels) {float dirt = fm1(coords);dirt = max(levels.x, min(dirt, levels.y));dirt = map(dirt, levels.x, levels.y, 0., 1.);return dirt;}vec3 rgb2hsv(vec3 rgb) {float Cmax = max(rgb.r, max(rgb.g, rgb.b));float Cmin = min(rgb.r, min(rgb.g, rgb.b));float delta = Cmax - Cmin;vec3 hsv = vec3(0., 0., Cmax);if (Cmax > Cmin) {hsv.y = delta / Cmax;if (rgb.r == Cmax) {hsv.x = (rgb.g - rgb.b) / delta;}else {if (rgb.g == Cmax) {hsv.x = 2. + (rgb.b - rgb.r) / delta;}else {hsv.x = 4. + (rgb.r - rgb.g) / delta;}}hsv.x = fract(hsv.x / 6.);}return hsv;}float chrky(vec3 color, vec3 bgcolor, vec3 weightsOffset) {vec3 backgroundColor = bgcolor;vec3 weights = vec3(4., 1., 2.) + weightsOffset;vec3 hsv = rgb2hsv(color);vec3 target = rgb2hsv(backgroundColor);float dist = length(weights * (target - hsv));return 1. - clamp(3. * dist - 1.5, 0., 1.);}void main() {float ratio = ures.x/ures.y;vec3 c = texture2D(tInput, vUv).rgb;vec3 oc = c;vec3 dirtc = texture2D(tDirtInput, vUv).rgb;float empty = 1.;if (uStep > 3.) {empty = texture2D(tEmpties, vUv).r;}vec3 cnoise = gtgrn();float stains = gtstns(c.rg);vec3 bgColor = ubg.rgb * ubg.a;float pertub = noise(vec3((vUv*uptuvscl * .3)+uptuvtrlt, 0.)) ;pertub += sn3d(vec3( (vUv* 6.7)+uptuvtrlt, 0.) ) * 0.01;float simplex = sn3d( vec3( (vUv*uptuvscl * 10.7)+uptuvtrlt, 0. ) );float simplex2 = sn3d( vec3( (vUv*uptuvscl * 1.7)+uptuvtrlt, 0. ) );vec3 curl = crlnse(vec3( (vUv*vec2(1., 1./ratio)*ucrl.z*ucrlscl)+vec2(ucrl.x, ucrl.y), 0.));vec3 dirtc2 = texture2D(tDirtInput, vUv + vec2(simplex*.005)).rgb;dirtc2 *= fm1(vUv*20.+uptuvtrlt);float m = mod(vUv.y * 3., .025);m = step(m, .01);if (uStep > 13.) {dirtc2 *= m;}float xdgemsk = noise(vec3(vUv * vec2(uframeprm.x + c.r, uframeprm.y), .0));float ydgemsk = noise(vec3(vUv * vec2(uframeprm.z + c.r, uframeprm.w), .0));float xdge = .02 + sin(vUv.y*15. + uptuvtrlt.x + vUv.x * 10.) * .003;float ydge = xdge * ratio + sin(vUv.x*10. + uptuvtrlt.y + vUv.y * 10. * curl.r * 2.) * .002;xdge += xdgemsk * .02 + abs(sin(vUv.x * 50.)) * .003;ydge += ydgemsk * .007 + sin(vUv.x * 5. + uptuvtrlt.x + step(vUv.y, .5)) * .0025;float framex = 1.;float framey = 1.;float frame = 1.;if (vUv.x < xdge || vUv.x > 1. - xdge ) { framex = 0.;}if (vUv.y < ydge || vUv.y > 1. - ydge ) { framey = 0.;}frame = framex * framey;float xsqssedgmsk = noise(vec3(vUv * vec2(uframeprm.x + c.r, uframeprm.y), .0));float ysqssedgmsk = noise(vec3(vUv * vec2(uframeprm.z + c.r, uframeprm.w), .0));float xsqssedg = .005 + sin(vUv.y*15. + uptuvtrlt.x + vUv.x * 10.) * .003;float ysqssedg = xsqssedg * ratio + sin(vUv.x*10. + uptuvtrlt.y + vUv.y * 10. * curl.r * 2.) * .002;xsqssedg += xsqssedgmsk * .02 + abs(sin(vUv.x * 50.)) * .009;ysqssedg += ysqssedgmsk * .007 + sin(vUv.x * 5. + uptuvtrlt.x + step(vUv.y, .5)) * .005;float framesqssx = 1.;float framesqssy = 1.;float framesqss = 1.;if (vUv.x < xsqssedg || vUv.x > 1. - xsqssedg ) { framesqssx = 0.;}if (vUv.y < ysqssedg || vUv.y > 1. - ysqssedg ) { framesqssy = 0.;}framesqss = framesqssx * framesqssy;\n${wrapuv}\nvec3 pclstkcl = gtpclstk(c.r);vec3 nsycl = gtnsycl(c.r);vec3 wrpcl = texture2D(tInput, wrapuv).rgb;float wrapRot = texture2D(tRotationInput, wrapuv).r;wrpcl *= fllcll;float cmask = step( length(wrpcl), 0. );float clltsh = .1;wrpcl *= empty;float stkrt = xpsr(vec3(wrpcl.r / wrpcl.b), 2.).r;vec2 stkuv = rotate(vUv, wrapRot + PI * .5 + curl.r * 50. + stripes + length(wrpcl) * 2. + cellId.x * PI * 1., vec2(.5));vec2 stkuv2 = rotate(vUv * vec2(1., 5.), wrapRot + curl.b * .5 + cellId.x * PI * 1., vec2(.5));vec2 stkuv3 = rotate(vUv * vec2(1., 30.), wrapRot + curl.b * .8 + cellId.x * PI * 1., vec2(.5));vec3 hstk = texture2D(tStrokesInput, stkuv).rgb;vec3 hstk2 = texture2D(tStrokesInput, stkuv2).rgb;vec3 hstk3 = texture2D(tStrokesInput, stkuv3).rgb;float hstk2Sat = -.05;if (ungt.x == 0.) {hstk2Sat = -1.;}hstk = strtn(hstk, -1.);hstk2 = strtn(hstk2, hstk2Sat);hstk3 = strtn(hstk3, -1.);float cctr = texture2D(tContourInput, wrapuv).r * 10.;cctr = clamp(cctr, 0., 1.);cctr = strtn(vec3(cctr), -1.).r;if (usqss.x == 0. && uStep > 11.) {wrpcl *= frame;}if (ucntr.z == 1.) {cctr *= frame;}cmask -= 1. - frame;hstk *= frame;hstk2 *= frame;hstk3 *= frame;float oclint = 0.;if (uStep > 9.) {oclint = uogclint;}c = bldscn(wrpcl, dirtc, oclint);if (uStep > 13.) {}if (uStep > 9.) {c = bldovl(c, nsycl, unseclint);}vec3 pclstk = strtn(pclstkcl, -1.);if (uStep > 17.) {c -= pclstk * upclskint * length(c) * frame;c = clamp(c, 0., 1.);}vec3 desathstk = strtn(hstk, -.95);if (uStep > 13. && empty > 0.) {c = bldav(c, vec3(desathstk), (1. - cmask) * uhstkint);c = bldav(c, vec3(hstk2), (1. - cmask) * uhstkint);c = bldav(c, vec3(hstk3), (1. - cmask) * uhstkint);}c = hsft(c, uarthsft);vec4 artcbse = vec4(uartcbse.x, 0., uartcbse.z, uartcbse.w);if (uStep > 6.) {artcbse.y = uartcbse.y; }c = applycbse(c, artcbse);float cntrdge = edge(tContourInput, wrapuv, vec2(ures.x, ures.y) * uedgwdh );cntrdge = clamp(cntrdge, 0., 1.);cntrdge *= pertub;if (uStep > 7.) {c += cnoise * .2;}if (ucntr.x == 1. && uStep > 12.) {float intensity = ungt.x == 1. ? .7 : 1.;if (frame == 1.) {intensity *= 1.05;}if (usqss.y == 0.) {c = bldav(c, vec3(1.), cntrdge * intensity);}if (usqss.y == 1.) {c -= vec3(-.12) * cntrdge;}}float xhashPertub = noise(vec3((vUv * vec2(100., 10.) + vec2(stripes)), 0.)) * 3. ;float yhashPertub = noise(vec3((vUv * vec2(1., 100.) + vec2(-.5)), 0.)) * 3. ;float xhshffst = (floor((vUv.y*10.))/10.);float hshmsk = 1. - vec3( cntrst(vec3(length(c)), 4.)).r;float hshres = 200.;if (upprtp.y == 1.) { hshres = 150.; }float xhsh = smoothstep(.1, .15, fract((vUv.x+xhshffst * 20.) * hshres));float yhsh = smoothstep(.1, .15 + pertub * .3, fract(vUv.y * hshres + yhashPertub * .1 )) + .2;float hashes = xhsh;if (uStep > 4.) {if (upprtp.x == 1.) {hashes = xhsh * yhsh;}if (upprtp.y == 0.) {c = bldmt(c, vec3(hashes), -.5 * (1.3-length(c)));}else {c = bldovl(c, vec3(hashes), 0.2 * (1.3-length(clamp(c,0., 1.))));}}float scratchPertub = noise(vec3(( (vUv+uptuvtrlt) * vec2(uwrsz.x, uwrsz.y * pertub * 10.) + vec2(-.5)), 0.)) * 3.;float yscratchPertub = noise(vec3(( (vUv+uptuvtrlt) * vec2(uwrsz.z, uwrsz.w * pertub * 1.) + vec2(-.5)), 0.)) * 3.;float xscrch = smoothstep(.5, .7, scratchPertub);float yscrch = smoothstep(.5, .7, yscratchPertub);float scrch = ( xscrch * yscrch);if (uStep > 14.) {c = bldovl(c, vec3(scrch), uscrch.x );}vec2 dvslnuv = rotate(vUv, urt * sin(vUv.y * unblns.x * urtfq + uptuvtrlt.x), vec2(.5));dvslnuv.x = mix(vUv.x, dvslnuv.x, 0.1);float yclluvy = dvslnuv.y + sin(dvslnuv.x * 30. + curl.r * 4.) * .001 * curl.r;float xcllbrd = ( fract( yclluvy + v ) * nbStripes) / nbStripes;xcllbrd = fract( xcllbrd * nbStripes );float xcllbrdfsst = fm1((dvslnuv+uptuvtrlt)*30.) * 2.;xcllbrd = smoothstep(.0, (ucllbrdsz * .65) * xcllbrdfsst, xcllbrd);if (framey == 0.) {xcllbrd = 1.;}float yclluvx = dvslnuv.x + sin(dvslnuv.y * 20. + curl.r * 4.) * .0025 * curl.r;float ycllbrd = ( fract( yclluvx + v ) * nbStripes) / nbStripes;ycllbrd = fract( ycllbrd * nbStripes );float ycllbrdfsst = fm1((dvslnuv+uptuvtrlt)*30.) * 2.;ycllbrd = smoothstep(.0, ucllbrdsz * ycllbrdfsst, ycllbrd);if (framex == 0.) {ycllbrd = 1.;}float cllbrd = xcllbrd * ycllbrd;if (unblns.x > 1. && uStep > 5.) {c = bldmt(c, vec3(cllbrd), -1.9 * (1.-le
=$[n],C=S.c,g=oe(C),F=ne(g.h,g.s,g.l);let X=S.i||.2;R.push({c:F,i:X})}let T,E,x,p,I,te,J,q=null;const A=()=>{const n=e.width,S=e.height/2,C=e.artdens;for(let g=0;g<ae;g++){let F=r.random()<.7?.1:.08;F+=r.random()*.1;let X=e.width*F,V=.01425313569*e.height,ue=.01425313569*e.height,H=n*(Math.floor(r.random()*C)/C),B=S;{H+=r.random()>.7?r.random()*n*.05:0;const L=e.artdens==10?0:.6;B+=r.random()>L?r.range(-1,1)*V*.125:0}g>20&&(e.strongStrokes||(V*=.1),H=r.random()*n,(e.strongStrokes||e.density>6)&&(B=r.random()*S));const M=g%$.length,h=R[M],z=h.c;let re=h.i;const ve=r.random()*Math.PI*2;t[M]||(t[M]=[]),t[M].push(H/e.width,B/e.height,X/e.width,V/e.height),c.push(H/e.width,B/e.height,X/e.width,V/e.height),a.push(H/e.width,B/e.height,X/e.width,ue/e.height),s.push(z.r/255,z.g/255,z.b/255,re),o.push(z.r/255,z.g/255,z.b/255,re),i.push(ve)}},tt=()=>{const n=e.nbLinesX,S=512,C=document.createElement("canvas");C.width=S,C.height=S;const g=C.getContext("2d"),F=S/n,X=r.tk.tokenId.substr(r.tk.tokenId.length-3,r.tk.tokenId.length),V=Mt[X]||[],ue=[];for(let h=0;h<V.length;h+=2)ue.push([V[h],V[h+1]]);let H=1,B=1,M=0;V[0]%1<1&&(H=V[0],B=V[1]||1,M=V[2]||0);for(let h=0;h<n;h++)for(let z=0;z<n;z++){const re=[h,z];let ve="white",L=ue.find(Ce=>Ce[0]==re[0]&&Ce[1]==re[1]);n==30&&(M==0&&(L=Math.sin(h*z+e.rnd)*B>H),M==1&&(L=Math.sin(h*z*z+e.rnd)*B>H),M==2&&(L=Math.sin(h*z+e.rnd*h*3)*B>H)),n==100&&(M==0&&(L=Math.cos(h*z+e.rnd)*Math.sin(h+e.rnd)*3>H),M==1&&(L=Math.cos(h*z+e.rnd)*Math.sin(h+e.rnd)*4>H)),L&&(ve="black");const kt=h*F,Et=z*F;g.save(),g.translate(kt,Et),g.fillStyle=ve,g.beginPath(),g.rect(0,0,F,F),g.fill(),g.closePath(),g.restore()}f=new THREE.Texture(C,THREE.UVMapping,THREE.ClampToEdgeWrapping,THREE.ClampToEdgeWrapping,THREE.NearestFilter,THREE.NearestFilter),f.minFilter=THREE.NearestFilter,f.maxFilter=THREE.NearestFilter,f.needsUpdate=!0},rt=()=>{for(let n=0;n<6;n++){const S=ze();l.push(S)}l[5].setSize(64,64),l[4].setSize(64,64),u=ze()},lt=()=>{let n=$.filter(S=>S.sh!==void 0);n.length?n=n[0].sh:n=0,p=new THREE.ShaderMaterial({defines:{nbshp:ae,nbshpROT:Ke},uniforms:{ures:{value:new THREE.Vector2(e.width,e.height)},ucntr:{value:new THREE.Vector2(0,e.contourWidth)},uskptsh:{value:e.skipThreshold},uhgtml:{value:2},ushp:{value:c},ushpcl:{value:s},uRotations:{value:i},uStep:{value:e.step},ugrdlmt:{value:new THREE.Vector2(e.artgrdlmt.x,e.artgrdlmt.y)},uRenderRot:{value:0},uShift:{value:n}},vertexShader:j,fragmentShader:ee})},ct=()=>{J=new THREE.ShaderMaterial({uniforms:{ures:{value:new THREE.Vector2(e.width,e.height)},tInput:{value:l[0].texture},tContourInput:{value:l[1].texture},uptuvtrlt:{value:new THREE.Vector2(e.pertubUVTranslateX,e.pertubUVTranslateY)},unblns:{value:new THREE.Vector2(e.nbLinesX,e.nbLinesY)},ucrl:{value:new THREE.Vector4(e.curl.pos.x,e.curl.pos.y,e.curl.scl.x,e.curl.scl.y)},ucrlscl:{value:e.form.crlsck2},uswl:{value:new THREE.Vector3(e.swl[0],e.swl[1],e.swl[2])},ucrlwrp:{value:new THREE.Vector2(e.curl.wrap.x,e.curl.wrap.y)},ucllff:{value:new THREE.Vector2(e.ucllff.x,e.ucllff.y)},ucntr:{value:0},ufm:{value:new THREE.Vector3(12.9898,78.233,43758.5453)}},vertexShader:j,fragmentShader:m})},st=()=>{te=new THREE.ShaderMaterial({defines:{nbshp:ae,nbshpROT:Ke},uniforms:{ures:{value:new THREE.Vector2(e.width,e.height)},uskptsh:{value:e.skipThreshold},uhgtml:{value:2},ushp:{value:a},ushpcl:{value:o},ucntr:{value:new THREE.Vector2(0,0)},ugrdlmt:{value:new THREE.Vector2(e.artgrdlmt.x,e.artgrdlmt.y)}},vertexShader:j,fragmentShader:ee})},nt=()=>{let n=$.filter(g=>g.d!==void 0);n=n.length?n[0]:{c:"#ffffff",i:0,d:0};const S=oe(n.c),C=ne(S.h,S.s,S.l);I=new THREE.ShaderMaterial({defines:{nbshp:ae},uniforms:{ures:{value:new THREE.Vector2(e.width,e.height)},uskptsh:{value:e.skipThreshold},ushp:{value:c},ushpcl:{value:s},udkncl:{value:new THREE.Vector4(C.r/255,C.g/255,C.b/255,n.i)}},vertexShader:j,fragmentShader:Ie}),e.darken=n.d,e.darkenColor=n.dc||"#555555"},ot=()=>{T=new THREE.Scene,E=new THREE.PerspectiveCamera(45,e.width/e.height,.01,100),nt(),st(),ct(),lt(),x=new THREE.PlaneBufferGeometry(2,2),q=new THREE.Mesh(x,p),T.add(q)},at=n=>{I.uniforms.uskptsh.value=e.skipThreshold,n.setRenderTarget(u),q.material=I,n.render(T,E)},it=n=>{p.uniforms.ugrdlmt.value.x=e.artgrdlmt.x,p.uniforms.ugrdlmt.value.y=e.artgrdlmt.y,p.uniforms.ucntr.value.x=0,p.uniforms.uRenderRot.value=0,p.uniforms.uskptsh.value=e.skipThreshold,p.uniforms.uStep.value=e.step,n.setRenderTarget(l[0]),q.material=p,n.render(T,E),p.uniforms.ugrdlmt.value.x=1,p.uniforms.ugrdlmt.value.y=1,n.setRenderTarget(l[5]),n.render(T,E),p.uniforms.uRenderRot.value=1,n.setRenderTarget(l[4]),n.render(T,E)},ut=n=>{n.setRenderTarget(l[2]),q.material=te,n.render(T,E),n.setRenderTarget(null)},vt=n=>{p.uniforms.uRenderRot.value=0,p.uniforms.ucntr.value.x=1,n.setRenderTarget(l[1]),q.material=p,n.render(T,E)},ft=n=>{J.uniforms.ucntr.value=0,q.material=J,n.setRenderTarget(l[3]),n.render(T,E)},dt=n=>{f.needsUpdate=!0,it(n),ut(n),at(n),vt(n),ft(n),n.setRenderTarget(null)},pt=()=>l[0].texture,mt=()=>l[5].texture,xt=()=>l[1].texture,ht=()=>u.texture,gt=()=>l[2].texture,bt=()=>l[3].texture,yt=()=>l[4].texture,wt=()=>f;return tt(),rt(),A(),ot(),{getContourTexture:xt,getColorTexture:pt,getColorTextureNoG:mt,getColorSelectionTexture:ht,gtdtColorTexture:gt,getWrapTexture:bt,getRotationTexture:yt,getEmptiesTexture:wt,render:dt}};var Ft=`#define PI 3.14159 uniform sampler2D tInput;uniform vec3 uffst;varying vec2 vUv; vec2 rotate(vec2 uv, float rotation){float mid = 0.5;return vec2(cos(rotation) * (uv.x - mid) + sin(rotation) * (uv.y - mid) + mid,cos(rotation) * (uv.y - mid) - sin(rotation) * (uv.x - mid) + mid);}vec2 rotate(vec2 uv, float rotation, vec2 mid){return vec2(cos(rotation) * (uv.x - mid.x) + sin(rotation) * (uv.y - mid.y) + mid.x,cos(rotation) * (uv.y - mid.y) - sin(rotation) * (uv.x - mid.x) + mid.y);}vec2 rotate(vec2 uv, float rotation, float mid){return vec2(cos(rotation) * (uv.x - mid) + sin(rotation) * (uv.y - mid) + mid,cos(rotation) * (uv.y - mid) - sin(rotation) * (uv.x - mid) + mid);}vec2 scale(vec2 uv, float scale, vec2 origin) {return (uv - origin) * scale + origin;}vec2 scale(vec2 uv, vec2 scale, vec2 origin) {return (uv - origin) * scale + origin;} \${noisecommon} \${snoise} vec3 gtpclstk2(vec2 res, float offset) {vec2 pencilstkuv = scale(vUv, res, vec2(1.5, .0));float pclstkPertub = sn3d(vec3(pencilstkuv, offset));vec2 pencilStrokeUv = vUv + vec2(pclstkPertub) * .2;vec3 c = texture2D(tInput, pencilStrokeUv).rgb * 10.;return c;}void main() {vec3 c = gtpclstk2(vec2(.1, 10.), 0.);c += gtpclstk2(vec2(.1, 50.), 0.) * .3;c = clamp(c, 0., 1.);gl_FragColor = vec4(c, 1.);}`;let ie=Ft;ie=ie.replace("${noisecommon}",Te);ie=ie.replace("${snoise}",Ue);const Wt=l=>{let c=l,s=null,a,o,t,i,u=null;const f=()=>{const E=4096;s=new THREE.WebGLRenderTarget(E,E,{minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter}),s.texture.wrapS=THREE.MirroredRepeatWrapping,s.texture.wrapT=THREE.MirroredRepeatWrapping},R=()=>{a=new THREE.Scene,o=new THREE.PerspectiveCamera(45,e.width/e.height,.01,100),i=new THREE.ShaderMaterial({uniforms:{tInput:{value:c},uffst:{value:new THREE.Vector4(e.curl.pos.x,e.curl.pos.y,e.curl.scl.x,e.curl.scl.y)}},vertexShader:j,fragmentShader:ie}),t=new THREE.PlaneBufferGeometry(2,2),u=new THREE.Mesh(t,i),a.add(u)},$=()=>s.texture,T=E=>{E.setRenderTarget(s),E.render(a,o),E.setRenderTarget(null)};return f(),R(),{getColorTexture:$,render:T}};var At="#define PI 3.14159\nuniform vec2 ures;uniform sampler2D tInput;uniform sampler2D tWrapInput;uniform sampler2D tDirtInput;uniform sampler2D tContourInput;uniform sampler2D tStrokesInput;uniform sampler2D tDarkInput;uniform sampler2D tRotationInput;uniform sampler2D tEmpties;uniform vec4 ubg;uniform vec4 ucbse;uniform vec4 uartcbse;uniform float uarthsft;uniform float urnd;uniform float uptscl;uniform float uptuvscl;uniform vec2 uptuvtrlt;uniform float uclattscl;uniform vec2 uclddgrtrlt;uniform float ugrnscl;uniform vec2 unblns;uniform vec4 ucrl;uniform vec2 ucrlwrp;uniform float ucrlscl;uniform vec2 ucllff;uniform vec2 upprtp;uniform vec2 uscrch;uniform vec4 uwrsz;uniform float uglrt;uniform vec2 ufllcll;uniform vec4 uframeprm;uniform vec2 ungt;uniform float udtbld;uniform vec4 uDirts[nbdrts];uniform vec2 udtintfq[nbdrts];uniform float ucllbrdsz;uniform float upclskint;uniform float unseclint;uniform float uogclint;uniform float uhstkint;uniform float ufzzstkint;uniform float udkint;uniform vec3 uswl;uniform vec2 uppruvfsst;uniform float uDebug;uniform float udkn;uniform vec3 udkncl;uniform vec2 usqss;uniform float urt;uniform float urtfq;uniform vec3 ucntr;uniform float uedgwdh;uniform float upidx;uniform float uStep;uniform vec2 uflp;varying vec2 vUv;\nfloat map(float value, float min1, float max1, float min2, float max2) {return min2 + (value - min1) * (max2 - min2) / (max1 - min1);}\nvec2 rotate(vec2 uv, float rotation){float mid = 0.5;return vec2(cos(rotation) * (uv.x - mid) + sin(rotation) * (uv.y - mid) + mid,cos(rotation) * (uv.y - mid) - sin(rotation) * (uv.x - mid) + mid);}vec2 rotate(vec2 uv, float rotation, vec2 mid){return vec2(cos(rotation) * (uv.x - mid.x) + sin(rotation) * (uv.y - mid.y) + mid.x,cos(rotation) * (uv.y - mid.y) - sin(rotation) * (uv.x - mid
,9,5,9,8],"473":[0,4,1,2,2,4,3,2],"474":[.9],"476":[.7,-1],"477":[0,3,0,9,1,3,1,9,2,3,2,9,3,3,3,9,4,3,4,9,5,3,5,9,6,3,6,9,7,3,7,9,8,3,8,9,9,3,9,9],"479":[0,3,1,0,2,2],"480":[.88,1,1],"483":[1,0],"485":[0,1,0,4,1,0,1,2,1,3,2,1,2,2,2,3,2,4,3,0,3,3,3,4,4,1],"487":[0,2],"488":[1,1],"489":[0,2,2,0],"490":[2,1,2,2,2,4,4,0],"493":[4,1],"494":[.9],"495":[0,0,0,1,0,2,2,0,2,1],"496":[0,3],"497":[1,3,1,4,2,2,4,1],"498":[0,4,2,2,3,1,3,2],"499":[2,1,3,1,3,3],"500":[1,3,2,1,2,4,3,1,3,4],"501":[2,0],"502":[0,0],"503":[.9],"504":[0,0,0,2],"505":[.8],"506":[0,2],"507":[.8,-1,1],"508":[.7,1,1],"509":[2,2],"510":[0,4,2,1,4,3,4,4],"511":[.9],"512":[0,1,0,2,1,0],"513":[0,4,1,4],"514":[0,2],"515":[0,2,0,6,1,3,2,2,2,4,2,5,2,9,4,1,4,2,4,4,4,9,5,1,5,4,6,5,7,4,8,0,8,5,8,9,9,6],"516":[0,0,1,2],"517":[0,2,0,4,0,8,0,9,1,2,1,4,1,8,1,9,2,2,2,4,2,8,2,9,3,2,3,4,3,8,3,9,4,2,4,4,4,8,4,9,5,2,5,4,5,8,5,9,6,2,6,4,6,8,6,9,7,2,7,4,7,8,7,9,8,2,8,4,8,8,8,9,9,2,9,4,9,8,9,9],"518":[2,3],"519":[.95],"520":[0,0,0,1,0,2],"521":[0,3,0,4,0,8,1,0,1,1,1,3,1,5,2,0,2,2,2,5,2,6,2,8,3,0,3,4,3,8,4,0,4,1,4,2,4,4,4,5,4,6,5,1,5,8,6,0,6,1,6,8,7,6,7,7,8,0,8,1,8,3,8,4,8,8,9,1,9,5,9,8],"522":[2.1],"523":[0,2],"524":[2,2],"525":[2.1],"526":[2,0,2,2],"527":[0,0,1,1,2,0,2,2],"528":[0,0,0,1,0,2,1,2,2,3,3,0],"530":[0,1,1,0,1,2,1,3,2,1,2,3,3,3],"531":[2,2],"532":[0,0,0,3,1,1,2,1],"533":[1,0,1,2,2,0,2,3,3,1,3,3,3,4],"534":[0,2,0,8,0,9,3,5,3,8,3,9,4,1,4,7,5,7],"535":[0,0,0,2,0,3,0,6,0,8,0,9,1,0,1,2,1,3,1,6,1,8,1,9,2,0,2,2,2,3,2,6,2,8,2,9,3,0,3,2,3,3,3,6,3,8,3,9,4,0,4,2,4,3,4,6,4,8,4,9,5,0,5,2,5,3,5,6,5,8,5,9,6,0,6,2,6,3,6,6,6,8,6,9,7,0,7,2,7,3,7,6,7,8,7,9,8,0,8,2,8,3,8,6,8,8,8,9,9,0,9,2,9,3,9,6,9,8,9,9],"536":[2,0],"537":[1,3],"538":[0,1,0,2],"541":[.9,-1,1],"543":[0,2,0,4,0,8,0,9,1,2,1,5,2,2,2,5,3,0,3,7,3,8,4,6,4,8,6,5,7,0,7,2,7,3,7,6,7,7,9,0,9,1],"544":[0,0,0,2,2,2],"545":[0,3,1,0,1,3,2,1,2,2,2,3],"546":[0,0,2,2],"547":[.9],"548":[0,0,0,2,1,0],"549":[0,0,0,2,1,1],"550":[2,1],"551":[0,0],"552":[.9],"553":[0,3,1,1,2,1,3,2,3,3],"554":[0,3,1,0,2,0,2,2],"555":[2,4,3,4,4,2],"556":[0,3,2,3,3,0,3,1],"557":[0,3,1,0,3,1],"558":[0,4,2,3,4,4],"559":[0,4,1,4,2,4,3,4,5,4,6,4,7,4,8,4,9,4],"560":[0,4],"562":[0,4],"563":[0,1,0,3,0,5,0,6,0,7,0,9,1,3,1,5,2,3,2,7,3,0,3,4,3,5,3,6,3,7,3,8,4,0,4,1,4,2,4,5,4,6,4,8,4,9,5,0,5,1,5,4,5,9,6,0,6,2,6,3,6,6,6,7,6,9,7,0,7,3,7,5,7,8,7,9,8,4,8,5,8,7,8,9,9,2,9,3,9,4,9,6,9,9],"564":[0,0,0,3,3,0],"565":[0,3,2,0],"566":[1,2,2,2,2,3,4,2,4,4],"568":[0,4,1,4,2,2],"569":[0,5,0,6,0,7,0,8,0,9,1,4,1,9,2,8,2,9,3,8,4,3,5,1,5,7,5,9,6,2,6,6,9,2,9,4],"570":[0,1,0,4,1,1,1,3,2,1,2,2,2,3,3,1,3,2,3,4,4,1,4,2],"571":[0,1,0,4,1,3,3,4],"572":[0,0,0,1,0,3,1,0,1,2,2,3],"573":[0,1,0,4,3,1,4,0,4,3],"574":[0,2,1,2,2,0,2,1],"575":[0,4,1,4,1,6,1,9,2,5,2,8,3,7,4,1,5,2,6,2,7,8,8,8,8,9],"576":[0,0,0,2],"577":[0,3,2,0,2,1],"579":[0,6,1,6,2,6,3,6,4,6,5,6,6,6,7,6,8,6,9,6],"580":[.8],"582":[.7,1,1],"583":[0,1,0,4,1,3,2,0,3,3,4,2],"584":[0,0,0,1,0,2,0,3,0,4,1,2,2,0,2,1,2,2,2,3,2,4,3,4,4,2],"585":[0,4,1,1,2,3],"586":[1,0,1,2,1,3,2,1,3,1],"587":[1.5,2,1],"588":[1,2],"589":[0,6,1,6,2,4,6,7,8,5,8,8],"590":[0,3,1,1,2,2],"591":[1,3,4,0],"592":[0,0,0,4,0,7,1,0,1,4,1,7,2,0,2,4,2,7,3,0,3,4,3,7,4,0,4,4,4,7,5,0,5,4,5,7,6,0,6,4,6,7,7,0,7,4,7,7,8,0,8,4,8,7,9,0,9,4,9,7],"595":[1,0,1,1,1,3,2,0,2,2,4,4],"596":[0,0,0,1,0,2,3,1],"597":[.7],"599":[0,3,1,2,1,3],"600":[0,2],"601":[0,1,0,2,2,2],"602":[0,3,2,3],"604":[0,4,3,4,4,2],"605":[2,1,2,2,3,0,4,3],"606":[0,1,0,4,1,0,1,2,2,4,4,1,4,3],"607":[1,0,1,1,1,2,2,0,2,1,3,1],"608":[0,2,2,1],"609":[0,4,1,0,1,2,2,0,2,1,3,1,3,2,3,3],"612":[0,1,0,2,2,1],"613":[0,0,0,1,0,2,3,3],"614":[1,4,2,0,2,3,2,7,3,4,3,5,3,8,4,8,5,0,5,1,5,6,6,1,6,2,6,7,6,9,7,2,7,3,7,4,7,5,7,6,7,8,8,3,8,6,9,5,9,9],"616":[1,1],"617":[0,1,0,4,1,3,1,4,2,0,2,4,4,1,4,2,4,4],"618":[0,2,0,6,1,2,1,6,2,2,2,6,3,2,3,6,4,2,4,6,5,2,5,6,6,2,6,6,7,2,7,6,8,2,8,6,9,2,9,6],"619":[0,4,1,4,2,4,3,4,4,4,5,4,6,4,7,4,8,4,9,4],"620":[.95],"621":[0,0,0,1,0,2,1,1,2,0],"622":[.8,1,1],"623":[0,0,0,1,0,2,3,1],"624":[0,0,0,2,0,3,0,8,0,9,2,0,2,3,2,7,3,1,4,4,4,5,4,8,5,1,5,7,6,0,6,9,7,0,7,2,8,4,8,5,9,5],"626":[0,3,1,1,2,1,2,2],"627":[0,0],"628":[0,4,4,0],"629":[0,0,0,2,2,0],"631":[1,1,1,3,2,0,2,1,2,3,3,3],"632":[0,1],"634":[0,4,1,3,2,0,2,1,3,3,3,4,4,0,4,1],"635":[1,1],"636":[1,1,4,4],"638":[0,1,1,3,2,3],"641":[0,1],"643":[],"644":[0,1,0,4,2,2,4,4],"645":[0,4,1,4,2,4,3,4,4,4,5,4,6,4,7,4,8,4,9,4],"646":[0,0,0,1,0,2],"647":[0,2],"648":[0,2],"649":[0,4,2,1],"650":[0,4,1,0,1,1,1,5,1,7,2,2,3,4,3,6,3,8,4,9,5,0,5,6,6,0,6,6,6,7,6,8,7,9],"652":[1,2,2,2,2,3],"653":[0,0,0,3,0,9,1,0,1,3,1,9,2,0,2,3,2,9,3,0,3,3,3,9,4,0,4,3,4,9,5,0,5,3,5,9,6,0,6,3,6,9,7,0,7,3,7,9,8,0,8,3,8,9,9,0,9,3,9,9],"654":[2.1],"655":[0,3,2,0,2,1,2,2,2,3,3,2,3,3],"656":[0,1,0,3,0,4,1,4,2,2,2,3,2,4,3,2,3,3,4,1,4,4],"658":[.9],"659":[0,2],"661":[0,2,1,1,1,2,2,2],"662":[1,2,1,3,2,3],"663":[0,1,0,4,4,0],"665":[0,4,3,0,4,3],"669":[0,0,0,1,0,2,0,3,0,4,1,4,2,3,4,1,4,3,4,4],"670":[0,3,1,0],"671":[0,1,0,2],"672":[1,3,2,4,4,4],"674":[0,1,0,4,1,3,2,4,3,0,3,1],"676":[0,0],"677":[0,1,0,4,3,3],"678":[0,1,1,1,1,3,2,3],"679":[0,2,2,2],"680":[0,4,1,0,2,0,4,0],"681":[0,0,0,2,1,0,2,2],"682":[0,2],"683":[0,0,1,1,1,2],"684":[0,2,0,6,0,8,1,7,1,9,2,0,2,2,2,8,3,0,3,5,3,8,3,9,4,6,5,2,5,5,5,8,6,3,6,5,6,6,6,8,7,1,7,2,7,5,7,9,8,3,8,5,8,8,9,4,9,6],"685":[0,0,0,1,0,3],"686":[0,4,1,4,2,4,3,4,4,4,5,4,6,4,7,4,8,4,9,4],"687":[0,0,0,4,0,7,1,0,1,4,1,7,2,0,2,4,2,7,3,0,3,4,3,7,4,0,4,4,4,7,5,0,5,4,5,7,6,0,6,4,6,7,7,0,7,4,7,7,8,0,8,4,8,7,9,0,9,4,9,7],"688":[3,1],"689":[0,0,0,2,0,9,1,0,1,9,2,1,3,0,3,6,3,7,3,8,4,2,4,3,4,4,4,9,5,1,5,2,5,9,6,0,6,1,6,2,6,4,7,3,7,8,8,0,8,3,8,4,9,0,9,1,9,2,9,4,9,5,9,7,9,8,9,9,6,7,7,6],"691":[0,0,0,2,1,0],"692":[0,1,0,3,0,5,0,6,0,7,0,9,1,1,1,3,1,5,1,6,1,7,1,9,2,1,2,3,2,5,2,6,2,7,2,9,3,1,3,3,3,5,3,6,3,7,3,9,4,1,4,3,4,5,4,6,4,7,4,9,5,1,5,3,5,5,5,6,5,7,5,9,6,1,6,3,6,5,6,6,6,7,6,9,7,1,7,3,7,5,7,6,7,7,7,9,8,1,8,3,8,5,8,6,8,7,8,9,9,1,9,3,9,5,9,6,9,7,9,9],"693":[0,2,1,1],"694":[0,0,0,2],"696":[.85],"698":[0,2,0,8,0,9,1,4,3,0,3,2,3,9,4,1,4,2,6,1,6,7,9,3],"701":[.9],"702":[0,3,2,2],"703":[0,0,0,2],"704":[2,3,3,1,4,4],"705":[0,2,0,4,0,8,0,9,1,2,1,4,1,8,1,9,2,2,2,4,2,8,2,9,3,2,3,4,3,8,3,9,4,2,4,4,4,8,4,9,5,2,5,4,5,8,5,9,6,2,6,4,6,8,6,9,7,2,7,4,7,8,7,9,8,2,8,4,8,8,8,9,9,2,9,4,9,8,9,9],"706":[1,2,3,0],"707":[0,4,1,0,1,2,1,3,1,4,2,1,3,4,4,1,4,4],"708":[1,2],"709":[.95],"710":[0,3,1,1,2,1,2,2],"711":[0,0,1,2],"712":[.9],"713":[1,0],"714":[.8,1.5,1],"715":[0,4,1,4,2,3,2,4,3,0,3,3,4,0,4,3],"716":[0,1,0,2,2,0],"717":[1,2,3,1,4,2],"718":[0,0],"719":[0,1,0,4,1,4,2,1,2,2,2,4],"720":[0,3,2,1],"722":[2,3],"723":[0,0,0,2,1,0,1,1,2,1,2,2],"724":[.92],"725":[0,4,2,1,2,2],"726":[.8],"727":[0,3,3,1],"728":[0,2,1,2,2,0],"729":[0,0,0,1,0,2,1,2,2,0,3,0,3,2],"730":[2,0,2,4,3,0,4,1],"731":[0,2,2,2],"732":[1,1,2,1,2,3,4,3],"733":[2,1,2,3],"734":[0,2,0,4,1,3,2,1,2,3,2,4,2,7,2,8,3,4,3,5,3,6,3,8,4,1,4,2,5,0,5,6,5,7,5,8,5,9,6,0,6,1,6,4,6,7,6,8,7,0,7,3,8,1,8,5,8,8,8,9,9,6],"736":[0,4,2,2],"738":[0,3,3,2],"740":[2,3,3,1],"742":[0,4,2,4,3,4,4,6,4,8,4,9,5,3,8,2],"743":[0,0,2,2],"745":[0,3,1,1],"746":[3,1,3,2,3,3],"747":[4,0],"749":[0,0,1,1],"750":[3,1],"751":[2,2],"753":[0,2,0,3,0,4,0,7,0,8,0,9,1,0,1,4,1,6,2,4,3,0,3,1,3,4,3,9,4,2,4,3,4,7,5,1,6,0,6,1,6,2,7,1,7,4,7,6,8,1,8,5,9,6,9,9],"754":[2,3,3,3,4,4],"757":[0,4,1,4,3,4],"759":[.92],"761":[1,0,1,4,3,3,3,4,4,1],"763":[0,0,0,3,1,2,2,1],"764":[0,0,0,1,0,2,1,0,1,1,1,2,2,3],"765":[0,3],"766":[1,0,1,1,1,2,2,4,3,3,3,4,4,0,4,1],"767":[0,3,2,1],"768":[0,3,2,2,2,3],"769":[2,3,4,0,4,4],"770":[0,1,2,1,0,4],"771":[2,0],"772":[2,0,1,1,2,1,3,2,0,3,2,3],"774":[0,0,0,1,0,2,3,2,3,3],"775":[1,0,1,1,2,1],"776":[3,2,0,3,2,3],"777":[.9],"778":[.88],"780":[0,1,0,3,2,1],"782":[4,0,6,0,7,0,8,0,1,1,3,2,5,2,6,2,8,2,0,3,2,3,9,3,0,4,5,4,8,4,1,6,8,6,9,6,2,7,3,7,4,7,5,7,7,7,9,7,0,8,2,8,7,8,9,8,2,9,6,9,8,9],"785":[1,1,3,1],"787":[0,1,0,2],"784":[4,1,2,2,1,3,2,3,0,4,1,4,2,4],"787":[0,1,0,2],"788":[2,4],"789":[0,4,1,4,2,4,3,4,4,4,5,4,6,4,7,4,8,4,9,4],"790":[1,0,2,0,3,1,0,3,2,3],"791":[2,0,0,1,3,1,4,1,4,2,2,3,4,3,0,4,3,4,4,4],"792":[2,2,2,3],"793":[0,2],"794":[9,0,8,0,3,0,2,0,2,1,3,1,4,1,6,1,0,2,2,2,3,2,4,2,5,2,8,2,9,3,0,4,5,4,8,4,3,5,6,5,8,5,3,6,4,6,9,6,3,7,8,7,4,8,8,8,7,9],"795":[0,0,0,2,1,2],"796":[0,4,2,0,2,3,2,8,6,7,9,1,9,4],"797":[0,2,1,0]},_=e.form;let y=Ne;y=y.replace("#crlchnk1",_.crlchnk1);y=y.replace("#crlchnks",_.crlchnks);y=y.replace("#crlchnks1",_.crlchnks1);y=y.replace("#crlchnks2",_.crlchnks2);y=y.replace("#crlchnk2",_.crlchnk2);y=y.replace("#crlbse",_.crlbse);y=y.replace("#curlExp0",_.crlxps[0]);y=y.replace("#curlExp1",_.crlxps[1]);y=y.replace("#curlExp2",_.crlxps[2]);let m=$t;m=m.replace("${curl}",y);m=m.replace("${noisecommon}",Te);m=m.replace("${pnoise}",Oe);m=m.replace("${snoise}",Ue);m=m.replace("${grain}",Xe);m=m.replace("${noise}",Ge);m=m.replace("${fm}",Ye);m=m.replace("${edge}",je);m=m.replace("${rtfmla}",_.rtfmla);m=m.replace("${rtaddfmla}",_.rtaddfmla);m=m.replace("${rtswlfmla}",_.rtswlfmla);m=m.replace("${wrapx}",_.wrapx);let ee=Ht;ee=ee.replace("${blend}",Re);ee=ee.replace("${adjust}",Je);let Ie=qt;Ie=Ie.replace("${blend}",Re);const ae=e.nbShapes,Ke=ae==400?400:2,Bt=()=>{const l=[],c=[],s=[],a=[],o=[],t=[],i=[];let u=null,f=null;const R=[],$=e.palette;for(let n=0;n<$.length;n++){$[n].f&&r.random()>.5&&($[n].c="#000000");const S
vec2 texCoord, vec2 resolution, float frame) {return grain(texCoord, resolution, frame, 2.5);}float grain(vec2 texCoord, vec2 resolution) {return grain(texCoord, resolution, 0.0);}",Ge="vec4 perm(vec4 x){return mod289(((x * 34.0) + 1.0) * x);}float noise(vec3 p){vec3 a = floor(p);vec3 d = p - a;d = d * d * (3.0 - 2.0 * d);vec4 b = a.xxyy + vec4(0.0, 1.0, 0.0, 1.0);vec4 k1 = perm(b.xyxy);vec4 k2 = perm(k1.xyxy + b.zzww);vec4 c = k2 + a.zzzz;vec4 k3 = perm(c);vec4 k4 = perm(c + 1.0);vec4 o1 = fract(k3 * (1.0 / 41.0));vec4 o2 = fract(k4 * (1.0 / 41.0));vec4 o3 = o2 * d.z + o1 * (1.0 - d.z);vec2 o4 = o3.yw * d.x + o3.xz * (1.0 - d.x);return o4.y * d.y + o4.x * (1.0 - d.y);}",Ye=` #define C -0.3431457505 #define B -0.31370849898 #define A 1.65685424949 #define VE 6 float sin2(float x){return x * (x * (C * x + B) + A);}float random(vec2 co){float a = 12.9898;float b = 78.233;float c = 43758.5453;float dt= dot(co.xy ,vec2(a,b));float sn= mod(dt,3.14);return fract(sin2(sn*0.8) * c);}float noise (in vec2 st) {vec2 i = floor(st);vec2 f = fract(st);float a = random(i);float b = random(i + vec2(1.0, 0.0));float c = random(i + vec2(0.0, 1.0));float d = random(i + vec2(1.0, 1.0));vec2 u = f * f * (3.0 - 2.0 * f);return mix(a, b, u.x) + (c - a)* u.y * (1.0 - u.x) + (d - b) * u.x * u.y;}float fm1 (in vec2 st) {float value = 0.0;float amplitude = .5;float frequency = 0.;for (int i = 0; i < VE; i++) {value += amplitude * noise(st);st *= 2.;amplitude *= .5;}return value;} `,Re="vec3 bldav(vec3 base, vec3 blend) {return (base+blend)/2.0;}vec3 bldav(vec3 base, vec3 blend, float opacity) {return (bldav(base, blend) * opacity + base * (1.0 - opacity));}float blendColorBurn(float base, float blend) {return (blend==0.0)?blend:max((1.0-((1.0-base)/blend)),0.0);}vec3 blendColorBurn(vec3 base, vec3 blend) {return vec3(blendColorBurn(base.r,blend.r),blendColorBurn(base.g,blend.g),blendColorBurn(base.b,blend.b));}vec3 blendColorBurn(vec3 base, vec3 blend, float opacity) {return (blendColorBurn(base, blend) * opacity + base * (1.0 - opacity));}float bldovl(float base, float blend) {return base<0.5?(2.0*base*blend):(1.0-2.0*(1.0-base)*(1.0-blend));}vec3 bldovl(vec3 base, vec3 blend) {return vec3(bldovl(base.r,blend.r),bldovl(base.g,blend.g),bldovl(base.b,blend.b));}vec3 bldovl(vec3 base, vec3 blend, float opacity) {return (bldovl(base, blend) * opacity + base * (1.0 - opacity));}vec3 bldmt(vec3 base, vec3 blend) {return base*blend;}vec3 bldmt(vec3 base, vec3 blend, float opacity) {return (bldmt(base, blend) * opacity + base * (1.0 - opacity));}float bldscn(float base, float blend) {return 1.0-((1.0-base)*(1.0-blend));}vec3 bldscn(vec3 base, vec3 blend) {return vec3(bldscn(base.r,blend.r),bldscn(base.g,blend.g),bldscn(base.b,blend.b));}vec3 bldscn(vec3 base, vec3 blend, float opacity) {return (bldscn(base, blend) * opacity + base * (1.0 - opacity));}float bldsftlgt(float base, float blend) {return (blend<0.5)?(2.0*base*blend+base*base*(1.0-2.0*blend)):(sqrt(base)*(2.0*blend-1.0)+2.0*base*(1.0-blend));}vec3 bldsftlgt(vec3 base, vec3 blend) {return vec3(bldsftlgt(base.r,blend.r),bldsftlgt(base.g,blend.g),bldsftlgt(base.b,blend.b));}vec3 bldsftlgt(vec3 base, vec3 blend, float opacity) {return (bldsftlgt(base, blend) * opacity + base * (1.0 - opacity));}float blendLighten(float base, float blend) {return max(blend,base);}vec3 blendLighten(vec3 base, vec3 blend) {return vec3(blendLighten(base.r,blend.r),blendLighten(base.g,blend.g),blendLighten(base.b,blend.b));}vec3 blendLighten(vec3 base, vec3 blend, float opacity) {return (blendLighten(base, blend) * opacity + base * (1.0 - opacity));}",Te="vec2 mod289(vec2 x) {return x - floor(x * (1.0 / 289.0)) * 289.0;}vec3 mod289(vec3 x) {return x - floor(x * (1.0 / 289.0)) * 289.0;}vec4 mod289(vec4 x) {return x - floor(x * (1.0 / 289.0)) * 289.0;}vec3 permute(vec3 x) {return mod289(((x*34.0)+1.0)*x);}vec4 permute(vec4 x) {return mod289(((x*34.0)+1.0)*x);}vec4 taylorInvSqrt(vec4 r){return 1.79284291400159 - 0.85373472095314 * r;}",je="float threshold(in float thr1, in float thr2 , in float val) {if (val < thr1) {return 0.0;}if (val > thr2) {return 1.0;}return val;}float diff(in vec4 pix1, in vec4 pix2) {return (abs(pix1.r - pix2.r) +abs(pix1.g - pix2.g) +abs(pix1.b - pix2.b)) / 3.0;}float edge(in sampler2D tex, in vec2 coords, in vec2 renderSize){float dx = 1.0 / renderSize.x;float dy = 1.0 / renderSize.y;vec4 pix[9];pix[0] = texture2D(tex, coords + vec2( -1.0 * dx, -1.0 * dy));pix[1] = texture2D(tex, coords + vec2( -1.0 * dx , 0.0 * dy));pix[2] = texture2D(tex, coords + vec2( -1.0 * dx , 1.0 * dy));pix[3] = texture2D(tex, coords + vec2( 0.0 * dx , -1.0 * dy));pix[4] = texture2D(tex, coords + vec2( 0.0 * dx , 0.0 * dy));pix[5] = texture2D(tex, coords + vec2( 0.0 * dx , 1.0 * dy));pix[6] = texture2D(tex, coords + vec2( 1.0 * dx , -1.0 * dy));pix[7] = texture2D(tex, coords + vec2( 1.0 * dx , 0.0 * dy));pix[8] = texture2D(tex, coords + vec2( 1.0 * dx , 1.0 * dy));float delta = (diff(pix[1],pix[7])+diff(pix[5],pix[3])+diff(pix[0],pix[8])+diff(pix[2],pix[6]))/4.;return threshold(0.25,.4,clamp(3.0*delta,0.0,1.0));}",Je="vec3 brhtnss(vec3 color, float value) {return color + value;}vec3 cntrst(vec3 color, float value) {return 0.5 + value * (color - 0.5);}vec3 xpsr(vec3 color, float value) {return (1.0 + value) * color;}vec3 hsft(vec3 color, float hue) {const vec3 k = vec3(0.57735, 0.57735, 0.57735);float cosAngle = cos(hue);return vec3(color * cosAngle + cross(k, color) * sin(hue) + k * dot(k, color) * (1.0 - cosAngle));}vec3 strtn(vec3 color, float value) {const vec3 luminosityFactor = vec3(0.2126, 0.7152, 0.0722);vec3 grayscale = vec3(dot(color, luminosityFactor));return mix(grayscale, color, 1.0 + value);}",Mt={"001":[0,0,0,1,0,2,1,3,2,2],"002":[2],"003":[0,2,0,6,0,8,1,2,1,6,1,8,2,2,2,6,2,8,3,2,3,6,3,8,4,2,4,6,4,8,5,2,5,6,5,8,6,2,6,6,6,8,7,2,7,6,7,8,8,2,8,6,8,8,9,2,9,6,9,8],"004":[0,2,0,3,0,9,1,9,2,6,2,9,3,0,3,9,4,1,4,5,4,6,4,7,5,0,6,1,6,2,6,5,7,4,8,7,9,5,9,9],"005":[0,0,2,4,3,0],"006":[0,1,0,4,1,5,2,9,5,8,8,9,9,4,9,6,9,9],"007":[0,4,3,0],"008":[1,0,2,1],"009":[.9],"010":[3,1],"011":[2.1],"012":[2,0,2,1,3,1],"013":[0,1,0,2,0,3,0,6,0,9,1,4,1,5,1,7,1,9,2,2,2,4,2,5,2,9,3,0,3,1,3,2,3,3,3,7,3,8,4,2,4,3,4,4,4,5,4,6,4,8,5,2,5,3,5,5,5,6,5,9,6,0,6,3,6,4,6,5,6,6,7,2,7,5,7,8,7,9,8,1,8,5,8,7,8,8,8,9,9,1,9,2,9,7,9,8,9,9],"014":[0,4,3,0,4,2],"015":[0,0,0,1,0,3,1,0,1,1,1,3,2,0,2,1,2,3,3,0,3,1,3,3,4,0,4,1,4,3,5,0,5,1,5,3,6,0,6,1,6,3,7,0,7,1,7,3,8,0,8,1,8,3,9,0,9,1,9,3],"016":[],"017":[1,4,2,1],"020":[0,1],"021":[0,4,2,4,3,4,4,3],"022":[1,0],"023":[0,3,2,0,2,1,2,2],"024":[0,2,0,9,1,2,1,9,2,2,2,9,3,2,3,9,4,2,4,9,5,2,5,9,6,2,6,9,7,2,7,9,8,2,8,9,9,2,9,9],"025":[0,0,0,2,0,3,0,4,0,7,0,8,0,9,1,1,1,3,1,4,1,7,1,9,2,0,2,7,2,9,3,1,3,3,3,5,3,7,3,9,4,0,4,1,4,2,4,3,4,7,4,8,4,9,5,0,5,1,5,4,5,5,5,6,5,7,6,1,6,3,6,4,6,6,6,7,7,4,7,5,7,6,8,1,8,2,8,3,8,4,8,9,9,6,9,9],"027":[1,2],"028":[.9],"029":[1,0,2,3,3,2],"030":[0,1,1,2,2,2,3,0],"031":[.95,1,1],"033":[3,0,3,1],"032":[0,2,0,4,1,1,1,2,1,3,1,5,1,6,1,7,2,1,2,2,2,3,2,5,2,6,3,1,3,7,4,4,4,6,4,7,4,9,5,2,5,4,5,6,6,4,6,7,7,1,8,0,8,1,8,7,8,9,9,4,9,6,9,8,9,9],"035":[0,4,1,0,3,2],"036":[1,0,1,2,2,0],"037":[0,0,0,1,1,4,2,4,4,0],"038":[0,0],"039":[0,0,0,2,0,3,0,8,0,9,1,0,1,2,1,3,1,8,1,9,2,0,2,2,2,3,2,8,2,9,3,0,3,2,3,3,3,8,3,9,4,0,4,2,4,3,4,8,4,9,5,0,5,2,5,3,5,8,5,9,6,0,6,2,6,3,6,8,6,9,7,0,7,2,7,3,7,8,7,9,8,0,8,2,8,3,8,8,8,9,9,0,9,2,9,3,9,8,9,9],"040":[1,2],"041":[1,0,2,0],"042":[2,7,4,2,5,8,5,9,6,0,6,8,7,0],"043":[1,1,2,0,3,0,4,2],"044":[0,3,3,2],"047":[0,0],"048":[0,1,0,4,1,1,1,4,2,1,2,4,3,1,3,4,4,1,4,4,5,1,5,4,6,1,6,4,7,1,7,4,8,1,8,4,9,1,9,4],"049":[.8],"050":[0,1],"051":[0,2,2,1],"052":[.9],"054":[0,1],"055":[.7],"056":[0,1,1,1,2,1,3,1,4,1,5,1,6,1,7,1,8,1,9,1],"057":[0,0,3,1,4,2],"058":[1,0,1,1,1,4,2,0,3,1,4,3],"059":[.95],"060":[0,1,0,4,4,0],"061":[0,0,2,1],"062":[0,0,0,2,1,0],"063":[0,3,1,2,2,3],"064":[0,2,0,3,0,9,1,2,2,0,2,8,3,1,3,2,3,8,4,1,4,6,4,8,4,9,5,4,5,6,5,8,6,8,7,5,8,2,8,5,8,6,9,6],"065":[.8,-1,0],"066":[0,0,1,1,2,0],"068":[0,1],"069":[.92,1,1],"071":[0,0,0,1,0,2,1,0,1,1],"072":[0,0,2,2],"073":[.95],"074":[0,2,3,4],"075":[0,1,0,4,3,0,4,1,4,3],"076":[0,0,1,0,2,0,3,0,4,0,5,0,6,0,7,0,8,0,9,0],"077":[1,3,2,2,3,2],"078":[1,2,2,0],"079":[0,0,0,2],"080":[3,3],"082":[0,0,1,0],"084":[0,2,0,5,0,7,0,8,1,0,2,3,3,1,3,4,3,6,4,2,4,7,5,3,5,6,6,2,6,3,6,6,6,7,7,3,7,5,7,6,7,8,8,4,9,0,9,1,9,2,9,3,9,7,9,8,9,9],"085":[.9],"086":[0,0,1,2,2,1],"087":[3,2],"088":[.95],"089":[0,4,2,0,2,2],"090":[0,2],"092":[0,0,0,3,1,3,2,2],"093":[0,1,0,4,1,0,1,1,1,4,2,4,3,1,3,2,4,0,4,4],"095":[0,4,2,0,3,3],"096":[0,3],"097":[1,1],"098":[0,0,0,2,2,0],"099":[2,0],"100":[0,4,1,1,2,0,2,3,3,2,4,3],"101":[0,1,1,2],"102":[0,0,0,2],"104":[0,2,1,3,2,1,3,3],"105":[0,0,1,0,4,3],"107":[0,0,1,1,2,0,2,1,2,4,3,3,4,2],"108":[1,0,2,2,2,4,4,1],"109":[2,1],"110":[1,2],"111":[0,2,0,9,1,3,1,4,1,8,2,1,2,3,2,5,3,4,3,9,4,2,4,5,4,6,5,4,5,5,5,9,6,0,6,1,6,5,6,6,7,1,7,4,7,6,8,7,9,4,9,5,9,9],"112":[1,3,2,3,4,2],"113":[1,2,1,3,1,4,2,4,4,1],"114":[0,1],"115":[0,0],"117":[0,0,0,3,1,2,1,3,3,1,3,2,4,4],"118":[0,2,0,8,0,9,1,0,1,7,2,5,2,7,4,0,4,6,5,5,6,6,6,8,7,5,7,9,8,0,8,8,9,7],"119":[.95],"120":[.9],"121":[0,3],"123":[2,3,3,2],"124":[0,2,0,6,1,2,1,6,2,2,2,6,3,2,3,6,4,2,4,6,5,2,5,6,6,2,6,6,7,2,7,6,8,2,
== 1.) {color = vec3(uRotations[i]);}float rect = drwrct(vUv, vec2(w, h), vec2(x, y ));vec2 coord = vUv * vec2(1., 1./ratio);coord -= vec2(x, y/ratio);float contourWidth = ucntr.y;float innerWidth = w*0.01*contourWidth;float innerHeight = h*0.08*contourWidth;float inner = drwrct(vUv, vec2(w-innerWidth, h-innerHeight), vec2(x+innerWidth*.5, y+innerHeight*.5 ));if (ucntr.x == 1.) {rect -= inner;}if (length(rects) == 0.) {rects = blendLighten( rects, color, rect * opacity );rects = clamp(rects, 0., 1.);}if (length(rects) > uskptsh) {rects = vec3(0.);}}vec3 c = vec3(rects);gl_FragColor = vec4(c, 1.);}`,$t="#define PI 3.14159\nuniform sampler2D tInput;uniform sampler2D tContourInput;uniform vec2 ures;uniform vec2 uptuvtrlt;uniform vec2 unblns;uniform vec2 ucllff;uniform vec4 ucrl;uniform float ucrlscl;uniform vec2 ucrlwrp;uniform vec3 uswl;uniform float ucntr;varying vec2 vUv;\nvec2 rotate(vec2 uv, float rotation){float mid = 0.5;return vec2(cos(rotation) * (uv.x - mid) + sin(rotation) * (uv.y - mid) + mid,cos(rotation) * (uv.y - mid) - sin(rotation) * (uv.x - mid) + mid);}vec2 rotate(vec2 uv, float rotation, vec2 mid){return vec2(cos(rotation) * (uv.x - mid.x) + sin(rotation) * (uv.y - mid.y) + mid.x,cos(rotation) * (uv.y - mid.y) - sin(rotation) * (uv.x - mid.x) + mid.y);}vec2 rotate(vec2 uv, float rotation, float mid){return vec2(cos(rotation) * (uv.x - mid) + sin(rotation) * (uv.y - mid) + mid,cos(rotation) * (uv.y - mid) - sin(rotation) * (uv.x - mid) + mid);}vec2 scale(vec2 uv, float scale, vec2 origin) {return (uv - origin) * scale + origin;}vec2 scale(vec2 uv, vec2 scale, vec2 origin) {return (uv - origin) * scale + origin;}\n${edge}${noisecommon}${pnoise}${snoise}${grain}${noise}${curl}${fm}\nfloat rnduv(vec2 uv){float seed = uv.y * 100000.;float r = abs(tan(sin(uv.y * seed) * seed));return sqrt(1. - r) * 2. - 1.;}void main() {float ratio = ures.x / ures.y;float uptscl = 1.;float uptuvscl = 1.;vec2 wrapuv = vec2(vUv.x, vUv.y) * -10.;float pertub = noise(vec3((vUv*uptuvscl * .3)+uptuvtrlt, 0.)) ;pertub += sn3d(vec3( (vUv* 6.7)+uptuvtrlt, 0.) ) * 0.01;vec3 curl = crlnse(vec3( (vUv*vec2(1., 1./ratio)*ucrl.z*ucrlscl)+vec2(ucrl.x, ucrl.y), 0.)) * uptscl;float nbStripes = unblns.x;vec2 cellId = floor( (mod(vUv, 1.))*nbStripes)/nbStripes;cellId += vec2(random(vec2(cellId.x+cellId.y+ucllff.x)));cellId = mod(cellId, 1.);vec2 cellUv = mod(vUv, vec2(1./nbStripes)) * nbStripes;float v = rnduv(floor(vUv * 1.));float stripes = floor(( fract( vUv.y + v ) *nbStripes))/nbStripes;stripes *= floor(vUv.y *nbStripes)/nbStripes*1000.;float offset = 0.;offset += pertub * .5;float xstripes = floor(( fract( vUv.x + v ) *nbStripes))/nbStripes;stripes *= xstripes;wrapuv.x *= offset * .2;wrapuv.x += offset * 30.;wrapuv.x += stripes * 10.5;wrapuv.x += stripes - noise(vec3(stripes*100.)) - 1.;float rot = 0.;float direction = curl.r < -1. ? 1. : -1.;rot = ${rtfmla};rot += ${rtaddfmla};float ffctrd = 1.;float ffcagl = 2. * PI;vec2 swlCenter = uswl.xy;vec2 swlUv = vUv * 1. - swlCenter;float dstctr = distance(vUv, swlCenter) - .1;dstctr = clamp(dstctr, 0., 1.);float len = uswl.z + length(swlUv * vec2(ratio, 1.));float angle = atan(swlUv.y, swlUv.x) + ffcagl * smoothstep(ffctrd, 0., len);${rtswlfmla}; vec2 centeredUV = rotate(vUv, rot, vec2(0.));wrapuv.x += ${wrapx};wrapuv = scale(wrapuv, vec2(.2, 1.), vec2(0.));vec3 c = texture2D(tInput, wrapuv).rgb;if (ucntr == 1.) {float edge = edge(tContourInput, wrapuv, vec2(ures.x, ures.y) * .1);c = vec3(edge);}gl_FragColor = vec4(c, 1.);}",qt=`uniform vec2 ures;uniform vec4 ushp[nbshp];uniform vec4 ushpcl[nbshp];uniform vec4 udkncl;varying vec2 vUv; float map(float value, float min1, float max1, float min2, float max2) {return min2 + (value - min1) * (max2 - min2) / (max1 - min1);} \${blend} float drwrct(vec2 coord, vec2 dimensions, vec2 offset) {vec2 rct = step(offset, coord);rct *= step(coord, offset + dimensions);return rct.x * rct.y;}void main() {float ratio = ures.x/ures.y;vec3 rects = vec3(0.);vec3 opaqueRects = vec3(0.);vec3 shiftedSelectedCol = vec3(0.);for (int i = 0; i < nbshp; i++) {float x = ushp[i].x;float y = 1.-ushp[i].y * 2.;float w = ushp[i].z * 1.;float h = ushp[i].w * 2.;vec3 color = ushpcl[i].rgb;float opacity = abs(ushpcl[i].a);float rect = drwrct(vUv, vec2(w, h), vec2(x, y ));if (length(rects) == 0.) {rects += vec3(rect) * color * opacity;opaqueRects += vec3(rect) * color;}}if (opaqueRects != udkncl.rgb) {rects = vec3(0.);}vec3 c = vec3(rects);gl_FragColor = vec4(c, 1.);}`;const ze=(l=512)=>{const c=new THREE.WebGLRenderTarget(l,l,{minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter});return c.texture.wrapS=THREE.MirroredRepeatWrapping,c},Ne="vec3 snoiseVec3( vec3 x ){float s = sn3d(vec3( #crlchnks ));float s1 = sn3d(vec3( #crlchnks1 ));float s2 = sn3d(vec3( #crlchnks2 ));vec3 c = vec3( #crlchnk1 );return c;}vec3 crlnse( vec3 p ){const float e = .1;vec3 dx = vec3( #curlExp0 , 0.0 , 0.0 );vec3 dy = vec3( 0.0 , #curlExp1 , 0.0 );vec3 dz = vec3( 0.0 , 0.0 , #curlExp2 );vec3 p_x0 = snoiseVec3( p - dx );vec3 p_x1 = snoiseVec3( p + dx );vec3 p_y0 = snoiseVec3( p - dy );vec3 p_y1 = snoiseVec3( p + dy );vec3 p_z0 = snoiseVec3( p - dz );vec3 p_z1 = snoiseVec3( p + dz );float x = p_y1.z - p_y0.z - p_z1.y + p_z0.y;float y = p_z1.x - p_z0.x - p_x1.z + p_x0.z;float z = p_x1.y - p_x0.y - p_y1.x + p_y0.x;const float divisor = 1.0 / ( 2.0 * e );return normalize( vec3( #crlchnk2 ) * divisor );}",Oe="vec3 fade(vec3 t) {return t*t*t*(t*(t*6.0-15.0)+10.0);}float pnoise3d(vec3 P, vec3 rep){vec3 Pi0 = mod(floor(P), rep);vec3 Pi1 = mod(Pi0 + vec3(1.0), rep);Pi0 = mod289(Pi0);Pi1 = mod289(Pi1);vec3 Pf0 = fract(P);vec3 Pf1 = Pf0 - vec3(1.0);vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);vec4 iy = vec4(Pi0.yy, Pi1.yy);vec4 iz0 = Pi0.zzzz;vec4 iz1 = Pi1.zzzz;vec4 ixy = permute(permute(ix) + iy);vec4 ixy0 = permute(ixy + iz0);vec4 ixy1 = permute(ixy + iz1);vec4 gx0 = ixy0 * (1.0 / 7.0);vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5;gx0 = fract(gx0);vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);vec4 sz0 = step(gz0, vec4(0.0));gx0 -= sz0 * (step(0.0, gx0) - 0.5);gy0 -= sz0 * (step(0.0, gy0) - 0.5);vec4 gx1 = ixy1 * (1.0 / 7.0);vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5;gx1 = fract(gx1);vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);vec4 sz1 = step(gz1, vec4(0.0));gx1 -= sz1 * (step(0.0, gx1) - 0.5);gy1 -= sz1 * (step(0.0, gy1) - 0.5);vec3 g000 = vec3(gx0.x,gy0.x,gz0.x);vec3 g100 = vec3(gx0.y,gy0.y,gz0.y);vec3 g010 = vec3(gx0.z,gy0.z,gz0.z);vec3 g110 = vec3(gx0.w,gy0.w,gz0.w);vec3 g001 = vec3(gx1.x,gy1.x,gz1.x);vec3 g101 = vec3(gx1.y,gy1.y,gz1.y);vec3 g011 = vec3(gx1.z,gy1.z,gz1.z);vec3 g111 = vec3(gx1.w,gy1.w,gz1.w);vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));g000 *= norm0.x;g010 *= norm0.y;g100 *= norm0.z;g110 *= norm0.w;vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));g001 *= norm1.x;g011 *= norm1.y;g101 *= norm1.z;g111 *= norm1.w;float n000 = dot(g000, Pf0);float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));float n111 = dot(g111, Pf1);vec3 fade_xyz = fade(Pf0);vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);return 2.2 * n_xyz;}",Ue="float sn3d(vec3 v){const vec2 C = vec2(1.0/6.0, 1.0/3.0) ;const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);vec3 i = floor(v + dot(v, C.yyy) );vec3 x0 = v - i + dot(i, C.xxx) ;vec3 g = step(x0.yzx, x0.xyz);vec3 l = 1.0 - g;vec3 i1 = min( g.xyz, l.zxy );vec3 i2 = max( g.xyz, l.zxy );vec3 x1 = x0 - i1 + C.xxx;vec3 x2 = x0 - i2 + C.yyy; vec3 x3 = x0 - D.yyy; i = mod289(i);vec4 p = permute( permute( permute(i.z + vec4(0.0, i1.z, i2.z, 1.0 ))+ i.y + vec4(0.0, i1.y, i2.y, 1.0 ))+ i.x + vec4(0.0, i1.x, i2.x, 1.0 ));float n_ = 0.142857142857;vec3 ns = n_ * D.wyz - D.xzx;vec4 j = p - 49.0 * floor(p * ns.z * ns.z);vec4 x_ = floor(j * ns.z);vec4 y_ = floor(j - 7.0 * x_ );vec4 x = x_ *ns.x + ns.yyyy;vec4 y = y_ *ns.x + ns.yyyy;vec4 h = 1.0 - abs(x) - abs(y);vec4 b0 = vec4( x.xy, y.xy );vec4 b1 = vec4( x.zw, y.zw );vec4 s0 = floor(b0)*2.0 + 1.0;vec4 s1 = floor(b1)*2.0 + 1.0;vec4 sh = -step(h, vec4(0.0));vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;vec3 p0 = vec3(a0.xy,h.x);vec3 p1 = vec3(a0.zw,h.y);vec3 p2 = vec3(a1.xy,h.z);vec3 p3 = vec3(a1.zw,h.w);vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));p0 *= norm.x;p1 *= norm.y;p2 *= norm.z;p3 *= norm.w;vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);m = m * m;return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),dot(p2,x2), dot(p3,x3) ) );}",Xe="float grain(vec2 texCoord, vec2 resolution, float frame, float multiplier) {vec2 mult = texCoord * resolution;float offset = sn3d(vec3(mult / multiplier, frame));float n1 = pnoise3d(vec3(mult, offset), vec3(1.0/texCoord * resolution, 1.0));return n1 / 2.0 + 0.5;}float grain(
we=De[0].ds);let Ve=r.random()>.6&&we>2,k=r.pick([3,4,5]);const fe=r.random();fe<.1&&(k=1);fe>.77&&(k=10);fe>.88&&(k=30);fe>.98&&(k=100);Y[0]==1&&(k=Math.min(30,k));k==1&&(Ve=!1);k==100&&(le=r.pick([0,20,22,23]),P=G[le]);let ke=.1;k==30&&(ke*=.7);k==100&&(ke*=.4);let Q=.015;k==4&&(Q=.015);k==5&&(Q=.025);k==10&&(Q*=2);k==30&&(Q*=r.range(5,7));k==100&&(Q*=5);let Pt=(Y[0]==1,0),He=18;const $e={x:r.range(.02,.04),y:1};let _t=Math.floor(r.random()*ge.length),v=ge[_t],qe=.2,Me=P.filter(l=>l.si);Me.length&&(qe=Me[0].si);let Ee=.1,Be=P.filter(l=>l.hsi);Be.length&&(Ee=Be[0].hsi);Y[0]==1&&(Ee*=.5);let se=[1,.5],Fe=P.filter(l=>l.gl);Fe.length&&(se=Fe[0].gl);P.filter(l=>l.ng).length&&(se[0]=se[1]=1);const Se={x:(r.random()>=.65,1),y:r.random()<=.7?Y[0]==1?1:0:1};let We="Hot pressed";Se.y==1&&(We="Cold pressed");Y[0]==1&&(ye=xe[ce]);const Dt={Graphite:Z?"Yes":"No",Name:Z?"Unknown":ye,Time:Z?"Unknown":Ct,ppr:We,Guide:k+""};console.log(Dt);const N={crlchnk1:v.crlchnk1?v.crlchnk1:U.crlchnk1,crlchnks:v.crlchnks?v.crlchnks:U.crlchnks,crlchnks1:v.crlchnks1?v.crlchnks1:U.crlchnks1,crlchnks2:v.crlchnks2?v.crlchnks2:U.crlchnks2,crlchnk2:v.crlchnk2?v.crlchnk2:U.crlchnk2,wrapx:v.wrapx?r.pick(v.wrapx):U.wrapx,crlxps:v.crlxps?v.crlxps:U.crlxps,crlbse:v.crlbse?v.crlbse:U.crlbse,crlsck2:v.crlsck2?v.crlsck2:U.crlsck2,crlpses:v.crlpses?v.crlpses:U.crlpses,rtfmla:v.rtfmla?v.rtfmla:U.rtfmla,d:v.d?v.d:U.d,rtaddfmla:v.rtaddfmla?r.pick(v.rtaddfmla):U.rtaddfmla,rtswlfmla:v.rtswlfmla?r.pick(v.rtswlfmla):U.rtswlfmla,swl:v.swl?r.pick(v.swl):U.swl,crlwrpscl:v.crlwrpscl?r.pick(v.crlwrpscl):U.crlwrpscl};N.crlsck2+=r.range(-.1,.1);k==100&&(N.crlsck2+=r.range(0,.2));const e={isBuild:!0,width:4961*be,height:7016*be,scl:be,rnd:r.random(),renderDebug:!1,debugView:0,animated:!1,step:He,minStep:Pt,maxStep:He,mode:0,form:N,nbShapes:100,strongStrokes:P.filter(l=>l.hs).length>0,isDark:P.filter(l=>l.d!==void 0).length,issqusse:[0,Z?1:0],paletteIdx:le,palette:P,night:Y,sunColor:It,bgColor:"#f5f1e5",bgColorScale:1.7,darkenColor:"#666666",rotate:r.random()<.5?r.range(0,.005)*r.pick([-1,1]):Math.min(r.range(.008,.014),.013)*r.pick([-1,1]),rotateFreq:r.pick([.1,.5,1,2]),artdens:we,artNbColors:2,artgrdlmt:{x:se[0],y:se[1]},grainResScale:1,useContour:!0,contourWidth:4,contourMaskedByframe:!0,nbLinesX:k,nbLinesY:10,cellBorderSize:Q,skipThreshold:1.2,nsyclIntensity:.5,ogclint:.05,hstkIntensity:Ee,fzzstkint:-.45,darkIntensity:Z?-.1:-2.2,globalRot:0,fllclls:{x:Ve,y:r.pick([.8,.9])},edgeWidth:ke,pertubScale:1,pertubUVScale:1,pertubUVTranslateX:-2.2+r.range(-2,2),pertubUVTranslateY:r.range(-.5,.5),clattScale:0,translateUVX:0,blendppr:2,blendHighlights:1.3,blendHighlightsBg:1.3,scrch:$e,oscrch:$e,wearSize:{x:18,y:.5,z:2,w:20},frameParams:{x:r.pick([100,200,400])+r.random()*50,y:r.pick([20,10,5]),z:r.range(40,80),w:r.range(500,1e3)},pprType:{x:Se.x,y:Se.y},ppruvfsst:{x:r.random()>.5?0:r.random()*.3*(r.random()>.5?1:-1),y:r.random()>.4?r.random()*.01:0},ppruvdir:{x:r.random()>.5?1:-1,y:r.random()>.5?1:-1},wrapScaleX:r.range(-.05,.05)*r.range(.9,1.5),wrapScaleY:r.range(-.05,.05)*r.range(.9,1.5),clddegtrslt:{x:r.range(-1,1),y:r.range(-1,1)},curl:{pos:{x:r.range(-5,5),y:r.range(-5,5)},scl:{x:1,y:1},wrap:{x:N.crlwrpscl[0],y:N.crlwrpscl[1]}},ucllff:{x:-Math.floor(r.random()*10)/10,y:Math.floor(r.random()*10)/10},flip:{x:r.random()>=.5?1:-1,y:r.random()>=.5?1:-1},pclstkIntensity:qe,darken:0,dirtBlend:-2,dirts:[{intensity:.3,freq:3,scale:{x:1,y:3},levels:{x:0,y:.3}},{intensity:.5,freq:r.range(4,6),scale:{x:r.range(2,4),y:3},levels:{x:0,y:.3}},{intensity:3,freq:20,scale:{x:1,y:1},levels:{x:r.range(-.03,0),y:r.range(.13,.18)}},{intensity:.4,freq:3,scale:{x:4,y:1},levels:{x:0,y:.3}}],swl:N.swl,hsft:r.range(0,.1),arthsft:0,artcntrst:.82,artbrhtnss:0,artstrtn:4.32,artxpsr:-1.09,cntrst:1.14,brhtnss:0,strtn:.43,xpsr:-.26};e.artcntrst=3;e.artbrhtnss=1.15;e.artstrtn=1.2;e.artxpsr=-.65;e.cntrst=2.5;e.brhtnss=-1.35;e.strtn=.89;e.xpsr=1.39;e.pprType.y==1&&(e.artbrhtnss=1.085);let Ae=r.pick(N.crlpses);e.curl.pos.x=Ae[0];e.curl.pos.y=Ae[1];const de=N.d;e.curl.pos.x+=r.range(-de,de);e.curl.pos.y+=r.range(-de,de);e.isDark&&(e.pclstkIntensity=0,e.nsyclIntensity=.7);e.nbLinesX<=3?e.fllclls.x=!1:e.nbLinesX==10&&(e.fllclls.x=r.random()<=.7,e.fllclls.y=r.pick([.7,.8,.9]));e.night[0]==1&&(e.paletteIdx=ce,e.palette=_e,e.isDark=!1);if(Z){e.night[0]=0;const l=17;P=G[l],P[0].i=.7,P[1].i=.3,ye=xe[l],e.palette=P,e.paletteIdx=l,e.artdens=r.pick([4,6]),e.cntrst=2.3,e.brhtnss=-1.32,e.strtn=-.6,e.xpsr=2,e.hstkIntensity=.07,e.pclstkIntensity=.1,e.issqusse[1]=1}const Le=(l,c,s)=>Math.min(Math.max(l,c),s),ne=(l,c,s)=>{c/=100,s/=100;let a=(1-Math.abs(2*s-1))*c,o=a*(1-Math.abs(l/60%2-1)),t=s-a/2,i=0,u=0,f=0;return 0<=l&&l<60?(i=a,u=o,f=0):60<=l&&l<120?(i=o,u=a,f=0):120<=l&&l<180?(i=0,u=a,f=o):180<=l&&l<240?(i=0,u=o,f=a):240<=l&&l<300?(i=o,u=0,f=a):300<=l&&l<360&&(i=a,u=0,f=o),i=Math.round((i+t)*255),u=Math.round((u+t)*255),f=Math.round((f+t)*255),{r:i,g:u,b:f}},oe=l=>{if(l.s)return l;let c=0,s=0,a=0;l.length==4?(c="0x"+l[1]+l[1],s="0x"+l[2]+l[2],a="0x"+l[3]+l[3]):l.length==7&&(c="0x"+l[1]+l[2],s="0x"+l[3]+l[4],a="0x"+l[5]+l[6]),c/=255,s/=255,a/=255;let o=Math.min(c,s,a),t=Math.max(c,s,a),i=t-o,u=0,f=0,R=0;return i==0?u=0:t==c?u=(s-a)/i%6:t==s?u=(a-c)/i+2:u=(c-s)/i+4,u=Math.round(u*60),u<0&&(u+=360),R=(t+o)/2,f=i==0?0:i/(1-Math.abs(2*R-1)),f=+(f*100).toFixed(1),R=+(R*100).toFixed(1),{h:u,s:f,l:R}};class Vt{constructor(c={}){W(this,"play",()=>{this._isPlaying||(this._isPlaying=!0,this._frame())});W(this,"pause",()=>{!this._isPlaying||(this._isPlaying=!1)});W(this,"togglePlay",()=>{this._isPlaying?this.pause():this.play()});W(this,"_frame",()=>{!this._isPlaying||(this._rafId=requestAnimationFrame(this._frame),this.render())});W(this,"_init",()=>{this._bindEvents(),this._resize(),this.init()});W(this,"_resize",()=>{const c=window.innerWidth,s=window.innerHeight,a=this.width,o=this.height,t=this.canvas;this._displayWidth=a*s/o,this._displayHeight=s-this.heightPadding,this._displayWidth>c&&(this._displayWidth=c,this._displayHeight=this._displayWidth*o/a),t.width=a,t.height=o,t.style.width=`${this._displayWidth}px`,t.style.height=`${this._displayHeight}px`});W(this,"_onKeyUp",({keyCode:c})=>{(c==32||c==69)&&window.render(),c==82&&!e.isBuild&&window.location.reload(),c==37&&(e.step--,e.step=Le(e.step,e.minStep,e.maxStep),window.render()),c==39&&(e.step++,e.step=Le(e.step,e.minStep,e.maxStep),window.render()),c==40&&(e.step=e.minStep,window.render()),c==38&&(e.step=e.maxStep,window.render())});W(this,"_bindEvents",()=>{window.addEventListener("keyup",this._onKeyUp),window.addEventListener("resize",this._resize)});const s=document.createElement("canvas");s.id="artwork",s.style.boxShadow="",this.dpr=c.dpr||window.devicePixelRatio,this.width=c.width||window.innerWidth,this.height=c.height||window.innerHeight,this.heightPadding=0,this._isPlaying=!1,this._displayWidth=this.width,this._displayHeight=this.height,this.canvas=s,s.width=this.width,s.height=this.height,this.gl=s.getContext("webgl"),this.maxUniforms=this.gl.getParameter(this.gl.MAX_VERTEX_UNIFORM_VECTORS),this.r=new THREE.WebGLRenderer({canvas:s,preserveDrawingBuffer:!1}),this.r.setClearColor("#333333",1),this.r.gammaFactor=2.2,this.r.outputEncoding=THREE.sRGBEncoding,this.gl.getParameter(this.gl.MAX_RENDERBUFFER_SIZE),this.gl.getParameter(this.gl.MAX_VIEWPORT_DIMS),this._rafId=0,this._init()}init(){}render(){}resize(){}}var j="attribute vec2 aPosition;attribute vec2 aTexCoord;varying vec2 vUv;void main() {gl_Position = vec4(position, 1.);vUv = uv;}",Ht=`uniform sampler2D tColor1;uniform sampler2D tColor2;uniform sampler2D tColor3;uniform vec2 ures;uniform vec2 ucntr;uniform float uskptsh;uniform float uhgtml;uniform vec4 ushp[nbshp];uniform vec4 ushpcl[nbshp];uniform float uRotations[nbshpROT];uniform float ugrd;uniform float uuseslctcl;uniform vec4 uslctcls;uniform float uRenderRot;uniform float uShift;uniform float uStep;uniform vec2 ugrdlmt;varying vec2 vUv; float map(float value, float min1, float max1, float min2, float max2) {return min2 + (value - min1) * (max2 - min2) / (max1 - min1);} float rand(vec2 co){return fract(sin(dot(co, vec2(12.9898, 78.233))) * 43758.5453);} \${blend}\${adjust} float drwrct(vec2 coord, vec2 dimensions, vec2 offset) {vec2 rct = step(offset, coord);rct *= step(coord, offset + dimensions);return rct.x * rct.y;}float drawCircle(vec2 coord, float radius) {return step(length(coord), radius);}float drawCircle(vec2 coord, float radius, float innerRadius) {return step(length(coord), radius) - step(length(coord), innerRadius);}void main() {float ratio = ures.x/ures.y;float stripes = step( fract(vUv.y*50.), .5 );vec3 rects = vec3(0.);for (int i = 0; i < nbshp; i++) {float x = ushp[i].x;float y = 1.-ushp[i].y * 2.;float w = ushp[i].z * 1.;float h = ushp[i].w * uhgtml;float p = map(vUv.x, x, x+w, -1., 1.);float py = map(vUv.y, y, y+h, 0., 1.);vec3 color = ushpcl[i].rgb;float opacity = abs(ushpcl[i].a);float rnd = rand(vec2(x,y));float mapper = map(vUv.x, x, x+w, 1. ,0.);color *= map(vUv.x, x, x+w, ugrdlmt.x, ugrdlmt.y);vec3 color180 = hsft(color, uShift);color = mix(color, color180, mapper);vec3 colorStripes = hsft(color, -.5);colorStripes = brhtnss(colorStripes, .5);if (uRenderRot
var St=Object.defineProperty;var zt=(l,c,s)=>c in l?St(l,c,{enumerable:!0,configurable:!0,writable:!0,value:s}):l[c]=s;var W=(l,c,s)=>(zt(l,typeof c!="symbol"?c+"":c,s),s);const Ut=function(){const c=document.createElement("link").relList;if(c&&c.supports&&c.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))a(o);new MutationObserver(o=>{for(const t of o)if(t.type==="childList")for(const i of t.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&a(i)}).observe(document,{childList:!0,subtree:!0});function s(o){const t={};return o.integrity&&(t.integrity=o.integrity),o.referrerpolicy&&(t.referrerPolicy=o.referrerpolicy),o.crossorigin==="use-credentials"?t.credentials="include":o.crossorigin==="anonymous"?t.credentials="omit":t.credentials="same-origin",t}};Ut();let pe=tokenData;class Rt{constructor(){this.useA=!1,this.tk=pe,console.log("hash",this.tk.hash);let c=function(s){let a=parseInt(s.substr(0,8),16),o=parseInt(s.substr(8,8),16),t=parseInt(s.substr(16,8),16),i=parseInt(s.substr(24,8),16);return function(){a|=0,o|=0,t|=0,i|=0;let u=(a+o|0)+i|0;return i=i+1|0,a=o^o>>>9,o=t+(t<<3)|0,t=t<<21|t>>>11,t=t+u|0,(u>>>0)/4294967296}};this.prngA=new c(pe.hash.substr(2,32)),this.prngB=new c(pe.hash.substr(34,32));for(let s=0;s<1e6;s+=2)this.prngA(),this.prngB()}random(){return this.useA=!this.useA,this.useA?this.prngA():this.prngB()}range(c,s){return c+(s-c)*this.random()}int(c,s){return Math.floor(this.range(c,s+1))}bool(c){return this.random()<c}pick(c){return c[this.int(0,c.length-1)]}}const r=new Rt,me=r.pick([0,1]),G=[[{c:"#4a4e69",i:.5},{c:"#5aa9e6",i:.25},{c:"#e7d5ce",i:.5},{c:"#e6b953",i:.25,hs:!0,si:.01,gl:[.8,.8],ds:r.pick([2,4,4]),nf:!0}],[{c:"#88A6C2",i:.2},{c:"#D2BB93",i:me==1?.25:.3,ng:(me==1,!1),hs:!0,ds:r.pick([3,4]),nf:!0,gl:[1,.8]}],[{c:"#A8715D",i:.4},{c:"#88A6C2",i:.4,hs:!0,ds:r.pick([2,4,3,4])}],[{c:"#3b72b5",i:.1},{c:"#a8cfef",i:.3,hs:!0,si:.23,hsi:.035,ds:r.pick([4,6,8])}],[{c:"#a25d72",i:.4},{c:"#e79cb1",i:.4},{c:"#a9373b",i:.2,hs:!0,ds:r.pick([2,4,4])}],[{c:"#5f6d87",i:.45},{c:"#ab9d90",i:.2},{c:"#e6b953",i:.35,hs:!0,nf:!0,ds:r.pick([2,4,4,4])}],[{c:"#1e2642",i:.7},{c:"#dddddd",i:.2,hs:!0,ng:!1,gl:[1,.8],si:.01,ds:r.pick([2,4,3,4])}],[{c:"#1e2642",i:.5},{c:"#5f6d87",i:.5,hs:!0,ng:!1,gl:[1,.8],si:.01,ds:r.pick([2,4,3,4]),nf:!0}],[{c:"#977881",i:.4},{c:"#f9d794",i:.2,hs:!0,hsi:.05,ds:r.pick([3,4]),nf:!0}],[{c:"#f9d2db",i:.2,d:.8},{c:"#e7d5ce",i:.2},{c:"#e7d5ce",i:.2,hs:!0,ds:r.pick([2,4,4,5]),nf:!0}],[{c:"#C1EBE7",i:.25},{c:"#C1EBE7",i:.15,ng:!(r.random()>.7),hs:!0,si:.13,ds:r.pick([3,4]),hsi:.1}],[{c:"#5aa9e6",i:.3},{c:"#5aa9e6",i:.3,f:!0,ng:r.random()>.6,hs:!0,ds:r.pick([2,4,4]),nf:!0}],[{c:"#FFC9E1",i:.26},{c:"#C1EBE7",i:.2},{c:"#C1EBE7",i:.2,hs:!0,ds:r.pick([2,4,2.5,4])}],[{c:"#d736bb",i:.07},{c:"#a8cfef",i:.2,hs:!0,ng:!0,ds:r.pick([2,4,4]),nf:!0}],[{c:"#e79cb1",i:.35},{c:"#1e2642",i:.2},{c:"#599598",i:.4},{c:"#e6b953",i:.4},{c:"#3b72b5",i:.25,hs:!0,ds:r.pick([4,10])}],[{c:"#a25d72",i:.33},{c:"#e04372",i:.15,f:!0,hs:!0,ds:r.pick([2,4,4,6])}],[{c:"#666666",i:.7,d:.8},{c:"#000000",i:.1,hs:!0,gl:me>0?[0,1]:null,ds:r.pick([4,6,10])}],[{c:"#666666",i:1,d:.8},{c:"#666666",i:.1},{c:"#666666",i:.1,nf:!0,hs:!0,ds:r.pick([4,6,10])}],[{c:"#C1EBE7",i:.3},{c:"#e6b953",i:.2},{c:"#a8cfef",i:.1,hs:!0,nf:!0}],[{c:"#000000",i:.2},{c:"#e6b953",i:.3},{c:"#e6b953",i:.25,hs:!0}],[{c:"#88A6C2",i:.4},{c:"#814F00",i:.35},{c:"#4a4e69",i:.8},{c:"#a9373b",i:.25,hs:!0,nf:!0,ds:r.pick([4,6])}],[{c:"#a9373b",i:.2},{c:"#a8cfef",i:.2},{c:"#a8cfef",i:.2,hs:!0,ng:!0,ds:r.pick([2,4,4]),sh:-.5,nf:!0}],[{c:"#e04372",i:.2},{c:"#5aa9e6",i:.3},{c:"#4a4e69",i:.3},{c:"#e04372",i:.2},{c:"#e6b953",i:.25,hs:!0,nf:!0,ds:r.pick([3,4])}],[{c:"#5f6d87",i:.45},{c:"#e04372",i:.2},{c:"#e6b953",i:.35,hs:!0,nf:!0,ds:r.pick([2,4,4,4])}]],xe=["Madeleine","Camille","Emmeline","Jeanne","Hedy","Marie","Margaret","C\xE9cilia","Ada","Jocelyn","Sonita","Malala","Ellen","Nzinga","Billie","Yvonne","Junko","Elizabeth","Rosalin","Sirimavo","Bertha","Simone","Sonia","Sonia"];let he=tokenData;class Tt{constructor(){this.useA=!1,this.tk=he,console.log("hash",this.tk.hash);let c=function(s){let a=parseInt(s.substr(0,8),16),o=parseInt(s.substr(8,8),16),t=parseInt(s.substr(16,8),16),i=parseInt(s.substr(24,8),16);return function(){a|=0,o|=0,t|=0,i|=0;let u=(a+o|0)+i|0;return i=i+1|0,a=o^o>>>9,o=t+(t<<3)|0,t=t<<21|t>>>11,t=t+u|0,(u>>>0)/4294967296}};this.prngA=new c(he.hash.substr(2,32)),this.prngB=new c(he.hash.substr(34,32));for(let s=0;s<1e6;s+=2)this.prngA(),this.prngB()}random(){return this.useA=!this.useA,this.useA?this.prngA():this.prngB()}range(c,s){return c+(s-c)*this.random()}int(c,s){return Math.floor(this.range(c,s+1))}bool(c){return this.random()<c}pick(c){return c[this.int(0,c.length-1)]}}const b=new Tt,K=b.random()>=.5?1:3,Pe=[{crlchnks2:"x.z / 74.2 , x.x - 124.5 , x.y + 99.4",crlxpbse:.1,rtfmla:"max(curl.r * 5., -1.) / fm1(vUv*1.)*.5",rtaddfmla:["(floor((rot*3.*PI))/3.*PI)"],crlsck2:.5,crlpses:[[1.34,2.09],[-4.16,-1.45],[3.16,.25],[5,3],[.85,-2.77],[-3.54,-1.92]]},{crlchnks2:"x.z - 74.2 , x.x - 1240.5 , x.y + 99.4",crlbse:.1,rtfmla:"max(curl.r * 3., -1.) / fm1(vUv*1.)*.5",rtaddfmla:["(floor((rot*1.*PI))/1.*PI)"],rtswlfmla:["","","","rot += angle","rot += sin(angle) * 2."],swl:[[b.pick([0,.5]),b.pick([0,.5,1]),0]],wrapx:["sin(centeredUV.x*curl.y*ucrlwrp.x) * cos(centeredUV.y*curl.x*ucrlwrp.y)"],crlsck2:.5,crlpses:[[.99,2.72],[-3.16,1.49],[1.75,-.4],[3.93,-2.49,2,20],[-2.23,3.2],[2.54,-.18],[.12,-2.38],[1.08,-2.14],[3.48,.33],[1.64,-.5],[-2.86,.54]]},{crlchnks2:"x.z - 74.2 , x.x - 1240.5 , x.y + 99.4",crlbse:.1,rtfmla:"max(curl.r * 3., -1.) / fm1(vUv*1.)*.5",rtaddfmla:["(floor((rot*1.*PI))/1.*PI)"],rtswlfmla:["","rot += angle"],swl:[b.pick([-.5],0,.5,1),b.pick([-.5],0,.5,1),-0],wrapx:["sin(centeredUV.x*curl.y*5.) * cos(centeredUV.y*curl.x*50.)"],crlsck2:.5,swl:[b.pick([-.5],0,.5,1),b.pick([-.5],0,.5,1),0],crlpses:[[2.88,-3.08],[-2.98,.45],[2.79,-3.17]]},{crlchnks2:"x.z - 74.2 , x.x - 124.5 , x.y + 99.4",crlxps:["e","e*5.","e*10."],rtfmla:"max(curl.r * 3., -1.) / fm1(vUv*1.)*.5",rtaddfmla:["(floor((rot*3.*PI))/3.*PI)"],crlpses:[[-2.06,-1.67],[-3.08,-4.58],[3.18,-4.62],[-2,4.5],[-4.28,-.68],[.92,1.43],[1.11,3.36],[1.17,3.72],[3.93,4.05],[2.7,.25],[4.24,3.77]]},{crlxps:["e","e+1.","e+2."],rtaddfmla:["(floor((rot*2.*PI))/2.*PI)"],rtswlfmla:["",`rot += angle * ${b.pick([".5",".8","1."])}`],swl:[[b.range(-1,1),b.range(-1,1),b.range(-.2,.1)]],crlpses:[[1.51,-2.32],[1.2,3.26],[.05,4.92],[-4.5,-1.5],[.2,2.32],[3.01,-4.05],[.89,3.47],[-4.74,3.9],[-1.63,-4.21],[-3.05,4.14],[-3.12,.1],[4.72,-.26]]},{crlchnks2:"x.z - 74.2 , x.x - 124.5 , x.y + 99.4",crlxps:["e-3.","e+10.","e"],crlbse:.1,crlsck2:.75,rtaddfmla:[`(floor((rot*${K}.*PI))/${K}.*PI) * ${b.random()}`],rtswlfmla:[""],swl:[0,0,-.2],rtfmla:"max(curl.r * 5., -1.) / fm1(vUv*1.)*.2",crlpses:[[4.6,9.95],[.67,-1.84],[3.87,3.91]]},{crlchnks2:"x.z - 74.2 , x.x - 124.5 , x.y + 99.4",crlxps:["e","e+1.","e+2."],crlbse:.1,rtaddfmla:[`(floor((rot*${K}.*PI))/${K}.*PI) * ${b.random()}`],wrapx:["sin(centeredUV.x*curl.y*ucrlwrp.x) - cos(centeredUV.y*curl.x*ucrlwrp.y)"],crlpses:[[.57,1.31],[.59,2.17],[2.22,-4.86],[-5.08,-4.17],[3,.55],[-4.21,-1.45],[.56,1.51],[-3.32,4.67]]},{crlchnks2:"x.z - 74.2 , x.x - 124.5 , x.y ",crlxps:["e","e-1.","e+2."],crlbse:.1,crlsck2:.5,rtfmla:"max(curl.r * 5., -1.) / fm1(vUv*1.)*.2",rtaddfmla:[`(floor((rot*${K}.*PI))/${K}.*PI) * ${b.random()}`],rtswlfmla:["","rot += curl.r * PI - curl.b"],swl:[b.pick([-.5],0,.5,1),b.pick([-.5],0,.5,1),-.2],wrapx:[`sin(centeredUV.x*curl.y*10.) + cos(centeredUV.y*curl.x*${b.pick([20])}.)`],d:.1,crlpses:[[2.72,1.74],[0,-1],[1.86,-4.7],[-2.55,2.39],[-2.45,-4.86],[3,1.07],[2.82,1.19],[3.51,4.82],[3.19,.94],[-1.08,-4.51],[-3.79,2.39]]},{crlxps:["e","e","dy.y * 1000."],wrapx:["sin(centeredUV.x*curl.y*2.) + cos(centeredUV.y*curl.x*20.)"],rtaddfmla:["(floor((rot*2.*PI))/2.*PI)","(floor((rot*5.*PI))/5.*PI)"],crlpses:[[-2.54,-3.62],[-.19,4.6],[-4.16,-1.45],[-1.07,1.87],[3.16,.25],[-2.96,1.61],[-4.52,4],[-.53,-3.45],[3.21,-4],[1.08,.08],[-1.6,-.9],[1.66,.71],[4.48,-.6],[4.21,2.26],[3.53,1.41],[2.39,2.67],[-4.4,-2.6],[-4.36,.74],[4.13,1.54],[-2.21,2.31],[3.6,-.13],[1.8,-2.15],[-3.28,-3]]}],ge=[];for(let l=0;l<Pe.length;l++){const c=Pe[l],s=c.crlpses,a=Object.keys(c);for(let o=0;o<s.length;o++){const t={},i=s[o];for(let u=0;u<a.length;u++){const f=a[u];t[f]=c[f],t.crlpses=[i]}ge.push(t)}}const U={crlchnk1:"s, s1, s2",crlchnks:"x",crlchnks1:"x.y - 19.1 , x.z + 33.4 , x.x + 47.2",crlchnks2:"x.z + 74.2 , x.x - 124.5 , x.y + 99.4",crlchnk2:"x, y, z",crlxps:["e","e","e"],crlxpbse:1,crlpses:[[b.range(-5,5),b.range(-5,5)]],rtfmla:"max(curl.r * 5., -1.) / fm1(vUv*1.)*.2",rtaddfmla:"0.",rtswlfmla:"",wrapx:"sin(centeredUV.x*curl.y*ucrlwrp.x) + cos(centeredUV.y*curl.x*ucrlwrp.y)",crlwrpscl:[10,50],crlsck2:.55,swl:[.5,.5,0],d:.2},be=.3;let le=Math.floor(r.random()*G.length);const Z=r.random()>.96;let ce=-1,_e=null;for(;ce==-1;){const l=Math.floor(r.random()*G.length);G[l].filter(a=>a.nf).length||(ce=l)}_e=G[ce];let P=G[le],ye=xe[le],It=[.7,.7,.7,1],Y=[r.random()>.85?1:0,r.pick([0,1])],Ct=Y[0]==0?"Day":"Night",we=r.pick([3,4,6,10]),De=P.filter(l=>l.ds);De.length&&(
we=De[0].ds);let Ve=r.random()>.6&&we>2,k=r.pick([3,4,5]);const fe=r.random();fe<.1&&(k=1);fe>.77&&(k=10);fe>.88&&(k=30);fe>.98&&(k=100);Y[0]==1&&(k=Math.min(30,k));k==1&&(Ve=!1);k==100&&(le=r.pick([0,20,22,23]),P=G[le]);let ke=.1;k==30&&(ke*=.7);k==100&&(ke*=.4);let Q=.015;k==4&&(Q=.015);k==5&&(Q=.025);k==10&&(Q*=2);k==30&&(Q*=r.range(5,7));k==100&&(Q*=5);let Pt=(Y[0]==1,0),He=18;const $e={x:r.range(.02,.04),y:1};let _t=Math.floor(r.random()*ge.length),v=ge[_t],qe=.2,Me=P.filter(l=>l.si);Me.length&&(qe=Me[0].si);let Ee=.1,Be=P.filter(l=>l.hsi);Be.length&&(Ee=Be[0].hsi);Y[0]==1&&(Ee*=.5);let se=[1,.5],Fe=P.filter(l=>l.gl);Fe.length&&(se=Fe[0].gl);P.filter(l=>l.ng).length&&(se[0]=se[1]=1);const Se={x:(r.random()>=.65,1),y:r.random()<=.7?Y[0]==1?1:0:1};let We="Hot pressed";Se.y==1&&(We="Cold pressed");Y[0]==1&&(ye=xe[ce]);const Dt={Graphite:Z?"Yes":"No",Name:Z?"Unknown":ye,Time:Z?"Unknown":Ct,ppr:We,Guide:k+""};console.log(Dt);const N={crlchnk1:v.crlchnk1?v.crlchnk1:U.crlchnk1,crlchnks:v.crlchnks?v.crlchnks:U.crlchnks,crlchnks1:v.crlchnks1?v.crlchnks1:U.crlchnks1,crlchnks2:v.crlchnks2?v.crlchnks2:U.crlchnks2,crlchnk2:v.crlchnk2?v.crlchnk2:U.crlchnk2,wrapx:v.wrapx?r.pick(v.wrapx):U.wrapx,crlxps:v.crlxps?v.crlxps:U.crlxps,crlbse:v.crlbse?v.crlbse:U.crlbse,crlsck2:v.crlsck2?v.crlsck2:U.crlsck2,crlpses:v.crlpses?v.crlpses:U.crlpses,rtfmla:v.rtfmla?v.rtfmla:U.rtfmla,d:v.d?v.d:U.d,rtaddfmla:v.rtaddfmla?r.pick(v.rtaddfmla):U.rtaddfmla,rtswlfmla:v.rtswlfmla?r.pick(v.rtswlfmla):U.rtswlfmla,swl:v.swl?r.pick(v.swl):U.swl,crlwrpscl:v.crlwrpscl?r.pick(v.crlwrpscl):U.crlwrpscl};N.crlsck2+=r.range(-.1,.1);k==100&&(N.crlsck2+=r.range(0,.2));const e={isBuild:!0,width:4961*be,height:7016*be,scl:be,rnd:r.random(),renderDebug:!1,debugView:0,animated:!1,step:He,minStep:Pt,maxStep:He,mode:0,form:N,nbShapes:100,strongStrokes:P.filter(l=>l.hs).length>0,isDark:P.filter(l=>l.d!==void 0).length,issqusse:[0,Z?1:0],paletteIdx:le,palette:P,night:Y,sunColor:It,bgColor:"#f5f1e5",bgColorScale:1.7,darkenColor:"#666666",rotate:r.random()<.5?r.range(0,.005)*r.pick([-1,1]):Math.min(r.range(.008,.014),.013)*r.pick([-1,1]),rotateFreq:r.pick([.1,.5,1,2]),artdens:we,artNbColors:2,artgrdlmt:{x:se[0],y:se[1]},grainResScale:1,useContour:!0,contourWidth:4,contourMaskedByframe:!0,nbLinesX:k,nbLinesY:10,cellBorderSize:Q,skipThreshold:1.2,nsyclIntensity:.5,ogclint:.05,hstkIntensity:Ee,fzzstkint:-.45,darkIntensity:Z?-.1:-2.2,globalRot:0,fllclls:{x:Ve,y:r.pick([.8,.9])},edgeWidth:ke,pertubScale:1,pertubUVScale:1,pertubUVTranslateX:-2.2+r.range(-2,2),pertubUVTranslateY:r.range(-.5,.5),clattScale:0,translateUVX:0,blendppr:2,blendHighlights:1.3,blendHighlightsBg:1.3,scrch:$e,oscrch:$e,wearSize:{x:18,y:.5,z:2,w:20},frameParams:{x:r.pick([100,200,400])+r.random()*50,y:r.pick([20,10,5]),z:r.range(40,80),w:r.range(500,1e3)},pprType:{x:Se.x,y:Se.y},ppruvfsst:{x:r.random()>.5?0:r.random()*.3*(r.random()>.5?1:-1),y:r.random()>.4?r.random()*.01:0},ppruvdir:{x:r.random()>.5?1:-1,y:r.random()>.5?1:-1},wrapScaleX:r.range(-.05,.05)*r.range(.9,1.5),wrapScaleY:r.range(-.05,.05)*r.range(.9,1.5),clddegtrslt:{x:r.range(-1,1),y:r.range(-1,1)},curl:{pos:{x:r.range(-5,5),y:r.range(-5,5)},scl:{x:1,y:1},wrap:{x:N.crlwrpscl[0],y:N.crlwrpscl[1]}},ucllff:{x:-Math.floor(r.random()*10)/10,y:Math.floor(r.random()*10)/10},flip:{x:r.random()>=.5?1:-1,y:r.random()>=.5?1:-1},pclstkIntensity:qe,darken:0,dirtBlend:-2,dirts:[{intensity:.3,freq:3,scale:{x:1,y:3},levels:{x:0,y:.3}},{intensity:.5,freq:r.range(4,6),scale:{x:r.range(2,4),y:3},levels:{x:0,y:.3}},{intensity:3,freq:20,scale:{x:1,y:1},levels:{x:r.range(-.03,0),y:r.range(.13,.18)}},{intensity:.4,freq:3,scale:{x:4,y:1},levels:{x:0,y:.3}}],swl:N.swl,hsft:r.range(0,.1),arthsft:0,artcntrst:.82,artbrhtnss:0,artstrtn:4.32,artxpsr:-1.09,cntrst:1.14,brhtnss:0,strtn:.43,xpsr:-.26};e.artcntrst=3;e.artbrhtnss=1.15;e.artstrtn=1.2;e.artxpsr=-.65;e.cntrst=2.5;e.brhtnss=-1.35;e.strtn=.89;e.xpsr=1.39;e.pprType.y==1&&(e.artbrhtnss=1.085);let Ae=r.pick(N.crlpses);e.curl.pos.x=Ae[0];e.curl.pos.y=Ae[1];const de=N.d;e.curl.pos.x+=r.range(-de,de);e.curl.pos.y+=r.range(-de,de);e.isDark&&(e.pclstkIntensity=0,e.nsyclIntensity=.7);e.nbLinesX<=3?e.fllclls.x=!1:e.nbLinesX==10&&(e.fllclls.x=r.random()<=.7,e.fllclls.y=r.pick([.7,.8,.9]));e.night[0]==1&&(e.paletteIdx=ce,e.palette=_e,e.isDark=!1);if(Z){e.night[0]=0;const l=17;P=G[l],P[0].i=.7,P[1].i=.3,ye=xe[l],e.palette=P,e.paletteIdx=l,e.artdens=r.pick([4,6]),e.cntrst=2.3,e.brhtnss=-1.32,e.strtn=-.6,e.xpsr=2,e.hstkIntensity=.07,e.pclstkIntensity=.1,e.issqusse[1]=1}const Le=(l,c,s)=>Math.min(Math.max(l,c),s),ne=(l,c,s)=>{c/=100,s/=100;let a=(1-Math.abs(2*s-1))*c,o=a*(1-Math.abs(l/60%2-1)),t=s-a/2,i=0,u=0,f=0;return 0<=l&&l<60?(i=a,u=o,f=0):60<=l&&l<120?(i=o,u=a,f=0):120<=l&&l<180?(i=0,u=a,f=o):180<=l&&l<240?(i=0,u=o,f=a):240<=l&&l<300?(i=o,u=0,f=a):300<=l&&l<360&&(i=a,u=0,f=o),i=Math.round((i+t)*255),u=Math.round((u+t)*255),f=Math.round((f+t)*255),{r:i,g:u,b:f}},oe=l=>{if(l.s)return l;let c=0,s=0,a=0;l.length==4?(c="0x"+l[1]+l[1],s="0x"+l[2]+l[2],a="0x"+l[3]+l[3]):l.length==7&&(c="0x"+l[1]+l[2],s="0x"+l[3]+l[4],a="0x"+l[5]+l[6]),c/=255,s/=255,a/=255;let o=Math.min(c,s,a),t=Math.max(c,s,a),i=t-o,u=0,f=0,R=0;return i==0?u=0:t==c?u=(s-a)/i%6:t==s?u=(a-c)/i+2:u=(c-s)/i+4,u=Math.round(u*60),u<0&&(u+=360),R=(t+o)/2,f=i==0?0:i/(1-Math.abs(2*R-1)),f=+(f*100).toFixed(1),R=+(R*100).toFixed(1),{h:u,s:f,l:R}};class Vt{constructor(c={}){W(this,"play",()=>{this._isPlaying||(this._isPlaying=!0,this._frame())});W(this,"pause",()=>{!this._isPlaying||(this._isPlaying=!1)});W(this,"togglePlay",()=>{this._isPlaying?this.pause():this.play()});W(this,"_frame",()=>{!this._isPlaying||(this._rafId=requestAnimationFrame(this._frame),this.render())});W(this,"_init",()=>{this._bindEvents(),this._resize(),this.init()});W(this,"_resize",()=>{const c=window.innerWidth,s=window.innerHeight,a=this.width,o=this.height,t=this.canvas;this._displayWidth=a*s/o,this._displayHeight=s-this.heightPadding,this._displayWidth>c&&(this._displayWidth=c,this._displayHeight=this._displayWidth*o/a),t.width=a,t.height=o,t.style.width=`${this._displayWidth}px`,t.style.height=`${this._displayHeight}px`});W(this,"_onKeyUp",({keyCode:c})=>{(c==32||c==69)&&window.render(),c==82&&!e.isBuild&&window.location.reload(),c==37&&(e.step--,e.step=Le(e.step,e.minStep,e.maxStep),window.render()),c==39&&(e.step++,e.step=Le(e.step,e.minStep,e.maxStep),window.render()),c==40&&(e.step=e.minStep,window.render()),c==38&&(e.step=e.maxStep,window.render())});W(this,"_bindEvents",()=>{window.addEventListener("keyup",this._onKeyUp),window.addEventListener("resize",this._resize)});const s=document.createElement("canvas");s.id="artwork",s.style.boxShadow="",this.dpr=c.dpr||window.devicePixelRatio,this.width=c.width||window.innerWidth,this.height=c.height||window.innerHeight,this.heightPadding=0,this._isPlaying=!1,this._displayWidth=this.width,this._displayHeight=this.height,this.canvas=s,s.width=this.width,s.height=this.height,this.gl=s.getContext("webgl"),this.maxUniforms=this.gl.getParameter(this.gl.MAX_VERTEX_UNIFORM_VECTORS),this.r=new THREE.WebGLRenderer({canvas:s,preserveDrawingBuffer:!1}),this.r.setClearColor("#333333",1),this.r.gammaFactor=2.2,this.r.outputEncoding=THREE.sRGBEncoding,this.gl.getParameter(this.gl.MAX_RENDERBUFFER_SIZE),this.gl.getParameter(this.gl.MAX_VIEWPORT_DIMS),this._rafId=0,this._init()}init(){}render(){}resize(){}}var j="attribute vec2 aPosition;attribute vec2 aTexCoord;varying vec2 vUv;void main() {gl_Position = vec4(position, 1.);vUv = uv;}",Ht=`uniform sampler2D tColor1;uniform sampler2D tColor2;uniform sampler2D tColor3;uniform vec2 ures;uniform vec2 ucntr;uniform float uskptsh;uniform float uhgtml;uniform vec4 ushp[nbshp];uniform vec4 ushpcl[nbshp];uniform float uRotations[nbshpROT];uniform float ugrd;uniform float uuseslctcl;uniform vec4 uslctcls;uniform float uRenderRot;uniform float uShift;uniform float uStep;uniform vec2 ugrdlmt;varying vec2 vUv; float map(float value, float min1, float max1, float min2, float max2) {return min2 + (value - min1) * (max2 - min2) / (max1 - min1);} float rand(vec2 co){return fract(sin(dot(co, vec2(12.9898, 78.233))) * 43758.5453);} \${blend}\${adjust} float drwrct(vec2 coord, vec2 dimensions, vec2 offset) {vec2 rct = step(offset, coord);rct *= step(coord, offset + dimensions);return rct.x * rct.y;}float drawCircle(vec2 coord, float radius) {return step(length(coord), radius);}float drawCircle(vec2 coord, float radius, float innerRadius) {return step(length(coord), radius) - step(length(coord), innerRadius);}void main() {float ratio = ures.x/ures.y;float stripes = step( fract(vUv.y*50.), .5 );vec3 rects = vec3(0.);for (int i = 0; i < nbshp; i++) {float x = ushp[i].x;float y = 1.-ushp[i].y * 2.;float w = ushp[i].z * 1.;float h = ushp[i].w * uhgtml;float p = map(vUv.x, x, x+w, -1., 1.);float py = map(vUv.y, y, y+h, 0., 1.);vec3 color = ushpcl[i].rgb;float opacity = abs(ushpcl[i].a);float rnd = rand(vec2(x,y));float mapper = map(vUv.x, x, x+w, 1. ,0.);color *= map(vUv.x, x, x+w, ugrdlmt.x, ugrdlmt.y);vec3 color180 = hsft(color, uShift);color = mix(color, color180, mapper);vec3 colorStripes = hsft(color, -.5);colorStripes = brhtnss(colorStripes, .5);if (uRenderRot
var xt=Object.defineProperty;var gt=(c,l,s)=>l in c?xt(c,l,{enumerable:!0,configurable:!0,writable:!0,value:s}):c[l]=s;var D=(c,l,s)=>(gt(c,typeof l!="symbol"?l+"":l,s),s);const bt=function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))o(n);new MutationObserver(n=>{for(const t of n)if(t.type==="childList")for(const i of t.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&o(i)}).observe(document,{childList:!0,subtree:!0});function s(n){const t={};return n.integrity&&(t.integrity=n.integrity),n.referrerpolicy&&(t.referrerPolicy=n.referrerpolicy),n.crossorigin==="use-credentials"?t.credentials="include":n.crossorigin==="anonymous"?t.credentials="omit":t.credentials="same-origin",t}};bt();function yt(c){let l={},s="0x";for(var o=0;o<64;o++)s+=Math.floor(Math.random()*16).toString(16);return l.hash=s,l.tokenId=(c*1e6+Math.floor(Math.random()*1e3)).toString(),l}let ie=tokenData||yt(123);class wt{constructor(){this.useA=!1,this.tk=ie,console.log("hash",this.tk.hash);let l=function(s){let o=parseInt(s.substr(0,8),16),n=parseInt(s.substr(8,8),16),t=parseInt(s.substr(16,8),16),i=parseInt(s.substr(24,8),16);return function(){o|=0,n|=0,t|=0,i|=0;let u=(o+n|0)+i|0;return i=i+1|0,o=n^n>>>9,n=t+(t<<3)|0,t=t<<21|t>>>11,t=t+u|0,(u>>>0)/4294967296}};this.prngA=new l(ie.hash.substr(2,32)),this.prngB=new l(ie.hash.substr(34,32));for(let s=0;s<1e6;s+=2)this.prngA(),this.prngB()}random(){return this.useA=!this.useA,this.useA?this.prngA():this.prngB()}range(l,s){return l+(s-l)*this.random()}int(l,s){return Math.floor(this.range(l,s+1))}bool(l){return this.random()<l}pick(l){return l[this.int(0,l.length-1)]}}const r=new wt,ue=r.pick([0,1]),B=[[{c:"#4a4e69",i:.5},{c:"#5aa9e6",i:.25},{c:"#e7d5ce",i:.5},{c:"#e6b953",i:.25,hs:!0,si:.01,gl:[.8,.8],ds:r.pick([2,4,4]),nf:!0}],[{c:"#88A6C2",i:.2},{c:"#D2BB93",i:ue==1?.25:.3,ng:(ue==1,!1),hs:!0,ds:r.pick([3,4]),nf:!0,gl:[1,.8]}],[{c:"#A8715D",i:.4},{c:"#88A6C2",i:.4,hs:!0,ds:r.pick([2,4,3,4])}],[{c:"#3b72b5",i:.1},{c:"#a8cfef",i:.3,hs:!0,si:.23,hsi:.035,ds:r.pick([4,6,8])}],[{c:"#a25d72",i:.4},{c:"#e79cb1",i:.4},{c:"#a9373b",i:.2,hs:!0,ds:r.pick([2,4,4])}],[{c:"#5f6d87",i:.45},{c:"#ab9d90",i:.2},{c:"#e6b953",i:.35,hs:!0,nf:!0,ds:r.pick([2,4,4,4])}],[{c:"#1e2642",i:.7},{c:"#dddddd",i:.2,hs:!0,ng:!1,gl:[1,.8],si:.01,ds:r.pick([2,4,3,4])}],[{c:"#1e2642",i:.5},{c:"#5f6d87",i:.5,hs:!0,ng:!1,gl:[1,.8],si:.01,ds:r.pick([2,4,3,4]),nf:!0}],[{c:"#977881",i:.4},{c:"#f9d794",i:.2,hs:!0,hsi:.05,ds:r.pick([3,4]),nf:!0}],[{c:"#f9d2db",i:.2,d:.8},{c:"#e7d5ce",i:.2},{c:"#e7d5ce",i:.2,hs:!0,ds:r.pick([2,4,4,5]),nf:!0}],[{c:"#C1EBE7",i:.25},{c:"#C1EBE7",i:.15,ng:!(r.random()>.7),hs:!0,si:.13,ds:r.pick([3,4]),hsi:.1}],[{c:"#5aa9e6",i:.3},{c:"#5aa9e6",i:.3,f:!0,ng:r.random()>.6,hs:!0,ds:r.pick([2,4,4]),nf:!0}],[{c:"#FFC9E1",i:.26},{c:"#C1EBE7",i:.2},{c:"#C1EBE7",i:.2,hs:!0,ds:r.pick([2,4,2.5,4])}],[{c:"#d736bb",i:.07},{c:"#a8cfef",i:.2,hs:!0,ng:!0,ds:r.pick([2,4,4]),nf:!0}],[{c:"#e79cb1",i:.35},{c:"#1e2642",i:.2},{c:"#599598",i:.4},{c:"#e6b953",i:.4},{c:"#3b72b5",i:.25,hs:!0,ds:r.pick([4,10])}],[{c:"#a25d72",i:.33},{c:"#e04372",i:.15,f:!0,hs:!0,ds:r.pick([2,4,4,6])}],[{c:"#666666",i:.7,d:.8},{c:"#000000",i:.1,hs:!0,gl:ue>0?[0,1]:null,ds:r.pick([4,6,10])}],[{c:"#666666",i:1,d:.8},{c:"#666666",i:.1},{c:"#666666",i:.1,nf:!0,hs:!0,ds:r.pick([4,6,10])}],[{c:"#C1EBE7",i:.3},{c:"#e6b953",i:.2},{c:"#a8cfef",i:.1,hs:!0,nf:!0}],[{c:"#000000",i:.2},{c:"#e6b953",i:.3},{c:"#e6b953",i:.25,hs:!0}],[{c:"#88A6C2",i:.4},{c:"#814F00",i:.35},{c:"#4a4e69",i:.8},{c:"#a9373b",i:.25,hs:!0,nf:!0,ds:r.pick([4,6])}],[{c:"#a9373b",i:.2},{c:"#a8cfef",i:.2},{c:"#a8cfef",i:.2,hs:!0,ng:!0,ds:r.pick([2,4,4]),sh:-.5,nf:!0}],[{c:"#e04372",i:.2},{c:"#5aa9e6",i:.3},{c:"#4a4e69",i:.3},{c:"#e04372",i:.2},{c:"#e6b953",i:.25,hs:!0,nf:!0,ds:r.pick([3,4])}],[{c:"#5f6d87",i:.45},{c:"#e04372",i:.2},{c:"#e6b953",i:.35,hs:!0,nf:!0,ds:r.pick([2,4,4,4])}]],ve=["Madeleine","Camille","Emmeline","Jeanne","Hedy","Marie","Margaret","C\xE9cilia","Ada","Jocelyn","Sonita","Malala","Ellen","Nzinga","Billie","Yvonne","Junko","Elizabeth","Rosalin","Sirimavo","Bertha","Simone","Sonia","Sonia"];function kt(c){let l={},s="0x";for(var o=0;o<64;o++)s+=Math.floor(Math.random()*16).toString(16);return l.hash=s,l.tokenId=(c*1e6+Math.floor(Math.random()*1e3)).toString(),l}let fe=tokenData||kt(123);class St{constructor(){this.useA=!1,this.tk=fe,console.log("hash",this.tk.hash);let l=function(s){let o=parseInt(s.substr(0,8),16),n=parseInt(s.substr(8,8),16),t=parseInt(s.substr(16,8),16),i=parseInt(s.substr(24,8),16);return function(){o|=0,n|=0,t|=0,i|=0;let u=(o+n|0)+i|0;return i=i+1|0,o=n^n>>>9,n=t+(t<<3)|0,t=t<<21|t>>>11,t=t+u|0,(u>>>0)/4294967296}};this.prngA=new l(fe.hash.substr(2,32)),this.prngB=new l(fe.hash.substr(34,32));for(let s=0;s<1e6;s+=2)this.prngA(),this.prngB()}random(){return this.useA=!this.useA,this.useA?this.prngA():this.prngB()}range(l,s){return l+(s-l)*this.random()}int(l,s){return Math.floor(this.range(l,s+1))}bool(l){return this.random()<l}pick(l){return l[this.int(0,l.length-1)]}}const h=new St,N=h.random()>=.5?1:3,Ie=[{crlchnks2:"x.z / 74.2 , x.x - 124.5 , x.y + 99.4",curlExpBase:.1,rtfmla:"max(curl.r * 5., -1.) / fm1(vUv*1.)*.5",rtaddfmla:["(floor((rot*3.*PI))/3.*PI)"],crlsck2:.5,crlpses:[[1.34,2.09],[-4.16,-1.45],[3.16,.25],[5,3],[.85,-2.77],[-3.54,-1.92]]},{crlchnks2:"x.z - 74.2 , x.x - 1240.5 , x.y + 99.4",crlbse:.1,rtfmla:"max(curl.r * 3., -1.) / fm1(vUv*1.)*.5",rtaddfmla:["(floor((rot*1.*PI))/1.*PI)"],rtswlfmla:["","","","rot += angle","rot += sin(angle) * 2."],swl:[[h.pick([0,.5]),h.pick([0,.5,1]),0]],wrapx:["sin(centeredUV.x*curl.y*ucrlwrp.x) * cos(centeredUV.y*curl.x*ucrlwrp.y)"],crlsck2:.5,crlpses:[[.99,2.72],[-3.16,1.49],[1.75,-.4],[3.93,-2.49,2,20],[-2.23,3.2],[2.54,-.18],[.12,-2.38],[1.08,-2.14],[3.48,.33],[1.64,-.5],[-2.86,.54]]},{crlchnks2:"x.z - 74.2 , x.x - 1240.5 , x.y + 99.4",crlbse:.1,rtfmla:"max(curl.r * 3., -1.) / fm1(vUv*1.)*.5",rtaddfmla:["(floor((rot*1.*PI))/1.*PI)"],rtswlfmla:["","rot += angle"],swl:[h.pick([-.5],0,.5,1),h.pick([-.5],0,.5,1),-0],wrapx:["sin(centeredUV.x*curl.y*5.) * cos(centeredUV.y*curl.x*50.)"],crlsck2:.5,swl:[h.pick([-.5],0,.5,1),h.pick([-.5],0,.5,1),0],crlpses:[[2.88,-3.08],[-2.98,.45],[2.79,-3.17]]},{crlchnks2:"x.z - 74.2 , x.x - 124.5 , x.y + 99.4",crlxps:["e","e*5.","e*10."],rtfmla:"max(curl.r * 3., -1.) / fm1(vUv*1.)*.5",rtaddfmla:["(floor((rot*3.*PI))/3.*PI)"],crlpses:[[-2.06,-1.67],[-3.08,-4.58],[3.18,-4.62],[-2,4.5],[-4.28,-.68],[.92,1.43],[1.11,3.36],[1.17,3.72],[3.93,4.05],[2.7,.25],[4.24,3.77]]},{crlxps:["e","e+1.","e+2."],rtaddfmla:["(floor((rot*2.*PI))/2.*PI)"],rtswlfmla:["",`rot += angle * ${h.pick([".5",".8","1."])}`],swl:[[h.range(-1,1),h.range(-1,1),h.range(-.2,.1)]],crlpses:[[1.51,-2.32],[1.2,3.26],[.05,4.92],[-4.5,-1.5],[.2,2.32],[3.01,-4.05],[.89,3.47],[-4.74,3.9],[-1.63,-4.21],[-3.05,4.14],[-3.12,.1],[4.72,-.26]]},{crlchnks2:"x.z - 74.2 , x.x - 124.5 , x.y + 99.4",crlxps:["e-3.","e+10.","e"],crlbse:.1,crlsck2:.75,rtaddfmla:[`(floor((rot*${N}.*PI))/${N}.*PI) * ${h.random()}`],rtswlfmla:[""],swl:[0,0,-.2],rtfmla:"max(curl.r * 5., -1.) / fm1(vUv*1.)*.2",crlpses:[[4.6,9.95],[.67,-1.84],[3.87,3.91]]},{crlchnks2:"x.z - 74.2 , x.x - 124.5 , x.y + 99.4",crlxps:["e","e+1.","e+2."],crlbse:.1,rtaddfmla:[`(floor((rot*${N}.*PI))/${N}.*PI) * ${h.random()}`],wrapx:["sin(centeredUV.x*curl.y*ucrlwrp.x) - cos(centeredUV.y*curl.x*ucrlwrp.y)"],crlpses:[[.57,1.31],[.59,2.17],[2.22,-4.86],[-5.08,-4.17],[3,.55],[-4.21,-1.45],[.56,1.51],[-3.32,4.67]]},{crlchnks2:"x.z - 74.2 , x.x - 124.5 , x.y ",crlxps:["e","e-1.","e+2."],crlbse:.1,crlsck2:.5,rtfmla:"max(curl.r * 5., -1.) / fm1(vUv*1.)*.2",rtaddfmla:[`(floor((rot*${N}.*PI))/${N}.*PI) * ${h.random()}`],rtswlfmla:["","rot += curl.r * PI - curl.b"],swl:[h.pick([-.5],0,.5,1),h.pick([-.5],0,.5,1),-.2],wrapx:[`sin(centeredUV.x*curl.y*10.) + cos(centeredUV.y*curl.x*${h.pick([20])}.)`],d:.1,crlpses:[[2.72,1.74],[0,-1],[1.86,-4.7],[-2.55,2.39],[-2.45,-4.86],[3,1.07],[2.82,1.19],[3.51,4.82],[3.19,.94],[-1.08,-4.51],[-3.79,2.39]]},{crlxps:["e","e","dy.y * 1000."],wrapx:["sin(centeredUV.x*curl.y*2.) + cos(centeredUV.y*curl.x*20.)"],rtaddfmla:["(floor((rot*2.*PI))/2.*PI)","(floor((rot*5.*PI))/5.*PI)"],crlpses:[[-2.54,-3.62],[-.19,4.6],[-4.16,-1.45],[-1.07,1.87],[3.16,.25],[-2.96,1.61],[-4.52,4],[-.53,-3.45],[3.21,-4],[1.08,.08],[-1.6,-.9],[1.66,.71],[4.48,-.6],[4.21,2.26],[3.53,1.41],[2.39,2.67],[-4.4,-2.6],[-4.36,.74],[4.13,1.54],[-2.21,2.31],[3.6,-.13],[1.8,-2.15],[-3.28,-3]]}],de=[];for(let c=0;c<Ie.length;c++){const l=Ie[c],s=l.crlpses,o=Object.keys(l);for(let n=0;n<s.length;n++){const t={},i=s[n];for(let u=0;u<o.length;u++){const p=o[u];t[p]=l[p],t.crlpses=[i]}de.push(t)}}const w={crlchnk1:"s, s1, s2",crlchnks:"x",crlchnks1:"x.y - 19.1 , x.z + 33.4 , x.x + 47.2",crlchnks2:"x.z + 74.2 , x.x - 124.5 , x.y + 99.4",crlchnk2:"x, y, z",crlxps:["e","e","e"],curlExpBase:1,crlpses:[[h.range(-5,5),h.range(-5,5)]],rtfmla:"max(curl.r * 5., -1.) / fm1(vUv*1.)*.2",rtaddfmla:"0.",rtswlfmla:"",wrapx:"sin(centeredUV.x*curl.y*ucrlwrp.x) + cos(centeredUV.y*curl.x*ucrlwrp.y)",crl
rotate(vec2 uv, float rotation, float mid){return vec2(cos(rotation) * (uv.x - mid) + sin(rotation) * (uv.y - mid) + mid,cos(rotation) * (uv.y - mid) - sin(rotation) * (uv.x - mid) + mid);}vec2 scale(vec2 uv, float scale, vec2 origin) {return (uv - origin) * scale + origin;}vec2 scale(vec2 uv, vec2 scale, vec2 origin) {return (uv - origin) * scale + origin;}void main() {float uvx = vUv.x;float uvy = vUv.y;if (uflp.x == 1.) {uvx = 1.-vUv.x;}if (uflp.y == 1.) {uvy = 1.-vUv.y;}vec2 uv = vec2(uvx, uvy);vec3 c = texture2D(tInput, uv).rgb;gl_FragColor = vec4(c, 1.);}`;const Mt="vec2 wrapuv = vec2(vUv.x, vUv.y) * -10.;float fllcll = 1.;if (uStep == 0. ) {wrapuv.x *= .5;}float nbStripes = 1.;if (uStep > 3.) {nbStripes = unblns.x;}float cellIdOffset = urnd * 10.;if (unblns.x == 10.) {cellIdOffset *= step(.35, urnd);}vec2 cellId = floor( (mod(vUv, 1.))*nbStripes)/nbStripes;cellId += vec2(random(vec2(cellId.x*cellIdOffset+cellId.y+ucllff.x*10.)));cellId = mod(cellId, 1.);vec2 cellUv = mod(vUv, vec2(1./nbStripes)) * nbStripes;float v = rnduv(floor(vUv * 1.));float stripes = floor(( fract( vUv.y + v ) *nbStripes))/nbStripes;stripes *= floor(vUv.y *nbStripes)/nbStripes*1000.;float offset = 0.;offset += pertub * .5;float xstripes = floor(( fract( vUv.x + v ) *nbStripes))/nbStripes;stripes *= xstripes;if (uStep > 0.) {wrapuv.x *= offset * .2;wrapuv.x += offset * 30.;wrapuv.x += stripes * 10.5;wrapuv.x += stripes - noise(vec3(stripes*100.)) - 1.;}float rot = 0.;float direction = curl.r < -1. ? 1. : -1.;if (uStep > 2.) {rot = #rtfmla;rot += #rtaddfmla;}float ffctrd = 1.;float ffcagl = 2. * PI;vec2 swlCenter = uswl.xy;vec2 swlUv = vUv * 1. - swlCenter;float dstctr = distance(vUv, swlCenter) - .1;dstctr = clamp(dstctr, 0., 1.);float len = uswl.z + length(swlUv * vec2(ratio, 1.));float angle = atan(swlUv.y, swlUv.x) + ffcagl * smoothstep(ffctrd, 0., len);#rtswlfmla; rot += uglrt;vec2 centeredUV = rotate(vUv, rot, vec2(0.));if (uStep > 1.) {wrapuv.x += #wrapx;}if(usqss.y == 0. && ufllcll.x == 1. && cellId.y > ufllcll.y && uStep > 4.) {fllcll = 0.;} wrapuv = scale(wrapuv, vec2(.2, 1.), vec2(0.));",I=e.form;let g=Fe;g=g.replace("#crlchnk1",I.crlchnk1);g=g.replace("#crlchnks",I.crlchnks);g=g.replace("#crlchnks1",I.crlchnks1);g=g.replace("#crlchnks2",I.crlchnks2);g=g.replace("#crlchnk2",I.crlchnk2);g=g.replace("#crlbse",I.crlbse);g=g.replace("#curlExp0",I.crlxps[0]);g=g.replace("#curlExp1",I.crlxps[1]);g=g.replace("#curlExp2",I.crlxps[2]);let d=qt;d=d.replace("${curl}",g);d=d.replace("${noisecommon}",Se);d=d.replace("${pnoise}",We);d=d.replace("${snoise}",we);d=d.replace("${grain}",Ae);d=d.replace("${noise}",Le);d=d.replace("${fm}",Ne);d=d.replace("${adjust}",Xe);d=d.replace("${blend}",ke);d=d.replace("${edge}",Oe);d=d.replace("${wrapuv}",Mt);d=d.replace("#rtfmla",I.rtfmla);d=d.replace("#rtaddfmla",I.rtaddfmla);d=d.replace("#rtswlfmla",I.rtswlfmla);d=d.replace("#wrapx",I.wrapx);new THREE.Vector2;new THREE.Vector3;const Ge=new THREE.Vector4,Bt=c=>{let l=null,s=null,o,n,t,i,u,p=null,b=ye(4096);const k=()=>{l=Dt(),s=$t(l.getColorTexture())},R=()=>{o=new THREE.Scene,n=new THREE.PerspectiveCamera(45,e.width/e.height,.01,100);let v=re(e.bgColor);v=te(v.h,v.s,v.l);let S=[],T=[];t=new THREE.ShaderMaterial({defines:{nbdrts:e.dirts.length},uniforms:{ures:{value:new THREE.Vector2(e.width,e.height)},uDebug:{value:e.debugView},tInput:{value:l.getColorTexture()},tWrap:{value:l.getWrapTexture()},tDirtInput:{value:l.gtdtColorTexture()},tDarkInput:{value:l.getColorSelectionTexture()},tContourInput:{value:l.getContourTexture()},tRotationInput:{value:l.getRotationTexture()},tStrokesInput:{value:s.getColorTexture()},ubg:{value:new THREE.Vector4(v.r/255,v.g/255,v.b/255,e.bgColorScale)},upprCBSE:{value:new THREE.Vector4(e.pprcntrst,e.pprbrhtnss,e.pprstrtn,e.pprxpsr)},uartcbse:{value:new THREE.Vector4(e.artcntrst,e.artbrhtnss,e.artstrtn,e.artxpsr)},uarthsft:{value:e.arthsft},ucbse:{value:new THREE.Vector4(e.cntrst,e.brhtnss,e.strtn,e.xpsr)},uptscl:{value:e.pertubScale},uptuvscl:{value:e.pertubUVScale},uptuvtrlt:{value:new THREE.Vector2(e.pertubUVTranslateX,e.pertubUVTranslateY)},uclddgrtrlt:{value:new THREE.Vector2(e.clddegtrslt.x,e.clddegtrslt.y)},uclattscl:{value:e.clattScale},ugrnscl:{value:e.grainResScale},ucntr:{value:new THREE.Vector3(1,e.contourWidth,1)},unblns:{value:new THREE.Vector2(e.nbLinesX,e.nbLinesY)},ucllbrdsz:{value:e.cellBorderSize},ucrl:{value:new THREE.Vector4(e.curl.pos.x,e.curl.pos.y,e.curl.scl.x,e.curl.scl.y)},ucrlwrp:{value:new THREE.Vector2(e.curl.wrap.x,e.curl.wrap.y)},ucrlscl:{value:e.form.crlsck2},upclskint:{value:e.pclstkIntensity},unseclint:{value:e.nsyclIntensity},uogclint:{value:e.isDark?0:e.originColorIntensity},uhstkint:{value:e.hstkIntensity},ufzzstkint:{value:e.fzzstkint},udkint:{value:e.darkIntensity},uswl:{value:new THREE.Vector3(e.swl[0],e.swl[1],e.swl[2])},ucllff:{value:new THREE.Vector2(e.ucllff.x,e.ucllff.y)},udkn:{value:e.isDark?1:0},udkncl:{value:new THREE.Vector4(v.r/255,v.g/255,v.b/255,e.bgColorScale)},upprtp:{value:new THREE.Vector2(e.pprType.x,e.pprType.y)},uscrch:{value:new THREE.Vector2(e.scrch.x,e.scrch.y)},uwrsz:{value:new THREE.Vector4(e.wearSize.x,e.wearSize.y,e.wearSize.y,e.wearSize.w)},uglrt:{value:e.globalRot},ufllcll:{value:new THREE.Vector2(e.fllclls.x?1:0,e.fllclls.y)},ufrmprm:{value:new THREE.Vector4(e.frameParams.x,e.frameParams.y,e.frameParams.z,e.frameParams.w)},ungt:{value:new THREE.Vector2(e.night[0],e.night[1])},uDirts:{value:S},udtintfq:{value:T},udtbld:{value:e.dirtBlend},usqss:{value:new THREE.Vector2(e.issqusse[0],e.issqusse[1])},urnd:{value:e.rnd},upidx:{value:e.paletteIdx},uWRes:{value:e.scl},urt:{value:e.rotate},urtfq:{value:e.rotateFreq},uedgwdh:{value:e.edgeWidth},uStep:{value:1}},vertexShader:W,fragmentShader:d}),t.extensions.derivatives=!0,i=new THREE.ShaderMaterial({uniforms:{tInput:{value:b.texture},uflp:{value:new THREE.Vector2(e.flip.x,e.flip.y)},ungt:{value:new THREE.Vector2(e.night[0],e.night[1])},uSunColor:{value:new THREE.Vector4(e.sunColor[0],e.sunColor[1],e.sunColor[2],e.sunColor[3])},uStep:{value:1}},vertexShader:W,fragmentShader:Ht}),u=new THREE.PlaneBufferGeometry(2,2),p=new THREE.Mesh(u,t),o.add(p)},C=v=>{console.log("render step",e.step),l.render(v),s.render(v),e.step>5&&e.night[0]==1?(t.uniforms.ungt.value.x=1,e.artcntrst=3.75,e.artbrhtnss=2,e.artstrtn=1.2,e.scrch.x=.01):e.night[0]==1&&(t.uniforms.ungt.value.x=0,e.artcntrst=3,e.artbrhtnss=1.15,e.artxpsr=-.65,e.artstrtn=-1);let S=re(e.bgColor);S=te(S.h,S.s,S.l);let T=re(e.darkenColor);T=te(T.h,T.s,T.l),Ge.set(S.r/255,S.g/255,S.b/255,e.bgColorScale),t.uniforms.ubg.value=Ge,t.uniforms.udkncl.value.x=T.r/255,t.uniforms.udkncl.value.y=T.g/255,t.uniforms.udkncl.value.z=T.b/255,t.uniforms.uDebug.value=e.debugView,t.uniforms.uarthsft.value=e.arthsft,t.uniforms.uartcbse.value.x=e.artcntrst,t.uniforms.uartcbse.value.y=e.artbrhtnss,t.uniforms.uartcbse.value.z=e.artstrtn,t.uniforms.uartcbse.value.w=e.artxpsr,t.uniforms.ucbse.value.x=e.cntrst,t.uniforms.ucbse.value.y=e.brhtnss,t.uniforms.ucbse.value.z=e.strtn,t.uniforms.ucbse.value.w=e.xpsr,t.uniforms.uptscl.value=e.pertubScale,t.uniforms.uptuvscl.value=e.pertubUVScale,t.uniforms.uptuvtrlt.value.x=e.pertubUVTranslateX,t.uniforms.uptuvtrlt.value.y=e.pertubUVTranslateY,t.uniforms.uclddgrtrlt.value.x=e.clddegtrslt.x,t.uniforms.uclddgrtrlt.value.y=e.clddegtrslt.y,t.uniforms.uclattscl.value=e.clattScale,t.uniforms.ugrnscl.value=e.grainResScale,t.uniforms.ucntr.value.x=1,t.uniforms.ucntr.value.y=e.contourWidth,t.uniforms.ucntr.value.z=1,t.uniforms.unblns.value.x=e.nbLinesX,t.uniforms.unblns.value.y=e.nbLinesY,t.uniforms.ucrl.value.x=e.curl.pos.x,t.uniforms.ucrl.value.y=e.curl.pos.y,t.uniforms.ucrl.value.z=e.curl.scl.x,t.uniforms.ucrl.value.w=e.curl.scl.y,t.uniforms.uscrch.value.x=e.scrch.x,t.uniforms.uwrsz.value.x=e.wearSize.x,t.uniforms.uwrsz.value.y=e.wearSize.y,t.uniforms.uwrsz.value.z=e.wearSize.z,t.uniforms.uwrsz.value.w=e.wearSize.w,t.uniforms.upclskint.value=e.pclstkIntensity,t.uniforms.unseclint.value=e.nsyclIntensity,t.uniforms.uhstkint.value=e.hstkIntensity,t.uniforms.uogclint.value=e.isDark?0:e.originColorIntensity,t.uniforms.udkn.value=e.isDark?1:0,t.uniforms.uglrt.value=e.globalRot,t.uniforms.ufllcll.value.x=e.fllclls.x?1:0,t.uniforms.ufllcll.value.y=e.fllclls.y;let A=[],P=[];for(let Y=0;Y<e.dirts.length;Y++){const $=e.dirts[Y];A.push($.scale.x,$.scale.y,$.levels.x,$.levels.y),P.push($.intensity,$.freq)}t.uniforms.uDirts.value=A,t.uniforms.udtintfq.value=P,t.uniforms.udtbld.value=e.dirtBlend,t.uniforms.uStep.value=e.step,i.uniforms.uStep.value=e.step,p.material=t,v.setRenderTarget(b),v.render(o,n),p.material=i,v.setRenderTarget(null),v.render(o,n)};return k(),R(),{render:C}};let V=null,Ye=null;const Ft=()=>{V.gl,Ye=Bt()},je=()=>{Ye.render(V.r)};window.render=je;const Wt=()=>{const l=V.canvas.toDataURL();let s=document.createElement("img");s.src=l,document.body.appendChild(s)};window.saveRender=Wt;const At=()=>{V=new Tt({width:e.width,height:e.height}),e.nbShapes=V.maxUniforms<1024?100:400,V.render=je,new THREE.Scene,new THREE.PerspectiveCamera(45,e.width/e.height,.01,100),Ft(),V.play(),V.pause(),document.body.appendChild(V.canvas)};At();
Step > 13.) {dirtc2 *= m;}float xdgemsk = noise(vec3(vUv * vec2(ufrmprm.x + c.r, ufrmprm.y), .0));float ydgemsk = noise(vec3(vUv * vec2(ufrmprm.z + c.r, ufrmprm.w), .0));float xdge = .02 + sin(vUv.y*15. + uptuvtrlt.x + vUv.x * 10.) * .003;float ydge = xdge * ratio + sin(vUv.x*10. + uptuvtrlt.y + vUv.y * 10. * curl.r * 2.) * .002;xdge += xdgemsk * .02 + abs(sin(vUv.x * 50.)) * .003;ydge += ydgemsk * .007 + sin(vUv.x * 5. + uptuvtrlt.x + step(vUv.y, .5)) * .0025;float frmx = 1.;float frmy = 1.;float frm = 1.;if (vUv.x < xdge || vUv.x > 1. - xdge ) { frmx = 0.;}if (vUv.y < ydge || vUv.y > 1. - ydge ) { frmy = 0.;}frm = frmx * frmy;float xsqssedgmsk = noise(vec3(vUv * vec2(ufrmprm.x + c.r, ufrmprm.y), .0));float ysqssedgmsk = noise(vec3(vUv * vec2(ufrmprm.z + c.r, ufrmprm.w), .0));float xsqssedg = .005 + sin(vUv.y*15. + uptuvtrlt.x + vUv.x * 10.) * .003;float ysqssedg = xsqssedg * ratio + sin(vUv.x*10. + uptuvtrlt.y + vUv.y * 10. * curl.r * 2.) * .002;xsqssedg += xsqssedgmsk * .02 + abs(sin(vUv.x * 50.)) * .009;ysqssedg += ysqssedgmsk * .007 + sin(vUv.x * 5. + uptuvtrlt.x + step(vUv.y, .5)) * .005;float frmsqssx = 1.;float frmsqssy = 1.;float frmsqss = 1.;if (vUv.x < xsqssedg || vUv.x > 1. - xsqssedg ) { frmsqssx = 0.;}if (vUv.y < ysqssedg || vUv.y > 1. - ysqssedg ) { frmsqssy = 0.;}frmsqss = frmsqssx * frmsqssy;\n${wrapuv}\nvec3 pclstkcl = gtpclstk(c.r);vec3 nsycl = gtnsycl(c.r);vec3 wrpcl = texture2D(tInput, wrapuv).rgb;float wrapRot = texture2D(tRotationInput, wrapuv).r;wrpcl *= fllcll;float cmask = step( length(wrpcl), 0. );float clltsh = .1;if((cellId.y < clltsh && unblns.x > 1.) || usqss.x == 1.) {wrpcl = vec3(0.);} float stkrt = xpsr(vec3(wrpcl.r / wrpcl.b), 2.).r;vec2 stkuv = rotate(vUv, wrapRot + PI * .5 + curl.r * 50. + stripes + length(wrpcl) * 2. + cellId.x * PI * 1., vec2(.5));vec2 stkuv2 = rotate(vUv * vec2(1., 5.), wrapRot + curl.b * .5 + cellId.x * PI * 1., vec2(.5));vec2 stkuv3 = rotate(vUv * vec2(1., 30.), wrapRot + curl.b * .8 + cellId.x * PI * 1., vec2(.5));vec3 hstk = texture2D(tStrokesInput, stkuv).rgb * (1. - step(cellId.y, clltsh) );vec3 hstk2 = texture2D(tStrokesInput, stkuv2).rgb * (1. - step(cellId.y, clltsh) );vec3 hstk3 = texture2D(tStrokesInput, stkuv3).rgb * (1. - step(cellId.y, clltsh) );float hstk2Sat = -.05;if (ungt.x == 0.) {hstk2Sat = -1.;}hstk = strtn(hstk, -1.);hstk2 = strtn(hstk2, hstk2Sat);hstk3 = strtn(hstk3, -1.);float cctr = texture2D(tContourInput, wrapuv).r * 10.;cctr = clamp(cctr, 0., 1.);cctr = strtn(vec3(cctr), -1.).r;if (usqss.x == 0. && uStep > 11.) {wrpcl *= frm;}if (ucntr.z == 1.) {cctr *= frm;}cmask -= 1. - frm;hstk *= frm;hstk2 *= frm;hstk3 *= frm;float oclint = 0.;if (uStep > 9.) {oclint = uogclint;}c = bldscn(wrpcl, dirtc, oclint);if (uStep > 13.) {}if (uStep > 9.) {c = bldovl(c, nsycl, unseclint);}vec3 pclstk = strtn(pclstkcl, -1.);if (uStep > 17.) {c -= pclstk * upclskint * length(c) * frm;c = clamp(c, 0., 1.);}vec3 desathstk = strtn(hstk, -.95);if (uStep > 13. && cellId.x > clltsh) {c = bldav(c, vec3(desathstk), (1. - cmask) * uhstkint);c = bldav(c, vec3(hstk2), (1. - cmask) * uhstkint);c = bldav(c, vec3(hstk3), (1. - cmask) * uhstkint);}c = hsft(c, uarthsft);vec4 artcbse = vec4(uartcbse.x, 0., uartcbse.z, uartcbse.w);if (uStep > 6.) {artcbse.y = uartcbse.y; }c = applycbse(c, artcbse);float cntrdge = edge(tContourInput, wrapuv, vec2(ures.x, ures.y) * uedgwdh );cntrdge = clamp(cntrdge, 0., 1.);cntrdge *= pertub;if (uStep > 7.) {c += cnoise * .2;}if (ucntr.x == 1. && uStep > 12.) {float intensity = ungt.x == 1. ? .7 : 1.;if (frm == 1.) {intensity *= 1.05;}if (usqss.y == 0.) {c = bldav(c, vec3(1.), cntrdge * intensity);}if (usqss.y == 1.) {c -= vec3(-.12) * cntrdge;}}float xhashPertub = noise(vec3((vUv * vec2(100., 10.) + vec2(stripes)), 0.)) * 3. ;float yhashPertub = noise(vec3((vUv * vec2(1., 100.) + vec2(-.5)), 0.)) * 3. ;float xhshffst = (floor((vUv.y*10.))/10.);float hshmsk = 1. - vec3( cntrst(vec3(length(c)), 4.)).r;float hshres = 200.;if (upprtp.y == 1.) { hshres = 150.; }float xhsh = smoothstep(.1, .15, fract((vUv.x+xhshffst * 20.) * hshres));float yhsh = smoothstep(.1, .15 + pertub * .3, fract(vUv.y * hshres + yhashPertub * .1 )) + .2;float hashes = xhsh;if (uStep > 4.) {if (upprtp.x == 1.) {hashes = xhsh * yhsh;}if (upprtp.y == 0.) {c = bldmt(c, vec3(hashes), -.5 * (1.3-length(c)));}else {c = bldovl(c, vec3(hashes), 0.2 * (1.3-length(clamp(c,0., 1.))));}}float scratchPertub = noise(vec3(( (vUv+uptuvtrlt) * vec2(uwrsz.x, uwrsz.y * pertub * 10.) + vec2(-.5)), 0.)) * 3.;float yscratchPertub = noise(vec3(( (vUv+uptuvtrlt) * vec2(uwrsz.z, uwrsz.w * pertub * 1.) + vec2(-.5)), 0.)) * 3.;float xscrch = smoothstep(.5, .7, scratchPertub);float yscrch = smoothstep(.5, .7, yscratchPertub);float scrch = ( xscrch * yscrch);if (uStep > 14.) {c = bldovl(c, vec3(scrch), uscrch.x );}vec2 dvslnuv = rotate(vUv, urt * sin(vUv.y * unblns.x * urtfq + uptuvtrlt.x), vec2(.5));dvslnuv.x = mix(vUv.x, dvslnuv.x, 0.1);float yclluvy = dvslnuv.y + sin(dvslnuv.x * 30. + curl.r * 4.) * .001 * curl.r;float xcllbrd = ( fract( yclluvy + v ) * nbStripes) / nbStripes;xcllbrd = fract( xcllbrd * nbStripes );float xcllbrdfsst = fm1((dvslnuv+uptuvtrlt)*30.) * 2.;xcllbrd = smoothstep(.0, (ucllbrdsz * .65) * xcllbrdfsst, xcllbrd);if (frmy == 0.) {xcllbrd = 1.;}float yclluvx = dvslnuv.x + sin(dvslnuv.y * 20. + curl.r * 4.) * .0025 * curl.r;float ycllbrd = ( fract( yclluvx + v ) * nbStripes) / nbStripes;ycllbrd = fract( ycllbrd * nbStripes );float ycllbrdfsst = fm1((dvslnuv+uptuvtrlt)*30.) * 2.;ycllbrd = smoothstep(.0, ucllbrdsz * ycllbrdfsst, ycllbrd);if (frmx == 0.) {ycllbrd = 1.;}float cllbrd = xcllbrd * ycllbrd;if (unblns.x > 1. && uStep > 5.) {c = bldmt(c, vec3(cllbrd), -1.9 * (1.-length(c)));}float cllgdtinst = .12 + simplex * .05;float xcllgdt = smoothstep(0., cllgdtinst, cellUv.x) - smoothstep(1.-cllgdtinst, 1., cellUv.x) ;float ycllgdt = smoothstep(0., cllgdtinst, cellUv.y) - smoothstep(1.-cllgdtinst, 1., cellUv.y) ;float cllgdt = xcllgdt * ycllgdt * frm;if(cellId.x < clltsh) {c = bldmt(c, vec3(cllgdt), -.2 * (1.-length(c)) * frm);} vec3 cDark = texture2D(tDarkInput, wrapuv).rgb;float cDarkMask = 1.-step(cDark.r, 0.);cDark = strtn(cDark, -1.);float clatt = noise( vec3(vUv * uclattscl , 1.) );if (uStep > 7.) {c = bldsftlgt(c, vec3(clatt), .5);}float maskMixer = length(c);vec3 mask = mix(vec3(1.0, 0., 0.), vec3(0., 1., 0.), maskMixer);vec3 ppr = bgColor;float ydistrt = sn3d( vec3( vUv * vec2(100., 100.), 0. ));float pprnseyscl = map(ydistrt, -1., 1., 3., 6.);float pprnse = sn3d( vec3(vUv * vec2(200., 50.) * pprnseyscl, 0.));ppr = bgColor * .9;if (uStep > 10.) {ppr = bldovl( bgColor, vec3(1.-pprnse), .2 );}if (uStep > 16.) {ppr = bldmt( ppr, vec3(stains), .025 );}c = bldmt(c, ppr, 1.);if (ungt.x == 0.) {c = mix(c, ppr, mask.r);}float drtcld = fm1(vUv*10.);float att = noise(vec3((vUv*7.)+c.rb*2.+uppruvfsst, 1.));att = clamp(att, 0., 1.);if (uStep > 8.) {c = bldscn(c, cnoise, 1.);}if (uStep > 17.) {float attInt = .02;if (usqss.x == 1.) {attInt = .003;}c = bldmt(c, vec3(att), attInt);}if (uStep > 8.) {c = bldovl(c, vec3(drtcld), .2);c = clamp(c, 0., 1.);}if (udkn == 1.) {c = strtn(c, -1. * cDarkMask * frm);vec3 cntrstedC = cntrst(c, .997);c = mix( c, cntrstedC, cDarkMask) ;c = bldovl(c, c*4., udkint*cDarkMask*frm);}float cloud = fm1(vUv*50.);float clcld = fm1(vUv*1.+uclddgrtrlt);if (uStep > 8.) {c = bldovl(c, vec3(clcld), .2);}float squsse = 0.;for (int i = 0; i < 10; i++ ) {float idx = float(i);float rnd = map( random( vec2(idx) ), 0., 1., -1.1, 1.1 );squsse = edge(tContourInput, wrapuv + vec2(rnd, 0.) + vec2(simplex2) * .1 + rnd , vec2(ures.x, ures.y) * .1 );squsse = max(0., min(squsse, .2 + abs(rnd)));c = bldovl(c, vec3(1.), squsse * ufzzstkint * float(i) * .1);}squsse = clamp(squsse, 0., 1.);vec4 cbse = ucbse;vec4 cbse2 = vec4(cbse.x, cbse.y, -.5, cbse.w);vec3 c0 = applycbse(c, cbse);vec3 c1 = applycbse(c, cbse2);float lutMixer = 0.;if (usqss.x == 1.) {lutMixer = cntrdge;}c = mix(c0, c1, lutMixer);if (unblns.x == 1. && cellId.y < clltsh) {c = bldovl(c, vec3(-1.0), cntrdge * .2);}float dirt = 1.;for (int i = 0; i < nbdrts; i++) {vec2 coords = vUv - vec2(.5);coords = scale(coords, vec2(uDirts[i].x, uDirts[i].y), vec2(.5));coords += uptuvtrlt;float d = gtdt(coords*udtintfq[i].y, vec2(uDirts[i].z, uDirts[i].w));dirt = bldmt(vec3(dirt), vec3(d), udtintfq[i].x).r;}if (uStep > 15.) {c = bldscn(c, vec3(1.-dirt), udtbld);}if (upidx == 6.) {vec3 woffset = vec3(0.);float key = chrky( c, vec3(133., 106., 30.) / 255., woffset );c = mix(c, vec3(175.,179.,193.) / 255., key * frm * fllcll * (1.-cmask));}if (usqss.y == 1.) {c *= ubg.rgb;}gl_FragColor = vec4(c, 1.);}",Ht=`uniform sampler2D tInput;uniform vec2 uflp;uniform vec2 ungt;uniform float uStep;varying vec2 vUv;vec3 brhtnss(vec3 color, float value) {return color + value;}vec2 rotate(vec2 uv, float rotation){float mid = 0.5;return vec2(cos(rotation) * (uv.x - mid) + sin(rotation) * (uv.y - mid) + mid,cos(rotation) * (uv.y - mid) - sin(rotation) * (uv.x - mid) + mid);}vec2 rotate(vec2 uv, float rotation, vec2 mid){return vec2(cos(rotation) * (uv.x - mid.x) + sin(rotation) * (uv.y - mid.y) + mid.x,cos(rotation) * (uv.y - mid.y) - sin(rotation) * (uv.x - mid.x) + mid.y);}vec2
dlmt.x,e.artgrdlmt.y)}},vertexShader:W,fragmentShader:G})},Qe=()=>{let a=b.filter(_=>_.d!==void 0);a=a.length?a[0]:{c:"#ffffff",i:0,d:0};const E=re(a.c),q=te(E.h,E.s,E.l);S=new THREE.ShaderMaterial({defines:{nbshp:M},uniforms:{ures:{value:new THREE.Vector2(e.width,e.height)},uskptsh:{value:e.skipThreshold},ushp:{value:l},ushpcl:{value:s},udkncl:{value:new THREE.Vector4(q.r/255,q.g/255,q.b/255,a.i)}},vertexShader:W,fragmentShader:Ee}),e.darken=a.d,e.darkenColor=a.dc||"#555555"},et=()=>{k=new THREE.Scene,R=new THREE.PerspectiveCamera(45,e.width/e.height,.01,100),Qe(),Ze(),Ke(),Je(),C=new THREE.PlaneBufferGeometry(2,2),P=new THREE.Mesh(C,v),k.add(P)},tt=a=>{S.uniforms.uskptsh.value=e.skipThreshold,a.setRenderTarget(u),P.material=S,a.render(k,R)},rt=a=>{v.uniforms.ugrdlmt.value.x=e.artgrdlmt.x,v.uniforms.ugrdlmt.value.y=e.artgrdlmt.y,v.uniforms.ucntr.value.x=0,v.uniforms.uRenderRot.value=0,v.uniforms.uskptsh.value=e.skipThreshold,v.uniforms.uStep.value=e.step,a.setRenderTarget(c[0]),P.material=v,a.render(k,R),v.uniforms.ugrdlmt.value.x=1,v.uniforms.ugrdlmt.value.y=1,a.setRenderTarget(c[5]),a.render(k,R),v.uniforms.uRenderRot.value=1,a.setRenderTarget(c[4]),a.render(k,R)},lt=a=>{a.setRenderTarget(c[2]),P.material=T,a.render(k,R),a.setRenderTarget(null)},ct=a=>{v.uniforms.uRenderRot.value=0,v.uniforms.ucntr.value.x=1,a.setRenderTarget(c[1]),P.material=v,a.render(k,R)},st=a=>{A.uniforms.ucntr.value=0,P.material=A,a.setRenderTarget(c[3]),a.render(k,R)},nt=a=>{rt(a),lt(a),tt(a),ct(a),st(a),a.setRenderTarget(null)},ot=()=>c[0].texture,at=()=>c[5].texture,it=()=>c[1].texture,ut=()=>u.texture,vt=()=>c[2].texture,ft=()=>c[3].texture,dt=()=>c[4].texture;return $(),Y(),et(),{getContourTexture:it,getColorTexture:ot,getColorTextureNoG:at,getColorSelectionTexture:ut,gtdtColorTexture:vt,getWrapTexture:ft,getRotationTexture:dt,render:nt}};var Vt=`#define PI 3.14159\nuniform sampler2D tInput;uniform vec3 uffst;varying vec2 vUv;vec2 rotate(vec2 uv, float rotation){float mid = 0.5;return vec2(cos(rotation) * (uv.x - mid) + sin(rotation) * (uv.y - mid) + mid,cos(rotation) * (uv.y - mid) - sin(rotation) * (uv.x - mid) + mid);}vec2 rotate(vec2 uv, float rotation, vec2 mid){return vec2(cos(rotation) * (uv.x - mid.x) + sin(rotation) * (uv.y - mid.y) + mid.x,cos(rotation) * (uv.y - mid.y) - sin(rotation) * (uv.x - mid.x) + mid.y);}vec2 rotate(vec2 uv, float rotation, float mid){return vec2(cos(rotation) * (uv.x - mid) + sin(rotation) * (uv.y - mid) + mid,cos(rotation) * (uv.y - mid) - sin(rotation) * (uv.x - mid) + mid);}vec2 scale(vec2 uv, float scale, vec2 origin) {return (uv - origin) * scale + origin;}vec2 scale(vec2 uv, vec2 scale, vec2 origin) {return (uv - origin) * scale + origin;}\${noisecommon}\${snoise}vec3 gtpclstk2(vec2 res, float offset) {vec2 pencilstkuv = scale(vUv, res, vec2(1.5, .0));float pclstkPertub = sn3d(vec3(pencilstkuv, offset));vec2 pencilStrokeUv = vUv + vec2(pclstkPertub) * .2;vec3 c = texture2D(tInput, pencilStrokeUv).rgb * 10.;return c;}void main() {vec3 c = gtpclstk2(vec2(.1, 10.), 0.);c += gtpclstk2(vec2(.1, 50.), 0.) * .3;c = clamp(c, 0., 1.);gl_FragColor = vec4(c, 1.);}`;let le=Vt;le=le.replace("${noisecommon}",Se);le=le.replace("${snoise}",we);const $t=c=>{let l=c,s=null,o,n,t,i,u=null;const p=()=>{const C=4096;s=new THREE.WebGLRenderTarget(C,C,{minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter}),s.texture.wrapS=THREE.MirroredRepeatWrapping,s.texture.wrapT=THREE.MirroredRepeatWrapping},b=()=>{o=new THREE.Scene,n=new THREE.PerspectiveCamera(45,e.width/e.height,.01,100),i=new THREE.ShaderMaterial({uniforms:{tInput:{value:l},uffst:{value:new THREE.Vector4(e.curl.pos.x,e.curl.pos.y,e.curl.scl.x,e.curl.scl.y)}},vertexShader:W,fragmentShader:le}),t=new THREE.PlaneBufferGeometry(2,2),u=new THREE.Mesh(t,i),o.add(u)},k=()=>s.texture,R=C=>{C.setRenderTarget(s),C.render(o,n),C.setRenderTarget(null)};return p(),b(),{getColorTexture:k,render:R}};var qt="#define PI 3.14159\nuniform vec2 ures;uniform sampler2D tInput;uniform sampler2D tWrapInput;uniform sampler2D tDirtInput;uniform sampler2D tContourInput;uniform sampler2D tStrokesInput;uniform sampler2D tDarkInput;uniform sampler2D tRotationInput;uniform vec4 ubg;uniform vec4 ucbse;uniform vec4 uartcbse;uniform float uarthsft;uniform float urnd;uniform float uptscl;uniform float uptuvscl;uniform vec2 uptuvtrlt;uniform float uclattscl;uniform vec2 uclddgrtrlt;uniform float ugrnscl;uniform vec2 unblns;uniform vec4 ucrl; uniform vec2 ucrlwrp;uniform float ucrlscl;uniform vec2 ucllff;uniform vec2 upprtp;uniform vec2 uscrch;uniform vec4 uwrsz;uniform float uglrt;uniform vec2 ufllcll;uniform vec4 ufrmprm;uniform vec2 ungt;uniform float udtbld;uniform vec4 uDirts[nbdrts];uniform vec2 udtintfq[nbdrts];uniform float ucllbrdsz;uniform float upclskint;uniform float unseclint;uniform float uogclint;uniform float uhstkint;uniform float ufzzstkint;uniform float udkint;uniform vec3 uswl;uniform vec2 uppruvfsst;uniform float uDebug;uniform float udkn;uniform vec3 udkncl;uniform vec2 usqss;uniform float urt;uniform float urtfq;uniform vec3 ucntr;uniform float uedgwdh;uniform float upidx;uniform float uStep;varying vec2 vUv;\nvec2 rotate(vec2 uv, float rotation){float mid = 0.5;return vec2(cos(rotation) * (uv.x - mid) + sin(rotation) * (uv.y - mid) + mid,cos(rotation) * (uv.y - mid) - sin(rotation) * (uv.x - mid) + mid);}vec2 rotate(vec2 uv, float rotation, vec2 mid){return vec2(cos(rotation) * (uv.x - mid.x) + sin(rotation) * (uv.y - mid.y) + mid.x,cos(rotation) * (uv.y - mid.y) - sin(rotation) * (uv.x - mid.x) + mid.y);}vec2 rotate(vec2 uv, float rotation, float mid){return vec2(cos(rotation) * (uv.x - mid) + sin(rotation) * (uv.y - mid) + mid,cos(rotation) * (uv.y - mid) - sin(rotation) * (uv.x - mid) + mid);}vec2 scale(vec2 uv, float scale, vec2 origin) {return (uv - origin) * scale + origin;}vec2 scale(vec2 uv, vec2 scale, vec2 origin) {return (uv - origin) * scale + origin;}\nfloat map(float value, float min1, float max1, float min2, float max2) {\n return min2 + (value - min1) * (max2 - min2) / (max1 - min1);\n}\n${fm}${edge}${noisecommon}${pnoise}${snoise}${grain}${noise}${curl}${adjust}${blend}\nfloat rnduv(vec2 uv){float seed = uv.y * 100000.;float r = abs(tan(sin(uv.y * seed) * seed));return sqrt(1. - r) * 2. - 1.;}vec3 gtgrn() {float grainPertub = noise(vec3(vUv * vec2(4., 80.), 0.));grainPertub /= noise(vec3(vUv * vec2(40., 8.), 0.));vec3 cnoise = vec3(grain(vUv, vec2(2100., 2800.) * ugrnscl + grainPertub*.3));return cnoise;}float gtstns(vec2 offset) {float stains = 1. - vec3(grain(vUv + vec2(offset), vec2(2100., 2800.) * .0025)).r;float stainsEdges = 0.1;float stainsThreshold = .7;stains = smoothstep(stainsThreshold + stainsEdges, stainsThreshold - stainsEdges, stains);stains = clamp(stains, 0., 1.);return stains;}vec3 gtnsycl(float offset) {float scly = 1000.;if (ungt.x == 1.) scly = 100000.;vec2 tinywrapUV = scale(vUv, vec2(50., scly) + vec2(0., urnd * 500.), vec2(0.5));float tinywrap = noise(vec3(tinywrapUV, offset));vec2 tinyuv = vUv * vec2(tinywrap);vec3 nsycl = texture2D(tInput, tinyuv).rgb;return nsycl;}vec3 gtpclstk(float offset) {vec2 pencilstkuv = vUv + vec2(0., urnd);pencilstkuv = scale(pencilstkuv, vec2(5., 1000.), vec2(.5));vec3 curl = crlnse(vec3( (vUv*ucrl.z*1.1)+vec2(ucrl.y, ucrl.x), 0.));pencilstkuv = rotate(pencilstkuv, curl.r * .5);float pclstkPertub = noise(vec3(pencilstkuv, offset));vec2 pencilStrokeUv = vUv + vec2(pclstkPertub) * .2;vec3 c = texture2D(tInput, pencilStrokeUv).rgb * 10.;return c;}vec3 applycbse(vec3 c, vec4 cbse) {c = cntrst(c, cbse.r);c = brhtnss(c, cbse.g);c = strtn(c, cbse.b);c = xpsr(c, cbse.a);return c;}float gtdt(vec2 coords, vec2 levels) {float dirt = fm1(coords);dirt = max(levels.x, min(dirt, levels.y));dirt = map(dirt, levels.x, levels.y, 0., 1.);return dirt;}vec3 rgb2hsv(vec3 rgb){float Cmax = max(rgb.r, max(rgb.g, rgb.b));float Cmin = min(rgb.r, min(rgb.g, rgb.b));float delta = Cmax - Cmin;vec3 hsv = vec3(0., 0., Cmax);if (Cmax > Cmin){hsv.y = delta / Cmax;if (rgb.r == Cmax) {hsv.x = (rgb.g - rgb.b) / delta;}else{if (rgb.g == Cmax) {hsv.x = 2. + (rgb.b - rgb.r) / delta;}else {hsv.x = 4. + (rgb.r - rgb.g) / delta;}}hsv.x = fract(hsv.x / 6.);}return hsv;}float chrky(vec3 color, vec3 bgcolor, vec3 weightsOffset){vec3 backgroundColor = bgcolor;vec3 weights = vec3(4., 1., 2.) + weightsOffset;vec3 hsv = rgb2hsv(color);vec3 target = rgb2hsv(backgroundColor);float dist = length(weights * (target - hsv));return 1. - clamp(3. * dist - 1.5, 0., 1.);}\nvoid main() {float ratio = ures.x/ures.y;vec3 c = texture2D(tInput, vUv).rgb;vec3 oc = c;vec3 dirtc = texture2D(tDirtInput, vUv).rgb;vec3 cnoise = gtgrn();float stains = gtstns(c.rg);vec3 bgColor = ubg.rgb * ubg.a;float pertub = noise(vec3((vUv*uptuvscl * .3)+uptuvtrlt, 0.)) ;pertub += sn3d(vec3( (vUv* 6.7)+uptuvtrlt, 0.) ) * 0.01;float simplex = sn3d( vec3( (vUv*uptuvscl * 10.7)+uptuvtrlt, 0. ) );float simplex2 = sn3d( vec3( (vUv*uptuvscl * 1.7)+uptuvtrlt, 0. ) );vec3 curl = crlnse(vec3( (vUv*vec2(1., 1./ratio)*ucrl.z*ucrlscl)+vec2(ucrl.x, ucrl.y), 0.));vec3 dirtc2 = texture2D(tDirtInput, vUv + vec2(simplex*.005)).rgb;dirtc2 *= fm1(vUv*20.+uptuvtrlt);float m = mod(vUv.y * 3., .025);m = step(m, .01);if (u
iplier) {vec2 mult = texCoord * resolution;float offset = sn3d(vec3(mult / multiplier, frame));float n1 = pnoise3d(vec3(mult, offset), vec3(1.0/texCoord * resolution, 1.0));return n1 / 2.0 + 0.5;}float grain(vec2 texCoord, vec2 resolution, float frame) {return grain(texCoord, resolution, frame, 2.5);}float grain(vec2 texCoord, vec2 resolution) {return grain(texCoord, resolution, 0.0);}",Le="vec4 perm(vec4 x){return mod289(((x * 34.0) + 1.0) * x);}float noise(vec3 p){vec3 a = floor(p);vec3 d = p - a;d = d * d * (3.0 - 2.0 * d);vec4 b = a.xxyy + vec4(0.0, 1.0, 0.0, 1.0);vec4 k1 = perm(b.xyxy);vec4 k2 = perm(k1.xyxy + b.zzww);vec4 c = k2 + a.zzzz;vec4 k3 = perm(c);vec4 k4 = perm(c + 1.0);vec4 o1 = fract(k3 * (1.0 / 41.0));vec4 o2 = fract(k4 * (1.0 / 41.0));vec4 o3 = o2 * d.z + o1 * (1.0 - d.z);vec2 o4 = o3.yw * d.x + o3.xz * (1.0 - d.x);return o4.y * d.y + o4.x * (1.0 - d.y);}",Ne=`#define OCTAVES 6\nfloat random(vec2 co){highp float a = 12.9898;highp float b = 78.233;highp float c = 43758.5453;highp float dt= dot(co.xy ,vec2(a,b));highp float sn= mod(dt,3.14);return fract(sin(sn) * c);}float noise (in vec2 st) {vec2 i = floor(st);vec2 f = fract(st);float a = random(i);float b = random(i + vec2(1.0, 0.0));float c = random(i + vec2(0.0, 1.0));float d = random(i + vec2(1.0, 1.0));vec2 u = f * f * (3.0 - 2.0 * f);return mix(a, b, u.x) +(c - a)* u.y * (1.0 - u.x) +(d - b) * u.x * u.y;}float fm1 (in vec2 st) {float value = 0.0;float amplitude = .5;float frequency = 0.;for (int i = 0; i < OCTAVES; i++) {value += amplitude * noise(st);st *= 2.;amplitude *= .5;}return value;}`,ke="vec3 bldav(vec3 base, vec3 blend) {return (base+blend)/2.0;}vec3 bldav(vec3 base, vec3 blend, float opacity) {return (bldav(base, blend) * opacity + base * (1.0 - opacity));}float blendColorBurn(float base, float blend) {return (blend==0.0)?blend:max((1.0-((1.0-base)/blend)),0.0);}vec3 blendColorBurn(vec3 base, vec3 blend) {return vec3(blendColorBurn(base.r,blend.r),blendColorBurn(base.g,blend.g),blendColorBurn(base.b,blend.b));}vec3 blendColorBurn(vec3 base, vec3 blend, float opacity) {return (blendColorBurn(base, blend) * opacity + base * (1.0 - opacity));}float bldovl(float base, float blend) {return base<0.5?(2.0*base*blend):(1.0-2.0*(1.0-base)*(1.0-blend));}vec3 bldovl(vec3 base, vec3 blend) {return vec3(bldovl(base.r,blend.r),bldovl(base.g,blend.g),bldovl(base.b,blend.b));}vec3 bldovl(vec3 base, vec3 blend, float opacity) {return (bldovl(base, blend) * opacity + base * (1.0 - opacity));}vec3 bldmt(vec3 base, vec3 blend) {return base*blend;}vec3 bldmt(vec3 base, vec3 blend, float opacity) {return (bldmt(base, blend) * opacity + base * (1.0 - opacity));}float bldscn(float base, float blend) {return 1.0-((1.0-base)*(1.0-blend));}vec3 bldscn(vec3 base, vec3 blend) {return vec3(bldscn(base.r,blend.r),bldscn(base.g,blend.g),bldscn(base.b,blend.b));}vec3 bldscn(vec3 base, vec3 blend, float opacity) {return (bldscn(base, blend) * opacity + base * (1.0 - opacity));}float bldsftlgt(float base, float blend) {return (blend<0.5)?(2.0*base*blend+base*base*(1.0-2.0*blend)):(sqrt(base)*(2.0*blend-1.0)+2.0*base*(1.0-blend));}vec3 bldsftlgt(vec3 base, vec3 blend) {return vec3(bldsftlgt(base.r,blend.r),bldsftlgt(base.g,blend.g),bldsftlgt(base.b,blend.b));}vec3 bldsftlgt(vec3 base, vec3 blend, float opacity) {return (bldsftlgt(base, blend) * opacity + base * (1.0 - opacity));}float blendLighten(float base, float blend) {return max(blend,base);}vec3 blendLighten(vec3 base, vec3 blend) {return vec3(blendLighten(base.r,blend.r),blendLighten(base.g,blend.g),blendLighten(base.b,blend.b));}vec3 blendLighten(vec3 base, vec3 blend, float opacity) {return (blendLighten(base, blend) * opacity + base * (1.0 - opacity));}",Se="vec2 mod289(vec2 x) {return x - floor(x * (1.0 / 289.0)) * 289.0;}vec3 mod289(vec3 x) {return x - floor(x * (1.0 / 289.0)) * 289.0;}vec4 mod289(vec4 x) {return x - floor(x * (1.0 / 289.0)) * 289.0;}vec3 permute(vec3 x) {return mod289(((x*34.0)+1.0)*x);}vec4 permute(vec4 x) {return mod289(((x*34.0)+1.0)*x);}vec4 taylorInvSqrt(vec4 r){return 1.79284291400159 - 0.85373472095314 * r;}",Oe="float threshold(in float thr1, in float thr2 , in float val) {if (val < thr1) {return 0.0;}if (val > thr2) {return 1.0;}return val;}float diff(in vec4 pix1, in vec4 pix2) {return (abs(pix1.r - pix2.r) +abs(pix1.g - pix2.g) +abs(pix1.b - pix2.b)) / 3.0;}float edge(in sampler2D tex, in vec2 coords, in vec2 renderSize){float dx = 1.0 / renderSize.x;float dy = 1.0 / renderSize.y;vec4 pix[9];pix[0] = texture2D(tex, coords + vec2( -1.0 * dx, -1.0 * dy));pix[1] = texture2D(tex, coords + vec2( -1.0 * dx , 0.0 * dy));pix[2] = texture2D(tex, coords + vec2( -1.0 * dx , 1.0 * dy));pix[3] = texture2D(tex, coords + vec2( 0.0 * dx , -1.0 * dy));pix[4] = texture2D(tex, coords + vec2( 0.0 * dx , 0.0 * dy));pix[5] = texture2D(tex, coords + vec2( 0.0 * dx , 1.0 * dy));pix[6] = texture2D(tex, coords + vec2( 1.0 * dx , -1.0 * dy));pix[7] = texture2D(tex, coords + vec2( 1.0 * dx , 0.0 * dy));pix[8] = texture2D(tex, coords + vec2( 1.0 * dx , 1.0 * dy));float delta = (diff(pix[1],pix[7])+diff(pix[5],pix[3]) +diff(pix[0],pix[8])+diff(pix[2],pix[6]))/4.;return threshold(0.25,.4,clamp(3.0*delta,0.0,1.0));}",Xe="vec3 brhtnss(vec3 color, float value) {return color + value;}vec3 cntrst(vec3 color, float value) {return 0.5 + value * (color - 0.5);}vec3 xpsr(vec3 color, float value) {return (1.0 + value) * color;}vec3 hsft(vec3 color, float hue) {const vec3 k = vec3(0.57735, 0.57735, 0.57735);float cosAngle = cos(hue);return vec3(color * cosAngle + cross(k, color) * sin(hue) + k * dot(k, color) * (1.0 - cosAngle));}vec3 strtn(vec3 color, float value) {const vec3 luminosityFactor = vec3(0.2126, 0.7152, 0.0722);vec3 grayscale = vec3(dot(color, luminosityFactor));return mix(grayscale, color, 1.0 + value);}",U=e.form;let x=Fe;x=x.replace("#crlchnk1",U.crlchnk1);x=x.replace("#crlchnks",U.crlchnks);x=x.replace("#crlchnks1",U.crlchnks1);x=x.replace("#crlchnks2",U.crlchnks2);x=x.replace("#crlchnk2",U.crlchnk2);x=x.replace("#crlbse",U.crlbse);x=x.replace("#curlExp0",U.crlxps[0]);x=x.replace("#curlExp1",U.crlxps[1]);x=x.replace("#curlExp2",U.crlxps[2]);let m=Pt;m=m.replace("${curl}",x);m=m.replace("${noisecommon}",Se);m=m.replace("${pnoise}",We);m=m.replace("${snoise}",we);m=m.replace("${grain}",Ae);m=m.replace("${noise}",Le);m=m.replace("${fm}",Ne);m=m.replace("${edge}",Oe);m=m.replace("${rtfmla}",U.rtfmla);m=m.replace("${rtaddfmla}",U.rtaddfmla);m=m.replace("${rtswlfmla}",U.rtswlfmla);m=m.replace("${wrapx}",U.wrapx);let G=Ct;G=G.replace("${blend}",ke);G=G.replace("${adjust}",Xe);let Ee=_t;Ee=Ee.replace("${blend}",ke);const M=e.nbShapes,Dt=()=>{const c=[],l=[],s=[],o=[],n=[],t=[],i=[];let u=null;const p=[],b=e.palette;for(let a=0;a<b.length;a++){b[a].f&&r.random()>.5&&(b[a].c="#000000");const E=b[a],q=E.c,_=re(q),ce=te(_.h,_.s,_.l);let j=E.i||.2;p.push({c:ce,i:j})}let k,R,C,v,S,T,A,P=null;const Y=()=>{const a=e.width,E=e.height/2,q=e.artdens;for(let _=0;_<M;_++){let ce=r.random()<.7?.1:.08;ce+=r.random()*.1;let j=e.width*ce,se=.01425313569*e.height,pt=.01425313569*e.height,J=a*(Math.floor(r.random()*q)/q),K=E;{J+=r.random()>.7?r.random()*a*.05:0;const ht=e.artdens==10?0:.6;K+=r.random()>ht?r.range(-1,1)*se*.125:0}_>20&&(e.strongStrokes||(se*=.1),J=r.random()*a,(e.strongStrokes||e.density>6)&&(K=r.random()*E));const ne=_%b.length,ze=p[ne],L=ze.c;let Ue=ze.i;const mt=r.random()*Math.PI*2;t[ne]||(t[ne]=[]),t[ne].push(J/e.width,K/e.height,j/e.width,se/e.height),l.push(J/e.width,K/e.height,j/e.width,se/e.height),o.push(J/e.width,K/e.height,j/e.width,pt/e.height),s.push(L.r/255,L.g/255,L.b/255,Ue),n.push(L.r/255,L.g/255,L.b/255,Ue),i.push(mt)}},$=()=>{for(let a=0;a<6;a++){const E=ye();c.push(E)}c[5].setSize(64,64),c[4].setSize(64,64),u=ye()},Je=()=>{let a=b.filter(E=>E.sh!==void 0);a.length?a=a[0].sh:a=0,v=new THREE.ShaderMaterial({defines:{nbshp:M,nbshprot:M==400?M:2},uniforms:{ures:{value:new THREE.Vector2(e.width,e.height)},ucntr:{value:new THREE.Vector2(0,e.contourWidth)},uskptsh:{value:e.skipThreshold},uhgtml:{value:2},ushp:{value:l},ushpcl:{value:s},uRotations:{value:i},uStep:{value:e.step},ugrdlmt:{value:new THREE.Vector2(e.artgrdlmt.x,e.artgrdlmt.y)},uRenderRot:{value:0},uShift:{value:a}},vertexShader:W,fragmentShader:G})},Ke=()=>{A=new THREE.ShaderMaterial({uniforms:{ures:{value:new THREE.Vector2(e.width,e.height)},tInput:{value:c[0].texture},tContourInput:{value:c[1].texture},uptuvtrlt:{value:new THREE.Vector2(e.pertubUVTranslateX,e.pertubUVTranslateY)},unblns:{value:new THREE.Vector2(e.nbLinesX,e.nbLinesY)},ucrl:{value:new THREE.Vector4(e.curl.pos.x,e.curl.pos.y,e.curl.scl.x,e.curl.scl.y)},ucrlscl:{value:e.form.crlsck2},uswl:{value:new THREE.Vector3(e.swl[0],e.swl[1],e.swl[2])},ucrlwrp:{value:new THREE.Vector2(e.curl.wrap.x,e.curl.wrap.y)},ucllff:{value:new THREE.Vector2(e.ucllff.x,e.ucllff.y)},ucntr:{value:0}},vertexShader:W,fragmentShader:m})},Ze=()=>{T=new THREE.ShaderMaterial({defines:{nbshp:M,nbshprot:M==400?M:2},uniforms:{ures:{value:new THREE.Vector2(e.width,e.height)},uskptsh:{value:e.skipThreshold},uhgtml:{value:2},ushp:{value:o},ushpcl:{value:n},ucntr:{value:new THREE.Vector2(0,0)},ugrdlmt:{value:new THREE.Vector2(e.artgr
t.y);vec3 color180 = hsft(color, uShift);color = mix(color, color180, mapper);vec3 colorStripes = hsft(color, -.5);colorStripes = brhtnss(colorStripes, .5);if (uRenderRot == 1.) {color = vec3(uRotations[i]);}float rect = drwrct(vUv, vec2(w, h), vec2(x, y ));vec2 coord = vUv * vec2(1., 1./ratio);coord -= vec2(x, y/ratio);float contourWidth = ucntr.y;float innerWidth = w*0.01*contourWidth;float innerHeight = h*0.08*contourWidth;float inner = drwrct(vUv, vec2(w-innerWidth, h-innerHeight), vec2(x+innerWidth*.5, y+innerHeight*.5 ));if (ucntr.x == 1.) {rect -= inner;}if (length(rects) == 0.) {rects = blendLighten( rects, color, rect * opacity );rects = clamp(rects, 0., 1.);}if (length(rects) > uskptsh) {rects = vec3(0.);}}vec3 c = vec3(rects);gl_FragColor = vec4(c, 1.);}`,Pt="#define PI 3.14159\nuniform sampler2D tInput;uniform sampler2D tContourInput;uniform vec2 ures;uniform vec2 uptuvtrlt;uniform vec2 unblns;uniform vec2 ucllff;uniform vec4 ucrl; uniform float ucrlscl;uniform vec2 ucrlwrp;uniform vec3 uswl;uniform float ucntr;varying vec2 vUv;\nvec2 rotate(vec2 uv, float rotation){float mid = 0.5;return vec2(cos(rotation) * (uv.x - mid) + sin(rotation) * (uv.y - mid) + mid,cos(rotation) * (uv.y - mid) - sin(rotation) * (uv.x - mid) + mid);}vec2 rotate(vec2 uv, float rotation, vec2 mid){return vec2(cos(rotation) * (uv.x - mid.x) + sin(rotation) * (uv.y - mid.y) + mid.x,cos(rotation) * (uv.y - mid.y) - sin(rotation) * (uv.x - mid.x) + mid.y);}vec2 rotate(vec2 uv, float rotation, float mid){return vec2(cos(rotation) * (uv.x - mid) + sin(rotation) * (uv.y - mid) + mid,cos(rotation) * (uv.y - mid) - sin(rotation) * (uv.x - mid) + mid);}vec2 scale(vec2 uv, float scale, vec2 origin) {return (uv - origin) * scale + origin;}vec2 scale(vec2 uv, vec2 scale, vec2 origin) {return (uv - origin) * scale + origin;}\n${fm}${edge}${noisecommon}${pnoise}${snoise}${grain}${noise}${curl}\nfloat rnduv(vec2 uv){float seed = uv.y * 100000.;float r = abs(tan(sin(uv.y * seed) * seed));return sqrt(1. - r) * 2. - 1.;}void main() {float ratio = ures.x / ures.y;float uptscl = 1.;float uptuvscl = 1.;vec2 wrapuv = vec2(vUv.x, vUv.y) * -10.;float pertub = noise(vec3((vUv*uptuvscl * .3)+uptuvtrlt, 0.)) ;pertub += sn3d(vec3( (vUv* 6.7)+uptuvtrlt, 0.) ) * 0.01;vec3 curl = crlnse(vec3( (vUv*vec2(1., 1./ratio)*ucrl.z*ucrlscl)+vec2(ucrl.x, ucrl.y), 0.)) * uptscl;float nbStripes = unblns.x;vec2 cellId = floor( (mod(vUv, 1.))*nbStripes)/nbStripes;cellId += vec2(random(vec2(cellId.x+cellId.y+ucllff.x)));cellId = mod(cellId, 1.);vec2 cellUv = mod(vUv, vec2(1./nbStripes)) * nbStripes;float v = rnduv(floor(vUv * 1.));float stripes = floor(( fract( vUv.y + v ) *nbStripes))/nbStripes;stripes *= floor(vUv.y *nbStripes)/nbStripes*1000.;float offset = 0.;offset += pertub * .5;float xstripes = floor(( fract( vUv.x + v ) *nbStripes))/nbStripes;stripes *= xstripes;wrapuv.x *= offset * .2;wrapuv.x += offset * 30.;wrapuv.x += stripes * 10.5;wrapuv.x += stripes - noise(vec3(stripes*100.)) - 1.;float rot = 0.;float direction = curl.r < -1. ? 1. : -1.;rot = ${rtfmla};rot += ${rtaddfmla};float ffctrd = 1.;float ffcagl = 2. * PI;vec2 swlCenter = uswl.xy;vec2 swlUv = vUv * 1. - swlCenter;float dstctr = distance(vUv, swlCenter) - .1;dstctr = clamp(dstctr, 0., 1.);float len = uswl.z + length(swlUv * vec2(ratio, 1.));float angle = atan(swlUv.y, swlUv.x) + ffcagl * smoothstep(ffctrd, 0., len);${rtswlfmla}; vec2 centeredUV = rotate(vUv, rot, vec2(0.));wrapuv.x += ${wrapx};wrapuv = scale(wrapuv, vec2(.2, 1.), vec2(0.));vec3 c = texture2D(tInput, wrapuv).rgb;if (ucntr == 1.) {float edge = edge(tContourInput, wrapuv, vec2(ures.x, ures.y) * .1);c = vec3(edge);}gl_FragColor = vec4(c, 1.);}",_t=`uniform vec2 ures;uniform vec4 ushp[nbshp];uniform vec4 ushpcl[nbshp];uniform vec4 udkncl;varying vec2 vUv;float map(float value, float min1, float max1, float min2, float max2) {return min2 + (value - min1) * (max2 - min2) / (max1 - min1);}\${blend}float drwrct(vec2 coord, vec2 dimensions, vec2 offset) {vec2 rct = step(offset, coord);rct *= step(coord, offset + dimensions);return rct.x * rct.y;}void main() {float ratio = ures.x/ures.y;vec3 rects = vec3(0.);vec3 opaqueRects = vec3(0.);vec3 shiftedSelectedCol = vec3(0.);for (int i = 0; i < nbshp; i++) {float x = ushp[i].x;float y = 1.-ushp[i].y * 2.;float w = ushp[i].z * 1.;float h = ushp[i].w * 2.;vec3 color = ushpcl[i].rgb;float opacity = abs(ushpcl[i].a);float rect = drwrct(vUv, vec2(w, h), vec2(x, y ));if (length(rects) == 0.) {rects += vec3(rect) * color * opacity;opaqueRects += vec3(rect) * color;}}if (opaqueRects != udkncl.rgb) {rects = vec3(0.);}vec3 c = vec3(rects);gl_FragColor = vec4(c, 1.);}`;const ye=(c=512)=>{const l=new THREE.WebGLRenderTarget(c,c,{minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter});return l.texture.wrapS=THREE.MirroredRepeatWrapping,l},Fe="vec3 snoiseVec3( vec3 x ){ float s = sn3d(vec3( #crlchnks )); float s1 = sn3d(vec3( #crlchnks1 )); float s2 = sn3d(vec3( #crlchnks2 )); vec3 c = vec3( #crlchnk1 ); return c;}vec3 crlnse( vec3 p ){ const float e = .1; vec3 dx = vec3( #curlExp0 , 0.0 , 0.0 ); vec3 dy = vec3( 0.0 , #curlExp1 , 0.0 ); vec3 dz = vec3( 0.0 , 0.0 , #curlExp2 ); vec3 p_x0 = snoiseVec3( p - dx ); vec3 p_x1 = snoiseVec3( p + dx ); vec3 p_y0 = snoiseVec3( p - dy ); vec3 p_y1 = snoiseVec3( p + dy ); vec3 p_z0 = snoiseVec3( p - dz ); vec3 p_z1 = snoiseVec3( p + dz ); float x = p_y1.z - p_y0.z - p_z1.y + p_z0.y; float y = p_z1.x - p_z0.x - p_x1.z + p_x0.z; float z = p_x1.y - p_x0.y - p_y1.x + p_y0.x; const float divisor = 1.0 / ( 2.0 * e ); return normalize( vec3( #crlchnk2 ) * divisor );}",We="vec3 fade(vec3 t) {return t*t*t*(t*(t*6.0-15.0)+10.0);}float pnoise3d(vec3 P, vec3 rep){vec3 Pi0 = mod(floor(P), rep);vec3 Pi1 = mod(Pi0 + vec3(1.0), rep);Pi0 = mod289(Pi0);Pi1 = mod289(Pi1);vec3 Pf0 = fract(P);vec3 Pf1 = Pf0 - vec3(1.0);vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);vec4 iy = vec4(Pi0.yy, Pi1.yy);vec4 iz0 = Pi0.zzzz;vec4 iz1 = Pi1.zzzz;vec4 ixy = permute(permute(ix) + iy);vec4 ixy0 = permute(ixy + iz0);vec4 ixy1 = permute(ixy + iz1);vec4 gx0 = ixy0 * (1.0 / 7.0);vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5;gx0 = fract(gx0);vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);vec4 sz0 = step(gz0, vec4(0.0));gx0 -= sz0 * (step(0.0, gx0) - 0.5);gy0 -= sz0 * (step(0.0, gy0) - 0.5);vec4 gx1 = ixy1 * (1.0 / 7.0);vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5;gx1 = fract(gx1);vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);vec4 sz1 = step(gz1, vec4(0.0));gx1 -= sz1 * (step(0.0, gx1) - 0.5);gy1 -= sz1 * (step(0.0, gy1) - 0.5);vec3 g000 = vec3(gx0.x,gy0.x,gz0.x);vec3 g100 = vec3(gx0.y,gy0.y,gz0.y);vec3 g010 = vec3(gx0.z,gy0.z,gz0.z);vec3 g110 = vec3(gx0.w,gy0.w,gz0.w);vec3 g001 = vec3(gx1.x,gy1.x,gz1.x);vec3 g101 = vec3(gx1.y,gy1.y,gz1.y);vec3 g011 = vec3(gx1.z,gy1.z,gz1.z);vec3 g111 = vec3(gx1.w,gy1.w,gz1.w);vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));g000 *= norm0.x;g010 *= norm0.y;g100 *= norm0.z;g110 *= norm0.w;vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));g001 *= norm1.x;g011 *= norm1.y;g101 *= norm1.z;g111 *= norm1.w;float n000 = dot(g000, Pf0);float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));float n111 = dot(g111, Pf1);vec3 fade_xyz = fade(Pf0);vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);return 2.2 * n_xyz;}",we="float sn3d(vec3 v){const vec2 C = vec2(1.0/6.0, 1.0/3.0) ;const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);vec3 i = floor(v + dot(v, C.yyy) );vec3 x0 = v - i + dot(i, C.xxx) ;vec3 g = step(x0.yzx, x0.xyz);vec3 l = 1.0 - g;vec3 i1 = min( g.xyz, l.zxy );vec3 i2 = max( g.xyz, l.zxy );vec3 x1 = x0 - i1 + C.xxx;vec3 x2 = x0 - i2 + C.yyy; vec3 x3 = x0 - D.yyy; i = mod289(i);vec4 p = permute( permute( permute(i.z + vec4(0.0, i1.z, i2.z, 1.0 ))+ i.y + vec4(0.0, i1.y, i2.y, 1.0 ))+ i.x + vec4(0.0, i1.x, i2.x, 1.0 ));float n_ = 0.142857142857;vec3 ns = n_ * D.wyz - D.xzx;vec4 j = p - 49.0 * floor(p * ns.z * ns.z);vec4 x_ = floor(j * ns.z);vec4 y_ = floor(j - 7.0 * x_ );vec4 x = x_ *ns.x + ns.yyyy;vec4 y = y_ *ns.x + ns.yyyy;vec4 h = 1.0 - abs(x) - abs(y);vec4 b0 = vec4( x.xy, y.xy );vec4 b1 = vec4( x.zw, y.zw );vec4 s0 = floor(b0)*2.0 + 1.0;vec4 s1 = floor(b1)*2.0 + 1.0;vec4 sh = -step(h, vec4(0.0));vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;vec3 p0 = vec3(a0.xy,h.x);vec3 p1 = vec3(a0.zw,h.y);vec3 p2 = vec3(a1.xy,h.z);vec3 p3 = vec3(a1.zw,h.w);vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));p0 *= norm.x;p1 *= norm.y;p2 *= norm.z;p3 *= norm.w;vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);m = m * m;return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),dot(p2,x2), dot(p3,x3) ) );}",Ae="float grain(vec2 texCoord, vec2 resolution, float frame, float mult
wrpscl:[10,50],crlsck2:.55,swl:[.5,.5,0],d:.2},pe=.3;let Z=Math.floor(r.random()*B.length);const O=r.random()>.96;let Q=-1,Re=null;for(;Q==-1;){const c=Math.floor(r.random()*B.length);B[c].filter(o=>o.nf).length||(Q=c)}Re=B[Q];let z=B[Z],me=ve[Z],Et=[.7,.7,.7,1],F=[r.random()>.85?1:0,r.pick([0,1])],zt=F[0]==0?"Day":"Night",he=r.pick([3,4,6,10]),Te=z.filter(c=>c.ds);Te.length&&(he=Te[0].ds);let Ce=r.random()>.6&&he>2,y=r.pick([3,4,5]);const oe=r.random();oe<.1&&(y=1);oe>.77&&(y=10);oe>.88&&(y=30);oe>.98&&(y=100);F[0]==1&&(y=Math.min(30,y));y==1&&(Ce=!1);y==100&&(Z=r.pick([0,20,22,23]),z=B[Z]);let xe=.1;y==30&&(xe*=.7);y==100&&(xe*=.4);let X=.015;y==4&&(X=.015);y==5&&(X=.025);y==10&&(X*=2);y==30&&(X*=r.range(5,7));y==100&&(X*=5);let Ut=(F[0]==1,0),Pe=18;const _e={x:r.range(.02,.04),y:1};let It=Math.floor(r.random()*de.length),f=de[It],De=.2,Ve=z.filter(c=>c.si);Ve.length&&(De=Ve[0].si);let ge=.1,$e=z.filter(c=>c.hsi);$e.length&&(ge=$e[0].hsi);F[0]==1&&(ge*=.5);let ee=[1,.5],qe=z.filter(c=>c.gl);qe.length&&(ee=qe[0].gl);z.filter(c=>c.ng).length&&(ee[0]=ee[1]=1);const be={x:(r.random()>=.65,1),y:r.random()<=.7?F[0]==1?1:0:1};let He="Hot pressed";be.y==1&&(He="Cold pressed");F[0]==1&&(me=ve[Q]);const Rt={Graphite:O?"Yes":"No",Name:O?"Unknown":me,Time:O?"Unknown":zt,ppr:He,Guide:y+""};console.log(Rt);const H={crlchnk1:f.crlchnk1?f.crlchnk1:w.crlchnk1,crlchnks:f.crlchnks?f.crlchnks:w.crlchnks,crlchnks1:f.crlchnks1?f.crlchnks1:w.crlchnks1,crlchnks2:f.crlchnks2?f.crlchnks2:w.crlchnks2,crlchnk2:f.crlchnk2?f.crlchnk2:w.crlchnk2,wrapx:f.wrapx?r.pick(f.wrapx):w.wrapx,crlxps:f.crlxps?f.crlxps:w.crlxps,crlbse:f.crlbse?f.crlbse:w.crlbse,crlsck2:f.crlsck2?f.crlsck2:w.crlsck2,crlpses:f.crlpses?f.crlpses:w.crlpses,rtfmla:f.rtfmla?f.rtfmla:w.rtfmla,d:f.d?f.d:w.d,rtaddfmla:f.rtaddfmla?r.pick(f.rtaddfmla):w.rtaddfmla,rtswlfmla:f.rtswlfmla?r.pick(f.rtswlfmla):w.rtswlfmla,swl:f.swl?r.pick(f.swl):w.swl,crlwrpscl:f.crlwrpscl?r.pick(f.crlwrpscl):w.crlwrpscl};H.crlsck2+=r.range(-.1,.1);y==100&&(H.crlsck2+=r.range(0,.2));const e={isBuild:!0,width:4961*pe,height:7016*pe,scl:pe,rnd:r.random(),renderDebug:!1,debugView:0,animated:!1,step:Pe,minStep:Ut,maxStep:Pe,mode:0,form:H,nbShapes:100,strongStrokes:z.filter(c=>c.hs).length>0,isDark:z.filter(c=>c.d!==void 0).length,issqusse:[0,O?1:0],paletteIdx:Z,palette:z,night:F,sunColor:Et,bgColor:"#f5f1e5",bgColorScale:1.7,darkenColor:"#666666",rotate:r.random()<.5?r.range(0,.005)*r.pick([-1,1]):Math.min(r.range(.008,.014),.013)*r.pick([-1,1]),rotateFreq:r.pick([.1,.5,1,2]),artdens:he,artNbColors:2,artgrdlmt:{x:ee[0],y:ee[1]},grainResScale:1,useContour:!0,contourWidth:4,contourMaskedByFrame:!0,nbLinesX:y,nbLinesY:10,cellBorderSize:X,skipThreshold:1.2,nsyclIntensity:.5,originColorIntensity:.05,hstkIntensity:ge,fzzstkint:-.45,darkIntensity:O?-.1:-2.2,globalRot:0,fllclls:{x:Ce,y:r.pick([.8,.9])},edgeWidth:xe,pertubScale:1,pertubUVScale:1,pertubUVTranslateX:-2.2+r.range(-2,2),pertubUVTranslateY:r.range(-.5,.5),clattScale:0,translateUVX:0,blendppr:2,blendHighlights:1.3,blendHighlightsBg:1.3,scrch:_e,oscrch:_e,wearSize:{x:18,y:.5,z:2,w:20},frameParams:{x:r.pick([100,200,400])+r.random()*50,y:r.pick([20,10,5]),z:r.range(40,80),w:r.range(500,1e3)},pprType:{x:be.x,y:be.y},ppruvfsst:{x:r.random()>.5?0:r.random()*.3*(r.random()>.5?1:-1),y:r.random()>.4?r.random()*.01:0},ppruvdir:{x:r.random()>.5?1:-1,y:r.random()>.5?1:-1},wrapScaleX:r.range(-.05,.05)*r.range(.9,1.5),wrapScaleY:r.range(-.05,.05)*r.range(.9,1.5),clddegtrslt:{x:r.range(-1,1),y:r.range(-1,1)},curl:{pos:{x:r.range(-5,5),y:r.range(-5,5)},scl:{x:1,y:1},wrap:{x:H.crlwrpscl[0],y:H.crlwrpscl[1]}},ucllff:{x:-Math.floor(r.random()*10)/10,y:Math.floor(r.random()*10)/10},flip:{x:r.random()>=.5?1:-1,y:r.random()>=.5?1:-1},pclstkIntensity:De,darken:0,dirtBlend:-2,dirts:[{intensity:.3,freq:3,scale:{x:1,y:3},levels:{x:0,y:.3}},{intensity:.5,freq:r.range(4,6),scale:{x:r.range(2,4),y:3},levels:{x:0,y:.3}},{intensity:3,freq:20,scale:{x:1,y:1},levels:{x:r.range(-.03,0),y:r.range(.13,.18)}},{intensity:.4,freq:3,scale:{x:4,y:1},levels:{x:0,y:.3}}],swl:H.swl,hsft:r.range(0,.1),arthsft:0,artcntrst:.82,artbrhtnss:0,artstrtn:4.32,artxpsr:-1.09,cntrst:1.14,brhtnss:0,strtn:.43,xpsr:-.26};e.artcntrst=3;e.artbrhtnss=1.15;e.artstrtn=1.2;e.artxpsr=-.65;e.cntrst=2.5;e.brhtnss=-1.35;e.strtn=.89;e.xpsr=1.39;e.pprType.y==1&&(e.artbrhtnss=1.085);let Me=r.pick(H.crlpses);e.curl.pos.x=Me[0];e.curl.pos.y=Me[1];const ae=H.d;e.curl.pos.x+=r.range(-ae,ae);e.curl.pos.y+=r.range(-ae,ae);e.isDark&&(e.pclstkIntensity=0,e.nsyclIntensity=.7);e.nbLinesX<=3?e.fllclls.x=!1:e.nbLinesX==10&&(e.fllclls.x=r.random()<=.7,e.fllclls.y=r.pick([.7,.8,.9]));e.night[0]==1&&(e.paletteIdx=Q,e.palette=Re,e.isDark=!1);if(O){e.night[0]=0;const c=17;z=B[c],z[0].i=.7,z[1].i=.3,me=ve[c],e.palette=z,e.paletteIdx=c,e.artdens=r.pick([4,6]),e.cntrst=2.3,e.brhtnss=-1.32,e.strtn=-.6,e.xpsr=2,e.hstkIntensity=.07,e.pclstkIntensity=.1,e.issqusse[1]=1}const Be=(c,l,s)=>Math.min(Math.max(c,l),s),te=(c,l,s)=>{l/=100,s/=100;let o=(1-Math.abs(2*s-1))*l,n=o*(1-Math.abs(c/60%2-1)),t=s-o/2,i=0,u=0,p=0;return 0<=c&&c<60?(i=o,u=n,p=0):60<=c&&c<120?(i=n,u=o,p=0):120<=c&&c<180?(i=0,u=o,p=n):180<=c&&c<240?(i=0,u=n,p=o):240<=c&&c<300?(i=n,u=0,p=o):300<=c&&c<360&&(i=o,u=0,p=n),i=Math.round((i+t)*255),u=Math.round((u+t)*255),p=Math.round((p+t)*255),{r:i,g:u,b:p}},re=c=>{if(c.s)return c;let l=0,s=0,o=0;c.length==4?(l="0x"+c[1]+c[1],s="0x"+c[2]+c[2],o="0x"+c[3]+c[3]):c.length==7&&(l="0x"+c[1]+c[2],s="0x"+c[3]+c[4],o="0x"+c[5]+c[6]),l/=255,s/=255,o/=255;let n=Math.min(l,s,o),t=Math.max(l,s,o),i=t-n,u=0,p=0,b=0;return i==0?u=0:t==l?u=(s-o)/i%6:t==s?u=(o-l)/i+2:u=(l-s)/i+4,u=Math.round(u*60),u<0&&(u+=360),b=(t+n)/2,p=i==0?0:i/(1-Math.abs(2*b-1)),p=+(p*100).toFixed(1),b=+(b*100).toFixed(1),{h:u,s:p,l:b}};class Tt{constructor(l={}){D(this,"play",()=>{this._isPlaying||(this._isPlaying=!0,this._frame())});D(this,"pause",()=>{!this._isPlaying||(this._isPlaying=!1)});D(this,"togglePlay",()=>{this._isPlaying?this.pause():this.play()});D(this,"_frame",()=>{!this._isPlaying||(this._rafId=requestAnimationFrame(this._frame),this.render())});D(this,"_init",()=>{this._bindEvents(),this._resize(),this.init()});D(this,"_resize",()=>{const l=window.innerWidth,s=window.innerHeight,o=this.width,n=this.height,t=this.canvas;this._displayWidth=o*s/n,this._displayHeight=s-this.heightPadding,this._displayWidth>l&&(this._displayWidth=l,this._displayHeight=this._displayWidth*n/o),t.width=o,t.height=n,t.style.width=`${this._displayWidth}px`,t.style.height=`${this._displayHeight}px`});D(this,"_onKeyUp",({keyCode:l})=>{(l==32||l==69)&&window.render(),l==82&&!e.isBuild&&window.location.reload(),l==37&&(e.step--,e.step=Be(e.step,e.minStep,e.maxStep),window.render()),l==39&&(e.step++,e.step=Be(e.step,e.minStep,e.maxStep),window.render()),l==40&&(e.step=e.minStep,window.render()),l==38&&(e.step=e.maxStep,window.render())});D(this,"_bindEvents",()=>{window.addEventListener("keyup",this._onKeyUp),window.addEventListener("resize",this._resize)});const s=document.createElement("canvas");s.id="artwork",s.style.boxShadow="",this.dpr=l.dpr||window.devicePixelRatio,this.width=l.width||window.innerWidth,this.height=l.height||window.innerHeight,this.heightPadding=0,this._isPlaying=!1,this._displayWidth=this.width,this._displayHeight=this.height,this.canvas=s,s.width=this.width,s.height=this.height,this.gl=s.getContext("webgl"),this.maxUniforms=this.gl.getParameter(this.gl.MAX_VERTEX_UNIFORM_VECTORS),this.r=new THREE.WebGLRenderer({canvas:s,preserveDrawingBuffer:!1}),this.r.setClearColor("#333333",1),this.r.gammaFactor=2.2,this.r.outputEncoding=THREE.sRGBEncoding,this.gl.getParameter(this.gl.MAX_RENDERBUFFER_SIZE),this.gl.getParameter(this.gl.MAX_VIEWPORT_DIMS),this._rafId=0,this._init()}init(){}render(){}resize(){}}var W=`attribute vec2 aPosition;attribute vec2 aTexCoord;varying vec2 vUv;void main() {gl_Position = vec4(position, 1.);vUv = uv;}`,Ct=`uniform sampler2D tColor1;uniform sampler2D tColor2;uniform sampler2D tColor3;uniform vec2 ures;uniform vec2 ucntr;uniform float uskptsh;uniform float uhgtml;uniform vec4 ushp[nbshp];uniform vec4 ushpcl[nbshp];uniform float uRotations[nbshprot];uniform float ugrd;uniform float uuseslctcl;uniform vec4 uslctcls;uniform float uRenderRot;uniform float uShift;uniform float uStep;uniform vec2 ugrdlmt;varying vec2 vUv;float map(float value, float min1, float max1, float min2, float max2) {return min2 + (value - min1) * (max2 - min2) / (max1 - min1);}float rand(vec2 co){return fract(sin(dot(co, vec2(12.9898, 78.233))) * 43758.5453);}\${blend}\${adjust}float drwrct(vec2 coord, vec2 dimensions, vec2 offset) {vec2 rct = step(offset, coord);rct *= step(coord, offset + dimensions);return rct.x * rct.y;}void main() {float ratio = ures.x/ures.y;float stripes = step( fract(vUv.y*50.), .5 );vec3 rects = vec3(0.);for (int i = 0; i < nbshp; i++) {float x = ushp[i].x;float y = 1.-ushp[i].y * 2.;float w = ushp[i].z * 1.;float h = ushp[i].w * uhgtml;float p = map(vUv.x, x, x+w, -1., 1.);float py = map(vUv.y, y, y+h, 0., 1.);vec3 color = ushpcl[i].rgb;float opacity = abs(ushpcl[i].a);float rnd = rand(vec2(x,y));float mapper = map(vUv.x, x, x+w, 1. ,0.);color *= map(vUv.x, x, x+w, ugrdlmt.x, ugrdlm
var xt=Object.defineProperty;var gt=(c,l,s)=>l in c?xt(c,l,{enumerable:!0,configurable:!0,writable:!0,value:s}):c[l]=s;var D=(c,l,s)=>(gt(c,typeof l!="symbol"?l+"":l,s),s);const bt=function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))o(n);new MutationObserver(n=>{for(const t of n)if(t.type==="childList")for(const i of t.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&o(i)}).observe(document,{childList:!0,subtree:!0});function s(n){const t={};return n.integrity&&(t.integrity=n.integrity),n.referrerpolicy&&(t.referrerPolicy=n.referrerpolicy),n.crossorigin==="use-credentials"?t.credentials="include":n.crossorigin==="anonymous"?t.credentials="omit":t.credentials="same-origin",t}};bt();function yt(c){let l={},s="0x";for(var o=0;o<64;o++)s+=Math.floor(Math.random()*16).toString(16);return l.hash=s,l.tokenId=(c*1e6+Math.floor(Math.random()*1e3)).toString(),l}let ie=tokenData||yt(123);class wt{constructor(){this.useA=!1,this.tk=ie,console.log("hash",this.tk.hash);let l=function(s){let o=parseInt(s.substr(0,8),16),n=parseInt(s.substr(8,8),16),t=parseInt(s.substr(16,8),16),i=parseInt(s.substr(24,8),16);return function(){o|=0,n|=0,t|=0,i|=0;let u=(o+n|0)+i|0;return i=i+1|0,o=n^n>>>9,n=t+(t<<3)|0,t=t<<21|t>>>11,t=t+u|0,(u>>>0)/4294967296}};this.prngA=new l(ie.hash.substr(2,32)),this.prngB=new l(ie.hash.substr(34,32));for(let s=0;s<1e6;s+=2)this.prngA(),this.prngB()}random(){return this.useA=!this.useA,this.useA?this.prngA():this.prngB()}range(l,s){return l+(s-l)*this.random()}int(l,s){return Math.floor(this.range(l,s+1))}bool(l){return this.random()<l}pick(l){return l[this.int(0,l.length-1)]}}const r=new wt,ue=r.pick([0,1]),B=[[{c:"#4a4e69",i:.5},{c:"#5aa9e6",i:.25},{c:"#e7d5ce",i:.5},{c:"#e6b953",i:.25,hs:!0,si:.01,gl:[.8,.8],ds:r.pick([2,4,4]),nf:!0}],[{c:"#88A6C2",i:.2},{c:"#D2BB93",i:ue==1?.25:.3,ng:(ue==1,!1),hs:!0,ds:r.pick([3,4]),nf:!0,gl:[1,.8]}],[{c:"#A8715D",i:.4},{c:"#88A6C2",i:.4,hs:!0,ds:r.pick([2,4,3,4])}],[{c:"#3b72b5",i:.1},{c:"#a8cfef",i:.3,hs:!0,si:.23,hsi:.035,ds:r.pick([4,6,8])}],[{c:"#a25d72",i:.4},{c:"#e79cb1",i:.4},{c:"#a9373b",i:.2,hs:!0,ds:r.pick([2,4,4])}],[{c:"#5f6d87",i:.45},{c:"#ab9d90",i:.2},{c:"#e6b953",i:.35,hs:!0,nf:!0,ds:r.pick([2,4,4,4])}],[{c:"#1e2642",i:.7},{c:"#dddddd",i:.2,hs:!0,ng:!1,gl:[1,.8],si:.01,ds:r.pick([2,4,3,4])}],[{c:"#1e2642",i:.5},{c:"#5f6d87",i:.5,hs:!0,ng:!1,gl:[1,.8],si:.01,ds:r.pick([2,4,3,4]),nf:!0}],[{c:"#977881",i:.4},{c:"#f9d794",i:.2,hs:!0,hsi:.05,ds:r.pick([3,4]),nf:!0}],[{c:"#f9d2db",i:.2,d:.8},{c:"#e7d5ce",i:.2},{c:"#e7d5ce",i:.2,hs:!0,ds:r.pick([2,4,4,5]),nf:!0}],[{c:"#C1EBE7",i:.25},{c:"#C1EBE7",i:.15,ng:!(r.random()>.7),hs:!0,si:.13,ds:r.pick([3,4]),hsi:.1}],[{c:"#5aa9e6",i:.3},{c:"#5aa9e6",i:.3,f:!0,ng:r.random()>.6,hs:!0,ds:r.pick([2,4,4]),nf:!0}],[{c:"#FFC9E1",i:.26},{c:"#C1EBE7",i:.2},{c:"#C1EBE7",i:.2,hs:!0,ds:r.pick([2,4,2.5,4])}],[{c:"#d736bb",i:.07},{c:"#a8cfef",i:.2,hs:!0,ng:!0,ds:r.pick([2,4,4]),nf:!0}],[{c:"#e79cb1",i:.35},{c:"#1e2642",i:.2},{c:"#599598",i:.4},{c:"#e6b953",i:.4},{c:"#3b72b5",i:.25,hs:!0,ds:r.pick([4,10])}],[{c:"#a25d72",i:.33},{c:"#e04372",i:.15,f:!0,hs:!0,ds:r.pick([2,4,4,6])}],[{c:"#666666",i:.7,d:.8},{c:"#000000",i:.1,hs:!0,gl:ue>0?[0,1]:null,ds:r.pick([4,6,10])}],[{c:"#666666",i:1,d:.8},{c:"#666666",i:.1},{c:"#666666",i:.1,nf:!0,hs:!0,ds:r.pick([4,6,10])}],[{c:"#C1EBE7",i:.3},{c:"#e6b953",i:.2},{c:"#a8cfef",i:.1,hs:!0,nf:!0}],[{c:"#000000",i:.2},{c:"#e6b953",i:.3},{c:"#e6b953",i:.25,hs:!0}],[{c:"#88A6C2",i:.4},{c:"#814F00",i:.35},{c:"#4a4e69",i:.8},{c:"#a9373b",i:.25,hs:!0,nf:!0,ds:r.pick([4,6])}],[{c:"#a9373b",i:.2},{c:"#a8cfef",i:.2},{c:"#a8cfef",i:.2,hs:!0,ng:!0,ds:r.pick([2,4,4]),sh:-.5,nf:!0}],[{c:"#e04372",i:.2},{c:"#5aa9e6",i:.3},{c:"#4a4e69",i:.3},{c:"#e04372",i:.2},{c:"#e6b953",i:.25,hs:!0,nf:!0,ds:r.pick([3,4])}],[{c:"#5f6d87",i:.45},{c:"#e04372",i:.2},{c:"#e6b953",i:.35,hs:!0,nf:!0,ds:r.pick([2,4,4,4])}]],ve=["Madeleine","Camille","Emmeline","Jeanne","Hedy","Marie","Margaret","C\xE9cilia","Ada","Jocelyn","Sonita","Malala","Ellen","Nzinga","Billie","Yvonne","Junko","Elizabeth","Rosalin","Sirimavo","Bertha","Simone","Sonia"," Sonia"];function kt(c){let l={},s="0x";for(var o=0;o<64;o++)s+=Math.floor(Math.random()*16).toString(16);return l.hash=s,l.tokenId=(c*1e6+Math.floor(Math.random()*1e3)).toString(),l}let fe=tokenData||kt(123);class St{constructor(){this.useA=!1,this.tk=fe,console.log("hash",this.tk.hash);let l=function(s){let o=parseInt(s.substr(0,8),16),n=parseInt(s.substr(8,8),16),t=parseInt(s.substr(16,8),16),i=parseInt(s.substr(24,8),16);return function(){o|=0,n|=0,t|=0,i|=0;let u=(o+n|0)+i|0;return i=i+1|0,o=n^n>>>9,n=t+(t<<3)|0,t=t<<21|t>>>11,t=t+u|0,(u>>>0)/4294967296}};this.prngA=new l(fe.hash.substr(2,32)),this.prngB=new l(fe.hash.substr(34,32));for(let s=0;s<1e6;s+=2)this.prngA(),this.prngB()}random(){return this.useA=!this.useA,this.useA?this.prngA():this.prngB()}range(l,s){return l+(s-l)*this.random()}int(l,s){return Math.floor(this.range(l,s+1))}bool(l){return this.random()<l}pick(l){return l[this.int(0,l.length-1)]}}const h=new St,N=h.random()>=.5?1:3,Ie=[{crlchnks2:"x.z / 74.2 , x.x - 124.5 , x.y + 99.4",curlExpBase:.1,rtfmla:"max(curl.r * 5., -1.) / fm1(vUv*1.)*.5",rtaddfmla:["(floor((rot*3.*PI))/3.*PI)"],crlsck2:.5,crlpses:[[1.34,2.09],[-4.16,-1.45],[3.16,.25],[5,3],[.85,-2.77],[-3.54,-1.92]]},{crlchnks2:"x.z - 74.2 , x.x - 1240.5 , x.y + 99.4",crlbse:.1,rtfmla:"max(curl.r * 3., -1.) / fm1(vUv*1.)*.5",rtaddfmla:["(floor((rot*1.*PI))/1.*PI)"],rtswlfmla:["","","","rot += angle","rot += sin(angle) * 2."],swl:[[h.pick([0,.5]),h.pick([0,.5,1]),0]],wrapx:["sin(centeredUV.x*curl.y*ucrlwrp.x) * cos(centeredUV.y*curl.x*ucrlwrp.y)"],crlsck2:.5,crlpses:[[.99,2.72],[-3.16,1.49],[1.75,-.4],[3.93,-2.49,2,20],[-2.23,3.2],[2.54,-.18],[.12,-2.38],[1.08,-2.14],[3.48,.33],[1.64,-.5],[-2.86,.54]]},{crlchnks2:"x.z - 74.2 , x.x - 1240.5 , x.y + 99.4",crlbse:.1,rtfmla:"max(curl.r * 3., -1.) / fm1(vUv*1.)*.5",rtaddfmla:["(floor((rot*1.*PI))/1.*PI)"],rtswlfmla:["","rot += angle"],swl:[h.pick([-.5],0,.5,1),h.pick([-.5],0,.5,1),-0],wrapx:["sin(centeredUV.x*curl.y*5.) * cos(centeredUV.y*curl.x*50.)"],crlsck2:.5,swl:[h.pick([-.5],0,.5,1),h.pick([-.5],0,.5,1),0],crlpses:[[2.88,-3.08],[-2.98,.45],[2.79,-3.17]]},{crlchnks2:"x.z - 74.2 , x.x - 124.5 , x.y + 99.4",crlxps:["e","e*5.","e*10."],rtfmla:"max(curl.r * 3., -1.) / fm1(vUv*1.)*.5",rtaddfmla:["(floor((rot*3.*PI))/3.*PI)"],crlpses:[[-2.06,-1.67],[-3.08,-4.58],[3.18,-4.62],[-2,4.5],[-4.28,-.68],[.92,1.43],[1.11,3.36],[1.17,3.72],[3.93,4.05],[2.7,.25],[4.24,3.77]]},{crlxps:["e","e+1.","e+2."],rtaddfmla:["(floor((rot*2.*PI))/2.*PI)"],rtswlfmla:["",`rot += angle * ${h.pick([".5",".8","1."])}`],swl:[[h.range(-1,1),h.range(-1,1),h.range(-.2,.1)]],crlpses:[[1.51,-2.32],[1.2,3.26],[.05,4.92],[-4.5,-1.5],[.2,2.32],[3.01,-4.05],[.89,3.47],[-4.74,3.9],[-1.63,-4.21],[-3.05,4.14],[-3.12,.1],[4.72,-.26]]},{crlchnks2:"x.z - 74.2 , x.x - 124.5 , x.y + 99.4",crlxps:["e-3.","e+10.","e"],crlbse:.1,crlsck2:.75,rtaddfmla:[`(floor((rot*${N}.*PI))/${N}.*PI) * ${h.random()}`],rtswlfmla:[""],swl:[0,0,-.2],rtfmla:"max(curl.r * 5., -1.) / fm1(vUv*1.)*.2",crlpses:[[4.6,9.95],[.67,-1.84],[3.87,3.91]]},{crlchnks2:"x.z - 74.2 , x.x - 124.5 , x.y + 99.4",crlxps:["e","e+1.","e+2."],crlbse:.1,rtaddfmla:[`(floor((rot*${N}.*PI))/${N}.*PI) * ${h.random()}`],wrapx:["sin(centeredUV.x*curl.y*ucrlwrp.x) - cos(centeredUV.y*curl.x*ucrlwrp.y)"],crlpses:[[.57,1.31],[.59,2.17],[2.22,-4.86],[-5.08,-4.17],[3,.55],[-4.21,-1.45],[.56,1.51],[-3.32,4.67]]},{crlchnks2:"x.z - 74.2 , x.x - 124.5 , x.y ",crlxps:["e","e-1.","e+2."],crlbse:.1,crlsck2:.5,rtfmla:"max(curl.r * 5., -1.) / fm1(vUv*1.)*.2",rtaddfmla:[`(floor((rot*${N}.*PI))/${N}.*PI) * ${h.random()}`],rtswlfmla:["","rot += curl.r * PI - curl.b"],swl:[h.pick([-.5],0,.5,1),h.pick([-.5],0,.5,1),-.2],wrapx:[`sin(centeredUV.x*curl.y*10.) + cos(centeredUV.y*curl.x*${h.pick([20])}.)`],d:.1,crlpses:[[2.72,1.74],[0,-1],[1.86,-4.7],[-2.55,2.39],[-2.45,-4.86],[3,1.07],[2.82,1.19],[3.51,4.82],[3.19,.94],[-1.08,-4.51],[-3.79,2.39]]},{crlxps:["e","e","dy.y * 1000."],wrapx:["sin(centeredUV.x*curl.y*2.) + cos(centeredUV.y*curl.x*20.)"],rtaddfmla:["(floor((rot*2.*PI))/2.*PI)","(floor((rot*5.*PI))/5.*PI)"],crlpses:[[-2.54,-3.62],[-.19,4.6],[-4.16,-1.45],[-1.07,1.87],[3.16,.25],[-2.96,1.61],[-4.52,4],[-.53,-3.45],[3.21,-4],[1.08,.08],[-1.6,-.9],[1.66,.71],[4.48,-.6],[4.21,2.26],[3.53,1.41],[2.39,2.67],[-4.4,-2.6],[-4.36,.74],[4.13,1.54],[-2.21,2.31],[3.6,-.13],[1.8,-2.15],[-3.28,-3]]}],de=[];for(let c=0;c<Ie.length;c++){const l=Ie[c],s=l.crlpses,o=Object.keys(l);for(let n=0;n<s.length;n++){const t={},i=s[n];for(let u=0;u<o.length;u++){const p=o[u];t[p]=l[p],t.crlpses=[i]}de.push(t)}}const w={crlchnk1:"s, s1, s2",crlchnks:"x",crlchnks1:"x.y - 19.1 , x.z + 33.4 , x.x + 47.2",crlchnks2:"x.z + 74.2 , x.x - 124.5 , x.y + 99.4",crlchnk2:"x, y, z",crlxps:["e","e","e"],curlExpBase:1,crlpses:[[h.range(-5,5),h.range(-5,5)]],rtfmla:"max(curl.r * 5., -1.) / fm1(vUv*1.)*.2",rtaddfmla:"0.",rtswlfmla:"",wrapx:"sin(centeredUV.x*curl.y*ucrlwrp.x) + cos(centeredUV.y*curl.x*ucrlwrp.y)",crl
Anticyclones are a weather phenomena. They pierce through darkness to instill peace and calm. Their planetary scale reminds us of how little we are and how powerful they can be. High pressure, rotation, air flow… The "Anticyclone" series is an artistic exploration and interpretation of those concepts. The rendering borrows its aesthetics from traditional and organic media like paper and crayons, to lend an analog/archival look. "Can a computer draw like a human?" The question is asked and challenged once more through "Anticyclone". [Press the left/right keys to explore the different steps building the final image. Bottom/top for the first/last step. Can be intense for your machine]