1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[77915],{21716:(e,t,n)=>{n.r(t),n.d(t,{CIRCLE_INTERESTS:()=>v,POSE_HZ:()=>p,POSE_KEEPALIVE_S:()=>f,POSE_MIN_INTERVAL_S:()=>h,POSE_SNAP_DIST:()=>g,ROOM_R:()=>o,SEAT_COUNT:()=>r,SEAT_R:()=>s,TUB_R:()=>a,WATER_R:()=>i,angleDelta:()=>m,encodePose:()=>d,fadeForDistance:()=>y,parseMessage:()=>u,pickDaily:()=>b,seatPositions:()=>l,shouldSendPose:()=>w,smoothK:()=>x});let r=n(28490).ut,o=9,a=2.6,i=2.3,s=3.3;function l(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s,n=[];for(let r=0;r<e;r++){let o=Math.PI/2+r/e*Math.PI*2,a=Math.cos(o)*t,i=Math.sin(o)*t;n.push({x:a,z:i,yaw:Math.atan2(-a,-i)})}return n}let c=e=>Math.round(100*e)/100;function d(e,t,n){let r=Math.hypot(e,t),a=r>o?o/r:1,i=n%(2*Math.PI);return i>Math.PI&&(i-=2*Math.PI),i<=-Math.PI&&(i+=2*Math.PI),{t:"p",x:c(e*a),z:c(t*a),r:c(i)}}function u(e){return"object"!=typeof e||null===e?null:"p"===e.t?"number"==typeof e.x&&"number"==typeof e.z&&"number"==typeof e.r&&Number.isFinite(e.x)&&Number.isFinite(e.z)&&Number.isFinite(e.r)?d(e.x,e.z,e.r):null:"e"===e.t&&"stoke"===e.k?{t:"e",k:"stoke"}:null}let p=10,h=.1,f=1.5;function w(e,t,n,r){if(!e)return!0;let o=r-n;return!(o<h)&&(!!(Math.hypot(t.x-e.x,t.z-e.z)>.015||Math.abs(m(e.r,t.r))>.03)||o>=f)}function m(e,t){let n=(t-e)%(2*Math.PI);return n>Math.PI&&(n-=2*Math.PI),n<-Math.PI&&(n+=2*Math.PI),n}function x(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;return 1-Math.exp(-t*e)}let g=3;function y(e){if(e>=1.1)return 1;let t=Math.max(0,e/1.1);return .15+t*t*(3-2*t)*.85}let v=["impressionism","photochrom","hokusai","birds","the-moon","maps","botanical","nebulae","lighthouses","winslow-homer","snowflakes","sailing-ships","hiroshige","butterflies","celestial-maps","van-gogh"];function b(e,t){var n;return 0===e.length?null:null!=(n=e[(Math.floor(t.getTime()/864e5)%e.length+e.length)%e.length])?n:null}},77915:(e,t,n)=>{n.r(t),n.d(t,{CircleRoom:()=>x});var r=n(4536),o=n(11092),a=n(90625),i=n(14404),s=n(74678),l=n(38726),c=n(35735),d=n(41566),u=n(32595),p=n(28490),h=n(61545),f=n(21716);let w=new a.Pq0(0,1,0),m=30*Math.PI/180;function x(e){let{selfSeed:t="you",selfName:n="Explorer",backHref:x="/labs/spatial
1-soak",backLabel:g="Rooms",roomId:y=(0,p.mJ)("world","the-circle"),art:v=null}=e,b=(0,o.useRef)(null),E=(0,o.useRef)(null),M=(0,o.useRef)(null),[k,P]=(0,o.useState)(null),[z,S]=(0,o.useState)(!1),[R,_]=(0,o.useState)(!1),[T,j]=(0,o.useState)(!1),[L,A]=(0,o.useState)(null),C=(0,o.useRef)(null),I=(0,o.useRef)([]),F=(0,o.useRef)(new Map),N=(0,o.useRef)(!1),[D,O]=(0,o.useState)("idle"),W=(0,o.useRef)("idle"),[q,V]=(0,o.useState)(0),[B,U]=(0,o.useState)(!1),H=(0,o.useRef)(!1),[K,Z]=(0,o.useState)(!1),[X,Y]=(0,o.useState)(!1),J=K||X,$=(0,o.useCallback)(()=>{var e,t,n,r,o;let a=document;if(a.fullscreenElement||a.webkitFullscreenElement){null!=(null==(n=a.exitFullscreen)?void 0:n.call(a))||null==(r=a.webkitExitFullscreen)||r.call(a);return}if(X)return void Y(!1);let i=b.current,s=null!=(o=null==i||null==(e=i.requestFullscreen)?void 0:e.bind(i))?o:null==i||null==(t=i.webkitRequestFullscreen)?void 0:t.bind(i);s?Promise.resolve(s()).catch(()=>Y(!0)):Y(!0)},[X]);(0,o.useEffect)(()=>{let e=()=>{let e=document;Z(!!(e.fullscreenElement||e.webkitFullscreenElement))};return document.addEventListener("fullscreenchange",e),document.addEventListener("webkitfullscreenchange",e),()=>{document.removeEventListener("fullscreenchange",e),document.removeEventListener("webkitfullscreenchange",e)}},[]),(0,o.useEffect)(()=>{if(!X)return;let e=document.body.style.overflow;document.body.style.overflow="hidden";let t=e=>{"Escape"===e.key&&Y(!1)};return window.addEventListener("keydown",t),()=>{document.body.style.overflow=e,window.removeEventListener("keydown",t)}},[X]);let[G,Q]=(0,o.useState)(!1),[ee,et]=(0,o.useState)(!1),en=(0,o.useRef)(null),er=(0,o.useCallback)(()=>{Q(!1),et(!0),en.current&&(clearTimeout(en.current),en.current=null)},[]),eo=(0,o.useCallback)(()=>{if(k){var e;null==(e=E.current)||e.click();return}Q(!0),en.current&&clearTimeout(en.current),en.current=setTimeout(er,5500)},[k,er]);(0,o.useEffect)(()=>()=>{en.current&&clearTimeout(en.current)},[]);let ea=(0,o.useCallback)(()=>{j(e=>{let t=!e;if(t)M.current||(M.current=(0,l.zq)("soak",.05)),M.current.start();else{var n;null==(n=M.current)||n.stop()}return t})},[]),ei=(0,o.useCallback)(()=>{if(C.current){C.current.stop(),C.current=null,I.current=[],F.current.clear(),W.current="idle",O("idle"),V(0);return}let e=new u.VoiceMesh({roomId:y,displayName:n,spatial:!0,onState:e=>{W.current=e,O(e)},onPeers:e=>{I.current=e,V(e.length)},onPeerData:(e,t)=>{let n=(0,f.parseMessage)(t);n&&("p"===n.t?F.current.set(e,n):"stoke"===n.k&&(N.current=!0))}});C.current=e,e.start()},[y,n]),es=(0,o.useCallback)(()=>{U(e=>{var t;let n=!e;return H.current=n,null==(t=C.current)||t.setMuted(n),n})},[]);(0,o.useEffect)(()=>()=>{var e;null==(e=C.current)||e.stop(),C.current=null},[]),(0,o.useEffect)(()=>{var e,n,r,o;let l=b.current;if(!l)return;let u=navigator.xr;(null==u?void 0:u.isSessionSupported)?u.isSessionSupported("immersive-vr").then(P).catch(()=>P(!1)):P(!1);let p=null==(e=(n=window).matchMedia)?void 0:e.call(n,"(prefers-reduced-motion: reduce)").matches,x=l.clientWidth||window.innerWidth,g=l.clientHeight||window.innerHeight,y=(0,c.uw)({host:l,width:x,height:g,onContextLost:()=>S(!0)});if(!y)return void S(!0);y.toneMapping=a.FV,y.toneMappingExposure=1.1;let k=i.Z.createButton(y);k.style.display="none",k.style.visibility="hidden",k.style.pointerEvents="none",l.appendChild(k),E.current=k;let z=new a.Q1f("#101526"),R=new a.Z58;R.background=z,R.fog=new a.jUj(z,16,85);let T=(0,f.seatPositions)(),j=Math.PI/2+Math.PI/f.SEAT_COUNT,L={x:Math.cos(j)*f.SEAT_R,z:Math.sin(j)*f.SEAT_R,yaw:0};L.yaw=Math.atan2(-L.x,-L.z);let D=new a.ubm(64,x/g,.1,300);D.position.set(1.65*L.x,1.7,1.65*L.z);let O=new a.YJl;R.add(O);let q=new s.N(D,y.domElement);q.target.set(L.x,1.4,L.z),q.enablePan=!1,q.minDistance=1.6,q.maxDistance=6,q.maxPolarAngle=Math.PI/1.96,q.enableDamping=!0,q.dampingFactor=.09,q.mouseButtons.RIGHT=a.kBv.ROTATE,q.update();let V=[],B=[],U=[],K=e=>(V.push(e),e),Z=e=>(B.push(e),e),X={geo:K,mat:Z,tex:e=>(U.push(e),e)},Y={value:0},J=(0,h.eo)(X),$=[],G=K(new a.Gu$(1,18,12)),Q=K(new a.Ho_(1,1,1,18)),ee=new a.dth(0x9db4d8,1708554,.62);R.add(ee);let et=new a.ZyN(8296136,.3);et.position.set(30,40,-20),R.add(et);let en=new a.HiM(0xffa14a,16,15,2);en.position.set(0,1.2,0),R.add(en),R.add((0,h.$q)(X,Y,130));{let e=new a.BdL(y),t=new a.Z58;t.add((0,h.$q)(X,Y,60));let n=e.fromScene(t,.04);R.environment=n.texture,e.dispose(),U.push(n.texture)}{let e=new Float32Array(720),t=0;for(;t<240;){let n=new a.Pq0(2*Math.random()-1,Math.random(),2*Math.random()-1).normalize();if(n.y<.06)continue;let r=105+18*Math.random();e[3*t]=n.x*r,e[3*t+1]=n.y*r,e[3*t+2]=n.z*r,t++}R.add((0,h.HL)(X,Y,{positions:e,color:"#cfe0ff",sizePx:2.2,opacity:.8,twinkleSpeed:.7,additive:!0,attenuate:!1,map:J}));let n=new a.eaF(G,Z(new a.V9B({color:"#f2e9d4",fog:!1})));n.scale.setScalar(2.6),n.position.set(60,30,-45),R.add(n);let r=new a.kxk(Z(new a.RoJ({map:J,color:"#f2e9d4",transparent:!0,opacity:.3,depthWrite:!1,fog:!1})));r.scale.setScalar(17),r.position.copy(n.position),R.add(r)}let er=function(e){var t,n,r;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=null!=(t=o.fg)?t:"#0e1830",s=null!=(n=o.bg)?n:"rgba(247,243,237,0.95)",l="".concat(o.bold?"800":"600"," 40px system-ui, -apple-system, sans-serif"),c=document.createElement("canvas").getContext("2d");c.font=l;let d=Math.ceil(Math.min(c.measureText(e).width,620)+56),u=document.createElement("canvas");u.width=d,u.height=86;let p=u.getContext("2d");p.fillStyle=s,p.beginPath(),p.moveTo(22,0),p.arcTo(d,0,d,86,22),p.arcTo(d,86,0,86,22),p.arcTo(0,86,0,0,22),p.arcTo(0,0,d,0,22),p.closePath(),p.fill(),p.font=l,p.fillStyle=i,p.textAlign="center",p.textBaseline="middle",p.fillText(e,d/2,45,620);let h=new a.GOR(u);
1h.colorSpace=a.er$,h.anisotropy=4,U.push(h);let f=Z(new a.RoJ({map:h,transparent:!0,depthWrite:!1,toneMapped:!1})),w=new a.kxk(f),m=(null!=(r=o.scale)?r:1)*.0042;return w.scale.set(d*m,86*m,1),w.renderOrder=12,w},eo=new a.eaF(K(new a.tcD(f.ROOM_R+7,56)),Z(new a._4j({color:"#16201a",roughness:1})));eo.rotation.x=-Math.PI/2,eo.position.y=-.02,R.add(eo);let ea=new a.eaF(K(new a.rKP(f.TUB_R-.05,4.9,48)),Z(new a._4j({color:"#4a3526",roughness:.85})));ea.rotation.x=-Math.PI/2,ea.position.y=.012,R.add(ea);let ei=new a.eaF(K(new a.tcD(4.4,36)),Z(new a.V9B({map:J,color:"#ff8a3c",transparent:!0,opacity:.1,blending:a.EZo,depthWrite:!1})));ei.rotation.x=-Math.PI/2,ei.position.y=.03,ei.renderOrder=2,R.add(ei);let es=new a.eaF(Q,Z(new a._4j({color:"#26474e",roughness:.55})));es.scale.set(f.TUB_R,.78,f.TUB_R),es.position.y=.39,R.add(es);let el=new a.eaF(K(new a.O3Y(f.TUB_R,.15,12,40)),Z(new a._4j({color:"#6b4e33",roughness:.6})));el.rotation.x=Math.PI/2,el.position.y=.8,R.add(el);let ec=(0,h.Lg)(X,Y);ec.color.set("#15454e"),ec.roughness=.12;let ed=new a.eaF(K(new a.tcD(f.WATER_R,36,0,2*Math.PI)),ec);ed.rotation.x=-Math.PI/2,ed.position.y=.64,R.add(ed);let eu=new a.eaF(Q,Z(new a._4j({color:"#0d2e34",emissive:new a.Q1f("#2fd4c8"),emissiveIntensity:.55,roughness:.4,side:a.hsX})));eu.scale.set(f.TUB_R-.12,.6,f.TUB_R-.12),eu.position.y=.34,R.add(eu),R.add((0,h.HL)(X,Y,{count:24,box:{x:[-f.WATER_R,f.WATER_R],y:[.7,2.6],z:[-f.WATER_R,f.WATER_R]},color:"#bcd0d8",sizePx:60,maxPx:300,opacity:.07,drift:{x:.08,y:.5,z:.05},wrap:{y:2,origin:{x:0,y:.7,z:0}},jitter:.25,map:J}));{let e=Z(new a._4j({color:"#5a4636",roughness:.8})),t=new a.ZLX(Q,e,f.SEAT_COUNT),n=new a.kn4;T.forEach((e,r)=>{n.compose(new a.Pq0(e.x,.25,e.z),new a.PTz,new a.Pq0(.42,.5,.42)),t.setMatrixAt(r,n)}),R.add(t)}let ep=new a.YJl;{let e=Z(new a._4j({color:"#7a5a2c",roughness:.45,metalness:.7})),t=new a.eaF(Q,e);t.scale.set(.09,1,.09),t.position.y=.5,ep.add(t);let n=new a.eaF(G,e);n.scale.set(.4,.16,.4),n.position.y=1.02,ep.add(n)}let eh=Z(new a.V9B({color:"#ffb45a",transparent:!0,opacity:.95,blending:a.EZo,depthWrite:!1})),ef=new a.eaF(G,eh);ef.scale.set(.15,.26,.15),ef.position.y=1.22,ep.add(ef);let ew=(0,h.HL)(X,Y,{count:26,box:{x:[-.18,.18],y:[1.1,2.6],z:[-.18,.18]},color:"#ffae62",sizePx:5,opacity:.85,twinkleSpeed:3.4,drift:{x:.04,y:.55,z:.02},wrap:{y:1.5,origin:{x:0,y:1.1,z:0}},jitter:.12,additive:!0,map:J});ep.add(ew),R.add(ep);let em=+!!v,ex=new a.YJl;if(v){ex.position.set(0,0,-4.6);let e=Z(new a._4j({color:"#4a3526",roughness:.8})),t=K(new a.Ho_(.03,.035,1.9,8));for(let[n,r]of[[-.42,.2],[.42,-.2],[0,0]]){let o=new a.eaF(t,e);o.position.set(n,.92,0===n?-.3:0),o.rotation.z=r,0===n&&(o.rotation.x=-.3),ex.add(o)}let n=v.width&&v.height&&v.height>0?v.width/v.height:4/3,o=Math.min(1.5,.95*n),i=Math.min(.95,o/n),s=new a.eaF(K(new a.iNn(o+.1,i+.1,.05)),e);s.position.set(0,1.32,.03),ex.add(s);let l=Z(new a._4j({color:"#1c1c20",roughness:.9})),c=new a.eaF(K(new a.bdM(o,i)),l);c.position.set(0,1.32,.062),ex.add(c);let d=er([null!=(r=v.title)?r:"Tonightâs piece",v.creator].filter(Boolean).join(" \xb7 "),{scale:.62,bg:"rgba(20,26,40,0.92)",fg:"#eaf1ff"});d.position.set(0,.62,.2),ex.add(d),R.add(ex);let u=new a.Tap;u.setCrossOrigin("anonymous"),u.load(v.url,e=>{e.colorSpace=a.er$,e.anisotropy=8,U.push(e),l.map=e,l.color.set("#ffffff"),l.roughness=.7,l.needsUpdate=!0,em=0,eY()},void 0,()=>{em=0,eY()})}{let e=Z(new a._4j({color:"#0d1410",roughness:1})),t=new a.ZLX(K(new a.qFE(1,1,7)),e,7),n=new a.kn4;for(let e=0;e<7;e++){let r=e/7*Math.PI*2+.5,o=56+e%3*7;n.compose(new a.Pq0(Math.cos(r)*o,2.4,Math.sin(r)*o),new a.PTz,new a.Pq0(16+e%4*5,6+e%3*2.4,16)),t.setMatrixAt(e,n)}R.add(t),R.add((0,h.HL)(X,Y,{count:30,box:{x:[-8,8],y:[.3,2.1],z:[-8,8]},color:"#ffe28a",sizePx:4,opacity:.75,twinkleSpeed:2.4,jitter:.9,additive:!0,map:J}))}let eg=(0,d.KV)((0,d.i$)(t));eg.position.set(L.x,0,L.z),eg.rotation.y=L.yaw,R.add(eg);let ey=Z(new a.V9B({color:"#ffe7b0",transparent:!0,opacity:0,blending:a.EZo,depthWrite:!1})),ev=new a.eaF(G,ey);ev.scale.setScalar(.05),ev.position.y=1.02,eg.add(ev);let eb=new Map,eE=Z(new a.V9B({map:J,color:"#000000",transparent:!0,opacity:.3,depthWrite:!1})),eM=K(new a.tcD(.34,16)),ek=e=>{let t=eb.get(e);t&&(R.remove(t.group),t.group.remove(t.label,t.glow,t.shadow),(0,d.Vr)(t.group),t.glowMat.dispose(),eb.delete(e),F.current.delete(e))},eP=[{id:"ember",x:0,z:0,focus:{id:"ember",name:"The Ember",species:"The circleâs fire",lore:"Every circle keeps one. Tap it and it flares for everyone here â a small shared spark to mark a good story, a welcome, a goodbye. The water stays warm either way."}}];
1if(v){let e=[v.creator,v.date].filter(Boolean).join(", "),t=[v.institution,v.license?"".concat(v.license):"Public domain"].filter(Boolean).join(" \xb7 ");eP.push({id:"piece",x:0,z:-4.6,focus:{id:"piece",name:null!=(o=v.title)?o:"Tonightâs piece",species:e||"Artist unknown",lore:"Tonightâs piece â the same one for everyone in the Circle today. Start there if the words run dry. ".concat(t,".")}})}let ez=0,eS=e=>{var t;ez=1,e&&(null==(t=C.current)||t.sendAppData({t:"e",k:"stoke"}))},eR=e=>A(e),e_=null,eT=new a.tBo,ej=new a.I9Y,eL=0,eA=0,eC=0,eI=e=>{eL=e.clientX,eA=e.clientY,eC=performance.now()},eF=e=>{if(y.xr.isPresenting||Math.hypot(e.clientX-eL,e.clientY-eA)>8||performance.now()-eC>600)return;let t=y.domElement.getBoundingClientRect();if(ej.set((e.clientX-t.left)/t.width*2-1,-(2*((e.clientY-t.top)/t.height))+1),eT.setFromCamera(ej,D),eT.intersectObject(ep,!0).length>0)return void eS(!0);if(v&&eT.intersectObject(ex,!0).length>0){let e=eP.find(e=>"piece"===e.id);e&&(e_=e.id,eR(e.focus))}};y.domElement.addEventListener("pointerdown",eI),y.domElement.addEventListener("pointerup",eF),y.domElement.style.cursor="grab";let eN=y.xr.getController(0),eD=y.xr.getController(1);O.add(eN,eD);let eO=new a.kn4,eW=e=>{eO.identity().extractRotation(e.target.matrixWorld),eT.ray.origin.setFromMatrixPosition(e.target.matrixWorld),eT.ray.direction.set(0,0,-1).applyMatrix4(eO),eT.intersectObject(ep,!0).length>0&&eS(!0)};eN.addEventListener("selectstart",eW),eD.addEventListener("selectstart",eW);let eq={f:0,r:0,yaw:0},eV=e=>{if(!(e.repeat||(()=>{let e=document.activeElement;return!!e&&("INPUT"===e.tagName||"TEXTAREA"===e.tagName||e.isContentEditable)})()))switch(e.code){case"KeyW":case"ArrowUp":eq.f=1,e.preventDefault();break;case"KeyS":case"ArrowDown":eq.f=-1,e.preventDefault();break;case"KeyA":eq.r=-1,e.preventDefault();break;case"KeyD":eq.r=1,e.preventDefault();break;case"ArrowLeft":eq.yaw=1,e.preventDefault();break;case"ArrowRight":eq.yaw=-1,e.preventDefault()}},eB=e=>{switch(e.code){case"KeyW":case"ArrowUp":1===eq.f&&(eq.f=0);break;case"KeyS":case"ArrowDown":-1===eq.f&&(eq.f=0);break;case"KeyA":-1===eq.r&&(eq.r=0);break;case"KeyD":1===eq.r&&(eq.r=0);break;case"ArrowLeft":1===eq.yaw&&(eq.yaw=0);break;case"ArrowRight":-1===eq.yaw&&(eq.yaw=0)}};window.addEventListener("keydown",eV),window.addEventListener("keyup",eB);let eU={pos:new a.Pq0,quat:new a.PTz,target:new a.Pq0},eH=()=>{eU.pos.copy(D.position),eU.quat.copy(D.quaternion),eU.target.copy(q.target),O.position.set(q.target.x,0,q.target.z),O.add(D),D.position.set(0,0,0),D.quaternion.identity(),eg.visible=!1},eK=()=>{R.add(D),D.position.copy(eU.pos),D.quaternion.copy(eU.quat),q.target.copy(eU.target),q.update(),eg.visible=!0};y.xr.addEventListener("sessionstart",eH),y.xr.addEventListener("sessionend",eK);let eZ=!1,eX=!1,eY=()=>{!eZ&&eX&&0===em&&(eZ=!0,_(!0))},eJ=setTimeout(()=>{eZ||(eZ=!0,_(!0))},5e3),e$=()=>{let e=l.clientWidth||window.innerWidth,t=l.clientHeight||window.innerHeight;y.setSize(e,t),D.aspect=e/t,D.updateProjectionMatrix()};window.addEventListener("resize",e$);let eG=new a.zD7,eQ=new a.Pq0,e0=new a.Pq0,e1=new a.Pq0,e2=new a.Pq0,e4=new a.Pq0,e5=new a.Pq0,e6=!0,e3=null,e8=0;return y.setAnimationLoop(()=>{var e,t,n,r,o,i,s,l,c,u,h,x,g,v;let b=Math.min(eG.getDelta(),.05),E=eG.elapsedTime,M=y.xr.isPresenting;Y.value=p?.15*E:E,N.current&&(N.current=!1,eS(!1));let k=p?0:.06*Math.sin(9.3*E)+.04*Math.sin(23.7*E),P=(ez=Math.max(0,ez-b/2.6))*ez;if(en.intensity=15+30*k+46*P,ef.scale.set(.15+.13*P,.26+k+.3*P,.15+.13*P),ei.material.opacity=.08+.2*k+.3*P,!p)for(let e of $)e(E,b);if(M){let e=null==(t=(n=y.xr).getSession)?void 0:t.call(n),a=0,c=0,d=0;for(let t of null!=(r=null==e?void 0:e.inputSources)?r:[]){let e=t.gamepad;if(!e)continue;let n=e.axes,r=null!=(i=null!=(o=n[2])?o:n[0])?i:0,u=null!=(l=null!=(s=n[3])?s:n[1])?l:0;"right"===t.handedness?Math.abs(r)>.6&&(d=r):(Math.abs(r)>.18&&(a+=r),Math.abs(u)>.18&&(c+=u))}(a||c)&&(D.getWorldDirection(eQ),eQ.y=0,eQ.normalize(),e0.set(eQ.z,0,-eQ.x),O.position.addScaledVector(eQ,-(2.8*c)*b),O.position.addScaledVector(e0,2.8*a*b),function(e){let t=Math.hypot(e.x,e.z);t>f.ROOM_R&&(e.x=e.x/t*f.ROOM_R,e.z=e.z/t*f.ROOM_R)}(O.position)),0!==d&&e6?(e6=!1,D.getWorldPosition(e4),O.rotation.y-=Math.sign(d)*m,O.updateMatrixWorld(),D.getWorldPosition(e5),O.position.x+=e4.x-e5.x,O.position.z+=e4.z-e5.z):0===d&&(e6=!0)}else{if((eq.f||eq.r)&&(eQ.subVectors(q.target,D.position),eQ.y=0,eQ.lengthSq()>1e-5)){eQ.normalize(),e0.crossVectors(eQ,w).normalize();let e=2.6*b,t=(eQ.x*eq.f+e0.x*eq.r)*e,n=(eQ.z*eq.f+e0.z*eq.r)*e;D.position.x+=t,D.position.z+=n,q.target.x+=t,q.target.z+=n,function(e,t){let n=Math.hypot(t.x,t.z);if(n>f.ROOM_R){let r=f.ROOM_R/n,o=t.x-t.x*r,a=t.z-t.z*r;t.x*=r,t.z*=r,e.x-=o,e.z-=a}}(D.position,q.target)}if(eq.yaw){let e=e4.subVectors(D.position,q.target);e.applyAxisAngle(w,1.7*eq.yaw*b),D.position.copy(q.target).add(e)}
1q.update()}let z=M?O.position.x:q.target.x,S=M?O.position.z:q.target.z,_=M?y.xr.getCamera():D;_.getWorldPosition(e1),_.getWorldDirection(e2);let j=Math.atan2(e2.x,e2.z);if(eg.position.set(z,0,S),eg.rotation.y=j,C.current&&"live"===W.current){let e=(0,f.encodePose)(z,S,j);(0,f.shouldSendPose)(e3,e,e8,E)&&(C.current.sendAppData(e),e3=e,e8=E);let t=H.current?0:C.current.getSelfLevel();ey.opacity+=(.8*t-ey.opacity)*Math.min(1,12*b),ev.scale.setScalar(.05+.1*ey.opacity)}let L=I.current;if(L.length!==eb.size||L.some(e=>!eb.has(e.id))){let e=new Set(L.map(e=>e.id));for(let t of[...eb.keys()])e.has(t)||ek(t);L.forEach((e,t)=>{eb.has(e.id)||eb.set(e.id,((e,t)=>{let n=T[t%T.length],r=(0,d.KV)((0,d.Pf)(e.id));r.position.set(n.x,.5,n.z),r.rotation.y=n.yaw;let o=[];for(let e of(r.traverse(e=>{let t=e.material;Array.isArray(t)?o.push(...t):t&&o.push(t)}),o))e.transparent=!0,e.opacity=1;let i=er(e.name,{bg:"rgba(20,30,50,0.92)",fg:"#eaf1ff",scale:.8});i.position.y=1.35,r.add(i);let s=new a.V9B({color:"#ffe7b0",transparent:!0,opacity:0,blending:a.EZo,depthWrite:!1}),l=new a.eaF(G,s);l.scale.setScalar(.05),l.position.y=1.02,r.add(l);let c=new a.eaF(eM,eE);return c.rotation.x=-Math.PI/2,c.position.y=.014-r.position.y,r.add(c),R.add(r),{group:r,mats:o,label:i,glow:l,glowMat:s,shadow:c,cur:{x:n.x,z:n.z,r:n.yaw},target:null,level:0,fade:1}})(e,t+1))})}let A=(0,f.smoothK)(b);for(let[e,t]of eb){let n=null!=(h=F.current.get(e))?h:t.target;if(n&&n!==t.target&&(t.target=n),t.target){let e=t.target.x-t.cur.x,n=t.target.z-t.cur.z;Math.hypot(e,n)>f.POSE_SNAP_DIST?(t.cur.x=t.target.x,t.cur.z=t.target.z,t.cur.r=t.target.r):(t.cur.x+=e*A,t.cur.z+=n*A,t.cur.r+=(0,f.angleDelta)(t.cur.r,t.target.r)*A),t.group.position.x=t.cur.x,t.group.position.z=t.cur.z,t.group.position.y+=(0-t.group.position.y)*A,t.group.rotation.y=t.cur.r}null==(c=C.current)||c.setPeerPosition(e,t.group.position.x,t.group.position.y+1.1,t.group.position.z);let r=null!=(x=null==(u=C.current)?void 0:u.getPeerLevel(e))?x:0;t.level+=(r-t.level)*Math.min(1,12*b),t.glowMat.opacity=.85*t.level,t.glow.scale.setScalar(.05+.12*t.level);let o=Math.hypot(t.group.position.x-e1.x,t.group.position.z-e1.z),a=(0,f.fadeForDistance)(o);if(Math.abs(a-t.fade)>.01){for(let e of(t.fade=a,t.mats))e.opacity=a;t.label.material.opacity=a}t.shadow.position.y=.014-t.group.position.y}null==(e=C.current)||e.setListenerPose(e1.x,e1.y,e1.z,e2.x,e2.y,e2.z);let V=null,B=3.4;for(let e of eP){let t=Math.hypot(e.x-z,e.z-S);t<B&&(B=t,V=e)}let U=null!=(g=null==V?void 0:V.id)?g:null;U!==e_&&(e_=U,eR(null!=(v=null==V?void 0:V.focus)?v:null)),y.render(R,D),eX||(eX=!0,eY())}),()=>{var e;for(let t of(clearTimeout(eJ),window.removeEventListener("resize",e$),window.removeEventListener("keydown",eV),window.removeEventListener("keyup",eB),y.domElement.removeEventListener("pointerdown",eI),y.domElement.removeEventListener("pointerup",eF),y.xr.removeEventListener("sessionstart",eH),y.xr.removeEventListener("sessionend",eK),eN.removeEventListener("selectstart",eW),eD.removeEventListener("selectstart",eW),null==(e=M.current)||e.dispose(),M.current=null,[...eb.keys()]))ek(t);for(let e of((0,d.Vr)(eg),q.dispose(),R.environment=null,V))e.dispose();for(let e of B)e.dispose();
1for(let e of U)e.dispose();k.parentNode&&k.parentNode.removeChild(k),(0,c.NP)(y)}},[]);let el={padding:"8px 13px",borderRadius:999,cursor:"pointer",background:"color-mix(in srgb, var(--paper) 92%, transparent)",border:"1px solid var(--surface-2)",boxShadow:"0 4px 14px rgba(12,59,70,0.14)",font:"800 0.82rem/1 var(--font-sans, system-ui)",color:"var(--water-ink)"},ec="idle"===D?"Voices":"connecting"===D?"Connectingâ¦":"denied"===D?"Mic blocked":"full"===D?"Circle full":"error"===D?"Voice error":q>0?"Live \xb7 ".concat(q):"Live";return(0,r.jsxs)("div",{ref:b,className:"xr-host".concat(X?" xr-host--immersive":"").concat(J?" xr-host--fs":""),children:[(0,r.jsxs)("div",{className:"xr-loading".concat(R?" is-ready":""),role:"status","aria-hidden":R,children:[(0,r.jsx)("span",{className:"xr-loading__sun","aria-hidden":"true"}),(0,r.jsx)("p",{className:"xr-loading__text",children:"Warming the waterâ¦"})]}),!X&&(0,r.jsxs)("a",{href:x,className:"xr-leave","aria-label":"Leave the Circle and go back",style:{position:"absolute",left:12,top:12,zIndex:7,display:"inline-flex",alignItems:"center",gap:6,padding:"8px 13px",borderRadius:999,textDecoration:"none",background:"color-mix(in srgb, var(--paper) 92%, transparent)",border:"1px solid var(--surface-2)",boxShadow:"0 4px 14px rgba(12,59,70,0.14)",font:"800 0.84rem/1 var(--font-sans, system-ui)",color:"var(--water-ink)"},children:["â ",g]}),!X&&(0,r.jsxs)("div",{style:{position:"absolute",left:12,top:54,zIndex:6,maxWidth:300,padding:"8px 13px",borderRadius:14,background:"color-mix(in srgb, var(--paper) 88%, transparent)",border:"1px solid var(--surface-2)",boxShadow:"0 4px 14px rgba(12,59,70,0.12)",color:"var(--water-ink)",pointerEvents:"none"},children:[(0,r.jsx)("div",{style:{font:"900 0.94rem/1.1 var(--font-sans, system-ui)",letterSpacing:"0.06em"},children:"THE CIRCLE"}),(0,r.jsx)("div",{style:{marginTop:3,font:"600 0.74rem/1.3 var(--font-sans, system-ui)",opacity:.82},children:"Eight seats, warm water. Turn voices on, walk the circle, tap the Ember to make it flare for everyone here."})]}),z&&(0,r.jsx)("div",{className:"xr-host__note",children:(0,r.jsxs)("p",{children:["This browser blocked 3D (WebGL). If youâre on ",(0,r.jsx)("strong",{children:"Brave"}),", lower Shields for this site and reload â it works in Safari, Edge, Chrome, and the Quest browser."]})}),!z&&!X&&(0,r.jsxs)("div",{style:{position:"absolute",right:12,bottom:12,zIndex:7,display:"flex",gap:8,flexWrap:"wrap",justifyContent:"flex-end"},children:[(0,r.jsx)("button",{type:"button",style:el,onClick:ei,"aria-pressed":"idle"!==D,children:ec}),"idle"!==D&&(0,r.jsx)("button",{type:"button",style:el,onClick:es,"aria-pressed":B,children:B?"Unmute":"Mute"}),(0,r.jsx)("button",{type:"button",style:el,onClick:ea,"aria-pressed":T,children:T?"Sound on":"Sound off"}),(0,r.jsx)("button",{type:"button",style:el,onClick:$,"aria-pressed":J,children:J?"Exit full screen":"Full screen"})]}),!z&&!ee&&(0,r.jsx)("button",{type:"button",className:"xr-enter",onClick:eo,"aria-label":k?"Enter VR":"About VR mode",children:"Enter VR"}),G&&(0,r.jsxs)("div",{className:"xr-vrhint",role:"status",children:[(0,r.jsx)("button",{type:"button",className:"xr-vrhint__x",onClick:er,"aria-label":"Close",children:"\xd7"}),(0,r.jsx)("span",{className:"xr-vrhint__sun","aria-hidden":"true"}),(0,r.jsxs)("p",{className:"xr-vrhint__text",children:[(0,r.jsx)("strong",{children:"Step inside in VR."})," Open this on a Meta\xa0Quest or Apple\xa0Vision\xa0Pro to sit in the Circle. For now, drag to look and use ",(0,r.jsx)("strong",{children:"WASD"})," to walk."]}),(0,r.jsx)("button",{type:"button",className:"xr-vrhint__ok",onClick:er,children:"Got it"})]}),L&&!X&&(0,r.jsxs)("div",{role:"dialog","aria-label":L.name,style:{position:"absolute",left:"50%",bottom:74,transform:"translateX(-50%)",zIndex:8,width:"min(460px, 92vw)",padding:"15px 17px",borderRadius:16,background:"color-mix(in srgb, var(--paper) 95%, transparent)",border:"1px solid var(--surface-2)",boxShadow:"0 10px 30px rgba(12,59,70,0.22)",color:"var(--water-ink)"},children:[(0,r.jsx)("button",{type:"button",onClick:()=>A(null),"aria-label":"Close",style:{position:"absolute",right:8,top:6,border:0,background:"transparent",curs
1or:"pointer",font:"700 1.1rem/1 system-ui",color:"var(--water-ink)",opacity:.6},children:"\xd7"}),(0,r.jsx)("p",{style:{margin:0,font:"800 1.05rem/1.25 var(--font-sans, system-ui)"},children:L.name}),(0,r.jsx)("p",{style:{margin:"2px 0 0",font:"600 0.8rem/1.3 var(--font-sans, system-ui)",opacity:.72},children:L.species}),(0,r.jsx)("p",{style:{margin:"9px 0 0",font:"500 0.86rem/1.45 var(--font-sans, system-ui)",opacity:.92},children:L.lore})]})]})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.