droidsembly 0.4.0-beta.1 → 0.4.0-beta.3

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 (116) hide show
  1. package/LICENSE +21 -21
  2. package/README.it.md +193 -184
  3. package/README.md +193 -184
  4. package/bin/distribution.d.ts +3 -3
  5. package/bin/distribution.js +48 -48
  6. package/dist/THIRD_PARTY_LICENSES.txt +240 -240
  7. package/dist/assets/AccessibilitySettings-HB1JfQbh.js +30 -0
  8. package/dist/assets/AppViewer-0Bly3EdB.js +5 -0
  9. package/dist/assets/Balloon-B6odnAlm.js +1 -0
  10. package/dist/assets/{Batched-BOgjreKO.js → Batched-CTJWq46z.js} +1 -1
  11. package/dist/assets/Birds-DSS0OIz9.js +1 -0
  12. package/dist/assets/Blimp-CZt6dddK.js +1 -0
  13. package/dist/assets/{BufferGeometryUtils-BsmWvcA2.js → BufferGeometryUtils-CmpUrBC5.js} +1 -1
  14. package/dist/assets/Duck-BnRLkodp.js +1 -0
  15. package/dist/assets/{Effects-CNyhhFkE.js → Effects-Bkewth1L.js} +2 -2
  16. package/dist/assets/{Fireworks-CJfDJOeb.js → Fireworks-Cvn8YKWd.js} +2 -2
  17. package/dist/assets/Helicopter-BDrFQMNX.js +1 -0
  18. package/dist/assets/{Hurricane-9WqZGyZg.js → Hurricane-C8hyFXjx.js} +2 -2
  19. package/dist/assets/Kaiju-Bxxe9DG0.js +1 -0
  20. package/dist/assets/Meteors-UdYL0Tbv.js +1 -0
  21. package/dist/assets/MissionConsole-DJRtojZP.js +1 -0
  22. package/dist/assets/Office-9Mank16i.js +563 -0
  23. package/dist/assets/PhotoPanel-C_njIXp0.js +1 -0
  24. package/dist/assets/PhotoScene-DwpeJjGe.js +115 -0
  25. package/dist/assets/Plane-DzvUAUYE.js +1 -0
  26. package/dist/assets/Pocket-A1iI6Ivy.js +2 -0
  27. package/dist/assets/{Rainbow-CdcWsmW8.js → Rainbow-CV1rD6rW.js} +2 -2
  28. package/dist/assets/Roof-DSpKcGXK.js +34 -0
  29. package/dist/assets/{Shell-BmnZn4UL.js → Shell-GaQY3zre.js} +2 -2
  30. package/dist/assets/Skywriting-D4B2ZvH7.js +1 -0
  31. package/dist/assets/TerminalView-DhmLqjYn.js +17 -0
  32. package/dist/assets/ToyWorld-DeQUxcuy.js +1 -0
  33. package/dist/assets/Ufo-CitoxReu.js +1 -0
  34. package/dist/assets/Whale-Btx5ph-T.js +1 -0
  35. package/dist/assets/all-gw-szDg1.js +11 -0
  36. package/dist/assets/bloomMarks-DRhDp19k.js +4231 -0
  37. package/dist/assets/cheerRules-DWb8Qwzg.js +1 -0
  38. package/dist/assets/{cityLayout-7ckfe3wf.js → cityLayout-aA2Ktgpu.js} +1 -1
  39. package/dist/assets/{dogState-DiOvoobI.js → dogState-DY7tJEVD.js} +1 -1
  40. package/dist/assets/{doors-BHKj8tkO.js → doors-BlKvxXVp.js} +1 -1
  41. package/dist/assets/{gallery-ColCPQQE.js → gallery-COKuWb9E.js} +1 -1
  42. package/dist/assets/gate-D0uU0wv5.js +2 -0
  43. package/dist/assets/index-CDJgPTOC.js +10 -0
  44. package/dist/assets/{instantReplay-DGiLgvkQ.js → instantReplay-BjoV6jrY.js} +1 -1
  45. package/dist/assets/interact-0jqx03Xr.js +1 -0
  46. package/dist/assets/jsx-runtime-CXW0f58S.js +1 -0
  47. package/dist/assets/jukeboxSongs-CUwHJ1cS.js +1 -0
  48. package/dist/assets/{kit-C6ByUQ-Y.js → kit-n-eqZ1AT.js} +1 -1
  49. package/dist/assets/mic-BnAa4E99.js +1 -0
  50. package/dist/assets/photoMode-BybFMLKC.js +1 -0
  51. package/dist/assets/{pipeline-BOTOZ69L.js → pipeline-BGPWXegt.js} +1 -1
  52. package/dist/assets/rapier-CrXmTSyE.js +1 -0
  53. package/dist/assets/rig-DfdntE8m.js +1 -0
  54. package/dist/assets/rolldown-runtime-XKyaHtl9.js +1 -0
  55. package/dist/assets/{speechLanguage-BtfdhZNI.js → speechLanguage-DfsQvU9M.js} +1 -1
  56. package/dist/assets/store-CXLtXw8e.js +5 -0
  57. package/dist/assets/useDayTime-BjBDzh_t.js +1 -0
  58. package/dist/assets/{useGraphics-Cif18p7Q.js → useGraphics-Bg6L4EdS.js} +1 -1
  59. package/dist/assets/voiceMessages-CFLyZLZ4.js +1 -0
  60. package/dist/assets/weatherState-BJVm5hU-.js +1 -0
  61. package/dist/icons/Sora-OFL.txt +93 -93
  62. package/dist/icons/badge.svg +1 -1
  63. package/dist/icons/droid-antenna.svg +29 -29
  64. package/dist/icons/droid-eyes.svg +29 -29
  65. package/dist/icons/droid-shell.svg +29 -29
  66. package/dist/icons/droid-spark.svg +29 -29
  67. package/dist/icons/droid-wire.svg +29 -29
  68. package/dist/icons/favicon.svg +1 -1
  69. package/dist/icons/icon.svg +29 -29
  70. package/dist/icons/logo-dark.svg +29 -29
  71. package/dist/icons/logo-light.svg +29 -29
  72. package/dist/index.html +26 -25
  73. package/dist/manifest.webmanifest +19 -19
  74. package/dist/third-party-licenses.json +3 -3
  75. package/dist-server/browser-init.js +24 -24
  76. package/dist-server/index.js +125 -42
  77. package/dist-server/index.js.map +4 -4
  78. package/dist-server/ptyHost.js.map +1 -1
  79. package/package.json +98 -98
  80. package/dist/assets/AccessibilitySettings-DSmFk9JC.js +0 -30
  81. package/dist/assets/AppViewer-alNn4TBB.js +0 -5
  82. package/dist/assets/Balloon-UTs7npGo.js +0 -1
  83. package/dist/assets/Birds-BA2HM-AD.js +0 -1
  84. package/dist/assets/Blimp-CTykuz6B.js +0 -1
  85. package/dist/assets/Duck-DH63jUrP.js +0 -1
  86. package/dist/assets/Helicopter-CW_SP7xP.js +0 -1
  87. package/dist/assets/Kaiju-SpSi_jBg.js +0 -1
  88. package/dist/assets/Meteors-DvjhLfbF.js +0 -1
  89. package/dist/assets/MissionConsole-BEP5CdC8.js +0 -1
  90. package/dist/assets/Office-BBnd6tyn.js +0 -563
  91. package/dist/assets/PhotoPanel-DehErnsv.js +0 -1
  92. package/dist/assets/PhotoScene-Ce-dzToM.js +0 -115
  93. package/dist/assets/Plane-0nfvzL_c.js +0 -1
  94. package/dist/assets/Pocket-CBoyL0ra.js +0 -2
  95. package/dist/assets/Roof-mkMKniSZ.js +0 -34
  96. package/dist/assets/Skywriting-06dZPAfg.js +0 -1
  97. package/dist/assets/TerminalView-wlhSixSH.js +0 -17
  98. package/dist/assets/ToyWorld-Cuu9aW-K.js +0 -1
  99. package/dist/assets/Ufo-iHaoe5t1.js +0 -1
  100. package/dist/assets/Whale-DZg88zIX.js +0 -1
  101. package/dist/assets/all-CYErCTCA.js +0 -11
  102. package/dist/assets/bloomMarks-DariC6lY.js +0 -4231
  103. package/dist/assets/cheerRules-CZGSrxOB.js +0 -1
  104. package/dist/assets/gate-BplJKcLG.js +0 -2
  105. package/dist/assets/index-B6qvKFYN.js +0 -10
  106. package/dist/assets/interact-0qw7BGhL.js +0 -1
  107. package/dist/assets/jsx-runtime-BFUkm7bt.js +0 -1
  108. package/dist/assets/jukeboxSongs-CjbAzAeb.js +0 -1
  109. package/dist/assets/mic-B316hcCe.js +0 -1
  110. package/dist/assets/photoMode-CYxQfgUF.js +0 -1
  111. package/dist/assets/rapier-CXAOW8OC.js +0 -1
  112. package/dist/assets/rig-wAyl3G1G.js +0 -1
  113. package/dist/assets/store-FA83kfnc.js +0 -5
  114. package/dist/assets/useDayTime-0XsqM14Q.js +0 -1
  115. package/dist/assets/voiceMessages-DtNmUazr.js +0 -1
  116. package/dist/assets/weatherState-ExG1doW-.js +0 -1
@@ -0,0 +1,5 @@
1
+ import{n as e,r as t}from"./rolldown-runtime-XKyaHtl9.js";import{a as n,s as r,t as i}from"./jsx-runtime-CXW0f58S.js";import{c as a,o,s}from"./index-CDJgPTOC.js";import{Bt as c,Gt as l,Ht as u,Jt as d,Kt as f,Rt as p,Vt as m,Wt as h,Xt as g,Yt as _,Zt as v,c as y,p as b,qt as x,zt as S}from"./store-CXLtXw8e.js";import{L as C,N as w,h as T,m as E,p as D}from"./AccessibilitySettings-HB1JfQbh.js";var O=t(r(),1),k=3e4,A=n(()=>({channels:{}}));function j(e){let t=A(t=>t.channels[e]),n=b(t=>t.repos.find(t=>t.id===e)?.pulls);return l(t,n??[])}function M(e,t){b.getState().replaying?b.getState().pushToast(`info`,`▶ Replaying: the PR theatre is live only. Press Esc to go back to the live office.`):(A.setState(n=>({channels:{...n.channels,[e]:t}})),t==null||b.getState().prPreviews[y(e,t)]||a.startPrPreview(e,t).catch(()=>void 0))}var N=(()=>{try{return crypto.randomUUID()}catch{return`viewer-${Math.random().toString(36).slice(2)}-${Date.now().toString(36)}`}})();function ee(e,t){(0,O.useEffect)(()=>{let n=()=>void a.watchPreview(N,t==null?null:e,t).catch(()=>void 0);n();let r=setInterval(n,k);return()=>clearInterval(r)},[e,t]),(0,O.useEffect)(()=>()=>void a.watchPreview(N,null,null).catch(()=>void 0),[])}typeof window<`u`&&!Object.getOwnPropertyDescriptor(window,`__swarmPreviews`)&&Object.defineProperty(window,"__swarmPreviews",{configurable:!0,get:()=>{let e=b.getState(),t=A.getState().channels;return{main:e.repos.map(e=>({repoId:e.id,floor:e.floor,status:e.preview.status,url:e.preview.url,ref:e.preview.ref,port:e.preview.port,channel:l(t[e.id],e.pulls)})),prs:Object.values(e.prPreviews).map(e=>({repoId:e.repoId,pr:e.pr,status:e.status,url:e.url,port:e.port,commit:e.commit,watched:e.watched,idleSec:Math.round((Date.now()-e.viewedAt)/1e3),error:e.error}))}}});var P=16e3,F=e=>Object.entries(e).reduce((e,[t,n])=>e+t.length+n.length+2,0);function I(e){let t=F(e);if(t<=16e3)return null;let n=e=>e.toLocaleString(`en-US`);return`The preview env is ${n(t)} characters (${n(Object.keys(e).length)} variables, each counted as KEY=value), over the ${n(P)} a floor's preview may take. Keep only the variables the app needs to run.`}var L=e({AppViewer:()=>oe}),R=i(),z={unconfigured:`not set up`,stopped:`stopped`,preparing:`checking out`,installing:`installing`,starting:`starting`,running:`running`,error:`error`},B=[`preparing`,`installing`,`starting`,`running`],V=[{status:`preparing`,label:`Check out the code`},{status:`installing`,label:`Install dependencies`},{status:`starting`,label:`Start the app`}],H=`desktop`,U=12e3;function W({status:e}){let t=s();return(0,R.jsx)(`span`,{className:`status status-${e}`,children:t(z[e])})}var G=e=>Object.entries(e).map(([e,t])=>`${e}=${t}`).join(`
2
+ `);function K(e){let t={},n=e.split(/\r?\n/);for(let e=0;e<n.length;e++){let r=n[e].trim();if(!r||r.startsWith(`#`))continue;let i=r.indexOf(`=`),a=i>0?r.slice(0,i).trim():``;if(!a)return{env:t,error:`Line ${e+1}: write it as KEY=value.`};if(!/^[A-Za-z_][A-Za-z0-9_]*$/.test(a))return{env:t,error:`Line ${e+1}: “${a}” is not a valid variable name.`};t[a]=r.slice(i+1).trim()}return{env:t,error:null}}function q({repo:e,saveLabel:t=`Save`,onSaved:n}){let r=s(),i={command:e.previewConfig.command??``,env:G(e.previewConfig.env)},[c,l]=(0,O.useState)(i.command),[u,d]=(0,O.useState)(i.env),[f,p]=(0,O.useState)(!1),[m,h]=(0,O.useState)(null);(0,O.useEffect)(()=>{l(i.command),d(i.env)},[i.command,i.env]);let g=c.trim()!==i.command||u.trim()!==i.env,_=e.preview.status===`unconfigured`,v=F(K(u).env);return(0,R.jsxs)(`form`,{className:`preview-form`,onSubmit:async t=>{t.preventDefault();let r=K(u);if(r.error)return h(r.error);let i=I(r.env);if(i)return h(i);h(null),p(!0);try{await a.updateRepo(e.id,{previewCommand:c.trim()||null,previewEnv:r.env}),n?.()}catch(e){h(e.message)}finally{p(!1)}},children:[(0,R.jsxs)(`label`,{className:`field`,children:[(0,R.jsx)(`span`,{children:(0,R.jsx)(o,{children:`Run command`})}),(0,R.jsx)(`input`,{value:c,onChange:e=>l(e.target.value),placeholder:r(_?`e.g. python -m http.server {port}`:`Auto-detected: npm run dev, else npm start, else npm run preview`),spellCheck:!1})]}),(0,R.jsxs)(`label`,{className:`field`,children:[(0,R.jsx)(`span`,{children:(0,R.jsx)(o,{children:`Environment (KEY=value, one per line)`})}),(0,R.jsx)(`textarea`,{value:u,onChange:e=>d(e.target.value),rows:3,placeholder:`API_URL=http://localhost:{port}/api
3
+ DATA_DIR={tmp}`,spellCheck:!1})]}),(0,R.jsxs)(`p`,{className:`muted small`,children:[(0,R.jsx)(o,{children:`Runs from the repo root in the floor’s own preview worktree.`}),` `,(0,R.jsx)(`code`,{children:`{port}`}),` `,r(`is this floor’s port ({port}) and`,{port:e.preview.port}),` `,(0,R.jsx)(`code`,{children:`PORT`}),` `,(0,R.jsx)(o,{children:`is always set;`}),` `,(0,R.jsx)(`code`,{children:`{tmp}`}),` `,(0,R.jsx)(o,{children:`is a scratch folder.`}),!_&&r(` Leave the command empty to use the auto-detected npm script.`)]}),v>12800&&(0,R.jsx)(`p`,{className:`muted small`,children:r(`Environment: {count} of {max} characters (each variable counts as KEY=value).`,{count:v.toLocaleString(),max:16e3.toLocaleString()})}),m&&(0,R.jsxs)(`div`,{className:`term-error`,children:[`⚠️ `,m]}),(0,R.jsxs)(`div`,{className:`row`,children:[(0,R.jsx)(`button`,{className:`btn btn-small btn-good`,disabled:f||!g&&!n||_&&!c.trim(),children:r(f?`Saving…`:t)}),g&&(0,R.jsx)(`button`,{type:`button`,className:`btn btn-small btn-ghost`,onClick:()=>{l(i.command),d(i.env),h(null)},children:(0,R.jsx)(o,{children:`Undo changes`})})]})]})}var J=`allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox allow-modals allow-downloads allow-pointer-lock`;function Y({repo:e,preview:t,label:n,src:r,width:i,reloads:a,busy:c,onStart:l,frameRef:u,compact:d}){let f=s(),[p,m]=(0,O.useState)(!1),[h,g]=(0,O.useState)(!1),[_,v]=(0,O.useState)(!1),y=t.status===`running`&&!!r,b=`${r}|${t.startedAt}|${a}`;if((0,O.useEffect)(()=>{if(m(!1),g(!1),!y)return;let e=setTimeout(()=>g(!0),U);return()=>clearTimeout(e)},[b,y]),y)return(0,R.jsxs)(`div`,{className:`app-stage ${i===`phone`?`app-stage-phone`:``}`,children:[(0,R.jsx)(`iframe`,{ref:u,className:`app-frame`,src:r,title:f(`{repo} app ({label})`,{repo:e.fullName.split(`/`)[1],label:n}),sandbox:J,allow:`clipboard-read; clipboard-write; fullscreen; autoplay`,onLoad:()=>m(!0),onError:()=>g(!0)},b),h&&!p&&(0,R.jsxs)(`div`,{className:`app-frame-hint`,role:`status`,children:[(0,R.jsx)(`b`,{children:(0,R.jsx)(o,{children:`The app isn’t showing up here.`})}),` `,(0,R.jsx)(o,{children:`It may refuse to be shown inside another page (X-Frame-Options or a CSP frame-ancestors rule).`}),` `,(0,R.jsx)(`a`,{href:r,target:`_blank`,rel:`noreferrer`,children:(0,R.jsx)(o,{children:`Open it in a new tab ↗`})})]})]});if(B.includes(t.status)){let e=V.findIndex(e=>e.status===t.status);return(0,R.jsxs)(`div`,{className:`app-state ${d?`app-state-compact`:``}`,role:`status`,children:[(0,R.jsx)(`div`,{className:`app-state-icon app-spin`,children:`⚙️`}),(0,R.jsx)(`h3`,{children:f(`Starting {label}…`,{label:n})}),(0,R.jsx)(`ol`,{className:`app-steps`,children:V.map((n,r)=>(0,R.jsxs)(`li`,{className:r<e?`app-step-done`:r===e?`app-step-now`:``,children:[r<e?`✓`:r===e?`●`:`○`,` `,f(n.label),n.status===`starting`&&t.port?f(` on port {port}`,{port:t.port}):``]},n.status))}),t.logTail.length>0&&(0,R.jsx)(`pre`,{className:`term app-log`,children:t.logTail.slice(-8).join(`
4
+ `)})]})}return t.status===`error`?(0,R.jsxs)(`div`,{className:`app-state app-state-left ${d?`app-state-compact`:``}`,children:[(0,R.jsx)(`h3`,{children:f(`⚠️ {label} didn’t run`,{label:n})}),(0,R.jsx)(`div`,{className:`term-error`,children:t.error??f(`The app stopped unexpectedly.`)}),(0,R.jsx)(`pre`,{className:`term app-log`,"aria-label":f(`Last output`),children:t.logTail.length?t.logTail.join(`
5
+ `):f(`(no output)`)}),(0,R.jsxs)(`div`,{className:`row wrap`,children:[(0,R.jsx)(`button`,{className:`btn btn-good`,disabled:c,onClick:l,children:(0,R.jsx)(o,{children:`↻ Try again`})}),(0,R.jsx)(`button`,{className:`btn`,"aria-expanded":_,onClick:()=>v(e=>!e),children:(0,R.jsx)(o,{children:`⚙️ Run settings`})})]}),_&&(0,R.jsx)(q,{repo:e})]}):t.status===`unconfigured`?(0,R.jsxs)(`div`,{className:`app-state app-state-left`,children:[(0,R.jsx)(`h3`,{children:(0,R.jsx)(o,{children:`🛠️ How should the office run this app?`})}),(0,R.jsxs)(`p`,{className:`muted`,children:[t.error??f(`This floor has no package.json to fall back on.`),` `,(0,R.jsx)(o,{children:`Give it a command that serves the app on the floor’s port.`})]}),(0,R.jsx)(q,{repo:e,saveLabel:`Save & start`,onSaved:l})]}):(0,R.jsxs)(`div`,{className:`app-state ${d?`app-state-compact`:``}`,children:[(0,R.jsx)(`div`,{className:`app-state-icon`,children:`🖥️`}),(0,R.jsx)(`h3`,{children:f(`{label} isn’t running`,{label:n})}),(0,R.jsx)(`p`,{className:`muted`,children:t.pr?f(`Start it to try the PR’s head right here, beside {branch}. It runs from a worktree of its own and stops after a while unwatched.`,{branch:e.defaultBranch}):f(`Start it to use it right here. It runs from the floor’s own preview worktree on port {port}.`,{port:t.port})}),(0,R.jsx)(`button`,{className:`btn btn-good`,disabled:c,onClick:l,children:f(`▶ Start {label}`,{label:n})}),!t.pr&&!d&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`button`,{className:`btn btn-ghost btn-small`,"aria-expanded":_,onClick:()=>v(e=>!e),children:(0,R.jsx)(o,{children:`⚙️ Run settings`})}),_&&(0,R.jsx)(`div`,{className:`app-state-left app-settings`,children:(0,R.jsx)(q,{repo:e})})]})]})}function te({repo:e,channel:t,onPick:n}){let r=s(),i=b(e=>e.prPreviews),a=b(e=>e.qa),o=u(e.pulls);return(0,R.jsxs)(`div`,{className:`channels`,role:`tablist`,"aria-label":r(`Channels`),children:[(0,R.jsxs)(`button`,{role:`tab`,"aria-selected":t==null,className:`channel ${t==null?`channel-on`:``}`,onClick:()=>n(null),title:r(`The floor’s app on {branch}`,{branch:e.defaultBranch}),children:[(0,R.jsx)(`span`,{className:`led led-${m(e.preview.status)}`,"aria-hidden":!0}),` `,e.defaultBranch]}),o.map(r=>{let o=c(r,a[y(e.id,r.number)]);return(0,R.jsxs)(`button`,{role:`tab`,"aria-selected":t===r.number,className:`channel ${t===r.number?`channel-on`:``}`,onClick:()=>n(r.number),title:o,children:[(0,R.jsx)(`span`,{className:`led led-${m(i[y(e.id,r.number)]?.status)}`,"aria-hidden":!0}),` `,o]},r.number)}),o.length===0&&(0,R.jsx)(`span`,{className:`muted small channels-empty`,children:r(`No open PRs: each one gets a channel here, to try it running beside {branch}.`,{branch:e.defaultBranch})})]})}var X={passing:`✅ passing`,failing:`❌ failing`,pending:`⏳ running`,none:`none`},Z={pass:`✅`,fail:`❌`,skip:`⏭️`};function ne({repo:e,pull:t,qa:n}){let r=s(),i=n?.shots??[];return(0,R.jsxs)(`aside`,{className:`qa-side`,"aria-label":r(`PR #{number}: checks and QA`,{number:t.number}),children:[(0,R.jsxs)(`h4`,{className:`qa-side-title`,children:[(0,R.jsxs)(`a`,{href:t.url,target:`_blank`,rel:`noreferrer`,children:[`PR #`,t.number,` ↗`]}),` `,t.title]}),(0,R.jsxs)(`div`,{className:`qa-side-meta small`,children:[(0,R.jsxs)(`span`,{children:[`+`,t.additions,` −`,t.deletions]}),(0,R.jsxs)(`a`,{href:`${t.url}/checks`,target:`_blank`,rel:`noreferrer`,children:[(0,R.jsx)(o,{children:`Checks:`}),` `,r(X[t.checks])]}),t.isDraft&&(0,R.jsx)(`span`,{children:(0,R.jsx)(o,{children:`draft`})})]}),t.failedChecks.length>0&&(0,R.jsx)(`ul`,{className:`qa-failed small`,children:t.failedChecks.map(e=>(0,R.jsx)(`li`,{children:e.url?(0,R.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,children:[`❌ `,e.name]}):`❌ ${e.name}`},e.name))}),n?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`div`,{className:`qa-side-status`,children:[(0,R.jsx)(`span`,{className:`qa-badge qa-badge-${n.status}`,children:(0,R.jsx)(o,{children:n.managerRequested&&(n.status===`failed`||n.status===`fixing`)?`Manager-requested changes`:p[n.status]})}),(0,R.jsx)(`span`,{className:`muted small`,children:r(`round {number}`,{number:n.round})}),n.commentUrl&&(0,R.jsx)(`a`,{className:`small`,href:n.commentUrl,target:`_blank`,rel:`noreferrer`,children:(0,R.jsx)(o,{children:`Full report ↗`})})]}),n.summary?(0,R.jsx)(C,{className:`qa-summary`,text:n.summary}):(0,R.jsx)(`p`,{className:`muted small`,children:r(n.status===`testing`?`QA is testing it now.`:`No QA report yet.`)}),n.checks.length>0&&(0,R.jsx)(`ul`,{className:`qa-checks`,children:n.checks.map((e,t)=>(0,R.jsxs)(`li`,{className:`qa-check qa-check-${e.result}`,children:[(0,R.jsx)(`span`,{"aria-label":r(e.result),children:Z[e.result]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`b`,{children:e.name}),e.details&&(0,R.jsx)(`div`,{className:`muted small`,children:e.details})]})]},t))}),i.length>0&&(0,R.jsx)(`div`,{className:`qa-shots`,children:i.map((r,i)=>{let a=_(e.id,t.number,i,n.updatedAt);return(0,R.jsxs)(`a`,{className:`qa-shot`,href:a,target:`_blank`,rel:`noreferrer`,title:r.page??r.caption,children:[(0,R.jsx)(`img`,{src:a,alt:r.caption,loading:`lazy`}),(0,R.jsx)(`span`,{className:`small`,children:r.caption})]},i)})})]}):(0,R.jsx)(`p`,{className:`muted small`,children:(0,R.jsx)(o,{children:`QA hasn’t tested this PR yet.`})})]})}var Q=!0;function $(e,t,n,r){let[i,o]=(0,O.useState)(null);return(0,O.useEffect)(()=>{if(o(null),!r||n.status!==`running`)return;let i=!0;return a.previewSync(e,t).then(e=>i&&o(e.url)).catch(()=>void 0),()=>{i=!1}},[e,t,r,n.status,n.startedAt]),i}function re({repo:e,main:t,pr:n,width:r,reloads:i,busy:a,onStartMain:c,onStartPr:l}){let u=s(),[d,p]=(0,O.useState)(`/`),[m,_]=(0,O.useState)(`/`),[y,b]=(0,O.useState)(0),[x,C]=(0,O.useState)(Q),[w,T]=(0,O.useState)({main:null,pr:null}),E={main:(0,O.useRef)(null),pr:(0,O.useRef)(null)},D=(0,O.useRef)({main:0,pr:0}),k=(0,O.useRef)(f()),A={main:$(e.id,null,t,x),pr:$(e.id,n.pr,n,x)};(0,O.useEffect)(()=>{let e=e=>{let t=e.data;if(!t||t.cubefarmSync!==`scroll`&&t.cubefarmSync!==`path`)return;let n=e.source&&e.source===E.main.current?.contentWindow?`main`:e.source&&e.source===E.pr.current?.contentWindow?`pr`:null;if(!n)return;let r=n===`main`?`pr`:`main`;if(typeof t.path==`string`&&T(e=>e[n]===t.path?e:{...e,[n]:t.path}),!x)return;let i=E[r].current?.contentWindow,a=Date.now();t.cubefarmSync===`scroll`&&a>D.current[n]?(D.current[r]=a+250,i?.postMessage({cubefarmSyncTo:`scroll`,x:t.x,y:t.y},`*`)):t.cubefarmSync===`path`&&typeof t.path==`string`&&v(k.current,n,t.path,a)&&i?.postMessage({cubefarmSyncTo:`path`,path:t.path},`*`)};return window.addEventListener(`message`,e),()=>window.removeEventListener(`message`,e)},[x]);let j=(e,t)=>e.url?S(g(x&&A[t]||e.url,location),d):null,M=(t,n)=>(0,R.jsxs)(`div`,{className:`compare-label`,children:[(0,R.jsx)(`b`,{children:n===`main`?e.defaultBranch:t.ref}),t.commit&&(0,R.jsx)(`code`,{children:t.commit}),w[n]&&(0,R.jsx)(`span`,{className:`muted`,children:w[n]}),x&&w[n]!==null&&(0,R.jsx)(`span`,{className:`compare-synced`,children:(0,R.jsx)(o,{children:`⇅ synced`})})]});return(0,R.jsxs)(`div`,{className:`compare`,children:[(0,R.jsxs)(`form`,{className:`compare-bar`,onSubmit:e=>{e.preventDefault();let t=h(m);_(t),p(t),b(e=>e+1)},children:[(0,R.jsxs)(`label`,{className:`compare-path`,children:[(0,R.jsx)(`span`,{className:`muted small`,children:(0,R.jsx)(o,{children:`Path`})}),(0,R.jsx)(`input`,{value:m,onChange:e=>_(e.target.value),spellCheck:!1,"aria-label":u(`Path to open on both sides`)})]}),(0,R.jsx)(`button`,{className:`btn btn-small`,children:(0,R.jsx)(o,{children:`Open on both`})}),(0,R.jsxs)(`label`,{className:`toggle small`,title:u(`Shows each side through the office so it can follow the other’s scrolling and links. Works for plain web pages that scroll the page itself.`),children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:x,onChange:e=>{Q=e.target.checked,C(e.target.checked),T({main:null,pr:null}),k.current=f()}}),` `,(0,R.jsx)(o,{children:`Sync scrolling`})]})]}),(0,R.jsxs)(`div`,{className:`compare-sides`,children:[(0,R.jsxs)(`div`,{className:`compare-side`,children:[M(t,`main`),(0,R.jsx)(Y,{repo:e,preview:t,label:e.defaultBranch,src:j(t,`main`),width:r,reloads:i+y,busy:a,onStart:c,frameRef:E.main,compact:!0})]}),(0,R.jsxs)(`div`,{className:`compare-side`,children:[M(n,`pr`),(0,R.jsx)(Y,{repo:e,preview:n,label:n.ref??u(`the PR`),src:j(n,`pr`),width:r,reloads:i+y,busy:a,onStart:l,frameRef:E.pr,compact:!0})]})]})]})}var ie=!1,ae=!0;function oe({repoId:e,pr:t}){let n=s(),r=b(t=>t.repos.find(t=>t.id===e)),i=b(e=>e.prPreviews),c=b(e=>e.qa),l=j(e),[u,f]=(0,O.useState)(H),[p,m]=(0,O.useState)(ie),[h,_]=(0,O.useState)(ae),[v,S]=(0,O.useState)(!1),[C,k]=(0,O.useState)(0),[A,N]=(0,O.useState)(!1),P=T(E()),F=(0,O.useRef)(null);if((0,O.useEffect)(()=>{t!==void 0&&M(e,t)},[e,t]),ee(e,l),(0,O.useEffect)(()=>{F.current?.querySelector(`button`)?.focus()},[]),(0,O.useEffect)(()=>{x(location)||navigator.serviceWorker?.register(`/preview/sw.js`,{scope:`/preview/`}).catch(()=>void 0)},[]),!r)return(0,R.jsx)(w,{title:`App`,children:(0,R.jsx)(`p`,{className:`muted`,children:(0,R.jsx)(o,{children:`This floor no longer exists.`})})});let I=async e=>{S(!0);try{await e()}catch{}finally{S(!1)}},L=r.preview,z=l==null?null:d(i[y(r.id,l)],l),V=z??L,U=l==null?void 0:r.pulls.find(e=>e.number===l),G=()=>I(()=>a.startPreview(r.id)),K=(e=!1)=>l!=null&&I(()=>a.startPrPreview(r.id,l,e)),q=e=>{H=e,f(e)},J=B.includes(V.status),X=l==null?r.defaultBranch:`PR #${l}`,Z=r.fullName.split(`/`)[1],Q=p&&z!=null;return(0,R.jsxs)(w,{wide:!0,className:`panel-app`,accent:r.color,title:(0,R.jsxs)(`span`,{className:`app-title`,children:[(0,R.jsxs)(`span`,{className:`app-title-name`,children:[`🖥️ `,Z]}),(0,R.jsx)(W,{status:V.status}),V.ref&&V.status!==`stopped`&&V.status!==`unconfigured`&&(0,R.jsxs)(`span`,{className:`muted small app-title-ref`,children:[V.ref,V.commit?` · ${V.commit}`:``]})]}),children:[(0,R.jsxs)(`div`,{ref:F,children:[(0,R.jsx)(te,{repo:r,channel:l,onPick:e=>M(r.id,e)}),(0,R.jsxs)(`div`,{className:`app-toolbar`,role:`toolbar`,"aria-label":n(`App controls`),children:[(0,R.jsx)(`button`,{className:`btn btn-small`,disabled:P,"aria-expanded":A||P,onClick:()=>N(e=>!e),children:(0,R.jsx)(o,{children:`📱 Phone access`})}),J?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`button`,{className:`btn btn-small`,disabled:v,onClick:()=>void(l==null?G():K(!0)),title:n(l==null?`Restart {label}`:`Restart {label} from the PR’s latest commit`,{label:X}),children:(0,R.jsx)(o,{children:`↻ Restart`})}),(0,R.jsx)(`button`,{className:`btn btn-small btn-bad`,disabled:v,onClick:()=>void I(()=>l==null?a.stopPreview(r.id):a.stopPrPreview(r.id,l)),children:(0,R.jsx)(o,{children:`■ Stop`})})]}):(0,R.jsx)(`button`,{className:`btn btn-small btn-good`,disabled:v||V.status===`unconfigured`,onClick:()=>void(l==null?G():K()),children:(0,R.jsx)(o,{children:`▶ Start`})}),z&&(0,R.jsx)(`button`,{className:`btn btn-small ${Q?`btn-on`:``}`,"aria-pressed":Q,onClick:()=>{ie=!p,m(!p)},title:n(`{branch} on the left, PR #{number} on the right`,{branch:r.defaultBranch,number:l??`?`}),children:n(`⇆ Compare with {branch}`,{branch:r.defaultBranch})}),(0,R.jsx)(`button`,{className:`btn btn-small`,disabled:V.status!==`running`&&!(Q&&L.status===`running`),onClick:()=>k(e=>e+1),title:n(`Reload the app`),children:(0,R.jsx)(o,{children:`⟳ Reload`})}),(0,R.jsxs)(`div`,{className:`seg`,role:`group`,"aria-label":n(`Viewport width`),children:[(0,R.jsx)(`button`,{className:`seg-btn ${u===`desktop`?`seg-on`:``}`,"aria-pressed":u===`desktop`,onClick:()=>q(`desktop`),children:`🖥 Desktop`}),(0,R.jsx)(`button`,{className:`seg-btn ${u===`phone`?`seg-on`:``}`,"aria-pressed":u===`phone`,onClick:()=>q(`phone`),title:n(`390px wide`),children:(0,R.jsx)(o,{children:`📱 Phone`})})]}),(0,R.jsx)(`span`,{className:`spacer`}),z&&(0,R.jsx)(`button`,{className:`btn btn-small ${h?`btn-on`:``}`,"aria-pressed":h,onClick:()=>{ae=!h,_(!h)},children:`📋 QA`}),V.url&&!P?(0,R.jsx)(`a`,{className:`btn btn-small`,href:g(V.url,location),target:`_blank`,rel:`noreferrer`,children:(0,R.jsx)(o,{children:`Open in new tab ↗`})}):(0,R.jsx)(`button`,{className:`btn btn-small`,disabled:!0,children:(0,R.jsx)(o,{children:`Open in new tab ↗`})})]})]}),(A||P)&&(0,R.jsx)(D,{blocked:P}),(0,R.jsxs)(`div`,{className:`app-body`,children:[(0,R.jsx)(`div`,{className:`app-main`,children:P?(0,R.jsx)(`p`,{className:`muted`,children:(0,R.jsx)(o,{children:`The preview is hidden until this browser can route its assets securely. Your running app has not been stopped.`})}):Q?(0,R.jsx)(re,{repo:r,main:L,pr:z,width:u,reloads:C,busy:v,onStartMain:()=>void G(),onStartPr:()=>void K()}):(0,R.jsx)(Y,{repo:r,preview:V,label:X,src:V.url&&g(V.url,location),width:u,reloads:C,busy:v,onStart:()=>void(l==null?G():K())})}),z&&h&&U&&(0,R.jsx)(ne,{repo:r,pull:U,qa:c[y(r.id,U.number)]})]}),V.status===`running`&&(0,R.jsxs)(`p`,{className:`muted small app-foot`,children:[(0,R.jsx)(o,{children:`Blank, or “refused to connect”? The app may block being framed: use`}),` `,(0,R.jsx)(`b`,{children:(0,R.jsx)(o,{children:`Open in new tab`})}),`. `,(0,R.jsx)(o,{children:`Keys typed in the app stay in the app, so`}),` `,(0,R.jsx)(`kbd`,{children:`Esc`}),` `,(0,R.jsx)(o,{children:`only closes this panel when focus is outside it;`}),` `,(0,R.jsx)(`b`,{children:`✕`}),` `,(0,R.jsx)(o,{children:`always does.`}),z&&n(` A PR preview stops after a while with nobody watching it, and when its PR merges or closes.`)]})]})}export{M as a,q as i,L as n,j as o,W as r,oe as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{s as t,t as n}from"./jsx-runtime-CXW0f58S.js";import{f as r}from"./bloomMarks-DRhDp19k.js";import{i,r as a}from"./Office-9Mank16i.js";import{a as o}from"./director-CrzFgnoP.js";import{a as s,i as c,l,n as u,o as d,r as f}from"./kit-n-eqZ1AT.js";var p=e(t(),1),m=n(),h=10,g=[[`#e63946`,`#f1faee`,`#ffb703`],[`#2a9d8f`,`#e9c46a`,`#f4a261`],[`#7209b7`,`#f72585`,`#4cc9f0`]];function _({run:e,elevation:t}){let n=(0,p.useRef)(null),_=(0,p.useRef)(null),v=d(e.side),y=(0,p.useMemo)(()=>{let n=o(e.seed);return{dir:n()<.5?1:-1,x:v*(105+n()*35),y:u(t)+18+n()*8,palette:g[Math.floor(n()*g.length)],burns:{next:3+n()*3,until:0}}},[e.seed,v,t]);return r(()=>{let r=e.t,o=n.current;if(!o)return;let l=r/e.seconds,u=y.x+Math.sin(r*.13)*4,d=y.y+l*12+Math.sin(r*.4)*.8,f=s(-y.dir*160,y.dir*160,l);if(o.position.set(u,d,f),o.rotation.z=Math.sin(r*.5)*.04,o.rotation.y=r*.05,r>=y.burns.next){y.burns.until=r+1.4,y.burns.next=r+6+Math.random()*5;let n=a(u,d-t,f,90);i(`burner`,{gain:n.gain*c(r,e.seconds,4),pan:n.pan})}if(_.current){let e=r<y.burns.until;_.current.visible=e,e&&_.current.scale.set(1,.8+Math.sin(r*40)*.25,1)}}),(0,m.jsxs)(`group`,{ref:n,children:[Array.from({length:h},(e,t)=>(0,m.jsx)(`mesh`,{material:l(y.palette[t%y.palette.length]),position:[0,15,0],scale:[1,1.15,1],children:(0,m.jsx)(`sphereGeometry`,{args:[9,3,14,t*Math.PI*2/h,Math.PI*2/h]})},t)),(0,m.jsx)(`mesh`,{material:l(y.palette[0],{side:2}),position:[0,4.6,0],children:(0,m.jsx)(`cylinderGeometry`,{args:[4.4,1.4,4,16,1,!0]})}),[0,1,2,3].map(e=>{let t=e*Math.PI/2+Math.PI/4;return(0,m.jsx)(`mesh`,{material:l(`#6b4a33`),position:[Math.cos(t)*1.1,1.5,Math.sin(t)*1.1],children:(0,m.jsx)(`cylinderGeometry`,{args:[.04,.04,2.4,4]})},e)}),(0,m.jsx)(`mesh`,{material:l(`#a1683a`),position:[0,-.3,0],children:(0,m.jsx)(`boxGeometry`,{args:[2,1.3,2]})}),(0,m.jsx)(`mesh`,{ref:_,material:f(`#ffb347`,{add:!0}),position:[0,3.1,0],visible:!1,children:(0,m.jsx)(`coneGeometry`,{args:[.5,2.2,10]})})]})}export{_ as default};
@@ -1,4 +1,4 @@
1
- import{s as e,t,u as n}from"./jsx-runtime-BFUkm7bt.js";import{Bt as r,Ft as i,G as a,O as o,P as s,Pt as c,Tt as l,U as u,bt as d,et as f,f as p,g as m,j as h,nt as g,q as _,z as v,zt as y}from"./bloomMarks-DariC6lY.js";import{n as b}from"./BufferGeometryUtils-BsmWvcA2.js";import{B as x,I as S,L as C,R as w,U as T}from"./rig-wAyl3G1G.js";var E=n(e(),1),D=new Map;function O(e,t={}){let n={geometry:e,shading:t.shading??`toon`,outline:t.outline??0,crease:t.crease??0,castShadow:t.castShadow??!1,receiveShadow:t.receiveShadow??!1,material:t.material},r=`${e.uuid}|${n.shading}|${n.outline}|${n.crease}|${+n.castShadow}${+n.receiveShadow}|${n.material?.uuid??``}`,i=D.get(r);return i||(i={key:r,...n},D.set(r,i)),i}function k(e){let t=e.parent;if(!t)return!1;for(;t;){if(!t.visible)return!1;t=t.parent}return!0}var A=16,j=class{look;set;materials;mesh;outline=null;slots=[];outlineGeometry=null;morphN=-1;constructor(e,t,n){this.look=e,this.set=t,this.materials=n,this.mesh=this.make(A),e.outline&&(this.outlineGeometry=e.crease?b(e.geometry,e.crease):e.geometry,this.outline=this.makeOutline(A))}make(e){let t=new _(this.look.geometry,this.look.material??this.materials[this.look.shading],e);t.instanceMatrix.setUsage(s),t.instanceColor=new a(new Float32Array(e*3),3).setUsage(s),t.count=0,t.castShadow=this.look.castShadow&&this.set.shadows,t.receiveShadow=this.look.receiveShadow,t.frustumCulled=!1,t.matrixAutoUpdate=!1,t.raycast=()=>void 0;let n=this.look.geometry.morphAttributes.position?.length??0;return n&&(t.morphTexture=new h(new Float32Array((n+1)*e),n+1,e,d,v)),this.set.root.add(t),t}makeOutline(e){let t=new _(this.outlineGeometry,this.materials.outline(this.look.outline),e);return t.instanceMatrix.setUsage(s),t.count=0,t.frustumCulled=!1,t.matrixAutoUpdate=!1,t.raycast=()=>void 0,this.set.root.add(t),t}add(e){this.slots.push(e);let t=this.mesh.instanceMatrix.count;this.slots.length<=t||(this.mesh.removeFromParent(),this.mesh.dispose(),this.mesh=this.make(t*2),this.morphN=-1,this.outline&&=(this.outline.removeFromParent(),this.outline.dispose(),this.makeOutline(t*2)))}remove(e){let t=this.slots.indexOf(e);t<0||(this.slots[t]=this.slots[this.slots.length-1],this.slots.pop())}sync(e,t){let n=this.mesh,r=n.instanceMatrix.array,i=n.instanceColor.array,a=this.outline,o=a?a.instanceMatrix.array:null,s=n.morphTexture?n.morphTexture.image.data:null,c=s?n.morphTexture.image.width:0,l=this.look.geometry.morphTargetsRelative,u=0,d=0,f=!1;for(let n of this.slots){if(!k(n.obj))continue;let a=n.obj.matrixWorld.elements;if(r.set(a,u*16),i[u*3]=n.color.r,i[u*3+1]=n.color.g,i[u*3+2]=n.color.b,s){let e=n.obj.morphTargetInfluences,t=0;for(let n=1;n<c;n++){let r=e?.[n-1]??0;s[u*c+n]!==r&&(f=!0),s[u*c+n]=r,t+=r}s[u*c]=l?1:1-t}if(u++,o){let n=a[12]-(e?.x??a[12]),r=a[13]-(e?.y??a[13]),i=a[14]-(e?.z??a[14]);n*n+r*r+i*i<=t&&o.set(a,d++*16)}}n.count=u,n.instanceMatrix.needsUpdate=!0,n.instanceColor.needsUpdate=!0,n.morphTexture&&(f||u!==this.morphN)&&(n.morphTexture.needsUpdate=!0),this.morphN=u,a&&(a.count=d,a.instanceMatrix.needsUpdate=!0)}dispose(){this.mesh.removeFromParent(),this.mesh.dispose(),this.outline?.removeFromParent(),this.outline?.dispose(),this.outlineGeometry&&this.outlineGeometry!==this.look.geometry&&this.outlineGeometry.dispose()}},M=class{materials;root=new u;camera=null;outlineRange=1/0;shadows=!0;batches=new Map;eye=new r;constructor(e){this.materials=e,this.root.name=`batches`}add(e,t,n){let r=this.batches.get(e.key);r||(r=new j(e,this,this.materials),this.batches.set(e.key,r));let i={obj:t,color:new o(n)};r.add(i);let a=r;return{setColor:e=>void i.color.set(e),remove:()=>a.remove(i)}}sync(){let e=this.camera?this.eye.setFromMatrixPosition(this.camera.matrixWorld):null,t=this.outlineRange*this.outlineRange;for(let n of this.batches.values())n.sync(e,t)}stats(){let e=0,t=0;for(let n of this.batches.values())e+=n.mesh.count,t+=n.outline?.count??0;return{batches:this.batches.size,instances:e,outlined:t}}dispose(){for(let e of this.batches.values())e.dispose();this.batches.clear()}};function N(e,t,n,r){var a=class extends l{constructor(a){super({vertexShader:t,fragmentShader:n,...a});for(let t in e)this.uniforms[t]=new c(e[t]),Object.defineProperty(this,t,{get(){return this.uniforms[t].value},set(e){this.uniforms[t].value=e}});this.uniforms=i.clone(this.uniforms),r?.(this)}};return a.key=f.generateUUID(),a}function P(e,t,n,r){let i=new g(r?b(t.geometry,r):t.geometry,n);return e.add(i),i}function F(e,t){let n=e.children[0];n&&(t&&n.geometry.dispose(),e.remove(n))}var I=t(),L=N({screenspace:!1,color:new o(`black`),opacity:1,thickness:.05,size:new y},`#include <common>
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{s as t,t as n}from"./jsx-runtime-CXW0f58S.js";import{Bt as r,Ft as i,G as a,O as o,P as s,Pt as c,Tt as l,U as u,bt as d,et as f,f as p,g as m,j as h,nt as g,q as _,z as v,zt as y}from"./bloomMarks-DRhDp19k.js";import{n as b}from"./BufferGeometryUtils-CmpUrBC5.js";import{B as x,I as S,L as C,R as w,U as T}from"./rig-DfdntE8m.js";var E=e(t(),1),D=new Map;function O(e,t={}){let n={geometry:e,shading:t.shading??`toon`,outline:t.outline??0,crease:t.crease??0,castShadow:t.castShadow??!1,receiveShadow:t.receiveShadow??!1,material:t.material},r=`${e.uuid}|${n.shading}|${n.outline}|${n.crease}|${+n.castShadow}${+n.receiveShadow}|${n.material?.uuid??``}`,i=D.get(r);return i||(i={key:r,...n},D.set(r,i)),i}function k(e){let t=e.parent;if(!t)return!1;for(;t;){if(!t.visible)return!1;t=t.parent}return!0}var A=16,j=class{look;set;materials;mesh;outline=null;slots=[];outlineGeometry=null;morphN=-1;constructor(e,t,n){this.look=e,this.set=t,this.materials=n,this.mesh=this.make(A),e.outline&&(this.outlineGeometry=e.crease?b(e.geometry,e.crease):e.geometry,this.outline=this.makeOutline(A))}make(e){let t=new _(this.look.geometry,this.look.material??this.materials[this.look.shading],e);t.instanceMatrix.setUsage(s),t.instanceColor=new a(new Float32Array(e*3),3).setUsage(s),t.count=0,t.castShadow=this.look.castShadow&&this.set.shadows,t.receiveShadow=this.look.receiveShadow,t.frustumCulled=!1,t.matrixAutoUpdate=!1,t.raycast=()=>void 0;let n=this.look.geometry.morphAttributes.position?.length??0;return n&&(t.morphTexture=new h(new Float32Array((n+1)*e),n+1,e,d,v)),this.set.root.add(t),t}makeOutline(e){let t=new _(this.outlineGeometry,this.materials.outline(this.look.outline),e);return t.instanceMatrix.setUsage(s),t.count=0,t.frustumCulled=!1,t.matrixAutoUpdate=!1,t.raycast=()=>void 0,this.set.root.add(t),t}add(e){this.slots.push(e);let t=this.mesh.instanceMatrix.count;this.slots.length<=t||(this.mesh.removeFromParent(),this.mesh.dispose(),this.mesh=this.make(t*2),this.morphN=-1,this.outline&&=(this.outline.removeFromParent(),this.outline.dispose(),this.makeOutline(t*2)))}remove(e){let t=this.slots.indexOf(e);t<0||(this.slots[t]=this.slots[this.slots.length-1],this.slots.pop())}sync(e,t){let n=this.mesh,r=n.instanceMatrix.array,i=n.instanceColor.array,a=this.outline,o=a?a.instanceMatrix.array:null,s=n.morphTexture?n.morphTexture.image.data:null,c=s?n.morphTexture.image.width:0,l=this.look.geometry.morphTargetsRelative,u=0,d=0,f=!1;for(let n of this.slots){if(!k(n.obj))continue;let a=n.obj.matrixWorld.elements;if(r.set(a,u*16),i[u*3]=n.color.r,i[u*3+1]=n.color.g,i[u*3+2]=n.color.b,s){let e=n.obj.morphTargetInfluences,t=0;for(let n=1;n<c;n++){let r=e?.[n-1]??0;s[u*c+n]!==r&&(f=!0),s[u*c+n]=r,t+=r}s[u*c]=l?1:1-t}if(u++,o){let n=a[12]-(e?.x??a[12]),r=a[13]-(e?.y??a[13]),i=a[14]-(e?.z??a[14]);n*n+r*r+i*i<=t&&o.set(a,d++*16)}}n.count=u,n.instanceMatrix.needsUpdate=!0,n.instanceColor.needsUpdate=!0,n.morphTexture&&(f||u!==this.morphN)&&(n.morphTexture.needsUpdate=!0),this.morphN=u,a&&(a.count=d,a.instanceMatrix.needsUpdate=!0)}dispose(){this.mesh.removeFromParent(),this.mesh.dispose(),this.outline?.removeFromParent(),this.outline?.dispose(),this.outlineGeometry&&this.outlineGeometry!==this.look.geometry&&this.outlineGeometry.dispose()}},M=class{materials;root=new u;camera=null;outlineRange=1/0;shadows=!0;batches=new Map;eye=new r;constructor(e){this.materials=e,this.root.name=`batches`}add(e,t,n){let r=this.batches.get(e.key);r||(r=new j(e,this,this.materials),this.batches.set(e.key,r));let i={obj:t,color:new o(n)};r.add(i);let a=r;return{setColor:e=>void i.color.set(e),remove:()=>a.remove(i)}}sync(){let e=this.camera?this.eye.setFromMatrixPosition(this.camera.matrixWorld):null,t=this.outlineRange*this.outlineRange;for(let n of this.batches.values())n.sync(e,t)}stats(){let e=0,t=0;for(let n of this.batches.values())e+=n.mesh.count,t+=n.outline?.count??0;return{batches:this.batches.size,instances:e,outlined:t}}dispose(){for(let e of this.batches.values())e.dispose();this.batches.clear()}};function N(e,t,n,r){var a=class extends l{constructor(a){super({vertexShader:t,fragmentShader:n,...a});for(let t in e)this.uniforms[t]=new c(e[t]),Object.defineProperty(this,t,{get(){return this.uniforms[t].value},set(e){this.uniforms[t].value=e}});this.uniforms=i.clone(this.uniforms),r?.(this)}};return a.key=f.generateUUID(),a}function P(e,t,n,r){let i=new g(r?b(t.geometry,r):t.geometry,n);return e.add(i),i}function F(e,t){let n=e.children[0];n&&(t&&n.geometry.dispose(),e.remove(n))}var I=n(),L=N({screenspace:!1,color:new o(`black`),opacity:1,thickness:.05,size:new y},`#include <common>
2
2
  #include <morphtarget_pars_vertex>
3
3
  #include <skinning_pars_vertex>
4
4
  #include <clipping_planes_pars_vertex>
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{s as t,t as n}from"./jsx-runtime-CXW0f58S.js";import{Bt as r,F as i,f as a,gt as o,tt as s}from"./bloomMarks-DRhDp19k.js";import{i as c,n as l,r as u}from"./Office-9Mank16i.js";import{ba as d}from"./store-CXLtXw8e.js";import{a as f}from"./director-CrzFgnoP.js";import{a as p,i as m,l as h,n as g,o as _}from"./kit-n-eqZ1AT.js";var v=e(t(),1),y=n(),b=26,x=new r(1,1,1),S=22;function C({run:e,elevation:t}){let n=(0,v.useRef)(null),C=(0,v.useRef)(null),w=(0,v.useRef)(null),T=_(e.side),E=(0,v.useMemo)(()=>{let n=f(e.seed),r=n()<.5?1:-1,i=Array.from({length:b},()=>({dx:(n()-.5)*5,dy:(n()-.5)*3.5,dz:(n()-.5)*11,phase:n()*6.28,rate:10+n()*4,wob:n()*6.28}));return{dir:r,x:T*(d+7+n()*5),y:g(t)+1+n()*2.5,birds:i}},[e.seed,T,t]),D=(0,v.useMemo)(()=>({body:new s,wing:new s,tmp:new s,q:new o,e:new i,p:new r,shape:new r(1,.85,1.8),chirpAt:1}),[]),O=(0,v.useMemo)(()=>({flap:null}),[]);(0,v.useEffect)(()=>(O.flap=l(`flap`),()=>O.flap?.stop(.6)),[O]),a(()=>{let r=e.t,i=n.current,a=C.current,o=w.current;if(!i||!a||!o)return;let s=Math.min(1,r/S),l=p(-E.dir*95,E.dir*95,s),d=E.y+Math.sin(s*Math.PI*2)*2.5,f=E.x-T*Math.sin(s*Math.PI)*3,h=E.dir>0?0:Math.PI;for(let e=0;e<b;e++){let t=E.birds[e],n=Math.sin(r*1.7+t.wob);D.p.set(f+t.dx+n*.6,d+t.dy+Math.sin(r*2.3+t.wob)*.5,l+t.dz),D.e.set(.08*n,h+.15*n,.2*n),D.q.setFromEuler(D.e),D.body.compose(D.p,D.q,D.shape),i.setMatrixAt(e,D.body),D.body.compose(D.p,D.q,x);let s=.15+Math.sin(r*t.rate+t.phase)*.55;D.wing.makeRotationZ(-s).premultiply(D.body),a.setMatrixAt(e,D.wing.multiply(D.tmp.makeTranslation(-.26,0,0))),D.wing.makeRotationZ(s).premultiply(D.body),o.setMatrixAt(e,D.wing.multiply(D.tmp.makeTranslation(.26,0,0)))}i.instanceMatrix.needsUpdate=!0,a.instanceMatrix.needsUpdate=!0,o.instanceMatrix.needsUpdate=!0;let g=u(f,d-t,l,25),_=m(r,24,2);O.flap?.set(g.gain*_,g.pan),r>=D.chirpAt&&r<S&&(D.chirpAt=r+.7+Math.random()*1.6,c(`chirps`,{gain:g.gain*_,pan:g.pan+(Math.random()-.5)*.4}))});let k=h(`#3d405b`);return(0,y.jsxs)(`group`,{children:[(0,y.jsx)(`instancedMesh`,{ref:n,args:[void 0,void 0,b],material:k,frustumCulled:!1,children:(0,y.jsx)(`sphereGeometry`,{args:[.1,8,6]})}),(0,y.jsx)(`instancedMesh`,{ref:C,args:[void 0,void 0,b],material:k,frustumCulled:!1,children:(0,y.jsx)(`boxGeometry`,{args:[.48,.015,.16]})}),(0,y.jsx)(`instancedMesh`,{ref:w,args:[void 0,void 0,b],material:k,frustumCulled:!1,children:(0,y.jsx)(`boxGeometry`,{args:[.48,.015,.16]})})]})}export{C as default};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{s as t,t as n}from"./jsx-runtime-CXW0f58S.js";import{Ct as r,f as i,pt as a,st as o,w as s}from"./bloomMarks-DRhDp19k.js";import{p as c}from"./store-CXLtXw8e.js";import{n as l,r as u}from"./Office-9Mank16i.js";import{a as d}from"./director-CrzFgnoP.js";import{a as f,i as p,l as m,n as h,o as g}from"./kit-n-eqZ1AT.js";import{t as _}from"./news-CrPol-gz.js";var v=e(t(),1),y=n(),b={w:46,h:6,segments:40};function x(e){let t=document.createElement(`canvas`);t.width=2048,t.height=256;let n=t.getContext(`2d`);n.fillStyle=`#fffaf0`,n.fillRect(0,0,t.width,t.height),n.strokeStyle=`#e63946`,n.lineWidth=18,n.strokeRect(9,9,t.width-18,t.height-18),n.fillStyle=`#1f1d2b`,n.textAlign=`center`,n.textBaseline=`middle`;let i=170;do n.font=`bold ${i}px "Segoe UI", "Apple Color Emoji", "Segoe UI Emoji", sans-serif`;while(n.measureText(e).width>t.width-120&&(i-=8)>60);n.fillText(e,t.width/2,t.height/2+8);let a=new s(t);return a.colorSpace=r,a.anisotropy=8,a}function S({run:e,elevation:t}){let n=(0,v.useRef)(null),r=(0,v.useRef)(null),s=g(e.side),S=(0,v.useMemo)(()=>{let n=d(e.seed),r=c.getState(),i=_(r.repos,Date.now(),r.settings.companyName,n()),a=n()<.5?1:-1,o=-s*a*Math.PI/2;return{dir:a,x:s*(95+n()*20),y:h(t)+11+n()*5,text:i,turn:o,along:-Math.sin(o)}},[e.seed,s,t]),C=(0,v.useMemo)(()=>{let e=new a(b.w,b.h,b.segments,1),t=Float32Array.from(e.attributes.position.array),n=x(S.text);return{geo:e,base:t,map:n,mat:new o({map:n,side:2,fog:!1})}},[S.text]);(0,v.useEffect)(()=>()=>{C.geo.dispose(),C.map.dispose(),C.mat.dispose()},[C]);let w=(0,v.useMemo)(()=>({engine:null}),[]);(0,v.useEffect)(()=>(w.engine=l(`engine`),()=>w.engine?.stop(1.2)),[w]),i(()=>{let i=e.t,a=n.current;if(!a)return;let o=f(-S.dir*200,S.dir*200,i/e.seconds),s=S.y+Math.sin(i*.35)*.7;a.position.set(S.x,s,o),a.rotation.y=S.dir>0?0:Math.PI,a.rotation.x=Math.sin(i*.3)*.02;let c=r.current?.children;if(c)for(let e=0;e<c.length;e++)c[e].rotation.z=i*14;let l=C.geo.attributes.position,d=l.array;for(let e=0;e<l.count;e++){let t=.5-C.base[e*3]*S.along/b.w;d[e*3+2]=Math.sin(i*3.2-t*7)*t*1.1}l.needsUpdate=!0;let m=u(S.x,s-t,o,110);w.engine?.set(m.gain*p(i,e.seconds,4),m.pan)});let T=m(`#dfe3ea`),E=m(`#e63946`);return(0,y.jsxs)(`group`,{ref:n,children:[(0,y.jsx)(`mesh`,{material:T,scale:[6,6,21],children:(0,y.jsx)(`sphereGeometry`,{args:[1,24,16]})}),(0,y.jsx)(`mesh`,{material:E,scale:[6.05,1.1,18],position:[0,.2,0],children:(0,y.jsx)(`sphereGeometry`,{args:[1,24,8]})}),[0,1,2,3].map(e=>(0,y.jsx)(`mesh`,{material:E,position:[0,0,-18],"rotation-z":e*Math.PI/2,children:(0,y.jsx)(`boxGeometry`,{args:[.4,9,4]})},e)),(0,y.jsx)(`mesh`,{material:m(`#495057`),position:[0,-6.4,2],children:(0,y.jsx)(`boxGeometry`,{args:[2.2,1.6,5]})}),(0,y.jsx)(`group`,{ref:r,children:[-1.6,1.6].map(e=>(0,y.jsx)(`mesh`,{material:m(`#2b2d42`),position:[e,-6.4,-.8],children:(0,y.jsx)(`boxGeometry`,{args:[.2,2.6,.12]})},e))}),(0,y.jsx)(`mesh`,{material:m(`#2b2d42`),position:[0,-3,-26],"rotation-x":Math.PI/2-.25,children:(0,y.jsx)(`cylinderGeometry`,{args:[.05,.05,12,4]})}),(0,y.jsx)(`mesh`,{geometry:C.geo,material:C.mat,position:[0,-5,-32-b.w/2],"rotation-y":S.turn})]})}export{S as default};
@@ -1 +1 @@
1
- import{C as e,S as t}from"./bloomMarks-DariC6lY.js";function n(t,n=!1){let i=t[0].index!==null,a=new Set(Object.keys(t[0].attributes)),o=new Set(Object.keys(t[0].morphAttributes)),s={},c={},l=t[0].morphTargetsRelative,u=new e,d=0;for(let e=0;e<t.length;++e){let r=t[e],f=0;if(i!==(r.index!==null))return console.error(`THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index `+e+`. All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them.`),null;for(let t in r.attributes){if(!a.has(t))return console.error(`THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index `+e+`. All geometries must have compatible attributes; make sure "`+t+`" attribute exists among all geometries, or in none of them.`),null;s[t]===void 0&&(s[t]=[]),s[t].push(r.attributes[t]),f++}if(f!==a.size)return console.error(`THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index `+e+`. Make sure all geometries have the same number of attributes.`),null;if(l!==r.morphTargetsRelative)return console.error(`THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index `+e+`. .morphTargetsRelative must be consistent throughout all geometries.`),null;for(let t in r.morphAttributes){if(!o.has(t))return console.error(`THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index `+e+`. .morphAttributes must be consistent throughout all geometries.`),null;c[t]===void 0&&(c[t]=[]),c[t].push(r.morphAttributes[t])}if(n){let t;if(i)t=r.index.count;else if(r.attributes.position!==void 0)t=r.attributes.position.count;else return console.error(`THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index `+e+`. The geometry must have either an index or a position attribute`),null;u.addGroup(d,t,e),d+=t}}if(i){let e=0,n=[];for(let r=0;r<t.length;++r){let i=t[r].index;for(let t=0;t<i.count;++t)n.push(i.getX(t)+e);e+=t[r].attributes.position.count}u.setIndex(n)}for(let e in s){let t=r(s[e]);if(!t)return console.error(`THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the `+e+` attribute.`),null;u.setAttribute(e,t)}for(let e in c){let t=c[e][0].length;if(t!==0){u.morphAttributes=u.morphAttributes||{},u.morphAttributes[e]=[];for(let n=0;n<t;++n){let t=[];for(let r=0;r<c[e].length;++r)t.push(c[e][r][n]);let i=r(t);if(!i)return console.error(`THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the `+e+` morphAttribute.`),null;u.morphAttributes[e].push(i)}}}return u}function r(e){let n,r,i,a=-1,o=0;for(let t=0;t<e.length;++t){let s=e[t];if(n===void 0&&(n=s.array.constructor),n!==s.array.constructor)return console.error(`THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes.`),null;if(r===void 0&&(r=s.itemSize),r!==s.itemSize)return console.error(`THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes.`),null;if(i===void 0&&(i=s.normalized),i!==s.normalized)return console.error(`THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes.`),null;if(a===-1&&(a=s.gpuType),a!==s.gpuType)return console.error(`THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes.`),null;o+=s.count*r}let s=new n(o),c=new t(s,r,i),l=0;for(let t=0;t<e.length;++t){let n=e[t];if(n.isInterleavedBufferAttribute){let e=l/r;for(let t=0,i=n.count;t<i;t++)for(let i=0;i<r;i++){let r=n.getComponent(t,i);c.setComponent(t+e,i,r)}}else s.set(n.array,l);l+=n.count*r}return a!==void 0&&(c.gpuType=a),c}function i(e,n=Math.PI/3){let r=e.index?e.toNonIndexed():e,i=r.attributes.position,a=i.count,o;if(i.isBufferAttribute===!0&&i.itemSize===3&&i.normalized===!1)o=i.array;else{o=new Float64Array(a*3);for(let e=0;e<a;e++)o[3*e+0]=i.getX(e),o[3*e+1]=i.getY(e),o[3*e+2]=i.getZ(e)}let s=Math.cos(n),c=(1+1e-10)*100,l=a/3,u=new Float64Array(l*3);for(let e=0;e<l;e++){let t=9*e,n=o[t+0],r=o[t+1],i=o[t+2],a=o[t+3],s=o[t+4],c=o[t+5],l=o[t+6],d=o[t+7],f=o[t+8],p=l-a,m=d-s,h=f-c,g=n-a,_=r-s,v=i-c,y=m*v-h*_,b=h*g-p*v,x=p*_-m*g,S=1/(Math.sqrt(y*y+b*b+x*x)||1);u[3*e+0]=y*S,u[3*e+1]=b*S,u[3*e+2]=x*S}let d=new Int32Array(a),f=new Float64Array(a*3),p=1;for(;p<a*2;)p<<=1;let m=p-1,h=new Int32Array(p),g=0;for(let e=0;e<a;e++){let t=3*e,n=Math.trunc(o[t+0]*c),r=Math.trunc(o[t+1]*c),i=Math.trunc(o[t+2]*c),a=(Math.imul(n,73856093)^Math.imul(r,19349663)^Math.imul(i,83492791))&m;for(;;){let t=h[a];if(t===0){let t=3*g;f[t+0]=n,f[t+1]=r,f[t+2]=i,h[a]=g+1,d[e]=g++;break}let o=3*(t-1);if(f[o+0]===n&&f[o+1]===r&&f[o+2]===i){d[e]=t-1;break}a=a+1&m}}let _=new Int32Array(g+1);for(let e=0;e<a;e++)_[d[e]+1]++;for(let e=0;e<g;e++)_[e+1]+=_[e];let v=new Int32Array(a),y=_.slice(0,g);for(let e=0;e<l;e++){let t=3*e;v[y[d[t+0]]++]=e,v[y[d[t+1]]++]=e,v[y[d[t+2]]++]=e}let b=new Float32Array(a*3);for(let e=0;e<l;e++){let t=3*e,n=u[t+0],r=u[t+1],i=u[t+2];for(let e=0;e<3;e++){let a=t+e,o=d[a],c=0,l=0,f=0;for(let e=_[o],t=_[o+1];e<t;e++){let t=3*v[e],a=u[t+0],o=u[t+1],d=u[t+2];n*a+r*o+i*d>s&&(c+=a,l+=o,f+=d)}let p=1/(Math.sqrt(c*c+l*l+f*f)||1);b[3*a+0]=c*p,b[3*a+1]=l*p,b[3*a+2]=f*p}}return r.setAttribute(`normal`,new t(b,3,!1)),r}export{i as n,n as t};
1
+ import{C as e,S as t}from"./bloomMarks-DRhDp19k.js";function n(t,n=!1){let i=t[0].index!==null,a=new Set(Object.keys(t[0].attributes)),o=new Set(Object.keys(t[0].morphAttributes)),s={},c={},l=t[0].morphTargetsRelative,u=new e,d=0;for(let e=0;e<t.length;++e){let r=t[e],f=0;if(i!==(r.index!==null))return console.error(`THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index `+e+`. All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them.`),null;for(let t in r.attributes){if(!a.has(t))return console.error(`THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index `+e+`. All geometries must have compatible attributes; make sure "`+t+`" attribute exists among all geometries, or in none of them.`),null;s[t]===void 0&&(s[t]=[]),s[t].push(r.attributes[t]),f++}if(f!==a.size)return console.error(`THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index `+e+`. Make sure all geometries have the same number of attributes.`),null;if(l!==r.morphTargetsRelative)return console.error(`THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index `+e+`. .morphTargetsRelative must be consistent throughout all geometries.`),null;for(let t in r.morphAttributes){if(!o.has(t))return console.error(`THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index `+e+`. .morphAttributes must be consistent throughout all geometries.`),null;c[t]===void 0&&(c[t]=[]),c[t].push(r.morphAttributes[t])}if(n){let t;if(i)t=r.index.count;else if(r.attributes.position!==void 0)t=r.attributes.position.count;else return console.error(`THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index `+e+`. The geometry must have either an index or a position attribute`),null;u.addGroup(d,t,e),d+=t}}if(i){let e=0,n=[];for(let r=0;r<t.length;++r){let i=t[r].index;for(let t=0;t<i.count;++t)n.push(i.getX(t)+e);e+=t[r].attributes.position.count}u.setIndex(n)}for(let e in s){let t=r(s[e]);if(!t)return console.error(`THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the `+e+` attribute.`),null;u.setAttribute(e,t)}for(let e in c){let t=c[e][0].length;if(t!==0){u.morphAttributes=u.morphAttributes||{},u.morphAttributes[e]=[];for(let n=0;n<t;++n){let t=[];for(let r=0;r<c[e].length;++r)t.push(c[e][r][n]);let i=r(t);if(!i)return console.error(`THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the `+e+` morphAttribute.`),null;u.morphAttributes[e].push(i)}}}return u}function r(e){let n,r,i,a=-1,o=0;for(let t=0;t<e.length;++t){let s=e[t];if(n===void 0&&(n=s.array.constructor),n!==s.array.constructor)return console.error(`THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes.`),null;if(r===void 0&&(r=s.itemSize),r!==s.itemSize)return console.error(`THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes.`),null;if(i===void 0&&(i=s.normalized),i!==s.normalized)return console.error(`THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes.`),null;if(a===-1&&(a=s.gpuType),a!==s.gpuType)return console.error(`THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes.`),null;o+=s.count*r}let s=new n(o),c=new t(s,r,i),l=0;for(let t=0;t<e.length;++t){let n=e[t];if(n.isInterleavedBufferAttribute){let e=l/r;for(let t=0,i=n.count;t<i;t++)for(let i=0;i<r;i++){let r=n.getComponent(t,i);c.setComponent(t+e,i,r)}}else s.set(n.array,l);l+=n.count*r}return a!==void 0&&(c.gpuType=a),c}function i(e,n=Math.PI/3){let r=e.index?e.toNonIndexed():e,i=r.attributes.position,a=i.count,o;if(i.isBufferAttribute===!0&&i.itemSize===3&&i.normalized===!1)o=i.array;else{o=new Float64Array(a*3);for(let e=0;e<a;e++)o[3*e+0]=i.getX(e),o[3*e+1]=i.getY(e),o[3*e+2]=i.getZ(e)}let s=Math.cos(n),c=(1+1e-10)*100,l=a/3,u=new Float64Array(l*3);for(let e=0;e<l;e++){let t=9*e,n=o[t+0],r=o[t+1],i=o[t+2],a=o[t+3],s=o[t+4],c=o[t+5],l=o[t+6],d=o[t+7],f=o[t+8],p=l-a,m=d-s,h=f-c,g=n-a,_=r-s,v=i-c,y=m*v-h*_,b=h*g-p*v,x=p*_-m*g,S=1/(Math.sqrt(y*y+b*b+x*x)||1);u[3*e+0]=y*S,u[3*e+1]=b*S,u[3*e+2]=x*S}let d=new Int32Array(a),f=new Float64Array(a*3),p=1;for(;p<a*2;)p<<=1;let m=p-1,h=new Int32Array(p),g=0;for(let e=0;e<a;e++){let t=3*e,n=Math.trunc(o[t+0]*c),r=Math.trunc(o[t+1]*c),i=Math.trunc(o[t+2]*c),a=(Math.imul(n,73856093)^Math.imul(r,19349663)^Math.imul(i,83492791))&m;for(;;){let t=h[a];if(t===0){let t=3*g;f[t+0]=n,f[t+1]=r,f[t+2]=i,h[a]=g+1,d[e]=g++;break}let o=3*(t-1);if(f[o+0]===n&&f[o+1]===r&&f[o+2]===i){d[e]=t-1;break}a=a+1&m}}let _=new Int32Array(g+1);for(let e=0;e<a;e++)_[d[e]+1]++;for(let e=0;e<g;e++)_[e+1]+=_[e];let v=new Int32Array(a),y=_.slice(0,g);for(let e=0;e<l;e++){let t=3*e;v[y[d[t+0]]++]=e,v[y[d[t+1]]++]=e,v[y[d[t+2]]++]=e}let b=new Float32Array(a*3);for(let e=0;e<l;e++){let t=3*e,n=u[t+0],r=u[t+1],i=u[t+2];for(let e=0;e<3;e++){let a=t+e,o=d[a],c=0,l=0,f=0;for(let e=_[o],t=_[o+1];e<t;e++){let t=3*v[e],a=u[t+0],o=u[t+1],d=u[t+2];n*a+r*o+i*d>s&&(c+=a,l+=o,f+=d)}let p=1/(Math.sqrt(c*c+l*l+f*f)||1);b[3*a+0]=c*p,b[3*a+1]=l*p,b[3*a+2]=f*p}}return r.setAttribute(`normal`,new t(b,3,!1)),r}export{i as n,n as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{s as t,t as n}from"./jsx-runtime-CXW0f58S.js";import{f as r}from"./bloomMarks-DRhDp19k.js";import{i,r as a}from"./Office-9Mank16i.js";import{a as o}from"./director-CrzFgnoP.js";import{a as s,i as c,l,n as u,o as d}from"./kit-n-eqZ1AT.js";var f=e(t(),1),p=n(),m=22;function h({run:e,elevation:t}){let n=(0,f.useRef)(null),h=d(e.side),g=(0,f.useMemo)(()=>{let n=o(e.seed);return{dir:n()<.5?1:-1,x:h*(115+n()*30),y:u(t)+6+n()*6,next:4+n()*4}},[e.seed,h,t]);r(()=>{let r=e.t,o=n.current;if(!o)return;let l=s(-g.dir*175,g.dir*175,r/e.seconds),u=g.y+Math.sin(r*.8)*1.6;if(o.position.set(g.x+Math.sin(r*.21)*6,u,l),o.rotation.set(Math.sin(r*.9)*.05,(g.dir>0?0:Math.PI)+Math.sin(r*.33)*.5,Math.sin(r*.7)*.06),r>=g.next){g.next=r+7+Math.random()*6;let n=a(o.position.x,u-t,l,110);i(`squeak`,{gain:n.gain*c(r,e.seconds,3),pan:n.pan,pitch:.8+Math.random()*.3})}});let _=l(`#ffd23f`),v=l(`#ff8c1a`),y=l(`#1f1d2b`);return(0,p.jsx)(`group`,{ref:n,children:(0,p.jsxs)(`group`,{scale:m,children:[(0,p.jsx)(`mesh`,{material:_,scale:[1,.78,1.25],children:(0,p.jsx)(`sphereGeometry`,{args:[.5,22,16]})}),(0,p.jsx)(`mesh`,{material:_,position:[0,.18,-.6],"rotation-x":-.9,children:(0,p.jsx)(`coneGeometry`,{args:[.2,.4,14]})}),[-1,1].map(e=>(0,p.jsx)(`mesh`,{material:_,position:[e*.44,.08,-.05],scale:[.35,.6,1],children:(0,p.jsx)(`sphereGeometry`,{args:[.3,14,10]})},e)),(0,p.jsx)(`mesh`,{material:_,position:[0,.58,.36],children:(0,p.jsx)(`sphereGeometry`,{args:[.32,20,14]})}),(0,p.jsx)(`mesh`,{material:v,position:[0,.5,.68],scale:[1.1,.42,1],children:(0,p.jsx)(`sphereGeometry`,{args:[.16,14,10]})}),[-1,1].map(e=>(0,p.jsxs)(`group`,{children:[(0,p.jsx)(`mesh`,{material:y,position:[e*.14,.68,.6],children:(0,p.jsx)(`sphereGeometry`,{args:[.05,10,8]})}),(0,p.jsx)(`mesh`,{material:l(`#ffffff`),position:[e*.13,.7,.645],children:(0,p.jsx)(`sphereGeometry`,{args:[.015,6,4]})})]},e))]})})}export{h as default};
@@ -1,4 +1,4 @@
1
- import{s as e,t,u as n}from"./jsx-runtime-BFUkm7bt.js";import{Jr as r,dn as i}from"./store-FA83kfnc.js";import{Ht as a,O as o,Tt as s,f as c,g as l,it as u,pt as d,rt as f,tt as p,ut as m,w as h}from"./bloomMarks-DariC6lY.js";import{a as g,c as _,n as v}from"./useGraphics-Cif18p7Q.js";import{a as y}from"./gate-BplJKcLG.js";import{createPipeline as b,t as x}from"./pipeline-BOTOZ69L.js";var S=n(e(),1),C={name:`HorizontalBlurShader`,uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:`
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{s as t,t as n}from"./jsx-runtime-CXW0f58S.js";import{Ht as r,O as i,Tt as a,f as o,g as s,it as c,pt as l,rt as u,tt as d,ut as f,w as p}from"./bloomMarks-DRhDp19k.js";import{createPipeline as m,t as h}from"./pipeline-BGPWXegt.js";import{Jr as g,dn as _}from"./store-CXLtXw8e.js";import{a as v}from"./gate-D0uU0wv5.js";import{a as y,c as b,n as x}from"./useGraphics-Bg6L4EdS.js";var S=e(t(),1),C={name:`HorizontalBlurShader`,uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:`
2
2
 
3
3
  varying vec2 vUv;
4
4
 
@@ -62,4 +62,4 @@ import{s as e,t,u as n}from"./jsx-runtime-BFUkm7bt.js";import{Jr as r,dn as i}fr
62
62
 
63
63
  gl_FragColor = sum;
64
64
 
65
- }`},T=t(),E=1.1,D=[1024,768],O=8e3,k=.45,A=48,j=()=>null;function M(){let e=new u;return e.onBeforeCompile=e=>{e.fragmentShader=e.fragmentShader.replace(`vec4( vec3( 1.0 - fragCoordZ ), opacity );`,`vec4( vec3( 0.0 ), ( 1.0 - fragCoordZ ) * 0.85 );`)},e}function N(e){if(e.userData.person||e.userData.moving||e.userData.contactShadow)return!0;let t=e.material;return e.isPoints||e.isSprite?!0:!!t&&!Array.isArray(t)&&t.transparent&&!t.depthWrite}function P(){let e=l(e=>e.gl),t=l(e=>e.scene),n=(0,S.useMemo)(()=>{let e=new a(D[0],D[1]),t=new a(D[0],D[1],{depthBuffer:!1});e.texture.generateMipmaps=t.texture.generateMipmaps=!1;let n=new m(-16,16,12,-12,0,E);n.position.set(0,-.005,0),n.up.set(0,0,1),n.lookAt(0,1,0),n.updateMatrixWorld(),e.texture.repeat.set(1,-1),e.texture.offset.set(0,1);let r=new s(C),i=new s(w);r.depthTest=i.depthTest=!1;let o=new x(r);return{target:e,blurTarget:t,camera:n,depth:M(),quad:o,h:r,v:i,hidden:[]}},[]);(0,S.useEffect)(()=>()=>{for(let e of[n.target,n.blurTarget,n.depth,n.quad,n.h,n.v])e.dispose()},[n]);let r=t=>{let{quad:r,h:i,v:a,target:o,blurTarget:s}=n;r.material=i,i.uniforms.tDiffuse.value=o.texture,i.uniforms.h.value=t/D[0],e.setRenderTarget(s),r.render(e),r.material=a,a.uniforms.tDiffuse.value=s.texture,a.uniforms.v.value=t/D[1],e.setRenderTarget(o),r.render(e)},i=(0,S.useRef)(-1/0);return c(()=>{let a=performance.now();if(a-i.current<O)return;i.current=a;let{hidden:s,target:c,camera:l,depth:u}=n;t.traverse(e=>{e.visible&&N(e)&&(e.visible=!1,s.push(e))});let d=t.background,f=t.overrideMaterial,p=e.shadowMap.autoUpdate,m=e.getRenderTarget(),h=e.autoClear,g=e.getClearAlpha(),_=e.getClearColor(new o);t.background=null,t.overrideMaterial=u,e.shadowMap.autoUpdate=!1;try{e.setRenderTarget(c),e.setClearColor(0,0),e.clear(!0,!0,!1),e.autoClear=!1,e.render(t,l),r(3),r(1.2)}finally{for(let e of s)e.visible=!0;s.length=0,t.background=d,t.overrideMaterial=f,e.shadowMap.autoUpdate=p,e.autoClear=h,e.setClearColor(_,g),e.setRenderTarget(m)}}),(0,T.jsxs)(`mesh`,{rotation:[-Math.PI/2,0,0],position:[0,.008,0],raycast:j,userData:{contactShadow:!0},renderOrder:-1,children:[(0,T.jsx)(`planeGeometry`,{args:[32,24]}),(0,T.jsx)(`meshBasicMaterial`,{map:n.target.texture,transparent:!0,opacity:k,depthWrite:!1,toneMapped:!1,fog:!1})]})}function F(){let e=document.createElement(`canvas`);e.width=e.height=64;let t=e.getContext(`2d`),n=t.createRadialGradient(32,32,0,32,32,32);return n.addColorStop(0,`rgba(0,0,0,0.38)`),n.addColorStop(.55,`rgba(0,0,0,0.2)`),n.addColorStop(1,`rgba(0,0,0,0)`),t.fillStyle=n,t.fillRect(0,0,64,64),new h(e)}function I(){let e=(0,S.useRef)(null),t=(0,S.useMemo)(()=>({geometry:new d(1,1).rotateX(-Math.PI/2),material:new f({map:F(),transparent:!0,depthWrite:!1,toneMapped:!1,fog:!1}),m:new p}),[]);return(0,S.useEffect)(()=>()=>{t.geometry.dispose(),t.material.map?.dispose(),t.material.dispose()},[t]),c(()=>{let n=e.current;if(!n)return;let r=0;for(let e of i().values()){if(r>=A)break;let i=.62+.2*e.sit;t.m.makeScale(i,1,i).setPosition(e.x,.009,e.z),n.setMatrixAt(r++,t.m)}n.count=r,n.instanceMatrix.needsUpdate=!0}),(0,T.jsx)(`instancedMesh`,{ref:e,args:[t.geometry,t.material,A],frustumCulled:!1,raycast:j,userData:{contactShadow:!0}})}function L(){return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(P,{}),(0,T.jsx)(I,{})]})}var R=new Map,z=null,B,V=4e3,H=6e4;function U(e,t,n,r){clearTimeout(B),z??={autoClear:e.autoClear,autoReset:e.info.autoReset};let i=R.get(r);if(i&&i.scene===t&&i.camera===n)return i.pipe;i?.pipe.drop();let a=b(e,t,n,r);return R.set(r,{scene:t,camera:n,pipe:a}),a}function W(e){z&&=(e.autoClear=z.autoClear,e.info.autoReset=z.autoReset,null),e.setRenderTarget(null),clearTimeout(B),B=setTimeout(()=>{for(let e of R.values())e.pipe.drop();R.clear()},H)}function G({tier:e}){let t=l(e=>e.gl),n=l(e=>e.scene),i=l(e=>e.camera),a=l(e=>e.size),o=l(e=>e.viewport.dpr),[s,u]=(0,S.useState)(null),d=(0,S.useRef)(!1),f=(0,S.useRef)({at:0,done:!1});return(0,S.useLayoutEffect)(()=>{let r=U(t,n,i,e);return d.current=!1,u(r),()=>{_(null),g(`low`)}},[t,n,i,e]),(0,S.useEffect)(()=>()=>W(t),[t]),(0,S.useLayoutEffect)(()=>s?.setSize(a.width,a.height),[s,a,o]),(0,S.useEffect)(()=>{if(!s)return;let e=setInterval(()=>_(s.stats()),1e3);return()=>clearInterval(e)},[s]),c((o,c)=>{if(!y()){if(!s){t.render(n,i);return}try{let o=f.current;if(!o.done&&o.at&&performance.now()>=o.at){o.done=!0;let s=e===`high`?`medium`:`high`;if(!R.has(s)){let e=performance.now(),o=U(t,n,i,s);o.setSize(a.width,a.height),o.render(c),r(`warmup`,`${s} effects built in ${Math.round(performance.now()-e)} ms`)}}s.render(c)}catch(e){v(`they stopped with an error`,e),t.render(n,i);return}d.current||(d.current=!0,f.current.at||(f.current.at=performance.now()+V),_(s.stats()),g(e))}},1),e===`high`?(0,T.jsx)(L,{}):null}export{G as default};
65
+ }`},T=n(),E=1.1,D=[1024,768],O=8e3,k=.45,A=48,j=()=>null;function M(){let e=new c;return e.onBeforeCompile=e=>{e.fragmentShader=e.fragmentShader.replace(`vec4( vec3( 1.0 - fragCoordZ ), opacity );`,`vec4( vec3( 0.0 ), ( 1.0 - fragCoordZ ) * 0.85 );`)},e}function N(e){if(e.userData.person||e.userData.moving||e.userData.contactShadow)return!0;let t=e.material;return e.isPoints||e.isSprite?!0:!!t&&!Array.isArray(t)&&t.transparent&&!t.depthWrite}function P(){let e=s(e=>e.gl),t=s(e=>e.scene),n=(0,S.useMemo)(()=>{let e=new r(D[0],D[1]),t=new r(D[0],D[1],{depthBuffer:!1});e.texture.generateMipmaps=t.texture.generateMipmaps=!1;let n=new f(-16,16,12,-12,0,E);n.position.set(0,-.005,0),n.up.set(0,0,1),n.lookAt(0,1,0),n.updateMatrixWorld(),e.texture.repeat.set(1,-1),e.texture.offset.set(0,1);let i=new a(C),o=new a(w);i.depthTest=o.depthTest=!1;let s=new h(i);return{target:e,blurTarget:t,camera:n,depth:M(),quad:s,h:i,v:o,hidden:[]}},[]);(0,S.useEffect)(()=>()=>{for(let e of[n.target,n.blurTarget,n.depth,n.quad,n.h,n.v])e.dispose()},[n]);let c=t=>{let{quad:r,h:i,v:a,target:o,blurTarget:s}=n;r.material=i,i.uniforms.tDiffuse.value=o.texture,i.uniforms.h.value=t/D[0],e.setRenderTarget(s),r.render(e),r.material=a,a.uniforms.tDiffuse.value=s.texture,a.uniforms.v.value=t/D[1],e.setRenderTarget(o),r.render(e)},l=(0,S.useRef)(-1/0);return o(()=>{let r=performance.now();if(r-l.current<O)return;l.current=r;let{hidden:a,target:o,camera:s,depth:u}=n;t.traverse(e=>{e.visible&&N(e)&&(e.visible=!1,a.push(e))});let d=t.background,f=t.overrideMaterial,p=e.shadowMap.autoUpdate,m=e.getRenderTarget(),h=e.autoClear,g=e.getClearAlpha(),_=e.getClearColor(new i);t.background=null,t.overrideMaterial=u,e.shadowMap.autoUpdate=!1;try{e.setRenderTarget(o),e.setClearColor(0,0),e.clear(!0,!0,!1),e.autoClear=!1,e.render(t,s),c(3),c(1.2)}finally{for(let e of a)e.visible=!0;a.length=0,t.background=d,t.overrideMaterial=f,e.shadowMap.autoUpdate=p,e.autoClear=h,e.setClearColor(_,g),e.setRenderTarget(m)}}),(0,T.jsxs)(`mesh`,{rotation:[-Math.PI/2,0,0],position:[0,.008,0],raycast:j,userData:{contactShadow:!0},renderOrder:-1,children:[(0,T.jsx)(`planeGeometry`,{args:[32,24]}),(0,T.jsx)(`meshBasicMaterial`,{map:n.target.texture,transparent:!0,opacity:k,depthWrite:!1,toneMapped:!1,fog:!1})]})}function F(){let e=document.createElement(`canvas`);e.width=e.height=64;let t=e.getContext(`2d`),n=t.createRadialGradient(32,32,0,32,32,32);return n.addColorStop(0,`rgba(0,0,0,0.38)`),n.addColorStop(.55,`rgba(0,0,0,0.2)`),n.addColorStop(1,`rgba(0,0,0,0)`),t.fillStyle=n,t.fillRect(0,0,64,64),new p(e)}function I(){let e=(0,S.useRef)(null),t=(0,S.useMemo)(()=>({geometry:new l(1,1).rotateX(-Math.PI/2),material:new u({map:F(),transparent:!0,depthWrite:!1,toneMapped:!1,fog:!1}),m:new d}),[]);return(0,S.useEffect)(()=>()=>{t.geometry.dispose(),t.material.map?.dispose(),t.material.dispose()},[t]),o(()=>{let n=e.current;if(!n)return;let r=0;for(let e of _().values()){if(r>=A)break;let i=.62+.2*e.sit;t.m.makeScale(i,1,i).setPosition(e.x,.009,e.z),n.setMatrixAt(r++,t.m)}n.count=r,n.instanceMatrix.needsUpdate=!0}),(0,T.jsx)(`instancedMesh`,{ref:e,args:[t.geometry,t.material,A],frustumCulled:!1,raycast:j,userData:{contactShadow:!0}})}function L(){return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(P,{}),(0,T.jsx)(I,{})]})}var R=new Map,z=null,B,V=4e3,H=6e4;function U(e,t,n,r){clearTimeout(B),z??={autoClear:e.autoClear,autoReset:e.info.autoReset};let i=R.get(r);if(i&&i.scene===t&&i.camera===n)return i.pipe;i?.pipe.drop();let a=m(e,t,n,r);return R.set(r,{scene:t,camera:n,pipe:a}),a}function W(e){z&&=(e.autoClear=z.autoClear,e.info.autoReset=z.autoReset,null),e.setRenderTarget(null),clearTimeout(B),B=setTimeout(()=>{for(let e of R.values())e.pipe.drop();R.clear()},H)}function G({tier:e}){let t=s(e=>e.gl),n=s(e=>e.scene),r=s(e=>e.camera),i=s(e=>e.size),a=s(e=>e.viewport.dpr),[c,l]=(0,S.useState)(null),u=(0,S.useRef)(!1),d=(0,S.useRef)({at:0,done:!1});return(0,S.useLayoutEffect)(()=>{let i=U(t,n,r,e);return u.current=!1,l(i),()=>{b(null),y(`low`)}},[t,n,r,e]),(0,S.useEffect)(()=>()=>W(t),[t]),(0,S.useLayoutEffect)(()=>c?.setSize(i.width,i.height),[c,i,a]),(0,S.useEffect)(()=>{if(!c)return;let e=setInterval(()=>b(c.stats()),1e3);return()=>clearInterval(e)},[c]),o((a,o)=>{if(!v()){if(!c)t.render(n,r);else{try{let a=d.current;if(!a.done&&a.at&&performance.now()>=a.at){a.done=!0;let s=e===`high`?`medium`:`high`;if(!R.has(s)){let e=performance.now(),a=U(t,n,r,s);a.setSize(i.width,i.height),a.render(o),g(`warmup`,`${s} effects built in ${Math.round(performance.now()-e)} ms`)}}c.render(o)}catch(e){x(`they stopped with an error`,e),t.render(n,r);return}u.current||(u.current=!0,d.current.at||(d.current.at=performance.now()+V),b(c.stats()),y(e))}}},1),e===`high`?(0,T.jsx)(L,{}):null}export{G as default};
@@ -1,4 +1,4 @@
1
- import{s as e,t,u as n}from"./jsx-runtime-BFUkm7bt.js";import{C as r,O as i,P as a,S as o,Tt as s,et as c,f as l,g as u,i as d,mt as f}from"./bloomMarks-DariC6lY.js";import{a as p}from"./director-CrzFgnoP.js";import{i as m,r as h}from"./Office-BBnd6tyn.js";import{n as g,o as _}from"./kit-C6ByUQ-Y.js";var v=n(e(),1),y=t(),b=2400,x=-6,S=[`position`,`aVel`,`aColor`,`aTime`,`aSize`],C=[`#ff595e`,`#ffca3a`,`#8ac926`,`#1982c4`,`#ff70a6`,`#ffffff`,`#c77dff`,`#4cc9f0`],w=`
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{s as t,t as n}from"./jsx-runtime-CXW0f58S.js";import{C as r,O as i,P as a,S as o,Tt as s,et as c,f as l,g as u,i as d,mt as f}from"./bloomMarks-DRhDp19k.js";import{i as p,r as m}from"./Office-9Mank16i.js";import{a as h}from"./director-CrzFgnoP.js";import{n as g,o as _}from"./kit-n-eqZ1AT.js";var v=e(t(),1),y=n(),b=2400,x=-6,S=[`position`,`aVel`,`aColor`,`aTime`,`aSize`],C=[`#ff595e`,`#ffca3a`,`#8ac926`,`#1982c4`,`#ff70a6`,`#ffffff`,`#c77dff`,`#4cc9f0`],w=`
2
2
  attribute vec3 aVel;
3
3
  attribute vec3 aColor;
4
4
  attribute vec2 aTime; // start, life
@@ -30,4 +30,4 @@ void main() {
30
30
  float r = length(gl_PointCoord - 0.5);
31
31
  float a = (1.0 - smoothstep(0.1, 0.5, r)) * vFade;
32
32
  gl_FragColor = vec4(vColor * (1.0 + (1.0 - smoothstep(0.0, 0.2, r))), a);
33
- }`;function E({run:e,elevation:t}){let n=u(e=>e.gl),E=_(e.side),D=(0,v.useMemo)(()=>{let n=p(e.seed),c=[],l=(e,r=!1)=>{let a=n()<.2?`willow`:n()<.35?`ring`:`sphere`,o=C[Math.floor(n()*C.length)];c.push({at:e,x:E*(140+n()*90),y:g(t)+22+n()*30,z:(n()-.5)*260,shape:a,color:new i(a===`willow`?`#ffcf6b`:o),color2:new i(n()<.4?C[Math.floor(n()*C.length)]:o),sparks:r?140:70+Math.floor(n()*50),done:!1})};for(let t=2;t<e.seconds-12;t+=.9+n()*1.3)l(t);for(let t=0;t<9;t++)l(e.seconds-11+t*.35+n()*.2,!0);c.sort((e,t)=>e.at-t.at);let u=new r,m=e=>new o(new Float32Array(b*e),e).setUsage(a);u.setAttribute(`position`,m(3)),u.setAttribute(`aVel`,m(3)),u.setAttribute(`aColor`,m(3)),u.setAttribute(`aTime`,m(2)),u.setAttribute(`aSize`,m(1)),u.attributes.aTime.array.fill(-1e3);let h=d(new s({vertexShader:w,fragmentShader:T,transparent:!0,depthWrite:!1,blending:2,uniforms:{uTime:{value:0},uScale:{value:400}}})),_=new f(u,h);return _.frustumCulled=!1,_.renderOrder=5,{launches:c,geo:u,mat:h,points:_,next:0,slot:0,rnd:p(e.seed+1)}},[e.seed,e.seconds,E,t]);(0,v.useEffect)(()=>()=>{D.geo.dispose(),D.mat.dispose()},[D]);let O=(e,t,n,r,i,a,o,s,c,l)=>{let u=D.slot;D.slot=(D.slot+1)%b;let d=D.geo.attributes,f=d.position.array,p=d.aVel.array,m=d.aColor.array,h=d.aTime.array;f[u*3]=e,f[u*3+1]=t,f[u*3+2]=n,p[u*3]=r,p[u*3+1]=i,p[u*3+2]=a,m[u*3]=o.r,m[u*3+1]=o.g,m[u*3+2]=o.b,h[u*2]=s,h[u*2+1]=c,d.aSize.array[u]=l};return l(({camera:r})=>{let i=e.t,a=r;D.mat.uniforms.uTime.value=i,D.mat.uniforms.uScale.value=n.domElement.height*.5/Math.tan(c.degToRad(a.fov/2));let o=!1;for(;D.next<D.launches.length&&D.launches[D.next].at<=i;){let e=D.launches[D.next++],n=1.5+D.rnd()*.4,i=e.at+n,a=(e.y-.5*x*n*n)/((1-Math.exp(-1.6*n))/1.6);for(let t=0;t<6;t++)O(e.x,0,e.z,0,a,0,e.color,e.at+t*.04,n-t*.04,t?.9:1.6);let s=D.rnd;for(let t=0;t<e.sparks;t++){let n,r,a;if(e.shape===`ring`){let i=t/e.sparks*Math.PI*2;n=Math.cos(i)*.25,r=Math.cos(i)*.9,a=Math.sin(i)}else{let e=s()*2-1,t=s()*Math.PI*2,i=Math.sqrt(1-e*e);n=Math.cos(t)*i,r=e,a=Math.sin(t)*i}let o=e.shape===`willow`?14:25+s()*6;O(e.x,e.y,e.z,n*o,r*o+(e.shape===`willow`?3:0),a*o,t%2?e.color2:e.color,i,e.shape===`willow`?3.6:2+s()*.6,e.shape===`willow`?2.4:3.2)}o=!0;let c=h(e.x,e.y-t,e.z,220);m(`launch`,{gain:c.gain,pan:c.pan,pitch:.85+D.rnd()*.3});let l=Math.hypot(e.x-r.position.x,e.y-t-r.position.y,e.z-r.position.z)/343;m(`boom`,{gain:c.gain,pan:c.pan,delay:n+l}),e.shape!==`ring`&&m(`crackle`,{gain:c.gain*.8,pan:c.pan,delay:n+l+.5})}if(o)for(let e of S)D.geo.attributes[e].needsUpdate=!0}),(0,y.jsx)(`primitive`,{object:D.points})}export{E as default};
33
+ }`;function E({run:e,elevation:t}){let n=u(e=>e.gl),E=_(e.side),D=(0,v.useMemo)(()=>{let n=h(e.seed),c=[],l=(e,r=!1)=>{let a=n()<.2?`willow`:n()<.35?`ring`:`sphere`,o=C[Math.floor(n()*C.length)];c.push({at:e,x:E*(140+n()*90),y:g(t)+22+n()*30,z:(n()-.5)*260,shape:a,color:new i(a===`willow`?`#ffcf6b`:o),color2:new i(n()<.4?C[Math.floor(n()*C.length)]:o),sparks:r?140:70+Math.floor(n()*50),done:!1})};for(let t=2;t<e.seconds-12;t+=.9+n()*1.3)l(t);for(let t=0;t<9;t++)l(e.seconds-11+t*.35+n()*.2,!0);c.sort((e,t)=>e.at-t.at);let u=new r,p=e=>new o(new Float32Array(b*e),e).setUsage(a);u.setAttribute(`position`,p(3)),u.setAttribute(`aVel`,p(3)),u.setAttribute(`aColor`,p(3)),u.setAttribute(`aTime`,p(2)),u.setAttribute(`aSize`,p(1)),u.attributes.aTime.array.fill(-1e3);let m=d(new s({vertexShader:w,fragmentShader:T,transparent:!0,depthWrite:!1,blending:2,uniforms:{uTime:{value:0},uScale:{value:400}}})),_=new f(u,m);return _.frustumCulled=!1,_.renderOrder=5,{launches:c,geo:u,mat:m,points:_,next:0,slot:0,rnd:h(e.seed+1)}},[e.seed,e.seconds,E,t]);(0,v.useEffect)(()=>()=>{D.geo.dispose(),D.mat.dispose()},[D]);let O=(e,t,n,r,i,a,o,s,c,l)=>{let u=D.slot;D.slot=(D.slot+1)%b;let d=D.geo.attributes,f=d.position.array,p=d.aVel.array,m=d.aColor.array,h=d.aTime.array;f[u*3]=e,f[u*3+1]=t,f[u*3+2]=n,p[u*3]=r,p[u*3+1]=i,p[u*3+2]=a,m[u*3]=o.r,m[u*3+1]=o.g,m[u*3+2]=o.b,h[u*2]=s,h[u*2+1]=c,d.aSize.array[u]=l};return l(({camera:r})=>{let i=e.t,a=r;D.mat.uniforms.uTime.value=i,D.mat.uniforms.uScale.value=n.domElement.height*.5/Math.tan(c.degToRad(a.fov/2));let o=!1;for(;D.next<D.launches.length&&D.launches[D.next].at<=i;){let e=D.launches[D.next++],n=1.5+D.rnd()*.4,i=e.at+n,a=(e.y-.5*x*n*n)/((1-Math.exp(-1.6*n))/1.6);for(let t=0;t<6;t++)O(e.x,0,e.z,0,a,0,e.color,e.at+t*.04,n-t*.04,t?.9:1.6);let s=D.rnd;for(let t=0;t<e.sparks;t++){let n,r,a;if(e.shape===`ring`){let i=t/e.sparks*Math.PI*2;n=Math.cos(i)*.25,r=Math.cos(i)*.9,a=Math.sin(i)}else{let e=s()*2-1,t=s()*Math.PI*2,i=Math.sqrt(1-e*e);n=Math.cos(t)*i,r=e,a=Math.sin(t)*i}let o=e.shape===`willow`?14:25+s()*6;O(e.x,e.y,e.z,n*o,r*o+(e.shape===`willow`?3:0),a*o,t%2?e.color2:e.color,i,e.shape===`willow`?3.6:2+s()*.6,e.shape===`willow`?2.4:3.2)}o=!0;let c=m(e.x,e.y-t,e.z,220);p(`launch`,{gain:c.gain,pan:c.pan,pitch:.85+D.rnd()*.3});let l=Math.hypot(e.x-r.position.x,e.y-t-r.position.y,e.z-r.position.z)/343;p(`boom`,{gain:c.gain,pan:c.pan,delay:n+l}),e.shape!==`ring`&&p(`crackle`,{gain:c.gain*.8,pan:c.pan,delay:n+l+.5})}if(o)for(let e of S)D.geo.attributes[e].needsUpdate=!0}),(0,y.jsx)(`primitive`,{object:D.points})}export{E as default};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{s as t,t as n}from"./jsx-runtime-CXW0f58S.js";import{Bt as r,f as i}from"./bloomMarks-DRhDp19k.js";import{Va as a,Vo as o,p as s}from"./store-CXLtXw8e.js";import{n as c,r as l}from"./Office-9Mank16i.js";import{a as u}from"./director-CrzFgnoP.js";import{a as d,c as f,i as p,l as m,n as h,o as g,s as _}from"./kit-n-eqZ1AT.js";var v=e(t(),1),y=n(),b=8,x=19,S={approach:20,over:27,down:31,lift:42,up:46},C=1.62*1.6;function w({run:e,elevation:t}){let n=(0,v.useRef)(null),w=(0,v.useRef)(null),T=(0,v.useRef)(null),E=g(e.side),D=(0,v.useMemo)(()=>{let n=u(e.seed),i=s.getState(),c=i.repos.reduce((e,t)=>Math.max(e,t.floor),0),l=i.floor===-1||n()<.5,d={x:a.x,y:o(c)+C,z:a.z};return{cx:E*(85+n()*20),cz:(n()-.5)*40,radius:42+n()*10,y:h(t)+9+n()*8,dir:n()<.5?1:-1,phase:n()*Math.PI*2,far:{x:E*420,z:(n()-.5)*500},land:l,pad:d,from:new r,fromSet:!1,heading:0}},[e.seed,E,t]),O=(0,v.useMemo)(()=>({rotor:null,prev:new r,first:!0,spin:0}),[]);(0,v.useEffect)(()=>(O.rotor=c(`rotor`),()=>O.rotor?.stop(1)),[O]),i((r,i)=>{let a=e.t,o=n.current;if(!o)return;let s=D.phase+D.dir*(a*Math.PI*2)/x,c=D.cx+Math.cos(s)*D.radius,u=D.cz+Math.sin(s)*D.radius,m=D.y,h=_(a/b),g=_((a-(e.seconds-b))/b);c=d(D.far.x,c,h),u=d(-D.far.z,u,h),m+=(1-h)*40;let v=0;if(D.land&&a>=S.approach&&a<e.seconds-b){D.fromSet||D.from.set(c,m,u),D.fromSet=!0;let e=D.pad.y+14,t=f(a,S.approach,S.over);c=d(D.from.x,D.pad.x,t),u=d(D.from.z,D.pad.z,t),m=d(D.from.y,e,t),m=d(m,D.pad.y,f(a,S.over,S.down)-f(a,S.lift,S.up)),v=f(a,S.down-.5,S.down)*(1-f(a,S.lift,S.lift+1))}D.land&&a>=e.seconds-b&&(c=D.pad.x,u=D.pad.z,m=D.pad.y+14),c=d(c,D.far.x,g),u=d(u,D.far.z,g),m+=g*40,O.first&&O.prev.set(c,m,u),O.first=!1;let y=c-O.prev.x,C=u-O.prev.z;y*y+C*C>1e-5&&(D.heading=Math.atan2(y,C)),o.rotation.y=D.heading;let E=D.land?1-f(a,S.approach,S.approach+3)+f(a,e.seconds-b,e.seconds-b+2):1;o.rotation.z=-D.dir*.22*h*(1-g)*Math.min(1,E),o.rotation.x=.12*(1-v),o.position.set(c,m,u),O.prev.set(c,m,u),O.spin+=Math.min(i,.1)*(31-22*v),w.current&&(w.current.rotation.y=O.spin),T.current&&(T.current.rotation.x=O.spin*1.3);let k=l(c,m-t,u,60);O.rotor?.set(k.gain*p(a,e.seconds,2)*(1-.6*v),k.pan,1-.35*v)});let k=m(`#d62828`),A=m(`#2b2d42`);return(0,y.jsxs)(`group`,{ref:n,scale:1.6,children:[(0,y.jsx)(`mesh`,{material:k,scale:[1,.95,1.5],children:(0,y.jsx)(`sphereGeometry`,{args:[1.6,14,10]})}),(0,y.jsx)(`mesh`,{material:m(`#8ecae6`),position:[0,.35,1.25],scale:[1,.7,.8],children:(0,y.jsx)(`sphereGeometry`,{args:[1.05,12,8]})}),(0,y.jsx)(`mesh`,{material:k,position:[0,.3,-3.2],"rotation-x":Math.PI/2,children:(0,y.jsx)(`cylinderGeometry`,{args:[.28,.45,4.2,8]})}),(0,y.jsx)(`mesh`,{material:m(`#f1faee`),position:[0,1,-5.1],children:(0,y.jsx)(`boxGeometry`,{args:[.15,1.4,.9]})}),(0,y.jsx)(`mesh`,{ref:T,material:A,position:[.2,.9,-5.2],children:(0,y.jsx)(`boxGeometry`,{args:[.05,1.6,.18]})}),[-.9,.9].map(e=>(0,y.jsx)(`mesh`,{material:A,position:[e,-1.55,0],children:(0,y.jsx)(`boxGeometry`,{args:[.12,.12,3.4]})},e)),(0,y.jsx)(`mesh`,{material:A,position:[0,1.55,0],children:(0,y.jsx)(`cylinderGeometry`,{args:[.18,.18,.5,8]})}),(0,y.jsxs)(`group`,{ref:w,position:[0,1.85,0],children:[(0,y.jsx)(`mesh`,{material:A,children:(0,y.jsx)(`boxGeometry`,{args:[11,.06,.35]})}),(0,y.jsx)(`mesh`,{material:A,"rotation-y":Math.PI/2,children:(0,y.jsx)(`boxGeometry`,{args:[11,.06,.35]})})]})]})}export{w as default};
@@ -1,4 +1,4 @@
1
- import{s as e,t,u as n}from"./jsx-runtime-BFUkm7bt.js";import{Bt as r,D as i,O as a,Tt as o,f as s,nt as c}from"./bloomMarks-DariC6lY.js";import{n as l}from"./weatherState-ExG1doW-.js";import{a as u}from"./director-CrzFgnoP.js";import{n as d,r as f}from"./Office-BBnd6tyn.js";import{i as p,o as m}from"./kit-C6ByUQ-Y.js";var h=n(e(),1),g=t(),_=`
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{s as t,t as n}from"./jsx-runtime-CXW0f58S.js";import{Bt as r,D as i,O as a,Tt as o,f as s,nt as c}from"./bloomMarks-DRhDp19k.js";import{n as l,r as u}from"./Office-9Mank16i.js";import{n as d}from"./weatherState-BJVm5hU-.js";import{a as f}from"./director-CrzFgnoP.js";import{i as p,o as m}from"./kit-n-eqZ1AT.js";var h=e(t(),1),g=n(),_=`
2
2
  varying vec2 vP;
3
3
  void main() {
4
4
  vP = position.xy;
@@ -30,4 +30,4 @@ void main() {
30
30
  vec3 col = mix(uShade, uLit, cloud * 0.7 + 0.3 * smoothstep(0.2, 0.9, r));
31
31
  gl_FragColor = vec4(col, alpha);
32
32
  #include <colorspace_fragment>
33
- }`,y=new a(`#eef1f6`),b=new a(`#7d8794`),x=22,S={kind:`heavy-rain`,wind:1};function C({run:e}){let t=m(e.side),n=(0,h.useMemo)(()=>{let n=u(e.seed),a=new i(230,96),s=new o({vertexShader:_,fragmentShader:v,transparent:!0,depthWrite:!1,side:2,uniforms:{uTime:{value:0},uFade:{value:0},uRadius:{value:230},uLit:{value:y.clone()},uShade:{value:b.clone()}}}),l=new c(a,s);return l.position.set(t*(320+n()*30),140,(n()-.5)*120),l.rotation.set(-Math.PI/2,0,0),l.rotateOnWorldAxis(new r(0,0,1),t*.95),l.renderOrder=1,l.frustumCulled=!1,{geo:a,mat:s,mesh:l}},[e.seed,t]),a=(0,h.useMemo)(()=>({gale:null}),[]);return(0,h.useEffect)(()=>(a.gale=d(`gale`),()=>{l(null),a.gale?.stop(2),n.geo.dispose(),n.mat.dispose()}),[n,a]),s(()=>{let t=e.t;n.mat.uniforms.uTime.value=t,n.mat.uniforms.uFade.value=p(t,e.seconds,15),l(t<e.seconds-x?S:null);let r=f(n.mesh.position.x,0,n.mesh.position.z,300);a.gale?.set(Math.max(.4,r.gain)*p(t,e.seconds,10),r.pan*.5)}),(0,g.jsx)(`primitive`,{object:n.mesh})}export{C as default};
33
+ }`,y=new a(`#eef1f6`),b=new a(`#7d8794`),x=22,S={kind:`heavy-rain`,wind:1};function C({run:e}){let t=m(e.side),n=(0,h.useMemo)(()=>{let n=f(e.seed),a=new i(230,96),s=new o({vertexShader:_,fragmentShader:v,transparent:!0,depthWrite:!1,side:2,uniforms:{uTime:{value:0},uFade:{value:0},uRadius:{value:230},uLit:{value:y.clone()},uShade:{value:b.clone()}}}),l=new c(a,s);return l.position.set(t*(320+n()*30),140,(n()-.5)*120),l.rotation.set(-Math.PI/2,0,0),l.rotateOnWorldAxis(new r(0,0,1),t*.95),l.renderOrder=1,l.frustumCulled=!1,{geo:a,mat:s,mesh:l}},[e.seed,t]),a=(0,h.useMemo)(()=>({gale:null}),[]);return(0,h.useEffect)(()=>(a.gale=l(`gale`),()=>{d(null),a.gale?.stop(2),n.geo.dispose(),n.mat.dispose()}),[n,a]),s(()=>{let t=e.t;n.mat.uniforms.uTime.value=t,n.mat.uniforms.uFade.value=p(t,e.seconds,15),d(t<e.seconds-x?S:null);let r=u(n.mesh.position.x,0,n.mesh.position.z,300);a.gale?.set(Math.max(.4,r.gain)*p(t,e.seconds,10),r.pan*.5)}),(0,g.jsx)(`primitive`,{object:n.mesh})}export{C as default};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{s as t,t as n}from"./jsx-runtime-CXW0f58S.js";import{f as r}from"./bloomMarks-DRhDp19k.js";import{v as i,y as a}from"./index-CDJgPTOC.js";import{dn as o,i as s,r as c,un as l}from"./Office-9Mank16i.js";import{Lo as u}from"./store-CXLtXw8e.js";import{o as d}from"./cityLayout-aA2Ktgpu.js";import{n as f}from"./billboardLayout-DSKGXPIM.js";import{a as p}from"./director-CrzFgnoP.js";import{c as m,l as h,o as g,t as _}from"./kit-n-eqZ1AT.js";var v=e(t(),1),y=n(),b=70,x=1.15,S=4.6,C=[9,33,62],w=2.6,T=9e4;function E({run:e,elevation:t}){let n=(0,v.useRef)(null),E=(0,v.useRef)(null),D=(0,v.useRef)(null),O=(0,v.useRef)([]),k=(0,v.useRef)([]),A=(0,v.useRef)(null),j=(0,v.useRef)(null),M=g(e.side),N=(0,v.useMemo)(()=>{let t=p(e.seed),n=t()<.5?1:-1,r=l().map((e,t)=>({...e,i:t})).filter(e=>M*e.x>f.max+10&&M*e.x<260&&Math.abs(e.z)<160),i=e=>Math.abs(M*e.x-175)+Math.abs(e.z)*.8;r.sort((e,t)=>i(e)-i(t));let a=r[0]??null,o=a?d():null,s=a&&o?o.cylinders[a.cylinder]:null;return{dir:n,x:a?a.x+M*19:M*190,z0:(a?a.z:(t()-.5)*60)-n*S*40,tower:a,tankR:s?s.w/2:1.5}},[e.seed,M]),P=(0,v.useMemo)(()=>({shake:0,lastStep:-1,roared:-1,knocked:-1,crashed:!1}),[]);(0,v.useEffect)(()=>{let e=N.tower;return()=>{e&&P.knocked>=0?setTimeout(()=>o(e.i,!1),T):e&&o(e.i,!1)}},[N,P]),r(({camera:r},l)=>{let d=e.t,f=n.current;if(!f)return;let p=N.z0+N.dir*S*d,h=d/x*Math.PI,g=0,v=-1;for(let e=0;e<C.length;e++)g=Math.max(g,m(d,C[e],C[e]+.4)*(1-m(d,C[e]+w-.5,C[e]+w))),d>=C[e]&&d<C[e]+.5&&(v=e);let y=1-g*.8;f.position.set(N.x,Math.abs(Math.sin(h))*.7*y,p),f.rotation.set(0,(N.dir>0?0:Math.PI)-M*N.dir*.35,Math.sin(h)*.04*y);for(let e=0;e<2;e++){let t=O.current[e];t&&(t.rotation.x=Math.sin(h+e*Math.PI)*.45*y);let n=k.current[e];n&&(n.rotation.x=-.6-g*1.2+Math.sin(h*2+e)*.15)}A.current&&(A.current.rotation.y=Math.sin(h*.5)*.35);let T=E.current;if(T){let e=N.tower&&P.knocked>=0?m(d,P.knocked+.6,P.knocked+1.4)*(1-m(d,P.knocked+4,P.knocked+5)):0;T.rotation.set(-g*.55+e*.15,-M*N.dir*.3+Math.sin(d*.4)*.25+e*-M*N.dir*.6,e*.25)}D.current&&(D.current.scale.y=.25+g*1.6);let F=Math.floor(d/x);if(F!==P.lastStep&&y>.5){P.lastStep=F;let e=c(N.x,-t,p,200);s(`stomp`,{gain:e.gain,pan:e.pan,pitch:.9+Math.random()*.2}),P.shake=1}if(v>=0&&P.roared!==v){P.roared=v;let e=c(N.x,b*.9-t,p,200);s(`roar`,{gain:e.gain,pan:e.pan})}P.shake*=Math.exp(-6*Math.min(.1,l)),P.shake>.01&&i().cameraShake&&!a()&&u(r.position.x)&&(r.rotation.x+=P.shake*.0035*Math.sin(d*41),r.rotation.z+=P.shake*.0025*Math.sin(d*33));let I=N.tower,L=j.current;if(I&&L&&(P.knocked<0&&N.dir*(p-I.z)>-7&&(P.knocked=d,o(I.i,!0)),L.visible=P.knocked>=0,P.knocked>=0)){let e=_((d-P.knocked)/1.3);if(L.rotation.z=M*Math.PI*.5*e*e-(e>=1?M*.06*Math.sin((d-P.knocked-1.3)*12)*Math.exp(-(d-P.knocked-1.3)*4):0),e>=1&&!P.crashed){P.crashed=!0;let e=c(I.x,I.y-t,I.z,180);s(`crash`,{gain:e.gain,pan:e.pan})}}});let F=h(`#6abf69`),I=h(`#f6e7a1`),L=h(`#ff9f1c`),R=h(`#1f1d2b`),z=h(`#ffffff`);return(0,y.jsxs)(`group`,{children:[(0,y.jsx)(`group`,{ref:n,children:(0,y.jsxs)(`group`,{scale:b,children:[(0,y.jsx)(`mesh`,{material:F,position:[0,.5,0],scale:[1,1.25,1.1],children:(0,y.jsx)(`sphereGeometry`,{args:[.28,20,14]})}),(0,y.jsx)(`mesh`,{material:I,position:[0,.47,.13],scale:[.85,1.15,.7],children:(0,y.jsx)(`sphereGeometry`,{args:[.22,16,12]})}),[0,1].map(e=>(0,y.jsxs)(`group`,{ref:t=>void(O.current[e]=t),position:[e?.13:-.13,.3,0],children:[(0,y.jsx)(`mesh`,{material:F,position:[0,-.14,0],children:(0,y.jsx)(`cylinderGeometry`,{args:[.085,.1,.3,10]})}),(0,y.jsx)(`mesh`,{material:F,position:[0,-.29,.04],scale:[1,.5,1.4],children:(0,y.jsx)(`sphereGeometry`,{args:[.1,10,8]})})]},e)),[0,1].map(e=>(0,y.jsx)(`group`,{ref:t=>void(k.current[e]=t),position:[e?.22:-.22,.64,.1],children:(0,y.jsx)(`mesh`,{material:F,position:[0,-.05,.06],"rotation-x":.6,children:(0,y.jsx)(`capsuleGeometry`,{args:[.035,.1,4,8]})})},e)),(0,y.jsx)(`group`,{ref:A,position:[0,.36,-.24],children:[0,1,2,3].map(e=>(0,y.jsx)(`mesh`,{material:F,position:[0,-e*.05,-.1-e*.12],scale:1-e*.2,children:(0,y.jsx)(`sphereGeometry`,{args:[.12,12,8]})},e))}),[0,1,2,3,4].map(e=>(0,y.jsx)(`mesh`,{material:L,position:[0,.84-e*.12,-.1-e*.06],"rotation-x":-.5-e*.12,scale:1-e*.12,children:(0,y.jsx)(`coneGeometry`,{args:[.05,.12,6]})},e)),(0,y.jsxs)(`group`,{ref:E,position:[0,.86,.1],children:[(0,y.jsx)(`mesh`,{material:F,children:(0,y.jsx)(`sphereGeometry`,{args:[.17,18,14]})}),(0,y.jsx)(`mesh`,{material:F,position:[0,-.04,.15],scale:[1,.72,1.15],children:(0,y.jsx)(`sphereGeometry`,{args:[.11,14,10]})}),[-1,1].map(e=>(0,y.jsxs)(`group`,{children:[(0,y.jsx)(`mesh`,{material:z,position:[e*.075,.06,.12],children:(0,y.jsx)(`sphereGeometry`,{args:[.055,12,10]})}),(0,y.jsx)(`mesh`,{material:R,position:[e*.075,.065,.168],children:(0,y.jsx)(`sphereGeometry`,{args:[.027,10,8]})}),(0,y.jsx)(`mesh`,{material:h(`#ff8fab`),position:[e*.11,-.03,.12],scale:[1,.6,.4],children:(0,y.jsx)(`sphereGeometry`,{args:[.03,8,6]})})]},e)),(0,y.jsx)(`mesh`,{ref:D,material:h(`#7a1f3d`),position:[0,-.08,.255],scale:[1,.25,.5],children:(0,y.jsx)(`sphereGeometry`,{args:[.06,12,8]})})]})]})}),N.tower&&(0,y.jsx)(`group`,{ref:j,position:[N.tower.x-M*N.tankR,N.tower.y,N.tower.z],visible:!1,children:(0,y.jsxs)(`group`,{position:[M*N.tankR,0,0],children:[(0,y.jsx)(`mesh`,{material:h(`#5e4a3c`),position:[0,.8,0],children:(0,y.jsx)(`boxGeometry`,{args:[2.6,1.6,2.6]})}),(0,y.jsx)(`mesh`,{material:h(`#a0704a`),position:[0,3.1,0],children:(0,y.jsx)(`cylinderGeometry`,{args:[1.5,1.5,3,12]})}),(0,y.jsx)(`mesh`,{material:h(`#6b4a33`),position:[0,5.3,0],children:(0,y.jsx)(`coneGeometry`,{args:[1.8,1.4,12]})})]})})]})}export{E as default};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{s as t,t as n}from"./jsx-runtime-CXW0f58S.js";import{Bt as r,f as i,gt as a}from"./bloomMarks-DRhDp19k.js";import{i as o,r as s}from"./Office-9Mank16i.js";import{a as c}from"./director-CrzFgnoP.js";import{i as l,n as u,o as d,r as f}from"./kit-n-eqZ1AT.js";var p=e(t(),1),m=n(),h=14,g=new r(0,1,0);function _({run:e,elevation:t}){let n=(0,p.useRef)(null),_=d(e.side),v=(0,p.useMemo)(()=>({meteors:Array.from({length:h},()=>({born:-10,life:0,x:0,y:0,z:0,dir:new r,speed:0,size:1})),next:1,rnd:c(e.seed),q:new a,back:new r}),[e.seed]);return i(()=>{let r=e.t,i=v.rnd;for(;r>=v.next&&r<e.seconds-3;){let n=v.meteors.find(e=>r-e.born>e.life),a=.9+2.2*Math.exp(-(((r/e.seconds-.55)/.12)**2));if(v.next+=-Math.log(1-i()*.98)/a*1.4,n&&(n.born=r,n.life=.7+i()*.8,n.x=_*(180+i()*140),n.y=u(t)+50+i()*120,n.z=(i()-.5)*420,n.dir.set(-_*i()*.3,-.35-i()*.35,i()<.5?1:-1).normalize(),n.speed=110+i()*80,n.size=.6+i()*.8,i()<.3)){let i=s(n.x,n.y-t,n.z,200);o(`whoosh`,{gain:i.gain*l(r,e.seconds,4),pan:i.pan})}}let a=n.current?.children;if(a)for(let e=0;e<h;e++){let t=v.meteors[e],n=a[e],i=r-t.born;if(n.visible=i>=0&&i<t.life,!n.visible)continue;let o=i/t.life,s=Math.min(i*t.speed,30+t.size*10)*(1-o*.5),c=t.x+t.dir.x*t.speed*i,l=t.y+t.dir.y*t.speed*i,u=t.z+t.dir.z*t.speed*i;n.position.set(c-t.dir.x*s/2,l-t.dir.y*s/2,u-t.dir.z*s/2),n.quaternion.copy(v.q.setFromUnitVectors(g,v.back.copy(t.dir).negate()));let d=t.size*(1-o*o);n.scale.set(d,Math.max(.01,s),d)}}),(0,m.jsx)(`group`,{ref:n,children:Array.from({length:h},(e,t)=>(0,m.jsx)(`mesh`,{material:f(`#dfe9ff`,{opacity:.85,add:!0}),visible:!1,frustumCulled:!1,children:(0,m.jsx)(`coneGeometry`,{args:[.9,1,6,1,!0]})},t))})}export{_ as default};
@@ -0,0 +1 @@
1
+ import{n as e,r as t}from"./rolldown-runtime-XKyaHtl9.js";import{s as n,t as r}from"./jsx-runtime-CXW0f58S.js";import{Xo as i,Yo as a,Zo as o,es as s,hs as c,p as l}from"./store-CXLtXw8e.js";import{c as u,l as d,o as f,s as p}from"./index-CDJgPTOC.js";var m=t(n(),1),h=r();function g(){let e=l(e=>e.usage.observations),t=l(e=>e.agents),n=l(e=>e.settings.language),r=p(),i=e=>e===null?r(`Not available`):e.toLocaleString(n,{maximumFractionDigits:6});return(0,h.jsxs)(`details`,{children:[(0,h.jsx)(`summary`,{children:(0,h.jsx)(f,{children:`Observed AI usage`})}),(0,h.jsx)(`p`,{className:`muted small`,children:(0,h.jsx)(f,{children:`Latest 200 observations. Status rows are cumulative session counters, not additional consumption. Reported costs are not subscription charges or remaining quota.`})}),e?.length?[...e].reverse().map(e=>(0,h.jsxs)(`div`,{className:`card`,style:{overflowWrap:`anywhere`},children:[(0,h.jsxs)(`b`,{children:[e.agentId?t[e.agentId]?.name??e.agentId:`—`,` · `,e.tool]}),(0,h.jsxs)(`div`,{children:[e.provider??r(`Not available`),` / `,e.model??r(`Not available`)]}),(0,h.jsxs)(`div`,{className:`small`,children:[(0,h.jsx)(f,{children:`Input tokens`}),`: `,i(e.input),` · `,(0,h.jsx)(f,{children:`Output tokens`}),`: `,i(e.output)]}),(0,h.jsxs)(`div`,{className:`small`,children:[(0,h.jsx)(f,{children:`Reasoning tokens`}),`: `,i(e.reasoning),` · `,(0,h.jsx)(f,{children:`Cache read / write`}),`: `,i(e.cacheRead),` / `,i(e.cacheWrite)]}),(0,h.jsxs)(`div`,{className:`small`,children:[(0,h.jsx)(f,{children:`Reported cost (USD)`}),`: `,i(e.costUsd),` · `,(0,h.jsx)(f,{children:`Remaining quota`}),`: `,(0,h.jsx)(f,{children:`Not available`})]}),(0,h.jsxs)(`div`,{className:`muted small`,children:[new Date(e.at).toLocaleString(n),` · `,e.source]}),(0,h.jsxs)(`div`,{className:`muted small`,children:[(0,h.jsx)(f,{children:`Last observation`}),`: `,e.observedAt?new Date(e.observedAt).toLocaleString(n):r(`Not available`)]})]},JSON.stringify([e.tool,e.sessionId,e.id]))):(0,h.jsx)(`p`,{className:`muted small`,children:(0,h.jsx)(f,{children:`No usage observations received yet.`})})]})}function _({resume:e}){let t=l(e=>e.usage.resources);return(0,h.jsx)(`div`,{children:t?.map(t=>(0,h.jsx)(v,{resource:t,resume:e},t.key))})}function v({resource:e,resume:t}){let n=p(),r=l(e=>e.agents),i=l(e=>e.settings.language),o=l(e=>e.demo),[s,c]=(0,m.useState)(e.group??``),[g,_]=(0,m.useState)(!1),v={idle:`Idle`,preparing:`Setting up`,working:`Working`,done:`Finished`,error:`Needs help`,stopped:`Stopped`},y=e=>e===null?n(`Not available`):new Date(e).toLocaleString(i),b=async()=>{if(await d({icon:`🔗`,tone:`warn`,title:n(`Confirm shared quota`),body:(0,h.jsx)(`p`,{children:(0,h.jsx)(f,{children:`Use the same label only when these connections share a quota. This does not change provider, model or billing mode.`})}),confirm:n(`Confirm shared quota`)})){_(!0);try{await u.setUsageGroup(e.key,s)}catch{}finally{_(!1)}}};return(0,h.jsxs)(`section`,{className:`card`,style:{overflowWrap:`anywhere`,minWidth:0},"aria-label":`${e.tool} ${e.provider??``}`,children:[(0,h.jsxs)(`div`,{className:`row wrap`,children:[(0,h.jsxs)(`b`,{children:[e.tool,` · `,e.provider??n(`Provider not reported`)]}),(0,h.jsx)(`span`,{className:`pill`,children:n(e.state===`paused`?`Paused`:e.state===`pacing`?`Pacing`:`No active limit signal`)})]}),(0,h.jsxs)(`div`,{children:[e.model??n(`Model not reported`),` · `,n(e.access===`api`?`API`:e.access===`subscription`?`Subscription`:`Access mode not reported`)]}),e.group&&(0,h.jsxs)(`div`,{className:`small`,children:[(0,h.jsx)(f,{children:`Shared quota`}),`: `,e.group]}),(0,h.jsx)(`div`,{className:`muted small`,children:(0,h.jsx)(f,{children:e.observedAt===null?`Configured selection; awaiting session telemetry`:`Observed connection`})}),(0,h.jsxs)(`div`,{className:`small`,children:[(0,h.jsx)(f,{children:`Running sessions`}),`: `,e.running,` · `,(0,h.jsx)(f,{children:`Last observation`}),`: `,y(e.observedAt)]}),(0,h.jsxs)(`div`,{className:`small`,children:[(0,h.jsx)(f,{children:`Last quota signal`}),`: `,y(e.warning?.at??null),` · `,(0,h.jsx)(f,{children:`Reported reset`}),`: `,y(e.warning?.resetsAt??null)]}),e.until!==null&&(0,h.jsxs)(`div`,{className:`small`,children:[(0,h.jsx)(f,{children:`Next scheduling check`}),`: `,y(e.until)]}),e.warning?.pct==null?(0,h.jsxs)(`div`,{className:`muted small`,children:[(0,h.jsx)(f,{children:`Remaining quota`}),`: `,(0,h.jsx)(f,{children:`Not available`})]}):(0,h.jsxs)(`div`,{children:[(0,h.jsx)(f,{children:`Reported usage`}),`: `,e.warning.pct,`% `,(0,h.jsx)(`meter`,{min:0,max:100,value:e.warning.pct,"aria-label":n(`Reported usage`)})]}),(0,h.jsx)(`ul`,{children:e.agentIds.map(e=>{let t=r[e];return(0,h.jsxs)(`li`,{children:[t?.name??e,` · `,t?.role===`ceo`?`CEO`:t?.repoId||`—`,` · `,t?n(v[t.status]??t.status):`—`,t?.startedAt?` · ${a((t.endedAt??Date.now())-t.startedAt)}`:``]},e)})}),(0,h.jsxs)(`div`,{className:`row wrap`,children:[(0,h.jsx)(`button`,{className:`btn btn-small`,disabled:e.state!==`pacing`,onClick:()=>t(e.key),children:(0,h.jsx)(f,{children:`Resume this quota`})}),o&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`button`,{className:`btn btn-small`,onClick:()=>void u.simulateUsage(`warning`,e.agentIds[0]).catch(()=>void 0),children:(0,h.jsx)(f,{children:`Simulate a usage warning`})}),(0,h.jsx)(`button`,{className:`btn btn-small`,onClick:()=>void u.simulateUsage(`limit`,e.agentIds[0]).catch(()=>void 0),children:(0,h.jsx)(f,{children:`Simulate reaching the limit`})})]})]}),(0,h.jsxs)(`details`,{children:[(0,h.jsx)(`summary`,{children:(0,h.jsx)(f,{children:`Quota association`})}),(0,h.jsx)(`p`,{className:`muted small`,children:(0,h.jsx)(f,{children:`Without an identified account or confirmed association, limits stay isolated. OAuth alone does not identify a subscription.`})}),(0,h.jsxs)(`label`,{children:[(0,h.jsx)(f,{children:`Confirmed shared quota label`}),(0,h.jsx)(`input`,{value:s,onChange:e=>c(e.target.value),maxLength:64,style:{width:`100%`,boxSizing:`border-box`}})]}),(0,h.jsx)(`button`,{className:`btn btn-small`,disabled:g||s===(e.group??``),onClick:()=>void b(),children:(0,h.jsx)(f,{children:`Save quota association`})})]})]})}function y(e,t,n){if(n!==`it`)return e.text;let r=e.kind===`pr`&&e.prNumber!==null?`PR #${e.prNumber} needs you`:e.kind===`agent`&&t?`${t} is stuck on an error`:null;return!r||!(e.text===r||e.text.startsWith(r+`: `))?e.text:(e.kind===`pr`?c(n,`PR #{number} needs you`,{number:e.prNumber}):c(n,`{name} is stuck on an error`,{name:t}))+e.text.slice(r.length)}function b(e,t,n,r){if(!e.startsWith(t)||!e.endsWith(n))return null;let i=/^(\d+) (minute|minutes|hours)$/.exec(e.slice(t.length,-n.length));return i?c(r,`{count} ${i[2]}`,{count:i[1]}):null}function x(e,t,n){if(n!==`it`)return e.text;let r=t??`Someone`,i={name:t??c(n,`Someone`),task:e.prNumber===null?`#${e.issueNumber}`:`PR #${e.prNumber}`,issue:e.issueNumber??`?`,pr:e.prNumber??`?`},a=(e,t={})=>c(n,e,{...i,...t});if(e.kind===`quiet`){let t=b(e.text,`${r} has been quiet for `,` on ${i.task}, even after a nudge. Stop them, or put the work back in line?`,n);if(t)return a(`{name} has been quiet for {duration} on {task}, even after a nudge. Stop them, or put the work back in line?`,{duration:t})}else if(e.kind===`preparing`){let t=b(e.text,`${r} has been setting up a desk for ${i.task} for `,`. Put the work back in line?`,n);if(t)return a(`{name} has been setting up a desk for {task} for {duration}. Put the work back in line?`,{duration:t})}else if(e.kind===`stale`){if(e.text===`${r}'s last task ${i.task} is already merged. Clear the desk?`)return a(`{name}’s last task {task} is already merged. Clear the desk?`);if(e.text===`${r}'s last task ${i.task} is already closed. Clear the desk?`)return a(`{name}’s last task {task} is already closed. Clear the desk?`)}else if(e.kind===`qa-orphan`){if(e.text===`PR #${e.prNumber} is marked as in QA, but nobody is testing it. Test it again?`)return a(`PR #{pr} is marked as in QA, but nobody is testing it. Test it again?`)}else if(e.kind===`fix-orphan`){if(e.text===`PR #${e.prNumber} is waiting for a fix, but ${e.agentId?`${r} is on something else`:`nobody is on it`}. Hand it to a free agent?`)return a(e.agentId?`PR #{pr} is waiting for a fix, but {name} is on something else. Hand it to a free agent?`:`PR #{pr} is waiting for a fix, but nobody is on it. Hand it to a free agent?`)}else if(e.kind===`unclosed`){let t=b(e.text,`Issue #${e.issueNumber} is still open, but PR #${e.prNumber}, which closes it, was merged `,` ago. Close it?`,n);if(t)return a(`Issue #{issue} is still open, but PR #{pr}, which closes it, was merged {duration} ago. Close it?`,{duration:t})}return e.text}var S=e({UsageCard:()=>T});async function C(e){try{return await e()}catch{return}}async function w(e){let{usage:t,settings:n}=l.getState(),r=(e,t)=>c(n.language,e,t),i=t.resources?.filter(e=>e.state===`pacing`)??[],a=e?i.find(t=>t.key===e):i.length===1?i[0]:void 0;a?(document.pointerLockElement&&document.exitPointerLock(),await d({icon:`⏩`,tone:`warn`,title:r(`Resume full speed?`),body:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(`p`,{children:[a.tool,` · `,a.provider??r(`Provider not reported`),` · `,a.group??a.model]}),(0,h.jsx)(`p`,{children:r(`Resume only this quota. Hard limits cannot be cleared early; other quotas are unchanged.`)})]}),confirm:r(`Resume full speed`)})&&await C(()=>u.resumeFullSpeed(a.key))):l.getState().openOverlay({kind:`manager`,tab:`ops`,card:`usage`})}function T({hot:e}){let t=l(e=>e.settings.language),n=l(e=>e.usage),r=s(n,Date.now(),t);return(0,h.jsxs)(`div`,{id:`ops-card-usage`,className:`card usage-card usage-${r.tone} ${e?`ops-card-hot`:``}`,children:[(0,h.jsxs)(`div`,{className:`row wrap`,children:[(0,h.jsx)(`b`,{children:(0,h.jsx)(f,{children:`🤖 AI usage`})}),(0,h.jsx)(`span`,{className:`pill usage-pill-${r.tone}`,children:r.state})]}),(0,h.jsx)(`p`,{className:`muted small`,children:(0,h.jsx)(f,{children:`Limits apply only to the affected quota. Warnings pace new issues; hard limits also hold QA, fixes and CEO jobs. Running sessions continue. Missing data does not mean unlimited usage.`})}),(0,h.jsx)(_,{resume:e=>void w(e)}),(0,h.jsx)(g,{})]})}function E({alarm:e,repo:t,hot:n}){let r=p(),i=l(e=>e.settings.language),a=l(t=>e.agentId?t.agents[e.agentId]?.name:void 0),o=l(e=>e.openOverlay),s=l(e=>e.goToFloor),c=e.prNumber===null?void 0:t?.pulls.find(t=>t.number===e.prNumber);return(0,h.jsxs)(`div`,{id:`ops-card-${e.id}`,className:`card floor-card alarm-card ${n?`ops-card-hot`:``}`,style:{"--accent":t?.color??`#ef476f`},children:[(0,h.jsxs)(`div`,{className:`row`,children:[(0,h.jsx)(`span`,{className:`floor-badge`,children:e.floor}),(0,h.jsxs)(`div`,{className:`grow`,children:[(0,h.jsxs)(`b`,{children:[`🚨 `,y(e,a,i)]}),(0,h.jsxs)(`div`,{className:`muted small`,children:[t?.fullName??e.repoId,c?` · ${c.title}`:``,` · `,r(`since {time}`,{time:new Date(e.since).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})})]})]})]}),(0,h.jsxs)(`div`,{className:`row wrap`,children:[e.kind===`pr`&&e.prNumber!==null?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`button`,{className:`btn btn-small`,onClick:()=>o({kind:`kanban`,repoId:e.repoId}),children:(0,h.jsx)(f,{children:`📋 Open the Kanban`})}),(0,h.jsx)(`button`,{className:`btn btn-small btn-good`,onClick:()=>void C(()=>u.sendToQa(e.repoId,e.prNumber)),children:(0,h.jsx)(f,{children:`Retry QA`})}),(0,h.jsx)(`button`,{className:`btn btn-small`,title:r(`Hand it to its author, or any free agent, with QA’s findings`),onClick:()=>void C(()=>u.sendBack(e.repoId,e.prNumber)),children:(0,h.jsx)(f,{children:`Send back for a fix`})}),c&&(0,h.jsx)(`a`,{className:`small`,href:c.url,target:`_blank`,rel:`noreferrer`,children:(0,h.jsx)(f,{children:`PR on GitHub ↗`})})]}):e.agentId&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`button`,{className:`btn btn-small`,onClick:()=>o({kind:`terminal`,agentId:e.agentId}),children:(0,h.jsx)(f,{children:`Terminal`})}),(0,h.jsx)(`button`,{className:`btn btn-small btn-good`,title:r(`Clear their desk so they take new work`),onClick:()=>void C(()=>u.reset(e.agentId)),children:(0,h.jsx)(f,{children:`Clear desk`})})]}),(0,h.jsx)(`span`,{className:`spacer`}),(0,h.jsx)(`button`,{className:`btn btn-small btn-ghost`,onClick:()=>s(e.floor),children:r(`Visit floor {floor}`,{floor:e.floor})})]})]})}var D={clear:[`↺ Clear desk`,`Clear their desk so they take new work`],stop:[`■ Stop`,`Stop their session`],requeue:[`↩ Requeue`,`Stop them and put the work back in line, without a strike`],"retry-qa":[`Retry QA`,`Queue the PR for a fresh QA run`],"send-back":[`Send back for a fix`,`Hand the PR to its author, or any free agent`],"close-issue":[`Close issue`,`Close the issue on GitHub as completed`]};async function O(e,t){let n=(e,t)=>c(l.getState().settings.language,e,t);t===`close-issue`&&(document.pointerLockElement&&document.exitPointerLock(),!await d({icon:`🩺`,tone:`warn`,title:n(`Close issue #{number}?`,{number:e.issueNumber??`?`}),body:(0,h.jsx)(`p`,{children:n(`It’s closed on GitHub as completed, with a comment saying PR #{number} resolved it.`,{number:e.prNumber??`?`})}),confirm:n(`Close issue`)}))||await C(()=>u.doctorFix(e.id,t))}function k({finding:e,repo:t}){let n=p(),r=l(e=>e.settings.language),i=l(t=>e.agentId?t.agents[e.agentId]?.name:void 0),a=l(e=>e.openOverlay);return(0,h.jsxs)(`div`,{id:`ops-card-doctor-${e.id}`,className:`card floor-card alarm-card doctor-card`,style:{"--accent":t?.color??`#7c6cf0`},children:[(0,h.jsxs)(`div`,{className:`row`,children:[(0,h.jsx)(`span`,{className:`floor-badge`,children:t?.floor??`?`}),(0,h.jsxs)(`div`,{className:`grow`,children:[(0,h.jsxs)(`b`,{children:[`🩺 `,x(e,i,r)]}),(0,h.jsxs)(`div`,{className:`muted small`,children:[t?.fullName??e.repoId,` · `,n(`since {time}`,{time:new Date(e.since).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})})]})]})]}),(0,h.jsxs)(`div`,{className:`row wrap`,children:[e.fixes.map((t,r)=>(0,h.jsx)(`button`,{className:`btn btn-small ${r===0?`btn-good`:``}`,title:n(D[t][1]),onClick:()=>void O(e,t),children:n(D[t][0])},t)),e.agentId&&(0,h.jsx)(`button`,{className:`btn btn-small`,onClick:()=>a({kind:`terminal`,agentId:e.agentId}),children:(0,h.jsx)(f,{children:`Terminal`})}),(0,h.jsx)(`span`,{className:`spacer`}),(0,h.jsx)(`button`,{className:`btn btn-small btn-ghost`,title:n(`Hide it until it goes away`),onClick:()=>void C(()=>u.doctorIgnore(e.id)),children:(0,h.jsx)(f,{children:`Ignore`})})]})]})}async function A(e){let t=await C(()=>u.demoDoctor(e));t&&l.getState().pushToast(`info`,t.text)}function j({hot:e}){let t=p(),n=l(e=>e.doctor),r=l(e=>e.repos),i=l(e=>e.demo);return(0,h.jsxs)(`div`,{id:`ops-card-doctor`,className:e?`ops-card-hot`:``,children:[(0,h.jsxs)(`h3`,{className:`section`,children:[(0,h.jsx)(f,{children:`🩺 Office doctor`}),` `,n.length>0&&(0,h.jsx)(`span`,{className:`badge`,children:n.length})]}),n.length===0&&(0,h.jsx)(`p`,{className:`muted small`,children:(0,h.jsx)(f,{children:`Nothing stuck. Every minute the watchdog nudges quiet sessions, frees stuck desks and puts orphaned work back in line by itself; what it can’t safely fix shows up here.`})}),n.map(e=>(0,h.jsx)(k,{finding:e,repo:r.find(t=>t.id===e.repoId)},e.id)),i&&(0,h.jsxs)(`div`,{className:`row wrap`,children:[(0,h.jsx)(`span`,{className:`muted small`,children:`Demo:`}),(0,h.jsx)(`button`,{className:`btn btn-small btn-ghost`,title:t(`Restart with desks gone and work finished on GitHub meanwhile`),onClick:()=>void A(`restart`),children:(0,h.jsx)(f,{children:`Simulate a restart`})}),(0,h.jsx)(`button`,{className:`btn btn-small btn-ghost`,title:t(`Someone’s session goes quiet for 20 minutes`),onClick:()=>void A(`stuck`),children:(0,h.jsx)(f,{children:`Make a session stuck`})}),(0,h.jsx)(`button`,{className:`btn btn-small btn-ghost`,title:t(`Ten more minutes pass for the stuck sessions`),onClick:()=>void A(`later`),children:(0,h.jsx)(f,{children:`10 minutes later`})}),(0,h.jsx)(`button`,{className:`btn btn-small btn-ghost`,title:t(`A merged PR whose issue was never closed`),onClick:()=>void A(`unclosed`),children:(0,h.jsx)(f,{children:`Leave an issue open`})})]})]})}var M=[[`Ready to start`,e=>String(e.ready),`Backlog issues that can start now`],[`Building`,e=>String(e.building)],[`In QA`,e=>String(e.inQa)],[`Fixing`,e=>String(e.fixing),`Back with an agent: QA findings, checks or a conflict`],[`To merge`,e=>String(e.toMerge)],[`Needs you`,e=>`${e.needsYou}${e.triage?` (+${e.triage} 🧭)`:``}`,`🧭: the CEO is looking first`],[`Merged today`,(e,t)=>t(`{count} ({hour} last hour)`,{count:e.mergedToday,hour:e.mergedHour})],[`Lead time`,e=>a(e.leadMs),`Median issue → merge over the last 24 hours`],[`QA wait`,e=>a(e.qaWaitMs),`Median wait for a free agent over the last 24 hours`],[`CI`,e=>e.ciRuns?`${i(e.ciPass)} · ${a(e.ciMs)}`:`—`,`GitHub’s checks over 7 days: pass rate · median time`],[`Team`,(e,t)=>t(`{busy} busy · {idle} idle`,{busy:e.busy,idle:e.idle})+(e.errors?t(` · errors: {count}`,{count:e.errors}):``)],[`Cost today`,e=>`~${o(e.costToday)}`,`An estimate from finished sessions’ reported cost`]];function N(){let e=p(),t=l(e=>e.ops),n=l(e=>e.repos),r=[...t.floors.map(e=>{let t=n.find(t=>t.id===e.repoId);return[`${e.floor} · ${t?.fullName.split(`/`)[1]??e.repoId}`,t?.color??`#ccc`,e]}),[e(`All floors`),`#1f1d2b`,t.total]];return(0,h.jsxs)(`div`,{className:`ops-table-wrap`,children:[(0,h.jsxs)(`table`,{className:`ops-table`,children:[(0,h.jsx)(`thead`,{children:(0,h.jsxs)(`tr`,{children:[(0,h.jsx)(`th`,{}),r.map(([e,t])=>(0,h.jsx)(`th`,{style:{"--accent":t},className:`ops-col`,children:e},e))]})}),(0,h.jsx)(`tbody`,{children:M.map(([t,n,i])=>(0,h.jsxs)(`tr`,{children:[(0,h.jsx)(`th`,{title:i?e(i):void 0,children:e(t)}),r.map(([t,,r])=>(0,h.jsx)(`td`,{children:n(r,e)},t))]},t))})]}),t.ceoCostToday>0&&(0,h.jsx)(`div`,{className:`muted small`,children:e(`The CEO’s sessions today: ~{cost} (in All floors’ cost).`,{cost:o(t.ceoCostToday)})})]})}function P({card:e}){let t=l(e=>e.ops.alarms),n=l(e=>e.repos);return(0,m.useEffect)(()=>{e&&document.getElementById(`ops-card-${e}`)?.scrollIntoView({block:`center`})},[e]),(0,h.jsxs)(`div`,{className:`tab-grid`,children:[(0,h.jsxs)(`div`,{children:[(0,h.jsx)(T,{hot:e===`usage`}),(0,h.jsxs)(`h3`,{className:`section`,children:[(0,h.jsx)(f,{children:`🚨 Needs you`}),` `,t.length>0&&(0,h.jsx)(`span`,{className:`badge`,children:t.length})]}),t.length===0&&(0,h.jsx)(`p`,{className:`muted small`,children:(0,h.jsx)(f,{children:`All clear. The beacon on the lobby’s mission control wall spins when a PR needs you or an agent has been stuck on an error for 10 minutes.`})}),t.map(t=>(0,h.jsx)(E,{alarm:t,repo:n.find(e=>e.id===t.repoId),hot:t.id===e},t.id)),(0,h.jsx)(j,{hot:e===`doctor`})]}),(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`h3`,{className:`section`,children:(0,h.jsx)(f,{children:`🛰️ The numbers`})}),(0,h.jsx)(N,{})]})]})}export{P as n,w as r,S as t};