@edpire/sdk 0.6.8 → 0.6.10
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/README.md +2 -2
- package/dist/index.mjs +1 -1
- package/dist/react.mjs +1 -1
- package/dist/umd/index.global.js +3379 -632
- package/package.json +6 -5
package/README.md
CHANGED
|
@@ -90,7 +90,7 @@ embed.unmount()
|
|
|
90
90
|
**CDN (no bundler):**
|
|
91
91
|
|
|
92
92
|
```html
|
|
93
|
-
<script src="https://cdn.jsdelivr.net/npm/@edpire/sdk@0.6.
|
|
93
|
+
<script src="https://cdn.jsdelivr.net/npm/@edpire/sdk@0.6.9/dist/umd/index.global.js"></script>
|
|
94
94
|
<script>
|
|
95
95
|
EdpireSDK.EdpireAssessment.mount({ token, container: "#root", onComplete: handleDone })
|
|
96
96
|
</script>
|
|
@@ -310,7 +310,7 @@ The integration uses two parts:
|
|
|
310
310
|
</head>
|
|
311
311
|
<body>
|
|
312
312
|
<div id="root"></div>
|
|
313
|
-
<script src="https://cdn.jsdelivr.net/npm/@edpire/sdk@0.6.
|
|
313
|
+
<script src="https://cdn.jsdelivr.net/npm/@edpire/sdk@0.6.9/dist/umd/index.global.js"></script>
|
|
314
314
|
<script>
|
|
315
315
|
EdpireSDK.EdpireAssessment.mount({
|
|
316
316
|
token: "{{EMBED_TOKEN}}", // replace server-side before loading
|
package/dist/index.mjs
CHANGED
|
@@ -64,4 +64,4 @@ sys.stdin = io.StringIO(${JSON.stringify(o)})
|
|
|
64
64
|
`);Ce(`@font-face{font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(fonts/KaTeX_AMS-Regular.woff2) format("woff2"),url(fonts/KaTeX_AMS-Regular.woff) format("woff"),url(fonts/KaTeX_AMS-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(fonts/KaTeX_Caligraphic-Bold.woff2) format("woff2"),url(fonts/KaTeX_Caligraphic-Bold.woff) format("woff"),url(fonts/KaTeX_Caligraphic-Bold.ttf) format("truetype")}@font-face{font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Caligraphic-Regular.woff2) format("woff2"),url(fonts/KaTeX_Caligraphic-Regular.woff) format("woff"),url(fonts/KaTeX_Caligraphic-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(fonts/KaTeX_Fraktur-Bold.woff2) format("woff2"),url(fonts/KaTeX_Fraktur-Bold.woff) format("woff"),url(fonts/KaTeX_Fraktur-Bold.ttf) format("truetype")}@font-face{font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Fraktur-Regular.woff2) format("woff2"),url(fonts/KaTeX_Fraktur-Regular.woff) format("woff"),url(fonts/KaTeX_Fraktur-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(fonts/KaTeX_Main-Bold.woff2) format("woff2"),url(fonts/KaTeX_Main-Bold.woff) format("woff"),url(fonts/KaTeX_Main-Bold.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(fonts/KaTeX_Main-BoldItalic.woff2) format("woff2"),url(fonts/KaTeX_Main-BoldItalic.woff) format("woff"),url(fonts/KaTeX_Main-BoldItalic.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(fonts/KaTeX_Main-Italic.woff2) format("woff2"),url(fonts/KaTeX_Main-Italic.woff) format("woff"),url(fonts/KaTeX_Main-Italic.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Main-Regular.woff2) format("woff2"),url(fonts/KaTeX_Main-Regular.woff) format("woff"),url(fonts/KaTeX_Main-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(fonts/KaTeX_Math-BoldItalic.woff2) format("woff2"),url(fonts/KaTeX_Math-BoldItalic.woff) format("woff"),url(fonts/KaTeX_Math-BoldItalic.ttf) format("truetype")}@font-face{font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(fonts/KaTeX_Math-Italic.woff2) format("woff2"),url(fonts/KaTeX_Math-Italic.woff) format("woff"),url(fonts/KaTeX_Math-Italic.ttf) format("truetype")}@font-face{font-family:KaTeX_SansSerif;font-style:normal;font-weight:700;src:url(fonts/KaTeX_SansSerif-Bold.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Bold.woff) format("woff"),url(fonts/KaTeX_SansSerif-Bold.ttf) format("truetype")}@font-face{font-family:KaTeX_SansSerif;font-style:italic;font-weight:400;src:url(fonts/KaTeX_SansSerif-Italic.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Italic.woff) format("woff"),url(fonts/KaTeX_SansSerif-Italic.ttf) format("truetype")}@font-face{font-family:KaTeX_SansSerif;font-style:normal;font-weight:400;src:url(fonts/KaTeX_SansSerif-Regular.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Regular.woff) format("woff"),url(fonts/KaTeX_SansSerif-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Script-Regular.woff2) format("woff2"),url(fonts/KaTeX_Script-Regular.woff) format("woff"),url(fonts/KaTeX_Script-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Size1-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size1-Regular.woff) format("woff"),url(fonts/KaTeX_Size1-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Size2-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size2-Regular.woff) format("woff"),url(fonts/KaTeX_Size2-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Size3-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size3-Regular.woff) format("woff"),url(fonts/KaTeX_Size3-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Size4-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size4-Regular.woff) format("woff"),url(fonts/KaTeX_Size4-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Typewriter-Regular.woff2) format("woff2"),url(fonts/KaTeX_Typewriter-Regular.woff) format("woff"),url(fonts/KaTeX_Typewriter-Regular.ttf) format("truetype")}.katex{font: 1.21em KaTeX_Main,Times New Roman,serif;line-height:1.2;text-indent:0;text-rendering:auto}.katex *{-ms-high-contrast-adjust:none!important;border-color:currentColor}.katex .katex-version:after{content:"0.16.22"}.katex .katex-mathml{clip:rect(1px,1px,1px,1px);border:0;height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.katex .katex-html>.newline{display:block}.katex .base{position:relative;white-space:nowrap;width:-webkit-min-content;width:-moz-min-content;width:min-content}.katex .base,.katex .strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathboldfrak,.katex .textboldfrak{font-family:KaTeX_Fraktur;font-weight:700}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .mathsfit,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;display:inline-table;table-layout:fixed}.katex .vlist-r{display:table-row}.katex .vlist{display:table-cell;position:relative;vertical-align:bottom}.katex .vlist>span{display:block;height:0;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{overflow:hidden;width:0}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{display:table-cell;font-size:1px;min-width:2px;vertical-align:bottom;width:2px}.katex .vbox{align-items:baseline;display:inline-flex;flex-direction:column}.katex .hbox{width:100%}.katex .hbox,.katex .thinbox{display:inline-flex;flex-direction:row}.katex .thinbox{max-width:0;width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline,.katex .hline,.katex .mfrac .frac-line,.katex .overline .overline-line,.katex .rule,.katex .underline .underline-line{min-height:1px}.katex .mspace{display:inline-block}.katex .clap,.katex .llap,.katex .rlap{position:relative;width:0}.katex .clap>.inner,.katex .llap>.inner,.katex .rlap>.inner{position:absolute}.katex .clap>.fix,.katex .llap>.fix,.katex .rlap>.fix{display:inline-block}.katex .llap>.inner{right:0}.katex .clap>.inner,.katex .rlap>.inner{left:0}.katex .clap>.inner>span{margin-left:-50%;margin-right:50%}.katex .rule{border:0 solid;display:inline-block;position:relative}.katex .hline,.katex .overline .overline-line,.katex .underline .underline-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline{border-bottom-style:dashed;display:inline-block;width:100%}.katex .sqrt>.root{margin-left:.2777777778em;margin-right:-.5555555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .sizing.reset-size2.size1{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .sizing.reset-size2.size3{font-size:1.1666666667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .sizing.reset-size2.size4{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .sizing.reset-size2.size6{font-size:1.6666666667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .sizing.reset-size2.size10{font-size:3.4566666667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .sizing.reset-size2.size11{font-size:4.1466666667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .sizing.reset-size3.size1{font-size:.7142857143em}.katex .fontsize-ensurer.reset-size3.size2,.katex .sizing.reset-size3.size2{font-size:.8571428571em}.katex .fontsize-ensurer.reset-size3.size3,.katex .sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .sizing.reset-size3.size4{font-size:1.1428571429em}.katex .fontsize-ensurer.reset-size3.size5,.katex .sizing.reset-size3.size5{font-size:1.2857142857em}.katex .fontsize-ensurer.reset-size3.size6,.katex .sizing.reset-size3.size6{font-size:1.4285714286em}.katex .fontsize-ensurer.reset-size3.size7,.katex .sizing.reset-size3.size7{font-size:1.7142857143em}.katex .fontsize-ensurer.reset-size3.size8,.katex .sizing.reset-size3.size8{font-size:2.0571428571em}.katex .fontsize-ensurer.reset-size3.size9,.katex .sizing.reset-size3.size9{font-size:2.4685714286em}.katex .fontsize-ensurer.reset-size3.size10,.katex .sizing.reset-size3.size10{font-size:2.9628571429em}.katex .fontsize-ensurer.reset-size3.size11,.katex .sizing.reset-size3.size11{font-size:3.5542857143em}.katex .fontsize-ensurer.reset-size4.size1,.katex .sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .sizing.reset-size5.size1{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .sizing.reset-size5.size2{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .sizing.reset-size5.size3{font-size:.7777777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .sizing.reset-size5.size4{font-size:.8888888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .sizing.reset-size5.size6{font-size:1.1111111111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .sizing.reset-size5.size7{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .sizing.reset-size5.size10{font-size:2.3044444444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .sizing.reset-size5.size11{font-size:2.7644444444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .sizing.reset-size7.size1{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .sizing.reset-size7.size3{font-size:.5833333333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .sizing.reset-size7.size4{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .sizing.reset-size7.size6{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .sizing.reset-size7.size10{font-size:1.7283333333em}.katex .fontsize-ensurer.reset-size7.size11,.katex .sizing.reset-size7.size11{font-size:2.0733333333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .sizing.reset-size8.size1{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .sizing.reset-size8.size2{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .sizing.reset-size8.size3{font-size:.4861111111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .sizing.reset-size8.size4{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .sizing.reset-size8.size6{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .sizing.reset-size8.size7{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .sizing.reset-size8.size10{font-size:1.4402777778em}.katex .fontsize-ensurer.reset-size8.size11,.katex .sizing.reset-size8.size11{font-size:1.7277777778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .sizing.reset-size9.size1{font-size:.2893518519em}.katex .fontsize-ensurer.reset-size9.size2,.katex .sizing.reset-size9.size2{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .sizing.reset-size9.size3{font-size:.4050925926em}.katex .fontsize-ensurer.reset-size9.size4,.katex .sizing.reset-size9.size4{font-size:.462962963em}.katex .fontsize-ensurer.reset-size9.size5,.katex .sizing.reset-size9.size5{font-size:.5208333333em}.katex .fontsize-ensurer.reset-size9.size6,.katex .sizing.reset-size9.size6{font-size:.5787037037em}.katex .fontsize-ensurer.reset-size9.size7,.katex .sizing.reset-size9.size7{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .sizing.reset-size9.size8{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .sizing.reset-size9.size10{font-size:1.2002314815em}.katex .fontsize-ensurer.reset-size9.size11,.katex .sizing.reset-size9.size11{font-size:1.4398148148em}.katex .fontsize-ensurer.reset-size10.size1,.katex .sizing.reset-size10.size1{font-size:.2410800386em}.katex .fontsize-ensurer.reset-size10.size2,.katex .sizing.reset-size10.size2{font-size:.2892960463em}.katex .fontsize-ensurer.reset-size10.size3,.katex .sizing.reset-size10.size3{font-size:.337512054em}.katex .fontsize-ensurer.reset-size10.size4,.katex .sizing.reset-size10.size4{font-size:.3857280617em}.katex .fontsize-ensurer.reset-size10.size5,.katex .sizing.reset-size10.size5{font-size:.4339440694em}.katex .fontsize-ensurer.reset-size10.size6,.katex .sizing.reset-size10.size6{font-size:.4821600771em}.katex .fontsize-ensurer.reset-size10.size7,.katex .sizing.reset-size10.size7{font-size:.5785920926em}.katex .fontsize-ensurer.reset-size10.size8,.katex .sizing.reset-size10.size8{font-size:.6943105111em}.katex .fontsize-ensurer.reset-size10.size9,.katex .sizing.reset-size10.size9{font-size:.8331726133em}.katex .fontsize-ensurer.reset-size10.size10,.katex .sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .sizing.reset-size10.size11{font-size:1.1996142719em}.katex .fontsize-ensurer.reset-size11.size1,.katex .sizing.reset-size11.size1{font-size:.2009646302em}.katex .fontsize-ensurer.reset-size11.size2,.katex .sizing.reset-size11.size2{font-size:.2411575563em}.katex .fontsize-ensurer.reset-size11.size3,.katex .sizing.reset-size11.size3{font-size:.2813504823em}.katex .fontsize-ensurer.reset-size11.size4,.katex .sizing.reset-size11.size4{font-size:.3215434084em}.katex .fontsize-ensurer.reset-size11.size5,.katex .sizing.reset-size11.size5{font-size:.3617363344em}.katex .fontsize-ensurer.reset-size11.size6,.katex .sizing.reset-size11.size6{font-size:.4019292605em}.katex .fontsize-ensurer.reset-size11.size7,.katex .sizing.reset-size11.size7{font-size:.4823151125em}.katex .fontsize-ensurer.reset-size11.size8,.katex .sizing.reset-size11.size8{font-size:.578778135em}.katex .fontsize-ensurer.reset-size11.size9,.katex .sizing.reset-size11.size9{font-size:.6945337621em}.katex .fontsize-ensurer.reset-size11.size10,.katex .sizing.reset-size11.size10{font-size:.8336012862em}.katex .fontsize-ensurer.reset-size11.size11,.katex .sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{display:inline-block;width:.12em}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .accent .accent-body{position:relative}.katex .accent .accent-body:not(.accent-full){width:0}.katex .overlay{display:block}.katex .mtable .vertical-separator{display:inline-block;min-width:1px}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{fill:currentColor;stroke:currentColor;fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:block;height:inherit;position:absolute;width:100%}.katex svg path{stroke:none}.katex img{border-style:none;max-height:none;max-width:none;min-height:0;min-width:0}.katex .stretchy{display:block;overflow:hidden;position:relative;width:100%}.katex .stretchy:after,.katex .stretchy:before{content:""}.katex .hide-tail{overflow:hidden;position:relative;width:100%}.katex .halfarrow-left{left:0;overflow:hidden;position:absolute;width:50.2%}.katex .halfarrow-right{overflow:hidden;position:absolute;right:0;width:50.2%}.katex .brace-left{left:0;overflow:hidden;position:absolute;width:25.1%}.katex .brace-center{left:25%;overflow:hidden;position:absolute;width:50%}.katex .brace-right{overflow:hidden;position:absolute;right:0;width:25.1%}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{border:.04em solid;box-sizing:border-box}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{border-right:.049em solid;border-top:.049em solid;box-sizing:border-box;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .eqn-num:before{content:"(" counter(katexEqnNo) ")";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:"(" counter(mmlEqnNo) ")";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{display:inline-block;position:absolute;right:calc(50% + .3em);text-align:left}.katex .cd-label-right{display:inline-block;left:calc(50% + .3em);position:absolute;text-align:right}.katex-display{display:block;margin:1em 0;text-align:center}.katex-display>.katex{display:block;text-align:center;white-space:nowrap}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.tag{left:0;right:auto}.katex-display.fleqn>.katex{padding-left:2em;text-align:left}body{counter-reset:katexEqnNo mmlEqnNo}
|
|
65
65
|
`);Ce(`.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:280px;max-width:480px;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:12px 20px;border-bottom:1px solid #f3f4f6;background:#f9fafb}.edpire-annex-panel__header-label{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.08em;color:#6b7280}.edpire-annex-panel__scroll{flex:1;overflow-y:auto;padding:24px 20px;display:flex;flex-direction:column;gap:32px}.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:8px;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 10px 10px 0;padding:18px 10px;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:11px;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,440px);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:16px 20px;border-bottom:1px solid #f3f4f6;background:#f9fafb;flex-shrink:0}.edpire-annex-drawer__label{font-size:13px;font-weight:700;color:#111827}.edpire-annex-drawer__close{display:flex;align-items:center;justify-content:center;width:28px;height:28px;background:none;border:none;cursor:pointer;font-size:20px;line-height:1;color:#9ca3af;border-radius:6px;transition:color .15s,background .15s}.edpire-annex-drawer__close:hover{color:#111827;background:#f3f4f6}.edpire-annex-drawer__scroll{flex:1;overflow-y:auto;padding:24px 20px;display:flex;flex-direction:column;gap:32px}.edpire-annex-backdrop{display:block;position:fixed;inset:0;background:#00000061;z-index:45;cursor:pointer}}
|
|
66
66
|
`);Ce(`/*! 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-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-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 .end{inset-inline-end:var(--spacing)}.edpire-scope .end-2{inset-inline-end:calc(var(--spacing) * 2)}.edpire-scope .end-3{inset-inline-end:calc(var(--spacing) * 3)}.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 .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 .left-0{left:calc(var(--spacing) * 0)}.edpire-scope .left-2{left: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-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 .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\\(100svh-6rem\\)\\]{max-height:calc(100svh - 6rem)}.edpire-scope .max-h-\\[calc\\(100vh-8rem\\)\\]{max-height:calc(100vh - 8rem)}.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 .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 .-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 .grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.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-y-0\\.5{row-gap:calc(var(--spacing) * .5)}.edpire-scope .self-stretch{align-self:stretch}.edpire-scope .truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.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-\\[14px\\]{border-radius:14px}.edpire-scope .rounded-full{border-radius:3.40282e38px}.edpire-scope .rounded-lg{border-radius:var(--radius-lg)}.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-\\[\\#1f8a4c\\]{background-color:#1f8a4c}.edpire-scope .bg-\\[\\#d23b2b\\]{background-color:#d23b2b}.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-4{padding-block:calc(var(--spacing) * 4)}.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 .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 .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-\\[10px\\]{font-size:10px}.edpire-scope .text-\\[11px\\]{font-size:11px}.edpire-scope .text-\\[20px\\]{font-size:20px}.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-black\\/20{color:#0003}@supports (color:color-mix(in lab,red,red)){.edpire-scope .text-black\\/20{color:color-mix(in oklab,var(--color-black) 20%,transparent)}}.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 .capitalize{text-transform:capitalize}.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 .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 .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 :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-\\[\\#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 .disabled\\:cursor-not-allowed):disabled{cursor:not-allowed}.edpire-scope :is(.edpire-scope .disabled\\:opacity-50):disabled{opacity:.5}@media(min-width:40rem){.edpire-scope .sm\\:block{display:block}.edpire-scope .sm\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.edpire-scope .sm\\:flex-row{flex-direction:row}.edpire-scope .sm\\:items-center{align-items:center}}@container (min-width:72rem){.edpire-scope .\\@6xl\\:flex{display:flex}.edpire-scope .\\@6xl\\:hidden{display:none}}.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)}@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-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}}
|
|
67
|
-
`);import{Fragment as En,jsx as A,jsxs as D}from"react/jsx-runtime";var Ss="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 _s(e){for(let t of e.exercises)for(let r of t.questions)if((r.content.content??[]).some(i=>i.type==="aiAnswerInput"))return!0;return!1}function $n(e){let t=e;return typeof t.totalMaxScore=="number"?t.totalMaxScore:(t.answerKeys??[]).reduce((r,n)=>r+(n.scoring?.maxScore??0),0)}function Pn(e){return e.questions.reduce((t,r)=>t+$n(r),0)}function Ae(e){return Number.isInteger(e)?String(e):parseFloat(e.toFixed(2)).toString()}function jn(e){return e==="full"?"#1f8a4c":e==="partial"?"#c8810e":"#d23b2b"}function Ns({outcome:e}){let t=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 A("svg",{width:14,height:14,viewBox:"0 0 100 100",fill:"none",stroke:jn(e),strokeWidth:9,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:A("path",{d:t})})}function Cs({score:e,weight:t,t:r}){if(e){if(e.awaiting)return D("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:[A(st,{size:11}),r("pendingReview")]});let n=e.m>0&&e.s>=e.m?"full":e.s>0?"partial":"none";return D("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:[A(Ns,{outcome:n}),D("span",{className:"font-bold leading-none",style:{fontFamily:'var(--font-hand, "Caveat", cursive)',fontSize:"1.05rem",color:jn(n)},children:[Ae(e.s)," / ",Ae(e.m)]})]})}return t>0?D("span",{className:"text-xs font-semibold tabular-nums text-[#8d93a0]",children:[Ae(t)," ",r("points")]}):null}function As({timeLimitMinutes:e,startedAt:t,onExpire:r}){let n=e*6e4,i=new Date(t).getTime()+n,[s,o]=Fe(()=>Math.max(i-Date.now(),0)),a=Ln(r);a.current=r,In(()=>{if(s<=0){a.current();return}let h=setInterval(()=>{let y=Math.max(i-Date.now(),0);o(y),y<=0&&(clearInterval(h),a.current())},1e3);return()=>clearInterval(h)},[i]);let l=s/n,c=l<.1?"bg-[#fdeeec] text-[#a32b1e] border-[#f6cfc9] animate-pulse":l<.25?"bg-[#fbf1dc] text-[#8a5a08] border-[#f2e2bf]":"bg-[#f5f4f1] text-[#565b66] border-[#e7e5e0]",d=Math.ceil(s/1e3),f=Math.floor(d/3600),g=Math.floor(d%3600/60),m=d%60,b=f>0?`${f}:${String(g).padStart(2,"0")}:${String(m).padStart(2,"0")}`:`${g}:${String(m).padStart(2,"0")}`;return D("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",c),children:[A(st,{size:12}),b]})}function Bn({assessment:e,meta:t,locale:r="en",branding:n,timeLimitMinutes:i,startedAt:s,onSubmit:o,onViewReport:a,reportLabel:l,onBack:c,backLabel:d,allowReset:f,onReset:g,overlayConfig:m,contained:b=!1,onClose:h,mediaHandler:y,onAddAnnex:w,fallbackLogoUrl:v}){let k=Ye(()=>Rn(r),[r]),x=Sn(r)?"rtl":"ltr",u=n?.branding?.primaryColor,_=n?.branding?.accentColor,P=n?.branding?.fontFamily,L=n?.branding?.fontUrl,I=n?.branding?.showPoweredBy!==!1;In(()=>{if(!L||typeof document>"u"||document.querySelector(`link[href="${L}"]`))return;let me=document.createElement("link");me.rel="stylesheet",me.href=L,document.head.appendChild(me)},[L]);let[p,T]=Fe({exerciseAnswers:[]}),[N,W]=Fe(!1),[R,E]=Fe(!1),[M,$]=Fe(null),[O,G]=Fe(null),[we,S]=Fe(!1),C=Ln(!1),B=Ye(()=>_s(e),[e]),K=Ye(()=>e.exercises.reduce((U,me)=>U+Pn(me),0),[e]),F=Ye(()=>M?zn(M.exerciseFeedback):void 0,[M]),ce=Ye(()=>{if(!M)return{};let U={};for(let me of M.exerciseFeedback){let Le=0,Te=0,de=!1;for(let Oe of me.questions)for(let Se of Oe.nodeResults)Le+=Se.score,Te+=Se.maxScore,Se.status==="awaiting_review"&&(de=!0);U[me.exerciseId]={score:Le,maxScore:Te,awaiting:de}}return U},[M]),J=Ye(()=>{if(!M)return{};let U={};for(let me of M.exerciseFeedback)for(let Le of me.questions){let Te=0,de=0,Oe=!1;for(let Se of Le.nodeResults)Te+=Se.score,de+=Se.maxScore,Se.status==="awaiting_review"&&(Oe=!0);U[Le.questionId]={score:Te,maxScore:de,awaiting:Oe}}return U},[M]),ae=ot(async()=>{W(!0),G(null);try{let U=await o(p);$(U),typeof window<"u"&&window.scrollTo({top:0,behavior:"smooth"})}catch(U){G(U instanceof Error?U.message:k("confirmCancel"))}finally{W(!1),E(!1)}},[p,o,k]),re=ot(()=>{!M||!a||a(M)},[M,a]),ne=ot(()=>{C.current||N||M||(C.current=!0,S(!0),E(!1),typeof document<"u"&&document.activeElement?.blur(),setTimeout(()=>{W(!0),G(null),o(p).then(U=>{$(U),typeof window<"u"&&window.scrollTo({top:0,behavior:"smooth"})}).catch(U=>{G(U instanceof Error?U.message:"submit_error")}).finally(()=>{W(!1),S(!1)})},800))},[p,N,o,M]),be=ot((U,me,Le)=>{let Te=Pn(U),de=ce[U.id],Oe=U.questions.length>1,Se=Nn(me)?_n(me,{renderQuestion:(at,Kt,Kn)=>{let wr=y&&Nn(Kt)?_n(Kt,{mediaHandler:y}):Kt,Je=at.id;if(!Oe)return A("div",{"data-question-id":Je,children:wr},Je);let lt=J[Je],Xn=$n(at);return D("div",{"data-question-id":Je,children:[D("div",{className:"flex items-center gap-2.5 mb-3",children:[A("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:k("question",{index:Kn+1})}),A(Cs,{score:lt?{s:lt.score,m:lt.maxScore,awaiting:lt.awaiting}:null,weight:Xn,t:k})]}),wr]},Je)},renderSeparator:at=>A("div",{className:"border-t border-[#e7e5e0] my-1"},`qsep-${at}`)}):me;return D("div",{"data-exercise-id":U.id,className:"bg-white rounded-[14px] border border-[#e7e5e0] shadow-sm overflow-hidden",children:[D("div",{className:"flex items-center justify-between px-4 py-2.5 bg-[#f1efe9] border-b border-[#e7e5e0]",style:_?{backgroundColor:_}:void 0,children:[A("span",{className:"text-sm font-bold text-[#1d2025]",children:k("exercise",{index:Le+1})}),de?.awaiting?D("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:[A(st,{size:11}),k("pendingReview")]}):de?D("span",{className:"font-bold leading-none tabular-nums",style:{fontFamily:'var(--font-hand, "Caveat", cursive)',fontSize:"1.15rem",color:de.maxScore>0&&de.score>=de.maxScore?"#1f8a4c":de.maxScore>0&&de.score>0?"#c8810e":de.maxScore>0?"#d23b2b":"#8d93a0"},children:[Ae(de.score)," / ",Ae(de.maxScore)]}):Te>0?D("span",{className:"text-xs font-semibold text-[#8d93a0] tabular-nums",children:["/ ",Ae(Te)," ",k("points")]}):null]}),A("div",{className:"p-4",children:Se})]},U.id)},[k,ce,J,_,y]),De=ot(U=>D("div",{className:"flex items-center gap-3 py-2",children:[A("div",{className:"flex-1 border-t border-dashed border-[#e7e5e0]"}),A("span",{className:"text-[10px] font-bold text-[#8d93a0] uppercase tracking-widest",children:k("exercise",{index:U+2})}),A("div",{className:"flex-1 border-t border-dashed border-[#e7e5e0]"})]},`sep-${U}`),[k]),he=M!==null;return A("div",{className:"edpire-scope",style:{display:"contents"},children:D("div",{dir:x,className:se("flex flex-col",b?"h-full":"h-dvh"),style:P?{fontFamily:P}:void 0,children:[A(bn,{visible:N&&!we,hasAiNodes:B,text:k("evaluating"),aiText:k("aiEvaluating"),contained:b,...m}),we&&D("div",{className:se("fixed inset-0 z-50 flex flex-col items-center justify-center gap-3 bg-red-950/80 backdrop-blur-sm",b&&"absolute"),children:[A(st,{size:40,className:"text-red-300"}),A("p",{className:"text-xl font-black text-white tracking-tight",children:k("timeUp.title")}),A("p",{className:"text-sm text-red-200",children:k("timeUp.submitting")})]}),D("div",{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:_?{backgroundColor:_}:void 0,children:[D("div",{className:"flex items-center gap-3",children:[A("img",{src:n?.logoUrl??v??Ss,alt:n?.name??"Edpire",width:24,height:24,loading:"lazy",className:"rounded object-contain"}),D("div",{children:[A("h1",{className:"text-sm font-bold text-[#1d2025]",children:t.title}),A("p",{className:"text-[11px] text-[#8d93a0] capitalize",children:K>0&&D("span",{className:"ms-2 font-semibold text-[#565b66]",children:["/ ",Ae(K)," ",k("points")]})})]}),!he&&i&&i>0&&s&&A(As,{timeLimitMinutes:i,startedAt:s,onExpire:ne})]}),D("div",{className:"flex items-center gap-2",children:[f&&D("button",{onClick:g,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:[A(Rs,{size:13}),k("reset")]}),!he&&c&&D("button",{onClick:c,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:[A(Mn,{size:13}),d??k("back")]}),h&&A("button",{onClick:h,className:"p-1.5 text-[#8d93a0] hover:text-[#1d2025] hover:bg-[#f1efe9] rounded-lg transition-colors",children:A(Mn,{size:15})}),!he&&A("button",{onClick:()=>E(!0),disabled:N,style:u?{backgroundColor:u}: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:N?D(En,{children:[A(An,{size:14,className:"animate-spin"}),k("submitting")]}):D(En,{children:[A(Cn,{size:14}),k("submit")]})})]})]}),O&&A("div",{className:"flex-shrink-0 bg-[#fdeeec] border-b border-[#f6cfc9] px-4 py-2 text-sm text-[#a32b1e]",children:O}),he&&M&&(M.awaitingManualGrading?A("div",{className:"flex-shrink-0 border-b bg-[#fbf1dc] border-[#f2e2bf]",children:A("div",{className:"max-w-3xl mx-auto px-6 py-4",children:D("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-4",children:[D("div",{className:"flex items-center gap-2",children:[A(st,{size:20,className:"text-[#c8810e] flex-shrink-0"}),A("span",{className:"text-sm font-semibold text-[#8a5a08]",children:k("awaitingReview")})]}),A("div",{className:"hidden sm:block w-px h-8 bg-[#f2e2bf]"}),A("p",{className:"text-sm text-[#8a5a08] flex-1 min-w-0",children:k("awaitingReviewDesc")}),a&&D("button",{onClick:re,style:u?{backgroundColor:u}: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:[A(Tn,{size:14}),l??k("viewFullReport")]})]})})}):A("div",{className:se("flex-shrink-0 border-b",M.passed?"bg-[#ecf8f0] border-[#c5e8d1]":"bg-[#fdeeec] border-[#f6cfc9]"),children:A("div",{className:"max-w-3xl mx-auto px-6 py-4",children:D("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-4",children:[D("div",{className:"flex items-center gap-2",children:[M.passed?A(ks,{size:20,className:"text-[#1f8a4c] flex-shrink-0"}):A(zs,{size:20,className:"text-[#d23b2b] flex-shrink-0"}),A("span",{className:se("text-sm font-semibold",M.passed?"text-[#1f8a4c]":"text-[#d23b2b]"),children:M.passed?k("assessmentPassed"):k("assessmentNotPassed")})]}),A("div",{className:"hidden sm:block w-px h-8 bg-[#e7e5e0]"}),D("div",{className:"flex items-baseline gap-1.5",children:[D("span",{className:"leading-none tabular-nums",style:{fontFamily:'var(--font-hand, "Caveat", cursive)',fontSize:"2rem",color:M.passed?"#1f8a4c":"#d23b2b"},children:[Ae(M.totalScore)," / ",Ae(M.maxScore)]}),A("span",{className:"text-sm text-[#8d93a0] font-medium",children:k("points")})]}),D("div",{className:"flex-1 flex items-center gap-3 min-w-0",children:[A("div",{className:"flex-1 h-2 bg-[#e7e5e0] rounded-full overflow-hidden min-w-[80px]",children:A("div",{className:se("h-full rounded-full transition-all duration-700",M.passed?"bg-[#1f8a4c]":"bg-[#d23b2b]"),style:{width:`${M.percentage}%`}})}),D("span",{className:se("text-sm font-bold tabular-nums flex-shrink-0",M.passed?"text-[#1f8a4c]":"text-[#d23b2b]"),children:[M.percentage,"%"]})]}),a&&D("button",{onClick:re,style:u?{backgroundColor:u}: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:[A(Tn,{size:14}),l??k("viewFullReport")]})]})})})),A("div",{className:se("flex-1 overflow-hidden flex flex-col",we&&"pointer-events-none opacity-60"),children:e.annex?A(wn,{assessment:e,isSubmitted:he,setAnswers:T,validationFeedback:F,renderExercise:be,renderSeparator:De,primaryColor:u,contained:b,locale:Ot(r),t:k}):w?A(kn,{assessment:e,isSubmitted:he,setAnswers:T,validationFeedback:F,renderExercise:be,renderSeparator:De,primaryColor:u,contained:b,locale:Ot(r),t:k,onAddAnnex:w}):A("div",{className:"flex-1 overflow-y-auto",children:A("div",{className:"max-w-3xl mx-auto p-6 flex flex-col gap-4",children:A(Ne,{assessment:e,onAnswersChange:he?void 0:T,validationFeedback:F,renderExercise:be,renderSeparator:De,locale:Ot(r)})})})}),I&&A("div",{className:"fixed bottom-2 end-3 text-[20px] text-black/20 pointer-events-none select-none z-10",children:k("poweredBy")}),R&&A("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",children:D("div",{className:"bg-white rounded-[14px] shadow-xl p-6 max-w-sm mx-4",children:[A("h3",{className:"text-base font-bold text-[#1d2025] mb-2",children:k("confirmTitle")}),A("p",{className:"text-sm text-[#565b66] mb-5",children:k("confirmDescription")}),D("div",{className:"flex gap-3 justify-end",children:[A("button",{onClick:()=>E(!1),className:"px-4 py-2 text-sm font-medium text-[#565b66] hover:bg-[#f1efe9] rounded-lg transition-colors",children:k("confirmCancel")}),D("button",{onClick:ae,disabled:N,style:u?{backgroundColor:u}: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:[N?A(An,{size:14,className:"animate-spin"}):A(Cn,{size:14}),k("confirmSubmit")]})]})]})})]})})}import{jsx as Es}from"react/jsx-runtime";function Ps(e,t){let r=(e.exercise_feedback??[]).map(n=>({exerciseId:n.exercise_id,questions:n.questions.map(i=>({questionId:i.question_id,nodeResults:i.node_results.map(s=>({nodeId:s.node_id,status:s.status,score:s.score,maxScore:s.max_score,...s.feedback!==void 0?{feedback:s.feedback}:{},...s.display_answer!==void 0?{displayAnswer:s.display_answer}:{},...s.detail!==void 0?{detail:s.detail}:{}}))}))}));return{submissionId:e.submission_id,totalScore:e.score,maxScore:e.max_score,percentage:e.percentage,passed:e.passed,returnUrl:t??null,exerciseFeedback:r,awaitingManualGrading:e.awaiting_manual_grading??!1}}function Dn({token:e,data:t,baseUrl:r,options:n}){let{locale:i,branding:s,returnUrl:o,reportLabel:a,backLabel:l,onBack:c,overlayConfig:d,mediaHandler:f,onComplete:g,onError:m}=n,b=s??t.branding??void 0,h=i??t.meta.language??"en",y=Ts(()=>({exercises:t.assessment.exercises.map(x=>({id:x.id,sharedContext:x.sharedContext,questions:x.questions.map(u=>({id:u.id,version:"1.0",content:u.content,answerKeys:[]}))}))}),[t]),[w]=Ms(()=>new Date().toISOString()),v=Fn(async x=>{let u=await fetch(`${r}/api/v1/embed/submit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:e,answers:x})});if(!u.ok){let P=await u.json().catch(()=>({})),L=typeof P.error=="string"?P.error:"Submission failed",I=u.status===401?"TOKEN_INVALID":u.status===409?"TOKEN_USED":u.status===404?"ASSESSMENT_NOT_FOUND":"UNKNOWN";throw m?.({code:I,message:L}),new Error(L)}let _=await u.json();return g?.(_),Ps(_,o)},[r,e,g,m,o]),k=Fn(x=>{if(o)try{let u=new URL(o);u.searchParams.set("submission_id",x.submissionId),x.awaitingManualGrading||(u.searchParams.set("score",String(x.totalScore)),u.searchParams.set("max_score",String(x.maxScore))),window.location.href=u.toString()}catch{window.location.href=o}},[o]);return Es(Bn,{assessment:y,meta:{title:t.meta.title,category:t.meta.category??null},locale:h,branding:b,timeLimitMinutes:t.meta.settings.time_limit_minutes,startedAt:w,onSubmit:v,onViewReport:o?k:void 0,reportLabel:a,onBack:c,backLabel:l,overlayConfig:d,mediaHandler:f})}import $s from"react";import{createRoot as js}from"react-dom/client";import Is,{useMemo as Ls}from"react";import{jsx as yr}from"react/jsx-runtime";var On=Is.memo(function({content:t,onAnswersChange:r,feedback:n,initialAnswers:i,className:s,dir:o}){let a=Ls(()=>{if(n)return new Map(Object.entries(n))},[n]),l=yr(Ge,{content:t,onAnswersChange:r,initialAnswers:i,validationFeedback:a,className:s});return yr("div",{className:"edpire-scope",style:{display:"contents"},children:o?yr("div",{dir:o,children:l}):l})});function Bs(e){let{container:t,content:r,onAnswersChange:n,feedback:i,initialAnswers:s,dir:o}=e,a=typeof t=="string"?document.querySelector(t):t;if(!a)throw new Error(`EdpireSDK.renderQuestion: container not found: ${String(t)}`);let l={content:r,onAnswersChange:n,feedback:i,initialAnswers:s,dir:o},c=js(a);function d(){c.render($s.createElement(On,l))}return d(),{setContent(f){l={...l,content:f,feedback:null},d()},setFeedback(f){l={...l,feedback:f},d()},setInitialAnswers(f){l={...l,initialAnswers:f},d()},unmount(){c.unmount()}}}function Fs(e){let t=[],r=0;for(let n of e.exercises)for(let i of n.questions)t.push({exerciseId:n.id,questionId:i.id,content:i.content_ast,points:i.points,sequenceNumber:i.sequence_number,index:r++});return t}function Ds(e){let t=new Map;for(let r of e)t.has(r.exerciseId)||t.set(r.exerciseId,[]),t.get(r.exerciseId).push({questionId:r.questionId,answers:r.answers});return{exerciseAnswers:Array.from(t.entries()).map(([r,n])=>({exerciseId:r,questionAnswers:n}))}}var Xs="https://edpire.com",pf={mount(e){let{token:t,container:r,baseUrl:n=Xs,onError:i}=e,s=typeof r=="string"?document.querySelector(r):r;if(!s){let c={code:"UNKNOWN",message:`Container not found: ${r}`};return i?.(c),{unmount:()=>{}}}let o=null,a=!1;function l(){if(a)return;a=!0;let c=o;o=null,setTimeout(()=>{c?.unmount()},0)}return(async()=>{s.innerHTML='<div style="padding:32px;text-align:center;color:#6b7280;font-family:sans-serif">Loading assessment\u2026</div>';let c;try{let d=await fetch(`${n}/api/v1/embed/assessments?token=${encodeURIComponent(t)}`,{method:"GET",headers:{"Content-Type":"application/json"}});if(!d.ok){let f=await d.json().catch(()=>({})),g=typeof f.error=="string"?f.error:"Failed to load assessment",m=d.status===401?"TOKEN_INVALID":d.status===403?"ORIGIN_NOT_ALLOWED":d.status===404?"ASSESSMENT_NOT_FOUND":"UNKNOWN";i?.({code:m,message:g}),s.innerHTML=`<div style="padding:32px;text-align:center;color:#dc2626;font-family:sans-serif">${g}</div>`;return}c=await d.json()}catch{i?.({code:"NETWORK_ERROR",message:"Failed to connect to Edpire"}),s.innerHTML='<div style="padding:32px;text-align:center;color:#dc2626;font-family:sans-serif">Failed to connect to Edpire. Please try again.</div>';return}a||(s.innerHTML="",o=Ks(s),o.render(Os.createElement(Dn,{token:t,data:c,baseUrl:n,options:e})))})(),{unmount:l}}};export{pf as EdpireAssessment,Ds as buildSubmitPayload,Fs as flattenAssessment,Bs as renderQuestion};
|
|
67
|
+
`);import{Fragment as En,jsx as A,jsxs as D}from"react/jsx-runtime";var Ss="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 _s(e){for(let t of e.exercises)for(let r of t.questions)if((r.content.content??[]).some(i=>i.type==="aiAnswerInput"))return!0;return!1}function $n(e){let t=e;return typeof t.totalMaxScore=="number"?t.totalMaxScore:(t.answerKeys??[]).reduce((r,n)=>r+(n.scoring?.maxScore??0),0)}function Pn(e){return e.questions.reduce((t,r)=>t+$n(r),0)}function Ae(e){return Number.isInteger(e)?String(e):parseFloat(e.toFixed(2)).toString()}function jn(e){return e==="full"?"#1f8a4c":e==="partial"?"#c8810e":"#d23b2b"}function Ns({outcome:e}){let t=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 A("svg",{width:14,height:14,viewBox:"0 0 100 100",fill:"none",stroke:jn(e),strokeWidth:9,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:A("path",{d:t})})}function Cs({score:e,weight:t,t:r}){if(e){if(e.awaiting)return D("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:[A(st,{size:11}),r("pendingReview")]});let n=e.m>0&&e.s>=e.m?"full":e.s>0?"partial":"none";return D("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:[A(Ns,{outcome:n}),D("span",{className:"font-bold leading-none",style:{fontFamily:'var(--font-hand, "Caveat", cursive)',fontSize:"1.05rem",color:jn(n)},children:[Ae(e.s)," / ",Ae(e.m)]})]})}return t>0?D("span",{className:"text-xs font-semibold tabular-nums text-[#8d93a0]",children:[Ae(t)," ",r("points")]}):null}function As({timeLimitMinutes:e,startedAt:t,onExpire:r}){let n=e*6e4,i=new Date(t).getTime()+n,[s,o]=Fe(()=>Math.max(i-Date.now(),0)),a=Ln(r);a.current=r,In(()=>{if(s<=0){a.current();return}let h=setInterval(()=>{let y=Math.max(i-Date.now(),0);o(y),y<=0&&(clearInterval(h),a.current())},1e3);return()=>clearInterval(h)},[i]);let l=s/n,c=l<.1?"bg-[#fdeeec] text-[#a32b1e] border-[#f6cfc9] animate-pulse":l<.25?"bg-[#fbf1dc] text-[#8a5a08] border-[#f2e2bf]":"bg-[#f5f4f1] text-[#565b66] border-[#e7e5e0]",d=Math.ceil(s/1e3),f=Math.floor(d/3600),g=Math.floor(d%3600/60),m=d%60,b=f>0?`${f}:${String(g).padStart(2,"0")}:${String(m).padStart(2,"0")}`:`${g}:${String(m).padStart(2,"0")}`;return D("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",c),children:[A(st,{size:12}),b]})}function Bn({assessment:e,meta:t,locale:r="en",branding:n,timeLimitMinutes:i,startedAt:s,onSubmit:o,onViewReport:a,reportLabel:l,onBack:c,backLabel:d,allowReset:f,onReset:g,overlayConfig:m,contained:b=!1,onClose:h,mediaHandler:y,onAddAnnex:w,fallbackLogoUrl:v}){let k=Ye(()=>Rn(r),[r]),x=Sn(r)?"rtl":"ltr",u=n?.branding?.primaryColor,_=n?.branding?.accentColor,P=n?.branding?.fontFamily,L=n?.branding?.fontUrl,I=n?.branding?.showPoweredBy!==!1;In(()=>{if(!L||typeof document>"u"||document.querySelector(`link[href="${L}"]`))return;let me=document.createElement("link");me.rel="stylesheet",me.href=L,document.head.appendChild(me)},[L]);let[p,T]=Fe({exerciseAnswers:[]}),[N,W]=Fe(!1),[R,E]=Fe(!1),[M,$]=Fe(null),[O,G]=Fe(null),[we,S]=Fe(!1),C=Ln(!1),B=Ye(()=>_s(e),[e]),K=Ye(()=>e.exercises.reduce((U,me)=>U+Pn(me),0),[e]),F=Ye(()=>M?zn(M.exerciseFeedback):void 0,[M]),ce=Ye(()=>{if(!M)return{};let U={};for(let me of M.exerciseFeedback){let Le=0,Te=0,de=!1;for(let Oe of me.questions)for(let Se of Oe.nodeResults)Le+=Se.score,Te+=Se.maxScore,Se.status==="awaiting_review"&&(de=!0);U[me.exerciseId]={score:Le,maxScore:Te,awaiting:de}}return U},[M]),J=Ye(()=>{if(!M)return{};let U={};for(let me of M.exerciseFeedback)for(let Le of me.questions){let Te=0,de=0,Oe=!1;for(let Se of Le.nodeResults)Te+=Se.score,de+=Se.maxScore,Se.status==="awaiting_review"&&(Oe=!0);U[Le.questionId]={score:Te,maxScore:de,awaiting:Oe}}return U},[M]),ae=ot(async()=>{W(!0),G(null);try{let U=await o(p);$(U),typeof window<"u"&&window.scrollTo({top:0,behavior:"smooth"})}catch(U){G(U instanceof Error?U.message:k("confirmCancel"))}finally{W(!1),E(!1)}},[p,o,k]),re=ot(()=>{!M||!a||a(M)},[M,a]),ne=ot(()=>{C.current||N||M||(C.current=!0,S(!0),E(!1),typeof document<"u"&&document.activeElement?.blur(),setTimeout(()=>{W(!0),G(null),o(p).then(U=>{$(U),typeof window<"u"&&window.scrollTo({top:0,behavior:"smooth"})}).catch(U=>{G(U instanceof Error?U.message:"submit_error")}).finally(()=>{W(!1),S(!1)})},800))},[p,N,o,M]),be=ot((U,me,Le)=>{let Te=Pn(U),de=ce[U.id],Oe=U.questions.length>1,Se=Nn(me)?_n(me,{renderQuestion:(at,Kt,Kn)=>{let wr=y&&Nn(Kt)?_n(Kt,{mediaHandler:y}):Kt,Je=at.id;if(!Oe)return A("div",{"data-question-id":Je,children:wr},Je);let lt=J[Je],Xn=$n(at);return D("div",{"data-question-id":Je,children:[D("div",{className:"flex items-center gap-2.5 mb-3",children:[A("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:k("question",{index:Kn+1})}),A(Cs,{score:lt?{s:lt.score,m:lt.maxScore,awaiting:lt.awaiting}:null,weight:Xn,t:k})]}),wr]},Je)},renderSeparator:at=>A("div",{className:"border-t border-[#e7e5e0] my-1"},`qsep-${at}`)}):me;return D("div",{"data-exercise-id":U.id,className:"bg-white rounded-[14px] border border-[#e7e5e0] shadow-sm overflow-hidden",children:[D("div",{className:"flex items-center justify-between px-4 py-2.5 bg-[#f1efe9] border-b border-[#e7e5e0]",style:_?{backgroundColor:_}:void 0,children:[A("span",{className:"text-sm font-bold text-[#1d2025]",children:k("exercise",{index:Le+1})}),de?.awaiting?D("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:[A(st,{size:11}),k("pendingReview")]}):de?D("span",{className:"font-bold leading-none tabular-nums",style:{fontFamily:'var(--font-hand, "Caveat", cursive)',fontSize:"1.15rem",color:de.maxScore>0&&de.score>=de.maxScore?"#1f8a4c":de.maxScore>0&&de.score>0?"#c8810e":de.maxScore>0?"#d23b2b":"#8d93a0"},children:[Ae(de.score)," / ",Ae(de.maxScore)]}):Te>0?D("span",{className:"text-xs font-semibold text-[#8d93a0] tabular-nums",children:["/ ",Ae(Te)," ",k("points")]}):null]}),A("div",{className:"p-4",children:Se})]},U.id)},[k,ce,J,_,y]),De=ot(U=>D("div",{className:"flex items-center gap-3 py-2",children:[A("div",{className:"flex-1 border-t border-dashed border-[#e7e5e0]"}),A("span",{className:"text-[10px] font-bold text-[#8d93a0] uppercase tracking-widest",children:k("exercise",{index:U+2})}),A("div",{className:"flex-1 border-t border-dashed border-[#e7e5e0]"})]},`sep-${U}`),[k]),he=M!==null;return A("div",{className:"edpire-scope",style:{display:"contents"},children:D("div",{dir:x,className:se("flex flex-col",b?"h-full":"h-dvh"),style:P?{fontFamily:P}:void 0,children:[A(bn,{visible:N&&!we,hasAiNodes:B,text:k("evaluating"),aiText:k("aiEvaluating"),contained:b,...m}),we&&D("div",{className:se("fixed inset-0 z-50 flex flex-col items-center justify-center gap-3 bg-red-950/80 backdrop-blur-sm",b&&"absolute"),children:[A(st,{size:40,className:"text-red-300"}),A("p",{className:"text-xl font-black text-white tracking-tight",children:k("timeUp.title")}),A("p",{className:"text-sm text-red-200",children:k("timeUp.submitting")})]}),D("div",{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:_?{backgroundColor:_}:void 0,children:[D("div",{className:"flex items-center gap-3",children:[A("img",{src:n?.logoUrl??v??Ss,alt:n?.name??"Edpire",width:24,height:24,loading:"lazy",className:"rounded object-contain"}),D("div",{children:[A("h1",{className:"text-sm font-bold text-[#1d2025]",children:t.title}),A("p",{className:"text-[11px] text-[#8d93a0] capitalize",children:K>0&&D("span",{className:"ms-2 font-semibold text-[#565b66]",children:["/ ",Ae(K)," ",k("points")]})})]}),!he&&i&&i>0&&s&&A(As,{timeLimitMinutes:i,startedAt:s,onExpire:ne})]}),D("div",{className:"flex items-center gap-2",children:[f&&D("button",{onClick:g,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:[A(Rs,{size:13}),k("reset")]}),!he&&c&&D("button",{onClick:c,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:[A(Mn,{size:13}),d??k("back")]}),h&&A("button",{onClick:h,className:"p-1.5 text-[#8d93a0] hover:text-[#1d2025] hover:bg-[#f1efe9] rounded-lg transition-colors",children:A(Mn,{size:15})}),!he&&A("button",{onClick:()=>E(!0),disabled:N,style:u?{backgroundColor:u}: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:N?D(En,{children:[A(An,{size:14,className:"animate-spin"}),k("submitting")]}):D(En,{children:[A(Cn,{size:14}),k("submit")]})})]})]}),O&&A("div",{className:"flex-shrink-0 bg-[#fdeeec] border-b border-[#f6cfc9] px-4 py-2 text-sm text-[#a32b1e]",children:O}),he&&M&&(M.awaitingManualGrading?A("div",{className:"flex-shrink-0 border-b bg-[#fbf1dc] border-[#f2e2bf]",children:A("div",{className:"max-w-3xl mx-auto px-6 py-4",children:D("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-4",children:[D("div",{className:"flex items-center gap-2",children:[A(st,{size:20,className:"text-[#c8810e] flex-shrink-0"}),A("span",{className:"text-sm font-semibold text-[#8a5a08]",children:k("awaitingReview")})]}),A("div",{className:"hidden sm:block w-px h-8 bg-[#f2e2bf]"}),A("p",{className:"text-sm text-[#8a5a08] flex-1 min-w-0",children:k("awaitingReviewDesc")}),a&&D("button",{onClick:re,style:u?{backgroundColor:u}: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:[A(Tn,{size:14}),l??k("viewFullReport")]})]})})}):A("div",{className:se("flex-shrink-0 border-b",M.passed?"bg-[#ecf8f0] border-[#c5e8d1]":"bg-[#fdeeec] border-[#f6cfc9]"),children:A("div",{className:"max-w-3xl mx-auto px-6 py-4",children:D("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-4",children:[D("div",{className:"flex items-center gap-2",children:[M.passed?A(ks,{size:20,className:"text-[#1f8a4c] flex-shrink-0"}):A(zs,{size:20,className:"text-[#d23b2b] flex-shrink-0"}),A("span",{className:se("text-sm font-semibold",M.passed?"text-[#1f8a4c]":"text-[#d23b2b]"),children:M.passed?k("assessmentPassed"):k("assessmentNotPassed")})]}),A("div",{className:"hidden sm:block w-px h-8 bg-[#e7e5e0]"}),D("div",{className:"flex items-baseline gap-1.5",children:[D("span",{className:"leading-none tabular-nums",style:{fontFamily:'var(--font-hand, "Caveat", cursive)',fontSize:"2rem",color:M.passed?"#1f8a4c":"#d23b2b"},children:[Ae(M.totalScore)," / ",Ae(M.maxScore)]}),A("span",{className:"text-sm text-[#8d93a0] font-medium",children:k("points")})]}),D("div",{className:"flex-1 flex items-center gap-3 min-w-0",children:[A("div",{className:"flex-1 h-2 bg-[#e7e5e0] rounded-full overflow-hidden min-w-[80px]",children:A("div",{className:se("h-full rounded-full transition-all duration-700",M.passed?"bg-[#1f8a4c]":"bg-[#d23b2b]"),style:{width:`${M.percentage}%`}})}),D("span",{className:se("text-sm font-bold tabular-nums flex-shrink-0",M.passed?"text-[#1f8a4c]":"text-[#d23b2b]"),children:[M.percentage,"%"]})]}),a&&D("button",{onClick:re,style:u?{backgroundColor:u}: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:[A(Tn,{size:14}),l??k("viewFullReport")]})]})})})),A("div",{className:se("flex-1 overflow-hidden flex flex-col",we&&"pointer-events-none opacity-60"),children:e.annex?A(wn,{assessment:e,isSubmitted:he,setAnswers:T,validationFeedback:F,renderExercise:be,renderSeparator:De,primaryColor:u,contained:b,locale:Ot(r),t:k}):w?A(kn,{assessment:e,isSubmitted:he,setAnswers:T,validationFeedback:F,renderExercise:be,renderSeparator:De,primaryColor:u,contained:b,locale:Ot(r),t:k,onAddAnnex:w}):A("div",{className:"flex-1 overflow-y-auto",children:A("div",{className:"max-w-3xl mx-auto p-6 flex flex-col gap-4",children:A(Ne,{assessment:e,onAnswersChange:he?void 0:T,validationFeedback:F,renderExercise:be,renderSeparator:De,locale:Ot(r)})})})}),I&&A("div",{className:"fixed bottom-2 end-3 text-[20px] text-black/20 pointer-events-none select-none z-10",children:k("poweredBy")}),R&&A("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",children:D("div",{className:"bg-white rounded-[14px] shadow-xl p-6 max-w-sm mx-4",children:[A("h3",{className:"text-base font-bold text-[#1d2025] mb-2",children:k("confirmTitle")}),A("p",{className:"text-sm text-[#565b66] mb-5",children:k("confirmDescription")}),D("div",{className:"flex gap-3 justify-end",children:[A("button",{onClick:()=>E(!1),className:"px-4 py-2 text-sm font-medium text-[#565b66] hover:bg-[#f1efe9] rounded-lg transition-colors",children:k("confirmCancel")}),D("button",{onClick:ae,disabled:N,style:u?{backgroundColor:u}: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:[N?A(An,{size:14,className:"animate-spin"}):A(Cn,{size:14}),k("confirmSubmit")]})]})]})})]})})}import{jsx as Es}from"react/jsx-runtime";function Ps(e,t){let r=(e.exercise_feedback??[]).map(n=>({exerciseId:n.exercise_id,questions:n.questions.map(i=>({questionId:i.question_id,nodeResults:i.node_results.map(s=>({nodeId:s.node_id,status:s.status,score:s.score,maxScore:s.max_score,...s.feedback!==void 0?{feedback:s.feedback}:{},...s.display_answer!==void 0?{displayAnswer:s.display_answer}:{},...s.detail!==void 0?{detail:s.detail}:{}}))}))}));return{submissionId:e.submission_id,totalScore:e.score,maxScore:e.max_score,percentage:e.percentage,passed:e.passed,returnUrl:t??null,exerciseFeedback:r,awaitingManualGrading:e.awaiting_manual_grading??!1}}function Dn({token:e,data:t,baseUrl:r,options:n}){let{locale:i,branding:s,returnUrl:o,reportLabel:a,backLabel:l,onBack:c,overlayConfig:d,mediaHandler:f,onComplete:g,onError:m}=n,b=s??t.branding??void 0,h=i??t.meta.language??"en",y=Ts(()=>({annex:t.assessment.annex??void 0,exercises:t.assessment.exercises.map(x=>({id:x.id,sharedContext:x.sharedContext,questions:x.questions.map(u=>({id:u.id,version:"1.0",content:u.content,answerKeys:[]}))}))}),[t]),[w]=Ms(()=>new Date().toISOString()),v=Fn(async x=>{let u=await fetch(`${r}/api/v1/embed/submit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:e,answers:x})});if(!u.ok){let P=await u.json().catch(()=>({})),L=typeof P.error=="string"?P.error:"Submission failed",I=u.status===401?"TOKEN_INVALID":u.status===409?"TOKEN_USED":u.status===404?"ASSESSMENT_NOT_FOUND":"UNKNOWN";throw m?.({code:I,message:L}),new Error(L)}let _=await u.json();return g?.(_),Ps(_,o)},[r,e,g,m,o]),k=Fn(x=>{if(o)try{let u=new URL(o);u.searchParams.set("submission_id",x.submissionId),x.awaitingManualGrading||(u.searchParams.set("score",String(x.totalScore)),u.searchParams.set("max_score",String(x.maxScore))),window.location.href=u.toString()}catch{window.location.href=o}},[o]);return Es(Bn,{assessment:y,meta:{title:t.meta.title,category:t.meta.category??null},locale:h,branding:b,timeLimitMinutes:t.meta.settings.time_limit_minutes,startedAt:w,onSubmit:v,onViewReport:o?k:void 0,reportLabel:a,onBack:c,backLabel:l,overlayConfig:d,mediaHandler:f})}import $s from"react";import{createRoot as js}from"react-dom/client";import Is,{useMemo as Ls}from"react";import{jsx as yr}from"react/jsx-runtime";var On=Is.memo(function({content:t,onAnswersChange:r,feedback:n,initialAnswers:i,className:s,dir:o}){let a=Ls(()=>{if(n)return new Map(Object.entries(n))},[n]),l=yr(Ge,{content:t,onAnswersChange:r,initialAnswers:i,validationFeedback:a,className:s});return yr("div",{className:"edpire-scope",style:{display:"contents"},children:o?yr("div",{dir:o,children:l}):l})});function Bs(e){let{container:t,content:r,onAnswersChange:n,feedback:i,initialAnswers:s,dir:o}=e,a=typeof t=="string"?document.querySelector(t):t;if(!a)throw new Error(`EdpireSDK.renderQuestion: container not found: ${String(t)}`);let l={content:r,onAnswersChange:n,feedback:i,initialAnswers:s,dir:o},c=js(a);function d(){c.render($s.createElement(On,l))}return d(),{setContent(f){l={...l,content:f,feedback:null},d()},setFeedback(f){l={...l,feedback:f},d()},setInitialAnswers(f){l={...l,initialAnswers:f},d()},unmount(){c.unmount()}}}function Fs(e){let t=[],r=0;for(let n of e.exercises)for(let i of n.questions)t.push({exerciseId:n.id,questionId:i.id,content:i.content_ast,points:i.points,sequenceNumber:i.sequence_number,index:r++});return t}function Ds(e){let t=new Map;for(let r of e)t.has(r.exerciseId)||t.set(r.exerciseId,[]),t.get(r.exerciseId).push({questionId:r.questionId,answers:r.answers});return{exerciseAnswers:Array.from(t.entries()).map(([r,n])=>({exerciseId:r,questionAnswers:n}))}}var Xs="https://edpire.com",pf={mount(e){let{token:t,container:r,baseUrl:n=Xs,onError:i}=e,s=typeof r=="string"?document.querySelector(r):r;if(!s){let c={code:"UNKNOWN",message:`Container not found: ${r}`};return i?.(c),{unmount:()=>{}}}let o=null,a=!1;function l(){if(a)return;a=!0;let c=o;o=null,setTimeout(()=>{c?.unmount()},0)}return(async()=>{s.innerHTML='<div style="padding:32px;text-align:center;color:#6b7280;font-family:sans-serif">Loading assessment\u2026</div>';let c;try{let d=await fetch(`${n}/api/v1/embed/assessments?token=${encodeURIComponent(t)}`,{method:"GET",headers:{"Content-Type":"application/json"}});if(!d.ok){let f=await d.json().catch(()=>({})),g=typeof f.error=="string"?f.error:"Failed to load assessment",m=d.status===401?"TOKEN_INVALID":d.status===403?"ORIGIN_NOT_ALLOWED":d.status===404?"ASSESSMENT_NOT_FOUND":"UNKNOWN";i?.({code:m,message:g}),s.innerHTML=`<div style="padding:32px;text-align:center;color:#dc2626;font-family:sans-serif">${g}</div>`;return}c=await d.json()}catch{i?.({code:"NETWORK_ERROR",message:"Failed to connect to Edpire"}),s.innerHTML='<div style="padding:32px;text-align:center;color:#dc2626;font-family:sans-serif">Failed to connect to Edpire. Please try again.</div>';return}a||(s.innerHTML="",o=Ks(s),o.render(Os.createElement(Dn,{token:t,data:c,baseUrl:n,options:e})))})(),{unmount:l}}};export{pf as EdpireAssessment,Ds as buildSubmitPayload,Fs as flattenAssessment,Bs as renderQuestion};
|
package/dist/react.mjs
CHANGED
|
@@ -64,4 +64,4 @@ sys.stdin = io.StringIO(${JSON.stringify(o)})
|
|
|
64
64
|
50% { height: 40px; }
|
|
65
65
|
}
|
|
66
66
|
`}),fe("div",{style:{background:t},className:`${l?"absolute":"fixed"} inset-0 z-[60] flex items-center justify-center`,children:br("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 fe("img",{src:o,alt:"",className:"w-24 h-24 object-contain"});switch(s){case"dots":return fe(ms,{accent:r});case"pulse":return fe(us,{accent:r});case"bars":return fe(hs,{accent:r});default:return fe(fs,{accent:r})}})(),fe("p",{className:"text-sm font-semibold text-slate-800",children:n}),a&&fe("p",{className:"text-xs text-slate-500 leading-snug",children:i})]})})]}):null}import{useState as xs}from"react";import{BookOpen as kn,X as bs}from"lucide-react";import{jsx as ee,jsxs as Ie}from"react/jsx-runtime";function zn({assessment:e,isSubmitted:t,setAnswers:r,validationFeedback:n,renderExercise:i,renderSeparator:s,primaryColor:o,contained:a=!1,locale:l,t:c}){let[d,f]=xs(!1),g=e.annex,m=g.tabLabel??c("annexDocuments");return Ie("div",{className:se("@container flex-1 min-h-0 flex",a&&"relative"),children:[Ie("div",{className:"hidden @6xl:flex flex-1 gap-4 p-4 bg-[#f5f4f1] items-start overflow-y-auto",children:[Ie("div",{className:"flex-1 sticky top-4 max-h-[calc(100svh-6rem)] flex flex-col bg-white rounded-[14px] border border-[#e7e5e0] shadow-sm overflow-hidden",children:[Ie("div",{className:"flex items-center gap-2 px-5 py-3 border-b border-[#e7e5e0] flex-shrink-0",children:[ee(kn,{size:14,className:"text-[#8d93a0]"}),ee("span",{className:"text-xs font-bold text-[#565b66] uppercase tracking-widest",children:m})]}),ee("div",{className:"flex-1 overflow-y-auto px-6 py-5 flex flex-col gap-6",children:g.items.map(x=>ee(Qe,{item:x},x.id))})]}),ee("div",{className:"w-px bg-[#e7e5e0] flex-shrink-0 self-stretch my-1 rounded-full"}),ee("div",{className:"flex-1 bg-white rounded-[14px] border border-[#e7e5e0] shadow-sm",children:ee("div",{className:"px-6 py-5 flex flex-col gap-4",children:ee(Ne,{assessment:e,onAnswersChange:t?void 0:r,validationFeedback:n,renderExercise:i,renderSeparator:s,locale:l})})})]}),Ie("div",{className:"@6xl:hidden flex-1 relative overflow-hidden",children:[ee("div",{className:"absolute inset-0 overflow-y-auto",children:ee("div",{className:"max-w-3xl mx-auto px-5 py-5 flex flex-col gap-4",children:ee(Ne,{assessment:e,onAnswersChange:t?void 0:r,validationFeedback:n,renderExercise:i,renderSeparator:s,locale:l})})}),d&&ee("div",{className:se("inset-0 z-30 bg-black/25",a?"absolute":"fixed"),onClick:()=>f(!1)}),Ie("div",{className:se("top-1/2 left-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",a?"absolute":"fixed",d?"translate-x-0":"-translate-x-[110%]"),children:[Ie("div",{className:"flex items-center justify-between px-5 py-3 flex-shrink-0",children:[ee("span",{className:"text-sm font-bold text-[#1d2025]",children:m}),ee("button",{onClick:()=>f(!1),className:"p-1 text-[#8d93a0] hover:text-[#1d2025] rounded-lg transition-colors",children:ee(bs,{size:18})})]}),ee("div",{className:"overflow-y-auto max-h-[calc(100vh-8rem)] px-5 pb-5 flex flex-col gap-5",children:g.items.map(x=>ee(Qe,{item:x},x.id))})]})]}),!d&&Ie("button",{onClick:()=>f(!0),style:{transform:"translateY(-50%)",...o?{backgroundColor:o}:{}},className:se("@6xl:hidden top-1/2 left-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",a?"absolute":"fixed"),children:[ee(kn,{size:12}),ee("span",{style:{writingMode:"vertical-rl",transform:"rotate(180deg)"},children:m})]})]})}import{useState as ys}from"react";import{BookOpen as Rn,Plus as ws,X as vs}from"lucide-react";import{jsx as te,jsxs as Be}from"react/jsx-runtime";function Sn({assessment:e,isSubmitted:t,setAnswers:r,validationFeedback:n,renderExercise:i,renderSeparator:s,primaryColor:o,contained:a=!1,locale:l,t:c,onAddAnnex:d}){let[f,g]=ys(!1),m=te(Ne,{assessment:e,onAnswersChange:t?void 0:r,validationFeedback:n,renderExercise:i,renderSeparator:s,locale:l});if(f)return te("div",{className:"flex-1 overflow-y-auto",children:te("div",{className:"max-w-3xl mx-auto p-6 flex flex-col gap-4",children:m})});let x=w=>{(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),d())},u=w=>Be("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",w?"px-3 py-1.5 text-xs":"mt-1 px-3.5 py-2 text-xs"),children:[te(ws,{size:13}),c("annexEmptyCta")]}),y=w=>te("button",{type:"button",onClick:v=>{v.stopPropagation(),g(!0)},"aria-label":c("annexEmptyDismiss"),title:c("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",w&&"absolute top-2 end-2 z-10"),children:te(vs,{size:15})});return Be("div",{className:se("@container flex-1 min-h-0 flex",a&&"relative"),children:[Be("div",{className:"hidden @6xl:flex flex-1 gap-4 p-4 bg-[#f5f4f1] items-start overflow-y-auto",children:[te("div",{className:"flex-1 sticky top-4 flex min-h-[200px] max-h-[calc(100svh-6rem)]",children:Be("div",{role:"button",tabIndex:0,onClick:d,onKeyDown:x,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:[y(!0),te("span",{className:"flex items-center justify-center w-11 h-11 rounded-full bg-[#f1efe9] text-[#8d93a0] group-hover:text-[#1d2025] transition-colors",children:te(Rn,{size:20})}),te("span",{className:"text-sm font-bold text-[#565b66]",children:c("annexEmptyTitle")}),te("span",{className:"text-xs text-[#8d93a0] max-w-[32ch] leading-relaxed",children:c("annexEmptyBody")}),u(!1)]})}),te("div",{className:"w-px bg-[#e7e5e0] flex-shrink-0 self-stretch my-1 rounded-full"}),te("div",{className:"flex-1 bg-white rounded-[14px] border border-[#e7e5e0] shadow-sm",children:te("div",{className:"px-6 py-5 flex flex-col gap-4",children:m})})]}),te("div",{className:"@6xl:hidden flex-1 overflow-y-auto",children:Be("div",{className:"max-w-3xl mx-auto px-5 py-5 flex flex-col gap-4",children:[Be("div",{role:"button",tabIndex:0,onClick:d,onKeyDown:x,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:[te("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:te(Rn,{size:16})}),Be("div",{className:"flex-1 min-w-0",children:[te("div",{className:"text-xs font-bold text-[#565b66]",children:c("annexEmptyTitle")}),te("div",{className:"text-[11px] text-[#8d93a0] leading-snug",children:c("annexEmptyBody")})]}),u(!0),y(!1)]}),m]})})]})}function _n(e){let t=new Map;for(let r of e){let n=new Map;for(let i of r.questions){let s=new Map;for(let o of i.nodeResults){let a={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"?a.correctChoiceIds=o.detail.correctChoiceIds:o.detail?.type==="matchingSet"&&(a.pairFeedback=o.detail.pairFeedback,a.correctPairings=o.detail.correctPairings),s.set(o.nodeId,a)}n.set(i.questionId,s)}t.set(r.exerciseId,n)}return t}var ks={exercise:"Exercise {index}",question:"Question {index}",points:"pts",submit:"Submit Assessment",submitting:"Submitting...",confirmTitle:"Submit Assessment",confirmDescription:"Are you sure you want to submit? You cannot change your answers after submitting.",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.",pendingReview:"Pending review",viewFullReport:"View Full Report",poweredBy:"Powered by Edpire",evaluating:"Evaluating your answers\u2026",aiEvaluating:"Some answers are being reviewed by AI \u2014 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"},zs={exercise:"Exercice {index}",question:"Question {index}",points:"pts",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.",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.",pendingReview:"En attente de correction",viewFullReport:"Voir le rapport complet",poweredBy:"Propuls\xE9 par Edpire",evaluating:"\xC9valuation de vos r\xE9ponses\u2026",aiEvaluating:"Certaines r\xE9ponses sont examin\xE9es par l'IA \u2014 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"},Rs={exercise:"\u062A\u0645\u0631\u064A\u0646 {index}",question:"\u0633\u0624\u0627\u0644 {index}",points:"\u0646\u0642\u0637\u0629",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.",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.",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",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 \u2014 \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"},yr={en:ks,fr:zs,ar:Rs};function Ss(e,t,r){let i=(yr[e]??yr.en)[t]??yr.en[t]??t;return r?Object.entries(r).reduce((s,[o,a])=>s.replace(`{${o}}`,String(a)),i):i}function Nn(e){return(t,r)=>Ss(e,t,r)}function Cn(e){return e==="ar"}function Ot(e){return e==="en"?"en":"fr"}Ce(`.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:280px;max-width:480px;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:12px 20px;border-bottom:1px solid #f3f4f6;background:#f9fafb}.edpire-annex-panel__header-label{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.08em;color:#6b7280}.edpire-annex-panel__scroll{flex:1;overflow-y:auto;padding:24px 20px;display:flex;flex-direction:column;gap:32px}.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:8px;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 10px 10px 0;padding:18px 10px;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:11px;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,440px);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:16px 20px;border-bottom:1px solid #f3f4f6;background:#f9fafb;flex-shrink:0}.edpire-annex-drawer__label{font-size:13px;font-weight:700;color:#111827}.edpire-annex-drawer__close{display:flex;align-items:center;justify-content:center;width:28px;height:28px;background:none;border:none;cursor:pointer;font-size:20px;line-height:1;color:#9ca3af;border-radius:6px;transition:color .15s,background .15s}.edpire-annex-drawer__close:hover{color:#111827;background:#f3f4f6}.edpire-annex-drawer__scroll{flex:1;overflow-y:auto;padding:24px 20px;display:flex;flex-direction:column;gap:32px}.edpire-annex-backdrop{display:block;position:fixed;inset:0;background:#00000061;z-index:45;cursor:pointer}}
|
|
67
|
-
`);import{Fragment as $n,jsx as A,jsxs as D}from"react/jsx-runtime";var As="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 Ts(e){for(let t of e.exercises)for(let r of t.questions)if((r.content.content??[]).some(i=>i.type==="aiAnswerInput"))return!0;return!1}function Fn(e){let t=e;return typeof t.totalMaxScore=="number"?t.totalMaxScore:(t.answerKeys??[]).reduce((r,n)=>r+(n.scoring?.maxScore??0),0)}function Ln(e){return e.questions.reduce((t,r)=>t+Fn(r),0)}function Ae(e){return Number.isInteger(e)?String(e):parseFloat(e.toFixed(2)).toString()}function Dn(e){return e==="full"?"#1f8a4c":e==="partial"?"#c8810e":"#d23b2b"}function Ps({outcome:e}){let t=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 A("svg",{width:14,height:14,viewBox:"0 0 100 100",fill:"none",stroke:Dn(e),strokeWidth:9,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:A("path",{d:t})})}function Es({score:e,weight:t,t:r}){if(e){if(e.awaiting)return D("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:[A(st,{size:11}),r("pendingReview")]});let n=e.m>0&&e.s>=e.m?"full":e.s>0?"partial":"none";return D("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:[A(Ps,{outcome:n}),D("span",{className:"font-bold leading-none",style:{fontFamily:'var(--font-hand, "Caveat", cursive)',fontSize:"1.05rem",color:Dn(n)},children:[Ae(e.s)," / ",Ae(e.m)]})]})}return t>0?D("span",{className:"text-xs font-semibold tabular-nums text-[#8d93a0]",children:[Ae(t)," ",r("points")]}):null}function Ms({timeLimitMinutes:e,startedAt:t,onExpire:r}){let n=e*6e4,i=new Date(t).getTime()+n,[s,o]=Fe(()=>Math.max(i-Date.now(),0)),a=Bn(r);a.current=r,jn(()=>{if(s<=0){a.current();return}let u=setInterval(()=>{let y=Math.max(i-Date.now(),0);o(y),y<=0&&(clearInterval(u),a.current())},1e3);return()=>clearInterval(u)},[i]);let l=s/n,c=l<.1?"bg-[#fdeeec] text-[#a32b1e] border-[#f6cfc9] animate-pulse":l<.25?"bg-[#fbf1dc] text-[#8a5a08] border-[#f2e2bf]":"bg-[#f5f4f1] text-[#565b66] border-[#e7e5e0]",d=Math.ceil(s/1e3),f=Math.floor(d/3600),g=Math.floor(d%3600/60),m=d%60,x=f>0?`${f}:${String(g).padStart(2,"0")}:${String(m).padStart(2,"0")}`:`${g}:${String(m).padStart(2,"0")}`;return D("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",c),children:[A(st,{size:12}),x]})}function wr({assessment:e,meta:t,locale:r="en",branding:n,timeLimitMinutes:i,startedAt:s,onSubmit:o,onViewReport:a,reportLabel:l,onBack:c,backLabel:d,allowReset:f,onReset:g,overlayConfig:m,contained:x=!1,onClose:u,mediaHandler:y,onAddAnnex:w,fallbackLogoUrl:v}){let k=Ye(()=>Nn(r),[r]),b=Cn(r)?"rtl":"ltr",h=n?.branding?.primaryColor,_=n?.branding?.accentColor,E=n?.branding?.fontFamily,L=n?.branding?.fontUrl,I=n?.branding?.showPoweredBy!==!1;jn(()=>{if(!L||typeof document>"u"||document.querySelector(`link[href="${L}"]`))return;let me=document.createElement("link");me.rel="stylesheet",me.href=L,document.head.appendChild(me)},[L]);let[p,T]=Fe({exerciseAnswers:[]}),[N,W]=Fe(!1),[R,M]=Fe(!1),[P,$]=Fe(null),[O,G]=Fe(null),[we,S]=Fe(!1),C=Bn(!1),B=Ye(()=>Ts(e),[e]),K=Ye(()=>e.exercises.reduce((U,me)=>U+Ln(me),0),[e]),F=Ye(()=>P?_n(P.exerciseFeedback):void 0,[P]),ce=Ye(()=>{if(!P)return{};let U={};for(let me of P.exerciseFeedback){let Le=0,Te=0,de=!1;for(let Oe of me.questions)for(let Se of Oe.nodeResults)Le+=Se.score,Te+=Se.maxScore,Se.status==="awaiting_review"&&(de=!0);U[me.exerciseId]={score:Le,maxScore:Te,awaiting:de}}return U},[P]),J=Ye(()=>{if(!P)return{};let U={};for(let me of P.exerciseFeedback)for(let Le of me.questions){let Te=0,de=0,Oe=!1;for(let Se of Le.nodeResults)Te+=Se.score,de+=Se.maxScore,Se.status==="awaiting_review"&&(Oe=!0);U[Le.questionId]={score:Te,maxScore:de,awaiting:Oe}}return U},[P]),ae=ot(async()=>{W(!0),G(null);try{let U=await o(p);$(U),typeof window<"u"&&window.scrollTo({top:0,behavior:"smooth"})}catch(U){G(U instanceof Error?U.message:k("confirmCancel"))}finally{W(!1),M(!1)}},[p,o,k]),re=ot(()=>{!P||!a||a(P)},[P,a]),ne=ot(()=>{C.current||N||P||(C.current=!0,S(!0),M(!1),typeof document<"u"&&document.activeElement?.blur(),setTimeout(()=>{W(!0),G(null),o(p).then(U=>{$(U),typeof window<"u"&&window.scrollTo({top:0,behavior:"smooth"})}).catch(U=>{G(U instanceof Error?U.message:"submit_error")}).finally(()=>{W(!1),S(!1)})},800))},[p,N,o,P]),be=ot((U,me,Le)=>{let Te=Ln(U),de=ce[U.id],Oe=U.questions.length>1,Se=Tn(me)?An(me,{renderQuestion:(at,Kt,qn)=>{let kr=y&&Tn(Kt)?An(Kt,{mediaHandler:y}):Kt,Je=at.id;if(!Oe)return A("div",{"data-question-id":Je,children:kr},Je);let lt=J[Je],Wn=Fn(at);return D("div",{"data-question-id":Je,children:[D("div",{className:"flex items-center gap-2.5 mb-3",children:[A("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:k("question",{index:qn+1})}),A(Es,{score:lt?{s:lt.score,m:lt.maxScore,awaiting:lt.awaiting}:null,weight:Wn,t:k})]}),kr]},Je)},renderSeparator:at=>A("div",{className:"border-t border-[#e7e5e0] my-1"},`qsep-${at}`)}):me;return D("div",{"data-exercise-id":U.id,className:"bg-white rounded-[14px] border border-[#e7e5e0] shadow-sm overflow-hidden",children:[D("div",{className:"flex items-center justify-between px-4 py-2.5 bg-[#f1efe9] border-b border-[#e7e5e0]",style:_?{backgroundColor:_}:void 0,children:[A("span",{className:"text-sm font-bold text-[#1d2025]",children:k("exercise",{index:Le+1})}),de?.awaiting?D("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:[A(st,{size:11}),k("pendingReview")]}):de?D("span",{className:"font-bold leading-none tabular-nums",style:{fontFamily:'var(--font-hand, "Caveat", cursive)',fontSize:"1.15rem",color:de.maxScore>0&&de.score>=de.maxScore?"#1f8a4c":de.maxScore>0&&de.score>0?"#c8810e":de.maxScore>0?"#d23b2b":"#8d93a0"},children:[Ae(de.score)," / ",Ae(de.maxScore)]}):Te>0?D("span",{className:"text-xs font-semibold text-[#8d93a0] tabular-nums",children:["/ ",Ae(Te)," ",k("points")]}):null]}),A("div",{className:"p-4",children:Se})]},U.id)},[k,ce,J,_,y]),De=ot(U=>D("div",{className:"flex items-center gap-3 py-2",children:[A("div",{className:"flex-1 border-t border-dashed border-[#e7e5e0]"}),A("span",{className:"text-[10px] font-bold text-[#8d93a0] uppercase tracking-widest",children:k("exercise",{index:U+2})}),A("div",{className:"flex-1 border-t border-dashed border-[#e7e5e0]"})]},`sep-${U}`),[k]),he=P!==null;return A("div",{className:"edpire-scope",style:{display:"contents"},children:D("div",{dir:b,className:se("flex flex-col",x?"h-full":"h-dvh"),style:E?{fontFamily:E}:void 0,children:[A(vn,{visible:N&&!we,hasAiNodes:B,text:k("evaluating"),aiText:k("aiEvaluating"),contained:x,...m}),we&&D("div",{className:se("fixed inset-0 z-50 flex flex-col items-center justify-center gap-3 bg-red-950/80 backdrop-blur-sm",x&&"absolute"),children:[A(st,{size:40,className:"text-red-300"}),A("p",{className:"text-xl font-black text-white tracking-tight",children:k("timeUp.title")}),A("p",{className:"text-sm text-red-200",children:k("timeUp.submitting")})]}),D("div",{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:_?{backgroundColor:_}:void 0,children:[D("div",{className:"flex items-center gap-3",children:[A("img",{src:n?.logoUrl??v??As,alt:n?.name??"Edpire",width:24,height:24,loading:"lazy",className:"rounded object-contain"}),D("div",{children:[A("h1",{className:"text-sm font-bold text-[#1d2025]",children:t.title}),A("p",{className:"text-[11px] text-[#8d93a0] capitalize",children:K>0&&D("span",{className:"ms-2 font-semibold text-[#565b66]",children:["/ ",Ae(K)," ",k("points")]})})]}),!he&&i&&i>0&&s&&A(Ms,{timeLimitMinutes:i,startedAt:s,onExpire:ne})]}),D("div",{className:"flex items-center gap-2",children:[f&&D("button",{onClick:g,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:[A(Cs,{size:13}),k("reset")]}),!he&&c&&D("button",{onClick:c,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:[A(In,{size:13}),d??k("back")]}),u&&A("button",{onClick:u,className:"p-1.5 text-[#8d93a0] hover:text-[#1d2025] hover:bg-[#f1efe9] rounded-lg transition-colors",children:A(In,{size:15})}),!he&&A("button",{onClick:()=>M(!0),disabled:N,style:h?{backgroundColor:h}: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:N?D($n,{children:[A(En,{size:14,className:"animate-spin"}),k("submitting")]}):D($n,{children:[A(Pn,{size:14}),k("submit")]})})]})]}),O&&A("div",{className:"flex-shrink-0 bg-[#fdeeec] border-b border-[#f6cfc9] px-4 py-2 text-sm text-[#a32b1e]",children:O}),he&&P&&(P.awaitingManualGrading?A("div",{className:"flex-shrink-0 border-b bg-[#fbf1dc] border-[#f2e2bf]",children:A("div",{className:"max-w-3xl mx-auto px-6 py-4",children:D("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-4",children:[D("div",{className:"flex items-center gap-2",children:[A(st,{size:20,className:"text-[#c8810e] flex-shrink-0"}),A("span",{className:"text-sm font-semibold text-[#8a5a08]",children:k("awaitingReview")})]}),A("div",{className:"hidden sm:block w-px h-8 bg-[#f2e2bf]"}),A("p",{className:"text-sm text-[#8a5a08] flex-1 min-w-0",children:k("awaitingReviewDesc")}),a&&D("button",{onClick:re,style:h?{backgroundColor:h}: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:[A(Mn,{size:14}),l??k("viewFullReport")]})]})})}):A("div",{className:se("flex-shrink-0 border-b",P.passed?"bg-[#ecf8f0] border-[#c5e8d1]":"bg-[#fdeeec] border-[#f6cfc9]"),children:A("div",{className:"max-w-3xl mx-auto px-6 py-4",children:D("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-4",children:[D("div",{className:"flex items-center gap-2",children:[P.passed?A(_s,{size:20,className:"text-[#1f8a4c] flex-shrink-0"}):A(Ns,{size:20,className:"text-[#d23b2b] flex-shrink-0"}),A("span",{className:se("text-sm font-semibold",P.passed?"text-[#1f8a4c]":"text-[#d23b2b]"),children:P.passed?k("assessmentPassed"):k("assessmentNotPassed")})]}),A("div",{className:"hidden sm:block w-px h-8 bg-[#e7e5e0]"}),D("div",{className:"flex items-baseline gap-1.5",children:[D("span",{className:"leading-none tabular-nums",style:{fontFamily:'var(--font-hand, "Caveat", cursive)',fontSize:"2rem",color:P.passed?"#1f8a4c":"#d23b2b"},children:[Ae(P.totalScore)," / ",Ae(P.maxScore)]}),A("span",{className:"text-sm text-[#8d93a0] font-medium",children:k("points")})]}),D("div",{className:"flex-1 flex items-center gap-3 min-w-0",children:[A("div",{className:"flex-1 h-2 bg-[#e7e5e0] rounded-full overflow-hidden min-w-[80px]",children:A("div",{className:se("h-full rounded-full transition-all duration-700",P.passed?"bg-[#1f8a4c]":"bg-[#d23b2b]"),style:{width:`${P.percentage}%`}})}),D("span",{className:se("text-sm font-bold tabular-nums flex-shrink-0",P.passed?"text-[#1f8a4c]":"text-[#d23b2b]"),children:[P.percentage,"%"]})]}),a&&D("button",{onClick:re,style:h?{backgroundColor:h}: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:[A(Mn,{size:14}),l??k("viewFullReport")]})]})})})),A("div",{className:se("flex-1 overflow-hidden flex flex-col",we&&"pointer-events-none opacity-60"),children:e.annex?A(zn,{assessment:e,isSubmitted:he,setAnswers:T,validationFeedback:F,renderExercise:be,renderSeparator:De,primaryColor:h,contained:x,locale:Ot(r),t:k}):w?A(Sn,{assessment:e,isSubmitted:he,setAnswers:T,validationFeedback:F,renderExercise:be,renderSeparator:De,primaryColor:h,contained:x,locale:Ot(r),t:k,onAddAnnex:w}):A("div",{className:"flex-1 overflow-y-auto",children:A("div",{className:"max-w-3xl mx-auto p-6 flex flex-col gap-4",children:A(Ne,{assessment:e,onAnswersChange:he?void 0:T,validationFeedback:F,renderExercise:be,renderSeparator:De,locale:Ot(r)})})})}),I&&A("div",{className:"fixed bottom-2 end-3 text-[20px] text-black/20 pointer-events-none select-none z-10",children:k("poweredBy")}),R&&A("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",children:D("div",{className:"bg-white rounded-[14px] shadow-xl p-6 max-w-sm mx-4",children:[A("h3",{className:"text-base font-bold text-[#1d2025] mb-2",children:k("confirmTitle")}),A("p",{className:"text-sm text-[#565b66] mb-5",children:k("confirmDescription")}),D("div",{className:"flex gap-3 justify-end",children:[A("button",{onClick:()=>M(!1),className:"px-4 py-2 text-sm font-medium text-[#565b66] hover:bg-[#f1efe9] rounded-lg transition-colors",children:k("confirmCancel")}),D("button",{onClick:ae,disabled:N,style:h?{backgroundColor:h}: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:[N?A(En,{size:14,className:"animate-spin"}):A(Pn,{size:14}),k("confirmSubmit")]})]})]})})]})})}import{jsx as js}from"react/jsx-runtime";function $s(e,t){let r=(e.exercise_feedback??[]).map(n=>({exerciseId:n.exercise_id,questions:n.questions.map(i=>({questionId:i.question_id,nodeResults:i.node_results.map(s=>({nodeId:s.node_id,status:s.status,score:s.score,maxScore:s.max_score,...s.feedback!==void 0?{feedback:s.feedback}:{},...s.display_answer!==void 0?{displayAnswer:s.display_answer}:{},...s.detail!==void 0?{detail:s.detail}:{}}))}))}));return{submissionId:e.submission_id,totalScore:e.score,maxScore:e.max_score,percentage:e.percentage,passed:e.passed,returnUrl:t??null,exerciseFeedback:r,awaitingManualGrading:e.awaiting_manual_grading??!1}}function Kn({token:e,data:t,baseUrl:r,options:n}){let{locale:i,branding:s,returnUrl:o,reportLabel:a,backLabel:l,onBack:c,overlayConfig:d,mediaHandler:f,onComplete:g,onError:m}=n,x=s??t.branding??void 0,u=i??t.meta.language??"en",y=Is(()=>({exercises:t.assessment.exercises.map(b=>({id:b.id,sharedContext:b.sharedContext,questions:b.questions.map(h=>({id:h.id,version:"1.0",content:h.content,answerKeys:[]}))}))}),[t]),[w]=Ls(()=>new Date().toISOString()),v=On(async b=>{let h=await fetch(`${r}/api/v1/embed/submit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:e,answers:b})});if(!h.ok){let E=await h.json().catch(()=>({})),L=typeof E.error=="string"?E.error:"Submission failed",I=h.status===401?"TOKEN_INVALID":h.status===409?"TOKEN_USED":h.status===404?"ASSESSMENT_NOT_FOUND":"UNKNOWN";throw m?.({code:I,message:L}),new Error(L)}let _=await h.json();return g?.(_),$s(_,o)},[r,e,g,m,o]),k=On(b=>{if(o)try{let h=new URL(o);h.searchParams.set("submission_id",b.submissionId),b.awaitingManualGrading||(h.searchParams.set("score",String(b.totalScore)),h.searchParams.set("max_score",String(b.maxScore))),window.location.href=h.toString()}catch{window.location.href=o}},[o]);return js(wr,{assessment:y,meta:{title:t.meta.title,category:t.meta.category??null},locale:u,branding:x,timeLimitMinutes:t.meta.settings.time_limit_minutes,startedAt:w,onSubmit:v,onViewReport:o?k:void 0,reportLabel:a,onBack:c,backLabel:l,overlayConfig:d,mediaHandler:f})}import rf from"react";import{createRoot as of}from"react-dom/client";var Ds="https://edpire.com",Xn={mount(e){let{token:t,container:r,baseUrl:n=Ds,onError:i}=e,s=typeof r=="string"?document.querySelector(r):r;if(!s){let c={code:"UNKNOWN",message:`Container not found: ${r}`};return i?.(c),{unmount:()=>{}}}let o=null,a=!1;function l(){if(a)return;a=!0;let c=o;o=null,setTimeout(()=>{c?.unmount()},0)}return(async()=>{s.innerHTML='<div style="padding:32px;text-align:center;color:#6b7280;font-family:sans-serif">Loading assessment\u2026</div>';let c;try{let d=await fetch(`${n}/api/v1/embed/assessments?token=${encodeURIComponent(t)}`,{method:"GET",headers:{"Content-Type":"application/json"}});if(!d.ok){let f=await d.json().catch(()=>({})),g=typeof f.error=="string"?f.error:"Failed to load assessment",m=d.status===401?"TOKEN_INVALID":d.status===403?"ORIGIN_NOT_ALLOWED":d.status===404?"ASSESSMENT_NOT_FOUND":"UNKNOWN";i?.({code:m,message:g}),s.innerHTML=`<div style="padding:32px;text-align:center;color:#dc2626;font-family:sans-serif">${g}</div>`;return}c=await d.json()}catch{i?.({code:"NETWORK_ERROR",message:"Failed to connect to Edpire"}),s.innerHTML='<div style="padding:32px;text-align:center;color:#dc2626;font-family:sans-serif">Failed to connect to Edpire. Please try again.</div>';return}a||(s.innerHTML="",o=Fs(s),o.render(Bs.createElement(Kn,{token:t,data:c,baseUrl:n,options:e})))})(),{unmount:l}}};import{jsx as Xs}from"react/jsx-runtime";function Ks({tokenEndpoint:e,assessmentId:t,tokenBody:r,className:n,style:i,onComplete:s,onError:o,...a}){let l=vr(null),c=vr(s);c.current=s;let d=vr(o);return d.current=o,Os(()=>{let f=l.current;if(!f)return;let g=!1,m=null;return(async()=>{let x;try{let u=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({assessmentId:t,...r})});if(g)return;if(!u.ok){let w=await u.json().catch(()=>({}));d.current?.({code:"TOKEN_INVALID",message:typeof w.error=="string"?w.error:`Token endpoint returned ${u.status}`});return}let y=await u.json();if(!y.token){d.current?.({code:"TOKEN_INVALID",message:"Token endpoint did not return a token"});return}x=y.token}catch{g||d.current?.({code:"NETWORK_ERROR",message:"Failed to fetch embed token"});return}g||(m=Xn.mount({token:x,container:f,...a,onComplete:u=>c.current?.(u),onError:u=>d.current?.(u)}))})(),()=>{g=!0,m?.unmount()}},[e,t]),Xs("div",{ref:l,className:n,style:n?void 0:i??{width:"100%",height:"100%"}})}export{wr as AssessmentShell,Ks as EdpireAssessmentPlayer,wn as EdpireQuestion};
|
|
67
|
+
`);import{Fragment as $n,jsx as A,jsxs as D}from"react/jsx-runtime";var As="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 Ts(e){for(let t of e.exercises)for(let r of t.questions)if((r.content.content??[]).some(i=>i.type==="aiAnswerInput"))return!0;return!1}function Fn(e){let t=e;return typeof t.totalMaxScore=="number"?t.totalMaxScore:(t.answerKeys??[]).reduce((r,n)=>r+(n.scoring?.maxScore??0),0)}function Ln(e){return e.questions.reduce((t,r)=>t+Fn(r),0)}function Ae(e){return Number.isInteger(e)?String(e):parseFloat(e.toFixed(2)).toString()}function Dn(e){return e==="full"?"#1f8a4c":e==="partial"?"#c8810e":"#d23b2b"}function Ps({outcome:e}){let t=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 A("svg",{width:14,height:14,viewBox:"0 0 100 100",fill:"none",stroke:Dn(e),strokeWidth:9,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:A("path",{d:t})})}function Es({score:e,weight:t,t:r}){if(e){if(e.awaiting)return D("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:[A(st,{size:11}),r("pendingReview")]});let n=e.m>0&&e.s>=e.m?"full":e.s>0?"partial":"none";return D("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:[A(Ps,{outcome:n}),D("span",{className:"font-bold leading-none",style:{fontFamily:'var(--font-hand, "Caveat", cursive)',fontSize:"1.05rem",color:Dn(n)},children:[Ae(e.s)," / ",Ae(e.m)]})]})}return t>0?D("span",{className:"text-xs font-semibold tabular-nums text-[#8d93a0]",children:[Ae(t)," ",r("points")]}):null}function Ms({timeLimitMinutes:e,startedAt:t,onExpire:r}){let n=e*6e4,i=new Date(t).getTime()+n,[s,o]=Fe(()=>Math.max(i-Date.now(),0)),a=Bn(r);a.current=r,jn(()=>{if(s<=0){a.current();return}let u=setInterval(()=>{let y=Math.max(i-Date.now(),0);o(y),y<=0&&(clearInterval(u),a.current())},1e3);return()=>clearInterval(u)},[i]);let l=s/n,c=l<.1?"bg-[#fdeeec] text-[#a32b1e] border-[#f6cfc9] animate-pulse":l<.25?"bg-[#fbf1dc] text-[#8a5a08] border-[#f2e2bf]":"bg-[#f5f4f1] text-[#565b66] border-[#e7e5e0]",d=Math.ceil(s/1e3),f=Math.floor(d/3600),g=Math.floor(d%3600/60),m=d%60,x=f>0?`${f}:${String(g).padStart(2,"0")}:${String(m).padStart(2,"0")}`:`${g}:${String(m).padStart(2,"0")}`;return D("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",c),children:[A(st,{size:12}),x]})}function wr({assessment:e,meta:t,locale:r="en",branding:n,timeLimitMinutes:i,startedAt:s,onSubmit:o,onViewReport:a,reportLabel:l,onBack:c,backLabel:d,allowReset:f,onReset:g,overlayConfig:m,contained:x=!1,onClose:u,mediaHandler:y,onAddAnnex:w,fallbackLogoUrl:v}){let k=Ye(()=>Nn(r),[r]),b=Cn(r)?"rtl":"ltr",h=n?.branding?.primaryColor,_=n?.branding?.accentColor,E=n?.branding?.fontFamily,L=n?.branding?.fontUrl,I=n?.branding?.showPoweredBy!==!1;jn(()=>{if(!L||typeof document>"u"||document.querySelector(`link[href="${L}"]`))return;let me=document.createElement("link");me.rel="stylesheet",me.href=L,document.head.appendChild(me)},[L]);let[p,T]=Fe({exerciseAnswers:[]}),[N,W]=Fe(!1),[R,M]=Fe(!1),[P,$]=Fe(null),[O,G]=Fe(null),[we,S]=Fe(!1),C=Bn(!1),B=Ye(()=>Ts(e),[e]),K=Ye(()=>e.exercises.reduce((U,me)=>U+Ln(me),0),[e]),F=Ye(()=>P?_n(P.exerciseFeedback):void 0,[P]),ce=Ye(()=>{if(!P)return{};let U={};for(let me of P.exerciseFeedback){let Le=0,Te=0,de=!1;for(let Oe of me.questions)for(let Se of Oe.nodeResults)Le+=Se.score,Te+=Se.maxScore,Se.status==="awaiting_review"&&(de=!0);U[me.exerciseId]={score:Le,maxScore:Te,awaiting:de}}return U},[P]),J=Ye(()=>{if(!P)return{};let U={};for(let me of P.exerciseFeedback)for(let Le of me.questions){let Te=0,de=0,Oe=!1;for(let Se of Le.nodeResults)Te+=Se.score,de+=Se.maxScore,Se.status==="awaiting_review"&&(Oe=!0);U[Le.questionId]={score:Te,maxScore:de,awaiting:Oe}}return U},[P]),ae=ot(async()=>{W(!0),G(null);try{let U=await o(p);$(U),typeof window<"u"&&window.scrollTo({top:0,behavior:"smooth"})}catch(U){G(U instanceof Error?U.message:k("confirmCancel"))}finally{W(!1),M(!1)}},[p,o,k]),re=ot(()=>{!P||!a||a(P)},[P,a]),ne=ot(()=>{C.current||N||P||(C.current=!0,S(!0),M(!1),typeof document<"u"&&document.activeElement?.blur(),setTimeout(()=>{W(!0),G(null),o(p).then(U=>{$(U),typeof window<"u"&&window.scrollTo({top:0,behavior:"smooth"})}).catch(U=>{G(U instanceof Error?U.message:"submit_error")}).finally(()=>{W(!1),S(!1)})},800))},[p,N,o,P]),be=ot((U,me,Le)=>{let Te=Ln(U),de=ce[U.id],Oe=U.questions.length>1,Se=Tn(me)?An(me,{renderQuestion:(at,Kt,qn)=>{let kr=y&&Tn(Kt)?An(Kt,{mediaHandler:y}):Kt,Je=at.id;if(!Oe)return A("div",{"data-question-id":Je,children:kr},Je);let lt=J[Je],Wn=Fn(at);return D("div",{"data-question-id":Je,children:[D("div",{className:"flex items-center gap-2.5 mb-3",children:[A("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:k("question",{index:qn+1})}),A(Es,{score:lt?{s:lt.score,m:lt.maxScore,awaiting:lt.awaiting}:null,weight:Wn,t:k})]}),kr]},Je)},renderSeparator:at=>A("div",{className:"border-t border-[#e7e5e0] my-1"},`qsep-${at}`)}):me;return D("div",{"data-exercise-id":U.id,className:"bg-white rounded-[14px] border border-[#e7e5e0] shadow-sm overflow-hidden",children:[D("div",{className:"flex items-center justify-between px-4 py-2.5 bg-[#f1efe9] border-b border-[#e7e5e0]",style:_?{backgroundColor:_}:void 0,children:[A("span",{className:"text-sm font-bold text-[#1d2025]",children:k("exercise",{index:Le+1})}),de?.awaiting?D("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:[A(st,{size:11}),k("pendingReview")]}):de?D("span",{className:"font-bold leading-none tabular-nums",style:{fontFamily:'var(--font-hand, "Caveat", cursive)',fontSize:"1.15rem",color:de.maxScore>0&&de.score>=de.maxScore?"#1f8a4c":de.maxScore>0&&de.score>0?"#c8810e":de.maxScore>0?"#d23b2b":"#8d93a0"},children:[Ae(de.score)," / ",Ae(de.maxScore)]}):Te>0?D("span",{className:"text-xs font-semibold text-[#8d93a0] tabular-nums",children:["/ ",Ae(Te)," ",k("points")]}):null]}),A("div",{className:"p-4",children:Se})]},U.id)},[k,ce,J,_,y]),De=ot(U=>D("div",{className:"flex items-center gap-3 py-2",children:[A("div",{className:"flex-1 border-t border-dashed border-[#e7e5e0]"}),A("span",{className:"text-[10px] font-bold text-[#8d93a0] uppercase tracking-widest",children:k("exercise",{index:U+2})}),A("div",{className:"flex-1 border-t border-dashed border-[#e7e5e0]"})]},`sep-${U}`),[k]),he=P!==null;return A("div",{className:"edpire-scope",style:{display:"contents"},children:D("div",{dir:b,className:se("flex flex-col",x?"h-full":"h-dvh"),style:E?{fontFamily:E}:void 0,children:[A(vn,{visible:N&&!we,hasAiNodes:B,text:k("evaluating"),aiText:k("aiEvaluating"),contained:x,...m}),we&&D("div",{className:se("fixed inset-0 z-50 flex flex-col items-center justify-center gap-3 bg-red-950/80 backdrop-blur-sm",x&&"absolute"),children:[A(st,{size:40,className:"text-red-300"}),A("p",{className:"text-xl font-black text-white tracking-tight",children:k("timeUp.title")}),A("p",{className:"text-sm text-red-200",children:k("timeUp.submitting")})]}),D("div",{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:_?{backgroundColor:_}:void 0,children:[D("div",{className:"flex items-center gap-3",children:[A("img",{src:n?.logoUrl??v??As,alt:n?.name??"Edpire",width:24,height:24,loading:"lazy",className:"rounded object-contain"}),D("div",{children:[A("h1",{className:"text-sm font-bold text-[#1d2025]",children:t.title}),A("p",{className:"text-[11px] text-[#8d93a0] capitalize",children:K>0&&D("span",{className:"ms-2 font-semibold text-[#565b66]",children:["/ ",Ae(K)," ",k("points")]})})]}),!he&&i&&i>0&&s&&A(Ms,{timeLimitMinutes:i,startedAt:s,onExpire:ne})]}),D("div",{className:"flex items-center gap-2",children:[f&&D("button",{onClick:g,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:[A(Cs,{size:13}),k("reset")]}),!he&&c&&D("button",{onClick:c,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:[A(In,{size:13}),d??k("back")]}),u&&A("button",{onClick:u,className:"p-1.5 text-[#8d93a0] hover:text-[#1d2025] hover:bg-[#f1efe9] rounded-lg transition-colors",children:A(In,{size:15})}),!he&&A("button",{onClick:()=>M(!0),disabled:N,style:h?{backgroundColor:h}: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:N?D($n,{children:[A(En,{size:14,className:"animate-spin"}),k("submitting")]}):D($n,{children:[A(Pn,{size:14}),k("submit")]})})]})]}),O&&A("div",{className:"flex-shrink-0 bg-[#fdeeec] border-b border-[#f6cfc9] px-4 py-2 text-sm text-[#a32b1e]",children:O}),he&&P&&(P.awaitingManualGrading?A("div",{className:"flex-shrink-0 border-b bg-[#fbf1dc] border-[#f2e2bf]",children:A("div",{className:"max-w-3xl mx-auto px-6 py-4",children:D("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-4",children:[D("div",{className:"flex items-center gap-2",children:[A(st,{size:20,className:"text-[#c8810e] flex-shrink-0"}),A("span",{className:"text-sm font-semibold text-[#8a5a08]",children:k("awaitingReview")})]}),A("div",{className:"hidden sm:block w-px h-8 bg-[#f2e2bf]"}),A("p",{className:"text-sm text-[#8a5a08] flex-1 min-w-0",children:k("awaitingReviewDesc")}),a&&D("button",{onClick:re,style:h?{backgroundColor:h}: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:[A(Mn,{size:14}),l??k("viewFullReport")]})]})})}):A("div",{className:se("flex-shrink-0 border-b",P.passed?"bg-[#ecf8f0] border-[#c5e8d1]":"bg-[#fdeeec] border-[#f6cfc9]"),children:A("div",{className:"max-w-3xl mx-auto px-6 py-4",children:D("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-4",children:[D("div",{className:"flex items-center gap-2",children:[P.passed?A(_s,{size:20,className:"text-[#1f8a4c] flex-shrink-0"}):A(Ns,{size:20,className:"text-[#d23b2b] flex-shrink-0"}),A("span",{className:se("text-sm font-semibold",P.passed?"text-[#1f8a4c]":"text-[#d23b2b]"),children:P.passed?k("assessmentPassed"):k("assessmentNotPassed")})]}),A("div",{className:"hidden sm:block w-px h-8 bg-[#e7e5e0]"}),D("div",{className:"flex items-baseline gap-1.5",children:[D("span",{className:"leading-none tabular-nums",style:{fontFamily:'var(--font-hand, "Caveat", cursive)',fontSize:"2rem",color:P.passed?"#1f8a4c":"#d23b2b"},children:[Ae(P.totalScore)," / ",Ae(P.maxScore)]}),A("span",{className:"text-sm text-[#8d93a0] font-medium",children:k("points")})]}),D("div",{className:"flex-1 flex items-center gap-3 min-w-0",children:[A("div",{className:"flex-1 h-2 bg-[#e7e5e0] rounded-full overflow-hidden min-w-[80px]",children:A("div",{className:se("h-full rounded-full transition-all duration-700",P.passed?"bg-[#1f8a4c]":"bg-[#d23b2b]"),style:{width:`${P.percentage}%`}})}),D("span",{className:se("text-sm font-bold tabular-nums flex-shrink-0",P.passed?"text-[#1f8a4c]":"text-[#d23b2b]"),children:[P.percentage,"%"]})]}),a&&D("button",{onClick:re,style:h?{backgroundColor:h}: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:[A(Mn,{size:14}),l??k("viewFullReport")]})]})})})),A("div",{className:se("flex-1 overflow-hidden flex flex-col",we&&"pointer-events-none opacity-60"),children:e.annex?A(zn,{assessment:e,isSubmitted:he,setAnswers:T,validationFeedback:F,renderExercise:be,renderSeparator:De,primaryColor:h,contained:x,locale:Ot(r),t:k}):w?A(Sn,{assessment:e,isSubmitted:he,setAnswers:T,validationFeedback:F,renderExercise:be,renderSeparator:De,primaryColor:h,contained:x,locale:Ot(r),t:k,onAddAnnex:w}):A("div",{className:"flex-1 overflow-y-auto",children:A("div",{className:"max-w-3xl mx-auto p-6 flex flex-col gap-4",children:A(Ne,{assessment:e,onAnswersChange:he?void 0:T,validationFeedback:F,renderExercise:be,renderSeparator:De,locale:Ot(r)})})})}),I&&A("div",{className:"fixed bottom-2 end-3 text-[20px] text-black/20 pointer-events-none select-none z-10",children:k("poweredBy")}),R&&A("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",children:D("div",{className:"bg-white rounded-[14px] shadow-xl p-6 max-w-sm mx-4",children:[A("h3",{className:"text-base font-bold text-[#1d2025] mb-2",children:k("confirmTitle")}),A("p",{className:"text-sm text-[#565b66] mb-5",children:k("confirmDescription")}),D("div",{className:"flex gap-3 justify-end",children:[A("button",{onClick:()=>M(!1),className:"px-4 py-2 text-sm font-medium text-[#565b66] hover:bg-[#f1efe9] rounded-lg transition-colors",children:k("confirmCancel")}),D("button",{onClick:ae,disabled:N,style:h?{backgroundColor:h}: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:[N?A(En,{size:14,className:"animate-spin"}):A(Pn,{size:14}),k("confirmSubmit")]})]})]})})]})})}import{jsx as js}from"react/jsx-runtime";function $s(e,t){let r=(e.exercise_feedback??[]).map(n=>({exerciseId:n.exercise_id,questions:n.questions.map(i=>({questionId:i.question_id,nodeResults:i.node_results.map(s=>({nodeId:s.node_id,status:s.status,score:s.score,maxScore:s.max_score,...s.feedback!==void 0?{feedback:s.feedback}:{},...s.display_answer!==void 0?{displayAnswer:s.display_answer}:{},...s.detail!==void 0?{detail:s.detail}:{}}))}))}));return{submissionId:e.submission_id,totalScore:e.score,maxScore:e.max_score,percentage:e.percentage,passed:e.passed,returnUrl:t??null,exerciseFeedback:r,awaitingManualGrading:e.awaiting_manual_grading??!1}}function Kn({token:e,data:t,baseUrl:r,options:n}){let{locale:i,branding:s,returnUrl:o,reportLabel:a,backLabel:l,onBack:c,overlayConfig:d,mediaHandler:f,onComplete:g,onError:m}=n,x=s??t.branding??void 0,u=i??t.meta.language??"en",y=Is(()=>({annex:t.assessment.annex??void 0,exercises:t.assessment.exercises.map(b=>({id:b.id,sharedContext:b.sharedContext,questions:b.questions.map(h=>({id:h.id,version:"1.0",content:h.content,answerKeys:[]}))}))}),[t]),[w]=Ls(()=>new Date().toISOString()),v=On(async b=>{let h=await fetch(`${r}/api/v1/embed/submit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:e,answers:b})});if(!h.ok){let E=await h.json().catch(()=>({})),L=typeof E.error=="string"?E.error:"Submission failed",I=h.status===401?"TOKEN_INVALID":h.status===409?"TOKEN_USED":h.status===404?"ASSESSMENT_NOT_FOUND":"UNKNOWN";throw m?.({code:I,message:L}),new Error(L)}let _=await h.json();return g?.(_),$s(_,o)},[r,e,g,m,o]),k=On(b=>{if(o)try{let h=new URL(o);h.searchParams.set("submission_id",b.submissionId),b.awaitingManualGrading||(h.searchParams.set("score",String(b.totalScore)),h.searchParams.set("max_score",String(b.maxScore))),window.location.href=h.toString()}catch{window.location.href=o}},[o]);return js(wr,{assessment:y,meta:{title:t.meta.title,category:t.meta.category??null},locale:u,branding:x,timeLimitMinutes:t.meta.settings.time_limit_minutes,startedAt:w,onSubmit:v,onViewReport:o?k:void 0,reportLabel:a,onBack:c,backLabel:l,overlayConfig:d,mediaHandler:f})}import rf from"react";import{createRoot as of}from"react-dom/client";var Ds="https://edpire.com",Xn={mount(e){let{token:t,container:r,baseUrl:n=Ds,onError:i}=e,s=typeof r=="string"?document.querySelector(r):r;if(!s){let c={code:"UNKNOWN",message:`Container not found: ${r}`};return i?.(c),{unmount:()=>{}}}let o=null,a=!1;function l(){if(a)return;a=!0;let c=o;o=null,setTimeout(()=>{c?.unmount()},0)}return(async()=>{s.innerHTML='<div style="padding:32px;text-align:center;color:#6b7280;font-family:sans-serif">Loading assessment\u2026</div>';let c;try{let d=await fetch(`${n}/api/v1/embed/assessments?token=${encodeURIComponent(t)}`,{method:"GET",headers:{"Content-Type":"application/json"}});if(!d.ok){let f=await d.json().catch(()=>({})),g=typeof f.error=="string"?f.error:"Failed to load assessment",m=d.status===401?"TOKEN_INVALID":d.status===403?"ORIGIN_NOT_ALLOWED":d.status===404?"ASSESSMENT_NOT_FOUND":"UNKNOWN";i?.({code:m,message:g}),s.innerHTML=`<div style="padding:32px;text-align:center;color:#dc2626;font-family:sans-serif">${g}</div>`;return}c=await d.json()}catch{i?.({code:"NETWORK_ERROR",message:"Failed to connect to Edpire"}),s.innerHTML='<div style="padding:32px;text-align:center;color:#dc2626;font-family:sans-serif">Failed to connect to Edpire. Please try again.</div>';return}a||(s.innerHTML="",o=Fs(s),o.render(Bs.createElement(Kn,{token:t,data:c,baseUrl:n,options:e})))})(),{unmount:l}}};import{jsx as Xs}from"react/jsx-runtime";function Ks({tokenEndpoint:e,assessmentId:t,tokenBody:r,className:n,style:i,onComplete:s,onError:o,...a}){let l=vr(null),c=vr(s);c.current=s;let d=vr(o);return d.current=o,Os(()=>{let f=l.current;if(!f)return;let g=!1,m=null;return(async()=>{let x;try{let u=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({assessmentId:t,...r})});if(g)return;if(!u.ok){let w=await u.json().catch(()=>({}));d.current?.({code:"TOKEN_INVALID",message:typeof w.error=="string"?w.error:`Token endpoint returned ${u.status}`});return}let y=await u.json();if(!y.token){d.current?.({code:"TOKEN_INVALID",message:"Token endpoint did not return a token"});return}x=y.token}catch{g||d.current?.({code:"NETWORK_ERROR",message:"Failed to fetch embed token"});return}g||(m=Xn.mount({token:x,container:f,...a,onComplete:u=>c.current?.(u),onError:u=>d.current?.(u)}))})(),()=>{g=!0,m?.unmount()}},[e,t]),Xs("div",{ref:l,className:n,style:n?void 0:i??{width:"100%",height:"100%"}})}export{wr as AssessmentShell,Ks as EdpireAssessmentPlayer,wn as EdpireQuestion};
|