1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7205],{97205:function(e,t,r){r.r(t),r.d(t,{LiveLessonEditor:function(){return C}});var l=r(42620),n=r(40740),a=r(29012);let i="block w-full rounded-md border border-[rgb(var(--border-default))] bg-[rgb(var(--surface-base))] px-3 py-2 text-sm focus:border-[rgb(var(--focus-ring))] focus:outline-none focus:ring-2 focus:ring-[rgb(var(--focus-ring))]/30";function s(e){let{title:t,hint:r,children:n}=e;return(0,l.jsxs)("section",{className:"mt-6 rounded-lg border border-[rgb(var(--border-default))] bg-[rgb(var(--surface-base))] p-4",children:[(0,l.jsx)("h3",{className:"text-sm font-semibold text-[rgb(var(--text-primary))]",children:t}),r?(0,l.jsx)("p",{className:"mt-1 text-xs text-[rgb(var(--text-muted))]",children:r}):null,(0,l.jsx)("div",{className:"mt-3 space-y-4",children:n})]})}function o(e){let{label:t,hint:r,error:a,children:i}=e,s=(0,n.useId)(),o=r?"".concat(s,"-hint"):void 0,d=a?"".concat(s,"-error"):void 0,c=[o,d].filter(Boolean).join(" ")||void 0;return(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{htmlFor:s,className:"block text-sm font-medium text-[rgb(var(--text-secondary))]",children:t}),(0,l.jsx)("div",{className:"mt-1",children:i({id:s,describedBy:c})}),r?(0,l.jsx)("p",{id:o,className:"mt-1 text-xs text-[rgb(var(--text-muted))]",children:r}):null,a?(0,l.jsx)("p",{id:d,className:"mt-1 text-xs text-[rgb(var(--danger))]",children:a}):null]})}function d(e){let{label:t,hint:r,checked:a,onChange:i}=e,s=(0,n.useId)(),o=r?"".concat(s,"-hint"):void 0;return(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"flex items-start gap-2",children:[(0,l.jsx)("input",{id:s,type:"checkbox",checked:a,"aria-describedby":o,onChange:e=>i(e.target.checked),className:"mt-0.5 h-4 w-4 rounded border-[rgb(var(--border-default))] text-[rgb(var(--brand))] focus:ring-[rgb(var(--focus-ring))]"}),(0,l.jsx)("label",{htmlFor:s,className:"text-sm text-[rgb(var(--text-secondary))]",children:t})]}),r?(0,l.jsx)("p",{id:o,className:"ml-6 mt-1 text-xs text-[rgb(var(--text-muted))]",children:r}):null]})}var c=r(64904),u=r(76884);
1function m(e){let{content:t,onChange:r}=e,d=(0,a.T)("builderMain"),m=(0,n.useMemo)(()=>(0,c.iu)(),[]),v=(0,u.cW)(t),p=t.startsAt&&t.endsAt&&Date.parse(t.endsAt)<=Date.parse(t.startsAt);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(s,{title:d("live.scheduleHeading"),children:[(0,l.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,l.jsx)(o,{label:d("live.startLabel"),children:e=>{let{id:n}=e;return(0,l.jsx)("input",{id:n,type:"datetime-local",className:i,value:(0,c.h3)(t.startsAt,t.timezone),onChange:e=>r({startsAt:(0,c.pC)(e.target.value,t.timezone)})})}}),(0,l.jsx)(o,{label:d("live.endLabel"),error:p?d("live.invalidTimes"):null,children:e=>{let{id:n,describedBy:a}=e;return(0,l.jsx)("input",{id:n,type:"datetime-local",className:i,"aria-describedby":a,"aria-invalid":!!p||void 0,value:(0,c.h3)(t.endsAt,t.timezone),onChange:e=>r({endsAt:(0,c.pC)(e.target.value,t.timezone)})})}})]}),(0,l.jsx)(o,{label:d("live.timezoneLabel"),hint:d("live.timezoneHint"),children:e=>{let{id:n,describedBy:a}=e;return(0,l.jsxs)("select",{id:n,className:i,"aria-describedby":a,value:t.timezone,onChange:e=>r({timezone:e.target.value}),children:[m.includes(t.timezone)?null:(0,l.jsx)("option",{value:t.timezone,children:t.timezone}),m.map(e=>(0,l.jsx)("option",{value:e,children:e},e))]})}}),null!=v?(0,l.jsxs)("p",{className:"text-xs text-[rgb(var(--text-muted))]",children:[d("live.durationLabel"),": ",d("live.durationValue",{minutes:v})]}):null]}),(0,l.jsxs)(s,{title:d("live.whereHeading"),children:[(0,l.jsx)(o,{label:d("live.providerLabel"),children:e=>{let{id:n}=e;return(0,l.jsx)("select",{id:n,className:i,value:t.provider,onChange:e=>r({provider:e.target.value}),children:u.jI.map(e=>(0,l.jsx)("option",{value:e,children:d("live.provider".concat(e.charAt(0).toUpperCase()).concat(e.slice(1)))},e))})}}),(0,l.jsx)(o,{label:d("live.joinUrlLabel"),hint:d("live.joinUrlHint"),children:e=>{var n;let{id:a,describedBy:s}=e;return(0,l.jsx)("input",{id:a,type:"url",inputMode:"url",className:i,"aria-describedby":s,placeholder:"https://",value:null!==(n=t.joinUrl)&&void 0!==n?n:"",onChange:e=>r({joinUrl:e.target.value.trim()||null})})}}),(0,l.jsx)(o,{label:d("live.dialInLabel"),hint:d("live.dialInHint"),children:e=>{var n;let{id:a,describedBy:s}=e;return(0,l.jsx)("input",{id:a,type:"text",className:i,"aria-describedby":s,value:null!==(n=t.dialIn)&&void 0!==n?n:"",onChange:e=>r({dialIn:e.target.value||null})})}})]})]})}function v(e){let{accessibility:t,onChange:r}=e,n=(0,a.T)("builderMain");return(0,l.jsxs)(s,{title:n("live.a11yHeading"),hint:n("live.a11yHint"),children:[(0,l.jsx)(d,{label:n("live.captionsLabel"),hint:n("live.captionsHint"),checked:t.captionsProvided,onChange:e=>r({captionsProvided:e})}),(0,l.jsx)(o,{label:n("live.interpreterUrlLabel"),hint:n("live.interpreterUrlHint"),children:e=>{var n;let{id:a,describedBy:s}=e;return(0,l.jsx)("input",{id:a,type:"url",inputMode:"url",className:i,"aria-describedby":s,placeholder:"https://",value:null!==(n=t.interpreterUrl)&&void 0!==n?n:"",onChange:e=>r({interpreterUrl:e.target.value.trim()||null})})}}),(0,l.jsx)(o,{label:n("live.interpreterLanguageLabel"),children:e=>{var a;let{id:s}=e;return(0,l.jsxs)("select",{id:s,className:i,value:null!==(a=t.interpreterLanguage)&&void 0!==a?a:"",onChange:e=>r({interpreterLanguage:e.target.value||null}),children:[(0,l.jsx)("option",{value:"",children:n("live.interpreterLanguageNone")}),u.t_.map(e=>(0,l.jsx)("option",{value:e,children:n("other"===e?"live.langOther":"live.lang".concat(e))},e))]})}}),(0,l.jsx)(o,{label:n("live.a11yNotesLabel"),hint:n("live.a11yNotesHint"),children:e=>{var n;let{id:a,describedBy:s}=e;return(0,l.jsx)("textarea",{id:a,rows:3,maxLength:2e3,className:i,"aria-describedby":s,value:null!==(n=t.notes)&&void 0!==n?n:"",onChange:e=>r({notes:e.target.value||null})})}})]})}function p(e){var t;let{recordingLessonId:r,videoLessons:o,lessonTitle:d,canCreate:c,onChange:u,onCreate:m}=e,v=(0,a.T)("builderMain"),[p,h]=(0,n.useState)(!1),[b,x]=(0,n.useState)(null),g=null!==(t=o.find(e=>e.id===r))&&void 0!==t?t:null,f=async()=>{h(!0),x(null);try{let e=await m("".concat(d," (recording)"));e?u(e.id):x(v("live.errorGeneric"))}catch(e){x(v("live.errorGeneric"))}finally{h(!1)}};return(0,l.jsxs)(s,{title:v("live.recordingHeading"),hint:v("live.recordingHint"),children:[g?(0,l.jsxs)("p",{className:"flex flex-wrap items-center gap-3 text-sm text-[rgb(var(--text-secondary))]",children:[(0,l.jsx)("span",{children:v("live.recordingLinked",{title:g.title})}),(0,l.jsx)("button",{type:"button",onClick:()=>u(null),className:"rounded-md border border-[rgb(var(--border-default))] px-2 py-1 text-xs hover:bg-[rgb(var(--surface-raised))]",children:v("live.recordingUnlink")})]}):(0,l.jsx)("p",{className:"text-sm text-[rgb(var(--text-muted))]",children:v("live.recordingNone")}),(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{htmlFor:"live-recording-select",className:"block text-sm font-medium text-[rgb(var(--text-secondary))]",children:v("live.recordingSelectLabel")}),(0,l.jsxs)("select",{id:"live-recording-select",className:"".concat(i," mt-1"),value:null!=r?r:"",onChange:e=>u(e.target.value||null),children:[(0,l.jsx)("option",{value:"",children:v("live.recordingSelectNone")}),o.map(e=>(0,l.jsx)("option",{value:e.id,children:e.title},e.id))]})]}),c?(0,l.jsxs)("div",{children:[(0,l.jsx)("button",{type:"button",onClick:f,disabled:p,className:"rounded-md border border-[rgb(var(--border-default))] px-3 py-1.5 text-sm text-[rgb(var(--text-secondary))] hover:bg-[rgb(var(--surface-raised))] disabled:opacity-60",children:p?v("live.recordingCreating"):v("live.recordingCreate")}),(0,l.jsx)("p",{className:"mt-1 text-xs text-[rgb(var(--text-muted))]",children:v("live.recordingUploadHint")}),b?(0,l.jsx)("p",{role:"alert",className:"mt-1 text-xs text-[rgb(var(--danger))]",children:b}):null]}):null]})}function h(e){let{settings:t,durationMinutes:r,onChange:n}=e,c=(0,a.T)("builderMain"),m=null==t.attendanceThresholdMinutes,v=null==r?null:(0,u.gJ)(r);return(0,l.jsxs)(s,{title:c("live.attendanceHeading"),children:[(0,l.jsx)(o,{label:c("live.thresholdLabel"),hint:m?null!=v?"".concat(c("live.thresholdHint")," ").concat(c("live.thresholdAutoValue",{minutes:v})):c("live.thresholdUnscheduled"):c("live.thresholdHint"),children:e=>{var r;let{id:a,describedBy:s}=e;return(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,l.jsx)("input",{id:a,type:"number",min:1,max:1440,step:1,className:"".concat(i," max-w-[9rem]"),"aria-describedby":s,placeholder:null!=v?String(v):"",value:null!==(r=t.attendanceThresholdMinutes)&&void 0!==r?r:"",onChange:e=>{let t=e.target.value.trim();if(!t)return n({attendanceThresholdMinutes:null});let r=Number.parseInt(t,10);n({attendanceThresholdMinutes:Number.isFinite(r)&&r>0?Math.min(r,1440):null})}}),m?(0,l.jsx)("span",{className:"text-xs text-[rgb(var(--text-muted))]",children:c("live.thresholdAuto")}):null]})}}),(0,l.jsx)(d,{label:c("live.autoCompleteLabel"),hint:c("live.autoCompleteHint"),checked:t.autoCompleteOnAttendance,onChange:e=>n({autoCompleteOnAttendance:e})}),(0,l.jsx)(d,{label:c("live.selfReportLabel"),hint:c("live.selfReportHint"),checked:t.allowSelfReport,onChange:e=>n({allowSelfReport:e})})]})}var b=r(67220),x=r(19187);let g=[{key:"bold",labelKey:"toolbarBold",isActive:e=>e.isActive("bold"),run:e=>e.chain().focus().toggleBold().run()},{key:"italic",labelKey:"toolbarItalic",isActive:e=>e.isActive("italic"),run:e=>e.chain().focus().toggleItalic().run()},{key:"h3",labelKey:"toolbarHeading",isActive:e=>e.isActive("heading",{level:3}),run:e=>e.chain().focus().toggleHeading({level:3}).run()},{key:"bullet",labelKey:"toolbarBulletList",isActive:e=>e.isActive("bulletList"),run:e=>e.chain().focus().toggleBulletList().run()},{key:"ordered",labelKey:"toolbarNumberedList",isActive:e=>e.isActive("orderedList"),run:e=>e.chain().focus().toggleOrderedList().run()}];function f(e){let{value:t,onChange:r,ariaLabel:i}=e,s=(0,a.T)("builderMain"),o=(0,b.jE)({immediatelyRender:!1,extensions:(0,x.L)(),content:null!=t?t:void 0,editorProps:{attributes:{"aria-label":i,class:"prose prose-sm max-w-none px-3 py-3 focus:outline-none min-h-[8rem]"}}
1,onUpdate:e=>{let{editor:t}=e;return r(t.isEmpty?null:t.getJSON())}});return((0,n.useEffect)(()=>()=>null==o?void 0:o.destroy(),[o]),o)?(0,l.jsxs)("div",{className:"rounded-md border border-[rgb(var(--border-default))] bg-[rgb(var(--surface-base))] focus-within:border-[rgb(var(--focus-ring))] focus-within:ring-2 focus-within:ring-[rgb(var(--focus-ring))]/30",children:[(0,l.jsxs)("div",{role:"toolbar","aria-label":s("toolbarFormattingLabel"),className:"flex flex-wrap items-center gap-1 border-b border-[rgb(var(--border-default))] px-2 py-1.5",children:[g.map(e=>(0,l.jsx)("button",{type:"button",onClick:()=>e.run(o),"aria-pressed":e.isActive(o),className:"rounded px-2 py-1 text-xs font-medium text-[rgb(var(--text-secondary))] hover:bg-[rgb(var(--surface-raised))] aria-pressed:bg-[rgb(var(--brand))]/10 aria-pressed:text-[rgb(var(--text-primary))]",children:"h3"===e.key?s(e.labelKey,{level:3}):s(e.labelKey)},e.key)),(0,l.jsx)("button",{type:"button",onClick:()=>{let e=window.prompt(s("toolbarAddLink"));null!==e&&(e?o.chain().focus().extendMarkRange("link").setLink({href:e}).run():o.chain().focus().unsetLink().run())},"aria-pressed":o.isActive("link"),className:"rounded px-2 py-1 text-xs font-medium text-[rgb(var(--text-secondary))] hover:bg-[rgb(var(--surface-raised))] aria-pressed:bg-[rgb(var(--brand))]/10 aria-pressed:text-[rgb(var(--text-primary))]",children:s("toolbarAddLink")})]}),(0,l.jsx)(b.kg,{editor:o})]}):null}let y={matched:"live.statusMatched",unknown_email:"live.statusUnknownEmail",no_email:"live.statusNoEmail"};function j(e){var t;let{lessonId:r,onImported:i}=e,s=(0,a.T)("builderMain"),o=(0,n.useRef)(null),[d,c]=(0,n.useState)(null),[u,m]=(0,n.useState)(!1),[v,p]=(0,n.useState)(null),[h,b]=(0,n.useState)(null),x=async e=>{if(d){m(!0),b(null);try{let l=await fetch("/api/lessons/".concat(r,"/attendance/import"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({csv:d,dryRun:e})}),n=await l.json();if(!l.ok){var t;b(null!==(t=null==n?void 0:n.error)&&void 0!==t?t:s("live.errorGeneric"));return}p(n.data),e||i()}catch(e){b(s("live.errorGeneric"))}finally{m(!1)}}},g=null!==(t=null==v?void 0:v.results.length)&&void 0!==t?t:0;return(0,l.jsxs)("div",{className:"mt-6 rounded-lg border border-[rgb(var(--border-default))] p-4",children:[(0,l.jsx)("h4",{className:"text-sm font-semibold text-[rgb(var(--text-primary))]",children:s("live.importHeading")}),(0,l.jsx)("p",{className:"mt-1 text-xs text-[rgb(var(--text-muted))]",children:s("live.importHint")}),(0,l.jsx)("p",{className:"mt-1 text-xs font-medium text-[rgb(var(--text-secondary))]",children:s("live.zoomApiNote")}),(0,l.jsx)("label",{htmlFor:"live-import-file",className:"mt-3 block text-sm font-medium text-[rgb(var(--text-secondary))]",children:s("live.importFileLabel")}),(0,l.jsx)("input",{id:"live-import-file",ref:o,type:"file",accept:".csv,text/csv",className:"mt-1 block w-full text-sm",onChange:async e=>{var t;let r=null===(t=e.target.files)||void 0===t?void 0:t[0];p(null),b(null),c(r?await r.text():null)}}),(0,l.jsxs)("div",{className:"mt-3 flex flex-wrap gap-2",children:[(0,l.jsx)("button",{type:"button",disabled:!d||u,onClick:()=>x(!0),className:"rounded-md border border-[rgb(var(--border-default))] px-3 py-1.5 text-sm hover:bg-[rgb(var(--surface-raised))] disabled:opacity-60",children:u?s("live.importing"):s("live.importPreview")}),(0,l.jsx)("button",{type:"button",disabled:!d||u,onClick:()=>x(!1),className:"rounded-md bg-[rgb(var(--brand))] px-3 py-1.5 text-sm font-medium text-white disabled:opacity-60",children:u?s("live.importing"):s("live.importApply")})]}),h?(0,l.jsx)("p",{role:"alert",className:"mt-2 text-sm text-[rgb(var(--danger))]",children:h}):null,v?(0,l.jsxs)("div",{className:"mt-4","aria-live":"polite",children:[(0,l.jsx)("p",{className:"text-sm font-medium text-[rgb(var(--text-primary))]",children:v.dryRun?s("live.importDryRunTitle"):s("live.importResultTitle",{count:v.imported,total:g})}),0===g||v.results.every(e=>"matched"!==e.status)?(0,l.jsx)("p",{className:"mt-1 text-xs text-[rgb(var(--text-muted))]",children:s("live.noAccountsMat
1ched")}):null,v.warnings.length?(0,l.jsxs)("details",{className:"mt-2",children:[(0,l.jsxs)("summary",{className:"cursor-pointer text-xs text-[rgb(var(--text-secondary))]",children:[s("live.importWarnings")," (",v.warnings.length,")"]}),(0,l.jsx)("ul",{className:"mt-1 list-disc pl-5 text-xs text-[rgb(var(--text-muted))]",children:v.warnings.map(e=>(0,l.jsx)("li",{children:e},e))})]}):null,(0,l.jsx)("div",{className:"mt-2 overflow-x-auto",children:(0,l.jsxs)("table",{className:"w-full text-left text-xs",children:[(0,l.jsx)("caption",{className:"sr-only",children:s("live.importHeading")}),(0,l.jsx)("thead",{children:(0,l.jsxs)("tr",{className:"text-[rgb(var(--text-muted))]",children:[(0,l.jsx)("th",{scope:"col",className:"py-1 pr-3 font-medium",children:s("live.colName")}),(0,l.jsx)("th",{scope:"col",className:"py-1 pr-3 font-medium",children:s("live.colEmail")}),(0,l.jsx)("th",{scope:"col",className:"py-1 pr-3 font-medium",children:s("live.colMinutes")}),(0,l.jsx)("th",{scope:"col",className:"py-1 font-medium",children:s("live.colCredit")})]})}),(0,l.jsx)("tbody",{children:v.results.map((e,t)=>{var r,n;return(0,l.jsxs)("tr",{className:"border-t border-[rgb(var(--border-default))]",children:[(0,l.jsx)("td",{className:"py-1 pr-3",children:e.name}),(0,l.jsx)("td",{className:"py-1 pr-3",children:null!==(r=e.email)&&void 0!==r?r:"â"}),(0,l.jsx)("td",{className:"py-1 pr-3",children:e.minutes}),(0,l.jsx)("td",{className:"py-1",children:"matched"!==e.status?s(y[e.status]):e.present?s("live.creditYes"):s("live.notPresent")})]},"".concat(null!==(n=e.email)&&void 0!==n?n:e.name,"-").concat(t))})})]})})]}):null]})}let N={zoom_report:"live.sourceZoom",manual:"live.sourceManual",self:"live.sourceSelf"},w="px-3 py-2 align-top";function A(e){let{lessonId:t}=e,r=(0,a.T)("builderMain"),[i,s]=(0,n.useState)([]),[o,d]=(0,n.useState)(null),[c,u]=(0,n.use
1State)(!0),[m,v]=(0,n.useState)(null),[p,h]=(0,n.useState)(""),[b,x]=(0,n.useState)(""),[g,f]=(0,n.useState)(!1),y=(0,n.useCallback)(async()=>{try{let a=await fetch("/api/lessons/".concat(t,"/attendance")),i=await a.json();if(a.ok){var e,r,l,n;s(null!==(l=null===(e=i.data)||void 0===e?void 0:e.rows)&&void 0!==l?l:[]),d(null!==(n=null===(r=i.data)||void 0===r?void 0:r.thresholdMinutes)&&void 0!==n?n:null)}}catch(e){}finally{u(!1)}},[t]);(0,n.useEffect)(()=>{y()},[y]);let A=async()=>{let e=p.trim().toLowerCase(),l=Number.parseInt(b,10);if(e&&Number.isFinite(l)&&!(l<0)){f(!0),v(null);try{var n,a,i;let s=["Name,User Email,Join Time,Leave Time,Duration (Minutes)",",".concat(e,",,,").concat(l)].join("\n"),o=await fetch("/api/lessons/".concat(t,"/attendance/import"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({csv:s})}),d=await o.json();o.ok&&(null!==(a=null===(n=d.data)||void 0===n?void 0:n.imported)&&void 0!==a?a:0)!==0?(h(""),x(""),await y()):v(null!==(i=null==d?void 0:d.error)&&void 0!==i?i:r("live.statusUnknownEmail"))}catch(e){v(r("live.errorGeneric"))}finally{f(!1)}}},C=async e=>{window.confirm(r("live.removeConfirm"))&&(await fetch("/api/lessons/".concat(t,"/attendance?userId=").concat(encodeURIComponent(e.userId)),{method:"DELETE"}),await y())};return(0,l.jsxs)("section",{className:"mt-6 rounded-lg border border-[rgb(var(--border-default))] bg-[rgb(var(--surface-base))] p-4",children:[(0,l.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,l.jsx)("h3",{className:"text-sm font-semibold text-[rgb(var(--text-primary))]",children:r("live.attendanceTableHeading")}),(0,l.jsx)("a",{href:"/api/lessons/".concat(t,"/attendance?format=csv"),className:"rounded-md border border-[rgb(var(--border-default))] px-3 py-1.5 text-xs text-[rgb(var(--text-secondary))] hover:bg-[rgb(var(--surface-raised))]",children:r("live.exportCsv")})]}),c?(0,l.jsx)("p",{className:"mt-3 text-sm text-[rgb(var(--text-muted))]",children:r("live.attendanceLoading")}):0===i.length?(0,l.jsx)("p",{className:"mt-3 text-sm text-[rgb(var(--text-muted))]",children:r("live.attendanceEmpty")}):(0,l.jsx)("div",{className:"mt-3 overflow-x-auto",children:(0,l.jsxs)("table",{className:"w-full text-left text-sm",children:[(0,l.jsx)("caption",{className:"sr-only",children:r("live.attendanceTableHeading")}),(0,l.jsx)("thead",{children:(0,l.jsxs)("tr",{className:"text-xs text-[rgb(var(--text-muted))]",children:[(0,l.jsx)("th",{scope:"col",className:"".concat(w," font-medium"),children:r("live.colName")}),(0,l.jsx)("th",{scope:"col",className:"".concat(w," font-medium"),children:r("live.colEmail")}),(0,l.jsx)("th",{scope:"col",className:"".concat(w," font-medium"),children:r("live.colMinutes")}),(0,l.jsx)("th",{scope:"col",className:"".concat(w," font-medium"),children:r("live.colSource")}),(0,l.jsx)("th",{scope:"col",className:"".concat(w," font-medium"),children:r("live.colCredit")}),(0,l.jsx)("th",{scope:"col",className:"".concat(w," font-medium"),children:r("live.colActions")})]})}),(0,l.jsx)("tbody",{children:i.map(e=>{var t,n,a,i;return(0,l.jsxs)("tr",{className:"border-t border-[rgb(var(--border-default))]",children:[(0,l.jsx)("td",{className:w,children:null!==(t=e.fullName)&&void 0!==t?t:"â"}),(0,l.jsx)("td",{className:w,children:null!==(n=e.email)&&void 0!==n?n:"â"}),(0,l.jsx)("td",{className:w,children:e.minutes}),(0,l.jsx)("td",{className:w,children:r(N[e.source])}),(0,l.jsx)("td",{className:w,children:null!=o&&e.minutes>=o?r("live.creditYes"):r("live.creditNo")}),(0,l.jsx)("td",{className:w,children:(0,l.jsxs)("button",{type:"button",onClick:()=>C(e),className:"rounded-md border border-[rgb(var(--border-default))] px-2 py-1 text-xs text-[rgb(var(--danger))] hover:bg-[rgb(var(--surface-raised))]",children:[(0,l.jsx)("span",{className:"sr-only",children:r("live.removePerson",{name:null!==(i=null!==(a=e.fullName)&&void 0!==a?a:e.email)&&void 0!==i?i:""})}),(0,l.jsx)("span",{"aria-hidden":"true",children:"\xd7"})]})})]},e.userId)})})]})}),(0,l.jsxs)("div",{className:"mt-4 rounded-lg border border-[rgb(var(--border-default))] p-4",children:[(0,l.jsx)("h4",{className:"text-sm font-semibold text-[rgb(var(--text-primary))]",children:r("live.addPersonHeading")}),(0,l.jsxs)("div",{className:"mt-2 flex flex-wrap items-end gap-3",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{htmlFor:"live-att-email",className:"block text-xs font-medium text-[rgb(var(--text-secondary))]",children:r("live.emailLabel")}),(0,l.jsx)("input",{id:"live-att-email",type:"email",value:p,onChange:e=>h(e.target.value),className:"mt-1 rounded-md border border-[rgb(var(--border-default))] bg-[rgb(var(--surface-base))] px-3 py-2 text-sm focus:border-[rgb(var(--focus-ring))] focus:outline-none focus:ring-2 focus:ring-[rgb(var(--focus-ring))]/30"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{htmlFor:"live-att-minutes",className:"block text-xs font-medium text-[rgb(var(--text-secondary))]",children:r("live.minutesLabel")}),(0,l.jsx)("input",{id:"live-att-minutes",type:"number",min:0,max:1440,value:b,onChange:e=>x(e.target.value),className:"mt-1 w-28 rounded-md border border-[rgb(var(--border-default))] bg-[rgb(var(--surface-base))] px-3 py-2 text-sm focus:border-[rgb(var(--focus-ring))] focus:outline-none focus:ring-2 focus:ring-[rgb(var(--focus-ring))]/30"})]}),(0,l.jsx)("button",{type:"button",onClick:A,disabled:g,className:"rounded-md border border-[rgb(var(--border-default))] px-3 py-2 text-sm hover:bg-[rgb(var(--surface-raised))] disabled:opacity-60",children:g?r("live.adding"):r("live.addPerson")})]}),m?(0,l.jsx)("p",{role:"alert",className:"mt-2 text-sm text-[rgb(var(--danger))]",children:m}):null]}),(0,l.jsx)(j,{lessonId:t,onImported:y})]})}function C(e){var t;let{lessonId:r,lessonTitle:i,initialContent:o,videoLessons:d=[],canCreateRecording:c=!1,onCreateRecordingLesson:b,onSaveStateChange:x}
1=e,g=(0,a.T)("builderMain"),[y,j]=(0,n.useState)(()=>(0,u.Fk)(o)),[N,w]=(0,n.useState)(u.TI),C=(0,n.useRef)(null),L=(0,n.useRef)(null);(0,n.useEffect)(()=>{let e=!1;return(async()=>{try{let a=await fetch("/api/lessons/".concat(r,"/live")),i=await a.json();if(!e&&a.ok&&(null==i?void 0:i.data)){var t,l,n;w({attendanceThresholdMinutes:null!==(t=i.data.attendanceThresholdMinutes)&&void 0!==t?t:null,autoCompleteOnAttendance:null===(l=i.data.autoCompleteOnAttendance)||void 0===l||l,allowSelfReport:null!==(n=i.data.allowSelfReport)&&void 0!==n&&n})}}catch(e){}})(),()=>{e=!0}},[r]),(0,n.useEffect)(()=>()=>{C.current&&clearTimeout(C.current),L.current&&clearTimeout(L.current)},[]);let k=(0,n.useCallback)(e=>{x("saving"),C.current&&clearTimeout(C.current),C.current=setTimeout(async()=>{try{let t=await fetch("/api/lessons/".concat(r),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:e})});x(t.ok?"saved":"error")}catch(e){x("error")}},1200)},[r,x]),T=(0,n.useCallback)(e=>{j(t=>{let r={...t,...e};return k(r),r})},[k]),S=(0,n.useCallback)(e=>{j(t=>{let r={...t,accessibility:{...t.accessibility,...e}};return k(r),r})},[k]),M=(0,n.useCallback)(e=>{w(t=>{let l={...t,...e};return x("saving"),L.current&&clearTimeout(L.current),L.current=setTimeout(async()=>{try{let e=await fetch("/api/lessons/".concat(r,"/live"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:l})});x(e.ok?"saved":"error")}catch(e){x("error")}},800),l})},[r,x]);return(0,l.jsxs)("div",{children:[(0,l.jsx)(m,{content:y,onChange:T}),(0,l.jsx)(s,{title:g("live.descriptionLabel"),hint:g("live.descriptionHint"),children:(0,l.jsx)(f,{value:y.description,ariaLabel:g("live.descriptionLabel"),onChange:e=>T({description:e})})}),(0,l.jsx)(v,{accessibility:y.accessibility,onChange:S}),(0,l.jsx)(p,{recordingLessonId:null!==(t=y.recordingLessonId)&&void 0!==t?t:null,videoLessons:d,lessonTitle:i,canCreate:!!(c&&b),onChange:e=>T({recordingLessonId:e}),onCreate:async e=>b?b(e):null}),(0,l.jsx)(h,{settings:N,durationMinutes:(0,u.cW)(y),onChange:M}),(0,l.jsx)(A,{lessonId:r})]})}},76884:function(e,t,r){r.d(t,{Fk:function(){return c},TI:function(){return p},ZU:function(){return h},cW:function(){return m},gJ:function(){return v},jI:function(){return n},t_:function(){return a}});var l=r(27867);let n=["zoom","teams","meet","other"],a=["ASL","LIS","BSL","other"],i=l.Z_8().trim().url().max(2e3).nullable().optional(),s=l.Ryn({captionsProvided:l.O72().default(!1),interpreterUrl:i,interpreterLanguage:l.KmV(a).nullable().optional(),notes:l.Z_8().max(2e3).nullable().optional()}),o=l.Ryn({startsAt:l.Z_8().datetime({offset:!0}).nullable().optional(),endsAt:l.Z_8().datetime({offset:!0}).nullable().optional(),timezone:l.Z_8().min(1).max(64).default("UTC"),provider:l.KmV(n).default("zoom"),joinUrl:i,dialIn:l.Z_8().max(200).nullable().optional(),description:l._4T().nullable().optional(),accessibility:s.default({captionsProvided:!1}),recordingLessonId:l.Z_8().uuid().nullable().optional()}),d={startsAt:null,endsAt:null,timezone:"UTC",provider:"zoom",joinUrl:null,dialIn:null,description:null,accessibility:{captionsProvided:!1,interpreterUrl:null,interpreterLanguage:null,notes:null},recordingLessonId:null};function c(e){var t,r;let l=o.safeParse(null!=e?e:{});if(l.success)return{...d,...l.data};let a=e&&"object"==typeof e?e:{},i=s.safeParse(null!==(t=a.accessibility)&&void 0!==t?t:{});return{...d,startsAt:u(a.startsAt)?a.startsAt:null,endsAt:u(a.endsAt)?a.endsAt:null,timezone:"string"==typeof a.timezone&&a.timezone?a.timezone:"UTC",provider:n.includes(a.provider)?a.provider:"zoom",joinUrl:"string"==typeof a.joinUrl?a.joinUrl:null,dialIn:"string"==typeof a.dialIn?a.dialIn:null,description:null!==(r=a.description)&&void 0!==r?r:null,accessibility:i.success?i.data:d.accessibility,recordingLessonId:"string"==typeof a.recordingLessonId?a.recordingLessonId:null}}function u(e){return"string"==typeof e&&!Number.isNaN(Date.parse(e))}function m(e){if(!e.startsAt||!e.endsAt)return null;let t=Date.parse(e.endsAt)-Date.parse(e.startsAt);return!Number.isFinite(t)||t<=0?null:Math.round(t/6e4)}function v(e){return Math.max(1,Math.ceil(.6*e))}let p={attendanceThresholdMinutes:null,autoCompleteOnAttendance:!0,allowSelfReport:!1};function h(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Date;if(!e.startsAt)return"unscheduled";let r=Date.parse(e.startsAt),l=e.endsAt?Date.parse(e.endsAt):r+36e5,n=t.getTime();return n>=l?"ended":n>=r?"live":n>=r-9e5?"joinable":"upcoming"}l.Ryn({attendanceThresholdMinutes:l.Rxh().int().min(1).max(1440).nullable().optional(),autoCompleteOnAttendance:l.O72().optional(),allowSelfReport:l.O72().optional()})},64904:function(e,t,r){function l(e,t){var r;let l=n(e,t);
1return Math.round((Date.UTC(l.year,l.month-1,l.day,l.hour,l.minute,null!==(r=l.second)&&void 0!==r?r:0)-1e3*Math.floor(e.getTime()/1e3))/6e4)}function n(e,t){let r=new Intl.DateTimeFormat("en-US",{timeZone:t,hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}),l={};for(let t of r.formatToParts(e))"literal"!==t.type&&(l[t.type]=Number(t.value));return{year:l.year,month:l.month,day:l.day,hour:24===l.hour?0:l.hour,minute:l.minute,second:l.second}}function a(e,t){var r;let n=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,null!==(r=e.second)&&void 0!==r?r:0),a=l(new Date(n),t),i=n-6e4*a,s=l(new Date(i),t);return s!==a&&(i=n-6e4*s),new Date(i)}r.d(t,{VV:function(){return a},VY:function(){return n},h3:function(){return s},iu:function(){return d},pC:function(){return o}});let i=e=>String(e).padStart(2,"0");function s(e,t){if(!e)return"";let r=new Date(e);if(Number.isNaN(r.getTime()))return"";let l=n(r,t);return"".concat(l.year,"-").concat(i(l.month),"-").concat(i(l.day),"T").concat(i(l.hour),":").concat(i(l.minute))}function o(e,t){let r=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2}))?$/.exec(e.trim());return r?a({year:+r[1],month:+r[2],day:+r[3],hour:+r[4],minute:+r[5],second:r[6]?+r[6]:0},t).toISOString():null}function d(){let e=Intl;if("function"==typeof e.supportedValuesOf)try{return e.supportedValuesOf("timeZone")}catch(e){}return["UTC","Europe/Rome","Europe/Madrid","Europe/London","Europe/Berlin","Europe/Paris","America/New_York","America/Chicago","America/Los_Angeles","America/Sao_Paulo","Asia/Tokyo","Asia/Singapore","Australia/Sydney"]}},73300:function(e,t,r){r.d(t,{V:function(){return a}});var l=r(19758);function n(e){var t,r;return{latex:null!==(r=null!==(t=e.getAttribute("data-latex"))&&void 0!==t?t:e.textContent)&&void 0!==r?r:"",display:"block"===e.getAttribute("data-math")}}let a=l.NB.create({name:"math",group:"inline",inline:!0,atom:!0,selectable:!0,draggable:!1,addOptions:()=>({onRequestEdit:void 0}),addAttributes:()=>({latex:{default:""},display:{default:!1}}),parseHTML:()=>[{tag:"span[data-math]",getAttrs:e=>n(e)},{tag:"div[data-math]",getAttrs:e=>n(e)}],renderHTML(e){var t;let{node:r,HTMLAttributes:n}=e,a=String(null!==(t=r.attrs.latex)&&void 0!==t?t:""),i=!!r.attrs.display,s=(0,l.P1)(n,{"data-math":i?"block":"inline","data-latex":a,class:"math math-".concat(i?"block":"inline")});return delete s.latex,delete s.display,[i?"div":"span",s,a]},addCommands(){return{insertMath:e=>t=>{let{commands:r}=t;return r.insertContent({type:this.name,attrs:e})},updateMath:(e,t)=>r=>{let{tr:l,state:n,dispatch:a}=r,i=n.doc.nodeAt(e);return!!i&&i.type.name===this.name&&(a&&l.setNodeMarkup(e,void 0,{...i.attrs,...t}),!0)},requestMathEdit:()=>e=>{var t,r;let{state:l}=e,{selection:n}=l,a="node"in n?n.node:null,i=(null==a?void 0:a.type.name)===this.name;return null===(t=(r=this.options).onRequestEdit)||void 0===t||t.call(r,{latex:i?a.attrs.latex:"",display:!!i&&a.attrs.display,pos:i?n.from:null}),!0}}},addKeyboardShortcuts(){return{"Mod-Shift-m":()=>this.editor.commands.requestMathEdit()}}})},19187:function(e,t,r){r.d(t,{L:function(){return m}});var l=r(1984),n=r(40886),a=r(98719),i=r(19758);let s=/^https:\/\/(player\.vimeo\.com\/video\/\d+|(www\.)?youtube(-nocookie)?\.com\/embed\/[\w-]+)/i,o=i.NB.create({name:"embed",group:"block",atom:!0,selectable:!0,draggable:!0,addAttributes:()=>({src:{default:null},title:{default:"Embedded video"},provider:{default:null}}),parseHTML:()=>[{tag:"iframe[src]",getAttrs:e=>{let t=e.getAttribute("src")||"";return!!s.test(t)&&{src:t,title:e.getAttribute("title")||"Embedded video",provider:/vimeo/i.test(t)?"vimeo":"youtube"}}}],renderHTML(e){let{HTMLAttributes:t}=e,r="string"==typeof t.src?t.src:"";if(!s.test(r))return["div",{}];let l=t.title||"Embedded video";return["div",{class:"embed-video",style:"position:relative;padding-bottom:56.25%;height:0;overflow:hidden;border-radius:0.5rem"},["iframe",(0,i.P1)({src:r,title:l,loading:"lazy",frameborder:"0",allow:"autoplay; fullscreen; picture-in-picture",allowfullscreen:"true",style:"position:absolute;top:0;left:0;width:100%;height:100%;border:0"})]]}});var d=r(73300),c=r(56036);let u=[2,3,4];function m(){var e,t,r;let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[l.Z.configure({heading:{levels:u},link:!1}),null!==(e=i.link)&&void 0!==e?e:a.ZP,null!==(t=i.image)&&void 0!==t?t:n.ZP,o,null!==(r=i.math)&&void 0!==r?r:d.V,...(0,c.Ag)()]}},56036:function(e,t,r){r.d(t,{$z:function(){return b},dZ:function(){return h},Ag:function(){return v},W1:function(){return p}});var l=r(19758),n=r(25470);let a=new Set(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"]),i={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:"\xa0",hellip:"â¦",mdash:"â",ndash:"â",laquo:"\xab",raquo:"\xbb",copy:"\xa9",reg:"\xae",lsquo:"â",rsquo:"â",ldquo:"â",rdquo:"â",euro:"â¬",middot:"\xb7"};function s(e){return e.replace(/&(#x[0-9a-f]+|#\d+|[a-z]+);/gi,(e,t)=>{if("#"===t[0]){let r="x"===t[1].toLowerCase()?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return Number.isFinite(r)&&r>0?String.fromCodePoint(r):e}let r=i[t.toLowerCase()];return null!=r?r:e})}function o(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}let d=/([^\s"'<>/=]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'<>`]+)))?/g,c=/<!--[\s\S]*?-->
1|<\/([a-zA-Z][\w:-]*)\s*>|<([a-zA-Z][\w:-]*)((?:\s+[^>]*?)?)\s*(\/?)>/g,u=l.NB.create({name:"tableCaptionIgnore",parseHTML:()=>[{tag:"caption",ignore:!0}]}),m=n.iA.extend({addAttributes(){var e,t;return{...null!==(t=null===(e=this.parent)||void 0===e?void 0:e.call(this))&&void 0!==t?t:{},caption:{default:null,parseHTML:e=>{var t,r;return(null===(r=e.querySelector("caption"))||void 0===r?void 0:null===(t=r.textContent)||void 0===t?void 0:t.trim())||null},renderHTML:()=>({})}}},renderHTML(e){var t;let r=null===(t=this.parent)||void 0===t?void 0:t.call(this,e),l="string"==typeof e.node.attrs.caption?e.node.attrs.caption.trim():"";if(!l||!Array.isArray(r)||"table"!==r[0])return r;let[n,a,...i]=r;return[n,a,["caption",{},l],...i]}});function v(){return[m,n.SC,n.xD,n.pj,u]}function p(e){var t,r,l;let n=(null!==(t=e.content)&&void 0!==t?t:[]).filter(e=>"tableRow"===e.type),a=e=>(null==e?void 0:e.type)==="tableHeader",i=n.length>0&&(null!==(r=n[0].content)&&void 0!==r?r:[]).length>0&&(null!==(l=n[0].content)&&void 0!==l?l:[]).every(a),s=n.length>0&&n.every(e=>{var t;return a((null!==(t=e.content)&&void 0!==t?t:[])[0])});return{headerRow:i,headerColumn:s,ok:i||s}}function h(e){let t=0,r=e=>{var l;if(e&&"object"==typeof e)for(let n of("table"!==e.type||p(e).ok||(t+=1),null!==(l=e.content)&&void 0!==l?l:[]))r(n)};return r(e),t}function b(e){return/<th[\s>]/i.test(e)?function e(t){return t.map(t=>{if("text"===t.type)return o(t.text);let r=Object.entries(t.attrs).map(e=>{let[t,r]=e;return""===r?" ".concat(t):" ".concat(t,'="').concat(o(r),'"')}).join("");return a.has(t.tag)?"<".concat(t.tag).concat(r,">"):"<".concat(t.tag).concat(r,">").concat(e(t.children),"</").concat(t.tag,">")}).join("")}(function e(t,r){return t.flatMap(t=>"text"===t.type?[t]:r(t)||[{...t,children:e(t.children,r)}])}(function(e){let t={type:"element",tag:"#root",attrs:{},children:[]},r=[t],l=0,n=e=>{e&&r[r.length-1].children.push({type:"text",text:s(e)})};for(let t of Array.from(e.matchAll(c))){var i,o,u,m;let c=null!==(o=t.index)&&void 0!==o?o:0;if(n(e.slice(l,c)),l=c+t[0].length,t[0].startsWith("<!--"))continue;let v=null===(i=t[1])||void 0===i?void 0:i.toLowerCase();if(v){let e=-1;for(let t=r.length-1;t>0;t-=1)if(r[t].tag===v){e=t;break}e>0&&(r.length=e);continue}let p=(null!==(u=t[2])&&void 0!==u?u:"").toLowerCase(),h={type:"element",tag:p,attrs:function(e){let t={};for(let a of Array.from(e.matchAll(d))){var r,l,n;let e=a[1].toLowerCase();if("/"===e)continue;let i=null!==(n=null!==(l=null!==(r=a[2])&&void 0!==r?r:a[3])&&void 0!==l?l:a[4])&&void 0!==n?n:"";t[e]=s(i)}return t}(null!==(m=t[3])&&void 0!==m?m:""),children:[]};r[r.length-1].children.push(h),"/"===t[4]||a.has(p)||r.push(h)}return n(e.slice(l)),t.children}(e),e=>"table"!==e.tag?null:((function(e){let t=[],r=e=>{for(let l of e)"element"===l.type&&("tr"===l.tag?t.push(l):"table"!==l.tag&&r(l.children))};return r(e.children),t})(e).forEach((e,t)=>{e.children.filter(e=>"element"===e.type&&("th"===e.tag||"td"===e.tag)).forEach((e,r)=>{"th"!==e.tag||e.attrs.scope||(0===t?e.attrs={...e.attrs,scope:"col"}:0===r&&(e.attrs={...e.attrs,scope:"row"}))})}),[e]))):e}}}]);
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.