droidsembly 0.4.0-beta.1 → 0.4.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.it.md +193 -184
- package/README.md +193 -184
- package/bin/distribution.d.ts +3 -3
- package/bin/distribution.js +48 -48
- package/dist/THIRD_PARTY_LICENSES.txt +240 -240
- package/dist/assets/AccessibilitySettings-BE7rmk0y.js +30 -0
- package/dist/assets/AppViewer-BINNxHVf.js +5 -0
- package/dist/assets/Balloon-jPkIBPvT.js +1 -0
- package/dist/assets/{Batched-BOgjreKO.js → Batched-DL3cFl-z.js} +1 -1
- package/dist/assets/Birds-9cXj_YEG.js +1 -0
- package/dist/assets/Blimp-Ci1lo_c7.js +1 -0
- package/dist/assets/{BufferGeometryUtils-BsmWvcA2.js → BufferGeometryUtils-Dk96On2P.js} +1 -1
- package/dist/assets/Duck-BMxCVlmW.js +1 -0
- package/dist/assets/{Effects-CNyhhFkE.js → Effects-Crrr3ggK.js} +2 -2
- package/dist/assets/{Fireworks-CJfDJOeb.js → Fireworks-ddjyPNX6.js} +2 -2
- package/dist/assets/Helicopter-CX-86eGa.js +1 -0
- package/dist/assets/{Hurricane-9WqZGyZg.js → Hurricane-CLANwn_b.js} +2 -2
- package/dist/assets/Kaiju-BCMy-uRo.js +1 -0
- package/dist/assets/Meteors-CiJzDtSj.js +1 -0
- package/dist/assets/MissionConsole-CJb-BlEJ.js +1 -0
- package/dist/assets/Office-bAhOa_1d.js +563 -0
- package/dist/assets/PhotoPanel-Bj8-zSMr.js +1 -0
- package/dist/assets/PhotoScene-Da13U_uP.js +115 -0
- package/dist/assets/Plane-DcyLXU5f.js +1 -0
- package/dist/assets/Pocket-C3fEmnP6.js +2 -0
- package/dist/assets/{Rainbow-CdcWsmW8.js → Rainbow-CiwNa4iX.js} +2 -2
- package/dist/assets/Roof-DDYcam5j.js +34 -0
- package/dist/assets/{Shell-BmnZn4UL.js → Shell-CjHm9J8I.js} +2 -2
- package/dist/assets/Skywriting-BD1rTdRn.js +1 -0
- package/dist/assets/TerminalView-nREejrGe.js +17 -0
- package/dist/assets/ToyWorld-NbwEfz8w.js +1 -0
- package/dist/assets/Ufo-DlOMBNSX.js +1 -0
- package/dist/assets/Whale-BpAZmX5F.js +1 -0
- package/dist/assets/all-D96CQm6h.js +11 -0
- package/dist/assets/bloomMarks-DO_1Aa_j.js +4231 -0
- package/dist/assets/cheerRules-DNkiE7MG.js +1 -0
- package/dist/assets/{cityLayout-7ckfe3wf.js → cityLayout-BwjgCIoW.js} +1 -1
- package/dist/assets/{dogState-DiOvoobI.js → dogState-_4V3U3Ki.js} +1 -1
- package/dist/assets/{doors-BHKj8tkO.js → doors-BLqiDSGY.js} +1 -1
- package/dist/assets/{gallery-ColCPQQE.js → gallery-CVQaqgJI.js} +1 -1
- package/dist/assets/gate-B1SWzR3V.js +2 -0
- package/dist/assets/index-BSf1g_FE.js +10 -0
- package/dist/assets/{instantReplay-DGiLgvkQ.js → instantReplay-Cuo_dJ0Q.js} +1 -1
- package/dist/assets/interact-2xHzPlZG.js +1 -0
- package/dist/assets/jsx-runtime-CXW0f58S.js +1 -0
- package/dist/assets/jukeboxSongs-CUwHJ1cS.js +1 -0
- package/dist/assets/{kit-C6ByUQ-Y.js → kit-Cx-l6IRN.js} +1 -1
- package/dist/assets/mic-ChYpSk7U.js +1 -0
- package/dist/assets/photoMode-7LqNRqz9.js +1 -0
- package/dist/assets/{pipeline-BOTOZ69L.js → pipeline-DWfp7bcu.js} +1 -1
- package/dist/assets/rapier-D3erQ37Q.js +1 -0
- package/dist/assets/rig-CXpaDXip.js +1 -0
- package/dist/assets/rolldown-runtime-XKyaHtl9.js +1 -0
- package/dist/assets/{speechLanguage-BtfdhZNI.js → speechLanguage-CsSMLLpg.js} +1 -1
- package/dist/assets/{store-FA83kfnc.js → store-CWHb7890.js} +4 -4
- package/dist/assets/useDayTime-DQo6X8vh.js +1 -0
- package/dist/assets/{useGraphics-Cif18p7Q.js → useGraphics-B19_wbNT.js} +1 -1
- package/dist/assets/voiceMessages-BNuAZiGC.js +1 -0
- package/dist/assets/weatherState-BmCM8XlW.js +1 -0
- package/dist/icons/Sora-OFL.txt +93 -93
- package/dist/icons/badge.svg +1 -1
- package/dist/icons/droid-antenna.svg +29 -29
- package/dist/icons/droid-eyes.svg +29 -29
- package/dist/icons/droid-shell.svg +29 -29
- package/dist/icons/droid-spark.svg +29 -29
- package/dist/icons/droid-wire.svg +29 -29
- package/dist/icons/favicon.svg +1 -1
- package/dist/icons/icon.svg +29 -29
- package/dist/icons/logo-dark.svg +29 -29
- package/dist/icons/logo-light.svg +29 -29
- package/dist/index.html +26 -25
- package/dist/manifest.webmanifest +19 -19
- package/dist/third-party-licenses.json +3 -3
- package/dist-server/browser-init.js +24 -24
- package/dist-server/index.js +98 -34
- package/dist-server/index.js.map +4 -4
- package/dist-server/ptyHost.js.map +1 -1
- package/package.json +98 -98
- package/dist/assets/AccessibilitySettings-DSmFk9JC.js +0 -30
- package/dist/assets/AppViewer-alNn4TBB.js +0 -5
- package/dist/assets/Balloon-UTs7npGo.js +0 -1
- package/dist/assets/Birds-BA2HM-AD.js +0 -1
- package/dist/assets/Blimp-CTykuz6B.js +0 -1
- package/dist/assets/Duck-DH63jUrP.js +0 -1
- package/dist/assets/Helicopter-CW_SP7xP.js +0 -1
- package/dist/assets/Kaiju-SpSi_jBg.js +0 -1
- package/dist/assets/Meteors-DvjhLfbF.js +0 -1
- package/dist/assets/MissionConsole-BEP5CdC8.js +0 -1
- package/dist/assets/Office-BBnd6tyn.js +0 -563
- package/dist/assets/PhotoPanel-DehErnsv.js +0 -1
- package/dist/assets/PhotoScene-Ce-dzToM.js +0 -115
- package/dist/assets/Plane-0nfvzL_c.js +0 -1
- package/dist/assets/Pocket-CBoyL0ra.js +0 -2
- package/dist/assets/Roof-mkMKniSZ.js +0 -34
- package/dist/assets/Skywriting-06dZPAfg.js +0 -1
- package/dist/assets/TerminalView-wlhSixSH.js +0 -17
- package/dist/assets/ToyWorld-Cuu9aW-K.js +0 -1
- package/dist/assets/Ufo-iHaoe5t1.js +0 -1
- package/dist/assets/Whale-DZg88zIX.js +0 -1
- package/dist/assets/all-CYErCTCA.js +0 -11
- package/dist/assets/bloomMarks-DariC6lY.js +0 -4231
- package/dist/assets/cheerRules-CZGSrxOB.js +0 -1
- package/dist/assets/gate-BplJKcLG.js +0 -2
- package/dist/assets/index-B6qvKFYN.js +0 -10
- package/dist/assets/interact-0qw7BGhL.js +0 -1
- package/dist/assets/jsx-runtime-BFUkm7bt.js +0 -1
- package/dist/assets/jukeboxSongs-CjbAzAeb.js +0 -1
- package/dist/assets/mic-B316hcCe.js +0 -1
- package/dist/assets/photoMode-CYxQfgUF.js +0 -1
- package/dist/assets/rapier-CXAOW8OC.js +0 -1
- package/dist/assets/rig-wAyl3G1G.js +0 -1
- package/dist/assets/useDayTime-0XsqM14Q.js +0 -1
- package/dist/assets/voiceMessages-DtNmUazr.js +0 -1
- package/dist/assets/weatherState-ExG1doW-.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as e,t,u as n}from"./jsx-runtime-BFUkm7bt.js";import{en as r,l as i,p as a}from"./store-FA83kfnc.js";import{o,s}from"./index-B6qvKFYN.js";import{c,u as l}from"./gate-BplJKcLG.js";import{M as u,j as d}from"./AccessibilitySettings-DSmFk9JC.js";import{s as f}from"./useDayTime-0XsqM14Q.js";import{a as p,c as m,d as h,i as g,o as _,r as v,u as y}from"./gallery-ColCPQQE.js";import{CLIP_SECONDS as b,GOLDEN_HOUR as x,cam as S,d as C,focusCenter as w,leave as T,n as E,overlayOptions as D,requestFrame as O,setDaytime as k,setFrozen as A,t as j,takeShot as M,toggleRecording as N,u as P,update as F,usePhoto as I}from"./photoMode-CYxQfgUF.js";var L=n(e(),1),R=t();function z(){let e=(0,L.useRef)(null),t=I(),n=a(e=>e.floor),[r,i]=(0,L.useState)({w:window.innerWidth,h:window.innerHeight});return(0,L.useEffect)(()=>{let e=()=>i({w:window.innerWidth,h:window.innerHeight});return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),(0,L.useEffect)(()=>{let t=e.current;if(!t)return;let n=window.devicePixelRatio||1;t.width=Math.round(r.w*n),t.height=Math.round(r.h*n);let i=t.getContext(`2d`);i&&(i.clearRect(0,0,t.width,t.height),j(i,t.width,t.height,D(!0)))},[t.filter,t.stamp,t.caption,t.guides,r,n]),(0,R.jsx)(`canvas`,{ref:e,className:`photo-preview`,"aria-hidden":`true`})}function B(){let e=I(e=>e.recording),[,t]=(0,L.useState)(0);if((0,L.useEffect)(()=>{if(!e)return;let n=setInterval(()=>t(e=>e+1),250);return()=>clearInterval(n)},[e]),!e)return null;let n=Math.min(e.limit,(performance.now()-e.started)/1e3),r=e=>`${Math.floor(e/60)}:${String(Math.floor(e%60)).padStart(2,`0`)}`;return(0,R.jsxs)(`div`,{className:`photo-rec`,role:`status`,children:[(0,R.jsx)(`span`,{className:`photo-rec-dot`}),` REC `,r(n),` / `,r(e.limit),(0,R.jsxs)(`button`,{className:`btn btn-small`,onClick:()=>void N(),children:[(0,R.jsx)(o,{children:`■ Stop`}),` `,(0,R.jsx)(`kbd`,{children:`V`})]})]})}function V({item:e}){return e.kind===`shot`?(0,R.jsx)(`img`,{src:e.thumb??e.url,alt:``}):(0,R.jsx)(`video`,{src:e.url,muted:!0,preload:`metadata`})}function H(){let e=s(),t=p(e=>e.items),n=t.reduce((e,t)=>e+t.bytes,0);return(0,R.jsxs)(`section`,{className:`photo-section`,children:[(0,R.jsxs)(`h4`,{children:[(0,R.jsx)(o,{children:`Gallery`}),` `,(0,R.jsx)(`span`,{className:`muted small`,children:t.length?e(`{count} · {size} · this tab only`,{count:t.length,size:y(n)}):e(`empty`)})]}),t.length>0&&(0,R.jsx)(`ul`,{className:`photo-gallery`,children:[...t].reverse().map(t=>(0,R.jsxs)(`li`,{title:t.name,children:[(0,R.jsx)(V,{item:t}),(0,R.jsxs)(`div`,{className:`photo-gallery-meta`,children:[(0,R.jsx)(`span`,{children:t.kind===`shot`?`📸 ${t.width}×${t.height}`:`${t.kind===`replay`?`⏪`:`🎬`} ${Math.round(t.seconds??0)} s`}),(0,R.jsx)(`span`,{className:`muted`,children:y(t.bytes)})]}),(0,R.jsxs)(`div`,{className:`photo-gallery-actions`,children:[(0,R.jsx)(`button`,{className:`btn btn-ghost btn-small`,onClick:()=>g(t),"aria-label":e(`Download {name}`,{name:t.name}),children:`⬇`}),(0,R.jsx)(`button`,{className:`btn btn-ghost btn-small`,onClick:()=>v(t.id),"aria-label":e(`Delete {name}`,{name:t.name}),children:`🗑`})]})]},t.id))})]})}function U(){let[e,t]=(0,L.useState)({fov:S.fov,roll:S.roll});return(0,L.useEffect)(()=>{let e=setInterval(()=>t(e=>e.fov===S.fov&&e.roll===S.roll?e:{fov:S.fov,roll:S.roll}),150);return()=>clearInterval(e)},[]),e}function W(){let e=s(),t=I(),n=l(e=>e.frozen),p=l(e=>e.replay),g=a(e=>e.toasts),v=a(e=>e.dismissToast),y=a(e=>e.floor),D=a(e=>e.floor===0?null:i(e.repos,e.floor)),j=a(e=>e.agents),{fov:L,roll:V}=U(),W=Object.values(j).filter(e=>(D?e.repoId===D.id:e.role===`ceo`)&&r(e.id)),G=h(window.innerWidth,window.innerHeight,window.devicePixelRatio||1,t.scale),K=f().t,q=t.daytime??K;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(z,{}),(0,R.jsx)(B,{}),t.panel?(0,R.jsxs)(`aside`,{className:`photo-panel`,"aria-label":e(`Photo mode`),children:[(0,R.jsxs)(`header`,{className:`photo-head`,children:[(0,R.jsx)(`b`,{children:(0,R.jsx)(o,{children:`📷 Photo mode`})}),(0,R.jsxs)(`button`,{className:`btn btn-small`,onClick:T,title:e(`Back to the office (or Esc with the mouse free)`),children:[(0,R.jsx)(o,{children:`Leave`}),` `,(0,R.jsx)(d,{action:`photo`})]})]}),t.note&&(0,R.jsx)(`p`,{className:`photo-note ${t.note.level===`error`?`photo-note-bad`:``}`,role:`status`,onClick:()=>F({note:null}),children:t.note.message?t.note.message.map(t=>e(t.key,t.values)).join(``):t.note.text}),(0,R.jsxs)(`section`,{className:`photo-section`,children:[(0,R.jsxs)(`label`,{className:`toggle`,children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:n,onChange:e=>A(e.target.checked)}),` `,(0,R.jsx)(o,{children:`❄ Freeze the office`}),` `,(0,R.jsx)(`kbd`,{children:`F`})]}),(0,R.jsx)(`p`,{className:`muted small`,children:e(n?`Everyone holds still; the work carries on and catches up when you thaw.`:`Live: people, toys and the sky move. Good for clips.`)})]}),(0,R.jsxs)(`section`,{className:`photo-section`,children:[(0,R.jsx)(`h4`,{children:(0,R.jsx)(o,{children:`Camera`})}),(0,R.jsxs)(`label`,{className:`photo-row`,children:[(0,R.jsx)(`span`,{children:(0,R.jsx)(o,{children:`Zoom`})}),(0,R.jsx)(`input`,{type:`range`,min:15,max:110,step:1,value:Math.round(L),onChange:e=>(S.fov=Number(e.target.value),O()),"aria-label":e(`Field of view`)}),(0,R.jsxs)(`b`,{children:[Math.round(L),`°`]})]}),(0,R.jsxs)(`label`,{className:`photo-row`,children:[(0,R.jsx)(`span`,{children:(0,R.jsx)(o,{children:`Roll`})}),(0,R.jsx)(`input`,{type:`range`,min:-45,max:45,step:1,value:Math.round(V*180/Math.PI),onChange:e=>(S.roll=Math.max(-E,Math.min(E,Number(e.target.value)*Math.PI/180)),O()),"aria-label":e(`Roll`)}),(0,R.jsxs)(`b`,{children:[Math.round(V*180/Math.PI),`°`]})]}),(0,R.jsxs)(`label`,{className:`toggle`,children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:t.dof,onChange:e=>F({dof:e.target.checked})}),` `,(0,R.jsx)(o,{children:`Depth of field`})]}),t.dof&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`label`,{className:`photo-row`,children:[(0,R.jsx)(`span`,{children:(0,R.jsx)(o,{children:`Focus`})}),(0,R.jsx)(`input`,{type:`range`,min:.3,max:40,step:.1,value:t.focus,onChange:e=>F({focus:Number(e.target.value)}),"aria-label":e(`Focus distance`)}),(0,R.jsxs)(`b`,{children:[t.focus.toFixed(1),` m`]})]}),(0,R.jsxs)(`label`,{className:`photo-row`,children:[(0,R.jsx)(`span`,{children:(0,R.jsx)(o,{children:`Blur`})}),(0,R.jsx)(`input`,{type:`range`,min:0,max:1,step:.05,value:t.blur,onChange:e=>F({blur:Number(e.target.value)}),"aria-label":e(`Blur strength`)}),(0,R.jsxs)(`b`,{children:[Math.round(t.blur*100),`%`]})]})]}),(0,R.jsxs)(`button`,{className:`btn btn-ghost btn-small`,onClick:()=>w(),children:[(0,R.jsx)(o,{children:`◎ Focus on the middle`}),` `,(0,R.jsx)(`kbd`,{children:`T`})]})]}),(0,R.jsxs)(`section`,{className:`photo-section`,children:[(0,R.jsx)(`h4`,{children:(0,R.jsx)(o,{children:`Filter`})}),(0,R.jsx)(`div`,{className:`photo-chips`,role:`radiogroup`,"aria-label":e(`Filter`),children:P.map(n=>(0,R.jsx)(`button`,{role:`radio`,"aria-checked":t.filter===n,className:`photo-chip ${t.filter===n?`on`:``}`,onClick:()=>F({filter:n}),children:e(C[n])},n))}),(0,R.jsxs)(`div`,{className:`photo-checks`,children:[(0,R.jsxs)(`label`,{className:`toggle`,children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:t.stamp,onChange:e=>F({stamp:e.target.checked})}),` `,(0,R.jsx)(o,{children:`Logo stamp`})]}),(0,R.jsxs)(`label`,{className:`toggle`,children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:t.caption,onChange:e=>F({caption:e.target.checked})}),` `,(0,R.jsx)(o,{children:`Floor and date`})]}),(0,R.jsxs)(`label`,{className:`toggle`,children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:t.guides,onChange:e=>F({guides:e.target.checked})}),` `,(0,R.jsx)(o,{children:`Thirds guides`})]})]})]}),(0,R.jsxs)(`section`,{className:`photo-section`,children:[(0,R.jsxs)(`h4`,{children:[(0,R.jsx)(o,{children:`Time of day`}),` `,(0,R.jsx)(`span`,{className:`muted small`,children:m(q)})]}),(0,R.jsx)(`input`,{type:`range`,min:0,max:1,step:.002,value:q,onChange:e=>k(Number(e.target.value)),"aria-label":e(`Time of day`),"aria-valuetext":m(q)}),(0,R.jsxs)(`div`,{className:`row wrap`,children:[(0,R.jsx)(`button`,{className:`btn btn-ghost btn-small`,onClick:()=>k(x),children:(0,R.jsx)(o,{children:`🌇 Golden hour`})}),(0,R.jsx)(`button`,{className:`btn btn-ghost btn-small`,onClick:()=>k(.5),children:(0,R.jsx)(o,{children:`☀️ Noon`})}),(0,R.jsx)(`button`,{className:`btn btn-ghost btn-small`,onClick:()=>k(.79),children:(0,R.jsx)(o,{children:`🌆 Blue hour`})}),(0,R.jsx)(`button`,{className:`btn btn-ghost btn-small`,onClick:()=>k(null),disabled:t.daytime===null,children:(0,R.jsx)(o,{children:`↺ As it is`})})]})]}),(0,R.jsxs)(`section`,{className:`photo-section`,children:[(0,R.jsx)(`h4`,{children:(0,R.jsx)(o,{children:`Shot`})}),(0,R.jsxs)(`div`,{className:`photo-chips`,role:`radiogroup`,"aria-label":e(`Shot size`),children:[_.map(e=>(0,R.jsxs)(`button`,{role:`radio`,"aria-checked":t.scale===e,className:`photo-chip ${t.scale===e?`on`:``}`,onClick:()=>F({scale:e}),children:[e,`×`]},e)),(0,R.jsxs)(`span`,{className:`muted small`,children:[G.width,`×`,G.height]})]}),(0,R.jsxs)(`button`,{className:`btn photo-big`,disabled:!!t.busy,onClick:()=>void M(),children:[`📸 `,e(t.busy===`Developing…`?`Developing…`:`Take the shot`),` `,(0,R.jsx)(`kbd`,{children:`Enter`})]}),(0,R.jsx)(`p`,{className:`muted small`,children:(0,R.jsx)(o,{children:`Saves a PNG to your downloads and copies it.`})})]}),(0,R.jsxs)(`section`,{className:`photo-section`,children:[(0,R.jsx)(`h4`,{children:(0,R.jsx)(o,{children:`Clip`})}),(0,R.jsxs)(`div`,{className:`photo-chips`,children:[b.map(e=>(0,R.jsxs)(`button`,{className:`photo-chip ${t.clipSeconds===e?`on`:``}`,"aria-pressed":t.clipSeconds===e,onClick:()=>F({clipSeconds:e}),children:[e,` s`]},e)),[30,60].map(e=>(0,R.jsxs)(`button`,{className:`photo-chip ${t.fps===e?`on`:``}`,"aria-pressed":t.fps===e,onClick:()=>F({fps:e}),children:[e,` fps`]},e))]}),(0,R.jsxs)(`label`,{className:`photo-row`,children:[(0,R.jsx)(`span`,{children:(0,R.jsx)(o,{children:`Camera`})}),(0,R.jsxs)(`select`,{value:t.orbit,onChange:e=>F({orbit:e.target.value}),"aria-label":e(`Cinematic orbit`),children:[(0,R.jsx)(`option`,{value:`free`,children:e(`Free (fly it yourself)`)}),y!==0&&(0,R.jsx)(`option`,{value:`gong`,children:e(`Orbit the gong`)}),y!==0&&(0,R.jsx)(`option`,{value:`board`,children:e(`Orbit the whiteboard`)}),W.map(t=>(0,R.jsx)(`option`,{value:`person:${t.id}`,children:e(`Orbit {name}`,{name:t.name})},t.id))]})]}),(0,R.jsxs)(`button`,{className:`btn photo-big ${t.recording?`photo-recording`:``}`,disabled:!t.recording&&!!t.busy,onClick:()=>void N(),children:[e(t.recording?`■ Stop recording`:t.busy===`Saving the clip…`?`Saving the clip…`:`⏺ Record`),` `,(0,R.jsx)(`kbd`,{children:`V`})]}),(0,R.jsxs)(`p`,{className:`muted small`,children:[(0,R.jsx)(o,{children:`A WebM with the office’s sound, up to a minute`}),n?e(` (frozen: a still scene, unless the camera moves)`):``,`.`]})]}),(0,R.jsxs)(`section`,{className:`photo-section`,children:[(0,R.jsx)(`h4`,{children:(0,R.jsx)(o,{children:`Instant replay`})}),(0,R.jsxs)(`label`,{className:`toggle`,children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:p,onChange:e=>c(e.target.checked)}),` `,(0,R.jsx)(o,{children:`Keep the last 15 s, any time`})]}),(0,R.jsxs)(`p`,{className:`muted small`,children:[(0,R.jsx)(o,{children:`Press`}),` `,(0,R.jsx)(d,{action:`saveReplay`}),` `,(0,R.jsx)(o,{children:`to save them. Off by default: it records all the time, which takes memory.`})]})]}),(0,R.jsx)(H,{}),(0,R.jsxs)(`p`,{className:`photo-keys muted small`,children:[(0,R.jsx)(o,{children:`Click the view to steer ·`}),` `,(0,R.jsx)(u,{joined:!0}),` `,(0,R.jsx)(o,{children:`fly`}),` · `,(0,R.jsx)(`kbd`,{children:`Space`}),`/`,(0,R.jsx)(`kbd`,{children:`C`}),` `,(0,R.jsx)(o,{children:`up/down`}),` · `,(0,R.jsx)(d,{action:`run`}),` `,(0,R.jsx)(o,{children:`faster`}),` · `,(0,R.jsx)(d,{action:`rotateLeft`}),`/`,(0,R.jsx)(d,{action:`rotateRight`}),` `,(0,R.jsx)(o,{children:`roll · wheel zoom ·`}),` `,(0,R.jsx)(`kbd`,{children:`R`}),` `,(0,R.jsx)(o,{children:`reset`}),` · `,(0,R.jsx)(`kbd`,{children:`H`}),` `,(0,R.jsx)(o,{children:`hide panel`}),` · `,(0,R.jsx)(`kbd`,{children:`Esc`}),` `,(0,R.jsx)(o,{children:`frees the mouse, then leaves`})]})]}):(0,R.jsxs)(`button`,{className:`photo-show`,onClick:()=>F({panel:!0}),children:[`📷 `,(0,R.jsx)(`kbd`,{children:`H`}),` `,(0,R.jsx)(o,{children:`show the panel`})]}),(0,R.jsx)(`div`,{className:`toasts photo-toasts`,children:g.map(e=>(0,R.jsx)(`div`,{className:`toast toast-${e.level}`,onClick:()=>v(e.id),children:e.text},e.id))})]})}export{W as default};
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/pipeline-BOTOZ69L.js","assets/bloomMarks-DariC6lY.js","assets/jsx-runtime-BFUkm7bt.js","assets/index-B6qvKFYN.js","assets/store-FA83kfnc.js","assets/index-COpmc42S.css","assets/useDayTime-0XsqM14Q.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{s as e,u as t}from"./jsx-runtime-BFUkm7bt.js";import{Ra as n,en as r,m as i,wa as a}from"./store-FA83kfnc.js";import{Bt as o,F as s,Ht as c,O as l,Tt as u,V as d,X as f,_t as p,ct as m,dt as h,f as g,g as _,gt as v,it as y,nt as b,pt as x,ut as ee,wt as te,yt as ne,zt as S}from"./bloomMarks-DariC6lY.js";import{l as C,t as w}from"./useGraphics-Cif18p7Q.js";import{G as T,H as E,k as D}from"./mic-B316hcCe.js";import{u as O}from"./gate-BplJKcLG.js";import{r as re}from"./useDayTime-0XsqM14Q.js";import{Ar as ie,Mr as ae,Or as oe,jr as se,kr as ce}from"./Office-BBnd6tyn.js";import{_ as le,d as k,f as A,p as j}from"./gallery-ColCPQQE.js";import{a as M,activeClip as N,c as P,cam as F,f as I,focusCenter as L,i as R,l as z,leave as B,o as V,overlayOptions as H,p as U,r as W,requestFrame as G,s as ue,setBridge as K,setFrozen as de,t as fe,takeRedraw as pe,takeShot as me,toggleRecording as he,update as q,usePhoto as J}from"./photoMode-CYxQfgUF.js";var Y=t(e(),1),X=.014,ge=`
|
|
3
|
-
varying vec2 vUv;
|
|
4
|
-
void main() {
|
|
5
|
-
vUv = uv;
|
|
6
|
-
gl_Position = vec4(position.xy, 0.0, 1.0);
|
|
7
|
-
}`,_e=`
|
|
8
|
-
#include <packing>
|
|
9
|
-
uniform sampler2D tColor;
|
|
10
|
-
uniform sampler2D tDepth;
|
|
11
|
-
uniform vec2 uSize;
|
|
12
|
-
uniform vec2 uOrigin;
|
|
13
|
-
uniform vec2 uFull;
|
|
14
|
-
uniform float uPx;
|
|
15
|
-
uniform float uSeed;
|
|
16
|
-
uniform float uDof;
|
|
17
|
-
uniform float uFocus;
|
|
18
|
-
uniform float uBlur;
|
|
19
|
-
uniform float uNear;
|
|
20
|
-
uniform float uFar;
|
|
21
|
-
uniform float uSaturation;
|
|
22
|
-
uniform float uContrast;
|
|
23
|
-
uniform vec3 uGain;
|
|
24
|
-
uniform vec3 uLift;
|
|
25
|
-
uniform float uVignette;
|
|
26
|
-
uniform float uGrain;
|
|
27
|
-
uniform float uPosterize;
|
|
28
|
-
uniform float uInk;
|
|
29
|
-
varying vec2 vUv;
|
|
30
|
-
|
|
31
|
-
float distanceAt(vec2 uv) {
|
|
32
|
-
float d = unpackRGBAToDepth(texture2D(tDepth, uv));
|
|
33
|
-
return -perspectiveDepthToViewZ(d, uNear, uFar);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// How blurred a point at this distance is, 0..1 (thin-lens-like: grows with distance from the focus plane).
|
|
37
|
-
float coc(float dist) {
|
|
38
|
-
return clamp(abs(dist - uFocus) / max(dist, 0.05) * 1.6, 0.0, 1.0);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
float luma(vec3 c) { return dot(c, vec3(0.2126, 0.7152, 0.0722)); }
|
|
42
|
-
|
|
43
|
-
// Flat bands of light and shade, as printed: the brightness is stepped, the hue kept (stepping each channel
|
|
44
|
-
// would turn smooth lighting into stripes of other colours), and each step is softened a little so faint noise in
|
|
45
|
-
// the lighting doesn't turn into ragged edges.
|
|
46
|
-
vec3 posterize(vec3 c) {
|
|
47
|
-
if (uPosterize < 2.0) return c;
|
|
48
|
-
float y = luma(c) * uPosterize;
|
|
49
|
-
float stepped = (floor(y) + smoothstep(0.3, 0.7, fract(y))) / uPosterize;
|
|
50
|
-
return c * (stepped / max(luma(c), 0.004));
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
float hash(vec2 p) {
|
|
54
|
-
p = fract(p * vec2(123.34, 456.21));
|
|
55
|
-
p += dot(p, p + 45.32 + uSeed);
|
|
56
|
-
return fract(p.x * p.y);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
void main() {
|
|
60
|
-
vec3 c = texture2D(tColor, vUv).rgb;
|
|
61
|
-
|
|
62
|
-
if (uDof > 0.5) {
|
|
63
|
-
// Gathering what spills onto this pixel: each sample reaches as far as its own blur, and one behind this pixel
|
|
64
|
-
// only as far as this pixel is blurred itself (a sharp face keeps its edge against a soft background).
|
|
65
|
-
float d0 = distanceAt(vUv);
|
|
66
|
-
float r0 = coc(d0) * uBlur;
|
|
67
|
-
vec3 sum = c;
|
|
68
|
-
float total = 1.0;
|
|
69
|
-
for (int i = 1; i < 32; i++) {
|
|
70
|
-
float rs = sqrt(float(i) / 31.0) * uBlur;
|
|
71
|
-
float a = float(i) * 2.39996;
|
|
72
|
-
vec2 uv = vUv + vec2(cos(a), sin(a)) * rs / uSize;
|
|
73
|
-
float d = distanceAt(uv);
|
|
74
|
-
float r = coc(d) * uBlur;
|
|
75
|
-
float reach = d > d0 ? min(r, r0) : r;
|
|
76
|
-
float w = clamp(reach - rs + 1.0, 0.0, 1.0);
|
|
77
|
-
sum += texture2D(tColor, uv).rgb * w;
|
|
78
|
-
total += w;
|
|
79
|
-
}
|
|
80
|
-
c = sum / total;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
if (uInk > 0.0) {
|
|
84
|
-
vec2 s = vec2(max(1.0, uPx)) / uSize;
|
|
85
|
-
float tl = luma(texture2D(tColor, vUv + vec2(-s.x, s.y)).rgb);
|
|
86
|
-
float t = luma(texture2D(tColor, vUv + vec2(0.0, s.y)).rgb);
|
|
87
|
-
float tr = luma(texture2D(tColor, vUv + vec2(s.x, s.y)).rgb);
|
|
88
|
-
float l = luma(texture2D(tColor, vUv + vec2(-s.x, 0.0)).rgb);
|
|
89
|
-
float r = luma(texture2D(tColor, vUv + vec2(s.x, 0.0)).rgb);
|
|
90
|
-
float bl = luma(texture2D(tColor, vUv + vec2(-s.x, -s.y)).rgb);
|
|
91
|
-
float b = luma(texture2D(tColor, vUv + vec2(0.0, -s.y)).rgb);
|
|
92
|
-
float br = luma(texture2D(tColor, vUv + vec2(s.x, -s.y)).rgb);
|
|
93
|
-
float gx = -tl - 2.0 * l - bl + tr + 2.0 * r + br;
|
|
94
|
-
float gy = -tl - 2.0 * t - tr + bl + 2.0 * b + br;
|
|
95
|
-
float edge = smoothstep(0.18, 0.5, length(vec2(gx, gy)));
|
|
96
|
-
c = posterize(c);
|
|
97
|
-
c = mix(c, vec3(0.06, 0.05, 0.08), edge * uInk);
|
|
98
|
-
} else {
|
|
99
|
-
c = posterize(c);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
float y = luma(c);
|
|
103
|
-
c = mix(vec3(y), c, uSaturation);
|
|
104
|
-
c = (c - 0.5) * uContrast + 0.5;
|
|
105
|
-
c = c * uGain + uLift;
|
|
106
|
-
|
|
107
|
-
vec2 full = uOrigin + gl_FragCoord.xy;
|
|
108
|
-
if (uVignette > 0.0) {
|
|
109
|
-
vec2 p = (full / uFull - 0.5) * vec2(uFull.x / uFull.y, 1.0);
|
|
110
|
-
c *= 1.0 - uVignette * smoothstep(0.35, 1.05, length(p));
|
|
111
|
-
}
|
|
112
|
-
if (uGrain > 0.0) c += (hash(floor(full / max(1.0, uPx * 0.75))) - 0.5) * uGrain;
|
|
113
|
-
|
|
114
|
-
gl_FragColor = vec4(clamp(c, 0.0, 1.0), 1.0);
|
|
115
|
-
}`,ve=class{gl;color=null;depth=new c(1,1,{minFilter:m,magFilter:m,depthBuffer:!0});depthMaterial=new y({depthPacking:p});material;quad;quadScene=new te;quadCamera=new ee(-1,1,1,-1,0,1);size=new S;clear=new l;shown=[];supported=!0;constructor(e){this.gl=e,this.depthMaterial.blending=0,this.material=new u({vertexShader:ge,fragmentShader:_e,depthTest:!1,depthWrite:!1,toneMapped:!1,uniforms:{tColor:{value:null},tDepth:{value:this.depth.texture},uSize:{value:new S(1,1)},uOrigin:{value:new S},uFull:{value:new S(1,1)},uPx:{value:1},uSeed:{value:0},uDof:{value:0},uFocus:{value:5},uBlur:{value:0},uNear:{value:.05},uFar:{value:500},uSaturation:{value:1},uContrast:{value:1},uGain:{value:new o(1,1,1)},uLift:{value:new o},uVignette:{value:0},uGrain:{value:0},uPosterize:{value:0},uInk:{value:0}}}),this.quad=new b(new x(2,2),this.material),this.quad.frustumCulled=!1,this.quadScene.add(this.quad)}margin(e){let t=e.grade.ink>0?Math.ceil(e.px)+2:0;return e.dof&&(t=Math.max(t,Math.ceil(e.dof.blur*X*e.full[1])+2)),t}render(e,t,n,r,i){let a=this.gl;if(a.setRenderTarget(null),n)n.render(r);else{let n=a.autoClear;a.autoClear=!0,a.render(e,t),a.autoClear=n}if(!this.supported||!i.dof&&!U(i.grade))return;a.getDrawingBufferSize(this.size);let o=this.size.x,s=this.size.y;(!this.color||this.color.image.width!==o||this.color.image.height!==s)&&(this.color?.dispose(),this.color=new d(o,s),this.color.minFilter=f,this.color.magFilter=f);try{a.copyFramebufferToTexture(this.color)}catch{this.supported=!1;return}let c=this.material.uniforms;i.dof&&((this.depth.width!==o||this.depth.height!==s)&&this.depth.setSize(o,s),this.depthPass(e,t,i.seeThrough)),c.tColor.value=this.color,c.uSize.value.set(o,s),c.uOrigin.value.set(i.origin[0],i.origin[1]),c.uFull.value.set(i.full[0],i.full[1]),c.uPx.value=i.px,c.uSeed.value=i.seed,c.uDof.value=+!!i.dof,c.uFocus.value=i.dof?.focus??5,c.uBlur.value=i.dof?i.dof.blur*X*i.full[1]:0,c.uNear.value=t.near,c.uFar.value=t.far;let l=i.grade;c.uSaturation.value=l.saturation,c.uContrast.value=l.contrast,c.uGain.value.set(l.gain[0],l.gain[1],l.gain[2]),c.uLift.value.set(l.lift[0],l.lift[1],l.lift[2]),c.uVignette.value=l.vignette,c.uGrain.value=l.grain,c.uPosterize.value=l.posterize,c.uInk.value=l.ink,a.render(this.quadScene,this.quadCamera)}depthPass(e,t,n){let r=this.gl,i=e.background,a=r.shadowMap.autoUpdate,o=r.getClearAlpha();r.getClearColor(this.clear),this.shown.length=0;for(let e=0;e<n.length;e++)this.shown.push(n[e].visible),n[e].visible=!1;e.background=null,e.overrideMaterial=this.depthMaterial,r.shadowMap.autoUpdate=!1,r.setClearColor(16777215,1),r.setRenderTarget(this.depth),r.clear(),r.render(e,t),r.setRenderTarget(null),r.setClearColor(this.clear,o),r.shadowMap.autoUpdate=a,e.overrideMaterial=null,e.background=i;for(let e=0;e<n.length;e++)n[e].visible=this.shown[e]}dispose(){this.color?.dispose(),this.depth.dispose(),this.depthMaterial.dispose(),this.material.dispose(),this.quad.geometry.dispose()}},Z=[`forward`,`back`,`left`,`right`,`run`,`rotateLeft`,`rotateRight`],Q=`Space`,$=`KeyC`;function ye(e){let t=e.target;return!t||t===document.body?`view`:t.tagName===`TEXTAREA`||t.tagName===`SELECT`||t.isContentEditable?`text`:t.tagName===`INPUT`?[`range`,`checkbox`,`radio`,`button`].includes(t.type)?`control`:`text`:t.tagName===`BUTTON`?`control`:`view`}function be(e,t){if(e===`gong`)t.set(n.x,n.y,n.z);else if(e===`board`)t.set(0,a.y+a.h/2,a.z);else if(e.startsWith(`person:`)){let n=r(e.slice(7));if(!n)return!1;n.stage===`seated`?t.set(n.seatX,1.1,n.seatZ):t.set(n.x,1.35,n.z)}else return!1;return!0}function xe(e){for(;e;e=e.parent)if(!e.visible&&!e.userData.standIn)return!1;return!0}function Se(e){for(let t=0;e&&t<6;e=e.parent,t++){let t=e.userData;if(t.billboard||t.facesCamera)return!0}return!1}function Ce(e){for(;e;e=e.parent)if(e.userData.firstPerson)return!0;return!1}function we(){let e=_(e=>e.gl),t=_(e=>e.scene),n=_(e=>e.camera),r=_(e=>e.size),a=_(e=>e.get),c=O(e=>e.frozen),l=(0,Y.useMemo)(()=>new h(n.fov,1,n.near,n.far),[n]),u=(0,Y.useMemo)(()=>new ve(e),[e]);(0,Y.useEffect)(()=>()=>u.dispose(),[u]);let d=C(w),[f,p]=(0,Y.useState)(null),m=(0,Y.useMemo)(()=>{let e={keys:new Set,input:{forward:0,right:0,up:0,roll:0,fast:!1},orbit:null,orbitKey:`free`,target:new o,facing:[],firstPerson:[],seeThrough:[],hidden:[],fogBack:0,scanAt:-1/0,frames:0,seed:0,q:new v,buf:new S,ray:new ne,center:new S,unlockedAt:-1/0,lookFilter:ce(),width:1,height:1,pipe:null,delta:0,post:{grade:I.none,dof:null,seed:0,origin:[0,0],full:[1,1],px:1,seeThrough:[]},dof:{focus:4,blur:.5},visit:t=>{let n=t.userData;n.billboard&&t.children[0]&&e.facing.push(t.children[0]),n.facesCamera&&e.facing.push(t),n.firstPerson&&e.firstPerson.push(t);let r=t;r.isMesh&&!Array.isArray(r.material)&&r.material.transparent&&!Se(t)&&e.seeThrough.push(t)}};return e.post.seeThrough=e.seeThrough,e},[]);(0,Y.useLayoutEffect)(()=>{m.width=Math.max(1,r.width),m.height=Math.max(1,r.height),f?.setSize(m.width,m.height),G()},[m,r,f]),(0,Y.useEffect)(()=>{if(d===`low`)return;let n=!0,r=null;return i(async()=>{let{createPipeline:e}=await import(`./pipeline-BOTOZ69L.js`);return{createPipeline:e}},__vite__mapDeps([0,1,2,3,4,5,6])).then(({createPipeline:i})=>{if(n)try{r=i(e,t,l,d),r.setSize(m.width,m.height),m.pipe=r,p(r),G()}catch{}}),()=>{n=!1,m.pipe=null,r?.dispose(),p(null)}},[e,t,l,m,d]),(0,Y.useLayoutEffect)(()=>{let e=new s().setFromQuaternion(n.quaternion,`YXZ`);Object.assign(F,M(n.position.x,n.position.y,n.position.z,e.y,e.x,n.fov)),G()},[n]);let{prepare:y,putBack:b,frame:x}=(0,Y.useMemo)(()=>{let r=()=>{m.facing.length=0,m.firstPerson.length=0,m.seeThrough.length=0,t.traverse(m.visit),m.scanAt=m.frames},i=()=>{l.position.set(F.x,F.y,F.z),l.rotation.set(F.pitch,F.yaw,F.roll,`YXZ`);let e=m.width/m.height;(l.fov!==F.fov||l.aspect!==e)&&(l.fov=F.fov,l.aspect=e,l.updateProjectionMatrix()),l.updateMatrixWorld(),m.frames-m.scanAt>30&&r();for(let e=0;e<m.facing.length;e++){let t=m.facing[e];t.parent&&(t.parent.getWorldQuaternion(m.q),t.quaternion.copy(l.quaternion).premultiply(m.q.invert()))}m.hidden.length=0;for(let e=0;e<m.firstPerson.length;e++)m.hidden.push(m.firstPerson[e].visible),m.firstPerson[e].visible=!1;let i=t.fog;m.fogBack=i?.isFog?l.position.distanceTo(n.position):0,i&&m.fogBack&&(i.near+=m.fogBack,i.far+=m.fogBack);let a=J.getState(),o=m.post;o.grade=I[a.filter],m.dof.focus=a.focus,m.dof.blur=a.blur,o.dof=a.dof&&a.blur>0?m.dof:null},a=()=>{for(let e=0;e<m.firstPerson.length;e++)m.firstPerson[e].visible=m.hidden[e];let e=t.fog;e&&m.fogBack&&(e.near-=m.fogBack,e.far-=m.fogBack),m.fogBack=0},o=()=>{i(),e.getDrawingBufferSize(m.buf);let n=m.post;n.origin[0]=0,n.origin[1]=0,n.full[0]=m.buf.x,n.full[1]=m.buf.y,n.px=e.getPixelRatio(),n.seed=m.seed,u.render(t,l,m.pipe,m.delta,n),a(),N()?.draw(),m.frames++};return{prepare:i,putBack:a,frame:(e,t)=>{m.delta=e;let n=m.keys,r=m.input,i=D();r.forward=+!!E(i,`forward`,n)-!!E(i,`back`,n),r.right=+!!E(i,`right`,n)-!!E(i,`left`,n),r.up=+!!n.has(Q)-!!n.has($),r.roll=+!!E(i,`rotateRight`,n)-!!E(i,`rotateLeft`,n),r.fast=E(i,`run`,n);let a=J.getState().orbit,s=!1;if(a!==`free`&&be(a,m.target)){let t=m.target;(m.orbitKey!==a||!m.orbit)&&(m.orbit=V(F,t.x,t.y,t.z)),m.orbitKey=a,m.orbit.cx=t.x,m.orbit.cy=t.y,m.orbit.cz=t.z,ue(m.orbit,F,e),P(F,r.roll,e),s=!0}else a!==`free`&&q({orbit:`free`}),m.orbitKey=`free`,W(F,r,e),s=r.forward!==0||r.right!==0||r.up!==0||r.roll!==0||Math.abs(F.vx)+Math.abs(F.vy)+Math.abs(F.vz)>1e-4;let c=N()!==null;c&&(m.seed=(m.seed+.618)%64),(pe()||s||t||c)&&o()}}},[e,t,l,n,u,m]);return(0,Y.useEffect)(()=>{if(!c)return;let e=0,t=performance.now(),n=r=>{x(Math.min(.1,Math.max(0,(r-t)/1e3)),!1),t=r,e=requestAnimationFrame(n)};return G(),e=requestAnimationFrame(n),()=>cancelAnimationFrame(e)},[c,x]),g((e,t)=>{O.getState().frozen||x(Math.min(t,.1),!0)},1),(0,Y.useEffect)(()=>J.subscribe((e,t)=>{e.daytime!==t.daytime&&O.getState().frozen&&re(a()),G()}),[a]),(0,Y.useEffect)(()=>{let t=e.domElement,r=m.keys,i=e=>{let t=ye(e);if(t===`text`||e.ctrlKey||e.metaKey||e.altKey)return;let i=e.code;if(i===`Escape`){!document.pointerLockElement&&performance.now()-m.unlockedAt>400&&B();return}let a=D();if(i===Q||i===$||Z.some(e=>T(a,e,i))){if(t===`control`&&(i.startsWith(`Arrow`)||i===Q))return;e.preventDefault(),r.add(i);return}if(!e.repeat){if(i===`Enter`&&t===`view`)me();else if(i===`KeyF`)de(!O.getState().frozen);else if(i===`KeyH`)q({panel:!J.getState().panel});else if(i===`KeyT`)L();else if(i===`KeyV`)he();else if(i===`KeyR`)F.roll=0,F.fov=n.fov,G();else return;e.preventDefault()}},a=e=>void r.delete(e.code),o=()=>r.clear(),s=e=>{if(e.button===0&&document.pointerLockElement!==t)try{t.requestPointerLock?.()?.catch?.(()=>void 0)}catch{}},c=e=>{if(document.pointerLockElement!==t||J.getState().orbit!==`free`)return;let n=ie(m.lookFilter,e.movementX,e.movementY,e.timeStamp);if(!n)return;let{sensitivity:r,invertY:i}=ae.getState(),a=oe*r*Math.min(1,F.fov/72);R(F,n[0]*a,n[1]*a*(i?-1:1)),G()},l=e=>{e.target?.closest?.(`.photo-panel`)||(F.fov=z(F.fov,e.deltaMode===1?e.deltaY*40:e.deltaY),G())},u=()=>{se(m.lookFilter),document.pointerLockElement||(m.unlockedAt=performance.now())};return window.addEventListener(`keydown`,i),window.addEventListener(`keyup`,a),window.addEventListener(`blur`,o),t.addEventListener(`mousedown`,s),document.addEventListener(`mousemove`,c),window.addEventListener(`wheel`,l,{passive:!0}),document.addEventListener(`pointerlockchange`,u),()=>{window.removeEventListener(`keydown`,i),window.removeEventListener(`keyup`,a),window.removeEventListener(`blur`,o),t.removeEventListener(`mousedown`,s),document.removeEventListener(`mousemove`,c),window.removeEventListener(`wheel`,l),document.removeEventListener(`pointerlockchange`,u)}},[e,m,n]),(0,Y.useEffect)(()=>(K({frames:()=>m.frames,focusCenter(){y(),b(),m.ray.setFromCamera(m.center,l);for(let e of m.ray.intersectObjects(t.children,!0)){let t=e.object;if(t.isMesh&&t.frustumCulled&&xe(t)&&!Ce(t)&&(Array.isArray(t.material)||!t.material.transparent))return e.distance}return null},async shot(n){let{width:r,height:i,scale:a}=k(m.width,m.height,window.devicePixelRatio||1,n),o=document.createElement(`canvas`);o.width=r,o.height=i;let s=o.getContext(`2d`);if(!s)throw Error(`the browser could not make a canvas that big`);y(),e.getDrawingBufferSize(m.buf);let c=m.buf.x,d=m.buf.y,f=m.post;f.full[0]=r,f.full[1]=i,f.px=r/m.width;let p=f.dof!==null||U(f.grade),h=Math.max(p?u.margin(f):0,m.pipe?Math.round(Math.min(c,d)*.08):0);for(let n of A(r,i,c,d,h))l.setViewOffset(r,i,n.viewX,n.viewY,c,d),f.origin[0]=n.viewX,f.origin[1]=i-(n.viewY+d),u.render(t,l,m.pipe,0,f),s.drawImage(e.domElement,n.x-n.viewX,n.y-n.viewY,n.w,n.h,n.x,n.y,n.w,n.h);l.clearViewOffset(),l.aspect=m.width/m.height,l.updateProjectionMatrix(),b(),G(),fe(s,r,i,H(!1));let g=await j(o,`image/png`),_=await le(o,r,i);return o.width=0,{png:g,thumb:_,width:r,height:i,scale:a}}}),()=>K(null)),[e,t,l,u,m,y,b]),null}export{we as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as e,t,u as n}from"./jsx-runtime-BFUkm7bt.js";import{Bt as r,f as i,gt as a,tt as o}from"./bloomMarks-DariC6lY.js";import{a as s}from"./director-CrzFgnoP.js";import{n as c,r as l}from"./Office-BBnd6tyn.js";import{a as u,i as d,l as f,n as p,o as m}from"./kit-C6ByUQ-Y.js";var h=n(e(),1),g=t(),_=44,v=260,y=_/(v/2),b=26;function x({run:e,elevation:t}){let n=(0,h.useRef)(null),x=(0,h.useRef)(null),S=m(e.side),C=(0,h.useMemo)(()=>{let n=s(e.seed),r=n()<.5?1:-1;return{dir:r,x:S*(290+n()*50),y:p(t)+70+n()*20,z0:-r*430,z1:r*430,livery:[`#e63946`,`#1d3557`,`#2a9d8f`,`#f4a261`][Math.floor(n()*4)]}},[e.seed,S,t]),w=(0,h.useMemo)(()=>({m:new o,q:new a,v:new r,sc:new r,born:new Float32Array(v).fill(-1),pos:new Float32Array(v*3),next:0}),[]);(0,h.useLayoutEffect)(()=>{let e=x.current;if(e){w.m.makeScale(0,0,0);for(let t=0;t<v;t++)e.setMatrixAt(t,w.m);e.instanceMatrix.needsUpdate=!0}},[w]);let T=(0,h.useMemo)(()=>({jet:null}),[]);(0,h.useEffect)(()=>(T.jet=c(`jet`),()=>T.jet?.stop(1.5)),[T]),i(()=>{let r=e.t,i=Math.min(1,r/_),a=u(C.z0,C.z1,i),o=n.current;o&&(o.visible=r<_,o.position.set(C.x,C.y,a),o.rotation.y=C.dir>0?0:Math.PI);let s=x.current;if(!s)return;for(;r<_&&w.next*y<=r&&w.next<v/2;){let e=u(C.z0,C.z1,Math.min(1,w.next*y/_))-C.dir*14;for(let t of[0,1]){let n=w.next*2+t;w.born[n]=w.next*y,w.pos[n*3]=C.x+(t?7:-7),w.pos[n*3+1]=C.y-1,w.pos[n*3+2]=e}w.next++}for(let e=0;e<v;e++){let t=w.born[e];if(t<0)continue;let n=r-t,i=n>b?0:(2.2+n*.25)*Math.min(1,(b-n)/6)*Math.min(1,n*3+.3);w.v.set(w.pos[e*3],w.pos[e*3+1]-n*.15,w.pos[e*3+2]),w.sc.set(i,i*.8,i*1.6),s.setMatrixAt(e,w.m.compose(w.v,w.q,w.sc))}s.instanceMatrix.needsUpdate=!0;let c=l(C.x,C.y-t,a,160);T.jet?.set(c.gain*d(r,_,6),c.pan,.9+.2*(1-i))});let E=f(`#f4f6fa`);return(0,g.jsxs)(`group`,{children:[(0,g.jsxs)(`group`,{ref:n,scale:1.15,children:[(0,g.jsx)(`mesh`,{material:E,"rotation-x":Math.PI/2,children:(0,g.jsx)(`capsuleGeometry`,{args:[2.1,30,6,12]})}),[-2.02,2.02].map(e=>(0,g.jsx)(`mesh`,{material:f(`#2b3a55`),position:[e,.6,1],children:(0,g.jsx)(`boxGeometry`,{args:[.12,.45,22]})},e)),(0,g.jsx)(`mesh`,{material:E,position:[0,-.6,-1],children:(0,g.jsx)(`boxGeometry`,{args:[34,.5,5]})}),(0,g.jsx)(`mesh`,{material:f(C.livery),position:[0,4.2,-14.5],children:(0,g.jsx)(`boxGeometry`,{args:[.6,6.5,4.5]})}),(0,g.jsx)(`mesh`,{material:E,position:[0,1,-15],children:(0,g.jsx)(`boxGeometry`,{args:[12,.4,3]})}),[-7,7].map(e=>(0,g.jsx)(`mesh`,{material:f(`#9aa3b5`),position:[e,-1.8,.8],"rotation-x":Math.PI/2,children:(0,g.jsx)(`cylinderGeometry`,{args:[1,1,4.5,10]})},e))]}),(0,g.jsx)(`instancedMesh`,{ref:x,args:[void 0,void 0,v],material:f(`#ffffff`,{opacity:.85}),frustumCulled:!1,children:(0,g.jsx)(`sphereGeometry`,{args:[1,8,6]})})]})}export{x as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/TerminalView-wlhSixSH.js","assets/jsx-runtime-BFUkm7bt.js","assets/store-FA83kfnc.js","assets/index-B6qvKFYN.js","assets/index-COpmc42S.css","assets/bloomMarks-DariC6lY.js","assets/BufferGeometryUtils-BsmWvcA2.js","assets/Batched-BOgjreKO.js","assets/rig-wAyl3G1G.js","assets/AccessibilitySettings-DSmFk9JC.js","assets/mic-B316hcCe.js","assets/jukeboxSongs-CjbAzAeb.js","assets/AccessibilitySettings-HrzBDUTN.css","assets/TerminalView-BrP-ENHg.css","assets/AppViewer-alNn4TBB.js","assets/MissionConsole-BEP5CdC8.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{s as e,t,u as n}from"./jsx-runtime-BFUkm7bt.js";import{At as r,a as i,d as a,ds as o,li as s,m as c,p as l,t as u}from"./store-FA83kfnc.js";import{O as d,a as f,c as p,l as m,o as h,s as g}from"./index-B6qvKFYN.js";import{C as _,I as v,N as y,a as b,b as x,c as S,f as C,g as w,i as T,n as E,o as D,p as O,r as k,s as A,t as j,u as M,v as N}from"./AccessibilitySettings-DSmFk9JC.js";var P=n(e(),1),F=t();function I({repo:e,qa:t,ready:n}){let r=g(),i=l(e=>t.devAgentId?e.agents[t.devAgentId]:void 0),a=l(e=>e.settings.language),[s,c]=(0,P.useState)(!1),u=e.pulls.find(e=>e.number===t.prNumber);if(!u)return null;let{note:d,tone:f}=o(t,u,e.autoMerge,a),_=async e=>{c(!0);try{await e()}catch{}finally{c(!1)}},v=async()=>{await m(n?{icon:`🎉`,title:r(`Merge PR #{number}?`,{number:u.number}),body:r(`“{title}” passed QA. It will be squash-merged into {branch}.`,{title:u.title,branch:e.defaultBranch}),confirm:r(`Squash & merge`)}:{tone:`warn`,title:r(`Merge PR #{number} without QA?`,{number:u.number}),body:r(`“{title}” has not passed QA yet. Merge it into {branch} anyway?`,{title:u.title,branch:e.defaultBranch}),confirm:r(`Merge anyway`)})&&await _(()=>p.mergePull(e.id,u.number))},y=async()=>{let t=``;await m({icon:`🔧`,title:r(`Send PR #{number} back for a fix?`,{number:u.number}),body:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`p`,{children:(0,F.jsx)(h,{children:`Its author, or any free agent, fixes it with QA’s findings, then it’s tested once more.`})}),(0,F.jsx)(`input`,{maxLength:1e3,placeholder:r(`Optional note for whoever fixes it`),"aria-label":r(`Note for whoever fixes it`),onChange:e=>t=e.target.value})]}),confirm:r(`Send back`)})&&await _(()=>p.sendBack(e.id,u.number,t.trim()||void 0))},b=async()=>{await m({tone:`danger`,title:r(`Close PR #{number}?`,{number:u.number}),body:r(`“{title}” will be closed without merging. The branch stays on GitHub.`,{title:u.title}),confirm:r(`Close PR`)})&&await _(()=>p.closePull(e.id,u.number))};return(0,F.jsxs)(`div`,{className:`pk-card pk-pr kcard-${f??`plain`}`,style:{"--accent":e.color},children:[(0,F.jsxs)(`div`,{className:`pk-pr-head`,children:[(0,F.jsx)(`span`,{className:`floor-badge`,children:e.floor}),(0,F.jsxs)(`div`,{className:`grow`,children:[(0,F.jsx)(`a`,{href:u.url,target:`_blank`,rel:`noreferrer`,children:(0,F.jsxs)(`b`,{children:[`PR #`,u.number]})}),` `,u.title,(0,F.jsxs)(`div`,{className:`muted small`,children:[e.fullName.split(`/`)[1],i?` · ${r(`by {name}`,{name:i.name})}`:``,` · `,r(`round {number}`,{number:t.round}),` · `,d]})]})]}),t.summary&&(0,F.jsx)(`div`,{className:`small pk-pr-summary`,children:t.summary}),t.commentUrl&&(0,F.jsx)(`a`,{className:`small`,href:t.commentUrl,target:`_blank`,rel:`noreferrer`,children:(0,F.jsx)(h,{children:`QA report ↗`})}),(0,F.jsxs)(`div`,{className:`pk-actions`,children:[!n&&(0,F.jsx)(`button`,{className:`btn btn-small btn-good`,disabled:s,onClick:()=>void _(()=>p.sendToQa(e.id,u.number)),children:(0,F.jsx)(h,{children:`Retry QA`})}),!n&&(0,F.jsx)(`button`,{className:`btn btn-small`,disabled:s,onClick:()=>void y(),children:(0,F.jsx)(h,{children:`Send back`})}),(0,F.jsx)(`button`,{className:`btn btn-small ${n?`btn-good`:``}`,disabled:s||u.isDraft,onClick:()=>void v(),children:r(n?`Merge`:`Merge anyway`)}),(0,F.jsx)(`button`,{className:`btn btn-small btn-ghost`,disabled:s,onClick:()=>void b(),children:(0,F.jsx)(h,{children:`Close`})})]})]})}function L(){let e=l(e=>e.repos),t=l(e=>e.qa),n=l(e=>e.requests),r=A(e,t,n),i=r.requests.length+r.stuck.length+r.ready.length===0;return(0,F.jsxs)(`div`,{className:`pk-page`,children:[i&&(0,F.jsx)(`p`,{className:`pk-empty`,children:(0,F.jsx)(h,{children:`Nothing waits on you. The team carries on, and your phone hears when that changes.`})}),r.requests.length>0&&(0,F.jsx)(`h3`,{className:`pk-h`,children:(0,F.jsx)(h,{children:`👥 Team changes`})}),r.requests.map(e=>(0,F.jsx)(_,{req:e},e.id)),r.stuck.length>0&&(0,F.jsx)(`h3`,{className:`pk-h`,children:(0,F.jsx)(h,{children:`⚠️ Pull requests that need you`})}),r.stuck.map(e=>(0,F.jsx)(I,{repo:e.repo,qa:e.qa},`${e.repo.id}#${e.qa.prNumber}`)),r.ready.length>0&&(0,F.jsx)(`h3`,{className:`pk-h`,children:(0,F.jsx)(h,{children:`✅ Ready to merge`})}),r.ready.map(e=>(0,F.jsx)(I,{repo:e.repo,qa:e.qa,ready:!0},`${e.repo.id}#${e.qa.prNumber}`))]})}var R={idle:`free`,preparing:`setting up`,working:`working`,done:`done`,error:`needs help`,stopped:`stopped`};function z({status:e}){let t=g();return(0,F.jsx)(`span`,{className:`status status-${e}`,children:t(R[e]??e)})}function B(){let[e,t]=(0,P.useState)(!1);return[e,async e=>{t(!0);try{return await e(),!0}catch{return!1}finally{t(!1)}}]}function V({agent:e,repo:t}){let n=g(),a=l(e=>e.agents),o=l(e=>e.qa),s=l(e=>e.settings),c=l(e=>e.clis),d=l(e=>e.openOverlay),f=(0,P.useMemo)(()=>i(t,u(a,t.id),o),[t,a,o]),[m,_]=B(),[y,x]=(0,P.useState)(``),[S,C]=(0,P.useState)(!1),[D,O]=(0,P.useState)(``),k=E(e),A=T(f),j=A.find(e=>e.key===y),M=e.status===`working`||e.status===`preparing`,I=N(e,s),L=async()=>{let t=D.trim();t&&await _(()=>p.message(e.id,t))&&(O(``),C(!1))};return(0,F.jsxs)(`div`,{className:`pk-card pk-agent ${e.status===`error`?`pk-agent-bad`:``}`,children:[(0,F.jsxs)(`div`,{className:`pk-agent-head`,children:[(0,F.jsx)(`span`,{className:`avatar`,style:{background:e.color},children:e.name[0]}),(0,F.jsxs)(`div`,{className:`grow`,children:[(0,F.jsx)(`b`,{children:e.name}),` `,(0,F.jsx)(`span`,{className:`muted small`,children:w(e,s,c)}),(0,F.jsxs)(`div`,{className:`small pk-ellipsis`,children:[b(e,s.language),M&&e.currentTool?(0,F.jsxs)(`span`,{className:`muted`,children:[` · `,n(r(e.currentTool)||e.currentTool),`…`]}):null]})]}),(0,F.jsx)(z,{status:e.status})]}),e.lastError&&!M&&(0,F.jsxs)(`div`,{className:`term-error small pk-error`,children:[`⚠️ `,e.lastError]}),I&&(0,F.jsxs)(`div`,{className:`small pk-sign-in`,children:[`🔑 `,n(`Waiting for you to sign {provider} in, in their terminal`,{provider:I}),`.`]}),(0,F.jsxs)(`div`,{className:`pk-actions`,children:[I&&(0,F.jsx)(`button`,{className:`btn btn-small btn-good`,onClick:()=>d({kind:`terminal`,agentId:e.id}),children:(0,F.jsx)(h,{children:`🔑 Sign in`})}),k.stop&&(0,F.jsx)(`button`,{className:`btn btn-small btn-bad`,disabled:m,onClick:()=>void _(()=>p.stop(e.id)),children:(0,F.jsx)(h,{children:`■ Stop`})}),k.assign&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`select`,{className:`pk-assign`,value:y,"aria-label":n(`Give {name} an issue or a pull request to test`,{name:e.name}),onChange:e=>x(e.target.value),disabled:m||A.length===0,children:[(0,F.jsx)(`option`,{value:``,children:n(A.length?`Pick an issue or a PR…`:`Nothing to pick up`)}),A.map(e=>(0,F.jsxs)(`option`,{value:e.key,children:[e.kind===`qa`?`🔍 PR `:``,`#`,e.number,` `,e.title]},e.key))]}),(0,F.jsx)(`button`,{className:`btn btn-small btn-good`,disabled:m||!j,onClick:()=>j&&void _(()=>j.kind===`qa`?p.sendToQa(t.id,j.number,e.id):p.assign(e.id,j.number)).then(e=>e&&x(``)),children:n(j?.kind===`qa`?`🔍 Test`:`▶ Start`)})]}),k.clear&&(0,F.jsx)(`button`,{className:`btn btn-small`,disabled:m,onClick:()=>void _(()=>p.reset(e.id)),children:(0,F.jsx)(h,{children:`↺ Clear desk`})}),k.message&&(0,F.jsx)(`button`,{className:`btn btn-small ${S?`btn-ghost`:``}`,"aria-expanded":S,onClick:()=>C(!S),children:(0,F.jsx)(h,{children:`💬 Message`})}),(0,F.jsx)(`button`,{className:`btn btn-small btn-ghost`,onClick:()=>d({kind:`terminal`,agentId:e.id}),children:(0,F.jsx)(h,{children:`Terminal`})})]}),S&&k.message&&(0,F.jsxs)(`form`,{className:`pk-msg`,onSubmit:e=>{e.preventDefault(),L()},children:[(0,F.jsx)(v,{value:D,onChange:O,autoFocus:!0,"aria-label":n(`Message {name}`,{name:e.name}),placeholder:n(M?`Tell {name} something while they work…`:`Ask {name} for a follow-up…`,{name:e.name})}),(0,F.jsx)(`button`,{className:`btn btn-small btn-good`,disabled:m||!D.trim(),children:(0,F.jsx)(h,{children:`Send`})})]})]})}function H(){let e=g(),t=l(e=>e.agents.ceo),n=l(e=>e.ceo),[r,i]=B();if(!t)return null;let a=t.status===`working`;return(0,F.jsxs)(`div`,{className:`pk-card pk-agent`,children:[(0,F.jsxs)(`div`,{className:`pk-agent-head`,children:[(0,F.jsx)(`span`,{className:`avatar`,style:{background:t.color},children:t.name[0]}),(0,F.jsxs)(`div`,{className:`grow`,children:[(0,F.jsx)(`b`,{children:t.name}),` `,(0,F.jsx)(`span`,{className:`muted small`,children:`CEO`}),(0,F.jsx)(`div`,{className:`small pk-ellipsis`,children:a?n.job?.label??e(`Working`):n.queue.length?e(`Up next: {jobs}`,{jobs:n.queue.map(e=>e.label).join(` → `)}):e(`Free`)})]}),(0,F.jsx)(z,{status:t.status})]}),a&&(0,F.jsx)(`div`,{className:`pk-actions`,children:(0,F.jsx)(`button`,{className:`btn btn-small btn-bad`,disabled:r,onClick:()=>void i(()=>p.stop(t.id)),children:(0,F.jsx)(h,{children:`■ Stop`})})})]})}function U({focusRepo:e}){let t=g(),n=l(e=>e.repos),r=l(e=>e.agents),i=(0,P.useRef)(null);return(0,P.useEffect)(()=>i.current?.scrollIntoView({block:`start`}),[]),(0,F.jsxs)(`div`,{className:`pk-page`,children:[(0,F.jsx)(H,{}),n.length===0&&(0,F.jsx)(`p`,{className:`muted`,children:(0,F.jsx)(h,{children:`No floors yet, so no team.`})}),n.map(n=>{let a=u(r,n.id);return(0,F.jsxs)(`section`,{ref:n.id===e?i:void 0,className:`pk-section`,style:{"--accent":n.color},children:[(0,F.jsxs)(`h3`,{className:`pk-h`,children:[(0,F.jsx)(`span`,{className:`floor-badge`,children:n.floor}),` `,n.fullName.split(`/`)[1],(0,F.jsxs)(`span`,{className:`muted small`,children:[` · `,t(a.length===1?`{count} agent`:`{count} agents`,{count:a.length})]})]}),a.length===0&&(0,F.jsx)(`p`,{className:`muted small`,children:(0,F.jsx)(h,{children:`Nobody works here yet.`})}),a.map(e=>(0,F.jsx)(V,{agent:e,repo:n},e.id))]},n.id)})]})}var W=(0,P.lazy)(()=>c(()=>import(`./TerminalView-wlhSixSH.js`).then(e=>e.r).then(e=>({default:e.TerminalView})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]))),G=(0,P.lazy)(()=>c(()=>import(`./AppViewer-alNn4TBB.js`).then(e=>e.n).then(e=>({default:e.AppViewer})),__vite__mapDeps([14,1,2,3,4,9,10,11,12]))),K=(0,P.lazy)(()=>c(()=>import(`./MissionConsole-BEP5CdC8.js`).then(e=>e.t).then(e=>({default:e.UsageCard})),__vite__mapDeps([15,1,2,3,4]))),q=[`company`,`chat`,`kanban`,`team`,`approvals`];function J(e){let t=e?new URL(e,location.origin).searchParams.get(`tab`):null;return q.includes(t)?t:null}var Y=e=>e.split(`/`)[1]??e;function X(){l.getState().openOverlay(null),d(`office`)}var Z=[[`building`,`🔨`,`Building`],[`qa`,`🔍`,`QA`],[`fixing`,`🔧`,`Fixing`],[`ready`,`✅`,`Ready`],[`needsYou`,`⚠️`,`Needs you`]];function Q(){let e=g(),t=l(e=>e.connected),n=l(e=>e.loaded),r=l(e=>e.usage),i=l(e=>e.restarting?`⟳ The office is restarting…`:s(e.officeUpdate,e.settings.language)),a=r.until?new Date(r.until).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}):null;return(0,F.jsxs)(F.Fragment,{children:[!t&&(0,F.jsx)(`div`,{className:`pk-banner pk-banner-bad`,children:e(n?`📡 Reconnecting to the office…`:`📡 Connecting to the office…`)}),r.state===`paused`&&(0,F.jsxs)(`div`,{className:`pk-banner pk-banner-bad`,children:[(0,F.jsx)(h,{children:`⏸ Claude’s usage limit was reached: no new work starts`}),a?e(` until {time}`,{time:a}):``,`.`]}),r.state===`pacing`&&(0,F.jsxs)(`div`,{className:`pk-banner`,children:[(0,F.jsx)(h,{children:`🐢 Pacing new work after a usage warning`}),a?e(` until {time}`,{time:a}):``,`.`]}),i&&(0,F.jsx)(`div`,{className:`pk-banner`,children:e(i)})]})}function $({go:e}){let t=g(),n=l(e=>e.repos),r=l(e=>e.agents),a=l(e=>e.qa),o=l(e=>e.requests),s=l(e=>e.ceo),c=l(e=>e.demo),d=l(e=>e.version),f=r.ceo,p=(0,P.useMemo)(()=>n.map(e=>{let t=u(r,e.id);return{repo:e,team:t.length,busy:t.filter(e=>e.status===`working`||e.status===`preparing`).length,p:D(i(e,t,a))}}),[n,r,a]),m=k(A(n,a,o));return(0,F.jsxs)(`div`,{className:`pk-page`,children:[(0,F.jsx)(Q,{}),m>0&&(0,F.jsxs)(`button`,{className:`pk-callout`,onClick:()=>e(`approvals`),children:[(0,F.jsxs)(`span`,{children:[`⚠️ `,t(m===1?`{count} decision waiting on you`:`{count} decisions waiting on you`,{count:m})]}),(0,F.jsx)(`span`,{children:(0,F.jsx)(h,{children:`Approvals →`})})]}),f&&(0,F.jsxs)(`div`,{className:`pk-card pk-ceo`,children:[(0,F.jsx)(`span`,{className:`avatar`,style:{background:f.color},children:f.name[0]}),(0,F.jsxs)(`div`,{className:`grow`,children:[(0,F.jsx)(`b`,{children:f.name}),` `,(0,F.jsx)(`span`,{className:`muted small`,children:`CEO`}),(0,F.jsx)(`div`,{className:`small`,children:f.status===`working`?s.job?.label??t(`Working`):s.queue.length?t(`Next: {job}`,{job:s.queue[0].label}):t(`Free`)})]}),(0,F.jsx)(`button`,{className:`btn btn-small`,onClick:()=>e(`chat`),children:(0,F.jsx)(h,{children:`💬 Chat`})})]}),p.length===0&&(0,F.jsx)(`p`,{className:`muted`,children:(0,F.jsx)(h,{children:`No projects yet. Connect a repo from the manager’s console in the 3D office.`})}),p.map(({repo:n,team:r,busy:i,p:a})=>(0,F.jsxs)(`div`,{className:`pk-card pk-floor`,style:{"--accent":n.color},children:[(0,F.jsxs)(`div`,{className:`pk-floor-head`,children:[(0,F.jsx)(`span`,{className:`floor-badge`,children:n.floor}),(0,F.jsxs)(`div`,{className:`grow`,children:[(0,F.jsx)(`b`,{className:`pk-floor-name`,children:Y(n.fullName)}),(0,F.jsx)(`div`,{className:`muted small pk-ellipsis`,children:n.summary||n.description||n.fullName})]})]}),(0,F.jsx)(`div`,{className:`pk-pipeline`,role:`list`,"aria-label":t(`Floor {floor} pipeline`,{floor:n.floor}),children:Z.map(([e,n,r])=>(0,F.jsxs)(`div`,{role:`listitem`,className:`pk-stage ${a[e]?``:`pk-stage-zero`} ${e===`needsYou`&&a[e]?`pk-stage-hot`:``}`,children:[(0,F.jsxs)(`span`,{className:`pk-stage-n`,children:[(0,F.jsx)(`span`,{className:`pk-stage-icon`,"aria-hidden":!0,children:n}),a[e]]}),(0,F.jsx)(`span`,{className:`pk-stage-label`,children:t(r)})]},e))}),(0,F.jsxs)(`div`,{className:`pk-floor-foot small`,children:[(0,F.jsx)(`span`,{className:`muted`,children:t(`👥 {team} · {busy} busy · 📋 {backlog} in backlog`,{team:r,busy:i,backlog:a.backlog})}),(0,F.jsx)(`span`,{className:`spacer`}),(0,F.jsx)(`button`,{className:`btn btn-small`,onClick:()=>e(`kanban`,n.id),children:(0,F.jsx)(h,{children:`Board`})}),(0,F.jsx)(`button`,{className:`btn btn-small`,onClick:()=>e(`team`,n.id),children:(0,F.jsx)(h,{children:`Team`})})]})]},n.id)),(0,F.jsx)(`button`,{className:`btn pk-wide`,onClick:X,children:(0,F.jsx)(h,{children:`🏢 Open the 3D office`})}),c&&(0,F.jsx)(`div`,{className:`pk-center small muted`,children:(0,F.jsx)(h,{children:`DEMO MODE: fake repos, fake agents`})}),d&&(0,F.jsxs)(`div`,{className:`pk-center small muted`,children:[`Droidsembly `,d]})]})}function ee({repoId:e,pick:t}){let n=g(),r=l(e=>e.repos),i=r.some(t=>t.id===e)?e:r[0]?.id;return i?(0,F.jsxs)(`div`,{className:`pk-page`,children:[r.length>1&&(0,F.jsx)(`div`,{className:`pk-chips`,role:`tablist`,"aria-label":n(`Floor`),children:r.map(e=>(0,F.jsxs)(`button`,{role:`tab`,"aria-selected":e.id===i,className:`pk-chip ${e.id===i?`pk-chip-on`:``}`,style:{"--accent":e.color},onClick:()=>t(e.id),children:[e.floor,` · `,Y(e.fullName)]},e.id))}),(0,F.jsx)(M,{repoId:i,embedded:!0},i)]}):(0,F.jsx)(`p`,{className:`muted pk-page`,children:(0,F.jsx)(h,{children:`No projects yet.`})})}function te(){let e=l(e=>e.toasts),t=l(e=>e.dismissToast);return(0,F.jsx)(`div`,{className:`toasts`,children:e.slice(-2).map(e=>(0,F.jsx)(`div`,{className:`toast toast-${e.level}`,onClick:()=>t(e.id),children:e.text},e.id))})}function ne(){let e=l(e=>e.overlay);return e?.kind===`terminal`&&e.agentId!==`ceo`?(0,F.jsx)(W,{agentId:e.agentId}):e?.kind===`app`?(0,F.jsx)(G,{repoId:e.repoId}):null}function re({onClose:e}){let t=g();return(0,F.jsxs)(y,{title:t(`⚙️ This device and notifications`),onClose:e,className:`pk-settings`,children:[(0,F.jsx)(`div`,{className:`card`,children:(0,F.jsx)(f,{})}),(0,F.jsx)(P.Suspense,{fallback:null,children:(0,F.jsx)(K,{hot:!1})}),(0,F.jsx)(O,{}),(0,F.jsx)(S,{}),(0,F.jsx)(j,{pocket:!0}),(0,F.jsxs)(`div`,{className:`card`,children:[(0,F.jsx)(`h3`,{children:(0,F.jsx)(h,{children:`📱 Pocket mode`})}),(0,F.jsxs)(`p`,{className:`muted small`,children:[(0,F.jsx)(h,{children:`This is the office without the 3D building, for phones and touch screens. It’s picked on its own on small or touch screens; this device remembers what you last chose. To reach the office from your phone safely, see`}),` `,(0,F.jsx)(`a`,{href:`https://github.com/leonvanzyl/cubefarm/blob/main/docs/pocket.md`,children:`docs/pocket.md`}),`.`]}),(0,F.jsx)(`button`,{className:`btn`,onClick:X,children:(0,F.jsx)(h,{children:`🏢 Open the 3D office`})})]})]})}function ie(){let e=g(),[t,n]=(0,P.useState)(()=>J(location.href)??`company`),[r,i]=(0,P.useState)(null),[o,s]=(0,P.useState)(!1),c=l(e=>e.settings.companyName),u=l(e=>e.loaded),d=l(e=>e.settings.setupDone),f=l(e=>a(e.messages,e.phoneReadAt)),p=l(e=>k(A(e.repos,e.qa,e.requests))),m=l(e=>e.agents.ceo?.name??`CEO`),_=l(e=>e.usage.state),v=l(e=>e.connected),y=(e,t)=>{t&&i(t),n(e)};(0,P.useEffect)(()=>{let e=e=>{let t=J(e.detail);t&&n(t)};return window.addEventListener(`cubefarm:open`,e),()=>window.removeEventListener(`cubefarm:open`,e)},[]),(0,P.useEffect)(()=>{let e=l.getState();t===`chat`?e.openOverlay({kind:`phone`,tab:`chat`}):e.overlay?.kind===`phone`&&e.openOverlay(null)},[t]),(0,P.useEffect)(()=>(document.title=`${c?`${c} · `:``}Droidsembly · pocket`,()=>void(document.title=`Droidsembly`)),[c]);let b=[[`company`,`📊`,`Company`,0],[`chat`,`💬`,m,t===`chat`?0:f],[`kanban`,`📋`,`Kanban`,0],[`team`,`👥`,`Team`,0],[`approvals`,`✋`,`Approvals`,p]];return(0,F.jsxs)(`div`,{className:`pocket`,children:[(0,F.jsxs)(`header`,{className:`pk-head`,children:[(0,F.jsx)(C,{}),(0,F.jsx)(`b`,{className:`pk-title`,children:c||`Droidsembly`}),(0,F.jsx)(`span`,{className:`pk-dot ${v?`pk-dot-on`:``}`,title:e(v?`Connected`:`Not connected`)}),(0,F.jsx)(`span`,{className:`spacer`}),_!==`normal`&&(0,F.jsx)(`span`,{className:`chip chip-warn`,children:e(_===`paused`?`⏸ paused`:`🐢 pacing`)}),(0,F.jsx)(`button`,{className:`pk-icon-btn`,onClick:()=>s(!0),"aria-label":e(`Settings and notifications`),title:e(`Settings and notifications`),children:`⚙️`})]}),(0,F.jsx)(`main`,{className:`pk-main ${t===`chat`?`pk-main-chat`:``}`,children:u&&!d?(0,F.jsxs)(`div`,{className:`pk-page`,children:[(0,F.jsx)(`p`,{children:(0,F.jsx)(h,{children:`The office isn’t set up yet. Finish the setup in the 3D office (on a computer is easiest), then come back.`})}),(0,F.jsx)(`button`,{className:`btn`,onClick:X,children:(0,F.jsx)(h,{children:`🏢 Open the 3D office`})})]}):(0,F.jsxs)(F.Fragment,{children:[t===`company`&&(0,F.jsx)($,{go:y}),t===`chat`&&(0,F.jsx)(x,{autoFocus:!1}),t===`kanban`&&(0,F.jsx)(ee,{repoId:r,pick:i}),t===`team`&&(0,F.jsx)(U,{focusRepo:r}),t===`approvals`&&(0,F.jsx)(L,{})]})}),(0,F.jsx)(`nav`,{className:`pk-tabs`,"aria-label":e(`Pocket office`),children:b.map(([r,i,a,o])=>(0,F.jsxs)(`button`,{className:`pk-tab ${t===r?`pk-tab-on`:``}`,"aria-current":t===r?`page`:void 0,onClick:()=>n(r),children:[(0,F.jsxs)(`span`,{className:`pk-tab-icon`,children:[i,o>0&&(0,F.jsx)(`span`,{className:`badge badge-dot`,children:o})]}),(0,F.jsx)(`span`,{className:`pk-tab-label`,children:r===`chat`?a:e(a)})]},r))}),(0,F.jsx)(te,{}),(0,F.jsx)(P.Suspense,{fallback:null,children:(0,F.jsx)(ne,{})}),o&&(0,F.jsx)(re,{onClose:()=>s(!1)})]})}export{ie as default};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import{s as e,t,u as n}from"./jsx-runtime-BFUkm7bt.js";import{$a as r,Ao as i,Ba as a,Bo as o,E as s,I as c,L as l,La as u,Li as d,N as f,Oa as p,Pa as m,Ti as h,To as g,Va as _,Vo as ee,Wa as te,Xa as ne,_n as re,b as ie,do as v,ea as ae,en as oe,fo as se,hn as y,io as ce,ka as b,kt as le,lo as ue,mn as de,p as x,pt as fe,r as pe,ro as me,sr as he,vn as ge,wo as _e,x as ve,xo as ye,yo as be}from"./store-FA83kfnc.js";import{A as S,Bt as C,C as xe,Ct as Se,D as Ce,Mt as we,O as w,R as T,Tt as Te,Y as Ee,f as E,g as De,gt as Oe,ht as ke,k as Ae,kt as D,pt as je,rt as Me,st as O,tt as Ne,w as Pe,x as k,xt as Fe}from"./bloomMarks-DariC6lY.js";import{Jn as Ie,Rn as Le,Vn as Re,_ as ze,b as Be,d as Ve,g as He,h as Ue,kn as We,p as Ge,u as Ke}from"./cheerRules-CZGSrxOB.js";import{a as A}from"./Batched-BOgjreKO.js";import{B as qe,U as j}from"./rig-wAyl3G1G.js";import{J as Je,N as Ye,a as Xe,c as M,ht as Ze,l as N,o as Qe,u as $e}from"./Shell-BmnZn4UL.js";import{n as et,r as tt}from"./interact-0qw7BGhL.js";import{f as nt,n as rt,u as it}from"./useDayTime-0XsqM14Q.js";import{o as at}from"./cityLayout-7ckfe3wf.js";import{ar as ot,er as st,fn as ct,ir as lt,nr as P,pn as ut,rr as dt,s as ft,tr as pt}from"./Office-BBnd6tyn.js";import{i as mt,r as ht,t as F}from"./billboardLayout-DSKGXPIM.js";var I=n(e(),1),gt=new Map,_t=new Map;function vt(e,t){let n=(0,I.useRef)(t);n.current=t,(0,I.useEffect)(()=>{let t=e=>n.current(e);return gt.set(e,t),()=>{gt.get(e)===t&>.delete(e)}},[e])}function L(e,t){let n=(0,I.useRef)(t);n.current=t,(0,I.useEffect)(()=>{let t=()=>n.current();return _t.set(e,t),()=>{_t.get(e)===t&&_t.delete(e)}},[e])}function yt(e){let t=e.indexOf(`:`);gt.get(t<0?e:e.slice(0,t))?.(t<0?``:e.slice(t+1))}var bt=()=>Object.fromEntries([..._t].map(([e,t])=>[e,t()]));function xt(){let[,e,t]=nt(.5),n=Math.hypot(e,t);return[0,-t/n,e/n]}var St=e=>2*Math.PI*(e-.5);function Ct(e,t,n=xt()){let r=St(t),i=Math.cos(r),a=Math.sin(r),[o,s,c]=n,[l,u,d]=e,f=o*l+s*u+c*d;return[l*i+(s*d-c*u)*a+o*f*(1-i),u*i+(c*l-o*d)*a+s*f*(1-i),d*i+(o*u-s*l)*a+c*f*(1-i)]}function wt(e){let[t,n,r]=nt(e);return[-t,-n,-r]}function Tt(e){let t=e=>Math.round(e*1800/Math.PI)/10;return{yaw:t(Math.atan2(-e[0],-e[2])),pitch:t(Math.asin(Math.max(-1,Math.min(1,e[1]))))}}var Et=[`The Coffee Mug`,`The Rubber Duck`,`The Merge Arrow`,`The Little Bug`,`The Gong`,`The Roomba`,`The Sticky Note`,`The Keyboard`],Dt=9*Math.PI/180,Ot=22*Math.PI/180,kt=[.9,0,.1],At=.17,jt=(e,t)=>Math.acos(Math.min(1,Math.max(-1,e[0]*t[0]+e[1]*t[1]+e[2]*t[2])));function Mt(e=6,t=ft(700)){let n=t.sizes.length,r=e=>[t.positions[e*3],t.positions[e*3+1],t.positions[e*3+2]],i=xt(),a=e=>kt.every(t=>Ct(r(e),t,i)[1]>At),o=Array.from({length:n},(e,t)=>t).filter(e=>t.sizes[e]>=3&&a(e)).sort((e,n)=>t.sizes[n]-t.sizes[e]||Ct(r(n),0,i)[1]-Ct(r(e),0,i)[1]),s=new Set,c=[];for(let i of o){if(c.length>=e)break;if(s.has(i)||c.some(e=>jt(r(e.stars[0]),r(i))<Ot))continue;let a=Array.from({length:n},(e,t)=>t).filter(e=>e!==i&&!s.has(e)&&jt(r(e),r(i))<Dt).sort((e,t)=>jt(r(e),r(i))-jt(r(t),r(i))).slice(0,5);if(a.length<3)continue;let o=[i,...a.sort((e,n)=>t.sizes[n]-t.sizes[e])],l=[],u=new Set([i]);for(;u.size<o.length;){let e=null,t=1/0;for(let n of u)for(let i of o){if(u.has(i))continue;let a=jt(r(n),r(i));a<t&&(t=a,e=[n,i])}l.push(e),u.add(e[1])}let d=o.reduce((e,t)=>[e[0]+r(t)[0],e[1]+r(t)[1],e[2]+r(t)[2]],[0,0,0]),f=Math.hypot(...d);for(let e of o)s.add(e);c.push({name:Et[c.length%Et.length],stars:o,lines:l,centre:[d[0]/f,d[1]/f,d[2]/f]})}return c}var Nt=null,Pt=()=>Nt??=Mt(),R=t(),z={w:1024,h:512},Ft=Math.round(z.w*F.h/F.w),It=null,Lt=()=>It??=at();function Rt(e,t,n){let r=t%2*z.w,i=Math.floor(t/2)*z.h,a=z.w,o=Ft;e.fillStyle=`#2b2d42`,e.fillRect(r,i,a,o),e.fillStyle=n.bg,le(e,r+14,i+14,a-28,o-28,26),e.fill(),e.fillStyle=`rgba(255,255,255,0.75)`;for(let t=0;t<24;t++){let n=(t+.5)/24;for(let t of[i+30,i+o-30])e.beginPath(),e.arc(r+40+n*(a-80),t,6,0,Math.PI*2),e.fill()}e.fillStyle=n.fg,e.textAlign=`center`,e.textBaseline=`middle`,e.font=`700 54px ${fe}`,e.fillText(n.top,r+a/2,i+92,a-120),e.font=`800 176px ${fe}`,e.fillText(n.big,r+a/2,i+o/2+18,a-120),e.font=`600 46px ${fe}`,e.fillText(n.under,r+a/2,i+o-82,a-120)}function zt(){let e=x(e=>e.repos),t=x(e=>e.agents),n=x(e=>e.qa),r=x(e=>e.settings.companyName);return(0,I.useMemo)(()=>{let i=Object.values(t).filter(e=>e.role!==`ceo`);return{company:r,floors:e.length,agents:i.length,working:i.filter(e=>e.status===`working`||e.status===`preparing`).length,issues:e.reduce((e,t)=>e+t.issues.length,0),openPrs:e.reduce((e,t)=>e+t.pulls.filter(e=>e.state===`OPEN`).length,0),inQa:e.reduce((e,t)=>e+pe(t,n).inQa,0),merged:e.reduce((e,t)=>e+t.pulls.filter(e=>e.state===`MERGED`).length,0)}},[e,t,n,r])}function Bt(e){let t=e%2*.5,n=1-Math.floor(e/2)*.5;return{u0:t,u1:t+.5,v1:n,v0:n-Ft/(z.h*2)}}function Vt({top:e}){let t=ee(e),n=(0,I.useMemo)(()=>ht(Lt(),{x:v.x,y:t+v.eye,z:v.z}),[t]),r=zt(),i=(0,I.useMemo)(()=>mt(r),[r]),a=JSON.stringify(i),o=et(z.w*2,z.h*2,e=>i.forEach((t,n)=>Rt(e,n,t)),[a]),s=(0,I.useMemo)(()=>{let e=[],t=[];return n.forEach((n,r)=>{let i=(e,t,r,i)=>e.translate(t,r,i).rotateY(n.yaw).translate(n.x,n.y,n.z),a=new je(F.w,F.h),{u0:o,u1:s,v0:c,v1:l}=Bt(r%4),u=a.attributes.uv;for(let e=0;e<u.count;e++)u.setXY(e,o+u.getX(e)*(s-o),c+u.getY(e)*(l-c));e.push(i(a,0,0,.2)),t.push(i(new k(F.w+.4,F.h+.4,.15),0,0,0)),t.push(i(new k(F.w,.12,.9),0,-F.h/2-.1,.5));let d=n.y-F.h/2-n.top;for(let e of[-F.w/3,F.w/3])t.push(i(new k(.3,d,.3),e,-F.h/2-d/2,-.1))}),{faces:N(e),frames:N(t)}},[n]);(0,I.useEffect)(()=>()=>Object.values(s).forEach(e=>e.dispose()),[s]);let c=(0,I.useMemo)(()=>({face:new Me({map:o,fog:!1,toneMapped:!1,polygonOffset:!0,polygonOffsetFactor:-2}),frame:new Me({color:`#3d405b`,fog:!1})}),[o]);return(0,I.useEffect)(()=>()=>Object.values(c).forEach(e=>e.dispose()),[c]),L(`billboards`,()=>n.map((e,n)=>{let r={x:e.x-v.x,y:e.y-t-v.eye,z:e.z-v.z},a=Math.hypot(r.x,r.y,r.z);return{x:Math.round(e.x),z:Math.round(e.z),dist:Math.round(e.dist),says:`${i[n%4].top}: ${i[n%4].big}`,...Tt([r.x/a,r.y/a,r.z/a])}})),(0,R.jsxs)(`group`,{position:[0,-t-.03,0],children:[(0,R.jsx)(`mesh`,{geometry:s.frames,material:c.frame}),(0,R.jsx)(`mesh`,{geometry:s.faces,material:c.face})]})}var Ht=new Map;function Ut(e,t,n,r,i=!0){let a=Ht.get(e);if(a)return a;let o=document.createElement(`canvas`);return o.width=t,o.height=n,r(o.getContext(`2d`)),a=new Pe(o),a.colorSpace=Se,a.anisotropy=8,i&&(a.wrapS=a.wrapT=Fe),Ht.set(e,a),a}function Wt(e){let t=e>>>0;return()=>(t=t*1664525+1013904223>>>0,t/4294967296)}var Gt=()=>Ut(`paving`,256,256,e=>{e.fillStyle=`#d6d0c4`,e.fillRect(0,0,256,256);let t=Wt(3);for(let n=0;n<260;n++)e.fillStyle=t()<.5?`rgba(255,255,255,0.18)`:`rgba(90,80,70,0.08)`,e.fillRect(t()*256,t()*256,2+t()*3,2+t()*3);e.fillStyle=`#b3ab9d`,e.fillRect(0,0,256,4),e.fillRect(0,0,4,256)}),Kt=()=>Ut(`decking`,512,512,e=>{let t=Wt(7);for(let n=0;n<8;n++){let r=n*64,i=150+Math.floor(t()*30);e.fillStyle=`rgb(${i+40},${i-20},${i-75})`,e.fillRect(0,r,512,64),e.strokeStyle=`rgba(80,40,10,0.18)`,e.lineWidth=2;for(let n=0;n<4;n++){let n=r+8+t()*48;e.beginPath(),e.moveTo(0,n),e.bezierCurveTo(170,n+(t()-.5)*8,340,n+(t()-.5)*8,512,n),e.stroke()}e.fillStyle=`#5b3a24`,e.fillRect(0,r,512,4);let a=(n%2?.3:.75)*512;e.fillRect(a,r,4,64)}}),qt=()=>Ut(`helipad`,1024,1024,e=>{e.fillStyle=`#4a4f5a`,e.beginPath(),e.arc(512,512,508,0,Math.PI*2),e.fill(),e.strokeStyle=`#ffd166`,e.lineWidth=34,e.beginPath(),e.arc(512,512,440,0,Math.PI*2),e.stroke(),e.strokeStyle=`#f8f9fa`,e.lineWidth=10,e.setLineDash([60,40]),e.beginPath(),e.arc(512,512,495,0,Math.PI*2),e.stroke(),e.setLineDash([]),e.fillStyle=`#f8f9fa`,e.fillRect(322,282,70,460),e.fillRect(632,282,70,460),e.fillRect(322,477,380,70)},!1),Jt=()=>Ut(`stripes`,128,8,e=>{for(let t=0;t<4;t++)e.fillStyle=t%2?`#ffffff`:`#c9c9c9`,e.fillRect(t*32,0,32,8)}),Yt=()=>Ut(`windsock`,8,128,e=>{for(let t=0;t<5;t++)e.fillStyle=t%2?`#ffffff`:`#ff7b39`,e.fillRect(0,t*128/5,8,26.6)}),Xt=[`#e63946`,`#3a86ff`,`#ffb703`,`#2a9d8f`],Zt=.45,B=[0,.22,.12],V=[0,.45,-.42],H=[0,B[1]+.86*Math.cos(.5),B[2]+.86*Math.sin(.5)],Qt=.28,$t=.31,en=[0,.98,.3],tn=.42,nn=(e,t)=>[e[0]+t[0],e[1]+t[1],e[2]+t[2]];function U(e,t,n=.045){let r=new C(...e),i=new C(...t).clone().sub(r),a=new k(n,n,i.length());return a.applyQuaternion(new Oe().setFromUnitVectors(new C(0,0,1),i.normalize())),a.translate((e[0]+t[0])/2,(e[1]+t[1])/2,(e[2]+t[2])/2)}function rn(e,t,n){let r=new xe,i=[e[0]-Qt,e[1],e[2],e[0]+Qt,e[1],e[2],t[0]-Qt,t[1],t[2],t[0]+Qt,t[1],t[2]];return r.setAttribute(`position`,new T(i,3)),r.setAttribute(`uv`,new T([0,0,1,0,0,1,1,1],2)),r.setAttribute(`color`,new T(Array.from({length:4},()=>[n.r,n.g,n.b]).flat(),3)),r.setIndex([0,2,1,1,2,3]),r.computeVertexNormals(),r}function an(){let e=[],t=[];b.xs.forEach((n,r)=>{let i=g(r),a=e=>[e[0]+i.x,e[1],e[2]+i.z];for(let t of[-.31,$t]){let n=[t,0,0];e.push(U(a(nn(V,n)),a(nn(B,n)))),e.push(U(a(nn(B,n)),a(nn(H,n)))),e.push(U(a([t,0,V[2]]),a([t,V[1]+.02,V[2]]))),e.push(U(a([t,0,.62]),a([t,.64,.34]))),e.push(U(a([t*1.07,.56,-.48]),a([t*1.07,.56,.2]),.07)),e.push(U(a([t*1.07,.56,-.44]),a([t,.3,-.42])))}e.push(U(a([-.31,H[1],H[2]]),a([$t,H[1],H[2]]),.06)),e.push(U(a([-.31,V[1],V[2]]),a([$t,V[1],V[2]]),.06));let o=new w(Xt[r%Xt.length]);t.push(rn(a(V),a(B),o),rn(a(B),a(H),o))});let n=N(ue.flatMap(e=>[new S(e.r,e.r,.05,20).translate(e.x,.55,e.z),new S(.04,.05,.53,8).translate(e.x,.27,e.z),new S(.2,.22,.03,16).translate(e.x,.015,e.z)]));return{frame:N(e),canvas:N(t),tables:n}}var on=(e,t=Date.now())=>Ge(t).some(n=>n.kind===`break`&&n.chair===e&&ze(n,t)!==`down`);function sn({i:e}){let t=g(e),n=tt({id:`deckchair-${e}`,label:`Sit back in the deck chair`,action:{kind:`roof`,op:`chair:${e}`}},3);return(0,R.jsx)(`mesh`,{ref:n,position:[t.x,.5,t.z+.05],visible:!1,children:(0,R.jsx)(`boxGeometry`,{args:[b.w,1,b.l]})})}function cn(e){if(e<0||e>=b.xs.length)return;let t=x.getState();if(P.getState().sitting===e)return;if(on(e)){t.pushToast(`info`,`🪑 Someone's sitting there: try another chair`);return}let n=g(e);ot({id:`deckchair-${e}`,x:n.x+en[0],y:en[1],z:n.z+en[2],tilt:tn,look:1,minPitch:-.95,maxPitch:1.1,exit:_e(e),yaw:0,pitch:.05,onLeave:()=>{P.getState().sitting===e&&P.setState({sitting:null})}}),P.setState({sitting:e,telescope:!1}),Ie({x:n.x,y:.4,z:n.z})}function ln(){let e=(0,I.useMemo)(an,[]);(0,I.useEffect)(()=>()=>Object.values(e).forEach(e=>e.dispose()),[e]);let t=(0,I.useMemo)(()=>new O({map:Jt(),vertexColors:!0,side:2}),[]);return(0,I.useEffect)(()=>()=>t.dispose(),[t]),vt(`chair`,e=>cn(Number(e))),L(`chairs`,()=>b.xs.map((e,t)=>P.getState().sitting===t?`you`:on(t)?`taken`:`free`)),(0,R.jsxs)(`group`,{children:[(0,R.jsx)(`mesh`,{geometry:e.frame,material:j(`#c08552`),castShadow:!0,children:(0,R.jsx)(A,{thickness:.012,color:`#1f1d2b`})}),(0,R.jsx)(`mesh`,{geometry:e.canvas,material:t,castShadow:!0,receiveShadow:!0}),(0,R.jsx)(`mesh`,{geometry:e.tables,material:j(`#e9ecef`),castShadow:!0,receiveShadow:!0}),b.xs.map((e,t)=>(0,R.jsx)(sn,{i:t},t))]})}var un=`#1f1d2b`;function dn(e){let t=e>>>0;return()=>(t=t*1664525+1013904223>>>0,t/4294967296)}var fn=e=>({x:(e.minX+e.maxX)/2,z:(e.minZ+e.maxZ)/2,w:e.maxX-e.minX,d:e.maxZ-e.minZ,h:e.h??.6});function pn(){let e=dn(21),t=[],n=[],r=[],i=[],a=[],o=[],s=[];u.forEach((c,l)=>{let{x:u,z:d,w:f,d:p,h:m}=fn(c);t.push({size:[f,m-.06,p],at:[u,(m-.06)/2,d]}),t.push({size:[f+.08,.06,p+.08],at:[u,m-.03,d]}),n.push({size:[f-.12,.04,p-.12],at:[u,m-.02,d]});let h=m,g=(t,n)=>{for(let r=0;r<t;r++)n(u-f/2+.35+r*(f-.7)/Math.max(1,t-1),d+(e()-.5)*.25,r)};if(l===2)for(let e of[-.22,.22])g(Math.round(f/.55),(t,n,i)=>r.push(new D(.17+i%3*.02,10,7).scale(1,.6,1).translate(t,h+.08,d+e)));else l===1?g(Math.round(f/.9),(t,n)=>{s.push(new S(.015,.015,1.1,5).translate(t,h+.55,n)),i.push(new D(.28,10,8).scale(1,1.35,1).translate(t,h+.5,n));for(let r=0;r<4;r++)a.push(new D(.06,8,6).translate(t+(e()-.5)*.4,h+.3+e()*.5,n+(e()<.5?-.24:.24)))}):g(Math.round(f/.8),(t,n)=>{let a=1.2+e()*.5;s.push(new S(.025,.03,a,6).translate(t,h+a/2,n+.2)),r.push(new D(.12,8,6).scale(1.6,.4,1).translate(t+.08,h+a*.5,n+.2)),o.push(new S(.24,.24,.04,14).rotateX(Math.PI/2).translate(t,h+a,n+.18)),s.push(new S(.11,.11,.06,12).rotateX(Math.PI/2).translate(t,h+a,n+.21)),i.push(new Ae(.12,.3,7).translate(t+.25,h+.15,n-.22))})});for(let e of se)t.push({size:[e.w,e.h-.06,e.w],at:[e.x,(e.h-.06)/2,e.z]}),t.push({size:[e.w+.08,.06,e.w+.08],at:[e.x,e.h-.03,e.z]}),n.push({size:[e.w-.12,.04,e.w-.12],at:[e.x,e.h-.02,e.z]}),s.push(new S(.07,.1,1.5,8).translate(e.x,e.h+.75,e.z)),i.push(new D(.75,14,10).translate(e.x,e.h+1.75,e.z)),r.push(new D(.5,12,8).translate(e.x+.45,e.h+1.45,e.z+.2)),r.push(new D(.45,12,8).translate(e.x-.4,e.h+1.5,e.z-.25));return{wood:M(t),soil:M(n),leaves:N(r),dark:N(i),red:N(a),yellow:N(o),brown:N(s)}}function mn(){let{x:e,z:t,r:n,legs:r,h:i}=be,a=[],o=n*.75;for(let n of[-o,o])for(let i of[-o,o])a.push({size:[.16,r,.16],at:[e+n,r/2,t+i]});for(let n of[.5,1.4])a.push({size:[2*o,.08,.08],at:[e,n,t-o]}),a.push({size:[2*o,.08,.08],at:[e,n,t+o]}),a.push({size:[.08,.08,2*o],at:[e-o,n,t]}),a.push({size:[.08,.08,2*o],at:[e+o,n,t]});a.push({size:[2*o+.4,.12,2*o+.4],at:[e,r-.06,t]});for(let o of[-.22,.22])a.push({size:[.06,r+i*.8,.06],at:[e+o,(r+i*.8)/2,t+n+.12]});for(let o=1;o<9;o++)a.push({size:[.44,.04,.04],at:[e,o*(r+i*.8)/9,t+n+.12]});let s=new S(n,n*1.04,i,24).translate(e,r+i/2,t),c=N([.25,.55,.85].map(a=>new we(n*1.03+.02,.035,6,32).rotateX(Math.PI/2).translate(e,r+i*a,t))),l=new Ae(n*1.12,.9,24).translate(e,r+i+.45,t);return{stand:M(a),tank:s,hoops:c,hat:l}}function hn(){let{x:e,z:t,w:n,d:r,h:i}=ne,a=[{size:[n,.07,.8],at:[e,i,t]}];for(let i of[-1,1])a.push({size:[n,.06,.3],at:[e,.44,t+i*(r/2-.15)]});let o=[];for(let a of[-n/2+.25,n/2-.25])o.push({size:[.08,.06,r-.1],at:[e+a,.38,t]}),o.push({size:[.08,i,.08],at:[e+a,i/2,t-.3]}),o.push({size:[.08,i,.08],at:[e+a,i/2,t+.3]});return{top:M(a),legs:M(o)}}function gn(){let e=(0,I.useMemo)(pn,[]),t=(0,I.useMemo)(mn,[]),n=(0,I.useMemo)(hn,[]);return(0,I.useEffect)(()=>()=>[...Object.values(e),...Object.values(t),...Object.values(n)].forEach(e=>e.dispose()),[e,t,n]),(0,R.jsxs)(`group`,{children:[(0,R.jsx)(`mesh`,{geometry:e.wood,material:j(`#b07d4f`),castShadow:!0,receiveShadow:!0,children:(0,R.jsx)(A,{thickness:.02,color:un})}),(0,R.jsx)(`mesh`,{geometry:e.soil,material:j(`#5e4433`),receiveShadow:!0}),(0,R.jsx)(`mesh`,{geometry:e.leaves,material:j(`#80c45c`),castShadow:!0}),(0,R.jsx)(`mesh`,{geometry:e.dark,material:j(`#3f9b4f`),castShadow:!0}),(0,R.jsx)(`mesh`,{geometry:e.red,material:j(`#e63946`)}),(0,R.jsx)(`mesh`,{geometry:e.yellow,material:j(`#ffc93c`),castShadow:!0}),(0,R.jsx)(`mesh`,{geometry:e.brown,material:j(`#7a5a3c`),castShadow:!0}),(0,R.jsx)(`mesh`,{geometry:t.stand,material:j(`#5e4a3c`),castShadow:!0}),(0,R.jsx)(`mesh`,{geometry:t.tank,material:j(`#a8744a`),castShadow:!0,receiveShadow:!0,children:(0,R.jsx)(A,{thickness:.025,color:un})}),(0,R.jsx)(`mesh`,{geometry:t.hoops,material:j(`#495057`)}),(0,R.jsx)(`mesh`,{geometry:t.hat,material:j(`#6b4a33`),castShadow:!0,children:(0,R.jsx)(A,{thickness:.025,color:un})}),(0,R.jsx)(`mesh`,{geometry:n.top,material:j(`#c9905a`),castShadow:!0,receiveShadow:!0,children:(0,R.jsx)(A,{thickness:.018,color:un})}),(0,R.jsx)(`mesh`,{geometry:n.legs,material:j(`#8a5a32`),castShadow:!0})]})}var W={cook:7,char:30},_n=()=>({since:null,turns:0});function G(e,t){if(e.since===null)return`idle`;let n=t-e.since;return n<W.cook?`cooking`:n<W.cook+W.char?`ready`:`charred`}function vn(e,t){if(e.since===null)return 0;let n=Math.max(0,t-e.since);return n<W.cook?n/W.cook:1+Math.min(1,(n-W.cook)/W.char)}function yn(e,t){let n=G(e,t);return n===`cooking`?1:n===`idle`?0:.35}function bn(e,t,n){let r=G(e,t);return r===`cooking`?{op:`turn`,grill:{...e,turns:e.turns+1}}:n?{op:`full`,grill:e}:r===`idle`?{op:`start`,grill:{since:t,turns:0}}:{op:`take`,grill:_n()}}function xn(e){return e===`idle`?`Grill a sausage`:e===`cooking`?`Turn the sausage`:e===`charred`?`Take the (charred) sausage`:`Take the sausage`}var Sn=`#1f1d2b`,Cn=.86,wn=new w(`#e9a0a0`),Tn=new w(`#b5532c`),En=new w(`#3b2922`),Dn=14,On=2.2,kn=1,An={x:a.x,y:Cn,z:a.z};function jn(e){d({name:`grill-sizzle`,group:`toys`,pos:An,dur:.06+Math.random()*.22,peak:(.012+Math.random()*.03)*e,filter:`highpass`,freq:2600+Math.random()*3800,attack:.004}),Math.random()<.18*e&&d({name:`grill-pop`,group:`toys`,pos:An,dur:.03,peak:.05*e,filter:`bandpass`,freq:1500+Math.random()*1500,q:2,attack:.001})}function Mn(){d({name:`grill-hiss`,group:`toys`,pos:An,dur:.9,peak:.07,filter:`highpass`,freq:3200,to:5200,attack:.01})}function Nn(){d({name:`grill-bun`,group:`toys`,pos:An,dur:.12,peak:.04,filter:`lowpass`,freq:700,attack:.01}),ae({name:`grill-bun`,group:`toys`,pos:An,freq:880,to:1320,type:`triangle`,dur:.12,peak:.03})}function Pn(){return{bowl:new D(a.r,24,12,0,Math.PI*2,Math.PI/2,Math.PI/2),lid:new D(a.r*1.02,24,12,0,Math.PI*2,0,Math.PI/2),coals:new Ce(a.r*.85,24).rotateX(-Math.PI/2),puff:new D(.11,10,8)}}function Fn(){let[e,t]=(0,I.useState)(_n),n=(0,I.useRef)(e);n.current=e;let r=(0,I.useMemo)(Pn,[]);(0,I.useEffect)(()=>()=>Object.values(r).forEach(e=>e.dispose()),[r]);let i=(0,I.useMemo)(()=>({sausage:new O({color:wn.clone()}),coals:new Me({color:`#ff6b2c`,toneMapped:!1}),smoke:new Me({color:`#e9ecef`,transparent:!0,opacity:.38,depthWrite:!1})}),[]);(0,I.useEffect)(()=>()=>Object.values(i).forEach(e=>e.dispose()),[i]);let o=(0,I.useRef)(null),s=(0,I.useRef)(null),c=(0,I.useMemo)(()=>({nextCrackle:0,m:new Ne,state:``}),[]),l=()=>performance.now()/1e3,u=G(e,l()),d=tt({id:`grill`,label:xn(u),action:{kind:`roof`,op:`grill`}},3);return E(()=>{let e=l(),r=n.current,u=G(r,e);u!==c.state&&(c.state=u,P.setState({grill:u}),t({...r}));let d=vn(r,e);d<=1?i.sausage.color.lerpColors(wn,Tn,d):i.sausage.color.lerpColors(Tn,En,d-1);let f=yn(r,e);i.coals.color.setRGB(1,.32+.12*Math.sin(e*7)*Math.sin(e*3.1),.08).multiplyScalar(.55+.45*Math.max(f,.3)),o.current&&(o.current.visible=r.since!==null,o.current.rotation.x=r.turns*Math.PI+(f>.5?Math.sin(e*9)*.03:0)),f>0&&e>=c.nextCrackle&&(jn(f),c.nextCrackle=e+(f>.5?.06+Math.random()*.1:.25+Math.random()*.5));let p=s.current;if(p&&(p.visible=f>0,p.visible)){for(let t=0;t<Dn;t++){let n=(e/On+t/Dn)%1,r=(.4+n*1.6)*(t/Dn<f),i=n*n*.9;c.m.makeScale(r,r,r).setPosition(a.x+Math.sin(t*2.3+e*.7)*.12*n,1.01+n*1.6,a.z+i),p.setMatrixAt(t,c.m)}p.instanceMatrix.needsUpdate=!0,i.smoke.opacity=.32*Math.min(1,f+.2)}}),vt(`grill`,()=>{let e=x.getState(),r=l(),{op:i,grill:a}=bn(n.current,r,e.held!==null);if(i===`full`){e.pushToast(`info`,e.held?.kind===`sausage`?`🌭 One at a time: eat that one first (E)`:`🙌 Your hands are full`);return}let o=n.current;n.current=a,t(a),(i===`start`||i===`turn`)&&Mn(),i===`take`&&(Nn(),e.setHeld({kind:`sausage`,id:`sausage-${kn++}`,bites:3,charred:G(o,r)===`charred`}))}),L(`grill`,()=>{let e=l();return{state:G(n.current,e),doneness:Math.round(vn(n.current,e)*100)/100,turns:n.current.turns,sizzle:yn(n.current,e)}}),(0,R.jsxs)(`group`,{children:[(0,R.jsxs)(`group`,{ref:d,children:[(0,R.jsxs)(`group`,{position:[a.x,Cn,a.z],children:[(0,R.jsx)(`mesh`,{geometry:r.bowl,material:j(`#2b2d42`),castShadow:!0,children:(0,R.jsx)(A,{thickness:.015,color:Sn})}),(0,R.jsx)(`mesh`,{geometry:r.coals,position:[0,-.08,0],material:i.coals}),(0,R.jsx)(`mesh`,{position:[0,.01,0],rotation:[-Math.PI/2,0,0],material:j(`#adb5bd`),children:(0,R.jsx)(`ringGeometry`,{args:[a.r*.88,a.r*.95,24]})}),[-.24,-.12,0,.12,.24].map(e=>(0,R.jsx)(`mesh`,{position:[e,.01,0],material:j(`#adb5bd`),children:(0,R.jsx)(`boxGeometry`,{args:[.012,.012,Math.sqrt(a.r*a.r*.85-e*e)*2]})},e)),(0,R.jsx)(`group`,{position:[0,0,a.r],rotation:[1.75,0,0],children:(0,R.jsx)(`mesh`,{geometry:r.lid,position:[0,0,-a.r],material:j(`#2b2d42`),castShadow:!0,children:(0,R.jsx)(A,{thickness:.015,color:Sn})})}),[0,1,2].map(e=>{let t=e/3*Math.PI*2+.5;return(0,R.jsx)(`mesh`,{position:[Math.cos(t)*.28,-.86/2-.05,Math.sin(t)*.28],rotation:[Math.sin(t)*.25,0,-Math.cos(t)*.25],material:j(`#495057`),castShadow:!0,children:(0,R.jsx)(`cylinderGeometry`,{args:[.022,.022,.91,6]})},e)}),(0,R.jsxs)(`group`,{ref:o,position:[.04,.05,0],rotation:[0,.3,0],visible:!1,children:[(0,R.jsx)(`mesh`,{rotation:[0,0,Math.PI/2],material:i.sausage,castShadow:!0,children:(0,R.jsx)(`capsuleGeometry`,{args:[.035,.2,4,10]})}),[-.06,0,.06].map(e=>(0,R.jsx)(`mesh`,{position:[e,-.03,0],material:j(`#5a2d1a`),children:(0,R.jsx)(`boxGeometry`,{args:[.012,.012,.072]})},e))]})]}),(0,R.jsxs)(`group`,{position:[a.x+a.shelf,0,a.z],children:[(0,R.jsxs)(`mesh`,{position:[0,.78,0],material:j(`#c9905a`),castShadow:!0,children:[(0,R.jsx)(`boxGeometry`,{args:[.6,.05,.5]}),(0,R.jsx)(A,{thickness:.012,color:Sn})]}),[-.25,.25].map(e=>[-.2,.2].map(t=>(0,R.jsx)(`mesh`,{position:[e,.38,t],material:j(`#8a5a32`),children:(0,R.jsx)(`boxGeometry`,{args:[.04,.76,.04]})},`${e}${t}`))),(0,R.jsx)(`mesh`,{position:[-.08,.86,0],material:j(`#d4a373`),children:(0,R.jsx)(`boxGeometry`,{args:[.3,.1,.22]})}),[-.05,.05].map(e=>(0,R.jsx)(`mesh`,{position:[-.08,.93,e],rotation:[0,0,Math.PI/2],material:j(`#f2c38b`),children:(0,R.jsx)(`capsuleGeometry`,{args:[.04,.14,4,8]})},e)),(0,R.jsx)(`mesh`,{position:[.17,.89,.1],material:j(`#d62828`),castShadow:!0,children:(0,R.jsx)(`cylinderGeometry`,{args:[.035,.04,.17,10]})}),(0,R.jsx)(`mesh`,{position:[.17,.99,.1],material:qe(`#f8f9fa`),children:(0,R.jsx)(`coneGeometry`,{args:[.02,.05,8]})})]})]}),(0,R.jsx)(`instancedMesh`,{ref:s,args:[r.puff,i.smoke,Dn],frustumCulled:!1,visible:!1,renderOrder:3})]})}var K={x:.17,y:-.15,z:-.42,tilt:-.5,turn:.7},In={x:.03,y:-.07,z:-.24,tilt:-.15,turn:1.35},Ln=`#1f1d2b`;function Rn(){let e=x(e=>e.held?.kind===`sausage`?e.held:null),t=(0,I.useRef)(null),n=(0,I.useRef)(null);if(E(({camera:e})=>{let r=t.current,i=n.current;if(!r||!i)return;r.position.copy(e.position),r.quaternion.copy(e.quaternion);let a=Be.lift,o=performance.now()/1e3;i.position.set(K.x+(In.x-K.x)*a,K.y+(In.y-K.y)*a+Math.sin(o*1.6)*.003*(1-a),K.z+(In.z-K.z)*a),i.rotation.set(K.tilt+(In.tilt-K.tilt)*a,K.turn+(In.turn-K.turn)*a,0,`YXZ`)}),!e)return null;let r=Math.max(.15,e.bites/3),i=.17*r;return(0,R.jsx)(`group`,{ref:t,userData:Ze,children:(0,R.jsx)(`group`,{ref:n,scale:.8,children:(0,R.jsxs)(`group`,{position:[0,0,-.085+i/2],children:[[-1,1].map(e=>(0,R.jsxs)(`mesh`,{position:[e*.026,-.012,0],rotation:[Math.PI/2,0,0],material:j(`#e9b872`),children:[(0,R.jsx)(`capsuleGeometry`,{args:[.026,i,4,10]}),(0,R.jsx)(A,{thickness:.004,color:Ln})]},e)),(0,R.jsxs)(`mesh`,{position:[0,.006,0],rotation:[Math.PI/2,0,0],material:j(e.charred?`#3b2922`:`#b5532c`),children:[(0,R.jsx)(`capsuleGeometry`,{args:[.02,i+.03,4,10]}),(0,R.jsx)(A,{thickness:.004,color:Ln})]}),Array.from({length:Math.max(1,Math.round(5*r))},(e,t)=>(0,R.jsx)(`mesh`,{position:[(t%2?1:-1)*.008,.027,-i/2+.02+t*.032],rotation:[0,(t%2?1:-1)*.9,0],material:j(t%3==2?`#ffc93c`:`#d62828`),children:(0,R.jsx)(`boxGeometry`,{args:[.006,.004,.03]})},t))]})})})}var zn=`#1f1d2b`,{x:q,z:J,t:Y,parapet:X,h:Bn}=me,Z=ce,Vn=1.2;function Hn(e,t,n){let r=new je(e,t).rotateX(-Math.PI/2),i=r.attributes.uv;for(let r=0;r<i.count;r++)i.setXY(r,i.getX(r)*e/n,i.getY(r)*t/n);return r}var Un=[[-q,q,-J,-J+Y],[-q,-q+Y,-J+Y,J-Y],[q-Y,q,-J+Y,J-Y],[-q,Z.minX,J-Y,J],[Z.maxX,q,J-Y,J]];function Wn(){let e=[],t=[],n=[];for(let[r,i,a,o]of Un){let s=i-r,c=o-a,l=(r+i)/2,u=(a+o)/2;e.push({size:[s,X,c],at:[l,X/2,u]}),t.push({size:[s+.06,.07,c+.06],at:[l,X+.035,u]});let d=s>c,f=d?s:c,p=Math.max(1,Math.round(f/1.6));for(let e=0;e<=p;e++){let t=-f/2+e*f/p;n.push({size:[.06,Bn-X,.06],at:[d?l+t:l,X+(Bn-X)/2,d?u:u+t]})}n.push({size:d?[s,.07,.09]:[.09,.07,c],at:[l,Bn,u]}),n.push({size:d?[s,.035,.035]:[.035,.035,c],at:[l,(X+Bn)/2+.05,u]})}return{wall:M(e),cap:M(t),metal:M(n)}}var Q={half:.5,h:2.2};function Gn(e){let{doorHalf:t,doorHeight:n}=m,r=Z.front,i=12+r/2,a=Z.stairX-Q.half,o=Z.stairX+Q.half,s=(e,t,n,a)=>({size:[t-e,a-n,r],at:[(e+t)/2,(n+a)/2,i]}),c=[s(Z.minX,a,0,Z.h),s(a,o,Q.h,Z.h),s(o,-t,0,Z.h),s(-t,t,n,Z.h),s(t,Z.maxX,0,Z.h),{size:[.25,Z.h+e,Z.maxZ-12],at:[Z.minX+.125,(Z.h-e)/2,(12+Z.maxZ)/2]},{size:[.25,Z.h+e,Z.maxZ-12],at:[Z.maxX-.125,(Z.h-e)/2,(12+Z.maxZ)/2]},{size:[Z.maxX-Z.minX,Z.h+e,.25],at:[(Z.minX+Z.maxX)/2,(Z.h-e)/2,Z.maxZ-.125]}],l=[{size:[Z.maxX-Z.minX+.3,.2,Z.maxZ-12+.3],at:[(Z.minX+Z.maxX)/2,Z.h+.1,(12+Z.maxZ)/2]},{size:[1.4,.7,1.1],at:[Z.minX+1.4,Z.h+.55,Z.maxZ-1]},{size:[.9,.5,.9],at:[Z.maxX-.9,Z.h+.45,12.9]}],u=[{size:[Z.maxX-Z.minX+.04,.22,.04],at:[(Z.minX+Z.maxX)/2,Z.h-.5,11.98]},{size:[.08,Q.h+.08,.08],at:[a-.04,Q.h/2,11.98]},{size:[.08,Q.h+.08,.08],at:[o+.04,Q.h/2,11.98]},{size:[Q.half*2+.16,.08,.08],at:[Z.stairX,Q.h+.04,11.98]},{size:[.05,1.6,.05],at:[Z.maxX-.6,Z.h+.2+.8,12.5]}],d=[{size:[Q.half*2,Q.h,.05],at:[Z.stairX,Q.h/2,12.06]}],f=[{size:[.05,.05,.08],at:[Z.stairX+Q.half-.14,1.05,12]},{size:[.5,.04,.04],at:[Z.stairX,1,12.01]}];return{walls:M(c),roof:M(l),trim:M(u),door:M(d),handle:M(f)}}function Kn(){let e=[new k(.3,.14,.12).translate(Z.stairX,Q.h+.35,11.94)];for(let t=0;t<12;t++){let n=t/12*Math.PI*2;e.push(new D(.09,10,6,0,Math.PI*2,0,Math.PI/2).translate(_.x+Math.cos(n)*(_.r+.25),0,_.z+Math.sin(n)*(_.r+.25)))}return N(e)}function qn(){let e=(0,I.useRef)(null),t=(0,I.useMemo)(()=>new S(.2,.09,1.3,16,1,!0).rotateX(Math.PI/2).translate(0,0,.65),[]);(0,I.useEffect)(()=>()=>t.dispose(),[t]);let n=(0,I.useMemo)(()=>new O({map:Yt(),side:2}),[]);return(0,I.useEffect)(()=>()=>n.dispose(),[n]),E(({clock:t})=>{let n=e.current;if(!n)return;let r=t.elapsedTime,i=.5+.5*Math.sin(r*.35)*Math.sin(r*.13+1);n.rotation.set(.55*(1-i)+Math.sin(r*3.1)*.04,Math.sin(r*.27)*.5+Math.sin(r*1.7)*.06,0,`YXZ`)}),(0,R.jsxs)(`group`,{position:[ye.x,0,ye.z],children:[(0,R.jsx)(`mesh`,{position:[0,ye.h/2,0],material:j(`#adb5bd`),castShadow:!0,children:(0,R.jsx)(`cylinderGeometry`,{args:[.045,.06,ye.h,10]})}),(0,R.jsx)(`group`,{ref:e,position:[0,ye.h-.12,0],children:(0,R.jsx)(`mesh`,{geometry:t,material:n,castShadow:!0})})]})}function Jn({top:e}){let t=ee(e),n=(0,I.useMemo)(()=>{let e=p.maxX-p.minX,t=p.maxZ-p.minZ;return{paving:Hn(2*q,2*J,Vn).translate(0,0,0),decking:(()=>{let n=new k(e,.06,t),r=n.attributes.uv;for(let n=0;n<r.count;n++)r.setXY(n,r.getX(n)*e/Vn,r.getY(n)*t/Vn);return n.translate((p.minX+p.maxX)/2,.03,(p.minZ+p.maxZ)/2)})(),helipad:new Ce(_.r,64).rotateX(-Math.PI/2).translate(_.x,.005,_.z),bulbs:Kn()}},[]),r=(0,I.useMemo)(Wn,[]),i=(0,I.useMemo)(()=>Gn(t),[t]);(0,I.useEffect)(()=>()=>[...Object.values(n),...Object.values(r)].forEach(e=>e.dispose()),[n,r]),(0,I.useEffect)(()=>()=>Object.values(i).forEach(e=>e.dispose()),[i]);let a=(0,I.useMemo)(()=>({paving:new O({map:Gt()}),decking:new O({map:Kt()}),helipad:new O({map:qt(),transparent:!0,polygonOffset:!0,polygonOffsetFactor:-2})}),[]);return(0,I.useEffect)(()=>()=>Object.values(a).forEach(e=>e.dispose()),[a]),(0,R.jsxs)(`group`,{children:[(0,R.jsx)(`mesh`,{geometry:n.paving,material:a.paving,receiveShadow:!0}),(0,R.jsx)(`mesh`,{geometry:n.decking,material:a.decking,receiveShadow:!0}),(0,R.jsx)(`mesh`,{geometry:n.helipad,material:a.helipad,receiveShadow:!0}),(0,R.jsx)(`mesh`,{geometry:n.bulbs,material:Xe}),(0,R.jsx)(`mesh`,{geometry:r.wall,material:j(`#c9c2b4`),receiveShadow:!0,castShadow:!0,children:(0,R.jsx)(A,{thickness:.02,color:zn})}),(0,R.jsx)(`mesh`,{geometry:r.cap,material:j(`#ece6da`),receiveShadow:!0}),(0,R.jsx)(`mesh`,{geometry:r.metal,material:j(`#5c677d`),castShadow:!0}),(0,R.jsx)(`mesh`,{geometry:i.walls,material:j(`#efe3cc`),receiveShadow:!0,castShadow:!0,children:(0,R.jsx)(A,{thickness:.02,color:zn})}),(0,R.jsx)(`mesh`,{geometry:i.roof,material:j(`#8d99ae`),castShadow:!0,receiveShadow:!0,children:(0,R.jsx)(A,{thickness:.02,color:zn})}),(0,R.jsx)(`mesh`,{geometry:i.trim,material:j(`#ff8a5b`)}),(0,R.jsx)(`mesh`,{geometry:i.door,material:j(`#2a9d8f`)}),(0,R.jsx)(`mesh`,{geometry:i.handle,material:j(`#dee2e6`)}),(0,R.jsx)(qn,{}),(0,R.jsx)(ct,{top:e})]})}var Yn={x:0,z:11},Xn=[{x:-14.4,z:-4.8},{x:-14.4,z:-1.2}],Zn=null,Qn=()=>Zn??=c([...o(),i()],{planR:ie+.1,lineR:ie+.03,greed:1.3}),$n=(e,t)=>l(Qn(),e,t),er=0,tr=Math.PI/2,nr=.5,rr=.16,ir={every:6,breakChance:.2,callChance:.06,ride:2.5},ar=3e3,or=(e,t)=>$n(e,t)??[t];function sr({agent:e,chair:t}){let n=(0,I.useRef)(null),r=g(t);return E(()=>{let t=n.current;if(!t)return;let r=oe(e.id),i=r?he(r.sit):1;t.rotation.x=Zt*i,t.position.y=nr-rr*i}),(0,R.jsx)(`group`,{position:[r.x,0,r.z],children:(0,R.jsx)(`group`,{ref:n,position:[0,.33999999999999997,0],rotation:[Zt,0,0],children:(0,R.jsx)(`group`,{position:[0,-.5,0],children:(0,R.jsx)(Je,{agent:e})})})})}function cr({agent:e}){return(0,R.jsx)(`group`,{position:[Xn[0].x,0,Xn[0].z],rotation:[0,tr,0],children:(0,R.jsx)(Je,{agent:e})})}function lr(){let e=De(e=>e.camera),t=x(e=>e.agents),[n,r]=(0,I.useState)([]),i=(0,I.useMemo)(()=>new Map,[]),a=(0,I.useMemo)(()=>({roll:ir.every,mounted:Date.now(),dirty:!1}),[]);(0,I.useEffect)(()=>()=>{for(let e of i.keys())re(e),y(e,null);i.clear()},[i]);let o=(e,t)=>{if(!e||!Le(e.status))return!1;let n=e.role===`ceo`?`call`:`break`,r=Ve(Ge(),e.id,n,Date.now(),Math.random(),{chairs:b.xs.length,playerChair:P.getState().sitting,ride:ir.ride,stay:t});return r&&Ue(r),!!r};vt(`visit`,e=>{let[t,n]=e.split(`:`);o(x.getState().agents[t],n?Number(n):void 0)||x.getState().pushToast(`info`,`🛗 No room on the roof for them just now (or they are busy)`)}),L(`visitors`,()=>[...i.values()].map(e=>({id:e.id,name:x.getState().agents[e.id]?.name??e.id,kind:e.kind,chair:e.chair,stage:e.stage,seated:oe(e.id)?.stage===`seated`})));let c=(e,t)=>{a.dirty=!0,t?i.set(e.id,e):i.delete(e.id)},l=(e,t,n)=>{e.stage=`leave`,e.hurry=t,e.path=[...or(n,Yn),Ye],e.wp=0,e.waited=e.ghost=0,y(e.id,null),t&&He(e.id,{leave:Date.now()})},u=(t,n,r,a)=>{let o=oe(t.id);if(!o)return!1;t.wp=Re(t.path,t.wp,o);let c=t.path[t.wp],l=t.wp===t.path.length-1,u=c.x-o.x,d=c.z-o.z,p=Math.hypot(u,d);if(l&&p<.08&&o.speed<.05)return!0;let m=l&&a!==void 0?a:Math.atan2(-u,-d),h=t.hurry?We:ve;if(p>.05&&t.ghost<=0){let a=[...i.values()].filter(e=>e!==t).flatMap(e=>{let t=oe(e.id);return t?[{id:e.id,x:t.x,z:t.z}]:[]}),c=s({id:t.id,x:o.x,z:o.z,dx:u/p,dz:d/p},a,{x:e.position.x,z:e.position.z},(e,t)=>f(Qn().rects,e,t,ie));if(c.wait||c.speed<.15)return t.waited+=n,t.waited>3&&(t.ghost=2),ge(t.id,{mode:`standing`,x:o.x,z:o.z,heading:o.heading,gesture:r}),!1}return t.waited=0,t.ghost=Math.max(0,t.ghost-n),ge(t.id,{mode:`walking`,x:c.x,z:c.z,heading:m,speed:h,gesture:r}),!1};return E((e,t)=>{let n=Math.min(t,.1),s=Date.now(),d=x.getState(),f=it(rt.t)<.5,p=Ge(s);for(let e of p){if(i.has(e.id)||!d.agents[e.id])continue;let t=ze(e,s);if(t===`down`)continue;let n={id:e.id,kind:e.kind,chair:e.chair,stage:`riding`,t:0,path:[],wp:0,leg:0,hold:-1,hurry:!1,waited:0,ghost:0,quietAt:0};t===`up`&&(s-e.arrive>ar||s-a.mounted<1e3)&&(e.kind===`call`?(de(e.id,Xn[0].x,Xn[0].z,tr),ge(e.id,{gesture:`call`}),n.stage=`call`):n.stage=`seated`),c(n,!0)}for(let e of i.values()){let t=d.agents[e.id],r=p.find(t=>t.id===e.id);if(!t||!r&&e.stage===`riding`){re(e.id),c(e,!1);continue}e.t+=n;let i=oe(e.id),o=!Le(t.status),m=!r||s>=r.leave;switch(e.quietAt&&s>e.quietAt&&(y(e.id,null),e.quietAt=0),e.stage){case`riding`:r&&s>=r.arrive&&(de(e.id,Ye.x,Ye.z,er),h({x:0,y:2.6,z:12}),e.stage=`doors`,e.t=0,a.dirty=!0);break;case`doors`:if(e.t<1.2)break;e.path=[Yn,...or(Yn,e.kind===`call`?Xn[0]:_e(e.chair))],e.wp=0,e.hurry=o,e.stage=`walk`;break;case`walk`:o&&!e.hurry&&i?l(e,!0,i):u(e,n,e.kind===`call`?`call`:`none`,e.kind===`call`?tr:er)&&(e.kind===`call`?(e.stage=`call`,e.t=0):(re(e.id),e.stage=`sitting`));break;case`sitting`:i?.stage===`seated`&&(e.stage=`seated`,y(e.id,f?`😎`:`🌙`),e.quietAt=s+3e3);break;case`seated`:(m||o)&&i&&l(e,o,_e(e.chair));break;case`call`:{if((m||o)&&i){l(e,o,i);break}let t=Xn[e.leg];if((!e.path.length||e.path[e.path.length-1]!==t)&&(e.path=[t],e.wp=0),!u(e,n,`call`,tr))break;e.hold<0&&(e.hold=4+Math.random()*5,Math.random()<.6&&(y(e.id,Math.random()<.5?`📞`:`💬`),e.quietAt=s+2500)),e.hold-=n,e.hold<=0&&(e.leg=1-e.leg,e.hold=-1);break}case`leave`:u(e,n,`none`)&&(Ke(e.id),re(e.id),y(e.id,null),c(e,!1))}}if(a.roll-=n,a.roll<=0){a.roll=ir.every;let e=new Set(p.map(e=>e.id)),t=Object.values(d.agents).filter(t=>!e.has(t.id)&&Le(t.status)),n=t.filter(e=>e.role!==`ceo`);n.length&&Math.random()<ir.breakChance&&o(n[Math.floor(Math.random()*n.length)]);let r=t.find(e=>e.role===`ceo`);r&&Math.random()<ir.callChance&&o(r)}a.dirty&&(a.dirty=!1,r([...i.values()].filter(e=>e.stage!==`riding`).map(e=>({id:e.id,kind:e.kind,chair:e.chair}))))}),(0,R.jsx)(`group`,{children:n.map(e=>{let n=t[e.id];return n?e.kind===`call`?(0,R.jsx)(cr,{agent:n},e.id):(0,R.jsx)(sr,{agent:n,chair:e.chair},e.id):null})})}var ur=[[0,3],[1,2],[2,5],[3,4],[0,2],[2,4],[1,3],[3,5]],dr=r.h-.12,fr=.62,pr=[`#fff1c9`,`#fff1c9`,`#ffb86b`,`#ff8fab`,`#8ecae6`,`#fff1c9`,`#b9fbc0`],mr=new w(`#bdb6a6`),hr=new w(`#ffffff`);function gr(e,t,n,r){return Array.from({length:n+1},(i,a)=>{let o=a/n;return new C(e.x+(t.x-e.x)*o,dr-r*4*o*(1-o),e.z+(t.z-e.z)*o)})}function _r(){let e=document.createElement(`canvas`);e.width=e.height=64;let t=e.getContext(`2d`),n=t.createRadialGradient(32,32,0,32,32,32);n.addColorStop(0,`rgba(255,255,255,1)`),n.addColorStop(.25,`rgba(255,255,255,0.55)`),n.addColorStop(1,`rgba(255,255,255,0)`),t.fillStyle=n,t.fillRect(0,0,64,64);let r=new Pe(e);return r.colorSpace=Se,r}function vr(){let e=(0,I.useRef)(null),t=(0,I.useMemo)(()=>{let e=[],t=[];for(let[n,r]of ur){let i=te[n],a=te[r],o=Math.hypot(a.x-i.x,a.z-i.z),s=gr(i,a,24,.12+o*.035);for(let t=0;t<s.length-1;t++)e.push(s[t].x,s[t].y,s[t].z,s[t+1].x,s[t+1].y,s[t+1].z);let c=Math.floor(o/fr);for(let e of gr(i,a,c,.12+o*.035).slice(1,-1))t.push(e.setY(e.y-.07))}let n=new xe;n.setAttribute(`position`,new T(e,3));let i=t.map((e,t)=>new w(pr[t%pr.length])),a=new xe;return a.setAttribute(`position`,new T(t.flatMap(e=>[e.x,e.y,e.z]),3)),a.setAttribute(`color`,new T(i.flatMap(e=>[e.r,e.g,e.b]),3)),{at:t,colors:i,wireGeo:n,haloGeo:a,poles:N(te.flatMap(e=>[new S(r.r,r.r*1.3,r.h,8).translate(e.x,r.h/2,e.z),new D(r.r*1.6,8,6).translate(e.x,r.h,e.z)])),bulbGeo:new D(.055,10,8).scale(1,1.3,1),bulbMat:new Me({color:mr.clone(),toneMapped:!1}),wireMat:new Ee({color:`#2b2d42`}),haloMat:new ke({size:.55,map:_r(),vertexColors:!0,transparent:!0,opacity:0,depthWrite:!1,blending:2,toneMapped:!1}),level:-1}},[]);(0,I.useEffect)(()=>()=>{for(let e of[t.wireGeo,t.haloGeo,t.poles,t.bulbGeo,t.bulbMat,t.wireMat,t.haloMat,t.haloMat.map])e?.dispose()},[t]),(0,I.useEffect)(()=>{let n=e.current;if(!n)return;let r=new Ne;t.at.forEach((e,i)=>{n.setMatrixAt(i,r.makeTranslation(e.x,e.y,e.z)),n.setColorAt(i,t.colors[i])}),n.instanceMatrix.needsUpdate=!0,n.instanceColor&&(n.instanceColor.needsUpdate=!0)},[t]);let n=(0,I.useRef)(null);return E(()=>{let e=Qe();Math.abs(e-t.level)<.004||(t.level=e,t.bulbMat.color.lerpColors(mr,hr,e),t.haloMat.opacity=e*.65,n.current&&(n.current.visible=e>.02))}),(0,R.jsxs)(`group`,{children:[(0,R.jsx)(`mesh`,{geometry:t.poles,material:j(`#3d405b`),castShadow:!0}),(0,R.jsx)(`lineSegments`,{geometry:t.wireGeo,material:t.wireMat}),(0,R.jsx)(`instancedMesh`,{ref:e,args:[t.bulbGeo,t.bulbMat,t.at.length]}),(0,R.jsx)(`points`,{ref:n,geometry:t.haloGeo,material:t.haloMat,visible:!1,renderOrder:2})]})}var yr=72,$=45,br=90*Math.tan(.0358)*1.25,xr=1.36,Sr={yaw:-.7,pitch:.08},Cr=`
|
|
2
|
-
varying vec2 vUv;
|
|
3
|
-
void main() {
|
|
4
|
-
vUv = uv;
|
|
5
|
-
vec4 p = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
6
|
-
gl_Position = p.xyww;
|
|
7
|
-
}`,wr=`
|
|
8
|
-
uniform sampler2D map;
|
|
9
|
-
uniform vec3 color;
|
|
10
|
-
uniform float opacity;
|
|
11
|
-
uniform bool textured;
|
|
12
|
-
varying vec2 vUv;
|
|
13
|
-
void main() {
|
|
14
|
-
vec4 t = textured ? texture2D(map, vUv) : vec4(1.0);
|
|
15
|
-
gl_FragColor = vec4(color * t.rgb, t.a * opacity);
|
|
16
|
-
#include <colorspace_fragment>
|
|
17
|
-
}`,Tr=`
|
|
18
|
-
attribute float aSize;
|
|
19
|
-
uniform float uPixel;
|
|
20
|
-
uniform float uOpacity;
|
|
21
|
-
varying float vAlpha;
|
|
22
|
-
void main() {
|
|
23
|
-
vAlpha = uOpacity * smoothstep(0.0, 0.08, normalize(mat3(modelMatrix) * position).y);
|
|
24
|
-
vec4 p = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
25
|
-
gl_Position = p.xyww;
|
|
26
|
-
gl_PointSize = aSize * uPixel;
|
|
27
|
-
}`,Er=`
|
|
28
|
-
varying float vAlpha;
|
|
29
|
-
void main() {
|
|
30
|
-
float r = length(gl_PointCoord - 0.5);
|
|
31
|
-
float a = max(1.0 - smoothstep(0.1, 0.2, r), (1.0 - smoothstep(0.0, 0.5, r)) * 0.4);
|
|
32
|
-
gl_FragColor = vec4(1.0, 0.97, 0.88, vAlpha * a);
|
|
33
|
-
#include <colorspace_fragment>
|
|
34
|
-
}`;function Dr(e,t,n){return new Te({vertexShader:Cr,fragmentShader:wr,uniforms:{map:{value:e},color:{value:new w(t)},opacity:{value:n},textured:{value:!!e}},transparent:!0,depthWrite:!1})}function Or(e,t,n){let r=document.createElement(`canvas`);r.width=e,r.height=t,n(r.getContext(`2d`));let i=new Pe(r);return i.colorSpace=Se,i.anisotropy=4,i}function kr(){return Or(512,512,e=>{let t=5,n=()=>((t=t*16807%2147483647)-1)/2147483646,r=e.createRadialGradient(256,256,184.5,256,256,256);r.addColorStop(0,`rgba(190,205,255,0.25)`),r.addColorStop(1,`rgba(190,205,255,0)`),e.fillStyle=r,e.fillRect(0,0,512,512);let i=e.createRadialGradient(216,216,10,256,256,205);i.addColorStop(0,`#fbf6e6`),i.addColorStop(.8,`#e9e0c6`),i.addColorStop(1,`#c9bfa4`),e.fillStyle=i,e.beginPath(),e.arc(256,256,205,0,Math.PI*2),e.fill(),e.save(),e.clip();let a=[[-60,-70,70,50,.3],[10,-95,55,40,-.2],[60,-40,60,45,.5],[-95,10,45,75,.2],[-30,25,65,45,-.4],[40,40,40,30,.1],[-120,-40,35,30,0]];e.fillStyle=`rgba(150,143,125,0.55)`;for(let[t,n,r,i,o]of a)e.beginPath(),e.ellipse(256+t,256+n,r,i,o,0,Math.PI*2),e.fill();for(let t=0;t<46;t++){let t=n()*Math.PI*2,r=Math.sqrt(n())*205*.92,i=256+Math.cos(t)*r,a=256+Math.sin(t)*r,o=3+n()**2*18;e.fillStyle=`rgba(120,112,96,0.45)`,e.beginPath(),e.arc(i,a,o,0,Math.PI*2),e.fill(),e.strokeStyle=`rgba(255,252,240,0.7)`,e.lineWidth=Math.max(1,o*.22),e.beginPath(),e.arc(i,a,o,Math.PI*.6,Math.PI*1.6),e.stroke()}e.strokeStyle=`rgba(255,255,250,0.22)`,e.lineWidth=3;for(let t=0;t<14;t++){let r=t/14*Math.PI*2+n()*.2;e.beginPath(),e.moveTo(231,391),e.lineTo(231+Math.cos(r)*(80+n()*120),391+Math.sin(r)*(80+n()*120)),e.stroke()}e.fillStyle=`#fffdf5`,e.beginPath(),e.arc(231,391,9,0,Math.PI*2),e.fill(),e.restore()})}function Ar(e){return Or(512,96,t=>{t.font=`600 44px ${fe}`,t.textAlign=`center`,t.textBaseline=`middle`,t.lineWidth=8,t.strokeStyle=`rgba(8,12,40,0.85)`,t.strokeText(e,256,48),t.fillStyle=`#d7e3ff`,t.fillText(e,256,48)})}function jr({visible:e}){let t=(0,I.useRef)(null),n=(0,I.useRef)(null),r=(0,I.useRef)(null),i=(0,I.useMemo)(()=>{let e=ft(700),t=Pt(),n=t=>new C(e.positions[t*3],e.positions[t*3+1],e.positions[t*3+2]),r=new xe;r.setAttribute(`position`,new T(t.flatMap(e=>e.lines.flatMap(([e,t])=>[...n(e).multiplyScalar($).toArray(),...n(t).multiplyScalar($).toArray()])),3));let i=t.map(e=>{let t=Ar(e.name),n=new C(...e.centre).multiplyScalar($);return{name:e.name,at:n,tex:t,mat:Dr(t,`#ffffff`,.9)}}),a=new C(...xt()),o=new Set(t.flatMap(e=>e.stars)),s=new xe;return s.setAttribute(`position`,new T(Array.from(e.positions,e=>e*$),3)),s.setAttribute(`aSize`,new T(Array.from(e.sizes,(e,t)=>o.has(t)?6+e*1.5:e*2.6),1)),{figures:t,starGeo:s,starMat:new Te({vertexShader:Tr,fragmentShader:Er,uniforms:{uPixel:{value:1},uOpacity:{value:0}},transparent:!0,depthWrite:!1}),lines:r,lineMat:Dr(null,`#9fc3ff`,.6),labels:i,labelGeo:new je(3.6,.68),moonGeo:new je(br,br),moonMat:Dr(kr(),`#ffffff`,1),axis:a,q:new Oe,back:new Oe}},[]);(0,I.useEffect)(()=>()=>{for(let e of[i.lines,i.lineMat,i.starGeo,i.starMat,i.labelGeo,i.moonGeo,i.moonMat,i.moonMat.uniforms.map.value])e.dispose();for(let e of i.labels)e.tex.dispose(),e.mat.dispose()},[i]);let a=(0,I.useRef)([]);return E(({camera:o,gl:s})=>{let c=t.current;if(!c)return;let l=rt.t,u=it(l);if(c.visible=e.current&&u>.3,!c.visible)return;c.position.copy(o.position),i.q.setFromAxisAngle(i.axis,St(l)),n.current?.quaternion.copy(i.q),i.back.copy(i.q).invert();let d=Math.min(1,(u-.3)/.4);i.lineMat.uniforms.opacity.value=.6*d,i.starMat.uniforms.uOpacity.value=d,i.starMat.uniforms.uPixel.value=s.getPixelRatio();for(let[e,t]of i.labels.entries()){let n=a.current[e];n&&(t.mat.uniforms.opacity.value=.9*d,n.quaternion.copy(i.back).multiply(o.quaternion))}let[f,p,m]=wt(l),h=r.current;h&&(h.visible=p>-.03,h.position.set(f*$,p*$,m*$),h.quaternion.copy(o.quaternion),i.moonMat.uniforms.opacity.value=d)}),(0,R.jsxs)(`group`,{ref:t,visible:!1,children:[(0,R.jsx)(`mesh`,{ref:r,geometry:i.moonGeo,material:i.moonMat,frustumCulled:!1,renderOrder:1001}),(0,R.jsxs)(`group`,{ref:n,children:[(0,R.jsx)(`points`,{geometry:i.starGeo,material:i.starMat,frustumCulled:!1,renderOrder:1001}),(0,R.jsx)(`lineSegments`,{geometry:i.lines,material:i.lineMat,frustumCulled:!1,renderOrder:1001}),i.labels.map((e,t)=>(0,R.jsx)(`mesh`,{ref:e=>void(a.current[t]=e),position:e.at,geometry:i.labelGeo,material:e.mat,frustumCulled:!1,renderOrder:1002},e.name))]})]})}function Mr(){let e=De(e=>e.camera),t=(0,I.useRef)(null),n=(0,I.useMemo)(()=>({...Sr}),[]),r=(0,I.useRef)(!1),i=tt({id:`telescope`,label:`Look through the telescope`,action:{kind:`roof`,op:`telescope`}},3),a=()=>{r.current||(ot({id:`telescope`,x:v.x,y:v.eye,z:v.z,tilt:0,look:.9/P.getState().zoom,minPitch:-.5,maxPitch:1.45,exit:{x:v.x,z:v.z+1.05},yaw:n.yaw,pitch:n.pitch,onLeave:()=>P.setState({telescope:!1})}),P.setState({telescope:!0,sitting:null}))},o=e=>{Number.isFinite(e)&&P.setState({zoom:Math.min(st.max,Math.max(st.min,Math.round(e/st.step)*st.step))})};return vt(`telescope`,a),vt(`zoom`,e=>o(Number(e))),L(`telescope`,()=>({yaw:Math.round(n.yaw*180/Math.PI),pitch:Math.round(n.pitch*180/Math.PI),fov:Math.round(e.fov*10)/10})),L(`sky`,()=>{let e=rt.t,t=wt(e);return{night:Math.round(it(e)*100)/100,moon:{...Tt(t),up:t[1]>0},constellations:Pt().map(t=>({name:t.name,stars:t.stars.length,...Tt(Ct(t.centre,e))}))}}),(0,I.useEffect)(()=>{let e=0,t=t=>{r.current&&(e-=t.deltaMode===1?t.deltaY*40:t.deltaY,!(Math.abs(e)<80)&&(o(P.getState().zoom+Math.sign(e)*st.step),e=0))};return window.addEventListener(`wheel`,t,{passive:!0}),()=>window.removeEventListener(`wheel`,t)},[]),(0,I.useEffect)(()=>()=>{lt()?.id===`telescope`&&dt(),e.fov=yr,e.updateProjectionMatrix()},[e]),E((i,a)=>{let o=lt(),s=P.getState();r.current=s.telescope&&o?.id===`telescope`,r.current&&o&&(n.yaw=o.yaw,n.pitch=o.pitch,o.look=.9/s.zoom);let c=t.current;c&&(c.rotation.set(n.pitch,n.yaw,0,`YXZ`),c.visible=!r.current);let l=r.current?yr/s.zoom:yr;e.fov!==l&&(e.fov=Math.abs(l-e.fov)<.05?l:e.fov+(l-e.fov)*(1-Math.exp(-a*12)),e.updateProjectionMatrix())}),(0,R.jsxs)(`group`,{children:[(0,R.jsxs)(`group`,{ref:i,position:[v.x,0,v.z],children:[[0,1,2].map(e=>{let t=e/3*Math.PI*2+.3;return(0,R.jsx)(`mesh`,{position:[Math.cos(t)*.2,xr/2-.05,Math.sin(t)*.2],rotation:[Math.sin(t)*.3,0,-Math.cos(t)*.3],material:j(`#6c757d`),castShadow:!0,children:(0,R.jsx)(`cylinderGeometry`,{args:[.025,.03,1.4100000000000001,8]})},e)}),(0,R.jsx)(`mesh`,{position:[0,.55,0],material:j(`#adb5bd`),children:(0,R.jsx)(`cylinderGeometry`,{args:[.16,.16,.03,12]})}),(0,R.jsx)(`mesh`,{position:[0,1.3,0],material:j(`#343a40`),castShadow:!0,children:(0,R.jsx)(`boxGeometry`,{args:[.14,.16,.14]})}),(0,R.jsxs)(`group`,{ref:t,position:[0,1.4400000000000002,0],children:[(0,R.jsxs)(`mesh`,{position:[0,0,-.15],rotation:[Math.PI/2,0,0],material:j(`#f8f9fa`),castShadow:!0,children:[(0,R.jsx)(`cylinderGeometry`,{args:[.085,.085,1,20]}),(0,R.jsx)(A,{thickness:.012,color:`#1f1d2b`})]}),(0,R.jsxs)(`mesh`,{position:[0,0,-.7],rotation:[Math.PI/2,0,0],material:j(`#1d3557`),castShadow:!0,children:[(0,R.jsx)(`cylinderGeometry`,{args:[.105,.1,.22,20]}),(0,R.jsx)(A,{thickness:.012,color:`#1f1d2b`})]}),(0,R.jsx)(`mesh`,{position:[0,0,0],rotation:[Math.PI/2,0,0],material:j(`#d4a373`),children:(0,R.jsx)(`cylinderGeometry`,{args:[.09,.09,.05,20]})}),(0,R.jsx)(`mesh`,{position:[0,.06,.4],rotation:[Math.PI/2-.6,0,0],material:j(`#343a40`),children:(0,R.jsx)(`cylinderGeometry`,{args:[.025,.03,.14,10]})}),(0,R.jsx)(`mesh`,{position:[.08,.11,-.05],rotation:[Math.PI/2,0,0],material:j(`#d4a373`),children:(0,R.jsx)(`cylinderGeometry`,{args:[.022,.022,.3,10]})})]})]}),(0,R.jsx)(jr,{visible:r})]})}function Nr({top:e}){return(0,I.useEffect)(()=>pt(yt,bt),[]),(0,I.useEffect)(()=>()=>void dt(),[]),L(`lights`,()=>Math.round(Qe()*100)/100),L(`elevation`,()=>ee(e)),(0,R.jsxs)(`group`,{children:[(0,R.jsx)(Jn,{top:e}),(0,R.jsx)($e,{floorLabel:`▲ R · Roof terrace`,accent:`#ff8a5b`}),(0,R.jsx)(gn,{}),(0,R.jsx)(vr,{}),(0,R.jsx)(ln,{}),(0,R.jsx)(Fn,{}),(0,R.jsx)(Mr,{}),(0,R.jsx)(Vt,{top:e}),(0,R.jsx)(lr,{}),(0,R.jsx)(Rn,{}),(0,R.jsx)(ut,{kind:`roof`})]})}export{Nr as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as e,t,u as n}from"./jsx-runtime-BFUkm7bt.js";import{l as r,p as i}from"./store-FA83kfnc.js";import{Bt as a,f as o,gt as s,tt as c}from"./bloomMarks-DariC6lY.js";import{a as l}from"./director-CrzFgnoP.js";import{n as u,r as d}from"./Office-BBnd6tyn.js";import{i as f,l as p,n as m,o as h,s as g,t as _}from"./kit-C6ByUQ-Y.js";import{n as v}from"./news-CrPol-gz.js";var y=n(e(),1),b=t(),x=460,S={from:5,to:47};function C(e){let t=document.createElement(`canvas`);t.width=900,t.height=120;let n=t.getContext(`2d`,{willReadFrequently:!0});n.font=`bold 96px "Segoe UI", sans-serif`;let r=Math.min(t.width-10,Math.ceil(n.measureText(e).width)+10);n.fillStyle=`#fff`,n.textBaseline=`middle`,n.fillText(e,5,62);let i=n.getImageData(0,0,r,t.height).data,a=Math.max(4,Math.round(Math.sqrt(r*60/x))),o=[];for(let e=0,n=0;e<r;e+=a,n++){let s=[];for(let n=0;n<t.height;n+=a)i[(n*r+e)*4+3]>120&&s.push([e,n]);o.push(...n%2?s.reverse():s)}return{pts:o.slice(0,x),w:r,h:t.height}}function w({run:e,elevation:t}){let n=(0,y.useRef)(null),w=(0,y.useRef)(null),T=h(e.side),E=(0,y.useMemo)(()=>{let n=i.getState(),a=n.floor>0?r(n.repos,n.floor):null,o=v(a?.fullName??null,n.settings.companyName),{pts:s,w:c,h:u}=C(o),d=l(e.seed),f=Math.min(190,18+o.length*13)/c,p=T*(215+d()*30),h=m(t)+38+d()*10;return{text:o,world:s.map(([e,t])=>[p,h+(u-t)*f,T*(e-c/2)*f]),x:p,y0:h,size:Math.max(1.4,f*3.2)}},[e.seed,T,t]),D=(0,y.useMemo)(()=>({mat:new c,v:new a,q:new s,sc:new a,last:new a,first:!0}),[]);(0,y.useLayoutEffect)(()=>{let e=w.current;if(e){D.mat.makeScale(0,0,0);for(let t=0;t<x;t++)e.setMatrixAt(t,D.mat);e.instanceMatrix.needsUpdate=!0}},[D]);let O=(0,y.useMemo)(()=>({engine:null}),[]);return(0,y.useEffect)(()=>(O.engine=u(`engine`),()=>O.engine?.stop(1)),[O]),o(()=>{let r=e.t,i=E.world.length,a=(S.to-S.from)/Math.max(1,i),o=_((r-S.from)/(S.to-S.from))*i,s=_((e.seconds-r)/14),c=w.current;if(c){for(let e=0;e<i;e++){let t=r-(S.from+e*a),[n,i,o]=E.world[e],l=t<0?0:E.size*(.4+.6*g(t))*(1+t*.012)*s;D.v.set(n,i+Math.max(0,t)*.03,o+Math.max(0,t)*.12),D.sc.set(l,l,l),c.setMatrixAt(e,D.mat.compose(D.v,D.q,D.sc))}c.instanceMatrix.needsUpdate=!0}let l=n.current;if(!l)return;let u=Math.min(i-1,Math.floor(o)),[p,m,h]=i?E.world[Math.max(0,u)]:[E.x,E.y0,0],v=p,y=m,b=h;if(r<S.from){let e=1-g(r/S.from);b-=T*e*160,y+=e*20}else if(r>S.to){let e=g((r-S.to)/12);b+=T*e*220,y+=e*40}if(!D.first){let e=v-D.last.x,t=y-D.last.y,n=b-D.last.z;e*e+t*t+n*n>1e-4&&l.lookAt(v+e,y+t,b+n)}D.first=!1,l.position.set(v,y,b),D.last.set(v,y,b),l.visible=r<S.to+12;let x=d(v,y-t,b,120);O.engine?.set(x.gain*.7*f(r,S.to+12,3),x.pan,1.7)}),(0,b.jsxs)(`group`,{children:[(0,b.jsxs)(`group`,{ref:n,scale:1.4,children:[(0,b.jsx)(`mesh`,{material:p(`#f4a261`),"rotation-x":Math.PI/2,children:(0,b.jsx)(`capsuleGeometry`,{args:[.45,3.2,4,8]})}),(0,b.jsx)(`mesh`,{material:p(`#e63946`),position:[0,0,.6],children:(0,b.jsx)(`boxGeometry`,{args:[6.5,.15,1.1]})}),(0,b.jsx)(`mesh`,{material:p(`#e63946`),position:[0,.5,-1.8],children:(0,b.jsx)(`boxGeometry`,{args:[.12,1,.8]})}),(0,b.jsx)(`mesh`,{material:p(`#e63946`),position:[0,.1,-1.9],children:(0,b.jsx)(`boxGeometry`,{args:[2.2,.1,.6]})})]}),(0,b.jsx)(`instancedMesh`,{ref:w,args:[void 0,void 0,x],material:p(`#ffffff`,{opacity:.92}),frustumCulled:!1,children:(0,b.jsx)(`sphereGeometry`,{args:[1,8,6]})})]})}export{w as default};
|