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.
Files changed (110) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/THIRD_PARTY.md +3 -0
  3. package/dist/field.cjs +1 -1
  4. package/dist/field.d.cts +1 -1
  5. package/dist/field.d.ts +1 -1
  6. package/dist/field.js +1 -1
  7. package/dist/{glyph-field-DRC-7uVf.d.ts → glyph-field-BCwGhohg.d.ts} +11 -0
  8. package/dist/{glyph-field-C2fQIlnq.d.cts → glyph-field-DKWHAMml.d.cts} +11 -0
  9. package/dist/hover.cjs +1 -1
  10. package/dist/hover.js +1 -1
  11. package/dist/kit/{chunk-4NV5APSJ.js → chunk-2NACMWVV.js} +1 -1
  12. package/dist/kit/{chunk-F6F2C3RH.js → chunk-2UOPVMN3.js} +1 -1
  13. package/dist/kit/{chunk-DMRPBFLW.js → chunk-3H3DJI3M.js} +1 -1
  14. package/dist/kit/{chunk-7M2FFUZ3.js → chunk-4G5LJNMB.js} +1 -1
  15. package/dist/kit/{chunk-G4ZSMTFN.js → chunk-4NR7QENR.js} +1 -1
  16. package/dist/kit/{chunk-GKR3ROYR.js → chunk-5Q634WWI.js} +1 -1
  17. package/dist/kit/{chunk-KY5KCIZE.js → chunk-64NSPD2R.js} +1 -1
  18. package/dist/kit/{chunk-2FH6GGV6.js → chunk-6G2ZVIBS.js} +1 -1
  19. package/dist/kit/{chunk-3MHEDZLZ.js → chunk-6NDTKY3V.js} +1 -1
  20. package/dist/kit/{chunk-GBNV3GXG.js → chunk-7QH33RJJ.js} +1 -1
  21. package/dist/kit/{chunk-BFBG3VHI.js → chunk-7TXDNPL3.js} +1 -1
  22. package/dist/kit/{chunk-3OD5BMF5.js → chunk-AAV5QNHU.js} +1 -1
  23. package/dist/kit/chunk-AU33Y2SZ.js +1 -0
  24. package/dist/kit/{chunk-KCEYRIU4.js → chunk-BGPEFFKK.js} +1 -1
  25. package/dist/kit/{chunk-KDROJANO.js → chunk-BJJUDT26.js} +1 -1
  26. package/dist/kit/{chunk-2LBQ7QJT.js → chunk-BO4CPM26.js} +1 -1
  27. package/dist/kit/chunk-BQ53B2HP.js +1 -0
  28. package/dist/kit/chunk-BV6AOHFU.js +1 -0
  29. package/dist/kit/{chunk-QVICL57J.js → chunk-CH64MY3U.js} +1 -1
  30. package/dist/kit/{chunk-LVCGC3SO.js → chunk-CMGMCRAD.js} +1 -1
  31. package/dist/kit/{chunk-4U72YE65.js → chunk-CZL5WMU6.js} +1 -1
  32. package/dist/kit/{chunk-PB5E3D4E.js → chunk-DKRZSP5K.js} +1 -1
  33. package/dist/kit/{chunk-KFXMLIVF.js → chunk-E427W6P5.js} +1 -1
  34. package/dist/kit/{chunk-RXOPJJC4.js → chunk-EH4S6T7U.js} +1 -1
  35. package/dist/kit/chunk-F4IO3HWD.js +1 -0
  36. package/dist/kit/{chunk-K6JX64AS.js → chunk-FU4WW3PU.js} +1 -1
  37. package/dist/kit/{chunk-TRDA73HN.js → chunk-G3FVDS2A.js} +1 -1
  38. package/dist/kit/{chunk-FHN3PPSI.js → chunk-G7GQSPMC.js} +1 -1
  39. package/dist/kit/chunk-GI5BNKBL.js +1 -0
  40. package/dist/kit/{chunk-KEE55QSD.js → chunk-GJANKSX6.js} +1 -1
  41. package/dist/kit/{chunk-Z2FRNFMB.js → chunk-HENGH3DE.js} +1 -1
  42. package/dist/kit/chunk-I377LEZA.js +1 -0
  43. package/dist/kit/chunk-IFZDWKIX.js +1 -0
  44. package/dist/kit/{chunk-WDS7VM2E.js → chunk-J7Y2KBXK.js} +1 -1
  45. package/dist/kit/{chunk-KXI3T72F.js → chunk-JF3WEYIE.js} +1 -1
  46. package/dist/kit/{chunk-3VEMKDBW.js → chunk-LTRVMY3D.js} +1 -1
  47. package/dist/kit/{chunk-EKYEA7Z4.js → chunk-M5JJSIWI.js} +1 -1
  48. package/dist/kit/{chunk-ILXVBO7M.js → chunk-MT23DCGU.js} +1 -1
  49. package/dist/kit/{chunk-NF4WVWAC.js → chunk-MWUPCAET.js} +1 -1
  50. package/dist/kit/{chunk-FPCCX4FM.js → chunk-MYAZOXMF.js} +1 -1
  51. package/dist/kit/{chunk-3YSK7V26.js → chunk-N7J4UAWY.js} +1 -1
  52. package/dist/kit/{chunk-YSN7EHSH.js → chunk-NP7UG7DS.js} +1 -1
  53. package/dist/kit/{chunk-ZCXNGJGB.js → chunk-NQ4PFWOG.js} +1 -1
  54. package/dist/kit/chunk-NS6HYTQZ.js +1 -0
  55. package/dist/kit/chunk-NSKX2OFA.js +1 -0
  56. package/dist/kit/{chunk-WI2AF2KE.js → chunk-OOVUQEXT.js} +1 -1
  57. package/dist/kit/{chunk-W4U5CK6L.js → chunk-P5MVACML.js} +1 -1
  58. package/dist/kit/chunk-PZKQUZQK.js +1 -0
  59. package/dist/kit/{chunk-CGSWUO67.js → chunk-R3ALZFUQ.js} +1 -1
  60. package/dist/kit/{chunk-7DXSG526.js → chunk-RGV7VRYC.js} +1 -1
  61. package/dist/kit/chunk-SBAUVRBY.js +1 -0
  62. package/dist/kit/chunk-SQNULNT3.js +1 -0
  63. package/dist/kit/{chunk-HYVTFKWX.js → chunk-TJHSBZBF.js} +1 -1
  64. package/dist/kit/{chunk-FWODCYYJ.js → chunk-UHLNVM63.js} +1 -1
  65. package/dist/kit/{chunk-UOYBFLGJ.js → chunk-UT6MJP5B.js} +1 -1
  66. package/dist/kit/{chunk-QSTDYL35.js → chunk-UWX7VIXT.js} +1 -1
  67. package/dist/kit/{chunk-6WU247CB.js → chunk-UXDJSGED.js} +1 -1
  68. package/dist/kit/{chunk-Z3KD6CLE.js → chunk-UXJRBOSR.js} +1 -1
  69. package/dist/kit/{chunk-KLRF3S7O.js → chunk-V42Q4L2G.js} +1 -1
  70. package/dist/kit/chunk-V6KL3IA7.js +1 -0
  71. package/dist/kit/{chunk-776H2BJ7.js → chunk-VENDLTH4.js} +1 -1
  72. package/dist/kit/{chunk-ZWZZMU5P.js → chunk-VQ4KIRBW.js} +1 -1
  73. package/dist/kit/{chunk-OZFSNW5N.js → chunk-WPWCFCEZ.js} +1 -1
  74. package/dist/kit/{chunk-H5KHXZWR.js → chunk-WRBLIULG.js} +1 -1
  75. package/dist/kit/{chunk-SDSW7422.js → chunk-WSWIOD2C.js} +1 -1
  76. package/dist/kit/{chunk-NW4U2YRE.js → chunk-X6GAMLEH.js} +1 -1
  77. package/dist/kit/chunk-X7AUCVMH.js +1 -0
  78. package/dist/kit/{chunk-B3TY6UXJ.js → chunk-XDX6WLED.js} +1 -1
  79. package/dist/kit/{chunk-42KMN727.js → chunk-XVA7UGUQ.js} +1 -1
  80. package/dist/kit/chunk-XXHIFJ5Z.js +1 -0
  81. package/dist/kit/{chunk-3LJ5C3U3.js → chunk-XZO4VH2Z.js} +1 -1
  82. package/dist/kit/{chunk-6G5MPND3.js → chunk-Y2SDQ6EC.js} +1 -1
  83. package/dist/kit/{chunk-CG6SGQMY.js → chunk-ZGCKUXYP.js} +1 -1
  84. package/dist/kit/{chunk-E3FPFANJ.js → chunk-ZNZAO7JA.js} +1 -1
  85. package/dist/kit/{chunk-XUCYFWC3.js → chunk-ZTCSVEHT.js} +1 -1
  86. package/dist/kit.cjs +1 -1
  87. package/dist/kit.d.cts +182 -7
  88. package/dist/kit.d.ts +182 -7
  89. package/dist/kit.js +1 -1
  90. package/dist/studio-worker.js +1 -1
  91. package/dist/studio.cjs +1 -1
  92. package/dist/studio.js +1 -1
  93. package/package.json +1 -1
  94. package/skills/asciify-engine/SKILL.md +4 -4
  95. package/skills/asciify-engine/references/applying-asciify.md +18 -2
  96. package/skills/asciify-engine/references/components.md +81 -0
  97. package/skills/asciify-engine/references/glyph-field.md +2 -0
  98. package/skills/asciify-engine/references/kit.md +132 -3
  99. package/skills/asciify-engine/references/scenario-prompts.md +10 -1
  100. package/dist/kit/chunk-2GAV4OAK.js +0 -1
  101. package/dist/kit/chunk-2MLFWO4U.js +0 -1
  102. package/dist/kit/chunk-AIGAJMNN.js +0 -1
  103. package/dist/kit/chunk-GF72XM4C.js +0 -1
  104. package/dist/kit/chunk-I5R2347P.js +0 -1
  105. package/dist/kit/chunk-M5VVLYI2.js +0 -1
  106. package/dist/kit/chunk-ORSI57T2.js +0 -1
  107. package/dist/kit/chunk-PGFBIU7R.js +0 -1
  108. package/dist/kit/chunk-UVLKCAKH.js +0 -1
  109. package/dist/kit/chunk-VBWG7HQA.js +0 -1
  110. package/dist/kit/chunk-VV2KP7ZW.js +0 -1
@@ -0,0 +1 @@
1
+ import{hash as t,styleKeeper as e,mountSurface as n,clamp as r,handle as o,entryProgress as a,house as i}from"./chunk-I377LEZA.js";var l={duration:800,trigger:"visible",replayOnHover:!0,settle:"glyphs"},c=["あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわをん","가나다라마바사아자차카타파하연결함께성장미래교류접","ÁÀÂÄÃÅÆÇÉÈÊËÍÌÎÏÑÓÒÔÖØŒÚÙÛÜÝŸßÐÞ","БГДЖЗИЙЛПФЦЧШЩЪЫЬЭЮЯ","ΑΒΓΔΘΛΞΠΣΦΨΩαβγδεζηθλμξπσφψω","0123456789#%&*+=<>/\\[]{}@$"];function s(e,n,r,o,a){if(n<o||!e.trim())return e;const i=[...a[Math.floor(r/4)%a.length]??e];return i[Math.floor(t(3.1*n+r,.7*r+n)*i.length)]??e}function f(e,n,r=.82){const o=e.getContext("2d");if(!o)return;const a=e.width,i=e.height,l=o.createImageData(a,i),c=t=>t*t*(3-2*t),s=(e,n)=>{const r=Math.floor(e),o=Math.floor(n),a=c(e-r),i=c(n-o),l=t(r,o),s=t(r+1,o),f=t(r,o+1);return l+(s-l)*a+(f-l)*i+(l-s-f+t(r+1,o+1))*a*i};for(let t=0;t<i;t++)for(let e=0;e<a;e++){const o=.6*s(e/6+2.4*n,t/3.5-.8*n)+.4*s(e/2.5-3*n,t/2),c=Math.min(1,2.4*(1-Math.hypot(2*(e/a-.5),2*(t/i-.5))*r)),f=.72*Math.max(0,o-.42)*Math.max(0,c)*255,h=4*(t*a+e);l.data[h]=l.data[h+1]=l.data[h+2]=f,l.data[h+3]=255}o.putImageData(l,0,0)}function h(h,u={}){const d={current:{...l,...u}},g=e(),m=document.createElement("canvas"),p=document.createElement("canvas");void 0===u.duration&&u.scramble&&(d.current.duration=1400);let x=-1,v="",w=!1,M=!1,y=null,S=[],b=0;const E=(t,e,n)=>{t.fillStyle="#fff",t.textAlign="center",t.textBaseline="alphabetic",S.forEach((r,o)=>{const a=s(r.char,o,e,n,Array.isArray(d.current.scramble)&&d.current.scramble.length?d.current.scramble:c);a.trim()&&(t.font=r.font,t.fillText(a,r.x+r.w/2,r.y,Math.max(1,1.2*r.w)))})},k=(t,e)=>{const n=`${t}x${e}:${d.current.text??""}:${h.textContent}`;if(n===v)return;v=n,m.width=t,m.height=e;const r=m.getContext("2d");r.fillStyle="#000",r.fillRect(0,0,t,e),S=[];const o=d.current.scramble?S:void 0;void 0!==d.current.text?function(t,e,n,r,o,a){const i=getComputedStyle(e),l=n.split("\n");t.fillStyle="#fff",t.textAlign="center",t.textBaseline="middle";const c=(parseFloat(i.letterSpacing)||0)/(parseFloat(i.fontSize)||16),s=e=>{"letterSpacing"in t&&(t.letterSpacing=c*e+"px")};t.font=`${i.fontWeight} 100px ${i.fontFamily}`,s(0);const f=Math.max(1,...l.map(e=>t.measureText(e).width)),h=Math.min(.94*r/f*100,.9*o/l.length);t.font=`${i.fontWeight} ${h}px ${i.fontFamily}`,s(h),l.forEach((e,n)=>{const i=o/2+(n-(l.length-1)/2)*h*1.04;if(t.fillText(e,r/2,i),!a)return;const s=c*h;let f=r/2-t.measureText(e).width/2;for(const n of e){const e=t.measureText(n).width;a.push({char:n,x:f,y:i+.36*h,w:e,font:t.font}),f+=e+s}})}(r,h,d.current.text,t,e,o):function(t,e,n,r,o){const a=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),i=document.createRange();t.fillStyle="#fff",t.textAlign="left",t.textBaseline="alphabetic";for(let e=a.nextNode();e;e=a.nextNode()){const a=e.parentElement;if(!a)continue;const l=getComputedStyle(a);t.font=`${l.fontStyle} ${l.fontWeight} ${parseFloat(l.fontSize)*r}px ${l.fontFamily}`,"letterSpacing"in t&&(t.letterSpacing=(parseFloat(l.letterSpacing)||0)*r+"px");const c=t.measureText("Hg"),s=c.fontBoundingBoxAscent||parseFloat(l.fontSize)*r*.8,f=c.fontBoundingBoxDescent||parseFloat(l.fontSize)*r*.2,h="uppercase"===l.textTransform?t=>t.toUpperCase():"lowercase"===l.textTransform?t=>t.toLowerCase():t=>t;for(const a of e.data.matchAll(/\S+/g)){i.setStart(e,a.index),i.setEnd(e,a.index+a[0].length);const l=i.getClientRects()[0];if(!l)continue;const c=(l.top-n.top)*r+(l.height*r-s-f)/2+s;if(t.fillText(h(a[0]),(l.left-n.left)*r,c),!o)continue;let u=a.index;for(const l of a[0]){i.setStart(e,u),i.setEnd(e,u+l.length);const a=i.getClientRects()[0];a&&o.push({char:h(l),x:(a.left-n.left)*r,y:c,w:a.width*r,font:t.font}),u+=l.length}}}i.detach?.()}(r,h,h.getBoundingClientRect(),t/(h.getBoundingClientRect().width||1),o)};y=n({host:h,look:()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:4.5,cellAspect:.62,glyphScale:.92,contrast:1.35,hover:"trail",trail:{strength:.6,radius:.2},...d.current.look}),ink:()=>d.current.ink??getComputedStyle(h).color,kit:d,reducedMotion:()=>d.current.reducedMotion,resolution:2,onFail:()=>{y=null,g.restore()},paint:({pen:e,width:n,height:o,now:a,still:l})=>{k(n,o);const c=d.current,s="text"===c.settle;if("scroll"===c.trigger){const t=l?1:b;if(t>=1)return s||e.drawImage(m,0,0),!1;if(t<=0)return!1;if(c.scramble)return E(e,Math.floor(48*t),Math.floor(r((t-.25)/.75)*S.length)),!1;const a=t*n;return e.drawImage(m,0,0,Math.max(1,a),o,0,0,Math.max(1,a),o),!1}if(x<0||l)return!(!M&&"visible"===c.trigger&&!l)&&(s&&x>=0||e.drawImage(m,0,0),x>=0&&I(),!1);const h=a-x,u=.3*c.duration,g=.7*c.duration;if(c.scramble){if(h>=c.duration)return s||e.drawImage(m,0,0),I(),!1;const t=Math.floor(i(r((h-.4*c.duration)/(.6*c.duration)))*S.length);return E(e,Math.floor(h/65),t),!0}const v=Math.max(2,Math.ceil(n/20)),y=Math.max(2,Math.ceil(o/20));if(p.width===v&&p.height===y||(p.width=v,p.height=y),f(p,h/1e3),e.imageSmoothingEnabled=!0,h<u)return e.drawImage(p,0,0,n,o),w&&(e.globalAlpha=1-i(h/u),e.drawImage(m,0,0),e.globalAlpha=1),!0;const $=Math.min(1,(h-u)/g),A=(1.18*$-.02)*n,C=.14*n,L=5.58,T=Math.floor(a/16);if($>=1)return s||e.drawImage(m,0,0),I(),!1;e.drawImage(p,0,0,n,o),A>0&&e.drawImage(m,0,0,A,o,0,0,A,o);for(let n=Math.max(0,Math.floor(A/L)*L);n<A+C;n+=L){const r=(n-A)/C;for(let a=0;a<o;a+=9)t(n+13*T,a)<r||(e.globalAlpha=.35+.65*t(a+7*T,n),e.fillStyle="#000",e.fillRect(n,a,L,9),e.drawImage(m,n,a,L,9,n,a,L,9))}return e.globalAlpha=1,!0}});const I=()=>{x=-1,w="text"!==d.current.settle,w||g.restore()},$=()=>{y&&(g.set(h,"-webkit-text-fill-color","transparent"),M=!0,x=performance.now(),y.kick())},A=()=>{if(!y)return;const t=a(h);Math.abs(t-b)<.002||(b=t,"text"===d.current.settle&&(t>=1?g.restore():g.set(h,"-webkit-text-fill-color","transparent")),y.kick())},C=!!y&&"scroll"===d.current.trigger&&"undefined"!=typeof window;C&&(window.addEventListener("scroll",A,{passive:!0}),b=-1,A());let L=!1;const T=y&&"visible"===d.current.trigger&&"function"==typeof IntersectionObserver?new IntersectionObserver(([t])=>{t.isIntersecting&&!L&&$(),L=t.isIntersecting},{threshold:.5}):null;y&&("text"!==d.current.settle&&g.set(h,"-webkit-text-fill-color","transparent"),w="text"!==d.current.settle&&"manual"===d.current.trigger,T?T.observe(h):"visible"===d.current.trigger&&$());let F=!1;const B=()=>{F||(F=!0,d.current.replayOnHover&&x<0&&"scroll"!==d.current.trigger&&$())},R=()=>{F=!1},W=t=>{!F||t.target instanceof Node&&h.contains(t.target)||(F=!1)};return y&&(h.addEventListener("pointerenter",B),h.addEventListener("pointermove",B),h.addEventListener("pointerleave",R),document.addEventListener("pointermove",W,!0)),y&&document.fonts?.ready.then(()=>{v="",y?.kick()}),o(()=>y,d,()=>{v="",y?.refresh()},{replay:$},()=>{T?.disconnect(),C&&window.removeEventListener("scroll",A),h.removeEventListener("pointerenter",B),h.removeEventListener("pointermove",B),h.removeEventListener("pointerleave",R),document.removeEventListener("pointermove",W,!0),g.restore()})}var u=l;export{u as DECODE_DEFAULTS,c as SCRAMBLE_SCRIPTS,h as decode,f as driftNoise,s as scrambleLetter};//# sourceMappingURL=chunk-IFZDWKIX.js.map
@@ -1 +1 @@
1
- import{styleKeeper as t,mountSurface as e,easeOut as n,srOnly as o,handle as r,isDark as a}from"./chunk-GF72XM4C.js";var i={tone:"neutral",live:!1,indicator:!0,sheen:!0},l={light:{green:[22,150,82],amber:[214,138,8],red:[214,52,52],neutral:[120,120,114],new:[255,255,255]},dark:{green:[120,240,170],amber:[255,206,110],red:[255,156,156],neutral:[200,200,192],new:[255,255,255]}},s={light:[[.03," "],[.08,"·"],[.13,"•"],[.18,"○"],[.5,"●"],[.56,"◐"],[.62,"◓"],[.68,"◑"],[.74,"◒"],[.8,"●"],[.88,"✧"],[2,"✦"]],dark:[[.02," "],[.06,"✦"],[.1,"✧"],[.2,"·"],[.3,"•"],[.38,"○"],[.64,"●"],[.68,"◐"],[.72,"◓"],[.76,"◑"],[.8,"◒"],[2,"●"]]},c=t=>Array.from({length:96},(e,n)=>t.find(([t])=>n/95<t)[1]).join(""),d={light:c(s.light),dark:c(s.dark)},h=["◐","◓","◑","◒"],u=["✧","·","✧","✦","✧","✦"],f=12;var p=(t,e)=>{return"green"===(n=t.dataset.tone)||"amber"===n||"red"===n||"neutral"===n||"new"===n?t.dataset.tone:e;var n};function m(t,e,n){return{x:t.x+2,y:Math.round((t.y+t.h/2)/n-.5)*n,w:Math.max(0,t.w-4)}}function x(t,e){const n=t=>t.toFixed(2),o=e/2,r=t.filter(t=>t.w>2*o).map(({x:t,y:r,w:a})=>`M${n(t+o)} ${n(r)}H${n(t+a-o)}A${n(o)} ${n(o)} 0 0 1 ${n(t+a-o)} ${n(r+e)}H${n(t+o)}A${n(o)} ${n(o)} 0 0 1 ${n(t+o)} ${n(r)}Z`).join("");return r?`path("${r}")`:"inset(50%)"}function M(c,M={}){const g={current:{...i,...M}},y=c instanceof HTMLElement?[c]:[...c],w=1===y.length,v=w?y[0]:y.length?function(t){let e=t[0].parentElement;for(;e&&!t.every(t=>e.contains(t));)e=e.parentElement;return e??document.body}(y):null,b=t(),k=new Map,$=new Map,E=new Map,C=new Map,S=[],A=t=>void 0!==t.dataset.count?"count":"new"===p(t,g.current.tone)?"new":"status",F=t=>void 0!==t.dataset.live?"false"!==t.dataset.live:g.current.live,z=(t=-1e6)=>{for(const e of y){const n=p(e,g.current.tone),o=k.get(e);o?o.to!==n&&k.set(e,{from:o.to,to:n,at:t}):k.set(e,{from:n,to:n,at:-1e6})}};z();const L=()=>P?.dark()??(!v||a(v))?"dark":"light",j=()=>({mark:"glyph",charset:d[L()],font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:f,cellAspect:1,glyphScale:1,color:"source",saturation:1,shade:0,...g.current.look}),H=()=>{const{cellSize:t=f,cellAspect:e=1}=j(),n=Math.min(2,globalThis.devicePixelRatio||1),o=Math.max(2,Math.round(t*n));return{ch:o/n,cw:Math.max(2,Math.round(o*e))/n}};let T=[0,0];const I=new Map;let P=null,q="";function B(){for(;S.length;)S.pop()();b.restore()}P=v?e({host:v,layer:w?"under":"over",look:j,ink:()=>g.current.ink,kit:g,reducedMotion:()=>g.current.reducedMotion,resolution:(t,e)=>{const{cw:n,ch:o}=H();return[Math.max(2,Math.round(2*t/n)),Math.max(2,Math.round(2*e/o))]},onFail:()=>{P=null,B()},onTheme:()=>P?.field.update({charset:d[L()]}),paint:({pen:t,now:e,still:o,dark:r,box:a,width:i,w:c})=>{const d=g.current,f=r?"dark":"light",p={...l[f],...d.tones?.[f]},M=(t,e)=>((t,e,n=.5)=>{const o=s[t],r=o.findIndex(([,t])=>t===e),a=r>0?o[r-1][0]:0;return a+(Math.min(o[r][0],1)-a)*n})(f,t,e),{cw:w,ch:S}=H(),z=i/c,L=(e,n,o,r)=>{r<=0||(t.fillStyle=function(t,e){const n=Math.max(1,...t),o=t.map(t=>t/n*255),r=(.2126*o[0]+.7152*o[1]+.0722*o[2])/255,a=Math.min(1,e/Math.max(r,.01));return`rgb(${o.map(t=>Math.round(Math.max(0,Math.min(255,t*a)))).join(" ")})`}(o,r),t.fillRect(Math.round((e+.5)*w*z)-1,Math.round((n+.5)*S*z)-1,2,2))};let j=!1;const B=y.map(t=>"count"!==A(t)&&d.indicator?t.querySelector("[data-dot]"):null),G=y.map((t,e)=>{const n=a(t),o=B[e]?a(B[e]):null,[r,i]=I.get(t)??[0,0],l=t=>({...t,x:t.x+T[0]-r,y:t.y+T[1]-i});return{b:l(n),dot:o&&l(o)}}),N=G.find((t,e)=>t.dot&&"status"===A(y[e]))??G.find(t=>t.dot)??G[0];if(N){const t=(t,e)=>{const n=((t-e/2)%e+e)%e;return n>.001?n-e:0},e=[N.dot?t(N.dot.x+N.dot.w/2,w):0,t(N.b.y+N.b.h/2,S)];(Math.abs(e[0]-T[0])>.01||Math.abs(e[1]-T[1])>.01)&&(T=e,P.canvas.style.translate=`${T[0].toFixed(2)}px ${T[1].toFixed(2)}px`)}const R=P.canvas.style,W=(t,e,n)=>Math.max(1,Math.floor((t-e)/n))*n+"px",O=W(v.clientWidth,T[0],w),X=W(v.clientHeight,T[1],S);R.width===O&&R.height===X||(R.width=O,R.height=X,P.field.resize(),j=!0);const Z=G.map((t,e)=>{const n=t=>({...t,x:t.x-T[0],y:t.y-T[1]});return((t,e,n,o,r)=>{const[a,i]=I.get(t)??[0,0],l=(t,e)=>Math.round((t-e/2)/e)*e+e/2-t,s=n?l(n.x+n.w/2,o):0,c=l(e.y+e.h/2,r);return(Math.abs(s-a)>.01||Math.abs(c-i)>.01)&&(I.set(t,[s,c]),b.set(t,"translate",`${s.toFixed(2)}px ${c.toFixed(2)}px`)),{b:{...e,x:e.x+s,y:e.y+c},dot:n&&{...n,x:n.x+s,y:n.y+c}}})(y[e],n(t.b),t.dot&&n(t.dot),w,S)}),D=Z.map(t=>t.b).map(t=>m(t,0,S)),J=x(D,S);return J!==q&&(q=J,P.canvas.style.clipPath=J),y.forEach((t,r)=>{const i=D[r],l=A(t),s=Math.round(i.y/S),c=Math.ceil(i.x/w),d=Math.floor((i.x+i.w)/w)-1;var m,x,g;if(!(d<c))if("status"===l){const a=Z[r].dot;if(!a)return;const i=k.get(t),l=e-i.at,u=o?1:n(l/240);u<1&&(j=!0);const y=(m=p[i.from],x=p[i.to],g=u,m.map((t,e)=>t+(x[e]-t)*g)),v=!o&&F(t),b=Math.floor((a.x+a.w/2)/w),$="light"===f?.55:.7,E="light"===f?.35:.25;let C="neutral"===i.to?M("○"):"amber"===i.to&&F(t)?M("◐"):M("●",$);"red"===i.to&&!o&&l<640?(j=!0,Math.floor(l/160)%2==0&&(C=M("○"))):v&&"amber"===i.to?(j=!0,C=M(h[Math.floor((e+90*r)/130)%4])):v&&(j=!0,C=M("●",$-E*Math.cos((e+500*r)/2200*Math.PI*2))),b>=c&&b<=d&&L(b,s,y,C)}else if("new"===l){const n=Z[r].dot;if(!n)return;const a=Math.max(0,(e-($.get(t)??-1e6))/720),i=Math.floor((n.x+n.w/2)/w);a<1&&!o&&(j=!0),i>=c&&i<=d&&L(i,s,p.new,M(a<1&&!o?u[Math.floor(a*u.length)]:"✦"))}else{const r=E.get(t),i=C.get(t)?.digits.children;if(!i)return;if((r?(e-r.at)/600:1)>=1||o){for(const t of i)t.style.opacity="",t.style.translate="";return}j=!0,[...i].forEach((t,o)=>{if(!r.changed[o])return;const i=t,l=a(i),h=(e-r.at-70*o)/460,u=n((h-.72)/.28);if(i.style.opacity=String(u),i.style.translate=`0 ${3*(u-1)}px`,h<=0||h>=.78)return;const f=Math.min(d,Math.max(c,Math.floor((l.x+l.w/2)/w)));L(f,s,p.neutral,M(["·","•","○","●"][Math.floor(9*h)%4]))})}}),j}}):null;const G=t=>[...t].map(t=>Object.assign(document.createElement("span"),{textContent:" "===t?"":t}));if(P){w||(P.canvas.style.zIndex="1");for(const t of y){if("count"===A(t)){const e=(t.textContent??"").trim(),n=[...t.childNodes],r=o(e),a=document.createElement("span");a.setAttribute("aria-hidden","true"),b.set(a,"display","inline-flex"),a.replaceChildren(...G(e)),t.replaceChildren(r,a),C.set(t,{text:e,live:r,digits:a}),S.push(()=>{const o=C.get(t)?.text??e;o===e?t.replaceChildren(...n):t.textContent=o})}else if(g.current.indicator&&!t.querySelector("[data-dot]")){const e=document.createElement("span");e.dataset.dot="",e.setAttribute("aria-hidden","true"),e.setAttribute("style",`display:inline-block;flex:none;width:${f}px;height:${f}px;margin-inline-end:4px;vertical-align:middle`),t.prepend(e),S.push(()=>e.remove())}if(!w)for(const e of[...t.childNodes])if(3===e.nodeType&&e.textContent?.trim()){const t=document.createElement("span");e.parentElement.insertBefore(t,e),t.appendChild(e),S.push(()=>{t.parentElement?.insertBefore(e,t),t.remove()}),N(t)}else e instanceof HTMLElement&&void 0===e.dataset.dot&&N(e)}C.size&&document.fonts?.ready.then(()=>P?.kick()),v.addEventListener("pointermove",O),v.addEventListener("pointerleave",X)}function N(t){"static"===getComputedStyle(t).position&&b.set(t,"position","relative"),b.set(t,"z-index","2")}function R(t){const e=performance.now();for(const n of t?[t]:y.filter(t=>"new"===A(t)))$.set(n,e);P?.kick()}let W=null;function O(t){const e=t.target,n=y.find(t=>e&&t.contains(e))??null;n!==W&&(W=n,n&&"new"===A(n)&&g.current.sheen&&R(n))}function X(){W=null}return r(()=>P,g,()=>{z(performance.now()),P?.refresh()},{sheen:R,count:(t,e)=>{const n=e??y.find(t=>"count"===A(t));if(!n)return;const o=String(t),r=C.get(n);if(!r)return void(n.textContent=o);if(o===r.text)return;const a=Math.max(o.length,r.text.length),i=r.text.padStart(a," "),l=o.padStart(a," "),s=P?.still()??!0;r.text=o,r.live.textContent=o,r.digits.replaceChildren(...G(l)),E.set(n,{at:s?-1e6:performance.now(),changed:[...l].map((t,e)=>t!==i[e])}),P?.kick()},refresh:()=>{z(performance.now()),P?.kick()}},()=>{v?.removeEventListener("pointermove",O),v?.removeEventListener("pointerleave",X),B()})}var g=i;export{g as PILL_DEFAULTS,l as PILL_TONES,x as laneClip,M as pill,m as pillLane,p as pillTone};//# sourceMappingURL=chunk-WDS7VM2E.js.map
1
+ import{styleKeeper as t,mountSurface as e,easeOut as n,srOnly as o,handle as r,isDark as a}from"./chunk-I377LEZA.js";var i={tone:"neutral",live:!1,indicator:!0,sheen:!0},l={light:{green:[22,150,82],amber:[214,138,8],red:[214,52,52],neutral:[120,120,114],new:[255,255,255]},dark:{green:[120,240,170],amber:[255,206,110],red:[255,156,156],neutral:[200,200,192],new:[255,255,255]}},s={light:[[.03," "],[.08,"·"],[.13,"•"],[.18,"○"],[.5,"●"],[.56,"◐"],[.62,"◓"],[.68,"◑"],[.74,"◒"],[.8,"●"],[.88,"✧"],[2,"✦"]],dark:[[.02," "],[.06,"✦"],[.1,"✧"],[.2,"·"],[.3,"•"],[.38,"○"],[.64,"●"],[.68,"◐"],[.72,"◓"],[.76,"◑"],[.8,"◒"],[2,"●"]]},c=t=>Array.from({length:96},(e,n)=>t.find(([t])=>n/95<t)[1]).join(""),d={light:c(s.light),dark:c(s.dark)},h=["◐","◓","◑","◒"],u=["✧","·","✧","✦","✧","✦"],f=12;var p=(t,e)=>{return"green"===(n=t.dataset.tone)||"amber"===n||"red"===n||"neutral"===n||"new"===n?t.dataset.tone:e;var n};function m(t,e,n){return{x:t.x+2,y:Math.round((t.y+t.h/2)/n-.5)*n,w:Math.max(0,t.w-4)}}function x(t,e){const n=t=>t.toFixed(2),o=e/2,r=t.filter(t=>t.w>2*o).map(({x:t,y:r,w:a})=>`M${n(t+o)} ${n(r)}H${n(t+a-o)}A${n(o)} ${n(o)} 0 0 1 ${n(t+a-o)} ${n(r+e)}H${n(t+o)}A${n(o)} ${n(o)} 0 0 1 ${n(t+o)} ${n(r)}Z`).join("");return r?`path("${r}")`:"inset(50%)"}function M(c,M={}){const g={current:{...i,...M}},y=c instanceof HTMLElement?[c]:[...c],w=1===y.length,v=w?y[0]:y.length?function(t){let e=t[0].parentElement;for(;e&&!t.every(t=>e.contains(t));)e=e.parentElement;return e??document.body}(y):null,b=t(),k=new Map,$=new Map,E=new Map,C=new Map,S=[],A=t=>void 0!==t.dataset.count?"count":"new"===p(t,g.current.tone)?"new":"status",L=t=>void 0!==t.dataset.live?"false"!==t.dataset.live:g.current.live,z=(t=-1e6)=>{for(const e of y){const n=p(e,g.current.tone),o=k.get(e);o?o.to!==n&&k.set(e,{from:o.to,to:n,at:t}):k.set(e,{from:n,to:n,at:-1e6})}};z();const F=()=>P?.dark()??(!v||a(v))?"dark":"light",j=()=>({mark:"glyph",charset:d[F()],font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:f,cellAspect:1,glyphScale:1,color:"source",saturation:1,shade:0,...g.current.look}),H=()=>{const{cellSize:t=f,cellAspect:e=1}=j(),n=Math.min(2,globalThis.devicePixelRatio||1),o=Math.max(2,Math.round(t*n));return{ch:o/n,cw:Math.max(2,Math.round(o*e))/n}};let T=[0,0];const I=new Map;let P=null,q="";function B(){for(;S.length;)S.pop()();b.restore()}P=v?e({host:v,layer:w?"under":"over",look:j,ink:()=>g.current.ink,kit:g,reducedMotion:()=>g.current.reducedMotion,resolution:(t,e)=>{const{cw:n,ch:o}=H();return[Math.max(2,Math.round(2*t/n)),Math.max(2,Math.round(2*e/o))]},onFail:()=>{P=null,B()},onTheme:()=>P?.field.update({charset:d[F()]}),paint:({pen:t,now:e,still:o,dark:r,box:a,width:i,w:c})=>{const d=g.current,f=r?"dark":"light",p={...l[f],...d.tones?.[f]},M=(t,e)=>((t,e,n=.5)=>{const o=s[t],r=o.findIndex(([,t])=>t===e),a=r>0?o[r-1][0]:0;return a+(Math.min(o[r][0],1)-a)*n})(f,t,e),{cw:w,ch:S}=H(),z=i/c,F=(e,n,o,r)=>{r<=0||(t.fillStyle=function(t,e){const n=Math.max(1,...t),o=t.map(t=>t/n*255),r=(.2126*o[0]+.7152*o[1]+.0722*o[2])/255,a=Math.min(1,e/Math.max(r,.01));return`rgb(${o.map(t=>Math.round(Math.max(0,Math.min(255,t*a)))).join(" ")})`}(o,r),t.fillRect(Math.round((e+.5)*w*z)-1,Math.round((n+.5)*S*z)-1,2,2))};let j=!1;const B=y.map(t=>"count"!==A(t)&&d.indicator?t.querySelector("[data-dot]"):null),N=y.map((t,e)=>{const n=a(t),o=B[e]?a(B[e]):null,[r,i]=I.get(t)??[0,0],l=t=>({...t,x:t.x+T[0]-r,y:t.y+T[1]-i});return{b:l(n),dot:o&&l(o)}}),R=N.find((t,e)=>t.dot&&"status"===A(y[e]))??N.find(t=>t.dot)??N[0];if(R){const t=(t,e)=>{const n=((t-e/2)%e+e)%e;return n>.001?n-e:0},e=[R.dot?t(R.dot.x+R.dot.w/2,w):0,t(R.b.y+R.b.h/2,S)];(Math.abs(e[0]-T[0])>.01||Math.abs(e[1]-T[1])>.01)&&(T=e,P.canvas.style.translate=`${T[0].toFixed(2)}px ${T[1].toFixed(2)}px`)}const W=P.canvas.style,Z=(t,e,n)=>Math.max(1,Math.floor((t-e)/n))*n+"px",G=Z(v.clientWidth,T[0],w),O=Z(v.clientHeight,T[1],S);W.width===G&&W.height===O||(W.width=G,W.height=O,P.field.resize(),j=!0);const D=N.map((t,e)=>{const n=t=>({...t,x:t.x-T[0],y:t.y-T[1]});return((t,e,n,o,r)=>{const[a,i]=I.get(t)??[0,0],l=(t,e)=>Math.round((t-e/2)/e)*e+e/2-t,s=n?l(n.x+n.w/2,o):0,c=l(e.y+e.h/2,r);return(Math.abs(s-a)>.01||Math.abs(c-i)>.01)&&(I.set(t,[s,c]),b.set(t,"translate",`${s.toFixed(2)}px ${c.toFixed(2)}px`)),{b:{...e,x:e.x+s,y:e.y+c},dot:n&&{...n,x:n.x+s,y:n.y+c}}})(y[e],n(t.b),t.dot&&n(t.dot),w,S)}),J=D.map(t=>t.b).map(t=>m(t,0,S)),K=x(J,S);return K!==q&&(q=K,P.canvas.style.clipPath=K),y.forEach((t,r)=>{const i=J[r],l=A(t),s=Math.round(i.y/S),c=Math.ceil(i.x/w),d=Math.floor((i.x+i.w)/w)-1;var m,x,g;if(!(d<c))if("status"===l){const a=D[r].dot;if(!a)return;const i=k.get(t),l=e-i.at,u=o?1:n(l/240);u<1&&(j=!0);const y=(m=p[i.from],x=p[i.to],g=u,m.map((t,e)=>t+(x[e]-t)*g)),v=!o&&L(t),b=Math.floor((a.x+a.w/2)/w),$="light"===f?.55:.7,E="light"===f?.35:.25;let C="neutral"===i.to?M("○"):"amber"===i.to&&L(t)?M("◐"):M("●",$);"red"===i.to&&!o&&l<640?(j=!0,Math.floor(l/160)%2==0&&(C=M("○"))):v&&"amber"===i.to?(j=!0,C=M(h[Math.floor((e+90*r)/130)%4])):v&&(j=!0,C=M("●",$-E*Math.cos((e+500*r)/2200*Math.PI*2))),b>=c&&b<=d&&F(b,s,y,C)}else if("new"===l){const n=D[r].dot;if(!n)return;const a=Math.max(0,(e-($.get(t)??-1e6))/720),i=Math.floor((n.x+n.w/2)/w);a<1&&!o&&(j=!0),i>=c&&i<=d&&F(i,s,p.new,M(a<1&&!o?u[Math.floor(a*u.length)]:"✦"))}else{const r=E.get(t),i=C.get(t)?.digits.children;if(!i)return;if((r?(e-r.at)/600:1)>=1||o){for(const t of i)t.style.opacity="",t.style.translate="";return}j=!0,[...i].forEach((t,o)=>{if(!r.changed[o])return;const i=t,l=a(i),h=(e-r.at-70*o)/460,u=n((h-.72)/.28);if(i.style.opacity=String(u),i.style.translate=`0 ${3*(u-1)}px`,h<=0||h>=.78)return;const f=Math.min(d,Math.max(c,Math.floor((l.x+l.w/2)/w)));F(f,s,p.neutral,M(["·","•","○","●"][Math.floor(9*h)%4]))})}}),j}}):null;const N=t=>[...t].map(t=>Object.assign(document.createElement("span"),{textContent:" "===t?"":t}));if(P){w||(P.canvas.style.zIndex="1");for(const t of y){if("count"===A(t)){const e=(t.textContent??"").trim(),n=[...t.childNodes],r=o(e),a=document.createElement("span");a.setAttribute("aria-hidden","true"),b.set(a,"display","inline-flex"),a.replaceChildren(...N(e)),t.replaceChildren(r,a),C.set(t,{text:e,live:r,digits:a}),S.push(()=>{const o=C.get(t)?.text??e;o===e?t.replaceChildren(...n):t.textContent=o})}else if(g.current.indicator&&!t.querySelector("[data-dot]")){const e=document.createElement("span");e.dataset.dot="",e.setAttribute("aria-hidden","true"),e.setAttribute("style",`display:inline-block;flex:none;width:${f}px;height:${f}px;margin-inline-end:4px;vertical-align:middle`),t.prepend(e),S.push(()=>e.remove())}if(!w)for(const e of[...t.childNodes])if(3===e.nodeType&&e.textContent?.trim()){const t=document.createElement("span");e.parentElement.insertBefore(t,e),t.appendChild(e),S.push(()=>{t.parentElement?.insertBefore(e,t),t.remove()}),R(t)}else e instanceof HTMLElement&&void 0===e.dataset.dot&&R(e)}C.size&&document.fonts?.ready.then(()=>P?.kick()),v.addEventListener("pointermove",G),v.addEventListener("pointerleave",O)}function R(t){"static"===getComputedStyle(t).position&&b.set(t,"position","relative"),b.set(t,"z-index","2")}function W(t){const e=performance.now();for(const n of t?[t]:y.filter(t=>"new"===A(t)))$.set(n,e);P?.kick()}let Z=null;function G(t){const e=t.target,n=y.find(t=>e&&t.contains(e))??null;n!==Z&&(Z=n,n&&"new"===A(n)&&g.current.sheen&&W(n))}function O(){Z=null}return r(()=>P,g,()=>{z(performance.now()),P?.refresh()},{sheen:W,count:(t,e)=>{const n=e??y.find(t=>"count"===A(t));if(!n)return;const o=String(t),r=C.get(n);if(!r)return void(n.textContent=o);if(o===r.text)return;const a=Math.max(o.length,r.text.length),i=r.text.padStart(a," "),l=o.padStart(a," "),s=P?.still()??!0;r.text=o,r.live.textContent=o,r.digits.replaceChildren(...N(l)),E.set(n,{at:s?-1e6:performance.now(),changed:[...l].map((t,e)=>t!==i[e])}),P?.kick()},refresh:()=>{z(performance.now()),P?.kick()}},()=>{v?.removeEventListener("pointermove",G),v?.removeEventListener("pointerleave",O),B()})}var g=i;export{g as PILL_DEFAULTS,l as PILL_TONES,x as laneClip,M as pill,m as pillLane,p as pillTone};//# sourceMappingURL=chunk-J7Y2KBXK.js.map
@@ -1 +1 @@
1
- import{styleKeeper as t,clamp as e,mountSurface as o,handle as r,house as n}from"./chunk-GF72XM4C.js";var a={aurora:["#2ee6c8","#9d7bff","#ff6fb5"],brand:["#ffb000","#ffd84d"]},i={palette:"aurora",swell:!0},l=t=>"mono"===t?[]:"string"==typeof t?[...a[t]??a.aurora]:[...t];function s(t,o){if(1===t.length)return t[0];const r=e(o)*(t.length-1),n=Math.min(t.length-2,Math.floor(r)),a=r-n,[i,l]=[t[n],t[n+1]].map(t=>[1,3,5].map(e=>parseInt(t.slice(e,e+2),16)||0));return`rgb(${i.map((t,e)=>Math.round(t+(l[e]-t)*a)).join(" ")})`}function c(t,o,r,n,a,i){const l=t=>{const o=Math.round(255*e(t)/2.2);return`rgb(${o} ${o} ${o})`},c=o/2,d=r/2,h=.36/(.92-.16*a)*Math.min(o,r),u=.86+.46*a,f=n*(.25+.6*a),p=t.createRadialGradient(c,d,.92*h,c,d,1.3*h);p.addColorStop(0,l(.36*u)),p.addColorStop(1,"#000"),t.fillStyle=p,t.fillRect(0,0,o,r),t.save(),t.beginPath(),t.arc(c,d,h,0,2*Math.PI),t.clip();const g=c+.8*Math.cos(f)*h*.62,m=d-.55*h*.62,M=t.createRadialGradient(g,m,0,g,m,1.7*h);M.addColorStop(0,l(.95*u)),M.addColorStop(.55,l(.5*u)),M.addColorStop(1,l(.18)),t.fillStyle=M,t.fillRect(c-h,d-h,2*h,2*h),t.globalCompositeOperation="lighter",t.lineWidth=Math.max(1.5,.05*h);for(let e=0;e<6;e++){const o=e/6*Math.PI+.35*n,r=Math.sin(o);r<0||(t.strokeStyle=l(.16*r),t.beginPath(),t.ellipse(c,d,h*Math.abs(Math.cos(o)),h,0,0,2*Math.PI),t.stroke())}const S=t.createRadialGradient(c,d,.7*h,c,d,h);if(S.addColorStop(0,"#000"),S.addColorStop(1,l(.3)),t.fillStyle=S,t.fillRect(c-h,d-h,2*h,2*h),t.restore(),t.globalCompositeOperation="source-over",!i.length)return;t.globalCompositeOperation="color";const k=.4*n,v=.5*a,y=t.createLinearGradient(c-Math.cos(k)*h,d-Math.sin(k)*h,c+Math.cos(k)*h,d+Math.sin(k)*h);y.addColorStop(0,s(i,v)),y.addColorStop(.5,s(i,v+.25)),y.addColorStop(1,s(i,v+.5)),t.fillStyle=y,t.fillRect(0,0,o,r),t.globalCompositeOperation="source-over"}function d(a,s={}){const d={current:{...i,...s}},h=t();let u="idle",f=0,p=e(d.current.level??0),g=p,m=0,M=0,S=l(d.current.palette),k=null,v=null,y=0;const b=t=>{t.canvas.style.filter=!t.dark()&&S.length?"brightness(.68) saturate(1.35)":""},C=t=>{a.style.setProperty("--ascii-level",t.toFixed(3)),d.current.swell&&h.set(a,"scale",String(1+.1*t))};k=o({host:a,outset:Math.round(.08*(a.offsetWidth||0)),look:()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:6,cellAspect:.62,glyphScale:.92,fit:"cover",color:S.length?"source":"ink",contrast:2.2,brightness:1.1-.5,saturation:1.4,...d.current.look}),ink:()=>d.current.ink??"--ascii-ink-strong",kit:d,reducedMotion:()=>d.current.reducedMotion,onTheme:()=>k&&b(k),onFail:()=>{k=null},paint:({pen:t,w:o,h:r,now:a,still:i})=>{const l=M?Math.min(64,a-M):16;M=a;const s=e((t=>"listening"===u?v?v.read():p:"thinking"===u?.2+.1*Math.sin((t-f)/120):"done"===u?m*(1-n(e((t-f)/420))):p)(a));return i||"done"===u?g=s:g+=(s-g)*(1-(1-(s>g?.45:.12))**(l/16.7)),i||C(g),c(t,o,r,i?0:a/1e3,g,S),!0}}),k&&b(k);const w=()=>{y++,v&&(v.stream.getTracks().forEach(t=>t.stop()),v.context.close().catch(()=>{}),v=null)},P=t=>{"listening"!==t&&w(),"done"===t&&(m=g),u=t,f=performance.now(),a.dataset.state=t,k||C("listening"===t?p:0),k?.kick()};return r(()=>k,d,t=>{S=l(t.palette),void 0!==t.level&&(p=e(t.level)),k?.refresh(),k&&b(k)},{level(t){p=e(Number.isFinite(t)?t:0),k||"listening"!==u||C(p),k?.kick()},listen:()=>P("listening"),think:()=>P("thinking"),done:()=>P("done"),idle:()=>{p=0,P("idle")},async mic(){w();const t=y,e="undefined"!=typeof navigator?navigator.mediaDevices:void 0,o=globalThis.AudioContext;if(!e?.getUserMedia||!o)return!1;let r;try{r=await e.getUserMedia({audio:!0})}catch{return!1}if(t!==y)return r.getTracks().forEach(t=>t.stop()),!1;const n=new o,a=n.createAnalyser();a.fftSize=1024,n.createMediaStreamSource(r).connect(a);const i=new Uint8Array(a.fftSize);return v={stream:r,context:n,read(){a.getByteTimeDomainData(i);let t=0;for(const e of i)t+=((e-128)/128)**2;return 5*Math.sqrt(t/i.length)}},P("listening"),!0},get state(){return u},get current(){return g}},()=>{w(),h.restore(),a.style.removeProperty("--ascii-level"),delete a.dataset.state})}var h=i;export{h as VOICE_ORB_DEFAULTS,a as VOICE_PALETTES,c as paintOrb,d as voiceOrb};//# sourceMappingURL=chunk-KXI3T72F.js.map
1
+ import{styleKeeper as t,clamp as e,mountSurface as o,handle as r,house as n}from"./chunk-I377LEZA.js";var a={aurora:["#2ee6c8","#9d7bff","#ff6fb5"],brand:["#ffb000","#ffd84d"]},i={palette:"aurora",swell:!0},l=t=>"mono"===t?[]:"string"==typeof t?[...a[t]??a.aurora]:[...t];function s(t,o){if(1===t.length)return t[0];const r=e(o)*(t.length-1),n=Math.min(t.length-2,Math.floor(r)),a=r-n,[i,l]=[t[n],t[n+1]].map(t=>[1,3,5].map(e=>parseInt(t.slice(e,e+2),16)||0));return`rgb(${i.map((t,e)=>Math.round(t+(l[e]-t)*a)).join(" ")})`}function c(t,o,r,n,a,i){const l=t=>{const o=Math.round(255*e(t)/2.2);return`rgb(${o} ${o} ${o})`},c=o/2,d=r/2,h=.36/(.92-.16*a)*Math.min(o,r),u=.86+.46*a,f=n*(.25+.6*a),p=t.createRadialGradient(c,d,.92*h,c,d,1.3*h);p.addColorStop(0,l(.36*u)),p.addColorStop(1,"#000"),t.fillStyle=p,t.fillRect(0,0,o,r),t.save(),t.beginPath(),t.arc(c,d,h,0,2*Math.PI),t.clip();const g=c+.8*Math.cos(f)*h*.62,m=d-.55*h*.62,M=t.createRadialGradient(g,m,0,g,m,1.7*h);M.addColorStop(0,l(.95*u)),M.addColorStop(.55,l(.5*u)),M.addColorStop(1,l(.18)),t.fillStyle=M,t.fillRect(c-h,d-h,2*h,2*h),t.globalCompositeOperation="lighter",t.lineWidth=Math.max(1.5,.05*h);for(let e=0;e<6;e++){const o=e/6*Math.PI+.35*n,r=Math.sin(o);r<0||(t.strokeStyle=l(.16*r),t.beginPath(),t.ellipse(c,d,h*Math.abs(Math.cos(o)),h,0,0,2*Math.PI),t.stroke())}const S=t.createRadialGradient(c,d,.7*h,c,d,h);if(S.addColorStop(0,"#000"),S.addColorStop(1,l(.3)),t.fillStyle=S,t.fillRect(c-h,d-h,2*h,2*h),t.restore(),t.globalCompositeOperation="source-over",!i.length)return;t.globalCompositeOperation="color";const k=.4*n,v=.5*a,y=t.createLinearGradient(c-Math.cos(k)*h,d-Math.sin(k)*h,c+Math.cos(k)*h,d+Math.sin(k)*h);y.addColorStop(0,s(i,v)),y.addColorStop(.5,s(i,v+.25)),y.addColorStop(1,s(i,v+.5)),t.fillStyle=y,t.fillRect(0,0,o,r),t.globalCompositeOperation="source-over"}function d(a,s={}){const d={current:{...i,...s}},h=t();let u="idle",f=0,p=e(d.current.level??0),g=p,m=0,M=0,S=l(d.current.palette),k=null,v=null,y=0;const b=t=>{t.canvas.style.filter=!t.dark()&&S.length?"brightness(.68) saturate(1.35)":""},C=t=>{a.style.setProperty("--ascii-level",t.toFixed(3)),d.current.swell&&h.set(a,"scale",String(1+.1*t))};k=o({host:a,outset:Math.round(.08*(a.offsetWidth||0)),look:()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:6,cellAspect:.62,glyphScale:.92,fit:"cover",color:S.length?"source":"ink",contrast:2.2,brightness:1.1-.5,saturation:1.4,...d.current.look}),ink:()=>d.current.ink??"--ascii-ink-strong",kit:d,reducedMotion:()=>d.current.reducedMotion,onTheme:()=>k&&b(k),onFail:()=>{k=null},paint:({pen:t,w:o,h:r,now:a,still:i})=>{const l=M?Math.min(64,a-M):16;M=a;const s=e((t=>"listening"===u?v?v.read():p:"thinking"===u?.2+.1*Math.sin((t-f)/120):"done"===u?m*(1-n(e((t-f)/420))):p)(a));return i||"done"===u?g=s:g+=(s-g)*(1-(1-(s>g?.45:.12))**(l/16.7)),i||C(g),c(t,o,r,i?0:a/1e3,g,S),!0}}),k&&b(k);const w=()=>{y++,v&&(v.stream.getTracks().forEach(t=>t.stop()),v.context.close().catch(()=>{}),v=null)},P=t=>{"listening"!==t&&w(),"done"===t&&(m=g),u=t,f=performance.now(),a.dataset.state=t,k||C("listening"===t?p:0),k?.kick()};return r(()=>k,d,t=>{S=l(t.palette),void 0!==t.level&&(p=e(t.level)),k?.refresh(),k&&b(k)},{level(t){p=e(Number.isFinite(t)?t:0),k||"listening"!==u||C(p),k?.kick()},listen:()=>P("listening"),think:()=>P("thinking"),done:()=>P("done"),idle:()=>{p=0,P("idle")},async mic(){w();const t=y,e="undefined"!=typeof navigator?navigator.mediaDevices:void 0,o=globalThis.AudioContext;if(!e?.getUserMedia||!o)return!1;let r;try{r=await e.getUserMedia({audio:!0})}catch{return!1}if(t!==y)return r.getTracks().forEach(t=>t.stop()),!1;const n=new o,a=n.createAnalyser();a.fftSize=1024,n.createMediaStreamSource(r).connect(a);const i=new Uint8Array(a.fftSize);return v={stream:r,context:n,read(){a.getByteTimeDomainData(i);let t=0;for(const e of i)t+=((e-128)/128)**2;return 5*Math.sqrt(t/i.length)}},P("listening"),!0},get state(){return u},get current(){return g}},()=>{w(),h.restore(),a.style.removeProperty("--ascii-level"),delete a.dataset.state})}var h=i;export{h as VOICE_ORB_DEFAULTS,a as VOICE_PALETTES,c as paintOrb,d as voiceOrb};//# sourceMappingURL=chunk-JF3WEYIE.js.map
@@ -1 +1 @@
1
- import{mountPageField as e}from"./chunk-7DXSG526.js";var r=(e,r)=>!1===e.cursor?"none":"string"==typeof e.cursor?e.cursor:r;function t(r,t,n,l){let o=null;if(o=e({host:r.host,kit:r.kit,layer:"under",glyphs:l&&(()=>l(r.settings())),look:e=>{const n=r.settings();return{...t(n,e),...n.look}},ink:e=>r.ink(e)??(e?n.dark:n.light),reducedMotion:r.reducedMotion,onFail:()=>{o=null,r.onFail()}}),!o)return null;const i=o.canvas;return{get field(){return o?.field??null},get canvas(){return o?.canvas??i},refresh(){o?.refresh()},play(){o?.field.play()},pause(){o?.field.pause()},destroy(){o?.destroy(),o=null}}}var n=()=>"number"==typeof innerWidth&&innerWidth<760,l={light:"#86847e",dark:"#7c7a74"},o={light:"#8f8d86",dark:"#64625d"},i=e=>({font:'"Geist Mono", ui-monospace, monospace',fontWeight:400,cellSize:e.cellSize,cellAspect:.62,glyphScale:.86}),s=e=>({cellSize:e.cellSize,cellAspect:1,dotScale:.68}),a={x:.18,y:.2,width:.64,height:.6,feather:.3,shape:"ellipse"};function c(e){const{scene:n,charset:o,hover:c,middle:d=a,feather:h=.3,graphite:u=l}=e,p=e.mark??"glyph";return{id:e.id,name:e.name,description:e.description,cellSize:e.cellSize,speed:e.speed??1,cursor:e.cursor??!0,opacity:e.opacity,mount(l){const a=t(l,(t,l)=>{const a=((e,r)=>e.mark??(e.charset||e.look?.charset?"glyph":r))(t,p);return{scene:n,color:"ink",shade:0,background:"transparent",vignette:0,speed:t.speed,maxPixelRatio:2,levels:"none",blend:"on",..."dot"===a?{mark:"dot",...s(t)}:{mark:"glyph",charset:t.charset??o,...i(t)},hover:r(t,c),lantern:{radius:.14,strength:.45,trail:.8,follow:9},trail:{strength:.8,radius:.35},fluid:{radius:.09,refraction:.03,glow:.6},clear:t.clear?{element:t.clear,padding:0,feather:h,shape:"ellipse"}:d,...e.tune?.(t,l)}},u,"dot"===p?e=>({...i(e),charset:o}):void 0);if(!a||!e.extra)return a;const g=e.extra(l,a),f=a.destroy.bind(a);return Object.assign(a,{destroy(){g(),f()}})}}}export{o as FIELD_GRAPHITE,r as hoverOf,t as mountField,n as narrow,c as scenePreset};//# sourceMappingURL=chunk-3VEMKDBW.js.map
1
+ import{mountPageField as e}from"./chunk-RGV7VRYC.js";var r=(e,r)=>!1===e.cursor?"none":"string"==typeof e.cursor?e.cursor:r;function t(r,t,n,l){let o=null;if(o=e({host:r.host,kit:r.kit,layer:"under",glyphs:l&&(()=>l(r.settings())),look:e=>{const n=r.settings();return{...t(n,e),...n.look}},ink:e=>r.ink(e)??(e?n.dark:n.light),reducedMotion:r.reducedMotion,onFail:()=>{o=null,r.onFail()}}),!o)return null;const i=o.canvas;return{get field(){return o?.field??null},get canvas(){return o?.canvas??i},refresh(){o?.refresh()},play(){o?.field.play()},pause(){o?.field.pause()},destroy(){o?.destroy(),o=null}}}var n=()=>"number"==typeof innerWidth&&innerWidth<760,l={light:"#86847e",dark:"#7c7a74"},o={light:"#8f8d86",dark:"#64625d"},i=e=>({font:'"Geist Mono", ui-monospace, monospace',fontWeight:400,cellSize:e.cellSize,cellAspect:.62,glyphScale:.86}),s=e=>({cellSize:e.cellSize,cellAspect:1,dotScale:.68}),a={x:.18,y:.2,width:.64,height:.6,feather:.3,shape:"ellipse"};function c(e){const{scene:n,charset:o,hover:c,middle:d=a,feather:h=.3,graphite:u=l}=e,p=e.mark??"glyph";return{id:e.id,name:e.name,description:e.description,cellSize:e.cellSize,speed:e.speed??1,cursor:e.cursor??!0,opacity:e.opacity,mount(l){const a=t(l,(t,l)=>{const a=((e,r)=>e.mark??(e.charset||e.look?.charset?"glyph":r))(t,p);return{scene:n,color:"ink",shade:0,background:"transparent",vignette:0,speed:t.speed,maxPixelRatio:2,levels:"none",blend:"on",..."dot"===a?{mark:"dot",...s(t)}:{mark:"glyph",charset:t.charset??o,...i(t)},hover:r(t,c),lantern:{radius:.14,strength:.45,trail:.8,follow:9},trail:{strength:.8,radius:.35},fluid:{radius:.09,refraction:.03,glow:.6},clear:t.clear?{element:t.clear,padding:0,feather:h,shape:"ellipse"}:d,...e.tune?.(t,l)}},u,"dot"===p?e=>({...i(e),charset:o}):void 0);if(!a||!e.extra)return a;const g=e.extra(l,a),f=a.destroy.bind(a);return Object.assign(a,{destroy(){g(),f()}})}}}export{o as FIELD_GRAPHITE,r as hoverOf,t as mountField,n as narrow,c as scenePreset};//# sourceMappingURL=chunk-LTRVMY3D.js.map
@@ -1 +1 @@
1
- import{scenePreset as e}from"./chunk-3VEMKDBW.js";var r=e({id:"interference",name:"Interference",description:"Two fine ring grids from slowly orbiting centres; where they cross, moiré bands open and close.",cellSize:11,scene:"interference",charset:" .:-=+*#",hover:"lantern"});export{r as interference};//# sourceMappingURL=chunk-EKYEA7Z4.js.map
1
+ import{scenePreset as e}from"./chunk-LTRVMY3D.js";var r=e({id:"interference",name:"Interference",description:"Two fine ring grids from slowly orbiting centres; where they cross, moiré bands open and close.",cellSize:11,scene:"interference",charset:" .:-=+*#",hover:"lantern"});export{r as interference};//# sourceMappingURL=chunk-M5JJSIWI.js.map
@@ -1 +1 @@
1
- import{blank as e,mountPageField as t,pageHandle as n,pulseAt as r,sleep as o}from"./chunk-7DXSG526.js";import{hash as l}from"./chunk-GF72XM4C.js";var a={preset:"hero",clear:!1,text:"404",ripple:!0},i=28,c='600 440px "Geist", Arial, sans-serif',s=()=>"number"==typeof innerWidth&&innerWidth<760,d=e=>({mark:"glyph",scene:"drift",levels:"auto",charset:" .:+*#",font:'"Geist Mono", ui-monospace, monospace',fontWeight:400,cellSize:10,cellAspect:.62,glyphScale:.86,color:"ink",shade:0,hover:"trail",trail:{strength:.9,radius:.32},...e}),h={mark:"glyph",scene:"none",charset:" .:-=+*#%@",font:'"Geist", Arial, sans-serif',fontWeight:500,cellSize:7,cellAspect:.8,glyphScale:.8,color:"ink",shade:0,contrast:1.4,fit:"contain",clear:!1,focus:{x:.5,y:.5},drift:.8,speed:.7,levels:"auto",hover:"trail",trail:{strength:1,radius:.42}};function f(t){const n=document.createElement("canvas").getContext("2d");n.font=c;const r=Math.max(320,Math.ceil(n.measureText(t).width)+160),{canvas:o,pen:l}=e(r,560);return l.fillStyle="#fff",l.textAlign="center",l.textBaseline="middle",l.font=c,l.letterSpacing="-10px",l.fillText(t,r/2,296),o}function u(e){const t=e.getContext("2d").getImageData(0,0,e.width,e.height).data,n=[];for(let r=0;r<e.height;r+=i)for(let o=0;o<e.width;o+=i){let a=!1;for(let n=0;n<i&&!a;n+=4)for(let l=0;l<i&&!a;l+=4)a=(t[4*((r+n)*e.width+o+l)]??0)>40;if(!a)continue;const c=n.length,s=l(c,1)*Math.PI*2,d=120+420*l(c,2);n.push({x:o,y:r,dx:Math.cos(s)*d+.5*(o-e.width/2),dy:Math.sin(s)*d*.6,lag:.35*l(c,3)})}return n}var p=[...Array.from({length:10},(e,t)=>(t+1)/10),1,1,1,...Array.from({length:14},(e,t)=>1-(t+1)/14)];function g(e,t,n,r){const o=t.getContext("2d");o.globalAlpha=1,o.fillStyle="#000",o.fillRect(0,0,t.width,t.height);for(const t of n){const n=Math.min(1,Math.max(0,(r-t.lag*(1-r))/(1-.5*t.lag))),l=n*n*(3-2*n);o.globalAlpha=1-.72*l,o.drawImage(e,t.x,t.y,i,i,t.x+t.dx*l,t.y+t.dy*l,i,i)}o.globalAlpha=1}function m(l,i={}){const m={current:{...a,...i}},x=()=>"notFound"===m.current.preset;let y=0,v=!1,b=0;const w={x:-1e4,y:-1e4,at:-1e6},k=()=>f(m.current.text);let M=null;M=t({host:l,look:()=>{const e=m.current,t=e.clear,n=e=>!!t&&{element:t,padding:-14,feather:e,shape:"ellipse"};return{..."notFound"===e.preset?h:"brand"===e.preset?d({scale:s()?1.4:1.6,brightness:.24,contrast:1.1,clear:n(.3)}):d({scale:s()?1.6:1.9,brightness:.26,contrast:1.15,clear:n(.22)}),...e.look}},ink:e=>{const t=m.current,n=t.palette,r="string"==typeof n?n:n?.[e?"dark":"light"];return r??t.ink?r??t.ink:"notFound"===t.preset?e?"#d8d6cf":"#1d1d1b":"brand"===t.preset?`var(--brand, ${e?"#8f80ff":"#5b4bd1"})`:e?"#8a8881":"#6b6964"},source:x()?k():null,label:m.current.label??(x()?m.current.text:void 0),kit:m,reducedMotion:()=>m.current.reducedMotion,onFail:()=>{M=null}}),M&&x()&&document.fonts?.load?.(c).then(()=>{M&&x()&&!v&&M.field.setSource(k())},()=>{});const S=(e,t=1.4)=>{M&&!M.still()&&(b=performance.now()+1400,r(M.field,e,t))},A=e=>{const t=m.current,n=performance.now();!M||x()||!t.ripple||M.still()||n<b||n-w.at<520||Math.hypot(e.clientX-w.x,e.clientY-w.y)<36||(Object.assign(w,{x:e.clientX,y:e.clientY,at:n}),r(M.field,{x:e.clientX,y:e.clientY},.65))};M&&l.addEventListener("pointermove",A);let F=m.current.preset,G=m.current.text;return n(()=>M,m,e=>{M&&((e.preset!==F||"notFound"===e.preset&&e.text!==G)&&(y++,v=!1,M.field.setSource("notFound"===e.preset?k():null)),F=e.preset,G=e.text)},{pulse:S,scatter:async t=>{const n=M?.field;if(!n)return;if(!x())return void S(t);if(t&&S(t,1.2),v||M.still())return;v=!0;const r=++y,l=k(),a=u(l),i=e(l.width,l.height).canvas;for(const e of p){const t=performance.now();if(g(l,i,a,e),await n.setSource(i),await o(Math.max(0,44-(performance.now()-t))),r!==y||!M)return void(v=!1)}await n.setSource(l),v=!1}},()=>{y++,l.removeEventListener("pointermove",A)})}var x=a;export{x as FIELD_BACKGROUND_DEFAULTS,p as SCATTER_STEPS,m as fieldBackground,f as lostArt,u as lostTiles};//# sourceMappingURL=chunk-ILXVBO7M.js.map
1
+ import{blank as e,mountPageField as t,pageHandle as n,pulseAt as r,sleep as o}from"./chunk-RGV7VRYC.js";import{hash as l}from"./chunk-I377LEZA.js";var a={preset:"hero",clear:!1,text:"404",ripple:!0},i=28,c='600 440px "Geist", Arial, sans-serif',s=()=>"number"==typeof innerWidth&&innerWidth<760,d=e=>({mark:"glyph",scene:"drift",levels:"auto",charset:" .:+*#",font:'"Geist Mono", ui-monospace, monospace',fontWeight:400,cellSize:10,cellAspect:.62,glyphScale:.86,color:"ink",shade:0,hover:"trail",trail:{strength:.9,radius:.32},...e}),h={mark:"glyph",scene:"none",charset:" .:-=+*#%@",font:'"Geist", Arial, sans-serif',fontWeight:500,cellSize:7,cellAspect:.8,glyphScale:.8,color:"ink",shade:0,contrast:1.4,fit:"contain",clear:!1,focus:{x:.5,y:.5},drift:.8,speed:.7,levels:"auto",hover:"trail",trail:{strength:1,radius:.42}};function f(t){const n=document.createElement("canvas").getContext("2d");n.font=c;const r=Math.max(320,Math.ceil(n.measureText(t).width)+160),{canvas:o,pen:l}=e(r,560);return l.fillStyle="#fff",l.textAlign="center",l.textBaseline="middle",l.font=c,l.letterSpacing="-10px",l.fillText(t,r/2,296),o}function u(e){const t=e.getContext("2d").getImageData(0,0,e.width,e.height).data,n=[];for(let r=0;r<e.height;r+=i)for(let o=0;o<e.width;o+=i){let a=!1;for(let n=0;n<i&&!a;n+=4)for(let l=0;l<i&&!a;l+=4)a=(t[4*((r+n)*e.width+o+l)]??0)>40;if(!a)continue;const c=n.length,s=l(c,1)*Math.PI*2,d=120+420*l(c,2);n.push({x:o,y:r,dx:Math.cos(s)*d+.5*(o-e.width/2),dy:Math.sin(s)*d*.6,lag:.35*l(c,3)})}return n}var p=[...Array.from({length:10},(e,t)=>(t+1)/10),1,1,1,...Array.from({length:14},(e,t)=>1-(t+1)/14)];function g(e,t,n,r){const o=t.getContext("2d");o.globalAlpha=1,o.fillStyle="#000",o.fillRect(0,0,t.width,t.height);for(const t of n){const n=Math.min(1,Math.max(0,(r-t.lag*(1-r))/(1-.5*t.lag))),l=n*n*(3-2*n);o.globalAlpha=1-.72*l,o.drawImage(e,t.x,t.y,i,i,t.x+t.dx*l,t.y+t.dy*l,i,i)}o.globalAlpha=1}function m(l,i={}){const m={current:{...a,...i}},x=()=>"notFound"===m.current.preset;let y=0,v=!1,b=0;const w={x:-1e4,y:-1e4,at:-1e6},k=()=>f(m.current.text);let M=null;M=t({host:l,look:()=>{const e=m.current,t=e.clear,n=e=>!!t&&{element:t,padding:-14,feather:e,shape:"ellipse"};return{..."notFound"===e.preset?h:"brand"===e.preset?d({scale:s()?1.4:1.6,brightness:.24,contrast:1.1,clear:n(.3)}):d({scale:s()?1.6:1.9,brightness:.26,contrast:1.15,clear:n(.22)}),...e.look}},ink:e=>{const t=m.current,n=t.palette,r="string"==typeof n?n:n?.[e?"dark":"light"];return r??t.ink?r??t.ink:"notFound"===t.preset?e?"#d8d6cf":"#1d1d1b":"brand"===t.preset?`var(--brand, ${e?"#8f80ff":"#5b4bd1"})`:e?"#8a8881":"#6b6964"},source:x()?k():null,label:m.current.label??(x()?m.current.text:void 0),kit:m,reducedMotion:()=>m.current.reducedMotion,onFail:()=>{M=null}}),M&&x()&&document.fonts?.load?.(c).then(()=>{M&&x()&&!v&&M.field.setSource(k())},()=>{});const A=(e,t=1.4)=>{M&&!M.still()&&(b=performance.now()+1400,r(M.field,e,t))},S=e=>{const t=m.current,n=performance.now();!M||x()||!t.ripple||M.still()||n<b||n-w.at<520||Math.hypot(e.clientX-w.x,e.clientY-w.y)<36||(Object.assign(w,{x:e.clientX,y:e.clientY,at:n}),r(M.field,{x:e.clientX,y:e.clientY},.65))};M&&l.addEventListener("pointermove",S);let F=m.current.preset,C=m.current.text;return n(()=>M,m,e=>{M&&((e.preset!==F||"notFound"===e.preset&&e.text!==C)&&(y++,v=!1,M.field.setSource("notFound"===e.preset?k():null)),F=e.preset,C=e.text)},{pulse:A,scatter:async t=>{const n=M?.field;if(!n)return;if(!x())return void A(t);if(t&&A(t,1.2),v||M.still())return;v=!0;const r=++y,l=k(),a=u(l),i=e(l.width,l.height).canvas;for(const e of p){const t=performance.now();if(g(l,i,a,e),await n.setSource(i),await o(Math.max(0,44-(performance.now()-t))),r!==y||!M)return void(v=!1)}await n.setSource(l),v=!1}},()=>{y++,l.removeEventListener("pointermove",S)})}var x=a;export{x as FIELD_BACKGROUND_DEFAULTS,p as SCATTER_STEPS,m as fieldBackground,f as lostArt,u as lostTiles};//# sourceMappingURL=chunk-MT23DCGU.js.map
@@ -1 +1 @@
1
- import{clamp as e,hash as t,styleKeeper as r,mountSurface as o,handle as n,prefersReduced as i}from"./chunk-GF72XM4C.js";var a={kind:"heart",icon:"svg",manage:!0,outset:40,layer:"under"},l=t=>1-(1-e(t))**3,s=e=>e>=1?1:1-Math.exp(-5*e)*Math.cos(9*e);function c(e,t,r,o,n){if(e.beginPath(),"heart"===t){const t=n/29;for(let n=0;n<=56;n++){const i=n/56*Math.PI*2,a=16*Math.sin(i)**3,l=-(13*Math.cos(i)-5*Math.cos(2*i)-2*Math.cos(3*i)-Math.cos(4*i));0===n?e.moveTo(r+a*t,o+(l-2.5)*t):e.lineTo(r+a*t,o+(l-2.5)*t)}}else{const t=.7*n,i=o-n/2,a=r-t/2,l=.12*n;e.moveTo(a,i+l),e.arcTo(a,i,a+l,i,l),e.lineTo(a+t-l,i),e.arcTo(a+t,i,a+t,i+l,l),e.lineTo(a+t,o+n/2),e.lineTo(r,o+n/2-.27*n),e.lineTo(a,o+n/2)}e.closePath()}function u(e,t,r,o,n,i){const a=e.createRadialGradient(r,o-.1*n,0,r,o,.62*n);a.addColorStop(0,"#fff"),a.addColorStop(.7,"#e6e6e6"),a.addColorStop(1,"#8c8c8c"),e.globalAlpha=i,e.fillStyle=a,e.shadowColor="#bbb",e.shadowBlur=Math.max(2,.08*n),c(e,t,r,o,n),e.fill(),e.shadowBlur=0,e.globalAlpha=1}function d(r,o,n,i,a){const d=n.x+n.w/2,h=n.y+n.h/2,f=n.h,p=1.45*f,k=s(i/.3),g=(e=>e<.5?4*e**3:1-(-2*e+2)**3/2)(e((i-.42)/.3)),b=g>0?p+(f-p)*g:.7*f+(p-.7*f)*k,M=e((i-.04)/.46);M>0&&M<1&&(r.strokeStyle=(t=>{const r=Math.round(255*e(t));return`rgb(${r} ${r} ${r})`})(.8*(1-M)**1.4),r.lineWidth=2.4-1.2*M,r.lineJoin="round",c(r,o,d,h,f*(1.2+.5*l(M))),r.stroke());r.fillStyle="#fff";for(let e=0;e<7;e++){const o=(i-.1-.05*t(e,a))/.5;if(o<=0||o>=1)continue;const n=-Math.PI/2+(e-3)/7*Math.PI*1.7+.3*(t(a+1,e)-.5),s=f*(.75+(.55+.35*t(e,a+2))*l(o)),c=1.8*(1-.6*o);r.globalAlpha=1-o*o,r.beginPath(),r.arc(d+Math.cos(n)*s*1.15,h+Math.sin(n)*s*.85,c,0,2*Math.PI),r.fill()}r.globalAlpha=1,u(r,o,d,h,b,1-e((i-.72)/.28))}function h(e,s={}){const c={current:{...a,...s}},h=r(),f=()=>e.querySelector(c.current.icon)??e,p=()=>!!(c.current.reducedMotion??i());let k="true"===e.getAttribute("aria-pressed"),g=[],b=[],M=null;M=o({host:e,outset:c.current.outset,layer:c.current.layer,look:()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:4,cellAspect:.62,glyphScale:.92,...c.current.look}),ink:e=>c.current.ink??("heart"===c.current.kind?`var(--ascii-like, ${e?"#ff6b70":"#e5484d"})`:"--ascii-ink-strong"),kit:c,reducedMotion:()=>c.current.reducedMotion,onFail:()=>{M=null},paint:({pen:e,w:r,now:o,box:n})=>{const i=n(f()),a=c.current.kind;g=g.filter(r=>{const n=(o-r.start)/("burst"===r.kind?560:300);if(n>=1)return!1;if(n<0)return!0;if(e.save(),"burst"===r.kind)d(e,a,i,n,r.seed);else{const r=i.x+i.w/2,o=i.y+i.h/2+3*l(n),s=i.h*(1+.12*l(n));u(e,a,r,o,s,(1-n)**1.4),e.fillStyle="#000";for(let i=o-s/2;i<o+s/2;i+=3)for(let o=r-s/2;o<r+s/2;o+=2)t(o,i)<1.15*n&&e.fillRect(o,i,2,3)}return e.restore(),!0});const s=c.current.limit;if(s&&g.length){const t=n(s),o=t.y+t.h,i=e.createLinearGradient(0,o-2,0,o+8);i.addColorStop(0,"#000"),i.addColorStop(1,"rgb(0 0 0 / 0)"),e.fillStyle="#000",e.fillRect(0,0,r,o-2),e.fillStyle=i,e.fillRect(0,o-2,r,10)}return g.length>0}});const m=()=>{b.forEach(clearTimeout),b=[]},y=()=>{if(m(),h.restore(),!M||p())return;const t=performance.now(),r=f();g=g.filter(e=>"undo"!==e.kind),g.push({kind:"burst",start:t,seed:Math.floor(t)%97}),r!==e&&h.set(r,"opacity","0"),b.push(setTimeout(()=>{h.restore(),r!==e&&"function"==typeof r.animate&&r.animate({opacity:["0","1"],scale:[".7","1"]},{duration:220,easing:"cubic-bezier(.34, 1.42, .64, 1)"})},347.2)),M.kick()},S=()=>{m(),h.restore(),M&&!p()&&(g=g.filter(e=>"burst"!==e.kind),g.push({kind:"undo",start:performance.now(),seed:0}),M.kick())},T=(t=!k)=>{k=t,e.setAttribute("aria-pressed",String(k)),k?y():S()},v=()=>{c.current.manage&&(T(),c.current.onChange?.(k))};return!e.hasAttribute("aria-pressed")&&c.current.manage&&e.setAttribute("aria-pressed","false"),e.addEventListener("click",v),n(()=>M,c,()=>M?.refresh(),{burst:y,undo:S,toggle:T,get pressed(){return k}},()=>{m(),h.restore(),e.removeEventListener("click",v)})}var f=a;export{f as LIKE_BURST_DEFAULTS,d as burstFrame,h as likeBurst,s as springOut};//# sourceMappingURL=chunk-NF4WVWAC.js.map
1
+ import{clamp as e,hash as t,styleKeeper as r,mountSurface as o,handle as n,prefersReduced as i}from"./chunk-I377LEZA.js";var a={kind:"heart",icon:"svg",manage:!0,outset:40,layer:"under"},l=t=>1-(1-e(t))**3,s=e=>e>=1?1:1-Math.exp(-5*e)*Math.cos(9*e);function c(e,t,r,o,n){if(e.beginPath(),"heart"===t){const t=n/29;for(let n=0;n<=56;n++){const i=n/56*Math.PI*2,a=16*Math.sin(i)**3,l=-(13*Math.cos(i)-5*Math.cos(2*i)-2*Math.cos(3*i)-Math.cos(4*i));0===n?e.moveTo(r+a*t,o+(l-2.5)*t):e.lineTo(r+a*t,o+(l-2.5)*t)}}else{const t=.7*n,i=o-n/2,a=r-t/2,l=.12*n;e.moveTo(a,i+l),e.arcTo(a,i,a+l,i,l),e.lineTo(a+t-l,i),e.arcTo(a+t,i,a+t,i+l,l),e.lineTo(a+t,o+n/2),e.lineTo(r,o+n/2-.27*n),e.lineTo(a,o+n/2)}e.closePath()}function u(e,t,r,o,n,i){const a=e.createRadialGradient(r,o-.1*n,0,r,o,.62*n);a.addColorStop(0,"#fff"),a.addColorStop(.7,"#e6e6e6"),a.addColorStop(1,"#8c8c8c"),e.globalAlpha=i,e.fillStyle=a,e.shadowColor="#bbb",e.shadowBlur=Math.max(2,.08*n),c(e,t,r,o,n),e.fill(),e.shadowBlur=0,e.globalAlpha=1}function d(r,o,n,i,a){const d=n.x+n.w/2,h=n.y+n.h/2,f=n.h,p=1.45*f,k=s(i/.3),g=(e=>e<.5?4*e**3:1-(-2*e+2)**3/2)(e((i-.42)/.3)),b=g>0?p+(f-p)*g:.7*f+(p-.7*f)*k,M=e((i-.04)/.46);M>0&&M<1&&(r.strokeStyle=(t=>{const r=Math.round(255*e(t));return`rgb(${r} ${r} ${r})`})(.8*(1-M)**1.4),r.lineWidth=2.4-1.2*M,r.lineJoin="round",c(r,o,d,h,f*(1.2+.5*l(M))),r.stroke());r.fillStyle="#fff";for(let e=0;e<7;e++){const o=(i-.1-.05*t(e,a))/.5;if(o<=0||o>=1)continue;const n=-Math.PI/2+(e-3)/7*Math.PI*1.7+.3*(t(a+1,e)-.5),s=f*(.75+(.55+.35*t(e,a+2))*l(o)),c=1.8*(1-.6*o);r.globalAlpha=1-o*o,r.beginPath(),r.arc(d+Math.cos(n)*s*1.15,h+Math.sin(n)*s*.85,c,0,2*Math.PI),r.fill()}r.globalAlpha=1,u(r,o,d,h,b,1-e((i-.72)/.28))}function h(e,s={}){const c={current:{...a,...s}},h=r(),f=()=>e.querySelector(c.current.icon)??e,p=()=>!!(c.current.reducedMotion??i());let k="true"===e.getAttribute("aria-pressed"),g=[],b=[],M=null;M=o({host:e,outset:c.current.outset,layer:c.current.layer,look:()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:4,cellAspect:.62,glyphScale:.92,...c.current.look}),ink:e=>c.current.ink??("heart"===c.current.kind?`var(--ascii-like, ${e?"#ff6b70":"#e5484d"})`:"--ascii-ink-strong"),kit:c,reducedMotion:()=>c.current.reducedMotion,onFail:()=>{M=null},paint:({pen:e,w:r,now:o,box:n})=>{const i=n(f()),a=c.current.kind;g=g.filter(r=>{const n=(o-r.start)/("burst"===r.kind?560:300);if(n>=1)return!1;if(n<0)return!0;if(e.save(),"burst"===r.kind)d(e,a,i,n,r.seed);else{const r=i.x+i.w/2,o=i.y+i.h/2+3*l(n),s=i.h*(1+.12*l(n));u(e,a,r,o,s,(1-n)**1.4),e.fillStyle="#000";for(let i=o-s/2;i<o+s/2;i+=3)for(let o=r-s/2;o<r+s/2;o+=2)t(o,i)<1.15*n&&e.fillRect(o,i,2,3)}return e.restore(),!0});const s=c.current.limit;if(s&&g.length){const t=n(s),o=t.y+t.h,i=e.createLinearGradient(0,o-2,0,o+8);i.addColorStop(0,"#000"),i.addColorStop(1,"rgb(0 0 0 / 0)"),e.fillStyle="#000",e.fillRect(0,0,r,o-2),e.fillStyle=i,e.fillRect(0,o-2,r,10)}return g.length>0}});const m=()=>{b.forEach(clearTimeout),b=[]},y=()=>{if(m(),h.restore(),!M||p())return;const t=performance.now(),r=f();g=g.filter(e=>"undo"!==e.kind),g.push({kind:"burst",start:t,seed:Math.floor(t)%97}),r!==e&&h.set(r,"opacity","0"),b.push(setTimeout(()=>{h.restore(),r!==e&&"function"==typeof r.animate&&r.animate({opacity:["0","1"],scale:[".7","1"]},{duration:220,easing:"cubic-bezier(.34, 1.42, .64, 1)"})},347.2)),M.kick()},S=()=>{m(),h.restore(),M&&!p()&&(g=g.filter(e=>"burst"!==e.kind),g.push({kind:"undo",start:performance.now(),seed:0}),M.kick())},T=(t=!k)=>{k=t,e.setAttribute("aria-pressed",String(k)),k?y():S()},v=()=>{c.current.manage&&(T(),c.current.onChange?.(k))};return!e.hasAttribute("aria-pressed")&&c.current.manage&&e.setAttribute("aria-pressed","false"),e.addEventListener("click",v),n(()=>M,c,()=>M?.refresh(),{burst:y,undo:S,toggle:T,get pressed(){return k}},()=>{m(),h.restore(),e.removeEventListener("click",v)})}var f=a;export{f as LIKE_BURST_DEFAULTS,d as burstFrame,h as likeBurst,s as springOut};//# sourceMappingURL=chunk-MWUPCAET.js.map
@@ -1 +1 @@
1
- import{scenePreset as e}from"./chunk-3VEMKDBW.js";var r=e({id:"contour",name:"Contour",description:"Survey lines over a slowly shifting terrain, every fifth an index line.",cellSize:11,scene:"contour",charset:" .·-~=",hover:"lantern"});export{r as contour};//# sourceMappingURL=chunk-FPCCX4FM.js.map
1
+ import{scenePreset as e}from"./chunk-LTRVMY3D.js";var r=e({id:"contour",name:"Contour",description:"Survey lines over a slowly shifting terrain, every fifth an index line.",cellSize:11,scene:"contour",charset:" .·-~=",hover:"lantern"});export{r as contour};//# sourceMappingURL=chunk-MYAZOXMF.js.map
@@ -1 +1 @@
1
- import{snapshot as e}from"./chunk-PB5E3D4E.js";import{styleKeeper as t,mountSurface as o,clamp as r,house as n}from"./chunk-GF72XM4C.js";var a={duration:620,collapse:!0,remove:!1},i=16,l=new WeakMap;function s(s,c={}){const d=l.get(s);if(d)return d;const h={...a,...c},p=t(),u=s.offsetHeight,g=()=>{for(const e of s.children)p.set(e,"opacity","0");p.set(s,"color","transparent"),p.set(s,"pointer-events","none"),s.setAttribute("aria-hidden","true")},f=e=>{h.collapse&&(p.set(s,"box-sizing","border-box"),p.set(s,"overflow","hidden"),p.set(s,"min-height","0"),p.set(s,"height",`${(u*(1-e)).toFixed(2)}px`),e>=1&&(p.set(s,"padding-block","0"),p.set(s,"margin-block","0"),p.set(s,"border-width","0")))},m=h.host??s.parentElement??s;let k=0,b=!1,w=null,v={x:0,y:0,w:0,h:0},x=()=>{};const y=o({host:m,look:()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:5,cellAspect:.62,glyphScale:.92,contrast:1.6,drift:5,...h.look}),outset:i,resolution:2,ink:()=>h.ink??"--ascii-ink-strong",kit:{current:{lazy:!1,globalLook:h.globalLook}},reducedMotion:()=>h.reducedMotion,onFail:()=>x(),paint:({pen:e,now:t,still:o,scale:a})=>{if(o)return queueMicrotask(x),!1;if(!w||!b)return!1;const l=t-k,s=r(l/h.duration);e.setTransform(a,0,0,a,0,0),l>=300&&f(n(r((l-300)/260))),e.save(),e.globalAlpha=r(2.2*(1-s))*(1-.9*s*s),e.translate(8*s,-14*s),e.drawImage(w,0,0,w.width/2,w.height/2),e.globalCompositeOperation="destination-out";const c=v.x+v.w,d=c-(1.3*s-.3)*v.w,p=c-1.3*s*v.w,u=e.createLinearGradient(p,0,Math.max(p+1,d),0);u.addColorStop(0,"rgba(0,0,0,0)"),u.addColorStop(1,"rgba(0,0,0,1)"),e.globalAlpha=1,e.fillStyle=u,e.fillRect(v.x-i,v.y-i,v.w+32,v.h+32),e.restore();const g=l>=Math.max(h.duration,h.collapse?560:0);return g&&queueMicrotask(x),!g}}),M=new Promise(t=>{let o=!1;if(x=()=>{o||(o=!0,y?.destroy(),f(1),h.remove&&s.remove(),l.delete(s),t())},!y||y.still())return g(),void x();v=y.box(s),w=e(s,y.canvas.clientWidth||v.w+32,y.canvas.clientHeight||v.h+32,y.box).canvas;y.field.ready.then(()=>{o||b||(g(),b=!0,k=performance.now(),y.kick())},()=>{g(),x()})});return l.set(s,M),M}var c=a;export{c as DISINTEGRATE_DEFAULTS,s as disintegrate};//# sourceMappingURL=chunk-3YSK7V26.js.map
1
+ import{snapshot as e}from"./chunk-DKRZSP5K.js";import{styleKeeper as t,mountSurface as o,clamp as r,house as n}from"./chunk-I377LEZA.js";var a={duration:620,collapse:!0,remove:!1},i=16,l=new WeakMap;function s(s,c={}){const d=l.get(s);if(d)return d;const h={...a,...c},p=t(),u=s.offsetHeight,g=()=>{for(const e of s.children)p.set(e,"opacity","0");p.set(s,"color","transparent"),p.set(s,"pointer-events","none"),s.setAttribute("aria-hidden","true")},f=e=>{h.collapse&&(p.set(s,"box-sizing","border-box"),p.set(s,"overflow","hidden"),p.set(s,"min-height","0"),p.set(s,"height",`${(u*(1-e)).toFixed(2)}px`),e>=1&&(p.set(s,"padding-block","0"),p.set(s,"margin-block","0"),p.set(s,"border-width","0")))},m=h.host??s.parentElement??s;let k=0,b=!1,w=null,v={x:0,y:0,w:0,h:0},x=()=>{};const y=o({host:m,look:()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:5,cellAspect:.62,glyphScale:.92,contrast:1.6,drift:5,...h.look}),outset:i,resolution:2,ink:()=>h.ink??"--ascii-ink-strong",kit:{current:{lazy:!1,globalLook:h.globalLook}},reducedMotion:()=>h.reducedMotion,onFail:()=>x(),paint:({pen:e,now:t,still:o,scale:a})=>{if(o)return queueMicrotask(x),!1;if(!w||!b)return!1;const l=t-k,s=r(l/h.duration);e.setTransform(a,0,0,a,0,0),l>=300&&f(n(r((l-300)/260))),e.save(),e.globalAlpha=r(2.2*(1-s))*(1-.9*s*s),e.translate(8*s,-14*s),e.drawImage(w,0,0,w.width/2,w.height/2),e.globalCompositeOperation="destination-out";const c=v.x+v.w,d=c-(1.3*s-.3)*v.w,p=c-1.3*s*v.w,u=e.createLinearGradient(p,0,Math.max(p+1,d),0);u.addColorStop(0,"rgba(0,0,0,0)"),u.addColorStop(1,"rgba(0,0,0,1)"),e.globalAlpha=1,e.fillStyle=u,e.fillRect(v.x-i,v.y-i,v.w+32,v.h+32),e.restore();const g=l>=Math.max(h.duration,h.collapse?560:0);return g&&queueMicrotask(x),!g}}),M=new Promise(t=>{let o=!1;if(x=()=>{o||(o=!0,y?.destroy(),f(1),h.remove&&s.remove(),l.delete(s),t())},!y||y.still())return g(),void x();v=y.box(s),w=e(s,y.canvas.clientWidth||v.w+32,y.canvas.clientHeight||v.h+32,y.box).canvas;y.field.ready.then(()=>{o||b||(g(),b=!0,k=performance.now(),y.kick())},()=>{g(),x()})});return l.set(s,M),M}var c=a;export{c as DISINTEGRATE_DEFAULTS,s as disintegrate};//# sourceMappingURL=chunk-N7J4UAWY.js.map
@@ -1 +1 @@
1
- import{imageFor as e,injectStyle as t,imageReady as r,drawCover as i}from"./chunk-PB5E3D4E.js";import{styleKeeper as n,clamp as o,mountSurface as a,handle as s,house as l}from"./chunk-GF72XM4C.js";function c(c,d){const u={current:{position:50,...d}},p=n();let h=o(u.current.position,0,100),m=null,g=null,v={from:h,to:h,at:-1e9},b=0,f=!1;const w=[];let A=u.current.position;g=a({host:c,layer:"under",look:()=>({blend:"coarse",mark:"glyph",charset:" .:-=+*#%@",font:'"Geist", Arial, sans-serif',fontWeight:600,cellSize:6,cellAspect:.8,glyphScale:.96,color:"source",levels:"auto",saturation:1.3,contrast:1.45,gamma:.85,brightness:.14,hover:"trail",trail:{strength:.7,radius:.3},...u.current.look}),ink:()=>u.current.ink??"--ascii-ink-strong",kit:u,reducedMotion:()=>u.current.reducedMotion,resolution:(e,t)=>{const r=Math.min(1600,Math.max(2,Math.round(2*e)));return[r,Math.max(2,Math.round(r*t/Math.max(1,e)))]},onFail:()=>{g=null},paint:({pen:e,width:t,height:r})=>(e.imageSmoothingQuality="high",m&&i(e,m,0,0,t,r),!1)});const k="string"==typeof u.current.image?e(u.current.image):u.current.image,x=c.querySelector('[role="slider"]'),y=c.querySelector("[data-compare-line]"),E=x??document.createElement("div"),M=y??document.createElement("span"),L=e=>{void 0===e&&E.hasAttribute("aria-label")||E.setAttribute("aria-label",e??"Photo and ASCII split")},C=()=>{const e=Math.round(h);p.set(c,"--ascii-pos",`${h}%`),E.setAttribute("aria-valuenow",String(e)),E.setAttribute("aria-valuetext",`${e}% photo, ${100-e}% ASCII`)},S=(e,t=!1)=>{if(e=o(e,0,100),!g)return void(h=e);if(b&&(cancelAnimationFrame(b),b=0),!t||g.still()||Math.abs(e-h)<.5)return h=e,C(),void u.current.onChange?.(h);v={from:h,to:e,at:performance.now()};const r=e=>{const t=o((e-v.at)/280);h=v.from+(v.to-v.from)*l(t),C(),u.current.onChange?.(h),b=t<1?requestAnimationFrame(r):0};b=requestAnimationFrame(r)},N=e=>{const t=c.getBoundingClientRect();return t.width?(e-t.left)/t.width*100:h},F=e=>{if(0!==e.button)return;c.setPointerCapture?.(e.pointerId),f=!0,c.dataset.dragging="";const t=N(e.clientX);S(t,Math.abs(t-h)>3),E.focus({preventScroll:!0})},I=e=>{f&&S(N(e.clientX))},j=()=>{f=!1,delete c.dataset.dragging},P=e=>{const t={ArrowLeft:-5,ArrowDown:-5,ArrowRight:5,ArrowUp:5,PageDown:-20,PageUp:20}[e.key],r="Home"===e.key?0:"End"===e.key?100:void 0!==t?5*Math.round(h/5)+t:null;null!==r&&(e.preventDefault(),S(r,!0))};let q=()=>{};if(g){t("ascii-kit-compare","\n:where(.ascii-compare-photo){position:absolute;inset:0;width:100%;height:100%;object-fit:cover;pointer-events:none;clip-path:inset(0 calc(100% - var(--ascii-pos, 50%)) 0 0)}\n:where(.ascii-compare-line){position:absolute;top:0;bottom:0;left:var(--ascii-pos, 50%);width:2px;translate:-50% 0;background:#fff;box-shadow:0 0 0 .5px rgb(0 0 0 / .25),0 0 12px rgb(0 0 0 / .45);pointer-events:none}\n:where(.ascii-compare-handle){position:absolute;top:50%;left:var(--ascii-pos, 50%);display:grid;place-items:center;width:40px;height:40px;translate:-50% -50%;border-radius:50%;background:#fff;color:#111;box-shadow:0 0 0 1px rgb(0 0 0 / .08),0 4px 14px rgb(0 0 0 / .4);cursor:grab;touch-action:none}\n:where(.ascii-compare-handle:focus-visible){outline:2px solid #fff;outline-offset:3px}\n"),p.set(c,"overflow","hidden"),p.set(c,"touch-action","pan-y"),p.set(c,"user-select","none"),p.set(c,"cursor","ew-resize");const e={className:k.className,hidden:k.getAttribute("aria-hidden")};q=()=>{k.className=e.className,null===e.hidden?k.removeAttribute("aria-hidden"):k.setAttribute("aria-hidden",e.hidden)},k.className=(e.className?`${e.className} `:"")+"ascii-compare-photo",k.setAttribute("aria-hidden","true"),k.draggable=!1,y||(M.className="ascii-compare-line",M.setAttribute("aria-hidden","true")),x||(E.className="ascii-compare-handle",E.innerHTML='<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m9 7-5 5 5 5M15 7l5 5-5 5"/></svg>',E.setAttribute("role","slider"),E.tabIndex=0),L(u.current.label),E.setAttribute("aria-valuemin","0"),E.setAttribute("aria-valuemax","100"),E.setAttribute("aria-orientation","horizontal");for(const e of[k,M,E])c.contains(e)||(c.appendChild(e),w.push(e));C(),c.addEventListener("pointerdown",F),c.addEventListener("pointermove",I),c.addEventListener("pointerup",j),c.addEventListener("pointercancel",j),E.addEventListener("keydown",P),r(k).then(e=>{m=e,g?.kick()},()=>{})}else c.contains(k)||("static"===getComputedStyle(c).position&&p.set(c,"position","relative"),k.setAttribute("style","position:absolute;inset:0;width:100%;height:100%;object-fit:cover;border-radius:inherit"),c.appendChild(k),w.push(k));return s(()=>g,u,e=>{L(e.label),e.position!==A&&(A=e.position,S(e.position,!0)),g?.refresh()},{set:S,get position(){return h}},()=>{b&&cancelAnimationFrame(b),c.removeEventListener("pointerdown",F),c.removeEventListener("pointermove",I),c.removeEventListener("pointerup",j),c.removeEventListener("pointercancel",j),E.removeEventListener("keydown",P),delete c.dataset.dragging,w.forEach(e=>e.remove()),q(),p.restore()})}export{c as compare};//# sourceMappingURL=chunk-YSN7EHSH.js.map
1
+ import{imageFor as e,injectStyle as t,imageReady as r,drawCover as i}from"./chunk-DKRZSP5K.js";import{styleKeeper as n,clamp as o,mountSurface as a,handle as s,house as l}from"./chunk-I377LEZA.js";function c(c,d){const u={current:{position:50,...d}},p=n();let h=o(u.current.position,0,100),m=null,g=null,v={from:h,to:h,at:-1e9},b=0,f=!1;const w=[];let A=u.current.position;g=a({host:c,layer:"under",look:()=>({blend:"coarse",mark:"glyph",charset:" .:-=+*#%@",font:'"Geist", Arial, sans-serif',fontWeight:600,cellSize:6,cellAspect:.8,glyphScale:.96,color:"source",levels:"auto",saturation:1.3,contrast:1.45,gamma:.85,brightness:.14,hover:"trail",trail:{strength:.7,radius:.3},...u.current.look}),ink:()=>u.current.ink??"--ascii-ink-strong",kit:u,reducedMotion:()=>u.current.reducedMotion,resolution:(e,t)=>{const r=Math.min(1600,Math.max(2,Math.round(2*e)));return[r,Math.max(2,Math.round(r*t/Math.max(1,e)))]},onFail:()=>{g=null},paint:({pen:e,width:t,height:r})=>(e.imageSmoothingQuality="high",m&&i(e,m,0,0,t,r),!1)});const k="string"==typeof u.current.image?e(u.current.image):u.current.image,x=c.querySelector('[role="slider"]'),y=c.querySelector("[data-compare-line]"),E=x??document.createElement("div"),M=y??document.createElement("span"),L=e=>{void 0===e&&E.hasAttribute("aria-label")||E.setAttribute("aria-label",e??"Photo and ASCII split")},S=()=>{const e=Math.round(h);p.set(c,"--ascii-pos",`${h}%`),E.setAttribute("aria-valuenow",String(e)),E.setAttribute("aria-valuetext",`${e}% photo, ${100-e}% ASCII`)},C=(e,t=!1)=>{if(e=o(e,0,100),!g)return void(h=e);if(b&&(cancelAnimationFrame(b),b=0),!t||g.still()||Math.abs(e-h)<.5)return h=e,S(),void u.current.onChange?.(h);v={from:h,to:e,at:performance.now()};const r=e=>{const t=o((e-v.at)/280);h=v.from+(v.to-v.from)*l(t),S(),u.current.onChange?.(h),b=t<1?requestAnimationFrame(r):0};b=requestAnimationFrame(r)},N=e=>{const t=c.getBoundingClientRect();return t.width?(e-t.left)/t.width*100:h},I=e=>{if(0!==e.button)return;c.setPointerCapture?.(e.pointerId),f=!0,c.dataset.dragging="";const t=N(e.clientX);C(t,Math.abs(t-h)>3),E.focus({preventScroll:!0})},j=e=>{f&&C(N(e.clientX))},F=()=>{f=!1,delete c.dataset.dragging},P=e=>{const t={ArrowLeft:-5,ArrowDown:-5,ArrowRight:5,ArrowUp:5,PageDown:-20,PageUp:20}[e.key],r="Home"===e.key?0:"End"===e.key?100:void 0!==t?5*Math.round(h/5)+t:null;null!==r&&(e.preventDefault(),C(r,!0))};let q=()=>{};if(g){t("ascii-kit-compare","\n:where(.ascii-compare-photo){position:absolute;inset:0;width:100%;height:100%;object-fit:cover;pointer-events:none;clip-path:inset(0 calc(100% - var(--ascii-pos, 50%)) 0 0)}\n:where(.ascii-compare-line){position:absolute;top:0;bottom:0;left:var(--ascii-pos, 50%);width:2px;translate:-50% 0;background:#fff;box-shadow:0 0 0 .5px rgb(0 0 0 / .25),0 0 12px rgb(0 0 0 / .45);pointer-events:none}\n:where(.ascii-compare-handle){position:absolute;top:50%;left:var(--ascii-pos, 50%);display:grid;place-items:center;width:40px;height:40px;translate:-50% -50%;border-radius:50%;background:#fff;color:#111;box-shadow:0 0 0 1px rgb(0 0 0 / .08),0 4px 14px rgb(0 0 0 / .4);cursor:grab;touch-action:none}\n:where(.ascii-compare-handle:focus-visible){outline:2px solid #fff;outline-offset:3px}\n"),p.set(c,"overflow","hidden"),p.set(c,"touch-action","pan-y"),p.set(c,"user-select","none"),p.set(c,"cursor","ew-resize");const e={className:k.className,hidden:k.getAttribute("aria-hidden")};q=()=>{k.className=e.className,null===e.hidden?k.removeAttribute("aria-hidden"):k.setAttribute("aria-hidden",e.hidden)},k.className=(e.className?`${e.className} `:"")+"ascii-compare-photo",k.setAttribute("aria-hidden","true"),k.draggable=!1,y||(M.className="ascii-compare-line",M.setAttribute("aria-hidden","true")),x||(E.className="ascii-compare-handle",E.innerHTML='<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m9 7-5 5 5 5M15 7l5 5-5 5"/></svg>',E.setAttribute("role","slider"),E.tabIndex=0),L(u.current.label),E.setAttribute("aria-valuemin","0"),E.setAttribute("aria-valuemax","100"),E.setAttribute("aria-orientation","horizontal");for(const e of[k,M,E])c.contains(e)||(c.appendChild(e),w.push(e));S(),c.addEventListener("pointerdown",I),c.addEventListener("pointermove",j),c.addEventListener("pointerup",F),c.addEventListener("pointercancel",F),E.addEventListener("keydown",P),r(k).then(e=>{m=e,g?.kick()},()=>{})}else c.contains(k)||("static"===getComputedStyle(c).position&&p.set(c,"position","relative"),k.setAttribute("style","position:absolute;inset:0;width:100%;height:100%;object-fit:cover;border-radius:inherit"),c.appendChild(k),w.push(k));return s(()=>g,u,e=>{L(e.label),e.position!==A&&(A=e.position,C(e.position,!0)),g?.refresh()},{set:C,get position(){return h}},()=>{b&&cancelAnimationFrame(b),c.removeEventListener("pointerdown",I),c.removeEventListener("pointermove",j),c.removeEventListener("pointerup",F),c.removeEventListener("pointercancel",F),E.removeEventListener("keydown",P),delete c.dataset.dragging,w.forEach(e=>e.remove()),q(),p.restore()})}export{c as compare};//# sourceMappingURL=chunk-NP7UG7DS.js.map
@@ -1 +1 @@
1
- import{renderMaterial as t}from"./chunk-XPXMCXYI.js";import{mountCanvas as i}from"./chunk-3OD5BMF5.js";var n=(t,i,n,e)=>{const r=7*i+.55*Math.sin(2.2*t+.09*e)+.22*Math.sin(4.8*t-.07*e),o=.5+.5*Math.sin(r);return Math.pow(o,5)*(.35+.65*i)+.08*Math.pow(.5+.5*Math.sin(17*r),3)*o},e={id:"dune",name:"Dune",description:"Layered sand ridges with slow-moving light and fine grain.",cellSize:12,speed:1,cursor:!1,mount:e=>i(e,(i,e,r,o,h,s)=>t(n,i,e,r,o,{ditherStrength:s.ditherStrength,fontSize:s.fontSize,chars:s.chars,lightMode:s.lightMode,color:s.ink}))};export{e as dune};//# sourceMappingURL=chunk-ZCXNGJGB.js.map
1
+ import{renderMaterial as t}from"./chunk-XPXMCXYI.js";import{mountCanvas as i}from"./chunk-AAV5QNHU.js";var n=(t,i,n,e)=>{const r=7*i+.55*Math.sin(2.2*t+.09*e)+.22*Math.sin(4.8*t-.07*e),o=.5+.5*Math.sin(r);return Math.pow(o,5)*(.35+.65*i)+.08*Math.pow(.5+.5*Math.sin(17*r),3)*o},e={id:"dune",name:"Dune",description:"Layered sand ridges with slow-moving light and fine grain.",cellSize:12,speed:1,cursor:!1,mount:e=>i(e,(i,e,r,o,h,s)=>t(n,i,e,r,o,{ditherStrength:s.ditherStrength,fontSize:s.fontSize,chars:s.chars,lightMode:s.lightMode,color:s.ink}))};export{e as dune};//# sourceMappingURL=chunk-NQ4PFWOG.js.map
@@ -0,0 +1 @@
1
+ import{parseColor as t}from"./chunk-ZCHGV2CV.js";import{mountCanvas as o}from"./chunk-AAV5QNHU.js";import{mixHex as e}from"./chunk-I377LEZA.js";function n(o,e,n,a,r={}){const{fontSize:i=13,chars:l=" .,:;i+xX#&@",color:h="#ff4500",hotColor:f="#ffe066",intensity:c=.85,wind:s=0,speed:m=1,lightMode:M=!1}=r,p=.62*i,d=1.4*i,g=Math.ceil(e/p),u=Math.ceil(n/d),b=g*u,x="__fire_heat__",A=o.canvas;let k=A[x];k&&k.length===b||(k=new Float32Array(b),A[x]=k);const S=.18*(.016*m),_=s*m*.8,y=u-1,z=a*m;for(let t=0;t<g;t++){const o=(.6*(.5*Math.sin(.31*t+4.1*z)+.5)+.4*(.5*Math.sin(.73*t-2.7*z)+.5))*c;k[y*g+t]=Math.min(1,o+.15*Math.random()*c),y>0&&(k[(y-1)*g+t]=Math.min(1,.85*o+.1*Math.random()*c))}const C=new Float32Array(b);for(let t=0;t<u-2;t++)for(let o=0;o<g;o++){const e=.4*k[(t+1)*g+o]+.25*k[(t+2)*g+Math.max(0,Math.min(g-1,o+Math.round(_)))]+.175*k[(t+1)*g+Math.max(0,o-1)]+.175*k[(t+1)*g+Math.min(g-1,o+1)];C[t*g+o]=Math.max(0,e-S-.02*Math.random()*m)}for(let t=0;t<g;t++)C[(u-1)*g+t]=k[(u-1)*g+t],u>1&&(C[(u-2)*g+t]=k[(u-2)*g+t]);A[x]=C;const $=t(h)??{r:255,g:69,b:0},j=t(f)??{r:255,g:224,b:102};o.clearRect(0,0,e,n),o.font=`${i}px "JetBrains Mono", monospace`,o.textBaseline="top";for(let t=0;t<u;t++)for(let e=0;e<g;e++){const n=C[t*g+e];if(n<.03)continue;const a=l[Math.min(l.length-1,Math.floor(n*l.length))];if(" "===a)continue;const r=Math.min(1,1.2*n),i=$.r+(j.r-$.r)*r|0,h=$.g+(j.g-$.g)*r|0,f=$.b+(j.b-$.b)*r|0,c=M?1-.3*n:Math.min(1,n+.15);o.globalAlpha=c,o.fillStyle=`rgb(${i},${h},${f})`,o.fillText(a,e*p,t*d)}o.globalAlpha=1}var a={id:"fire",name:"Fire",description:"A cellular flame rising from the bottom edge.",cellSize:13,speed:1,cursor:!1,mount:t=>o(t,(t,o,a,r,i,l)=>n(t,o,a,l.elapsed,{fontSize:l.fontSize,chars:l.chars,color:l.ink,hotColor:l.accent??e(l.ink,"#ffffff",.6),speed:l.speed}),48)};export{a as fire,n as renderFireBackground};//# sourceMappingURL=chunk-NS6HYTQZ.js.map
@@ -0,0 +1 @@
1
+ import{mountSurface as t,house as e,styleKeeper as n,handle as r,clamp as o}from"./chunk-I377LEZA.js";var l={values:[],duration:560},a=.46,i=(t,e)=>e?Math.min(e-1,Math.max(0,Math.floor(t*e))):-1;function c(t,e){if(!e)return{bar:0,gap:0,left:0};const n=e<=7?.5:.6;let r=Math.max(1,Math.floor(t/e));for(;r>1&&e*r+(e-1)*Math.max(1,Math.round(r*n))>t;)r--;const o=e>1?Math.max(0,Math.min(Math.ceil(r*n*1.6),Math.floor((t-e*r)/(e-1)))):0;return{bar:r,gap:o,left:Math.max(0,Math.floor((t-e*r-(e-1)*o)/2))}}function s(s,h={}){const u={current:{...l,...h}};let d=u.current.values,m=null,f=[],p=0,M=!1,x=null,g=!1===u.current.intro?-1e9:performance.now(),v=[],b=[],w=[],E={cols:0,rows:0};const k=()=>u.current.values??[],y=()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:7,cellAspect:1,glyphScale:1.1,shade:.5,blend:"off",...u.current.look}),A=(t,e)=>{const{cellSize:n=7,maxPixelRatio:r=2}=y(),o=Math.min("number"==typeof devicePixelRatio&&devicePixelRatio>0?devicePixelRatio:1,r),l=Math.max(2,Math.round(n*o)),a=l/o,i=t=>{const e=Math.max(1,Math.floor(t*o/l));for(let t=e;t>1&&t>e-8;t--)if(Math.abs(t*a-Math.round(t*a))<.01)return t;return e},c=i(t),s=Math.max(2,i(e));return{cols:c,rows:s,cell:a,gw:Math.round(c*a),gh:Math.round(s*a)}};let L={left:0,cell:0};const C=(t,e)=>null===m?t===e-1?.8:a:t===m?.8:.3,$=(t,n)=>e((n-g-(b[t]??0))/u.current.duration),S=(t,e,n,r)=>{const l=((t,e,n,r)=>{const{bar:l,gap:a,left:i}=c(n,e.length),s=u.current.max??1.04*Math.max(...e,0),h=s>0?o(Math.max(0,e[t])/s)*(r-1):0,d=i+t*(l+a);return{x0:d,x1:d+l,h:h>0?Math.max(1,Math.round(h)):0}})(t,e,E.cols,E.rows);if(r)return l;const a=v[t]??{...l,h:0},i=$(t,n);return{x0:a.x0+(l.x0-a.x0)*i,x1:a.x1+(l.x1-a.x1)*i,h:a.h+(l.h-a.h)*i}};x=t({host:s,look:y,ink:()=>u.current.ink??"--ascii-ink-strong",kit:u,reducedMotion:()=>u.current.reducedMotion,resolution:(t,e)=>{const{cell:n}=A(t,e);return[Math.max(2,2*Math.round(t/n)),Math.max(4,2*Math.round(e/n))]},onFail:()=>{x=null},paint:({pen:t,width:n,height:r,now:l,still:i})=>{const c=(()=>{const t=x?.canvas;if(!t||!s.offsetWidth)return!1;const{gw:e,gh:n,cell:r}=A(s.offsetWidth,s.offsetHeight),o=Math.round((s.offsetWidth-e)/2),l=[`${o}px`,s.offsetHeight-n+"px",`${e}px`,`${n}px`];L={left:o,cell:r};let a=!1;return["left","top","width","height"].forEach((e,n)=>{t.style[e]!==l[n]&&(t.style[e]=l[n],a=!0)}),a&&x?.field.resize(),a})(),h=n/2,d=r/2;E={cols:h,rows:d};const m=k(),M=m.length,v=p?Math.min(64,l-p):16;p=l;const b=new Float32Array(h*d),y=(t,e,n)=>{const r=(d-1-e)*h+t;n>b[r]&&(b[r]=n)};for(let t=0;t<h;t++)y(t,0,.16);const R=({x0:t,x1:e,h:n},r)=>{if(n<=.01)return;const l=Math.ceil(n)-1;for(let a=Math.max(0,Math.floor(t));a<Math.min(h,Math.ceil(e));a++){const i=o(Math.min(a+1,e)-Math.max(a,t));for(let t=0;t<=l&&t<d-1;t++)y(a,t+1,(t===l?Math.min(1,r+.2):r)*i*o(n-t))}};let I=!1;const H=i?1:e((l-g)/u.current.duration);H<1&&(I=!0);for(const t of w)R({...t,h:t.h*(1-H)},a);H>=1&&(w=[]);for(let t=0;t<M;t++){!i&&$(t,l)<1&&(I=!0);const e=C(t,M),n=f[t]??e;f[t]=i?e:n+(e-n)*(1-Math.exp(-v/70)),Math.abs(f[t]-e)>.004&&(I=!0),R(S(t,m,l,i),f[t])}for(let e=0;e<b.length;e++){if(b[e]<=0)continue;const n=Math.round(255*b[e]);t.fillStyle=`rgb(${n} ${n} ${n})`,t.fillRect(e%h*2,2*Math.floor(e/h),2,2)}return c&&i&&x?.kick(),I||c}});const R=n(),I=x?null:document.createElement("div"),H=()=>{if(!I)return;const t=k(),e=t.length,n=u.current.max??1.04*Math.max(...t,0);I.replaceChildren(...t.map((t,r)=>{const l=document.createElement("div");return l.setAttribute("style",`flex:1 1 0;height:${n>0?(100*o(t/n)).toFixed(2):0}%;margin:0 ${e<=7?22:18}%;background:currentColor;opacity:${.9*(.16+.84*C(r,e))}`),l}))};I&&("static"===getComputedStyle(s).position&&R.set(s,"position","relative"),I.setAttribute("aria-hidden","true"),I.setAttribute("style","position:absolute;inset:0;display:flex;align-items:flex-end;pointer-events:none"),s.appendChild(I));const P=document.createElement("table");P.setAttribute("style","position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0");const W=()=>{const t=u.current.format??(t=>t.toLocaleString()),e=u.current.labels??[],n=document.createElement("tbody");k().forEach((r,o)=>{const l=document.createElement("tr"),a=document.createElement("th"),i=document.createElement("td");a.setAttribute("scope","row"),a.setAttribute("style","font-weight:inherit"),a.textContent=e[o]??String(o+1),i.textContent=t(r),l.appendChild(a),l.appendChild(i),n.appendChild(l)}),P.replaceChildren(n)};W(),s.appendChild(P);const z=!s.hasAttribute("tabindex"),F=!s.hasAttribute("role");z&&(s.tabIndex=0),F&&s.setAttribute("role","group");const O=t=>{const e=k().length,n=null!==t&&e?Math.min(e-1,Math.max(0,Math.round(t))):null;n!==m&&(m=n,x?.kick(),H(),u.current.onHover?.(m,null===m?null:k()[m],null===m?null:u.current.labels?.[m]??null))},X=t=>u.current.stagger??(t<=7?45:12),j=(t,n)=>{const r=k(),o=u.current.labels,l=performance.now(),i=!!x?.still(),c=E.cols&&!i?t.map((e,n)=>S(n,t,l,!1)):[],s=i?[]:w.map(t=>({...t,h:t.h*(1-e((l-g)/u.current.duration))})),h=new Map,m=(t,e,r)=>o&&n?r?.[t]??`#${t}`:"#"+(e-1-t);t.forEach((e,r)=>h.set(m(r,t.length,n),r));const p=new Set,M=f;let y=0;const A=r.length;v=r.map((t,e)=>{const n=h.get(m(e,A,o));return void 0!==n&&c[n]?(p.add(n),c[n]):null}),f=r.map((t,e)=>{const n=h.get(m(e,A,o));return void 0!==n?M[n]??a:a}),b=v.map(t=>t?0:y++*X(A)*.6),w=[...s,...c.filter((t,e)=>!p.has(e))].filter(t=>t.h>.01),d=r,g=l,x?.kick(),H()};H();const B=t=>{const e=s.getBoundingClientRect(),n=k().length;if(!e.width)return;const r=(t.clientX-e.left)/e.width,o=t.clientY-e.top;if(r<0||r>1||o<0||o>e.height)return void O(null);if(!E.cols)return void O(i(r,n));const{bar:l,gap:a,left:h}=c(E.cols,n);O(Math.round(((t.clientX-e.left-L.left)/L.cell-h-l/2)/Math.max(1,l+a)))},D=()=>O(null),G=t=>{const e=k().length,n="ArrowRight"===t.key?null===m?0:Math.min(e-1,m+1):"ArrowLeft"===t.key?null===m?e-1:Math.max(0,m-1):"Home"===t.key?0:"End"===t.key?e-1:"Escape"===t.key?null:void 0;void 0!==n&&e&&(t.preventDefault(),O(n))};s.addEventListener("pointermove",B),s.addEventListener("pointerdown",B),s.addEventListener("pointerleave",D),s.addEventListener("pointercancel",D),s.addEventListener("keydown",G),s.addEventListener("blur",D);const Y="function"==typeof IntersectionObserver?new IntersectionObserver(([t])=>{t?.isIntersecting&&!M&&(M=!0,!1!==u.current.intro&&(()=>{const t=k().length;d=k(),g=performance.now(),v=[],w=[],b=Array.from({length:t},(e,n)=>n*X(t)),f=k().map((t,e,n)=>C(e,n.length)),x?.kick(),H()})())},{threshold:.4}):null;Y?.observe(s);let Z=u.current.labels;return r(()=>x,u,t=>{W(),t.values!==d&&(j(d,Z),Z=t.labels),x?.refresh()},{set(t,e){const n=d,r=Z;u.current={...u.current,values:[...t],...e?{labels:[...e]}:{}},Z=u.current.labels,null!==m&&m>=t.length&&O(null),W(),j(n,r)},highlight:O,get active(){return m},get values(){return k()}},()=>{Y?.disconnect(),P.remove(),I?.remove(),R.restore(),s.removeEventListener("pointermove",B),s.removeEventListener("pointerdown",B),s.removeEventListener("pointerleave",D),s.removeEventListener("pointercancel",D),s.removeEventListener("keydown",G),s.removeEventListener("blur",D),z&&s.removeAttribute("tabindex"),F&&s.removeAttribute("role")})}var h=l;export{h as BLOCK_CHART_DEFAULTS,i as barAt,c as barLayout,s as blockChart};//# sourceMappingURL=chunk-NSKX2OFA.js.map
@@ -1 +1 @@
1
- import{parseColor as t,hash2 as o}from"./chunk-ZCHGV2CV.js";import{mountCanvas as c}from"./chunk-3OD5BMF5.js";function e(c,e,n,r,a={x:.5,y:.5},i={}){const{fontSize:l=12,chars:s="·-=+|/",accentColor:h,color:f,bands:d=3,speed:g=1,bandWidth:M=.12,glitch:m=!0,lightMode:p=!1}=i,$=h??(p?"#6b8700":"#d4ff00"),b=.62*l,x=1.4*l,u=Math.ceil(e/b),S=Math.ceil(n/x);c.clearRect(0,0,e,n),c.font=`${l}px monospace`,c.textBaseline="top";let z=255,C=255,k=255;if(p&&(z=55,C=55,k=55),f){const o=t(f);o&&(z=o.r,C=o.g,k=o.b)}let y=212,j=255,B=0;const G=t($);G&&(y=G.r,j=G.g,B=G.b);const V=r*g;for(let t=0;t<S;t++)for(let e=0;e<u;e++){const n=t/S,r=((n*d-.5*V)%1+1)%1,i=Math.max(0,1-r/M),l=.35*(.5*o(3*e,7*t)+.5);let h=0;if(m){const c=e/u-a.x,r=n-a.y,i=Math.sqrt(c*c+r*r);if(i<.18){const c=o(11*e+Math.floor(12*V),5*t);h=Math.max(0,1-i/.18)*(c>.5?c-.3:0)}}const f=Math.min(1,l+.8*i+.6*h);if(f<.04)continue;const g=s[Math.floor(f*(s.length-1))],$=i>.55,G=p?.82*f:.12*f;c.fillStyle=$?`rgba(${y},${j},${B},${p?.92:.28})`:`rgba(${z},${C},${k},${G})`,c.fillText(g,e*b,t*x)}}var n={id:"grid",name:"Grid",description:"Scan bands roll down a character grid and glitch near the cursor.",cellSize:12,speed:1,cursor:!0,mount:t=>c(t,(t,o,c,n,r,a)=>e(t,o,c,n,r,{fontSize:a.fontSize,chars:a.chars,lightMode:a.lightMode,color:a.ink,accentColor:a.accent}))};export{n as grid,e as renderGridBackground};//# sourceMappingURL=chunk-WI2AF2KE.js.map
1
+ import{parseColor as t,hash2 as o}from"./chunk-ZCHGV2CV.js";import{mountCanvas as c}from"./chunk-AAV5QNHU.js";function e(c,e,n,r,a={x:.5,y:.5},i={}){const{fontSize:l=12,chars:s="·-=+|/",accentColor:h,color:f,bands:d=3,speed:g=1,bandWidth:M=.12,glitch:m=!0,lightMode:p=!1}=i,$=h??(p?"#6b8700":"#d4ff00"),b=.62*l,x=1.4*l,u=Math.ceil(e/b),S=Math.ceil(n/x);c.clearRect(0,0,e,n),c.font=`${l}px monospace`,c.textBaseline="top";let z=255,C=255,k=255;if(p&&(z=55,C=55,k=55),f){const o=t(f);o&&(z=o.r,C=o.g,k=o.b)}let y=212,V=255,j=0;const A=t($);A&&(y=A.r,V=A.g,j=A.b);const G=r*g;for(let t=0;t<S;t++)for(let e=0;e<u;e++){const n=t/S,r=((n*d-.5*G)%1+1)%1,i=Math.max(0,1-r/M),l=.35*(.5*o(3*e,7*t)+.5);let h=0;if(m){const c=e/u-a.x,r=n-a.y,i=Math.sqrt(c*c+r*r);if(i<.18){const c=o(11*e+Math.floor(12*G),5*t);h=Math.max(0,1-i/.18)*(c>.5?c-.3:0)}}const f=Math.min(1,l+.8*i+.6*h);if(f<.04)continue;const g=s[Math.floor(f*(s.length-1))],$=i>.55,A=p?.82*f:.12*f;c.fillStyle=$?`rgba(${y},${V},${j},${p?.92:.28})`:`rgba(${z},${C},${k},${A})`,c.fillText(g,e*b,t*x)}}var n={id:"grid",name:"Grid",description:"Scan bands roll down a character grid and glitch near the cursor.",cellSize:12,speed:1,cursor:!0,mount:t=>c(t,(t,o,c,n,r,a)=>e(t,o,c,n,r,{fontSize:a.fontSize,chars:a.chars,lightMode:a.lightMode,color:a.ink,accentColor:a.accent}))};export{n as grid,e as renderGridBackground};//# sourceMappingURL=chunk-OOVUQEXT.js.map
@@ -1 +1 @@
1
- import{renderMaterial as t}from"./chunk-XPXMCXYI.js";import{mountCanvas as e}from"./chunk-3OD5BMF5.js";var n=(t,e,n,i)=>{const r=.2*Math.sin(3*t+2*e+.2*i);return(.65*Math.pow(.5+.5*Math.sin(45*(t+r)),8)+.35*Math.pow(.5+.5*Math.sin(50*(e-.3*r)),10))*(.4+.6*Math.sin(2*e+.4))},i={id:"weave",name:"Weave",description:"Interlaced threads with a subtle change in tension.",cellSize:12,speed:1,cursor:!1,mount:i=>e(i,(e,i,r,h,o,a)=>t(n,e,i,r,h,{ditherStrength:a.ditherStrength,fontSize:a.fontSize,chars:a.chars,lightMode:a.lightMode,color:a.ink}))};export{i as weave};//# sourceMappingURL=chunk-W4U5CK6L.js.map
1
+ import{renderMaterial as t}from"./chunk-XPXMCXYI.js";import{mountCanvas as e}from"./chunk-AAV5QNHU.js";var n=(t,e,n,i)=>{const r=.2*Math.sin(3*t+2*e+.2*i);return(.65*Math.pow(.5+.5*Math.sin(45*(t+r)),8)+.35*Math.pow(.5+.5*Math.sin(50*(e-.3*r)),10))*(.4+.6*Math.sin(2*e+.4))},i={id:"weave",name:"Weave",description:"Interlaced threads with a subtle change in tension.",cellSize:12,speed:1,cursor:!1,mount:i=>e(i,(e,i,r,h,o,a)=>t(n,e,i,r,h,{ditherStrength:a.ditherStrength,fontSize:a.fontSize,chars:a.chars,lightMode:a.lightMode,color:a.ink}))};export{i as weave};//# sourceMappingURL=chunk-P5MVACML.js.map
@@ -0,0 +1 @@
1
+ import{injectStyle as e}from"./chunk-DKRZSP5K.js";import{drawBlocks as t,snapshot as n,blocksOf as r,BLOCK_W as o,BLOCK_H as s}from"./chunk-HENGH3DE.js";import{styleKeeper as i,mountSurface as a,house as c,clamp as l,handle as u,hash as d,boxIn as f,prefersReduced as p}from"./chunk-I377LEZA.js";var h={input:"input",rows:'[role="option"]',hotkey:"k",manage:!0,closeOnRun:!0,highlight:!0,ai:"[data-ai]"},m=200,g=3600,y=40,v="cubic-bezier(.16, 1, .3, 1)",x=`\n:where([data-ascii-cmd-highlight]){position:absolute;left:0;top:0;z-index:-1;pointer-events:none;opacity:0;background:var(--ascii-cmd-highlight,color-mix(in oklab,currentColor 7%,transparent));transition:translate 240ms ${v},width 240ms ${v},height 240ms ${v},opacity 160ms ${v}}\n:where([data-ascii-cmd-highlight][data-on]){opacity:1}\n@media (prefers-reduced-motion:reduce){:where([data-ascii-cmd-highlight]){transition:none}}\n`;function k(k,w={}){const b={current:{...h,...w}},E=i(),$=()=>[...k.querySelectorAll(b.current.rows)],A=()=>k.querySelector(b.current.input),L=i();let M=b.current.open??!k.hasAttribute("hidden"),S=0,C=null,T=!1,H=0,O=null,W=[],R=null,D=0,P=0;const z=new WeakMap,K=()=>!!(b.current.reducedMotion??p());e("ascii-kit-command",x),"static"===getComputedStyle(k).position&&L.set(k,"position","relative"),L.set(k,"isolation","isolate");const j=document.createElement("div");j.setAttribute("aria-hidden","true"),j.dataset.asciiCmdHighlight="",b.current.highlight&&k.insertBefore(j,k.firstElementChild);const F=e=>{if(void 0===e.offsetParent)return f(k,e);let t=0,n=0;for(let r=e;r&&r!==k;r=r.offsetParent)t+=r.offsetLeft,n+=r.offsetTop;for(let r=e.parentElement;r&&r!==k;r=r.parentElement)t-=r.scrollLeft,n-=r.scrollTop;return{x:t,y:n,w:e.offsetWidth,h:e.offsetHeight}},N=e=>{const t=$()[S];if(!j.parentElement)return;if(!t||!M)return void delete j.dataset.on;const n=F(t),r=!e||void 0===j.dataset.on||K();r&&(j.style.transition="none"),j.style.translate=`${n.x}px ${n.y}px`,j.style.width=`${n.w}px`,j.style.height=`${n.h}px`,j.style.borderRadius=getComputedStyle(t).borderTopLeftRadius,j.dataset.on="",r&&(j.offsetWidth,j.style.removeProperty("transition"))};let q=null;const G=i();O=a({host:k,layer:"under",look:()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:5,cellAspect:.62,glyphScale:.92,...b.current.look}),ink:()=>b.current.ink??"--ascii-ink-strong",kit:b,reducedMotion:()=>b.current.reducedMotion,resolution:2,onFail:()=>{O=null},paint:({pen:e,now:i,still:a,box:u})=>{if(e.setTransform(2,0,0,2,0,0),C){const n=C,r=(i-n.start)/(n.closing?m:260);if(!(r>=1||a)){const o=n.closing?1-1.02*c(r):1.04*c(r);return t(e,n.snap,n.blocks,n.order,o,(e,t)=>[(n.ox-e.x)*t*.9,(n.oy-e.y)*t*.9],n.closing?1:1-l((r-.72)/.28),.4),!0}C=null}if(!M||T)return!1;let f=!1;W=W.filter(n=>{const r=(i-n.start)/280;return(r>=.7||a)&&n.styles.restore(),r>=1||a||!k.contains(n.row)?(n.styles.restore(),!1):(f=!0,r>0&&t(e,n.snap,n.blocks,n.order,1.04*c(r),(e,t)=>[14*t,0],1-l((r-.7)/.3),.42),!0)});const p=$()[S];if(p&&!a&&p.matches(b.current.ai)){p!==R&&(R=p,D=i+160);const t=i-D,a=t>=0?t%g/1100:-1;if(a>=0&&a<1&&!W.some(e=>e.row===p))((e,t,i,a,c)=>{const l=O,u=`${t.textContent}|${i.x}|${i.y}|${i.w}`;if(q?.row!==t||q.key!==u){const e=n(t,l.box,l.canvas.clientWidth||k.offsetWidth,l.canvas.clientHeight||k.offsetHeight,2);q={row:t,key:u,snap:e,blocks:r(e,2)}}const f=i.x-y+(i.w+80)*(e=>e<.5?4*e**3:1-(-2*e+2)**3/2)(a),p=Math.floor(c/70);for(const t of q.blocks){const n=(t.x+2-f)/y;if(n<=-1||n>=1)continue;const r=1-n*n;d(t.x+p,t.y)>.35+.65*r||(e.globalAlpha=Math.min(1,1.6*r),e.drawImage(q.snap,2*t.x,2*t.y,2*o,2*s,t.x,t.y,o,s))}e.globalAlpha=1;const h=f-i.x;G.set(t,"mask-image",`linear-gradient(90deg, #000 ${h-y}px, transparent ${h-14}px, transparent ${h+14}px, #000 ${h+y}px)`)})(e,p,u(p),a,i),f=!0;else{if(G.restore(),f)return!0;P&&clearTimeout(P);const e=t>=0?g-t%g:-t;P=setTimeout(()=>{P=0,O?.kick()},Math.max(16,e))}}else R=null,G.restore();return f}}),O&&(k.dataset.gpu="");const I=(e=!0)=>{const t=$();if(S=t.length?Math.min(Math.max(0,S),t.length-1):0,N(e),!b.current.manage)return;t.forEach((e,t)=>e.setAttribute("aria-selected",String(t===S)));const n=A(),r=t[S]?.id;n&&r&&n.setAttribute("aria-activedescendant",r)},Z=()=>`inset(0 round ${getComputedStyle(k).borderTopLeftRadius||"0px"})`,B=()=>{const e=b.current.trigger,t=k.offsetWidth,n=k.offsetHeight;if(!e)return`inset(0 ${Math.max(0,t/2-40)}px ${Math.max(0,n-36)}px round 18px)`;const r=f(k,e);return`inset(${r.y}px ${t-r.x-r.w}px ${n-r.y-r.h}px ${r.x}px round ${r.h/2}px)`},U=e=>{const t=O;if(!t)return;const o=k.offsetWidth,s=k.offsetHeight,i=n(k,t.box,o,s,2),a=r(i,2),c=b.current.trigger,l=c?t.box(c):{x:o/2,y:0,w:0,h:0},u=l.x+l.w/2,d=l.y+l.h/2,f=Math.hypot(o,s)||1;C={snap:i,blocks:a,order:Float32Array.from(a,e=>Math.hypot(e.x-u,e.y-d)/f*.7+.3*e.seed),ox:u,oy:d,start:performance.now(),closing:e},t.kick()},V=e=>{if(e)for(const e of[...k.children])"CANVAS"===e.tagName&&void 0!==e.dataset.asciiKit||E.set(e,"opacity","0");else E.restore()},J=(e,t,n="none")=>"function"!=typeof k.animate?null:k.animate(e.map(e=>({clipPath:e})),{duration:t,easing:v,fill:n}),Q=()=>{H&&clearTimeout(H),H=0},X=(e=!0)=>{!M||T?(Q(),M=!0,T=!1,S=0,k.removeAttribute("hidden"),k.dataset.open="",b.current.trigger?.setAttribute("aria-expanded","true"),I(!1),(()=>{for(const e of $())z.set(e,F(e).y)})(),e&&A()?.focus({preventScroll:!0}),b.current.onOpenChange?.(!0),K()?O?.kick():(k.dataset.state="opening",J([B(),Z()],260),O&&(T=!0,V(!0),U(!1)),H=setTimeout(()=>{H=0,delete k.dataset.state,T=!1,V(!1),O?.kick()},143))):e&&A()?.focus({preventScroll:!0})},Y=()=>{if(!M)return;Q();const e=k.contains(document.activeElement),t=()=>{H=0,T=!1,M=!1,C=null,delete k.dataset.state,delete k.dataset.open,V(!1),N(!1);for(const e of W)e.styles.restore();W=[],G.restore(),q=null,k.setAttribute("hidden",""),b.current.trigger?.setAttribute("aria-expanded","false"),e&&b.current.trigger?.focus({preventScroll:!0}),O?.kick(),b.current.onOpenChange?.(!1)};if(K())return void t();T=!0,k.dataset.state="closing",O&&(U(!0),V(!0));const n=J([Z(),B()],m,"forwards"),r="function"==typeof k.animate?k.animate([{opacity:1},{opacity:1,offset:.4},{opacity:0}],{duration:m,fill:"forwards"}):null;H=setTimeout(()=>{t(),n?.cancel(),r?.cancel()},m)},_=e=>{const t=$().length;t&&(S=(Math.round(e)%t+t)%t,I(),O?.kick())},ee=(e=S)=>{const t=$()[e];if(!t||T)return;_(e),O?.field.pulse({element:t,strength:.6}),t.matches(b.current.ai)&&(R=t,D=performance.now()),t.dataset.run="",b.current.onRun?.(e,t);const n=()=>{delete t.dataset.run,b.current.closeOnRun&&Y()};K()?n():setTimeout(n,240)},te=e=>{if(!b.current.manage)return;const t=$().length;if("Escape"===e.key&&M)return e.preventDefault(),e.stopPropagation(),void Y();if(e.target!==A()&&!$().includes(e.target))return;const n="ArrowDown"===e.key?S+1:"ArrowUp"===e.key?S-1:"Home"===e.key?0:"End"===e.key?t-1:null;if(null!==n)return e.preventDefault(),void _(n);"Enter"===e.key&&(e.preventDefault(),ee())},ne=e=>{const t=e.target?.closest?.(b.current.rows);return t?$().indexOf(t):-1},re=e=>{if(!b.current.manage)return;const t=ne(e);t<0||t!==S&&_(t)},oe=e=>{if(!b.current.manage)return;const t=ne(e);t>=0&&ee(t)},se=()=>{b.current.manage&&(S=0,I(!1))},ie="function"==typeof MutationObserver?new MutationObserver(()=>{M&&(I(!1),(()=>{const e=O,t=$(),o=t.filter(e=>{const t=F(e).y,n=z.get(e);return z.set(e,t),void 0===n||Math.abs(n-t)>1});for(const e of W)t.includes(e.row)&&!o.includes(e.row)||e.styles.restore();if(W=W.filter(e=>t.includes(e.row)&&!o.includes(e.row)),!e||!e.live||e.still()||T||!M)return;const s=e.canvas.clientWidth||k.offsetWidth,a=e.canvas.clientHeight||k.offsetHeight,c=performance.now();o.forEach((t,o)=>{const l=n(t,e.box,s,a,2),u=r(l,2);if(!u.length)return;const d=Math.min(...u.map(e=>e.x)),f=Math.max(1,Math.max(...u.map(e=>e.x))-d),p=i();for(const e of[...t.children])p.set(e,"opacity","0");W.push({row:t,snap:l,blocks:u,order:Float32Array.from(u,e=>(e.x-d)/f*.72+.28*e.seed),start:c+28*o,styles:p})}),e.kick()})())}):null;ie?.observe(k,{childList:!0,subtree:!0});const ae="function"==typeof ResizeObserver?new ResizeObserver(()=>N(!1)):null;ae?.observe(k);const ce=()=>{M?Y():X(!0)},le=e=>{const t=b.current.hotkey;t&&e.key?.toLowerCase()===t.toLowerCase()&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),M?document.activeElement===A()?Y():A()?.focus():X(!0))},ue=e=>{if(!b.current.manage||!M||T)return;const t=e.target;k.contains(t)||b.current.trigger?.contains(t)||Y()};k.addEventListener("keydown",te),k.addEventListener("pointermove",re),k.addEventListener("click",oe),k.addEventListener("input",se);const de=b.current.trigger;return de?.addEventListener("click",ce),de?.setAttribute("aria-expanded",String(M)),de?.setAttribute("aria-haspopup","dialog"),document.addEventListener("keydown",le),document.addEventListener("pointerdown",ue),M?k.dataset.open="":k.setAttribute("hidden",""),I(),u(()=>O,b,()=>{I(),O?.refresh()},{open:X,close:Y,select:_,run:ee,toggle(){M?Y():X(!0)},get isOpen(){return M},get selected(){return S}},()=>{Q(),P&&clearTimeout(P),V(!1);for(const e of W)e.styles.restore();G.restore(),ie?.disconnect(),ae?.disconnect(),j.remove(),L.restore(),k.removeEventListener("keydown",te),k.removeEventListener("pointermove",re),k.removeEventListener("click",oe),k.removeEventListener("input",se),de?.removeEventListener("click",ce),document.removeEventListener("keydown",le),document.removeEventListener("pointerdown",ue),delete k.dataset.gpu,delete k.dataset.state})}var w=h;export{w as COMMAND_PALETTE_DEFAULTS,k as commandPalette};//# sourceMappingURL=chunk-PZKQUZQK.js.map
@@ -1 +1 @@
1
- import{renderMaterial as t}from"./chunk-XPXMCXYI.js";import{mountCanvas as i}from"./chunk-3OD5BMF5.js";var o=(t,i,o,r)=>{const e=5.5*(t-.5*o)+.65*Math.sin(3.2*i+.2*r)+.12*r;return Math.pow(.5+.5*Math.cos(e),7)*(.45+.55*Math.sin(2.4*i+.2))},r={id:"veil",name:"Veil",description:"Tall folds of light drifting across a quiet ground.",cellSize:12,speed:1,cursor:!1,mount:r=>i(r,(i,r,e,n,h,s)=>t(o,i,r,e,n,{ditherStrength:s.ditherStrength,fontSize:s.fontSize,chars:s.chars,lightMode:s.lightMode,color:s.ink}))};export{r as veil};//# sourceMappingURL=chunk-CGSWUO67.js.map
1
+ import{renderMaterial as t}from"./chunk-XPXMCXYI.js";import{mountCanvas as i}from"./chunk-AAV5QNHU.js";var o=(t,i,o,r)=>{const e=5.5*(t-.5*o)+.65*Math.sin(3.2*i+.2*r)+.12*r;return Math.pow(.5+.5*Math.cos(e),7)*(.45+.55*Math.sin(2.4*i+.2))},r={id:"veil",name:"Veil",description:"Tall folds of light drifting across a quiet ground.",cellSize:12,speed:1,cursor:!1,mount:r=>i(r,(i,r,e,n,h,s)=>t(o,i,r,e,n,{ditherStrength:s.ditherStrength,fontSize:s.fontSize,chars:s.chars,lightMode:s.lightMode,color:s.ink}))};export{r as veil};//# sourceMappingURL=chunk-R3ALZFUQ.js.map
@@ -1 +1 @@
1
- import{styleKeeper as e,isDark as t,BASE_LOOK as n,prefersReduced as r,resolveColor as o,mergeOptions as i}from"./chunk-GF72XM4C.js";import{poster as s,liveField as l,disposeKit as u,setPosterSource as d}from"./chunk-FEAFQY7O.js";import{isGlyphFieldSupported as a,watchTheme as c,cancelFieldFrame as p,requestFieldFrame as f}from"../field.js";var g=e=>new Promise(t=>setTimeout(t,e));function h(i){const{host:u,layer:d="under",kit:g}=i;if("undefined"==typeof document)return null;const h=`position:absolute;inset:0;width:100%;height:100%;pointer-events:none;border-radius:inherit;z-index:${"under"===d?-1:"auto"}`;if(!a())return g?.current.poster&&!i.ownPoster&&s(u,g.current.poster,h,g),null;const m=e(),v=document.createElement("canvas");"static"===getComputedStyle(u).position&&m.set(u,"position","relative"),"under"===d&&m.set(u,"isolation","isolate"),v.dataset.asciiKit="",v.setAttribute("style",h),u.appendChild(v);let y=t(u),b=!1;const k=()=>{const e=i.reducedMotion();return!0===e?{speed:0,drift:0,respectReducedMotion:!0}:{respectReducedMotion:!1!==e}},w=()=>o(i.ink(y),u,y?"#d8d6cf":"#1d1d1b")??"#888888",M=l({host:u,canvas:v,kit:g,place:h,ownPoster:i.ownPoster,glyphs:i.glyphs,source:i.source??null,options:()=>({...n,...i.look(y),...k(),ink:w(),interactionTarget:u,label:i.label??""}),onMount:(e,t)=>{i.label||(t.removeAttribute("role"),t.removeAttribute("aria-label"),t.setAttribute("aria-hidden","true")),i.onMount?.()},onRelease:i.onRelease,onFail:()=>{A(),i.onFail?.()}}),R=M.field;let j=!1;const C=()=>{b||(y=t(u),R.update({...n,...i.look(y),...k(),ink:w()}))},P=()=>{j=!1,C()},x=c(()=>{j||b||(j=!0,f(P))});function A(){b||(b=!0,j&&p(P),x(),M.destroy(),m.restore())}return M.start(),M.failed?(A(),null):{field:R,get canvas(){return M.canvas},get live(){return M.live},dark:()=>y,still:()=>!!(i.reducedMotion()??r()),refresh:C,destroy:A}}function m(e,t,n,r,o=()=>{}){let s=!1;const l={get supported(){return!!e()&&!s},get field(){return s?null:e()?.field??null},update(r){if(s)return;t.current=i(t.current,r);const o=r.poster;o&&d(t,o),n(t.current),e()?.refresh()},play(){s||e()?.field.play()},pause(){s||e()?.field.pause()},destroy(){s||(s=!0,o(),e()?.destroy(),u(t))}};return Object.defineProperties(r,Object.getOwnPropertyDescriptors(l))}function v(e,t){const n=Object.assign(document.createElement("canvas"),{width:e,height:t}),r=n.getContext("2d");return r.fillStyle="#000",r.fillRect(0,0,e,t),{canvas:n,pen:r}}function y(e,t,n){if(!t)return void e.pulse({strength:n});if("getBoundingClientRect"in t)return void e.pulse({element:t,strength:n});const r=e.canvas.getBoundingClientRect();e.pulse({x:t.x-r.left,y:t.y-r.top,strength:n})}export{v as blank,h as mountPageField,m as pageHandle,y as pulseAt,g as sleep};//# sourceMappingURL=chunk-7DXSG526.js.map
1
+ import{styleKeeper as e,isDark as t,BASE_LOOK as n,prefersReduced as r,resolveColor as o,mergeOptions as i}from"./chunk-I377LEZA.js";import{poster as s,liveField as l,disposeKit as u,setPosterSource as d}from"./chunk-FEAFQY7O.js";import{isGlyphFieldSupported as a,watchTheme as c,cancelFieldFrame as p,requestFieldFrame as f}from"../field.js";var g=e=>new Promise(t=>setTimeout(t,e));function h(i){const{host:u,layer:d="under",kit:g}=i;if("undefined"==typeof document)return null;const h=`position:absolute;inset:0;width:100%;height:100%;pointer-events:none;border-radius:inherit;z-index:${"under"===d?-1:"auto"}`;if(!a())return g?.current.poster&&!i.ownPoster&&s(u,g.current.poster,h,g),null;const m=e(),v=document.createElement("canvas");"static"===getComputedStyle(u).position&&m.set(u,"position","relative"),"under"===d&&m.set(u,"isolation","isolate"),v.dataset.asciiKit="",v.setAttribute("style",h),u.appendChild(v);let y=t(u),b=!1;const k=()=>{const e=i.reducedMotion();return!0===e?{speed:0,drift:0,respectReducedMotion:!0}:{respectReducedMotion:!1!==e}},w=()=>o(i.ink(y),u,y?"#d8d6cf":"#1d1d1b")??"#888888",R=l({host:u,canvas:v,kit:g,place:h,ownPoster:i.ownPoster,glyphs:i.glyphs,source:i.source??null,options:()=>({...n,...i.look(y),...k(),ink:w(),interactionTarget:u,label:i.label??""}),onMount:(e,t)=>{i.label||(t.removeAttribute("role"),t.removeAttribute("aria-label"),t.setAttribute("aria-hidden","true")),i.onMount?.()},onRelease:i.onRelease,onFail:()=>{C(),i.onFail?.()}}),j=R.field;let A=!1;const M=()=>{b||(y=t(u),j.update({...n,...i.look(y),...k(),ink:w()}))},P=()=>{A=!1,M()},x=c(()=>{A||b||(A=!0,f(P))});function C(){b||(b=!0,A&&p(P),x(),R.destroy(),m.restore())}return R.start(),R.failed?(C(),null):{field:j,get canvas(){return R.canvas},get live(){return R.live},dark:()=>y,still:()=>!!(i.reducedMotion()??r()),refresh:M,destroy:C}}function m(e,t,n,r,o=()=>{}){let s=!1;const l={get supported(){return!!e()&&!s},get field(){return s?null:e()?.field??null},update(r){if(s)return;t.current=i(t.current,r);const o=r.poster;o&&d(t,o),n(t.current),e()?.refresh()},play(){s||e()?.field.play()},pause(){s||e()?.field.pause()},destroy(){s||(s=!0,o(),e()?.destroy(),u(t))}};return Object.defineProperties(r,Object.getOwnPropertyDescriptors(l))}function v(e,t){const n=Object.assign(document.createElement("canvas"),{width:e,height:t}),r=n.getContext("2d");return r.fillStyle="#000",r.fillRect(0,0,e,t),{canvas:n,pen:r}}function y(e,t,n){if(!t)return void e.pulse({strength:n});if("getBoundingClientRect"in t)return void e.pulse({element:t,strength:n});const r=e.canvas.getBoundingClientRect();e.pulse({x:t.x-r.left,y:t.y-r.top,strength:n})}export{v as blank,h as mountPageField,m as pageHandle,y as pulseAt,g as sleep};//# sourceMappingURL=chunk-RGV7VRYC.js.map
@@ -0,0 +1 @@
1
+ import{clamp as A,styleKeeper as t,srOnly as e,mountSurface as n,handle as o,house as a}from"./chunk-I377LEZA.js";var r=null;var i={speed:6,lon:-30,tilt:18,graticule:15,backside:.22,size:.92,drag:!0},c=Math.PI/180,s=A=>((A+180)%360+360)%360-180;function w(t,e,n,o,a,r,i){const{width:w,height:P,data:h}=t,l=Math.min(w,P)/2*o,M=w/2,D=P/2,f=Math.cos(n*c),g=Math.sin(n*c),u=(t,n,o)=>{const a=n*f+o*g,r=-n*g+o*f;return[Math.asin(A(a,-1,1))/c,s(Math.atan2(t,r)/c+e)]};for(let t=0;t<P;t++){const e=(D-t-.5)/l;for(let n=0;n<w;n++){const o=(n+.5-M)/l,s=o*o+e*e,P=4*(t*w+n);let D=0;if(s<=1){const A=Math.sqrt(1-s),[t,n]=u(o,e,A),w=a(t,n);if(D=w>0?w*(.5+.5*A):.05*A,r>0){const e=.7/(l*Math.max(A,.2))/c,o=Math.abs(t-Math.round(t/r)*r),a=Math.abs(n-Math.round(n/r)*r)*Math.cos(t*c);(o<e||a<e)&&(D=Math.max(D,.22*(.4+.6*A)))}if(i>0&&w<=0){const[t,n]=u(o,e,-A),r=a(t,n);r>0&&(D=Math.max(D,r*i*(.35+.65*A)))}}else s<1.1&&(D=.18*(1-(Math.sqrt(s)-1)/(Math.sqrt(1.1)-1)));const f=Math.round(255*A(D));h[P]=h[P+1]=h[P+2]=f,h[P+3]=255}}}function P(A,t,e,n,o,a){const r=Math.min(n,o)/2*a,i=A.lat*c,s=(A.lon-t)*c,w=Math.cos(i)*Math.sin(s),P=Math.sin(i),h=Math.cos(i)*Math.cos(s),l=Math.cos(e*c),M=Math.sin(e*c),D=P*M+h*l;return{x:n/2+w*r,y:o/2-(P*l-h*M)*r,front:D>0,depth:D}}function h(h,l={}){const M={current:{...i,...l}},D=()=>M.current,f=t();let g=D().lon,u=0,d=!1,m=0,p=0,B=0,E=null,v=null,Q=D().tilt;const H=D().label?e(D().label):null,I=(t,e)=>{const n=D().land;if(!n)return function(A,t){if(!r){const A=atob("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAPgP8DAAAAAAAAAAAAAAAAAAAAAACM+/3//wcAAAAgBQACAAAAAAAAAAAAhPfw//8PAPAAAAAAwAMAAAAAAAAAwADEw////wEABAAAAADgAAAAAAAAAABQQT8A/v8PAAAAAAwA/D8AOAEAAAAAcBHvD8D/XwAAAAAgAP7/PwMAABCAAQD4w/4H8P8FAAAAAIJ7//9//xuAAP9ff2479QD/HwAA+A+EN/7//////3/g/////x88+B8AAOD/1//7////////jP////+/+AEfgAcAn9f//////////w/w/////wEs4AEAAHz+////////////gL////8HeAAcAADA5///////////9ADgAf7/f4AnAAAAEHb8////////H0AAAAhA//8f8AcAAIAB4////////38ABwAAAOj//5//AQAAHAT+////////B3AAAAAA/v//+z8AAGDj//////////8CAQAAAMD/////AwAA8P//////////LwAAAAAA4P///2MAAAD+//////////8AAAAAAAD///8/CAAA4P//ff//////JwAAAAAA8P///wYAAAD+/unz/////z8AAAAAAAD///8HAAAA/pgPPP//////MQAAAAAA8P//HwAAAMBD9v7n/////wcAAAAAAAD///8AAAAAPkD6P/7///8hEAAAAAAA4P//DwAAAIDBov/n////f8YAAAAAAAD8//8AAAAA+AdE//////8jDwAAAAAAgP//AwAAAMD/APD/////PxgAAAAAAADw/x8AAAAA/n/v//////8HAAAAAAAAAPwDAgAAAOD///v7////fwAAAAAAAACgHyAAAACA//9/f/7///8DAAAAAAAAAPQBAAAAAPj//+cP+P//HwAAAAAAAAAAHjAAAADA/////g////8EAAAAAAAAAOBhCAAAAPz//99/4B//AAAAAAAAAAAAPAMMAADA////+Qf44BcAAAAAAAAAAAA/AAAAAPz//78fgAf6QAAAAAAAAAAAAA8AAADg////ewA4gA8EAAAAAAAAAADAAAAAAPz//38BgAP4QQAAAAAAAAAAAAgOAADA////zwAwgAwQAAAAAAAAAAAA9Q8AAPj///8HAAFIAAAAAAAAAAAAAID/AQAA////fwBAAAAQAAAAAAAAAAAA+P8AAGDg//8DAAA0GAAAAAAAAAAAAID/HwAAAPj/HwAAgMIBAAAAAAAAAAAA/P8BAACA//8AAAA4XwAAAAAAAAAAAMD/fwAAAPz/BwAAAOOBAQAAAAAAAAAA/P8/AACA/z8AAABgLtQBAAAAAAAAAOD//w8AAPD/AwAAAAQAeAAAAAAAAAAA/P//AQAA/z8AAACAB4APAQAAAAAAAID//w8AAPD/AwAAAAARsEAAAAAAAAAA+P9/AAAA/j8AAAAAAAAAAAAAAAAAAAD//wcAAPD/QwAAAACAIwAAAAAAAAAA8P8/AAAA/z8EAAAAAD4GIAAAAAAAAAD8/wMAAPD/cQAAAAD4fwAAAAAAAAAAgP8/AAAA/w8HAAAAgP8HAAAAAAAAAAD4/wMAAOD/MAAAAAD//wEBAAAAAAAAgP8PAAAA/g8DAAAA+P8fAAAAAAAAAAD4PwAAAOB/MAAAAID//wMAAAAAAAAAgP8DAAAA/AMAAAAA+P9/AAAAAAAAAAD8HwAAAMA/AAAAAID//wcAAAAAAAAAwP8AAAAA+AEAAAAA8P9/AAAAAAAAAAD8DwAAAIAPAAAAAAAP/gMAAAAAAAAAwB8AAAAAAAAAAAAAEMAfAAAAAAAAAAD+AwAAAAAAAAAAAAAA8AEgAAAAAAAA4AcAAAAAAAAAAAAAAAAAAAYAAAAAAABeAAAAAAAAAAAAAAAAwAAwAAAAAAAAwAMAAAAAAAAAAAAAAAAIgAEAAAAAAAAeAAAAAAAAAAAAAAAAAAAMAAAAAAAA4AEAAAAAAAAAAAAAAAAAAAAAAAAAAAAPAAAAAAAAAAABAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAA8AOD/j/sDAAAAAAAAAAA0AAAAAABA/P/h/////w8AAAAAAAAA0AcAAED4////z///////PwAAAAAADgPxAACA/////3////////8HAADA/wP//wMAAP7/////////////BwAA+P////8AAMD//////////////38AAOH/////wQAO/v//////////////BwAA/P////8PAPT//////////////z8AGPH//////+f/////////////////PwDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA");r=new Uint8Array(A.length);for(let t=0;t<A.length;t++)r[t]=A.charCodeAt(t)}const e=180*Math.min(89,Math.max(0,Math.floor((90-A)/2)))+(Math.floor((t+180)/2)%180+180)%180;return!!(r[e>>3]>>(7&e)&1)}(t,e)?1:0;const o=n(t,e);return"boolean"==typeof o?o?1:0:A(o)};let k=null;k=n({host:h,kit:M,look:()=>({mark:"dot",charset:" .:-=+*#%@",cellSize:5,cellAspect:1,dotScale:.86,contrast:1,...D().look}),ink:()=>D().ink??"--ascii-ink-strong",reducedMotion:()=>D().reducedMotion,resolution:(A,t)=>{const e=Math.min(1,320/Math.max(A,t));return[Math.max(8,Math.round(A*e)),Math.max(8,Math.round(t*e))]},onFail:()=>{k=null,f.restore()},paint:({pen:t,width:e,height:n,now:o,still:r})=>{const i=B?Math.min(.1,Math.max(0,o-B)/1e3):0;if(B=o,v){const t=r?1:a(A((o-v.start)/900));g=v.from+(v.to-v.from)*t,Q=v.tiltFrom+(v.tiltTo-v.tiltFrom)*t,t>=1&&(v=null)}else r||d||(g+=D().speed*i+u*i,u*=Math.exp(3*-i),Math.abs(u)<.5&&(u=0));g=s(g),E&&E.width===e&&E.height===n||(E=t.createImageData(e,n)),w(E,g,Q,D().size,I,D().graticule,D().backside),t.putImageData(E,0,0);const c=D().points??[],h=Math.min(e,n)/2*D().size;for(const[A,a]of c.entries()){const i=P(a,g,Q,e,n,D().size);if(!i.front)continue;if(t.fillStyle="#fff",t.beginPath(),t.arc(i.x,i.y,Math.max(1.5,.03*h),0,2*Math.PI),t.fill(),r)continue;const c=(o+537*A)%1800/1800;t.strokeStyle=`rgba(255,255,255,${.9*(1-c)*i.depth})`,t.lineWidth=Math.max(1,.012*h),t.beginPath(),t.arc(i.x,i.y,h*(.03+.12*c),0,2*Math.PI),t.stroke()}return!r&&(0!==D().speed||c.length>0||d||0!==u||!!v)}});const x=A=>{D().drag&&0===A.button&&k&&(d=!0,u=0,v=null,m=A.clientX,p=A.timeStamp||performance.now(),A.currentTarget?.setPointerCapture?.(A.pointerId),k.kick())},z=t=>{if(!d||!k)return;const e=h.getBoundingClientRect(),n=Math.min(e.width,e.height)/2*D().size||1,o=t.timeStamp||performance.now(),a=-(t.clientX-m)/n/c;g+=a,u=o>p?A(a/(o-p)*1e3,-240,240):u,m=t.clientX,p=o,k.kick()},C=()=>{d&&(d=!1,k?.kick())};return k&&(H&&h.appendChild(H),D().drag&&(f.set(h,"touch-action","pan-y"),f.set(h,"cursor","grab")),h.addEventListener("pointerdown",x),h.addEventListener("pointermove",z),h.addEventListener("pointerup",C),h.addEventListener("pointercancel",C)),o(()=>k,M,A=>{void 0===A.tilt||v||(Q=A.tilt),H&&(H.textContent=A.label??""),k?.refresh()},{rotateTo(t,e){if(!k)return void(g=s(t));const n=g+s(t-g);v={from:g,to:n,tiltFrom:Q,tiltTo:void 0===e?Q:A(e,-80,80),start:performance.now()},u=0,k.kick()},get lon(){return s(g)}},()=>{h.removeEventListener("pointerdown",x),h.removeEventListener("pointermove",z),h.removeEventListener("pointerup",C),h.removeEventListener("pointercancel",C),H?.remove(),f.restore()})}export{h as globe,w as globeFrame,P as globeProject};//# sourceMappingURL=chunk-SBAUVRBY.js.map
@@ -0,0 +1 @@
1
+ import{blank as e,mountPageField as t,pageHandle as n}from"./chunk-RGV7VRYC.js";import{house as r,clamp as o,hash as i,styleKeeper as l,entryProgress as c}from"./chunk-I377LEZA.js";import{requestFieldFrame as s}from"../field.js";var a={font:'Georgia, "Times New Roman", serif',fontWeight:600};function h(t,n=a.font,r=a.fontWeight,o=520){const{canvas:i,pen:l}=e(1800,Math.max(1,Math.round(o))),c=Math.min(400,1700/Math.max(3,.56*[...t].length));return l.fillStyle="#fff",l.textAlign="center",l.textBaseline="middle",l.font=`${r} ${c}px ${n}`,l.fillText(t||" ",i.width/2,i.height/2+.05*c),i}var f=24;function u(e,t,n){n.width===e.width&&n.height===e.height||(n.width=e.width,n.height=e.height);const l=n.getContext("2d");if(!l)return n;if(l.globalAlpha=1,l.fillStyle="#000",l.fillRect(0,0,n.width,n.height),t>=1)return l.drawImage(e,0,0),n;const c=Math.ceil(e.width/f),s=Math.ceil(e.height/f);for(let n=0;n<s;n++)for(let s=0;s<c;s++){const a=n*c+s,h=r(o(1.5*t-.5*i(a,3.7)));if(h<=0)continue;const u=(i(a,1.3)-.5)*e.width*.45*(1-h),d=(i(a,2.9)-.5)*e.height*1.4*(1-h);l.globalAlpha=h,l.drawImage(e,s*f,n*f,f,f,s*f+u,n*f+d,f,f)}return l.globalAlpha=1,n}function d(e,r={}){const i=(e.textContent??"").trim(),f={current:{...a,...r}};let d=f.current.text??i;const g=l(),m=()=>h(d,f.current.font,f.current.fontWeight,f.current.artHeight),p=!i;let x=null;x=t({host:e,layer:"over",look:()=>({mark:"glyph",scene:"none",charset:" .:-=+*#%@",font:'"Geist", Arial, sans-serif',fontWeight:500,cellSize:7,cellAspect:.8,glyphScale:.8,color:"ink",shade:0,contrast:1.3,levels:"auto",fit:"contain",focus:{x:.5,y:.5},hover:"trail",trail:{strength:.62,radius:.22},...f.current.look}),ink:()=>f.current.ink??"--ascii-ink-strong",source:m(),label:p?f.current.label??d:void 0,kit:f,reducedMotion:()=>f.current.reducedMotion,onFail:()=>{x=null,g.restore()}}),x&&i&&g.set(e,"color","transparent");const v=document.createElement("canvas");let w=1,b=-1,k=!1;const M=()=>!!f.current.assemble&&!!x&&!x.still(),y=()=>{if(!x)return;const e=m();!M()||w>=1?x.field.setSource(e):(x.field.setSource(u(e,w,v)),x.field.redraw())},A=e=>{k=!1,!x||b<0||(w=o((e-b)/(f.current.duration??1400)),y(),w<1?(k=!0,s(A)):b=-1)},I=()=>{const t=c(e);Math.abs(t-w)<.004||(w=t,y())};let S=!1;const W=!!M()&&f.current.assemble,$="visible"===W&&"function"==typeof IntersectionObserver?new IntersectionObserver(([e])=>{e.isIntersecting&&!S&&M()&&(b=performance.now(),w=0,k||(k=!0,s(A))),S=e.isIntersecting},{threshold:.35}):null;W&&(w=0,y()),$?.observe(e),"scroll"===W&&"undefined"!=typeof window&&(window.addEventListener("scroll",I,{passive:!0}),I()),x&&document.fonts?.load?.(`${f.current.fontWeight} 100px ${f.current.font}`).then(()=>y(),()=>{});const C=t=>{if(t!==d)if(d=t,void 0!==f.current.text&&(f.current={...f.current,text:d}),x)if(y(),p)x.field.update({label:f.current.label??(d||" ")});else{for(const t of[...e.childNodes])t!==x.canvas&&t.remove();e.prepend(document.createTextNode(d))}else i&&(e.textContent=d)};return n(()=>x,f,e=>{void 0!==e.text&&e.text!==d?C(e.text):y()},{setText:C,get text(){return d}},()=>{$?.disconnect(),"scroll"===W&&window.removeEventListener("scroll",I),g.restore()})}export{u as scatterFrame,h as wordArt,d as wordmark};//# sourceMappingURL=chunk-SQNULNT3.js.map
@@ -1 +1 @@
1
- import{injectStyle as e,imageReady as t,imageFor as n,drawCover as a}from"./chunk-PB5E3D4E.js";import{srOnly as o,mountSurface as r,handle as i,isDark as l,clamp as s}from"./chunk-GF72XM4C.js";var c={maxBytes:10485760,develop:900};function d(e,t,n=Math.min(2,"number"==typeof devicePixelRatio&&devicePixelRatio>0?devicePixelRatio:1)){const a=Math.max(2,Math.round(6*n)),o=Math.max(2,Math.round(1*a)),r=(e,t)=>{const a=Math.floor(e*n/t);for(let e=a;e>1;e--){const o=e*t/n;if(Math.abs(o-Math.round(o))<.01||e<a-8)return{n:e,css:Math.round(o)}}return{n:1,css:Math.round(t/n)}},i=r(e,o),l=r(t,a);return{cols:i.n,rows:l.n,w:i.css,h:l.css,cw:o/n,ch:a/n}}function p(e,t,n,a){const{cols:o,rows:r}=t,i=e.createImageData(2*o,2*r),l=i.data,{tone:s,glow:c=0,phase:d=0,near:p=null}=a,h=Math.max(1,n/t.cw),u=Math.max(1,n/t.ch),m=o-2,f=r-2,g=Math.max(0,m-1-2*h),x=Math.max(0,f-1-2*u),v=Math.PI/4*(h+u),y=.45*Math.hypot(o,r);for(let e=0;e<r;e++)for(let t=0;t<o;t++){const n=Math.max(1+h-t,0,t-(m-h)),a=Math.max(1+u-e,0,e-(f-u));let r;if(n>0&&a>0){const e=Math.hypot(n/h,a/u);r=Math.hypot(n,a)*(1-1/e)}else r=-Math.min(t-1,m-t,e-1,f-e);let i=0;if(Math.abs(r)<.5){if(i=s,c>0){const o=t>m-h,r=e>f-u,l=t<1+h,p=e<1+u,y=(e,t)=>Math.atan2(e,t)/(Math.PI/2);let M;M=!p||l||o?p&&o?g+v*y(n/h,a/u):!o||p||r?r&&o?g+v+x+v*y(a/u,n/h):r&&!l?g+2*v+x+(m-h-t):r&&l?2*g+2*v+x+v*y(n/h,a/u):l&&!p?2*g+3*v+x+(f-u-e):2*g+3*v+2*x+v*y(a/u,n/h):g+v+(e-(1+u)):t-(1+h);const b=((M-d)%9+9)%9;i=s+c*(.2+.32*Math.max(0,1-Math.abs(b-4.5)/2.2))}}else if(c>0&&r<-.5&&r>-3.5){i=c*(1-(-r-.5)/3)**1.6*(.1+.32*(p?Math.max(0,1-Math.hypot(t-p.x,e-p.y)/y):.4))}const M=Math.round(255*Math.min(1,i));for(let n=0;n<4;n++){const a=4*((2*e+(n>>1))*o*2+2*t+(1&n));l[a]=l[a+1]=l[a+2]=M,l[a+3]=255}}e.putImageData(i,0,0)}function h(h,u={}){const m={current:{...c,...u}};let f="empty",g=null,x="",v="",y="image",M=0,b=0,w=!1,k=0,C=0,E=0,L=0,R=null,S=null,z=null,$=null,U=null;const j=o("",!0),O=["left","top","width","height"],P=()=>{const e=$?.canvas;if(!e||!h.offsetWidth)return null;const t="empty"===f?d(h.offsetWidth,h.offsetHeight):null,n=t?[`${Math.round((h.offsetWidth-t.w)/2)}px`,`${Math.round((h.offsetHeight-t.h)/2)}px`,`${t.w}px`,`${t.h}px`]:["0px","0px","100%","100%"];let a=!1;return O.forEach((t,o)=>{e.style[t]!==n[o]&&(e.style[t]=n[o],a=!0)}),U=t,a?($?.field.resize(),$?.kick(),null):t},D=document.createElement("input"),B=[j,D];let I=null;const G=!h.children.length;$=r({host:h,layer:"under",look:()=>"empty"===f?{mark:"glyph",charset:" .:+*#",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:6,cellAspect:1,glyphScale:.9,...m.current.look}:{blend:"coarse",mark:"glyph",charset:" .:-=+*#%@",font:'"Geist", Arial, sans-serif',fontWeight:500,cellSize:6,cellAspect:.8,glyphScale:.8,background:l(h)?"transparent":"#0b0b0a",color:"source",saturation:1.15,contrast:1.15,levels:"auto",brightness:.08,hover:"trail",trail:{strength:.6,radius:.3},...m.current.look},ink:e=>m.current.ink??`var(--ascii-ink, ${e?"#7a7872":"#76746e"})`,kit:m,reducedMotion:()=>m.current.reducedMotion,resolution:(e,t)=>"empty"===f&&U?[2*U.cols,2*U.rows]:[Math.max(1,Math.round(e)),Math.max(1,Math.round(t))],onFail:()=>{$=null,x&&A(x)},paint:({pen:e,w:t,h:n,now:o,still:r})=>{if("empty"!==f){if(!g)return!1;const i=r?1:s((o-M)/m.current.develop),l=1-(1-i)**2;return a(e,g,0,0,t,n),"developing"===f&&l<1&&function(e,t,n,a,o){const r=Math.max(Math.hypot(a.x,a.y),Math.hypot(t-a.x,a.y),Math.hypot(a.x,n-a.y),Math.hypot(t-a.x,n-a.y)),i=Math.max(24,.22*Math.min(t,n)),l=o*(r+i),s=Math.max(0,l-i),c=e.createRadialGradient(a.x,a.y,s,a.x,a.y,Math.max(s+1,l));c.addColorStop(0,"rgb(0 0 0 / 0)"),c.addColorStop(1,"rgb(0 0 0 / 1)"),e.globalCompositeOperation="source-over",e.fillStyle=c,e.fillRect(0,0,t,n);const d=e.createRadialGradient(a.x,a.y,s,a.x,a.y,Math.max(s+1,l)),p=1-o*o;d.addColorStop(0,"rgb(255 255 255 / 0)"),d.addColorStop(.55,`rgb(255 255 255 / ${.5*p})`),d.addColorStop(1,"rgb(255 255 255 / 0)"),e.globalCompositeOperation="lighter",e.fillStyle=d,e.fillRect(0,0,t,n),e.globalCompositeOperation="source-over"}(e,t,n,z??{x:t/2,y:n/2},l),i>=1&&"developing"===f&&N(),i<1}const i=E?Math.min(64,o-E):16;E=o;const l=w?1:0;C=r?l:C+(l-C)*(1-Math.exp(-i/90)),!r&&C>.004&&(L+=i/1e3*14);const c=Math.max(4,(parseFloat(getComputedStyle(h).borderTopLeftRadius)||16)-6),d=P();if(d){const t=$.canvas.getBoundingClientRect(),n=S&&t.width?{x:(S.x-t.left)/t.width*d.cols,y:(S.y-t.top)/t.height*d.rows}:null;p(e,d,c,{tone:.3,glow:C,phase:L,near:n})}const u=!r&&(w||Math.abs(l-C)>.004);return u||(E=0),u}});const W=e=>{const t=f;f=e,h.dataset.state=e,"empty"===t!=("empty"===e)&&(P(),$?.refresh()),t!==e&&m.current.onState?.(e,"empty"===e?"":y)},N=()=>{W("done"),j.textContent=`${y} ready`,g&&m.current.onImage?.({file:R,src:x,width:g.width,height:g.height})};function A(e){I??(I=Object.assign(document.createElement("img"),{className:"ascii-drop-img",alt:""})),I.src=e,I.parentElement!==h&&(h.prepend(I),B.push(I))}const F=async(e,a=null,o=null)=>{const r=++b;let i;z=o,v&&URL.revokeObjectURL(v),v="string"==typeof e?"":URL.createObjectURL(e),x=v||e,R=a??("undefined"!=typeof File&&e instanceof File?e:null),y=R?.name??("string"==typeof e&&e.split("/").pop()?.split("?")[0]||"image"),j.textContent=`Converting ${y}`;try{i=await t(n(x))}catch{return void(r===b&&(j.textContent=`Could not load ${y}`))}if(r===b){if(g=i,!$)return A(x),W("done"),void N();M=performance.now(),W($.still()?"done":"developing"),$.field.pulse({strength:1}),$.kick(),"done"===f&&N()}},T=(e,t=null)=>{const n=t=>{j.textContent=t,m.current.onError?.(t,e)};return e.type.startsWith("image/")?e.size>m.current.maxBytes?n(`${e.name} is over ${Math.round(m.current.maxBytes/1024/1024)} MB.`):void F(e,e,t):n(`${e.name} isn’t an image.`)},X=()=>{b++,g=null,x="",R=null,v&&URL.revokeObjectURL(v),v="",I?.remove(),W("empty"),j.textContent="",$?.kick()},Y=()=>D.click(),H=e=>new Promise(t=>{const n=$?.field;if(!n||!g||"done"!==f)return void t(null);const a=document.createElement("canvas");a.width=n.canvas.width,a.height=n.canvas.height;const o=a.getContext("2d");o?(o.fillStyle=getComputedStyle(h).backgroundColor||"#000",o.fillRect(0,0,a.width,a.height),n.redraw(),o.drawImage(n.canvas,0,0),a.toBlob(n=>{if(n){const t=document.createElement("a");t.href=URL.createObjectURL(n),t.download=e??m.current.filename??`${y.replace(/\.[^.]+$/,"")}-ascii.png`,t.click(),setTimeout(()=>URL.revokeObjectURL(t.href),1e3)}t(n)},"image/png")):t(null)}),J=()=>{E=0,$?.kick()},q=e=>{e.preventDefault(),k++,S={x:e.clientX,y:e.clientY},w||(w=!0,h.dataset.over="",J())},K=e=>{e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy"),S={x:e.clientX,y:e.clientY}},Q=()=>{k=Math.max(0,k-1),!k&&w&&(w=!1,S=null,delete h.dataset.over,J())},V=e=>{e.preventDefault(),k=0,w=!1,S=null,delete h.dataset.over;const t=h.getBoundingClientRect(),n={x:e.clientX-t.left,y:e.clientY-t.top};$?.field.pulse({...n,strength:1});const a=e.dataTransfer?.files?.[0];a?T(a,n):J()},Z=e=>{const t=e.target?.closest?.("[data-dropzone]")?.getAttribute("data-dropzone");"pick"===t?Y():"clear"===t?X():"download"===t&&H()},_=()=>{const e=D.files?.[0];D.value="",e&&T(e)};e("ascii-kit-dropzone",'\n:where(.ascii-drop-empty){position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;height:100%;min-height:inherit;padding:24px;box-sizing:border-box;text-align:center}\n:where([data-ascii-dropzone]:not([data-state="empty"])) :where(.ascii-drop-empty){display:none}\n:where(.ascii-drop-title){margin:0;font-weight:500}\n:where(.ascii-drop-hint){margin:0;font-size:14px;opacity:.65}\n:where(.ascii-drop-pick){margin-top:8px;height:34px;padding:0 14px;border:0;border-radius:999px;background:currentColor;font:inherit;font-size:14px;cursor:pointer}\n:where(.ascii-drop-pick) > span{color:Canvas}\n:where(.ascii-drop-img){position:absolute;inset:0;width:100%;height:100%;object-fit:cover}\n'),h.dataset.asciiDropzone="",D.type="file",D.accept="image/*",D.tabIndex=-1,D.hidden=!0,D.setAttribute("aria-hidden","true"),G&&B.push(function(){const e=document.createElement("div"),t=document.createElement("p"),n=document.createElement("p"),a=document.createElement("button"),o=document.createElement("span");return e.className="ascii-drop-empty",t.className="ascii-drop-title",t.textContent="Drop an image",n.className="ascii-drop-hint",n.textContent="PNG, JPG or WebP",a.type="button",a.className="ascii-drop-pick",a.dataset.dropzone="pick",o.textContent="Choose file",a.appendChild(o),e.append(t,n,a),e}());for(const e of B)h.appendChild(e);return W("empty"),h.addEventListener("dragenter",q),h.addEventListener("dragover",K),h.addEventListener("dragleave",Q),h.addEventListener("drop",V),h.addEventListener("click",Z),D.addEventListener("change",_),i(()=>$,m,()=>$?.refresh(),{setImage:e=>F(e),clear:X,pick:Y,download:H,get state(){return f}},()=>{b++,v&&URL.revokeObjectURL(v),h.removeEventListener("dragenter",q),h.removeEventListener("dragover",K),h.removeEventListener("dragleave",Q),h.removeEventListener("drop",V),h.removeEventListener("click",Z),D.removeEventListener("change",_),B.forEach(e=>e.remove()),delete h.dataset.asciiDropzone,delete h.dataset.state,delete h.dataset.over})}var u=c;export{u as DROPZONE_DEFAULTS,h as dropzone,p as paintRing,d as ringGrid};//# sourceMappingURL=chunk-HYVTFKWX.js.map
1
+ import{injectStyle as e,imageReady as t,imageFor as n,drawCover as a}from"./chunk-DKRZSP5K.js";import{srOnly as o,mountSurface as r,handle as i,isDark as l,clamp as s}from"./chunk-I377LEZA.js";var c={maxBytes:10485760,develop:900};function d(e,t,n=Math.min(2,"number"==typeof devicePixelRatio&&devicePixelRatio>0?devicePixelRatio:1)){const a=Math.max(2,Math.round(6*n)),o=Math.max(2,Math.round(1*a)),r=(e,t)=>{const a=Math.floor(e*n/t);for(let e=a;e>1;e--){const o=e*t/n;if(Math.abs(o-Math.round(o))<.01||e<a-8)return{n:e,css:Math.round(o)}}return{n:1,css:Math.round(t/n)}},i=r(e,o),l=r(t,a);return{cols:i.n,rows:l.n,w:i.css,h:l.css,cw:o/n,ch:a/n}}function p(e,t,n,a){const{cols:o,rows:r}=t,i=e.createImageData(2*o,2*r),l=i.data,{tone:s,glow:c=0,phase:d=0,near:p=null}=a,h=Math.max(1,n/t.cw),u=Math.max(1,n/t.ch),m=o-2,f=r-2,g=Math.max(0,m-1-2*h),x=Math.max(0,f-1-2*u),v=Math.PI/4*(h+u),y=.45*Math.hypot(o,r);for(let e=0;e<r;e++)for(let t=0;t<o;t++){const n=Math.max(1+h-t,0,t-(m-h)),a=Math.max(1+u-e,0,e-(f-u));let r;if(n>0&&a>0){const e=Math.hypot(n/h,a/u);r=Math.hypot(n,a)*(1-1/e)}else r=-Math.min(t-1,m-t,e-1,f-e);let i=0;if(Math.abs(r)<.5){if(i=s,c>0){const o=t>m-h,r=e>f-u,l=t<1+h,p=e<1+u,y=(e,t)=>Math.atan2(e,t)/(Math.PI/2);let M;M=!p||l||o?p&&o?g+v*y(n/h,a/u):!o||p||r?r&&o?g+v+x+v*y(a/u,n/h):r&&!l?g+2*v+x+(m-h-t):r&&l?2*g+2*v+x+v*y(n/h,a/u):l&&!p?2*g+3*v+x+(f-u-e):2*g+3*v+2*x+v*y(a/u,n/h):g+v+(e-(1+u)):t-(1+h);const b=((M-d)%9+9)%9;i=s+c*(.2+.32*Math.max(0,1-Math.abs(b-4.5)/2.2))}}else if(c>0&&r<-.5&&r>-3.5){i=c*(1-(-r-.5)/3)**1.6*(.1+.32*(p?Math.max(0,1-Math.hypot(t-p.x,e-p.y)/y):.4))}const M=Math.round(255*Math.min(1,i));for(let n=0;n<4;n++){const a=4*((2*e+(n>>1))*o*2+2*t+(1&n));l[a]=l[a+1]=l[a+2]=M,l[a+3]=255}}e.putImageData(i,0,0)}function h(h,u={}){const m={current:{...c,...u}};let f="empty",g=null,x="",v="",y="image",M=0,b=0,w=!1,k=0,C=0,E=0,L=0,R=null,S=null,z=null,$=null,U=null;const j=o("",!0),O=["left","top","width","height"],P=()=>{const e=$?.canvas;if(!e||!h.offsetWidth)return null;const t="empty"===f?d(h.offsetWidth,h.offsetHeight):null,n=t?[`${Math.round((h.offsetWidth-t.w)/2)}px`,`${Math.round((h.offsetHeight-t.h)/2)}px`,`${t.w}px`,`${t.h}px`]:["0px","0px","100%","100%"];let a=!1;return O.forEach((t,o)=>{e.style[t]!==n[o]&&(e.style[t]=n[o],a=!0)}),U=t,a?($?.field.resize(),$?.kick(),null):t},D=document.createElement("input"),I=[j,D];let B=null;const W=!h.children.length;$=r({host:h,layer:"under",look:()=>"empty"===f?{mark:"glyph",charset:" .:+*#",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:6,cellAspect:1,glyphScale:.9,...m.current.look}:{blend:"coarse",mark:"glyph",charset:" .:-=+*#%@",font:'"Geist", Arial, sans-serif',fontWeight:500,cellSize:6,cellAspect:.8,glyphScale:.8,background:l(h)?"transparent":"#0b0b0a",color:"source",saturation:1.15,contrast:1.15,levels:"auto",brightness:.08,hover:"trail",trail:{strength:.6,radius:.3},...m.current.look},ink:e=>m.current.ink??`var(--ascii-ink, ${e?"#7a7872":"#76746e"})`,kit:m,reducedMotion:()=>m.current.reducedMotion,resolution:(e,t)=>"empty"===f&&U?[2*U.cols,2*U.rows]:[Math.max(1,Math.round(e)),Math.max(1,Math.round(t))],onFail:()=>{$=null,x&&N(x)},paint:({pen:e,w:t,h:n,now:o,still:r})=>{if("empty"!==f){if(!g)return!1;const i=r?1:s((o-M)/m.current.develop),l=1-(1-i)**2;return a(e,g,0,0,t,n),"developing"===f&&l<1&&function(e,t,n,a,o){const r=Math.max(Math.hypot(a.x,a.y),Math.hypot(t-a.x,a.y),Math.hypot(a.x,n-a.y),Math.hypot(t-a.x,n-a.y)),i=Math.max(24,.22*Math.min(t,n)),l=o*(r+i),s=Math.max(0,l-i),c=e.createRadialGradient(a.x,a.y,s,a.x,a.y,Math.max(s+1,l));c.addColorStop(0,"rgb(0 0 0 / 0)"),c.addColorStop(1,"rgb(0 0 0 / 1)"),e.globalCompositeOperation="source-over",e.fillStyle=c,e.fillRect(0,0,t,n);const d=e.createRadialGradient(a.x,a.y,s,a.x,a.y,Math.max(s+1,l)),p=1-o*o;d.addColorStop(0,"rgb(255 255 255 / 0)"),d.addColorStop(.55,`rgb(255 255 255 / ${.5*p})`),d.addColorStop(1,"rgb(255 255 255 / 0)"),e.globalCompositeOperation="lighter",e.fillStyle=d,e.fillRect(0,0,t,n),e.globalCompositeOperation="source-over"}(e,t,n,z??{x:t/2,y:n/2},l),i>=1&&"developing"===f&&G(),i<1}const i=E?Math.min(64,o-E):16;E=o;const l=w?1:0;C=r?l:C+(l-C)*(1-Math.exp(-i/90)),!r&&C>.004&&(L+=i/1e3*14);const c=Math.max(4,(parseFloat(getComputedStyle(h).borderTopLeftRadius)||16)-6),d=P();if(d){const t=$.canvas.getBoundingClientRect(),n=S&&t.width?{x:(S.x-t.left)/t.width*d.cols,y:(S.y-t.top)/t.height*d.rows}:null;p(e,d,c,{tone:.3,glow:C,phase:L,near:n})}const u=!r&&(w||Math.abs(l-C)>.004);return u||(E=0),u}});const A=e=>{const t=f;f=e,h.dataset.state=e,"empty"===t!=("empty"===e)&&(P(),$?.refresh()),t!==e&&m.current.onState?.(e,"empty"===e?"":y)},G=()=>{A("done"),j.textContent=`${y} ready`,g&&m.current.onImage?.({file:R,src:x,width:g.width,height:g.height})};function N(e){B??(B=Object.assign(document.createElement("img"),{className:"ascii-drop-img",alt:""})),B.src=e,B.parentElement!==h&&(h.prepend(B),I.push(B))}const T=async(e,a=null,o=null)=>{const r=++b;let i;z=o,v&&URL.revokeObjectURL(v),v="string"==typeof e?"":URL.createObjectURL(e),x=v||e,R=a??("undefined"!=typeof File&&e instanceof File?e:null),y=R?.name??("string"==typeof e&&e.split("/").pop()?.split("?")[0]||"image"),j.textContent=`Converting ${y}`;try{i=await t(n(x))}catch{return void(r===b&&(j.textContent=`Could not load ${y}`))}if(r===b){if(g=i,!$)return N(x),A("done"),void G();M=performance.now(),A($.still()?"done":"developing"),$.field.pulse({strength:1}),$.kick(),"done"===f&&G()}},F=(e,t=null)=>{const n=t=>{j.textContent=t,m.current.onError?.(t,e)};return e.type.startsWith("image/")?e.size>m.current.maxBytes?n(`${e.name} is over ${Math.round(m.current.maxBytes/1024/1024)} MB.`):void T(e,e,t):n(`${e.name} isn’t an image.`)},X=()=>{b++,g=null,x="",R=null,v&&URL.revokeObjectURL(v),v="",B?.remove(),A("empty"),j.textContent="",$?.kick()},Y=()=>D.click(),H=e=>new Promise(t=>{const n=$?.field;if(!n||!g||"done"!==f)return void t(null);const a=document.createElement("canvas");a.width=n.canvas.width,a.height=n.canvas.height;const o=a.getContext("2d");o?(o.fillStyle=getComputedStyle(h).backgroundColor||"#000",o.fillRect(0,0,a.width,a.height),n.redraw(),o.drawImage(n.canvas,0,0),a.toBlob(n=>{if(n){const t=document.createElement("a");t.href=URL.createObjectURL(n),t.download=e??m.current.filename??`${y.replace(/\.[^.]+$/,"")}-ascii.png`,t.click(),setTimeout(()=>URL.revokeObjectURL(t.href),1e3)}t(n)},"image/png")):t(null)}),K=()=>{E=0,$?.kick()},Z=e=>{e.preventDefault(),k++,S={x:e.clientX,y:e.clientY},w||(w=!0,h.dataset.over="",K())},J=e=>{e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy"),S={x:e.clientX,y:e.clientY}},q=()=>{k=Math.max(0,k-1),!k&&w&&(w=!1,S=null,delete h.dataset.over,K())},Q=e=>{e.preventDefault(),k=0,w=!1,S=null,delete h.dataset.over;const t=h.getBoundingClientRect(),n={x:e.clientX-t.left,y:e.clientY-t.top};$?.field.pulse({...n,strength:1});const a=e.dataTransfer?.files?.[0];a?F(a,n):K()},V=e=>{const t=e.target?.closest?.("[data-dropzone]")?.getAttribute("data-dropzone");"pick"===t?Y():"clear"===t?X():"download"===t&&H()},_=()=>{const e=D.files?.[0];D.value="",e&&F(e)};e("ascii-kit-dropzone",'\n:where(.ascii-drop-empty){position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;height:100%;min-height:inherit;padding:24px;box-sizing:border-box;text-align:center}\n:where([data-ascii-dropzone]:not([data-state="empty"])) :where(.ascii-drop-empty){display:none}\n:where(.ascii-drop-title){margin:0;font-weight:500}\n:where(.ascii-drop-hint){margin:0;font-size:14px;opacity:.65}\n:where(.ascii-drop-pick){margin-top:8px;height:34px;padding:0 14px;border:0;border-radius:999px;background:currentColor;font:inherit;font-size:14px;cursor:pointer}\n:where(.ascii-drop-pick) > span{color:Canvas}\n:where(.ascii-drop-img){position:absolute;inset:0;width:100%;height:100%;object-fit:cover}\n'),h.dataset.asciiDropzone="",D.type="file",D.accept="image/*",D.tabIndex=-1,D.hidden=!0,D.setAttribute("aria-hidden","true"),W&&I.push(function(){const e=document.createElement("div"),t=document.createElement("p"),n=document.createElement("p"),a=document.createElement("button"),o=document.createElement("span");return e.className="ascii-drop-empty",t.className="ascii-drop-title",t.textContent="Drop an image",n.className="ascii-drop-hint",n.textContent="PNG, JPG or WebP",a.type="button",a.className="ascii-drop-pick",a.dataset.dropzone="pick",o.textContent="Choose file",a.appendChild(o),e.append(t,n,a),e}());for(const e of I)h.appendChild(e);return A("empty"),h.addEventListener("dragenter",Z),h.addEventListener("dragover",J),h.addEventListener("dragleave",q),h.addEventListener("drop",Q),h.addEventListener("click",V),D.addEventListener("change",_),i(()=>$,m,()=>$?.refresh(),{setImage:e=>T(e),clear:X,pick:Y,download:H,get state(){return f}},()=>{b++,v&&URL.revokeObjectURL(v),h.removeEventListener("dragenter",Z),h.removeEventListener("dragover",J),h.removeEventListener("dragleave",q),h.removeEventListener("drop",Q),h.removeEventListener("click",V),D.removeEventListener("change",_),I.forEach(e=>e.remove()),delete h.dataset.asciiDropzone,delete h.dataset.state,delete h.dataset.over})}var u=c;export{u as DROPZONE_DEFAULTS,h as dropzone,p as paintRing,d as ringGrid};//# sourceMappingURL=chunk-TJHSBZBF.js.map
@@ -1 +1 @@
1
- import{velocity as t,stepSpring as e}from"./chunk-K6JX64AS.js";import{clamp as r,styleKeeper as n,mountSurface as o,handle as a,prefersReduced as i}from"./chunk-GF72XM4C.js";var l={cards:"[data-card]",loop:!0,threshold:.4,outset:56},h=(t,e,r)=>t+(e-t)*r,s=(t,e,r)=>({x:t,v:0,to:t,k:e,z:r}),c=Array.from({length:96},(t,e)=>{const r=43758.5453*Math.sin(127.1*e+311.7);return r-Math.floor(r)});function d(t,e,n=.04){if(!t.complete||!t.naturalWidth)return null;const o=Math.min(1,420/Math.max(t.naturalWidth,t.naturalHeight)),a=document.createElement("canvas");a.width=Math.max(1,Math.round(t.naturalWidth*o)),a.height=Math.max(1,Math.round(t.naturalHeight*o));const i=a.getContext("2d",{willReadFrequently:!0});if(!i)return null;try{i.drawImage(t,0,0,a.width,a.height);const o=i.getImageData(0,0,a.width,a.height),l=o.data,h=new Uint32Array(256),s=l.length/4,c=t=>.2126*l[t]+.7152*l[t+1]+.0722*l[t+2];for(let t=0;t<l.length;t+=4)h[Math.round(c(t))]++;let d=0,u=255,g=0;for(let t=0;t<256;t++)if(g+=h[t],g>=.02*s){d=t;break}g=0;for(let t=255;t>=0;t--)if(g+=h[t],g>=.02*s){u=t;break}const m=Math.max(1,u-d);for(let t=0;t<l.length;t+=4){let o=r((c(t)-d)/m);e&&(o=1-o),l[t]=l[t+1]=l[t+2]=Math.round(255*(n+(1-n)*o)),l[t+3]=255}return i.putImageData(o,0,0),a}catch{return null}}function u(u,g={}){const m={current:{...l,...g}},p=n(),f=()=>!!(m.current.reducedMotion??i()),v=()=>[...u.querySelectorAll(m.current.cards)];let x=0,M=s(0,380,.72),w=s(0,380,.8),b=s(0,260,.9),y=!1,k=0,A=0,E=null,L=[],I=0,S=0,C=-1,$=new Map,R=null,F=null;const W=t=>v()[D(t)]??null,q=()=>u.clientWidth||160,D=t=>{const e=v().length;return e?(t%e+e)%e:0},P=(t,e,r,n)=>{const o=W(t);if(!o||!m.current.loop&&t>=v().length)return null;const a="IMG"===o.tagName?o:o.querySelector("img"),i=`${a?.currentSrc||a?.src||""}|${a?.complete}|${Math.round(e)}x${Math.round(r)}|${n}`,l=$.get(o);if(l?.key===i)return l.canvas;const h=document.createElement("canvas");h.width=Math.max(1,Math.round(e)),h.height=Math.max(1,Math.round(r));const s=h.getContext("2d");if(!s)return null;const c=m.current.radius??(parseFloat(getComputedStyle(u).borderTopLeftRadius)||16);s.beginPath(),s.roundRect(0,0,h.width,h.height,Math.min(c,h.width/2,h.height/2)),s.clip();const g=a?d(a,n):null;if(g){const t=Math.max(h.width/g.width,h.height/g.height),e=h.width/t,r=h.height/t;s.drawImage(g,(g.width-e)/2,(g.height-r)/2,e,r,0,0,h.width,h.height)}else s.fillStyle="rgb(60 60 60)",s.fillRect(0,0,h.width,h.height);return s.strokeStyle="rgb(150 150 150)",s.lineWidth=6,s.stroke(),$.set(o,{key:i,canvas:h}),h};function T(){const t=v(),e=x+(E?1:0),r=!m.current.loop&&e>=t.length?null:W(e);t.forEach(t=>{F?(p.set(t,"opacity","0"),t!==r?t.setAttribute("aria-hidden","true"):t.removeAttribute("aria-hidden")):t.hidden=t!==r}),u.setAttribute("aria-label",r?`${r.getAttribute("aria-label")||r.querySelector("img")?.alt||r.textContent?.trim()||"Card"}. Left arrow to pass, right arrow to keep.`:"No more cards")}F=o({host:u,outset:m.current.outset,look:()=>({blend:"coarse",mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:4,cellAspect:.62,glyphScale:.94,contrast:1.3,...m.current.look}),ink:()=>m.current.ink??"--ascii-ink-strong",kit:m,reducedMotion:()=>m.current.reducedMotion,onFail:()=>{F=null,p.restore(),T()},onTheme:()=>{$=new Map},paint:({pen:t,w:e,now:n,dark:o,box:a})=>{const i=a(u),l=i.w,s=i.h,d=i.x+l/2,g=i.y+s/2,m=r(b.x),p=(e,r,n,a,i=0)=>{const h=P(e,l,s,!o);!h||a<=0||(t.save(),t.translate(d,g+n),t.scale(r,r),t.globalAlpha=a,t.drawImage(h,-l/2,-s/2),i>0&&(t.globalCompositeOperation="destination-out",t.globalAlpha=i,t.drawImage(((t,e)=>{let r=R;if(!r||r.width!==Math.round(t)||r.height!==Math.round(e)){r=R=document.createElement("canvas"),r.width=Math.max(1,Math.round(t)),r.height=Math.max(1,Math.round(e));const n=r.getContext("2d");if(n)for(let t=0;t<r.height;t+=6)for(let e=0;e<r.width;e+=4){const r=43758.5453*Math.sin(12.9898*e+78.233*t);r-Math.floor(r)<.55&&(n.fillStyle="#000",n.fillRect(e,t,4,6))}}return r})(l,s),-l/2,-s/2)),t.restore())};p(x+2,h(.86,.93,m),h(24,12,m),h(.3,.55,m),.3),p(x+1,h(.93,1,m),h(12,0,m),h(.55,1,m),.4*(1-m));const f=P(x,l,s,!o);if(!f)return!1;const v=E?r((n-E.start)/620):0,y=E?.dir??1,k=E?E.x0+y*l*.9*(1-(1-v)**3):M.x,A=E?E.y0:w.x;if(t.save(),t.translate(d+k,g+A),t.rotate(.22*r(k/l,-1.6,1.6)),!E)return t.drawImage(f,-l/2,-s/2),t.restore(),!1;const L=Math.ceil(s/6);for(let n=0;n<L;n++){const o=c[n%c.length],a=r(1.55*v-.55*o);if(a>=1)continue;const i=y*a*a*l*(.5+.9*o),h=6*n,u=Math.min(6,s-h),g=y>0?d+k+i+.62*l:d+k+i-.62*l,m=y>0?e-4-g:g-4;t.globalAlpha=(1-a*a)*r(m/56),t.drawImage(f,0,h,l,u,-l/2+i,-s/2+h,l,u)}return t.restore(),!1}});const X=t=>{I=0;const n=Math.min(1/30,Math.max(0,(t-S)/1e3));S=t;let o=!1;y||E||(o=e(M,n,.3),o=e(w,n,.3)||o),o=e(b,n,.002)||o,E&&t-E.start>=620&&(E=null,x+=1,j()),(()=>{(m.current.leanTarget??u).style.setProperty("--ascii-lean",String(E?0:r(M.x/(.4*q()),-1,1)));const t=W(x);!F&&t&&p.set(t,"transform",`translate(${M.x}px, ${w.x}px) rotate(${.22*r(M.x/q(),-1.6,1.6)}rad)`)})(),F?.kick(),(o||y||E)&&(I=requestAnimationFrame(X))},G=()=>{I||(S=performance.now(),I=requestAnimationFrame(X))},j=()=>{M=s(0,380,.72),w=s(0,380,.8),b=s(0,260,.9)},z=(t=1)=>{const e=v();if(E||!e.length||!m.current.loop&&x>=e.length)return!1;const r=W(x),n=D(x);return y=!1,f()||!F?(x+=1,j(),F||p.set(r,"transform","")):(E={dir:t,start:performance.now(),x0:M.x,y0:w.x},b.to=1),T(),G(),m.current.onSwipe?.(t,n,r),!0},H=e=>{if(!y||void 0!==e&&void 0!==e.pointerId&&e.pointerId!==C)return;y=!1;const n=t(L,performance.now()),o=q();Math.abs(M.x)>o*m.current.threshold||Math.abs(n)>650&&Math.sign(n)===Math.sign(M.x)&&Math.abs(M.x)>16?z(M.x<0?-1:1):(M.to=0,w.to=0,b.to=0,M.v=.2*r(n,-1600,1600),f()&&(M.x=w.x=b.x=0,M.v=w.v=b.v=0),G())},N=()=>u.getBoundingClientRect().width/(u.clientWidth||1)||1,Y=t=>{if(0!==t.button||E)return;try{u.setPointerCapture?.(t.pointerId)}catch{}C=t.pointerId;const e=N();y=!0,k=t.clientX-M.x*e,A=t.clientY-w.x/.3*e,L=[],G()},B=t=>{if(!y||t.pointerId!==C)return;const e=N();M.x=M.to=(t.clientX-k)/e,w.x=w.to=(t.clientY-A)/e*.3,M.v=w.v=0,b.to=.5*r(Math.abs(M.x)/q()),L.push([M.x,performance.now()]),L.length>8&&L.shift(),G()},J=t=>{"ArrowLeft"!==t.key&&"ArrowRight"!==t.key||(t.preventDefault(),z("ArrowRight"===t.key?1:-1))},K=()=>F?.kick(),O=t=>t.preventDefault();return u.hasAttribute("tabindex")||(u.tabIndex=0),u.setAttribute("role",u.getAttribute("role")??"group"),u.setAttribute("aria-roledescription","card"),p.set(u,"touch-action","none"),T(),u.addEventListener("pointerdown",Y),u.addEventListener("pointermove",B),u.addEventListener("pointerup",H),u.addEventListener("pointercancel",H),u.addEventListener("lostpointercapture",H),u.addEventListener("keydown",J),u.addEventListener("load",K,!0),u.addEventListener("dragstart",O),a(()=>F,m,()=>{$=new Map,T(),F?.refresh()},{next:z,get index(){return D(x+(E?1:0))}},()=>{I&&cancelAnimationFrame(I),I=0,p.restore(),v().forEach(t=>{t.hidden=!1,t.removeAttribute("aria-hidden")}),(m.current.leanTarget??u).style.removeProperty("--ascii-lean"),u.removeAttribute("aria-roledescription"),u.removeEventListener("pointerdown",Y),u.removeEventListener("pointermove",B),u.removeEventListener("pointerup",H),u.removeEventListener("pointercancel",H),u.removeEventListener("lostpointercapture",H),u.removeEventListener("keydown",J),u.removeEventListener("load",K,!0),u.removeEventListener("dragstart",O)})}var g=l;export{g as SWIPE_DECK_DEFAULTS,u as swipeDeck,d as toneImage};//# sourceMappingURL=chunk-FWODCYYJ.js.map
1
+ import{velocity as t,stepSpring as e}from"./chunk-FU4WW3PU.js";import{clamp as r,styleKeeper as n,mountSurface as o,handle as a,prefersReduced as i}from"./chunk-I377LEZA.js";var l={cards:"[data-card]",loop:!0,threshold:.4,outset:56},h=(t,e,r)=>t+(e-t)*r,s=(t,e,r)=>({x:t,v:0,to:t,k:e,z:r}),c=Array.from({length:96},(t,e)=>{const r=43758.5453*Math.sin(127.1*e+311.7);return r-Math.floor(r)});function d(t,e,n=.04){if(!t.complete||!t.naturalWidth)return null;const o=Math.min(1,420/Math.max(t.naturalWidth,t.naturalHeight)),a=document.createElement("canvas");a.width=Math.max(1,Math.round(t.naturalWidth*o)),a.height=Math.max(1,Math.round(t.naturalHeight*o));const i=a.getContext("2d",{willReadFrequently:!0});if(!i)return null;try{i.drawImage(t,0,0,a.width,a.height);const o=i.getImageData(0,0,a.width,a.height),l=o.data,h=new Uint32Array(256),s=l.length/4,c=t=>.2126*l[t]+.7152*l[t+1]+.0722*l[t+2];for(let t=0;t<l.length;t+=4)h[Math.round(c(t))]++;let d=0,u=255,g=0;for(let t=0;t<256;t++)if(g+=h[t],g>=.02*s){d=t;break}g=0;for(let t=255;t>=0;t--)if(g+=h[t],g>=.02*s){u=t;break}const m=Math.max(1,u-d);for(let t=0;t<l.length;t+=4){let o=r((c(t)-d)/m);e&&(o=1-o),l[t]=l[t+1]=l[t+2]=Math.round(255*(n+(1-n)*o)),l[t+3]=255}return i.putImageData(o,0,0),a}catch{return null}}function u(u,g={}){const m={current:{...l,...g}},p=n(),f=()=>!!(m.current.reducedMotion??i()),v=()=>[...u.querySelectorAll(m.current.cards)];let x=0,M=s(0,380,.72),w=s(0,380,.8),b=s(0,260,.9),y=!1,k=0,A=0,E=null,L=[],I=0,S=0,C=-1,W=new Map,$=null,R=null;const F=t=>v()[P(t)]??null,q=()=>u.clientWidth||160,P=t=>{const e=v().length;return e?(t%e+e)%e:0},D=(t,e,r,n)=>{const o=F(t);if(!o||!m.current.loop&&t>=v().length)return null;const a="IMG"===o.tagName?o:o.querySelector("img"),i=`${a?.currentSrc||a?.src||""}|${a?.complete}|${Math.round(e)}x${Math.round(r)}|${n}`,l=W.get(o);if(l?.key===i)return l.canvas;const h=document.createElement("canvas");h.width=Math.max(1,Math.round(e)),h.height=Math.max(1,Math.round(r));const s=h.getContext("2d");if(!s)return null;const c=m.current.radius??(parseFloat(getComputedStyle(u).borderTopLeftRadius)||16);s.beginPath(),s.roundRect(0,0,h.width,h.height,Math.min(c,h.width/2,h.height/2)),s.clip();const g=a?d(a,n):null;if(g){const t=Math.max(h.width/g.width,h.height/g.height),e=h.width/t,r=h.height/t;s.drawImage(g,(g.width-e)/2,(g.height-r)/2,e,r,0,0,h.width,h.height)}else s.fillStyle="rgb(60 60 60)",s.fillRect(0,0,h.width,h.height);return s.strokeStyle="rgb(150 150 150)",s.lineWidth=6,s.stroke(),W.set(o,{key:i,canvas:h}),h};function T(){const t=v(),e=x+(E?1:0),r=!m.current.loop&&e>=t.length?null:F(e);t.forEach(t=>{R?(p.set(t,"opacity","0"),t!==r?t.setAttribute("aria-hidden","true"):t.removeAttribute("aria-hidden")):t.hidden=t!==r}),u.setAttribute("aria-label",r?`${r.getAttribute("aria-label")||r.querySelector("img")?.alt||r.textContent?.trim()||"Card"}. Left arrow to pass, right arrow to keep.`:"No more cards")}R=o({host:u,outset:m.current.outset,look:()=>({blend:"coarse",mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:4,cellAspect:.62,glyphScale:.94,contrast:1.3,...m.current.look}),ink:()=>m.current.ink??"--ascii-ink-strong",kit:m,reducedMotion:()=>m.current.reducedMotion,onFail:()=>{R=null,p.restore(),T()},onTheme:()=>{W=new Map},paint:({pen:t,w:e,now:n,dark:o,box:a})=>{const i=a(u),l=i.w,s=i.h,d=i.x+l/2,g=i.y+s/2,m=r(b.x),p=(e,r,n,a,i=0)=>{const h=D(e,l,s,!o);!h||a<=0||(t.save(),t.translate(d,g+n),t.scale(r,r),t.globalAlpha=a,t.drawImage(h,-l/2,-s/2),i>0&&(t.globalCompositeOperation="destination-out",t.globalAlpha=i,t.drawImage(((t,e)=>{let r=$;if(!r||r.width!==Math.round(t)||r.height!==Math.round(e)){r=$=document.createElement("canvas"),r.width=Math.max(1,Math.round(t)),r.height=Math.max(1,Math.round(e));const n=r.getContext("2d");if(n)for(let t=0;t<r.height;t+=6)for(let e=0;e<r.width;e+=4){const r=43758.5453*Math.sin(12.9898*e+78.233*t);r-Math.floor(r)<.55&&(n.fillStyle="#000",n.fillRect(e,t,4,6))}}return r})(l,s),-l/2,-s/2)),t.restore())};p(x+2,h(.86,.93,m),h(24,12,m),h(.3,.55,m),.3),p(x+1,h(.93,1,m),h(12,0,m),h(.55,1,m),.4*(1-m));const f=D(x,l,s,!o);if(!f)return!1;const v=E?r((n-E.start)/620):0,y=E?.dir??1,k=E?E.x0+y*l*.9*(1-(1-v)**3):M.x,A=E?E.y0:w.x;if(t.save(),t.translate(d+k,g+A),t.rotate(.22*r(k/l,-1.6,1.6)),!E)return t.drawImage(f,-l/2,-s/2),t.restore(),!1;const L=Math.ceil(s/6);for(let n=0;n<L;n++){const o=c[n%c.length],a=r(1.55*v-.55*o);if(a>=1)continue;const i=y*a*a*l*(.5+.9*o),h=6*n,u=Math.min(6,s-h),g=y>0?d+k+i+.62*l:d+k+i-.62*l,m=y>0?e-4-g:g-4;t.globalAlpha=(1-a*a)*r(m/56),t.drawImage(f,0,h,l,u,-l/2+i,-s/2+h,l,u)}return t.restore(),!1}});const U=t=>{I=0;const n=Math.min(1/30,Math.max(0,(t-S)/1e3));S=t;let o=!1;y||E||(o=e(M,n,.3),o=e(w,n,.3)||o),o=e(b,n,.002)||o,E&&t-E.start>=620&&(E=null,x+=1,z()),(()=>{(m.current.leanTarget??u).style.setProperty("--ascii-lean",String(E?0:r(M.x/(.4*q()),-1,1)));const t=F(x);!R&&t&&p.set(t,"transform",`translate(${M.x}px, ${w.x}px) rotate(${.22*r(M.x/q(),-1.6,1.6)}rad)`)})(),R?.kick(),(o||y||E)&&(I=requestAnimationFrame(U))},j=()=>{I||(S=performance.now(),I=requestAnimationFrame(U))},z=()=>{M=s(0,380,.72),w=s(0,380,.8),b=s(0,260,.9)},G=(t=1)=>{const e=v();if(E||!e.length||!m.current.loop&&x>=e.length)return!1;const r=F(x),n=P(x);return y=!1,f()||!R?(x+=1,z(),R||p.set(r,"transform","")):(E={dir:t,start:performance.now(),x0:M.x,y0:w.x},b.to=1),T(),j(),m.current.onSwipe?.(t,n,r),!0},H=e=>{if(!y||void 0!==e&&void 0!==e.pointerId&&e.pointerId!==C)return;y=!1;const n=t(L,performance.now()),o=q();Math.abs(M.x)>o*m.current.threshold||Math.abs(n)>650&&Math.sign(n)===Math.sign(M.x)&&Math.abs(M.x)>16?G(M.x<0?-1:1):(M.to=0,w.to=0,b.to=0,M.v=.2*r(n,-1600,1600),f()&&(M.x=w.x=b.x=0,M.v=w.v=b.v=0),j())},N=()=>u.getBoundingClientRect().width/(u.clientWidth||1)||1,X=t=>{if(0!==t.button||E)return;try{u.setPointerCapture?.(t.pointerId)}catch{}C=t.pointerId;const e=N();y=!0,k=t.clientX-M.x*e,A=t.clientY-w.x/.3*e,L=[],j()},Y=t=>{if(!y||t.pointerId!==C)return;const e=N();M.x=M.to=(t.clientX-k)/e,w.x=w.to=(t.clientY-A)/e*.3,M.v=w.v=0,b.to=.5*r(Math.abs(M.x)/q()),L.push([M.x,performance.now()]),L.length>8&&L.shift(),j()},B=t=>{"ArrowLeft"!==t.key&&"ArrowRight"!==t.key||(t.preventDefault(),G("ArrowRight"===t.key?1:-1))},O=()=>R?.kick(),Z=t=>t.preventDefault();return u.hasAttribute("tabindex")||(u.tabIndex=0),u.setAttribute("role",u.getAttribute("role")??"group"),u.setAttribute("aria-roledescription","card"),p.set(u,"touch-action","none"),T(),u.addEventListener("pointerdown",X),u.addEventListener("pointermove",Y),u.addEventListener("pointerup",H),u.addEventListener("pointercancel",H),u.addEventListener("lostpointercapture",H),u.addEventListener("keydown",B),u.addEventListener("load",O,!0),u.addEventListener("dragstart",Z),a(()=>R,m,()=>{W=new Map,T(),R?.refresh()},{next:G,get index(){return P(x+(E?1:0))}},()=>{I&&cancelAnimationFrame(I),I=0,p.restore(),v().forEach(t=>{t.hidden=!1,t.removeAttribute("aria-hidden")}),(m.current.leanTarget??u).style.removeProperty("--ascii-lean"),u.removeAttribute("aria-roledescription"),u.removeEventListener("pointerdown",X),u.removeEventListener("pointermove",Y),u.removeEventListener("pointerup",H),u.removeEventListener("pointercancel",H),u.removeEventListener("lostpointercapture",H),u.removeEventListener("keydown",B),u.removeEventListener("load",O,!0),u.removeEventListener("dragstart",Z)})}var g=l;export{g as SWIPE_DECK_DEFAULTS,u as swipeDeck,d as toneImage};//# sourceMappingURL=chunk-UHLNVM63.js.map
@@ -1 +1 @@
1
- import{mountSurface as t}from"./chunk-GF72XM4C.js";var e=class{constructor(t=1,e=3.5,s=!1){this.strokes=[],this.advected=[0,0,0],this.previous=null,this.energy=0,this.continuousWake=s,this.decayRate=e,this.aspect=Math.max(.25,Math.min(4,t));const i=s?96:64;this.columns=this.aspect>=1?i:Math.round(i*this.aspect),this.rows=this.aspect>=1?Math.round(i/this.aspect):i,this.front=new Float32Array(this.columns*this.rows*3),this.back=new Float32Array(this.front.length)}get active(){return this.energy>5e-4||this.strokes.length>0}move(t,e){if(!Number.isFinite(t+e))return;if(this.continuousWake&&!this.previous)return void(this.previous={x:t,y:e});const s=this.previous??{x:t-.004,y:e-.001},i=Math.max(-.09,Math.min(.09,t-s.x)),n=Math.max(-.09,Math.min(.09,e-s.y));if(this.previous={x:t,y:e},Math.abs(i)+Math.abs(n)<1e-4)return;const a=Math.min(1,25*Math.hypot(i*this.aspect,n)+.06);this.strokes.push({x:t,y:e,dx:i,dy:n,speed:a,fromX:s.x,fromY:s.y}),this.strokes.length>12&&this.strokes.shift()}leave(){this.previous=null}clear(){this.front.fill(0),this.back.fill(0),this.strokes.length=0,this.previous=null,this.energy=0}read(t,e,s,i){const n=Math.max(0,Math.min(this.columns-1.001,e*(this.columns-1))),a=Math.max(0,Math.min(this.rows-1.001,s*(this.rows-1))),h=Math.floor(n),o=Math.floor(a),r=n-h,c=a-o,l=3*(o*this.columns+h),m=l+3*this.columns,u=1-r,d=1-c;i[0]=(t[l]*u+t[l+3]*r)*d+(t[m]*u+t[m+3]*r)*c,i[1]=(t[l+1]*u+t[l+4]*r)*d+(t[m+1]*u+t[m+4]*r)*c,i[2]=(t[l+2]*u+t[l+5]*r)*d+(t[m+2]*u+t[m+5]*r)*c}sample(t,e,s){this.read(this.front,t,e,s)}step(t){if(!this.active)return;const e=Math.max(0,Math.min(.05,t)),s=Math.exp(-e*this.decayRate),i=Math.exp(-e*(this.decayRate+.5)),n=Math.max(1,this.aspect),a=Math.max(1,1/this.aspect);let h=0;for(let t=0;t<this.rows;t++)for(let o=0;o<this.columns;o++){const r=3*(t*this.columns+o),c=o/(this.columns-1),l=t/(this.rows-1),m=this.continuousWake?.65:2,u=c-this.front[r]*e*m,d=l-this.front[r+1]*e*m;this.read(this.front,u,d,this.advected);let M=this.advected[0]*s,f=this.advected[1]*s,p=this.advected[2]*i;for(const t of this.strokes){let e=(c-t.x)*n,s=(l-t.y)*a;if(this.continuousWake){const i=(c-t.fromX)*n,h=(l-t.fromY)*a,o=(t.x-t.fromX)*n,r=(t.y-t.fromY)*a,m=Math.max(0,Math.min(1,(i*o+h*r)/(o*o+r*r||1)));e=i-o*m,s=h-r*m;const u=e*e+s*s;if(u>.0225)continue;const d=Math.exp(-u/.0032),v=Math.hypot(t.dx*n,t.dy*a),x=Math.min(.025,.55*v);M+=(4.2*t.dx-s*x)*d,f+=(4.2*t.dy+e*x)*d,p=Math.max(p,Math.min(.7,18*v)*d);continue}const i=e*e+s*s;if(i>.045)continue;const h=Math.exp(-i/.0075),o=t.speed;M+=(2.8*t.dx-s*o*.16)*h,f+=(2.8*t.dy+e*o*.16)*h,p+=o*h*.3}this.back[r]=Math.max(-.18,Math.min(.18,M)),this.back[r+1]=Math.max(-.18,Math.min(.18,f)),this.back[r+2]=Math.min(.8,p),h=Math.max(h,Math.abs(M),Math.abs(f),p)}[this.front,this.back]=[this.back,this.front],this.strokes.length=0,this.energy=h,this.active||this.clear()}};var s=" .:+-=xICA$FY#@",i=.58,n=72649.5/59542.5;var a={id:"fluid",name:"Fluid",description:"Flowing folds with a soft wake behind the cursor. The original Asciify hero.",cellSize:7,speed:1,cursor:!0,opacity:.7,mount:function(a){const{host:h}=a;let o=new e(1),r=1,c=12,l=0,m=!1,u=null;const d=[],M=(t,e)=>((t,e,s)=>Math.max(t,Math.sqrt(e*s*i/26e3)))(a.settings().cellSize,t,e),f=t({host:h,kit:a.kit,layer:"under",look:()=>{const t=a.settings();return{mark:"glyph",charset:t.charset??s,font:'"JetBrains Mono", monospace',fontWeight:400,cellSize:M(h.clientWidth||1,h.clientHeight||1)/i,cellAspect:i,glyphScale:.9,cellFit:"fill",maxPixelRatio:1.5,clear:!!t.clear&&{element:t.clear,padding:8,feather:.22,shape:"ellipse"},color:"ink",shade:0,levels:"none",fit:"cover",gamma:1,contrast:n,brightness:-.0004316244699164449-.5/Math.max(1,Array.from(t.charset??s).length-1),...t.look}},ink:t=>a.ink(t)??"#8f8d86",resolution:(t,e)=>{const s=Math.max(192,Math.min(384,Math.ceil(Math.max(t,e*i)/M(t,e)))),n=t/e;return n>=1?[s,Math.max(1,Math.round(s/n))]:[Math.max(1,Math.round(s*n)),s]},reducedMotion:a.reducedMotion,onFail:()=>a.onFail(),paint:({pen:t,width:s,height:i,w:n,h:M,now:f,still:p})=>{const v=a.settings(),x=l?Math.min(.05,(f-l)/1e3):1/60;l=f,p||(c+=x*v.speed);const g=n/M;if(Math.abs(g-r)>.01&&(o=new e(g),r=g),p||!v.cursor)o.clear(),d.length=0;else{const t=h.getBoundingClientRect();if(t.width&&t.height)for(const e of d)o.move((e.x-t.left)/t.width,(e.y-t.top)/t.height);d.length=0,m&&(o.leave(),m=!1),o.step(x)}u&&u.width===s&&u.height===i||(u=t.createImageData(s,i));const y=u.data;!function(t,e,s,i,n,a){const h=[0,0,0],o=a.active;for(let r=0;r<s;r++)for(let c=0;c<e;c++){const l=c/e,m=r/s;o&&a.sample(l,m,h);const u=(l-.5-h[0])*i,d=m-.5-h[1],M=u+.22*Math.sin(5.2*d+.17*n)+.15*Math.sin(2.4*u-3.1*d-.1*n),f=d+.19*Math.sin(3.5*u+.13*n),p=Math.hypot(.8*M+.18,1.1*f),v=.5+.5*Math.sin(14*p-2.8*M+1.4*Math.sin(5*f)-.24*n),x=.5+.5*Math.sin(3.6*M-2.9*f+.09*n),g=Math.max(0,Math.min(1,v*v*(.48+.32*x)-.075+.75*h[2])),y=Math.round(255*g),k=4*(r*e+c);t[k]=t[k+1]=t[k+2]=y,t[k+3]=255}}(y,s,i,g,c,o);for(let t=0;t<y.length;t+=4){const e=y[t]<10?0:Math.min(255,1.45*y[t]);y[t]=y[t+1]=y[t+2]=.299*e+e*(185/232)*.587,y[t+3]=255}return t.putImageData(u,0,0),!0}});if(!f)return null;const p=t=>{if(t.target instanceof Element&&t.target.closest("button, a, input, select, summary, textarea"))return m=!0,void f.kick();d.push({x:t.clientX,y:t.clientY}),d.length>6&&d.shift(),f.kick()},v=()=>{m=!0,f.kick()};return h.addEventListener("pointermove",p),h.addEventListener("pointerdown",p),h.addEventListener("pointerleave",v),h.addEventListener("pointercancel",v),{get field(){return f.field},get canvas(){return f.canvas},refresh:()=>f.refresh(),play:()=>{l=0,f.play()},pause:()=>f.pause(),destroy(){h.removeEventListener("pointermove",p),h.removeEventListener("pointerdown",p),h.removeEventListener("pointerleave",v),h.removeEventListener("pointercancel",v),f.destroy()}}}};export{a as fluid};//# sourceMappingURL=chunk-UOYBFLGJ.js.map
1
+ import{mountSurface as t}from"./chunk-I377LEZA.js";var e=class{constructor(t=1,e=3.5,s=!1){this.strokes=[],this.advected=[0,0,0],this.previous=null,this.energy=0,this.continuousWake=s,this.decayRate=e,this.aspect=Math.max(.25,Math.min(4,t));const i=s?96:64;this.columns=this.aspect>=1?i:Math.round(i*this.aspect),this.rows=this.aspect>=1?Math.round(i/this.aspect):i,this.front=new Float32Array(this.columns*this.rows*3),this.back=new Float32Array(this.front.length)}get active(){return this.energy>5e-4||this.strokes.length>0}move(t,e){if(!Number.isFinite(t+e))return;if(this.continuousWake&&!this.previous)return void(this.previous={x:t,y:e});const s=this.previous??{x:t-.004,y:e-.001},i=Math.max(-.09,Math.min(.09,t-s.x)),n=Math.max(-.09,Math.min(.09,e-s.y));if(this.previous={x:t,y:e},Math.abs(i)+Math.abs(n)<1e-4)return;const a=Math.min(1,25*Math.hypot(i*this.aspect,n)+.06);this.strokes.push({x:t,y:e,dx:i,dy:n,speed:a,fromX:s.x,fromY:s.y}),this.strokes.length>12&&this.strokes.shift()}leave(){this.previous=null}clear(){this.front.fill(0),this.back.fill(0),this.strokes.length=0,this.previous=null,this.energy=0}read(t,e,s,i){const n=Math.max(0,Math.min(this.columns-1.001,e*(this.columns-1))),a=Math.max(0,Math.min(this.rows-1.001,s*(this.rows-1))),h=Math.floor(n),o=Math.floor(a),r=n-h,c=a-o,l=3*(o*this.columns+h),m=l+3*this.columns,u=1-r,d=1-c;i[0]=(t[l]*u+t[l+3]*r)*d+(t[m]*u+t[m+3]*r)*c,i[1]=(t[l+1]*u+t[l+4]*r)*d+(t[m+1]*u+t[m+4]*r)*c,i[2]=(t[l+2]*u+t[l+5]*r)*d+(t[m+2]*u+t[m+5]*r)*c}sample(t,e,s){this.read(this.front,t,e,s)}step(t){if(!this.active)return;const e=Math.max(0,Math.min(.05,t)),s=Math.exp(-e*this.decayRate),i=Math.exp(-e*(this.decayRate+.5)),n=Math.max(1,this.aspect),a=Math.max(1,1/this.aspect);let h=0;for(let t=0;t<this.rows;t++)for(let o=0;o<this.columns;o++){const r=3*(t*this.columns+o),c=o/(this.columns-1),l=t/(this.rows-1),m=this.continuousWake?.65:2,u=c-this.front[r]*e*m,d=l-this.front[r+1]*e*m;this.read(this.front,u,d,this.advected);let M=this.advected[0]*s,f=this.advected[1]*s,p=this.advected[2]*i;for(const t of this.strokes){let e=(c-t.x)*n,s=(l-t.y)*a;if(this.continuousWake){const i=(c-t.fromX)*n,h=(l-t.fromY)*a,o=(t.x-t.fromX)*n,r=(t.y-t.fromY)*a,m=Math.max(0,Math.min(1,(i*o+h*r)/(o*o+r*r||1)));e=i-o*m,s=h-r*m;const u=e*e+s*s;if(u>.0225)continue;const d=Math.exp(-u/.0032),v=Math.hypot(t.dx*n,t.dy*a),x=Math.min(.025,.55*v);M+=(4.2*t.dx-s*x)*d,f+=(4.2*t.dy+e*x)*d,p=Math.max(p,Math.min(.7,18*v)*d);continue}const i=e*e+s*s;if(i>.045)continue;const h=Math.exp(-i/.0075),o=t.speed;M+=(2.8*t.dx-s*o*.16)*h,f+=(2.8*t.dy+e*o*.16)*h,p+=o*h*.3}this.back[r]=Math.max(-.18,Math.min(.18,M)),this.back[r+1]=Math.max(-.18,Math.min(.18,f)),this.back[r+2]=Math.min(.8,p),h=Math.max(h,Math.abs(M),Math.abs(f),p)}[this.front,this.back]=[this.back,this.front],this.strokes.length=0,this.energy=h,this.active||this.clear()}};var s=" .:+-=xICA$FY#@",i=.58,n=72649.5/59542.5;var a={id:"fluid",name:"Fluid",description:"Flowing folds with a soft wake behind the cursor. The original Asciify hero.",cellSize:7,speed:1,cursor:!0,opacity:.7,mount:function(a){const{host:h}=a;let o=new e(1),r=1,c=12,l=0,m=!1,u=null;const d=[],M=(t,e)=>((t,e,s)=>Math.max(t,Math.sqrt(e*s*i/26e3)))(a.settings().cellSize,t,e),f=t({host:h,kit:a.kit,layer:"under",look:()=>{const t=a.settings();return{mark:"glyph",charset:t.charset??s,font:'"JetBrains Mono", monospace',fontWeight:400,cellSize:M(h.clientWidth||1,h.clientHeight||1)/i,cellAspect:i,glyphScale:.9,cellFit:"fill",maxPixelRatio:1.5,clear:!!t.clear&&{element:t.clear,padding:8,feather:.22,shape:"ellipse"},color:"ink",shade:0,levels:"none",fit:"cover",gamma:1,contrast:n,brightness:-.0004316244699164449-.5/Math.max(1,Array.from(t.charset??s).length-1),...t.look}},ink:t=>a.ink(t)??"#8f8d86",resolution:(t,e)=>{const s=Math.max(192,Math.min(384,Math.ceil(Math.max(t,e*i)/M(t,e)))),n=t/e;return n>=1?[s,Math.max(1,Math.round(s/n))]:[Math.max(1,Math.round(s*n)),s]},reducedMotion:a.reducedMotion,onFail:()=>a.onFail(),paint:({pen:t,width:s,height:i,w:n,h:M,now:f,still:p})=>{const v=a.settings(),x=l?Math.min(.05,(f-l)/1e3):1/60;l=f,p||(c+=x*v.speed);const g=n/M;if(Math.abs(g-r)>.01&&(o=new e(g),r=g),p||!v.cursor)o.clear(),d.length=0;else{const t=h.getBoundingClientRect();if(t.width&&t.height)for(const e of d)o.move((e.x-t.left)/t.width,(e.y-t.top)/t.height);d.length=0,m&&(o.leave(),m=!1),o.step(x)}u&&u.width===s&&u.height===i||(u=t.createImageData(s,i));const y=u.data;!function(t,e,s,i,n,a){const h=[0,0,0],o=a.active;for(let r=0;r<s;r++)for(let c=0;c<e;c++){const l=c/e,m=r/s;o&&a.sample(l,m,h);const u=(l-.5-h[0])*i,d=m-.5-h[1],M=u+.22*Math.sin(5.2*d+.17*n)+.15*Math.sin(2.4*u-3.1*d-.1*n),f=d+.19*Math.sin(3.5*u+.13*n),p=Math.hypot(.8*M+.18,1.1*f),v=.5+.5*Math.sin(14*p-2.8*M+1.4*Math.sin(5*f)-.24*n),x=.5+.5*Math.sin(3.6*M-2.9*f+.09*n),g=Math.max(0,Math.min(1,v*v*(.48+.32*x)-.075+.75*h[2])),y=Math.round(255*g),k=4*(r*e+c);t[k]=t[k+1]=t[k+2]=y,t[k+3]=255}}(y,s,i,g,c,o);for(let t=0;t<y.length;t+=4){const e=y[t]<10?0:Math.min(255,1.45*y[t]);y[t]=y[t+1]=y[t+2]=.299*e+e*(185/232)*.587,y[t+3]=255}return t.putImageData(u,0,0),!0}});if(!f)return null;const p=t=>{if(t.target instanceof Element&&t.target.closest("button, a, input, select, summary, textarea"))return m=!0,void f.kick();d.push({x:t.clientX,y:t.clientY}),d.length>6&&d.shift(),f.kick()},v=()=>{m=!0,f.kick()};return h.addEventListener("pointermove",p),h.addEventListener("pointerdown",p),h.addEventListener("pointerleave",v),h.addEventListener("pointercancel",v),{get field(){return f.field},get canvas(){return f.canvas},refresh:()=>f.refresh(),play:()=>{l=0,f.play()},pause:()=>f.pause(),destroy(){h.removeEventListener("pointermove",p),h.removeEventListener("pointerdown",p),h.removeEventListener("pointerleave",v),h.removeEventListener("pointercancel",v),f.destroy()}}}};export{a as fluid};//# sourceMappingURL=chunk-UT6MJP5B.js.map
@@ -1 +1 @@
1
- import{parseColor as o,fbm as t,hash2 as e}from"./chunk-ZCHGV2CV.js";import{mountCanvas as r}from"./chunk-3OD5BMF5.js";import{mixHex as l}from"./chunk-GF72XM4C.js";function n(r,l,n,a,i={}){const{fontSize:c=13,chars:s=" .,:;+*#@",color:f="#4caf50",skyColor:h="#1a237e",peakColor:g="#e0e0e0",speed:p=1,roughness:M=.55,heightScale:b=.55,stars:d=!0,lightMode:m=!1}=i,k=.62*c,u=1.4*c,x=Math.ceil(l/k),C=Math.ceil(n/u),S=o(f)??{r:76,g:175,b:80},$=o(h)??{r:26,g:35,b:126},y=o(g)??{r:224,g:224,b:224};r.clearRect(0,0,l,n),r.font=`${c}px "JetBrains Mono", monospace`,r.textBaseline="top";const A=a*p*.4,z=new Array(x);for(let o=0;o<x;o++){const e=(.5*t((o/x+A)*M*3,.5)+.5)*b;z[o]=Math.floor(e*C)}for(let o=0;o<C;o++)for(let t=0;t<x;t++){const l=C-1-z[t],n=o===l;if(!(o>=l)){if(d){const l=e(7*t+Math.floor(.3*A),13*o);if(l>.97){const e=.3*Math.sin(2*a+100*l)+.7;r.globalAlpha=.5*e,r.fillStyle=`rgb(${$.r+60},${$.g+60},${$.b+80})`,r.fillText("·",t*k,o*u)}}continue}const i=(o-l)/Math.max(1,z[t]),c=s[Math.min(s.length-1,Math.floor(i*s.length))];if(" "===c&&!n)continue;const f=n?1:Math.max(0,1-4*i),h=S.r+(y.r-S.r)*f|0,g=S.g+(y.g-S.g)*f|0,p=S.b+(y.b-S.b)*f|0;r.globalAlpha=.5+.5*i,r.fillStyle=`rgb(${h},${g},${p})`,r.fillText(n?s[s.length-1]:c,t*k,o*u)}r.globalAlpha=1}var a={id:"terrain",name:"Terrain",description:"A side-scrolling landscape drawn in density characters.",cellSize:13,speed:1,cursor:!1,mount:o=>r(o,(o,t,e,r,a,i)=>n(o,t,e,r,{fontSize:i.fontSize,chars:i.chars,lightMode:i.lightMode,color:i.ink,peakColor:i.accent??l(i.ink,"#ffffff",.65),skyColor:l(i.ink,"#0c0d0b",.55)}))};export{n as renderTerrainBackground,a as terrain};//# sourceMappingURL=chunk-QSTDYL35.js.map
1
+ import{parseColor as o,fbm as t,hash2 as e}from"./chunk-ZCHGV2CV.js";import{mountCanvas as r}from"./chunk-AAV5QNHU.js";import{mixHex as l}from"./chunk-I377LEZA.js";function n(r,l,n,a,i={}){const{fontSize:c=13,chars:s=" .,:;+*#@",color:f="#4caf50",skyColor:h="#1a237e",peakColor:g="#e0e0e0",speed:p=1,roughness:b=.55,heightScale:M=.55,stars:d=!0,lightMode:m=!1}=i,k=.62*c,u=1.4*c,A=Math.ceil(l/k),x=Math.ceil(n/u),S=o(f)??{r:76,g:175,b:80},$=o(h)??{r:26,g:35,b:126},y=o(g)??{r:224,g:224,b:224};r.clearRect(0,0,l,n),r.font=`${c}px "JetBrains Mono", monospace`,r.textBaseline="top";const C=a*p*.4,z=new Array(A);for(let o=0;o<A;o++){const e=(.5*t((o/A+C)*b*3,.5)+.5)*M;z[o]=Math.floor(e*x)}for(let o=0;o<x;o++)for(let t=0;t<A;t++){const l=x-1-z[t],n=o===l;if(!(o>=l)){if(d){const l=e(7*t+Math.floor(.3*C),13*o);if(l>.97){const e=.3*Math.sin(2*a+100*l)+.7;r.globalAlpha=.5*e,r.fillStyle=`rgb(${$.r+60},${$.g+60},${$.b+80})`,r.fillText("·",t*k,o*u)}}continue}const i=(o-l)/Math.max(1,z[t]),c=s[Math.min(s.length-1,Math.floor(i*s.length))];if(" "===c&&!n)continue;const f=n?1:Math.max(0,1-4*i),h=S.r+(y.r-S.r)*f|0,g=S.g+(y.g-S.g)*f|0,p=S.b+(y.b-S.b)*f|0;r.globalAlpha=.5+.5*i,r.fillStyle=`rgb(${h},${g},${p})`,r.fillText(n?s[s.length-1]:c,t*k,o*u)}r.globalAlpha=1}var a={id:"terrain",name:"Terrain",description:"A side-scrolling landscape drawn in density characters.",cellSize:13,speed:1,cursor:!1,mount:o=>r(o,(o,t,e,r,a,i)=>n(o,t,e,r,{fontSize:i.fontSize,chars:i.chars,lightMode:i.lightMode,color:i.ink,peakColor:i.accent??l(i.ink,"#ffffff",.65),skyColor:l(i.ink,"#0c0d0b",.55)}))};export{n as renderTerrainBackground,a as terrain};//# sourceMappingURL=chunk-UWX7VIXT.js.map
@@ -1 +1 @@
1
- import{renderMaterial as t}from"./chunk-XPXMCXYI.js";import{mountCanvas as e}from"./chunk-3OD5BMF5.js";var o=(t,e,o,r)=>{const h=2.8*t+1.8*e+.018*r,a=1.2*t-3.2*e,i=Math.abs(2*(h-Math.floor(h))-1),n=Math.abs(2*(a-Math.floor(a))-1);return.85*Math.pow(Math.min(i,n),1.8)},r={id:"facet",name:"Facet",description:"Quiet folded planes catch light along their edges.",cellSize:12,speed:1,cursor:!1,mount:r=>e(r,(e,r,h,a,i,n)=>t(o,e,r,h,a,{ditherStrength:n.ditherStrength,fontSize:n.fontSize,chars:n.chars,lightMode:n.lightMode,color:n.ink}))};export{r as facet};//# sourceMappingURL=chunk-6WU247CB.js.map
1
+ import{renderMaterial as t}from"./chunk-XPXMCXYI.js";import{mountCanvas as e}from"./chunk-AAV5QNHU.js";var o=(t,e,o,r)=>{const h=2.8*t+1.8*e+.018*r,a=1.2*t-3.2*e,i=Math.abs(2*(h-Math.floor(h))-1),n=Math.abs(2*(a-Math.floor(a))-1);return.85*Math.pow(Math.min(i,n),1.8)},r={id:"facet",name:"Facet",description:"Quiet folded planes catch light along their edges.",cellSize:12,speed:1,cursor:!1,mount:r=>e(r,(e,r,h,a,i,n)=>t(o,e,r,h,a,{ditherStrength:n.ditherStrength,fontSize:n.fontSize,chars:n.chars,lightMode:n.lightMode,color:n.ink}))};export{r as facet};//# sourceMappingURL=chunk-UXDJSGED.js.map
@@ -1 +1 @@
1
- import{scenePreset as e}from"./chunk-3VEMKDBW.js";var t=e({id:"ripple",name:"Ripple",description:"Still water: drops land here and there and ring outward, and the pointer drops its own.",cellSize:11,scene:"ripple",charset:" .·:-~=",hover:"none",extra(e,t){const{host:n}=e;let r=-1e9,i=-1e4,o=-1e4;const s=n=>{const s=performance.now();if(!1===e.settings().cursor||s-r<260||Math.hypot(n.clientX-i,n.clientY-o)<48)return;r=s,i=n.clientX,o=n.clientY;const c=t.canvas.getBoundingClientRect();t.field?.pulse({x:n.clientX-c.left,y:n.clientY-c.top,strength:.5})};return n.addEventListener("pointermove",s,{passive:!0}),()=>n.removeEventListener("pointermove",s)}});export{t as ripple};//# sourceMappingURL=chunk-Z3KD6CLE.js.map
1
+ import{scenePreset as e}from"./chunk-LTRVMY3D.js";var t=e({id:"ripple",name:"Ripple",description:"Still water: drops land here and there and ring outward, and the pointer drops its own.",cellSize:11,scene:"ripple",charset:" .·:-~=",hover:"none",extra(e,t){const{host:n}=e;let r=-1e9,i=-1e4,o=-1e4;const s=n=>{const s=performance.now();if(!1===e.settings().cursor||s-r<260||Math.hypot(n.clientX-i,n.clientY-o)<48)return;r=s,i=n.clientX,o=n.clientY;const c=t.canvas.getBoundingClientRect();t.field?.pulse({x:n.clientX-c.left,y:n.clientY-c.top,strength:.5})};return n.addEventListener("pointermove",s,{passive:!0}),()=>n.removeEventListener("pointermove",s)}});export{t as ripple};//# sourceMappingURL=chunk-UXJRBOSR.js.map
@@ -1 +1 @@
1
- import{easeOut as t,styleKeeper as e,mountSurface as n,smoothstep as r,handle as o,boxIn as i,clamp as a}from"./chunk-GF72XM4C.js";var l={tabs:'[role="tab"]',duration:440,panels:"hidden",manage:!0};function c(e,n,r){const o=Math.sign(n.x+n.w/2-(e.x+e.w/2))||1,i=t(r/.78,4),a=t((r-.14)/.86,4);return{left:e.x+(n.x-e.x)*(o>0?a:i),right:e.x+e.w+(n.x+n.w-e.x-e.w)*(o>0?i:a),dir:o}}function s(t,e,n=20){const r=Math.max(0,Math.floor((t-2*n)/e));return{n:r,x0:(t-r*e)/2}}function u(u,d={}){const h={current:{...l,...d}},x=()=>[...u.querySelectorAll(h.current.tabs)],f=x().findIndex(t=>"true"===t.getAttribute("aria-selected"));let g=Math.max(0,h.current.active??(f>=0?f:0)),p=-1e6,v=null,y=null;const b=e(),m=()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:6,cellAspect:.62,glyphScale:.96,blend:"off",...h.current.look}),M=t=>{const e=i(u,t);return{...e,x:e.x-u.clientLeft,y:e.y-u.clientTop}},w=t=>{y=t;const e=t=>Math.round(100*t)/100+"px";b.set(u,"--tabs-x",e(t.x)),b.set(u,"--tabs-y",e(t.y)),b.set(u,"--tabs-w",e(t.w)),b.set(u,"--tabs-h",e(t.h))},k=()=>{const t=x()[g];t&&w(M(t))};let A=null;A=n({host:u,layer:"under",look:m,ink:()=>h.current.ink??"--ascii-ink",kit:h,reducedMotion:()=>h.current.reducedMotion,onFail:()=>{A=null,k()},paint:({pen:e,now:n,still:o})=>{const i=x()[g];if(!i)return!1;const l=M(i),u=o||!v?1:a((n-p)/h.current.duration),d=u<1?c(v,l,u):{left:l.x,right:l.x+l.w,dir:1},f={x:d.left,y:l.y,w:d.right-d.left,h:l.h};w(f),u>=1&&(v=null);const y=m(),b=Math.min(2,globalThis.devicePixelRatio||1),k=Math.max(2,Math.round((y.cellSize??6)*b)),$=k/b,E=Math.max(2,Math.round(k*(y.cellAspect??.62)))/b,{n:L,x0:S}=s(f.w,E),F=t=>u<1?t:Math.round(t*b)/b,R=F(f.x+S),z=F(f.y+f.h-7-$),I=(R%E+E)%E-E,O=(z%$+$)%$-$,P=A.canvas,C=`${I.toFixed(3)}px ${O.toFixed(3)}px`;P.style.translate!==C&&(P.style.translate=C);const G=t=>`${Math.max(0,t).toFixed(2)}px`,H=R-I,T=z-O,W=`inset(${G(T)} ${G(P.clientWidth-H-L*E)} ${G(P.clientHeight-T-$)} ${G(H)})`;P.style.clipPath!==W&&(P.style.clipPath=W);const j=u<1?1-t(u,2):0;for(let t=0;t<L;t++){const n=L>1?t/(L-1):.5,o=d.dir>0?n:1-n,i=r(0,.42,1-Math.abs(2*n-1))*(.5+j*(.5*o**1.4-.2));e.fillStyle=`rgb(${Math.round(255*i)} ${Math.round(255*i)} ${Math.round(255*i)})`,e.fillRect(R-I+t*E,z-O,E,$)}return u<1}});const $=()=>{const t=h.current;x().forEach((e,n)=>{const r=n===g;t.manage&&(e.setAttribute("aria-selected",String(r)),e.tabIndex=r?0:-1);const o=e.getAttribute("aria-controls")?document.getElementById(e.getAttribute("aria-controls")):null;o&&"none"!==t.panels&&("hidden"===t.panels?o.hidden=!r:o.toggleAttribute("data-active",r))})},E=(t,e=!1)=>{const n=x();if(!n.length)return;const r=(t%n.length+n.length)%n.length;e&&n[r].focus(),r!==g&&(v=y??M(n[g]),g=r,p=performance.now(),$(),A&&!A.still()||(v=null,k()),A.kick(),h.current.onChange?.(r,n[r]))},L=t=>{if(!h.current.manage)return;const e=t.target.closest?.(h.current.tabs),n=e?x().indexOf(e):-1;n>=0&&E(n)},S=t=>{if(!h.current.manage)return;const e={ArrowRight:g+1,ArrowLeft:g-1,Home:0,End:x().length-1};t.key in e&&(t.preventDefault(),E(e[t.key],!0))},F="function"==typeof ResizeObserver?new ResizeObserver(()=>{A?.live||k()}):null;return F?.observe(u),u.addEventListener("click",L),u.addEventListener("keydown",S),$(),k(),o(()=>A,h,t=>{void 0!==t.active&&t.active!==g&&E(t.active),$(),A?.refresh()},{select:E,get active(){return g}},()=>{u.removeEventListener("click",L),u.removeEventListener("keydown",S),F?.disconnect(),b.restore()})}var d=l;export{d as TABS_DEFAULTS,s as indicatorRow,c as streamSpan,u as tabs};//# sourceMappingURL=chunk-KLRF3S7O.js.map
1
+ import{easeOut as t,styleKeeper as e,mountSurface as n,smoothstep as r,handle as o,boxIn as i,clamp as a}from"./chunk-I377LEZA.js";var l={tabs:'[role="tab"]',duration:440,panels:"hidden",manage:!0};function c(e,n,r){const o=Math.sign(n.x+n.w/2-(e.x+e.w/2))||1,i=t(r/.78,4),a=t((r-.14)/.86,4);return{left:e.x+(n.x-e.x)*(o>0?a:i),right:e.x+e.w+(n.x+n.w-e.x-e.w)*(o>0?i:a),dir:o}}function s(t,e,n=20){const r=Math.max(0,Math.floor((t-2*n)/e));return{n:r,x0:(t-r*e)/2}}function u(u,d={}){const h={current:{...l,...d}},x=()=>[...u.querySelectorAll(h.current.tabs)],f=x().findIndex(t=>"true"===t.getAttribute("aria-selected"));let g=Math.max(0,h.current.active??(f>=0?f:0)),p=-1e6,v=null,y=null;const b=e(),m=()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:6,cellAspect:.62,glyphScale:.96,blend:"off",...h.current.look}),M=t=>{const e=i(u,t);return{...e,x:e.x-u.clientLeft,y:e.y-u.clientTop}},w=t=>{y=t;const e=t=>Math.round(100*t)/100+"px";b.set(u,"--tabs-x",e(t.x)),b.set(u,"--tabs-y",e(t.y)),b.set(u,"--tabs-w",e(t.w)),b.set(u,"--tabs-h",e(t.h))},k=()=>{const t=x()[g];t&&w(M(t))};let A=null;A=n({host:u,layer:"under",look:m,ink:()=>h.current.ink??"--ascii-ink",kit:h,reducedMotion:()=>h.current.reducedMotion,onFail:()=>{A=null,k()},paint:({pen:e,now:n,still:o})=>{const i=x()[g];if(!i)return!1;const l=M(i),u=o||!v?1:a((n-p)/h.current.duration),d=u<1?c(v,l,u):{left:l.x,right:l.x+l.w,dir:1},f={x:d.left,y:l.y,w:d.right-d.left,h:l.h};w(f),u>=1&&(v=null);const y=m(),b=Math.min(2,globalThis.devicePixelRatio||1),k=Math.max(2,Math.round((y.cellSize??6)*b)),$=k/b,E=Math.max(2,Math.round(k*(y.cellAspect??.62)))/b,{n:L,x0:S}=s(f.w,E),R=t=>u<1?t:Math.round(t*b)/b,z=R(f.x+S),F=R(f.y+f.h-7-$),I=(z%E+E)%E-E,O=(F%$+$)%$-$,P=A.canvas,H=`${I.toFixed(3)}px ${O.toFixed(3)}px`;P.style.translate!==H&&(P.style.translate=H);const T=t=>`${Math.max(0,t).toFixed(2)}px`,W=z-I,j=F-O,q=`inset(${T(j)} ${T(P.clientWidth-W-L*E)} ${T(P.clientHeight-j-$)} ${T(W)})`;P.style.clipPath!==q&&(P.style.clipPath=q);const B=u<1?1-t(u,2):0;for(let t=0;t<L;t++){const n=L>1?t/(L-1):.5,o=d.dir>0?n:1-n,i=r(0,.42,1-Math.abs(2*n-1))*(.5+B*(.5*o**1.4-.2));e.fillStyle=`rgb(${Math.round(255*i)} ${Math.round(255*i)} ${Math.round(255*i)})`,e.fillRect(z-I+t*E,F-O,E,$)}return u<1}});const $=()=>{const t=h.current;x().forEach((e,n)=>{const r=n===g;t.manage&&(e.setAttribute("aria-selected",String(r)),e.tabIndex=r?0:-1);const o=e.getAttribute("aria-controls")?document.getElementById(e.getAttribute("aria-controls")):null;o&&"none"!==t.panels&&("hidden"===t.panels?o.hidden=!r:o.toggleAttribute("data-active",r))})},E=(t,e=!1)=>{const n=x();if(!n.length)return;const r=(t%n.length+n.length)%n.length;e&&n[r].focus(),r!==g&&(v=y??M(n[g]),g=r,p=performance.now(),$(),A&&!A.still()||(v=null,k()),A.kick(),h.current.onChange?.(r,n[r]))},L=t=>{if(!h.current.manage)return;const e=t.target.closest?.(h.current.tabs),n=e?x().indexOf(e):-1;n>=0&&E(n)},S=t=>{if(!h.current.manage)return;const e={ArrowRight:g+1,ArrowLeft:g-1,Home:0,End:x().length-1};t.key in e&&(t.preventDefault(),E(e[t.key],!0))},R="function"==typeof ResizeObserver?new ResizeObserver(()=>{A?.live||k()}):null;return R?.observe(u),u.addEventListener("click",L),u.addEventListener("keydown",S),$(),k(),o(()=>A,h,t=>{void 0!==t.active&&t.active!==g&&E(t.active),$(),A?.refresh()},{select:E,get active(){return g}},()=>{u.removeEventListener("click",L),u.removeEventListener("keydown",S),R?.disconnect(),b.restore()})}var d=l;export{d as TABS_DEFAULTS,s as indicatorRow,c as streamSpan,u as tabs};//# sourceMappingURL=chunk-V42Q4L2G.js.map
@@ -0,0 +1 @@
1
+ import{MONO as t,GRAPHITE_LIGHT as e,GRAPHITE_DARK as o,pixelSnap as r,parseColor as n,band as c,ditherIndex as i,toneAlpha as a,vnoise as l}from"./chunk-ZCHGV2CV.js";import{mountCanvas as s}from"./chunk-AAV5QNHU.js";function h(s,h,f,d,g={x:.5,y:.5},u={}){const{fontSize:m=13,chars:M=" .:-=+*#%@",accentColor:p,color:$,octaves:x=4,speed:S=1,scale:b=1,accentThreshold:y=.9,mouseWarp:z=.3,lightMode:A=!1}=u,C=Array.from(M),k=.62*m,V=1.3*m,j=Math.ceil(h/k),v=Math.ceil(f/V);s.clearRect(0,0,h,f),s.font=`${m}px ${t}`,s.textBaseline="top";const w=A?e:o;let H=w.r,N=w.g,T=w.b;const q=r(s);if($){const t=n($);t&&(H=t.r,N=t.g,T=t.b)}let B=H,G=N,Q=T;const R=p?n(p):null;R&&(B=R.r,G=R.g,Q=R.b);const U=.035*b,W=d*S,Z=Math.min(6,Math.max(1,x)),D=(t,e)=>{let o=0,r=.5,n=1,c=0;for(let i=0;i<Z;i++)o+=l(t*n,e*n)*r,c+=r,r*=.5,n*=2.1;return o/c};for(let t=0;t<v;t++)for(let e=0;e<j;e++){const o=e*U+.06*W,r=t*U*1.3-.04*W,n=e/j-g.x,l=t/v-g.y,h=Math.sqrt(n*n+l*l),f=z>0?.12*Math.max(0,1-h/z):0,d=D(o+f*Math.sin(1.3*W+8*l),r+f*Math.cos(.9*W+8*n)),m=c(.5*d+.5,.7,.83);if(m<=0)continue;const M=C[i(m,C.length,e,t,u.ditherStrength)];if(" "===M)continue;const p=!!R&&m>y,$=a(m);s.fillStyle=p?`rgba(${B},${G},${Q},${$})`:`rgba(${H},${N},${T},${$})`,s.fillText(M,q(e*k),q(t*V))}}var f={id:"noise",name:"Noise",description:"A slow fractal noise field that warps around the cursor.",cellSize:13,speed:.5,cursor:!0,mount:t=>s(t,(t,e,o,r,n,c)=>h(t,e,o,r,n,{ditherStrength:c.ditherStrength,fontSize:c.fontSize,chars:c.chars,lightMode:c.lightMode,color:c.ink,accentColor:c.accent}))};export{f as noise,h as renderNoiseBackground};//# sourceMappingURL=chunk-V6KL3IA7.js.map
@@ -1 +1 @@
1
- import{scenePreset as e}from"./chunk-3VEMKDBW.js";var r=e({id:"mesh",name:"Mesh",description:"Four soft lights on slow paths: a gradient mesh written in characters.",cellSize:11,scene:"mesh",charset:" .:-=+*#%@",hover:"trail"});export{r as mesh};//# sourceMappingURL=chunk-776H2BJ7.js.map
1
+ import{scenePreset as e}from"./chunk-LTRVMY3D.js";var r=e({id:"mesh",name:"Mesh",description:"Four soft lights on slow paths: a gradient mesh written in characters.",cellSize:11,scene:"mesh",charset:" .:-=+*#%@",hover:"trail"});export{r as mesh};//# sourceMappingURL=chunk-VENDLTH4.js.map