1!function(){try{var e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[(new e.Error).stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(null!=n)for(var a in n)n.hasOwnProperty(a)&&(e[a]=n[a])}return e}({},e._sentryModuleMetadata[(new e.Error).stack],{"_sentryBundlerPluginAppKey:mentortools-frontend":!0});var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9ef49b91-89bf-4f23-9fd3-6606832ae320",e._sentryDebugIdIdentifier="sentry-dbid-9ef49b91-89bf-4f23-9fd3-6606832ae320")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2506],{3329:(e,t,n)=>{"use strict";n.d(t,{A:()=>d});var a=n(67768),i=n(40097),r=n(63456),s=n(11313),o=n(48367),l=n(16361);let d=()=>{let e=(0,a.jE)(),{t}=(0,r.Bd)("translation",{keyPrefix:"ALERT"}),{notify:n,notifyWithDescription:d}=(0,l.A)();return(0,i.n)({mutationFn:e=>o.u.deleteTemplate({template_id:e}),onSuccess:async()=>{e.invalidateQueries(s.Ay.certificates.allTemplates),n("CERTIFICATES.delete",{type:"success"})},onError:e=>{let n=e?.response?.data,a=(n?.error?.match(/\[(.*?)\]/)?.[1]||"").split(",").map(e=>e.trim()).filter(Boolean);d("CERTIFICATES.delete_assigned",a.length>0?t("ERROR.CERTIFICATES.delete_assigned_lessons",{ids:a.join(", ")}):t("ERROR.unexpected"),{type:"error"})}})}},10760:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var a=n(89099),i=n(23877),r=n(48790),s=n(11313),o=n(14958),l=n(34020);let d=["id","description","title","payment_type_id","is_active","image_id","is_archived","course_category.*","order","launch_date_enabled","is_content_duration_shown","total_content_duration_s","is_file_transcription_shown","modules.id","modules.title","modules.order","modules.is_published","modules.available_at","modules.short_description","modules.public_description","modules.image_id","modules.course_id","modules.lessons.id","modules.lessons.title","modules.lessons.order","modules.lessons.available_at","modules.lessons.type_id","modules.lessons.module_id","modules.lessons.submodule_id","modules.lessons.image_id","modules.submodules.id","modules.submodules.title","modules.submodules.order"],c=(e,{hasAccess:t=!0},n)=>{let c=(0,a.useRouter)(),{user:u}=(0,o.A)(),{courseId:p,moduleId:m,lessonId:y,...x}=e;return(0,l.A)({queryDataKey:s.Ay.courses.all.queryKey,queryCountKey:s.Ay.courses.count.queryKey,queryDataFn:({limit:t,offset:a,order:i})=>r.A.getAll({columns:d,limit:n?.limit||t,offset:n?.offset||a,order_by:n?.order||i,filter_by:[{attribute:"portal_id",operator:"==",value:u?.portal?.id},{attribute:"is_archived",operator:"==",value:e.isArchived}],search_by:[{attribute:"title",operator:"ilike",value:e.search}]}),queryCountFn:()=>r.A.getCount({filter_by:[{attribute:"portal_id",operator:"==",value:u?.portal?.id},{attribute:"is_archived",operator:"==",value:e.isArchived}],search_by:[{attribute:"title",operator:"ilike",value:e.search}]}),enabled:t},{initialPage:parseInt(`${c.query?.page}`)||1,initialLimit:parseInt(`${c.query?.limit}`)||Number(localStorage.getItem(i.sk))||10,initialOrder:{column:c.query?.order?`${c.query?.order}`:"order",ascending:!c.query?.ascending||!!c.query?.ascending},searchQuery:x})}},13851:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var a=n(67768),i=n(40097),r=n(11313),s=n(48367),o=n(16361);let l=()=>{let e=(0,a.jE)(),{notify:t}=(0,o.A)();return(0,i.n)({mutationFn:s.u.copyTemplate,onSuccess:async()=>{e.invalidateQueries(r.Ay.certificates.allTemplates),t("CERTIFICATES.duplicate",{type:"success"})},onError:()=>t("CERTIFICATES.duplicate",{type:"error"})})}},15726:(e,t,n)=>{"use strict";n.d(t,{Y:()=>s});var a=n(74359),i=n(11313),r=n(48367);let s=({templateId:e})=>(0,a.I)({...i.Ay.certificates.customerTemplate(e),queryFn:()=>r.u.getCustomerTemplate({template_id:e}),select:e=>e.data.result,retry:!1})},20917:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var a=n(81498),i=n(54683),r=n(37103);let s={getExternalSystemIntegrations:async()=>i.A.post(a.y.getExternalSystemIntegrationList),getWebhookPayload:async e=>i.A.post(a.y.getWebhookPayload,e),sendTestRequest:async e=>i.A.post(a.y.sendTestRequest,e),getIntegrations:async()=>i.A.post(a.y.getIntegrationList),addIntegration:async e=>i.A.post(a.y.addIntegration,{values:e}),removeIntegration:async e=>i.A.post(a.y.removeIntegration,e),updateIntegration:async e=>i.A.post(a.y.updateIntegration,{id:e.id,values:{...e}}),addIntegrationWithJwt:async e=>i.A.post(a.y.addIntegrationWithJwt,e),getOathUri:async e=>i.A.post(a.y.getOathUri,{values:e}),getWebhookUri:async()=>i.A.post(a.y.getWebhookUri,{external_system_id:r.lH.ZOOM}),getEvents:async()=>i.A.post(a.y.getIntegrationRuleEventList),getActions:async()=>i.A.post(a.y.getIntegrationActionList),getAutomations:async e=>i.A.post(a.y.getIntegrationRuleList,e),getCount:async()=>i.A.post(a.y.getIntegrationRuleCount),getActiveIntegrationsCount:async()=>i.A.post(a.y.getActiveIntegrationsCount),getCourseInfo:async e=>i.A.post(a.y.getCourseInfo,e),getErrorTypes:async()=>i.A.post(a.y.getIntegrationErrorTypeList),getErrorLogList:async e=>i.A.post(a.y.getIntegrationErrorList,e),getMailingList:async e=>i.A.post(a.y.getIntegrationMailingList,{...e,limit:1e5}),addIntegrationRule:async e=>i.A.post(a.y.addIntegrationRule,{values:e}),updateIntegrationRule:async e=>i.A.post(a.y.updateIntegrationRule,{id:e.id,values:{...e}}),removeIntegrationRule:async e=>i.A.post(a.y.removeIntegrationRule,e),validateIntegrationRule:async e=>i.A.post(a.y.validateIntegrationRule,{values:e})}},32881:(e,t,n)=>{"use strict";n.d(t,{Fc:()=>p,O8:()=>c,SC:()=>d,bT:()=>o,hS:()=>l,lU:()=>u,vW:()=>m});var a=n(48711),i=n(69884),r=n(22870),s=n(61226);let o=(e,t)=>`${(0,s.Y9)("/editor/")}?page_type=certificate&id=${e}&access_token=${t?.token}&refresh_token=${t?.refresh_token}`,l=["Lessons previous lesson with","Quiz with"],d=e=>{var t;if(!(0,a.F0)(e)||!e.response?.data)return{missingInfo:{firstName:!1,lastName:!1,birthDate:!1},hasMissingInfo:!1};let n=(t=e.response?.data,JSON.parse(new TextDecoder().decode(t)))?.error,i="First name empty, but required"===n,r="Last name empty, but required"===n,s="Birth date empty, but required"===n;return{missingInfo:{firstName:i,lastName:r,birthDate:s},hasMissingInfo:i||r||s}},c=e=>`${window.location.origin}${(0,r.ZM)(i.C.certificateView.replace("[access_hash]",e))}`,u=e=>e?`${window.location.origin}${(0,r.ZM)(i.C.certificatePreview.replace("[id]",e.toString()))}`:"",p=0,m="Template not found"}
1,32952:(e,t,n)=>{"use strict";n.d(t,{L0:()=>i,nj:()=>s,y:()=>r});var a=n(34133);let i=e=>{let t=e.content,n=!!(e.mandatory_video_view??t?.mandatory_video_view),a=e.video_percent??t?.video_percent,i=null!=a?Number(a):null;return{mandatoryVideoView:n,videoPercent:null==i||Number.isNaN(i)?80:i}},r=(e,t=0)=>{let{mandatoryVideoView:n,videoPercent:a}=i(e);return!n||t>=a},s=e=>{let t=e.content?.link?.trim();return t?(0,a.k3)(t):!!e.content?.file_id}},36468:(e,t,n)=>{"use strict";n.d(t,{I$:()=>c,Iw:()=>d,O8:()=>p,Q7:()=>l,W3:()=>u,YS:()=>y,t4:()=>m});var a=n(48711),i=n(73127),r=n(54683);let s="/ai_widget_api/v1",o={list:`${s}/widget/list`,get:`${s}/widget/get`,templateList:`${s}/widget/template/list`,add:`${s}/widget/add`,update:`${s}/widget/update`,manifestUpdate:`${s}/widget/manifest/update`,publish:`${s}/widget/publish`,duplicate:`${s}/widget/duplicate`,delete:`${s}/widget/delete`,generate:`${s}/widget/generate`,generateStatus:`${s}/widget/generate/status`,placementUpsert:`${s}/widget/placement/upsert`,placementGet:`${s}/widget/placement/get`,placementDelete:`${s}/widget/placement/delete`,runtimeGet:`${s}/runtime/get`,runtimeEvent:`${s}/runtime/event`,runtimeAi:`${s}/runtime/ai`,runtimeVoiceToken:`${s}/runtime/voice/token`,landingGet:`${s}/landing/get`,landingEvent:`${s}/landing/event`,landingAi:`${s}/landing/ai`,landingVoiceToken:`${s}/landing/voice/token`},l={list:(e={})=>r.A.post(o.list,e),get:e=>r.A.post(o.get,e),templateList:(e={})=>r.A.post(o.templateList,e),add:e=>r.A.post(o.add,e),update:e=>r.A.post(o.update,e),updateManifest:e=>r.A.post(o.manifestUpdate,e),publish:e=>r.A.post(o.publish,e),duplicate:e=>r.A.post(o.duplicate,e),delete:e=>r.A.post(o.delete,e),generate:e=>r.A.post(o.generate,e),generateStatus:e=>r.A.post(o.generateStatus,e),placementUpsert:e=>r.A.post(o.placementUpsert,e),placementGet:e=>r.A.post(o.placementGet,e),placementDelete:e=>r.A.post(o.placementDelete,e),runtimeGet:e=>r.A.post(o.runtimeGet,e),runtimeEvent:e=>r.A.post(o.runtimeEvent,{...e,detail:e.detail??""}),runtimeAi:e=>r.A.post(o.runtimeAi,{...e,system:e.system??null}),runtimeVoiceToken:e=>r.A.post(o.runtimeVoiceToken,e),landingGet:e=>r.A.post(o.landingGet,e),landingEvent:e=>r.A.post(o.landingEvent,{...e,detail:e.detail??""}),landingAi:e=>r.A.post(o.landingAi,{...e,system:e.system??null}),landingVoiceToken:e=>r.A.post(o.landingVoiceToken,e)},d=e=>(0,i.FV)(e,402),c=e=>(0,i.FV)(e,429),u=e=>(0,i.FV)(e,504),p=e=>(0,i.FV)(e,404,403),m=e=>"string_too_long"===(e=>{if(!(0,a.F0)(e)||e.response?.status!==422)return null;let t=e.response.data?.error_code;return"string"==typeof t?t:null})(e),y=(e,t="unknown")=>{let n=d(e)?"credits":u(e)?"timeout":c(e)?"rate_limit":"unknown";return"credits"===n?"out_of_credits":"timeout"===n?"timeout":"rate_limit"===n?"rate_limited":t}},36594:(e,t,n)=>{"use strict";n.d(t,{A:()=>b});var a=n(37876),i=n(14232),r=n(66950),s=n(76587),o=n(15756),l=n(9423),d=n(62902),c=n(60072),u=n(31941),p=n(74234),m=n(64713),y=n(24261),x=n(99985),h=n(24156);let f=(0,m.Ay)(o.Ay)(({theme:e,width:t})=>({width:t||e.spacing(25),border:"none",fontFamily:e.typography.fontFamily})),_=(0,m.Ay)(s.A)({background:"none",margin:0}),g=(0,m.Ay)(y.A)(({theme:e})=>({fontSize:13,color:e.palette.grey[800]})),A=(0,m.Ay)(y.A)(({theme:e})=>({color:e.palette.error.main,position:"absolute",top:"100%"})),b=(0,i.memo)(({label:e,rgba:t,value:n,onChange:o,variant:m="circle",disabled:y,width:b,errorMessage:C,...j})=>{let v=(0,p.A)(),{id:k,isOpen:T,open:I,close:w,anchor:S}=(0,h.f)("popover"),E=(0,i.useCallback)(e=>{o?.(e.target.value)},[o]),L=(0,i.useCallback)(e=>{let t=`rgba(${e.r}, ${e.g}, ${e.b}, ${e.a})`;o?.(t)},[o]),N=(0,i.useMemo)(()=>n?n.replace(/^rgba?\(|\s+|\)$/g,"").split(",").reduce((e,t,n)=>(e[["r","g","b","a"][n]]=parseFloat(t),e),{r:0,g:0,b:0,a:0}):{r:0,g:0,b:0,a:0},[n]);return"rectangle"===m?(0,a.jsxs)(d.A,{spacing:v.spacing(1.5),position:"relative",marginBottom:C?v.spacing(8):0,children:[e&&(0,a.jsx)(g,{children:e}),(0,a.jsx)(r.A,{border:"1px solid",borderColor:C?v.palette.error.main:v.palette.grey[300],borderRadius:v.spacing(1.5),display:"flex",gap:v.spacing(2),padding:v.spacing(1.5),children:(0,a.jsxs)(d.A,{alignItems:"center",spacing:v.spacing(2),direction:"row",useFlexGap:!0,children:[(0,a.jsx)(f,{value:n,width:b,disabled:y,onChange:E}),(0,a.jsx)(_,{labelPlacement:"top",label:(0,a.jsx)(r.A,{onClick:y?w:I,children:(0,a.jsx)(r.A,{sx:{bgcolor:n,borderColor:v.palette.divider,borderStyle:"solid",borderWidth:1,borderRadius:v.spacing(1),cursor:"pointer",transition:"all 0.1s ease-in-out",height:24,width:24,"&:hover":{borderColor:v.palette.primary.main}}})}),control:(0,a.jsx)(l.Ay,{id:k,open:T,anchorEl:S,onClose:w,anchorOrigin:{vertical:"bottom",horizontal:"left"},children:(0,a.jsx)(r.A,{alignItems:"center",display:"flex",flexDirection:"column",gap:v.spacing(2),justifyContent:"center",padding:v.spacing(3),children:t?(0,a.jsx)(x.YJ,{color:n?N:{r:0,g:0,b:0,a:1},onChange:L}):(0,a.jsx)(x.jI,{color:n,onChange:o})})}),...j})]})}),C&&(0,a.jsx)(A,{children:C})]}):"circle"===m?(0,a.jsx)(r.A,{border:"1px",borderColor:v.palette.divider,borderRadius:"4px",display:"flex",gap:v.spacing(2),paddingX:"10
1px",paddingY:"7px",children:(0,a.jsx)(s.A,{sx:{background:"none"},label:(0,a.jsxs)(d.A,{alignItems:"center",gap:v.spacing(2),direction:"row",onClick:I,children:[(0,a.jsx)("div",{children:(0,a.jsx)(r.A,{sx:{bgcolor:n,borderColor:v.palette.divider,borderStyle:"solid",borderWidth:1,borderRadius:"100%",cursor:"pointer",transition:"all 0.1s ease-in-out",height:24,width:24,"&:hover":{borderColor:v.palette.primary.main}}})}),(0,a.jsx)(u.A,{children:e})]}),control:(0,a.jsx)(l.Ay,{id:k,open:T,anchorEl:S,onClose:w,anchorOrigin:{vertical:"bottom",horizontal:"left"},children:(0,a.jsxs)(r.A,{alignItems:"center",display:"flex",flexDirection:"column",gap:v.spacing(2),justifyContent:"center",padding:v.spacing(2),children:[(0,a.jsx)(x.jI,{color:n,onChange:o}),(0,a.jsx)(c.A,{size:"small",value:n,onChange:E,...j})]})}),...j})}):null})},36649:(e,t,n)=>{"use strict";n.d(t,{t:()=>s});var a=n(74359),i=n(11313),r=n(48367);let s=({params:{templateId:e,lessonId:t},options:n})=>(0,a.I)({...i.Ay.certificates.templateAvailabilityDetail(e,t),queryFn:()=>r.u.getTemplateAvailability({template_id:e,lesson_id:t}),select:e=>e.data.result,...n})},43219:(e,t,n)=>{"use strict";n.d(t,{HI:()=>r,Iu:()=>o,Nh:()=>a,Xc:()=>i,Y1:()=>s});let a={blank:"blank",memory:"memory",quiz:"quiz",flashcards:"flashcards",streak:"streak",voicecoach:"voicecoach",lead_quiz:"lead_quiz",lead_ai_coach:"lead_ai_coach",lead_voice_teaser:"lead_voice_teaser"},i={lesson:"lesson",landing:"landing"},r={draft:"draft",published:"published"},s={pending:"pending",running:"running",done:"done",error:"error"},o=24e3},46840:(e,t,n)=>{"use strict";n.d(t,{KL:()=>a,Q5:()=>i,YB:()=>s,k0:()=>r,oE:()=>o});let a={RichText:1,HTML:2,Button:3,Video:4,Audio:5,PDF:6,Certificate:10,AI_chat:11,Widget:12,LiveStream:13},i={Text:7,Video:8,Audio:9},r={[a.RichText]:"RichText",[a.HTML]:"HTML",[a.Button]:"Button",[a.Video]:"Video",[a.Audio]:"Audio",[a.PDF]:"PDF",[a.Certificate]:"Certificate",[i.Text]:"Text",[i.Video]:"Video",[i.Audio]:"Audio",[a.AI_chat]:"AI chat",[a.Widget]:"Widget",[a.LiveStream]:"Live Stream"},s=e=>Object.entries(a).filter(t=>t[1]===e)?.[0]?.[0],o=(e=0)=>Object.entries(i).filter(t=>t[1]===e)?.[0]?.[0]},48367:(e,t,n)=>{"use strict";n.d(t,{u:()=>r});var a=n(81498),i=n(54683);let r={getAllCertificates:e=>i.A.post(a.y.getCertificates,e),getCertificatesCount:e=>i.A.post(a.y.getCertificatesCount,e),createCertificate:e=>i.A.post(a.y.createCertificate,e),getCertificate:e=>i.A.post(a.y.getCertificate,e),downloadCertificate:e=>i.A.post(a.y.downloadCertificate,e,{responseType:"arraybuffer",headers:{Accept:"application/pdf"}}),getTemplates:e=>i.A.post(a.y.getTemplates,e),getTemplateDetail:e=>i.A.get(a.y.getTemplateDetail.replace("[id]",e.toString())),getRootTemplates:e=>i.A.post(a.y.getRootTemplates,e),addTemplate:e=>i.A.post(a.y.addTemplate,e),copyTemplate:e=>i.A.post(a.y.copyTemplate,e),updateTemplate:e=>i.A.post(a.y.updateTemplate,e),deleteTemplate:e=>i.A.post(a.y.deleteTemplate,e),addTemplateAvailability:e=>i.A.post(a.y.addTemplateAvailability,e),getTemplateAvailability:e=>i.A.post(a.y.getTemplateAvailability,e),deleteTemplateAvailability:e=>i.A.post(a.y.deleteTemplateAvailability,e),getCustomerTemplate:e=>i.A.post(a.y.getCustomerTemplate,e)}},48753:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var a=n(89099),i=n(34020),r=n(11313),s=n(48367);let o=({memberId:e,searchQuery:t,enabled:n=!0})=>{let o=(0,a.useRouter)();return(0,i.A)({queryDataKey:r.Ay.certificates.allCertificates.queryKey,queryCountKey:r.Ay.certificates.allCertificatesCount.queryKey,queryDataFn:({limit:n,offset:a,order:i})=>s.u.getAllCertificates({template_id:Number(t?.templateId)||void 0,portal_member_id:e,search_by_email:t?.search,end_timestamp:Number(t?.endDate)||void 0,start_timestamp:Number(t?.startDate)||void 0,filter_params:{limit:n,offset:a,order_by:i[0].column||"id",order_direction:i[0].ascending?"ascending":"descending"}}),queryCountFn:()=>s.u.getCertificatesCount({template_id:Number(t?.templateId)||void 0,portal_member_id:e,search_by_email:t?.search}),enabled:n},{searchQuery:t,initialPage:parseInt(`${o.query?.page}`)||1,initialLimit:parseInt(`${o.query?.limit}`)||10,initialOrder:{column:o.query?.order??"id",ascending:!o.query?.ascending||!!o.query?.ascending}})}},50782:(e,t,n)=>{"use strict";n.d(t,{A:()=>b});var a=n(37876),i=n(14232),r=n(79378),s=n(66950),o=n(22208),l=n(90748),d=n(62902),c=n(31941),u=n(74234),p=n(64713),m=n(67746),y=n(74472),x=n.n(y),h=n(70008),f=n.n(h),_=n(5157),g=n(30942);n(836),n(61087),n(65791),n(6961),n(28677);let A=(0,p.Ay)(s.A)(({theme:e})=>({position:"relative",width:"100%",minHeight:e.spacing(64),border:`1px solid ${e.palette.divider}`,borderRadius:e.shape.borderRadius,overflow:"hidden",backgroundColor:e.palette.background.paper,"& pre":{margin:0,padding:e.spacing(2),minHeight:e.spacing(64),fontSize:e.typography.body1.fontSize,fontFamily:"monospace",lineHeight:1.5,overflow:"auto",whiteSpace:"pre-wrap",wordBreak:"break-word",backgroundColor:"transparent !important"},"& textarea":{position:"absolute",top:0,left:0,width:"100%",height:"100%",padding:e.spacing(2),margin:0,border:"none",outline:"none",resize:"none",fontSize:e.typography.body1.fontSize,fontFamily:"monospace",lineHeight:1.5,backgroundColor:"transparent",color:"transparent",caretColor:e.palette.text.primary,whiteSpace:"pre-wrap",wordBreak:"break-word",overflow:"auto",zIndex:1},"& code":{fontFamily:"monospace",fontSize:e.typography.body1.fontSize,lineHeight:1.5}})),b=(0,i.memo)(({value:e="",onChange:t,additionalActionContent:n,disabled:s,...p})=>{let{htmlMode:y,update:h}=(0,m.er)(),{t:b}=(0,g.o)("translation",{keyPrefix:"PAGE.EDITOR.HTML"}),[C,j]=(0,i.useState)(y?"preview":"code"),v=(0,i.useRef)(null),k=(0,i.useRef)(null),T=(0,u.A)(),I=(0,i.useCallback)(e=>{try{return x().html(e,{indent_size:2,indent_char:" ",max_preserve_newlines:2,preserve_newlines:!0,wrap_line_length:0,wrap_attributes:"auto",wrap_attributes_indent_size:2,end_with_newline:!1,indent_inner_html:!0,indent_scripts:"normal",indent_empty_lines:!1,eol:"\n"})}catch(t){return e}},[]),w=(0,i.useCallback)(n=>()=>{if("code"===n&&e){let n=I(e);n!==e&&t(n)}j(n),h({htmlMode:"preview"===n})},[h,e,t,I]),S=(0,i.useCallback)(e=>()=>{j(e),h({htmlMode:"preview"===e})}
1,[h]);(0,i.useEffect)(()=>{S("code")()},[S]);let E=(0,i.useCallback)(e=>{let n=e.target.value;t?.(n)},[t]),L=(0,i.useMemo)(()=>e||"",[e]),N=(0,i.useMemo)(()=>{if(!L)return"";try{return f().highlight(L,f().languages.markup,"markup")}catch(e){return L.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}},[L]),O=(0,i.useCallback)(e=>{t(e.target.value)},[t]),R=(0,i.useCallback)(e=>{e.preventDefault();let n=I(e.clipboardData.getData("text/plain")),a=e.currentTarget,i=a.selectionStart,r=a.selectionEnd,s=L||"";t(s.substring(0,i)+n+s.substring(r)),setTimeout(()=>{if(v.current){let e=i+n.length;v.current.setSelectionRange(e,e)}},0)},[L,t,I]),M=(0,i.useCallback)(()=>{v.current&&k.current&&(k.current.scrollTop=v.current.scrollTop,k.current.scrollLeft=v.current.scrollLeft)},[]);return(0,i.useEffect)(()=>{let e=v.current,t=k.current;if(e&&t)return e.addEventListener("scroll",M),()=>{e.removeEventListener("scroll",M)}},[M]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(d.A,{direction:"row",gap:T.spacing(2),children:[(0,a.jsxs)(l.A,{variant:"outlined",color:"primary",children:[(0,a.jsx)(o.A,{"data-form-path":`${p["data-form-path"]||""}.preview_html`,"data-ai-field":`${p["data-ai-field"]||""}.preview_html button click`,"data-element-type":"button",onClick:w("code"),variant:"code"===C?"contained":"outlined",startIcon:(0,a.jsx)(_.A,{icon:"tabler:eye"}),children:b("preview")}),(0,a.jsx)(o.A,{"data-form-path":`${p["data-form-path"]||""}.html_code`,"data-ai-field":`${p["data-ai-field"]||""}.html_code button click`,"data-element-type":"button",onClick:w("preview"),variant:"preview"===C?"contained":"outlined",startIcon:(0,a.jsx)(_.A,{icon:"tabler:code"}),children:b("code")})]}),n&&n]}),y?(0,a.jsxs)(A,{children:[(0,a.jsx)("pre",{ref:k,children:(0,a.jsx)("code",{dangerouslySetInnerHTML:{__html:N}})}),(0,a.jsx)("textarea",{ref:v,value:L,onChange:O,onPaste:R,spellCheck:!1,disabled:s,...p})]}):(0,a.jsx)(m.Ay,{style:{resize:"none",minHeight:T.spacing(64)},value:e,onChange:E,disabled:s,...p}),(0,a.jsx)(r.A,{severity:"warning",children:(0,a.jsx)(c.A,{children:b("alert")})})]})})},52729:(e,t,n)=>{"use strict";n.d(t,{Q:()=>a});let a=(0,n(84961).DY)("widgets",{list:(e,t,n)=>({queryKey:[e,t,n]}),templates:(e,t)=>({queryKey:[e,t]}),detail:e=>({queryKey:[e]}),generateStatus:e=>({queryKey:[e]}),placement:e=>({queryKey:[e]}),placementByBlock:e=>({queryKey:[e]}),runtime:(e,t,n,a)=>({queryKey:[e,t,n,a]})})},55832:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});var a=n(81498),i=n(54683);let r={getOne:async()=>i.A.post(a.y.appRequests),updateSummary:async e=>i.A.post(a.y.appRequestSummary,e),updateDetails:async e=>i.A.post(a.y.appRequestDetailsV2,e),accessesShare:async e=>i.A.post(a.y.appRequestAccessesShare,e),marketingToolsConfirm:async e=>i.A.post(a.y.appRequestMarketing,e),setTestUser:async e=>i.A.post(a.y.appRequestTestUser,e),submitFacebook:async e=>i.A.post(a.y.appRequestSubmitFacebook,e),getCourses:e=>i.A.post(a.y.courseInfo,e)}},61226:(e,t,n)=>{"use strict";n.d(t,{JO:()=>r,Y9:()=>i});var a=n(56947);let i=(e="/ai-page-editor/")=>{let t=(()=>{if((0,a.Ze)(window.location.hostname)){let{protocol:e,hostname:t}=window.location;return`${e}//${t}:4200`}return window.location.origin})();return t?(0,a.Ze)(window.location.hostname)?`${t}/`:`${t}${e}`:""},r=e=>`${i("/ai-page-editor/")}?page_type=shared&id=${e}`},61734:(e,t,n)=>{"use strict";n.d(t,{r:()=>s});var a=n(14232),i=n(89099),r=n(60880);let s=(e,t=!1)=>{let n=(0,i.useRouter)(),[s,o]=(0,a.useState)(e),l=(0,a.useRef)(e);(0,a.useEffect)(()=>{let n=l.current,a=Object.keys(e).some(t=>e[t]!==n[t]);t&&a&&(o(e),l.current=e)},[e,t]);let d=(0,a.useCallback)((e,t,a=!1)=>{o(n=>({...n,[e]:t})),n.replace(`${n.pathname}?${(0,r.O)({...n.query,...s,[e]:t})}`,void 0,{shallow:a})},[n,s]),c=(0,a.useCallback)((e,t=!1)=>{o(t=>({...t,...e})),n.replace(`${n.pathname}?${(0,r.O)({...n.query,...s,...e})}`,void 0,{shallow:t})},[n,s]);return(0,a.useMemo)(()=>({searchQuery:s,onChangeSearchQuery:d,setParams:c}),[d,s,c])}},62717:(e,t,n)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/courses/[course_id]/modules/[module_id]/lessons/[lesson_id]",function(){return n(83264)}])},64520:(e,t,n)=>{"use strict";n.d(t,{A:()=>b});var a=n(37876),i=n(48230),r=n.n(i),s=n(66950),o=n(64713),l=n(74234),d=n(31941),c=n(22208),u=n(85811),p=n(30942),m=n(14232),y=n(89099),x=n(14958),h=n(69884);
1let f=(0,o.Ay)(s.A)({display:"flex",alignItems:"center",justifyContent:"center"}),_=(0,o.Ay)(f)(({theme:e})=>({height:860,maxHeight:"100%",paddingTop:e.spacing(4)})),g=(0,o.Ay)(f)(({theme:e})=>({width:500,flexDirection:"column",gap:e.spacing(12)})),A=(0,o.Ay)(f)(({theme:e})=>({flexDirection:"column",textAlign:"center",gap:e.spacing(6)})),b=({entityType:e,message:t,icon:n="tabler:map-search",iconSize:i=200,redirectToHomepage:s=!1})=>{let o=(0,l.A)(),{t:f}=(0,p.o)();return(({enabled:e})=>{let{loading:t,user:n,currentRoleGetter:{isCustomer:a,isHiddenCustomer:i,isContentCreator:r,isTeamMember:s}}=(0,x.A)(),o=(0,y.useRouter)(),l=(0,m.useCallback)(()=>{if(e&&o.isReady&&!t){if(!n){window.location.href=window.location.origin;return}if(a||i)return void o.replace(h.C.customerDashboard);if(r||s)return void o.replace(h.C.dashboard)}},[t,e,n,o,a,i,r,s]);(0,m.useEffect)(()=>{l()},[l])})({enabled:s}),e=e||f("ENTITY.page"),t=t||f("NOT_FOUND.page"),(0,a.jsx)(_,{"data-sentry-element":"Container","data-sentry-component":"NotFoundComponent","data-sentry-source-file":"index.tsx",children:(0,a.jsxs)(g,{"data-sentry-element":"Content","data-sentry-source-file":"index.tsx",children:[(0,a.jsx)(u.In,{fontSize:i,color:o.palette.text.disabled,icon:n,"data-sentry-element":"Icon","data-sentry-source-file":"index.tsx"}),(0,a.jsxs)(A,{"data-sentry-element":"TextContent","data-sentry-source-file":"index.tsx",children:[(0,a.jsx)(d.A,{variant:"h2",sx:{":first-letter":{textTransform:"capitalize"}},"data-sentry-element":"Typography","data-sentry-source-file":"index.tsx",children:f("NOT_FOUND.entity",{page:f(`ENTITY.${e}`)})}),(0,a.jsx)(d.A,{variant:"h5","data-sentry-element":"Typography","data-sentry-source-file":"index.tsx",children:t})]}),(0,a.jsx)(c.A,{href:"/",component:r(),variant:"contained",startIcon:(0,a.jsx)(u.In,{icon:"tabler:home"}),"data-sentry-element":"Button","data-sentry-source-file":"index.tsx",children:f("ACTION.go_home")})]})})}},65263:(e,t,n)=>{"use strict";n.d(t,{_X:()=>s,Ux:()=>y}),n(74676),n(86018),n(48753);var a=n(74359),i=n(11313),r=n(48367);let s=e=>(0,a.I)({...i.Ay.certificates.allTemplates,queryFn:()=>r.u.getTemplates(e?.filters),select:e=>e.data.result.sort((e,t)=>e.order-t.order),enabled:e?.enabled??!0});n(70219),n(15726),n(94047);var o=n(88992),l=n(67768),d=n(40097),c=n(13810),u=n(16361),p=n(51802);let m=p.Ik({title:p.Yj({errorMap:()=>({message:"title"})}).min(1).max(400),language_id:p.ai(),is_published:p.zM()}),y=({template:e,onSuccess:t})=>{let n=(0,l.jE)(),{notify:a}=(0,u.A)(),{register:s,control:p,handleSubmit:y,formState:{isSubmitting:x,errors:h}}=(0,o.mN)({resolver:(0,c.u)(m),defaultValues:{title:e.title,language_id:e.language_id,is_published:e.is_published}}),{mutate:f,isPending:_}=(0,d.n)({mutationFn:r.u.updateTemplate,onSettled:()=>{n.invalidateQueries(i.Ay.certificates.allTemplates),n.invalidateQueries(i.Ay.certificates.templateDetail(e.id))},onSuccess:()=>{t?.(),a("CERTIFICATES.edit",{type:"success"})},onError:()=>a("CERTIFICATES.edit",{type:"error"})});return{register:s,control:p,onSubmit:y(t=>f({values:[{id:e.id,...t}]})),isSubmitting:x||_,errors:h}};n(88179),n(36649),n(3329),n(13851)},69960:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});let a={ALWAYS:1,ALL_LESSONS:2,QUIZ:3}},70219:(e,t,n)=>{"use strict";n.d(t,{T:()=>s});var a=n(74359),i=n(11313),r=n(48367);let s=({templateId:e,lessonId:t})=>(0,a.I)({...i.Ay.certificates.createdCertificate(e,t),queryFn:()=>r.u.createCertificate({template_id:e,lesson_id:t}),select:e=>e.data.result,retry:!1,refetchOnMount:!1,refetchOnReconnect:!1,refetchOnWindowFocus:!1})},74676:(e,t,n)=>{"use strict";n.d(t,{S:()=>u});var a=n(14232),i=n(67768),r=n(40097),s=n(30942),o=n(48367),l=n(11313),d=n(14958),c=n(16361);let u=()=>{let{t:e}=(0,s.o)("translation",{keyPrefix:"PAGE.CERTIFICATES"}),t=(0,i.jE)(),{user:n}=(0,d.A)(),{notify:u}=(0,c.A)(),{isPending:p,mutate:m}=(0,r.n)({mutationFn:o.u.addTemplate,onSuccess:async()=>{t.invalidateQueries(l.Ay.certificates.allTemplates),u("CERTIFICATES.duplicate",{type:"success"})},onError:()=>u("CERTIFICATES.duplicate",{type:"error"})});return{addEmptyTemplate:(0,a.useCallback)(()=>m({title:e("root_new_template_title"),language_id:n?.portal?.language_id||1}),[m,e,n?.portal?.language_id]),isPending:p}}},75575:(e,t,n)=>{"use strict";n.d(t,{Qz:()=>o,j9:()=>l,qo:()=>s});var a=n(91555);let i=new Set(Object.values(a.AV)),r=e=>e?"cs"===e?a.AV.cz:i.has(e)?e:null:null,s=e=>r(e)??a.AV.en,o=e=>{let t=r(e);return t?t===a.AV.cz?a.S$.CS:t:a.S$.EN},l=e=>e===a.S$.CS?a.AV.cz:e}
1,76448:(e,t,n)=>{"use strict";n.d(t,{Mb:()=>k,mU:()=>b,r_:()=>v});var a=n(37876),i=n(14232),r=n(79378),s=n(66950),o=n(22208),l=n(74086),d=n(82615),c=n(54237),u=n(62902),p=n(25875),m=n(60072),y=n(31941),x=n(64713),h=n(74234),f=n(88992),_=n(5157),g=n(30942);let A=[25,50,75,80,90,100],b=90,C=(0,x.Ay)(s.A)(({theme:e})=>({border:`1px solid ${e.palette.divider}`,borderRadius:e.shape.borderRadius,backgroundColor:e.palette.action.hover,padding:e.spacing(4)})),j=(0,x.Ay)(o.A)(({theme:e})=>({minWidth:52,borderRadius:e.shape.borderRadius,textTransform:"none",fontWeight:500})),v=(0,i.memo)(({mandatoryVideoView:e,videoPercent:t,onMandatoryVideoViewChange:n,onVideoPercentChange:s,formPathPrefix:o="content_blocks",hideToggle:x=!1})=>{let f=(0,h.A)(),{t:v}=(0,g.o)("translation",{keyPrefix:"PAGE.LESSON_DETAIL.LESSON_CONTENT.VIDEO.view_settings"}),k=(0,i.useMemo)(()=>null==t?b:Math.max(1,t),[t]),T=(0,i.useCallback)(e=>{n(e),e&&null==t&&s(b)},[n,s,t]),I=(0,i.useCallback)((e,t)=>{s(Array.isArray(t)?t[0]:t)},[s]),w=(0,i.useCallback)(e=>()=>{s(e)},[s]),S=(0,i.useCallback)(e=>{if(""===e)return void s(null);let t=Number(e);Number.isNaN(t)||s(Math.min(100,Math.max(1,t)))},[s]),E=x||e,L=(0,a.jsxs)(u.A,{spacing:f.spacing(3),children:[(0,a.jsxs)(u.A,{direction:"row",alignItems:"center",justifyContent:"space-between",gap:f.spacing(2),children:[(0,a.jsx)(y.A,{variant:"body2",fontWeight:500,children:v("video_percent_label")}),(0,a.jsx)(m.A,{value:t??"",onChange:e=>S(e.target.value),type:"number",size:"small",inputProps:{min:1,max:100},sx:{width:88},InputProps:{endAdornment:(0,a.jsx)(d.A,{position:"end",children:"%"})},"data-form-path":`${o}.video_percent`,"data-ai-field":"Video watch percentage"})]}),(0,a.jsx)(c.Ay,{value:k,onChange:I,min:1,max:100,step:1,valueLabelDisplay:"off","data-form-path":`${o}.video_percent_slider`}),(0,a.jsx)(u.A,{direction:"row",flexWrap:"wrap",gap:f.spacing(1.5),children:A.map(e=>{let t=k===e;return(0,a.jsxs)(j,{size:"small",variant:t?"contained":"outlined",color:"primary",onClick:w(e),sx:{...!t&&{color:f.palette.text.primary,borderColor:f.palette.divider,backgroundColor:f.palette.background.paper,"&:hover":{backgroundColor:f.palette.action.hover,borderColor:f.palette.divider}}},"data-form-path":`${o}.video_percent_preset_${e}`,children:[e,"%"]},e)})}),(0,a.jsx)(r.A,{severity:"info",icon:(0,a.jsx)(_.A,{icon:"tabler:lock",fontSize:18}),sx:{alignItems:"center","& .MuiAlert-message":{padding:0}},children:(0,a.jsx)(y.A,{variant:"body2",children:v("finish_lesson_locked_info",{percent:k})})})]});return(0,a.jsx)(C,{children:(0,a.jsxs)(u.A,{spacing:f.spacing(4),children:[x?(0,a.jsxs)(u.A,{direction:"row",spacing:f.spacing(2),flex:1,minWidth:0,children:[(0,a.jsx)(_.A,{icon:"tabler:eye",fontSize:22,style:{flexShrink:0,marginTop:2}}),(0,a.jsxs)(u.A,{spacing:.5,minWidth:0,children:[(0,a.jsx)(y.A,{variant:"body1",fontWeight:600,children:v("mandatory_video_view_label")}),(0,a.jsx)(y.A,{variant:"body2",color:"text.secondary",children:v("mandatory_video_view_subtitle",{percent:k})})]})]}):(0,a.jsxs)(u.A,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",gap:f.spacing(2),children:[(0,a.jsxs)(u.A,{direction:"row",spacing:f.spacing(2),flex:1,minWidth:0,children:[(0,a.jsx)(_.A,{icon:"tabler:eye",fontSize:22,style:{flexShrink:0,marginTop:2}}),(0,a.jsxs)(u.A,{spacing:.5,minWidth:0,children:[(0,a.jsx)(y.A,{variant:"body1",fontWeight:600,children:v("mandatory_video_view_label")}),(0,a.jsx)(y.A,{variant:"body2",color:"text.secondary",children:v("mandatory_video_view_subtitle",{percent:k})})]})]}),(0,a.jsx)(p.A,{checked:e,onChange:(e,t)=>
1T(t),"data-form-path":`${o}.mandatory_video_view`,"data-ai-field":"Required video viewing toggle"})]}),x?L:(0,a.jsx)(l.A,{in:E,unmountOnExit:!0,children:L})]})})}),k=(0,i.memo)(({index:e})=>{let{control:t,setValue:n}=(0,f.xW)(),r=(0,f.FH)({control:t,name:`content_blocks.${e}.mandatory_video_view`}),s=(0,f.FH)({control:t,name:`content_blocks.${e}.video_percent`}),o=`content_blocks.${e}`,l=(0,i.useCallback)(t=>{n(`content_blocks.${e}.mandatory_video_view`,t,{shouldDirty:!0,shouldValidate:!0})},[e,n]),d=(0,i.useCallback)(t=>{n(`content_blocks.${e}.video_percent`,t,{shouldDirty:!0,shouldValidate:!0})},[e,n]);return(0,a.jsx)(v,{mandatoryVideoView:!!r,videoPercent:s??null,onMandatoryVideoViewChange:l,onVideoPercentChange:d,formPathPrefix:o})})},78881:(e,t,n)=>{"use strict";n.d(t,{O:()=>i});var a=n(12227);let i=e=>"function"!=typeof a.A.sanitize?"":a.A.sanitize(e,{ADD_TAGS:["iframe","details","summary"],ADD_ATTR:["src","width","height","title","name","allow","allowfullscreen","frameborder","scrolling","loading","referrerpolicy","sandbox","target","open","class","data-type"],ADD_DATA_URI_TAGS:["iframe"]})},83264:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>aO});var a,i,r,s,o,l,d,c,u,p,m=n(37876),y=n(14232),x=n(89099),h=n(62902),f=n(74234),_=n(74359),g=n(84933),A=n(5157),b=n(12772);let C=(0,y.createContext)({uniqueCallbackMap:{},validationCallbacks:[],submitCallbacks:[],setUniqueCallback:(e,t)=>{},removeUniqueCallback:e=>{}}),j=({children:e})=>{let[t,n]=(0,y.useState)({}),a=(0,y.useCallback)((e,t)=>{n(n=>({...n,[e]:t}))},[]),i=(0,y.useCallback)(e=>{n(t=>{let{[e]:n,...a}=t;return{...a}})},[]),r=(0,y.useMemo)(()=>Object.values(t).map(e=>e.validate),[t]),s=(0,y.useMemo)(()=>Object.values(t).map(e=>e.submit),[t]);return(0,m.jsx)(C.Provider,{value:{uniqueCallbackMap:t,setUniqueCallback:a,validationCallbacks:r,submitCallbacks:s,removeUniqueCallback:i},"data-sentry-element":"SubmitCallbacksContext.Provider","data-sentry-component":"SubmitCallbacksProvider","data-sentry-source-file":"SubmitCallbacksContext.tsx",children:e})},v=()=>{let e=(0,y.useContext)(C);if(void 0===e)throw Error("useSubmitCallbacks must be used within a SubmitCallbacksProvider");return e},k=(0,y.createContext)(void 0);var T=n(30942),I=n(11313),w=n(16519);let S=e=>(0,_.I)({...I.Ay.lessons.detail(e),queryFn:()=>w.A.getDetails({filter_by:[{attribute:"id",operator:"==",value:e}]}),enabled:!!e,select:({data:e})=>e.result[0]});var E=n(10760),L=n(61734),N=n(92993),O=n(99399),R=n(64520),M=n(88992),q=n(67768),z=n(40097),F=n(13810),D=n(83673),$=n(16361),B=n(60168);let P=(e,t,n="application/octet-stream")=>new File([new Uint8Array(t)],e,{type:n});var Q=n(46840),V=n(52729),H=n(48367),W=n(49067),Z=n(36468),Y=n(51802),K=n(81645);let G=e=>{let t=/<img[^>]*>/i.test(e);return e.replace(/<[^>]*>/g,"").trim().length>0||t};var U=n(32881);let X="always",J="after_stream",ee="never";var et=n(69960),en=n(78956);let ea=Y.Ik({title:Y.Yj(),order:Y.ai(),is_correct:Y.zM()}),ei=Y.Ik({dragId:Y.Yj().optional(),title:Y.Yj().optional(),answers:Y.YO(ea).optional(),id:Y.ai().optional(),lesson_id:Y.ai().optional(),is_expanded:Y.zM().optional(),order:Y.ai(),type_id:Y.ai(),mandatory_video_view:Y.zM().optional(),video_percent:Y.au.number().min(1).max(100).nullable().optional()}),er=Y.Ik({type_id:Y.eu(1),content:Y.Ik({file_id:Y.Yj().nullable().optional(),payload:Y.Yj().min(1).refine(G,{message:"PAGE.LESSON_DETAIL.LESSON_CONTENT.required"})})}),es=Y.Ik({type_id:Y.eu(7),content:Y.Ik({file_id:Y.Yj().nullable().optional(),payload:Y.Yj().min(1).refine(G,{message:"PAGE.LESSON_DETAIL.LESSON_CONTENT.required"})})}),eo=Y.Ik({type_id:Y.eu(2),content:Y.Ik({file_id:Y.Yj().nullable().optional(),payload:Y.Yj().min(1)})}),el=Y.Ik({type_id:Y.eu(3),content:Y.Ik({btn_url:Y.Yj().min(1),btn_font:Y.Yj(),btn_size:Y.Yj().min(1),btn_text:Y.Yj().min(1),btn_color:Y.Yj(),btn_target:Y.Yj(),btn_position:Y.Yj(),btn_text_color:Y.Yj()})}),ed=Y.Ik({type_id:Y.eu(4),content:Y.Ik({link:Y.Yj().nullable().optional(),file_id:Y.Yj().nullable().optional(),is_file_transcription_shown:Y.zM().optional()}).refine(e=>e.link||e.file_id,{message:"PAGE.LESSON_DETAIL.LESSON_CONTENT.required"})}),ec=Y.Ik({type_id:Y.eu(8),content:Y.Ik({link:Y.Yj().nullable().optional(),file_id:Y.Yj().nullable().optional(),is_file_transcription_shown:Y.zM().optional()}).refine(e=>e.link||e.file_id,{message:"PAGE.LESSON_DETAIL.LESSON_CONTENT.required"})}),eu=Y.Ik({type_id:Y.eu(5),content:Y.Ik({audio_id:Y.Yj().min(1),audio_payload:Y.Yj().optional().nullable(),audio_additional_text:Y.Yj().optional().nullable()})}),ep=Y.Ik({type_id:Y.eu(9),content:Y.Ik({audio_id:Y.Yj().min(1),audio_payload:Y.Yj().optional(),audio_additional_text:Y.Yj().optional()})}),em=Y.Ik({type_id:Y.eu(6),content:Y.Ik({pdf_id:Y.Yj().min(1)})}),ey=Y.Ik({type_id:Y.eu(Q.KL.Certificate),content:Y.Ik({type_id:Y.au.number(),quiz_id:Y.au.number().optional(),message:Y.Yj().optional(),template_id:Y.au.number().min(1)}).superRefine((e,t)=>
1{e.template_id===U.Fc&&t.addIssue({code:K.eq.custom,message:"required",path:["template_id"]}),e.type_id===et.A.ALWAYS||(e?.message||t.addIssue({code:K.eq.custom,message:"required",path:["message"]}),e.type_id===et.A.QUIZ&&(e?.quiz_id||t.addIssue({code:K.eq.custom,message:"required",path:["quiz_id"]})))})}),ex=Y.Ik({type_id:Y.eu(Q.KL.AI_chat),content:Y.Ik({name:Y.Yj().optional(),instructions:Y.Yj().optional(),conversation_starter:Y.Yj().optional(),avatar_id:Y.Yj().optional()})}),eh=Y.Ik({type_id:Y.eu(Q.KL.LiveStream),content:Y.Ik({stream_session_id:Y.Yj().min(1,"PAGE.LESSON_CONTENT.live_stream.validation.streamRequired"),cover_image_id:Y.Yj().optional(),recording_availability:Y.k5([X,J,ee])})}),ef=Y.Ik({type_id:Y.eu(Q.KL.Widget),content:Y.Ik({widget_id:Y.au.number(),custom_inputs:Y.g1(Y.bz()).optional(),placement_id:Y.au.number().optional()}).superRefine((e,t)=>{(!e.widget_id||e.widget_id<1)&&t.addIssue({code:K.eq.custom,message:"required",path:["widget_id"]})})}),e_=Y.gM("type_id",[ei.merge(er),ei.merge(eo),ei.merge(el),ei.merge(ed),ei.merge(eu),ei.merge(em),ei.merge(es),ei.merge(ec),ei.merge(ep),ei.merge(ey),ei.merge(ex),ei.merge(ef),ei.merge(eh)]),eg=Y.Ik({available_at:Y.au.number().min(0).default(0),title:Y.Yj().min(1).max(100,"Maximum 100 characters allowed."),payload:Y.Yj().optional(),content_blocks:Y.YO(e_).default([]),image_id:Y.Yj().nullable().optional(),attachments:Y.YO(Y.Ik({id:Y.Yj().optional(),file_id:Y.ai().optional()}).optional()).optional(),files:Y.YO(Y.Ik({id:Y.Yj(),file:Y.bz(),order:Y.ai().optional(),progress:Y.ai().optional()})).refine(e=>e.every(({file:e})=>e instanceof File&&e.size<=0x100000000),{message:"FILE_UPLOADER.validation.max_size"}).default([]),quiz_options:Y.Ik({correct_answer:Y.Ik({show_type_id:Y.au.number().min(0).default(en.Br.SHOW_CORRECT_ANSWER_AFTER_EACH_QUESTION_AND_AT_END).optional()}).default({show_type_id:en.Br.SHOW_CORRECT_ANSWER_AFTER_EACH_QUESTION_AND_AT_END}).optional(),grade:Y.Ik({grade_after_percents:Y.au.number().min(0,"Required minimum is 0").default(0).optional()}).default({grade_after_percents:0}).optional(),hide_answers_hint:Y.zM().default(!1).optional(),lock_type_id:Y.au.number().min(0).default(en.yv.NOTHING).optional(),randomize:Y.Ik({answers:Y.zM().default(!1).optional(),questions:Y.zM().default(!1).optional()}).default({answers:!1,questions:!1}).optional(),redo:Y.Ik({redo_type_id:Y.au.number().min(0).default(0).optional(),redo_after_hours:Y.au.number().min(0).default(0).optional()}).default({redo_after_hours:0,redo_type_id:en.Eb.CAN_BE_REDONE}).optional()}).default({correct_answer:{show_type_id:en.Br.SHOW_CORRECT_ANSWER_AFTER_EACH_QUESTION_AND_AT_END},grade:{grade_after_percents:0},hide_answers_hint:!1,lock_type_id:en.yv.NOTHING,randomize:{answers:!1,questions:!1},redo:{redo_after_hours:0,redo_type_id:en.Eb.CAN_BE_REDONE}}).optional(),block:Y.Ik({lesson_id:Y.au.number(),block_type:Y.eu(en._B.UNTIL_COMPLETE).default(en._B.UNTIL_COMPLETE),block_value:Y.KC([Y.eu(en.BP.LESSONS),Y.eu(en.BP.MODULES_AND_LESSONS)]).default(en.BP.LESSONS)}).nullable().optional()});var eA=n(12227);let eb=async(e,t,n)=>{let a=[],i=[],r=await Promise.all(e.map(async({dragId:e,...t})=>{let i={...t};switch(i.answers&&Array.isArray(i.answers)&&(i.answers=i.answers.map(e=>({...e,title:e.title?eA.A.sanitize(e.title):e.title}))),i.type_id){case Q.KL.AI_chat:{let e=i.content;if(e?.name||e?.instructions||e?.conversation_starter)try{let t={is_active:!0,conversation_style:"formal",avatar_id:e.avatar_id||void 0,voice_id:1,name:e.name||"",allow_text:!0,allow_voice:!1,prefer_voice:!1,system_prompt:e.instructions||"",conversation_starter:e.conversation_starter||"",lexicon_items:[],banned_keywords:[],approved_urls:[]},n=e.ai_assistant_id;return n?await W.A.update({id:n,...t}):n=(await W.A.create(t)).id,{...i,content:{ai_assistant_id:n,name:e.name,instructions:e.instructions,conversation_starter:e.conversation_starter,avatar_id:e.avatar_id}}}catch(e){console.error("Error handling AI assistant:",e)}return i}case Q.KL.Widget:{let e=i.content;return{...i,content:{widget_id:e.widget_id}}}case Q.KL.Certificate:{let{content:e}=i,t={...e,lesson_id:n||0};
1return a.push(t),{...i,type_id:Q.KL.Certificate,content:{template_id:e.template_id,type_id:e.type_id}}}case Q.Q5.Video:case Q.KL.Video:{let{mandatory_video_view:e=!1,video_percent:t,content:n,...a}=i,r={...n};if(n?.is_file_transcription_shown===!1){let{is_file_transcription_shown:e,...t}=r;r=t}return{...a,mandatory_video_view:e,video_percent:e?t??null:null,content:r}}default:return i}})),s=t?.flatMap(e=>e.type_id===Q.KL.Certificate?e.content:[]);return s?.forEach(e=>{a.some(t=>t.template_id===e.template_id)||i.push({lesson_id:n||0,template_id:e.template_id})}),{contentBlocksPrepared:r,newTemplateAvailabilities:a,deletedTemplateAvailabilities:i}},eC=async(e,t,n)=>{if(e)try{let{data:a}=await w.A.getDetails({filter_by:[{attribute:"id",operator:"==",value:e}]}),i=a.result?.[0],r=(i?.content_blocks||[]).filter(e=>e.type_id===Q.KL.Widget&&"number"==typeof e.id&&!(e.id<=0)&&!!e.content?.widget_id&&Number(e.content.widget_id)>0);if(!r.length)return;let s=t.filter(e=>e.type_id===Q.KL.Widget&&Number(e.content?.widget_id)>0);await Promise.all(r.map(async(t,n)=>{let a=t.id,i=Number(t.content?.widget_id);if("number"!=typeof a||!Number.isFinite(i)||i<=0)return;let r=s.find(e=>e.id===a)??s[n],o=r&&r.type_id===Q.KL.Widget?r.content.custom_inputs??{}:{};await Z.Q7.placementUpsert({content_block_id:a,lesson_id:e,widget_id:i,custom_inputs:o,require_completion:!1})})),await n?.invalidateQueries({queryKey:V.Q.placementByBlock._def})}catch(e){console.warn("Widget placement sync failed",e)}},ej=(e,t)=>({attachments:e?.attached_files?.map(e=>({id:e.file_id.toString(),file_id:Number(e.file_id)})),available_at:e?.available_at||0,title:e?.title,payload:e?.payload,image_id:e?.image_id||null,files:t?.map(({id:t,title:n,size:a},i)=>({id:t.toString(),file:P(n,a),order:e?.attached_files.find(e=>Number(e.file_id)===Number(t))?.order||i})).sort((e,t)=>e.order-t.order),content_blocks:e?.content_blocks?.map(e=>{let t={dragId:(0,B.$)(),...e};if(e.type_id===Q.KL.Video||e.type_id===Q.Q5.Video){let n=e.content,{mandatory_video_view:a,video_percent:i,...r}=n??{};t.content={...r,file_id:n?.file_id||null,link:n?.link||null},t.mandatory_video_view=e.mandatory_video_view??n?.mandatory_video_view??!1,t.video_percent=e.video_percent??n?.video_percent??null}return t}).sort((e,t)=>e.order-t.order)||[],quiz_options:{correct_answer:{show_type_id:e?.quiz_options?.at(0)?.correct_answer?.show_type_id??en.Br.SHOW_CORRECT_ANSWER_AFTER_EACH_QUESTION_AND_AT_END},grade:{grade_after_percents:e?.quiz_options?.at(0)?.grade?.grade_after_percents??80},hide_answers_hint:e?.quiz_options?.at(0)?.hide_answers_hint??!1,lock_type_id:e?.quiz_options?.at(0)?.lock_type_id??en.yv.NOTHING,randomize:{answers:e?.quiz_options?.at(0)?.randomize?.answers??!0,questions:e?.quiz_options?.at(0)?.randomize?.questions??!0},redo:{redo_type_id:e?.quiz_options?.at(0)?.redo?.redo_type_id??1,redo_after_hours:e?.quiz_options?.at(0)?.redo?.redo_after_hours??0}},block:e?.block||null}),ev=(e,t)=>{let n=(0,x.useRouter)(),{notify:a}=(0,$.A)(),i=(0,q.jE)(),{activeTab:r,setActiveTab:s}=(0,D.V)(),o=Number(n.query.module_id),l=Number(n.query.lesson_id),d=(0,M.mN)({defaultValues:ej(e,t),resolver:(0,F.u)(eg)});(0,y.useEffect)(()=>{d.reset(ej(e,t))},[e,t]);let{mutateAsync:c}=(0,z.n)({mutationFn:w.A.update,onSuccess:()=>{a(e?.type_id===1?"LESSON.update":"QUIZ.update",{type:"success"})},onError:()=>a("LESSON.update",{type:"error"}),onSettled:()=>{i.invalidateQueries(I.Ay.lessons.detail(l)),i.invalidateQueries(I.Ay.modules.detail(o)),i.invalidateQueries(I.Ay.modules.overview(o)),i.invalidateQueries({predicate:e=>{let{queryKey:t}=I.Ay.courses.all;return e.queryKey.includes(t[0])}})}}),{mutateAsync:u}=(0,z.n)({mutationFn:H.u.addTemplateAvailability}),{mutateAsync:p}=(0,z.n)({mutationFn:H.u.deleteTemplateAvailability}),m=(e,t="")=>{if(!e)return null;for(let n in e){let a=t?`${t}.${n}`:n,i=e[n];if(i?.message)return a;
1if(i&&"object"==typeof i&&!i.message){let e=m(i,a);if(e)return e}}return null},h=e=>{let t=e.match(/content_blocks\.(\d+)/);if(t){let e=Number(t[1]);setTimeout(()=>{let t=document.querySelector(`[data-form-path="content_blocks.${e}.content.row_collapse"]`);if(t){let n=document.querySelector(`[data-form-path="content_blocks.${e}"]`),a=n?.querySelector('[role="region"]'),i=a&&(0===a.offsetHeight||"0px"===getComputedStyle(a).height||"true"===a.getAttribute("aria-hidden")),r=t.querySelector("svg"),s=r?.style.transform||(r?window.getComputedStyle(r).transform:""),o=s&&!s.includes("-180deg");(i||o)&&t.click()}setTimeout(()=>{let t=document.querySelector(`[data-form-path*="content_blocks.${e}"]`);if(t){t.scrollIntoView({behavior:"smooth",block:"center"});let e=t.querySelector('input, textarea, [role="textbox"]');e&&setTimeout(()=>e.focus(),300)}else{let t=document.querySelector(`[data-form-path="content_blocks.${e}"]`);t&&t.scrollIntoView({behavior:"smooth",block:"center"})}},350)},100)}else setTimeout(()=>{let t=document.querySelector(`[data-form-path="${e}"]`)||document.querySelector(`[data-form-path*="${e}"]`);if(t){t.scrollIntoView({behavior:"smooth",block:"center"});let e=t.querySelector('input, textarea, [role="textbox"]');e&&setTimeout(()=>e.focus(),150)}},100)},{validationCallbacks:f,submitCallbacks:_}=v();return{form:d,onSubmit:o=>d.handleSubmit(async n=>{let r;try{r=(await Promise.all(f.map(e=>e()))).every(e=>e)}catch(e){r=!1}if(!r)return;await Promise.all(_.map(e=>e()));let{contentBlocksPrepared:s,newTemplateAvailabilities:d,deletedTemplateAvailabilities:m}=await eb(n.content_blocks,ej(e,t)?.content_blocks,e?.id);await c({values:{mandatory:!1,main_settings:null,is_active:!0,available_at:n.available_at||0,title:n.title,image_id:n.image_id,id:e?.id,payload:n?.payload,content_blocks:s,attached_files:n?.attachments?.filter(Boolean).map(e=>({file_id:e?.file_id,order:n?.files.find(({id:t})=>t===e?.id)?.order}))||[],quiz_options:e?.type_id===1?[]:[{...n.quiz_options,timing:{completion_limit_ms:0}}],block:n.block?{lesson_id:n.block.lesson_id,block_type:n.block.block_type,block_value:n.block.block_value}:null},filter_by:[{attribute:"id",operator:"==",value:e?.id}]}),e?.id&&(await eC(e.id,n.content_blocks||[],i),await i.invalidateQueries(I.Ay.lessons.detail(l)));try{await Promise.all([...d.map(e=>u({availability:e})),...m.map(e=>p(e))]),i.invalidateQueries({queryKey:I.Ay.certificates.templateAvailabilityDetail._def})}catch(e){a("CERTIFICATES.availability",{type:"error"})}o?.()},async t=>{await Promise.all(f.map(e=>e()));let a=m(t);if(a){var i;let t=(i=a).startsWith("content_blocks")?0:i.startsWith("title")||i.startsWith("image_id")||i.startsWith("payload")?1:(e?.type_id===1?["files","attachments"]:["quiz_options"]).some(e=>i.startsWith(e))?2:3;r!==t?(s(t),n.push({query:{...n.query,tab:String(t)}},void 0,{shallow:!0}),setTimeout(()=>{h(a)},300)):h(a)}})}};var ek=n(79378),eT=n(66950),eI=n(22208),ew=n(48185),eS=n(76587),eE=n(98611),eL=n(47692),eN=n(29608),eO=n(31941),eR=n(3801),eM=n(85811),eq=n(75542),ez=n(3597),eF=n(79494),eD=n(14958),e$=n(61349),eB=n(71078),eP=n(90623),eQ=n(9989),eV=n(64713);let eH=(0,eV.Ay)(eT.A)(({theme:e})=>({display:"flex",flexDirection:"column",gap:e.spacing(8),paddingTop:e.spacing(8),[e.breakpoints.down("md")]:{paddingBottom:75}})),eW=(0,eV.Ay)(eI.A)(()=>({width:"120px",borderRadius:"0 5px 5px 0",margin:"-1px",marginBottom:"-1px",marginTop:"-1px",height:"100%"})),eZ=(0,eV.Ay)(eT.A)(({theme:e})=>({display:"flex",flexDirection:"column",gap:e.spacing(3)})),eY=(0,eV.Ay)(eT.A)(({theme:e})=>({display:"flex",flexDirection:"column",gap:e.spacing(1)}));var eK=n(82867);let eG=(0,y.forwardRef)(({control:e,currentCourse:t,currentModule:n,currentLesson:a},i)=>{let r=(0,f.A)(),{t:s}=(0,T.o)(),o=(0,x.useRouter)(),[l,d]=(0,y.useState)(!0),{deleteLessonOnDetailsPage:c,copyLesson:u}=(0,ez.A)({moduleId:0,type:1,triggerId:0,lesson:{},triggered:!1,currentCourse:t,currentModule:n,currentLesson:a}),{user:p}=(0,eD.A)(),h=(0,y.useMemo)(()=>(p?.portal?.domain||window.location.hostname)+"/customer/dashboard?lesson_public="+(a?.public_key||""),[p,a?.public_key]),{copyToClipboard:_}=(0,eF.T)(),g=async e=>{await (0,eQ.m)(e,u.copy)};return(0,m.jsxs)(eH,{ref:i,children:[(0,m.jsx)(eB.A,{lessonId:a?.id,isOpen:u.isModalOpen,onClose:u.closeModal,onCancel:u.closeModal,isSubmitting:u.isPending,onSubmit:g}),(0,m.jsx)(e$.A,{isOpen:c.isConfirmationWindowOpen,entityType:"lesson",entityTitle:a?.title||"",confirmWord:"DELETE",preventContextMenu:!0,onClose:c.denyConfirmation,onCancel:c.denyConfirmation,onDelete:c.handleDelete}),(0,m.jsxs)(eZ,{children:[(0,m.jsxs)(eY,{children:[(0,m.jsx)(eO.A,{variant:"h5",children:s("ACTION.ENTITY.lesson_link")}),(0,m.jsx)(eO.A,{variant:"body1",color:"text.disabled",children:s("ACTION.ENTITY.lesson_link_hint")})]}),(0,m.jsx)(eq.Ay,{disabled:!0,value:h,sx:{width:"100%","& .MuiFilledInput-root":{backgroundColor:`${r.palette.background.paper} !important`}},InputProps:{sx:{paddingRight:0},endAdornment:(0,m.jsx)(eW,{"data-form-path":"copy_lesson_link","data-element-type":"button","data-ai-field":`Copy lesson link ${h} on click`,onClick:()=>_(h),variant:"outlined",children:s("ACTION.ENTITY.copy_link")})},fullWidth:!0})]}),(0,m.jsxs)(eZ,{children:[(0,m.jsxs)(eY,{children:[(0,m.jsx)(eO.A,{variant:"h5",children:s("extracted.access_settings")}),(0,m.jsx)(eO.A,{variant:"body1",color:"text.disabled",children:s("ACTION.ENTITY.lesson_access_setting_hint")})]}),(0,m.jsx)(M.xI,{name:"available_at",control:e,rules:{required:!0}
1,render:({field:{value:e,onChange:t},fieldState:{error:n}})=>(0,m.jsx)(eq.Ay,{"data-form-path":"available_at","data-element-type":"number field","data-ai-field":"Days until lesson unlock",label:s("ACTION.ENTITY.access_in_days"),placeholder:s("ACTION.ENTITY.access_in_days"),helperText:s("PAGE.LESSON_SETTINGS.days_to_unlock_desc"),type:"number",value:e,onChange:e=>t(e.target.value),fullWidth:!0,error:!!n,...n&&{helperText:n.message}})}),(0,m.jsx)(M.xI,{name:"block",control:e,render:({field:{value:e,onChange:t}})=>{let n=e?String(e.block_value):en.Cq;return(0,m.jsxs)(eT.A,{display:"flex",flexDirection:"column",gap:r.spacing(4),sx:{mt:4},children:[(0,m.jsx)(eO.A,{variant:"h5",children:s("PAGE.LESSON_SETTINGS.LOCK.label")}),(0,m.jsxs)(eN.A,{value:n,onChange:e=>{let n=e.target.value,i=Number(o.query.lesson_id)||a?.id||0;n===en.Cq?t(null):t({lesson_id:i,block_type:en._B.UNTIL_COMPLETE,block_value:Number(n)})},children:[(0,m.jsx)(eS.A,{value:en.Cq,control:(0,m.jsx)(eL.A,{}),label:s("PAGE.LESSON_SETTINGS.LOCK.never")}),(0,m.jsx)(eS.A,{value:en.BP.LESSONS,control:(0,m.jsx)(eL.A,{}),label:s("PAGE.LESSON_SETTINGS.LOCK.lessons")}),(0,m.jsx)(eS.A,{value:en.BP.MODULES_AND_LESSONS,control:(0,m.jsx)(eL.A,{}),label:s("PAGE.LESSON_SETTINGS.LOCK.lessons_and_modules")})]})]})}})]}),(0,m.jsxs)(eZ,{children:[(0,m.jsxs)(eY,{children:[(0,m.jsx)(eO.A,{variant:"h5",children:s("ACTION.ENTITY.duplicate_lesson")}),(0,m.jsx)(eO.A,{variant:"body1",color:"text.disabled",children:s("ACTION.ENTITY.duplicate_lesson_module_hint")})]}),(0,m.jsxs)(eY,{children:[(0,m.jsx)(eP.f,{action:eK.Qi.EDIT_ANY_COURSE,children:(0,m.jsx)(eR.A,{"data-form-path":"clone_lesson","data-element-type":"button","data-ai-field":"Clone/duplicate lesson on click",variant:"outlined",startIcon:(0,m.jsx)(eM.In,{icon:"tabler:copy"}),loading:u.isPending,onClick:()=>u.copy({is_duplicate:!0,lesson_id:Number(o.query.lesson_id),copy_to:[{module_id:Number(o.query.module_id)}]},""),children:s("ACTION.clone")})}),(0,m.jsx)(eP.f,{action:eK.Qi.EDIT_ANY_COURSE,children:(0,m.jsx)(eI.A,{"data-form-path":"clone_lesson_to","data-element-type":"button","data-ai-field":"Clone/duplicate lesson to selected module on click",variant:"outlined",startIcon:(0,m.jsx)(eM.In,{icon:"tabler:copy"}),onClick:u.openModal,children:s("ACTION.duplicate_to")})})]})]}),(0,m.jsx)(eZ,{children:(0,m.jsxs)(eY,{children:[(0,m.jsxs)(eO.A,{variant:"h5",children:[" ",s("ACTION.ENTITY.delete_lesson")]}),(0,m.jsx)(ek.A,{icon:!1,severity:"warning",children:s("ACTION.ENTITY.delete_lesson_hint")}),(0,m.jsx)(eE.A,{row:!0,children:(0,m.jsx)(eS.A,{"data-form-path":"delete_lesson_check","data-element-type":"button","data-ai-field":"confirm checkbox for delete lesson",label:s("ACTION.ENTITY.delete_lesson_confirm"),control:(0,m.jsx)(ew.A,{onChange:e=>d(!e.target.checked),name:""})})}),(0,m.jsx)(eT.A,{children:(0,m.jsx)(eP.f,{action:eK.Qi.EDIT_ANY_COURSE,children:(0,m.jsx)(eI.A,{"data-form-path":"delete_lesson_confirm","data-element-type":"button","data-ai-field":"Open delete lesson modal on click",onClick:c.askConfirmation,disabled:l,variant:"outlined",color:"error",startIcon:(0,m.jsx)(eM.In,{icon:"tabler:trash"}),children:s("ACTION.ENTITY.delete_lesson")})})})]})})]})});var eU=n(60880),eX=n(27345),eJ=n(61210),e2=n(68954),e0=n(26183),e1=n(76747),e3=n(92371),e5=n(23436);let e7=[{id:"placeholder-upcoming-demo",title:"Upcoming demo live stream",dateLabel:"Thu, Jun 26 \xb7 7:00 PM"},{id:"placeholder-scheduled-workshop",title:"Scheduled workshop session",dateLabel:"Mon, Jun 30 \xb7 6:00 PM"},{id:"placeholder-past-recording",title:"Past stream recording",dateLabel:"Recorded \xb7 available after stream"}];function e8(e){if(e)return e7.find(t=>t.id===e)}function e4(){return(e4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)({}).hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(null,arguments)}let e6=function(e){return y.createElement("svg",e4({xmlns:"http://www.w3.org/2000/svg",width:41,height:40,fill:"none"},e),a||(a=y.createElement("path",{stroke:"#415BF5",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M23.5 5v6.667c0 .92.746 1.666 1.667 1.666h6.666"})),i||(i=y.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",strokeOpacity:.4,strokeWidth:2,d:"M23.5 5v6.667c0 .92.746 1.666 1.667 1.666h6.666"})),r||(r=y.createElement("path",{fill:"#415BF5",fillRule:"evenodd",d:"M8.5 13.333v-5A3.333 3.333 0 0 1 11.833 5H23.5l8.333 8.333v18.334A3.333 3.333 0 0 1 28.5 35h-8.333",clipRule:"evenodd"})),s||(s=y.createElement("path",{fill:"#fff",fillOpacity:.8,fillRule:"evenodd",d:"M8.5 13.333v-5A3.333 3.333 0 0 1 11.833 5H23.5l8.333 8.333v18.334A3.333 3.333 0 0 1 28.5 35h-8.333",clipRule:"evenodd"})),o||(o=y.createElement("path",{stroke:"#415BF5",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8.5 13.333v-5A3.333 3.333 0 0 1 11.833 5H23.5l8.333 8.333v18.334A3.333 3.333 0 0 1 28.5 35h-8.333"})),l||(l=y.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",strokeOpacity:.4,strokeWidth:2,d:"M8.5 13.333v-5A3.333 3.333 0 0 1 11.833 5H23.5l8.333 8.333v18.334A3.333 3.333 0 0 1 28.5 35h-8.333"})),d||(d=y.createElement("circle",{cx:10.167,cy:23.334,r:5,stroke:"#415BF5",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2})),c||(c=y.createElement("circle",{cx:10.167,cy:23.334,r:5,stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",strokeOpacity:.4,strokeWidth:2})),u||(u=y.createElement("path",{stroke:"#415BF5",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"m7.667 28.334-2.5 8.333 5-2.5 5 2.5-2.5-8.333"})),p||(p=y.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",strokeOpacity:.4,strokeWidth:2,d:"m7.667 28.334-2.5 8.333 5-2.5 5 2.5-2.5-8.333"})))};var e9=n(74086),te=n(9423),tt=n(76068),tn=n(24156),ta=n(76852),ti=n(646),tr=n(78339),ts=n(88414),to=n(90035);
1let tl=({label:e,onChange:t,value:n,...a})=>{let i=(0,f.A)(),[r,s]=(0,y.useState)(n||"center");return(0,y.useEffect)(()=>{t&&t(r)},[r]),(0,y.useEffect)(()=>{n&&n!==r&&s(n)},[n]),(0,m.jsxs)(eT.A,{display:"flex",flexDirection:"column",gap:i.spacing(2),"data-sentry-element":"Box","data-sentry-component":"AlignmentSelection","data-sentry-source-file":"index.tsx",children:[(0,m.jsx)(eO.A,{variant:"body2","data-sentry-element":"Typography","data-sentry-source-file":"index.tsx",children:e}),(0,m.jsxs)(eT.A,{display:"flex",gap:i.spacing(2),"data-sentry-element":"Box","data-sentry-source-file":"index.tsx",children:[(0,m.jsx)(eI.A,{onClick:()=>s("left"),variant:"left"===r?"contained":"tonal",sx:{paddingX:"8px",minWidth:"38px",maxWidth:"38px",minHeight:"38px",maxHeight:"38px"},...a,"data-sentry-element":"Button","data-sentry-source-file":"index.tsx",children:(0,m.jsx)(eM.In,{fontSize:"22px",icon:"tabler:align-left","data-sentry-element":"Icon","data-sentry-source-file":"index.tsx"})}),(0,m.jsx)(eI.A,{onClick:()=>s("center"),variant:"center"===r?"contained":"tonal",sx:{paddingX:"8px",minWidth:"38px",maxWidth:"38px",minHeight:"38px",maxHeight:"38px"},...a,"data-sentry-element":"Button","data-sentry-source-file":"index.tsx",children:(0,m.jsx)(eM.In,{fontSize:"22px",icon:"tabler:align-center","data-sentry-element":"Icon","data-sentry-source-file":"index.tsx"})}),(0,m.jsx)(eI.A,{onClick:()=>s("right"),variant:"right"===r?"contained":"tonal",sx:{paddingX:"8px",minWidth:"38px",maxWidth:"38px",minHeight:"38px",maxHeight:"38px"},...a,"data-sentry-element":"Button","data-sentry-source-file":"index.tsx",children:(0,m.jsx)(eM.In,{fontSize:"22px",icon:"tabler:align-right","data-sentry-element":"Icon","data-sentry-source-file":"index.tsx"})})]})]})};var td=n(36594);let tc={left:"-60%",center:"0",right:"60%"},tu=(0,y.memo)(({index:e,control:t})=>{let n=(0,f.A)(),{t:a}=(0,T.o)(),{t:i}=(0,T.o)("translation",{keyPrefix:"PAGE.LESSON_DETAIL.LESSON_CONTENT"}),[r,s]=(0,y.useState)(!1),o=(0,ts.A)(e=>e.breakpoints.down("md"));return(0,m.jsx)(M.xI,{name:`content_blocks.${e}`,control:t,render:({field:{value:t,onChange:l},fieldState:{error:d}})=>(0,m.jsxs)(m.Fragment,{children:[d&&(0,m.jsx)(eO.A,{color:n.palette.error[500],children:i("required")}),t?.type_id===3&&(0,m.jsxs)(eT.A,{display:"flex",flexDirection:"column",gap:n.spacing(3),children:[(0,m.jsxs)(eT.A,{display:"flex",gap:n.spacing(8),flexDirection:{xs:"column",md:"row"},children:[(0,m.jsx)(eq.Ay,{"data-form-path":`content_blocks.${e}.content.btn_text`,"data-element-type":"input","data-ai-field":`Edit content block/field Button with index ${e} button label/title text`,onChange:e=>l({...t,content:{...t.content,btn_text:e.target.value}}),label:a("PAGE.EDITOR.BUTTON.label"),placeholder:a("FORM.click_here"),helperText:a("PAGE.EDITOR.BUTTON.label_help"),fullWidth:!o,value:t?.content.btn_text||""}),(0,m.jsx)(eq.Ay,{"data-form-path":`content_blocks.${e}.content.btn_url`,"data-element-type":"input","data-ai-field":`Edit content block/field Button with index ${e} button url text`,onChange:e=>l({...t,content:{...t.content,btn_url:e.target.value}}),label:a("PAGE.EDITOR.BUTTON.link"),placeholder:a("FORM.mentortools_url"),helperText:a("PAGE.EDITOR.BUTTON.link_help"),fullWidth:!o,value:t?.content.btn_url||""})]}),(0,m.jsx)(eT.A,{children:(0,m.jsx)(eI.A,{"data-form-path":`content_blocks.${e}.content.styles_collapse`,"data-element-type":"button","data-ai-field":`Toggle styles section for Button with index ${e}`,onClick:()=>s(!r),variant:"tonal",size:"small",endIcon:(0,m.jsx)(eM.In,{icon:"tabler:chevron-down",style:{transition:"all 0.2s ease-in-out",transform:`rotate(${180*!r}deg)`}}),children:a("PAGE.EDITOR.BUTTON.styles")})}),(0,m.jsx)(e9.A,{in:r,children:(0,m.jsxs)(eT.A,{display:"flex",gap:n.spacing(3),children:[(0,m.jsx)(eT.A,{alignItems:"center",bgcolor:n.palette.background.paper,border:"1px",borderRadius:"8px",display:"flex",flexDirection:"column",gap:n.spacing(4),justifyContent:"center",padding:n.spacing(6),width:"100%",children:(0,m.jsx)(eI.A,{size:t?.content.btn_size,variant:"contained",sx:{bgcolor:t?.content.btn_color,color:t?.content.btn_text_color,fontWeight:t?.content.btn_font==="bold"?600:4
100,transition:"all 0.5s ease-in-out",marginLeft:tc[t?.content.btn_position]},onClick:()=>{window.open(t?.content.btn_url,"_BLANK")},children:t?.content.btn_text||a("FORM.click_here")})}),(0,m.jsx)(eT.A,{border:"1px",borderRadius:"8px",display:"flex",flexDirection:"column",gap:n.spacing(4),padding:n.spacing(6),width:"100%",children:(0,m.jsxs)(eT.A,{display:"flex",flexDirection:"column",gap:n.spacing(2),children:[(0,m.jsx)(eO.A,{variant:"body2",children:a("PAGE.EDITOR.BUTTON.style")}),(0,m.jsxs)(eT.A,{display:"flex",gap:n.spacing(2),children:[(0,m.jsx)(td.A,{"data-form-path":`content_blocks.${e}.content.btn_color`,"data-element-type":"input","data-ai-field":`Edit content block/field Button with index ${e} button color hex color, value = hex color code`,onChange:e=>l({...t,content:{...t.content,btn_color:e}}),value:t?.content.btn_color,label:a("PAGE.EDITOR.BUTTON.color")}),(0,m.jsx)(td.A,{"data-form-path":`content_blocks.${e}.content.btn_text_color`,"data-element-type":"input","data-ai-field":`Edit content block/field Button with index ${e} button text color hex color, value = hex color code`,onChange:e=>l({...t,content:{...t.content,btn_text_color:e}}),value:t?.content.btn_text_color,label:a("PAGE.EDITOR.BUTTON.text_color")})]}),(0,m.jsx)(eT.A,{children:(0,m.jsx)(eS.A,{"data-form-path":`content_blocks.${e}.content.btn_font`,"data-element-type":"checkbox","data-ai-field":`Edit content block/field Button with index ${e} bold/normal font toggle where value='bold' or 'normal'`,label:a("PAGE.EDITOR.BUTTON.text_bold"),value:t?.content.btn_font==="bold",control:(0,m.jsx)(ew.A,{checked:t?.content.btn_font==="bold",onChange:e=>l({...t,content:{...t.content,btn_font:e.target.checked?"bold":"normal"}})})})}),(0,m.jsxs)(eT.A,{display:"flex",flexDirection:"column",gap:n.spacing(4),children:[(0,m.jsx)(tl,{"data-form-path":`content_blocks.${e}.content.btn_position`,"data-element-type":"radio","data-ai-field":`Edit content block/field Button with index ${e} alignment in lesson (left | center | right)`,onChange:e=>l({...t,content:{...t.content,btn_position:e}}),value:t?.content.btn_position,label:a("PAGE.EDITOR.BUTTON.alignment_in_lesson")}),(0,m.jsx)(to.A,{"data-form-path":`content_blocks.${e}.content.btn_size`,"data-element-type":"select","data-ai-field":`Edit content block/field Button with index ${e} button size (small | medium | large)`,label:(0,m.jsx)(eO.A,{variant:"body2",children:a("PAGE.EDITOR.BUTTON.size")}),selectItems:[{name:a("PAGE.EDITOR.BUTTON.small"),value:"small"},{name:a("PAGE.EDITOR.BUTTON.medium"),value:"medium"},{name:a("PAGE.EDITOR.BUTTON.large"),value:"large"}],handleValueChange:e=>l({...t,content:{...t.content,btn_size:e.target.value}}),value:t?.content.btn_size||""})]})]})})]})})]})]})})});var tp=n(67746),tm=n(50782);let ty=(0,y.memo)(({control:e,additionalActionContent:t,index:n,...a})=>{let i=(0,f.A)(),{t:r}=(0,T.o)("translation",{keyPrefix:"PAGE.LESSON_DETAIL.LESSON_CONTENT"});return(0,m.jsx)(M.xI,{control:e,name:`content_blocks.${n}`,render:({field:{value:e,onChange:n},fieldState:{error:s}})=>(0,m.jsxs)(m.Fragment,{children:[s&&(0,m.jsx)(eO.A,{color:i.palette.error[500],children:r("required")}),2===e.type_id&&(0,m.jsx)(tp.zz,{children:(0,m.jsx)(tm.A,{additionalActionContent:t,value:e.content?.payload,onChange:t=>n({...e,content:{...e.content,payload:t}}),...a}
1)})]})})});var tx=n(81170),th=n(32894);let tf=(0,y.memo)(({index:e,control:t,...n})=>{let a=(0,f.A)(),{t:i}=(0,T.o)("translation",{keyPrefix:"PAGE.LESSON_DETAIL.LESSON_CONTENT"});return(0,m.jsx)(h.A,{gap:a.spacing(1),width:{xs:320,md:"100%"},children:(0,m.jsx)(M.xI,{control:t,name:`content_blocks.${e}`,render:({field:{value:e,onChange:t},fieldState:{error:r}})=>(0,m.jsxs)(h.A,{children:[r&&(0,m.jsx)(eO.A,{color:a.palette.error[500],children:i("required")}),1===e.type_id&&(0,m.jsx)(th.A,{allowAccordion:!0,editorStyles:{wordBreak:"break-word"},value:e.content?.payload,onChange:n=>t({...e,content:{payload:n}}),...n})]})})})});var t_=n(8600);let tg=e=>(0,_.I)({...I.Ay.mentorCloud.videoMetadata(`${e}`),queryFn:async()=>e&&(await ti.A.getFile({search_by:[{attribute:"file_id",operator:"==",value:e}]})).data.result[0]||null,enabled:!!e});var tA=n(39567),tb=n(41216),tC=n(80315),tj=n(10266),tv=n(47128),tk=n(89144),tT=n(45462),tI=n(18754),tw=n(50064),tS=n(39077),tE=n(92184);let tL=({fileId:e,aspectRatio:t})=>{let n=(0,f.A)(),a=Number((0,x.useRouter)().query.lesson_id),{hasAccess:i}=(0,O.D)(),{t:r}=(0,T.o)(),{t:s}=(0,T.o)("translation",{keyPrefix:"PAGE.LESSON_DETAIL.LESSON_CONTENT"}),{anchor:o,open:l,close:d,isOpen:c}=(0,tn.f)("thumbnail-menu"),{isOpen:u,open:p,close:_}=(0,tt.A)(),{isOpen:g,open:b,close:C}=(0,tt.A)(),{isOpen:j,open:v,close:k}=(0,tt.A)(),[S,E]=(0,y.useState)(!1),[L,N]=(0,y.useState)(!1),{videoMetadata:R,setThumbnailFromFrameMutation:M,setThumbnailFromImageMutation:F,resetToDefaultMutation:D,updateLesson:B,isResetToDefaultPending:P,isSetThumbnailFromImagePending:Q,isSetThumbnailFromFramePending:V}=((e,t)=>{let n=(0,q.jE)(),{notify:a}=(0,$.A)(),{data:i,isLoading:r}=tg(e),s=I.Ay.mentorCloud.videoMetadata(`${e}`).queryKey,{mutateAsync:o,isPending:l}=(0,z.n)({mutationFn:({time:e})=>{if(!i?.id)throw Error("Video ID not found");return ti.A.resetThumbnail({id:i.id,frame_second:e})},onSuccess:()=>{a("LESSON_CONTENT.set_thumbnail_from_frame",{type:"success"}),n.invalidateQueries({queryKey:s})},onError:()=>a("LESSON_CONTENT.set_thumbnail_from_frame",{type:"error"})}),{mutateAsync:d,isPending:c}=(0,z.n)({mutationFn:e=>{if(!i?.id)throw Error("Video ID not found");return ti.A.addThumbnail({id:i.id,preview_file_id:e})},onSuccess:()=>{a("LESSON_CONTENT.set_thumbnail_from_image",{type:"success"}),n.invalidateQueries({queryKey:s})},onError:()=>a("LESSON_CONTENT.set_thumbnail_from_image",{type:"error"})}),{mutateAsync:u,isPending:p}=(0,z.n)({mutationFn:()=>{if(!i?.id)throw Error("Video ID not found");return ti.A.resetToDefaultThumbnail(i.id)},onSuccess:()=>{a("LESSON_CONTENT.reset_to_default",{type:"success"}),n.invalidateQueries({queryKey:s})},onError:()=>a("LESSON_CONTENT.reset_to_default",{type:"error"})}),{mutateAsync:m}=(0,z.n)({mutationFn:w.A.update,onSuccess:()=>{a("LESSON_CONTENT.lesson_thumbnail_update",{type:"success"})},onError:()=>a("LESSON_CONTENT.lesson_thumbnail_update",{type:"error"}),onSettled:()=>{t&&(n.invalidateQueries(I.Ay.lessons.detail(t)),n.invalidateQueries({predicate:e=>{let{queryKey:t}=I.Ay.courses.all;return e.queryKey.includes(t[0])}}))}});return{videoMetadata:i,isLoading:r,setThumbnailFromFrameMutation:o,setThumbnailFromImageMutation:d,updateLesson:m,resetToDefaultMutation:u,isResetToDefaultPending:p,isSetThumbnailFromImagePending:c,isSetThumbnailFromFramePending:l}})(e,a),H=async e=>{L&&a&&await B({values:{image_id:e,id:a},filter_by:[{attribute:"id",operator:"==",value:a}]})},{cropSource:W,onApplyCrop:Z,onClearCropSource:Y,onChangeCropSource:K,isImageUploading:G}=(0,tv.A)({imageId:null,formSetterFn:H,aspectRatio:t}),U=async e=>{if(i(eK.Qi.EDIT_FILE))try{let{data:t}=await F(e);t.result.preview_file_id&&S&&a&&await B({values:{image_id:e,id:a},filter_by:[{attribute:"id",operator:"==",value:a}]})}catch(e){console.error("Failed to set thumbnail from image:",e)}finally{_()}},X=async(e,t)=>{if(i(eK.Qi.EDIT_FILE))try{let{data:n}=await M({time:e});n.result.preview_file_id&&t&&(N(!0),K((0,tw.w8)(n.result.preview_file_id)),v())}catch(e){console.error("Failed to set thumbnail from video frame:",e)}finally{C()}};return e?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(eT.A,{position:"absolute",top:n.spacing(4),left:n.spacing(4),zIndex:10,"data-sentry-element":"Box","data-sentry-source-file":"Thumbn
1ailManager.tsx",children:[(0,m.jsx)(eP.f,{action:eK.Qi.EDIT_FILE,"data-sentry-element":"TeamMemberGuard","data-sentry-source-file":"ThumbnailManager.tsx",children:(0,m.jsx)(eI.A,{variant:"contained",color:"primary",size:"small",startIcon:(0,m.jsx)(A.A,{icon:"tabler:photo"}),endIcon:(0,m.jsx)(A.A,{icon:"tabler:chevron-down"}),onClick:e=>{i(eK.Qi.EDIT_FILE)&&l(e)},"data-sentry-element":"Button","data-sentry-source-file":"ThumbnailManager.tsx",children:s("VIDEO.thumbnail")})}),(0,m.jsxs)(tC.A,{anchorEl:o,open:c,onClose:d,"data-sentry-element":"Menu","data-sentry-source-file":"ThumbnailManager.tsx",children:[R?.preview_file_id?(0,m.jsx)(tj.A,{disabled:P,onClick:()=>{d(),D()},children:(0,m.jsxs)(h.A,{direction:"row",alignItems:"center",gap:n.spacing(2),children:[(0,m.jsx)(A.A,{icon:"tabler:rotate",fontSize:18}),s("VIDEO.reset_thumbnail")]})}):(0,m.jsx)(tj.A,{disabled:Q,onClick:()=>{d(),p()},children:(0,m.jsxs)(h.A,{direction:"row",alignItems:"center",gap:n.spacing(2),children:[(0,m.jsx)(A.A,{icon:"tabler:upload",fontSize:18}),s("VIDEO.upload_image")]})}),(0,m.jsx)(tj.A,{disabled:!e,onClick:()=>{d(),b()},"data-sentry-element":"MenuItem","data-sentry-source-file":"ThumbnailManager.tsx",children:(0,m.jsxs)(h.A,{direction:"row",alignItems:"center",gap:n.spacing(2),"data-sentry-element":"Stack","data-sentry-source-file":"ThumbnailManager.tsx",children:[(0,m.jsx)(A.A,{icon:"tabler:video",fontSize:18,"data-sentry-element":"Icon","data-sentry-source-file":"ThumbnailManager.tsx"}),s("VIDEO.select_from_video")]})})]})]}),(0,m.jsx)(tS.I,{PaperProps:{sx:{overflow:"visible",position:"relative",maxWidth:740}},open:u,onClose:_,title:s("VIDEO.upload_image"),maxWidth:"md",fullWidth:!0,actions:[(0,m.jsx)(eI.A,{onClick:_,variant:"outlined",fullWidth:!0,disabled:Q,children:r("ACTION.cancel")},"cancel")],"data-sentry-element":"CustomDialog","data-sentry-source-file":"ThumbnailManager.tsx",children:Q?(0,m.jsx)(h.A,{height:240,alignItems:"center",justifyContent:"center",children:(0,m.jsx)(tE.m,{})}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(tk.A,{existingImageId:R?.preview_file_id??null,formSetterFn:U}),(0,m.jsx)(eS.A,{control:(0,m.jsx)(ew.A,{checked:S,onChange:(e,t)=>
1E(t),color:"primary"}),label:s("VIDEO.use_as_lesson_thumbnail_generic"),sx:{mr:"auto"}})]})}),(0,m.jsx)(tT.$,{hasLessonThumbnailCheckbox:!0,fileId:e??void 0,isOpen:g,onClose:C,onSetThumbnail:X,isSavePending:V,"data-sentry-element":"MentorCloudVideoPreviewModal","data-sentry-source-file":"ThumbnailManager.tsx"}),(0,m.jsx)(tI.A,{aspectRatio:t,imgSrc:W,isOpen:j,onClose:Y(k),onSubmit:Z(k),isSubmitting:G,"data-sentry-element":"ImageCropperModal","data-sentry-source-file":"ThumbnailManager.tsx"})]}):null};var tN=n(65450),tO=n(86888),tR=n(97786),tM=n(25875),tq=n(92955),tz=n(6872);let tF=Y.Ik({order:Y.ai(),started_at:Y.Yj(),finished_at:Y.Yj(),transcription:Y.Yj({errorMap:()=>({message:"transcript"})})}),tD=Y.Ik({segments:Y.YO(tF)}),t$=e=>({segments:[...e.file_transcription?.segments||[]]});var tB=n(48711);let tP=()=>{let{mutateAsync:e,isPending:t}=(0,z.n)({mutationFn:tz.K.getFileTranscription});return{getFileTranscriptionAsync:e,isGetFileTranscriptionPending:t}},tQ="in_progress",tV="finished_with_error";var tH=n(80390);let tW="starting",tZ="polling",tY="error";var tK=n(82179),tG=n(39244),tU=n(75575),tX=n(91555);let tJ=({isOpen:e,onClose:t,onConfirm:n})=>{let{t:a}=(0,T.o)(),{t:i}=(0,T.o)("translation",{keyPrefix:"UPLOAD.VIDEO.TRANSCRIPT.AI_MODAL"}),[r,s]=(0,y.useState)(tX.S$.DE),o=(0,y.useMemo)(()=>tX.q0.map(e=>({value:e,name:a(`LANGUAGE.${(0,tU.j9)(e)}`)})),[a]);return(0,m.jsx)(tG.j,{open:e,onClose:t,title:i("title"),contentBody:(0,m.jsxs)(tK.A,{spacing:2,children:[(0,m.jsx)(eO.A,{children:i("select_language")}),(0,m.jsx)(to.A,{title:i("label"),placeholder:i("placeholder"),value:r,handleValueChange:e=>s(e.target.value),selectItems:o})]}),buttons:[{text:a("ACTION.close"),onClick:t,variant:"tonal",color:"primary"},{text:i("transcribe_with_ai"),onClick:()=>{n(r),t()},variant:"contained",color:"primary"}],"data-sentry-element":"CustomModal","data-sentry-component":"GenerateTranscriptWithAiModal","data-sentry-source-file":"GenerateTranscriptWithAIModal.tsx"})};var t2=n(9835);let t0=(0,eV.Ay)(h.A)(({theme:e})=>({border:"1px solid",borderColor:e.palette.divider,borderRadius:e.shape.borderRadius,padding:e.spacing(2),width:"100%"})),t1=({isOpen:e,onClose:t,onConfirm:n})=>{let{t:a}=(0,T.o)(),{t:i}=(0,T.o)("translation",{keyPrefix:"UPLOAD.VIDEO.TRANSCRIPT.SRT_MODAL"}),[r,s]=(0,y.useState)(null),o=(0,y.useRef)(null),l=()=>{s(null),o.current&&(o.current.value=""),t()};return(0,m.jsx)(tG.j,{open:e,onClose:l,title:i("title"),contentBody:(0,m.jsxs)(h.A,{spacing:2,children:[(0,m.jsx)(eO.A,{children:i("select_file")}),r?(0,m.jsxs)(t0,{direction:"row",alignItems:"center",spacing:2,children:[(0,m.jsx)(A.A,{icon:"tabler:file-text",fontSize:28}),(0,m.jsxs)(h.A,{minWidth:0,children:[(0,m.jsx)(eO.A,{noWrap:!0,title:r.name,children:r.name}),(0,m.jsx)(eO.A,{variant:"caption",color:"text.secondary",children:i("file_info",{size:(0,ta.v7)(r.size)})})]})]}):(0,m.jsx)(t2.A,{requirements:i("requirements"),fileInputRef:o,accept:".srt",mentorCloudEnabled:!1,onUpload:e=>s(e?.[0]??null)})]}),buttons:[{text:a("ACTION.close"),onClick:l,variant:"tonal",color:"primary"},{text:i("upload_srt"),disabled:!r,tooltip:r?void 0:i("upload_file_to_proceed"),onClick:()=>{n(r),l()},variant:"contained",color:"primary"}],"data-sentry-element":"CustomModal","data-sentry-component":"UploadSRTModal","data-sentry-source-file":"UploadSRTModal.tsx"})};var t3=n(99782),t5=n(74175);let t7=({status:e,isAI:t=!1})=>{let{t:n}=(0,T.o)("translation",{keyPrefix:"UPLOAD.VIDEO.TRANSCRIPT"});switch(e){case"idle":default:return null;case"loading":return(0,m.jsxs)(t3.A,{component:h.A,spacing:2,padding:2,children:[(0,m.jsx)(eO.A,{children:n(t?"generating_with_ai":"generating")}),(0,m.jsx)(t5.A,{"aria-label":"Loading…",variant:"query"})]});case"error":return t?(0,m.jsx)(eO.A,{children:n("ai_transcription_failed")}):null}};var t8=n(36940),t4=n(81829);let t6=(0,eV.Ay)(h.A)(({theme:e})=>({padding:e.spacing(4),borderRadius:e.spacing(1.5),maxHeight:237,overflow:"auto",border:`1px solid ${e.palette.grey[200]}`,gap:e.spacing(3)})),t9=(0,eV.Ay)("textarea")(({theme:e})=>({width:"100%",minHeight:40,resize:"vertical",font:"inherit",padding:e.spacing(2),borderRadius:e.spacing(1),border:`1px solid ${e.palette.divider}`,background:e.palette.background.paper,color:e.palette.text.primary,fieldSizing:"content","&:disabled":{color:e.palette.text.disabled,WebkitTextFillColor:e.palette.text.disabled}})),ne=(0,y.memo)(({segment:e,control:t,index:n,disabled:a})=>{let i=(0,f.A)(),{t:r}=(0,T.o)("translation",{keyPrefix:"UPLOAD.VIDEO.TRANSCRIPT"});return(0,m.jsxs)(h.A,{direction:"row",spacing:i.spacing(3),alignItems:"flex-start",children:[(0,m.jsx)(eO.A,{minWidth:50,color:i.palette.primary.main,paddingTop:i.spacing(2),children:(0,t8.k)(e.started_at)}),(0,m.jsx)(M.xI,{control:t,name:`segments.${n}
1.transcription`,render:({field:e,fieldState:{invalid:t,error:n}})=>(0,m.jsxs)(h.A,{flex:1,children:[(0,m.jsx)(t9,{...e,rows:1,disabled:a,"aria-invalid":t}),n?.message&&(0,m.jsx)(eO.A,{variant:"caption",color:"error",children:r(`validation.${n.message}`)})]})})]})});ne.displayName="TranscriptSegmentEditor";let nt=(0,y.memo)(({fileTranscription:e})=>{let t=(0,f.A)(),{hasAccess:n}=(0,O.D)(),{t:a}=(0,T.o)("translation",{keyPrefix:"UPLOAD.VIDEO.TRANSCRIPT"}),{isOpen:i,toggle:r}=(0,tA.A)(),{isOpen:s,open:o,close:l}=(0,tt.A)(),{isOpen:d,open:c,close:u}=(0,tt.A)(),{control:p,onSubmit:x,onUpdateTranscription:_,trigger:g,isDirty:b}=(e=>{let{hasAccess:t}=(0,O.D)(),{control:n,handleSubmit:a,reset:i,trigger:r,formState:{isSubmitting:s,isDirty:o}}=(0,M.mN)({resolver:(0,F.u)(tD),defaultValues:t$(e),mode:"onSubmit",reValidateMode:"onChange"}),l=e=>{i(t$(e))},{isUpdateFileTranscriptionPending:d,updateFileTranscription:c}=(({onSuccess:e,shouldNotifySuccess:t=!1})=>{let{notify:n}=(0,$.A)(),a=(0,q.jE)(),{t:i}=(0,T.o)(),{mutateAsync:r,isPending:s}=(0,z.n)({mutationFn:tz.K.updateFileTranscription,onSuccess:(i,r)=>{t&&n("FILE_TRANSCRIPTION.update"),a.setQueryData(tq.R.transcription(r.file_id).queryKey,i),e?.(i.data.result)},onError:(e,t)=>{a.invalidateQueries({queryKey:tq.R.transcription(t.file_id).queryKey}),n(i("ALERT.ERROR.FILE_TRANSCRIPTION.update",{fileId:t.file_id}),{type:"error"})}});return{updateFileTranscription:r,isUpdateFileTranscriptionPending:s}})({onSuccess:l});return{isSubmitting:s||d,control:n,isDirty:o,trigger:r,onUpdateTranscription:l,onSubmit:(0,y.useMemo)(()=>a(async n=>{if(t(eK.Qi.EDIT_FILE))try{await c({file_id:e.file_id,values:n})}catch(e){}}),[a,c,e.file_id,t])}})(e),{isRestoreFileTranscriptionPending:C,restoreFileTranscription:j}=(({onSuccess:e})=>{let{notify:t}=(0,$.A)(),n=(0,q.jE)(),{mutate:a,isPending:i}=(0,z.n)({mutationFn:tz.K.restoreFileTranscription,onSuccess:(a,i)=>{t("FILE_TRANSCRIPTION.restore"),n.setQueryData(tq.R.transcription(i.file_id).queryKey,a),e?.(a.data.result)},onError:(e,a)=>{(n.invalidateQueries({queryKey:tq.R.transcription(a.file_id).queryKey}),(0,tB.F0)(e)&&"error"in e.response?.data)?t(e.response?.data.error,{type:"error"}):t("FILE_TRANSCRIPTION.restore",{type:"error"})}});return{restoreFileTranscription:a,isRestoreFileTranscriptionPending:i}})({onSuccess:_}),{isTranscribeWithAILoading:k,AITranscriptionStatus:I,transcribeWithAI:w}=(({onSuccess:e})=>{let[t,n]=(0,y.useState)("idle"),a=(0,q.jE)(),{notify:i}=(0,$.A)(),{mutateAsync:r}=(0,z.n)({mutationFn:tz.K.transcribeWithAI}),{getFileTranscriptionAsync:s}=tP(),o=async e=>{let{data:{result:{status:t,error_message:n}}}=await tz.K.getFileTranscriptionStatus({file_id:e});switch(t){case"in_progress":return await new Promise(e=>setTimeout(()=>e(null),tH.KF)),o(e);case"finished":case"finished_with_error":return{status:t,error_message:n}}};return{transcribeWithAI:async({file_id:t,language_code:l})=>{try{n(tW),await r({file_id:t,language_code:l}),n(tZ);let{status:a,error_message:d}=await o(t);if(a===tV)return n(tY),i(d||"FILE_TRANSCRIPTION.status",{type:"error"});let c=(await s({file_id:t})).data.result;e?.(c),n("success")}catch(e){n(tY)}finally{a.invalidateQueries(tq.R.transcription(t))}},AITranscriptionStatus:t,isTranscribeWithAILoading:t===tZ||t===tW}})({onSuccess:_}),{isUploadSRTPending:S,uploadSRT:E}=(({onSuccess:e})=>{let{notify:t}=(0,$.A)(),n=(0,q.jE)(),{getFileTranscriptionAsync:a}=tP(),{mutate:i,isPending:r}=(0,z.n)({mutationFn:async({file_id:e,subtitles:t})=>(await tz.K.addSRTTranscription({file_id:e,subtitles:t}),await a({file_id:e})),onSuccess:(a,i)=>{t("FILE_TRANSCRIPTION.srt"),n.invalidateQueries(tq.R.transcription(i.file_id)),e?.(a.data.result)},onError:()=>{t("FILE_TRANSCRIPTION.srt",{type:"error"})}});return{uploadSRT:i,isUploadSRTPending:r}})({onSuccess:_}),{setUniqueCallback:L,removeUniqueCallback:N}=v();(0,y.useEffect)(()=>(L((0,t4.n)(e.file_id),{submit:async()=>await (b&&x()),validate:g}),()=>N((0,t4.n)(e.file_id))),[e.file_id,b,x,N,L,g]);let{fields:R}=(0,M.jz)({control:p,name:"segments"}),D=!n(eK.Qi.EDIT_FILE);return(0,m.jsxs)(h.A,{spacing:t.spacing(3),children:[!i&&(0,m.jsxs)(h.A,{spacing:t.spacing(4),children:[(0,m.jsx)(eq.XY,{value:e.file_transcription?.transcription,multiline:!0,maxRows:10,fullWidth:!0,disabled:!0,sx:{"& .MuiInputBase-input":{color:`${t.palette.grey[800]} !important`,"-webkit-text-fill-color":`${t.palette.grey[800]} !important`}},inputProps:{readOnly:!0}}),(0,m.jsxs)(h.A,{direction:"row",alignItems:"center",spacing:t.spacing(2),children:[(0,m.jsx)(A.A,{icon:"tabler:info-circle",fontSize:18,color:t.palette.grey[500]}),(0,m.jsx)(eO.A,{variant:"body2",color:t.palette.grey[500],children:a("edit_only_timestamps")})]})]}),i&&(0,m.jsxs)(h.A,{spacing:t.spacing(4),children:[(0,m.jsx)(t6,{children:R.map((e,t)=>(0,m.jsx)(ne,{segment:e,index:t,control:p,disabled:D},e.id))}),(0,m.jsxs)(h.A,{direction:"row",alignItems:"center",spacing:t.spacing(2),children:[(0,m.jsx)(A.A,{icon:"tabler:info-circle",fontSize:18,color:t.palette.grey[500]}),(0,m.jsx)(eO.A,{variant:"body2",color:t.palette.grey[500],children:a("empty_info")})]})]}),(0,m.jsxs)(h.A,{justifyContent:"space-between",direction:"row",alignItems:"center",spacing:t.spacing(2),children:[(0,m.jsx)(eS.A,{onChange:()=>r(),checked:i,label:a("show_timestamps_label"),control:(0,m.jsx)(tM.A,{})}),(0,m.jsx)(eP.f,{action:eK.Qi.EDIT_FILE,children:(0,m.jsxs)(h.A,{flex:1,useFlexGap:!0,flexWrap:"wrap",direction:"row",alignItems:"center",justifyContent:"flex-end",spacing:t.spacing(2),children:[(0,m.jsx)(eR.A,{size:"small",variant:"outlined",loading:S,onClick:n(eK.Qi.EDIT_FILE)?c:void 0,children:a("upload_srt")}),(0,m.jsx)(eR.A,{size:"small",variant:"outlined",loading:k,onClick:n(eK.Qi.EDIT_FILE)?o:void 0,children:a("transcribe_with_ai")}),(0,m.jsx)(eR.A,{size:"small",variant:"outlined",loading:C,onClick:n(eK.Qi.EDIT_FILE)?()=>j({file_id:e.file_id}):void 0,children:a("restore_original")})]})})]}),(0,m.jsx)(t7,{status:(e=>{switch(e){case"idle":case"success":return"idle";case"starting":case"polling":return"loading";case"error":return"error"}})(I),isAI:!0}),(0,m.jsx)(tJ,{isOpen:s,onClose:l,onConfirm:t=>w({file_id:e.file_id,language_code:t})}),(0,m.jsx)(t1,{isOpen:d,onClose:u,onConfirm:t=>E({file_id:e.file_id,subtitles:t})})]})});nt.displayName="TranscriptForm";let nn="transcribing",na="idle",ni=({fileId:e})=>{let{hasAccess:t}=(0,O.D)(),{t:n}=(0,T.o)("translation",{keyPrefix:"UPLOAD.VIDEO.TRANSCRIPT"}),a=(0,f.A)(),[i,r]=(0,y.useState)(na),{notify:s}=(0,$.A)(),o=(0,q.jE)(),l=(0,y.useRef)(!1),{isTranscribeFilePending:d,transcribeFile:c}=(({onSuccess:e})=>{let{notify:t}=(0,$.A)(),n=(0,q.jE)(),{mutate:a,isPending:i}=(0,z.n)({mutationFn:tz.K.transcribeFile,onSuccess:(a,i)=>{t("FILE_TRANSCRIPTION.transcribe"),n.setQueryData(tq.R.transcription(i.file_id).queryKey,a),e?.()},onError:e=>{(0,tB.F0)(e)&&"error"in e.response?.data?t(e.response?.data.error,{type:"error"}):t("FILE_TRANSCRIPTION.transcribe",{type:"error"})},onSettled:(e,t,a)=>n.invalidateQueries({queryKey:tq.R.transcription(a.file_id).queryKey})});return{transcribeFile:a,isTranscribeFilePending:i}})({onSuccess:()=>{r(nn),l.current=!1,o.invalidateQueries({queryKey:tq.R.transcriptionStatus(e).queryKey})}}),{isError:u,isLoading:p,isSuccess:x}=(({fileId:e,enabled:t})=>{let{isLoading:n,isPending:a,data:i}=(0,_.I)({queryFn:()=>tz.K.getFileTranscriptionStatus({file_id:e}),queryKey:tq.R.transcriptionStatus(e).queryKey,refetchInterval:e=>{if(!t)return!1;let n=e.state.data?.data.result.status;return(!n||n===tQ)&&1e3},select:e=>e.data.result,enabled:t});return{isPending:a,isLoading:n||i?.status===tQ,isError:i?.status===tV,isSuccess:i?.status==="finished",errorMessage:i?.error_message}})({fileId:e,enabled:t(eK.Qi.UPLOAD_FILE)&&i===nn});return((0,y.useEffect)(()=>{t(eK.Qi.UPLOAD_FILE)&&!l.current&&(u&&(s("FILE_TRANSCRIPTION.status",{type:"error"}),l.current=!0,r(na)),x&&(s("FILE_TRANSCRIPTION.status"),l.current=!0,r(na),o.invalidateQueries({queryKey:tq.R.transcription(e).queryKey})))},[u,x,s,r,o,e]),i===nn)?(0,m.jsx)(t7,{status:"loading"}):(0,m.jsxs)(h.A,{spacing:a.spacing(3),"data-sentry-element":"Stack","data-sentry-component":"GenerateTranscript","data-sentry-source-file":"GenerateTranscript.tsx",children:[(0,m.jsx)(eO.A,{"data-sentry-element":"Typography","data-sentry-source-file":"GenerateTranscript.tsx",children:n("not_generated")}),(0,m.jsx)(eP.f,{action:eK.Qi.UPLOAD_FILE,"data-sentry-element":"TeamMemberGuard","data-sentry-source-file":"GenerateTranscript.tsx",children:(0,m.jsx)(eR.A,{sx:{alignSelf:"end"},size:"small",variant:"contained",loading:d||p,onClick:t(eK.Qi.UPLOAD_FILE)?()=>c({file_id:e}):void 0,"data-sentry-element":"LoadingButton","data-sentry-source-file":"GenerateTranscript.tsx",children:n("generate")})})]})},nr=(0,y.memo)(({fileId:e})=>{let t=(0,f.A)(),{t:n}=(0,T.o)("translation",{keyPrefix:"UPLOAD.VIDEO.TRANSCRIPT"}),{fileTranscription:a,isFileTranscriptionError:i,isFileTranscriptionLoading:r,isMissingFileTranscription:s}=(0,tR.u)(e);return r?(0,m.jsxs)(h.A,{spacing:t.spacing(6),children:[(0,m.jsx)(tO.A,{variant:"text"}),(0,m.jsx)(tO.A,{variant:"rectangular",height:240})]}):s?(0,m.jsx)(ni,{fileId:e}):i?(0,m.jsx)(eO.A,{color:t.palette.error.main,children:n("loading_error")}):a&&a.file_transcription?(0,m.jsx)(nt,{fileTranscription:a}):(0,m.jsx)(ni,{fileId:e})}),ns=({index:e})=>{let t=(0,f.A)(),{t:n}=(0,T.o)("translation",{keyPrefix:"PAGE.LESSON_DETAIL.LESSON_CONTENT.VIDEO.transcript"}),a=(0,y.useContext)(k),{control:i}=(0,M.xW)();return!a||a.is_file_transcription_shown?null:(0,m.jsxs)(h.A,{spacing:t.spacing(2),border:`1px solid ${t.palette.divider}`,borderColor:t.palette.warning.main,borderRadius:t.spacing(1.2),padding:t.spacing(3),"data-sentry-element":"Stack","data-sentry-component":"ContentBlockTranscriptVisibilitySettings","data-sentry-source-file":"ContentBlockTranscriptVisibilitySettings.tsx",children:[(0,m.jsx)(eO.A,{variant:"body1","data-sentry-element":"Typography","data-sentry-source-file":"ContentBlockTranscriptVisibilitySettings.tsx",children:n("course_transcription_off")}),(0,m.jsxs)(h.A,{spacing:t.spacing(1),"data-sentry-element":"Stack","data-sentry-source-file":"ContentBlockTranscriptVisibilitySettings.tsx",children:[(0,m.jsx)(eO.A,{variant:"body1","data-sentry-element":"Typography","data-sentry-source-file":"ContentBlockTranscriptVisibilitySettings.tsx",children:n("course_transcription_override")}),(0,m.jsx)(M.xI,{control:i,render:({field:e})=>(0,m.jsx)(eT.A,{children:(0,m.jsx)(eS.A,{...e,control:(0,m.jsx)(tM.A,{checked:!!e.value,sx:{marginTop:t.spacing(-3),marginBottom:t.spacing(-3)}}),label:(0,m.jsx)(eO.A,{variant:"body1",children:n("show_transcript")})})}),name:`content_blocks.${e}.content.is_file_transcription_shown`,"data-sentry-element":"Controller","data-sentry-source-file":"ContentBlockTranscriptVisibilitySettings.tsx"})]})]})};var no=n(76448),nl=n(32952);let nd=(0,y.memo)(({index:e,control:t})=>{let n=(0,f.A)(),{t:a}=(0,T.o)("translation",{keyPrefix:"PAGE.LESSON_DETAIL.LESSON_CONTENT"}),{t:i}=(0,T.o)("translation",{keyPrefix:"UPLOAD.VIDEO.TRANSCRIPT"}),r=(0,M.FH)({control:t,name:`content_blocks.${e}.content.file_id`}),{data:s}=tg(r),{toggle:o,isOpen:l}=(0,tA.A)();return(0,m.jsx)(M.xI,{control:t,name:`content_blocks.${e}`,render:({field:{value:t,onChange:d},fieldState:{error:c}})=>{let u=t?.content,p=u?.file_id,y=u?.link;return(0,m.jsxs)(h.A,{children:[c&&(0,m.jsx)(eO.A,{color:n.palette.error[500],children:a("required")}),4===t.type_id&&(0,m.jsxs)(h.A,{position:"relative",gap:n.spacing(3),children:[!t.content.link&&(0,m.jsx)(tL,{fileId:r||p}),(0,m.jsx)(tb.A,{contentBelowUrl:(0,m.jsxs)(h.A,{gap:n.spacing(3),width:"100%",children:[(0,nl.nj)(t)&&(0,m.jsx)(no.Mb,{index:e}),(0,m.jsx)(eP.f,{action:eK.Qi.VIEW_FILE,children:(0,m.jsx)(t_.A,{arrow:!0,title:p?void 0:i("transcript_info_tooltip"),children:(0,m.jsx)("span",{children:(0,m.jsx)(eI.A,{endIcon:(0,m.jsx)(tN.WM,{isOpen:l,children:(0,m.jsx)(A.A,{icon:"tabler:chevron-down",fontSize:16})}),sx:{minHeight:41},disabled:!p,onClick:()=>o(),variant:"tonal",color:"primary",children:i("toggle_transcript")})})})})]}),"data-form-path":`content_blocks.${e}.content.file_id`,"data-ai-field":`Manage video uploader for content block with index ${e}`,existingSource:y,existingVideoId:p,formSetterFn:({id:e,url:n})=>d({...t,content:{...t.content,file_id:e,link:n}})},`${p}_${s?.preview_file_id||"default"}_${s?.preview_link||""}`),p&&(0,m.jsx)(eP.f,{action:eK.Qi.VIEW_FILE,children:(0,m.jsx)(e9.A,{in:l,mountOnEnter:!0,children:(0,m.jsxs)(h.A,{spacing:n.spacing(2),children:[(0,m.jsx)(ns,{index:e}),(0,m.jsx)(nr,{fileId:p})]})})})]})]})},"data-sentry-element":"Controller","data-sentry-component":"Video","data-sentry-source-file":"index.tsx"})});var nc=n(48530),nu=n(54227),np=n(74441),nm=n(65263),ny=n(36649),nx=n(48790);let nh=Object.assign(()=>(0,m.jsx)(m.Fragment,{}),{Audio:({index:e,control:t})=>{let n=(0,f.A)(),{t:a}=(0,T.o)("translation",{keyPrefix:"PAGE.LESSON_DETAIL.LESSON_CONTENT"}),i=(0,M.FH)({control:t,name:`content_blocks.${e}`}),r=(0,y.useMemo)(()=>i?.content&&"audio_id"in i.content&&!!i.content.audio_id,[i?.content]);return(0,m.jsxs)(h.A,{gap:n.spacing(3),"data-sentry-element":"Stack","data-sentry-component":"Audio","data-sentry-source-file":"index.tsx",children:[(0,m.jsx)(M.xI,{control:t,name:`content_blocks.${e}`,render:({field:{value:t,onChange:i},fieldState:{error:r}})=>(0,m.jsxs)(m.Fragment,{children:[r&&(0,m.jsx)(eO.A,{color:n.palette.error[500],children:a("required")}),t.type_id===Q.KL.Audio&&(0,m.jsx)(tr.Ay,{additionalAudioText:t?.content?.audio_additional_text??"","data-form-path":`content_blocks.${e}.content.audio_id`,"data-ai-field":`Manage audio file for content block/field with index ${e}`,existingAudioId:t?.content?.audio_id,formSetterFn:e=>{i({...t,content:{audio_id:e,link:""}})}})]}),"data-sentry-element":"Controller","data-sentry-source-file":"index.tsx"}),r&&(0,m.jsx)(M.xI,{control:t,name:`content_blocks.${e}
1.content.audio_additional_text`,render:({field:{onChange:e,value:t}})=>(0,m.jsx)(eq.XY,{multiline:!0,fullWidth:!0,rows:2,onChange:e,value:t,placeholder:a("description_text_placeholder"),label:a("description_text_label")})})]})},Button:tu,HTML:ty,PDF:({control:e,index:t})=>{let{t:n}=(0,T.o)("translation",{keyPrefix:"PAGE.LESSON_DETAIL.LESSON_CONTENT"}),a=(0,f.A)();return(0,m.jsx)(M.xI,{control:e,name:`content_blocks.${t}`,render:({field:{value:e,onChange:i},fieldState:{error:r}})=>(0,m.jsxs)(m.Fragment,{children:[r&&(0,m.jsx)(eO.A,{color:a.palette.error[500],children:n("required")}),6===e.type_id&&(0,m.jsx)(tx.A,{"data-form-path":`content_blocks.${t}.content.pdf_id`,"data-ai-field":`Manage pdf file for content block/field with index ${t}`,existingPdfId:e?.content?.pdf_id,formSetterFn:t=>{e&&i({...e,content:{...e.content,pdf_id:t}})}})]}),"data-sentry-element":"Controller","data-sentry-component":"PDF","data-sentry-source-file":"index.tsx"})},RichText:tf,Video:nd,Certificate:(0,y.memo)(({index:e})=>{let{t}=(0,T.o)("translation",{keyPrefix:"PAGE.EDITOR.CERTIFICATE"}),n=(0,f.A)(),a=(0,x.useRouter)(),{data:i,isSuccess:r,isLoading:s,isError:o}=(0,nm._X)(),l=Array.isArray(a.query.course_id)?a.query.course_id[0]:a.query.course_id,d=Array.isArray(a.query.lesson_id)?a.query.lesson_id[0]:a.query.lesson_id,{getValues:c,setValue:u,control:p}=(0,M.xW)(),g=((e,t)=>{let{content_blocks:n}=e,a=n?.[t]?.content;return"template_id"in a&&a.template_id})(c(),e),[A,C]=(0,y.useState)(void 0),{data:j}=S(Number(d)),{data:v,isLoading:k,isFetching:w}=(0,ny.t)({params:{lessonId:Number(d),templateId:g||0},options:{enabled:!!g}}),{data:E,isLoading:L,isError:N,isSuccess:O}=(0,_.I)({queryKey:I.Ay.courses.courseQuizzes(Number(l)??0).queryKey,queryFn:()=>nx.A.getOne({filter_by:[{attribute:"is_archived",value:!1},{attribute:"id",value:Number(l)}]}),select:e=>{let t=[];return e.data.result[0]?.modules.forEach(e=>{e.lessons.forEach(e=>{e.type_id===en.nv.QUIZ&&t.push(e)}),e.submodules.forEach(e=>{e.lessons?.forEach(e=>{e.type_id===en.nv.QUIZ&&t.push(e)})})}),t},enabled:a.isReady});return((0,y.useEffect)(()=>{A===d||E&&i&&!w&&(((e,t,n,a,i,r)=>{let{content_blocks:s}=e(),o=s[n];if(!r)return t(`content_blocks.${n}`,{...o,type_id:Q.KL.Certificate,content:{type_id:"type_id"in o.content?o.content.type_id:et.A.ALWAYS,template_id:U.Fc}});if(!r)return;let{type_id:l,message:d,quiz_id:c,template_id:u}=r,p=null!==c&&i?.some(e=>e.id===c),m={type_id:l,template_id:a.some(e=>e.id===u)?u:U.Fc,quiz_id:p?c:void 0,message:d||void 0};t(`content_blocks.${n}`,{...o,type_id:Q.KL.Certificate,content:m},{shouldValidate:!0})})(c,u,e,i,E,v),C(d))},[c,e,A,O,w,r,j,d,E,u,v,i]),k)?(0,m.jsx)(b.A,{fullHeight:!1}):(0,m.jsx)(M.xI,{name:`content_blocks.${e}`,control:p,render:({field:{value:a,onChange:r},fieldState:{error:l}})=>(0,m.jsx)(m.Fragment,{children:a.type_id===Q.KL.Certificate&&(0,m.jsxs)(nu.A,{children:[(0,m.jsxs)(h.A,{spacing:n.spacing(5),children:[(0,m.jsx)(nu.A,{maxWidth:345,children:(0,m.jsx)(to.A,{loading:s,disabled:o,selectItems:i?.map(e=>({value:e.id,name:e.title}))||[],error:!!l?.content?.template_id,helperText:l?.content?.template_id?t("validation.required"):void 0,placeholder:t("select_cert_placeholder"),value:a?.content.template_id,handleValueChange:e=>{r({...a,content:{...a.content,template_id:e.target.value}})},"data-form-path":`content_blocks.${e}.content.template_id`,"data-element-type":"select","data-ai-field":`open Certificate template dropdown for content block/field with index = ${e}`})}),(0,m.jsxs)(nc.A,{children:[(0,m.jsx)(eO.A,{variant:"h6",children:t("availability")}),(0,m.jsxs)(eN.A,{defaultValue:et.A.ALWAYS,value:a?.content.type_id,onChange:e=>{let n;return n=Number(e.target.value),void r({...a,type_id:Q.KL.Certificate,content:{...a.content,type_id:n,...n===et.A.ALWAYS&&{quiz_id:void 0,message:void 0},...n===et.A.ALL_LESSONS&&{quiz_id:void 0,message:t("certificate_all_lessons_custom_message_default")},...n===et.A.QUIZ&&{message:t("certificate_quiz_custom_message_default")}}})},children:[(0,m.jsx)(eS.A,{value:et.A.ALWAYS,control:(0,m.jsx)(eL.A,{}),label:t("option.always"),"data-form-path":`content_blocks.${e}.content.type_id`,"data-element-type":"radio","data-ai-field":`Set certificate availability to Always for c
1ontent block/field with index ${e} with value = ${et.A.ALWAYS}`}),(0,m.jsx)(eS.A,{value:et.A.ALL_LESSONS,control:(0,m.jsx)(eL.A,{}),label:t("option.after_all_lessons"),"data-form-path":`content_blocks.${e}.content.type_id`,"data-element-type":"radio","data-ai-field":`Set certificate availability to After All Lessons for content block/field with index ${e} value = ${et.A.ALL_LESSONS}`}),(0,m.jsx)(t_.A,{title:E?.length===0?t("no_quizzes"):"",placement:"bottom-start",children:(0,m.jsx)("span",{children:(0,m.jsx)(eS.A,{disabled:!E||0===E.length,value:et.A.QUIZ,control:(0,m.jsx)(eL.A,{}),label:t("option.after_quiz"),"data-form-path":`content_blocks.${e}.content.type_id`,"data-element-type":"radio","data-ai-field":`Set certificate availability to After Quiz for content block/field with index ${e} value = ${et.A.QUIZ}`})})})]})]})]}),a?.content.type_id!==et.A.ALWAYS&&(0,m.jsxs)(h.A,{spacing:n.spacing(5),children:[a?.content.type_id===et.A.QUIZ&&(0,m.jsx)(nu.A,{maxWidth:250,children:(0,m.jsx)(to.A,{loading:L,disabled:N,selectItems:E?.map(e=>({value:String(e.id),name:e.title}))||[],error:!!l?.content?.quiz_id,helperText:l?.content?.quiz_id?t("validation.required"):void 0,placeholder:t("select_quiz_placeholder"),value:String(a?.content.quiz_id),handleValueChange:e=>r({...a,content:{...a.content,quiz_id:Number(e.target.value)}}),"data-form-path":`content_blocks.${e}.content.quiz_id`,"data-element-type":"select","data-ai-field":`open Select quiz dropdown for certificate availability for content block/field with index = ${e}`})}),(0,m.jsxs)(h.A,{spacing:n.spacing(2),children:[(0,m.jsxs)(h.A,{spacing:n.spacing(1),children:[(0,m.jsx)(eO.A,{variant:"h6",color:(0,np.X4)("#4B465C",.8),children:t("alternate_msg")}),(0,m.jsx)(eO.A,{variant:"body1",color:(0,np.X4)("#4B465C",.5),children:t("alternate_msg_info")})]}),(0,m.jsx)(eq.XY,{value:a?.content.message,onChange:e=>r({...a,content:{...a.content,message:e.target.value}}),error:!!l?.content?.message,helperText:l?.content?.message?t("validation.required"):void 0,fullWidth:!0,multiline:!0,minRows:2,placeholder:t("alternate_msg_placeholder"),"data-form-path":`content_blocks.${e}.content.message`,"data-element-type":"input","data-ai-field":`Edit alternate certificate message for content block/field with index ${e}`})]})]})]})})})})}),nf=(0,eV.Ay)(eT.A)(({theme:e})=>({width:200,height:200,minWidth:200,minHeight:200,maxWidth:200,maxHeight:200,overflow:"hidden",marginLeft:0,marginRight:0,[e.breakpoints.up("md")]:{width:200,height:200,minWidth:200,minHeight:200,maxWidth:200,maxHeight:200}})),n_=(0,eV.Ay)(eT.A)(({theme:e})=>({marginTop:0,width:"100%",[e.breakpoints.up("md")]:{marginTop:e.spacing(-1.5),width:"auto"}})),ng=(0,y.memo)(({control:e,index:t})=>{let n=(0,f.A)(),{t:a}=(0,T.o)("translation",{keyPrefix:"PAGE.LESSON_CONTENT"});return(0,m.jsx)(M.xI,{name:`content_blocks.${t}`,control:e,render:({field:{value:e,onChange:t},fieldState:{error:i}})=>{if(e?.type_id!==Q.KL.AI_chat)return(0,m.jsx)(m.Fragment,{});let r=e.content;return(0,m.jsxs)(h.A,{gap:n.spacing(3),width:{xs:"100%",md:"100%"},children:[i&&(0,m.jsx)(eO.A,{color:n.palette.error[500],children:a("required")}),(0,m.jsxs)(eT.A,{display:"flex",flexDirection:"column",gap:n.spacing(3),children:[(0,m.jsxs)(eT.A,{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:n.spacing(3),sx:{flexDirection:{xs:"column",xl:"row"}},children:[(0,m.jsxs)(eT.A,{flex:1,display:"flex",flexDirection:"column",gap:n.spacing(2),width:{xs:"100%",xl:"auto"},children:[(0,m.jsx)(eq.Ay,{onChange:n=>t({...e,content:{...r,name:n.target.value}}),label:a("ai_chat_name_label"),placeholder:a("ai_chat_name_placeholder"),fullWidth:!0,value:r.name||""}),(0,m.jsx)(eq.Ay,{onChange:n=>t({...e,content:{...r,conversation_starter:n.target.value}}),label:a("ai_chat_conversation_starter_label"),placeholder:a("ai_chat_conversation_starter_placeholder"),fullWidth:!0,value:r.conversation_starter||""})]}),(0,m.jsxs)(n_,{children:[(0,m.jsx)(eO.A,{variant:"body2",color:n.palette.text.secondary,sx:{mb:1},children:a("ai_chat_avatar_label")}),(0,m.jsx)(nf,{children:(0,m.jsx)(tk.A,{existingImageId:r.avatar_id||null,formSetterFn:n=>t({...e,content:{...r,avatar_id:n}}),variant:"compact",isCircle:!0,aspectRatio:1,requirementsLabel:a("ai_chat_avatar_requirements")})})]})]}),(0,m.jsx)(eq.Ay,{onChange:n=>t({...e,content:{...r,instructions:n.target.value}}),label:a("ai_chat_instructions_label"),placeholder:a("ai_chat_instructions_placeholder"),multiline:!0,rows:15,fullWidth:!0,value:r.
1instructions||""})]})]})}})});var nA=n(19610);let nb=(0,eV.Ay)(eT.A)(({theme:e})=>({height:180,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:e.palette.action.hover,color:e.palette.text.secondary})),nC=(0,y.memo)(({control:e,index:t})=>{let n=(0,f.A)(),{t:a}=(0,T.o)("translation",{keyPrefix:"PAGE.LESSON_CONTENT"}),i=e7.map(e=>({value:e.id,name:e.title}));return(0,m.jsx)(M.xI,{name:`content_blocks.${t}`,control:e,render:({field:{value:e,onChange:r},fieldState:{error:s}})=>{if(e?.type_id!==Q.KL.LiveStream)return(0,m.jsx)(m.Fragment,{});let o=e.content,l=e8(o.stream_session_id);return(0,m.jsxs)(h.A,{gap:n.spacing(5),children:[(0,m.jsx)(ek.A,{severity:"info",icon:(0,m.jsx)(A.A,{icon:"tabler:info-circle",fontSize:20}),children:a("live_stream.placeholderNotice")}),(0,m.jsx)(eT.A,{maxWidth:480,children:(0,m.jsx)(to.A,{labelText:a("live_stream.selectLabel"),selectItems:i,error:!!s?.content?.stream_session_id,helperText:s?.content?.stream_session_id?a("live_stream.validation.streamRequired"):a("live_stream.placeholderSelectHelper"),placeholder:a("live_stream.selectPlaceholder"),value:o.stream_session_id||"",handleValueChange:t=>{r({...e,content:{...o,stream_session_id:String(t.target.value)}})},"data-form-path":`content_blocks.${t}.content.stream_session_id`,"data-element-type":"select"})}),(0,m.jsxs)(h.A,{gap:n.spacing(1),children:[(0,m.jsx)(eO.A,{variant:"h6",children:a("live_stream.coverLabel")}),(0,m.jsx)(eO.A,{variant:"body2",sx:{color:"text.secondary"},children:a("live_stream.coverHelper")}),(0,m.jsx)(tk.A,{existingImageId:o.cover_image_id||null,formSetterFn:t=>r({...e,content:{...o,cover_image_id:t}}),aspectRatio:16/9,requirementsLabel:a("live_stream.coverRequirements"),"data-form-path":`content_blocks.${t}.content.cover_image_id`,"data-element-type":"image-uploader"})]}),l&&(0,m.jsxs)(nA.A,{variant:"outlined",sx:{maxWidth:480,overflow:"hidden"},children:[(0,m.jsx)(nb,{children:(0,m.jsx)(A.A,{icon:"tabler:broadcast",fontSize:40})}),(0,m.jsxs)(eT.A,{sx:{p:3},children:[(0,m.jsx)(eO.A,{variant:"subtitle1",sx:{fontWeight:600},children:l.title}),(0,m.jsx)(eO.A,{variant:"caption",sx:{color:"text.secondary"},children:l.dateLabel})]})]}),(0,m.jsxs)(nc.A,{children:[(0,m.jsx)(eO.A,{variant:"h6",sx:{mb:1},children:a("live_stream.recordingAvailabilityLabel")}),(0,m.jsx)(eO.A,{variant:"body2",sx:{color:"text.secondary",mb:2},children:a("live_stream.recordingAvailabilityHelper")}),(0,m.jsxs)(eN.A,{value:o.recording_availability,onChange:t=>{r({...e,content:{...o,recording_availability:t.target.value}})},children:[(0,m.jsx)(eS.A,{value:X,control:(0,m.jsx)(eL.A,{}),label:(0,m.jsxs)(eT.A,{children:[(0,m.jsx)(eO.A,{variant:"body2",sx:{fontWeight:600},children:a("live_stream.recording.alwaysTitle")}),(0,m.jsx)(eO.A,{variant:"caption",sx:{color:"text.secondary"},children:a("live_stream.recording.alwaysHelper")})]})}),(0,m.jsx)(eS.A,{value:J,control:(0,m.jsx)(eL.A,{}),label:(0,m.jsxs)(eT.A,{children:[(0,m.jsx)(eO.A,{variant:"body2",sx:{fontWeight:600},children:a("live_stream.recording.afterStreamTitle")}),(0,m.jsx)(eO.A,{variant:"caption",sx:{color:"text.secondary"},children:a("live_stream.recording.afterStreamHelper")})]})}),(0,m.jsx)(eS.A,{value:ee,control:(0,m.jsx)(eL.A,{}),label:(0,m.jsxs)(eT.A,{children:[(0,m.jsx)(eO.A,{variant:"body2",sx:{fontWeight:600},children:a("live_stream.recording.neverTitle")}),(0,m.jsx)(eO.A,{variant:"caption",sx:{color:"text.secondary"},children:a("live_stream.recording.neverHelper")})]})})]})]}),(0,m.jsx)(ek.A,{severity:"info",icon:(0,m.jsx)(A.A,{icon:"tabler:clock",fontSize:20}),children:a("live_stream.reminderInfo")})]})}})});var nj=n(90433),nv=n(43219);let nk=e=>!!(e&&Object.keys(e).length>0),nT=(e,t)=>{},nI=(0,y.memo)(({index:e,value:t,onChange:n,hasError:a,widgetList:i,isLoading:r,lessonId:s})=>{let o=(0,f.A)(),{t:l}=(0,T.o)("translation",{keyPrefix:"PAGE.LESSON_CONTENT"}),d=(0,y.useRef)(null),c=t.content.widget_id>0?t.content.widget_id:void 0,u=(0,y.useMemo)(()=>t.content.custom_inputs??{},[t.content.custom_inputs]),p="number"==typeof t.id?t.id:void 0,x=(0,y.useMemo)(()=>i.find(e=>e.id===c),[i,c]),{data:g,isFetching:A}=(0,_.I)({queryKey:V.Q.detail(c).queryKey,queryFn:()=>Z.Q7.get({widget_id:c}),select:e=>e.data.result,enabled:!!c,staleTime:3e4}),b=g??x,C=(0,y.useMemo)(()=>{let e=i.filter(e=>e.status===nv.HI.published).map(e=>({value:e.id,name:e.name}));return b&&!e.some(e=>
1e.value===b.id)?[{value:b.id,name:b.name},...e]:e},[i,b]),j=(0,y.useMemo)(()=>{let e=b?.manifest?.inputs||[],t=e.filter(e=>"creator"===e.source);return nT("creatorInputs resolved",{selectedId:c,fromDetail:!!g,fromList:!!x,manifestInputCount:e.length,creatorInputCount:t.length,labels:t.map(e=>e.label||e.name),sources:e.map(e=>({name:e.name,source:e.source,label:e.label}))}),t},[b?.manifest?.inputs,c,g,x]),v=(0,y.useMemo)(()=>j.filter(e=>{if(!e.required)return!1;let t=u[e.name];return null==t||""===String(t).trim()}),[j,u]),{data:k,isFetching:I}=(0,_.I)({queryKey:V.Q.placementByBlock(p).queryKey,queryFn:()=>Z.Q7.placementUpsert({content_block_id:p,lesson_id:s,widget_id:c,custom_inputs:null}),select:e=>e.data.result,enabled:!!(p&&c&&s),staleTime:6e4,retry:!1});(0,y.useEffect)(()=>{if(!k||!p)return;let e=nk(t.content.custom_inputs),a=nk(k.custom_inputs);if(nT("hydrate check",{blockId:p,selectedId:c,hydratedFor:d.current,hasLocalValues:e,hasPlacementValues:a,localKeys:Object.keys(t.content.custom_inputs??{}),placementKeys:Object.keys(k.custom_inputs??{}),isPlacementFetching:I}),e){d.current=p;return}a?(d.current=p,nT("hydrating custom_inputs from placement",{blockId:p,keys:Object.keys(k.custom_inputs??{})}),n({...t,content:{...t.content,custom_inputs:k.custom_inputs}})):nT("skip hydrate — placement has no custom_inputs (possible BE wipe or never saved)",{blockId:p,selectedId:c})},[k,p,n,t,c,I]);let w=(0,y.useCallback)(e=>{let a=Number(e.target.value);d.current=null,nT("widget selection changed",{previousId:c,nextId:a}),n({...t,content:{widget_id:Number.isFinite(a)?a:0,custom_inputs:{}}})},[n,t,c]),S=(0,y.useCallback)((e,a)=>{n({...t,content:{...t.content,custom_inputs:{...u,[e]:a}}})},[u,n,t]);return(0,m.jsxs)(h.A,{gap:o.spacing(6),width:"100%",children:[(0,m.jsx)(to.A,{labelText:l("widget_select_label"),value:c??"",handleValueChange:w,selectItems:C,loading:r||A,fullWidth:!0,placeholder:l("widget_select_placeholder"),error:a,helperText:a?l("required"):void 0,"data-form-path":`content_blocks.${e}.content.widget_id`,"data-element-type":"select","data-ai-field":`Select widget for content block ${e}`}),j.length>0?(0,m.jsxs)(h.A,{gap:o.spacing(3),children:[(0,m.jsx)(eO.A,{variant:"subtitle2",children:l("widget_creator_inputs_title")}),v.length>0?(0,m.jsx)(ek.A,{severity:"warning",variant:"outlined",children:l("widget_unconfigured",{count:v.length})}):null,(0,m.jsx)(h.A,{gap:o.spacing(2),children:j.map(e=>{let t="list"===e.type;return(0,m.jsx)(eq.Ay,{fullWidth:!0,label:e.label||e.name.split("_").filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),required:!!e.required,value:String(u[e.name]??""),onChange:t=>S(e.name,t.target.value),multiline:t,minRows:t?2:void 0,InputLabelProps:{sx:{whiteSpace:"normal",overflow:"visible",textOverflow:"unset"}}},e.name)})})]}):null]})}),nw=(0,y.memo)(({control:e,index:t})=>{let n=(0,x.useRouter)(),a=(0,y.useMemo)(()=>{let e=n.query.lesson_id;return Number(Array.isArray(e)?e[0]:e)||0},[n.query.lesson_id]),{data:i=[],isLoading:r}=(0,nj.q)({embedTarget:nv.Xc.lesson});return(0,m.jsx)(M.xI,{name:`content_blocks.${t}`,control:e,render:({field:{value:e,onChange:n},fieldState:{error:s}})=>{if(e?.type_id!==Q.KL.Widget)return(0,m.jsx)(m.Fragment,{});let o=!!s?.content?.widget_id||!!s;return(0,m.jsx)(nI,{index:t,value:e,onChange:n,hasError:o,widgetList:i,isLoading:r,lessonId:a})}})}),nS=(0,eV.Ay)(e0.A)(({theme:e})=>({color:e.palette.warning.main,alignSelf:"flex-start"})),nE=(0,eV.Ay)(h.A)(({theme:e})=>({flexDirection:"row",padding:e.spacing(4),gap:e.spacing(3),borderRadius:e.spacing(1.5),backgroundColor:e.palette.background.paper,boxShadow:e.shadow.grey.sm})),nL=(0,eV.Ay)(h.A)(({theme:e})=>({flexDirection:"row",alignItems:"center",gap:e.spacing(3),width:"100%"})),nN=(0,y.memo)(({ccHasApp:e,content:t,index:n,onDelete:a,control:i,before:r,...s})=>{let{t:o}=(0,T.o)(),l=(0,f.A)(),{id:d,isOpen:c,open:u,close:p,anchor:x}=(0,tn.f)("html-warning-popover"),{isOpen:_,open:g,close:A}=(0,tt.A)(!0),{isOpen:b}=(0,tt.A)(!0),[C,j]=(0,y.useState)(""),v=t&&t?.content&&"file_id"in t?.content?t.content.file_id:null,k=t?.type_id===Q.KL.LiveStream&&t.content&&"stream_session_id"in t.content?e8(t.content.stream_session_id)?.title??"":"",I=(0,y.useCallback)(async()=>{try{if(v&&t?.type_id===4){let e=(await ti.A.getFile({search_by:[{attribute:"file_id",operator:"==",value:v}]})).data.result[0];j((0,ta.kJ)(e?.title||"Video"))}else j("")}catch(e){console.error("Error fetching video details:",e)}},[v,t?.type_id]);return(0,y.useEffect)(()=>{I()},[I]),(0,m.jsx)(e9.A,{in:b,"data-form-path":s["data-form-path"],"data-element-type":s["data-element-type"],"data-ai-field":s["data-element-field"],children:(0,m.jsxs)(nE,{children:[r,(0,m.jsxs)(h.A,{gap:l.spacing(3),flex:1,children:[(0,m.jsxs)(nL,{children:[(0,m.jsxs)(eO.A,{variant:"h5",flex:1,display:"flex",gap:l.spacing(1),children:[o(`PAGE.LESSON_CONTENT.${(0,Q.YB)(Number(t.type_id
1))}`),Number(t.type_id)===Q.KL.Video?":":"",Number(t.type_id)===Q.KL.LiveStream&&k?":":"",(0,m.jsx)(eO.A,{variant:"h5",color:l.palette.primary["400"],sx:{wordBreak:"break-all"},children:Number(t.type_id)===Q.KL.Video?C:k})]}),(0,m.jsx)(e0.A,{color:"error",onClick:a,"data-form-path":`content_blocks.${n}.content.remove`,"data-element-type":"button","data-ai-field":`Click Delete/remove content block/field with index ${n} and type ${Q.k0[t.type_id]}`,children:(0,m.jsx)(eM.In,{fontSize:l.spacing(4.5),icon:"tabler:trash",color:"primary"})}),(0,m.jsx)(e0.A,{"data-form-path":`content_blocks.${n}.content.row_collapse`,"data-element-type":"button","data-ai-field":`Click collapse for content block with index ${n} and type type ${Q.k0[t.type_id]}`,onClick:()=>_?A():g(),children:(0,m.jsx)(eM.In,{fontSize:l.spacing(4.5),icon:"tabler:chevron-down",color:"primary",style:{transform:_?"rotate(-180deg)":"rotate(0deg)",transition:"transform 150ms ease-out"}})})]}),(0,m.jsxs)(e9.A,{in:_,children:[t.type_id===Q.KL.AI_chat&&(0,m.jsx)(ng,{control:i,index:n}),t.type_id===Q.KL.Widget&&(0,m.jsx)(nw,{control:i,index:n}),t.type_id===Q.KL.LiveStream&&(0,m.jsx)(nC,{control:i,index:n}),t.type_id===Q.KL.RichText&&(0,m.jsx)(nh.RichText,{control:i,index:n,"data-form-path":`${s["data-form-path"]}.content.payload`,"data-element-type":`Content block/field rich text with index ${n}`,"data-ai-field":`Content block/field rich text with index ${n}`}),t.type_id===Q.KL.Video&&(0,m.jsx)(nh.Video,{control:i,index:n}),t.type_id===Q.KL.Button&&(0,m.jsx)(nh.Button,{control:i,index:n}),t.type_id===Q.KL.Audio&&(0,m.jsx)(nh.Audio,{control:i,index:n}),t.type_id===Q.KL.HTML&&(0,m.jsxs)(h.A,{gap:l.spacing(3),children:[(0,m.jsx)(nh.HTML,{"data-form-path":`${s["data-form-path"]}.content.payload`,"data-element-type":`Content block/field HTML with index ${n}`,"data-ai-field":`Edit content block/field HTML with index ${n}`,control:i,index:n,additionalActionContent:(0,m.jsx)(m.Fragment,{children:e&&(0,m.jsx)(nS,{color:"warning",onClick:u,children:(0,m.jsx)(eM.In,{icon:"tabler:alert-triangle",color:l.palette.warning.main})})})}),(0,m.jsx)(te.Ay,{id:d,open:c,anchorEl:x,onClose:p,anchorOrigin:{vertical:"bottom",horizontal:"left"},children:(0,m.jsx)(h.A,{padding:l.spacing(4,4.5,4,4.5),maxWidth:346,children:(0,m.jsx)(eO.A,{variant:"body1",children:o("PAGE.COMMON.app_html_content_warning")})})})]}),t.type_id===Q.KL.PDF&&(0,m.jsx)(nh.PDF,{control:i,index:n}),t.type_id===Q.KL.Certificate&&(0,m.jsx)(nh.Certificate,{index:n})]})]})]})})});var nO=n(18664);let nR=(0,eV.Ay)(eT.A,{shouldForwardProp:e=>"highlighted"!==e})(({theme:e,highlighted:t})=>({alignItems:"center",border:"1px dashed",borderColor:t?e.palette.primary.main:e.palette.divider,borderRadius:"6px",cursor:"pointer",display:"flex",flex:1,gap:e.spacing(6),justifyContent:"center",padding:e.spacing(8),position:"relative",transition:"all 100ms ease-in-out",...t&&{backgroundColor:e.palette.primary.main+"14"},"&:hover":{borderColor:e.palette.primary.main}})),nM=(0,eV.Ay)(nO.A)(({theme:e})=>({position:"absolute",top:e.spacing(2),right:e.spacing(2),height:20,fontSize:10,fontWeight:700})),nq=({icon:e,title:t,subTitle:n,onClick:a,highlighted:i,badge:r,...s})=>{let o=(0,f.A)();return(0,m.jsxs)(nR,{onClick:a,highlighted:i,...s,"data-sentry-element":"ContentAdditionButtonSectionBox","data-sentry-component":"ContentAdditionButton","data-sentry-source-file":"ContentAdditionButton.tsx",children:[r&&(0,m.jsx)(nM,{label:r,size:"small",color:"primary"}),(0,m.jsxs)(h.A,{alignItems:"center",justifyContent:"center",gap:o.spacing(1),"data-sentry-element":"Stack","data-sentry-source-file":"ContentAdditionButton.tsx",children:[e,(0,m.jsx)(eO.A,{variant:"body1",textAlign:"center",fontWeight:500,color:i?"primary.main":"text.primary","data-sentry-element":"Typography","data-sentry-source-file":"ContentAdditionButton.tsx",children:t}),(0,m.jsx)(eO.A,{textAlign:"center",variant:"body2","data-sentry-element":"Typography","data-sentry-source-file":"ContentAdditionButton.tsx",children:n})]})]})},nz=()=>(0,m.jsxs)("svg",{width:"43",height:"42",viewBox:"0 0 43 42",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-sentry-element":"svg","data-sentry-component":"Text","data-sentry-source-file":"Text.tsx",children:[(0,m.jsxs)("g",{opacity:"0.2","data-sentry-element":"g","data-sentry-source-file":"Text.tsx",children:[(0,m.jsx)("path",{d:"M36.8345 9.1875H5.49854C4.72836 9.1875 4.104 9.81185 4.104 10.582V31.418C4.104 32.1881 4.72836 32.8125 5.49854 32.8125H36.8345C37.6047 32.8125 38.229 32.1881 38.229 31.418V10.582C38.229 9.81185 37.6047 9.1875 36.8345 9.1875Z",fill:"#415BF5","data-sentry-element":"path","data-sentry-source-file":"Text.tsx"}),(0,m.jsx)("path",{d:"M36.8345 9.1875H5.49854C4.72836 9.1875 4.104 9.81185 4.104 10.582V31.418C4.104 32.1881 4.72836 32.8125 5.49854 32.8125H36.8345C37.6047 32.8125 38.229 32.1881 38.229 31.418V10.582C38.229 9.81185 37.6047 9.1875 36.8345 9.1875Z",fill:"white",fillOpacity:"0.4","data-sentry-element":"path","data-sentry-source-file":"Text.tsx"})]}),(0,m.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.1542 10.5822C5.1542 10.3919 5.30845 10.2377 5.49873 10.2377H36.8347C37.0249 10.2377 37.1792 10.3919 37.1792 10.5822V31.4182C37.1792 31.6084 37.0249 31.7627 36.8347 31.7627H5.49873C5.30845 31.7627 5.1542 31.6084 5.1542 31.4182V10.5822ZM5.49873 8.1377C4.14865 8.1377 3.0542 9.23215 3.0542 10.5822V31.4182C3.0542 32.7682 4.14865 33.8627 5.49873 33.8627H36.8347C38.1847 33.8627 39.2792 32.7682 39.2792 31.4182V10.5822C39.2792 9.23215 38.1847 8.1377 36.8347 8.1377H5.49873ZM9.3542 14.7002C8.7743 14.7002 8.3042 15.1703 8.3042 15.7502C8.3042 16.3301 8.7743 16.8002 9.3542 16.8002H32.9792C33.5591 16.8002 34.0292 16.3301 34.0292 15.7502C34.0292 15.1703 33.5591 14.7002 32.9792 14.7002H9.3542ZM9.3542 19.9502C8.7743 19.9502 8.3042 20.4203 8.3042 21.0002C8.3042 21.5801 8.7743 22.0502 9.3542 22.0502H32.9792C33.5591 22.0502 34.0292 21.5801 34.0292 21.0002C34.0292 20.4203 33.5591 19.9502 32.9792 19.9502H9.3542ZM8.3042 26.2502C8.3042 25.6703 8.7743 25.2002 9.3542 25.2002H10.6667C11.2466 25.2002 11.7167 25.6703 11.7167 26.2502C11.7167 26.8301 11.2466 27.3002 10.6667 27.3002H9.3542C8.7743 27.3002 8.3042 26.8301 8.3042 26.2502ZM15.916
17 25.2002C15.3368 25.2002 14.8667 25.6703 14.8667 26.2502C14.8667 26.8301 15.3368 27.3002 15.9167 27.3002H26.4167C26.9966 27.3002 27.4667 26.8301 27.4667 26.2502C27.4667 25.6703 26.9966 25.2002 26.4167 25.2002H15.9167ZM30.6167 26.2502C30.6167 25.6703 31.0868 25.2002 31.6667 25.2002H32.9792C33.5591 25.2002 34.0292 25.6703 34.0292 26.2502C34.0292 26.8301 33.5591 27.3002 32.9792 27.3002H31.6667C31.0868 27.3002 30.6167 26.8301 30.6167 26.2502Z",fill:"#415BF5","data-sentry-element":"path","data-sentry-source-file":"Text.tsx"}),(0,m.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.1542 10.5822C5.1542 10.3919 5.30845 10.2377 5.49873 10.2377H36.8347C37.0249 10.2377 37.1792 10.3919 37.1792 10.5822V31.4182C37.1792 31.6084 37.0249 31.7627 36.8347 31.7627H5.49873C5.30845 31.7627 5.1542 31.6084 5.1542 31.4182V10.5822ZM5.49873 8.1377C4.14865 8.1377 3.0542 9.23215 3.0542 10.5822V31.4182C3.0542 32.7682 4.14865 33.8627 5.49873 33.8627H36.8347C38.1847 33.8627 39.2792 32.7682 39.2792 31.4182V10.5822C39.2792 9.23215 38.1847 8.1377 36.8347 8.1377H5.49873ZM9.3542 14.7002C8.7743 14.7002 8.3042 15.1703 8.3042 15.7502C8.3042 16.3301 8.7743 16.8002 9.3542 16.8002H32.9792C33.5591 16.8002 34.0292 16.3301 34.0292 15.7502C34.0292 15.1703 33.5591 14.7002 32.9792 14.7002H9.3542ZM9.3542 19.9502C8.7743 19.9502 8.3042 20.4203 8.3042 21.0002C8.3042 21.5801 8.7743 22.0502 9.3542 22.0502H32.9792C33.5591 22.0502 34.0292 21.5801 34.0292 21.0002C34.0292 20.4203 33.5591 19.9502 32.9792 19.9502H9.3542ZM8.3042 26.2502C8.3042 25.6703 8.7743 25.2002 9.3542 25.2002H10.6667C11.2466 25.2002 11.7167 25.6703 11.7167 26.2502C11.7167 26.8301 11.2466 27.3002 10.6667 27.3002H9.3542C8.7743 27.3002 8.3042 26.8301 8.3042 26.2502ZM15.9167 25.2002C15.3368 25.2002 14.8667 25.6703 14.8667 26.2502C14.8667 26.8301 15.3368 27.3002 15.9167 27.3002H26.4167C26.9966 27.3002 27.4667 26.8301 27.4667 26.2502C27.4667 25.6703 26.9966 25.2002 26.4167 25.2002H15.9167ZM30.6167 26.2502C30.6167 25.6703 31.0868 25.2002 31.6667 25.2002H32.9792C33.5591 25.2002 34.0292 25.6703 34.0292 26.2502C34.0292 26.8301 33.5591 27.3002 32.9792 27.3002H31.6667C31.0868 27.3002 30.6167 26.8301 30.6167 26.2502Z",fill:"white",fillOpacity:"0.4","data-sentry-element":"path","data-sentry-source-file":"Text.tsx"})]}),nF=()=>(0,m.jsxs)("svg",{width:"43",height:"42",viewBox:"0 0 43 42",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-sentry-element":"svg","data-sentry-component":"Camera","data-sentry-source-file":"Camera.tsx",children:[(0,m.jsxs)("g",{opacity:"0.2","data-sentry-element":"g","data-sentry-source-file":"Camera.tsx",children:[(0,m.jsx)("path",{d:"M37.168 9.1875H5.83203C5.06185 9.1875 4.4375 9.81185 4.4375 10.582V31.418C4.4375 32.1881 5.06185 32.8125 5.83203 32.8125H37.168C37.9381 32.8125 38.5625 32.1881 38.5625 31.418V10.582C38.5625 9.81185 37.9381 9.1875 37.168 9.1875Z",fill:"#415BF5","data-sentry-element":"path","data-sentry-source-file":"Camera.tsx"}),(0,m.jsx)("path",{d:"M37.168 9.1875H5.83203C5.06185 9.1875 4.4375 9.81185 4.4375 10.582V31.418C4.4375 32.1881 5.06185 32.8125 5.83203 32.8125H37.168C37.9381 32.8125 38.5625 32.1881 38.5625 31.418V10.582C38.5625 9.81185 37.9381 9.1875 37.168 9.1875Z",fill:"white",fillOpacity:"0.4","data-sentry-element":"path","data-sentry-source-file":"Camera.tsx"})]}),(0,m.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.8322 10.2376C5.64191 10.2376 5.48765 10.3919 5.48765 10.5822V31.4181C5.48765 31.6084 5.64191 31.7627 5.8322 31.7627H37.1681C37.3584 31.7627 37.5127 31.6084 37.5127 31.4181V10.5822C37.5127 10.3919 37.3584 10.2376 37.1681 10.2376H5.8322ZM3.3877 10.5822C3.3877 9.23214 4.48214 8.1377 5.8322 8.1377H37.1681C38.5182 8.1377 39.6126 9.23214 39.6126 10.5822V31.4181C39.6126 32.7682 38.5182 33.8626 37.1681 33.8626H5.8322C4.48214 33.8626 3.3877 32.7682 3.3877 31.4181V10.5822Z",fill:"#415BF5","data-sentry-element":"path","data-sentry-source-file":"Camera.tsx"}),(0,m.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.8322 10.2376C5.64191 10.2376 5.48765 10.3919 5.48765 10.5822V31.4181C5.48765 31.6084 5.64191 31.7627 5.8322 31.7627H37.1681C37.3584 31.7627 37.5127 31.6084 37.5127 31.4181V10.5822C37.5127 10.3919 37.3584 10.2376 37.1681 10.2376H5.8322ZM3.3877 10.5822C3.3877 9.23214 4.48214 8.1377 5.8322 8.1377H37.1681C38.5182 8.1377 39.6126 9.23214 39.6126 10.5822V31.4181C39.6126 32.7682 38.5182 33.8626 37.1681 33.8626H5.8322C4.48214 33.8626 3.3877 32.7682 3.387
17 31.4181V10.5822Z",fill:"white",fillOpacity:"0.4","data-sentry-element":"path","data-sentry-source-file":"Camera.tsx"}),(0,m.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M23.731 18.6372L27.914 16.5461C28.1987 16.4038 28.5368 16.4191 28.8076 16.5864C29.0784 16.7537 29.2433 17.0492 29.2435 17.3675V23.5819C29.2433 23.9002 29.0784 24.1957 28.8076 24.363C28.5368 24.5303 28.1987 24.5455 27.914 24.4033L23.731 22.3122V18.6372Z",stroke:"#415BF5",strokeWidth:"2.1",strokeLinecap:"round",strokeLinejoin:"round","data-sentry-element":"path","data-sentry-source-file":"Camera.tsx"}),(0,m.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M23.731 18.6372L27.914 16.5461C28.1987 16.4038 28.5368 16.4191 28.8076 16.5864C29.0784 16.7537 29.2433 17.0492 29.2435 17.3675V23.5819C29.2433 23.9002 29.0784 24.1957 28.8076 24.363C28.5368 24.5303 28.1987 24.5455 27.914 24.4033L23.731 22.3122V18.6372Z",stroke:"white",strokeOpacity:"0.4",strokeWidth:"2.1",strokeLinecap:"round",strokeLinejoin:"round","data-sentry-element":"path","data-sentry-source-file":"Camera.tsx"}),(0,m.jsx)("rect",{x:"12.7061",y:"14.9619",width:"11.025",height:"11.025",rx:"1.8375",stroke:"#415BF5",strokeWidth:"2.1",strokeLinecap:"round",strokeLinejoin:"round","data-sentry-element":"rect","data-sentry-source-file":"Camera.tsx"}),(0,m.jsx)("rect",{x:"12.7061",y:"14.9619",width:"11.025",height:"11.025",rx:"1.8375",stroke:"white",strokeOpacity:"0.4",strokeWidth:"2.1",strokeLinecap:"round",strokeLinejoin:"round","data-sentry-element":"rect","data-sentry-source-file":"Camera.tsx"})]}),nD=()=>(0,m.jsxs)("svg",{width:"43",height:"42",viewBox:"0 0 43 42",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-sentry-element":"svg","data-sentry-component":"Speaker","data-sentry-source-file":"Speaker.tsx",children:[(0,m.jsx)("path",{d:"M21.1665 36.75C29.865 36.75 36.9165 29.6985 36.9165 21C36.9165 12.3015 29.865 5.25 21.1665 5.25C12.468 5.25 5.4165 12.3015 5.4165 21C5.4165 29.6985 12.468 36.75 21.1665 36.75Z",fill:"#415BF5","data-sentry-element":"path","data-sentry-source-file":"Speaker.tsx"}),(0,m.jsx)("path",{d:"M21.1665 36.75C29.865 36.75 36.9165 29.6985 36.9165 21C36.9165 12.3015 29.865 5.25 21.1665 5.25C12.468 5.25 5.4165 12.3015 5.4165 21C5.4165 29.6985 12.468 36.75 21.1665 36.75Z",fill:"white",fillOpacity:"0.8","data-sentry-element":"path","data-sentry-source-file":"Speaker.tsx"}),(0,m.jsx)("path",{d:"M21.1665 36.75C29.865 36.75 36.9165 29.6985 36.9165 21C36.9165 12.3015 29.865 5.25 21.1665 5.25C12.468 5.25 5.4165 12.3015 5.4165 21C5.4165 29.6985 12.468 36.75 21.1665 36.75Z",stroke:"#415BF5",strokeWidth:"2.1",strokeLinecap:"round",strokeLinejoin:"round","data-sentry-element":"path","data-sentry-source-file":"Speaker.tsx"}),(0,m.jsx)("path",{d:"M21.1665 36.75C29.865 36.75 36.9165 29.6985 36.9165 21C36.9165 12.3015 29.865 5.25 21.1665 5.25C12.468 5.25 5.4165 12.3015 5.4165 21C5.4165 29.6985 12.468 36.75 21.1665 36.75Z",stroke:"white",strokeOpacity:"0.4",strokeWidth:"2.1",strokeLinecap:"round",strokeLinejoin:"round","data-sentry-element":"path","data-sentry-source-file":"Speaker.tsx"}),(0,m.jsx)("path",{d:"M24.0537 17.1494C25.2655 18.0583 25.9787 19.4846 25.9787 20.9994C25.9787 22.5142 25.2655 23.9406 24.0537 24.8494",stroke:"#415BF5",strokeWidth:"2.1",strokeLinecap:"round",strokeLinejoin:"round","data-sentry-element":"path","data-sentry-source-file":"Speaker.tsx"}),(0,m.jsx)("path",{d:"M24.0537 17.1494C25.2655 18.0583 25.9787 19.4846 25.9787 20.9994C25.9787 22.5142 25.2655 23.9406 24.0537 24.8494",stroke:"white",strokeOpacity:"0.4",strokeWidth:"2.1",strokeLinecap:"round",strokeLinejoin:"round","data-sentry-element":"path","data-sentry-source-file":"Speaker.tsx"}),(0,m.jsx)("path",{d:"M26.6523 14.2617C28.6874 15.9063 29.8701 18.3827 29.8701 20.9992C29.8701 23.6158 28.6874 26.0921 26.6523 27.7367",stroke:"#415BF5",strokeWidth:"2.1",strokeLinecap:"round",strokeLinejoin:"round","data-sentry-element":"path","data-sentry-source-file":"Speaker.tsx"}),(0,m.jsx)("path",{d:"M26.6523 14.2617C28.6874 15.9063 29.8701 18.3827 29.8701 20.9992C29.8701 23.6158 28.6874 26.0921 26.6523 27.7367",stroke:"white",strokeOpacity:"0.4",strokeWidth:"2.1",strokeLinecap:"round",strokeLinejoin:"round","data-sentry-element":"path","data-sentry-source-file":"Speaker.tsx"}),(0,m.jsx)("path",{d:"M15.3914 23.8872H13.4664C12.9348 23.8872 12.5039 23.4563 12.5039 22.9247V19.0747C12.5039 18.5431 12.9348 18.1122 13.4664 18.1122H15.3914L18.7602 13.7809C18.934 13.4433 19.328 13.2828 19.6882 13.4029C20.0485 13.523 20.2674 13.8878 20.2039 14.2622V27.7372C20.2674 28.1116 20.0485 28.4764 19.6882 28.5965C19.328 28.7166 18.934 28.5561 18.7602 28.2184L15.3914 23.8872",stroke:"#415BF5",strokeWidth:"2.1",strokeLinecap:"round",strokeLinejoin:"round","data-sentry-element":"path","data-sentry-source-file":"Speaker.tsx"}),(0,m.jsx)("path",{d:"M15.3914 23.8872H13.4664C12.9348 23.8872 12.5039 23.4563 12.5039 22.9247V19.0747C12.5039 18.5431 12.9348 18.1122 13.4664 18.1122H15.3914L18.7602 13.7809C18.934 13.4433 19.328 13.2828 19.6882 13.4029C20.0485 13.523 20.2674 13.8878 20.2039 14.2622V27.7372C20.2674 28.1116 20.0485 28.4764 19.6882 28.5965C19.328 28.7166 18.934 28.5561 18.7602 28.2184L15.3914 23.8872",stroke:"white",strokeOpacity:"0.4",strokeWidth:"2.1",strokeLinecap:"round",strokeLinejoin:"round","data-sentry-element":"path","data-sentry-source-file":"Speaker.tsx"})]}),n$=()=>(0,m.jsxs)("svg",{width:"43",height:"42",viewBox:"0 0 43 42",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-sentry-element":"svg","data-sentry-component":"Window","data-sentry-source-file":"Window.tsx",children:[(0,m.jsxs)("g",{opacity:"0.2","data-sentry-element":"g","data-sentry-source-file":"Window.tsx",children:[(0,m.jsx)("path",{d:"M4.4375 15.8975H38.5625V31.4998C38.5625 31.8479 38.4242 32.1817 38.1781 32.4279C37.9319 32.674 37.5981 32.8123 37.25 32.8123H5.75C5.4019 32.8123 5.06806 32.674 4.82192 32.4279C4.57578 32.1817 4.4375 31.8479 4.4375 31.4998V15.8975Z",fill:"#415BF5","data-sentry-element":"path","data-sentry-source-file":"Window.tsx"}),(0,m.jsx)("path",{d:"M4.4375 15.8975H38.5625V31.4998C38.5625 31.8479 38.4242 32.1817 38.1781 32.4279C37.9319 32.674 37.5981 32.8123 37.25 32.8123H5.75C5.4019 32.8123 5.06806 32.674 4.82192 32.4279C4.57578 32.1817 4.4375 31.8479 4.4375 31.4998V15.8975Z",fill:"white",fillOpacity:"0.4","data-sentry-element":"path","data-sentry-source-file":"Window.tsx"})]}),(0,m.jsx)("path",{d:"M28.0625 27.5625H33.3125M20.1875 27.5625H22.8125M4.4375 15.8977H38.5625M5.75 9.1875H37.25C37.9749 9.1875 38.5625 9.77513 38.5625 10.5V31.5C38.5625 32.2249 37.9749 32.8125 37.25 32.8125H5.75C5.02513 32.8125 4.4375 32.2249 4.4375 31.5V10.5C4.4375 9.77513 5.02513 9.1875 5.75 9.1875Z",stroke:"#415BF5",strokeWidth:"2.1",strokeLinecap:"round",strokeLinejoin:"round","data-sentry-element":"path","data-sentry-source-file":"Window.tsx"}),(0,m.jsx)("path",{d:"M28.0625 27.5625H33.3125M20.1875 27.5625H22.8125M4.4375 15.8977H38.5625M5.75 9.1875H37.25C37.9749 9.1875 38.5625 9.77513 38.5625 10.5V31.5C38.5625 32.2249 37.9749 32.8125 37.25 32.8125H5.75C5.02513 32.8125 4.4375 32.2249 4.4375 31.5V10.5C4.4375 9.77513 5.02513 9.1875 5.75 9.1875Z",stroke:"white",strokeOpacity:"0.4",strokeWidth:"2.1",strokeLinecap:"round",strokeLinejoin:"round","data-sentry-element":"path","data-sentry-source-file":"Window.tsx"}),(0,m.jsx)("circle",{cx:"8.3748",cy:"12.6004",r:"1.575",fill:"#415BF5","data-sentry-element":"circle","data-sentry-source-file":"Window.tsx"}),(0,m.jsx)("circle",{cx:"8.3748",cy:"12.6004",r:"1.575",fill:"white",fillOpacity:"0.4","data-sentry-element":"circle","data-sentry-source-file":"Window.tsx"}),(0,m.jsx)("circle",{cx:"12.575",cy:"12.6004",r:"1.575",fill:"#415BF5","data-sentry-element":"circle","data-sentry-source-file":"Window.tsx"}),(0,m.jsx)("circle",{cx:"12.575",cy:"12.6004",r:"1.575",fill:"white",fillOpacity:"0.4","data-sentry-element":"circle","data-sentry-source-file":"Window.tsx"}),(0,m.jsx)("circle",{cx:"16.7752",cy:"12.6004",r:"1.575",fill:"#415BF5","data-sentry-element":"circle","data-sentry-source-file":"Window.tsx"}),(0,m.jsx)("circle",{cx:"16.7752",cy:"12.6004",r:"1.575",fill:"white",fillOpacity:"0.4","data-sentry-element":"circle","data-sentry-source-file":"Window.tsx"})]}),nB=()=>(0,m.jsxs)("svg",{width:"43",height:"42",viewBox:"0 0 43 42",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-sentry-element":"svg","data-sentry-component":"FilePlus","data-sentry-source-file":"FilePlus.tsx",children:[(0,m.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M29.7081 35.1752H13.9581C12.2184 35.1752 10.8081 33.7649 10.8081 32.0252V9.97519C10.8081 8.2355 12.2184 6.8252 13.9581 6.8252H24.9831L32.8581 14.7002V32.0252C32.8581 33.7649 31.4478 35.1752 29.7081 35.1752Z",fill:"#415BF5","data-sentry-element":"path","data-sentry-source-file":"FilePlus.tsx"}),(0,m.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M29.7081 35.1752H13.9581C12.2184 35.1752 10.8081 33.7649 10.8081 32.0252V9.97519C10.8081 8.2355 12.2184 6.8252 13.9581 6.8252H24.9831L32.8581 14.7002V32.0252C32.8581 33.7649 31.4478 35.1752 29.7081 35.1752Z",fill:"white",fillOpacity:"0.8","data-sentry-element":"path","data-sentry-source-file":"FilePlus.tsx"}),(0,m.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M29.7081 35.1752H13.9581C12.2184 35.1752 10.8081 33.7649 10.8081 32.0252V9.97519C10.8081 8.2355 12.2184 6.8252 13.9581 6.8252H24.9831L32.8581 14.7002V32.0252C32.8581 33.7649 31.4478 35.1752 29.7081 35.1752Z",stroke:"#415BF5",strokeWidth:"2.1",strokeLinecap:"round",strokeLinejoin:"round","data-sentry-element":"path","data-sentry-source-file":"FilePlus.tsx"}),(0,m.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M29.7081 35.1752H13.9581C12.2184 35.1752 10.8081 33.7649 10.8081 32.0252V9.97519C10.8081 8.2355 12.2184 6.8252 13.9581 6.8252H24.9831L32.8581 14.7002V32.0252C32.8581 33.7649 31.4478 35.1752 29.7081 35.1752Z",stroke:"white",strokeOpacity:"0.4",strokeWidth:"2.1",strokeLinecap:"round",strokeLinejoin:"round","data-sentry-element":"path","data-sentry-source-file":"FilePlus.tsx"}),(0,m.jsx)("path",{d:"M21.8334 19.4248V28.8748",stroke:"#415BF5",strokeWidth:"2.1",strokeLinecap:"round",strokeLinejoin:"round","data-sentry-element":"path","data-sentry-source-file":"FilePlus.tsx"}),(0,m.jsx)("path",{d:"M21.8334 19.4248V28.8748",stroke:"white",strokeOpacity:"0.4",strokeWidth:"2.1",strokeLinecap:"round",strokeLinejoin:"round","data-sentry-element":"path","data-sentry-source-file":"FilePlus.tsx"}),(0,m.jsx)("path",{d:"M17.1084 24.1498H26.5584",stroke:"#415BF5",strokeWidth:"2.1",strokeLinecap:"round",strokeLinejoin:"round","data-sentry-element":"path","data-sentry-source-file":"FilePlus.tsx"}),(0,m.jsx)("path",{d:"M17.1084 24.1498H26.5584",stroke:"white",strokeOpacity:"0.4",strokeWidth:"2.1",strokeLinecap:"round",strokeLinejoin:"round","data-sentry-element":"path","data-sentry-source-file":"FilePlus.tsx"}),(0,m.jsx)("path",{d:"M24.9834 6.8252V13.1252C24.9834 13.995 25.6885 14.7002 26.5584 14.7002H32.8584",stroke:"#415BF5",strokeWidth:"2.1",strokeLinecap:"round",strokeLinejoin:"round","data-sentry-element":"path","data-sentry-source-file":"FilePlus.tsx"}),(0,m.jsx)("path",{d:"M24.9834 6.8252V13.1252C24.9834 13.995 25.6885 14.7002 26.5584 14.7002H32.8584",stroke:"white",strokeOpacity:"0.4",strokeWidth:"2.1",strokeLinecap:"round",strokeLinejoin:"round","data-sentry-element":"path","data-sentry-source-file":"FilePlus.tsx"})]}),nP=()=>(0,m.jsxs)("svg",{width:"43",height:"42",viewBox:"0 0 43 42",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-sentry-element":"svg","data-sentry-component":"StarInBox","data-sentry-source-file":"StarInBox.tsx",children:[(0,m.jsxs)("g",{opacity:"0.2","data-sentry-element":"g","data-sentry-source-file":"StarInBox.tsx",children:[(0,m.jsx)("path",{d:"M37.3815 11.5498H5.56345C4.78142 11.5498 4.14746 12.0493 4.14746 12.6654V29.3342C4.14746 29.9503 4.78142 30.4498 5.56345 30.4498H37.3815C38.1635 30.4498 38.7975 29.9503 38.7975 29.3342V12.6654C38.7975 12.0493 38.1635 11.5498 37.3815 11.5498Z",fill:"#415BF5","data-sentry-element":"path","data-sentry-source-file":"StarInBox.tsx"}),(0,m.jsx)("path",{d:"M37.3815 11.5498H5.56345C4.78142 11.5498 4.14746 12.0493 4.14746 12.6654V29.3342C4.14746 29.9503 4.78142 30.4498 5.56345 30.4498H37.3815C38.1635 30.4498 38.7975 29.9503 38.7975 29.3342V12.6654C38.7975 12.0493 38.1635 11.5498 37.3815 11.5498Z",fill:"white",fillOpacity:"0.4","data-sentry-element":"path","data-sentry-source-file":"StarInBox.tsx"})]}),(0,m.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.01069 12.7287C5.01065 12.7287 5.01104 12.7281 5.01197 12.7271C5.0112 12.7281 5.01073 12.7287 5.01069 12.7287ZM5.03384 12.7075C5.0352 12.7064 5.03663 12.7053 5.03813 12.7042C5.09806 12.6586 5.22719 12.6 5.41323 12.6H37.5326C37.7186 12.6 37.8477 12.6586 37.9077 12.7042C37.9092 12.7053 37.9106 12.7064 37.912 12.7075V28.8098C37.9106 28.8109 37.9092 28.812 37.9077 28.8131C37.8477 28.8587 37.7186 28.9173 37.5326 28.9173H5.41323C5.22719 28.9173 5.09806 28.8587 5.03813 28.8131C5.03663 28.812 5.0352 28.8109 5.03384 28.8098V12.7075ZM5.01069 28.7886C5.01073 28.7886 5.01122 28.7892 5.01203 28.7903C5.01105 28.7892 5.01065 28.7886 5.01069 28.7886ZM37.9351 28.7886C37.9352 28.7886 37.9348 28.7891 37.9338 28.7902C37.9346 28.7892 37.9351 28.7886 37.9351 28.7886ZM37.9351 12.7287C37.9351 12.7287 37.9346 12.7281 37.9337 12.7269C37.9347 12.7281 37.9352 12.7287 37.9351 12.7287ZM3.76687 11.0327C4.22427 10.6848 4.80984 10.5 5.41323 10.5H37.5326C38.136 10.5 38.7215 10.6848 39.1789 11.0327C39.6371 11.3812 40.012 11.9386 40.012 12.6371V28.8802C40.012 29.5787 39.6371 30.1361 39.1789 30.4846C38.7215 30.8325 38.136 31.0173 37.5326 31.0173H5.41323C4.80984 31.01
173 4.22427 30.8325 3.76687 30.4846C3.30866 30.1361 2.93384 29.5787 2.93384 28.8802V12.6371C2.93384 11.9386 3.30866 11.3812 3.76687 11.0327Z",fill:"#415BF5","data-sentry-element":"path","data-sentry-source-file":"StarInBox.tsx"}),(0,m.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.01069 12.7287C5.01065 12.7287 5.01104 12.7281 5.01197 12.7271C5.0112 12.7281 5.01073 12.7287 5.01069 12.7287ZM5.03384 12.7075C5.0352 12.7064 5.03663 12.7053 5.03813 12.7042C5.09806 12.6586 5.22719 12.6 5.41323 12.6H37.5326C37.7186 12.6 37.8477 12.6586 37.9077 12.7042C37.9092 12.7053 37.9106 12.7064 37.912 12.7075V28.8098C37.9106 28.8109 37.9092 28.812 37.9077 28.8131C37.8477 28.8587 37.7186 28.9173 37.5326 28.9173H5.41323C5.22719 28.9173 5.09806 28.8587 5.03813 28.8131C5.03663 28.812 5.0352 28.8109 5.03384 28.8098V12.7075ZM5.01069 28.7886C5.01073 28.7886 5.01122 28.7892 5.01203 28.7903C5.01105 28.7892 5.01065 28.7886 5.01069 28.7886ZM37.9351 28.7886C37.9352 28.7886 37.9348 28.7891 37.9338 28.7902C37.9346 28.7892 37.9351 28.7886 37.9351 28.7886ZM37.9351 12.7287C37.9351 12.7287 37.9346 12.7281 37.9337 12.7269C37.9347 12.7281 37.9352 12.7287 37.9351 12.7287ZM3.76687 11.0327C4.22427 10.6848 4.80984 10.5 5.41323 10.5H37.5326C38.136 10.5 38.7215 10.6848 39.1789 11.0327C39.6371 11.3812 40.012 11.9386 40.012 12.6371V28.8802C40.012 29.5787 39.6371 30.1361 39.1789 30.4846C38.7215 30.8325 38.136 31.0173 37.5326 31.0173H5.41323C4.80984 31.0173 4.22427 30.8325 3.76687 30.4846C3.30866 30.1361 2.93384 29.5787 2.93384 28.8802V12.6371C2.93384 11.9386 3.30866 11.3812 3.76687 11.0327Z",fill:"white",fillOpacity:"0.4","data-sentry-element":"path","data-sentry-source-file":"StarInBox.tsx"}),(0,m.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.34766 20.4748C8.34766 19.8949 8.81776 19.4248 9.39766 19.4248H19.8977C20.4776 19.4248 20.9477 19.8949 20.9477 20.4748C20.9477 21.0547 20.4776 21.5248 19.8977 21.5248H9.39766C8.81776 21.5248 8.34766 21.0547 8.34766 20.4748Z",fill:"#415BF5","data-sentry-element":"path","data-sentry-source-file":"StarInBox.tsx"}),(0,m.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.34766 20.4748C8.34766 19.8949 8.81776 19.4248 9.39766 19.4248H19.8977C20.4776 19.4248 20.9477 19.8949 20.9477 20.4748C20.9477 21.0547 20.4776 21.5248 19.8977 21.5248H9.39766C8.81776 21.5248 8.34766 21.0547 8.34766 20.4748Z",fill:"white",fillOpacity:"0.4","data-sentry-element":"path","data-sentry-source-file":"StarInBox.tsx"}),(0,m.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M29.3478 22.9903L26.6475 24.41L27.1633 21.4031L24.9758 19.2738L27.9946 18.8363L29.3447 16.1006L30.6948 18.8363L33.7136 19.2738L31.5261 21.4031L32.0419 24.41L29.3478 22.9903Z",stroke:"#415BF5",strokeWidth:"1.575",strokeLinecap:"round",strokeLinejoin:"round","data-sentry-element":"path","data-sentry-source-file":"StarInBox.tsx"}),(0,m.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M29.3478 22.9903L26.6475 24.41L27.1633 21.4031L24.9758 19.2738L27.9946 18.8363L29.3447 16.1006L30.6948 18.8363L33.7136 19.2738L31.5261 21.4031L32.0419 24.41L29.3478 22.9903Z",stroke:"white",strokeOpacity:"0.4",strokeWidth:"1.575",strokeLinecap:"round",strokeLinejoin:"round","data-sentry-element":"path","data-sentry-source-file":"StarInBox.tsx"})]}),nQ=()=>(0,m.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"42",height:"42",viewBox:"0 0 42 42",fill:"none","data-sentry-element":"svg","data-sentry-component":"AIChat","data-sentry-source-file":"AIChat.tsx",children:[(0,m.jsx)("path",{d:"M35.7585 17.9152C36.1448 16.7707 36.2788 15.558 36.1517 14.3583C36.0245 13.1585 35.639 11.9994 35.0211 10.9585C34.1049 9.38413 32.7054 8.13765 31.0246 7.39896C29.3439 6.66026 27.4687 6.46755 25.6698 6.84863C24.8585 5.94634 23.8612 5.22544 22.7447 4.7342C21.6282 4.24296 20.4182 3.9927 19.1958 4.00016C17.3567 3.9958 15.5636 4.56778 14.0751 5.63365C12.5866 6.69951 11.4796 8.20421 10.9136 9.93085C9.71527 10.1728 8.58317 10.6645 7.59309 11.3732C6.60301 12.0819 5.7778 12.9911 5.17271 14.0399C4.24947 15.61 3.85544 17.4288 4.04743 19.2342C4.23941 21.0395 5.0075 22.738 6.24094 24.0848C5.85463 25.2294 5.72057 26.4423 5.84775 27.6422C5.97493 28.8421 6.3604 30.0013 6.97836 31.0423C7.89469 32.6166 9.29416 33.863 10.9749 34.6017C12.6556 35.3404 14.5307 35.5332 16.3297 35.1522C17.1412 36.0544 18.1386 36.7752 19.2553 37.2663C20.3719 37.7574 21.582 38.0075 22.8045 37.9998C24.6446 38.0046 26.4386 37.4325 27.9276 36.3659C29.4167 35.2993 30.5239 33.7935 31.0893 32.0657C32.2875 31.8237 33.4194 31.3319 34.4093 30.6232C35.3992 29.9146 36.2243 29.0054 36.8293 27.9567C37.7515 26.3867 38.1448 24.5684 37.9523 22.7638C37.7599 20.9591 36.9917 19.2614 35.7585 17.9152ZM22.8071 35.7795C21.2963 35.7817 19.8329 35.2597 18.6729 34.3
1047C18.7254 34.2767 18.8176 34.2274 18.877 34.1908L25.7378 30.2807C25.9103 30.184 26.0535 30.0438 26.1527 29.8743C26.2519 29.7049 26.3034 29.5124 26.3021 29.3167V19.7717L29.2018 21.4242C29.2171 21.4316 29.2303 21.4426 29.2402 21.4562C29.2501 21.4699 29.2565 21.4857 29.2587 21.5024V29.4068C29.2566 31.0953 28.5763 32.714 27.3668 33.9084C26.1574 35.1028 24.5174 35.7753 22.8062 35.7787L22.8071 35.7795ZM8.93218 29.9313C8.17565 28.6413 7.90303 27.1299 8.16203 25.6616C8.21371 25.6922 8.30159 25.7457 8.3662 25.7814L15.227 29.6916C15.398 29.7901 15.5924 29.842 15.7904 29.842C15.9884 29.842 16.1828 29.7901 16.3538 29.6916L24.7308 24.9195V28.2244C24.7317 28.2413 24.7285 28.2581 24.7213 28.2733C24.714 28.2886 24.7031 28.3019 24.6894 28.312L17.7537 32.2638C16.27 33.107 14.5079 33.3349 12.8541 32.8976C11.2002 32.4604 9.78978 31.3935 8.93218 29.9313ZM7.12739 15.1526C7.881 13.8607 9.07128 12.8715 10.4897 12.3585C10.4897 12.4164 10.4863 12.5201 10.4863 12.5915V20.4126C10.4852 20.6079 10.5368 20.8 10.6358 20.9691C10.7348 21.1382 10.8777 21.2783 11.0497 21.3749L19.4258 26.147L16.5261 27.7994C16.5117 27.8088 16.4952 27.8145 16.4781 27.816C16.4609 27.8174 16.4437 27.8147 16.4279 27.8079L9.49042 23.8536C8.00935 23.0072 6.92886 21.6159 6.48589 19.9847C6.04292 18.3534 6.27361 16.6163 7.12739 15.1526ZM30.9541 20.6243L22.5771 15.8513L25.4777 14.1997C25.492 14.1906 25.5083 14.185 25.5253 14.1835C25.5422 14.182 25.5593 14.1847 25.575 14.1912L32.5116 18.1422C33.5743 18.7479 34.44 19.6398 35.0076 20.7135C35.5752 21.7871 35.821 22.9981 35.7163 24.2046C35.6117 25.4111 35.1608 26.5633 34.4166 27.5261C33.6724 28.489 32.6655 29.2227 31.514 29.6414V21.5865C31.5156 21.3915 31.4645 21.1997 31.3661 21.0306C31.2677 20.8615 31.1255 20.7212 30.9541 20.6243ZM33.84 16.3376C33.773 16.2964 33.7052 16.2564 33.6367 16.2177L26.775 12.3075C26.604 12.2091 26.4096 12.1573 26.2116 12.1573C26.0137 12.1573 25.8192 12.2091 25.6482 12.3075L17.2721 17.0796V13.7747C17.2711 13.7579 17.2744 13.7411 17.2816 13.7258C17.2888 13.7105 17.2998 13.6972 17.3135 13.6872L24.2483 9.73874C25.311 9.13388 26.5262 8.84015 27.7519 8.89193C28.9775 8.94371 30.1629 9.33886 31.1692 10.0311C32.1756 10.7234 32.9613 11.6842 33.4344 12.801C33.9075 13.9179 34.0477 15.1445 33.84 16.3376ZM15.6948 22.2274L12.7942 20.575C12.7791 20.5675 12.7661 20.5564 12.7563 20.5428C12.74
165 20.5291 12.7403 20.5133 12.7382 20.4968V12.5923C12.7392 11.3818 13.0896 10.1967 13.7483 9.17557C14.4071 8.15443 15.3469 7.33954 16.4579 6.82624C17.5689 6.31294 18.8051 6.12248 20.0218 6.27713C21.2385 6.43178 22.3854 6.92515 23.3283 7.69951C23.2598 7.73617 23.192 7.77414 23.125 7.81342L16.2633 11.7236C16.0913 11.8202 15.9484 11.9602 15.8494 12.1293C15.7504 12.2984 15.6988 12.4905 15.6999 12.6858L15.6948 22.2274ZM17.2704 18.8758L21.0006 16.7498L24.7325 18.8749V23.1251L21.0014 25.2502L17.2704 23.1251V18.8758Z",fill:"#415BF5","data-sentry-element":"path","data-sentry-source-file":"AIChat.tsx"}),(0,m.jsx)("path",{d:"M35.7585 17.9152C36.1448 16.7707 36.2788 15.558 36.1517 14.3583C36.0245 13.1585 35.639 11.9994 35.0211 10.9585C34.1049 9.38413 32.7054 8.13765 31.0246 7.39896C29.3439 6.66026 27.4687 6.46755 25.6698 6.84863C24.8585 5.94634 23.8612 5.22544 22.7447 4.7342C21.6282 4.24296 20.4182 3.9927 19.1958 4.00016C17.3567 3.9958 15.5636 4.56778 14.0751 5.63365C12.5866 6.69951 11.4796 8.20421 10.9136 9.93085C9.71527 10.1728 8.58317 10.6645 7.59309 11.3732C6.60301 12.0819 5.7778 12.9911 5.17271 14.0399C4.24947 15.61 3.85544 17.4288 4.04743 19.2342C4.23941 21.0395 5.0075 22.738 6.24094 24.0848C5.85463 25.2294 5.72057 26.4423 5.84775 27.6422C5.97493 28.8421 6.3604 30.0013 6.97836 31.0423C7.89469 32.6166 9.29416 33.863 10.9749 34.6017C12.6556 35.3404 14.5307 35.5332 16.3297 35.1522C17.1412 36.0544 18.1386 36.7752 19.2553 37.2663C20.3719 37.7574 21.582 38.0075 22.8045 37.9998C24.6446 38.0046 26.4386 37.4325 27.9276 36.3659C29.4167 35.2993 30.5239 33.7935 31.0893 32.0657C32.2875 31.8237 33.4194 31.3319 34.4093 30.6232C35.3992 29.9146 36.2243 29.0054 36.8293 27.9567C37.7515 26.3867 38.1448 24.5684 37.9523 22.7638C37.7599 20.9591 36.9917 19.2614 35.7585 17.9152ZM22.8071 35.7795C21.2963 35.7817 19.8329 35.2597 18.6729 34.3047C18.7254 34.2767 18.8176 34.2274 18.877 34.1908L25.7378 30.2807C25.9103 30.184 26.0535 30.0438 26.1527 29.8743C26.2519 29.7049 26.3034 29.5124 26.3021 29.3167V19.7717L29.2018 21.4242C29.2171 21.4316 29.2303 21.4426 29.2402 21.4562C29.2501 21.4699 29.2565 21.4857 29.2587 21.5024V29.4068C29.2566 31.0953 28.5763 32.714 27.3668 33.9084C26.1574 35.1028 24.5174 35.7753 22.8062 35.7787L22.8071 35.7795ZM8.93218 29.9313C8.17565 28.6413 7.90303 27.1299 8.16203 25.6616C8.21371 25.6922 8.30159 25.7457 8.3662 25.7814L15.227 29.6916C15.398 29.7901 15.5924 29.842 15.7904 29.842C15.9884 29.842 16.1828 29.7901 16.3538 29.6916L24.7308 24.9195V28.2244C24.7317 28.2413 24.7285 28.2581 24.7213 28.2733C24.714 28.2886 24.7031 28.3019 24.6894 28.312L17.7537 32.2638C16.27 33.107 14.5079 33.3349 12.8541 32.8976C11.2002 32.4604 9.78978 31.3935 8.93218 29.9313ZM7.12739 15.1526C7.881 13.8607 9.07128 12.8715 10.4897 12.3585C10.4897 12.4164 10.4863 12.5201 10.4863 12.5915V20.4126C10.4852 20.6079 10.5368 20.8 10.6358 20.9691C10.7348 21.1382 10.8777 21.2783 11.0497 21.3749L19.4258 26.147L16.5261 27.7994C16.5117 27.8088 16.4952 27.8145 16.4781 27.816C16.4609 27.8174 16.4437 27.8147 16.4279 27.8079L9.49042 23.8536C8.00935 23.0072 6.92886 21.6159 6.48589 19.9847C6.04292 18.3534 6.27361 16.6163 7.12739 15.1526ZM30.9541 20.6243L22.5771 15.8513L25.4777 14.1997C25.492 14.1906 25.5083 14.185 25.5253 14.1835C25.5422 14.182 25.5593 14.1847 25.575 14.1912L32.5116 18.1422C33.5743 18.7479 34.44 19.6398 35.0076 20.7135C35.5752 21.7871 35.821 22.9981 35.7163 24.2046C35.6117 25.4111 35.1608 26.5633 34.4166 27.5261C33.6724 28.489 32.6655 29.2227 31.514 29.6414V21.5865C31.5156 21.3915 31.4645 21.1997 31.3661 21.0306C31.2677 20.8615 31.1255 20.7212 30.9541 20.6243ZM33.84 16.3376C33.773 16.2964 33.7052 16.2564 33.6367 16.2177L26.775 12.3075C26.604 12.2091 26.4096 12.1573 26.2116 12.1573C26.0137 12.1573 25.8192 12.2091 25.6482 12.3075L17.2721 17.0796V13.7747C17.2711 13.7579 17.2744 13.7411 17.2816 13.7258C17.2888 13.7105 17.2998 13.6972 17.3135 13.6872L24.2483 9.73874C25.311 9.13388 26.5262 8.84015 27.7519 8.89193C28.9775 8.94371 30.1629 9.33886 31.1692 10.0311C32.1756 10.7234 32.9613 11.6842 33.4344 12.801C33.9075 13.9179 34.0477 15.1445 33.84 16.3376ZM15.6948 22.2274L12.7942 20.575C12.7791 20.5675 12.7661 20.5564 12.7563 20.5428C12.74
165 20.5291 12.7403 20.5133 12.7382 20.4968V12.5923C12.7392 11.3818 13.0896 10.1967 13.7483 9.17557C14.4071 8.15443 15.3469 7.33954 16.4579 6.82624C17.5689 6.31294 18.8051 6.12248 20.0218 6.27713C21.2385 6.43178 22.3854 6.92515 23.3283 7.69951C23.2598 7.73617 23.192 7.77414 23.125 7.81342L16.2633 11.7236C16.0913 11.8202 15.9484 11.9602 15.8494 12.1293C15.7504 12.2984 15.6988 12.4905 15.6999 12.6858L15.6948 22.2274ZM17.2704 18.8758L21.0006 16.7498L24.7325 18.8749V23.1251L21.0014 25.2502L17.2704 23.1251V18.8758Z",fill:"white","fill-opacity":"0.4","data-sentry-element":"path","data-sentry-source-file":"AIChat.tsx"})]}),nV=()=>(0,m.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"42",height:"42",viewBox:"0 0 42 42",fill:"none","data-sentry-element":"svg","data-sentry-component":"WidgetIcon","data-sentry-source-file":"WidgetIcon.tsx",children:[(0,m.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M28.875 17.5V14c0-1.45-1.175-2.625-2.625-2.625h-3.5c0-2.415-1.96-4.375-4.375-4.375S14 8.96 14 11.375H10.5c-1.45 0-2.625 1.175-2.625 2.625v3.5c2.415 0 4.375 1.96 4.375 4.375S10.29 26.25 7.875 26.25V29.75c0 1.45 1.175 2.625 2.625 2.625h3.5c0-2.415 1.96-4.375 4.375-4.375s4.375 1.96 4.375 4.375h3.5c1.45 0 2.625-1.175 2.625-2.625v-3.5c-2.415 0-4.375-1.96-4.375-4.375s1.96-4.375 4.375-4.375z",fill:"#415BF5","data-sentry-element":"path","data-sentry-source-file":"WidgetIcon.tsx"}),(0,m.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M28.875 17.5V14c0-1.45-1.175-2.625-2.625-2.625h-3.5c0-2.415-1.96-4.375-4.375-4.375S14 8.96 14 11.375H10.5c-1.45 0-2.625 1.175-2.625 2.625v3.5c2.415 0 4.375 1.96 4.375 4.375S10.29 26.25 7.875 26.25V29.75c0 1.45 1.175 2.625 2.625 2.625h3.5c0-2.415 1.96-4.375 4.375-4.375s4.375 1.96 4.375 4.375h3.5c1.45 0 2.625-1.175 2.625-2.625v-3.5c-2.415 0-4.375-1.96-4.375-4.375s1.96-4.375 4.375-4.375z",fill:"white",fillOpacity:"0.8","data-sentry-element":"path","data-sentry-source-file":"WidgetIcon.tsx"}),(0,m.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M28.875 17.5V14c0-1.45-1.175-2.625-2.625-2.625h-3.5c0-2.415-1.96-4.375-4.375-4.375S14 8.96 14 11.375H10.5c-1.45 0-2.625 1.175-2.625 2.625v3.5c2.415 0 4.375 1.96 4.375 4.375S10.29 26.25 7.875 26.25V29.75c0 1.45 1.175 2.625 2.625 2.625h3.5c0-2.415 1.96-4.375 4.375-4.375s4.375 1.96 4.375 4.375h3.5c1.45 0 2.625-1.175 2.625-2.625v-3.5c-2.415 0-4.375-1.96-4.375-4.375s1.96-4.375 4.375-4.375z",stroke:"#415BF5",strokeWidth:"2.1",strokeLinecap:"round",strokeLinejoin:"round","data-sentry-element":"path","data-sentry-source-file":"WidgetIcon.tsx"}),(0,m.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M28.875 17.5V14c0-1.45-1.175-2.625-2.625-2.625h-3.5c0-2.415-1.96-4.375-4.375-4.375S14 8.96 14 11.375H10.5c-1.45 0-2.625 1.175-2.625 2.625v3.5c2.415 0 4.375 1.96 4.375 4.375S10.29 26.25 7.875 26.25V29.75c0 1.45 1.175 2.625 2.625 2.625h3.5c0-2.415 1.96-4.375 4.375-4.375s4.375 1.96 4.375 4.375h3.5c1.45 0 2.625-1.175 2.625-2.625v-3.5c-2.415 0-4.375-1.96-4.375-4.375s1.96-4.375 4.375-4.375z",stroke:"white",strokeOpacity:"0.4",strokeWidth:"2.1",strokeLinecap:"round",strokeLinejoin:"round","data-sentry-element":"path","data-sentry-source-file":"WidgetIcon.tsx"})]}),nH=()=>(0,m.jsxs)("svg",{width:"43",height:"42",viewBox:"0 0 43 42",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-sentry-element":"svg","data-sentry-component":"LiveStream","data-sentry-source-file":"LiveStream.tsx",children:[(0,m.jsx)("circle",{cx:"21.5",cy:"21",r:"8",stroke:"#415BF5",strokeWidth:"2.1","data-sentry-element":"circle","data-sentry-source-file":"LiveStream.tsx"}),(0,m.jsx)("circle",{cx:"21.5",cy:"21",r:"8",stroke:"white",strokeOpacity:"0.4",strokeWidth:"2.1","data-sentry-element":"circle","data-sentry-source-file":"LiveStream.tsx"}),(0,m.jsx)("path",{d:"M21.5 6V10.5M21.5 31.5V36M36 21H31.5M10.5 21H6M31.07 10.93L27.9 14.1M15.1 26.9L11.93 30.07M31.07 31.07L27.9 27.9M15.1 15.1L11.93 11.93",stroke:"#415BF5",strokeWidth:"2.1",strokeLinecap:"round","data-sentry-element":"path","data-sentry-source-file":"LiveStream.tsx"}),(0,m.jsx)("path",{d:"M21.5 6V10.5M21.5 31.5V36M36 21H31.5M10.5 21H6M31.07 10.93L27.9 14.1M15.1 26.9L11.93 30.07M31.07 31.07L27.9 27.9M15.1 15.1L11.93 11.93",stroke:"white",strokeOpacity:"0.4",strokeWidth:"2.1",strokeLinecap:"round","data-sentry-element":"path","data-sentry-source-file":"LiveStream.tsx"})]}),nW=(0,eV.Ay)(eT.A)(({theme:e})=>({display:"flex",flexDirection:"column",gap:e.spacing(8)})),nZ=(0,eV.Ay)(eT.A)(({theme:e})=>({display:"flex",flexDirection:"column",gap:e.spacing(4)})),nY=(0,eV.Ay)(eT.A)(({theme:e})=>({display:"flex",gap:e.spacing(4),[e.breakpoints.down("md")]:{flexDirection:"column"}}));(0,eV.Ay)(eT.A)(()=>({display:"flex",flexDirection:"column"}));let nK=(0,y.forwardRef)(({ccHasApp:e,form:{control:t,getValues:n}},a)=>{let i=(0,f.A)(),{t:r}=(0,T.o)("translation",{keyPrefix:"PAGE.LESSON_CONTENT"}),{data:s}=(0,e5.c)(),o=(0,y.useMemo)(()=>s?.colors_light.primary_color,[s]),l=(0,y.useMemo)(()=>s?.colors_light.primary_contrast_color,[s]),{append:d,fields:c,move:u,remove:p}=(0,M.jz)({control:t,name:"content_blocks"}),[x]=(0,M.FH)({control:t,name:["content_blocks"]}),{livestream:_}=(0,e3.h)();return(0,m.jsxs)(nW,{paddingBottom:{xs:20,md:0},ref:a,children:[(0,m.jsx)(e1.JY,{onDragEnd:e=>{if(!e.destination)return;let t=e.source.index,a=e.destination.index;if(t===a)return;let i=[...n("content_blocks")],[r]=i.splice(t,1);
1i.splice(a,0,r),i.forEach((e,t)=>{e.order=t+1}),u(t,a)},children:(0,m.jsx)(e1.gL,{droppableId:"content_blocks",children:n=>(0,m.jsxs)(h.A,{ref:n.innerRef,...n.droppableProps,gap:i.spacing(2),children:[(0,m.jsx)(M.xI,{control:t,name:"content_blocks",render:({field:{value:n}})=>(0,m.jsx)(m.Fragment,{children:x.map((a,i)=>(0,m.jsx)(e1.sx,{draggableId:a.dragId,index:i,children:r=>(0,m.jsx)(h.A,{ref:r.innerRef,...r.draggableProps,children:(0,m.jsx)(nN,{"data-form-path":`content_blocks.${i}`,"data-element-type":"content block","data-ai-field":`edit Lesson content block/field with index ${i+1} with type ${Q.k0[a.type_id]}`,ccHasApp:e,before:(0,m.jsx)("div",{children:(0,m.jsx)(e0.A,{color:"primary",sx:{cursor:"grab"},...r.dragHandleProps,children:(0,m.jsx)(A.A,{icon:"tabler:grip-vertical"})})}),content:a,control:t,index:i,onDelete:()=>p(n.findIndex(e=>e.dragId===a.dragId)),isNew:-1===c.findIndex(e=>e.id===a.id)},a.id)})},a.dragId))})}),n.placeholder]})})}),(0,m.jsxs)(nZ,{children:[(0,m.jsxs)(nY,{children:[(0,m.jsx)(nq,{"data-form-path":"add_video_block","data-element-type":"button","data-ai-field":"Add video content block/field button click",onClick:()=>d({dragId:(0,B.$)(),type_id:Q.KL.Video,mandatory_video_view:!1,video_percent:null,content:{file_id:null,link:null},order:c.length+1}),title:r("add_video_title"),subTitle:r("add_video_subtitle"),icon:(0,m.jsx)(nF,{})}),(0,m.jsx)(nq,{"data-form-path":"add_rich_text_block","data-element-type":"button","data-ai-field":"Add rich text content block/field button click",onClick:()=>d({dragId:(0,B.$)(),type_id:Q.KL.RichText,content:{payload:"<p></p>"},order:c.length+1}),title:r("add_rich_text_title"),subTitle:r("add_rich_text_subtitle"),icon:(0,m.jsx)(nz,{})}),(0,m.jsx)(nq,{"data-form-path":"add_audio_block","data-element-type":"button","data-ai-field":"Add audio content block/field button click",onClick:()=>d({dragId:(0,B.$)(),type_id:Q.KL.Audio,content:{audio_id:""},order:c.length+1}),title:r("add_audio_title"),subTitle:r("add_audio_subtitle"),icon:(0,m.jsx)(nD,{})})]}),(0,m.jsxs)(nY,{children:[(0,m.jsx)(nq,{"data-form-path":"add_pdf_block","data-element-type":"button","data-ai-field":"Add PDF content block/field button click",onClick:()=>d({dragId:(0,B.$)(),type_id:Q.KL.PDF,content:{pdf_id:""},order:c.length+1}),title:r("add_pdf_title"),subTitle:r("add_pdf_subtitle"),icon:(0,m.jsx)(nB,{})}),(0,m.jsx)(nq,{"data-form-path":"add_button_block","data-element-type":"button","data-ai-field":"Add button content block/field button click",onClick:()=>d({dragId:(0,B.$)(),type_id:Q.KL.Button,content:{btn_size:"medium",btn_url:"",btn_font:"normal",btn_color:o||i.palette.primary[500],btn_text_color:l||i.palette.common.white,btn_position:"center",btn_target:"",btn_text:""},order:c.length+1}),title:r("add_btn_title"),subTitle:r("add_btn_subtitle"),icon:(0,m.jsx)(nP,{})}),(0,m.jsx)(nq,{"data-form-path":"add_html_block","data-element-type":"button","data-ai-field":"Add HTML content block/field button click",onClick:()=>d({dragId:(0,B.$)(),type_id:Q.KL.HTML,content:{payload:""},order:c.length+1}),title:r("add_HTML_title"),subTitle:r("add_HTML_subtitle"),icon:(0,m.jsx)(n$,{})})]}),(0,m.jsxs)(nY,{children:[(0,m.jsx)(nq,{onClick:()=>d({dragId:(0,B.$)(),type_id:Q.KL.AI_chat,content:{name:r("ai_chat_name_placeholder"),instructions:"",conversation_starter:r("ai_chat_conversation_starter_placeholder")},order:c.length+1}),title:r("add_ai_chat_title"),subTitle:r("add_ai_chat_subtitle"),icon:(0,m.jsx)(nQ,{})}),(0,m.jsx)(nq,{"data-form-path":"add_certificate_block","data-element-type":"button","data-ai-field":"Add certificate content block/field button click",onClick:()=>d({dragId:(0,B.$)(),type_id:Q.KL.Certificate,content:{template_id:U.Fc,type_id:et.A.ALWAYS},order:c.length+1}),title:r("add_certificate_title"),subTitle:r("add_certificate_subtitle"),icon:(0,m.jsx)(e6,{})}),(0,m.jsx)(nq,{"data-form-path":"add_widget_block","data-element-type":"button","data-ai-field":"Add widget content block/field button click",onClick:()=>d({dragId:(0,B.$)(),type_id:Q.KL.Widget,content:{widget_id:0},order:c.length+1}),title:r("add_widget_title"),subTitle:r("add_widget_subtitle"),icon:(0,m.jsx)(nV,{})}),_&&(0,m.jsx)(nq,{"data-form-path":"add_live_stream_block","data-element-type":"button","data-ai-field":"Add live stream content block/field button click",highlighted:!0,badge:r("live_stream.newBadge"),onClick:()=>
1d({dragId:(0,B.$)(),type_id:Q.KL.LiveStream,content:{stream_session_id:e7[0].id,recording_availability:J,cover_image_id:""},order:c.length+1}),title:r("add_live_stream_title"),subTitle:r("add_live_stream_subtitle"),icon:(0,m.jsx)(nH,{})})]})]})]})});var nG=n(24261);let nU=(0,eV.Ay)(eT.A)(({theme:e})=>({display:"flex",flexDirection:"column",gap:e.spacing(4),paddingTop:e.spacing(4),[e.breakpoints.down("md")]:{paddingBottom:30}})),nX=(0,eV.Ay)(eT.A)(({theme:e})=>({display:"flex",flexDirection:"column",gap:e.spacing(1)})),nJ=(0,y.forwardRef)(({control:e},t)=>{let n=(0,f.A)(),{t:a}=(0,T.o)();return(0,m.jsxs)(nU,{ref:t,children:[(0,m.jsx)(M.xI,{control:e,name:"title",rules:{required:!0},render:({field:e,fieldState:{error:t}})=>(0,m.jsx)(eq.XY,{"data-form-path":"title","data-element-type":"text field","data-ai-field":"Lesson title",...e,placeholder:a("FORM.placeholder"),error:!!t,fullWidth:!0,helperText:(0,m.jsxs)(h.A,{spacing:n.spacing(2),children:[t&&(0,m.jsx)(nG.A,{error:!0,children:t?.message}),(0,m.jsx)(nG.A,{error:e.value?.length>100,children:`${e.value?.length??0} / 100`}),(0,m.jsx)(nG.A,{children:a("PAGE.LESSON_SETTINGS.TITLE.help")})]}),label:a("PAGE.LESSON_SETTINGS.TITLE.label"),value:e.value})}),(0,m.jsx)(M.xI,{control:e,name:"payload",render:({field:{value:e,onChange:t},fieldState:{error:i}})=>(0,m.jsxs)(h.A,{children:[(0,m.jsx)(eO.A,{variant:"body2",children:a("PAGE.LESSON_SETTINGS.DESCRIPTION.label")}),(0,m.jsx)(th.A,{"data-form-path":"payload","data-element-type":"rich text editor","data-ai-field":"Lesson description field with html value",value:e,onChange:t,placeholder:a("FORM.placeholder")}),i&&(0,m.jsx)(eO.A,{color:n.palette.error[500],variant:"body2",children:a("PAGE.LESSON_SETTINGS.DESCRIPTION.help")})]})}),(0,m.jsxs)(nX,{children:[(0,m.jsx)(eO.A,{variant:"body2",children:a("PAGE_ELEMENT.cover_image")}),(0,m.jsx)(M.xI,{control:e,name:"image_id",render:({field:{value:e,onChange:t}})=>(0,m.jsx)(tk.A,{existingImageId:e||null,formSetterFn:t,requirementsLabel:"​"})})]})]})});var n2=n(65608),n0=n(20310),n1=n(66664);let n3=(0,eV.Ay)(eO.A)(({theme:e})=>({position:"absolute",top:"130%",textAlign:"center",left:"50%",width:200,marginLeft:-100,color:e.palette.primary.main})),n5=({file:e,uploadPercent:t,fileStatus:n,onDelete:a,before:i,...r})=>{let s=(0,f.A)(),{t:o}=(0,T.o)("translation",{keyPrefix:"PAGE.LESSON_DETAIL.ATTACHMENTS"}),{t:l}=(0,T.o)(),d=(0,y.useMemo)(()=>100===t&&n[e.id]?.converting?(0,m.jsxs)(h.A,{alignItems:"center",justifyContent:"center",position:"relative",children:[(0,m.jsx)(tE.m,{size:24,bgColor:"transparent"}),(0,m.jsx)(n3,{variant:"caption",children:l("ACTION.do_not_close_tab")})]}):100!==t||n[e.id]?.converting||n[e.id]?.uploading?n[e.id]?.uploading?(0,m.jsxs)(h.A,{alignItems:"center",justifyContent:"center",position:"relative",children:[(0,m.jsx)(n1.A,{variant:"determinate",value:t,size:s.spacing(6)}),(0,m.jsx)(n3,{variant:"caption",children:l("ACTION.do_not_close_tab")})]}):void 0:(0,m.jsx)(nO.A,{label:o("uploaded"),size:"small",color:"success"}),[t,n,e.id,l,o,s]);return(0,m.jsx)(e9.A,{in:!0,"data-sentry-element":"Collapse","data-sentry-component":"FileRow","data-sentry-source-file":"FileRow.tsx",children:(0,m.jsxs)(h.A,{direction:"row",alignItems:"center",gap:s.spacing(2),boxShadow:s.shadow.grey.sm,padding:s.spacing(1),borderRadius:s.spacing(1),pb:t&&100!==t||n[e.id]?.converting||n[e.id]?.uploading?s.spacing(5):s.spacing(1),"data-sentry-element":"Stack","data-sentry-source-file":"FileRow.tsx",children:[i,(0,m.jsxs)(h.A,{direction:"row",alignItems:"center",width:"100%",gap:s.spacing(2),"data-sentry-element":"Stack","data-sentry-source-file":"FileRow.tsx",children:[(0,m.jsx)(eM.In,{color:s.palette.primary.main,fontSize:s.spacing(4.5),icon:"tabler:file","data-sentry-element":"Icon","data-sentry-source-file":"FileRow.tsx"}),(0,m.jsx)(eO.A,{variant:"body1",flex:1,width:"100%","data-sentry-element":"Typography","data-sentry-source-file":"FileRow.tsx",children:e.file.name}),(0,m.jsxs)(h.A,{direction:"row",alignItems:"center",gap:s.spacing(2),"data-sentry-element":"Stack","data-sentry-source-file":"FileRow.tsx",children:[d,(0,m.jsxs)(eO.A,{variant:"body2","data-sentry-element":"Typography","data-sentry-source-file":"FileRow.tsx",children:[(e.file.size/1024/1024).toFixed(2)," ",l("extracted.mb")]}),(0,m.jsx)(e0.A,{color:"error",onClick:a(e.id),...r,"data-sentry-element":"IconButton","data-sentry-source-file":"FileRow.tsx",children:(0,m.jsx)(eM.In,{fontSize:s.spacing(4.5),icon:"tabler:trash",color:"primary","data-sentry-element":"Icon","data-sentry-source-file":"FileRow.tsx"})})]})]})]})})},n7=(0,y.forwardRef)(({control:e,setValue:t,getValues:n},a)=>{let i=(0,f.A)(),[r,s]=(0,y.useState)({}),{onChangeUploadFiles:o,onUploadFilesChangeProgress:l}=(0,n2.g)(),{fields:d,move:c}=(0,M.jz)({control:e,name:"files",keyName:"customId"}),u=[...d].sort((e,t)=>
1e.order-t.order),p=(0,y.useRef)(null),{uploadFile:x}=(0,n0.A)((e,a)=>{t("files",n("files").map(t=>t.id===a&&t?.progress!==100?{...t,progress:e}:t))},async({data:e},a)=>{t("attachments",[...n("attachments")||[],...e.result.map(e=>({id:a,file_id:e.id}))]),a&&s(e=>({...e,[a]:{...e[a]||{},uploading:!1,converting:!0}}))}),_=async e=>{await Promise.all(e.map(e=>{let a=n("files"),i=(0,B.$)();return t("files",[...a||[],{id:i,file:e,order:a.length+1}]),o?.(t=>[...t,{file:e,progress:0,convertProgress:0}]),(async()=>{s(e=>({...e,[i]:{...e[i]||{},uploading:!0,converting:!1}}));try{await x({file:e,id:i,onProgress:t=>l?.(e,t),withConverting:!0,onConvertingDone:(t,n)=>{n&&s(e=>({...e,[n]:{...e[n]||{},uploading:!1,converting:!1}})),o?.(t=>t.filter(t=>t.file.name!==e.name))}})}catch(t){s(e=>({...e,[i]:{...e[i]||{},uploading:!1,converting:!1}})),o?.(t=>t.filter(t=>t.file.name!==e.name))}})()}))},g=e=>()=>{let a=n("files"),i=n("attachments");t("files",a.filter(t=>t.id!==e)),t("attachments",i?.filter(t=>t?.id!==e))};return(0,m.jsxs)(h.A,{gap:i.spacing(4),width:"100%",marginTop:i.spacing(2),ref:a,children:[(0,m.jsx)(e1.JY,{onDragEnd:e=>{if(!e.destination)return;let t=e.source.index,a=e.destination.index;if(t===a)return;let i=[...n("files")],[r]=i.splice(t,1);i.splice(a,0,r),i.forEach((e,t)=>{e.order=t+1}),c(t,a)},children:(0,m.jsx)(e1.gL,{droppableId:"content_blocks",children:e=>(0,m.jsxs)(h.A,{gap:i.spacing(2),ref:e.innerRef,...e.droppableProps,children:[(0,m.jsx)(m.Fragment,{children:u&&u.map((e,t)=>(0,m.jsx)(e1.sx,{draggableId:e.id,index:t,children:n=>(0,m.jsx)(h.A,{ref:n.innerRef,...n.draggableProps,children:(0,m.jsx)(n5,{"data-form-path":`attachments.${t}`,"data-element-type":"button","data-ai-field":`delete file with file index ${t} button click`,before:(0,m.jsx)(e0.A,{sx:{cursor:"grab"},...n.dragHandleProps,children:(0,m.jsx)(A.A,{color:i.palette.primary.main,icon:"tabler:grip-vertical"})}),file:e,fileStatus:r,uploadPercent:e?.progress,onDelete:g})})},e.id))}),e.placeholder]})})}),(0,m.jsx)(t2.A,{fileInputRef:p,onUpload:_,onMentorCloudFilesPick:e=>{let a=n("files"),i=n("attachments");t("files",[...a||[],...e.map((e,t)=>({id:e.file_id,file:P((0,ta.kJ)(e.title),e.size),order:a.length+t+1}))]),t("attachments",[...i||[],...e.map(e=>({id:e.file_id,file_id:e.id}))])}})]})}),n8=({lesson:e,files:t,currentCourse:n,currentModule:a,currentLesson:i,onNextClick:r,onPrevClick:s,isFirstLessonInModule:o,isLastLessonInModule:l,ccHasApp:d})=>{let c,{t:u}=(0,T.o)("translation",{keyPrefix:"PAGE.LESSON_DETAIL"}),p=(0,x.useRouter)(),h=(c=(0,y.useRef)(null),(0,y.useEffect)(()=>{window.App&&(window.App.methods.getContext=()=>c.current?.innerHTML||"")},[]),c),{onSubmit:f,form:_}=ev(e,t),g=()=>p.push(`/courses?${(0,eU.O)({...p.query,module:`${e?.module_id}`,lesson:`${e?.id}`})}`);return(0,m.jsx)(m.Fragment,{children:(0,m.jsxs)(M.Op,{..._,"data-sentry-element":"FormProvider","data-sentry-source-file":"LessonDetailsForm.tsx",children:[(0,m.jsx)("form",{children:(0,m.jsxs)(eX.A,{title:i?.title,buttons:{next:{disabled:l,onClick:r,"data-form-path":"next_lesson_button","data-element-type":"button","data-ai-field":"Next lesson button"},previous:{disabled:o,onClick:s,"data-form-path":"previous_lesson_button","data-element-type":"button","data-ai-field":"Previous lesson button"}},"data-sentry-element":"FormLayout","data-sentry-source-file":"LessonDetailsForm.tsx",children:[(0,m.jsx)(eJ.A,{menuIcon:"tabler:book-2",menuTitle:u("LESSON_CONTENT.menu_title"),menuSubTitle:u("LESSON_CONTENT.menu_subtitle"),tabTitle:u("LESSON_CONTENT.tab_title"),tabSubtitle:u("LESSON_CONTENT.tab_subtitle"),"data-sentry-element":"FormTab","data-sentry-source-file":"LessonDetailsForm.tsx",children:(0,m.jsx)(nK,{ref:h,form:_,ccHasApp:d,"data-sentry-element":"LessonContent","data-sentry-source-file":"LessonDetailsForm.tsx"})}),(0,m.jsx)(eJ.A,{menuIcon:"tabler:home",menuTitle:u("MAIN_INFO.menu_title"),menuSubTitle:u("MAIN_INFO.menu_subtitle"),tabTitle:u("MAIN_INFO.tab_title"),"data-sentry-element":"FormTab","data-sentry-source-file":"LessonDetailsForm.tsx",children:(0,m.jsx)(nJ,{ref:h,control:_.control,"data-sentry-element":"LessonMainInformation","data-sentry-source-file":"LessonDetail
1sForm.tsx"})}),(0,m.jsx)(eJ.A,{menuIcon:"tabler:file",menuTitle:u("ATTACHMENTS.menu_title"),menuSubTitle:u("ATTACHMENTS.menu_subtitle"),tabTitle:u("ATTACHMENTS.tab_title"),tabSubtitle:u("ATTACHMENTS.tab_subtitle"),"data-sentry-element":"FormTab","data-sentry-source-file":"LessonDetailsForm.tsx",children:(0,m.jsx)(n7,{ref:h,control:_.control,setValue:_.setValue,getValues:_.getValues,"data-sentry-element":"LessonAttachments","data-sentry-source-file":"LessonDetailsForm.tsx"})}),(0,m.jsx)(eJ.A,{menuIcon:"tabler:settings",menuTitle:u("SETTINGS.menu_title"),menuSubTitle:u("SETTINGS.menu_subtitle"),tabTitle:u("SETTINGS.tab_title"),"data-sentry-element":"FormTab","data-sentry-source-file":"LessonDetailsForm.tsx",children:(0,m.jsx)(eG,{ref:h,control:_.control,currentCourse:n,currentLesson:i,currentModule:a,"data-sentry-element":"LessonAdjustment","data-sentry-source-file":"LessonDetailsForm.tsx"})})]})}),(0,m.jsx)(e2.A,{cancelButton:{onSubmit:g,"data-form-path":"cancel_button","data-element-type":"button","data-ai-field":"Cancel button click"},saveButton:{actionCode:eK.Qi.EDIT_COURSE,anyActionCode:eK.Qi.EDIT_ANY_COURSE,courseId:n?.id,onSubmit:f(),"data-form-path":"save_button","data-element-type":"button","data-ai-field":"Save button click"},saveAndCloseButton:{actionCode:eK.Qi.EDIT_COURSE,anyActionCode:eK.Qi.EDIT_ANY_COURSE,courseId:n?.id,onSubmit:f(g),"data-form-path":"save_and_close_button","data-element-type":"button","data-ai-field":"Save and close button click"},"data-sentry-element":"FormFooter","data-sentry-source-file":"LessonDetailsForm.tsx"})]})})};var n4=n(69884),n6=n(41070),n9=n(75452);let ae=(0,y.memo)(({children:e})=>(0,m.jsx)(e1.gL,{droppableId:"quiz-questions",children:t=>(0,m.jsxs)(nu.A,{display:"flex",flexDirection:"column",ref:t.innerRef,...t.droppableProps,children:[e,t.placeholder]})})),at=(0,eV.Ay)(eT.A)(({theme:e})=>({alignItems:"center",border:"1px dashed",borderColor:e.palette.divider,borderRadius:e.spacing(1.5),cursor:"pointer",display:"flex",flex:1,gap:e.spacing(6),justifyContent:"center",padding:e.spacing(8),transition:"all 100ms ease-in-out","&:hover":{borderColor:e.palette.primary.main}})),an=({icon:e,title:t,subTitle:n,onClick:a,...i})=>{let r=(0,f.A)();return(0,m.jsx)(at,{onClick:a,...i,"data-sentry-element":"ContentAdditionButtonSectionBox","data-sentry-component":"ContentAdditionButton","data-sentry-source-file":"ContentAdditionButton.tsx",children:(0,m.jsxs)(eT.A,{alignItems:"center",display:"flex",flexDirection:"column",gap:r.spacing(.5),justifyContent:"center","data-sentry-element":"Box","data-sentry-source-file":"ContentAdditionButton.tsx",children:[e,(0,m.jsx)(eO.A,{variant:"body1",fontWeight:500,textAlign:"center","data-sentry-element":"Typography","data-sentry-source-file":"ContentAdditionButton.tsx",children:t}),(0,m.jsx)(eO.A,{textAlign:"center",variant:"body2","data-sentry-element":"Typography","data-sentry-source-file":"ContentAdditionButton.tsx",children:n})]})})},aa=()=>(0,m.jsxs)("svg",{width:"43",height:"42",viewBox:"0 0 43 42",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-sentry-element":"svg","data-sentry-component":"Camera","data-sentry-source-file":"Camera.tsx",children:[(0,m.jsxs)("g",{opacity:"0.2","data-sentry-element":"g","data-sentry-source-file":"Camera.tsx",children:[(0,m.jsx)("path",{d:"M37.168 9.1875H5.83203C5.06185 9.1875 4.4375 9.81185 4.4375 10.582V31.418C4.4375 32.1881 5.06185 32.8125 5.83203 32.8125H37.168C37.9381 32.8125 38.5625 32.1881 38.5625 31.418V10.582C38.5625 9.81185 37.9381 9.1875 37.168 9.1875Z",fill:"#415BF5","data-sentry-element":"path","data-sentry-source-file":"Camera.tsx"}),(0,m.jsx)("path",{d:"M37.168 9.1875H5.83203C5.06185 9.1875 4.4375 9.81185 4.4375 10.582V31.418C4.4375 32.1881 5.06185 32.8125 5.83203 32.8125H37.168C37.9381 32.8125 38.5625 32.1881 38.5625 31.418V10.582C38.5625 9.81185 37.9381 9.1875 37.168 9.1875Z",fill:"white",fillOpacity:"0.4","data-sentry-element":"path","data-sentry-source-file":"Camera.tsx"})]}),(0,m.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.8322 10.2376C5.64191 10.2376 5.48765 10.3919 5.48765 10.5822V31.4181C5.48765 31.6084 5.64191 31.7627 5.8322 31.7627H37.1681C37.3584 31.7627 37.5127 31.6084 37.5127 31.4181V10.5822C37.5127 10.3919 37.3584 10.2376 37.1681 10.2376H5.8322ZM3.3877 10.5822C3.3877 9.23214 4.48214 8.1377 5.8322 8.1377H37.1681C38.5182 8.1377 39.6126 9.23214 39.6126 10.5822V31.4181C39.6126 32.7682 38.5182 33.8626 37.1681 33.8626H5.8322C4.48214 33.8626 3.3877 32.7682 3.387
17 31.4181V10.5822Z",fill:"#415BF5","data-sentry-element":"path","data-sentry-source-file":"Camera.tsx"}),(0,m.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.8322 10.2376C5.64191 10.2376 5.48765 10.3919 5.48765 10.5822V31.4181C5.48765 31.6084 5.64191 31.7627 5.8322 31.7627H37.1681C37.3584 31.7627 37.5127 31.6084 37.5127 31.4181V10.5822C37.5127 10.3919 37.3584 10.2376 37.1681 10.2376H5.8322ZM3.3877 10.5822C3.3877 9.23214 4.48214 8.1377 5.8322 8.1377H37.1681C38.5182 8.1377 39.6126 9.23214 39.6126 10.5822V31.4181C39.6126 32.7682 38.5182 33.8626 37.1681 33.8626H5.8322C4.48214 33.8626 3.3877 32.7682 3.3877 31.4181V10.5822Z",fill:"white",fillOpacity:"0.4","data-sentry-element":"path","data-sentry-source-file":"Camera.tsx"}),(0,m.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M23.731 18.6372L27.914 16.5461C28.1987 16.4038 28.5368 16.4191 28.8076 16.5864C29.0784 16.7537 29.2433 17.0492 29.2435 17.3675V23.5819C29.2433 23.9002 29.0784 24.1957 28.8076 24.363C28.5368 24.5303 28.1987 24.5455 27.914 24.4033L23.731 22.3122V18.6372Z",stroke:"#415BF5",strokeWidth:"2.1",strokeLinecap:"round",strokeLinejoin:"round","data-sentry-element":"path","data-sentry-source-file":"Camera.tsx"}),(0,m.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M23.731 18.6372L27.914 16.5461C28.1987 16.4038 28.5368 16.4191 28.8076 16.5864C29.0784 16.7537 29.2433 17.0492 29.2435 17.3675V23.5819C29.2433 23.9002 29.0784 24.1957 28.8076 24.363C28.5368 24.5303 28.1987 24.5455 27.914 24.4033L23.731 22.3122V18.6372Z",stroke:"white",strokeOpacity:"0.4",strokeWidth:"2.1",strokeLinecap:"round",strokeLinejoin:"round","data-sentry-element":"path","data-sentry-source-file":"Camera.tsx"}),(0,m.jsx)("rect",{x:"12.7061",y:"14.9619",width:"11.025",height:"11.025",rx:"1.8375",stroke:"#415BF5",strokeWidth:"2.1",strokeLinecap:"round",strokeLinejoin:"round","data-sentry-element":"rect","data-sentry-source-file":"Camera.tsx"}),(0,m.jsx)("rect",{x:"12.7061",y:"14.9619",width:"11.025",height:"11.025",rx:"1.8375",stroke:"white",strokeOpacity:"0.4",strokeWidth:"2.1",strokeLinecap:"round",strokeLinejoin:"round","data-sentry-element":"rect","data-sentry-source-file":"Camera.tsx"})]}),ai=()=>(0,m.jsxs)("svg",{width:"43",height:"42",viewBox:"0 0 43 42",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-sentry-element":"svg","data-sentry-component":"Speaker","data-sentry-source-file":"Speaker.tsx",children:[(0,m.jsx)("path",{d:"M21.1665 36.75C29.865 36.75 36.9165 29.6985 36.9165 21C36.9165 12.3015 29.865 5.25 21.1665 5.25C12.468 5.25 5.4165 12.3015 5.4165 21C5.4165 29.6985 12.468 36.75 21.1665 36.75Z",fill:"#415BF5","data-sentry-element":"path","data-sentry-source-file":"Speaker.tsx"}),(0,m.jsx)("path",{d:"M21.1665 36.75C29.865 36.75 36.9165 29.6985 36.9165 21C36.9165 12.3015 29.865 5.25 21.1665 5.25C12.468 5.25 5.4165 12.3015 5.4165 21C5.4165 29.6985 12.468 36.75 21.1665 36.75Z",fill:"white",fillOpacity:"0.8","data-sentry-element":"path","data-sentry-source-file":"Speaker.tsx"}),(0,m.jsx)("path",{d:"M21.1665 36.75C29.865 36.75 36.9165 29.6985 36.9165 21C36.9165 12.3015 29.865 5.25 21.1665 5.25C12.468 5.25 5.4165 12.3015 5.4165 21C5.4165 29.6985 12.468 36.75 21.1665 36.75Z",stroke:"#415BF5",strokeWidth:"2.1",strokeLinecap:"round",strokeLinejoin:"round","data-sentry-element":"path","data-sentry-source-file":"Speaker.tsx"}),(0,m.jsx)("path",{d:"M21.1665 36.75C29.865 36.75 36.9165 29.6985 36.9165 21C36.9165 12.3015 29.865 5.25 21.1665 5.25C12.468 5.25 5.4165 12.3015 5.4165 21C5.4165 29.6985 12.468 36.75 21.1665 36.75Z",stroke:"white",strokeOpacity:"0.4",strokeWidth:"2.1",strokeLinecap:"round",strokeLinejoin:"round","data-sentry-element":"path","data-sentry-source-file":"Speaker.tsx"}),(0,m.jsx)("path",{d:"M24.0537 17.1494C25.2655 18.0583 25.9787 19.4846 25.9787 20.9994C25.9787 22.5142 25.2655 23.9406 24.0537 24.8494",stroke:"#415BF5",strokeWidth:"2.1",strokeLinecap:"round",strokeLinejoin:"round","data-sentry-element":"path","data-sentry-source-file":"Speaker.tsx"}),(0,m.jsx)("path",{d:"M24.0537 17.1494C25.2655 18.0583 25.9787 19.4846 25.9787 20.9994C25.9787 22.5142 25.2655 23.9406 24.0537 24.8494",stroke:"white",strokeOpacity:"0.4",strokeWidth:"2.1",strokeLinecap:"round",strokeLinejoin:"round","data-sentry-element":"path","data-sentry-source-file":"Speaker.tsx"}),(0,m.jsx)("path",{d:"M26.6523 14.2617C28.6874 15.9063 29.8701 18.3827 29.8701 20.9992C29.8701 23.6158 28.6874 26.0921 26.6523 27.7367",stroke:"#415BF5",strokeWidth:"2.1",strokeLinecap:"round",strokeLinejoin:"round","data-sentry-element":"path","data-sentry-source-file":"Speaker.tsx"}),(0,m.jsx)("path",{d:"M26.6523 14.2617C28.6874 15.9063 29.8701 18.3827 29.8701 20.9992C29.8701 23.6158 28.6874 26.0921 26.6523 27.7367",stroke:"white",strokeOpacity:"0.4",strokeWidth:"2.1",strokeLinecap:"round",strokeLinejoin:"round","data-sentry-element":"path","data-sentry-source-file":"Speaker.tsx"}),(0,m.jsx)("path",{d:"M15.3914 23.8872H13.4664C12.9348 23.8872 12.5039 23.4563 12.5039 22.9247V19.0747C12.5039 18.5431 12.9348 18.1122 13.4664 18.1122H15.3914L18.7602 13.7809C18.934 13.4433 19.328 13.2828 19.6882 13.4029C20.0485 13.523 20.2674 13.8878 20.2039 14.2622V27.7372C20.2674 28.1116 20.0485 28.4764 19.6882 28.5965C19.328 28.7166 18.934 28.5561 18.7602 28.2184L15.3914 23.8872",stroke:"#415BF5",strokeWidth:"2.1",strokeLinecap:"round",strokeLinejoin:"round","data-sentry-element":"path","data-sentry-source-file":"Speaker.tsx"}),(0,m.jsx)("path",{d:"M15.3914 23.8872H13.4664C12.9348 23.8872 12.5039 23.4563 12.5039 22.9247V19.0747C12.5039 18.5431 12.9348 18.1122 13.4664 18.1122H15.3914L18.7602 13.7809C18.934 13.4433 19.328 13.2828 19.6882 13.4029C20.0485 13.523 20.2674 13.8878 20.2039 14.2622V27.7372C20.2674 28.1116 20.0485 28.4764 19.6882 28.5965C19.328 28.7166 18.934 28.5561 18.7602 28.2184L15.3914 23.8872",stroke:"white",strokeOpacity:"0.4",strokeWidth:"2.1",strokeLinecap:"round",strokeLinejoin:"round","data-sentry-element":"path","data-sentry-source-file":"Speaker.tsx"})]}),ar=()=>(0,m.jsxs)("svg",{width:"43",height:"42",viewBox:"0 0 43 42",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-sentry-element":"svg","data-sentry-component":"Text","data-sentry-source-file":"Text.tsx",children:[(0,m.jsxs)("g",{opacity:"0.2","data-sentry-element":"g","data-sentry-source-file":"Text.tsx",children:[(0,m.jsx)("path",{d:"M36.8345 9.1875H5.49854C4.72836 9.1875 4.104 9.81185 4.104 10.582V31.418C4.104 32.1881 4.72836 32.8125 5.49854 32.8125H36.8345C37.6047 32.8125 38.229 32.1881 38.229 31.418V10.582C38.229 9.81185 37.6047 9.1875 36.8345 9.1875Z",fill:"#415BF5","data-sentry-element":"path","data-sentry-source-file":"Text.tsx"}),(0,m.jsx)("path",{d:"M36.8345 9.1875H5.49854C4.72836 9.1875 4.104 9.81185 4.104 10.582V31.418C4.104 32.1881 4.72836 32.8125 5.49854 32.8125H36.8345C37.6047 32.8125 38.229 32.1881 38.229 31.418V10.582C38.229 9.81185 37.6047 9.1875 36.8345 9.1875Z",fill:"white",fillOpacity:"0.4","data-sentry-element":"path","data-sentry-source-file":"Text.tsx"})]}),(0,m.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.1542 10.5822C5.1542 10.3919 5.30845 10.2377 5.49873 10.2377H36.8347C37.0249 10.2377 37.1792 10.3919 37.1792 10.5822V31.4182C37.1792 31.6084 37.0249 31.7627 36.8347 31.7627H5.49873C5.30845 31.7627 5.1542 31.6084 5.1542 31.4182V10.5822ZM5.49873 8.1377C4.14865 8.1377 3.0542 9.23215 3.0542 10.5822V31.4182C3.0542 32.7682 4.14865 33.8627 5.49873 33.8627H36.8347C38.1847 33.8627 39.2792 32.7682 39.2792 31.4182V10.5822C39.2792 9.23215 38.1847 8.1377 36.8347 8.1377H5.49873ZM9.3542 14.7002C8.7743 14.7002 8.3042 15.1703 8.3042 15.7502C8.3042 16.3301 8.7743 16.8002 9.3542 16.8002H32.9792C33.5591 16.8002 34.0292 16.3301 34.0292 15.7502C34.0292 15.1703 33.5591 14.7002 32.9792 14.7002H9.3542ZM9.3542 19.9502C8.7743 19.9502 8.3042 20.4203 8.3042 21.0002C8.3042 21.5801 8.7743 22.0502 9.3542 22.0502H32.9792C33.5591 22.0502 34.0292 21.5801 34.0292 21.0002C34.0292 20.4203 33.5591 19.9502 32.9792 19.9502H9.3542ZM8.3042 26.2502C8.3042 25.6703 8.7743 25.2002 9.3542 25.2002H10.6667C11.2466 25.2002 11.7167 25.6703 11.7167 26.2502C11.7167 26.8301 11.2466 27.3002 10.6667 27.3002H9.3542C8.7743 27.3002 8.3042 26.8301 8.3042 26.2502ZM15.916
17 25.2002C15.3368 25.2002 14.8667 25.6703 14.8667 26.2502C14.8667 26.8301 15.3368 27.3002 15.9167 27.3002H26.4167C26.9966 27.3002 27.4667 26.8301 27.4667 26.2502C27.4667 25.6703 26.9966 25.2002 26.4167 25.2002H15.9167ZM30.6167 26.2502C30.6167 25.6703 31.0868 25.2002 31.6667 25.2002H32.9792C33.5591 25.2002 34.0292 25.6703 34.0292 26.2502C34.0292 26.8301 33.5591 27.3002 32.9792 27.3002H31.6667C31.0868 27.3002 30.6167 26.8301 30.6167 26.2502Z",fill:"#415BF5","data-sentry-element":"path","data-sentry-source-file":"Text.tsx"}),(0,m.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.1542 10.5822C5.1542 10.3919 5.30845 10.2377 5.49873 10.2377H36.8347C37.0249 10.2377 37.1792 10.3919 37.1792 10.5822V31.4182C37.1792 31.6084 37.0249 31.7627 36.8347 31.7627H5.49873C5.30845 31.7627 5.1542 31.6084 5.1542 31.4182V10.5822ZM5.49873 8.1377C4.14865 8.1377 3.0542 9.23215 3.0542 10.5822V31.4182C3.0542 32.7682 4.14865 33.8627 5.49873 33.8627H36.8347C38.1847 33.8627 39.2792 32.7682 39.2792 31.4182V10.5822C39.2792 9.23215 38.1847 8.1377 36.8347 8.1377H5.49873ZM9.3542 14.7002C8.7743 14.7002 8.3042 15.1703 8.3042 15.7502C8.3042 16.3301 8.7743 16.8002 9.3542 16.8002H32.9792C33.5591 16.8002 34.0292 16.3301 34.0292 15.7502C34.0292 15.1703 33.5591 14.7002 32.9792 14.7002H9.3542ZM9.3542 19.9502C8.7743 19.9502 8.3042 20.4203 8.3042 21.0002C8.3042 21.5801 8.7743 22.0502 9.3542 22.0502H32.9792C33.5591 22.0502 34.0292 21.5801 34.0292 21.0002C34.0292 20.4203 33.5591 19.9502 32.9792 19.9502H9.3542ZM8.3042 26.2502C8.3042 25.6703 8.7743 25.2002 9.3542 25.2002H10.6667C11.2466 25.2002 11.7167 25.6703 11.7167 26.2502C11.7167 26.8301 11.2466 27.3002 10.6667 27.3002H9.3542C8.7743 27.3002 8.3042 26.8301 8.3042 26.2502ZM15.9167 25.2002C15.3368 25.2002 14.8667 25.6703 14.8667 26.2502C14.8667 26.8301 15.3368 27.3002 15.9167 27.3002H26.4167C26.9966 27.3002 27.4667 26.8301 27.4667 26.2502C27.4667 25.6703 26.9966 25.2002 26.4167 25.2002H15.9167ZM30.6167 26.2502C30.6167 25.6703 31.0868 25.2002 31.6667 25.2002H32.9792C33.5591 25.2002 34.0292 25.6703 34.0292 26.2502C34.0292 26.8301 33.5591 27.3002 32.9792 27.3002H31.6667C31.0868 27.3002 30.6167 26.8301 30.6167 26.2502Z",fill:"white",fillOpacity:"0.4","data-sentry-element":"path","data-sentry-source-file":"Text.tsx"})]});var as=n(15236),ao=n(51220);let al=Y.Ik({quiz_id:Y.au.number()});var ad=n(56046),ac=n(78881),au=n(20917);let ap=(0,eV.Ay)(eT.A)(({theme:e})=>({position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",maxWidth:500,width:"100%",border:0,outline:0,borderRadius:e.spacing(1.5),boxShadow:`0 5px 20px 0 ${e.colorWithOpacity("#4B465C",40)}`,backgroundColor:e.palette.customColors.cardBg,padding:e.spacing(6),[e.breakpoints.down("sm")]:{width:"93%"}})),am=(0,eV.Ay)(eT.A)(({theme:e})=>({display:"flex",flexDirection:"column",gap:e.spacing(8),paddingBottom:e.spacing(2.5)})),ay=(0,eV.Ay)(eT.A)(({theme:e})=>({display:"flex",flexDirection:"column",height:"calc(100% - 68px)",gap:e.spacing(4),padding:e.spacing(5,0)})),ax=(0,eV.Ay)(eT.A)(({theme:e})=>({display:"flex",justifyContent:"flex-end",gap:e.spacing(4)})),ah=(0,eV.Ay)(eT.A)(({theme:e})=>({position:"absolute",top:`-${e.spacing(2.5)}`,right:`-${e.spacing(2.5)}`,display:"flex",alignItems:"center",justifyContent:"center",width:32,height:32,padding:e.spacing(1.5),borderRadius:e.spacing(1.5),backgroundColor:e.palette.customColors.cardBg,boxShadow:`0 2px 4px 0 ${e.colorWithOpacity(e.palette.grey[500],30)}`,cursor:"pointer"})),af=({isOpen:e,onClose:t,question:n})=>{let{t:a}=(0,T.o)("translation",{keyPrefix:"PAGE.QUIZ_CONTENT.COPY_MODAL"}),{t:i}=(0,T.o)("translation",{keyPrefix:"ACTION"}),{data:r,isLoading:s,isError:o}=(0,_.I)({...I.Ay.courses.allCourseQuizzes,queryFn:()=>au.A.getCourseInfo({columns:["id","title","is_active","modules.title","modules.lessons.id","modules.lessons.title","modules.lessons.type_id"],filter_by:[{attribute:"is_archived",value:!1}],limit:9999}),select:({data:e})=>e.result.flatMap(e=>e.modules.flatMap(t=>t.lessons?.flatMap(n=>n.type_id===en.nv.QUIZ?{...n,title:`${e.title} > ${t.title} > ${n.title}`}:[])??[]))}),{control:l,onSubmit:d,isLessonError:c,isLessonLoading:u,isValid:p,isSubmitting:x}=((e,t)=>{let{control:n,watch:a,formState:{isValid:i}}=(0,M.mN)({resolver:(0,F.u)(al)}),r=a("quiz_id"),{data:s,isLoading:o,isError:l}=S(r),{onSubmit:d,form:c}=ev((0,y.useMemo)(()=>{let t=[...s?.content_blocks||[]],n=Math.max(...t?.map(e=>e?.order||0),0)+1,a=[...t,{...e,id:void 0,order:n||1}];
1return s?{...s,content_blocks:a}:void 0},[s,e])),u=(0,q.jE)();return{control:n,onSubmit:d((0,y.useCallback)(()=>{t?.(),u.invalidateQueries(I.Ay.lessons.detail(r))},[t,u,r])),isValid:i,isLessonLoading:o,isLessonError:l,isSubmitting:c.formState.isSubmitting}})(n,t);return(0,m.jsx)(ao.A,{open:e,onClose:t,"data-sentry-element":"Modal","data-sentry-component":"CopyToQuizModalForm","data-sentry-source-file":"CopyToQuizModalForm.tsx",children:(0,m.jsxs)(ap,{"data-sentry-element":"ModalContent","data-sentry-source-file":"CopyToQuizModalForm.tsx",children:[(0,m.jsx)(ah,{"data-sentry-element":"IconBox","data-sentry-source-file":"CopyToQuizModalForm.tsx",children:(0,m.jsx)(A.A,{icon:"tabler:x",onClick:t,"data-sentry-element":"Icon","data-sentry-source-file":"CopyToQuizModalForm.tsx"})}),(0,m.jsx)(am,{"data-sentry-element":"ModalHeader","data-sentry-source-file":"CopyToQuizModalForm.tsx",children:(0,m.jsx)(eO.A,{variant:"h5","data-sentry-element":"Typography","data-sentry-source-file":"CopyToQuizModalForm.tsx",children:a("title")})}),(0,m.jsxs)(ay,{"data-sentry-element":"ModalBody","data-sentry-source-file":"CopyToQuizModalForm.tsx",children:[(0,m.jsxs)(eT.A,{"data-sentry-element":"Box","data-sentry-source-file":"CopyToQuizModalForm.tsx",children:[(0,m.jsx)(eO.A,{"data-sentry-element":"Typography","data-sentry-source-file":"CopyToQuizModalForm.tsx",children:a("question")}),(0,m.jsx)(eO.A,{sx:{"& img":{maxWidth:"100%",margin:"0 auto"},wordBreak:"break-word"},dangerouslySetInnerHTML:{__html:(0,ad.X5)((0,ac.O)(n?.content?.payload||"")||"")},"data-sentry-element":"Typography","data-sentry-source-file":"CopyToQuizModalForm.tsx"})]}),(0,m.jsx)(M.xI,{render:({field:{value:e,onChange:t},fieldState:{invalid:n}})=>(0,m.jsx)(to.A,{loading:s,disabled:o,selectItems:r?.map(e=>({value:e.id,name:e.title}))||[],error:n,helperText:n?a("validation_required"):void 0,placeholder:a("select_quiz_placeholder"),value:e,handleValueChange:t}),name:"quiz_id",control:l,"data-sentry-element":"Controller","data-sentry-source-file":"CopyToQuizModalForm.tsx"})]}),(0,m.jsxs)(ax,{"data-sentry-element":"ModalFooter","data-sentry-source-file":"CopyToQuizModalForm.tsx",children:[(0,m.jsx)(eI.A,{variant:"tonal",color:"secondary",onClick:t,"data-sentry-element":"Button","data-sentry-source-file":"CopyToQuizModalForm.tsx",children:i("discard")}),(0,m.jsx)(eR.A,{loading:x,disabled:u||!p||c,variant:"contained",color:"primary",onClick:d,"data-sentry-element":"LoadingButton","data-sentry-source-file":"CopyToQuizModalForm.tsx",children:i("save")})]})]})})},a_=({children:e})=>(0,m.jsx)(nu.A,{display:"flex",flexDirection:"column","data-sentry-element":"Box","data-sentry-component":"AnswerList","data-sentry-source-file":"AnswerList.tsx",children:e}),ag=(0,y.memo)(({control:e,contentBlockIndex:t,index:n,onDelete:a})=>{let i=(0,f.A)(),{t:r}=(0,T.o)();return(0,m.jsxs)(eT.A,{display:"flex",gap:i.spacing(1),marginBottom:i.spacing(3),width:"100%",children:[(0,m.jsx)(eT.A,{alignItems:"center",bgcolor:(0,np.X4)(i.palette.primary.main,.2),borderRadius:"4px",display:"flex",gap:i.spacing(1),justifyContent:"center",paddingX:i.spacing(2),paddingY:i.spacing(1),children:(0,m.jsx)(eO.A,{color:i.palette.primary.main,variant:"h5",children:String.fromCharCode(n+65)})}),(0,m.jsx)(eT.A,{alignItems:"center",bgcolor:i.palette.background.paper,borderRadius:"4px",display:"flex",gap:i.spacing(3),justifyContent:"center",padding:i.spacing(3),width:"100%",children:(0,m.jsxs)(eT.A,{display:"flex",flexDirection:"column",gap:i.spacing(2),width:"100%",children:[(0,m.jsxs)(eT.A,{alignItems:"center",display:"flex",gap:i.spacing(3),width:"100%",children:[(0,m.jsx)(eO.A,{variant:"h6",flex:"1",children:r("PAGE.ANSWER_ROW.answer")}),(0,m.jsx)(M.xI,{control:e,name:`content_blocks.${t}.answers.${n}`,render:({field:{value:e,onChange:a}})=>(0,m.jsx)(eS.A,{"data-form-path":`content_blocks.${t}.answers.${n}.is_correct`,"data-element-type":"button","data-ai-field":`quetion block/field checkbox with index = ${n} with value boolean value type can be propagated with click`,label:r("PAGE.ANSWER_ROW.is_correct"),checked:e.is_correct,onChange:(t,n)=>a({title:e.title,order:e.order,is_correct:n}),control:(0,m.jsx)(ew.A,{})})}),(0,m.jsx)(e0.A,{"data-form-path":`content_blocks.${t}.answers.${n}`,"data-element-type":"button","data-ai-field":`Delete answer with index = ${n} for question with index = ${t}`,color:"error",onClick:a,children:(0,m.jsx)(eM.In,{fontSize:"18px",icon:"tabler:trash",color:"primary"})})]}),(0,m.jsx)(M.xI,{control:e,name:`content_blocks.${t}.answers.${n}
1`,render:({field:{value:e,onChange:a}})=>(0,m.jsx)(th.A,{"data-form-path":`content_blocks.${t}.answers.${n}.title`,"data-element-type":`Answer block/field rich text with index = ${n}`,"data-ai-field":`Answer block/field rich text with index = ${n}`,placeholder:r("ACTION.ENTITY.enter_answer"),value:e.title,onChange:t=>a({order:e.order,is_correct:e.is_correct,title:t})})})]})})]})}),aA=({control:e,index:t})=>{let n=(0,f.A)(),{t:a}=(0,T.o)(),{append:i,remove:r,fields:s,swap:o}=(0,M.jz)({control:e,name:`content_blocks.${t}.answers`});return(0,m.jsxs)(nu.A,{display:"flex",flexDirection:"column",gap:n.spacing(6),"data-sentry-element":"Box","data-sentry-component":"TextQuestion","data-sentry-source-file":"index.tsx",children:[(0,m.jsxs)(nu.A,{bgcolor:n.palette.background.paper,borderRadius:"8px",display:"flex",flexDirection:"column",gap:n.spacing(3),padding:n.spacing(3),"data-sentry-element":"Box","data-sentry-source-file":"index.tsx",children:[(0,m.jsx)(eO.A,{variant:"h6","data-sentry-element":"Typography","data-sentry-source-file":"index.tsx",children:a("PAGE.QUESTION_ROW.question")}),(0,m.jsx)(M.xI,{control:e,name:`content_blocks.${t}.content.payload`,render:({field:{value:e,onChange:n}})=>(0,m.jsx)(th.A,{"data-form-path":`content_blocks.${t}.content.payload`,"data-element-type":`Question block/field rich text with index ${t}`,"data-ai-field":`Question block/field rich text with index ${t}`,placeholder:a("ACTION.ENTITY.enter_text_question"),value:e,onChange:n}),"data-sentry-element":"Controller","data-sentry-source-file":"index.tsx"})]}),(0,m.jsxs)(nu.A,{display:"flex",flexDirection:"column",gap:n.spacing(3),"data-sentry-element":"Box","data-sentry-source-file":"index.tsx",children:[(0,m.jsx)(e1.JY,{onDragEnd:e=>{e.destination?.index&&o(e.source.index,e.destination?.index)},"data-sentry-element":"DragDropContext","data-sentry-source-file":"index.tsx",children:(0,m.jsx)(a_,{droppableId:(0,B.$)(),"data-sentry-element":"AnswerList","data-sentry-source-file":"index.tsx",children:s.map((n,a)=>(0,m.jsx)(ag,{answer:n,index:a,onDelete:()=>r(a),contentBlockIndex:t,control:e},n.id))})}),(0,m.jsx)(nu.A,{display:"flex",width:"100%","data-sentry-element":"Box","data-sentry-source-file":"index.tsx",children:(0,m.jsx)(eI.A,{sx:{marginLeft:"auto"},variant:"outlined",startIcon:(0,m.jsx)(eM.In,{icon:"tabler:plus"}),onClick:()=>i({title:"",order:s.length+1,is_correct:!1}),disabled:s.length>=8,"data-sentry-element":"Button","data-sentry-source-file":"index.tsx",children:a("ACTION.ENTITY.add_new_answer")})})]})]})},ab=(0,y.memo)(({question:e,index:t,control:n})=>{let a=(0,f.A)(),{t:i}=(0,T.o)(),{append:r,remove:s,fields:o,swap:l}=(0,M.jz)({control:n,name:`content_blocks.${t}.answers`}),d=(0,M.FH)({control:n,name:`content_blocks.${t}.content.file_id`}),{data:c}=tg(d);return(0,m.jsxs)(eT.A,{display:"flex",flexDirection:"column",gap:a.spacing(6),"data-sentry-element":"Box","data-sentry-component":"VideoQuestion","data-sentry-source-file":"index.tsx",children:[(0,m.jsx)(M.xI,{control:n,name:`content_blocks.${t}`,render:({field:{value:e,onChange:t}})=>(0,m.jsx)(eT.A,{position:"relative",children:(e?.type_id===4||e?.type_id===8)&&(0,m.jsxs)(m.Fragment,{children:[!e.content.link&&(0,m.jsx)(tL,{fileId:d}),(0,m.jsx)(tb.A,{existingVideoId:e?.content?.file_id,existingSource:e?.content?.link,formSetterFn:({id:n,url:a})=>t({...e,content:{file_id:n,link:a}})},`${d}_${c?.preview_file_id||"default"}_${c?.preview_link||""}`)]})}),"data-sentry-element":"Controller","data-sentry-source-file":"index.tsx"}),(0,m.jsxs)(eT.A,{display:"flex",flexDirection:"column",gap:a.spacing(3),"data-sentry-element":"Box","data-sentry-source-file":"index.tsx",children:[(0,m.jsx)(e1.JY,{onDragEnd:e=>{e.destination?.index&&l(e.source.index,e.destination?.index)},"data-sentry-element":"DragDropContext","data-sentry-source-file":"index.tsx",children:(0,m.jsx)(a_,{droppableId:String(e?.id),"data-sentry-element":"AnswerList","data-sentry-source-file":"index.tsx",children:o.map((e,a)=>e&&(0,m.jsx)(ag,{answer:e,index:a,onDelete:()=>s(a),contentBlockIndex:t,control:n},e.id))})}),(0,m.jsx)(eT.A,{display:"flex",width:"100%","data-sentry-element":"Box","data-sentry-source-file":"index.tsx",children:(0,m.jsx)(eI.A,{s
1x:{marginLeft:"auto"},variant:"outlined",startIcon:(0,m.jsx)(eM.In,{icon:"tabler:plus"}),onClick:()=>r({title:"",order:o.length+1,is_correct:!1}),disabled:o.length>=8,"data-sentry-element":"Button","data-sentry-source-file":"index.tsx",children:i("ACTION.ENTITY.add_new_answer")})})]})]})}),aC=({control:e,index:t})=>{let n=(0,f.A)(),{t:a}=(0,T.o)(),{t:i}=(0,T.o)("translation",{keyPrefix:"PAGE.LESSON_DETAIL.LESSON_CONTENT"}),{append:r,remove:s,fields:o,swap:l}=(0,M.jz)({control:e,name:`content_blocks.${t}.answers`}),d=(0,M.FH)({control:e,name:`content_blocks.${t}`}),c=(0,y.useMemo)(()=>d?.content&&"audio_id"in d.content&&!!d.content.audio_id,[d?.content]);return(0,m.jsxs)(eT.A,{display:"flex",flexDirection:"column",gap:n.spacing(4),"data-sentry-element":"Box","data-sentry-component":"AudioQuestion","data-sentry-source-file":"index.tsx",children:[(0,m.jsxs)(h.A,{gap:n.spacing(3),"data-sentry-element":"Stack","data-sentry-source-file":"index.tsx",children:[(0,m.jsx)(M.xI,{control:e,name:`content_blocks.${t}`,render:({field:{value:e,onChange:t}})=>(0,m.jsx)(m.Fragment,{children:(5===e.type_id||9===e.type_id)&&(0,m.jsx)(tr.Ay,{additionalAudioText:e?.content?.audio_additional_text??"",existingAudioId:e?.content?.audio_id,formSetterFn:n=>{t({...e,content:{...e.content,audio_id:n}})}})}),"data-sentry-element":"Controller","data-sentry-source-file":"index.tsx"}),c&&(0,m.jsx)(M.xI,{control:e,name:`content_blocks.${t}.content.audio_additional_text`,render:({field:{onChange:e,value:t}})=>(0,m.jsx)(eq.XY,{multiline:!0,fullWidth:!0,rows:2,onChange:e,value:t,placeholder:i("description_text_placeholder"),label:i("description_text_label")})})]}),(0,m.jsxs)(eT.A,{display:"flex",flexDirection:"column",gap:n.spacing(3),"data-sentry-element":"Box","data-sentry-source-file":"index.tsx",children:[(0,m.jsx)(e1.JY,{onDragEnd:e=>{e.destination?.index&&l(e.source.index,e.destination?.index)},"data-sentry-element":"DragDropContext","data-sentry-source-file":"index.tsx",children:(0,m.jsx)(a_,{droppableId:(0,B.$)(),"data-sentry-element":"AnswerList","data-sentry-source-file":"index.tsx",children:o.map((n,a)=>(0,m.jsx)(ag,{answer:n,index:a,onDelete:()=>s(a),contentBlockIndex:t,control:e},n.id))})}),(0,m.jsx)(eT.A,{display:"flex",width:"100%","data-sentry-element":"Box","data-sentry-source-file":"index.tsx",children:(0,m.jsx)(eI.A,{sx:{marginLeft:"auto"},variant:"outlined",startIcon:(0,m.jsx)(eM.In,{icon:"tabler:plus"}),onClick:()=>r({title:"",order:o.length+1,is_correct:!1}),disabled:o.length>=8,"data-sentry-element":"Button","data-sentry-source-file":"index.tsx",children:a("ACTION.ENTITY.add_new_answer")})})]})]})},aj=(0,y.memo)(({control:e,index:t,question:n,onDelete:a,onDuplicate:i,dragId:r})=>{let{t:s}=(0,T.o)("translation",{keyPrefix:"PAGE.QUIZ_CONTENT"}),o=(0,f.A)(),[l,d]=(0,y.useState)(!n?.id),{close:c,open:u,isOpen:p}=(0,tt.A)(),x=n&&n.content&&"file_id"in n.content?n.content.file_id:null,h=(0,y.useMemo)(()=>{switch((0,Q.oE)(n?.type_id)){case"Text":return n?.content?.payload?(0,as.QZ)(n?.content?.payload).result.replace("Powered by Froala Editor",""):s("text_question");case"Video":return s("video_question");case"Audio":return s("audio_question");default:return""}},[n,s]),{data:g}=(0,_.I)({queryKey:I.Ay.files.detail([x]).queryKey,queryFn:()=>ti.A.getFile({search_by:[{attribute:"file_id",operator:"==",value:x}]}),select:e=>e.data.result[0],enabled:!!(x&&n?.type_id===8)});return n?(0,m.jsx)(e1.sx,{draggableId:r,index:t,children:r=>(0,m.jsxs)(eT.A,{bgcolor:(0,np.X4)(o.palette.secondary.light,.08),borderRadius:"6px",display:"flex",gap:o.spacing(1),marginBottom:o.spacing(2),padding:o.spacing(4),paddingLeft:o.spacing(1),ref:r.innerRef,...r.draggableProps,children:[(0,m.jsx)(eT.A,{children:(0,m.jsx)(e0.A,{size:"small",...r.dragHandleProps,children:(0,m.jsx)(eM.In,{color:o.palette.primary.main,icon:"tabler:grip-vertical"})})}),(0,m.jsxs)(eT.A,{display:"flex",flexDirection:"column",gap:l?o.spacing(3):0,flex:1,children:[(0,m.jsxs)(eT.A,{alignItems:"center",display:"flex",gap:o.spacing(3),width:"100%",justifyContent:"space-between",children:[(0,m.jsxs)(eT.A,{display:"flex",flexDirection:"row",gap:o.spacing(1),children:[(0,m.jsxs)(eO.A,{variant:"h5",children:[h,8===Number(n?.type_id
1)?":":""]}),g?.title&&(0,m.jsx)(eO.A,{variant:"h5",color:o.palette.primary["400"],children:g?.title})]}),(0,m.jsxs)(eT.A,{children:[(0,m.jsx)(t_.A,{arrow:!0,title:s("copy_to_quiz"),children:(0,m.jsx)(e0.A,{"data-form-path":`content_blocks.${t}.content.copy_to_quiz`,"data-element-type":"button","data-ai-field":`Click Copy to Quiz content block/field with index ${t} and type ${Q.k0[n.type_id]}`,onClick:u,children:(0,m.jsx)(eM.In,{fontSize:"18px",icon:"tabler:file-arrow-left"})})}),(0,m.jsx)(t_.A,{arrow:!0,title:s("duplicate_question"),children:(0,m.jsx)(e0.A,{onClick:i,children:(0,m.jsx)(eM.In,{fontSize:"18px",icon:"tabler:copy"})})}),(0,m.jsx)(t_.A,{arrow:!0,title:s("delete_question"),children:(0,m.jsx)(e0.A,{"data-form-path":`content_blocks.${t}.content.remove`,"data-element-type":"button","data-ai-field":`Click Delete/remove content block/field with index ${t} and type ${Q.k0[n.type_id]}`,color:"error",onClick:a,children:(0,m.jsx)(eM.In,{fontSize:"18px",icon:"tabler:trash"})})}),(0,m.jsx)(e0.A,{"data-form-path":`content_blocks.${t}.content.row_collapse`,"data-element-type":"button","data-ai-field":`Click collapse for content block / question block with index ${t} and type type ${Q.k0[n.type_id]}`,onClick:()=>d(!l),children:(0,m.jsx)(eM.In,{fontSize:"18px",icon:"tabler:chevron-down",color:"primary",style:{transform:l?"rotate(-180deg)":"rotate(0deg)",transition:"transform 150ms ease-out"}})})]})]}),(0,m.jsxs)(e9.A,{in:l,children:[n.type_id===Q.Q5.Text&&(0,m.jsx)(aA,{control:e,index:t}),n.type_id===Q.Q5.Video&&(0,m.jsx)(ab,{control:e,question:n,index:t}),n.type_id===Q.Q5.Audio&&(0,m.jsx)(aC,{control:e,index:t})]})]}),(0,m.jsx)(af,{question:n,isOpen:p,onClose:c})]})},r):null}),av=(0,eV.Ay)(eT.A)(({theme:e})=>({display:"flex",flexDirection:"column",gap:e.spacing(8),[e.breakpoints.down("md")]:{paddingBottom:70}})),ak=(0,eV.Ay)(eT.A)(({theme:e})=>({display:"flex",gap:e.spacing(4),[e.breakpoints.down("md")]:{flexDirection:"column"}})),aT=(0,y.memo)(({control:e,getValues:t,watch:n,setValue:a})=>{let{t:i}=(0,T.o)("translation",{keyPrefix:"PAGE.QUIZ_CONTENT"}),{append:r,remove:s,fields:o}=(0,M.jz)({control:e,name:"content_blocks"}),l=n("content_blocks"),d=(0,n9.A)(),{notify:c}=(0,$.A)();return(0,m.jsx)(av,{"data-sentry-element":"Container","data-sentry-component":"QuizContent","data-sentry-source-file":"QuizContent.tsx",children:(0,m.jsxs)(e1.JY,{onDragEnd:e=>{if(!e.destination)return;let n=e.source.index,i=e.destination.index;if(n===i)return;let r=[...t("content_blocks")],[s]=r.splice(n,1);r.splice(i,0,s),r.forEach((e,t)=>{e.order=t+1}),a("content_blocks",r)},"data-sentry-element":"DragDropContext","data-sentry-source-file":"QuizContent.tsx",children:[(0,m.jsx)(ae,{"data-sentry-element":"QuestionList","data-sentry-source-file":"QuizContent.tsx",children:l.map((t,n)=>t&&(0,m.jsx)(aj,{"data-form-path":`content_blocks.${n}`,"data-element-type":"content block","data-ai-field":`edit Quiz question block/field with index ${n+1} with type ${Q.k0[t.type_id]}`,control:e,dragId:t.dragId,question:t,index:n,onDelete:()=>s(n),onDuplicate:()=>{c("QUIZ.duplicate"),r({...t,id:void 0})}},t.id?.toString()||(0,B.$)()))}),(0,m.jsx)(h.A,{gap:d.spacing(4),"data-sentry-element":"Stack","data-sentry-source-file":"QuizContent.tsx",children:(0,m.jsxs)(ak,{"data-sentry-element":"ContentActions","data-sentry-source-file":"QuizContent.tsx",children:[(0,m.jsx)(an,{"data-form-path":"add_text_question","data-element-type":"button","data-ai-field":"Add text question block/field button click",onClick:()=>r({type_id:Q.Q5.Text,content:{payload:""},order:o.length,dragId:(0,B.$)()}),title:i("add_text_q_title"),subTitle:i("add_text_q_subtitle"),icon:(0,m.jsx)(ar,{}),"data-sentry-element":"ContentAdditionButton","data-sentry-source-file":"QuizContent.tsx"}),(0,m.jsx)(an,{"data-form-path":"add_video_question","data-element-type":"button","data-ai-field":"Add video question block/field button click",onClick:()=>r({type_id:Q.Q5.Video,content:{file_id:"",link:""},order:o.length,dragId:(0,B.$)()}),title:i("add_video_q_title"),subTitle:i("add_video_q_subtitle"),icon:(0,m.jsx)(aa,{}),"data-sentry-element":"ContentAdditionButton","data-sentry-source-file":"QuizContent.tsx"}),(0,m.jsx)(an,{"data-form-path":"add_audio_question","data-element-type":"button","data-ai-field":"Add audio question block/field button click",onClick:()=>
1r({type_id:Q.Q5.Audio,content:{audio_id:"",audio_additional_text:""},order:o.length,dragId:(0,B.$)()}),title:i("add_audio_q_title"),subTitle:i("add_audio_q_subtitle"),icon:(0,m.jsx)(ai,{}),"data-sentry-element":"ContentAdditionButton","data-sentry-source-file":"QuizContent.tsx"})]})})]})})}),aI=({control:e})=>{let t=(0,f.A)(),{t:n}=(0,T.o)("translation",{keyPrefix:"PAGE.QUIZ_SETTINGS"});return(0,m.jsxs)(eT.A,{display:"flex",flexDirection:"column",gap:t.spacing(6),paddingBottom:{xs:20,md:0},"data-sentry-element":"Box","data-sentry-component":"QuizSettings","data-sentry-source-file":"QuizSettings.tsx",children:[(0,m.jsxs)(eT.A,{display:"flex",flexDirection:"column",gap:t.spacing(4),"data-sentry-element":"Box","data-sentry-source-file":"QuizSettings.tsx",children:[(0,m.jsx)(eT.A,{display:"flex",flexDirection:"column",gap:t.spacing(4),"data-sentry-element":"Box","data-sentry-source-file":"QuizSettings.tsx",children:(0,m.jsx)(eO.A,{variant:"h5","data-sentry-element":"Typography","data-sentry-source-file":"QuizSettings.tsx",children:n("PASS_REQUIREMENT.label")})}),(0,m.jsxs)(eT.A,{alignItems:"center",display:"flex",gap:t.spacing(4),"data-sentry-element":"Box","data-sentry-source-file":"QuizSettings.tsx",children:[(0,m.jsx)(eO.A,{variant:"body1","data-sentry-element":"Typography","data-sentry-source-file":"QuizSettings.tsx",children:n("PASS_REQUIREMENT.desc")}),(0,m.jsx)(M.xI,{name:"quiz_options.grade.grade_after_percents",control:e,rules:{required:!0},render:({field:{value:e,onChange:n},formState:{errors:a}})=>(0,m.jsx)(eq.Ay,{"data-form-path":"quiz_options.grade.grade_after_percents","data-element-type":"input","data-ai-field":"Quiz grade after percents with number value type",value:e,InputProps:{endAdornment:(0,m.jsx)(eT.A,{alignItems:"center",display:"flex",paddingX:"10px",paddingY:t.spacing(1),children:"%"})},sx:{"& .MuiInputBase-root":{padding:0,maxWidth:"150px"},"& input":{borderRight:"1px solid",borderColor:t.palette.divider,"&:focus":{transition:"all 100ms ease-in-out",borderColor:t.palette.primary.main}}},onChange:n,error:!!a.quiz_options?.grade,...a.quiz_options?.grade&&{helperText:a.quiz_options?.grade?.grade_after_percents?.message}}),"data-sentry-element":"Controller","data-sentry-source-file":"QuizSettings.tsx"})]})]}),(0,m.jsxs)(eT.A,{display:"flex",flexDirection:"column",gap:t.spacing(4),"data-sentry-element":"Box","data-sentry-source-file":"QuizSettings.tsx",children:[(0,m.jsx)(eO.A,{variant:"h5","data-sentry-element":"Typography","data-sentry-source-file":"QuizSettings.tsx",children:n("RANDOMIZE.label")}),(0,m.jsxs)(eT.A,{display:"flex",flexDirection:"column",gap:t.spacing(3),"data-sentry-element":"Box","data-sentry-source-file":"QuizSettings.tsx",children:[(0,m.jsx)(M.xI,{name:"quiz_options.randomize.questions",control:e,rules:{required:!0},render:({field:{value:e,onChange:t},formState:{errors:a}})=>(0,m.jsx)(eS.A,{"data-form-path":"quiz_options.randomize.questions","data-element-type":"button","data-ai-field":"Randomize questions button click checkbox",onChange:t,checked:e,...a.quiz_options?.randomize?.questions&&{helperText:a.quiz_options?.randomize?.questions.message},control:(0,m.jsx)(ew.A,{sx:{paddingY:0}}),label:n("RANDOMIZE.questions")}),"data-sentry-element":"Controller","data-sentry-source-file":"QuizSettings.tsx"}),(0,m.jsx)(M.xI,{name:"quiz_options.randomize.answers",control:e,rules:{required:!0},render:({field:{value:e,onChange:t},formState:{errors:a}})=>(0,m.jsx)(eS.A,{"data-form-path":"quiz_options.randomize.answers","data-element-type":"button","data-ai-field":"Randomize answers button click checkbox",onChange:t,checked:e,...a.quiz_options?.randomize?.answers&&{helperText:a.quiz_options?.randomize?.answers.message},control:(0,m.jsx)(ew.A,{sx:{paddingY:0}}),label:n("RANDOMIZE.answers")}),"data-sentry-element":"Controller","data-sentry-source-file":"QuizSettings.tsx"})]})]}),(0,m.jsxs)(eT.A,{display:"flex",flexDirection:"column",gap:t.spacing(4),"data-sentry-element":"Box","data-sentry-source-file":"QuizSettings.tsx",children:[(0,m.jsx)(eO.A,{variant:"h5","data-sentry-element":"Typography","data-sentry-source-file":"QuizSettings.tsx",children:n("REDO.label")}),(0,m.jsx)(eT.A,{display:"flex",flexDirection:"column",gap:t.spacing(3),"data-sentry-element":"Box","data-sentry-source-file":"QuizSettings.tsx",children:(0,m.jsx)(M.xI,{name:"quiz_options.redo.redo_type_id",control:e,rules:{required:!0},render:({field:{value:a,onChange:i},formState:{errors:r}})=>(0,m.jsxs)(eN.A,{onChange:i,value:a,...r.quiz_options?.redo&&{helperText:r.quiz_options?.redo?.redo_type_id?.message},children:[(0,m.jsx)(eS.A,{"data-form-path":"quiz_options.redo.redo_type_id_1","data-element-type":"button","data-ai-field":"Set redo type to Can be redone button click radio button",value:en.Eb.CAN_BE_REDONE,control:(0,m.jsx)(eL.A,{}),label:(0,m.jsxs)(eT.A,{alignItems:{xs:"start",md:"center"},display:"flex",gap:t.spacing(4),flexDirection:{xs:"column",md:"row"},children:[(0,m.jsx)(eO.A,{children:n("REDO.desc")}),(0,m.jsx)(M.xI,{name:"quiz_options.redo.redo_after_hours",control:e,rules:{required:!0}
1,render:({field:{value:e,onChange:a},formState:{errors:i}})=>(0,m.jsx)(eq.Ay,{"data-form-path":"quiz_options.redo.redo_after_hours","data-element-type":"input","data-ai-field":"Redo after hours input with number value type",onChange:a,value:e,error:!!i.quiz_options?.redo,...i.quiz_options?.redo&&{helperText:i.quiz_options?.redo?.redo_after_hours?.message},type:"number",sx:{"& .MuiInputBase-root":{padding:0},"& input":{borderRight:"1px solid",borderColor:t.palette.divider,"&:focus":{transition:"all 100ms ease-in-out",borderColor:t.palette.primary.main}}},InputProps:{endAdornment:(0,m.jsx)(eT.A,{alignItems:"center",display:"flex",paddingX:"10px",paddingY:t.spacing(1),children:n("MISC.hours")})}})})]})}),(0,m.jsx)(eS.A,{"data-form-path":"quiz_options.redo.redo_type_id_2","data-element-type":"button","data-ai-field":"Set redo type to Can not be redone button click radio button",value:en.Eb.CAN_NOT_BE_REDONE,control:(0,m.jsx)(eL.A,{}),label:n("REDO.restricted")})]}),"data-sentry-element":"Controller","data-sentry-source-file":"QuizSettings.tsx"})})]}),(0,m.jsxs)(eT.A,{display:"flex",flexDirection:"column",gap:t.spacing(4),"data-sentry-element":"Box","data-sentry-source-file":"QuizSettings.tsx",children:[(0,m.jsx)(eO.A,{variant:"h5","data-sentry-element":"Typography","data-sentry-source-file":"QuizSettings.tsx",children:n("CORRECT_ANSWER.label")}),(0,m.jsx)(M.xI,{name:"quiz_options.hide_answers_hint",control:e,rules:{required:!0},render:({field:{value:e,onChange:t},formState:{errors:a}})=>(0,m.jsx)(eS.A,{"data-form-path":"quiz_options.hide_answers_hint","data-element-type":"button","data-ai-field":"Show/hide correct answers hint button click switch",onChange:t,checked:e,...a.quiz_options?.hide_answers_hint&&{helperText:a.quiz_options?.hide_answers_hint.message},control:(0,m.jsx)(tM.A,{}),label:n("CORRECT_ANSWER.number")}),"data-sentry-element":"Controller","data-sentry-source-file":"QuizSettings.tsx"})]}),(0,m.jsxs)(eT.A,{display:"flex",flexDirection:"column",gap:t.spacing(4),"data-sentry-element":"Box","data-sentry-source-file":"QuizSettings.tsx",children:[(0,m.jsx)(eO.A,{variant:"h5","data-sentry-element":"Typography","data-sentry-source-file":"QuizSettings.tsx",children:n("CORRECT_ANSWER.show_correct_answers")}),(0,m.jsx)(eT.A,{display:"flex",flexDirection:"column","data-sentry-element":"Box","data-sentry-source-file":"QuizSettings.tsx",children:(0,m.jsx)(M.xI,{name:"quiz_options.correct_answer.show_type_id",control:e,rules:{required:!0},render:({field:{value:e,onChange:t},formState:{errors:a}})=>(0,m.jsxs)(eN.A,{onChange:t,value:e,...a.quiz_options?.correct_answer?.show_type_id&&{helperText:a.quiz_options?.correct_answer?.show_type_id?.message},children:[(0,m.jsx)(eS.A,{"data-form-path":"quiz_options.correct_answer.show_type_id_1","data-element-type":"button","data-ai-field":"Set correct answer show type to Never Show Correct Answer button click radio button",value:en.Br.NEVER_SHOW_CORRECT_ANSWER,control:(0,m.jsx)(eL.A,{}),label:n("CORRECT_ANSWER.never")}),(0,m.jsx)(eS.A,{"data-form-path":"quiz_options.correct_answer.show_type_id_2","data-element-type":"button","data-ai-field":"Set correct answer show type to Show Correct Answer After Each Question button click radio button",value:en.Br.SHOW_CORRECT_ANSWER_AFTER_EACH_QUESTION_AND_AT_END,control:(0,m.jsx)(eL.A,{}),label:n("CORRECT_ANSWER.always")}),(0,m.jsx)(eS.A,{"data-form-path":"quiz_options.correct_answer.show_type_id_3","data-element-type":"button","data-ai-field":"Set correct answer show type to Show Correct Answer At End button click radio button",value:en.Br.SHOW_CORRECT_ANSWER_AT_END,control:(0,m.jsx)(eL.A,{}),label:n("CORRECT_ANSWER.end")}),(0,m.jsx)(eS.A,{"data-form-path":"quiz_options.correct_answer.show_type_id_4","data-element-type":"button","data-ai-field":"Set correct answer show type to Show Correct Answer At End If Quiz Passed button click radio button",value:en.Br.SHOW_CORRECT_ANSWER_AT_END_IF_QUIZ_PASSED,control:(0,m.jsx)(eL.A,{}),label:n("CORRECT_ANSWER.end_if_passed")})]}),"data-sentry-element":"Controller","data-sentry-source-file":"QuizSettings.tsx"})})]}),(0,m.jsxs)(eT.A,{display:"flex",flexDirection:"column",gap:t.spacing(4),"data-sentry-element":"Box","data-sentry-source-file":"QuizSettings.tsx",children:[(0,m.jsx)(eO.A,{variant:"h5","data-sentry-element":"Typography","data-sentry-source-file":"QuizSettings.tsx",children:n("LOCK.label")}),(0,m.jsx)(eT.A,{display:"flex",flexDirection:"column","data-sentry-element":"Box","data-sentry-source-file":"QuizSettings.tsx",children:(0,m.jsx)(M.xI,{name:"quiz_options.lock_type_id",control:e,rules:{required:!0}
1,render:({field:{value:e,onChange:t},formState:{errors:a}})=>(0,m.jsxs)(eN.A,{onChange:t,value:e,...a.quiz_options?.lock_type_id&&{helperText:a.quiz_options?.lock_type_id.message},children:[(0,m.jsx)(eS.A,{"data-form-path":"quiz_options.lock_type_id_1","data-element-type":"button","data-ai-field":"Set 'don't lock anything after the quiz' button click radio button",value:en.yv.NOTHING,control:(0,m.jsx)(eL.A,{}),label:n("LOCK.never")}),(0,m.jsx)(eS.A,{"data-form-path":"quiz_options.lock_type_id_2","data-element-type":"button","data-ai-field":"Set 'Lock lessons - after this quiz in this module unless the quiz is passed' button click radio button",value:en.yv.LESSON_ONLY,control:(0,m.jsx)(eL.A,{}),label:n("LOCK.lessons")}),(0,m.jsx)(eS.A,{"data-form-path":"quiz_options.lock_type_id_3","data-element-type":"button","data-ai-field":"Set 'Lock modules - after this quiz in this module unless the quiz is passed' button click radio button",value:en.yv.MODULES_LESSONS,control:(0,m.jsx)(eL.A,{}),label:n("LOCK.lessons_and_modules")})]}),"data-sentry-element":"Controller","data-sentry-source-file":"QuizSettings.tsx"})})]})]})},aw=({control:e})=>{let t=(0,f.A)(),{t:n}=(0,T.o)();return(0,m.jsxs)(nu.A,{display:"flex",flexDirection:"column",gap:t.spacing(8),paddingBottom:{xs:10,md:0},"data-sentry-element":"Box","data-sentry-component":"QuizInformation","data-sentry-source-file":"QuizInformation.tsx",children:[(0,m.jsx)(M.xI,{name:"title",control:e,rules:{required:!0},render:({field:{value:e,onChange:a},fieldState:{error:i}})=>(0,m.jsx)(eq.Ay,{"data-form-path":"title","data-element-type":"text field","data-ai-field":"Quiz title",helperText:(0,m.jsxs)(h.A,{spacing:t.spacing(2),children:[i&&(0,m.jsx)(nG.A,{error:!0,children:i?.message}),(0,m.jsx)(nG.A,{error:e?.length>100,children:`${e?.length??0} / 100`})]}),label:n("PAGE.QUIZ_SETTINGS.TITLE.label"),fullWidth:!0,placeholder:n("FORM.placeholder"),value:e,InputProps:{sx:{width:"100%"}},sx:{flex:1},onChange:a,error:!!i}),"data-sentry-element":"Controller","data-sentry-source-file":"QuizInformation.tsx"}),(0,m.jsxs)(nu.A,{display:"flex",flexDirection:"column",gap:t.spacing(1),"data-sentry-element":"Box","data-sentry-source-file":"QuizInformation.tsx",children:[(0,m.jsx)(eO.A,{variant:"body2","data-sentry-element":"Typography","data-sentry-source-file":"QuizInformation.tsx",children:n("PAGE_ELEMENT.cover_image")}),(0,m.jsx)(M.xI,{control:e,name:"image_id",render:({field:{value:e,onChange:t}})=>(0,m.jsx)(tk.A,{existingImageId:e||"",formSetterFn:t}),"data-sentry-element":"Controller","data-sentry-source-file":"QuizInformation.tsx"})]})]})},aS=({control:e,currentCourse:t,currentLesson:n,currentModule:a})=>{let i=(0,f.A)(),{t:r}=(0,T.o)(),s=(0,x.useRouter)(),[o,l]=(0,y.useState)(!0),{deleteLessonOnDetailsPage:d,copyLesson:c}=(0,ez.A)({moduleId:0,type:1,triggerId:0,lesson:{},triggered:!1,currentCourse:t,currentModule:a,currentLesson:n}),{currentUrl:u,copyUrl:p}=(e=>{let{user:t}=(0,eD.A)(),n=(0,y.useMemo)(()=>(t?.portal?.domain||window.location.hostname)+"/customer/dashboard?lesson_public="+e,[t,e]),{notify:a}=(0,$.A)(),i=async()=>{try{await navigator.clipboard.writeText(n),a("QUIZ.link_copy",{type:"success"})}catch{a("clipboard_copy",{type:"error"})}};return{currentUrl:n,copyUrl:i}})(n?.public_key||""),h=async e=>{await (0,eQ.m)(e,c.copy)};return(0,m.jsxs)(eT.A,{display:"flex",flexDirection:"column",gap:i.spacing(8),paddingBottom:{xs:20,md:0},"data-sentry-element":"Box","data-sentry-component":"QuizAdjustment","data-sentry-source-file":"QuizAdjustment.tsx",children:[(0,m.jsx)(eB.A,{isOpen:c.isModalOpen,onClose:c.closeModal,onCancel:c.closeModal,onSubmit:h,lessonId:Number(s.query.lesson_id),"data-sentry-element":"CopyLessonModal","data-sentry-source-file":"QuizAdjustment.tsx"}),(0,m.jsx)(e$.A,{isOpen:d.isConfirmationWindowOpen,entityType:"quiz",confirmWord:"DELETE",onClose:d.denyConfirmation,onCancel:d.denyConfirmation,onDelete:d.handleDelete,"data-sentry-element":"DeleteConfirmationModal","data-sentry-source-file":"QuizAdjustment.tsx"}),(0,m.jsxs)(eT.A,{display:"flex",flexDirection:"column",gap:i.spacing(3),"data-sentry-element":"Box","data-sentry-source-file":"QuizAdjustment.tsx",children:[(0,m.jsxs)(eT.A,{display:"flex",flexDirection:"column",gap:i.spacing(1),"data-sentry-element":"Box","data-sentry-source-file":"QuizAdjustment.tsx",children:[(0,m.jsx)(eO.A,{variant:"h5","data-sentry-element":"Typography","data-sentry-source-file":"QuizAdjustment.tsx",children:r("ACTION.ENTITY.quiz_link")}),(0,m.jsx)(eO.A,{variant:"body1",color:"text.disabled","data-sentry-element":"Typography","data-sentry-source-file":"QuizAdjustment.tsx",children:r("ACTION.ENTITY.quiz_link_hint")})]}),(0,m.jsx)(eq.Ay,{disabled:!0,value:u,sx:{width:"100%","& .MuiFilledInput-root":{backgroundColor:`${i.palette.background.paper} !important`}},InputProps:{sx:{paddingRight:0},endAdornment:(0,m.jsx)(eI.A,{onClick:p,sx:{width:"120px",borderRadius:"0 5px 5px 0",margin:"-1px",marginBottom:"-1px",marginTop:"-1px",height:"100%"},variant:"outlined",children:r("ACTION.ENTITY.copy_link")})},fullWidth:!0,"data-sentry-element":"CustomTextField","data-sentry-source-file":"QuizAdjustment.tsx"})]}),(0,m.jsxs)(eT.A,{display:"flex",flexDirection:"column",gap:i.spacing(3),"data-sentry-element":"Box","data-sentry-source-file":"QuizAdjustment.tsx",children:[(0,m.jsxs)(eT.A,{display:"flex",flexDirection:"column",gap:i.spacing(1),"data-sentry-element":"Box","data-sentry-source-file":"QuizAdjustment.tsx",children:[(0,m.jsx)(eO.A,{variant:"h5","data-sentry-element":"Typography","data-sentry-source-file":"QuizAdjustment.tsx",children:r("extracted.access_settings")}),(0,m.jsx)(eO.A,{variant:"body1",color:"text.disabled","data-sentry-element":"Typography","data-sentry-source-file":"QuizAdjustment.tsx",children:r("ACTION.ENTITY.quiz_access_setting_hint")})]}),(0,m.jsx)(M.xI,{name:"available_at",control:e,rules:{required:!0}
1,render:({field:{value:e,onChange:t},formState:{errors:n}})=>(0,m.jsx)(eq.Ay,{"data-form-path":"available_at","data-element-type":"number field","data-ai-field":"Days until quiz unlock field with number value",label:r("ACTION.ENTITY.access_in_days"),placeholder:r("ACTION.ENTITY.access_in_days"),helperText:r("PAGE.LESSON_SETTINGS.days_to_unlock_desc"),type:"number",value:e,onChange:e=>t(e.target.value),fullWidth:!0,error:!!n.available_at,...n.available_at&&{helperText:n.available_at.message}}),"data-sentry-element":"Controller","data-sentry-source-file":"QuizAdjustment.tsx"})]}),(0,m.jsxs)(eT.A,{display:"flex",flexDirection:"column",gap:i.spacing(3),"data-sentry-element":"Box","data-sentry-source-file":"QuizAdjustment.tsx",children:[(0,m.jsxs)(eT.A,{display:"flex",flexDirection:"column",gap:i.spacing(1),"data-sentry-element":"Box","data-sentry-source-file":"QuizAdjustment.tsx",children:[(0,m.jsx)(eO.A,{variant:"h5","data-sentry-element":"Typography","data-sentry-source-file":"QuizAdjustment.tsx",children:r("ACTION.ENTITY.duplicate_quiz")}),(0,m.jsx)(eO.A,{variant:"body1",color:"text.disabled","data-sentry-element":"Typography","data-sentry-source-file":"QuizAdjustment.tsx",children:r("ACTION.ENTITY.duplicate_quiz_module_hint")})]}),(0,m.jsxs)(eT.A,{display:"flex",gap:i.spacing(2),paddingY:i.spacing(2),flexDirection:{xs:"column",md:"row"},"data-sentry-element":"Box","data-sentry-source-file":"QuizAdjustment.tsx",children:[(0,m.jsx)(eP.f,{action:eK.Qi.EDIT_ANY_COURSE,"data-sentry-element":"TeamMemberGuard","data-sentry-source-file":"QuizAdjustment.tsx",children:(0,m.jsx)(eI.A,{"data-form-path":"clone_quiz","data-element-type":"button","data-ai-field":"Clone/duplicate quiz on click",variant:"outlined",startIcon:(0,m.jsx)(eM.In,{icon:"tabler:copy"}),onClick:()=>c.copy({is_duplicate:!0,lesson_id:Number(s.query.lesson_id),copy_to:[{module_id:Number(s.query.module_id)}]},""),"data-sentry-element":"Button","data-sentry-source-file":"QuizAdjustment.tsx",children:r("ACTION.clone")})}),(0,m.jsx)(eP.f,{action:eK.Qi.EDIT_ANY_COURSE,"data-sentry-element":"TeamMemberGuard","data-sentry-source-file":"QuizAdjustment.tsx",children:(0,m.jsx)(eI.A,{"data-form-path":"clone_lesson_to","data-element-type":"button","data-ai-field":"Clone/duplicate quiz to selected module on click",variant:"outlined",startIcon:(0,m.jsx)(eM.In,{icon:"tabler:copy"}),onClick:c.openModal,"data-sentry-element":"Button","data-sentry-source-file":"QuizAdjustment.tsx",children:r("ACTION.duplicate_to")})})]})]}),(0,m.jsx)(eT.A,{display:"flex",flexDirection:"column",gap:i.spacing(4),"data-sentry-element":"Box","data-sentry-source-file":"QuizAdjustment.tsx",children:(0,m.jsxs)(eT.A,{display:"flex",flexDirection:"column",gap:i.spacing(4),"data-sentry-element":"Box","data-sentry-source-file":"QuizAdjustment.tsx",children:[(0,m.jsx)(eO.A,{variant:"h5","data-sentry-element":"Typography","data-sentry-source-file":"QuizAdjustment.tsx",children:r("ACTION.ENTITY.delete_quiz")}),(0,m.jsx)(ek.A,{icon:!1,severity:"warning","data-sentry-element":"Alert","data-sentry-source-file":"QuizAdjustment.tsx",children:r("ACTION.ENTITY.delete_quiz_hint")}),(0,m.jsx)(eE.A,{row:!0,"data-sentry-element":"FormGroup","data-sentry-source-file":"QuizAdjustment.tsx",children:(0,m.jsx)(eS.A,{"data-form-path":"delete_quiz_check","data-element-type":"button","data-ai-field":"confirm checkbox for delete quiz",label:r("ACTION.ENTITY.delete_quiz_confirm"),control:(0,m.jsx)(ew.A,{onChange:e=>l(!e.target.checked),name:""}),"data-sentry-element":"FormControlLabel","data-sentry-source-file":"QuizAdjustment.tsx"})}),(0,m.jsx)(eT.A,{"data-sentry-element":"Box","data-sentry-source-file":"QuizAdjustment.tsx",children:(0,m.jsx)(eP.f,{action:eK.Qi.EDIT_ANY_COURSE,"data-sentry-element":"TeamMemberGuard","data-sentry-source-file":"QuizAdjustment.tsx",children:(0,m.jsx)(eI.A,{"data-form-path":"delete_quiz_confirm","data-element-type":"button","data-ai-field":"Open delete quiz modal on click",onClick:d.askConfirmation,disabled:o,variant:"outlined",color:"error",startIcon:(0,m.jsx)(eM.In,{icon:"tabler:trash"}),"data-sentry-element":"Button","data-sentry-source-file":"QuizAdjustment.tsx",children:r("ACTION.ENTITY.delete_quiz")})})})]})})]})},aE=({lesson:e,currentLesson:t,currentCourse:n,currentModule:a,onNextClick:i,onPrevClick:r,isFirstLessonInModule:s,isLastLessonInModule:o})=>{let{t:l}=(0,T.o)("translation",{keyPrefix:"PAGE.QUIZ_DETAIL"}),{form:{control:d,watch:c,getValues:u,setValue:p},onSubmit:h}=ev(e),f=(0,x.useRouter)(),_=e=>{let{path:t,value:n}=e.detail,a=t.match(/^content_blocks\.(\d+)\.content\.(.+)$/);if(a){let e=Number(a[1]),t=a[2],i=u(`content_blocks.${e}`);p(`content_blocks.${e}`,{...i,content:{...i.content,[t]:n}},{shouldValidate:!0,shouldDirty:!0})}else{let e=structuredClone(u());
1(0,n6.F)(e,t,n),p(t,n,{shouldValidate:!0,shouldDirty:!0})}};(0,y.useEffect)(()=>(window.addEventListener("form:setValue",_),()=>{window.removeEventListener("form:setValue",_)}),[p,u]);let g=()=>f.push(`${n4.C.courses}?${(0,eU.O)({...f.query,module:`${e?.module_id}`,lesson:`${e?.id}`})}`);return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("form",{children:(0,m.jsxs)(eX.A,{title:t?.title,buttons:{next:{"data-form-path":"next_lesson_button","data-element-type":"button","data-ai-field":"Next lesson button",disabled:o,onClick:i},previous:{"data-form-path":"previous_lesson_button","data-element-type":"button","data-ai-field":"Previous lesson button",disabled:s,onClick:r}},"data-sentry-element":"FormLayout","data-sentry-source-file":"QuizDetails.tsx",children:[(0,m.jsx)(eJ.A,{menuIcon:"tabler:book-2",menuTitle:l("QUIZ_CONTENT.menu_title"),menuSubTitle:l("QUIZ_CONTENT.menu_subtitle"),tabTitle:l("QUIZ_CONTENT.tab_title"),tabSubtitle:l("QUIZ_CONTENT.tab_subtitle"),"data-sentry-element":"FormTab","data-sentry-source-file":"QuizDetails.tsx",children:(0,m.jsx)(aT,{control:d,watch:c,setValue:p,getValues:u,"data-sentry-element":"QuizContent","data-sentry-source-file":"QuizDetails.tsx"})}),(0,m.jsx)(eJ.A,{menuIcon:"tabler:home",menuTitle:l("MAIN_INFO.menu_title"),menuSubTitle:l("MAIN_INFO.menu_subtitle"),tabTitle:l("MAIN_INFO.tab_title"),"data-sentry-element":"FormTab","data-sentry-source-file":"QuizDetails.tsx",children:(0,m.jsx)(aw,{control:d,"data-sentry-element":"QuizInformation","data-sentry-source-file":"QuizDetails.tsx"})}),(0,m.jsx)(eJ.A,{menuIcon:"tabler:file",menuTitle:l("QUIZ_SETTINGS.menu_title"),menuSubTitle:l("QUIZ_SETTINGS.menu_subtitle"),tabTitle:l("QUIZ_SETTINGS.tab_title"),"data-sentry-element":"FormTab","data-sentry-source-file":"QuizDetails.tsx",children:(0,m.jsx)(aI,{control:d,"data-sentry-element":"QuizSettings","data-sentry-source-file":"QuizDetails.tsx"})}),(0,m.jsx)(eJ.A,{menuIcon:"tabler:settings",menuTitle:l("SETTINGS.menu_title"),menuSubTitle:l("SETTINGS.menu_subtitle"),tabTitle:l("SETTINGS.tab_title"),"data-sentry-element":"FormTab","data-sentry-source-file":"QuizDetails.tsx",children:(0,m.jsx)(aS,{control:d,currentCourse:n,currentLesson:t,currentModule:a,"data-sentry-element":"QuizAdjustment","data-sentry-source-file":"QuizDetails.tsx"})})]})}),(0,m.jsx)(e2.A,{cancelButton:{onSubmit:g},saveButton:{onSubmit:h(),actionCode:eK.Qi.EDIT_COURSE,anyActionCode:eK.Qi.EDIT_ANY_COURSE,courseId:n?.id},saveAndCloseButton:{onSubmit:h(g),actionCode:eK.Qi.EDIT_COURSE,anyActionCode:eK.Qi.EDIT_ANY_COURSE,courseId:n?.id},"data-sentry-element":"FormFooter","data-sentry-source-file":"QuizDetails.tsx"})]})};var aL=n(68010),aN=n(69348);let aO=()=>{let{hasAccess:e}=(0,O.D)(),t=(0,x.useRouter)(),n=(0,f.A)(),{t:a}=(0,T.o)(),i=e(eK.Qi.VIEW_ANY_COURSE),{appRequestData:r}=(0,N.I)(i),s=Number(t.query.course_id),o=Number(t.query.module_id),l=Number(t.query.lesson_id),{searchQuery:d}=(0,L.r)({isArchived:"true"===t.query.isArchived,search:"",course:t.query.course?`${t.query.course}`:"",module:t.query.module?`${t.query.module}`:"",lesson:t.query.lesson?`${t.query.lesson}`:""}),c=(0,g.d7)(d,500),{data:u=[],isLoading:p,isError:C}=(0,E.A)(c,{hasAccess:i},{limit:9999,offset:0}),{data:v,isLoading:w,isError:M}=S(l),{data:q,isLoading:z,isError:F}=(0,_.I)({queryKey:I.Ay.files.detailByFileId(v?.attached_files.map(e=>e.file_id)||[]).queryKey,queryFn:async()=>await ti.A.getFile({search_by:[{attribute:"id",operator:"in",value:v?.attached_files.map(e=>e.file_id)||[]}]}),enabled:v?.attached_files&&v.attached_files.map(e=>e.file_id)?.length>0&&i,select:e=>e.data.result}),D=(0,y.useMemo)(()=>u?.find(e=>e.id===s),[s,u]),$=(0,y.useMemo)(()=>D?.modules.find(e=>e.id===o),[D,o]),B=(0,y.useMemo)(()=>{let e=$?.lessons.find(e=>e.id===l);return e&&v?{...e,public_key:v.public_key}:e},[$,v,l]),P=(0,y.useMemo)(()=>{if(!D)return[];let e=[];return[...D.modules].sort((e,t)=>e.order-t.order).forEach(t=>{var n,a;let i,r,s=(n=t.lessons,a=t.submodules,i=new Map,a.forEach(e=>{i.set(e.id,{...e,isSubmodule:!0,lessons:[]})}),r=[],n.forEach(e=>{if(e.submodule_id){let t=i.get(e.submodule_id);t&&t.lessons?.push(e)}else r.push(e)}),[...Array.from(i.values()).map(e=>({...e,lessons:e.lessons?.sort((e,t)=>
1e.order-t.order)||[]})),...r].sort((e,t)=>e.order-t.order)).flatMap(e=>"isSubmodule"in e?e.lessons||[]:[e]);e.push(...s)}),e},[D]),Q=(0,y.useCallback)(e=>{if(!D)return null;let t=D.modules.map(t=>t.lessons.some(t=>t.id===e)?t.id:null).find(e=>null!==e);return null!=t?t:null},[D]),V=(0,y.useCallback)(()=>{if(!B||0===P.length)return;let e=P.findIndex(e=>e.id===B.id);if(e>0){let n=P[e-1],a=Q(n.id);t.push({pathname:t.pathname,query:{...t.query,lesson_id:n.id,module_id:a}},void 0,{shallow:!0})}},[B,P,t,Q]),H=(0,y.useCallback)(()=>{if(!B||0===P.length)return;let e=P.findIndex(e=>e.id===B.id);if(e<P.length-1){let n=P[e+1],a=Q(n.id);t.push({pathname:t.pathname,query:{...t.query,lesson_id:n.id,module_id:a}},void 0,{shallow:!0})}},[B,P,t,Q]),W=(0,y.useMemo)(()=>P[P.length-1]?.id===B?.id,[B,P]),Z=(0,y.useMemo)(()=>P[0]?.id===B?.id,[B,P]),Y=(0,y.useMemo)(()=>r?.status_v2==="complete",[r?.status_v2]);if(!i)return(0,m.jsx)(aN.default,{isTeamMember:!0});if(w||p||z)return(0,m.jsx)(h.A,{alignItems:"center",justifyContent:"center",children:(0,m.jsx)(b.A,{})});if(M||C||F)return(0,m.jsx)(R.A,{entityType:"lesson / quiz",message:a("NOT_FOUND.lesson_and_quiz_by_id")});let K=v?.type_id===1?"lesson":"quiz";return(0,m.jsxs)(h.A,{gap:n.spacing(6),"data-sentry-element":"Stack","data-sentry-component":"LessonSettings","data-sentry-source-file":"index.tsx",children:[(0,m.jsx)(aL.A,{separator:(0,m.jsx)(A.A,{icon:"tabler:chevron-right"}),data:[{href:`/courses?course=${s}&module=${o}&isArchived=${d.isArchived}`,text:a("PAGE.COURSE_OVERVIEW.course_overview")},{href:`/courses/${D?.id}`,text:D?.title},{href:`/courses/${D?.id}/modules/${$?.id}`,text:$?.title},{text:B?.title,isActive:!0}],"data-sentry-element":"BreadCrumbs","data-sentry-source-file":"index.tsx"}),(0,m.jsx)(j,{"data-sentry-element":"SubmitCallbacksProvider","data-sentry-source-file":"index.tsx",children:(0,m.jsx)(k.Provider,{value:D,"data-sentry-element":"CurrentCourseContext.Provider","data-sentry-source-file":"index.tsx",children:"lesson"===K?(0,m.jsx)(n8,{ccHasApp:Y,lesson:v,files:q,currentCourse:D,currentLesson:B,currentModule:$,onNextClick:H,onPrevClick:V,isFirstLessonInModule:Z,isLastLessonInModule:W}):(0,m.jsx)(aE,{lesson:v,currentCourse:D,currentLesson:B,currentModule:$,onNextClick:H,onPrevClick:V,isFirstLessonInModule:Z,isLastLessonInModule:W})})})]})}},86018:(e,t,n)=>{"use strict";n.d(t,{C:()=>s});var a=n(74359),i=n(11313),r=n(48367);let s=({templateId:e})=>(0,a.I)({...i.Ay.certificates.certificateCount(e),queryFn:()=>r.u.getCertificatesCount({template_id:e}),select:e=>e.data.result})},88179:(e,t,n)=>{"use strict";n.d(t,{F:()=>s});var a=n(74359),i=n(11313),r=n(48367);let s=()=>(0,a.I)({...i.Ay.certificates.allRootTemplates,queryFn:()=>r.u.getRootTemplates({}),select:e=>e.data.result})},90433:(e,t,n)=>{"use strict";n.d(t,{q:()=>s});var a=n(74359),i=n(52729),r=n(36468);let s=e=>{let{enabled:t=!0,limit:n,offset:s,embedTarget:o}=e??{};return(0,a.I)({queryKey:i.Q.list(n,s,o).queryKey,queryFn:()=>r.Q7.list({limit:n,offset:s,embed_target:o}),select:e=>e.data.result,enabled:t})}},91555:(e,t,n)=>{"use strict";n.d(t,{AV:()=>a,S$:()=>i,q0:()=>r});let a={en:"en",de:"de",sk:"sk",hu:"hu",mk:"mk",cz:"cz",es:"es"},i={EN:a.en,DE:a.de,SK:a.sk,HU:a.hu,MK:a.mk,CS:"cs",ES:a.es},r=Object.values(i)},92993:(e,t,n)=>{"use strict";n.d(t,{I:()=>s});var a=n(74359),i=n(11313),r=n(55832);let s=e=>{let{data:t,isLoading:n,isError:s}=(0,a.I)({queryKey:[i.Ay.appRequests.appRequestsPersonal],queryFn:()=>r.A.getOne(),select:e=>e.data.result?.[0]??{},enabled:e});return{appRequestData:t,isLoading:n,isError:s}}},94047:(e,t,n)=>{"use strict";n.d(t,{b:()=>s});var a=n(74359),i=n(11313),r=n(48367);let s=({accessHash:e})=>(0,a.I)({...i.Ay.certificates.downloadedCertificate(e),queryFn:()=>r.u.downloadCertificate({access_hash:e??""}),select:e=>new Uint8Array(e.data),enabled:!!e,retry:!1,refetchOnReconnect:!1,refetchOnWindowFocus:!1})}},e=>{e.O(0,[1289,5236,3218,9838,4383,3220,4854,8015,636,6593,8792],()=>e(e.s=62717)),_N_E=e.O()}]); 2//# sourceMappingURL=[lesson_id]-2f281e1726d199c2.js.map
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.