asciify-engine 4.28.0 → 4.30.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 +14 -0
- package/THIRD_PARTY.md +3 -0
- package/dist/field.cjs +1 -1
- package/dist/field.d.cts +1 -1
- package/dist/field.d.ts +1 -1
- package/dist/field.js +1 -1
- package/dist/{glyph-field-DRC-7uVf.d.ts → glyph-field-BCwGhohg.d.ts} +11 -0
- package/dist/{glyph-field-C2fQIlnq.d.cts → glyph-field-DKWHAMml.d.cts} +11 -0
- package/dist/hover.cjs +1 -1
- package/dist/hover.js +1 -1
- package/dist/kit/{chunk-4NV5APSJ.js → chunk-2NACMWVV.js} +1 -1
- package/dist/kit/{chunk-F6F2C3RH.js → chunk-2UOPVMN3.js} +1 -1
- package/dist/kit/{chunk-DMRPBFLW.js → chunk-3H3DJI3M.js} +1 -1
- package/dist/kit/{chunk-7M2FFUZ3.js → chunk-4G5LJNMB.js} +1 -1
- package/dist/kit/{chunk-G4ZSMTFN.js → chunk-4NR7QENR.js} +1 -1
- package/dist/kit/{chunk-GKR3ROYR.js → chunk-5Q634WWI.js} +1 -1
- package/dist/kit/{chunk-KY5KCIZE.js → chunk-64NSPD2R.js} +1 -1
- package/dist/kit/{chunk-2FH6GGV6.js → chunk-6G2ZVIBS.js} +1 -1
- package/dist/kit/{chunk-3MHEDZLZ.js → chunk-6NDTKY3V.js} +1 -1
- package/dist/kit/{chunk-GBNV3GXG.js → chunk-7QH33RJJ.js} +1 -1
- package/dist/kit/{chunk-BFBG3VHI.js → chunk-7TXDNPL3.js} +1 -1
- package/dist/kit/{chunk-3OD5BMF5.js → chunk-AAV5QNHU.js} +1 -1
- package/dist/kit/chunk-AU33Y2SZ.js +1 -0
- package/dist/kit/{chunk-KCEYRIU4.js → chunk-BGPEFFKK.js} +1 -1
- package/dist/kit/{chunk-KDROJANO.js → chunk-BJJUDT26.js} +1 -1
- package/dist/kit/{chunk-2LBQ7QJT.js → chunk-BO4CPM26.js} +1 -1
- package/dist/kit/chunk-BQ53B2HP.js +1 -0
- package/dist/kit/chunk-BV6AOHFU.js +1 -0
- package/dist/kit/{chunk-QVICL57J.js → chunk-CH64MY3U.js} +1 -1
- package/dist/kit/{chunk-LVCGC3SO.js → chunk-CMGMCRAD.js} +1 -1
- package/dist/kit/{chunk-4U72YE65.js → chunk-CZL5WMU6.js} +1 -1
- package/dist/kit/{chunk-PB5E3D4E.js → chunk-DKRZSP5K.js} +1 -1
- package/dist/kit/{chunk-KFXMLIVF.js → chunk-E427W6P5.js} +1 -1
- package/dist/kit/{chunk-RXOPJJC4.js → chunk-EH4S6T7U.js} +1 -1
- package/dist/kit/chunk-F4IO3HWD.js +1 -0
- package/dist/kit/{chunk-K6JX64AS.js → chunk-FU4WW3PU.js} +1 -1
- package/dist/kit/{chunk-TRDA73HN.js → chunk-G3FVDS2A.js} +1 -1
- package/dist/kit/{chunk-FHN3PPSI.js → chunk-G7GQSPMC.js} +1 -1
- package/dist/kit/chunk-GI5BNKBL.js +1 -0
- package/dist/kit/{chunk-KEE55QSD.js → chunk-GJANKSX6.js} +1 -1
- package/dist/kit/{chunk-Z2FRNFMB.js → chunk-HENGH3DE.js} +1 -1
- package/dist/kit/chunk-I377LEZA.js +1 -0
- package/dist/kit/chunk-IFZDWKIX.js +1 -0
- package/dist/kit/{chunk-WDS7VM2E.js → chunk-J7Y2KBXK.js} +1 -1
- package/dist/kit/{chunk-KXI3T72F.js → chunk-JF3WEYIE.js} +1 -1
- package/dist/kit/{chunk-3VEMKDBW.js → chunk-LTRVMY3D.js} +1 -1
- package/dist/kit/{chunk-EKYEA7Z4.js → chunk-M5JJSIWI.js} +1 -1
- package/dist/kit/{chunk-ILXVBO7M.js → chunk-MT23DCGU.js} +1 -1
- package/dist/kit/{chunk-NF4WVWAC.js → chunk-MWUPCAET.js} +1 -1
- package/dist/kit/{chunk-FPCCX4FM.js → chunk-MYAZOXMF.js} +1 -1
- package/dist/kit/{chunk-3YSK7V26.js → chunk-N7J4UAWY.js} +1 -1
- package/dist/kit/{chunk-YSN7EHSH.js → chunk-NP7UG7DS.js} +1 -1
- package/dist/kit/{chunk-ZCXNGJGB.js → chunk-NQ4PFWOG.js} +1 -1
- package/dist/kit/chunk-NS6HYTQZ.js +1 -0
- package/dist/kit/chunk-NSKX2OFA.js +1 -0
- package/dist/kit/{chunk-WI2AF2KE.js → chunk-OOVUQEXT.js} +1 -1
- package/dist/kit/{chunk-W4U5CK6L.js → chunk-P5MVACML.js} +1 -1
- package/dist/kit/chunk-PZKQUZQK.js +1 -0
- package/dist/kit/{chunk-CGSWUO67.js → chunk-R3ALZFUQ.js} +1 -1
- package/dist/kit/{chunk-7DXSG526.js → chunk-RGV7VRYC.js} +1 -1
- package/dist/kit/chunk-SBAUVRBY.js +1 -0
- package/dist/kit/chunk-SQNULNT3.js +1 -0
- package/dist/kit/{chunk-HYVTFKWX.js → chunk-TJHSBZBF.js} +1 -1
- package/dist/kit/{chunk-FWODCYYJ.js → chunk-UHLNVM63.js} +1 -1
- package/dist/kit/{chunk-UOYBFLGJ.js → chunk-UT6MJP5B.js} +1 -1
- package/dist/kit/{chunk-QSTDYL35.js → chunk-UWX7VIXT.js} +1 -1
- package/dist/kit/{chunk-6WU247CB.js → chunk-UXDJSGED.js} +1 -1
- package/dist/kit/{chunk-Z3KD6CLE.js → chunk-UXJRBOSR.js} +1 -1
- package/dist/kit/{chunk-KLRF3S7O.js → chunk-V42Q4L2G.js} +1 -1
- package/dist/kit/chunk-V6KL3IA7.js +1 -0
- package/dist/kit/{chunk-776H2BJ7.js → chunk-VENDLTH4.js} +1 -1
- package/dist/kit/{chunk-ZWZZMU5P.js → chunk-VQ4KIRBW.js} +1 -1
- package/dist/kit/{chunk-OZFSNW5N.js → chunk-WPWCFCEZ.js} +1 -1
- package/dist/kit/{chunk-H5KHXZWR.js → chunk-WRBLIULG.js} +1 -1
- package/dist/kit/{chunk-SDSW7422.js → chunk-WSWIOD2C.js} +1 -1
- package/dist/kit/{chunk-NW4U2YRE.js → chunk-X6GAMLEH.js} +1 -1
- package/dist/kit/chunk-X7AUCVMH.js +1 -0
- package/dist/kit/{chunk-B3TY6UXJ.js → chunk-XDX6WLED.js} +1 -1
- package/dist/kit/{chunk-42KMN727.js → chunk-XVA7UGUQ.js} +1 -1
- package/dist/kit/chunk-XXHIFJ5Z.js +1 -0
- package/dist/kit/{chunk-3LJ5C3U3.js → chunk-XZO4VH2Z.js} +1 -1
- package/dist/kit/{chunk-6G5MPND3.js → chunk-Y2SDQ6EC.js} +1 -1
- package/dist/kit/{chunk-CG6SGQMY.js → chunk-ZGCKUXYP.js} +1 -1
- package/dist/kit/{chunk-E3FPFANJ.js → chunk-ZNZAO7JA.js} +1 -1
- package/dist/kit/{chunk-XUCYFWC3.js → chunk-ZTCSVEHT.js} +1 -1
- package/dist/kit.cjs +1 -1
- package/dist/kit.d.cts +182 -7
- package/dist/kit.d.ts +182 -7
- package/dist/kit.js +1 -1
- package/dist/studio-worker.js +1 -1
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +1 -1
- package/package.json +1 -1
- package/skills/asciify-engine/SKILL.md +4 -4
- package/skills/asciify-engine/references/applying-asciify.md +18 -2
- package/skills/asciify-engine/references/components.md +81 -0
- package/skills/asciify-engine/references/glyph-field.md +2 -0
- package/skills/asciify-engine/references/kit.md +132 -3
- package/skills/asciify-engine/references/scenario-prompts.md +10 -1
- package/dist/kit/chunk-2GAV4OAK.js +0 -1
- package/dist/kit/chunk-2MLFWO4U.js +0 -1
- package/dist/kit/chunk-AIGAJMNN.js +0 -1
- package/dist/kit/chunk-GF72XM4C.js +0 -1
- package/dist/kit/chunk-I5R2347P.js +0 -1
- package/dist/kit/chunk-M5VVLYI2.js +0 -1
- package/dist/kit/chunk-ORSI57T2.js +0 -1
- package/dist/kit/chunk-PGFBIU7R.js +0 -1
- package/dist/kit/chunk-UVLKCAKH.js +0 -1
- package/dist/kit/chunk-VBWG7HQA.js +0 -1
- package/dist/kit/chunk-VV2KP7ZW.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{imageFor as e,drawCover as t,injectStyle as a,imageReady as n,toneOf as r}from"./chunk-
|
|
1
|
+
import{imageFor as e,drawCover as t,injectStyle as a,imageReady as n,toneOf as r}from"./chunk-DKRZSP5K.js";import{styleKeeper as i,clamp as o,mountSurface as c,smoothstep as s,handle as l,prefersReduced as p}from"./chunk-I377LEZA.js";var d=e=>"string"==typeof e?{src:e}:e;function u(u,h){const m={current:{open:0,duration:420,label:"Images",...h}},f=i(),v=m.current.images.map(d);let x=o(Math.round(m.current.open),0,Math.max(0,v.length-1)),b=0,g=0;const w=v.map((e,t)=>({x:t===x?1:0,v:0})),y=v.map(()=>null),k=v.map(()=>null);let E=null;const A=v.map(t=>{const a=document.createElement("button");a.type="button",a.className="ascii-acc-panel",a.setAttribute("aria-label",[t.title??t.alt,t.meta].filter(Boolean).join(", ")||t.src);const n=e(t.src);if(n.className="ascii-acc-photo",n.alt="",n.draggable=!1,t.focus&&n.style.setProperty("object-position",`${100*t.focus.x}% ${100*t.focus.y}%`),a.appendChild(n),t.title||t.meta){const e=document.createElement("span");e.className="ascii-acc-caption",e.setAttribute("aria-hidden","true");for(const[a,n]of[["ascii-acc-title",t.title],["ascii-acc-meta",t.meta]]){if(!n)continue;const t=document.createElement("span");t.className=a,t.textContent=n,e.appendChild(t)}a.appendChild(e)}return a});function L(e,t){const a=b?Math.min(.064,(e-b)/1e3):1/60;b=e;const n=5/(Math.max(1,m.current.duration)/1e3),r=Math.max(1,Math.ceil(240*a)),i=a/r;let o=!1;return w.forEach((e,a)=>{const c=a===x?1:0;t&&(e.x=c,e.v=0);for(let t=0;t<r&&(e.x!==c||e.v);t++)e.v+=(-n*n*(e.x-c)-2*n*e.v)*i,e.x+=e.v*i;Math.abs(e.x-c)<.001&&Math.abs(e.v)<.01?(e.x=c,e.v=0):o=!0,M(A[a],e.x)}),o||(b=0),o}function M(e,t){const a=e.style;a.setProperty("--ascii-acc-open",t.toFixed(4)),a.setProperty("--ascii-acc-photo",(E?s(.15,.75,t):.45+.55*t).toFixed(3)),a.setProperty("--ascii-acc-caption",s(.6,1,t).toFixed(3))}E=c({host:u,layer:"under",look:()=>({blend:"coarse",mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:6,cellAspect:.62,glyphScale:.94,hover:"trail",trail:{strength:.5,radius:.25},...m.current.look}),ink:()=>m.current.ink??"--ascii-ink-strong",kit:m,reducedMotion:()=>m.current.reducedMotion,onFail:()=>{E=null,delete u.dataset.asciiField},onTheme:()=>{y.forEach((e,t)=>{k[t]=e&&E?r(e,!E.dark()):null}),E?.kick()},paint:({pen:e,still:a,now:n,box:r})=>{const i=L(n,a);return A.forEach((a,n)=>{const i=k[n],o=w[n].x,c=1-s(.45,.95,o);if(!i||c<=0)return;const l=r(a),p=parseFloat(getComputedStyle(a).borderTopLeftRadius)||0,d=1.04-.04*o;e.save(),e.beginPath(),e.roundRect(l.x,l.y,l.w,l.h,p),e.clip(),e.globalAlpha=c,t(e,i,l.x-l.w*(d-1)/2,l.y-l.h*(d-1)/2,l.w*d,l.h*d,v[n].focus?.x,v[n].focus?.y),e.restore()}),i}});const F=()=>{A.forEach((e,t)=>{e.setAttribute("aria-expanded",String(t===x)),e.tabIndex=t===x?0:-1})},C=(e,t=!1)=>{e=o(Math.round(e),0,A.length-1),t&&A[e]?.focus(),e!==x&&(x=e,F(),m.current.onChange?.(e),(()=>{if(E)return void E.kick();if(g||"function"!=typeof requestAnimationFrame)return void(g||L(performance.now(),!0));const e=t=>{g=L(t,!!(m.current.reducedMotion??p()))?requestAnimationFrame(e):0};g=requestAnimationFrame(e)})())};let S=0,P=0,j=0,T=0,q=0;const N=()=>{S&&clearTimeout(S),S=0},R=A.map((e,t)=>{const a=e=>{if("mouse"!==e.pointerType)return;const a=e.timeStamp||performance.now(),n=Math.max(1,a-j);if(T=j&&n<100?.5*T+Math.abs(e.clientX-P)/n*.5:0,P=e.clientX,j=a,q!==t&&N(),q=t,t!==x)return T<.3?(N(),void C(t)):void(S||(S=setTimeout(()=>{S=0,C(q)},90)));N()},n=()=>{N(),C(t)},r=()=>{e.matches(":focus-visible")&&C(t)},i=e=>{const a={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1}[e.key],n="Home"===e.key?0:"End"===e.key?A.length-1:void 0!==a?(t+a+A.length)%A.length:null;null!==n&&(e.preventDefault(),C(n,!0))};return e.addEventListener("pointermove",a),e.addEventListener("pointerdown",n),e.addEventListener("click",n),e.addEventListener("focus",r),e.addEventListener("keydown",i),()=>{e.removeEventListener("pointermove",a),e.removeEventListener("pointerdown",n),e.removeEventListener("click",n),e.removeEventListener("focus",r),e.removeEventListener("keydown",i)}}),z=()=>{N(),j=0};u.addEventListener("pointerleave",z),a("ascii-kit-accordion",'\n:where([data-ascii-accordion]){display:flex;gap:6px}\n:where(.ascii-acc-panel){position:relative;flex:calc(1 + 3.2 * var(--ascii-acc-open, 0)) 1 0;min-width:0;margin:0;padding:0;border:0;border-radius:12px;overflow:hidden;background:transparent;color:#fff;font:inherit;text-align:left;cursor:pointer;-webkit-tap-highlight-color:transparent}\n:where(.ascii-acc-panel[aria-expanded="true"]){cursor:default}\n:where(.ascii-acc-photo){position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:var(--ascii-acc-photo, 0);scale:calc(1.04 - .04 * var(--ascii-acc-open, 0))}\n:where(.ascii-acc-caption){position:absolute;inset:auto 0 0;display:flex;color:#fff;flex-direction:column;gap:2px;padding:28px 12px 11px;background:linear-gradient(to top, rgb(0 0 0 / .62), transparent);white-space:nowrap;opacity:var(--ascii-acc-caption, 0);translate:0 calc(6px - 6px * var(--ascii-acc-caption, 0))}\n:where(.ascii-acc-title){font-size:15px;font-weight:500}\n:where(.ascii-acc-meta){font-size:14px;opacity:.8}\n'),u.dataset.asciiAccordion="",E&&(u.dataset.asciiField="");const D=u.getAttribute("role"),I=u.getAttribute("aria-label");return D||u.setAttribute("role","group"),I||u.setAttribute("aria-label",m.current.label),A.forEach((e,t)=>{M(e,w[t].x),u.appendChild(e)}),F(),A.forEach((e,t)=>{const a=e.querySelector("img");a&&n(a).then(e=>{y[t]=e,k[t]=E?r(e,!E.dark()):null,E?.kick()},()=>{})}),l(()=>E,m,e=>{I||u.setAttribute("aria-label",e.label),E?.refresh()},{select:C,get open(){return x}},()=>{R.forEach(e=>e()),N(),g&&cancelAnimationFrame(g),u.removeEventListener("pointerleave",z),A.forEach(e=>e.remove()),delete u.dataset.asciiAccordion,delete u.dataset.asciiField,D||u.removeAttribute("role"),I||u.removeAttribute("aria-label"),f.restore()})}export{u as accordion};//# sourceMappingURL=chunk-4NR7QENR.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-AAV5QNHU.js";function r(o,r,c,n,l={}){const{fontSize:i=14,chars:s=" ·∙•:-=+*#",color:a,accentColor:h,speed:f=.5,harmonics:m=3,lightMode:p=!1}=l,g=h??(p?"#6b8700":"#d4ff00"),M=.62*i,d=1.4*i,$=Math.ceil(r/M),u=Math.ceil(c/d);o.clearRect(0,0,r,c),o.font=`${i}px monospace`,o.textBaseline="top";let b=255,S=255,x=255;if(p&&(b=55,S=55,x=55),a){const e=t(a);e&&(b=e.r,S=e.g,x=e.b)}let z=212,C=255,k=0;const y=t(g);y&&(z=y.r,C=y.g,k=y.b);const A=n*f,V=Array.from({length:m},(t,e)=>1/(e+1)).reduce((t,e)=>t+e,0);for(let t=0;t<u;t++)for(let r=0;r<$;r++){let c=0;for(let o=0;o<m;o++){const n=.18+1.4*e(r*(o+3)+7,t*(o+5)+11),l=e(r*(o+7),t*(o+9)+3)*Math.PI*2,i=1/(o+1);c+=Math.sin(A*n+l)*i}const n=.5*(c/V+1);if(n<.28)continue;const l=(n-.28)/.72,i=s[Math.min(s.length-1,Math.floor(l*s.length))],a=n>.88,h=p?.82*l:.13*l;o.fillStyle=a?`rgba(${z},${C},${k},${p?.92:.28})`:`rgba(${b},${S},${x},${h})`,o.fillText(i,r*M,t*d)}}var c={id:"morph",name:"Morph",description:"Every cell shimmers at its own frequencies.",cellSize:14,speed:1,cursor:!1,mount:t=>o(t,(t,e,o,c,n,l)=>r(t,e,o,c,{fontSize:l.fontSize,chars:l.chars,lightMode:l.lightMode,color:l.ink,accentColor:l.accent}))};export{c as morph,r as renderMorphBackground};//# sourceMappingURL=chunk-5Q634WWI.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-LTRVMY3D.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-64NSPD2R.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{styleKeeper as t,srOnly as e,mountSurface as n,house as o,handle as r,clamp as l,smoothstep as a,hash as i}from"./chunk-
|
|
1
|
+
import{styleKeeper as t,srOnly as e,mountSurface as n,house as o,handle as r,clamp as l,smoothstep as a,hash as i}from"./chunk-I377LEZA.js";var c={value:0,duration:360,stagger:60,glyphs:"#%*+=-:",format:t=>t.toLocaleString(),face:"text"};function s(t,e){const n=(t,e)=>t[t.length-1-e]??"";for(let o=e.length-1;o>=0;o--)if(/\d/.test(n(e,o))&&n(t,o)!==n(e,o))return o;return-1}function f(f,u={}){const p=parseFloat((f.textContent??"").replace(/[^\d.-]/g,"")),h={current:{...c,...u,value:u.value??(Number.isFinite(p)?p:0)}},g=t();let d=h.current.value,m=h.current.format(d),y={from:m,to:m,t0:-1e9,up:!0,first:-1},x=null;const v=e(m,!0),k=document.createElement("span"),S=()=>{k.replaceChildren(...[...m].map(t=>Object.assign(document.createElement("span"),{textContent:t}))),v.textContent=m};x=n({host:f,look:()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:3,cellAspect:.66,glyphScale:1,shade:.2,contrast:1.1,...h.current.look}),ink:()=>h.current.ink??getComputedStyle(f).color,kit:h,reducedMotion:()=>h.current.reducedMotion,resolution:2,onFail:()=>{x=null,f.textContent=m,g.restore()},paint:({pen:t,now:e,still:n,box:r,scale:c})=>{const s=getComputedStyle(k),f=parseFloat(s.fontSize),u=parseFloat(s.letterSpacing)||0,p=`${s.fontStyle} ${s.fontWeight} ${s.fontSize} ${s.fontFamily}`;t.setTransform(c,0,0,c,0,0),t.font=p,t.textAlign="center",t.textBaseline="alphabetic";const g=t.measureText("0"),d=g.fontBoundingBoxAscent||.8*f,m=g.fontBoundingBoxDescent||.2*f,{from:x,to:v,t0:S,up:b,first:C}=y,A=[...k.children],F=h.current,M="glyph"===F.face,w=(t,e)=>t[t.length-1-e]??"";let B=!1;return A.forEach((c,s)=>{const h=A.length-1-s,g=r(c),y=g.x+(g.w-u)/2,k=g.y,E=g.h,$=k+(E-d-m)/2+d,T=w(v,h),z=C-h,G=!n&&C>=0&&z>=0&&/\d/.test(T)?l((e-S)/(F.duration+z*F.stagger)):1,N=o(G),j=G<1&&!M?a(.72,1,G).toFixed(3):"";if(c.style.opacity!==j&&(c.style.opacity=j),G>=1)return void(M&&(t.globalAlpha=1,t.font=p,t.fillStyle="#fff",t.fillText(T,y,$)));B=!0,t.globalAlpha=M?1:1-a(.72,1,G);const I=5+2*z,L=[w(x,h),...Array.from({length:I},(t,e)=>F.glyphs[Math.floor(i(e+7*h,S)*F.glyphs.length)]??""),T];b||L.reverse();const P=(L.length-1)*E,W=b?N*P:P-N*P;t.save(),t.beginPath(),t.rect(y-g.w,k,2*g.w,E),t.clip(),L.forEach((e,n)=>{const o=$+n*E-W;if(o<k-E||o>k+2*E)return;const r=n>0&&n<L.length-1;t.font=r?`600 ${.84*f}px "Geist Mono", ui-monospace, monospace`:p,t.fillStyle=r?"#d0d0d0":"#fff",t.fillText(e,y,o)}),t.restore()}),t.globalAlpha=1,B}});const b=()=>{x&&g.set(k,"color","glyph"===h.current.face?"transparent":"inherit")};x&&(g.set(k,"display","inline-flex"),b(),k.setAttribute("aria-hidden","true"),f.replaceChildren(v,k,...(t=>[...t.children].filter(t=>"IMG"===t.tagName&&void 0!==t.dataset?.asciiPoster))(f),x.canvas),S(),document.fonts?.ready.then(()=>x?.kick()));const C=t=>{if(!Number.isFinite(t))return;const e=d,n=m;d=h.current.value=t,m=h.current.format(t),x?n!==m&&(y={from:n,to:m,up:t>=e,first:s(n,m),t0:performance.now()},S(),x.kick()):f.textContent=m};return r(()=>x,h,t=>{b(),t.value!==d?C(t.value):(m=t.format(d),S(),x?.refresh())},{set:C,get value(){return d}},()=>{x&&(f.textContent=m),g.restore()})}var u=c;export{u as ODOMETER_DEFAULTS,s as firstChanged,f as odometer};//# sourceMappingURL=chunk-6G2ZVIBS.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{scenePreset as e}from"./chunk-
|
|
1
|
+
import{scenePreset as e}from"./chunk-LTRVMY3D.js";var n=e({id:"constellation",name:"Constellation",description:"Points wander and neighbours close enough are linked by fine lines that come and go.",cellSize:11,scene:"constellation",charset:" .·:+*#",hover:"lantern",tune:()=>({blend:"off"})});export{n as constellation};//# sourceMappingURL=chunk-6NDTKY3V.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{scenePreset as r,FIELD_GRAPHITE as e,narrow as t}from"./chunk-
|
|
1
|
+
import{scenePreset as r,FIELD_GRAPHITE as e,narrow as t}from"./chunk-LTRVMY3D.js";var a=r({id:"drift",name:"Drift",description:"Characters that drift slowly in broad lobes and stay clear around your content.",cellSize:11,scene:"drift",charset:" .:-=+*#",hover:"trail",graphite:e,middle:!1,feather:.2,tune:r=>({scale:t()?"dot"===r.mark?1.8:1.6:1,brightness:"dot"===r.mark?0:.05,blend:"auto",lantern:{radius:.16,strength:.35,trail:.6,follow:9},trail:{strength:.9,radius:"dot"===r.mark?.4:.32},...r.clear?{clear:{element:r.clear,padding:32,feather:.2,shape:"rect"}}:{}})});export{a as drift};//# sourceMappingURL=chunk-7QH33RJJ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parseColor as t,hash2 as o}from"./chunk-ZCHGV2CV.js";import{mountCanvas as e}from"./chunk-
|
|
1
|
+
import{parseColor as t,hash2 as o}from"./chunk-ZCHGV2CV.js";import{mountCanvas as e}from"./chunk-AAV5QNHU.js";function n(e,n,c,l,i={}){const{fontSize:r=13,chars:a="0123456789ABCDEF@#$&*+=/<>",accentColor:s,color:f,speed:h=1,density:g=.55,tailLength:d=14,lightMode:$=!1}=i,p=s??($?"#6b8700":"#d4ff00"),m=.62*r,u=1.4*r,M=Math.ceil(n/m),b=Math.ceil(c/u);e.clearRect(0,0,n,c),e.font=`${r}px monospace`,e.textBaseline="top";let C=255,S=255,x=255;if($&&(C=55,S=55,x=55),f){const o=t(f);o&&(C=o.r,S=o.g,x=o.b)}let z=212,k=255,y=0;const A=t(p);A&&(z=A.r,k=A.g,y=A.b);const V=b+d;for(let t=0;t<M;t++){if(o(17*t,3)>g)continue;const n=(.5+1.5*o(31*t,7))*h,c=o(13*t,11)*V,i=Math.floor((l*n*7+c)%V),r=t*m;for(let n=0;n<=d;n++){const c=i-(d-n);if(c<0||c>=b)continue;const s=c*u,f=o(53*t+Math.floor(5*l+n),7*c),h=a[Math.floor(f*a.length)],g=n/d;if(n===d)e.fillStyle=`rgba(${z},${k},${y},${$?.7:.85})`;else{const t=$?.85*g:.15*g;e.fillStyle=`rgba(${C},${S},${x},${t})`}e.fillText(h,r,s)}}}var c={id:"rain",name:"Rain",description:"Columns of falling characters with bright heads.",cellSize:13,speed:1,cursor:!1,mount:t=>e(t,(t,o,e,c,l,i)=>n(t,o,e,c,{fontSize:i.fontSize,chars:i.chars,lightMode:i.lightMode,color:i.ink,accentColor:i.accent}))};export{c as rain,n as renderRainBackground};//# sourceMappingURL=chunk-7TXDNPL3.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{styleKeeper as e,isDark as t,resolveColor as n,prefersReduced as i,boxIn as o}from"./chunk-
|
|
1
|
+
import{styleKeeper as e,isDark as t,resolveColor as n,prefersReduced as i,boxIn as o}from"./chunk-I377LEZA.js";var r="#6f6d67",s="#8f8d86",a={x:-1,y:-1,users:0},c=e=>{a.x=e.clientX,a.y=e.clientY};function d(d,l,u=0){if("undefined"==typeof document)return null;const{host:m}=d,h=document.createElement("canvas");let f=null;try{f=h.getContext("2d")}catch{f=null}if(!f)return null;const v=f,p=e();"static"===getComputedStyle(m).position&&p.set(m,"position","relative"),p.set(m,"isolation","isolate"),h.dataset.asciiKit="",h.setAttribute("aria-hidden","true"),h.setAttribute("style","position:absolute;inset:0;width:100%;height:100%;pointer-events:none;border-radius:inherit;z-index:-1"),m.appendChild(h);let g,y=t(m),b="";const x=()=>{b=n(d.ink(y),m,y?s:r)??s;const e=d.settings().accent;g=e?n(e,m)??void 0:void 0};x();let E=0,M=!0,w=!1,L=!1,A=0,C=0,F=0,O=!1,S=9,R=9,z=1,k=1,q=u;const I={x:.5,y:.5},j=()=>!!(d.reducedMotion()??i()),H=()=>{const e=d.settings(),t=performance.now(),n={fontSize:e.cellSize,chars:e.charset,ditherStrength:e.dither,lightMode:!y,ink:b,accent:g,elapsed:R,speed:e.speed};for(v.globalAlpha=1,v.globalCompositeOperation="source-over";q>0;q--)l(v,z,k,S,I,n);l(v,z,k,S,I,n),(e=>{if(!e||!e.isConnected)return;const t=o(h,e);if(!t.w||!t.h)return;const n=.71*t.w+32,i=.71*t.h+32,r=h.width/z||1;v.save(),v.setTransform(r*n,0,0,r*i,r*(t.x+t.w/2),r*(t.y+t.h/2));const s=v.createRadialGradient(0,0,0,0,0,1);s.addColorStop(0,"rgba(0,0,0,1)"),s.addColorStop(.72,"rgba(0,0,0,1)"),s.addColorStop(1,"rgba(0,0,0,0)"),v.globalCompositeOperation="destination-out",v.fillStyle=s,v.fillRect(-1,-1,2,2),v.restore()})(e.clear),F=.9*F+.1*(performance.now()-t),h.dataset.painted=""},P=e=>{if(E=0,L||w||!M||"undefined"!=typeof document&&document.hidden)return void(A=C=0);const t=j(),n=d.settings(),i=C?e-C:17;if(C=e,!t&&F>4.5&&i<12&&(O=!O))return void(E=requestAnimationFrame(P));const o=A?Math.min(.05,(e-A)/1e3):0;if(A=e,t||(S+=o*n.speed,R+=o),n.cursor&&a.x>=0){const e=h.getBoundingClientRect();e.width&&e.height&&(I.x+=.07*((a.x-e.left)/e.width-I.x),I.y+=.07*((a.y-e.top)/e.height-I.y))}else n.cursor||(I.x+=.07*(.5-I.x),I.y+=.07*(.5-I.y));H(),t||(E=requestAnimationFrame(P))},T=()=>{E||L||w||!M||(E=requestAnimationFrame(P))},W=()=>{if(L)return;const e=Math.min(2,"number"==typeof devicePixelRatio&&devicePixelRatio||1);z=Math.max(1,h.clientWidth||m.clientWidth||1),k=Math.max(1,h.clientHeight||m.clientHeight||1),h.width=Math.round(z*e),h.height=Math.round(k*e),v.setTransform(e,0,0,e,0,0),q=u,M&&!w&&H(),T()};W();const B="function"==typeof ResizeObserver?new ResizeObserver(W):null;B?.observe(m);const G="function"==typeof IntersectionObserver?new IntersectionObserver(([e])=>{M=e.isIntersecting,A=0,M?T():E&&(cancelAnimationFrame(E),E=0)},{rootMargin:"64px"}):null;G?.observe(m);const K=()=>{A=0,T()};document.addEventListener("visibilitychange",K);const X="function"==typeof matchMedia?matchMedia("(prefers-reduced-motion: reduce)"):null;X?.addEventListener?.("change",K),0===a.users++&&"function"==typeof addEventListener&&addEventListener("pointermove",c,{passive:!0});const Y="object"==typeof document.fonts?document.fonts:null,Z=()=>{L||!M||w||(H(),T())};Y?.addEventListener?.("loadingdone",Z),Y?.ready?.then(Z,()=>{});let D=0;const J=()=>{D||L||(D=requestAnimationFrame(()=>{D=0,L||(y=t(m),x(),j()&&H(),T())}))},N="function"==typeof matchMedia?matchMedia("(prefers-color-scheme: dark)"):null;N?.addEventListener?.("change",J);const Q="function"==typeof MutationObserver?new MutationObserver(J):null;for(const e of[document.documentElement,document.body])e&&Q?.observe(e,{attributes:!0,attributeFilter:["class","data-theme","data-mode","style"]});return{field:null,canvas:h,refresh(){L||(y=t(m),x(),j()&&M&&!w&&H(),T())},play(){w&&(w=!1,A=0,T())},pause(){w=!0,E&&cancelAnimationFrame(E),E=0},destroy(){L||(L=!0,E&&cancelAnimationFrame(E),D&&cancelAnimationFrame(D),E=D=0,B?.disconnect(),G?.disconnect(),Q?.disconnect(),document.removeEventListener("visibilitychange",K),X?.removeEventListener?.("change",K),N?.removeEventListener?.("change",J),Y?.removeEventListener?.("loadingdone",Z),0===--a.users&&"function"==typeof removeEventListener&&removeEventListener("pointermove",c),h.remove(),h.width=h.height=0,p.restore())}}}export{d as mountCanvas};//# sourceMappingURL=chunk-AAV5QNHU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{srOnly as t,mountSurface as e,handle as n,house as o,clamp as i}from"./chunk-I377LEZA.js";var l={hold:3200,transition:1e3,autoplay:!0,fit:"cover",layer:"under"};function r(t,e,n,o,i,l){if("function"==typeof e)return e(t,n,o,i),!0;const[r,a]="videoWidth"in(c=e)?[c.videoWidth,c.videoHeight]:"naturalWidth"in c?[c.naturalWidth,c.naturalHeight]:[c.width,c.height];var c;if(!r||!a)return!1;const s="cover"===l?Math.max(n/r,o/a):Math.min(n/r,o/a);return t.drawImage(e,(n-r*s)/2,(o-a*s)/2,r*s,a*s),!0}function a(a,c){const s={current:{...l,...c}},u=()=>s.current;let h,d=[],g=u().sources,p=0,m=0,f=-1;const k=u().label?t(u().label):null,v=()=>{d=u().sources.map(t=>{if("string"!=typeof t)return t;const e=document.createElement("img");return e.crossOrigin="anonymous",e.decoding="async",e.onload=()=>y?.kick(),e.src=t,e})};v();let y=null;y=e({host:a,kit:s,layer:u().layer,look:()=>({mark:"engraving",markAngle:-45,charset:" .:-=+*#%@",cellSize:7,cellAspect:1,contrast:1.15,levels:"none",...u().look}),ink:()=>u().ink??"--ascii-ink-strong",reducedMotion:()=>u().reducedMotion,onFail:()=>{y=null},paint:({pen:t,width:e,height:n,now:l,still:a})=>{if(!d.length)return!1;const c=f<0||a?1:o(i((l-f)/u().transition)),s=u().fit;if(c<1)return r(t,d[m],e,n,l,s),t.globalAlpha=c,t.fillStyle="#000",t.fillRect(0,0,e,n),t.globalAlpha=1,t.globalCompositeOperation="lighter",t.globalAlpha=c,r(t,d[p],e,n,l,s),t.globalAlpha=1,t.globalCompositeOperation="source-over",!0;f>=0&&(f=-1,A());const h=r(t,d[p],e,n,l,s);return!a&&("function"==typeof(g=d[p])||!!g&&"videoWidth"in g&&!g.paused||!h);var g}});const b=t=>{const e=d.length;e&&((t=(t%e+e)%e)===p&&f<0||(clearTimeout(h),m=p,p=t,u().onChange?.(p),f=y&&!y.still()?performance.now():-1,y?.kick(),f<0&&A()))};function A(){clearTimeout(h),!y||!u().autoplay||y.still()||d.length<2||(h=setTimeout(()=>b(p+1),u().hold))}return y&&(k&&a.appendChild(k),A()),n(()=>y,s,t=>{t.sources!==g&&(g=t.sources,v(),p=Math.min(p,Math.max(0,d.length-1))),k&&(k.textContent=t.label??""),A(),y?.refresh()},{next:()=>b(p+1),go:b,get index(){return p}},()=>{clearTimeout(h),k?.remove()})}export{r as drawMorphSource,a as morphField};//# sourceMappingURL=chunk-AU33Y2SZ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{mountSurface as n,mixHex as t,handle as e,resolveColor as i}from"./chunk-
|
|
1
|
+
import{mountSurface as n,mixHex as t,handle as e,resolveColor as i}from"./chunk-I377LEZA.js";var r={colourByState:!0,ring:!0},o={success:["--ascii-success","#17844a","#3ccf7e"],warning:["--ascii-warning","#9a6700","#f5b83d"],error:["--ascii-error","#c93636","#ff6b6b"]},a=120,c=280,s=520,l=2*Math.PI,u=l/1050,d=n=>1-(1-n)**4,f=n=>`rgb(${255*n} ${255*n} ${255*n})`,h=n=>n*u-Math.PI/2,g=(n,t=0)=>78+5*Math.sin(n/1600*l)*(1-t);function p(n,t,e=78,i=24){n.strokeStyle=f(t),n.lineWidth=i,n.beginPath(),n.arc(a,a,e,0,l),n.stroke()}function k(n,t,e,i=0,r=1){if(p(n,(.3+(e-78)/100)*r,e,24-6*i),i>=1)return void p(n,.72*r,e,18);const o=3.4+(l-3.4)*i;n.lineCap="round";for(let c=0;c<32;c++){const s=c/32,l=.3+.7*(1-s)**1.6;n.strokeStyle=f((l+(.72-l)*i)*r),n.lineWidth=28-6*s+(18-(28-6*s))*i,n.beginPath(),n.arc(a,a,e,t-(s+1/32)*o,t-s*o),n.stroke()}}function m(n,t,e,i=800,r=0,o=!0){if("idle"===t)return void p(n,.34);if("loading"===t)return void k(n,h(e),g(e));const f=(n=>n<.5?4*n*n*n:1-(-2*n+2)**3/2)(Math.min(1,i/c)),m=Math.min(i,c),M=r+u*(m-m*m/560);o?k(n,M,g(e,f),f):f<1&&k(n,M,g(e,f),0,1-f);const b=(i-196)/s;o&&b>0&&b<1&&p(n,.5*(1-b)**2,88+24*b,16-8*b),function(n,t,e,i=30){n.strokeStyle="#fff",n.lineWidth=i,n.lineCap="round",n.lineJoin="round";const r=(t,e)=>{const i=t.slice(1).map((n,e)=>Math.hypot(n[0]-t[e][0],n[1]-t[e][1]));let r=e*i.reduce((n,t)=>n+t,0);n.beginPath(),n.moveTo(t[0][0],t[0][1]);for(let e=1;e<t.length&&r>0;e++){const o=Math.min(1,r/i[e-1]);n.lineTo(t[e-1][0]+(t[e][0]-t[e-1][0])*o,t[e-1][1]+(t[e][1]-t[e-1][1])*o),r-=i[e-1]}n.stroke()};"success"===t?r([[86,122],[110,146],[156,96]],e):"warning"===t?(n.lineWidth=i-4,r([[a,74],[a,114]],Math.min(1,e/.7)),e>.7&&(n.fillStyle="#fff",n.beginPath(),n.arc(a,152,i/2*d((e-.7)/.3),0,l),n.fill())):(r([[92,92],[148,148]],e),r([[148,92],[92,148]],e))}(n,t,d(Math.min(1,Math.max(0,(i-40)/260))),o?24:30)}function M(a,c={}){const s={current:{...r,...c}};let l="idle",u=0,f=0,g="",p="",k=-1e9,M="",b=null;const y=n=>{if(!s.current.colourByState||"idle"===l||"loading"===l)return(n=>i(s.current.ink??"--ascii-ink-strong",a,n?"#d8d6cf":"#1d1d1b"))(n);const[t,e,r]=o[l];return i(s.current.colors?.[l]??t,a,n?r:e)};b=n({host:a,look:()=>({mark:"glyph",fit:"contain",charset:" .:-=+*#%@",cellSize:5,cellAspect:.62,glyphScale:.94,font:'"Geist Mono", ui-monospace, monospace',fontWeight:600,contrast:1.1,shade:.5,...s.current.look}),ink:n=>y(n),kit:s,reducedMotion:()=>s.current.reducedMotion,resolution:()=>[240,240],onFail:()=>{b=null},onTheme:()=>{k=-1e9,M=""},paint:({pen:n,now:e,still:i,dark:r})=>{const o=e-u;m(n,l,i?380:e,i?800:o,f,s.current.ring);const a=y(r);a!==p&&(g=p||a,p=a,k=e);const c=i?1:d(Math.min(1,(e-k)/200)),h=c<1?t(g,p,c):p;return h!==M&&(M=h,b?.field.update({ink:h})),"loading"===l||o<800||c<1}});const S=n=>{const t=performance.now();"loading"===l&&"loading"!==n&&(f=h(t)),l=n,u=t,a.dataset.state=n,"error"===n&&b&&!b.still()&&"function"==typeof a.animate&&a.animate({translate:["0","-5px 0","4px 0","-2px 0","0"]},{duration:260,easing:"cubic-bezier(.16, 1, .3, 1)"}),b?.kick()};return e(()=>b,s,()=>b?.refresh(),{idle:()=>S("idle"),loading:()=>S("loading"),success:()=>S("success"),warning:()=>S("warning"),error:()=>S("error"),get state(){return l}},()=>{delete a.dataset.state})}var b=r;export{b as STATUS_ORB_DEFAULTS,m as orbFrame,M as statusOrb};//# sourceMappingURL=chunk-BGPEFFKK.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{driftNoise as t}from"./chunk-
|
|
1
|
+
import{driftNoise as t}from"./chunk-IFZDWKIX.js";import{styleKeeper as e,mountSurface as r,handle as i}from"./chunk-I377LEZA.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)},I=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"))},L=t=>new Promise(e=>setTimeout(e,t)),R=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"))},S=async(t=g.current.stream)=>{if(!t)return b;const e=++d,r=()=>e===d,i=!!M?.still();p=performance.now(),A("generating"),I(!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){R(e.final),M&&x(await m(e.final),o.final.k,o.final.blur);break}if(!M){R(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 L(i?0:544),!r())return b;A("done"),I(!0),M?.kick()}catch(t){if(!r())return b;x(null,0,n),await L(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&&S(),i(()=>M,g,()=>M?.refresh(),{run:S,reset(){d++,x(null,0,n),A("idle"),I(!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-BJJUDT26.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{mountPageField as e,pageHandle as t}from"./chunk-
|
|
1
|
+
import{mountPageField as e,pageHandle as t}from"./chunk-RGV7VRYC.js";import{styleKeeper as r,prefersReduced as o}from"./chunk-I377LEZA.js";var n="position:absolute;inset:0;width:100%;height:100%;object-fit:cover;border-radius:inherit;pointer-events:none";function s(s,i={}){const l={current:{...i}},a=r(),c=[],p=s.querySelector("video"),u=l.current.src??p??null,d=()=>l.current.reducedMotion??o();let y=null,h=0;y=u?e({host:s,layer:"over",look:()=>({mark:"glyph",scene:"none",charset:" .:-=+*#%@",font:'"Geist", Arial, sans-serif',fontWeight:500,cellSize:6,cellAspect:.8,glyphScale:.8,color:"ink",shade:0,contrast:1.25,levels:"auto",fit:"cover",focus:{x:.5,y:.5},hover:"trail",trail:{strength:.9,radius:.35},...l.current.look}),ink:()=>l.current.ink??"--ascii-ink-strong",source:u,label:l.current.label??"Video, drawn in characters",kit:l,ownPoster:!0,reducedMotion:()=>l.current.reducedMotion,onFail:()=>{y=null,a.restore(),v()},onRelease:()=>{f=!1,g(),u instanceof HTMLVideoElement&&u.pause?.()},onMount:()=>{h++&&(y?.field.ready.then(()=>{f=!0,g()}),k&&u instanceof HTMLVideoElement&&u.play?.()?.catch?.(()=>{}))}}):null,y&&u instanceof HTMLVideoElement&&(s.contains(u)&&a.set(u,"opacity","0"),u.muted=!0,u.loop=!0,u.playsInline=!0);let m=null;l.current.poster&&u&&(m=Object.assign(document.createElement("img"),{alt:"",decoding:"async"}),m.className="ascii-video-poster",m.setAttribute("aria-hidden","true"),m.setAttribute("style",`${n};transition:opacity 280ms cubic-bezier(.16, 1, .3, 1)`),m.src=l.current.poster,"static"===getComputedStyle(s).position&&a.set(s,"position","relative"),s.appendChild(m),c.push(m));let f=!1;const g=()=>{m&&(m.style.opacity=y&&f&&(k||!d())?"0":"1")};let b=null;function v(){!b&&u&&(u instanceof HTMLVideoElement?b=u:(b=document.createElement("video"),b.src=u,b.setAttribute("style",n),b.setAttribute("aria-label",l.current.label??"Video"),"static"===getComputedStyle(s).position&&a.set(s,"position","relative"),m?s.insertBefore(b,m):s.appendChild(b),c.push(b)),l.current.poster&&!b.poster&&(b.poster=l.current.poster),b.muted=!0,b.loop=!0,b.playsInline=!0,m&&(m.style.opacity="0"),k&&b.play?.()?.catch?.(()=>{}))}let k=l.current.autoplay??!(y?y.still():d());y?(y.field.ready.then(()=>{f=!0,k||y?.field.pause(),g()}),k&&u instanceof HTMLVideoElement&&u.play?.()?.catch?.(()=>{}),g()):v();const E=t(()=>y,l,e=>{m&&e.poster&&m.getAttribute("src")!==e.poster&&(m.src=e.poster),b&&e.poster&&(b.poster=e.poster)},{toggle:()=>(k?E.pause():E.play(),k),get playing(){return k}},()=>{c.forEach(e=>e.remove()),a.restore()}),M=E.play,V=E.pause;return E.play=()=>{y&&!E.supported||(k=!0,y?M():b?.play?.()?.catch?.(()=>{}),g())},E.pause=()=>{y&&!E.supported||(k=!1,y?V():b?.pause?.(),g())},E}export{s as asciiVideo};//# sourceMappingURL=chunk-BO4CPM26.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{mergeOptions as t,prefersReduced as e,hash as i,mountSurface as s,resolveColor as h}from"./chunk-I377LEZA.js";import{isGlyphFieldSupported as a,watchPointer as r,watchVisibility as n,watchMotionPreference as o}from"../field.js";var l=class{constructor(t,e,i){this.previous=null,this.peak=0,this.width=t,this.height=e,this.span=i??Math.min(t,e);const s=t*e;this.pixels=new Uint8Array(4*s),this.signal=new Float32Array(s),this.offsetX=new Float32Array(s),this.offsetY=new Float32Array(s),this.driftX=new Float32Array(s),this.driftY=new Float32Array(s),this.u=new Float32Array(s),this.v=new Float32Array(s),this.ink=new Float32Array(s),this.a=new Float32Array(s),this.b=new Float32Array(s),this.c=new Float32Array(s),this.pressure=new Float32Array(s),this.pressureNext=new Float32Array(s),this.divergence=new Float32Array(s),this.curl=new Float32Array(s)}get active(){return this.peak>2e-4}clear(){for(const t of[this.u,this.v,this.ink,this.a,this.b,this.c,this.pressure,this.pressureNext,this.divergence,this.curl,this.signal,this.pixels,this.offsetX,this.offsetY,this.driftX,this.driftY])t.fill(0);this.previous=null,this.peak=0}leave(){this.previous=null}move(t,e,i,s=performance.now()){if(!Number.isFinite(t+e+i+s))return;t=Math.max(0,Math.min(1,t)),e=Math.max(0,Math.min(1,e)),i=Math.max(.1,Math.min(1,i));const h=this.previous;if(this.previous={x:t,y:e,time:s},!h)return;const a=(t-h.x)*(this.width-1),r=(e-h.y)*(this.height-1),n=Math.hypot(a,r);if(n<.001)return;const o=this.span,l=s>h.time?Math.max(1/240,(s-h.time)/1e3):1/60,c=Math.min(12,n/o/l),u=1-Math.exp(-c/2.2),d=o*(.022+.075*i)*(.65+.95*u),p=Math.min(128,Math.max(1,Math.ceil(n/(.4*d)))),f=n/d*(.32+.22*u)/p,m=a/n,M=r/n,y=-M,x=m,v=n*(2+18*u)/p;for(let i=0;i<p;i++){const s=(i+.5)/p,a=(h.x+(t-h.x)*s)*(this.width-1),r=(h.y+(e-h.y)*s)*(this.height-1),n=Math.max(1,Math.floor(a-3*d)),o=Math.min(this.width-2,Math.ceil(a+3*d)),l=Math.max(1,Math.floor(r-3*d)),c=Math.min(this.height-2,Math.ceil(r+3*d));for(let t=l;t<=c;t++)for(let e=n;e<=o;e++){const i=((e-a)*m+(t-r)*M)/d,s=((e-a)*y+(t-r)*x)/d,h=Math.exp(-i*i*.65-s*s*1.7),n=t*this.width+e;this.ink[n]=1-(1-this.ink[n])*Math.exp(-h*f);const o=1-s*s*.55,l=i*s*.7;this.u[n]=Math.max(-80,Math.min(80,this.u[n]+(m*o+y*l)*h*v)),this.v[n]=Math.max(-80,Math.min(80,this.v[n]+(M*o+x*l)*h*v))}}this.peak=1}read(t,e,i){const s=0|(e=Math.max(.5,Math.min(this.width-1.5,e))),h=0|(i=Math.max(.5,Math.min(this.height-1.5,i))),a=e-s,r=i-h,n=h*this.width+s;return(t[n]*(1-a)+t[n+1]*a)*(1-r)+(t[n+this.width]*(1-a)+t[n+this.width+1]*a)*r}sample(t,e){return this.read(this.signal,t*(this.width-1),e*(this.height-1))}displacement(t,e,i){i[0]=this.read(this.offsetX,t*(this.width-1),e*(this.height-1)),i[1]=this.read(this.offsetY,t*(this.width-1),e*(this.height-1))}step(t){if(!this.active||!Number.isFinite(t))return;let e=Math.max(0,Math.min(.05,t));const i=this.width,s=this.height;for(;e>1e-7;){const t=Math.min(1/60,e);e-=t;const h=Math.exp(-1.9*t),a=Math.exp(-3.2*t);for(let e=1;e<s-1;e++)for(let r=1;r<i-1;r++){const n=e*i+r,o=Math.max(.5,Math.min(i-1.5,r-this.u[n]*t)),l=Math.max(.5,Math.min(s-1.5,e-this.v[n]*t)),c=0|o,u=0|l,d=o-c,p=l-u,f=u*i+c,m=(1-d)*(1-p),M=d*(1-p),y=(1-d)*p,x=d*p;this.a[n]=(this.u[f]*m+this.u[f+1]*M+this.u[f+i]*y+this.u[f+i+1]*x)*h,this.b[n]=(this.v[f]*m+this.v[f+1]*M+this.v[f+i]*y+this.v[f+i+1]*x)*h,this.c[n]=(this.ink[f]*m+this.ink[f+1]*M+this.ink[f+i]*y+this.ink[f+i+1]*x)*a}[this.u,this.a]=[this.a,this.u],[this.v,this.b]=[this.b,this.v],[this.ink,this.c]=[this.c,this.ink];for(let t=1;t<s-1;t++)for(let e=1;e<i-1;e++){const s=t*i+e;this.curl[s]=.5*(this.v[s+1]-this.v[s-1]-this.u[s+i]+this.u[s-i])}for(let e=1;e<s-1;e++)for(let s=1;s<i-1;s++){const h=e*i+s,a=Math.abs(this.curl[h+1])-Math.abs(this.curl[h-1]),r=Math.abs(this.curl[h+i])-Math.abs(this.curl[h-i]),n=Math.hypot(a,r)+1e-4,o=this.curl[h]*t*10,l=Math.hypot(this.u[h],this.v[h]);this.u[h]+=r/n*o,this.v[h]-=a/n*o;const c=Math.min(1,l/(Math.hypot(this.u[h],this.v[h])+1e-6));this.u[h]*=c,this.v[h]*=c,this.divergence[h]=-.5*(this.u[h+1]-this.u[h-1]+this.v[h+i]-this.v[h-i])}this.pressure.fill(0);for(let t=0;t<4;t++){for(let t=1;t<s-1;t++)for(let e=1;e<i-1;e++){const s=t*i+e;this.pressureNext[s]=.25*(this.divergence[s]+this.pressure[s-1]+this.pressure[s+1]+this.pressure[s-i]+this.pressure[s+i])}[this.pressure,this.pressureNext]=[this.pressureNext,this.pressure]}let r=0;for(let e=1;e<s-1;e++)for(let s=1;s<i-1;s++){const h=e*i+s;this.u[h]=Math.max(-80,Math.min(80,this.u[h]-.5*(this.pressure[h+1]-this.pressure[h-1]))),this.v[h]=Math.max(-80,Math.min(80,this.v[h]-.5*(this.pressure[h+i]-this.pressure[h-i]))),this.driftX[h]+=(3.6*this.u[h]-58*this.offsetX[h]-12*this.driftX[h])*t,this.driftY[h]+=(3.6*this.v[h]-58*this.offsetY[h]-12*this.driftY[h])*t,this.offsetX[h]=Math.max(-2,Math.min(2,this.offsetX[h]+this.driftX[h]*t)),this.offsetY[h]=Math.max(-2,Math.min(2,this.offsetY[h]+this.driftY[h]*t)),this.signal[h]=1-Math.exp(.06*-Math.hypot(this.u[h],this.v[h])-.16*this.ink[h]),r=Math.max(r,this.signal[h])}this.peak=r}if(this.active)for(let t=0;t<this.ink.length;t++){const e=Math.round(65535*Math.min(1,this.signal[t]));this.pixels[4*t]=e>>>8,this.pixels[4*t+1]=255&e,this.pixels[4*t+2]=Math.round(128+63.5*this.offsetX[t]),this.pixels[4*t+3]=Math.round(128+63.5*this.offsetY[t])}else this.clear()}},c={style:"trail",charset:" .:-=+*#%@",cellSize:9,zIndex:1e3},u='input, textarea, select, [contenteditable], dialog, [role="dialog"], [role="alertdialog"], [data-ascii-cursor-skip]',d={trail:64,wake:48,water:20,sparkle:140,spray:90},p={strength:.62,radius:.22,span:540,cell:15},f=t=>{const e=Math.round(255*Math.max(0,Math.min(1,t)));return`rgb(${e},${e},${e})`};function m(t,e,i,s,h,a,r){for(let n=1;n<e.length;n++){const o=e[n-1],l=e[n],c=e[n-2]??o,u=1-(s-l.t)/h;u<=0||(t.strokeStyle=f(r(u)),t.lineWidth=Math.max(1,a(u)*i),t.beginPath(),t.moveTo((c.x+o.x)/2*i,(c.y+o.y)/2*i),t.quadraticCurveTo(o.x*i,o.y*i,(o.x+l.x)/2*i,(o.y+l.y)/2*i),t.lineTo(l.x*i,l.y*i),t.stroke())}}function M(t,e,i,s,h,a,r,n){if(t.lineCap="round",t.lineJoin="round",t.globalCompositeOperation="lighten","trail"===i)m(t,e,r,s,h,t=>a*(.5+.95*t),t=>t**1.25);else if("wake"===i)m(t,e,r,s,h,t=>a*(2+3.2*t),t=>.34*t**1.6),m(t,e,r,s,h,t=>a*(.8+1.4*t),t=>.62*t**1.4);else if("water"===i)for(const i of e){const e=s-i.t,n=1-e/h;n<=0||(t.strokeStyle=f(.9*n**1.5),t.lineWidth=Math.max(1,a*(.45+.5*n)*r),t.beginPath(),t.arc(i.x*r,i.y*r,(.8*a+.085*e)*r,0,2*Math.PI),t.stroke())}else if("spray"===i){for(const i of e){const e=1-(s-i.t)/h;if(e<=0)continue;const n=a*(1.1+1.6*i.seed)*(.75+.25*e)*r,o=i.x*r,l=i.y*r,c=t.createRadialGradient(o,l,0,o,l,n);c.addColorStop(0,f(.95*e**.8)),c.addColorStop(.6,f(.6*e**.8)),c.addColorStop(1,f(0)),t.fillStyle=c,t.fillRect(o-n,l-n,2*n,2*n)}if(n){const e=n.t?1-(s-n.t)/h:1;e>0&&(t.strokeStyle=f(.85*e),t.lineWidth=Math.max(1,.5*a*r),t.strokeRect(Math.min(n.x0,n.x1)*r,Math.min(n.y0,n.y1)*r,Math.abs(n.x1-n.x0)*r,Math.abs(n.y1-n.y0)*r))}}else for(const i of e){const e=s-i.t,n=1-e/h;if(n<=0)continue;const o=.55+.45*Math.sin(.028*e+6.28*i.seed),l=a*(.55+.6*i.seed)*(.6+.4*n)*r;t.fillStyle=f(n**1.2*o),t.fillRect((i.x+i.vx*e)*r-l/2,(i.y+i.vy*e)*r-l/2,l,l)}t.globalCompositeOperation="source-over"}function y(f={}){const m={current:{...c,...f}},y=()=>m.current,x=()=>y().life??("water"===y().style?950:800);let v=[],g=null;const w=[];let k=-1/0,b=0;const A=(t,e,i,s)=>{if(!y().readout||!S)return;const a=s??b++%2+2;let r=w[a];r||(r=document.createElement("span"),w[a]=r,S.appendChild(r));const n=h(y().ink??"--ascii-ink",document.body,"#1d1d1b")??"#1d1d1b";r.textContent=`${Math.round(t)}, ${Math.round(e)}`,r.style.cssText=`position:absolute;left:${Math.round(t+10)}px;top:${Math.round(e-22)}px;padding:1px 5px;font:500 10px/1.5 ui-monospace,"SF Mono",Menlo,monospace;letter-spacing:.02em;white-space:nowrap;color:var(--ascii-readout-text,#fff);background:${n};opacity:.9;transition:opacity ${x()}ms linear`,k=i,requestAnimationFrame?.(()=>{r&&(r.style.opacity="0")})};let F=null,S=null,X=!1,Y=!1,z=!1,C=0;const $="undefined"!=typeof document&&"undefined"!=typeof window&&a(),I=()=>!!(y().reducedMotion??e()),E=()=>({mark:"glyph",charset:y().charset,cellSize:y().cellSize,..."trail"===y().style?{font:'"Geist", Arial, sans-serif',fontWeight:500,cellAspect:.8,glyphScale:.8,shade:0,levels:"none"}:"spray"===y().style?{mark:"engraving",markAngle:-45,cellAspect:1,shade:0}:{cellAspect:.62,glyphScale:.92,shade:.6},contrast:1,...y().look}),N={trail:null,cols:0,rows:0,at:0,moved:0,lit:!1,art:null},T=()=>({...p,...y().trail}),L=()=>{const{cell:t,span:e}=T(),i=window.innerWidth||1280,s=window.innerHeight||800,h=Math.ceil(i/t)+2,a=Math.ceil(s/t)+2;return N.trail&&N.cols===h&&N.rows===a&&N.trail.span===e/t||(N.trail=new l(h,a,e/t),N.cols=h,N.rows=a),N.trail},P=t=>{t.style.cssText=`position:fixed;left:0;top:0;width:100vw;height:100vh;pointer-events:none;z-index:${y().zIndex};contain:strict`},W=t=>{if("trail"===y().style)return(({pen:t,now:e,scale:i})=>{const s=L(),h=N.at?Math.max(0,e-N.at)/1e3:1/60;if(N.at=Math.max(N.at,e),s.step(h),!s.active)return N.at=0,N.lit=!1;const{cols:a,rows:r}=N,{strength:n,cell:o}=T(),l=s.pixels,c=N.art??(N.art=document.createElement("canvas")),u=3*a,d=3*r;c.width===u&&c.height===d||(c.width=u,c.height=d);const p=c.getContext("2d");if(!p)return N.at=0,N.lit=!1;const f=p.createImageData(u,d),m=f.data,M=t=>(256*l[4*t]+l[4*t+1])/65535;let y=0;for(let t=0;t<d;t++){const e=Math.min(r-1.001,Math.max(0,(t+.5)/3-.5)),i=0|e,s=e-i;for(let e=0;e<u;e++){const h=Math.min(a-1.001,Math.max(0,(e+.5)/3-.5)),r=0|h,o=h-r,l=i*a+r,c=((M(l)*(1-o)+M(l+1)*o)*(1-s)+(M(l+a)*(1-o)+M(l+a+1)*o)*s)*n,d=Math.min(1,c/.38),p=d*d*(3-2*d);p>y&&(y=p);const f=Math.round(255*p),x=4*(t*u+e);m[x]=m[x+1]=m[x+2]=f,m[x+3]=255}}return y<.05&&e-N.moved>150?(s.clear(),N.at=0,N.lit=!1):(p.putImageData(f,0,0),t.imageSmoothingEnabled=!0,t.drawImage(c,-o/2*i,-o/2*i,a*o*i,r*o*i),N.lit=!0)})(t);const{pen:e,now:i,scale:s}=t,h=x();return v=v.filter(t=>i-t.t<h),g&&g.t&&i-g.t>h&&(g=null),!(!v.length&&!g)&&(M(e,v,y().style,i,h,y().cellSize,s,g),!0)},R=()=>{F||X||Y||!$||(S=document.createElement("div"),S.setAttribute("aria-hidden","true"),S.dataset.asciiCursor="",P(S),document.body.appendChild(S),F=s({host:S,kit:{get current(){return{lazy:!1,globalLook:y().globalLook??!1}}},look:E,ink:()=>y().ink??"--ascii-ink",resolution:.5,paint:W,reducedMotion:()=>y().reducedMotion,onFail:()=>{X=!0,F=null,S?.remove(),S=null}}),F||(X=!0,S.remove(),S=null))},j=()=>{v=[],g=null,(()=>{for(const t of w)t?.remove();w.length=0})(),N.trail?.clear(),N.lit=!1,N.at=0},q=()=>{g&&!g.t&&(g.t=performance.now(),F?.kick())};$&&window.addEventListener("pointerup",q,!0);const D=$?[()=>window.removeEventListener("pointerup",q,!0),r({target:window,move:t=>{if(Y||z||"touch"===t.pointerType||"function"==typeof matchMedia&&matchMedia("(hover: none)").matches&&matchMedia("(pointer: coarse)").matches||I()||(t=>{const e=t;return!!e?.closest&&!!e.closest(y().skip?`${u}, ${y().skip}`:u)})(t.target))return void N.trail?.leave();const e=performance.now(),s=t.clientX,h=t.clientY,a=y().style;if("trail"===a){const{cell:t,radius:i}=T(),a=L();return N.at||(N.at=e),N.moved=e,a.move(s/(t*(N.cols-1)),h/(t*(N.rows-1)),i,e),N.lit=!0,R(),void F?.kick()}if("spray"===a){!(1&~t.buttons)?(g&&!g.t||(g={x0:s,y0:h,x1:s,y1:h,t:0},R(),A(s,h,e,0)),g.x1=s,g.y1=h,e-k>60&&A(s,h,e,1)):g&&!g.t&&(g.t=e)}const r=v[v.length-1],n=r?Math.hypot(s-r.x,h-r.y):1/0;if("water"===a?n<2.6*y().cellSize&&e-C<90:"spray"===a?n<2.2*y().cellSize:n<2)g&&F?.kick();else{if(C=e,"sparkle"===a)for(let t=0;t<2;t++){const a=i(e+17*t,s+h),r=i(h+t,e)*Math.PI*2,n=1.4*y().cellSize*i(s,e+t);v.push({x:s+Math.cos(r)*n,y:h+Math.sin(r)*n,t:e,seed:a,vx:.012*Math.cos(r),vy:.012*Math.sin(r)+.01})}else if("spray"===a){const t=i(e,s)*Math.PI*2,a=2.6*y().cellSize*i(h,e);v.push({x:s+Math.cos(t)*a,y:h+Math.sin(t)*a,t:e,seed:i(s+e,h),vx:0,vy:0}),!g&&e-k>140&&(R(),A(s,h,e))}else v.push({x:s,y:h,t:e,seed:0,vx:0,vy:0});for(;v.length>d[a];)v.shift();R(),F?.kick()}},leave(){}}),n(()=>{document.hidden&&j()}),o(()=>{I()&&j(),F?.kick()})]:[];return{get supported(){return $&&!X&&!Y},get field(){return Y?null:F?.field??null},get active(){return v.length>0||!!g||N.lit},clear(){j(),F?.kick()},update(e){if(Y)return;const i=y().style;m.current={...c,...t(m.current,e)},y().style!==i&&j(),S&&P(S),F?.refresh()},play(){Y||(z=!1,F?.play())},pause(){Y||(z=!0,j(),F?.pause())},destroy(){if(!Y){Y=!0;for(const t of D)t();j(),F?.destroy(),F=null,S?.remove(),S=null}}}}export{y as cursorTrail,M as cursorTrailFrame};//# sourceMappingURL=chunk-BQ53B2HP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{clamp as t,mountSurface as o,handle as e}from"./chunk-I377LEZA.js";import{watchPointer as r}from"../field.js";var n={lights:[{x:.5,y:1.08,radius:.62,strength:1}],base:.05,motion:.35,follow:.06,layer:"under"},l=o=>{const e=Math.round(255*t(o));return`rgb(${e},${e},${e})`};function i(o,e,r,n,i,a,s,c){o.fillStyle=l(i),o.fillRect(0,0,e,r),o.globalCompositeOperation="lighter";const h=Math.max(e,r);n.forEach((n,i)=>{const d=.035*a,u=1+.14*a*Math.sin(.55*s+2.1*i),x=(n.x+d*Math.sin(.17*s+1.7*i)+(0===i?c.x:0))*e,y=(n.y+d*Math.cos(.13*s+2.3*i)+(0===i?c.y:0))*r,m=Math.max(1,(n.radius??.6)*h*u),g=t(n.strength??1),p=o.createRadialGradient(x,y,0,x,y,m);p.addColorStop(0,l(g)),p.addColorStop(.35,l(.62*g)),p.addColorStop(.7,l(.2*g)),p.addColorStop(1,l(0)),o.fillStyle=p,o.fillRect(0,0,e,r)}),o.globalCompositeOperation="source-over"}function a(l,a={}){const s={current:{...n,...a}},c=()=>s.current,h={x:0,y:0,tx:0,ty:0};let d=null;d=o({host:l,kit:s,layer:c().layer,look:()=>({mark:"dither",charset:" .:-=+*#%@",cellSize:6,cellAspect:1,contrast:1,...c().look}),ink:()=>c().ink??getComputedStyle(l).color,reducedMotion:()=>c().reducedMotion,resolution:(t,o)=>{const e=Math.min(1,180/Math.max(t,o));return[Math.max(4,Math.round(t*e)),Math.max(4,Math.round(o*e))]},onFail:()=>{d=null},paint:({pen:o,width:e,height:r,now:n,still:l})=>{const a=!l&&(Math.abs(h.tx-h.x)>.001||Math.abs(h.ty-h.y)>.001);l?h.x=h.tx=h.y=h.ty=0:(h.x+=.08*(h.tx-h.x),h.y+=.08*(h.ty-h.y));const s=l?0:t(c().motion);return i(o,e,r,c().lights,t(c().base),s,n/1e3,h),!l&&(s>0||a)}});const u=d?r({target:l,move:o=>{const e=c().follow;if(!e||!d)return;const r=l.getBoundingClientRect();h.tx=2*t((o.clientX-r.left)/(r.width||1)-.5,-.5,.5)*e,h.ty=2*t((o.clientY-r.top)/(r.height||1)-.5,-.5,.5)*e,d.kick()},leave:()=>{h.tx=h.ty=0,d?.kick()}}):()=>{};return e(()=>d,s,()=>d?.refresh(),{setLights(t){s.current={...s.current,lights:t},d?.kick()}},u)}export{a as ditherGradient,i as ditherGradientFrame};//# sourceMappingURL=chunk-BV6AOHFU.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-I377LEZA.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`)},E="undefined"!=typeof document&&l();if(E){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=E?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,E&&!C&&(k.remove(),A.remove(),g||p.replaceChildren(...f),h.restore());const N=(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}…`)){N("loading",e)},succeed(e="Done"){N("success",e)},fail(e="Retry"){N("error",e)},reset(e=(g?y??"":m)){N("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-CH64MY3U.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{snapshot as t}from"./chunk-
|
|
1
|
+
import{snapshot as t}from"./chunk-HENGH3DE.js";import{hash as e,styleKeeper as a,mountSurface as n,handle as o,house as i,prefersReduced as s}from"./chunk-I377LEZA.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-CMGMCRAD.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-DKRZSP5K.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-I377LEZA.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,S=!0,C=0,I=null,T=[];const R=new WeakSet,F=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),R=a(E/k.threshold),F=Math.min(k.threshold,48),q="idle"===M||"pulling"===M?s(.1,.55,R):a(E/F),D=o/2,Y=Math.min(E,F)/2+.25*Math.max(0,E-F);"pulling"===M&&R>=1&&!C&&(C=i),R<1&&(C=0);const H=C&&!h&&i-C<260?.14*Math.sin(Math.PI*((i-C)/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(D,Y),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*R})`,r.beginPath(),r.arc(0,0,11,e,e+2*Math.PI*Math.max(.02,R)),r.stroke()}else{const e="done"===M&&S?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||S?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 D=(e,t)=>{if(I&&!I.still()){for(const n of e)n instanceof HTMLElement&&!R.has(n)&&(R.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()}},Y=()=>{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"),F(e.messages?.refreshing??"Refreshing."),q(),S=!0;try{await Promise.all([e.onRefresh(),H(t?0:600)])}catch{S=!1}if("refreshing"===M){if(S&&e.reveal&&!t){await new Promise(e=>"function"==typeof requestAnimationFrame?requestAnimationFrame(()=>e()):e());const t=g();t&&D(t.querySelectorAll(e.reveal),1/0)}M="done",P=performance.now(),F(S?e.messages?.done??"Updated.":e.messages?.failed??"Couldn’t refresh."),q(),await H(t?0:620),"done"===M?(M="idle",w.to=0,Y(),p.removeAttribute("aria-busy"),q()):Y()}},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()},K=()=>{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()},Z=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",K),p.addEventListener("pointercancel",K),p.addEventListener("touchmove",N,{passive:!1}),p.addEventListener("dragstart",Z),p.addEventListener("selectstart",Z)):p.appendChild(y),h(()=>I,m,()=>I?.refresh(),{refresh:$,revealRows:e=>D(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",K),p.removeEventListener("pointercancel",K),p.removeEventListener("touchmove",N),p.removeEventListener("dragstart",Z),p.removeEventListener("selectstart",Z),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-CZL5WMU6.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{clamp as t,hash as e}from"./chunk-
|
|
1
|
+
import{clamp as t,hash as e}from"./chunk-I377LEZA.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=()=>{i(),n(e())},r=()=>{i(),o(new Error(`Could not load ${t.src}`))},i=()=>{t.removeEventListener("load",a),t.removeEventListener("error",r)};t.addEventListener("load",a),t.addEventListener("error",r)})}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,r,i=.5,h=.5){if(a<=0||r<=0||!e.width||!e.height)return;const l=Math.max(a/e.width,r/e.height),c=e.width*l,d=e.height*l;t.save(),t.beginPath(),t.rect(n,o,a,r),t.clip(),t.drawImage(e.image,n+(a-c)*i,o+(r-d)*h,c,d),t.restore()}function r(e,n,o=.08){const a=Math.min(1,420/Math.max(1,e.width,e.height)),r=document.createElement("canvas");r.width=Math.max(1,Math.round(e.width*a)),r.height=Math.max(1,Math.round(e.height*a));const i=r.getContext("2d",{willReadFrequently:!0});if(!i)return e;let h;i.drawImage(e.image,0,0,r.width,r.height);try{h=i.getImageData(0,0,r.width,r.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 i.putImageData(h,0,0),{image:r,width:r.width,height:r.height}}var i={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 r=document.createElement("canvas");r.width=Math.max(2,Math.round(2*n)),r.height=Math.max(2,Math.round(2*o));const c=[],d=r.getContext("2d");if(!d)return{canvas:r,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!==i[t])return i[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?i.icon:i.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:r,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 r=4*Math.floor((a.x-2)/4);r<a.x+a.w+2;r+=4){const a=`${r},${t}`;n.has(a)||(n.add(a),o.push({x:r,y:t,seed:e(r,t)}))}return o}function s(t,e,n,o,a,r,i=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]=r(c,s);u+=t,f+=e}t.globalAlpha=i*(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,r as toneOf};//# sourceMappingURL=chunk-DKRZSP5K.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-I377LEZA.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())},I=t=>{let e=t.querySelector("[data-digit]");return e||(e=document.createElement("span"),e.dataset.digit="",t.appendChild(e),g.push(e)),e},W=(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},F=(t,e)=>{t.toggleAttribute("data-shown",e),m.set(I(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=>F(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=>F(t,!1)),s<.55){const e=(s/.55)**2;C.forEach((r,n)=>k[n]&&W(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 F(e,!1),W(t,w[r],a,1-m/l,h,r,p),void(f=!0);if(i){const s=o?1:(n-A[r])/300;if(F(e,s>=.7),s>=1)return;return f=!0,void(s>0&&W(t,i,a,s,h,r,p,s>.7?1-(s-.7)/.3:1))}if(F(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 j=(t,e)=>{$.push(setTimeout(e,t))},D=()=>{$.forEach(clearTimeout),$=[]},G=()=>{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)=>{I(e).textContent=y[r]??"",e.toggleAttribute("data-active",r===t),P||F(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=>{D(),"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,G(),e.length===b()&&j(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,G()},Z=()=>{M=!1,G()};return q.addEventListener("input",R),q.addEventListener("paste",U),q.addEventListener("focus",V),q.addEventListener("blur",Z),q.value?J(q.value):G(),r(()=>P,p,()=>{q.setAttribute("maxlength",String(b())),G(),P?.refresh()},{verify:t=>{D();const e=performance.now();if(t)return k=y,C=P?z().map(t=>P.box(t)):[],S=e,x="success",void G();w=y,E=v()||!P?e-l:e,x="error",G(),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;j(v()||!P?0:l,()=>{w===r&&(w="",y="",G())})},clear:()=>{D(),w="",E=-1e9,S=-1e9,y="",x="idle",G()},fill(t){L=55,J(t)},get value(){return y},get state(){return x}},()=>{D(),q.removeEventListener("input",R),q.removeEventListener("paste",U),q.removeEventListener("focus",V),q.removeEventListener("blur",Z),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-E427W6P5.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-LTRVMY3D.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-EH4S6T7U.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{parseColor as t,MONO as e,pixelSnap as n,fbm as o,hash2 as a,band as r,ditherIndex as i,toneAlpha as c}from"./chunk-ZCHGV2CV.js";import{mountCanvas as h}from"./chunk-AAV5QNHU.js";import{hexRgb as s}from"./chunk-I377LEZA.js";function l(h,s,l,f,M={x:.5,y:.5},m={}){const{fontSize:g=13,charAspect:u=.62,lineHeightRatio:d=1.3,chars:p=" .:-=+*#%@",baseColor:x=null,accentColor:$,accentThreshold:b=.52,mouseInfluence:S=.4,mouseFalloff:A=2.8,speed:C=1,vortex:k=!0,sparkles:v=!1,breathe:y=!0,lightMode:z=!1}=m,j=Array.from(p),w=g*u,H=g*d,V=Math.ceil(s/w),I=Math.ceil(l/H),R=M.x,T=M.y,Z=$?t($):null;h.clearRect(0,0,s,l),h.font=`${g}px ${e}`;const q=n(h);h.textBaseline="top";const B=f*C,E=y?.12*(.5*Math.sin(.22*B)+.5):0;for(let t=0;t<I;t++)for(let e=0;e<V;e++){const n=e/V,s=t/I,l=.045,f=.08*B,M=.06,g=.45*((.5*Math.sin(.08*e+.05*t+.6*B)+.5+(.5*Math.sin(.03*e-.07*t+.4*B)+.5)+(.5*Math.sin(.05*e+.03*t+.8*B)+.5))/3)+.35*(.5*o(e*l+f,t*l*1.4-.7*f)+.5)+.2*(.5*Math.sin((e+.65*t)*M+1.1*B)+.5)+E,u=n-R,d=s-T,p=Math.sqrt(u*u+d*d);let $=0;if(k&&p<.35){const t=Math.atan2(d,u),e=Math.sin(4*t+2.2*B-14*p),n=Math.max(0,1-p/.35);$=e*n*n*.22}const C=g*(1-S)+(Math.max(0,1-p*A)+.5*$)*S+.15*$,y=Math.min(1,Math.max(0,C));let F=y;if(v&&y>.72){const n=Math.floor(8*B),o=a(7*e+3*n,11*t+n);o>.88&&(F=Math.min(1,y+4*(o-.88)))}const G=r(F,.32,.9);if(G<=0)continue;const L=i(G,j.length,e,t,m.ditherStrength);if(" "===j[L])continue;const N=c(G);h.fillStyle=Z&&F>b?`rgba(${Z.r},${Z.g},${Z.b},${N})`:x?x.replace("{a}",String(N)):z?`rgba(111,109,103,${N})`:`rgba(143,141,134,${N})`,h.fillText(j[L],q(e*w),q(t*H))}}var f={id:"wave",name:"Wave",description:"An interference field with a soft vortex at the cursor and a slow breath.",cellSize:13,speed:.6,cursor:!0,mount:t=>h(t,(t,e,n,o,a,r)=>{const[i,c,h]=s(r.ink);l(t,e,n,o,a,{ditherStrength:r.ditherStrength,fontSize:r.fontSize,chars:r.chars,lightMode:r.lightMode,baseColor:`rgba(${i},${c},${h},{a})`,accentColor:r.accent})})};export{l as renderWaveBackground,f as wave};//# sourceMappingURL=chunk-F4IO3HWD.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{styleKeeper as t,mountSurface as e,clamp as r,handle as n,resolveColor as o,mixHex as a,prefersReduced as i}from"./chunk-
|
|
1
|
+
import{styleKeeper as t,mountSurface as e,clamp as r,handle as n,resolveColor as o,mixHex as a,prefersReduced as i}from"./chunk-I377LEZA.js";var s={thumb:'[role="slider"]',label:"[data-label]",threshold:.9,resetAfter:0},l=720,c=(t,e,r)=>t+(e-t)*r,d=t=>1-(1-t)**3,u=(t,e,r)=>({x:t,v:0,to:t,k:e,z:r});function m(t,e,r=.4){const n=2*Math.sqrt(t.k)*t.z,o=Math.max(1,Math.ceil(240*e)),a=e/o;for(let e=0;e<o;e++)t.v+=(-t.k*(t.x-t.to)-n*t.v)*a,t.x+=t.v*a;return!(Math.abs(t.x-t.to)<r&&Math.abs(t.v)<12*r)||(t.x=t.to,t.v=0,!1)}var f=t=>{t.x=t.to,t.v=0};function h(t,e){const r=t.filter(([,t])=>e-t<80);if(r.length<2)return 0;const[n,o]=r[0],[a,i]=r[r.length-1];return i>o?(a-n)/(i-o)*1e3:0}function p(p,v={}){const x={current:{...s,...v}},b=t(),g=p.querySelector(x.current.thumb)??p.firstElementChild,A=()=>p.querySelector(x.current.label),k=()=>!!(x.current.reducedMotion??i());let y=u(0,520,.8),w=u(0,150,1),M=!1,E=0,L=!1,S=0,C=0,I=[],T=0,P=0,q=0,z="",D=-1,R=null;const W=()=>{if(!g)return null;const t=Math.max(0,(p.clientHeight-g.offsetHeight)/2);return{pad:t,size:g.offsetHeight,max:Math.max(1,p.clientWidth-g.offsetWidth-2*t)}},$=()=>p.getBoundingClientRect().width/(p.clientWidth||1)||1,F=t=>o(x.current.ink??"--ascii-ink-strong",p)??o(getComputedStyle(p).color,p)??(t?"#d8d6cf":"#1d1d1b");R=e({host:p,layer:"under",look:()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:4,cellAspect:.62,glyphScale:.94,...x.current.look}),ink:F,kit:x,reducedMotion:()=>x.current.reducedMotion,onFail:()=>{R=null},onTheme:()=>{z=""},paint:({pen:t,w:e,h:n,now:i,still:s,dark:u,box:m})=>{const f=W();if(!f)return!1;const h=L?s?1:r((i-S)/l):0,v=d(r(h/.5)),b=d(r((h-.36)/.3)),g=d(r((h-.46)/.4)),A=r((h-.5)/.5),k=1+.07*Math.sin(Math.PI*A)*(1-A),M=C?1-r((i-C)/260):1,E=x.current.mark?m(x.current.mark):{x:e/2-18,y:n/2-18,w:36,h:36},I=E.x+E.w/2,T=E.y+E.h/2,P=Math.min(E.w/2,n/2-2)*k,q=L?a(F(u),(t=>o(x.current.color??"--ascii-success",p,t?"#3ccf7e":"#17844a"))(u),d(r(s?1:(i-S)/360))):F(u);q!==z&&(z=q,R?.field.update({ink:q})),t.save(),t.globalAlpha=M,t.beginPath(),e>4&&n>4&&t.roundRect(2,2,e-4,n-4,(n-4)/2),t.clip(),t.fillStyle=`rgba(255,255,255,${.1*(1-v)})`,t.fillRect(0,0,e,n);const D=f.pad+y.x+f.size/2,$=L?1:w.x,H=c(0,I-P,v),G=c(D,I+P,v),X=c(0,T-P,v),j=c(n,T+P,v);if(G-H>1&&$>.004){const e=t.createLinearGradient(H,0,G,0);e.addColorStop(0,`rgba(255,255,255,${c(.14,1,v)*$})`),e.addColorStop(.62,`rgba(255,255,255,${c(.48,1,v)*$})`),e.addColorStop(1,`rgba(255,255,255,${$})`),t.fillStyle=e,t.globalAlpha=M*(1-.28*b),t.beginPath(),t.roundRect(H,X,G-H,j-X,c(0,P,v)),t.fill()}return b>0&&(t.globalAlpha=1,t.fillStyle="#000",t.beginPath(),t.arc(I,T,Math.max(0,P-5)*b,0,2*Math.PI),t.fill()),t.restore(),g>0&&function(t,e,r,n,o,a,i){if(o<=0||a<=0)return;const s=[[-.82,.02],[-.26,.56],[.86,-.6]].map(([t,o])=>[e+t*n,r+o*n]),l=Math.hypot(s[1][0]-s[0][0],s[1][1]-s[0][1])+Math.hypot(s[2][0]-s[1][0],s[2][1]-s[1][1]);t.save(),t.globalAlpha=a,t.strokeStyle="#fff",t.lineWidth=i,t.lineCap="round",t.lineJoin="round",t.setLineDash([l*o,l]),t.beginPath(),t.moveTo(s[0][0],s[0][1]),t.lineTo(s[1][0],s[1][1]),t.lineTo(s[2][0],s[2][1]),t.stroke(),t.restore()}(t,I+.02*P,T+.07*P,.55*P,g,M,4.5),!1}});const H=()=>{const t=W();if(!t||!g)return;const e=y.x/t.max;b.set(g,"translate",`${y.x}px 0`),g.setAttribute("aria-valuenow",String(Math.round(100*r(e))));const n=A();n&&b.set(n,"opacity",String(L?0:1-r(1.7*e)))},G=t=>{T=0;const e=Math.min(1/30,Math.max(0,(t-P)/1e3));P=t;let r=!M&&m(y,e,.3);r=m(w,e,.003)||r,C&&(t-C>=260||k())&&(C=0,L=!1,y=u(0,520,.8),w=u(0,150,1),p.dataset.state="idle",delete p.dataset.confirmed,g&&(b.set(g,"opacity","1"),b.set(g,"scale","1"),g.tabIndex=0)),L&&t-S>302.4&&(p.dataset.confirmed=""),H(),R?.kick(),(r||M||L&&t-S<760||C>0)&&(T=requestAnimationFrame(G))},X=()=>{T||(P=performance.now(),T=requestAnimationFrame(G))},j=()=>{const t=W();if(!t||L)return;const e=t.max-y.x;M=!1,L=!0,y.to=t.max,w.to=1,S=performance.now()+(e>4?200:90),k()&&(f(y),f(w),S=-1e6,p.dataset.confirmed=""),p.dataset.state="confirmed",g&&(g.setAttribute("aria-valuetext","Confirmed"),g.tabIndex=-1,b.set(g,"transition","opacity 200ms 160ms, scale 240ms 160ms"),b.set(g,"opacity","0"),b.set(g,"scale",".6")),q&&clearTimeout(q),x.current.resetAfter>0&&(q=setTimeout(B,x.current.resetAfter)),H(),X(),x.current.onConfirm?.()};function B(){if(q&&clearTimeout(q),q=0,!L)return y.to=0,w.to=0,void X();C=performance.now(),p.dataset.state="resetting",g?.removeAttribute("aria-valuetext"),X()}const J=t=>{const e=W();if(!M||!e||void 0!==t&&void 0!==t.pointerId&&t.pointerId!==D)return;M=!1;const n=h(I,performance.now());y.x>=e.max*x.current.threshold||n>900&&y.x>.5*e.max?j():(y.to=0,y.v=.25*r(n,-1500,1500),w.to=0,k()&&(f(y),f(w)),p.dataset.state="idle",X())},U=t=>{if(0===t.button&&!L&&g)if(g.contains(t.target)){try{g.setPointerCapture?.(t.pointerId)}catch{}D=t.pointerId,M=!0,E=t.clientX-y.x*$(),w.to=1,I=[],p.dataset.state="dragging",X()}else M||k()||(y.v+=420,w.to=0,X())},Z=t=>{const e=W();M&&e&&t.pointerId===D&&(y.x=y.to=r((t.clientX-E)/$(),0,e.max),y.v=0,I.push([y.x,performance.now()]),I.length>8&&I.shift(),y.x>=e.max-.5?j():X())},K=t=>{const e=W();if(!e||L)return;if("Enter"===t.key||" "===t.key||"End"===t.key)return t.preventDefault(),void j();const n={ArrowRight:1,ArrowUp:1,ArrowLeft:-1,ArrowDown:-1}[t.key],o="Home"===t.key?0:void 0!==n?r(y.to+n*e.max/4,0,e.max):null;null!==o&&(t.preventDefault(),y.to=o,w.to=o>0?1:0,k()&&(f(y),f(w)),o>=e.max-.5?j():X())};g&&(g.hasAttribute("role")||g.setAttribute("role","slider"),g.hasAttribute("tabindex")||(g.tabIndex=0),g.hasAttribute("aria-label")||g.setAttribute("aria-label",A()?.textContent?.trim()||"Slide to confirm"),g.setAttribute("aria-valuemin","0"),g.setAttribute("aria-valuemax","100"),g.setAttribute("aria-valuenow","0"),b.set(g,"touch-action","none"),g.addEventListener("keydown",K));const N=t=>t.preventDefault();return p.dataset.state="idle",p.addEventListener("pointerdown",U),p.addEventListener("pointermove",Z),p.addEventListener("pointerup",J),p.addEventListener("pointercancel",J),p.addEventListener("lostpointercapture",J),p.addEventListener("dragstart",N),n(()=>R,x,()=>R?.refresh(),{confirm:j,reset:B,get confirmed(){return L}},()=>{T&&cancelAnimationFrame(T),q&&clearTimeout(q),T=q=0,g?.removeEventListener("keydown",K),p.removeEventListener("pointerdown",U),p.removeEventListener("pointermove",Z),p.removeEventListener("pointerup",J),p.removeEventListener("pointercancel",J),p.removeEventListener("lostpointercapture",J),p.removeEventListener("dragstart",N),b.restore(),delete p.dataset.state,delete p.dataset.confirmed})}var v=s;export{v as SLIDE_TO_CONFIRM_DEFAULTS,p as slideToConfirm,m as stepSpring,h as velocity};//# sourceMappingURL=chunk-FU4WW3PU.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{scenePreset as e}from"./chunk-
|
|
1
|
+
import{scenePreset as e}from"./chunk-LTRVMY3D.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-G3FVDS2A.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{scenePreset as e}from"./chunk-
|
|
1
|
+
import{scenePreset as e}from"./chunk-LTRVMY3D.js";var r=e({id:"aurora",name:"Aurora",description:"Curtains of light at three depths hang from the top in tall vertical rays, brightest along their hems.",cellSize:11,scene:"aurora",charset:" .:¦|",hover:"lantern",tune:()=>({blend:"off"}),middle:{x:.2,y:.42,width:.6,height:.5,feather:.3,shape:"ellipse"}});export{r as aurora};//# sourceMappingURL=chunk-G7GQSPMC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{mountPageField as e,pageHandle as r}from"./chunk-RGV7VRYC.js";import{styleKeeper as t,prefersReduced as n,resolveColor as s,entryProgress as o,clamp as i,house as l}from"./chunk-I377LEZA.js";import{requestFieldFrame as c}from"../field.js";var a={tones:["transparent","--ascii-ink-strong"],mark:"dither",cellSize:5,reveal:"visible",duration:1100};function f(f,u={}){const d={current:{...a,...u}},v=()=>d.current,h=t(),p=v().src?null:f.querySelector("img"),b=v().src??p??null;let k="none"===v().reveal||(v().reducedMotion??n())?1:0,m=-1,w=!1;let y=null;y=e({host:f,layer:"under",look:e=>{const r=v().tones[0],t="transparent"===r?"transparent":s(r,f,e?"#000000":"#ffffff")??"transparent";return{mark:v().mark,charset:" .:-=+*#%@",cellSize:v().cellSize,cellAspect:1,levels:"auto",contrast:1.1,fit:"cover",focus:v().focus??{x:.5,y:.5},background:t,...v().look,brightness:(v().look?.brightness??0)-(1-k)}},ink:()=>v().ink??v().tones[1],source:b,label:v().label??(p?.alt||("object"==typeof v().src?v().src.alt:"")||void 0),kit:d,reducedMotion:()=>v().reducedMotion,onFail:()=>{y=null,h.restore()}}),y&&p&&h.set(p,"visibility","hidden"),y?.still()&&(k=1);const g=e=>{if(w=!1,!y||m<0)return;const r=i((e-m)/v().duration);k=l(r),y.refresh(),r<1?(w=!0,c(g)):m=-1},I=()=>{if(y){if(y.still())return k=1,void y.refresh();m=performance.now(),k=0,y.refresh(),w||(w=!0,c(g))}},j=()=>{if(!y||y.still())return;const e=o(f);Math.abs(e-k)<.004||(k=e,y.refresh())};let M=!1;const S=y&&"visible"===v().reveal&&"function"==typeof IntersectionObserver?new IntersectionObserver(([e])=>{e.isIntersecting&&!M&&I(),M=e.isIntersecting},{threshold:.3}):null;S?.observe(f);const z=!!y&&"scroll"===v().reveal&&"undefined"!=typeof window;return z&&(window.addEventListener("scroll",j,{passive:!0}),j()),y?.refresh(),r(()=>y,d,()=>{},{replay:I},()=>{S?.disconnect(),z&&window.removeEventListener("scroll",j),h.restore()})}export{f as ditherImage};//# sourceMappingURL=chunk-GI5BNKBL.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-AAV5QNHU.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,A=255,C=204;const k=t(m);k&&(z=k.r,A=k.g,C=k.b);const q=a.replace(/ /g,"").split("");if(0===q.length)return;const y=Math.ceil(o/s),V=Math.ceil(n/s);for(let t=0;t<V;t++)for(let o=0;o<y;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 k=Math.floor(h*(q.length-1)),y=q[Math.min(k,q.length-1)],V=p?.88*h:.22*h;e.fillStyle=m?`rgba(${z},${A},${C},${Math.min(p?.95:.4,.55*h)})`:`rgba(${$},${b},${S},${V})`,e.fillText(y,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-GJANKSX6.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{hash as t,settledSource as e}from"./chunk-
|
|
1
|
+
import{hash as t,settledSource as e}from"./chunk-I377LEZA.js";var o=t=>{const e=Math.round(255*Math.min(1,Math.max(0,t)));return`rgb(${e} ${e} ${e})`},n=t=>{if(!t||"transparent"===t)return 0;const e=/\/\s*([\d.]+)(%?)\s*\)$/.exec(t);if(e)return parseFloat(e[1])/(e[2]?100:1);const o=/^rgba\([^)]*,\s*([\d.]+)\s*\)$/.exec(t);return o?parseFloat(o[1]):1},i=/^(IMG|PICTURE|VIDEO|CANVAS|SVG|svg)$/;function a(t,a,s,c){const d=(t,e)=>Math.max(0,Math.min(parseFloat(t.borderTopLeftRadius)||0,e.w/2,e.h/2)),f=[a,...a.querySelectorAll("*")];t.save();for(const l of f){if("CANVAS"===l.tagName&&void 0!==l.dataset?.asciiKit){if(!c||l===c.skip)continue;const o=s(l),n=o.w>0&&o.h>0?e(l):null;n&&(t.globalCompositeOperation="lighter",t.drawImage(n,o.x,o.y,o.w,o.h),t.globalCompositeOperation="source-over");continue}if(void 0!==l.dataset?.asciiPoster)continue;const f=s(l);if(f.w<=0||f.h<=0)continue;const h=getComputedStyle(l);if("hidden"===h.visibility||"none"===h.display)continue;const u=n(h.backgroundColor)>.03,g=(parseFloat(h.borderTopWidth)||0)>0&&n(h.borderTopColor)>.1;if(t.beginPath(),l===a)(u||g)&&(t.strokeStyle=o(.42),t.lineWidth=3,t.roundRect(f.x+1.5,f.y+1.5,f.w-3,f.h-3,d(h,f)),t.stroke());else{if(i.test(l.tagName)){t.fillStyle=o(.5),f.w<32&&f.h<32?t.arc(f.x+f.w/2,f.y+f.h/2,.36*Math.min(f.w,f.h),0,2*Math.PI):t.roundRect(f.x,f.y,f.w,f.h,d(h,f)),t.fill();continue}u?(t.fillStyle=o(.22),t.roundRect(f.x,f.y,f.w,f.h,d(h,f)),t.fill()):g&&(t.strokeStyle=o(.32),t.lineWidth=1.5,t.roundRect(f.x+.75,f.y+.75,f.w-1.5,f.h-1.5,d(h,f)),t.stroke())}if("INPUT"===l.tagName||"TEXTAREA"===l.tagName){const e=l,o=e.value||e.placeholder||"";o&&r(t,o,f.x+(parseFloat(h.paddingLeft)||0),f.y,f.h,h,e.value?.82:.5)}}!function(t,e,o){if("function"!=typeof document.createTreeWalker)return;const n=document.createTreeWalker(e,4),i=document.createRange(),a=o(e),s=e.getBoundingClientRect(),c=s.width/(e.offsetWidth||s.width||1)||1;let d=0;for(let o=n.nextNode();o&&d<2e3;o=n.nextNode()){const n=o.parentElement;if(!n)continue;const f=getComputedStyle(n);if("hidden"===f.visibility||l(n,e))continue;const h=(parseFloat(f.fontWeight)||400)>=600||/^H[1-6]$/.test(n.tagName)?1:.8;for(const e of o.data.matchAll(/\S+/g)){i.setStart(o,e.index),i.setEnd(o,e.index+e[0].length);const n=i.getClientRects()[0];n&&(d++,r(t,e[0],a.x+(n.left-s.left)/c,a.y+(n.top-s.top)/c,n.height/c,f,h))}}i.detach?.()}(t,a,s),t.restore()}function r(t,e,n,i,a,r,l){const s=Math.min(900,(parseFloat(r.fontWeight)||400)+200);t.font=`${r.fontStyle||"normal"} ${s} ${r.fontSize} ${r.fontFamily}`,t.fillStyle=o(l),t.shadowColor=o(l),t.shadowBlur=3,t.textBaseline="middle",t.fillText(e,n,i+a/2),t.shadowBlur=0}function l(t,e){for(;t&&t!==e;t=t.parentElement){const e=t,o=getComputedStyle(e);if(e.offsetWidth<=1&&e.offsetHeight<=1&&"hidden"===o.overflow)return!0;if("inset(50%)"===o.clipPath||"rect(0px, 0px, 0px, 0px)"===o.clip)return!0}return!1}function s(t,e,o,n,i=2,r){const l=document.createElement("canvas");l.width=Math.max(2,Math.round(o*i)),l.height=Math.max(2,Math.round(n*i));const s=l.getContext("2d",{willReadFrequently:!0});return s?(s.setTransform(i,0,0,i,0,0),s.fillStyle="#000",s.fillRect(0,0,o,n),a(s,t,e,r),l):l}var c=4,d=6;function f(e,o=2){const n=e.getContext("2d",{willReadFrequently:!0});if(!n)return[];const i=e.width,a=e.height,r=n.getImageData(0,0,i,a).data,l=[];for(let e=0;e<a/o;e+=6)for(let n=0;n<i/o;n+=4){let s=!1;for(let t=0;t<6*o&&!s;t+=3)for(let l=0;l<4*o&&!s;l+=2){const c=Math.round(n*o+l),d=Math.round(e*o+t);c<i&&d<a&&r[4*(d*i+c)]>10&&(s=!0)}s&&l.push({x:n,y:e,seed:t(n,e)})}return l}function h(t,e,o,n,i,a,r=1,l=.32,s=2){for(let c=0;c<o.length;c++){const d=o[c],f=(i-n[c]*(1-l))/l;if(f<=0)continue;const h=f>=1?0:1-f;let u=d.x,g=d.y;if(h>0){const[t,e]=a(d,h);u+=t,g+=e}t.globalAlpha=r*(1-h*h),t.drawImage(e,d.x*s,d.y*s,4*s,6*s,u,g,4,6)}t.globalAlpha=1}export{d as BLOCK_H,c as BLOCK_W,f as blocksOf,h as drawBlocks,s as snapshot};//# sourceMappingURL=chunk-HENGH3DE.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{poster as e,liveField as t,disposeKit as n,setPosterSource as o}from"./chunk-FEAFQY7O.js";import{isGlyphFieldSupported as r,watchPointer as i,requestFieldFrame as a,watchVisibility as s,watchTheme as c,watchMotionPreference as l,cancelFieldFrame as u,ambientFactor as d}from"../field.js";var p,h=(e,t=0,n=1)=>Math.min(n,Math.max(t,e)),f=(e,t)=>{const n=43758.5453*Math.sin(127.1*e+311.7*t);return n-Math.floor(n)},m=(e,t=3)=>1-(1-h(e))**t,g=(e,t,n)=>{const o=h((n-e)/(t-e));return o*o*(3-2*o)},y=e=>{if(e<=0)return 0;if(e>=1)return 1;const t=(e,t,n)=>3*t*e*(1-e)**2+3*n*e*e*(1-e)+e**3;let n=0,o=1,r=e;for(let i=0;i<22;i++)r=(n+o)/2,t(r,.16,.3)<e?n=r:o=r;return t(r,1,1)};function v(e){const t=e.getBoundingClientRect(),n="number"==typeof innerHeight&&innerHeight>0?innerHeight:800;return h((n-t.top)/Math.max(1,Math.min(t.height||n,.5*n)))}var b,x=()=>"function"==typeof matchMedia&&matchMedia("(prefers-reduced-motion: reduce)").matches,w=e=>e??x(),M={scene:"none",background:"transparent",color:"ink",levels:"none",fit:"cover",focus:{x:.5,y:.5},vignette:0,drift:0,hover:"none",shade:0,contrast:1,brightness:0,gamma:1,maxPixelRatio:2,clear:!1};function k(e,t,n){let o=(e??"").trim();const r=/^var\(\s*(--[\w-]+)\s*(?:,\s*(.+))?\)$/.exec(o);if(r?o=C(t,r[1])||(r[2]??"").trim():o.startsWith("--")&&(o=C(t,o)),!o)return n?k(n,t):null;if(/^#[\da-f]{6}$/i.test(o))return o.toLowerCase();if(/^#[\da-f]{3}$/i.test(o))return`#${[...o.slice(1)].map(e=>e+e).join("")}`.toLowerCase();const i=/^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)/i.exec(o);if(i)return R([+i[1],+i[2],+i[3]]);if(void 0===b)try{b="undefined"==typeof document?null:Object.assign(document.createElement("canvas"),{width:1,height:1}).getContext("2d",{willReadFrequently:!0})}catch{b=null}if(!b)return n?k(n,t):null;b.clearRect(0,0,1,1),b.fillStyle="#000",b.fillStyle=o,b.fillRect(0,0,1,1);const[a,s,c]=b.getImageData(0,0,1,1).data;return R([a,s,c])}var C=(e,t)=>"function"==typeof getComputedStyle?getComputedStyle(e).getPropertyValue(t).trim():"",R=e=>`#${e.map(e=>Math.round(h(e,0,255)).toString(16).padStart(2,"0")).join("")}`,S=e=>{const t=parseInt(e.slice(1,7),16);return[t>>16&255,t>>8&255,255&t]},$=(e,t,n)=>{const o=S(e),r=S(t);return R(o.map((e,t)=>e+(r[t]-e)*n))};function O(e){const t="function"==typeof getComputedStyle?getComputedStyle(e):null,n=/^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)(?:\s*[,/]\s*([\d.]+%?))?/i.exec(t?.backgroundColor??"");if(n){if((void 0===n[4]?1:n[4].endsWith("%")?parseFloat(n[4])/100:parseFloat(n[4]))>=.5)return.2126*+n[1]+.7152*+n[2]+.0722*+n[3]<128}const o=k(t?.color??"",e);if(!o)return"function"==typeof matchMedia&&matchMedia("(prefers-color-scheme: dark)").matches;const[r,i,a]=S(o);return.2126*r+.7152*i+.0722*a>140}function j(){const e=[];return{set(t,n,o){e.some(([e,o])=>e===t&&o===n)||e.push([t,n,t.style.getPropertyValue(n)]),t.style.setProperty(n,o)},restore(){for(const[t,n,o]of e.reverse())o?t.style.setProperty(n,o):t.style.removeProperty(n);e.length=0}}}function E(e="",t=!1){const n=document.createElement("span");return n.setAttribute("style","position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0"),t&&n.setAttribute("aria-live","polite"),n.textContent=e,n}function F(e,t){const n=e.getBoundingClientRect(),o=t.getBoundingClientRect(),r=n.width/(e.offsetWidth||n.width||1)||1;return{x:(o.left-n.left)/r,y:(o.top-n.top)/r,w:o.width/r,h:o.height/r}}function P(e,t){const n={...e,...t},o=e.look,r=t.look;return r&&(n.look=Object.fromEntries(Object.entries({...o,...r}).filter(([,e])=>void 0!==e))),n}var W=new WeakMap,A=e=>W.get(e)?.()??null;function H(n){const{host:o,layer:h="over",outset:f=0,kit:m}=n;if("undefined"==typeof document)return null;const g=`position:absolute;left:${-f}px;top:${-f}px;width:calc(100% + ${2*f}px);height:calc(100% + ${2*f}px);pointer-events:none;z-index:${"under"===h?-1:"auto"}`;if(!r())return m?.current.poster&&e(o,m.current.poster,g,m),null;const y=j(),v=document.createElement("canvas"),b=document.createElement("canvas"),w=b.getContext("2d");if(!w)return null;"static"===getComputedStyle(o).position&&y.set(o,"position","relative"),"under"===h&&y.set(o,"isolation","isolate"),v.setAttribute("aria-hidden","true"),v.dataset.asciiKit="";const C=v.style;C.position="absolute",C.left=C.top=-f+"px",C.width=C.height=`calc(100% + ${2*f}px)`,C.pointerEvents="none",C.zIndex="under"===h?"-1":"",o.appendChild(v);const R=()=>{const e=getComputedStyle(o);T.canvas.style.borderRadius=[e.borderTopLeftRadius,e.borderTopRightRadius,e.borderBottomRightRadius,e.borderBottomLeftRadius].map(e=>f&&/^[\d.]+px$/.test(e)?`${parseFloat(e)+f}px`:e).join(" ")};let S=O(o);const $=()=>k(n.ink(S),o)??k(getComputedStyle(o).color,o)??(S?"#d8d6cf":"#1d1d1b");let E=!1,P=!1,A=!0,H=!1,I=-1/0,z=-1/0;const B=i({target:o,move:e=>{z=e.timeStamp},leave(){}}),T=t({host:o,canvas:v,kit:m,place:g,options:()=>({...M,...n.look(),ink:$(),interactionTarget:o,label:""}),onMount:(e,t)=>{W.set(t,K),t.removeAttribute("role"),t.removeAttribute("aria-label"),e.ready.then(Y,()=>{}),Y()},onRelease:()=>{E&&u(Q),E=!1},onFail:()=>{ee(),n.onFail?.()}}),L=T.field;R();const D=()=>!!(n.reducedMotion()??x()),V=e=>F(T.canvas,e),q=e=>{const t=T.canvas,r=Math.max(1,t.clientWidth||o.clientWidth+2*f),i=Math.max(1,t.clientHeight||o.clientHeight+2*f),a=n.resolution??1,[s,c]="function"==typeof a?a(r,i):[Math.max(1,Math.round(r*a)),Math.max(1,Math.round(i*a))];b.width===s&&b.height===c||(b.width=s,b.height=c),w.setTransform(1,0,0,1,0,0),w.globalAlpha=1,w.globalCompositeOperation="source-over",w.filter="none",w.fillStyle="#000",w.fillRect(0,0,s,c);let l=!1;try{l=n.paint({pen:w,width:s,height:c,w:r,h:i,scale:s/r,now:e,still:D(),dark:S,box:V})}catch(e){"undefined"!=typeof console&&console.error(e)}return L.setSource(b),H||L.redraw(),l};function K(){const e=T.canvas,t=Math.max(1,e.clientWidth||o.clientWidth+2*f),r=Math.max(1,e.clientHeight||o.clientHeight+2*f),i=n.resolution??1,[a,s]="function"==typeof i?i(t,r):[Math.max(1,Math.round(t*i)),Math.max(1,Math.round(r*i))],c=document.createElement("canvas");c.width=a,c.height=s;const l=c.getContext("2d");if(!l)return null;l.fillStyle="#000",l.fillRect(0,0,a,s);try{n.paint({pen:l,width:a,height:s,w:t,h:r,scale:a/t,now:performance.now(),still:!0,dark:S,box:V})}catch{return null}return c}function Q(e){if(E=!1,H||P||!T.live)return;if(e-I<(p??(p=(()=>{const e="undefined"==typeof navigator?void 0:navigator;return 1e3/(e&&(e.hardwareConcurrency>0&&e.hardwareConcurrency<=2||e.deviceMemory&&e.deviceMemory<=2||e.connection?.saveData)?30:60)-2})()))*d()&&e-z>1e3)return E=!0,void a(Q);I=e;!q(e)||D()||!A||"undefined"!=typeof document&&document.hidden||(E=!0,a(Q))}function Y(){E||H||P||!T.live||(E=!0,a(Q))}W.set(v,K);const G="function"==typeof ResizeObserver?new ResizeObserver(()=>{R(),L.resize(),!T.live||H||P||q(performance.now()),Y()}):null;G?.observe(o);const J="function"==typeof IntersectionObserver?new IntersectionObserver(([e])=>{A=e.isIntersecting,A&&Y()},{rootMargin:"64px"}):null;J?.observe(o);const N=s(()=>{document.hidden||Y()});let U=!1;const X=()=>{U=!1,H||(S=O(o),L.update({ink:$()}),n.onTheme?.(),Y())},Z=c(()=>{U||H||(U=!0,a(X))}),_=l(Y);function ee(){H||(H=!0,E&&u(Q),U&&u(X),E=U=!1,G?.disconnect(),J?.disconnect(),N(),B(),Z(),_(),T.destroy(),y.restore(),b.width=b.height=1)}return T.start(),T.failed?(ee(),null):{field:L,get canvas(){return T.canvas},get live(){return T.live},kick:Y,refresh(){H||(S=O(o),L.update({...M,...n.look(),ink:$()}),Y())},still:D,dark:()=>S,box:V,play(){P&&(P=!1,L.play(),Y())},pause(){P=!0,E&&u(Q),E=!1,L.pause()},destroy:ee}}function I(e,t,r,i,a=()=>{}){let s=!1;const c={get supported(){return!!e()&&!s},get field(){return s?null:e()?.field??null},update(e){if(s)return;t.current=P(t.current,e);const n=e.poster;n&&o(t,n),r(t.current)},play(){s||e()?.play()},pause(){s||e()?.pause()},destroy(){s||(s=!0,e()?.destroy(),n(t),a())}};return Object.defineProperties(i,Object.getOwnPropertyDescriptors(c))}export{M as BASE_LOOK,F as boxIn,h as clamp,m as easeOut,v as entryProgress,I as handle,f as hash,S as hexRgb,y as house,O as isDark,P as mergeOptions,$ as mixHex,H as mountSurface,x as prefersReduced,w as reducedFrom,k as resolveColor,A as settledSource,g as smoothstep,E as srOnly,j as styleKeeper,R as toHex};//# sourceMappingURL=chunk-I377LEZA.js.map
|