asciify-engine 4.24.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 +325 -0
- package/README.md +71 -718
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/field.cjs +1 -1
- package/dist/field.d.cts +132 -272
- package/dist/field.d.ts +132 -272
- 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/hover.cjs +1 -1
- package/dist/hover.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/kit/chunk-2FH6GGV6.js +1 -0
- package/dist/kit/chunk-2GAV4OAK.js +1 -0
- package/dist/kit/{chunk-C4KZYCPF.js → chunk-2LBQ7QJT.js} +1 -1
- package/dist/kit/{chunk-BN7HL52Z.js → chunk-3LJ5C3U3.js} +1 -1
- package/dist/kit/{chunk-NURPDP3Y.js → chunk-3MHEDZLZ.js} +1 -1
- package/dist/kit/{chunk-BR6ZNJZW.js → chunk-3OD5BMF5.js} +1 -1
- package/dist/kit/{chunk-C3C7AYKL.js → chunk-3VEMKDBW.js} +1 -1
- package/dist/kit/{chunk-PFKYKAIP.js → chunk-42KMN727.js} +1 -1
- package/dist/kit/{chunk-2CF4PX6U.js → chunk-6G5MPND3.js} +1 -1
- package/dist/kit/{chunk-QALCXKU6.js → chunk-6WU247CB.js} +1 -1
- package/dist/kit/{chunk-YBRP6BFW.js → chunk-776H2BJ7.js} +1 -1
- package/dist/kit/chunk-7DXSG526.js +1 -0
- package/dist/kit/{chunk-H2UZBVKE.js → chunk-7M2FFUZ3.js} +1 -1
- package/dist/kit/{chunk-5BEBNKYM.js → chunk-7NVKRDKE.js} +1 -1
- package/dist/kit/{chunk-XB4DKPGL.js → chunk-AIGAJMNN.js} +1 -1
- package/dist/kit/{chunk-O7SGY4YJ.js → chunk-B3TY6UXJ.js} +1 -1
- package/dist/kit/{chunk-XDKKCIIL.js → chunk-BFBG3VHI.js} +1 -1
- package/dist/kit/{chunk-3A5LID2G.js → chunk-CG6SGQMY.js} +1 -1
- package/dist/kit/{chunk-T3GWGPST.js → chunk-CGSWUO67.js} +1 -1
- package/dist/kit/{chunk-DFOWXOZR.js → chunk-DAJSBX6H.js} +1 -1
- package/dist/kit/{chunk-IUKSHYED.js → chunk-DCLJHSWM.js} +1 -1
- package/dist/kit/{chunk-W2STAN6V.js → chunk-DMRPBFLW.js} +1 -1
- package/dist/kit/{chunk-XANKANGR.js → chunk-E3FPFANJ.js} +1 -1
- package/dist/kit/{chunk-VC2ZQG63.js → chunk-EKYEA7Z4.js} +1 -1
- package/dist/kit/{chunk-IQTGJRDX.js → chunk-F6F2C3RH.js} +1 -1
- package/dist/kit/chunk-FEAFQY7O.js +1 -0
- package/dist/kit/{chunk-FUI5AVIF.js → chunk-FHN3PPSI.js} +1 -1
- package/dist/kit/{chunk-QRCXXS5Z.js → chunk-FPCCX4FM.js} +1 -1
- package/dist/kit/{chunk-TTGMK4EA.js → chunk-FWODCYYJ.js} +1 -1
- package/dist/kit/{chunk-AIM3J2US.js → chunk-GBNV3GXG.js} +1 -1
- package/dist/kit/chunk-GF72XM4C.js +1 -0
- package/dist/kit/{chunk-SARCZMLN.js → chunk-GKR3ROYR.js} +1 -1
- package/dist/kit/{chunk-ROR6MG3K.js → chunk-H5KHXZWR.js} +1 -1
- package/dist/kit/{chunk-PCIAA2LL.js → chunk-I5R2347P.js} +1 -1
- package/dist/kit/{chunk-4QHFEMFS.js → chunk-IBNDCKEX.js} +1 -1
- package/dist/kit/{chunk-J2YZBT3N.js → chunk-ILXVBO7M.js} +1 -1
- package/dist/kit/{chunk-S62H7ZIU.js → chunk-JELJEEJO.js} +1 -1
- package/dist/kit/{chunk-2NVKPXPL.js → chunk-K6JX64AS.js} +1 -1
- package/dist/kit/{chunk-3473NPIN.js → chunk-KCEYRIU4.js} +1 -1
- package/dist/kit/{chunk-HTUGMGVA.js → chunk-KDROJANO.js} +1 -1
- package/dist/kit/{chunk-5QE6UMXN.js → chunk-KEE55QSD.js} +1 -1
- package/dist/kit/{chunk-MIZ2DUHU.js → chunk-KFXMLIVF.js} +1 -1
- package/dist/kit/{chunk-G57QACJG.js → chunk-KLRF3S7O.js} +1 -1
- package/dist/kit/{chunk-ENTDGT2V.js → chunk-KXI3T72F.js} +1 -1
- package/dist/kit/{chunk-4ZQFDFEH.js → chunk-KY5KCIZE.js} +1 -1
- package/dist/kit/{chunk-4OT66HSZ.js → chunk-LE53AVKR.js} +1 -1
- package/dist/kit/{chunk-WJLZM3DR.js → chunk-LVCGC3SO.js} +1 -1
- package/dist/kit/chunk-M5VVLYI2.js +1 -0
- package/dist/kit/{chunk-7ABNWOW4.js → chunk-MJJSZS23.js} +1 -1
- package/dist/kit/{chunk-VVW7LZT2.js → chunk-MZFK765W.js} +1 -1
- package/dist/kit/{chunk-5I4IZTL5.js → chunk-NF4WVWAC.js} +1 -1
- package/dist/kit/{chunk-PIU2BMFU.js → chunk-NW4U2YRE.js} +1 -1
- package/dist/kit/{chunk-5Z2EJAUV.js → chunk-ORSI57T2.js} +1 -1
- package/dist/kit/{chunk-UML6XQAR.js → chunk-QSTDYL35.js} +1 -1
- package/dist/kit/{chunk-K563CCOL.js → chunk-QVICL57J.js} +1 -1
- package/dist/kit/{chunk-MQJQIDO5.js → chunk-RXOPJJC4.js} +1 -1
- package/dist/kit/{chunk-SNCXU7KF.js → chunk-SDSW7422.js} +1 -1
- package/dist/kit/{chunk-DZ5XGHTJ.js → chunk-TRDA73HN.js} +1 -1
- package/dist/kit/{chunk-KWTF6Q5W.js → chunk-UOYBFLGJ.js} +1 -1
- package/dist/kit/chunk-UVLKCAKH.js +1 -0
- package/dist/kit/{chunk-YCWMOTYH.js → chunk-VBWG7HQA.js} +1 -1
- package/dist/kit/{chunk-FR3ZJNOY.js → chunk-VIUEAEBX.js} +1 -1
- package/dist/kit/{chunk-ZRJVOUWH.js → chunk-VV2KP7ZW.js} +1 -1
- package/dist/kit/chunk-VX2AD3M7.js +1 -0
- package/dist/kit/{chunk-RFLIFKZ4.js → chunk-W4U5CK6L.js} +1 -1
- package/dist/kit/{chunk-I4QVLLRQ.js → chunk-WI2AF2KE.js} +1 -1
- package/dist/kit/{chunk-MGVPLQ3Z.js → chunk-XUCYFWC3.js} +1 -1
- package/dist/kit/{chunk-BNVRKD3V.js → chunk-Z2FRNFMB.js} +1 -1
- package/dist/kit/{chunk-BQZCLGCY.js → chunk-Z3KD6CLE.js} +1 -1
- package/dist/kit/{chunk-E3TUOX2A.js → chunk-ZCXNGJGB.js} +1 -1
- package/dist/kit/{chunk-IPVN22ZM.js → chunk-ZWZZMU5P.js} +1 -1
- package/dist/kit.cjs +1 -1
- package/dist/kit.d.cts +4 -2
- package/dist/kit.d.ts +4 -2
- 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 +3 -1
- package/skills/asciify-engine/SKILL.md +2 -2
- package/skills/asciify-engine/references/applying-asciify.md +1 -1
- package/skills/asciify-engine/references/kit.md +2 -2
- package/skills/asciify-engine/references/performance.md +6 -3
- package/dist/kit/chunk-3PCKMO6I.js +0 -1
- package/dist/kit/chunk-4HWMQCAM.js +0 -1
- package/dist/kit/chunk-73M2OESE.js +0 -1
- package/dist/kit/chunk-BTD6EFAW.js +0 -1
- package/dist/kit/chunk-OWEZV7TQ.js +0 -1
- package/dist/kit/chunk-S7RZP2MT.js +0 -1
- package/dist/kit/chunk-UO7RB7RC.js +0 -1
- package/dist/kit/chunk-XM56OTYT.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{driftNoise as t}from"./chunk-
|
|
1
|
+
import{driftNoise as t}from"./chunk-VV2KP7ZW.js";import{styleKeeper as e,mountSurface as r,handle as i}from"./chunk-GF72XM4C.js";var a=680,n=12,o={preview:[{k:.55,blur:6},{k:.8,blur:2.5}],final:{k:1,blur:0}},l=t=>.5-.5*Math.cos(Math.PI*Math.min(1,Math.max(0,t))),s=t=>{const e=t/1e3;return e<60?`${e.toFixed(1)}s`:`${Math.floor(e/60)}:${String(Math.floor(e%60)).padStart(2,"0")}`},m=async t=>{if("function"==typeof createImageBitmap)return createImageBitmap("string"==typeof t?await(await fetch(t)).blob():t);const e=new Image;return e.crossOrigin="anonymous",e.src="string"==typeof t?t:URL.createObjectURL(t),await e.decode(),e};function c(c,u={}){const g={current:{...u}},h=e(),f=document.createElement("canvas");let b="idle",p=0,d=0,k="",M=null;const w={from:{img:null,k:0,blur:n},to:{img:null,k:0,blur:n},at:-1e6},y=()=>void 0===g.current.image?c.querySelector("img"):g.current.image,v=(t,e)=>{const r=e?1:l((t-w.at)/a),i="generating"===b&&!e&&w.to.img?1-.45*(1-Math.exp(-Math.max(0,t-w.at)/1600)):1,n=(w.from.blur+(w.to.blur-w.from.blur)*r)*i,o=(w.from.img?w.from.k:0)+((w.to.img?w.to.k:0)-(w.from.img?w.from.k:0))*r;return w.to.img??w.from.img?[{img:w.from.img,k:o,blur:n,mix:1},{img:w.to.img,k:o,blur:n,mix:w.from.img?r:1}].filter(t=>t.img):[]},x=(t,e,r)=>{const i=performance.now(),o=M?.still()?1:l((i-w.at)/a),[s]=v(i,!!M?.still());w.from={img:(o>=.5?w.to.img:w.from.img)??w.to.img??w.from.img,k:s?.k??0,blur:s?.blur??n},w.to={img:t,k:e,blur:r},w.at=i,M?.kick()};M=r({host:c,layer:"under",look:()=>({blend:"coarse",mark:"glyph",charset:" .:-=+*#%@",font:'"Geist", Arial, sans-serif',fontWeight:500,cellSize:7,cellAspect:.8,glyphScale:.8,contrast:1.4,drift:.5,speed:.6,hover:"trail",trail:{strength:.9,radius:.35},...g.current.look}),ink:()=>g.current.ink??"--ascii-ink-strong",kit:g,reducedMotion:()=>g.current.reducedMotion,resolution:(t,e)=>{const r=Math.min(480,Math.max(2,Math.round(t)));return[r,Math.max(2,Math.round(r*e/Math.max(1,t)))]},onFail:()=>{M=null,h.restore()},paint:({pen:e,width:r,height:i,now:n,still:o})=>{const l="generating"===b,m=o?0:(n-p)/1e3;l&&g.current.elapsed&&(g.current.elapsed.textContent=s(n-p));const c=l&&!o?1+.12*Math.sin(2.1*m)*(.7+.3*Math.sin(.37*m)):1,u=Math.max(2,Math.ceil(24*i/Math.max(1,r)));24===f.width&&f.height===u||(f.width=24,f.height=u),t(f,3.1+(l?.55*m:0),.35);const h=v(n,o),d=Math.min(1,h[0]?.k??0);e.imageSmoothingEnabled=!0,e.globalAlpha=Math.max(0,1-d),e.filter=`brightness(${1.7*c})`,e.drawImage(f,0,0,r,i);for(const{img:t,k:a,blur:n,mix:o=1}of h){if(!t||a<=0||o<=0)continue;const l=t.width,s=t.height,m=Math.min(s,l*i/r),c=Math.min(l,s*r/i);e.globalAlpha=Math.min(1,1.25*a)*o,e.filter=`brightness(1.3) blur(${n*r/480}px)`,e.drawImage(t,(l-c)/2,Math.max(0,.45*(s-m)),c,m,0,0,r,i)}const k=l&&!o?.6*Math.min(1,d)*(1-Math.max(0,d-.8)/.2):0;return k>.01&&(e.globalCompositeOperation="lighter",e.globalAlpha=k,e.filter=`brightness(${.9*c})`,e.drawImage(f,0,0,r,i),e.globalCompositeOperation="source-over"),e.filter="none",e.globalAlpha=1,l||n-w.at<a}});const A=(t,e)=>{b=t,c.dataset.state=t,c.setAttribute("aria-busy",String("generating"===t)),g.current.onState?.(t,e)},L=t=>{const e=y();e&&M&&(h.set(e,"transition",M.still()?"none":`opacity ${t?560:440}ms cubic-bezier(.45, 0, .25, 1)`),h.set(e,"opacity",t?"1":"0"))},R=t=>new Promise(e=>setTimeout(e,t)),S=t=>{const e=y();e&&(k&&URL.revokeObjectURL(k),k="string"==typeof t?"":URL.createObjectURL(t),e.src=k||t,M||h.set(e,"visibility","visible"))},U=async(t=g.current.stream)=>{if(!t)return b;const e=++d,r=()=>e===d,i=!!M?.still();p=performance.now(),A("generating"),L(!1),x(null,0,n);let a=0;try{for await(const e of"function"==typeof t?t():t){if(!r())return b;if(!(e.final??e.preview))continue;if(e.final){S(e.final),M&&x(await m(e.final),o.final.k,o.final.blur);break}if(!M){S(e.preview);continue}const t=o.preview[Math.min(a++,o.preview.length-1)];x(await m(e.preview),t.k,t.blur)}if(await R(i?0:544),!r())return b;A("done"),L(!0),M?.kick()}catch(t){if(!r())return b;x(null,0,n),await R(i?0:340),A("failed",t)}return b};{const t=y();t&&h.set(t,M?"opacity":"visibility",M?"0":t.getAttribute("src")?"visible":"hidden")}return g.current.stream&&U(),i(()=>M,g,()=>M?.refresh(),{run:U,reset(){d++,x(null,0,n),A("idle"),L(!1)},get state(){return b}},()=>{d++,k&&URL.revokeObjectURL(k),delete c.dataset.state,c.removeAttribute("aria-busy"),h.restore()})}export{s as elapsedLabel,c as imageGenerate};//# sourceMappingURL=chunk-KDROJANO.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parseColor as t}from"./chunk-ZCHGV2CV.js";import{mountCanvas as e}from"./chunk-
|
|
1
|
+
import{parseColor as t}from"./chunk-ZCHGV2CV.js";import{mountCanvas as e}from"./chunk-3OD5BMF5.js";function o(e,o,n,c,r={x:.5,y:.5},l={}){const{fontSize:s=14,chars:a=". · ○ ◎ ●",accentColor:i,color:h,rings:f=5,speed:M=1,sharpness:g=4,lightMode:p=!1}=l,m=i??(p?"#007a5e":"#00ffcc");e.clearRect(0,0,o,n),e.textBaseline="middle",e.textAlign="center";const u=o*r.x,d=n*r.y,x=1.6*Math.sqrt(u*u+d*d)+.2*Math.sqrt(o*o+n*n);let $=255,b=255,S=255;if(p&&($=55,b=55,S=55),h){const e=t(h);e&&($=e.r,b=e.g,S=e.b)}let z=0,C=255,k=204;const q=t(m);q&&(z=q.r,C=q.g,k=q.b);const y=a.replace(/ /g,"").split("");if(0===y.length)return;const j=Math.ceil(o/s),A=Math.ceil(n/s);for(let t=0;t<A;t++)for(let o=0;o<j;o++){const n=o*s+.5*s,r=t*s+.5*s,l=n-u,a=r-d,i=Math.sqrt(l*l+a*a)/x;let h=0;for(let t=0;t<f;t++){const e=(c*M*.38+t/f)%1,o=Math.abs(i-e),n=Math.max(0,1-o*x/(s*(12-g)));h+=Math.cos(n*Math.PI*.5)*n}if(h=Math.min(1,h),h<.02)continue;const m=h>.6;e.font=`${s}px monospace`;const q=Math.floor(h*(y.length-1)),j=y[Math.min(q,y.length-1)],A=p?.88*h:.22*h;e.fillStyle=m?`rgba(${z},${C},${k},${Math.min(p?.95:.4,.55*h)})`:`rgba(${$},${b},${S},${A})`,e.fillText(j,n,r)}e.textAlign="left"}var n={id:"pulse",name:"Pulse",description:"Rings of characters ripple out from the cursor.",cellSize:14,speed:1,cursor:!0,mount:t=>e(t,(t,e,n,c,r,l)=>o(t,e,n,c,r,{fontSize:l.fontSize,chars:l.chars,lightMode:l.lightMode,color:l.ink,accentColor:l.accent}))};export{n as pulse,o as renderPulseBackground};//# sourceMappingURL=chunk-KEE55QSD.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{styleKeeper as t,mountSurface as e,handle as r,hash as n,prefersReduced as o,clamp as a,house as i}from"./chunk-
|
|
1
|
+
import{styleKeeper as t,mountSurface as e,handle as r,hash as n,prefersReduced as o,clamp as a,house as i}from"./chunk-GF72XM4C.js";var s={length:6,accept:"digits",cells:"[data-cell]"},l=560,c=t=>{const e=Math.round(255*a(t));return`rgb(${e} ${e} ${e})`},u=(t,e,r="digits")=>("digits"===r?t.replace(/\D/g,""):t.replace(/[^a-z\d]/gi,"").toUpperCase()).slice(0,e);function d(d,h={}){const p={current:{...s,...h}},f=t(),m=t(),g=[],v=()=>!!(p.current.reducedMotion??o()),b=()=>Math.max(1,Math.round(p.current.length));let y="",x="idle",M=!1,A=[],w="",E=-1e9,k="",S=-1e9,C=[],$=[],L=0,P=null;const T=new Map;"static"===getComputedStyle(d).position&&f.set(d,"position","relative");let B=d.querySelector("input");B||(B=document.createElement("input"),B.setAttribute("style","position:absolute;inset:0;width:100%;height:100%;margin:0;padding:0;border:0;opacity:0;font-size:16px;cursor:text"),d.appendChild(B),g.push(B));const q=B;q.setAttribute("inputmode","digits"===p.current.accept?"numeric":"text"),q.setAttribute("autocomplete","one-time-code"),q.setAttribute("maxlength",String(b())),"digits"===p.current.accept&&q.setAttribute("pattern","[0-9]*"),q.hasAttribute("aria-label")||q.hasAttribute("aria-labelledby")||q.setAttribute("aria-label",`Verification code, ${b()} ${"digits"===p.current.accept?"digits":"characters"}`);const z=()=>{const t=[...d.querySelectorAll(p.current.cells)];for(;t.length<b();){const e=document.createElement("span");e.dataset.cell="",e.setAttribute("aria-hidden","true"),q.parentElement===d?d.insertBefore(e,q):d.appendChild(e),g.push(e),t.push(e)}return t.slice(0,b())},F=t=>{let e=t.querySelector("[data-digit]");return e||(e=document.createElement("span"),e.dataset.digit="",t.appendChild(e),g.push(e)),e},I=(t,e,r,o,a,i,s,l=1,c=0,u=0,d=1)=>{const h=((t,e,r,n)=>{const o=`${t}|${Math.round(e)}x${Math.round(r)}|${n}`;let a=T.get(o);if(!a){a=document.createElement("canvas"),a.width=Math.max(2,Math.round(2*e)),a.height=Math.max(2,Math.round(2*r));const i=a.getContext("2d");i&&(i.scale(2,2),i.fillStyle="#fff",i.shadowColor="#fff",i.shadowBlur=3,i.font=`600 ${Math.round(.6*r)}px ${n}`,i.textAlign="center",i.textBaseline="middle",i.fillText(t,e/2,r/2+1)),T.set(o,a)}return a})(e,r.w,r.h,s);t.globalAlpha=l;const p=r.w*d,f=r.h*d,m=r.x+(r.w-p)/2+c,g=r.y+(r.h-f)/2+u;for(let e=0;e<r.h;e+=4)for(let s=0;s<r.w;s+=3){if(n(s+31*i,e)>1.3*o-.12)continue;const r=3*(1-o);t.drawImage(h,2*s,2*e,6,8,m+s*d+(n(s,e+a)-.5)*r,g+e*d+(n(e,s+a)-.5)*r,3*d,4*d)}t.globalAlpha=1},W=(t,e)=>{t.toggleAttribute("data-shown",e),m.set(F(t),"opacity",e?"1":"0")};P=e({host:d,outset:16,look:()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:4,cellAspect:.62,glyphScale:.92,...p.current.look}),ink:()=>p.current.ink??"--ascii-ink-strong",kit:p,reducedMotion:()=>p.current.reducedMotion,resolution:2,onFail:()=>{P=null,m.restore(),z().forEach(t=>W(t,!0))},paint:({pen:t,w:e,h:r,now:n,still:o,box:s})=>{t.setTransform(2,0,0,2,0,0);const u=z(),h=o?0:Math.floor(n/110),p=getComputedStyle(d).fontFamily||"sans-serif";if("success"===x){const s=o?1:(n-S)/700,l=e/2,d=r/2;if(u.forEach(t=>W(t,!1)),s<.55){const e=(s/.55)**2;C.forEach((r,n)=>k[n]&&I(t,k[n],r,1,h,n,p,1-e**3,(l-r.x-r.w/2)*e,(d-r.y-r.h/2)*e,1-.65*e))}const f=a((s-.45)/.55);return f>0&&f<1&&(t.strokeStyle=c(.55*(1-f)),t.lineWidth=3,t.beginPath(),t.arc(l,d,18+44*(t=>1-(1-a(t))**3)(f),0,2*Math.PI),t.stroke()),((t,e,r,n)=>{if(n<=0)return;const o=[[e-20,r+1],[e-7,r+14],[e+21,r-14]],a=Math.hypot(13,13),i=Math.hypot(28,28);let s=n*(a+i);t.strokeStyle="#fff",t.lineWidth=8,t.lineCap="round",t.lineJoin="round",t.shadowColor="#fff",t.shadowBlur=4,t.beginPath(),t.moveTo(o[0][0],o[0][1]);const l=Math.min(1,s/a);if(t.lineTo(o[0][0]+(o[1][0]-o[0][0])*l,o[0][1]+(o[1][1]-o[0][1])*l),s-=a,s>0){const e=Math.min(1,s/i);t.lineTo(o[1][0]+(o[2][0]-o[1][0])*e,o[1][1]+(o[2][1]-o[1][1])*e)}t.stroke(),t.shadowBlur=0})(t,l,d+1,i(a((s-.4)/.45))),s<1}let f=!1;const m=n-E;return u.forEach((e,r)=>{const a=s(e),i=y[r];if(m<l&&w[r])return W(e,!1),I(t,w[r],a,1-m/l,h,r,p),void(f=!0);if(i){const s=o?1:(n-A[r])/300;if(W(e,s>=.7),s>=1)return;return f=!0,void(s>0&&I(t,i,a,s,h,r,p,s>.7?1-(s-.7)/.3:1))}if(W(e,!1),M&&r===y.length&&m>=l){const e=o?.6:.5-.5*Math.cos(n/1600*Math.PI*2);t.fillStyle=c(.2+.26*e),t.beginPath(),t.roundRect(a.x+a.w/2-1.5,a.y+a.h/2-11,3,22,1.5),t.fill(),f=!0}}),f}});const G=(t,e)=>{$.push(setTimeout(e,t))},j=()=>{$.forEach(clearTimeout),$=[]},D=()=>{d.dataset.state=x,"error"===x?q.setAttribute("aria-invalid","true"):q.removeAttribute("aria-invalid");const t=M&&"success"!==x?Math.min(y.length,b()-1):-1;z().forEach((e,r)=>{F(e).textContent=y[r]??"",e.toggleAttribute("data-active",r===t),P||W(e,!0),"success"===x&&P?(f.set(e,"transition","opacity 200ms, scale 240ms cubic-bezier(.16, 1, .3, 1)"),f.set(e,"opacity","0"),f.set(e,"scale",".86")):(e.style.removeProperty("opacity"),e.style.removeProperty("scale"))}),q.value!==y&&(q.value=y),P?.kick()},J=t=>{j(),"idle"!==x&&(x="idle",S=-1e9),w="",E=-1e9;const e=u(t,b(),p.current.accept),r=performance.now();let n=0;for(let t=0;t<e.length;t++)e[t]!==y[t]&&(A[t]=v()?-1e9:r+L*n++);y=e,D(),e.length===b()&&G(v()||!P?0:300+L*Math.max(0,n-1)+80,()=>p.current.onComplete?.(e)),L=0},R=()=>J(q.value),U=()=>{L=55},V=()=>{M=!0,D()},X=()=>{M=!1,D()};return q.addEventListener("input",R),q.addEventListener("paste",U),q.addEventListener("focus",V),q.addEventListener("blur",X),q.value?J(q.value):D(),r(()=>P,p,()=>{q.setAttribute("maxlength",String(b())),D(),P?.refresh()},{verify:t=>{j();const e=performance.now();if(t)return k=y,C=P?z().map(t=>P.box(t)):[],S=e,x="success",void D();w=y,E=v()||!P?e-l:e,x="error",D(),v()||"function"!=typeof d.animate||d.animate([{translate:"0"},{translate:"-9px"},{translate:"7px"},{translate:"-4px"},{translate:"2px"},{translate:"0"}],{duration:380,easing:"ease-out"});const r=y;G(v()||!P?0:l,()=>{w===r&&(w="",y="",D())})},clear:()=>{j(),w="",E=-1e9,S=-1e9,y="",x="idle",D()},fill(t){L=55,J(t)},get value(){return y},get state(){return x}},()=>{j(),q.removeEventListener("input",R),q.removeEventListener("paste",U),q.removeEventListener("focus",V),q.removeEventListener("blur",X),m.restore(),f.restore();for(const t of g)t.remove();for(const t of d.querySelectorAll(p.current.cells))t.removeAttribute("data-shown"),t.removeAttribute("data-active");delete d.dataset.state})}var h=s;export{h as CODE_INPUT_DEFAULTS,u as cleanCode,d as codeInput};//# sourceMappingURL=chunk-KFXMLIVF.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{easeOut as t,styleKeeper as e,mountSurface as n,smoothstep as r,handle as o,boxIn as i,clamp as a}from"./chunk-
|
|
1
|
+
import{easeOut as t,styleKeeper as e,mountSurface as n,smoothstep as r,handle as o,boxIn as i,clamp as a}from"./chunk-GF72XM4C.js";var l={tabs:'[role="tab"]',duration:440,panels:"hidden",manage:!0};function c(e,n,r){const o=Math.sign(n.x+n.w/2-(e.x+e.w/2))||1,i=t(r/.78,4),a=t((r-.14)/.86,4);return{left:e.x+(n.x-e.x)*(o>0?a:i),right:e.x+e.w+(n.x+n.w-e.x-e.w)*(o>0?i:a),dir:o}}function s(t,e,n=20){const r=Math.max(0,Math.floor((t-2*n)/e));return{n:r,x0:(t-r*e)/2}}function u(u,d={}){const h={current:{...l,...d}},x=()=>[...u.querySelectorAll(h.current.tabs)],f=x().findIndex(t=>"true"===t.getAttribute("aria-selected"));let g=Math.max(0,h.current.active??(f>=0?f:0)),p=-1e6,v=null,y=null;const b=e(),m=()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:6,cellAspect:.62,glyphScale:.96,blend:"off",...h.current.look}),M=t=>{const e=i(u,t);return{...e,x:e.x-u.clientLeft,y:e.y-u.clientTop}},w=t=>{y=t;const e=t=>Math.round(100*t)/100+"px";b.set(u,"--tabs-x",e(t.x)),b.set(u,"--tabs-y",e(t.y)),b.set(u,"--tabs-w",e(t.w)),b.set(u,"--tabs-h",e(t.h))},k=()=>{const t=x()[g];t&&w(M(t))};let A=null;A=n({host:u,layer:"under",look:m,ink:()=>h.current.ink??"--ascii-ink",kit:h,reducedMotion:()=>h.current.reducedMotion,onFail:()=>{A=null,k()},paint:({pen:e,now:n,still:o})=>{const i=x()[g];if(!i)return!1;const l=M(i),u=o||!v?1:a((n-p)/h.current.duration),d=u<1?c(v,l,u):{left:l.x,right:l.x+l.w,dir:1},f={x:d.left,y:l.y,w:d.right-d.left,h:l.h};w(f),u>=1&&(v=null);const y=m(),b=Math.min(2,globalThis.devicePixelRatio||1),k=Math.max(2,Math.round((y.cellSize??6)*b)),$=k/b,E=Math.max(2,Math.round(k*(y.cellAspect??.62)))/b,{n:L,x0:S}=s(f.w,E),F=t=>u<1?t:Math.round(t*b)/b,R=F(f.x+S),z=F(f.y+f.h-7-$),I=(R%E+E)%E-E,O=(z%$+$)%$-$,P=A.canvas,C=`${I.toFixed(3)}px ${O.toFixed(3)}px`;P.style.translate!==C&&(P.style.translate=C);const G=t=>`${Math.max(0,t).toFixed(2)}px`,H=R-I,T=z-O,W=`inset(${G(T)} ${G(P.clientWidth-H-L*E)} ${G(P.clientHeight-T-$)} ${G(H)})`;P.style.clipPath!==W&&(P.style.clipPath=W);const j=u<1?1-t(u,2):0;for(let t=0;t<L;t++){const n=L>1?t/(L-1):.5,o=d.dir>0?n:1-n,i=r(0,.42,1-Math.abs(2*n-1))*(.5+j*(.5*o**1.4-.2));e.fillStyle=`rgb(${Math.round(255*i)} ${Math.round(255*i)} ${Math.round(255*i)})`,e.fillRect(R-I+t*E,z-O,E,$)}return u<1}});const $=()=>{const t=h.current;x().forEach((e,n)=>{const r=n===g;t.manage&&(e.setAttribute("aria-selected",String(r)),e.tabIndex=r?0:-1);const o=e.getAttribute("aria-controls")?document.getElementById(e.getAttribute("aria-controls")):null;o&&"none"!==t.panels&&("hidden"===t.panels?o.hidden=!r:o.toggleAttribute("data-active",r))})},E=(t,e=!1)=>{const n=x();if(!n.length)return;const r=(t%n.length+n.length)%n.length;e&&n[r].focus(),r!==g&&(v=y??M(n[g]),g=r,p=performance.now(),$(),A&&!A.still()||(v=null,k()),A.kick(),h.current.onChange?.(r,n[r]))},L=t=>{if(!h.current.manage)return;const e=t.target.closest?.(h.current.tabs),n=e?x().indexOf(e):-1;n>=0&&E(n)},S=t=>{if(!h.current.manage)return;const e={ArrowRight:g+1,ArrowLeft:g-1,Home:0,End:x().length-1};t.key in e&&(t.preventDefault(),E(e[t.key],!0))},F="function"==typeof ResizeObserver?new ResizeObserver(()=>{A?.live||k()}):null;return F?.observe(u),u.addEventListener("click",L),u.addEventListener("keydown",S),$(),k(),o(()=>A,h,t=>{void 0!==t.active&&t.active!==g&&E(t.active),$(),A?.refresh()},{select:E,get active(){return g}},()=>{u.removeEventListener("click",L),u.removeEventListener("keydown",S),F?.disconnect(),b.restore()})}var d=l;export{d as TABS_DEFAULTS,s as indicatorRow,c as streamSpan,u as tabs};//# sourceMappingURL=chunk-KLRF3S7O.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{styleKeeper as t,clamp as e,mountSurface as o,handle as r,house as n}from"./chunk-
|
|
1
|
+
import{styleKeeper as t,clamp as e,mountSurface as o,handle as r,house as n}from"./chunk-GF72XM4C.js";var a={aurora:["#2ee6c8","#9d7bff","#ff6fb5"],brand:["#ffb000","#ffd84d"]},i={palette:"aurora",swell:!0},l=t=>"mono"===t?[]:"string"==typeof t?[...a[t]??a.aurora]:[...t];function s(t,o){if(1===t.length)return t[0];const r=e(o)*(t.length-1),n=Math.min(t.length-2,Math.floor(r)),a=r-n,[i,l]=[t[n],t[n+1]].map(t=>[1,3,5].map(e=>parseInt(t.slice(e,e+2),16)||0));return`rgb(${i.map((t,e)=>Math.round(t+(l[e]-t)*a)).join(" ")})`}function c(t,o,r,n,a,i){const l=t=>{const o=Math.round(255*e(t)/2.2);return`rgb(${o} ${o} ${o})`},c=o/2,d=r/2,h=.36/(.92-.16*a)*Math.min(o,r),u=.86+.46*a,f=n*(.25+.6*a),p=t.createRadialGradient(c,d,.92*h,c,d,1.3*h);p.addColorStop(0,l(.36*u)),p.addColorStop(1,"#000"),t.fillStyle=p,t.fillRect(0,0,o,r),t.save(),t.beginPath(),t.arc(c,d,h,0,2*Math.PI),t.clip();const g=c+.8*Math.cos(f)*h*.62,m=d-.55*h*.62,M=t.createRadialGradient(g,m,0,g,m,1.7*h);M.addColorStop(0,l(.95*u)),M.addColorStop(.55,l(.5*u)),M.addColorStop(1,l(.18)),t.fillStyle=M,t.fillRect(c-h,d-h,2*h,2*h),t.globalCompositeOperation="lighter",t.lineWidth=Math.max(1.5,.05*h);for(let e=0;e<6;e++){const o=e/6*Math.PI+.35*n,r=Math.sin(o);r<0||(t.strokeStyle=l(.16*r),t.beginPath(),t.ellipse(c,d,h*Math.abs(Math.cos(o)),h,0,0,2*Math.PI),t.stroke())}const S=t.createRadialGradient(c,d,.7*h,c,d,h);if(S.addColorStop(0,"#000"),S.addColorStop(1,l(.3)),t.fillStyle=S,t.fillRect(c-h,d-h,2*h,2*h),t.restore(),t.globalCompositeOperation="source-over",!i.length)return;t.globalCompositeOperation="color";const k=.4*n,v=.5*a,y=t.createLinearGradient(c-Math.cos(k)*h,d-Math.sin(k)*h,c+Math.cos(k)*h,d+Math.sin(k)*h);y.addColorStop(0,s(i,v)),y.addColorStop(.5,s(i,v+.25)),y.addColorStop(1,s(i,v+.5)),t.fillStyle=y,t.fillRect(0,0,o,r),t.globalCompositeOperation="source-over"}function d(a,s={}){const d={current:{...i,...s}},h=t();let u="idle",f=0,p=e(d.current.level??0),g=p,m=0,M=0,S=l(d.current.palette),k=null,v=null,y=0;const b=t=>{t.canvas.style.filter=!t.dark()&&S.length?"brightness(.68) saturate(1.35)":""},C=t=>{a.style.setProperty("--ascii-level",t.toFixed(3)),d.current.swell&&h.set(a,"scale",String(1+.1*t))};k=o({host:a,outset:Math.round(.08*(a.offsetWidth||0)),look:()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:6,cellAspect:.62,glyphScale:.92,fit:"cover",color:S.length?"source":"ink",contrast:2.2,brightness:1.1-.5,saturation:1.4,...d.current.look}),ink:()=>d.current.ink??"--ascii-ink-strong",kit:d,reducedMotion:()=>d.current.reducedMotion,onTheme:()=>k&&b(k),onFail:()=>{k=null},paint:({pen:t,w:o,h:r,now:a,still:i})=>{const l=M?Math.min(64,a-M):16;M=a;const s=e((t=>"listening"===u?v?v.read():p:"thinking"===u?.2+.1*Math.sin((t-f)/120):"done"===u?m*(1-n(e((t-f)/420))):p)(a));return i||"done"===u?g=s:g+=(s-g)*(1-(1-(s>g?.45:.12))**(l/16.7)),i||C(g),c(t,o,r,i?0:a/1e3,g,S),!0}}),k&&b(k);const w=()=>{y++,v&&(v.stream.getTracks().forEach(t=>t.stop()),v.context.close().catch(()=>{}),v=null)},P=t=>{"listening"!==t&&w(),"done"===t&&(m=g),u=t,f=performance.now(),a.dataset.state=t,k||C("listening"===t?p:0),k?.kick()};return r(()=>k,d,t=>{S=l(t.palette),void 0!==t.level&&(p=e(t.level)),k?.refresh(),k&&b(k)},{level(t){p=e(Number.isFinite(t)?t:0),k||"listening"!==u||C(p),k?.kick()},listen:()=>P("listening"),think:()=>P("thinking"),done:()=>P("done"),idle:()=>{p=0,P("idle")},async mic(){w();const t=y,e="undefined"!=typeof navigator?navigator.mediaDevices:void 0,o=globalThis.AudioContext;if(!e?.getUserMedia||!o)return!1;let r;try{r=await e.getUserMedia({audio:!0})}catch{return!1}if(t!==y)return r.getTracks().forEach(t=>t.stop()),!1;const n=new o,a=n.createAnalyser();a.fftSize=1024,n.createMediaStreamSource(r).connect(a);const i=new Uint8Array(a.fftSize);return v={stream:r,context:n,read(){a.getByteTimeDomainData(i);let t=0;for(const e of i)t+=((e-128)/128)**2;return 5*Math.sqrt(t/i.length)}},P("listening"),!0},get state(){return u},get current(){return g}},()=>{w(),h.restore(),a.style.removeProperty("--ascii-level"),delete a.dataset.state})}var h=i;export{h as VOICE_ORB_DEFAULTS,a as VOICE_PALETTES,c as paintOrb,d as voiceOrb};//# sourceMappingURL=chunk-KXI3T72F.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{scenePreset as e,FIELD_GRAPHITE as t,narrow as r}from"./chunk-
|
|
1
|
+
import{scenePreset as e,FIELD_GRAPHITE as t,narrow as r}from"./chunk-3VEMKDBW.js";var l=e({id:"swell",name:"Swell",description:"A fine grid that swells in slow rolling waves, quiet in the middle. Dots by default, or characters.",cellSize:10,opacity:.6,scene:"swell",mark:"dot",charset:" .:-=+*#",hover:"lantern",graphite:t,tune:()=>({scale:r()?1.5:1,contrast:.62,brightness:-.19,blend:"auto",lantern:{radius:.12,strength:.5,trail:1,follow:8},trail:{strength:.7,radius:.35}})});export{l as swell};//# sourceMappingURL=chunk-KY5KCIZE.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{clamp as t,hash as e}from"./chunk-
|
|
1
|
+
import{clamp as t,hash as e}from"./chunk-GF72XM4C.js";function n(t){const e=()=>({image:t,width:t.naturalWidth,height:t.naturalHeight});return t.complete&&t.naturalWidth?Promise.resolve(e()):new Promise((n,o)=>{const a=()=>{r(),n(e())},i=()=>{r(),o(new Error(`Could not load ${t.src}`))},r=()=>{t.removeEventListener("load",a),t.removeEventListener("error",i)};t.addEventListener("load",a),t.addEventListener("error",i)})}function o(t,e=document.createElement("img")){return(t=>{try{return"undefined"!=typeof location&&new URL(t,location.href).origin!==location.origin}catch{return!1}})(t)&&!e.crossOrigin&&(e.crossOrigin="anonymous"),e.decoding="async",e.src=t,e}function a(t,e,n,o,a,i,r=.5,h=.5){if(a<=0||i<=0||!e.width||!e.height)return;const l=Math.max(a/e.width,i/e.height),c=a/l,d=i/l;t.drawImage(e.image,(e.width-c)*r,(e.height-d)*h,c,d,n,o,a,i)}function i(e,n,o=.08){const a=Math.min(1,420/Math.max(1,e.width,e.height)),i=document.createElement("canvas");i.width=Math.max(1,Math.round(e.width*a)),i.height=Math.max(1,Math.round(e.height*a));const r=i.getContext("2d",{willReadFrequently:!0});if(!r)return e;let h;r.drawImage(e.image,0,0,i.width,i.height);try{h=r.getImageData(0,0,i.width,i.height)}catch{return e}const l=h.data,c=new Uint32Array(256),d=l.length/4,s=t=>.2126*l[t]+.7152*l[t+1]+.0722*l[t+2];for(let t=0;t<l.length;t+=4)c[Math.round(s(t))]++;let u=0,f=255,g=0;for(let t=0;t<256;t++)if(g+=c[t],g>=.02*d){u=t;break}g=0;for(let t=255;t>=0;t--)if(g+=c[t],g>=.02*d){f=t;break}const m=Math.max(1,f-u);for(let e=0;e<l.length;e+=4){let a=t((s(e)-u)/m);n&&(a=1-a),l[e]=l[e+1]=l[e+2]=Math.round(255*(o+(1-o)*a)),l[e+3]=255}return r.putImageData(h,0,0),{image:i,width:i.width,height:i.height}}var r={strong:1,text:.82,meta:.55,tile:.42,icon:.62},h=new Set(["IMG","SVG","svg","VIDEO","PICTURE"]),l=t=>[...t.children].flatMap(t=>h.has(t.tagName)?[t]:[t,...l(t)]);function c(e,n,o,a){const i=document.createElement("canvas");i.width=Math.max(2,Math.round(2*n)),i.height=Math.max(2,Math.round(2*o));const c=[],d=i.getContext("2d");if(!d)return{canvas:i,rects:c};d.scale(2,2),d.fillStyle="#000",d.fillRect(0,0,n,o);const s=a(e),u=e.getBoundingClientRect(),f=u.width/(e.offsetWidth||u.width||1)||1,g=t=>{for(let n=t;n&&n!==e.parentElement;n=n.parentElement){const t=n.dataset?.paint;if(t&&void 0!==r[t])return r[t]}return parseFloat(t?getComputedStyle(t).fontWeight:"400")>=500?1:.7},m=e=>{const n=Math.round(255*t(e));return`rgb(${n} ${n} ${n})`},w=l(e),p=[e,...w].filter(t=>{const e=t.dataset?.paint;return"tile"===e||"icon"===e||!e&&h.has(t.tagName)&&!t.closest("[data-paint]")});for(const t of p){const e=a(t);if(e.w<=0||e.h<=0)continue;const n=t.dataset?.paint;d.fillStyle=m("icon"===n?r.icon:r.tile),d.beginPath(),"icon"===n||"svg"===t.tagName.toLowerCase()?d.arc(e.x+e.w/2,e.y+e.h/2,.4*Math.min(e.w,e.h),0,2*Math.PI):d.roundRect(e.x,e.y,e.w,e.h,Math.min(parseFloat(getComputedStyle(t).borderTopLeftRadius)||0,e.h/2)),d.fill(),c.push(e)}const y=document.createTreeWalker(e,4),x=document.createRange();d.textBaseline="middle";for(let t=y.nextNode();t;t=y.nextNode()){const e=t.parentElement;if(!e||e.closest('[data-paint="none"]'))continue;const n=getComputedStyle(e);d.font=`${n.fontStyle} ${n.fontWeight} ${n.fontSize} ${n.fontFamily}`,d.fillStyle=m(g(e)),d.shadowColor=d.fillStyle,d.shadowBlur=4;for(const e of t.data.matchAll(/\S+/g)){x.setStart(t,e.index),x.setEnd(t,e.index+e[0].length);const n=x.getClientRects()[0];if(!n)continue;const o={x:s.x+(n.left-u.left)/f,y:s.y+(n.top-u.top)/f,w:n.width/f,h:n.height/f};d.fillText(e[0],o.x,o.y+o.h/2),c.push(o)}}return d.shadowBlur=0,x.detach?.(),{canvas:i,rects:c}}function d(t){const n=new Set,o=[];for(const a of t)for(let t=6*Math.floor((a.y-2)/6);t<a.y+a.h+2;t+=6)for(let i=4*Math.floor((a.x-2)/4);i<a.x+a.w+2;i+=4){const a=`${i},${t}`;n.has(a)||(n.add(a),o.push({x:i,y:t,seed:e(i,t)}))}return o}function s(t,e,n,o,a,i,r=1,h=.32){for(let l=0;l<n.length;l++){const c=n[l],d=(a-o[l]*(1-h))/h;if(d<=0)continue;const s=d>=1?0:1-d;let u=c.x,f=c.y;if(s>0){const[t,e]=i(c,s);u+=t,f+=e}t.globalAlpha=r*(1-s*s),t.drawImage(e,2*c.x,2*c.y,8,12,u,f,4,6)}t.globalAlpha=1}function u(t,e){if("undefined"==typeof document||document.getElementById(t))return;const n=document.createElement("style");n.setAttribute("id",t),n.textContent=e,(document.head??document.documentElement).appendChild(n)}export{d as blocksOf,s as drawBlocks,a as drawCover,o as imageFor,n as imageReady,u as injectStyle,c as snapshot,i as toneOf};//# sourceMappingURL=chunk-LE53AVKR.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{snapshot as t}from"./chunk-
|
|
1
|
+
import{snapshot as t}from"./chunk-Z2FRNFMB.js";import{hash as e,styleKeeper as a,mountSurface as n,handle as o,house as i,prefersReduced as s}from"./chunk-GF72XM4C.js";var r={dissolve:300,condense:300},c=10,l=16,h=t=>.5-.5*Math.cos(Math.PI*Math.min(1,Math.max(0,t))),d=t=>i(Math.min(1,Math.max(0,t))),u=()=>{let t=()=>{};return[new Promise(e=>{t=e}),t]};function g(t,a,n,o,i,s=!1){const r=a.width,h=a.height,d=Math.ceil(r/c),u=Math.ceil(h/l),g=[],m=[],f=Math.max(...[[0,0],[r,0],[0,h],[r,h]].map(([t,e])=>Math.hypot(t-o.x,e-o.y)))||1,x=function(t,e,a){const n=p.get(t);if(n)return n;const o=Object.assign(document.createElement("canvas"),{width:e,height:a}),i=Object.assign(document.createElement("canvas"),{width:t.width,height:t.height}),s=o.getContext("2d"),r=i.getContext("2d"),c={mask:o,maskPen:s,data:s.createImageData(e,a),clip:i,clipPen:r};return p.set(t,c),c}(a,d,u),M=x.data.data;let w=0;for(let t=0;t<u;t++)for(let a=0;a<d;a++){const i=a*c,r=t*l,h=Math.hypot(i+5-o.x,r+8-o.y)/f*.72+.28*e(i,r),u=s?n-h-.12:h-n;M[4*(t*d+a)+3]=u>0?255:0,u>0&&w++,u>0&&u<.07?g.push([i,r]):u<=0&&u>-.12&&m.push([i,r,-u/.12])}if(w){x.maskPen.putImageData(x.data,0,0);const e=x.clipPen;e.globalCompositeOperation="source-over",e.clearRect(0,0,r,h),e.drawImage(a,0,0),e.globalCompositeOperation="destination-in",e.imageSmoothingEnabled=!1,e.drawImage(x.mask,0,0,d*c,u*l),e.globalCompositeOperation="source-over",t.drawImage(x.clip,0,0)}for(const[n,o,r]of m)t.globalAlpha=(1-r)*(s?.7:1),t.drawImage(a,n,o,c,l,n+18*(e(o,n+i)-.5)*r,o-10*r*(s?-.6:1),c,l);t.globalAlpha=1,t.globalCompositeOperation="lighter",t.globalAlpha=s?.5:1;for(const[e,n]of g)t.drawImage(a,e,n,c,l,e,n,c,l);t.globalAlpha=1,t.globalCompositeOperation="source-over"}var p=new WeakMap;function m(e,i={}){const c={current:{...r,...i}},l=a();let p=null,m=0,f=0,x=Promise.resolve(),M=0,w=null;const b="function"==typeof matchMedia&&matchMedia("(pointer: coarse)").matches?1:2,k=t=>{t.handed(),t.landing(),t.done()};w=n({host:e,look:()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:8,cellAspect:.6,glyphScale:.9,contrast:1.15,shade:.55,...c.current.look}),ink:()=>c.current.ink??"--ascii-ink-strong",kit:{get current(){return{...c.current,poster:void 0}}},reducedMotion:()=>c.current.reducedMotion,resolution:b,onFail:()=>{w=null;const t=p;p=null,l.restore(),t&&k(t)},paint:({pen:t,width:e,height:a,now:n})=>{const o=p;if(!o)return!1;const i=n-o.start,s=i/o.outMs,r=o.next?(n-o.nextAt)/o.nextMs:0;var c;s<1&&g(t,o.out,1.12*h(s),o.at,++f),o.next&&r>0&&g(t,o.next,.1+1.14*(c=r,1-(1-Math.min(1,Math.max(0,c)))**2),o.at,f,!0);const l=o.next?(n-o.nextAt-o.nextMs+o.hand)/o.hand:-1,u=d(i/o.hand)*(1-d(l));u<1&&(t.globalAlpha=1-u,t.fillStyle="#000",t.fillRect(0,0,e,a),t.globalAlpha=1);const x=Math.round(-160*h(2*s)*(o.next?1-h(r):1))/1e3;return x!==m&&(m=x,w?.field.update({brightness:x})),0===o.stage&&i>=o.hand&&(o.stage=1,o.handed()),1===o.stage&&l>=0&&(o.stage=2,o.landing()),!(l>=1)||(p=null,o.done(),!1)}});const v=(t,a)=>{if(t&&"getBoundingClientRect"in t){const e=a.box(t);return{x:(e.x+e.w/2)*b,y:(e.y+e.h/2)*b}}return t?{x:t.x*b,y:t.y*b}:{x:e.offsetWidth/2*b,y:0}},y=a=>t(e,a.box,e.offsetWidth,e.offsetHeight,b,{skip:a.canvas}),A=(t,a)=>{for(const n of[...e.children].filter(t=>void 0===t.dataset.asciiKit&&void 0===t.dataset.asciiPoster))l.set(n,"transition",a?`opacity ${a}ms cubic-bezier(.16, 1, .3, 1)`:"none"),l.set(n,"opacity",t?"1":"0")},C=async(t,a)=>{const n=w;if(!n||(c.current.reducedMotion??s())||!n.live)return void await t();const{dissolve:o,condense:i}=c.current,r=Math.max(1,Math.min(110,o/2,i/2)),[h,d]=u(),[g,f]=u(),[x,M]=u(),b=p={at:v(a??c.current.origin,n),start:performance.now(),hand:r,out:y(n),outMs:Math.max(1,o),next:null,nextAt:0,nextMs:Math.max(1,i),handed:d,landing:f,done:M,stage:0};if(e.dataset.state="out",A(!1,r),n.kick(),await h,p===b){try{await t()}catch(t){throw p===b&&(p=null,l.restore(),w?.field.update({brightness:0})),t}w&&p===b&&(n.canvas.isConnected&&n.canvas.parentElement===e||e.appendChild(n.canvas),A(!1,0),e.dataset.state="in",b.next=y(n),b.nextAt=performance.now(),n.kick(),await g,p===b&&A(!0,r),await x,l.restore(),m=0,w?.field.update({brightness:0}),w?.kick())}};return o(()=>w,c,()=>w?.refresh(),{swap(t,a){M++;const n=x.then(()=>C(t,a)).finally(()=>{0===--M&&delete e.dataset.state});return x=n.catch(()=>{}),n},get busy(){return M>0}},()=>{const t=p;p=null,l.restore(),delete e.dataset.state,t&&k(t)})}var f=r;export{f as PAGE_DISSOLVE_DEFAULTS,g as dissolveFrame,m as pageDissolve};//# sourceMappingURL=chunk-LVCGC3SO.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{MONO as t,GRAPHITE_LIGHT as e,GRAPHITE_DARK as o,pixelSnap as r,parseColor as n,band as c,ditherIndex as i,toneAlpha as a,vnoise as l}from"./chunk-ZCHGV2CV.js";import{mountCanvas as s}from"./chunk-3OD5BMF5.js";function h(s,h,f,d,g={x:.5,y:.5},u={}){const{fontSize:M=13,chars:m=" .:-=+*#%@",accentColor:p,color:$,octaves:x=4,speed:S=1,scale:b=1,accentThreshold:y=.9,mouseWarp:z=.3,lightMode:C=!1}=u,k=Array.from(m),j=.62*M,v=1.3*M,w=Math.ceil(h/j),A=Math.ceil(f/v);s.clearRect(0,0,h,f),s.font=`${M}px ${t}`,s.textBaseline="top";const B=C?e:o;let T=B.r,V=B.g,q=B.b;const D=r(s);if($){const t=n($);t&&(T=t.r,V=t.g,q=t.b)}let F=T,G=V,H=q;const N=p?n(p):null;N&&(F=N.r,G=N.g,H=N.b);const O=.035*b,R=d*S,W=Math.min(6,Math.max(1,x)),Z=(t,e)=>{let o=0,r=.5,n=1,c=0;for(let i=0;i<W;i++)o+=l(t*n,e*n)*r,c+=r,r*=.5,n*=2.1;return o/c};for(let t=0;t<A;t++)for(let e=0;e<w;e++){const o=e*O+.06*R,r=t*O*1.3-.04*R,n=e/w-g.x,l=t/A-g.y,h=Math.sqrt(n*n+l*l),f=z>0?.12*Math.max(0,1-h/z):0,d=Z(o+f*Math.sin(1.3*R+8*l),r+f*Math.cos(.9*R+8*n)),M=c(.5*d+.5,.7,.83);if(M<=0)continue;const m=k[i(M,k.length,e,t,u.ditherStrength)];if(" "===m)continue;const p=!!N&&M>y,$=a(M);s.fillStyle=p?`rgba(${F},${G},${H},${$})`:`rgba(${T},${V},${q},${$})`,s.fillText(m,D(e*j),D(t*v))}}var f={id:"noise",name:"Noise",description:"A slow fractal noise field that warps around the cursor.",cellSize:13,speed:.5,cursor:!0,mount:t=>s(t,(t,e,o,r,n,c)=>h(t,e,o,r,n,{ditherStrength:c.ditherStrength,fontSize:c.fontSize,chars:c.chars,lightMode:c.lightMode,color:c.ink,accentColor:c.accent}))};export{f as noise,h as renderNoiseBackground};//# sourceMappingURL=chunk-M5VVLYI2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{snapshot as e,drawCover as t,toneOf as n}from"./chunk-
|
|
1
|
+
import{snapshot as e,drawCover as t,toneOf as n}from"./chunk-LE53AVKR.js";import{styleKeeper as r,srOnly as o,mountSurface as i,clamp as a,smoothstep as s,easeOut as l,handle as h}from"./chunk-GF72XM4C.js";var c={threshold:64},u=.3;function d(e,t,n=300,r=.86,o=.2){const i=2*Math.sqrt(n)*r,a=Math.max(1,Math.ceil(240*t)),s=t/a;for(let t=0;t<a;t++)e.v+=(-n*(e.x-e.to)-i*e.v)*s,e.x+=e.v*s;return!(Math.abs(e.x-e.to)<o&&Math.abs(e.v)<12*o)||(e.x=e.to,e.v=0,!1)}function p(p,f){const m={current:{...c,...f}},v=r(),g=()=>m.current.content??p.children[0]??null,y=o("",!0),w={x:0,v:0,to:0};let M="idle",x=!1,b=!1,k=0,E=-1,L=0,P=0,A=0,C=!0,S=0,I=null,T=[];const F=new WeakSet,R=e=>{y.textContent=e};I=i({host:p,look:()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:5,cellAspect:.62,glyphScale:.94,...m.current.look}),ink:()=>m.current.ink??"--ascii-ink-strong",kit:m,reducedMotion:()=>m.current.reducedMotion,resolution:2,onFail:()=>{I=null},paint:({pen:r,w:o,now:i,still:h,scale:c,box:p})=>{const f=A?Math.min(1/30,(i-A)/1e3):1/60;A=i;let y=x;h?(w.x=w.to,w.v=0):x||(y=d(w,f)||y),"refreshing"===M&&(L+=6.5*f,y=!0),"done"===M&&i-P<320&&(y=!0);const b=g();b&&v.set(b,"translate",`0 ${Math.max(0,w.x).toFixed(2)}px`),r.setTransform(c,0,0,c,0,0);const k=m.current,E=Math.max(0,w.x),F=a(E/k.threshold),R=Math.min(k.threshold,48),q="idle"===M||"pulling"===M?s(.1,.55,F):a(E/R),Y=o/2,D=Math.min(E,R)/2+.25*Math.max(0,E-R);"pulling"===M&&F>=1&&!S&&(S=i),F<1&&(S=0);const H=S&&!h&&i-S<260?.14*Math.sin(Math.PI*((i-S)/260)):0;if(H&&(y=!0),E>.5&&q>.01){if(r.save(),r.beginPath(),r.rect(0,0,o,E),r.clip(),r.translate(Y,D),r.scale(q*(1+H),q*(1+H)),r.lineWidth=4,r.lineCap="round","idle"===M||"pulling"===M){const e=-Math.PI/2+.03*Math.max(0,E-k.threshold);r.strokeStyle=`rgba(255,255,255,${.55+.45*F})`,r.beginPath(),r.arc(0,0,11,e,e+2*Math.PI*Math.max(.02,F)),r.stroke()}else{const e="done"===M&&C?h?1:l((i-P)/300):0,t="refreshing"!==M||h?1:l((i-P)/240),n=24,o=2*Math.PI*(1-.22*t);for(let i=0;i<n;i++){const a=L-Math.PI/2+i/n*o,s=1-.85*t*(1-i/(n-1));r.strokeStyle=`rgba(255,255,255,${s*(1-e)*("done"!==M||C?1:.4)})`,r.beginPath(),r.arc(0,0,11,a,a+o/n+.02),r.stroke()}e>0&&function(e,t,n,r,o){if(o<=0)return;const i=[[-.82,.02],[-.26,.56],[.86,-.6]].map(([e,o])=>[t+e*r,n+o*r]),a=Math.hypot(i[1][0]-i[0][0],i[1][1]-i[0][1])+Math.hypot(i[2][0]-i[1][0],i[2][1]-i[1][1]);e.save(),e.strokeStyle="#fff",e.lineWidth=4.5,e.lineCap="round",e.lineJoin="round",e.setLineDash([a*o,a]),e.beginPath(),e.moveTo(i[0][0],i[0][1]),e.lineTo(i[1][0],i[1][1]),e.lineTo(i[2][0],i[2][1]),e.stroke(),e.restore()}(r,0,0,11,e)}r.restore()}return T=T.filter(o=>{if(!o.row.isConnected)return W(o,!0),!1;const a=h?1:(i-o.start)/760;if(a<0||!Number.isFinite(a))return y=y||Number.isFinite(a),!0;if(a>=u&&W(o),a>=1)return W(o,!0),!1;const s=p(o.row);(!o.snap||Math.abs(o.snap.width/2-s.w)>.5||Math.abs(o.snap.height/2-s.h)>.5)&&(o.snap=e(o.row,s.w,s.h,e=>{const t=p(e);return{x:t.x-s.x,y:t.y-s.y,w:t.w,h:t.h}}).canvas,o.photos=[...o.row.querySelectorAll("img")]);const c=o.snap;return o.photos.length&&function(e,r,o){const i=r.getContext("2d"),a=o(e.row);e.photos=e.photos.filter(e=>{if(!e.complete)return!0;if(!i||!e.naturalWidth)return!1;const r=o(e),s=r.x-a.x,l=r.y-a.y,h=Math.min(parseFloat(getComputedStyle(e).borderTopLeftRadius)||0,r.w/2,r.h/2);return i.save(),i.setTransform(2,0,0,2,0,0),i.beginPath(),i.roundRect(s,l,r.w,r.h,h),i.clip(),i.fillStyle="#000",i.fillRect(s,l,r.w,r.h),t(i,n({image:e,width:e.naturalWidth,height:e.naturalHeight},!I?.dark()),s,l,r.w,r.h),i.restore(),!1})}(o,c,p),r.globalAlpha=a<u?l(a/u,3):1-l((a-u)/.7,3),r.drawImage(c,s.x,s.y,s.w,s.h),r.globalAlpha=1,y=!0,!0}),y||(A=0),y}});const q=()=>I?.kick();function W(e,t=!1){const n=e.row.style;e.shown||(e.shown=!0,n.transition="opacity 280ms cubic-bezier(.16, 1, .3, 1)",n.opacity=e.opacity),t&&(n.transition=e.transition)}const Y=(e,t)=>{if(I&&!I.still()){for(const n of e)n instanceof HTMLElement&&!F.has(n)&&(F.add(n),T.push({row:n,snap:null,start:t,opacity:n.style.opacity,transition:n.style.transition,shown:!1,photos:[...n.querySelectorAll("img")]}),n.style.transition="none",n.style.opacity="0");q()}},D=()=>{const e=performance.now();T.forEach(t=>{t.start===1/0&&(t.start=e)}),q()},H=e=>new Promise(t=>setTimeout(t,e)),$=async()=>{if("refreshing"===M||"done"===M)return;const e=m.current,t=!I||I.still();M="refreshing",x=b=!1,w.to=Math.min(e.threshold,48),P=performance.now(),p.setAttribute("aria-busy","true"),R(e.messages?.refreshing??"Refreshing."),q(),C=!0;try{await Promise.all([e.onRefresh(),H(t?0:600)])}catch{C=!1}if("refreshing"===M){if(C&&e.reveal&&!t){await new Promise(e=>"function"==typeof requestAnimationFrame?requestAnimationFrame(()=>e()):e());const t=g();t&&Y(t.querySelectorAll(e.reveal),1/0)}M="done",P=performance.now(),R(C?e.messages?.done??"Updated.":e.messages?.failed??"Couldn’t refresh."),q(),await H(t?0:620),"done"===M?(M="idle",w.to=0,D(),p.removeAttribute("aria-busy"),q()):D()}},j=e=>{0!==e.button||"idle"!==M||p.scrollTop>0||(x=!0,b=!1,k=e.clientY,E=e.pointerId)},z=e=>{if(!x||e.pointerId!==E)return;e.clientY<k&&(k=e.clientY);const t=(e.clientY-k)/(p.getBoundingClientRect().height/(p.clientHeight||1)||1);if(!b){if(t<6)return;b=!0,M="pulling";try{p.setPointerCapture?.(e.pointerId)}catch{}}w.x=w.to=(e=>128*(1-Math.exp(-Math.max(0,e)/128)))(t-6),w.v=0,q()},G=()=>{if(x&&(x=!1,b)){if(b=!1,w.x>=m.current.threshold)return M="idle",void $();M="idle",w.to=0,q()}},N=e=>{b&&e.preventDefault()},B=e=>{x&&e.preventDefault()};return I?(v.set(p,"overscroll-behavior-y","contain"),p.appendChild(y),p.addEventListener("pointerdown",j),p.addEventListener("pointermove",z),p.addEventListener("pointerup",G),p.addEventListener("pointercancel",G),p.addEventListener("touchmove",N,{passive:!1}),p.addEventListener("dragstart",B),p.addEventListener("selectstart",B)):p.appendChild(y),h(()=>I,m,()=>I?.refresh(),{refresh:$,revealRows:e=>Y(e,performance.now()),get state(){return M}},()=>{M="idle",T.forEach(e=>{e.row.style.opacity=e.opacity,e.row.style.transition=e.transition}),T=[],p.removeEventListener("pointerdown",j),p.removeEventListener("pointermove",z),p.removeEventListener("pointerup",G),p.removeEventListener("pointercancel",G),p.removeEventListener("touchmove",N),p.removeEventListener("dragstart",B),p.removeEventListener("selectstart",B),p.removeAttribute("aria-busy"),y.remove(),v.restore()})}var f=c;export{f as PULL_REFRESH_DEFAULTS,p as pullRefresh,d as stepSpring};//# sourceMappingURL=chunk-MJJSZS23.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{imageFor as e,injectStyle as t,imageReady as r,drawCover as i}from"./chunk-
|
|
1
|
+
import{imageFor as e,injectStyle as t,imageReady as r,drawCover as i}from"./chunk-LE53AVKR.js";import{styleKeeper as n,clamp as o,mountSurface as a,handle as s,house as l}from"./chunk-GF72XM4C.js";function c(c,d){const u={current:{position:50,...d}},p=n();let h=o(u.current.position,0,100),m=null,g=null,v={from:h,to:h,at:-1e9},b=0,f=!1;const w=[];let A=u.current.position;g=a({host:c,layer:"under",look:()=>({blend:"coarse",mark:"glyph",charset:" .:-=+*#%@",font:'"Geist", Arial, sans-serif',fontWeight:600,cellSize:6,cellAspect:.8,glyphScale:.96,color:"source",levels:"auto",saturation:1.3,contrast:1.45,gamma:.85,brightness:.14,hover:"trail",trail:{strength:.7,radius:.3},...u.current.look}),ink:()=>u.current.ink??"--ascii-ink-strong",kit:u,reducedMotion:()=>u.current.reducedMotion,resolution:(e,t)=>{const r=Math.min(1600,Math.max(2,Math.round(2*e)));return[r,Math.max(2,Math.round(r*t/Math.max(1,e)))]},onFail:()=>{g=null},paint:({pen:e,width:t,height:r})=>(e.imageSmoothingQuality="high",m&&i(e,m,0,0,t,r),!1)});const k="string"==typeof u.current.image?e(u.current.image):u.current.image,x=c.querySelector('[role="slider"]'),y=c.querySelector("[data-compare-line]"),E=x??document.createElement("div"),M=y??document.createElement("span"),L=e=>{void 0===e&&E.hasAttribute("aria-label")||E.setAttribute("aria-label",e??"Photo and ASCII split")},C=()=>{const e=Math.round(h);p.set(c,"--ascii-pos",`${h}%`),E.setAttribute("aria-valuenow",String(e)),E.setAttribute("aria-valuetext",`${e}% photo, ${100-e}% ASCII`)},S=(e,t=!1)=>{if(e=o(e,0,100),!g)return void(h=e);if(b&&(cancelAnimationFrame(b),b=0),!t||g.still()||Math.abs(e-h)<.5)return h=e,C(),void u.current.onChange?.(h);v={from:h,to:e,at:performance.now()};const r=e=>{const t=o((e-v.at)/280);h=v.from+(v.to-v.from)*l(t),C(),u.current.onChange?.(h),b=t<1?requestAnimationFrame(r):0};b=requestAnimationFrame(r)},N=e=>{const t=c.getBoundingClientRect();return t.width?(e-t.left)/t.width*100:h},F=e=>{if(0!==e.button)return;c.setPointerCapture?.(e.pointerId),f=!0,c.dataset.dragging="";const t=N(e.clientX);S(t,Math.abs(t-h)>3),E.focus({preventScroll:!0})},I=e=>{f&&S(N(e.clientX))},j=()=>{f=!1,delete c.dataset.dragging},q=e=>{const t={ArrowLeft:-5,ArrowDown:-5,ArrowRight:5,ArrowUp:5,PageDown:-20,PageUp:20}[e.key],r="Home"===e.key?0:"End"===e.key?100:void 0!==t?5*Math.round(h/5)+t:null;null!==r&&(e.preventDefault(),S(r,!0))};let P=()=>{};if(g){t("ascii-kit-compare","\n:where(.ascii-compare-photo){position:absolute;inset:0;width:100%;height:100%;object-fit:cover;pointer-events:none;clip-path:inset(0 calc(100% - var(--ascii-pos, 50%)) 0 0)}\n:where(.ascii-compare-line){position:absolute;top:0;bottom:0;left:var(--ascii-pos, 50%);width:2px;translate:-50% 0;background:#fff;box-shadow:0 0 0 .5px rgb(0 0 0 / .25),0 0 12px rgb(0 0 0 / .45);pointer-events:none}\n:where(.ascii-compare-handle){position:absolute;top:50%;left:var(--ascii-pos, 50%);display:grid;place-items:center;width:40px;height:40px;translate:-50% -50%;border-radius:50%;background:#fff;color:#111;box-shadow:0 0 0 1px rgb(0 0 0 / .08),0 4px 14px rgb(0 0 0 / .4);cursor:grab;touch-action:none}\n:where(.ascii-compare-handle:focus-visible){outline:2px solid #fff;outline-offset:3px}\n"),p.set(c,"overflow","hidden"),p.set(c,"touch-action","pan-y"),p.set(c,"user-select","none"),p.set(c,"cursor","ew-resize");const e={className:k.className,hidden:k.getAttribute("aria-hidden")};P=()=>{k.className=e.className,null===e.hidden?k.removeAttribute("aria-hidden"):k.setAttribute("aria-hidden",e.hidden)},k.className=(e.className?`${e.className} `:"")+"ascii-compare-photo",k.setAttribute("aria-hidden","true"),k.draggable=!1,y||(M.className="ascii-compare-line",M.setAttribute("aria-hidden","true")),x||(E.className="ascii-compare-handle",E.innerHTML='<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m9 7-5 5 5 5M15 7l5 5-5 5"/></svg>',E.setAttribute("role","slider"),E.tabIndex=0),L(u.current.label),E.setAttribute("aria-valuemin","0"),E.setAttribute("aria-valuemax","100"),E.setAttribute("aria-orientation","horizontal");for(const e of[k,M,E])c.contains(e)||(c.appendChild(e),w.push(e));C(),c.addEventListener("pointerdown",F),c.addEventListener("pointermove",I),c.addEventListener("pointerup",j),c.addEventListener("pointercancel",j),E.addEventListener("keydown",q),r(k).then(e=>{m=e,g?.kick()},()=>{})}else c.contains(k)||("static"===getComputedStyle(c).position&&p.set(c,"position","relative"),k.setAttribute("style","position:absolute;inset:0;width:100%;height:100%;object-fit:cover;border-radius:inherit"),c.appendChild(k),w.push(k));return s(()=>g,u,e=>{L(e.label),e.position!==A&&(A=e.position,S(e.position,!0)),g?.refresh()},{set:S,get position(){return h}},()=>{b&&cancelAnimationFrame(b),c.removeEventListener("pointerdown",F),c.removeEventListener("pointermove",I),c.removeEventListener("pointerup",j),c.removeEventListener("pointercancel",j),E.removeEventListener("keydown",q),delete c.dataset.dragging,w.forEach(e=>e.remove()),P(),p.restore()})}export{c as compare};//# sourceMappingURL=chunk-MZFK765W.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{clamp as e,hash as t,styleKeeper as r,mountSurface as o,handle as n,prefersReduced as i}from"./chunk-
|
|
1
|
+
import{clamp as e,hash as t,styleKeeper as r,mountSurface as o,handle as n,prefersReduced as i}from"./chunk-GF72XM4C.js";var a={kind:"heart",icon:"svg",manage:!0,outset:40,layer:"under"},l=t=>1-(1-e(t))**3,s=e=>e>=1?1:1-Math.exp(-5*e)*Math.cos(9*e);function c(e,t,r,o,n){if(e.beginPath(),"heart"===t){const t=n/29;for(let n=0;n<=56;n++){const i=n/56*Math.PI*2,a=16*Math.sin(i)**3,l=-(13*Math.cos(i)-5*Math.cos(2*i)-2*Math.cos(3*i)-Math.cos(4*i));0===n?e.moveTo(r+a*t,o+(l-2.5)*t):e.lineTo(r+a*t,o+(l-2.5)*t)}}else{const t=.7*n,i=o-n/2,a=r-t/2,l=.12*n;e.moveTo(a,i+l),e.arcTo(a,i,a+l,i,l),e.lineTo(a+t-l,i),e.arcTo(a+t,i,a+t,i+l,l),e.lineTo(a+t,o+n/2),e.lineTo(r,o+n/2-.27*n),e.lineTo(a,o+n/2)}e.closePath()}function u(e,t,r,o,n,i){const a=e.createRadialGradient(r,o-.1*n,0,r,o,.62*n);a.addColorStop(0,"#fff"),a.addColorStop(.7,"#e6e6e6"),a.addColorStop(1,"#8c8c8c"),e.globalAlpha=i,e.fillStyle=a,e.shadowColor="#bbb",e.shadowBlur=Math.max(2,.08*n),c(e,t,r,o,n),e.fill(),e.shadowBlur=0,e.globalAlpha=1}function d(r,o,n,i,a){const d=n.x+n.w/2,h=n.y+n.h/2,f=n.h,p=1.45*f,k=s(i/.3),g=(e=>e<.5?4*e**3:1-(-2*e+2)**3/2)(e((i-.42)/.3)),b=g>0?p+(f-p)*g:.7*f+(p-.7*f)*k,M=e((i-.04)/.46);M>0&&M<1&&(r.strokeStyle=(t=>{const r=Math.round(255*e(t));return`rgb(${r} ${r} ${r})`})(.8*(1-M)**1.4),r.lineWidth=2.4-1.2*M,r.lineJoin="round",c(r,o,d,h,f*(1.2+.5*l(M))),r.stroke());r.fillStyle="#fff";for(let e=0;e<7;e++){const o=(i-.1-.05*t(e,a))/.5;if(o<=0||o>=1)continue;const n=-Math.PI/2+(e-3)/7*Math.PI*1.7+.3*(t(a+1,e)-.5),s=f*(.75+(.55+.35*t(e,a+2))*l(o)),c=1.8*(1-.6*o);r.globalAlpha=1-o*o,r.beginPath(),r.arc(d+Math.cos(n)*s*1.15,h+Math.sin(n)*s*.85,c,0,2*Math.PI),r.fill()}r.globalAlpha=1,u(r,o,d,h,b,1-e((i-.72)/.28))}function h(e,s={}){const c={current:{...a,...s}},h=r(),f=()=>e.querySelector(c.current.icon)??e,p=()=>!!(c.current.reducedMotion??i());let k="true"===e.getAttribute("aria-pressed"),g=[],b=[],M=null;M=o({host:e,outset:c.current.outset,layer:c.current.layer,look:()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:4,cellAspect:.62,glyphScale:.92,...c.current.look}),ink:e=>c.current.ink??("heart"===c.current.kind?`var(--ascii-like, ${e?"#ff6b70":"#e5484d"})`:"--ascii-ink-strong"),kit:c,reducedMotion:()=>c.current.reducedMotion,onFail:()=>{M=null},paint:({pen:e,w:r,now:o,box:n})=>{const i=n(f()),a=c.current.kind;g=g.filter(r=>{const n=(o-r.start)/("burst"===r.kind?560:300);if(n>=1)return!1;if(n<0)return!0;if(e.save(),"burst"===r.kind)d(e,a,i,n,r.seed);else{const r=i.x+i.w/2,o=i.y+i.h/2+3*l(n),s=i.h*(1+.12*l(n));u(e,a,r,o,s,(1-n)**1.4),e.fillStyle="#000";for(let i=o-s/2;i<o+s/2;i+=3)for(let o=r-s/2;o<r+s/2;o+=2)t(o,i)<1.15*n&&e.fillRect(o,i,2,3)}return e.restore(),!0});const s=c.current.limit;if(s&&g.length){const t=n(s),o=t.y+t.h,i=e.createLinearGradient(0,o-2,0,o+8);i.addColorStop(0,"#000"),i.addColorStop(1,"rgb(0 0 0 / 0)"),e.fillStyle="#000",e.fillRect(0,0,r,o-2),e.fillStyle=i,e.fillRect(0,o-2,r,10)}return g.length>0}});const m=()=>{b.forEach(clearTimeout),b=[]},y=()=>{if(m(),h.restore(),!M||p())return;const t=performance.now(),r=f();g=g.filter(e=>"undo"!==e.kind),g.push({kind:"burst",start:t,seed:Math.floor(t)%97}),r!==e&&h.set(r,"opacity","0"),b.push(setTimeout(()=>{h.restore(),r!==e&&"function"==typeof r.animate&&r.animate({opacity:["0","1"],scale:[".7","1"]},{duration:220,easing:"cubic-bezier(.34, 1.42, .64, 1)"})},347.2)),M.kick()},S=()=>{m(),h.restore(),M&&!p()&&(g=g.filter(e=>"burst"!==e.kind),g.push({kind:"undo",start:performance.now(),seed:0}),M.kick())},T=(t=!k)=>{k=t,e.setAttribute("aria-pressed",String(k)),k?y():S()},v=()=>{c.current.manage&&(T(),c.current.onChange?.(k))};return!e.hasAttribute("aria-pressed")&&c.current.manage&&e.setAttribute("aria-pressed","false"),e.addEventListener("click",v),n(()=>M,c,()=>M?.refresh(),{burst:y,undo:S,toggle:T,get pressed(){return k}},()=>{m(),h.restore(),e.removeEventListener("click",v)})}var f=a;export{f as LIKE_BURST_DEFAULTS,d as burstFrame,h as likeBurst,s as springOut};//# sourceMappingURL=chunk-NF4WVWAC.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{mergeOptions as e,prefersReduced as t}from"./chunk-
|
|
1
|
+
import{mergeOptions as e,prefersReduced as t}from"./chunk-GF72XM4C.js";import{disposeKit as r,setPosterSource as o}from"./chunk-FEAFQY7O.js";var s={standard:{label:"Classic ASCII",chars:" .:-=+*#%@"},asciify:{label:"Asciify",chars:" .:-=+YCIFSA#@"},minimal:{label:"Minimal",chars:" .:+"},detailed:{label:"Detailed",chars:" .,:;-~=+*xX#%@"},letters:{label:"Letters",chars:" .liLTYCFSAWM"},technical:{label:"Technical",chars:" ._:;+/>=][{}*$#@"},blocks:{label:"Tonal blocks",chars:" ░▒▓█"},braille:{label:"Braille",chars:" ⠁⠃⠇⡇⣇⣧⣷⣿"}},n=(e,t,r,o)=>"number"==typeof e&&Number.isFinite(e)?Math.min(o,Math.max(r,e)):t;function i(e){if(!e)return;if("dots"===e)return" ·∙•●";const t=s[e];return t&&Object.prototype.hasOwnProperty.call(s,e)?t.chars:e.startsWith(" ")?e:" "+e}function c(s,c){if(!c||!c.preset||"function"!=typeof c.preset.mount)throw new TypeError("background() needs a preset, such as `aurora` imported from asciify-engine/kit.");const l=c.preset;let a=c.poster;const u=e=>({...e,poster:e.preset===l?a:void 0}),p={current:u({...c})};let y=null,d=!1,f=!1;const m=new Set,h=()=>{const e=p.current,t=e.preset;return{speed:n(e.speed,t.speed,0,5),cellSize:n(e.cellSize,t.cellSize,3,96),charset:i(e.charset),cursor:"none"!==e.look?.hover&&(e.cursor??t.cursor),mark:"glyph"===e.mark||"dot"===e.mark?e.mark:void 0,clear:e.clear??!1,dither:n(e.dither,0,0,1),accent:e.accent,text:e.text?.trim()||"ASCIIFY",look:e.look}},b=e=>{const t=p.current,r=t.palette;return("string"==typeof r?r:r?.[e?"dark":"light"])??t.color??t.ink},k=()=>String(n(p.current.opacity,p.current.preset.opacity??1,0,1)),g=()=>!!(p.current.reducedMotion??t()),v=e=>{let t=null;if(t=p.current.preset.mount({host:s,kit:p,settings:h,ink:b,reducedMotion:()=>p.current.reducedMotion,onFail:()=>{y===t&&(y=null)}}),!t)return null;const r=t.canvas.style;return e&&(r.opacity="0",r.transition="opacity 320ms cubic-bezier(.16, 1, .3, 1)",t.canvas.offsetWidth),r.opacity=k(),d&&t.pause(),t},S={position:s.style.getPropertyValue("position"),isolation:s.style.getPropertyValue("isolation")},C=(e,t)=>{t?s.style.setProperty(e,t):s.style.removeProperty(e)};let F=!1;const M=e=>{F=!0,e.destroy(),y&&!f&&("function"==typeof getComputedStyle&&"static"===getComputedStyle(s).position&&s.style.setProperty("position","relative"),s.style.setProperty("isolation","isolate"))},P=e=>{if(f||!e||"function"!=typeof e.mount||e===p.current.preset)return;p.current=u({...p.current,preset:e});const t=y;y=v(!!t&&!g()),t&&(e=>{if(g())return void M(e);e.canvas.style.transition="opacity 320ms cubic-bezier(.16, 1, .3, 1)",e.canvas.style.opacity="0";const t={run:e,timer:setTimeout(()=>{m.delete(t),M(e)},340)};m.add(t)})(t)};y=v(!1);return{get supported(){return!!y&&!f},get field(){return f?null:y?.field??null},get preset(){return p.current.preset},update(t){if(f||!t)return;const{preset:r,...s}=t;"poster"in s&&(a=s.poster),p.current=u(e(p.current,s)),s.poster&&p.current.poster&&o(p,s.poster),r&&r!==p.current.preset?P(r):y&&(y.canvas.style.opacity=k(),y.refresh())},play(){!f&&d&&(d=!1,y?.play())},pause(){f||(d=!0,y?.pause())},setPreset:P,destroy(){if(!f){f=!0;for(const e of m)clearTimeout(e.timer),e.run.destroy(),F=!0;m.clear(),y?.destroy(),y=null,F&&(C("position",S.position),C("isolation",S.isolation)),r(p)}}}}export{c as background,i as backgroundCharset};//# sourceMappingURL=chunk-NW4U2YRE.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parseColor as t,hash2 as e}from"./chunk-ZCHGV2CV.js";import{mountCanvas as o}from"./chunk-
|
|
1
|
+
import{parseColor as t,hash2 as e}from"./chunk-ZCHGV2CV.js";import{mountCanvas as o}from"./chunk-3OD5BMF5.js";function n(o,n,c,r,s={x:.5,y:.5},l={}){const{fontSize:a=14,chars:i=" . · * + ° ★",accentColor:h,color:f,speed:d=1,count:g=180,lightMode:M=!1}=l,m=h??(M?"#6b8700":"#d4ff00");o.clearRect(0,0,n,c),o.textBaseline="middle",o.textAlign="center";const p=n*(.2+.6*s.x),x=c*(.2+.6*s.y),$=.65*Math.sqrt(n*n+c*c);let u=255,S=255,b=255;if(M&&(u=55,S=55,b=55),f){const e=t(f);e&&(u=e.r,S=e.g,b=e.b)}let k=212,z=255,C=0;const y=t(m);y&&(k=y.r,z=y.g,C=y.b);const A=i.replace(/ /g,"").split("");if(0!==A.length){for(let t=0;t<g;t++){const s=e(17*t,3)*Math.PI*2,l=(r*(.15+.85*e(31*t,7))*d*.22+e(13*t,11))%1,i=p+Math.cos(s)*l*$,h=x+Math.sin(s)*l*$;if(i<-20||i>n+20||h<-20||h>c+20)continue;const f=Math.max(6,a*(.4+.9*l));o.font=`${f}px monospace`;const g=A[Math.min(A.length-1,Math.floor(l*A.length))],m=l>.72,y=M?.85*l:.2*l;o.fillStyle=m?`rgba(${k},${z},${C},${Math.min(M?.92:.32,2.2*y)})`:`rgba(${u},${S},${b},${y})`,o.fillText(g,i,h)}o.textAlign="left"}}var c={id:"stars",name:"Stars",description:"A sparse starfield that twinkles, drifts and leans toward the cursor.",cellSize:14,speed:1,cursor:!0,mount:t=>o(t,(t,e,o,c,r,s)=>n(t,e,o,c,r,{fontSize:s.fontSize,chars:s.chars,lightMode:s.lightMode,color:s.ink,accentColor:s.accent}))};export{n as renderStarsBackground,c as stars};//# sourceMappingURL=chunk-ORSI57T2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parseColor as o,fbm as t,hash2 as e}from"./chunk-ZCHGV2CV.js";import{mountCanvas as r}from"./chunk-
|
|
1
|
+
import{parseColor as o,fbm as t,hash2 as e}from"./chunk-ZCHGV2CV.js";import{mountCanvas as r}from"./chunk-3OD5BMF5.js";import{mixHex as l}from"./chunk-GF72XM4C.js";function n(r,l,n,a,i={}){const{fontSize:c=13,chars:s=" .,:;+*#@",color:f="#4caf50",skyColor:h="#1a237e",peakColor:g="#e0e0e0",speed:p=1,roughness:M=.55,heightScale:b=.55,stars:d=!0,lightMode:m=!1}=i,k=.62*c,u=1.4*c,x=Math.ceil(l/k),C=Math.ceil(n/u),S=o(f)??{r:76,g:175,b:80},$=o(h)??{r:26,g:35,b:126},y=o(g)??{r:224,g:224,b:224};r.clearRect(0,0,l,n),r.font=`${c}px "JetBrains Mono", monospace`,r.textBaseline="top";const A=a*p*.4,z=new Array(x);for(let o=0;o<x;o++){const e=(.5*t((o/x+A)*M*3,.5)+.5)*b;z[o]=Math.floor(e*C)}for(let o=0;o<C;o++)for(let t=0;t<x;t++){const l=C-1-z[t],n=o===l;if(!(o>=l)){if(d){const l=e(7*t+Math.floor(.3*A),13*o);if(l>.97){const e=.3*Math.sin(2*a+100*l)+.7;r.globalAlpha=.5*e,r.fillStyle=`rgb(${$.r+60},${$.g+60},${$.b+80})`,r.fillText("·",t*k,o*u)}}continue}const i=(o-l)/Math.max(1,z[t]),c=s[Math.min(s.length-1,Math.floor(i*s.length))];if(" "===c&&!n)continue;const f=n?1:Math.max(0,1-4*i),h=S.r+(y.r-S.r)*f|0,g=S.g+(y.g-S.g)*f|0,p=S.b+(y.b-S.b)*f|0;r.globalAlpha=.5+.5*i,r.fillStyle=`rgb(${h},${g},${p})`,r.fillText(n?s[s.length-1]:c,t*k,o*u)}r.globalAlpha=1}var a={id:"terrain",name:"Terrain",description:"A side-scrolling landscape drawn in density characters.",cellSize:13,speed:1,cursor:!1,mount:o=>r(o,(o,t,e,r,a,i)=>n(o,t,e,r,{fontSize:i.fontSize,chars:i.chars,lightMode:i.lightMode,color:i.ink,peakColor:i.accent??l(i.ink,"#ffffff",.65),skyColor:l(i.ink,"#0c0d0b",.55)}))};export{n as renderTerrainBackground,a as terrain};//# sourceMappingURL=chunk-QSTDYL35.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{hash as e,styleKeeper as t,srOnly as n,mountSurface as r,handle as i}from"./chunk-
|
|
1
|
+
import{hash as e,styleKeeper as t,srOnly as n,mountSurface as r,handle as i}from"./chunk-GF72XM4C.js";import{isGlyphFieldSupported as l}from"../field.js";var o={check:!0,shake:!0};function a(e,t){const n=Math.max(3,3*Math.round(e*t/3));return{cw:n/3*2/t,ch:n/t,cellSize:n/t}}function s(t,n,r,i,l,o=0){const a=24*r+170;if(n<a){const r=(n-24*t)/170;return r<1?1+Math.floor(e(t+o,Math.floor(n/46))*(r<0?3:9)):0}if(!i||l)return 0;const s=(((n-a)/1250-.07*t)%1+1)%1;return s<.3?1+Math.round(8*Math.sin(Math.PI*(s/.3))):0}var c="cubic-bezier(.16, 1, .3, 1)";function d(e,d={}){const u={current:{...o,...d}},h=t(),p=u.current.label??e,m=u.current.text??(p.textContent??"").trim(),f=[...p.childNodes],g=void 0!==u.current.icon?u.current.icon:m?null:e.querySelector("svg"),y=e.getAttribute("aria-label");let v="idle",b=m,x=-1e9,M=0,C=null,w={cw:9,ch:15,cellSize:15};const $=n(m),k=document.createElement("span"),A=document.createElement("span");A.setAttribute("aria-hidden","true"),A.dataset.asciiCheck="",A.innerHTML='<svg viewBox="0 0 24 24" width="1.1em" height="1.1em" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 6 9 17l-5-5"/></svg>';const S=()=>{const e=Math.min(globalThis.devicePixelRatio||1,2);w=a(parseFloat(getComputedStyle(p).fontSize)||15,e)},z=()=>{if(g)return k.replaceChildren(),C&&k.appendChild(C.canvas),k.style.width=`${w.cw}px`,void(k.style.height=`${w.ch}px`);const t=[...b];for(const e of[...k.children])"SPAN"===e.tagName&&e.remove();const n=C&&C.canvas.parentElement===k?C.canvas:null;for(const[e,r]of t.entries()){const t=document.createElement("span");t.textContent=r,t.setAttribute("style",`position:absolute;top:0;left:${e*w.cw}px;width:${w.cw}px;height:${w.ch}px;line-height:${w.ch}px;text-align:center`),n?k.insertBefore(t,n):k.appendChild(t)}C&&!n&&k.appendChild(C.canvas),k.style.width=t.length*w.cw+"px",k.style.height=`${w.ch}px`,$.textContent=b,M=Math.max(M,e.offsetWidth),M&&h.set(e,"min-width",`${M}px`)},N="undefined"!=typeof document&&l();if(N){S(),k.setAttribute("aria-hidden","true");const t="position:absolute;left:50%;top:50%;translate:-50% -50%;pointer-events:none";g?("static"===getComputedStyle(e).position&&h.set(e,"position","relative"),k.setAttribute("style",t),A.setAttribute("style",`${t};display:grid;place-items:center;opacity:0;scale:.5`),e.appendChild(k),e.appendChild(A)):(k.setAttribute("style","display:inline-block;vertical-align:middle;position:relative;white-space:pre"),A.setAttribute("style","display:inline-grid;place-items:center;vertical-align:middle;overflow:hidden;width:0;opacity:0;scale:.5"),p.replaceChildren($,A,k)),z()}C=N?r({host:k,look:()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:w.cellSize,cellAspect:2/3,glyphScale:.94,...u.current.look}),ink:()=>u.current.ink??getComputedStyle(p).color,kit:u,reducedMotion:()=>u.current.reducedMotion,resolution:(e,t)=>[Math.max(2,2*Math.round(e/w.cw)),Math.max(3,3*Math.round(t/w.ch))],onFail:()=>{C=null,k.remove(),A.remove(),h.restore(),g||(p.replaceChildren(...f),p.textContent=b)},paint:({pen:e,now:t,still:n})=>{const r=t-x;if(g){if("loading"!==v||n)return!1;const t=1+Math.round(8*(.5-.5*Math.cos(2*Math.PI*r/720))),i=Math.round(t/9*255);return e.fillStyle=`rgb(${i} ${i} ${i})`,e.fillRect(0,0,2,3),!0}const i=[...k.children].filter(e=>"SPAN"===e.tagName);let l="loading"===v&&!n;for(let t=0;t<i.length;t++){const o=n?0:s(t,r,i.length,"loading"===v,n,b.length);r<24*i.length+170&&(l=!0);const a=" "===b[t];if(i[t].style.visibility=o&&!a?"hidden":"",!o||a)continue;const c=Math.round(o/9*255);e.fillStyle=`rgb(${c} ${c} ${c})`,e.fillRect(2*t,0,2,3)}return l}}):null,N&&!C&&(k.remove(),A.remove(),g||p.replaceChildren(...f),h.restore());const P=(t,n)=>{v=t,b=g?"":n,e.dataset.state=t,"loading"===t?e.setAttribute("aria-busy","true"):e.removeAttribute("aria-busy"),g&&null!==y&&e.setAttribute("aria-label","idle"===t?y:n),u.current.announce&&(u.current.announce.textContent="idle"===t?"":n),C?(x=performance.now(),((e,t)=>{const n=t?"none":`opacity 160ms ${c} ${e?120:0}ms, scale 240ms ${c} ${e?120:0}ms`;if(A.style.transition=n,A.style.opacity=e?"1":"0",A.style.scale=e?"1":".5",g||(A.style.width=e?"1.1em":"0",A.style.marginRight=e?".45em":"0"),g&&"style"in g){const e="idle"!==v&&"error"!==v;h.set(g,"transition",n.replace(/ 120ms/g,"")),h.set(g,"opacity",e?t&&"loading"===v?".4":"0":"1"),h.set(g,"scale",e&&!t?".6":"1")}})(!("success"!==t||!g&&!u.current.check),C.still()),z(),C.kick(),"error"===t&&u.current.shake&&!C.still()&&"function"==typeof e.animate&&e.animate([{translate:"0"},{translate:"-4px 0"},{translate:"4px 0"},{translate:"-2px 0"},{translate:"0"}],{duration:280,easing:c})):g||(p.textContent=n)};return i(()=>C,u,()=>{C&&(S(),z(),C.refresh())},{start(e=(g?y??"":`${m}…`)){P("loading",e)},succeed(e="Done"){P("success",e)},fail(e="Retry"){P("error",e)},reset(e=(g?y??"":m)){P("idle",e)},get state(){return v}},()=>{C&&(k.remove(),A.remove(),g||p.replaceChildren(...f)),g&&null!==y&&e.setAttribute("aria-label",y),delete e.dataset.state,e.removeAttribute("aria-busy"),h.restore()})}var u=o;export{u as BUTTON_LOADING_DEFAULTS,d as buttonLoading,a as letterCells,s as letterGlyph};//# sourceMappingURL=chunk-QVICL57J.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{mountField as e,hoverOf as t,narrow as r}from"./chunk-
|
|
1
|
+
import{mountField as e,hoverOf as t,narrow as r}from"./chunk-3VEMKDBW.js";var a={id:"field",name:"Field",description:"A word becomes the background, drawn by the GPU with a soft wake.",cellSize:13,speed:1,cursor:!0,mount:a=>e(a,(e,a)=>({scene:"flow",levels:"auto",charset:e.charset??" .,:-+"+e.text.replace(/\s+/g,"").toUpperCase(),font:'"Geist", Arial, sans-serif',fontWeight:500,cellSize:e.cellSize,cellAspect:.8,glyphScale:.76,color:"ink",shade:a?r()?.1:.4:0,background:"transparent",contrast:1.1,scale:r()?1.6:1,brightness:r()&&a?.08:0,vignette:0,speed:e.speed,maxPixelRatio:2,hover:t(e,"trail"),fluid:{radius:.09,refraction:.04,glow:.7,dissipation:1.3},lantern:{radius:.13,strength:.6,trail:.5,follow:11},trail:{strength:.9,radius:.4}}),{light:"#9a9891",dark:"#7d7b75"})};export{a as wordField};//# sourceMappingURL=chunk-RXOPJJC4.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{clamp as t,hash as e,mountSurface as r,handle as a,smoothstep as n}from"./chunk-
|
|
1
|
+
import{clamp as t,hash as e,mountSurface as r,handle as a,smoothstep as n}from"./chunk-GF72XM4C.js";var o={colorful:["#22c55e","#06b6d4","#6366f1","#d946ef","#f43f5e","#f59e0b"],mono:["#ffffff"],ocean:["#22d3ee","#3b82f6","#2dd4bf","#818cf8"],sunset:["#f97316","#f43f5e","#ec4899","#fbbf24"]},s={palette:"colorful",mode:"rotate",grain:"dots",speed:1,hover:!0,depth:18},i=["rotate","pulse","progress"],l=t=>{const e=/^#[\da-f]{3}$/i.test(t)?`#${[...t.slice(1)].map(t=>t+t).join("")}`:t;return[1,3,5].map(t=>(parseInt(e.slice(t,t+2),16)||0)/255)},h=(t,e,r)=>t.map((t,a)=>t+(e[a]-t)*r),c=l("#ff4a4a"),u=l("#2fd67b");function p(t){const e=("string"==typeof t?o[t]??o.colorful:t.length?t:o.colorful).map(l),r=new Float32Array(1024);for(let t=0;t<256;t++){const a=t/256*e.length,n=Math.floor(a),o=a-n,s=1===e.length?e[0]:h(e[n%e.length],e[(n+1)%e.length],o*o*(3-2*o)),i=Math.max(...s,.01);r.set([s[0]/i,s[1]/i,s[2]/i,(.2126*s[0]+.7152*s[1]+.0722*s[2])/i],4*t)}return r}var m=(t,e)=>{const r=(-t%1+1)%1,a=1-r;return Math.max(r<e?(1-r/e)**2.2:0,a<.03?(1-a/.03)**2:0)},M=t=>Math.max(m(t,.3),.75*m(t-.5,.22)),f=(t,e)=>t<=e?.42+.4*(t/Math.max(e,.001))**1.6+.38*Math.exp(-(((e-t)/.03)**2)):t-e<.014?1.2*(1-(t-e)/.014)**2:0,d=(e,r)=>t((e-.68*r)/.07);function g(t,r,a,n,o,s,i){const l=Math.ceil(t/a),h=t/2,c=r/2,u=Math.min(h,c),[p,m,M,f]=[0,1,2,3].map(t=>Math.max(0,Math.min(s[t]??s[0]??0,u))),d=new Int32Array(l*Math.ceil(r/n)).fill(-1),g=[],x=[],v=[];for(let t=0;t<d.length;t++){const r=(t%l+.5)*a-h,s=(Math.floor(t/l)+.5)*n-c,u=r<0?s<0?p:f:s<0?m:M,k=Math.abs(r)-h+u,b=Math.abs(s)-c+u,y=-(Math.hypot(Math.max(k,0),Math.max(b,0))+Math.min(Math.max(k,b),0)-u),L=y>0?Math.min(Math.max(0,1-y/Math.max(1,o))**1.7,y/Math.max(.1,i)):0;if(L<.004)continue;d[t]=g.length,g.push(L);const w=Math.atan2(s/Math.max(1,c),r/Math.max(1,h))/(2*Math.PI)+.25,A=w-Math.floor(w);x.push(A),v.push(.78*e(Math.floor(46*A),5)+.22*e(t,9))}const k=Math.max(1,Math.round(t)),b=Math.max(1,Math.round(r)),y=[],L=[];for(let t=0;t<b;t++)for(let e=0;e<k;e++){const r=d[Math.min(l-1,Math.floor((e+.5)/a))+l*Math.floor((t+.5)/n)];r>=0&&(y.push(t*k+e),L.push(r))}return{W:k,H:b,weight:Float32Array.from(g),turn:Float32Array.from(x),crack:Float32Array.from(v),pixel:Int32Array.from(y),owner:Int32Array.from(L)}}function x(o,l={}){const h={current:{...s,...l}};let m="idle",x=0,v=p(h.current.palette),k=!1;const b=()=>"mono"===h.current.palette,y=()=>({..."glyphs"===h.current.grain?{mark:"glyph",charset:" ·.:-+*",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:5,cellAspect:.6,glyphScale:1}:{mark:"dot",cellSize:3.5,cellAspect:1,dotScale:.82},color:b()?"ink":"source",saturation:1.25,shade:.55,contrast:2.4,brightness:.58,...h.current.look}),L=t=>{const e=!t.dark();t.canvas.style.opacity=e?"0.72":"",t.canvas.style.filter=e&&!b()?"brightness(1.45) saturate(.9)":""};let w=null,A=null,I=new Uint8Array(0),F="",$=0,E=null,P=0,R=.62,S=0,T=0,W=0,j=0,z=0,H=0;const B={rotate:0,pulse:0,progress:0};B[h.current.mode]=1;let C=null;C=r({host:o,look:y,ink:t=>h.current.ink??(t?"#b3b1aa":"#8a8882"),kit:h,reducedMotion:()=>h.current.reducedMotion,onTheme:()=>C&&L(C),onFail:()=>{C=null},resolution:(t,e)=>[Math.max(1,Math.round(t)),Math.max(1,Math.round(e))],paint:r=>{const{pen:a,w:s,h:l,now:p,still:b,dark:L}=r,D=h.current,G=getComputedStyle(o),U=Math.min(o.clientWidth||s,o.clientHeight||l),N=Math.max(2,Math.min(D.depth,Math.min(parseFloat(G.paddingTop)||D.depth,parseFloat(G.paddingLeft)||D.depth)-2)),X=[G.borderTopLeftRadius,G.borderTopRightRadius,G.borderBottomRightRadius,G.borderBottomLeftRadius].map(t=>((t,e)=>t.endsWith("%")?parseFloat(t)/100*e:parseFloat(t)||0)(t??"",U)),q=y(),J="dot"!==q.mark,K=q.cellSize??(J?5:3.5),O=q.cellAspect??(J?.6:1),Q=`${s}x${l}:${D.grain}:${N}:${X.join(",")}:${K}:${O}`;if(Q!==F){F=Q,C.canvas.style.clipPath=`inset(0 round ${X.map(t=>`${t}px`).join(" ")})`;const t=Math.min(globalThis.devicePixelRatio||1,q.maxPixelRatio??2),e=Math.max(2,Math.round(K*t)),r=Math.max(2,Math.round(e*O))/t,n=e/t;w=g(s,l,r,n,N,X,J?Math.min(r,n)/2:(q.dotScale??.82)*r/2),A=a.createImageData(w.W,w.H),I=new Uint8Array(3*w.weight.length)}const V=w,Y=A.data,Z=V.crack,_=(e,r,n,o,s)=>{I.fill(0);for(let a=0;a<V.weight.length;a++){const i=V.turn[a],l=t(V.weight[a]*e(i,a))*(L?1.12:.8);if(l<.03)continue;const h=4*(255&Math.floor(((i-r)%1+1)%1*256));let p=v[h],m=v[h+1],M=v[h+2],f=v[h+3];const d=s&&L?s(i):0;(o>0||n>0||d>0)&&(o>0&&(p+=(u[0]-p)*o,m+=(u[1]-m)*o,M+=(u[2]-M)*o),n>0&&(p+=(c[0]-p)*n,m+=(c[1]-m)*n,M+=(c[2]-M)*n),d>0&&(p+=(1-p)*d,m+=(1-m)*d,M+=(1-M)*d),f=.2126*p+.7152*m+.0722*M);const g=255*Math.min(1,(l+.12)/2.4/Math.max(f,.01));I[3*a]=p*g,I[3*a+1]=m*g,I[3*a+2]=M*g}Y.fill(0);for(let t=0;t<V.pixel.length;t++){const e=4*V.pixel[t],r=3*V.owner[t];Y[e]=I[r],Y[e+1]=I[r+1],Y[e+2]=I[r+2],Y[e+3]=255}a.putImageData(A,0,0)};if(b){const t="progress"===D.mode?t=>"running"===m||"error"===m?f(t,x):.14:t=>("running"===m?.75:.55)*(.7+.3*Math.cos(2*Math.PI*(t-.12)));return"success"===m?_(()=>.62,0,0,.9):"error"===m?_((e,r)=>.5*t(e)*d(Z[r],1),0,.9,0):_(t,0,0,0),!1}const tt=$?Math.min(48,p-$):16;$=p,m!==E&&("running"===m&&"running"!==E&&(z=0),P=p,E=m);let et=p-P;"success"===m&&et>2700&&(m=E="idle",x=0,P=p,et=0);const rt="running"===m,at="error"===m,nt="success"===m,ot=D.hover&&k;for(const t of i)B[t]+=((t===D.mode?1:0)-B[t])*(1-Math.exp(-tt/260));if(at)T=0;else{const t=(rt?1500-500*x:"pulse"===D.mode?9e3:2600)/Math.max(.05,D.speed);T+=(1/t*(ot?1.35:1)-T)*(1-Math.exp(-tt/320)),R+=T*tt,H+=tt,S+=tt/("pulse"===D.mode?14e3:26e3)*(1-B.progress),(rt||nt)&&(z+=((nt?1:x)-z)*(1-Math.exp(-tt/110)))}W+=((ot?1:0)-W)*(1-Math.exp(-tt/220)),j=at?.9*n(0,60,et):j*Math.exp(-tt/180);const st=1+.22*W,it=.32+.68*(.5-.5*Math.cos(2*Math.PI*H/2400)),lt=.05+.1*(.5-.5*Math.cos(2*Math.PI*H/5200)),ht=rt||nt||at,ct=t=>st*(B.rotate*M(t-R)+B.pulse*(rt||at?M(t-R):it*(.78+.22*Math.cos(2*Math.PI*(t-R))))+B.progress*(ht?f(t,z):lt));if(nt){const e=n(0,260,et),r=t((et-240)/620),a=1-n(860,1060,et),o=n(780,1e3,et),s=n(1350,2450,et),i=(L?.86:.55)*e*(1-o)+.62*o*(1-s),l=1-e*(1-n(1900,2700,et)*(1-B.progress)),h=t=>{if(et<240)return 0;const e=r-t;return a*(e>=0?e<.2?(1-e/.2)**2:0:e>-.02?(1+e/.02)**2:0)};return _(t=>Math.max(ct(t)*l,i*(.9+.1*Math.cos(2*Math.PI*(t-.1))),1.3*h(t),B.progress*lt*s),S,0,.9*o*(1-s),e=>t(.8*h(e))),!0}if(at){const t=et<90?1.2:et<170?.1:et<260?1.2:et<340?.1:1,r=n(380,1150,et),a=1-.5*n(700,1500,et),o=Math.floor(et/50);return _((n,s)=>{const i=d(Z[s],r);return i<=0?0:ct(n)*t*i*a*(1-1.4*r*(1-r)*e(s,o))},S,j,0),et<1600||Math.abs(W-(ot?1:0))>.01}return _(ct,S,j,0),!0}});const D=()=>{k||(k=!0,C?.kick())},G=()=>{k=!1,C?.kick()},U=t=>{k=t.target?.matches?.(":focus-visible")??!1,C?.kick()};C&&(L(C),o.addEventListener("pointerenter",D),o.addEventListener("pointermove",D),o.addEventListener("pointerleave",G),o.addEventListener("focusin",U),o.addEventListener("focusout",G));const N=t=>{m=t,C?.kick()};return a(()=>C,h,t=>{v=p(t.palette),C?.refresh(),C&&L(C)},{progress(e){x=t(Number.isFinite(e)?e:0),N("running")},success(){N("success")},error(){N("error")},reset(){x=0,N("idle")}},()=>{o.removeEventListener("pointerenter",D),o.removeEventListener("pointermove",D),o.removeEventListener("pointerleave",G),o.removeEventListener("focusin",U),o.removeEventListener("focusout",G)})}var v=s;export{v as BEAM_DEFAULTS,o as BEAM_PALETTES,x as beam,M as beamArcs,g as beamBand,d as beamCracked,p as beamPalette,f as beamRing};//# sourceMappingURL=chunk-SDSW7422.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{scenePreset as e}from"./chunk-
|
|
1
|
+
import{scenePreset as e}from"./chunk-3VEMKDBW.js";var a=e({id:"cascade",name:"Cascade",description:"Streaks fall in three depths: far ones faint and slow, near ones rare, bright and quick.",cellSize:11,scene:"cascade",charset:" .:;|",hover:"lantern",tune:()=>({blend:"off"}),middle:{x:.22,y:.25,width:.56,height:.5,feather:.3,shape:"ellipse"}});export{a as cascade};//# sourceMappingURL=chunk-TRDA73HN.js.map
|
|
@@ -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
|
|
@@ -0,0 +1 @@
|
|
|
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
|