@edpire/sdk 0.11.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/react.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import"./chunk-76CZ6Z7T.mjs";import Mc,{useMemo as $c}from"react";import{jsx as hr}from"react/jsx-runtime";import{useEffect as ht,useMemo as fc,useRef as hc}from"react";import Fo from"mitt";var je=class{constructor(){this.emitter=Fo(),this.answers=new Map}emit(r){if(r.type==="answer:changed")this.answers.set(r.answer.nodeId,r.answer);else if(r.type==="answers:reset")this.answers.clear();else if(r.type==="answers:prefill")for(let t of r.answers)this.answers.set(t.nodeId,t);this.emitter.emit(r.type,r)}on(r,t){this.emitter.on(r,t)}off(r,t){this.emitter.off(r,t)}getAllAnswers(){return Array.from(this.answers.values())}clearAnswers(){this.answers.clear(),this.emit({type:"answers:reset"})}prefillAnswers(r){this.emit({type:"answers:prefill",answers:r})}submitAnswers(){this.emit({type:"answer:submitted",answers:this.getAllAnswers(),timestamp:Date.now()})}},zn="__edpireGlobalAnswerBus",Dn=globalThis,Br=Dn[zn]??(Dn[zn]=new je);import{jsx as jo}from"react/jsx-runtime";import{createContext as Bo,useContext as Wo}from"react";var On="__edpireAnswerBusContext",Fn=globalThis,jn=Fn[On]??(Fn[On]=Bo(Br));function le(){return Wo(jn)}function Wr({children:e,bus:r=new je}){return jo(jn.Provider,{value:r,children:e})}import{jsx as me,jsxs as nr}from"react/jsx-runtime";import{Fragment as Ss,useState as aa,useEffect as Ot,useMemo as _s}from"react";import Be from"clsx";import{jsx as B,jsxs as Jn}from"react/jsx-runtime";import qo from"katex";import"katex/dist/contrib/mhchem.js";var Ho={"\\d":"\\mathrm{d}","\\R":"\\mathbb{R}","\\N":"\\mathbb{N}","\\Z":"\\mathbb{Z}","\\Q":"\\mathbb{Q}","\\C":"\\mathbb{C}"};function Ze(e,r,t=!0){try{return qo.renderToString(e,{displayMode:r,output:t?"htmlAndMathml":"html",throwOnError:!1,errorColor:"#cc0000",macros:Ho,strict:!1})}catch(n){return`<span class="katex-error" style="color:#cc0000" title="${String(n)}">${e}</span>`}}function E(e){return`calc(${typeof e=="number"?`${e}px`:e} * var(--edp-scale, 1))`}function re(e){return{width:E(e),height:E(e)}}function Ee(e){if(e==null||e==="")return;if(typeof e=="number")return E(e);let r=String(e).trim();return/^\d+(\.\d+)?px$/.test(r)?E(r):r}import{createContext as Uo}from"react";var kr=Uo(!1),qr="1px solid #d1d5db",Vo="#f3f4f6",Qo="#e3e1dc",Go="var(--card, #fff)",er="edp-table-first",Bn={overflowX:"auto",margin:`${E("1.25rem")} 0`},Wn={left:!1,right:!1,held:0,rtl:!1};function qn(e,r,t,n=0){return{left:r.left<e.left-1,right:r.right>e.right+1,held:n,rtl:t}}function Hn(e,r){return Math.max(80,Math.round((e-r)*.8))}var Tt={borderCollapse:"separate",borderSpacing:0,width:"100%",tableLayout:"auto",fontSize:E("0.875rem"),lineHeight:1.3,borderBlockStart:qr,borderInlineStart:qr};function Rr(e){let r=e.gray?Qo:e.header?Vo:e.sticky?Go:void 0;return{borderBlockEnd:qr,borderInlineEnd:qr,padding:`${E("4px")} ${E("6px")}`,verticalAlign:"middle",overflowWrap:"normal",wordBreak:"normal",hyphens:"manual",...r?{background:r}:{},...e.header?{fontWeight:600}:{},...e.sticky?{position:"sticky",insetInlineStart:0,zIndex:1}:{}}}function Sr(e){return Object.entries(e).map(([r,t])=>`${r.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`)}:${t}`).join(";")}function Lt(e){let r=[],t=new Set,n=[];(e??[]).forEach((o,i)=>{let c=0;(o.content??[]).forEach(l=>{for(;n[i]?.[c];)c++;let d=Math.max(1,l.attrs?.colspan??1),p=Math.max(1,l.attrs?.rowspan??1);for(let m=i;m<i+p;m++){let g=n[m]??(n[m]=[]);for(let u=c;u<c+d;u++)g[u]=!0}for(let m=0;m<d;m++){let g=l.attrs?.colwidth?.[m];g&&r[c+m]==null&&(r[c+m]=g)}c===0&&d===1&&t.add(l),c+=d})});let a=n.reduce((o,i)=>Math.max(o,i.length),0);return{columnWidths:r.some(o=>o!=null)?Array.from({length:a},(o,i)=>r[i]??null):[],stickyCells:t}}function It(e){return e.replace(/(\d) (?=\d)/g,"$1\xA0").replace(/(\d) (?=[\p{L}%\p{Sc}]{1,3}(?![\p{L}\p{N}]))/gu,"$1\xA0")}import{jsx as Me,jsxs as $t}from"react/jsx-runtime";import{useCallback as Jo,useEffect as Zo,useLayoutEffect as es,useRef as rs,useState as ts}from"react";import{jsx as Yo}from"react/jsx-runtime";import{createContext as Ko,useContext as Un}from"react";var dr={submitButton:"Submit",showHint:"Show hint",clickToRemove:"Click to remove",blankAnswerAria:"Your answer",aiEvaluationInProgress:"AI evaluation in progress\u2026",aiEvaluationInProgressAria:"AI evaluation in progress",shortAnswerPlaceholder:"Short answer\u2026",longAnswerPlaceholder:"Write your answer here\u2026",minWordsLabel:e=>`Min: ${e}`,wordBank:"Word Bank",chooseN:e=>`(choose ${e})`,annexDefaultLabel:"Documents",annexOpen:e=>`Open ${e}`,annexClose:"Close",referenceInPanel:e=>`This exercise's text is in ${e}.`,readReference:"Read it",referenceForExercise:e=>`Exercise ${e}`,choiceLetters:"ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),tableScrollLeft:"Show the columns on the left",tableScrollRight:"Show the columns on the right",mathChecking:"Checking your answer\u2026",mathCorrect:"Correct",mathIncorrect:"Incorrect",openResponseTextPlaceholder:"Write your answer here\u2026",openResponseWords:"words",openResponseChars:"chars",openResponseDropZoneLabel:"Drag & drop files here, or",openResponseDropZoneBrowse:"browse",openResponseUploading:"Uploading\u2026",openResponseNoSubmission:"No submission",openResponseFile:"File",openResponseAttachFile:"Attach a file",openResponseAttachFiles:"Attach files",openResponseAttachedFiles:"Attached files",openResponseTypeImage:"Image",openResponseTypePdf:"PDF",openResponseTypeAudio:"Audio",openResponseTypeVideo:"Video",openResponseTypeVideoLink:"Video link",openResponseVideoLinkPlaceholder:"Paste YouTube or Vimeo URL\u2026",openResponseAddVideoLink:"Add",openResponseTapToRecord:"Tap to start recording",openResponseTapToRecordScreen:"Click to start screen recording",openResponseRequestingPermission:"Requesting permission\u2026",openResponsePermissionDenied:"Microphone/camera access denied. Please allow access in your browser settings.",openResponseMediaHandlerRequired:"A media handler is required to save recordings.",openResponseStopRecording:"Stop",openResponseReRecord:"Re-record",openResponseConfirmRecording:"Use this recording",openResponseRecordingSubmitted:"Recording submitted",openResponseAwaitingReview:"Submitted, awaiting teacher review",openResponseTeacherFeedbackLabel:"Teacher feedback",openResponseGradeThisResponse:"Grade this response",openResponseGradeScoreLabel:e=>`Score (max ${e})`,openResponseGradeFeedbackLabel:"Feedback (optional)",openResponseGradeFeedbackPlaceholder:"Add feedback for the student\u2026",openResponseSubmitGrade:"Submit Grade",openResponseGradeSubmitted:(e,r)=>`Grade submitted: ${e} / ${r}`,openResponseRubricTitle:"Rubric",openResponseRubricCriterionPoints:(e,r)=>`${e} / ${r} pts`,openResponseAiSuggestionTitle:"AI Pre-grading Suggestion",openResponseAiSuggestedScore:(e,r)=>`Suggested score: ${e} / ${r}`,openResponseAiEvidence:"Evidence:",openResponseAiApplySuggestion:"Apply suggestion",openResponseStudentAnswerTitle:"Student answer"};var Hr={submitButton:"Valider",showHint:"Voir l'indice",clickToRemove:"Cliquer pour retirer",blankAnswerAria:"Votre r\xE9ponse",aiEvaluationInProgress:"\xC9valuation IA en cours\u2026",aiEvaluationInProgressAria:"\xC9valuation IA en cours",shortAnswerPlaceholder:"R\xE9ponse courte\u2026",longAnswerPlaceholder:"\xC9crivez votre r\xE9ponse ici\u2026",minWordsLabel:e=>`Min. : ${e}`,wordBank:"Banque de mots",chooseN:e=>`(choisir ${e})`,annexDefaultLabel:"Documents",annexOpen:e=>`Ouvrir ${e}`,annexClose:"Fermer",referenceInPanel:e=>`Le texte de cet exercice est dans \xAB ${e} \xBB.`,readReference:"Le lire",referenceForExercise:e=>`Exercice ${e}`,choiceLetters:"ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),tableScrollLeft:"Voir les colonnes de gauche",tableScrollRight:"Voir les colonnes de droite",mathChecking:"V\xE9rification de votre r\xE9ponse\u2026",mathCorrect:"Juste",mathIncorrect:"Faux",openResponseTextPlaceholder:"\xC9crivez votre r\xE9ponse ici\u2026",openResponseWords:"mots",openResponseChars:"car.",openResponseDropZoneLabel:"Glissez-d\xE9posez des fichiers ici, ou",openResponseDropZoneBrowse:"parcourir",openResponseUploading:"Envoi en cours\u2026",openResponseNoSubmission:"Aucun fichier d\xE9pos\xE9",openResponseFile:"Fichier",openResponseAttachFile:"Joindre un fichier",openResponseAttachFiles:"Joindre des fichiers",openResponseAttachedFiles:"Fichiers joints",openResponseTypeImage:"Image",openResponseTypePdf:"PDF",openResponseTypeAudio:"Audio",openResponseTypeVideo:"Vid\xE9o",openResponseTypeVideoLink:"Lien vid\xE9o",openResponseVideoLinkPlaceholder:"Coller un lien YouTube ou Vimeo\u2026",openResponseAddVideoLink:"Ajouter",openResponseTapToRecord:"Appuyer pour d\xE9marrer l'enregistrement",openResponseTapToRecordScreen:"Cliquer pour d\xE9marrer l'enregistrement d'\xE9cran",openResponseRequestingPermission:"Demande d'autorisation\u2026",openResponsePermissionDenied:"Acc\xE8s au micro/cam\xE9ra refus\xE9. Autorise l'acc\xE8s dans les param\xE8tres du navigateur.",openResponseMediaHandlerRequired:"Un gestionnaire de m\xE9dias est requis pour sauvegarder les enregistrements.",openResponseStopRecording:"Arr\xEAter",openResponseReRecord:"R\xE9enregistrer",openResponseConfirmRecording:"Utiliser cet enregistrement",openResponseRecordingSubmitted:"Enregistrement soumis",openResponseAwaitingReview:"Soumis, en attente de correction par l'enseignant",openResponseTeacherFeedbackLabel:"Commentaire de l'enseignant",openResponseGradeThisResponse:"Corriger cette r\xE9ponse",openResponseGradeScoreLabel:e=>`Note (max ${e})`,openResponseGradeFeedbackLabel:"Commentaire (facultatif)",openResponseGradeFeedbackPlaceholder:"Ajouter un commentaire pour l'\xE9l\xE8ve\u2026",openResponseSubmitGrade:"Valider la note",openResponseGradeSubmitted:(e,r)=>`Note envoy\xE9e : ${e} / ${r}`,openResponseRubricTitle:"Grille d'\xE9valuation",openResponseRubricCriterionPoints:(e,r)=>`${e} / ${r} pts`,openResponseAiSuggestionTitle:"Suggestion de correction par IA",openResponseAiSuggestedScore:(e,r)=>`Score sugg\xE9r\xE9 : ${e} / ${r}`,openResponseAiEvidence:"Extrait :",openResponseAiApplySuggestion:"Appliquer la suggestion",openResponseStudentAnswerTitle:"R\xE9ponse de l'\xE9l\xE8ve"};var Ur={submitButton:"\u0625\u0631\u0633\u0627\u0644",showHint:"\u0625\u0638\u0647\u0627\u0631 \u0627\u0644\u062A\u0644\u0645\u064A\u062D",clickToRemove:"\u0627\u0646\u0642\u0631 \u0644\u0644\u0625\u0632\u0627\u0644\u0629",blankAnswerAria:"\u0625\u062C\u0627\u0628\u062A\u0643",aiEvaluationInProgress:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u0642\u064A\u064A\u0645 \u0628\u0627\u0644\u0630\u0643\u0627\u0621 \u0627\u0644\u0627\u0635\u0637\u0646\u0627\u0639\u064A\u2026",aiEvaluationInProgressAria:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u0642\u064A\u064A\u0645 \u0628\u0627\u0644\u0630\u0643\u0627\u0621 \u0627\u0644\u0627\u0635\u0637\u0646\u0627\u0639\u064A",shortAnswerPlaceholder:"\u0625\u062C\u0627\u0628\u0629 \u0642\u0635\u064A\u0631\u0629\u2026",longAnswerPlaceholder:"\u0627\u0643\u062A\u0628 \u0625\u062C\u0627\u0628\u062A\u0643 \u0647\u0646\u0627\u2026",minWordsLabel:e=>`\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u062F\u0646\u0649: ${e}`,wordBank:"\u0628\u0646\u0643 \u0627\u0644\u0643\u0644\u0645\u0627\u062A",chooseN:e=>`(\u0627\u062E\u062A\u0631 ${e})`,annexDefaultLabel:"\u0627\u0644\u0645\u0633\u062A\u0646\u062F\u0627\u062A",annexOpen:e=>`\u0641\u062A\u062D ${e}`,annexClose:"\u0625\u063A\u0644\u0627\u0642",referenceInPanel:e=>`\u0646\u0635 \u0647\u0630\u0627 \u0627\u0644\u062A\u0645\u0631\u064A\u0646 \u0641\u064A \xAB${e}\xBB.`,readReference:"\u0627\u0642\u0631\u0623\u0647",referenceForExercise:e=>`\u0627\u0644\u062A\u0645\u0631\u064A\u0646 ${e}`,choiceLetters:["\u0623","\u0628","\u062C","\u062F","\u0647\u0640","\u0648","\u0632","\u062D","\u0637","\u064A","\u0643","\u0644","\u0645","\u0646","\u0633","\u0639","\u0641","\u0635","\u0642","\u0631","\u0634","\u062A","\u062B","\u062E","\u0630","\u0636","\u0638","\u063A"],tableScrollLeft:"\u0625\u0638\u0647\u0627\u0631 \u0627\u0644\u0623\u0639\u0645\u062F\u0629 \u0639\u0644\u0649 \u0627\u0644\u064A\u0633\u0627\u0631",tableScrollRight:"\u0625\u0638\u0647\u0627\u0631 \u0627\u0644\u0623\u0639\u0645\u062F\u0629 \u0639\u0644\u0649 \u0627\u0644\u064A\u0645\u064A\u0646",mathChecking:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0642\u0642 \u0645\u0646 \u0625\u062C\u0627\u0628\u062A\u0643\u2026",mathCorrect:"\u0635\u062D\u064A\u062D",mathIncorrect:"\u062E\u0637\u0623",openResponseTextPlaceholder:"\u0627\u0643\u062A\u0628 \u0625\u062C\u0627\u0628\u062A\u0643 \u0647\u0646\u0627\u2026",openResponseWords:"\u0643\u0644\u0645\u0629",openResponseChars:"\u062D\u0631\u0641",openResponseDropZoneLabel:"\u0627\u0633\u062D\u0628 \u0627\u0644\u0645\u0644\u0641\u0627\u062A \u0648\u0623\u0641\u0644\u062A\u0647\u0627 \u0647\u0646\u0627\u060C \u0623\u0648",openResponseDropZoneBrowse:"\u062A\u0635\u0641\u0651\u062D",openResponseUploading:"\u062C\u0627\u0631\u064D \u0627\u0644\u0631\u0641\u0639\u2026",openResponseNoSubmission:"\u0644\u0627 \u064A\u0648\u062C\u062F \u062A\u0633\u0644\u064A\u0645",openResponseFile:"\u0645\u0644\u0641",openResponseAttachFile:"\u0625\u0631\u0641\u0627\u0642 \u0645\u0644\u0641",openResponseAttachFiles:"\u0625\u0631\u0641\u0627\u0642 \u0645\u0644\u0641\u0627\u062A",openResponseAttachedFiles:"\u0627\u0644\u0645\u0644\u0641\u0627\u062A \u0627\u0644\u0645\u0631\u0641\u0642\u0629",openResponseTypeImage:"\u0635\u0648\u0631\u0629",openResponseTypePdf:"PDF",openResponseTypeAudio:"\u0635\u0648\u062A",openResponseTypeVideo:"\u0641\u064A\u062F\u064A\u0648",openResponseTypeVideoLink:"\u0631\u0627\u0628\u0637 \u0641\u064A\u062F\u064A\u0648",openResponseVideoLinkPlaceholder:"\u0627\u0644\u0635\u0642 \u0631\u0627\u0628\u0637 \u064A\u0648\u062A\u064A\u0648\u0628 \u0623\u0648 Vimeo\u2026",openResponseAddVideoLink:"\u0625\u0636\u0627\u0641\u0629",openResponseTapToRecord:"\u0627\u0646\u0642\u0631 \u0644\u0628\u062F\u0621 \u0627\u0644\u062A\u0633\u062C\u064A\u0644",openResponseTapToRecordScreen:"\u0627\u0646\u0642\u0631 \u0644\u0628\u062F\u0621 \u062A\u0633\u062C\u064A\u0644 \u0627\u0644\u0634\u0627\u0634\u0629",openResponseRequestingPermission:"\u062C\u0627\u0631\u064D \u0637\u0644\u0628 \u0627\u0644\u0625\u0630\u0646\u2026",openResponsePermissionDenied:"\u062A\u0645 \u0631\u0641\u0636 \u0627\u0644\u0648\u0635\u0648\u0644 \u0625\u0644\u0649 \u0627\u0644\u0645\u064A\u0643\u0631\u0648\u0641\u0648\u0646/\u0627\u0644\u0643\u0627\u0645\u064A\u0631\u0627. \u064A\u064F\u0631\u062C\u0649 \u0627\u0644\u0633\u0645\u0627\u062D \u0628\u0627\u0644\u0648\u0635\u0648\u0644 \u0645\u0646 \u0625\u0639\u062F\u0627\u062F\u0627\u062A \u0627\u0644\u0645\u062A\u0635\u0641\u062D.",openResponseMediaHandlerRequired:"\u064A\u0644\u0632\u0645 \u0645\u0639\u0627\u0644\u062C \u0648\u0633\u0627\u0626\u0637 \u0644\u062D\u0641\u0638 \u0627\u0644\u062A\u0633\u062C\u064A\u0644\u0627\u062A.",openResponseStopRecording:"\u0625\u064A\u0642\u0627\u0641",openResponseReRecord:"\u0625\u0639\u0627\u062F\u0629 \u0627\u0644\u062A\u0633\u062C\u064A\u0644",openResponseConfirmRecording:"\u0627\u0633\u062A\u062E\u062F\u0627\u0645 \u0647\u0630\u0627 \u0627\u0644\u062A\u0633\u062C\u064A\u0644",openResponseRecordingSubmitted:"\u062A\u0645 \u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u062A\u0633\u062C\u064A\u0644",openResponseAwaitingReview:"\u062A\u0645 \u0627\u0644\u0625\u0631\u0633\u0627\u0644\u060C \u0641\u064A \u0627\u0646\u062A\u0638\u0627\u0631 \u0645\u0631\u0627\u062C\u0639\u0629 \u0627\u0644\u0645\u0639\u0644\u0645",openResponseTeacherFeedbackLabel:"\u0645\u0644\u0627\u062D\u0638\u0627\u062A \u0627\u0644\u0645\u0639\u0644\u0645",openResponseGradeThisResponse:"\u062A\u0635\u062D\u064A\u062D \u0647\u0630\u0647 \u0627\u0644\u0625\u062C\u0627\u0628\u0629",openResponseGradeScoreLabel:e=>`\u0627\u0644\u062F\u0631\u062C\u0629 (\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 ${e})`,openResponseGradeFeedbackLabel:"\u0645\u0644\u0627\u062D\u0638\u0627\u062A (\u0627\u062E\u062A\u064A\u0627\u0631\u064A)",openResponseGradeFeedbackPlaceholder:"\u0623\u0636\u0641 \u0645\u0644\u0627\u062D\u0638\u0627\u062A \u0644\u0644\u0637\u0627\u0644\u0628\u2026",openResponseSubmitGrade:"\u0627\u0639\u062A\u0645\u0627\u062F \u0627\u0644\u062F\u0631\u062C\u0629",openResponseGradeSubmitted:(e,r)=>`\u062A\u0645 \u0627\u0639\u062A\u0645\u0627\u062F \u0627\u0644\u062F\u0631\u062C\u0629: ${e} / ${r}`,openResponseRubricTitle:"\u0633\u0644\u0651\u0645 \u0627\u0644\u062A\u0635\u062D\u064A\u062D",openResponseRubricCriterionPoints:(e,r)=>`${e} / ${r} \u0646\u0642\u0637\u0629`,openResponseAiSuggestionTitle:"\u0627\u0642\u062A\u0631\u0627\u062D \u0627\u0644\u062A\u0635\u062D\u064A\u062D \u0627\u0644\u0645\u0633\u0628\u0642 \u0628\u0627\u0644\u0630\u0643\u0627\u0621 \u0627\u0644\u0627\u0635\u0637\u0646\u0627\u0639\u064A",openResponseAiSuggestedScore:(e,r)=>`\u0627\u0644\u062F\u0631\u062C\u0629 \u0627\u0644\u0645\u0642\u062A\u0631\u062D\u0629: ${e} / ${r}`,openResponseAiEvidence:"\u0627\u0644\u0623\u062F\u0644\u0629:",openResponseAiApplySuggestion:"\u062A\u0637\u0628\u064A\u0642 \u0627\u0644\u0627\u0642\u062A\u0631\u0627\u062D",openResponseStudentAnswerTitle:"\u0625\u062C\u0627\u0628\u0629 \u0627\u0644\u0637\u0627\u0644\u0628"};var Xo={en:dr,fr:Hr,ar:Ur},Mt=Ko(null);function Z(){return Un(Mt)??dr}function _r(e){let r=Un(Mt);return e&&Xo[e]||r||dr}function Cr({locale:e,children:r}){let t=_r(e);return Yo(Mt.Provider,{value:t,children:r})}var ns=typeof window<"u"?es:Zo;function Vn({side:e}){return Me("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2.25",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:Me("path",{d:e==="left"?"M15 6l-6 6 6 6":"M9 6l6 6-6 6"})})}function Qn({children:e}){let r=Z(),t=rs(null),[n,a]=ts(Wn),s=Jo(()=>{let p=t.current,m=p?.querySelector("table");if(!p||!m)return;let g=p.querySelector(`.${er}`),u=qn(p.getBoundingClientRect(),m.getBoundingClientRect(),getComputedStyle(p).direction==="rtl",g?g.getBoundingClientRect().width:0);a(b=>b.left===u.left&&b.right===u.right&&b.held===u.held&&b.rtl===u.rtl?b:u)},[]);ns(()=>{let p=t.current;if(!p)return;s(),p.addEventListener("scroll",s,{passive:!0});let m=typeof ResizeObserver<"u"?new ResizeObserver(s):null;m?.observe(p);let g=p.querySelector("table");return g&&m?.observe(g),()=>{p.removeEventListener("scroll",s),m?.disconnect()}},[s]);let o=p=>{let m=t.current;m&&m.scrollBy({left:p*Hn(m.clientWidth,n.held),behavior:"smooth"})},i=n.left||n.right,c=p=>i?Me("div",{className:`edp-table-arrows edp-table-arrows--${p}`,children:$t("span",{dir:"ltr",className:"edp-table-arrows__pair",children:[Me("button",{type:"button",className:"edp-table-arrow",onClick:()=>o(-1),disabled:!n.left,"aria-label":r.tableScrollLeft,children:Me(Vn,{side:"left"})}),Me("button",{type:"button",className:"edp-table-arrow",onClick:()=>o(1),disabled:!n.right,"aria-label":r.tableScrollRight,children:Me(Vn,{side:"right"})})]})}):null,l=n.rtl?0:n.held,d=n.rtl?n.held:0;return $t("div",{className:"edp-table-frame",style:{margin:`${E("1.25rem")} 0`},children:[c("top"),$t("div",{style:{position:"relative"},children:[Me("div",{ref:t,className:"edp-table-scroll",style:{overflowX:"auto"},children:e}),n.left&&Me("span",{className:"edp-table-shade edp-table-shade--left",style:{left:l},"aria-hidden":"true"}),n.right&&Me("span",{className:"edp-table-shade edp-table-shade--right",style:{right:d},"aria-hidden":"true"})]}),c("bottom")]})}var Gn={1:{fontSize:"1.75em",fontWeight:700,lineHeight:1.2,margin:"0.6em 0 0.4em"},2:{fontSize:"1.4em",fontWeight:700,lineHeight:1.25,margin:"0.6em 0 0.35em"},3:{fontSize:"1.15em",fontWeight:600,lineHeight:1.3,margin:"0.5em 0 0.3em"}},Yn={border:"#2563eb",background:"#e0f2fe"},Kn={border:"#dc2626",background:"#fee2e2"};function as(e){return{display:"inline-block",verticalAlign:"middle",border:`2px solid ${e?.border||Yn.border}`,background:e?.background||Yn.background,borderRadius:E("4px"),padding:"0.17em 0.37em"}}function os(e){let r=e?.shape==="circle"?"50%":"9999px";return{display:"inline-block",verticalAlign:"middle",border:`2px solid ${e?.border||Kn.border}`,background:e?.background||Kn.background,borderRadius:r,padding:"0.15em 0.45em"}}function ss(e,r){if(!(!e&&!r))return{...e?{textAlign:e}:{},...r?{margin:0}:{}}}function Se(e,r,t){return B("div",{className:"exercise-content",children:e.content.map((n,a)=>xe(n,`node-${a}`,r,t))})}var is=/^[\u00a0\u202f ]?[.,;:!?\u2026)\]}\u00bb\u201d\u2019%\u060c\u061b\u061f]+/,cs=new Set(["blank","inlineChoiceSet"]);function Xn(e,r,t,n){let a=[],s=e??[];for(let o=0;o<s.length;o++){let i=s[o],c=s[o+1],l=cs.has(i.type)&&c?.type==="text"?is.exec(c.text??"")?.[0]:void 0;if(!l||!c){a.push(xe(i,`${r}-${o}`,t,n));continue}let d=(c.text??"").slice(l.length);a.push(Jn("span",{style:{whiteSpace:"nowrap"},children:[B("span",{style:{whiteSpace:"normal"},children:xe(i,`${r}-${o}-a`,t,n)}),xe({...c,text:l},`${r}-${o}-p`,t,n)]},`${r}-${o}`)),d&&a.push(xe({...c,text:d},`${r}-${o+1}`,t,n)),o++}return a}function xe(e,r,t,n){switch(e.type){case"choiceSet":case"inlineChoiceSet":return B(Qr,{node:e,validationFeedback:t?.get(e.id)},r);case"blank":return e.attrs.mode==="typed"?B(Gr,{node:e,validationFeedback:t?.get(e.id)},r):B(Yr,{node:e,validationFeedback:t?.get(e.id)},r);case"blankPool":return B(Kr,{node:e},r);case"inlinePool":return B(Xr,{node:e},r);case"matchingSet":return B(Jr,{node:e,validationFeedback:t?.get(e.id)},r);case"aiAnswerInput":return B(Zr,{node:e,validationFeedback:t?.get(e.id)},r);case"openResponseNode":return B(et,{node:e,validationFeedback:t?.get(e.id),readOnly:n?.readOnly,mediaHandler:n?.mediaHandler},r);case"mathResponse":return B(rt,{nodeId:e.id,placeholder:e.attrs?.placeholder,hint:e.attrs?.hint,validationFeedback:t?.get(e.id),readOnly:n?.readOnly},r);case"codingResponse":return B(tt,{node:e,validationFeedback:t?.get(e.id),readOnly:n?.readOnly,executor:n?.codeExecutor},r);case"aiEvaluationConfig":return null;case"paragraph":{let a=e.attrs,s=a?.textAlign,o=a?.dir||void 0;return B("p",{dir:o,style:ss(s,n?.inTable),children:Xn(e.content,r,t,n)},r)}case"heading":{let a=e.attrs.level??1,s=`h${a}`,o=e.attrs,i=o?.textAlign,c=o?.dir||void 0,l=Gn[a]??Gn[3];return B(s,{dir:c,style:{...l,...i?{textAlign:i}:{}},children:Xn(e.content,r,t,n)},r)}case"blockquote":{let a=e.attrs,s=a?.dir||void 0,o=a?.textAlign;return B("blockquote",{dir:s,style:{borderInlineStart:"3px solid #d6d3cc",paddingInlineStart:"1em",margin:"0.75em 0",color:"#565b66",fontStyle:"italic",...o?{textAlign:o}:{}},children:e.content?.map((i,c)=>xe(i,`${r}-${c}`,t,n))},r)}case"text":{let a=e,s=n?.inTable?It(a.text??""):a.text??"",o=a.marks??[];if(o.length===0)return B("span",{children:s},r);let i={};for(let l of o)l.type==="textStyle"&&(l.attrs?.color&&(i.color=l.attrs.color),l.attrs?.fontSize&&(i.fontSize=l.attrs.fontSize),l.attrs?.fontFamily&&(i.fontFamily=l.attrs.fontFamily));let c=s;for(let l of o)switch(l.type){case"bold":c=B("strong",{children:c});break;case"italic":c=B("em",{children:c});break;case"underline":c=B("u",{children:c});break;case"strike":c=B("s",{children:c});break;case"code":c=B("code",{children:c});break;case"subscript":c=B("sub",{children:c});break;case"superscript":c=B("sup",{children:c});break;case"boxedText":c=B("span",{style:as(l.attrs),children:c});break;case"circleText":c=B("span",{style:os(l.attrs),children:c});break}return B("span",{style:Object.keys(i).length>0?i:void 0,children:c},r)}case"hardBreak":return B("br",{},r);case"resizableImage":return B("img",{src:e.attrs?.src||void 0,alt:e.attrs?.alt||"",style:{display:"inline-block",verticalAlign:"middle",width:Ee(e.attrs?.width||void 0)??"auto",height:Ee(e.attrs?.height||void 0)??"auto",maxWidth:"100%"}},r);case"resizableAudio":return B("span",{style:{display:"inline-flex",verticalAlign:"middle",alignItems:"center",background:"#f1f5f9",borderRadius:E("8px"),padding:`${E("4px")} ${E("8px")}`,maxWidth:"100%"},children:B("audio",{controls:!0,src:e.attrs?.src||void 0,style:{display:"block",width:E("320px"),maxWidth:"100%"}})},r);case"resizableVideo":return B("video",{src:e.attrs?.src||void 0,controls:!0,style:{display:"inline-block",verticalAlign:"middle",width:Ee(e.attrs?.width||void 0)??"auto",height:Ee(e.attrs?.height||void 0)??"auto",maxWidth:"100%"}},r);case"youtubeEmbed":return B("iframe",{src:`https://www.youtube.com/embed/${e.attrs?.videoId||""}`,width:e.attrs?.width||480,height:e.attrs?.height||270,allowFullScreen:!0,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",style:{display:"inline-block",verticalAlign:"middle",border:0,width:Ee(e.attrs?.width||480),height:Ee(e.attrs?.height||270)}},r);case"inlineMath":return B("span",{dir:"ltr",style:{unicodeBidi:"isolate",display:"inline-block"},className:"math-inline",dangerouslySetInnerHTML:{__html:Ze(e.attrs?.latex??"",!1,!0)}},r);case"blockMath":return B("div",{dir:"ltr",style:{unicodeBidi:"isolate",textAlign:"center",margin:"1em 0"},className:"math-block",dangerouslySetInnerHTML:{__html:Ze(e.attrs?.latex??"",!0,!0)}},r);case"variable":return B("span",{className:"variable",children:`{${e.attrs?.name}}`},r);default:{let a=e;if(a.type==="bulletList")return B("ul",{style:{listStyleType:"disc",paddingLeft:"1.5em",margin:"0.5em 0"},children:a.content?.map((s,o)=>xe(s,`${r}-${o}`,t,n))},r);if(a.type==="orderedList")return B("ol",{style:{listStyleType:"decimal",paddingLeft:"1.5em",margin:"0.5em 0"},children:a.content?.map((s,o)=>xe(s,`${r}-${o}`,t,n))},r);if(a.type==="listItem")return B("li",{children:a.content?.map((s,o)=>xe(s,`${r}-${o}`,t,n))},r);if(a.type==="table"){let s=Lt(a.content),o={...n,inTable:!0,stickyCells:s.stickyCells};return B(Qn,{children:Jn("table",{style:Tt,children:[s.columnWidths.length>0&&B("colgroup",{children:s.columnWidths.map((i,c)=>B("col",{style:i?{width:E(i)}:void 0},c))}),B("tbody",{children:a.content?.map((i,c)=>xe(i,`${r}-${c}`,t,o))})]})},r)}return a.type==="tableRow"?B("tr",{children:a.content?.map((s,o)=>xe(s,`${r}-${o}`,t,n))},r):a.type==="tableCell"?B("td",{colSpan:a.attrs?.colspan,rowSpan:a.attrs?.rowspan,className:n?.stickyCells?.has(a)?er:void 0,style:Rr({header:!1,gray:!!a.attrs?.gray,sticky:!!n?.stickyCells?.has(a)}),children:B(kr.Provider,{value:!0,children:a.content?.map((s,o)=>xe(s,`${r}-${o}`,t,n))})},r):a.type==="tableHeader"?B("th",{colSpan:a.attrs?.colspan,rowSpan:a.attrs?.rowspan,className:n?.stickyCells?.has(a)?er:void 0,style:Rr({header:!0,gray:!!a.attrs?.gray,sticky:!!n?.stickyCells?.has(a)}),children:B(kr.Provider,{value:!0,children:a.content?.map((s,o)=>xe(s,`${r}-${o}`,t,n))})},r):(console.warn(`Unknown node type during interpretation: ${e.type}`),null)}}}function te(e,r){return e.map(t=>{if(t.type==="text"){let n=rr(r?.inTable?It(t.text??""):t.text??""),a=t.marks??[],s=[];for(let o of a)o.type==="textStyle"&&(o.attrs?.color&&s.push(`color:${o.attrs.color}`),o.attrs?.fontSize&&s.push(`font-size:${o.attrs.fontSize}`),o.attrs?.fontFamily&&s.push(`font-family:${o.attrs.fontFamily}`));s.length>0&&(n=`<span style="${s.join(";")}">${n}</span>`);for(let o of a)switch(o.type){case"bold":n=`<strong>${n}</strong>`;break;case"italic":n=`<em>${n}</em>`;break;case"underline":n=`<u>${n}</u>`;break;case"strike":n=`<s>${n}</s>`;break;case"code":n=`<code>${n}</code>`;break;case"subscript":n=`<sub>${n}</sub>`;break;case"superscript":n=`<sup>${n}</sup>`;break;case"boxedText":{let i=o.attrs?.border||"#2563eb",c=o.attrs?.background||"#e0f2fe";n=`<span style="display:inline-block;vertical-align:middle;border:2px solid ${i};background:${c};border-radius:${E("4px")};padding:0.17em 0.37em">${n}</span>`;break}case"circleText":{let i=o.attrs?.border||"#dc2626",c=o.attrs?.background||"#fee2e2",l=o.attrs?.shape==="circle"?"50%":"9999px";n=`<span style="display:inline-block;vertical-align:middle;border:2px solid ${i};background:${c};border-radius:${l};padding:0.15em 0.45em">${n}</span>`;break}}return n}if(t.type==="paragraph"){let n=t.content?te(t.content,r):"",a=t.attrs?.dir,s=t.attrs?.textAlign,o=a?` dir="${a}"`:"",i=[s?`text-align:${s}`:"",r?.inTable?"margin:0":""].filter(Boolean).join(";"),c=i?` style="${i}"`:"";return r?.stripParagraphs?n:`<p${o}${c}>${n}</p>`}if(t.type==="hardBreak")return"<br/>";if(t.type==="table"){let n=Lt(t.content),a=t.content?te(t.content,{...r,inTable:!0,stickyCells:n.stickyCells}):"",s=n.columnWidths.length?`<colgroup>${n.columnWidths.map(o=>o?`<col style="width:${E(o)}">`:"<col>").join("")}</colgroup>`:"";return`<div style="${Sr(Bn)}"><table style="${Sr(Tt)}">${s}<tbody>${a}</tbody></table></div>`}if(t.type==="tableRow")return`<tr>${t.content?te(t.content,r):""}</tr>`;if(t.type==="tableCell"){let n=t.content?te(t.content,r):"",a=t.attrs?.colspan?` colspan="${t.attrs.colspan}"`:"",s=t.attrs?.rowspan?` rowspan="${t.attrs.rowspan}"`:"",o=!!r?.stickyCells?.has(t),i=o?` class="${er}"`:"";return`<td${a}${s}${i} style="${Sr(Rr({header:!1,gray:!!t.attrs?.gray,sticky:o}))}">${n}</td>`}if(t.type==="tableHeader"){let n=t.content?te(t.content,r):"",a=t.attrs?.colspan?` colspan="${t.attrs.colspan}"`:"",s=t.attrs?.rowspan?` rowspan="${t.attrs.rowspan}"`:"",o=!!r?.stickyCells?.has(t),i=o?` class="${er}"`:"";return`<th${a}${s}${i} style="${Sr(Rr({header:!0,gray:!!t.attrs?.gray,sticky:o}))}">${n}</th>`}if(t.type==="bulletList")return`<ul style="list-style-type:disc;padding-left:1.5em">${t.content?te(t.content,r):""}</ul>`;if(t.type==="orderedList")return`<ol style="list-style-type:decimal;padding-left:1.5em">${t.content?te(t.content,r):""}</ol>`;if(t.type==="listItem")return`<li>${t.content?te(t.content,r):""}</li>`;if(t.type==="blockquote"){let n=t.content?te(t.content,r):"";return`<blockquote${t.attrs?.dir?` dir="${t.attrs.dir}"`:""} style="border-inline-start:3px solid #d6d3cc;padding-inline-start:1em;margin:0.75em 0;color:#565b66;font-style:italic">${n}</blockquote>`}if(t.type==="resizableImage"){let n=t.attrs??{},a=Vr(n.width),s=Vr(n.height);return`<img src="${rr(n.src??"")}" alt="${rr(n.alt??"")}" style="display:inline-block;vertical-align:middle;max-width:100%;${a?`width:${a};`:""}${s?`height:${s};`:""}"/>`}if(t.type==="resizableAudio"){let n=t.attrs??{};return`<span style="display:inline-flex;vertical-align:middle;align-items:center;background:#f1f5f9;border-radius:${E("8px")};padding:${E("4px")} ${E("8px")};max-width:100%"><audio controls src="${rr(n.src??"")}" style="display:block;width:${E("320px")};max-width:100%"></audio></span>`}if(t.type==="resizableVideo"){let n=t.attrs??{},a=Vr(n.width),s=Vr(n.height);return`<video src="${rr(n.src??"")}" controls style="display:inline-block;vertical-align:middle;max-width:100%;${a?`width:${a};`:""}${s?`height:${s};`:""}"></video>`}if(t.type==="youtubeEmbed"){let n=t.attrs??{};return`<iframe src="https://www.youtube.com/embed/${rr(n.videoId??"")}" width="${n.width||480}" height="${n.height||270}" allowfullscreen frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" style="display:inline-block;vertical-align:middle;border:0;width:${Ee(n.width||480)};height:${Ee(n.height||270)}"></iframe>`}return t.type==="inlineMath"?`<span dir="ltr" class="math-inline" style="unicode-bidi:isolate;display:inline-block">${Ze(t.attrs?.latex??"",!1,!0)}</span>`:t.type==="blockMath"?`<div dir="ltr" class="math-block" style="unicode-bidi:isolate;text-align:center;margin:1em 0">${Ze(t.attrs?.latex??"",!0,!0)}</div>`:t.type==="variable"?`<span class="variable">{${rr(t.attrs?.name??"")}}</span>`:""}).join("")}function Vr(e){return e==null||e===""?null:Ee(e)??null}function rr(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}import{jsx as ls}from"react/jsx-runtime";import{createContext as ds,useContext as Zn,useMemo as ea}from"react";var ps={sm:.875,md:1,lg:1.25,xl:1.5},zt=ds(null);function ms(e,r){let t={...e??{}};if(r)for(let[n,a]of Object.entries(r))a!==void 0&&(t[n]=a);return t}function us(e){return typeof e=="number"?Number.isFinite(e)&&e>0?e:1:e?ps[e]??1:1}function _e(e){let r=e??{};return{scale:us(r.size),sizeSet:r.size!==void 0,choiceLabels:r.choiceLabels??"marks",choiceColumns:r.choiceColumns,layoutBy:r.layoutBy??"window",motion:r.motion??"full",shuffleSeed:r.shuffleSeed}}function we(e){let r=Zn(zt);return ea(()=>ms(r,e),[r,e?.size,e?.choiceLabels,e?.choiceColumns,e?.layoutBy,e?.motion,e?.shuffleSeed])}function ke(){let e=Zn(zt);return ea(()=>_e(e),[e])}function Re({display:e,children:r}){let t=we(e);return ls(zt.Provider,{value:t,children:r})}function Ce(e){if(e.sizeSet)return{"--edp-scale":String(e.scale)}}function tr(){let{motion:e}=ke();return{hop:e==="none"?"":"animate-hop",shake:e==="full"?"animate-shake":"",wobble:e==="full"?"animate-wobble":""}}function fs(e){let r=2166136261;for(let t=0;t<e.length;t++)r^=e.charCodeAt(t),r=Math.imul(r,16777619);return r>>>0}function hs(e){return()=>{e=e+1831565813|0;let r=Math.imul(e^e>>>15,1|e);return r=r+Math.imul(r^r>>>7,61|r)^r,((r^r>>>14)>>>0)/4294967296}}function Ar(e,r){let t=[...e],n=hs(fs(r));for(let a=t.length-1;a>0;a--){let s=Math.floor(n()*(a+1));[t[a],t[s]]=[t[s],t[a]]}return t}import{Fragment as ra,jsx as oe,jsxs as gs}from"react/jsx-runtime";import{useState as nt,useEffect as na,useRef as ta,useLayoutEffect as bs,useCallback as xs}from"react";import{createPortal as ys}from"react-dom";import vs from"clsx";var ws=typeof window<"u"?bs:na;function Dt({node:e}){if(e.type==="text"){if(!e.marks||e.marks.length===0)return oe(ra,{children:e.text});let r=e.text||"";for(let t of e.marks)t.type==="bold"?r=oe("strong",{children:r}):t.type==="italic"?r=oe("em",{children:r}):t.type==="underline"?r=oe("u",{children:r}):t.type==="strike"?r=oe("s",{children:r}):t.type==="textStyle"&&t.attrs?.color&&(r=oe("span",{style:{color:t.attrs.color},children:r}));return oe(ra,{children:r})}return e.type==="paragraph"?oe("span",{className:"block",children:e.content?.map((r,t)=>oe(Dt,{node:r},t))??oe("br",{})}):e.type==="hardBreak"?oe("br",{}):e.content?oe("span",{className:"block",children:e.content.map((r,t)=>oe(Dt,{node:r},t))}):null}function ks({nodes:e}){return oe("span",{className:"block space-y-1",style:{color:"var(--ink, #1d2025)"},children:e.map((r,t)=>oe(Dt,{node:r},t))})}function Rs(e,r,t,n=8){let a=e.top-r.height-n;a<n&&(a=e.bottom+n);let s=e.left+e.width/2-r.width/2;return s=Math.max(n,Math.min(s,t-r.width-n)),{top:a,left:s}}function Ye({hint:e}){let r=Z(),[t,n]=nt(!1),[a,s]=nt(!1),[o,i]=nt(null),[c,l]=nt({}),d=ta(null),p=ta(null);na(()=>{if(!a)return;let w=x=>{let _=x.target;d.current&&!d.current.contains(_)&&p.current&&!p.current.contains(_)&&(s(!1),n(!1))};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[a]);let m=xs(()=>{let w=d.current,x=p.current;!w||!x||i(Rs(w.getBoundingClientRect(),x.getBoundingClientRect(),window.innerWidth))},[]);ws(()=>{if(!t){i(null);return}let w=d.current;if(w){let x=getComputedStyle(w);l({direction:x.direction,fontFamily:x.fontFamily,"--edp-scale":x.getPropertyValue("--edp-scale").trim()||"1"})}return m(),window.addEventListener("scroll",m,!0),window.addEventListener("resize",m),()=>{window.removeEventListener("scroll",m,!0),window.removeEventListener("resize",m)}},[t,m]);let g=()=>n(!0),u=()=>{a||n(!1)},b=w=>{w.stopPropagation(),a?(s(!1),n(!1)):(s(!0),n(!0))},v=t&&typeof document<"u"?ys(oe("span",{className:"edpire-scope",style:{...c,display:"contents"},children:oe("span",{ref:p,role:"tooltip",className:"player-blank-hint-pop",onClick:w=>w.stopPropagation(),onMouseEnter:g,onMouseLeave:u,style:{position:"fixed",top:o?o.top:0,left:o?o.left:0,bottom:"auto",transform:"none",margin:0,visibility:o?"visible":"hidden"},children:oe(ks,{nodes:e})})}),document.body):null;return gs("span",{ref:d,className:"relative inline-flex items-center align-middle",onMouseEnter:g,onMouseLeave:u,children:[oe("button",{type:"button",onClick:b,className:vs("player-blank-hint-btn select-none",a&&"player-blank-hint-btn--pinned"),"aria-label":r.showHint,"aria-expanded":t,children:"?"}),v]})}function $e({hint:e}){return!e||e.length===0?null:oe(Ye,{hint:e})}function Cs(e){return[...e].map(r=>({v:r,r:Math.random()})).sort((r,t)=>r.r-t.r).map(r=>r.v)}var As=e=>e.replace(/ {2,}/g,r=>"&nbsp;".repeat(r.length-1)+" "),Ns=new Set(["image","resizableImage","resizableVideo","youtubeEmbed"]);function ia(e){return(e??[]).some(r=>Ns.has(r?.type)||ia(r?.content))}var oa=()=>me("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:3,children:me("path",{d:"M5 13l4 4L19 7"})}),sa=()=>me("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:3,children:me("path",{d:"M6 6l12 12M18 6L6 18"})});function Qr({node:e,validationFeedback:r}){let t=le(),n=Z(),a=ke(),s=tr(),{id:o,content:i,attrs:c}=e,l=c.shuffle??!1,d="prompt"in c?c.prompt:void 0,p="separator"in c?c.separator??"/":"/",m="pickLimit"in c&&c.pickLimit?c.pickLimit:1,g="layout"in c?c.layout??"row":"row",u=e.type==="inlineChoiceSet",b=JSON.stringify(i),v=l&&a.shuffleSeed!==void 0,w=_s(()=>v?Ar(i,`${a.shuffleSeed}:${o}`):null,[v,a.shuffleSeed,o,b]),[x,_]=aa(i);Ot(()=>{v||_(l?Cs(i):i)},[l,v,b]);let h=w??x,[y,C]=aa(new Set),P=r?.showFeedback??!1,$=r?.correctChoiceIds||[];Ot(()=>{let D=X=>{let T=X.answers.find(F=>F.nodeId===o&&F.type==="choiceSet");T&&"selectedIds"in T.answer&&C(new Set(T.answer.selectedIds))};return t.on("answers:prefill",D),()=>t.off("answers:prefill",D)},[o,t]),Ot(()=>{t.emit({type:"answer:changed",answer:{nodeId:o,type:"choiceSet",timestamp:Date.now(),answer:{selectedIds:Array.from(y)}}})},[y,o,t]);let R=D=>{P||C(X=>{let k=new Set(X);return m===1?k.has(D)?k.delete(D):(k.clear(),k.add(D)):k.has(D)?k.delete(D):k.size<m&&k.add(D),k})},f=D=>As(te(D.content)),I=D=>{let X=y.has(D),k=$.includes(D);return P?k&&X?"correct":k&&!X?"correct-unchosen":!k&&X?"incorrect":"muted":X?"selected":"idle"},A={idle:"",selected:"player-choice--selected",correct:Be("player-choice--correct",s.hop),"correct-unchosen":"player-choice--correct-unchosen",incorrect:Be("player-choice--incorrect",s.shake),muted:"player-choice--muted"},H={idle:"",selected:"player-inline-choice--selected",correct:Be("player-inline-choice--correct",s.hop),"correct-unchosen":"player-inline-choice--correct-unchosen",incorrect:Be("player-inline-choice--incorrect",s.shake),muted:"player-inline-choice--muted"};if(u)return nr("span",{className:"inline-choice",children:[d&&nr("span",{className:"mr-2 font-medium",children:[d,m>1?me("span",{className:"ml-1 opacity-60",children:n.chooseN(m)}):null]}),h.map((D,X)=>nr(Ss,{children:[me("button",{type:"button",disabled:P,onClick:()=>R(D.id),className:Be("player-inline-choice",H[I(D.id)]),"aria-pressed":y.has(D.id),dangerouslySetInnerHTML:{__html:f(D)}}),X<h.length-1&&me("span",{className:"mx-1",children:p})]},D.id)),c.hint&&c.hint.length>0&&me(Ye,{hint:c.hint})]});let S=a.layoutBy==="box",N=a.choiceColumns?Math.min(a.choiceColumns,h.length):0,j=N?{gridAutoRows:"1fr",gridTemplateColumns:`repeat(${N}, minmax(0, 1fr))`}:{gridAutoRows:"1fr"},z=h.some(D=>ia(D.content)),q=a.choiceLabels==="letters",G=D=>n.choiceLetters[D]??String(D+1);return nr("div",{className:Be("cs-player my-4 space-y-3",S&&"cs-player--box"),children:[d&&nr("p",{className:"font-medium",children:[d,m>1?nr("span",{className:"ml-2 text-sm opacity-70",children:["(choose ",m,")"]}):null]}),c.hint&&c.hint.length>0&&me(Ye,{hint:c.hint}),me("div",{className:Be("cs-player__grid",g==="row"&&"cs-player__grid--row"),style:j,children:h.map((D,X)=>{let k=I(D.id),T=k==="incorrect"?"incorrect":k==="correct"||k==="correct-unchosen"?"correct":null;return nr("button",{type:"button",disabled:P,onClick:()=>R(D.id),className:Be("player-choice",z&&"player-choice--tile",A[k]),"aria-pressed":y.has(D.id),children:[me("span",{className:Be("player-choice__mark",m>1?"player-choice__mark--box":"player-choice__mark--radio",q&&"player-choice__mark--letter"),children:q?G(X):k==="incorrect"?me(sa,{}):me(oa,{})}),me("span",{className:"player-choice__text",dangerouslySetInnerHTML:{__html:f(D)}}),q&&T&&me("span",{className:`player-choice__verdict player-choice__verdict--${T}`,"aria-hidden":"true",children:T==="incorrect"?me(sa,{}):me(oa,{})})]},D.id)})})]})}import{jsx as We,Fragment as Es,jsxs as Ft}from"react/jsx-runtime";import{useContext as Ps,useState as Ts,useEffect as jt,useRef as Ls,useCallback as Is}from"react";import ar from"clsx";function Gr({node:e,validationFeedback:r}){let t=le(),n=Z(),a=tr(),{id:s,attrs:o}=e,{placeholder:i="___",width:c="auto",hint:l}=o,d=Ls(null),p=i.trim().split(/\s+/).filter(Boolean).length,m=Ps(kr),g=!m&&c==="auto"&&p>=4,[u,b]=Ts(""),v=r?.showFeedback??!1,w=r?.state,x=w==="validating",_=r?.displayAnswer,h=r?.message;jt(()=>{let $=R=>{let I=R.answers.find(A=>A.nodeId===s&&A.type==="blank");I&&"mode"in I.answer&&I.answer.mode==="typed"&&"text"in I.answer&&b(I.answer.text)};return t.on("answers:prefill",$),()=>t.off("answers:prefill",$)},[s,t]),jt(()=>{t.emit({type:"answer:changed",answer:{nodeId:s,type:"blank",timestamp:Date.now(),answer:{mode:"typed",text:u}}})},[u,s,t]);let y=$=>{b($.target.value)},C=Is(()=>{let $=d.current;$&&($.style.height="auto",$.style.height=`${$.scrollHeight}px`)},[]);jt(()=>{C()},[u,C]);let P=v&&!x;return Ft("span",{className:m?"player-blank-cell":ar("inline-flex flex-wrap items-center gap-x-1 gap-y-0.5 align-middle max-w-full",g&&"w-full"),children:[We("span",{className:m?"player-blank-cell__box":ar("relative inline-block shrink-0 min-w-0 max-w-full",g&&"w-full flex-1"),children:P?We("span",{className:ar("player-typed-blank-feedback",m&&"player-typed-blank-feedback--cell",g&&"w-full",w==="correct"&&ar("player-typed-blank-feedback--correct",a.hop),w==="partial"&&"player-typed-blank-feedback--partial",w==="incorrect"&&ar("player-typed-blank-feedback--incorrect",a.wobble)),children:u||We("span",{className:"opacity-40",children:i})}):Ft(Es,{children:[We("textarea",{ref:d,"aria-label":n.blankAnswerAria,placeholder:i,value:u,onChange:y,disabled:v,rows:1,wrap:m?"off":void 0,className:ar("player-typed-blank",m&&"player-typed-blank--cell",g&&"w-full",x&&"player-typed-blank--pending"),style:m?void 0:c!=="auto"?{width:c}:g?{width:"100%"}:{width:`${Math.max(7,u.length+1)}ch`,maxWidth:"100%"}}),!u&&!x&&!m&&We("span",{className:"absolute right-1 top-1/2 -translate-y-1/2 pointer-events-none text-sm",style:{color:"var(--ink-faint, #8d93a0)"},children:"\u270E"}),x&&We("span",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:We("span",{className:"player-typed-blank-spinner","aria-label":n.aiEvaluationInProgressAria})})]})}),v&&w==="incorrect"&&_&&Ft("span",{className:"player-blank-reveal",children:["(",_,")"]}),v&&h&&We("span",{className:ar("player-blank-feedback",w==="correct"&&"player-blank-feedback--correct",w==="partial"&&"player-blank-feedback--partial",w==="incorrect"&&"player-blank-feedback--incorrect"),children:h}),l&&l.length>0&&We(Ye,{hint:l})]})}import{jsx as ot,Fragment as pa,jsxs as Wt}from"react/jsx-runtime";import{useEffect as ma}from"react";import st from"clsx";import{useDroppable as js,useDndContext as Bs}from"@dnd-kit/core";import{jsx as Ms}from"react/jsx-runtime";import{createContext as $s,useCallback as Ke,useContext as zs,useEffect as Ds,useMemo as ca,useRef as Os,useState as Bt}from"react";import{useDndMonitor as Fs}from"@dnd-kit/core";var da=$s(null);function ze(){let e=zs(da);if(!e)throw new Error("usePool must be used within a PoolProvider");return e}function la(e){let r={};for(let t of e??[])t.type==="blank"&&"mode"in t.answer&&t.answer.mode==="choice"&&"choiceId"in t.answer&&t.answer.choiceId&&(r[t.nodeId]={choiceId:t.answer.choiceId,poolId:t.answer.poolId||"",value:t.answer.value||""});return r}function at({children:e,initialAnswers:r}){let t=le(),n=ca(()=>la(r),[r]),[a,s]=Bt(n),[o,i]=Bt({}),[c,l]=Bt({}),d=Os(new Set);Ds(()=>{let h=y=>{let C=la(y.answers);Object.keys(C).length!==0&&s(P=>{if(!Object.entries(C).some(([f,I])=>P[f]?.choiceId!==I.choiceId||P[f]?.poolId!==I.poolId||P[f]?.value!==I.value))return P;let R={...P,...C};return i(f=>{let I={...f};for(let[A,H]of Object.entries(f)){let S=new Set(Object.values(R).filter(N=>N.poolId===A).map(N=>N.choiceId));I[A]={...H,available:new Set(H.choices.map(N=>N.id).filter(N=>!S.has(N)))}}return I}),R})};return t.on("answers:prefill",h),()=>t.off("answers:prefill",h)},[t]);let p=Ke((h,y)=>{i(C=>{let P=C[h];if(!P){let A=new Set;for(let S of Object.values(a))S.poolId===h&&A.add(S.choiceId);let H=new Set(y.map(S=>S.id).filter(S=>!A.has(S)));return{...C,[h]:{choices:y,available:H}}}let $=new Set(P.choices.map(A=>A.id)),R=new Set(y.map(A=>A.id));if(!(y.some(A=>!$.has(A.id))||P.choices.some(A=>!R.has(A.id))))return C;let I=new Set;for(let A of P.available)R.has(A)&&I.add(A);for(let A of y)$.has(A.id)||I.add(A.id);return{...C,[h]:{choices:y,available:I}}})},[a]),m=Ke((h,y)=>{l(C=>{let P=C[h]??[];return P.includes(y)?C:{...C,[h]:[...P,y]}}),!d.current.has(y)&&!a[y]&&(d.current.add(y),t.emit({type:"answer:changed",answer:{nodeId:y,type:"blank",timestamp:Date.now(),answer:{mode:"choice",choiceId:"",poolId:h,value:""}}}))},[a,t]),g=Ke(h=>(c[h]??[]).find(C=>!a[C])??null,[c,a]),u=Ke((h,y,C,P)=>{s($=>{let R=$[h];return R&&i(f=>{let I=f[R.poolId];if(!I)return f;let A=new Set(I.available);return A.add(R.choiceId),{...f,[R.poolId]:{...I,available:A}}}),{...$,[h]:{choiceId:C,value:P,poolId:y}}}),i($=>{let R=$[y];if(!R)return $;let f=new Set(R.available);return f.delete(C),{...$,[y]:{...R,available:f}}}),t.emit({type:"answer:changed",answer:{nodeId:h,type:"blank",timestamp:Date.now(),answer:{mode:"choice",choiceId:C,poolId:y,value:P}}})},[t]),b=Ke(h=>{let y=a[h];if(!y)return;let{poolId:C,choiceId:P}=y;i($=>{let R=$[C];if(!R)return $;let f=new Set(R.available);return f.add(P),{...$,[C]:{...R,available:f}}}),s($=>{let{[h]:R,...f}=$;return f}),t.emit({type:"answer:changed",answer:{nodeId:h,type:"blank",timestamp:Date.now(),answer:{mode:"choice",choiceId:"",poolId:C,value:""}}})},[a,t]),v=Ke((h,y)=>o[h]?.available.has(y)??!1,[o]),w=Ke((h,y)=>o[h]?.choices.find(C=>C.id===y),[o]),x=Ke(()=>{s({}),i(h=>{let y={};for(let[C,P]of Object.entries(h))y[C]={choices:P.choices,available:new Set(P.choices.map($=>$.id))};return y});for(let[h,y]of Object.entries(c))for(let C of y)t.emit({type:"answer:changed",answer:{nodeId:C,type:"blank",timestamp:Date.now(),answer:{mode:"choice",choiceId:"",poolId:h,value:""}}})},[c,t]);Fs({onDragEnd(h){window.dispatchEvent(new CustomEvent("dnd-drop",{detail:{active:h.active,over:h.over}}))}});let _=ca(()=>({blanks:a,pools:o,registerPool:p,registerBlank:m,fill:u,back:b,isAvailable:v,getChoice:w,firstEmptyBlank:g,resetAllAnswers:x}),[a,o,p,m,u,b,v,w,g,x]);return Ms(da.Provider,{value:_,children:e})}function Yr({node:e,validationFeedback:r}){let{id:t,attrs:n}=e,{poolId:a,placeholder:s="___",hint:o}=n,{blanks:i,fill:c,back:l,getChoice:d,registerBlank:p}=ze(),m=Z(),g=tr(),u=i[t],b=!!u?.choiceId,v=r?.showFeedback??!1,w=r?.state,x=r?.correctChoiceIds??[],_=v&&w==="incorrect"&&x.length>0?d(a||"",x[0]):void 0,h=_?_.html.replace(/<\/?[^>]+(>|$)/g,""):void 0,{setNodeRef:y,isOver:C}=js({id:t,data:{type:"blank",blankId:t,poolId:a}}),{active:P}=Bs(),$=!!P&&P.data.current?.poolId===a;return ma(()=>{p(a||"",t)},[a,t,p]),ma(()=>{let I=A=>{let H=A,{active:S,over:N}=H.detail||{};if(!N||N.id!==t)return;let{choiceId:j,poolId:z}=S?.data.current||{};if(!j||z!==a)return;let q=d(a||"",j);if(!q)return;let G=q.html.replace(/<\/?[^>]+(>|$)/g,"");c(t,a||"",j,G)};return window.addEventListener("dnd-drop",I),()=>window.removeEventListener("dnd-drop",I)},[t,a,d,c]),Wt(pa,{children:[ot("span",{ref:y,onClick:()=>{b&&!v&&l(t)},className:st("player-choice-blank",C&&"player-choice-blank--over",!C&&$&&!b&&!v&&"player-choice-blank--target",b&&!v&&!C&&"player-choice-blank--filled",v&&w==="correct"&&st("player-choice-blank--correct",g.hop),v&&w==="partial"&&st("player-choice-blank--partial",g.hop),v&&w==="incorrect"&&st("player-choice-blank--incorrect",g.wobble)),title:b&&!v?m.clickToRemove:void 0,"data-node-id":t,"data-pool-id":a,children:b?Wt(pa,{children:[ot("span",{children:u.value}),!v&&ot("span",{className:"player-choice-blank__clear",children:"\xD7"})]}):s}),h&&Wt("span",{className:"player-blank-reveal",children:["(",h,")"]}),ot($e,{hint:o})]})}import{jsx as Ut,jsxs as Gs}from"react/jsx-runtime";import{useEffect as wa,useRef as Ys,useState as Ks}from"react";import Xs from"clsx";import{jsx as va,jsxs as Us}from"react/jsx-runtime";import Vs from"clsx";import{useDraggable as Qs}from"@dnd-kit/core";import{jsx as or,jsxs as ua}from"react/jsx-runtime";import{useEffect as fa,useState as ha}from"react";import Ws from"clsx";var ga="edpire:tap-hint-placed",ba=2;function qs(e){let t=(()=>{try{return Number(e?.getItem(ga))||0}catch{return 0}})(),n=new Set,a=new Set,s=()=>n.forEach(o=>o());return{done:()=>t>=ba,placed:()=>t,recordPlacement(){if(!(t>=ba)){t+=1;try{e?.setItem(ga,String(t))}catch{}s()}},setOnScreen(o,i){let c=a.has(o);i!==c&&(i?a.add(o):a.delete(o),s())},owner(){let o=null;for(let i of a)(!o||i.compareDocumentPosition(o)&4)&&(o=i);return o},subscribe(o){return n.add(o),()=>{n.delete(o)}}}}var qt=null;function Ht(){if(!qt){let e=null;try{e=typeof window<"u"?window.localStorage:null}catch{e=null}qt=qs(e)}return qt}function xa(){typeof window>"u"||Ht().recordPlacement()}function Hs(){try{return window.matchMedia("(hover: none) and (pointer: coarse)").matches}catch{return!1}}function it(e,r){let[,t]=ha(0),[n,a]=ha(!1);if(fa(()=>{a(Hs())},[]),fa(()=>{let o=e.current;if(!n||!o)return;let i=Ht();if(i.done())return;let c=i.subscribe(()=>t(d=>d+1));if(!r||typeof IntersectionObserver>"u")return()=>{i.setOnScreen(o,!1),c()};let l=new IntersectionObserver(d=>{for(let p of d)i.setOnScreen(o,p.isIntersecting)},{threshold:.6});return l.observe(o),()=>{l.disconnect(),i.setOnScreen(o,!1),c()}},[e,n,r]),!n||!r||typeof window>"u")return!1;let s=Ht();return!s.done()&&s.owner()===e.current}function ya(){let{motion:e}=ke();return ua("span",{className:Ws("player-tap-hint",e==="none"&&"player-tap-hint--still"),"aria-hidden":"true",children:[or("span",{className:"player-tap-hint__ripple"}),or("svg",{className:"player-tap-hint__hand",viewBox:"0 0 24 24",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[{stroke:"#ffffff",strokeWidth:4.5},{stroke:"currentColor",strokeWidth:1.75}].map((r,t)=>ua("g",{...r,children:[or("path",{d:"M22 14a8 8 0 0 1-8 8"}),or("path",{d:"M18 11v-1a2 2 0 0 0-2-2a2 2 0 0 0-2 2"}),or("path",{d:"M14 10V9a2 2 0 0 0-2-2a2 2 0 0 0-2 2v1"}),or("path",{d:"M10 9.5V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v10"}),or("path",{d:"M18 11a2 2 0 1 1 4 0v3a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15"})]},t))})]})}function pr({poolId:e,data:r,isInline:t=!1,tapHint:n=!1}){let{isAvailable:a,firstEmptyBlank:s,fill:o}=ze(),{id:i,html:c}=r,l=!a(e,i),{setNodeRef:d,attributes:p,listeners:m,transform:g,isDragging:u}=Qs({id:i,data:{type:"choice",choiceId:i,poolId:e,html:c},disabled:l});if(l)return null;let b=_=>_.replace(/<\/?[^>]+(>|$)/g,""),v=()=>{let _=s(e);if(_){let h=b(c);o(_,e,i,h),xa()}},w=g?{transform:`translate3d(${g.x}px, ${g.y}px, 0)`}:void 0;return Us(t?"span":"div",{ref:d,style:w,className:Vs("player-bank-pill",u&&"player-bank-pill--dragging",n&&!u&&"player-bank-pill--hinted",t&&"mx-1"),...p,...m,onClick:v,children:[va("span",{dangerouslySetInnerHTML:{__html:c},className:"pointer-events-none whitespace-pre-wrap break-words"}),n&&!u&&va(ya,{})]})}function Kr({node:e}){let r=Z(),{id:t,attrs:n,content:a}=e,{shuffle:s=!0,equalWidth:o=!1}=n,{registerPool:i,isAvailable:c}=ze(),l=Ys(null),[d,p]=Ks(()=>a.map(u=>({id:u.id,html:te(u.content)})));wa(()=>{let u=a.map(b=>({id:b.id,html:te(b.content)}));p(s?[...u].map(b=>({v:b,r:Math.random()})).sort((b,v)=>b.r-v.r).map(b=>b.v):u)},[s,JSON.stringify(a)]),wa(()=>{i(t,d)},[t,d,i]);let m=d.find(u=>c(t,u.id))?.id,g=it(l,m!==void 0);return Gs("div",{ref:l,className:"player-word-bank",children:[Ut("div",{className:"player-word-bank__label",children:r.wordBank}),Ut("div",{className:Xs("player-word-bank__items",o&&"player-word-bank__items--grid"),children:d.map(u=>Ut(pr,{poolId:t,data:u,tapHint:g&&u.id===m},u.id))})]})}import{jsx as Vt,jsxs as Js}from"react/jsx-runtime";import{useEffect as ka,useRef as Zs,useState as ei}from"react";function Xr({node:e}){let{id:r,attrs:t,content:n}=e,{shuffle:a=!0,separator:s=" "}=t,{registerPool:o,isAvailable:i}=ze(),c=Zs(null),[l,d]=ei(()=>n.map(g=>({id:g.id,html:te(g.content,{stripParagraphs:!0})})));ka(()=>{let g=n.map(u=>({id:u.id,html:te(u.content,{stripParagraphs:!0})}));d(a?[...g].map(u=>({v:u,r:Math.random()})).sort((u,b)=>u.r-b.r).map(u=>u.v):g)},[a,JSON.stringify(n)]),ka(()=>{o(r,l)},[r,l,o]);let p=l.find(g=>i(r,g.id))?.id,m=it(c,p!==void 0);return Vt("span",{ref:c,style:{display:"inline-flex",flexWrap:"wrap",gap:E("0.25rem"),alignItems:"center"},children:l.map((g,u)=>Js("span",{children:[Vt(pr,{poolId:r,data:g,isInline:!0,tapHint:m&&g.id===p}),u<l.length-1&&Vt("span",{children:s})]},g.id))})}import{jsx as mr,jsxs as Yt}from"react/jsx-runtime";import{useState as Kt,useEffect as Xt,useMemo as ai}from"react";import{Check as oi,X as si}from"lucide-react";import{jsx as ue,jsxs as sr}from"react/jsx-runtime";import{useState as Qt,useMemo as Gt,useRef as ct,useCallback as ri,useLayoutEffect as ti}from"react";var Ra="#1d2025",Sa="#8d93a0",_a="#1f8a4c",Ca="#d23b2b",ni=11;function Aa({leftItems:e,rightItems:r,connections:t,direction:n,disabled:a,feedback:s,onConnectionsChange:o}){let[i,c]=Qt(null),[l,d]=Qt(null),[p,m]=Qt(new Map),g=ct(null),u=ct(new Map),b=ct("mouse"),v=s?.showFeedback??!1,w=Gt(()=>{let k=new Map;if(s?.pairFeedback)for(let T of s.pairFeedback)k.set(`${T.leftId}-${T.rightId}`,T.correct);return k},[s]),x=Gt(()=>{let k=new Map;return s?.correctPairings?.forEach(T=>k.set(T.leftId,T.rightId)),k},[s]),_=Gt(()=>{let k=new Map;return s?.correctPairings?.forEach(T=>k.set(T.rightId,T.leftId)),k},[s]),h=new Map,y=new Map;t.forEach((k,T)=>{h.set(k.leftId,T),y.set(k.rightId,T)});let C=k=>{let T=t[k];if(!v||!T)return null;let F=w.get(`${T.leftId}-${T.rightId}`);return F===!0?"correct":F===!1?"incorrect":null},P=ri(()=>{if(!g.current)return;let k=g.current.getBoundingClientRect(),T=new Map;u.current.forEach((F,U)=>{if(F){let Q=F.getBoundingClientRect();T.set(U,new DOMRect(Q.left-k.left,Q.top-k.top,Q.width,Q.height))}}),m(T)},[]);ti(()=>{P();let k=new ResizeObserver(P);return g.current&&k.observe(g.current),()=>k.disconnect()},[P,t,e,r]);let $=8,R=(k,T)=>{let F=p.get(k);if(!F)return null;let U=F.y+F.height/2;return T==="left"?{x:F.x+F.width,y:U}:{x:F.x-$,y:U}},f=(k,T)=>{if(a)return;let U=(T==="left"?h:y).has(k),Q=i?.id===k&&i?.side===T,be=i!==null&&i.side!==T;if(Q){c(null);return}if(be){let ie=T==="right"?i.id:k,ae=T==="left"?i.id:k,ee=t.filter(ne=>ne.leftId!==ie&&ne.rightId!==ae);ee.push({leftId:ie,rightId:ae}),o(ee),c(null);return}if(U&&!i){let ie=T==="left"?t.filter(ae=>ae.leftId!==k):t.filter(ae=>ae.rightId!==k);o(ie);return}c({id:k,side:T})},I=ct(null),A=(k,T,F)=>{if(a||(b.current=F.pointerType,F.pointerType==="touch"))return;F.currentTarget.setPointerCapture(F.pointerId);let U=g.current.getBoundingClientRect();I.current={x:F.clientX-U.left,y:F.clientY-U.top},d({fromId:k,fromSide:T,x:F.clientX-U.left,y:F.clientY-U.top,overId:null,overSide:null})},H=k=>{if(!l)return;let T=g.current.getBoundingClientRect(),F=k.clientX-T.left,U=k.clientY-T.top,Q=l.fromSide==="left"?"right":"left",be=Q==="left"?e:r,ie=null,ae=null;for(let ee of be){let ne=p.get(ee.id);if(ne&&F>=ne.x&&F<=ne.x+ne.width&&U>=ne.y&&U<=ne.y+ne.height){ie=ee.id,ae=Q;break}}d(ee=>ee?{...ee,x:F,y:U,overId:ie,overSide:ae}:null)},S=k=>{if(!l)return;let T=g.current.getBoundingClientRect(),F=k.clientX-T.left,U=k.clientY-T.top,Q=I.current;if((Q?Math.hypot(F-Q.x,U-Q.y):999)<8){d(null),f(l.fromId,l.fromSide);return}if(l.overId&&l.overSide){let ie=l.fromSide==="left"?l.fromId:l.overId,ae=l.fromSide==="right"?l.fromId:l.overId,ee=t.filter(ne=>ne.leftId!==ie&&ne.rightId!==ae);ee.push({leftId:ie,rightId:ae}),o(ee)}d(null),c(null)},N=(k,T)=>{if(!v)return null;let U=(T==="left"?h:y).get(k.id);if(U!==void 0){let Q=t[U];if(w.get(`${Q.leftId}-${Q.rightId}`)===!0)return null}if(T==="left"){let Q=x.get(k.id);return r.find(be=>be.id===Q)?.content??null}else{let Q=_.get(k.id);return e.find(be=>be.id===Q)?.content??null}},j=(k,T)=>{let U=(T==="left"?h:y).get(k.id),Q=U!==void 0,be=i?.id===k.id&&i?.side===T,ie=i!==null&&i.side!==T&&!Q,ae=l?.overId===k.id&&l?.overSide===T,ee=Q?C(U):null,ne=Q?U+1:null,Ne="matching-player__item";Q&&(Ne+=" matching-player__item--matched"),ee==="correct"&&(Ne+=" matching-player__item--correct"),ee==="incorrect"&&(Ne+=" matching-player__item--incorrect"),be&&(Ne+=" matching-player__item--selected"),(ie||ae)&&(Ne+=" matching-player__item--available"),a&&(Ne+=" matching-player__item--disabled");let Qe=N(k,T);return sr("button",{ref:V=>{V?u.current.set(k.id,V):u.current.delete(k.id)},type:"button",className:Ne,onPointerDown:V=>A(k.id,T,V),onClick:()=>{b.current==="touch"&&f(k.id,T)},"aria-pressed":be,children:[T==="right"&&ue("span",{className:"matching-player__connector matching-player__connector--right","aria-hidden":!0,children:sr("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:[ue("circle",{cx:"9",cy:"9",r:"8",stroke:"currentColor",strokeWidth:"1.5",fill:"currentColor",fillOpacity:"0.08"}),ue("path",{d:"M12 9H6M8.5 6.5L6 9l2.5 2.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),Q&&T==="left"&&ue("span",{className:"matching-player__pair-num","aria-hidden":!0,children:ne}),ue("span",{className:"matching-player__item-text",dangerouslySetInnerHTML:{__html:te(k.content)}}),Qe&&sr("span",{className:"matching-player__correct-hint",children:["(",ue("span",{dangerouslySetInnerHTML:{__html:te(Qe)}}),")"]}),Q&&T==="right"&&ue("span",{className:"matching-player__pair-num","aria-hidden":!0,children:ne}),T==="left"&&ue("span",{className:"matching-player__connector matching-player__connector--left","aria-hidden":!0,children:sr("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:[ue("circle",{cx:"9",cy:"9",r:"8",stroke:"currentColor",strokeWidth:"1.5",fill:"currentColor",fillOpacity:"0.08"}),ue("path",{d:"M6 9h6M9.5 6.5L12 9l-2.5 2.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]},k.id)},z=n==="ltr"?e:r,q=n==="ltr"?r:e,G=n==="ltr"?"left":"right",D=n==="ltr"?"right":"left";return sr("div",{ref:g,className:`matching-player__arena${l?" matching-player__arena--dragging":""}`,onPointerMove:H,onPointerUp:S,children:[sr("svg",{className:"matching-player__svg","aria-hidden":!0,children:[ue("defs",{children:[["mp-arrow-ink",Ra],["mp-arrow-correct",_a],["mp-arrow-incorrect",Ca],["mp-arrow-ghost",Sa]].map(([k,T])=>ue("marker",{id:k,markerUnits:"userSpaceOnUse",markerWidth:"11",markerHeight:"9",refX:"0",refY:"4.5",orient:"auto",children:ue("polygon",{points:"0 0, 11 4.5, 0 9",fill:T})},k))}),t.map(k=>{let T=R(k.leftId,"left"),F=R(k.rightId,"right");if(!T||!F)return null;let U=F.x-ni,Q=Math.max(16,Math.abs(U-T.x)*.4),be=`M ${T.x} ${T.y} C ${T.x+Q} ${T.y}, ${U-Q} ${F.y}, ${U} ${F.y}`,ie=v?w.get(`${k.leftId}-${k.rightId}`):void 0;return ue("path",{d:be,stroke:ie===!0?_a:ie===!1?Ca:Ra,strokeWidth:"2.5",fill:"none",markerEnd:`url(#${ie===!0?"mp-arrow-correct":ie===!1?"mp-arrow-incorrect":"mp-arrow-ink"})`},`${k.leftId}-${k.rightId}`)}),l&&(()=>{let k=R(l.fromId,l.fromSide);if(!k)return null;let T=Math.abs(l.x-k.x)*.35,F=`M ${k.x} ${k.y} C ${k.x+T} ${k.y}, ${l.x-T} ${l.y}, ${l.x} ${l.y}`;return ue("path",{d:F,stroke:Sa,strokeWidth:"2",strokeDasharray:"6 4",fill:"none",markerEnd:"url(#mp-arrow-ghost)"})})()]}),sr("div",{className:"matching-player__columns",children:[ue("div",{className:"matching-player__column",children:z.map(k=>j(k,G))}),ue("div",{className:"matching-player__column",children:q.map(k=>j(k,D))})]})]})}var Na=e=>Number.isInteger(e)?String(e):e.toFixed(2);function Ea(e){return[...e].map(r=>({v:r,r:Math.random()})).sort((r,t)=>r.r-t.r).map(r=>r.v)}function Jr({node:e,validationFeedback:r}){let t=le(),{shuffleSeed:n,layoutBy:a}=ke(),{id:s,attrs:o,leftItems:i,rightItems:c}=e,{direction:l,shuffle:d,hint:p}=o,m=JSON.stringify(i),g=JSON.stringify(c),u=d&&n!==void 0,b=ai(()=>u?{left:Ar(i,`${n}:${s}:left`),right:Ar(c,`${n}:${s}:right`)}:null,[u,n,s,m,g]),[v,w]=Kt(i),[x,_]=Kt(c);Xt(()=>{u||(d?(w(Ea(i)),_(Ea(c))):(w(i),_(c)))},[d,u,m,g]);let h=b?.left??v,y=b?.right??x,[C,P]=Kt([]),$=r?.showFeedback??!1;Xt(()=>{let S=N=>{let z=N.answers.find(q=>q.nodeId===s&&q.type==="matchingSet");z&&"connections"in z.answer&&P(z.answer.connections)};return t.on("answers:prefill",S),()=>t.off("answers:prefill",S)},[t,s]),Xt(()=>{t.emit({type:"answer:changed",answer:{nodeId:s,type:"matchingSet",timestamp:Date.now(),answer:{connections:C}}})},[t,s,C]);let R=S=>{$||P(S)},f=r?.score,I=r?.maxScore,A=$&&f!=null&&I!=null,H=A?f>=I?"correct":f>0?"partial":"incorrect":null;return Yt("div",{className:a==="box"?"matching-player matching-player--box":"matching-player",children:[p&&p.length>0&&mr("div",{className:"matching-player-hintrow",children:mr($e,{hint:p})}),mr(Aa,{leftItems:h,rightItems:y,connections:C,direction:l,disabled:$,feedback:r,onConnectionsChange:R}),A&&Yt("div",{className:"matching-player-feedback matching-player-feedback--"+H,children:[H==="correct"&&mr(oi,{size:15,style:re(15)}),H==="incorrect"&&mr(si,{size:15,style:re(15)}),mr("span",{children:H==="correct"?"All matched":H==="partial"?"Partial credit":"Not matched"}),Yt("span",{className:"matching-player-score",children:[Na(f)," / ",Na(I)]})]})]})}import{jsxs as ur,jsx as De,Fragment as ii}from"react/jsx-runtime";import{useState as Pa,useEffect as Jt,useRef as ci,useCallback as Ta}from"react";import lt from"clsx";function Zr({node:e,validationFeedback:r}){let t=le(),n=Z(),{id:a,attrs:s}=e,{placeholder:o,minWords:i=0,maxWords:c=500,hint:l}=s,[d,p]=Pa(""),[m,g]=Pa(0),u=r?.showFeedback??!1,b=r?.state,v=c<=30,w=Ta(f=>f.trim().split(/\s+/).filter(Boolean).length,[]);Jt(()=>{let f=I=>{let H=I.answers?.find(S=>S.nodeId===a&&S.type==="aiAnswer");if(H&&H.answer?.text!=null){let S=H.answer.text;p(S),g(w(S))}};return t.on("answers:prefill",f),()=>t.off("answers:prefill",f)},[a,t,w]),Jt(()=>{let f=()=>{p(""),g(0)};return t.on("answers:reset",f),()=>t.off("answers:reset",f)},[t]);let x=ci(null),_=Ta((f,I)=>{x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{t.emit({type:"answer:changed",answer:{nodeId:a,type:"aiAnswer",timestamp:Date.now(),answer:{text:f,wordCount:I}}})},300)},[a,t]);Jt(()=>{t.emit({type:"answer:changed",answer:{nodeId:a,type:"aiAnswer",timestamp:Date.now(),answer:{text:"",wordCount:0}}})},[]);let h=f=>{if(u)return;let I=w(f);p(f),g(I),_(f,I)},y=b==="validating",C=lt("player-ai-count",m>c&&"player-ai-count--over"),P=!u||y?"":b==="correct"?"player-ai-input--correct":b==="incorrect"?"player-ai-input--incorrect":b==="partial"?"player-ai-input--partial":"",$=b==="correct"?"player-ai-feedback--correct":b==="incorrect"?"player-ai-feedback--incorrect":b==="partial"?"player-ai-feedback--partial":"",R=f=>Number.isInteger(f)?String(f):f.toFixed(2);return ur("div",{className:"player-ai",children:[ur("div",{className:"player-ai-counts",children:[ur("span",{className:C,children:[m," / ",c," ",n.openResponseWords]}),i>0&&m<i&&De("span",{className:"player-ai-count player-ai-count--min",children:n.minWordsLabel(i)}),De("span",{style:{marginInlineStart:"auto"},children:De($e,{hint:l})})]}),v?De("input",{type:"text",value:d,onChange:f=>h(f.target.value),placeholder:o??n.shortAnswerPlaceholder,"aria-label":n.blankAnswerAria,disabled:u,className:lt("player-ai-input",P)}):De("textarea",{value:d,onChange:f=>h(f.target.value),placeholder:o??n.longAnswerPlaceholder,"aria-label":n.blankAnswerAria,disabled:u,rows:5,className:lt("player-ai-input player-ai-input--multiline",P)}),u&&r&&De("div",{className:lt("player-ai-feedback",$),children:y?ur("div",{className:"player-ai-validating",children:[De("span",{className:"player-ai-spinner"}),De("span",{children:n.aiEvaluationInProgress})]}):ur(ii,{children:[r.message&&De("p",{className:"player-ai-message",children:r.message}),r.score!=null&&r.maxScore!=null&&De("div",{className:"player-ai-score-row",children:ur("span",{className:"player-ai-score",children:[R(r.score)," / ",R(r.maxScore)]})})]})})]})}import{jsx as M,jsxs as Y}from"react/jsx-runtime";import{useState as ve,useEffect as Te,useRef as Pe,useCallback as dt}from"react";import{useEditor as li,EditorContent as di}from"@tiptap/react";import pi from"@tiptap/starter-kit";import qe from"clsx";import{FolderOpen as mi,Mic as ui,Video as Ma,Monitor as fi,Clock as hi,Image as gi,FileText as $a,Music as bi,Link2 as xi}from"lucide-react";function za(e){return e.trim().split(/\s+/).filter(Boolean).length}function Da(e){return e.length}function yi(e){let r=t=>t.map(n=>(n.text??"")+(n.content?r(n.content):"")).join(" ");return za(r(e))}function vi(e){let r=t=>t.map(n=>(n.text??"")+(n.content?r(n.content):"")).join("");return Da(r(e))}function La(e){if(!isFinite(e.duration)){e.currentTime=1e101;let r=()=>{e.currentTime=0,e.removeEventListener("timeupdate",r)};e.addEventListener("timeupdate",r)}}function wi(e){return/youtube\.com|youtu\.be/i.test(e)?"youtube":/vimeo\.com/i.test(e)?"vimeo":"other"}function ki(e){let r=e.match(/[?&]v=([^&]+)/)||e.match(/youtu\.be\/([^?]+)/)||e.match(/embed\/([^?]+)/);return r?r[1]:null}function Ia(e){let r=Math.floor(e/60),t=e%60;return`${r}:${t.toString().padStart(2,"0")}`}function et({node:e,validationFeedback:r,readOnly:t=!1,mediaHandler:n}){let a=le(),s=Z(),{id:o,attrs:i}=e,{mode:c,placeholder:l,allowFormatting:d,wordLimit:p,characterLimit:m,allowedTypes:g,allowMultiple:u,fileInstructions:b,maxDuration:v,hint:w}=i,x=t||(r?.showFeedback??!1),_=r?.state,h=Pe(null),y=dt(f=>{h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{let I=f.files?.map(A=>({url:A.url,mimeType:A.kind==="videoLink"?"video/x-link":A.mimeType,name:A.kind==="videoLink"?void 0:A.name,duration:A.kind==="videoLink"?void 0:A.duration}));a.emit({type:"answer:changed",answer:{nodeId:o,type:"openResponse",timestamp:Date.now(),answer:{...f,files:I}}})},300)},[o,a]);Te(()=>{y({})},[]);let[C,P]=ve([]);Te(()=>{(c==="file"||c==="text+file")&&c==="file"&&y({files:C})},[C,c]),Te(()=>{let f=()=>{P([])};return a.on("answers:reset",f),()=>a.off("answers:reset",f)},[a]),Te(()=>{let f=I=>{let H=(I.answers??[]).find(S=>S.nodeId===o&&S.type==="openResponse");H?.answer?.files&&P(H.answer.files)};return a.on("answers:prefill",f),()=>a.off("answers:prefill",f)},[o,a]);let $=r?.showFeedback,R=qe(!$&&"player-or-field--pre",$&&_==="correct"&&"player-or-field--correct",$&&_==="partial"&&"player-or-field--partial",$&&_==="incorrect"&&"player-or-field--incorrect",$&&_==="awaiting_review"&&"player-or-field--review");return Y("div",{className:"my-3 space-y-2",children:[!x&&w&&w.length>0&&M("div",{className:"flex justify-end",children:M(Ye,{hint:w})}),c==="text"&&M(Oa,{nodeId:o,placeholder:l,allowFormatting:d,wordLimit:p,characterLimit:m,isDisabled:x,feedbackBorderClass:R,emitAnswer:f=>y({text:f}),answerBus:a}),c==="file"&&M(Zt,{allowedTypes:g??["image"],allowMultiple:!!u,fileInstructions:b,isDisabled:x,feedbackBorderClass:R,files:C,setFiles:P,mediaHandler:n,t:s}),(c==="audio"||c==="video"||c==="screen")&&M(Ai,{kind:c,maxDuration:v,isDisabled:x,feedbackBorderClass:R,mediaHandler:n,emitAnswer:f=>y({recording:f}),t:s}),c==="text+file"&&M(Ci,{nodeId:o,placeholder:l,allowFormatting:d,wordLimit:p,characterLimit:m,allowedTypes:g??["image"],allowMultiple:!!u,fileInstructions:b,isDisabled:x,feedbackBorderClass:R,files:C,setFiles:P,emitAnswer:y,answerBus:a,mediaHandler:n,t:s}),r?.showFeedback&&_==="awaiting_review"&&Y("div",{className:"flex items-center gap-2 text-sm border rounded px-3 py-2",style:{color:"var(--almost-ink, #8a5a08)",background:"var(--almost-soft, #fbf1dc)",borderColor:"var(--almost, #c8810e)"},children:[M(hi,{size:15,style:re(15),className:"animate-pulse"}),M("span",{children:s.openResponseAwaitingReview})]}),r?.showFeedback&&_!=="awaiting_review"&&r.teacherFeedback&&M(Ni,{feedback:r.teacherFeedback,feedbackState:_,score:r.score,t:s})]})}function Oa({nodeId:e,placeholder:r,allowFormatting:t,wordLimit:n,characterLimit:a,isDisabled:s,feedbackBorderClass:o,emitAnswer:i,answerBus:c}){let l=Z(),[d,p]=ve(""),[m,g]=ve(0),[u,b]=ve(0),v=Pe(null),w=dt(()=>{let N=v.current;N&&(N.style.height="auto",N.style.height=`${N.scrollHeight}px`)},[]),x=li({extensions:[pi.configure({heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1})],immediatelyRender:!1,editable:!s,content:"",onUpdate({editor:N}){if(s)return;let z=N.getJSON().content??[],q=yi(z),G=vi(z);g(q),b(G),i({content:z,wordCount:q})}});Te(()=>{x&&x.setEditable(!s)},[s,x]);let _=Pe(null);Te(()=>{x&&_.current!==null&&(x.commands.setContent({type:"doc",content:_.current}),_.current=null)},[x]),Te(()=>{let N=j=>{let z=(j.answers??[]).find(G=>G.nodeId===e&&G.type==="openResponse");if(!z?.answer?.text)return;let q=z.answer.text.content??[];if(t)x?x.commands.setContent({type:"doc",content:q}):_.current=q;else{let G=q.flatMap(D=>D.content?.map(X=>X.text??"")??[D.text??""]).join(`
2
- `);p(G),setTimeout(w,0)}};return c.on("answers:prefill",N),()=>c.off("answers:prefill",N)},[e,c,t,x]),Te(()=>{let N=()=>{t&&x?x.commands.clearContent():(p(""),setTimeout(w,0)),g(0),b(0)};return c.on("answers:reset",N),()=>c.off("answers:reset",N)},[c,t,x,w]);let h=!!n,y=!!a&&!n,C=h?m:u,P=h?n?.max:a?.max,$=h?n?.min:a?.min,R=P!=null&&C>P,f=P!=null&&C>=P*.8&&!R,I=$!=null&&C<$&&C>0,A="text-xs tabular-nums",H=R?{color:"var(--pen, #d23b2b)",fontWeight:500}:f||I?{color:"var(--almost, #c8810e)"}:{color:"var(--ink-faint, #8d93a0)"},S=h?P?`${m} / ${P} ${l.openResponseWords}`:$?`${m} ${l.openResponseWords} (min. ${$})`:`${m} ${l.openResponseWords}`:y?P?`${u} / ${P} ${l.openResponseChars}`:`${u} ${l.openResponseChars}`:null;return t?Y("div",{className:"relative",children:[Y("div",{className:qe("rounded border transition-colors min-h-[120px]",o),children:[!s&&Y("div",{className:"sticky top-0 z-10 flex gap-1 px-2 pt-1.5 pb-1 border-b border-gray-100 bg-white rounded-t",children:[[{label:"B",cmd:"toggleBold",style:"font-bold"},{label:"I",cmd:"toggleItalic",style:"italic"}].map(({label:N,cmd:j,style:z})=>M("button",{type:"button",onMouseDown:q=>{q.preventDefault(),x?.chain().focus()?.[j]().run()},className:`text-xs px-1.5 py-0.5 rounded hover:bg-gray-100 ${z}`,children:N},N)),M("button",{type:"button",onMouseDown:N=>{N.preventDefault(),x?.chain().focus().toggleBulletList().run()},className:"text-xs px-1.5 py-0.5 rounded hover:bg-gray-100",children:"\u2022\u2014"})]}),M(di,{editor:x,className:"prose prose-sm max-w-none p-3 outline-none [&_.ProseMirror]:min-h-[80px] [&_.ProseMirror]:outline-none"})]}),S&&M("div",{className:qe("absolute bottom-2 right-3",A),style:H,children:S})]}):Y("div",{className:"relative",children:[M("textarea",{ref:v,value:d,onChange:N=>{if(s)return;let j=N.target.value;p(j);let z=za(j),q=Da(j);g(z),b(q),w(),i({content:[{type:"paragraph",content:[{type:"text",text:j}]}],wordCount:z})},onInput:w,disabled:s,placeholder:r||l.openResponseTextPlaceholder,rows:4,style:{resize:"none",overflow:"hidden"},className:qe("w-full px-3 py-2 text-base min-h-[100px] rounded border transition-colors outline-none",o,s&&"cursor-default")}),S&&M("div",{className:qe("absolute bottom-2 right-3",A),children:S})]})}var Ri={image:"image/*",pdf:"application/pdf",audio:"audio/*",video:"video/*"},Si={image:M(gi,{size:12,style:re(12)}),pdf:M($a,{size:12,style:re(12)}),audio:M(bi,{size:12,style:re(12)}),video:M(Ma,{size:12,style:re(12)}),videoLink:M(xi,{size:12,style:re(12)})};function Zt({allowedTypes:e,allowMultiple:r,fileInstructions:t,isDisabled:n,files:a,setFiles:s,mediaHandler:o,t:i,compact:c=!1}){let l=Pe(null),[d,p]=ve(!1),[m,g]=ve(!1),[u,b]=ve(""),v=e.some(f=>f!=="videoLink"),w=e.includes("videoLink"),x=r||a.length===0,_=e.filter(f=>f!=="videoLink").map(f=>Ri[f]).filter(Boolean).join(","),h=dt(f=>{s(I=>r?[...I,f]:[f])},[r,s]),y=dt(f=>{s(I=>I.filter((A,H)=>H!==f))},[s]),C=async f=>{if(!(!x||n)){p(!0);try{let I=f.type.startsWith("image/")?"image":f.type==="application/pdf"?"document":f.type.startsWith("audio/")?"audio":f.type.startsWith("video/")?"video":"file";if(o){let A=await o.upload(f,I);h({kind:"file",url:A.url,mimeType:A.mimeType??f.type,name:f.name})}else{let A=URL.createObjectURL(f);h({kind:"file",url:A,mimeType:f.type,name:f.name})}}finally{p(!1)}}},P=async f=>{if(f.preventDefault(),g(!1),n||!x)return;let I=f.dataTransfer.files?.[0];I&&await C(I)},$=()=>{let f=u.trim();f&&(h({kind:"videoLink",url:f,platform:wi(f)}),b(""))},R={image:i.openResponseTypeImage,pdf:i.openResponseTypePdf,audio:i.openResponseTypeAudio,video:i.openResponseTypeVideo,videoLink:i.openResponseTypeVideoLink};return Y("div",{className:"space-y-2",children:[t&&!c&&M("p",{className:"text-sm text-gray-600 italic",children:t}),a.length>0&&M("div",{className:c?"flex flex-wrap gap-1.5":"space-y-2",children:a.map((f,I)=>M(_i,{file:f,onRemove:n?void 0:()=>y(I),compact:c,t:i},I))}),!n&&x&&Y("div",{className:"space-y-2",children:[v&&!c&&Y("div",{onDragOver:f=>{f.preventDefault(),g(!0)},onDragLeave:()=>g(!1),onDrop:P,className:"border-2 border-dashed rounded-lg p-6 text-center transition-colors cursor-pointer",style:{borderColor:m?"var(--ink-faint, #8d93a0)":"var(--line-strong, #d6d3cc)",background:m?"var(--ui-muted, #f5f4f1)":"transparent"},onClick:()=>l.current?.click(),children:[M(mi,{size:26,className:"mx-auto mb-2",style:{...re(26),color:"var(--ink-soft, #565b66)"}}),M("p",{className:"text-sm font-medium",style:{color:"var(--ink-soft, #565b66)"},children:i.openResponseDropZoneLabel}),M("p",{className:"text-xs hover:underline mt-0.5",style:{color:"var(--ink, #1d2025)"},children:i.openResponseDropZoneBrowse}),d&&M("p",{className:"text-xs mt-1 animate-pulse",style:{color:"var(--ink-faint, #8d93a0)"},children:i.openResponseUploading}),M("div",{className:"flex flex-wrap justify-center gap-1.5 mt-3",children:e.filter(f=>f!=="videoLink").map(f=>Y("span",{className:"inline-flex items-center gap-1 text-[10px] px-2 py-0.5 bg-gray-100 text-gray-600 rounded-full",children:[Si[f]," ",R[f]]},f))})]}),v&&c&&M("button",{type:"button",onClick:()=>l.current?.click(),disabled:d,className:"text-xs px-3 py-1.5 rounded border border-dashed disabled:opacity-50",style:{borderColor:"var(--line-strong, #d6d3cc)",color:"var(--ink-soft, #565b66)"},children:d?i.openResponseUploading:`+ ${i.openResponseAttachFile}`}),M("input",{ref:l,type:"file",accept:_,onChange:async f=>{let I=f.target.files?.[0];I&&(await C(I),f.target.value="")},className:"hidden"}),w&&Y("div",{className:"flex gap-2 flex-wrap",children:[M("input",{type:"url",value:u,onChange:f=>b(f.target.value),placeholder:i.openResponseVideoLinkPlaceholder,className:"flex-1 text-sm border rounded px-2 py-1.5 outline-none",style:{borderColor:"var(--line-strong, #d6d3cc)"},onKeyDown:f=>{f.key==="Enter"&&(f.preventDefault(),$())}}),M("button",{type:"button",onClick:$,disabled:!u.trim(),className:"text-sm px-3 py-1.5 rounded text-white disabled:opacity-50",style:{background:"var(--ink, #1d2025)"},children:i.openResponseAddVideoLink})]})]}),n&&a.length===0&&M("p",{className:"text-sm text-gray-400 text-center py-3",children:i.openResponseNoSubmission})]})}function _i({file:e,onRemove:r,compact:t,t:n}){if(e.kind==="videoLink"){let a=e.platform==="youtube"?ki(e.url):null;return Y("div",{className:qe("bg-white rounded border border-gray-200",t?"px-2 py-1 flex items-center gap-1.5":"p-3 space-y-1"),children:[a&&!t&&M("iframe",{src:`https://www.youtube.com/embed/${a}`,width:240,height:135,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,className:"rounded w-full"}),M("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-blue-600 underline truncate block max-w-[200px]",children:e.url}),r&&M("button",{type:"button",onClick:r,className:"ml-auto text-gray-400 hover:text-rose-500 text-xs",children:"\u2715"})]})}return Y("div",{className:qe("bg-white rounded border border-gray-200",t?"px-2 py-1 flex items-center gap-1.5":"p-2 flex items-center gap-2"),children:[e.mimeType?.startsWith("image/")?M("img",{src:e.url,alt:e.name??"upload",className:t?"h-6 w-6 object-cover rounded":"h-16 w-16 object-cover rounded"}):e.mimeType?.startsWith("audio/")?M("audio",{src:e.url,controls:!0,className:t?"hidden":"h-8 max-w-[240px]"}):e.mimeType?.startsWith("video/")?M("video",{src:e.url,controls:!0,className:t?"hidden":"h-16 max-w-[240px] rounded"}):M($a,{size:20,style:{...re(20),color:"var(--ink-soft, #565b66)"}}),Y("div",{className:"flex-1 min-w-0",children:[M("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-gray-700 truncate block hover:underline",children:e.name??n.openResponseFile}),t&&e.mimeType?.startsWith("audio/")&&M("audio",{src:e.url,controls:!0,className:"h-6 max-w-[160px] mt-0.5"})]}),r&&M("button",{type:"button",onClick:r,className:"ml-auto text-gray-400 hover:text-rose-500 text-xs shrink-0",children:"\u2715"})]})}function Ci({nodeId:e,placeholder:r,allowFormatting:t,wordLimit:n,characterLimit:a,allowedTypes:s,allowMultiple:o,fileInstructions:i,isDisabled:c,feedbackBorderClass:l,files:d,setFiles:p,emitAnswer:m,answerBus:g,mediaHandler:u,t:b}){let[v,w]=ve(null),[x,_]=ve(!1);return Te(()=>{m({...v&&{text:v},files:d.length>0?d:void 0})},[v,d]),Y("div",{className:"space-y-2",children:[M(Oa,{nodeId:e,placeholder:r,allowFormatting:t,wordLimit:n,characterLimit:a,isDisabled:c,feedbackBorderClass:l,emitAnswer:h=>w(h),answerBus:g}),!c&&Y("div",{children:[Y("button",{type:"button",onClick:()=>_(!x),className:"flex items-center gap-1.5 text-xs",style:{color:"var(--ink-soft, #565b66)"},children:[M("span",{children:x?"\u25BE":"\u25B8"}),Y("span",{children:[b.openResponseAttachFiles,d.length>0&&M("span",{className:"ml-1 rounded-full px-1.5 py-0.5 text-[10px]",style:{background:"var(--ui-muted, #f5f4f1)",color:"var(--ink, #1d2025)"},children:d.length})]})]}),x&&M("div",{className:"mt-1.5",children:M(Zt,{allowedTypes:s,allowMultiple:o,fileInstructions:i,isDisabled:c,feedbackBorderClass:l,files:d,setFiles:p,mediaHandler:u,t:b,compact:!0})})]}),c&&d.length>0&&Y("div",{className:"space-y-1",children:[M("p",{className:"text-xs text-gray-500 font-medium",children:b.openResponseAttachedFiles}),M(Zt,{allowedTypes:s,allowMultiple:o,isDisabled:!0,feedbackBorderClass:l,files:d,setFiles:p,t:b,compact:!0})]})]})}function Ai({kind:e,maxDuration:r,isDisabled:t,feedbackBorderClass:n,mediaHandler:a,emitAnswer:s,t:o}){let[i,c]=ve("idle"),[l,d]=ve(0),[p,m]=ve(null),[g,u]=ve("audio/webm"),[b,v]=ve(null),w=Pe(null),x=Pe(null),_=Pe([]),h=Pe(null),y=Pe(null),C=Pe(null),P=Pe(0);Te(()=>()=>{$(),h.current&&clearInterval(h.current),cancelAnimationFrame(P.current)},[]),Te(()=>{i==="recording"&&e==="audio"&&x.current&&H(x.current)},[i]);let $=()=>{x.current?.getTracks().forEach(S=>S.stop()),x.current=null},R=async()=>{if(!a){v(o.openResponseMediaHandlerRequired);return}v(null),c("requesting");try{let S;if(e==="screen"){let z=await navigator.mediaDevices.getDisplayMedia({video:{cursor:"always"},audio:!1});try{let G=(await navigator.mediaDevices.getUserMedia({audio:!0})).getAudioTracks()[0];G&&z.addTrack(G)}catch{}z.getVideoTracks()[0]?.addEventListener("ended",()=>{w.current?.state==="recording"&&f()}),S=z,y.current&&(y.current.srcObject=S,y.current.play())}else e==="video"?(S=await navigator.mediaDevices.getUserMedia({audio:!0,video:{facingMode:"environment"}}),y.current&&(y.current.srcObject=S,y.current.play())):S=await navigator.mediaDevices.getUserMedia({audio:!0});x.current=S;let N=e==="audio"?"audio/webm":"video/webm";u(N);let j=new MediaRecorder(S,{mimeType:N});w.current=j,_.current=[],j.ondataavailable=z=>{z.data.size>0&&_.current.push(z.data)},j.onstop=()=>{let z=new Blob(_.current,{type:N}),q=URL.createObjectURL(z);m(q),c("reviewing"),$(),cancelAnimationFrame(P.current)},j.start(200),c("recording"),d(0),h.current=setInterval(()=>{d(z=>{let q=z+1;return r&&q>=r&&f(),q})},1e3)}catch{c("idle"),v(o.openResponsePermissionDenied)}},f=()=>{h.current&&(clearInterval(h.current),h.current=null),w.current?.stop()},I=async()=>{if(!p||!a)return;c("submitted");let N=await(await fetch(p)).blob(),j=e==="screen"?"video":e,z=new File([N],"recording.webm",{type:g}),q=await a.upload(z,j);URL.revokeObjectURL(p),s({url:q.url,mimeType:q.mimeType??g,duration:l,kind:j})},A=()=>{p&&URL.revokeObjectURL(p),m(null),d(0),c("idle")},H=S=>{let N=new AudioContext,j=N.createMediaStreamSource(S),z=N.createAnalyser();z.fftSize=64,j.connect(z);let q=new Uint8Array(z.frequencyBinCount),G=C.current;if(!G)return;let D=()=>{z.getByteFrequencyData(q);let X=G.getContext("2d");if(!X)return;X.clearRect(0,0,G.width,G.height);let k=G.width/q.length*2.5,T=0;for(let F=0;F<q.length;F++){let U=q[F]/255*G.height;X.fillStyle="#1d2025",X.fillRect(T,G.height-U,k,U),T+=k+1}P.current=requestAnimationFrame(D)};D()};return t?M("div",{className:qe("rounded border p-4 text-center text-sm text-gray-400",n),children:o.openResponseRecordingSubmitted}):Y("div",{className:qe("rounded border p-4 space-y-3",n),children:[b&&M("p",{className:"text-sm",style:{color:"var(--pen, #d23b2b)"},children:b}),(e==="video"||e==="screen")&&i==="recording"&&M("video",{ref:y,muted:!0,className:"w-full rounded max-h-48 bg-black",playsInline:!0}),e==="audio"&&i==="recording"&&M("canvas",{ref:C,width:300,height:48,className:"w-full rounded bg-gray-900"}),i==="reviewing"&&p&&(e==="audio"?M("audio",{src:p,controls:!0,className:"w-full",onLoadedMetadata:S=>La(S.currentTarget)}):M("video",{src:p,controls:!0,className:"w-full rounded max-h-48",onLoadedMetadata:S=>La(S.currentTarget)})),Y("div",{className:"flex items-center justify-center gap-3",children:[i==="idle"&&Y("button",{type:"button",onClick:R,className:"flex flex-col items-center gap-1 px-6 py-3 rounded-full font-medium text-white transition-colors",style:{background:"var(--ink, #1d2025)"},children:[e==="audio"?M(ui,{size:22,style:re(22)}):e==="screen"?M(fi,{size:22,style:re(22)}):M(Ma,{size:22,style:re(22)}),M("span",{className:"text-sm",children:e==="screen"?o.openResponseTapToRecordScreen:o.openResponseTapToRecord})]}),i==="requesting"&&M("p",{className:"text-sm text-gray-500 animate-pulse",children:o.openResponseRequestingPermission}),i==="recording"&&Y("div",{className:"flex flex-col items-center gap-2",children:[Y("div",{className:"flex items-center gap-2 font-mono text-lg",style:{color:"var(--pen, #d23b2b)"},children:[M("span",{className:"animate-pulse",children:"\u25CF"}),M("span",{children:Ia(l)}),r&&Y("span",{className:"text-sm",style:{color:"var(--ink-faint, #8d93a0)"},children:["/ ",Ia(r)]})]}),M("button",{type:"button",onClick:f,className:"px-5 py-2 rounded-full text-white text-sm font-medium",style:{background:"var(--pen, #d23b2b)"},children:o.openResponseStopRecording})]}),i==="reviewing"&&Y("div",{className:"flex gap-2",children:[M("button",{type:"button",onClick:A,className:"px-4 py-1.5 rounded border text-sm",style:{borderColor:"var(--line-strong, #d6d3cc)",color:"var(--ink, #1d2025)"},children:o.openResponseReRecord}),M("button",{type:"button",onClick:I,className:"px-4 py-1.5 rounded text-white text-sm",style:{background:"var(--ink, #1d2025)"},children:o.openResponseConfirmRecording})]}),i==="submitted"&&Y("p",{className:"text-sm",style:{color:"var(--ok, #1f8a4c)"},children:["\u2713 ",o.openResponseRecordingSubmitted]})]})]})}function Ni({feedback:e,feedbackState:r,score:t,t:n}){let a=r==="correct"?{bg:"var(--ok-soft, #ecf8f0)",border:"var(--ok, #1f8a4c)",ink:"var(--ok, #1f8a4c)"}:r==="incorrect"?{bg:"var(--pen-soft, #fdeeec)",border:"var(--pen, #d23b2b)",ink:"var(--pen, #d23b2b)"}:{bg:"var(--almost-soft, #fbf1dc)",border:"var(--almost, #c8810e)",ink:"var(--almost-ink, #8a5a08)"};return Y("div",{className:"rounded p-3 text-sm border",style:{background:a.bg,borderColor:a.border,color:"var(--ink, #1d2025)"},children:[M("p",{className:"text-xs font-medium mb-1 opacity-70",children:n.openResponseTeacherFeedbackLabel}),e.flatMap(s=>s.content?.map(o=>o.text??"")??[s.text??""]).join(" "),t!=null&&Y("div",{className:"mt-1 text-right",style:{fontFamily:'var(--font-hand, "Caveat", cursive)',fontSize:E("1.4rem"),lineHeight:1,color:a.ink},children:[t," pts"]})]})}import{jsx as ir,jsxs as He,Fragment as Fa}from"react/jsx-runtime";import{useEffect as en,useMemo as Ei,useRef as Pi,useState as ja}from"react";function Ti(e){return e?.showFeedback?e.state==="validating"?"validating":e.state==="correct"?"correct":e.state==="incorrect"?"incorrect":"idle":"idle"}function rt({nodeId:e,placeholder:r,hint:t,validationFeedback:n,readOnly:a=!1}){let s=Z(),o=le(),i=Pi(null),[c,l]=ja(""),[d,p]=ja(!1),m=Ti(n),g=n?.score,u=n?.maxScore,b=h=>Number.isInteger(h)?String(h):h.toFixed(2),v=n?.displayAnswer,w=Ei(()=>v?Ze(v,!1):"",[v]);en(()=>{import("mathlive").then(()=>{p(!0)}).catch(()=>{})},[]),en(()=>{let h=y=>{let C=y.answers?.find(P=>P.nodeId===e&&P.type==="mathResponse");C?.answer?.latex!==void 0&&(l(C.answer.latex),i.current&&(i.current.value=C.answer.latex))};return o.on("answers:prefill",h),()=>o.off("answers:prefill",h)},[o,e]),en(()=>{o.emit({type:"answer:changed",answer:{nodeId:e,type:"mathResponse",timestamp:Date.now(),answer:{latex:c}}})},[c,e,o]);let x=h=>{let y=h.target?.value??"";l(y)},_=m==="correct"?"player-math-field--correct":m==="incorrect"?"player-math-field--incorrect":m==="validating"?"player-math-field--validating":"";return He("div",{dir:"ltr",className:"math-response-player",children:[He("span",{style:{display:"inline-flex",alignItems:"center",gap:E("0.4rem")},children:[ir("div",{className:"player-math-field"+(_?" "+_:"")+(a?" player-math-field--readonly":""),children:d?ir("math-field",{ref:i,value:c,onInput:x,"virtual-keyboard-mode":"onfocus","smart-fence":"true",className:"player-math-field__input",style:{opacity:a?.7:1,pointerEvents:a?"none":"auto"}}):ir("input",{type:"text",value:c,onChange:h=>l(h.target.value),placeholder:r||"Enter LaTeX (e.g. \\frac{x^2}{2})",readOnly:a,className:"player-math-field__fallback"})}),ir($e,{hint:t})]}),n?.showFeedback&&He("div",{className:"player-math-feedback player-math-feedback--"+m,children:[m==="validating"&&He(Fa,{children:[ir("span",{className:"player-math-spinner"}),ir("span",{children:s.mathChecking})]}),m==="correct"&&He(Fa,{children:[He("span",{children:["\u2713 ",s.mathCorrect]}),g!=null&&He("span",{className:"player-math-score",children:[b(g),u!=null?` / ${b(u)}`:""]})]}),m==="incorrect"&&He("span",{children:["\u2717 ",s.mathIncorrect]}),m==="incorrect"&&w&&He("span",{className:"player-blank-reveal player-math-reveal",children:["(",ir("span",{dangerouslySetInnerHTML:{__html:w}}),")"]})]})]})}import{jsx as K,jsxs as de,Fragment as Pr}from"react/jsx-runtime";import{useCallback as Gi,useEffect as Yi,useRef as Ki,useState as Er}from"react";import{Play as Xi,Lock as Ji,Check as tn,X as qa}from"lucide-react";function ut(e,r){if(e===r)return!0;if(e===null||r===null||typeof e!=typeof r||typeof e!="object")return!1;let t=Array.isArray(e),n=Array.isArray(r);if(t!==n)return!1;if(t&&n){let c=e,l=r;return c.length!==l.length?!1:c.every((d,p)=>ut(d,l[p]))}let a=e,s=r,o=Object.keys(a),i=Object.keys(s);return o.length!==i.length?!1:o.every(c=>ut(a[c],s[c]))}var Li=`
1
+ import"./chunk-76CZ6Z7T.mjs";import jl,{useMemo as Bl}from"react";import{jsx as zr}from"react/jsx-runtime";import{useEffect as Un,useMemo as vl,useRef as wl}from"react";import Ns from"mitt";var Je=class{constructor(){this.emitter=Ns(),this.answers=new Map}emit(r){if(r.type==="answer:changed")this.answers.set(r.answer.nodeId,r.answer);else if(r.type==="answers:reset")this.answers.clear();else if(r.type==="answers:prefill")for(let t of r.answers)this.answers.set(t.nodeId,t);this.emitter.emit(r.type,r)}on(r,t){this.emitter.on(r,t)}off(r,t){this.emitter.off(r,t)}getAllAnswers(){return Array.from(this.answers.values())}clearAnswers(){this.answers.clear(),this.emit({type:"answers:reset"})}prefillAnswers(r){this.emit({type:"answers:prefill",answers:r})}submitAnswers(){this.emit({type:"answer:submitted",answers:this.getAllAnswers(),timestamp:Date.now()})}},ko="__edpireGlobalAnswerBus",Ro=globalThis,ht=Ro[ko]??(Ro[ko]=new Je);import{jsx as As}from"react/jsx-runtime";import{createContext as Es,useContext as Ps}from"react";var So="__edpireAnswerBusContext",Co=globalThis,_o=Co[So]??(Co[So]=Es(ht));function xe(){return Ps(_o)}function gt({children:e,bus:r=new Je}){return As(_o.Provider,{value:r,children:e})}import{jsx as ve,jsxs as Tr}from"react/jsx-runtime";import{Fragment as xi,useState as Ho,useEffect as wn,useMemo as vi}from"react";import Ze from"clsx";import{jsx as Q,jsxs as Oo}from"react/jsx-runtime";import{jsx as Me,jsxs as dn}from"react/jsx-runtime";import{createContext as Is,useCallback as pn,useContext as $s,useEffect as Yr,useMemo as zs,useRef as Er,useState as hr}from"react";import{Pause as Ds,Play as Fs,RotateCcw as Os}from"lucide-react";import{jsx as Ts}from"react/jsx-runtime";import{createContext as Ms,useContext as No}from"react";var Ar={submitButton:"Submit",showHint:"Show hint",clickToRemove:"Click to remove",blankAnswerAria:"Your answer",aiEvaluationInProgress:"AI evaluation in progress\u2026",aiEvaluationInProgressAria:"AI evaluation in progress",shortAnswerPlaceholder:"Short answer\u2026",longAnswerPlaceholder:"Write your answer here\u2026",minWordsLabel:e=>`Min: ${e}`,wordBank:"Word Bank",chooseN:e=>`(choose ${e})`,annexDefaultLabel:"Documents",annexOpen:e=>`Open ${e}`,annexClose:"Close",referenceInPanel:e=>`This exercise's text is in ${e}.`,readReference:"Read it",referenceForExercise:e=>`Exercise ${e}`,choiceLetters:"ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),tableScrollLeft:"Show the columns on the left",tableScrollRight:"Show the columns on the right",mathChecking:"Checking your answer\u2026",mathCorrect:"Correct",mathIncorrect:"Incorrect",openResponseTextPlaceholder:"Write your answer here\u2026",openResponseWords:"words",openResponseChars:"chars",openResponseDropZoneLabel:"Drag & drop files here, or",openResponseDropZoneBrowse:"browse",openResponseUploading:"Uploading\u2026",openResponseNoSubmission:"No submission",openResponseFile:"File",openResponseAttachFile:"Attach a file",openResponseAttachFiles:"Attach files",openResponseAttachedFiles:"Attached files",openResponseTypeImage:"Image",openResponseTypePdf:"PDF",openResponseTypeAudio:"Audio",openResponseTypeVideo:"Video",openResponseTypeVideoLink:"Video link",openResponseVideoLinkPlaceholder:"Paste YouTube or Vimeo URL\u2026",openResponseAddVideoLink:"Add",openResponseTapToRecord:"Tap to start recording",openResponseTapToRecordScreen:"Click to start screen recording",openResponseRequestingPermission:"Requesting permission\u2026",openResponsePermissionDenied:"Microphone/camera access denied. Please allow access in your browser settings.",openResponseMediaHandlerRequired:"A media handler is required to save recordings.",openResponseStopRecording:"Stop",openResponseReRecord:"Re-record",openResponseConfirmRecording:"Use this recording",openResponseRecordingSubmitted:"Recording submitted",openResponseAwaitingReview:"Submitted, awaiting teacher review",openResponseTeacherFeedbackLabel:"Teacher feedback",openResponseGradeThisResponse:"Grade this response",openResponseGradeScoreLabel:e=>`Score (max ${e})`,openResponseGradeFeedbackLabel:"Feedback (optional)",openResponseGradeFeedbackPlaceholder:"Add feedback for the student\u2026",openResponseSubmitGrade:"Submit Grade",openResponseGradeSubmitted:(e,r)=>`Grade submitted: ${e} / ${r}`,openResponseRubricTitle:"Rubric",openResponseRubricCriterionPoints:(e,r)=>`${e} / ${r} pts`,openResponseAiSuggestionTitle:"AI Pre-grading Suggestion",openResponseAiSuggestedScore:(e,r)=>`Suggested score: ${e} / ${r}`,openResponseAiEvidence:"Evidence:",openResponseAiApplySuggestion:"Apply suggestion",openResponseStudentAnswerTitle:"Student answer",audioPlay:"Play",audioPause:"Pause",audioReplay:"Play again",audioSpeed:e=>`Speed ${e}`,audioRate:e=>`${e}\xD7`,audioPosition:"Position in the audio",audioTimeOf:(e,r)=>`${e} of ${r}`,audioPlaysLeft:e=>e===1?"1 play left":`${e} plays left`,audioNoPlaysLeft:"No plays left",audioUnavailable:"This audio can't be played.",recorderUpTo:e=>`Up to ${e}`,recorderRecord:"Record",recorderRecordingAria:"Recording",recorderSaving:e=>`Saving ${e}%`,recorderSaved:"Saved",recorderRecordAgain:"Record again",recorderCancel:"Cancel",recorderFailed:"Your recording wasn't saved. Check your connection.",recorderRetry:"Try again",recorderUnsupported:"This browser can't record. Try an up-to-date Chrome, Safari or Firefox.",recorderUnavailableHere:"Recording isn't available here.",recorderNone:"No recording"};var bt={submitButton:"Valider",showHint:"Voir l'indice",clickToRemove:"Cliquer pour retirer",blankAnswerAria:"Votre r\xE9ponse",aiEvaluationInProgress:"\xC9valuation IA en cours\u2026",aiEvaluationInProgressAria:"\xC9valuation IA en cours",shortAnswerPlaceholder:"R\xE9ponse courte\u2026",longAnswerPlaceholder:"\xC9crivez votre r\xE9ponse ici\u2026",minWordsLabel:e=>`Min. : ${e}`,wordBank:"Banque de mots",chooseN:e=>`(choisir ${e})`,annexDefaultLabel:"Documents",annexOpen:e=>`Ouvrir ${e}`,annexClose:"Fermer",referenceInPanel:e=>`Le texte de cet exercice est dans \xAB ${e} \xBB.`,readReference:"Le lire",referenceForExercise:e=>`Exercice ${e}`,choiceLetters:"ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),tableScrollLeft:"Voir les colonnes de gauche",tableScrollRight:"Voir les colonnes de droite",mathChecking:"V\xE9rification de votre r\xE9ponse\u2026",mathCorrect:"Juste",mathIncorrect:"Faux",openResponseTextPlaceholder:"\xC9crivez votre r\xE9ponse ici\u2026",openResponseWords:"mots",openResponseChars:"car.",openResponseDropZoneLabel:"Glissez-d\xE9posez des fichiers ici, ou",openResponseDropZoneBrowse:"parcourir",openResponseUploading:"Envoi en cours\u2026",openResponseNoSubmission:"Aucun fichier d\xE9pos\xE9",openResponseFile:"Fichier",openResponseAttachFile:"Joindre un fichier",openResponseAttachFiles:"Joindre des fichiers",openResponseAttachedFiles:"Fichiers joints",openResponseTypeImage:"Image",openResponseTypePdf:"PDF",openResponseTypeAudio:"Audio",openResponseTypeVideo:"Vid\xE9o",openResponseTypeVideoLink:"Lien vid\xE9o",openResponseVideoLinkPlaceholder:"Coller un lien YouTube ou Vimeo\u2026",openResponseAddVideoLink:"Ajouter",openResponseTapToRecord:"Appuyer pour d\xE9marrer l'enregistrement",openResponseTapToRecordScreen:"Cliquer pour d\xE9marrer l'enregistrement d'\xE9cran",openResponseRequestingPermission:"Demande d'autorisation\u2026",openResponsePermissionDenied:"Acc\xE8s au micro ou \xE0 la cam\xE9ra refus\xE9. Autorisez-le dans les r\xE9glages du navigateur.",openResponseMediaHandlerRequired:"Un gestionnaire de m\xE9dias est requis pour sauvegarder les enregistrements.",openResponseStopRecording:"Arr\xEAter",openResponseReRecord:"R\xE9enregistrer",openResponseConfirmRecording:"Utiliser cet enregistrement",openResponseRecordingSubmitted:"Enregistrement soumis",openResponseAwaitingReview:"Soumis, en attente de correction par l'enseignant",openResponseTeacherFeedbackLabel:"Commentaire de l'enseignant",openResponseGradeThisResponse:"Corriger cette r\xE9ponse",openResponseGradeScoreLabel:e=>`Note (max ${e})`,openResponseGradeFeedbackLabel:"Commentaire (facultatif)",openResponseGradeFeedbackPlaceholder:"Ajouter un commentaire pour l'\xE9l\xE8ve\u2026",openResponseSubmitGrade:"Valider la note",openResponseGradeSubmitted:(e,r)=>`Note envoy\xE9e : ${e} / ${r}`,openResponseRubricTitle:"Grille d'\xE9valuation",openResponseRubricCriterionPoints:(e,r)=>`${e} / ${r} pts`,openResponseAiSuggestionTitle:"Suggestion de correction par IA",openResponseAiSuggestedScore:(e,r)=>`Score sugg\xE9r\xE9 : ${e} / ${r}`,openResponseAiEvidence:"Extrait :",openResponseAiApplySuggestion:"Appliquer la suggestion",openResponseStudentAnswerTitle:"R\xE9ponse de l'\xE9l\xE8ve",audioPlay:"\xC9couter",audioPause:"Pause",audioReplay:"R\xE9\xE9couter",audioSpeed:e=>`Vitesse ${e}`,audioRate:e=>`${String(e).replace(".",",")}\xD7`,audioPosition:"Position dans l'audio",audioTimeOf:(e,r)=>`${e} sur ${r}`,audioPlaysLeft:e=>e===1?"1 \xE9coute restante":`${e} \xE9coutes restantes`,audioNoPlaysLeft:"Plus d'\xE9coute restante",audioUnavailable:"Impossible de lire cet audio.",recorderUpTo:e=>`Jusqu'\xE0 ${e}`,recorderRecord:"Enregistrer",recorderRecordingAria:"Enregistrement en cours",recorderSaving:e=>`Envoi ${e}\u202F%`,recorderSaved:"Enregistr\xE9",recorderRecordAgain:"Recommencer",recorderCancel:"Annuler",recorderFailed:"Votre enregistrement n'a pas \xE9t\xE9 envoy\xE9. V\xE9rifiez votre connexion.",recorderRetry:"R\xE9essayer",recorderUnsupported:"Ce navigateur ne peut pas enregistrer. Essayez Chrome, Safari ou Firefox \xE0 jour.",recorderUnavailableHere:"L'enregistrement n'est pas disponible ici.",recorderNone:"Aucun enregistrement"};var yt={submitButton:"\u0625\u0631\u0633\u0627\u0644",showHint:"\u0625\u0638\u0647\u0627\u0631 \u0627\u0644\u062A\u0644\u0645\u064A\u062D",clickToRemove:"\u0627\u0646\u0642\u0631 \u0644\u0644\u0625\u0632\u0627\u0644\u0629",blankAnswerAria:"\u0625\u062C\u0627\u0628\u062A\u0643",aiEvaluationInProgress:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u0642\u064A\u064A\u0645 \u0628\u0627\u0644\u0630\u0643\u0627\u0621 \u0627\u0644\u0627\u0635\u0637\u0646\u0627\u0639\u064A\u2026",aiEvaluationInProgressAria:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u0642\u064A\u064A\u0645 \u0628\u0627\u0644\u0630\u0643\u0627\u0621 \u0627\u0644\u0627\u0635\u0637\u0646\u0627\u0639\u064A",shortAnswerPlaceholder:"\u0625\u062C\u0627\u0628\u0629 \u0642\u0635\u064A\u0631\u0629\u2026",longAnswerPlaceholder:"\u0627\u0643\u062A\u0628 \u0625\u062C\u0627\u0628\u062A\u0643 \u0647\u0646\u0627\u2026",minWordsLabel:e=>`\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u062F\u0646\u0649: ${e}`,wordBank:"\u0628\u0646\u0643 \u0627\u0644\u0643\u0644\u0645\u0627\u062A",chooseN:e=>`(\u0627\u062E\u062A\u0631 ${e})`,annexDefaultLabel:"\u0627\u0644\u0645\u0633\u062A\u0646\u062F\u0627\u062A",annexOpen:e=>`\u0641\u062A\u062D ${e}`,annexClose:"\u0625\u063A\u0644\u0627\u0642",referenceInPanel:e=>`\u0646\u0635 \u0647\u0630\u0627 \u0627\u0644\u062A\u0645\u0631\u064A\u0646 \u0641\u064A \xAB${e}\xBB.`,readReference:"\u0627\u0642\u0631\u0623\u0647",referenceForExercise:e=>`\u0627\u0644\u062A\u0645\u0631\u064A\u0646 ${e}`,choiceLetters:["\u0623","\u0628","\u062C","\u062F","\u0647\u0640","\u0648","\u0632","\u062D","\u0637","\u064A","\u0643","\u0644","\u0645","\u0646","\u0633","\u0639","\u0641","\u0635","\u0642","\u0631","\u0634","\u062A","\u062B","\u062E","\u0630","\u0636","\u0638","\u063A"],tableScrollLeft:"\u0625\u0638\u0647\u0627\u0631 \u0627\u0644\u0623\u0639\u0645\u062F\u0629 \u0639\u0644\u0649 \u0627\u0644\u064A\u0633\u0627\u0631",tableScrollRight:"\u0625\u0638\u0647\u0627\u0631 \u0627\u0644\u0623\u0639\u0645\u062F\u0629 \u0639\u0644\u0649 \u0627\u0644\u064A\u0645\u064A\u0646",mathChecking:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0642\u0642 \u0645\u0646 \u0625\u062C\u0627\u0628\u062A\u0643\u2026",mathCorrect:"\u0635\u062D\u064A\u062D",mathIncorrect:"\u062E\u0637\u0623",openResponseTextPlaceholder:"\u0627\u0643\u062A\u0628 \u0625\u062C\u0627\u0628\u062A\u0643 \u0647\u0646\u0627\u2026",openResponseWords:"\u0643\u0644\u0645\u0629",openResponseChars:"\u062D\u0631\u0641",openResponseDropZoneLabel:"\u0627\u0633\u062D\u0628 \u0627\u0644\u0645\u0644\u0641\u0627\u062A \u0648\u0623\u0641\u0644\u062A\u0647\u0627 \u0647\u0646\u0627\u060C \u0623\u0648",openResponseDropZoneBrowse:"\u062A\u0635\u0641\u0651\u062D",openResponseUploading:"\u062C\u0627\u0631\u064D \u0627\u0644\u0631\u0641\u0639\u2026",openResponseNoSubmission:"\u0644\u0627 \u064A\u0648\u062C\u062F \u062A\u0633\u0644\u064A\u0645",openResponseFile:"\u0645\u0644\u0641",openResponseAttachFile:"\u0625\u0631\u0641\u0627\u0642 \u0645\u0644\u0641",openResponseAttachFiles:"\u0625\u0631\u0641\u0627\u0642 \u0645\u0644\u0641\u0627\u062A",openResponseAttachedFiles:"\u0627\u0644\u0645\u0644\u0641\u0627\u062A \u0627\u0644\u0645\u0631\u0641\u0642\u0629",openResponseTypeImage:"\u0635\u0648\u0631\u0629",openResponseTypePdf:"PDF",openResponseTypeAudio:"\u0635\u0648\u062A",openResponseTypeVideo:"\u0641\u064A\u062F\u064A\u0648",openResponseTypeVideoLink:"\u0631\u0627\u0628\u0637 \u0641\u064A\u062F\u064A\u0648",openResponseVideoLinkPlaceholder:"\u0627\u0644\u0635\u0642 \u0631\u0627\u0628\u0637 \u064A\u0648\u062A\u064A\u0648\u0628 \u0623\u0648 Vimeo\u2026",openResponseAddVideoLink:"\u0625\u0636\u0627\u0641\u0629",openResponseTapToRecord:"\u0627\u0646\u0642\u0631 \u0644\u0628\u062F\u0621 \u0627\u0644\u062A\u0633\u062C\u064A\u0644",openResponseTapToRecordScreen:"\u0627\u0646\u0642\u0631 \u0644\u0628\u062F\u0621 \u062A\u0633\u062C\u064A\u0644 \u0627\u0644\u0634\u0627\u0634\u0629",openResponseRequestingPermission:"\u062C\u0627\u0631\u064D \u0637\u0644\u0628 \u0627\u0644\u0625\u0630\u0646\u2026",openResponsePermissionDenied:"\u062A\u0645 \u0631\u0641\u0636 \u0627\u0644\u0648\u0635\u0648\u0644 \u0625\u0644\u0649 \u0627\u0644\u0645\u064A\u0643\u0631\u0648\u0641\u0648\u0646/\u0627\u0644\u0643\u0627\u0645\u064A\u0631\u0627. \u064A\u064F\u0631\u062C\u0649 \u0627\u0644\u0633\u0645\u0627\u062D \u0628\u0627\u0644\u0648\u0635\u0648\u0644 \u0645\u0646 \u0625\u0639\u062F\u0627\u062F\u0627\u062A \u0627\u0644\u0645\u062A\u0635\u0641\u062D.",openResponseMediaHandlerRequired:"\u064A\u0644\u0632\u0645 \u0645\u0639\u0627\u0644\u062C \u0648\u0633\u0627\u0626\u0637 \u0644\u062D\u0641\u0638 \u0627\u0644\u062A\u0633\u062C\u064A\u0644\u0627\u062A.",openResponseStopRecording:"\u0625\u064A\u0642\u0627\u0641",openResponseReRecord:"\u0625\u0639\u0627\u062F\u0629 \u0627\u0644\u062A\u0633\u062C\u064A\u0644",openResponseConfirmRecording:"\u0627\u0633\u062A\u062E\u062F\u0627\u0645 \u0647\u0630\u0627 \u0627\u0644\u062A\u0633\u062C\u064A\u0644",openResponseRecordingSubmitted:"\u062A\u0645 \u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u062A\u0633\u062C\u064A\u0644",openResponseAwaitingReview:"\u062A\u0645 \u0627\u0644\u0625\u0631\u0633\u0627\u0644\u060C \u0641\u064A \u0627\u0646\u062A\u0638\u0627\u0631 \u0645\u0631\u0627\u062C\u0639\u0629 \u0627\u0644\u0645\u0639\u0644\u0645",openResponseTeacherFeedbackLabel:"\u0645\u0644\u0627\u062D\u0638\u0627\u062A \u0627\u0644\u0645\u0639\u0644\u0645",openResponseGradeThisResponse:"\u062A\u0635\u062D\u064A\u062D \u0647\u0630\u0647 \u0627\u0644\u0625\u062C\u0627\u0628\u0629",openResponseGradeScoreLabel:e=>`\u0627\u0644\u062F\u0631\u062C\u0629 (\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 ${e})`,openResponseGradeFeedbackLabel:"\u0645\u0644\u0627\u062D\u0638\u0627\u062A (\u0627\u062E\u062A\u064A\u0627\u0631\u064A)",openResponseGradeFeedbackPlaceholder:"\u0623\u0636\u0641 \u0645\u0644\u0627\u062D\u0638\u0627\u062A \u0644\u0644\u0637\u0627\u0644\u0628\u2026",openResponseSubmitGrade:"\u0627\u0639\u062A\u0645\u0627\u062F \u0627\u0644\u062F\u0631\u062C\u0629",openResponseGradeSubmitted:(e,r)=>`\u062A\u0645 \u0627\u0639\u062A\u0645\u0627\u062F \u0627\u0644\u062F\u0631\u062C\u0629: ${e} / ${r}`,openResponseRubricTitle:"\u0633\u0644\u0651\u0645 \u0627\u0644\u062A\u0635\u062D\u064A\u062D",openResponseRubricCriterionPoints:(e,r)=>`${e} / ${r} \u0646\u0642\u0637\u0629`,openResponseAiSuggestionTitle:"\u0627\u0642\u062A\u0631\u0627\u062D \u0627\u0644\u062A\u0635\u062D\u064A\u062D \u0627\u0644\u0645\u0633\u0628\u0642 \u0628\u0627\u0644\u0630\u0643\u0627\u0621 \u0627\u0644\u0627\u0635\u0637\u0646\u0627\u0639\u064A",openResponseAiSuggestedScore:(e,r)=>`\u0627\u0644\u062F\u0631\u062C\u0629 \u0627\u0644\u0645\u0642\u062A\u0631\u062D\u0629: ${e} / ${r}`,openResponseAiEvidence:"\u0627\u0644\u0623\u062F\u0644\u0629:",openResponseAiApplySuggestion:"\u062A\u0637\u0628\u064A\u0642 \u0627\u0644\u0627\u0642\u062A\u0631\u0627\u062D",openResponseStudentAnswerTitle:"\u0625\u062C\u0627\u0628\u0629 \u0627\u0644\u0637\u0627\u0644\u0628",audioPlay:"\u062A\u0634\u063A\u064A\u0644",audioPause:"\u0625\u064A\u0642\u0627\u0641 \u0645\u0624\u0642\u062A",audioReplay:"\u0625\u0639\u0627\u062F\u0629 \u0627\u0644\u0627\u0633\u062A\u0645\u0627\u0639",audioSpeed:e=>`\u0627\u0644\u0633\u0631\u0639\u0629 ${e}`,audioRate:e=>`${e}\xD7`,audioPosition:"\u0627\u0644\u0645\u0648\u0636\u0639 \u0641\u064A \u0627\u0644\u062A\u0633\u062C\u064A\u0644 \u0627\u0644\u0635\u0648\u062A\u064A",audioTimeOf:(e,r)=>`${e} \u0645\u0646 ${r}`,audioPlaysLeft:e=>e===1?"\u0628\u0642\u064A \u0627\u0633\u062A\u0645\u0627\u0639 \u0648\u0627\u062D\u062F":e===2?"\u0628\u0642\u064A \u0627\u0633\u062A\u0645\u0627\u0639\u0627\u0646":`\u0628\u0642\u064A\u062A ${e} \u0627\u0633\u062A\u0645\u0627\u0639\u0627\u062A`,audioNoPlaysLeft:"\u0644\u0645 \u064A\u0628\u0642 \u0623\u064A \u0627\u0633\u062A\u0645\u0627\u0639",audioUnavailable:"\u062A\u0639\u0630\u0631 \u062A\u0634\u063A\u064A\u0644 \u0647\u0630\u0627 \u0627\u0644\u062A\u0633\u062C\u064A\u0644 \u0627\u0644\u0635\u0648\u062A\u064A.",recorderUpTo:e=>`\u062D\u062A\u0649 ${e}`,recorderRecord:"\u062A\u0633\u062C\u064A\u0644",recorderRecordingAria:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u0633\u062C\u064A\u0644",recorderSaving:e=>`\u062C\u0627\u0631\u064D \u0627\u0644\u0625\u0631\u0633\u0627\u0644 ${e}\u066A`,recorderSaved:"\u062A\u0645 \u0627\u0644\u062D\u0641\u0638",recorderRecordAgain:"\u0625\u0639\u0627\u062F\u0629 \u0627\u0644\u062A\u0633\u062C\u064A\u0644",recorderCancel:"\u0625\u0644\u063A\u0627\u0621",recorderFailed:"\u0644\u0645 \u064A\u062A\u0645 \u0625\u0631\u0633\u0627\u0644 \u062A\u0633\u062C\u064A\u0644\u0643. \u062A\u062D\u0642\u0642 \u0645\u0646 \u0627\u062A\u0635\u0627\u0644\u0643.",recorderRetry:"\u0625\u0639\u0627\u062F\u0629 \u0627\u0644\u0645\u062D\u0627\u0648\u0644\u0629",recorderUnsupported:"\u0644\u0627 \u064A\u0645\u0643\u0646 \u0644\u0647\u0630\u0627 \u0627\u0644\u0645\u062A\u0635\u0641\u062D \u0627\u0644\u062A\u0633\u062C\u064A\u0644. \u062C\u0631\u0651\u0628 \u0625\u0635\u062F\u0627\u0631\u064B\u0627 \u062D\u062F\u064A\u062B\u064B\u0627 \u0645\u0646 Chrome \u0623\u0648 Safari \u0623\u0648 Firefox.",recorderUnavailableHere:"\u0627\u0644\u062A\u0633\u062C\u064A\u0644 \u063A\u064A\u0631 \u0645\u062A\u0627\u062D \u0647\u0646\u0627.",recorderNone:"\u0644\u0627 \u064A\u0648\u062C\u062F \u062A\u0633\u062C\u064A\u0644"};var Ls={en:Ar,fr:bt,ar:yt},ln=Ms(null);function se(){return No(ln)??Ar}function Qr(e){let r=No(ln);return e&&Ls[e]||r||Ar}function Gr({locale:e,children:r}){let t=Qr(e);return Ts(ln.Provider,{value:t,children:r})}var Ao=Is(null);function xt({initial:e,onChange:r,children:t}){let n=Er({...e??{}}),o=Er(r);o.current=r;let a=zs(()=>({get:s=>n.current[s]??0,set:(s,i)=>{n.current={...n.current,[s]:i},o.current?.(n.current)}}),[]);return Me(Ao.Provider,{value:a,children:t})}var un=[.75,1,1.25,1.5],mn=.5;function Pr(e){if(!Number.isFinite(e)||e<0)return"0:00";let r=Math.round(e);return`${Math.floor(r/60)}:${String(r%60).padStart(2,"0")}`}var fn="edpire:audio-play";function Qe({src:e,maxPlays:r,learnerSpeed:t,speed:n,allowSeek:o,durationHint:a,playsKey:s,playsUsed:i,onPlaysUsedChange:c,disabled:l=!1,label:d,className:m}){let p=se(),g=$s(Ao),u=s??e,h=r&&r>0?Math.floor(r):0,v=o!==!1,R=t!==!1,w=n&&n>=.25&&n<=4?n:1,C=Er(null),y=Er(null),[S,k]=hr(!1),[_,P]=hr(0),[F,b]=hr(a&&a>0?a:0),[T,f]=hr(!1),[q,A]=hr(!1),[L,G]=hr(w),[B,V]=hr(()=>i??g?.get(u)??0),K=Er(!1),le=Er(!1);Yr(()=>{i!==void 0&&V(i)},[i]),Yr(()=>G(w),[w]),Yr(()=>{C.current&&(C.current.playbackRate=L)},[L]),Yr(()=>{A(!1),f(!1),P(0),k(!1),K.current=!1,a&&a>0||b(0);let D=C.current;D&&D.readyState>=1&&Number.isFinite(D.duration)&&D.duration>0&&b(D.duration)},[e]),Yr(()=>{let D=J=>{let Z=C.current;Z&&J.detail!==Z&&!Z.paused&&Z.pause()};return window.addEventListener(fn,D),()=>window.removeEventListener(fn,D)},[]);let ye=h>0&&B>=h&&!K.current,E=h>0?Math.max(0,h-B):null,x=l||q||ye,j=pn(()=>{if(h===0)return!0;if(B>=h)return!1;let D=B+1;return V(D),K.current=!0,i===void 0&&g?.set(u,D),c?.(D),!0},[h,B,i,g,u,c]),O=pn(()=>{let D=C.current;if(!D||l||q)return;if(!D.paused){D.pause();return}(T||D.currentTime<mn)&&!K.current&&!j()||((T||D.currentTime>=(D.duration||1/0))&&(D.currentTime=0),f(!1),D.playbackRate=L,window.dispatchEvent(new CustomEvent(fn,{detail:D})),D.play().catch(()=>k(!1)))},[l,q,T,j,L]),z=F>0?F:0,ae=z>0?Math.min(1,_/z):0,re=pn(D=>{let J=C.current;if(!J||!v||x||z===0)return;let Z=Math.max(0,Math.min(z,D));if(h>0&&Z<mn&&_>=mn&&K.current&&(K.current=!1,!J.paused&&!j())){J.pause();return}J.currentTime=Z,P(Z),f(!1)},[v,x,z,h,_,j]),ie=D=>{let J=y.current;if(!J)return 0;let Z=J.getBoundingClientRect(),H=getComputedStyle(J).direction==="rtl"?(Z.right-D)/Z.width:(D-Z.left)/Z.width;return Math.max(0,Math.min(1,H))},de=D=>{!v||x||z===0||(D.preventDefault(),le.current=!0,D.currentTarget.setPointerCapture(D.pointerId),re(ie(D.clientX)*z))},U=D=>{le.current&&re(ie(D.clientX)*z)},Y=()=>{le.current=!1},me=D=>{if(!v||x||z===0)return;let J=y.current?getComputedStyle(y.current).direction==="rtl":!1,Z=5,pe=null;D.key==="ArrowRight"?pe=_+(J?-Z:Z):D.key==="ArrowLeft"?pe=_+(J?Z:-Z):D.key==="ArrowUp"?pe=_+Z:D.key==="ArrowDown"?pe=_-Z:D.key==="Home"?pe=0:D.key==="End"&&(pe=z),pe!==null&&(D.preventDefault(),re(pe))},ee=()=>{let D=un.indexOf(L);G(un[(D+1)%un.length]??1)},te=(S||_>0)&&!T&&z>0,ce=Pr(te?z-_:z),ze=S?Me(Ds,{size:18,fill:"currentColor",strokeWidth:0,"aria-hidden":!0}):T&&!ye?Me(Os,{size:18,"aria-hidden":!0}):Me(Fs,{size:18,fill:"currentColor",strokeWidth:0,"aria-hidden":!0,style:{marginInlineStart:2}}),Te=S?p.audioPause:T?p.audioReplay:p.audioPlay;return dn("span",{role:"group","aria-label":d,className:`edp-audio${x?" edp-audio--off":""}${m?` ${m}`:""}`,"data-audio-player":"",children:[dn("span",{className:"edp-audio-bar",children:[Me("button",{type:"button",className:"edp-audio-play",onClick:O,disabled:x,"aria-label":Te,children:ze}),dn("span",{ref:y,className:`edp-audio-track${v&&!x?" edp-audio-track--seek":""}`,role:"slider",tabIndex:v&&!x?0:-1,"aria-label":p.audioPosition,"aria-valuemin":0,"aria-valuemax":Math.round(z),"aria-valuenow":Math.round(_),"aria-valuetext":p.audioTimeOf(Pr(_),Pr(z)),"aria-disabled":!v||x,onPointerDown:de,onPointerMove:U,onPointerUp:Y,onPointerCancel:Y,onKeyDown:me,children:[Me("span",{className:"edp-audio-rail",children:Me("span",{className:"edp-audio-fill",style:{width:`${ae*100}%`}})}),v&&!x&&z>0&&Me("span",{className:"edp-audio-thumb",style:{insetInlineStart:`${ae*100}%`}})]}),Me("span",{className:"edp-audio-time",dir:"ltr",children:ce}),R&&!q&&Me("button",{type:"button",className:"edp-audio-speed",dir:"ltr",onClick:ee,disabled:l,"aria-label":p.audioSpeed(p.audioRate(L)),children:p.audioRate(L)})]}),(q||E!==null)&&Me("span",{className:"edp-audio-note","aria-live":"polite",children:Me("bdi",{children:q?p.audioUnavailable:E===0&&!K.current?p.audioNoPlaysLeft:p.audioPlaysLeft(E??0)})}),Me("audio",{ref:C,src:e||void 0,preload:"metadata",onLoadedMetadata:D=>{let J=D.currentTarget;J.playbackRate=L,Number.isFinite(J.duration)&&J.duration>0?b(J.duration):js(J,Z=>b(pe=>pe>0?pe:Z))},onDurationChange:D=>{let J=D.currentTarget.duration;Number.isFinite(J)&&J>0&&b(J)},onTimeUpdate:D=>{le.current||P(D.currentTarget.currentTime)},onPlay:()=>k(!0),onPause:()=>k(!1),onEnded:()=>{k(!1),f(!0),K.current=!1,P(z)},onError:()=>{e&&A(!0)}})]})}function js(e,r){let t=()=>{e.removeEventListener("timeupdate",t),Number.isFinite(e.duration)&&e.duration>0&&r(e.duration),e.currentTime=0};e.addEventListener("timeupdate",t);try{e.currentTime=1e101}catch{e.removeEventListener("timeupdate",t)}}import Bs from"katex";import"katex/dist/contrib/mhchem.js";var qs={"\\d":"\\mathrm{d}","\\R":"\\mathbb{R}","\\N":"\\mathbb{N}","\\Z":"\\mathbb{Z}","\\Q":"\\mathbb{Q}","\\C":"\\mathbb{C}"};function gr(e,r,t=!0){try{return Bs.renderToString(e,{displayMode:r,output:t?"htmlAndMathml":"html",throwOnError:!1,errorColor:"#cc0000",macros:qs,strict:!1})}catch(n){return`<span class="katex-error" style="color:#cc0000" title="${String(n)}">${e}</span>`}}function I(e){return`calc(${typeof e=="number"?`${e}px`:e} * var(--edp-scale, 1))`}function fe(e){return{width:I(e),height:I(e)}}function We(e){if(e==null||e==="")return;if(typeof e=="number")return I(e);let r=String(e).trim();return/^\d+(\.\d+)?px$/.test(r)?I(r):r}import{createContext as Ws}from"react";var Kr=Ws(!1),vt="1px solid #d1d5db",Us="#f3f4f6",Hs="#e3e1dc",Vs="var(--card, #fff)",br="edp-table-first",Eo={overflowX:"auto",margin:`${I("1.25rem")} 0`},Po={left:!1,right:!1,held:0,rtl:!1};function To(e,r,t,n=0){return{left:r.left<e.left-1,right:r.right>e.right+1,held:n,rtl:t}}function Mo(e,r){return Math.max(80,Math.round((e-r)*.8))}var hn={borderCollapse:"separate",borderSpacing:0,width:"100%",tableLayout:"auto",fontSize:I("0.875rem"),lineHeight:1.3,borderBlockStart:vt,borderInlineStart:vt};function Xr(e){let r=e.gray?Hs:e.header?Us:e.sticky?Vs:void 0;return{borderBlockEnd:vt,borderInlineEnd:vt,padding:`${I("4px")} ${I("6px")}`,verticalAlign:"middle",overflowWrap:"normal",wordBreak:"normal",hyphens:"manual",...r?{background:r}:{},...e.header?{fontWeight:600}:{},...e.sticky?{position:"sticky",insetInlineStart:0,zIndex:1}:{}}}function Jr(e){return Object.entries(e).map(([r,t])=>`${r.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`)}:${t}`).join(";")}function gn(e){let r=[],t=new Set,n=[];(e??[]).forEach((s,i)=>{let c=0;(s.content??[]).forEach(l=>{for(;n[i]?.[c];)c++;let d=Math.max(1,l.attrs?.colspan??1),m=Math.max(1,l.attrs?.rowspan??1);for(let p=i;p<i+m;p++){let g=n[p]??(n[p]=[]);for(let u=c;u<c+d;u++)g[u]=!0}for(let p=0;p<d;p++){let g=l.attrs?.colwidth?.[p];g&&r[c+p]==null&&(r[c+p]=g)}c===0&&d===1&&t.add(l),c+=d})});let o=n.reduce((s,i)=>Math.max(s,i.length),0);return{columnWidths:r.some(s=>s!=null)?Array.from({length:o},(s,i)=>r[i]??null):[],stickyCells:t}}function bn(e){return e.replace(/(\d) (?=\d)/g,"$1\xA0").replace(/(\d) (?=[\p{L}%\p{Sc}]{1,3}(?![\p{L}\p{N}]))/gu,"$1\xA0")}import{jsx as Ge,jsxs as yn}from"react/jsx-runtime";import{useCallback as Qs,useEffect as Gs,useLayoutEffect as Ys,useRef as Ks,useState as Xs}from"react";var Js=typeof window<"u"?Ys:Gs;function Lo({side:e}){return Ge("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2.25",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:Ge("path",{d:e==="left"?"M15 6l-6 6 6 6":"M9 6l6 6-6 6"})})}function Io({children:e}){let r=se(),t=Ks(null),[n,o]=Xs(Po),a=Qs(()=>{let m=t.current,p=m?.querySelector("table");if(!m||!p)return;let g=m.querySelector(`.${br}`),u=To(m.getBoundingClientRect(),p.getBoundingClientRect(),getComputedStyle(m).direction==="rtl",g?g.getBoundingClientRect().width:0);o(h=>h.left===u.left&&h.right===u.right&&h.held===u.held&&h.rtl===u.rtl?h:u)},[]);Js(()=>{let m=t.current;if(!m)return;a(),m.addEventListener("scroll",a,{passive:!0});let p=typeof ResizeObserver<"u"?new ResizeObserver(a):null;p?.observe(m);let g=m.querySelector("table");return g&&p?.observe(g),()=>{m.removeEventListener("scroll",a),p?.disconnect()}},[a]);let s=m=>{let p=t.current;p&&p.scrollBy({left:m*Mo(p.clientWidth,n.held),behavior:"smooth"})},i=n.left||n.right,c=m=>i?Ge("div",{className:`edp-table-arrows edp-table-arrows--${m}`,children:yn("span",{dir:"ltr",className:"edp-table-arrows__pair",children:[Ge("button",{type:"button",className:"edp-table-arrow",onClick:()=>s(-1),disabled:!n.left,"aria-label":r.tableScrollLeft,children:Ge(Lo,{side:"left"})}),Ge("button",{type:"button",className:"edp-table-arrow",onClick:()=>s(1),disabled:!n.right,"aria-label":r.tableScrollRight,children:Ge(Lo,{side:"right"})})]})}):null,l=n.rtl?0:n.held,d=n.rtl?n.held:0;return yn("div",{className:"edp-table-frame",style:{margin:`${I("1.25rem")} 0`},children:[c("top"),yn("div",{style:{position:"relative"},children:[Ge("div",{ref:t,className:"edp-table-scroll",style:{overflowX:"auto"},children:e}),n.left&&Ge("span",{className:"edp-table-shade edp-table-shade--left",style:{left:l},"aria-hidden":"true"}),n.right&&Ge("span",{className:"edp-table-shade edp-table-shade--right",style:{right:d},"aria-hidden":"true"})]}),c("bottom")]})}var $o={1:{fontSize:"1.75em",fontWeight:700,lineHeight:1.2,margin:"0.6em 0 0.4em"},2:{fontSize:"1.4em",fontWeight:700,lineHeight:1.25,margin:"0.6em 0 0.35em"},3:{fontSize:"1.15em",fontWeight:600,lineHeight:1.3,margin:"0.5em 0 0.3em"}},zo={border:"#2563eb",background:"#e0f2fe"},Do={border:"#dc2626",background:"#fee2e2"};function Zs(e){return{display:"inline-block",verticalAlign:"middle",border:`2px solid ${e?.border||zo.border}`,background:e?.background||zo.background,borderRadius:I("4px"),padding:"0.17em 0.37em"}}function ei(e){let r=e?.shape==="circle"?"50%":"9999px";return{display:"inline-block",verticalAlign:"middle",border:`2px solid ${e?.border||Do.border}`,background:e?.background||Do.background,borderRadius:r,padding:"0.15em 0.45em"}}function ri(e,r){if(!(!e&&!r))return{...e?{textAlign:e}:{},...r?{margin:0}:{}}}function De(e,r,t){return Q("div",{className:"exercise-content",children:e.content.map((n,o)=>Ne(n,`node-${o}`,r,t))})}var ti=/^[\u00a0\u202f ]?[.,;:!?\u2026)\]}\u00bb\u201d\u2019%\u060c\u061b\u061f]+/,ni=new Set(["blank","inlineChoiceSet"]);function Fo(e,r,t,n){let o=[],a=e??[];for(let s=0;s<a.length;s++){let i=a[s],c=a[s+1],l=ni.has(i.type)&&c?.type==="text"?ti.exec(c.text??"")?.[0]:void 0;if(!l||!c){o.push(Ne(i,`${r}-${s}`,t,n));continue}let d=(c.text??"").slice(l.length);o.push(Oo("span",{style:{whiteSpace:"nowrap"},children:[Q("span",{style:{whiteSpace:"normal"},children:Ne(i,`${r}-${s}-a`,t,n)}),Ne({...c,text:l},`${r}-${s}-p`,t,n)]},`${r}-${s}`)),d&&o.push(Ne({...c,text:d},`${r}-${s+1}`,t,n)),s++}return o}function Ne(e,r,t,n){switch(e.type){case"choiceSet":case"inlineChoiceSet":return Q(kt,{node:e,validationFeedback:t?.get(e.id)},r);case"blank":return e.attrs.mode==="typed"?Q(Rt,{node:e,validationFeedback:t?.get(e.id)},r):Q(St,{node:e,validationFeedback:t?.get(e.id)},r);case"blankPool":return Q(Ct,{node:e},r);case"inlinePool":return Q(_t,{node:e},r);case"matchingSet":return Q(Nt,{node:e,validationFeedback:t?.get(e.id)},r);case"aiAnswerInput":return Q(At,{node:e,validationFeedback:t?.get(e.id)},r);case"openResponseNode":return Q(Et,{node:e,validationFeedback:t?.get(e.id),readOnly:n?.readOnly,mediaHandler:n?.mediaHandler},r);case"mathResponse":return Q(Pt,{nodeId:e.id,placeholder:e.attrs?.placeholder,hint:e.attrs?.hint,validationFeedback:t?.get(e.id),readOnly:n?.readOnly},r);case"codingResponse":return Q(Tt,{node:e,validationFeedback:t?.get(e.id),readOnly:n?.readOnly,executor:n?.codeExecutor},r);case"aiEvaluationConfig":return null;case"paragraph":{let o=e.attrs,a=o?.textAlign,s=o?.dir||void 0;return Q("p",{dir:s,style:ri(a,n?.inTable),children:Fo(e.content,r,t,n)},r)}case"heading":{let o=e.attrs.level??1,a=`h${o}`,s=e.attrs,i=s?.textAlign,c=s?.dir||void 0,l=$o[o]??$o[3];return Q(a,{dir:c,style:{...l,...i?{textAlign:i}:{}},children:Fo(e.content,r,t,n)},r)}case"blockquote":{let o=e.attrs,a=o?.dir||void 0,s=o?.textAlign;return Q("blockquote",{dir:a,style:{borderInlineStart:"3px solid #d6d3cc",paddingInlineStart:"1em",margin:"0.75em 0",color:"#565b66",fontStyle:"italic",...s?{textAlign:s}:{}},children:e.content?.map((i,c)=>Ne(i,`${r}-${c}`,t,n))},r)}case"text":{let o=e,a=n?.inTable?bn(o.text??""):o.text??"",s=o.marks??[];if(s.length===0)return Q("span",{children:a},r);let i={};for(let l of s)l.type==="textStyle"&&(l.attrs?.color&&(i.color=l.attrs.color),l.attrs?.fontSize&&(i.fontSize=l.attrs.fontSize),l.attrs?.fontFamily&&(i.fontFamily=l.attrs.fontFamily));let c=a;for(let l of s)switch(l.type){case"bold":c=Q("strong",{children:c});break;case"italic":c=Q("em",{children:c});break;case"underline":c=Q("u",{children:c});break;case"strike":c=Q("s",{children:c});break;case"code":c=Q("code",{children:c});break;case"subscript":c=Q("sub",{children:c});break;case"superscript":c=Q("sup",{children:c});break;case"boxedText":c=Q("span",{style:Zs(l.attrs),children:c});break;case"circleText":c=Q("span",{style:ei(l.attrs),children:c});break}return Q("span",{style:Object.keys(i).length>0?i:void 0,children:c},r)}case"hardBreak":return Q("br",{},r);case"resizableImage":return Q("img",{src:e.attrs?.src||void 0,alt:e.attrs?.alt||"",style:{display:"inline-block",verticalAlign:"middle",width:We(e.attrs?.width||void 0)??"auto",height:We(e.attrs?.height||void 0)??"auto",maxWidth:"100%"}},r);case"resizableAudio":{let o=e.attrs??{src:""},a=n?.readOnly===!0;return Q(Qe,{src:o.src||"",maxPlays:a?null:o.maxPlays,learnerSpeed:o.learnerSpeed,speed:o.speed,allowSeek:a?null:o.allowSeek},r)}case"resizableVideo":return Q("video",{src:e.attrs?.src||void 0,controls:!0,style:{display:"inline-block",verticalAlign:"middle",width:We(e.attrs?.width||void 0)??"auto",height:We(e.attrs?.height||void 0)??"auto",maxWidth:"100%"}},r);case"youtubeEmbed":return Q("iframe",{src:`https://www.youtube.com/embed/${e.attrs?.videoId||""}`,width:e.attrs?.width||480,height:e.attrs?.height||270,allowFullScreen:!0,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",style:{display:"inline-block",verticalAlign:"middle",border:0,width:We(e.attrs?.width||480),height:We(e.attrs?.height||270)}},r);case"inlineMath":return Q("span",{dir:"ltr",style:{unicodeBidi:"isolate",display:"inline-block"},className:"math-inline",dangerouslySetInnerHTML:{__html:gr(e.attrs?.latex??"",!1,!0)}},r);case"blockMath":return Q("div",{dir:"ltr",style:{unicodeBidi:"isolate",textAlign:"center",margin:"1em 0"},className:"math-block",dangerouslySetInnerHTML:{__html:gr(e.attrs?.latex??"",!0,!0)}},r);case"variable":return Q("span",{className:"variable",children:`{${e.attrs?.name}}`},r);default:{let o=e;if(o.type==="bulletList")return Q("ul",{style:{listStyleType:"disc",paddingLeft:"1.5em",margin:"0.5em 0"},children:o.content?.map((a,s)=>Ne(a,`${r}-${s}`,t,n))},r);if(o.type==="orderedList")return Q("ol",{style:{listStyleType:"decimal",paddingLeft:"1.5em",margin:"0.5em 0"},children:o.content?.map((a,s)=>Ne(a,`${r}-${s}`,t,n))},r);if(o.type==="listItem")return Q("li",{children:o.content?.map((a,s)=>Ne(a,`${r}-${s}`,t,n))},r);if(o.type==="table"){let a=gn(o.content),s={...n,inTable:!0,stickyCells:a.stickyCells};return Q(Io,{children:Oo("table",{style:hn,children:[a.columnWidths.length>0&&Q("colgroup",{children:a.columnWidths.map((i,c)=>Q("col",{style:i?{width:I(i)}:void 0},c))}),Q("tbody",{children:o.content?.map((i,c)=>Ne(i,`${r}-${c}`,t,s))})]})},r)}return o.type==="tableRow"?Q("tr",{children:o.content?.map((a,s)=>Ne(a,`${r}-${s}`,t,n))},r):o.type==="tableCell"?Q("td",{colSpan:o.attrs?.colspan,rowSpan:o.attrs?.rowspan,className:n?.stickyCells?.has(o)?br:void 0,style:Xr({header:!1,gray:!!o.attrs?.gray,sticky:!!n?.stickyCells?.has(o)}),children:Q(Kr.Provider,{value:!0,children:o.content?.map((a,s)=>Ne(a,`${r}-${s}`,t,n))})},r):o.type==="tableHeader"?Q("th",{colSpan:o.attrs?.colspan,rowSpan:o.attrs?.rowspan,className:n?.stickyCells?.has(o)?br:void 0,style:Xr({header:!0,gray:!!o.attrs?.gray,sticky:!!n?.stickyCells?.has(o)}),children:Q(Kr.Provider,{value:!0,children:o.content?.map((a,s)=>Ne(a,`${r}-${s}`,t,n))})},r):(console.warn(`Unknown node type during interpretation: ${e.type}`),null)}}}function ue(e,r){return e.map(t=>{if(t.type==="text"){let n=yr(r?.inTable?bn(t.text??""):t.text??""),o=t.marks??[],a=[];for(let s of o)s.type==="textStyle"&&(s.attrs?.color&&a.push(`color:${s.attrs.color}`),s.attrs?.fontSize&&a.push(`font-size:${s.attrs.fontSize}`),s.attrs?.fontFamily&&a.push(`font-family:${s.attrs.fontFamily}`));a.length>0&&(n=`<span style="${a.join(";")}">${n}</span>`);for(let s of o)switch(s.type){case"bold":n=`<strong>${n}</strong>`;break;case"italic":n=`<em>${n}</em>`;break;case"underline":n=`<u>${n}</u>`;break;case"strike":n=`<s>${n}</s>`;break;case"code":n=`<code>${n}</code>`;break;case"subscript":n=`<sub>${n}</sub>`;break;case"superscript":n=`<sup>${n}</sup>`;break;case"boxedText":{let i=s.attrs?.border||"#2563eb",c=s.attrs?.background||"#e0f2fe";n=`<span style="display:inline-block;vertical-align:middle;border:2px solid ${i};background:${c};border-radius:${I("4px")};padding:0.17em 0.37em">${n}</span>`;break}case"circleText":{let i=s.attrs?.border||"#dc2626",c=s.attrs?.background||"#fee2e2",l=s.attrs?.shape==="circle"?"50%":"9999px";n=`<span style="display:inline-block;vertical-align:middle;border:2px solid ${i};background:${c};border-radius:${l};padding:0.15em 0.45em">${n}</span>`;break}}return n}if(t.type==="paragraph"){let n=t.content?ue(t.content,r):"",o=t.attrs?.dir,a=t.attrs?.textAlign,s=o?` dir="${o}"`:"",i=[a?`text-align:${a}`:"",r?.inTable?"margin:0":""].filter(Boolean).join(";"),c=i?` style="${i}"`:"";return r?.stripParagraphs?n:`<p${s}${c}>${n}</p>`}if(t.type==="hardBreak")return"<br/>";if(t.type==="table"){let n=gn(t.content),o=t.content?ue(t.content,{...r,inTable:!0,stickyCells:n.stickyCells}):"",a=n.columnWidths.length?`<colgroup>${n.columnWidths.map(s=>s?`<col style="width:${I(s)}">`:"<col>").join("")}</colgroup>`:"";return`<div style="${Jr(Eo)}"><table style="${Jr(hn)}">${a}<tbody>${o}</tbody></table></div>`}if(t.type==="tableRow")return`<tr>${t.content?ue(t.content,r):""}</tr>`;if(t.type==="tableCell"){let n=t.content?ue(t.content,r):"",o=t.attrs?.colspan?` colspan="${t.attrs.colspan}"`:"",a=t.attrs?.rowspan?` rowspan="${t.attrs.rowspan}"`:"",s=!!r?.stickyCells?.has(t),i=s?` class="${br}"`:"";return`<td${o}${a}${i} style="${Jr(Xr({header:!1,gray:!!t.attrs?.gray,sticky:s}))}">${n}</td>`}if(t.type==="tableHeader"){let n=t.content?ue(t.content,r):"",o=t.attrs?.colspan?` colspan="${t.attrs.colspan}"`:"",a=t.attrs?.rowspan?` rowspan="${t.attrs.rowspan}"`:"",s=!!r?.stickyCells?.has(t),i=s?` class="${br}"`:"";return`<th${o}${a}${i} style="${Jr(Xr({header:!0,gray:!!t.attrs?.gray,sticky:s}))}">${n}</th>`}if(t.type==="bulletList")return`<ul style="list-style-type:disc;padding-left:1.5em">${t.content?ue(t.content,r):""}</ul>`;if(t.type==="orderedList")return`<ol style="list-style-type:decimal;padding-left:1.5em">${t.content?ue(t.content,r):""}</ol>`;if(t.type==="listItem")return`<li>${t.content?ue(t.content,r):""}</li>`;if(t.type==="blockquote"){let n=t.content?ue(t.content,r):"";return`<blockquote${t.attrs?.dir?` dir="${t.attrs.dir}"`:""} style="border-inline-start:3px solid #d6d3cc;padding-inline-start:1em;margin:0.75em 0;color:#565b66;font-style:italic">${n}</blockquote>`}if(t.type==="resizableImage"){let n=t.attrs??{},o=wt(n.width),a=wt(n.height);return`<img src="${yr(n.src??"")}" alt="${yr(n.alt??"")}" style="display:inline-block;vertical-align:middle;max-width:100%;${o?`width:${o};`:""}${a?`height:${a};`:""}"/>`}if(t.type==="resizableAudio"){let n=t.attrs??{};return`<audio controls preload="metadata" src="${yr(n.src??"")}" style="display:inline-block;vertical-align:middle;width:${I("260px")};max-width:100%;height:${I("36px")}"></audio>`}if(t.type==="resizableVideo"){let n=t.attrs??{},o=wt(n.width),a=wt(n.height);return`<video src="${yr(n.src??"")}" controls style="display:inline-block;vertical-align:middle;max-width:100%;${o?`width:${o};`:""}${a?`height:${a};`:""}"></video>`}if(t.type==="youtubeEmbed"){let n=t.attrs??{};return`<iframe src="https://www.youtube.com/embed/${yr(n.videoId??"")}" width="${n.width||480}" height="${n.height||270}" allowfullscreen frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" style="display:inline-block;vertical-align:middle;border:0;width:${We(n.width||480)};height:${We(n.height||270)}"></iframe>`}return t.type==="inlineMath"?`<span dir="ltr" class="math-inline" style="unicode-bidi:isolate;display:inline-block">${gr(t.attrs?.latex??"",!1,!0)}</span>`:t.type==="blockMath"?`<div dir="ltr" class="math-block" style="unicode-bidi:isolate;text-align:center;margin:1em 0">${gr(t.attrs?.latex??"",!0,!0)}</div>`:t.type==="variable"?`<span class="variable">{${yr(t.attrs?.name??"")}}</span>`:""}).join("")}function wt(e){return e==null||e===""?null:We(e)??null}function yr(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}import{jsx as oi}from"react/jsx-runtime";import{createContext as ai,useContext as jo,useMemo as Bo}from"react";var si={sm:.875,md:1,lg:1.25,xl:1.5},xn=ai(null);function ii(e,r){let t={...e??{}};if(r)for(let[n,o]of Object.entries(r))o!==void 0&&(t[n]=o);return t}function ci(e){return typeof e=="number"?Number.isFinite(e)&&e>0?e:1:e?si[e]??1:1}function Fe(e){let r=e??{};return{scale:ci(r.size),sizeSet:r.size!==void 0,choiceLabels:r.choiceLabels??"marks",choiceColumns:r.choiceColumns,layoutBy:r.layoutBy??"window",motion:r.motion??"full",shuffleSeed:r.shuffleSeed}}function Le(e){let r=jo(xn);return Bo(()=>ii(r,e),[r,e?.size,e?.choiceLabels,e?.choiceColumns,e?.layoutBy,e?.motion,e?.shuffleSeed])}function Ie(){let e=jo(xn);return Bo(()=>Fe(e),[e])}function $e({display:e,children:r}){let t=Le(e);return oi(xn.Provider,{value:t,children:r})}function Oe(e){if(e.sizeSet)return{"--edp-scale":String(e.scale)}}function xr(){let{motion:e}=Ie();return{hop:e==="none"?"":"animate-hop",shake:e==="full"?"animate-shake":"",wobble:e==="full"?"animate-wobble":""}}function li(e){let r=2166136261;for(let t=0;t<e.length;t++)r^=e.charCodeAt(t),r=Math.imul(r,16777619);return r>>>0}function di(e){return()=>{e=e+1831565813|0;let r=Math.imul(e^e>>>15,1|e);return r=r+Math.imul(r^r>>>7,61|r)^r,((r^r>>>14)>>>0)/4294967296}}function Zr(e,r){let t=[...e],n=di(li(r));for(let o=t.length-1;o>0;o--){let a=Math.floor(n()*(o+1));[t[o],t[a]]=[t[a],t[o]]}return t}import{Fragment as qo,jsx as he,jsxs as pi}from"react/jsx-runtime";import{useState as Mt,useEffect as Uo,useRef as Wo,useLayoutEffect as ui,useCallback as mi}from"react";import{createPortal as fi}from"react-dom";import hi from"clsx";var gi=typeof window<"u"?ui:Uo;function vn({node:e}){if(e.type==="text"){if(!e.marks||e.marks.length===0)return he(qo,{children:e.text});let r=e.text||"";for(let t of e.marks)t.type==="bold"?r=he("strong",{children:r}):t.type==="italic"?r=he("em",{children:r}):t.type==="underline"?r=he("u",{children:r}):t.type==="strike"?r=he("s",{children:r}):t.type==="textStyle"&&t.attrs?.color&&(r=he("span",{style:{color:t.attrs.color},children:r}));return he(qo,{children:r})}return e.type==="paragraph"?he("span",{className:"block",children:e.content?.map((r,t)=>he(vn,{node:r},t))??he("br",{})}):e.type==="hardBreak"?he("br",{}):e.content?he("span",{className:"block",children:e.content.map((r,t)=>he(vn,{node:r},t))}):null}function bi({nodes:e}){return he("span",{className:"block space-y-1",style:{color:"var(--ink, #1d2025)"},children:e.map((r,t)=>he(vn,{node:r},t))})}function yi(e,r,t,n=8){let o=e.top-r.height-n;o<n&&(o=e.bottom+n);let a=e.left+e.width/2-r.width/2;return a=Math.max(n,Math.min(a,t-r.width-n)),{top:o,left:a}}function cr({hint:e}){let r=se(),[t,n]=Mt(!1),[o,a]=Mt(!1),[s,i]=Mt(null),[c,l]=Mt({}),d=Wo(null),m=Wo(null);Uo(()=>{if(!o)return;let R=w=>{let C=w.target;d.current&&!d.current.contains(C)&&m.current&&!m.current.contains(C)&&(a(!1),n(!1))};return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[o]);let p=mi(()=>{let R=d.current,w=m.current;!R||!w||i(yi(R.getBoundingClientRect(),w.getBoundingClientRect(),window.innerWidth))},[]);gi(()=>{if(!t){i(null);return}let R=d.current;if(R){let w=getComputedStyle(R);l({direction:w.direction,fontFamily:w.fontFamily,"--edp-scale":w.getPropertyValue("--edp-scale").trim()||"1"})}return p(),window.addEventListener("scroll",p,!0),window.addEventListener("resize",p),()=>{window.removeEventListener("scroll",p,!0),window.removeEventListener("resize",p)}},[t,p]);let g=()=>n(!0),u=()=>{o||n(!1)},h=R=>{R.stopPropagation(),o?(a(!1),n(!1)):(a(!0),n(!0))},v=t&&typeof document<"u"?fi(he("span",{className:"edpire-scope",style:{...c,display:"contents"},children:he("span",{ref:m,role:"tooltip",className:"player-blank-hint-pop",onClick:R=>R.stopPropagation(),onMouseEnter:g,onMouseLeave:u,style:{position:"fixed",top:s?s.top:0,left:s?s.left:0,bottom:"auto",transform:"none",margin:0,visibility:s?"visible":"hidden"},children:he(bi,{nodes:e})})}),document.body):null;return pi("span",{ref:d,className:"relative inline-flex items-center align-middle",onMouseEnter:g,onMouseLeave:u,children:[he("button",{type:"button",onClick:h,className:hi("player-blank-hint-btn select-none",o&&"player-blank-hint-btn--pinned"),"aria-label":r.showHint,"aria-expanded":t,children:"?"}),v]})}function Ye({hint:e}){return!e||e.length===0?null:he(cr,{hint:e})}function wi(e){return[...e].map(r=>({v:r,r:Math.random()})).sort((r,t)=>r.r-t.r).map(r=>r.v)}var ki=e=>e.replace(/ {2,}/g,r=>"&nbsp;".repeat(r.length-1)+" "),Ri=new Set(["image","resizableImage","resizableVideo","youtubeEmbed"]);function Go(e){return(e??[]).some(r=>Ri.has(r?.type)||Go(r?.content))}var Vo=()=>ve("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:3,children:ve("path",{d:"M5 13l4 4L19 7"})}),Qo=()=>ve("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:3,children:ve("path",{d:"M6 6l12 12M18 6L6 18"})});function kt({node:e,validationFeedback:r}){let t=xe(),n=se(),o=Ie(),a=xr(),{id:s,content:i,attrs:c}=e,l=c.shuffle??!1,d="prompt"in c?c.prompt:void 0,m="separator"in c?c.separator??"/":"/",p="pickLimit"in c&&c.pickLimit?c.pickLimit:1,g=c.hideCount===!0,u=g||p>1,h=!g&&p>1,v="layout"in c?c.layout??"row":"row",R=e.type==="inlineChoiceSet",w=JSON.stringify(i),C=l&&o.shuffleSeed!==void 0,y=vi(()=>C?Zr(i,`${o.shuffleSeed}:${s}`):null,[C,o.shuffleSeed,s,w]),[S,k]=Ho(i);wn(()=>{C||k(l?wi(i):i)},[l,C,w]);let _=y??S,[P,F]=Ho(new Set),b=r?.showFeedback??!1,T=r?.correctChoiceIds||[];wn(()=>{let x=j=>{let z=j.answers.find(ae=>ae.nodeId===s&&ae.type==="choiceSet");z&&"selectedIds"in z.answer&&F(new Set(z.answer.selectedIds))};return t.on("answers:prefill",x),()=>t.off("answers:prefill",x)},[s,t]),wn(()=>{t.emit({type:"answer:changed",answer:{nodeId:s,type:"choiceSet",timestamp:Date.now(),answer:{selectedIds:Array.from(P)}}})},[P,s,t]);let f=x=>{b||F(j=>{let O=new Set(j);return u?O.has(x)?O.delete(x):(g||O.size<p)&&O.add(x):O.has(x)?O.delete(x):(O.clear(),O.add(x)),O})},q=x=>ki(ue(x.content)),A=x=>{let j=P.has(x),O=T.includes(x);return b?O&&j?"correct":O&&!j?"correct-unchosen":!O&&j?"incorrect":"muted":j?"selected":"idle"},L={idle:"",selected:"player-choice--selected",correct:Ze("player-choice--correct",a.hop),"correct-unchosen":"player-choice--correct-unchosen",incorrect:Ze("player-choice--incorrect",a.shake),muted:"player-choice--muted"},G={idle:"",selected:"player-inline-choice--selected",correct:Ze("player-inline-choice--correct",a.hop),"correct-unchosen":"player-inline-choice--correct-unchosen",incorrect:Ze("player-inline-choice--incorrect",a.shake),muted:"player-inline-choice--muted"};if(R)return Tr("span",{className:"inline-choice",children:[d&&Tr("span",{className:"mr-2 font-medium",children:[d,h?ve("span",{className:"ms-1 opacity-60",children:n.chooseN(p)}):null]}),_.map((x,j)=>Tr(xi,{children:[ve("button",{type:"button",disabled:b,onClick:()=>f(x.id),className:Ze("player-inline-choice",G[A(x.id)]),"aria-pressed":P.has(x.id),dangerouslySetInnerHTML:{__html:q(x)}}),j<_.length-1&&ve("span",{className:"mx-1",children:m})]},x.id)),c.hint&&c.hint.length>0&&ve(cr,{hint:c.hint})]});let B=o.layoutBy==="box",V=o.choiceColumns?Math.min(o.choiceColumns,_.length):0,K=V?{gridAutoRows:"1fr",gridTemplateColumns:`repeat(${V}, minmax(0, 1fr))`}:{gridAutoRows:"1fr"},le=_.some(x=>Go(x.content)),ye=o.choiceLabels==="letters",E=x=>n.choiceLetters[x]??String(x+1);return Tr("div",{className:Ze("cs-player my-4 space-y-3",B&&"cs-player--box"),children:[d&&Tr("p",{className:"font-medium",children:[d,h?ve("span",{className:"ms-2 text-sm opacity-70",children:n.chooseN(p)}):null]}),c.hint&&c.hint.length>0&&ve(cr,{hint:c.hint}),ve("div",{className:Ze("cs-player__grid",v==="row"&&"cs-player__grid--row"),style:K,children:_.map((x,j)=>{let O=A(x.id),z=O==="incorrect"?"incorrect":O==="correct"||O==="correct-unchosen"?"correct":null;return Tr("button",{type:"button",disabled:b,onClick:()=>f(x.id),className:Ze("player-choice",le&&"player-choice--tile",L[O]),"aria-pressed":P.has(x.id),children:[ve("span",{className:Ze("player-choice__mark",u?"player-choice__mark--box":"player-choice__mark--radio",ye&&"player-choice__mark--letter"),children:ye?E(j):O==="incorrect"?ve(Qo,{}):ve(Vo,{})}),ve("span",{className:"player-choice__text",dangerouslySetInnerHTML:{__html:q(x)}}),ye&&z&&ve("span",{className:`player-choice__verdict player-choice__verdict--${z}`,"aria-hidden":"true",children:z==="incorrect"?ve(Qo,{}):ve(Vo,{})})]},x.id)})})]})}import{jsx as er,Fragment as Si,jsxs as kn}from"react/jsx-runtime";import{useContext as Ci,useState as _i,useEffect as Rn,useRef as Ni,useCallback as Ai}from"react";import vr from"clsx";function Rt({node:e,validationFeedback:r}){let t=xe(),n=se(),o=xr(),{id:a,attrs:s}=e,{placeholder:i="___",width:c="auto",hint:l}=s,d=Ni(null),m=i.trim().split(/\s+/).filter(Boolean).length,p=Ci(Kr),g=!p&&c==="auto"&&m>=4,[u,h]=_i(""),v=r?.showFeedback??!1,R=r?.state,w=R==="validating",C=r?.displayAnswer,y=r?.message;Rn(()=>{let P=F=>{let T=F.answers.find(f=>f.nodeId===a&&f.type==="blank");T&&"mode"in T.answer&&T.answer.mode==="typed"&&"text"in T.answer&&h(T.answer.text)};return t.on("answers:prefill",P),()=>t.off("answers:prefill",P)},[a,t]),Rn(()=>{t.emit({type:"answer:changed",answer:{nodeId:a,type:"blank",timestamp:Date.now(),answer:{mode:"typed",text:u}}})},[u,a,t]);let S=P=>{h(P.target.value)},k=Ai(()=>{let P=d.current;P&&(P.style.height="auto",P.style.height=`${P.scrollHeight}px`)},[]);Rn(()=>{k()},[u,k]);let _=v&&!w;return kn("span",{className:p?"player-blank-cell":vr("inline-flex flex-wrap items-center gap-x-1 gap-y-0.5 align-middle max-w-full",g&&"w-full"),children:[er("span",{className:p?"player-blank-cell__box":vr("relative inline-block shrink-0 min-w-0 max-w-full",g&&"w-full flex-1"),children:_?er("span",{className:vr("player-typed-blank-feedback",p&&"player-typed-blank-feedback--cell",g&&"w-full",R==="correct"&&vr("player-typed-blank-feedback--correct",o.hop),R==="partial"&&"player-typed-blank-feedback--partial",R==="incorrect"&&vr("player-typed-blank-feedback--incorrect",o.wobble)),children:u||er("span",{className:"opacity-40",children:i})}):kn(Si,{children:[er("textarea",{ref:d,"aria-label":n.blankAnswerAria,placeholder:i,value:u,onChange:S,disabled:v,rows:1,wrap:p?"off":void 0,className:vr("player-typed-blank",p&&"player-typed-blank--cell",g&&"w-full",w&&"player-typed-blank--pending"),style:p?void 0:c!=="auto"?{width:c}:g?{width:"100%"}:{width:`${Math.max(7,u.length+1)}ch`,maxWidth:"100%"}}),!u&&!w&&!p&&er("span",{className:"absolute right-1 top-1/2 -translate-y-1/2 pointer-events-none text-sm",style:{color:"var(--ink-faint, #8d93a0)"},children:"\u270E"}),w&&er("span",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:er("span",{className:"player-typed-blank-spinner","aria-label":n.aiEvaluationInProgressAria})})]})}),v&&R==="incorrect"&&C&&kn("span",{className:"player-blank-reveal",children:["(",C,")"]}),v&&y&&er("span",{className:vr("player-blank-feedback",R==="correct"&&"player-blank-feedback--correct",R==="partial"&&"player-blank-feedback--partial",R==="incorrect"&&"player-blank-feedback--incorrect"),children:y}),l&&l.length>0&&er(cr,{hint:l})]})}import{jsx as It,Fragment as Jo,jsxs as Cn}from"react/jsx-runtime";import{useEffect as Zo}from"react";import $t from"clsx";import{useDroppable as $i,useDndContext as zi}from"@dnd-kit/core";import{jsx as Ei}from"react/jsx-runtime";import{createContext as Pi,useCallback as lr,useContext as Ti,useEffect as Mi,useMemo as Yo,useRef as Li,useState as Sn}from"react";import{useDndMonitor as Ii}from"@dnd-kit/core";var Xo=Pi(null);function Ke(){let e=Ti(Xo);if(!e)throw new Error("usePool must be used within a PoolProvider");return e}function Ko(e){let r={};for(let t of e??[])t.type==="blank"&&"mode"in t.answer&&t.answer.mode==="choice"&&"choiceId"in t.answer&&t.answer.choiceId&&(r[t.nodeId]={choiceId:t.answer.choiceId,poolId:t.answer.poolId||"",value:t.answer.value||""});return r}function Lt({children:e,initialAnswers:r}){let t=xe(),n=Yo(()=>Ko(r),[r]),[o,a]=Sn(n),[s,i]=Sn({}),[c,l]=Sn({}),d=Li(new Set);Mi(()=>{let y=S=>{let k=Ko(S.answers);Object.keys(k).length!==0&&a(_=>{if(!Object.entries(k).some(([b,T])=>_[b]?.choiceId!==T.choiceId||_[b]?.poolId!==T.poolId||_[b]?.value!==T.value))return _;let F={..._,...k};return i(b=>{let T={...b};for(let[f,q]of Object.entries(b)){let A=new Set(Object.values(F).filter(L=>L.poolId===f).map(L=>L.choiceId));T[f]={...q,available:new Set(q.choices.map(L=>L.id).filter(L=>!A.has(L)))}}return T}),F})};return t.on("answers:prefill",y),()=>t.off("answers:prefill",y)},[t]);let m=lr((y,S)=>{i(k=>{let _=k[y];if(!_){let f=new Set;for(let A of Object.values(o))A.poolId===y&&f.add(A.choiceId);let q=new Set(S.map(A=>A.id).filter(A=>!f.has(A)));return{...k,[y]:{choices:S,available:q}}}let P=new Set(_.choices.map(f=>f.id)),F=new Set(S.map(f=>f.id));if(!(S.some(f=>!P.has(f.id))||_.choices.some(f=>!F.has(f.id))))return k;let T=new Set;for(let f of _.available)F.has(f)&&T.add(f);for(let f of S)P.has(f.id)||T.add(f.id);return{...k,[y]:{choices:S,available:T}}})},[o]),p=lr((y,S)=>{l(k=>{let _=k[y]??[];return _.includes(S)?k:{...k,[y]:[..._,S]}}),!d.current.has(S)&&!o[S]&&(d.current.add(S),t.emit({type:"answer:changed",answer:{nodeId:S,type:"blank",timestamp:Date.now(),answer:{mode:"choice",choiceId:"",poolId:y,value:""}}}))},[o,t]),g=lr(y=>(c[y]??[]).find(k=>!o[k])??null,[c,o]),u=lr((y,S,k,_)=>{a(P=>{let F=P[y];return F&&i(b=>{let T=b[F.poolId];if(!T)return b;let f=new Set(T.available);return f.add(F.choiceId),{...b,[F.poolId]:{...T,available:f}}}),{...P,[y]:{choiceId:k,value:_,poolId:S}}}),i(P=>{let F=P[S];if(!F)return P;let b=new Set(F.available);return b.delete(k),{...P,[S]:{...F,available:b}}}),t.emit({type:"answer:changed",answer:{nodeId:y,type:"blank",timestamp:Date.now(),answer:{mode:"choice",choiceId:k,poolId:S,value:_}}})},[t]),h=lr(y=>{let S=o[y];if(!S)return;let{poolId:k,choiceId:_}=S;i(P=>{let F=P[k];if(!F)return P;let b=new Set(F.available);return b.add(_),{...P,[k]:{...F,available:b}}}),a(P=>{let{[y]:F,...b}=P;return b}),t.emit({type:"answer:changed",answer:{nodeId:y,type:"blank",timestamp:Date.now(),answer:{mode:"choice",choiceId:"",poolId:k,value:""}}})},[o,t]),v=lr((y,S)=>s[y]?.available.has(S)??!1,[s]),R=lr((y,S)=>s[y]?.choices.find(k=>k.id===S),[s]),w=lr(()=>{a({}),i(y=>{let S={};for(let[k,_]of Object.entries(y))S[k]={choices:_.choices,available:new Set(_.choices.map(P=>P.id))};return S});for(let[y,S]of Object.entries(c))for(let k of S)t.emit({type:"answer:changed",answer:{nodeId:k,type:"blank",timestamp:Date.now(),answer:{mode:"choice",choiceId:"",poolId:y,value:""}}})},[c,t]);Ii({onDragEnd(y){window.dispatchEvent(new CustomEvent("dnd-drop",{detail:{active:y.active,over:y.over}}))}});let C=Yo(()=>({blanks:o,pools:s,registerPool:m,registerBlank:p,fill:u,back:h,isAvailable:v,getChoice:R,firstEmptyBlank:g,resetAllAnswers:w}),[o,s,m,p,u,h,v,R,g,w]);return Ei(Xo.Provider,{value:C,children:e})}function St({node:e,validationFeedback:r}){let{id:t,attrs:n}=e,{poolId:o,placeholder:a="___",hint:s}=n,{blanks:i,fill:c,back:l,getChoice:d,registerBlank:m}=Ke(),p=se(),g=xr(),u=i[t],h=!!u?.choiceId,v=r?.showFeedback??!1,R=r?.state,w=r?.correctChoiceIds??[],C=v&&R==="incorrect"&&w.length>0?d(o||"",w[0]):void 0,y=C?C.html.replace(/<\/?[^>]+(>|$)/g,""):void 0,{setNodeRef:S,isOver:k}=$i({id:t,data:{type:"blank",blankId:t,poolId:o}}),{active:_}=zi(),P=!!_&&_.data.current?.poolId===o;return Zo(()=>{m(o||"",t)},[o,t,m]),Zo(()=>{let T=f=>{let q=f,{active:A,over:L}=q.detail||{};if(!L||L.id!==t)return;let{choiceId:G,poolId:B}=A?.data.current||{};if(!G||B!==o)return;let V=d(o||"",G);if(!V)return;let K=V.html.replace(/<\/?[^>]+(>|$)/g,"");c(t,o||"",G,K)};return window.addEventListener("dnd-drop",T),()=>window.removeEventListener("dnd-drop",T)},[t,o,d,c]),Cn(Jo,{children:[It("span",{ref:S,onClick:()=>{h&&!v&&l(t)},className:$t("player-choice-blank",k&&"player-choice-blank--over",!k&&P&&!h&&!v&&"player-choice-blank--target",h&&!v&&!k&&"player-choice-blank--filled",v&&R==="correct"&&$t("player-choice-blank--correct",g.hop),v&&R==="partial"&&$t("player-choice-blank--partial",g.hop),v&&R==="incorrect"&&$t("player-choice-blank--incorrect",g.wobble)),title:h&&!v?p.clickToRemove:void 0,"data-node-id":t,"data-pool-id":o,children:h?Cn(Jo,{children:[It("span",{children:u.value}),!v&&It("span",{className:"player-choice-blank__clear",children:"\xD7"})]}):a}),y&&Cn("span",{className:"player-blank-reveal",children:["(",y,")"]}),It(Ye,{hint:s})]})}import{jsx as An,jsxs as Wi}from"react/jsx-runtime";import{useEffect as ca,useRef as Ui,useState as Hi}from"react";import Vi from"clsx";import{jsx as ia,jsxs as ji}from"react/jsx-runtime";import Bi from"clsx";import{useDraggable as qi}from"@dnd-kit/core";import{jsx as wr,jsxs as ea}from"react/jsx-runtime";import{useEffect as ra,useState as ta}from"react";import Di from"clsx";var na="edpire:tap-hint-placed",oa=2;function Fi(e){let t=(()=>{try{return Number(e?.getItem(na))||0}catch{return 0}})(),n=new Set,o=new Set,a=()=>n.forEach(s=>s());return{done:()=>t>=oa,placed:()=>t,recordPlacement(){if(!(t>=oa)){t+=1;try{e?.setItem(na,String(t))}catch{}a()}},setOnScreen(s,i){let c=o.has(s);i!==c&&(i?o.add(s):o.delete(s),a())},owner(){let s=null;for(let i of o)(!s||i.compareDocumentPosition(s)&4)&&(s=i);return s},subscribe(s){return n.add(s),()=>{n.delete(s)}}}}var _n=null;function Nn(){if(!_n){let e=null;try{e=typeof window<"u"?window.localStorage:null}catch{e=null}_n=Fi(e)}return _n}function aa(){typeof window>"u"||Nn().recordPlacement()}function Oi(){try{return window.matchMedia("(hover: none) and (pointer: coarse)").matches}catch{return!1}}function zt(e,r){let[,t]=ta(0),[n,o]=ta(!1);if(ra(()=>{o(Oi())},[]),ra(()=>{let s=e.current;if(!n||!s)return;let i=Nn();if(i.done())return;let c=i.subscribe(()=>t(d=>d+1));if(!r||typeof IntersectionObserver>"u")return()=>{i.setOnScreen(s,!1),c()};let l=new IntersectionObserver(d=>{for(let m of d)i.setOnScreen(s,m.isIntersecting)},{threshold:.6});return l.observe(s),()=>{l.disconnect(),i.setOnScreen(s,!1),c()}},[e,n,r]),!n||!r||typeof window>"u")return!1;let a=Nn();return!a.done()&&a.owner()===e.current}function sa(){let{motion:e}=Ie();return ea("span",{className:Di("player-tap-hint",e==="none"&&"player-tap-hint--still"),"aria-hidden":"true",children:[wr("span",{className:"player-tap-hint__ripple"}),wr("svg",{className:"player-tap-hint__hand",viewBox:"0 0 24 24",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[{stroke:"#ffffff",strokeWidth:4.5},{stroke:"currentColor",strokeWidth:1.75}].map((r,t)=>ea("g",{...r,children:[wr("path",{d:"M22 14a8 8 0 0 1-8 8"}),wr("path",{d:"M18 11v-1a2 2 0 0 0-2-2a2 2 0 0 0-2 2"}),wr("path",{d:"M14 10V9a2 2 0 0 0-2-2a2 2 0 0 0-2 2v1"}),wr("path",{d:"M10 9.5V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v10"}),wr("path",{d:"M18 11a2 2 0 1 1 4 0v3a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15"})]},t))})]})}function Mr({poolId:e,data:r,isInline:t=!1,tapHint:n=!1}){let{isAvailable:o,firstEmptyBlank:a,fill:s}=Ke(),{id:i,html:c}=r,l=!o(e,i),{setNodeRef:d,attributes:m,listeners:p,transform:g,isDragging:u}=qi({id:i,data:{type:"choice",choiceId:i,poolId:e,html:c},disabled:l});if(l)return null;let h=C=>C.replace(/<\/?[^>]+(>|$)/g,""),v=()=>{let C=a(e);if(C){let y=h(c);s(C,e,i,y),aa()}},R=g?{transform:`translate3d(${g.x}px, ${g.y}px, 0)`}:void 0;return ji(t?"span":"div",{ref:d,style:R,className:Bi("player-bank-pill",u&&"player-bank-pill--dragging",n&&!u&&"player-bank-pill--hinted",t&&"mx-1"),...m,...p,onClick:v,children:[ia("span",{dangerouslySetInnerHTML:{__html:c},className:"pointer-events-none whitespace-pre-wrap break-words"}),n&&!u&&ia(sa,{})]})}function Ct({node:e}){let r=se(),{id:t,attrs:n,content:o}=e,{shuffle:a=!0,equalWidth:s=!1}=n,{registerPool:i,isAvailable:c}=Ke(),l=Ui(null),[d,m]=Hi(()=>o.map(u=>({id:u.id,html:ue(u.content)})));ca(()=>{let u=o.map(h=>({id:h.id,html:ue(h.content)}));m(a?[...u].map(h=>({v:h,r:Math.random()})).sort((h,v)=>h.r-v.r).map(h=>h.v):u)},[a,JSON.stringify(o)]),ca(()=>{i(t,d)},[t,d,i]);let p=d.find(u=>c(t,u.id))?.id,g=zt(l,p!==void 0);return Wi("div",{ref:l,className:"player-word-bank",children:[An("div",{className:"player-word-bank__label",children:r.wordBank}),An("div",{className:Vi("player-word-bank__items",s&&"player-word-bank__items--grid"),children:d.map(u=>An(Mr,{poolId:t,data:u,tapHint:g&&u.id===p},u.id))})]})}import{jsx as En,jsxs as Qi}from"react/jsx-runtime";import{useEffect as la,useRef as Gi,useState as Yi}from"react";function _t({node:e}){let{id:r,attrs:t,content:n}=e,{shuffle:o=!0,separator:a=" "}=t,{registerPool:s,isAvailable:i}=Ke(),c=Gi(null),[l,d]=Yi(()=>n.map(g=>({id:g.id,html:ue(g.content,{stripParagraphs:!0})})));la(()=>{let g=n.map(u=>({id:u.id,html:ue(u.content,{stripParagraphs:!0})}));d(o?[...g].map(u=>({v:u,r:Math.random()})).sort((u,h)=>u.r-h.r).map(u=>u.v):g)},[o,JSON.stringify(n)]),la(()=>{s(r,l)},[r,l,s]);let m=l.find(g=>i(r,g.id))?.id,p=zt(c,m!==void 0);return En("span",{ref:c,style:{display:"inline-flex",flexWrap:"wrap",gap:I("0.25rem"),alignItems:"center"},children:l.map((g,u)=>Qi("span",{children:[En(Mr,{poolId:r,data:g,isInline:!0,tapHint:p&&g.id===m}),u<l.length-1&&En("span",{children:a})]},g.id))})}import{jsx as Lr,jsxs as Mn}from"react/jsx-runtime";import{useState as Ln,useEffect as In,useMemo as Zi}from"react";import{Check as ec,X as rc}from"lucide-react";import{jsx as Re,jsxs as kr}from"react/jsx-runtime";import{useState as Pn,useMemo as Tn,useRef as Dt,useCallback as Ki,useLayoutEffect as Xi}from"react";var da="#1d2025",pa="#8d93a0",ua="#1f8a4c",ma="#d23b2b",Ji=11;function fa({leftItems:e,rightItems:r,connections:t,direction:n,disabled:o,feedback:a,onConnectionsChange:s}){let[i,c]=Pn(null),[l,d]=Pn(null),[m,p]=Pn(new Map),g=Dt(null),u=Dt(new Map),h=Dt("mouse"),v=a?.showFeedback??!1,R=Tn(()=>{let E=new Map;if(a?.pairFeedback)for(let x of a.pairFeedback)E.set(`${x.leftId}-${x.rightId}`,x.correct);return E},[a]),w=Tn(()=>{let E=new Map;return a?.correctPairings?.forEach(x=>E.set(x.leftId,x.rightId)),E},[a]),C=Tn(()=>{let E=new Map;return a?.correctPairings?.forEach(x=>E.set(x.rightId,x.leftId)),E},[a]),y=new Map,S=new Map;t.forEach((E,x)=>{y.set(E.leftId,x),S.set(E.rightId,x)});let k=E=>{let x=t[E];if(!v||!x)return null;let j=R.get(`${x.leftId}-${x.rightId}`);return j===!0?"correct":j===!1?"incorrect":null},_=Ki(()=>{if(!g.current)return;let E=g.current.getBoundingClientRect(),x=new Map;u.current.forEach((j,O)=>{if(j){let z=j.getBoundingClientRect();x.set(O,new DOMRect(z.left-E.left,z.top-E.top,z.width,z.height))}}),p(x)},[]);Xi(()=>{_();let E=new ResizeObserver(_);return g.current&&E.observe(g.current),()=>E.disconnect()},[_,t,e,r]);let P=8,F=(E,x)=>{let j=m.get(E);if(!j)return null;let O=j.y+j.height/2;return x==="left"?{x:j.x+j.width,y:O}:{x:j.x-P,y:O}},b=(E,x)=>{if(o)return;let O=(x==="left"?y:S).has(E),z=i?.id===E&&i?.side===x,ae=i!==null&&i.side!==x;if(z){c(null);return}if(ae){let re=x==="right"?i.id:E,ie=x==="left"?i.id:E,de=t.filter(U=>U.leftId!==re&&U.rightId!==ie);de.push({leftId:re,rightId:ie}),s(de),c(null);return}if(O&&!i){let re=x==="left"?t.filter(ie=>ie.leftId!==E):t.filter(ie=>ie.rightId!==E);s(re);return}c({id:E,side:x})},T=Dt(null),f=(E,x,j)=>{if(o||(h.current=j.pointerType,j.pointerType==="touch"))return;j.currentTarget.setPointerCapture(j.pointerId);let O=g.current.getBoundingClientRect();T.current={x:j.clientX-O.left,y:j.clientY-O.top},d({fromId:E,fromSide:x,x:j.clientX-O.left,y:j.clientY-O.top,overId:null,overSide:null})},q=E=>{if(!l)return;let x=g.current.getBoundingClientRect(),j=E.clientX-x.left,O=E.clientY-x.top,z=l.fromSide==="left"?"right":"left",ae=z==="left"?e:r,re=null,ie=null;for(let de of ae){let U=m.get(de.id);if(U&&j>=U.x&&j<=U.x+U.width&&O>=U.y&&O<=U.y+U.height){re=de.id,ie=z;break}}d(de=>de?{...de,x:j,y:O,overId:re,overSide:ie}:null)},A=E=>{if(!l)return;let x=g.current.getBoundingClientRect(),j=E.clientX-x.left,O=E.clientY-x.top,z=T.current;if((z?Math.hypot(j-z.x,O-z.y):999)<8){d(null),b(l.fromId,l.fromSide);return}if(l.overId&&l.overSide){let re=l.fromSide==="left"?l.fromId:l.overId,ie=l.fromSide==="right"?l.fromId:l.overId,de=t.filter(U=>U.leftId!==re&&U.rightId!==ie);de.push({leftId:re,rightId:ie}),s(de)}d(null),c(null)},L=(E,x)=>{if(!v)return null;let O=(x==="left"?y:S).get(E.id);if(O!==void 0){let z=t[O];if(R.get(`${z.leftId}-${z.rightId}`)===!0)return null}if(x==="left"){let z=w.get(E.id);return r.find(ae=>ae.id===z)?.content??null}else{let z=C.get(E.id);return e.find(ae=>ae.id===z)?.content??null}},G=(E,x)=>{let O=(x==="left"?y:S).get(E.id),z=O!==void 0,ae=i?.id===E.id&&i?.side===x,re=i!==null&&i.side!==x&&!z,ie=l?.overId===E.id&&l?.overSide===x,de=z?k(O):null,U=z?O+1:null,Y="matching-player__item";z&&(Y+=" matching-player__item--matched"),de==="correct"&&(Y+=" matching-player__item--correct"),de==="incorrect"&&(Y+=" matching-player__item--incorrect"),ae&&(Y+=" matching-player__item--selected"),(re||ie)&&(Y+=" matching-player__item--available"),o&&(Y+=" matching-player__item--disabled");let me=L(E,x);return kr("button",{ref:ee=>{ee?u.current.set(E.id,ee):u.current.delete(E.id)},type:"button",className:Y,onPointerDown:ee=>f(E.id,x,ee),onClick:()=>{h.current==="touch"&&b(E.id,x)},"aria-pressed":ae,children:[x==="right"&&Re("span",{className:"matching-player__connector matching-player__connector--right","aria-hidden":!0,children:kr("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:[Re("circle",{cx:"9",cy:"9",r:"8",stroke:"currentColor",strokeWidth:"1.5",fill:"currentColor",fillOpacity:"0.08"}),Re("path",{d:"M12 9H6M8.5 6.5L6 9l2.5 2.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),z&&x==="left"&&Re("span",{className:"matching-player__pair-num","aria-hidden":!0,children:U}),Re("span",{className:"matching-player__item-text",dangerouslySetInnerHTML:{__html:ue(E.content)}}),me&&kr("span",{className:"matching-player__correct-hint",children:["(",Re("span",{dangerouslySetInnerHTML:{__html:ue(me)}}),")"]}),z&&x==="right"&&Re("span",{className:"matching-player__pair-num","aria-hidden":!0,children:U}),x==="left"&&Re("span",{className:"matching-player__connector matching-player__connector--left","aria-hidden":!0,children:kr("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:[Re("circle",{cx:"9",cy:"9",r:"8",stroke:"currentColor",strokeWidth:"1.5",fill:"currentColor",fillOpacity:"0.08"}),Re("path",{d:"M6 9h6M9.5 6.5L12 9l-2.5 2.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]},E.id)},B=n==="ltr"?e:r,V=n==="ltr"?r:e,K=n==="ltr"?"left":"right",le=n==="ltr"?"right":"left";return kr("div",{ref:g,className:`matching-player__arena${l?" matching-player__arena--dragging":""}`,onPointerMove:q,onPointerUp:A,children:[kr("svg",{className:"matching-player__svg","aria-hidden":!0,children:[Re("defs",{children:[["mp-arrow-ink",da],["mp-arrow-correct",ua],["mp-arrow-incorrect",ma],["mp-arrow-ghost",pa]].map(([E,x])=>Re("marker",{id:E,markerUnits:"userSpaceOnUse",markerWidth:"11",markerHeight:"9",refX:"0",refY:"4.5",orient:"auto",children:Re("polygon",{points:"0 0, 11 4.5, 0 9",fill:x})},E))}),t.map(E=>{let x=F(E.leftId,"left"),j=F(E.rightId,"right");if(!x||!j)return null;let O=j.x-Ji,z=Math.max(16,Math.abs(O-x.x)*.4),ae=`M ${x.x} ${x.y} C ${x.x+z} ${x.y}, ${O-z} ${j.y}, ${O} ${j.y}`,re=v?R.get(`${E.leftId}-${E.rightId}`):void 0;return Re("path",{d:ae,stroke:re===!0?ua:re===!1?ma:da,strokeWidth:"2.5",fill:"none",markerEnd:`url(#${re===!0?"mp-arrow-correct":re===!1?"mp-arrow-incorrect":"mp-arrow-ink"})`},`${E.leftId}-${E.rightId}`)}),l&&(()=>{let E=F(l.fromId,l.fromSide);if(!E)return null;let x=Math.abs(l.x-E.x)*.35,j=`M ${E.x} ${E.y} C ${E.x+x} ${E.y}, ${l.x-x} ${l.y}, ${l.x} ${l.y}`;return Re("path",{d:j,stroke:pa,strokeWidth:"2",strokeDasharray:"6 4",fill:"none",markerEnd:"url(#mp-arrow-ghost)"})})()]}),kr("div",{className:"matching-player__columns",children:[Re("div",{className:"matching-player__column",children:B.map(E=>G(E,K))}),Re("div",{className:"matching-player__column",children:V.map(E=>G(E,le))})]})]})}var ha=e=>Number.isInteger(e)?String(e):e.toFixed(2);function ga(e){return[...e].map(r=>({v:r,r:Math.random()})).sort((r,t)=>r.r-t.r).map(r=>r.v)}function Nt({node:e,validationFeedback:r}){let t=xe(),{shuffleSeed:n,layoutBy:o}=Ie(),{id:a,attrs:s,leftItems:i,rightItems:c}=e,{direction:l,shuffle:d,hint:m}=s,p=JSON.stringify(i),g=JSON.stringify(c),u=d&&n!==void 0,h=Zi(()=>u?{left:Zr(i,`${n}:${a}:left`),right:Zr(c,`${n}:${a}:right`)}:null,[u,n,a,p,g]),[v,R]=Ln(i),[w,C]=Ln(c);In(()=>{u||(d?(R(ga(i)),C(ga(c))):(R(i),C(c)))},[d,u,p,g]);let y=h?.left??v,S=h?.right??w,[k,_]=Ln([]),P=r?.showFeedback??!1;In(()=>{let A=L=>{let B=L.answers.find(V=>V.nodeId===a&&V.type==="matchingSet");B&&"connections"in B.answer&&_(B.answer.connections)};return t.on("answers:prefill",A),()=>t.off("answers:prefill",A)},[t,a]),In(()=>{t.emit({type:"answer:changed",answer:{nodeId:a,type:"matchingSet",timestamp:Date.now(),answer:{connections:k}}})},[t,a,k]);let F=A=>{P||_(A)},b=r?.score,T=r?.maxScore,f=P&&b!=null&&T!=null,q=f?b>=T?"correct":b>0?"partial":"incorrect":null;return Mn("div",{className:o==="box"?"matching-player matching-player--box":"matching-player",children:[m&&m.length>0&&Lr("div",{className:"matching-player-hintrow",children:Lr(Ye,{hint:m})}),Lr(fa,{leftItems:y,rightItems:S,connections:k,direction:l,disabled:P,feedback:r,onConnectionsChange:F}),f&&Mn("div",{className:"matching-player-feedback matching-player-feedback--"+q,children:[q==="correct"&&Lr(ec,{size:15,style:fe(15)}),q==="incorrect"&&Lr(rc,{size:15,style:fe(15)}),Lr("span",{children:q==="correct"?"All matched":q==="partial"?"Partial credit":"Not matched"}),Mn("span",{className:"matching-player-score",children:[ha(b)," / ",ha(T)]})]})]})}import{jsxs as Ir,jsx as Xe,Fragment as tc}from"react/jsx-runtime";import{useState as ba,useEffect as $n,useRef as nc,useCallback as ya}from"react";import Ft from"clsx";function At({node:e,validationFeedback:r}){let t=xe(),n=se(),{id:o,attrs:a}=e,{placeholder:s,minWords:i=0,maxWords:c=500,hint:l}=a,[d,m]=ba(""),[p,g]=ba(0),u=r?.showFeedback??!1,h=r?.state,v=c<=30,R=ya(b=>b.trim().split(/\s+/).filter(Boolean).length,[]);$n(()=>{let b=T=>{let q=T.answers?.find(A=>A.nodeId===o&&A.type==="aiAnswer");if(q&&q.answer?.text!=null){let A=q.answer.text;m(A),g(R(A))}};return t.on("answers:prefill",b),()=>t.off("answers:prefill",b)},[o,t,R]),$n(()=>{let b=()=>{m(""),g(0)};return t.on("answers:reset",b),()=>t.off("answers:reset",b)},[t]);let w=nc(null),C=ya((b,T)=>{w.current&&clearTimeout(w.current),w.current=setTimeout(()=>{t.emit({type:"answer:changed",answer:{nodeId:o,type:"aiAnswer",timestamp:Date.now(),answer:{text:b,wordCount:T}}})},300)},[o,t]);$n(()=>{t.emit({type:"answer:changed",answer:{nodeId:o,type:"aiAnswer",timestamp:Date.now(),answer:{text:"",wordCount:0}}})},[]);let y=b=>{if(u)return;let T=R(b);m(b),g(T),C(b,T)},S=h==="validating",k=Ft("player-ai-count",p>c&&"player-ai-count--over"),_=!u||S?"":h==="correct"?"player-ai-input--correct":h==="incorrect"?"player-ai-input--incorrect":h==="partial"?"player-ai-input--partial":"",P=h==="correct"?"player-ai-feedback--correct":h==="incorrect"?"player-ai-feedback--incorrect":h==="partial"?"player-ai-feedback--partial":"",F=b=>Number.isInteger(b)?String(b):b.toFixed(2);return Ir("div",{className:"player-ai",children:[Ir("div",{className:"player-ai-counts",children:[Ir("span",{className:k,children:[p," / ",c," ",n.openResponseWords]}),i>0&&p<i&&Xe("span",{className:"player-ai-count player-ai-count--min",children:n.minWordsLabel(i)}),Xe("span",{style:{marginInlineStart:"auto"},children:Xe(Ye,{hint:l})})]}),v?Xe("input",{type:"text",value:d,onChange:b=>y(b.target.value),placeholder:s??n.shortAnswerPlaceholder,"aria-label":n.blankAnswerAria,disabled:u,className:Ft("player-ai-input",_)}):Xe("textarea",{value:d,onChange:b=>y(b.target.value),placeholder:s??n.longAnswerPlaceholder,"aria-label":n.blankAnswerAria,disabled:u,rows:5,className:Ft("player-ai-input player-ai-input--multiline",_)}),u&&r&&Xe("div",{className:Ft("player-ai-feedback",P),children:S?Ir("div",{className:"player-ai-validating",children:[Xe("span",{className:"player-ai-spinner"}),Xe("span",{children:n.aiEvaluationInProgress})]}):Ir(tc,{children:[r.message&&Xe("p",{className:"player-ai-message",children:r.message}),r.score!=null&&r.maxScore!=null&&Xe("div",{className:"player-ai-score-row",children:Ir("span",{className:"player-ai-score",children:[F(r.score)," / ",F(r.maxScore)]})})]})})]})}import{jsx as M,jsxs as X,Fragment as et}from"react/jsx-runtime";import{useState as Ae,useEffect as Ee,useRef as Ce,useCallback as Ot}from"react";import{useEditor as oc,EditorContent as ac}from"@tiptap/react";import sc from"@tiptap/starter-kit";import rr from"clsx";import{FolderOpen as ic,Mic as cc,Video as xa,Monitor as lc,Clock as dc,Image as pc,FileText as va,Music as uc,Link2 as mc,Check as fc,AlertCircle as hc}from"lucide-react";function wa(e){return e.trim().split(/\s+/).filter(Boolean).length}function ka(e){return e.length}function gc(e){let r=t=>t.map(n=>(n.text??"")+(n.content?r(n.content):"")).join(" ");return wa(r(e))}function bc(e){let r=t=>t.map(n=>(n.text??"")+(n.content?r(n.content):"")).join("");return ka(r(e))}function yc(e){return/youtube\.com|youtu\.be/i.test(e)?"youtube":/vimeo\.com/i.test(e)?"vimeo":"other"}function xc(e){let r=e.match(/[?&]v=([^&]+)/)||e.match(/youtu\.be\/([^?]+)/)||e.match(/embed\/([^?]+)/);return r?r[1]:null}function zn(e){let r=Math.floor(e/60),t=e%60;return`${r}:${t.toString().padStart(2,"0")}`}function Et({node:e,validationFeedback:r,readOnly:t=!1,mediaHandler:n}){let o=xe(),a=se(),{id:s,attrs:i}=e,{mode:c,placeholder:l,allowFormatting:d,wordLimit:m,characterLimit:p,allowedTypes:g,allowMultiple:u,fileInstructions:h,maxDuration:v,hint:R}=i,w=t||(r?.showFeedback??!1),C=r?.state,y=Ce(null),S=Ot(b=>{y.current&&clearTimeout(y.current),y.current=setTimeout(()=>{let T=b.files?.map(f=>({url:f.url,mimeType:f.kind==="videoLink"?"video/x-link":f.mimeType,name:f.kind==="videoLink"?void 0:f.name,duration:f.kind==="videoLink"?void 0:f.duration}));o.emit({type:"answer:changed",answer:{nodeId:s,type:"openResponse",timestamp:Date.now(),answer:{...b,files:T}}})},300)},[s,o]);Ee(()=>{S({})},[]);let[k,_]=Ae([]);Ee(()=>{(c==="file"||c==="text+file")&&c==="file"&&S({files:k})},[k,c]),Ee(()=>{let b=()=>{_([])};return o.on("answers:reset",b),()=>o.off("answers:reset",b)},[o]),Ee(()=>{let b=T=>{let q=(T.answers??[]).find(A=>A.nodeId===s&&A.type==="openResponse");q&&(y.current&&(clearTimeout(y.current),y.current=null),q.answer?.files&&_(q.answer.files))};return o.on("answers:prefill",b),()=>o.off("answers:prefill",b)},[s,o]);let P=r?.showFeedback,F=rr(!P&&"player-or-field--pre",P&&C==="correct"&&"player-or-field--correct",P&&C==="partial"&&"player-or-field--partial",P&&C==="incorrect"&&"player-or-field--incorrect",P&&C==="awaiting_review"&&"player-or-field--review");return X("div",{className:"my-3 space-y-2",children:[!w&&R&&R.length>0&&M("div",{className:"flex justify-end",children:M(cr,{hint:R})}),c==="text"&&M(Ra,{nodeId:s,placeholder:l,allowFormatting:d,wordLimit:m,characterLimit:p,isDisabled:w,feedbackBorderClass:F,emitAnswer:b=>S({text:b}),answerBus:o}),c==="file"&&M(Dn,{allowedTypes:g??["image"],allowMultiple:!!u,fileInstructions:h,isDisabled:w,feedbackBorderClass:F,files:k,setFiles:_,mediaHandler:n,t:a}),(c==="audio"||c==="video"||c==="screen")&&M(Ec,{nodeId:s,answerBus:o,kind:c,maxDuration:v,isDisabled:w,feedbackBorderClass:F,mediaHandler:n,emitAnswer:b=>S({recording:b}),t:a}),c==="text+file"&&M(Rc,{nodeId:s,placeholder:l,allowFormatting:d,wordLimit:m,characterLimit:p,allowedTypes:g??["image"],allowMultiple:!!u,fileInstructions:h,isDisabled:w,feedbackBorderClass:F,files:k,setFiles:_,emitAnswer:S,answerBus:o,mediaHandler:n,t:a}),r?.showFeedback&&C==="awaiting_review"&&X("div",{className:"flex items-center gap-2 text-sm border rounded px-3 py-2",style:{color:"var(--almost-ink, #8a5a08)",background:"var(--almost-soft, #fbf1dc)",borderColor:"var(--almost, #c8810e)"},children:[M(dc,{size:15,style:fe(15),className:"animate-pulse"}),M("span",{children:a.openResponseAwaitingReview})]}),r?.showFeedback&&C!=="awaiting_review"&&r.teacherFeedback&&M(Pc,{feedback:r.teacherFeedback,feedbackState:C,score:r.score,t:a})]})}function Ra({nodeId:e,placeholder:r,allowFormatting:t,wordLimit:n,characterLimit:o,isDisabled:a,feedbackBorderClass:s,emitAnswer:i,answerBus:c}){let l=se(),[d,m]=Ae(""),[p,g]=Ae(0),[u,h]=Ae(0),v=Ce(null),R=Ot(()=>{let L=v.current;L&&(L.style.height="auto",L.style.height=`${L.scrollHeight}px`)},[]),w=oc({extensions:[sc.configure({heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1})],immediatelyRender:!1,editable:!a,content:"",onUpdate({editor:L}){if(a)return;let B=L.getJSON().content??[],V=gc(B),K=bc(B);g(V),h(K),i({content:B,wordCount:V})}});Ee(()=>{w&&w.setEditable(!a)},[a,w]);let C=Ce(null);Ee(()=>{w&&C.current!==null&&(w.commands.setContent({type:"doc",content:C.current}),C.current=null)},[w]),Ee(()=>{let L=G=>{let B=(G.answers??[]).find(K=>K.nodeId===e&&K.type==="openResponse");if(!B?.answer?.text)return;let V=B.answer.text.content??[];if(t)w?w.commands.setContent({type:"doc",content:V}):C.current=V;else{let K=V.flatMap(le=>le.content?.map(ye=>ye.text??"")??[le.text??""]).join(`
2
+ `);m(K),setTimeout(R,0)}};return c.on("answers:prefill",L),()=>c.off("answers:prefill",L)},[e,c,t,w]),Ee(()=>{let L=()=>{t&&w?w.commands.clearContent():(m(""),setTimeout(R,0)),g(0),h(0)};return c.on("answers:reset",L),()=>c.off("answers:reset",L)},[c,t,w,R]);let y=!!n,S=!!o&&!n,k=y?p:u,_=y?n?.max:o?.max,P=y?n?.min:o?.min,F=_!=null&&k>_,b=_!=null&&k>=_*.8&&!F,T=P!=null&&k<P&&k>0,f="text-xs tabular-nums",q=F?{color:"var(--pen, #d23b2b)",fontWeight:500}:b||T?{color:"var(--almost, #c8810e)"}:{color:"var(--ink-faint, #8d93a0)"},A=y?_?`${p} / ${_} ${l.openResponseWords}`:P?`${p} ${l.openResponseWords} (min. ${P})`:`${p} ${l.openResponseWords}`:S?_?`${u} / ${_} ${l.openResponseChars}`:`${u} ${l.openResponseChars}`:null;return t?X("div",{className:"relative",children:[X("div",{className:rr("rounded border transition-colors min-h-[120px]",s),children:[!a&&X("div",{className:"sticky top-0 z-10 flex gap-1 px-2 pt-1.5 pb-1 border-b border-gray-100 bg-white rounded-t",children:[[{label:"B",cmd:"toggleBold",style:"font-bold"},{label:"I",cmd:"toggleItalic",style:"italic"}].map(({label:L,cmd:G,style:B})=>M("button",{type:"button",onMouseDown:V=>{V.preventDefault(),w?.chain().focus()?.[G]().run()},className:`text-xs px-1.5 py-0.5 rounded hover:bg-gray-100 ${B}`,children:L},L)),M("button",{type:"button",onMouseDown:L=>{L.preventDefault(),w?.chain().focus().toggleBulletList().run()},className:"text-xs px-1.5 py-0.5 rounded hover:bg-gray-100",children:"\u2022\u2014"})]}),M(ac,{editor:w,className:"prose prose-sm max-w-none p-3 outline-none [&_.ProseMirror]:min-h-[80px] [&_.ProseMirror]:outline-none"})]}),A&&M("div",{className:rr("absolute bottom-2 right-3",f),style:q,children:A})]}):X("div",{className:"relative",children:[M("textarea",{ref:v,value:d,onChange:L=>{if(a)return;let G=L.target.value;m(G);let B=wa(G),V=ka(G);g(B),h(V),R(),i({content:[{type:"paragraph",content:[{type:"text",text:G}]}],wordCount:B})},onInput:R,disabled:a,placeholder:r||l.openResponseTextPlaceholder,rows:4,style:{resize:"none",overflow:"hidden"},className:rr("w-full px-3 py-2 text-base min-h-[100px] rounded border transition-colors outline-none",s,a&&"cursor-default")}),A&&M("div",{className:rr("absolute bottom-2 right-3",f),children:A})]})}var vc={image:"image/*",pdf:"application/pdf",audio:"audio/*",video:"video/*"},wc={image:M(pc,{size:12,style:fe(12)}),pdf:M(va,{size:12,style:fe(12)}),audio:M(uc,{size:12,style:fe(12)}),video:M(xa,{size:12,style:fe(12)}),videoLink:M(mc,{size:12,style:fe(12)})};function Dn({allowedTypes:e,allowMultiple:r,fileInstructions:t,isDisabled:n,files:o,setFiles:a,mediaHandler:s,t:i,compact:c=!1}){let l=Ce(null),[d,m]=Ae(!1),[p,g]=Ae(!1),[u,h]=Ae(""),v=e.some(b=>b!=="videoLink"),R=e.includes("videoLink"),w=r||o.length===0,C=e.filter(b=>b!=="videoLink").map(b=>vc[b]).filter(Boolean).join(","),y=Ot(b=>{a(T=>r?[...T,b]:[b])},[r,a]),S=Ot(b=>{a(T=>T.filter((f,q)=>q!==b))},[a]),k=async b=>{if(!(!w||n)){m(!0);try{let T=b.type.startsWith("image/")?"image":b.type==="application/pdf"?"document":b.type.startsWith("audio/")?"audio":b.type.startsWith("video/")?"video":"file";if(s){let f=await s.upload(b,T);y({kind:"file",url:f.url,mimeType:f.mimeType??b.type,name:b.name})}else{let f=URL.createObjectURL(b);y({kind:"file",url:f,mimeType:b.type,name:b.name})}}finally{m(!1)}}},_=async b=>{if(b.preventDefault(),g(!1),n||!w)return;let T=b.dataTransfer.files?.[0];T&&await k(T)},P=()=>{let b=u.trim();b&&(y({kind:"videoLink",url:b,platform:yc(b)}),h(""))},F={image:i.openResponseTypeImage,pdf:i.openResponseTypePdf,audio:i.openResponseTypeAudio,video:i.openResponseTypeVideo,videoLink:i.openResponseTypeVideoLink};return X("div",{className:"space-y-2",children:[t&&!c&&M("p",{className:"text-sm text-gray-600 italic",children:t}),o.length>0&&M("div",{className:c?"flex flex-wrap gap-1.5":"space-y-2",children:o.map((b,T)=>M(kc,{file:b,onRemove:n?void 0:()=>S(T),compact:c,t:i},T))}),!n&&w&&X("div",{className:"space-y-2",children:[v&&!c&&X("div",{onDragOver:b=>{b.preventDefault(),g(!0)},onDragLeave:()=>g(!1),onDrop:_,className:"border-2 border-dashed rounded-lg p-6 text-center transition-colors cursor-pointer",style:{borderColor:p?"var(--ink-faint, #8d93a0)":"var(--line-strong, #d6d3cc)",background:p?"var(--ui-muted, #f5f4f1)":"transparent"},onClick:()=>l.current?.click(),children:[M(ic,{size:26,className:"mx-auto mb-2",style:{...fe(26),color:"var(--ink-soft, #565b66)"}}),M("p",{className:"text-sm font-medium",style:{color:"var(--ink-soft, #565b66)"},children:i.openResponseDropZoneLabel}),M("p",{className:"text-xs hover:underline mt-0.5",style:{color:"var(--ink, #1d2025)"},children:i.openResponseDropZoneBrowse}),d&&M("p",{className:"text-xs mt-1 animate-pulse",style:{color:"var(--ink-faint, #8d93a0)"},children:i.openResponseUploading}),M("div",{className:"flex flex-wrap justify-center gap-1.5 mt-3",children:e.filter(b=>b!=="videoLink").map(b=>X("span",{className:"inline-flex items-center gap-1 text-[10px] px-2 py-0.5 bg-gray-100 text-gray-600 rounded-full",children:[wc[b]," ",F[b]]},b))})]}),v&&c&&M("button",{type:"button",onClick:()=>l.current?.click(),disabled:d,className:"text-xs px-3 py-1.5 rounded border border-dashed disabled:opacity-50",style:{borderColor:"var(--line-strong, #d6d3cc)",color:"var(--ink-soft, #565b66)"},children:d?i.openResponseUploading:`+ ${i.openResponseAttachFile}`}),M("input",{ref:l,type:"file",accept:C,onChange:async b=>{let T=b.target.files?.[0];T&&(await k(T),b.target.value="")},className:"hidden"}),R&&X("div",{className:"flex gap-2 flex-wrap",children:[M("input",{type:"url",value:u,onChange:b=>h(b.target.value),placeholder:i.openResponseVideoLinkPlaceholder,className:"flex-1 text-sm border rounded px-2 py-1.5 outline-none",style:{borderColor:"var(--line-strong, #d6d3cc)"},onKeyDown:b=>{b.key==="Enter"&&(b.preventDefault(),P())}}),M("button",{type:"button",onClick:P,disabled:!u.trim(),className:"text-sm px-3 py-1.5 rounded text-white disabled:opacity-50",style:{background:"var(--ink, #1d2025)"},children:i.openResponseAddVideoLink})]})]}),n&&o.length===0&&M("p",{className:"text-sm text-gray-400 text-center py-3",children:i.openResponseNoSubmission})]})}function kc({file:e,onRemove:r,compact:t,t:n}){if(e.kind==="videoLink"){let o=e.platform==="youtube"?xc(e.url):null;return X("div",{className:rr("bg-white rounded border border-gray-200",t?"px-2 py-1 flex items-center gap-1.5":"p-3 space-y-1"),children:[o&&!t&&M("iframe",{src:`https://www.youtube.com/embed/${o}`,width:240,height:135,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,className:"rounded w-full"}),M("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-blue-600 underline truncate block max-w-[200px]",children:e.url}),r&&M("button",{type:"button",onClick:r,className:"ml-auto text-gray-400 hover:text-rose-500 text-xs",children:"\u2715"})]})}return X("div",{className:rr("bg-white rounded border border-gray-200",t?"px-2 py-1 flex items-center gap-1.5":"p-2 flex items-center gap-2"),children:[e.mimeType?.startsWith("image/")?M("img",{src:e.url,alt:e.name??"upload",className:t?"h-6 w-6 object-cover rounded":"h-16 w-16 object-cover rounded"}):e.mimeType?.startsWith("audio/")?t?null:M("span",{className:"flex-1 min-w-0",children:M(Qe,{src:e.url,durationHint:e.duration})}):e.mimeType?.startsWith("video/")?M("video",{src:e.url,controls:!0,className:t?"hidden":"h-16 max-w-[240px] rounded"}):M(va,{size:20,style:{...fe(20),color:"var(--ink-soft, #565b66)"}}),X("div",{className:"flex-1 min-w-0",children:[M("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-gray-700 truncate block hover:underline",children:e.name??n.openResponseFile}),t&&e.mimeType?.startsWith("audio/")&&M(Qe,{src:e.url,durationHint:e.duration})]}),r&&M("button",{type:"button",onClick:r,className:"ml-auto text-gray-400 hover:text-rose-500 text-xs shrink-0",children:"\u2715"})]})}function Rc({nodeId:e,placeholder:r,allowFormatting:t,wordLimit:n,characterLimit:o,allowedTypes:a,allowMultiple:s,fileInstructions:i,isDisabled:c,feedbackBorderClass:l,files:d,setFiles:m,emitAnswer:p,answerBus:g,mediaHandler:u,t:h}){let[v,R]=Ae(null),[w,C]=Ae(!1);return Ee(()=>{p({...v&&{text:v},files:d.length>0?d:void 0})},[v,d]),X("div",{className:"space-y-2",children:[M(Ra,{nodeId:e,placeholder:r,allowFormatting:t,wordLimit:n,characterLimit:o,isDisabled:c,feedbackBorderClass:l,emitAnswer:y=>R(y),answerBus:g}),!c&&X("div",{children:[X("button",{type:"button",onClick:()=>C(!w),className:"flex items-center gap-1.5 text-xs",style:{color:"var(--ink-soft, #565b66)"},children:[M("span",{children:w?"\u25BE":"\u25B8"}),X("span",{children:[h.openResponseAttachFiles,d.length>0&&M("span",{className:"ml-1 rounded-full px-1.5 py-0.5 text-[10px]",style:{background:"var(--ui-muted, #f5f4f1)",color:"var(--ink, #1d2025)"},children:d.length})]})]}),w&&M("div",{className:"mt-1.5",children:M(Dn,{allowedTypes:a,allowMultiple:s,fileInstructions:i,isDisabled:c,feedbackBorderClass:l,files:d,setFiles:m,mediaHandler:u,t:h,compact:!0})})]}),c&&d.length>0&&X("div",{className:"space-y-1",children:[M("p",{className:"text-xs text-gray-500 font-medium",children:h.openResponseAttachedFiles}),M(Dn,{allowedTypes:a,allowMultiple:s,isDisabled:!0,feedbackBorderClass:l,files:d,setFiles:m,t:h,compact:!0})]})]})}var Sc=180,Cc={audio:["audio/webm;codecs=opus","audio/webm","audio/mp4;codecs=mp4a.40.2","audio/mp4","audio/aac","audio/ogg;codecs=opus"],video:["video/webm;codecs=vp9,opus","video/webm;codecs=vp8,opus","video/webm","video/mp4"]};function _c(e){if(!(typeof MediaRecorder>"u"||typeof MediaRecorder.isTypeSupported!="function"))return Cc[e].find(r=>MediaRecorder.isTypeSupported(r))}function Nc(e,r){let t=e.split(";")[0].trim().toLowerCase();return t.endsWith("/webm")?"webm":t.endsWith("/ogg")?"ogg":t.endsWith("/aac")?"aac":t.endsWith("/mp4")?r==="audio"?"m4a":"mp4":"webm"}function Ac(e){return e instanceof DOMException?e.name==="AbortError":e?.name==="AbortError"}function Ec({nodeId:e,kind:r,maxDuration:t,isDisabled:n,feedbackBorderClass:o,mediaHandler:a,emitAnswer:s,answerBus:i,t:c}){let l=r==="audio"?"audio":"video",d=t&&t>0?t:r==="audio"?Sc:null,[m,p]=Ae("idle"),[g,u]=Ae(null),[h,v]=Ae(null),[R,w]=Ae(0),[C,y]=Ae(null),[S,k]=Ae(null),_=Ce(null),P=Ce(null),F=Ce([]),b=Ce(0),T=Ce(null),f=Ce(null),q=Ce(null),A=Ce(null),L=Ce(0),G=Ce(null),B=Ce(null),V=Ce(null);Ee(()=>{let U=me=>{let te=(me.answers??[]).find(ce=>ce.nodeId===e&&ce.type==="openResponse")?.answer?.recording;te?.url&&(u(te),p("saved"))},Y=()=>{G.current?.abort(),u(null),v(null),k(null),p("idle")};return i.on("answers:prefill",U),i.on("answers:reset",Y),()=>{i.off("answers:prefill",U),i.off("answers:reset",Y)}},[e,i]);let K=()=>{cancelAnimationFrame(L.current);let U=A.current;A.current=null,U&&U.state!=="closed"&&U.close().catch(()=>{})},le=()=>{P.current?.getTracks().forEach(U=>U.stop()),P.current=null};Ee(()=>()=>{T.current&&clearInterval(T.current),K(),le(),G.current?.abort()},[]),Ee(()=>{let U=h?.url;return()=>{U&&URL.revokeObjectURL(U)}},[h?.url]);let ye=U=>{let Y=q.current,me=window.AudioContext||window.webkitAudioContext;if(!Y||!me)return;let ee;try{ee=new me}catch{return}A.current=ee;let te=ee.createAnalyser();te.fftSize=512,ee.createMediaStreamSource(U).connect(te);let ce=new Uint8Array(te.fftSize),ze=window.devicePixelRatio||1,Te=Math.max(1,Y.clientWidth),D=Math.max(1,Y.clientHeight);Y.width=Math.round(Te*ze),Y.height=Math.round(D*ze);let J=Y.getContext("2d");if(!J)return;J.scale(ze,ze);let Z=3,pe=2,H=[],ct=Math.floor(Te/(Z+pe)),qr=0,Wr=ur=>{if(L.current=requestAnimationFrame(Wr),ur-qr<50)return;qr=ur,te.getByteTimeDomainData(ce);let _r=0;for(let sr=0;sr<ce.length;sr++){let Nr=(ce[sr]-128)/128;_r+=Nr*Nr}H.push(Math.min(1,Math.sqrt(_r/ce.length)*3)),H.length>ct&&H.shift(),J.clearRect(0,0,Te,D),J.fillStyle="#1d2025";let lt=Te-H.length*(Z+pe);H.forEach((sr,Nr)=>{let Ur=Math.max(2,sr*D);J.fillRect(lt+Nr*(Z+pe),(D-Ur)/2,Z,Ur)})};L.current=requestAnimationFrame(Wr)};Ee(()=>{m==="recording"&&r==="audio"&&P.current&&ye(P.current)},[m]);let E=async(U,Y)=>{if(!a)return;let me=new AbortController;G.current=me,B.current={file:U,duration:Y},k(null),y(0),p("uploading");try{let ee=await a.upload(U,l,{onProgress:ce=>{me.signal.aborted||y(Math.max(0,Math.min(1,ce)))},signal:me.signal});if(me.signal.aborted)return;let te={url:ee.url,mimeType:ee.mimeType??U.type,duration:Y,kind:l};B.current=null,u(te),p("saved"),s(te)}catch(ee){if(me.signal.aborted||Ac(ee))return;p("failed"),k(c.recorderFailed)}finally{y(null)}},x=()=>{G.current?.abort(),B.current=null,v(null),y(null),p(V.current?"saved":"idle")},j=()=>{let U=B.current;U&&E(U.file,U.duration)},O=()=>{T.current&&(clearInterval(T.current),T.current=null);let U=_.current;U&&U.state!=="inactive"&&U.stop()},z=async()=>{if(!a){k(c.recorderUnavailableHere);return}if(!(typeof MediaRecorder<"u"&&typeof navigator<"u"&&!!navigator.mediaDevices?.getUserMedia&&(r!=="screen"||!!navigator.mediaDevices.getDisplayMedia))){k(c.recorderUnsupported);return}G.current?.abort(),V.current=g,k(null),p("requesting");let Y;try{if(r==="screen"){Y=await navigator.mediaDevices.getDisplayMedia({video:!0,audio:!1});try{let ce=(await navigator.mediaDevices.getUserMedia({audio:!0})).getAudioTracks()[0];ce&&Y.addTrack(ce)}catch{}Y.getVideoTracks()[0]?.addEventListener("ended",()=>O())}else r==="video"?Y=await navigator.mediaDevices.getUserMedia({audio:!0,video:{facingMode:"user"}}):Y=await navigator.mediaDevices.getUserMedia({audio:!0})}catch(te){let ce=te?.name;p(g?"saved":"idle"),k(ce==="NotAllowedError"||ce==="SecurityError"||ce==="NotFoundError"?c.openResponsePermissionDenied:c.recorderUnsupported);return}let me=_c(l),ee;try{ee=me?new MediaRecorder(Y,{mimeType:me}):new MediaRecorder(Y)}catch{try{ee=new MediaRecorder(Y)}catch{Y.getTracks().forEach(te=>te.stop()),p(g?"saved":"idle"),k(c.recorderUnsupported);return}}P.current=Y,_.current=ee,F.current=[],ee.ondataavailable=te=>{te.data.size>0&&F.current.push(te.data)},ee.onstop=()=>{let te=Math.max(1,Math.round((performance.now()-b.current)/1e3)),ce=ee.mimeType||me||`${l}/webm`,ze=new Blob(F.current,{type:ce});if(F.current=[],K(),le(),f.current&&(f.current.srcObject=null),ze.size===0){p(V.current?"saved":"idle"),k(c.recorderUnsupported);return}let Te=new File([ze],`recording.${Nc(ce,l)}`,{type:ce});v({url:URL.createObjectURL(ze),duration:te}),E(Te,te)},ee.start(250),b.current=performance.now(),w(0),p("recording"),T.current=setInterval(()=>{let te=(performance.now()-b.current)/1e3;w(te),d&&te>=d&&O()},200)};Ee(()=>{let U=f.current;m==="recording"&&U&&P.current&&(U.srcObject=P.current,U.play().catch(()=>{}))},[m]);let ae=h?.url??g?.url??null,re=h?.duration??g?.duration??null,ie=ae?l==="audio"?M(Qe,{src:ae,durationHint:re}):M("video",{src:ae,controls:!0,playsInline:!0,preload:"metadata"}):null;if(n)return M("div",{className:rr("edp-rec",o),children:g?l==="audio"?M(Qe,{src:g.url,durationHint:g.duration}):M("video",{src:g.url,controls:!0,playsInline:!0,preload:"metadata"}):M("p",{className:"edp-rec-message",children:c.recorderNone})});let de=r==="audio"?M(cc,{"aria-hidden":!0}):r==="screen"?M(lc,{"aria-hidden":!0}):M(xa,{"aria-hidden":!0});return X("div",{className:rr("edp-rec",o),children:[(m==="idle"||m==="requesting")&&X("div",{className:"edp-rec-idle",children:[M("button",{type:"button",className:"edp-rec-record",onClick:z,disabled:m==="requesting"||!a,"aria-label":r==="screen"?c.openResponseTapToRecordScreen:c.recorderRecord,children:de}),M("span",{className:"edp-rec-label",children:m==="requesting"?c.openResponseRequestingPermission:c.recorderRecord}),d&&M("span",{className:"edp-rec-limit",children:c.recorderUpTo(zn(d))}),!a&&M("p",{className:"edp-rec-message",children:c.recorderUnavailableHere})]}),m==="recording"&&X(et,{children:[l==="video"&&M("video",{ref:f,muted:!0,playsInline:!0}),X("div",{className:"edp-rec-live",role:"status","aria-label":c.recorderRecordingAria,children:[r==="audio"?M("canvas",{ref:q,className:"edp-rec-level","aria-hidden":!0}):M("span",{style:{flex:1}}),X("span",{className:"edp-rec-clock",dir:"ltr",children:[M("span",{className:"edp-rec-dot","aria-hidden":!0}),zn(Math.floor(R)),d&&X("small",{children:["/ ",zn(d)]})]}),X("button",{type:"button",className:"edp-rec-stop",onClick:O,children:[M("i",{"aria-hidden":!0}),c.openResponseStopRecording]})]})]}),(m==="uploading"||m==="saved"||m==="failed")&&X(et,{children:[ie,X("div",{className:"edp-rec-foot",children:[m==="uploading"&&X(et,{children:[M("span",{className:"edp-rec-status","aria-live":"polite",children:C&&C>0?c.recorderSaving(Math.round(C*100)):c.openResponseUploading}),M("span",{className:"edp-rec-progress","aria-hidden":!0,children:M("span",{style:{width:`${Math.round((C??0)*100)}%`}})}),M("button",{type:"button",className:"edp-rec-link",onClick:x,children:c.recorderCancel})]}),m==="saved"&&X(et,{children:[X("span",{className:"edp-rec-status edp-rec-status--ok","aria-live":"polite",children:[M(fc,{size:16,"aria-hidden":!0}),c.recorderSaved]}),M("button",{type:"button",className:"edp-rec-link",onClick:z,children:c.recorderRecordAgain})]}),m==="failed"&&X(et,{children:[X("span",{className:"edp-rec-status edp-rec-status--error",role:"alert",children:[M(hc,{size:16,"aria-hidden":!0}),S??c.recorderFailed]}),X("span",{style:{display:"inline-flex",gap:"1rem"},children:[M("button",{type:"button",className:"edp-rec-link",onClick:j,children:c.recorderRetry}),M("button",{type:"button",className:"edp-rec-link",onClick:z,children:c.recorderRecordAgain})]})]})]})]}),S&&m!=="failed"&&M("p",{className:"edp-rec-message",role:"alert",children:S})]})}function Pc({feedback:e,feedbackState:r,score:t,t:n}){let o=r==="correct"?{bg:"var(--ok-soft, #ecf8f0)",border:"var(--ok, #1f8a4c)",ink:"var(--ok, #1f8a4c)"}:r==="incorrect"?{bg:"var(--pen-soft, #fdeeec)",border:"var(--pen, #d23b2b)",ink:"var(--pen, #d23b2b)"}:{bg:"var(--almost-soft, #fbf1dc)",border:"var(--almost, #c8810e)",ink:"var(--almost-ink, #8a5a08)"};return X("div",{className:"rounded p-3 text-sm border",style:{background:o.bg,borderColor:o.border,color:"var(--ink, #1d2025)"},children:[M("p",{className:"text-xs font-medium mb-1 opacity-70",children:n.openResponseTeacherFeedbackLabel}),e.flatMap(a=>a.content?.map(s=>s.text??"")??[a.text??""]).join(" "),t!=null&&X("div",{className:"mt-1 text-right",style:{fontFamily:'var(--font-hand, "Caveat", cursive)',fontSize:I("1.4rem"),lineHeight:1,color:o.ink},children:[t," pts"]})]})}import{jsx as Rr,jsxs as tr,Fragment as Sa}from"react/jsx-runtime";import{useEffect as Fn,useMemo as Tc,useRef as Mc,useState as Ca}from"react";function Lc(e){return e?.showFeedback?e.state==="validating"?"validating":e.state==="correct"?"correct":e.state==="incorrect"?"incorrect":"idle":"idle"}function Pt({nodeId:e,placeholder:r,hint:t,validationFeedback:n,readOnly:o=!1}){let a=se(),s=xe(),i=Mc(null),[c,l]=Ca(""),[d,m]=Ca(!1),p=Lc(n),g=n?.score,u=n?.maxScore,h=y=>Number.isInteger(y)?String(y):y.toFixed(2),v=n?.displayAnswer,R=Tc(()=>v?gr(v,!1):"",[v]);Fn(()=>{import("mathlive").then(()=>{m(!0)}).catch(()=>{})},[]),Fn(()=>{let y=S=>{let k=S.answers?.find(_=>_.nodeId===e&&_.type==="mathResponse");k?.answer?.latex!==void 0&&(l(k.answer.latex),i.current&&(i.current.value=k.answer.latex))};return s.on("answers:prefill",y),()=>s.off("answers:prefill",y)},[s,e]),Fn(()=>{s.emit({type:"answer:changed",answer:{nodeId:e,type:"mathResponse",timestamp:Date.now(),answer:{latex:c}}})},[c,e,s]);let w=y=>{let S=y.target?.value??"";l(S)},C=p==="correct"?"player-math-field--correct":p==="incorrect"?"player-math-field--incorrect":p==="validating"?"player-math-field--validating":"";return tr("div",{dir:"ltr",className:"math-response-player",children:[tr("span",{style:{display:"inline-flex",alignItems:"center",gap:I("0.4rem")},children:[Rr("div",{className:"player-math-field"+(C?" "+C:"")+(o?" player-math-field--readonly":""),children:d?Rr("math-field",{ref:i,value:c,onInput:w,"virtual-keyboard-mode":"onfocus","smart-fence":"true",className:"player-math-field__input",style:{opacity:o?.7:1,pointerEvents:o?"none":"auto"}}):Rr("input",{type:"text",value:c,onChange:y=>l(y.target.value),placeholder:r||"Enter LaTeX (e.g. \\frac{x^2}{2})",readOnly:o,className:"player-math-field__fallback"})}),Rr(Ye,{hint:t})]}),n?.showFeedback&&tr("div",{className:"player-math-feedback player-math-feedback--"+p,children:[p==="validating"&&tr(Sa,{children:[Rr("span",{className:"player-math-spinner"}),Rr("span",{children:a.mathChecking})]}),p==="correct"&&tr(Sa,{children:[tr("span",{children:["\u2713 ",a.mathCorrect]}),g!=null&&tr("span",{className:"player-math-score",children:[h(g),u!=null?` / ${h(u)}`:""]})]}),p==="incorrect"&&tr("span",{children:["\u2717 ",a.mathIncorrect]}),p==="incorrect"&&R&&tr("span",{className:"player-blank-reveal player-math-reveal",children:["(",Rr("span",{dangerouslySetInnerHTML:{__html:R}}),")"]})]})]})}import{jsx as oe,jsxs as we,Fragment as nt}from"react/jsx-runtime";import{useCallback as Kc,useEffect as Xc,useRef as Jc,useState as tt}from"react";import{Play as Zc,Lock as el,Check as jn,X as Aa}from"lucide-react";function qt(e,r){if(e===r)return!0;if(e===null||r===null||typeof e!=typeof r||typeof e!="object")return!1;let t=Array.isArray(e),n=Array.isArray(r);if(t!==n)return!1;if(t&&n){let c=e,l=r;return c.length!==l.length?!1:c.every((d,m)=>qt(d,l[m]))}let o=e,a=r,s=Object.keys(o),i=Object.keys(a);return s.length!==i.length?!1:s.every(c=>qt(o[c],a[c]))}var Ic=`
3
3
  "use strict";
4
4
 
5
5
  // Capture console output for stdio mode
@@ -36,17 +36,17 @@ self.onmessage = async function(e) {
36
36
  self.postMessage({ testId, passed: false, stderr: String(err), errored: true, durationMs: Date.now() - start });
37
37
  }
38
38
  };
39
- `;async function Ii(e,r,t,n,a,s,o,i,c){return new Promise(l=>{let d=new Blob([Li],{type:"text/javascript"}),p=URL.createObjectURL(d),m=new Worker(p),g=setTimeout(()=>{m.terminate(),URL.revokeObjectURL(p),l({testId:n,passed:!1,stderr:`Execution timed out after ${c}ms`,errored:!0})},c);m.onmessage=u=>{clearTimeout(g),m.terminate(),URL.revokeObjectURL(p);let b=u.data;if(r==="function"&&!b.errored){let v=ut(b.actual,s);l({testId:n,passed:v,actual:b.actual,stderr:b.stderr,durationMs:b.durationMs})}else l({testId:n,passed:b.passed??!1,actualStdout:b.actualStdout,stderr:b.stderr,durationMs:b.durationMs,errored:b.errored})},m.onerror=u=>{clearTimeout(g),m.terminate(),URL.revokeObjectURL(p),l({testId:n,passed:!1,stderr:u.message,errored:!0})},m.postMessage({testId:n,source:e,mode:r,entryFunction:t,args:a,expectedStdout:i,timeout:c})})}var Mi="0.27.7";function $i(){let e=globalThis.EDPIRE_PYODIDE_INDEX_URL;return typeof e=="string"&&e?e.endsWith("/")?e:e+"/":`https://cdn.jsdelivr.net/pyodide/v${globalThis.EDPIRE_PYODIDE_VERSION||Mi}/full/`}var Nr=null;function zi(e){return typeof globalThis.loadPyodide=="function"?Promise.resolve():Nr||(Nr=new Promise((r,t)=>{if(typeof document>"u"){t(new Error("Pyodide can only be loaded in a browser environment"));return}let n=document.createElement("script");n.src=`${e}pyodide.js`,n.async=!0,n.onload=()=>r(),n.onerror=()=>{Nr=null,t(new Error(`Failed to load Pyodide from ${n.src}`))},document.head.appendChild(n)}),Nr)}var pt=null;async function Di(){if(pt)return pt;let e=$i();await zi(e);let r=globalThis.loadPyodide;if(typeof r!="function")throw new Error("Pyodide global not available after loading the CDN script");return pt=await r({indexURL:e}),pt}async function Oi(e,r,t,n,a,s,o,i,c){let l=Date.now();try{let d=await Di();if(r==="stdio"){d.runPython(`
39
+ `;async function $c(e,r,t,n,o,a,s,i,c){return new Promise(l=>{let d=new Blob([Ic],{type:"text/javascript"}),m=URL.createObjectURL(d),p=new Worker(m),g=setTimeout(()=>{p.terminate(),URL.revokeObjectURL(m),l({testId:n,passed:!1,stderr:`Execution timed out after ${c}ms`,errored:!0})},c);p.onmessage=u=>{clearTimeout(g),p.terminate(),URL.revokeObjectURL(m);let h=u.data;if(r==="function"&&!h.errored){let v=qt(h.actual,a);l({testId:n,passed:v,actual:h.actual,stderr:h.stderr,durationMs:h.durationMs})}else l({testId:n,passed:h.passed??!1,actualStdout:h.actualStdout,stderr:h.stderr,durationMs:h.durationMs,errored:h.errored})},p.onerror=u=>{clearTimeout(g),p.terminate(),URL.revokeObjectURL(m),l({testId:n,passed:!1,stderr:u.message,errored:!0})},p.postMessage({testId:n,source:e,mode:r,entryFunction:t,args:o,expectedStdout:i,timeout:c})})}var zc="0.27.7";function Dc(){let e=globalThis.EDPIRE_PYODIDE_INDEX_URL;return typeof e=="string"&&e?e.endsWith("/")?e:e+"/":`https://cdn.jsdelivr.net/pyodide/v${globalThis.EDPIRE_PYODIDE_VERSION||zc}/full/`}var rt=null;function Fc(e){return typeof globalThis.loadPyodide=="function"?Promise.resolve():rt||(rt=new Promise((r,t)=>{if(typeof document>"u"){t(new Error("Pyodide can only be loaded in a browser environment"));return}let n=document.createElement("script");n.src=`${e}pyodide.js`,n.async=!0,n.onload=()=>r(),n.onerror=()=>{rt=null,t(new Error(`Failed to load Pyodide from ${n.src}`))},document.head.appendChild(n)}),rt)}var jt=null;async function Oc(){if(jt)return jt;let e=Dc();await Fc(e);let r=globalThis.loadPyodide;if(typeof r!="function")throw new Error("Pyodide global not available after loading the CDN script");return jt=await r({indexURL:e}),jt}async function jc(e,r,t,n,o,a,s,i,c){let l=Date.now();try{let d=await Oc();if(r==="stdio"){d.runPython(`
40
40
  import sys, io
41
41
  _stdout_capture = io.StringIO()
42
42
  sys.stdout = _stdout_capture
43
- `),o&&d.runPython(`
43
+ `),s&&d.runPython(`
44
44
  import io
45
- sys.stdin = io.StringIO(${JSON.stringify(o)})
46
- `),d.runPython(e);let p=d.runPython("_stdout_capture.getvalue()");d.runPython("sys.stdout = sys.__stdout__");let m=p.trim()===(i||"").trim();return{testId:n,passed:m,actualStdout:p,durationMs:Date.now()-l}}else{d.runPython(e);let p=(a||[]).map(u=>JSON.stringify(u)).join(", "),m=d.runPython(`${t}(${p})`),g=ut(m,s);return{testId:n,passed:g,actual:m,durationMs:Date.now()-l}}}catch(d){return{testId:n,passed:!1,stderr:String(d),errored:!0,durationMs:Date.now()-l}}}var mt=null;async function Fi(){if(mt)return mt;let e=await import("./sql-wasm-browser-NICPVFVD.mjs");return mt=await(e.default??e)(),mt}async function ji(e,r,t,n){let a=Date.now();try{let s=await Fi(),o=new s.Database;t&&o.run(t);let c=o.exec(e).flatMap(d=>d.values.map(p=>p.map(String).join("|"))).join(`
47
- `),l=c.trim()===(n||"").trim();return o.close(),{testId:r,passed:l,actualStdout:c,durationMs:Date.now()-a}}catch(s){return{testId:r,passed:!1,stderr:String(s),errored:!0,durationMs:Date.now()-a}}}async function Bi(e){let{transform:r}=await import("./esm-RQP7AIMT.mjs");return r(e,{transforms:["typescript"]}).code}var fr=class{supports(r){return["javascript","typescript","python","sql"].includes(r)}async run(r){let{language:t,source:n,mode:a,entryFunction:s,tests:o,timeoutMs:i=5e3}=r;if(!this.supports(t))return o.map(d=>({testId:d.id,passed:!1,stderr:`Language "${t}" cannot run in-browser. Configure a RemoteExecutor for compiled languages.`,errored:!0}));let c=n;if(t==="typescript")try{c=await Bi(n)}catch(d){return o.map(p=>({testId:p.id,passed:!1,stderr:`TypeScript compile error: ${d.message}`,errored:!0}))}let l=[];for(let d of o){let p;t==="python"?p=await Oi(c,a,s,d.id,d.args,d.expectedReturn,d.stdin,d.expectedStdout,i):t==="sql"?p=await ji(c,d.id,d.stdin,d.expectedStdout):p=await Ii(c,a,s,d.id,d.args,d.expectedReturn,d.stdin,d.expectedStdout,i),l.push(p)}return l}};import{jsx as Ba}from"react/jsx-runtime";import{forwardRef as Wi,useEffect as qi,useImperativeHandle as Hi,useRef as Ui,useState as Vi}from"react";function Qi(e){return{javascript:"javascript",typescript:"typescript",python:"python",sql:"sql",java:"java",cpp:"cpp",go:"go"}[e]??"plaintext"}var rn=Wi(function({value:r,onChange:t,language:n="javascript",readOnly:a=!1,readOnlyRanges:s,placeholder:o,height:i=300,className:c,autoFocus:l},d){let[p,m]=Vi(null),{scale:g}=ke(),u=Ui(null);qi(()=>{import("./dist-RXTJ74FF.mjs").then(x=>{m(()=>x.default)}).catch(()=>{})},[]),Hi(d,()=>({getValue(){return u.current?.getValue?.()??r},focus(){u.current?.focus?.()},insert(x){let _=u.current;if(!_)return;let h=_.getSelection();_.executeEdits("insert",[{range:h,text:x,forceMoveMarkers:!0}])}}));function b(x){u.current=x,l&&x.focus(),s?.length&&x.onDidAttemptReadOnlyEdit(()=>{})}function v(x){t(x??"")}let w=typeof i=="number"?i*g:i;return p?Ba(p,{className:c,height:w,language:Qi(n),value:r,onChange:v,onMount:b,options:{readOnly:a,minimap:{enabled:!1},fontSize:14*g,lineNumbers:"on",scrollBeyondLastLine:!1,automaticLayout:!0,tabSize:2,wordWrap:"on"}}):Ba("textarea",{className:c,value:r,onChange:x=>t(x.target.value),readOnly:a,placeholder:o,style:{width:"100%",height:typeof i=="number"?E(i):i,fontFamily:"monospace",fontSize:E(14),padding:E("0.5rem"),border:"1px solid #e2e8f0",borderRadius:E("0.375rem"),resize:"vertical",background:a?"#f8fafc":"white",boxSizing:"border-box"},autoFocus:l})});var Zi=new fr;function ec(e){return e?.showFeedback?e.state??"idle":"idle"}function Wa(e){let r={};for(let t of e.attrs.starters??[])r[t.language]=t.code;return r}function rc({sample:e,result:r,mode:t}){let n=r?.passed,a=r?.errored,s=r!==void 0,o=s?a?"var(--almost, #c8810e)":n?"var(--ok, #1f8a4c)":"var(--pen, #d23b2b)":"var(--ink-faint, #8d93a0)",i=s?a?"\u26A0":null:"\u25CB";return de("div",{style:{padding:`${E("0.5rem")} ${E("0.75rem")}`,borderBottom:"1px solid var(--line, #e7e5e0)",fontSize:E("0.8125rem"),fontFamily:"var(--font-mono, ui-monospace, monospace)"},children:[de("div",{style:{display:"flex",alignItems:"center",gap:E("0.5rem")},children:[K("span",{style:{color:o,fontWeight:700,fontSize:E("0.875rem"),display:"inline-flex"},children:i??(n?K(tn,{size:15,style:re(15)}):K(qa,{size:15}))}),K("span",{style:{fontWeight:600,color:"var(--ink, #1d2025)"},children:e.name??`Test ${e.id}`})]}),s&&!n&&de("div",{style:{marginTop:E("0.25rem"),paddingLeft:E("1.5rem")},children:[t==="function"?K(Pr,{children:r?.actual!==void 0&&de("div",{style:{color:"var(--ink-soft, #565b66)"},children:[K("span",{style:{color:"var(--ink-faint, #8d93a0)"},children:"got: "}),K("span",{style:{color:"var(--pen, #d23b2b)"},children:JSON.stringify(r.actual)}),K("span",{style:{color:"var(--ink-faint, #8d93a0)"},children:" expected: "}),K("span",{style:{color:"var(--ok, #1f8a4c)"},children:JSON.stringify(e.expectedReturn)})]})}):K(Pr,{children:r?.actualStdout!==void 0&&de("div",{style:{color:"var(--ink-soft, #565b66)"},children:[de("div",{children:[K("span",{style:{color:"var(--ink-faint, #8d93a0)"},children:"got: "}),K("span",{style:{color:"var(--pen, #d23b2b)",whiteSpace:"pre-wrap"},children:r.actualStdout||"(empty)"})]}),de("div",{children:[K("span",{style:{color:"var(--ink-faint, #8d93a0)"},children:"expected: "}),K("span",{style:{color:"var(--ok, #1f8a4c)",whiteSpace:"pre-wrap"},children:e.expectedStdout||"(empty)"})]})]})}),r?.stderr&&K("div",{style:{color:"var(--almost-ink, #8a5a08)",marginTop:E("0.125rem"),whiteSpace:"pre-wrap"},children:r.stderr})]})]})}function tt({node:e,validationFeedback:r,readOnly:t=!1,executor:n=Zi,gradingTests:a}){let s=le(),o=Ki(null),{attrs:i}=e,c=e.id,[l,d]=Er(i.defaultLanguage),[p,m]=Er(()=>Wa(e)),[g,u]=Er([]),[b,v]=Er(!1),[w,x]=Er(!1),_=p[l]??"",h=ec(r);Yi(()=>{let S=j=>{let z=j.answers?.find(q=>q.nodeId===c&&q.type==="codingResponse");z?.answer&&(z.answer.language&&d(z.answer.language),z.answer.sourceByLanguage&&m(z.answer.sourceByLanguage),z.answer.testResults&&u(z.answer.testResults))},N=()=>{m(Wa(e)),u([]),x(!1)};return s.on("answers:prefill",S),s.on("answers:reset",N),()=>{s.off("answers:prefill",S),s.off("answers:reset",N)}},[s,c,e]);let y=Gi((S,N,j)=>{s.emit({type:"answer:changed",answer:{nodeId:c,type:"codingResponse",timestamp:Date.now(),answer:{language:S,sourceByLanguage:N,source:N[S]??"",testResults:j}}})},[s,c]),C=S=>{let N={...p,[l]:S};m(N),y(l,N,g)},P=S=>{d(S),u([]),y(S,p,[])},$=async()=>{if(b)return;v(!0),u([]);let S=a??i.visibleSamples??[];if(S.length===0){v(!1);return}try{let N=await n.run({language:l,source:_,mode:i.testMode,entryFunction:i.entryFunction,tests:S,timeoutMs:5e3});u(N),y(l,p,N)}catch(N){let j=S.map(z=>({testId:z.id,passed:!1,stderr:String(N),errored:!0}));u(j),y(l,p,j)}finally{v(!1)}},R=()=>{w||(x(!0),y(l,p,g))},f=(a??[]).filter(S=>S.hidden).length,I=f>0?g.filter(S=>(a??[]).find(j=>j.id===S.testId)?.hidden&&S.passed).length:0,A=a?a.filter(S=>!S.hidden):i.visibleSamples??[],H=h==="correct"?"var(--ok, #1f8a4c)":h==="partial"?"var(--almost, #c8810e)":h==="incorrect"?"var(--pen, #d23b2b)":"var(--line-strong, #d6d3cc)";return de("div",{style:{margin:`${E("0.75rem")} 0`,border:`1px solid ${H}`,borderRadius:E("0.875rem"),overflow:"hidden",transition:"border-color 0.2s"},children:[de("div",{style:{background:"var(--ui-muted, #f5f4f1)",borderBottom:"1px solid var(--line, #e7e5e0)",padding:`${E("0.5rem")} ${E("0.75rem")}`,display:"flex",alignItems:"center",gap:E("0.5rem"),flexWrap:"wrap"},children:[K("div",{style:{display:"flex",gap:E("0.25rem")},children:i.languages.map(S=>K("button",{onClick:()=>!t&&P(S),disabled:t,style:{padding:`${E("0.2rem")} ${E("0.6rem")}`,borderRadius:E("0.375rem"),border:"1px solid",borderColor:l===S?"var(--ink, #1d2025)":"var(--line, #e7e5e0)",background:l===S?"var(--ink, #1d2025)":"var(--card, #fff)",color:l===S?"#fff":"var(--ink-soft, #565b66)",fontSize:E("0.75rem"),fontWeight:600,cursor:t?"default":"pointer",fontFamily:"var(--font-mono, ui-monospace, monospace)"},children:S},S))}),K("div",{style:{flex:1}}),K($e,{hint:i.hint}),!t&&de(Pr,{children:[de("button",{onClick:$,disabled:b,style:{padding:`${E("0.25rem")} ${E("0.75rem")}`,borderRadius:E("0.5rem"),border:"1px solid var(--line-strong, #d6d3cc)",background:b?"var(--ui-muted, #f5f4f1)":"var(--card, #fff)",color:"var(--ink, #1d2025)",fontSize:E("0.8125rem"),fontWeight:600,cursor:b?"not-allowed":"pointer",display:"inline-flex",alignItems:"center",gap:E("0.35rem")},children:[K(Xi,{size:13,style:re(13)})," ",b?"Running\u2026":"Run"]}),de("button",{onClick:R,disabled:w,style:{padding:`${E("0.3rem")} ${E("0.85rem")}`,borderRadius:E("0.5rem"),border:"none",background:w?"var(--ok-soft, #ecf8f0)":"var(--ink, #1d2025)",color:w?"var(--ok, #1f8a4c)":"#fff",fontSize:E("0.8125rem"),fontWeight:600,cursor:w?"default":"pointer",display:"inline-flex",alignItems:"center",gap:E("0.35rem")},children:[w&&K(tn,{size:13,style:re(13)})," ",w?"Submitted":"Submit"]})]})]}),K(rn,{ref:o,value:_,onChange:C,language:l,readOnly:t,readOnlyRanges:i.starters.find(S=>S.language===l)?.readOnlyRanges,height:320}),(g.length>0||A.length>0)&&de("div",{style:{borderTop:"1px solid var(--line, #e7e5e0)",background:"var(--paper, #fbfaf7)"},children:[K("div",{style:{padding:`${E("0.5rem")} ${E("0.75rem")}`,fontSize:E("0.7rem"),fontWeight:700,color:"var(--ink-faint, #8d93a0)",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Test Results"}),A.map(S=>K(rc,{sample:S,result:g.find(N=>N.testId===S.id),mode:i.testMode},S.id)),f>0&&de("div",{style:{padding:`${E("0.5rem")} ${E("0.75rem")}`,fontSize:E("0.8125rem"),color:"var(--ink-soft, #565b66)",borderTop:"1px solid var(--line, #e7e5e0)",fontStyle:"italic",display:"flex",alignItems:"center",gap:E("0.4rem")},children:[K(Ji,{size:13,style:re(13)})," Hidden tests: ",I,"/",f," passed"]})]}),r?.showFeedback&&de("div",{style:{padding:`${E("0.55rem")} ${E("0.75rem")}`,fontSize:E("0.85rem"),fontWeight:600,borderTop:"1px solid var(--line, #e7e5e0)",display:"flex",alignItems:"center",gap:E("0.45rem"),background:h==="correct"?"var(--ok-soft, #ecf8f0)":h==="partial"?"var(--almost-soft, #fbf1dc)":h==="incorrect"?"var(--pen-soft, #fdeeec)":"transparent",color:h==="correct"?"var(--ok, #1f8a4c)":h==="partial"?"var(--almost-ink, #8a5a08)":h==="incorrect"?"var(--pen, #d23b2b)":"var(--ink-soft, #565b66)"},children:[h==="correct"&&de(Pr,{children:[K(tn,{size:15,style:re(15)})," All tests passed"]}),h==="partial"&&"Partial credit",h==="incorrect"&&de(Pr,{children:[K(qa,{size:15,style:re(15)})," Tests failed"]}),h==="validating"&&"Evaluating\u2026",h==="awaiting_review"&&"Awaiting teacher review",r.score!==void 0&&de("span",{style:{marginLeft:"auto",fontFamily:'var(--font-hand, "Caveat", cursive)',fontSize:E("1.5rem"),lineHeight:1},children:[r.score," / ",r.maxScore??i.maxScore]})]})]})}import{Fragment as ac,jsx as on,jsxs as oc}from"react/jsx-runtime";import{createContext as sc,useContext as ic}from"react";import{DndContext as cc,MouseSensor as lc,TouchSensor as dc,KeyboardSensor as pc,useSensor as sn,useSensors as mc}from"@dnd-kit/core";import{jsx as nn}from"react/jsx-runtime";import{DragOverlay as tc,useDndContext as nc}from"@dnd-kit/core";function an(){let{active:e}=nc();if(!e)return null;let r=e.data.current?.html??"";return nn(tc,{dropAnimation:null,children:nn("div",{style:{display:"inline-block",padding:"0.375rem 0.75rem",borderRadius:"9999px",backgroundColor:"white",border:"1px solid #e5e7eb",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",cursor:"grabbing",maxWidth:"20rem"},children:nn("span",{dangerouslySetInnerHTML:{__html:r},style:{pointerEvents:"none",whiteSpace:"nowrap",lineHeight:"1.25"}})})})}var Ha=sc(!1),uc={acceleration:3,threshold:{x:0,y:.25}};function ft({children:e}){let r=ic(Ha),t=sn(lc,{activationConstraint:{distance:8}}),n=sn(dc,{activationConstraint:{delay:250,tolerance:5}}),a=sn(pc),s=mc(t,n,a);return r?on(ac,{children:e}):on(Ha.Provider,{value:!0,children:oc(cc,{sensors:s,autoScroll:uc,children:[e,on(an,{})]})})}function gr({content:e,onAnswersChange:r,onSubmit:t,answerBus:n,namespace:a,initialAnswers:s,validationFeedback:o,className:i="",locale:c,readOnly:l=!1,mediaHandler:d,codeExecutor:p,display:m}){let g=we(m),u=fc(()=>_e(g),[g]),b=hc(null);b.current||(b.current=new je);let v=n??b.current;ht(()=>{s&&s.length>0&&v.prefillAnswers(s)},[s,v]),ht(()=>{if(!r)return;let x=()=>{let _=v.getAllAnswers();r(_)};return v.on("answer:changed",x),()=>v.off("answer:changed",x)},[v,r]),ht(()=>{if(!t)return;let x=_=>{t(_.answers)};return v.on("answer:submitted",x),()=>v.off("answer:submitted",x)},[v,t]),ht(()=>{document.querySelectorAll("[data-audio]").forEach(_=>{let h=_.querySelector("audio"),y=_.querySelector("svg");!h||!y||(_.onclick=()=>{h.paused?(h.play(),y.innerHTML='<path d="M6 4h4v16H6zm8 0h4v16h-4z"/>',y.dataset.icon="pause"):(h.pause(),y.innerHTML='<path d="M6 4v16l12-8z"/>',y.dataset.icon="play")},h.onended=()=>{y.innerHTML='<path d="M6 4v16l12-8z"/>',y.dataset.icon="play"})})},[e]);let w=Se(e,o,{readOnly:l,mediaHandler:d,codeExecutor:p});return hr(Cr,{locale:c,children:hr(Re,{display:g,children:hr(Wr,{bus:v,children:hr(ft,{children:hr(at,{initialAnswers:s,children:hr("div",{className:`question-runtime ${i}${u.sizeSet?" edp-scaled":""}`,"data-namespace":a,style:{fontSize:E("1.125rem"),lineHeight:"1.75",...Ce(u)},children:w})})})})})})}import{jsx as br,jsxs as xt}from"react/jsx-runtime";import{memo as yc,useCallback as Ya,useMemo as vc,useRef as Ga}from"react";var Ua={words:80,media:1,tableRows:6},gc=new Set(["resizableImage","resizableVideo","youtubeEmbed"]);function Va(e){let r={words:0,media:0,tableRows:0},t=n=>{if(typeof n.text=="string"&&(r.words+=n.text.split(/\s+/).filter(a=>/[\p{L}\p{N}]/u.test(a)).length),n.type&&gc.has(n.type)&&r.media++,n.type==="table"){let a=(n.content??[]).filter(s=>s.type==="tableRow").length;r.tableRows=Math.max(r.tableRows,a)}for(let a of n.content??[])t(a)};return e&&t(e),r}function Tr(e,r=Ua){let t=Va(e);return t.words>r.words||t.media>r.media||t.tableRows>r.tableRows}import{createContext as bc,useContext as xc}from"react";var Qa=bc(null),gt=Qa.Provider;function bt(){return xc(Qa)}function yt({exercise:e,onAnswersChange:r,validationFeedback:t,renderSharedContext:n,renderQuestion:a,renderSeparator:s,className:o="",locale:i,display:c}){let l=we(c),d=vc(()=>_e(l),[l]),p=Ga(new Map),m=Ga({exercise:e,onAnswersChange:r});m.current={exercise:e,onAnswersChange:r};let g=Ya((x,_)=>{p.current.set(x,_);let{exercise:h,onAnswersChange:y}=m.current;if(y){let C={exerciseId:h.id,questionAnswers:h.questions.map(P=>({questionId:P.id,answers:p.current.get(P.id)??[]}))};y(C)}},[]),u=bt(),b=_r(i),v=!!(u&&e.sharedContext&&Tr(e.sharedContext)),w=e.sharedContext?v?xt("p",{className:"exercise-reference-cue",children:[br("span",{children:b.referenceInPanel(u.label)})," ",xt("button",{type:"button",className:"exercise-reference-cue__link",onClick:()=>u.showExerciseReference(e.id),children:[b.readReference,br("span",{"aria-hidden":"true",className:"exercise-reference-cue__arrow",children:"\u203A"})]})]}):br("div",{className:"exercise-shared-context",children:Se(e.sharedContext)}):null;return br(Re,{display:l,children:xt("div",{className:`exercise-runtime ${o}`,style:Ce(d),children:[w&&(n?n(w):w),e.questions.map((x,_)=>{let h=t?.get(x.id),y=br(wc,{questionId:x.id,content:x.content,onQuestionAnswers:g,validationFeedback:h,locale:i},x.id);return xt("div",{children:[a?a(x,y,_):y,s&&_<e.questions.length-1?s(_):null]},x.id)})]})})}var wc=yc(function({questionId:r,onQuestionAnswers:t,...n}){let a=Ya(s=>t(r,s),[t,r]);return br(gr,{...n,onAnswersChange:a})});import{jsx as cn,jsxs as kc}from"react/jsx-runtime";import{useCallback as Rc,useEffect as Sc,useMemo as _c,useRef as Ka}from"react";function Xe({assessment:e,onAnswersChange:r,validationFeedback:t,renderExercise:n,renderSharedContext:a,renderSeparator:s,className:o="",brandingConfig:i,locale:c,display:l}){let d=Ka(new Map),p=we(l),m=_c(()=>_e(p),[p]);Sc(()=>{if(!i?.fontUrl)return;let v=`edpire-brand-font-${i.fontUrl.replace(/\W/g,"").slice(-24)}`;if(document.getElementById(v))return;let w=document.createElement("link");w.id=v,w.rel="stylesheet",w.href=i.fontUrl,document.head.appendChild(w)},[i?.fontUrl]);let g={...Ce(m)};i?.fontFamily&&(g["--brand-font"]=i.fontFamily);let u=Ka({assessment:e,onAnswersChange:r});u.current={assessment:e,onAnswersChange:r};let b=Rc(v=>{d.current.set(v.exerciseId,v);let{assessment:w,onAnswersChange:x}=u.current;if(x){let _={exerciseAnswers:w.exercises.map(h=>d.current.get(h.id)??{exerciseId:h.id,questionAnswers:[]})};x(_)}},[]);return cn(Re,{display:p,children:cn("div",{className:`assessment-runtime ${o}`,style:Object.keys(g).length?g:void 0,children:e.exercises.map((v,w)=>{let x=t?.get(v.id),_=cn(yt,{exercise:v,onAnswersChange:b,validationFeedback:x,renderSharedContext:a?h=>a(h,v):void 0,locale:c},v.id);return kc("div",{children:[n?n(v,_,w):_,s&&w<e.exercises.length-1?s(w):null]},v.id)})})})}import{jsx as Xa}from"react/jsx-runtime";import{useMemo as Cc}from"react";function xr({content:e,className:r,display:t}){let n=we(t),a=Cc(()=>_e(n),[n]);return Xa(Re,{display:n,children:Xa("div",{className:`content-view ${r??""}`,style:Ce(a),children:Se(e)})})}import{jsx as Lr,Fragment as Ja,jsxs as vt}from"react/jsx-runtime";import{useMemo as Ac}from"react";function Ir({item:e,className:r,renderFigureLabel:t,display:n}){let a=we(n),s=Ac(()=>_e(a),[a]);return Lr(Re,{display:a,children:vt("div",{className:`annex-item-view ${r??""}${s.sizeSet?" edp-scaled":""}`,style:Ce(s),children:[e.type==="text-document"&&vt(Ja,{children:[e.title&&Lr("h3",{className:"text-base font-semibold mb-2",children:e.title}),Se(e.content)]}),e.type==="figure"&&vt("figure",{children:[Se(e.content),Lr("figcaption",{children:t?t(e.label):Lr("span",{children:e.label})})]}),e.type==="rich-block"&&vt(Ja,{children:[e.title&&Lr("h3",{className:"text-base font-semibold mb-2",children:e.title}),Se(e.content)]})]})})}import{jsx as Gu,jsxs as Yu}from"react/jsx-runtime";import{useState as Xu}from"react";import{jsx as nf,jsxs as af}from"react/jsx-runtime";import{useState as sf,useCallback as cf,useMemo as lf}from"react";import{useEditor as pf,EditorContent as mf}from"@tiptap/react";import ff from"@tiptap/starter-kit";import{jsx as xf,jsxs as yf,Fragment as vf}from"react/jsx-runtime";import{useMemo as kf,useState as Rf}from"react";function cr(e,{insertAt:r}={}){if(!e||typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",r==="top"&&t.firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}cr(`:root{--ink: #1d2025;--ink-soft: #565b66;--ink-faint: #8d93a0;--ui-muted: #f5f4f1;--line: #e7e5e0;--line-strong: #d6d3cc;--ok: #1f8a4c;--ok-soft: #ecf8f0;--pen: #d23b2b;--pen-soft: #fdeeec;--almost: #c8810e;--almost-ink: #8a5a08;--almost-soft: #fbf1dc;--font-hand: "Caveat", cursive}@keyframes answer-shake{10%,90%{transform:translate(-2px)}20%,80%{transform:translate(4px)}30%,50%,70%{transform:translate(-6px)}40%,60%{transform:translate(6px)}}@keyframes hop{0%,to{transform:translateY(0) scale(1)}40%{transform:translateY(-6%) scale(1.05)}}@keyframes wobble{0%,to{transform:translate(0)}15%,85%{transform:translate(-4px)}30%,70%{transform:translate(4px)}45%,55%{transform:translate(-2px)}}.animate-shake{animation:answer-shake .4s both}.animate-hop{animation:hop .5s ease-out}.animate-wobble{animation:wobble .5s ease}.cs-player__grid{display:grid;gap:calc(.75rem * var(--edp-scale, 1));grid-template-columns:repeat(1,minmax(0,1fr))}@media(min-width:40rem){:where(.cs-player:not(.cs-player--box)) .cs-player__grid--row{grid-template-columns:repeat(2,minmax(0,1fr))}}.cs-player--box{container-type:inline-size}@container (min-width: 35.5em){.cs-player--box .cs-player__grid--row{grid-template-columns:repeat(2,minmax(0,1fr))}}.player-choice{position:relative;display:inline-flex;align-items:center;gap:calc(.75rem * var(--edp-scale, 1));flex-wrap:wrap;width:100%;padding:calc(.75rem * var(--edp-scale, 1)) calc(1rem * var(--edp-scale, 1));border:1.5px solid var(--line, #e7e5e0);border-radius:calc(.75rem * var(--edp-scale, 1));background-color:#fff;color:var(--ink, #1d2025);cursor:pointer;user-select:none;transition:border-color .15s ease,background-color .15s ease,box-shadow .15s ease;font-weight:500;text-align:start}.player-choice:hover:not(:disabled){background-color:var(--ui-muted, #f5f4f1);border-color:var(--line-strong, #d6d3cc)}.player-choice:disabled{cursor:default}.player-choice>img{flex-shrink:0}.player-choice__mark{flex:none;display:grid;place-items:center;width:calc(20px * var(--edp-scale, 1));height:calc(20px * var(--edp-scale, 1));border:1.5px solid var(--ink-faint, #8d93a0);background:#fff;color:#fff;transition:border-color .15s,background .15s}.player-choice__mark--radio{border-radius:999px}.player-choice__mark--box{border-radius:calc(6px * var(--edp-scale, 1))}.player-choice__mark>svg{width:calc(13px * var(--edp-scale, 1));height:calc(13px * var(--edp-scale, 1));opacity:0}.player-choice__text{flex:1;min-width:0}.player-choice{height:100%}.player-choice__text img,.player-choice__text video,.player-choice__text iframe{max-height:calc(120px * var(--edp-scale, 1));width:auto;max-width:100%}.player-choice--tile{flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:calc(.5rem * var(--edp-scale, 1));padding:calc(1rem * var(--edp-scale, 1)) calc(.75rem * var(--edp-scale, 1))}.player-choice--tile .player-choice__mark{position:absolute;top:calc(.5rem * var(--edp-scale, 1));inset-inline-start:calc(.5rem * var(--edp-scale, 1))}.player-choice--tile .player-choice__text{flex:0 1 auto;width:100%;text-align:center}.player-choice--tile .player-choice__text img,.player-choice--tile .player-choice__text video,.player-choice--tile .player-choice__text iframe{display:block!important;margin-inline:auto;margin-bottom:calc(.4rem * var(--edp-scale, 1))}.player-choice--selected{background-color:var(--ui-muted, #f5f4f1);border-color:var(--ink, #1d2025)}.player-choice--selected .player-choice__mark{border-color:var(--ink, #1d2025);background:var(--ink, #1d2025)}.player-choice--selected .player-choice__mark>svg{opacity:1}.player-choice--correct{background-color:var(--ok-soft, #ecf8f0);border-color:var(--ok, #1f8a4c)}.player-choice--correct .player-choice__mark{border-color:var(--ok, #1f8a4c);background:var(--ok, #1f8a4c)}.player-choice--correct .player-choice__mark>svg{opacity:1}.player-choice--correct-unchosen{background-color:#fff;border-color:var(--ok, #1f8a4c);border-style:dashed}.player-choice--correct-unchosen .player-choice__mark{border-color:var(--ok, #1f8a4c)}.player-choice--incorrect{background-color:var(--pen-soft, #fdeeec);border-color:var(--pen, #d23b2b)}.player-choice--incorrect .player-choice__mark{border-color:var(--pen, #d23b2b);background:var(--pen, #d23b2b)}.player-choice--incorrect .player-choice__mark>svg{opacity:1}.player-choice--muted{opacity:.55}.player-choice--partial{background-color:var(--ok-soft, #ecf8f0);border-color:var(--ok, #1f8a4c)}.player-choice--disabled{cursor:default}.player-choice__mark--letter{width:calc(1.625rem * var(--edp-scale, 1));height:calc(1.625rem * var(--edp-scale, 1));color:var(--ink, #1d2025);font-size:.8em;font-weight:700;line-height:1}.player-choice--selected .player-choice__mark--letter,.player-choice--correct .player-choice__mark--letter,.player-choice--incorrect .player-choice__mark--letter{color:#fff}.player-choice--correct-unchosen .player-choice__mark--letter{color:var(--ok, #1f8a4c)}.player-choice__verdict{flex:none;display:grid;place-items:center;margin-inline-start:auto}.player-choice__verdict>svg{width:calc(1.125rem * var(--edp-scale, 1));height:calc(1.125rem * var(--edp-scale, 1))}.player-choice__verdict--correct{color:var(--ok, #1f8a4c)}.player-choice__verdict--incorrect{color:var(--pen, #d23b2b)}.player-choice--tile .player-choice__verdict{position:absolute;top:calc(.5rem * var(--edp-scale, 1));inset-inline-end:calc(.5rem * var(--edp-scale, 1));margin:0}.player-inline-choice{display:inline-flex;align-items:center;gap:calc(.25rem * var(--edp-scale, 1));padding:.05em .55em;border:1.5px solid var(--line-strong, #d6d3cc);border-radius:999px;background:#fff;color:var(--ink, #1d2025);font-size:.9em;line-height:inherit;cursor:pointer;user-select:none;transition:border-color .15s,background .15s}.player-inline-choice:hover:not(:disabled){background:var(--ui-muted, #f5f4f1)}.player-inline-choice:disabled{cursor:default}.player-inline-choice--selected{border-color:var(--ink, #1d2025);background:var(--ui-muted, #f5f4f1)}.player-inline-choice--correct{border-color:var(--ok, #1f8a4c);background:var(--ok-soft, #ecf8f0)}.player-inline-choice--correct-unchosen{border-color:var(--ok, #1f8a4c);border-style:dashed}.player-inline-choice--incorrect{border-color:var(--pen, #d23b2b);background:var(--pen-soft, #fdeeec)}.player-inline-choice--muted{opacity:.55}.player-inline-choice:focus-visible{outline:2px solid var(--ink, #1d2025);outline-offset:2px}.player-blank-input{display:inline-block;min-width:3ch;padding:calc(.25rem * var(--edp-scale, 1)) calc(.5rem * var(--edp-scale, 1));border:none;border-bottom:2px solid var(--line-strong, #d6d3cc);background-color:transparent;font-size:inherit;font-family:inherit;transition:all .2s ease;outline:none}.player-blank-input:focus{border-bottom-color:var(--ink, #1d2025);background-color:var(--ui-muted, #f5f4f1)}.player-blank-input--correct{border-bottom-color:var(--ok, #1f8a4c);background-color:var(--ok-soft, #ecf8f0);color:var(--ok, #1f8a4c)}.player-blank-input--incorrect{border-bottom-color:var(--pen, #d23b2b);background-color:var(--pen-soft, #fdeeec);color:var(--pen, #d23b2b)}.player-blank-input:disabled{opacity:.7;cursor:not-allowed}.player-typed-blank{display:inline-block;min-width:7ch;max-width:100%;padding:0 calc(.25rem * var(--edp-scale, 1));font-weight:600;text-align:center;line-height:1.25;border:1px solid var(--line-strong, #d6d3cc);border-bottom-width:2px;border-radius:calc(2px * var(--edp-scale, 1));background:var(--ui-muted, #f5f4f1);color:var(--ink, #1d2025);outline:none;resize:none;overflow:hidden;vertical-align:middle}.player-typed-blank::placeholder{color:var(--ink-faint, #8d93a0);font-weight:500}.player-typed-blank:focus{border-color:var(--ink, #1d2025)}.player-typed-blank--pending{border-color:var(--ink-faint, #8d93a0);background:var(--card, #ffffff)}.player-blank-cell{display:flex;flex-wrap:wrap;align-items:center;gap:calc(.125rem * var(--edp-scale, 1)) calc(.25rem * var(--edp-scale, 1));width:100%}.player-blank-cell__box{position:relative;display:block;flex:1 1 100%;min-width:0}.player-typed-blank--cell{display:block;box-sizing:border-box;width:100%;min-width:6.5ch;padding:calc(1px * var(--edp-scale, 1)) calc(2px * var(--edp-scale, 1));font:inherit;font-weight:600;line-height:1.3;white-space:nowrap;overflow-x:hidden}.player-typed-blank-feedback--cell{display:block;box-sizing:border-box;width:max-content;min-width:100%;max-width:none;white-space:nowrap;overflow:visible}.player-blank-cell .player-blank-reveal{white-space:nowrap;font-size:.9em}.edp-table-arrows{display:flex;justify-content:flex-end}.edp-table-arrows--top{margin-bottom:calc(.375rem * var(--edp-scale, 1))}.edp-table-arrows--bottom{margin-top:calc(.375rem * var(--edp-scale, 1))}.edp-table-arrows__pair{display:inline-flex;gap:calc(.375rem * var(--edp-scale, 1))}.edp-table-arrow{display:inline-flex;align-items:center;justify-content:center;width:calc(1.875rem * var(--edp-scale, 1));height:calc(1.875rem * var(--edp-scale, 1));padding:0;border:1px solid var(--line-strong, #d6d3cc);border-radius:999px;background:var(--card, #ffffff);color:var(--ink, #1d2025);cursor:pointer;transition:border-color .15s,background .15s,opacity .15s;-webkit-tap-highlight-color:transparent}.edp-table-arrow:hover:not(:disabled){border-color:var(--ink, #1d2025);background:var(--ui-muted, #f5f4f1)}.edp-table-arrow:focus-visible{outline:2px solid var(--ink, #1d2025);outline-offset:2px}.edp-table-arrow:disabled{opacity:.35;cursor:default}.edp-table-shade{position:absolute;top:0;bottom:0;width:calc(1.5rem * var(--edp-scale, 1));pointer-events:none;z-index:2}.edp-table-shade--left{background:linear-gradient(to right,#1d202529,#1d202500)}.edp-table-shade--right{background:linear-gradient(to left,#1d202529,#1d202500)}@media(max-width:640px){.edp-table-first{max-width:38vw}}.player-typed-blank-feedback{display:inline-block;min-width:2ch;max-width:100%;padding:0 calc(.25rem * var(--edp-scale, 1));font-weight:600;text-align:center;line-height:1.25;border:1px solid var(--line-strong, #d6d3cc);border-bottom-width:2px;border-radius:calc(2px * var(--edp-scale, 1));overflow-x:auto;cursor:default;vertical-align:middle}.player-typed-blank-feedback--correct{border-color:var(--ok, #1f8a4c);background:var(--ok-soft, #ecf8f0);color:var(--ok, #1f8a4c)}.player-typed-blank-feedback--partial{border-color:var(--ok, #1f8a4c);border-style:dashed;background:var(--ok-soft, #ecf8f0);color:var(--ok, #1f8a4c)}.player-typed-blank-feedback--incorrect{border-color:var(--pen, #d23b2b);background:var(--pen-soft, #fdeeec);color:var(--pen, #d23b2b);text-decoration:line-through}.player-typed-blank-spinner{display:inline-block;width:calc(.75rem * var(--edp-scale, 1));height:calc(.75rem * var(--edp-scale, 1));border:2px solid var(--ink-faint, #8d93a0);border-top-color:transparent;border-radius:999px;animation:blank-spin .7s linear infinite}@keyframes blank-spin{to{transform:rotate(360deg)}}.player-blank-reveal{font-weight:700;color:var(--ok, #1f8a4c);font-size:.875em;word-break:break-word;min-width:0}.player-blank-feedback{display:inline-block;font-size:.8em;font-weight:500;line-height:1.3;padding:calc(2px * var(--edp-scale, 1)) calc(8px * var(--edp-scale, 1));border-radius:999px;word-break:break-word;min-width:0;background:var(--ui-muted, #f5f4f1);color:var(--ink-soft, #565b66)}.player-blank-feedback--correct{background:var(--ok-soft, #ecf8f0);color:var(--ok, #1f8a4c)}.player-blank-feedback--incorrect{background:var(--pen-soft, #fdeeec);color:var(--pen, #d23b2b)}.player-blank-hint-btn{width:calc(1rem * var(--edp-scale, 1));height:calc(1rem * var(--edp-scale, 1));border:0;border-radius:999px;background:#fbbf24;color:#fff;font-size:calc(10px * var(--edp-scale, 1));font-weight:700;line-height:1;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;transition:background .12s}.player-blank-hint-btn:hover,.player-blank-hint-btn--pinned{background:#f59e0b}.player-blank-hint-pop{position:absolute;bottom:100%;left:50%;transform:translate(-50%);margin-bottom:calc(.5rem * var(--edp-scale, 1));z-index:9999;min-width:calc(180px * var(--edp-scale, 1));max-width:calc(300px * var(--edp-scale, 1));width:max-content;background:#fffbeb;border:1px solid #fde68a;border-radius:calc(14px * var(--edp-scale, 1));box-shadow:0 8px 24px #92400e2e;padding:calc(.5rem * var(--edp-scale, 1)) calc(.75rem * var(--edp-scale, 1));font-size:calc(.875rem * var(--edp-scale, 1));color:#78350f}.matching-player-hintrow{display:flex;justify-content:flex-start;margin-bottom:calc(.4rem * var(--edp-scale, 1))}.player-choice-blank{display:inline-flex;align-items:center;justify-content:center;min-width:4ch;padding:calc(.1rem * var(--edp-scale, 1)) calc(.5rem * var(--edp-scale, 1));border:2px dashed var(--line-strong, #d6d3cc);border-radius:calc(.5rem * var(--edp-scale, 1));color:var(--ink-faint, #8d93a0);background:transparent;transition:border-color .15s,background .15s,transform .15s,color .15s;vertical-align:middle}.player-choice-blank--target{border-color:var(--ink, #1d2025);background:var(--ui-muted, #f5f4f1)}.player-choice-blank--over{border-style:solid;border-color:var(--ink, #1d2025);background:var(--ui-muted, #f5f4f1);transform:scale(1.05)}.player-choice-blank--filled{border-style:solid;border-color:var(--ink, #1d2025);background:var(--ui-muted, #f5f4f1);color:var(--ink, #1d2025);cursor:pointer}.player-choice-blank--correct,.player-choice-blank--partial{border-style:solid;border-color:var(--ok, #1f8a4c);background:var(--ok-soft, #ecf8f0);color:var(--ok, #1f8a4c)}.player-choice-blank--incorrect{border-style:solid;border-color:var(--pen, #d23b2b);background:var(--pen-soft, #fdeeec);color:var(--pen, #d23b2b)}.player-choice-blank__clear{margin-inline-start:calc(.25rem * var(--edp-scale, 1));opacity:0;font-size:calc(.75rem * var(--edp-scale, 1));line-height:1;transition:opacity .12s}.player-choice-blank--filled:hover .player-choice-blank__clear{opacity:.6}.player-word-bank{margin:calc(1rem * var(--edp-scale, 1)) 0;position:relative;border:1px solid var(--line, #e7e5e0);border-radius:calc(14px * var(--edp-scale, 1));background:var(--ui-muted, #f5f4f1);padding:calc(.75rem * var(--edp-scale, 1)) calc(1rem * var(--edp-scale, 1))}.player-word-bank__label{margin-bottom:calc(.5rem * var(--edp-scale, 1));font-size:.7em;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--ink-soft, #565b66);user-select:none}.player-word-bank__items{display:flex;flex-wrap:wrap;gap:calc(.5rem * var(--edp-scale, 1))}.player-word-bank__items--grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(calc(10rem * var(--edp-scale, 1)),1fr));gap:calc(.5rem * var(--edp-scale, 1))}.player-bank-pill{display:inline-block;padding:calc(.35rem * var(--edp-scale, 1)) calc(.75rem * var(--edp-scale, 1));border:1px solid var(--line-strong, #d6d3cc);border-radius:999px;background:var(--card, #ffffff);color:var(--ink, #1d2025);user-select:none;-webkit-touch-callout:none;touch-action:manipulation;cursor:grab;transition:border-color .15s,background .15s,box-shadow .15s}.player-bank-pill:hover{border-color:var(--ink, #1d2025);background:var(--ui-muted, #f5f4f1)}.player-bank-pill--dragging{opacity:.5;cursor:grabbing;box-shadow:0 8px 24px #1d20252e}.player-bank-pill--hinted{position:relative}.player-tap-hint{position:absolute;left:calc(50% - 10px * var(--edp-scale, 1));top:50%;width:calc(30px * var(--edp-scale, 1));height:calc(30px * var(--edp-scale, 1));z-index:2;pointer-events:none;color:var(--ink, #1d2025)}.player-tap-hint__hand{display:block;width:100%;height:100%;opacity:.92;filter:drop-shadow(0 2px 3px rgba(29,32,37,.25));transform-origin:33% 8%;animation:edp-tap-hand 1.8s ease-in-out infinite}.player-tap-hint__ripple{position:absolute;left:calc(10px * var(--edp-scale, 1) - 11px);top:-11px;width:22px;height:22px;border-radius:999px;border:2px solid var(--ink, #1d2025);opacity:0;animation:edp-tap-ripple 1.8s ease-out infinite}@keyframes edp-tap-hand{0%,to{transform:translateY(12px)}30%{transform:translateY(0) scale(1)}38%{transform:translateY(1px) scale(.88)}48%{transform:translateY(0) scale(1)}75%{transform:translateY(12px)}}@keyframes edp-tap-ripple{0%,34%{opacity:0;transform:scale(.4)}40%{opacity:.45;transform:scale(.6)}70%{opacity:0;transform:scale(1.5)}to{opacity:0}}.player-tap-hint--still .player-tap-hint__hand,.player-tap-hint--still .player-tap-hint__ripple{animation:none}@media(prefers-reduced-motion:reduce){.player-tap-hint__hand,.player-tap-hint__ripple{animation:none}}.exercise-runtime{font-family:var(--brand-font, "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", sans-serif);font-size:calc(1.25rem * var(--edp-scale, 1));line-height:1.6;color:#1f2937}.exercise-runtime input,.exercise-runtime textarea{font-family:inherit}@media(min-width:640px){.exercise-runtime{font-size:calc(1.5rem * var(--edp-scale, 1))}}@media(min-width:768px){.exercise-runtime{font-size:calc(1.5rem * var(--edp-scale, 1))}}@media(min-width:1024px){.exercise-runtime{font-size:calc(2.25rem * var(--edp-scale, 1))}}@media(min-width:1280px){.exercise-runtime{font-size:calc(2.25rem * var(--edp-scale, 1))}}.exercise-runtime :lang(ar),.exercise-runtime [lang=ar],.exercise-runtime [dir=rtl]{direction:rtl;font-family:Arial,Scheherazade New,Amiri,sans-serif;text-align:right}.exercise-runtime p{margin:.5em 0;min-height:1.5em}.exercise-runtime p:empty:after{content:"\\a0";display:inline-block;min-height:1em}.exercise-runtime strong{font-weight:600;color:inherit}.exercise-runtime em{font-style:italic}.exercise-runtime ul,.exercise-runtime ol{list-style:revert;margin-left:calc(1.25rem * var(--edp-scale, 1));padding-left:0}.exercise-runtime img{max-width:100%;height:auto;vertical-align:middle;display:inline-block;margin:0 calc(4px * var(--edp-scale, 1))}.exercise-runtime .inline-math{display:inline-block;vertical-align:middle;margin:0 calc(2px * var(--edp-scale, 1))}.exercise-runtime .math-formula{display:flex;justify-content:center;margin:1em 0}.choice-set-player{margin:calc(1rem * var(--edp-scale, 1)) 0}.choice-set-player__prompt{font-weight:600;margin-bottom:calc(.75rem * var(--edp-scale, 1));color:#374151}.choice-set-player__prompt-hint{margin-left:calc(.5rem * var(--edp-scale, 1));font-size:calc(.875rem * var(--edp-scale, 1));opacity:.7;font-weight:400}.choice-set-player__choices{display:flex;flex-direction:column;gap:calc(.75rem * var(--edp-scale, 1))}.choice-set-player__choices--grid{display:grid;gap:calc(.75rem * var(--edp-scale, 1));grid-template-columns:1fr}@media(min-width:640px){.choice-set-player__choices--grid{grid-template-columns:repeat(2,1fr)}}.choice-set-player--inline{display:inline-flex;align-items:center;gap:calc(.5rem * var(--edp-scale, 1));flex-wrap:wrap}.choice-set-player--inline .player-choice{width:auto;padding:calc(.5rem * var(--edp-scale, 1)) calc(1rem * var(--edp-scale, 1))}.player-choice:focus-visible{outline:2px solid var(--ink, #1d2025);outline-offset:2px}.player-blank-input:focus-visible{outline:2px solid #3b82f6;outline-offset:2px}@media(prefers-contrast:high){.player-choice{border-width:3px}.player-choice--correct{border-color:#15803d}.player-choice--incorrect{border-color:#991b1b}}@media(prefers-reduced-motion:reduce){.animate-shake,.animate-hop,.animate-wobble{animation:none}.player-choice{transition:none}}@media print{.exercise-runtime{font-size:12pt;color:#000}.player-choice{border:1px solid black;background-color:#fff;page-break-inside:avoid}.player-choice--correct:after{content:" \\2713";font-weight:700}.player-choice--incorrect:after{content:" \\2717";font-weight:700}}.matching-player{margin:calc(1rem * var(--edp-scale, 1)) 0}.matching-player-feedback{display:flex;align-items:center;gap:calc(.45rem * var(--edp-scale, 1));margin-top:calc(.6rem * var(--edp-scale, 1));padding:calc(.55rem * var(--edp-scale, 1)) calc(.75rem * var(--edp-scale, 1));border:1px solid var(--line, #e7e5e0);border-radius:calc(.625rem * var(--edp-scale, 1));font-size:calc(.85rem * var(--edp-scale, 1));font-weight:600}.matching-player-feedback--correct{color:var(--ok, #1f8a4c);border-color:var(--ok, #1f8a4c);background:var(--ok-soft, #ecf8f0)}.matching-player-feedback--partial{color:var(--almost-ink, #8a5a08);border-color:var(--almost, #c8810e);background:var(--almost-soft, #fbf1dc)}.matching-player-feedback--incorrect{color:var(--pen, #d23b2b);border-color:var(--pen, #d23b2b);background:var(--pen-soft, #fdeeec)}.matching-player-score{margin-inline-start:auto;font-family:var(--font-hand, "Caveat", cursive);font-size:calc(1.5rem * var(--edp-scale, 1));line-height:1}.matching-player__instruction{display:none}.matching-player__arena{position:relative;display:flex;flex-direction:column;gap:calc(.5rem * var(--edp-scale, 1))}.matching-player__arena--dragging{user-select:none;touch-action:none}.matching-player__svg{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;overflow:visible;z-index:1}.matching-player__columns{display:grid;grid-template-columns:1fr 1fr;gap:calc(5rem * var(--edp-scale, 1));align-items:start;position:relative}.matching-player__column{display:flex;flex-direction:column;gap:calc(.5rem * var(--edp-scale, 1))}.matching-player__item{display:flex;align-items:center;flex-wrap:wrap;gap:calc(.5rem * var(--edp-scale, 1));width:100%;padding:calc(.75rem * var(--edp-scale, 1)) calc(1rem * var(--edp-scale, 1));border:2px solid var(--line, #e7e5e0);border-radius:calc(.625rem * var(--edp-scale, 1));background:var(--card, #ffffff);text-align:left;transition:border-color .15s,background .15s,box-shadow .15s,transform .1s;font-size:inherit;font-family:inherit;color:var(--ink, #1d2025);min-height:calc(52px * var(--edp-scale, 1));user-select:none;-webkit-tap-highlight-color:transparent}.matching-player__item:not(.matching-player__item--disabled){cursor:grab}.matching-player__item:not(.matching-player__item--disabled):active{cursor:grabbing}.matching-player__item:hover:not(.matching-player__item--disabled){border-color:var(--line-strong, #d6d3cc);background:var(--ui-muted, #f5f4f1)}.matching-player__item--selected{border-color:var(--ink, #1d2025)!important;background:var(--ui-muted, #f5f4f1)!important;box-shadow:0 0 0 3px #1d20251f;transform:scale(1.02)}.matching-player__item--available{border-color:var(--ink-faint, #8d93a0);border-style:dashed}.matching-player__item--available:hover{border-color:var(--ink, #1d2025);border-style:solid;background:var(--ui-muted, #f5f4f1)}.matching-player__item--matched{border-width:2px;border-color:var(--ink, #1d2025)}.matching-player__item--matched:hover:not(.matching-player__item--disabled){background:var(--ui-muted, #f5f4f1)}.matching-player__item--correct,.matching-player__item--correct:hover{border-color:var(--ok, #1f8a4c)!important;background:var(--ok-soft, #ecf8f0)!important}.matching-player__item--incorrect,.matching-player__item--incorrect:hover{border-color:var(--pen, #d23b2b)!important;background:var(--pen-soft, #fdeeec)!important}.matching-player__item--disabled{cursor:default;pointer-events:none}.matching-player__item-text{flex:1;min-width:0;line-height:1.4}.matching-player__item-text p{margin:0}.matching-player__pair-num{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:calc(22px * var(--edp-scale, 1));height:calc(22px * var(--edp-scale, 1));border-radius:50%;font-size:calc(.7rem * var(--edp-scale, 1));font-weight:700;line-height:1;background:var(--ink, #1d2025);color:#fff}.matching-player__item--correct .matching-player__pair-num{background:var(--ok, #1f8a4c)}.matching-player__item--incorrect .matching-player__pair-num{background:var(--pen, #d23b2b)}.matching-player__connector{flex-shrink:0;color:var(--ink-faint, #8d93a0);display:flex;align-items:center;transition:color .2s,transform .2s;border-radius:50%}.matching-player__item:hover .matching-player__connector{color:var(--ink, #1d2025);transform:scale(1.25)}.matching-player__connector--left{order:10;margin-left:calc(6px * var(--edp-scale, 1))}.matching-player__connector--right{order:-1;margin-right:calc(6px * var(--edp-scale, 1))}.matching-player__connector svg{width:calc(18px * var(--edp-scale, 1));height:calc(18px * var(--edp-scale, 1))}.matching-player__correct-hint{width:100%;order:20;font-weight:700;color:var(--ok, #1f8a4c);font-size:.82em;line-height:1.4;padding-top:.1em;word-break:break-word}.matching-player__correct-hint p{display:inline;margin:0}.matching-player__item:focus-visible{outline:3px solid var(--ink, #1d2025);outline-offset:2px}.blank-correct-hint{display:inline;font-weight:700;color:var(--ok, #1f8a4c);font-size:.875em;margin-left:.3em;word-break:break-word}@keyframes matching-pulse{0%{opacity:.5}to{opacity:1}}@media(prefers-reduced-motion:reduce){.matching-player__item{transition:none}}@media(max-width:600px){:where(.matching-player:not(.matching-player--box)) .matching-player__columns{gap:calc(1rem * var(--edp-scale, 1))}:where(.matching-player:not(.matching-player--box)) .matching-player__item{padding:calc(.5rem * var(--edp-scale, 1)) calc(.6rem * var(--edp-scale, 1));min-height:calc(44px * var(--edp-scale, 1));font-size:calc(.875rem * var(--edp-scale, 1));gap:calc(.35rem * var(--edp-scale, 1))}.matching-player__item:not(.matching-player__item--disabled){cursor:pointer}.matching-player__item:not(.matching-player__item--disabled):active{cursor:pointer}:where(.matching-player:not(.matching-player--box)) .matching-player__connector svg{width:calc(15px * var(--edp-scale, 1));height:calc(15px * var(--edp-scale, 1))}}.matching-player--box{container-type:inline-size}@container (max-width: 33.3em){.matching-player--box .matching-player__columns{gap:calc(1rem * var(--edp-scale, 1))}.matching-player--box .matching-player__item{padding:calc(.5rem * var(--edp-scale, 1)) calc(.6rem * var(--edp-scale, 1));min-height:calc(44px * var(--edp-scale, 1));font-size:calc(.875rem * var(--edp-scale, 1));gap:calc(.35rem * var(--edp-scale, 1))}.matching-player--box .matching-player__connector svg{width:calc(15px * var(--edp-scale, 1));height:calc(15px * var(--edp-scale, 1))}}.math-response-player{margin:calc(.5rem * var(--edp-scale, 1)) 0}.player-math-field{border:2px solid var(--line, #e7e5e0);border-radius:calc(.625rem * var(--edp-scale, 1));padding:calc(.375rem * var(--edp-scale, 1)) calc(.5rem * var(--edp-scale, 1));background:var(--card, #ffffff);transition:border-color .2s ease,background .2s ease}.player-math-field:focus-within{border-color:var(--ink, #1d2025)}.player-math-field--readonly{background:var(--ui-muted, #f5f4f1)}.player-math-field__input{width:100%;min-height:calc(2.5rem * var(--edp-scale, 1));font-size:calc(1.1rem * var(--edp-scale, 1));outline:none;--primary: var(--ink, #1d2025);--caret-color: var(--ink, #1d2025);--selection-background-color: var(--ink-soft, #565b66);--contains-highlight-background-color: var(--ui-muted, #f5f4f1)}.player-math-field__input::part(virtual-keyboard-toggle),.player-math-field__input::part(menu-toggle){color:var(--ink-faint, #8d93a0)}.player-math-field__fallback{width:100%;border:none;outline:none;font-size:calc(1rem * var(--edp-scale, 1));font-family:monospace;background:transparent;color:var(--ink, #1d2025)}.player-math-field--correct{border-color:var(--ok, #1f8a4c);background:var(--ok-soft, #ecf8f0)}.player-math-field--incorrect{border-color:var(--pen, #d23b2b);background:var(--pen-soft, #fdeeec)}.player-math-field--validating{border-color:var(--ink-faint, #8d93a0)}.player-math-feedback{margin-top:calc(.4rem * var(--edp-scale, 1));font-size:calc(.8rem * var(--edp-scale, 1));font-weight:600;display:flex;align-items:center;gap:calc(.4rem * var(--edp-scale, 1))}.player-math-feedback--correct{color:var(--ok, #1f8a4c)}.player-math-feedback--incorrect{color:var(--pen, #d23b2b)}.player-math-feedback--validating{color:var(--ink-soft, #565b66)}.player-math-score{margin-inline-start:auto;font-family:var(--font-hand, "Caveat", cursive);font-size:calc(1.5rem * var(--edp-scale, 1));line-height:1;color:var(--ok, #1f8a4c)}.player-math-spinner{display:inline-block;width:calc(.9rem * var(--edp-scale, 1));height:calc(.9rem * var(--edp-scale, 1));border:2px solid var(--ink-faint, #8d93a0);border-top-color:transparent;border-radius:50%;animation:player-math-spin .7s linear infinite}@keyframes player-math-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.player-math-spinner{animation:none}}.player-ai{margin:calc(1rem * var(--edp-scale, 1)) 0;padding:calc(.5rem * var(--edp-scale, 1));display:flex;flex-direction:column;gap:calc(.75rem * var(--edp-scale, 1));border:1px solid var(--line, #e7e5e0);border-radius:calc(.875rem * var(--edp-scale, 1));background:var(--ui-muted, #f5f4f1)}.player-ai-counts{display:flex;justify-content:flex-end;gap:calc(.5rem * var(--edp-scale, 1))}.player-ai-count{font-size:calc(.75rem * var(--edp-scale, 1));font-weight:600;padding:calc(.1rem * var(--edp-scale, 1)) calc(.5rem * var(--edp-scale, 1));border-radius:999px;background:var(--card, #ffffff);border:1px solid var(--line, #e7e5e0);color:var(--ink-soft, #565b66)}.player-ai-count--over{color:var(--pen, #d23b2b);border-color:var(--pen, #d23b2b)}.player-ai-count--min{color:var(--ink-faint, #8d93a0)}.player-ai-input{width:100%;box-sizing:border-box;padding:calc(.5rem * var(--edp-scale, 1)) calc(.75rem * var(--edp-scale, 1));font-size:calc(1rem * var(--edp-scale, 1));border:1px solid var(--line-strong, #d6d3cc);border-radius:calc(.625rem * var(--edp-scale, 1));background:var(--card, #ffffff);color:var(--ink, #1d2025);outline:none;transition:border-color .2s ease,background .2s ease}.player-ai-input::placeholder{color:var(--ink-faint, #8d93a0)}.player-ai-input:focus{border-color:var(--ink, #1d2025)}.player-ai-input--multiline{min-height:calc(120px * var(--edp-scale, 1));resize:vertical}.player-ai-input:disabled{cursor:default}.player-ai-input--correct{border-color:var(--ok, #1f8a4c);background:var(--ok-soft, #ecf8f0)}.player-ai-input--partial{border-color:var(--almost, #c8810e);border-style:dashed;background:var(--almost-soft, #fbf1dc)}.player-ai-input--incorrect{border-color:var(--pen, #d23b2b);background:var(--pen-soft, #fdeeec)}.player-ai-feedback{display:flex;flex-direction:column;gap:calc(.25rem * var(--edp-scale, 1));padding:calc(.75rem * var(--edp-scale, 1));border-radius:calc(.5rem * var(--edp-scale, 1));font-size:calc(.875rem * var(--edp-scale, 1));border:1px solid var(--line, #e7e5e0);background:var(--card, #ffffff);color:var(--ink, #1d2025)}.player-ai-feedback--correct{border-color:var(--ok, #1f8a4c);background:var(--ok-soft, #ecf8f0);color:var(--ok, #1f8a4c)}.player-ai-feedback--partial{border-color:var(--almost, #c8810e);background:var(--almost-soft, #fbf1dc);color:var(--almost-ink, #8a5a08)}.player-ai-feedback--incorrect{border-color:var(--pen, #d23b2b);background:var(--pen-soft, #fdeeec);color:var(--pen, #d23b2b)}.player-ai-message{margin:0}.player-ai-score-row{display:flex;justify-content:flex-end}.player-ai-score{font-family:var(--font-hand, "Caveat", cursive);font-size:calc(1.5rem * var(--edp-scale, 1));font-weight:600;line-height:1;padding:0 calc(.35rem * var(--edp-scale, 1));color:inherit}.player-ai-validating{display:flex;align-items:center;gap:calc(.5rem * var(--edp-scale, 1));padding:calc(.25rem * var(--edp-scale, 1)) 0;color:var(--ink-soft, #565b66)}.player-ai-spinner{display:inline-block;width:calc(.9rem * var(--edp-scale, 1));height:calc(.9rem * var(--edp-scale, 1));border:2px solid var(--ink-faint, #8d93a0);border-top-color:transparent;border-radius:999px;animation:ai-answer-spin .7s linear infinite}@keyframes ai-answer-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.player-ai-spinner{animation:none}}.player-or-field--pre{border-color:var(--line-strong, #d6d3cc)!important}.player-or-field--correct{border-color:var(--ok, #1f8a4c)!important;background:var(--ok-soft, #ecf8f0)!important}.player-or-field--partial,.player-or-field--review{border-color:var(--almost, #c8810e)!important;background:var(--almost-soft, #fbf1dc)!important}.player-or-field--review{border-style:dashed!important}.player-or-field--incorrect{border-color:var(--pen, #d23b2b)!important;background:var(--pen-soft, #fdeeec)!important}.edp-scaled .text-xs{font-size:calc(.75rem * var(--edp-scale, 1));line-height:calc(1 / .75)}.edp-scaled .text-sm{font-size:calc(.875rem * var(--edp-scale, 1));line-height:calc(1.25 / .875)}.edp-scaled .text-base{font-size:calc(1rem * var(--edp-scale, 1));line-height:1.5}.edp-scaled .text-lg{font-size:calc(1.125rem * var(--edp-scale, 1));line-height:calc(1.75 / 1.125)}.edp-scaled .text-\\[10px\\]{font-size:calc(10px * var(--edp-scale, 1))}.edp-scaled .prose-sm{font-size:calc(.875rem * var(--edp-scale, 1))}.edp-scaled .p-2{padding:calc(.5rem * var(--edp-scale, 1))}.edp-scaled .p-3{padding:calc(.75rem * var(--edp-scale, 1))}.edp-scaled .p-4{padding:calc(1rem * var(--edp-scale, 1))}.edp-scaled .p-6{padding:calc(1.5rem * var(--edp-scale, 1))}.edp-scaled .pb-1{padding-bottom:calc(.25rem * var(--edp-scale, 1))}.edp-scaled .pt-1\\.5{padding-top:calc(.375rem * var(--edp-scale, 1))}.edp-scaled .px-1\\.5{padding-left:calc(.375rem * var(--edp-scale, 1));padding-right:calc(.375rem * var(--edp-scale, 1))}.edp-scaled .px-2{padding-left:calc(.5rem * var(--edp-scale, 1));padding-right:calc(.5rem * var(--edp-scale, 1))}.edp-scaled .px-3{padding-left:calc(.75rem * var(--edp-scale, 1));padding-right:calc(.75rem * var(--edp-scale, 1))}.edp-scaled .px-4{padding-left:calc(1rem * var(--edp-scale, 1));padding-right:calc(1rem * var(--edp-scale, 1))}.edp-scaled .px-5{padding-left:calc(1.25rem * var(--edp-scale, 1));padding-right:calc(1.25rem * var(--edp-scale, 1))}.edp-scaled .px-6{padding-left:calc(1.5rem * var(--edp-scale, 1));padding-right:calc(1.5rem * var(--edp-scale, 1))}.edp-scaled .py-0\\.5{padding-top:calc(.125rem * var(--edp-scale, 1));padding-bottom:calc(.125rem * var(--edp-scale, 1))}.edp-scaled .py-1{padding-top:calc(.25rem * var(--edp-scale, 1));padding-bottom:calc(.25rem * var(--edp-scale, 1))}.edp-scaled .py-1\\.5{padding-top:calc(.375rem * var(--edp-scale, 1));padding-bottom:calc(.375rem * var(--edp-scale, 1))}.edp-scaled .py-2{padding-top:calc(.5rem * var(--edp-scale, 1));padding-bottom:calc(.5rem * var(--edp-scale, 1))}.edp-scaled .py-3{padding-top:calc(.75rem * var(--edp-scale, 1));padding-bottom:calc(.75rem * var(--edp-scale, 1))}.edp-scaled .mb-1{margin-bottom:calc(.25rem * var(--edp-scale, 1))}.edp-scaled .mb-2{margin-bottom:calc(.5rem * var(--edp-scale, 1))}.edp-scaled .ml-1{margin-left:calc(.25rem * var(--edp-scale, 1))}.edp-scaled .ml-2{margin-left:calc(.5rem * var(--edp-scale, 1))}.edp-scaled .mr-2{margin-right:calc(.5rem * var(--edp-scale, 1))}.edp-scaled .mt-0\\.5{margin-top:calc(.125rem * var(--edp-scale, 1))}.edp-scaled .mt-1{margin-top:calc(.25rem * var(--edp-scale, 1))}.edp-scaled .mt-1\\.5{margin-top:calc(.375rem * var(--edp-scale, 1))}.edp-scaled .mt-3{margin-top:calc(.75rem * var(--edp-scale, 1))}.edp-scaled .mx-1{margin-left:calc(.25rem * var(--edp-scale, 1));margin-right:calc(.25rem * var(--edp-scale, 1))}.edp-scaled .my-3{margin-top:calc(.75rem * var(--edp-scale, 1));margin-bottom:calc(.75rem * var(--edp-scale, 1))}.edp-scaled .my-4{margin-top:calc(1rem * var(--edp-scale, 1));margin-bottom:calc(1rem * var(--edp-scale, 1))}.edp-scaled .gap-1{gap:calc(.25rem * var(--edp-scale, 1))}.edp-scaled .gap-1\\.5{gap:calc(.375rem * var(--edp-scale, 1))}.edp-scaled .gap-2{gap:calc(.5rem * var(--edp-scale, 1))}.edp-scaled .gap-3{gap:calc(.75rem * var(--edp-scale, 1))}.edp-scaled .gap-x-1{column-gap:calc(.25rem * var(--edp-scale, 1))}.edp-scaled .gap-y-0\\.5{row-gap:calc(.125rem * var(--edp-scale, 1))}.edp-scaled .w-6{width:calc(1.5rem * var(--edp-scale, 1))}.edp-scaled .w-16{width:calc(4rem * var(--edp-scale, 1))}.edp-scaled .h-6{height:calc(1.5rem * var(--edp-scale, 1))}.edp-scaled .h-8{height:calc(2rem * var(--edp-scale, 1))}.edp-scaled .h-16{height:calc(4rem * var(--edp-scale, 1))}.edp-scaled .max-h-48{max-height:calc(12rem * var(--edp-scale, 1))}.edp-scaled .right-1{right:calc(.25rem * var(--edp-scale, 1))}.edp-scaled .right-3{right:calc(.75rem * var(--edp-scale, 1))}.edp-scaled .bottom-2{bottom:calc(.5rem * var(--edp-scale, 1))}.edp-scaled .max-w-\\[160px\\]{max-width:calc(160px * var(--edp-scale, 1))}.edp-scaled .max-w-\\[200px\\]{max-width:calc(200px * var(--edp-scale, 1))}.edp-scaled .max-w-\\[240px\\]{max-width:calc(240px * var(--edp-scale, 1))}.edp-scaled .min-h-\\[100px\\]{min-height:calc(100px * var(--edp-scale, 1))}.edp-scaled .min-h-\\[120px\\]{min-height:calc(120px * var(--edp-scale, 1))}.edp-scaled .\\[\\&_\\.ProseMirror\\]\\:min-h-\\[80px\\] .ProseMirror{min-height:calc(80px * var(--edp-scale, 1))}.math-inline,.math-block,.math-response-player,.katex,.katex-display{direction:ltr;unicode-bidi:isolate}.exercise-shared-context{font-size:calc(1.125rem * var(--edp-scale, 1));margin-bottom:calc(1rem * var(--edp-scale, 1))}.exercise-reference-cue{display:flex;flex-wrap:wrap;align-items:baseline;gap:calc(.25rem * var(--edp-scale, 1)) calc(.5rem * var(--edp-scale, 1));margin:0 0 calc(1rem * var(--edp-scale, 1));padding:calc(.625rem * var(--edp-scale, 1)) calc(.875rem * var(--edp-scale, 1));border:1px solid var(--line, #e7e5e0);border-inline-start:3px solid var(--ink-soft, #565b66);border-radius:calc(.625rem * var(--edp-scale, 1));background:var(--ui-muted, #f5f4f1);color:var(--ink-soft, #565b66);font-size:calc(1rem * var(--edp-scale, 1));line-height:1.5}.exercise-reference-cue__link{font:inherit;font-weight:600;color:var(--ink, #1d2025);background:none;border:0;padding:0;cursor:pointer;text-decoration:underline;text-underline-offset:3px}.exercise-reference-cue__link:hover{text-decoration-thickness:2px}.exercise-reference-cue__link:focus-visible{outline:2px solid var(--ink, #1d2025);outline-offset:2px;border-radius:2px}.exercise-reference-cue__arrow{display:inline-block;margin-inline-start:.25em}.exercise-reference-cue__arrow:dir(rtl){transform:scaleX(-1)}
48
- `);import"katex/dist/katex.min.css";cr(`/*! tailwindcss v4.2.0 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){.edpire-scope *,.edpire-scope :before,.edpire-scope :after,.edpire-scope ::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:""}}}@layer theme{.edpire-scope{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-200:oklch(88.5% .062 18.334);--color-red-300:oklch(80.8% .114 19.571);--color-red-950:oklch(25.8% .092 26.042);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-900:oklch(41.4% .112 45.904);--color-blue-600:oklch(54.6% .245 262.881);--color-rose-500:oklch(64.5% .246 16.439);--color-slate-500:oklch(55.4% .046 257.417);--color-slate-800:oklch(27.9% .041 260.031);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-gray-900:oklch(21% .034 264.665);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--font-weight-black:900;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-snug:1.375;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--ease-out:cubic-bezier(0, 0, .2, 1);--ease-in-out:cubic-bezier(.4, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1)}}.edpire-scope .\\@container{container-type:inline-size}.edpire-scope .pointer-events-none{pointer-events:none}.edpire-scope .collapse{visibility:collapse}.edpire-scope .invisible{visibility:hidden}.edpire-scope .visible{visibility:visible}.edpire-scope .absolute{position:absolute}.edpire-scope .fixed{position:fixed}.edpire-scope .relative{position:relative}.edpire-scope .static{position:static}.edpire-scope .sticky{position:sticky}.edpire-scope .inset-0{inset:calc(var(--spacing) * 0)}.edpire-scope .start{inset-inline-start:var(--spacing)}.edpire-scope .start-0{inset-inline-start:calc(var(--spacing) * 0)}.edpire-scope .start-2{inset-inline-start:calc(var(--spacing) * 2)}.edpire-scope .end{inset-inline-end:var(--spacing)}.edpire-scope .end-2{inset-inline-end:calc(var(--spacing) * 2)}.edpire-scope .top-0{top:calc(var(--spacing) * 0)}.edpire-scope .top-1\\/2{top:50%}.edpire-scope .top-2{top:calc(var(--spacing) * 2)}.edpire-scope .top-4{top:calc(var(--spacing) * 4)}.edpire-scope .top-\\[calc\\(var\\(--edp-bar\\)\\+1rem\\)\\]{top:calc(var(--edp-bar) + 1rem)}.edpire-scope .right-1{right:calc(var(--spacing) * 1)}.edpire-scope .right-3{right:calc(var(--spacing) * 3)}.edpire-scope .bottom-2{bottom:calc(var(--spacing) * 2)}.edpire-scope .isolate{isolation:isolate}.edpire-scope .z-10{z-index:10}.edpire-scope .z-20{z-index:20}.edpire-scope .z-30{z-index:30}.edpire-scope .z-40{z-index:40}.edpire-scope .z-50{z-index:50}.edpire-scope .z-\\[60\\]{z-index:60}.edpire-scope .container{width:100%}@media(min-width:40rem){.edpire-scope .container{max-width:40rem}}@media(min-width:48rem){.edpire-scope .container{max-width:48rem}}@media(min-width:64rem){.edpire-scope .container{max-width:64rem}}@media(min-width:80rem){.edpire-scope .container{max-width:80rem}}@media(min-width:96rem){.edpire-scope .container{max-width:96rem}}.edpire-scope .-mx-3{margin-inline:calc(var(--spacing) * -3)}.edpire-scope .mx-1{margin-inline:calc(var(--spacing) * 1)}.edpire-scope .mx-4{margin-inline:calc(var(--spacing) * 4)}.edpire-scope .mx-auto{margin-inline:auto}.edpire-scope .my-1{margin-block:calc(var(--spacing) * 1)}.edpire-scope .my-3{margin-block:calc(var(--spacing) * 3)}.edpire-scope .my-4{margin-block:calc(var(--spacing) * 4)}.edpire-scope .ms-2{margin-inline-start:calc(var(--spacing) * 2)}.edpire-scope .ms-auto{margin-inline-start:auto}.edpire-scope .mt-0\\.5{margin-top:calc(var(--spacing) * .5)}.edpire-scope .mt-1{margin-top:calc(var(--spacing) * 1)}.edpire-scope .mt-1\\.5{margin-top:calc(var(--spacing) * 1.5)}.edpire-scope .mt-2{margin-top:calc(var(--spacing) * 2)}.edpire-scope .mt-3{margin-top:calc(var(--spacing) * 3)}.edpire-scope .mt-px{margin-top:1px}.edpire-scope .mr-2{margin-right:calc(var(--spacing) * 2)}.edpire-scope .mb-1{margin-bottom:calc(var(--spacing) * 1)}.edpire-scope .mb-2{margin-bottom:calc(var(--spacing) * 2)}.edpire-scope .mb-3{margin-bottom:calc(var(--spacing) * 3)}.edpire-scope .mb-5{margin-bottom:calc(var(--spacing) * 5)}.edpire-scope .ml-1{margin-left:calc(var(--spacing) * 1)}.edpire-scope .ml-2{margin-left:calc(var(--spacing) * 2)}.edpire-scope .ml-auto{margin-left:auto}.edpire-scope .block{display:block}.edpire-scope .contents{display:contents}.edpire-scope .flex{display:flex}.edpire-scope .grid{display:grid}.edpire-scope .hidden{display:none}.edpire-scope .inline{display:inline}.edpire-scope .inline-block{display:inline-block}.edpire-scope .inline-flex{display:inline-flex}.edpire-scope .table{display:table}.edpire-scope .h-2{height:calc(var(--spacing) * 2)}.edpire-scope .h-3{height:calc(var(--spacing) * 3)}.edpire-scope .h-4{height:calc(var(--spacing) * 4)}.edpire-scope .h-5{height:calc(var(--spacing) * 5)}.edpire-scope .h-6{height:calc(var(--spacing) * 6)}.edpire-scope .h-7{height:calc(var(--spacing) * 7)}.edpire-scope .h-8{height:calc(var(--spacing) * 8)}.edpire-scope .h-9{height:calc(var(--spacing) * 9)}.edpire-scope .h-11{height:calc(var(--spacing) * 11)}.edpire-scope .h-16{height:calc(var(--spacing) * 16)}.edpire-scope .h-24{height:calc(var(--spacing) * 24)}.edpire-scope .h-\\[600px\\]{height:600px}.edpire-scope .h-dvh{height:100dvh}.edpire-scope .h-full{height:100%}.edpire-scope .h-screen{height:100vh}.edpire-scope .max-h-48{max-height:calc(var(--spacing) * 48)}.edpire-scope .max-h-\\[calc\\(100dvh-8rem\\)\\]{max-height:calc(100dvh - 8rem)}.edpire-scope .max-h-\\[calc\\(100dvh-var\\(--edp-bar\\)-2rem\\)\\]{max-height:calc(100dvh - var(--edp-bar) - 2rem)}.edpire-scope .max-h-\\[calc\\(100svh-6rem\\)\\]{max-height:calc(100svh - 6rem)}.edpire-scope .min-h-0{min-height:calc(var(--spacing) * 0)}.edpire-scope .min-h-\\[72px\\]{min-height:72px}.edpire-scope .min-h-\\[100px\\]{min-height:100px}.edpire-scope .min-h-\\[120px\\]{min-height:120px}.edpire-scope .min-h-\\[200px\\]{min-height:200px}.edpire-scope .min-h-dvh{min-height:100dvh}.edpire-scope .w-3{width:calc(var(--spacing) * 3)}.edpire-scope .w-4{width:calc(var(--spacing) * 4)}.edpire-scope .w-5{width:calc(var(--spacing) * 5)}.edpire-scope .w-6{width:calc(var(--spacing) * 6)}.edpire-scope .w-7{width:calc(var(--spacing) * 7)}.edpire-scope .w-9{width:calc(var(--spacing) * 9)}.edpire-scope .w-11{width:calc(var(--spacing) * 11)}.edpire-scope .w-12{width:calc(var(--spacing) * 12)}.edpire-scope .w-16{width:calc(var(--spacing) * 16)}.edpire-scope .w-24{width:calc(var(--spacing) * 24)}.edpire-scope .w-\\[88\\%\\]{width:88%}.edpire-scope .w-full{width:100%}.edpire-scope .w-px{width:1px}.edpire-scope .max-w-3xl{max-width:var(--container-3xl)}.edpire-scope .max-w-\\[32ch\\]{max-width:32ch}.edpire-scope .max-w-\\[160px\\]{max-width:160px}.edpire-scope .max-w-\\[200px\\]{max-width:200px}.edpire-scope .max-w-\\[240px\\]{max-width:240px}.edpire-scope .max-w-full{max-width:100%}.edpire-scope .max-w-none{max-width:none}.edpire-scope .max-w-sm{max-width:var(--container-sm)}.edpire-scope .max-w-xs{max-width:var(--container-xs)}.edpire-scope .min-w-0{min-width:calc(var(--spacing) * 0)}.edpire-scope .min-w-\\[80px\\]{min-width:80px}.edpire-scope .min-w-\\[140px\\]{min-width:140px}.edpire-scope .flex-1{flex:1}.edpire-scope .flex-none{flex:none}.edpire-scope .flex-shrink-0,.edpire-scope .shrink-0{flex-shrink:0}.edpire-scope .grow{flex-grow:1}.edpire-scope .-translate-x-\\[110\\%\\]{--tw-translate-x: -110% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.edpire-scope .translate-x-0{--tw-translate-x:calc(var(--spacing) * 0);translate:var(--tw-translate-x) var(--tw-translate-y)}.edpire-scope .-translate-y-1\\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.edpire-scope .transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.edpire-scope .animate-pulse{animation:var(--animate-pulse)}.edpire-scope .animate-spin{animation:var(--animate-spin)}.edpire-scope .cursor-default{cursor:default}.edpire-scope .cursor-pointer{cursor:pointer}.edpire-scope .resize{resize:both}.edpire-scope .flex-col{flex-direction:column}.edpire-scope .flex-wrap{flex-wrap:wrap}.edpire-scope .items-baseline{align-items:baseline}.edpire-scope .items-center{align-items:center}.edpire-scope .items-start{align-items:flex-start}.edpire-scope .justify-between{justify-content:space-between}.edpire-scope .justify-center{justify-content:center}.edpire-scope .justify-end{justify-content:flex-end}.edpire-scope .gap-0\\.5{gap:calc(var(--spacing) * .5)}.edpire-scope .gap-1{gap:calc(var(--spacing) * 1)}.edpire-scope .gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.edpire-scope .gap-2{gap:calc(var(--spacing) * 2)}.edpire-scope .gap-2\\.5{gap:calc(var(--spacing) * 2.5)}.edpire-scope .gap-3{gap:calc(var(--spacing) * 3)}.edpire-scope .gap-4{gap:calc(var(--spacing) * 4)}.edpire-scope .gap-5{gap:calc(var(--spacing) * 5)}.edpire-scope .gap-6{gap:calc(var(--spacing) * 6)}.edpire-scope :where(.edpire-scope .space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}.edpire-scope :where(.edpire-scope .space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}.edpire-scope :where(.edpire-scope .space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}.edpire-scope .gap-x-1{column-gap:calc(var(--spacing) * 1)}.edpire-scope .gap-x-4{column-gap:calc(var(--spacing) * 4)}.edpire-scope .gap-y-0\\.5{row-gap:calc(var(--spacing) * .5)}.edpire-scope .gap-y-2{row-gap:calc(var(--spacing) * 2)}.edpire-scope .self-start{align-self:flex-start}.edpire-scope .self-stretch{align-self:stretch}.edpire-scope .truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.edpire-scope .overflow-auto{overflow:auto}.edpire-scope .overflow-hidden{overflow:hidden}.edpire-scope .overflow-y-auto{overflow-y:auto}.edpire-scope .rounded{border-radius:.25rem}.edpire-scope .rounded-2xl{border-radius:var(--radius-2xl)}.edpire-scope .rounded-\\[10px\\]{border-radius:10px}.edpire-scope .rounded-\\[14px\\]{border-radius:14px}.edpire-scope .rounded-full{border-radius:3.40282e38px}.edpire-scope .rounded-lg{border-radius:var(--radius-lg)}.edpire-scope .rounded-md{border-radius:var(--radius-md)}.edpire-scope .rounded-sm{border-radius:var(--radius-sm)}.edpire-scope .rounded-xl{border-radius:var(--radius-xl)}.edpire-scope .rounded-e-lg{border-start-end-radius:var(--radius-lg);border-end-end-radius:var(--radius-lg)}.edpire-scope .rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.edpire-scope .border{border-style:var(--tw-border-style);border-width:1px}.edpire-scope .border-2{border-style:var(--tw-border-style);border-width:2px}.edpire-scope .border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.edpire-scope .border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.edpire-scope .border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.edpire-scope .border-dashed{--tw-border-style:dashed;border-style:dashed}.edpire-scope .border-\\[\\#c5e8d1\\]{border-color:#c5e8d1}.edpire-scope .border-\\[\\#d6d3cc\\]{border-color:#d6d3cc}.edpire-scope .border-\\[\\#e7e5e0\\]{border-color:#e7e5e0}.edpire-scope .border-\\[\\#f2e2bf\\]{border-color:#f2e2bf}.edpire-scope .border-\\[\\#f6cfc9\\]{border-color:#f6cfc9}.edpire-scope .border-amber-200{border-color:var(--color-amber-200)}.edpire-scope .border-gray-100{border-color:var(--color-gray-100)}.edpire-scope .border-gray-200{border-color:var(--color-gray-200)}.edpire-scope .border-gray-300{border-color:var(--color-gray-300)}.edpire-scope .bg-\\[\\#1d2025\\]{background-color:#1d2025}.edpire-scope .bg-\\[\\#e7e5e0\\]{background-color:#e7e5e0}.edpire-scope .bg-\\[\\#ecf8f0\\]{background-color:#ecf8f0}.edpire-scope .bg-\\[\\#f1efe9\\]{background-color:#f1efe9}.edpire-scope .bg-\\[\\#f2e2bf\\]{background-color:#f2e2bf}.edpire-scope .bg-\\[\\#f5f4f1\\]{background-color:#f5f4f1}.edpire-scope .bg-\\[\\#fbf1dc\\]{background-color:#fbf1dc}.edpire-scope .bg-\\[\\#fbfaf7\\]{background-color:#fbfaf7}.edpire-scope .bg-\\[\\#fdeeec\\]{background-color:#fdeeec}.edpire-scope .bg-amber-50{background-color:var(--color-amber-50)}.edpire-scope .bg-black{background-color:var(--color-black)}.edpire-scope .bg-black\\/25{background-color:#00000040}@supports (color:color-mix(in lab,red,red)){.edpire-scope .bg-black\\/25{background-color:color-mix(in oklab,var(--color-black) 25%,transparent)}}.edpire-scope .bg-black\\/40{background-color:#0006}@supports (color:color-mix(in lab,red,red)){.edpire-scope .bg-black\\/40{background-color:color-mix(in oklab,var(--color-black) 40%,transparent)}}.edpire-scope .bg-gray-50{background-color:var(--color-gray-50)}.edpire-scope .bg-gray-100{background-color:var(--color-gray-100)}.edpire-scope .bg-gray-300{background-color:var(--color-gray-300)}.edpire-scope .bg-gray-900{background-color:var(--color-gray-900)}.edpire-scope .bg-red-950\\/80{background-color:#460809cc}@supports (color:color-mix(in lab,red,red)){.edpire-scope .bg-red-950\\/80{background-color:color-mix(in oklab,var(--color-red-950) 80%,transparent)}}.edpire-scope .bg-white{background-color:var(--color-white)}.edpire-scope .bg-white\\/60{background-color:#fff9}@supports (color:color-mix(in lab,red,red)){.edpire-scope .bg-white\\/60{background-color:color-mix(in oklab,var(--color-white) 60%,transparent)}}.edpire-scope .object-contain{object-fit:contain}.edpire-scope .object-cover{object-fit:cover}.edpire-scope .p-1{padding:calc(var(--spacing) * 1)}.edpire-scope .p-1\\.5{padding:calc(var(--spacing) * 1.5)}.edpire-scope .p-2{padding:calc(var(--spacing) * 2)}.edpire-scope .p-3{padding:calc(var(--spacing) * 3)}.edpire-scope .p-4{padding:calc(var(--spacing) * 4)}.edpire-scope .p-6{padding:calc(var(--spacing) * 6)}.edpire-scope .px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.edpire-scope .px-2{padding-inline:calc(var(--spacing) * 2)}.edpire-scope .px-2\\.5{padding-inline:calc(var(--spacing) * 2.5)}.edpire-scope .px-3{padding-inline:calc(var(--spacing) * 3)}.edpire-scope .px-3\\.5{padding-inline:calc(var(--spacing) * 3.5)}.edpire-scope .px-4{padding-inline:calc(var(--spacing) * 4)}.edpire-scope .px-5{padding-inline:calc(var(--spacing) * 5)}.edpire-scope .px-6{padding-inline:calc(var(--spacing) * 6)}.edpire-scope .px-10{padding-inline:calc(var(--spacing) * 10)}.edpire-scope .py-0\\.5{padding-block:calc(var(--spacing) * .5)}.edpire-scope .py-1{padding-block:calc(var(--spacing) * 1)}.edpire-scope .py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.edpire-scope .py-2{padding-block:calc(var(--spacing) * 2)}.edpire-scope .py-2\\.5{padding-block:calc(var(--spacing) * 2.5)}.edpire-scope .py-3{padding-block:calc(var(--spacing) * 3)}.edpire-scope .py-5{padding-block:calc(var(--spacing) * 5)}.edpire-scope .py-8{padding-block:calc(var(--spacing) * 8)}.edpire-scope .ps-2{padding-inline-start:calc(var(--spacing) * 2)}.edpire-scope .ps-\\[23px\\]{padding-inline-start:23px}.edpire-scope .pe-2\\.5{padding-inline-end:calc(var(--spacing) * 2.5)}.edpire-scope .pt-1\\.5{padding-top:calc(var(--spacing) * 1.5)}.edpire-scope .pt-2{padding-top:calc(var(--spacing) * 2)}.edpire-scope .pb-1{padding-bottom:calc(var(--spacing) * 1)}.edpire-scope .pb-5{padding-bottom:calc(var(--spacing) * 5)}.edpire-scope .pl-2{padding-left:calc(var(--spacing) * 2)}.edpire-scope .text-center{text-align:center}.edpire-scope .text-right{text-align:right}.edpire-scope .text-start{text-align:start}.edpire-scope .align-middle{vertical-align:middle}.edpire-scope .font-mono{font-family:var(--font-mono)}.edpire-scope .font-sans{font-family:var(--font-sans)}.edpire-scope .text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.edpire-scope .text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.edpire-scope .text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.edpire-scope .text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.edpire-scope .text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.edpire-scope .text-\\[1\\.6rem\\]{font-size:1.6rem}.edpire-scope .text-\\[10px\\]{font-size:10px}.edpire-scope .text-\\[11px\\]{font-size:11px}.edpire-scope .leading-none{--tw-leading:1;line-height:1}.edpire-scope .leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.edpire-scope .leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.edpire-scope .font-black{--tw-font-weight:var(--font-weight-black);font-weight:var(--font-weight-black)}.edpire-scope .font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.edpire-scope .font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.edpire-scope .font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.edpire-scope .tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.edpire-scope .tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.edpire-scope .tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.edpire-scope .tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.edpire-scope .break-words{overflow-wrap:break-word}.edpire-scope .whitespace-pre-wrap{white-space:pre-wrap}.edpire-scope .text-\\[\\#1d2025\\]{color:#1d2025}.edpire-scope .text-\\[\\#1f8a4c\\]{color:#1f8a4c}.edpire-scope .text-\\[\\#8a5a08\\]{color:#8a5a08}.edpire-scope .text-\\[\\#8d93a0\\]{color:#8d93a0}.edpire-scope .text-\\[\\#565b66\\]{color:#565b66}.edpire-scope .text-\\[\\#a32b1e\\]{color:#a32b1e}.edpire-scope .text-\\[\\#c8810e\\]{color:#c8810e}.edpire-scope .text-\\[\\#d23b2b\\]{color:#d23b2b}.edpire-scope .text-amber-900{color:var(--color-amber-900)}.edpire-scope .text-blue-600{color:var(--color-blue-600)}.edpire-scope .text-gray-400{color:var(--color-gray-400)}.edpire-scope .text-gray-500{color:var(--color-gray-500)}.edpire-scope .text-gray-600{color:var(--color-gray-600)}.edpire-scope .text-gray-700{color:var(--color-gray-700)}.edpire-scope .text-gray-800{color:var(--color-gray-800)}.edpire-scope .text-red-200{color:var(--color-red-200)}.edpire-scope .text-red-300{color:var(--color-red-300)}.edpire-scope .text-slate-500{color:var(--color-slate-500)}.edpire-scope .text-slate-800{color:var(--color-slate-800)}.edpire-scope .text-white{color:var(--color-white)}.edpire-scope .uppercase{text-transform:uppercase}.edpire-scope .italic{font-style:italic}.edpire-scope .tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.edpire-scope .line-through{text-decoration-line:line-through}.edpire-scope .underline{text-decoration-line:underline}.edpire-scope .underline-offset-2{text-underline-offset:2px}.edpire-scope .underline-offset-4{text-underline-offset:4px}.edpire-scope .opacity-40{opacity:.4}.edpire-scope .opacity-60{opacity:.6}.edpire-scope .opacity-70{opacity:.7}.edpire-scope .shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.edpire-scope .shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.edpire-scope .shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.edpire-scope .shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.edpire-scope .outline{outline-style:var(--tw-outline-style);outline-width:1px}.edpire-scope .grayscale{--tw-grayscale:grayscale(100%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.edpire-scope .backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.edpire-scope .transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.edpire-scope .transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.edpire-scope .transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.edpire-scope .transition-shadow{transition-property:box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.edpire-scope .transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.edpire-scope .duration-300{--tw-duration:.3s;transition-duration:.3s}.edpire-scope .duration-700{--tw-duration:.7s;transition-duration:.7s}.edpire-scope .ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.edpire-scope .ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.edpire-scope .outline-none{--tw-outline-style:none;outline-style:none}.edpire-scope .select-none{-webkit-user-select:none;user-select:none}.edpire-scope .\\[--edp-bar\\:0px\\]{--edp-bar:0px}.edpire-scope :is(.edpire-scope .group-open\\:rotate-90):is(:where(.group):is([open],.edpire-scope :popover-open,.edpire-scope :open) *){rotate:90deg}@media(hover:hover){.edpire-scope :is(.edpire-scope .group-hover\\:text-\\[\\#1d2025\\]):is(:where(.group):hover *){color:#1d2025}.edpire-scope :is(.edpire-scope .group-hover\\:shadow-md):is(:where(.group):hover *){--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.edpire-scope :is(.edpire-scope .hover\\:border-\\[\\#8d93a0\\]):hover{border-color:#8d93a0}.edpire-scope :is(.edpire-scope .hover\\:bg-\\[\\#31353c\\]):hover{background-color:#31353c}.edpire-scope :is(.edpire-scope .hover\\:bg-\\[\\#e7e5e0\\]):hover{background-color:#e7e5e0}.edpire-scope :is(.edpire-scope .hover\\:bg-\\[\\#f1efe9\\]):hover{background-color:#f1efe9}.edpire-scope :is(.edpire-scope .hover\\:bg-gray-100):hover{background-color:var(--color-gray-100)}.edpire-scope :is(.edpire-scope .hover\\:bg-white):hover{background-color:var(--color-white)}.edpire-scope :is(.edpire-scope .hover\\:text-\\[\\#1d2025\\]):hover{color:#1d2025}.edpire-scope :is(.edpire-scope .hover\\:text-gray-700):hover{color:var(--color-gray-700)}.edpire-scope :is(.edpire-scope .hover\\:text-rose-500):hover{color:var(--color-rose-500)}.edpire-scope :is(.edpire-scope .hover\\:underline):hover{text-decoration-line:underline}}.edpire-scope :is(.edpire-scope .focus\\:outline-none):focus{--tw-outline-style:none;outline-style:none}.edpire-scope :is(.edpire-scope .focus-visible\\:ring-2):focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.edpire-scope :is(.edpire-scope .focus-visible\\:ring-\\[\\#8d93a0\\]):focus-visible{--tw-ring-color:#8d93a0}.edpire-scope :is(.edpire-scope .focus-visible\\:ring-offset-2):focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.edpire-scope :is(.edpire-scope .focus-visible\\:outline-2):focus-visible{outline-style:var(--tw-outline-style);outline-width:2px}.edpire-scope :is(.edpire-scope .focus-visible\\:outline-\\[\\#1d2025\\]):focus-visible{outline-color:#1d2025}.edpire-scope :is(.edpire-scope .disabled\\:cursor-not-allowed):disabled{cursor:not-allowed}.edpire-scope :is(.edpire-scope .disabled\\:opacity-50):disabled{opacity:.5}.edpire-scope :is(.edpire-scope .data-\\[flash\\=true\\]\\:bg-\\[\\#fbf1dc\\])[data-flash=true]{background-color:#fbf1dc}.edpire-scope :is(.edpire-scope .data-\\[flash\\=true\\]\\:duration-150)[data-flash=true]{--tw-duration:.15s;transition-duration:.15s}@media(min-width:40rem){.edpire-scope .sm\\:block{display:block}.edpire-scope .sm\\:hidden{display:none}.edpire-scope .sm\\:inline{display:inline}.edpire-scope .sm\\:inline-flex{display:inline-flex}.edpire-scope .sm\\:flex-row{flex-direction:row}.edpire-scope .sm\\:flex-nowrap{flex-wrap:nowrap}.edpire-scope .sm\\:items-center{align-items:center}.edpire-scope .sm\\:gap-4{gap:calc(var(--spacing) * 4)}.edpire-scope .sm\\:px-4{padding-inline:calc(var(--spacing) * 4)}.edpire-scope .sm\\:px-6{padding-inline:calc(var(--spacing) * 6)}.edpire-scope .sm\\:py-4{padding-block:calc(var(--spacing) * 4)}.edpire-scope .sm\\:text-\\[2rem\\]{font-size:2rem}}@container (min-width:72rem){.edpire-scope .\\@6xl\\:flex{display:flex}.edpire-scope .\\@6xl\\:hidden{display:none}}.edpire-scope :is(.edpire-scope .rtl\\:translate-x-\\[110\\%\\]):where(:dir(rtl),.edpire-scope [dir=rtl],.edpire-scope [dir=rtl] *){--tw-translate-x:110%;translate:var(--tw-translate-x) var(--tw-translate-y)}.edpire-scope :is(.edpire-scope .\\[\\&_\\.ProseMirror\\]\\:min-h-\\[80px\\]) .ProseMirror{min-height:80px}.edpire-scope :is(.edpire-scope .\\[\\&_\\.ProseMirror\\]\\:outline-none) .ProseMirror{--tw-outline-style:none;outline-style:none}.edpire-scope :is(.edpire-scope .\\[\\&_\\.ProseMirror_p\\.is-editor-empty\\:first-child\\:\\:before\\]\\:pointer-events-none) .ProseMirror p.is-editor-empty:first-child:before{pointer-events:none}.edpire-scope :is(.edpire-scope .\\[\\&_\\.ProseMirror_p\\.is-editor-empty\\:first-child\\:\\:before\\]\\:float-left) .ProseMirror p.is-editor-empty:first-child:before{float:left}.edpire-scope :is(.edpire-scope .\\[\\&_\\.ProseMirror_p\\.is-editor-empty\\:first-child\\:\\:before\\]\\:h-0) .ProseMirror p.is-editor-empty:first-child:before{height:calc(var(--spacing) * 0)}.edpire-scope :is(.edpire-scope .\\[\\&_\\.ProseMirror_p\\.is-editor-empty\\:first-child\\:\\:before\\]\\:text-gray-400) .ProseMirror p.is-editor-empty:first-child:before{color:var(--color-gray-400)}.edpire-scope :is(.edpire-scope .\\[\\&_\\.ProseMirror_p\\.is-editor-empty\\:first-child\\:\\:before\\]\\:content-\\[attr\\(data-placeholder\\)\\]) .ProseMirror p.is-editor-empty:first-child:before{--tw-content:attr(data-placeholder);content:var(--tw-content)}.edpire-scope :is(.edpire-scope .\\[\\&_\\[data-exercise-id\\]\\]\\:scroll-mt-\\[calc\\(var\\(--edp-bar\\)\\+0\\.75rem\\)\\]) [data-exercise-id],.edpire-scope :is(.edpire-scope .\\[\\&_\\[data-question-id\\]\\]\\:scroll-mt-\\[calc\\(var\\(--edp-bar\\)\\+0\\.75rem\\)\\]) [data-question-id]{scroll-margin-top:calc(var(--edp-bar) + .75rem)}@layer base{.edpire-scope *,.edpire-scope :after,.edpire-scope :before,.edpire-scope ::backdrop{border-color:var(--color-gray-200,currentColor)}.edpire-scope ::file-selector-button{border-color:var(--color-gray-200,currentColor)}}@supports not (height:100dvh){.edpire-scope .h-dvh{height:100vh}}.edpire-scope :where(span:has(>textarea.player-typed-blank)){line-height:0}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}
49
- `);import{jsx as ln}from"react/jsx-runtime";var Za=Mc.memo(function({content:r,onAnswersChange:t,feedback:n,initialAnswers:a,readOnly:s,className:o,dir:i}){let c=$c(()=>{if(n)return new Map(Object.entries(n))},[n]),l=ln(gr,{content:r,onAnswersChange:t,initialAnswers:a,validationFeedback:c,readOnly:s,className:o});return ln("div",{className:"edpire-scope",style:{display:"contents"},children:i?ln("div",{dir:i,children:l}):l})});import{useEffect as _l,useRef as wn}from"react";import No from"react";import{createRoot as Eo}from"react-dom/client";import{useCallback as So,useMemo as yl,useState as vl}from"react";import{cloneElement as go,isValidElement as bo,useCallback as Je,useEffect as kt,useMemo as Le,useRef as Mr,useState as Oe}from"react";import{Send as xo,Loader2 as fn,BarChart2 as yo,CheckCircle2 as il,XCircle as cl,RotateCcw as ll,X as hn,Clock as vr,AlertTriangle as dl,Check as pl,CloudOff as ml}from"lucide-react";import{clsx as zc}from"clsx";import{twMerge as Dc}from"tailwind-merge";function se(...e){return Dc(zc(e))}import{Fragment as Wc,jsx as ge,jsxs as dn}from"react/jsx-runtime";function Oc({accent:e}){return ge("div",{style:{width:48,height:48,borderRadius:"50%",border:`4px solid ${e}33`,borderTopColor:e,animation:"edpire-spin 0.8s linear infinite"}})}function Fc({accent:e}){return ge("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[0,1,2].map(r=>ge("div",{style:{width:12,height:12,borderRadius:"50%",background:e,animation:`edpire-bounce 1.2s ease-in-out ${r*.2}s infinite`}},r))})}function jc({accent:e}){return dn("div",{style:{position:"relative",width:48,height:48},children:[[0,1].map(r=>ge("div",{style:{position:"absolute",inset:0,borderRadius:"50%",background:e,opacity:.4,animation:`edpire-pulse 1.6s ease-out ${r*.8}s infinite`}},r)),ge("div",{style:{position:"absolute",inset:"25%",borderRadius:"50%",background:e}})]})}function Bc({accent:e}){return ge("div",{style:{display:"flex",gap:4,alignItems:"flex-end",height:40},children:[0,1,2,3].map(r=>ge("div",{style:{width:8,borderRadius:4,background:e,animation:`edpire-bars 1s ease-in-out ${r*.15}s infinite`}},r))})}function eo({visible:e,bgColor:r="rgba(0,0,0,0.55)",accentColor:t="#6366f1",text:n="Evaluating your answers\u2026",aiText:a="Some answers are being reviewed by AI, this may take a few seconds.",spinnerTheme:s="default",animationUrl:o,hasAiNodes:i=!1,contained:c=!1}){return e?dn(Wc,{children:[ge("style",{children:`
45
+ sys.stdin = io.StringIO(${JSON.stringify(s)})
46
+ `),d.runPython(e);let m=d.runPython("_stdout_capture.getvalue()");d.runPython("sys.stdout = sys.__stdout__");let p=m.trim()===(i||"").trim();return{testId:n,passed:p,actualStdout:m,durationMs:Date.now()-l}}else{d.runPython(e);let m=(o||[]).map(u=>JSON.stringify(u)).join(", "),p=d.runPython(`${t}(${m})`),g=qt(p,a);return{testId:n,passed:g,actual:p,durationMs:Date.now()-l}}}catch(d){return{testId:n,passed:!1,stderr:String(d),errored:!0,durationMs:Date.now()-l}}}var Bt=null;async function Bc(){if(Bt)return Bt;let e=await import("./sql-wasm-browser-NICPVFVD.mjs");return Bt=await(e.default??e)(),Bt}async function qc(e,r,t,n){let o=Date.now();try{let a=await Bc(),s=new a.Database;t&&s.run(t);let c=s.exec(e).flatMap(d=>d.values.map(m=>m.map(String).join("|"))).join(`
47
+ `),l=c.trim()===(n||"").trim();return s.close(),{testId:r,passed:l,actualStdout:c,durationMs:Date.now()-o}}catch(a){return{testId:r,passed:!1,stderr:String(a),errored:!0,durationMs:Date.now()-o}}}async function Wc(e){let{transform:r}=await import("./esm-RQP7AIMT.mjs");return r(e,{transforms:["typescript"]}).code}var $r=class{supports(r){return["javascript","typescript","python","sql"].includes(r)}async run(r){let{language:t,source:n,mode:o,entryFunction:a,tests:s,timeoutMs:i=5e3}=r;if(!this.supports(t))return s.map(d=>({testId:d.id,passed:!1,stderr:`Language "${t}" cannot run in-browser. Configure a RemoteExecutor for compiled languages.`,errored:!0}));let c=n;if(t==="typescript")try{c=await Wc(n)}catch(d){return s.map(m=>({testId:m.id,passed:!1,stderr:`TypeScript compile error: ${d.message}`,errored:!0}))}let l=[];for(let d of s){let m;t==="python"?m=await jc(c,o,a,d.id,d.args,d.expectedReturn,d.stdin,d.expectedStdout,i):t==="sql"?m=await qc(c,d.id,d.stdin,d.expectedStdout):m=await $c(c,o,a,d.id,d.args,d.expectedReturn,d.stdin,d.expectedStdout,i),l.push(m)}return l}};import{jsx as _a}from"react/jsx-runtime";import{forwardRef as Uc,useEffect as Hc,useImperativeHandle as Vc,useRef as Qc,useState as Gc}from"react";function Yc(e){return{javascript:"javascript",typescript:"typescript",python:"python",sql:"sql",java:"java",cpp:"cpp",go:"go"}[e]??"plaintext"}var On=Uc(function({value:r,onChange:t,language:n="javascript",readOnly:o=!1,readOnlyRanges:a,placeholder:s,height:i=300,className:c,autoFocus:l},d){let[m,p]=Gc(null),{scale:g}=Ie(),u=Qc(null);Hc(()=>{import("./dist-RXTJ74FF.mjs").then(w=>{p(()=>w.default)}).catch(()=>{})},[]),Vc(d,()=>({getValue(){return u.current?.getValue?.()??r},focus(){u.current?.focus?.()},insert(w){let C=u.current;if(!C)return;let y=C.getSelection();C.executeEdits("insert",[{range:y,text:w,forceMoveMarkers:!0}])}}));function h(w){u.current=w,l&&w.focus(),a?.length&&w.onDidAttemptReadOnlyEdit(()=>{})}function v(w){t(w??"")}let R=typeof i=="number"?i*g:i;return m?_a(m,{className:c,height:R,language:Yc(n),value:r,onChange:v,onMount:h,options:{readOnly:o,minimap:{enabled:!1},fontSize:14*g,lineNumbers:"on",scrollBeyondLastLine:!1,automaticLayout:!0,tabSize:2,wordWrap:"on"}}):_a("textarea",{className:c,value:r,onChange:w=>t(w.target.value),readOnly:o,placeholder:s,style:{width:"100%",height:typeof i=="number"?I(i):i,fontFamily:"monospace",fontSize:I(14),padding:I("0.5rem"),border:"1px solid #e2e8f0",borderRadius:I("0.375rem"),resize:"vertical",background:o?"#f8fafc":"white",boxSizing:"border-box"},autoFocus:l})});var rl=new $r;function tl(e){return e?.showFeedback?e.state??"idle":"idle"}function Na(e){let r={};for(let t of e.attrs.starters??[])r[t.language]=t.code;return r}function nl({sample:e,result:r,mode:t}){let n=r?.passed,o=r?.errored,a=r!==void 0,s=a?o?"var(--almost, #c8810e)":n?"var(--ok, #1f8a4c)":"var(--pen, #d23b2b)":"var(--ink-faint, #8d93a0)",i=a?o?"\u26A0":null:"\u25CB";return we("div",{style:{padding:`${I("0.5rem")} ${I("0.75rem")}`,borderBottom:"1px solid var(--line, #e7e5e0)",fontSize:I("0.8125rem"),fontFamily:"var(--font-mono, ui-monospace, monospace)"},children:[we("div",{style:{display:"flex",alignItems:"center",gap:I("0.5rem")},children:[oe("span",{style:{color:s,fontWeight:700,fontSize:I("0.875rem"),display:"inline-flex"},children:i??(n?oe(jn,{size:15,style:fe(15)}):oe(Aa,{size:15}))}),oe("span",{style:{fontWeight:600,color:"var(--ink, #1d2025)"},children:e.name??`Test ${e.id}`})]}),a&&!n&&we("div",{style:{marginTop:I("0.25rem"),paddingLeft:I("1.5rem")},children:[t==="function"?oe(nt,{children:r?.actual!==void 0&&we("div",{style:{color:"var(--ink-soft, #565b66)"},children:[oe("span",{style:{color:"var(--ink-faint, #8d93a0)"},children:"got: "}),oe("span",{style:{color:"var(--pen, #d23b2b)"},children:JSON.stringify(r.actual)}),oe("span",{style:{color:"var(--ink-faint, #8d93a0)"},children:" expected: "}),oe("span",{style:{color:"var(--ok, #1f8a4c)"},children:JSON.stringify(e.expectedReturn)})]})}):oe(nt,{children:r?.actualStdout!==void 0&&we("div",{style:{color:"var(--ink-soft, #565b66)"},children:[we("div",{children:[oe("span",{style:{color:"var(--ink-faint, #8d93a0)"},children:"got: "}),oe("span",{style:{color:"var(--pen, #d23b2b)",whiteSpace:"pre-wrap"},children:r.actualStdout||"(empty)"})]}),we("div",{children:[oe("span",{style:{color:"var(--ink-faint, #8d93a0)"},children:"expected: "}),oe("span",{style:{color:"var(--ok, #1f8a4c)",whiteSpace:"pre-wrap"},children:e.expectedStdout||"(empty)"})]})]})}),r?.stderr&&oe("div",{style:{color:"var(--almost-ink, #8a5a08)",marginTop:I("0.125rem"),whiteSpace:"pre-wrap"},children:r.stderr})]})]})}function Tt({node:e,validationFeedback:r,readOnly:t=!1,executor:n=rl,gradingTests:o}){let a=xe(),s=Jc(null),{attrs:i}=e,c=e.id,[l,d]=tt(i.defaultLanguage),[m,p]=tt(()=>Na(e)),[g,u]=tt([]),[h,v]=tt(!1),[R,w]=tt(!1),C=m[l]??"",y=tl(r);Xc(()=>{let A=G=>{let B=G.answers?.find(V=>V.nodeId===c&&V.type==="codingResponse");B?.answer&&(B.answer.language&&d(B.answer.language),B.answer.sourceByLanguage&&p(B.answer.sourceByLanguage),B.answer.testResults&&u(B.answer.testResults))},L=()=>{p(Na(e)),u([]),w(!1)};return a.on("answers:prefill",A),a.on("answers:reset",L),()=>{a.off("answers:prefill",A),a.off("answers:reset",L)}},[a,c,e]);let S=Kc((A,L,G)=>{a.emit({type:"answer:changed",answer:{nodeId:c,type:"codingResponse",timestamp:Date.now(),answer:{language:A,sourceByLanguage:L,source:L[A]??"",testResults:G}}})},[a,c]),k=A=>{let L={...m,[l]:A};p(L),S(l,L,g)},_=A=>{d(A),u([]),S(A,m,[])},P=async()=>{if(h)return;v(!0),u([]);let A=o??i.visibleSamples??[];if(A.length===0){v(!1);return}try{let L=await n.run({language:l,source:C,mode:i.testMode,entryFunction:i.entryFunction,tests:A,timeoutMs:5e3});u(L),S(l,m,L)}catch(L){let G=A.map(B=>({testId:B.id,passed:!1,stderr:String(L),errored:!0}));u(G),S(l,m,G)}finally{v(!1)}},F=()=>{R||(w(!0),S(l,m,g))},b=(o??[]).filter(A=>A.hidden).length,T=b>0?g.filter(A=>(o??[]).find(G=>G.id===A.testId)?.hidden&&A.passed).length:0,f=o?o.filter(A=>!A.hidden):i.visibleSamples??[],q=y==="correct"?"var(--ok, #1f8a4c)":y==="partial"?"var(--almost, #c8810e)":y==="incorrect"?"var(--pen, #d23b2b)":"var(--line-strong, #d6d3cc)";return we("div",{style:{margin:`${I("0.75rem")} 0`,border:`1px solid ${q}`,borderRadius:I("0.875rem"),overflow:"hidden",transition:"border-color 0.2s"},children:[we("div",{style:{background:"var(--ui-muted, #f5f4f1)",borderBottom:"1px solid var(--line, #e7e5e0)",padding:`${I("0.5rem")} ${I("0.75rem")}`,display:"flex",alignItems:"center",gap:I("0.5rem"),flexWrap:"wrap"},children:[oe("div",{style:{display:"flex",gap:I("0.25rem")},children:i.languages.map(A=>oe("button",{onClick:()=>!t&&_(A),disabled:t,style:{padding:`${I("0.2rem")} ${I("0.6rem")}`,borderRadius:I("0.375rem"),border:"1px solid",borderColor:l===A?"var(--ink, #1d2025)":"var(--line, #e7e5e0)",background:l===A?"var(--ink, #1d2025)":"var(--card, #fff)",color:l===A?"#fff":"var(--ink-soft, #565b66)",fontSize:I("0.75rem"),fontWeight:600,cursor:t?"default":"pointer",fontFamily:"var(--font-mono, ui-monospace, monospace)"},children:A},A))}),oe("div",{style:{flex:1}}),oe(Ye,{hint:i.hint}),!t&&we(nt,{children:[we("button",{onClick:P,disabled:h,style:{padding:`${I("0.25rem")} ${I("0.75rem")}`,borderRadius:I("0.5rem"),border:"1px solid var(--line-strong, #d6d3cc)",background:h?"var(--ui-muted, #f5f4f1)":"var(--card, #fff)",color:"var(--ink, #1d2025)",fontSize:I("0.8125rem"),fontWeight:600,cursor:h?"not-allowed":"pointer",display:"inline-flex",alignItems:"center",gap:I("0.35rem")},children:[oe(Zc,{size:13,style:fe(13)})," ",h?"Running\u2026":"Run"]}),we("button",{onClick:F,disabled:R,style:{padding:`${I("0.3rem")} ${I("0.85rem")}`,borderRadius:I("0.5rem"),border:"none",background:R?"var(--ok-soft, #ecf8f0)":"var(--ink, #1d2025)",color:R?"var(--ok, #1f8a4c)":"#fff",fontSize:I("0.8125rem"),fontWeight:600,cursor:R?"default":"pointer",display:"inline-flex",alignItems:"center",gap:I("0.35rem")},children:[R&&oe(jn,{size:13,style:fe(13)})," ",R?"Submitted":"Submit"]})]})]}),oe(On,{ref:s,value:C,onChange:k,language:l,readOnly:t,readOnlyRanges:i.starters.find(A=>A.language===l)?.readOnlyRanges,height:320}),(g.length>0||f.length>0)&&we("div",{style:{borderTop:"1px solid var(--line, #e7e5e0)",background:"var(--paper, #fbfaf7)"},children:[oe("div",{style:{padding:`${I("0.5rem")} ${I("0.75rem")}`,fontSize:I("0.7rem"),fontWeight:700,color:"var(--ink-faint, #8d93a0)",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Test Results"}),f.map(A=>oe(nl,{sample:A,result:g.find(L=>L.testId===A.id),mode:i.testMode},A.id)),b>0&&we("div",{style:{padding:`${I("0.5rem")} ${I("0.75rem")}`,fontSize:I("0.8125rem"),color:"var(--ink-soft, #565b66)",borderTop:"1px solid var(--line, #e7e5e0)",fontStyle:"italic",display:"flex",alignItems:"center",gap:I("0.4rem")},children:[oe(el,{size:13,style:fe(13)})," Hidden tests: ",T,"/",b," passed"]})]}),r?.showFeedback&&we("div",{style:{padding:`${I("0.55rem")} ${I("0.75rem")}`,fontSize:I("0.85rem"),fontWeight:600,borderTop:"1px solid var(--line, #e7e5e0)",display:"flex",alignItems:"center",gap:I("0.45rem"),background:y==="correct"?"var(--ok-soft, #ecf8f0)":y==="partial"?"var(--almost-soft, #fbf1dc)":y==="incorrect"?"var(--pen-soft, #fdeeec)":"transparent",color:y==="correct"?"var(--ok, #1f8a4c)":y==="partial"?"var(--almost-ink, #8a5a08)":y==="incorrect"?"var(--pen, #d23b2b)":"var(--ink-soft, #565b66)"},children:[y==="correct"&&we(nt,{children:[oe(jn,{size:15,style:fe(15)})," All tests passed"]}),y==="partial"&&"Partial credit",y==="incorrect"&&we(nt,{children:[oe(Aa,{size:15,style:fe(15)})," Tests failed"]}),y==="validating"&&"Evaluating\u2026",y==="awaiting_review"&&"Awaiting teacher review",r.score!==void 0&&we("span",{style:{marginLeft:"auto",fontFamily:'var(--font-hand, "Caveat", cursive)',fontSize:I("1.5rem"),lineHeight:1},children:[r.score," / ",r.maxScore??i.maxScore]})]})]})}import{Fragment as sl,jsx as Wt,jsxs as il}from"react/jsx-runtime";import{createContext as cl,useContext as ll,useEffect as dl}from"react";import{DndContext as pl,MouseSensor as ul,TouchSensor as ml,KeyboardSensor as fl,useDndContext as hl,useSensor as Wn,useSensors as gl}from"@dnd-kit/core";import{jsx as Bn}from"react/jsx-runtime";import{DragOverlay as ol,useDndContext as al}from"@dnd-kit/core";function qn(){let{active:e}=al();if(!e)return null;let r=e.data.current?.html??"";return Bn(ol,{dropAnimation:null,children:Bn("div",{style:{display:"inline-block",padding:"0.375rem 0.75rem",borderRadius:"9999px",backgroundColor:"white",border:"1px solid #e5e7eb",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",cursor:"grabbing",maxWidth:"20rem"},children:Bn("span",{dangerouslySetInnerHTML:{__html:r},style:{pointerEvents:"none",whiteSpace:"nowrap",lineHeight:"1.25"}})})})}function bl(e,r,t){let n=[],o=new Set,a=s=>{o.has(s)||(o.add(s),t(s)==="smooth"&&(n.push([s,s.style.scrollBehavior]),s.style.scrollBehavior="auto"))};for(let s=e;s;s=s.parentElement)a(s);return r&&a(r),()=>{for(let[s,i]of n)s.style.scrollBehavior=i}}function yl(){let{activeNode:e}=hl();return dl(()=>{if(!(!e||typeof document>"u"))return bl(e,document.scrollingElement,r=>getComputedStyle(r).scrollBehavior)},[e]),null}var Ea=cl(!1),xl={acceleration:3,threshold:{x:0,y:.25}};function Ut({children:e}){let r=ll(Ea),t=Wn(ul,{activationConstraint:{distance:8}}),n=Wn(ml,{activationConstraint:{delay:250,tolerance:5}}),o=Wn(fl),a=gl(t,n,o);return r?Wt(sl,{children:e}):Wt(Ea.Provider,{value:!0,children:il(pl,{sensors:a,autoScroll:xl,children:[e,Wt(qn,{}),Wt(yl,{})]})})}function Dr({content:e,onAnswersChange:r,onSubmit:t,answerBus:n,namespace:o,initialAnswers:a,validationFeedback:s,className:i="",locale:c,readOnly:l=!1,mediaHandler:d,codeExecutor:m,display:p}){let g=Le(p),u=vl(()=>Fe(g),[g]),h=wl(null);h.current||(h.current=new Je);let v=n??h.current;Un(()=>{a&&a.length>0&&v.prefillAnswers(a)},[a,v]),Un(()=>{if(!r)return;let w=()=>{let C=v.getAllAnswers();r(C)};return v.on("answer:changed",w),()=>v.off("answer:changed",w)},[v,r]),Un(()=>{if(!t)return;let w=C=>{t(C.answers)};return v.on("answer:submitted",w),()=>v.off("answer:submitted",w)},[v,t]);let R=De(e,s,{readOnly:l,mediaHandler:d,codeExecutor:m});return zr(Gr,{locale:c,children:zr($e,{display:g,children:zr(gt,{bus:v,children:zr(Ut,{children:zr(Lt,{initialAnswers:a,children:zr("div",{className:`question-runtime ${i}${u.sizeSet?" edp-scaled":""}`,"data-namespace":o,style:{fontSize:I("1.125rem"),lineHeight:"1.75",...Oe(u)},children:R})})})})})})}import{jsx as Fr,jsxs as Qt}from"react/jsx-runtime";import{memo as Cl,useCallback as Ia,useMemo as _l,useRef as La}from"react";var Pa={words:80,media:1,tableRows:6},kl=new Set(["resizableImage","resizableVideo","youtubeEmbed"]);function Ta(e){let r={words:0,media:0,tableRows:0},t=n=>{if(typeof n.text=="string"&&(r.words+=n.text.split(/\s+/).filter(o=>/[\p{L}\p{N}]/u.test(o)).length),n.type&&kl.has(n.type)&&r.media++,n.type==="table"){let o=(n.content??[]).filter(a=>a.type==="tableRow").length;r.tableRows=Math.max(r.tableRows,o)}for(let o of n.content??[])t(o)};return e&&t(e),r}function ot(e,r=Pa){let t=Ta(e);return t.words>r.words||t.media>r.media||t.tableRows>r.tableRows}import{createContext as Rl,useContext as Sl}from"react";var Ma=Rl(null),Ht=Ma.Provider;function Vt(){return Sl(Ma)}function Gt({exercise:e,onAnswersChange:r,validationFeedback:t,renderSharedContext:n,renderQuestion:o,renderSeparator:a,className:s="",locale:i,display:c}){let l=Le(c),d=_l(()=>Fe(l),[l]),m=La(new Map),p=La({exercise:e,onAnswersChange:r});p.current={exercise:e,onAnswersChange:r};let g=Ia((w,C)=>{m.current.set(w,C);let{exercise:y,onAnswersChange:S}=p.current;if(S){let k={exerciseId:y.id,questionAnswers:y.questions.map(_=>({questionId:_.id,answers:m.current.get(_.id)??[]}))};S(k)}},[]),u=Vt(),h=Qr(i),v=!!(u&&e.sharedContext&&ot(e.sharedContext)),R=e.sharedContext?v?Qt("p",{className:"exercise-reference-cue",children:[Fr("span",{children:h.referenceInPanel(u.label)})," ",Qt("button",{type:"button",className:"exercise-reference-cue__link",onClick:()=>u.showExerciseReference(e.id),children:[h.readReference,Fr("span",{"aria-hidden":"true",className:"exercise-reference-cue__arrow",children:"\u203A"})]})]}):Fr("div",{className:"exercise-shared-context",children:De(e.sharedContext)}):null;return Fr($e,{display:l,children:Qt("div",{className:`exercise-runtime ${s}`,style:Oe(d),children:[R&&(n?n(R):R),e.questions.map((w,C)=>{let y=t?.get(w.id),S=Fr(Nl,{questionId:w.id,content:w.content,onQuestionAnswers:g,validationFeedback:y,locale:i},w.id);return Qt("div",{children:[o?o(w,S,C):S,a&&C<e.questions.length-1?a(C):null]},w.id)})]})})}var Nl=Cl(function({questionId:r,onQuestionAnswers:t,...n}){let o=Ia(a=>t(r,a),[t,r]);return Fr(Dr,{...n,onAnswersChange:o})});import{jsx as Hn,jsxs as Al}from"react/jsx-runtime";import{useCallback as El,useEffect as Pl,useMemo as Tl,useRef as $a}from"react";function dr({assessment:e,onAnswersChange:r,validationFeedback:t,renderExercise:n,renderSharedContext:o,renderSeparator:a,className:s="",brandingConfig:i,locale:c,display:l}){let d=$a(new Map),m=Le(l),p=Tl(()=>Fe(m),[m]);Pl(()=>{if(!i?.fontUrl)return;let v=`edpire-brand-font-${i.fontUrl.replace(/\W/g,"").slice(-24)}`;if(document.getElementById(v))return;let R=document.createElement("link");R.id=v,R.rel="stylesheet",R.href=i.fontUrl,document.head.appendChild(R)},[i?.fontUrl]);let g={...Oe(p)};i?.fontFamily&&(g["--brand-font"]=i.fontFamily);let u=$a({assessment:e,onAnswersChange:r});u.current={assessment:e,onAnswersChange:r};let h=El(v=>{d.current.set(v.exerciseId,v);let{assessment:R,onAnswersChange:w}=u.current;if(w){let C={exerciseAnswers:R.exercises.map(y=>d.current.get(y.id)??{exerciseId:y.id,questionAnswers:[]})};w(C)}},[]);return Hn($e,{display:m,children:Hn("div",{className:`assessment-runtime ${s}`,style:Object.keys(g).length?g:void 0,children:e.exercises.map((v,R)=>{let w=t?.get(v.id),C=Hn(Gt,{exercise:v,onAnswersChange:h,validationFeedback:w,renderSharedContext:o?y=>o(y,v):void 0,locale:c},v.id);return Al("div",{children:[n?n(v,C,R):C,a&&R<e.exercises.length-1?a(R):null]},v.id)})})})}import{jsx as za}from"react/jsx-runtime";import{useMemo as Ml}from"react";function Or({content:e,className:r,display:t}){let n=Le(t),o=Ml(()=>Fe(n),[n]);return za($e,{display:n,children:za("div",{className:`content-view ${r??""}`,style:Oe(o),children:De(e)})})}import{jsx as at,Fragment as Da,jsxs as Yt}from"react/jsx-runtime";import{useMemo as Ll}from"react";function st({item:e,className:r,renderFigureLabel:t,display:n}){let o=Le(n),a=Ll(()=>Fe(o),[o]);return at($e,{display:o,children:Yt("div",{className:`annex-item-view ${r??""}${a.sizeSet?" edp-scaled":""}`,style:Oe(a),children:[e.type==="text-document"&&Yt(Da,{children:[e.title&&at("h3",{className:"text-base font-semibold mb-2",children:e.title}),De(e.content)]}),e.type==="figure"&&Yt("figure",{children:[De(e.content),at("figcaption",{children:t?t(e.label):at("span",{children:e.label})})]}),e.type==="rich-block"&&Yt(Da,{children:[e.title&&at("h3",{className:"text-base font-semibold mb-2",children:e.title}),De(e.content)]})]})})}import{jsx as ch,jsxs as lh}from"react/jsx-runtime";import{useState as ph}from"react";import{jsx as bh,jsxs as yh}from"react/jsx-runtime";import{useState as vh,useCallback as wh,useMemo as kh}from"react";import{useEditor as Sh,EditorContent as Ch}from"@tiptap/react";import Nh from"@tiptap/starter-kit";import{jsx as Mh,jsxs as Lh,Fragment as Ih}from"react/jsx-runtime";import{useMemo as zh,useState as Dh}from"react";function Sr(e,{insertAt:r}={}){if(!e||typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",r==="top"&&t.firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}Sr(`:root{--ink: #1d2025;--ink-soft: #565b66;--ink-faint: #8d93a0;--ui-muted: #f5f4f1;--line: #e7e5e0;--line-strong: #d6d3cc;--ok: #1f8a4c;--ok-soft: #ecf8f0;--pen: #d23b2b;--pen-soft: #fdeeec;--almost: #c8810e;--almost-ink: #8a5a08;--almost-soft: #fbf1dc;--font-hand: "Caveat", cursive}@keyframes answer-shake{10%,90%{transform:translate(-2px)}20%,80%{transform:translate(4px)}30%,50%,70%{transform:translate(-6px)}40%,60%{transform:translate(6px)}}@keyframes hop{0%,to{transform:translateY(0) scale(1)}40%{transform:translateY(-6%) scale(1.05)}}@keyframes wobble{0%,to{transform:translate(0)}15%,85%{transform:translate(-4px)}30%,70%{transform:translate(4px)}45%,55%{transform:translate(-2px)}}.animate-shake{animation:answer-shake .4s both}.animate-hop{animation:hop .5s ease-out}.animate-wobble{animation:wobble .5s ease}.cs-player__grid{display:grid;gap:calc(.75rem * var(--edp-scale, 1));grid-template-columns:repeat(1,minmax(0,1fr))}@media(min-width:40rem){:where(.cs-player:not(.cs-player--box)) .cs-player__grid--row{grid-template-columns:repeat(2,minmax(0,1fr))}}.cs-player--box{container-type:inline-size}@container (min-width: 35.5em){.cs-player--box .cs-player__grid--row{grid-template-columns:repeat(2,minmax(0,1fr))}}.player-choice{position:relative;display:inline-flex;align-items:center;gap:calc(.75rem * var(--edp-scale, 1));flex-wrap:wrap;width:100%;padding:calc(.75rem * var(--edp-scale, 1)) calc(1rem * var(--edp-scale, 1));border:1.5px solid var(--line, #e7e5e0);border-radius:calc(.75rem * var(--edp-scale, 1));background-color:#fff;color:var(--ink, #1d2025);cursor:pointer;user-select:none;transition:border-color .15s ease,background-color .15s ease,box-shadow .15s ease;font-weight:500;text-align:start}.player-choice:hover:not(:disabled){background-color:var(--ui-muted, #f5f4f1);border-color:var(--line-strong, #d6d3cc)}.player-choice:disabled{cursor:default}.player-choice>img{flex-shrink:0}.player-choice__mark{flex:none;display:grid;place-items:center;width:calc(20px * var(--edp-scale, 1));height:calc(20px * var(--edp-scale, 1));border:1.5px solid var(--ink-faint, #8d93a0);background:#fff;color:#fff;transition:border-color .15s,background .15s}.player-choice__mark--radio{border-radius:999px}.player-choice__mark--box{border-radius:calc(6px * var(--edp-scale, 1))}.player-choice__mark>svg{width:calc(13px * var(--edp-scale, 1));height:calc(13px * var(--edp-scale, 1));opacity:0}.player-choice__text{flex:1;min-width:0}.player-choice{height:100%}.player-choice__text img,.player-choice__text video,.player-choice__text iframe{max-height:calc(120px * var(--edp-scale, 1));width:auto;max-width:100%}.player-choice--tile{flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:calc(.5rem * var(--edp-scale, 1));padding:calc(1rem * var(--edp-scale, 1)) calc(.75rem * var(--edp-scale, 1))}.player-choice--tile .player-choice__mark{position:absolute;top:calc(.5rem * var(--edp-scale, 1));inset-inline-start:calc(.5rem * var(--edp-scale, 1))}.player-choice--tile .player-choice__text{flex:0 1 auto;width:100%;text-align:center}.player-choice--tile .player-choice__text img,.player-choice--tile .player-choice__text video,.player-choice--tile .player-choice__text iframe{display:block!important;margin-inline:auto;margin-bottom:calc(.4rem * var(--edp-scale, 1))}.player-choice--selected{background-color:var(--ui-muted, #f5f4f1);border-color:var(--ink, #1d2025)}.player-choice--selected .player-choice__mark{border-color:var(--ink, #1d2025);background:var(--ink, #1d2025)}.player-choice--selected .player-choice__mark>svg{opacity:1}.player-choice--correct{background-color:var(--ok-soft, #ecf8f0);border-color:var(--ok, #1f8a4c)}.player-choice--correct .player-choice__mark{border-color:var(--ok, #1f8a4c);background:var(--ok, #1f8a4c)}.player-choice--correct .player-choice__mark>svg{opacity:1}.player-choice--correct-unchosen{background-color:#fff;border-color:var(--ok, #1f8a4c);border-style:dashed}.player-choice--correct-unchosen .player-choice__mark{border-color:var(--ok, #1f8a4c)}.player-choice--incorrect{background-color:var(--pen-soft, #fdeeec);border-color:var(--pen, #d23b2b)}.player-choice--incorrect .player-choice__mark{border-color:var(--pen, #d23b2b);background:var(--pen, #d23b2b)}.player-choice--incorrect .player-choice__mark>svg{opacity:1}.player-choice--muted{opacity:.55}.player-choice--partial{background-color:var(--ok-soft, #ecf8f0);border-color:var(--ok, #1f8a4c)}.player-choice--disabled{cursor:default}.player-choice__mark--letter{width:calc(1.625rem * var(--edp-scale, 1));height:calc(1.625rem * var(--edp-scale, 1));color:var(--ink, #1d2025);font-size:.8em;font-weight:700;line-height:1}.player-choice--selected .player-choice__mark--letter,.player-choice--correct .player-choice__mark--letter,.player-choice--incorrect .player-choice__mark--letter{color:#fff}.player-choice--correct-unchosen .player-choice__mark--letter{color:var(--ok, #1f8a4c)}.player-choice__verdict{flex:none;display:grid;place-items:center;margin-inline-start:auto}.player-choice__verdict>svg{width:calc(1.125rem * var(--edp-scale, 1));height:calc(1.125rem * var(--edp-scale, 1))}.player-choice__verdict--correct{color:var(--ok, #1f8a4c)}.player-choice__verdict--incorrect{color:var(--pen, #d23b2b)}.player-choice--tile .player-choice__verdict{position:absolute;top:calc(.5rem * var(--edp-scale, 1));inset-inline-end:calc(.5rem * var(--edp-scale, 1));margin:0}.player-inline-choice{display:inline-flex;align-items:center;gap:calc(.25rem * var(--edp-scale, 1));padding:.05em .55em;border:1.5px solid var(--line-strong, #d6d3cc);border-radius:999px;background:#fff;color:var(--ink, #1d2025);font-size:.9em;line-height:inherit;cursor:pointer;user-select:none;transition:border-color .15s,background .15s}.player-inline-choice:hover:not(:disabled){background:var(--ui-muted, #f5f4f1)}.player-inline-choice:disabled{cursor:default}.player-inline-choice--selected{border-color:var(--ink, #1d2025);background:var(--ui-muted, #f5f4f1)}.player-inline-choice--correct{border-color:var(--ok, #1f8a4c);background:var(--ok-soft, #ecf8f0)}.player-inline-choice--correct-unchosen{border-color:var(--ok, #1f8a4c);border-style:dashed}.player-inline-choice--incorrect{border-color:var(--pen, #d23b2b);background:var(--pen-soft, #fdeeec)}.player-inline-choice--muted{opacity:.55}.player-inline-choice:focus-visible{outline:2px solid var(--ink, #1d2025);outline-offset:2px}.player-blank-input{display:inline-block;min-width:3ch;padding:calc(.25rem * var(--edp-scale, 1)) calc(.5rem * var(--edp-scale, 1));border:none;border-bottom:2px solid var(--line-strong, #d6d3cc);background-color:transparent;font-size:inherit;font-family:inherit;transition:all .2s ease;outline:none}.player-blank-input:focus{border-bottom-color:var(--ink, #1d2025);background-color:var(--ui-muted, #f5f4f1)}.player-blank-input--correct{border-bottom-color:var(--ok, #1f8a4c);background-color:var(--ok-soft, #ecf8f0);color:var(--ok, #1f8a4c)}.player-blank-input--incorrect{border-bottom-color:var(--pen, #d23b2b);background-color:var(--pen-soft, #fdeeec);color:var(--pen, #d23b2b)}.player-blank-input:disabled{opacity:.7;cursor:not-allowed}.player-typed-blank{display:inline-block;min-width:7ch;max-width:100%;padding:0 calc(.25rem * var(--edp-scale, 1));font-weight:600;text-align:center;line-height:1.25;border:1px solid var(--line-strong, #d6d3cc);border-bottom-width:2px;border-radius:calc(2px * var(--edp-scale, 1));background:var(--ui-muted, #f5f4f1);color:var(--ink, #1d2025);outline:none;resize:none;overflow:hidden;vertical-align:middle}.player-typed-blank::placeholder{color:var(--ink-faint, #8d93a0);font-weight:500}.player-typed-blank:focus{border-color:var(--ink, #1d2025)}.player-typed-blank--pending{border-color:var(--ink-faint, #8d93a0);background:var(--card, #ffffff)}.player-blank-cell{display:flex;flex-wrap:wrap;align-items:center;gap:calc(.125rem * var(--edp-scale, 1)) calc(.25rem * var(--edp-scale, 1));width:100%}.player-blank-cell__box{position:relative;display:block;flex:1 1 100%;min-width:0}.player-typed-blank--cell{display:block;box-sizing:border-box;width:100%;min-width:6.5ch;padding:calc(1px * var(--edp-scale, 1)) calc(2px * var(--edp-scale, 1));font:inherit;font-weight:600;line-height:1.3;white-space:nowrap;overflow-x:hidden}.player-typed-blank-feedback--cell{display:block;box-sizing:border-box;width:max-content;min-width:100%;max-width:none;white-space:nowrap;overflow:visible}.player-blank-cell .player-blank-reveal{white-space:nowrap;font-size:.9em}.edp-table-arrows{display:flex;justify-content:flex-end}.edp-table-arrows--top{margin-bottom:calc(.375rem * var(--edp-scale, 1))}.edp-table-arrows--bottom{margin-top:calc(.375rem * var(--edp-scale, 1))}.edp-table-arrows__pair{display:inline-flex;gap:calc(.375rem * var(--edp-scale, 1))}.edp-table-arrow{display:inline-flex;align-items:center;justify-content:center;width:calc(1.875rem * var(--edp-scale, 1));height:calc(1.875rem * var(--edp-scale, 1));padding:0;border:1px solid var(--line-strong, #d6d3cc);border-radius:999px;background:var(--card, #ffffff);color:var(--ink, #1d2025);cursor:pointer;transition:border-color .15s,background .15s,opacity .15s;-webkit-tap-highlight-color:transparent}.edp-table-arrow:hover:not(:disabled){border-color:var(--ink, #1d2025);background:var(--ui-muted, #f5f4f1)}.edp-table-arrow:focus-visible{outline:2px solid var(--ink, #1d2025);outline-offset:2px}.edp-table-arrow:disabled{opacity:.35;cursor:default}.edp-table-shade{position:absolute;top:0;bottom:0;width:calc(1.5rem * var(--edp-scale, 1));pointer-events:none;z-index:2}.edp-table-shade--left{background:linear-gradient(to right,#1d202529,#1d202500)}.edp-table-shade--right{background:linear-gradient(to left,#1d202529,#1d202500)}@media(max-width:640px){.edp-table-first{max-width:38vw}}.player-typed-blank-feedback{display:inline-block;min-width:2ch;max-width:100%;padding:0 calc(.25rem * var(--edp-scale, 1));font-weight:600;text-align:center;line-height:1.25;border:1px solid var(--line-strong, #d6d3cc);border-bottom-width:2px;border-radius:calc(2px * var(--edp-scale, 1));overflow-x:auto;cursor:default;vertical-align:middle}.player-typed-blank-feedback--correct{border-color:var(--ok, #1f8a4c);background:var(--ok-soft, #ecf8f0);color:var(--ok, #1f8a4c)}.player-typed-blank-feedback--partial{border-color:var(--ok, #1f8a4c);border-style:dashed;background:var(--ok-soft, #ecf8f0);color:var(--ok, #1f8a4c)}.player-typed-blank-feedback--incorrect{border-color:var(--pen, #d23b2b);background:var(--pen-soft, #fdeeec);color:var(--pen, #d23b2b);text-decoration:line-through}.player-typed-blank-spinner{display:inline-block;width:calc(.75rem * var(--edp-scale, 1));height:calc(.75rem * var(--edp-scale, 1));border:2px solid var(--ink-faint, #8d93a0);border-top-color:transparent;border-radius:999px;animation:blank-spin .7s linear infinite}@keyframes blank-spin{to{transform:rotate(360deg)}}.player-blank-reveal{font-weight:700;color:var(--ok, #1f8a4c);font-size:.875em;word-break:break-word;min-width:0}.player-blank-feedback{display:inline-block;font-size:.8em;font-weight:500;line-height:1.3;padding:calc(2px * var(--edp-scale, 1)) calc(8px * var(--edp-scale, 1));border-radius:999px;word-break:break-word;min-width:0;background:var(--ui-muted, #f5f4f1);color:var(--ink-soft, #565b66)}.player-blank-feedback--correct{background:var(--ok-soft, #ecf8f0);color:var(--ok, #1f8a4c)}.player-blank-feedback--incorrect{background:var(--pen-soft, #fdeeec);color:var(--pen, #d23b2b)}.player-blank-hint-btn{width:calc(1rem * var(--edp-scale, 1));height:calc(1rem * var(--edp-scale, 1));border:0;border-radius:999px;background:#fbbf24;color:#fff;font-size:calc(10px * var(--edp-scale, 1));font-weight:700;line-height:1;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;transition:background .12s}.player-blank-hint-btn:hover,.player-blank-hint-btn--pinned{background:#f59e0b}.player-blank-hint-pop{position:absolute;bottom:100%;left:50%;transform:translate(-50%);margin-bottom:calc(.5rem * var(--edp-scale, 1));z-index:9999;min-width:calc(180px * var(--edp-scale, 1));max-width:calc(300px * var(--edp-scale, 1));width:max-content;background:#fffbeb;border:1px solid #fde68a;border-radius:calc(14px * var(--edp-scale, 1));box-shadow:0 8px 24px #92400e2e;padding:calc(.5rem * var(--edp-scale, 1)) calc(.75rem * var(--edp-scale, 1));font-size:calc(.875rem * var(--edp-scale, 1));color:#78350f}.matching-player-hintrow{display:flex;justify-content:flex-start;margin-bottom:calc(.4rem * var(--edp-scale, 1))}.player-choice-blank{display:inline-flex;align-items:center;justify-content:center;min-width:4ch;padding:calc(.1rem * var(--edp-scale, 1)) calc(.5rem * var(--edp-scale, 1));border:2px dashed var(--line-strong, #d6d3cc);border-radius:calc(.5rem * var(--edp-scale, 1));color:var(--ink-faint, #8d93a0);background:transparent;transition:border-color .15s,background .15s,transform .15s,color .15s;vertical-align:middle}.player-choice-blank--target{border-color:var(--ink, #1d2025);background:var(--ui-muted, #f5f4f1)}.player-choice-blank--over{border-style:solid;border-color:var(--ink, #1d2025);background:var(--ui-muted, #f5f4f1);transform:scale(1.05)}.player-choice-blank--filled{border-style:solid;border-color:var(--ink, #1d2025);background:var(--ui-muted, #f5f4f1);color:var(--ink, #1d2025);cursor:pointer}.player-choice-blank--correct,.player-choice-blank--partial{border-style:solid;border-color:var(--ok, #1f8a4c);background:var(--ok-soft, #ecf8f0);color:var(--ok, #1f8a4c)}.player-choice-blank--incorrect{border-style:solid;border-color:var(--pen, #d23b2b);background:var(--pen-soft, #fdeeec);color:var(--pen, #d23b2b)}.player-choice-blank__clear{margin-inline-start:calc(.25rem * var(--edp-scale, 1));opacity:0;font-size:calc(.75rem * var(--edp-scale, 1));line-height:1;transition:opacity .12s}.player-choice-blank--filled:hover .player-choice-blank__clear{opacity:.6}.player-word-bank{margin:calc(1rem * var(--edp-scale, 1)) 0;position:relative;border:1px solid var(--line, #e7e5e0);border-radius:calc(14px * var(--edp-scale, 1));background:var(--ui-muted, #f5f4f1);padding:calc(.75rem * var(--edp-scale, 1)) calc(1rem * var(--edp-scale, 1))}.player-word-bank__label{margin-bottom:calc(.5rem * var(--edp-scale, 1));font-size:.7em;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--ink-soft, #565b66);user-select:none}.player-word-bank__items{display:flex;flex-wrap:wrap;gap:calc(.5rem * var(--edp-scale, 1))}.player-word-bank__items--grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(calc(10rem * var(--edp-scale, 1)),1fr));gap:calc(.5rem * var(--edp-scale, 1))}.player-bank-pill{display:inline-block;padding:calc(.35rem * var(--edp-scale, 1)) calc(.75rem * var(--edp-scale, 1));border:1px solid var(--line-strong, #d6d3cc);border-radius:999px;background:var(--card, #ffffff);color:var(--ink, #1d2025);user-select:none;-webkit-touch-callout:none;touch-action:manipulation;cursor:grab;transition:border-color .15s,background .15s,box-shadow .15s}.player-bank-pill:hover{border-color:var(--ink, #1d2025);background:var(--ui-muted, #f5f4f1)}.player-bank-pill--dragging{opacity:.5;cursor:grabbing;box-shadow:0 8px 24px #1d20252e}.player-bank-pill--hinted{position:relative}.player-tap-hint{position:absolute;left:calc(50% - 10px * var(--edp-scale, 1));top:50%;width:calc(30px * var(--edp-scale, 1));height:calc(30px * var(--edp-scale, 1));z-index:2;pointer-events:none;color:var(--ink, #1d2025)}.player-tap-hint__hand{display:block;width:100%;height:100%;opacity:.92;filter:drop-shadow(0 2px 3px rgba(29,32,37,.25));transform-origin:33% 8%;animation:edp-tap-hand 1.8s ease-in-out infinite}.player-tap-hint__ripple{position:absolute;left:calc(10px * var(--edp-scale, 1) - 11px);top:-11px;width:22px;height:22px;border-radius:999px;border:2px solid var(--ink, #1d2025);opacity:0;animation:edp-tap-ripple 1.8s ease-out infinite}@keyframes edp-tap-hand{0%,to{transform:translateY(12px)}30%{transform:translateY(0) scale(1)}38%{transform:translateY(1px) scale(.88)}48%{transform:translateY(0) scale(1)}75%{transform:translateY(12px)}}@keyframes edp-tap-ripple{0%,34%{opacity:0;transform:scale(.4)}40%{opacity:.45;transform:scale(.6)}70%{opacity:0;transform:scale(1.5)}to{opacity:0}}.player-tap-hint--still .player-tap-hint__hand,.player-tap-hint--still .player-tap-hint__ripple{animation:none}@media(prefers-reduced-motion:reduce){.player-tap-hint__hand,.player-tap-hint__ripple{animation:none}}.exercise-runtime{font-family:var(--brand-font, "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", sans-serif);font-size:calc(1.25rem * var(--edp-scale, 1));line-height:1.6;color:#1f2937}.exercise-runtime input,.exercise-runtime textarea{font-family:inherit}@media(min-width:640px){.exercise-runtime{font-size:calc(1.5rem * var(--edp-scale, 1))}}@media(min-width:768px){.exercise-runtime{font-size:calc(1.5rem * var(--edp-scale, 1))}}@media(min-width:1024px){.exercise-runtime{font-size:calc(2.25rem * var(--edp-scale, 1))}}@media(min-width:1280px){.exercise-runtime{font-size:calc(2.25rem * var(--edp-scale, 1))}}.exercise-runtime :lang(ar),.exercise-runtime [lang=ar],.exercise-runtime [dir=rtl]{direction:rtl;font-family:Arial,Scheherazade New,Amiri,sans-serif;text-align:right}.exercise-runtime p{margin:.5em 0;min-height:1.5em}.exercise-runtime p:empty:after{content:"\\a0";display:inline-block;min-height:1em}.exercise-runtime strong{font-weight:600;color:inherit}.exercise-runtime em{font-style:italic}.exercise-runtime ul,.exercise-runtime ol{list-style:revert;margin-left:calc(1.25rem * var(--edp-scale, 1));padding-left:0}.exercise-runtime img{max-width:100%;height:auto;vertical-align:middle;display:inline-block;margin:0 calc(4px * var(--edp-scale, 1))}.exercise-runtime .inline-math{display:inline-block;vertical-align:middle;margin:0 calc(2px * var(--edp-scale, 1))}.exercise-runtime .math-formula{display:flex;justify-content:center;margin:1em 0}.choice-set-player{margin:calc(1rem * var(--edp-scale, 1)) 0}.choice-set-player__prompt{font-weight:600;margin-bottom:calc(.75rem * var(--edp-scale, 1));color:#374151}.choice-set-player__prompt-hint{margin-left:calc(.5rem * var(--edp-scale, 1));font-size:calc(.875rem * var(--edp-scale, 1));opacity:.7;font-weight:400}.choice-set-player__choices{display:flex;flex-direction:column;gap:calc(.75rem * var(--edp-scale, 1))}.choice-set-player__choices--grid{display:grid;gap:calc(.75rem * var(--edp-scale, 1));grid-template-columns:1fr}@media(min-width:640px){.choice-set-player__choices--grid{grid-template-columns:repeat(2,1fr)}}.choice-set-player--inline{display:inline-flex;align-items:center;gap:calc(.5rem * var(--edp-scale, 1));flex-wrap:wrap}.choice-set-player--inline .player-choice{width:auto;padding:calc(.5rem * var(--edp-scale, 1)) calc(1rem * var(--edp-scale, 1))}.player-choice:focus-visible{outline:2px solid var(--ink, #1d2025);outline-offset:2px}.player-blank-input:focus-visible{outline:2px solid #3b82f6;outline-offset:2px}@media(prefers-contrast:high){.player-choice{border-width:3px}.player-choice--correct{border-color:#15803d}.player-choice--incorrect{border-color:#991b1b}}@media(prefers-reduced-motion:reduce){.animate-shake,.animate-hop,.animate-wobble{animation:none}.player-choice{transition:none}}@media print{.exercise-runtime{font-size:12pt;color:#000}.player-choice{border:1px solid black;background-color:#fff;page-break-inside:avoid}.player-choice--correct:after{content:" \\2713";font-weight:700}.player-choice--incorrect:after{content:" \\2717";font-weight:700}}.matching-player{margin:calc(1rem * var(--edp-scale, 1)) 0}.matching-player-feedback{display:flex;align-items:center;gap:calc(.45rem * var(--edp-scale, 1));margin-top:calc(.6rem * var(--edp-scale, 1));padding:calc(.55rem * var(--edp-scale, 1)) calc(.75rem * var(--edp-scale, 1));border:1px solid var(--line, #e7e5e0);border-radius:calc(.625rem * var(--edp-scale, 1));font-size:calc(.85rem * var(--edp-scale, 1));font-weight:600}.matching-player-feedback--correct{color:var(--ok, #1f8a4c);border-color:var(--ok, #1f8a4c);background:var(--ok-soft, #ecf8f0)}.matching-player-feedback--partial{color:var(--almost-ink, #8a5a08);border-color:var(--almost, #c8810e);background:var(--almost-soft, #fbf1dc)}.matching-player-feedback--incorrect{color:var(--pen, #d23b2b);border-color:var(--pen, #d23b2b);background:var(--pen-soft, #fdeeec)}.matching-player-score{margin-inline-start:auto;font-family:var(--font-hand, "Caveat", cursive);font-size:calc(1.5rem * var(--edp-scale, 1));line-height:1}.matching-player__instruction{display:none}.matching-player__arena{position:relative;display:flex;flex-direction:column;gap:calc(.5rem * var(--edp-scale, 1))}.matching-player__arena--dragging{user-select:none;touch-action:none}.matching-player__svg{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;overflow:visible;z-index:1}.matching-player__columns{display:grid;grid-template-columns:1fr 1fr;gap:calc(5rem * var(--edp-scale, 1));align-items:start;position:relative}.matching-player__column{display:flex;flex-direction:column;gap:calc(.5rem * var(--edp-scale, 1))}.matching-player__item{display:flex;align-items:center;flex-wrap:wrap;gap:calc(.5rem * var(--edp-scale, 1));width:100%;padding:calc(.75rem * var(--edp-scale, 1)) calc(1rem * var(--edp-scale, 1));border:2px solid var(--line, #e7e5e0);border-radius:calc(.625rem * var(--edp-scale, 1));background:var(--card, #ffffff);text-align:left;transition:border-color .15s,background .15s,box-shadow .15s,transform .1s;font-size:inherit;font-family:inherit;color:var(--ink, #1d2025);min-height:calc(52px * var(--edp-scale, 1));user-select:none;-webkit-tap-highlight-color:transparent}.matching-player__item:not(.matching-player__item--disabled){cursor:grab}.matching-player__item:not(.matching-player__item--disabled):active{cursor:grabbing}.matching-player__item:hover:not(.matching-player__item--disabled){border-color:var(--line-strong, #d6d3cc);background:var(--ui-muted, #f5f4f1)}.matching-player__item--selected{border-color:var(--ink, #1d2025)!important;background:var(--ui-muted, #f5f4f1)!important;box-shadow:0 0 0 3px #1d20251f;transform:scale(1.02)}.matching-player__item--available{border-color:var(--ink-faint, #8d93a0);border-style:dashed}.matching-player__item--available:hover{border-color:var(--ink, #1d2025);border-style:solid;background:var(--ui-muted, #f5f4f1)}.matching-player__item--matched{border-width:2px;border-color:var(--ink, #1d2025)}.matching-player__item--matched:hover:not(.matching-player__item--disabled){background:var(--ui-muted, #f5f4f1)}.matching-player__item--correct,.matching-player__item--correct:hover{border-color:var(--ok, #1f8a4c)!important;background:var(--ok-soft, #ecf8f0)!important}.matching-player__item--incorrect,.matching-player__item--incorrect:hover{border-color:var(--pen, #d23b2b)!important;background:var(--pen-soft, #fdeeec)!important}.matching-player__item--disabled{cursor:default;pointer-events:none}.matching-player__item-text{flex:1;min-width:0;line-height:1.4}.matching-player__item-text p{margin:0}.matching-player__pair-num{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:calc(22px * var(--edp-scale, 1));height:calc(22px * var(--edp-scale, 1));border-radius:50%;font-size:calc(.7rem * var(--edp-scale, 1));font-weight:700;line-height:1;background:var(--ink, #1d2025);color:#fff}.matching-player__item--correct .matching-player__pair-num{background:var(--ok, #1f8a4c)}.matching-player__item--incorrect .matching-player__pair-num{background:var(--pen, #d23b2b)}.matching-player__connector{flex-shrink:0;color:var(--ink-faint, #8d93a0);display:flex;align-items:center;transition:color .2s,transform .2s;border-radius:50%}.matching-player__item:hover .matching-player__connector{color:var(--ink, #1d2025);transform:scale(1.25)}.matching-player__connector--left{order:10;margin-left:calc(6px * var(--edp-scale, 1))}.matching-player__connector--right{order:-1;margin-right:calc(6px * var(--edp-scale, 1))}.matching-player__connector svg{width:calc(18px * var(--edp-scale, 1));height:calc(18px * var(--edp-scale, 1))}.matching-player__correct-hint{width:100%;order:20;font-weight:700;color:var(--ok, #1f8a4c);font-size:.82em;line-height:1.4;padding-top:.1em;word-break:break-word}.matching-player__correct-hint p{display:inline;margin:0}.matching-player__item:focus-visible{outline:3px solid var(--ink, #1d2025);outline-offset:2px}.blank-correct-hint{display:inline;font-weight:700;color:var(--ok, #1f8a4c);font-size:.875em;margin-left:.3em;word-break:break-word}@keyframes matching-pulse{0%{opacity:.5}to{opacity:1}}@media(prefers-reduced-motion:reduce){.matching-player__item{transition:none}}@media(max-width:600px){:where(.matching-player:not(.matching-player--box)) .matching-player__columns{gap:calc(1rem * var(--edp-scale, 1))}:where(.matching-player:not(.matching-player--box)) .matching-player__item{padding:calc(.5rem * var(--edp-scale, 1)) calc(.6rem * var(--edp-scale, 1));min-height:calc(44px * var(--edp-scale, 1));font-size:calc(.875rem * var(--edp-scale, 1));gap:calc(.35rem * var(--edp-scale, 1))}.matching-player__item:not(.matching-player__item--disabled){cursor:pointer}.matching-player__item:not(.matching-player__item--disabled):active{cursor:pointer}:where(.matching-player:not(.matching-player--box)) .matching-player__connector svg{width:calc(15px * var(--edp-scale, 1));height:calc(15px * var(--edp-scale, 1))}}.matching-player--box{container-type:inline-size}@container (max-width: 33.3em){.matching-player--box .matching-player__columns{gap:calc(1rem * var(--edp-scale, 1))}.matching-player--box .matching-player__item{padding:calc(.5rem * var(--edp-scale, 1)) calc(.6rem * var(--edp-scale, 1));min-height:calc(44px * var(--edp-scale, 1));font-size:calc(.875rem * var(--edp-scale, 1));gap:calc(.35rem * var(--edp-scale, 1))}.matching-player--box .matching-player__connector svg{width:calc(15px * var(--edp-scale, 1));height:calc(15px * var(--edp-scale, 1))}}.math-response-player{margin:calc(.5rem * var(--edp-scale, 1)) 0}.player-math-field{border:2px solid var(--line, #e7e5e0);border-radius:calc(.625rem * var(--edp-scale, 1));padding:calc(.375rem * var(--edp-scale, 1)) calc(.5rem * var(--edp-scale, 1));background:var(--card, #ffffff);transition:border-color .2s ease,background .2s ease}.player-math-field:focus-within{border-color:var(--ink, #1d2025)}.player-math-field--readonly{background:var(--ui-muted, #f5f4f1)}.player-math-field__input{width:100%;min-height:calc(2.5rem * var(--edp-scale, 1));font-size:calc(1.1rem * var(--edp-scale, 1));outline:none;--primary: var(--ink, #1d2025);--caret-color: var(--ink, #1d2025);--selection-background-color: var(--ink-soft, #565b66);--contains-highlight-background-color: var(--ui-muted, #f5f4f1)}.player-math-field__input::part(virtual-keyboard-toggle),.player-math-field__input::part(menu-toggle){color:var(--ink-faint, #8d93a0)}.player-math-field__fallback{width:100%;border:none;outline:none;font-size:calc(1rem * var(--edp-scale, 1));font-family:monospace;background:transparent;color:var(--ink, #1d2025)}.player-math-field--correct{border-color:var(--ok, #1f8a4c);background:var(--ok-soft, #ecf8f0)}.player-math-field--incorrect{border-color:var(--pen, #d23b2b);background:var(--pen-soft, #fdeeec)}.player-math-field--validating{border-color:var(--ink-faint, #8d93a0)}.player-math-feedback{margin-top:calc(.4rem * var(--edp-scale, 1));font-size:calc(.8rem * var(--edp-scale, 1));font-weight:600;display:flex;align-items:center;gap:calc(.4rem * var(--edp-scale, 1))}.player-math-feedback--correct{color:var(--ok, #1f8a4c)}.player-math-feedback--incorrect{color:var(--pen, #d23b2b)}.player-math-feedback--validating{color:var(--ink-soft, #565b66)}.player-math-score{margin-inline-start:auto;font-family:var(--font-hand, "Caveat", cursive);font-size:calc(1.5rem * var(--edp-scale, 1));line-height:1;color:var(--ok, #1f8a4c)}.player-math-spinner{display:inline-block;width:calc(.9rem * var(--edp-scale, 1));height:calc(.9rem * var(--edp-scale, 1));border:2px solid var(--ink-faint, #8d93a0);border-top-color:transparent;border-radius:50%;animation:player-math-spin .7s linear infinite}@keyframes player-math-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.player-math-spinner{animation:none}}.player-ai{margin:calc(1rem * var(--edp-scale, 1)) 0;padding:calc(.5rem * var(--edp-scale, 1));display:flex;flex-direction:column;gap:calc(.75rem * var(--edp-scale, 1));border:1px solid var(--line, #e7e5e0);border-radius:calc(.875rem * var(--edp-scale, 1));background:var(--ui-muted, #f5f4f1)}.player-ai-counts{display:flex;justify-content:flex-end;gap:calc(.5rem * var(--edp-scale, 1))}.player-ai-count{font-size:calc(.75rem * var(--edp-scale, 1));font-weight:600;padding:calc(.1rem * var(--edp-scale, 1)) calc(.5rem * var(--edp-scale, 1));border-radius:999px;background:var(--card, #ffffff);border:1px solid var(--line, #e7e5e0);color:var(--ink-soft, #565b66)}.player-ai-count--over{color:var(--pen, #d23b2b);border-color:var(--pen, #d23b2b)}.player-ai-count--min{color:var(--ink-faint, #8d93a0)}.player-ai-input{width:100%;box-sizing:border-box;padding:calc(.5rem * var(--edp-scale, 1)) calc(.75rem * var(--edp-scale, 1));font-size:calc(1rem * var(--edp-scale, 1));border:1px solid var(--line-strong, #d6d3cc);border-radius:calc(.625rem * var(--edp-scale, 1));background:var(--card, #ffffff);color:var(--ink, #1d2025);outline:none;transition:border-color .2s ease,background .2s ease}.player-ai-input::placeholder{color:var(--ink-faint, #8d93a0)}.player-ai-input:focus{border-color:var(--ink, #1d2025)}.player-ai-input--multiline{min-height:calc(120px * var(--edp-scale, 1));resize:vertical}.player-ai-input:disabled{cursor:default}.player-ai-input--correct{border-color:var(--ok, #1f8a4c);background:var(--ok-soft, #ecf8f0)}.player-ai-input--partial{border-color:var(--almost, #c8810e);border-style:dashed;background:var(--almost-soft, #fbf1dc)}.player-ai-input--incorrect{border-color:var(--pen, #d23b2b);background:var(--pen-soft, #fdeeec)}.player-ai-feedback{display:flex;flex-direction:column;gap:calc(.25rem * var(--edp-scale, 1));padding:calc(.75rem * var(--edp-scale, 1));border-radius:calc(.5rem * var(--edp-scale, 1));font-size:calc(.875rem * var(--edp-scale, 1));border:1px solid var(--line, #e7e5e0);background:var(--card, #ffffff);color:var(--ink, #1d2025)}.player-ai-feedback--correct{border-color:var(--ok, #1f8a4c);background:var(--ok-soft, #ecf8f0);color:var(--ok, #1f8a4c)}.player-ai-feedback--partial{border-color:var(--almost, #c8810e);background:var(--almost-soft, #fbf1dc);color:var(--almost-ink, #8a5a08)}.player-ai-feedback--incorrect{border-color:var(--pen, #d23b2b);background:var(--pen-soft, #fdeeec);color:var(--pen, #d23b2b)}.player-ai-message{margin:0}.player-ai-score-row{display:flex;justify-content:flex-end}.player-ai-score{font-family:var(--font-hand, "Caveat", cursive);font-size:calc(1.5rem * var(--edp-scale, 1));font-weight:600;line-height:1;padding:0 calc(.35rem * var(--edp-scale, 1));color:inherit}.player-ai-validating{display:flex;align-items:center;gap:calc(.5rem * var(--edp-scale, 1));padding:calc(.25rem * var(--edp-scale, 1)) 0;color:var(--ink-soft, #565b66)}.player-ai-spinner{display:inline-block;width:calc(.9rem * var(--edp-scale, 1));height:calc(.9rem * var(--edp-scale, 1));border:2px solid var(--ink-faint, #8d93a0);border-top-color:transparent;border-radius:999px;animation:ai-answer-spin .7s linear infinite}@keyframes ai-answer-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.player-ai-spinner{animation:none}}.player-or-field--pre{border-color:var(--line-strong, #d6d3cc)!important}.player-or-field--correct{border-color:var(--ok, #1f8a4c)!important;background:var(--ok-soft, #ecf8f0)!important}.player-or-field--partial,.player-or-field--review{border-color:var(--almost, #c8810e)!important;background:var(--almost-soft, #fbf1dc)!important}.player-or-field--review{border-style:dashed!important}.player-or-field--incorrect{border-color:var(--pen, #d23b2b)!important;background:var(--pen-soft, #fdeeec)!important}.edp-scaled .text-xs{font-size:calc(.75rem * var(--edp-scale, 1));line-height:calc(1 / .75)}.edp-scaled .text-sm{font-size:calc(.875rem * var(--edp-scale, 1));line-height:calc(1.25 / .875)}.edp-scaled .text-base{font-size:calc(1rem * var(--edp-scale, 1));line-height:1.5}.edp-scaled .text-lg{font-size:calc(1.125rem * var(--edp-scale, 1));line-height:calc(1.75 / 1.125)}.edp-scaled .text-\\[10px\\]{font-size:calc(10px * var(--edp-scale, 1))}.edp-scaled .prose-sm{font-size:calc(.875rem * var(--edp-scale, 1))}.edp-scaled .p-2{padding:calc(.5rem * var(--edp-scale, 1))}.edp-scaled .p-3{padding:calc(.75rem * var(--edp-scale, 1))}.edp-scaled .p-4{padding:calc(1rem * var(--edp-scale, 1))}.edp-scaled .p-6{padding:calc(1.5rem * var(--edp-scale, 1))}.edp-scaled .pb-1{padding-bottom:calc(.25rem * var(--edp-scale, 1))}.edp-scaled .pt-1\\.5{padding-top:calc(.375rem * var(--edp-scale, 1))}.edp-scaled .px-1\\.5{padding-left:calc(.375rem * var(--edp-scale, 1));padding-right:calc(.375rem * var(--edp-scale, 1))}.edp-scaled .px-2{padding-left:calc(.5rem * var(--edp-scale, 1));padding-right:calc(.5rem * var(--edp-scale, 1))}.edp-scaled .px-3{padding-left:calc(.75rem * var(--edp-scale, 1));padding-right:calc(.75rem * var(--edp-scale, 1))}.edp-scaled .px-4{padding-left:calc(1rem * var(--edp-scale, 1));padding-right:calc(1rem * var(--edp-scale, 1))}.edp-scaled .px-5{padding-left:calc(1.25rem * var(--edp-scale, 1));padding-right:calc(1.25rem * var(--edp-scale, 1))}.edp-scaled .px-6{padding-left:calc(1.5rem * var(--edp-scale, 1));padding-right:calc(1.5rem * var(--edp-scale, 1))}.edp-scaled .py-0\\.5{padding-top:calc(.125rem * var(--edp-scale, 1));padding-bottom:calc(.125rem * var(--edp-scale, 1))}.edp-scaled .py-1{padding-top:calc(.25rem * var(--edp-scale, 1));padding-bottom:calc(.25rem * var(--edp-scale, 1))}.edp-scaled .py-1\\.5{padding-top:calc(.375rem * var(--edp-scale, 1));padding-bottom:calc(.375rem * var(--edp-scale, 1))}.edp-scaled .py-2{padding-top:calc(.5rem * var(--edp-scale, 1));padding-bottom:calc(.5rem * var(--edp-scale, 1))}.edp-scaled .py-3{padding-top:calc(.75rem * var(--edp-scale, 1));padding-bottom:calc(.75rem * var(--edp-scale, 1))}.edp-scaled .mb-1{margin-bottom:calc(.25rem * var(--edp-scale, 1))}.edp-scaled .mb-2{margin-bottom:calc(.5rem * var(--edp-scale, 1))}.edp-scaled .ml-1{margin-left:calc(.25rem * var(--edp-scale, 1))}.edp-scaled .ml-2{margin-left:calc(.5rem * var(--edp-scale, 1))}.edp-scaled .mr-2{margin-right:calc(.5rem * var(--edp-scale, 1))}.edp-scaled .mt-0\\.5{margin-top:calc(.125rem * var(--edp-scale, 1))}.edp-scaled .mt-1{margin-top:calc(.25rem * var(--edp-scale, 1))}.edp-scaled .mt-1\\.5{margin-top:calc(.375rem * var(--edp-scale, 1))}.edp-scaled .mt-3{margin-top:calc(.75rem * var(--edp-scale, 1))}.edp-scaled .mx-1{margin-left:calc(.25rem * var(--edp-scale, 1));margin-right:calc(.25rem * var(--edp-scale, 1))}.edp-scaled .my-3{margin-top:calc(.75rem * var(--edp-scale, 1));margin-bottom:calc(.75rem * var(--edp-scale, 1))}.edp-scaled .my-4{margin-top:calc(1rem * var(--edp-scale, 1));margin-bottom:calc(1rem * var(--edp-scale, 1))}.edp-scaled .gap-1{gap:calc(.25rem * var(--edp-scale, 1))}.edp-scaled .gap-1\\.5{gap:calc(.375rem * var(--edp-scale, 1))}.edp-scaled .gap-2{gap:calc(.5rem * var(--edp-scale, 1))}.edp-scaled .gap-3{gap:calc(.75rem * var(--edp-scale, 1))}.edp-scaled .gap-x-1{column-gap:calc(.25rem * var(--edp-scale, 1))}.edp-scaled .gap-y-0\\.5{row-gap:calc(.125rem * var(--edp-scale, 1))}.edp-scaled .w-6{width:calc(1.5rem * var(--edp-scale, 1))}.edp-scaled .w-16{width:calc(4rem * var(--edp-scale, 1))}.edp-scaled .h-6{height:calc(1.5rem * var(--edp-scale, 1))}.edp-scaled .h-8{height:calc(2rem * var(--edp-scale, 1))}.edp-scaled .h-16{height:calc(4rem * var(--edp-scale, 1))}.edp-scaled .max-h-48{max-height:calc(12rem * var(--edp-scale, 1))}.edp-scaled .right-1{right:calc(.25rem * var(--edp-scale, 1))}.edp-scaled .right-3{right:calc(.75rem * var(--edp-scale, 1))}.edp-scaled .bottom-2{bottom:calc(.5rem * var(--edp-scale, 1))}.edp-scaled .max-w-\\[160px\\]{max-width:calc(160px * var(--edp-scale, 1))}.edp-scaled .max-w-\\[200px\\]{max-width:calc(200px * var(--edp-scale, 1))}.edp-scaled .max-w-\\[240px\\]{max-width:calc(240px * var(--edp-scale, 1))}.edp-scaled .min-h-\\[100px\\]{min-height:calc(100px * var(--edp-scale, 1))}.edp-scaled .min-h-\\[120px\\]{min-height:calc(120px * var(--edp-scale, 1))}.edp-scaled .\\[\\&_\\.ProseMirror\\]\\:min-h-\\[80px\\] .ProseMirror{min-height:calc(80px * var(--edp-scale, 1))}.math-inline,.math-block,.math-response-player,.katex,.katex-display{direction:ltr;unicode-bidi:isolate}.exercise-shared-context{font-size:calc(1.125rem * var(--edp-scale, 1));margin-bottom:calc(1rem * var(--edp-scale, 1))}.exercise-reference-cue{display:flex;flex-wrap:wrap;align-items:baseline;gap:calc(.25rem * var(--edp-scale, 1)) calc(.5rem * var(--edp-scale, 1));margin:0 0 calc(1rem * var(--edp-scale, 1));padding:calc(.625rem * var(--edp-scale, 1)) calc(.875rem * var(--edp-scale, 1));border:1px solid var(--line, #e7e5e0);border-inline-start:3px solid var(--ink-soft, #565b66);border-radius:calc(.625rem * var(--edp-scale, 1));background:var(--ui-muted, #f5f4f1);color:var(--ink-soft, #565b66);font-size:calc(1rem * var(--edp-scale, 1));line-height:1.5}.exercise-reference-cue__link{font:inherit;font-weight:600;color:var(--ink, #1d2025);background:none;border:0;padding:0;cursor:pointer;text-decoration:underline;text-underline-offset:3px}.exercise-reference-cue__link:hover{text-decoration-thickness:2px}.exercise-reference-cue__link:focus-visible{outline:2px solid var(--ink, #1d2025);outline-offset:2px;border-radius:2px}.exercise-reference-cue__arrow{display:inline-block;margin-inline-start:.25em}.exercise-reference-cue__arrow:dir(rtl){transform:scaleX(-1)}.edp-audio{--edp-a: var(--edp-scale, 1);display:flex;flex-direction:column;gap:calc(.25rem * var(--edp-a));width:100%;max-width:100%;margin:calc(.5rem * var(--edp-a)) 0;font-size:calc(.875rem * var(--edp-a));line-height:1.4;vertical-align:middle}.edp-audio-bar{display:flex;align-items:center;gap:calc(.75rem * var(--edp-a));min-width:0;padding:calc(.375rem * var(--edp-a));padding-inline-end:calc(.75rem * var(--edp-a));background:#fff;border:1px solid var(--line, #e7e5e0);border-radius:999px}.edp-audio-play{flex:none;display:inline-flex;align-items:center;justify-content:center;width:calc(2.75rem * var(--edp-a));height:calc(2.75rem * var(--edp-a));border:0;border-radius:999px;background:var(--ink, #1d2025);color:#fff;cursor:pointer;transition:transform 90ms ease-out,background-color .18s ease-out}.edp-audio-play:hover:not(:disabled){background:#33373e}.edp-audio-play:active:not(:disabled){transform:scale(.94)}.edp-audio-play:focus-visible,.edp-audio-speed:focus-visible,.edp-audio-track:focus-visible{outline:2px solid var(--ink, #1d2025);outline-offset:2px}.edp-audio-play:disabled{background:var(--line-strong, #d6d3cc);cursor:not-allowed}.edp-audio-play svg{width:calc(1.125rem * var(--edp-a));height:calc(1.125rem * var(--edp-a))}.edp-audio-track{position:relative;flex:1 1 auto;min-width:calc(3rem * var(--edp-a));height:calc(2rem * var(--edp-a));display:flex;align-items:center;touch-action:none;border-radius:4px}.edp-audio-track--seek{cursor:pointer}.edp-audio-rail{position:relative;display:block;width:100%;height:4px;border-radius:999px;background:var(--line, #e7e5e0);overflow:hidden}.edp-audio-fill{position:absolute;inset-block:0;inset-inline-start:0;background:var(--ink, #1d2025);border-radius:999px}.edp-audio-thumb{position:absolute;top:50%;width:12px;height:12px;margin-inline-start:-6px;margin-top:-6px;border-radius:999px;background:var(--ink, #1d2025);box-shadow:0 0 0 3px #fff;transition:transform .15s ease-out;pointer-events:none}.edp-audio-track--seek:hover .edp-audio-thumb,.edp-audio-track--seek:focus-visible .edp-audio-thumb{transform:scale(1.25)}.edp-audio-time{flex:none;min-width:2.6em;text-align:end;font-variant-numeric:tabular-nums;color:var(--ink-soft, #565b66);unicode-bidi:isolate}.edp-audio-speed{flex:none;min-width:3.1em;height:calc(1.75rem * var(--edp-a));padding:0 .5em;border:1px solid var(--line-strong, #d6d3cc);border-radius:999px;background:var(--ui-muted, #f5f4f1);color:var(--ink, #1d2025);font:inherit;font-size:.85em;font-weight:600;font-variant-numeric:tabular-nums;cursor:pointer;transition:border-color .18s ease-out}.edp-audio-speed:hover:not(:disabled){border-color:var(--ink-faint, #8d93a0)}.edp-audio-speed:active:not(:disabled){transform:scale(.97)}.edp-audio-note{display:block;margin:0;padding-inline-start:calc(.75rem * var(--edp-a));font-size:.9em;color:var(--ink-soft, #565b66)}.edp-audio--off .edp-audio-bar{background:var(--ui-muted, #f5f4f1)}.edp-audio--off .edp-audio-fill{background:var(--ink-faint, #8d93a0)}@media(max-width:380px){.edp-audio-bar{gap:calc(.5rem * var(--edp-a))}}@media(pointer:coarse){.edp-audio-speed{height:calc(2.5rem * var(--edp-a));min-width:3.6em}}.edp-rec{--edp-a: var(--edp-scale, 1);display:flex;flex-direction:column;gap:calc(.75rem * var(--edp-a));padding:calc(1rem * var(--edp-a));border:1px solid var(--line, #e7e5e0);border-radius:14px;background:#fff;font-size:calc(.9375rem * var(--edp-a));line-height:1.4}.edp-rec .edp-audio{margin:0}.edp-rec-idle{display:flex;flex-direction:column;align-items:center;gap:calc(.5rem * var(--edp-a));padding:calc(.5rem * var(--edp-a)) 0}.edp-rec-record{display:inline-flex;align-items:center;justify-content:center;width:calc(4rem * var(--edp-a));height:calc(4rem * var(--edp-a));border:0;border-radius:999px;background:var(--pen, #d23b2b);color:#fff;cursor:pointer;box-shadow:0 0 0 5px var(--pen-soft, #fdeeec);transition:transform 90ms ease-out,box-shadow .18s ease-out}.edp-rec-record:hover:not(:disabled){box-shadow:0 0 0 7px var(--pen-soft, #fdeeec)}.edp-rec-record:active:not(:disabled){transform:scale(.95)}.edp-rec-record:disabled{background:var(--line-strong, #d6d3cc);box-shadow:none;cursor:not-allowed}.edp-rec-record svg{width:calc(1.6rem * var(--edp-a));height:calc(1.6rem * var(--edp-a))}.edp-rec-record:focus-visible,.edp-rec-stop:focus-visible,.edp-rec-link:focus-visible{outline:2px solid var(--ink, #1d2025);outline-offset:3px}.edp-rec-label{font-weight:600;color:var(--ink, #1d2025)}.edp-rec-limit{font-size:.9em;color:var(--ink-soft, #565b66);font-variant-numeric:tabular-nums}.edp-rec-live{display:flex;align-items:center;gap:calc(.75rem * var(--edp-a))}.edp-rec-level{flex:1 1 auto;min-width:0;width:100%;height:calc(2.5rem * var(--edp-a));display:block}.edp-rec-clock{flex:none;display:inline-flex;align-items:center;gap:.4em;font-variant-numeric:tabular-nums;color:var(--ink, #1d2025);unicode-bidi:isolate}.edp-rec-clock small{color:var(--ink-faint, #8d93a0);font-size:.9em}.edp-rec-dot{width:.6em;height:.6em;border-radius:999px;background:var(--pen, #d23b2b);animation:edp-rec-dot 1.2s ease-in-out infinite}@keyframes edp-rec-dot{50%{opacity:.35}}.edp-rec-stop{flex:none;display:inline-flex;align-items:center;gap:.45em;height:calc(2.5rem * var(--edp-a));padding:0 1em;border:1px solid var(--ink, #1d2025);border-radius:999px;background:var(--ink, #1d2025);color:#fff;font:inherit;font-weight:600;cursor:pointer}.edp-rec-stop{transition:background-color .18s ease-out,transform 90ms ease-out}.edp-rec-stop:hover{background:#33373e}.edp-rec-stop:active{transform:scale(.97)}.edp-rec-stop i{display:inline-block;width:.7em;height:.7em;border-radius:2px;background:currentColor}.edp-rec-foot{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:calc(.5rem * var(--edp-a)) calc(1rem * var(--edp-a));min-height:1.75em}.edp-rec-status{display:inline-flex;align-items:center;gap:.4em;color:var(--ink-soft, #565b66)}.edp-rec-status--ok{color:var(--ok, #1f8a4c);font-weight:600}.edp-rec-status--error{color:var(--ink, #1d2025)}.edp-rec-status--error svg{color:var(--ink, #1d2025);flex:none}.edp-rec-progress{flex:1 1 8rem;height:4px;border-radius:999px;background:var(--line, #e7e5e0);overflow:hidden}.edp-rec-progress>span{display:block;height:100%;background:var(--ink, #1d2025);transition:width .15s ease-out}.edp-rec-link{font:inherit;font-weight:600;color:var(--ink, #1d2025);background:none;border:0;padding:.25em 0;cursor:pointer;text-decoration:underline;text-underline-offset:3px}.edp-rec-link:hover{text-decoration-thickness:2px}@media(pointer:coarse){.edp-rec-link{min-height:2.5rem;padding:0 .25em}}.edp-rec-level:dir(rtl){transform:scaleX(-1)}.edp-rec-message{margin:0;color:var(--ink-soft, #565b66);text-align:center}.edp-rec video{width:100%;max-height:16rem;border-radius:10px;background:#000}@media(prefers-reduced-motion:reduce){.edp-rec-dot{animation:none}.edp-audio-play,.edp-audio-thumb,.edp-rec-record,.edp-rec-stop,.edp-rec-progress>span{transition:none}}
48
+ `);import"katex/dist/katex.min.css";Sr(`/*! tailwindcss v4.2.0 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){.edpire-scope *,.edpire-scope :before,.edpire-scope :after,.edpire-scope ::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:""}}}@layer theme{.edpire-scope{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-200:oklch(88.5% .062 18.334);--color-red-300:oklch(80.8% .114 19.571);--color-red-950:oklch(25.8% .092 26.042);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-900:oklch(41.4% .112 45.904);--color-blue-600:oklch(54.6% .245 262.881);--color-rose-500:oklch(64.5% .246 16.439);--color-slate-500:oklch(55.4% .046 257.417);--color-slate-800:oklch(27.9% .041 260.031);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--font-weight-black:900;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-snug:1.375;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--ease-out:cubic-bezier(0, 0, .2, 1);--ease-in-out:cubic-bezier(.4, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1)}}.edpire-scope .\\@container{container-type:inline-size}.edpire-scope .pointer-events-none{pointer-events:none}.edpire-scope .collapse{visibility:collapse}.edpire-scope .invisible{visibility:hidden}.edpire-scope .visible{visibility:visible}.edpire-scope .absolute{position:absolute}.edpire-scope .fixed{position:fixed}.edpire-scope .relative{position:relative}.edpire-scope .static{position:static}.edpire-scope .sticky{position:sticky}.edpire-scope .inset-0{inset:calc(var(--spacing) * 0)}.edpire-scope .start{inset-inline-start:var(--spacing)}.edpire-scope .start-0{inset-inline-start:calc(var(--spacing) * 0)}.edpire-scope .start-2{inset-inline-start:calc(var(--spacing) * 2)}.edpire-scope .end{inset-inline-end:var(--spacing)}.edpire-scope .end-2{inset-inline-end:calc(var(--spacing) * 2)}.edpire-scope .top-0{top:calc(var(--spacing) * 0)}.edpire-scope .top-1\\/2{top:50%}.edpire-scope .top-2{top:calc(var(--spacing) * 2)}.edpire-scope .top-4{top:calc(var(--spacing) * 4)}.edpire-scope .top-\\[calc\\(var\\(--edp-bar\\)\\+1rem\\)\\]{top:calc(var(--edp-bar) + 1rem)}.edpire-scope .right-1{right:calc(var(--spacing) * 1)}.edpire-scope .right-3{right:calc(var(--spacing) * 3)}.edpire-scope .bottom-2{bottom:calc(var(--spacing) * 2)}.edpire-scope .isolate{isolation:isolate}.edpire-scope .z-10{z-index:10}.edpire-scope .z-20{z-index:20}.edpire-scope .z-30{z-index:30}.edpire-scope .z-40{z-index:40}.edpire-scope .z-50{z-index:50}.edpire-scope .z-\\[60\\]{z-index:60}.edpire-scope .container{width:100%}@media(min-width:40rem){.edpire-scope .container{max-width:40rem}}@media(min-width:48rem){.edpire-scope .container{max-width:48rem}}@media(min-width:64rem){.edpire-scope .container{max-width:64rem}}@media(min-width:80rem){.edpire-scope .container{max-width:80rem}}@media(min-width:96rem){.edpire-scope .container{max-width:96rem}}.edpire-scope .-mx-3{margin-inline:calc(var(--spacing) * -3)}.edpire-scope .mx-1{margin-inline:calc(var(--spacing) * 1)}.edpire-scope .mx-4{margin-inline:calc(var(--spacing) * 4)}.edpire-scope .mx-auto{margin-inline:auto}.edpire-scope .my-1{margin-block:calc(var(--spacing) * 1)}.edpire-scope .my-3{margin-block:calc(var(--spacing) * 3)}.edpire-scope .my-4{margin-block:calc(var(--spacing) * 4)}.edpire-scope .ms-0\\.5{margin-inline-start:calc(var(--spacing) * .5)}.edpire-scope .ms-1{margin-inline-start:calc(var(--spacing) * 1)}.edpire-scope .ms-2{margin-inline-start:calc(var(--spacing) * 2)}.edpire-scope .ms-auto{margin-inline-start:auto}.edpire-scope .mt-0\\.5{margin-top:calc(var(--spacing) * .5)}.edpire-scope .mt-1{margin-top:calc(var(--spacing) * 1)}.edpire-scope .mt-1\\.5{margin-top:calc(var(--spacing) * 1.5)}.edpire-scope .mt-2{margin-top:calc(var(--spacing) * 2)}.edpire-scope .mt-3{margin-top:calc(var(--spacing) * 3)}.edpire-scope .mt-4{margin-top:calc(var(--spacing) * 4)}.edpire-scope .mt-6{margin-top:calc(var(--spacing) * 6)}.edpire-scope .mt-px{margin-top:1px}.edpire-scope .mr-2{margin-right:calc(var(--spacing) * 2)}.edpire-scope .mb-1{margin-bottom:calc(var(--spacing) * 1)}.edpire-scope .mb-2{margin-bottom:calc(var(--spacing) * 2)}.edpire-scope .mb-3{margin-bottom:calc(var(--spacing) * 3)}.edpire-scope .mb-5{margin-bottom:calc(var(--spacing) * 5)}.edpire-scope .ml-1{margin-left:calc(var(--spacing) * 1)}.edpire-scope .ml-auto{margin-left:auto}.edpire-scope .line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.edpire-scope .block{display:block}.edpire-scope .contents{display:contents}.edpire-scope .flex{display:flex}.edpire-scope .grid{display:grid}.edpire-scope .hidden{display:none}.edpire-scope .inline{display:inline}.edpire-scope .inline-block{display:inline-block}.edpire-scope .inline-flex{display:inline-flex}.edpire-scope .table{display:table}.edpire-scope .h-2{height:calc(var(--spacing) * 2)}.edpire-scope .h-3{height:calc(var(--spacing) * 3)}.edpire-scope .h-4{height:calc(var(--spacing) * 4)}.edpire-scope .h-5{height:calc(var(--spacing) * 5)}.edpire-scope .h-6{height:calc(var(--spacing) * 6)}.edpire-scope .h-7{height:calc(var(--spacing) * 7)}.edpire-scope .h-8{height:calc(var(--spacing) * 8)}.edpire-scope .h-9{height:calc(var(--spacing) * 9)}.edpire-scope .h-11{height:calc(var(--spacing) * 11)}.edpire-scope .h-16{height:calc(var(--spacing) * 16)}.edpire-scope .h-24{height:calc(var(--spacing) * 24)}.edpire-scope .h-\\[600px\\]{height:600px}.edpire-scope .h-dvh{height:100dvh}.edpire-scope .h-full{height:100%}.edpire-scope .h-screen{height:100vh}.edpire-scope .max-h-48{max-height:calc(var(--spacing) * 48)}.edpire-scope .max-h-\\[calc\\(100dvh-8rem\\)\\]{max-height:calc(100dvh - 8rem)}.edpire-scope .max-h-\\[calc\\(100dvh-var\\(--edp-bar\\)-2rem\\)\\]{max-height:calc(100dvh - var(--edp-bar) - 2rem)}.edpire-scope .max-h-\\[calc\\(100svh-6rem\\)\\]{max-height:calc(100svh - 6rem)}.edpire-scope .min-h-0{min-height:calc(var(--spacing) * 0)}.edpire-scope .min-h-\\[72px\\]{min-height:72px}.edpire-scope .min-h-\\[100px\\]{min-height:100px}.edpire-scope .min-h-\\[120px\\]{min-height:120px}.edpire-scope .min-h-\\[200px\\]{min-height:200px}.edpire-scope .min-h-dvh{min-height:100dvh}.edpire-scope .w-3{width:calc(var(--spacing) * 3)}.edpire-scope .w-4{width:calc(var(--spacing) * 4)}.edpire-scope .w-5{width:calc(var(--spacing) * 5)}.edpire-scope .w-6{width:calc(var(--spacing) * 6)}.edpire-scope .w-7{width:calc(var(--spacing) * 7)}.edpire-scope .w-9{width:calc(var(--spacing) * 9)}.edpire-scope .w-11{width:calc(var(--spacing) * 11)}.edpire-scope .w-12{width:calc(var(--spacing) * 12)}.edpire-scope .w-16{width:calc(var(--spacing) * 16)}.edpire-scope .w-24{width:calc(var(--spacing) * 24)}.edpire-scope .w-\\[88\\%\\]{width:88%}.edpire-scope .w-full{width:100%}.edpire-scope .w-px{width:1px}.edpire-scope .max-w-3xl{max-width:var(--container-3xl)}.edpire-scope .max-w-\\[32ch\\]{max-width:32ch}.edpire-scope .max-w-\\[200px\\]{max-width:200px}.edpire-scope .max-w-\\[240px\\]{max-width:240px}.edpire-scope .max-w-full{max-width:100%}.edpire-scope .max-w-none{max-width:none}.edpire-scope .max-w-sm{max-width:var(--container-sm)}.edpire-scope .max-w-xs{max-width:var(--container-xs)}.edpire-scope .min-w-0{min-width:calc(var(--spacing) * 0)}.edpire-scope .min-w-\\[80px\\]{min-width:80px}.edpire-scope .min-w-\\[140px\\]{min-width:140px}.edpire-scope .flex-1{flex:1}.edpire-scope .flex-none{flex:none}.edpire-scope .flex-shrink-0,.edpire-scope .shrink-0{flex-shrink:0}.edpire-scope .grow{flex-grow:1}.edpire-scope .-translate-x-\\[110\\%\\]{--tw-translate-x: -110% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.edpire-scope .translate-x-0{--tw-translate-x:calc(var(--spacing) * 0);translate:var(--tw-translate-x) var(--tw-translate-y)}.edpire-scope .-translate-y-1\\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.edpire-scope .transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.edpire-scope .animate-pulse{animation:var(--animate-pulse)}.edpire-scope .animate-spin{animation:var(--animate-spin)}.edpire-scope .cursor-default{cursor:default}.edpire-scope .cursor-pointer{cursor:pointer}.edpire-scope .resize{resize:both}.edpire-scope .flex-col{flex-direction:column}.edpire-scope .flex-wrap{flex-wrap:wrap}.edpire-scope .items-baseline{align-items:baseline}.edpire-scope .items-center{align-items:center}.edpire-scope .items-start{align-items:flex-start}.edpire-scope .justify-between{justify-content:space-between}.edpire-scope .justify-center{justify-content:center}.edpire-scope .justify-end{justify-content:flex-end}.edpire-scope .gap-0\\.5{gap:calc(var(--spacing) * .5)}.edpire-scope .gap-1{gap:calc(var(--spacing) * 1)}.edpire-scope .gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.edpire-scope .gap-2{gap:calc(var(--spacing) * 2)}.edpire-scope .gap-2\\.5{gap:calc(var(--spacing) * 2.5)}.edpire-scope .gap-3{gap:calc(var(--spacing) * 3)}.edpire-scope .gap-4{gap:calc(var(--spacing) * 4)}.edpire-scope .gap-5{gap:calc(var(--spacing) * 5)}.edpire-scope .gap-6{gap:calc(var(--spacing) * 6)}.edpire-scope :where(.edpire-scope .space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}.edpire-scope :where(.edpire-scope .space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}.edpire-scope :where(.edpire-scope .space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}.edpire-scope .gap-x-1{column-gap:calc(var(--spacing) * 1)}.edpire-scope .gap-x-4{column-gap:calc(var(--spacing) * 4)}.edpire-scope .gap-y-0\\.5{row-gap:calc(var(--spacing) * .5)}.edpire-scope .gap-y-2{row-gap:calc(var(--spacing) * 2)}.edpire-scope .self-start{align-self:flex-start}.edpire-scope .self-stretch{align-self:stretch}.edpire-scope .truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.edpire-scope .overflow-auto{overflow:auto}.edpire-scope .overflow-hidden{overflow:hidden}.edpire-scope .overflow-visible{overflow:visible}.edpire-scope .overflow-y-auto{overflow-y:auto}.edpire-scope .rounded{border-radius:.25rem}.edpire-scope .rounded-2xl{border-radius:var(--radius-2xl)}.edpire-scope .rounded-\\[10px\\]{border-radius:10px}.edpire-scope .rounded-\\[14px\\]{border-radius:14px}.edpire-scope .rounded-full{border-radius:3.40282e38px}.edpire-scope .rounded-lg{border-radius:var(--radius-lg)}.edpire-scope .rounded-md{border-radius:var(--radius-md)}.edpire-scope .rounded-sm{border-radius:var(--radius-sm)}.edpire-scope .rounded-xl{border-radius:var(--radius-xl)}.edpire-scope .rounded-e-lg{border-start-end-radius:var(--radius-lg);border-end-end-radius:var(--radius-lg)}.edpire-scope .rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.edpire-scope .border{border-style:var(--tw-border-style);border-width:1px}.edpire-scope .border-2{border-style:var(--tw-border-style);border-width:2px}.edpire-scope .border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.edpire-scope .border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.edpire-scope .border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.edpire-scope .border-dashed{--tw-border-style:dashed;border-style:dashed}.edpire-scope .border-\\[\\#c5e8d1\\]{border-color:#c5e8d1}.edpire-scope .border-\\[\\#d6d3cc\\]{border-color:#d6d3cc}.edpire-scope .border-\\[\\#e7e5e0\\]{border-color:#e7e5e0}.edpire-scope .border-\\[\\#f2e2bf\\]{border-color:#f2e2bf}.edpire-scope .border-\\[\\#f6cfc9\\]{border-color:#f6cfc9}.edpire-scope .border-amber-200{border-color:var(--color-amber-200)}.edpire-scope .border-gray-100{border-color:var(--color-gray-100)}.edpire-scope .border-gray-200{border-color:var(--color-gray-200)}.edpire-scope .border-gray-300{border-color:var(--color-gray-300)}.edpire-scope .bg-\\[\\#1d2025\\]{background-color:#1d2025}.edpire-scope .bg-\\[\\#e7e5e0\\]{background-color:#e7e5e0}.edpire-scope .bg-\\[\\#ecf8f0\\]{background-color:#ecf8f0}.edpire-scope .bg-\\[\\#f1efe9\\]{background-color:#f1efe9}.edpire-scope .bg-\\[\\#f2e2bf\\]{background-color:#f2e2bf}.edpire-scope .bg-\\[\\#f5f4f1\\]{background-color:#f5f4f1}.edpire-scope .bg-\\[\\#fbf1dc\\]{background-color:#fbf1dc}.edpire-scope .bg-\\[\\#fbfaf7\\]{background-color:#fbfaf7}.edpire-scope .bg-\\[\\#fdeeec\\]{background-color:#fdeeec}.edpire-scope .bg-amber-50{background-color:var(--color-amber-50)}.edpire-scope .bg-black\\/25{background-color:#00000040}@supports (color:color-mix(in lab,red,red)){.edpire-scope .bg-black\\/25{background-color:color-mix(in oklab,var(--color-black) 25%,transparent)}}.edpire-scope .bg-black\\/40{background-color:#0006}@supports (color:color-mix(in lab,red,red)){.edpire-scope .bg-black\\/40{background-color:color-mix(in oklab,var(--color-black) 40%,transparent)}}.edpire-scope .bg-gray-50{background-color:var(--color-gray-50)}.edpire-scope .bg-gray-100{background-color:var(--color-gray-100)}.edpire-scope .bg-gray-300{background-color:var(--color-gray-300)}.edpire-scope .bg-red-950\\/80{background-color:#460809cc}@supports (color:color-mix(in lab,red,red)){.edpire-scope .bg-red-950\\/80{background-color:color-mix(in oklab,var(--color-red-950) 80%,transparent)}}.edpire-scope .bg-white{background-color:var(--color-white)}.edpire-scope .bg-white\\/60{background-color:#fff9}@supports (color:color-mix(in lab,red,red)){.edpire-scope .bg-white\\/60{background-color:color-mix(in oklab,var(--color-white) 60%,transparent)}}.edpire-scope .object-contain{object-fit:contain}.edpire-scope .object-cover{object-fit:cover}.edpire-scope .p-1{padding:calc(var(--spacing) * 1)}.edpire-scope .p-1\\.5{padding:calc(var(--spacing) * 1.5)}.edpire-scope .p-2{padding:calc(var(--spacing) * 2)}.edpire-scope .p-3{padding:calc(var(--spacing) * 3)}.edpire-scope .p-4{padding:calc(var(--spacing) * 4)}.edpire-scope .p-6{padding:calc(var(--spacing) * 6)}.edpire-scope .px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.edpire-scope .px-2{padding-inline:calc(var(--spacing) * 2)}.edpire-scope .px-2\\.5{padding-inline:calc(var(--spacing) * 2.5)}.edpire-scope .px-3{padding-inline:calc(var(--spacing) * 3)}.edpire-scope .px-3\\.5{padding-inline:calc(var(--spacing) * 3.5)}.edpire-scope .px-4{padding-inline:calc(var(--spacing) * 4)}.edpire-scope .px-5{padding-inline:calc(var(--spacing) * 5)}.edpire-scope .px-6{padding-inline:calc(var(--spacing) * 6)}.edpire-scope .px-10{padding-inline:calc(var(--spacing) * 10)}.edpire-scope .py-0\\.5{padding-block:calc(var(--spacing) * .5)}.edpire-scope .py-1{padding-block:calc(var(--spacing) * 1)}.edpire-scope .py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.edpire-scope .py-2{padding-block:calc(var(--spacing) * 2)}.edpire-scope .py-2\\.5{padding-block:calc(var(--spacing) * 2.5)}.edpire-scope .py-3{padding-block:calc(var(--spacing) * 3)}.edpire-scope .py-5{padding-block:calc(var(--spacing) * 5)}.edpire-scope .py-8{padding-block:calc(var(--spacing) * 8)}.edpire-scope .py-16{padding-block:calc(var(--spacing) * 16)}.edpire-scope .ps-2{padding-inline-start:calc(var(--spacing) * 2)}.edpire-scope .ps-\\[23px\\]{padding-inline-start:23px}.edpire-scope .pe-2\\.5{padding-inline-end:calc(var(--spacing) * 2.5)}.edpire-scope .pt-1\\.5{padding-top:calc(var(--spacing) * 1.5)}.edpire-scope .pt-2{padding-top:calc(var(--spacing) * 2)}.edpire-scope .pb-1{padding-bottom:calc(var(--spacing) * 1)}.edpire-scope .pb-5{padding-bottom:calc(var(--spacing) * 5)}.edpire-scope .pl-2{padding-left:calc(var(--spacing) * 2)}.edpire-scope .text-center{text-align:center}.edpire-scope .text-right{text-align:right}.edpire-scope .text-start{text-align:start}.edpire-scope .align-middle{vertical-align:middle}.edpire-scope .font-sans{font-family:var(--font-sans)}.edpire-scope .text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.edpire-scope .text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.edpire-scope .text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.edpire-scope .text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.edpire-scope .text-\\[1\\.6rem\\]{font-size:1.6rem}.edpire-scope .text-\\[10px\\]{font-size:10px}.edpire-scope .text-\\[11px\\]{font-size:11px}.edpire-scope .leading-none{--tw-leading:1;line-height:1}.edpire-scope .leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.edpire-scope .leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.edpire-scope .font-black{--tw-font-weight:var(--font-weight-black);font-weight:var(--font-weight-black)}.edpire-scope .font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.edpire-scope .font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.edpire-scope .font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.edpire-scope .tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.edpire-scope .tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.edpire-scope .tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.edpire-scope .tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.edpire-scope .\\[overflow-wrap\\:anywhere\\]{overflow-wrap:anywhere}.edpire-scope .break-words{overflow-wrap:break-word}.edpire-scope .whitespace-pre-wrap{white-space:pre-wrap}.edpire-scope .text-\\[\\#1d2025\\]{color:#1d2025}.edpire-scope .text-\\[\\#1f8a4c\\]{color:#1f8a4c}.edpire-scope .text-\\[\\#8a5a08\\]{color:#8a5a08}.edpire-scope .text-\\[\\#8a8f99\\]{color:#8a8f99}.edpire-scope .text-\\[\\#8d93a0\\]{color:#8d93a0}.edpire-scope .text-\\[\\#565b66\\]{color:#565b66}.edpire-scope .text-\\[\\#a32b1e\\]{color:#a32b1e}.edpire-scope .text-\\[\\#c8810e\\]{color:#c8810e}.edpire-scope .text-\\[\\#d23b2b\\]{color:#d23b2b}.edpire-scope .text-amber-900{color:var(--color-amber-900)}.edpire-scope .text-blue-600{color:var(--color-blue-600)}.edpire-scope .text-gray-400{color:var(--color-gray-400)}.edpire-scope .text-gray-500{color:var(--color-gray-500)}.edpire-scope .text-gray-600{color:var(--color-gray-600)}.edpire-scope .text-gray-700{color:var(--color-gray-700)}.edpire-scope .text-gray-800{color:var(--color-gray-800)}.edpire-scope .text-red-200{color:var(--color-red-200)}.edpire-scope .text-red-300{color:var(--color-red-300)}.edpire-scope .text-slate-500{color:var(--color-slate-500)}.edpire-scope .text-slate-800{color:var(--color-slate-800)}.edpire-scope .text-white{color:var(--color-white)}.edpire-scope .uppercase{text-transform:uppercase}.edpire-scope .italic{font-style:italic}.edpire-scope .tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.edpire-scope .line-through{text-decoration-line:line-through}.edpire-scope .underline{text-decoration-line:underline}.edpire-scope .underline-offset-2{text-underline-offset:2px}.edpire-scope .underline-offset-4{text-underline-offset:4px}.edpire-scope .opacity-40{opacity:.4}.edpire-scope .opacity-60{opacity:.6}.edpire-scope .opacity-70{opacity:.7}.edpire-scope .shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.edpire-scope .shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.edpire-scope .shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.edpire-scope .shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.edpire-scope .outline{outline-style:var(--tw-outline-style);outline-width:1px}.edpire-scope .grayscale{--tw-grayscale:grayscale(100%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.edpire-scope .backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.edpire-scope .transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.edpire-scope .transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.edpire-scope .transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.edpire-scope .transition-shadow{transition-property:box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.edpire-scope .transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.edpire-scope .duration-300{--tw-duration:.3s;transition-duration:.3s}.edpire-scope .duration-700{--tw-duration:.7s;transition-duration:.7s}.edpire-scope .ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.edpire-scope .ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.edpire-scope .outline-none{--tw-outline-style:none;outline-style:none}.edpire-scope .select-none{-webkit-user-select:none;user-select:none}.edpire-scope .\\[--edp-bar\\:0px\\]{--edp-bar:0px}.edpire-scope :is(.edpire-scope .group-open\\:rotate-90):is(:where(.group):is([open],.edpire-scope :popover-open,.edpire-scope :open) *){rotate:90deg}@media(hover:hover){.edpire-scope :is(.edpire-scope .group-hover\\:text-\\[\\#1d2025\\]):is(:where(.group):hover *){color:#1d2025}.edpire-scope :is(.edpire-scope .group-hover\\:shadow-md):is(:where(.group):hover *){--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.edpire-scope :is(.edpire-scope .hover\\:border-\\[\\#8d93a0\\]):hover{border-color:#8d93a0}.edpire-scope :is(.edpire-scope .hover\\:bg-\\[\\#31353c\\]):hover{background-color:#31353c}.edpire-scope :is(.edpire-scope .hover\\:bg-\\[\\#e7e5e0\\]):hover{background-color:#e7e5e0}.edpire-scope :is(.edpire-scope .hover\\:bg-\\[\\#f1efe9\\]):hover{background-color:#f1efe9}.edpire-scope :is(.edpire-scope .hover\\:bg-gray-100):hover{background-color:var(--color-gray-100)}.edpire-scope :is(.edpire-scope .hover\\:bg-white):hover{background-color:var(--color-white)}.edpire-scope :is(.edpire-scope .hover\\:text-\\[\\#1d2025\\]):hover{color:#1d2025}.edpire-scope :is(.edpire-scope .hover\\:text-gray-700):hover{color:var(--color-gray-700)}.edpire-scope :is(.edpire-scope .hover\\:text-rose-500):hover{color:var(--color-rose-500)}.edpire-scope :is(.edpire-scope .hover\\:underline):hover{text-decoration-line:underline}}.edpire-scope :is(.edpire-scope .focus\\:outline-none):focus{--tw-outline-style:none;outline-style:none}.edpire-scope :is(.edpire-scope .focus-visible\\:ring-2):focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.edpire-scope :is(.edpire-scope .focus-visible\\:ring-\\[\\#8d93a0\\]):focus-visible{--tw-ring-color:#8d93a0}.edpire-scope :is(.edpire-scope .focus-visible\\:ring-offset-2):focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.edpire-scope :is(.edpire-scope .focus-visible\\:outline-2):focus-visible{outline-style:var(--tw-outline-style);outline-width:2px}.edpire-scope :is(.edpire-scope .focus-visible\\:outline-\\[\\#1d2025\\]):focus-visible{outline-color:#1d2025}.edpire-scope :is(.edpire-scope .disabled\\:cursor-not-allowed):disabled{cursor:not-allowed}.edpire-scope :is(.edpire-scope .disabled\\:opacity-50):disabled{opacity:.5}.edpire-scope :is(.edpire-scope .data-\\[flash\\=true\\]\\:bg-\\[\\#fbf1dc\\])[data-flash=true]{background-color:#fbf1dc}.edpire-scope :is(.edpire-scope .data-\\[flash\\=true\\]\\:duration-150)[data-flash=true]{--tw-duration:.15s;transition-duration:.15s}@media(min-width:40rem){.edpire-scope .sm\\:block{display:block}.edpire-scope .sm\\:hidden{display:none}.edpire-scope .sm\\:inline{display:inline}.edpire-scope .sm\\:inline-flex{display:inline-flex}.edpire-scope .sm\\:flex-row{flex-direction:row}.edpire-scope .sm\\:flex-nowrap{flex-wrap:nowrap}.edpire-scope .sm\\:items-center{align-items:center}.edpire-scope .sm\\:gap-4{gap:calc(var(--spacing) * 4)}.edpire-scope .sm\\:px-4{padding-inline:calc(var(--spacing) * 4)}.edpire-scope .sm\\:px-6{padding-inline:calc(var(--spacing) * 6)}.edpire-scope .sm\\:py-4{padding-block:calc(var(--spacing) * 4)}.edpire-scope .sm\\:text-\\[2rem\\]{font-size:2rem}}@container (min-width:72rem){.edpire-scope .\\@6xl\\:flex{display:flex}.edpire-scope .\\@6xl\\:hidden{display:none}}.edpire-scope :is(.edpire-scope .rtl\\:translate-x-\\[110\\%\\]):where(:dir(rtl),.edpire-scope [dir=rtl],.edpire-scope [dir=rtl] *){--tw-translate-x:110%;translate:var(--tw-translate-x) var(--tw-translate-y)}.edpire-scope :is(.edpire-scope .\\[\\&_\\.ProseMirror\\]\\:min-h-\\[80px\\]) .ProseMirror{min-height:80px}.edpire-scope :is(.edpire-scope .\\[\\&_\\.ProseMirror\\]\\:outline-none) .ProseMirror{--tw-outline-style:none;outline-style:none}.edpire-scope :is(.edpire-scope .\\[\\&_\\.ProseMirror_p\\.is-editor-empty\\:first-child\\:\\:before\\]\\:pointer-events-none) .ProseMirror p.is-editor-empty:first-child:before{pointer-events:none}.edpire-scope :is(.edpire-scope .\\[\\&_\\.ProseMirror_p\\.is-editor-empty\\:first-child\\:\\:before\\]\\:float-left) .ProseMirror p.is-editor-empty:first-child:before{float:left}.edpire-scope :is(.edpire-scope .\\[\\&_\\.ProseMirror_p\\.is-editor-empty\\:first-child\\:\\:before\\]\\:h-0) .ProseMirror p.is-editor-empty:first-child:before{height:calc(var(--spacing) * 0)}.edpire-scope :is(.edpire-scope .\\[\\&_\\.ProseMirror_p\\.is-editor-empty\\:first-child\\:\\:before\\]\\:text-gray-400) .ProseMirror p.is-editor-empty:first-child:before{color:var(--color-gray-400)}.edpire-scope :is(.edpire-scope .\\[\\&_\\.ProseMirror_p\\.is-editor-empty\\:first-child\\:\\:before\\]\\:content-\\[attr\\(data-placeholder\\)\\]) .ProseMirror p.is-editor-empty:first-child:before{--tw-content:attr(data-placeholder);content:var(--tw-content)}.edpire-scope :is(.edpire-scope .\\[\\&_\\[data-exercise-id\\]\\]\\:scroll-mt-\\[calc\\(var\\(--edp-bar\\)\\+0\\.75rem\\)\\]) [data-exercise-id],.edpire-scope :is(.edpire-scope .\\[\\&_\\[data-question-id\\]\\]\\:scroll-mt-\\[calc\\(var\\(--edp-bar\\)\\+0\\.75rem\\)\\]) [data-question-id]{scroll-margin-top:calc(var(--edp-bar) + .75rem)}@layer base{.edpire-scope *,.edpire-scope :after,.edpire-scope :before,.edpire-scope ::backdrop{border-color:var(--color-gray-200,currentColor)}.edpire-scope ::file-selector-button{border-color:var(--color-gray-200,currentColor)}}@supports not (height:100dvh){.edpire-scope .h-dvh{height:100vh}}.edpire-scope :where(span:has(>textarea.player-typed-blank)){line-height:0}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}
49
+ `);import{jsx as Vn}from"react/jsx-runtime";var Fa=jl.memo(function({content:r,onAnswersChange:t,feedback:n,initialAnswers:o,readOnly:a,className:s,dir:i}){let c=Bl(()=>{if(n)return new Map(Object.entries(n))},[n]),l=Vn(Dr,{content:r,onAnswersChange:t,initialAnswers:o,validationFeedback:c,readOnly:a,className:s});return Vn("div",{className:"edpire-scope",style:{display:"contents"},children:i?Vn("div",{dir:i,children:l}):l})});import{useEffect as Td,useRef as lo}from"react";import fs from"react";import{createRoot as hs}from"react-dom/client";import{useCallback as ds,useMemo as Cd,useState as _d}from"react";import{cloneElement as Za,isValidElement as es,useCallback as Ue,useEffect as Xt,useMemo as Pe,useRef as pr,useState as Be}from"react";import{Send as rs,Loader2 as ro,BarChart2 as to,CheckCircle2 as ts,XCircle as fd,RotateCcw as hd,X as no,Clock as Br,AlertTriangle as gd,AlertCircle as bd,Check as yd,CloudOff as xd}from"lucide-react";import{clsx as ql}from"clsx";import{twMerge as Wl}from"tailwind-merge";function ge(...e){return Wl(ql(e))}function Cr(e,r,t){return r?.trim()||e("exercise",{index:t+1})}import{Fragment as Gl,jsx as _e,jsxs as Qn}from"react/jsx-runtime";function Ul({accent:e}){return _e("div",{style:{width:48,height:48,borderRadius:"50%",border:`4px solid ${e}33`,borderTopColor:e,animation:"edpire-spin 0.8s linear infinite"}})}function Hl({accent:e}){return _e("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[0,1,2].map(r=>_e("div",{style:{width:12,height:12,borderRadius:"50%",background:e,animation:`edpire-bounce 1.2s ease-in-out ${r*.2}s infinite`}},r))})}function Vl({accent:e}){return Qn("div",{style:{position:"relative",width:48,height:48},children:[[0,1].map(r=>_e("div",{style:{position:"absolute",inset:0,borderRadius:"50%",background:e,opacity:.4,animation:`edpire-pulse 1.6s ease-out ${r*.8}s infinite`}},r)),_e("div",{style:{position:"absolute",inset:"25%",borderRadius:"50%",background:e}})]})}function Ql({accent:e}){return _e("div",{style:{display:"flex",gap:4,alignItems:"flex-end",height:40},children:[0,1,2,3].map(r=>_e("div",{style:{width:8,borderRadius:4,background:e,animation:`edpire-bars 1s ease-in-out ${r*.15}s infinite`}},r))})}function Oa({visible:e,bgColor:r="rgba(0,0,0,0.55)",accentColor:t="#6366f1",text:n="Evaluating your answers\u2026",aiText:o="Some answers are being reviewed by AI, this may take a few seconds.",spinnerTheme:a="default",animationUrl:s,hasAiNodes:i=!1,contained:c=!1}){return e?Qn(Gl,{children:[_e("style",{children:`
50
50
  @keyframes edpire-spin {
51
51
  to { transform: rotate(360deg); }
52
52
  }
@@ -62,5 +62,18 @@ sys.stdin = io.StringIO(${JSON.stringify(o)})
62
62
  0%, 100% { height: 12px; }
63
63
  50% { height: 40px; }
64
64
  }
65
- `}),ge("div",{style:{background:r},className:`${c?"absolute":"fixed"} inset-0 z-[60] flex items-center justify-center`,children:dn("div",{className:"flex flex-col items-center gap-5 bg-white rounded-2xl shadow-2xl px-10 py-8 max-w-xs text-center",children:[(()=>{if(o)return ge("img",{src:o,alt:"",className:"w-24 h-24 object-contain"});switch(s){case"dots":return ge(Fc,{accent:t});case"pulse":return ge(jc,{accent:t});case"bars":return ge(Bc,{accent:t});default:return ge(Oc,{accent:t})}})(),ge("p",{className:"text-sm font-semibold text-slate-800",children:n}),i&&ge("p",{className:"text-xs text-slate-500 leading-snug",children:a})]})})]}):null}import{useCallback as ro,useEffect as qc,useMemo as to,useRef as wt,useState as Hc}from"react";import{BookOpen as no,X as Uc}from"lucide-react";import{Fragment as Qc,jsx as ce,jsxs as Ae}from"react/jsx-runtime";function pn(e){return e.exercises.flatMap((r,t)=>r.sharedContext&&Tr(r.sharedContext)?[{id:r.id,index:t,content:r.sharedContext}]:[])}var ao=()=>typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;function Vc(e){e.removeAttribute("data-flash"),e.offsetWidth,e.setAttribute("data-flash","true"),setTimeout(()=>e.removeAttribute("data-flash"),1200)}function oo({assessment:e,isSubmitted:r,setAnswers:t,validationFeedback:n,renderExercise:a,renderSeparator:s,primaryColor:o,contained:i=!1,locale:c,contentMaxWidth:l,t:d,footer:p}){let[m,g]=Hc(!1),u=e.annex,b=u?.tabLabel||d("annexDocuments"),v=to(()=>pn(e),[e]),w=wt(null),x=wt(null),_=wt(null),h=wt(null),y=()=>(w.current?.getClientRects().length??0)>0,C=ro((A,H)=>{let S=A?.querySelector(`[data-reference-for="${CSS.escape(H)}"]`);if(!A||!S)return;let N=S.getBoundingClientRect().top-A.getBoundingClientRect().top+A.scrollTop-12;A.scrollTo({top:N,behavior:ao()?"auto":"smooth"}),Vc(S)},[]),P=ro(A=>{if(y()){C(x.current,A);return}g(!0),requestAnimationFrame(()=>requestAnimationFrame(()=>C(h.current,A)))},[C]),$=A=>{let H=y()?w.current:_.current;y()||g(!1),Array.from(H?.querySelectorAll(`[data-exercise-id="${CSS.escape(A)}"]`)??[]).find(N=>N.getClientRects().length>0)?.scrollIntoView({behavior:ao()?"auto":"smooth",block:"start"})};qc(()=>{let A=w.current;if(!A||v.length===0||typeof IntersectionObserver>"u")return;let H=i?A:null,S=new Set(v.map(z=>z.id)),N=null,j=new IntersectionObserver(z=>{if(!y())return;let G=z.filter(D=>D.isIntersecting&&S.has(D.target.dataset.exerciseId??"")).sort((D,X)=>D.boundingClientRect.top-X.boundingClientRect.top)[0]?.target?.dataset.exerciseId;!G||G===N||(N=G,C(x.current,G))},{root:H,rootMargin:"0px 0px -60% 0px"});return A.querySelectorAll("[data-exercise-id]").forEach(z=>j.observe(z)),()=>j.disconnect()},[v,C,i]);let R=to(()=>({label:b,showExerciseReference:P}),[b,P]),f=Ae(Qc,{children:[u?.items.map(A=>ce(Ir,{item:A},A.id)),u?.items.length&&v.length?ce("div",{className:"border-t border-[#e7e5e0]"}):null,v.map(A=>Ae("section",{"data-reference-for":A.id,className:"-mx-3 flex flex-col gap-2 rounded-[10px] px-3 py-2 transition-colors duration-700 data-[flash=true]:bg-[#fbf1dc] data-[flash=true]:duration-150",children:[ce("button",{type:"button",onClick:()=>$(A.id),className:"self-start cursor-pointer text-xs font-bold uppercase tracking-widest text-[#565b66] underline-offset-4 hover:text-[#1d2025] hover:underline focus-visible:outline-2 focus-visible:outline-[#1d2025] rounded-sm",children:d("exercise",{index:A.index+1})}),ce(xr,{content:A.content})]},A.id))]}),I=ce(Xe,{assessment:e,onAnswersChange:r?void 0:t,validationFeedback:n,renderExercise:a,renderSeparator:s,locale:c});return ce(gt,{value:R,children:Ae("div",{className:se("@container flex-1 min-h-0 flex",i&&"relative"),children:[Ae("div",{ref:w,className:se("hidden @6xl:flex flex-1 min-w-0 gap-4 p-4 bg-[#f5f4f1] items-start",i&&"overflow-y-auto"),children:[Ae("div",{className:se("flex-1 sticky flex flex-col bg-white rounded-[14px] border border-[#e7e5e0] shadow-sm overflow-hidden",i?"top-4 max-h-[calc(100svh-6rem)]":"top-[calc(var(--edp-bar)+1rem)] max-h-[calc(100dvh-var(--edp-bar)-2rem)]"),children:[Ae("div",{className:"flex items-center gap-2 px-5 py-3 border-b border-[#e7e5e0] flex-shrink-0",children:[ce(no,{size:14,className:"text-[#8d93a0]"}),ce("span",{className:"text-xs font-bold text-[#565b66] uppercase tracking-widest",children:b})]}),ce("div",{ref:x,className:"flex-1 overflow-y-auto px-6 py-5 flex flex-col gap-6",children:f})]}),ce("div",{className:"w-px bg-[#e7e5e0] flex-shrink-0 self-stretch my-1 rounded-full"}),ce("div",{className:"flex-1 min-w-0 bg-white rounded-[14px] border border-[#e7e5e0] shadow-sm",children:Ae("div",{className:"px-6 py-5 flex flex-col gap-4",children:[I,p]})})]}),Ae("div",{className:se("@6xl:hidden flex-1 min-w-0 relative",i&&"overflow-hidden"),children:[ce("div",{ref:_,className:se(i&&"absolute inset-0 overflow-y-auto"),children:Ae("div",{className:"mx-auto px-5 py-5 flex flex-col gap-4",style:{maxWidth:l},children:[I,p]})}),m&&ce("div",{className:se("inset-0 z-30 bg-black/25",i?"absolute":"fixed"),onClick:()=>g(!1)}),Ae("div",{role:"dialog","aria-label":b,"aria-hidden":!m,className:se("top-1/2 start-2 -translate-y-1/2 z-40 w-[88%] bg-[#f1efe9] rounded-2xl shadow-2xl flex flex-col overflow-hidden transition-transform duration-300 ease-in-out",i?"absolute":"fixed",m?"translate-x-0":"-translate-x-[110%] rtl:translate-x-[110%]"),children:[Ae("div",{className:"flex items-center justify-between px-5 py-3 flex-shrink-0",children:[ce("span",{className:"text-sm font-bold text-[#1d2025]",children:b}),ce("button",{onClick:()=>g(!1),"aria-label":d("close"),className:"p-1 text-[#8d93a0] hover:text-[#1d2025] rounded-lg transition-colors",children:ce(Uc,{size:18})})]}),ce("div",{ref:h,className:"overflow-y-auto max-h-[calc(100dvh-8rem)] px-5 pb-5 flex flex-col gap-5",children:f})]})]}),!m&&Ae("button",{onClick:()=>g(!0),"aria-label":b,style:{transform:"translateY(-50%)",...o?{backgroundColor:o}:{}},className:se("@6xl:hidden top-1/2 start-0 z-20 flex flex-col items-center gap-1 py-3 px-1.5 bg-[#1d2025] text-white text-[10px] font-bold uppercase tracking-wider rounded-e-lg shadow-md hover:bg-[#31353c] transition-colors",i?"absolute":"fixed"),children:[ce(no,{size:12}),ce("span",{style:{writingMode:"vertical-rl",transform:"rotate(180deg)"},children:b})]})]})})}import{useState as Gc}from"react";import{BookOpen as so,Plus as Yc,X as Kc}from"lucide-react";import{jsx as fe,jsxs as Ue}from"react/jsx-runtime";function io({assessment:e,isSubmitted:r,setAnswers:t,validationFeedback:n,renderExercise:a,renderSeparator:s,primaryColor:o,contained:i=!1,locale:c,contentMaxWidth:l,t:d,onAddAnnex:p,footer:m}){let[g,u]=Gc(!1),b=fe(Xe,{assessment:e,onAnswersChange:r?void 0:t,validationFeedback:n,renderExercise:a,renderSeparator:s,locale:c});if(g)return fe("div",{className:"flex-1 overflow-y-auto",children:Ue("div",{className:"mx-auto p-6 flex flex-col gap-4",style:{maxWidth:l},children:[b,m]})});let v=_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),p())},w=_=>Ue("span",{style:o?{backgroundColor:o}:void 0,className:se("flex-none inline-flex items-center gap-1.5 rounded-lg bg-[#1d2025] text-white font-semibold shadow-sm group-hover:shadow-md transition-shadow",_?"px-3 py-1.5 text-xs":"mt-1 px-3.5 py-2 text-xs"),children:[fe(Yc,{size:13}),d("annexEmptyCta")]}),x=_=>fe("button",{type:"button",onClick:h=>{h.stopPropagation(),u(!0)},"aria-label":d("annexEmptyDismiss"),title:d("annexEmptyDismiss"),className:se("flex-none flex items-center justify-center w-7 h-7 rounded-lg text-[#8d93a0] hover:text-[#1d2025] hover:bg-[#f1efe9] transition-colors cursor-pointer",_&&"absolute top-2 end-2 z-10"),children:fe(Kc,{size:15})});return Ue("div",{className:se("@container flex-1 min-h-0 flex",i&&"relative"),children:[Ue("div",{className:"hidden @6xl:flex flex-1 gap-4 p-4 bg-[#f5f4f1] items-start overflow-y-auto",children:[fe("div",{className:"flex-1 sticky top-4 flex min-h-[200px] max-h-[calc(100svh-6rem)]",children:Ue("div",{role:"button",tabIndex:0,onClick:p,onKeyDown:v,className:"group relative flex-1 w-full flex flex-col items-center justify-center gap-3 text-center rounded-[14px] border-2 border-dashed border-[#d6d3cc] bg-white/60 hover:border-[#8d93a0] hover:bg-white transition-colors cursor-pointer px-6 py-8 outline-none focus-visible:ring-2 focus-visible:ring-[#8d93a0] focus-visible:ring-offset-2",children:[x(!0),fe("span",{className:"flex items-center justify-center w-11 h-11 rounded-full bg-[#f1efe9] text-[#8d93a0] group-hover:text-[#1d2025] transition-colors",children:fe(so,{size:20})}),fe("span",{className:"text-sm font-bold text-[#565b66]",children:d("annexEmptyTitle")}),fe("span",{className:"text-xs text-[#8d93a0] max-w-[32ch] leading-relaxed",children:d("annexEmptyBody")}),w(!1)]})}),fe("div",{className:"w-px bg-[#e7e5e0] flex-shrink-0 self-stretch my-1 rounded-full"}),fe("div",{className:"flex-1 bg-white rounded-[14px] border border-[#e7e5e0] shadow-sm",children:Ue("div",{className:"px-6 py-5 flex flex-col gap-4",children:[b,m]})})]}),fe("div",{className:"@6xl:hidden flex-1 overflow-y-auto",children:Ue("div",{className:"mx-auto px-5 py-5 flex flex-col gap-4",style:{maxWidth:l},children:[Ue("div",{role:"button",tabIndex:0,onClick:p,onKeyDown:v,className:"group flex items-center gap-3 rounded-[14px] border-2 border-dashed border-[#d6d3cc] bg-white/60 hover:border-[#8d93a0] hover:bg-white transition-colors cursor-pointer px-4 py-2.5 outline-none focus-visible:ring-2 focus-visible:ring-[#8d93a0]",children:[fe("span",{className:"flex-none flex items-center justify-center w-9 h-9 rounded-full bg-[#f1efe9] text-[#8d93a0] group-hover:text-[#1d2025] transition-colors",children:fe(so,{size:16})}),Ue("div",{className:"flex-1 min-w-0",children:[fe("div",{className:"text-xs font-bold text-[#565b66]",children:d("annexEmptyTitle")}),fe("div",{className:"text-[11px] text-[#8d93a0] leading-snug",children:d("annexEmptyBody")})]}),w(!0),x(!1)]}),b,m]})})]})}function mn(e){let r=new Map;for(let t of e){let n=new Map;for(let a of t.questions){let s=new Map;for(let o of a.nodeResults){let i={state:o.status,showFeedback:!0,score:o.score,...o.feedback!==void 0?{message:o.feedback}:{},...o.displayAnswer!==void 0?{displayAnswer:o.displayAnswer}:{},...o.teacherFeedback!==void 0?{teacherFeedback:o.teacherFeedback}:{}};o.detail?.type==="choiceSet"?i.correctChoiceIds=o.detail.correctChoiceIds:o.detail?.type==="matchingSet"&&(i.pairFeedback=o.detail.pairFeedback,i.correctPairings=o.detail.correctPairings),s.set(o.nodeId,i)}n.set(a.questionId,s)}r.set(t.exerciseId,n)}return r}import{Lightbulb as Xc}from"lucide-react";import{jsx as un,jsxs as co}from"react/jsx-runtime";function Jc(e){return e.length===0||e.some(r=>r.status==="awaiting_review")?null:e.every(r=>r.status==="correct")?"correct":e.some(r=>r.score>0)?"partial":"incorrect"}function lo({content:e,nodeResults:r,label:t}){let n=Jc(r);return co("div",{className:`player-ai-feedback mt-3 mb-3${n?` player-ai-feedback--${n}`:""}`,children:[co("p",{className:"flex items-center gap-1.5 text-xs font-semibold",children:[un(Xc,{size:14,"aria-hidden":!0}),t]}),un("div",{className:"text-[#1d2025]",children:un(xr,{content:e})})]})}var Zc=new Set(["choiceSet","inlineChoiceSet","blank","aiAnswerInput","matchingSet","openResponseNode","mathResponse","codingResponse"]),el=new Set(["blankPool","inlinePool"]);function rl(e){switch(e.type){case"choiceSet":case"inlineChoiceSet":return e.answer.selectedIds.length>0;case"blank":return e.answer.mode==="choice"?e.answer.choiceId.length>0:e.answer.text.trim().length>0;case"matchingSet":return e.answer.connections.length>0;case"aiAnswer":return e.answer.text.trim().length>0;case"openResponse":{let r=e.answer;return r.recording||r.files&&r.files.length>0?!0:(r.text?.wordCount??0)>0}case"mathResponse":return e.answer.latex.trim().length>0;case"codingResponse":return e.answer.source.trim().length>0;default:{let r=e;return!0}}}function tl(e){let r=0,t=n=>{if(Array.isArray(n)){for(let o of n)t(o);return}if(!n||typeof n!="object")return;let{type:a,content:s}=n;if(typeof a=="string"){if(Zc.has(a)){r+=1;return}if(el.has(a))return}s!==void 0&&t(s)};return t(e),r}function po(e,r){let t=new Map;for(let a of r?.exerciseAnswers??[])for(let s of a.questionAnswers){let o=t.get(s.questionId);o||(o=new Set,t.set(s.questionId,o));for(let i of s.answers)rl(i)&&o.add(i.nodeId)}let n=[];return e.exercises.forEach((a,s)=>{a.questions.forEach((o,i)=>{let c=tl(o.content);c!==0&&(t.get(o.id)?.size??0)<c&&n.push({questionId:o.id,exerciseIndex:s,questionIndex:i,only:a.questions.length===1})})}),n}var nl={exercise:"Exercise {index}",question:"Question {index}",points:"pts","points.one":"pt",submit:"Submit Assessment",submitting:"Submitting...",confirmTitle:"Submit Assessment",confirmDescription:"Are you sure you want to submit? You cannot change your answers after submitting.",unansweredOne:"1 question is not fully answered.",unansweredMany:"{count} questions are not fully answered.",unansweredMore:"and {count} more",confirmSubmit:"Submit",confirmCancel:"Cancel",assessmentPassed:"Assessment passed",assessmentNotPassed:"Assessment not passed",awaitingReview:"Awaiting review",awaitingReviewDesc:"Your teacher is reviewing your open responses. Your final score will be available once grading is complete.",beingMarked:"Being marked",beingMarkedDesc:"Some answers are still being marked. Your final score will be available once every answer is marked.",pendingReview:"Pending review",viewFullReport:"View Full Report",explanation:"Explanation",poweredBy:"Powered by Edpire",evaluating:"Evaluating your answers\u2026",aiEvaluating:"Some answers are being reviewed by AI, this may take a few seconds.",reset:"Reset",back:"Back",annexDocuments:"Documents",annexEmptyTitle:"No reference yet",annexEmptyBody:"A text, figure, table or document that stays in view across the whole assessment while students answer.",annexEmptyCta:"Add reference",annexEmptyDismiss:"Hide","timeUp.title":"Time's up","timeUp.submitting":"Submitting your answers\u2026",yourScore:"Your score",answersSaving:"Saving\u2026",answersSaved:"Answers saved",answersNotSaved:"Your answers aren't being saved. Check your connection.",resumeRestored:"Welcome back. Your answers are here.",resumeFresh:"Welcome back.",resumeTimeLeft:"The clock kept running: {minutes} min left.",close:"Close"},al={exercise:"Exercice {index}",question:"Question {index}",points:"pts","points.one":"pt",submit:"Soumettre l'\xE9valuation",submitting:"Soumission...",confirmTitle:"Soumettre l'\xE9valuation",confirmDescription:"\xCAtes-vous s\xFBr de vouloir soumettre ? Vous ne pourrez pas modifier vos r\xE9ponses.",unansweredOne:"1 question n'est pas enti\xE8rement remplie.",unansweredMany:"{count} questions ne sont pas enti\xE8rement remplies.",unansweredMore:"et {count} autres",confirmSubmit:"Soumettre",confirmCancel:"Annuler",assessmentPassed:"\xC9valuation r\xE9ussie",assessmentNotPassed:"\xC9valuation non r\xE9ussie",awaitingReview:"En attente de correction",awaitingReviewDesc:"Votre professeur examine vos r\xE9ponses ouvertes. Votre note finale sera disponible une fois la correction termin\xE9e.",beingMarked:"Correction en cours",beingMarkedDesc:"Certaines r\xE9ponses sont encore en cours de correction. Votre note finale sera disponible d\xE8s que toutes les r\xE9ponses seront corrig\xE9es.",pendingReview:"En attente de correction",viewFullReport:"Voir le rapport complet",explanation:"Explication",poweredBy:"Propuls\xE9 par Edpire",evaluating:"\xC9valuation de vos r\xE9ponses\u2026",aiEvaluating:"Certaines r\xE9ponses sont examin\xE9es par l'IA, cela peut prendre quelques secondes.",reset:"R\xE9initialiser",back:"Retour",annexDocuments:"Documents",annexEmptyTitle:"Aucune annexe pour l'instant",annexEmptyBody:"Un texte, une figure, un tableau ou un document qui reste visible pour toute l'\xE9valuation pendant que les \xE9l\xE8ves r\xE9pondent.",annexEmptyCta:"Ajouter une annexe",annexEmptyDismiss:"Masquer","timeUp.title":"Temps \xE9coul\xE9","timeUp.submitting":"Envoi de vos r\xE9ponses\u2026",yourScore:"Votre score",answersSaving:"Enregistrement\u2026",answersSaved:"R\xE9ponses enregistr\xE9es",answersNotSaved:"Vos r\xE9ponses ne sont pas enregistr\xE9es. V\xE9rifiez votre connexion.",resumeRestored:"Bon retour. Vos r\xE9ponses sont l\xE0.",resumeFresh:"Bon retour.",resumeTimeLeft:"Le chrono a continu\xE9 : il reste {minutes} min.",close:"Fermer"},ol={exercise:"\u062A\u0645\u0631\u064A\u0646 {index}",question:"\u0633\u0624\u0627\u0644 {index}",points:"\u0646\u0642\u0637\u0629","points.two":"\u0646\u0642\u0637\u062A\u0627\u0646","points.few":"\u0646\u0642\u0627\u0637",submit:"\u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u062A\u0642\u064A\u064A\u0645",submitting:"\u062C\u0627\u0631\u064D \u0627\u0644\u0625\u0631\u0633\u0627\u0644...",confirmTitle:"\u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u062A\u0642\u064A\u064A\u0645",confirmDescription:"\u0647\u0644 \u0623\u0646\u062A \u0645\u062A\u0623\u0643\u062F \u0645\u0646 \u0627\u0644\u0625\u0631\u0633\u0627\u0644\u061F \u0644\u0646 \u062A\u062A\u0645\u0643\u0646 \u0645\u0646 \u062A\u063A\u064A\u064A\u0631 \u0625\u062C\u0627\u0628\u0627\u062A\u0643 \u0628\u0639\u062F \u0627\u0644\u0625\u0631\u0633\u0627\u0644.",unansweredOne:"\u0644\u0645 \u062A\u064F\u0643\u0645\u0644 \u0627\u0644\u0625\u062C\u0627\u0628\u0629 \u0639\u0646 \u0633\u0624\u0627\u0644 \u0648\u0627\u062D\u062F.",unansweredMany:"\u0644\u0645 \u062A\u064F\u0643\u0645\u0644 \u0627\u0644\u0625\u062C\u0627\u0628\u0629 \u0639\u0646 {count} \u0645\u0646 \u0627\u0644\u0623\u0633\u0626\u0644\u0629.",unansweredMore:"\u0648{count} \u0623\u062E\u0631\u0649",confirmSubmit:"\u0625\u0631\u0633\u0627\u0644",confirmCancel:"\u0625\u0644\u063A\u0627\u0621",assessmentPassed:"\u0627\u062C\u062A\u064A\u0627\u0632 \u0627\u0644\u062A\u0642\u064A\u064A\u0645",assessmentNotPassed:"\u0644\u0645 \u064A\u062A\u0645 \u0627\u062C\u062A\u064A\u0627\u0632 \u0627\u0644\u062A\u0642\u064A\u064A\u0645",awaitingReview:"\u0641\u064A \u0627\u0646\u062A\u0638\u0627\u0631 \u0627\u0644\u062A\u0635\u062D\u064A\u062D",awaitingReviewDesc:"\u064A\u0642\u0648\u0645 \u0645\u0639\u0644\u0645\u0643 \u0628\u0645\u0631\u0627\u062C\u0639\u0629 \u0625\u062C\u0627\u0628\u0627\u062A\u0643 \u0627\u0644\u0645\u0641\u062A\u0648\u062D\u0629. \u0633\u062A\u0638\u0647\u0631 \u0639\u0644\u0627\u0645\u062A\u0643 \u0627\u0644\u0646\u0647\u0627\u0626\u064A\u0629 \u0628\u0639\u062F \u0627\u0643\u062A\u0645\u0627\u0644 \u0627\u0644\u062A\u0635\u062D\u064A\u062D.",beingMarked:"\u0642\u064A\u062F \u0627\u0644\u062A\u0635\u062D\u064A\u062D",beingMarkedDesc:"\u0628\u0639\u0636 \u0627\u0644\u0625\u062C\u0627\u0628\u0627\u062A \u0645\u0627 \u0632\u0627\u0644\u062A \u0642\u064A\u062F \u0627\u0644\u062A\u0635\u062D\u064A\u062D. \u0633\u062A\u0638\u0647\u0631 \u0639\u0644\u0627\u0645\u062A\u0643 \u0627\u0644\u0646\u0647\u0627\u0626\u064A\u0629 \u0628\u0639\u062F \u062A\u0635\u062D\u064A\u062D \u062C\u0645\u064A\u0639 \u0627\u0644\u0625\u062C\u0627\u0628\u0627\u062A.",pendingReview:"\u0642\u064A\u062F \u0627\u0644\u062A\u0635\u062D\u064A\u062D",viewFullReport:"\u0639\u0631\u0636 \u0627\u0644\u062A\u0642\u0631\u064A\u0631 \u0627\u0644\u0643\u0627\u0645\u0644",explanation:"\u0634\u0631\u062D",poweredBy:"\u0645\u062F\u0639\u0648\u0645 \u0645\u0646 Edpire",evaluating:"\u062C\u0627\u0631\u064D \u062A\u0642\u064A\u064A\u0645 \u0625\u062C\u0627\u0628\u0627\u062A\u0643\u2026",aiEvaluating:"\u0628\u0639\u0636 \u0627\u0644\u0625\u062C\u0627\u0628\u0627\u062A \u0642\u064A\u062F \u0627\u0644\u0645\u0631\u0627\u062C\u0639\u0629 \u0628\u0627\u0644\u0630\u0643\u0627\u0621 \u0627\u0644\u0627\u0635\u0637\u0646\u0627\u0639\u064A\u060C \u0642\u062F \u064A\u0633\u062A\u063A\u0631\u0642 \u0630\u0644\u0643 \u0628\u0636\u0639 \u062B\u0648\u0627\u0646\u064D.",reset:"\u0625\u0639\u0627\u062F\u0629 \u062A\u0639\u064A\u064A\u0646",back:"\u0631\u062C\u0648\u0639",annexDocuments:"\u0627\u0644\u0645\u0633\u062A\u0646\u062F\u0627\u062A",annexEmptyTitle:"\u0644\u0627 \u064A\u0648\u062C\u062F \u0645\u064F\u0644\u062D\u064E\u0642 \u0628\u0639\u062F",annexEmptyBody:"\u0646\u0635 \u0623\u0648 \u0635\u0648\u0631\u0629 \u0623\u0648 \u062C\u062F\u0648\u0644 \u0623\u0648 \u0645\u0633\u062A\u0646\u062F \u064A\u0628\u0642\u0649 \u0638\u0627\u0647\u0631\u064B\u0627 \u0637\u0648\u0627\u0644 \u0627\u0644\u062A\u0642\u064A\u064A\u0645 \u0623\u062B\u0646\u0627\u0621 \u0625\u062C\u0627\u0628\u0629 \u0627\u0644\u0637\u0644\u0627\u0628.",annexEmptyCta:"\u0625\u0636\u0627\u0641\u0629 \u0645\u064F\u0644\u062D\u064E\u0642",annexEmptyDismiss:"\u0625\u062E\u0641\u0627\u0621","timeUp.title":"\u0627\u0646\u062A\u0647\u0649 \u0627\u0644\u0648\u0642\u062A","timeUp.submitting":"\u062C\u0627\u0631\u064D \u0625\u0631\u0633\u0627\u0644 \u0625\u062C\u0627\u0628\u0627\u062A\u0643\u2026",yourScore:"\u0646\u062A\u064A\u062C\u062A\u0643",answersSaving:"\u062C\u0627\u0631\u064D \u0627\u0644\u062D\u0641\u0638\u2026",answersSaved:"\u062A\u0645 \u062D\u0641\u0638 \u0627\u0644\u0625\u062C\u0627\u0628\u0627\u062A",answersNotSaved:"\u0644\u0627 \u064A\u062A\u0645 \u062D\u0641\u0638 \u0625\u062C\u0627\u0628\u0627\u062A\u0643. \u062A\u062D\u0642\u0651\u0642 \u0645\u0646 \u0627\u062A\u0635\u0627\u0644\u0643.",resumeRestored:"\u0645\u0631\u062D\u0628\u064B\u0627 \u0628\u0639\u0648\u062F\u062A\u0643. \u0625\u062C\u0627\u0628\u0627\u062A\u0643 \u0647\u0646\u0627.",resumeFresh:"\u0645\u0631\u062D\u0628\u064B\u0627 \u0628\u0639\u0648\u062F\u062A\u0643.",resumeTimeLeft:"\u0627\u0633\u062A\u0645\u0631\u0651 \u0627\u0644\u0645\u0624\u0642\u0651\u062A: \u062A\u0628\u0642\u0651\u0649 {minutes} \u062F\u0642\u064A\u0642\u0629.",close:"\u0625\u063A\u0644\u0627\u0642"},yr={en:nl,fr:al,ar:ol};function sl(e,r,t){let a=(yr[e]??yr.en)[r]??yr.en[r]??r;return t?Object.entries(t).reduce((s,[o,i])=>s.replace(`{${o}}`,String(i)),a):a}function mo(e,r){let t=new Intl.PluralRules(e).select(r),n=yr[e]??yr.en;return n[`points.${t}`]??n.points??yr.en.points}function uo(e){return(r,t)=>sl(e,r,t)}function fo(e){return e==="ar"}var ho="48rem";import"katex/dist/katex.min.css";cr(`.edpire-annex-layout{display:flex;flex:1;min-width:0;height:100%;overflow:hidden;position:relative}.edpire-annex-main{flex:1;min-width:0;overflow:hidden;display:flex;flex-direction:column}.edpire-annex-panel{width:38%;min-width:calc(280px * var(--edp-scale, 1));max-width:calc(480px * var(--edp-scale, 1));flex-shrink:0;display:flex;flex-direction:column;border-right:1px solid #e5e7eb;background:#fff;overflow:hidden}.edpire-annex-panel__header{flex-shrink:0;padding:calc(12px * var(--edp-scale, 1)) calc(20px * var(--edp-scale, 1));border-bottom:1px solid #f3f4f6;background:#f9fafb}.edpire-annex-panel__header-label{font-size:calc(11px * var(--edp-scale, 1));font-weight:700;text-transform:uppercase;letter-spacing:.08em;color:#6b7280}.edpire-annex-panel__scroll{flex:1;overflow-y:auto;padding:calc(24px * var(--edp-scale, 1)) calc(20px * var(--edp-scale, 1));display:flex;flex-direction:column;gap:calc(32px * var(--edp-scale, 1))}.edpire-annex-tab,.edpire-annex-drawer,.edpire-annex-backdrop{display:none}@media(max-width:1023px){.edpire-annex-panel{display:none}.edpire-annex-tab{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:calc(8px * var(--edp-scale, 1));position:fixed;left:0;top:50%;transform:translateY(-50%);z-index:40;background:var(--edpire-annex-tab-bg, #2563eb);color:var(--edpire-annex-tab-color, #ffffff);border:none;border-radius:0 calc(10px * var(--edp-scale, 1)) calc(10px * var(--edp-scale, 1)) 0;padding:calc(18px * var(--edp-scale, 1)) calc(10px * var(--edp-scale, 1));cursor:pointer;box-shadow:2px 2px 16px #0000002e;transition:filter .15s}.edpire-annex-tab:hover{filter:brightness(.88)}.edpire-annex-tab__label{writing-mode:vertical-rl;text-orientation:mixed;transform:rotate(180deg);font-size:calc(11px * var(--edp-scale, 1));font-weight:700;letter-spacing:.07em;text-transform:uppercase;white-space:nowrap}.edpire-annex-drawer{display:flex;flex-direction:column;position:fixed;left:0;top:0;bottom:0;width:min(84vw,calc(440px * var(--edp-scale, 1)));background:#fff;z-index:50;transform:translate(-100%);transition:transform .28s cubic-bezier(.4,0,.2,1);box-shadow:4px 0 32px #00000021;overflow:hidden}.edpire-annex-drawer--open{transform:translate(0)}.edpire-annex-drawer__header{display:flex;align-items:center;justify-content:space-between;padding:calc(16px * var(--edp-scale, 1)) calc(20px * var(--edp-scale, 1));border-bottom:1px solid #f3f4f6;background:#f9fafb;flex-shrink:0}.edpire-annex-drawer__label{font-size:calc(13px * var(--edp-scale, 1));font-weight:700;color:#111827}.edpire-annex-drawer__close{display:flex;align-items:center;justify-content:center;width:calc(28px * var(--edp-scale, 1));height:calc(28px * var(--edp-scale, 1));background:none;border:none;cursor:pointer;font-size:calc(20px * var(--edp-scale, 1));line-height:1;color:#9ca3af;border-radius:calc(6px * var(--edp-scale, 1));transition:color .15s,background .15s}.edpire-annex-drawer__close:hover{color:#111827;background:#f3f4f6}.edpire-annex-drawer__scroll{flex:1;overflow-y:auto;padding:calc(24px * var(--edp-scale, 1)) calc(20px * var(--edp-scale, 1));display:flex;flex-direction:column;gap:calc(32px * var(--edp-scale, 1))}.edpire-annex-backdrop{display:block;position:fixed;inset:0;background:#00000061;z-index:45;cursor:pointer}}
66
- `);import{Fragment as bn,jsx as L,jsxs as W}from"react/jsx-runtime";var ul="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%234f46e5'%3E%3Cpath d='M12 2L2 7v10l10 5 10-5V7L12 2zm0 2.18L19.5 8 12 11.82 4.5 8 12 4.18zM4 9.6l7 3.5v7.3L4 16.9V9.6zm9 10.8v-7.3l7-3.5v7.3L13 20.4z'/%3E%3C/svg%3E";function fl(e){for(let r of e.exercises)for(let t of r.questions)if((t.content.content??[]).some(a=>a.type==="aiAnswerInput"))return!0;return!1}function ko(e){let r=e;return typeof r.totalMaxScore=="number"?r.totalMaxScore:(r.answerKeys??[]).reduce((t,n)=>t+(n.scoring?.maxScore??0),0)}function vo(e){return e.questions.reduce((r,t)=>r+ko(t),0)}function Ve(e){return Number.isInteger(e)?String(e):parseFloat(e.toFixed(2)).toString()}var gn=5;function Ro(e){return e==="full"?"#1f8a4c":e==="partial"?"#c8810e":"#d23b2b"}function hl({outcome:e}){let r=e==="full"?"M20 54 L41 75 L82 24":e==="none"?"M27 27 L73 73 M73 27 L27 73":"M14 58 C29 33 40 33 52 51 C64 69 74 69 88 42";return L("svg",{width:14,height:14,viewBox:"0 0 100 100",fill:"none",stroke:Ro(e),strokeWidth:9,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:L("path",{d:r})})}function gl({score:e,weight:r,unit:t,t:n}){if(e){if(e.awaiting)return W("span",{className:"inline-flex items-center gap-1 rounded-lg border border-[#f2e2bf] bg-[#fbf1dc] px-2 py-0.5 text-xs font-semibold text-[#8a5a08]",children:[L(vr,{size:11}),n("pendingReview")]});let a=e.m>0&&e.s>=e.m?"full":e.s>0?"partial":"none";return W("span",{className:"inline-flex items-center gap-1.5 rounded-lg border border-[#e7e5e0] bg-[#f5f4f1] ps-2 pe-2.5 py-0.5",children:[L(hl,{outcome:a}),W("span",{className:"font-bold leading-none",style:{fontFamily:'var(--font-hand, "Caveat", cursive)',fontSize:"1.05rem",color:Ro(a)},children:[Ve(e.s)," / ",Ve(e.m)]})]})}return r>0?W("span",{className:"text-xs font-semibold tabular-nums text-[#8d93a0]",children:[Ve(r)," ",t(r)]}):null}function wo(e){let r=new Map;for(let t of e?.exerciseAnswers??[])for(let n of t.questionAnswers)r.set(n.questionId,n.answers);return r}function bl(e,r){return r.size===0?e:{exerciseAnswers:e.exerciseAnswers.map(t=>({...t,questionAnswers:t.questionAnswers.map(n=>n.answers.length===0&&r.has(n.questionId)?{...n,answers:r.get(n.questionId)}:n)}))}}function xl({timeLimitMinutes:e,startedAt:r,onExpire:t}){let n=e*6e4,a=new Date(r).getTime()+n,[s,o]=Oe(()=>Math.max(a-Date.now(),0)),i=Mr(t);i.current=t,kt(()=>{if(s<=0){i.current();return}let b=setInterval(()=>{let v=Math.max(a-Date.now(),0);o(v),v<=0&&(clearInterval(b),i.current())},1e3);return()=>clearInterval(b)},[a]);let c=s/n,l=c<.1?"bg-[#fdeeec] text-[#a32b1e] border-[#f6cfc9] animate-pulse":c<.25?"bg-[#fbf1dc] text-[#8a5a08] border-[#f2e2bf]":"bg-[#f5f4f1] text-[#565b66] border-[#e7e5e0]",d=Math.ceil(s/1e3),p=Math.floor(d/3600),m=Math.floor(d%3600/60),g=d%60,u=p>0?`${p}:${String(m).padStart(2,"0")}:${String(g).padStart(2,"0")}`:`${m}:${String(g).padStart(2,"0")}`;return W("span",{className:se("inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full border text-xs font-bold tabular-nums transition-colors",l),children:[L(vr,{size:12}),u]})}function $r({assessment:e,meta:r,locale:t="en",branding:n,timeLimitMinutes:a,startedAt:s,initialAnswers:o,onAnswersChange:i,saveState:c,resumed:l=!1,onSubmit:d,review:p,onViewReport:m,reportLabel:g,onBack:u,backLabel:b,allowReset:v,onReset:w,overlayConfig:x,contained:_=!1,layout:h,onClose:y,mediaHandler:C,onAddAnnex:P,fallbackLogoUrl:$}){let R=Le(()=>uo(t),[t]),f=Je(O=>mo(t,O),[t]),I=fo(t)?"rtl":"ltr",A=Mr(null),H=Mr(null);kt(()=>{let O=H.current,J=A.current;if(!O||!J||typeof ResizeObserver>"u")return;let pe=()=>J.style.setProperty("--edp-bar",`${O.offsetHeight}px`);pe();let ye=new ResizeObserver(pe);return ye.observe(O),()=>ye.disconnect()},[]);let S=h?.maxWidth??ho,N=n?.branding?.primaryColor,j=n?.branding?.accentColor,z=n?.branding?.fontFamily,q=n?.branding?.fontUrl,G=n?.branding?.showPoweredBy!==!1;kt(()=>{if(!q||typeof document>"u"||document.querySelector(`link[href="${q}"]`))return;let J=document.createElement("link");J.rel="stylesheet",J.href=q,document.head.appendChild(J)},[q]);let[D,X]=Oe(()=>p?.answers??o??{exerciseAnswers:[]}),[k]=Oe(()=>p?new Map:wo(o)),T=Mr(i);T.current=i;let F=Je(O=>{let J=bl(O,k);X(J),T.current?.(J)},[k]),[U,Q]=Oe(null);kt(()=>{Q(Date.now())},[]);let[be,ie]=Oe(l&&!p),ae=Le(()=>{if(U===null||!a||a<=0||!s)return null;let O=new Date(s).getTime()+a*6e4-U;return O>0?Math.max(1,Math.floor(O/6e4)):null},[U,a,s]),[ee,ne]=Oe(!1),[Ne,Qe]=Oe(!1),[V,kn]=Oe(p?.result??null),Rn=Le(()=>wo(p?.answers),[p]),[Sn,zr]=Oe(null),[Rt,_n]=Oe(!1),Cn=Mr(!1),Lo=Le(()=>fl(e),[e]),An=Le(()=>Ne?po(e,D):[],[Ne,e,D]),wr=An.length,Io=Je(O=>{Qe(!1);let J=A.current?.querySelectorAll(`[data-question-id="${CSS.escape(O)}"]`),pe=Array.from(J??[]).find(ye=>ye.getClientRects().length>0);pe&&requestAnimationFrame(()=>pe.scrollIntoView({block:"start",behavior:"smooth"}))},[]),St=Le(()=>e.exercises.reduce((O,J)=>O+vo(J),0),[e]),_t=Le(()=>V?mn(V.exerciseFeedback):void 0,[V]),Nn=Le(()=>{let O=new Map;for(let J of V?.exerciseFeedback??[])for(let pe of J.questions)pe.explanation&&O.set(pe.questionId,pe);return O},[V]),En=Le(()=>{if(!V)return{};let O={};for(let J of V.exerciseFeedback){let pe=0,ye=0,he=!1;for(let lr of J.questions)for(let Fe of lr.nodeResults)pe+=Fe.score,ye+=Fe.maxScore,Fe.status==="awaiting_review"&&(he=!0);O[J.exerciseId]={score:pe,maxScore:ye,awaiting:he}}return O},[V]),Pn=Le(()=>{if(!V)return{};let O={};for(let J of V.exerciseFeedback)for(let pe of J.questions){let ye=0,he=0,lr=!1;for(let Fe of pe.nodeResults)ye+=Fe.score,he+=Fe.maxScore,Fe.status==="awaiting_review"&&(lr=!0);O[pe.questionId]={score:ye,maxScore:he,awaiting:lr}}return O},[V]),Mo=Je(async()=>{ne(!0),zr(null);try{let O=await d(D);kn(O),typeof window<"u"&&window.scrollTo({top:0,behavior:"smooth"})}catch(O){zr(O instanceof Error?O.message:R("confirmCancel"))}finally{ne(!1),Qe(!1)}},[D,d,R]),Tn=Je(()=>{!V||!m||m(V)},[V,m]),$o=Je(()=>{Cn.current||ee||V||(Cn.current=!0,_n(!0),Qe(!1),typeof document<"u"&&document.activeElement?.blur(),setTimeout(()=>{ne(!0),zr(null),d(D).then(O=>{kn(O),typeof window<"u"&&window.scrollTo({top:0,behavior:"smooth"})}).catch(O=>{zr(O instanceof Error?O.message:"submit_error")}).finally(()=>{ne(!1),_n(!1)})},800))},[D,ee,d,V]),Ct=Je((O,J,pe)=>{let ye=vo(O),he=En[O.id],lr=O.questions.length>1,Fe=bo(J)?go(J,{renderQuestion:(Fr,Et,Do)=>{let Ge=Fr.id,Ln=k.get(Ge),In={...C?{mediaHandler:C}:{},...p?{initialAnswers:Rn.get(Ge)??[],readOnly:!0}:Ln?{initialAnswers:Ln}:{}},Mn=Object.keys(In).length>0&&bo(Et)?go(Et,In):Et,Pt=Nn.get(Ge),$n=Pt?.explanation?L(lo,{content:Pt.explanation,nodeResults:Pt.nodeResults,label:R("explanation")}):null;if(!lr)return W("div",{"data-question-id":Ge,children:[Mn,$n]},Ge);let jr=Pn[Ge],Oo=ko(Fr);return W("div",{"data-question-id":Ge,children:[W("div",{className:"flex items-center gap-2.5 mb-3",children:[L("span",{className:"inline-flex items-center rounded-lg border border-[#e7e5e0] bg-[#f1efe9] px-3 py-1 text-xs font-bold tracking-tight text-[#1d2025]",children:R("question",{index:Do+1})}),L(gl,{score:jr?{s:jr.score,m:jr.maxScore,awaiting:jr.awaiting}:null,weight:Oo,unit:f,t:R})]}),Mn,$n]},Ge)},renderSeparator:Fr=>L("div",{className:"border-t border-[#e7e5e0] my-1"},`qsep-${Fr}`)}):J;return W("div",{"data-exercise-id":O.id,className:"bg-white rounded-[14px] border border-[#e7e5e0] shadow-sm overflow-hidden",children:[W("div",{className:"flex items-center justify-between px-4 py-2.5 bg-[#f1efe9] border-b border-[#e7e5e0]",style:j?{backgroundColor:j}:void 0,children:[L("span",{className:"text-sm font-bold text-[#1d2025]",children:R("exercise",{index:pe+1})}),he?.awaiting?W("span",{className:"inline-flex items-center gap-1 text-xs font-semibold text-[#8a5a08] bg-[#fbf1dc] border border-[#f2e2bf] rounded-full px-2 py-0.5",children:[L(vr,{size:11}),R("pendingReview")]}):he?W("span",{className:"font-bold leading-none tabular-nums",style:{fontFamily:'var(--font-hand, "Caveat", cursive)',fontSize:"1.15rem",color:he.maxScore>0&&he.score>=he.maxScore?"#1f8a4c":he.maxScore>0&&he.score>0?"#c8810e":he.maxScore>0?"#d23b2b":"#8d93a0"},children:[Ve(he.score)," / ",Ve(he.maxScore)]}):ye>0?W("span",{className:"text-xs font-semibold text-[#8d93a0] tabular-nums",children:["/ ",Ve(ye)," ",f(ye)]}):null]}),L("div",{className:"p-4",children:Fe})]},O.id)},[R,f,En,Pn,j,C,p,Rn,k,Nn]),zo=Le(()=>pn(e).length>0,[e]),At=Je(O=>W("div",{className:"flex items-center gap-3 py-2",children:[L("div",{className:"flex-1 border-t border-dashed border-[#e7e5e0]"}),L("span",{className:"text-[10px] font-bold text-[#8d93a0] uppercase tracking-widest",children:R("exercise",{index:O+2})}),L("div",{className:"flex-1 border-t border-dashed border-[#e7e5e0]"})]},`sep-${O}`),[R]),Nt=G?L("p",{className:"pt-2 pb-1 text-center text-xs text-[#8d93a0] select-none",children:R("poweredBy")}):null,Ie=V!==null,Dr=V?.showVerdict!==!1,Or=Dr?V?.passed?"#1f8a4c":"#d23b2b":"#1d2025";return L("div",{className:"edpire-scope",style:{display:"contents"},children:W("div",{ref:A,dir:I,className:se("flex flex-col [--edp-bar:0px] [&_[data-exercise-id]]:scroll-mt-[calc(var(--edp-bar)+0.75rem)] [&_[data-question-id]]:scroll-mt-[calc(var(--edp-bar)+0.75rem)]",_?"h-full":"min-h-dvh"),style:z?{fontFamily:z}:void 0,children:[L(eo,{visible:ee&&!Rt,hasAiNodes:Lo,text:R("evaluating"),aiText:R("aiEvaluating"),contained:_,...x}),Rt&&W("div",{className:se("fixed inset-0 z-50 flex flex-col items-center justify-center gap-3 bg-red-950/80 backdrop-blur-sm",_&&"absolute"),children:[L(vr,{size:40,className:"text-red-300"}),L("p",{className:"text-xl font-black text-white tracking-tight",children:R("timeUp.title")}),L("p",{className:"text-sm text-red-200",children:R("timeUp.submitting")})]}),W("div",{ref:H,className:"sticky top-0 z-10 flex-shrink-0 flex items-center justify-between px-4 py-2.5 border-b border-[#e7e5e0] bg-[#fbfaf7]",style:j?{backgroundColor:j}:void 0,children:[W("div",{className:"flex items-center gap-3",children:[L("img",{src:n?.logoUrl??$??ul,alt:n?.name??"Edpire",width:24,height:24,loading:"lazy",className:"rounded object-contain"}),W("div",{children:[L("h1",{className:"text-sm font-bold text-[#1d2025]",children:r.title}),L("p",{className:"text-[11px] text-[#8d93a0]",children:St>0&&W("span",{className:"ms-2 font-semibold text-[#565b66]",children:["/ ",Ve(St)," ",f(St)]})})]}),!Ie&&U!==null&&a&&a>0&&s&&L(xl,{timeLimitMinutes:a,startedAt:s,onExpire:$o}),!Ie&&(c==="saving"||c==="saved")&&W("span",{role:"status",className:"hidden sm:inline-flex items-center gap-1 text-[11px] font-medium text-[#8d93a0]",children:[c==="saved"?L(pl,{size:12}):L(fn,{size:12,className:"animate-spin"}),R(c==="saved"?"answersSaved":"answersSaving")]})]}),W("div",{className:"flex items-center gap-2",children:[v&&W("button",{onClick:w,className:"flex items-center gap-1.5 px-3 py-2 text-sm font-medium text-[#565b66] hover:text-[#1d2025] hover:bg-[#f1efe9] rounded-lg transition-colors",children:[L(ll,{size:13}),R("reset")]}),(!Ie||p)&&u&&W("button",{onClick:u,className:"flex items-center gap-1.5 px-3 py-2 text-sm font-medium text-[#565b66] hover:text-[#1d2025] hover:bg-[#f1efe9] rounded-lg transition-colors",children:[L(hn,{size:13}),b??R("back")]}),y&&L("button",{onClick:y,className:"p-1.5 text-[#8d93a0] hover:text-[#1d2025] hover:bg-[#f1efe9] rounded-lg transition-colors",children:L(hn,{size:15})}),!Ie&&L("button",{onClick:()=>Qe(!0),disabled:ee,style:N?{backgroundColor:N}:void 0,className:"flex flex-shrink-0 items-center gap-2 px-3.5 sm:px-4 py-2 bg-[#1d2025] text-white text-sm font-semibold rounded-lg hover:bg-[#31353c] transition-colors disabled:opacity-50",children:ee?W(bn,{children:[L(fn,{size:14,className:"animate-spin"}),R("submitting")]}):W(bn,{children:[L(xo,{size:14}),L("span",{className:"sm:hidden",children:R("confirmSubmit")}),L("span",{className:"hidden sm:inline",children:R("submit")})]})})]})]}),Sn&&L("div",{className:"flex-shrink-0 bg-[#fdeeec] border-b border-[#f6cfc9] px-4 py-2 text-sm text-[#a32b1e]",children:Sn}),!Ie&&c==="failed"&&W("div",{role:"alert",className:"flex-shrink-0 flex items-center gap-2 bg-[#fbf1dc] border-b border-[#f2e2bf] px-4 py-2 text-sm font-semibold text-[#8a5a08]",children:[L(ml,{size:15,className:"flex-shrink-0"}),R("answersNotSaved")]}),!Ie&&be&&(k.size>0||ae!==null)&&W("div",{role:"status",className:"flex-shrink-0 flex items-center gap-2 bg-[#f5f4f1] border-b border-[#e7e5e0] px-4 py-2 text-sm text-[#1d2025]",children:[ae!==null&&L(vr,{size:15,className:"flex-shrink-0 text-[#565b66]"}),W("span",{className:"flex-1 min-w-0",children:[k.size>0?R("resumeRestored"):R("resumeFresh"),ae!==null&&W(bn,{children:[" ",R("resumeTimeLeft",{minutes:ae})]})]}),L("button",{type:"button",onClick:()=>ie(!1),"aria-label":R("close"),className:"flex-shrink-0 p-1 rounded-md text-[#8d93a0] hover:text-[#1d2025] hover:bg-[#e7e5e0] transition-colors",children:L(hn,{size:14})})]}),Ie&&V&&(V.awaitingManualGrading?L("div",{className:"flex-shrink-0 border-b bg-[#fbf1dc] border-[#f2e2bf]",children:L("div",{className:"mx-auto px-4 py-3 sm:px-6 sm:py-4",style:{maxWidth:S},children:W("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2 sm:gap-4",children:[W("div",{className:"flex items-center gap-2",children:[L(vr,{size:20,className:"text-[#c8810e] flex-shrink-0"}),L("span",{className:"text-sm font-semibold text-[#8a5a08]",children:V.aiPending?R("beingMarked"):R("awaitingReview")})]}),L("div",{className:"hidden sm:block w-px h-8 bg-[#f2e2bf]"}),L("p",{className:"text-sm text-[#8a5a08] flex-1 min-w-0",children:V.aiPending?R("beingMarkedDesc"):R("awaitingReviewDesc")}),m&&W("button",{onClick:Tn,style:N?{backgroundColor:N}:void 0,className:"flex-shrink-0 flex items-center gap-2 px-4 py-2 bg-[#1d2025] text-white text-sm font-semibold rounded-lg hover:bg-[#31353c] transition-colors",children:[L(yo,{size:14}),g??R("viewFullReport")]})]})})}):L("div",{className:se("flex-shrink-0 border-b",Dr?V.passed?"bg-[#ecf8f0] border-[#c5e8d1]":"bg-[#fdeeec] border-[#f6cfc9]":"bg-[#f5f4f1] border-[#e7e5e0]"),children:L("div",{className:"mx-auto px-4 py-3 sm:px-6 sm:py-4",style:{maxWidth:S},children:W("div",{className:"flex flex-wrap sm:flex-nowrap items-center gap-x-4 gap-y-2",children:[W("div",{className:"flex items-center gap-2",children:[Dr?V.passed?L(il,{size:20,className:"text-[#1f8a4c] flex-shrink-0"}):L(cl,{size:20,className:"text-[#d23b2b] flex-shrink-0"}):null,L("span",{className:"text-sm font-semibold",style:{color:Or},children:Dr?V.passed?R("assessmentPassed"):R("assessmentNotPassed"):R("yourScore")})]}),L("div",{className:"hidden sm:block w-px h-8 bg-[#e7e5e0]"}),W("div",{className:"flex items-baseline gap-1.5",children:[W("span",{className:"leading-none tabular-nums text-[1.6rem] sm:text-[2rem]",style:{fontFamily:'var(--font-hand, "Caveat", cursive)',color:Or},children:[Ve(V.totalScore)," / ",Ve(V.maxScore)]}),L("span",{className:"text-sm text-[#8d93a0] font-medium",children:f(V.maxScore)})]}),W("div",{className:"flex-1 flex items-center gap-3 min-w-[140px]",children:[L("div",{className:"flex-1 h-2 bg-[#e7e5e0] rounded-full overflow-hidden min-w-[80px]",children:L("div",{className:"h-full rounded-full transition-all duration-700",style:{width:`${V.percentage}%`,backgroundColor:Or}})}),W("span",{className:"text-sm font-bold tabular-nums flex-shrink-0",style:{color:Or},children:[V.percentage,"%"]})]}),m&&W("button",{onClick:Tn,style:N?{backgroundColor:N}:void 0,className:"flex-shrink-0 flex items-center gap-2 px-4 py-2 bg-[#1d2025] text-white text-sm font-semibold rounded-lg hover:bg-[#31353c] transition-colors",children:[L(yo,{size:14}),g??R("viewFullReport")]})]})})})),L("div",{className:se("flex-1 flex flex-col",_&&"overflow-hidden",Rt&&"pointer-events-none opacity-60"),children:e.annex||zo?L(oo,{assessment:e,isSubmitted:Ie,setAnswers:F,validationFeedback:_t,renderExercise:Ct,renderSeparator:At,primaryColor:N,contained:_,locale:t,contentMaxWidth:S,t:R,footer:Nt}):P?L(io,{assessment:e,isSubmitted:Ie,setAnswers:F,validationFeedback:_t,renderExercise:Ct,renderSeparator:At,primaryColor:N,contained:_,locale:t,contentMaxWidth:S,t:R,onAddAnnex:P,footer:Nt}):L("div",{className:se("flex-1",_&&"overflow-y-auto"),children:W("div",{className:"mx-auto p-6 flex flex-col gap-4",style:{maxWidth:S},children:[L(Xe,{assessment:e,onAnswersChange:Ie?void 0:F,validationFeedback:_t,renderExercise:Ct,renderSeparator:At,locale:t}),Nt]})})}),Ne&&L("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",children:W("div",{role:"dialog","aria-modal":"true","aria-labelledby":"edpire-submit-confirm-title",className:"bg-white rounded-[14px] shadow-xl p-6 max-w-sm mx-4",children:[L("h3",{id:"edpire-submit-confirm-title",className:"text-base font-bold text-[#1d2025] mb-2",children:R("confirmTitle")}),wr>0&&W("div",{className:"text-sm text-[#8a5a08] bg-[#fbf1dc] border border-[#f2e2bf] rounded-lg px-3 py-2 mb-3",children:[W("p",{className:"flex items-start gap-2 font-semibold",children:[L(dl,{size:15,className:"flex-shrink-0 mt-px"}),L("span",{children:wr===1?R("unansweredOne"):R("unansweredMany",{count:wr})})]}),W("ul",{className:"mt-1 ps-[23px] flex flex-col gap-0.5",children:[An.slice(0,gn).map(O=>L("li",{children:L("button",{type:"button",onClick:()=>Io(O.questionId),className:"text-start underline underline-offset-2 hover:text-[#1d2025] cursor-pointer",children:O.only?R("exercise",{index:O.exerciseIndex+1}):`${R("exercise",{index:O.exerciseIndex+1})} \xB7 ${R("question",{index:O.questionIndex+1})}`})},O.questionId)),wr>gn&&L("li",{children:R("unansweredMore",{count:wr-gn})})]})]}),L("p",{className:"text-sm text-[#565b66] mb-5",children:R("confirmDescription")}),W("div",{className:"flex gap-3 justify-end",children:[L("button",{onClick:()=>Qe(!1),className:"px-4 py-2 text-sm font-medium text-[#565b66] hover:bg-[#f1efe9] rounded-lg transition-colors",children:R("confirmCancel")}),W("button",{onClick:Mo,disabled:ee,style:N?{backgroundColor:N}:void 0,className:"flex items-center gap-2 px-4 py-2 bg-[#1d2025] text-white text-sm font-semibold rounded-lg hover:bg-[#31353c] transition-colors disabled:opacity-50",children:[ee?L(fn,{size:14,className:"animate-spin"}):L(xo,{size:14}),R("confirmSubmit")]})]})]})})]})})}function xn(e){return(e??[]).map(r=>({exerciseId:r.exercise_id,questions:r.questions.map(t=>({questionId:t.question_id,...t.explanation?{explanation:t.explanation}:{},nodeResults:t.node_results.map(n=>({nodeId:n.node_id,status:n.status,score:n.score,maxScore:n.max_score,...n.feedback!==void 0?{feedback:n.feedback}:{},...n.display_answer!==void 0?{displayAnswer:n.display_answer}:{},...n.detail!==void 0?{detail:n.detail}:{},...n.teacher_feedback!==void 0?{teacherFeedback:n.teacher_feedback}:{}}))}))}))}import{jsx as wl}from"react/jsx-runtime";function yn(e,r){let t=xn(e.exercise_feedback);return{submissionId:e.submission_id,totalScore:e.score,maxScore:e.max_score,percentage:e.percentage,passed:e.passed,returnUrl:r??null,exerciseFeedback:t,awaitingManualGrading:e.awaiting_manual_grading??!1,aiPending:e.ai_pending??!1}}function vn(e){return{annex:e.annex??void 0,exercises:e.exercises.map(r=>({id:r.id,sharedContext:r.sharedContext,questions:r.questions.map(t=>({id:t.id,version:"1.0",content:t.content,answerKeys:[]}))}))}}function _o({token:e,data:r,baseUrl:t,options:n}){let{locale:a,branding:s,returnUrl:o,reportLabel:i,backLabel:c,onBack:l,overlayConfig:d,layout:p,mediaHandler:m,onComplete:g,onError:u}=n,b=s??r.branding??void 0,v=a??r.meta.language??"en",w=yl(()=>vn(r.assessment),[r]),[x]=vl(()=>new Date().toISOString()),_=So(async y=>{let C=await fetch(`${t}/api/v1/embed/submit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:e,answers:y})});if(!C.ok){let $=await C.json().catch(()=>({})),R=typeof $.error=="string"?$.error:"Submission failed",f=C.status===401?"TOKEN_INVALID":C.status===409?"TOKEN_USED":C.status===404?"ASSESSMENT_NOT_FOUND":"UNKNOWN";throw u?.({code:f,message:R}),new Error(R)}let P=await C.json();return g?.(P),yn(P,o)},[t,e,g,u,o]),h=So(y=>{if(o)try{let C=new URL(o);C.searchParams.set("submission_id",y.submissionId),y.awaitingManualGrading||(C.searchParams.set("score",String(y.totalScore)),C.searchParams.set("max_score",String(y.maxScore))),window.location.href=C.toString()}catch{window.location.href=o}},[o]);return wl($r,{assessment:w,meta:{title:r.meta.title,category:r.meta.category??null},locale:v,branding:b,timeLimitMinutes:r.meta.settings.time_limit_minutes,startedAt:x,onSubmit:_,onViewReport:o?h:void 0,reportLabel:i,onBack:l,backLabel:c,overlayConfig:d,layout:p,mediaHandler:m})}import{useMemo as Co}from"react";import{jsx as Rl}from"react/jsx-runtime";function kl(){return Promise.reject(new Error("A review cannot be submitted"))}function Ao({review:e,locale:r,branding:t,layout:n,onBack:a,backLabel:s}){let o=Co(()=>vn(e.assessment),[e]),i=Co(()=>({answers:e.answers,result:yn({submission_id:e.submission.id,score:e.submission.score,max_score:e.submission.max_score,percentage:e.submission.percentage,passed:e.submission.passed,awaiting_manual_grading:e.submission.awaiting_manual_grading,ai_pending:e.submission.ai_pending,exercise_feedback:e.exercise_feedback})}),[e]),c=r??e.meta.language??"en";return Rl($r,{assessment:o,meta:{title:e.meta.title,category:e.meta.category??null},locale:c,branding:t??e.branding??void 0,review:i,onSubmit:kl,onBack:a,backLabel:s,layout:n})}import hg from"react";import{createRoot as bg}from"react-dom/client";var Sl="https://edpire.com";function Po(e,r,t){e.textContent="";let n=document.createElement("div");n.style.cssText="padding:32px;text-align:center;color:#dc2626;font-family:sans-serif";let a=document.createElement("div");if(a.textContent=r,n.appendChild(a),t){let s=document.createElement("div");s.style.cssText="margin-top:8px;font-size:13px;color:#6b7280",s.textContent=t,n.appendChild(s)}e.appendChild(n)}var To={mount(e){let{token:r,container:t,baseUrl:n=Sl,onError:a}=e,s=typeof t=="string"?document.querySelector(t):t;if(!s){let l={code:"UNKNOWN",message:`Container not found: ${t}`};return a?.(l),{unmount:()=>{}}}let o=null,i=!1;function c(){if(i)return;i=!0;let l=o;o=null,setTimeout(()=>{l?.unmount()},0)}return(async()=>{s.innerHTML='<div style="padding:32px;text-align:center;color:#6b7280;font-family:sans-serif">Loading assessment\u2026</div>';let l;try{let d=await fetch(`${n}/api/v1/embed/assessments?token=${encodeURIComponent(r)}`,{method:"GET"});if(!d.ok){let p=await d.json().catch(()=>({})),m=typeof p.error=="string"?p.error:"Failed to load assessment",g=d.status===401?"TOKEN_INVALID":d.status===403?"ORIGIN_NOT_ALLOWED":d.status===404?"ASSESSMENT_NOT_FOUND":"UNKNOWN";a?.({code:g,message:m});let u=g==="ORIGIN_NOT_ALLOWED"?`Add ${typeof location<"u"?location.origin:"this origin"} to Allowed Embed Origins in Edpire, under Integrations then Origins.`:"";Po(s,m,u);return}l=await d.json()}catch{a?.({code:"NETWORK_ERROR",message:"Failed to connect to Edpire"}),Po(s,"Failed to connect to Edpire. Please try again.","");return}i||(s.innerHTML="",o=Eo(s),o.render(No.createElement(_o,{token:r,data:l,baseUrl:n,options:e})))})(),{unmount:c}},review(e){let{container:r,...t}=e,n=typeof r=="string"?document.querySelector(r):r;if(!n)return{unmount:()=>{}};n.textContent="";let a=Eo(n);return a.render(No.createElement(Ao,t)),{unmount(){let s=a;a=null,setTimeout(()=>s?.unmount(),0)}}}};import{jsx as Al}from"react/jsx-runtime";function Cl({tokenEndpoint:e,assessmentId:r,tokenBody:t,className:n,style:a,onComplete:s,onError:o,...i}){let c=wn(null),l=wn(s);l.current=s;let d=wn(o);return d.current=o,_l(()=>{let p=c.current;if(!p)return;let m=!1,g=null;return(async()=>{let u;try{let b=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({assessmentId:r,...t})});if(m)return;if(!b.ok){let w=await b.json().catch(()=>({}));d.current?.({code:"TOKEN_INVALID",message:typeof w.error=="string"?w.error:`Token endpoint returned ${b.status}`});return}let v=await b.json();if(!v.token){d.current?.({code:"TOKEN_INVALID",message:"Token endpoint did not return a token"});return}u=v.token}catch{m||d.current?.({code:"NETWORK_ERROR",message:"Failed to fetch embed token"});return}m||(g=To.mount({token:u,container:p,...i,onComplete:b=>l.current?.(b),onError:b=>d.current?.(b)}))})(),()=>{m=!0,g?.unmount()}},[e,r]),Al("div",{ref:c,className:n,style:n?void 0:a??{width:"100%"}})}export{$r as AssessmentShell,Cl as EdpireAssessmentPlayer,Za as EdpireQuestion};
65
+ `}),_e("div",{style:{background:r},className:`${c?"absolute":"fixed"} inset-0 z-[60] flex items-center justify-center`,children:Qn("div",{className:"flex flex-col items-center gap-5 bg-white rounded-2xl shadow-2xl px-10 py-8 max-w-xs text-center",children:[(()=>{if(s)return _e("img",{src:s,alt:"",className:"w-24 h-24 object-contain"});switch(a){case"dots":return _e(Hl,{accent:t});case"pulse":return _e(Vl,{accent:t});case"bars":return _e(Ql,{accent:t});default:return _e(Ul,{accent:t})}})(),_e("p",{className:"text-sm font-semibold text-slate-800",children:n}),i&&_e("p",{className:"text-xs text-slate-500 leading-snug",children:o})]})})]}):null}import{useCallback as ja,useEffect as Yl,useMemo as Ba,useRef as Kt,useState as Kl}from"react";import{BookOpen as qa,X as Xl}from"lucide-react";import{Fragment as Zl,jsx as be,jsxs as je}from"react/jsx-runtime";function Gn(e){return e.exercises.flatMap((r,t)=>r.sharedContext&&ot(r.sharedContext)?[{id:r.id,index:t,title:r.title,content:r.sharedContext}]:[])}var Wa=()=>typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;function Jl(e){e.removeAttribute("data-flash"),e.offsetWidth,e.setAttribute("data-flash","true"),setTimeout(()=>e.removeAttribute("data-flash"),1200)}function Ua({assessment:e,isSubmitted:r,setAnswers:t,validationFeedback:n,renderExercise:o,renderSeparator:a,primaryColor:s,contained:i=!1,locale:c,contentMaxWidth:l,t:d,footer:m}){let[p,g]=Kl(!1),u=e.annex,h=u?.tabLabel||d("annexDocuments"),v=Ba(()=>Gn(e),[e]),R=Kt(null),w=Kt(null),C=Kt(null),y=Kt(null),S=()=>(R.current?.getClientRects().length??0)>0,k=ja((f,q)=>{let A=f?.querySelector(`[data-reference-for="${CSS.escape(q)}"]`);if(!f||!A)return;let L=A.getBoundingClientRect().top-f.getBoundingClientRect().top+f.scrollTop-12;f.scrollTo({top:L,behavior:Wa()?"auto":"smooth"}),Jl(A)},[]),_=ja(f=>{if(S()){k(w.current,f);return}g(!0),requestAnimationFrame(()=>requestAnimationFrame(()=>k(y.current,f)))},[k]),P=f=>{let q=S()?R.current:C.current;S()||g(!1),Array.from(q?.querySelectorAll(`[data-exercise-id="${CSS.escape(f)}"]`)??[]).find(L=>L.getClientRects().length>0)?.scrollIntoView({behavior:Wa()?"auto":"smooth",block:"start"})};Yl(()=>{let f=R.current;if(!f||v.length===0||typeof IntersectionObserver>"u")return;let q=i?f:null,A=new Set(v.map(B=>B.id)),L=null,G=new IntersectionObserver(B=>{if(!S())return;let K=B.filter(le=>le.isIntersecting&&A.has(le.target.dataset.exerciseId??"")).sort((le,ye)=>le.boundingClientRect.top-ye.boundingClientRect.top)[0]?.target?.dataset.exerciseId;!K||K===L||(L=K,k(w.current,K))},{root:q,rootMargin:"0px 0px -60% 0px"});return f.querySelectorAll("[data-exercise-id]").forEach(B=>G.observe(B)),()=>G.disconnect()},[v,k,i]);let F=Ba(()=>({label:h,showExerciseReference:_}),[h,_]),b=je(Zl,{children:[u?.items.map(f=>be(st,{item:f},f.id)),u?.items.length&&v.length?be("div",{className:"border-t border-[#e7e5e0]"}):null,v.map(f=>je("section",{"data-reference-for":f.id,className:"-mx-3 flex flex-col gap-2 rounded-[10px] px-3 py-2 transition-colors duration-700 data-[flash=true]:bg-[#fbf1dc] data-[flash=true]:duration-150",children:[be("button",{type:"button",onClick:()=>P(f.id),className:"self-start cursor-pointer text-xs font-bold uppercase tracking-widest text-[#565b66] underline-offset-4 hover:text-[#1d2025] hover:underline focus-visible:outline-2 focus-visible:outline-[#1d2025] rounded-sm",children:be("span",{dir:"auto",children:Cr(d,f.title,f.index)})}),be(Or,{content:f.content})]},f.id))]}),T=be(dr,{assessment:e,onAnswersChange:r?void 0:t,validationFeedback:n,renderExercise:o,renderSeparator:a,locale:c});return be(Ht,{value:F,children:je("div",{className:ge("@container flex-1 min-h-0 flex",i&&"relative"),children:[je("div",{ref:R,className:ge("hidden @6xl:flex flex-1 min-w-0 gap-4 p-4 bg-[#f5f4f1] items-start",i&&"overflow-y-auto"),children:[je("div",{className:ge("flex-1 sticky flex flex-col bg-white rounded-[14px] border border-[#e7e5e0] shadow-sm overflow-hidden",i?"top-4 max-h-[calc(100svh-6rem)]":"top-[calc(var(--edp-bar)+1rem)] max-h-[calc(100dvh-var(--edp-bar)-2rem)]"),children:[je("div",{className:"flex items-center gap-2 px-5 py-3 border-b border-[#e7e5e0] flex-shrink-0",children:[be(qa,{size:14,className:"text-[#8d93a0]"}),be("span",{className:"text-xs font-bold text-[#565b66] uppercase tracking-widest",children:h})]}),be("div",{ref:w,className:"flex-1 overflow-y-auto px-6 py-5 flex flex-col gap-6",children:b})]}),be("div",{className:"w-px bg-[#e7e5e0] flex-shrink-0 self-stretch my-1 rounded-full"}),be("div",{className:"flex-1 min-w-0 bg-white rounded-[14px] border border-[#e7e5e0] shadow-sm",children:je("div",{className:"px-6 py-5 flex flex-col gap-4",children:[T,m]})})]}),je("div",{className:ge("@6xl:hidden flex-1 min-w-0 relative",i&&"overflow-hidden"),children:[be("div",{ref:C,className:ge(i&&"absolute inset-0 overflow-y-auto"),children:je("div",{className:"mx-auto px-5 py-5 flex flex-col gap-4",style:{maxWidth:l},children:[T,m]})}),p&&be("div",{className:ge("inset-0 z-30 bg-black/25",i?"absolute":"fixed"),onClick:()=>g(!1)}),je("div",{role:"dialog","aria-label":h,"aria-hidden":!p,className:ge("top-1/2 start-2 -translate-y-1/2 z-40 w-[88%] bg-[#f1efe9] rounded-2xl shadow-2xl flex flex-col overflow-hidden transition-transform duration-300 ease-in-out",i?"absolute":"fixed",p?"translate-x-0":"-translate-x-[110%] rtl:translate-x-[110%]"),children:[je("div",{className:"flex items-center justify-between px-5 py-3 flex-shrink-0",children:[be("span",{className:"text-sm font-bold text-[#1d2025]",children:h}),be("button",{onClick:()=>g(!1),"aria-label":d("close"),className:"p-1 text-[#8d93a0] hover:text-[#1d2025] rounded-lg transition-colors",children:be(Xl,{size:18})})]}),be("div",{ref:y,className:"overflow-y-auto max-h-[calc(100dvh-8rem)] px-5 pb-5 flex flex-col gap-5",children:b})]})]}),!p&&je("button",{onClick:()=>g(!0),"aria-label":h,style:{transform:"translateY(-50%)",...s?{backgroundColor:s}:{}},className:ge("@6xl:hidden top-1/2 start-0 z-20 flex flex-col items-center gap-1 py-3 px-1.5 bg-[#1d2025] text-white text-[10px] font-bold uppercase tracking-wider rounded-e-lg shadow-md hover:bg-[#31353c] transition-colors",i?"absolute":"fixed"),children:[be(qa,{size:12}),be("span",{style:{writingMode:"vertical-rl",transform:"rotate(180deg)"},children:h})]})]})})}import{useState as ed}from"react";import{BookOpen as Ha,Plus as rd,X as td}from"lucide-react";import{jsx as Se,jsxs as nr}from"react/jsx-runtime";function Va({assessment:e,isSubmitted:r,setAnswers:t,validationFeedback:n,renderExercise:o,renderSeparator:a,primaryColor:s,contained:i=!1,locale:c,contentMaxWidth:l,t:d,onAddAnnex:m,footer:p}){let[g,u]=ed(!1),h=Se(dr,{assessment:e,onAnswersChange:r?void 0:t,validationFeedback:n,renderExercise:o,renderSeparator:a,locale:c});if(g)return Se("div",{className:"flex-1 overflow-y-auto",children:nr("div",{className:"mx-auto p-6 flex flex-col gap-4",style:{maxWidth:l},children:[h,p]})});let v=C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),m())},R=C=>nr("span",{style:s?{backgroundColor:s}:void 0,className:ge("flex-none inline-flex items-center gap-1.5 rounded-lg bg-[#1d2025] text-white font-semibold shadow-sm group-hover:shadow-md transition-shadow",C?"px-3 py-1.5 text-xs":"mt-1 px-3.5 py-2 text-xs"),children:[Se(rd,{size:13}),d("annexEmptyCta")]}),w=C=>Se("button",{type:"button",onClick:y=>{y.stopPropagation(),u(!0)},"aria-label":d("annexEmptyDismiss"),title:d("annexEmptyDismiss"),className:ge("flex-none flex items-center justify-center w-7 h-7 rounded-lg text-[#8d93a0] hover:text-[#1d2025] hover:bg-[#f1efe9] transition-colors cursor-pointer",C&&"absolute top-2 end-2 z-10"),children:Se(td,{size:15})});return nr("div",{className:ge("@container flex-1 min-h-0 flex",i&&"relative"),children:[nr("div",{className:"hidden @6xl:flex flex-1 gap-4 p-4 bg-[#f5f4f1] items-start overflow-y-auto",children:[Se("div",{className:"flex-1 sticky top-4 flex min-h-[200px] max-h-[calc(100svh-6rem)]",children:nr("div",{role:"button",tabIndex:0,onClick:m,onKeyDown:v,className:"group relative flex-1 w-full flex flex-col items-center justify-center gap-3 text-center rounded-[14px] border-2 border-dashed border-[#d6d3cc] bg-white/60 hover:border-[#8d93a0] hover:bg-white transition-colors cursor-pointer px-6 py-8 outline-none focus-visible:ring-2 focus-visible:ring-[#8d93a0] focus-visible:ring-offset-2",children:[w(!0),Se("span",{className:"flex items-center justify-center w-11 h-11 rounded-full bg-[#f1efe9] text-[#8d93a0] group-hover:text-[#1d2025] transition-colors",children:Se(Ha,{size:20})}),Se("span",{className:"text-sm font-bold text-[#565b66]",children:d("annexEmptyTitle")}),Se("span",{className:"text-xs text-[#8d93a0] max-w-[32ch] leading-relaxed",children:d("annexEmptyBody")}),R(!1)]})}),Se("div",{className:"w-px bg-[#e7e5e0] flex-shrink-0 self-stretch my-1 rounded-full"}),Se("div",{className:"flex-1 bg-white rounded-[14px] border border-[#e7e5e0] shadow-sm",children:nr("div",{className:"px-6 py-5 flex flex-col gap-4",children:[h,p]})})]}),Se("div",{className:"@6xl:hidden flex-1 overflow-y-auto",children:nr("div",{className:"mx-auto px-5 py-5 flex flex-col gap-4",style:{maxWidth:l},children:[nr("div",{role:"button",tabIndex:0,onClick:m,onKeyDown:v,className:"group flex items-center gap-3 rounded-[14px] border-2 border-dashed border-[#d6d3cc] bg-white/60 hover:border-[#8d93a0] hover:bg-white transition-colors cursor-pointer px-4 py-2.5 outline-none focus-visible:ring-2 focus-visible:ring-[#8d93a0]",children:[Se("span",{className:"flex-none flex items-center justify-center w-9 h-9 rounded-full bg-[#f1efe9] text-[#8d93a0] group-hover:text-[#1d2025] transition-colors",children:Se(Ha,{size:16})}),nr("div",{className:"flex-1 min-w-0",children:[Se("div",{className:"text-xs font-bold text-[#565b66]",children:d("annexEmptyTitle")}),Se("div",{className:"text-[11px] text-[#8d93a0] leading-snug",children:d("annexEmptyBody")})]}),R(!0),w(!1)]}),h,p]})})]})}function Yn(e){let r=new Map;for(let t of e){let n=new Map;for(let o of t.questions){let a=new Map;for(let s of o.nodeResults){let i={state:s.status,showFeedback:!0,score:s.score,...s.feedback!==void 0?{message:s.feedback}:{},...s.displayAnswer!==void 0?{displayAnswer:s.displayAnswer}:{},...s.teacherFeedback!==void 0?{teacherFeedback:s.teacherFeedback}:{}};s.detail?.type==="choiceSet"?i.correctChoiceIds=s.detail.correctChoiceIds:s.detail?.type==="matchingSet"&&(i.pairFeedback=s.detail.pairFeedback,i.correctPairings=s.detail.correctPairings),a.set(s.nodeId,i)}n.set(o.questionId,a)}r.set(t.exerciseId,n)}return r}import{Lightbulb as nd}from"lucide-react";import{jsx as Kn,jsxs as Qa}from"react/jsx-runtime";function od(e){return e.length===0||e.some(r=>r.status==="awaiting_review")?null:e.every(r=>r.status==="correct")?"correct":e.some(r=>r.status==="partial"||r.status==="correct"||(r.score??0)>0)?"partial":"incorrect"}function Ga({content:e,nodeResults:r,label:t}){let n=od(r);return Qa("div",{className:`player-ai-feedback mt-3 mb-3${n?` player-ai-feedback--${n}`:""}`,children:[Qa("p",{className:"flex items-center gap-1.5 text-xs font-semibold",children:[Kn(nd,{size:14,"aria-hidden":!0}),t]}),Kn("div",{className:"text-[#1d2025]",children:Kn(Or,{content:e})})]})}import{jsx as or,jsxs as Xn}from"react/jsx-runtime";function Ya({t:e,rtl:r,showClose:t,onContinue:n,continueLabel:o,primaryColor:a}){return Xn("div",{role:"status",className:"edp-thanks flex-1 flex items-center justify-center px-6 py-16",children:[or("style",{children:ad}),Xn("div",{className:"flex flex-col items-center text-center",style:{maxWidth:"26rem"},children:[Xn("div",{className:"relative",style:{width:120,height:120},"aria-hidden":!0,children:[or("svg",{className:"edp-thanks-blob absolute inset-0 overflow-visible",viewBox:"0 0 200 200",width:"120",height:"120",children:or("path",{d:"M104 14c44 2 80 34 82 80s-34 94-86 92S12 150 16 98 58 12 104 14z",fill:"#ffd64a"})}),or("svg",{className:"absolute inset-0 overflow-visible",viewBox:"0 0 100 100",width:"120",height:"120",children:or("path",{className:"edp-thanks-check",d:"M26 54l17 17 33-39",fill:"none",stroke:"#1d2025",strokeWidth:9,strokeLinecap:"round",strokeLinejoin:"round",pathLength:1})})]}),or("h2",{className:"edp-thanks-stamp mt-4 text-[#1d2025]",style:r?{fontSize:36,fontWeight:700,lineHeight:1.3,transform:"rotate(-3deg)"}:{fontFamily:'var(--font-hand, "Caveat", cursive)',fontSize:56,fontWeight:600,lineHeight:1,transform:"rotate(-4deg)"},children:e("formThanks")}),or("p",{className:"edp-thanks-rise mt-4 text-base text-[#565b66]",style:{animationDelay:"750ms"},children:e("formThanksDesc")}),t&&!n&&or("p",{className:"edp-thanks-rise mt-1 text-sm text-[#8a8f99]",style:{animationDelay:"850ms"},children:e("formThanksClose")}),n&&or("button",{onClick:n,style:{animationDelay:"850ms",...a?{backgroundColor:a}:{}},className:"edp-thanks-rise mt-6 px-4 py-2 bg-[#1d2025] text-white text-sm font-semibold rounded-lg hover:bg-[#31353c] transition-colors",children:o??e("continue")})]})]})}var ad=`
66
+ @keyframes edp-thanks-blob-in { from { transform: scale(0) rotate(-25deg); } }
67
+ @keyframes edp-thanks-draw { to { stroke-dashoffset: 0; } }
68
+ @keyframes edp-thanks-stamp-in { from { opacity: 0; transform: scale(1.8) rotate(-4deg); } }
69
+ @keyframes edp-thanks-rise-in { from { opacity: 0; transform: translateY(6px); } }
70
+ .edp-thanks .edp-thanks-blob { transform-origin: 50% 50%; animation: edp-thanks-blob-in 450ms cubic-bezier(.34,1.56,.64,1) 100ms both; }
71
+ .edp-thanks .edp-thanks-check { stroke-dasharray: 1; stroke-dashoffset: 1; animation: edp-thanks-draw 500ms cubic-bezier(.2,.8,.2,1) 300ms forwards; }
72
+ .edp-thanks .edp-thanks-stamp { animation: edp-thanks-stamp-in 350ms cubic-bezier(.34,1.56,.64,1) 550ms both; }
73
+ .edp-thanks .edp-thanks-rise { animation: edp-thanks-rise-in 240ms cubic-bezier(.2,.8,.2,1) both; }
74
+ @media (prefers-reduced-motion: reduce) {
75
+ .edp-thanks * { animation: none !important; }
76
+ .edp-thanks .edp-thanks-check { stroke-dashoffset: 0; }
77
+ }
78
+ `;var sd=new Set(["choiceSet","inlineChoiceSet","blank","aiAnswerInput","matchingSet","openResponseNode","mathResponse","codingResponse"]),id=new Set(["blankPool","inlinePool"]);function cd(e){switch(e.type){case"choiceSet":case"inlineChoiceSet":return e.answer.selectedIds.length>0;case"blank":return e.answer.mode==="choice"?e.answer.choiceId.length>0:e.answer.text.trim().length>0;case"matchingSet":return e.answer.connections.length>0;case"aiAnswer":return e.answer.text.trim().length>0;case"openResponse":{let r=e.answer;return r.recording||r.files&&r.files.length>0?!0:(r.text?.wordCount??0)>0}case"mathResponse":return e.answer.latex.trim().length>0;case"codingResponse":return e.answer.source.trim().length>0;default:{let r=e;return!0}}}function ld(e){let r=0,t=n=>{if(Array.isArray(n)){for(let s of n)t(s);return}if(!n||typeof n!="object")return;let{type:o,content:a}=n;if(typeof o=="string"){if(sd.has(o)){r+=1;return}if(id.has(o))return}a!==void 0&&t(a)};return t(e),r}function Jn(e,r){let t=new Map;for(let o of r?.exerciseAnswers??[])for(let a of o.questionAnswers){let s=t.get(a.questionId);s||(s=new Set,t.set(a.questionId,s));for(let i of a.answers)cd(i)&&s.add(i.nodeId)}let n=[];return e.exercises.forEach((o,a)=>{o.questions.forEach((s,i)=>{let c=ld(s.content);c!==0&&(t.get(s.id)?.size??0)<c&&n.push({questionId:s.id,exerciseIndex:a,...o.title?{exerciseTitle:o.title}:{},questionIndex:i,only:o.questions.length===1})})}),n}function Zn(e,r,t){let n=new Set(t);return n.size===0?[]:Jn(e,r).filter(o=>n.has(o.questionId))}var dd={exercise:"Exercise {index}",question:"Question {index}",points:"pts","points.one":"pt",submit:"Submit Assessment",submitting:"Submitting...",confirmTitle:"Submit Assessment",confirmDescription:"Are you sure you want to submit? You cannot change your answers after submitting.",unansweredOne:"1 question is not fully answered.",unansweredMany:"{count} questions are not fully answered.",unansweredMore:"and {count} more",confirmSubmit:"Submit",confirmCancel:"Cancel",assessmentPassed:"Assessment passed",assessmentNotPassed:"Assessment not passed",awaitingReview:"Awaiting review",awaitingReviewDesc:"Your teacher is reviewing your open responses. Your final score will be available once grading is complete.",submittedNoScore:"Your answers are in",submittedNoScoreDesc:"No score on this one: see below what you got right and what to look at again.",formThanks:"Thank you!",formThanksDesc:"Your answers have been sent.",formThanksClose:"You can close this page.",formSubmit:"Send",formSending:"Sending\u2026",formConfirmTitle:"Send your answers?",formConfirmDescription:"You won't be able to change them after sending.",required:"Required",requiredMissing:"This question is required",requiredBlocked:"A required question is unanswered: answer it, then send again.",continue:"Continue",beingMarked:"Being marked",beingMarkedDesc:"Some answers are still being marked. Your final score will be available once every answer is marked.",pendingReview:"Pending review",viewFullReport:"View Full Report",explanation:"Explanation",poweredBy:"Powered by Edpire",evaluating:"Evaluating your answers\u2026",aiEvaluating:"Some answers are being reviewed by AI, this may take a few seconds.",reset:"Reset",back:"Back",annexDocuments:"Documents",annexEmptyTitle:"No reference yet",annexEmptyBody:"A text, figure, table or document that stays in view across the whole assessment while students answer.",annexEmptyCta:"Add reference",annexEmptyDismiss:"Hide","timeUp.title":"Time's up","timeUp.submitting":"Submitting your answers\u2026",yourScore:"Your score",answersSaving:"Saving\u2026",answersSaved:"Answers saved",answersNotSaved:"Your answers aren't being saved. Check your connection.",resumeRestored:"Welcome back. Your answers are here.",resumeFresh:"Welcome back.",resumeTimeLeft:"The clock kept running: {minutes} min left.",close:"Close"},pd={exercise:"Exercice {index}",question:"Question {index}",points:"pts","points.one":"pt",submit:"Soumettre l'\xE9valuation",submitting:"Soumission...",confirmTitle:"Soumettre l'\xE9valuation",confirmDescription:"\xCAtes-vous s\xFBr de vouloir soumettre ? Vous ne pourrez pas modifier vos r\xE9ponses.",unansweredOne:"1 question n'est pas enti\xE8rement remplie.",unansweredMany:"{count} questions ne sont pas enti\xE8rement remplies.",unansweredMore:"et {count} autres",confirmSubmit:"Soumettre",confirmCancel:"Annuler",assessmentPassed:"\xC9valuation r\xE9ussie",assessmentNotPassed:"\xC9valuation non r\xE9ussie",awaitingReview:"En attente de correction",awaitingReviewDesc:"Votre professeur examine vos r\xE9ponses ouvertes. Votre note finale sera disponible une fois la correction termin\xE9e.",submittedNoScore:"Vos r\xE9ponses sont envoy\xE9es",submittedNoScoreDesc:"Pas de note pour celle-ci : voyez ci-dessous ce qui est juste et ce qu'il faut revoir.",formThanks:"Merci !",formThanksDesc:"Vos r\xE9ponses ont bien \xE9t\xE9 envoy\xE9es.",formThanksClose:"Vous pouvez fermer cette page.",formSubmit:"Envoyer",formSending:"Envoi\u2026",formConfirmTitle:"Envoyer vos r\xE9ponses ?",formConfirmDescription:"Vous ne pourrez plus les modifier ensuite.",required:"Obligatoire",requiredMissing:"R\xE9ponse obligatoire",requiredBlocked:"Une question obligatoire est sans r\xE9ponse : r\xE9pondez-y, puis envoyez \xE0 nouveau.",continue:"Continuer",beingMarked:"Correction en cours",beingMarkedDesc:"Certaines r\xE9ponses sont encore en cours de correction. Votre note finale sera disponible d\xE8s que toutes les r\xE9ponses seront corrig\xE9es.",pendingReview:"En attente de correction",viewFullReport:"Voir le rapport complet",explanation:"Explication",poweredBy:"Propuls\xE9 par Edpire",evaluating:"\xC9valuation de vos r\xE9ponses\u2026",aiEvaluating:"Certaines r\xE9ponses sont examin\xE9es par l'IA, cela peut prendre quelques secondes.",reset:"R\xE9initialiser",back:"Retour",annexDocuments:"Documents",annexEmptyTitle:"Aucune annexe pour l'instant",annexEmptyBody:"Un texte, une figure, un tableau ou un document qui reste visible pour toute l'\xE9valuation pendant que les \xE9l\xE8ves r\xE9pondent.",annexEmptyCta:"Ajouter une annexe",annexEmptyDismiss:"Masquer","timeUp.title":"Temps \xE9coul\xE9","timeUp.submitting":"Envoi de vos r\xE9ponses\u2026",yourScore:"Votre score",answersSaving:"Enregistrement\u2026",answersSaved:"R\xE9ponses enregistr\xE9es",answersNotSaved:"Vos r\xE9ponses ne sont pas enregistr\xE9es. V\xE9rifiez votre connexion.",resumeRestored:"Bon retour. Vos r\xE9ponses sont l\xE0.",resumeFresh:"Bon retour.",resumeTimeLeft:"Le chrono a continu\xE9 : il reste {minutes} min.",close:"Fermer"},ud={exercise:"\u062A\u0645\u0631\u064A\u0646 {index}",question:"\u0633\u0624\u0627\u0644 {index}",points:"\u0646\u0642\u0637\u0629","points.two":"\u0646\u0642\u0637\u062A\u0627\u0646","points.few":"\u0646\u0642\u0627\u0637",submit:"\u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u062A\u0642\u064A\u064A\u0645",submitting:"\u062C\u0627\u0631\u064D \u0627\u0644\u0625\u0631\u0633\u0627\u0644...",confirmTitle:"\u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u062A\u0642\u064A\u064A\u0645",confirmDescription:"\u0647\u0644 \u0623\u0646\u062A \u0645\u062A\u0623\u0643\u062F \u0645\u0646 \u0627\u0644\u0625\u0631\u0633\u0627\u0644\u061F \u0644\u0646 \u062A\u062A\u0645\u0643\u0646 \u0645\u0646 \u062A\u063A\u064A\u064A\u0631 \u0625\u062C\u0627\u0628\u0627\u062A\u0643 \u0628\u0639\u062F \u0627\u0644\u0625\u0631\u0633\u0627\u0644.",unansweredOne:"\u0644\u0645 \u062A\u064F\u0643\u0645\u0644 \u0627\u0644\u0625\u062C\u0627\u0628\u0629 \u0639\u0646 \u0633\u0624\u0627\u0644 \u0648\u0627\u062D\u062F.",unansweredMany:"\u0644\u0645 \u062A\u064F\u0643\u0645\u0644 \u0627\u0644\u0625\u062C\u0627\u0628\u0629 \u0639\u0646 {count} \u0645\u0646 \u0627\u0644\u0623\u0633\u0626\u0644\u0629.",unansweredMore:"\u0648{count} \u0623\u062E\u0631\u0649",confirmSubmit:"\u0625\u0631\u0633\u0627\u0644",confirmCancel:"\u0625\u0644\u063A\u0627\u0621",assessmentPassed:"\u0627\u062C\u062A\u064A\u0627\u0632 \u0627\u0644\u062A\u0642\u064A\u064A\u0645",assessmentNotPassed:"\u0644\u0645 \u064A\u062A\u0645 \u0627\u062C\u062A\u064A\u0627\u0632 \u0627\u0644\u062A\u0642\u064A\u064A\u0645",awaitingReview:"\u0641\u064A \u0627\u0646\u062A\u0638\u0627\u0631 \u0627\u0644\u062A\u0635\u062D\u064A\u062D",awaitingReviewDesc:"\u064A\u0642\u0648\u0645 \u0645\u0639\u0644\u0645\u0643 \u0628\u0645\u0631\u0627\u062C\u0639\u0629 \u0625\u062C\u0627\u0628\u0627\u062A\u0643 \u0627\u0644\u0645\u0641\u062A\u0648\u062D\u0629. \u0633\u062A\u0638\u0647\u0631 \u0639\u0644\u0627\u0645\u062A\u0643 \u0627\u0644\u0646\u0647\u0627\u0626\u064A\u0629 \u0628\u0639\u062F \u0627\u0643\u062A\u0645\u0627\u0644 \u0627\u0644\u062A\u0635\u062D\u064A\u062D.",submittedNoScore:"\u062A\u0645 \u0625\u0631\u0633\u0627\u0644 \u0625\u062C\u0627\u0628\u0627\u062A\u0643",submittedNoScoreDesc:"\u0644\u0627 \u0639\u0644\u0627\u0645\u0629 \u0644\u0647\u0630\u0627 \u0627\u0644\u062A\u0642\u064A\u064A\u0645: \u0627\u0646\u0638\u0631 \u0623\u062F\u0646\u0627\u0647 \u0645\u0627 \u0623\u062C\u0628\u062A \u0639\u0646\u0647 \u0628\u0634\u0643\u0644 \u0635\u062D\u064A\u062D \u0648\u0645\u0627 \u064A\u062C\u0628 \u0645\u0631\u0627\u062C\u0639\u062A\u0647.",formThanks:"\u0634\u0643\u0631\u064B\u0627 \u0644\u0643!",formThanksDesc:"\u062A\u0645 \u0625\u0631\u0633\u0627\u0644 \u0625\u062C\u0627\u0628\u0627\u062A\u0643.",formThanksClose:"\u064A\u0645\u0643\u0646\u0643 \u0625\u063A\u0644\u0627\u0642 \u0647\u0630\u0647 \u0627\u0644\u0635\u0641\u062D\u0629.",formSubmit:"\u0625\u0631\u0633\u0627\u0644",formSending:"\u062C\u0627\u0631\u064D \u0627\u0644\u0625\u0631\u0633\u0627\u0644\u2026",formConfirmTitle:"\u0625\u0631\u0633\u0627\u0644 \u0625\u062C\u0627\u0628\u0627\u062A\u0643\u061F",formConfirmDescription:"\u0644\u0646 \u062A\u062A\u0645\u0643\u0646 \u0645\u0646 \u062A\u0639\u062F\u064A\u0644\u0647\u0627 \u0628\u0639\u062F \u0627\u0644\u0625\u0631\u0633\u0627\u0644.",required:"\u0645\u0637\u0644\u0648\u0628",requiredMissing:"\u0647\u0630\u0627 \u0633\u0624\u0627\u0644 \u0645\u0637\u0644\u0648\u0628",requiredBlocked:"\u0633\u0624\u0627\u0644 \u0645\u0637\u0644\u0648\u0628 \u0628\u0644\u0627 \u0625\u062C\u0627\u0628\u0629: \u0623\u062C\u0628 \u0639\u0646\u0647 \u062B\u0645 \u0623\u0631\u0633\u0644 \u0645\u0646 \u062C\u062F\u064A\u062F.",continue:"\u0645\u062A\u0627\u0628\u0639\u0629",beingMarked:"\u0642\u064A\u062F \u0627\u0644\u062A\u0635\u062D\u064A\u062D",beingMarkedDesc:"\u0628\u0639\u0636 \u0627\u0644\u0625\u062C\u0627\u0628\u0627\u062A \u0645\u0627 \u0632\u0627\u0644\u062A \u0642\u064A\u062F \u0627\u0644\u062A\u0635\u062D\u064A\u062D. \u0633\u062A\u0638\u0647\u0631 \u0639\u0644\u0627\u0645\u062A\u0643 \u0627\u0644\u0646\u0647\u0627\u0626\u064A\u0629 \u0628\u0639\u062F \u062A\u0635\u062D\u064A\u062D \u062C\u0645\u064A\u0639 \u0627\u0644\u0625\u062C\u0627\u0628\u0627\u062A.",pendingReview:"\u0642\u064A\u062F \u0627\u0644\u062A\u0635\u062D\u064A\u062D",viewFullReport:"\u0639\u0631\u0636 \u0627\u0644\u062A\u0642\u0631\u064A\u0631 \u0627\u0644\u0643\u0627\u0645\u0644",explanation:"\u0634\u0631\u062D",poweredBy:"\u0645\u062F\u0639\u0648\u0645 \u0645\u0646 Edpire",evaluating:"\u062C\u0627\u0631\u064D \u062A\u0642\u064A\u064A\u0645 \u0625\u062C\u0627\u0628\u0627\u062A\u0643\u2026",aiEvaluating:"\u0628\u0639\u0636 \u0627\u0644\u0625\u062C\u0627\u0628\u0627\u062A \u0642\u064A\u062F \u0627\u0644\u0645\u0631\u0627\u062C\u0639\u0629 \u0628\u0627\u0644\u0630\u0643\u0627\u0621 \u0627\u0644\u0627\u0635\u0637\u0646\u0627\u0639\u064A\u060C \u0642\u062F \u064A\u0633\u062A\u063A\u0631\u0642 \u0630\u0644\u0643 \u0628\u0636\u0639 \u062B\u0648\u0627\u0646\u064D.",reset:"\u0625\u0639\u0627\u062F\u0629 \u062A\u0639\u064A\u064A\u0646",back:"\u0631\u062C\u0648\u0639",annexDocuments:"\u0627\u0644\u0645\u0633\u062A\u0646\u062F\u0627\u062A",annexEmptyTitle:"\u0644\u0627 \u064A\u0648\u062C\u062F \u0645\u064F\u0644\u062D\u064E\u0642 \u0628\u0639\u062F",annexEmptyBody:"\u0646\u0635 \u0623\u0648 \u0635\u0648\u0631\u0629 \u0623\u0648 \u062C\u062F\u0648\u0644 \u0623\u0648 \u0645\u0633\u062A\u0646\u062F \u064A\u0628\u0642\u0649 \u0638\u0627\u0647\u0631\u064B\u0627 \u0637\u0648\u0627\u0644 \u0627\u0644\u062A\u0642\u064A\u064A\u0645 \u0623\u062B\u0646\u0627\u0621 \u0625\u062C\u0627\u0628\u0629 \u0627\u0644\u0637\u0644\u0627\u0628.",annexEmptyCta:"\u0625\u0636\u0627\u0641\u0629 \u0645\u064F\u0644\u062D\u064E\u0642",annexEmptyDismiss:"\u0625\u062E\u0641\u0627\u0621","timeUp.title":"\u0627\u0646\u062A\u0647\u0649 \u0627\u0644\u0648\u0642\u062A","timeUp.submitting":"\u062C\u0627\u0631\u064D \u0625\u0631\u0633\u0627\u0644 \u0625\u062C\u0627\u0628\u0627\u062A\u0643\u2026",yourScore:"\u0646\u062A\u064A\u062C\u062A\u0643",answersSaving:"\u062C\u0627\u0631\u064D \u0627\u0644\u062D\u0641\u0638\u2026",answersSaved:"\u062A\u0645 \u062D\u0641\u0638 \u0627\u0644\u0625\u062C\u0627\u0628\u0627\u062A",answersNotSaved:"\u0644\u0627 \u064A\u062A\u0645 \u062D\u0641\u0638 \u0625\u062C\u0627\u0628\u0627\u062A\u0643. \u062A\u062D\u0642\u0651\u0642 \u0645\u0646 \u0627\u062A\u0635\u0627\u0644\u0643.",resumeRestored:"\u0645\u0631\u062D\u0628\u064B\u0627 \u0628\u0639\u0648\u062F\u062A\u0643. \u0625\u062C\u0627\u0628\u0627\u062A\u0643 \u0647\u0646\u0627.",resumeFresh:"\u0645\u0631\u062D\u0628\u064B\u0627 \u0628\u0639\u0648\u062F\u062A\u0643.",resumeTimeLeft:"\u0627\u0633\u062A\u0645\u0631\u0651 \u0627\u0644\u0645\u0624\u0642\u0651\u062A: \u062A\u0628\u0642\u0651\u0649 {minutes} \u062F\u0642\u064A\u0642\u0629.",close:"\u0625\u063A\u0644\u0627\u0642"},jr={en:dd,fr:pd,ar:ud};function md(e,r,t){let o=(jr[e]??jr.en)[r]??jr.en[r]??r;return t?Object.entries(t).reduce((a,[s,i])=>a.replace(`{${s}}`,String(i)),o):o}function Ka(e,r){let t=new Intl.PluralRules(e).select(r),n=jr[e]??jr.en;return n[`points.${t}`]??n.points??jr.en.points}function Xa(e){return(r,t)=>md(e,r,t)}function eo(e){return e==="ar"}var Ja="48rem";import"katex/dist/katex.min.css";Sr(`.edpire-annex-layout{display:flex;flex:1;min-width:0;height:100%;overflow:hidden;position:relative}.edpire-annex-main{flex:1;min-width:0;overflow:hidden;display:flex;flex-direction:column}.edpire-annex-panel{width:38%;min-width:calc(280px * var(--edp-scale, 1));max-width:calc(480px * var(--edp-scale, 1));flex-shrink:0;display:flex;flex-direction:column;border-right:1px solid #e5e7eb;background:#fff;overflow:hidden}.edpire-annex-panel__header{flex-shrink:0;padding:calc(12px * var(--edp-scale, 1)) calc(20px * var(--edp-scale, 1));border-bottom:1px solid #f3f4f6;background:#f9fafb}.edpire-annex-panel__header-label{font-size:calc(11px * var(--edp-scale, 1));font-weight:700;text-transform:uppercase;letter-spacing:.08em;color:#6b7280}.edpire-annex-panel__scroll{flex:1;overflow-y:auto;padding:calc(24px * var(--edp-scale, 1)) calc(20px * var(--edp-scale, 1));display:flex;flex-direction:column;gap:calc(32px * var(--edp-scale, 1))}.edpire-annex-tab,.edpire-annex-drawer,.edpire-annex-backdrop{display:none}@media(max-width:1023px){.edpire-annex-panel{display:none}.edpire-annex-tab{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:calc(8px * var(--edp-scale, 1));position:fixed;left:0;top:50%;transform:translateY(-50%);z-index:40;background:var(--edpire-annex-tab-bg, #2563eb);color:var(--edpire-annex-tab-color, #ffffff);border:none;border-radius:0 calc(10px * var(--edp-scale, 1)) calc(10px * var(--edp-scale, 1)) 0;padding:calc(18px * var(--edp-scale, 1)) calc(10px * var(--edp-scale, 1));cursor:pointer;box-shadow:2px 2px 16px #0000002e;transition:filter .15s}.edpire-annex-tab:hover{filter:brightness(.88)}.edpire-annex-tab__label{writing-mode:vertical-rl;text-orientation:mixed;transform:rotate(180deg);font-size:calc(11px * var(--edp-scale, 1));font-weight:700;letter-spacing:.07em;text-transform:uppercase;white-space:nowrap}.edpire-annex-drawer{display:flex;flex-direction:column;position:fixed;left:0;top:0;bottom:0;width:min(84vw,calc(440px * var(--edp-scale, 1)));background:#fff;z-index:50;transform:translate(-100%);transition:transform .28s cubic-bezier(.4,0,.2,1);box-shadow:4px 0 32px #00000021;overflow:hidden}.edpire-annex-drawer--open{transform:translate(0)}.edpire-annex-drawer__header{display:flex;align-items:center;justify-content:space-between;padding:calc(16px * var(--edp-scale, 1)) calc(20px * var(--edp-scale, 1));border-bottom:1px solid #f3f4f6;background:#f9fafb;flex-shrink:0}.edpire-annex-drawer__label{font-size:calc(13px * var(--edp-scale, 1));font-weight:700;color:#111827}.edpire-annex-drawer__close{display:flex;align-items:center;justify-content:center;width:calc(28px * var(--edp-scale, 1));height:calc(28px * var(--edp-scale, 1));background:none;border:none;cursor:pointer;font-size:calc(20px * var(--edp-scale, 1));line-height:1;color:#9ca3af;border-radius:calc(6px * var(--edp-scale, 1));transition:color .15s,background .15s}.edpire-annex-drawer__close:hover{color:#111827;background:#f3f4f6}.edpire-annex-drawer__scroll{flex:1;overflow-y:auto;padding:calc(24px * var(--edp-scale, 1)) calc(20px * var(--edp-scale, 1));display:flex;flex-direction:column;gap:calc(32px * var(--edp-scale, 1))}.edpire-annex-backdrop{display:block;position:fixed;inset:0;background:#00000061;z-index:45;cursor:pointer}}
79
+ `);import{Fragment as ao,jsx as N,jsxs as W}from"react/jsx-runtime";var vd="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%234f46e5'%3E%3Cpath d='M12 2L2 7v10l10 5 10-5V7L12 2zm0 2.18L19.5 8 12 11.82 4.5 8 12 4.18zM4 9.6l7 3.5v7.3L4 16.9V9.6zm9 10.8v-7.3l7-3.5v7.3L13 20.4z'/%3E%3C/svg%3E";function wd(e){for(let r of e.exercises)for(let t of r.questions)if((t.content.content??[]).some(o=>o.type==="aiAnswerInput"))return!0;return!1}function cs(e){let r=e;return typeof r.totalMaxScore=="number"?r.totalMaxScore:(r.answerKeys??[]).reduce((t,n)=>t+(n.scoring?.maxScore??0),0)}function ns(e){return e.questions.reduce((r,t)=>r+cs(t),0)}function ar(e){return Number.isInteger(e)?String(e):parseFloat(e.toFixed(2)).toString()}var oo=5;function os({label:e}){return N("span",{className:"ms-0.5 text-[#d23b2b]",title:e,"aria-label":e,children:"*"})}function ls(e){return e==="full"?"#1f8a4c":e==="partial"?"#c8810e":"#d23b2b"}function as({outcome:e}){let r=e==="full"?"M20 54 L41 75 L82 24":e==="none"?"M27 27 L73 73 M73 27 L27 73":"M14 58 C29 33 40 33 52 51 C64 69 74 69 88 42";return N("svg",{width:14,height:14,viewBox:"0 0 100 100",fill:"none",stroke:ls(e),strokeWidth:9,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:N("path",{d:r})})}function kd({score:e,weight:r,unit:t,t:n,hidden:o=!1}){if(e){if(e.awaiting)return W("span",{className:"inline-flex items-center gap-1 rounded-lg border border-[#f2e2bf] bg-[#fbf1dc] px-2 py-0.5 text-xs font-semibold text-[#8a5a08]",children:[N(Br,{size:11}),n("pendingReview")]});let a=o?e.outcome:e.m>0&&e.s>=e.m?"full":e.s>0?"partial":"none";return o?N("span",{className:"inline-flex items-center rounded-lg border border-[#e7e5e0] bg-[#f5f4f1] px-2 py-1",children:N(as,{outcome:a})}):W("span",{className:"inline-flex items-center gap-1.5 rounded-lg border border-[#e7e5e0] bg-[#f5f4f1] ps-2 pe-2.5 py-0.5",children:[N(as,{outcome:a}),W("span",{className:"font-bold leading-none",style:{fontFamily:'var(--font-hand, "Caveat", cursive)',fontSize:"1.05rem",color:ls(a)},children:[ar(e.s)," / ",ar(e.m)]})]})}return r>0&&!o?W("span",{className:"text-xs font-semibold tabular-nums text-[#8d93a0]",children:[ar(r)," ",t(r)]}):null}function ss(e){let r=0,t=0,n=!1,o=0,a=0;for(let i of e)r+=i.score??0,t+=i.maxScore??0,i.status==="awaiting_review"&&(n=!0),i.status==="correct"&&o++,(i.status==="correct"||i.status==="partial")&&a++;let s=e.length>0&&o===e.length?"full":a>0?"partial":"none";return{score:r,maxScore:t,awaiting:n,outcome:s}}function is(e){let r=new Map;for(let t of e?.exerciseAnswers??[])for(let n of t.questionAnswers)r.set(n.questionId,n.answers);return r}function Rd(e,r){return r.size===0?e:{exerciseAnswers:e.exerciseAnswers.map(t=>({...t,questionAnswers:t.questionAnswers.map(n=>n.answers.length===0&&r.has(n.questionId)?{...n,answers:r.get(n.questionId)}:n)}))}}function Sd({timeLimitMinutes:e,startedAt:r,onExpire:t}){let n=e*6e4,o=new Date(r).getTime()+n,[a,s]=Be(()=>Math.max(o-Date.now(),0)),i=pr(t);i.current=t,Xt(()=>{if(a<=0){i.current();return}let h=setInterval(()=>{let v=Math.max(o-Date.now(),0);s(v),v<=0&&(clearInterval(h),i.current())},1e3);return()=>clearInterval(h)},[o]);let c=a/n,l=c<.1?"bg-[#fdeeec] text-[#a32b1e] border-[#f6cfc9] animate-pulse":c<.25?"bg-[#fbf1dc] text-[#8a5a08] border-[#f2e2bf]":"bg-[#f5f4f1] text-[#565b66] border-[#e7e5e0]",d=Math.ceil(a/1e3),m=Math.floor(d/3600),p=Math.floor(d%3600/60),g=d%60,u=m>0?`${m}:${String(p).padStart(2,"0")}:${String(g).padStart(2,"0")}`:`${p}:${String(g).padStart(2,"0")}`;return W("span",{className:ge("inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full border text-xs font-bold tabular-nums transition-colors",l),children:[N(Br,{size:12}),u]})}function it({assessment:e,meta:r,scoreHidden:t=!1,isForm:n=!1,requiredQuestionIds:o,locale:a="en",branding:s,timeLimitMinutes:i,startedAt:c,initialAnswers:l,onAnswersChange:d,saveState:m,resumed:p=!1,onSubmit:g,review:u,onViewReport:h,reportLabel:v,onBack:R,backLabel:w,allowReset:C,onReset:y,overlayConfig:S,contained:k=!1,layout:_,onClose:P,mediaHandler:F,onAddAnnex:b,fallbackLogoUrl:T}){let f=Pe(()=>Xa(a),[a]),q=Ue($=>Ka(a,$),[a]),A=eo(a)?"rtl":"ltr",L=pr(null),G=pr(null);Xt(()=>{let $=G.current,ne=L.current;if(!$||!ne||typeof ResizeObserver>"u")return;let ke=()=>ne.style.setProperty("--edp-bar",`${$.offsetHeight}px`);ke();let ir=new ResizeObserver(ke);return ir.observe($),()=>ir.disconnect()},[]);let B=_?.maxWidth??Ja,V=s?.branding?.primaryColor,K=s?.branding?.accentColor,le=s?.branding?.fontFamily,ye=s?.branding?.fontUrl,E=s?.branding?.showPoweredBy!==!1;Xt(()=>{if(!ye||typeof document>"u"||document.querySelector(`link[href="${ye}"]`))return;let ne=document.createElement("link");ne.rel="stylesheet",ne.href=ye,document.head.appendChild(ne)},[ye]);let[x,j]=Be(()=>u?.answers??l??{exerciseAnswers:[]}),[O]=Be(()=>u?new Map:is(l)),z=pr(d);z.current=d;let[ae]=Be(()=>(u?u.answers:l)?.mediaPlays),re=pr(ae),ie=Ue($=>re.current&&Object.keys(re.current).length>0?{...$,mediaPlays:re.current}:$,[]),de=pr(x);de.current=x;let U=pr(!1),Y=Ue($=>{let ne=ie(Rd($,O));j(ne),z.current?.(ne)},[O,ie]),me=Ue($=>{if(re.current=$,u||U.current)return;let ne=ie(de.current);j(ne),z.current?.(ne)},[u,ie]),[ee,te]=Be(null);Xt(()=>{te(Date.now())},[]);let[ce,ze]=Be(p&&!u),Te=Pe(()=>{if(ee===null||!i||i<=0||!c)return null;let $=new Date(c).getTime()+i*6e4-ee;return $>0?Math.max(1,Math.floor($/6e4)):null},[ee,i,c]),[D,J]=Be(!1),[Z,pe]=Be(!1),[H,ct]=Be(u?.result??null);U.current=H!==null;let qr=Pe(()=>is(u?.answers),[u]),[Wr,ur]=Be(null),[_r,lt]=Be(!1),sr=pr(!1),Nr=Pe(()=>wd(e),[e]),Ur=Pe(()=>Z?Jn(e,x):[],[Z,e,x]),Hr=Ur.length,Jt=Ue($=>{pe(!1);let ne=L.current?.querySelectorAll(`[data-question-id="${CSS.escape($)}"]`),ke=Array.from(ne??[]).find(ir=>ir.getClientRects().length>0);ke&&requestAnimationFrame(()=>ke.scrollIntoView({block:"start",behavior:"smooth"}))},[]),Zt=(o??[]).join(" "),mr=Pe(()=>new Set(Zt?Zt.split(" "):[]),[Zt]),[po,ys]=Be(!1),en=Pe(()=>po?Zn(e,x,mr).map($=>$.questionId).join(" "):"",[po,e,x,mr]),uo=Pe(()=>new Set(en?en.split(" "):[]),[en]),xs=Ue(()=>{let $=Zn(e,x,mr);if($.length===0){pe(!0);return}ys(!0),Jt($[0].questionId)},[e,x,mr,Jt]),rn=Pe(()=>e.exercises.reduce(($,ne)=>$+ns(ne),0),[e]),tn=Pe(()=>H?Yn(H.exerciseFeedback):void 0,[H]),mo=Pe(()=>{let $=new Map;for(let ne of H?.exerciseFeedback??[])for(let ke of ne.questions)ke.explanation&&$.set(ke.questionId,ke);return $},[H]),dt=t||H?.scoreHidden===!0,fo=Pe(()=>{if(!H)return{};let $={};for(let ne of H.exerciseFeedback)$[ne.exerciseId]=ss(ne.questions.flatMap(ke=>ke.nodeResults));return $},[H]),ho=Pe(()=>{if(!H)return{};let $={};for(let ne of H.exerciseFeedback)for(let ke of ne.questions)ke.nodeResults.length>0&&($[ke.questionId]=ss(ke.nodeResults));return $},[H]),vs=Ue(async()=>{J(!0),ur(null);try{let $=await g(x);ct($),typeof window<"u"&&window.scrollTo({top:0,behavior:"smooth"})}catch($){ur($ instanceof Error?$.message==="required_unanswered"?f("requiredBlocked"):$.message:f("confirmCancel"))}finally{J(!1),pe(!1)}},[x,g,f]),pt=Ue(()=>{!H||!h||h(H)},[H,h]),ws=Ue(()=>{sr.current||D||H||(sr.current=!0,lt(!0),pe(!1),typeof document<"u"&&document.activeElement?.blur(),setTimeout(()=>{J(!0),ur(null),g(x).then($=>{ct($),typeof window<"u"&&window.scrollTo({top:0,behavior:"smooth"})}).catch($=>{ur($ instanceof Error?$.message:"submit_error")}).finally(()=>{J(!1),lt(!1)})},800))},[x,D,g,H]),nn=Ue(($,ne,ke)=>{let ir=ns($),He=fo[$.id],go=$.questions.length>1,Rs=es(ne)?Za(ne,{renderQuestion:(ft,sn,Ss)=>{let Ve=ft.id,bo=O.get(Ve),yo={...F?{mediaHandler:F}:{},...u?{initialAnswers:qr.get(Ve)??[],readOnly:!0}:bo?{initialAnswers:bo}:{},...H!==null?{readOnly:!0}:{}},xo=Object.keys(yo).length>0&&es(sn)?Za(sn,yo):sn,Cs=mr.has(Ve),vo=uo.has(Ve)?W("p",{role:"alert",className:"mt-2 flex items-center gap-1.5 text-sm font-medium text-[#a32b1e]",children:[N(bd,{size:14,className:"flex-shrink-0"}),f("requiredMissing")]}):null,cn=mo.get(Ve),wo=cn?.explanation?N(Ga,{content:cn.explanation,nodeResults:cn.nodeResults,label:f("explanation")}):null;if(!go)return W("div",{"data-question-id":Ve,children:[xo,vo,wo]},Ve);let Vr=ho[Ve],_s=cs(ft);return W("div",{"data-question-id":Ve,children:[W("div",{className:"flex items-center gap-2.5 mb-3",children:[W("span",{className:"inline-flex items-center rounded-lg border border-[#e7e5e0] bg-[#f1efe9] px-3 py-1 text-xs font-bold tracking-tight text-[#1d2025]",children:[f("question",{index:Ss+1}),Cs&&N(os,{label:f("required")})]}),N(kd,{hidden:dt,score:Vr?{s:Vr.score,m:Vr.maxScore,awaiting:Vr.awaiting,outcome:Vr.outcome}:null,weight:_s,unit:q,t:f})]}),xo,vo,wo]},Ve)},renderSeparator:ft=>N("div",{className:"border-t border-[#e7e5e0] my-1"},`qsep-${ft}`)}):ne;return W("div",{"data-exercise-id":$.id,className:"bg-white rounded-[14px] border border-[#e7e5e0] shadow-sm overflow-hidden",children:[W("div",{className:"flex items-center justify-between px-4 py-2.5 bg-[#f1efe9] border-b border-[#e7e5e0]",style:K?{backgroundColor:K}:void 0,children:[W("span",{dir:"auto",className:"min-w-0 text-sm font-bold text-[#1d2025] [overflow-wrap:anywhere]",children:[Cr(f,$.title,ke),!go&&$.questions[0]&&mr.has($.questions[0].id)&&N(os,{label:f("required")})]}),dt?null:He?.awaiting?W("span",{className:"inline-flex items-center gap-1 text-xs font-semibold text-[#8a5a08] bg-[#fbf1dc] border border-[#f2e2bf] rounded-full px-2 py-0.5",children:[N(Br,{size:11}),f("pendingReview")]}):He?W("span",{className:"font-bold leading-none tabular-nums",style:{fontFamily:'var(--font-hand, "Caveat", cursive)',fontSize:"1.15rem",color:He.maxScore>0&&He.score>=He.maxScore?"#1f8a4c":He.maxScore>0&&He.score>0?"#c8810e":He.maxScore>0?"#d23b2b":"#8d93a0"},children:[ar(He.score)," / ",ar(He.maxScore)]}):ir>0?W("span",{className:"text-xs font-semibold text-[#8d93a0] tabular-nums",children:["/ ",ar(ir)," ",q(ir)]}):null]}),N("div",{className:"p-4",children:Rs})]},$.id)},[f,q,fo,ho,K,F,u,qr,O,mo,dt,mr,uo,H]),ks=Pe(()=>Gn(e).length>0,[e]),on=Ue($=>W("div",{className:"flex items-center gap-3 py-2",children:[N("div",{className:"flex-1 border-t border-dashed border-[#e7e5e0]"}),N("span",{className:"text-[10px] font-bold text-[#8d93a0] uppercase tracking-widest",children:Cr(f,e.exercises[$+1]?.title,$+1)}),N("div",{className:"flex-1 border-t border-dashed border-[#e7e5e0]"})]},`sep-${$}`),[f,e]),an=E?N("p",{className:"pt-2 pb-1 text-center text-xs text-[#8d93a0] select-none",children:f("poweredBy")}):null,qe=H!==null,fr=n||H?.isForm===!0,ut=H?.showVerdict!==!1,mt=ut?H?.passed?"#1f8a4c":"#d23b2b":"#1d2025";return N(xt,{initial:ae,onChange:me,children:N("div",{className:"edpire-scope",style:{display:"contents"},children:W("div",{ref:L,dir:A,className:ge("flex flex-col [--edp-bar:0px] [&_[data-exercise-id]]:scroll-mt-[calc(var(--edp-bar)+0.75rem)] [&_[data-question-id]]:scroll-mt-[calc(var(--edp-bar)+0.75rem)]",k?"h-full":"min-h-dvh"),style:le?{fontFamily:le}:void 0,children:[N(Oa,{visible:D&&!_r&&!fr,hasAiNodes:Nr,text:f("evaluating"),aiText:f("aiEvaluating"),contained:k,...S}),_r&&W("div",{className:ge("fixed inset-0 z-50 flex flex-col items-center justify-center gap-3 bg-red-950/80 backdrop-blur-sm",k&&"absolute"),children:[N(Br,{size:40,className:"text-red-300"}),N("p",{className:"text-xl font-black text-white tracking-tight",children:f("timeUp.title")}),N("p",{className:"text-sm text-red-200",children:f("timeUp.submitting")})]}),W("div",{ref:G,className:"sticky top-0 z-10 flex-shrink-0 flex items-center justify-between gap-2 px-4 py-2.5 border-b border-[#e7e5e0] bg-[#fbfaf7]",style:K?{backgroundColor:K}:void 0,children:[W("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[N("img",{src:s?.logoUrl??T??vd,alt:s?.name??"Edpire",width:24,height:24,loading:"lazy",className:"flex-none rounded object-contain"}),W("div",{className:"min-w-0",children:[N("h1",{dir:"auto",title:r.title,className:"line-clamp-2 text-sm font-bold leading-snug text-[#1d2025] [overflow-wrap:anywhere]",children:r.title}),N("p",{className:"text-[11px] text-[#8d93a0]",children:rn>0&&!dt&&W("span",{className:"ms-2 font-semibold text-[#565b66]",children:["/ ",ar(rn)," ",q(rn)]})})]}),!qe&&ee!==null&&i&&i>0&&c&&N(Sd,{timeLimitMinutes:i,startedAt:c,onExpire:ws}),!qe&&(m==="saving"||m==="saved")&&W("span",{role:"status",className:"hidden sm:inline-flex items-center gap-1 text-[11px] font-medium text-[#8d93a0]",children:[m==="saved"?N(yd,{size:12}):N(ro,{size:12,className:"animate-spin"}),f(m==="saved"?"answersSaved":"answersSaving")]})]}),W("div",{className:"flex flex-none items-center gap-2",children:[C&&W("button",{onClick:y,className:"flex items-center gap-1.5 px-3 py-2 text-sm font-medium text-[#565b66] hover:text-[#1d2025] hover:bg-[#f1efe9] rounded-lg transition-colors",children:[N(hd,{size:13}),f("reset")]}),(!qe||u)&&R&&W("button",{onClick:R,className:"flex items-center gap-1.5 px-3 py-2 text-sm font-medium text-[#565b66] hover:text-[#1d2025] hover:bg-[#f1efe9] rounded-lg transition-colors",children:[N(no,{size:13}),w??f("back")]}),P&&N("button",{onClick:P,className:"p-1.5 text-[#8d93a0] hover:text-[#1d2025] hover:bg-[#f1efe9] rounded-lg transition-colors",children:N(no,{size:15})}),!qe&&N("button",{onClick:xs,disabled:D,style:V?{backgroundColor:V}:void 0,className:"flex flex-shrink-0 items-center gap-2 px-3.5 sm:px-4 py-2 bg-[#1d2025] text-white text-sm font-semibold rounded-lg hover:bg-[#31353c] transition-colors disabled:opacity-50",children:D?W(ao,{children:[N(ro,{size:14,className:"animate-spin"}),f(fr?"formSending":"submitting")]}):W(ao,{children:[N(rs,{size:14}),N("span",{className:"sm:hidden",children:f(fr?"formSubmit":"confirmSubmit")}),N("span",{className:"hidden sm:inline",children:f(fr?"formSubmit":"submit")})]})})]})]}),Wr&&N("div",{className:"flex-shrink-0 bg-[#fdeeec] border-b border-[#f6cfc9] px-4 py-2 text-sm text-[#a32b1e]",children:Wr}),!qe&&m==="failed"&&W("div",{role:"alert",className:"flex-shrink-0 flex items-center gap-2 bg-[#fbf1dc] border-b border-[#f2e2bf] px-4 py-2 text-sm font-semibold text-[#8a5a08]",children:[N(xd,{size:15,className:"flex-shrink-0"}),f("answersNotSaved")]}),!qe&&ce&&(O.size>0||Te!==null)&&W("div",{role:"status",className:"flex-shrink-0 flex items-center gap-2 bg-[#f5f4f1] border-b border-[#e7e5e0] px-4 py-2 text-sm text-[#1d2025]",children:[Te!==null&&N(Br,{size:15,className:"flex-shrink-0 text-[#565b66]"}),W("span",{className:"flex-1 min-w-0",children:[O.size>0?f("resumeRestored"):f("resumeFresh"),Te!==null&&W(ao,{children:[" ",f("resumeTimeLeft",{minutes:Te})]})]}),N("button",{type:"button",onClick:()=>ze(!1),"aria-label":f("close"),className:"flex-shrink-0 p-1 rounded-md text-[#8d93a0] hover:text-[#1d2025] hover:bg-[#e7e5e0] transition-colors",children:N(no,{size:14})})]}),qe&&H?.isForm?N(Ya,{t:f,rtl:eo(a),showClose:!k,onContinue:h&&H.returnUrl?pt:void 0,continueLabel:v,primaryColor:V}):qe&&H&&(H.awaitingManualGrading?N("div",{className:"flex-shrink-0 border-b bg-[#fbf1dc] border-[#f2e2bf]",children:N("div",{className:"mx-auto px-4 py-3 sm:px-6 sm:py-4",style:{maxWidth:B},children:W("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2 sm:gap-4",children:[W("div",{className:"flex items-center gap-2",children:[N(Br,{size:20,className:"text-[#c8810e] flex-shrink-0"}),N("span",{className:"text-sm font-semibold text-[#8a5a08]",children:H.aiPending?f("beingMarked"):f("awaitingReview")})]}),N("div",{className:"hidden sm:block w-px h-8 bg-[#f2e2bf]"}),N("p",{className:"text-sm text-[#8a5a08] flex-1 min-w-0",children:H.aiPending?f("beingMarkedDesc"):f("awaitingReviewDesc")}),h&&W("button",{onClick:pt,style:V?{backgroundColor:V}:void 0,className:"flex-shrink-0 flex items-center gap-2 px-4 py-2 bg-[#1d2025] text-white text-sm font-semibold rounded-lg hover:bg-[#31353c] transition-colors",children:[N(to,{size:14}),v??f("viewFullReport")]})]})})}):H.scoreHidden?N("div",{className:"flex-shrink-0 border-b bg-[#f5f4f1] border-[#e7e5e0]",children:N("div",{className:"mx-auto px-4 py-3 sm:px-6 sm:py-4",style:{maxWidth:B},children:W("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2 sm:gap-4",children:[W("div",{className:"flex items-center gap-2",children:[N(ts,{size:20,className:"text-[#1d2025] flex-shrink-0"}),N("span",{className:"text-sm font-semibold text-[#1d2025]",children:f("submittedNoScore")})]}),N("div",{className:"hidden sm:block w-px h-8 bg-[#e7e5e0]"}),N("p",{className:"text-sm text-[#565b66] flex-1 min-w-0",children:f("submittedNoScoreDesc")}),h&&W("button",{onClick:pt,style:V?{backgroundColor:V}:void 0,className:"flex-shrink-0 flex items-center gap-2 px-4 py-2 bg-[#1d2025] text-white text-sm font-semibold rounded-lg hover:bg-[#31353c] transition-colors",children:[N(to,{size:14}),v??f("viewFullReport")]})]})})}):N("div",{className:ge("flex-shrink-0 border-b",ut?H.passed?"bg-[#ecf8f0] border-[#c5e8d1]":"bg-[#fdeeec] border-[#f6cfc9]":"bg-[#f5f4f1] border-[#e7e5e0]"),children:N("div",{className:"mx-auto px-4 py-3 sm:px-6 sm:py-4",style:{maxWidth:B},children:W("div",{className:"flex flex-wrap sm:flex-nowrap items-center gap-x-4 gap-y-2",children:[W("div",{className:"flex items-center gap-2",children:[ut?H.passed?N(ts,{size:20,className:"text-[#1f8a4c] flex-shrink-0"}):N(fd,{size:20,className:"text-[#d23b2b] flex-shrink-0"}):null,N("span",{className:"text-sm font-semibold",style:{color:mt},children:ut?H.passed?f("assessmentPassed"):f("assessmentNotPassed"):f("yourScore")})]}),N("div",{className:"hidden sm:block w-px h-8 bg-[#e7e5e0]"}),W("div",{className:"flex items-baseline gap-1.5",children:[W("span",{className:"leading-none tabular-nums text-[1.6rem] sm:text-[2rem]",style:{fontFamily:'var(--font-hand, "Caveat", cursive)',color:mt},children:[ar(H.totalScore)," / ",ar(H.maxScore)]}),N("span",{className:"text-sm text-[#8d93a0] font-medium",children:q(H.maxScore)})]}),W("div",{className:"flex-1 flex items-center gap-3 min-w-[140px]",children:[N("div",{className:"flex-1 h-2 bg-[#e7e5e0] rounded-full overflow-hidden min-w-[80px]",children:N("div",{className:"h-full rounded-full transition-all duration-700",style:{width:`${H.percentage}%`,backgroundColor:mt}})}),W("span",{className:"text-sm font-bold tabular-nums flex-shrink-0",style:{color:mt},children:[H.percentage,"%"]})]}),h&&W("button",{onClick:pt,style:V?{backgroundColor:V}:void 0,className:"flex-shrink-0 flex items-center gap-2 px-4 py-2 bg-[#1d2025] text-white text-sm font-semibold rounded-lg hover:bg-[#31353c] transition-colors",children:[N(to,{size:14}),v??f("viewFullReport")]})]})})})),N("div",{className:ge("flex-1 flex flex-col",k&&"overflow-hidden",_r&&"pointer-events-none opacity-60",H?.isForm&&"hidden"),children:e.annex||ks?N(Ua,{assessment:e,isSubmitted:qe,setAnswers:Y,validationFeedback:tn,renderExercise:nn,renderSeparator:on,primaryColor:V,contained:k,locale:a,contentMaxWidth:B,t:f,footer:an}):b?N(Va,{assessment:e,isSubmitted:qe,setAnswers:Y,validationFeedback:tn,renderExercise:nn,renderSeparator:on,primaryColor:V,contained:k,locale:a,contentMaxWidth:B,t:f,onAddAnnex:b,footer:an}):N("div",{className:ge("flex-1",k&&"overflow-y-auto"),children:W("div",{className:"mx-auto p-6 flex flex-col gap-4",style:{maxWidth:B},children:[N(dr,{assessment:e,onAnswersChange:qe?void 0:Y,validationFeedback:tn,renderExercise:nn,renderSeparator:on,locale:a}),an]})})}),Z&&N("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",children:W("div",{role:"dialog","aria-modal":"true","aria-labelledby":"edpire-submit-confirm-title",className:"bg-white rounded-[14px] shadow-xl p-6 max-w-sm mx-4",children:[N("h3",{id:"edpire-submit-confirm-title",className:"text-base font-bold text-[#1d2025] mb-2",children:f(fr?"formConfirmTitle":"confirmTitle")}),Hr>0&&W("div",{className:"text-sm text-[#8a5a08] bg-[#fbf1dc] border border-[#f2e2bf] rounded-lg px-3 py-2 mb-3",children:[W("p",{className:"flex items-start gap-2 font-semibold",children:[N(gd,{size:15,className:"flex-shrink-0 mt-px"}),N("span",{children:Hr===1?f("unansweredOne"):f("unansweredMany",{count:Hr})})]}),W("ul",{className:"mt-1 ps-[23px] flex flex-col gap-0.5",children:[Ur.slice(0,oo).map($=>N("li",{children:N("button",{type:"button",onClick:()=>Jt($.questionId),className:"text-start underline underline-offset-2 hover:text-[#1d2025] cursor-pointer",children:$.only?Cr(f,$.exerciseTitle,$.exerciseIndex):`${Cr(f,$.exerciseTitle,$.exerciseIndex)} \xB7 ${f("question",{index:$.questionIndex+1})}`})},$.questionId)),Hr>oo&&N("li",{children:f("unansweredMore",{count:Hr-oo})})]})]}),N("p",{className:"text-sm text-[#565b66] mb-5",children:f(fr?"formConfirmDescription":"confirmDescription")}),W("div",{className:"flex gap-3 justify-end",children:[N("button",{onClick:()=>pe(!1),className:"px-4 py-2 text-sm font-medium text-[#565b66] hover:bg-[#f1efe9] rounded-lg transition-colors",children:f("confirmCancel")}),W("button",{onClick:vs,disabled:D,style:V?{backgroundColor:V}:void 0,className:"flex items-center gap-2 px-4 py-2 bg-[#1d2025] text-white text-sm font-semibold rounded-lg hover:bg-[#31353c] transition-colors disabled:opacity-50",children:[D?N(ro,{size:14,className:"animate-spin"}):N(rs,{size:14}),f(fr?"formSubmit":"confirmSubmit")]})]})]})})]})})})}function so(e){return(e??[]).map(r=>({exerciseId:r.exercise_id,questions:r.questions.map(t=>({questionId:t.question_id,...t.explanation?{explanation:t.explanation}:{},nodeResults:t.node_results.map(n=>({nodeId:n.node_id,status:n.status,...n.score!==void 0?{score:n.score}:{},...n.max_score!==void 0?{maxScore:n.max_score}:{},...n.feedback!==void 0?{feedback:n.feedback}:{},...n.display_answer!==void 0?{displayAnswer:n.display_answer}:{},...n.detail!==void 0?{detail:n.detail}:{},...n.teacher_feedback!==void 0?{teacherFeedback:n.teacher_feedback}:{}}))}))}))}import{jsx as Nd}from"react/jsx-runtime";function io(e,r){let t=so(e.exercise_feedback);return{submissionId:e.submission_id,totalScore:e.score??0,maxScore:e.max_score??0,percentage:e.percentage??0,passed:e.passed??!1,...e.score_hidden?{scoreHidden:!0}:{},returnUrl:r??null,exerciseFeedback:t,awaitingManualGrading:e.awaiting_manual_grading??!1,aiPending:e.ai_pending??!1}}function co(e){return{annex:e.annex??void 0,exercises:e.exercises.map(r=>({id:r.id,...r.title?{title:r.title}:{},sharedContext:r.sharedContext,questions:r.questions.map(t=>({id:t.id,version:"1.0",content:t.content,answerKeys:[]}))}))}}function ps({token:e,data:r,baseUrl:t,options:n}){let{locale:o,branding:a,returnUrl:s,reportLabel:i,backLabel:c,onBack:l,overlayConfig:d,layout:m,mediaHandler:p,onComplete:g,onError:u}=n,h=a??r.branding??void 0,v=o??r.meta.language??"en",R=Cd(()=>co(r.assessment),[r]),[w]=_d(()=>new Date().toISOString()),C=ds(async S=>{let k=await fetch(`${t}/api/v1/embed/submit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:e,answers:S})});if(!k.ok){let P=await k.json().catch(()=>({}));if(k.status===422&&P.code==="required_unanswered")throw new Error("required_unanswered");let F=typeof P.error=="string"?P.error:"Submission failed",b=k.status===401?"TOKEN_INVALID":k.status===409?"TOKEN_USED":k.status===404?"ASSESSMENT_NOT_FOUND":"UNKNOWN";throw u?.({code:b,message:F}),new Error(F)}let _=await k.json();return g?.(_),io(_,s)},[t,e,g,u,s]),y=ds(S=>{if(s)try{let k=new URL(s);k.searchParams.set("submission_id",S.submissionId),!S.awaitingManualGrading&&!S.scoreHidden&&(k.searchParams.set("score",String(S.totalScore)),k.searchParams.set("max_score",String(S.maxScore))),window.location.href=k.toString()}catch{window.location.href=s}},[s]);return Nd(it,{assessment:R,meta:{title:r.meta.title,category:r.meta.category??null},locale:v,branding:h,scoreHidden:r.meta.score_hidden===!0,requiredQuestionIds:r.meta.required_question_ids,timeLimitMinutes:r.meta.settings.time_limit_minutes,startedAt:w,onSubmit:C,onViewReport:s?y:void 0,reportLabel:i,onBack:l,backLabel:c,overlayConfig:d,layout:m,mediaHandler:p})}import{useMemo as us}from"react";import{jsx as Ed}from"react/jsx-runtime";function Ad(){return Promise.reject(new Error("A review cannot be submitted"))}function ms({review:e,locale:r,branding:t,layout:n,onBack:o,backLabel:a}){let s=us(()=>co(e.assessment),[e]),i=us(()=>({answers:e.answers,result:io({submission_id:e.submission.id,score:e.submission.score,max_score:e.submission.max_score,percentage:e.submission.percentage,passed:e.submission.passed,awaiting_manual_grading:e.submission.awaiting_manual_grading,ai_pending:e.submission.ai_pending,score_hidden:e.submission.score_hidden,exercise_feedback:e.exercise_feedback})}),[e]),c=r??e.meta.language??"en";return Ed(it,{assessment:s,meta:{title:e.meta.title,category:e.meta.category??null},locale:c,branding:t??e.branding??void 0,review:i,scoreHidden:e.submission.score_hidden===!0,onSubmit:Ad,onBack:o,backLabel:a,layout:n})}import Lb from"react";import{createRoot as $b}from"react-dom/client";var Pd="https://edpire.com";function gs(e,r,t){e.textContent="";let n=document.createElement("div");n.style.cssText="padding:32px;text-align:center;color:#dc2626;font-family:sans-serif";let o=document.createElement("div");if(o.textContent=r,n.appendChild(o),t){let a=document.createElement("div");a.style.cssText="margin-top:8px;font-size:13px;color:#6b7280",a.textContent=t,n.appendChild(a)}e.appendChild(n)}var bs={mount(e){let{token:r,container:t,baseUrl:n=Pd,onError:o}=e,a=typeof t=="string"?document.querySelector(t):t;if(!a){let l={code:"UNKNOWN",message:`Container not found: ${t}`};return o?.(l),{unmount:()=>{}}}let s=null,i=!1;function c(){if(i)return;i=!0;let l=s;s=null,setTimeout(()=>{l?.unmount()},0)}return(async()=>{a.innerHTML='<div style="padding:32px;text-align:center;color:#6b7280;font-family:sans-serif">Loading assessment\u2026</div>';let l;try{let d=await fetch(`${n}/api/v1/embed/assessments?token=${encodeURIComponent(r)}`,{method:"GET"});if(!d.ok){let m=await d.json().catch(()=>({})),p=typeof m.error=="string"?m.error:"Failed to load assessment",g=d.status===401?"TOKEN_INVALID":d.status===403?"ORIGIN_NOT_ALLOWED":d.status===404?"ASSESSMENT_NOT_FOUND":"UNKNOWN";o?.({code:g,message:p});let u=g==="ORIGIN_NOT_ALLOWED"?`Add ${typeof location<"u"?location.origin:"this origin"} to Allowed Embed Origins in Edpire, under Integrations then Origins.`:"";gs(a,p,u);return}l=await d.json()}catch{o?.({code:"NETWORK_ERROR",message:"Failed to connect to Edpire"}),gs(a,"Failed to connect to Edpire. Please try again.","");return}i||(a.innerHTML="",s=hs(a),s.render(fs.createElement(ps,{token:r,data:l,baseUrl:n,options:e})))})(),{unmount:c}},review(e){let{container:r,...t}=e,n=typeof r=="string"?document.querySelector(r):r;if(!n)return{unmount:()=>{}};n.textContent="";let o=hs(n);return o.render(fs.createElement(ms,t)),{unmount(){let a=o;o=null,setTimeout(()=>a?.unmount(),0)}}}};import{jsx as Ld}from"react/jsx-runtime";function Md({tokenEndpoint:e,assessmentId:r,tokenBody:t,className:n,style:o,onComplete:a,onError:s,...i}){let c=lo(null),l=lo(a);l.current=a;let d=lo(s);return d.current=s,Td(()=>{let m=c.current;if(!m)return;let p=!1,g=null;return(async()=>{let u;try{let h=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({assessmentId:r,...t})});if(p)return;if(!h.ok){let R=await h.json().catch(()=>({}));d.current?.({code:"TOKEN_INVALID",message:typeof R.error=="string"?R.error:`Token endpoint returned ${h.status}`});return}let v=await h.json();if(!v.token){d.current?.({code:"TOKEN_INVALID",message:"Token endpoint did not return a token"});return}u=v.token}catch{p||d.current?.({code:"NETWORK_ERROR",message:"Failed to fetch embed token"});return}p||(g=bs.mount({token:u,container:m,...i,onComplete:h=>l.current?.(h),onError:h=>d.current?.(h)}))})(),()=>{p=!0,g?.unmount()}},[e,r]),Ld("div",{ref:c,className:n,style:n?void 0:o??{width:"100%"}})}export{it as AssessmentShell,Md as EdpireAssessmentPlayer,Fa as EdpireQuestion};