1import{q as t}from"./index-Chw7iKGq.js";import{h as y,f as _,e as r}from"./vendor-feOCaMQ1.js";import{M as j}from"./MeetingRoom-RBrtm3k6.js";import{V as E}from"./VideoPageShell-CDKBxKkw.js";import{d as h}from"./api-DK9QzHxR.js";function N(){const{slug:a}=y(),d=_(),[e,g]=r.useState(null),[n,u]=r.useState(""),[f,b]=r.useState(!0),[m,p]=r.useState(""),[i,v]=r.useState("");r.useEffect(()=>{let s=!1;return h.issue(a,"host").catch(()=>h.issue(a,"participant")).then(o=>{s||(g(o),u(""))}).catch(o=>{s||u((o==null?void 0:o.message)||"Could not get a meeting token.")}).finally(()=>{s||b(!1)}),()=>{s=!0}},[a]),r.useEffect(()=>{if(!(e!=null&&e.enable_e2ee))return;const s=sessionStorage.getItem(`video.e2ee.${a}`);s&&p(s)},[e==null?void 0:e.enable_e2ee,a]);function l(){e!=null&&e.parent_room_slug?d(`/dashboard/video/rooms/${encodeURIComponent(e.parent_room_slug)}`):d("/dashboard/video/rooms")}function x(s){var o;if((o=s==null?void 0:s.preventDefault)==null||o.call(s),!i||i.length<8){window.alert("Passphrase must be at least 8 characters. Everyone in the meeting must use the same passphrase.");return}sessionStorage.setItem(`video.e2ee.${a}`,i),p(i)}const c=!!(e!=null&&e.enable_e2ee)&&!m&&!n;return t.jsxs(E,{eyebrow:e!=null&&e.parent_room_slug?"BeetlVideo · Breakout":"BeetlVideo · Meeting",title:(e==null?void 0:e.room_name)||a,subtitle:e!=null&&e.parent_room_slug?`You're in a breakout from "${e.parent_room_slug}". You'll return when the host ends breakouts.`:e!=null&&e.is_host?"You're the host â you can record + manage participants.":(e==null?void 0:e.mode)==="webinar"?"You've joined as an attendee (webinar mode: listen-only).":"You've joined as a participant.",actions:t.jsx("button",{className:"video-btn secondary",onClick:l,children:"Leave"}),appLayoutTitle:`BeetlVideo · ${(e==null?void 0:e.room_name)||a}`,fullBleed:!0,children:[f&&t.jsx("div",{className:"video-empty",children:"Connecting to meetingâ¦"}),n&&t.jsxs("div",{style:{padding:24},children:[t.jsx("div",{className:"video-error",children:n}),t.jsx("div",{className:"video-row",style:{marginTop:12},children:t.jsx("button",{className:"video-btn secondary",onClick:l,children:"Back to rooms"})})]}),c&&t.jsx("div",{style:{padding:24,maxWidth:520,margin:"0 auto"},children:t.jsxs("div",{style:{background:"rgba(99,102,241,0.1)",border:"1px solid rgba(99,102,241,0.4)",borderRadius:8,padding:20,color:"#fff"},children:[t.jsx("h3",{style:{margin:"0 0 8px 0",fontSize:16},children:"ð End-to-end encrypted meeting"}),t.jsxs("p",{style:{fontSize:13,color:"rgba(255,255,255,0.75)",marginTop:0},children:["Enter the shared passphrase to join. Everyone must use the same one. The server cannot decrypt media â recording and livestream are ",t.jsx("strong",{children:"disabled"})," while E2EE is on."]}),t.jsxs("form",{onSubmit:x,style:{display:"flex",flexDirection:"column",gap:12,marginTop:12},children:[t.jsx("input",{type:"password",value:i,onChange:s=>v(s.target.value),placeholder:"Shared passphrase (min 8 chars)",autoFocus:!0,style:{padding:"10px 12px",borderRadius:6,fontSize:14,background:"#1e293b",color:"#fff",border:"1px solid rgba(255,255,255,0.15)"}}),t.jsxs("div",{className:"video-row",style:{justifyContent:"flex-end",gap:8},children:[t.jsx("button",{type:"button",className:"video-btn secondary",onClick:l,children:"Cancel"}),t.jsx("button",{type:"submit",className:"video-btn",children:"Join encrypted meeting"})]})]})]})}),e&&!n&&!c&&t.jsx("div",{style:{height:"calc(100vh - 220px)",minHeight:480},children:t.jsx(j,{wsUrl:e.ws_url,token:e.token,onLeave:l,slug:a,canInvite:!e.parent_room_slug,isHost:!!e.is_host,mode:e.mode||"meeting",canPublish:e.can_publish!==!1,parentSlug:e.parent_room_slug||"",e2eePassphrase:e.enable_e2ee?m:"",enableRecording:!!e.enable_recording,muteOnEntry:!!e.mute_on_entry,allowParticipantModeration:!!e.allow_participant_moderation,height:"100%"})})]})}export{N as default};
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.