asciify-engine 4.25.0 → 4.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/dist/field.cjs +1 -1
- package/dist/field.d.cts +132 -275
- package/dist/field.d.ts +132 -275
- package/dist/field.js +1 -1
- package/dist/glyph-field-C2fQIlnq.d.cts +292 -0
- package/dist/glyph-field-DRC-7uVf.d.ts +292 -0
- package/dist/kit/{chunk-KS3TL3S2.js → chunk-2FH6GGV6.js} +1 -1
- package/dist/kit/chunk-2GAV4OAK.js +1 -0
- package/dist/kit/{chunk-3F6FTBMN.js → chunk-2LBQ7QJT.js} +1 -1
- package/dist/kit/chunk-3LJ5C3U3.js +1 -0
- package/dist/kit/{chunk-SQGJ263V.js → chunk-3MHEDZLZ.js} +1 -1
- package/dist/kit/{chunk-KTYCGGRO.js → chunk-3OD5BMF5.js} +1 -1
- package/dist/kit/{chunk-OVCIHOOS.js → chunk-3VEMKDBW.js} +1 -1
- package/dist/kit/{chunk-H4DBJULW.js → chunk-42KMN727.js} +1 -1
- package/dist/kit/{chunk-PND73YEV.js → chunk-6G5MPND3.js} +1 -1
- package/dist/kit/{chunk-CA5J25SV.js → chunk-6WU247CB.js} +1 -1
- package/dist/kit/{chunk-6L2GAV5C.js → chunk-776H2BJ7.js} +1 -1
- package/dist/kit/{chunk-4SHQA3CO.js → chunk-7DXSG526.js} +1 -1
- package/dist/kit/{chunk-L3P7ZDSK.js → chunk-7M2FFUZ3.js} +1 -1
- package/dist/kit/{chunk-XYLLL2PQ.js → chunk-7NVKRDKE.js} +1 -1
- package/dist/kit/chunk-AIGAJMNN.js +1 -0
- package/dist/kit/{chunk-XXPDXJMQ.js → chunk-B3TY6UXJ.js} +1 -1
- package/dist/kit/chunk-BFBG3VHI.js +1 -0
- package/dist/kit/{chunk-6XNIZ52V.js → chunk-CG6SGQMY.js} +1 -1
- package/dist/kit/{chunk-KBXVIAWS.js → chunk-CGSWUO67.js} +1 -1
- package/dist/kit/{chunk-YDP6566E.js → chunk-DAJSBX6H.js} +1 -1
- package/dist/kit/{chunk-PFNFW4ZI.js → chunk-DCLJHSWM.js} +1 -1
- package/dist/kit/{chunk-QTVMD62E.js → chunk-DMRPBFLW.js} +1 -1
- package/dist/kit/{chunk-CR7QS3B3.js → chunk-E3FPFANJ.js} +1 -1
- package/dist/kit/{chunk-LUOIH2EM.js → chunk-EKYEA7Z4.js} +1 -1
- package/dist/kit/{chunk-QKZYCROD.js → chunk-F6F2C3RH.js} +1 -1
- package/dist/kit/chunk-FEAFQY7O.js +1 -0
- package/dist/kit/{chunk-A6EDU3UT.js → chunk-FHN3PPSI.js} +1 -1
- package/dist/kit/{chunk-FIWIUXNV.js → chunk-FPCCX4FM.js} +1 -1
- package/dist/kit/{chunk-EHYFSX5K.js → chunk-FWODCYYJ.js} +1 -1
- package/dist/kit/{chunk-PZAQLUAS.js → chunk-GBNV3GXG.js} +1 -1
- package/dist/kit/chunk-GF72XM4C.js +1 -0
- package/dist/kit/{chunk-MRDEO5HZ.js → chunk-GKR3ROYR.js} +1 -1
- package/dist/kit/{chunk-D4KCZSIP.js → chunk-H5KHXZWR.js} +1 -1
- package/dist/kit/{chunk-EJ3W4FN6.js → chunk-I5R2347P.js} +1 -1
- package/dist/kit/{chunk-ZYYLWSPY.js → chunk-IBNDCKEX.js} +1 -1
- package/dist/kit/{chunk-A73S2BCE.js → chunk-ILXVBO7M.js} +1 -1
- package/dist/kit/{chunk-QZHZWO7N.js → chunk-JELJEEJO.js} +1 -1
- package/dist/kit/{chunk-XDNCXCR7.js → chunk-K6JX64AS.js} +1 -1
- package/dist/kit/{chunk-2D2SG6FW.js → chunk-KCEYRIU4.js} +1 -1
- package/dist/kit/{chunk-SE6MQQLB.js → chunk-KDROJANO.js} +1 -1
- package/dist/kit/{chunk-ODMQERGZ.js → chunk-KEE55QSD.js} +1 -1
- package/dist/kit/{chunk-YBBYCUFP.js → chunk-KFXMLIVF.js} +1 -1
- package/dist/kit/{chunk-P6S6HSN3.js → chunk-KLRF3S7O.js} +1 -1
- package/dist/kit/{chunk-ANLBW5RI.js → chunk-KXI3T72F.js} +1 -1
- package/dist/kit/{chunk-PDNKLLBI.js → chunk-KY5KCIZE.js} +1 -1
- package/dist/kit/{chunk-PCGRRX5P.js → chunk-LE53AVKR.js} +1 -1
- package/dist/kit/{chunk-MIA6TUQC.js → chunk-LVCGC3SO.js} +1 -1
- package/dist/kit/chunk-M5VVLYI2.js +1 -0
- package/dist/kit/{chunk-KJJJORN6.js → chunk-MJJSZS23.js} +1 -1
- package/dist/kit/{chunk-EPVZIGEZ.js → chunk-MZFK765W.js} +1 -1
- package/dist/kit/{chunk-G4BQYQJ6.js → chunk-NF4WVWAC.js} +1 -1
- package/dist/kit/{chunk-JRSCTMFM.js → chunk-NW4U2YRE.js} +1 -1
- package/dist/kit/chunk-ORSI57T2.js +1 -0
- package/dist/kit/{chunk-GCIZKMJL.js → chunk-QSTDYL35.js} +1 -1
- package/dist/kit/{chunk-B6GZ645M.js → chunk-QVICL57J.js} +1 -1
- package/dist/kit/{chunk-JAM46FF6.js → chunk-RXOPJJC4.js} +1 -1
- package/dist/kit/{chunk-YL2AXWRA.js → chunk-SDSW7422.js} +1 -1
- package/dist/kit/{chunk-WT3XOWAI.js → chunk-TRDA73HN.js} +1 -1
- package/dist/kit/{chunk-VFV7HZ3G.js → chunk-UOYBFLGJ.js} +1 -1
- package/dist/kit/{chunk-EWPT56TR.js → chunk-UVLKCAKH.js} +1 -1
- package/dist/kit/{chunk-EHXSXMBE.js → chunk-VBWG7HQA.js} +1 -1
- package/dist/kit/{chunk-2TQW2PIG.js → chunk-VIUEAEBX.js} +1 -1
- package/dist/kit/{chunk-BBOSHBZK.js → chunk-VV2KP7ZW.js} +1 -1
- package/dist/kit/{chunk-4XT5IKM3.js → chunk-VX2AD3M7.js} +1 -1
- package/dist/kit/{chunk-2KFBIOVS.js → chunk-W4U5CK6L.js} +1 -1
- package/dist/kit/{chunk-6YVZZ3DO.js → chunk-WI2AF2KE.js} +1 -1
- package/dist/kit/{chunk-HMW5NRUV.js → chunk-XUCYFWC3.js} +1 -1
- package/dist/kit/{chunk-V6GEQ5Y5.js → chunk-Z2FRNFMB.js} +1 -1
- package/dist/kit/{chunk-NPJ77LDC.js → chunk-Z3KD6CLE.js} +1 -1
- package/dist/kit/{chunk-ONVONNUH.js → chunk-ZCXNGJGB.js} +1 -1
- package/dist/kit/{chunk-IUX46UDR.js → chunk-ZWZZMU5P.js} +1 -1
- package/dist/kit.cjs +1 -1
- package/dist/kit.d.cts +1 -1
- package/dist/kit.d.ts +1 -1
- package/dist/kit.js +1 -1
- package/dist/studio-worker.js +1 -0
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +1 -1
- package/package.json +2 -1
- package/skills/asciify-engine/SKILL.md +2 -2
- package/skills/asciify-engine/references/performance.md +1 -1
- package/dist/kit/chunk-2JQ4MRIP.js +0 -1
- package/dist/kit/chunk-BJRPY7UB.js +0 -1
- package/dist/kit/chunk-EK4GIXIO.js +0 -1
- package/dist/kit/chunk-PFQBEWCF.js +0 -1
- package/dist/kit/chunk-SAQJAH2I.js +0 -1
- package/dist/kit/chunk-SVXRMHUJ.js +0 -1
- package/dist/kit/chunk-UO4U32P7.js +0 -1
- package/dist/kit/chunk-XVB3B3FV.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{mountSurface as t}from"./chunk-
|
|
1
|
+
import{mountSurface as t}from"./chunk-GF72XM4C.js";var e=class{constructor(t=1,e=3.5,s=!1){this.strokes=[],this.advected=[0,0,0],this.previous=null,this.energy=0,this.continuousWake=s,this.decayRate=e,this.aspect=Math.max(.25,Math.min(4,t));const i=s?96:64;this.columns=this.aspect>=1?i:Math.round(i*this.aspect),this.rows=this.aspect>=1?Math.round(i/this.aspect):i,this.front=new Float32Array(this.columns*this.rows*3),this.back=new Float32Array(this.front.length)}get active(){return this.energy>5e-4||this.strokes.length>0}move(t,e){if(!Number.isFinite(t+e))return;if(this.continuousWake&&!this.previous)return void(this.previous={x:t,y:e});const s=this.previous??{x:t-.004,y:e-.001},i=Math.max(-.09,Math.min(.09,t-s.x)),n=Math.max(-.09,Math.min(.09,e-s.y));if(this.previous={x:t,y:e},Math.abs(i)+Math.abs(n)<1e-4)return;const a=Math.min(1,25*Math.hypot(i*this.aspect,n)+.06);this.strokes.push({x:t,y:e,dx:i,dy:n,speed:a,fromX:s.x,fromY:s.y}),this.strokes.length>12&&this.strokes.shift()}leave(){this.previous=null}clear(){this.front.fill(0),this.back.fill(0),this.strokes.length=0,this.previous=null,this.energy=0}read(t,e,s,i){const n=Math.max(0,Math.min(this.columns-1.001,e*(this.columns-1))),a=Math.max(0,Math.min(this.rows-1.001,s*(this.rows-1))),h=Math.floor(n),o=Math.floor(a),r=n-h,c=a-o,l=3*(o*this.columns+h),m=l+3*this.columns,u=1-r,d=1-c;i[0]=(t[l]*u+t[l+3]*r)*d+(t[m]*u+t[m+3]*r)*c,i[1]=(t[l+1]*u+t[l+4]*r)*d+(t[m+1]*u+t[m+4]*r)*c,i[2]=(t[l+2]*u+t[l+5]*r)*d+(t[m+2]*u+t[m+5]*r)*c}sample(t,e,s){this.read(this.front,t,e,s)}step(t){if(!this.active)return;const e=Math.max(0,Math.min(.05,t)),s=Math.exp(-e*this.decayRate),i=Math.exp(-e*(this.decayRate+.5)),n=Math.max(1,this.aspect),a=Math.max(1,1/this.aspect);let h=0;for(let t=0;t<this.rows;t++)for(let o=0;o<this.columns;o++){const r=3*(t*this.columns+o),c=o/(this.columns-1),l=t/(this.rows-1),m=this.continuousWake?.65:2,u=c-this.front[r]*e*m,d=l-this.front[r+1]*e*m;this.read(this.front,u,d,this.advected);let M=this.advected[0]*s,f=this.advected[1]*s,p=this.advected[2]*i;for(const t of this.strokes){let e=(c-t.x)*n,s=(l-t.y)*a;if(this.continuousWake){const i=(c-t.fromX)*n,h=(l-t.fromY)*a,o=(t.x-t.fromX)*n,r=(t.y-t.fromY)*a,m=Math.max(0,Math.min(1,(i*o+h*r)/(o*o+r*r||1)));e=i-o*m,s=h-r*m;const u=e*e+s*s;if(u>.0225)continue;const d=Math.exp(-u/.0032),v=Math.hypot(t.dx*n,t.dy*a),x=Math.min(.025,.55*v);M+=(4.2*t.dx-s*x)*d,f+=(4.2*t.dy+e*x)*d,p=Math.max(p,Math.min(.7,18*v)*d);continue}const i=e*e+s*s;if(i>.045)continue;const h=Math.exp(-i/.0075),o=t.speed;M+=(2.8*t.dx-s*o*.16)*h,f+=(2.8*t.dy+e*o*.16)*h,p+=o*h*.3}this.back[r]=Math.max(-.18,Math.min(.18,M)),this.back[r+1]=Math.max(-.18,Math.min(.18,f)),this.back[r+2]=Math.min(.8,p),h=Math.max(h,Math.abs(M),Math.abs(f),p)}[this.front,this.back]=[this.back,this.front],this.strokes.length=0,this.energy=h,this.active||this.clear()}};var s=" .:+-=xICA$FY#@",i=.58,n=72649.5/59542.5;var a={id:"fluid",name:"Fluid",description:"Flowing folds with a soft wake behind the cursor. The original Asciify hero.",cellSize:7,speed:1,cursor:!0,opacity:.7,mount:function(a){const{host:h}=a;let o=new e(1),r=1,c=12,l=0,m=!1,u=null;const d=[],M=(t,e)=>((t,e,s)=>Math.max(t,Math.sqrt(e*s*i/26e3)))(a.settings().cellSize,t,e),f=t({host:h,kit:a.kit,layer:"under",look:()=>{const t=a.settings();return{mark:"glyph",charset:t.charset??s,font:'"JetBrains Mono", monospace',fontWeight:400,cellSize:M(h.clientWidth||1,h.clientHeight||1)/i,cellAspect:i,glyphScale:.9,cellFit:"fill",maxPixelRatio:1.5,clear:!!t.clear&&{element:t.clear,padding:8,feather:.22,shape:"ellipse"},color:"ink",shade:0,levels:"none",fit:"cover",gamma:1,contrast:n,brightness:-.0004316244699164449-.5/Math.max(1,Array.from(t.charset??s).length-1),...t.look}},ink:t=>a.ink(t)??"#8f8d86",resolution:(t,e)=>{const s=Math.max(192,Math.min(384,Math.ceil(Math.max(t,e*i)/M(t,e)))),n=t/e;return n>=1?[s,Math.max(1,Math.round(s/n))]:[Math.max(1,Math.round(s*n)),s]},reducedMotion:a.reducedMotion,onFail:()=>a.onFail(),paint:({pen:t,width:s,height:i,w:n,h:M,now:f,still:p})=>{const v=a.settings(),x=l?Math.min(.05,(f-l)/1e3):1/60;l=f,p||(c+=x*v.speed);const g=n/M;if(Math.abs(g-r)>.01&&(o=new e(g),r=g),p||!v.cursor)o.clear(),d.length=0;else{const t=h.getBoundingClientRect();if(t.width&&t.height)for(const e of d)o.move((e.x-t.left)/t.width,(e.y-t.top)/t.height);d.length=0,m&&(o.leave(),m=!1),o.step(x)}u&&u.width===s&&u.height===i||(u=t.createImageData(s,i));const y=u.data;!function(t,e,s,i,n,a){const h=[0,0,0],o=a.active;for(let r=0;r<s;r++)for(let c=0;c<e;c++){const l=c/e,m=r/s;o&&a.sample(l,m,h);const u=(l-.5-h[0])*i,d=m-.5-h[1],M=u+.22*Math.sin(5.2*d+.17*n)+.15*Math.sin(2.4*u-3.1*d-.1*n),f=d+.19*Math.sin(3.5*u+.13*n),p=Math.hypot(.8*M+.18,1.1*f),v=.5+.5*Math.sin(14*p-2.8*M+1.4*Math.sin(5*f)-.24*n),x=.5+.5*Math.sin(3.6*M-2.9*f+.09*n),g=Math.max(0,Math.min(1,v*v*(.48+.32*x)-.075+.75*h[2])),y=Math.round(255*g),k=4*(r*e+c);t[k]=t[k+1]=t[k+2]=y,t[k+3]=255}}(y,s,i,g,c,o);for(let t=0;t<y.length;t+=4){const e=y[t]<10?0:Math.min(255,1.45*y[t]);y[t]=y[t+1]=y[t+2]=.299*e+e*(185/232)*.587,y[t+3]=255}return t.putImageData(u,0,0),!0}});if(!f)return null;const p=t=>{if(t.target instanceof Element&&t.target.closest("button, a, input, select, summary, textarea"))return m=!0,void f.kick();d.push({x:t.clientX,y:t.clientY}),d.length>6&&d.shift(),f.kick()},v=()=>{m=!0,f.kick()};return h.addEventListener("pointermove",p),h.addEventListener("pointerdown",p),h.addEventListener("pointerleave",v),h.addEventListener("pointercancel",v),{get field(){return f.field},get canvas(){return f.canvas},refresh:()=>f.refresh(),play:()=>{l=0,f.play()},pause:()=>f.pause(),destroy(){h.removeEventListener("pointermove",p),h.removeEventListener("pointerdown",p),h.removeEventListener("pointerleave",v),h.removeEventListener("pointercancel",v),f.destroy()}}}};export{a as fluid};//# sourceMappingURL=chunk-UOYBFLGJ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parseColor as t}from"./chunk-ZCHGV2CV.js";import{mountCanvas as o}from"./chunk-
|
|
1
|
+
import{parseColor as t}from"./chunk-ZCHGV2CV.js";import{mountCanvas as o}from"./chunk-3OD5BMF5.js";import{mixHex as e}from"./chunk-GF72XM4C.js";function n(o,e,n,a,r={}){const{fontSize:i=13,chars:l=" .,:;i+xX#&@",color:h="#ff4500",hotColor:f="#ffe066",intensity:c=.85,wind:s=0,speed:m=1,lightMode:M=!1}=r,p=.62*i,d=1.4*i,g=Math.ceil(e/p),u=Math.ceil(n/d),b=g*u,x="__fire_heat__",k=o.canvas;let A=k[x];A&&A.length===b||(A=new Float32Array(b),k[x]=A);const C=.18*(.016*m),F=s*m*.8,S=u-1,_=a*m;for(let t=0;t<g;t++){const o=(.6*(.5*Math.sin(.31*t+4.1*_)+.5)+.4*(.5*Math.sin(.73*t-2.7*_)+.5))*c;A[S*g+t]=Math.min(1,o+.15*Math.random()*c),S>0&&(A[(S-1)*g+t]=Math.min(1,.85*o+.1*Math.random()*c))}const y=new Float32Array(b);for(let t=0;t<u-2;t++)for(let o=0;o<g;o++){const e=.4*A[(t+1)*g+o]+.25*A[(t+2)*g+Math.max(0,Math.min(g-1,o+Math.round(F)))]+.175*A[(t+1)*g+Math.max(0,o-1)]+.175*A[(t+1)*g+Math.min(g-1,o+1)];y[t*g+o]=Math.max(0,e-C-.02*Math.random()*m)}for(let t=0;t<g;t++)y[(u-1)*g+t]=A[(u-1)*g+t],u>1&&(y[(u-2)*g+t]=A[(u-2)*g+t]);k[x]=y;const z=t(h)??{r:255,g:69,b:0},$=t(f)??{r:255,g:224,b:102};o.clearRect(0,0,e,n),o.font=`${i}px "JetBrains Mono", monospace`,o.textBaseline="top";for(let t=0;t<u;t++)for(let e=0;e<g;e++){const n=y[t*g+e];if(n<.03)continue;const a=l[Math.min(l.length-1,Math.floor(n*l.length))];if(" "===a)continue;const r=Math.min(1,1.2*n),i=z.r+($.r-z.r)*r|0,h=z.g+($.g-z.g)*r|0,f=z.b+($.b-z.b)*r|0,c=M?1-.3*n:Math.min(1,n+.15);o.globalAlpha=c,o.fillStyle=`rgb(${i},${h},${f})`,o.fillText(a,e*p,t*d)}o.globalAlpha=1}var a={id:"fire",name:"Fire",description:"A cellular flame rising from the bottom edge.",cellSize:13,speed:1,cursor:!1,mount:t=>o(t,(t,o,a,r,i,l)=>n(t,o,a,l.elapsed,{fontSize:l.fontSize,chars:l.chars,color:l.ink,hotColor:l.accent??e(l.ink,"#ffffff",.6),speed:l.speed}),48)};export{a as fire,n as renderFireBackground};//# sourceMappingURL=chunk-UVLKCAKH.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{mountSurface as t,house as e,styleKeeper as n,handle as r,clamp as o}from"./chunk-
|
|
1
|
+
import{mountSurface as t,house as e,styleKeeper as n,handle as r,clamp as o}from"./chunk-GF72XM4C.js";var l={values:[],duration:560},a=.46,i=(t,e)=>e?Math.min(e-1,Math.max(0,Math.floor(t*e))):-1;function c(t,e){if(!e)return{bar:0,gap:0,left:0};const n=e<=7?.5:.6;let r=Math.max(1,Math.floor(t/e));for(;r>1&&e*r+(e-1)*Math.max(1,Math.round(r*n))>t;)r--;const o=e>1?Math.max(0,Math.min(Math.ceil(r*n*1.6),Math.floor((t-e*r)/(e-1)))):0;return{bar:r,gap:o,left:Math.max(0,Math.floor((t-e*r-(e-1)*o)/2))}}function s(s,h={}){const u={current:{...l,...h}};let d=u.current.values,m=null,f=[],p=0,M=!1,x=null,g=!1===u.current.intro?-1e9:performance.now(),v=[],b=[],w=[],k={cols:0,rows:0};const y=()=>u.current.values??[],E=()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:7,cellAspect:1,glyphScale:1.1,shade:.5,blend:"off",...u.current.look}),A=(t,e)=>{const{cellSize:n=7,maxPixelRatio:r=2}=E(),o=Math.min("number"==typeof devicePixelRatio&&devicePixelRatio>0?devicePixelRatio:1,r),l=Math.max(2,Math.round(n*o)),a=l/o,i=t=>{const e=Math.max(1,Math.floor(t*o/l));for(let t=e;t>1&&t>e-8;t--)if(Math.abs(t*a-Math.round(t*a))<.01)return t;return e},c=i(t),s=Math.max(2,i(e));return{cols:c,rows:s,cell:a,gw:Math.round(c*a),gh:Math.round(s*a)}};let L={left:0,cell:0};const C=(t,e)=>null===m?t===e-1?.8:a:t===m?.8:.3,$=(t,n)=>e((n-g-(b[t]??0))/u.current.duration),S=(t,e,n,r)=>{const l=((t,e,n,r)=>{const{bar:l,gap:a,left:i}=c(n,e.length),s=u.current.max??1.04*Math.max(...e,0),h=s>0?o(Math.max(0,e[t])/s)*(r-1):0,d=i+t*(l+a);return{x0:d,x1:d+l,h:h>0?Math.max(1,Math.round(h)):0}})(t,e,k.cols,k.rows);if(r)return l;const a=v[t]??{...l,h:0},i=$(t,n);return{x0:a.x0+(l.x0-a.x0)*i,x1:a.x1+(l.x1-a.x1)*i,h:a.h+(l.h-a.h)*i}};x=t({host:s,look:E,ink:()=>u.current.ink??"--ascii-ink-strong",kit:u,reducedMotion:()=>u.current.reducedMotion,resolution:(t,e)=>{const{cell:n}=A(t,e);return[Math.max(2,2*Math.round(t/n)),Math.max(4,2*Math.round(e/n))]},onFail:()=>{x=null},paint:({pen:t,width:n,height:r,now:l,still:i})=>{const c=(()=>{const t=x?.canvas;if(!t||!s.offsetWidth)return!1;const{gw:e,gh:n,cell:r}=A(s.offsetWidth,s.offsetHeight),o=Math.round((s.offsetWidth-e)/2),l=[`${o}px`,s.offsetHeight-n+"px",`${e}px`,`${n}px`];L={left:o,cell:r};let a=!1;return["left","top","width","height"].forEach((e,n)=>{t.style[e]!==l[n]&&(t.style[e]=l[n],a=!0)}),a&&x?.field.resize(),a})(),h=n/2,d=r/2;k={cols:h,rows:d};const m=y(),M=m.length,v=p?Math.min(64,l-p):16;p=l;const b=new Float32Array(h*d),E=(t,e,n)=>{const r=(d-1-e)*h+t;n>b[r]&&(b[r]=n)};for(let t=0;t<h;t++)E(t,0,.16);const R=({x0:t,x1:e,h:n},r)=>{if(n<=.01)return;const l=Math.ceil(n)-1;for(let a=Math.max(0,Math.floor(t));a<Math.min(h,Math.ceil(e));a++){const i=o(Math.min(a+1,e)-Math.max(a,t));for(let t=0;t<=l&&t<d-1;t++)E(a,t+1,(t===l?Math.min(1,r+.2):r)*i*o(n-t))}};let F=!1;const H=i?1:e((l-g)/u.current.duration);H<1&&(F=!0);for(const t of w)R({...t,h:t.h*(1-H)},a);H>=1&&(w=[]);for(let t=0;t<M;t++){!i&&$(t,l)<1&&(F=!0);const e=C(t,M),n=f[t]??e;f[t]=i?e:n+(e-n)*(1-Math.exp(-v/70)),Math.abs(f[t]-e)>.004&&(F=!0),R(S(t,m,l,i),f[t])}for(let e=0;e<b.length;e++){if(b[e]<=0)continue;const n=Math.round(255*b[e]);t.fillStyle=`rgb(${n} ${n} ${n})`,t.fillRect(e%h*2,2*Math.floor(e/h),2,2)}return c&&i&&x?.kick(),F||c}});const R=n(),F=x?null:document.createElement("div"),H=()=>{if(!F)return;const t=y(),e=t.length,n=u.current.max??1.04*Math.max(...t,0);F.replaceChildren(...t.map((t,r)=>{const l=document.createElement("div");return l.setAttribute("style",`flex:1 1 0;height:${n>0?(100*o(t/n)).toFixed(2):0}%;margin:0 ${e<=7?22:18}%;background:currentColor;opacity:${.9*(.16+.84*C(r,e))}`),l}))};F&&("static"===getComputedStyle(s).position&&R.set(s,"position","relative"),F.setAttribute("aria-hidden","true"),F.setAttribute("style","position:absolute;inset:0;display:flex;align-items:flex-end;pointer-events:none"),s.appendChild(F));const I=document.createElement("table");I.setAttribute("style","position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0");const P=()=>{const t=u.current.format??(t=>t.toLocaleString()),e=u.current.labels??[],n=document.createElement("tbody");y().forEach((r,o)=>{const l=document.createElement("tr"),a=document.createElement("th"),i=document.createElement("td");a.setAttribute("scope","row"),a.setAttribute("style","font-weight:inherit"),a.textContent=e[o]??String(o+1),i.textContent=t(r),l.appendChild(a),l.appendChild(i),n.appendChild(l)}),I.replaceChildren(n)};P(),s.appendChild(I);const W=!s.hasAttribute("tabindex"),z=!s.hasAttribute("role");W&&(s.tabIndex=0),z&&s.setAttribute("role","group");const X=t=>{const e=y().length,n=null!==t&&e?Math.min(e-1,Math.max(0,Math.round(t))):null;n!==m&&(m=n,x?.kick(),H(),u.current.onHover?.(m,null===m?null:y()[m],null===m?null:u.current.labels?.[m]??null))},G=t=>u.current.stagger??(t<=7?45:12),O=(t,n)=>{const r=y(),o=u.current.labels,l=performance.now(),i=!!x?.still(),c=k.cols&&!i?t.map((e,n)=>S(n,t,l,!1)):[],s=i?[]:w.map(t=>({...t,h:t.h*(1-e((l-g)/u.current.duration))})),h=new Map,m=(t,e,r)=>o&&n?r?.[t]??`#${t}`:"#"+(e-1-t);t.forEach((e,r)=>h.set(m(r,t.length,n),r));const p=new Set,M=f;let E=0;const A=r.length;v=r.map((t,e)=>{const n=h.get(m(e,A,o));return void 0!==n&&c[n]?(p.add(n),c[n]):null}),f=r.map((t,e)=>{const n=h.get(m(e,A,o));return void 0!==n?M[n]??a:a}),b=v.map(t=>t?0:E++*G(A)*.6),w=[...s,...c.filter((t,e)=>!p.has(e))].filter(t=>t.h>.01),d=r,g=l,x?.kick(),H()};H();const j=t=>{const e=s.getBoundingClientRect(),n=y().length;if(!e.width)return;const r=(t.clientX-e.left)/e.width,o=t.clientY-e.top;if(r<0||r>1||o<0||o>e.height)return void X(null);if(!k.cols)return void X(i(r,n));const{bar:l,gap:a,left:h}=c(k.cols,n);X(Math.round(((t.clientX-e.left-L.left)/L.cell-h-l/2)/Math.max(1,l+a)))},B=()=>X(null),D=t=>{const e=y().length,n="ArrowRight"===t.key?null===m?0:Math.min(e-1,m+1):"ArrowLeft"===t.key?null===m?e-1:Math.max(0,m-1):"Home"===t.key?0:"End"===t.key?e-1:"Escape"===t.key?null:void 0;void 0!==n&&e&&(t.preventDefault(),X(n))};s.addEventListener("pointermove",j),s.addEventListener("pointerdown",j),s.addEventListener("pointerleave",B),s.addEventListener("pointercancel",B),s.addEventListener("keydown",D),s.addEventListener("blur",B);const Y="function"==typeof IntersectionObserver?new IntersectionObserver(([t])=>{t?.isIntersecting&&!M&&(M=!0,!1!==u.current.intro&&(()=>{const t=y().length;d=y(),g=performance.now(),v=[],w=[],b=Array.from({length:t},(e,n)=>n*G(t)),f=y().map((t,e,n)=>C(e,n.length)),x?.kick(),H()})())},{threshold:.4}):null;Y?.observe(s);let q=u.current.labels;return r(()=>x,u,t=>{P(),t.values!==d&&(O(d,q),q=t.labels),x?.refresh()},{set(t,e){const n=d,r=q;u.current={...u.current,values:[...t],...e?{labels:[...e]}:{}},q=u.current.labels,null!==m&&m>=t.length&&X(null),P(),O(n,r)},highlight:X,get active(){return m},get values(){return y()}},()=>{Y?.disconnect(),I.remove(),F?.remove(),R.restore(),s.removeEventListener("pointermove",j),s.removeEventListener("pointerdown",j),s.removeEventListener("pointerleave",B),s.removeEventListener("pointercancel",B),s.removeEventListener("keydown",D),s.removeEventListener("blur",B),W&&s.removeAttribute("tabindex"),z&&s.removeAttribute("role")})}var h=l;export{h as BLOCK_CHART_DEFAULTS,i as barAt,c as barLayout,s as blockChart};//# sourceMappingURL=chunk-VBWG7HQA.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{injectStyle as e}from"./chunk-
|
|
1
|
+
import{injectStyle as e}from"./chunk-LE53AVKR.js";import{mountSurface as t,hash as n,handle as r,prefersReduced as i,clamp as o,house as a,smoothstep as s}from"./chunk-GF72XM4C.js";var l={caret:!0,settle:60,stagger:18,reasoningLines:2,transition:"flicker",roll:300,glyphs:"#%*+=-:"},c="cubic-bezier(.16, 1, .3, 1)",d=`\n:where(.ascii-reasoning){display:grid;grid-template-rows:1fr;transition:grid-template-rows 260ms ${c},opacity 200ms ${c}}\n:where(.ascii-reasoning[data-collapsed]){grid-template-rows:0fr;opacity:0}\n:where(.ascii-reasoning-in){min-height:0;overflow:hidden}\n:where(.ascii-reasoning ol){height:calc(var(--ascii-reasoning-lines, 2) * 1.5em);margin:0 0 .5em;padding:0;list-style:none;overflow:hidden;-webkit-mask-image:linear-gradient(to bottom,transparent,#000 45%);mask-image:linear-gradient(to bottom,transparent,#000 45%)}\n:where(.ascii-reasoning li){height:1.5em;line-height:1.5em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;opacity:.62;translate:0 calc(var(--ascii-reasoning-shift, 0) * -1.5em);transition:translate 240ms ${c},opacity 200ms ${c}}\n:where(.ascii-reasoning li[data-new]){opacity:0}\n@media (prefers-reduced-motion: reduce){:where(.ascii-reasoning, .ascii-reasoning li){transition:none}}\n`,p=.7,h=e=>[...e.children].filter(e=>"IMG"===e.tagName&&void 0!==e.dataset?.asciiPoster);function u(c,u={}){const m={current:{...l,...u}},g=[...c.childNodes];let f="idle",y="",x=[],w=null,v=0,b=null,k=null,M=null;const S=()=>{const e=getComputedStyle(c),t=parseFloat(e.fontSize)||15,n=parseFloat(e.lineHeight),r=Number.isFinite(n)&&n>0?n:1.5*t;return{size:t,line:r,ch:r/2,cw:Math.max(2,Math.round(.44*t))}},C="roll"===m.current.transition;let A=null,$=null;const E=e=>{f!==e&&(f=e,"done"!==e&&"stopped"!==e||(A?.setAttribute("data-collapsed",""),A?.setAttribute("aria-hidden","true")),"streaming"===e?c.setAttribute("aria-busy","true"):c.removeAttribute("aria-busy"),m.current.onState?.(e))},P=e=>{e.span.style.removeProperty("color"),e.span.style.removeProperty("opacity")},F=()=>{x.forEach(P),x=[],"streaming"===f&&b&&E("done"),b?.(),b=null};if(M=t({host:c,look:()=>{if(C){return{mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:S().size<24?2:3,cellAspect:.66,glyphScale:1,shade:.2,contrast:1.1,...m.current.look}}const{ch:e,cw:t}=S();return{mark:"glyph",charset:" :-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:e,cellAspect:t/e,glyphScale:1,shade:.6,...m.current.look}},ink:()=>m.current.ink??getComputedStyle(c).color,kit:m,reducedMotion:()=>m.current.reducedMotion,onFail:()=>{M=null,F()},resolution:C?2:1,paint:({pen:e,now:t,still:r,box:i,scale:l})=>{if(C)return((e,t,r,i,l)=>{const d=getComputedStyle(c),p=parseFloat(d.fontSize)||15,{line:h}=S(),u=`${d.fontStyle} ${d.fontWeight} ${d.fontSize} ${d.fontFamily}`;e.setTransform(l,0,0,l,0,0),e.textAlign="left",e.textBaseline="alphabetic",e.font=u;const g=e.measureText("x"),y=g.fontBoundingBoxAscent||.8*p,v=g.fontBoundingBoxDescent||.2*p;r&&(x.forEach(P),x=[]);const k=m.current;if(x=x.filter(r=>{if(t>=r.at)return P(r),!1;const l=o((t-r.from)/Math.max(1,r.at-r.from)),c=a(l),d=i(r.span);if(r.span.style.setProperty("opacity",s(.72,1,l).toFixed(3)),l<=0)return!0;const m=d.y+(d.h-h)/2,g=m+(h-y-v)/2+y,f=3+r.seed%3,x=[...Array.from({length:f},(e,t)=>k.glyphs[Math.floor(n(t,r.seed)*k.glyphs.length)]??""),r.span.textContent??""],w=(1-c)*(x.length-1)*h;return e.save(),e.beginPath(),e.rect(d.x-2,m,d.w+4,h),e.clip(),e.globalAlpha=1-s(.72,1,l),x.forEach((t,n)=>{const r=g+(n-(x.length-1))*h+w;if(r<m-h||r>m+2*h)return;const i=n===x.length-1;e.font=i?u:`600 ${.84*p}px "Geist Mono", ui-monospace, monospace`,e.fillStyle=i?"#fff":"#d0d0d0",e.fillText(t,d.x+(i?0:(d.w-e.measureText(t).width)/2),r)}),e.restore(),!0}),e.globalAlpha=1,!x.length&&b&&F(),k.caret&&"idle"!==f&&(w||"streaming"===f)){const n=x.find(e=>e.from>t),r=n?n.span.previousElementSibling:w,o=r?i(r):{x:0,y:0,w:0,h:h},a=o.y+(o.h-h)/2;e.fillStyle="streaming"===f?"#fff":"rgb(178.5 178.5 178.5)",e.fillRect(o.x+o.w+.18*p,a+.2*h,Math.max(2,.5*p),.6*h)}return x.length>0})(e,t,r,i,l);const{line:d,ch:h,cw:u,size:g}=S(),y=Math.floor(t/48),v=d/4,k=(t,n)=>{const r=Math.floor((t.y-v+t.h/2)/d)*d+v+(d-h)/2,i=Math.round(t.x/u),o=Math.round(255*n);e.fillStyle=`rgb(${o} ${o} ${o})`,e.fillRect(i*u,r,Math.max(1,Math.round((t.x+t.w)/u)-i)*u,h)};if(r&&(x.forEach(P),x=[]),x=x.filter(e=>t>=e.at?(P(e),!1):(k(i(e.span),.55+.45*n(y,e.seed)),!0)),!x.length&&b&&F(),m.current.caret&&"idle"!==f&&(w||"streaming"===f)){const e=w?i(w):{x:0,y:v,w:0,h:d},t=Math.round((e.x+e.w+.3*g)/u)*u;k({x:t,y:e.y,w:u,h:e.h},"streaming"===f?1:p)}return x.length>0}}),M){const e=getComputedStyle(c),t=M.canvas.style,n=e=>parseFloat(e??"")||0,{line:r}=S(),i=n(e.paddingTop)-r/4,o=n(e.paddingRight)-r/2,a=n(e.paddingBottom)-r/4,s=n(e.paddingLeft);t.top=`${i}px`,t.left=`${s}px`,t.width=`calc(100% - ${s+o}px)`,t.height=`calc(100% - ${i+a}px)`}return r(()=>M,m,()=>M?.refresh(),{write:e=>{if(!e)return;"streaming"!==f&&("idle"===f&&(c.replaceChildren(...h(c)),M&&c.appendChild(M.canvas)),k=null,E("streaming")),y+=e;const t=e=>c.appendChild(e);if(!M)return void t(document.createTextNode(e));const n=performance.now(),r=m.current,i=M.still();let o=0;for(const a of e.match(/\s+|\S/g)??[]){if(/^\s/.test(a)){t(document.createTextNode(a));continue}const e=document.createElement("span");if(e.textContent=a,!i)if(C){const t=x.length?x[x.length-1].from+r.stagger:n,i=Math.max(n,t);e.style.setProperty("opacity","0"),x.push({span:e,from:i,at:i+r.roll,seed:31*v+o})}else e.style.setProperty("color","transparent"),x.push({span:e,from:n,at:n+r.settle+o*r.stagger,seed:31*v+o});t(e),w=e,o++}v++,M.kick()},done:()=>k||("streaming"!==f?Promise.resolve():(k=new Promise(e=>{b=e}),M&&x.length?M.kick():F(),k)),stop(){if("idle"===f&&A)return k=null,E("stopped"),void M?.kick();"streaming"===f&&(x.forEach(P),x=[],E("stopped"),b?.(),b=null,M?.kick())},reasoning:t=>{if(!t||"undefined"==typeof document)return;if(!A||!$){e("ascii-kit-reasoning",d),A=document.createElement("div"),A.className="ascii-reasoning";const t=document.createElement("div");t.className="ascii-reasoning-in",$=document.createElement("ol"),t.appendChild($),A.appendChild(t),c.parentElement?.insertBefore(A,c)}A.removeAttribute("data-collapsed"),A.removeAttribute("aria-hidden");const n=Math.max(1,Math.round(m.current.reasoningLines));A.style.setProperty("--ascii-reasoning-lines",String(n));const r=document.createElement("li");r.textContent=t;const o=m.current.reducedMotion??i();o||r.setAttribute("data-new",""),$.appendChild(r);const a=A,s=String(Math.max(0,$.children.length-n));o?a.style.setProperty("--ascii-reasoning-shift",s):(getComputedStyle(r).translate,requestAnimationFrame(()=>{r.removeAttribute("data-new"),a.style.setProperty("--ascii-reasoning-shift",s)}))},reset(){x=[],y="",w=null,v=0,A?.remove(),A=$=null,b?.(),b=null,k=null,c.replaceChildren(...h(c)),M&&c.appendChild(M.canvas),E("idle"),M?.kick()},get state(){return f},get text(){return y}},()=>{b?.(),b=null,A?.remove(),A=$=null,c.removeAttribute("aria-busy"),y?c.textContent=y:c.replaceChildren(...g)})}var m=l;export{m as STREAM_TEXT_DEFAULTS,u as streamText};//# sourceMappingURL=chunk-VIUEAEBX.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{styleKeeper as t,mountSurface as e,handle as n,hash as r,house as o}from"./chunk-
|
|
1
|
+
import{styleKeeper as t,mountSurface as e,handle as n,hash as r,house as o}from"./chunk-GF72XM4C.js";var a={duration:800,trigger:"visible",replayOnHover:!0,settle:"glyphs"};function i(t,e,n=.82){const o=t.getContext("2d");if(!o)return;const a=t.width,i=t.height,l=o.createImageData(a,i),c=t=>t*t*(3-2*t),s=(t,e)=>{const n=Math.floor(t),o=Math.floor(e),a=c(t-n),i=c(e-o),l=r(n,o),s=r(n+1,o),f=r(n,o+1);return l+(s-l)*a+(f-l)*i+(l-s-f+r(n+1,o+1))*a*i};for(let t=0;t<i;t++)for(let r=0;r<a;r++){const o=.6*s(r/6+2.4*e,t/3.5-.8*e)+.4*s(r/2.5-3*e,t/2),c=Math.min(1,2.4*(1-Math.hypot(2*(r/a-.5),2*(t/i-.5))*n)),f=.72*Math.max(0,o-.42)*Math.max(0,c)*255,g=4*(t*a+r);l.data[g]=l.data[g+1]=l.data[g+2]=f,l.data[g+3]=255}o.putImageData(l,0,0)}function l(l,c={}){const s={current:{...a,...c}},f=t(),g=document.createElement("canvas"),d=document.createElement("canvas");let h=-1,p="",u=!1,m=!1,x=null;const v=(t,e)=>{const n=`${t}x${e}:${s.current.text??""}:${l.textContent}`;if(n===p)return;p=n,g.width=t,g.height=e;const r=g.getContext("2d");r.fillStyle="#000",r.fillRect(0,0,t,e),void 0!==s.current.text?function(t,e,n,r,o){const a=getComputedStyle(e),i=n.split("\n");t.fillStyle="#fff",t.textAlign="center",t.textBaseline="middle";const l=(parseFloat(a.letterSpacing)||0)/(parseFloat(a.fontSize)||16),c=e=>{"letterSpacing"in t&&(t.letterSpacing=l*e+"px")};t.font=`${a.fontWeight} 100px ${a.fontFamily}`,c(0);const s=Math.max(1,...i.map(e=>t.measureText(e).width)),f=Math.min(.94*r/s*100,.9*o/i.length);t.font=`${a.fontWeight} ${f}px ${a.fontFamily}`,c(f),i.forEach((e,n)=>t.fillText(e,r/2,o/2+(n-(i.length-1)/2)*f*1.04))}(r,l,s.current.text,t,e):function(t,e,n,r){const o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),a=document.createRange();t.fillStyle="#fff",t.textAlign="left",t.textBaseline="alphabetic";for(let e=o.nextNode();e;e=o.nextNode()){const o=e.parentElement;if(!o)continue;const i=getComputedStyle(o);t.font=`${i.fontStyle} ${i.fontWeight} ${parseFloat(i.fontSize)*r}px ${i.fontFamily}`,"letterSpacing"in t&&(t.letterSpacing=(parseFloat(i.letterSpacing)||0)*r+"px");const l=t.measureText("Hg"),c=l.fontBoundingBoxAscent||parseFloat(i.fontSize)*r*.8,s=l.fontBoundingBoxDescent||parseFloat(i.fontSize)*r*.2,f="uppercase"===i.textTransform?t=>t.toUpperCase():"lowercase"===i.textTransform?t=>t.toLowerCase():t=>t;for(const o of e.data.matchAll(/\S+/g)){a.setStart(e,o.index),a.setEnd(e,o.index+o[0].length);const i=a.getClientRects()[0];if(!i)continue;const l=(i.top-n.top)*r,g=i.height*r;t.fillText(f(o[0]),(i.left-n.left)*r,l+(g-c-s)/2+c)}}a.detach?.()}(r,l,l.getBoundingClientRect(),t/(l.getBoundingClientRect().width||1))};x=e({host:l,look:()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:4.5,cellAspect:.62,glyphScale:.92,contrast:1.35,hover:"trail",trail:{strength:.6,radius:.2},...s.current.look}),ink:()=>s.current.ink??getComputedStyle(l).color,kit:s,reducedMotion:()=>s.current.reducedMotion,resolution:2,onFail:()=>{x=null,f.restore()},paint:({pen:t,width:e,height:n,now:a,still:l})=>{v(e,n);const c=s.current,f="text"===c.settle;if(h<0||l)return!(!m&&"visible"===c.trigger&&!l)&&(f&&h>=0||t.drawImage(g,0,0),h>=0&&S(),!1);const p=a-h,x=.3*c.duration,w=.7*c.duration,y=Math.max(2,Math.ceil(e/20)),M=Math.max(2,Math.ceil(n/20));if(d.width===y&&d.height===M||(d.width=y,d.height=M),i(d,p/1e3),t.imageSmoothingEnabled=!0,p<x)return t.drawImage(d,0,0,e,n),u&&(t.globalAlpha=1-o(p/x),t.drawImage(g,0,0),t.globalAlpha=1),!0;const b=Math.min(1,(p-x)/w),E=(1.18*b-.02)*e,k=.14*e,I=5.58,$=Math.floor(a/16);if(b>=1)return f||t.drawImage(g,0,0),S(),!1;t.drawImage(d,0,0,e,n),E>0&&t.drawImage(g,0,0,E,n,0,0,E,n);for(let e=Math.max(0,Math.floor(E/I)*I);e<E+k;e+=I){const o=(e-E)/k;for(let a=0;a<n;a+=9)r(e+13*$,a)<o||(t.globalAlpha=.35+.65*r(a+7*$,e),t.fillStyle="#000",t.fillRect(e,a,I,9),t.drawImage(g,e,a,I,9,e,a,I,9))}return t.globalAlpha=1,!0}});const S=()=>{h=-1,u="text"!==s.current.settle,u||f.restore()},w=()=>{x&&(f.set(l,"-webkit-text-fill-color","transparent"),m=!0,h=performance.now(),x.kick())};let y=!1;const M=x&&"visible"===s.current.trigger&&"function"==typeof IntersectionObserver?new IntersectionObserver(([t])=>{t.isIntersecting&&!y&&w(),y=t.isIntersecting},{threshold:.5}):null;x&&("text"!==s.current.settle&&f.set(l,"-webkit-text-fill-color","transparent"),u="text"!==s.current.settle&&"manual"===s.current.trigger,M?M.observe(l):"visible"===s.current.trigger&&w());let b=!1;const E=()=>{b||(b=!0,s.current.replayOnHover&&h<0&&w())},k=()=>{b=!1},I=t=>{!b||t.target instanceof Node&&l.contains(t.target)||(b=!1)};return x&&(l.addEventListener("pointerenter",E),l.addEventListener("pointermove",E),l.addEventListener("pointerleave",k),document.addEventListener("pointermove",I,!0)),x&&document.fonts?.ready.then(()=>{p="",x?.kick()}),n(()=>x,s,()=>{p="",x?.refresh()},{replay:w},()=>{M?.disconnect(),l.removeEventListener("pointerenter",E),l.removeEventListener("pointermove",E),l.removeEventListener("pointerleave",k),document.removeEventListener("pointermove",I,!0),f.restore()})}var c=a;export{c as DECODE_DEFAULTS,l as decode,i as driftNoise};//# sourceMappingURL=chunk-VV2KP7ZW.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{injectStyle as e}from"./chunk-
|
|
1
|
+
import{injectStyle as e}from"./chunk-LE53AVKR.js";import{drawBlocks as t,snapshot as n,blocksOf as r,BLOCK_W as o,BLOCK_H as s}from"./chunk-Z2FRNFMB.js";import{styleKeeper as i,mountSurface as a,house as c,clamp as l,handle as u,hash as d,boxIn as f,prefersReduced as p}from"./chunk-GF72XM4C.js";var h={input:"input",rows:'[role="option"]',hotkey:"k",manage:!0,closeOnRun:!0,highlight:!0,ai:"[data-ai]"},m=200,g=3600,y=40,v="cubic-bezier(.16, 1, .3, 1)",x=`\n:where([data-ascii-cmd-highlight]){position:absolute;left:0;top:0;z-index:-1;pointer-events:none;opacity:0;background:var(--ascii-cmd-highlight,color-mix(in oklab,currentColor 7%,transparent));transition:translate 240ms ${v},width 240ms ${v},height 240ms ${v},opacity 160ms ${v}}\n:where([data-ascii-cmd-highlight][data-on]){opacity:1}\n@media (prefers-reduced-motion:reduce){:where([data-ascii-cmd-highlight]){transition:none}}\n`;function k(k,w={}){const b={current:{...h,...w}},E=i(),$=()=>[...k.querySelectorAll(b.current.rows)],M=()=>k.querySelector(b.current.input),A=i();let L=b.current.open??!k.hasAttribute("hidden"),C=0,S=null,T=!1,O=0,R=null,W=[],H=null,F=0,z=0;const D=new WeakMap,P=()=>!!(b.current.reducedMotion??p());e("ascii-kit-command",x),"static"===getComputedStyle(k).position&&A.set(k,"position","relative"),A.set(k,"isolation","isolate");const K=document.createElement("div");K.setAttribute("aria-hidden","true"),K.dataset.asciiCmdHighlight="",b.current.highlight&&k.insertBefore(K,k.firstElementChild);const j=e=>{if(void 0===e.offsetParent)return f(k,e);let t=0,n=0;for(let r=e;r&&r!==k;r=r.offsetParent)t+=r.offsetLeft,n+=r.offsetTop;for(let r=e.parentElement;r&&r!==k;r=r.parentElement)t-=r.scrollLeft,n-=r.scrollTop;return{x:t,y:n,w:e.offsetWidth,h:e.offsetHeight}},N=e=>{const t=$()[C];if(!K.parentElement)return;if(!t||!L)return void delete K.dataset.on;const n=j(t),r=!e||void 0===K.dataset.on||P();r&&(K.style.transition="none"),K.style.translate=`${n.x}px ${n.y}px`,K.style.width=`${n.w}px`,K.style.height=`${n.h}px`,K.style.borderRadius=getComputedStyle(t).borderTopLeftRadius,K.dataset.on="",r&&(K.offsetWidth,K.style.removeProperty("transition"))};let q=null;const B=i();R=a({host:k,layer:"under",look:()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:5,cellAspect:.62,glyphScale:.92,...b.current.look}),ink:()=>b.current.ink??"--ascii-ink-strong",kit:b,reducedMotion:()=>b.current.reducedMotion,resolution:2,onFail:()=>{R=null},paint:({pen:e,now:i,still:a,box:u})=>{if(e.setTransform(2,0,0,2,0,0),S){const n=S,r=(i-n.start)/(n.closing?m:260);if(!(r>=1||a)){const o=n.closing?1-1.02*c(r):1.04*c(r);return t(e,n.snap,n.blocks,n.order,o,(e,t)=>[(n.ox-e.x)*t*.9,(n.oy-e.y)*t*.9],n.closing?1:1-l((r-.72)/.28),.4),!0}S=null}if(!L||T)return!1;let f=!1;W=W.filter(n=>{const r=(i-n.start)/280;return(r>=.7||a)&&n.styles.restore(),r>=1||a||!k.contains(n.row)?(n.styles.restore(),!1):(f=!0,r>0&&t(e,n.snap,n.blocks,n.order,1.04*c(r),(e,t)=>[14*t,0],1-l((r-.7)/.3),.42),!0)});const p=$()[C];if(p&&!a&&p.matches(b.current.ai)){p!==H&&(H=p,F=i+160);const t=i-F,a=t>=0?t%g/1100:-1;if(a>=0&&a<1&&!W.some(e=>e.row===p))((e,t,i,a,c)=>{const l=R,u=`${t.textContent}|${i.x}|${i.y}|${i.w}`;if(q?.row!==t||q.key!==u){const e=n(t,l.box,l.canvas.clientWidth||k.offsetWidth,l.canvas.clientHeight||k.offsetHeight,2);q={row:t,key:u,snap:e,blocks:r(e,2)}}const f=i.x-y+(i.w+80)*(e=>e<.5?4*e**3:1-(-2*e+2)**3/2)(a),p=Math.floor(c/70);for(const t of q.blocks){const n=(t.x+2-f)/y;if(n<=-1||n>=1)continue;const r=1-n*n;d(t.x+p,t.y)>.35+.65*r||(e.globalAlpha=Math.min(1,1.6*r),e.drawImage(q.snap,2*t.x,2*t.y,2*o,2*s,t.x,t.y,o,s))}e.globalAlpha=1;const h=f-i.x;B.set(t,"mask-image",`linear-gradient(90deg, #000 ${h-y}px, transparent ${h-14}px, transparent ${h+14}px, #000 ${h+y}px)`)})(e,p,u(p),a,i),f=!0;else{if(B.restore(),f)return!0;z&&clearTimeout(z);const e=t>=0?g-t%g:-t;z=setTimeout(()=>{z=0,R?.kick()},Math.max(16,e))}}else H=null,B.restore();return f}}),R&&(k.dataset.gpu="");const G=(e=!0)=>{const t=$();if(C=t.length?Math.min(Math.max(0,C),t.length-1):0,N(e),!b.current.manage)return;t.forEach((e,t)=>e.setAttribute("aria-selected",String(t===C)));const n=M(),r=t[C]?.id;n&&r&&n.setAttribute("aria-activedescendant",r)},V=()=>`inset(0 round ${getComputedStyle(k).borderTopLeftRadius||"0px"})`,I=()=>{const e=b.current.trigger,t=k.offsetWidth,n=k.offsetHeight;if(!e)return`inset(0 ${Math.max(0,t/2-40)}px ${Math.max(0,n-36)}px round 18px)`;const r=f(k,e);return`inset(${r.y}px ${t-r.x-r.w}px ${n-r.y-r.h}px ${r.x}px round ${r.h/2}px)`},U=e=>{const t=R;if(!t)return;const o=k.offsetWidth,s=k.offsetHeight,i=n(k,t.box,o,s,2),a=r(i,2),c=b.current.trigger,l=c?t.box(c):{x:o/2,y:0,w:0,h:0},u=l.x+l.w/2,d=l.y+l.h/2,f=Math.hypot(o,s)||1;S={snap:i,blocks:a,order:Float32Array.from(a,e=>Math.hypot(e.x-u,e.y-d)/f*.7+.3*e.seed),ox:u,oy:d,start:performance.now(),closing:e},t.kick()},X=e=>{if(e)for(const e of[...k.children])"CANVAS"===e.tagName&&void 0!==e.dataset.asciiKit||E.set(e,"opacity","0");else E.restore()},Z=(e,t,n="none")=>"function"!=typeof k.animate?null:k.animate(e.map(e=>({clipPath:e})),{duration:t,easing:v,fill:n}),J=()=>{O&&clearTimeout(O),O=0},Q=(e=!0)=>{!L||T?(J(),L=!0,T=!1,C=0,k.removeAttribute("hidden"),k.dataset.open="",b.current.trigger?.setAttribute("aria-expanded","true"),G(!1),(()=>{for(const e of $())D.set(e,j(e).y)})(),e&&M()?.focus({preventScroll:!0}),b.current.onOpenChange?.(!0),P()?R?.kick():(k.dataset.state="opening",Z([I(),V()],260),R&&(T=!0,X(!0),U(!1)),O=setTimeout(()=>{O=0,delete k.dataset.state,T=!1,X(!1),R?.kick()},143))):e&&M()?.focus({preventScroll:!0})},Y=()=>{if(!L)return;J();const e=k.contains(document.activeElement),t=()=>{O=0,T=!1,L=!1,S=null,delete k.dataset.state,delete k.dataset.open,X(!1),N(!1);for(const e of W)e.styles.restore();W=[],B.restore(),q=null,k.setAttribute("hidden",""),b.current.trigger?.setAttribute("aria-expanded","false"),e&&b.current.trigger?.focus({preventScroll:!0}),R?.kick(),b.current.onOpenChange?.(!1)};if(P())return void t();T=!0,k.dataset.state="closing",R&&(U(!0),X(!0));const n=Z([V(),I()],m,"forwards"),r="function"==typeof k.animate?k.animate([{opacity:1},{opacity:1,offset:.4},{opacity:0}],{duration:m,fill:"forwards"}):null;O=setTimeout(()=>{t(),n?.cancel(),r?.cancel()},m)},_=e=>{const t=$().length;t&&(C=(Math.round(e)%t+t)%t,G(),R?.kick())},ee=(e=C)=>{const t=$()[e];if(!t||T)return;_(e),R?.field.pulse({element:t,strength:.6}),t.matches(b.current.ai)&&(H=t,F=performance.now()),t.dataset.run="",b.current.onRun?.(e,t);const n=()=>{delete t.dataset.run,b.current.closeOnRun&&Y()};P()?n():setTimeout(n,240)},te=e=>{if(!b.current.manage)return;const t=$().length;if("Escape"===e.key&&L)return e.preventDefault(),e.stopPropagation(),void Y();if(e.target!==M()&&!$().includes(e.target))return;const n="ArrowDown"===e.key?C+1:"ArrowUp"===e.key?C-1:"Home"===e.key?0:"End"===e.key?t-1:null;if(null!==n)return e.preventDefault(),void _(n);"Enter"===e.key&&(e.preventDefault(),ee())},ne=e=>{const t=e.target?.closest?.(b.current.rows);return t?$().indexOf(t):-1},re=e=>{if(!b.current.manage)return;const t=ne(e);t<0||t!==C&&_(t)},oe=e=>{if(!b.current.manage)return;const t=ne(e);t>=0&&ee(t)},se=()=>{b.current.manage&&(C=0,G(!1))},ie="function"==typeof MutationObserver?new MutationObserver(()=>{L&&(G(!1),(()=>{const e=R,t=$(),o=t.filter(e=>{const t=j(e).y,n=D.get(e);return D.set(e,t),void 0===n||Math.abs(n-t)>1});for(const e of W)t.includes(e.row)&&!o.includes(e.row)||e.styles.restore();if(W=W.filter(e=>t.includes(e.row)&&!o.includes(e.row)),!e||!e.live||e.still()||T||!L)return;const s=e.canvas.clientWidth||k.offsetWidth,a=e.canvas.clientHeight||k.offsetHeight,c=performance.now();o.forEach((t,o)=>{const l=n(t,e.box,s,a,2),u=r(l,2);if(!u.length)return;const d=Math.min(...u.map(e=>e.x)),f=Math.max(1,Math.max(...u.map(e=>e.x))-d),p=i();for(const e of[...t.children])p.set(e,"opacity","0");W.push({row:t,snap:l,blocks:u,order:Float32Array.from(u,e=>(e.x-d)/f*.72+.28*e.seed),start:c+28*o,styles:p})}),e.kick()})())}):null;ie?.observe(k,{childList:!0,subtree:!0});const ae="function"==typeof ResizeObserver?new ResizeObserver(()=>N(!1)):null;ae?.observe(k);const ce=()=>{L?Y():Q(!0)},le=e=>{const t=b.current.hotkey;t&&e.key?.toLowerCase()===t.toLowerCase()&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),L?document.activeElement===M()?Y():M()?.focus():Q(!0))},ue=e=>{if(!b.current.manage||!L||T)return;const t=e.target;k.contains(t)||b.current.trigger?.contains(t)||Y()};k.addEventListener("keydown",te),k.addEventListener("pointermove",re),k.addEventListener("click",oe),k.addEventListener("input",se);const de=b.current.trigger;return de?.addEventListener("click",ce),de?.setAttribute("aria-expanded",String(L)),de?.setAttribute("aria-haspopup","dialog"),document.addEventListener("keydown",le),document.addEventListener("pointerdown",ue),L?k.dataset.open="":k.setAttribute("hidden",""),G(),u(()=>R,b,()=>{G(),R?.refresh()},{open:Q,close:Y,select:_,run:ee,toggle(){L?Y():Q(!0)},get isOpen(){return L},get selected(){return C}},()=>{J(),z&&clearTimeout(z),X(!1);for(const e of W)e.styles.restore();B.restore(),ie?.disconnect(),ae?.disconnect(),K.remove(),A.restore(),k.removeEventListener("keydown",te),k.removeEventListener("pointermove",re),k.removeEventListener("click",oe),k.removeEventListener("input",se),de?.removeEventListener("click",ce),document.removeEventListener("keydown",le),document.removeEventListener("pointerdown",ue),delete k.dataset.gpu,delete k.dataset.state})}var w=h;export{w as COMMAND_PALETTE_DEFAULTS,k as commandPalette};//# sourceMappingURL=chunk-VX2AD3M7.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{renderMaterial as t}from"./chunk-XPXMCXYI.js";import{mountCanvas as e}from"./chunk-
|
|
1
|
+
import{renderMaterial as t}from"./chunk-XPXMCXYI.js";import{mountCanvas as e}from"./chunk-3OD5BMF5.js";var n=(t,e,n,i)=>{const r=.2*Math.sin(3*t+2*e+.2*i);return(.65*Math.pow(.5+.5*Math.sin(45*(t+r)),8)+.35*Math.pow(.5+.5*Math.sin(50*(e-.3*r)),10))*(.4+.6*Math.sin(2*e+.4))},i={id:"weave",name:"Weave",description:"Interlaced threads with a subtle change in tension.",cellSize:12,speed:1,cursor:!1,mount:i=>e(i,(e,i,r,h,o,a)=>t(n,e,i,r,h,{ditherStrength:a.ditherStrength,fontSize:a.fontSize,chars:a.chars,lightMode:a.lightMode,color:a.ink}))};export{i as weave};//# sourceMappingURL=chunk-W4U5CK6L.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parseColor as t,hash2 as o}from"./chunk-ZCHGV2CV.js";import{mountCanvas as c}from"./chunk-
|
|
1
|
+
import{parseColor as t,hash2 as o}from"./chunk-ZCHGV2CV.js";import{mountCanvas as c}from"./chunk-3OD5BMF5.js";function e(c,e,n,r,a={x:.5,y:.5},i={}){const{fontSize:l=12,chars:s="·-=+|/",accentColor:h,color:f,bands:d=3,speed:g=1,bandWidth:M=.12,glitch:m=!0,lightMode:p=!1}=i,$=h??(p?"#6b8700":"#d4ff00"),b=.62*l,x=1.4*l,u=Math.ceil(e/b),S=Math.ceil(n/x);c.clearRect(0,0,e,n),c.font=`${l}px monospace`,c.textBaseline="top";let z=255,C=255,k=255;if(p&&(z=55,C=55,k=55),f){const o=t(f);o&&(z=o.r,C=o.g,k=o.b)}let y=212,j=255,B=0;const G=t($);G&&(y=G.r,j=G.g,B=G.b);const V=r*g;for(let t=0;t<S;t++)for(let e=0;e<u;e++){const n=t/S,r=((n*d-.5*V)%1+1)%1,i=Math.max(0,1-r/M),l=.35*(.5*o(3*e,7*t)+.5);let h=0;if(m){const c=e/u-a.x,r=n-a.y,i=Math.sqrt(c*c+r*r);if(i<.18){const c=o(11*e+Math.floor(12*V),5*t);h=Math.max(0,1-i/.18)*(c>.5?c-.3:0)}}const f=Math.min(1,l+.8*i+.6*h);if(f<.04)continue;const g=s[Math.floor(f*(s.length-1))],$=i>.55,G=p?.82*f:.12*f;c.fillStyle=$?`rgba(${y},${j},${B},${p?.92:.28})`:`rgba(${z},${C},${k},${G})`,c.fillText(g,e*b,t*x)}}var n={id:"grid",name:"Grid",description:"Scan bands roll down a character grid and glitch near the cursor.",cellSize:12,speed:1,cursor:!0,mount:t=>c(t,(t,o,c,n,r,a)=>e(t,o,c,n,r,{fontSize:a.fontSize,chars:a.chars,lightMode:a.lightMode,color:a.ink,accentColor:a.accent}))};export{n as grid,e as renderGridBackground};//# sourceMappingURL=chunk-WI2AF2KE.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{mountPageField as e,pageHandle as t,sleep as r,pulseAt as o}from"./chunk-
|
|
1
|
+
import{mountPageField as e,pageHandle as t,sleep as r,pulseAt as o}from"./chunk-7DXSG526.js";import{styleKeeper as a}from"./chunk-GF72XM4C.js";function n(n,l={}){const i={current:{...l}},c=a(),s=n.querySelector("img"),u=i.current.image??s??null;let d=null;d=u?e({host:n,look:()=>{const e=i.current;return{mark:"glyph",scene:"none",charset:" .:-=+*#%@",font:'"Geist", Arial, sans-serif',fontWeight:500,cellSize:6,cellAspect:.8,glyphScale:.8,color:"ink",shade:0,contrast:1.3,levels:"auto",fit:"cover",focus:e.focus??{x:.5,y:.4},hover:"trail",trail:{strength:.95,radius:.42},clear:!!e.clear&&{element:e.clear,padding:8,feather:.12,shape:"rect"},...e.look}},ink:()=>i.current.ink??"--ascii-ink-strong",source:u,label:i.current.label??(u instanceof HTMLImageElement&&u.alt||void 0),kit:i,reducedMotion:()=>i.current.reducedMotion,onFail:()=>{d=null,c.restore()}}):null,d&&s&&u===s&&c.set(s,"opacity","0");let h=0,m=!1;return t(()=>d,i,()=>{},{pulse:(e,t=1)=>{d&&!d.still()&&o(d.field,e,t)},shimmer:e=>{const t=d?.field;if(!t||e===m||e&&d.still())return;const o=++h;m=e,e?(async()=>{let e;try{e=await(async()=>{if(u instanceof HTMLImageElement)return u.complete||await u.decode(),u;const e=new Image;return e.crossOrigin="anonymous",e.src=u,await e.decode(),e})()}catch{return}const a=Math.min(1,1400/Math.max(e.naturalWidth,e.naturalHeight,1)),n=Object.assign(document.createElement("canvas"),{width:Math.max(1,Math.round(e.naturalWidth*a)),height:Math.max(1,Math.round(e.naturalHeight*a))}),l=n.getContext("2d"),i=n.width,c=n.height,s=performance.now();for(;o===h&&d?.field===t;){const o=performance.now(),a=-.4*i+1.8*((o-s)/1100%1)*i;l.globalCompositeOperation="source-over",l.drawImage(e,0,0,i,c);const u=l.createLinearGradient(a-.22*i,.3*a,a+.22*i,.3*a+.3*c);u.addColorStop(0,"rgb(0 0 0 / 0)"),u.addColorStop(.5,"rgb(255 255 255 / .42)"),u.addColorStop(1,"rgb(0 0 0 / 0)"),l.globalCompositeOperation="lighter",l.fillStyle=u,l.fillRect(0,0,i,c),await t.setSource(n),await r(Math.max(0,48-(performance.now()-o)))}})():t.setSource(u)}},()=>{h++,c.restore()})}export{n as artPanel};//# sourceMappingURL=chunk-XUCYFWC3.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{hash as t,settledSource as e}from"./chunk-
|
|
1
|
+
import{hash as t,settledSource as e}from"./chunk-GF72XM4C.js";var o=t=>{const e=Math.round(255*Math.min(1,Math.max(0,t)));return`rgb(${e} ${e} ${e})`},n=t=>{if(!t||"transparent"===t)return 0;const e=/\/\s*([\d.]+)(%?)\s*\)$/.exec(t);if(e)return parseFloat(e[1])/(e[2]?100:1);const o=/^rgba\([^)]*,\s*([\d.]+)\s*\)$/.exec(t);return o?parseFloat(o[1]):1},i=/^(IMG|PICTURE|VIDEO|CANVAS|SVG|svg)$/;function a(t,a,s,c){const d=(t,e)=>Math.max(0,Math.min(parseFloat(t.borderTopLeftRadius)||0,e.w/2,e.h/2)),f=[a,...a.querySelectorAll("*")];t.save();for(const l of f){if("CANVAS"===l.tagName&&void 0!==l.dataset?.asciiKit){if(!c||l===c.skip)continue;const o=s(l),n=o.w>0&&o.h>0?e(l):null;n&&(t.globalCompositeOperation="lighter",t.drawImage(n,o.x,o.y,o.w,o.h),t.globalCompositeOperation="source-over");continue}if(void 0!==l.dataset?.asciiPoster)continue;const f=s(l);if(f.w<=0||f.h<=0)continue;const h=getComputedStyle(l);if("hidden"===h.visibility||"none"===h.display)continue;const u=n(h.backgroundColor)>.03,g=(parseFloat(h.borderTopWidth)||0)>0&&n(h.borderTopColor)>.1;if(t.beginPath(),l===a)(u||g)&&(t.strokeStyle=o(.42),t.lineWidth=3,t.roundRect(f.x+1.5,f.y+1.5,f.w-3,f.h-3,d(h,f)),t.stroke());else{if(i.test(l.tagName)){t.fillStyle=o(.5),f.w<32&&f.h<32?t.arc(f.x+f.w/2,f.y+f.h/2,.36*Math.min(f.w,f.h),0,2*Math.PI):t.roundRect(f.x,f.y,f.w,f.h,d(h,f)),t.fill();continue}u?(t.fillStyle=o(.22),t.roundRect(f.x,f.y,f.w,f.h,d(h,f)),t.fill()):g&&(t.strokeStyle=o(.32),t.lineWidth=1.5,t.roundRect(f.x+.75,f.y+.75,f.w-1.5,f.h-1.5,d(h,f)),t.stroke())}if("INPUT"===l.tagName||"TEXTAREA"===l.tagName){const e=l,o=e.value||e.placeholder||"";o&&r(t,o,f.x+(parseFloat(h.paddingLeft)||0),f.y,f.h,h,e.value?.82:.5)}}!function(t,e,o){if("function"!=typeof document.createTreeWalker)return;const n=document.createTreeWalker(e,4),i=document.createRange(),a=o(e),s=e.getBoundingClientRect(),c=s.width/(e.offsetWidth||s.width||1)||1;let d=0;for(let o=n.nextNode();o&&d<2e3;o=n.nextNode()){const n=o.parentElement;if(!n)continue;const f=getComputedStyle(n);if("hidden"===f.visibility||l(n,e))continue;const h=(parseFloat(f.fontWeight)||400)>=600||/^H[1-6]$/.test(n.tagName)?1:.8;for(const e of o.data.matchAll(/\S+/g)){i.setStart(o,e.index),i.setEnd(o,e.index+e[0].length);const n=i.getClientRects()[0];n&&(d++,r(t,e[0],a.x+(n.left-s.left)/c,a.y+(n.top-s.top)/c,n.height/c,f,h))}}i.detach?.()}(t,a,s),t.restore()}function r(t,e,n,i,a,r,l){const s=Math.min(900,(parseFloat(r.fontWeight)||400)+200);t.font=`${r.fontStyle||"normal"} ${s} ${r.fontSize} ${r.fontFamily}`,t.fillStyle=o(l),t.shadowColor=o(l),t.shadowBlur=3,t.textBaseline="middle",t.fillText(e,n,i+a/2),t.shadowBlur=0}function l(t,e){for(;t&&t!==e;t=t.parentElement){const e=t,o=getComputedStyle(e);if(e.offsetWidth<=1&&e.offsetHeight<=1&&"hidden"===o.overflow)return!0;if("inset(50%)"===o.clipPath||"rect(0px, 0px, 0px, 0px)"===o.clip)return!0}return!1}function s(t,e,o,n,i=2,r){const l=document.createElement("canvas");l.width=Math.max(2,Math.round(o*i)),l.height=Math.max(2,Math.round(n*i));const s=l.getContext("2d",{willReadFrequently:!0});return s?(s.setTransform(i,0,0,i,0,0),s.fillStyle="#000",s.fillRect(0,0,o,n),a(s,t,e,r),l):l}var c=4,d=6;function f(e,o=2){const n=e.getContext("2d",{willReadFrequently:!0});if(!n)return[];const i=e.width,a=e.height,r=n.getImageData(0,0,i,a).data,l=[];for(let e=0;e<a/o;e+=6)for(let n=0;n<i/o;n+=4){let s=!1;for(let t=0;t<6*o&&!s;t+=3)for(let l=0;l<4*o&&!s;l+=2){const c=Math.round(n*o+l),d=Math.round(e*o+t);c<i&&d<a&&r[4*(d*i+c)]>10&&(s=!0)}s&&l.push({x:n,y:e,seed:t(n,e)})}return l}function h(t,e,o,n,i,a,r=1,l=.32,s=2){for(let c=0;c<o.length;c++){const d=o[c],f=(i-n[c]*(1-l))/l;if(f<=0)continue;const h=f>=1?0:1-f;let u=d.x,g=d.y;if(h>0){const[t,e]=a(d,h);u+=t,g+=e}t.globalAlpha=r*(1-h*h),t.drawImage(e,d.x*s,d.y*s,4*s,6*s,u,g,4,6)}t.globalAlpha=1}export{d as BLOCK_H,c as BLOCK_W,f as blocksOf,h as drawBlocks,s as snapshot};//# sourceMappingURL=chunk-Z2FRNFMB.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{scenePreset as e}from"./chunk-
|
|
1
|
+
import{scenePreset as e}from"./chunk-3VEMKDBW.js";var t=e({id:"ripple",name:"Ripple",description:"Still water: drops land here and there and ring outward, and the pointer drops its own.",cellSize:11,scene:"ripple",charset:" .·:-~=",hover:"none",extra(e,t){const{host:n}=e;let r=-1e9,i=-1e4,o=-1e4;const s=n=>{const s=performance.now();if(!1===e.settings().cursor||s-r<260||Math.hypot(n.clientX-i,n.clientY-o)<48)return;r=s,i=n.clientX,o=n.clientY;const c=t.canvas.getBoundingClientRect();t.field?.pulse({x:n.clientX-c.left,y:n.clientY-c.top,strength:.5})};return n.addEventListener("pointermove",s,{passive:!0}),()=>n.removeEventListener("pointermove",s)}});export{t as ripple};//# sourceMappingURL=chunk-Z3KD6CLE.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{renderMaterial as t}from"./chunk-XPXMCXYI.js";import{mountCanvas as i}from"./chunk-
|
|
1
|
+
import{renderMaterial as t}from"./chunk-XPXMCXYI.js";import{mountCanvas as i}from"./chunk-3OD5BMF5.js";var n=(t,i,n,e)=>{const r=7*i+.55*Math.sin(2.2*t+.09*e)+.22*Math.sin(4.8*t-.07*e),o=.5+.5*Math.sin(r);return Math.pow(o,5)*(.35+.65*i)+.08*Math.pow(.5+.5*Math.sin(17*r),3)*o},e={id:"dune",name:"Dune",description:"Layered sand ridges with slow-moving light and fine grain.",cellSize:12,speed:1,cursor:!1,mount:e=>i(e,(i,e,r,o,h,s)=>t(n,i,e,r,o,{ditherStrength:s.ditherStrength,fontSize:s.fontSize,chars:s.chars,lightMode:s.lightMode,color:s.ink}))};export{e as dune};//# sourceMappingURL=chunk-ZCXNGJGB.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{styleKeeper as t,srOnly as e,mountSurface as n,clamp as o,smoothstep as r,hash as a,house as l,handle as i,prefersReduced as s}from"./chunk-
|
|
1
|
+
import{styleKeeper as t,srOnly as e,mountSurface as n,clamp as o,smoothstep as r,hash as a,house as l,handle as i,prefersReduced as s}from"./chunk-GF72XM4C.js";var c={start:!0,stagger:38,roll:520,wave:55,glyphs:"#%*+=-:"},h=t=>`Thought for ${t}s`;function u(u,p={}){const f={current:{...c,...p}},m=t(),g=[...u.childNodes],d=f.current.label??null,y=d?[...d.childNodes]:[];let x="done",k=0,C=0,b=-1e9,w=0,M="",S=null;const A=d?e("",!0):null,v=document.createElement("span");let $="",F="";const E=()=>f.current.reducedMotion??s(),T=(t,e)=>{F=$,$=t,d&&(A&&(A.textContent=t),S?(v.replaceChildren(...[...t].map(t=>Object.assign(document.createElement("span"),{textContent:t}))),b=e?performance.now():-1e9,S.kick()):d.textContent=t)};d&&(S=n({host:d,look:()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:2,cellAspect:.66,glyphScale:1,shade:.2,contrast:1.1,...f.current.look}),ink:()=>f.current.ink??getComputedStyle(d).color,kit:f,reducedMotion:()=>f.current.reducedMotion,resolution:2,onFail:()=>{S=null,d.textContent=$,m.restore()},paint:({pen:t,now:e,still:n,box:i,scale:s})=>{const c=getComputedStyle(v),h=parseFloat(c.fontSize)||14,u=`${c.fontStyle} ${c.fontWeight} ${c.fontSize} ${c.fontFamily}`;t.setTransform(s,0,0,s,0,0),t.textAlign="center",t.textBaseline="alphabetic",t.font=u;const p=t.measureText("x"),m=p.fontBoundingBoxAscent||.8*h,g=p.fontBoundingBoxDescent||.2*h,d=f.current,y=[...v.children],k=e-b<d.roll+y.length*d.wave,w=y.length*d.wave+d.roll+420;let M=!1;return y.forEach((s,c)=>{let p=1;if(!n&&k)p=o((e-b-c*d.wave)/d.roll);else if(!n&&"thinking"===x){const t=(e-C)%w-c*d.wave;p=t<0||t>d.roll?1:t/d.roll}const f=p<1?r(.7,1,p).toFixed(3):"";if(s.style.opacity!==f&&(s.style.opacity=f),p>=1||!s.textContent?.trim())return;M=!0;const y=i(s),S=y.y+(y.h-m-g)/2+m,A=y.x+y.w/2,v=k?F[c]??" ":s.textContent,$=s.textContent,E=[v,...Array.from({length:3},(t,e)=>d.glyphs[Math.floor(a(e+7*c,Math.floor(C))*d.glyphs.length)]??""),$],T=l(p)*(E.length-1)*y.h;t.save(),t.beginPath(),t.rect(y.x-2,y.y,y.w+4,y.h),t.clip(),t.globalAlpha=1-r(.7,1,p),E.forEach((e,n)=>{const o=S+n*y.h-T;if(o<y.y-y.h||o>y.y+2*y.h)return;const r=0===n||n===E.length-1;t.font=r?u:`600 ${.86*h}px "Geist Mono", ui-monospace, monospace`,t.fillStyle=r?"#fff":"#d0d0d0",t.fillText(e,A,o)}),t.restore()}),t.globalAlpha=1,M||!n&&("thinking"===x||k)}}),S&&A&&(m.set(v,"display","inline-flex"),m.set(v,"white-space","pre"),v.setAttribute("aria-hidden","true"),d.replaceChildren(A,v,S.canvas)));const B=document.createElement("span"),z=()=>{w++,x="thinking",C=performance.now(),M="",B.replaceChildren(),u.replaceChildren(B),u.setAttribute("aria-busy","true"),T(f.current.labels?.thinking??"Thinking…",!1),f.current.onState?.("thinking",0),S?.kick()};let G=0,P=0;return f.current.start&&z(),i(()=>S,f,()=>S?.refresh(),{think:z,stream:async t=>{"thinking"!==x&&z();const e=w;G=0;let n="";const o=()=>{"thinking"===x&&(x="streaming",P=performance.now(),k=Math.max(1,Math.round((P-C)/1e3)),T((f.current.labels?.done??h)(k),!0),f.current.onState?.("streaming",k))},r=(t,e)=>{n+=t;const r=e?n.length:n.search(/\s\S*$/)+1;r<=0||(o(),M+=n.slice(0,r),(t=>{const e=!E()&&!S?.still();for(const n of t.match(/\s+|\S+/g)??[]){if(/^\s/.test(n)){B.append(n);continue}const t=document.createElement("span");if(t.textContent=n,e){m.set(t,"opacity","0");const e=Math.max(0,G*f.current.stagger-(performance.now()-P));m.set(t,"transition",`opacity 260ms cubic-bezier(.16, 1, .3, 1) ${Math.round(e)}ms`),requestAnimationFrame(()=>requestAnimationFrame(()=>t.style.setProperty("opacity","1")))}G++,B.appendChild(t)}})(n.slice(0,r)),n=n.slice(r))};if("string"==typeof t)r(t,!0);else{for await(const n of t){if(e!==w)return;r(n,!1)}if(e!==w)return;r("",!0)}o();const a=E()?0:Math.max(0,G*f.current.stagger-(performance.now()-P))+260;await new Promise(t=>setTimeout(t,a)),e===w&&(x="done",u.setAttribute("aria-busy","false"),f.current.onState?.("done",k),S?.kick())},get state(){return x}},()=>{w++,m.restore(),u.removeAttribute("aria-busy"),M?u.textContent=M:u.replaceChildren(...g),d&&($?d.textContent=$:d.replaceChildren(...y))})}var p=c;export{p as THINKING_DEFAULTS,u as thinking};//# sourceMappingURL=chunk-ZWZZMU5P.js.map
|