@citolab/qti-components 7.1.0 → 7.1.2

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.
Files changed (281) hide show
  1. package/cdn/chunks/chunk-27WPPEWB.js +1 -0
  2. package/cdn/chunks/chunk-2HL3OFY7.js +1 -0
  3. package/cdn/chunks/chunk-33UT2QKP.js +5 -0
  4. package/cdn/chunks/chunk-3M3VWZCU.js +8 -0
  5. package/cdn/chunks/chunk-3QAOJL7Y.js +1007 -0
  6. package/cdn/chunks/chunk-3R4ZTZYA.js +5 -0
  7. package/cdn/chunks/chunk-6DWYLZ5E.js +5 -0
  8. package/cdn/chunks/chunk-6RVWXAM7.js +8 -0
  9. package/cdn/chunks/chunk-7HXSSTSU.js +1 -0
  10. package/cdn/chunks/chunk-7JXSJZV5.js +8 -0
  11. package/cdn/chunks/chunk-7QMIMK5V.js +5 -0
  12. package/cdn/chunks/chunk-7RLNGBXK.js +1 -0
  13. package/cdn/chunks/chunk-AHZ3W4YP.js +8 -0
  14. package/cdn/chunks/chunk-BGHD6LZP.js +1007 -0
  15. package/cdn/chunks/chunk-C73FEG6J.js +1 -0
  16. package/cdn/chunks/chunk-CFS5WXCD.js +1 -0
  17. package/cdn/chunks/chunk-CZDMOYYF.js +1 -0
  18. package/cdn/chunks/chunk-EBVKDAVL.js +5 -0
  19. package/cdn/chunks/chunk-EEFB2V7Q.js +27 -0
  20. package/cdn/chunks/chunk-ELZQC26E.js +5 -0
  21. package/cdn/chunks/chunk-EPOG3VSF.js +5 -0
  22. package/cdn/chunks/chunk-FDKTSUOQ.js +48 -0
  23. package/cdn/chunks/chunk-FJOHSSA3.js +1 -0
  24. package/cdn/chunks/chunk-G5YNM432.js +5 -0
  25. package/cdn/chunks/chunk-GIJVMMKY.js +1007 -0
  26. package/cdn/chunks/chunk-GNIERKRX.js +1007 -0
  27. package/cdn/chunks/chunk-GTHARXCW.js +10 -0
  28. package/cdn/chunks/chunk-IRLG6H7G.js +1 -0
  29. package/cdn/chunks/chunk-J3F2YSRA.js +1007 -0
  30. package/cdn/chunks/chunk-J4ISS5TZ.js +5 -0
  31. package/cdn/chunks/chunk-KBJYE746.js +5 -0
  32. package/cdn/chunks/chunk-KIH2VB5Z.js +1 -0
  33. package/cdn/chunks/chunk-KJJG5SSY.js +1 -0
  34. package/cdn/chunks/chunk-KLRM2GAU.js +8 -0
  35. package/cdn/chunks/chunk-KQT5S3DK.js +5 -0
  36. package/cdn/chunks/chunk-LDKKOMIK.js +3570 -0
  37. package/cdn/chunks/chunk-LDXZOGPY.js +10 -0
  38. package/cdn/chunks/chunk-LUVDXKE2.js +5 -0
  39. package/cdn/chunks/chunk-LZQKENA3.js +1 -0
  40. package/cdn/chunks/chunk-MGLK2Q6K.js +5 -0
  41. package/cdn/chunks/chunk-MK2CR5DP.js +1 -0
  42. package/cdn/chunks/chunk-N5JQAYOR.js +1 -0
  43. package/cdn/chunks/chunk-NJUBWVY3.js +10 -0
  44. package/cdn/chunks/chunk-NQKAQ6AU.js +1007 -0
  45. package/cdn/chunks/chunk-NW5VVFA5.js +5 -0
  46. package/cdn/chunks/chunk-OYUWBJSX.js +1 -0
  47. package/cdn/chunks/chunk-PBZODDGJ.js +1 -0
  48. package/cdn/chunks/chunk-PJFJOZNR.js +48 -0
  49. package/cdn/chunks/chunk-PMIMCEQ2.js +1 -0
  50. package/cdn/chunks/chunk-PYOOOJUP.js +3547 -0
  51. package/cdn/chunks/chunk-Q6HFDDZ4.js +1 -0
  52. package/cdn/chunks/chunk-QQR6POPY.js +1 -0
  53. package/cdn/chunks/chunk-QS2LH2IW.js +1007 -0
  54. package/cdn/chunks/chunk-QUFRWTHS.js +1 -0
  55. package/cdn/chunks/chunk-RJB5E47I.js +1 -0
  56. package/cdn/chunks/chunk-SFY52QPM.js +1 -0
  57. package/cdn/chunks/chunk-SUXBSENJ.js +48 -0
  58. package/cdn/chunks/chunk-SYO32O6X.js +1 -0
  59. package/cdn/chunks/chunk-TUWPPE7H.js +1 -0
  60. package/cdn/chunks/chunk-UHILPQTT.js +10 -0
  61. package/cdn/chunks/chunk-UOY4MCKX.js +6 -0
  62. package/cdn/chunks/chunk-VLCD4DFD.js +8 -0
  63. package/cdn/chunks/chunk-VRTU4ZV6.js +48 -0
  64. package/cdn/chunks/chunk-VXDODYB5.js +1007 -0
  65. package/cdn/chunks/chunk-W7GYEQJQ.js +1 -0
  66. package/cdn/chunks/chunk-WNI2D7SG.js +1 -0
  67. package/cdn/chunks/chunk-WNJ3YFMW.js +1 -0
  68. package/cdn/chunks/chunk-WRFAZSRX.js +1007 -0
  69. package/cdn/chunks/chunk-WTUTTA5R.js +1 -0
  70. package/cdn/chunks/chunk-WVVKSWZV.js +5 -0
  71. package/cdn/chunks/chunk-WXFIEBQR.js +0 -0
  72. package/cdn/chunks/chunk-X75XIXUI.js +10 -0
  73. package/cdn/chunks/chunk-XPI6OOWN.js +27 -0
  74. package/cdn/chunks/chunk-YBPCVJIX.js +10 -0
  75. package/cdn/chunks/chunk-YTSCJPU2.js +1007 -0
  76. package/cdn/chunks/chunk-YZQZGOYM.js +1 -0
  77. package/cdn/chunks/chunk-ZHVOZ7WZ.js +1007 -0
  78. package/cdn/exports/session.context.js +1 -1
  79. package/cdn/exports/test.context.js +1 -1
  80. package/cdn/index.global.js +1 -1
  81. package/cdn/index.js +1 -1
  82. package/cdn/qti-components/index.js +1 -1
  83. package/cdn/qti-test/components/index.js +1 -1
  84. package/cdn/qti-test/components/test-navigation.js +1 -1
  85. package/cdn/qti-test/components/test-print-context.js +1 -0
  86. package/cdn/qti-test/components/test-print-item-variables copy.js +1 -0
  87. package/cdn/qti-test/components/test-print-item-variables.js +1 -1
  88. package/cdn/qti-test/components/test-print-item-variables.stories copy.js +233 -0
  89. package/cdn/qti-test/components/test-print-test-context.js +1 -0
  90. package/cdn/qti-test/components/test-view.js +1 -1
  91. package/cdn/qti-test/core/index.js +1 -1
  92. package/dist/chunks/chunk-2BVFKYAB.js +659 -0
  93. package/dist/chunks/chunk-2BVFKYAB.js.map +1 -0
  94. package/dist/chunks/chunk-2RXVRB7Z.js +659 -0
  95. package/dist/chunks/chunk-2RXVRB7Z.js.map +1 -0
  96. package/dist/chunks/chunk-2ZTRBYHP.js +660 -0
  97. package/dist/chunks/chunk-2ZTRBYHP.js.map +1 -0
  98. package/dist/chunks/chunk-36LEJZEY.js +87 -0
  99. package/dist/chunks/chunk-36LEJZEY.js.map +1 -0
  100. package/dist/chunks/chunk-373M5NVS.js +62 -0
  101. package/dist/chunks/chunk-373M5NVS.js.map +1 -0
  102. package/dist/chunks/chunk-3DEV5ARX.js +89 -0
  103. package/dist/chunks/chunk-3DEV5ARX.js.map +1 -0
  104. package/dist/chunks/chunk-3GCBMXXY.js +62 -0
  105. package/dist/chunks/chunk-3GCBMXXY.js.map +1 -0
  106. package/dist/chunks/chunk-3NH5KOQ4.js +89 -0
  107. package/dist/chunks/chunk-3NH5KOQ4.js.map +1 -0
  108. package/dist/chunks/chunk-4BDSKOGB.js +6873 -0
  109. package/dist/chunks/chunk-4BDSKOGB.js.map +1 -0
  110. package/dist/chunks/chunk-4BIRH5VP.js +99 -0
  111. package/dist/chunks/chunk-4BIRH5VP.js.map +1 -0
  112. package/dist/chunks/chunk-4O3EJ3SA.js +3884 -0
  113. package/dist/chunks/chunk-4O3EJ3SA.js.map +1 -0
  114. package/dist/chunks/chunk-4Z3IMDB5.js +84 -0
  115. package/dist/chunks/chunk-4Z3IMDB5.js.map +1 -0
  116. package/dist/chunks/chunk-6ITJ2I3A.js +82 -0
  117. package/dist/chunks/chunk-6ITJ2I3A.js.map +1 -0
  118. package/dist/chunks/chunk-75ZDJN64.js +32 -0
  119. package/dist/chunks/chunk-75ZDJN64.js.map +1 -0
  120. package/dist/chunks/chunk-76SJLOAE.js +84 -0
  121. package/dist/chunks/chunk-76SJLOAE.js.map +1 -0
  122. package/dist/chunks/chunk-7JS7FRDO.js +89 -0
  123. package/dist/chunks/chunk-7JS7FRDO.js.map +1 -0
  124. package/dist/chunks/chunk-7WL6TAJE.js +6872 -0
  125. package/dist/chunks/chunk-7WL6TAJE.js.map +1 -0
  126. package/dist/chunks/chunk-AD5H6KYS.js +78 -0
  127. package/dist/chunks/chunk-AD5H6KYS.js.map +1 -0
  128. package/dist/chunks/chunk-AQLCQATM.js +62 -0
  129. package/dist/chunks/chunk-AQLCQATM.js.map +1 -0
  130. package/dist/chunks/chunk-AWQHFFVL.js +659 -0
  131. package/dist/chunks/chunk-AWQHFFVL.js.map +1 -0
  132. package/dist/chunks/chunk-BLUHTHXX.js +6877 -0
  133. package/dist/chunks/chunk-BLUHTHXX.js.map +1 -0
  134. package/dist/chunks/chunk-BO6QD3VK.js +27 -0
  135. package/dist/chunks/chunk-BO6QD3VK.js.map +1 -0
  136. package/dist/chunks/chunk-BQ22JHXC.js +6877 -0
  137. package/dist/chunks/chunk-BQ22JHXC.js.map +1 -0
  138. package/dist/chunks/chunk-BWM6SEM3.js +659 -0
  139. package/dist/chunks/chunk-BWM6SEM3.js.map +1 -0
  140. package/dist/chunks/chunk-C2FVCRYJ.js +660 -0
  141. package/dist/chunks/chunk-C2FVCRYJ.js.map +1 -0
  142. package/dist/chunks/chunk-CIVMCP3W.js +78 -0
  143. package/dist/chunks/chunk-CIVMCP3W.js.map +1 -0
  144. package/dist/chunks/chunk-CJADUWEC.js +10 -0
  145. package/dist/chunks/chunk-CJADUWEC.js.map +1 -0
  146. package/dist/chunks/chunk-DCKLAFBL.js +79 -0
  147. package/dist/chunks/chunk-DCKLAFBL.js.map +1 -0
  148. package/dist/chunks/chunk-EHRC7LG6.js +3638 -0
  149. package/dist/chunks/chunk-EHRC7LG6.js.map +1 -0
  150. package/dist/chunks/chunk-ELXD2ZSR.js +218 -0
  151. package/dist/chunks/chunk-ELXD2ZSR.js.map +1 -0
  152. package/dist/chunks/chunk-EQUEIZJL.js +27 -0
  153. package/dist/chunks/chunk-EQUEIZJL.js.map +1 -0
  154. package/dist/chunks/chunk-EREPAU3B.js +80 -0
  155. package/dist/chunks/chunk-EREPAU3B.js.map +1 -0
  156. package/dist/chunks/chunk-EXOIDEQ6.js +660 -0
  157. package/dist/chunks/chunk-EXOIDEQ6.js.map +1 -0
  158. package/dist/chunks/chunk-FFF7WZJF.js +33 -0
  159. package/dist/chunks/chunk-FFF7WZJF.js.map +1 -0
  160. package/dist/chunks/chunk-FJJMZEPV.js +95 -0
  161. package/dist/chunks/chunk-FJJMZEPV.js.map +1 -0
  162. package/dist/chunks/chunk-G5DLHZE2.js +659 -0
  163. package/dist/chunks/chunk-G5DLHZE2.js.map +1 -0
  164. package/dist/chunks/chunk-HD63HGFY.js +52 -0
  165. package/dist/chunks/chunk-HD63HGFY.js.map +1 -0
  166. package/dist/chunks/chunk-HUKKTEBP.js +99 -0
  167. package/dist/chunks/chunk-HUKKTEBP.js.map +1 -0
  168. package/dist/chunks/chunk-HXGGGOV2.js +86 -0
  169. package/dist/chunks/chunk-HXGGGOV2.js.map +1 -0
  170. package/dist/chunks/chunk-HZYAIUVZ.js +6872 -0
  171. package/dist/chunks/chunk-HZYAIUVZ.js.map +1 -0
  172. package/dist/chunks/chunk-IT744RXI.js +75 -0
  173. package/dist/chunks/chunk-IT744RXI.js.map +1 -0
  174. package/dist/chunks/chunk-IXVOEGNZ.js +87 -0
  175. package/dist/chunks/chunk-IXVOEGNZ.js.map +1 -0
  176. package/dist/chunks/chunk-JEM74SR3.js +85 -0
  177. package/dist/chunks/chunk-JEM74SR3.js.map +1 -0
  178. package/dist/chunks/chunk-JP22YLJ6.js +219 -0
  179. package/dist/chunks/chunk-JP22YLJ6.js.map +1 -0
  180. package/dist/chunks/chunk-JVGOS45U.js +660 -0
  181. package/dist/chunks/chunk-JVGOS45U.js.map +1 -0
  182. package/dist/chunks/chunk-JWVGRAWQ.js +6872 -0
  183. package/dist/chunks/chunk-JWVGRAWQ.js.map +1 -0
  184. package/dist/chunks/chunk-JWX6ZOZ6.js +86 -0
  185. package/dist/chunks/chunk-JWX6ZOZ6.js.map +1 -0
  186. package/dist/chunks/chunk-JZMZLOTW.js +32 -0
  187. package/dist/chunks/chunk-JZMZLOTW.js.map +1 -0
  188. package/dist/chunks/chunk-KS3SCUUO.js +92 -0
  189. package/dist/chunks/chunk-KS3SCUUO.js.map +1 -0
  190. package/dist/chunks/chunk-LOPCNZ26.js +95 -0
  191. package/dist/chunks/chunk-LOPCNZ26.js.map +1 -0
  192. package/dist/chunks/chunk-LSNOL7NJ.js +6872 -0
  193. package/dist/chunks/chunk-LSNOL7NJ.js.map +1 -0
  194. package/dist/chunks/chunk-M4E2ACHZ.js +75 -0
  195. package/dist/chunks/chunk-M4E2ACHZ.js.map +1 -0
  196. package/dist/chunks/chunk-MQS7RZFR.js +85 -0
  197. package/dist/chunks/chunk-MQS7RZFR.js.map +1 -0
  198. package/dist/chunks/chunk-N3JFTFIL.js +79 -0
  199. package/dist/chunks/chunk-N3JFTFIL.js.map +1 -0
  200. package/dist/chunks/chunk-OSMLF3OH.js +6868 -0
  201. package/dist/chunks/chunk-OSMLF3OH.js.map +1 -0
  202. package/dist/chunks/chunk-OWWUE3LK.js +660 -0
  203. package/dist/chunks/chunk-OWWUE3LK.js.map +1 -0
  204. package/dist/chunks/chunk-P36CLOLO.js +27 -0
  205. package/dist/chunks/chunk-P36CLOLO.js.map +1 -0
  206. package/dist/chunks/chunk-PL32YWZA.js +30 -0
  207. package/dist/chunks/chunk-PL32YWZA.js.map +1 -0
  208. package/dist/chunks/chunk-Q5JLRHTY.js +659 -0
  209. package/dist/chunks/chunk-Q5JLRHTY.js.map +1 -0
  210. package/dist/chunks/chunk-RB227QQP.js +659 -0
  211. package/dist/chunks/chunk-RB227QQP.js.map +1 -0
  212. package/dist/chunks/chunk-TC5ZLAPV.js +218 -0
  213. package/dist/chunks/chunk-TC5ZLAPV.js.map +1 -0
  214. package/dist/chunks/chunk-TRSEENUK.js +45 -0
  215. package/dist/chunks/chunk-TRSEENUK.js.map +1 -0
  216. package/dist/chunks/chunk-U7VUCT7D.js +659 -0
  217. package/dist/chunks/chunk-U7VUCT7D.js.map +1 -0
  218. package/dist/chunks/chunk-UEX52I7G.js +1 -0
  219. package/dist/chunks/chunk-UEX52I7G.js.map +1 -0
  220. package/dist/chunks/chunk-UFRDMBKM.js +43 -0
  221. package/dist/chunks/chunk-UFRDMBKM.js.map +1 -0
  222. package/dist/chunks/chunk-USJXIVR4.js +6872 -0
  223. package/dist/chunks/chunk-USJXIVR4.js.map +1 -0
  224. package/dist/chunks/chunk-UZ4QB5IO.js +10 -0
  225. package/dist/chunks/chunk-UZ4QB5IO.js.map +1 -0
  226. package/dist/chunks/chunk-V2EYNAG4.js +659 -0
  227. package/dist/chunks/chunk-V2EYNAG4.js.map +1 -0
  228. package/dist/chunks/chunk-WJBYWKIF.js +32 -0
  229. package/dist/chunks/chunk-WJBYWKIF.js.map +1 -0
  230. package/dist/chunks/chunk-WOVQFPIV.js +6872 -0
  231. package/dist/chunks/chunk-WOVQFPIV.js.map +1 -0
  232. package/dist/chunks/chunk-WPUMEBSF.js +33 -0
  233. package/dist/chunks/chunk-WPUMEBSF.js.map +1 -0
  234. package/dist/chunks/chunk-WVVYYP6F.js +218 -0
  235. package/dist/chunks/chunk-WVVYYP6F.js.map +1 -0
  236. package/dist/chunks/chunk-XSHHCMRC.js +217 -0
  237. package/dist/chunks/chunk-XSHHCMRC.js.map +1 -0
  238. package/dist/chunks/chunk-XZTGFLMB.js +6872 -0
  239. package/dist/chunks/chunk-XZTGFLMB.js.map +1 -0
  240. package/dist/chunks/chunk-ZBMTSE6Q.js +660 -0
  241. package/dist/chunks/chunk-ZBMTSE6Q.js.map +1 -0
  242. package/dist/chunks/chunk-ZMTMIG3C.js +77 -0
  243. package/dist/chunks/chunk-ZMTMIG3C.js.map +1 -0
  244. package/dist/chunks/chunk-ZSR4X4I6.js +638 -0
  245. package/dist/chunks/chunk-ZSR4X4I6.js.map +1 -0
  246. package/dist/exports/interaction.js +1 -1
  247. package/dist/exports/session.context.d.ts +1 -1
  248. package/dist/exports/session.context.js +3 -1
  249. package/dist/exports/test.context.d.ts +2 -1
  250. package/dist/exports/test.context.js +3 -1
  251. package/dist/index.d.ts +3 -2
  252. package/dist/index.js +20 -12
  253. package/dist/qti-components/index.js +2 -2
  254. package/dist/qti-components-jsx.d.ts +35 -2
  255. package/dist/qti-response-declaration-5PnLgbOQ.d.ts +1143 -0
  256. package/dist/qti-response-declaration-PJkGU8F8.d.ts +1151 -0
  257. package/dist/qti-test/components/index.d.ts +2 -1
  258. package/dist/qti-test/components/index.js +13 -9
  259. package/dist/qti-test/components/test-navigation.d.ts +1 -1
  260. package/dist/qti-test/components/test-navigation.js +3 -3
  261. package/dist/qti-test/components/test-print-context.d.ts +20 -0
  262. package/dist/qti-test/components/test-print-context.js +9 -0
  263. package/dist/qti-test/components/test-print-context.js.map +1 -0
  264. package/dist/qti-test/components/test-print-item-variables copy.js +86 -0
  265. package/dist/qti-test/components/test-print-item-variables copy.js.map +1 -0
  266. package/dist/qti-test/components/test-print-item-variables.d.ts +2 -2
  267. package/dist/qti-test/components/test-print-item-variables.js +1 -1
  268. package/dist/qti-test/components/test-print-item-variables.stories copy.js +9731 -0
  269. package/dist/qti-test/components/test-print-item-variables.stories copy.js.map +1 -0
  270. package/dist/qti-test/components/test-print-test-context.js +86 -0
  271. package/dist/qti-test/components/test-print-test-context.js.map +1 -0
  272. package/dist/qti-test/components/test-view.js +2 -2
  273. package/dist/qti-test/core/index.d.ts +3 -3
  274. package/dist/qti-test/core/index.js +15 -3
  275. package/dist/qti-test-feedback-BuFBq7JH.d.ts +97 -0
  276. package/dist/qti-test-feedback-CZsPCqSt.d.ts +97 -0
  277. package/dist/qti-test-feedback-CaNdRC7L.d.ts +96 -0
  278. package/dist/qti-test-part-BIeEZIWw.d.ts +85 -0
  279. package/dist/qti-test-part-C_jSX7Zz.d.ts +85 -0
  280. package/dist/vscode.html-custom-data.json +17 -6
  281. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- function t(t,e){if(e==null||e>t.length)e=t.length;for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function e(t){if(Array.isArray(t))return t}function n(e){if(Array.isArray(e))return t(e)}function r(t){if(t===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t}function i(t,e,n,r,i,o,a){try{var s=t[o](a);var l=s.value}catch(t){n(t);return}if(s.done){e(l)}else{Promise.resolve(l).then(r,i)}}function o(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var a=t.apply(e,n);function s(t){i(a,r,o,s,l,"next",t)}function l(t){i(a,r,o,s,l,"throw",t)}s(undefined)})}}function a(t,e,n){e=f(e);return w(t,U()?Reflect.construct(e,n||[],f(t).constructor):e.apply(t,n))}function s(t,e){if(!(t instanceof e)){throw new TypeError("Cannot call a class as a function")}}function l(t,e,n){if(U()){l=Reflect.construct}else{l=function t(t,e,n){var r=[null];r.push.apply(r,e);var i=Function.bind.apply(t,r);var o=new i;if(n)q(o,n.prototype);return o}}return l.apply(null,arguments)}function u(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false;r.configurable=true;if("value"in r)r.writable=true;Object.defineProperty(t,r.key,r)}}function c(t,e,n){if(e)u(t.prototype,e);if(n)u(t,n);return t}function d(t,e,n){if(e in t){Object.defineProperty(t,e,{value:n,enumerable:true,configurable:true,writable:true})}else{t[e]=n}return t}function h(t,e,n){if(typeof Reflect!=="undefined"&&Reflect.get){h=Reflect.get}else{h=function t(t,e,n){var r=R(t,e);if(!r)return;var i=Object.getOwnPropertyDescriptor(r,e);if(i.get){return i.get.call(n||t)}return i.value}}return h(t,e,n||t)}function f(t){f=Object.setPrototypeOf?Object.getPrototypeOf:function t(t){return t.__proto__||Object.getPrototypeOf(t)};return f(t)}function v(t,e){if(typeof e!=="function"&&e!==null){throw new TypeError("Super expression must either be null or a function")}t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:true,configurable:true}});if(e)q(t,e)}function p(t,e){if(e!=null&&typeof Symbol!=="undefined"&&e[Symbol.hasInstance]){return!!e[Symbol.hasInstance](t)}else{return t instanceof e}}function y(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function m(t){if(typeof Symbol!=="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function g(t,e){var n=t==null?null:typeof Symbol!=="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(n==null)return;var r=[];var i=true;var o=false;var a,s;try{for(n=n.call(t);!(i=(a=n.next()).done);i=true){r.push(a.value);if(e&&r.length===e)break}}catch(t){o=true;s=t}finally{try{if(!i&&n["return"]!=null)n["return"]()}finally{if(o)throw s}}return r}function b(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function k(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};var r=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){r=r.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))}r.forEach(function(e){d(t,e,n[e])})}return t}function E(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);if(e){r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})}n.push.apply(n,r)}return n}function x(t,e){e=e!=null?e:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(t,Object.getOwnPropertyDescriptors(e))}else{E(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function w(t,e){if(e&&(O(e)==="object"||typeof e==="function")){return e}return r(t)}function A(t,e,n,r){if(typeof Reflect!=="undefined"&&Reflect.set){A=Reflect.set}else{A=function t(t,e,n,r){var i=R(t,e);var o;if(i){o=Object.getOwnPropertyDescriptor(i,e);if(o.set){o.set.call(r,n);return true}else if(!o.writable){return false}}o=Object.getOwnPropertyDescriptor(r,e);if(o){if(!o.writable){return false}o.value=n;Object.defineProperty(r,e,o)}else{d(r,e,n)}return true}}return A(t,e,n,r)}function C(t,e,n,r,i){var o=A(t,e,n,r||t);if(!o&&i){throw new Error("failed to set property")}return n}function q(t,e){q=Object.setPrototypeOf||function t(t,e){t.__proto__=e;return t};return q(t,e)}function S(t,n){return e(t)||g(t,n)||$(t,n)||b()}function R(t,e){while(!Object.prototype.hasOwnProperty.call(t,e)){t=f(t);if(t===null)break}return t}function P(t,e){if(!e){e=t.slice(0)}return Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function M(t){return e(t)||m(t)||$(t)||b()}function T(t){return n(t)||m(t)||$(t)||_()}function O(t){"@swc/helpers - typeof";return t&&typeof Symbol!=="undefined"&&t.constructor===Symbol?"symbol":typeof t}function $(e,n){if(!e)return;if(typeof e==="string")return t(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor)r=e.constructor.name;if(r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return t(e,n)}function I(t){var e=typeof Map==="function"?new Map:undefined;I=function t(t){if(t===null||!y(t))return t;if(typeof t!=="function"){throw new TypeError("Super expression must either be null or a function")}if(typeof e!=="undefined"){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return l(t,arguments,f(this).constructor)}n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:false,writable:true,configurable:true}});return q(n,t)};return I(t)}function U(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(U=function(){return!!t})()}function L(t,e){var n,r,i,o,a={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),"throw":s(1),"return":s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(t){return function(e){return l([t,e])}}function l(o){if(n)throw new TypeError("Generator is already executing.");while(a)try{if(n=1,r&&(i=o[0]&2?r["return"]:o[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;if(r=0,i)o=[o[0]&2,i.value];switch(o[0]){case 0:case 1:i=o;break;case 4:a.label++;return{value:o[1],done:false};case 5:a.label++;r=o[1];o=[0];continue;case 7:o=a.ops.pop();a.trys.pop();continue;default:if(!(i=a.trys,i=i.length>0&&i[i.length-1])&&(o[0]===6||o[0]===2)){a=0;continue}if(o[0]===3&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(o[0]===6&&a.label<i[1]){a.label=i[1];i=o;break}if(i&&a.label<i[2]){a.label=i[2];a.ops.push(o);break}if(i[2])a.ops.pop();a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t];r=0}finally{n=i=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}}function N(){var t=P(["<slot></slot>"]);N=function e(){return t};return t}function D(){var t=P(["<slot></slot>"]);D=function e(){return t};return t}function V(){var t=P(['<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">\n<xsl:output method="html" version="5.0" encoding="UTF-8" indent="yes" />\n <xsl:template match="@*|node()">\n <xsl:copy>\n <xsl:apply-templates select="@*|node()"/>\n </xsl:copy>\n </xsl:template>\n\n \x3c!-- remove existing namespaces --\x3e\n <xsl:template match="*">\n \x3c!-- remove element prefix --\x3e\n <xsl:element name="{local-name()}">\n \x3c!-- process attributes --\x3e\n <xsl:for-each select="@*">\n \x3c!-- remove attribute prefix --\x3e\n <xsl:attribute name="{local-name()}">\n <xsl:value-of select="."/>\n </xsl:attribute>\n </xsl:for-each>\n <xsl:apply-templates/>\n </xsl:element>\n</xsl:template>\n</xsl:stylesheet>']);V=function e(){return t};return t}function j(){var t=P(["<slot @slotchange=","></slot>"]);j=function e(){return t};return t}function H(){var t=P([' <slot part="feedback" class="feedback ','"></slot> ']);H=function e(){return t};return t}function Q(){var t=P(["\n :host {\n display: block;\n }\n .on {\n display: block;\n }\n .off {\n display: none;\n }\n "]);Q=function e(){return t};return t}function F(){var t=P([' <slot part="feedback" class="','"></slot> ']);F=function e(){return t};return t}function z(){var t=P(["\n .on {\n display: inline-block;\n }\n .off {\n display: none;\n }\n "]);z=function e(){return t};return t}function B(){var t=P(['\n <dialog class="qti-dialog" part="feedback" ?open="','">\n <slot></slot>\n <div style="margin-top: var(--qti-gap-size); text-align: center;">\n <button class="button close-button" @click="','">Close</button>\n </div>\n </dialog>\n ']);B=function e(){return t};return t}function W(){var t=P(["\n .qti-dialog {\n background: var(--qti-bg);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n border-radius: var(--qti-border-radius);\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1000;\n width: auto;\n max-width: 90%;\n }\n\n .button {\n border-radius: var(--qti-border-radius);\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n background-color: var(--qti-bg-active);\n border: var(--qti-border-active);\n cursor: pointer;\n position: relative;\n display: inline-block;\n }\n\n .button:hover {\n background-color: var(--qti-hover-bg);\n }\n\n .button:disabled {\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n cursor: not-allowed;\n }\n\n .button:focus {\n outline: var(--qti-focus-border-width) solid var(--qti-focus-color);\n }\n "]);W=function e(){return t};return t}function Y(){var t=P([' <slot name="drags"></slot> ']);Y=function e(){return t};return t}function X(){var t=P(["\n :host {\n display: flex;\n user-select: none;\n position: absolute;\n }\n "]);X=function e(){return t};return t}function J(){var t=P(["\n :host {\n display: block; /* necessary to calculate scaling position */\n }\n slot[name='qti-simple-associable-choice'] {\n display: flex;\n align-items: flex-start;\n flex: 1;\n border: 2px solid transparent;\n padding: 0.3rem;\n border-radius: 0.3rem;\n gap: 0.5rem;\n }\n\n :host::part(associables-container) {\n display: flex;\n padding: 0.5rem;\n justify-content: space-between;\n background: linear-gradient(\n 180deg,\n rgb(0 0 0 / 0%) calc(50% - 1px),\n var(--qti-border-color-gray) calc(50%),\n rgb(0 0 0 / 0%) calc(50% + 1px)\n );\n }\n"]);J=function e(){return t};return t}function G(){var t=P(['<div part="associables-container">\n <div name="left','" part="drop-list" class="dl" identifier="droplist','_left"></div>\n <div name="right','" part="drop-list" class="dl" identifier="droplist','_right"></div>\n </div>']);G=function e(){return t};return t}function K(){var t=P([' <slot name="prompt"></slot>\n <slot name="qti-simple-associable-choice"></slot>\n <div part="drop-container">\n ','\n\n <div role="alert" id="validationMessage"></div>\n </div>']);K=function e(){return t};return t}function Z(){var t=P(["\n :host {\n display: block;\n }\n\n [part='slot'] {\n display: grid;\n gap: 10px;\n }\n\n /* Define the number of columns dynamically */\n :host([class*='qti-choices-stacking-']) [part='slot'] {\n grid-template-columns: repeat(var(--stacking-count, 1), 1fr);\n }\n\n /* Apply dynamic stacking count based on class */\n :host(.qti-choices-stacking-1) {\n --stacking-count: 1;\n }\n :host(.qti-choices-stacking-2) {\n --stacking-count: 2;\n }\n :host(.qti-choices-stacking-3) {\n --stacking-count: 3;\n }\n :host(.qti-choices-stacking-4) {\n --stacking-count: 4;\n }\n :host(.qti-choices-stacking-5) {\n --stacking-count: 5;\n }\n :host(.qti-choices-stacking-6) {\n --stacking-count: 6;\n }\n\n /* Default slot item layout */\n ::slotted(qti-simple-choice) {\n display: flex;\n align-items: center;\n white-space: nowrap;\n }\n\n /* Orientation styles */\n :host(.qti-orientation-horizontal) [part='slot'] {\n grid-auto-flow: dense column;\n grid-auto-columns: 1fr;\n }\n\n :host(.qti-orientation-vertical) [part='slot'] {\n grid-auto-flow: row;\n }\n\n /* Vertical and horizontal stacking logic */\n :host(.qti-orientation-vertical[class*='qti-choices-stacking-']) [part='slot'] {\n grid-auto-flow: dense column;\n grid-auto-columns: 1fr;\n grid-template-columns: repeat(var(--stacking-count), 1fr);\n grid-template-rows: repeat(calc(var(--item-count) / var(--stacking-count)), 1fr);\n }\n\n :host(.qti-orientation-horizontal[class*='qti-choices-stacking-']) [part='slot'] {\n grid-auto-flow: row;\n grid-template-columns: repeat(var(--stacking-count), 1fr);\n grid-template-rows: unset;\n }\n\n /* Ensure even distribution in vertical mode */\n :host(.qti-orientation-vertical) ::slotted(qti-simple-choice:nth-child(even)) {\n grid-row: auto;\n }\n"]);Z=function e(){return t};return t}function tt(){var t=P(['\n <slot part="prompt" name="prompt"></slot><slot part="slot" @slotchange=','></slot>\n <div part="message" role="alert" id="validationMessage"></div>\n ']);tt=function e(){return t};return t}function te(){var t=P(['<div style="color:red">\n <h1>Error</h1>\n ',"\n </div>"]);te=function e(){return t};return t}function tn(){var t=P(["<iframe\n width=","\n height=",'\n frameborder="0"\n title="pciContainer"\n id="pciContainer"\n >\n </iframe>\n ',""]);tn=function e(){return t};return t}function tr(){var t=P(["<button ?disabled=",' part="button" @click=',">","</button>"]);tr=function e(){return t};return t}function ti(){var t=P(["\n /* PK: display host as block, else design will be collapsed */\n :host {\n display: block;\n }\n textarea {\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n border: 0;\n }\n"]);ti=function e(){return t};return t}function to(){var t=P(['<slot name="prompt"></slot\n ><textarea\n part="textarea"\n name="','"\n spellcheck="false"\n autocomplete="off"\n maxlength="','"\n @keydown="','"\n @keyup="','"\n @change="','"\n @blur="','"\n placeholder="','"\n rows="','"\n ?disabled="','"\n ?readonly="','"\n .value=',"\n ></textarea>"]);to=function e(){return t};return t}function ta(){var t=P(["\n :host {\n display: flex;\n user-select: none;\n }\n "]);ta=function e(){return t};return t}function ts(){var t=P(["\n :host {\n display: flex;\n align-items: flex-start;\n flex-direction: column;\n flex-wrap: wrap;\n gap: 0.5rem;\n }\n\n :host(.qti-choices-top) {\n flex-direction: column;\n }\n :host(.qti-choices-bottom) {\n flex-direction: column-reverse;\n }\n :host(.qti-choices-left) {\n flex-direction: row;\n }\n :host(.qti-choices-right) {\n flex-direction: row-reverse;\n }\n /* [part='drops'] , */\n [name='prompt'] {\n width: 100%;\n }\n [name='drags'] {\n display: flex;\n align-items: flex-start;\n flex: 1;\n border: 2px solid transparent;\n padding: 0.3rem;\n border-radius: 0.3rem;\n gap: 0.5rem;\n }\n"]);ts=function e(){return t};return t}function tl(){var t=P(['<slot name="prompt"> </slot>\n <slot part="drags" name="drags"></slot>\n <slot part="drops"></slot>\n <div role="alert" id="validationMessage"></div>']);tl=function e(){return t};return t}function tu(){var t=P(["<slot></slot>"]);tu=function e(){return t};return t}function tc(){var t=P(["\n :host {\n display: inline-flex;\n user-select: none;\n }\n "]);tc=function e(){return t};return t}function td(){var t=P([' <slot name="drags"></slot>']);td=function e(){return t};return t}function th(){var t=P(["\n :host {\n display: flex;\n user-select: none;\n }\n "]);th=function e(){return t};return t}function tf(){var t=P(["\n slot:not([name='prompt']) {\n // position: relative; /* qti-hotspot-choice relative to the slot */\n display: block;\n width: fit-content; /* hotspots not stretching further if image is at max size */\n }\n ::slotted(img) {\n /* image not selectable anymore */\n pointer-events: none;\n user-select: none;\n }\n ::slotted(qti-associable-hotspot) {\n transform: translate(-50%, -50%);\n }\n line-container {\n display: block;\n position: relative;\n width: fit-content;\n }\n svg {\n position: absolute;\n top: 0px;\n left: 0px;\n }\n"]);tf=function e(){return t};return t}function tv(){var t=P(['\n <line\n part="line"\n x1=',"\n y1=","\n x2=","\n y2=",'\n stroke="red"\n stroke-width="3"\n @click=',"\n />\n "]);tv=function e(){return t};return t}function tp(){var t=P(['\n <line\n part="correct-line"\n x1=',"\n y1=","\n x2=","\n y2=",'\n stroke="var(--qti-correct)"\n stroke-width="3"\n stroke-dasharray="5,5"\n />\n ']);tp=function e(){return t};return t}function ty(){var t=P(['<line\n part="point"\n x1=',"\n y1=","\n x2=","\n y2=",'\n stroke="var(--qti-border-active)"\n stroke-width="3"\n />']);ty=function e(){return t};return t}function tm(){var t=P(['<slot name="prompt"></slot>\n <line-container>\n <svg\n width=',"\n height=",'\n viewbox="0 0 '," ",'"\n >\n ',"\n ","\n ",'\n </svg>\n <slot></slot>\n </line-container>\n <div role="alert" id="validationMessage"></div>']);tm=function e(){return t};return t}function tg(){var t=P(["\n :host {\n display: flex;\n align-items: flex-start;\n flex-direction: column;\n flex-wrap: wrap;\n gap: 0.5rem;\n }\n\n :host(.qti-choices-top) {\n flex-direction: column-reverse;\n }\n :host(.qti-choices-bottom) {\n flex-direction: column;\n }\n :host(.qti-choices-left) {\n flex-direction: row-reverse;\n & [name='drags'] {\n width: 25%;\n }\n & [part='image'] {\n width: 75%;\n }\n }\n :host(.qti-choices-right) {\n flex-direction: row;\n & [name='drags'] {\n width: 25%;\n }\n & [part='image'] {\n width: 75%;\n }\n }\n [part='image'] {\n display: block;\n position: relative;\n }\n /* [part='drops'] , */\n\n [name='drags'] {\n display: flex;\n align-items: flex-start;\n flex-wrap: wrap;\n flex: 1;\n border: 2px solid transparent;\n padding: 0.3rem;\n border-radius: 0.3rem;\n gap: 0.5rem;\n }\n ::slotted(img) {\n display: inline-block;\n user-select: none;\n pointer-events: none;\n }\n"]);tg=function e(){return t};return t}function tb(){var t=P([' <slot name="prompt"></slot>\n <slot part="image"></slot>\n <slot part="drags" name="drags" class="hover-border"></slot>\n <div role="alert" id="validationMessage"></div>']);tb=function e(){return t};return t}function t_(){var t=P(["\n slot:not([name='prompt']) {\n position: relative; /* qti-hotspot-choice relative to the slot */\n display: block;\n width: fit-content; /* hotspots not stretching further if image is at max size */\n }\n ::slotted(img) {\n /* image not selectable anymore */\n pointer-events: none;\n user-select: none;\n }\n"]);t_=function e(){return t};return t}function tk(){var t=P(['\n <slot name="prompt"></slot>\n <slot></slot>\n <div role="alert" id="validationMessage"></div>\n ']);tk=function e(){return t};return t}function tE(){var t=P(["\n :host {\n display: flex;\n user-select: none;\n position: absolute;\n }\n "]);tE=function e(){return t};return t}function tx(){var t=P(["\n slot:not([name='prompt']) {\n position: relative; /* qti-hotspot-choice relative to the slot */\n display: block;\n width: fit-content; /* hotspots not stretching further if image is at max size */\n }\n ::slotted(img) {\n /* image not selectable anymore */\n pointer-events: none;\n user-select: none;\n /* width:100%; */\n }\n"]);tx=function e(){return t};return t}function tw(){var t=P(['\n <slot name="prompt"></slot>\n <slot></slot>\n ']);tw=function e(){return t};return t}function tA(){var t=P(["<slot></slot>"]);tA=function e(){return t};return t}function tC(){var t=P(['<div part="ch"><div part="cha"></div></div>\n <slot></slot> ']);tC=function e(){return t};return t}function tq(){var t=P(["\n :host {\n display: flex;\n user-select: none;\n }\n "]);tq=function e(){return t};return t}function tS(){var t=P(["\n :host {\n display: inline-block;\n }\n slot {\n display: flex;\n flex-direction: column;\n }\n [role='menu'] {\n position: absolute;\n z-index: 1000;\n }\n .anchor {\n /* anchor-name: --infobox; */\n width: fit-content;\n }\n\n .positionedElement {\n position: absolute;\n /* position-anchor: --infobox; */\n /* top: anchor(bottom); */\n }\n "]);tS=function e(){return t};return t}function tR(){var t=P(['\n <option value="','" ?selected="','">',"</option>\n "]);tR=function e(){return t};return t}function tP(){var t=P(['\n <select part="select" @change="','" ?disabled="','" ?readonly="','">\n ',"\n </select>\n\n ","\n "]);tP=function e(){return t};return t}function tM(){var t=P(["\n :host {\n display: block;\n cursor: pointer;\n }\n "]);tM=function e(){return t};return t}function tT(){var t=P([" <slot></slot> "]);tT=function e(){return t};return t}function tO(){var t=P(['\n <slot part="slot"></slot>\n <slot part="dropslot" name="qti-simple-associable-choice"></slot>\n ']);tO=function e(){return t};return t}function t$(){var t=P(["\n :host {\n display: flex;\n user-select: none;\n }\n slot {\n width: 100%;\n display: block;\n }\n slot[name='qti-simple-associable-choice'] {\n width: 100%;\n }\n "]);t$=function e(){return t};return t}function tI(){var t=P(["\n slot:not([hidden]) {\n /* slot where the */\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n align-items: flex-start; /* prevents the drag and drop container slots having the same height */\n }\n :host(.qti-choices-top) slot {\n flex-direction: column;\n }\n :host(.qti-choices-bottom) slot {\n flex-direction: column-reverse;\n }\n :host(.qti-choices-left) slot {\n flex-direction: row;\n }\n :host(.qti-choices-right) slot {\n flex-direction: row-reverse;\n }\n slot[name='prompt'] {\n display: block;\n }\n ::slotted(qti-simple-match-set) {\n /* Make sure the drag and drop container slots have the same width */\n flex: 1;\n }\n"]);tI=function e(){return t};return t}function tU(){var t=P(['<th part="r-header">',"</th>"]);tU=function e(){return t};return t}function tL(){var t=P(["<td>\n <input\n type=","\n part=","\n name=","\n value=","\n .disabled=","\n @change=","\n @click=","\n />\n </td>"]);tL=function e(){return t};return t}function tN(){var t=P(['<tr>\n <td part="c-header">',"</td>\n ","\n </tr>"]);tN=function e(){return t};return t}function tD(){var t=P(["\n <table>\n <tr>\n <td></td>\n ","\n </tr>\n\n ","\n </table>\n "]);tD=function e(){return t};return t}function tV(){var t=P(['\n <slot name="prompt"></slot>\n <slot ?hidden=',"></slot>\n\n ",'\n\n <div role="alert" id="validationMessage"></div>\n ']);tV=function e(){return t};return t}function tj(){var t=P([' <slot name="prompt"></slot>\n <slot></slot>']);tj=function e(){return t};return t}function tH(){var t=P([""]);tH=function e(){return t};return t}function tQ(){var t=P(["\n [part='drags'] {\n display: flex;\n align-items: flex-start;\n flex: 1;\n border: 2px solid transparent;\n }\n\n [part='drops'] {\n flex: 1;\n display: grid;\n grid-auto-flow: column;\n grid-auto-columns: 1fr;\n }\n\n :host([orientation='horizontal']) [part='drags'] {\n flex-direction: row;\n }\n :host([orientation='horizontal']) [part='drops'] {\n grid-auto-flow: column;\n }\n :host([orientation='vertical']) [part='drags'] {\n flex-direction: column;\n }\n :host([orientation='vertical']) [part='drops'] {\n grid-auto-flow: row;\n }\n\n [part='drop-list'] {\n display: block;\n flex: 1;\n }\n\n [part='container'] {\n display: flex;\n gap: 0.5rem;\n }\n :host(.qti-choices-top) [part='container'] {\n flex-direction: column;\n }\n :host(.qti-choices-bottom) [part='container'] {\n flex-direction: column-reverse;\n }\n :host(.qti-choices-left) [part='container'] {\n flex-direction: row;\n }\n :host(.qti-choices-right) [part='container'] {\n flex-direction: row-reverse;\n }\n"]);tQ=function e(){return t};return t}function tF(){var t=P(['<drop-list part="drop-list" identifier="droplist','"></drop-list>']);tF=function e(){return t};return t}function tz(){var t=P([' <slot name="prompt"> </slot>\n <div part="container">\n <slot part="drags"> </slot>\n <div part="drops">\n ',"\n </div>\n </div>"]);tz=function e(){return t};return t}function tB(){var t=P(['<div style="color:red">\n <h1>Error</h1>\n ',"\n </div>"]);tB=function e(){return t};return t}function tW(){var t=P(["<slot></slot>",""]);tW=function e(){return t};return t}function tY(){var t=P(["<slot></slot>"]);tY=function e(){return t};return t}function tX(){var t=P(["\n :host {\n display: block;\n }\n ::slotted(img) {\n position: absolute;\n cursor: move;\n user-select: none;\n left: 50%;\n transform: translateX(-50%);\n }\n "]);tX=function e(){return t};return t}function tJ(){var t=P(["<slot></slot>"]);tJ=function e(){return t};return t}function tG(){var t=P(["\n :host {\n display: inline-block;\n position: relative;\n }\n "]);tG=function e(){return t};return t}function tK(){var t=P(['\n <button\n part="point"\n style=','\n aria-label="Remove point at ','"\n @click=',"\n ></button>\n "]);tK=function e(){return t};return t}function tZ(){var t=P(["<div\n style=",'\n data-coord="','"\n alt=','\n data-shape="','"\n ></div>']);tZ=function e(){return t};return t}function t0(){var t=P([' <slot name="prompt"></slot>\n <point-container>\n ',"\n ","\n <slot></slot>\n </point-container>"]);t0=function e(){return t};return t}function t1(){var t=P(["\n :host {\n display: block;\n }\n point-container {\n display: block;\n position: relative;\n width: fit-content;\n }\n\n ::slotted(img) {\n max-width: 100%;\n height: auto;\n display: block;\n }\n "]);t1=function e(){return t};return t}function t2(){var t=P(['<div id="label">',"</div>"]);t2=function e(){return t};return t}function t3(){var t=P(['<div part="ch">\n <div part="cha"></div>\n </div>\n ','\n <slot part="slot"></slot> ']);t3=function e(){return t};return t}function t5(){var t=P(["\n :host {\n display: flex;\n align-items: center;\n user-select: none;\n }\n slot {\n width: 100%;\n display: flex;\n align-items: center;\n }\n [part='ch'] {\n display: flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n }\n "]);t5=function e(){return t};return t}function t4(){var t=P(["\n :host {\n display: block;\n --show-bounds: true;\n --show-ticks: true;\n --show-value: true;\n }\n\n [part='slider'] {\n margin-left: 2rem; /* mx-8 */\n margin-right: 2rem;\n padding-bottom: 1rem; /* pb-4 */\n padding-top: 1.25rem; /* pt-5 */\n }\n\n [part='bounds'] {\n display: flex;\n width: 100%;\n justify-content: space-between;\n margin-bottom: 0.5rem; /* mb-2 */\n }\n\n [part='ticks'] {\n margin-left: 0.125rem; /* mx-0.5 */\n margin-right: 0.125rem;\n margin-bottom: 0.25rem; /* mb-1 */\n height: 0.5rem; /* h-2 */\n background: linear-gradient(to right, var(--qti-border-color) var(--qti-border-thickness), transparent 1px) repeat-x\n 0 center / calc(calc(100% - var(--qti-border-thickness)) / ((var(--max) - var(--min)) / var(--step))) 100%;\n }\n\n [part='rail'] {\n display: flex;\n align-items: center;\n box-sizing: border-box;\n height: 0.375rem; /* h-1.5 */\n width: 100%;\n cursor: pointer;\n border-radius: 9999px; /* rounded-full */\n border: 1px solid #d1d5db; /* border-gray-300 */\n background-color: #e5e7eb; /* bg-gray-200 */\n }\n\n [part='knob'] {\n background-color: var(--qti-bg-active);\n border: 2px solid var(--qti-border-active);\n position: relative;\n height: 1rem; /* h-4 */\n width: 1rem; /* w-4 */\n transform-origin: center;\n transform: translateX(-50%);\n cursor: pointer;\n border-radius: 9999px; /* rounded-full */\n left: var(--value-percentage);\n }\n [part='knob-correct'] {\n background-color: var(--qti-correct-light);\n border: 2px solid var(--qti-correct);\n position: relative;\n height: 1rem; /* h-4 */\n width: 1rem; /* w-4 */\n transform-origin: center;\n transform: translateX(-50%);\n cursor: pointer;\n border-radius: 9999px; /* rounded-full */\n left: var(--value-percentage-correct);\n }\n\n [part='value'] {\n position: absolute;\n bottom: 2rem; /* bottom-8 */\n left: 0.5rem; /* left-2 */\n transform: translateX(-50%);\n cursor: pointer;\n border-radius: 0.25rem; /* rounded */\n background-color: #f3f4f6; /* bg-gray-100 */\n padding: 0.25rem 0.5rem; /* px-2 py-1 */\n text-align: center;\n color: #6b7280; /* text-gray-500 */\n }\n"]);t4=function e(){return t};return t}function t6(){var t=P(['\n <div id="knob-correct" part="knob-correct">\n <div id="value" part="value">',"</div>\n </div>\n "]);t6=function e(){return t};return t}function t9(){var t=P(['\n <slot name="prompt"></slot>\n <div id="slider" part="slider">\n <div id="bounds" part="bounds">\n <div>',"</div>\n <div>",'</div>\n </div>\n\n <div id="ticks" part="ticks"></div>\n\n <div id="rail" part="rail" @mousedown='," @touchstart=",'>\n <div id="knob" part="knob">\n <div id="value" part="value">',"</div>\n </div>\n\n ","\n </div>\n </div>\n "]);t9=function e(){return t};return t}function t7(){var t=P(["\n :host {\n display: inline-block;\n }\n [part='correct'] {\n position: absolute;\n width: 100%;\n }\n :host(.qti-input-width-1) [part='input'] {\n width: 1.1rem;\n min-width: 1.1rem;\n }\n\n :host(.qti-input-width-2) [part='input'] {\n width: 2.3rem;\n min-width: 2.3rem;\n }\n\n :host(.qti-input-width-3) [part='input'] {\n width: 3.3rem;\n min-width: 3.3rem;\n }\n\n :host(.qti-input-width-4) [part='input'] {\n width: 4.2rem;\n min-width: 4.2rem;\n }\n\n :host(.qti-input-width-6) [part='input'] {\n width: 6.6rem;\n min-width: 6.6rem;\n }\n\n :host(.qti-input-width-10) [part='input'] {\n width: 8rem;\n min-width: 8rem;\n }\n\n :host(.qti-input-width-15) [part='input'] {\n width: 12rem;\n min-width: 12rem;\n }\n\n :host(.qti-input-width-20) [part='input'] {\n width: 17rem;\n min-width: 17rem;\n }\n\n :host(.qti-input-width-25) [part='input'] {\n width: 20rem;\n min-width: 20rem;\n }\n\n :host(.qti-input-width-30) [part='input'] {\n width: 24rem;\n min-width: 24rem;\n }\n\n :host(.qti-input-width-35) [part='input'] {\n width: 28rem;\n min-width: 28rem;\n }\n\n :host(.qti-input-width-40) [part='input'] {\n width: 32rem;\n min-width: 32rem;\n }\n\n :host(.qti-input-width-45) [part='input'] {\n width: 36rem;\n min-width: 36rem;\n }\n\n :host(.qti-input-width-50) [part='input'] {\n width: 40rem;\n min-width: 40rem;\n }\n\n :host(.qti-input-width-72) [part='input'] {\n width: 57rem;\n min-width: 57rem;\n }\n"]);t7=function e(){return t};return t}function t8(){var t=P(['\n <input\n part="input"\n name="','"\n spellcheck="false"\n autocomplete="off"\n @blur="','"\n @keydown="','"\n @keyup="','"\n @change="','"\n type="','"\n placeholder="','"\n .value="','"\n pattern="','"\n maxlength=','\n ?disabled="','"\n ?readonly="','"\n />\n <div part="correct">',"</div>\n "]);t8=function e(){return t};return t}function et(){var t=P(['\n <div>\n <slot name="prompt"></slot>\n <input type="file" @change="','" ?disabled="','" ?readonly="','" />\n </div>\n ']);et=function e(){return t};return t}function ee(){var t=P(["\n :host {\n display: block;\n margin: 1em 0;\n }\n input[type='file'] {\n display: block;\n margin-top: 0.5em;\n }\n "]);ee=function e(){return t};return t}function en(){var t=P(["\n :host {\n display: block;\n }\n"]);en=function e(){return t};return t}function er(){var t=P(['<slot part="qti-rubric-blocks" name="qti-rubric-block"></slot><slot></slot>']);er=function e(){return t};return t}function ei(){var t=P(["<slot></slot>"]);ei=function e(){return t};return t}function eo(){var t=P(["\n :host {\n display: none;\n }\n "]);eo=function e(){return t};return t}function ea(){var t=P(["<slot></slot>"]);ea=function e(){return t};return t}function es(){var t=P(["<slot></slot>"]);es=function e(){return t};return t}function el(){var t=P(["\n :host {\n display: none;\n }\n "]);el=function e(){return t};return t}function eu(){var t=P(["<slot></slot>"]);eu=function e(){return t};return t}function ec(){var t=P(["<slot></slot>"]);ec=function e(){return t};return t}function ed(){var t=P(["<slot></slot>"]);ed=function e(){return t};return t}function eh(){var t=P(["",""]);eh=function e(){return t};return t}function ef(){var t=P(["<pre>","</pre>\n <slot></slot>"]);ef=function e(){return t};return t}function ev(){var t=P(["\n slot {\n display: none;\n }\n "]);ev=function e(){return t};return t}function ep(){var t=P(["<pre>","</pre>\n <slot></slot>"]);ep=function e(){return t};return t}function ey(){var t=P(["\n slot {\n display: none;\n }\n "]);ey=function e(){return t};return t}function em(){var t=P(["",""]);em=function e(){return t};return t}function eg(){var t=P(["",""]);eg=function e(){return t};return t}function eb(){var t=P(["<slot></slot>"]);eb=function e(){return t};return t}function e_(){var t=P(["<slot></slot>"]);e_=function e(){return t};return t}function ek(){var t=P(["\n :host {\n display: block;\n }\n "]);ek=function e(){return t};return t}function eE(){var t=P(["<slot></slot>"]);eE=function e(){return t};return t}function ex(){var t=P(["",""]);ex=function e(){return t};return t}function ew(){var t=P(["\n :host {\n display: none;\n }\n "]);ew=function e(){return t};return t}function eA(){var t=P(["",""]);eA=function e(){return t};return t}function eC(){var t=P(["\n :host {\n display: none;\n }\n "]);eC=function e(){return t};return t}var QtiComponents=function(){var t=function t(t){var e=t.context;return function(t,n){var r=new WeakMap;if((typeof n==="undefined"?"undefined":O(n))=="object")return n.addInitializer(function(){r.set(this,new eW(this,{context:e}))}),{get:function e(){return t.get.call(this)},set:function e(e){var n;return(n=r.get(this))===null||n===void 0?void 0:n.setValue(e),t.set.call(this,e)},init:function t(t){var e;return(e=r.get(this))===null||e===void 0?void 0:e.setValue(t),t}};{t.constructor.addInitializer(function(t){r.set(t,new eW(t,{context:e}))});var i=Object.getOwnPropertyDescriptor(t,n),o;if(i===void 0){var a=new WeakMap;o={get:function t(){return a.get(this)},set:function t(t){r.get(this).setValue(t),a.set(this,t)},configurable:!0,enumerable:!0}}else{var s=i.set;o=x(k({},i),{set:function t(t){r.get(this).setValue(t),s===null||s===void 0?void 0:s.call(this,t)}})}return void Object.defineProperty(t,n,o)}}};var e=function t(t){var e=t.context,n=t.subscribe;return function(t,r){(typeof r==="undefined"?"undefined":O(r))=="object"?r.addInitializer(function(){var r=this;new eF(this,{context:e,callback:function(e){t.set.call(r,e)},subscribe:n})}):t.constructor.addInitializer(function(t){new eF(t,{context:e,callback:function(e){t[r]=e},subscribe:n})})}};var n=function t(t,e){if(!nT(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return nw!==void 0?nw.createHTML(e):e};var r=function t(t){return function(e,n){return(typeof n==="undefined"?"undefined":O(n))=="object"?ro(t,e,n):function(t,e,n){var r=e.hasOwnProperty(n);return e.constructor.createProperty(n,r?x(k({},t),{wrapped:!0}):t),r?Object.getOwnPropertyDescriptor(e,n):void 0}(t,e,n)}};var i=function t(t){return r(x(k({},t),{state:!0,attribute:!1}))};var l=function t(t,e){return function(n,r,i){var o=function(e){var n;var r;return(r=(n=e.renderRoot)===null||n===void 0?void 0:n.querySelector(t))!==null&&r!==void 0?r:null};if(e){var a=(typeof r==="undefined"?"undefined":O(r))=="object"?n:i!==null&&i!==void 0?i:function(){var t=Symbol();return{get:function e(){return this[t]},set:function e(e){this[t]=e}}}(),s=a.get,l=a.set;return ra(n,r,{get:function t(){var t=s.call(this);return t===void 0&&(t=o(this),(t!==null||this.hasUpdated)&&l.call(this,t)),t}})}return ra(n,r,{get:function t(){return o(this)}})}};var u=function t(t){return function(e,n){var r=t!==null&&t!==void 0?t:{},i=r.slot,o=r.selector,a="slot"+(i?"[name=".concat(i,"]"):":not([name])");return ra(e,n,{get:function e(){var e;var n;var r=(e=this.renderRoot)===null||e===void 0?void 0:e.querySelector(a),i=(n=r===null||r===void 0?void 0:r.assignedElements(t))!==null&&n!==void 0?n:[];return o===void 0?i:i.filter(function(t){return t.matches(o)})}})}};var d=function t(t,e){var n=k({waitUntilFirstUpdate:!1},e);return function(e,r){var i=e.update,o=Array.isArray(t)?t:[t];e.update=function(t){var e=this;o.forEach(function(i){var o=i;if(t.has(o)){var a=t.get(o),s=e[o];a!==s&&(!n.waitUntilFirstUpdate||e.hasUpdated)&&e[r](a,s)}}),i.call(this,t)}}};var y=function t(t,e,n){t.querySelectorAll(e).forEach(function(t){var r="".concat(e,"-").concat(n),i=g(t,r);t.replaceWith(i)})};var m=function t(t,e){t.querySelectorAll("*").forEach(function(t){var n=t.classList;n&&n.forEach(function(n){if(n.startsWith("".concat(e,":"))){var r=n.slice("".concat(e,":").length),i="".concat(t.nodeName,"-").concat(r),o=g(t,i);t.replaceWith(o)}})})};var g=function t(t,e){var n=document.createElement(e);var r=true,i=false,o=undefined;try{for(var a=t.attributes[Symbol.iterator](),s;!(r=(s=a.next()).done);r=true){var l=s.value;n.setAttribute(l.name,l.value)}}catch(t){i=true;o=t}finally{try{if(!r&&a.return!=null){a.return()}}finally{if(i){throw o}}}for(;t.firstChild;)n.appendChild(t.firstChild);return n};var b=function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return e&&rh!==null&&rh.abort(),new Promise(function(e,n){var r=new XMLHttpRequest;rh=r,r.open("GET",t,!0),r.responseType="document",r.onload=function(){r.status>=200&&r.status<300?e(r.responseXML):n(r.statusText)},r.onerror=function(){n(r.statusText)},r.send()})};var _=function t(t){return new DOMParser().parseFromString(t,"text/xml")};var E=function t(t){var e=new XSLTProcessor,n=new DOMParser().parseFromString(rd,"text/xml");return e.importStylesheet(n),e.transformToFragment(t,document)};var w=function t(t,e){e.endsWith("/")||(e+="/"),t.querySelectorAll("[src],[href],[primary-path]").forEach(function(t){var n;var r="";t.getAttribute("src")&&(r="src"),t.getAttribute("href")&&(r="href"),t.getAttribute("primary-path")&&(r="primary-path");var i=(n=t.getAttribute(r))===null||n===void 0?void 0:n.trim();if(!i.startsWith("data:")&&!i.startsWith("http")){var o=e+encodeURI(i);t.setAttribute(r,o)}})};var A=function t(t){t.querySelectorAll('qti-custom-operator[class="js.org"] > qti-base-value').forEach(function(t){var e=document.createComment(t.textContent);t.replaceChild(e,t.firstChild)})};var q=function t(t){t.querySelectorAll("qti-stylesheet").forEach(function(t){return t.remove()})};var R=function t(t){return t==null};var P=function t(t){return t.replace(/([^:]\/)\/+/g,"$1").replace(/\/\//g,"/").replace("http:/","http://").replace("https:/","https://")};var $=function t(t,e){var n;return function(e,r){var i=e.connectedCallback,o=e.disconnectedCallback;e.connectedCallback=function(){var e=this;var o;i.call(this);var a=function(n){var i;var o=Array.from(e.querySelectorAll(t)).concat(Array.from(((i=e.shadowRoot)===null||i===void 0?void 0:i.querySelectorAll(t))||[]));var a=true,s=false,l=undefined;try{for(var u=n[Symbol.iterator](),c;!(a=(c=u.next()).done);a=true){var d=c.value;var h=Array.from(d.addedNodes).map(function(t){return t}),f=Array.from(d.addedNodes).map(function(t){return t});d.type==="childList"&&h.find(function(t){return o.includes(t)})&&e[r](h,f)}}catch(t){s=true;l=t}finally{try{if(!a&&u.return!=null){u.return()}}finally{if(s){throw l}}}};n=new MutationObserver(a),n.observe(this,{childList:!0,subtree:!0});var s=Array.from(this.querySelectorAll(t)).concat(Array.from(((o=this.shadowRoot)===null||o===void 0?void 0:o.querySelectorAll(t))||[]));this[r](Array.from(s),[])},e.disconnectedCallback=function(){o.call(this),n.disconnect()}}};var U=function t(t,e){var n=/*#__PURE__*/function(t){"use strict";v(n,t);function n(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++){e[r]=arguments[r]}s(this,n);var i;i=a(this,n,T(e));i.identifier="";i.tabIndex=0;i.disabled=!1;i.readonly=!1;i.internals=i.attachInternals();return i}c(n,[{key:"handleDisabledChange",value:function t(t,e){this.tabIndex=e?-1:0,e&&this.blur()}},{key:"connectedCallback",value:function t(){h(f(n.prototype),"connectedCallback",this).call(this),this.addEventListener("keyup",this._onKeyUp),this.addEventListener("click",this._onClick),this.dispatchEvent(new CustomEvent("register-".concat(e),{bubbles:!0,composed:!0}))}},{key:"disconnectedCallback",value:function t(){h(f(n.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("keyup",this._onKeyUp),this.removeEventListener("click",this._onClick),this.dispatchEvent(new CustomEvent("unregister-".concat(e),{bubbles:!0,composed:!0}))}},{key:"_onKeyUp",value:function t(t){t.altKey||t.code==="Space"&&(t.preventDefault(),this._activate())}},{key:"_onClick",value:function t(){this.disabled||this.readonly||(this.focus(),this._activate())}},{key:"_activate",value:function t(){this.disabled||this.readonly||this.dispatchEvent(new CustomEvent("activate-".concat(e),{bubbles:!0,composed:!0,detail:{identifier:this.identifier}}))}},{key:"render",value:function t(){return nQ(N())}}]);return n}(t);return ej([r({type:String})],n.prototype,"identifier",2),ej([r({type:Number,reflect:!0,attribute:"tabindex"})],n.prototype,"tabIndex",2),ej([r({type:Boolean,reflect:!0,attribute:"aria-disabled",converter:rH})],n.prototype,"disabled",2),ej([r({type:Boolean,reflect:!0,attribute:"aria-readonly",converter:rH})],n.prototype,"readonly",2),ej([d("disabled",{waitUntilFirstUpdate:!0})],n.prototype,"handleDisabledChange",1),n};var eq=function t(t,e,n,r){var i=n.getAttribute("width")?parseFloat(n.getAttribute("width")):n.naturalWidth,o=n.getAttribute("height")?parseFloat(n.getAttribute("height")):n.naturalHeight;switch(t){case"circle":{if(e.length!==3){console.error("Invalid cirlce coordinates:",e);return}var a=S(e,3),s=a[0],l=a[1],u=a[2],c=s/i*100,d=l/o*100,h=u/i*100;r.style.left=c-h+"%",r.style.top=d-h+"%";var f=u/i*100,v=u/o*100;r.style.width=2*f+"%",r.style.height=2*v+"%",r.style.borderRadius="50%"}break;case"rect":{if(e.length!==4){console.error("Invalid rectangle coordinates:",e);return}var p=S(e,4),y=p[0],m=p[1],g=p[2],b=p[3],_=y/i*100,k=m/o*100,E=g/i*100,x=b/o*100;r.style.left=_+"%",r.style.top=k+"%",r.style.width=E-_+"%",r.style.height=x-k+"%"}break;case"ellipse":{if(e.length!==4){console.error("Invalid ellipse coordinates:",e);return}var w=S(e,4),A=w[0],C=w[1],q=w[2],R=w[3],P=A/i*100,M=C/o*100,O=q/i*100,$=R/o*100;r.style.left=P-O+"%",r.style.top=M-$+"%",r.style.width=2*O+"%",r.style.height=2*$+"%",r.style.borderRadius="50%"}break;case"poly":{var I,U,L,N;if(e.length<6||e.length%2!==0){console.error("Invalid polygon coordinates:",e);return}var D=[];for(var V=0;V<e.length;V+=2)D.push({x:e[V],y:e[V+1]});var j=(I=Math).min.apply(I,T(D.map(function(t){return t.x}))),H=(U=Math).max.apply(U,T(D.map(function(t){return t.x}))),Q=(L=Math).min.apply(L,T(D.map(function(t){return t.y}))),F=(N=Math).max.apply(N,T(D.map(function(t){return t.y}))),z=j/i*100,B=Q/o*100,W=H/i*100,Y=F/o*100;r.style.left=z+"%",r.style.top=B+"%",r.style.width=W-z+"%",r.style.height=Y-B+"%";var X=D.map(function(t){return{x:(t.x-j)/(H-j)*100,y:(t.y-Q)/(F-Q)*100}}).map(function(t){return"".concat(t.x,"% ").concat(t.y,"%")}).join(",");r.style.clipPath="polygon(".concat(X,")")}break;default:console.error("Unsupported shape: ".concat(t));break}};var eS=function t(t){this._$AN!==void 0?(iR(this),this._$AM=t,iP(this)):this._$AM=t};var eR=function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;var r=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(e)if(Array.isArray(r))for(var o=n;o<r.length;o++)iS(r[o],!1),iR(r[o]);else r!=null&&(iS(r,!1),iR(r));else iS(this,t)};var eP=function t(t){return /*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"calculateChildren",value:function t(t){return t.map(function(t){var e=t;if(!e.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;var n=e.calculate(),r=!1;if(typeof n=="string")if(n==="true")r=!0;else if(n==="false")r=!1;else return console.error("unexpected val in qti-or, expected boolean"),null;else typeof n=="boolean"&&(r=n);return r}).every(function(t){return typeof t=="boolean"&&t})}}]);return e}(t)};var eM=function t(t){return /*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"calculateChildren",value:function t(t){var e=t.map(function(t){if(!t.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;var e=t.calculate();return Number.isNaN(e)?(console.error("Unexpected value in qti-subtract, expected number"),null):Number(e)});return e.some(function(t){return t===null})?(console.error("One or more child expressions returned invalid values"),0):e[0]-e[1]}}]);return e}(t)};var eT,eO;var e$=Object.defineProperty;var eI=Object.getOwnPropertyDescriptor;var eU=Object.getOwnPropertyNames;var eL=Object.prototype.hasOwnProperty;var eN=function(t,e){for(var n in e)e$(t,n,{get:e[n],enumerable:!0})},eD=function(t,e,n,r){var i=true,o=false,a=undefined;if(e&&(typeof e==="undefined"?"undefined":O(e))=="object"||typeof e=="function")try{var s=function(){var i=u.value;!eL.call(t,i)&&i!==n&&e$(t,i,{get:function(){return e[i]},enumerable:!(r=eI(e,i))||r.enumerable})};for(var l=eU(e)[Symbol.iterator](),u;!(i=(u=l.next()).done);i=true)s()}catch(t){o=true;a=t}finally{try{if(!i&&l.return!=null){l.return()}}finally{if(o){throw a}}}return t};var eV=function(t){return eD(e$({},"__esModule",{value:!0}),t)},ej=function(t,e,n,r){for(var i=r>1?void 0:r?eI(e,n):e,o=t.length-1,a;o>=0;o--)(a=t[o])&&(i=(r?a(e,n,i):a(i))||i);return r&&i&&e$(e,n,i),i};var eH={};eN(eH,{QtiAnd:function(){return i4},QtiAssessmentItem:function(){return ru},QtiAssessmentStimulusRef:function(){return rv},QtiAssociableHotspot:function(){return rw},QtiAssociateInteraction:function(){return rR},QtiBaseValue:function(){return i6},QtiChoiceInteraction:function(){return r$},QtiCompanionMaterialsInfo:function(){return rp},QtiContains:function(){return i9},QtiContentBody:function(){return oA},QtiCorrect:function(){return i7},QtiCustomInteraction:function(){return rI},QtiCustomOperator:function(){return ry},QtiDelete:function(){return ow},QtiEndAttemptInteraction:function(){return rU},QtiEqual:function(){return oe},QtiEqualRounded:function(){return i8},QtiExtendedTextInteraction:function(){return rN},QtiFeedbackBlock:function(){return r_},QtiFeedbackInline:function(){return rE},QtiGap:function(){return rF},QtiGapImg:function(){return rD},QtiGapMatchInteraction:function(){return rj},QtiGapText:function(){return rQ},QtiGraphicAssociateInteraction:function(){return r6},QtiGraphicGapMatchInteraction:function(){return r7},QtiGraphicOrderInteraction:function(){return it},QtiGt:function(){return on},QtiGte:function(){return or},QtiHotspotChoice:function(){return ie},QtiHotspotInteraction:function(){return ii},QtiHottext:function(){return ia},QtiHottextInteraction:function(){return io},QtiInlineChoice:function(){return ic},QtiInlineChoiceInteraction:function(){return iu},QtiIsNull:function(){return oi},QtiItemBody:function(){return ij},QtiLookupOutcomeValue:function(){return iJ},QtiLt:function(){return oo},QtiLte:function(){return oa},QtiMapResponse:function(){return os},QtiMapResponsePoint:function(){return ou},QtiMatch:function(){return oc},QtiMatchInteraction:function(){return iv},QtiMediaInteraction:function(){return ip},QtiMember:function(){return od},QtiModalFeedback:function(){return rx},QtiMultiple:function(){return oh},QtiNot:function(){return of},QtiOr:function(){return ov},QtiOrderInteraction:function(){return im},QtiOrdered:function(){return op},QtiOutcomeDeclaration:function(){return oR},QtiOutcomeProcessing:function(){return iH},QtiOutcomeProcessingProcessor:function(){return iQ},QtiPortableCustomInteraction:function(){return ig},QtiPositionObjectInteraction:function(){return ib},QtiPositionObjectStage:function(){return i_},QtiPrintedVariable:function(){return oy},QtiProduct:function(){return om},QtiPrompt:function(){return iF},QtiRandom:function(){return ox},QtiResponseCondition:function(){return iG},QtiResponseDeclaration:function(){return oP},QtiResponseElse:function(){return i0},QtiResponseElseIf:function(){return i2},QtiResponseIf:function(){return i1},QtiResponseProcessing:function(){return iY},QtiRubricBlock:function(){return oC},QtiRule:function(){return iX},QtiSelectPointInteraction:function(){return iw},QtiSetOutcomeValue:function(){return iK},QtiSetOutcomeValueRule:function(){return iZ},QtiSimpleAssociableChoice:function(){return id},QtiSimpleChoice:function(){return iA},QtiSliderInteraction:function(){return iq},QtiStringMatch:function(){return ob},QtiStylesheet:function(){return oq},QtiSubtract:function(){return og},QtiSum:function(){return o_},QtiSumExpression:function(){return ok},QtiTextEntryInteraction:function(){return iN},QtiUploadInteraction:function(){return iD},QtiVariable:function(){return oE},qtiAndMixin:function(){return eP},qtiSubtractMixin:function(){return eM}});var eQ=/*#__PURE__*/function(t){"use strict";v(e,t);function e(t,n,r){s(this,e);var i;i=a(this,e,["context-request",{bubbles:!0,composed:!0}]),i.context=t,i.callback=n,i.subscribe=r!==null&&r!==void 0?r:!1;return i}return e}(I(Event));var eF=/*#__PURE__*/function(){"use strict";function t(e,n,r,i){var o=this;s(this,t);if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=function(t,e){o.unsubscribe&&(o.unsubscribe!==e&&(o.provided=!1,o.unsubscribe()),o.subscribe||o.unsubscribe()),o.value=t,o.host.requestUpdate(),o.provided&&!o.subscribe||(o.provided=!0,o.callback&&o.callback(t,e)),o.unsubscribe=e},this.host=e,n.context!==void 0){var a=n;var l;this.context=a.context,this.callback=a.callback,this.subscribe=(l=a.subscribe)!==null&&l!==void 0?l:!1}else this.context=n,this.callback=r,this.subscribe=i!==null&&i!==void 0?i:!1;this.host.addController(this)}c(t,[{key:"hostConnected",value:function t(){this.dispatchRequest()}},{key:"hostDisconnected",value:function t(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}},{key:"dispatchRequest",value:function t(){this.host.dispatchEvent(new eQ(this.context,this.t,this.subscribe))}}]);return t}();var ez=/*#__PURE__*/function(){"use strict";function t(e){var n=this;s(this,t);this.subscriptions=new Map,this.updateObservers=function(){var t=true,e=false,r=undefined;try{for(var i=n.subscriptions[Symbol.iterator](),o;!(t=(o=i.next()).done);t=true){var a=S(o.value,2),s=a[0],l=a[1],u=l.disposer;s(n.o,u)}}catch(t){e=true;r=t}finally{try{if(!t&&i.return!=null){i.return()}}finally{if(e){throw r}}}},e!==void 0&&(this.value=e)}c(t,[{key:"value",get:function t(){return this.o},set:function t(t){this.setValue(t)}},{key:"setValue",value:function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;var n=e||!Object.is(t,this.o);this.o=t,n&&this.updateObservers()}},{key:"addCallback",value:function t(t,e,n){var r=this;if(!n)return void t(this.value);this.subscriptions.has(t)||this.subscriptions.set(t,{disposer:function(){r.subscriptions.delete(t)},consumerHost:e});var i=this.subscriptions.get(t),o=i.disposer;t(this.value,o)}},{key:"clearCallbacks",value:function t(){this.subscriptions.clear()}}]);return t}();var eB=/*#__PURE__*/function(t){"use strict";v(e,t);function e(t){s(this,e);var n;n=a(this,e,["context-provider",{bubbles:!0,composed:!0}]),n.context=t;return n}return e}(I(Event)),eW=/*#__PURE__*/function(t){"use strict";v(e,t);function e(t,n,r){s(this,e);var i;var o,l;i=a(this,e,[n.context!==void 0?n.initialValue:r]),i.onContextRequest=function(t){var e=t.composedPath()[0];t.context===i.context&&e!==i.host&&(t.stopPropagation(),i.addCallback(t.callback,e,t.subscribe))},i.onProviderRequest=function(t){var e=t.composedPath()[0];if(t.context!==i.context||e===i.host)return;var n=new Set;var r=true,o=false,a=undefined;try{for(var s=i.subscriptions[Symbol.iterator](),l;!(r=(l=s.next()).done);r=true){var u=S(l.value,2),c=u[0],d=u[1],h=d.consumerHost;n.has(c)||(n.add(c),h.dispatchEvent(new eQ(i.context,c,!0)))}}catch(t){o=true;a=t}finally{try{if(!r&&s.return!=null){s.return()}}finally{if(o){throw a}}}t.stopPropagation()},i.host=t,n.context!==void 0?i.context=n.context:i.context=n,i.attachListeners(),(o=(l=i.host).addController)===null||o===void 0?void 0:o.call(l,i);return i}c(e,[{key:"attachListeners",value:function t(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}},{key:"hostConnected",value:function t(){this.host.dispatchEvent(new eB(this.context))}}]);return e}(ez);var eY=/*#__PURE__*/function(){"use strict";function t(e){s(this,t);this.ariaAtomic="",this.ariaAutoComplete="",this.ariaBrailleLabel="",this.ariaBrailleRoleDescription="",this.ariaBusy="",this.ariaChecked="",this.ariaColCount="",this.ariaColIndex="",this.ariaColSpan="",this.ariaCurrent="",this.ariaDescription="",this.ariaDisabled="",this.ariaExpanded="",this.ariaHasPopup="",this.ariaHidden="",this.ariaInvalid="",this.ariaKeyShortcuts="",this.ariaLabel="",this.ariaLevel="",this.ariaLive="",this.ariaModal="",this.ariaMultiLine="",this.ariaMultiSelectable="",this.ariaOrientation="",this.ariaPlaceholder="",this.ariaPosInSet="",this.ariaPressed="",this.ariaReadOnly="",this.ariaRequired="",this.ariaRoleDescription="",this.ariaRowCount="",this.ariaRowIndex="",this.ariaRowSpan="",this.ariaSelected="",this.ariaSetSize="",this.ariaSort="",this.ariaValueMax="",this.ariaValueMin="",this.ariaValueNow="",this.ariaValueText="",this.role="",this.form=null,this.labels=[],this.states=new Set,this.validationMessage="",this.validity={},this.willValidate=!0,this.__host=e}c(t,[{key:"shadowRoot",get:function t(){return this.__host.__shadowRoot}},{key:"checkValidity",value:function t(){return console.warn("`ElementInternals.checkValidity()` was called on the server.This method always returns true."),!0}},{key:"reportValidity",value:function t(){return!0}},{key:"setFormValue",value:function t(){}},{key:"setValidity",value:function t(){}}]);return t}();var eX=new WeakMap,eJ=function(t){var e=eX.get(t);return e===void 0&&eX.set(t,e=new Map),e},eG=/*#__PURE__*/function(){"use strict";function t(){s(this,t);this.__shadowRootMode=null,this.__shadowRoot=null,this.__internals=null}c(t,[{key:"attributes",get:function t(){return Array.from(eJ(this)).map(function(t){var e=S(t,2),n=e[0],r=e[1];return{name:n,value:r}})}},{key:"shadowRoot",get:function t(){return this.__shadowRootMode==="closed"?null:this.__shadowRoot}},{key:"localName",get:function t(){return this.constructor.__localName}},{key:"tagName",get:function t(){var t;return(t=this.localName)===null||t===void 0?void 0:t.toUpperCase()}},{key:"setAttribute",value:function t(t,e){eJ(this).set(t,String(e))}},{key:"removeAttribute",value:function t(t){eJ(this).delete(t)}},{key:"toggleAttribute",value:function t(t,e){if(this.hasAttribute(t)){if(e===void 0||!e)return this.removeAttribute(t),!1}else return e===void 0||e?(this.setAttribute(t,""),!0):!1;return!0}},{key:"hasAttribute",value:function t(t){return eJ(this).has(t)}},{key:"attachShadow",value:function t(t){var e={host:this};return this.__shadowRootMode=t.mode,t&&t.mode==="open"&&(this.__shadowRoot=e),e}},{key:"attachInternals",value:function t(){if(this.__internals!==null)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");var t=new eY(this);return this.__internals=t,t}},{key:"getAttribute",value:function t(t){var e;return(e=eJ(this).get(t))!==null&&e!==void 0?e:null}}]);return t}();var eK=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}return e}(eG),eZ=eK;var e0=/*#__PURE__*/function(){"use strict";function t(){s(this,t);this.__definitions=new Map}c(t,[{key:"define",value:function t(t,e){if(this.__definitions.has(t))if(process.env.NODE_ENV==="development")console.warn("'CustomElementRegistry' already has \"".concat(t,'" defined. This may have been caused by live reload or hot module replacement in which case it can be safely ignored.\nMake sure to test your application with a production build as repeat registrations will throw in production.'));else throw new Error("Failed to execute 'define' on 'CustomElementRegistry': the name \"".concat(t,'" has already been used with this registry'));var n;e.__localName=t,this.__definitions.set(t,{ctor:e,observedAttributes:(n=e.observedAttributes)!==null&&n!==void 0?n:[]})}},{key:"get",value:function t(t){var e;return(e=this.__definitions.get(t))===null||e===void 0?void 0:e.ctor}}]);return t}(),e1=e0;var e2=new e1;var e3=globalThis,e5=e3.ShadowRoot&&(e3.ShadyCSS===void 0||e3.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,e4=Symbol(),e6=new WeakMap,e9=/*#__PURE__*/function(){"use strict";function t(e,n,r){s(this,t);if(this._$cssResult$=!0,r!==e4)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=n}c(t,[{key:"styleSheet",get:function t(){var t=this.o,e=this.t;if(e5&&t===void 0){var n=e!==void 0&&e.length===1;n&&(t=e6.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),n&&e6.set(e,t))}return t}},{key:"toString",value:function t(){return this.cssText}}]);return t}(),e7=function(t){return new e9(typeof t=="string"?t:t+"",void 0,e4)},e8=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++){n[r-1]=arguments[r]}var i=t.length===1?t[0]:n.reduce(function(e,n,r){return e+function(t){if(t._$cssResult$===!0)return t.cssText;if(typeof t=="number")return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")}(n)+t[r+1]},t[0]);return new e9(i,t,e4)},nt=function(t,e){var n=true,r=false,i=undefined;if(e5)t.adoptedStyleSheets=e.map(function(t){return p(t,CSSStyleSheet)?t:t.styleSheet});else try{for(var o=e[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){var s=a.value;var l=document.createElement("style"),u=e3.litNonce;u!==void 0&&l.setAttribute("nonce",u),l.textContent=s.cssText,t.appendChild(l)}}catch(t){r=true;i=t}finally{try{if(!n&&o.return!=null){o.return()}}finally{if(r){throw i}}}},ne=e5||e3.CSSStyleSheet===void 0?function(t){return t}:function(t){return p(t,CSSStyleSheet)?function(t){var e="";var n=true,r=false,i=undefined;try{for(var o=t.cssRules[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){var s=a.value;e+=s.cssText}}catch(t){r=true;i=t}finally{try{if(!n&&o.return!=null){o.return()}}finally{if(r){throw i}}}return e7(e)}(t):t};var nn=Object.is,nr=Object.defineProperty,ni=Object.getOwnPropertyDescriptor,no=Object.getOwnPropertyNames,na=Object.getOwnPropertySymbols,ns=Object.getPrototypeOf,nl=globalThis;var nu;(nu=nl.customElements)!==null&&nu!==void 0?nu:nl.customElements=e2;var nc=nl.trustedTypes,nd=nc?nc.emptyScript:"",nh=nl.reactiveElementPolyfillSupport,nf=function(t,e){return t},nv={toAttribute:function t(t,e){switch(e){case Boolean:t=t?nd:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute:function t(t,e){var n=t;switch(e){case Boolean:n=t!==null;break;case Number:n=t===null?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch(t){n=null}}return n}},np=function(t,e){return!nn(t,e)},ny={attribute:!0,type:String,converter:nv,reflect:!1,hasChanged:np};var nm,ng;(nm=Symbol.metadata)!==null&&nm!==void 0?nm:Symbol.metadata=Symbol("metadata"),(ng=nl.litPropertyMetadata)!==null&&ng!==void 0?ng:nl.litPropertyMetadata=new WeakMap;var nb;var n_=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e),t._$Ep=void 0,t.isUpdatePending=!1,t.hasUpdated=!1,t._$Em=null,t._$Ev();return t}c(e,[{key:"_$Ev",value:function t(){var t=this;var e;this._$ES=new Promise(function(e){return t.enableUpdating=e}),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)===null||e===void 0?void 0:e.forEach(function(e){return e(t)})}},{key:"addController",value:function t(t){var e;var n;((n=this._$EO)!==null&&n!==void 0?n:this._$EO=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)===null||e===void 0?void 0:e.call(t))}},{key:"removeController",value:function t(t){var e;(e=this._$EO)===null||e===void 0?void 0:e.delete(t)}},{key:"_$E_",value:function t(){var t=new Map,e=this.constructor.elementProperties;var n=true,r=false,i=undefined;try{for(var o=e.keys()[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){var s=a.value;this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s])}}catch(t){r=true;i=t}finally{try{if(!n&&o.return!=null){o.return()}}finally{if(r){throw i}}}t.size>0&&(this._$Ep=t)}},{key:"createRenderRoot",value:function t(){var t;var e=(t=this.shadowRoot)!==null&&t!==void 0?t:this.attachShadow(this.constructor.shadowRootOptions);return nt(e,this.constructor.elementStyles),e}},{key:"connectedCallback",value:function t(){var t;var e;(e=this.renderRoot)!==null&&e!==void 0?e:this.renderRoot=this.createRenderRoot(),this.enableUpdating(!0),(t=this._$EO)===null||t===void 0?void 0:t.forEach(function(t){var e;return(e=t.hostConnected)===null||e===void 0?void 0:e.call(t)})}},{key:"enableUpdating",value:function t(t){}},{key:"disconnectedCallback",value:function t(){var t;(t=this._$EO)===null||t===void 0?void 0:t.forEach(function(t){var e;return(e=t.hostDisconnected)===null||e===void 0?void 0:e.call(t)})}},{key:"attributeChangedCallback",value:function t(t,e,n){this._$AK(t,n)}},{key:"_$EC",value:function t(t,e){var n=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,n);if(r!==void 0&&n.reflect===!0){var i;var o=(((i=n.converter)===null||i===void 0?void 0:i.toAttribute)!==void 0?n.converter:nv).toAttribute(e,n.type);this._$Em=t,o==null?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}},{key:"_$AK",value:function t(t,e){var n=this.constructor,r=n._$Eh.get(t);if(r!==void 0&&this._$Em!==r){var i;var o=n.getPropertyOptions(r),a=typeof o.converter=="function"?{fromAttribute:o.converter}:((i=o.converter)===null||i===void 0?void 0:i.fromAttribute)!==void 0?o.converter:nv;this._$Em=r,this[r]=a.fromAttribute(e,o.type),this._$Em=null}}},{key:"requestUpdate",value:function t(t,e,n){if(t!==void 0){var r;if(n!==null&&n!==void 0?n:n=this.constructor.getPropertyOptions(t),!((r=n.hasChanged)!==null&&r!==void 0?r:np)(this[t],e))return;this.P(t,e,n)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}},{key:"P",value:function t(t,e,n){var r;this._$AL.has(t)||this._$AL.set(t,e),n.reflect===!0&&this._$Em!==t&&((r=this._$Ej)!==null&&r!==void 0?r:this._$Ej=new Set).add(t)}},{key:"_$ET",value:function t(){var t=this;return o(function(){var e,n,r;return L(this,function(i){switch(i.label){case 0:t.isUpdatePending=!0;i.label=1;case 1:i.trys.push([1,3,,4]);return[4,t._$ES];case 2:i.sent();return[3,4];case 3:e=i.sent();Promise.reject(e);return[3,4];case 4:n=t.scheduleUpdate();r=n!=null;if(!r)return[3,6];return[4,n];case 5:r=i.sent();i.label=6;case 6:return[2,(r,!t.isUpdatePending)]}})})()}},{key:"scheduleUpdate",value:function t(){return this.performUpdate()}},{key:"performUpdate",value:function t(){if(!this.isUpdatePending)return;if(!this.hasUpdated){var t;if((t=this.renderRoot)!==null&&t!==void 0?t:this.renderRoot=this.createRenderRoot(),this._$Ep){var e=true,n=false,r=undefined;try{for(var i=this._$Ep[Symbol.iterator](),o;!(e=(o=i.next()).done);e=true){var a=S(o.value,2),s=a[0],l=a[1];this[s]=l}}catch(t){n=true;r=t}finally{try{if(!e&&i.return!=null){i.return()}}finally{if(n){throw r}}}this._$Ep=void 0}var u=this.constructor.elementProperties;var c=true,d=false,h=undefined;if(u.size>0)try{for(var f=u[Symbol.iterator](),v;!(c=(v=f.next()).done);c=true){var p=S(v.value,2),y=p[0],m=p[1];m.wrapped!==!0||this._$AL.has(y)||this[y]===void 0||this.P(y,this[y],m)}}catch(t){d=true;h=t}finally{try{if(!c&&f.return!=null){f.return()}}finally{if(d){throw h}}}}var g=!1,b=this._$AL;try{var _;g=this.shouldUpdate(b),g?(this.willUpdate(b),(_=this._$EO)===null||_===void 0?void 0:_.forEach(function(t){var e;return(e=t.hostUpdate)===null||e===void 0?void 0:e.call(t)}),this.update(b)):this._$EU()}catch(t){throw g=!1,this._$EU(),t}g&&this._$AE(b)}},{key:"willUpdate",value:function t(t){}},{key:"_$AE",value:function t(t){var e;(e=this._$EO)===null||e===void 0?void 0:e.forEach(function(t){var e;return(e=t.hostUpdated)===null||e===void 0?void 0:e.call(t)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}},{key:"_$EU",value:function t(){this._$AL=new Map,this.isUpdatePending=!1}},{key:"updateComplete",get:function t(){return this.getUpdateComplete()}},{key:"getUpdateComplete",value:function t(){return this._$ES}},{key:"shouldUpdate",value:function t(t){return!0}},{key:"update",value:function t(t){var e=this;this._$Ej&&(this._$Ej=this._$Ej.forEach(function(t){return e._$EC(t,e[t])})),this._$EU()}},{key:"updated",value:function t(t){}},{key:"firstUpdated",value:function t(t){}}],[{key:"addInitializer",value:function t(t){var e;this._$Ei(),((e=this.l)!==null&&e!==void 0?e:this.l=[]).push(t)}},{key:"observedAttributes",get:function t(){return this.finalize(),this._$Eh&&T(this._$Eh.keys())}},{key:"createProperty",value:function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ny;if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){var n=Symbol(),r=this.getPropertyDescriptor(t,n,e);r!==void 0&&nr(this.prototype,t,r)}}},{key:"getPropertyDescriptor",value:function t(t,e,n){var r;var i=(r=ni(this.prototype,t))!==null&&r!==void 0?r:{get:function t(){return this[e]},set:function t(t){this[e]=t}},o=i.get,a=i.set;return{get:function t(){return o===null||o===void 0?void 0:o.call(this)},set:function e(e){var r=o===null||o===void 0?void 0:o.call(this);a.call(this,e),this.requestUpdate(t,r,n)},configurable:!0,enumerable:!0}}},{key:"getPropertyOptions",value:function t(t){var e;return(e=this.elementProperties.get(t))!==null&&e!==void 0?e:ny}},{key:"_$Ei",value:function t(){if(this.hasOwnProperty(nf("elementProperties")))return;var t=ns(this);t.finalize(),t.l!==void 0&&(this.l=T(t.l)),this.elementProperties=new Map(t.elementProperties)}},{key:"finalize",value:function t(){if(this.hasOwnProperty(nf("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(nf("properties"))){var t=this.properties,e=T(no(t)).concat(T(na(t)));var n=true,r=false,i=undefined;try{for(var o=e[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){var s=a.value;this.createProperty(s,t[s])}}catch(t){r=true;i=t}finally{try{if(!n&&o.return!=null){o.return()}}finally{if(r){throw i}}}}var l=this[Symbol.metadata];if(l!==null){var u=litPropertyMetadata.get(l);var c=true,d=false,h=undefined;if(u!==void 0)try{for(var f=u[Symbol.iterator](),v;!(c=(v=f.next()).done);c=true){var p=S(v.value,2),y=p[0],m=p[1];this.elementProperties.set(y,m)}}catch(t){d=true;h=t}finally{try{if(!c&&f.return!=null){f.return()}}finally{if(d){throw h}}}}this._$Eh=new Map;var g=true,b=false,_=undefined;try{for(var k=this.elementProperties[Symbol.iterator](),E;!(g=(E=k.next()).done);g=true){var x=S(E.value,2),w=x[0],A=x[1];var C=this._$Eu(w,A);C!==void 0&&this._$Eh.set(C,w)}}catch(t){b=true;_=t}finally{try{if(!g&&k.return!=null){k.return()}}finally{if(b){throw _}}}this.elementStyles=this.finalizeStyles(this.styles)}},{key:"finalizeStyles",value:function t(t){var e=[];if(Array.isArray(t)){var n=new Set(t.flat(1/0).reverse());var r=true,i=false,o=undefined;try{for(var a=n[Symbol.iterator](),s;!(r=(s=a.next()).done);r=true){var l=s.value;e.unshift(ne(l))}}catch(t){i=true;o=t}finally{try{if(!r&&a.return!=null){a.return()}}finally{if(i){throw o}}}}else t!==void 0&&e.push(ne(t));return e}},{key:"_$Eu",value:function t(t,e){var n=e.attribute;return n===!1?void 0:typeof n=="string"?n:typeof t=="string"?t.toLowerCase():void 0}}]);return e}((nb=globalThis.HTMLElement)!==null&&nb!==void 0?nb:eZ);var nk;n_.elementStyles=[],n_.shadowRootOptions={mode:"open"},n_[nf("elementProperties")]=new Map,n_[nf("finalized")]=new Map,nh===null||nh===void 0?void 0:nh({ReactiveElement:n_}),((nk=nl.reactiveElementVersions)!==null&&nk!==void 0?nk:nl.reactiveElementVersions=[]).push("2.0.4");var nE=globalThis,nx=nE.trustedTypes,nw=nx?nx.createPolicy("lit-html",{createHTML:function(t){return t}}):void 0,nA="$lit$",nC="lit$".concat(Math.random().toFixed(9).slice(2),"$"),nq="?"+nC,nS="<".concat(nq,">"),nR=nE.document===void 0?{createTreeWalker:function(){return{}}}:document,nP=function(){return nR.createComment("")},nM=function(t){return t===null||(typeof t==="undefined"?"undefined":O(t))!="object"&&typeof t!="function"},nT=Array.isArray,nO=function(t){return nT(t)||typeof(t===null||t===void 0?void 0:t[Symbol.iterator])=="function"},n$="[ \n\f\r]",nI=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,nU=/-->/g,nL=/>/g,nN=RegExp(">|".concat(n$,"(?:([^\\s\"'>=/]+)(").concat(n$,"*=").concat(n$,"*(?:[^ \n\f\r\"'`<>=]|(\"|')|))|$)"),"g"),nD=/'/g,nV=/"/g,nj=/^(?:script|style|textarea|title)$/i,nH=function(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++){r[i-1]=arguments[i]}return{_$litType$:t,strings:e,values:r}}},nQ=nH(1),nF=nH(2),nz=nH(3),nB=Symbol.for("lit-noChange"),nW=Symbol.for("lit-nothing"),nY=new WeakMap,nX=nR.createTreeWalker(nR,129);var nJ=function(t,e){var r=t.length-1,i=[],o,a=e===2?"<svg>":e===3?"<math>":"",s=nI;for(var l=0;l<r;l++){var u=t[l],c=void 0,d=void 0,h=-1,f=0;for(;f<u.length&&(s.lastIndex=f,d=s.exec(u),d!==null);)f=s.lastIndex,s===nI?d[1]==="!--"?s=nU:d[1]!==void 0?s=nL:d[2]!==void 0?(nj.test(d[2])&&(o=RegExp("</"+d[2],"g")),s=nN):d[3]!==void 0&&(s=nN):s===nN?d[0]===">"?(s=o!==null&&o!==void 0?o:nI,h=-1):d[1]===void 0?h=-2:(h=s.lastIndex-d[2].length,c=d[1],s=d[3]===void 0?nN:d[3]==='"'?nV:nD):s===nV||s===nD?s=nN:s===nU||s===nL?s=nI:(s=nN,o=void 0);var v=s===nN&&t[l+1].startsWith("/>")?" ":"";a+=s===nI?u+nS:h>=0?(i.push(c),u.slice(0,h)+nA+u.slice(h)+nC+v):u+nC+(h===-2?l:v)}return[n(t,a+(t[r]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]},nG=/*#__PURE__*/function(){"use strict";function t(e,n){var r=e.strings,i=e._$litType$;s(this,t);var o;this.parts=[];var a=0,l=0,u=r.length-1,c=this.parts,d=S(nJ(r,i),2),h=d[0],f=d[1];if(this.el=t.createElement(h,n),nX.currentNode=this.el.content,i===2||i===3){var v;var p=this.el.content.firstChild;(v=p).replaceWith.apply(v,T(p.childNodes))}for(;(o=nX.nextNode())!==null&&c.length<u;){if(o.nodeType===1){var y=true,m=false,g=undefined;if(o.hasAttributes())try{for(var b=o.getAttributeNames()[Symbol.iterator](),_;!(y=(_=b.next()).done);y=true){var k=_.value;if(k.endsWith(nA)){var E=f[l++],x=o.getAttribute(k).split(nC),w=/([.?@])?(.*)/.exec(E);c.push({type:1,index:a,name:w[2],strings:x,ctor:w[1]==="."?n2:w[1]==="?"?n3:w[1]==="@"?n5:n1}),o.removeAttribute(k)}else k.startsWith(nC)&&(c.push({type:6,index:a}),o.removeAttribute(k))}}catch(t){m=true;g=t}finally{try{if(!y&&b.return!=null){b.return()}}finally{if(m){throw g}}}if(nj.test(o.tagName)){var A=o.textContent.split(nC),C=A.length-1;if(C>0){o.textContent=nx?nx.emptyScript:"";for(var q=0;q<C;q++)o.append(A[q],nP()),nX.nextNode(),c.push({type:2,index:++a});o.append(A[C],nP())}}}else if(o.nodeType===8)if(o.data===nq)c.push({type:2,index:a});else{var R=-1;for(;(R=o.data.indexOf(nC,R+1))!==-1;)c.push({type:7,index:a}),R+=nC.length-1}a++}}c(t,null,[{key:"createElement",value:function t(t,e){var n=nR.createElement("template");return n.innerHTML=t,n}}]);return t}();function nK(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t,r=arguments.length>3?arguments[3]:void 0;var i,o;if(e===nB)return e;var a=r!==void 0?(i=n._$Co)===null||i===void 0?void 0:i[r]:n._$Cl,s=nM(e)?void 0:e._$litDirective$;var l;return(a===null||a===void 0?void 0:a.constructor)!==s&&(a===null||a===void 0?void 0:(o=a._$AO)===null||o===void 0?void 0:o.call(a,!1),s===void 0?a=void 0:(a=new s(t),a._$AT(t,n,r)),r!==void 0?((l=n._$Co)!==null&&l!==void 0?l:n._$Co=[])[r]=a:n._$Cl=a),a!==void 0&&(e=nK(t,a._$AS(t,e.values),a,r)),e}var nZ=/*#__PURE__*/function(){"use strict";function t(e,n){s(this,t);this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=n}c(t,[{key:"parentNode",get:function t(){return this._$AM.parentNode}},{key:"_$AU",get:function t(){return this._$AM._$AU}},{key:"u",value:function t(t){var e;var n=this._$AD,r=n.el,i=r.content,o=n.parts,a=((e=t===null||t===void 0?void 0:t.creationScope)!==null&&e!==void 0?e:nR).importNode(i,!0);nX.currentNode=a;var s=nX.nextNode(),l=0,u=0,c=o[0];for(;c!==void 0;){if(l===c.index){var d=void 0;c.type===2?d=new n0(s,s.nextSibling,this,t):c.type===1?d=new c.ctor(s,c.name,c.strings,this,t):c.type===6&&(d=new n4(s,this,t)),this._$AV.push(d),c=o[++u]}l!==(c===null||c===void 0?void 0:c.index)&&(s=nX.nextNode(),l++)}return nX.currentNode=nR,a}},{key:"p",value:function t(t){var e=0;var n=true,r=false,i=undefined;try{for(var o=this._$AV[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){var s=a.value;s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}catch(t){r=true;i=t}finally{try{if(!n&&o.return!=null){o.return()}}finally{if(r){throw i}}}}}]);return t}(),n0=/*#__PURE__*/function(){"use strict";function t(e,n,r,i){s(this,t);var o;this.type=2,this._$AH=nW,this._$AN=void 0,this._$AA=e,this._$AB=n,this._$AM=r,this.options=i,this._$Cv=(o=i===null||i===void 0?void 0:i.isConnected)!==null&&o!==void 0?o:!0}c(t,[{key:"_$AU",get:function t(){var t;var e;return(e=(t=this._$AM)===null||t===void 0?void 0:t._$AU)!==null&&e!==void 0?e:this._$Cv}},{key:"parentNode",get:function t(){var t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&(t===null||t===void 0?void 0:t.nodeType)===11&&(t=e.parentNode),t}},{key:"startNode",get:function t(){return this._$AA}},{key:"endNode",get:function t(){return this._$AB}},{key:"_$AI",value:function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this;t=nK(this,t,e),nM(t)?t===nW||t==null||t===""?(this._$AH!==nW&&this._$AR(),this._$AH=nW):t!==this._$AH&&t!==nB&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):nO(t)?this.k(t):this._(t)}},{key:"O",value:function t(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}},{key:"T",value:function t(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}},{key:"_",value:function t(t){this._$AH!==nW&&nM(this._$AH)?this._$AA.nextSibling.data=t:this.T(nR.createTextNode(t)),this._$AH=t}},{key:"$",value:function t(t){var e;var r=t.values,i=t._$litType$,o=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=nG.createElement(n(i.h,i.h[0]),this.options)),i);if(((e=this._$AH)===null||e===void 0?void 0:e._$AD)===o)this._$AH.p(r);else{var a=new nZ(o,this),s=a.u(this.options);a.p(r),this.T(s),this._$AH=a}}},{key:"_$AC",value:function t(t){var e=nY.get(t.strings);return e===void 0&&nY.set(t.strings,e=new nG(t)),e}},{key:"k",value:function e(e){nT(this._$AH)||(this._$AH=[],this._$AR());var n=this._$AH,r,i=0;var o=true,a=false,s=undefined;try{for(var l=e[Symbol.iterator](),u;!(o=(u=l.next()).done);o=true){var c=u.value;i===n.length?n.push(r=new t(this.O(nP()),this.O(nP()),this,this.options)):r=n[i],r._$AI(c),i++}}catch(t){a=true;s=t}finally{try{if(!o&&l.return!=null){l.return()}}finally{if(a){throw s}}}i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}},{key:"_$AR",value:function t(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this._$AA.nextSibling,e=arguments.length>1?arguments[1]:void 0;var n,r;for((n=(r=this)._$AP)===null||n===void 0?void 0:n.call(r,!1,!0,e);t&&t!==this._$AB;){var i=t.nextSibling;t.remove(),t=i}}},{key:"setConnected",value:function t(t){var e,n;this._$AM===void 0&&(this._$Cv=t,(e=(n=this)._$AP)===null||e===void 0?void 0:e.call(n,t))}}]);return t}(),n1=/*#__PURE__*/function(){"use strict";function t(e,n,r,i,o){s(this,t);this.type=1,this._$AH=nW,this._$AN=void 0,this.element=e,this.name=n,this._$AM=i,this.options=o,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=nW}c(t,[{key:"tagName",get:function t(){return this.element.tagName}},{key:"_$AU",get:function t(){return this._$AM._$AU}},{key:"_$AI",value:function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;var i=this.strings,o=!1;if(i===void 0)t=nK(this,t,e,0),o=!nM(t)||t!==this._$AH&&t!==nB,o&&(this._$AH=t);else{var a=t,s,l;for(t=i[0],s=0;s<i.length-1;s++)l=nK(this,a[n+s],e,s),l===nB&&(l=this._$AH[s]),o||(o=!nM(l)||l!==this._$AH[s]),l===nW?t=nW:t!==nW&&(t+=(l!==null&&l!==void 0?l:"")+i[s+1]),this._$AH[s]=l}o&&!r&&this.j(t)}},{key:"j",value:function t(t){t===nW?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t!==null&&t!==void 0?t:"")}}]);return t}(),n2=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments),t.type=3;return t}c(e,[{key:"j",value:function t(t){this.element[this.name]=t===nW?void 0:t}}]);return e}(n1),n3=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments),t.type=4;return t}c(e,[{key:"j",value:function t(t){this.element.toggleAttribute(this.name,!!t&&t!==nW)}}]);return e}(n1),n5=/*#__PURE__*/function(t){"use strict";v(e,t);function e(t,n,r,i,o){s(this,e);var l;l=a(this,e,[t,n,r,i,o]),l.type=5;return l}c(e,[{key:"_$AI",value:function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this;var n;if((t=(n=nK(this,t,e,0))!==null&&n!==void 0?n:nW)===nB)return;var r=this._$AH,i=t===nW&&r!==nW||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,o=t!==nW&&(r===nW||i);i&&this.element.removeEventListener(this.name,this,r),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}},{key:"handleEvent",value:function t(t){var e;var n;typeof this._$AH=="function"?this._$AH.call((n=(e=this.options)===null||e===void 0?void 0:e.host)!==null&&n!==void 0?n:this.element,t):this._$AH.handleEvent(t)}}]);return e}(n1),n4=/*#__PURE__*/function(){"use strict";function t(e,n,r){s(this,t);this.element=e,this.type=6,this._$AN=void 0,this._$AM=n,this.options=r}c(t,[{key:"_$AU",get:function t(){return this._$AM._$AU}},{key:"_$AI",value:function t(t){nK(this,t)}}]);return t}(),n6={M:nA,P:nC,A:nq,C:1,L:nJ,R:nZ,D:nO,V:nK,I:n0,H:n1,N:n3,U:n5,B:n2,F:n4},n9=nE.litHtmlPolyfillSupport;var n7;n9===null||n9===void 0?void 0:n9(nG,n0),((n7=nE.litHtmlVersions)!==null&&n7!==void 0?n7:nE.litHtmlVersions=[]).push("3.2.1");var n8=function(t,e,n){var r;var i=(r=n===null||n===void 0?void 0:n.renderBefore)!==null&&r!==void 0?r:e,o=i._$litPart$;if(o===void 0){var a;var s=(a=n===null||n===void 0?void 0:n.renderBefore)!==null&&a!==void 0?a:null;i._$litPart$=o=new n0(e.insertBefore(nP(),s),s,void 0,n!==null&&n!==void 0?n:{})}return o._$AI(t),o};var rt=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments),t.renderOptions={host:t},t._$Do=void 0;return t}c(e,[{key:"createRenderRoot",value:function t(){var t;var n=h(f(e.prototype),"createRenderRoot",this).call(this);var r;return(r=(t=this.renderOptions).renderBefore)!==null&&r!==void 0?r:t.renderBefore=n.firstChild,n}},{key:"update",value:function t(t){var n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),h(f(e.prototype),"update",this).call(this,t),this._$Do=n8(n,this.renderRoot,this.renderOptions)}},{key:"connectedCallback",value:function t(){var t;h(f(e.prototype),"connectedCallback",this).call(this),(t=this._$Do)===null||t===void 0?void 0:t.setConnected(!0)}},{key:"disconnectedCallback",value:function t(){var t;h(f(e.prototype),"disconnectedCallback",this).call(this),(t=this._$Do)===null||t===void 0?void 0:t.setConnected(!1)}},{key:"render",value:function t(){return nB}}]);return e}(n_);rt._$litElement$=!0,rt.finalized=!0,(eT=(eO=globalThis).litElementHydrateSupport)===null||eT===void 0?void 0:eT.call(eO,{LitElement:rt});var re=globalThis.litElementPolyfillSupport;re===null||re===void 0?void 0:re({LitElement:rt});var rn;((rn=globalThis.litElementVersions)!==null&&rn!==void 0?rn:globalThis.litElementVersions=[]).push("4.1.1");var rr=function(t){return function(e,n){n!==void 0?n.addInitializer(function(){customElements.define(t,e)}):customElements.define(t,e)}};var ri={attribute:!0,type:String,converter:nv,reflect:!1,hasChanged:np},ro=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ri,e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;var r=n.kind,i=n.metadata,o=globalThis.litPropertyMetadata.get(i);if(o===void 0&&globalThis.litPropertyMetadata.set(i,o=new Map),o.set(n.name,t),r==="accessor"){var a=n.name;return{set:function n(n){var r=e.get.call(this);e.set.call(this,n),this.requestUpdate(a,r,t)},init:function e(e){return e!==void 0&&this.P(a,void 0,t),e}}}if(r==="setter"){var s=n.name;return function n(n){var r=this[s];e.call(this,n),this.requestUpdate(s,r,t)}}throw Error("Unsupported decorator location: "+r)};var ra=function(t,e,n){return n.configurable=!0,n.enumerable=!0,Reflect.decorate&&(typeof e==="undefined"?"undefined":O(e))!="object"&&Object.defineProperty(t,e,n),n};var rs=Symbol("item");var rl=[{identifier:"completionStatus",cardinality:"single",baseType:"string",value:"unknown",type:"outcome"},{identifier:"numAttempts",cardinality:"single",baseType:"integer",value:"0",type:"response"}];var ru=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.identifier="";t.adaptive="false";t.timeDependent=null;t._handleDisabledChange=function(e,n){t._interactionElements.forEach(function(t){return t.disabled=n})};t._handleReadonlyChange=function(e,n){return t._interactionElements.forEach(function(t){return t.readonly=n})};t._context={identifier:t.getAttribute("identifier"),variables:rl};t._initialContext=x(k({},t._context),{variables:t._context.variables});t._feedbackElements=[];t._interactionElements=[];t._handleRegisterVariable=function(e){e.stopImmediatePropagation(),t._context=x(k({},t._context),{variables:T(t._context.variables).concat([e.detail.variable])}),t._initialContext=t._context,e.stopPropagation()};t._handleRegisterFeedback=function(e){var n;e.stopImmediatePropagation();var r=e.detail;t._feedbackElements.push(r),(Number((n=t._context.variables.find(function(t){return t.identifier==="numAttempts"}))===null||n===void 0?void 0:n.value)||0)>0&&r.checkShowFeedback(r.outcomeIdentifier)};t._handleRegisterInteraction=function(e){e.stopImmediatePropagation(),t._interactionElements.push(e.detail.interactionElement)};t._handleEndAttempt=function(e){e.stopImmediatePropagation();var n=e.detail,r=n.responseIdentifier,i=n.countAttempt;t.validate(),t.updateResponseVariable(r,"true"),t.processResponse(i)};t._handleSetOutcomeValue=function(e){e.stopImmediatePropagation();var n=e.detail,r=n.outcomeIdentifier,i=n.value;t.updateOutcomeVariable(r,i),e.stopPropagation()};t._handleUpdateResponseVariable=function(e){e.stopImmediatePropagation();var n=e.detail,r=n.responseIdentifier,i=n.response;t.updateResponseVariable(r,i),t._emit("qti-item-context-updated",{itemContext:t._context})};return t}c(e,[{key:"variables",get:function t(){return this._context.variables.map(function(t){return k({identifier:t.identifier,value:t.value,type:t.type},t.type==="outcome"&&t.identifier==="SCORE"?{externalScored:t.externalScored}:{})})},set:function t(t){var e=this;if(!Array.isArray(t)||t.some(function(t){return!("identifier"in t)})){console.warn("variables property should be an array of VariableDeclaration");return}this._context=x(k({},this._context),{variables:this._context.variables.map(function(e){var n=t.find(function(t){return t.identifier===e.identifier});return n?k({},e,n):e})}),this._context.variables.forEach(function(t){if(t.type==="response"){var n=e._interactionElements.find(function(e){return e.responseIdentifier===t.identifier});n&&(n.value=t.value)}})}},{key:"responses",set:function t(t){var e=true,n=false,r=undefined;if(t)try{var i,o=function(){var t=s.value;i.getResponse(t.responseIdentifier)&&i.updateResponseVariable(t.responseIdentifier,t.response);var e=i._interactionElements.find(function(e){return e.getAttribute("response-identifier")===t.responseIdentifier});e&&(e.value=t.response)};for(var a=t[Symbol.iterator](),s;!(e=(s=a.next()).done);e=true)i=this,o()}catch(t){n=true;r=t}finally{try{if(!e&&a.return!=null){a.return()}}finally{if(n){throw r}}}}},{key:"render",value:function t(){return nQ(D())}},{key:"connectedCallback",value:function t(){var t=this;this._attachEventListeners(),h(f(e.prototype),"connectedCallback",this).call(this),this.updateComplete.then(function(){t._emit("qti-assessment-item-connected",t)})}},{key:"disconnectedCallback",value:function t(){this._removeEventListeners(),h(f(e.prototype),"disconnectedCallback",this).call(this)}},{key:"_attachEventListeners",value:function t(){this.addEventListener("qti-register-variable",this._handleRegisterVariable),this.addEventListener("qti-register-feedback",this._handleRegisterFeedback),this.addEventListener("qti-register-interaction",this._handleRegisterInteraction),this.addEventListener("end-attempt",this._handleEndAttempt),this.addEventListener("qti-set-outcome-value",this._handleSetOutcomeValue),this.addEventListener("qti-interaction-response",this._handleUpdateResponseVariable)}},{key:"_removeEventListeners",value:function t(){this.removeEventListener("qti-register-variable",this._handleRegisterVariable),this.removeEventListener("qti-register-feedback",this._handleRegisterFeedback),this.removeEventListener("qti-register-interaction",this._handleRegisterInteraction),this.removeEventListener("end-attempt",this._handleEndAttempt),this.removeEventListener("qti-set-outcome-value",this._handleSetOutcomeValue),this.removeEventListener("qti-interaction-response",this._handleUpdateResponseVariable)}},{key:"showCorrectResponse",value:function t(t){var e=true,n=false,r=undefined;try{var i,o=function(){var e=s.value;var n=i._interactionElements.find(function(t){return t.getAttribute("response-identifier")===e.identifier});n&&n.toggleCorrectResponse(e,t)};for(var a=this._context.variables.filter(function(t){return t.type==="response"})[Symbol.iterator](),s;!(e=(s=a.next()).done);e=true)i=this,o()}catch(t){n=true;r=t}finally{try{if(!e&&a.return!=null){a.return()}}finally{if(n){throw r}}}}},{key:"processResponse",value:function t(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;var n;this.validate(e);var r=this.querySelector("qti-response-processing");return!r||!r.process?!1:(r.process(),this.adaptive==="false"&&this.updateOutcomeVariable("completionStatus",this._getCompletionStatus()),t&&this.updateOutcomeVariable("numAttempts",(+((n=this._context.variables.find(function(t){return t.identifier==="numAttempts"}))===null||n===void 0?void 0:n.value)+1).toString()),this._emit("qti-item-context-updated",{itemContext:this._context}),!0)}},{key:"resetResponses",value:function t(){this._context=this._initialContext}},{key:"getResponse",value:function t(t){return this.getVariable(t)}},{key:"getOutcome",value:function t(t){return this.getVariable(t)}},{key:"getVariable",value:function t(t){return this._context.variables.find(function(e){return e.identifier===t})||null}},{key:"updateResponseVariable",value:function t(t,e){this._context=x(k({},this._context),{variables:this._context.variables.map(function(n){return n.identifier!==t?n:x(k({},n),{value:e})})}),this._emit("qti-interaction-changed",{item:this.identifier,responseIdentifier:t,response:Array.isArray(e)?T(e):e}),this.adaptive==="false"&&this.updateOutcomeVariable("completionStatus",this._getCompletionStatus())}},{key:"updateOutcomeVariable",value:function t(t,e){var n;var r=this.getOutcome(t);if(!r){console.warn("Can not set qti-outcome-identifier: ".concat(t,", it is not available"));return}this._context=x(k({},this._context),{variables:this._context.variables.map(function(n){return n.identifier!==t?n:x(k({},n),{value:r.cardinality==="single"?e:T(n.value).concat([e])})})}),this._feedbackElements.forEach(function(e){return e.checkShowFeedback(t)}),this._emit("qti-outcome-changed",{item:this.identifier,outcomeIdentifier:t,value:(n=this._context.variables.find(function(e){return e.identifier===t}))===null||n===void 0?void 0:n.value})}},{key:"validate",value:function t(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this._interactionElements.every(function(t){return t.validate()})?!0:this._interactionElements.some(function(t){return t.validate()})?!1:(t&&this.reportValidity(),null)}},{key:"reportValidity",value:function t(){var t=true,e=false,n=undefined;try{for(var r=this._interactionElements[Symbol.iterator](),i;!(t=(i=r.next()).done);t=true){var o=i.value;o.reportValidity()}}catch(t){e=true;n=t}finally{try{if(!t&&r.return!=null){r.return()}}finally{if(e){throw n}}}}},{key:"_getCompletionStatus",value:function t(){var t=this.validate(!1);return t===!0?"completed":t===!1?"incomplete":"not_attempted"}},{key:"_emit",value:function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e}))}}]);return e}(rt);ej([r({type:String})],ru.prototype,"title",2),ej([r({type:String})],ru.prototype,"identifier",2),ej([r({type:String})],ru.prototype,"adaptive",2),ej([r({type:String})],ru.prototype,"timeDependent",2),ej([r({type:Boolean})],ru.prototype,"disabled",2),ej([d("disabled",{waitUntilFirstUpdate:!0})],ru.prototype,"_handleDisabledChange",2),ej([r({type:Boolean})],ru.prototype,"readonly",2),ej([d("readonly",{waitUntilFirstUpdate:!0})],ru.prototype,"_handleReadonlyChange",2),ej([t({context:rs})],ru.prototype,"_context",2),ru=ej([rr("qti-assessment-item")],ru);var rc=String.raw,rd=rc(V());var rh=null;var rf=function(){var t,e={load:function n(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return o(function(){return L(this,function(i){return[2,new Promise(function(i){b(n,r).then(function(r){return t=r,e.path(n.substring(0,n.lastIndexOf("/"))),i(e)})})]})})()},parse:function n(n){return t=_(n),e},path:function(n){return w(t,n),e},fn:function n(n){return n(t),e},pciHooks:function n(n){var r=["hook","module"],i=n.substring(0,n.lastIndexOf("/"));var o=true,a=false,s=undefined;try{var l=function(){var e=c.value;t.querySelectorAll("["+e+"]").forEach(function(t){var r=t.getAttribute(e);!r.startsWith("data:")&&!r.startsWith("http")&&(t.setAttribute("base-url",n),t.setAttribute("module",i+"/"+encodeURI(r+(r.endsWith(".js")?"":".js"))))})};for(var u=r[Symbol.iterator](),c;!(o=(c=u.next()).done);o=true)l()}catch(t){a=true;s=t}finally{try{if(!o&&u.return!=null){u.return()}}finally{if(a){throw s}}}return e},extendElementName:function(n,r){return y(t,n,r),e},extendElementsWithClass:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"extend";return m(t,n),e},customInteraction:function n(n,r){var i=t.querySelector("qti-custom-interaction"),o=i.querySelector("object");return i.setAttribute("data-base-ref",n),i.setAttribute("data-base-item",n+r),i.setAttribute("data",o.getAttribute("data")),i.setAttribute("width",o.getAttribute("width")),i.setAttribute("height",o.getAttribute("height")),i.removeChild(o),e},convertCDATAtoComment:function n(){return A(t),e},stripStyleSheets:function n(){return q(t),e},html:function e(){return new XMLSerializer().serializeToString(E(t))},xml:function e(){return new XMLSerializer().serializeToString(t)},htmlDoc:function e(){return E(t)},xmlDoc:function e(){return t}};return e};var rv=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.identifier="";t.href="";return t}c(e,[{key:"connectedCallback",value:function t(){var t=this;var n=this,r=function(){return h(f(e.prototype),"connectedCallback",t)};return o(function(){var t,e,i;return L(this,function(o){switch(o.label){case 0:r().call(n);t=new Event("qti-assessment-stimulus-ref-connected",{cancelable:!0,bubbles:!0,composed:!0});if(!n.dispatchEvent(t))return[3,4];e=n.closest("qti-assessment-item").querySelector("[data-stimulus-idref=".concat(n.identifier,"]"));if(!e)return[3,2];return[4,n.updateStimulusRef(e)];case 1:i=o.sent();return[3,3];case 2:i=console.warn("Stimulus with data-stimulus-idref ".concat(n.identifier," not found"));o.label=3;case 3:i;o.label=4;case 4:return[2]}})})()}},{key:"updateStimulusRef",value:function t(t){var e=this;return o(function(){var n,r,i;return L(this,function(o){switch(o.label){case 0:return[4,rf().load(e.href).then(function(t){return t.htmlDoc()})];case 1:n=o.sent();if(n){;i=n.querySelectorAll("qti-stimulus-body, qti-stylesheet");t.innerHTML="",(r=t).append.apply(r,T(i))}return[2]}})})()}}]);return e}(rt);ej([r({type:String})],rv.prototype,"identifier",2),ej([r({type:String})],rv.prototype,"href",2),rv=ej([rr("qti-assessment-stimulus-ref")],rv);var rp=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}return e}(rt);rp=ej([rr("qti-companion-materials-info")],rp);var ry=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nQ(j(),this.handleSlotChange)}},{key:"handleSlotChange",value:function t(){var t;var e;var n=Array.from((e=(t=this.firstElementChild)===null||t===void 0?void 0:t.childNodes)!==null&&e!==void 0?e:[]).find(function(t){return t.nodeType===Node.COMMENT_NODE});try{var r;this.operatorFunction=new Function("context","fn","item",(r=n===null||n===void 0?void 0:n.textContent)!==null&&r!==void 0?r:"")}catch(t){console.error("custom-operator contains invalid javascript code",t)}}},{key:"calculate",value:function t(){var t=this;var e={variable:function(e){var n,r;var i;return(i=(r=t._context)===null||r===void 0?void 0:(n=r.variables.find(function(t){return t.identifier===e}))===null||n===void 0?void 0:n.value)!==null&&i!==void 0?i:""},correct:function(e){var n,r;var i;return(i=(r=t._context)===null||r===void 0?void 0:(n=r.variables.find(function(t){return t.identifier===e}))===null||n===void 0?void 0:n.correctResponse)!==null&&i!==void 0?i:""}},n={getVariable:function(e){var n;return(n=t._context)===null||n===void 0?void 0:n.variables.find(function(t){return t.identifier===e})},updateOutcomeVariable:function(e,n){t.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:e,value:n}}))},updateResponseVariable:function(e,n){t.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:e,response:n}}))}};return this.operatorFunction(this._context,e,n)}}]);return e}(rt);ej([e({context:rs,subscribe:!0}),i()],ry.prototype,"_context",2),ry=ej([rr("qti-custom-operator")],ry);var rm=function(){return new Intl.NumberFormat().format(.1).replace(/\d/g,"")},rg=function(t){if(typeof t=="string")return t;var e=rm();return e==="."?t.toLocaleString():t.toString().replace(".","").replace(e,".")};var rb=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"connectedCallback",value:function t(){h(f(e.prototype),"connectedCallback",this).call(this),this.dispatchEvent(new CustomEvent("qti-register-feedback",{bubbles:!0,composed:!0,detail:this}))}},{key:"checkShowFeedback",value:function t(t){var e=this._context.variables.find(function(e){return e.identifier===t})||null;if(this.outcomeIdentifier!==t||!e)return;var n=!1;Array.isArray(e.value)?n=e.value.includes(this.identifier):n=!R(this.identifier)&&!R(e===null||e===void 0?void 0:e.value)&&this.identifier===e.value||!1,this.showFeedback(n)}},{key:"showFeedback",value:function t(t){this.showStatus=t&&this.showHide==="show"||!t&&this.showHide==="hide"?"on":"off"}}]);return e}(rt);ej([r({type:String,attribute:"show-hide"})],rb.prototype,"showHide",2),ej([r({type:String,attribute:"outcome-identifier"})],rb.prototype,"outcomeIdentifier",2),ej([r({type:String})],rb.prototype,"identifier",2),ej([r({type:String,attribute:!1})],rb.prototype,"showStatus",2),ej([e({context:rs,subscribe:!0}),i()],rb.prototype,"_context",2);var r_=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nQ(H(),this.showStatus)}},{key:"connectedCallback",value:function t(){h(f(e.prototype),"connectedCallback",this).call(this),this.checkShowFeedback(this.outcomeIdentifier)}}]);return e}(rb);r_.styles=e8(Q()),r_=ej([rr("qti-feedback-block")],r_);var rk=function(t){return t!==null&&t!==void 0?t:nW};var rE=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.render=function(){return nQ(F(),rk(t.showStatus))};return t}c(e,[{key:"connectedCallback",value:function t(){h(f(e.prototype),"connectedCallback",this).call(this),this.checkShowFeedback(this.outcomeIdentifier)}}]);return e}(rb);rE.styles=e8(z()),rE=ej([rr("qti-feedback-inline")],rE);var rx=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nQ(B(),this.showStatus==="on",this.closeFeedback)}},{key:"openFeedback",value:function t(){var t;var e=(t=this.shadowRoot)===null||t===void 0?void 0:t.querySelector("dialog");e&&!e.open&&e.showModal()}},{key:"closeFeedback",value:function t(){var t;var e=(t=this.shadowRoot)===null||t===void 0?void 0:t.querySelector("dialog");e&&e.open&&(e.close(),this.showStatus="off")}},{key:"connectedCallback",value:function t(){h(f(e.prototype),"connectedCallback",this).call(this),this.showStatus==="on"&&this.openFeedback()}},{key:"updated",value:function t(t){t.has("showStatus")&&(this.showStatus==="on"?this.openFeedback():this.closeFeedback())}}]);return e}(rb);rx.styles=e8(W()),rx=ej([rr("qti-modal-feedback")],rx);var rw=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"connectedCallback",value:function t(){h(f(e.prototype),"connectedCallback",this).call(this),this.dispatchEvent(new CustomEvent("qti-register-hotspot",{bubbles:!0,composed:!0,cancelable:!1}))}},{key:"render",value:function t(){return nQ(Y())}}]);return e}(rt);rw.styles=e8(X()),rw=ej([rr("qti-associable-hotspot")],rw);var rA=function(t,e,n){var r=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}return e}(t);return r};var rC=function(t,e,n,i){var l=/*#__PURE__*/function(t){"use strict";v(r,t);function r(){s(this,r);var t;t=a(this,r,arguments);t.observer=null;t.droppableObsever=null;t.resizeObserver=null;t.draggables=[];t.droppables=[];t.dragContainers=[];t.dragClone=null;t.dragSource=null;t.touchStartPoint=null;t.isDraggable=!1;t.cloneOffset={x:0,y:0};t.isDragging=!1;t.allDropzones=[];t.lastTarget=null;t.currentDropTarget=null;t.MIN_DRAG_DISTANCE=5;t.DRAG_CLONE_OPACITY=1;t.dataTransfer={data:{},setData:function t(t,e){this.data[t]=e},getData:function t(t){return this.data[t]},effectAllowed:"move"};t.configuration={copyStylesDragClone:!0,dragCanBePlacedBack:!0,dragOnClick:!1};t.minAssociations=1;t.maxAssociations=0;t.draggablesModified=function(e,n){var r=true,i=false,o=undefined;try{var a=function(){var e=l.value;t.draggables.includes(e)&&(t.draggables=t.draggables.filter(function(t){return t!==e}),e.removeAttribute("tabindex"),e.removeEventListener("touchstart",t.handleTouchStart.bind(t)),e.removeEventListener("mousedown",t.handleTouchStart.bind(t)))};for(var s=n[Symbol.iterator](),l;!(r=(l=s.next()).done);r=true)a()}catch(t){i=true;o=t}finally{try{if(!r&&s.return!=null){s.return()}}finally{if(i){throw o}}}var u=true,c=false,d=undefined;try{for(var h=e[Symbol.iterator](),f;!(u=(f=h.next()).done);u=true){var v=f.value;t.draggables.includes(v)||(t.draggables.push(v),v.setAttribute("tabindex","0"),v.hasTouchStartListener||(v.addEventListener("touchstart",t.handleTouchStart.bind(t),{passive:!1}),v.addEventListener("mousedown",t.handleTouchStart.bind(t),{passive:!1}),v.hasTouchStartListener=!0))}}catch(t){c=true;d=t}finally{try{if(!u&&h.return!=null){h.return()}}finally{if(c){throw d}}}var p=0;t.draggables.forEach(function(e){e.style.viewTransitionName="drag-".concat(p,"-").concat(t.getAttribute("identifier")||crypto.randomUUID()),e.setAttribute("qti-draggable","true"),p++})};t.droppablesModified=function(e,n){var r=true,i=false,o=undefined;try{var a=function(){var e=l.value;t.droppables.includes(e)&&(t.droppables=t.droppables.filter(function(t){return t!==e}),t.allDropzones=t.allDropzones.filter(function(t){return t!==e}))};for(var s=n[Symbol.iterator](),l;!(r=(l=s.next()).done);r=true)a()}catch(t){i=true;o=t}finally{try{if(!r&&s.return!=null){s.return()}}finally{if(i){throw o}}}var u=true,c=false,d=undefined;try{for(var h=e[Symbol.iterator](),f;!(u=(f=h.next()).done);u=true){var v=f.value;t.droppables.includes(v)||(t.droppables.push(v),t.allDropzones.push(v))}}catch(t){c=true;d=t}finally{try{if(!u&&h.return!=null){h.return()}}finally{if(c){throw d}}}var p=true,y=false,m=undefined;try{for(var g=t.droppables[Symbol.iterator](),b;!(p=(b=g.next()).done);p=true){var _=b.value;t.dataset.choicesContainerWidth&&(_.style.width="".concat(t.dataset.choicesContainerWidth,"px"),_.style.boxSizing="border-box")}}catch(t){y=true;m=t}finally{try{if(!p&&g.return!=null){g.return()}}finally{if(y){throw m}}}};return t}c(r,[{key:"handleDraggableContainerChange",value:function t(t,e){this.isMatchTabular()||(t.length>0||e.length>0)&&this.dragContainersModified(t||[],e||[])}},{key:"dragContainersModified",value:function t(t,e){var n=true,r=false,i=undefined;try{var o,a=function(){var t=l.value;o.dragContainers.includes(t)&&(o.dragContainers=o.dragContainers.filter(function(e){return e!==t}),o.allDropzones=o.allDropzones.filter(function(e){return e!==t}))};for(var s=e[Symbol.iterator](),l;!(n=(l=s.next()).done);n=true)o=this,a()}catch(t){r=true;i=t}finally{try{if(!n&&s.return!=null){s.return()}}finally{if(r){throw i}}}var u=true,c=false,d=undefined;try{for(var h=t[Symbol.iterator](),f;!(u=(f=h.next()).done);u=true){var v=f.value;this.dragContainers.includes(v)||(this.dragContainers.push(v),this.allDropzones.push(v))}}catch(t){c=true;d=t}finally{try{if(!u&&h.return!=null){h.return()}}finally{if(c){throw d}}}}},{key:"handleDraggablesChange",value:function t(t,e){this.isMatchTabular()||(t.length>0||e.length>0)&&this.draggablesModified(t||[],e||[])}},{key:"handleDroppablesChange",value:function t(t,e){this.isMatchTabular()||(t.length>0||e.length>0)&&this.droppablesModified(t||[],e||[])}},{key:"firstUpdated",value:function t(t){var o=this;var a,s,l;h(f(r.prototype),"firstUpdated",this).call(this,t),this.hasAttribute("disabled")||(document.addEventListener("touchmove",this.handleTouchMove.bind(this),{passive:!1}),document.addEventListener("mousemove",this.handleTouchMove.bind(this),{passive:!1}),document.addEventListener("touchend",this.handleTouchEnd.bind(this),{passive:!1}),document.addEventListener("mouseup",this.handleTouchEnd.bind(this),{passive:!1}),document.addEventListener("touchcancel",this.handleTouchCancel.bind(this),{passive:!1}));var u=Array.from(this.querySelectorAll(e)||[]).concat(Array.from(((a=this.shadowRoot)===null||a===void 0?void 0:a.querySelectorAll(e))||[])),c=Array.from(this.querySelectorAll(n)||[]).concat(Array.from(((s=this.shadowRoot)===null||s===void 0?void 0:s.querySelectorAll(n))||[])),d=Array.from(this.querySelectorAll(i)||[]).concat(Array.from(((l=this.shadowRoot)===null||l===void 0?void 0:l.querySelectorAll(i))||[]));this.dragContainersModified(d,[]),this.droppablesModified(c,[]),this.draggablesModified(u,[]),this.updateMinDimensionsForDropZones(),this.observer=new MutationObserver(function(){return o.updateMinDimensionsForDropZones()}),this.observer.observe(this,{childList:!0,subtree:!0}),this.resizeObserver=new ResizeObserver(function(){return o.updateMinDimensionsForDropZones()}),this.querySelectorAll("qti-gap-text").forEach(function(t){var e;return(e=o.resizeObserver)===null||e===void 0?void 0:e.observe(t)})}},{key:"moveDraggableToDroppable",value:function t(t,e){var n=this;return o(function(){return L(this,function(r){(function(){t.style.transform="translate(0, 0)",e.tagName==="SLOT"?t.setAttribute("slot",e.getAttribute("name")):e.appendChild(t),n.checkAllMaxAssociations(),n.saveResponse()})();return[2]})})()}},{key:"activateDroppable",value:function t(t){this.dragContainers.includes(t)?(this._internals.states.add("--dragzone-active"),t.setAttribute("active","")):(this._internals.states.delete("--dragzone-active"),t.setAttribute("active",""))}},{key:"deactivateDroppable",value:function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;e&&this._internals.states.add("--dragzone-active"),t.removeAttribute("active")}},{key:"connectedCallback",value:function t(){h(f(r.prototype),"connectedCallback",this).call(this)}},{key:"isMatchTabular",value:function t(){return this.classList.contains("qti-match-tabular")}},{key:"updateMinDimensionsForDropZones",value:function t(){var t;var r=this.querySelectorAll(e),o=Array.from(this.querySelectorAll(n)).map(function(t){return t}),a=0,s=0;r.forEach(function(t){var e=t.getBoundingClientRect();a=Math.max(a,e.height),s=Math.max(s,e.width)});var l=this.querySelector(i)||((t=this.shadowRoot)===null||t===void 0?void 0:t.querySelector(i));l&&(l.style.minHeight="".concat(a,"px"),l.style.minWidth="".concat(s,"px"));var u=true,c=false,d=undefined;try{for(var h=o[Symbol.iterator](),f;!(u=(f=h.next()).done);u=true){var v=f.value;v.style.minHeight="".concat(a,"px"),v.style.minWidth="".concat(s,"px")}}catch(t){c=true;d=t}finally{try{if(!u&&h.return!=null){h.return()}}finally{if(c){throw d}}}}},{key:"activateDroppables",value:function t(t){this.dragContainers.forEach(function(e){e.setAttribute("enabled",""),e.hasAttribute("disabled")&&(e.contains(t)||e.shadowRoot&&e.shadowRoot.contains(t))&&e.removeAttribute("disabled")}),this.droppables.forEach(function(e){e.setAttribute("enabled",""),e.hasAttribute("disabled")&&(e.contains(t)||e.shadowRoot&&e.shadowRoot.contains(t))&&e.removeAttribute("disabled")})}},{key:"activateDragLocation",value:function t(){this._internals.states.add("--dragzone-enabled")}},{key:"deactivateDragLocation",value:function t(){this._internals.states.delete("--dragzone-enabled")}},{key:"deactivateDroppables",value:function t(){this.dragContainers.forEach(function(t){t.removeAttribute("enabled"),t.removeAttribute("active")}),this.droppables.forEach(function(t){t.removeAttribute("enabled"),t.removeAttribute("active")})}},{key:"disconnectedCallback",value:function t(){h(f(r.prototype),"disconnectedCallback",this).call(this),this.observer&&(this.observer.disconnect(),this.observer=null),this.droppableObsever&&(this.droppableObsever.disconnect(),this.droppableObsever=null),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),document.removeEventListener("touchmove",this.handleTouchMove),document.removeEventListener("mousemove",this.handleTouchMove),document.removeEventListener("touchend",this.handleTouchEnd),document.removeEventListener("mouseup",this.handleTouchEnd),document.removeEventListener("touchcancel",this.handleTouchCancel)}},{key:"handleTouchMove",value:function t(t){if(this.isDraggable&&this.dragClone){var e=this.getEventCoordinates(t),n=e.x,r=e.y,i={clientX:n,clientY:r};this.calculateDragDistance(i)>=this.MIN_DRAG_DISTANCE&&(this.isDragging=!0,this.updateDragClonePosition(i));var o=this.findClosestDropzone();this.currentDropTarget=o,o!==this.lastTarget&&(this.lastTarget&&(this.deactivateDroppable(this.lastTarget),this.dispatchCustomEvent(this.lastTarget,"dragleave")),o&&(this.activateDroppable(o),this.dispatchCustomEvent(o,"dragenter")),this.lastTarget=o),this.currentDropTarget&&this.dispatchCustomEvent(this.currentDropTarget,"dragover"),t.preventDefault()}}},{key:"handleTouchEnd",value:function t(t){this.isDragging&&this.resetDragState(),this._internals.states.delete("--dragzone-active"),this.checkAllMaxAssociations(),this._internals.states.delete("--dragzone-enabled"),this._internals.states.delete("--dragzone-active"),this.deactivateDragLocation(),this.deactivateDroppables(),this.draggables.forEach(function(t){t.removeAttribute("dragging")}),t.preventDefault()}},{key:"handleTouchCancel",value:function t(t){this.resetDragState()}},{key:"validate",value:function t(){if(!this.shadowRoot)return!1;var t=this.getValidAssociations(),e=!0,n="";this.maxAssociations>0&&t>this.maxAssociations?(e=!1,n=this.dataset.maxSelectionsMessage||"You've selected too many associations. Maximum allowed is ".concat(this.maxAssociations,".")):this.minAssociations>0&&t<this.minAssociations&&(e=!1,n=this.dataset.minSelectionsMessage||"You haven't selected enough associations. Minimum required is ".concat(this.minAssociations,"."));var r=this.lastElementChild;return this._internals.setValidity(e?{}:{customError:!0},n,r),e}},{key:"reportValidity",value:function t(){var t=this.shadowRoot.querySelector("#validationMessage");return t&&(this._internals.validity.valid?(t.textContent="",t.style.display="none"):(t.textContent=this._internals.validationMessage,t.style.display="block")),this._internals.validity.valid}},{key:"checkMaxAssociations",value:function t(t){var e=this.getMatchMaxValue(t),n=t.querySelectorAll('[qti-draggable="true"]').length;return!(e===0)&&n>=e}},{key:"dropDraggableInDroppable",value:function t(t,e){var n=t.cloneNode(!0);n.removeAttribute("style"),this.moveDraggableToDroppable(n,e),this.draggablesModified([n],[]);var r=this.getMatchMaxValue(t),i=this.draggables.filter(function(e){return e.getAttribute("identifier")===t.getAttribute("identifier")});r!==0&&i.length>=r?(t.style.opacity="0.0",t.style.pointerEvents="none"):t.style.opacity="1.0"}},{key:"resetDragState",value:function t(){if(this.dragClone){var t=this.currentDropTarget!==null,e=!t||this.dragContainers.includes(this.currentDropTarget);t&&this.currentDropTarget&&!e&&this.dropDraggableInDroppable(this.dragSource,this.currentDropTarget),e&&(this.dragSource.style.opacity="1.0",this.dragSource.style.display="block",this.dragSource.style.position="static",this.dragSource.style.pointerEvents="auto",this.saveResponse()),this.dragClone.remove(),this.draggablesModified([],[this.dragClone])}this.isDragging=!1,this.isDraggable=!1,this.dragSource=null,this.dragClone=null,this.touchStartPoint=null,this.currentDropTarget=null,this.lastTarget=null,this.deactivateDroppables()}},{key:"checkAllMaxAssociations",value:function t(){var t=this;var e=this.getValidAssociations(),n=this.maxAssociations!==0&&e>=this.maxAssociations;this.droppables.forEach(function(e){n?t.disableDroppable(e):t.checkMaxAssociations(e)?t.disableDroppable(e):t.enableDroppable(e)})}},{key:"getMatchMaxValue",value:function t(t){var e=t.getAttribute("match-max");return e?parseInt(e,10):1}},{key:"disableDroppable",value:function t(t){t.setAttribute("disabled","")}},{key:"enableDroppable",value:function t(t){t.removeAttribute("disabled")}},{key:"value",get:function t(){return this.collectResponseData()},set:function t(t){var e=this;if(!this.isMatchTabular())if(Array.isArray(t)){this.reset(),t===null||t===void 0?void 0:t.forEach(function(t){return e.placeResponse(t)});var n=new FormData;t.forEach(function(t){n.append(e.responseIdentifier,t)}),this._internals.setFormValue(n)}else this._internals.setFormValue(t||"")}},{key:"placeResponse",value:function t(t){var e=this;var n=M(t.split(" ").reverse()),r=n[0],i=n.slice(1),o=Array.from(this.draggables),a=Array.from(this.droppables);i.forEach(function(t){var n=o.find(function(e){return e.getAttribute("identifier")===t}),i=a.find(function(t){return t.getAttribute("identifier")===r});e.dropDraggableInDroppable(n,i)})}},{key:"getValidAssociations",value:function t(){var t=0;var e=true,n=false,r=undefined;try{for(var i=this.droppables[Symbol.iterator](),o;!(e=(o=i.next()).done);e=true){var a=o.value;t=t+this.getDraggablesFromDroppable(a).length}}catch(t){n=true;r=t}finally{try{if(!e&&i.return!=null){i.return()}}finally{if(n){throw r}}}return t}},{key:"saveResponse",value:function t(){var t=this.collectResponseData();this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:this.responseIdentifier,response:t}}))}},{key:"collectResponseData",value:function t(){var t=this;return this.droppables.map(function(e){var n=t.getDraggablesFromDroppable(e).map(function(t){return t.getAttribute("identifier")}),r=e.getAttribute("identifier");return n.map(function(t){return"".concat(t," ").concat(r)})}).flat()}},{key:"getDraggablesFromDroppable",value:function t(t){return this.draggables.map(function(t){return t.getAttribute("identifier")}).filter(function(t,e,n){return n.indexOf(t)===e}).flatMap(function(e){return Array.from(t.querySelectorAll("[identifier='".concat(e,"']")))}).filter(function(t){return!!t}).map(function(t){return t})}},{key:"reset",value:function t(){var t=this;var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.droppables.forEach(function(e){t.getDraggablesFromDroppable(e).forEach(function(e){e.remove(),t.draggablesModified([],[e])})}),this.dragContainers.forEach(function(t){Array.from(t.querySelectorAll('[qti-draggable="true"]')).forEach(function(t){t.style.opacity="1.0"})}),this.dragClone=null,this.dragSource=null,this.isDragging=!1,this.isDraggable=!1,this.currentDropTarget=null,this.lastTarget=null,e&&this.saveResponse()}},{key:"updateDragClonePosition",value:function t(t){if(!this.isDragging||!this.dragClone)return;var e=t.clientX-this.cloneOffset.x,n=t.clientY-this.cloneOffset.y,r=this.applyInteractionBoundaries(e,n,this.dragClone),i=r.newLeft,o=r.newTop;this.dragClone.style.left="".concat(i,"px"),this.dragClone.style.top="".concat(o,"px")}},{key:"applyInteractionBoundaries",value:function t(t,e,n){var r=this.getBoundingClientRect(),i=n.getBoundingClientRect(),o=i.width,a=i.height,s=Math.max(r.left,Math.min(t,r.right-o)),l=Math.max(r.top,Math.min(e,r.bottom-a));return{newLeft:s,newTop:l}}},{key:"getEventCoordinates",value:function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;var n=t.touches?t.touches[0]:t;return{x:e?n.pageX:n.clientX,y:e?n.pageY:n.clientY}}},{key:"calculateDragDistance",value:function t(t){var e=Math.abs(t.clientX-this.touchStartPoint.x),n=Math.abs(t.clientY-this.touchStartPoint.y);return e+n}},{key:"findClosestDropzone",value:function t(){var t=this.allDropzones.filter(function(t){return!t.hasAttribute("disabled")});if(!this.dragClone||t.length===0)return null;var e=this.dragClone.getBoundingClientRect(),n=null,r=0;var i=true,o=false,a=undefined;try{for(var s=t[Symbol.iterator](),l;!(i=(l=s.next()).done);i=true){var u=l.value;var c=u.getBoundingClientRect(),d=this.calculateOverlapArea(e,c);d>r&&(r=d,n=u)}}catch(t){o=true;a=t}finally{try{if(!i&&s.return!=null){s.return()}}finally{if(o){throw a}}}if(!n){var h=200;var f=true,v=false,p=undefined;try{for(var y=t[Symbol.iterator](),m;!(f=(m=y.next()).done);f=true){var g=m.value;var b=g.getBoundingClientRect(),_=Math.sqrt(Math.pow(e.left-b.left,2)+Math.pow(e.top-b.top,2));_<h&&(h=_,n=g)}}catch(t){v=true;p=t}finally{try{if(!f&&y.return!=null){y.return()}}finally{if(v){throw p}}}}return n}},{key:"calculateOverlapArea",value:function t(t,e){var n=Math.max(0,Math.min(t.right,e.right)-Math.max(t.left,e.left)),r=Math.max(0,Math.min(t.bottom,e.bottom)-Math.max(t.top,e.top));return n*r}},{key:"dispatchCustomEvent",value:function t(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t)return;var r=new CustomEvent(e,{bubbles:n,cancelable:!0});r.dataTransfer=this.dataTransfer,t.dispatchEvent(r)}},{key:"appendClone",value:function t(){document.body.appendChild(this.dragClone)}},{key:"handleTouchStart",value:function t(t){var e=this;if(this.isDragging)return;var n=this.getEventCoordinates(t),r=n.x,i=n.y;this.touchStartPoint={x:r,y:i},this.dragSource=t.currentTarget,this.isDraggable=!0,this._internals.states.add("--dragzone-enabled"),this._internals.states.add("--dragzone-active"),this.activateDragLocation(),this.activateDroppables(this.dragSource);var o=this.findDraggableInDraggableContainer(this.dragSource.getAttribute("identifier")),a=this.droppables.some(function(t){return Array.from(t.children).some(function(t){return t===e.dragSource})}),s=this.dragSource.getBoundingClientRect();a&&(this.dragSource.remove(),this.draggablesModified([],[this.dragSource]),this.dragSource=o),this.cloneOffset.x=r-s.left,this.cloneOffset.y=i-s.top,this.dragClone=o.cloneNode(!0);var l=window.getComputedStyle(o);for(var u=0;u<l.length;u++){var c=l[u];this.dragClone.style.setProperty(c,l.getPropertyValue(c))}var d=o.getBoundingClientRect();this.dragClone.style.width="".concat(d.width,"px"),this.dragClone.style.height="".concat(d.height,"px"),s&&this.setDragCloneStyles(s),this.dragClone.style.display="block",this.dragClone.style.opacity="1",this.appendClone();var h=this.getMatchMaxValue(this.dragSource),f=this.draggables.filter(function(t){return t.getAttribute("identifier")===e.dragSource.getAttribute("identifier")});h!==0&&f.length>=h?(o.style.opacity="0.0",o.style.pointerEvents="none"):o.style.opacity="1.0",t.preventDefault(),this.dragClone.setAttribute("dragging","")}},{key:"findDraggableInDraggableContainer",value:function t(t){var n=this.dragContainers.flat();var r=true,i=false,o=undefined;try{for(var a=n[Symbol.iterator](),s;!(r=(s=a.next()).done);r=true){var l=s.value;if(l.getAttribute("identifier")===t)return l;var u=void 0;p(l,HTMLSlotElement)?u=Array.from((l===null||l===void 0?void 0:l.assignedElements())||[]):u=Array.from(l.querySelectorAll(e));var c=u.find(function(e){return e.getAttribute("identifier")===t});if(c)return c}}catch(t){i=true;o=t}finally{try{if(!r&&a.return!=null){a.return()}}finally{if(i){throw o}}}}},{key:"setDragCloneStyles",value:function t(t){this.dragClone.style.position="fixed",this.dragClone.style.top="".concat(t.top,"px"),this.dragClone.style.left="".concat(t.left,"px"),this.dragClone.style.setProperty("box-sizing","border-box","important"),this.dragClone.style.zIndex="9999",this.dragClone.style.pointerEvents="none",this.dragClone.style.opacity=this.DRAG_CLONE_OPACITY.toString(),this.dragClone.style.display="block"}}]);return r}(rA(t,n,e));return ej([r({attribute:!1,type:Object})],l.prototype,"configuration",2),ej([r({type:Number,reflect:!0,attribute:"min-associations"})],l.prototype,"minAssociations",2),ej([r({type:Number,reflect:!0,attribute:"max-associations"})],l.prototype,"maxAssociations",2),ej([$(i)],l.prototype,"handleDraggableContainerChange",1),ej([$(e)],l.prototype,"handleDraggablesChange",1),ej([$(n)],l.prototype,"handleDroppablesChange",1),l};var rq=e8(J());var rS=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e);t.disabled=!1;t.readonly=!1;t._internals=t.attachInternals();return t}c(e,[{key:"correctResponse",get:function t(){return this._correctResponse},set:function t(t){this._correctResponse=t}},{key:"reportValidity",value:function t(){return this._internals.reportValidity()}},{key:"reset",value:function t(){this.value=""}},{key:"toggleCorrectResponse",value:function t(t,e){this.correctResponse=e?t===null||t===void 0?void 0:t.correctResponse:t.cardinality==="single"?"":[]}},{key:"connectedCallback",value:function t(){h(f(e.prototype),"connectedCallback",this).call(this),this.dispatchEvent(new CustomEvent("qti-register-interaction",{bubbles:!0,composed:!0,cancelable:!1,detail:{interactionElement:this,responseIdentifier:this.responseIdentifier}}))}},{key:"saveResponse",value:function t(t){this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,cancelable:!1,detail:{responseIdentifier:this.responseIdentifier,response:Array.isArray(t)?T(t):t}}))}}]);return e}(rt);rS.formAssociated=!0,ej([r({type:String,attribute:"response-identifier"})],rS.prototype,"responseIdentifier",2),ej([r({reflect:!0,type:Boolean})],rS.prototype,"disabled",2),ej([r({reflect:!0,type:Boolean})],rS.prototype,"readonly",2),ej([i()],rS.prototype,"_correctResponse",2);var rR=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e);t._childrenMap=[];t._registerChoiceHandler=t._registerChoice.bind(t),t.addEventListener("register-qti-simple-associable-choice",t._registerChoiceHandler);return t}c(e,[{key:"_registerChoice",value:function t(t){var e=t.target;this._childrenMap.push(e)}},{key:"render",value:function t(){return nQ(K(),this._childrenMap.length>0&&Array.from(Array(Math.ceil(this._childrenMap.length/2)).keys()).map(function(t,e){return nQ(G(),e,e,e,e)}))}},{key:"disconnectedCallback",value:function t(){h(f(e.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("register-qti-simple-associable-choice",this._registerChoiceHandler)}}]);return e}(rC(rS,"qti-simple-associable-choice",".dl","slot[name='qti-simple-associable-choice']"));rR.styles=rq,ej([i()],rR.prototype,"_childrenMap",2),rR=ej([rr("qti-associate-interaction")],rR);var rP=function(t,e){var n=/*#__PURE__*/function(t){"use strict";v(n,t);function n(){s(this,n);var t;t=a(this,n,arguments);t._choiceElements=[];t.minChoices=0;t.maxChoices=1;t._handleDisabledChange=function(e,n){t._choiceElements.forEach(function(t){return t.disabled=n})};t._handleReadonlyChange=function(e,n){t._choiceElements.forEach(function(t){return t.readonly=n})};t._value="";return t}c(n,[{key:"_handleMaxChoicesChange",value:function t(t,e){this._determineInputType()}},{key:"value",get:function t(){return Array.isArray(this._value)&&this._value.length===0||this._value===""?null:Array.isArray(this._value)?this._value.join(","):this._value},set:function t(t){var e=this;if(this.maxChoices>1&&(typeof t=="string"||t===null)?this._value=t?t.toString().split(","):[]:this._value=t||"",Array.isArray(this._value)){var n=new FormData;this._value.forEach(function(t){n.append(e.responseIdentifier,t)}),this._internals.setFormValue(n)}else this._internals.setFormValue(this._value);this._updateChoiceSelection()}},{key:"toggleCorrectResponse",value:function t(t,e){if(t.correctResponse){var n=Array.isArray(t.correctResponse)?t.correctResponse:[t.correctResponse];this._choiceElements.forEach(function(t){t.internals.states.delete("correct-response"),t.internals.states.delete("incorrect-response"),e&&n.length>0&&(n.includes(t.identifier)?t.internals.states.add("correct-response"):t.internals.states.add("incorrect-response"))})}}},{key:"connectedCallback",value:function t(){h(f(n.prototype),"connectedCallback",this).call(this),this.addEventListener("register-".concat(e),this._registerChoiceElement),this.addEventListener("unregister-".concat(e),this._unregisterChoiceElement),this.addEventListener("activate-".concat(e),this._choiceElementSelectedHandler)}},{key:"disconnectedCallback",value:function t(){h(f(n.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("register-".concat(e),this._registerChoiceElement),this.removeEventListener("unregister-".concat(e),this._unregisterChoiceElement),this.removeEventListener("activate-".concat(e),this._choiceElementSelectedHandler)}},{key:"validate",value:function t(){var t=this;var e=this._choiceElements.filter(function(e){return t._getChoiceChecked(e)}),n=e.length,r=!0,i="";return this.maxChoices!==0&&n>this.maxChoices?(r=!1,i=this.dataset.maxSelectionsMessage||"Please select no more than ".concat(this.maxChoices," ").concat(this.maxChoices===1?"option":"options",".")):n<this.minChoices&&(r=!1,i=this.dataset.minSelectionsMessage||"Please select at least ".concat(this.minChoices," ").concat(this.minChoices===1?"option":"options",".")),e.length>0&&this._internals.setValidity(r?{}:{customError:!0},i,e[n-1]||this._choiceElements[0]||this),r}},{key:"reportValidity",value:function t(){return this._validationMessageElement&&(this._internals.validity.valid?(this._validationMessageElement.textContent="",this._validationMessageElement.style.display="none"):(this._validationMessageElement.textContent=this._internals.validationMessage,this._validationMessageElement.style.display="block")),this._internals.validity.valid}},{key:"_registerChoiceElement",value:function t(t){t.stopPropagation();var e=t.target;e.disabled=this.disabled,this._choiceElements.push(e),this._setInputType(e)}},{key:"_unregisterChoiceElement",value:function t(t){t.stopPropagation();var e=t.target;this._choiceElements=this._choiceElements.filter(function(t){return t!==e})}},{key:"_determineInputType",value:function t(){var t=this;this._choiceElements.forEach(function(e){t._setInputType(e)})}},{key:"_setInputType",value:function t(t){this._internals.ariaLabel=this.maxChoices===1?"radio-group":"checkbox-group";var e=this.maxChoices===1?"radio":"checkbox";t.internals.role=e,t.internals.states.delete(e==="radio"?"checkbox":"radio"),t.internals.states.add(e)}},{key:"_choiceElementSelectedHandler",value:function t(t){var e=this;this._toggleChoiceChecked(t.target),this.maxChoices===1&&this._choiceElements.forEach(function(n){n.identifier!==t.detail.identifier&&e._setChoiceChecked(n,!1)}),this._handleChoiceSelection()}},{key:"_setChoiceChecked",value:function t(t,e){var n;((n=t.internals)===null||n===void 0?void 0:n.states)&&(e?(t.internals.states.add("--checked"),t.internals.ariaChecked="true"):(t.internals.states.delete("--checked"),t.internals.ariaChecked="false"))}},{key:"_getChoiceChecked",value:function t(t){return t.internals.states.has("--checked")}},{key:"_toggleChoiceChecked",value:function t(t){var e=this._getChoiceChecked(t);this._setChoiceChecked(t,!e)}},{key:"_handleChoiceSelection",value:function t(){var t=this;var e=this._choiceElements.filter(function(e){return t._getChoiceChecked(e)}).map(function(t){return t.identifier});this.value=this.maxChoices===1?e[0]||"":e,this.validate(),this.saveResponse(this._value)}},{key:"_updateChoiceSelection",value:function t(){var t=this;var e=Array.isArray(this._value)?this._value:[this._value];this._choiceElements.forEach(function(n){var r=e.includes(n.identifier);t._setChoiceChecked(n,r)})}}]);return n}(t);return ej([l("#validationMessage")],n.prototype,"_validationMessageElement",2),ej([r({type:Number,attribute:"min-choices"})],n.prototype,"minChoices",2),ej([r({type:Number,attribute:"max-choices"})],n.prototype,"maxChoices",2),ej([d("maxChoices",{waitUntilFirstUpdate:!0})],n.prototype,"_handleMaxChoicesChange",1),ej([d("disabled",{waitUntilFirstUpdate:!0})],n.prototype,"_handleDisabledChange",2),ej([d("readonly",{waitUntilFirstUpdate:!0})],n.prototype,"_handleReadonlyChange",2),n};var rM=function(t,e){var n=/*#__PURE__*/function(t){"use strict";v(n,t);function n(){s(this,n);var t;t=a(this,n,arguments);t.shuffle="false";return t}c(n,[{key:"connectedCallback",value:function t(){h(f(n.prototype),"connectedCallback",this).call(this),this._applyShuffle()}},{key:"updated",value:function t(t){t.has("shuffle")&&this._applyShuffle()}},{key:"_applyShuffle",value:function t(){this.shuffle==="true"?this._shuffleChoices():this._resetShuffleChoices()}},{key:"_shuffleChoices",value:function t(){var t=Array.from(this.querySelectorAll(e)),n=t.filter(function(t){return t.hasAttribute("fixed")}),r=t.filter(function(t){return!t.hasAttribute("fixed")});if(r.length<=1){console.warn("Shuffling is not possible with fewer than 2 non-fixed elements.");return}var i=T(r),o=!1,a=0;for(;!o&&a<10;){a++;for(var s=r.length-1;s>0;s--){var l=Math.floor(Math.random()*(s+1));var u;u=[r[l],r[s]],r[s]=u[0],r[l]=u[1],u}o=!r.every(function(t,e){return t===i[e]})}o||console.warn("Failed to shuffle the choices after multiple attempts.");var c=1;T(n).concat(T(r)).forEach(function(t){t.style.setProperty("order",String(c++))})}},{key:"_resetShuffleChoices",value:function t(){this.querySelectorAll(e).forEach(function(t){t.style.setProperty("order","initial")})}}]);return n}(t);return ej([r({type:String,reflect:!0})],n.prototype,"shuffle",2),n};var rT=function(t,e){var n=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t._classes=[];t._allLabels=["qti-labels-decimal","qti-labels-lower-alpha","qti-labels-upper-alpha"];t._allLabelSuffixes=["qti-labels-suffix-period","qti-labels-suffix-parenthesis"];return t}c(e,[{key:"class",get:function t(){var t;return((t=this._classes)===null||t===void 0?void 0:t.join(" "))||""},set:function t(t){t&&(this._classes=t.split(" "),this._addLabels())}},{key:"updated",value:function t(t){h(f(e.prototype),"updated",this).call(this,t),t.has("shuffle")&&this._addLabels()}},{key:"_addLabels",value:function t(){var t=this;var e=this._classes.some(function(e){return t._allLabels.includes(e)||t._allLabelSuffixes.includes(e)}),n=function(t){return!isNaN(+t)};if(e){var r=Array.from(this.querySelectorAll("qti-simple-choice")).map(function(t){return t}).map(function(t,e){return{el:t,order:n(t.style.order)?+t.style.order:e+1}}).sort(function(t,e){return t.order-e.order}).map(function(t){return t.el});for(var i=0;i<r.length;i++)r[i].marker=this._getLabel(i+1)}}},{key:"_getLabel",value:function t(t){var e=this;var n=this._classes.filter(function(t){return e._allLabels.includes(t)}).pop(),r=this._classes.filter(function(t){return e._allLabelSuffixes.includes(t)}).pop();!n&&r&&(n="qti-labels-upper-alpha");var i="";switch(n){case"qti-labels-decimal":i="".concat(t);break;case"qti-labels-lower-alpha":i="".concat(String.fromCharCode(97+t-1));break;case"qti-labels-upper-alpha":i="".concat(String.fromCharCode(65+t-1));break}return r==="qti-labels-suffix-period"?i+=".":r==="qti-labels-suffix-parenthesis"&&(i+=")"),i}}]);return e}(t);return ej([r({type:String,reflect:!0})],n.prototype,"class",1),n};var rO=e8(Z());var r$=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e),t._internals.role="group";return t}c(e,[{key:"handleSlotChange",value:function t(){var t=this.querySelectorAll("qti-simple-choice");this.style.setProperty("--item-count",t.length.toString())}},{key:"render",value:function t(){return nQ(tt(),this.handleSlotChange)}}]);return e}(rT(rM(rP(rS,"qti-simple-choice"),"qti-simple-choice"),"qti-simple-choice"));r$.styles=rO,ej([r({type:String})],r$.prototype,"orientation",2),r$=ej([rr("qti-choice-interaction")],r$);var rI=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e);t._errorMessage=null;t.handlePostMessage=t.handlePostMessage.bind(t);return t}c(e,[{key:"connectedCallback",value:function t(){var t=this;h(f(e.prototype),"connectedCallback",this).call(this);var n=this.data.startsWith("http")?this.data:P(this.baseItemUrl+"/"+this.data);fetch(n).then(function(t){return t.json()}).then(function(e){t.manifest=e,t.setupCES()}).catch(function(e){t._errorMessage=e})}},{key:"setupCES",value:function t(){var t=this.shadowRoot.querySelector("#pciContainer"),e=t.contentDocument;window.addEventListener("message",this.handlePostMessage),e.open(),e.write("\n <html>\n <head>\n <link href='".concat(P("".concat(this.baseRefUrl,"/").concat(this.manifest.style[0])),"' rel=\"stylesheet\" />\n <script src='").concat(P("".concat(this.baseRefUrl,"/").concat(this.manifest.script[0])),"'><\/script>\n </head>\n <body></body>\n </html>\n ")),e.close()}},{key:"getIFrames",value:function t(){var t=this.shadowRoot.querySelectorAll("iframe"),e=this.querySelectorAll("iframe"),n=T(t).concat(T(e));var r=true,i=false,o=undefined;try{for(var a=n[Symbol.iterator](),s;!(r=(s=a.next()).done);r=true){var l=s.value;var u=l.src;if(new URL(u,window.location.href).origin===window.location.origin)try{var c=l.contentDocument||l.contentWindow.document;c&&this.getInnerIFrames(c,n)}catch(t){console.error("Error accessing nested iframe:",t)}}}catch(t){i=true;o=t}finally{try{if(!r&&a.return!=null){a.return()}}finally{if(i){throw o}}}return n.forEach(function(t,e){n.indexOf(t)!==e&&n.splice(e,1)}),n}},{key:"getInnerIFrames",value:function t(t){var e=this;var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return t.querySelectorAll("iframe").forEach(function(t){n.push(t);var r=t.src;if(new URL(r,window.location.href).origin===window.location.origin)try{var i=t.contentDocument||t.contentWindow.document;e.getInnerIFrames(i,n)}catch(t){console.error("Error accessing nested iframe:",t)}else console.warn("Skipped cross-origin iframe:",r)}),n}},{key:"postToWindowAndIframes",value:function t(t,e){window.postMessage({type:t,data:e},"*");var n=this.getIFrames();var r=true,i=false,o=undefined;try{for(var a=n[Symbol.iterator](),s;!(r=(s=a.next()).done);r=true){var l=s.value;l.contentWindow&&l.contentWindow.postMessage({type:t,data:e},"*")}}catch(t){i=true;o=t}finally{try{if(!r&&a.return!=null){a.return()}}finally{if(i){throw o}}}}},{key:"handlePostMessage",value:function t(t){var e=this;var n=t.data,r=n.type,i=n.data;switch(r){case"setResponse":this.rawResponse=i,this.saveResponse(i);break;case"getResponse":{this.postToWindowAndIframes("responseData",this.rawResponse);break}case"getMedia":{var o=this.manifest.media.map(function(t){return t.startsWith("http")?t:P(e.baseRefUrl+"/"+t)});this.postToWindowAndIframes("mediaData",o);break}case"setStageHeight":console.log("setStageHeight not implemented");break}}},{key:"validate",value:function t(){return this.rawResponse!==""}},{key:"value",get:function t(){return this.rawResponse},set:function t(t){if(typeof t=="string")this.rawResponse=t,this.saveResponse(t);else throw new Error("Value must be a string")}},{key:"disconnectedCallback",value:function t(){window.removeEventListener("message",this.handlePostMessage),h(f(e.prototype),"disconnectedCallback",this).call(this)}},{key:"render",value:function t(){return nQ(tn(),this.getAttribute("width"),this.getAttribute("height"),this._errorMessage&&nQ(te(),this._errorMessage))}}]);return e}(rS);ej([r({type:String,attribute:"data"})],rI.prototype,"data",2),ej([r({type:String,attribute:"data-base-item"})],rI.prototype,"baseItemUrl",2),ej([r({type:String,attribute:"data-base-ref"})],rI.prototype,"baseRefUrl",2),ej([r({type:String,attribute:"id"})],rI.prototype,"id",2),ej([i()],rI.prototype,"_errorMessage",2),rI=ej([rr("qti-custom-interaction")],rI);var rU=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.disabled=!1;t.countAttempt=null;t.title="end attempt";return t}c(e,[{key:"render",value:function t(){return nQ(tr(),this.disabled,this.endAttempt,this.title)}},{key:"endAttempt",value:function t(t){this.dispatchEvent(new CustomEvent("end-attempt",{bubbles:!0,composed:!0,detail:{responseIdentifier:this.responseIdentifier,countAttempt:this.countAttempt==="true"}}))}}]);return e}(rt);ej([r({type:String,attribute:"response-identifier"})],rU.prototype,"responseIdentifier",2),ej([r({reflect:!0,type:Boolean})],rU.prototype,"disabled",2),ej([r({type:String,attribute:"count-attempt"})],rU.prototype,"countAttempt",2),ej([r({type:String})],rU.prototype,"title",2),rU=ej([rr("qti-end-attempt-interaction")],rU);var rL=e8(ti());var rN=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t._rows=5;t._value="";return t}c(e,[{key:"handleclassNamesChange",value:function t(t,e){var n=this;var r=e.split(" "),i=!1;if(r.forEach(function(t){if(t.startsWith("qti-height-lines-")){var e=t.replace("qti-height-lines-","");n._rows=parseInt(e),i=!0}}),!i&&this.expectedLength){var o=Math.ceil(this.expectedLength/50);this._rows=o}}},{key:"value",get:function t(){return this._value||null},set:function t(t){if(typeof t=="string"||t===null){this._value=t||"";var e=new FormData;e.append(this.responseIdentifier,this._value),this._internals.setFormValue(e),this.validate()}else throw new Error("Value must be a string")}},{key:"validate",value:function t(){var t=this.shadowRoot.querySelector("textarea");if(!t)return!1;if(this.patternMask&&this.dataPatternmaskMessage){this._internals.setValidity({}),t.setCustomValidity("");var e=this.patternMask.startsWith("^")&&this.patternMask.endsWith("$")?this.patternMask:"^".concat(this.patternMask,"$"),n=new RegExp(e);t.checkValidity()&&n.test(t.value)||(this._internals.setValidity({customError:!0},this.dataPatternmaskMessage),t.setCustomValidity(this.dataPatternmaskMessage))}else{var r=t.checkValidity();this._internals.setValidity(r?{}:{customError:!1})}return this._value!==""&&t.checkValidity()}},{key:"reportValidity",value:function t(){var t=this.shadowRoot.querySelector("textarea");if(!t)return!1;var e=this.validate();return e||t.reportValidity(),e}},{key:"render",value:function t(){var t=this;return nQ(to(),this.responseIdentifier,5e3,function(t){return t.stopImmediatePropagation()},this.textChanged,this.textChanged,function(e){t.reportValidity()},rk(this.placeholderText?this.placeholderText:void 0),this._rows,this.disabled,this.readonly,this._value)}},{key:"textChanged",value:function t(t){if(this.disabled||this.readonly)return;var e=t.target;this.setEmptyAttribute(e.value),this._value!==e.value&&(this.value=e.value,this.saveResponse(e.value))}},{key:"setEmptyAttribute",value:function t(t){this.setAttribute("empty",t===""?"true":"false")}}]);return e}(rS);rN.styles=rL,ej([i()],rN.prototype,"_rows",2),ej([r({type:Number,attribute:"expected-length"})],rN.prototype,"expectedLength",2),ej([r({type:String,attribute:"pattern-mask"})],rN.prototype,"patternMask",2),ej([r({type:String,attribute:"placeholder-text"})],rN.prototype,"placeholderText",2),ej([r({type:String,attribute:"data-patternmask-message"})],rN.prototype,"dataPatternmaskMessage",2),ej([i()],rN.prototype,"_value",2),ej([r({type:String,attribute:"class"})],rN.prototype,"classNames",2),ej([d("classNames")],rN.prototype,"handleclassNamesChange",1),rN=ej([rr("qti-extended-text-interaction")],rN);var rD=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.tabindex=0;return t}c(e,[{key:"connectedCallback",value:function t(){this.setAttribute("slot","drags")}}]);return e}(rt);rD.styles=e8(ta()),ej([r({type:Number,reflect:!0})],rD.prototype,"tabindex",2),rD=ej([rr("qti-gap-img")],rD);var rV=e8(ts());var rj=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nQ(tl())}},{key:"toggleCorrectResponse",value:function t(t,e){var n=this;if(e&&t.correctResponse){var r=[],i=Array.isArray(t.correctResponse)?t.correctResponse:[t.correctResponse];i&&(r=i.map(function(t){var e=t.split(" ");return{text:e[0],gap:e[1]}})),this.querySelectorAll("qti-gap").forEach(function(t){var e,i,o;var a=t.getAttribute("identifier"),s=(e=r.find(function(t){return t.gap===a}))===null||e===void 0?void 0:e.text,l=(i=n.querySelector('qti-gap-text[identifier="'.concat(s,'"]')))===null||i===void 0?void 0:i.textContent.trim();if(s&&l){var u;if(!((u=t.nextElementSibling)===null||u===void 0?void 0:u.classList.contains("correct-option"))){var c=document.createElement("span");c.classList.add("correct-option"),c.textContent=l,c.style.border="1px solid var(--qti-correct)",c.style.borderRadius="4px",c.style.padding="2px 4px",c.style.display="inline-block",t.insertAdjacentElement("afterend",c)}}else((o=t.nextElementSibling)===null||o===void 0?void 0:o.classList.contains("correct-option"))&&t.nextElementSibling.remove()})}else this.querySelectorAll(".correct-option").forEach(function(t){t.remove()})}}]);return e}(rC(rS,"qti-gap-text","qti-gap","slot[part='drags']"));rj.styles=rV,rj=ej([rr("qti-gap-match-interaction")],rj);var rH={toAttribute:function(t){return t?"true":"false"},fromAttribute:function(t){return t==="true"}};var rQ=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.tabindex=0;return t}c(e,[{key:"connectedCallback",value:function t(){h(f(e.prototype),"connectedCallback",this).call(this),this.setAttribute("slot","drags")}},{key:"render",value:function t(){return nQ(tu())}}]);return e}(U(rt,"qti-gap-text"));rQ.styles=e8(tc()),ej([r({type:Number,reflect:!0})],rQ.prototype,"tabindex",2),rQ=ej([rr("qti-gap-text")],rQ);var rF=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.tabindex=0;return t}c(e,[{key:"render",value:function t(){return nQ(td())}}]);return e}(rt);rF.styles=e8(th()),ej([r({type:Number,reflect:!0})],rF.prototype,"tabindex",2),rF=ej([rr("qti-gap")],rF);var rz={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},rB=function(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++){n[r]=arguments[r]}return{_$litDirective$:t,values:n}}},rW=/*#__PURE__*/function(){"use strict";function t(e){s(this,t)}c(t,[{key:"_$AU",get:function t(){return this._$AM._$AU}},{key:"_$AT",value:function t(t,e,n){this._$Ct=t,this._$AM=e,this._$Ci=n}},{key:"_$AS",value:function t(t,e){return this.update(t,e)}},{key:"update",value:function t(t,e){return this.render.apply(this,T(e))}}]);return t}();var rY=n6.I;var rX=function(t){return t.strings===void 0},rJ=function(){return document.createComment("")},rG=function(t,e,n){var r=t._$AA.parentNode,i=e===void 0?t._$AB:e._$AA;if(n===void 0){var o=r.insertBefore(rJ(),i),a=r.insertBefore(rJ(),i);n=new rY(o,a,t,t.options)}else{var s=n._$AB.nextSibling,l=n._$AM,u=l!==t;if(u){var c;var d;(c=n._$AQ)===null||c===void 0?void 0:c.call(n,t),n._$AM=t,n._$AP!==void 0&&(d=t._$AU)!==l._$AU&&n._$AP(d)}if(s!==i||u){var h=n._$AA;for(;h!==s;){var f=h.nextSibling;r.insertBefore(h,i),h=f}}}return n},rK=function(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t;return t._$AI(e,n),t},rZ={},r0=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:rZ;return t._$AH=e},r1=function(t){return t._$AH},r2=function(t){var e;(e=t._$AP)===null||e===void 0?void 0:e.call(t,!1,!0);var n=t._$AA,r=t._$AB.nextSibling;for(;n!==r;){var i=n.nextSibling;n.remove(),n=i}};var r3=function(t,e,n){var r=new Map;for(var i=e;i<=n;i++)r.set(t[i],i);return r},r5=rB(/*#__PURE__*/function(t){"use strict";v(e,t);function e(t){s(this,e);var n;if(n=a(this,e,[t]),t.type!==rz.CHILD)throw Error("repeat() can only be used in text expressions");return n}c(e,[{key:"dt",value:function t(t,e,n){var r;n===void 0?n=e:e!==void 0&&(r=e);var i=[],o=[],a=0;var s=true,l=false,u=undefined;try{for(var c=t[Symbol.iterator](),d;!(s=(d=c.next()).done);s=true){var h=d.value;i[a]=r?r(h,a):a,o[a]=n(h,a),a++}}catch(t){l=true;u=t}finally{try{if(!s&&c.return!=null){c.return()}}finally{if(l){throw u}}}return{values:o,keys:i}}},{key:"render",value:function t(t,e,n){return this.dt(t,e,n).values}},{key:"update",value:function t(t,e){var n=S(e,3),r=n[0],i=n[1],o=n[2];var a=r1(t),s=this.dt(r,i,o),l=s.values,u=s.keys;if(!Array.isArray(a))return this.ut=u,l;var c;var d=(c=this.ut)!==null&&c!==void 0?c:this.ut=[],h=[],f,v,p=0,y=a.length-1,m=0,g=l.length-1;for(;p<=y&&m<=g;)if(a[p]===null)p++;else if(a[y]===null)y--;else if(d[p]===u[m])h[m]=rK(a[p],l[m]),p++,m++;else if(d[y]===u[g])h[g]=rK(a[y],l[g]),y--,g--;else if(d[p]===u[g])h[g]=rK(a[p],l[g]),rG(t,h[g+1],a[p]),p++,g--;else if(d[y]===u[m])h[m]=rK(a[y],l[m]),rG(t,a[p],a[y]),y--,m++;else if(f===void 0&&(f=r3(u,m,g),v=r3(d,p,y)),f.has(d[p]))if(f.has(d[y])){var b=v.get(u[m]),_=b!==void 0?a[b]:null;if(_===null){var k=rG(t,a[p]);rK(k,l[m]),h[m]=k}else h[m]=rK(_,l[m]),rG(t,a[p],_),a[b]=null;m++}else r2(a[y]),y--;else r2(a[p]),p++;for(;m<=g;){var E=rG(t,h[g+1]);rK(E,l[m]),h[m++]=E}for(;p<=y;){var x=a[p++];x!==null&&r2(x)}return this.ut=u,r0(t,h),nB}}]);return e}(rW));var r4=e8(tf());var r6=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e);t.startPoint=null;t.endPoint=null;t._lines=[];t._correctLines=[];t.addEventListener("qti-register-hotspot",t.positionHotspotOnRegister);return t}c(e,[{key:"reset",value:function t(){this._lines=[],this._correctLines=[]}},{key:"validate",value:function t(){return this._lines.length>0}},{key:"value",get:function t(){return this._lines},set:function t(t){Array.isArray(t)&&(this._lines=t)}},{key:"toggleCorrectResponse",value:function t(t,e){if(!e){this._correctLines=[];return}if(!t.correctResponse){console.error("No correct response found for this interaction.");return}var n=Array.isArray(t.correctResponse)?t.correctResponse:[t.correctResponse];this._correctLines=n}},{key:"render",value:function t(){var t=this;var e,n,r,i;return nQ(tm(),rk((e=this.grImage[0])===null||e===void 0?void 0:e.width),rk((n=this.grImage[0])===null||n===void 0?void 0:n.height),(r=this.grImage[0])===null||r===void 0?void 0:r.width,(i=this.grImage[0])===null||i===void 0?void 0:i.height,r5(this._lines,function(t){return t},function(e,n){return nF(tv(),parseInt(t.querySelector("[identifier=".concat(e.split(" ")[0],"]")).style.left),parseInt(t.querySelector("[identifier=".concat(e.split(" ")[0],"]")).style.top),parseInt(t.querySelector("[identifier=".concat(e.split(" ")[1],"]")).style.left),parseInt(t.querySelector("[identifier=".concat(e.split(" ")[1],"]")).style.top),function(e){e.stopPropagation(),t._lines=t._lines.filter(function(t,e){return e!==n}),t.saveResponse(t._lines)})}),r5(this._correctLines,function(t){return t},function(e,n){return nF(tp(),parseInt(t.querySelector("[identifier=".concat(e.split(" ")[0],"]")).style.left),parseInt(t.querySelector("[identifier=".concat(e.split(" ")[0],"]")).style.top),parseInt(t.querySelector("[identifier=".concat(e.split(" ")[1],"]")).style.left),parseInt(t.querySelector("[identifier=".concat(e.split(" ")[1],"]")).style.top))}),this.startPoint&&nF(ty(),this.startCoord.x,this.startCoord.y,this.mouseCoord.x,this.mouseCoord.y))}},{key:"positionHotspotOnRegister",value:function t(t){var e=this.querySelector("img"),n=t.target,r=n.getAttribute("coords"),i=n.getAttribute("shape"),o=r.split(",").map(function(t){return parseInt(t)});eq(i,o,e,n)}},{key:"firstUpdated",value:function t(){var t=this;this.hotspots=this.querySelectorAll("qti-associable-hotspot"),document.addEventListener("mousemove",function(e){var n=t.grImage[0].getBoundingClientRect(),r=t.grImage[0].naturalWidth/n.width,i=t.grImage[0].naturalHeight/n.height;t.mouseCoord={x:(e.clientX-n.left)*r,y:(e.clientY-n.top)*i}}),this.hotspots.forEach(function(e){e.style.left=e.getAttribute("coords").split(",")[0]+"px",e.style.top=e.getAttribute("coords").split(",")[1]+"px",e.addEventListener("click",function(e){t.startPoint?t.endPoint||(t.endPoint=e.target,t._lines=T(t._lines).concat(["".concat(t.startPoint.getAttribute("identifier")," ").concat(t.endPoint.getAttribute("identifier"))]),t.saveResponse(t._lines),t.startPoint=null,t.endPoint=null):(t.startPoint=e.target,t.startCoord={x:parseInt(t.startPoint.getAttribute("coords").split(",")[0]),y:parseInt(t.startPoint.getAttribute("coords").split(",")[1])})})})}},{key:"disconnectedCallback",value:function t(){h(f(e.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}}]);return e}(rS);r6.styles=r4,ej([i()],r6.prototype,"_lines",2),ej([i()],r6.prototype,"_correctLines",2),ej([i()],r6.prototype,"startCoord",2),ej([i()],r6.prototype,"mouseCoord",2),ej([u({selector:"img"})],r6.prototype,"grImage",2),r6=ej([rr("qti-graphic-associate-interaction")],r6);var r9=e8(tg());var r7=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nQ(tb())}},{key:"positionHotspotOnRegister",value:function t(t){var e=t.target,n=e.getAttribute("coords"),r=e.getAttribute("shape"),i=n.split(",").map(function(t){return parseInt(t)});switch(r){case"circle":{var o=S(i,3),a=o[0],s=o[1],l=o[2];e.style.left=a-l+"px",e.style.top=s-l+"px",e.style.width=e.style.height=2*l+"px"}break;case"rect":{var u=S(i,4),c=u[0],d=u[1],h=u[2],f=u[3];e.style.left=c+"px",e.style.top=d+"px",e.style.width=h-c+"px",e.style.height=f-d+"px"}break;default:break}}},{key:"connectedCallback",value:function t(){h(f(e.prototype),"connectedCallback",this).call(this),this.addEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}},{key:"disconnectedCallback",value:function t(){h(f(e.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}}]);return e}(rC(rS,"qti-gap-img, qti-gap-text","qti-associable-hotspot","slot[part='drags']"));r7.styles=r9,r7=ej([rr("qti-graphic-gap-match-interaction")],r7);var r8=e8(t_());var it=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t._choiceElements=[];return t}c(e,[{key:"render",value:function t(){return nQ(tk())}},{key:"setHotspotOrder",value:function t(t){var e=t.detail,n=e.identifier,r=this._choiceElements.find(function(t){return t.getAttribute("identifier")===n});if(!r)return;var i=this._choiceElements.length;if(!this.choiceOrdering){if(this.choiceOrdering=!0,r.order==null){var o=this._choiceElements.filter(function(t){return t.order!=null}).length;if(o>=i){this.choiceOrdering=!1;return}r.order=o+1}else{var a=r.order;r.order=null,this._choiceElements.forEach(function(t){t.order!=null&&t.order>a&&t.order--})}this.choiceOrdering=!1}}},{key:"toggleCorrectResponse",value:function t(t,e){var n;var r=this._choiceElements;var i=true,o=false,a=undefined;try{var s=function(){var r=u.value;if(e&&((n=t.correctResponse)===null||n===void 0?void 0:n.length)>0&&Array.isArray(t.correctResponse)){var i=t.correctResponse.findIndex(function(t){return t===r.identifier});i>=0?r.orderCorrect=i+1:r.orderCorrect=null}else r.orderCorrect=null};for(var l=r[Symbol.iterator](),u;!(i=(u=l.next()).done);i=true)s()}catch(t){o=true;a=t}finally{try{if(!i&&l.return!=null){l.return()}}finally{if(o){throw a}}}}},{key:"positionHotspotOnRegister",value:function t(t){var e=this.querySelector("img"),n=t.target,r=n.getAttribute("coords"),i=n.getAttribute("shape"),o=r.split(",").map(function(t){return parseInt(t)});eq(i,o,e,n)}},{key:"connectedCallback",value:function t(){h(f(e.prototype),"connectedCallback",this).call(this),this.addEventListener("activate-qti-hotspot-choice",this.setHotspotOrder),this.addEventListener("register-qti-hotspot-choice",this.positionHotspotOnRegister)}},{key:"disconnectedCallback",value:function t(){h(f(e.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("activate-qti-hotspot-choice",this.setHotspotOrder),this.removeEventListener("register-qti-hotspot-choice",this.positionHotspotOnRegister)}}]);return e}(rP(rS,"qti-hotspot-choice"));it.styles=r8,it=ej([rr("qti-graphic-order-interaction")],it);var ie=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}return e}(U(rt,"qti-hotspot-choice"));ie.styles=e8(tE()),ej([r({attribute:"aria-ordervalue",type:Number,reflect:!0})],ie.prototype,"order",2),ej([r({attribute:"aria-ordercorrectvalue",type:Number,reflect:!0})],ie.prototype,"orderCorrect",2),ie=ej([rr("qti-hotspot-choice")],ie);var ir=e8(tx());var ii=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nQ(tw())}},{key:"positionHotspotOnRegister",value:function t(t){var e=this.querySelector("img"),n=t.target,r=n.getAttribute("coords"),i=n.getAttribute("shape"),o=r.split(",").map(function(t){return parseInt(t)});eq(i,o,e,n)}},{key:"connectedCallback",value:function t(){h(f(e.prototype),"connectedCallback",this).call(this),this.addEventListener("register-qti-hotspot-choice",this.positionHotspotOnRegister)}},{key:"disconnectedCallback",value:function t(){h(f(e.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("unregister-qti-hotspot-choice",this.positionHotspotOnRegister)}}]);return e}(rP(rS,"qti-hotspot-choice"));ii.styles=ir,ii=ej([rr("qti-hotspot-interaction")],ii);var io=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.render=function(){return nQ(tA())};return t}return e}(rP(rS,"qti-hottext"));io=ej([rr("qti-hottext-interaction")],io);var ia=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nQ(tC())}}]);return e}(U(rt,"qti-hottext"));ia.styles=e8(tq()),ia=ej([rr("qti-hottext")],ia);var is=/*#__PURE__*/function(t){"use strict";v(e,t);function e(t){s(this,e);var n;if(n=a(this,e,[t]),n.it=nW,t.type!==rz.CHILD)throw Error(n.constructor.directiveName+"() can only be used in child bindings");return n}c(e,[{key:"render",value:function t(t){if(t===nW||t==null)return this._t=void 0,this.it=t;if(t===nB)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;var e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}]);return e}(rW);is.directiveName="unsafeHTML",is.resultType=1;var il=rB(is);var iu=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.options=[];t.correctOption="";t.dataPrompt="select";return t}c(e,[{key:"render",value:function t(){return nQ(tP(),this.choiceSelected,this.disabled,this.readonly,this.options.map(function(t){return nQ(tR(),t.value,t.selected,il(t.textContent))}),il(this.correctOption))}},{key:"connectedCallback",value:function t(){h(f(e.prototype),"connectedCallback",this).call(this),this.addEventListener("on-dropdown-selected",this.choiceSelected);var t=Array.from(this.querySelectorAll("qti-inline-choice"));this.options=[{textContent:this.dataPrompt,value:"",selected:!1}].concat(T(t.map(function(t){return{textContent:t.innerHTML,value:t.getAttribute("identifier"),selected:!1}})))}},{key:"disconnectedCallback",value:function t(){this.removeEventListener("on-dropdown-selected",this.choiceSelected)}},{key:"validate",value:function t(){var t=this.options.find(function(t){return t.selected});return t?t.value!=="":!1}},{key:"reset",value:function t(){this.options=this.options.map(function(t,e){return x(k({},t),{selected:e===0})})}},{key:"value",get:function t(){var t;return((t=this.options.find(function(t){return t.selected}))===null||t===void 0?void 0:t.value)||null},set:function t(t){this.options=this.options.map(function(e){return t&&t===e.value&&(e.selected=!0),e})}},{key:"toggleCorrectResponse",value:function t(t,e){var n=this;if(this.correctResponse=e?t.value:"",!this.correctResponse){this.correctOption="";return}this.correctOption='<span part="correct-option">'.concat(this.options.find(function(t){return n.correctResponse===t.value}).textContent,"</span>")}},{key:"choiceSelected",value:function t(t){var e=t.target.value;this.options=this.options.map(function(t){return x(k({},t),{selected:t.value===e})}),this.saveResponse(e)}}],[{key:"styles",get:function t(){return[e8(tS())]}}]);return e}(rS);iu.inputWidthClass=["","qti-input-width-2","qti-input-width-1","qti-input-width-3","qti-input-width-4","qti-input-width-6","qti-input-width-10","qti-input-width-15","qti-input-width-20","qti-input-width-72"],ej([i()],iu.prototype,"options",2),ej([i()],iu.prototype,"correctOption",2),ej([r({attribute:"data-prompt",type:String})],iu.prototype,"dataPrompt",2),iu=ej([rr("qti-inline-choice-interaction")],iu);var ic=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"connectedCallback",value:function t(){h(f(e.prototype),"connectedCallback",this).call(this),this.addEventListener("click",this._onSelectInlineChoice),this.dispatchEvent(new CustomEvent("qti-inline-choice-register",{bubbles:!0,composed:!0,cancelable:!1}))}},{key:"disconnectedCallback",value:function t(){this.removeEventListener("click",this._onSelectInlineChoice)}},{key:"render",value:function t(){return nQ(tT())}},{key:"_onSelectInlineChoice",value:function t(){this.dispatchEvent(new CustomEvent("qti-inline-choice-select",{bubbles:!0,cancelable:!1,composed:!0,detail:{identifier:this.identifier}}))}}],[{key:"styles",get:function t(){return[e8(tM())]}}]);return e}(rt);ej([r({type:String})],ic.prototype,"identifier",2),ic=ej([rr("qti-inline-choice")],ic);var id=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.matchMin=0;t.matchMax=1;t.fixed=!1;return t}c(e,[{key:"connectedCallback",value:function t(){h(f(e.prototype),"connectedCallback",this).call(this),this.setAttribute("slot","qti-simple-associable-choice"),this.setAttribute("part","qti-simple-associable-choice")}},{key:"render",value:function t(){return nQ(tO())}}]);return e}(U(rt,"qti-simple-associable-choice"));id.styles=e8(t$()),ej([r({type:Number,attribute:"match-min"})],id.prototype,"matchMin",2),ej([r({type:Number,attribute:"match-max"})],id.prototype,"matchMax",2),ej([r({type:Boolean,attribute:"fixed"})],id.prototype,"fixed",2),id=ej([rr("qti-simple-associable-choice")],id);var ih=e8(tI());var iv=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.lastCheckedRadio=null;t.class="";t._response=[];t.responseIdentifier="";t.correctOptions=[];t.handleRadioClick=function(e){var n=e.target;t.lastCheckedRadio===n?(n.checked=!1,t.lastCheckedRadio=null,t.handleRadioChange(e)):t.lastCheckedRadio=n};t.handleRadioChange=function(e){var n=e.target,r=n.value,i=n.name,o=n.type;n.checked?(t.value?t.value.indexOf(r)===-1&&(o==="radio"&&(t.value=t.value.filter(function(t){return t.indexOf(i)===-1})),t.value=T(t.value).concat([r])):t.value=[r],t.lastCheckedRadio=n):(t.value=t.value.filter(function(t){return t!==r}),t.lastCheckedRadio=null),t.requestUpdate(),t.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:t.responseIdentifier,response:Array.isArray(t.value)?T(t.value):t.value}}))};return t}c(e,[{key:"value",get:function t(){return this.classList.contains("qti-match-tabular")?this._response:h(f(e.prototype),"value",this)},set:function t(t){this.classList.contains("qti-match-tabular")?this._response=t:C(f(e.prototype),"value",t,this,true)}},{key:"connectedCallback",value:function t(){var t=this;var n=this,r=function(){return h(f(e.prototype),"connectedCallback",t)};return o(function(){return L(this,function(t){r().call(n),n.rows=Array.from(n.querySelectorAll("qti-simple-match-set:first-of-type qti-simple-associable-choice")),n.cols=Array.from(n.querySelectorAll("qti-simple-match-set:last-of-type qti-simple-associable-choice")),n.value=[];return[2]})})()}},{key:"toggleCorrectResponse",value:function t(t,e){var n=this;if(e&&t.correctResponse){var r=[],i=Array.isArray(t.correctResponse)?t.correctResponse:[t.correctResponse];i&&(r=i.map(function(t){var e=t.split(" ");return{text:e[0],gap:e[1]}})),this.querySelectorAll("qti-simple-match-set > qti-simple-associable-choice").forEach(function(t){var e,i,o;var a=t.getAttribute("identifier"),s=(e=r.find(function(t){return t.gap===a}))===null||e===void 0?void 0:e.text,l=(i=n.querySelector('qti-simple-associable-choice[identifier="'.concat(s,'"]')))===null||i===void 0?void 0:i.textContent.trim();if(s&&l){var u;if(!((u=t.nextElementSibling)===null||u===void 0?void 0:u.classList.contains("correct-option"))){var c=document.createElement("span");c.classList.add("correct-option"),c.textContent=l,c.style.border="1px solid var(--qti-correct)",c.style.borderRadius="4px",c.style.padding="2px 4px",c.style.display="inline-block",t.insertAdjacentElement("beforebegin",c)}}else((o=t.nextElementSibling)===null||o===void 0?void 0:o.classList.contains("correct-option"))&&t.nextElementSibling.remove()})}else this.querySelectorAll(".correct-option").forEach(function(t){t.remove()})}},{key:"correctResponse",set:function t(t){if(t===""){this.correctOptions=[];return}else Array.isArray(t)&&(this.correctOptions=t,this.class.split(" ").includes("qti-match-tabular")||(this.value=t))}},{key:"render",value:function t(){var t=this;var e=this.class.split(" ").includes("qti-match-tabular");return nQ(tV(),e,e?nQ(tD(),this.cols.map(function(t){return nQ(tU(),il(t.innerHTML))}),this.rows.map(function(e){return nQ(tN(),il(e.innerHTML),t.cols.map(function(n){var r=e.getAttribute("identifier"),i=n.getAttribute("identifier"),o="".concat(r," ").concat(i),a=t.value.filter(function(t){return t.split(" ")[0]===r}).length||0,s=t.value.includes(o),l="rb ".concat(s?"rb-checked":""," ").concat(t.correctOptions.includes(o)?"rb-correct":""),u=t.correctOptions.length>0?!0:e.matchMax===1?!1:e.matchMax!==0&&a>=e.matchMax&&!s;return nQ(tL(),e.matchMax===1?"radio":"checkbox",l,r,o,u,function(e){return t.handleRadioChange(e)},function(n){return e.matchMax===1?t.handleRadioClick(n):null})}))})):nW)}}]);return e}(rC(rS,"qti-simple-match-set:first-of-type qti-simple-associable-choice, qti-simple-match-set:last-of-type > qti-simple-associable-choice > qti-simple-associable-choice","qti-simple-match-set:last-of-type > qti-simple-associable-choice","qti-simple-match-set:first-of-type"));iv.styles=ih,ej([r({type:String})],iv.prototype,"class",2),ej([i()],iv.prototype,"_response",2),ej([r({type:String,attribute:"response-identifier"})],iv.prototype,"responseIdentifier",2),ej([i()],iv.prototype,"correctOptions",2),iv=ej([rr("qti-match-interaction")],iv);var ip=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e);t._value=0;return t}c(e,[{key:"reset",value:function t(){}},{key:"validate",value:function t(){return!0}},{key:"value",get:function t(){return this._value.toString()},set:function t(t){if(t!==null)if(!isNaN(parseInt(t===null||t===void 0?void 0:t.toString())))this._value=parseInt(t.toString());else throw new Error("Value must be a number")}},{key:"render",value:function t(){return nQ(tj())}},{key:"connectedCallback",value:function t(){var t=this;h(f(e.prototype),"connectedCallback",this).call(this);var n=this.querySelector("audio")||this.querySelector("video")||this.querySelector("object");n&&n.addEventListener("ended",function(){t._value++,t.saveResponse(t.value)})}}],[{key:"properties",get:function t(){return x(k({},rS.properties),{step:{type:Number,attribute:"step",default:10}})}}]);return e}(rS);ip.styles=[e8(tH())],ip=ej([rr("qti-media-interaction")],ip);var iy=e8(tQ());var im=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.nrChoices=0;t.correctResponses=[];t.showCorrectResponses=!1;return t}c(e,[{key:"render",value:function t(){var t=Array.from(this.querySelectorAll("qti-simple-choice"));return this.nrChoices<t.length&&(this.nrChoices=t.length),nQ(tz(),T(Array(this.nrChoices)).map(function(t,e){return nQ(tF(),e)}))}},{key:"toggleCorrectResponse",value:function t(t,e){var n=this;if(e&&t.correctResponse){var r=[],i=Array.isArray(t.correctResponse)?t.correctResponse:[t.correctResponse];i&&(r=i.map(function(t){return{text:t.split(" ")[0]}})),this.querySelectorAll("qti-simple-choice").forEach(function(t,e){var i,o,a;var s=t.getAttribute("identifier"),l=(i=r.find(function(t){return t.text===s}))===null||i===void 0?void 0:i.text,u=(o=n.querySelector('qti-simple-choice[identifier="'.concat(l,'"]')))===null||o===void 0?void 0:o.textContent.trim();if(l&&u){var c;if(!((c=t.nextElementSibling)===null||c===void 0?void 0:c.classList.contains("correct-option"))){var d=document.createElement("span");d.classList.add("correct-option"),d.textContent=u,d.style.border="1px solid var(--qti-correct)",d.style.borderRadius="4px",d.style.padding="2px 4px",d.style.display="inline-block",n.shadowRoot.querySelector('drop-list[identifier="droplist'.concat(e,'"]')).insertAdjacentElement("afterend",d)}}else((a=n.shadowRoot.querySelector('drop-list[identifier="droplist'.concat(e,'"]')).nextElementSibling)===null||a===void 0?void 0:a.classList.contains("correct-option"))&&t.nextElementSibling.remove()})}else this.shadowRoot.querySelectorAll(".correct-option").forEach(function(t){t.remove()})}},{key:"getResponse",value:function t(){return Array.from(this.shadowRoot.querySelectorAll("drop-list")).map(function(t){var e=t.querySelectorAll('[qti-draggable="true"]');return T(Array.from(e).map(function(t){return t.getAttribute("identifier")})).join(" ")})}},{key:"firstUpdated",value:function t(t){var n=this;var r=this,i=function(){return h(f(e.prototype),"firstUpdated",n)};return o(function(){return L(this,function(e){i().call(r,t),r.childrenMap=Array.from(r.querySelectorAll("qti-simple-choice")),r.childrenMap.forEach(function(t){return t.setAttribute("part","qti-simple-choice")});return[2]})})()}}]);return e}(rM(rC(rS,"qti-simple-choice","drop-list","slot[part='drags']"),"qti-simple-choice"));im.styles=iy,ej([i()],im.prototype,"nrChoices",2),ej([i()],im.prototype,"correctResponses",2),ej([i()],im.prototype,"showCorrectResponses",2),ej([r({type:String})],im.prototype,"orientation",2),im=ej([rr("qti-order-interaction")],im);var ig=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;var n;t=a(this,e,arguments),n=t;t._errorMessage=null;t._onInteractionChanged=function(e){e.stopPropagation();var n=t.convertQtiVariableJSON(e.detail.value);t.value=n,t.saveResponse(n)};t.loadConfig=/*#__PURE__*/function(){var t=o(function(t,e){var r,i,o,a;return L(this,function(o){switch(o.label){case 0:t=n.removeDoubleSlashes(t);o.label=1;case 1:o.trys.push([1,5,,6]);return[4,fetch(t)];case 2:r=o.sent();if(!r.ok)return[3,4];return[4,r.json()];case 3:i=o.sent();for(var s in i.paths)e&&(i.paths[s]=n.getResolvablePath(i.paths[s],e));return[2,i];case 4:return[3,6];case 5:a=o.sent();return[3,6];case 6:return[2,null]}})});return function(e,n){return t.apply(this,arguments)}}();t.getResolvablePathString=function(e,n){return e=e.replace(/\.js$/,""),(e===null||e===void 0?void 0:e.toLocaleLowerCase().startsWith("http"))||!n?e:t.removeDoubleSlashes("".concat(n,"/").concat(e))};t.getResolvablePath=function(e,n){return Array.isArray(e)?e.map(function(e){return t.getResolvablePathString(e,n)}):t.getResolvablePathString(e,n)};return t}c(e,[{key:"convertQtiVariableJSON",value:function t(t){for(var e in t)if(t.hasOwnProperty(e)){var n=t[e];if(n){for(var r in n)if(n.hasOwnProperty(r)){var i=n[r];if(Array.isArray(i))return i.map(String);if(i!=null)return String(i)}}}return null}},{key:"addHyphenatedKeys",value:function t(t){var e=k({},t);for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var r=n.replace(/[A-Z]/g,function(t){return"-".concat(t.toLowerCase())});e[r]=t[n]}return e}},{key:"responseVariablesToQtiVariableJSON",value:function t(t,e,n){if(e!=="single"){var r={list:{}};return r.list[n]=t,r}else{var i={base:{}};return i.base[n]=t,i}}},{key:"validate",value:function t(){return!0}},{key:"value",get:function t(){var t;var e=(t=this.pci)===null||t===void 0?void 0:t.getResponse();return e?this.convertQtiVariableJSON(e):this._value},set:function t(t){this._value=t}},{key:"boundTo",get:function t(){var t=this;var e,n,r,i,o,a;var s=this.responseVariablesToQtiVariableJSON(this._value,((r=this.context)===null||r===void 0?void 0:(n=r.variables)===null||n===void 0?void 0:(e=n.find(function(e){return e.identifier===t.responseIdentifier}))===null||e===void 0?void 0:e.cardinality)||"single",((a=this.context)===null||a===void 0?void 0:(o=a.variables)===null||o===void 0?void 0:(i=o.find(function(e){return e.identifier===t.responseIdentifier}))===null||i===void 0?void 0:i.baseType)||"string"),l={};return l[this.responseIdentifier]=s,l},set:function t(t){var e=this.convertQtiVariableJSON(t);this._value=e,this.saveResponse(e)}},{key:"register",value:function t(t){var e=this;this.pci=t,this.dom=this.querySelector("qti-interaction-markup"),this.dom||(this.dom=document.createElement("div"),this.appendChild(this.dom)),this.dom.classList.add("qti-customInteraction"),this.dom.addEventListener("qti-interaction-changed",this._onInteractionChanged),this.querySelector("properties")&&(this.querySelector("properties").style.display="none");var n={properties:this.addHyphenatedKeys(k({},this.dataset)),onready:function(t){e.pci=t},ondone:function(t,n,r,i){e.value=e.convertQtiVariableJSON(n),e.saveResponse(e.value)},responseIdentifier:this.responseIdentifier,boundTo:this.boundTo};if(t.getInstance)t.getInstance(this.dom,n,void 0);else{var r=function(t){var e={},n=function(t){var e={};Object.entries(t.dataset).forEach(function(t){var n=S(t,2),r=n[0],i=n[1];r.includes("__")||(e[r]=i)});var n={};return Object.entries(t.dataset).forEach(function(t){var e=S(t,2),r=e[0],i=e[1];var o=r.split("__");if(o.length>1){var a=S(o,3),s=a[0],l=a[1],u=a[2];n[s]=n[s]||{},n[s][l]=n[s][l]||{},n[s][l][u]=i}}),Object.entries(n).forEach(function(t){var n=S(t,2),r=n[0],i=n[1];e[r]=Object.values(i)}),e}(t);for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];r==="config"?e[r]=JSON.parse(i):e[r]=i}return e}(this);t.initialize(this.customInteractionTypeIdentifier,this.dom.firstElementChild||this.dom,Object.keys(r).length?r:null)}}},{key:"connectedCallback",value:function t(){var t=this;h(f(e.prototype),"connectedCallback",this).call(this),define("qtiCustomInteractionContext",function(){return{register:function(e){t.register(e)},notifyReady:function(){}}});var n=this.buildRequireConfig(),r=requirejs.config(n);requirejs.onError=function(t){throw console.error("RequireJS error:",t),t.requireType==="timeout"&&console.error("Modules that timed out:",t.requireModules),t},r(["require"],function(e){try{e([t.module],function(){},function(t){console.error("Error loading module:",t)})}catch(t){console.error("Error in require call:",t)}})}},{key:"disconnectedCallback",value:function t(){h(f(e.prototype),"disconnectedCallback",this).call(this),requirejs.undef(this.customInteractionTypeIdentifier);var t=requirejs.s.contexts;delete t[this.customInteractionTypeIdentifier],this.removeEventListener("qti-interaction-changed",this._onInteractionChanged)}},{key:"buildRequireConfig",value:function t(){var t={context:this.customInteractionTypeIdentifier,catchError:!0,paths:window.requirePaths||{},shim:window.requireShim||{}};if(!globalThis.require)return this._errorMessage="RequireJS not found. Please load it via CDN: https://cdnjs.com/libraries/require.js",null;var e=this.getAttribute("data-base-url"),n=this.querySelector("qti-interaction-modules");if(n){var r=n.querySelectorAll("qti-interaction-module");var i=true,o=false,a=undefined;try{for(var s=r[Symbol.iterator](),l;!(i=(l=s.next()).done);i=true){var u=l.value;var c=u.getAttribute("id"),d=u.getAttribute("primary-path"),h=u.getAttribute("fallback-path");if(c&&d){var f=h?this.combineRequireResolvePaths(this.getResolvablePath(d,e),this.getResolvablePath(h,e)):this.getResolvablePath(d,e),v=t.paths[c]||[];t.paths[c]=this.combineRequireResolvePaths(v,f)}}}catch(t){o=true;a=t}finally{try{if(!i&&s.return!=null){s.return()}}finally{if(o){throw a}}}}return t}},{key:"combineRequireResolvePaths",value:function t(t,e){var n=Array.isArray(t)?t:[t],r=Array.isArray(e)?e:[e];return n.concat(r).filter(function(t,e,n){return n.indexOf(t)===e})}},{key:"removeDoubleSlashes",value:function t(t){return t.replace(/([^:]\/)\/+/g,"$1").replace(/\/\//g,"/").replace("http:/","http://").replace("https:/","https://")}},{key:"render",value:function t(){return nQ(tW(),this._errorMessage&&nQ(tB(),this._errorMessage))}}]);return e}(rS);ej([r({type:String,attribute:"module"})],ig.prototype,"module",2),ej([r({type:String,attribute:"custom-interaction-type-identifier"})],ig.prototype,"customInteractionTypeIdentifier",2),ej([i()],ig.prototype,"_errorMessage",2),ej([e({context:rs,subscribe:!0}),i()],ig.prototype,"context",2),ig=ej([rr("qti-portable-custom-interaction")],ig);var ib=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nQ(tY())}}]);return e}(rt);ib.styles=[e8(tX())];customElements.define("qti-position-object-interaction",ib);var i_=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e),t.removeMoveListener=t.removeMoveListener.bind(t),t.dragElementHandler=t.dragElementHandler.bind(t);return t}c(e,[{key:"render",value:function t(){return nQ(tJ())}},{key:"dragElementHandler",value:function t(t){t.preventDefault();var e=t.clientX-this.startX,n=t.clientY-this.startY;this.dragElement.style.left=this.dragElement.offsetLeft+e+"px",this.dragElement.style.top=this.dragElement.offsetTop+n+"px",this.startX=t.clientX,this.startY=t.clientY}},{key:"firstUpdated",value:function t(t){var n=this;h(f(e.prototype),"firstUpdated",this).call(this,t),this.dragElement=this.querySelector("qti-position-object-interaction>img"),this.startX=0,this.startY=0,this.dragElement.addEventListener("mousedown",function(t){n.startX=t.clientX,n.startY=t.clientY,document.addEventListener("mousemove",n.dragElementHandler,!0)}),document.addEventListener("mouseup",this.removeMoveListener)}},{key:"removeMoveListener",value:function t(){document.removeEventListener("mousemove",this.dragElementHandler,!0)}},{key:"disconnectedCallback",value:function t(){h(f(e.prototype),"disconnectedCallback",this).call(this),document.removeEventListener("mousemove",this.dragElementHandler),document.removeEventListener("mouseup",this.removeMoveListener)}}]);return e}(rt);i_.styles=[e8(tG())],i_=ej([rr("qti-position-object-stage")],i_);var ik="important",iE=" !"+ik,ix=rB(/*#__PURE__*/function(t){"use strict";v(e,t);function e(t){s(this,e);var n;var r;if(n=a(this,e,[t]),t.type!==rz.ATTRIBUTE||t.name!=="style"||((r=t.strings)===null||r===void 0?void 0:r.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.");return n}c(e,[{key:"render",value:function t(t){return Object.keys(t).reduce(function(e,n){var r=t[n];return r==null?e:e+"".concat(n=n.includes("-")?n:n.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase(),":").concat(r,";")},"")}},{key:"update",value:function t(t,e){var n=S(e,1),r=n[0];var i=t.element,o=i.style;if(this.ft===void 0)return this.ft=new Set(Object.keys(r)),this.render(r);var a=true,s=false,l=undefined;try{for(var u=this.ft[Symbol.iterator](),c;!(a=(c=u.next()).done);a=true){var d=c.value;r[d]==null&&(this.ft.delete(d),d.includes("-")?o.removeProperty(d):o[d]=null)}}catch(t){s=true;l=t}finally{try{if(!a&&u.return!=null){u.return()}}finally{if(s){throw l}}}for(var h in r){var f=r[h];if(f!=null){this.ft.add(h);var v=typeof f=="string"&&f.endsWith(iE);h.includes("-")||v?o.setProperty(h,v?f.slice(0,-11):f,v?ik:""):o[h]=f}}return nB}}]);return e}(rW));var iw=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.maxChoices=1/0;t.minChoices=0;t._points=[];t._correctAreas=[];t._imgElement=null;t._scaleX=1;t._scaleY=1;t._imageWidthOrginal=0;t._imageHeightOrginal=0;t._onImageClick=function(e){if(!t._imgElement){console.warn("No <img> element found in <qti-select-point-interaction>");return}t.calculateScale();var n=t._imgElement.getBoundingClientRect(),r=(e.clientX-n.left)*t._scaleX,i=(e.clientY-n.top)*t._scaleY,o="".concat(r.toFixed()," ").concat(i.toFixed());t.maxChoices===1?t._points=[o]:t.maxChoices===0||t._points.length<t.maxChoices?t._points=T(t._points).concat([o]):console.warn("Maximum number of points reached. Remove a marker to add a new one."),t.saveResponse(t._points)};t._onResize=function(){t.calculateScale()};return t}c(e,[{key:"connectedCallback",value:function t(){h(f(e.prototype),"connectedCallback",this).call(this),window.addEventListener("resize",this._onResize)}},{key:"toggleCorrectResponse",value:function t(t,e){if(!e){this._correctAreas=[];return}var n=t.areaMapping,r=[];if(!n||n.areaMapEntries.length===0)if(t.correctResponse){var i=Array.isArray(t.correctResponse)?t.correctResponse:[t.correctResponse];if(i.length===0||i.find(function(t){return t.split(" ").length<2}))return console.error("No valid correct responses found for the response variable."),null;console.warn("No area mapping found for the response variable. Using the correct responses to display the correct response but it probably won't score correct."),r=i.map(function(t){return{shape:"circle",coords:t.split(" ").join(",").concat(",10"),defaultValue:1,mappedValue:1}})}else{console.error("No area mapping found for the response variable.");return}else r=n.areaMapEntries;this._correctAreas=r.map(function(t){return{coords:t.coords,shape:t.shape}})}},{key:"updated",value:function t(t){h(f(e.prototype),"updated",this).call(this,t);var n=this._imgElement;n&&t.has("_correctAreas")&&this._correctAreas.length>0&&(this.calculateScale(),this.shadowRoot.querySelectorAll("div").forEach(function(t){var e=t.dataset.coord,r=t.dataset.shape;e&&r&&eq(r,e.split(",").map(function(t){return+t}),n,t)}))}},{key:"render",value:function t(){var t=this;var e;return nQ(t0(),r5(this._points.filter(function(t){return t}),function(t){return t},function(e,n){var r=S(e.split(" ").map(Number),2),i=r[0],o=r[1],a=i/(t._imageWidthOrginal||1)*100,s=o/(t._imageHeightOrginal||1)*100,l=16,u=l/(t._imageWidthOrginal||1)*100,c=l/(t._imageHeightOrginal||1)*100;return nQ(tK(),ix({pointerEvents:t.maxChoices===1?"none":"auto",position:"absolute",transform:"translate(-50%, -50%)",left:"".concat(a,"%"),top:"".concat(s,"%"),width:"min(".concat(u,"%, 1rem)"),height:"min(".concat(c,"%, 1rem)"),minWidth:"min(".concat(u,"%, 1rem)"),minHeight:"min(".concat(c,"%, 1rem)"),borderRadius:"50%",background:"red"}),e,function(e){e.stopPropagation(),t._points=t._points.filter(function(t,e){return e!==n}),t.saveResponse(t._points)})}),r5((e=this._correctAreas)===null||e===void 0?void 0:e.filter(function(t){return t}),function(t){return t},function(t,e){return nQ(tZ(),ix({position:"absolute",pointerEvents:"none",backgroundColor:"var(--qti-correct)",opacity:"0.5"}),t.coords,"correct-response-".concat(e+1),t.shape)}))}},{key:"reset",value:function t(){this._points=[]}},{key:"validate",value:function t(){return this._points.length>=this.minChoices&&this._points.length<=this.maxChoices}},{key:"value",get:function t(){return this._points},set:function t(t){this._points=Array.isArray(t)?t:t?[t]:[]}},{key:"calculateScale",value:function t(){this._imageWidthOrginal=this._imgElement.getAttribute("width")?parseFloat(this._imgElement.getAttribute("width")):this._imgElement.naturalWidth,this._imageHeightOrginal=this._imgElement.getAttribute("height")?parseFloat(this._imgElement.getAttribute("height")):this._imgElement.naturalHeight;var t=this._imgElement.getBoundingClientRect();this._scaleX=t.width===0?1:this._imageWidthOrginal/t.width,this._scaleY=t.height===0?1:this._imageHeightOrginal/t.height}},{key:"firstUpdated",value:function t(){this._imgElement=this.querySelector("img"),this._imgElement?(this.calculateScale(),this._imgElement.addEventListener("click",this._onImageClick)):console.warn("No <img> element found in <qti-select-point-interaction>")}},{key:"disconnectedCallback",value:function t(){h(f(e.prototype),"disconnectedCallback",this).call(this),window.removeEventListener("resize",this._onResize),this._imgElement&&this._imgElement.removeEventListener("click",this._onImageClick)}}]);return e}(rS);iw.styles=[e8(t1())],ej([r({type:Number,attribute:"max-choices"})],iw.prototype,"maxChoices",2),ej([r({type:Number,attribute:"min-choices"})],iw.prototype,"minChoices",2),ej([i()],iw.prototype,"_points",2),ej([i()],iw.prototype,"_correctAreas",2),iw=ej([rr("qti-select-point-interaction")],iw);var iA=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"checked",get:function t(){return this.internals.states.has("--checked")}},{key:"render",value:function t(){return nQ(t3(),this.marker?nQ(t2(),this.marker):nW)}}]);return e}(U(rt,"qti-simple-choice"));iA.styles=e8(t5()),ej([r({type:String,attribute:!1})],iA.prototype,"marker",2),iA=ej([rr("qti-simple-choice")],iA);var iC=e8(t4());var iq=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t._value=0;t._correctResponseNumber=null;t.min=0;t.max=100;t.step=1;return t}c(e,[{key:"validate",value:function t(){return!0}},{key:"connectedCallback",value:function t(){h(f(e.prototype),"connectedCallback",this).call(this),this._updateValue(this.min),this.setAttribute("tabindex","0"),this.setAttribute("role","slider")}},{key:"value",get:function t(){return this._value.toString()},set:function t(t){var e=parseInt(t,10);isNaN(e)||this._updateValue(e)}},{key:"toggleCorrectResponse",value:function t(t,e){if(e){this._correctResponse=t.correctResponse.toString();var n=parseFloat(t.correctResponse.toString());if(isNaN(n))this._correctResponseNumber=null;else{this._correctResponseNumber=n;var r=(this._correctResponseNumber-this.min)/(this.max-this.min)*100;this.style.setProperty("--value-percentage-correct","".concat(r,"%"))}}else this._correctResponseNumber=null;this.requestUpdate()}},{key:"_updateValue",value:function t(t){var e=this._value;if(this._value=Math.min(this.max,Math.max(this.min,t)),this._value===e)return;var n=(this._value-this.min)/(this.max-this.min)*100;this.style.setProperty("--value-percentage","".concat(n,"%")),this._internals.setFormValue(this.value),this.saveResponse(this.value),this.requestUpdate()}},{key:"render",value:function t(){return nQ(t9(),this.min,this.max,this._onMouseDown,this._onTouchStart,this.value,this._correctResponseNumber!==null?nQ(t6(),this._correctResponseNumber):null)}},{key:"_onMouseDown",value:function t(t){var e=this;this._startDrag(t.pageX);var n=function(t){return e._onDrag(t.pageX)},r=function(){document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",r),e._onDragEnd()};document.addEventListener("mousemove",n),document.addEventListener("mouseup",r)}},{key:"_onTouchStart",value:function t(t){var e=this;this._startDrag(t.touches[0].pageX);var n=function(t){return e._onDrag(t.touches[0].pageX)},r=function(){document.removeEventListener("touchmove",n),document.removeEventListener("touchend",r),e._onDragEnd()};document.addEventListener("touchmove",n,{passive:!1}),document.addEventListener("touchend",r)}},{key:"_startDrag",value:function t(t){this._onDrag(t)}},{key:"_onDrag",value:function t(t){var e=this._rail.getBoundingClientRect(),n=t-e.left,r=Math.min(1,Math.max(0,n/e.width)),i=this.min+Math.round(r*(this.max-this.min)/this.step)*this.step;this._updateValue(i)}},{key:"_onDragEnd",value:function t(){this.dispatchEvent(new Event("change",{bubbles:!0}))}}]);return e}(rS);iq.formAssociated=!0,iq.styles=iC,ej([l("#rail")],iq.prototype,"_rail",2),ej([r({type:Number,attribute:"lower-bound"})],iq.prototype,"min",2),ej([r({type:Number,attribute:"upper-bound"})],iq.prototype,"max",2),ej([r({type:Number,attribute:"step"})],iq.prototype,"step",2),iq=ej([rr("qti-slider-interaction")],iq);var iS=function(t,e){var n;var r=t._$AN;if(r===void 0)return!1;var i=true,o=false,a=undefined;try{for(var s=r[Symbol.iterator](),l;!(i=(l=s.next()).done);i=true){var u=l.value;(n=u._$AO)===null||n===void 0?void 0:n.call(u,e,!1),iS(u,e)}}catch(t){o=true;a=t}finally{try{if(!i&&s.return!=null){s.return()}}finally{if(o){throw a}}}return!0},iR=function(t){var e,n;do{if((e=t._$AM)===void 0)break;n=e._$AN,n.delete(t),t=e}while((n===null||n===void 0?void 0:n.size)===0)},iP=function(t){for(var e;e=t._$AM;t=e){var n=e._$AN;if(n===void 0)e._$AN=n=new Set;else if(n.has(t))break;n.add(t),iM(e)}};var iM=function(t){var e,n;t.type==rz.CHILD&&((e=t._$AP)!==null&&e!==void 0?e:t._$AP=eR,(n=t._$AQ)!==null&&n!==void 0?n:t._$AQ=eS)},iT=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments),t._$AN=void 0;return t}c(e,[{key:"_$AT",value:function t(t,n,r){h(f(e.prototype),"_$AT",this).call(this,t,n,r),iP(this),this.isConnected=t._$AU}},{key:"_$AO",value:function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;var n,r,i,o;t!==this.isConnected&&(this.isConnected=t,t?(n=(r=this).reconnected)===null||n===void 0?void 0:n.call(r):(i=(o=this).disconnected)===null||i===void 0?void 0:i.call(o)),e&&(iS(this,t),iR(this))}},{key:"setValue",value:function t(t){if(rX(this._$Ct))this._$Ct._$AI(t,this);else{var e=T(this._$Ct._$AH);e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}},{key:"disconnected",value:function t(){}},{key:"reconnected",value:function t(){}}]);return e}(rW);var iO=function(){return new i$},i$=function t(){"use strict";s(this,t)},iI=new WeakMap,iU=rB(/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(t){return nW}},{key:"update",value:function t(t,e){var n=S(e,1),r=n[0];var i;var o=r!==this.Y;return o&&this.Y!==void 0&&this.rt(void 0),(o||this.lt!==this.ct)&&(this.Y=r,this.ht=(i=t.options)===null||i===void 0?void 0:i.host,this.rt(this.ct=t.element)),nW}},{key:"rt",value:function t(t){if(this.isConnected||(t=void 0),typeof this.Y=="function"){var e;var n=(e=this.ht)!==null&&e!==void 0?e:globalThis,r=iI.get(n);r===void 0&&(r=new WeakMap,iI.set(n,r)),r.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),r.set(this.Y,t),t!==void 0&&this.Y.call(this.ht,t)}else this.Y.value=t}},{key:"lt",get:function t(){var t,e;var n;return typeof this.Y=="function"?(t=iI.get((n=this.ht)!==null&&n!==void 0?n:globalThis))===null||t===void 0?void 0:t.get(this.Y):(e=this.Y)===null||e===void 0?void 0:e.value}},{key:"disconnected",value:function t(){this.lt===this.ct&&this.rt(void 0)}},{key:"reconnected",value:function t(){this.rt(this.ct)}}]);return e}(iT));var iL=e8(t7());var iN=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t._value="";t.inputRef=iO();return t}c(e,[{key:"value",get:function t(){return this._value||null},set:function t(t){if(typeof t=="string"||t===null){this._value=t||"";var e=new FormData;e.append(this.responseIdentifier,this._value),this._internals.setFormValue(e),this.validate()}else throw new Error("Value must be a string")}},{key:"validate",value:function t(){var t=this.shadowRoot.querySelector("input");if(!t)return!1;if(this.patternMask&&this.dataPatternmaskMessage)this._internals.setValidity({}),t.setCustomValidity(""),t.checkValidity()||(this._internals.setValidity({customError:!0},this.dataPatternmaskMessage),t.setCustomValidity(this.dataPatternmaskMessage));else{var e=t.checkValidity();this._internals.setValidity(e?{}:{customError:!1})}return this._value!==""&&t.checkValidity()}},{key:"toggleCorrectResponse",value:function t(t,e){var n;var r=this.shadowRoot.querySelector("input");if(e&&t.correctResponse){var i,o;var a=t.correctResponse.toString();if(a){var s;if(!((s=r.nextElementSibling)===null||s===void 0?void 0:s.classList.contains("correct-option"))){var l=document.createElement("span");l.classList.add("correct-option"),l.textContent=a,l.style.border="1px solid var(--qti-correct)",l.style.borderRadius="4px",l.style.padding="2px 4px",l.style.margin="4px",l.style.display="inline-block",r.insertAdjacentElement("afterend",l)}}else((i=r.nextElementSibling)===null||i===void 0?void 0:i.classList.contains("correct-option"))&&((o=r.nextElementSibling)===null||o===void 0?void 0:o.remove())}else(n=r.nextElementSibling)===null||n===void 0?void 0:n.remove()}},{key:"render",value:function t(){var t=this;return nQ(t8(),this.responseIdentifier,function(e){t.reportValidity()},function(t){return t.stopImmediatePropagation()},this.textChanged,this.textChanged,this.patternMask=="[0-9]*"?"number":"text",rk(this.placeholderText?this.placeholderText:void 0),this._value,rk(this.patternMask?this.patternMask:void 0),1e3,this.disabled,this.readonly,this._correctResponse)}},{key:"textChanged",value:function t(t){if(this.disabled||this.readonly)return;var e=t.target;this.setEmptyAttribute(e.value),this._value!==e.value&&(this.value=e.value,this.saveResponse(e.value))}},{key:"reportValidity",value:function t(){var t=this.shadowRoot.querySelector("input");if(!t)return!1;var e=this.validate();return e||t.reportValidity(),e}},{key:"reset",value:function t(){this._value=""}},{key:"setEmptyAttribute",value:function t(t){this.setAttribute("empty",t===""?"true":"false")}}]);return e}(rS);iN.styles=iL,ej([r({type:Number,attribute:"expected-length"})],iN.prototype,"expectedLength",2),ej([r({type:String,attribute:"pattern-mask"})],iN.prototype,"patternMask",2),ej([r({type:String,attribute:"placeholder-text"})],iN.prototype,"placeholderText",2),ej([r({type:String,attribute:"data-patternmask-message"})],iN.prototype,"dataPatternmaskMessage",2),ej([i()],iN.prototype,"_value",2),iN=ej([rr("qti-text-entry-interaction")],iN);var iD=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t._file=null;t._base64=null;return t}c(e,[{key:"reset",value:function t(){this._file=null,this._base64=null,this.saveResponse(null)}},{key:"validate",value:function t(){return this._base64!==null}},{key:"value",get:function t(){return this._base64},set:function t(t){if(typeof t=="string")this._base64=t,this.saveResponse(t);else if(t===null)this.reset();else throw new Error("Value must be a Base64-encoded string or null")}},{key:"render",value:function t(){return nQ(et(),this._onFileChange,this.disabled,this.readonly)}},{key:"_onFileChange",value:function t(t){var e=this;return o(function(){var n,r;return L(this,function(i){switch(i.label){case 0:n=t.target;r=n.files&&n.files.length>0;if(!r)return[3,2];e._file=n.files[0];return[4,e._convertToBase64(e._file)];case 1:r=(e._base64=i.sent(),e.saveResponse(e._base64),e.dispatchEvent(new CustomEvent("qti-interaction-response",{detail:{response:e._base64}})));i.label=2;case 2:r;return[2]}})})()}},{key:"_convertToBase64",value:function t(t){return new Promise(function(e,n){var r=new FileReader;r.onload=function(){return e(r.result)},r.onerror=function(){return n(r.error)},r.readAsDataURL(t)})}}],[{key:"properties",get:function t(){return k({},rS.properties)}}]);return e}(rS);iD.styles=[e8(ee())],iD=ej([rr("qti-upload-interaction")],iD);var iV=e8(en());var ij=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nQ(er())}}]);return e}(rt);ij.styles=iV,ij=ej([rr("qti-item-body")],ij);var iH=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nQ(ei())}},{key:"process",value:function t(){var t=new iQ,e=T(this.children);t.process(e)}}]);return e}(rt);iH.styles=[e8(eo())],iH=ej([rr("qti-outcome-processing")],iH);var iQ=/*#__PURE__*/function(){"use strict";function t(){s(this,t)}c(t,[{key:"process",value:function t(t){var e=true,n=false,r=undefined;try{for(var i=t[Symbol.iterator](),o;!(e=(o=i.next()).done);e=true){var a=o.value;a.process()}}catch(t){n=true;r=t}finally{try{if(!e&&i.return!=null){i.return()}}finally{if(n){throw r}}}}}]);return t}();var iF=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nQ(ea())}},{key:"connectedCallback",value:function t(){this.parentElement.tagName.endsWith("INTERACTION")&&this.setAttribute("slot","prompt")}}]);return e}(rt);iF=ej([rr("qti-prompt")],iF);var iz='<qti-response-processing>\n <qti-response-condition>\n <qti-response-if>\n <qti-match>\n <qti-variable identifier="RESPONSE"></qti-variable>\n <qti-correct identifier="RESPONSE"></qti-correct>\n </qti-match>\n <qti-set-outcome-value identifier="SCORE">\n <qti-base-value base-type="float">1</qti-base-value>\n </qti-set-outcome-value>\n </qti-response-if>\n <qti-response-else>\n <qti-set-outcome-value identifier="SCORE">\n <qti-base-value base-type="float">0</qti-base-value>\n </qti-set-outcome-value>\n </qti-response-else>\n </qti-response-condition>\n</qti-response-processing>',iB='<qti-response-processing>\n <qti-response-condition>\n <qti-response-if>\n <qti-is-null>\n <qti-variable identifier="RESPONSE"></qti-variable>\n </qti-is-null>\n <qti-set-outcome-value identifier="SCORE">\n <qti-base-value base-type="float">0.0</qti-base-value>\n </qti-set-outcome-value>\n </qti-response-if>\n <qti-response-else>\n <qti-set-outcome-value identifier="SCORE">\n <qti-map-response identifier="RESPONSE"> </qti-map-response>\n </qti-set-outcome-value>\n </qti-response-else>\n </qti-response-condition>\n</qti-response-processing>',iW='<qti-response-processing>\n <qti-response-condition>\n <qti-response-if>\n <qti-is-null>\n <qti-variable identifier="RESPONSE"></qti-variable>\n </qti-is-null>\n <qti-set-outcome-value identifier="SCORE">\n <qti-base-value base-type="float">0</qti-base-value>\n </qti-set-outcome-value>\n </qti-response-if>\n <qti-response-else>\n <qti-set-outcome-value identifier="SCORE">\n <qti-map-response-point identifier="RESPONSE"></qti-map-response-point>\n </qti-set-outcome-value>\n </qti-response-else>\n </qti-response-condition>\n</qti-response-processing>';var iY=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nQ(es())}},{key:"process",value:function t(){if(!this.closest("qti-assessment-item"))return;var t=T(this.children);var e=true,n=false,r=undefined;try{for(var i=t[Symbol.iterator](),o;!(e=(o=i.next()).done);e=true){var a=o.value;a.process()}}catch(t){n=true;r=t}finally{try{if(!e&&i.return!=null){i.return()}}finally{if(n){throw r}}}}},{key:"firstUpdated",value:function t(t){if(this.getAttribute("template")){var e=this.getAttribute("template").split("/"),n=e[e.length-1].replace(".xml","");switch(this.innerHTML="",n){case"map_response":{this.appendChild(this.fragmentFromString(iB).firstElementChild.firstElementChild);break}case"map_response_point":{this.appendChild(this.fragmentFromString(iW).firstElementChild.firstElementChild);break}case"match_correct":this.appendChild(this.fragmentFromString(iz).firstElementChild.firstElementChild);break}}}},{key:"fragmentFromString",value:function t(t){return document.createRange().createContextualFragment(t)}}]);return e}(rt);iY.styles=[e8(el())],iY=ej([rr("qti-response-processing")],iY);var iX=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nQ(eu())}},{key:"process",value:function t(){throw new Error("Not implemented")}}]);return e}(rt);iX=ej([rr("qti-rule")],iX);var iJ=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"childExpression",get:function t(){return this.firstElementChild}},{key:"process",value:function t(){var t=this.getAttribute("identifier"),e=this.closest("qti-assessment-item").getVariable(t),n;return e.interpolationTable&&(n=e.interpolationTable.get(parseInt(this.childExpression.calculate()))),n==null?(console.warn("lookupOutcomeValue: value is null or undefined"),0):(this.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:this.identifier,value:rg(n)}})),n)}}]);return e}(iX);ej([r({type:String})],iJ.prototype,"identifier",2);customElements.define("qti-lookup-outcome-value",iJ);var iG=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nQ(ec())}},{key:"process",value:function t(){var t=T(this.children);for(var e=0;e<t.length;e++){var n=t[e];if(n.calculate()){n.process();return}}}}]);return e}(iX);customElements.define("qti-response-condition",iG);var iK=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"process",value:function t(){var t=this.getAttribute("identifier");if(!t){console.warn('QtiSetOutcomeValue: Missing "identifier" attribute.');return}var e=this.firstElementChild;if(!e){console.warn("QtiSetOutcomeValue: No expression found.");return}var n=new iZ(e).process();this.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:t,value:this.formatValue(n)}}))}},{key:"formatValue",value:function t(t){return Array.isArray(t)?t.map(rg):t!==null?rg(t):null}}]);return e}(iX),iZ=/*#__PURE__*/function(){"use strict";function t(e){s(this,t);this.expression=e}c(t,[{key:"process",value:function t(){var t;var e=(t=this.expression.calculate())!==null&&t!==void 0?t:null;return e===null&&console.warn("QtiSetOutcomeValueRule: Evaluated value is null."),Array.isArray(e)?e.map(function(t){return t.value?t.value:t}):e}}]);return t}();customElements.define("qti-set-outcome-value",iK);var i0=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nQ(ed())}},{key:"calculate",value:function t(){return!0}},{key:"getSubRules",value:function t(){return T(this.children)}},{key:"process",value:function t(){var t=this.getSubRules();for(var e=0;e<t.length;e++)t[e].process()}}]);return e}(rt);customElements.define("qti-response-else",i0);var i1=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"calculate",value:function t(){return this.firstElementChild.calculate()}},{key:"getSubRules",value:function t(){var t=[];for(var e=1;e<this.children.length;e++)t.push(this.children[e]);return t}}]);return e}(i0);customElements.define("qti-response-if",i1);var i2=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nQ(eh(),h(f(e.prototype),"render",this).call(this))}}]);return e}(i1);customElements.define("qti-response-else-if",i2);var i3=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.getVariables=function(){return Array.from(t.children).map(function(e){switch(e.tagName.toLowerCase()){case"qti-base-value":return{baseType:e.getAttribute("base-type"),value:e.textContent.trim(),cardinality:"single"};case"qti-variable":{var n=e.getAttribute("identifier")||"";return t.context.variables.find(function(t){return t.identifier===n})||null}case"qti-multiple":{var r=e.getResult();return r.length>0?{identifier:"",baseType:r[0].baseType,value:r.map(function(t){return t.value}),cardinality:"multiple",type:"response"}:null}case"qti-correct":{var i=e.getAttribute("identifier")||"",o=t.context.variables.find(function(t){return t.identifier===i})||null;return{baseType:o.baseType,value:o.correctResponse,cardinality:o.cardinality}}default:{try{return{baseType:"integer",value:e.getResult().toString(),cardinality:"single"}}catch(t){console.warn("default not sufficient")}return null}}}).filter(function(t){return t!==null})};return t}c(e,[{key:"render",value:function t(){return nQ(ef(),JSON.stringify(this.result,null,2))}},{key:"calculate",value:function t(){return this.result=this.getResult(),this.result}},{key:"getResult",value:function t(){throw new Error("Not implemented")}}]);return e}(rt);i3.styles=e8(ev()),ej([i()],i3.prototype,"result",2),ej([e({context:rs,subscribe:!0}),i()],i3.prototype,"context",2);var i5=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"calculate",value:function t(){return this.result=this.getResult(),this.result}},{key:"getResult",value:function t(){throw new Error("Not implemented")}}]);return e}(i3);var i4=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"calculate",value:function t(){return this.calculateChildren(Array.from(this.children))}}]);return e}(eP(i5));i4=ej([rr("qti-and")],i4);var i6=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.baseType="string";return t}c(e,[{key:"getResult",value:function t(){return this.textContent.trim()}}]);return e}(i3);ej([r({type:String,attribute:"base-type"})],i6.prototype,"baseType",2);customElements.define("qti-base-value",i6);var i9=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){var t=this.getVariables();if(this.children.length===2){var e=t[0],n=t[1];if(e.baseType==="directedPair"&&n.baseType==="directedPair"&&e.cardinality==="multiple"){var r=e.value,i=n.value;return r.filter(function(t){return i.includes(t)}).length>0}else if(e.baseType==="directedPair"&&n.baseType==="directedPair"&&e.cardinality==="single"){var o=e.value;return n.value.includes(o)}else console.error("unsupported baseType or cardinality in qti contains, only baseType: directedPair and cardinality: multiple is supported")}else console.error("unexpected number of children in qti contains");return!1}}]);return e}(i5);customElements.define("qti-contains",i9);var i7=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"interpretation",get:function t(){return this.getAttribute("interpretation")||""}},{key:"getResult",value:function t(){var t=this.getAttribute("identifier")||"",e=this.context.variables.find(function(e){return e.identifier===t})||null;return e.cardinality!=="single"?e.correctResponse.length>0?e.correctResponse[0]:"":e.correctResponse}}]);return e}(i3);customElements.define("qti-correct",i7);var i8=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.roundingMode="significantFigures";return t}c(e,[{key:"figures",get:function t(){if(!this.getAttribute("figures"))return console.error("figures attribute is missing"),null;var t=parseInt(this.getAttribute("figures")||"0");return isNaN(t)?(console.error("figures attribute is not a number"),null):t<0?(console.error("figures attribute is negative"),null):t<1&&this.roundingMode==="significantFigures"?(console.error("figures cannot be smaller than 1 for RoundingMode significantFigures"),null):t}},{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),e=t[0],n=t[1];if(this.roundingMode===null)return null;if(e.cardinality!=="single"||n.cardinality!=="single"||Array.isArray(e.value)||Array.isArray(n.value))return console.error("unexpected cardinality in qti equal"),!1;switch(t[0].baseType){case"integer":case"float":{var r=parseFloat(e.value),i=parseFloat(n.value);if(!isNaN(r)&&!isNaN(i))return this.roundingMode==="significantFigures"?r.toPrecision(this.figures)===i.toPrecision(this.figures):Math.round(r*Math.pow(10,this.figures))/Math.pow(10,this.figures)===Math.round(i*Math.pow(10,this.figures))/Math.pow(10,this.figures);console.error("value cannot be casted to numeric value in equalRounded operator: ".concat(r,", ").concat(i));break}default:{console.error("values other than float and int cannot be used in equalRounded operator.");break}}return!1}return console.error("unexpected number of children in qti-equal-rounded"),null}}]);return e}(i3);ej([r({type:String})],i8.prototype,"roundingMode",2);customElements.define("qti-equal-rounded",i8);var ot=/*#__PURE__*/function(){"use strict";function t(){s(this,t)}c(t,null,[{key:"isPointInArea",value:function t(t,e,n){if(n!=="point")return console.warn("Base type ".concat(n," is not supported for point area mapping.")),!1;var r=S(t.split(" ").map(Number),2),i=r[0],o=r[1],a=M(e.split(",")),s=a[0],l=a.slice(1),u=l.map(Number);switch(s.toLowerCase()){case"circle":case"default":{var c=S(u,3),d=c[0],h=c[1],f=c[2];return u.length!==3?(console.warn("Invalid circle definition: ".concat(e)),!1):Math.sqrt(Math.pow(i-d,2)+Math.pow(o-h,2))<=f}case"rect":{var v=S(u,4),p=v[0],y=v[1],m=v[2],g=v[3];return u.length!==4?(console.warn("Invalid rectangle definition: ".concat(e)),!1):i>=p&&i<=m&&o>=y&&o<=g}case"ellipse":{var b=S(u,4),_=b[0],k=b[1],E=b[2],x=b[3];if(u.length!==4)return console.warn("Invalid ellipse definition: ".concat(e)),!1;var w=Math.pow(i-_,2)/Math.pow(E,2),A=Math.pow(o-k,2)/Math.pow(x,2);return w+A<=1}case"poly":{if(u.length<6||u.length%2!==0)return console.warn("Invalid polygon definition: ".concat(e)),!1;var C=[];for(var q=0;q<u.length;q+=2)C.push({x:u[q],y:u[q+1]});return this.isPointInPolygon({x:i,y:o},C)}default:return console.warn("Unsupported shape type: ".concat(s)),!1}}},{key:"isPointInPolygon",value:function t(t,e){var n=!1;for(var r=0,i=e.length-1;r<e.length;i=r++){var o=e[r].x,a=e[r].y,s=e[i].x,l=e[i].y;a>t.y!=l>t.y&&t.x<(s-o)*(t.y-a)/(l-a)+o&&(n=!n)}return n}},{key:"compareSingleValues",value:function t(t,e,n){switch(n){case"identifier":case"string":return t===e;case"integer":{var r=parseInt(t,10),i=parseInt(e,10);if(!isNaN(r)&&!isNaN(i))return r===i;console.error("Cannot convert ".concat(t," and/or ").concat(e," to int."));break}case"float":{var o=parseFloat(t),a=parseFloat(e);if(!isNaN(o)&&!isNaN(a))return o===a;console.error("couldn't convert ".concat(t," and/or ").concat(e," to float."));break}case"pair":case"directedPair":{var s=t.split(" ").sort(),l=e.split(" ").sort();if(s.length===2&&l.length===2)return n==="pair"&&(s.sort(),l.sort()),s.join(" ")===l.join(" ");console.error("compared two pair but one of the values does not have 2 values: 1: ".concat(t," 2: ").concat(e));break}}return!1}}]);return t}();var oe=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.toleranceMode="exact";return t}c(e,[{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),e=t[0],n=t[1];return this.toleranceMode!=="exact"?(console.error("toleranceMode is not supported yet"),!1):e.cardinality!=="single"||n.cardinality!=="single"||Array.isArray(e.value)||Array.isArray(n.value)?(console.error("unexpected cardinality in qti equal"),!1):ot.compareSingleValues(e.value,n.value,e.baseType)}return console.error("unexpected number of children in qti-equal"),null}}]);return e}(i3);ej([r({type:String})],oe.prototype,"toleranceMode",2);customElements.define("qti-equal",oe);var on=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),e=t[0],n=t[1];if((e.baseType==="integer"||e.baseType==="float")&&(n.baseType==="integer"||n.baseType==="float"))return+e.value>+n.value;console.error("unexpected baseType or cardinality in qti gt")}return console.error("unexpected number of children in qt"),null}}]);return e}(i3);customElements.define("qti-gt",on);var or=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),e=t[0],n=t[1];return(e.baseType==="integer"||e.baseType==="float")&&(n.baseType==="integer"||n.baseType==="float")?+e.value>=+n.value:(console.error("unexpected baseType or cardinality in qti gte"),null)}return console.log("unexpected number of children in qte"),null}}]);return e}(i5);customElements.define("qti-gte",or);var oi=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){if(this.children.length===1){var t=this.getVariables();if(!t)return!0;var e=t[0].value;return e==null||e==null||e===""}return console.error("unexpected number of children in qti Null"),null}}]);return e}(i3);customElements.define("qti-is-null",oi);var oo=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),e=t[0],n=t[1];if((e.baseType==="integer"||e.baseType==="float")&&(n.baseType==="integer"||n.baseType==="float"))return+e.value<+n.value;console.error("unexpected baseType or cardinality in qti lt")}return console.error("unexpected number of children in lt"),null}}]);return e}(i3);customElements.define("qti-lt",oo);var oa=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),e=t[0],n=t[1];return(e.baseType==="integer"||e.baseType==="float")&&(n.baseType==="integer"||n.baseType==="float")?+e.value<=+n.value:(console.error("unexpected baseType or cardinality in qti lte"),null)}return console.log("unexpected number of children in lte"),null}}]);return e}(i5);customElements.define("qti-lte",oa);var os=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){var t=this;var e=this.context.variables.find(function(e){return e.identifier===t.identifier});if(!e||!e.mapping)return console.error("Response ".concat(this.identifier," can not be found")),null;var n=e.mapping,r=Array.isArray(e.value)?e.value:[e.value],i=0;var o=true,a=false,s=undefined;try{var l=function(){var t=c.value;var r=n.mapEntries.filter(function(n){return e.baseType==="string"&&!n.caseSensitive?ot.compareSingleValues(n.mapKey.toLowerCase(),t.toLowerCase(),e.baseType):ot.compareSingleValues(n.mapKey,t,e.baseType)}),o=r.reduce(function(t,e){return t.mappedValue>e.mappedValue?t:e},r.length>0?r[0]:{mapKey:null,mappedValue:null});o===null||o.mappedValue==null?i+=n.defaultValue:i+=o.mappedValue};for(var u=r[Symbol.iterator](),c;!(o=(c=u.next()).done);o=true)l()}catch(t){a=true;s=t}finally{try{if(!o&&u.return!=null){u.return()}}finally{if(a){throw s}}}return(n===null||n===void 0?void 0:n.lowerBound)!==null&&(n===null||n===void 0?void 0:n.lowerBound)!==void 0&&(i=Math.max(n.lowerBound,i)),(n===null||n===void 0?void 0:n.upperBound)!==null&&(n===null||n===void 0?void 0:n.upperBound)!==void 0&&(i=Math.min(n.upperBound,i)),i}}]);return e}(i3);ej([r({type:String})],os.prototype,"identifier",2);customElements.define("qti-map-response",os);var ol=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.getVariables=function(){return Array.from(t.children).map(function(e){switch(e.tagName.toLowerCase()){case"qti-base-value":return{baseType:e.getAttribute("base-type"),value:e.textContent.trim(),cardinality:"single"};case"qti-variable":{var n=e.getAttribute("identifier")||"";return t.context.variables.find(function(t){return t.identifier===n})||null}case"qti-multiple":{var r=e.getResult();return r.length>0?{identifier:"",baseType:r[0].baseType,value:r.map(function(t){return t.value}),cardinality:"multiple",type:"response"}:null}case"qti-correct":{var i=e.getAttribute("identifier")||"",o=t.context.variables.find(function(t){return t.identifier===i})||null;return{baseType:o.baseType,value:o.correctResponse,cardinality:o.cardinality}}default:{try{return{baseType:"integer",value:e.getResult().toString(),cardinality:"single"}}catch(t){console.warn("default not sufficient")}return null}}}).filter(function(t){return t!==null})};return t}c(e,[{key:"render",value:function t(){return nQ(ep(),JSON.stringify(this.result,null,2))}},{key:"calculate",value:function t(){return this.result=this.getResult(),this.result}},{key:"getResult",value:function t(){throw new Error("Not implemented")}}]);return e}(rt);ol.styles=e8(ey()),ej([i()],ol.prototype,"result",2),ej([e({context:rs,subscribe:!0}),i()],ol.prototype,"context",2);var ou=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){var t=this;var e=this.context.variables.find(function(e){return e.identifier===t.identifier});if(!e)return console.warn("Response ".concat(this.identifier," cannot be found")),null;var n=e.areaMapping;if(!n)return console.warn("Area mapping not found for response ".concat(this.identifier)),null;var r=Array.isArray(e.value)?e.value:[e.value];if(!r||r.length===0)return console.warn("No candidate responses for response ".concat(this.identifier)),null;var i=0,o=new Set;var a=true,s=false,l=undefined,u=true,c=false,d=undefined;try{for(var h=r[Symbol.iterator](),f;!(u=(f=h.next()).done);u=true){var v=f.value;try{for(var p=n.areaMapEntries[Symbol.iterator](),y;!(a=(y=p.next()).done);a=true){var m=y.value;if(o.has(m.coords))continue;var g;ot.isPointInArea(v,"".concat(m.shape,",").concat(m.coords),e.baseType)&&(i+=(g=m.mappedValue)!==null&&g!==void 0?g:0,o.add(m.coords))}}catch(t){s=true;l=t}finally{try{if(!a&&p.return!=null){p.return()}}finally{if(s){throw l}}}}}catch(t){c=true;d=t}finally{try{if(!u&&h.return!=null){h.return()}}finally{if(c){throw d}}}return o.size<r.length&&(i+=n.defaultValue),n.lowerBound!=null&&(i=Math.max(n.lowerBound,i)),n.upperBound!=null&&(i=Math.min(n.upperBound,i)),i}}]);return e}(ol);ej([r({type:String})],ou.prototype,"identifier",2);customElements.define("qti-map-response-point",ou);var oc=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),n=t[0],r=t[1];return e.match(n,r)}return console.error("unexpected number of children in match"),null}}],[{key:"match",value:function t(t,e){switch(e.cardinality){case"single":var n;return t.value===null?!1:Array.isArray(t.value)||Array.isArray(e.value)?(console.error("unexpected cardinality in qti match"),!1):ot.compareSingleValues((n=t.value)===null||n===void 0?void 0:n.toString(),e.value.toString(),e.baseType);case"ordered":{if(!Array.isArray(t.value)||!Array.isArray(e.value))return console.error("unexpected cardinality in qti match"),!1;if(t.value.length!==e.value.length)return!1;for(var r=0;r<t.value.length;r++)if(!ot.compareSingleValues(e.value[r],t.value[r],e.baseType))return!1;return!0}case"multiple":{if(!Array.isArray(t.value)||!Array.isArray(e.value))return console.error("unexpected cardinality in qti match"),!1;if(t.value.length!==e.value.length)return!1;var i=0;var o=true,a=false,s=undefined;try{for(var l=e.value[Symbol.iterator](),u;!(o=(u=l.next()).done);o=true){var c=u.value;var d=null,h=T(t.value);var f=true,v=false,p=undefined;try{for(var y=h[Symbol.iterator](),m;!(f=(m=y.next()).done);f=true){var g=m.value;if(ot.compareSingleValues(c,g,e.baseType)){d=g;break}}}catch(t){v=true;p=t}finally{try{if(!f&&y.return!=null){y.return()}}finally{if(v){throw p}}}if(d!==null)h.splice(h.indexOf(d),1);else return!1;i++}}catch(t){a=true;s=t}finally{try{if(!o&&l.return!=null){l.return()}}finally{if(a){throw s}}}return!0}default:return console.error("unexpected cardinality in qti match"),!1}}}]);return e}(i3);customElements.define("qti-match",oc);var od=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){var t=this.getVariables();this.children.length!==2&&console.warn("The member operator takes two sub-expressions");var e=S(t,2),n=e[0],r=e[1];if(n.baseType===r.baseType||n.baseType==="integer"&&r.baseType==="float"||n.baseType==="float"&&r.baseType==="integer"||console.warn("Which must both have the same base-type"),r.cardinality==="multiple"||r.cardinality==="ordered"||console.warn("and the second must be a multiple or ordered container"),(n.baseType==="float"||r.baseType==="float")&&console.warn("The member operator should not be used on sub-expressions with a base-type of float"),(n.baseType==="duration"||r.baseType==="duration")&&console.warn("It must not be used on sub-expressions with a base-type of duration"),n.value===null||r.value===null)return null;var i=n.value;return r.value.includes(i)}}]);return e}(i3);customElements.define("qti-member",od);var oh=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){var t=this.getVariables();if(t.length===0)return console.error("unexpected number of children in qti multiple"),null;var e=true,n=false,r=undefined;try{for(var i=t[Symbol.iterator](),o;!(e=(o=i.next()).done);e=true){var a=o.value;if(a.cardinality!=="multiple"&&a.cardinality!=="single")return console.error("unexpected cardinality in qti multiple"),[]}}catch(t){n=true;r=t}finally{try{if(!e&&i.return!=null){i.return()}}finally{if(n){throw r}}}return t}}]);return e}(i3);customElements.define("qti-multiple",oh);var of=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nQ(em(),h(f(e.prototype),"render",this).call(this))}},{key:"getResult",value:function t(){return!this.firstElementChild.calculate()}}]);return e}(i3);customElements.define("qti-not",of);var ov=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){return Array.from(this.children).map(function(t){var e=t;if(!e.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;var n=e.calculate(),r=!1;if(typeof n=="string")if(n==="true")r=!0;else if(n==="false")r=!1;else return console.error("unexpected val in qti-or, expected boolean"),null;else typeof n=="boolean"&&(r=n);return r}).some(function(t){return typeof t=="boolean"&&t})}}]);return e}(i5);customElements.define("qti-or",ov);var op=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){var t=this.getVariables();if(t.length===0)return console.error("unexpected number of children in qti multiple"),null;var e=true,n=false,r=undefined;try{for(var i=t[Symbol.iterator](),o;!(e=(o=i.next()).done);e=true){var a=o.value;if(a.cardinality!=="ordered"&&a.cardinality!=="single")return console.error("unexpected cardinality in qti ordered"),[]}}catch(t){n=true;r=t}finally{try{if(!e&&i.return!=null){i.return()}}finally{if(n){throw r}}}return t}}]);return e}(i3);customElements.define("qti-ordered",op);var oy=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){var t=this;var e,n;var r=(n=this.context)===null||n===void 0?void 0:(e=n.variables.find(function(e){return e.identifier===t.identifier}))===null||e===void 0?void 0:e.value;return r===null?nW:nQ(eg(),JSON.stringify(r,null,2))}},{key:"calculate",value:function t(){var t=this;return this.context.variables.find(function(e){return e.identifier===t.identifier})||null}}]);return e}(rt);ej([r({type:String})],oy.prototype,"identifier",2),ej([e({context:rs,subscribe:!0}),i()],oy.prototype,"context",2);customElements.define("qti-printed-variable",oy);var om=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){return this.getVariables().reduce(function(t,e){if(e.baseType=="float"||e.baseType=="integer")try{return t*parseInt(e.value.toString())}catch(t){console.warn("can not convert to number")}else console.warn("has another baseType ".concat(e.baseType));return t},1)}}]);return e}(i3);customElements.define("qti-product",om);var og=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){return this.calculateChildren(Array.from(this.children))}}]);return e}(eM(i3));customElements.define("qti-subtract",og);var ob=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.caseSensitive="true";return t}c(e,[{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),e=t[0],n=t[1];if(e.cardinality!=="single"||n.cardinality!=="single"||Array.isArray(e.value)||Array.isArray(n.value))return console.error("unexpected cardinality in qti string-match"),!1;var r=this.caseSensitive==="true"?e.value:e.value.toLowerCase(),i=this.caseSensitive==="true"?n.value:n.value.toLowerCase();return ot.compareSingleValues(r,i,e.baseType)}return console.error("unexpected number of children in qti-string-match"),null}}]);return e}(i3);ej([r({type:String,attribute:"case-sensitive"})],ob.prototype,"caseSensitive",2);customElements.define("qti-string-match",ob);var o_=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e),t._expression=new ok(Array.from(t.children));return t}c(e,[{key:"getResult",value:function t(){return this._expression.calculate()}}]);return e}(i3),ok=/*#__PURE__*/function(){"use strict";function t(e){s(this,t);this.expressions=e}c(t,[{key:"calculate",value:function t(){return this.expressions.map(function(t){if(!t.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;var e=t.calculate();return Number.isNaN(e)?(console.error("unexpected value in qti-sum, expected number"),null):Number(e)}).reduce(function(t,e){return t+e},0)}}]);return t}();customElements.define("qti-sum",o_);var oE=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){var t=this.getAttribute("identifier");return this.context.variables.find(function(e){return e.identifier===t}).value}}]);return e}(i3);customElements.define("qti-variable",oE);var ox=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){var t=this.getVariables();if(t.length===1){var e=t[0].value;if(Array.isArray(e)){var n=Math.floor(Math.random()*e.length);return e[n]}return e}return console.error("unexpected number of children in match"),null}}]);return e}(i3);customElements.define("qti-random",ox);var ow=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),e=t[0],n=t[1];return e.cardinality!=="single"||!Array.isArray(n.value)?(console.error("unexpected cardinality in qti equal"),null):t[0].baseType!==t[1].baseType?(console.error("The baseType of the two variables is different"),null):n.value.filter(function(t){return!e.value.includes(t)})}}}]);return e}(ol);customElements.define("qti-delete",ow);var oA=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nQ(eb())}}]);return e}(rt);oA=ej([rr("qti-content-body")],oA);var oC=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"handleclassNamesChange",value:function t(){var t=this;this.classNames.split(" ").forEach(function(e){switch(e){case"qti-rubric-discretionary-placement":t.setAttribute("slot","qti-rubric-block");break;case"qti-rubric-inline":t.setAttribute("slot","");break;default:break}})}},{key:"render",value:function t(){return nQ(e_())}}]);return e}(rt);oC.styles=e8(ek()),ej([r({type:String})],oC.prototype,"id",2),ej([r({type:String})],oC.prototype,"use",2),ej([r({type:String})],oC.prototype,"view",2),ej([r({type:String,attribute:"class"})],oC.prototype,"classNames",2),ej([d("classNames",{waitUntilFirstUpdate:!0})],oC.prototype,"handleclassNamesChange",1),oC=ej([rr("qti-rubric-block")],oC);var oq=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.styleElement=null;return t}c(e,[{key:"firstUpdated",value:function t(t){var n=this;h(f(e.prototype),"firstUpdated",this).call(this,t);var r=this.getAttribute("href");if(r!==null&&fetch(r).then(function(t){return t.text()}).then(function(t){var e=n.minifyCss(t);n.styleElement=document.createElement("style"),n.styleElement.media="screen",n.styleElement.textContent="@scope {".concat(e,"}"),n.parentElement?n.parentElement.appendChild(n.styleElement):console.warn("No parent element to append the scoped stylesheet to.")}).catch(function(t){console.error("Failed to load stylesheet:",t)}),this.textContent!==null&&this.textContent.trim()!==""){var i=this.minifyCss(this.textContent);this.styleElement=document.createElement("style"),this.styleElement.media="screen",this.styleElement.textContent="@scope {".concat(i,"}"),this.parentElement?this.parentElement.appendChild(this.styleElement):console.warn("No parent element to append the scoped stylesheet to.")}}},{key:"minifyCss",value:function t(t){return t.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\s+/g," ").replace(/\s*([{}:;])\s*/g,"$1").trim()}},{key:"disconnectedCallback",value:function t(){if(this.styleElement)try{this.styleElement.remove()}catch(t){console.error("Could not remove stylesheet:",t)}h(f(e.prototype),"disconnectedCallback",this).call(this)}}]);return e}(rt);oq=ej([rr("qti-stylesheet")],oq);var oS=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nQ(eE())}},{key:"defaultValues",value:function t(t){var e=Array.from(this.querySelectorAll("qti-default-value > qti-value"));if(e.length===0)return null;var n=e.map(function(t){return t.innerHTML.trim()});return n.length>1||t.cardinality==="multiple"||t.cardinality==="ordered"?n:n[0]}}]);return e}(rt);oS=ej([rr("qti-variabledeclaration")],oS);var oR=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.externalScored=null;return t}c(e,[{key:"render",value:function t(){var t=this;var e,n;var r=(n=this.itemContext)===null||n===void 0?void 0:(e=n.variables.find(function(e){return e.identifier===t.identifier}))===null||e===void 0?void 0:e.value;return nQ(ex(),JSON.stringify(r,null,2))}},{key:"interpolationTable",get:function t(){var t=this.querySelector("qti-interpolation-table");if(t){var e=new Map;var n=true,r=false,i=undefined;try{for(var o=t.querySelectorAll("qti-interpolation-table-entry")[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){var s=a.value;!s.getAttribute("source-value")&&s.getAttribute("target-value")&&console.error("source-value or target-value is missing in qti-interpolation-table-entry");var l=parseInt(s.getAttribute("source-value")),u=parseInt(s.getAttribute("target-value"));(isNaN(l)||isNaN(u))&&console.error("source-value or target-value is not a number in qti-interpolation-table-entry"),e.set(l,u)}}catch(t){r=true;i=t}finally{try{if(!n&&o.return!=null){o.return()}}finally{if(r){throw i}}}return e}return null}},{key:"connectedCallback",value:function t(){h(f(e.prototype),"connectedCallback",this).call(this);var t={identifier:this.identifier,cardinality:this.cardinality,baseType:this.baseType,type:"outcome",value:null,interpolationTable:this.interpolationTable,externalScored:this.externalScored};t.value=this.defaultValues(t),(t.value===null||t.value==null)&&(t.baseType==="integer"||t.baseType==="float")&&(t.value="0"),this.dispatchEvent(new CustomEvent("qti-register-variable",{bubbles:!0,composed:!0,detail:{variable:t}}))}}]);return e}(oS);oR.styles=[e8(ew())],ej([r({type:String,attribute:"base-type"})],oR.prototype,"baseType",2),ej([r({type:String,attribute:"external-scored"})],oR.prototype,"externalScored",2),ej([r({type:String})],oR.prototype,"identifier",2),ej([r({type:String})],oR.prototype,"cardinality",2),ej([e({context:rs,subscribe:!0}),i()],oR.prototype,"itemContext",2),oR=ej([rr("qti-outcome-declaration")],oR);var oP=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){var t=this;var e,n;var r=(n=this.itemContext)===null||n===void 0?void 0:(e=n.variables.find(function(e){return e.identifier===t.identifier}))===null||e===void 0?void 0:e.value;return nQ(eA(),JSON.stringify(r,null,2))}},{key:"connectedCallback",value:function t(){h(f(e.prototype),"connectedCallback",this).call(this);var t={baseType:this.baseType,identifier:this.identifier,correctResponse:this.correctResponse,cardinality:this.cardinality||"single",mapping:this.mapping,areaMapping:this.areaMapping,value:null,type:"response",candidateResponse:null};t.value=this.defaultValues(t),this.dispatchEvent(new CustomEvent("qti-register-variable",{bubbles:!0,composed:!0,detail:{variable:t}}))}},{key:"correctResponse",get:function t(){var t,e=this.querySelector("qti-correct-response");if(e){var n=e.querySelectorAll("qti-value");if(this.cardinality==="single"&&n.length>0)t=n[0].textContent.trim(),n[0].remove();else if(this.cardinality!=="single"){t=[];for(var r=0;r<n.length;r++)t.push(n[r].textContent.trim()),n[r].remove()}}return t}},{key:"mapping",get:function t(){var t=this.querySelector("qti-mapping"),e=parseInt(t===null||t===void 0?void 0:t.getAttribute("lower-bound")),n=parseInt(t===null||t===void 0?void 0:t.getAttribute("upper-bound"));return{defaultValue:Number(t===null||t===void 0?void 0:t.getAttribute("default-value"))||0,lowerBound:isNaN(e)?null:e,upperBound:isNaN(n)?null:n,mapEntries:Array.from((t===null||t===void 0?void 0:t.querySelectorAll("qti-map-entry"))||[]).map(function(t){return{mapKey:t.getAttribute("map-key")||"",mappedValue:Number(t.getAttribute("mapped-value"))||0,caseSensitive:t.hasAttribute("case-sensitive")?t.getAttribute("case-sensitive")!=="false":!0}})}}},{key:"areaMapping",get:function t(){var t=this.querySelector("qti-area-mapping"),e=Number(t===null||t===void 0?void 0:t.getAttribute("default-value"))||0,n=parseInt(t===null||t===void 0?void 0:t.getAttribute("lower-bound")),r=parseInt(t===null||t===void 0?void 0:t.getAttribute("upper-bound")),i=Array.from((t===null||t===void 0?void 0:t.querySelectorAll("qti-area-map-entry"))||[]).map(function(t){return{shape:t.getAttribute("shape")||"default",coords:t.getAttribute("coords")||"",mappedValue:Number(t.getAttribute("mapped-value"))||0,defaultValue:Number(t.getAttribute("default-value"))||0}});return{defaultValue:e,lowerBound:isNaN(n)?null:n,upperBound:isNaN(r)?null:r,areaMapEntries:i}}}]);return e}(oS);oP.styles=[e8(eC())],ej([r({type:String,attribute:"base-type"})],oP.prototype,"baseType",2),ej([r({type:String})],oP.prototype,"identifier",2),ej([r({type:String})],oP.prototype,"cardinality",2),ej([e({context:rs,subscribe:!0}),i()],oP.prototype,"itemContext",2),oP=ej([rr("qti-response-declaration")],oP);return eV(eH)}();/*! Bundled license information:
1
+ function t(t,e){if(e==null||e>t.length)e=t.length;for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function e(t){if(Array.isArray(t))return t}function n(e){if(Array.isArray(e))return t(e)}function r(t){if(t===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t}function i(t,e,n,r,i,o,a){try{var s=t[o](a);var l=s.value}catch(t){n(t);return}if(s.done){e(l)}else{Promise.resolve(l).then(r,i)}}function o(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var a=t.apply(e,n);function s(t){i(a,r,o,s,l,"next",t)}function l(t){i(a,r,o,s,l,"throw",t)}s(undefined)})}}function a(t,e,n){e=f(e);return w(t,U()?Reflect.construct(e,n||[],f(t).constructor):e.apply(t,n))}function s(t,e){if(!(t instanceof e)){throw new TypeError("Cannot call a class as a function")}}function l(t,e,n){if(U()){l=Reflect.construct}else{l=function t(t,e,n){var r=[null];r.push.apply(r,e);var i=Function.bind.apply(t,r);var o=new i;if(n)q(o,n.prototype);return o}}return l.apply(null,arguments)}function u(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false;r.configurable=true;if("value"in r)r.writable=true;Object.defineProperty(t,r.key,r)}}function c(t,e,n){if(e)u(t.prototype,e);if(n)u(t,n);return t}function d(t,e,n){if(e in t){Object.defineProperty(t,e,{value:n,enumerable:true,configurable:true,writable:true})}else{t[e]=n}return t}function h(t,e,n){if(typeof Reflect!=="undefined"&&Reflect.get){h=Reflect.get}else{h=function t(t,e,n){var r=R(t,e);if(!r)return;var i=Object.getOwnPropertyDescriptor(r,e);if(i.get){return i.get.call(n||t)}return i.value}}return h(t,e,n||t)}function f(t){f=Object.setPrototypeOf?Object.getPrototypeOf:function t(t){return t.__proto__||Object.getPrototypeOf(t)};return f(t)}function v(t,e){if(typeof e!=="function"&&e!==null){throw new TypeError("Super expression must either be null or a function")}t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:true,configurable:true}});if(e)q(t,e)}function p(t,e){if(e!=null&&typeof Symbol!=="undefined"&&e[Symbol.hasInstance]){return!!e[Symbol.hasInstance](t)}else{return t instanceof e}}function y(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function m(t){if(typeof Symbol!=="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function g(t,e){var n=t==null?null:typeof Symbol!=="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(n==null)return;var r=[];var i=true;var o=false;var a,s;try{for(n=n.call(t);!(i=(a=n.next()).done);i=true){r.push(a.value);if(e&&r.length===e)break}}catch(t){o=true;s=t}finally{try{if(!i&&n["return"]!=null)n["return"]()}finally{if(o)throw s}}return r}function b(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function k(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};var r=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){r=r.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))}r.forEach(function(e){d(t,e,n[e])})}return t}function E(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);if(e){r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})}n.push.apply(n,r)}return n}function x(t,e){e=e!=null?e:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(t,Object.getOwnPropertyDescriptors(e))}else{E(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function w(t,e){if(e&&(O(e)==="object"||typeof e==="function")){return e}return r(t)}function A(t,e,n,r){if(typeof Reflect!=="undefined"&&Reflect.set){A=Reflect.set}else{A=function t(t,e,n,r){var i=R(t,e);var o;if(i){o=Object.getOwnPropertyDescriptor(i,e);if(o.set){o.set.call(r,n);return true}else if(!o.writable){return false}}o=Object.getOwnPropertyDescriptor(r,e);if(o){if(!o.writable){return false}o.value=n;Object.defineProperty(r,e,o)}else{d(r,e,n)}return true}}return A(t,e,n,r)}function C(t,e,n,r,i){var o=A(t,e,n,r||t);if(!o&&i){throw new Error("failed to set property")}return n}function q(t,e){q=Object.setPrototypeOf||function t(t,e){t.__proto__=e;return t};return q(t,e)}function S(t,n){return e(t)||g(t,n)||$(t,n)||b()}function R(t,e){while(!Object.prototype.hasOwnProperty.call(t,e)){t=f(t);if(t===null)break}return t}function P(t,e){if(!e){e=t.slice(0)}return Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function M(t){return e(t)||m(t)||$(t)||b()}function T(t){return n(t)||m(t)||$(t)||_()}function O(t){"@swc/helpers - typeof";return t&&typeof Symbol!=="undefined"&&t.constructor===Symbol?"symbol":typeof t}function $(e,n){if(!e)return;if(typeof e==="string")return t(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor)r=e.constructor.name;if(r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return t(e,n)}function I(t){var e=typeof Map==="function"?new Map:undefined;I=function t(t){if(t===null||!y(t))return t;if(typeof t!=="function"){throw new TypeError("Super expression must either be null or a function")}if(typeof e!=="undefined"){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return l(t,arguments,f(this).constructor)}n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:false,writable:true,configurable:true}});return q(n,t)};return I(t)}function U(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(U=function(){return!!t})()}function L(t,e){var n,r,i,o,a={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),"throw":s(1),"return":s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(t){return function(e){return l([t,e])}}function l(o){if(n)throw new TypeError("Generator is already executing.");while(a)try{if(n=1,r&&(i=o[0]&2?r["return"]:o[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;if(r=0,i)o=[o[0]&2,i.value];switch(o[0]){case 0:case 1:i=o;break;case 4:a.label++;return{value:o[1],done:false};case 5:a.label++;r=o[1];o=[0];continue;case 7:o=a.ops.pop();a.trys.pop();continue;default:if(!(i=a.trys,i=i.length>0&&i[i.length-1])&&(o[0]===6||o[0]===2)){a=0;continue}if(o[0]===3&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(o[0]===6&&a.label<i[1]){a.label=i[1];i=o;break}if(i&&a.label<i[2]){a.label=i[2];a.ops.push(o);break}if(i[2])a.ops.pop();a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t];r=0}finally{n=i=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}}function N(){var t=P(["<slot></slot>"]);N=function e(){return t};return t}function D(){var t=P(["<slot></slot>"]);D=function e(){return t};return t}function V(){var t=P(['<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">\n<xsl:output method="html" version="5.0" encoding="UTF-8" indent="yes" />\n <xsl:template match="@*|node()">\n <xsl:copy>\n <xsl:apply-templates select="@*|node()"/>\n </xsl:copy>\n </xsl:template>\n\n \x3c!-- remove existing namespaces --\x3e\n <xsl:template match="*">\n \x3c!-- remove element prefix --\x3e\n <xsl:element name="{local-name()}">\n \x3c!-- process attributes --\x3e\n <xsl:for-each select="@*">\n \x3c!-- remove attribute prefix --\x3e\n <xsl:attribute name="{local-name()}">\n <xsl:value-of select="."/>\n </xsl:attribute>\n </xsl:for-each>\n <xsl:apply-templates/>\n </xsl:element>\n</xsl:template>\n</xsl:stylesheet>']);V=function e(){return t};return t}function j(){var t=P(["<slot @slotchange=","></slot>"]);j=function e(){return t};return t}function H(){var t=P([' <slot part="feedback" class="feedback ','"></slot> ']);H=function e(){return t};return t}function Q(){var t=P(["\n :host {\n display: block;\n }\n .on {\n display: block;\n }\n .off {\n display: none;\n }\n "]);Q=function e(){return t};return t}function F(){var t=P([' <slot part="feedback" class="','"></slot> ']);F=function e(){return t};return t}function z(){var t=P(["\n .on {\n display: inline-block;\n }\n .off {\n display: none;\n }\n "]);z=function e(){return t};return t}function B(){var t=P(['\n <dialog class="qti-dialog" part="feedback" ?open="','">\n <slot></slot>\n <div style="margin-top: var(--qti-gap-size); text-align: center;">\n <button class="button close-button" @click="','">Close</button>\n </div>\n </dialog>\n ']);B=function e(){return t};return t}function W(){var t=P(["\n .qti-dialog {\n background: var(--qti-bg);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n border-radius: var(--qti-border-radius);\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1000;\n width: auto;\n max-width: 90%;\n }\n\n .button {\n border-radius: var(--qti-border-radius);\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n background-color: var(--qti-bg-active);\n border: var(--qti-border-active);\n cursor: pointer;\n position: relative;\n display: inline-block;\n }\n\n .button:hover {\n background-color: var(--qti-hover-bg);\n }\n\n .button:disabled {\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n cursor: not-allowed;\n }\n\n .button:focus {\n outline: var(--qti-focus-border-width) solid var(--qti-focus-color);\n }\n "]);W=function e(){return t};return t}function Y(){var t=P([' <slot name="drags"></slot> ']);Y=function e(){return t};return t}function X(){var t=P(["\n :host {\n display: flex;\n user-select: none;\n position: absolute;\n }\n "]);X=function e(){return t};return t}function J(){var t=P(["\n :host {\n display: block; /* necessary to calculate scaling position */\n }\n slot[name='qti-simple-associable-choice'] {\n display: flex;\n align-items: flex-start;\n flex: 1;\n border: 2px solid transparent;\n padding: 0.3rem;\n border-radius: 0.3rem;\n gap: 0.5rem;\n }\n\n :host::part(associables-container) {\n display: flex;\n padding: 0.5rem;\n justify-content: space-between;\n background: linear-gradient(\n 180deg,\n rgb(0 0 0 / 0%) calc(50% - 1px),\n var(--qti-border-color-gray) calc(50%),\n rgb(0 0 0 / 0%) calc(50% + 1px)\n );\n }\n"]);J=function e(){return t};return t}function G(){var t=P(['<div part="associables-container">\n <div name="left','" part="drop-list" class="dl" identifier="droplist','_left"></div>\n <div name="right','" part="drop-list" class="dl" identifier="droplist','_right"></div>\n </div>']);G=function e(){return t};return t}function K(){var t=P([' <slot name="prompt"></slot>\n <slot name="qti-simple-associable-choice"></slot>\n <div part="drop-container">\n ','\n\n <div role="alert" id="validationMessage"></div>\n </div>']);K=function e(){return t};return t}function Z(){var t=P(["\n :host {\n display: block;\n }\n\n [part='slot'] {\n display: grid;\n gap: 10px;\n }\n\n /* Define the number of columns dynamically */\n :host([class*='qti-choices-stacking-']) [part='slot'] {\n grid-template-columns: repeat(var(--stacking-count, 1), 1fr);\n }\n\n /* Apply dynamic stacking count based on class */\n :host(.qti-choices-stacking-1) {\n --stacking-count: 1;\n }\n :host(.qti-choices-stacking-2) {\n --stacking-count: 2;\n }\n :host(.qti-choices-stacking-3) {\n --stacking-count: 3;\n }\n :host(.qti-choices-stacking-4) {\n --stacking-count: 4;\n }\n :host(.qti-choices-stacking-5) {\n --stacking-count: 5;\n }\n :host(.qti-choices-stacking-6) {\n --stacking-count: 6;\n }\n\n /* Default slot item layout */\n ::slotted(qti-simple-choice) {\n display: flex;\n align-items: center;\n white-space: nowrap;\n }\n\n /* Orientation styles */\n :host(.qti-orientation-horizontal) [part='slot'] {\n grid-auto-flow: dense column;\n grid-auto-columns: 1fr;\n }\n\n :host(.qti-orientation-vertical) [part='slot'] {\n grid-auto-flow: row;\n }\n\n /* Vertical and horizontal stacking logic */\n :host(.qti-orientation-vertical[class*='qti-choices-stacking-']) [part='slot'] {\n grid-auto-flow: dense column;\n grid-auto-columns: 1fr;\n grid-template-columns: repeat(var(--stacking-count), 1fr);\n grid-template-rows: repeat(calc(var(--item-count) / var(--stacking-count)), 1fr);\n }\n\n :host(.qti-orientation-horizontal[class*='qti-choices-stacking-']) [part='slot'] {\n grid-auto-flow: row;\n grid-template-columns: repeat(var(--stacking-count), 1fr);\n grid-template-rows: unset;\n }\n\n /* Ensure even distribution in vertical mode */\n :host(.qti-orientation-vertical) ::slotted(qti-simple-choice:nth-child(even)) {\n grid-row: auto;\n }\n"]);Z=function e(){return t};return t}function tt(){var t=P(['\n <slot part="prompt" name="prompt"></slot><slot part="slot" @slotchange=','></slot>\n <div part="message" role="alert" id="validationMessage"></div>\n ']);tt=function e(){return t};return t}function te(){var t=P(['<div style="color:red">\n <h1>Error</h1>\n ',"\n </div>"]);te=function e(){return t};return t}function tn(){var t=P(["<iframe\n width=","\n height=",'\n frameborder="0"\n title="pciContainer"\n id="pciContainer"\n >\n </iframe>\n ',""]);tn=function e(){return t};return t}function tr(){var t=P(["<button ?disabled=",' part="button" @click=',">","</button>"]);tr=function e(){return t};return t}function ti(){var t=P(["\n /* PK: display host as block, else design will be collapsed */\n :host {\n display: block;\n }\n textarea {\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n border: 0;\n }\n"]);ti=function e(){return t};return t}function to(){var t=P(['<slot name="prompt"></slot\n ><textarea\n part="textarea"\n name="','"\n spellcheck="false"\n autocomplete="off"\n maxlength="','"\n @keydown="','"\n @keyup="','"\n @change="','"\n @blur="','"\n placeholder="','"\n rows="','"\n ?disabled="','"\n ?readonly="','"\n .value=',"\n ></textarea>"]);to=function e(){return t};return t}function ta(){var t=P(["\n :host {\n display: flex;\n user-select: none;\n }\n "]);ta=function e(){return t};return t}function ts(){var t=P(["\n :host {\n display: flex;\n align-items: flex-start;\n flex-direction: column;\n flex-wrap: wrap;\n gap: 0.5rem;\n }\n\n :host(.qti-choices-top) {\n flex-direction: column;\n }\n :host(.qti-choices-bottom) {\n flex-direction: column-reverse;\n }\n :host(.qti-choices-left) {\n flex-direction: row;\n }\n :host(.qti-choices-right) {\n flex-direction: row-reverse;\n }\n /* [part='drops'] , */\n [name='prompt'] {\n width: 100%;\n }\n [name='drags'] {\n display: flex;\n align-items: flex-start;\n flex: 1;\n border: 2px solid transparent;\n padding: 0.3rem;\n border-radius: 0.3rem;\n gap: 0.5rem;\n }\n"]);ts=function e(){return t};return t}function tl(){var t=P(['<slot name="prompt"> </slot>\n <slot part="drags" name="drags"></slot>\n <slot part="drops"></slot>\n <div role="alert" id="validationMessage"></div>']);tl=function e(){return t};return t}function tu(){var t=P(["<slot></slot>"]);tu=function e(){return t};return t}function tc(){var t=P(["\n :host {\n display: inline-flex;\n user-select: none;\n }\n "]);tc=function e(){return t};return t}function td(){var t=P([' <slot name="drags"></slot>']);td=function e(){return t};return t}function th(){var t=P(["\n :host {\n display: flex;\n user-select: none;\n }\n "]);th=function e(){return t};return t}function tf(){var t=P(["\n slot:not([name='prompt']) {\n // position: relative; /* qti-hotspot-choice relative to the slot */\n display: block;\n width: fit-content; /* hotspots not stretching further if image is at max size */\n }\n ::slotted(img) {\n /* image not selectable anymore */\n pointer-events: none;\n user-select: none;\n }\n ::slotted(qti-associable-hotspot) {\n transform: translate(-50%, -50%);\n }\n line-container {\n display: block;\n position: relative;\n width: fit-content;\n }\n svg {\n position: absolute;\n top: 0px;\n left: 0px;\n }\n"]);tf=function e(){return t};return t}function tv(){var t=P(['\n <line\n part="line"\n x1=',"\n y1=","\n x2=","\n y2=",'\n stroke="red"\n stroke-width="3"\n @click=',"\n />\n "]);tv=function e(){return t};return t}function tp(){var t=P(['\n <line\n part="correct-line"\n x1=',"\n y1=","\n x2=","\n y2=",'\n stroke="var(--qti-correct)"\n stroke-width="3"\n stroke-dasharray="5,5"\n />\n ']);tp=function e(){return t};return t}function ty(){var t=P(['<line\n part="point"\n x1=',"\n y1=","\n x2=","\n y2=",'\n stroke="var(--qti-border-active)"\n stroke-width="3"\n />']);ty=function e(){return t};return t}function tm(){var t=P(['<slot name="prompt"></slot>\n <line-container>\n <svg\n width=',"\n height=",'\n viewbox="0 0 '," ",'"\n >\n ',"\n ","\n ",'\n </svg>\n <slot></slot>\n </line-container>\n <div role="alert" id="validationMessage"></div>']);tm=function e(){return t};return t}function tg(){var t=P(["\n :host {\n display: flex;\n align-items: flex-start;\n flex-direction: column;\n flex-wrap: wrap;\n gap: 0.5rem;\n }\n\n :host(.qti-choices-top) {\n flex-direction: column-reverse;\n }\n :host(.qti-choices-bottom) {\n flex-direction: column;\n }\n :host(.qti-choices-left) {\n flex-direction: row-reverse;\n & [name='drags'] {\n width: 25%;\n }\n & [part='image'] {\n width: 75%;\n }\n }\n :host(.qti-choices-right) {\n flex-direction: row;\n & [name='drags'] {\n width: 25%;\n }\n & [part='image'] {\n width: 75%;\n }\n }\n [part='image'] {\n display: block;\n position: relative;\n }\n /* [part='drops'] , */\n\n [name='drags'] {\n display: flex;\n align-items: flex-start;\n flex-wrap: wrap;\n flex: 1;\n border: 2px solid transparent;\n padding: 0.3rem;\n border-radius: 0.3rem;\n gap: 0.5rem;\n }\n ::slotted(img) {\n display: inline-block;\n user-select: none;\n pointer-events: none;\n }\n"]);tg=function e(){return t};return t}function tb(){var t=P([' <slot name="prompt"></slot>\n <slot part="image"></slot>\n <slot part="drags" name="drags" class="hover-border"></slot>\n <div role="alert" id="validationMessage"></div>']);tb=function e(){return t};return t}function t_(){var t=P(["\n slot:not([name='prompt']) {\n position: relative; /* qti-hotspot-choice relative to the slot */\n display: block;\n width: fit-content; /* hotspots not stretching further if image is at max size */\n }\n ::slotted(img) {\n /* image not selectable anymore */\n pointer-events: none;\n user-select: none;\n }\n"]);t_=function e(){return t};return t}function tk(){var t=P(['\n <slot name="prompt"></slot>\n <slot></slot>\n <div role="alert" id="validationMessage"></div>\n ']);tk=function e(){return t};return t}function tE(){var t=P(["\n :host {\n display: flex;\n user-select: none;\n position: absolute;\n }\n "]);tE=function e(){return t};return t}function tx(){var t=P(["\n slot:not([name='prompt']) {\n position: relative; /* qti-hotspot-choice relative to the slot */\n display: block;\n width: fit-content; /* hotspots not stretching further if image is at max size */\n }\n ::slotted(img) {\n /* image not selectable anymore */\n pointer-events: none;\n user-select: none;\n /* width:100%; */\n }\n"]);tx=function e(){return t};return t}function tw(){var t=P(['\n <slot name="prompt"></slot>\n <slot></slot>\n ']);tw=function e(){return t};return t}function tA(){var t=P(["<slot></slot>"]);tA=function e(){return t};return t}function tC(){var t=P(['<div part="ch"><div part="cha"></div></div>\n <slot></slot> ']);tC=function e(){return t};return t}function tq(){var t=P(["\n :host {\n display: flex;\n user-select: none;\n }\n "]);tq=function e(){return t};return t}function tS(){var t=P(["\n :host {\n display: inline-block;\n }\n slot {\n display: flex;\n flex-direction: column;\n }\n [role='menu'] {\n position: absolute;\n z-index: 1000;\n }\n .anchor {\n /* anchor-name: --infobox; */\n width: fit-content;\n }\n\n .positionedElement {\n position: absolute;\n /* position-anchor: --infobox; */\n /* top: anchor(bottom); */\n }\n "]);tS=function e(){return t};return t}function tR(){var t=P(['\n <option value="','" ?selected="','">',"</option>\n "]);tR=function e(){return t};return t}function tP(){var t=P(['\n <select part="select" @change="','" ?disabled="','" ?readonly="','">\n ',"\n </select>\n\n ","\n "]);tP=function e(){return t};return t}function tM(){var t=P(["\n :host {\n display: block;\n cursor: pointer;\n }\n "]);tM=function e(){return t};return t}function tT(){var t=P([" <slot></slot> "]);tT=function e(){return t};return t}function tO(){var t=P(['\n <slot part="slot"></slot>\n <slot part="dropslot" name="qti-simple-associable-choice"></slot>\n ']);tO=function e(){return t};return t}function t$(){var t=P(["\n :host {\n display: flex;\n user-select: none;\n }\n slot {\n width: 100%;\n display: block;\n }\n slot[name='qti-simple-associable-choice'] {\n width: 100%;\n }\n "]);t$=function e(){return t};return t}function tI(){var t=P(["\n slot:not([hidden]) {\n /* slot where the */\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n align-items: flex-start; /* prevents the drag and drop container slots having the same height */\n }\n :host(.qti-choices-top) slot {\n flex-direction: column;\n }\n :host(.qti-choices-bottom) slot {\n flex-direction: column-reverse;\n }\n :host(.qti-choices-left) slot {\n flex-direction: row;\n }\n :host(.qti-choices-right) slot {\n flex-direction: row-reverse;\n }\n slot[name='prompt'] {\n display: block;\n }\n ::slotted(qti-simple-match-set) {\n /* Make sure the drag and drop container slots have the same width */\n flex: 1;\n }\n"]);tI=function e(){return t};return t}function tU(){var t=P(['<th part="r-header">',"</th>"]);tU=function e(){return t};return t}function tL(){var t=P(["<td>\n <input\n type=","\n part=","\n name=","\n value=","\n .disabled=","\n @change=","\n @click=","\n />\n </td>"]);tL=function e(){return t};return t}function tN(){var t=P(['<tr>\n <td part="c-header">',"</td>\n ","\n </tr>"]);tN=function e(){return t};return t}function tD(){var t=P(["\n <table>\n <tr>\n <td></td>\n ","\n </tr>\n\n ","\n </table>\n "]);tD=function e(){return t};return t}function tV(){var t=P(['\n <slot name="prompt"></slot>\n <slot ?hidden=',"></slot>\n\n ",'\n\n <div role="alert" id="validationMessage"></div>\n ']);tV=function e(){return t};return t}function tj(){var t=P([' <slot name="prompt"></slot>\n <slot></slot>']);tj=function e(){return t};return t}function tH(){var t=P([""]);tH=function e(){return t};return t}function tQ(){var t=P(["\n [part='drags'] {\n display: flex;\n align-items: flex-start;\n flex: 1;\n flex-wrap: wrap;\n }\n\n [part='drops'] {\n flex: 1;\n display: grid;\n grid-auto-flow: column;\n grid-auto-columns: 1fr;\n }\n\n :host([orientation='horizontal']) [part='drags'] {\n flex-direction: row;\n }\n :host([orientation='horizontal']) [part='drops'] {\n grid-auto-flow: column;\n }\n :host([orientation='vertical']) [part='drags'] {\n flex-direction: column;\n }\n :host([orientation='vertical']) [part='drops'] {\n grid-auto-flow: row;\n }\n\n [part='drop-list'] {\n display: block;\n flex: 1;\n }\n\n [part='container'] {\n display: flex;\n gap: 0.5rem;\n }\n :host(.qti-choices-top) [part='container'] {\n flex-direction: column;\n }\n :host(.qti-choices-bottom) [part='container'] {\n flex-direction: column-reverse;\n }\n :host(.qti-choices-left) [part='container'] {\n flex-direction: row;\n }\n :host(.qti-choices-right) [part='container'] {\n flex-direction: row-reverse;\n }\n"]);tQ=function e(){return t};return t}function tF(){var t=P(['<drop-list part="drop-list" identifier="droplist','"></drop-list>']);tF=function e(){return t};return t}function tz(){var t=P([' <slot name="prompt"> </slot>\n <div part="container">\n <slot part="drags"> </slot>\n <div part="drops">\n ',"\n </div>\n </div>"]);tz=function e(){return t};return t}function tB(){var t=P(['<div style="color:red">\n <h1>Error</h1>\n ',"\n </div>"]);tB=function e(){return t};return t}function tW(){var t=P(["<slot></slot>",""]);tW=function e(){return t};return t}function tY(){var t=P(["<slot></slot>"]);tY=function e(){return t};return t}function tX(){var t=P(["\n :host {\n display: block;\n }\n ::slotted(img) {\n position: absolute;\n cursor: move;\n user-select: none;\n left: 50%;\n transform: translateX(-50%);\n }\n "]);tX=function e(){return t};return t}function tJ(){var t=P(["<slot></slot>"]);tJ=function e(){return t};return t}function tG(){var t=P(["\n :host {\n display: inline-block;\n position: relative;\n }\n "]);tG=function e(){return t};return t}function tK(){var t=P(['\n <button\n part="point"\n style=','\n aria-label="Remove point at ','"\n @click=',"\n ></button>\n "]);tK=function e(){return t};return t}function tZ(){var t=P(["<div\n style=",'\n data-coord="','"\n alt=','\n data-shape="','"\n ></div>']);tZ=function e(){return t};return t}function t0(){var t=P([' <slot name="prompt"></slot>\n <point-container>\n ',"\n ","\n <slot></slot>\n </point-container>"]);t0=function e(){return t};return t}function t1(){var t=P(["\n :host {\n display: block;\n }\n point-container {\n display: block;\n position: relative;\n width: fit-content;\n }\n\n ::slotted(img) {\n max-width: 100%;\n height: auto;\n display: block;\n }\n "]);t1=function e(){return t};return t}function t2(){var t=P(['<div id="label">',"</div>"]);t2=function e(){return t};return t}function t3(){var t=P(['<div part="ch">\n <div part="cha"></div>\n </div>\n ','\n <slot part="slot"></slot> ']);t3=function e(){return t};return t}function t5(){var t=P(["\n :host {\n display: flex;\n align-items: center;\n user-select: none;\n }\n slot {\n width: 100%;\n display: flex;\n align-items: center;\n }\n [part='ch'] {\n display: flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n }\n "]);t5=function e(){return t};return t}function t4(){var t=P(["\n :host {\n display: block;\n --show-bounds: true;\n --show-ticks: true;\n --show-value: true;\n }\n\n [part='slider'] {\n margin-left: 2rem; /* mx-8 */\n margin-right: 2rem;\n padding-bottom: 1rem; /* pb-4 */\n padding-top: 1.25rem; /* pt-5 */\n }\n\n [part='bounds'] {\n display: flex;\n width: 100%;\n justify-content: space-between;\n margin-bottom: 0.5rem; /* mb-2 */\n }\n\n [part='ticks'] {\n margin-left: 0.125rem; /* mx-0.5 */\n margin-right: 0.125rem;\n margin-bottom: 0.25rem; /* mb-1 */\n height: 0.5rem; /* h-2 */\n background: linear-gradient(to right, var(--qti-border-color) var(--qti-border-thickness), transparent 1px) repeat-x\n 0 center / calc(calc(100% - var(--qti-border-thickness)) / ((var(--max) - var(--min)) / var(--step))) 100%;\n }\n\n [part='rail'] {\n display: flex;\n align-items: center;\n box-sizing: border-box;\n height: 0.375rem; /* h-1.5 */\n width: 100%;\n cursor: pointer;\n border-radius: 9999px; /* rounded-full */\n border: 1px solid #d1d5db; /* border-gray-300 */\n background-color: #e5e7eb; /* bg-gray-200 */\n }\n\n [part='knob'] {\n background-color: var(--qti-bg-active);\n border: 2px solid var(--qti-border-active);\n position: relative;\n height: 1rem; /* h-4 */\n width: 1rem; /* w-4 */\n transform-origin: center;\n transform: translateX(-50%);\n cursor: pointer;\n border-radius: 9999px; /* rounded-full */\n left: var(--value-percentage);\n }\n [part='knob-correct'] {\n background-color: var(--qti-correct-light);\n border: 2px solid var(--qti-correct);\n position: relative;\n height: 1rem; /* h-4 */\n width: 1rem; /* w-4 */\n transform-origin: center;\n transform: translateX(-50%);\n cursor: pointer;\n border-radius: 9999px; /* rounded-full */\n left: var(--value-percentage-correct);\n }\n\n [part='value'] {\n position: absolute;\n bottom: 2rem; /* bottom-8 */\n left: 0.5rem; /* left-2 */\n transform: translateX(-50%);\n cursor: pointer;\n border-radius: 0.25rem; /* rounded */\n background-color: #f3f4f6; /* bg-gray-100 */\n padding: 0.25rem 0.5rem; /* px-2 py-1 */\n text-align: center;\n color: #6b7280; /* text-gray-500 */\n }\n"]);t4=function e(){return t};return t}function t6(){var t=P(['\n <div id="knob-correct" part="knob-correct">\n <div id="value" part="value">',"</div>\n </div>\n "]);t6=function e(){return t};return t}function t9(){var t=P(['\n <slot name="prompt"></slot>\n <div id="slider" part="slider">\n <div id="bounds" part="bounds">\n <div>',"</div>\n <div>",'</div>\n </div>\n\n <div id="ticks" part="ticks"></div>\n\n <div id="rail" part="rail" @mousedown='," @touchstart=",'>\n <div id="knob" part="knob">\n <div id="value" part="value">',"</div>\n </div>\n\n ","\n </div>\n </div>\n "]);t9=function e(){return t};return t}function t7(){var t=P(["\n :host {\n display: inline-block;\n }\n [part='correct'] {\n position: absolute;\n width: 100%;\n }\n :host(.qti-input-width-1) [part='input'] {\n width: 1.1rem;\n min-width: 1.1rem;\n }\n\n :host(.qti-input-width-2) [part='input'] {\n width: 2.3rem;\n min-width: 2.3rem;\n }\n\n :host(.qti-input-width-3) [part='input'] {\n width: 3.3rem;\n min-width: 3.3rem;\n }\n\n :host(.qti-input-width-4) [part='input'] {\n width: 4.2rem;\n min-width: 4.2rem;\n }\n\n :host(.qti-input-width-6) [part='input'] {\n width: 6.6rem;\n min-width: 6.6rem;\n }\n\n :host(.qti-input-width-10) [part='input'] {\n width: 8rem;\n min-width: 8rem;\n }\n\n :host(.qti-input-width-15) [part='input'] {\n width: 12rem;\n min-width: 12rem;\n }\n\n :host(.qti-input-width-20) [part='input'] {\n width: 17rem;\n min-width: 17rem;\n }\n\n :host(.qti-input-width-25) [part='input'] {\n width: 20rem;\n min-width: 20rem;\n }\n\n :host(.qti-input-width-30) [part='input'] {\n width: 24rem;\n min-width: 24rem;\n }\n\n :host(.qti-input-width-35) [part='input'] {\n width: 28rem;\n min-width: 28rem;\n }\n\n :host(.qti-input-width-40) [part='input'] {\n width: 32rem;\n min-width: 32rem;\n }\n\n :host(.qti-input-width-45) [part='input'] {\n width: 36rem;\n min-width: 36rem;\n }\n\n :host(.qti-input-width-50) [part='input'] {\n width: 40rem;\n min-width: 40rem;\n }\n\n :host(.qti-input-width-72) [part='input'] {\n width: 57rem;\n min-width: 57rem;\n }\n"]);t7=function e(){return t};return t}function t8(){var t=P(['\n <input\n part="input"\n name="','"\n spellcheck="false"\n autocomplete="off"\n @blur="','"\n @keydown="','"\n @keyup="','"\n @change="','"\n type="','"\n placeholder="','"\n .value="','"\n pattern="','"\n maxlength=','\n ?disabled="','"\n ?readonly="','"\n />\n <div part="correct">',"</div>\n "]);t8=function e(){return t};return t}function et(){var t=P(['\n <div>\n <slot name="prompt"></slot>\n <input type="file" @change="','" ?disabled="','" ?readonly="','" />\n </div>\n ']);et=function e(){return t};return t}function ee(){var t=P(["\n :host {\n display: block;\n margin: 1em 0;\n }\n input[type='file'] {\n display: block;\n margin-top: 0.5em;\n }\n "]);ee=function e(){return t};return t}function en(){var t=P(["\n :host {\n display: block;\n }\n"]);en=function e(){return t};return t}function er(){var t=P(['<slot part="qti-rubric-blocks" name="qti-rubric-block"></slot><slot></slot>']);er=function e(){return t};return t}function ei(){var t=P(["<slot></slot>"]);ei=function e(){return t};return t}function eo(){var t=P(["\n :host {\n display: none;\n }\n "]);eo=function e(){return t};return t}function ea(){var t=P(["<slot></slot>"]);ea=function e(){return t};return t}function es(){var t=P(["<slot></slot>"]);es=function e(){return t};return t}function el(){var t=P(["\n :host {\n display: none;\n }\n "]);el=function e(){return t};return t}function eu(){var t=P(["<slot></slot>"]);eu=function e(){return t};return t}function ec(){var t=P(["<slot></slot>"]);ec=function e(){return t};return t}function ed(){var t=P(["<slot></slot>"]);ed=function e(){return t};return t}function eh(){var t=P(["",""]);eh=function e(){return t};return t}function ef(){var t=P(["<pre>","</pre>\n <slot></slot>"]);ef=function e(){return t};return t}function ev(){var t=P(["\n slot {\n display: none;\n }\n "]);ev=function e(){return t};return t}function ep(){var t=P(["<pre>","</pre>\n <slot></slot>"]);ep=function e(){return t};return t}function ey(){var t=P(["\n slot {\n display: none;\n }\n "]);ey=function e(){return t};return t}function em(){var t=P(["",""]);em=function e(){return t};return t}function eg(){var t=P(["",""]);eg=function e(){return t};return t}function eb(){var t=P(["<slot></slot>"]);eb=function e(){return t};return t}function e_(){var t=P(["<slot></slot>"]);e_=function e(){return t};return t}function ek(){var t=P(["\n :host {\n display: block;\n }\n "]);ek=function e(){return t};return t}function eE(){var t=P(["<slot></slot>"]);eE=function e(){return t};return t}function ex(){var t=P(["",""]);ex=function e(){return t};return t}function ew(){var t=P(["\n :host {\n display: none;\n }\n "]);ew=function e(){return t};return t}function eA(){var t=P(["",""]);eA=function e(){return t};return t}function eC(){var t=P(["\n :host {\n display: none;\n }\n "]);eC=function e(){return t};return t}var QtiComponents=function(){var t=function t(t){var e=t.context;return function(t,n){var r=new WeakMap;if((typeof n==="undefined"?"undefined":O(n))=="object")return n.addInitializer(function(){r.set(this,new eW(this,{context:e}))}),{get:function e(){return t.get.call(this)},set:function e(e){var n;return(n=r.get(this))===null||n===void 0?void 0:n.setValue(e),t.set.call(this,e)},init:function t(t){var e;return(e=r.get(this))===null||e===void 0?void 0:e.setValue(t),t}};{t.constructor.addInitializer(function(t){r.set(t,new eW(t,{context:e}))});var i=Object.getOwnPropertyDescriptor(t,n),o;if(i===void 0){var a=new WeakMap;o={get:function t(){return a.get(this)},set:function t(t){r.get(this).setValue(t),a.set(this,t)},configurable:!0,enumerable:!0}}else{var s=i.set;o=x(k({},i),{set:function t(t){r.get(this).setValue(t),s===null||s===void 0?void 0:s.call(this,t)}})}return void Object.defineProperty(t,n,o)}}};var e=function t(t){var e=t.context,n=t.subscribe;return function(t,r){(typeof r==="undefined"?"undefined":O(r))=="object"?r.addInitializer(function(){var r=this;new eF(this,{context:e,callback:function(e){t.set.call(r,e)},subscribe:n})}):t.constructor.addInitializer(function(t){new eF(t,{context:e,callback:function(e){t[r]=e},subscribe:n})})}};var n=function t(t,e){if(!nT(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return nw!==void 0?nw.createHTML(e):e};var r=function t(t){return function(e,n){return(typeof n==="undefined"?"undefined":O(n))=="object"?ro(t,e,n):function(t,e,n){var r=e.hasOwnProperty(n);return e.constructor.createProperty(n,r?x(k({},t),{wrapped:!0}):t),r?Object.getOwnPropertyDescriptor(e,n):void 0}(t,e,n)}};var i=function t(t){return r(x(k({},t),{state:!0,attribute:!1}))};var l=function t(t,e){return function(n,r,i){var o=function(e){var n;var r;return(r=(n=e.renderRoot)===null||n===void 0?void 0:n.querySelector(t))!==null&&r!==void 0?r:null};if(e){var a=(typeof r==="undefined"?"undefined":O(r))=="object"?n:i!==null&&i!==void 0?i:function(){var t=Symbol();return{get:function e(){return this[t]},set:function e(e){this[t]=e}}}(),s=a.get,l=a.set;return ra(n,r,{get:function t(){var t=s.call(this);return t===void 0&&(t=o(this),(t!==null||this.hasUpdated)&&l.call(this,t)),t}})}return ra(n,r,{get:function t(){return o(this)}})}};var u=function t(t){return function(e,n){var r=t!==null&&t!==void 0?t:{},i=r.slot,o=r.selector,a="slot"+(i?"[name=".concat(i,"]"):":not([name])");return ra(e,n,{get:function e(){var e;var n;var r=(e=this.renderRoot)===null||e===void 0?void 0:e.querySelector(a),i=(n=r===null||r===void 0?void 0:r.assignedElements(t))!==null&&n!==void 0?n:[];return o===void 0?i:i.filter(function(t){return t.matches(o)})}})}};var d=function t(t,e){var n=k({waitUntilFirstUpdate:!1},e);return function(e,r){var i=e.update,o=Array.isArray(t)?t:[t];e.update=function(t){var e=this;o.forEach(function(i){var o=i;if(t.has(o)){var a=t.get(o),s=e[o];a!==s&&(!n.waitUntilFirstUpdate||e.hasUpdated)&&e[r](a,s)}}),i.call(this,t)}}};var y=function t(t,e,n){t.querySelectorAll(e).forEach(function(t){var r="".concat(e,"-").concat(n),i=g(t,r);t.replaceWith(i)})};var m=function t(t,e){t.querySelectorAll("*").forEach(function(t){var n=t.classList;n&&n.forEach(function(n){if(n.startsWith("".concat(e,":"))){var r=n.slice("".concat(e,":").length),i="".concat(t.nodeName,"-").concat(r),o=g(t,i);t.replaceWith(o)}})})};var g=function t(t,e){var n=document.createElement(e);var r=true,i=false,o=undefined;try{for(var a=t.attributes[Symbol.iterator](),s;!(r=(s=a.next()).done);r=true){var l=s.value;n.setAttribute(l.name,l.value)}}catch(t){i=true;o=t}finally{try{if(!r&&a.return!=null){a.return()}}finally{if(i){throw o}}}for(;t.firstChild;)n.appendChild(t.firstChild);return n};var b=function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return e&&rh!==null&&rh.abort(),new Promise(function(e,n){var r=new XMLHttpRequest;rh=r,r.open("GET",t,!0),r.responseType="document",r.onload=function(){r.status>=200&&r.status<300?e(r.responseXML):n(r.statusText)},r.onerror=function(){n(r.statusText)},r.send()})};var _=function t(t){return new DOMParser().parseFromString(t,"text/xml")};var E=function t(t){var e=new XSLTProcessor,n=new DOMParser().parseFromString(rd,"text/xml");return e.importStylesheet(n),e.transformToFragment(t,document)};var w=function t(t,e){e.endsWith("/")||(e+="/"),t.querySelectorAll("[src],[href],[primary-path]").forEach(function(t){var n;var r="";t.getAttribute("src")&&(r="src"),t.getAttribute("href")&&(r="href"),t.getAttribute("primary-path")&&(r="primary-path");var i=(n=t.getAttribute(r))===null||n===void 0?void 0:n.trim();if(!i.startsWith("data:")&&!i.startsWith("http")){var o=e+encodeURI(i);t.setAttribute(r,o)}})};var A=function t(t){t.querySelectorAll('qti-custom-operator[class="js.org"] > qti-base-value').forEach(function(t){var e=document.createComment(t.textContent);t.replaceChild(e,t.firstChild)})};var q=function t(t){t.querySelectorAll("qti-stylesheet").forEach(function(t){return t.remove()})};var R=function t(t){return t==null};var P=function t(t){return t.replace(/([^:]\/)\/+/g,"$1").replace(/\/\//g,"/").replace("http:/","http://").replace("https:/","https://")};var $=function t(t,e){var n;return function(e,r){var i=e.connectedCallback,o=e.disconnectedCallback;e.connectedCallback=function(){var e=this;var o;i.call(this);var a=function(n){var i;var o=Array.from(e.querySelectorAll(t)).concat(Array.from(((i=e.shadowRoot)===null||i===void 0?void 0:i.querySelectorAll(t))||[]));var a=true,s=false,l=undefined;try{for(var u=n[Symbol.iterator](),c;!(a=(c=u.next()).done);a=true){var d=c.value;var h=Array.from(d.addedNodes).map(function(t){return t}),f=Array.from(d.addedNodes).map(function(t){return t});d.type==="childList"&&h.find(function(t){return o.includes(t)})&&e[r](h,f)}}catch(t){s=true;l=t}finally{try{if(!a&&u.return!=null){u.return()}}finally{if(s){throw l}}}};n=new MutationObserver(a),n.observe(this,{childList:!0,subtree:!0});var s=Array.from(this.querySelectorAll(t)).concat(Array.from(((o=this.shadowRoot)===null||o===void 0?void 0:o.querySelectorAll(t))||[]));this[r](Array.from(s),[])},e.disconnectedCallback=function(){o.call(this),n.disconnect()}}};var U=function t(t,e){var n=/*#__PURE__*/function(t){"use strict";v(n,t);function n(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++){e[r]=arguments[r]}s(this,n);var i;i=a(this,n,T(e));i.identifier="";i.tabIndex=0;i.disabled=!1;i.readonly=!1;i.internals=i.attachInternals();return i}c(n,[{key:"handleDisabledChange",value:function t(t,e){this.tabIndex=e?-1:0,e&&this.blur()}},{key:"connectedCallback",value:function t(){h(f(n.prototype),"connectedCallback",this).call(this),this.addEventListener("keyup",this._onKeyUp),this.addEventListener("click",this._onClick),this.dispatchEvent(new CustomEvent("register-".concat(e),{bubbles:!0,composed:!0}))}},{key:"disconnectedCallback",value:function t(){h(f(n.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("keyup",this._onKeyUp),this.removeEventListener("click",this._onClick),this.dispatchEvent(new CustomEvent("unregister-".concat(e),{bubbles:!0,composed:!0}))}},{key:"_onKeyUp",value:function t(t){t.altKey||t.code==="Space"&&(t.preventDefault(),this._activate())}},{key:"_onClick",value:function t(){this.disabled||this.readonly||(this.focus(),this._activate())}},{key:"_activate",value:function t(){this.disabled||this.readonly||this.dispatchEvent(new CustomEvent("activate-".concat(e),{bubbles:!0,composed:!0,detail:{identifier:this.identifier}}))}},{key:"render",value:function t(){return nQ(N())}}]);return n}(t);return ej([r({type:String})],n.prototype,"identifier",2),ej([r({type:Number,reflect:!0,attribute:"tabindex"})],n.prototype,"tabIndex",2),ej([r({type:Boolean,reflect:!0,attribute:"aria-disabled",converter:rH})],n.prototype,"disabled",2),ej([r({type:Boolean,reflect:!0,attribute:"aria-readonly",converter:rH})],n.prototype,"readonly",2),ej([d("disabled",{waitUntilFirstUpdate:!0})],n.prototype,"handleDisabledChange",1),n};var eq=function t(t,e,n,r){var i=n.getAttribute("width")?parseFloat(n.getAttribute("width")):n.naturalWidth,o=n.getAttribute("height")?parseFloat(n.getAttribute("height")):n.naturalHeight;switch(t){case"circle":{if(e.length!==3){console.error("Invalid cirlce coordinates:",e);return}var a=S(e,3),s=a[0],l=a[1],u=a[2],c=s/i*100,d=l/o*100,h=u/i*100;r.style.left=c-h+"%",r.style.top=d-h+"%";var f=u/i*100,v=u/o*100;r.style.width=2*f+"%",r.style.height=2*v+"%",r.style.borderRadius="50%"}break;case"rect":{if(e.length!==4){console.error("Invalid rectangle coordinates:",e);return}var p=S(e,4),y=p[0],m=p[1],g=p[2],b=p[3],_=y/i*100,k=m/o*100,E=g/i*100,x=b/o*100;r.style.left=_+"%",r.style.top=k+"%",r.style.width=E-_+"%",r.style.height=x-k+"%"}break;case"ellipse":{if(e.length!==4){console.error("Invalid ellipse coordinates:",e);return}var w=S(e,4),A=w[0],C=w[1],q=w[2],R=w[3],P=A/i*100,M=C/o*100,O=q/i*100,$=R/o*100;r.style.left=P-O+"%",r.style.top=M-$+"%",r.style.width=2*O+"%",r.style.height=2*$+"%",r.style.borderRadius="50%"}break;case"poly":{var I,U,L,N;if(e.length<6||e.length%2!==0){console.error("Invalid polygon coordinates:",e);return}var D=[];for(var V=0;V<e.length;V+=2)D.push({x:e[V],y:e[V+1]});var j=(I=Math).min.apply(I,T(D.map(function(t){return t.x}))),H=(U=Math).max.apply(U,T(D.map(function(t){return t.x}))),Q=(L=Math).min.apply(L,T(D.map(function(t){return t.y}))),F=(N=Math).max.apply(N,T(D.map(function(t){return t.y}))),z=j/i*100,B=Q/o*100,W=H/i*100,Y=F/o*100;r.style.left=z+"%",r.style.top=B+"%",r.style.width=W-z+"%",r.style.height=Y-B+"%";var X=D.map(function(t){return{x:(t.x-j)/(H-j)*100,y:(t.y-Q)/(F-Q)*100}}).map(function(t){return"".concat(t.x,"% ").concat(t.y,"%")}).join(",");r.style.clipPath="polygon(".concat(X,")")}break;default:console.error("Unsupported shape: ".concat(t));break}};var eS=function t(t){this._$AN!==void 0?(iR(this),this._$AM=t,iP(this)):this._$AM=t};var eR=function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;var r=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(e)if(Array.isArray(r))for(var o=n;o<r.length;o++)iS(r[o],!1),iR(r[o]);else r!=null&&(iS(r,!1),iR(r));else iS(this,t)};var eP=function t(t){return /*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"calculateChildren",value:function t(t){return t.map(function(t){var e=t;if(!e.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;var n=e.calculate(),r=!1;if(typeof n=="string")if(n==="true")r=!0;else if(n==="false")r=!1;else return console.error("unexpected val in qti-or, expected boolean"),null;else typeof n=="boolean"&&(r=n);return r}).every(function(t){return typeof t=="boolean"&&t})}}]);return e}(t)};var eM=function t(t){return /*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"calculateChildren",value:function t(t){var e=t.map(function(t){if(!t.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;var e=t.calculate();return Number.isNaN(e)?(console.error("Unexpected value in qti-subtract, expected number"),null):Number(e)});return e.some(function(t){return t===null})?(console.error("One or more child expressions returned invalid values"),0):e[0]-e[1]}}]);return e}(t)};var eT,eO;var e$=Object.defineProperty;var eI=Object.getOwnPropertyDescriptor;var eU=Object.getOwnPropertyNames;var eL=Object.prototype.hasOwnProperty;var eN=function(t,e){for(var n in e)e$(t,n,{get:e[n],enumerable:!0})},eD=function(t,e,n,r){var i=true,o=false,a=undefined;if(e&&(typeof e==="undefined"?"undefined":O(e))=="object"||typeof e=="function")try{var s=function(){var i=u.value;!eL.call(t,i)&&i!==n&&e$(t,i,{get:function(){return e[i]},enumerable:!(r=eI(e,i))||r.enumerable})};for(var l=eU(e)[Symbol.iterator](),u;!(i=(u=l.next()).done);i=true)s()}catch(t){o=true;a=t}finally{try{if(!i&&l.return!=null){l.return()}}finally{if(o){throw a}}}return t};var eV=function(t){return eD(e$({},"__esModule",{value:!0}),t)},ej=function(t,e,n,r){for(var i=r>1?void 0:r?eI(e,n):e,o=t.length-1,a;o>=0;o--)(a=t[o])&&(i=(r?a(e,n,i):a(i))||i);return r&&i&&e$(e,n,i),i};var eH={};eN(eH,{QtiAnd:function(){return i4},QtiAssessmentItem:function(){return ru},QtiAssessmentStimulusRef:function(){return rv},QtiAssociableHotspot:function(){return rw},QtiAssociateInteraction:function(){return rR},QtiBaseValue:function(){return i6},QtiChoiceInteraction:function(){return r$},QtiCompanionMaterialsInfo:function(){return rp},QtiContains:function(){return i9},QtiContentBody:function(){return oA},QtiCorrect:function(){return i7},QtiCustomInteraction:function(){return rI},QtiCustomOperator:function(){return ry},QtiDelete:function(){return ow},QtiEndAttemptInteraction:function(){return rU},QtiEqual:function(){return oe},QtiEqualRounded:function(){return i8},QtiExtendedTextInteraction:function(){return rN},QtiFeedbackBlock:function(){return r_},QtiFeedbackInline:function(){return rE},QtiGap:function(){return rF},QtiGapImg:function(){return rD},QtiGapMatchInteraction:function(){return rj},QtiGapText:function(){return rQ},QtiGraphicAssociateInteraction:function(){return r6},QtiGraphicGapMatchInteraction:function(){return r7},QtiGraphicOrderInteraction:function(){return it},QtiGt:function(){return on},QtiGte:function(){return or},QtiHotspotChoice:function(){return ie},QtiHotspotInteraction:function(){return ii},QtiHottext:function(){return ia},QtiHottextInteraction:function(){return io},QtiInlineChoice:function(){return ic},QtiInlineChoiceInteraction:function(){return iu},QtiIsNull:function(){return oi},QtiItemBody:function(){return ij},QtiLookupOutcomeValue:function(){return iJ},QtiLt:function(){return oo},QtiLte:function(){return oa},QtiMapResponse:function(){return os},QtiMapResponsePoint:function(){return ou},QtiMatch:function(){return oc},QtiMatchInteraction:function(){return iv},QtiMediaInteraction:function(){return ip},QtiMember:function(){return od},QtiModalFeedback:function(){return rx},QtiMultiple:function(){return oh},QtiNot:function(){return of},QtiOr:function(){return ov},QtiOrderInteraction:function(){return im},QtiOrdered:function(){return op},QtiOutcomeDeclaration:function(){return oR},QtiOutcomeProcessing:function(){return iH},QtiOutcomeProcessingProcessor:function(){return iQ},QtiPortableCustomInteraction:function(){return ig},QtiPositionObjectInteraction:function(){return ib},QtiPositionObjectStage:function(){return i_},QtiPrintedVariable:function(){return oy},QtiProduct:function(){return om},QtiPrompt:function(){return iF},QtiRandom:function(){return ox},QtiResponseCondition:function(){return iG},QtiResponseDeclaration:function(){return oP},QtiResponseElse:function(){return i0},QtiResponseElseIf:function(){return i2},QtiResponseIf:function(){return i1},QtiResponseProcessing:function(){return iY},QtiRubricBlock:function(){return oC},QtiRule:function(){return iX},QtiSelectPointInteraction:function(){return iw},QtiSetOutcomeValue:function(){return iK},QtiSetOutcomeValueRule:function(){return iZ},QtiSimpleAssociableChoice:function(){return id},QtiSimpleChoice:function(){return iA},QtiSliderInteraction:function(){return iq},QtiStringMatch:function(){return ob},QtiStylesheet:function(){return oq},QtiSubtract:function(){return og},QtiSum:function(){return o_},QtiSumExpression:function(){return ok},QtiTextEntryInteraction:function(){return iN},QtiUploadInteraction:function(){return iD},QtiVariable:function(){return oE},qtiAndMixin:function(){return eP},qtiSubtractMixin:function(){return eM}});var eQ=/*#__PURE__*/function(t){"use strict";v(e,t);function e(t,n,r){s(this,e);var i;i=a(this,e,["context-request",{bubbles:!0,composed:!0}]),i.context=t,i.callback=n,i.subscribe=r!==null&&r!==void 0?r:!1;return i}return e}(I(Event));var eF=/*#__PURE__*/function(){"use strict";function t(e,n,r,i){var o=this;s(this,t);if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=function(t,e){o.unsubscribe&&(o.unsubscribe!==e&&(o.provided=!1,o.unsubscribe()),o.subscribe||o.unsubscribe()),o.value=t,o.host.requestUpdate(),o.provided&&!o.subscribe||(o.provided=!0,o.callback&&o.callback(t,e)),o.unsubscribe=e},this.host=e,n.context!==void 0){var a=n;var l;this.context=a.context,this.callback=a.callback,this.subscribe=(l=a.subscribe)!==null&&l!==void 0?l:!1}else this.context=n,this.callback=r,this.subscribe=i!==null&&i!==void 0?i:!1;this.host.addController(this)}c(t,[{key:"hostConnected",value:function t(){this.dispatchRequest()}},{key:"hostDisconnected",value:function t(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}},{key:"dispatchRequest",value:function t(){this.host.dispatchEvent(new eQ(this.context,this.t,this.subscribe))}}]);return t}();var ez=/*#__PURE__*/function(){"use strict";function t(e){var n=this;s(this,t);this.subscriptions=new Map,this.updateObservers=function(){var t=true,e=false,r=undefined;try{for(var i=n.subscriptions[Symbol.iterator](),o;!(t=(o=i.next()).done);t=true){var a=S(o.value,2),s=a[0],l=a[1],u=l.disposer;s(n.o,u)}}catch(t){e=true;r=t}finally{try{if(!t&&i.return!=null){i.return()}}finally{if(e){throw r}}}},e!==void 0&&(this.value=e)}c(t,[{key:"value",get:function t(){return this.o},set:function t(t){this.setValue(t)}},{key:"setValue",value:function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;var n=e||!Object.is(t,this.o);this.o=t,n&&this.updateObservers()}},{key:"addCallback",value:function t(t,e,n){var r=this;if(!n)return void t(this.value);this.subscriptions.has(t)||this.subscriptions.set(t,{disposer:function(){r.subscriptions.delete(t)},consumerHost:e});var i=this.subscriptions.get(t),o=i.disposer;t(this.value,o)}},{key:"clearCallbacks",value:function t(){this.subscriptions.clear()}}]);return t}();var eB=/*#__PURE__*/function(t){"use strict";v(e,t);function e(t){s(this,e);var n;n=a(this,e,["context-provider",{bubbles:!0,composed:!0}]),n.context=t;return n}return e}(I(Event)),eW=/*#__PURE__*/function(t){"use strict";v(e,t);function e(t,n,r){s(this,e);var i;var o,l;i=a(this,e,[n.context!==void 0?n.initialValue:r]),i.onContextRequest=function(t){var e=t.composedPath()[0];t.context===i.context&&e!==i.host&&(t.stopPropagation(),i.addCallback(t.callback,e,t.subscribe))},i.onProviderRequest=function(t){var e=t.composedPath()[0];if(t.context!==i.context||e===i.host)return;var n=new Set;var r=true,o=false,a=undefined;try{for(var s=i.subscriptions[Symbol.iterator](),l;!(r=(l=s.next()).done);r=true){var u=S(l.value,2),c=u[0],d=u[1],h=d.consumerHost;n.has(c)||(n.add(c),h.dispatchEvent(new eQ(i.context,c,!0)))}}catch(t){o=true;a=t}finally{try{if(!r&&s.return!=null){s.return()}}finally{if(o){throw a}}}t.stopPropagation()},i.host=t,n.context!==void 0?i.context=n.context:i.context=n,i.attachListeners(),(o=(l=i.host).addController)===null||o===void 0?void 0:o.call(l,i);return i}c(e,[{key:"attachListeners",value:function t(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}},{key:"hostConnected",value:function t(){this.host.dispatchEvent(new eB(this.context))}}]);return e}(ez);var eY=/*#__PURE__*/function(){"use strict";function t(e){s(this,t);this.ariaAtomic="",this.ariaAutoComplete="",this.ariaBrailleLabel="",this.ariaBrailleRoleDescription="",this.ariaBusy="",this.ariaChecked="",this.ariaColCount="",this.ariaColIndex="",this.ariaColSpan="",this.ariaCurrent="",this.ariaDescription="",this.ariaDisabled="",this.ariaExpanded="",this.ariaHasPopup="",this.ariaHidden="",this.ariaInvalid="",this.ariaKeyShortcuts="",this.ariaLabel="",this.ariaLevel="",this.ariaLive="",this.ariaModal="",this.ariaMultiLine="",this.ariaMultiSelectable="",this.ariaOrientation="",this.ariaPlaceholder="",this.ariaPosInSet="",this.ariaPressed="",this.ariaReadOnly="",this.ariaRequired="",this.ariaRoleDescription="",this.ariaRowCount="",this.ariaRowIndex="",this.ariaRowSpan="",this.ariaSelected="",this.ariaSetSize="",this.ariaSort="",this.ariaValueMax="",this.ariaValueMin="",this.ariaValueNow="",this.ariaValueText="",this.role="",this.form=null,this.labels=[],this.states=new Set,this.validationMessage="",this.validity={},this.willValidate=!0,this.__host=e}c(t,[{key:"shadowRoot",get:function t(){return this.__host.__shadowRoot}},{key:"checkValidity",value:function t(){return console.warn("`ElementInternals.checkValidity()` was called on the server.This method always returns true."),!0}},{key:"reportValidity",value:function t(){return!0}},{key:"setFormValue",value:function t(){}},{key:"setValidity",value:function t(){}}]);return t}();var eX=new WeakMap,eJ=function(t){var e=eX.get(t);return e===void 0&&eX.set(t,e=new Map),e},eG=/*#__PURE__*/function(){"use strict";function t(){s(this,t);this.__shadowRootMode=null,this.__shadowRoot=null,this.__internals=null}c(t,[{key:"attributes",get:function t(){return Array.from(eJ(this)).map(function(t){var e=S(t,2),n=e[0],r=e[1];return{name:n,value:r}})}},{key:"shadowRoot",get:function t(){return this.__shadowRootMode==="closed"?null:this.__shadowRoot}},{key:"localName",get:function t(){return this.constructor.__localName}},{key:"tagName",get:function t(){var t;return(t=this.localName)===null||t===void 0?void 0:t.toUpperCase()}},{key:"setAttribute",value:function t(t,e){eJ(this).set(t,String(e))}},{key:"removeAttribute",value:function t(t){eJ(this).delete(t)}},{key:"toggleAttribute",value:function t(t,e){if(this.hasAttribute(t)){if(e===void 0||!e)return this.removeAttribute(t),!1}else return e===void 0||e?(this.setAttribute(t,""),!0):!1;return!0}},{key:"hasAttribute",value:function t(t){return eJ(this).has(t)}},{key:"attachShadow",value:function t(t){var e={host:this};return this.__shadowRootMode=t.mode,t&&t.mode==="open"&&(this.__shadowRoot=e),e}},{key:"attachInternals",value:function t(){if(this.__internals!==null)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");var t=new eY(this);return this.__internals=t,t}},{key:"getAttribute",value:function t(t){var e;return(e=eJ(this).get(t))!==null&&e!==void 0?e:null}}]);return t}();var eK=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}return e}(eG),eZ=eK;var e0=/*#__PURE__*/function(){"use strict";function t(){s(this,t);this.__definitions=new Map}c(t,[{key:"define",value:function t(t,e){if(this.__definitions.has(t))if(process.env.NODE_ENV==="development")console.warn("'CustomElementRegistry' already has \"".concat(t,'" defined. This may have been caused by live reload or hot module replacement in which case it can be safely ignored.\nMake sure to test your application with a production build as repeat registrations will throw in production.'));else throw new Error("Failed to execute 'define' on 'CustomElementRegistry': the name \"".concat(t,'" has already been used with this registry'));var n;e.__localName=t,this.__definitions.set(t,{ctor:e,observedAttributes:(n=e.observedAttributes)!==null&&n!==void 0?n:[]})}},{key:"get",value:function t(t){var e;return(e=this.__definitions.get(t))===null||e===void 0?void 0:e.ctor}}]);return t}(),e1=e0;var e2=new e1;var e3=globalThis,e5=e3.ShadowRoot&&(e3.ShadyCSS===void 0||e3.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,e4=Symbol(),e6=new WeakMap,e9=/*#__PURE__*/function(){"use strict";function t(e,n,r){s(this,t);if(this._$cssResult$=!0,r!==e4)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=n}c(t,[{key:"styleSheet",get:function t(){var t=this.o,e=this.t;if(e5&&t===void 0){var n=e!==void 0&&e.length===1;n&&(t=e6.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),n&&e6.set(e,t))}return t}},{key:"toString",value:function t(){return this.cssText}}]);return t}(),e7=function(t){return new e9(typeof t=="string"?t:t+"",void 0,e4)},e8=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++){n[r-1]=arguments[r]}var i=t.length===1?t[0]:n.reduce(function(e,n,r){return e+function(t){if(t._$cssResult$===!0)return t.cssText;if(typeof t=="number")return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")}(n)+t[r+1]},t[0]);return new e9(i,t,e4)},nt=function(t,e){var n=true,r=false,i=undefined;if(e5)t.adoptedStyleSheets=e.map(function(t){return p(t,CSSStyleSheet)?t:t.styleSheet});else try{for(var o=e[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){var s=a.value;var l=document.createElement("style"),u=e3.litNonce;u!==void 0&&l.setAttribute("nonce",u),l.textContent=s.cssText,t.appendChild(l)}}catch(t){r=true;i=t}finally{try{if(!n&&o.return!=null){o.return()}}finally{if(r){throw i}}}},ne=e5||e3.CSSStyleSheet===void 0?function(t){return t}:function(t){return p(t,CSSStyleSheet)?function(t){var e="";var n=true,r=false,i=undefined;try{for(var o=t.cssRules[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){var s=a.value;e+=s.cssText}}catch(t){r=true;i=t}finally{try{if(!n&&o.return!=null){o.return()}}finally{if(r){throw i}}}return e7(e)}(t):t};var nn=Object.is,nr=Object.defineProperty,ni=Object.getOwnPropertyDescriptor,no=Object.getOwnPropertyNames,na=Object.getOwnPropertySymbols,ns=Object.getPrototypeOf,nl=globalThis;var nu;(nu=nl.customElements)!==null&&nu!==void 0?nu:nl.customElements=e2;var nc=nl.trustedTypes,nd=nc?nc.emptyScript:"",nh=nl.reactiveElementPolyfillSupport,nf=function(t,e){return t},nv={toAttribute:function t(t,e){switch(e){case Boolean:t=t?nd:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute:function t(t,e){var n=t;switch(e){case Boolean:n=t!==null;break;case Number:n=t===null?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch(t){n=null}}return n}},np=function(t,e){return!nn(t,e)},ny={attribute:!0,type:String,converter:nv,reflect:!1,hasChanged:np};var nm,ng;(nm=Symbol.metadata)!==null&&nm!==void 0?nm:Symbol.metadata=Symbol("metadata"),(ng=nl.litPropertyMetadata)!==null&&ng!==void 0?ng:nl.litPropertyMetadata=new WeakMap;var nb;var n_=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e),t._$Ep=void 0,t.isUpdatePending=!1,t.hasUpdated=!1,t._$Em=null,t._$Ev();return t}c(e,[{key:"_$Ev",value:function t(){var t=this;var e;this._$ES=new Promise(function(e){return t.enableUpdating=e}),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)===null||e===void 0?void 0:e.forEach(function(e){return e(t)})}},{key:"addController",value:function t(t){var e;var n;((n=this._$EO)!==null&&n!==void 0?n:this._$EO=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)===null||e===void 0?void 0:e.call(t))}},{key:"removeController",value:function t(t){var e;(e=this._$EO)===null||e===void 0?void 0:e.delete(t)}},{key:"_$E_",value:function t(){var t=new Map,e=this.constructor.elementProperties;var n=true,r=false,i=undefined;try{for(var o=e.keys()[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){var s=a.value;this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s])}}catch(t){r=true;i=t}finally{try{if(!n&&o.return!=null){o.return()}}finally{if(r){throw i}}}t.size>0&&(this._$Ep=t)}},{key:"createRenderRoot",value:function t(){var t;var e=(t=this.shadowRoot)!==null&&t!==void 0?t:this.attachShadow(this.constructor.shadowRootOptions);return nt(e,this.constructor.elementStyles),e}},{key:"connectedCallback",value:function t(){var t;var e;(e=this.renderRoot)!==null&&e!==void 0?e:this.renderRoot=this.createRenderRoot(),this.enableUpdating(!0),(t=this._$EO)===null||t===void 0?void 0:t.forEach(function(t){var e;return(e=t.hostConnected)===null||e===void 0?void 0:e.call(t)})}},{key:"enableUpdating",value:function t(t){}},{key:"disconnectedCallback",value:function t(){var t;(t=this._$EO)===null||t===void 0?void 0:t.forEach(function(t){var e;return(e=t.hostDisconnected)===null||e===void 0?void 0:e.call(t)})}},{key:"attributeChangedCallback",value:function t(t,e,n){this._$AK(t,n)}},{key:"_$EC",value:function t(t,e){var n=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,n);if(r!==void 0&&n.reflect===!0){var i;var o=(((i=n.converter)===null||i===void 0?void 0:i.toAttribute)!==void 0?n.converter:nv).toAttribute(e,n.type);this._$Em=t,o==null?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}},{key:"_$AK",value:function t(t,e){var n=this.constructor,r=n._$Eh.get(t);if(r!==void 0&&this._$Em!==r){var i;var o=n.getPropertyOptions(r),a=typeof o.converter=="function"?{fromAttribute:o.converter}:((i=o.converter)===null||i===void 0?void 0:i.fromAttribute)!==void 0?o.converter:nv;this._$Em=r,this[r]=a.fromAttribute(e,o.type),this._$Em=null}}},{key:"requestUpdate",value:function t(t,e,n){if(t!==void 0){var r;if(n!==null&&n!==void 0?n:n=this.constructor.getPropertyOptions(t),!((r=n.hasChanged)!==null&&r!==void 0?r:np)(this[t],e))return;this.P(t,e,n)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}},{key:"P",value:function t(t,e,n){var r;this._$AL.has(t)||this._$AL.set(t,e),n.reflect===!0&&this._$Em!==t&&((r=this._$Ej)!==null&&r!==void 0?r:this._$Ej=new Set).add(t)}},{key:"_$ET",value:function t(){var t=this;return o(function(){var e,n,r;return L(this,function(i){switch(i.label){case 0:t.isUpdatePending=!0;i.label=1;case 1:i.trys.push([1,3,,4]);return[4,t._$ES];case 2:i.sent();return[3,4];case 3:e=i.sent();Promise.reject(e);return[3,4];case 4:n=t.scheduleUpdate();r=n!=null;if(!r)return[3,6];return[4,n];case 5:r=i.sent();i.label=6;case 6:return[2,(r,!t.isUpdatePending)]}})})()}},{key:"scheduleUpdate",value:function t(){return this.performUpdate()}},{key:"performUpdate",value:function t(){if(!this.isUpdatePending)return;if(!this.hasUpdated){var t;if((t=this.renderRoot)!==null&&t!==void 0?t:this.renderRoot=this.createRenderRoot(),this._$Ep){var e=true,n=false,r=undefined;try{for(var i=this._$Ep[Symbol.iterator](),o;!(e=(o=i.next()).done);e=true){var a=S(o.value,2),s=a[0],l=a[1];this[s]=l}}catch(t){n=true;r=t}finally{try{if(!e&&i.return!=null){i.return()}}finally{if(n){throw r}}}this._$Ep=void 0}var u=this.constructor.elementProperties;var c=true,d=false,h=undefined;if(u.size>0)try{for(var f=u[Symbol.iterator](),v;!(c=(v=f.next()).done);c=true){var p=S(v.value,2),y=p[0],m=p[1];m.wrapped!==!0||this._$AL.has(y)||this[y]===void 0||this.P(y,this[y],m)}}catch(t){d=true;h=t}finally{try{if(!c&&f.return!=null){f.return()}}finally{if(d){throw h}}}}var g=!1,b=this._$AL;try{var _;g=this.shouldUpdate(b),g?(this.willUpdate(b),(_=this._$EO)===null||_===void 0?void 0:_.forEach(function(t){var e;return(e=t.hostUpdate)===null||e===void 0?void 0:e.call(t)}),this.update(b)):this._$EU()}catch(t){throw g=!1,this._$EU(),t}g&&this._$AE(b)}},{key:"willUpdate",value:function t(t){}},{key:"_$AE",value:function t(t){var e;(e=this._$EO)===null||e===void 0?void 0:e.forEach(function(t){var e;return(e=t.hostUpdated)===null||e===void 0?void 0:e.call(t)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}},{key:"_$EU",value:function t(){this._$AL=new Map,this.isUpdatePending=!1}},{key:"updateComplete",get:function t(){return this.getUpdateComplete()}},{key:"getUpdateComplete",value:function t(){return this._$ES}},{key:"shouldUpdate",value:function t(t){return!0}},{key:"update",value:function t(t){var e=this;this._$Ej&&(this._$Ej=this._$Ej.forEach(function(t){return e._$EC(t,e[t])})),this._$EU()}},{key:"updated",value:function t(t){}},{key:"firstUpdated",value:function t(t){}}],[{key:"addInitializer",value:function t(t){var e;this._$Ei(),((e=this.l)!==null&&e!==void 0?e:this.l=[]).push(t)}},{key:"observedAttributes",get:function t(){return this.finalize(),this._$Eh&&T(this._$Eh.keys())}},{key:"createProperty",value:function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ny;if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){var n=Symbol(),r=this.getPropertyDescriptor(t,n,e);r!==void 0&&nr(this.prototype,t,r)}}},{key:"getPropertyDescriptor",value:function t(t,e,n){var r;var i=(r=ni(this.prototype,t))!==null&&r!==void 0?r:{get:function t(){return this[e]},set:function t(t){this[e]=t}},o=i.get,a=i.set;return{get:function t(){return o===null||o===void 0?void 0:o.call(this)},set:function e(e){var r=o===null||o===void 0?void 0:o.call(this);a.call(this,e),this.requestUpdate(t,r,n)},configurable:!0,enumerable:!0}}},{key:"getPropertyOptions",value:function t(t){var e;return(e=this.elementProperties.get(t))!==null&&e!==void 0?e:ny}},{key:"_$Ei",value:function t(){if(this.hasOwnProperty(nf("elementProperties")))return;var t=ns(this);t.finalize(),t.l!==void 0&&(this.l=T(t.l)),this.elementProperties=new Map(t.elementProperties)}},{key:"finalize",value:function t(){if(this.hasOwnProperty(nf("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(nf("properties"))){var t=this.properties,e=T(no(t)).concat(T(na(t)));var n=true,r=false,i=undefined;try{for(var o=e[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){var s=a.value;this.createProperty(s,t[s])}}catch(t){r=true;i=t}finally{try{if(!n&&o.return!=null){o.return()}}finally{if(r){throw i}}}}var l=this[Symbol.metadata];if(l!==null){var u=litPropertyMetadata.get(l);var c=true,d=false,h=undefined;if(u!==void 0)try{for(var f=u[Symbol.iterator](),v;!(c=(v=f.next()).done);c=true){var p=S(v.value,2),y=p[0],m=p[1];this.elementProperties.set(y,m)}}catch(t){d=true;h=t}finally{try{if(!c&&f.return!=null){f.return()}}finally{if(d){throw h}}}}this._$Eh=new Map;var g=true,b=false,_=undefined;try{for(var k=this.elementProperties[Symbol.iterator](),E;!(g=(E=k.next()).done);g=true){var x=S(E.value,2),w=x[0],A=x[1];var C=this._$Eu(w,A);C!==void 0&&this._$Eh.set(C,w)}}catch(t){b=true;_=t}finally{try{if(!g&&k.return!=null){k.return()}}finally{if(b){throw _}}}this.elementStyles=this.finalizeStyles(this.styles)}},{key:"finalizeStyles",value:function t(t){var e=[];if(Array.isArray(t)){var n=new Set(t.flat(1/0).reverse());var r=true,i=false,o=undefined;try{for(var a=n[Symbol.iterator](),s;!(r=(s=a.next()).done);r=true){var l=s.value;e.unshift(ne(l))}}catch(t){i=true;o=t}finally{try{if(!r&&a.return!=null){a.return()}}finally{if(i){throw o}}}}else t!==void 0&&e.push(ne(t));return e}},{key:"_$Eu",value:function t(t,e){var n=e.attribute;return n===!1?void 0:typeof n=="string"?n:typeof t=="string"?t.toLowerCase():void 0}}]);return e}((nb=globalThis.HTMLElement)!==null&&nb!==void 0?nb:eZ);var nk;n_.elementStyles=[],n_.shadowRootOptions={mode:"open"},n_[nf("elementProperties")]=new Map,n_[nf("finalized")]=new Map,nh===null||nh===void 0?void 0:nh({ReactiveElement:n_}),((nk=nl.reactiveElementVersions)!==null&&nk!==void 0?nk:nl.reactiveElementVersions=[]).push("2.0.4");var nE=globalThis,nx=nE.trustedTypes,nw=nx?nx.createPolicy("lit-html",{createHTML:function(t){return t}}):void 0,nA="$lit$",nC="lit$".concat(Math.random().toFixed(9).slice(2),"$"),nq="?"+nC,nS="<".concat(nq,">"),nR=nE.document===void 0?{createTreeWalker:function(){return{}}}:document,nP=function(){return nR.createComment("")},nM=function(t){return t===null||(typeof t==="undefined"?"undefined":O(t))!="object"&&typeof t!="function"},nT=Array.isArray,nO=function(t){return nT(t)||typeof(t===null||t===void 0?void 0:t[Symbol.iterator])=="function"},n$="[ \n\f\r]",nI=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,nU=/-->/g,nL=/>/g,nN=RegExp(">|".concat(n$,"(?:([^\\s\"'>=/]+)(").concat(n$,"*=").concat(n$,"*(?:[^ \n\f\r\"'`<>=]|(\"|')|))|$)"),"g"),nD=/'/g,nV=/"/g,nj=/^(?:script|style|textarea|title)$/i,nH=function(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++){r[i-1]=arguments[i]}return{_$litType$:t,strings:e,values:r}}},nQ=nH(1),nF=nH(2),nz=nH(3),nB=Symbol.for("lit-noChange"),nW=Symbol.for("lit-nothing"),nY=new WeakMap,nX=nR.createTreeWalker(nR,129);var nJ=function(t,e){var r=t.length-1,i=[],o,a=e===2?"<svg>":e===3?"<math>":"",s=nI;for(var l=0;l<r;l++){var u=t[l],c=void 0,d=void 0,h=-1,f=0;for(;f<u.length&&(s.lastIndex=f,d=s.exec(u),d!==null);)f=s.lastIndex,s===nI?d[1]==="!--"?s=nU:d[1]!==void 0?s=nL:d[2]!==void 0?(nj.test(d[2])&&(o=RegExp("</"+d[2],"g")),s=nN):d[3]!==void 0&&(s=nN):s===nN?d[0]===">"?(s=o!==null&&o!==void 0?o:nI,h=-1):d[1]===void 0?h=-2:(h=s.lastIndex-d[2].length,c=d[1],s=d[3]===void 0?nN:d[3]==='"'?nV:nD):s===nV||s===nD?s=nN:s===nU||s===nL?s=nI:(s=nN,o=void 0);var v=s===nN&&t[l+1].startsWith("/>")?" ":"";a+=s===nI?u+nS:h>=0?(i.push(c),u.slice(0,h)+nA+u.slice(h)+nC+v):u+nC+(h===-2?l:v)}return[n(t,a+(t[r]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]},nG=/*#__PURE__*/function(){"use strict";function t(e,n){var r=e.strings,i=e._$litType$;s(this,t);var o;this.parts=[];var a=0,l=0,u=r.length-1,c=this.parts,d=S(nJ(r,i),2),h=d[0],f=d[1];if(this.el=t.createElement(h,n),nX.currentNode=this.el.content,i===2||i===3){var v;var p=this.el.content.firstChild;(v=p).replaceWith.apply(v,T(p.childNodes))}for(;(o=nX.nextNode())!==null&&c.length<u;){if(o.nodeType===1){var y=true,m=false,g=undefined;if(o.hasAttributes())try{for(var b=o.getAttributeNames()[Symbol.iterator](),_;!(y=(_=b.next()).done);y=true){var k=_.value;if(k.endsWith(nA)){var E=f[l++],x=o.getAttribute(k).split(nC),w=/([.?@])?(.*)/.exec(E);c.push({type:1,index:a,name:w[2],strings:x,ctor:w[1]==="."?n2:w[1]==="?"?n3:w[1]==="@"?n5:n1}),o.removeAttribute(k)}else k.startsWith(nC)&&(c.push({type:6,index:a}),o.removeAttribute(k))}}catch(t){m=true;g=t}finally{try{if(!y&&b.return!=null){b.return()}}finally{if(m){throw g}}}if(nj.test(o.tagName)){var A=o.textContent.split(nC),C=A.length-1;if(C>0){o.textContent=nx?nx.emptyScript:"";for(var q=0;q<C;q++)o.append(A[q],nP()),nX.nextNode(),c.push({type:2,index:++a});o.append(A[C],nP())}}}else if(o.nodeType===8)if(o.data===nq)c.push({type:2,index:a});else{var R=-1;for(;(R=o.data.indexOf(nC,R+1))!==-1;)c.push({type:7,index:a}),R+=nC.length-1}a++}}c(t,null,[{key:"createElement",value:function t(t,e){var n=nR.createElement("template");return n.innerHTML=t,n}}]);return t}();function nK(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t,r=arguments.length>3?arguments[3]:void 0;var i,o;if(e===nB)return e;var a=r!==void 0?(i=n._$Co)===null||i===void 0?void 0:i[r]:n._$Cl,s=nM(e)?void 0:e._$litDirective$;var l;return(a===null||a===void 0?void 0:a.constructor)!==s&&(a===null||a===void 0?void 0:(o=a._$AO)===null||o===void 0?void 0:o.call(a,!1),s===void 0?a=void 0:(a=new s(t),a._$AT(t,n,r)),r!==void 0?((l=n._$Co)!==null&&l!==void 0?l:n._$Co=[])[r]=a:n._$Cl=a),a!==void 0&&(e=nK(t,a._$AS(t,e.values),a,r)),e}var nZ=/*#__PURE__*/function(){"use strict";function t(e,n){s(this,t);this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=n}c(t,[{key:"parentNode",get:function t(){return this._$AM.parentNode}},{key:"_$AU",get:function t(){return this._$AM._$AU}},{key:"u",value:function t(t){var e;var n=this._$AD,r=n.el,i=r.content,o=n.parts,a=((e=t===null||t===void 0?void 0:t.creationScope)!==null&&e!==void 0?e:nR).importNode(i,!0);nX.currentNode=a;var s=nX.nextNode(),l=0,u=0,c=o[0];for(;c!==void 0;){if(l===c.index){var d=void 0;c.type===2?d=new n0(s,s.nextSibling,this,t):c.type===1?d=new c.ctor(s,c.name,c.strings,this,t):c.type===6&&(d=new n4(s,this,t)),this._$AV.push(d),c=o[++u]}l!==(c===null||c===void 0?void 0:c.index)&&(s=nX.nextNode(),l++)}return nX.currentNode=nR,a}},{key:"p",value:function t(t){var e=0;var n=true,r=false,i=undefined;try{for(var o=this._$AV[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){var s=a.value;s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}catch(t){r=true;i=t}finally{try{if(!n&&o.return!=null){o.return()}}finally{if(r){throw i}}}}}]);return t}(),n0=/*#__PURE__*/function(){"use strict";function t(e,n,r,i){s(this,t);var o;this.type=2,this._$AH=nW,this._$AN=void 0,this._$AA=e,this._$AB=n,this._$AM=r,this.options=i,this._$Cv=(o=i===null||i===void 0?void 0:i.isConnected)!==null&&o!==void 0?o:!0}c(t,[{key:"_$AU",get:function t(){var t;var e;return(e=(t=this._$AM)===null||t===void 0?void 0:t._$AU)!==null&&e!==void 0?e:this._$Cv}},{key:"parentNode",get:function t(){var t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&(t===null||t===void 0?void 0:t.nodeType)===11&&(t=e.parentNode),t}},{key:"startNode",get:function t(){return this._$AA}},{key:"endNode",get:function t(){return this._$AB}},{key:"_$AI",value:function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this;t=nK(this,t,e),nM(t)?t===nW||t==null||t===""?(this._$AH!==nW&&this._$AR(),this._$AH=nW):t!==this._$AH&&t!==nB&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):nO(t)?this.k(t):this._(t)}},{key:"O",value:function t(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}},{key:"T",value:function t(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}},{key:"_",value:function t(t){this._$AH!==nW&&nM(this._$AH)?this._$AA.nextSibling.data=t:this.T(nR.createTextNode(t)),this._$AH=t}},{key:"$",value:function t(t){var e;var r=t.values,i=t._$litType$,o=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=nG.createElement(n(i.h,i.h[0]),this.options)),i);if(((e=this._$AH)===null||e===void 0?void 0:e._$AD)===o)this._$AH.p(r);else{var a=new nZ(o,this),s=a.u(this.options);a.p(r),this.T(s),this._$AH=a}}},{key:"_$AC",value:function t(t){var e=nY.get(t.strings);return e===void 0&&nY.set(t.strings,e=new nG(t)),e}},{key:"k",value:function e(e){nT(this._$AH)||(this._$AH=[],this._$AR());var n=this._$AH,r,i=0;var o=true,a=false,s=undefined;try{for(var l=e[Symbol.iterator](),u;!(o=(u=l.next()).done);o=true){var c=u.value;i===n.length?n.push(r=new t(this.O(nP()),this.O(nP()),this,this.options)):r=n[i],r._$AI(c),i++}}catch(t){a=true;s=t}finally{try{if(!o&&l.return!=null){l.return()}}finally{if(a){throw s}}}i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}},{key:"_$AR",value:function t(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this._$AA.nextSibling,e=arguments.length>1?arguments[1]:void 0;var n,r;for((n=(r=this)._$AP)===null||n===void 0?void 0:n.call(r,!1,!0,e);t&&t!==this._$AB;){var i=t.nextSibling;t.remove(),t=i}}},{key:"setConnected",value:function t(t){var e,n;this._$AM===void 0&&(this._$Cv=t,(e=(n=this)._$AP)===null||e===void 0?void 0:e.call(n,t))}}]);return t}(),n1=/*#__PURE__*/function(){"use strict";function t(e,n,r,i,o){s(this,t);this.type=1,this._$AH=nW,this._$AN=void 0,this.element=e,this.name=n,this._$AM=i,this.options=o,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=nW}c(t,[{key:"tagName",get:function t(){return this.element.tagName}},{key:"_$AU",get:function t(){return this._$AM._$AU}},{key:"_$AI",value:function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;var i=this.strings,o=!1;if(i===void 0)t=nK(this,t,e,0),o=!nM(t)||t!==this._$AH&&t!==nB,o&&(this._$AH=t);else{var a=t,s,l;for(t=i[0],s=0;s<i.length-1;s++)l=nK(this,a[n+s],e,s),l===nB&&(l=this._$AH[s]),o||(o=!nM(l)||l!==this._$AH[s]),l===nW?t=nW:t!==nW&&(t+=(l!==null&&l!==void 0?l:"")+i[s+1]),this._$AH[s]=l}o&&!r&&this.j(t)}},{key:"j",value:function t(t){t===nW?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t!==null&&t!==void 0?t:"")}}]);return t}(),n2=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments),t.type=3;return t}c(e,[{key:"j",value:function t(t){this.element[this.name]=t===nW?void 0:t}}]);return e}(n1),n3=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments),t.type=4;return t}c(e,[{key:"j",value:function t(t){this.element.toggleAttribute(this.name,!!t&&t!==nW)}}]);return e}(n1),n5=/*#__PURE__*/function(t){"use strict";v(e,t);function e(t,n,r,i,o){s(this,e);var l;l=a(this,e,[t,n,r,i,o]),l.type=5;return l}c(e,[{key:"_$AI",value:function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this;var n;if((t=(n=nK(this,t,e,0))!==null&&n!==void 0?n:nW)===nB)return;var r=this._$AH,i=t===nW&&r!==nW||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,o=t!==nW&&(r===nW||i);i&&this.element.removeEventListener(this.name,this,r),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}},{key:"handleEvent",value:function t(t){var e;var n;typeof this._$AH=="function"?this._$AH.call((n=(e=this.options)===null||e===void 0?void 0:e.host)!==null&&n!==void 0?n:this.element,t):this._$AH.handleEvent(t)}}]);return e}(n1),n4=/*#__PURE__*/function(){"use strict";function t(e,n,r){s(this,t);this.element=e,this.type=6,this._$AN=void 0,this._$AM=n,this.options=r}c(t,[{key:"_$AU",get:function t(){return this._$AM._$AU}},{key:"_$AI",value:function t(t){nK(this,t)}}]);return t}(),n6={M:nA,P:nC,A:nq,C:1,L:nJ,R:nZ,D:nO,V:nK,I:n0,H:n1,N:n3,U:n5,B:n2,F:n4},n9=nE.litHtmlPolyfillSupport;var n7;n9===null||n9===void 0?void 0:n9(nG,n0),((n7=nE.litHtmlVersions)!==null&&n7!==void 0?n7:nE.litHtmlVersions=[]).push("3.2.1");var n8=function(t,e,n){var r;var i=(r=n===null||n===void 0?void 0:n.renderBefore)!==null&&r!==void 0?r:e,o=i._$litPart$;if(o===void 0){var a;var s=(a=n===null||n===void 0?void 0:n.renderBefore)!==null&&a!==void 0?a:null;i._$litPart$=o=new n0(e.insertBefore(nP(),s),s,void 0,n!==null&&n!==void 0?n:{})}return o._$AI(t),o};var rt=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments),t.renderOptions={host:t},t._$Do=void 0;return t}c(e,[{key:"createRenderRoot",value:function t(){var t;var n=h(f(e.prototype),"createRenderRoot",this).call(this);var r;return(r=(t=this.renderOptions).renderBefore)!==null&&r!==void 0?r:t.renderBefore=n.firstChild,n}},{key:"update",value:function t(t){var n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),h(f(e.prototype),"update",this).call(this,t),this._$Do=n8(n,this.renderRoot,this.renderOptions)}},{key:"connectedCallback",value:function t(){var t;h(f(e.prototype),"connectedCallback",this).call(this),(t=this._$Do)===null||t===void 0?void 0:t.setConnected(!0)}},{key:"disconnectedCallback",value:function t(){var t;h(f(e.prototype),"disconnectedCallback",this).call(this),(t=this._$Do)===null||t===void 0?void 0:t.setConnected(!1)}},{key:"render",value:function t(){return nB}}]);return e}(n_);rt._$litElement$=!0,rt.finalized=!0,(eT=(eO=globalThis).litElementHydrateSupport)===null||eT===void 0?void 0:eT.call(eO,{LitElement:rt});var re=globalThis.litElementPolyfillSupport;re===null||re===void 0?void 0:re({LitElement:rt});var rn;((rn=globalThis.litElementVersions)!==null&&rn!==void 0?rn:globalThis.litElementVersions=[]).push("4.1.1");var rr=function(t){return function(e,n){n!==void 0?n.addInitializer(function(){customElements.define(t,e)}):customElements.define(t,e)}};var ri={attribute:!0,type:String,converter:nv,reflect:!1,hasChanged:np},ro=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ri,e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;var r=n.kind,i=n.metadata,o=globalThis.litPropertyMetadata.get(i);if(o===void 0&&globalThis.litPropertyMetadata.set(i,o=new Map),o.set(n.name,t),r==="accessor"){var a=n.name;return{set:function n(n){var r=e.get.call(this);e.set.call(this,n),this.requestUpdate(a,r,t)},init:function e(e){return e!==void 0&&this.P(a,void 0,t),e}}}if(r==="setter"){var s=n.name;return function n(n){var r=this[s];e.call(this,n),this.requestUpdate(s,r,t)}}throw Error("Unsupported decorator location: "+r)};var ra=function(t,e,n){return n.configurable=!0,n.enumerable=!0,Reflect.decorate&&(typeof e==="undefined"?"undefined":O(e))!="object"&&Object.defineProperty(t,e,n),n};var rs=Symbol("item");var rl=[{identifier:"completionStatus",cardinality:"single",baseType:"string",value:"unknown",type:"outcome"},{identifier:"numAttempts",cardinality:"single",baseType:"integer",value:"0",type:"response"}];var ru=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.identifier="";t.adaptive="false";t.timeDependent=null;t._handleDisabledChange=function(e,n){t._interactionElements.forEach(function(t){return t.disabled=n})};t._handleReadonlyChange=function(e,n){return t._interactionElements.forEach(function(t){return t.readonly=n})};t._context={identifier:t.getAttribute("identifier"),variables:rl};t._initialContext=x(k({},t._context),{variables:t._context.variables});t._feedbackElements=[];t._interactionElements=[];t._handleRegisterVariable=function(e){e.stopImmediatePropagation(),t._context=x(k({},t._context),{variables:T(t._context.variables).concat([e.detail.variable])}),t._initialContext=t._context,e.stopPropagation()};t._handleRegisterFeedback=function(e){var n;e.stopImmediatePropagation();var r=e.detail;t._feedbackElements.push(r),(Number((n=t._context.variables.find(function(t){return t.identifier==="numAttempts"}))===null||n===void 0?void 0:n.value)||0)>0&&r.checkShowFeedback(r.outcomeIdentifier)};t._handleRegisterInteraction=function(e){e.stopImmediatePropagation(),t._interactionElements.push(e.detail.interactionElement)};t._handleEndAttempt=function(e){e.stopImmediatePropagation();var n=e.detail,r=n.responseIdentifier,i=n.countAttempt;t.validate(),t.updateResponseVariable(r,"true"),t.processResponse(i)};t._handleSetOutcomeValue=function(e){e.stopImmediatePropagation();var n=e.detail,r=n.outcomeIdentifier,i=n.value;t.updateOutcomeVariable(r,i),e.stopPropagation()};t._handleUpdateResponseVariable=function(e){e.stopImmediatePropagation();var n=e.detail,r=n.responseIdentifier,i=n.response;t.updateResponseVariable(r,i),t._emit("qti-item-context-updated",{itemContext:t._context})};return t}c(e,[{key:"variables",get:function t(){return this._context.variables.map(function(t){return k({identifier:t.identifier,value:t.value,type:t.type},t.type==="outcome"&&t.identifier==="SCORE"?{externalScored:t.externalScored}:{})})},set:function t(t){var e=this;if(!Array.isArray(t)||t.some(function(t){return!("identifier"in t)})){console.warn("variables property should be an array of VariableDeclaration");return}this._context=x(k({},this._context),{variables:this._context.variables.map(function(e){var n=t.find(function(t){return t.identifier===e.identifier});return n?k({},e,n):e})}),this._context.variables.forEach(function(t){if(t.type==="response"){var n=e._interactionElements.find(function(e){return e.responseIdentifier===t.identifier});n&&(n.value=t.value)}})}},{key:"responses",set:function t(t){var e=true,n=false,r=undefined;if(t)try{var i,o=function(){var t=s.value;i.getResponse(t.responseIdentifier)&&i.updateResponseVariable(t.responseIdentifier,t.response);var e=i._interactionElements.find(function(e){return e.getAttribute("response-identifier")===t.responseIdentifier});e&&(e.value=t.response)};for(var a=t[Symbol.iterator](),s;!(e=(s=a.next()).done);e=true)i=this,o()}catch(t){n=true;r=t}finally{try{if(!e&&a.return!=null){a.return()}}finally{if(n){throw r}}}}},{key:"render",value:function t(){return nQ(D())}},{key:"connectedCallback",value:function t(){var t=this;this._attachEventListeners(),h(f(e.prototype),"connectedCallback",this).call(this),this.updateComplete.then(function(){t._emit("qti-assessment-item-connected",t)})}},{key:"disconnectedCallback",value:function t(){this._removeEventListeners(),h(f(e.prototype),"disconnectedCallback",this).call(this)}},{key:"_attachEventListeners",value:function t(){this.addEventListener("qti-register-variable",this._handleRegisterVariable),this.addEventListener("qti-register-feedback",this._handleRegisterFeedback),this.addEventListener("qti-register-interaction",this._handleRegisterInteraction),this.addEventListener("end-attempt",this._handleEndAttempt),this.addEventListener("qti-set-outcome-value",this._handleSetOutcomeValue),this.addEventListener("qti-interaction-response",this._handleUpdateResponseVariable)}},{key:"_removeEventListeners",value:function t(){this.removeEventListener("qti-register-variable",this._handleRegisterVariable),this.removeEventListener("qti-register-feedback",this._handleRegisterFeedback),this.removeEventListener("qti-register-interaction",this._handleRegisterInteraction),this.removeEventListener("end-attempt",this._handleEndAttempt),this.removeEventListener("qti-set-outcome-value",this._handleSetOutcomeValue),this.removeEventListener("qti-interaction-response",this._handleUpdateResponseVariable)}},{key:"showCorrectResponse",value:function t(t){var e=true,n=false,r=undefined;try{var i,o=function(){var e=s.value;var n=i._interactionElements.find(function(t){return t.getAttribute("response-identifier")===e.identifier});n&&n.toggleCorrectResponse(e,t)};for(var a=this._context.variables.filter(function(t){return t.type==="response"})[Symbol.iterator](),s;!(e=(s=a.next()).done);e=true)i=this,o()}catch(t){n=true;r=t}finally{try{if(!e&&a.return!=null){a.return()}}finally{if(n){throw r}}}}},{key:"processResponse",value:function t(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;var n;this.validate(e);var r=this.querySelector("qti-response-processing");return!r||!r.process?!1:(r.process(),this.adaptive==="false"&&this.updateOutcomeVariable("completionStatus",this._getCompletionStatus()),t&&this.updateOutcomeVariable("numAttempts",(+((n=this._context.variables.find(function(t){return t.identifier==="numAttempts"}))===null||n===void 0?void 0:n.value)+1).toString()),this._emit("qti-item-context-updated",{itemContext:this._context}),!0)}},{key:"resetResponses",value:function t(){this._context=this._initialContext}},{key:"getResponse",value:function t(t){return this.getVariable(t)}},{key:"getOutcome",value:function t(t){return this.getVariable(t)}},{key:"getVariable",value:function t(t){return this._context.variables.find(function(e){return e.identifier===t})||null}},{key:"updateResponseVariable",value:function t(t,e){this._context=x(k({},this._context),{variables:this._context.variables.map(function(n){return n.identifier!==t?n:x(k({},n),{value:e})})}),this._emit("qti-interaction-changed",{item:this.identifier,responseIdentifier:t,response:Array.isArray(e)?T(e):e}),this.adaptive==="false"&&this.updateOutcomeVariable("completionStatus",this._getCompletionStatus())}},{key:"updateOutcomeVariable",value:function t(t,e){var n;var r=this.getOutcome(t);if(!r){console.warn("Can not set qti-outcome-identifier: ".concat(t,", it is not available"));return}this._context=x(k({},this._context),{variables:this._context.variables.map(function(n){return n.identifier!==t?n:x(k({},n),{value:r.cardinality==="single"?e:T(n.value).concat([e])})})}),this._feedbackElements.forEach(function(e){return e.checkShowFeedback(t)}),this._emit("qti-outcome-changed",{item:this.identifier,outcomeIdentifier:t,value:(n=this._context.variables.find(function(e){return e.identifier===t}))===null||n===void 0?void 0:n.value})}},{key:"validate",value:function t(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this._interactionElements.every(function(t){return t.validate()})?!0:this._interactionElements.some(function(t){return t.validate()})?!1:(t&&this.reportValidity(),null)}},{key:"reportValidity",value:function t(){var t=true,e=false,n=undefined;try{for(var r=this._interactionElements[Symbol.iterator](),i;!(t=(i=r.next()).done);t=true){var o=i.value;o.reportValidity()}}catch(t){e=true;n=t}finally{try{if(!t&&r.return!=null){r.return()}}finally{if(e){throw n}}}}},{key:"_getCompletionStatus",value:function t(){var t=this.validate(!1);return t===!0?"completed":t===!1?"incomplete":"not_attempted"}},{key:"_emit",value:function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e}))}}]);return e}(rt);ej([r({type:String})],ru.prototype,"title",2),ej([r({type:String})],ru.prototype,"identifier",2),ej([r({type:String})],ru.prototype,"adaptive",2),ej([r({type:String})],ru.prototype,"timeDependent",2),ej([r({type:Boolean})],ru.prototype,"disabled",2),ej([d("disabled",{waitUntilFirstUpdate:!0})],ru.prototype,"_handleDisabledChange",2),ej([r({type:Boolean})],ru.prototype,"readonly",2),ej([d("readonly",{waitUntilFirstUpdate:!0})],ru.prototype,"_handleReadonlyChange",2),ej([t({context:rs})],ru.prototype,"_context",2),ru=ej([rr("qti-assessment-item")],ru);var rc=String.raw,rd=rc(V());var rh=null;var rf=function(){var t,e={load:function n(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return o(function(){return L(this,function(i){return[2,new Promise(function(i){b(n,r).then(function(r){return t=r,e.path(n.substring(0,n.lastIndexOf("/"))),i(e)})})]})})()},parse:function n(n){return t=_(n),e},path:function(n){return w(t,n),e},fn:function n(n){return n(t),e},pciHooks:function n(n){var r=["hook","module"],i=n.substring(0,n.lastIndexOf("/"));var o=true,a=false,s=undefined;try{var l=function(){var e=c.value;t.querySelectorAll("["+e+"]").forEach(function(t){var r=t.getAttribute(e);!r.startsWith("data:")&&!r.startsWith("http")&&(t.setAttribute("base-url",n),t.setAttribute("module",i+"/"+encodeURI(r+(r.endsWith(".js")?"":".js"))))})};for(var u=r[Symbol.iterator](),c;!(o=(c=u.next()).done);o=true)l()}catch(t){a=true;s=t}finally{try{if(!o&&u.return!=null){u.return()}}finally{if(a){throw s}}}return e},extendElementName:function(n,r){return y(t,n,r),e},extendElementsWithClass:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"extend";return m(t,n),e},customInteraction:function n(n,r){var i=t.querySelector("qti-custom-interaction"),o=i.querySelector("object");return i.setAttribute("data-base-ref",n),i.setAttribute("data-base-item",n+r),i.setAttribute("data",o.getAttribute("data")),i.setAttribute("width",o.getAttribute("width")),i.setAttribute("height",o.getAttribute("height")),i.removeChild(o),e},convertCDATAtoComment:function n(){return A(t),e},stripStyleSheets:function n(){return q(t),e},html:function e(){return new XMLSerializer().serializeToString(E(t))},xml:function e(){return new XMLSerializer().serializeToString(t)},htmlDoc:function e(){return E(t)},xmlDoc:function e(){return t}};return e};var rv=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.identifier="";t.href="";return t}c(e,[{key:"connectedCallback",value:function t(){var t=this;var n=this,r=function(){return h(f(e.prototype),"connectedCallback",t)};return o(function(){var t,e,i;return L(this,function(o){switch(o.label){case 0:r().call(n);t=new Event("qti-assessment-stimulus-ref-connected",{cancelable:!0,bubbles:!0,composed:!0});if(!n.dispatchEvent(t))return[3,4];e=n.closest("qti-assessment-item").querySelector("[data-stimulus-idref=".concat(n.identifier,"]"));if(!e)return[3,2];return[4,n.updateStimulusRef(e)];case 1:i=o.sent();return[3,3];case 2:i=console.warn("Stimulus with data-stimulus-idref ".concat(n.identifier," not found"));o.label=3;case 3:i;o.label=4;case 4:return[2]}})})()}},{key:"updateStimulusRef",value:function t(t){var e=this;return o(function(){var n,r,i;return L(this,function(o){switch(o.label){case 0:return[4,rf().load(e.href).then(function(t){return t.htmlDoc()})];case 1:n=o.sent();if(n){;i=n.querySelectorAll("qti-stimulus-body, qti-stylesheet");t.innerHTML="",(r=t).append.apply(r,T(i))}return[2]}})})()}}]);return e}(rt);ej([r({type:String})],rv.prototype,"identifier",2),ej([r({type:String})],rv.prototype,"href",2),rv=ej([rr("qti-assessment-stimulus-ref")],rv);var rp=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}return e}(rt);rp=ej([rr("qti-companion-materials-info")],rp);var ry=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nQ(j(),this.handleSlotChange)}},{key:"handleSlotChange",value:function t(){var t;var e;var n=Array.from((e=(t=this.firstElementChild)===null||t===void 0?void 0:t.childNodes)!==null&&e!==void 0?e:[]).find(function(t){return t.nodeType===Node.COMMENT_NODE});try{var r;this.operatorFunction=new Function("context","fn","item",(r=n===null||n===void 0?void 0:n.textContent)!==null&&r!==void 0?r:"")}catch(t){console.error("custom-operator contains invalid javascript code",t)}}},{key:"calculate",value:function t(){var t=this;var e={variable:function(e){var n,r;var i;return(i=(r=t._context)===null||r===void 0?void 0:(n=r.variables.find(function(t){return t.identifier===e}))===null||n===void 0?void 0:n.value)!==null&&i!==void 0?i:""},correct:function(e){var n,r;var i;return(i=(r=t._context)===null||r===void 0?void 0:(n=r.variables.find(function(t){return t.identifier===e}))===null||n===void 0?void 0:n.correctResponse)!==null&&i!==void 0?i:""}},n={getVariable:function(e){var n;return(n=t._context)===null||n===void 0?void 0:n.variables.find(function(t){return t.identifier===e})},updateOutcomeVariable:function(e,n){t.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:e,value:n}}))},updateResponseVariable:function(e,n){t.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:e,response:n}}))}};return this.operatorFunction(this._context,e,n)}}]);return e}(rt);ej([e({context:rs,subscribe:!0}),i()],ry.prototype,"_context",2),ry=ej([rr("qti-custom-operator")],ry);var rm=function(){return new Intl.NumberFormat().format(.1).replace(/\d/g,"")},rg=function(t){if(typeof t=="string")return t;var e=rm();return e==="."?t.toLocaleString():t.toString().replace(".","").replace(e,".")};var rb=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"connectedCallback",value:function t(){h(f(e.prototype),"connectedCallback",this).call(this),this.dispatchEvent(new CustomEvent("qti-register-feedback",{bubbles:!0,composed:!0,detail:this}))}},{key:"checkShowFeedback",value:function t(t){var e=this._context.variables.find(function(e){return e.identifier===t})||null;if(this.outcomeIdentifier!==t||!e)return;var n=!1;Array.isArray(e.value)?n=e.value.includes(this.identifier):n=!R(this.identifier)&&!R(e===null||e===void 0?void 0:e.value)&&this.identifier===e.value||!1,this.showFeedback(n)}},{key:"showFeedback",value:function t(t){this.showStatus=t&&this.showHide==="show"||!t&&this.showHide==="hide"?"on":"off"}}]);return e}(rt);ej([r({type:String,attribute:"show-hide"})],rb.prototype,"showHide",2),ej([r({type:String,attribute:"outcome-identifier"})],rb.prototype,"outcomeIdentifier",2),ej([r({type:String})],rb.prototype,"identifier",2),ej([r({type:String,attribute:!1})],rb.prototype,"showStatus",2),ej([e({context:rs,subscribe:!0}),i()],rb.prototype,"_context",2);var r_=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nQ(H(),this.showStatus)}},{key:"connectedCallback",value:function t(){h(f(e.prototype),"connectedCallback",this).call(this),this.checkShowFeedback(this.outcomeIdentifier)}}]);return e}(rb);r_.styles=e8(Q()),r_=ej([rr("qti-feedback-block")],r_);var rk=function(t){return t!==null&&t!==void 0?t:nW};var rE=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.render=function(){return nQ(F(),rk(t.showStatus))};return t}c(e,[{key:"connectedCallback",value:function t(){h(f(e.prototype),"connectedCallback",this).call(this),this.checkShowFeedback(this.outcomeIdentifier)}}]);return e}(rb);rE.styles=e8(z()),rE=ej([rr("qti-feedback-inline")],rE);var rx=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nQ(B(),this.showStatus==="on",this.closeFeedback)}},{key:"openFeedback",value:function t(){var t;var e=(t=this.shadowRoot)===null||t===void 0?void 0:t.querySelector("dialog");e&&!e.open&&e.showModal()}},{key:"closeFeedback",value:function t(){var t;var e=(t=this.shadowRoot)===null||t===void 0?void 0:t.querySelector("dialog");e&&e.open&&(e.close(),this.showStatus="off")}},{key:"connectedCallback",value:function t(){h(f(e.prototype),"connectedCallback",this).call(this),this.showStatus==="on"&&this.openFeedback()}},{key:"updated",value:function t(t){t.has("showStatus")&&(this.showStatus==="on"?this.openFeedback():this.closeFeedback())}}]);return e}(rb);rx.styles=e8(W()),rx=ej([rr("qti-modal-feedback")],rx);var rw=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"connectedCallback",value:function t(){h(f(e.prototype),"connectedCallback",this).call(this),this.dispatchEvent(new CustomEvent("qti-register-hotspot",{bubbles:!0,composed:!0,cancelable:!1}))}},{key:"render",value:function t(){return nQ(Y())}}]);return e}(rt);rw.styles=e8(X()),rw=ej([rr("qti-associable-hotspot")],rw);var rA=function(t,e,n){var r=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}return e}(t);return r};var rC=function(t,e,n,i){var l=/*#__PURE__*/function(t){"use strict";v(r,t);function r(){s(this,r);var t;t=a(this,r,arguments);t.observer=null;t.droppableObsever=null;t.resizeObserver=null;t.draggables=[];t.droppables=[];t.dragContainers=[];t.dragClone=null;t.dragSource=null;t.touchStartPoint=null;t.isDraggable=!1;t.cloneOffset={x:0,y:0};t.isDragging=!1;t.allDropzones=[];t.lastTarget=null;t.currentDropTarget=null;t.MIN_DRAG_DISTANCE=5;t.DRAG_CLONE_OPACITY=1;t.dataTransfer={data:{},setData:function t(t,e){this.data[t]=e},getData:function t(t){return this.data[t]},effectAllowed:"move"};t.configuration={copyStylesDragClone:!0,dragCanBePlacedBack:!0,dragOnClick:!1};t.minAssociations=1;t.maxAssociations=0;t.draggablesModified=function(e,n){var r=true,i=false,o=undefined;try{var a=function(){var e=l.value;t.draggables.includes(e)&&(t.draggables=t.draggables.filter(function(t){return t!==e}),e.removeAttribute("tabindex"),e.removeEventListener("touchstart",t.handleTouchStart.bind(t)),e.removeEventListener("mousedown",t.handleTouchStart.bind(t)))};for(var s=n[Symbol.iterator](),l;!(r=(l=s.next()).done);r=true)a()}catch(t){i=true;o=t}finally{try{if(!r&&s.return!=null){s.return()}}finally{if(i){throw o}}}var u=true,c=false,d=undefined;try{for(var h=e[Symbol.iterator](),f;!(u=(f=h.next()).done);u=true){var v=f.value;t.draggables.includes(v)||(t.draggables.push(v),v.setAttribute("tabindex","0"),v.hasTouchStartListener||(v.addEventListener("touchstart",t.handleTouchStart.bind(t),{passive:!1}),v.addEventListener("mousedown",t.handleTouchStart.bind(t),{passive:!1}),v.hasTouchStartListener=!0))}}catch(t){c=true;d=t}finally{try{if(!u&&h.return!=null){h.return()}}finally{if(c){throw d}}}var p=0;t.draggables.forEach(function(e){e.style.viewTransitionName="drag-".concat(p,"-").concat(t.getAttribute("identifier")||crypto.randomUUID()),e.setAttribute("qti-draggable","true"),p++})};t.droppablesModified=function(e,n){var r=true,i=false,o=undefined;try{var a=function(){var e=l.value;t.droppables.includes(e)&&(t.droppables=t.droppables.filter(function(t){return t!==e}),t.allDropzones=t.allDropzones.filter(function(t){return t!==e}))};for(var s=n[Symbol.iterator](),l;!(r=(l=s.next()).done);r=true)a()}catch(t){i=true;o=t}finally{try{if(!r&&s.return!=null){s.return()}}finally{if(i){throw o}}}var u=true,c=false,d=undefined;try{for(var h=e[Symbol.iterator](),f;!(u=(f=h.next()).done);u=true){var v=f.value;t.droppables.includes(v)||(t.droppables.push(v),t.allDropzones.push(v))}}catch(t){c=true;d=t}finally{try{if(!u&&h.return!=null){h.return()}}finally{if(c){throw d}}}var p=true,y=false,m=undefined;try{for(var g=t.droppables[Symbol.iterator](),b;!(p=(b=g.next()).done);p=true){var _=b.value;t.dataset.choicesContainerWidth&&(_.style.width="".concat(t.dataset.choicesContainerWidth,"px"),_.style.boxSizing="border-box")}}catch(t){y=true;m=t}finally{try{if(!p&&g.return!=null){g.return()}}finally{if(y){throw m}}}};return t}c(r,[{key:"handleDraggableContainerChange",value:function t(t,e){this.isMatchTabular()||(t.length>0||e.length>0)&&this.dragContainersModified(t||[],e||[])}},{key:"dragContainersModified",value:function t(t,e){var n=true,r=false,i=undefined;try{var o,a=function(){var t=l.value;o.dragContainers.includes(t)&&(o.dragContainers=o.dragContainers.filter(function(e){return e!==t}),o.allDropzones=o.allDropzones.filter(function(e){return e!==t}))};for(var s=e[Symbol.iterator](),l;!(n=(l=s.next()).done);n=true)o=this,a()}catch(t){r=true;i=t}finally{try{if(!n&&s.return!=null){s.return()}}finally{if(r){throw i}}}var u=true,c=false,d=undefined;try{for(var h=t[Symbol.iterator](),f;!(u=(f=h.next()).done);u=true){var v=f.value;this.dragContainers.includes(v)||(this.dragContainers.push(v),this.allDropzones.push(v))}}catch(t){c=true;d=t}finally{try{if(!u&&h.return!=null){h.return()}}finally{if(c){throw d}}}}},{key:"handleDraggablesChange",value:function t(t,e){this.isMatchTabular()||(t.length>0||e.length>0)&&this.draggablesModified(t||[],e||[])}},{key:"handleDroppablesChange",value:function t(t,e){this.isMatchTabular()||(t.length>0||e.length>0)&&this.droppablesModified(t||[],e||[])}},{key:"firstUpdated",value:function t(t){var o=this;var a,s,l;h(f(r.prototype),"firstUpdated",this).call(this,t),this.hasAttribute("disabled")||(document.addEventListener("touchmove",this.handleTouchMove.bind(this),{passive:!1}),document.addEventListener("mousemove",this.handleTouchMove.bind(this),{passive:!1}),document.addEventListener("touchend",this.handleTouchEnd.bind(this),{passive:!1}),document.addEventListener("mouseup",this.handleTouchEnd.bind(this),{passive:!1}),document.addEventListener("touchcancel",this.handleTouchCancel.bind(this),{passive:!1}));var u=Array.from(this.querySelectorAll(e)||[]).concat(Array.from(((a=this.shadowRoot)===null||a===void 0?void 0:a.querySelectorAll(e))||[])),c=Array.from(this.querySelectorAll(n)||[]).concat(Array.from(((s=this.shadowRoot)===null||s===void 0?void 0:s.querySelectorAll(n))||[])),d=Array.from(this.querySelectorAll(i)||[]).concat(Array.from(((l=this.shadowRoot)===null||l===void 0?void 0:l.querySelectorAll(i))||[]));this.dragContainersModified(d,[]),this.droppablesModified(c,[]),this.draggablesModified(u,[]),this.updateMinDimensionsForDropZones(),this.observer=new MutationObserver(function(){return o.updateMinDimensionsForDropZones()}),this.observer.observe(this,{childList:!0,subtree:!0}),this.resizeObserver=new ResizeObserver(function(){return o.updateMinDimensionsForDropZones()}),this.querySelectorAll("qti-gap-text").forEach(function(t){var e;return(e=o.resizeObserver)===null||e===void 0?void 0:e.observe(t)})}},{key:"moveDraggableToDroppable",value:function t(t,e){var n=this;return o(function(){return L(this,function(r){(function(){t.style.transform="translate(0, 0)",e.tagName==="SLOT"?t.setAttribute("slot",e.getAttribute("name")):e.appendChild(t),n.checkAllMaxAssociations(),n.saveResponse()})();return[2]})})()}},{key:"activateDroppable",value:function t(t){this.dragContainers.includes(t)?(this._internals.states.add("--dragzone-active"),t.setAttribute("active","")):(this._internals.states.delete("--dragzone-active"),t.setAttribute("active",""))}},{key:"deactivateDroppable",value:function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;e&&this._internals.states.add("--dragzone-active"),t.removeAttribute("active")}},{key:"connectedCallback",value:function t(){h(f(r.prototype),"connectedCallback",this).call(this)}},{key:"isMatchTabular",value:function t(){return this.classList.contains("qti-match-tabular")}},{key:"updateMinDimensionsForDropZones",value:function t(){var t;var r=this.querySelectorAll(e),o=Array.from(this.querySelectorAll(n)).map(function(t){return t}),a=0,s=0;r.forEach(function(t){var e=t.getBoundingClientRect();a=Math.max(a,e.height),s=Math.max(s,e.width)});var l=this.querySelector(i)||((t=this.shadowRoot)===null||t===void 0?void 0:t.querySelector(i));l&&(l.style.minHeight="".concat(a,"px"),l.style.minWidth="".concat(s,"px"));var u=true,c=false,d=undefined;try{for(var h=o[Symbol.iterator](),f;!(u=(f=h.next()).done);u=true){var v=f.value;v.style.minHeight="".concat(a,"px"),v.style.minWidth="".concat(s,"px")}}catch(t){c=true;d=t}finally{try{if(!u&&h.return!=null){h.return()}}finally{if(c){throw d}}}}},{key:"activateDroppables",value:function t(t){this.dragContainers.forEach(function(e){e.setAttribute("enabled",""),e.hasAttribute("disabled")&&(e.contains(t)||e.shadowRoot&&e.shadowRoot.contains(t))&&e.removeAttribute("disabled")}),this.droppables.forEach(function(e){e.setAttribute("enabled",""),e.hasAttribute("disabled")&&(e.contains(t)||e.shadowRoot&&e.shadowRoot.contains(t))&&e.removeAttribute("disabled")})}},{key:"activateDragLocation",value:function t(){this._internals.states.add("--dragzone-enabled")}},{key:"deactivateDragLocation",value:function t(){this._internals.states.delete("--dragzone-enabled")}},{key:"deactivateDroppables",value:function t(){this.dragContainers.forEach(function(t){t.removeAttribute("enabled"),t.removeAttribute("active")}),this.droppables.forEach(function(t){t.removeAttribute("enabled"),t.removeAttribute("active")})}},{key:"disconnectedCallback",value:function t(){h(f(r.prototype),"disconnectedCallback",this).call(this),this.observer&&(this.observer.disconnect(),this.observer=null),this.droppableObsever&&(this.droppableObsever.disconnect(),this.droppableObsever=null),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),document.removeEventListener("touchmove",this.handleTouchMove),document.removeEventListener("mousemove",this.handleTouchMove),document.removeEventListener("touchend",this.handleTouchEnd),document.removeEventListener("mouseup",this.handleTouchEnd),document.removeEventListener("touchcancel",this.handleTouchCancel)}},{key:"handleTouchMove",value:function t(t){if(this.isDraggable&&this.dragClone){var e=this.getEventCoordinates(t),n=e.x,r=e.y,i={clientX:n,clientY:r};this.calculateDragDistance(i)>=this.MIN_DRAG_DISTANCE&&(this.isDragging=!0,this.updateDragClonePosition(i));var o=this.findClosestDropzone();this.currentDropTarget=o,o!==this.lastTarget&&(this.lastTarget&&(this.deactivateDroppable(this.lastTarget),this.dispatchCustomEvent(this.lastTarget,"dragleave")),o&&(this.activateDroppable(o),this.dispatchCustomEvent(o,"dragenter")),this.lastTarget=o),this.currentDropTarget&&this.dispatchCustomEvent(this.currentDropTarget,"dragover"),t.preventDefault()}}},{key:"handleTouchEnd",value:function t(t){this.isDragging&&this.resetDragState(),this._internals.states.delete("--dragzone-active"),this.checkAllMaxAssociations(),this._internals.states.delete("--dragzone-enabled"),this._internals.states.delete("--dragzone-active"),this.deactivateDragLocation(),this.deactivateDroppables(),this.draggables.forEach(function(t){t.removeAttribute("dragging")}),t.preventDefault()}},{key:"handleTouchCancel",value:function t(t){this.resetDragState()}},{key:"validate",value:function t(){if(!this.shadowRoot)return!1;var t=this.getValidAssociations(),e=!0,n="";this.maxAssociations>0&&t>this.maxAssociations?(e=!1,n=this.dataset.maxSelectionsMessage||"You've selected too many associations. Maximum allowed is ".concat(this.maxAssociations,".")):this.minAssociations>0&&t<this.minAssociations&&(e=!1,n=this.dataset.minSelectionsMessage||"You haven't selected enough associations. Minimum required is ".concat(this.minAssociations,"."));var r=this.lastElementChild;return this._internals.setValidity(e?{}:{customError:!0},n,r),e}},{key:"reportValidity",value:function t(){var t=this.shadowRoot.querySelector("#validationMessage");return t&&(this._internals.validity.valid?(t.textContent="",t.style.display="none"):(t.textContent=this._internals.validationMessage,t.style.display="block")),this._internals.validity.valid}},{key:"checkMaxAssociations",value:function t(t){var e=this.getMatchMaxValue(t),n=t.querySelectorAll('[qti-draggable="true"]').length;return!(e===0)&&n>=e}},{key:"dropDraggableInDroppable",value:function t(t,e){var n=t.cloneNode(!0);n.removeAttribute("style"),this.moveDraggableToDroppable(n,e),this.draggablesModified([n],[]);var r=this.getMatchMaxValue(t),i=this.draggables.filter(function(e){return e.getAttribute("identifier")===t.getAttribute("identifier")});r!==0&&i.length>=r?(t.style.opacity="0.0",t.style.pointerEvents="none"):t.style.opacity="1.0"}},{key:"resetDragState",value:function t(){if(this.dragClone){var t=this.currentDropTarget!==null,e=!t||this.dragContainers.includes(this.currentDropTarget);t&&this.currentDropTarget&&!e&&this.dropDraggableInDroppable(this.dragSource,this.currentDropTarget),e&&(this.dragSource.style.opacity="1.0",this.dragSource.style.display="block",this.dragSource.style.position="static",this.dragSource.style.pointerEvents="auto",this.saveResponse()),this.dragClone.remove(),this.draggablesModified([],[this.dragClone])}this.isDragging=!1,this.isDraggable=!1,this.dragSource=null,this.dragClone=null,this.touchStartPoint=null,this.currentDropTarget=null,this.lastTarget=null,this.deactivateDroppables()}},{key:"checkAllMaxAssociations",value:function t(){var t=this;var e=this.getValidAssociations(),n=this.maxAssociations!==0&&e>=this.maxAssociations;this.droppables.forEach(function(e){n?t.disableDroppable(e):t.checkMaxAssociations(e)?t.disableDroppable(e):t.enableDroppable(e)})}},{key:"getMatchMaxValue",value:function t(t){var e=t.getAttribute("match-max");return e?parseInt(e,10):1}},{key:"disableDroppable",value:function t(t){t.setAttribute("disabled","")}},{key:"enableDroppable",value:function t(t){t.removeAttribute("disabled")}},{key:"value",get:function t(){return this.collectResponseData()},set:function t(t){var e=this;if(!this.isMatchTabular())if(Array.isArray(t)){this.reset(),t===null||t===void 0?void 0:t.forEach(function(t){return e.placeResponse(t)});var n=new FormData;t.forEach(function(t){n.append(e.responseIdentifier,t)}),this._internals.setFormValue(n)}else this._internals.setFormValue(t||"")}},{key:"placeResponse",value:function t(t){var e=this;var n=M(t.split(" ").reverse()),r=n[0],i=n.slice(1),o=Array.from(this.draggables),a=Array.from(this.droppables);i.forEach(function(t){var n=o.find(function(e){return e.getAttribute("identifier")===t}),i=a.find(function(t){return t.getAttribute("identifier")===r});e.dropDraggableInDroppable(n,i)})}},{key:"getValidAssociations",value:function t(){var t=0;var e=true,n=false,r=undefined;try{for(var i=this.droppables[Symbol.iterator](),o;!(e=(o=i.next()).done);e=true){var a=o.value;t=t+this.getDraggablesFromDroppable(a).length}}catch(t){n=true;r=t}finally{try{if(!e&&i.return!=null){i.return()}}finally{if(n){throw r}}}return t}},{key:"saveResponse",value:function t(){var t;typeof this.getResponse=="function"?t=this.getResponse():t=this.collectResponseData(),this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:this.responseIdentifier,response:t}}))}},{key:"collectResponseData",value:function t(){var t=this;return this.droppables.map(function(e){var n=t.getDraggablesFromDroppable(e).map(function(t){return t.getAttribute("identifier")}),r=e.getAttribute("identifier");return n.map(function(t){return"".concat(t," ").concat(r)})}).flat()}},{key:"getDraggablesFromDroppable",value:function t(t){return this.draggables.map(function(t){return t.getAttribute("identifier")}).filter(function(t,e,n){return n.indexOf(t)===e}).flatMap(function(e){return Array.from(t.querySelectorAll("[identifier='".concat(e,"']")))}).filter(function(t){return!!t}).map(function(t){return t})}},{key:"reset",value:function t(){var t=this;var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.droppables.forEach(function(e){t.getDraggablesFromDroppable(e).forEach(function(e){e.remove(),t.draggablesModified([],[e])})}),this.dragContainers.forEach(function(t){Array.from(t.querySelectorAll('[qti-draggable="true"]')).forEach(function(t){t.style.opacity="1.0"})}),this.dragClone=null,this.dragSource=null,this.isDragging=!1,this.isDraggable=!1,this.currentDropTarget=null,this.lastTarget=null,e&&this.saveResponse()}},{key:"updateDragClonePosition",value:function t(t){if(!this.isDragging||!this.dragClone)return;var e=t.clientX-this.cloneOffset.x,n=t.clientY-this.cloneOffset.y,r=this.applyInteractionBoundaries(e,n,this.dragClone),i=r.newLeft,o=r.newTop;this.dragClone.style.left="".concat(i,"px"),this.dragClone.style.top="".concat(o,"px")}},{key:"applyInteractionBoundaries",value:function t(t,e,n){var r=this.getBoundingClientRect(),i=n.getBoundingClientRect(),o=i.width,a=i.height,s=Math.max(r.left,Math.min(t,r.right-o)),l=Math.max(r.top,Math.min(e,r.bottom-a));return{newLeft:s,newTop:l}}},{key:"getEventCoordinates",value:function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;var n=t.touches?t.touches[0]:t;return{x:e?n.pageX:n.clientX,y:e?n.pageY:n.clientY}}},{key:"calculateDragDistance",value:function t(t){var e=Math.abs(t.clientX-this.touchStartPoint.x),n=Math.abs(t.clientY-this.touchStartPoint.y);return e+n}},{key:"findClosestDropzone",value:function t(){var t=this.allDropzones.filter(function(t){return!t.hasAttribute("disabled")});if(!this.dragClone||t.length===0)return null;var e=this.dragClone.getBoundingClientRect(),n=null,r=0;var i=true,o=false,a=undefined;try{for(var s=t[Symbol.iterator](),l;!(i=(l=s.next()).done);i=true){var u=l.value;var c=u.getBoundingClientRect(),d=this.calculateOverlapArea(e,c);d>r&&(r=d,n=u)}}catch(t){o=true;a=t}finally{try{if(!i&&s.return!=null){s.return()}}finally{if(o){throw a}}}if(!n){var h=200;var f=true,v=false,p=undefined;try{for(var y=t[Symbol.iterator](),m;!(f=(m=y.next()).done);f=true){var g=m.value;var b=g.getBoundingClientRect(),_=Math.sqrt(Math.pow(e.left-b.left,2)+Math.pow(e.top-b.top,2));_<h&&(h=_,n=g)}}catch(t){v=true;p=t}finally{try{if(!f&&y.return!=null){y.return()}}finally{if(v){throw p}}}}return n}},{key:"calculateOverlapArea",value:function t(t,e){var n=Math.max(0,Math.min(t.right,e.right)-Math.max(t.left,e.left)),r=Math.max(0,Math.min(t.bottom,e.bottom)-Math.max(t.top,e.top));return n*r}},{key:"dispatchCustomEvent",value:function t(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t)return;var r=new CustomEvent(e,{bubbles:n,cancelable:!0});r.dataTransfer=this.dataTransfer,t.dispatchEvent(r)}},{key:"appendClone",value:function t(){document.body.appendChild(this.dragClone)}},{key:"handleTouchStart",value:function t(t){var e=this;if(this.isDragging)return;var n=this.getEventCoordinates(t),r=n.x,i=n.y;this.touchStartPoint={x:r,y:i},this.dragSource=t.currentTarget,this.isDraggable=!0,this._internals.states.add("--dragzone-enabled"),this._internals.states.add("--dragzone-active"),this.activateDragLocation(),this.activateDroppables(this.dragSource);var o=this.findDraggableInDraggableContainer(this.dragSource.getAttribute("identifier")),a=this.droppables.some(function(t){return Array.from(t.children).some(function(t){return t===e.dragSource})}),s=this.dragSource.getBoundingClientRect();a&&(this.dragSource.remove(),this.draggablesModified([],[this.dragSource]),this.dragSource=o),this.cloneOffset.x=r-s.left,this.cloneOffset.y=i-s.top,this.dragClone=o.cloneNode(!0);var l=window.getComputedStyle(o);for(var u=0;u<l.length;u++){var c=l[u];this.dragClone.style.setProperty(c,l.getPropertyValue(c))}var d=o.getBoundingClientRect();this.dragClone.style.width="".concat(d.width,"px"),this.dragClone.style.height="".concat(d.height,"px"),s&&this.setDragCloneStyles(s),this.dragClone.style.display="block",this.dragClone.style.opacity="1",this.appendClone();var h=this.getMatchMaxValue(this.dragSource),f=this.draggables.filter(function(t){return t.getAttribute("identifier")===e.dragSource.getAttribute("identifier")});h!==0&&f.length>=h?(o.style.opacity="0.0",o.style.pointerEvents="none"):o.style.opacity="1.0",t.preventDefault(),this.dragClone.setAttribute("dragging","")}},{key:"findDraggableInDraggableContainer",value:function t(t){var n=this.dragContainers.flat();var r=true,i=false,o=undefined;try{for(var a=n[Symbol.iterator](),s;!(r=(s=a.next()).done);r=true){var l=s.value;if(l.getAttribute("identifier")===t)return l;var u=void 0;p(l,HTMLSlotElement)?u=Array.from((l===null||l===void 0?void 0:l.assignedElements())||[]):u=Array.from(l.querySelectorAll(e));var c=u.find(function(e){return e.getAttribute("identifier")===t});if(c)return c}}catch(t){i=true;o=t}finally{try{if(!r&&a.return!=null){a.return()}}finally{if(i){throw o}}}}},{key:"setDragCloneStyles",value:function t(t){this.dragClone.style.position="fixed",this.dragClone.style.top="".concat(t.top,"px"),this.dragClone.style.left="".concat(t.left,"px"),this.dragClone.style.setProperty("box-sizing","border-box","important"),this.dragClone.style.zIndex="9999",this.dragClone.style.pointerEvents="none",this.dragClone.style.opacity=this.DRAG_CLONE_OPACITY.toString(),this.dragClone.style.display="block"}}]);return r}(rA(t,n,e));return ej([r({attribute:!1,type:Object})],l.prototype,"configuration",2),ej([r({type:Number,reflect:!0,attribute:"min-associations"})],l.prototype,"minAssociations",2),ej([r({type:Number,reflect:!0,attribute:"max-associations"})],l.prototype,"maxAssociations",2),ej([$(i)],l.prototype,"handleDraggableContainerChange",1),ej([$(e)],l.prototype,"handleDraggablesChange",1),ej([$(n)],l.prototype,"handleDroppablesChange",1),l};var rq=e8(J());var rS=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e);t.disabled=!1;t.readonly=!1;t._internals=t.attachInternals();return t}c(e,[{key:"correctResponse",get:function t(){return this._correctResponse},set:function t(t){this._correctResponse=t}},{key:"reportValidity",value:function t(){return this._internals.reportValidity()}},{key:"reset",value:function t(){this.value=""}},{key:"toggleCorrectResponse",value:function t(t,e){this.correctResponse=e?t===null||t===void 0?void 0:t.correctResponse:t.cardinality==="single"?"":[]}},{key:"connectedCallback",value:function t(){h(f(e.prototype),"connectedCallback",this).call(this),this.dispatchEvent(new CustomEvent("qti-register-interaction",{bubbles:!0,composed:!0,cancelable:!1,detail:{interactionElement:this,responseIdentifier:this.responseIdentifier}}))}},{key:"saveResponse",value:function t(t){this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,cancelable:!1,detail:{responseIdentifier:this.responseIdentifier,response:Array.isArray(t)?T(t):t}}))}}]);return e}(rt);rS.formAssociated=!0,ej([r({type:String,attribute:"response-identifier"})],rS.prototype,"responseIdentifier",2),ej([r({reflect:!0,type:Boolean})],rS.prototype,"disabled",2),ej([r({reflect:!0,type:Boolean})],rS.prototype,"readonly",2),ej([i()],rS.prototype,"_correctResponse",2);var rR=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e);t._childrenMap=[];t._registerChoiceHandler=t._registerChoice.bind(t),t.addEventListener("register-qti-simple-associable-choice",t._registerChoiceHandler);return t}c(e,[{key:"_registerChoice",value:function t(t){var e=t.target;this._childrenMap.push(e)}},{key:"render",value:function t(){return nQ(K(),this._childrenMap.length>0&&Array.from(Array(Math.ceil(this._childrenMap.length/2)).keys()).map(function(t,e){return nQ(G(),e,e,e,e)}))}},{key:"disconnectedCallback",value:function t(){h(f(e.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("register-qti-simple-associable-choice",this._registerChoiceHandler)}}]);return e}(rC(rS,"qti-simple-associable-choice",".dl","slot[name='qti-simple-associable-choice']"));rR.styles=rq,ej([i()],rR.prototype,"_childrenMap",2),rR=ej([rr("qti-associate-interaction")],rR);var rP=function(t,e){var n=/*#__PURE__*/function(t){"use strict";v(n,t);function n(){s(this,n);var t;t=a(this,n,arguments);t._choiceElements=[];t.minChoices=0;t.maxChoices=1;t._handleDisabledChange=function(e,n){t._choiceElements.forEach(function(t){return t.disabled=n})};t._handleReadonlyChange=function(e,n){t._choiceElements.forEach(function(t){return t.readonly=n})};t._value="";return t}c(n,[{key:"_handleMaxChoicesChange",value:function t(t,e){this._determineInputType()}},{key:"value",get:function t(){return Array.isArray(this._value)&&this._value.length===0||this._value===""?null:Array.isArray(this._value)?this._value.join(","):this._value},set:function t(t){var e=this;if(this.maxChoices>1&&(typeof t=="string"||t===null)?this._value=t?t.toString().split(","):[]:this._value=t||"",Array.isArray(this._value)){var n=new FormData;this._value.forEach(function(t){n.append(e.responseIdentifier,t)}),this._internals.setFormValue(n)}else this._internals.setFormValue(this._value);this._updateChoiceSelection()}},{key:"toggleCorrectResponse",value:function t(t,e){if(t.correctResponse){var n=Array.isArray(t.correctResponse)?t.correctResponse:[t.correctResponse];this._choiceElements.forEach(function(t){t.internals.states.delete("correct-response"),t.internals.states.delete("incorrect-response"),e&&n.length>0&&(n.includes(t.identifier)?t.internals.states.add("correct-response"):t.internals.states.add("incorrect-response"))})}}},{key:"connectedCallback",value:function t(){h(f(n.prototype),"connectedCallback",this).call(this),this.addEventListener("register-".concat(e),this._registerChoiceElement),this.addEventListener("unregister-".concat(e),this._unregisterChoiceElement),this.addEventListener("activate-".concat(e),this._choiceElementSelectedHandler)}},{key:"disconnectedCallback",value:function t(){h(f(n.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("register-".concat(e),this._registerChoiceElement),this.removeEventListener("unregister-".concat(e),this._unregisterChoiceElement),this.removeEventListener("activate-".concat(e),this._choiceElementSelectedHandler)}},{key:"validate",value:function t(){var t=this;var e=this._choiceElements.filter(function(e){return t._getChoiceChecked(e)}),n=e.length,r=!0,i="";return this.maxChoices!==0&&n>this.maxChoices?(r=!1,i=this.dataset.maxSelectionsMessage||"Please select no more than ".concat(this.maxChoices," ").concat(this.maxChoices===1?"option":"options",".")):n<this.minChoices&&(r=!1,i=this.dataset.minSelectionsMessage||"Please select at least ".concat(this.minChoices," ").concat(this.minChoices===1?"option":"options",".")),e.length>0&&this._internals.setValidity(r?{}:{customError:!0},i,e[n-1]||this._choiceElements[0]||this),r}},{key:"reportValidity",value:function t(){return this._validationMessageElement&&(this._internals.validity.valid?(this._validationMessageElement.textContent="",this._validationMessageElement.style.display="none"):(this._validationMessageElement.textContent=this._internals.validationMessage,this._validationMessageElement.style.display="block")),this._internals.validity.valid}},{key:"_registerChoiceElement",value:function t(t){t.stopPropagation();var e=t.target;e.disabled=this.disabled,this._choiceElements.push(e),this._setInputType(e)}},{key:"_unregisterChoiceElement",value:function t(t){t.stopPropagation();var e=t.target;this._choiceElements=this._choiceElements.filter(function(t){return t!==e})}},{key:"_determineInputType",value:function t(){var t=this;this._choiceElements.forEach(function(e){t._setInputType(e)})}},{key:"_setInputType",value:function t(t){this._internals.ariaLabel=this.maxChoices===1?"radio-group":"checkbox-group";var e=this.maxChoices===1?"radio":"checkbox";t.internals.role=e,t.internals.states.delete(e==="radio"?"checkbox":"radio"),t.internals.states.add(e)}},{key:"_choiceElementSelectedHandler",value:function t(t){var e=this;this._toggleChoiceChecked(t.target),this.maxChoices===1&&this._choiceElements.forEach(function(n){n.identifier!==t.detail.identifier&&e._setChoiceChecked(n,!1)}),this._handleChoiceSelection()}},{key:"_setChoiceChecked",value:function t(t,e){var n;((n=t.internals)===null||n===void 0?void 0:n.states)&&(e?(t.internals.states.add("--checked"),t.internals.ariaChecked="true"):(t.internals.states.delete("--checked"),t.internals.ariaChecked="false"))}},{key:"_getChoiceChecked",value:function t(t){return t.internals.states.has("--checked")}},{key:"_toggleChoiceChecked",value:function t(t){var e=this._getChoiceChecked(t);this._setChoiceChecked(t,!e)}},{key:"_handleChoiceSelection",value:function t(){var t=this;var e=this._choiceElements.filter(function(e){return t._getChoiceChecked(e)}).map(function(t){return t.identifier});this.value=this.maxChoices===1?e[0]||"":e,this.validate(),this.saveResponse(this._value)}},{key:"_updateChoiceSelection",value:function t(){var t=this;var e=Array.isArray(this._value)?this._value:[this._value];this._choiceElements.forEach(function(n){var r=e.includes(n.identifier);t._setChoiceChecked(n,r)})}}]);return n}(t);return ej([l("#validationMessage")],n.prototype,"_validationMessageElement",2),ej([r({type:Number,attribute:"min-choices"})],n.prototype,"minChoices",2),ej([r({type:Number,attribute:"max-choices"})],n.prototype,"maxChoices",2),ej([d("maxChoices",{waitUntilFirstUpdate:!0})],n.prototype,"_handleMaxChoicesChange",1),ej([d("disabled",{waitUntilFirstUpdate:!0})],n.prototype,"_handleDisabledChange",2),ej([d("readonly",{waitUntilFirstUpdate:!0})],n.prototype,"_handleReadonlyChange",2),n};var rM=function(t,e){var n=/*#__PURE__*/function(t){"use strict";v(n,t);function n(){s(this,n);var t;t=a(this,n,arguments);t.shuffle="false";return t}c(n,[{key:"connectedCallback",value:function t(){h(f(n.prototype),"connectedCallback",this).call(this),this._applyShuffle()}},{key:"updated",value:function t(t){t.has("shuffle")&&this._applyShuffle()}},{key:"_applyShuffle",value:function t(){this.shuffle==="true"?this._shuffleChoices():this._resetShuffleChoices()}},{key:"_shuffleChoices",value:function t(){var t=Array.from(this.querySelectorAll(e)),n=t.filter(function(t){return t.hasAttribute("fixed")}),r=t.filter(function(t){return!t.hasAttribute("fixed")});if(r.length<=1){console.warn("Shuffling is not possible with fewer than 2 non-fixed elements.");return}var i=T(r),o=!1,a=0;for(;!o&&a<10;){a++;for(var s=r.length-1;s>0;s--){var l=Math.floor(Math.random()*(s+1));var u;u=[r[l],r[s]],r[s]=u[0],r[l]=u[1],u}o=!r.every(function(t,e){return t===i[e]})}o||console.warn("Failed to shuffle the choices after multiple attempts.");var c=1;T(n).concat(T(r)).forEach(function(t){t.style.setProperty("order",String(c++))})}},{key:"_resetShuffleChoices",value:function t(){this.querySelectorAll(e).forEach(function(t){t.style.setProperty("order","initial")})}}]);return n}(t);return ej([r({type:String,reflect:!0})],n.prototype,"shuffle",2),n};var rT=function(t,e){var n=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t._classes=[];t._allLabels=["qti-labels-decimal","qti-labels-lower-alpha","qti-labels-upper-alpha"];t._allLabelSuffixes=["qti-labels-suffix-period","qti-labels-suffix-parenthesis"];return t}c(e,[{key:"class",get:function t(){var t;return((t=this._classes)===null||t===void 0?void 0:t.join(" "))||""},set:function t(t){t&&(this._classes=t.split(" "),this._addLabels())}},{key:"updated",value:function t(t){h(f(e.prototype),"updated",this).call(this,t),t.has("shuffle")&&this._addLabels()}},{key:"_addLabels",value:function t(){var t=this;var e=this._classes.some(function(e){return t._allLabels.includes(e)||t._allLabelSuffixes.includes(e)}),n=function(t){return!isNaN(+t)};if(e){var r=Array.from(this.querySelectorAll("qti-simple-choice")).map(function(t){return t}).map(function(t,e){return{el:t,order:n(t.style.order)?+t.style.order:e+1}}).sort(function(t,e){return t.order-e.order}).map(function(t){return t.el});for(var i=0;i<r.length;i++)r[i].marker=this._getLabel(i+1)}}},{key:"_getLabel",value:function t(t){var e=this;var n=this._classes.filter(function(t){return e._allLabels.includes(t)}).pop(),r=this._classes.filter(function(t){return e._allLabelSuffixes.includes(t)}).pop();!n&&r&&(n="qti-labels-upper-alpha");var i="";switch(n){case"qti-labels-decimal":i="".concat(t);break;case"qti-labels-lower-alpha":i="".concat(String.fromCharCode(97+t-1));break;case"qti-labels-upper-alpha":i="".concat(String.fromCharCode(65+t-1));break}return r==="qti-labels-suffix-period"?i+=".":r==="qti-labels-suffix-parenthesis"&&(i+=")"),i}}]);return e}(t);return ej([r({type:String,reflect:!0})],n.prototype,"class",1),n};var rO=e8(Z());var r$=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e),t._internals.role="group";return t}c(e,[{key:"handleSlotChange",value:function t(){var t=this.querySelectorAll("qti-simple-choice");this.style.setProperty("--item-count",t.length.toString())}},{key:"render",value:function t(){return nQ(tt(),this.handleSlotChange)}}]);return e}(rT(rM(rP(rS,"qti-simple-choice"),"qti-simple-choice"),"qti-simple-choice"));r$.styles=rO,ej([r({type:String})],r$.prototype,"orientation",2),r$=ej([rr("qti-choice-interaction")],r$);var rI=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e);t._errorMessage=null;t.handlePostMessage=t.handlePostMessage.bind(t);return t}c(e,[{key:"connectedCallback",value:function t(){var t=this;h(f(e.prototype),"connectedCallback",this).call(this);var n=this.data.startsWith("http")?this.data:P(this.baseItemUrl+"/"+this.data);fetch(n).then(function(t){return t.json()}).then(function(e){t.manifest=e,t.setupCES()}).catch(function(e){t._errorMessage=e})}},{key:"setupCES",value:function t(){var t=this.shadowRoot.querySelector("#pciContainer"),e=t.contentDocument;window.addEventListener("message",this.handlePostMessage),e.open(),e.write("\n <html>\n <head>\n <link href='".concat(P("".concat(this.baseRefUrl,"/").concat(this.manifest.style[0])),"' rel=\"stylesheet\" />\n <script src='").concat(P("".concat(this.baseRefUrl,"/").concat(this.manifest.script[0])),"'><\/script>\n </head>\n <body></body>\n </html>\n ")),e.close()}},{key:"getIFrames",value:function t(){var t=this.shadowRoot.querySelectorAll("iframe"),e=this.querySelectorAll("iframe"),n=T(t).concat(T(e));var r=true,i=false,o=undefined;try{for(var a=n[Symbol.iterator](),s;!(r=(s=a.next()).done);r=true){var l=s.value;var u=l.src;if(new URL(u,window.location.href).origin===window.location.origin)try{var c=l.contentDocument||l.contentWindow.document;c&&this.getInnerIFrames(c,n)}catch(t){console.error("Error accessing nested iframe:",t)}}}catch(t){i=true;o=t}finally{try{if(!r&&a.return!=null){a.return()}}finally{if(i){throw o}}}return n.forEach(function(t,e){n.indexOf(t)!==e&&n.splice(e,1)}),n}},{key:"getInnerIFrames",value:function t(t){var e=this;var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return t.querySelectorAll("iframe").forEach(function(t){n.push(t);var r=t.src;if(new URL(r,window.location.href).origin===window.location.origin)try{var i=t.contentDocument||t.contentWindow.document;e.getInnerIFrames(i,n)}catch(t){console.error("Error accessing nested iframe:",t)}else console.warn("Skipped cross-origin iframe:",r)}),n}},{key:"postToWindowAndIframes",value:function t(t,e){window.postMessage({type:t,data:e},"*");var n=this.getIFrames();var r=true,i=false,o=undefined;try{for(var a=n[Symbol.iterator](),s;!(r=(s=a.next()).done);r=true){var l=s.value;l.contentWindow&&l.contentWindow.postMessage({type:t,data:e},"*")}}catch(t){i=true;o=t}finally{try{if(!r&&a.return!=null){a.return()}}finally{if(i){throw o}}}}},{key:"handlePostMessage",value:function t(t){var e=this;var n=t.data,r=n.type,i=n.data;switch(r){case"setResponse":this.rawResponse=i,this.saveResponse(i);break;case"getResponse":{this.postToWindowAndIframes("responseData",this.rawResponse);break}case"getMedia":{var o=this.manifest.media.map(function(t){return t.startsWith("http")?t:P(e.baseRefUrl+"/"+t)});this.postToWindowAndIframes("mediaData",o);break}case"setStageHeight":console.log("setStageHeight not implemented");break}}},{key:"validate",value:function t(){return this.rawResponse!==""}},{key:"value",get:function t(){return this.rawResponse},set:function t(t){if(typeof t=="string")this.rawResponse=t,this.saveResponse(t);else throw new Error("Value must be a string")}},{key:"disconnectedCallback",value:function t(){window.removeEventListener("message",this.handlePostMessage),h(f(e.prototype),"disconnectedCallback",this).call(this)}},{key:"render",value:function t(){return nQ(tn(),this.getAttribute("width"),this.getAttribute("height"),this._errorMessage&&nQ(te(),this._errorMessage))}}]);return e}(rS);ej([r({type:String,attribute:"data"})],rI.prototype,"data",2),ej([r({type:String,attribute:"data-base-item"})],rI.prototype,"baseItemUrl",2),ej([r({type:String,attribute:"data-base-ref"})],rI.prototype,"baseRefUrl",2),ej([r({type:String,attribute:"id"})],rI.prototype,"id",2),ej([i()],rI.prototype,"_errorMessage",2),rI=ej([rr("qti-custom-interaction")],rI);var rU=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.disabled=!1;t.countAttempt=null;t.title="end attempt";return t}c(e,[{key:"render",value:function t(){return nQ(tr(),this.disabled,this.endAttempt,this.title)}},{key:"endAttempt",value:function t(t){this.dispatchEvent(new CustomEvent("end-attempt",{bubbles:!0,composed:!0,detail:{responseIdentifier:this.responseIdentifier,countAttempt:this.countAttempt==="true"}}))}}]);return e}(rt);ej([r({type:String,attribute:"response-identifier"})],rU.prototype,"responseIdentifier",2),ej([r({reflect:!0,type:Boolean})],rU.prototype,"disabled",2),ej([r({type:String,attribute:"count-attempt"})],rU.prototype,"countAttempt",2),ej([r({type:String})],rU.prototype,"title",2),rU=ej([rr("qti-end-attempt-interaction")],rU);var rL=e8(ti());var rN=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t._rows=5;t._value="";return t}c(e,[{key:"handleclassNamesChange",value:function t(t,e){var n=this;var r=e.split(" "),i=!1;if(r.forEach(function(t){if(t.startsWith("qti-height-lines-")){var e=t.replace("qti-height-lines-","");n._rows=parseInt(e),i=!0}}),!i&&this.expectedLength){var o=Math.ceil(this.expectedLength/50);this._rows=o}}},{key:"value",get:function t(){return this._value||null},set:function t(t){if(typeof t=="string"||t===null){this._value=t||"";var e=new FormData;e.append(this.responseIdentifier,this._value),this._internals.setFormValue(e),this.validate()}else throw new Error("Value must be a string")}},{key:"validate",value:function t(){var t=this.shadowRoot.querySelector("textarea");if(!t)return!1;if(this.patternMask&&this.dataPatternmaskMessage){this._internals.setValidity({}),t.setCustomValidity("");var e=this.patternMask.startsWith("^")&&this.patternMask.endsWith("$")?this.patternMask:"^".concat(this.patternMask,"$"),n=new RegExp(e);t.checkValidity()&&n.test(t.value)||(this._internals.setValidity({customError:!0},this.dataPatternmaskMessage),t.setCustomValidity(this.dataPatternmaskMessage))}else{var r=t.checkValidity();this._internals.setValidity(r?{}:{customError:!1})}return this._value!==""&&t.checkValidity()}},{key:"reportValidity",value:function t(){var t=this.shadowRoot.querySelector("textarea");if(!t)return!1;var e=this.validate();return e||t.reportValidity(),e}},{key:"render",value:function t(){var t=this;return nQ(to(),this.responseIdentifier,5e3,function(t){return t.stopImmediatePropagation()},this.textChanged,this.textChanged,function(e){t.reportValidity()},rk(this.placeholderText?this.placeholderText:void 0),this._rows,this.disabled,this.readonly,this._value)}},{key:"textChanged",value:function t(t){if(this.disabled||this.readonly)return;var e=t.target;this.setEmptyAttribute(e.value),this._value!==e.value&&(this.value=e.value,this.saveResponse(e.value))}},{key:"setEmptyAttribute",value:function t(t){this.setAttribute("empty",t===""?"true":"false")}}]);return e}(rS);rN.styles=rL,ej([i()],rN.prototype,"_rows",2),ej([r({type:Number,attribute:"expected-length"})],rN.prototype,"expectedLength",2),ej([r({type:String,attribute:"pattern-mask"})],rN.prototype,"patternMask",2),ej([r({type:String,attribute:"placeholder-text"})],rN.prototype,"placeholderText",2),ej([r({type:String,attribute:"data-patternmask-message"})],rN.prototype,"dataPatternmaskMessage",2),ej([i()],rN.prototype,"_value",2),ej([r({type:String,attribute:"class"})],rN.prototype,"classNames",2),ej([d("classNames")],rN.prototype,"handleclassNamesChange",1),rN=ej([rr("qti-extended-text-interaction")],rN);var rD=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.tabindex=0;return t}c(e,[{key:"connectedCallback",value:function t(){this.setAttribute("slot","drags")}}]);return e}(rt);rD.styles=e8(ta()),ej([r({type:Number,reflect:!0})],rD.prototype,"tabindex",2),rD=ej([rr("qti-gap-img")],rD);var rV=e8(ts());var rj=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nQ(tl())}},{key:"toggleCorrectResponse",value:function t(t,e){var n=this;if(e&&t.correctResponse){var r=[],i=Array.isArray(t.correctResponse)?t.correctResponse:[t.correctResponse];i&&(r=i.map(function(t){var e=t.split(" ");return{text:e[0],gap:e[1]}})),this.querySelectorAll("qti-gap").forEach(function(t){var e,i,o;var a=t.getAttribute("identifier"),s=(e=r.find(function(t){return t.gap===a}))===null||e===void 0?void 0:e.text,l=(i=n.querySelector('qti-gap-text[identifier="'.concat(s,'"]')))===null||i===void 0?void 0:i.textContent.trim();if(s&&l){var u;if(!((u=t.nextElementSibling)===null||u===void 0?void 0:u.classList.contains("correct-option"))){var c=document.createElement("span");c.classList.add("correct-option"),c.textContent=l,c.style.border="1px solid var(--qti-correct)",c.style.borderRadius="4px",c.style.padding="2px 4px",c.style.display="inline-block",t.insertAdjacentElement("afterend",c)}}else((o=t.nextElementSibling)===null||o===void 0?void 0:o.classList.contains("correct-option"))&&t.nextElementSibling.remove()})}else this.querySelectorAll(".correct-option").forEach(function(t){t.remove()})}}]);return e}(rC(rS,"qti-gap-text","qti-gap","slot[part='drags']"));rj.styles=rV,rj=ej([rr("qti-gap-match-interaction")],rj);var rH={toAttribute:function(t){return t?"true":"false"},fromAttribute:function(t){return t==="true"}};var rQ=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.tabindex=0;return t}c(e,[{key:"connectedCallback",value:function t(){h(f(e.prototype),"connectedCallback",this).call(this),this.setAttribute("slot","drags")}},{key:"render",value:function t(){return nQ(tu())}}]);return e}(U(rt,"qti-gap-text"));rQ.styles=e8(tc()),ej([r({type:Number,reflect:!0})],rQ.prototype,"tabindex",2),rQ=ej([rr("qti-gap-text")],rQ);var rF=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.tabindex=0;return t}c(e,[{key:"render",value:function t(){return nQ(td())}}]);return e}(rt);rF.styles=e8(th()),ej([r({type:Number,reflect:!0})],rF.prototype,"tabindex",2),rF=ej([rr("qti-gap")],rF);var rz={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},rB=function(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++){n[r]=arguments[r]}return{_$litDirective$:t,values:n}}},rW=/*#__PURE__*/function(){"use strict";function t(e){s(this,t)}c(t,[{key:"_$AU",get:function t(){return this._$AM._$AU}},{key:"_$AT",value:function t(t,e,n){this._$Ct=t,this._$AM=e,this._$Ci=n}},{key:"_$AS",value:function t(t,e){return this.update(t,e)}},{key:"update",value:function t(t,e){return this.render.apply(this,T(e))}}]);return t}();var rY=n6.I;var rX=function(t){return t.strings===void 0},rJ=function(){return document.createComment("")},rG=function(t,e,n){var r=t._$AA.parentNode,i=e===void 0?t._$AB:e._$AA;if(n===void 0){var o=r.insertBefore(rJ(),i),a=r.insertBefore(rJ(),i);n=new rY(o,a,t,t.options)}else{var s=n._$AB.nextSibling,l=n._$AM,u=l!==t;if(u){var c;var d;(c=n._$AQ)===null||c===void 0?void 0:c.call(n,t),n._$AM=t,n._$AP!==void 0&&(d=t._$AU)!==l._$AU&&n._$AP(d)}if(s!==i||u){var h=n._$AA;for(;h!==s;){var f=h.nextSibling;r.insertBefore(h,i),h=f}}}return n},rK=function(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t;return t._$AI(e,n),t},rZ={},r0=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:rZ;return t._$AH=e},r1=function(t){return t._$AH},r2=function(t){var e;(e=t._$AP)===null||e===void 0?void 0:e.call(t,!1,!0);var n=t._$AA,r=t._$AB.nextSibling;for(;n!==r;){var i=n.nextSibling;n.remove(),n=i}};var r3=function(t,e,n){var r=new Map;for(var i=e;i<=n;i++)r.set(t[i],i);return r},r5=rB(/*#__PURE__*/function(t){"use strict";v(e,t);function e(t){s(this,e);var n;if(n=a(this,e,[t]),t.type!==rz.CHILD)throw Error("repeat() can only be used in text expressions");return n}c(e,[{key:"dt",value:function t(t,e,n){var r;n===void 0?n=e:e!==void 0&&(r=e);var i=[],o=[],a=0;var s=true,l=false,u=undefined;try{for(var c=t[Symbol.iterator](),d;!(s=(d=c.next()).done);s=true){var h=d.value;i[a]=r?r(h,a):a,o[a]=n(h,a),a++}}catch(t){l=true;u=t}finally{try{if(!s&&c.return!=null){c.return()}}finally{if(l){throw u}}}return{values:o,keys:i}}},{key:"render",value:function t(t,e,n){return this.dt(t,e,n).values}},{key:"update",value:function t(t,e){var n=S(e,3),r=n[0],i=n[1],o=n[2];var a=r1(t),s=this.dt(r,i,o),l=s.values,u=s.keys;if(!Array.isArray(a))return this.ut=u,l;var c;var d=(c=this.ut)!==null&&c!==void 0?c:this.ut=[],h=[],f,v,p=0,y=a.length-1,m=0,g=l.length-1;for(;p<=y&&m<=g;)if(a[p]===null)p++;else if(a[y]===null)y--;else if(d[p]===u[m])h[m]=rK(a[p],l[m]),p++,m++;else if(d[y]===u[g])h[g]=rK(a[y],l[g]),y--,g--;else if(d[p]===u[g])h[g]=rK(a[p],l[g]),rG(t,h[g+1],a[p]),p++,g--;else if(d[y]===u[m])h[m]=rK(a[y],l[m]),rG(t,a[p],a[y]),y--,m++;else if(f===void 0&&(f=r3(u,m,g),v=r3(d,p,y)),f.has(d[p]))if(f.has(d[y])){var b=v.get(u[m]),_=b!==void 0?a[b]:null;if(_===null){var k=rG(t,a[p]);rK(k,l[m]),h[m]=k}else h[m]=rK(_,l[m]),rG(t,a[p],_),a[b]=null;m++}else r2(a[y]),y--;else r2(a[p]),p++;for(;m<=g;){var E=rG(t,h[g+1]);rK(E,l[m]),h[m++]=E}for(;p<=y;){var x=a[p++];x!==null&&r2(x)}return this.ut=u,r0(t,h),nB}}]);return e}(rW));var r4=e8(tf());var r6=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e);t.startPoint=null;t.endPoint=null;t._lines=[];t._correctLines=[];t.addEventListener("qti-register-hotspot",t.positionHotspotOnRegister);return t}c(e,[{key:"reset",value:function t(){this._lines=[],this._correctLines=[]}},{key:"validate",value:function t(){return this._lines.length>0}},{key:"value",get:function t(){return this._lines},set:function t(t){Array.isArray(t)&&(this._lines=t)}},{key:"toggleCorrectResponse",value:function t(t,e){if(!e){this._correctLines=[];return}if(!t.correctResponse){console.error("No correct response found for this interaction.");return}var n=Array.isArray(t.correctResponse)?t.correctResponse:[t.correctResponse];this._correctLines=n}},{key:"render",value:function t(){var t=this;var e,n,r,i;return nQ(tm(),rk((e=this.grImage[0])===null||e===void 0?void 0:e.width),rk((n=this.grImage[0])===null||n===void 0?void 0:n.height),(r=this.grImage[0])===null||r===void 0?void 0:r.width,(i=this.grImage[0])===null||i===void 0?void 0:i.height,r5(this._lines,function(t){return t},function(e,n){return nF(tv(),parseInt(t.querySelector("[identifier=".concat(e.split(" ")[0],"]")).style.left),parseInt(t.querySelector("[identifier=".concat(e.split(" ")[0],"]")).style.top),parseInt(t.querySelector("[identifier=".concat(e.split(" ")[1],"]")).style.left),parseInt(t.querySelector("[identifier=".concat(e.split(" ")[1],"]")).style.top),function(e){e.stopPropagation(),t._lines=t._lines.filter(function(t,e){return e!==n}),t.saveResponse(t._lines)})}),r5(this._correctLines,function(t){return t},function(e,n){return nF(tp(),parseInt(t.querySelector("[identifier=".concat(e.split(" ")[0],"]")).style.left),parseInt(t.querySelector("[identifier=".concat(e.split(" ")[0],"]")).style.top),parseInt(t.querySelector("[identifier=".concat(e.split(" ")[1],"]")).style.left),parseInt(t.querySelector("[identifier=".concat(e.split(" ")[1],"]")).style.top))}),this.startPoint&&nF(ty(),this.startCoord.x,this.startCoord.y,this.mouseCoord.x,this.mouseCoord.y))}},{key:"positionHotspotOnRegister",value:function t(t){var e=this.querySelector("img"),n=t.target,r=n.getAttribute("coords"),i=n.getAttribute("shape"),o=r.split(",").map(function(t){return parseInt(t)});eq(i,o,e,n)}},{key:"firstUpdated",value:function t(){var t=this;this.hotspots=this.querySelectorAll("qti-associable-hotspot"),document.addEventListener("mousemove",function(e){var n=t.grImage[0].getBoundingClientRect(),r=t.grImage[0].naturalWidth/n.width,i=t.grImage[0].naturalHeight/n.height;t.mouseCoord={x:(e.clientX-n.left)*r,y:(e.clientY-n.top)*i}}),this.hotspots.forEach(function(e){e.style.left=e.getAttribute("coords").split(",")[0]+"px",e.style.top=e.getAttribute("coords").split(",")[1]+"px",e.addEventListener("click",function(e){t.startPoint?t.endPoint||(t.endPoint=e.target,t._lines=T(t._lines).concat(["".concat(t.startPoint.getAttribute("identifier")," ").concat(t.endPoint.getAttribute("identifier"))]),t.saveResponse(t._lines),t.startPoint=null,t.endPoint=null):(t.startPoint=e.target,t.startCoord={x:parseInt(t.startPoint.getAttribute("coords").split(",")[0]),y:parseInt(t.startPoint.getAttribute("coords").split(",")[1])})})})}},{key:"disconnectedCallback",value:function t(){h(f(e.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}}]);return e}(rS);r6.styles=r4,ej([i()],r6.prototype,"_lines",2),ej([i()],r6.prototype,"_correctLines",2),ej([i()],r6.prototype,"startCoord",2),ej([i()],r6.prototype,"mouseCoord",2),ej([u({selector:"img"})],r6.prototype,"grImage",2),r6=ej([rr("qti-graphic-associate-interaction")],r6);var r9=e8(tg());var r7=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nQ(tb())}},{key:"positionHotspotOnRegister",value:function t(t){var e=t.target,n=e.getAttribute("coords"),r=e.getAttribute("shape"),i=n.split(",").map(function(t){return parseInt(t)});switch(r){case"circle":{var o=S(i,3),a=o[0],s=o[1],l=o[2];e.style.left=a-l+"px",e.style.top=s-l+"px",e.style.width=e.style.height=2*l+"px"}break;case"rect":{var u=S(i,4),c=u[0],d=u[1],h=u[2],f=u[3];e.style.left=c+"px",e.style.top=d+"px",e.style.width=h-c+"px",e.style.height=f-d+"px"}break;default:break}}},{key:"connectedCallback",value:function t(){h(f(e.prototype),"connectedCallback",this).call(this),this.addEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}},{key:"disconnectedCallback",value:function t(){h(f(e.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}}]);return e}(rC(rS,"qti-gap-img, qti-gap-text","qti-associable-hotspot","slot[part='drags']"));r7.styles=r9,r7=ej([rr("qti-graphic-gap-match-interaction")],r7);var r8=e8(t_());var it=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t._choiceElements=[];return t}c(e,[{key:"render",value:function t(){return nQ(tk())}},{key:"setHotspotOrder",value:function t(t){var e=t.detail,n=e.identifier,r=this._choiceElements.find(function(t){return t.getAttribute("identifier")===n});if(!r)return;var i=this._choiceElements.length;if(!this.choiceOrdering){if(this.choiceOrdering=!0,r.order==null){var o=this._choiceElements.filter(function(t){return t.order!=null}).length;if(o>=i){this.choiceOrdering=!1;return}r.order=o+1}else{var a=r.order;r.order=null,this._choiceElements.forEach(function(t){t.order!=null&&t.order>a&&t.order--})}this.choiceOrdering=!1}}},{key:"toggleCorrectResponse",value:function t(t,e){var n;var r=this._choiceElements;var i=true,o=false,a=undefined;try{var s=function(){var r=u.value;if(e&&((n=t.correctResponse)===null||n===void 0?void 0:n.length)>0&&Array.isArray(t.correctResponse)){var i=t.correctResponse.findIndex(function(t){return t===r.identifier});i>=0?r.orderCorrect=i+1:r.orderCorrect=null}else r.orderCorrect=null};for(var l=r[Symbol.iterator](),u;!(i=(u=l.next()).done);i=true)s()}catch(t){o=true;a=t}finally{try{if(!i&&l.return!=null){l.return()}}finally{if(o){throw a}}}}},{key:"positionHotspotOnRegister",value:function t(t){var e=this.querySelector("img"),n=t.target,r=n.getAttribute("coords"),i=n.getAttribute("shape"),o=r.split(",").map(function(t){return parseInt(t)});eq(i,o,e,n)}},{key:"connectedCallback",value:function t(){h(f(e.prototype),"connectedCallback",this).call(this),this.addEventListener("activate-qti-hotspot-choice",this.setHotspotOrder),this.addEventListener("register-qti-hotspot-choice",this.positionHotspotOnRegister)}},{key:"disconnectedCallback",value:function t(){h(f(e.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("activate-qti-hotspot-choice",this.setHotspotOrder),this.removeEventListener("register-qti-hotspot-choice",this.positionHotspotOnRegister)}}]);return e}(rP(rS,"qti-hotspot-choice"));it.styles=r8,it=ej([rr("qti-graphic-order-interaction")],it);var ie=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}return e}(U(rt,"qti-hotspot-choice"));ie.styles=e8(tE()),ej([r({attribute:"aria-ordervalue",type:Number,reflect:!0})],ie.prototype,"order",2),ej([r({attribute:"aria-ordercorrectvalue",type:Number,reflect:!0})],ie.prototype,"orderCorrect",2),ie=ej([rr("qti-hotspot-choice")],ie);var ir=e8(tx());var ii=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nQ(tw())}},{key:"positionHotspotOnRegister",value:function t(t){var e=this.querySelector("img"),n=t.target,r=n.getAttribute("coords"),i=n.getAttribute("shape"),o=r.split(",").map(function(t){return parseInt(t)});eq(i,o,e,n)}},{key:"connectedCallback",value:function t(){h(f(e.prototype),"connectedCallback",this).call(this),this.addEventListener("register-qti-hotspot-choice",this.positionHotspotOnRegister)}},{key:"disconnectedCallback",value:function t(){h(f(e.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("unregister-qti-hotspot-choice",this.positionHotspotOnRegister)}}]);return e}(rP(rS,"qti-hotspot-choice"));ii.styles=ir,ii=ej([rr("qti-hotspot-interaction")],ii);var io=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.render=function(){return nQ(tA())};return t}return e}(rP(rS,"qti-hottext"));io=ej([rr("qti-hottext-interaction")],io);var ia=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nQ(tC())}}]);return e}(U(rt,"qti-hottext"));ia.styles=e8(tq()),ia=ej([rr("qti-hottext")],ia);var is=/*#__PURE__*/function(t){"use strict";v(e,t);function e(t){s(this,e);var n;if(n=a(this,e,[t]),n.it=nW,t.type!==rz.CHILD)throw Error(n.constructor.directiveName+"() can only be used in child bindings");return n}c(e,[{key:"render",value:function t(t){if(t===nW||t==null)return this._t=void 0,this.it=t;if(t===nB)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;var e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}]);return e}(rW);is.directiveName="unsafeHTML",is.resultType=1;var il=rB(is);var iu=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.options=[];t.correctOption="";t.dataPrompt="select";return t}c(e,[{key:"render",value:function t(){return nQ(tP(),this.choiceSelected,this.disabled,this.readonly,this.options.map(function(t){return nQ(tR(),t.value,t.selected,il(t.textContent))}),il(this.correctOption))}},{key:"connectedCallback",value:function t(){h(f(e.prototype),"connectedCallback",this).call(this),this.addEventListener("on-dropdown-selected",this.choiceSelected);var t=Array.from(this.querySelectorAll("qti-inline-choice"));this.options=[{textContent:this.dataPrompt,value:"",selected:!1}].concat(T(t.map(function(t){return{textContent:t.innerHTML,value:t.getAttribute("identifier"),selected:!1}})))}},{key:"disconnectedCallback",value:function t(){this.removeEventListener("on-dropdown-selected",this.choiceSelected)}},{key:"validate",value:function t(){var t=this.options.find(function(t){return t.selected});return t?t.value!=="":!1}},{key:"reset",value:function t(){this.options=this.options.map(function(t,e){return x(k({},t),{selected:e===0})})}},{key:"value",get:function t(){var t;return((t=this.options.find(function(t){return t.selected}))===null||t===void 0?void 0:t.value)||null},set:function t(t){this.options=this.options.map(function(e){return t&&t===e.value&&(e.selected=!0),e})}},{key:"toggleCorrectResponse",value:function t(t,e){var n=this;if(this.correctResponse=e?t.value:"",!this.correctResponse){this.correctOption="";return}this.correctOption='<span part="correct-option">'.concat(this.options.find(function(t){return n.correctResponse===t.value}).textContent,"</span>")}},{key:"choiceSelected",value:function t(t){var e=t.target.value;this.options=this.options.map(function(t){return x(k({},t),{selected:t.value===e})}),this.saveResponse(e)}}],[{key:"styles",get:function t(){return[e8(tS())]}}]);return e}(rS);iu.inputWidthClass=["","qti-input-width-2","qti-input-width-1","qti-input-width-3","qti-input-width-4","qti-input-width-6","qti-input-width-10","qti-input-width-15","qti-input-width-20","qti-input-width-72"],ej([i()],iu.prototype,"options",2),ej([i()],iu.prototype,"correctOption",2),ej([r({attribute:"data-prompt",type:String})],iu.prototype,"dataPrompt",2),iu=ej([rr("qti-inline-choice-interaction")],iu);var ic=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"connectedCallback",value:function t(){h(f(e.prototype),"connectedCallback",this).call(this),this.addEventListener("click",this._onSelectInlineChoice),this.dispatchEvent(new CustomEvent("qti-inline-choice-register",{bubbles:!0,composed:!0,cancelable:!1}))}},{key:"disconnectedCallback",value:function t(){this.removeEventListener("click",this._onSelectInlineChoice)}},{key:"render",value:function t(){return nQ(tT())}},{key:"_onSelectInlineChoice",value:function t(){this.dispatchEvent(new CustomEvent("qti-inline-choice-select",{bubbles:!0,cancelable:!1,composed:!0,detail:{identifier:this.identifier}}))}}],[{key:"styles",get:function t(){return[e8(tM())]}}]);return e}(rt);ej([r({type:String})],ic.prototype,"identifier",2),ic=ej([rr("qti-inline-choice")],ic);var id=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.matchMin=0;t.matchMax=1;t.fixed=!1;return t}c(e,[{key:"connectedCallback",value:function t(){h(f(e.prototype),"connectedCallback",this).call(this),this.setAttribute("slot","qti-simple-associable-choice"),this.setAttribute("part","qti-simple-associable-choice")}},{key:"render",value:function t(){return nQ(tO())}}]);return e}(U(rt,"qti-simple-associable-choice"));id.styles=e8(t$()),ej([r({type:Number,attribute:"match-min"})],id.prototype,"matchMin",2),ej([r({type:Number,attribute:"match-max"})],id.prototype,"matchMax",2),ej([r({type:Boolean,attribute:"fixed"})],id.prototype,"fixed",2),id=ej([rr("qti-simple-associable-choice")],id);var ih=e8(tI());var iv=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.lastCheckedRadio=null;t.class="";t._response=[];t.responseIdentifier="";t.correctOptions=[];t.handleRadioClick=function(e){var n=e.target;t.lastCheckedRadio===n?(n.checked=!1,t.lastCheckedRadio=null,t.handleRadioChange(e)):t.lastCheckedRadio=n};t.handleRadioChange=function(e){var n=e.target,r=n.value,i=n.name,o=n.type;n.checked?(t.value?t.value.indexOf(r)===-1&&(o==="radio"&&(t.value=t.value.filter(function(t){return t.indexOf(i)===-1})),t.value=T(t.value).concat([r])):t.value=[r],t.lastCheckedRadio=n):(t.value=t.value.filter(function(t){return t!==r}),t.lastCheckedRadio=null),t.requestUpdate(),t.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:t.responseIdentifier,response:Array.isArray(t.value)?T(t.value):t.value}}))};return t}c(e,[{key:"value",get:function t(){return this.classList.contains("qti-match-tabular")?this._response:h(f(e.prototype),"value",this)},set:function t(t){this.classList.contains("qti-match-tabular")?this._response=t:C(f(e.prototype),"value",t,this,true)}},{key:"connectedCallback",value:function t(){var t=this;var n=this,r=function(){return h(f(e.prototype),"connectedCallback",t)};return o(function(){return L(this,function(t){r().call(n),n.rows=Array.from(n.querySelectorAll("qti-simple-match-set:first-of-type qti-simple-associable-choice")),n.cols=Array.from(n.querySelectorAll("qti-simple-match-set:last-of-type qti-simple-associable-choice")),n.value=[];return[2]})})()}},{key:"toggleCorrectResponse",value:function t(t,e){var n=this;if(e&&t.correctResponse){var r=[],i=Array.isArray(t.correctResponse)?t.correctResponse:[t.correctResponse];i&&(r=i.map(function(t){var e=t.split(" ");return{text:e[0],gap:e[1]}})),this.querySelectorAll("qti-simple-match-set > qti-simple-associable-choice").forEach(function(t){var e,i,o;var a=t.getAttribute("identifier"),s=(e=r.find(function(t){return t.gap===a}))===null||e===void 0?void 0:e.text,l=(i=n.querySelector('qti-simple-associable-choice[identifier="'.concat(s,'"]')))===null||i===void 0?void 0:i.textContent.trim();if(s&&l){var u;if(!((u=t.nextElementSibling)===null||u===void 0?void 0:u.classList.contains("correct-option"))){var c=document.createElement("span");c.classList.add("correct-option"),c.textContent=l,c.style.border="1px solid var(--qti-correct)",c.style.borderRadius="4px",c.style.padding="2px 4px",c.style.display="inline-block",t.insertAdjacentElement("beforebegin",c)}}else((o=t.nextElementSibling)===null||o===void 0?void 0:o.classList.contains("correct-option"))&&t.nextElementSibling.remove()})}else this.querySelectorAll(".correct-option").forEach(function(t){t.remove()})}},{key:"correctResponse",set:function t(t){if(t===""){this.correctOptions=[];return}else Array.isArray(t)&&(this.correctOptions=t,this.class.split(" ").includes("qti-match-tabular")||(this.value=t))}},{key:"render",value:function t(){var t=this;var e=this.class.split(" ").includes("qti-match-tabular");return nQ(tV(),e,e?nQ(tD(),this.cols.map(function(t){return nQ(tU(),il(t.innerHTML))}),this.rows.map(function(e){return nQ(tN(),il(e.innerHTML),t.cols.map(function(n){var r=e.getAttribute("identifier"),i=n.getAttribute("identifier"),o="".concat(r," ").concat(i),a=t.value.filter(function(t){return t.split(" ")[0]===r}).length||0,s=t.value.includes(o),l="rb ".concat(s?"rb-checked":""," ").concat(t.correctOptions.includes(o)?"rb-correct":""),u=t.correctOptions.length>0?!0:e.matchMax===1?!1:e.matchMax!==0&&a>=e.matchMax&&!s;return nQ(tL(),e.matchMax===1?"radio":"checkbox",l,r,o,u,function(e){return t.handleRadioChange(e)},function(n){return e.matchMax===1?t.handleRadioClick(n):null})}))})):nW)}}]);return e}(rC(rS,"qti-simple-match-set:first-of-type qti-simple-associable-choice, qti-simple-match-set:last-of-type > qti-simple-associable-choice > qti-simple-associable-choice","qti-simple-match-set:last-of-type > qti-simple-associable-choice","qti-simple-match-set:first-of-type"));iv.styles=ih,ej([r({type:String})],iv.prototype,"class",2),ej([i()],iv.prototype,"_response",2),ej([r({type:String,attribute:"response-identifier"})],iv.prototype,"responseIdentifier",2),ej([i()],iv.prototype,"correctOptions",2),iv=ej([rr("qti-match-interaction")],iv);var ip=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e);t._value=0;return t}c(e,[{key:"reset",value:function t(){}},{key:"validate",value:function t(){return!0}},{key:"value",get:function t(){return this._value.toString()},set:function t(t){if(t!==null)if(!isNaN(parseInt(t===null||t===void 0?void 0:t.toString())))this._value=parseInt(t.toString());else throw new Error("Value must be a number")}},{key:"render",value:function t(){return nQ(tj())}},{key:"connectedCallback",value:function t(){var t=this;h(f(e.prototype),"connectedCallback",this).call(this);var n=this.querySelector("audio")||this.querySelector("video")||this.querySelector("object");n&&n.addEventListener("ended",function(){t._value++,t.saveResponse(t.value)})}}],[{key:"properties",get:function t(){return x(k({},rS.properties),{step:{type:Number,attribute:"step",default:10}})}}]);return e}(rS);ip.styles=[e8(tH())],ip=ej([rr("qti-media-interaction")],ip);var iy=e8(tQ());var im=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.nrChoices=0;t.correctResponses=[];t.showCorrectResponses=!1;return t}c(e,[{key:"render",value:function t(){var t=Array.from(this.querySelectorAll("qti-simple-choice"));return this.nrChoices<t.length&&(this.nrChoices=t.length),nQ(tz(),T(Array(this.nrChoices)).map(function(t,e){return nQ(tF(),e)}))}},{key:"toggleCorrectResponse",value:function t(t,e){var n=this;if(e&&t.correctResponse){var r=[],i=Array.isArray(t.correctResponse)?t.correctResponse:[t.correctResponse];i&&(r=i.map(function(t){return{text:t.split(" ")[0]}})),this.querySelectorAll("qti-simple-choice").forEach(function(t,e){var i,o,a;var s=t.getAttribute("identifier"),l=(i=r.find(function(t){return t.text===s}))===null||i===void 0?void 0:i.text,u=(o=n.querySelector('qti-simple-choice[identifier="'.concat(l,'"]')))===null||o===void 0?void 0:o.textContent.trim();if(l&&u){var c;if(!((c=t.nextElementSibling)===null||c===void 0?void 0:c.classList.contains("correct-option"))){var d=document.createElement("span");d.classList.add("correct-option"),d.textContent=u,d.style.border="1px solid var(--qti-correct)",d.style.borderRadius="4px",d.style.padding="2px 4px",d.style.display="inline-block",n.shadowRoot.querySelector('drop-list[identifier="droplist'.concat(e,'"]')).insertAdjacentElement("afterend",d)}}else((a=n.shadowRoot.querySelector('drop-list[identifier="droplist'.concat(e,'"]')).nextElementSibling)===null||a===void 0?void 0:a.classList.contains("correct-option"))&&t.nextElementSibling.remove()})}else this.shadowRoot.querySelectorAll(".correct-option").forEach(function(t){t.remove()})}},{key:"getResponse",value:function t(){return Array.from(this.shadowRoot.querySelectorAll("drop-list")).map(function(t){var e=t.querySelectorAll('[qti-draggable="true"]');return T(Array.from(e).map(function(t){return t.getAttribute("identifier")})).join(" ")})}},{key:"firstUpdated",value:function t(t){var n=this;var r=this,i=function(){return h(f(e.prototype),"firstUpdated",n)};return o(function(){return L(this,function(e){i().call(r,t),r.childrenMap=Array.from(r.querySelectorAll("qti-simple-choice")),r.childrenMap.forEach(function(t){return t.setAttribute("part","qti-simple-choice")});return[2]})})()}}]);return e}(rM(rC(rS,"qti-simple-choice","drop-list","slot[part='drags']"),"qti-simple-choice"));im.styles=iy,ej([i()],im.prototype,"nrChoices",2),ej([i()],im.prototype,"correctResponses",2),ej([i()],im.prototype,"showCorrectResponses",2),ej([r({type:String})],im.prototype,"orientation",2),im=ej([rr("qti-order-interaction")],im);var ig=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;var n;t=a(this,e,arguments),n=t;t._errorMessage=null;t._onInteractionChanged=function(e){e.stopPropagation();var n=t.convertQtiVariableJSON(e.detail.value);t.value=n,t.saveResponse(n)};t.loadConfig=/*#__PURE__*/function(){var t=o(function(t,e){var r,i,o,a;return L(this,function(o){switch(o.label){case 0:t=n.removeDoubleSlashes(t);o.label=1;case 1:o.trys.push([1,5,,6]);return[4,fetch(t)];case 2:r=o.sent();if(!r.ok)return[3,4];return[4,r.json()];case 3:i=o.sent();for(var s in i.paths)e&&(i.paths[s]=n.getResolvablePath(i.paths[s],e));return[2,i];case 4:return[3,6];case 5:a=o.sent();return[3,6];case 6:return[2,null]}})});return function(e,n){return t.apply(this,arguments)}}();t.getResolvablePathString=function(e,n){return e=e.replace(/\.js$/,""),(e===null||e===void 0?void 0:e.toLocaleLowerCase().startsWith("http"))||!n?e:t.removeDoubleSlashes("".concat(n,"/").concat(e))};t.getResolvablePath=function(e,n){return Array.isArray(e)?e.map(function(e){return t.getResolvablePathString(e,n)}):t.getResolvablePathString(e,n)};return t}c(e,[{key:"convertQtiVariableJSON",value:function t(t){for(var e in t)if(t.hasOwnProperty(e)){var n=t[e];if(n){for(var r in n)if(n.hasOwnProperty(r)){var i=n[r];if(Array.isArray(i))return i.map(String);if(i!=null)return String(i)}}}return null}},{key:"addHyphenatedKeys",value:function t(t){var e=k({},t);for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var r=n.replace(/[A-Z]/g,function(t){return"-".concat(t.toLowerCase())});e[r]=t[n]}return e}},{key:"responseVariablesToQtiVariableJSON",value:function t(t,e,n){if(e!=="single"){var r={list:{}};return r.list[n]=t,r}else{var i={base:{}};return i.base[n]=t,i}}},{key:"validate",value:function t(){return!0}},{key:"value",get:function t(){var t;var e=(t=this.pci)===null||t===void 0?void 0:t.getResponse();return e?this.convertQtiVariableJSON(e):this._value},set:function t(t){this._value=t}},{key:"boundTo",get:function t(){var t=this;var e,n,r,i,o,a;var s=this.responseVariablesToQtiVariableJSON(this._value,((r=this.context)===null||r===void 0?void 0:(n=r.variables)===null||n===void 0?void 0:(e=n.find(function(e){return e.identifier===t.responseIdentifier}))===null||e===void 0?void 0:e.cardinality)||"single",((a=this.context)===null||a===void 0?void 0:(o=a.variables)===null||o===void 0?void 0:(i=o.find(function(e){return e.identifier===t.responseIdentifier}))===null||i===void 0?void 0:i.baseType)||"string"),l={};return l[this.responseIdentifier]=s,l},set:function t(t){var e=this.convertQtiVariableJSON(t);this._value=e,this.saveResponse(e)}},{key:"register",value:function t(t){var e=this;this.pci=t,this.dom=this.querySelector("qti-interaction-markup"),this.dom||(this.dom=document.createElement("div"),this.appendChild(this.dom)),this.dom.classList.add("qti-customInteraction"),this.dom.addEventListener("qti-interaction-changed",this._onInteractionChanged),this.querySelector("properties")&&(this.querySelector("properties").style.display="none");var n={properties:this.addHyphenatedKeys(k({},this.dataset)),onready:function(t){e.pci=t},ondone:function(t,n,r,i){e.value=e.convertQtiVariableJSON(n),e.saveResponse(e.value)},responseIdentifier:this.responseIdentifier,boundTo:this.boundTo};if(t.getInstance)t.getInstance(this.dom,n,void 0);else{var r=function(t){var e={},n=function(t){var e={};Object.entries(t.dataset).forEach(function(t){var n=S(t,2),r=n[0],i=n[1];r.includes("__")||(e[r]=i)});var n={};return Object.entries(t.dataset).forEach(function(t){var e=S(t,2),r=e[0],i=e[1];var o=r.split("__");if(o.length>1){var a=S(o,3),s=a[0],l=a[1],u=a[2];n[s]=n[s]||{},n[s][l]=n[s][l]||{},n[s][l][u]=i}}),Object.entries(n).forEach(function(t){var n=S(t,2),r=n[0],i=n[1];e[r]=Object.values(i)}),e}(t);for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];r==="config"?e[r]=JSON.parse(i):e[r]=i}return e}(this);t.initialize(this.customInteractionTypeIdentifier,this.dom.firstElementChild||this.dom,Object.keys(r).length?r:null)}}},{key:"connectedCallback",value:function t(){var t=this;h(f(e.prototype),"connectedCallback",this).call(this),define("qtiCustomInteractionContext",function(){return{register:function(e){t.register(e)},notifyReady:function(){}}});var n=this.buildRequireConfig(),r=requirejs.config(n);requirejs.onError=function(t){throw console.error("RequireJS error:",t),t.requireType==="timeout"&&console.error("Modules that timed out:",t.requireModules),t},r(["require"],function(e){try{e([t.module],function(){},function(t){console.error("Error loading module:",t)})}catch(t){console.error("Error in require call:",t)}})}},{key:"disconnectedCallback",value:function t(){h(f(e.prototype),"disconnectedCallback",this).call(this),requirejs.undef(this.customInteractionTypeIdentifier);var t=requirejs.s.contexts;delete t[this.customInteractionTypeIdentifier],this.removeEventListener("qti-interaction-changed",this._onInteractionChanged)}},{key:"buildRequireConfig",value:function t(){var t={context:this.customInteractionTypeIdentifier,catchError:!0,paths:window.requirePaths||{},shim:window.requireShim||{}};if(!globalThis.require)return this._errorMessage="RequireJS not found. Please load it via CDN: https://cdnjs.com/libraries/require.js",null;var e=this.getAttribute("data-base-url"),n=this.querySelector("qti-interaction-modules");if(n){var r=n.querySelectorAll("qti-interaction-module");var i=true,o=false,a=undefined;try{for(var s=r[Symbol.iterator](),l;!(i=(l=s.next()).done);i=true){var u=l.value;var c=u.getAttribute("id"),d=u.getAttribute("primary-path"),h=u.getAttribute("fallback-path");if(c&&d){var f=h?this.combineRequireResolvePaths(this.getResolvablePath(d,e),this.getResolvablePath(h,e)):this.getResolvablePath(d,e),v=t.paths[c]||[];t.paths[c]=this.combineRequireResolvePaths(v,f)}}}catch(t){o=true;a=t}finally{try{if(!i&&s.return!=null){s.return()}}finally{if(o){throw a}}}}return t}},{key:"combineRequireResolvePaths",value:function t(t,e){var n=Array.isArray(t)?t:[t],r=Array.isArray(e)?e:[e];return n.concat(r).filter(function(t,e,n){return n.indexOf(t)===e})}},{key:"removeDoubleSlashes",value:function t(t){return t.replace(/([^:]\/)\/+/g,"$1").replace(/\/\//g,"/").replace("http:/","http://").replace("https:/","https://")}},{key:"render",value:function t(){return nQ(tW(),this._errorMessage&&nQ(tB(),this._errorMessage))}}]);return e}(rS);ej([r({type:String,attribute:"module"})],ig.prototype,"module",2),ej([r({type:String,attribute:"custom-interaction-type-identifier"})],ig.prototype,"customInteractionTypeIdentifier",2),ej([i()],ig.prototype,"_errorMessage",2),ej([e({context:rs,subscribe:!0}),i()],ig.prototype,"context",2),ig=ej([rr("qti-portable-custom-interaction")],ig);var ib=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nQ(tY())}}]);return e}(rt);ib.styles=[e8(tX())];customElements.define("qti-position-object-interaction",ib);var i_=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e),t.removeMoveListener=t.removeMoveListener.bind(t),t.dragElementHandler=t.dragElementHandler.bind(t);return t}c(e,[{key:"render",value:function t(){return nQ(tJ())}},{key:"dragElementHandler",value:function t(t){t.preventDefault();var e=t.clientX-this.startX,n=t.clientY-this.startY;this.dragElement.style.left=this.dragElement.offsetLeft+e+"px",this.dragElement.style.top=this.dragElement.offsetTop+n+"px",this.startX=t.clientX,this.startY=t.clientY}},{key:"firstUpdated",value:function t(t){var n=this;h(f(e.prototype),"firstUpdated",this).call(this,t),this.dragElement=this.querySelector("qti-position-object-interaction>img"),this.startX=0,this.startY=0,this.dragElement.addEventListener("mousedown",function(t){n.startX=t.clientX,n.startY=t.clientY,document.addEventListener("mousemove",n.dragElementHandler,!0)}),document.addEventListener("mouseup",this.removeMoveListener)}},{key:"removeMoveListener",value:function t(){document.removeEventListener("mousemove",this.dragElementHandler,!0)}},{key:"disconnectedCallback",value:function t(){h(f(e.prototype),"disconnectedCallback",this).call(this),document.removeEventListener("mousemove",this.dragElementHandler),document.removeEventListener("mouseup",this.removeMoveListener)}}]);return e}(rt);i_.styles=[e8(tG())],i_=ej([rr("qti-position-object-stage")],i_);var ik="important",iE=" !"+ik,ix=rB(/*#__PURE__*/function(t){"use strict";v(e,t);function e(t){s(this,e);var n;var r;if(n=a(this,e,[t]),t.type!==rz.ATTRIBUTE||t.name!=="style"||((r=t.strings)===null||r===void 0?void 0:r.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.");return n}c(e,[{key:"render",value:function t(t){return Object.keys(t).reduce(function(e,n){var r=t[n];return r==null?e:e+"".concat(n=n.includes("-")?n:n.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase(),":").concat(r,";")},"")}},{key:"update",value:function t(t,e){var n=S(e,1),r=n[0];var i=t.element,o=i.style;if(this.ft===void 0)return this.ft=new Set(Object.keys(r)),this.render(r);var a=true,s=false,l=undefined;try{for(var u=this.ft[Symbol.iterator](),c;!(a=(c=u.next()).done);a=true){var d=c.value;r[d]==null&&(this.ft.delete(d),d.includes("-")?o.removeProperty(d):o[d]=null)}}catch(t){s=true;l=t}finally{try{if(!a&&u.return!=null){u.return()}}finally{if(s){throw l}}}for(var h in r){var f=r[h];if(f!=null){this.ft.add(h);var v=typeof f=="string"&&f.endsWith(iE);h.includes("-")||v?o.setProperty(h,v?f.slice(0,-11):f,v?ik:""):o[h]=f}}return nB}}]);return e}(rW));var iw=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.maxChoices=1/0;t.minChoices=0;t._points=[];t._correctAreas=[];t._imgElement=null;t._scaleX=1;t._scaleY=1;t._imageWidthOrginal=0;t._imageHeightOrginal=0;t._onImageClick=function(e){if(!t._imgElement){console.warn("No <img> element found in <qti-select-point-interaction>");return}t.calculateScale();var n=t._imgElement.getBoundingClientRect(),r=(e.clientX-n.left)*t._scaleX,i=(e.clientY-n.top)*t._scaleY,o="".concat(r.toFixed()," ").concat(i.toFixed());t.maxChoices===1?t._points=[o]:t.maxChoices===0||t._points.length<t.maxChoices?t._points=T(t._points).concat([o]):console.warn("Maximum number of points reached. Remove a marker to add a new one."),t.saveResponse(t._points)};t._onResize=function(){t.calculateScale()};return t}c(e,[{key:"connectedCallback",value:function t(){h(f(e.prototype),"connectedCallback",this).call(this),window.addEventListener("resize",this._onResize)}},{key:"toggleCorrectResponse",value:function t(t,e){if(!e){this._correctAreas=[];return}var n=t.areaMapping,r=[];if(!n||n.areaMapEntries.length===0)if(t.correctResponse){var i=Array.isArray(t.correctResponse)?t.correctResponse:[t.correctResponse];if(i.length===0||i.find(function(t){return t.split(" ").length<2}))return console.error("No valid correct responses found for the response variable."),null;console.warn("No area mapping found for the response variable. Using the correct responses to display the correct response but it probably won't score correct."),r=i.map(function(t){return{shape:"circle",coords:t.split(" ").join(",").concat(",10"),defaultValue:1,mappedValue:1}})}else{console.error("No area mapping found for the response variable.");return}else r=n.areaMapEntries;this._correctAreas=r.map(function(t){return{coords:t.coords,shape:t.shape}})}},{key:"updated",value:function t(t){h(f(e.prototype),"updated",this).call(this,t);var n=this._imgElement;n&&t.has("_correctAreas")&&this._correctAreas.length>0&&(this.calculateScale(),this.shadowRoot.querySelectorAll("div").forEach(function(t){var e=t.dataset.coord,r=t.dataset.shape;e&&r&&eq(r,e.split(",").map(function(t){return+t}),n,t)}))}},{key:"render",value:function t(){var t=this;var e;return nQ(t0(),r5(this._points.filter(function(t){return t}),function(t){return t},function(e,n){var r=S(e.split(" ").map(Number),2),i=r[0],o=r[1],a=i/(t._imageWidthOrginal||1)*100,s=o/(t._imageHeightOrginal||1)*100,l=16,u=l/(t._imageWidthOrginal||1)*100,c=l/(t._imageHeightOrginal||1)*100;return nQ(tK(),ix({pointerEvents:t.maxChoices===1?"none":"auto",position:"absolute",transform:"translate(-50%, -50%)",left:"".concat(a,"%"),top:"".concat(s,"%"),width:"min(".concat(u,"%, 1rem)"),height:"min(".concat(c,"%, 1rem)"),minWidth:"min(".concat(u,"%, 1rem)"),minHeight:"min(".concat(c,"%, 1rem)"),borderRadius:"50%",background:"red"}),e,function(e){e.stopPropagation(),t._points=t._points.filter(function(t,e){return e!==n}),t.saveResponse(t._points)})}),r5((e=this._correctAreas)===null||e===void 0?void 0:e.filter(function(t){return t}),function(t){return t},function(t,e){return nQ(tZ(),ix({position:"absolute",pointerEvents:"none",backgroundColor:"var(--qti-correct)",opacity:"0.5"}),t.coords,"correct-response-".concat(e+1),t.shape)}))}},{key:"reset",value:function t(){this._points=[]}},{key:"validate",value:function t(){return this._points.length>=this.minChoices&&this._points.length<=this.maxChoices}},{key:"value",get:function t(){return this._points},set:function t(t){this._points=Array.isArray(t)?t:t?[t]:[]}},{key:"calculateScale",value:function t(){this._imageWidthOrginal=this._imgElement.getAttribute("width")?parseFloat(this._imgElement.getAttribute("width")):this._imgElement.naturalWidth,this._imageHeightOrginal=this._imgElement.getAttribute("height")?parseFloat(this._imgElement.getAttribute("height")):this._imgElement.naturalHeight;var t=this._imgElement.getBoundingClientRect();this._scaleX=t.width===0?1:this._imageWidthOrginal/t.width,this._scaleY=t.height===0?1:this._imageHeightOrginal/t.height}},{key:"firstUpdated",value:function t(){this._imgElement=this.querySelector("img"),this._imgElement?(this.calculateScale(),this._imgElement.addEventListener("click",this._onImageClick)):console.warn("No <img> element found in <qti-select-point-interaction>")}},{key:"disconnectedCallback",value:function t(){h(f(e.prototype),"disconnectedCallback",this).call(this),window.removeEventListener("resize",this._onResize),this._imgElement&&this._imgElement.removeEventListener("click",this._onImageClick)}}]);return e}(rS);iw.styles=[e8(t1())],ej([r({type:Number,attribute:"max-choices"})],iw.prototype,"maxChoices",2),ej([r({type:Number,attribute:"min-choices"})],iw.prototype,"minChoices",2),ej([i()],iw.prototype,"_points",2),ej([i()],iw.prototype,"_correctAreas",2),iw=ej([rr("qti-select-point-interaction")],iw);var iA=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"checked",get:function t(){return this.internals.states.has("--checked")}},{key:"render",value:function t(){return nQ(t3(),this.marker?nQ(t2(),this.marker):nW)}}]);return e}(U(rt,"qti-simple-choice"));iA.styles=e8(t5()),ej([r({type:String,attribute:!1})],iA.prototype,"marker",2),iA=ej([rr("qti-simple-choice")],iA);var iC=e8(t4());var iq=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t._value=0;t._correctResponseNumber=null;t.min=0;t.max=100;t.step=1;return t}c(e,[{key:"validate",value:function t(){return!0}},{key:"connectedCallback",value:function t(){h(f(e.prototype),"connectedCallback",this).call(this),this._updateValue(this.min),this.setAttribute("tabindex","0"),this.setAttribute("role","slider")}},{key:"value",get:function t(){return this._value.toString()},set:function t(t){var e=parseInt(t,10);isNaN(e)||this._updateValue(e)}},{key:"toggleCorrectResponse",value:function t(t,e){if(e){this._correctResponse=t.correctResponse.toString();var n=parseFloat(t.correctResponse.toString());if(isNaN(n))this._correctResponseNumber=null;else{this._correctResponseNumber=n;var r=(this._correctResponseNumber-this.min)/(this.max-this.min)*100;this.style.setProperty("--value-percentage-correct","".concat(r,"%"))}}else this._correctResponseNumber=null;this.requestUpdate()}},{key:"_updateValue",value:function t(t){var e=this._value;if(this._value=Math.min(this.max,Math.max(this.min,t)),this._value===e)return;var n=(this._value-this.min)/(this.max-this.min)*100;this.style.setProperty("--value-percentage","".concat(n,"%")),this._internals.setFormValue(this.value),this.saveResponse(this.value),this.requestUpdate()}},{key:"render",value:function t(){return nQ(t9(),this.min,this.max,this._onMouseDown,this._onTouchStart,this.value,this._correctResponseNumber!==null?nQ(t6(),this._correctResponseNumber):null)}},{key:"_onMouseDown",value:function t(t){var e=this;this._startDrag(t.pageX);var n=function(t){return e._onDrag(t.pageX)},r=function(){document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",r),e._onDragEnd()};document.addEventListener("mousemove",n),document.addEventListener("mouseup",r)}},{key:"_onTouchStart",value:function t(t){var e=this;this._startDrag(t.touches[0].pageX);var n=function(t){return e._onDrag(t.touches[0].pageX)},r=function(){document.removeEventListener("touchmove",n),document.removeEventListener("touchend",r),e._onDragEnd()};document.addEventListener("touchmove",n,{passive:!1}),document.addEventListener("touchend",r)}},{key:"_startDrag",value:function t(t){this._onDrag(t)}},{key:"_onDrag",value:function t(t){var e=this._rail.getBoundingClientRect(),n=t-e.left,r=Math.min(1,Math.max(0,n/e.width)),i=this.min+Math.round(r*(this.max-this.min)/this.step)*this.step;this._updateValue(i)}},{key:"_onDragEnd",value:function t(){this.dispatchEvent(new Event("change",{bubbles:!0}))}}]);return e}(rS);iq.formAssociated=!0,iq.styles=iC,ej([l("#rail")],iq.prototype,"_rail",2),ej([r({type:Number,attribute:"lower-bound"})],iq.prototype,"min",2),ej([r({type:Number,attribute:"upper-bound"})],iq.prototype,"max",2),ej([r({type:Number,attribute:"step"})],iq.prototype,"step",2),iq=ej([rr("qti-slider-interaction")],iq);var iS=function(t,e){var n;var r=t._$AN;if(r===void 0)return!1;var i=true,o=false,a=undefined;try{for(var s=r[Symbol.iterator](),l;!(i=(l=s.next()).done);i=true){var u=l.value;(n=u._$AO)===null||n===void 0?void 0:n.call(u,e,!1),iS(u,e)}}catch(t){o=true;a=t}finally{try{if(!i&&s.return!=null){s.return()}}finally{if(o){throw a}}}return!0},iR=function(t){var e,n;do{if((e=t._$AM)===void 0)break;n=e._$AN,n.delete(t),t=e}while((n===null||n===void 0?void 0:n.size)===0)},iP=function(t){for(var e;e=t._$AM;t=e){var n=e._$AN;if(n===void 0)e._$AN=n=new Set;else if(n.has(t))break;n.add(t),iM(e)}};var iM=function(t){var e,n;t.type==rz.CHILD&&((e=t._$AP)!==null&&e!==void 0?e:t._$AP=eR,(n=t._$AQ)!==null&&n!==void 0?n:t._$AQ=eS)},iT=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments),t._$AN=void 0;return t}c(e,[{key:"_$AT",value:function t(t,n,r){h(f(e.prototype),"_$AT",this).call(this,t,n,r),iP(this),this.isConnected=t._$AU}},{key:"_$AO",value:function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;var n,r,i,o;t!==this.isConnected&&(this.isConnected=t,t?(n=(r=this).reconnected)===null||n===void 0?void 0:n.call(r):(i=(o=this).disconnected)===null||i===void 0?void 0:i.call(o)),e&&(iS(this,t),iR(this))}},{key:"setValue",value:function t(t){if(rX(this._$Ct))this._$Ct._$AI(t,this);else{var e=T(this._$Ct._$AH);e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}},{key:"disconnected",value:function t(){}},{key:"reconnected",value:function t(){}}]);return e}(rW);var iO=function(){return new i$},i$=function t(){"use strict";s(this,t)},iI=new WeakMap,iU=rB(/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(t){return nW}},{key:"update",value:function t(t,e){var n=S(e,1),r=n[0];var i;var o=r!==this.Y;return o&&this.Y!==void 0&&this.rt(void 0),(o||this.lt!==this.ct)&&(this.Y=r,this.ht=(i=t.options)===null||i===void 0?void 0:i.host,this.rt(this.ct=t.element)),nW}},{key:"rt",value:function t(t){if(this.isConnected||(t=void 0),typeof this.Y=="function"){var e;var n=(e=this.ht)!==null&&e!==void 0?e:globalThis,r=iI.get(n);r===void 0&&(r=new WeakMap,iI.set(n,r)),r.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),r.set(this.Y,t),t!==void 0&&this.Y.call(this.ht,t)}else this.Y.value=t}},{key:"lt",get:function t(){var t,e;var n;return typeof this.Y=="function"?(t=iI.get((n=this.ht)!==null&&n!==void 0?n:globalThis))===null||t===void 0?void 0:t.get(this.Y):(e=this.Y)===null||e===void 0?void 0:e.value}},{key:"disconnected",value:function t(){this.lt===this.ct&&this.rt(void 0)}},{key:"reconnected",value:function t(){this.rt(this.ct)}}]);return e}(iT));var iL=e8(t7());var iN=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t._value="";t.inputRef=iO();return t}c(e,[{key:"value",get:function t(){return this._value||null},set:function t(t){if(typeof t=="string"||t===null){this._value=t||"";var e=new FormData;e.append(this.responseIdentifier,this._value),this._internals.setFormValue(e),this.validate()}else throw new Error("Value must be a string")}},{key:"validate",value:function t(){var t=this.shadowRoot.querySelector("input");if(!t)return!1;if(this.patternMask&&this.dataPatternmaskMessage)this._internals.setValidity({}),t.setCustomValidity(""),t.checkValidity()||(this._internals.setValidity({customError:!0},this.dataPatternmaskMessage),t.setCustomValidity(this.dataPatternmaskMessage));else{var e=t.checkValidity();this._internals.setValidity(e?{}:{customError:!1})}return this._value!==""&&t.checkValidity()}},{key:"toggleCorrectResponse",value:function t(t,e){var n;var r=this.shadowRoot.querySelector("input");if(e&&t.correctResponse){var i,o;var a=t.correctResponse.toString();if(a){var s;if(!((s=r.nextElementSibling)===null||s===void 0?void 0:s.classList.contains("correct-option"))){var l=document.createElement("span");l.classList.add("correct-option"),l.textContent=a,l.style.border="1px solid var(--qti-correct)",l.style.borderRadius="4px",l.style.padding="2px 4px",l.style.margin="4px",l.style.display="inline-block",r.insertAdjacentElement("afterend",l)}}else((i=r.nextElementSibling)===null||i===void 0?void 0:i.classList.contains("correct-option"))&&((o=r.nextElementSibling)===null||o===void 0?void 0:o.remove())}else(n=r.nextElementSibling)===null||n===void 0?void 0:n.remove()}},{key:"render",value:function t(){var t=this;return nQ(t8(),this.responseIdentifier,function(e){t.reportValidity()},function(t){return t.stopImmediatePropagation()},this.textChanged,this.textChanged,this.patternMask=="[0-9]*"?"number":"text",rk(this.placeholderText?this.placeholderText:void 0),this._value,rk(this.patternMask?this.patternMask:void 0),1e3,this.disabled,this.readonly,this._correctResponse)}},{key:"textChanged",value:function t(t){if(this.disabled||this.readonly)return;var e=t.target;this.setEmptyAttribute(e.value),this._value!==e.value&&(this.value=e.value,this.saveResponse(e.value))}},{key:"reportValidity",value:function t(){var t=this.shadowRoot.querySelector("input");if(!t)return!1;var e=this.validate();return e||t.reportValidity(),e}},{key:"reset",value:function t(){this._value=""}},{key:"setEmptyAttribute",value:function t(t){this.setAttribute("empty",t===""?"true":"false")}}]);return e}(rS);iN.styles=iL,ej([r({type:Number,attribute:"expected-length"})],iN.prototype,"expectedLength",2),ej([r({type:String,attribute:"pattern-mask"})],iN.prototype,"patternMask",2),ej([r({type:String,attribute:"placeholder-text"})],iN.prototype,"placeholderText",2),ej([r({type:String,attribute:"data-patternmask-message"})],iN.prototype,"dataPatternmaskMessage",2),ej([i()],iN.prototype,"_value",2),iN=ej([rr("qti-text-entry-interaction")],iN);var iD=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t._file=null;t._base64=null;return t}c(e,[{key:"reset",value:function t(){this._file=null,this._base64=null,this.saveResponse(null)}},{key:"validate",value:function t(){return this._base64!==null}},{key:"value",get:function t(){return this._base64},set:function t(t){if(typeof t=="string")this._base64=t,this.saveResponse(t);else if(t===null)this.reset();else throw new Error("Value must be a Base64-encoded string or null")}},{key:"render",value:function t(){return nQ(et(),this._onFileChange,this.disabled,this.readonly)}},{key:"_onFileChange",value:function t(t){var e=this;return o(function(){var n,r;return L(this,function(i){switch(i.label){case 0:n=t.target;r=n.files&&n.files.length>0;if(!r)return[3,2];e._file=n.files[0];return[4,e._convertToBase64(e._file)];case 1:r=(e._base64=i.sent(),e.saveResponse(e._base64),e.dispatchEvent(new CustomEvent("qti-interaction-response",{detail:{response:e._base64}})));i.label=2;case 2:r;return[2]}})})()}},{key:"_convertToBase64",value:function t(t){return new Promise(function(e,n){var r=new FileReader;r.onload=function(){return e(r.result)},r.onerror=function(){return n(r.error)},r.readAsDataURL(t)})}}],[{key:"properties",get:function t(){return k({},rS.properties)}}]);return e}(rS);iD.styles=[e8(ee())],iD=ej([rr("qti-upload-interaction")],iD);var iV=e8(en());var ij=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nQ(er())}}]);return e}(rt);ij.styles=iV,ij=ej([rr("qti-item-body")],ij);var iH=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nQ(ei())}},{key:"process",value:function t(){var t=new iQ,e=T(this.children);t.process(e)}}]);return e}(rt);iH.styles=[e8(eo())],iH=ej([rr("qti-outcome-processing")],iH);var iQ=/*#__PURE__*/function(){"use strict";function t(){s(this,t)}c(t,[{key:"process",value:function t(t){var e=true,n=false,r=undefined;try{for(var i=t[Symbol.iterator](),o;!(e=(o=i.next()).done);e=true){var a=o.value;a.process()}}catch(t){n=true;r=t}finally{try{if(!e&&i.return!=null){i.return()}}finally{if(n){throw r}}}}}]);return t}();var iF=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nQ(ea())}},{key:"connectedCallback",value:function t(){this.parentElement.tagName.endsWith("INTERACTION")&&this.setAttribute("slot","prompt")}}]);return e}(rt);iF=ej([rr("qti-prompt")],iF);var iz='<qti-response-processing>\n <qti-response-condition>\n <qti-response-if>\n <qti-match>\n <qti-variable identifier="RESPONSE"></qti-variable>\n <qti-correct identifier="RESPONSE"></qti-correct>\n </qti-match>\n <qti-set-outcome-value identifier="SCORE">\n <qti-base-value base-type="float">1</qti-base-value>\n </qti-set-outcome-value>\n </qti-response-if>\n <qti-response-else>\n <qti-set-outcome-value identifier="SCORE">\n <qti-base-value base-type="float">0</qti-base-value>\n </qti-set-outcome-value>\n </qti-response-else>\n </qti-response-condition>\n</qti-response-processing>',iB='<qti-response-processing>\n <qti-response-condition>\n <qti-response-if>\n <qti-is-null>\n <qti-variable identifier="RESPONSE"></qti-variable>\n </qti-is-null>\n <qti-set-outcome-value identifier="SCORE">\n <qti-base-value base-type="float">0.0</qti-base-value>\n </qti-set-outcome-value>\n </qti-response-if>\n <qti-response-else>\n <qti-set-outcome-value identifier="SCORE">\n <qti-map-response identifier="RESPONSE"> </qti-map-response>\n </qti-set-outcome-value>\n </qti-response-else>\n </qti-response-condition>\n</qti-response-processing>',iW='<qti-response-processing>\n <qti-response-condition>\n <qti-response-if>\n <qti-is-null>\n <qti-variable identifier="RESPONSE"></qti-variable>\n </qti-is-null>\n <qti-set-outcome-value identifier="SCORE">\n <qti-base-value base-type="float">0</qti-base-value>\n </qti-set-outcome-value>\n </qti-response-if>\n <qti-response-else>\n <qti-set-outcome-value identifier="SCORE">\n <qti-map-response-point identifier="RESPONSE"></qti-map-response-point>\n </qti-set-outcome-value>\n </qti-response-else>\n </qti-response-condition>\n</qti-response-processing>';var iY=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nQ(es())}},{key:"process",value:function t(){if(!this.closest("qti-assessment-item"))return;var t=T(this.children);var e=true,n=false,r=undefined;try{for(var i=t[Symbol.iterator](),o;!(e=(o=i.next()).done);e=true){var a=o.value;a.process()}}catch(t){n=true;r=t}finally{try{if(!e&&i.return!=null){i.return()}}finally{if(n){throw r}}}}},{key:"firstUpdated",value:function t(t){if(this.getAttribute("template")){var e=this.getAttribute("template").split("/"),n=e[e.length-1].replace(".xml","");switch(this.innerHTML="",n){case"map_response":{this.appendChild(this.fragmentFromString(iB).firstElementChild.firstElementChild);break}case"map_response_point":{this.appendChild(this.fragmentFromString(iW).firstElementChild.firstElementChild);break}case"match_correct":this.appendChild(this.fragmentFromString(iz).firstElementChild.firstElementChild);break}}}},{key:"fragmentFromString",value:function t(t){return document.createRange().createContextualFragment(t)}}]);return e}(rt);iY.styles=[e8(el())],iY=ej([rr("qti-response-processing")],iY);var iX=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nQ(eu())}},{key:"process",value:function t(){throw new Error("Not implemented")}}]);return e}(rt);iX=ej([rr("qti-rule")],iX);var iJ=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"childExpression",get:function t(){return this.firstElementChild}},{key:"process",value:function t(){var t=this.getAttribute("identifier"),e=this.closest("qti-assessment-item").getVariable(t),n;return e.interpolationTable&&(n=e.interpolationTable.get(parseInt(this.childExpression.calculate()))),n==null?(console.warn("lookupOutcomeValue: value is null or undefined"),0):(this.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:this.identifier,value:rg(n)}})),n)}}]);return e}(iX);ej([r({type:String})],iJ.prototype,"identifier",2);customElements.define("qti-lookup-outcome-value",iJ);var iG=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nQ(ec())}},{key:"process",value:function t(){var t=T(this.children);for(var e=0;e<t.length;e++){var n=t[e];if(n.calculate()){n.process();return}}}}]);return e}(iX);customElements.define("qti-response-condition",iG);var iK=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"process",value:function t(){var t=this.getAttribute("identifier");if(!t){console.warn('QtiSetOutcomeValue: Missing "identifier" attribute.');return}var e=this.firstElementChild;if(!e){console.warn("QtiSetOutcomeValue: No expression found.");return}var n=new iZ(e).process();this.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:t,value:this.formatValue(n)}}))}},{key:"formatValue",value:function t(t){return Array.isArray(t)?t.map(rg):t!==null?rg(t):null}}]);return e}(iX),iZ=/*#__PURE__*/function(){"use strict";function t(e){s(this,t);this.expression=e}c(t,[{key:"process",value:function t(){var t;var e=(t=this.expression.calculate())!==null&&t!==void 0?t:null;return e===null&&console.warn("QtiSetOutcomeValueRule: Evaluated value is null."),Array.isArray(e)?e.map(function(t){return t.value?t.value:t}):e}}]);return t}();customElements.define("qti-set-outcome-value",iK);var i0=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nQ(ed())}},{key:"calculate",value:function t(){return!0}},{key:"getSubRules",value:function t(){return T(this.children)}},{key:"process",value:function t(){var t=this.getSubRules();for(var e=0;e<t.length;e++)t[e].process()}}]);return e}(rt);customElements.define("qti-response-else",i0);var i1=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"calculate",value:function t(){return this.firstElementChild.calculate()}},{key:"getSubRules",value:function t(){var t=[];for(var e=1;e<this.children.length;e++)t.push(this.children[e]);return t}}]);return e}(i0);customElements.define("qti-response-if",i1);var i2=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nQ(eh(),h(f(e.prototype),"render",this).call(this))}}]);return e}(i1);customElements.define("qti-response-else-if",i2);var i3=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.getVariables=function(){return Array.from(t.children).map(function(e){switch(e.tagName.toLowerCase()){case"qti-base-value":return{baseType:e.getAttribute("base-type"),value:e.textContent.trim(),cardinality:"single"};case"qti-variable":{var n=e.getAttribute("identifier")||"";return t.context.variables.find(function(t){return t.identifier===n})||null}case"qti-multiple":{var r=e.getResult();return r.length>0?{identifier:"",baseType:r[0].baseType,value:r.map(function(t){return t.value}),cardinality:"multiple",type:"response"}:null}case"qti-correct":{var i=e.getAttribute("identifier")||"",o=t.context.variables.find(function(t){return t.identifier===i})||null;return{baseType:o.baseType,value:o.correctResponse,cardinality:o.cardinality}}default:{try{return{baseType:"integer",value:e.getResult().toString(),cardinality:"single"}}catch(t){console.warn("default not sufficient")}return null}}}).filter(function(t){return t!==null})};return t}c(e,[{key:"render",value:function t(){return nQ(ef(),JSON.stringify(this.result,null,2))}},{key:"calculate",value:function t(){return this.result=this.getResult(),this.result}},{key:"getResult",value:function t(){throw new Error("Not implemented")}}]);return e}(rt);i3.styles=e8(ev()),ej([i()],i3.prototype,"result",2),ej([e({context:rs,subscribe:!0}),i()],i3.prototype,"context",2);var i5=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"calculate",value:function t(){return this.result=this.getResult(),this.result}},{key:"getResult",value:function t(){throw new Error("Not implemented")}}]);return e}(i3);var i4=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"calculate",value:function t(){return this.calculateChildren(Array.from(this.children))}}]);return e}(eP(i5));i4=ej([rr("qti-and")],i4);var i6=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.baseType="string";return t}c(e,[{key:"getResult",value:function t(){return this.textContent.trim()}}]);return e}(i3);ej([r({type:String,attribute:"base-type"})],i6.prototype,"baseType",2);customElements.define("qti-base-value",i6);var i9=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){var t=this.getVariables();if(this.children.length===2){var e=t[0],n=t[1];if(e.baseType==="directedPair"&&n.baseType==="directedPair"&&e.cardinality==="multiple"){var r=e.value,i=n.value;return r.filter(function(t){return i.includes(t)}).length>0}else if(e.baseType==="directedPair"&&n.baseType==="directedPair"&&e.cardinality==="single"){var o=e.value;return n.value.includes(o)}else console.error("unsupported baseType or cardinality in qti contains, only baseType: directedPair and cardinality: multiple is supported")}else console.error("unexpected number of children in qti contains");return!1}}]);return e}(i5);customElements.define("qti-contains",i9);var i7=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"interpretation",get:function t(){return this.getAttribute("interpretation")||""}},{key:"getResult",value:function t(){var t=this.getAttribute("identifier")||"",e=this.context.variables.find(function(e){return e.identifier===t})||null;return e.cardinality!=="single"?e.correctResponse.length>0?e.correctResponse[0]:"":e.correctResponse}}]);return e}(i3);customElements.define("qti-correct",i7);var i8=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.roundingMode="significantFigures";return t}c(e,[{key:"figures",get:function t(){if(!this.getAttribute("figures"))return console.error("figures attribute is missing"),null;var t=parseInt(this.getAttribute("figures")||"0");return isNaN(t)?(console.error("figures attribute is not a number"),null):t<0?(console.error("figures attribute is negative"),null):t<1&&this.roundingMode==="significantFigures"?(console.error("figures cannot be smaller than 1 for RoundingMode significantFigures"),null):t}},{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),e=t[0],n=t[1];if(this.roundingMode===null)return null;if(e.cardinality!=="single"||n.cardinality!=="single"||Array.isArray(e.value)||Array.isArray(n.value))return console.error("unexpected cardinality in qti equal"),!1;switch(t[0].baseType){case"integer":case"float":{var r=parseFloat(e.value),i=parseFloat(n.value);if(!isNaN(r)&&!isNaN(i))return this.roundingMode==="significantFigures"?r.toPrecision(this.figures)===i.toPrecision(this.figures):Math.round(r*Math.pow(10,this.figures))/Math.pow(10,this.figures)===Math.round(i*Math.pow(10,this.figures))/Math.pow(10,this.figures);console.error("value cannot be casted to numeric value in equalRounded operator: ".concat(r,", ").concat(i));break}default:{console.error("values other than float and int cannot be used in equalRounded operator.");break}}return!1}return console.error("unexpected number of children in qti-equal-rounded"),null}}]);return e}(i3);ej([r({type:String})],i8.prototype,"roundingMode",2);customElements.define("qti-equal-rounded",i8);var ot=/*#__PURE__*/function(){"use strict";function t(){s(this,t)}c(t,null,[{key:"isPointInArea",value:function t(t,e,n){if(n!=="point")return console.warn("Base type ".concat(n," is not supported for point area mapping.")),!1;var r=S(t.split(" ").map(Number),2),i=r[0],o=r[1],a=M(e.split(",")),s=a[0],l=a.slice(1),u=l.map(Number);switch(s.toLowerCase()){case"circle":case"default":{var c=S(u,3),d=c[0],h=c[1],f=c[2];return u.length!==3?(console.warn("Invalid circle definition: ".concat(e)),!1):Math.sqrt(Math.pow(i-d,2)+Math.pow(o-h,2))<=f}case"rect":{var v=S(u,4),p=v[0],y=v[1],m=v[2],g=v[3];return u.length!==4?(console.warn("Invalid rectangle definition: ".concat(e)),!1):i>=p&&i<=m&&o>=y&&o<=g}case"ellipse":{var b=S(u,4),_=b[0],k=b[1],E=b[2],x=b[3];if(u.length!==4)return console.warn("Invalid ellipse definition: ".concat(e)),!1;var w=Math.pow(i-_,2)/Math.pow(E,2),A=Math.pow(o-k,2)/Math.pow(x,2);return w+A<=1}case"poly":{if(u.length<6||u.length%2!==0)return console.warn("Invalid polygon definition: ".concat(e)),!1;var C=[];for(var q=0;q<u.length;q+=2)C.push({x:u[q],y:u[q+1]});return this.isPointInPolygon({x:i,y:o},C)}default:return console.warn("Unsupported shape type: ".concat(s)),!1}}},{key:"isPointInPolygon",value:function t(t,e){var n=!1;for(var r=0,i=e.length-1;r<e.length;i=r++){var o=e[r].x,a=e[r].y,s=e[i].x,l=e[i].y;a>t.y!=l>t.y&&t.x<(s-o)*(t.y-a)/(l-a)+o&&(n=!n)}return n}},{key:"compareSingleValues",value:function t(t,e,n){switch(n){case"identifier":case"string":return t===e;case"integer":{var r=parseInt(t,10),i=parseInt(e,10);if(!isNaN(r)&&!isNaN(i))return r===i;console.error("Cannot convert ".concat(t," and/or ").concat(e," to int."));break}case"float":{var o=parseFloat(t),a=parseFloat(e);if(!isNaN(o)&&!isNaN(a))return o===a;console.error("couldn't convert ".concat(t," and/or ").concat(e," to float."));break}case"pair":case"directedPair":{var s=t.split(" ").sort(),l=e.split(" ").sort();if(s.length===2&&l.length===2)return n==="pair"&&(s.sort(),l.sort()),s.join(" ")===l.join(" ");console.error("compared two pair but one of the values does not have 2 values: 1: ".concat(t," 2: ").concat(e));break}}return!1}}]);return t}();var oe=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.toleranceMode="exact";return t}c(e,[{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),e=t[0],n=t[1];return this.toleranceMode!=="exact"?(console.error("toleranceMode is not supported yet"),!1):e.cardinality!=="single"||n.cardinality!=="single"||Array.isArray(e.value)||Array.isArray(n.value)?(console.error("unexpected cardinality in qti equal"),!1):ot.compareSingleValues(e.value,n.value,e.baseType)}return console.error("unexpected number of children in qti-equal"),null}}]);return e}(i3);ej([r({type:String})],oe.prototype,"toleranceMode",2);customElements.define("qti-equal",oe);var on=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),e=t[0],n=t[1];if((e.baseType==="integer"||e.baseType==="float")&&(n.baseType==="integer"||n.baseType==="float"))return+e.value>+n.value;console.error("unexpected baseType or cardinality in qti gt")}return console.error("unexpected number of children in qt"),null}}]);return e}(i3);customElements.define("qti-gt",on);var or=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),e=t[0],n=t[1];return(e.baseType==="integer"||e.baseType==="float")&&(n.baseType==="integer"||n.baseType==="float")?+e.value>=+n.value:(console.error("unexpected baseType or cardinality in qti gte"),null)}return console.log("unexpected number of children in qte"),null}}]);return e}(i5);customElements.define("qti-gte",or);var oi=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){if(this.children.length===1){var t=this.getVariables();if(!t)return!0;var e=t[0].value;return e==null||e==null||e===""}return console.error("unexpected number of children in qti Null"),null}}]);return e}(i3);customElements.define("qti-is-null",oi);var oo=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),e=t[0],n=t[1];if((e.baseType==="integer"||e.baseType==="float")&&(n.baseType==="integer"||n.baseType==="float"))return+e.value<+n.value;console.error("unexpected baseType or cardinality in qti lt")}return console.error("unexpected number of children in lt"),null}}]);return e}(i3);customElements.define("qti-lt",oo);var oa=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),e=t[0],n=t[1];return(e.baseType==="integer"||e.baseType==="float")&&(n.baseType==="integer"||n.baseType==="float")?+e.value<=+n.value:(console.error("unexpected baseType or cardinality in qti lte"),null)}return console.log("unexpected number of children in lte"),null}}]);return e}(i5);customElements.define("qti-lte",oa);var os=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){var t=this;var e=this.context.variables.find(function(e){return e.identifier===t.identifier});if(!e||!e.mapping)return console.error("Response ".concat(this.identifier," can not be found")),null;var n=e.mapping,r=Array.isArray(e.value)?e.value:[e.value],i=0;var o=true,a=false,s=undefined;try{var l=function(){var t=c.value;var r=n.mapEntries.filter(function(n){return e.baseType==="string"&&!n.caseSensitive?ot.compareSingleValues(n.mapKey.toLowerCase(),t.toLowerCase(),e.baseType):ot.compareSingleValues(n.mapKey,t,e.baseType)}),o=r.reduce(function(t,e){return t.mappedValue>e.mappedValue?t:e},r.length>0?r[0]:{mapKey:null,mappedValue:null});o===null||o.mappedValue==null?i+=n.defaultValue:i+=o.mappedValue};for(var u=r[Symbol.iterator](),c;!(o=(c=u.next()).done);o=true)l()}catch(t){a=true;s=t}finally{try{if(!o&&u.return!=null){u.return()}}finally{if(a){throw s}}}return(n===null||n===void 0?void 0:n.lowerBound)!==null&&(n===null||n===void 0?void 0:n.lowerBound)!==void 0&&(i=Math.max(n.lowerBound,i)),(n===null||n===void 0?void 0:n.upperBound)!==null&&(n===null||n===void 0?void 0:n.upperBound)!==void 0&&(i=Math.min(n.upperBound,i)),i}}]);return e}(i3);ej([r({type:String})],os.prototype,"identifier",2);customElements.define("qti-map-response",os);var ol=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.getVariables=function(){return Array.from(t.children).map(function(e){switch(e.tagName.toLowerCase()){case"qti-base-value":return{baseType:e.getAttribute("base-type"),value:e.textContent.trim(),cardinality:"single"};case"qti-variable":{var n=e.getAttribute("identifier")||"";return t.context.variables.find(function(t){return t.identifier===n})||null}case"qti-multiple":{var r=e.getResult();return r.length>0?{identifier:"",baseType:r[0].baseType,value:r.map(function(t){return t.value}),cardinality:"multiple",type:"response"}:null}case"qti-correct":{var i=e.getAttribute("identifier")||"",o=t.context.variables.find(function(t){return t.identifier===i})||null;return{baseType:o.baseType,value:o.correctResponse,cardinality:o.cardinality}}default:{try{return{baseType:"integer",value:e.getResult().toString(),cardinality:"single"}}catch(t){console.warn("default not sufficient")}return null}}}).filter(function(t){return t!==null})};return t}c(e,[{key:"render",value:function t(){return nQ(ep(),JSON.stringify(this.result,null,2))}},{key:"calculate",value:function t(){return this.result=this.getResult(),this.result}},{key:"getResult",value:function t(){throw new Error("Not implemented")}}]);return e}(rt);ol.styles=e8(ey()),ej([i()],ol.prototype,"result",2),ej([e({context:rs,subscribe:!0}),i()],ol.prototype,"context",2);var ou=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){var t=this;var e=this.context.variables.find(function(e){return e.identifier===t.identifier});if(!e)return console.warn("Response ".concat(this.identifier," cannot be found")),null;var n=e.areaMapping;if(!n)return console.warn("Area mapping not found for response ".concat(this.identifier)),null;var r=Array.isArray(e.value)?e.value:[e.value];if(!r||r.length===0)return console.warn("No candidate responses for response ".concat(this.identifier)),null;var i=0,o=new Set;var a=true,s=false,l=undefined,u=true,c=false,d=undefined;try{for(var h=r[Symbol.iterator](),f;!(u=(f=h.next()).done);u=true){var v=f.value;try{for(var p=n.areaMapEntries[Symbol.iterator](),y;!(a=(y=p.next()).done);a=true){var m=y.value;if(o.has(m.coords))continue;var g;ot.isPointInArea(v,"".concat(m.shape,",").concat(m.coords),e.baseType)&&(i+=(g=m.mappedValue)!==null&&g!==void 0?g:0,o.add(m.coords))}}catch(t){s=true;l=t}finally{try{if(!a&&p.return!=null){p.return()}}finally{if(s){throw l}}}}}catch(t){c=true;d=t}finally{try{if(!u&&h.return!=null){h.return()}}finally{if(c){throw d}}}return o.size<r.length&&(i+=n.defaultValue),n.lowerBound!=null&&(i=Math.max(n.lowerBound,i)),n.upperBound!=null&&(i=Math.min(n.upperBound,i)),i}}]);return e}(ol);ej([r({type:String})],ou.prototype,"identifier",2);customElements.define("qti-map-response-point",ou);var oc=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),n=t[0],r=t[1];return e.match(n,r)}return console.error("unexpected number of children in match"),null}}],[{key:"match",value:function t(t,e){switch(e.cardinality){case"single":var n;return t.value===null?!1:Array.isArray(t.value)||Array.isArray(e.value)?(console.error("unexpected cardinality in qti match"),!1):ot.compareSingleValues((n=t.value)===null||n===void 0?void 0:n.toString(),e.value.toString(),e.baseType);case"ordered":{if(!Array.isArray(t.value)||!Array.isArray(e.value))return console.error("unexpected cardinality in qti match"),!1;if(t.value.length!==e.value.length)return!1;for(var r=0;r<t.value.length;r++)if(!ot.compareSingleValues(e.value[r],t.value[r],e.baseType))return!1;return!0}case"multiple":{if(!Array.isArray(t.value)||!Array.isArray(e.value))return console.error("unexpected cardinality in qti match"),!1;if(t.value.length!==e.value.length)return!1;var i=0;var o=true,a=false,s=undefined;try{for(var l=e.value[Symbol.iterator](),u;!(o=(u=l.next()).done);o=true){var c=u.value;var d=null,h=T(t.value);var f=true,v=false,p=undefined;try{for(var y=h[Symbol.iterator](),m;!(f=(m=y.next()).done);f=true){var g=m.value;if(ot.compareSingleValues(c,g,e.baseType)){d=g;break}}}catch(t){v=true;p=t}finally{try{if(!f&&y.return!=null){y.return()}}finally{if(v){throw p}}}if(d!==null)h.splice(h.indexOf(d),1);else return!1;i++}}catch(t){a=true;s=t}finally{try{if(!o&&l.return!=null){l.return()}}finally{if(a){throw s}}}return!0}default:return console.error("unexpected cardinality in qti match"),!1}}}]);return e}(i3);customElements.define("qti-match",oc);var od=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){var t=this.getVariables();this.children.length!==2&&console.warn("The member operator takes two sub-expressions");var e=S(t,2),n=e[0],r=e[1];if(n.baseType===r.baseType||n.baseType==="integer"&&r.baseType==="float"||n.baseType==="float"&&r.baseType==="integer"||console.warn("Which must both have the same base-type"),r.cardinality==="multiple"||r.cardinality==="ordered"||console.warn("and the second must be a multiple or ordered container"),(n.baseType==="float"||r.baseType==="float")&&console.warn("The member operator should not be used on sub-expressions with a base-type of float"),(n.baseType==="duration"||r.baseType==="duration")&&console.warn("It must not be used on sub-expressions with a base-type of duration"),n.value===null||r.value===null)return null;var i=n.value;return r.value.includes(i)}}]);return e}(i3);customElements.define("qti-member",od);var oh=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){var t=this.getVariables();if(t.length===0)return console.error("unexpected number of children in qti multiple"),null;var e=true,n=false,r=undefined;try{for(var i=t[Symbol.iterator](),o;!(e=(o=i.next()).done);e=true){var a=o.value;if(a.cardinality!=="multiple"&&a.cardinality!=="single")return console.error("unexpected cardinality in qti multiple"),[]}}catch(t){n=true;r=t}finally{try{if(!e&&i.return!=null){i.return()}}finally{if(n){throw r}}}return t}}]);return e}(i3);customElements.define("qti-multiple",oh);var of=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nQ(em(),h(f(e.prototype),"render",this).call(this))}},{key:"getResult",value:function t(){return!this.firstElementChild.calculate()}}]);return e}(i3);customElements.define("qti-not",of);var ov=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){return Array.from(this.children).map(function(t){var e=t;if(!e.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;var n=e.calculate(),r=!1;if(typeof n=="string")if(n==="true")r=!0;else if(n==="false")r=!1;else return console.error("unexpected val in qti-or, expected boolean"),null;else typeof n=="boolean"&&(r=n);return r}).some(function(t){return typeof t=="boolean"&&t})}}]);return e}(i5);customElements.define("qti-or",ov);var op=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){var t=this.getVariables();if(t.length===0)return console.error("unexpected number of children in qti multiple"),null;var e=true,n=false,r=undefined;try{for(var i=t[Symbol.iterator](),o;!(e=(o=i.next()).done);e=true){var a=o.value;if(a.cardinality!=="ordered"&&a.cardinality!=="single")return console.error("unexpected cardinality in qti ordered"),[]}}catch(t){n=true;r=t}finally{try{if(!e&&i.return!=null){i.return()}}finally{if(n){throw r}}}return t}}]);return e}(i3);customElements.define("qti-ordered",op);var oy=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){var t=this;var e,n;var r=(n=this.context)===null||n===void 0?void 0:(e=n.variables.find(function(e){return e.identifier===t.identifier}))===null||e===void 0?void 0:e.value;return r===null?nW:nQ(eg(),JSON.stringify(r,null,2))}},{key:"calculate",value:function t(){var t=this;return this.context.variables.find(function(e){return e.identifier===t.identifier})||null}}]);return e}(rt);ej([r({type:String})],oy.prototype,"identifier",2),ej([e({context:rs,subscribe:!0}),i()],oy.prototype,"context",2);customElements.define("qti-printed-variable",oy);var om=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){return this.getVariables().reduce(function(t,e){if(e.baseType=="float"||e.baseType=="integer")try{return t*parseInt(e.value.toString())}catch(t){console.warn("can not convert to number")}else console.warn("has another baseType ".concat(e.baseType));return t},1)}}]);return e}(i3);customElements.define("qti-product",om);var og=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){return this.calculateChildren(Array.from(this.children))}}]);return e}(eM(i3));customElements.define("qti-subtract",og);var ob=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.caseSensitive="true";return t}c(e,[{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),e=t[0],n=t[1];if(e.cardinality!=="single"||n.cardinality!=="single"||Array.isArray(e.value)||Array.isArray(n.value))return console.error("unexpected cardinality in qti string-match"),!1;var r=this.caseSensitive==="true"?e.value:e.value.toLowerCase(),i=this.caseSensitive==="true"?n.value:n.value.toLowerCase();return ot.compareSingleValues(r,i,e.baseType)}return console.error("unexpected number of children in qti-string-match"),null}}]);return e}(i3);ej([r({type:String,attribute:"case-sensitive"})],ob.prototype,"caseSensitive",2);customElements.define("qti-string-match",ob);var o_=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e),t._expression=new ok(Array.from(t.children));return t}c(e,[{key:"getResult",value:function t(){return this._expression.calculate()}}]);return e}(i3),ok=/*#__PURE__*/function(){"use strict";function t(e){s(this,t);this.expressions=e}c(t,[{key:"calculate",value:function t(){return this.expressions.map(function(t){if(!t.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;var e=t.calculate();return Number.isNaN(e)?(console.error("unexpected value in qti-sum, expected number"),null):Number(e)}).reduce(function(t,e){return t+e},0)}}]);return t}();customElements.define("qti-sum",o_);var oE=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){var t=this.getAttribute("identifier");return this.context.variables.find(function(e){return e.identifier===t}).value}}]);return e}(i3);customElements.define("qti-variable",oE);var ox=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){var t=this.getVariables();if(t.length===1){var e=t[0].value;if(Array.isArray(e)){var n=Math.floor(Math.random()*e.length);return e[n]}return e}return console.error("unexpected number of children in match"),null}}]);return e}(i3);customElements.define("qti-random",ox);var ow=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),e=t[0],n=t[1];return e.cardinality!=="single"||!Array.isArray(n.value)?(console.error("unexpected cardinality in qti equal"),null):t[0].baseType!==t[1].baseType?(console.error("The baseType of the two variables is different"),null):n.value.filter(function(t){return!e.value.includes(t)})}}}]);return e}(ol);customElements.define("qti-delete",ow);var oA=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nQ(eb())}}]);return e}(rt);oA=ej([rr("qti-content-body")],oA);var oC=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"handleclassNamesChange",value:function t(){var t=this;this.classNames.split(" ").forEach(function(e){switch(e){case"qti-rubric-discretionary-placement":t.setAttribute("slot","qti-rubric-block");break;case"qti-rubric-inline":t.setAttribute("slot","");break;default:break}})}},{key:"render",value:function t(){return nQ(e_())}}]);return e}(rt);oC.styles=e8(ek()),ej([r({type:String})],oC.prototype,"id",2),ej([r({type:String})],oC.prototype,"use",2),ej([r({type:String})],oC.prototype,"view",2),ej([r({type:String,attribute:"class"})],oC.prototype,"classNames",2),ej([d("classNames",{waitUntilFirstUpdate:!0})],oC.prototype,"handleclassNamesChange",1),oC=ej([rr("qti-rubric-block")],oC);var oq=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.styleElement=null;return t}c(e,[{key:"firstUpdated",value:function t(t){var n=this;h(f(e.prototype),"firstUpdated",this).call(this,t);var r=this.getAttribute("href");if(r!==null&&fetch(r).then(function(t){return t.text()}).then(function(t){var e=n.minifyCss(t);n.styleElement=document.createElement("style"),n.styleElement.media="screen",n.styleElement.textContent="@scope {".concat(e,"}"),n.parentElement?n.parentElement.appendChild(n.styleElement):console.warn("No parent element to append the scoped stylesheet to.")}).catch(function(t){console.error("Failed to load stylesheet:",t)}),this.textContent!==null&&this.textContent.trim()!==""){var i=this.minifyCss(this.textContent);this.styleElement=document.createElement("style"),this.styleElement.media="screen",this.styleElement.textContent="@scope {".concat(i,"}"),this.parentElement?this.parentElement.appendChild(this.styleElement):console.warn("No parent element to append the scoped stylesheet to.")}}},{key:"minifyCss",value:function t(t){return t.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\s+/g," ").replace(/\s*([{}:;])\s*/g,"$1").trim()}},{key:"disconnectedCallback",value:function t(){if(this.styleElement)try{this.styleElement.remove()}catch(t){console.error("Could not remove stylesheet:",t)}h(f(e.prototype),"disconnectedCallback",this).call(this)}}]);return e}(rt);oq=ej([rr("qti-stylesheet")],oq);var oS=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nQ(eE())}},{key:"defaultValues",value:function t(t){var e=Array.from(this.querySelectorAll("qti-default-value > qti-value"));if(e.length===0)return null;var n=e.map(function(t){return t.innerHTML.trim()});return n.length>1||t.cardinality==="multiple"||t.cardinality==="ordered"?n:n[0]}}]);return e}(rt);oS=ej([rr("qti-variabledeclaration")],oS);var oR=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.externalScored=null;return t}c(e,[{key:"render",value:function t(){var t=this;var e,n;var r=(n=this.itemContext)===null||n===void 0?void 0:(e=n.variables.find(function(e){return e.identifier===t.identifier}))===null||e===void 0?void 0:e.value;return nQ(ex(),JSON.stringify(r,null,2))}},{key:"interpolationTable",get:function t(){var t=this.querySelector("qti-interpolation-table");if(t){var e=new Map;var n=true,r=false,i=undefined;try{for(var o=t.querySelectorAll("qti-interpolation-table-entry")[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){var s=a.value;!s.getAttribute("source-value")&&s.getAttribute("target-value")&&console.error("source-value or target-value is missing in qti-interpolation-table-entry");var l=parseInt(s.getAttribute("source-value")),u=parseInt(s.getAttribute("target-value"));(isNaN(l)||isNaN(u))&&console.error("source-value or target-value is not a number in qti-interpolation-table-entry"),e.set(l,u)}}catch(t){r=true;i=t}finally{try{if(!n&&o.return!=null){o.return()}}finally{if(r){throw i}}}return e}return null}},{key:"connectedCallback",value:function t(){h(f(e.prototype),"connectedCallback",this).call(this);var t={identifier:this.identifier,cardinality:this.cardinality,baseType:this.baseType,type:"outcome",value:null,interpolationTable:this.interpolationTable,externalScored:this.externalScored};t.value=this.defaultValues(t),(t.value===null||t.value==null)&&(t.baseType==="integer"||t.baseType==="float")&&(t.value="0"),this.dispatchEvent(new CustomEvent("qti-register-variable",{bubbles:!0,composed:!0,detail:{variable:t}}))}}]);return e}(oS);oR.styles=[e8(ew())],ej([r({type:String,attribute:"base-type"})],oR.prototype,"baseType",2),ej([r({type:String,attribute:"external-scored"})],oR.prototype,"externalScored",2),ej([r({type:String})],oR.prototype,"identifier",2),ej([r({type:String})],oR.prototype,"cardinality",2),ej([e({context:rs,subscribe:!0}),i()],oR.prototype,"itemContext",2),oR=ej([rr("qti-outcome-declaration")],oR);var oP=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){var t=this;var e,n;var r=(n=this.itemContext)===null||n===void 0?void 0:(e=n.variables.find(function(e){return e.identifier===t.identifier}))===null||e===void 0?void 0:e.value;return nQ(eA(),JSON.stringify(r,null,2))}},{key:"connectedCallback",value:function t(){h(f(e.prototype),"connectedCallback",this).call(this);var t={baseType:this.baseType,identifier:this.identifier,correctResponse:this.correctResponse,cardinality:this.cardinality||"single",mapping:this.mapping,areaMapping:this.areaMapping,value:null,type:"response",candidateResponse:null};t.value=this.defaultValues(t),this.dispatchEvent(new CustomEvent("qti-register-variable",{bubbles:!0,composed:!0,detail:{variable:t}}))}},{key:"correctResponse",get:function t(){var t,e=this.querySelector("qti-correct-response");if(e){var n=e.querySelectorAll("qti-value");if(this.cardinality==="single"&&n.length>0)t=n[0].textContent.trim(),n[0].remove();else if(this.cardinality!=="single"){t=[];for(var r=0;r<n.length;r++)t.push(n[r].textContent.trim()),n[r].remove()}}return t}},{key:"mapping",get:function t(){var t=this.querySelector("qti-mapping"),e=parseInt(t===null||t===void 0?void 0:t.getAttribute("lower-bound")),n=parseInt(t===null||t===void 0?void 0:t.getAttribute("upper-bound"));return{defaultValue:Number(t===null||t===void 0?void 0:t.getAttribute("default-value"))||0,lowerBound:isNaN(e)?null:e,upperBound:isNaN(n)?null:n,mapEntries:Array.from((t===null||t===void 0?void 0:t.querySelectorAll("qti-map-entry"))||[]).map(function(t){return{mapKey:t.getAttribute("map-key")||"",mappedValue:Number(t.getAttribute("mapped-value"))||0,caseSensitive:t.hasAttribute("case-sensitive")?t.getAttribute("case-sensitive")!=="false":!0}})}}},{key:"areaMapping",get:function t(){var t=this.querySelector("qti-area-mapping"),e=Number(t===null||t===void 0?void 0:t.getAttribute("default-value"))||0,n=parseInt(t===null||t===void 0?void 0:t.getAttribute("lower-bound")),r=parseInt(t===null||t===void 0?void 0:t.getAttribute("upper-bound")),i=Array.from((t===null||t===void 0?void 0:t.querySelectorAll("qti-area-map-entry"))||[]).map(function(t){return{shape:t.getAttribute("shape")||"default",coords:t.getAttribute("coords")||"",mappedValue:Number(t.getAttribute("mapped-value"))||0,defaultValue:Number(t.getAttribute("default-value"))||0}});return{defaultValue:e,lowerBound:isNaN(n)?null:n,upperBound:isNaN(r)?null:r,areaMapEntries:i}}}]);return e}(oS);oP.styles=[e8(eC())],ej([r({type:String,attribute:"base-type"})],oP.prototype,"baseType",2),ej([r({type:String})],oP.prototype,"identifier",2),ej([r({type:String})],oP.prototype,"cardinality",2),ej([e({context:rs,subscribe:!0}),i()],oP.prototype,"itemContext",2),oP=ej([rr("qti-response-declaration")],oP);return eV(eH)}();/*! Bundled license information:
2
2
 
3
3
  @lit/context/lib/context-request-event.js:
4
4
  (**