@imagile-dev/toil-ui 0.1.0-beta.4 → 0.1.0-beta.6

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 (61) hide show
  1. package/README.md +529 -180
  2. package/dist/app/assets/400-3Dshv1o0.css +1 -0
  3. package/dist/app/assets/400-BlzPh-5d.css +1 -0
  4. package/dist/app/assets/400-CPrO1MiG.css +1 -0
  5. package/dist/app/assets/400-CbHxiUkt.css +1 -0
  6. package/dist/app/assets/400-D153RTnK.css +1 -0
  7. package/dist/app/assets/600-B0bH0tPL.css +1 -0
  8. package/dist/app/assets/600-BC2hxnnO.css +1 -0
  9. package/dist/app/assets/600-BR9-_eiK.css +1 -0
  10. package/dist/app/assets/600-BsKsKkx5.css +1 -0
  11. package/dist/app/assets/600-Czj0FyAy.css +1 -0
  12. package/dist/app/assets/600-D452fNA9.css +1 -0
  13. package/dist/app/assets/600-D6SrDV1i.css +1 -0
  14. package/dist/app/assets/600-DBby7xF7.css +1 -0
  15. package/dist/app/assets/700-DlBBsyxq.css +1 -0
  16. package/dist/app/assets/700-Dr8Emwbw.css +1 -0
  17. package/dist/app/assets/Graph-CAQkpyYr.js +7 -0
  18. package/dist/app/assets/PowershellMan-DldYCOOP.js +1 -0
  19. package/dist/app/assets/gallery-447w4Nva.js +1 -0
  20. package/dist/app/assets/graph-CPXdI5ap.js +13 -0
  21. package/dist/app/assets/graph-CpctQRjW.css +1 -0
  22. package/dist/app/assets/index-CGVZr4kM.css +1 -0
  23. package/dist/app/assets/index-lUb0DGcI.js +732 -0
  24. package/dist/app/assets/jsx-runtime-DyZJNswf.js +1 -0
  25. package/dist/app/assets/latin-400-BVAlDo0s.css +1 -0
  26. package/dist/app/assets/latin-400-_vizA_-6.css +1 -0
  27. package/dist/app/assets/latin-600-BcF9gTYO.css +1 -0
  28. package/dist/app/assets/latin-600-Cv5fXBpv.css +1 -0
  29. package/dist/app/assets/latin-600-yBvtfTSt.css +1 -0
  30. package/dist/app/assets/latin-800-DN-4L033.css +1 -0
  31. package/dist/app/assets/sample-app-DEDGRcL1.js +27 -0
  32. package/dist/app/assets/series-B2reSWoM.svg +10 -0
  33. package/dist/app/assets/series-CRHwxbpo.svg +10 -0
  34. package/dist/app/assets/series-CppUGsOL.svg +10 -0
  35. package/dist/app/assets/series-DVzjwDhp.svg +10 -0
  36. package/dist/app/assets/series-zigaZBZX.svg +10 -0
  37. package/dist/app/assets/{source-serif-4-cyrillic-600-normal-DFnC3vAY.woff → source-serif-4-cyrillic-600-normal-CHh5eQWW.woff} +0 -0
  38. package/dist/app/assets/{source-serif-4-cyrillic-ext-600-normal-DiT2IGQm.woff → source-serif-4-cyrillic-ext-600-normal-h2VnbV3V.woff} +0 -0
  39. package/dist/app/assets/{source-serif-4-greek-600-normal-DhXQw1Kl.woff → source-serif-4-greek-600-normal-OkzgCkGB.woff} +0 -0
  40. package/dist/app/assets/{source-serif-4-latin-600-normal-DMD1h6_f.woff → source-serif-4-latin-600-normal-DeJomR3S.woff} +0 -0
  41. package/dist/app/assets/{source-serif-4-latin-ext-600-normal-C6NNqpJh.woff → source-serif-4-latin-ext-600-normal-B2fExS53.woff} +0 -0
  42. package/dist/app/assets/source-serif-4-latin-ext-600-normal-pa-C5Dkf.woff2 +0 -0
  43. package/dist/app/assets/source-serif-4-vietnamese-600-normal-B33FcZBi.woff2 +0 -0
  44. package/dist/app/assets/{source-serif-4-vietnamese-600-normal-B0WJbuqT.woff → source-serif-4-vietnamese-600-normal-CKUOBVO_.woff} +0 -0
  45. package/dist/app/assets/theme-BxDF9UoZ.css +1 -0
  46. package/dist/app/assets/theme-zHGs48Oo.css +1 -0
  47. package/dist/app/assets/unread-27QyAoLL.css +1 -0
  48. package/dist/app/assets/unread-Cpm8TUDq.js +4 -0
  49. package/dist/app/index.html +7 -2
  50. package/dist/server/toil-ui.js +21912 -10488
  51. package/package.json +19 -17
  52. package/dist/app/assets/Graph-8jUpxY5T.js +0 -7
  53. package/dist/app/assets/PowershellMan-D_GfPDDt.js +0 -1
  54. package/dist/app/assets/index-BJY6F1XS.js +0 -504
  55. package/dist/app/assets/index-BWejFOaT.css +0 -1
  56. package/dist/app/assets/press-start-2p-latin-400-normal-KLytu4cr.woff +0 -0
  57. package/dist/app/assets/press-start-2p-latin-400-normal-_wFEWmAB.woff2 +0 -0
  58. package/dist/app/assets/source-serif-4-latin-ext-600-normal-0sIUyHMO.woff2 +0 -0
  59. package/dist/app/assets/source-serif-4-vietnamese-600-normal-CznyfUKR.woff2 +0 -0
  60. package/dist/app/assets/theme-Bd9rCh2b.css +0 -1
  61. package/dist/app/assets/theme-hbyLw_lf.css +0 -1
@@ -0,0 +1 @@
1
+ import{i as e,n as t,t as n}from"./jsx-runtime-DyZJNswf.js";var r=e(t(),1),i=new URL(`title-1MphWZoQ.webp`,import.meta.url).href,a=new URL(`sprites-BUKsxG6N.webp`,import.meta.url).href,o=n(),s=[{label:`THE RELEASE PIPELINE`,title:`FRIDAY. 16:59.`,narration:`Microsoft releases reach production through the packaging team. Reviewed, signed, and supported. Powershell Man finds this suspiciously boring.`,bubble:`Use the vendor release. Let Packaging verify and distribute it.`,speaker:`THE ARCHITECT`,caption:`A predictable release process. Our hero senses a problem.`},{label:`THE INTERNAL BUILD`,title:`WE'LL BUILD IT OURSELVES`,narration:`Powershell Man has a plan: compile PowerShell and other Microsoft software, then have Packaging distribute his internal binaries in place of Microsoft's releases.`,bubble:`Why wait for Microsoft? Packaging can ship MY builds instead!`,speaker:`POWERSHELL MAN`,caption:`The vendor release pipeline is now a folder called final_FINAL.`},{label:`THE REVIEW`,title:`THE ARCHITECT STRIKES`,narration:`The DevSecOps architect raises a clipboard shield. Someone has to own the replacement release chain after the first build succeeds.`,bubble:`Who owns signing, security updates, provenance, and support?`,speaker:`THE ARCHITECT`,caption:`He wants a supportable release chain. Powershell Man calls it villainy.`}];function c({onFinish:e,onSkip:t}){let[n,i]=(0,r.useState)(0),a=s[n],c=(0,r.useCallback)(()=>{n===s.length-1?e():i(e=>Math.min(e+1,s.length-1))},[n,e]);(0,r.useEffect)(()=>{let e=e=>{if(e.repeat)return;if(e.key===`Escape`){e.preventDefault(),t();return}if(e.key!==`Enter`&&e.key!==` `)return;let n=e.target;n instanceof HTMLElement&&(n.closest(`button`)||n.isContentEditable)||(e.preventDefault(),c())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[c,t]);function l(){i(e=>Math.max(0,e-1))}return(0,o.jsxs)(`section`,{className:`pm-story pm-story--panel-${n+1}`,"aria-label":`Powershell Man: origin story`,"aria-roledescription":`comic`,children:[(0,o.jsx)(`div`,{className:`pm-story__art`,"aria-hidden":`true`}),(0,o.jsx)(`div`,{className:`pm-story__shade`,"aria-hidden":`true`}),(0,o.jsxs)(`header`,{className:`pm-story__topline`,children:[(0,o.jsxs)(`span`,{children:[`TOIL COMICS `,(0,o.jsx)(`i`,{children:`✦`}),` INCIDENT ZERO`]}),(0,o.jsxs)(`span`,{className:`pm-story__counter`,"aria-label":`Panel ${n+1} of 3`,children:[String(n+1).padStart(2,`0`),` `,(0,o.jsx)(`b`,{children:`/`}),` 03`]})]}),(0,o.jsxs)(`div`,{className:`pm-story__content`,role:`group`,"aria-live":`polite`,"aria-atomic":`true`,"aria-label":`${a.label}, panel ${n+1} of 3`,children:[(0,o.jsx)(`div`,{className:`pm-story__eyebrow`,children:a.label}),(0,o.jsx)(`h1`,{children:a.title}),(0,o.jsx)(`p`,{className:`pm-story__narration`,children:a.narration}),(0,o.jsxs)(`div`,{className:`pm-story__bubble`,children:[(0,o.jsx)(`span`,{children:a.speaker}),(0,o.jsx)(`p`,{children:a.bubble})]}),(0,o.jsx)(`p`,{className:`pm-story__caption`,children:a.caption})]},n),(0,o.jsxs)(`footer`,{className:`pm-story__footer`,children:[(0,o.jsx)(`div`,{className:`pm-story__dots`,"aria-label":`Story progress`,children:s.map((e,t)=>(0,o.jsx)(`span`,{className:t===n?`is-current`:``,"aria-hidden":`true`},e.label))}),(0,o.jsxs)(`div`,{className:`pm-story__actions`,children:[(0,o.jsxs)(`button`,{className:`pm-story__skip`,onClick:t,children:[`SKIP STORY `,(0,o.jsx)(`kbd`,{children:`ESC`})]}),(0,o.jsxs)(`div`,{className:`pm-story__step-actions`,children:[(0,o.jsx)(`button`,{className:`pm-story__back`,onClick:l,disabled:n===0,"aria-label":`Previous panel`,children:`←`}),(0,o.jsxs)(`button`,{className:`pm-story__next`,onClick:c,children:[n===s.length-1?`START GAME`:`NEXT PANEL`,(0,o.jsx)(`span`,{"aria-hidden":`true`,children:` ↗`})]})]})]}),(0,o.jsx)(`div`,{className:`pm-story__hint`,"aria-hidden":`true`,children:`ENTER / SPACE TO ADVANCE`})]})]})}var l=new Image;l.src=a;var u=[],d=[];function f(){if(u.length||!l.naturalWidth)return;let e=document.createElement(`canvas`);e.width=l.naturalWidth,e.height=l.naturalHeight;let t=e.getContext(`2d`,{willReadFrequently:!0});if(!t)return;t.drawImage(l,0,0);let n=t.getImageData(0,0,e.width,e.height).data,r=e.width/8,i=[0,.265,.507,.727,1];u=Array.from({length:4},(t,a)=>Array.from({length:8},(t,o)=>{let s=Math.round(o*r),c=Math.round((i[a]??0)*e.height),l=Math.round((i[a+1]??1)*e.height)-c,u=Math.round(r),d=Math.round(l),f=0,p=0;for(let t=0;t<Math.floor(l);t++)for(let i=0;i<Math.floor(r);i++)(n[((c+t)*e.width+s+i)*4+3]??0)<32||(u=Math.min(u,i),d=Math.min(d,t),f=Math.max(f,i),p=Math.max(p,t));return{x:s+u,y:c+d,w:Math.max(1,f-u+1),h:Math.max(1,p-d+1)}}));let a=Math.max(...u.slice(0,2).flat().map(e=>e.h));d=[76/a,76/a,1,140/Math.max(...(u[3]??[]).map(e=>e.h))]}function p(e,t,n,r,i,a=1,o){let s=u[t]?.[n];if(!s)return;let c=o?o/Math.max(...(u[t]??[]).slice(n-n%2,n-n%2+2).map(e=>e.h)):d[t]??1;e.save(),e.translate(Math.round(r),Math.round(i)),e.scale(a,1),e.imageSmoothingEnabled=!1,e.drawImage(l,s.x,s.y,s.w,s.h,-s.w*c/2,-s.h*c,s.w*c,s.h*c),e.restore()}function m(e,t,n,r,i,a){if(r<.12)return;let o=Math.min(1,(r-.12)/.88),s=1+Math.sin(i/95)*.06;if(e.save(),e.globalCompositeOperation=`lighter`,a){e.globalAlpha=o*.22,e.filter=`blur(2px)`,p(e,2,7,t+Math.sin(i/150)*5,n+3,-1,(65+o*38)*s),e.filter=`none`,e.globalAlpha=.35+o*.4;for(let r=0;r<12;r++){let a=i/380+r*Math.PI/6,s=25+o*20+Math.sin(a*3)*4;e.fillStyle=r%2?`#8affed`:`#ffc5f1`,e.beginPath(),e.arc(t+Math.cos(a)*s,n-36+Math.sin(a)*s*1.15,.7+o,0,Math.PI*2),e.fill()}}else{let r=(42+o*30)*s,i=e.createRadialGradient(t,n-36,3,t,n-36,r);i.addColorStop(0,`rgba(100,240,255,${.12+o*.12})`),i.addColorStop(.5,`rgba(76,130,255,${o*.2})`),i.addColorStop(1,`rgba(70,80,255,0)`),e.fillStyle=i,e.fillRect(t-r,n-36-r,r*2,r*2),e.globalAlpha=.13+o*.18,e.filter=`blur(7px)`,p(e,2,7,t,n+12,1,(90+o*50)*s)}e.restore()}var h=960,g=540,_=1850,v=235,y=[{x:0,y:476,w:720,h:80},{x:790,y:476,w:520,h:80},{x:1400,y:476,w:740,h:80},{x:2240,y:476,w:720,h:80},{x:3060,y:476,w:760,h:80},{x:3900,y:476,w:740,h:80},{x:520,y:390,w:120,h:20},{x:925,y:370,w:140,h:20},{x:1190,y:410,w:120,h:20},{x:1640,y:370,w:150,h:20},{x:1900,y:405,w:130,h:20},{x:2460,y:380,w:140,h:20},{x:2780,y:410,w:130,h:20},{x:3270,y:365,w:150,h:20},{x:3550,y:400,w:130,h:20},{x:4100,y:370,w:160,h:20},{x:4390,y:400,w:150,h:20},{x:4740,y:476,w:650,h:80},{x:5470,y:476,w:650,h:80},{x:6260,y:476,w:680,h:80},{x:7090,y:476,w:640,h:80},{x:7880,y:476,w:1e3,h:80},{x:4930,y:400,w:130,h:20},{x:5700,y:380,w:140,h:20},{x:6030,y:410,w:120,h:20},{x:6530,y:370,w:150,h:20},{x:6840,y:405,w:130,h:20},{x:7370,y:375,w:140,h:20},{x:7660,y:410,w:120,h:20}],b=[0,1400,3060,4740,6260,7880],x=(e,t)=>e.type!==`phantom`||Math.sin(t/690+e.phase)<.45,S=()=>[...[300,620,1010,1320,1550,1810,2090,2360,2650,2960,3210,3470,3780,4050,4300,4610,4910,5180,5500,5810,6120,6400,6670,6940,7220,7490,7770].map((e,t)=>({x:e,y:465,hp:2,type:t%3==0?`job`:t%3==1?`alias`:`phantom`,base:e,phase:t*1.8})),{x:8310,y:405,hp:18,type:`boss`,base:8310,phase:0}];function C(e,t,n){let r=t.camera,i=e.createLinearGradient(0,0,0,g);i.addColorStop(0,`#071522`),i.addColorStop(1,`#102a3b`),e.fillStyle=i,e.fillRect(0,0,h,g);for(let t=0;t<28;t++){let n=((t*213-r*.22)%6200+6200)%6200-80,i=100+t*47%145;e.fillStyle=t%2?`#0b2130`:`#0d2636`,e.fillRect(n,470-i,92,i),e.fillStyle=`#17394a`;for(let t=485-i;t<455;t+=24)e.fillRect(n+12,t,6,7),e.fillRect(n+28,t,6,7),e.fillRect(n+62,t,6,7)}e.strokeStyle=`rgba(68,163,185,.08)`,e.lineWidth=1;for(let t=-(r%48);t<h;t+=48)e.beginPath(),e.moveTo(t,0),e.lineTo(t,g),e.stroke();for(let t of y){let n=t.x-r;if(!(n+t.w<-20||n>980)){e.fillStyle=`#193547`,e.fillRect(n,t.y,t.w,t.h),e.fillStyle=`#2b6270`,e.fillRect(n,t.y,t.w,5),e.fillStyle=`#102634`;for(let r=n+10;r<n+t.w-5;r+=40)e.fillRect(r,t.y+14,20,3)}}for(let[t,n]of[[520,`Execution Policy: Bypass?`],[1620,`Object → string`],[2780,`Final_v7_REAL.ps1`],[4120,`TODO: add retries`],[5660,`Reviewed by /dev/null`],[7130,`This log is not a database`]]){let i=t-r;i<-180||i>990||(e.fillStyle=`#302f3b`,e.fillRect(i,398,3,78),e.fillStyle=`#41394a`,e.fillRect(i-8,399,Math.min(190,n.length*6+18),30),e.fillStyle=`#f1b4c0`,e.font=`9px monospace`,e.fillText(n,i,418),e.fillStyle=`#ef77a5`,e.fillRect(i-2,396,7,4))}b.slice(1).forEach((t,i)=>{let a=t-r;a>-30&&a<990&&(e.fillStyle=`#f7b955`,e.fillRect(a,416,4,60),e.fillStyle=`rgba(247,185,85,${.2+.12*Math.sin(n/240)})`,e.beginPath(),e.arc(a+2,412,18,0,Math.PI*2),e.fill(),e.fillStyle=`#ffda8b`,e.font=`10px monospace`,e.fillText(`CHECKPOINT ${i+1}`,a-42,398))});for(let i of t.foes){let a=i.x-r,o=t.time-(i.hitAt??-1/0),s=i.hp<=0;if(!(a<-100||a>1060||s&&o>.45||!x(i,n)&&o>.3)){if(e.save(),o<.32&&e.translate((i.hitDirection??1)*Math.sin(o*Math.PI/.32)*9,0),s&&(e.globalAlpha=Math.max(0,1-o/.45),e.translate(0,-o*40)),o<.075&&(e.filter=`brightness(3) saturate(0.4)`),i.type===`boss`){if(p(e,3,o<.26?6+Math.min(1,Math.floor(o/.13)):t.bossTelegraph>0?4+Math.floor(n/100)%2:Math.floor(n/180)%4,a,476),t.bossTelegraph>0){let n=[`“Could we add validation before deploy?”`,`“Let’s keep this to least privilege.”`,`“One quick review before merge?”`][t.bossPhase];e.fillStyle=`#f3ebdf`,e.fillRect(a-120,276,240,26),e.fillStyle=`#302c39`,e.font=`10px monospace`,e.textAlign=`center`,e.fillText(n??`Please add a test.`,a,293),e.textAlign=`start`,e.fillStyle=`#ef77a5`,e.fillRect(a-3,301,6,8)}}else{let t=i.y;p(e,2,(i.type===`job`?0:i.type===`alias`?2:4)+Math.floor(n/140+i.phase)%2,a,t+9,1,i.type===`phantom`?46:39),e.fillStyle=`#d8b9bc`,e.font=`8px monospace`,e.textAlign=`center`,e.fillText(i.type===`job`?`JOB`:i.type===`alias`?`ALIAS`:`PROFILE`,a,t-30),e.textAlign=`start`}if(e.filter=`none`,o<.25&&(e.globalAlpha=1-o/.25,p(e,2,7,a,(i.type===`boss`?425:i.y)+14,1,24+o*120)),s){e.fillStyle=`#ffb8e6`;for(let t=0;t<8;t++){let n=t*Math.PI/4;e.fillRect(a+Math.cos(n)*o*95,i.y-12+Math.sin(n)*o*80,3,3)}}e.restore()}}for(let n of t.shots){let t=n.x-r,i=n.hostile?`#ffb547`:n.charge>0?`#8affed`:`#ff58a5`;e.strokeStyle=i,e.lineWidth=n.charge?5:3,e.shadowBlur=n.charge?14:7,e.shadowColor=i,e.beginPath(),e.moveTo(t-n.vx*.035,n.y-n.vy*.035),e.bezierCurveTo(t-n.vx*.024+3,n.y-n.vy*.025+5,t-n.vx*.012-4,n.y-n.vy*.012-5,t,n.y),e.stroke(),e.fillStyle=i,e.fillRect(t-3,n.y-3,6,6),e.shadowBlur=0}let a=t.player,o=a.x-r,s=a.y;if(!(a.invuln>0&&Math.floor(n/65)%2==0)){let r=t.time-t.lastFire<.23,i=Math.abs(a.vx)>1,c=a.grounded&&i&&!r?0:1,l=c===0?Math.floor(n/75)%8:r?5+Math.min(2,Math.floor((t.time-t.lastFire)/.077)):a.grounded?Math.floor(n/320)%2:a.vy<-160?2:a.vy<150?3:4;m(e,o,s,t.charge,n,!1),p(e,c,l,o,s,a.face),m(e,o,s,t.charge,n,!0),t.charge>.85&&(e.strokeStyle=`#8affed`,e.lineWidth=1+t.charge,e.beginPath(),e.arc(o+a.face*27,s-44,5+t.charge*9+Math.sin(n/45)*2,0,Math.PI*2),e.stroke()),r&&p(e,2,6+Math.floor(n/65)%2,o+a.face*40,s-27,a.face,24)}}function w({onClose:e}){let[t,n]=(0,r.useState)(!1),[a,s]=(0,r.useState)(!1),[d,p]=(0,r.useState)(0);(0,r.useEffect)(()=>{let e=()=>{f(),n(u.length===4)},t=()=>s(!0);return l.addEventListener(`load`,e),l.addEventListener(`error`,t),l.complete&&(l.naturalWidth?e():t()),()=>{l.removeEventListener(`load`,e),l.removeEventListener(`error`,t)}},[]);let m=(0,r.useRef)(null),w=(0,r.useRef)(null),T=(0,r.useRef)(new Set),E=(0,r.useRef)(!1),[D,O]=(0,r.useState)(`intro`),[k,A]=(0,r.useState)(0),[j,M]=(0,r.useState)(8),[N,P]=(0,r.useState)(18),F=(0,r.useCallback)(()=>{w.current={player:{x:90,y:476,vx:0,vy:0,grounded:!0,face:1,invuln:0,health:8,checkpoint:0,coyote:.1,buffer:0,emergency:0,emergencyCooldown:0},foes:S(),shots:[],camera:0,charge:0,last:0,accumulator:0,shotAt:0,lastFire:-1/0,bossPhase:0,time:0,bossTelegraph:0,padJump:!1,padFire:!1,padEmergency:!1,padStart:!1},T.current.clear(),M(8),P(18),A(0),p(0),O(`playing`)},[]);(0,r.useEffect)(()=>{let e=m.current;if(!e)return;let t=e.getContext(`2d`);if(!t)return;let n=0,r=()=>{let n=Math.min(2,window.devicePixelRatio||1);e.width=Math.round(e.clientWidth*n),e.height=Math.round(e.clientHeight*n),t.setTransform(e.width/h,0,0,e.height/g,0,0)};r();let i=new ResizeObserver(r);i.observe(e);let a=e=>{if([`ArrowLeft`,`ArrowRight`,`ArrowUp`,`Space`].includes(e.code)&&e.preventDefault(),e.code===`Escape`){if(e.repeat)return;D===`playing`&&T.current.clear(),O(e=>e===`playing`?`paused`:e===`paused`?`playing`:e)}else e.code===`KeyR`&&(D===`won`||D===`lost`)?F():(D===`playing`&&!T.current.has(e.code)&&[`ArrowUp`,`KeyZ`,`Space`].includes(e.code)&&(E.current=!0),D===`playing`&&!T.current.has(e.code)&&e.code===`KeyC`&&w.current&&w.current.player.emergencyCooldown<=0&&(w.current.player.emergency=1.25,w.current.player.emergencyCooldown=7,w.current.player.invuln=1.25),T.current.add(e.code))},o=e=>{if(T.current.delete(e.code),D===`playing`&&e.code===`KeyX`&&w.current){let e=w.current,t=e.player;performance.now()-e.shotAt>180&&(e.shots.push({x:t.x+t.face*24,y:t.y-45,vx:t.face*(e.charge>.9?600:510),vy:0,life:1.5,charge:+(e.charge>.9)}),e.shotAt=performance.now(),e.lastFire=e.time),e.charge=0}};window.addEventListener(`keydown`,a),window.addEventListener(`keyup`,o);let s=(e,t)=>{t.time+=e;let n=t.time*1e3,r=t.player,i=T.current,a=navigator.getGamepads?.()[0],o=!!a?.buttons[0]?.pressed,s=!!a?.buttons[2]?.pressed,c=!!a?.buttons[1]?.pressed,l=!!a?.buttons[9]?.pressed;o&&!t.padJump&&(E.current=!0),c&&!t.padEmergency&&r.emergencyCooldown<=0&&(r.emergency=1.25,r.emergencyCooldown=7,r.invuln=1.25),l&&!t.padStart&&(T.current.clear(),O(`paused`)),s&&!t.padFire&&(t.charge=0),!s&&t.padFire&&performance.now()-t.shotAt>180&&(t.shots.push({x:r.x+r.face*24,y:r.y-45,vx:r.face*(t.charge>.9?600:510),vy:0,life:1.5,charge:+(t.charge>.9)}),t.shotAt=performance.now(),t.lastFire=t.time,t.charge=0),t.padJump=o,t.padFire=s,t.padEmergency=c,t.padStart=l,r.invuln=Math.max(0,r.invuln-e),r.emergency=Math.max(0,r.emergency-e),r.emergencyCooldown=Math.max(0,r.emergencyCooldown-e),r.coyote=r.grounded?.11:Math.max(0,r.coyote-e),r.buffer=E.current?.12:Math.max(0,r.buffer-e),E.current=!1;let u=a?.axes[0]??0,d=(i.has(`ArrowRight`)||i.has(`KeyD`)||u>.25||a?.buttons[15]?.pressed?1:0)-(i.has(`ArrowLeft`)||i.has(`KeyA`)||u<-.25||a?.buttons[14]?.pressed?1:0);d&&(r.face=d),r.vx=d*v,r.buffer&&r.coyote&&(r.vy=-665,r.grounded=!1,r.coyote=0,r.buffer=0),(i.has(`KeyX`)||s)&&(t.charge=Math.min(1,t.charge+e/1.2)),r.vy=Math.min(1e3,r.vy+_*e);let f=r.x;r.x=Math.max(18,Math.min(8780,r.x+r.vx*e));let m=r.y;r.y+=r.vy*e,r.grounded=!1;for(let e of y){let t=r.x+12>e.x&&r.x-12<e.x+e.w,n=r.y>e.y&&r.y-54<e.y+e.h;t&&(m<=e.y&&r.y>=e.y&&r.vy>=0?(r.y=e.y,r.vy=0,r.grounded=!0):m-54>=e.y+e.h&&r.y-54<e.y+e.h&&r.vy<0&&(r.y=e.y+e.h+54,r.vy=0)),n&&(f+12<=e.x&&r.x+12>e.x?(r.x=e.x-12,r.vx=0):f-12>=e.x+e.w&&r.x-12<e.x+e.w&&(r.x=e.x+e.w+12,r.vx=0))}r.y>620&&(r.health=0);for(let i of t.shots){if(i.x+=i.vx*e,i.y+=i.vy*e,i.life-=e,!i.hostile){for(let e of t.foes)if(e.hp>0&&x(e,n)&&Math.abs(i.x-e.x)<(e.type===`boss`?44:23)&&Math.abs(i.y-e.y)<(e.type===`boss`?118:36)){e.hp-=i.charge?3:1,e.hitAt=t.time,e.hitDirection=Math.sign(i.vx),p(e=>e+1),i.life=0,e.type===`boss`&&P(e.hp);break}}i.hostile&&Math.abs(i.x-r.x)<20&&Math.abs(i.y-(r.y-20))<30&&!r.invuln&&(r.health--,r.invuln=1.2,i.life=0)}t.shots=t.shots.filter(e=>e.life>0&&e.x>t.camera-100&&e.x<t.camera+h+100);for(let i of t.foes)if(!(i.hp<=0)){if(i.type===`boss`){i.x=Math.max(8110,Math.min(8510,i.base+Math.sin(n/1100)*160)),i.phase+=e;let a=i.hp>12?0:i.hp>6?1:2;t.bossPhase=a;let o=a===0?1.5:a===1?1.2:.9;if(t.bossTelegraph=i.phase>o-.35?o-i.phase:0,i.phase>o){i.phase=0,t.bossTelegraph=0;let e=r.x-i.x,n=r.y-22-382,o=Math.hypot(e,n)||1,s=a===2?3:1;for(let r=0;r<s;r++){let a=(r-(s-1)/2)*.2,c=e/o*300,l=n/o*300;t.shots.push({x:i.x,y:382,vx:c*Math.cos(a)-l*Math.sin(a),vy:c*Math.sin(a)+l*Math.cos(a),life:3.2,charge:0,hostile:!0})}}}else i.x=i.type===`job`?i.base+Math.sin(n/640+i.phase)*65:i.base+Math.sin(n/480+i.phase)*32,i.y=i.type===`alias`?465-Math.max(0,Math.sin(n/250+i.phase))*42:465,x(i,n)&&Math.abs(i.x-r.x)<28&&Math.abs(i.y-22-(r.y-35))<35&&!r.invuln&&(r.health--,r.invuln=1)}if(r.health<=0)r.health=0,M(0),O(`lost`);else{for(let e=r.checkpoint+1;e<b.length;e++)r.x>(b[e]??1/0)&&(r.checkpoint=e);t.camera=Math.max(0,Math.min(7900,r.x-290)),M(r.health),A(t.charge),(t.foes.at(-1)?.hp??18)<=0&&O(`won`)}},c=e=>{if(D===`playing`){let n=w.current;if(n){n.last||=e;let r=Math.min(.05,(e-n.last)/1e3);for(n.last=e,n.accumulator+=r;n.accumulator>=1/120;)s(1/120,n),n.accumulator-=1/120;C(t,n,n.time*1e3)}}else if(w.current)C(t,w.current,w.current.time*1e3);else{t.fillStyle=`#071522`,t.fillRect(0,0,h,g);for(let e=0;e<18;e++)t.fillStyle=e%2?`#0b2130`:`#0d2636`,t.fillRect(e*61,270+e%4*19,48,250)}n=requestAnimationFrame(c)};return n=requestAnimationFrame(c),()=>{cancelAnimationFrame(n),i.disconnect(),window.removeEventListener(`keydown`,a),window.removeEventListener(`keyup`,o)}},[D,F]),(0,r.useEffect)(()=>{let e=()=>{T.current.clear(),O(e=>e===`playing`?`paused`:e)},t=()=>{document.hidden&&e()};return document.addEventListener(`visibilitychange`,t),window.addEventListener(`blur`,e),()=>{document.removeEventListener(`visibilitychange`,t),window.removeEventListener(`blur`,e)}},[]);let I=w.current;return(0,o.jsxs)(`section`,{className:`pm-game`,"aria-label":`Powershell Man game`,"data-game-state":D,"data-health":j,"data-boss-health":N,"data-charge":k.toFixed(2),"data-player-x":I?.player.x.toFixed(0),"data-player-y":I?.player.y.toFixed(0),"data-checkpoint":I?.player.checkpoint,"data-sprites-ready":t,"data-hit-count":d,children:[(0,o.jsx)(`canvas`,{ref:m,className:`pm-canvas`,"aria-label":`Game screen. Arrow keys or A and D to move, Z or Space to jump, X to fire, Escape to pause.`}),D===`playing`&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(`div`,{className:`pm-hud`,children:[(0,o.jsxs)(`div`,{children:[(0,o.jsx)(`b`,{children:`POWERSHELL MAN`}),(0,o.jsx)(`span`,{children:`INCIDENT RESPONSE / FIELD OPS`})]}),(0,o.jsxs)(`div`,{className:`pm-life`,children:[(0,o.jsx)(`span`,{title:`Works on My Machine`,children:`HP`}),Array.from({length:8},(e,t)=>(0,o.jsx)(`i`,{className:t<j?`on`:``},t))]}),(0,o.jsxs)(`div`,{className:`pm-charge`,children:[(0,o.jsx)(`span`,{children:`CHARGE`}),(0,o.jsx)(`progress`,{max:`100`,value:k*100})]}),(0,o.jsxs)(`span`,{className:`pm-emergency`,"data-ready":I&&I.player.emergencyCooldown<=0,children:[`C · SilentlyContinue`,` `,I?`${Math.ceil(I.player.emergencyCooldown)}s`:``]}),(0,o.jsx)(`button`,{onClick:()=>O(`paused`),"aria-label":`Pause`,children:`Ⅱ`})]}),(I?.foes.at(-1)?.x??1/0)-(I?.camera??0)<900&&(0,o.jsxs)(`div`,{className:`pm-bossbar`,children:[(0,o.jsxs)(`span`,{children:[`COMMON-SENSE DEVSECOPS ARCHITECT · PHASE`,` `,(I?.bossPhase??0)+1,I?.bossTelegraph?` · REVIEWING TARGET`:``]}),(0,o.jsx)(`progress`,{max:`18`,value:Math.max(0,N)})]}),(0,o.jsx)(`div`,{className:`pm-controls`,children:`← → move\xA0\xA0 Z jump\xA0\xA0 X fire / release to shoot\xA0\xA0 C emergency\xA0\xA0 Esc pause`})]}),D===`story`&&(0,o.jsx)(c,{onFinish:F,onSkip:F}),D!==`playing`&&D!==`story`&&(0,o.jsxs)(`div`,{className:`pm-overlay ${D===`intro`?`pm-overlay--intro`:``}`,children:[D===`intro`&&(0,o.jsx)(`img`,{className:`pm-title-art`,src:i,alt:``}),(0,o.jsxs)(`div`,{className:`pm-card`,children:[(0,o.jsx)(`div`,{className:`pm-kicker`,children:`TOIL SYSTEMS // INCIDENT RESPONSE SIMULATOR`}),(0,o.jsx)(`h1`,{children:D===`intro`?`POWERSHELL MAN`:D===`paused`?`PAUSED`:D===`won`?`PRODUCTION RESTORED`:`INCIDENT UNRECOVERED`}),D===`intro`?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`p`,{children:`Compile the stack. Replace the vendor release. Hand Packaging the consequences.`}),(0,o.jsxs)(`div`,{className:`pm-how`,children:[(0,o.jsxs)(`div`,{children:[(0,o.jsx)(`strong`,{children:`MOVE`}),(0,o.jsx)(`span`,{children:`← → or A / D`})]}),(0,o.jsxs)(`div`,{children:[(0,o.jsx)(`strong`,{children:`JUMP`}),(0,o.jsx)(`span`,{children:`Z or Space`})]}),(0,o.jsxs)(`div`,{children:[(0,o.jsx)(`strong`,{children:`FIRE`}),(0,o.jsx)(`span`,{children:`X · hold to charge`})]}),(0,o.jsxs)(`div`,{children:[(0,o.jsx)(`strong`,{children:`PAUSE`}),(0,o.jsx)(`span`,{children:`Esc`})]})]}),(0,o.jsx)(`p`,{className:`pm-threat`,children:`Alias gremlins · orphan jobs · profile phantoms · one architect with opinions.`}),(0,o.jsx)(`p`,{className:`pm-gamepad-note`,children:`GAMEPAD · left stick / D-pad move · A jump · X hold/release fire · B emergency · Start pause`}),a&&(0,o.jsx)(`p`,{role:`alert`,children:`The sprite sheet could not load. Reload the page to retry.`}),(0,o.jsxs)(`button`,{onClick:()=>O(`story`),disabled:!t,children:[t?`START INCIDENT`:`LOADING SPRITES…`,` `,(0,o.jsx)(`span`,{children:`↗`})]}),(0,o.jsx)(`button`,{className:`pm-secondary`,onClick:e,children:`BACK TO WORK`})]}):D===`paused`?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`p`,{children:`Runbooks can wait. The incident will not progress while paused.`}),(0,o.jsxs)(`button`,{onClick:()=>{I&&(I.last=0),O(`playing`)},children:[`RESUME `,(0,o.jsx)(`span`,{children:`↗`})]}),(0,o.jsx)(`button`,{className:`pm-secondary`,onClick:e,children:`EXIT SIMULATOR`})]}):D===`won`?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`p`,{children:`DEPLOYMENT SUCCESSFUL · Fine.`}),(0,o.jsx)(`p`,{className:`pm-joke`,children:`The architect approved the deploy. You now own the on-call rotation. Maintenance begins at 02:00.`}),(0,o.jsxs)(`button`,{onClick:F,children:[`RUN IT BACK `,(0,o.jsx)(`span`,{children:`↗`})]}),(0,o.jsx)(`button`,{className:`pm-secondary`,onClick:e,children:`BACK TO WORK`})]}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`p`,{children:`Emergency SilentlyContinue: the incident got you. Your last checkpoint is still intact.`}),(0,o.jsxs)(`button`,{onClick:()=>{if(I){let e=b[I.player.checkpoint]??7880;I.player.x=e+40,I.player.y=476,I.player.vy=0,I.player.health=8,I.player.invuln=2,I.shots=[];for(let t of I.foes)t.type!==`boss`&&t.x<e&&(t.hp=0);M(8),O(`playing`)}},children:[`RESPAWN AT CHECKPOINT `,(0,o.jsx)(`span`,{children:`↗`})]}),(0,o.jsx)(`button`,{className:`pm-secondary`,onClick:F,children:`RESTART LEVEL · R`}),(0,o.jsx)(`button`,{className:`pm-secondary`,onClick:e,children:`BACK TO WORK`})]})]})]})]})}export{w as PowershellMan};
@@ -0,0 +1 @@
1
+ import{i as e,n as t,t as n}from"./jsx-runtime-DyZJNswf.js";import{B as r,G as i,H as a,I as o,J as s,K as c,L as l,R as u,U as d,V as f,W as p,Y as m,q as h,z as g}from"./index-lUb0DGcI.js";import{k as _}from"./unread-Cpm8TUDq.js";var v=e(t(),1),y=(e,t=0,n=t)=>({value:e,items:[],measured:e===null?0:n,of:t,...e===null?{reason:`No item in it has an estimate`}:{}}),b=e=>e.every(e=>e===null)?null:e.reduce((e,t)=>e+(t??0),0);function x(e){let t=e.measure??{id:`items`,unit:`items`,label:`Items`},n=e.values.map((t,n)=>t.map((t,r)=>y(t,t===null?3:Math.round(t),e.partial?.[`${n},${r}`]??Math.round(t??0)))),r=e.columns.map((t,n)=>b(e.values.map(e=>e[n])));n.forEach(e=>e.forEach((e,t)=>{let n=r[t];e.share=e.value===null||!n?null:e.value/n}));let i=e.values.map(e=>y(b(e),1)),a=b(r);return{spec:{measure:t.id,share:!0},asOf:`2026-11-09T12:00:00Z`,period:{from:`2026-08-11`,to:`2026-11-09`},measure:t,split:e.split===null?null:{kind:`single`,read:!0,...e.split??{spec:`category`,label:`Category`}},across:e.across===null?null:{kind:`time`,read:!0,...e.across??{spec:`created:month`,label:`Created, by month`}},rows:e.rows,columns:e.columns,cells:n,rowTotals:i,columnTotals:r.map(e=>y(e,1)),total:y(a,1),allValues:e.rows.map((e,t)=>({key:e.key,label:e.label,value:i[t].value,items:Math.round(i[t].value??0)})),coverage:{items:0,measured:0,unreadSplit:0,unreadAcross:0,parentsLeftOut:0,multi:!1,notes:e.notes??[]},notable:[]}}var S=(e,t,n)=>({key:`v:${e}`,label:t,kind:`value`,...n?{short:n}:{}}),C={key:`(other)`,label:`Other`,kind:`other`},w=e=>({key:`(none)`,label:e,kind:`none`}),T=[`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`].map(e=>S(`2026-${e}`,e)),E=x({measure:{id:`estimate`,unit:`points`,label:`Estimate`},split:{spec:`category`,label:`Category`},across:{spec:`created:month`,label:`Created, by month`},rows:[S(`ktlo`,`Keep the lights on`,`KTLO`),S(`features`,`New features`,`FEAT`),C,w(`Unsure`)],columns:T,values:[[14,18,20,null,26,24],[30,28,31,35,29,33],[4,5,3,6,4,5],[6,4,5,3,2,3]],partial:{"0,5":3},notes:[`One month of Keep the lights on has no estimate on any item, so it is a dash, not a zero.`]}),D=x({measure:{id:`items`,unit:`items`,label:`Items`},rows:[S(`ktlo`,`Keep the lights on`,`KTLO`),S(`features`,`New features`,`FEAT`),C,w(`Unsure`)],columns:T,values:[[14,18,20,17,26,24],[30,28,31,35,29,33],[4,5,3,6,4,5],[6,4,5,3,2,3]]}),O=x({split:{spec:`release`,label:`Release`,kind:`multi`},across:{spec:`type`,label:`Type`},rows:[S(`4.2`,`4.2`),S(`4.3`,`4.3`),S(`4.4`,`4.4`),S(`4.5`,`4.5`),C,w(`No fix version`)],columns:[S(`story`,`Story`),S(`bug`,`Bug`),S(`task`,`Task`),S(`incident`,`Incident`)],values:[[24,9,7,1],[18,12,6,0],[11,6,9,2],[8,3,4,0],[5,4,2,1],[9,14,10,3]],notes:[`An item with several fix versions counts once in each, so the rows add up to more than the total.`]}),k=x({split:{spec:`statusCategory`,label:`Status`},across:{spec:`resolved:day`,label:`Resolved, by day`},rows:[S(`done`,`Done`)],columns:Array.from({length:10},(e,t)=>S(`d${t}`,`Nov ${t+1}`)),values:[[0,2,5,6,9,12,13,17,19,22]]}),A=[30,30,32,32,32,35,35,35,36,36],j={low:[null,null,null,null,null,null,null,17,21,26],high:[null,null,null,null,null,null,null,17,25,36],label:`Forecast`},M={...D,split:{spec:`release`,label:`Release`,kind:`multi`,read:!1},rows:[],cells:[],rowTotals:[]},N=x({split:{spec:`category`,label:`Category`},across:null,rows:[S(`ktlo`,`Keep the lights on`,`KTLO`),S(`features`,`New features`,`FEAT`),C,w(`Unsure`)],columns:[{key:_,label:`All items`,kind:`value`}],values:[[8],[11],[2],[1]]}),P=n(),F={categories:[{id:`ktlo`},{id:`features`}]},I=`Sample data. Nothing here was read from a tool.`;function L(){let[e]=s();(0,v.useEffect)(()=>{if(!/^#\/chartkit\?.*simple/.test(window.location.hash))return;let t=e;return h(!0),()=>h(t)},[])}function R(){L();let e=c(),t=i(),[n,h]=s(),[_,y]=(0,v.useState)(`Nothing clicked yet.`),b=e=>y(`Drilled into ${e.row.label}, ${e.column.label}.`),x={onDrill:b,onFilter:e=>y(`Filtered to ${e.row.label}, ${e.column.label}.`),source:I};return(0,P.jsxs)(`div`,{className:`ck-gallery`,"data-chartkit-gallery":``,children:[(0,P.jsxs)(`header`,{children:[(0,P.jsx)(`h1`,{children:`Chart kit`}),(0,P.jsx)(`p`,{className:`note`,role:`status`,children:_}),(0,P.jsxs)(`label`,{className:`note`,children:[(0,P.jsx)(`input`,{type:`checkbox`,checked:n,onChange:e=>h(e.target.checked)}),` Simple chart marks`]})]}),(0,P.jsxs)(`section`,{"aria-labelledby":`ck-marks`,children:[(0,P.jsx)(`h2`,{id:`ck-marks`,children:`The four marks, Other and None`}),(0,P.jsxs)(`ul`,{className:`ck-legend`,children:[e.map((e,n)=>(0,P.jsx)(`li`,{className:`ck-legend__item`,children:(0,P.jsxs)(`span`,{className:`ck-legend__btn`,children:[(0,P.jsx)(m,{mark:e,frames:t}),(0,P.jsxs)(`span`,{children:[`Mark `,n+1]})]})},e.name)),(0,P.jsx)(`li`,{className:`ck-legend__item`,children:(0,P.jsxs)(`span`,{className:`ck-legend__btn`,children:[(0,P.jsx)(m,{kind:`other`}),(0,P.jsx)(`span`,{children:`Other`})]})}),(0,P.jsx)(`li`,{className:`ck-legend__item`,children:(0,P.jsxs)(`span`,{className:`ck-legend__btn`,children:[(0,P.jsx)(m,{kind:`none`}),(0,P.jsx)(`span`,{children:`None`})]})})]})]}),(0,P.jsx)(`section`,{children:(0,P.jsx)(p,{title:`Work mix by month, in points`,result:E,scheme:F,...x,children:e=>(0,P.jsx)(d,{view:e})})}),(0,P.jsx)(`section`,{children:(0,P.jsx)(p,{title:`Work mix by month, as bars`,result:D,scheme:F,defaultMode:`share`,...x,children:e=>(0,P.jsx)(a,{view:e})})}),(0,P.jsx)(`section`,{children:(0,P.jsx)(p,{title:`Releases by type`,result:O,...x,children:e=>(0,P.jsx)(a,{view:e})})}),(0,P.jsx)(`section`,{children:(0,P.jsx)(p,{title:`Work mix over time`,result:D,scheme:F,...x,children:e=>(0,P.jsx)(f,{view:e})})}),(0,P.jsx)(`section`,{children:(0,P.jsx)(p,{title:`Burn-up with a forecast`,result:k,modes:!1,legend:`line`,...x,children:e=>(0,P.jsx)(l,{view:e,scope:A,forecast:j})})}),(0,P.jsx)(`section`,{children:(0,P.jsx)(p,{title:`Work mix, as a heatmap`,result:E,legend:`none`,...x,children:e=>(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(o,{view:e}),(0,P.jsx)(g,{})]})})}),(0,P.jsx)(`section`,{children:(0,P.jsx)(p,{title:`Work mix, one chart for each`,result:D,scheme:F,legend:`none`,...x,children:e=>(0,P.jsx)(r,{view:e})})}),(0,P.jsx)(`section`,{children:(0,P.jsx)(p,{title:`A release split nobody read`,result:M,...x,unreadAction:(0,P.jsx)(`button`,{type:`button`,children:`Read releases`}),children:e=>(0,P.jsx)(d,{view:e})})}),(0,P.jsxs)(`section`,{"aria-labelledby":`ck-mix`,children:[(0,P.jsx)(`h2`,{id:`ck-mix`,children:`A mix bar, for a card`}),(0,P.jsx)(u,{result:N,scheme:F,label:`Work mix`,onDrill:b})]})]})}export{R as ChartkitGallery,R as default};