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{styleKeeper as t,srOnly as e,mountSurface as n,clamp as o,smoothstep as r,hash as a,house as l,handle as i,prefersReduced as s}from"./chunk-
|
|
1
|
+
import{styleKeeper as t,srOnly as e,mountSurface as n,clamp as o,smoothstep as r,hash as a,house as l,handle as i,prefersReduced as s}from"./chunk-I377LEZA.js";var c={start:!0,stagger:38,roll:520,wave:55,glyphs:"#%*+=-:"},h=t=>`Thought for ${t}s`;function u(u,p={}){const f={current:{...c,...p}},m=t(),g=[...u.childNodes],d=f.current.label??null,y=d?[...d.childNodes]:[];let x="done",k=0,C=0,b=-1e9,w=0,A="",S=null;const M=d?e("",!0):null,v=document.createElement("span");let $="",E="";const F=()=>f.current.reducedMotion??s(),T=(t,e)=>{E=$,$=t,d&&(M&&(M.textContent=t),S?(v.replaceChildren(...[...t].map(t=>Object.assign(document.createElement("span"),{textContent:t}))),b=e?performance.now():-1e9,S.kick()):d.textContent=t)};d&&(S=n({host:d,look:()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:2,cellAspect:.66,glyphScale:1,shade:.2,contrast:1.1,...f.current.look}),ink:()=>f.current.ink??getComputedStyle(d).color,kit:f,reducedMotion:()=>f.current.reducedMotion,resolution:2,onFail:()=>{S=null,d.textContent=$,m.restore()},paint:({pen:t,now:e,still:n,box:i,scale:s})=>{const c=getComputedStyle(v),h=parseFloat(c.fontSize)||14,u=`${c.fontStyle} ${c.fontWeight} ${c.fontSize} ${c.fontFamily}`;t.setTransform(s,0,0,s,0,0),t.textAlign="center",t.textBaseline="alphabetic",t.font=u;const p=t.measureText("x"),m=p.fontBoundingBoxAscent||.8*h,g=p.fontBoundingBoxDescent||.2*h,d=f.current,y=[...v.children],k=e-b<d.roll+y.length*d.wave,w=y.length*d.wave+d.roll+420;let A=!1;return y.forEach((s,c)=>{let p=1;if(!n&&k)p=o((e-b-c*d.wave)/d.roll);else if(!n&&"thinking"===x){const t=(e-C)%w-c*d.wave;p=t<0||t>d.roll?1:t/d.roll}const f=p<1?r(.7,1,p).toFixed(3):"";if(s.style.opacity!==f&&(s.style.opacity=f),p>=1||!s.textContent?.trim())return;A=!0;const y=i(s),S=y.y+(y.h-m-g)/2+m,M=y.x+y.w/2,v=k?E[c]??" ":s.textContent,$=s.textContent,F=[v,...Array.from({length:3},(t,e)=>d.glyphs[Math.floor(a(e+7*c,Math.floor(C))*d.glyphs.length)]??""),$],T=l(p)*(F.length-1)*y.h;t.save(),t.beginPath(),t.rect(y.x-2,y.y,y.w+4,y.h),t.clip(),t.globalAlpha=1-r(.7,1,p),F.forEach((e,n)=>{const o=S+n*y.h-T;if(o<y.y-y.h||o>y.y+2*y.h)return;const r=0===n||n===F.length-1;t.font=r?u:`600 ${.86*h}px "Geist Mono", ui-monospace, monospace`,t.fillStyle=r?"#fff":"#d0d0d0",t.fillText(e,M,o)}),t.restore()}),t.globalAlpha=1,A||!n&&("thinking"===x||k)}}),S&&M&&(m.set(v,"display","inline-flex"),m.set(v,"white-space","pre"),v.setAttribute("aria-hidden","true"),d.replaceChildren(M,v,S.canvas)));const B=document.createElement("span"),z=()=>{w++,x="thinking",C=performance.now(),A="",B.replaceChildren(),u.replaceChildren(B),u.setAttribute("aria-busy","true"),T(f.current.labels?.thinking??"Thinking…",!1),f.current.onState?.("thinking",0),S?.kick()};let P=0,j=0;return f.current.start&&z(),i(()=>S,f,()=>S?.refresh(),{think:z,stream:async t=>{"thinking"!==x&&z();const e=w;P=0;let n="";const o=()=>{"thinking"===x&&(x="streaming",j=performance.now(),k=Math.max(1,Math.round((j-C)/1e3)),T((f.current.labels?.done??h)(k),!0),f.current.onState?.("streaming",k))},r=(t,e)=>{n+=t;const r=e?n.length:n.search(/\s\S*$/)+1;r<=0||(o(),A+=n.slice(0,r),(t=>{const e=!F()&&!S?.still();for(const n of t.match(/\s+|\S+/g)??[]){if(/^\s/.test(n)){B.append(n);continue}const t=document.createElement("span");if(t.textContent=n,e){m.set(t,"opacity","0");const e=Math.max(0,P*f.current.stagger-(performance.now()-j));m.set(t,"transition",`opacity 260ms cubic-bezier(.16, 1, .3, 1) ${Math.round(e)}ms`),requestAnimationFrame(()=>requestAnimationFrame(()=>t.style.setProperty("opacity","1")))}P++,B.appendChild(t)}})(n.slice(0,r)),n=n.slice(r))};if("string"==typeof t)r(t,!0);else{for await(const n of t){if(e!==w)return;r(n,!1)}if(e!==w)return;r("",!0)}o();const a=F()?0:Math.max(0,P*f.current.stagger-(performance.now()-j))+260;await new Promise(t=>setTimeout(t,a)),e===w&&(x="done",u.setAttribute("aria-busy","false"),f.current.onState?.("done",k),S?.kick())},get state(){return x}},()=>{w++,m.restore(),u.removeAttribute("aria-busy"),A?u.textContent=A:u.replaceChildren(...g),d&&($?d.textContent=$:d.replaceChildren(...y))})}var p=c;export{p as THINKING_DEFAULTS,u as thinking};//# sourceMappingURL=chunk-VQ4KIRBW.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{injectStyle as t,drawBlocks as e,snapshot as n,blocksOf as o}from"./chunk-PB5E3D4E.js";import{clamp as i,styleKeeper as a,srOnly as r,mountSurface as s,house as c,hash as d,handle as l,hexRgb as p,resolveColor as m,isDark as h}from"./chunk-GF72XM4C.js";var u={max:3,duration:6e3,label:"Notifications",swipe:!0},f="cubic-bezier(.16, 1, .3, 1)",x=`\n:where(.ascii-toasts){position:relative;margin:0;padding:0;list-style:none;min-height:52px}\n:where(.ascii-toast){position:absolute;left:0;right:0;bottom:0;box-sizing:border-box;display:flex;align-items:center;gap:10px;min-height:52px;padding:8px 8px 8px 10px;border-radius:14px;background:var(--ascii-toast-bg,Canvas);color:var(--ascii-toast-ink,CanvasText);box-shadow:var(--ascii-toast-shadow,0 1px 2px rgb(0 0 0 / .06),0 10px 28px -10px rgb(0 0 0 / .22));z-index:calc(10 - var(--d,0));transform-origin:50% 0;translate:0 calc(var(--d,0) * -12px);scale:calc(1 - var(--d,0) * .05);touch-action:pan-y;transition:translate 380ms ${f},scale 380ms ${f},opacity 220ms ${f},transform 300ms ${f},filter 380ms ${f}}\n:where(.ascii-toast)::after{content:"";position:absolute;left:0;right:0;top:100%;height:10px}\n:where(.ascii-toast) > *{transition:opacity 200ms ${f}}\n:where(.ascii-toast[data-back]) > *{opacity:0}\n:where(.ascii-toasts:not([data-open])) :where(.ascii-toast[data-back]){filter:brightness(calc(1 - var(--d,0) * .04))}\n:where(.ascii-toasts:not([data-open])) :where(.ascii-toast[data-back]) > *{pointer-events:none}\n:where(.ascii-toasts[data-open]) :where(.ascii-toast){translate:0 calc(var(--d,0) * (-100% - 8px));scale:1}\n:where(.ascii-toasts[data-open]) :where(.ascii-toast[data-back]) > *{opacity:1}\n:where(.ascii-toast[data-forming]){animation:ascii-toast-in 420ms ${f} both}\n:where(.ascii-toast[data-forming],.ascii-toast[data-gone]) > *{opacity:0;transition:none}\n:where(.ascii-toast[data-gone]){opacity:0;scale:.97;pointer-events:none}\n:where(.ascii-toast[data-swiping]){transition:translate 380ms ${f},scale 380ms ${f},opacity 220ms ${f}}\n@keyframes ascii-toast-in{from{opacity:0;translate:0 14px}}\n:where(.ascii-toast-icon){display:grid;place-items:center;flex:none;width:32px;height:32px;border-radius:9px;background:rgb(128 128 128 / .14)}\n:where(.ascii-toast-text){display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}\n:where(.ascii-toast-title){overflow:hidden;font-size:14px;font-weight:600;text-overflow:ellipsis;white-space:nowrap}\n:where(.ascii-toast-body){overflow:hidden;font-size:13px;opacity:.68;text-overflow:ellipsis;white-space:nowrap}\n:where(.ascii-toast-action,.ascii-toast-close){flex:none;border:0;background:rgb(128 128 128 / .14);color:inherit;font:inherit;cursor:pointer}\n:where(.ascii-toast-action){height:32px;padding:0 12px;border-radius:999px;font-size:14px;font-weight:500}\n:where(.ascii-toast-close){display:grid;place-items:center;width:28px;height:28px;border-radius:999px;background:transparent;font-size:18px;line-height:1;opacity:.6}\n@media (prefers-reduced-motion:reduce){:where(.ascii-toast){transition:none}:where(.ascii-toast[data-forming]){animation:none}}\n`,g=t=>{const[e,n,o]=p(t).map(t=>{const e=t/255;return e<=.04045?e/12.92:((e+.055)/1.055)**2.4});return.2126*e+.7152*n+.0722*o};function b(t,e){const n=/^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)(?:[\s,/]+([\d.]+%?))?/i.exec(t.trim());if(!n)return!1;if(!((void 0===n[4]?1:n[4].endsWith("%")?parseFloat(n[4])/100:parseFloat(n[4]))>=.5))return!1;const o=`#${[n[1],n[2],n[3]].map(t=>Math.round(i(+t,0,255)).toString(16).padStart(2,"0")).join("")}`,[a,r]=[g(o),g(e)].sort((t,e)=>e-t);return(a+.05)/(r+.05)<3}function v(p,f={}){const g={current:{...u,...f}},v=a(),w=document.createElement("ol"),y=r("",!1);y.setAttribute("role","status");let k=[],E=[],C=0,L=!1,$=!1,M=!1,P=!1,T=null;const z=[];t("ascii-kit-toast",x),w.className="ascii-toasts",w.setAttribute("aria-label",g.current.label),p.append(w,y);const S=new WeakSet,A=t=>{delete t.dataset.forming,S.delete(t)&&(t.style.removeProperty("transition"),t.style.removeProperty("background-color"),t.style.removeProperty("box-shadow"))};T=s({host:p,look:()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:5,cellAspect:.62,glyphScale:.92,...g.current.look}),outset:24,resolution:2,ink:()=>g.current.ink??"--ascii-ink-strong",kit:g,reducedMotion:()=>g.current.reducedMotion,onFail:()=>{T=null,E=[];for(const t of k)A(t.node)},paint:({pen:t,now:n,scale:o,still:a,box:r})=>(t.setTransform(o,0,0,o,0,0),E=E.filter(o=>{const a=(n-o.start)/o.ms;if(o.form&&a>=.62&&A(o.node),a>=1)return!1;if(o.form)e(t,o.snap,o.blocks,o.order,1.04*c(a),(t,e)=>[70*(t.seed-.5)*e,(14+26*d(t.x,t.y))*e],1-i((a-.62)/.28));else{const n=o.dir;e(t,o.snap,o.blocks,o.order,1-1.04*(1-(1-a)**3),(t,e)=>[n*(14+34*t.seed+.5*Math.abs(o.throw))*e,14*(d(t.y,t.x)-.35)*e],1-i((a-.75)/.25))}return!0}),E.length>0)}),T&&(T.canvas.style.zIndex="11");const F=()=>!!T&&T.live&&!T.still(),I=()=>{const t=k.filter(t=>void 0===t.node.dataset.gone);t.forEach((e,n)=>{const o=t.length-1-n;v.set(e.node,"--d",String(o)),0===o?(e.node.dataset.front="",delete e.node.dataset.back):(e.node.dataset.back="",delete e.node.dataset.front)})},W=(t,e,i=0)=>{if(!T)return;const a=T.canvas.clientWidth||p.clientWidth+48,r=T.canvas.clientHeight||p.clientHeight+48,s=n(t,a,r,T.box),c=o(s.rects),d=Math.max(1,...c.map(t=>t.x)),l=i<0?-1:1,m=l>0?t=>t.x/d:t=>1-t.x/d,h=Float32Array.from(c,t=>e?t.x/d*.3+.7*t.seed:.62*m(t)+.38*t.seed);E.push({start:performance.now(),ms:e?340:440,snap:s.canvas,blocks:c,order:h,form:e,node:t,dir:l,throw:i}),T.kick()},X=t=>{t.timer&&clearTimeout(t.timer),t.timer=0,L||t.left<=0||(t.since=performance.now(),t.timer=setTimeout(()=>B(t.id),t.left))},j=()=>(t=>{if(t!==L){L=t,t?w.dataset.open="":delete w.dataset.open;for(const e of k)t&&e.timer&&(clearTimeout(e.timer),e.timer=0,e.left=Math.max(400,e.left-(performance.now()-e.since))),t||X(e)}})($||M),N=()=>{$=!0,j()},D=()=>{$=!1,j()},G=()=>{M=!0,j()},H=t=>{w.contains(t.relatedTarget)||(M=!1,j())};function B(t,e=0){const n=k.find(e=>e.id===t);if(!n||void 0!==n.node.dataset.gone)return;n.timer&&clearTimeout(n.timer);const o=()=>{k=k.filter(t=>t!==n),E=E.filter(t=>t.node!==n.node),n.node.remove(),I(),T?.kick(),k.some(t=>void 0===t.node.dataset.gone)||($=M=!1,j())},i=k[k.length-1]===n;F()&&(i||L||e)?(A(n.node),W(n.node,!1,e),n.node.dataset.gone="",I(),z.push(setTimeout(o,220))):o()}w.addEventListener("pointerenter",N),w.addEventListener("pointerleave",D),w.addEventListener("focusin",G),w.addEventListener("focusout",H);let q=null;const J=t=>{if(!g.current.swipe||0!==t.button||q)return;const e=t.target;if(e?.closest?.('button, a, input, textarea, select, [role="button"]'))return;const n=e?.closest?.("[data-toast]"),o=n&&k.find(t=>t.node===n);o&&void 0===n.dataset.gone&&void 0===n.dataset.forming&&(q={item:o,id:t.pointerId,x0:t.clientX,dx:0,t:performance.now(),v:0},n.dataset.swiping="",n.setPointerCapture?.(t.pointerId))},K=t=>{if(!q||t.pointerId!==q.id)return;const e=performance.now(),n=t.clientX-q.x0;q.v=(n-q.dx)/Math.max(1,e-q.t),q.dx=n,q.t=e,q.item.node.style.setProperty("transform",`translateX(${n}px)`),q.item.node.style.setProperty("opacity",String(i(1-Math.abs(n)/260,.2)))},O=t=>{if(!q||t.pointerId!==q.id)return;const{item:e,dx:n}=q,o=e.node,i=performance.now()-q.t>90?0:q.v;q=null,delete o.dataset.swiping;const a=Math.abs(n)>64||Math.abs(i)>.45&&Math.abs(n)>8;o.style.removeProperty("opacity"),a?(B(e.id,n||i),o.style.setProperty("transform",`translateX(${n+48*Math.sign(n||i)}px)`)):o.style.removeProperty("transform")};w.addEventListener("pointerdown",J),w.addEventListener("pointermove",K),w.addEventListener("pointerup",O),w.addEventListener("pointercancel",O);return l(()=>T,g,t=>{w.setAttribute("aria-label",t.label),T?.refresh()},{push:t=>{if(P)return-1;const e=++C,n=k.filter(t=>void 0===t.node.dataset.gone),o=n.length+1-Math.max(1,g.current.max);o>0&&n.slice(0,o).forEach(t=>B(t.id));const i=g.current.render?g.current.render(t,e):function(t,e){const n=(t,e,n)=>{const o=document.createElement(t);return o.className=e,n&&(o.dataset.paint=n),o},o=n("li","ascii-toast");if(void 0!==t.icon){const e=n("span","ascii-toast-icon","tile");e.setAttribute("aria-hidden","true"),"string"==typeof t.icon?e.textContent=t.icon:e.appendChild(t.icon),o.appendChild(e)}const i=n("span","ascii-toast-text"),a=n("b","ascii-toast-title","strong");if(a.textContent=t.title,i.appendChild(a),t.body){const e=n("span","ascii-toast-body","meta");e.textContent=t.body,i.appendChild(e)}if(o.appendChild(i),t.action){const{label:i,onClick:a}=t.action,r=n("button","ascii-toast-action","text");r.type="button",r.textContent=i,r.addEventListener("click",()=>{a(),e()}),o.appendChild(r)}const r=n("button","ascii-toast-close","none");return r.type="button",r.setAttribute("aria-label",`Dismiss ${t.title}`),r.textContent="×",r.addEventListener("click",e),o.appendChild(r),o}(t,()=>B(e));i.dataset.toast=String(e);const a={id:e,node:i,timer:0,left:t.duration??g.current.duration,since:0,born:performance.now()};return k.push(a),w.appendChild(i),I(),y.textContent=t.body?`${t.title}. ${t.body}`:t.title,F()?(i.dataset.forming="",(t=>{const e=m(g.current.ink??"--ascii-ink-strong",p,h(p)?"#d8d6cf":"#1d1d1b");e&&b(getComputedStyle(t).backgroundColor,e)&&(S.add(t),t.style.setProperty("transition","none","important"),t.style.setProperty("background-color","transparent","important"),t.style.setProperty("box-shadow","none","important"))})(i),W(i,!0)):T?.kick(),X(a),e},dismiss:t=>B(t),clear(){[...k].forEach(t=>B(t.id))},get toasts(){return k.filter(t=>void 0===t.node.dataset.gone).map(t=>t.id)}},()=>{P=!0;for(const t of k)t.timer&&clearTimeout(t.timer);z.forEach(clearTimeout),w.removeEventListener("pointerenter",N),w.removeEventListener("pointerleave",D),w.removeEventListener("focusin",G),w.removeEventListener("focusout",H),w.removeEventListener("pointerdown",J),w.removeEventListener("pointermove",K),w.removeEventListener("pointerup",O),w.removeEventListener("pointercancel",O),k=[],E=[],w.remove(),y.remove(),v.restore()})}var w=u;export{w as TOAST_DEFAULTS,b as hidesInk,v as toastStack};//# sourceMappingURL=chunk-OZFSNW5N.js.map
|
|
1
|
+
import{injectStyle as t,drawBlocks as e,snapshot as n,blocksOf as o}from"./chunk-DKRZSP5K.js";import{clamp as i,styleKeeper as a,srOnly as r,mountSurface as s,house as c,hash as d,handle as l,hexRgb as p,resolveColor as m,isDark as h}from"./chunk-I377LEZA.js";var u={max:3,duration:6e3,label:"Notifications",swipe:!0},f="cubic-bezier(.16, 1, .3, 1)",x=`\n:where(.ascii-toasts){position:relative;margin:0;padding:0;list-style:none;min-height:52px}\n:where(.ascii-toast){position:absolute;left:0;right:0;bottom:0;box-sizing:border-box;display:flex;align-items:center;gap:10px;min-height:52px;padding:8px 8px 8px 10px;border-radius:14px;background:var(--ascii-toast-bg,Canvas);color:var(--ascii-toast-ink,CanvasText);box-shadow:var(--ascii-toast-shadow,0 1px 2px rgb(0 0 0 / .06),0 10px 28px -10px rgb(0 0 0 / .22));z-index:calc(10 - var(--d,0));transform-origin:50% 0;translate:0 calc(var(--d,0) * -12px);scale:calc(1 - var(--d,0) * .05);touch-action:pan-y;transition:translate 380ms ${f},scale 380ms ${f},opacity 220ms ${f},transform 300ms ${f},filter 380ms ${f}}\n:where(.ascii-toast)::after{content:"";position:absolute;left:0;right:0;top:100%;height:10px}\n:where(.ascii-toast) > *{transition:opacity 200ms ${f}}\n:where(.ascii-toast[data-back]) > *{opacity:0}\n:where(.ascii-toasts:not([data-open])) :where(.ascii-toast[data-back]){filter:brightness(calc(1 - var(--d,0) * .04))}\n:where(.ascii-toasts:not([data-open])) :where(.ascii-toast[data-back]) > *{pointer-events:none}\n:where(.ascii-toasts[data-open]) :where(.ascii-toast){translate:0 calc(var(--d,0) * (-100% - 8px));scale:1}\n:where(.ascii-toasts[data-open]) :where(.ascii-toast[data-back]) > *{opacity:1}\n:where(.ascii-toast[data-forming]){animation:ascii-toast-in 420ms ${f} both}\n:where(.ascii-toast[data-forming],.ascii-toast[data-gone]) > *{opacity:0;transition:none}\n:where(.ascii-toast[data-gone]){opacity:0;scale:.97;pointer-events:none}\n:where(.ascii-toast[data-swiping]){transition:translate 380ms ${f},scale 380ms ${f},opacity 220ms ${f}}\n@keyframes ascii-toast-in{from{opacity:0;translate:0 14px}}\n:where(.ascii-toast-icon){display:grid;place-items:center;flex:none;width:32px;height:32px;border-radius:9px;background:rgb(128 128 128 / .14)}\n:where(.ascii-toast-text){display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}\n:where(.ascii-toast-title){overflow:hidden;font-size:14px;font-weight:600;text-overflow:ellipsis;white-space:nowrap}\n:where(.ascii-toast-body){overflow:hidden;font-size:13px;opacity:.68;text-overflow:ellipsis;white-space:nowrap}\n:where(.ascii-toast-action,.ascii-toast-close){flex:none;border:0;background:rgb(128 128 128 / .14);color:inherit;font:inherit;cursor:pointer}\n:where(.ascii-toast-action){height:32px;padding:0 12px;border-radius:999px;font-size:14px;font-weight:500}\n:where(.ascii-toast-close){display:grid;place-items:center;width:28px;height:28px;border-radius:999px;background:transparent;font-size:18px;line-height:1;opacity:.6}\n@media (prefers-reduced-motion:reduce){:where(.ascii-toast){transition:none}:where(.ascii-toast[data-forming]){animation:none}}\n`,g=t=>{const[e,n,o]=p(t).map(t=>{const e=t/255;return e<=.04045?e/12.92:((e+.055)/1.055)**2.4});return.2126*e+.7152*n+.0722*o};function b(t,e){const n=/^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)(?:[\s,/]+([\d.]+%?))?/i.exec(t.trim());if(!n)return!1;if(!((void 0===n[4]?1:n[4].endsWith("%")?parseFloat(n[4])/100:parseFloat(n[4]))>=.5))return!1;const o=`#${[n[1],n[2],n[3]].map(t=>Math.round(i(+t,0,255)).toString(16).padStart(2,"0")).join("")}`,[a,r]=[g(o),g(e)].sort((t,e)=>e-t);return(a+.05)/(r+.05)<3}function v(p,f={}){const g={current:{...u,...f}},v=a(),w=document.createElement("ol"),y=r("",!1);y.setAttribute("role","status");let k=[],E=[],C=0,L=!1,$=!1,M=!1,P=!1,S=null;const T=[];t("ascii-kit-toast",x),w.className="ascii-toasts",w.setAttribute("aria-label",g.current.label),p.append(w,y);const z=new WeakSet,A=t=>{delete t.dataset.forming,z.delete(t)&&(t.style.removeProperty("transition"),t.style.removeProperty("background-color"),t.style.removeProperty("box-shadow"))};S=s({host:p,look:()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:5,cellAspect:.62,glyphScale:.92,...g.current.look}),outset:24,resolution:2,ink:()=>g.current.ink??"--ascii-ink-strong",kit:g,reducedMotion:()=>g.current.reducedMotion,onFail:()=>{S=null,E=[];for(const t of k)A(t.node)},paint:({pen:t,now:n,scale:o,still:a,box:r})=>(t.setTransform(o,0,0,o,0,0),E=E.filter(o=>{const a=(n-o.start)/o.ms;if(o.form&&a>=.62&&A(o.node),a>=1)return!1;if(o.form)e(t,o.snap,o.blocks,o.order,1.04*c(a),(t,e)=>[70*(t.seed-.5)*e,(14+26*d(t.x,t.y))*e],1-i((a-.62)/.28));else{const n=o.dir;e(t,o.snap,o.blocks,o.order,1-1.04*(1-(1-a)**3),(t,e)=>[n*(14+34*t.seed+.5*Math.abs(o.throw))*e,14*(d(t.y,t.x)-.35)*e],1-i((a-.75)/.25))}return!0}),E.length>0)}),S&&(S.canvas.style.zIndex="11");const I=()=>!!S&&S.live&&!S.still(),W=()=>{const t=k.filter(t=>void 0===t.node.dataset.gone);t.forEach((e,n)=>{const o=t.length-1-n;v.set(e.node,"--d",String(o)),0===o?(e.node.dataset.front="",delete e.node.dataset.back):(e.node.dataset.back="",delete e.node.dataset.front)})},F=(t,e,i=0)=>{if(!S)return;const a=S.canvas.clientWidth||p.clientWidth+48,r=S.canvas.clientHeight||p.clientHeight+48,s=n(t,a,r,S.box),c=o(s.rects),d=Math.max(1,...c.map(t=>t.x)),l=i<0?-1:1,m=l>0?t=>t.x/d:t=>1-t.x/d,h=Float32Array.from(c,t=>e?t.x/d*.3+.7*t.seed:.62*m(t)+.38*t.seed);E.push({start:performance.now(),ms:e?340:440,snap:s.canvas,blocks:c,order:h,form:e,node:t,dir:l,throw:i}),S.kick()},X=t=>{t.timer&&clearTimeout(t.timer),t.timer=0,L||t.left<=0||(t.since=performance.now(),t.timer=setTimeout(()=>Z(t.id),t.left))},j=()=>(t=>{if(t!==L){L=t,t?w.dataset.open="":delete w.dataset.open;for(const e of k)t&&e.timer&&(clearTimeout(e.timer),e.timer=0,e.left=Math.max(400,e.left-(performance.now()-e.since))),t||X(e)}})($||M),N=()=>{$=!0,j()},D=()=>{$=!1,j()},H=()=>{M=!0,j()},K=t=>{w.contains(t.relatedTarget)||(M=!1,j())};function Z(t,e=0){const n=k.find(e=>e.id===t);if(!n||void 0!==n.node.dataset.gone)return;n.timer&&clearTimeout(n.timer);const o=()=>{k=k.filter(t=>t!==n),E=E.filter(t=>t.node!==n.node),n.node.remove(),W(),S?.kick(),k.some(t=>void 0===t.node.dataset.gone)||($=M=!1,j())},i=k[k.length-1]===n;I()&&(i||L||e)?(A(n.node),F(n.node,!1,e),n.node.dataset.gone="",W(),T.push(setTimeout(o,220))):o()}w.addEventListener("pointerenter",N),w.addEventListener("pointerleave",D),w.addEventListener("focusin",H),w.addEventListener("focusout",K);let G=null;const R=t=>{if(!g.current.swipe||0!==t.button||G)return;const e=t.target;if(e?.closest?.('button, a, input, textarea, select, [role="button"]'))return;const n=e?.closest?.("[data-toast]"),o=n&&k.find(t=>t.node===n);o&&void 0===n.dataset.gone&&void 0===n.dataset.forming&&(G={item:o,id:t.pointerId,x0:t.clientX,dx:0,t:performance.now(),v:0},n.dataset.swiping="",n.setPointerCapture?.(t.pointerId))},q=t=>{if(!G||t.pointerId!==G.id)return;const e=performance.now(),n=t.clientX-G.x0;G.v=(n-G.dx)/Math.max(1,e-G.t),G.dx=n,G.t=e,G.item.node.style.setProperty("transform",`translateX(${n}px)`),G.item.node.style.setProperty("opacity",String(i(1-Math.abs(n)/260,.2)))},B=t=>{if(!G||t.pointerId!==G.id)return;const{item:e,dx:n}=G,o=e.node,i=performance.now()-G.t>90?0:G.v;G=null,delete o.dataset.swiping;const a=Math.abs(n)>64||Math.abs(i)>.45&&Math.abs(n)>8;o.style.removeProperty("opacity"),a?(Z(e.id,n||i),o.style.setProperty("transform",`translateX(${n+48*Math.sign(n||i)}px)`)):o.style.removeProperty("transform")};w.addEventListener("pointerdown",R),w.addEventListener("pointermove",q),w.addEventListener("pointerup",B),w.addEventListener("pointercancel",B);return l(()=>S,g,t=>{w.setAttribute("aria-label",t.label),S?.refresh()},{push:t=>{if(P)return-1;const e=++C,n=k.filter(t=>void 0===t.node.dataset.gone),o=n.length+1-Math.max(1,g.current.max);o>0&&n.slice(0,o).forEach(t=>Z(t.id));const i=g.current.render?g.current.render(t,e):function(t,e){const n=(t,e,n)=>{const o=document.createElement(t);return o.className=e,n&&(o.dataset.paint=n),o},o=n("li","ascii-toast");if(void 0!==t.icon){const e=n("span","ascii-toast-icon","tile");e.setAttribute("aria-hidden","true"),"string"==typeof t.icon?e.textContent=t.icon:e.appendChild(t.icon),o.appendChild(e)}const i=n("span","ascii-toast-text"),a=n("b","ascii-toast-title","strong");if(a.textContent=t.title,i.appendChild(a),t.body){const e=n("span","ascii-toast-body","meta");e.textContent=t.body,i.appendChild(e)}if(o.appendChild(i),t.action){const{label:i,onClick:a}=t.action,r=n("button","ascii-toast-action","text");r.type="button",r.textContent=i,r.addEventListener("click",()=>{a(),e()}),o.appendChild(r)}const r=n("button","ascii-toast-close","none");return r.type="button",r.setAttribute("aria-label",`Dismiss ${t.title}`),r.textContent="×",r.addEventListener("click",e),o.appendChild(r),o}(t,()=>Z(e));i.dataset.toast=String(e);const a={id:e,node:i,timer:0,left:t.duration??g.current.duration,since:0,born:performance.now()};return k.push(a),w.appendChild(i),W(),y.textContent=t.body?`${t.title}. ${t.body}`:t.title,I()?(i.dataset.forming="",(t=>{const e=m(g.current.ink??"--ascii-ink-strong",p,h(p)?"#d8d6cf":"#1d1d1b");e&&b(getComputedStyle(t).backgroundColor,e)&&(z.add(t),t.style.setProperty("transition","none","important"),t.style.setProperty("background-color","transparent","important"),t.style.setProperty("box-shadow","none","important"))})(i),F(i,!0)):S?.kick(),X(a),e},dismiss:t=>Z(t),clear(){[...k].forEach(t=>Z(t.id))},get toasts(){return k.filter(t=>void 0===t.node.dataset.gone).map(t=>t.id)}},()=>{P=!0;for(const t of k)t.timer&&clearTimeout(t.timer);T.forEach(clearTimeout),w.removeEventListener("pointerenter",N),w.removeEventListener("pointerleave",D),w.removeEventListener("focusin",H),w.removeEventListener("focusout",K),w.removeEventListener("pointerdown",R),w.removeEventListener("pointermove",q),w.removeEventListener("pointerup",B),w.removeEventListener("pointercancel",B),k=[],E=[],w.remove(),y.remove(),v.restore()})}var w=u;export{w as TOAST_DEFAULTS,b as hidesInk,v as toastStack};//# sourceMappingURL=chunk-WPWCFCEZ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{styleKeeper as t,mountSurface as e,easeOut as o,handle as n}from"./chunk-
|
|
1
|
+
import{styleKeeper as t,mountSurface as e,easeOut as o,handle as n}from"./chunk-I377LEZA.js";var a={blocks:"[data-block]",shimmer:1400,resolve:420,stagger:60,develop:640},r=t=>`rgb(${255*t} ${255*t} ${255*t})`,l=(t,e,n)=>t<0?0:o((t-e)/n,3),i=t=>parseFloat(t)||0;function s(t,e,o=1){const n=getComputedStyle(t),a=t.getBoundingClientRect(),r=n.borderTopLeftRadius,l=r.endsWith("%")?i(r)/100*Math.min(a.width,a.height):i(r);if("text"!==e)return{radius:l/o,lines:[]};const s=i(n.fontSize)||14,c="normal"===n.lineHeight?1.2*s:i(n.lineHeight),u=Math.min(c,.62*s),h=new Map,m="undefined"!=typeof document&&"function"==typeof document.createRange?document.createRange():null;m?.selectNodeContents(t);for(const t of m?[...m.getClientRects()]:[]){if(!t.width)continue;const e=Math.round((t.top+t.bottom)/2/Math.max(1,c/2)),o=h.get(e);h.set(e,o?{left:Math.min(o.left,t.left),right:Math.max(o.right,t.right),top:Math.min(o.top,t.top),bottom:Math.max(o.bottom,t.bottom)}:{left:t.left,right:t.right,top:t.top,bottom:t.bottom})}const d=[...h.values()].map(t=>{const e=Math.max(t.left,a.left),n=Math.min(t.right,a.right),r=(t.top+t.bottom)/2;return{x:(e-a.left)/o,y:(r-u/2-a.top)/o,w:Math.max(0,n-e)/o,h:u/o}}).filter(t=>t.w>0);return d.length||d.push({x:0,y:(a.height-u)/2/o,w:a.width/o,h:u/o}),{radius:(l||u/2)/o,lines:d}}function c(t){const e=t.dataset.block;return"text"===e||"photo"===e||"avatar"===e?e:"IMG"===t.tagName||"PICTURE"===t.tagName||"VIDEO"===t.tagName?/^50%|^9999px/.test(getComputedStyle(t).borderTopLeftRadius)?"avatar":"photo":"text"}function u(i,u={}){const h={current:{...a,...u}},m=t();let d=0,f=null,g=null,p=null,b=null;const M=()=>[...i.querySelectorAll(h.current.blocks)].map((t,e)=>({el:t,kind:c(t),delay:void 0!==t.dataset.delay?Number(t.dataset.delay):80+e*h.current.stagger})),y=["mask-image","-webkit-mask-image"],k=()=>{m.restore(),i.removeAttribute("aria-busy"),g?.(),g=null};b=e({host:i,look:()=>({mark:"glyph",charset:" .:-=+*#%@",cellSize:5,cellAspect:.62,glyphScale:.92,font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,contrast:1.15,shade:.35,...h.current.look}),ink:()=>h.current.ink??"--ascii-ink-strong",kit:h,reducedMotion:()=>h.current.reducedMotion,onFail:()=>{b=null,k()},paint:({pen:t,now:e,still:n,box:a,w:i})=>{if(null!==f&&n)return k(),!1;const c=h.current,u=null===f?-1:e-f;if(null!==f&&u>Math.max(h.current.develop,...M().map(t=>t.delay+h.current.resolve))+16)return k(),!1;null!==f&&(t=>{for(const{el:e,kind:o,delay:n}of M()){const a=l(t,n,h.current.resolve);if(m.set(e,"opacity",String("text"===o?Math.min(1,1.6*a):a)),"text"===o){const t=128*a-14;for(const o of y)m.set(e,o,a>=1?"none":`linear-gradient(90deg, #000 ${t-14}%, transparent ${t+14}%)`)}}})(u);const g=Math.max(140,.42*i),p=i+g,b=-g+(n?.4:(e-d)/c.shimmer%1)*p,x=n?1:o((e-d)/280,3),v=t.createLinearGradient(b-p,0,b+p,.08*p);for(let t=0;t<=32;t++){const e=Math.abs(t/16-1)*p,o=Math.min(e,Math.abs(p-e)),n=o<g?.5+.5*Math.cos(o/g*Math.PI):0;v.addColorStop(t/32,r(.24+(.54-.24)*n))}const w=(e,o,n,a,r)=>{t.beginPath(),t.roundRect(e,o,Math.max(0,n),a,Math.min(r,a/2,Math.max(0,n)/2))};for(const{el:e,kind:n,delay:r}of M()){const{x:i,y:h,w:m,h:d}=a(e),f=e.getBoundingClientRect().width,g=s(e,n,f&&m?f/m:1),p=l(u,r,c.resolve);if(t.fillStyle=v,"photo"===n){const n=u<0?0:o(u/c.develop,4);t.globalAlpha=(1-p)*x,w(i,h,m,d,g.radius),t.fill();const a=e instanceof HTMLImageElement?e:e.querySelector("img");if(n>0&&a?.complete&&a.naturalWidth){const e=Math.max(m/a.naturalWidth,d/a.naturalHeight),o=a.naturalWidth*e,r=a.naturalHeight*e;t.save(),w(i,h,m,d,g.radius),t.clip(),t.globalAlpha=n*(1-p),t.drawImage(a,i+(m-o)/2,h+(d-r)/2,o,r),t.restore()}}else if("avatar"===n)t.globalAlpha=(1-p)*x,t.beginPath(),t.arc(i+m/2,h+d/2,Math.min(m,d)/2,0,2*Math.PI),t.fill();else{t.globalAlpha=x*(1-p);for(const e of g.lines){const o=i+e.x,n=o+e.w*p;w(n,h+e.y,o+e.w-n,e.h,g.radius),t.fill()}}t.globalAlpha=1}return!0}});const x=()=>{const t=null!==f;if(d=performance.now(),f=null,i.setAttribute("aria-busy","true"),b){if(t&&!b.still())for(const{el:t}of M())t.animate?.([{opacity:1},{opacity:0}],{duration:240,easing:"cubic-bezier(.16, 1, .3, 1)"});(()=>{for(const{el:t}of M()){m.set(t,"opacity","0");for(const e of y)t.style.removeProperty(e)}})(),b.kick()}};return x(),n(()=>b,h,()=>b?.refresh(),{resolve:()=>b?(null!==f&&p||(f=performance.now(),p=new Promise(t=>{g=t}),b.kick()),p):(i.removeAttribute("aria-busy"),Promise.resolve()),reset(){g?.(),g=null,p=null,x()},get loading(){return null===f}},()=>{k()})}var h=a;export{h as SKELETON_DEFAULTS,c as blockKind,s as blockShape,u as skeleton};//# sourceMappingURL=chunk-WRBLIULG.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{clamp as t,hash as e,mountSurface as r,handle as a,smoothstep as n}from"./chunk-
|
|
1
|
+
import{clamp as t,hash as e,mountSurface as r,handle as a,smoothstep as n}from"./chunk-I377LEZA.js";var o={colorful:["#22c55e","#06b6d4","#6366f1","#d946ef","#f43f5e","#f59e0b"],mono:["#ffffff"],ocean:["#22d3ee","#3b82f6","#2dd4bf","#818cf8"],sunset:["#f97316","#f43f5e","#ec4899","#fbbf24"]},s={palette:"colorful",mode:"rotate",grain:"dots",speed:1,hover:!0,depth:18},i=["rotate","pulse","progress"],l=t=>{const e=/^#[\da-f]{3}$/i.test(t)?`#${[...t.slice(1)].map(t=>t+t).join("")}`:t;return[1,3,5].map(t=>(parseInt(e.slice(t,t+2),16)||0)/255)},h=(t,e,r)=>t.map((t,a)=>t+(e[a]-t)*r),c=l("#ff4a4a"),u=l("#2fd67b");function p(t){const e=("string"==typeof t?o[t]??o.colorful:t.length?t:o.colorful).map(l),r=new Float32Array(1024);for(let t=0;t<256;t++){const a=t/256*e.length,n=Math.floor(a),o=a-n,s=1===e.length?e[0]:h(e[n%e.length],e[(n+1)%e.length],o*o*(3-2*o)),i=Math.max(...s,.01);r.set([s[0]/i,s[1]/i,s[2]/i,(.2126*s[0]+.7152*s[1]+.0722*s[2])/i],4*t)}return r}var m=(t,e)=>{const r=(-t%1+1)%1,a=1-r;return Math.max(r<e?(1-r/e)**2.2:0,a<.03?(1-a/.03)**2:0)},f=t=>Math.max(m(t,.3),.75*m(t-.5,.22)),M=(t,e)=>t<=e?.42+.4*(t/Math.max(e,.001))**1.6+.38*Math.exp(-(((e-t)/.03)**2)):t-e<.014?1.2*(1-(t-e)/.014)**2:0,d=(e,r)=>t((e-.68*r)/.07);function g(t,r,a,n,o,s,i){const l=Math.ceil(t/a),h=t/2,c=r/2,u=Math.min(h,c),[p,m,f,M]=[0,1,2,3].map(t=>Math.max(0,Math.min(s[t]??s[0]??0,u))),d=new Int32Array(l*Math.ceil(r/n)).fill(-1),g=[],x=[],v=[];for(let t=0;t<d.length;t++){const r=(t%l+.5)*a-h,s=(Math.floor(t/l)+.5)*n-c,u=r<0?s<0?p:M:s<0?m:f,k=Math.abs(r)-h+u,b=Math.abs(s)-c+u,y=-(Math.hypot(Math.max(k,0),Math.max(b,0))+Math.min(Math.max(k,b),0)-u),L=y>0?Math.min(Math.max(0,1-y/Math.max(1,o))**1.7,y/Math.max(.1,i)):0;if(L<.004)continue;d[t]=g.length,g.push(L);const A=Math.atan2(s/Math.max(1,c),r/Math.max(1,h))/(2*Math.PI)+.25,I=A-Math.floor(A);x.push(I),v.push(.78*e(Math.floor(46*I),5)+.22*e(t,9))}const k=Math.max(1,Math.round(t)),b=Math.max(1,Math.round(r)),y=[],L=[];for(let t=0;t<b;t++)for(let e=0;e<k;e++){const r=d[Math.min(l-1,Math.floor((e+.5)/a))+l*Math.floor((t+.5)/n)];r>=0&&(y.push(t*k+e),L.push(r))}return{W:k,H:b,weight:Float32Array.from(g),turn:Float32Array.from(x),crack:Float32Array.from(v),pixel:Int32Array.from(y),owner:Int32Array.from(L)}}function x(o,l={}){const h={current:{...s,...l}};let m="idle",x=0,v=p(h.current.palette),k=!1;const b=()=>"mono"===h.current.palette,y=()=>({..."glyphs"===h.current.grain?{mark:"glyph",charset:" ·.:-+*",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:5,cellAspect:.6,glyphScale:1}:{mark:"dot",cellSize:3.5,cellAspect:1,dotScale:.82},color:b()?"ink":"source",saturation:1.25,shade:.55,contrast:2.4,brightness:.58,...h.current.look}),L=t=>{const e=!t.dark();t.canvas.style.opacity=e?"0.72":"",t.canvas.style.filter=e&&!b()?"brightness(1.45) saturate(.9)":""};let A=null,I=null,w=new Uint8Array(0),E="",$=0,F=null,P=0,R=.62,S=0,T=0,W=0,j=0,z=0,H=0;const B={rotate:0,pulse:0,progress:0};B[h.current.mode]=1;let D=null;D=r({host:o,look:y,ink:t=>h.current.ink??(t?"#b3b1aa":"#8a8882"),kit:h,reducedMotion:()=>h.current.reducedMotion,onTheme:()=>D&&L(D),onFail:()=>{D=null},resolution:(t,e)=>[Math.max(1,Math.round(t)),Math.max(1,Math.round(e))],paint:r=>{const{pen:a,w:s,h:l,now:p,still:b,dark:L}=r,U=h.current,C=getComputedStyle(o),G=Math.min(o.clientWidth||s,o.clientHeight||l),N=Math.max(2,Math.min(U.depth,Math.min(parseFloat(C.paddingTop)||U.depth,parseFloat(C.paddingLeft)||U.depth)-2)),Z=[C.borderTopLeftRadius,C.borderTopRightRadius,C.borderBottomRightRadius,C.borderBottomLeftRadius].map(t=>((t,e)=>t.endsWith("%")?parseFloat(t)/100*e:parseFloat(t)||0)(t??"",G)),q=y(),J="dot"!==q.mark,K=q.cellSize??(J?5:3.5),O=q.cellAspect??(J?.6:1),Q=`${s}x${l}:${U.grain}:${N}:${Z.join(",")}:${K}:${O}`;if(Q!==E){E=Q,D.canvas.style.clipPath=`inset(0 round ${Z.map(t=>`${t}px`).join(" ")})`;const t=Math.min(globalThis.devicePixelRatio||1,q.maxPixelRatio??2),e=Math.max(2,Math.round(K*t)),r=Math.max(2,Math.round(e*O))/t,n=e/t;A=g(s,l,r,n,N,Z,J?Math.min(r,n)/2:(q.dotScale??.82)*r/2),I=a.createImageData(A.W,A.H),w=new Uint8Array(3*A.weight.length)}const V=A,X=I.data,Y=V.crack,_=(e,r,n,o,s)=>{w.fill(0);for(let a=0;a<V.weight.length;a++){const i=V.turn[a],l=t(V.weight[a]*e(i,a))*(L?1.12:.8);if(l<.03)continue;const h=4*(255&Math.floor(((i-r)%1+1)%1*256));let p=v[h],m=v[h+1],f=v[h+2],M=v[h+3];const d=s&&L?s(i):0;(o>0||n>0||d>0)&&(o>0&&(p+=(u[0]-p)*o,m+=(u[1]-m)*o,f+=(u[2]-f)*o),n>0&&(p+=(c[0]-p)*n,m+=(c[1]-m)*n,f+=(c[2]-f)*n),d>0&&(p+=(1-p)*d,m+=(1-m)*d,f+=(1-f)*d),M=.2126*p+.7152*m+.0722*f);const g=255*Math.min(1,(l+.12)/2.4/Math.max(M,.01));w[3*a]=p*g,w[3*a+1]=m*g,w[3*a+2]=f*g}X.fill(0);for(let t=0;t<V.pixel.length;t++){const e=4*V.pixel[t],r=3*V.owner[t];X[e]=w[r],X[e+1]=w[r+1],X[e+2]=w[r+2],X[e+3]=255}a.putImageData(I,0,0)};if(b){const t="progress"===U.mode?t=>"running"===m||"error"===m?M(t,x):.14:t=>("running"===m?.75:.55)*(.7+.3*Math.cos(2*Math.PI*(t-.12)));return"success"===m?_(()=>.62,0,0,.9):"error"===m?_((e,r)=>.5*t(e)*d(Y[r],1),0,.9,0):_(t,0,0,0),!1}const tt=$?Math.min(48,p-$):16;$=p,m!==F&&("running"===m&&"running"!==F&&(z=0),P=p,F=m);let et=p-P;"success"===m&&et>2700&&(m=F="idle",x=0,P=p,et=0);const rt="running"===m,at="error"===m,nt="success"===m,ot=U.hover&&k;for(const t of i)B[t]+=((t===U.mode?1:0)-B[t])*(1-Math.exp(-tt/260));if(at)T=0;else{const t=(rt?1500-500*x:"pulse"===U.mode?9e3:2600)/Math.max(.05,U.speed);T+=(1/t*(ot?1.35:1)-T)*(1-Math.exp(-tt/320)),R+=T*tt,H+=tt,S+=tt/("pulse"===U.mode?14e3:26e3)*(1-B.progress),(rt||nt)&&(z+=((nt?1:x)-z)*(1-Math.exp(-tt/110)))}W+=((ot?1:0)-W)*(1-Math.exp(-tt/220)),j=at?.9*n(0,60,et):j*Math.exp(-tt/180);const st=1+.22*W,it=.32+.68*(.5-.5*Math.cos(2*Math.PI*H/2400)),lt=.05+.1*(.5-.5*Math.cos(2*Math.PI*H/5200)),ht=rt||nt||at,ct=t=>st*(B.rotate*f(t-R)+B.pulse*(rt||at?f(t-R):it*(.78+.22*Math.cos(2*Math.PI*(t-R))))+B.progress*(ht?M(t,z):lt));if(nt){const e=n(0,260,et),r=t((et-240)/620),a=1-n(860,1060,et),o=n(780,1e3,et),s=n(1350,2450,et),i=(L?.86:.55)*e*(1-o)+.62*o*(1-s),l=1-e*(1-n(1900,2700,et)*(1-B.progress)),h=t=>{if(et<240)return 0;const e=r-t;return a*(e>=0?e<.2?(1-e/.2)**2:0:e>-.02?(1+e/.02)**2:0)};return _(t=>Math.max(ct(t)*l,i*(.9+.1*Math.cos(2*Math.PI*(t-.1))),1.3*h(t),B.progress*lt*s),S,0,.9*o*(1-s),e=>t(.8*h(e))),!0}if(at){const t=et<90?1.2:et<170?.1:et<260?1.2:et<340?.1:1,r=n(380,1150,et),a=1-.5*n(700,1500,et),o=Math.floor(et/50);return _((n,s)=>{const i=d(Y[s],r);return i<=0?0:ct(n)*t*i*a*(1-1.4*r*(1-r)*e(s,o))},S,j,0),et<1600||Math.abs(W-(ot?1:0))>.01}return _(ct,S,j,0),!0}});const U=()=>{k||(k=!0,D?.kick())},C=()=>{k=!1,D?.kick()},G=t=>{k=t.target?.matches?.(":focus-visible")??!1,D?.kick()};D&&(L(D),o.addEventListener("pointerenter",U),o.addEventListener("pointermove",U),o.addEventListener("pointerleave",C),o.addEventListener("focusin",G),o.addEventListener("focusout",C));const N=t=>{m=t,D?.kick()};return a(()=>D,h,t=>{v=p(t.palette),D?.refresh(),D&&L(D)},{progress(e){x=t(Number.isFinite(e)?e:0),N("running")},success(){N("success")},error(){N("error")},reset(){x=0,N("idle")}},()=>{o.removeEventListener("pointerenter",U),o.removeEventListener("pointermove",U),o.removeEventListener("pointerleave",C),o.removeEventListener("focusin",G),o.removeEventListener("focusout",C)})}var v=s;export{v as BEAM_DEFAULTS,o as BEAM_PALETTES,x as beam,f as beamArcs,g as beamBand,d as beamCracked,p as beamPalette,M as beamRing};//# sourceMappingURL=chunk-WSWIOD2C.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{mergeOptions as e,prefersReduced as t}from"./chunk-
|
|
1
|
+
import{mergeOptions as e,prefersReduced as t}from"./chunk-I377LEZA.js";import{disposeKit as r,setPosterSource as o}from"./chunk-FEAFQY7O.js";var s={standard:{label:"Classic ASCII",chars:" .:-=+*#%@"},asciify:{label:"Asciify",chars:" .:-=+YCIFSA#@"},minimal:{label:"Minimal",chars:" .:+"},detailed:{label:"Detailed",chars:" .,:;-~=+*xX#%@"},letters:{label:"Letters",chars:" .liLTYCFSAWM"},technical:{label:"Technical",chars:" ._:;+/>=][{}*$#@"},blocks:{label:"Tonal blocks",chars:" ░▒▓█"},braille:{label:"Braille",chars:" ⠁⠃⠇⡇⣇⣧⣷⣿"}},n=(e,t,r,o)=>"number"==typeof e&&Number.isFinite(e)?Math.min(o,Math.max(r,e)):t;function i(e){if(!e)return;if("dots"===e)return" ·∙•●";const t=s[e];return t&&Object.prototype.hasOwnProperty.call(s,e)?t.chars:e.startsWith(" ")?e:" "+e}function c(s,c){if(!c||!c.preset||"function"!=typeof c.preset.mount)throw new TypeError("background() needs a preset, such as `aurora` imported from asciify-engine/kit.");const l=c.preset;let a=c.poster;const u=e=>({...e,poster:e.preset===l?a:void 0}),p={current:u({...c})};let y=null,d=!1,f=!1;const m=new Set,h=()=>{const e=p.current,t=e.preset;return{speed:n(e.speed,t.speed,0,5),cellSize:n(e.cellSize,t.cellSize,3,96),charset:i(e.charset),cursor:"none"!==e.look?.hover&&(e.cursor??t.cursor),mark:"glyph"===e.mark||"dot"===e.mark?e.mark:void 0,clear:e.clear??!1,dither:n(e.dither,0,0,1),accent:e.accent,text:e.text?.trim()||"ASCIIFY",look:e.look}},b=e=>{const t=p.current,r=t.palette;return("string"==typeof r?r:r?.[e?"dark":"light"])??t.color??t.ink},k=()=>String(n(p.current.opacity,p.current.preset.opacity??1,0,1)),g=()=>!!(p.current.reducedMotion??t()),v=e=>{let t=null;if(t=p.current.preset.mount({host:s,kit:p,settings:h,ink:b,reducedMotion:()=>p.current.reducedMotion,onFail:()=>{y===t&&(y=null)}}),!t)return null;const r=t.canvas.style;return e&&(r.opacity="0",r.transition="opacity 320ms cubic-bezier(.16, 1, .3, 1)",t.canvas.offsetWidth),r.opacity=k(),d&&t.pause(),t},S={position:s.style.getPropertyValue("position"),isolation:s.style.getPropertyValue("isolation")},P=(e,t)=>{t?s.style.setProperty(e,t):s.style.removeProperty(e)};let A=!1;const C=e=>{A=!0,e.destroy(),y&&!f&&("function"==typeof getComputedStyle&&"static"===getComputedStyle(s).position&&s.style.setProperty("position","relative"),s.style.setProperty("isolation","isolate"))},F=e=>{if(f||!e||"function"!=typeof e.mount||e===p.current.preset)return;p.current=u({...p.current,preset:e});const t=y;y=v(!!t&&!g()),t&&(e=>{if(g())return void C(e);e.canvas.style.transition="opacity 320ms cubic-bezier(.16, 1, .3, 1)",e.canvas.style.opacity="0";const t={run:e,timer:setTimeout(()=>{m.delete(t),C(e)},340)};m.add(t)})(t)};y=v(!1);return{get supported(){return!!y&&!f},get field(){return f?null:y?.field??null},get preset(){return p.current.preset},update(t){if(f||!t)return;const{preset:r,...s}=t;"poster"in s&&(a=s.poster),p.current=u(e(p.current,s)),s.poster&&p.current.poster&&o(p,s.poster),r&&r!==p.current.preset?F(r):y&&(y.canvas.style.opacity=k(),y.refresh())},play(){!f&&d&&(d=!1,y?.play())},pause(){f||(d=!0,y?.pause())},setPreset:F,destroy(){if(!f){f=!0;for(const e of m)clearTimeout(e.timer),e.run.destroy(),A=!0;m.clear(),y?.destroy(),y=null,A&&(P("position",S.position),P("isolation",S.isolation)),r(p)}}}}export{c as background,i as backgroundCharset};//# sourceMappingURL=chunk-X6GAMLEH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{parseColor as o,hash2 as t}from"./chunk-ZCHGV2CV.js";import{mountCanvas as l}from"./chunk-AAV5QNHU.js";import{mixHex as e}from"./chunk-I377LEZA.js";function r(l,e,r,a,i={}){const{fontSize:n=13,baseChars:f="ATCG",bridgeChars:h="-=≡",color:c="#00e5ff",color2:s="#ff4081",bridgeColor:b="#88ffcc",speed:g=1,helixCount:M,lightMode:p=!1}=i,d=.62*n,m=1.4*n,u=Math.ceil(e/d),$=Math.ceil(r/m),x=M??Math.max(1,Math.floor(e/80)),A=u/x,C=o(c)??{r:0,g:229,b:255},S=o(s)??{r:255,g:64,b:129},k=o(b)??{r:136,g:255,b:204};l.clearRect(0,0,e,r),l.font=`${n}px "JetBrains Mono", monospace`,l.textBaseline="top";const z=a*g,I=.35*A;for(let o=0;o<x;o++){const e=A*(o+.5);for(let r=0;r<$;r++){const a=r/$*Math.PI*6-1.8*z,i=e+Math.sin(a)*I,n=e+Math.sin(a+Math.PI)*I,c=Math.round(i),s=Math.round(n);if(c<0||c>=u)continue;const b=t(31*o+7*r,3),g=f[Math.floor(b*f.length)],M=.5*(Math.sin(a)+1),p=.5*(Math.sin(a+Math.PI)+1);if(l.globalAlpha=.35+.65*M,l.fillStyle=`rgb(${C.r},${C.g},${C.b})`,l.fillText(g,c*d,r*m),s>=0&&s<u){const e=t(53*o+11*r,7),a=f[Math.floor(e*f.length)];l.globalAlpha=.35+.65*p,l.fillStyle=`rgb(${S.r},${S.g},${S.b})`,l.fillText(a,s*d,r*m)}if(r%3===0){const e=Math.min(c,s),a=Math.max(c,s);if(a-e>1){const i=t(17*r+43*o,5),n=h[Math.floor(i*h.length)],f=.25*(M+p)+.2;l.globalAlpha=f,l.fillStyle=`rgb(${k.r},${k.g},${k.b})`;for(let o=e+1;o<a;o++)l.fillText(n,o*d,r*m)}}}}l.globalAlpha=1}var a={id:"dna",name:"DNA",description:"Double helices scroll past with base-pair letters.",cellSize:13,speed:1,cursor:!1,mount:o=>l(o,(o,t,l,a,i,n)=>r(o,t,l,a,{fontSize:n.fontSize,color:n.ink,color2:n.accent??e(n.ink,"#ffffff",.55),bridgeColor:e(n.ink,"#0c0d0b",.35)}))};export{a as dna,r as renderDnaBackground};//# sourceMappingURL=chunk-X7AUCVMH.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{renderMaterial as i}from"./chunk-XPXMCXYI.js";import{mountCanvas as t}from"./chunk-
|
|
1
|
+
import{renderMaterial as i}from"./chunk-XPXMCXYI.js";import{mountCanvas as t}from"./chunk-AAV5QNHU.js";var o=(i,t,o,r)=>{const e=.12+.06*Math.sin(.1*r),n=Math.sin(68*i),h=Math.sin(68*(i*Math.cos(e)+t*Math.sin(e)));return.8*Math.pow((n+h+2)/4,3)},r={id:"moire",name:"Moiré",description:"Two fine line fields overlap into broad, shifting bands.",cellSize:12,speed:1,cursor:!1,mount:r=>t(r,(t,r,e,n,h,s)=>i(o,t,r,e,n,{ditherStrength:s.ditherStrength,fontSize:s.fontSize,chars:s.chars,lightMode:s.lightMode,color:s.ink}))};export{r as moire};//# sourceMappingURL=chunk-XDX6WLED.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{blank as t,mountPageField as e,pageHandle as o,sleep as n,pulseAt as r}from"./chunk-
|
|
1
|
+
import{blank as t,mountPageField as e,pageHandle as o,sleep as n,pulseAt as r}from"./chunk-RGV7VRYC.js";var i={saving:null,font:'"Geist", Arial, sans-serif'};function a(t,e){const o=t.getBoundingClientRect(),n=o.height?t.offsetHeight/o.height:1,r=e?.getBoundingClientRect().top??o.top+o.height;let i=e;for(;i&&i.parentElement!==t;)i=i.parentElement;let a=o.top;for(const e of Array.from(t.children)){if(e===i)break;if(void 0!==e.dataset?.asciiKit)continue;const t=e.getBoundingClientRect();t.height&&(a=Math.max(a,t.top+t.height))}return{middle:((a+r)/2-o.top)*n,height:(r-a)*n}}function l(e,o,n,r=i.font){const l=Math.max(2,Math.round(2*e.offsetWidth)),s=Math.max(2,Math.round(2*e.offsetHeight)),{canvas:c,pen:f}=t(l,s),d=f.createRadialGradient(l,0,0,l,0,.52*Math.hypot(l,s));d.addColorStop(0,"rgb(150 150 150)"),d.addColorStop(.4,"rgb(64 64 64)"),d.addColorStop(1,"rgb(0 0 0)"),f.fillStyle=d,f.fillRect(0,0,l,s);const h=o?a(e,n):null;if(o&&h&&h.height>=30){const t=Math.min(2*h.height*.9,.34*l),e=l-.07*l,n=2*h.middle+.04*t;f.font=`600 ${t}px ${r}`,f.letterSpacing=.04*-t+"px",f.textAlign="right",f.textBaseline="middle",f.lineJoin="round",f.lineWidth=.28*t,f.strokeStyle="rgb(0 0 0 / .85)",f.strokeText(o,e,n),f.fillStyle="#fff",f.fillText(o,e,n)}return c}function s(a,s={}){const c={current:{...i,...s}},f=(t=c.current.saving)=>l(a,t,(()=>{const t=c.current.price;return"string"==typeof t?a.querySelector(t):t??a.querySelector("[data-price]")})(),c.current.font);let d=null,h=0,u=0,g=0,p=null;p=e({host:a,look:()=>({mark:"dot",scene:"drift",scale:"number"==typeof innerWidth&&innerWidth<760?1.7:1,cellSize:4,cellAspect:1,dotScale:.92,color:"ink",shade:0,fit:"cover",focus:{x:.5,y:.5},levels:"none",contrast:1.1,brightness:-.04,drift:.5,hover:"lantern",lantern:{radius:.26,strength:.4,trail:.7,follow:8},trail:{strength:.9,radius:.4},fluid:{radius:.09,refraction:.03,glow:.6},...c.current.look}),ink:t=>c.current.ink??(t?"#aeaca5":"#5c5a55"),source:d=f(),kit:c,reducedMotion:()=>c.current.reducedMotion,onFail:()=>{p=null,m?.disconnect()}}),u=a.offsetWidth,g=a.offsetHeight;const m=p&&"function"==typeof ResizeObserver?new ResizeObserver(()=>{!p||Math.abs(a.offsetWidth-u)<2&&Math.abs(a.offsetHeight-g)<2||(u=a.offsetWidth,g=a.offsetHeight,h++,p.field.setSource(d=f()))}):null;m?.observe(a);const S=async e=>{const o=p?.field,r=d;if(d=e,!o)return;const i=++h;if(!r||p.still())return void await o.setSource(e);const a=t(e.width,e.height),l=a.pen,s=e.width,c=e.height,f=.34*s;for(let t=1;t<=9&&i===h;t++){const i=performance.now(),d=t/9*(s+2*f)-f,h=Math.max(0,Math.min(s,d));l.globalCompositeOperation="source-over",l.drawImage(r,0,0,s,c),h>0&&l.drawImage(e,0,0,h,c,0,0,h,c);const u=l.createLinearGradient(d-f,0,d+.4*f,0);u.addColorStop(0,"rgb(0 0 0 / 0)"),u.addColorStop(.72,"rgb(255 255 255 / .5)"),u.addColorStop(1,"rgb(0 0 0 / 0)"),l.globalCompositeOperation="lighter",l.fillStyle=u,l.fillRect(0,0,s,c),await o.setSource(a.canvas),await n(Math.max(0,48-(performance.now()-i)))}i===h&&p?.field===o&&await o.setSource(e)};return o(()=>p,c,()=>{S(f())},{sweep:()=>S(f()),saving:t=>(c.current={...c.current,saving:t},S(f(t))),pulse:(t,e=1.6)=>{p&&!p.still()&&r(p.field,t,e)}},()=>{h++,m?.disconnect()})}export{l as planArt,s as pricingGlow,a as savingRoom};//# sourceMappingURL=chunk-XVA7UGUQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{parseColor as t,hash2 as e}from"./chunk-ZCHGV2CV.js";import{mountCanvas as o}from"./chunk-AAV5QNHU.js";function n(o,n,c,r,s={x:.5,y:.5},l={}){const{fontSize:a=14,chars:i=" . · * + ° ★",accentColor:h,color:f,speed:d=1,count:g=180,lightMode:m=!1}=l,p=h??(m?"#6b8700":"#d4ff00");o.clearRect(0,0,n,c),o.textBaseline="middle",o.textAlign="center";const M=n*(.2+.6*s.x),x=c*(.2+.6*s.y),$=.65*Math.sqrt(n*n+c*c);let u=255,S=255,b=255;if(m&&(u=55,S=55,b=55),f){const e=t(f);e&&(u=e.r,S=e.g,b=e.b)}let A=212,k=255,z=0;const C=t(p);C&&(A=C.r,k=C.g,z=C.b);const y=i.replace(/ /g,"").split("");if(0!==y.length){for(let t=0;t<g;t++){const s=e(17*t,3)*Math.PI*2,l=(r*(.15+.85*e(31*t,7))*d*.22+e(13*t,11))%1,i=M+Math.cos(s)*l*$,h=x+Math.sin(s)*l*$;if(i<-20||i>n+20||h<-20||h>c+20)continue;const f=Math.max(6,a*(.4+.9*l));o.font=`${f}px monospace`;const g=y[Math.min(y.length-1,Math.floor(l*y.length))],p=l>.72,C=m?.85*l:.2*l;o.fillStyle=p?`rgba(${A},${k},${z},${Math.min(m?.92:.32,2.2*C)})`:`rgba(${u},${S},${b},${C})`,o.fillText(g,i,h)}o.textAlign="left"}}var c={id:"stars",name:"Stars",description:"A sparse starfield that twinkles, drifts and leans toward the cursor.",cellSize:14,speed:1,cursor:!0,mount:t=>o(t,(t,e,o,c,r,s)=>n(t,e,o,c,r,{fontSize:s.fontSize,chars:s.chars,lightMode:s.lightMode,color:s.ink,accentColor:s.accent}))};export{n as renderStarsBackground,c as stars};//# sourceMappingURL=chunk-XXHIFJ5Z.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{MONO as t,GRAPHITE_LIGHT as o,GRAPHITE_DARK as e,pixelSnap as n,parseColor as r,hash2 as c,band as h,ditherIndex as i,toneAlpha as l}from"./chunk-ZCHGV2CV.js";import{mountCanvas as a}from"./chunk-
|
|
1
|
+
import{MONO as t,GRAPHITE_LIGHT as o,GRAPHITE_DARK as e,pixelSnap as n,parseColor as r,hash2 as c,band as h,ditherIndex as i,toneAlpha as l}from"./chunk-ZCHGV2CV.js";import{mountCanvas as a}from"./chunk-AAV5QNHU.js";function s(a,s,f,M,g={}){const{fontSize:d=13,color:u,accentColor:S,speed:$=.4,layers:I=4,turbulence:P=.8,lightMode:b=!1}=g,p=.62*d,m=1.3*d,k=Math.ceil(s/p),x=Math.ceil(f/m);a.clearRect(0,0,s,f),a.font=`${d}px ${t}`,a.textBaseline="top";const z=b?o:e;let C=z.r,w=z.g,y=z.b;const A=n(a);if(u){const t=r(u);t&&(C=t.r,w=t.g,y=t.b)}let V=C,j=w,v=y;const H=S?r(S):null;H&&(V=H.r,j=H.g,v=H.b);const B=M*$,G=g.chars?Array.from(g.chars):void 0,L=["-","\\","|","/"];for(let t=0;t<x;t++){const o=t/x;for(let e=0;e<k;e++){const n=e/k;let r=0,s=0;for(let t=0;t<I;t++){const e=c(13*t,7*t+3),h=1.1+2.4*e,i=.9+2*c(29*t,11*t+1),l=e*Math.PI*6,a=(.2+.5*c(41*t,17*t))*(t%2==0?1:-1.3),f=Math.sin(n*h*Math.PI*2+B*a+l),M=Math.cos(o*i*Math.PI*2+B*a*.6+1.7*l),g=Math.sin(n*i*Math.PI*P+o*h*Math.PI*P+B*a*.4);r+=Math.atan2(M+.3*g,f),s+=.5*(f*M+1)}const f=r/I,M=h(s/I,.54,.74);if(M<=0)continue;const d=(f%Math.PI+Math.PI)%Math.PI,u=Math.round(d/(Math.PI/4))%L.length;if(!G&&g.ditherStrength&&0===i(M,2,e,t,g.ditherStrength))continue;const S=G?G[i(M,G.length,e,t,g.ditherStrength)]:L[u];if(" "===S)continue;const $=!!H&&M>.85,b=l(M);a.fillStyle=$?`rgba(${V},${j},${v},${b})`:`rgba(${C},${w},${y},${b})`,a.fillText(S,A(e*p),A(t*m))}}}var f={id:"silk",name:"Silk",description:"Long ribbons that follow a slow flow field.",cellSize:13,speed:1,cursor:!1,mount:t=>a(t,(t,o,e,n,r,c)=>s(t,o,e,n,{ditherStrength:c.ditherStrength,fontSize:c.fontSize,chars:c.chars,lightMode:c.lightMode,color:c.ink,accentColor:c.accent}))};export{s as renderSilkBackground,f as silk};//# sourceMappingURL=chunk-XZO4VH2Z.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{scenePreset as e}from"./chunk-
|
|
1
|
+
import{scenePreset as e}from"./chunk-LTRVMY3D.js";var r=e({id:"halo",name:"Halo",description:"A corona breathes slowly round the middle, its rays turning; the centre stays empty for a headline.",cellSize:11,scene:"halo",charset:" .·:-=+*",hover:"lantern",middle:!1,feather:.12});export{r as halo};//# sourceMappingURL=chunk-Y2SDQ6EC.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{renderMaterial as t}from"./chunk-XPXMCXYI.js";import{mountCanvas as r}from"./chunk-
|
|
1
|
+
import{renderMaterial as t}from"./chunk-XPXMCXYI.js";import{mountCanvas as r}from"./chunk-AAV5QNHU.js";var e=(t,r,e,o)=>{const i=48*t+4*Math.sin(2.6*r+.08*o)+1.5*Math.sin(7*r-2*t);return Math.pow(.5+.5*Math.sin(i),10)*(.35+.55*Math.pow(Math.sin(2*r+.4),2))},o={id:"etch",name:"Etch",description:"Cut-grain lines follow a slow, sculpted current.",cellSize:12,speed:1,cursor:!1,mount:o=>r(o,(r,o,i,n,h,s)=>t(e,r,o,i,n,{ditherStrength:s.ditherStrength,fontSize:s.fontSize,chars:s.chars,lightMode:s.lightMode,color:s.ink}))};export{o as etch};//# sourceMappingURL=chunk-ZGCKUXYP.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";import{mixHex as l}from"./chunk-I377LEZA.js";var r=1,i=2,n=4,f=8,c={3:"─",12:"│",9:"┌",10:"┐",5:"└",6:"┘",11:"┬",7:"┴",13:"├",14:"┤",15:"┼",[r]:"╶",[i]:"╴",[n]:"╵",[f]:"╷"};function a(e,l,r,i,n={}){const{fontSize:f=13,pulseColor:a="#ffffff",color:s="#00ff88",density:h=.38,speed:g=1,lightMode:p=!1}=n,u=.62*f,b=1.4*f,m=Math.ceil(l/u),d=Math.ceil(r/b),M=t(s)??{r:0,g:255,b:136},$=t(a)??{r:255,g:255,b:255},A=(t,e)=>{if(o(17*t+1,7*e+2)>h)return 0;let l=0;return t+1<m&&o(17*t+1,7*e+2)>.15&&(l|=1),t-1>=0&&o(17*(t-1)+1,7*e+2)>.15&&(l|=2),e+1<d&&o(17*t+1,7*(e+1)+2)>.15&&(l|=8),e-1>=0&&o(17*t+1,7*(e-1)+2)>.15&&(l|=4),l};e.clearRect(0,0,l,r),e.font=`${f}px "JetBrains Mono", monospace`,e.textBaseline="top";const C=i*g;for(let t=0;t<d;t++)for(let l=0;l<m;l++){const r=A(l,t);if(0===r)continue;const i=c[r]??"·",n=(8*C+40*o(l,23*t))%m,f=(6*C+40*o(17*t,11*l))%d,a=(1&r||2&r)&&Math.abs(l-n)<1.5,s=(4&r||8&r)&&Math.abs(t-f)<1.5,h=a||s,g=.25+.35*o(3*l,5*t);h?(e.globalAlpha=.95,e.fillStyle=`rgb(${$.r},${$.g},${$.b})`):(e.globalAlpha=g,e.fillStyle=`rgb(${M.r},${M.g},${M.b})`),e.fillText(i,l*u,t*b)}e.globalAlpha=1}var s={id:"circuit",name:"Circuit",description:"Circuit traces with signals running along them.",cellSize:13,speed:1,cursor:!1,mount:t=>e(t,(t,o,e,r,i,n)=>a(t,o,e,r,{fontSize:n.fontSize,chars:n.chars,lightMode:n.lightMode,color:n.ink,pulseColor:n.accent??l(n.ink,"#ffffff",.7)}))};export{s as circuit,a as renderCircuitBackground};//# sourceMappingURL=chunk-ZNZAO7JA.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{mountPageField as e,pageHandle as t,sleep as r,pulseAt as o}from"./chunk-
|
|
1
|
+
import{mountPageField as e,pageHandle as t,sleep as r,pulseAt as o}from"./chunk-RGV7VRYC.js";import{styleKeeper as a}from"./chunk-I377LEZA.js";function n(n,l={}){const i={current:{...l}},c=a(),s=n.querySelector("img"),u=i.current.image??s??null;let d=null;d=u?e({host:n,look:()=>{const e=i.current;return{mark:"glyph",scene:"none",charset:" .:-=+*#%@",font:'"Geist", Arial, sans-serif',fontWeight:500,cellSize:6,cellAspect:.8,glyphScale:.8,color:"ink",shade:0,contrast:1.3,levels:"auto",fit:"cover",focus:e.focus??{x:.5,y:.4},hover:"trail",trail:{strength:.95,radius:.42},clear:!!e.clear&&{element:e.clear,padding:8,feather:.12,shape:"rect"},...e.look}},ink:()=>i.current.ink??"--ascii-ink-strong",source:u,label:i.current.label??(u instanceof HTMLImageElement&&u.alt||void 0),kit:i,reducedMotion:()=>i.current.reducedMotion,onFail:()=>{d=null,c.restore()}}):null,d&&s&&u===s&&c.set(s,"opacity","0");let h=0,m=!1;return t(()=>d,i,()=>{},{pulse:(e,t=1)=>{d&&!d.still()&&o(d.field,e,t)},shimmer:e=>{const t=d?.field;if(!t||e===m||e&&d.still())return;const o=++h;m=e,e?(async()=>{let e;try{e=await(async()=>{if(u instanceof HTMLImageElement)return u.complete||await u.decode(),u;const e=new Image;return e.crossOrigin="anonymous",e.src=u,await e.decode(),e})()}catch{return}const a=Math.min(1,1400/Math.max(e.naturalWidth,e.naturalHeight,1)),n=Object.assign(document.createElement("canvas"),{width:Math.max(1,Math.round(e.naturalWidth*a)),height:Math.max(1,Math.round(e.naturalHeight*a))}),l=n.getContext("2d"),i=n.width,c=n.height,s=performance.now();for(;o===h&&d?.field===t;){const o=performance.now(),a=-.4*i+1.8*((o-s)/1100%1)*i;l.globalCompositeOperation="source-over",l.drawImage(e,0,0,i,c);const u=l.createLinearGradient(a-.22*i,.3*a,a+.22*i,.3*a+.3*c);u.addColorStop(0,"rgb(0 0 0 / 0)"),u.addColorStop(.5,"rgb(255 255 255 / .42)"),u.addColorStop(1,"rgb(0 0 0 / 0)"),l.globalCompositeOperation="lighter",l.fillStyle=u,l.fillRect(0,0,i,c),await t.setSource(n),await r(Math.max(0,48-(performance.now()-o)))}})():t.setSource(u)}},()=>{h++,c.restore()})}export{n as artPanel};//# sourceMappingURL=chunk-ZTCSVEHT.js.map
|