@citolab/qti-components 7.28.1 → 8.0.1

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 (88) hide show
  1. package/cdn/index.global.js +1 -1
  2. package/cdn/index.js +6316 -2710
  3. package/dist/base.d.ts +100 -15
  4. package/dist/base.js +27 -6
  5. package/dist/chunk-3AJOQCDU.js +11 -0
  6. package/dist/chunk-3AJOQCDU.js.map +1 -0
  7. package/dist/chunk-64XSIBGO.js +241 -0
  8. package/dist/chunk-64XSIBGO.js.map +1 -0
  9. package/dist/chunk-7HC5SMCU.js +102 -0
  10. package/dist/chunk-7HC5SMCU.js.map +1 -0
  11. package/dist/{chunk-SP6S2WMG.js → chunk-7V4HJFHW.js} +3 -3
  12. package/dist/{chunk-SP6S2WMG.js.map → chunk-7V4HJFHW.js.map} +1 -1
  13. package/dist/chunk-CAO4JRLY.js +11 -0
  14. package/dist/chunk-CAO4JRLY.js.map +1 -0
  15. package/dist/{chunk-MPC7LIPC.js → chunk-F4BNJWYN.js} +4264 -3647
  16. package/dist/chunk-F4BNJWYN.js.map +1 -0
  17. package/dist/{chunk-3XV26R5M.js → chunk-H3J7LFRO.js} +829 -1005
  18. package/dist/chunk-H3J7LFRO.js.map +1 -0
  19. package/dist/{chunk-3WBG257S.js → chunk-IJD53WY6.js} +96 -74
  20. package/dist/chunk-IJD53WY6.js.map +1 -0
  21. package/dist/chunk-LVBIQDPM.js +1374 -0
  22. package/dist/chunk-LVBIQDPM.js.map +1 -0
  23. package/dist/{chunk-REI3AMCZ.js → chunk-NA2N2WSG.js} +1303 -1193
  24. package/dist/chunk-NA2N2WSG.js.map +1 -0
  25. package/dist/chunk-QECOPVPO.js +294 -0
  26. package/dist/chunk-QECOPVPO.js.map +1 -0
  27. package/dist/{chunk-HFCZFWSH.js → chunk-RXGDQDOV.js} +1993 -1764
  28. package/dist/chunk-RXGDQDOV.js.map +1 -0
  29. package/dist/chunk-V5G7X53Y.js +11 -0
  30. package/dist/chunk-V5G7X53Y.js.map +1 -0
  31. package/dist/{chunk-WDO2TRFM.js → chunk-WVVMNF74.js} +851 -925
  32. package/dist/chunk-WVVMNF74.js.map +1 -0
  33. package/dist/{chunk-FLJAKWXL.js → chunk-X3E5HXG2.js} +2 -2
  34. package/dist/chunk-XU7HNT4F.js +1608 -0
  35. package/dist/chunk-XU7HNT4F.js.map +1 -0
  36. package/dist/{computed-item.context-DfsW_96S.d.ts → computed-item.types.d-BKZdSLLJ.d.ts} +2 -5
  37. package/dist/{computed.context-DHbxad0N.d.ts → computed.types.d-rKLSPvVG.d.ts} +2 -5
  38. package/dist/config.context.d-BvU9r-Mg.d.ts +91 -0
  39. package/dist/corrections.d.ts +432 -0
  40. package/dist/corrections.js +84 -0
  41. package/dist/elements.d.ts +8 -14
  42. package/dist/elements.js +6 -5
  43. package/dist/index.d.ts +51 -16
  44. package/dist/index.js +193 -76
  45. package/dist/interaction.d-D4MstYRz.d.ts +115 -0
  46. package/dist/interaction.interface.d-CvjHM2bi.d.ts +46 -0
  47. package/dist/interactions.d.ts +1206 -552
  48. package/dist/interactions.js +19 -15
  49. package/dist/item.css +4228 -1656
  50. package/dist/item.d.ts +13 -55
  51. package/dist/item.js +6 -11
  52. package/dist/{variables-CMYcDbyW.d.ts → item.types.d-QU7LljEK.d.ts} +13 -1
  53. package/dist/loader.d.ts +4 -4
  54. package/dist/loader.js +2 -3
  55. package/dist/processing.d.ts +6 -7
  56. package/dist/processing.js +2 -3
  57. package/dist/qti-components-jsx.d.ts +5348 -2709
  58. package/dist/qti-components-jsx.js +1 -0
  59. package/dist/qti-condition-expression.d-aMvBvpc6.d.ts +8 -0
  60. package/dist/{qti-condition-expression-Dam-RER6.d.ts → qti-expression.d-BietT_8b.d.ts} +14 -9
  61. package/dist/{qti-feedback-ChmXhZuf.d.ts → qti-feedback.d-DZbad0RN.d.ts} +1 -1
  62. package/dist/{qti-transform-test-DoZaWItm.d.ts → qti-transform-test.d-BL7GGFJj.d.ts} +2 -2
  63. package/dist/response.d-_8y4kjGP.d.ts +106 -0
  64. package/dist/test.d.ts +199 -39
  65. package/dist/test.js +34 -11
  66. package/dist/transformers.d.ts +1 -1
  67. package/dist/transformers.js +1 -2
  68. package/package.json +24 -17
  69. package/custom-elements.json +0 -43251
  70. package/dist/chunk-3WBG257S.js.map +0 -1
  71. package/dist/chunk-3XV26R5M.js.map +0 -1
  72. package/dist/chunk-AQ5RJFM6.js +0 -3673
  73. package/dist/chunk-AQ5RJFM6.js.map +0 -1
  74. package/dist/chunk-HFCZFWSH.js.map +0 -1
  75. package/dist/chunk-MPC7LIPC.js.map +0 -1
  76. package/dist/chunk-QXBXORM3.js +0 -27
  77. package/dist/chunk-REI3AMCZ.js.map +0 -1
  78. package/dist/chunk-RLTYVS2I.js +0 -530
  79. package/dist/chunk-RLTYVS2I.js.map +0 -1
  80. package/dist/chunk-WDO2TRFM.js.map +0 -1
  81. package/dist/config.context-BjZ2bZSY.d.ts +0 -42
  82. package/dist/interaction-Bgzlw7Iu.d.ts +0 -110
  83. package/dist/item.context-CkUeDcaO.d.ts +0 -15
  84. package/dist/test.context-CByZZjkR.d.ts +0 -15
  85. /package/dist/{chunk-FLJAKWXL.js.map → chunk-X3E5HXG2.js.map} +0 -0
  86. /package/dist/{chunk-QXBXORM3.js.map → corrections.js.map} +0 -0
  87. /package/dist/{qti-rule-base-ajOnfGXY.d.ts → qti-rule-base.d-ajOnfGXY.d.ts} +0 -0
  88. /package/dist/{qti.context-CejJMlfZ.d.ts → qti.context.d-CejJMlfZ.d.ts} +0 -0
@@ -1 +1 @@
1
- function t(t,e){if(e==null||e>t.length)e=t.length;for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function e(t){if(Array.isArray(t))return t}function n(e){if(Array.isArray(e))return t(e)}function i(t){if(t===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t}function o(t,e,n,i,o,a,s){try{var l=t[a](s);var u=l.value}catch(t){n(t);return}if(l.done){e(u)}else{Promise.resolve(u).then(i,o)}}function a(t){return function(){var e=this,n=arguments;return new Promise(function(i,a){var s=t.apply(e,n);function l(t){o(s,i,a,l,u,"next",t)}function u(t){o(s,i,a,l,u,"throw",t)}l(undefined)})}}function s(t,e,n){e=p(e);return S(t,V()?Reflect.construct(e,n||[],p(t).constructor):e.apply(t,n))}function l(t,e){if(!(t instanceof e)){throw new TypeError("Cannot call a class as a function")}}function u(t,e,n){if(V()){u=Reflect.construct}else{u=function t(t,e,n){var i=[null];i.push.apply(i,e);var o=Function.bind.apply(t,i);var a=new o;if(n)I(a,n.prototype);return a}}return u.apply(null,arguments)}function c(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(t,i.key,i)}}function d(t,e,n){if(e)c(t.prototype,e);if(n)c(t,n);return t}function h(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 f(t,e,n){if(typeof Reflect!=="undefined"&&Reflect.get){f=Reflect.get}else{f=function t(t,e,n){var i=M(t,e);if(!i)return;var o=Object.getOwnPropertyDescriptor(i,e);if(o.get){return o.get.call(n||t)}return o.value}}return f(t,e,n||t)}function p(t){p=Object.setPrototypeOf?Object.getPrototypeOf:function t(t){return t.__proto__||Object.getPrototypeOf(t)};return p(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)I(t,e)}function m(t,e){if(e!=null&&typeof Symbol!=="undefined"&&e[Symbol.hasInstance]){return!!e[Symbol.hasInstance](t)}else{return t instanceof e}}function g(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function y(t){if(typeof Symbol!=="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function b(t,e){var n=t==null?null:typeof Symbol!=="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(n==null)return;var i=[];var o=true;var a=false;var s,l;try{for(n=n.call(t);!(o=(s=n.next()).done);o=true){i.push(s.value);if(e&&i.length===e)break}}catch(t){a=true;l=t}finally{try{if(!o&&n["return"]!=null)n["return"]()}finally{if(a)throw l}}return i}function w(){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 q(){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 i=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){i=i.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))}i.forEach(function(e){h(t,e,n[e])})}return t}function x(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);if(e){i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})}n.push.apply(n,i)}return n}function _(t,e){e=e!=null?e:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(t,Object.getOwnPropertyDescriptors(e))}else{x(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function E(t,e){if(t==null)return{};var n={},i,o,a;if(typeof Reflect!=="undefined"&&Reflect.ownKeys){i=Reflect.ownKeys(t);for(a=0;a<i.length;a++){o=i[a];if(e.indexOf(o)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(t,o))continue;n[o]=t[o]}return n}n=C(t,e);if(Object.getOwnPropertySymbols){i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++){o=i[a];if(e.indexOf(o)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(t,o))continue;n[o]=t[o]}}return n}function C(t,e){if(t==null)return{};var n={},i=Object.getOwnPropertyNames(t),o,a;for(a=0;a<i.length;a++){o=i[a];if(e.indexOf(o)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(t,o))continue;n[o]=t[o]}return n}function S(t,e){if(e&&(U(e)==="object"||typeof e==="function")){return e}return i(t)}function A(t,e,n,i){if(typeof Reflect!=="undefined"&&Reflect.set){A=Reflect.set}else{A=function t(t,e,n,i){var o=M(t,e);var a;if(o){a=Object.getOwnPropertyDescriptor(o,e);if(a.set){a.set.call(i,n);return true}else if(!a.writable){return false}}a=Object.getOwnPropertyDescriptor(i,e);if(a){if(!a.writable){return false}a.value=n;Object.defineProperty(i,e,a)}else{h(i,e,n)}return true}}return A(t,e,n,i)}function R(t,e,n,i,o){var a=A(t,e,n,i||t);if(!a&&o){throw new Error("failed to set property")}return n}function I(t,e){I=Object.setPrototypeOf||function t(t,e){t.__proto__=e;return t};return I(t,e)}function T(t,n){return e(t)||b(t,n)||L(t,n)||w()}function M(t,e){while(!Object.prototype.hasOwnProperty.call(t,e)){t=p(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 O(t){return e(t)||y(t)||L(t)||w()}function N(t){return n(t)||y(t)||L(t)||q()}function U(t){"@swc/helpers - typeof";return t&&typeof Symbol!=="undefined"&&t.constructor===Symbol?"symbol":typeof t}function L(e,n){if(!e)return;if(typeof e==="string")return t(e,n);var i=Object.prototype.toString.call(e).slice(8,-1);if(i==="Object"&&e.constructor)i=e.constructor.name;if(i==="Map"||i==="Set")return Array.from(i);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return t(e,n)}function D(t){var e=typeof Map==="function"?new Map:undefined;D=function t(t){if(t===null||!g(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 u(t,arguments,p(this).constructor)}n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:false,writable:true,configurable:true}});return I(n,t)};return D(t)}function V(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(V=function(){return!!t})()}function $(t,e){var n,i,o,a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},s=Object.create((typeof Iterator==="function"?Iterator:Object).prototype),l=Object.defineProperty;return l(s,"next",{value:u(0)}),l(s,"throw",{value:u(1)}),l(s,"return",{value:u(2)}),typeof Symbol==="function"&&l(s,Symbol.iterator,{value:function(){return this}}),s;function u(t){return function(e){return c([t,e])}}function c(l){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,l[0]&&(a=0)),a)try{if(n=1,i&&(o=l[0]&2?i["return"]:l[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;if(i=0,o)l=[l[0]&2,o.value];switch(l[0]){case 0:case 1:o=l;break;case 4:a.label++;return{value:l[1],done:false};case 5:a.label++;i=l[1];l=[0];continue;case 7:l=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){a=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){a.label=l[1];break}if(l[0]===6&&a.label<o[1]){a.label=o[1];o=l;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(l);break}if(o[2])a.ops.pop();a.trys.pop();continue}l=e.call(t,a)}catch(t){l=[6,t];i=0}finally{n=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}}function W(){var t=P(["<slot></slot>"]);W=function e(){return t};return t}function j(){var t=P(["<slot></slot>"]);j=function e(){return t};return t}function F(){var t=P(["<pre>","</pre>\n <slot></slot>"]);F=function e(){return t};return t}function z(){var t=P(["\n slot {\n display: none;\n }\n "]);z=function e(){return t};return t}function B(){var t=P(["<slot></slot>"]);B=function e(){return t};return t}function H(){var t=P(['<slot name="qti-rubric-block"></slot><slot></slot>']);H=function e(){return t};return t}function Q(){var t=P([" <slot></slot>"]);Q=function e(){return t};return t}function X(){var t=P([" <slot></slot>"]);X=function e(){return t};return t}function G(){var t=P(["<slot></slot>"]);G=function e(){return t};return t}function J(){var t=P(["<slot @slotchange=","></slot>"]);J=function e(){return t};return t}function Y(){var t=P([' <slot part="feedback" class="feedback ','"></slot> ']);Y=function e(){return t};return t}function K(){var t=P(["\n :host {\n display: block;\n }\n .on {\n display: block;\n }\n .off {\n display: none;\n }\n "]);K=function e(){return t};return t}function Z(){var t=P([' <slot part="feedback" class="','"></slot> ']);Z=function e(){return t};return t}function tt(){var t=P(["\n .on {\n display: inline-block;\n }\n .off {\n display: none;\n }\n "]);tt=function e(){return t};return t}function te(){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 ']);te=function e(){return t};return t}function tn(){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 "]);tn=function e(){return t};return t}function tr(){var t=P(["\n :host {\n display: block;\n }\n"]);tr=function e(){return t};return t}function ti(){var t=P(['<slot part="qti-rubric-blocks" name="qti-rubric-block"></slot><slot></slot>']);ti=function e(){return t};return t}function to(){var t=P(["<slot @slotchange=","></slot>"]);to=function e(){return t};return t}function ta(){var t=P(["<slot></slot>"]);ta=function e(){return t};return t}function ts(){var t=P(["\n :host {\n display: block;\n }\n "]);ts=function e(){return t};return t}function tl(){var t=P(["",""]);tl=function e(){return t};return t}function tu(){var t=P(["\n :host {\n display: none;\n }\n "]);tu=function e(){return t};return t}function tc(){var t=P(["",""]);tc=function e(){return t};return t}function td(){var t=P(["\n :host {\n display: none;\n }\n "]);td=function e(){return t};return t}function th(){var t=P(["<slot></slot>"]);th=function e(){return t};return t}function tf(){var t=P(["\n :host {\n display: none;\n }\n "]);tf=function e(){return t};return t}function tp(){var t=P(["<slot></slot>"]);tp=function e(){return t};return t}function tv(){var t=P(["\n :host {\n display: none;\n }\n "]);tv=function e(){return t};return t}function tm(){var t=P(["<slot></slot>"]);tm=function e(){return t};return t}function tg(){var t=P(["\n :host {\n display: none;\n }\n "]);tg=function e(){return t};return t}function ty(){var t=P(["<slot></slot>"]);ty=function e(){return t};return t}function tb(){var t=P(["<slot></slot>"]);tb=function e(){return t};return t}function tw(){var t=P(["\n :host {\n display: none;\n }\n "]);tw=function e(){return t};return t}function tq(){var t=P([""]);tq=function e(){return t};return t}function tk(){var t=P(["\n :host {\n color: gray;\n }\n "]);tk=function e(){return t};return t}function tx(){var t=P(["<slot></slot>"]);tx=function e(){return t};return t}function t_(){var t=P(["\n display: inline-flex;\n align-items: center;\n cursor: pointer;\n padding: 0.5rem 1rem;\n border-radius: 0.25rem;\n user-select: none;\n"]);t_=function e(){return t};return t}function tE(){var t=P(["\n background-color: lightgray;\n ",";\n"]);tE=function e(){return t};return t}function tC(){var t=P(["\n cursor: not-allowed;\n opacity: 0.8;\n"]);tC=function e(){return t};return t}function tS(){var t=P(["\n ",";\n border: 1px solid gray;\n"]);tS=function e(){return t};return t}function tA(){var t=P(["<slot></slot>"]);tA=function e(){return t};return t}function tR(){var t=P(["\n :host {\n ",";\n }\n :host([disabled]) {\n ",";\n }\n "]);tR=function e(){return t};return t}function tI(){var t=P(["<slot></slot>"]);tI=function e(){return t};return t}function tT(){var t=P(["\n :host {\n ",";\n }\n :host([disabled]) {\n ",";\n }\n "]);tT=function e(){return t};return t}function tM(){var t=P(['<option value="','" ?selected=',">","</option>"]);tM=function e(){return t};return t}function tP(){var t=P(['\n <label part="label" for="viewSelect">','</label>\n <select\n part="select"\n id="viewSelect"\n @change=',"\n >\n ","\n </select>\n "]);tP=function e(){return t};return t}function tO(){var t=P([" <slot></slot> "]);tO=function e(){return t};return t}function tN(){var t=P(["\n :host {\n ",";\n }\n :host([disabled]) {\n ",";\n }\n "]);tN=function e(){return t};return t}function tU(){var t=P([" <slot></slot> "]);tU=function e(){return t};return t}function tL(){var t=P(["\n :host {\n ",";\n }\n :host([disabled]) {\n ",";\n }\n "]);tL=function e(){return t};return t}function tD(){var t=P([' <div @click="','">',"</div> "]);tD=function e(){return t};return t}function tV(){var t=P(["\n :host {\n ",";\n }\n :host([disabled]) {\n ",";\n }\n "]);tV=function e(){return t};return t}function t$(){var t=P([""]);t$=function e(){return t};return t}function tW(){var t=P([" "," "]);tW=function e(){return t};return t}function tj(){var t=P(["<span>Loading...</span>"]);tj=function e(){return t};return t}function tF(){var t=P(["\n ","\n <slot></slot>\n ","\n "]);tF=function e(){return t};return t}function tz(){var t=P([""]);tz=function e(){return t};return t}function tB(){var t=P([""]);tB=function e(){return t};return t}function tH(){var t=P(["\n <tr>\n <td>","</td>\n <td>","</td>\n <td>","</td>\n <td>","</td>\n <td>","</td>\n </tr>\n "]);tH=function e(){return t};return t}function tQ(){var t=P(["\n <h3>","</h3>\n <table>\n <thead>\n <tr>\n <th>Identifier</th>\n <th>Value</th>\n <th>Cardinality</th>\n <th>Base Type</th>\n <th>Correct Response / Mappings</th>\n </tr>\n </thead>\n <tbody>\n ","\n </tbody>\n </table>\n "]);tQ=function e(){return t};return t}function tX(){var t=P(["\n "," ","\n "]);tX=function e(){return t};return t}function tG(){var t=P(["\n table {\n width: 100%;\n border-collapse: collapse;\n margin: 20px 0;\n font-size: 14px;\n text-align: left;\n }\n th,\n td {\n border: 1px solid #ddd;\n padding: 8px;\n }\n th {\n background-color: #f4f4f4;\n font-weight: bold;\n }\n h3 {\n margin-top: 20px;\n font-size: 16px;\n }\n "]);tG=function e(){return t};return t}function tJ(){var t=P([""]);tJ=function e(){return t};return t}function tY(){var t=P([" "," "]);tY=function e(){return t};return t}function tK(){var t=P([" <slot></slot> "]);tK=function e(){return t};return t}function tZ(){var t=P(["\n :host {\n ",";\n }\n :host([disabled]) {\n ",";\n }\n "]);tZ=function e(){return t};return t}function t0(){var t=P([" <small><pre>","</pre></small> "]);t0=function e(){return t};return t}function t1(){var t=P(["<small><pre>","</pre></small>"]);t1=function e(){return t};return t}function t2(){var t=P([" ","\n ",""]);t2=function e(){return t};return t}function t3(){var t=P([""]);t3=function e(){return t};return t}function t5(){var t=P(["",""]);t5=function e(){return t};return t}function t4(){var t=P(["",""]);t4=function e(){return t};return t}function t6(){var t=P([""]);t6=function e(){return t};return t}function t8(){var t=P(["<div>","</div>"]);t8=function e(){return t};return t}function t7(){var t=P(["<div>","</div>"]);t7=function e(){return t};return t}function t9(){var t=P([" <slot></slot> "]);t9=function e(){return t};return t}function et(){var t=P(["\n :host {\n ",";\n }\n :host([disabled]) {\n ",";\n }\n "]);et=function e(){return t};return t}function ee(){var t=P(["<span>Loading...</span>"]);ee=function e(){return t};return t}function en(){var t=P(["\n ","\n <slot></slot>\n ","\n "]);en=function e(){return t};return t}function er(){var t=P([""]);er=function e(){return t};return t}function ei(){var t=P(['<option value="','" ?selected=',">\n ","\n </option>"]);ei=function e(){return t};return t}function eo(){var t=P(['\n <label part="label" for="modeSelect">','</label>\n <select\n part="select"\n id="modeSelect"\n @change=',"\n >\n ","\n </select>\n "]);eo=function e(){return t};return t}function ea(){var t=P(["\n display: inline-flex;\n align-items: center;\n cursor: pointer;\n padding: 0.5rem 1rem;\n border-radius: 0.25rem;\n user-select: none;\n"]);ea=function e(){return t};return t}function es(){var t=P(["\n background-color: lightgray;\n ",";\n"]);es=function e(){return t};return t}function el(){var t=P(["\n cursor: not-allowed;\n opacity: 0.8;\n"]);el=function e(){return t};return t}function eu(){var t=P(["\n ",";\n border: 1px solid gray;\n"]);eu=function e(){return t};return t}function ec(){var t=P([' <div @click="','">',"</div> "]);ec=function e(){return t};return t}function ed(){var t=P(["\n :host {\n ",";\n }\n :host([disabled]) {\n ",";\n }\n "]);ed=function e(){return t};return t}function eh(){var t=P([' <div @click="','">',"</div> "]);eh=function e(){return t};return t}function ef(){var t=P(["\n :host {\n ",";\n }\n :host([disabled]) {\n ",";\n }\n "]);ef=function e(){return t};return t}function ep(){var t=P([""]);ep=function e(){return t};return t}function ev(){var t=P(["\n <tr>\n <td>","</td>\n <td>","</td>\n <td>","</td>\n <td>","</td>\n <td>","</td>\n </tr>\n "]);ev=function e(){return t};return t}function em(){var t=P(["\n <h3>","</h3>\n <table>\n <thead>\n <tr>\n <th>Identifier</th>\n <th>Value</th>\n <th>Cardinality</th>\n <th>Base Type</th>\n <th>Correct Response / Mappings</th>\n </tr>\n </thead>\n <tbody>\n ","\n </tbody>\n </table>\n "]);em=function e(){return t};return t}function eg(){var t=P(["\n "," ","\n "]);eg=function e(){return t};return t}function ey(){var t=P(["\n table {\n width: 100%;\n border-collapse: collapse;\n margin: 20px 0;\n font-size: 14px;\n text-align: left;\n }\n th,\n td {\n border: 1px solid #ddd;\n padding: 8px;\n }\n th {\n background-color: #f4f4f4;\n font-weight: bold;\n }\n h3 {\n margin-top: 20px;\n font-size: 16px;\n }\n "]);ey=function e(){return t};return t}function eb(){var t=P(["<slot></slot>"]);eb=function e(){return t};return t}function ew(){var t=P(["\n :host {\n display: flex;\n user-select: none;\n position: absolute;\n }\n"]);ew=function e(){return t};return t}function eq(){var t=P([' <slot name="drags"></slot> ']);eq=function e(){return t};return t}function ek(){var t=P(["\n :host {\n display: flex;\n user-select: none;\n }\n"]);ek=function e(){return t};return t}function ex(){var t=P([' <slot name="drags"></slot>']);ex=function e(){return t};return t}function e_(){var t=P(["\n :host {\n display: flex;\n user-select: none;\n }\n"]);e_=function e(){return t};return t}function eE(){var t=P(["\n :host {\n display: inline-flex;\n user-select: none;\n }\n"]);eE=function e(){return t};return t}function eC(){var t=P(["<slot></slot>"]);eC=function e(){return t};return t}function eS(){var t=P(["\n :host {\n display: flex;\n user-select: none;\n position: absolute;\n }\n"]);eS=function e(){return t};return t}function eA(){var t=P(["\n :host {\n display: flex;\n user-select: none;\n }\n"]);eA=function e(){return t};return t}function eR(){var t=P(['<div part="ch"><div part="cha"></div></div>\n <slot></slot> ']);eR=function e(){return t};return t}function eI(){var t=P(["\n :host {\n display: block;\n box-sizing: border-box;\n }\n\n slot {\n display: inline;\n }\n"]);eI=function e(){return t};return t}function eT(){var t=P([" <slot></slot> "]);eT=function e(){return t};return t}function eM(){var t=P(["\n :host {\n display: block;\n }\n"]);eM=function e(){return t};return t}function eP(){var t=P(["<slot></slot>"]);eP=function e(){return t};return t}function eO(){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: auto;\n }\n"]);eO=function e(){return t};return t}function eN(){var t=P(['\n <slot part="slot"></slot>\n <slot part="dropslot" name="qti-simple-associable-choice"></slot>\n ']);eN=function e(){return t};return t}function eU(){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"]);eU=function e(){return t};return t}function eL(){var t=P(['<div id="label">',"</div>"]);eL=function e(){return t};return t}function eD(){var t=P(['<div part="ch">\n <div part="cha"></div>\n </div>\n ','\n <slot part="slot"></slot>']);eD=function e(){return t};return t}function eV(){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 margin: 1rem 0;\n border-radius: 0.3rem;\n gap: 0.5rem;\n }\n\n [part='drop-list'][active] {\n border-color: var(--qti-border-active) !important;\n background-color: var(--qti-bg-active) !important;\n }\n\n [part='drop-list'] {\n display: grid;\n min-height: 3rem;\n min-width: 10rem;\n border: 1px solid var(--qti-border-color, #d1d5db);\n border-radius: 0.25rem;\n box-sizing: border-box;\n }\n\n [part='drop-container'] {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n }\n\n [part='drop-list'][enabled] {\n background-color: var(--qti-bg-active) !important;\n }\n\n :host::part(associables-container) {\n display: flex;\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) calc(50%),\n rgb(0 0 0 / 0%) calc(50% + 1px)\n );\n }\n"]);eV=function e(){return t};return t}function e$(){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>']);e$=function e(){return t};return t}function eW(){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" part="message" id="validation-message"></div>\n </div>']);eW=function e(){return t};return t}function ej(){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: normal;\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"]);ej=function e(){return t};return t}function eF(){var t=P(['\n <slot part="prompt" name="prompt"></slot>\n <slot part="slot" @slotchange=','></slot>\n <div part="message" role="alert" id="validation-message"></div>\n ']);eF=function e(){return t};return t}function ez(){var t=P([""]);ez=function e(){return t};return t}function eB(){var t=P(['<div style="color:red">\n <h1>Error</h1>\n ',"\n </div>"]);eB=function e(){return t};return t}function eH(){var t=P(["<iframe\n width=","\n height=",'\n frameborder="0"\n title="pciContainer"\n id="pciContainer"\n >\n </iframe>\n ',""]);eH=function e(){return t};return t}function eQ(){var t=P([""]);eQ=function e(){return t};return t}function eX(){var t=P(["<button ?disabled=",' part="button" @click=',">","</button>"]);eX=function e(){return t};return t}function eG(){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"]);eG=function e(){return t};return t}function eJ(){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>"]);eJ=function e(){return t};return t}function eY(){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"]);eY=function e(){return t};return t}function eK(){var t=P(['<slot name="prompt"> </slot>\n <slot part="drags" name="drags"></slot>\n <slot part="drops"></slot>\n <div role="alert" part="message" id="validation-message"></div>']);eK=function e(){return t};return t}function eZ(){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"]);eZ=function e(){return t};return t}function e0(){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 "]);e0=function e(){return t};return t}function e1(){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 ']);e1=function e(){return t};return t}function e2(){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 />']);e2=function e(){return t};return t}function e3(){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" part="message" id="validation-message"></div>']);e3=function e(){return t};return t}function e5(){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"]);e5=function e(){return t};return t}function e4(){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" part="message" id="validation-message"></div>']);e4=function e(){return t};return t}function e6(){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"]);e6=function e(){return t};return t}function e8(){var t=P(['\n <slot name="prompt"></slot>\n <slot></slot>\n <div role="alert" part="message" id="validation-message"></div>\n ']);e8=function e(){return t};return t}function e7(){var t=P(["\n slot:not([name='prompt']) {\n position: relative; /* qti-hotspot-choice relative to the slot */\n display: inline-block;\n width: fit-content; /* hotspots not stretching further if image is at max size */\n line-height: 0; /* remove gaps below image */\n }\n ::slotted(img) {\n /* image not selectable anymore */\n display: block;\n pointer-events: none;\n user-select: none;\n /* width:100%; */\n }\n"]);e7=function e(){return t};return t}function e9(){var t=P(['\n <slot name="prompt"></slot>\n <slot></slot>\n ']);e9=function e(){return t};return t}function nt(){var t=P([""]);nt=function e(){return t};return t}function ne(){var t=P(['<slot></slot>\n <div part="message" role="alert" id="validation-message"></div>']);ne=function e(){return t};return t}function nn(){var t=P(["\n :host {\n display: inline-block;\n vertical-align: baseline;\n position: relative;\n }\n\n button[part='trigger'] {\n anchor-name: --qti-inline-choice-trigger;\n }\n\n [part='value'] {\n display: inline-flex;\n align-items: center;\n gap: 0.5rem;\n min-width: 0;\n }\n\n [part~='dropdown-icon'] {\n line-height: 1;\n }\n\n [part='menu'] {\n position-anchor: --qti-inline-choice-trigger;\n inset: auto;\n margin: 0;\n z-index: 1000;\n top: calc(anchor(bottom) + 4px);\n left: anchor(left);\n min-width: anchor-size(width);\n max-width: min(90vw, 36rem);\n max-height: min(40vh, 20rem);\n position-try-fallbacks: flip-block, flip-inline;\n }\n\n button[part~='option'] {\n width: 100%;\n }\n\n [part='option-content'] {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n flex-wrap: nowrap;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n min-width: 0;\n }\n\n button[part~='option'] img,\n button[part='trigger'] img,\n [part='menu'] img {\n display: inline-block;\n vertical-align: middle;\n }\n"]);nn=function e(){return t};return t}function nr(){var t=P(['\n <button\n part="trigger"\n type="button"\n @click=',"\n @keydown=",'\n aria-haspopup="listbox"\n aria-expanded="','"\n aria-controls="','"\n popovertarget="','"\n popovertargetaction="toggle"\n ?disabled="','"\n data-readonly="','"\n >\n <span part="value">','</span>\n <span part="','" aria-hidden="true"\n >▾</span\n >\n </button>\n <div\n id="','"\n part="menu"\n role="listbox"\n popover="auto"\n @toggle=',"\n @keydown=",'\n >\n <button\n part="','"\n type="button"\n role="option"\n aria-selected="','"\n @click=','\n >\n <span part="option-content">',"</span>\n </button>\n <slot @slotchange=","></slot>\n </div>\n ","\n "]);nr=function e(){return t};return t}function ni(){var t=P(['<span\n part="correct-option"\n style="border:1px solid var(--qti-correct); border-radius:4px; padding: 2px 4px; margin: 4px; display:inline-block"\n >',"</span\n >"]);ni=function e(){return t};return t}function no(){var t=P(["\n slot:not([hidden]) {\n /* slot where the */\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\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"]);no=function e(){return t};return t}function na(){var t=P(['<th part="r-header">',"</th>"]);na=function e(){return t};return t}function ns(){var t=P(['\n <svg\n part="checkmark"\n viewBox="0 0 24 24"\n style="position: absolute; width: 20px; height: 20px; top: 2px; left: 2px; pointer-events: none;"\n >\n <path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z" fill="white" />\n </svg>\n ']);ns=function e(){return t};return t}function nl(){var t=P(['<td part="input-cell">\n <div\n class="input-container"\n style="position: relative; width: 24px; height: 24px; margin: 0 auto;"\n >\n <input\n type=',"\n part=","\n name=","\n value=","\n .disabled=","\n @change=","\n @click=","\n />\n ","\n </div>\n </td>"]);nl=function e(){return t};return t}function nu(){var t=P(['<tr part="row">\n <td part="c-header">',"</td>\n ","\n </tr>"]);nu=function e(){return t};return t}function nc(){var t=P(['\n <table part="table">\n <tr part="r-header">\n <td></td>\n ',"\n </tr>\n\n ","\n </table>\n "]);nc=function e(){return t};return t}function nd(){var t=P(['\n <slot name="prompt"></slot>\n <slot ?hidden=',"></slot>\n\n ",'\n\n <div role="alert" part="message" id="validation-message"></div>\n ']);nd=function e(){return t};return t}function nh(){var t=P([""]);nh=function e(){return t};return t}function nf(){var t=P([' <slot name="prompt"></slot>\n <slot></slot>']);nf=function e(){return t};return t}function np(){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='drop-list'][active] {\n border-color: var(--qti-border-active) !important;\n background-color: var(--qti-bg-active) !important;\n }\n\n [part='drop-list'][enabled] {\n background-color: var(--qti-bg-active) !important;\n }\n\n [part='drop-list'][data-cross-slot-target] {\n border-color: var(--qti-border-active, #0066cc) !important;\n background-color: var(--qti-bg-active, rgba(0, 102, 204, 0.1)) !important;\n outline: 2px dashed var(--qti-border-active, #0066cc);\n outline-offset: -2px;\n }\n\n /* Candidate correction colors for choices placed inside drop-lists. */\n drop-list [qti-draggable='true']:state(candidate-correct),\n [part='qti-simple-choice']:state(candidate-correct) {\n background-color: var(--qti-correct) !important;\n }\n\n drop-list [qti-draggable='true']:state(candidate-incorrect),\n [part='qti-simple-choice']:state(candidate-incorrect) {\n background-color: var(--qti-incorrect) !important;\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"]);np=function e(){return t};return t}function nv(){var t=P(['<drop-list role="region" part="drop-list" identifier="droplist','"></drop-list>']);nv=function e(){return t};return t}function nm(){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>"]);nm=function e(){return t};return t}function ng(){var t=P(["\n :host {\n display: block;\n width: 100%;\n min-height: 50px;\n }\n\n ::slotted(qti-interaction-markup) {\n display: none;\n }\n"]);ng=function e(){return t};return t}function ny(){var t=P(['<div style="color:red">\n <h1>Error</h1>\n ',"\n </div>"]);ny=function e(){return t};return t}function nb(){var t=P(["\n <slot></slot>\n ","\n "]);nb=function e(){return t};return t}function nw(){var t=P(["\n :host {\n display: block;\n width: 100%;\n min-height: 50px;\n }\n "]);nw=function e(){return t};return t}function nq(){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"]);nq=function e(){return t};return t}function nk(){var t=P(["<slot></slot>"]);nk=function e(){return t};return t}function nx(){var t=P(["\n :host {\n display: inline-block;\n position: relative;\n }\n"]);nx=function e(){return t};return t}function n_(){var t=P(["<slot></slot>"]);n_=function e(){return t};return t}function nE(){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"]);nE=function e(){return t};return t}function nC(){var t=P(['\n <button\n part="point','"\n style=','\n aria-label="Remove point at ','"\n ?disabled=',"\n @click=","\n ></button>\n "]);nC=function e(){return t};return t}function nS(){var t=P(["<div\n style=",'\n data-coord="','"\n alt=','\n data-shape="','"\n ></div>']);nS=function e(){return t};return t}function nA(){var t=P([' <slot name="prompt"></slot>\n <point-container>\n ',"\n ","\n <slot></slot>\n </point-container>"]);nA=function e(){return t};return t}function nR(){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"]);nR=function e(){return t};return t}function nI(){var t=P(['\n <div id="knob-correct" part="knob-correct">\n <div id="value" part="value">',"</div>\n </div>\n "]);nI=function e(){return t};return t}function nT(){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 "]);nT=function e(){return t};return t}function nM(){var t=P(["\n :host {\n display: inline-block;\n }\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\n :host {\n position: relative;\n }\n input {\n anchor-name: --text-entry-input;\n z-index: 100;\n position: relative;\n }\n\n [part='correct'] {\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n background-color: var(--qti-bg);\n z-index: 0;\n position: absolute;\n left: 0;\n right: 0;\n position-anchor: --text-entry-input;\n bottom: anchor(top);\n left: anchor(left);\n /* opacity: 1; */\n transition: all 1s;\n\n @starting-style {\n display: grid;\n /* opacity: 0; */\n bottom: 0;\n }\n }\n"]);nM=function e(){return t};return t}function nP(){var t=P(['<div part="correct">',"</div>"]);nP=function e(){return t};return t}function nO(){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 ',"\n "]);nO=function e(){return t};return t}function nN(){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"]);nN=function e(){return t};return t}function nU(){var t=P(['\n <div>\n <slot name="prompt"></slot>\n <input type="file" @change="','" ?disabled="','" ?readonly="','" />\n </div>\n ']);nU=function e(){return t};return t}function nL(){var t=P(["<slot></slot>"]);nL=function e(){return t};return t}function nD(){var t=P(["<slot></slot>"]);nD=function e(){return t};return t}function nV(){var t=P(["<slot></slot>"]);nV=function e(){return t};return t}function n$(){var t=P(["",""]);n$=function e(){return t};return t}function nW(){var t=P(["",""]);nW=function e(){return t};return t}function nj(){var t=P(["",""]);nj=function e(){return t};return t}var QtiComponents=function(){var t=function t(t){var e=t.context;return function(t,n){var i=new WeakMap;if((typeof n==="undefined"?"undefined":U(n))=="object")return{get:function e(){return t.get.call(this)},set:function e(e){return i.get(this).setValue(e),t.set.call(this,e)},init:function t(t){return i.set(this,new r0(this,{context:e,initialValue:t})),t}};{t.constructor.addInitializer(function(t){i.set(t,new r0(t,{context:e}))});var o=Object.getOwnPropertyDescriptor(t,n),a;if(o===void 0){var s=new WeakMap;a={get:function t(){return s.get(this)},set:function t(t){i.get(this).setValue(t),s.set(this,t)},configurable:!0,enumerable:!0}}else{var l=o.set;a=_(k({},o),{set:function t(t){i.get(this).setValue(t),l===null||l===void 0?void 0:l.call(this,t)}})}return void Object.defineProperty(t,n,a)}}};var e=function t(t){var e=t.context,n=t.subscribe;return function(t,i){(typeof i==="undefined"?"undefined":U(i))=="object"?i.addInitializer(function(){var i=this;new rY(this,{context:e,callback:function e(e){t.set.call(i,e)},subscribe:n})}):t.constructor.addInitializer(function(t){new rY(t,{context:e,callback:function e(e){t[i]=e},subscribe:n})})}};var n=function t(){var t,e;return{promise:new Promise(function(n,i){t=n,e=i}),resolve:t,reject:e}};var i=function t(t,e){if(!i8(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return iZ!==void 0?iZ.createHTML(e):e};var o=function t(t){return function(e,n){return(typeof n==="undefined"?"undefined":U(n))=="object"?oP(t,e,n):function(t,e,n){var i=e.hasOwnProperty(n);return e.constructor.createProperty(n,t),i?Object.getOwnPropertyDescriptor(e,n):void 0}(t,e,n)}};var u=function t(t){return o(_(k({},t),{state:!0,attribute:!1}))};var c=function t(t,e){return function(n,i,o){var a=function e(e){var n;var i;return(n=(i=e.renderRoot)===null||i===void 0?void 0:i.querySelector(t))!==null&&n!==void 0?n:null};if(e){var s=(typeof i==="undefined"?"undefined":U(i))=="object"?n:o!==null&&o!==void 0?o:function(){var t=Symbol();return{get:function e(){return this[t]},set:function e(e){this[t]=e}}}(),l=s.get,u=s.set;return oO(n,i,{get:function t(){var t=l.call(this);return t===void 0&&(t=a(this),(t!==null||this.hasUpdated)&&u.call(this,t)),t}})}return oO(n,i,{get:function t(){return a(this)}})}};var g=function t(t){return function(e,n){var i=t!==null&&t!==void 0?t:{},o=i.slot,a=i.selector,s="slot"+(o?"[name=".concat(o,"]"):":not([name])");return oO(e,n,{get:function e(){var e;var n;var i=(n=this.renderRoot)===null||n===void 0?void 0:n.querySelector(s),o=(e=i===null||i===void 0?void 0:i.assignedElements(t))!==null&&e!==void 0?e:[];return a===void 0?o:o.filter(function(t){return t.matches(a)})}})}};var y=function t(t,e){var n=k({waitUntilFirstUpdate:!1},e);return function(e,i){var o=e.update,a=Array.isArray(t)?t:[t];e.update=function(t){var e=this;a.forEach(function(o){var a=o;if(t.has(a)){var s=t.get(a),l=e[a];s!==l&&(!n.waitUntilFirstUpdate||e.hasUpdated)&&e[i](s,l)}}),o.call(this,t)}}};var b=function t(t){this._$AN!==void 0?(o9(this),this._$AM=t,at(this)):this._$AM=t};var w=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 i=this._$AH,o=this._$AN;if(o!==void 0&&o.size!==0)if(e)if(Array.isArray(i))for(var a=n;a<i.length;a++)o7(i[a],!1),o9(i[a]);else i!=null&&(o7(i,!1),o9(i));else o7(this,t)};var q=function t(t){return t==null};var x=function t(t){return t.replace(/([^:]\/)\/+/g,"$1").replace(/\/\//g,"/").replace("http:/","http://").replace("https:/","https://")};var C=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 S=function t(t,e,n){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"qti-portable-custom-interaction";return a(function(){var o,s,l,u,c,d,h,f,p,v,m,g,y,b,w,q,k,x,_,E,C,S,A,R,I,T,M,P,O,N,U,L,D,V;return $(this,function(M){switch(M.label){case 0:o=[],s=t.querySelectorAll(i);if(s.length===0)return[2];l=null,u=null,c=function t(){return a(function(){var t,i;return $(this,function(o){switch(o.label){case 0:if(!(l===null))return[3,4];o.label=1;case 1:o.trys.push([1,3,,4]);return[4,n(e,"/modules/module_resolution.js")];case 2:l=o.sent();return[3,4];case 3:t=o.sent();l=null;return[3,4];case 4:if(!(u===null))return[3,8];o.label=5;case 5:o.trys.push([5,7,,8]);return[4,n(e,"/modules/fallback_module_resolution.js")];case 6:u=o.sent();return[3,8];case 7:i=o.sent();u=null;return[3,8];case 8:return[2]}})})()};d=true,h=false,f=undefined;M.label=1;case 1:M.trys.push([1,12,13,14]);p=Array.from(s)[Symbol.iterator]();M.label=2;case 2:if(!!(d=(v=p.next()).done))return[3,11];m=v.value;m.setAttribute("data-base-url",e);g=m.getAttribute("custom-interaction-type-identifier");g&&o.includes(g)&&(g=g+o.length,m.setAttribute("custom-interaction-type-identifier",g),o.push(g)),g&&o.push(g);y=m.querySelector("qti-interaction-modules");if(!(y&&y.getAttribute("primary-configuration")))return[3,8];return[4,c()];case 3:M.sent();b=y.getAttribute("primary-configuration");if(!b)return[3,7];M.label=4;case 4:M.trys.push([4,6,,7]);return[4,n(e,"/".concat(b))];case 5:w=M.sent(),q=Array.from(y.querySelectorAll("qti-interaction-module"));k=true,x=false,_=undefined;try{for(E=q[Symbol.iterator]();!(k=(C=E.next()).done);k=true){S=C.value;A=S.getAttribute("id");if(A&&w.paths&&w.paths[A]){R=w.paths[A],I=Array.isArray(R)?R[0]:R;if(S.setAttribute("primary-path",I),u&&u.paths&&u.paths[A]){T=u.paths[A];Array.isArray(T)?S.setAttribute("fallback-path",T[0]):S.setAttribute("fallback-path",T)}}}}catch(t){x=true;_=t}finally{try{if(!k&&E.return!=null){E.return()}}finally{if(x){throw _}}}if(w.paths){for(var D in w.paths)if(!y.querySelector('qti-interaction-module[id="'.concat(D,'"]'))){P=t.createElement("qti-interaction-module");P.setAttribute("id",D);O=Array.isArray(w.paths[D])?w.paths[D][0]:w.paths[D];if(P.setAttribute("primary-path",O),u&&u.paths&&u.paths[D]){N=u.paths[D];Array.isArray(N)?P.setAttribute("fallback-path",N[0]):P.setAttribute("fallback-path",N)}y.appendChild(P)}}w.urlArgs&&y.setAttribute("url-args",w.urlArgs);return[3,7];case 6:U=M.sent();console.warn("Failed to load primary configuration: ".concat(b),U);return[3,7];case 7:return[3,10];case 8:return[4,c()];case 9:if(M.sent(),l){L=function(e){var n=l.paths[e],i="";u&&u.paths&&u.paths[e]&&(i=u.paths[e]);var o=Array.isArray(n)?n:[n],a=Array.isArray(i)?i:[i],s=o.map(function(t,e){var n=a.length>e?a[e]:"";return{primaryPath:t,fallbackPath:n}});var c=true,d=false,h=undefined;try{var f=function(){var t=v.value;s.some(function(e){return e.fallbackPath===t})||s.push({primaryPath:o.length>0?o[0]:t,fallbackPath:t})};for(var p=a[Symbol.iterator](),v;!(c=(v=p.next()).done);c=true)f()}catch(t){d=true;h=t}finally{try{if(!c&&p.return!=null){p.return()}}finally{if(d){throw h}}}var m=true,g=false,b=undefined;try{for(var w=s[Symbol.iterator](),q;!(m=(q=w.next()).done);m=true){var k=q.value;var x=t.createElement("qti-interaction-module");k.fallbackPath&&x.setAttribute("fallback-path",k.fallbackPath),x.setAttribute("id",e),x.setAttribute("primary-path",k.primaryPath),y&&y.appendChild(x)}}catch(t){g=true;b=t}finally{try{if(!m&&w.return!=null){w.return()}}finally{if(g){throw b}}}};m.querySelector("qti-interaction-modules")===null?(y=t.createElement("qti-interaction-modules"),m.appendChild(y)):y=m.querySelector("qti-interaction-modules");for(var W in l.paths)L(W)}M.label=10;case 10:d=true;return[3,2];case 11:return[3,14];case 12:V=M.sent();h=true;f=V;return[3,14];case 13:try{if(!d&&p.return!=null){p.return()}}finally{if(h){throw f}}return[7];case 14:return[2]}})})()};var A=function t(t,e,n){Array.from(t.getElementsByTagName("*")).filter(function(t){var n;return t.localName===e||((n=t.localName)===null||n===void 0?void 0:n.toLowerCase())===e.toLowerCase()}).forEach(function(t){var i="".concat(e,"-").concat(n),o=M(t,i);t.replaceWith(o)})};var I=function t(t,e){t.querySelectorAll("*").forEach(function(t){var n=t.classList;n&&n.forEach(function(n){if(n.startsWith("".concat(e,":"))){var i=n.slice("".concat(e,":").length),o="".concat(t.nodeName,"-").concat(i),a=M(t,o);t.replaceWith(a)}})})};var M=function t(t,e){var n=t.ownerDocument.createElement(e);var i=true,o=false,a=undefined;try{for(var s=t.attributes[Symbol.iterator](),l;!(i=(l=s.next()).done);i=true){var u=l.value;n.setAttribute(u.name,u.value)}}catch(t){o=true;a=t}finally{try{if(!i&&s.return!=null){s.return()}}finally{if(o){throw a}}}for(;t.firstChild;)n.appendChild(t.firstChild);return n};var P=function t(t,e){var n=["hook","module"],i=e.substring(0,e.lastIndexOf("/"));var o=true,a=false,s=undefined;try{var l=function(){var n=c.value;t.querySelectorAll("["+n+"]").forEach(function(t){var o=t.getAttribute(n);!o.startsWith("data:")&&!o.startsWith("http")&&(t.setAttribute("base-url",e),t.setAttribute("module",i+"/"+encodeURI(o+(o.endsWith(".js")?"":".js"))))})};for(var u=n[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}}}};var L=function t(t){return aq.fromSeedKey(t)};var V=function t(t){var e=0x6a09e667^t.length;for(var n=0;n<t.length;n++)e=Math.imul(e^t.charCodeAt(n),0xcc9e2d51),e=e<<13|e>>>19;return nz(e)};var nF=function t(t){var e=0x6a09e667^t.length;for(var n=0;n<t.length;n++)e=Math.imul(e^t[n],0xcc9e2d51),e=e<<13|e>>>19;return nz(e)};var nz=function t(t){var e=Math.imul(t^t>>>16,0x85ebca6b);return e=Math.imul(e^e>>>13,0xc2b2ae35),(e^e>>>16)>>>0};var nB=function t(t,e){var n=t.filter(function(t){return!t.fixed});for(var i=n.length-1;i>0;i--){var o=Math.floor(ak(e)*(i+1));var a;a=[n[o],n[i]],n[i]=a[0],n[o]=a[1],a}var s=0;return t.map(function(t){return t.fixed?t:n[s++]})};var nH=function t(t){switch(t){case"qti-choice-interaction":case"qti-order-interaction":return"qti-simple-choice";case"qti-inline-choice-interaction":return"qti-inline-choice";case"qti-match-interaction":return["qti-simple-match-set:first-of-type qti-simple-associable-choice","qti-simple-match-set:last-of-type > qti-simple-associable-choice"];case"qti-gap-match-interaction":return"qti-gap-text";case"qti-associate-interaction":return"qti-simple-associable-choice";default:return null}};var nQ=function t(t,e){var n;var i,o;var a=t.querySelectorAll('[shuffle="true"]'),s=Array.from(a).filter(function(t){var e;return(e=t.tagName)===null||e===void 0?void 0:e.toLowerCase().endsWith("-interaction")}),l=e!=null&&"".concat(e).length>0,u=(n=(o=t.querySelector)===null||o===void 0?void 0:(i=o.call(t,"qti-assessment-item"))===null||i===void 0?void 0:i.getAttribute("identifier"))!==null&&n!==void 0?n:"",c=0;var d=true,h=false,f=undefined;try{for(var p=s[Symbol.iterator](),v;!(d=(v=p.next()).done);d=true){var m=v.value;var g;var y=(g=m.getAttribute("response-identifier"))!==null&&g!==void 0?g:"".concat(c);c++;var b=nH(m.tagName.toLowerCase()),w=Array.isArray(b)?b:[b],q=!1,k=0;var x=true,_=false,E=undefined;try{var C=function(){var t=A.value;if(!t)return"continue";var n=l?L("".concat(e,":").concat(u,":").concat(y,":").concat(k)):Math.random;k++;var i=Array.from(m.querySelectorAll(t)).filter(function(t){return t.parentElement!==null});if(i.filter(function(t){return t.getAttribute("fixed")!=="true"}).length<=1){console.warn("Shuffling is not possible with fewer than 2 non-fixed elements.");return"continue"}var o=i[0].parentElement;if(!o||i.some(function(t){return t.parentElement!==o})){console.warn("Shuffling is not possible when choices do not share the same parent element.");return"continue"}var a=i[i.length-1].nextSibling,s=nB(i.map(function(t){return{element:t,fixed:t.getAttribute("fixed")==="true"}}),n);var c=true,d=false,h=undefined;try{for(var f=i[Symbol.iterator](),p;!(c=(p=f.next()).done);c=true){var v=p.value;v.remove()}}catch(t){d=true;h=t}finally{try{if(!c&&f.return!=null){f.return()}}finally{if(d){throw h}}}var g=true,b=false,w=undefined;try{for(var x=s[Symbol.iterator](),_;!(g=(_=x.next()).done);g=true){var E=_.value,C=E.element;o.insertBefore(C,a)}}catch(t){b=true;w=t}finally{try{if(!g&&x.return!=null){x.return()}}finally{if(b){throw w}}}q=!0};for(var S=w[Symbol.iterator](),A;!(x=(A=S.next()).done);x=true)C()}catch(t){_=true;E=t}finally{try{if(!x&&S.return!=null){S.return()}}finally{if(_){throw E}}}q&&m.removeAttribute("shuffle")}}catch(t){h=true;f=t}finally{try{if(!d&&p.return!=null){p.return()}}finally{if(h){throw f}}}};var nX=function t(t){t.querySelectorAll("qti-stylesheet").forEach(function(t){return t.remove()})};var nG=function t(t,e){return fetch(t,{signal:e}).then(function(t){if(!t.ok)throw new Error("HTTP error! status: ".concat(t.status));return t.text()}).then(function(t){return new DOMParser().parseFromString(t,"text/xml")}).catch(function(t){throw t.name==="AbortError"?t:new Error("Failed to load XML: ".concat(t.message))})};var nJ=function t(t){return new DOMParser().parseFromString(t,"text/xml")};var nY=function t(t){var e=document.createDocumentFragment();for(var n=0;n<t.childNodes.length;n++)e.appendChild(ax(t.childNodes[n],document));return e};var nK=function t(t,e){e.endsWith("/")||(e+="/"),t.querySelectorAll("*").forEach(function(t){for(var n=0,i=["src","href","srcset","poster"];n<i.length;n++){var o=i[n];var a;var s=(a=t.getAttribute(o))===null||a===void 0?void 0:a.trim();if(s&&!/^(data:|https?:|blob:)/.test(s)){var l=e+encodeURI(s);t.setAttribute(o,l)}}})};var nZ=function t(t){var e=[];return t.querySelectorAll("qti-assessment-item-ref").forEach(function(t){var n=t.getAttribute("identifier"),i=t.getAttribute("href"),o=t.getAttribute("category");e.push({identifier:n,href:i,category:o})}),e};var n0=function t(t,e){var n=Array.from(t.getElementsByTagName("*")).filter(function(t){return aA(t)});var i=true,o=false,a=undefined;try{for(var s=n[Symbol.iterator](),l;!(i=(l=s.next()).done);i=true){var u=l.value;var c=u.parentElement;(!c||!aA(c))&&aM(u,e)}}catch(t){o=true;a=t}finally{try{if(!i&&s.return!=null){s.return()}}finally{if(o){throw a}}}};var n1=function t(t,e){if(!lx(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return lv!==void 0?lv.createHTML(e):e};var n2=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),i=0;i<t;i++){e[i]=arguments[i]}l(this,n);var o;o=s(this,n,N(e));o.identifier="";o.tabIndex=0;o.disabled=!1;o.readonly=!1;o.internals=o.attachInternals();return o}d(n,[{key:"handleDisabledChange",value:function t(t,e){this.tabIndex=e?-1:0,e&&this.blur()}},{key:"connectedCallback",value:function t(){f(p(n.prototype),"connectedCallback",this).call(this),this.internals.ariaChecked="false",this.disabled&&(this.tabIndex=-1),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(){f(p(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.code==="Enter")&&(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 ol(W())}}]);return n}(t);return rj([o({type:String})],n.prototype,"identifier",2),rj([o({type:Number,reflect:!0,attribute:"tabindex"})],n.prototype,"tabIndex",2),rj([o({type:Boolean,reflect:!0,attribute:"aria-disabled",converter:dx})],n.prototype,"disabled",2),rj([o({type:Boolean,reflect:!0,attribute:"aria-readonly",converter:dx})],n.prototype,"readonly",2),rj([y("disabled",{waitUntilFirstUpdate:!0})],n.prototype,"handleDisabledChange",1),n};var n3=function t(){return typeof globalThis.Observable=="function"};var n5=function t(){Object.defineProperties(globalThis,{Observable:{value:dK,configurable:!0,writable:!0},Subscriber:{value:dZ,configurable:!0,writable:!0}}),EventTarget.prototype.when=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(dG()&&!dX(document))return;var n=this;return new dK(function(i){if(!n||i.signal.aborted)return;var o=function t(t){i.next(t)};n.addEventListener(t,o,{capture:e.capture||!1,passive:e.passive,once:!1,signal:i.signal})})}};var n4=function t(t,e,n){var i=t.filter(function(t){return!t.hasAttribute("disabled")});var o=true,a=false,s=undefined;try{for(var l=i[Symbol.iterator](),u;!(o=(u=l.next()).done);o=true){var c=u.value;var d=c.getBoundingClientRect();if(e>=d.left&&e<=d.right&&n>=d.top&&n<=d.bottom)return c}}catch(t){a=true;s=t}finally{try{if(!o&&l.return!=null){l.return()}}finally{if(a){throw s}}}return null};var n6=function t(t,e,n,i){if(!i)return null;var o=t.filter(function(t){return!t.hasAttribute("disabled")}),a=i.getBoundingClientRect();var s=true,l=false,u=undefined;try{for(var c=o[Symbol.iterator](),d;!(s=(d=c.next()).done);s=true){var h=d.value;var f=h.getBoundingClientRect();if(!(a.right<f.left||a.left>f.right||a.bottom<f.top||a.top>f.bottom))return h}}catch(t){l=true;u=t}finally{try{if(!s&&c.return!=null){c.return()}}finally{if(l){throw u}}}return null};var n8=function t(t,e,n,i){var o=t.filter(function(t){return!t.hasAttribute("disabled")});if(o.length===0)return null;var a,s;if(i){var l=i.getBoundingClientRect();a=l.left+l.width/2,s=l.top+l.height/2}else a=e,s=n;var u=null,c=1/0;var d=true,h=false,f=undefined;try{for(var p=o[Symbol.iterator](),v;!(d=(v=p.next()).done);d=true){var m=v.value;var g=m.getBoundingClientRect(),y=g.left+g.width/2,b=g.top+g.height/2,w=Math.sqrt(Math.pow(a-y,2)+Math.pow(s-b,2));w<c&&(c=w,u=m)}}catch(t){h=true;f=t}finally{try{if(!d&&p.return!=null){p.return()}}finally{if(h){throw f}}}return u};var n7=function t(t,e,n,i){var o=t.filter(function(t){return!t.hasAttribute("disabled")});if(o.length===0)return null;var a;if(i){var s=i.getBoundingClientRect();a=[{x:s.left,y:s.top},{x:s.right,y:s.top},{x:s.left,y:s.bottom},{x:s.right,y:s.bottom}]}else a=[{x:e,y:n},{x:e,y:n},{x:e,y:n},{x:e,y:n}];var l=null,u=1/0;var c=true,d=false,h=undefined;try{for(var f=o[Symbol.iterator](),p;!(c=(p=f.next()).done);c=true){var v=p.value;var m=v.getBoundingClientRect(),g=[{x:m.left,y:m.top},{x:m.right,y:m.top},{x:m.left,y:m.bottom},{x:m.right,y:m.bottom}],y=0,b=0;var w=true,q=false,k=undefined,x=true,_=false,E=undefined;try{for(var C=a[Symbol.iterator](),S;!(x=(S=C.next()).done);x=true){var A=S.value;try{for(var R=g[Symbol.iterator](),I;!(w=(I=R.next()).done);w=true){var T=I.value;var M=Math.sqrt(Math.pow(A.x-T.x,2)+Math.pow(A.y-T.y,2));y+=M,b++}}catch(t){q=true;k=t}finally{try{if(!w&&R.return!=null){R.return()}}finally{if(q){throw k}}}}}catch(t){_=true;E=t}finally{try{if(!x&&C.return!=null){C.return()}}finally{if(_){throw E}}}var P=y/b;P<u&&(u=P,l=v)}}catch(t){d=true;h=t}finally{try{if(!c&&f.return!=null){f.return()}}finally{if(d){throw h}}}return l};var n9=function t(t,e,n,i,o){var a=o&&o.length>0?t.filter(function(t){return o.includes(t)}):t.filter(function(t){var e;return t.tagName==="SLOT"&&t.hasAttribute("part")&&((e=t.getAttribute("part"))===null||e===void 0?void 0:e.includes("drags"))}),s=t.filter(function(t){return!a.includes(t)});if(a.length===0&&s.length===0)return null;var l;if(i){var u=i.getBoundingClientRect();l=[{x:u.left,y:u.top},{x:u.right,y:u.top},{x:u.left,y:u.bottom},{x:u.right,y:u.bottom}]}else l=[{x:e,y:n},{x:e,y:n},{x:e,y:n},{x:e,y:n}];var c=function t(t){var e=t.getBoundingClientRect(),n=[{x:e.left,y:e.top},{x:e.right,y:e.top},{x:e.left,y:e.bottom},{x:e.right,y:e.bottom}],i=0,o=0;var a=true,s=false,u=undefined,c=true,d=false,h=undefined;try{for(var f=l[Symbol.iterator](),p;!(c=(p=f.next()).done);c=true){var v=p.value;try{for(var m=n[Symbol.iterator](),g;!(a=(g=m.next()).done);a=true){var y=g.value;var b=Math.sqrt(Math.pow(v.x-y.x,2)+Math.pow(v.y-y.y,2));i+=b,o++}}catch(t){s=true;u=t}finally{try{if(!a&&m.return!=null){m.return()}}finally{if(s){throw u}}}}}catch(t){d=true;h=t}finally{try{if(!c&&f.return!=null){f.return()}}finally{if(d){throw h}}}return i/o},d=null,h=1/0;var f=true,p=false,v=undefined;try{for(var m=a[Symbol.iterator](),g;!(f=(g=m.next()).done);f=true){var y=g.value;var b=c(y);b<h&&(h=b,d=y)}}catch(t){p=true;v=t}finally{try{if(!f&&m.return!=null){m.return()}}finally{if(p){throw v}}}var w=null,q=1/0;var k=true,x=false,_=undefined;try{for(var E=s[Symbol.iterator](),C;!(k=(C=E.next()).done);k=true){var S=C.value;var A=c(S);A<q&&(q=A,w=S)}}catch(t){x=true;_=t}finally{try{if(!k&&E.return!=null){E.return()}}finally{if(x){throw _}}}if(d&&i){var R=i.getBoundingClientRect(),I=d.getBoundingClientRect(),T=R.left+R.width/2,M=R.top+R.height/2;if(T>=I.left&&T<=I.right&&M>=I.top&&M<=I.bottom)return d}var P=(i===null||i===void 0?void 0:i.getAttribute("data-drag-origin"))==="droppable"?.85:1.5;return d&&w?h<=q*P?d:w:d||w};var rt=function t(t){switch(t){case"pointerWithin":return n4;case"rectangleIntersection":return n6;case"closestCenter":return n8;case"closestCorners":return n7;case"closestCornersWithInventoryPriority":return n9;default:return n4}};var re=function t(t,e,n,i){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"pointerWithin",a=arguments.length>5?arguments[5]:void 0;return rt(o)(t,e,n,i,a)};var rn=function t(t,e){var n=t.composedPath?t.composedPath():[t.target];var i=true,o=false,a=undefined;try{for(var s=n[Symbol.iterator](),l;!(i=(l=s.next()).done);i=true){var u=l.value;if(m(u,HTMLElement)&&u.tagName!=="SLOT"){if(u.matches(e)||u.hasAttribute("qti-draggable"))return u;var c=u.closest(e)||u.closest('[qti-draggable="true"]');if(c)return c}}}catch(t){o=true;a=t}finally{try{if(!i&&s.return!=null){s.return()}}finally{if(o){throw a}}}return null};var rr=function t(t,e){var n=[];return t.forEach(function(t){var i;var o=[];t.tagName.toLowerCase()==="slot"?o=t.assignedElements({flatten:!0}).filter(function(t){return t.getAttribute("identifier")===e}):o=Array.from(t.querySelectorAll('[identifier="'.concat(e,'"]'))),(i=n).push.apply(i,N(o))}),n};var ri=function t(t,e){var n=t.find(function(t){return t.getAttribute("identifier")===e});if(!n)return 1;var i=n.getAttribute("match-max");return i?parseInt(i,10)||0:1};var ro=function t(t,e){var n=parseInt(t.getAttribute("match-max")||"1",10),i=Number.isNaN(n)?1:n;if(i===0)return!1;var o=t.querySelectorAll(e),a=t.querySelectorAll('[qti-draggable="true"]');return Math.max(o.length,a.length)>=i};var ra=function t(t,e){return t.reduce(function(t,n){var i=n.querySelectorAll(e).length,o=n.querySelectorAll('[qti-draggable="true"]').length;return t+Math.max(i,o)},0)};var rs=function t(t,e){return t.map(function(t){var n=Array.from(t.querySelectorAll(e)).map(function(t){return t.getAttribute("identifier")}).filter(function(t){return!!t}),i=t.getAttribute("identifier");return n.map(function(t){return"".concat(t," ").concat(i)})}).flat()};var rl=function t(t,e,n){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:(typeof window==="undefined"?"undefined":U(window))<"u"?window:null;if(!t.length||!e.length||!i)return;var o=0,a=0;t.forEach(function(t){var e=t.getBoundingClientRect();o=Math.max(o,e.height),a=Math.max(a,e.width)});var s=e[0].parentElement,l=e[0].tagName==="QTI-SIMPLE-ASSOCIABLE-CHOICE",u=e[0].tagName==="QTI-GAP";if(l&&s){var c;if(s.clientWidth>0){var d=i.getComputedStyle(s),h=parseFloat(d.paddingLeft),f=parseFloat(d.paddingRight);c=s.clientWidth-h-f}else c=Math.min(i.innerWidth*.8,600);s.style.gridTemplateColumns="repeat(auto-fit, minmax(calc(min(".concat(c,"px, ").concat(a,"px + 2 * var(--qti-dropzone-padding, 0.5rem))), 1fr))")}e.forEach(function(t){var e;t.style.minHeight="".concat(o,"px"),(l||u)&&(t.style.minWidth="".concat(a,"px"));var n=(e=t.shadowRoot)===null||e===void 0?void 0:e.querySelector('slot[part="dropslot"]');n&&(n.style.minHeight="".concat(o,"px"))}),n.forEach(function(t){t.style.minHeight="".concat(o,"px")})};var ru=function t(t){!t||d0.has(t)||(t.addEventListener("touchmove",function(){},{capture:!1,passive:!1}),d0.add(t))};var rc=function t(t){var e=t.getBoundingClientRect();return{left:e.left,top:e.top,width:e.width,height:e.height}};var rd=function t(t){var e=new Map;return t.forEach(function(t){e.set(t,rc(t))}),e};var rh=function t(t,e){return{deltaX:t.left-e.left,deltaY:t.top-e.top,deltaW:t.width/e.width,deltaH:t.height/e.height}};var rf=function t(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var i=rc(t),o=rh(e,i),a=o.deltaX,s=o.deltaY,l=o.deltaW,u=o.deltaH;if(a===0&&s===0&&l===1&&u===1)return null;var c=k({},d2,n),d=c.duration,h=c.easing,f=c.fill;return t.animate([{transformOrigin:"top left",transform:"translate(".concat(a,"px, ").concat(s,"px) scale(").concat(l,", ").concat(u,")")},{transformOrigin:"top left",transform:"none"}],{duration:d,easing:h,fill:f})};var rp=function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var n=new Map;return t.forEach(function(t,i){if(!m(i,HTMLElement))return;var o=rf(i,t,e);o&&n.set(i,o)}),n};var rv=function t(){return{placeholder:null,lastHoverTarget:null,lastPlacement:null,sortContainer:null}};var rm=function t(t){var e;(e=t.placeholder)===null||e===void 0?void 0:e.remove(),t.placeholder=null,t.lastHoverTarget=null,t.lastPlacement=null,t.sortContainer=null};var rg=function t(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var i=k({},d6,n),o=document.createElement("div");return o.setAttribute("data-drop-placeholder","true"),o.style.width="".concat(e.width,"px"),o.style.height="".concat(e.height,"px"),o.style.margin=window.getComputedStyle(t).margin,o.style.boxSizing="border-box",o.style.border="".concat(i.borderStyle," ").concat(i.borderColor),o.style.borderRadius=getComputedStyle(t).borderRadius,o.style.background=i.background,o.style.transition="transform ".concat(i.transitionDuration,"ms ease"),o.style.pointerEvents="none",o};var ry=function t(t,e){var n=true,i=false,o=undefined;try{for(var a=e[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;if(l.contains(t)&&l!==t)return l}}catch(t){i=true;o=t}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(i){throw o}}}return null};var rb=function t(t,e,n,i){var o=n.getAttribute("width")?parseFloat(n.getAttribute("width")):n.naturalWidth,a=n.getAttribute("height")?parseFloat(n.getAttribute("height")):n.naturalHeight;switch(t){case"circle":{if(e.length!==3){console.error("Invalid circle coordinates:",e);return}var s=T(e,3),l=s[0],u=s[1],c=s[2],d=l/o*100,h=u/a*100,f=c/o*100,p=c/a*100;i.style.left=d-f+"%",i.style.top=h-p+"%",i.style.width=2*f+"%",i.style.height=2*p+"%",i.style.borderRadius="50%"}break;case"rect":{if(e.length!==4){console.error("Invalid rectangle coordinates:",e);return}var v=T(e,4),m=v[0],g=v[1],y=v[2],b=v[3],w=m/o*100,q=g/a*100,k=y/o*100,x=b/a*100;i.style.left=w+"%",i.style.top=q+"%",i.style.width=k-w+"%",i.style.height=x-q+"%"}break;case"ellipse":{if(e.length!==4){console.error("Invalid ellipse coordinates:",e);return}var _=T(e,4),E=_[0],C=_[1],S=_[2],A=_[3],R=E/o*100,I=C/a*100,M=S/o*100,P=A/a*100;i.style.left=R-M+"%",i.style.top=I-P+"%",i.style.width=2*M+"%",i.style.height=2*P+"%",i.style.borderRadius="50%"}break;case"poly":{var O,U,L,D;if(e.length<6||e.length%2!==0){console.error("Invalid polygon coordinates:",e);return}var V=[];for(var $=0;$<e.length;$+=2)V.push({x:e[$],y:e[$+1]});var W=(O=Math).min.apply(O,N(V.map(function(t){return t.x}))),j=(U=Math).max.apply(U,N(V.map(function(t){return t.x}))),F=(L=Math).min.apply(L,N(V.map(function(t){return t.y}))),z=(D=Math).max.apply(D,N(V.map(function(t){return t.y}))),B=W/o*100,H=F/a*100,Q=j/o*100,X=z/a*100;i.style.left=B+"%",i.style.top=H+"%",i.style.width=Q-B+"%",i.style.height=X-H+"%";var G=V.map(function(t){return{x:(t.x-W)/(j-W)*100,y:(t.y-F)/(z-F)*100}}).map(function(t){return"".concat(t.x,"% ").concat(t.y,"%")}).join(",");i.style.clipPath="polygon(".concat(G,")")}break;default:console.error("Unsupported shape: ".concat(t));break}};var rw=function t(t){return /*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(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(),i=!1;if(typeof n=="string")if(n==="true")i=!0;else if(n==="false")i=!1;else return console.error("unexpected val in qti-or, expected boolean"),null;else typeof n=="boolean"&&(i=n);return i}).every(function(t){return typeof t=="boolean"&&t})}}]);return e}(t)};var rq=function t(t){return /*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(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 rk,rx,r_,rE,rC,rS,rA,rR,rI,rT,rM;var rP;var rO=Object.defineProperty;var rN=Object.getOwnPropertyDescriptor;var rU=Object.getOwnPropertyNames;var rL=Object.prototype.hasOwnProperty;var rD=function t(t){throw TypeError(t)};var rV=function t(t,e){for(var n in e)rO(t,n,{get:e[n],enumerable:!0})},r$=function t(t,e,n,i){var o=true,a=false,s=undefined;if(e&&(typeof e==="undefined"?"undefined":U(e))=="object"||typeof e=="function")try{var l=function(){var o=c.value;!rL.call(t,o)&&o!==n&&rO(t,o,{get:function t(){return e[o]},enumerable:!(i=rN(e,o))||i.enumerable})};for(var u=rU(e)[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 t};var rW=function t(t){return r$(rO({},"__esModule",{value:!0}),t)},rj=function t(t,e,n,i){for(var o=i>1?void 0:i?rN(e,n):e,a=t.length-1,s;a>=0;a--)(s=t[a])&&(o=(i?s(e,n,o):s(o))||o);return i&&o&&rO(e,n,o),o};var rF=function t(t,e,n){return e.has(t)||rD("Cannot "+n)};var rz=function t(t,e,n){return rF(t,e,"read from private field"),n?n.call(t):e.get(t)},rB=function t(t,e,n){return e.has(t)?rD("Cannot add the same private member more than once"):m(e,WeakSet)?e.add(t):e.set(t,n)},rH=function t(t,e,n,i){return rF(t,e,"write to private field"),i?i.call(t,n):e.set(t,n),n},rQ=function t(t,e,n){return rF(t,e,"access private method"),n};var rX=function t(t,e,n,i){return{set _(r){rH(t,e,r,n)},get _(){return rz(t,e,i)}}};var rG={};rV(rG,{Correctness:function t(){return as},INITIAL_SESSION_CONTEXT:function t(){return oz},INITIAL_TEST_CONTEXT:function t(){return oH},Interaction:function t(){return al},IsNullOrUndefined:function t(){return q},ItemContainer:function t(){return cB},ItemCorrectResponseMode:function t(){return cX},ItemPrintVariables:function t(){return de},ItemShowCandidateCorrection:function t(){return c5},ItemShowCorrectResponse:function t(){return dt},QtiAnd:function t(){return p2},QtiAnyN:function t(){return p3},QtiAssessmentItem:function t(){return si},QtiAssessmentItemRef:function t(){return aW},QtiAssessmentSection:function t(){return az},QtiAssessmentStimulusRef:function t(){return ss},QtiAssessmentStimulusRefConnectedEvent:function t(){return sa},QtiAssessmentTest:function t(){return aH},QtiAssociableHotspot:function t(){return dy},QtiAssociateInteraction:function t(){return ht},QtiBaseValue:function t(){return p5},QtiChoiceInteraction:function t(){return ha},QtiCompanionMaterialsInfo:function t(){return sl},QtiConditionExpression:function t(){return ad},QtiContainerSize:function t(){return p4},QtiContains:function t(){return p6},QtiContentBody:function t(){return sw},QtiContextDeclaration:function t(){return sQ},QtiCorrect:function t(){return p8},QtiCustomInteraction:function t(){return hk},QtiCustomOperator:function t(){return sc},QtiDefault:function t(){return p7},QtiDelete:function t(){return mU},QtiDivide:function t(){return vl},QtiDurationGte:function t(){return vh},QtiDurationLt:function t(){return vm},QtiEndAttemptInteraction:function t(){return h_},QtiEqual:function t(){return vo},QtiEqualRounded:function t(){return p9},QtiExpression:function t(){return ac},QtiExtendedTextInteraction:function t(){return hC},QtiFeedback:function t(){return am},QtiFeedbackBlock:function t(){return sd},QtiFeedbackInline:function t(){return sf},QtiFieldValue:function t(){return vB},QtiGap:function t(){return dw},QtiGapImg:function t(){return dk},QtiGapMatchInteraction:function t(){return hT},QtiGapText:function t(){return dE},QtiGcd:function t(){return vw},QtiGraphicAssociateInteraction:function t(){return hj},QtiGraphicGapMatchInteraction:function t(){return hQ},QtiGraphicOrderInteraction:function t(){return hK},QtiGt:function t(){return vq},QtiGte:function t(){return vk},QtiHotspotChoice:function t(){return dS},QtiHotspotInteraction:function t(){return h5},QtiHottext:function t(){return dR},QtiHottextInteraction:function t(){return h9},QtiIndex:function t(){return mV},QtiInlineChoice:function t(){return dO},QtiInlineChoiceInteraction:function t(){return fx},QtiInside:function t(){return vI},QtiIntegerDivide:function t(){return vP},QtiIntegerModulus:function t(){return vU},QtiIntegerToFloat:function t(){return vL},QtiIsNull:function t(){return vz},QtiItem:function t(){return dm},QtiItemBody:function t(){return sm},QtiLcm:function t(){return vj},QtiLookupOutcomeValue:function t(){return pQ},QtiLt:function t(){return vH},QtiLte:function t(){return vQ},QtiMapResponse:function t(){return vX},QtiMapResponsePoint:function t(){return vG},QtiMatch:function t(){return vZ},QtiMatchInteraction:function t(){return fA},QtiMathOperator:function t(){return vK},QtiMax:function t(){return v2},QtiMediaInteraction:function t(){return fT},QtiMember:function t(){return v3},QtiMin:function t(){return v6},QtiModalFeedback:function t(){return sp},QtiMultiple:function t(){return v8},QtiNot:function t(){return v7},QtiNull:function t(){return vF},QtiOr:function t(){return v9},QtiOrderInteraction:function t(){return fU},QtiOrdered:function t(){return mt},QtiOutcomeDeclaration:function t(){return sT},QtiPatternMatch:function t(){return mn},QtiPortableCustomInteraction:function t(){return f8},QtiPositionObjectInteraction:function t(){return pe},QtiPositionObjectStage:function t(){return pr},QtiPower:function t(){return me},QtiPrintedVariable:function t(){return mr},QtiProduct:function t(){return mi},QtiPrompt:function t(){return dU},QtiRandom:function t(){return mN},QtiRandomInteger:function t(){return mO},QtiRepeat:function t(){return ml},QtiResponseCondition:function t(){return pX},QtiResponseDeclaration:function t(){return sI},QtiResponseElse:function t(){return pZ},QtiResponseElseIf:function t(){return p1},QtiResponseIf:function t(){return p0},QtiResponseProcessing:function t(){return sL},QtiRound:function t(){return vt},QtiRoundTo:function t(){return vi},QtiRubricBlock:function t(){return sq},QtiRuleElement:function t(){return ag},QtiSelectPointInteraction:function t(){return pg},QtiSetCorrectResponse:function t(){return mh},QtiSetCorrectResponseRule:function t(){return mv},QtiSetOutcomeValue:function t(){return pY},QtiSetOutcomeValueRule:function t(){return pK},QtiSetTemplateValue:function t(){return mb},QtiSetTemplateValueRule:function t(){return mk},QtiSimpleAssociableChoice:function t(){return dD},QtiSimpleChoice:function t(){return d$},QtiSliderInteraction:function t(){return pA},QtiStatsOperator:function t(){return mC},QtiStringMatch:function t(){return mR},QtiStylesheet:function t(){return sE},QtiSubstring:function t(){return mA},QtiSubtract:function t(){return mS},QtiSum:function t(){return mI},QtiSumExpression:function t(){return mT},QtiTemplateConstraint:function t(){return sH},QtiTemplateDeclaration:function t(){return sF},QtiTemplateProcessing:function t(){return sB},QtiTest:function t(){return aV},QtiTestFeedback:function t(){return sX},QtiTestPart:function t(){return aX},QtiTextEntryInteraction:function t(){return pU},QtiTruncate:function t(){return mM},QtiUploadInteraction:function t(){return pF},QtiVariable:function t(){return mP},QtiVariableDeclaration:function t(){return au},ScoringHelper:function t(){return ay},TestCheckItem:function t(){return c$},TestContainer:function t(){return cC},TestEndAttempt:function t(){return ls},TestItemLink:function t(){return la},TestNavigation:function t(){return s4},TestNext:function t(){return le},TestPagingButtonsStamp:function t(){return cp},TestPrev:function t(){return ln},TestPrintContext:function t(){return cP},TestPrintVariables:function t(){return cS},TestScoringButtons:function t(){return cL},TestScoringFeedback:function t(){return cV},TestSectionButtonsStamp:function t(){return cR},TestSectionLink:function t(){return cM},TestShowCorrectResponse:function t(){return lh},TestStamp:function t(){return cO},TestView:function t(){return lo},TestViewToggle:function t(){return cD},asSeed:function t(){return oj},computedContext:function t(){return oU},computedItemContext:function t(){return oN},configContext:function t(){return oL},convertNumberToUniversalFormat:function t(){return af},decimalSeparator:function t(){return ah},getItemByUri:function t(){return pB},getManifestInfo:function t(){return pz},isSeed:function t(){return oW},itemContext:function t(){return oV},itemContextVariables:function t(){return oD},qtiAndMixin:function t(){return rw},qtiContext:function t(){return oF},qtiSubtractMixin:function t(){return rq},qtiTransformItem:function t(){return a_},qtiTransformManifest:function t(){return aE},qtiTransformTest:function t(){return aP},removeDoubleSlashes:function t(){return x},sessionContext:function t(){return oB},testContext:function t(){return oQ}});var rJ=/*#__PURE__*/function(t){"use strict";v(e,t);function e(t,n,i,o){l(this,e);var a;a=s(this,e,["context-request",{bubbles:!0,composed:!0}]),a.context=t,a.contextTarget=n,a.callback=i,a.subscribe=o!==null&&o!==void 0?o:!1;return a}return e}(D(Event));var rY=/*#__PURE__*/function(){"use strict";function t(e,n,i,o){var a=this;l(this,t);if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=function(t,e){a.unsubscribe&&(a.unsubscribe!==e&&(a.provided=!1,a.unsubscribe()),a.subscribe||a.unsubscribe()),a.value=t,a.host.requestUpdate(),a.provided&&!a.subscribe||(a.provided=!0,a.callback&&a.callback(t,e)),a.unsubscribe=e},this.host=e,n.context!==void 0){var s;var u=n;this.context=u.context,this.callback=u.callback,this.subscribe=(s=u.subscribe)!==null&&s!==void 0?s:!1}else this.context=n,this.callback=i,this.subscribe=o!==null&&o!==void 0?o:!1;this.host.addController(this)}d(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 rJ(this.context,this.host,this.t,this.subscribe))}}]);return t}();var rK=/*#__PURE__*/function(){"use strict";function t(e){var n=this;l(this,t);this.subscriptions=new Map,this.updateObservers=function(){var t=true,e=false,i=undefined;try{for(var o=n.subscriptions[Symbol.iterator](),a;!(t=(a=o.next()).done);t=true){var s=T(a.value,2),l=s[0],u=s[1],c=u.disposer;l(n.o,c)}}catch(t){e=true;i=t}finally{try{if(!t&&o.return!=null){o.return()}}finally{if(e){throw i}}}},e!==void 0&&(this.value=e)}d(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 i=this;if(!n)return void t(this.value);this.subscriptions.has(t)||this.subscriptions.set(t,{disposer:function e(){i.subscriptions.delete(t)},consumerHost:e});var o=this.subscriptions.get(t),a=o.disposer;t(this.value,a)}},{key:"clearCallbacks",value:function t(){this.subscriptions.clear()}}]);return t}();var rZ=/*#__PURE__*/function(t){"use strict";v(e,t);function e(t,n){l(this,e);var i;i=s(this,e,["context-provider",{bubbles:!0,composed:!0}]),i.context=t,i.contextTarget=n;return i}return e}(D(Event)),r0=/*#__PURE__*/function(t){"use strict";v(e,t);function e(t,n,i){l(this,e);var o;var a,u;o=s(this,e,[n.context!==void 0?n.initialValue:i]),o.onContextRequest=function(t){var e;if(t.context!==o.context)return;var n=(e=t.contextTarget)!==null&&e!==void 0?e:t.composedPath()[0];n!==o.host&&(t.stopPropagation(),o.addCallback(t.callback,n,t.subscribe))},o.onProviderRequest=function(t){var e;if(t.context!==o.context||((e=t.contextTarget)!==null&&e!==void 0?e:t.composedPath()[0])===o.host)return;var n=new Set;var i=true,a=false,s=undefined;try{for(var l=o.subscriptions[Symbol.iterator](),u;!(i=(u=l.next()).done);i=true){var c=T(u.value,2),d=c[0],h=c[1],f=h.consumerHost;n.has(d)||(n.add(d),f.dispatchEvent(new rJ(o.context,f,d,!0)))}}catch(t){a=true;s=t}finally{try{if(!i&&l.return!=null){l.return()}}finally{if(a){throw s}}}t.stopPropagation()},o.host=t,n.context!==void 0?o.context=n.context:o.context=n,o.attachListeners(),(a=(u=o.host).addController)===null||a===void 0?void 0:a.call(u,o);return o}d(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 rZ(this.context,this.host))}}]);return e}(rK);var r1=/*#__PURE__*/function(){"use strict";function t(e){l(this,t);this.ariaActiveDescendantElement=null,this.ariaAtomic="",this.ariaAutoComplete="",this.ariaBrailleLabel="",this.ariaBrailleRoleDescription="",this.ariaBusy="",this.ariaChecked="",this.ariaColCount="",this.ariaColIndex="",this.ariaColIndexText="",this.ariaColSpan="",this.ariaControlsElements=null,this.ariaCurrent="",this.ariaDescribedByElements=null,this.ariaDescription="",this.ariaDetailsElements=null,this.ariaDisabled="",this.ariaErrorMessageElements=null,this.ariaExpanded="",this.ariaFlowToElements=null,this.ariaHasPopup="",this.ariaHidden="",this.ariaInvalid="",this.ariaKeyShortcuts="",this.ariaLabel="",this.ariaLabelledByElements=null,this.ariaLevel="",this.ariaLive="",this.ariaModal="",this.ariaMultiLine="",this.ariaMultiSelectable="",this.ariaOrientation="",this.ariaOwnsElements=null,this.ariaPlaceholder="",this.ariaPosInSet="",this.ariaPressed="",this.ariaReadOnly="",this.ariaRelevant="",this.ariaRequired="",this.ariaRoleDescription="",this.ariaRowCount="",this.ariaRowIndex="",this.ariaRowIndexText="",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}d(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 r2=function t(t,e,n,i,o){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?o.call(t,n):o?o.value=n:e.set(t,n),n},r3=function t(t,e,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(t):i?i.value:e.get(t)},r5,r4,r6,r8,r7,r9,it,ie,ir,ii,io,ia,is=function t(t){var e;return typeof t=="boolean"?t:(e=t===null||t===void 0?void 0:t.capture)!==null&&e!==void 0?e:!1};var il=/*#__PURE__*/function(){"use strict";function t(){l(this,t);this.__eventListeners=new Map,this.__captureEventListeners=new Map}d(t,[{key:"addEventListener",value:function t(t,e,n){var i=this;var o;if(e==null)return;var a=is(n)?this.__captureEventListeners:this.__eventListeners,s=a.get(t);if(s===void 0)s=new Map,a.set(t,s);else if(s.has(e))return;var l=(typeof n==="undefined"?"undefined":U(n))=="object"&&n?n:{};(o=l.signal)===null||o===void 0?void 0:o.addEventListener("abort",function(){return i.removeEventListener(t,e,n)}),s.set(e,l!==null&&l!==void 0?l:{})}},{key:"removeEventListener",value:function t(t,e,n){if(e==null)return;var i=is(n)?this.__captureEventListeners:this.__eventListeners,o=i.get(t);o!==void 0&&(o.delete(e),o.size||i.delete(t))}},{key:"dispatchEvent",value:function t(t){var e=this;var n=[this],i=this.__eventTargetParent;if(t.composed)for(;i;)n.push(i),i=i.__eventTargetParent;else for(;i&&i!==this.__host;)n.push(i),i=i.__eventTargetParent;var o=!1,a=!1,s=0,l=null,u=null,c=null,d=t.stopPropagation,h=t.stopImmediatePropagation;Object.defineProperties(t,{target:k({get:function t(){return l!==null&&l!==void 0?l:u}},ic),srcElement:k({get:function e(){return t.target}},ic),currentTarget:k({get:function t(){return c}},ic),eventPhase:k({get:function t(){return s}},ic),composedPath:k({value:function t(){return n}},ic),stopPropagation:k({value:function e(){o=!0,d.call(t)}},ic),stopImmediatePropagation:k({value:function e(){a=!0,h.call(t)}},ic)});var f=function e(e,n,i){typeof e=="function"?e(t):typeof(e===null||e===void 0?void 0:e.handleEvent)=="function"&&e.handleEvent(t),n.once&&i.delete(e)},p=function e(){return c=null,s=0,!t.defaultPrevented},v=n.slice().reverse();l=!this.__host||!t.composed?this:null;var m=function t(t){for(u=e;u.__host&&t.includes(u.__host);)u=u.__host};var g=true,y=false,b=undefined;try{for(var w=v[Symbol.iterator](),q;!(g=(q=w.next()).done);g=true){var x=q.value;!l&&(!u||u===x.__host)&&m(v.slice(v.indexOf(x))),c=x,s=x===t.target?2:1;var _=x.__captureEventListeners.get(t.type);if(_){var E=true,C=false,S=undefined;try{for(var A=_[Symbol.iterator](),R;!(E=(R=A.next()).done);E=true){var I=T(R.value,2),M=I[0],P=I[1];if(f(M,P,_),a)return p()}}catch(t){C=true;S=t}finally{try{if(!E&&A.return!=null){A.return()}}finally{if(C){throw S}}}}if(o)return p()}}catch(t){y=true;b=t}finally{try{if(!g&&w.return!=null){w.return()}}finally{if(y){throw b}}}var O=t.bubbles?n:[this];u=null;var N=true,U=false,L=undefined;try{for(var D=O[Symbol.iterator](),V;!(N=(V=D.next()).done);N=true){var $=V.value;!l&&(!u||$===u.__host)&&m(O.slice(0,O.indexOf($)+1)),c=$,s=$===t.target?2:3;var W=$.__eventListeners.get(t.type);if(W){var j=true,F=false,z=undefined;try{for(var B=W[Symbol.iterator](),H;!(j=(H=B.next()).done);j=true){var Q=T(H.value,2),X=Q[0],G=Q[1];if(f(X,G,W),a)return p()}}catch(t){F=true;z=t}finally{try{if(!j&&B.return!=null){B.return()}}finally{if(F){throw z}}}}if(o)return p()}}catch(t){U=true;L=t}finally{try{if(!N&&D.return!=null){D.return()}}finally{if(U){throw L}}}return p()}}]);return t}(),iu=il;var ic={__proto__:null};ic.enumerable=!0;Object.freeze(ic);var id=(ii=/*#__PURE__*/function(){"use strict";function t(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};l(this,t);if(r5.set(this,!1),r4.set(this,!1),r6.set(this,!1),r8.set(this,!1),r7.set(this,Date.now()),r9.set(this,!1),it.set(this,void 0),ie.set(this,void 0),ir.set(this,void 0),this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,arguments.length===0)throw new Error("The type argument must be specified");if((typeof n==="undefined"?"undefined":U(n))!="object"||!n)throw new Error('The "options" argument must be an object');var i=n.bubbles,o=n.cancelable,a=n.composed;r2(this,r5,!!o,"f"),r2(this,r4,!!i,"f"),r2(this,r6,!!a,"f"),r2(this,it,"".concat(e),"f"),r2(this,ie,null,"f"),r2(this,ir,!1,"f")}d(t,[{key:"initEvent",value:function t(t,e,n){throw new Error("Method not implemented.")}},{key:"stopImmediatePropagation",value:function t(){this.stopPropagation()}},{key:"preventDefault",value:function t(){r2(this,r8,!0,"f")}},{key:"target",get:function t(){return r3(this,ie,"f")}},{key:"currentTarget",get:function t(){return r3(this,ie,"f")}},{key:"srcElement",get:function t(){return r3(this,ie,"f")}},{key:"type",get:function t(){return r3(this,it,"f")}},{key:"cancelable",get:function t(){return r3(this,r5,"f")}},{key:"defaultPrevented",get:function t(){return r3(this,r5,"f")&&r3(this,r8,"f")}},{key:"timeStamp",get:function t(){return r3(this,r7,"f")}},{key:"composedPath",value:function t(){return r3(this,ir,"f")?[r3(this,ie,"f")]:[]}},{key:"returnValue",get:function t(){return!r3(this,r5,"f")||!r3(this,r8,"f")}},{key:"bubbles",get:function t(){return r3(this,r4,"f")}},{key:"composed",get:function t(){return r3(this,r6,"f")}},{key:"eventPhase",get:function t(){return r3(this,ir,"f")?ii.AT_TARGET:ii.NONE}},{key:"cancelBubble",get:function t(){return r3(this,r9,"f")},set:function t(t){t&&r2(this,r9,!0,"f")}},{key:"stopPropagation",value:function t(){r2(this,r9,!0,"f")}},{key:"isTrusted",get:function t(){return!1}}]);return t}(),r5=new WeakMap,r4=new WeakMap,r6=new WeakMap,r8=new WeakMap,r7=new WeakMap,r9=new WeakMap,it=new WeakMap,ie=new WeakMap,ir=new WeakMap,ii.NONE=0,ii.CAPTURING_PHASE=1,ii.AT_TARGET=2,ii.BUBBLING_PHASE=3,ii);Object.defineProperties(id.prototype,{initEvent:ic,stopImmediatePropagation:ic,preventDefault:ic,target:ic,currentTarget:ic,srcElement:ic,type:ic,cancelable:ic,defaultPrevented:ic,timeStamp:ic,composedPath:ic,returnValue:ic,bubbles:ic,composed:ic,eventPhase:ic,cancelBubble:ic,stopPropagation:ic,isTrusted:ic});var ih=(ia=/*#__PURE__*/function(t){"use strict";v(e,t);function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};l(this,e);var i;var o;i=s(this,e,[t,n]),io.set(i,void 0),r2(i,io,(o=n===null||n===void 0?void 0:n.detail)!==null&&o!==void 0?o:null,"f");return i}d(e,[{key:"initCustomEvent",value:function t(t,e,n,i){throw new Error("Method not implemented.")}},{key:"detail",get:function t(){return r3(this,io,"f")}}]);return e}(id),io=new WeakMap,ia);Object.defineProperties(ih.prototype,{detail:ic});var ip=id,iv=ih;var im;var ig=(im=/*#__PURE__*/function(){"use strict";function t(){l(this,t);this.STYLE_RULE=1,this.CHARSET_RULE=2,this.IMPORT_RULE=3,this.MEDIA_RULE=4,this.FONT_FACE_RULE=5,this.PAGE_RULE=6,this.NAMESPACE_RULE=10,this.KEYFRAMES_RULE=7,this.KEYFRAME_RULE=8,this.SUPPORTS_RULE=12,this.COUNTER_STYLE_RULE=11,this.FONT_FEATURE_VALUES_RULE=14,this.__parentStyleSheet=null,this.cssText=""}d(t,[{key:"parentRule",get:function t(){return null}},{key:"parentStyleSheet",get:function t(){return this.__parentStyleSheet}},{key:"type",get:function t(){return 0}}]);return t}(),im.STYLE_RULE=1,im.CHARSET_RULE=2,im.IMPORT_RULE=3,im.MEDIA_RULE=4,im.FONT_FACE_RULE=5,im.PAGE_RULE=6,im.NAMESPACE_RULE=10,im.KEYFRAMES_RULE=7,im.KEYFRAME_RULE=8,im.SUPPORTS_RULE=12,im.COUNTER_STYLE_RULE=11,im.FONT_FEATURE_VALUES_RULE=14,im);(rk=globalThis.Event)!==null&&rk!==void 0?rk:globalThis.Event=ip;(rx=globalThis.CustomEvent)!==null&&rx!==void 0?rx:globalThis.CustomEvent=iv;var iy=new WeakMap,ib=function t(t){var e=iy.get(t);return e===void 0&&iy.set(t,e=new Map),e},iw=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments),t.__shadowRootMode=null,t.__shadowRoot=null,t.__internals=null;return t}d(e,[{key:"attributes",get:function t(){return Array.from(ib(this)).map(function(t){var e=T(t,2),n=e[0],i=e[1];return{name:n,value:i}})}},{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){ib(this).set(t,String(e))}},{key:"removeAttribute",value:function t(t){ib(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 ib(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 r1(this);return this.__internals=t,t}},{key:"getAttribute",value:function t(t){var e;return(e=ib(this).get(t))!==null&&e!==void 0?e:null}}]);return e}(iu);var iq=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}return e}(iw),ik=iq;(r_=globalThis.litServerRoot)!==null&&r_!==void 0?r_:globalThis.litServerRoot=Object.defineProperty(new ik,"localName",{get:function t(){return"lit-server-root"}});var ix=/*#__PURE__*/function(){"use strict";function t(){l(this,t);this.__definitions=new Map,this.__reverseDefinitions=new Map,this.__pendingWhenDefineds=new Map}d(t,[{key:"define",value:function t(t,e){var n;var i;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'));if(this.__reverseDefinitions.has(e))throw new Error("Failed to execute 'define' on 'CustomElementRegistry': the constructor has already been used with this registry for the tag name ".concat(this.__reverseDefinitions.get(e)));e.__localName=t,this.__definitions.set(t,{ctor:e,observedAttributes:(n=e.observedAttributes)!==null&&n!==void 0?n:[]}),this.__reverseDefinitions.set(e,t),(i=this.__pendingWhenDefineds.get(t))===null||i===void 0?void 0:i.resolve(e),this.__pendingWhenDefineds.delete(t)}},{key:"get",value:function t(t){var e;return(e=this.__definitions.get(t))===null||e===void 0?void 0:e.ctor}},{key:"getName",value:function t(t){var e;return(e=this.__reverseDefinitions.get(t))!==null&&e!==void 0?e:null}},{key:"upgrade",value:function t(t){throw new Error("customElements.upgrade is not currently supported in SSR. Please file a bug if you need it.")}},{key:"whenDefined",value:function t(t){return a(function(){var e,i;return $(this,function(o){e=this.__definitions.get(t);if(e)return[2,e.ctor];i=this.__pendingWhenDefineds.get(t);return[2,(i||(i=n(),this.__pendingWhenDefineds.set(t,i)),i.promise)]})}).call(this)}}]);return t}(),i_=ix;var iE=new i_;var iC=globalThis,iS=iC.ShadowRoot&&(iC.ShadyCSS===void 0||iC.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,iA=Symbol(),iR=new WeakMap,iI=/*#__PURE__*/function(){"use strict";function t(e,n,i){l(this,t);if(this._$cssResult$=!0,i!==iA)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=n}d(t,[{key:"styleSheet",get:function t(){var t=this.o,e=this.t;if(iS&&t===void 0){var n=e!==void 0&&e.length===1;n&&(t=iR.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),n&&iR.set(e,t))}return t}},{key:"toString",value:function t(){return this.cssText}}]);return t}(),iT=function t(t){return new iI(typeof t=="string"?t:t+"",void 0,iA)},iM=function t(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++){n[i-1]=arguments[i]}var o=t.length===1?t[0]:n.reduce(function(e,n,i){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[i+1]},t[0]);return new iI(o,t,iA)},iP=function t(t,e){var n=true,i=false,o=undefined;if(iS)t.adoptedStyleSheets=e.map(function(t){return m(t,CSSStyleSheet)?t:t.styleSheet});else try{for(var a=e[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;var u=document.createElement("style"),c=iC.litNonce;c!==void 0&&u.setAttribute("nonce",c),u.textContent=l.cssText,t.appendChild(u)}}catch(t){i=true;o=t}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(i){throw o}}}},iO=iS||iC.CSSStyleSheet===void 0?function(t){return t}:function(t){return m(t,CSSStyleSheet)?function(t){var e="";var n=true,i=false,o=undefined;try{for(var a=t.cssRules[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;e+=l.cssText}}catch(t){i=true;o=t}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(i){throw o}}}return iT(e)}(t):t};var iN=Object.is,iU=Object.defineProperty,iL=Object.getOwnPropertyDescriptor,iD=Object.getOwnPropertyNames,iV=Object.getOwnPropertySymbols,i$=Object.getPrototypeOf,iW=globalThis;(rE=iW.customElements)!==null&&rE!==void 0?rE:iW.customElements=iE;var ij=iW.trustedTypes,iF=ij?ij.emptyScript:"",iz=iW.reactiveElementPolyfillSupport,iB=function t(t,e){return t},iH={toAttribute:function t(t,e){switch(e){case Boolean:t=t?iF: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}},iQ=function t(t,e){return!iN(t,e)},iX={attribute:!0,type:String,converter:iH,reflect:!1,useDefault:!1,hasChanged:iQ};(rC=Symbol.metadata)!==null&&rC!==void 0?rC:Symbol.metadata=Symbol("metadata"),(rS=iW.litPropertyMetadata)!==null&&rS!==void 0?rS:iW.litPropertyMetadata=new WeakMap;var iG=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e),t._$Ep=void 0,t.isUpdatePending=!1,t.hasUpdated=!1,t._$Em=null,t._$Ev();return t}d(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;((e=this._$EO)!==null&&e!==void 0?e:this._$EO=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&((n=t.hostConnected)===null||n===void 0?void 0:n.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,i=false,o=undefined;try{for(var a=e.keys()[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;this.hasOwnProperty(l)&&(t.set(l,this[l]),delete this[l])}}catch(t){i=true;o=t}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(i){throw o}}}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 iP(e,this.constructor.elementStyles),e}},{key:"connectedCallback",value:function t(){var t;var e;(t=this.renderRoot)!==null&&t!==void 0?t:this.renderRoot=this.createRenderRoot(),this.enableUpdating(!0),(e=this._$EO)===null||e===void 0?void 0:e.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:"_$ET",value:function t(t,e){var n=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,n);if(i!==void 0&&n.reflect===!0){var o;var a=(((o=n.converter)===null||o===void 0?void 0:o.toAttribute)!==void 0?n.converter:iH).toAttribute(e,n.type);this._$Em=t,a==null?this.removeAttribute(i):this.setAttribute(i,a),this._$Em=null}}},{key:"_$AK",value:function t(t,e){var n=this.constructor,i=n._$Eh.get(t);if(i!==void 0&&this._$Em!==i){var o;var a,s;var l=n.getPropertyOptions(i),u=typeof l.converter=="function"?{fromAttribute:l.converter}:((a=l.converter)===null||a===void 0?void 0:a.fromAttribute)!==void 0?l.converter:iH;this._$Em=i;var c=u.fromAttribute(e,l.type);this[i]=(o=c!==null&&c!==void 0?c:(s=this._$Ej)===null||s===void 0?void 0:s.get(i))!==null&&o!==void 0?o:c,this._$Em=null}}},{key:"requestUpdate",value:function t(t,e,n){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,o=arguments.length>4?arguments[4]:void 0;if(t!==void 0){var a;var s;var l=this.constructor;if(i===!1&&(o=this[t]),n!==null&&n!==void 0?n:n=l.getPropertyOptions(t),!(((a=n.hasChanged)!==null&&a!==void 0?a:iQ)(o,e)||n.useDefault&&n.reflect&&o===((s=this._$Ej)===null||s===void 0?void 0:s.get(t))&&!this.hasAttribute(l._$Eu(t,n))))return;this.C(t,e,n)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}},{key:"C",value:function t(t,e,n,i){var o=n.useDefault,a=n.reflect,s=n.wrapped;var l,u,c;o&&!((l=this._$Ej)!==null&&l!==void 0?l:this._$Ej=new Map).has(t)&&(this._$Ej.set(t,(u=i!==null&&i!==void 0?i:e)!==null&&u!==void 0?u:this[t]),s!==!0||i!==void 0)||(this._$AL.has(t)||(this.hasUpdated||o||(e=void 0),this._$AL.set(t,e)),a===!0&&this._$Em!==t&&((c=this._$Eq)!==null&&c!==void 0?c:this._$Eq=new Set).add(t))}},{key:"_$EP",value:function t(){return a(function(){var t,e,n;return $(this,function(i){switch(i.label){case 0:this.isUpdatePending=!0;i.label=1;case 1:i.trys.push([1,3,,4]);return[4,this._$ES];case 2:i.sent();return[3,4];case 3:t=i.sent();Promise.reject(t);return[3,4];case 4:e=this.scheduleUpdate();n=e!=null;if(!n)return[3,6];return[4,e];case 5:n=i.sent();i.label=6;case 6:return[2,(n,!this.isUpdatePending)]}})}).call(this)}},{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,i=undefined;try{for(var o=this._$Ep[Symbol.iterator](),a;!(e=(a=o.next()).done);e=true){var s=T(a.value,2),l=s[0],u=s[1];this[l]=u}}catch(t){n=true;i=t}finally{try{if(!e&&o.return!=null){o.return()}}finally{if(n){throw i}}}this._$Ep=void 0}var c=this.constructor.elementProperties;var d=true,h=false,f=undefined;if(c.size>0)try{for(var p=c[Symbol.iterator](),v;!(d=(v=p.next()).done);d=true){var m=T(v.value,2),g=m[0],y=m[1];var b=y.wrapped,w=this[g];b!==!0||this._$AL.has(g)||w===void 0||this.C(g,void 0,y,w)}}catch(t){h=true;f=t}finally{try{if(!d&&p.return!=null){p.return()}}finally{if(h){throw f}}}}var q=!1,k=this._$AL;try{var x;q=this.shouldUpdate(k),q?(this.willUpdate(k),(x=this._$EO)===null||x===void 0?void 0:x.forEach(function(t){var e;return(e=t.hostUpdate)===null||e===void 0?void 0:e.call(t)}),this.update(k)):this._$EM()}catch(t){throw q=!1,this._$EM(),t}q&&this._$AE(k)}},{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:"_$EM",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._$Eq&&(this._$Eq=this._$Eq.forEach(function(t){return e._$ET(t,e[t])})),this._$EM()}},{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&&N(this._$Eh.keys())}},{key:"createProperty",value:function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:iX;if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){var n=Symbol(),i=this.getPropertyDescriptor(t,n,e);i!==void 0&&iU(this.prototype,t,i)}}},{key:"getPropertyDescriptor",value:function t(t,e,n){var i;var o=(i=iL(this.prototype,t))!==null&&i!==void 0?i:{get:function t(){return this[e]},set:function t(t){this[e]=t}},a=o.get,s=o.set;return{get:a,set:function e(e){var i=a===null||a===void 0?void 0:a.call(this);s===null||s===void 0?void 0:s.call(this,e),this.requestUpdate(t,i,n)},configurable:!0,enumerable:!0}}},{key:"getPropertyOptions",value:function t(t){var e;return(e=this.elementProperties.get(t))!==null&&e!==void 0?e:iX}},{key:"_$Ei",value:function t(){if(this.hasOwnProperty(iB("elementProperties")))return;var t=i$(this);t.finalize(),t.l!==void 0&&(this.l=N(t.l)),this.elementProperties=new Map(t.elementProperties)}},{key:"finalize",value:function t(){if(this.hasOwnProperty(iB("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(iB("properties"))){var t=this.properties,e=N(iD(t)).concat(N(iV(t)));var n=true,i=false,o=undefined;try{for(var a=e[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;this.createProperty(l,t[l])}}catch(t){i=true;o=t}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(i){throw o}}}}var u=this[Symbol.metadata];if(u!==null){var c=litPropertyMetadata.get(u);var d=true,h=false,f=undefined;if(c!==void 0)try{for(var p=c[Symbol.iterator](),v;!(d=(v=p.next()).done);d=true){var m=T(v.value,2),g=m[0],y=m[1];this.elementProperties.set(g,y)}}catch(t){h=true;f=t}finally{try{if(!d&&p.return!=null){p.return()}}finally{if(h){throw f}}}}this._$Eh=new Map;var b=true,w=false,q=undefined;try{for(var k=this.elementProperties[Symbol.iterator](),x;!(b=(x=k.next()).done);b=true){var _=T(x.value,2),E=_[0],C=_[1];var S=this._$Eu(E,C);S!==void 0&&this._$Eh.set(S,E)}}catch(t){w=true;q=t}finally{try{if(!b&&k.return!=null){k.return()}}finally{if(w){throw q}}}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 i=true,o=false,a=undefined;try{for(var s=n[Symbol.iterator](),l;!(i=(l=s.next()).done);i=true){var u=l.value;e.unshift(iO(u))}}catch(t){o=true;a=t}finally{try{if(!i&&s.return!=null){s.return()}}finally{if(o){throw a}}}}else t!==void 0&&e.push(iO(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}((rA=globalThis.HTMLElement)!==null&&rA!==void 0?rA:ik);iG.elementStyles=[],iG.shadowRootOptions={mode:"open"},iG[iB("elementProperties")]=new Map,iG[iB("finalized")]=new Map,iz===null||iz===void 0?void 0:iz({ReactiveElement:iG}),((rR=iW.reactiveElementVersions)!==null&&rR!==void 0?rR:iW.reactiveElementVersions=[]).push("2.1.2");var iJ=globalThis,iY=function t(t){return t},iK=iJ.trustedTypes,iZ=iK?iK.createPolicy("lit-html",{createHTML:function t(t){return t}}):void 0,i0="$lit$",i1="lit$".concat(Math.random().toFixed(9).slice(2),"$"),i2="?"+i1,i3="<".concat(i2,">"),i5=iJ.document===void 0?{createTreeWalker:function t(){return{}}}:document,i4=function t(){return i5.createComment("")},i6=function t(t){return t===null||(typeof t==="undefined"?"undefined":U(t))!="object"&&typeof t!="function"},i8=Array.isArray,i7=function t(t){return i8(t)||typeof(t===null||t===void 0?void 0:t[Symbol.iterator])=="function"},i9="[ \n\f\r]",ot=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,oe=/-->/g,on=/>/g,or=RegExp(">|".concat(i9,"(?:([^\\s\"'>=/]+)(").concat(i9,"*=").concat(i9,"*(?:[^ \n\f\r\"'`<>=]|(\"|')|))|$)"),"g"),oi=/'/g,oo=/"/g,oa=/^(?:script|style|textarea|title)$/i,os=function t(t){return function(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++){i[o-1]=arguments[o]}return{_$litType$:t,strings:e,values:i}}},ol=os(1),ou=os(2),oc=os(3),od=Symbol.for("lit-noChange"),oh=Symbol.for("lit-nothing"),of=new WeakMap,op=i5.createTreeWalker(i5,129);var ov=function t(t,e){var n=t.length-1,o=[],a,s=e===2?"<svg>":e===3?"<math>":"",l=ot;for(var u=0;u<n;u++){var c=t[u],d=void 0,h=void 0,f=-1,p=0;for(;p<c.length&&(l.lastIndex=p,h=l.exec(c),h!==null);)p=l.lastIndex,l===ot?h[1]==="!--"?l=oe:h[1]!==void 0?l=on:h[2]!==void 0?(oa.test(h[2])&&(a=RegExp("</"+h[2],"g")),l=or):h[3]!==void 0&&(l=or):l===or?h[0]===">"?(l=a!==null&&a!==void 0?a:ot,f=-1):h[1]===void 0?f=-2:(f=l.lastIndex-h[2].length,d=h[1],l=h[3]===void 0?or:h[3]==='"'?oo:oi):l===oo||l===oi?l=or:l===oe||l===on?l=ot:(l=or,a=void 0);var v=l===or&&t[u+1].startsWith("/>")?" ":"";s+=l===ot?c+i3:f>=0?(o.push(d),c.slice(0,f)+i0+c.slice(f)+i1+v):c+i1+(f===-2?u:v)}return[i(t,s+(t[n]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),o]},om=/*#__PURE__*/function(){"use strict";function t(e,n){var i=e.strings,o=e._$litType$;l(this,t);var a;this.parts=[];var s=0,u=0,c=i.length-1,d=this.parts,h=T(ov(i,o),2),f=h[0],p=h[1];if(this.el=t.createElement(f,n),op.currentNode=this.el.content,o===2||o===3){var v;var m=this.el.content.firstChild;(v=m).replaceWith.apply(v,N(m.childNodes))}for(;(a=op.nextNode())!==null&&d.length<c;){if(a.nodeType===1){var g=true,y=false,b=undefined;if(a.hasAttributes())try{for(var w=a.getAttributeNames()[Symbol.iterator](),q;!(g=(q=w.next()).done);g=true){var k=q.value;if(k.endsWith(i0)){var x=p[u++],_=a.getAttribute(k).split(i1),E=/([.?@])?(.*)/.exec(x);d.push({type:1,index:s,name:E[2],strings:_,ctor:E[1]==="."?oq:E[1]==="?"?ok:E[1]==="@"?ox:ow}),a.removeAttribute(k)}else k.startsWith(i1)&&(d.push({type:6,index:s}),a.removeAttribute(k))}}catch(t){y=true;b=t}finally{try{if(!g&&w.return!=null){w.return()}}finally{if(y){throw b}}}if(oa.test(a.tagName)){var C=a.textContent.split(i1),S=C.length-1;if(S>0){a.textContent=iK?iK.emptyScript:"";for(var A=0;A<S;A++)a.append(C[A],i4()),op.nextNode(),d.push({type:2,index:++s});a.append(C[S],i4())}}}else if(a.nodeType===8)if(a.data===i2)d.push({type:2,index:s});else{var R=-1;for(;(R=a.data.indexOf(i1,R+1))!==-1;)d.push({type:7,index:s}),R+=i1.length-1}s++}}d(t,null,[{key:"createElement",value:function t(t,e){var n=i5.createElement("template");return n.innerHTML=t,n}}]);return t}();function og(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t,i=arguments.length>3?arguments[3]:void 0;var o;var a,s;if(e===od)return e;var l=i!==void 0?(a=n._$Co)===null||a===void 0?void 0:a[i]:n._$Cl,u=i6(e)?void 0:e._$litDirective$;return(l===null||l===void 0?void 0:l.constructor)!==u&&(l===null||l===void 0?void 0:(s=l._$AO)===null||s===void 0?void 0:s.call(l,!1),u===void 0?l=void 0:(l=new u(t),l._$AT(t,n,i)),i!==void 0?((o=n._$Co)!==null&&o!==void 0?o:n._$Co=[])[i]=l:n._$Cl=l),l!==void 0&&(e=og(t,l._$AS(t,e.values),l,i)),e}var oy=/*#__PURE__*/function(){"use strict";function t(e,n){l(this,t);this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=n}d(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,i=n.el,o=i.content,a=n.parts,s=((e=t===null||t===void 0?void 0:t.creationScope)!==null&&e!==void 0?e:i5).importNode(o,!0);op.currentNode=s;var l=op.nextNode(),u=0,c=0,d=a[0];for(;d!==void 0;){if(u===d.index){var h=void 0;d.type===2?h=new ob(l,l.nextSibling,this,t):d.type===1?h=new d.ctor(l,d.name,d.strings,this,t):d.type===6&&(h=new o_(l,this,t)),this._$AV.push(h),d=a[++c]}u!==(d===null||d===void 0?void 0:d.index)&&(l=op.nextNode(),u++)}return op.currentNode=i5,s}},{key:"p",value:function t(t){var e=0;var n=true,i=false,o=undefined;try{for(var a=this._$AV[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;l!==void 0&&(l.strings!==void 0?(l._$AI(t,l,e),e+=l.strings.length-2):l._$AI(t[e])),e++}}catch(t){i=true;o=t}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(i){throw o}}}}}]);return t}(),ob=/*#__PURE__*/function(){"use strict";function t(e,n,i,o){l(this,t);var a;this.type=2,this._$AH=oh,this._$AN=void 0,this._$AA=e,this._$AB=n,this._$AM=i,this.options=o,this._$Cv=(a=o===null||o===void 0?void 0:o.isConnected)!==null&&a!==void 0?a:!0}d(t,[{key:"_$AU",get:function t(){var t;var e;return(t=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&t!==void 0?t: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=og(this,t,e),i6(t)?t===oh||t==null||t===""?(this._$AH!==oh&&this._$AR(),this._$AH=oh):t!==this._$AH&&t!==od&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):i7(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!==oh&&i6(this._$AH)?this._$AA.nextSibling.data=t:this.T(i5.createTextNode(t)),this._$AH=t}},{key:"$",value:function t(t){var e;var n=t.values,o=t._$litType$,a=typeof o=="number"?this._$AC(t):(o.el===void 0&&(o.el=om.createElement(i(o.h,o.h[0]),this.options)),o);if(((e=this._$AH)===null||e===void 0?void 0:e._$AD)===a)this._$AH.p(n);else{var s=new oy(a,this),l=s.u(this.options);s.p(n),this.T(l),this._$AH=s}}},{key:"_$AC",value:function t(t){var e=of.get(t.strings);return e===void 0&&of.set(t.strings,e=new om(t)),e}},{key:"k",value:function e(e){i8(this._$AH)||(this._$AH=[],this._$AR());var n=this._$AH,i,o=0;var a=true,s=false,l=undefined;try{for(var u=e[Symbol.iterator](),c;!(a=(c=u.next()).done);a=true){var d=c.value;o===n.length?n.push(i=new t(this.O(i4()),this.O(i4()),this,this.options)):i=n[o],i._$AI(d),o++}}catch(t){s=true;l=t}finally{try{if(!a&&u.return!=null){u.return()}}finally{if(s){throw l}}}o<n.length&&(this._$AR(i&&i._$AB.nextSibling,o),n.length=o)}},{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,i;for((n=(i=this)._$AP)===null||n===void 0?void 0:n.call(i,!1,!0,e);t!==this._$AB;){var o=iY(t).nextSibling;iY(t).remove(),t=o}}},{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}(),ow=/*#__PURE__*/function(){"use strict";function t(e,n,i,o,a){l(this,t);this.type=1,this._$AH=oh,this._$AN=void 0,this.element=e,this.name=n,this._$AM=o,this.options=a,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=oh}d(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,i=arguments.length>3?arguments[3]:void 0;var o=this.strings,a=!1;if(o===void 0)t=og(this,t,e,0),a=!i6(t)||t!==this._$AH&&t!==od,a&&(this._$AH=t);else{var s=t,l,u;for(t=o[0],l=0;l<o.length-1;l++)u=og(this,s[n+l],e,l),u===od&&(u=this._$AH[l]),a||(a=!i6(u)||u!==this._$AH[l]),u===oh?t=oh:t!==oh&&(t+=(u!==null&&u!==void 0?u:"")+o[l+1]),this._$AH[l]=u}a&&!i&&this.j(t)}},{key:"j",value:function t(t){t===oh?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t!==null&&t!==void 0?t:"")}}]);return t}(),oq=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments),t.type=3;return t}d(e,[{key:"j",value:function t(t){this.element[this.name]=t===oh?void 0:t}}]);return e}(ow),ok=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments),t.type=4;return t}d(e,[{key:"j",value:function t(t){this.element.toggleAttribute(this.name,!!t&&t!==oh)}}]);return e}(ow),ox=/*#__PURE__*/function(t){"use strict";v(e,t);function e(t,n,i,o,a){l(this,e);var u;u=s(this,e,[t,n,i,o,a]),u.type=5;return u}d(e,[{key:"_$AI",value:function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this;var n;if((t=(n=og(this,t,e,0))!==null&&n!==void 0?n:oh)===od)return;var i=this._$AH,o=t===oh&&i!==oh||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,a=t!==oh&&(i===oh||o);o&&this.element.removeEventListener(this.name,this,i),a&&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((e=(n=this.options)===null||n===void 0?void 0:n.host)!==null&&e!==void 0?e:this.element,t):this._$AH.handleEvent(t)}}]);return e}(ow),o_=/*#__PURE__*/function(){"use strict";function t(e,n,i){l(this,t);this.element=e,this.type=6,this._$AN=void 0,this._$AM=n,this.options=i}d(t,[{key:"_$AU",get:function t(){return this._$AM._$AU}},{key:"_$AI",value:function t(t){og(this,t)}}]);return t}(),oE={M:i0,P:i1,A:i2,C:1,L:ov,R:oy,D:i7,V:og,I:ob,H:ow,N:ok,U:ox,B:oq,F:o_},oC=iJ.litHtmlPolyfillSupport;oC===null||oC===void 0?void 0:oC(om,ob),((rI=iJ.litHtmlVersions)!==null&&rI!==void 0?rI:iJ.litHtmlVersions=[]).push("3.3.2");var oS=function t(t,e,n){var i;var o=(i=n===null||n===void 0?void 0:n.renderBefore)!==null&&i!==void 0?i:e,a=o._$litPart$;if(a===void 0){var s;var l=(s=n===null||n===void 0?void 0:n.renderBefore)!==null&&s!==void 0?s:null;o._$litPart$=a=new ob(e.insertBefore(i4(),l),l,void 0,n!==null&&n!==void 0?n:{})}return a._$AI(t),a};var oA=globalThis,oR=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments),t.renderOptions={host:t},t._$Do=void 0;return t}d(e,[{key:"createRenderRoot",value:function t(){var t;var n;var i=f(p(e.prototype),"createRenderRoot",this).call(this);return(t=(n=this.renderOptions).renderBefore)!==null&&t!==void 0?t:n.renderBefore=i.firstChild,i}},{key:"update",value:function t(t){var n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),f(p(e.prototype),"update",this).call(this,t),this._$Do=oS(n,this.renderRoot,this.renderOptions)}},{key:"connectedCallback",value:function t(){var t;f(p(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;f(p(e.prototype),"disconnectedCallback",this).call(this),(t=this._$Do)===null||t===void 0?void 0:t.setConnected(!1)}},{key:"render",value:function t(){return od}}]);return e}(iG);oR._$litElement$=!0,oR.finalized=!0,(rP=oA.litElementHydrateSupport)===null||rP===void 0?void 0:rP.call(oA,{LitElement:oR});var oI=oA.litElementPolyfillSupport;oI===null||oI===void 0?void 0:oI({LitElement:oR});((rT=oA.litElementVersions)!==null&&rT!==void 0?rT:oA.litElementVersions=[]).push("4.2.2");var oT=function t(t){return function(e,n){n!==void 0?n.addInitializer(function(){customElements.define(t,e)}):customElements.define(t,e)}};var oM={attribute:!0,type:String,converter:iH,reflect:!1,hasChanged:iQ},oP=function t(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:oM,e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;var i=n.kind,o=n.metadata,a=globalThis.litPropertyMetadata.get(o);if(a===void 0&&globalThis.litPropertyMetadata.set(o,a=new Map),i==="setter"&&((t=Object.create(t)).wrapped=!0),a.set(n.name,t),i==="accessor"){var s=n.name;return{set:function n(n){var i=e.get.call(this);e.set.call(this,n),this.requestUpdate(s,i,t,!0,n)},init:function e(e){return e!==void 0&&this.C(s,void 0,t,e),e}}}if(i==="setter"){var l=n.name;return function(n){var i=this[l];e.call(this,n),this.requestUpdate(l,i,t,!0,n)}}throw Error("Unsupported decorator location: "+i)};var oO=function t(t,e,n){return n.configurable=!0,n.enumerable=!0,Reflect.decorate&&(typeof e==="undefined"?"undefined":U(e))!="object"&&Object.defineProperty(t,e,n),n};var oN=Symbol("computedItemContext");var oU=Symbol("computedContext");var oL=Symbol("configContext");var oD=[{identifier:"completionStatus",cardinality:"single",baseType:"string",value:"unknown",type:"outcome"},{identifier:"numAttempts",cardinality:"single",baseType:"integer",value:"0",type:"response"}];var oV=Symbol("item");var o$=/^[A-Za-z0-9-]+$/,oW=function t(t){return typeof t=="string"&&o$.test(t)},oj=function t(t){return oW(t)?t:void 0},oF=Symbol("qtiContext");var oz={view:"candidate"},oB=Symbol("testContext");var oH={items:[],testOutcomeVariables:[]},oQ=Symbol("testContext");var oX={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},oG=function t(t){return function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++){n[i]=arguments[i]}return{_$litDirective$:t,values:n}}},oJ=/*#__PURE__*/function(){"use strict";function t(e){l(this,t)}d(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,N(e))}}]);return t}();var oY=oE.I,oK=function t(t){return t},oZ=function t(t){return t===null||(typeof t==="undefined"?"undefined":U(t))!="object"&&typeof t!="function"};var o0=function t(t){return t.strings===void 0},o1=function t(){return document.createComment("")},o2=function t(t,e,n){var i=t._$AA.parentNode,o=e===void 0?t._$AB:e._$AA;if(n===void 0){var a=i.insertBefore(o1(),o),s=i.insertBefore(o1(),o);n=new oY(a,s,t,t.options)}else{var l=n._$AB.nextSibling,u=n._$AM,c=u!==t;if(c){var d;var h;(d=n._$AQ)===null||d===void 0?void 0:d.call(n,t),n._$AM=t,n._$AP!==void 0&&(h=t._$AU)!==u._$AU&&n._$AP(h)}if(l!==o||c){var f=n._$AA;for(;f!==l;){var p=oK(f).nextSibling;oK(i).insertBefore(f,o),f=p}}}return n},o3=function t(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t;return t._$AI(e,n),t},o5={},o4=function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:o5;return t._$AH=e},o6=function t(t){return t._$AH},o8=function t(t){t._$AR(),t._$AA.remove()};var o7=function t(t,e){var n;var i=t._$AN;if(i===void 0)return!1;var o=true,a=false,s=undefined;try{for(var l=i[Symbol.iterator](),u;!(o=(u=l.next()).done);o=true){var c=u.value;(n=c._$AO)===null||n===void 0?void 0:n.call(c,e,!1),o7(c,e)}}catch(t){a=true;s=t}finally{try{if(!o&&l.return!=null){l.return()}}finally{if(a){throw s}}}return!0},o9=function t(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)},at=function t(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),ae(e)}};var ae=function t(t){var e,n;t.type==oX.CHILD&&((e=t._$AP)!==null&&e!==void 0?e:t._$AP=w,(n=t._$AQ)!==null&&n!==void 0?n:t._$AQ=b)},an=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments),t._$AN=void 0;return t}d(e,[{key:"_$AT",value:function t(t,n,i){f(p(e.prototype),"_$AT",this).call(this,t,n,i),at(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,i,o,a;t!==this.isConnected&&(this.isConnected=t,t?(n=(i=this).reconnected)===null||n===void 0?void 0:n.call(i):(o=(a=this).disconnected)===null||o===void 0?void 0:o.call(a)),e&&(o7(this,t),o9(this))}},{key:"setValue",value:function t(t){if(o0(this._$Ct))this._$Ct._$AI(t,this);else{var e=N(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}(oJ);var ar,ai,ao=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,ar);t.prevData={};return t}d(e,[{key:"render",value:function t(t){return oh}},{key:"update",value:function t(t,e){var n=T(e,1),i=n[0];var o;return this.element!==t.element&&(this.element=t.element),this.host=((o=t.options)===null||o===void 0?void 0:o.host)||this.element,this.apply(i),this.groom(i),this.prevData=k({},i),oh}},{key:"apply",value:function t(t){var e=rQ(this,ar,ai).call(this,t),n=this,i=n.prevData,o=n.element;for(var a in e){var s=e[a];s!==i[a]&&(s===!0?o.setAttribute(a,""):s===!1?o.removeAttribute(a):s!=null?o.setAttribute(a,String(s)):o.removeAttribute(a))}}},{key:"groom",value:function t(t){var e=this,n=e.prevData,i=e.element;if(!n)return;var o=t?rQ(this,ar,ai).call(this,t):{};for(var a in n)(!o||!(a in o))&&i.removeAttribute(a)}}]);return e}(an);ar=new WeakSet,ai=function t(t){return Object.fromEntries(Object.entries(t).filter(function(t){var e=T(t,2),n=e[0],i=e[1];return typeof i=="function"?!1:n==="max-choices"&&i===0?!0:!(i===""||i===null||i===void 0)}))};var aa=oG(ao);var as=function(t){return t.Correct="correct",t.PartiallyCorrect="partially-correct",t.Incorrect="incorrect",t}(as||{}),al=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e);t.disabled=!1;t.readonly=!1;t.showCorrectResponse=!1;t._handleShowCorrectResponseChange=function(e,n){t.toggleInternalCorrectResponse(n)};t.showFullCorrectResponse=!1;t._handleShowFullCorrectResponseChange=function(e,n){t.toggleFullCorrectResponse(n)};t.showCandidateCorrection=!1;t._handleShowCandidateCorrectionChange=function(e,n){t.toggleCandidateCorrection(n)};t._correctResponse=null;t._internals=t.attachInternals();return t}d(e,[{key:"internals",get:function t(){return this._internals}},{key:"correctResponseAttr",get:function t(){return this._correctResponse===null||this._correctResponse===void 0?null:Array.isArray(this._correctResponse)?this._correctResponse.join(","):this._correctResponse},set:function t(t){t===null?this._correctResponse=null:t.includes(",")?this._correctResponse=t.split(",").map(function(t){return t.trim()}):this._correctResponse=t}},{key:"isFullCorrectResponse",get:function t(){return this._isFullCorrectResponse},set:function t(t){this._isFullCorrectResponse=t,t&&(this.disabled=!0,this.setAttribute("inert",""),this.setAttribute("response-identifier",this.responseIdentifier+"_cr"))}},{key:"correctResponse",get:function t(){var t=this.responseVariable;return(t===null||t===void 0?void 0:t.correctResponse)?t.correctResponse:this._correctResponse},set:function t(t){var e=this._correctResponse;this._correctResponse=t,t==null?this.removeAttribute("correct-response"):this.setAttribute("correct-response",Array.isArray(t)?t.join(","):t),this.requestUpdate("_correctResponse",e)}},{key:"correctness",get:function t(){var t=this.correctResponse;if(!t)return null;var e=this.response;if(e==null||e===""||Array.isArray(e)&&e.length===0)return null;var n=Array.isArray(t)?t:[t],i=(Array.isArray(e)?e:[e]).filter(function(t){return t!==""});if(i.length===0)return null;var o=i.filter(function(t){return n.includes(t)}).length,a=i.filter(function(t){return!n.includes(t)}).length;return o===n.length&&a===0&&i.length===n.length?"correct":o>0&&(o<n.length||a>0)?"partially-correct":"incorrect"}},{key:"isInline",get:function t(){return!1}},{key:"responseVariable",get:function t(){var t;if(!((t=this._context)===null||t===void 0?void 0:t.variables))return;var e=this._context.variables.filter(function(t){return t.type==="response"}),n=this.getAttribute("response-identifier");return e.find(function(t){return t.identifier===n})}},{key:"toggleCorrectResponse",value:function t(t){var e,n;(((n=this)===null||n===void 0?void 0:(e=n.configContext)===null||e===void 0?void 0:e.correctResponseMode)||"internal")==="full"?this.toggleFullCorrectResponse(t):this.toggleInternalCorrectResponse(t)}},{key:"toggleFullCorrectResponse",value:function t(t){return a(function(){var e,n,i,o,a,s,l,u,c;return $(this,function(d){switch(d.label){case 0:o=this.nextSibling,a=m(o,HTMLDivElement)&&(o===null||o===void 0?void 0:o.classList.contains("full-correct-response")),s=this.correctResponse;if(!s)return[2];if(!(t&&(((n=this)===null||n===void 0?void 0:(e=n.configContext)===null||e===void 0?void 0:e.fullCorrectResponseOnlyWhenIncorrect)===!1||this.correctness!=="correct"))){;if(!a)return[2];(l=this.parentElement)===null||l===void 0?void 0:l.removeChild(o);return[2]}if(a)return[2];u=this.cloneNode(!0);u.removeAttribute("show-full-correct-response"),u.removeAttribute("show-correct-response"),u.removeAttribute("show-candidate-correction");c=document.createElement("div");c.classList.add("full-correct-response"),this.isInline?c.classList.add("full-correct-response-inline"):c.classList.add("full-correct-response-block"),c.role="full-correct-response",c.appendChild(u),u.isFullCorrectResponse=!0,(i=this.parentElement)===null||i===void 0?void 0:i.insertBefore(c,this.nextSibling);return[4,u.updateComplete];case 1:d.sent(),u.response=Array.isArray(s)?N(s):s;return[2]}})}).call(this)}},{key:"toggleInternalCorrectResponse",value:function t(t){this._internals.states.delete("show-correct-response"),t&&this.correctResponse&&this._internals.states.add("show-correct-response")}},{key:"toggleCandidateCorrection",value:function t(t){this._internals.states.delete("candidate-correct"),this._internals.states.delete("candidate-partially-correct"),this._internals.states.delete("candidate-incorrect"),t&&(this.correctness==="correct"&&this._internals.states.add("candidate-correct"),this.correctness==="partially-correct"&&this._internals.states.add("candidate-partially-correct"),this.correctness==="incorrect"&&this._internals.states.add("candidate-incorrect"))}},{key:"value",get:function t(){return JSON.stringify(this.response)},set:function t(t){this.response=t?JSON.parse(t):null}},{key:"reportValidity",value:function t(){return this._internals.reportValidity()}},{key:"reset",value:function t(){this.response=null}},{key:"formResetCallback",value:function t(){this.reset()}},{key:"connectedCallback",value:function t(){f(p(e.prototype),"connectedCallback",this).call(this),!this.isFullCorrectResponse&&this.dispatchEvent(new CustomEvent("qti-register-interaction",{bubbles:!0,composed:!0,cancelable:!1,detail:{interactionElement:this,responseIdentifier:this.responseIdentifier}}))}},{key:"firstUpdated",value:function t(){this.isFullCorrectResponse||(this.showCorrectResponse&&this.toggleInternalCorrectResponse(!0),this.showFullCorrectResponse&&this.toggleFullCorrectResponse(!0),this.showCandidateCorrection&&this.toggleCandidateCorrection(!0))}},{key:"saveResponse",value:function t(t,e){this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,cancelable:!1,detail:k({responseIdentifier:this.responseIdentifier,response:Array.isArray(t)?N(t):t},e!==void 0?{state:e}:{})}))}}]);return e}(oR);al.formAssociated=!0,rj([e({context:oV,subscribe:!0})],al.prototype,"_context",2),rj([e({context:oL,subscribe:!0})],al.prototype,"configContext",2),rj([o({type:String,attribute:"response-identifier"})],al.prototype,"responseIdentifier",2),rj([o({reflect:!0,type:Boolean})],al.prototype,"disabled",2),rj([o({reflect:!0,type:Boolean})],al.prototype,"readonly",2),rj([o({type:String})],al.prototype,"name",2),rj([o({type:String,attribute:"correct-response",reflect:!0})],al.prototype,"correctResponseAttr",1),rj([o({type:Boolean,attribute:"show-correct-response",reflect:!0})],al.prototype,"showCorrectResponse",2),rj([y("showCorrectResponse",{waitUntilFirstUpdate:!0})],al.prototype,"_handleShowCorrectResponseChange",2),rj([o({type:Boolean,attribute:"show-full-correct-response",reflect:!0})],al.prototype,"showFullCorrectResponse",2),rj([y("showFullCorrectResponse",{waitUntilFirstUpdate:!0})],al.prototype,"_handleShowFullCorrectResponseChange",2),rj([o({type:Boolean,attribute:"show-candidate-correction",reflect:!0})],al.prototype,"showCandidateCorrection",2),rj([y("showCandidateCorrection",{waitUntilFirstUpdate:!0})],al.prototype,"_handleShowCandidateCorrectionChange",2),rj([u()],al.prototype,"_isFullCorrectResponse",2),rj([u()],al.prototype,"_correctResponse",2);var au=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){return ol(j())}},{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==="multiple"||t==="ordered"?n:n[0]}}]);return e}(oR);var ac=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.getVariables=function(){return Array.from(t.children).map(function(e){switch(console.debug("getVariables",e.tagName.toLowerCase()),e.tagName.toLowerCase()){case"qti-base-value":return{baseType:e.getAttribute("base-type"),value:e.textContent.trim(),cardinality:"single"};case"qti-variable":{var n;var i=e.getAttribute("identifier")||"";return i==="QTI_CONTEXT"?((n=t.qtiContext)===null||n===void 0?void 0:n.QTI_CONTEXT)?{identifier:"QTI_CONTEXT",baseType:"record",value:t.qtiContext.QTI_CONTEXT,cardinality:"record",type:"context"}:(console.warn("QTI_CONTEXT not available"),{identifier:"QTI_CONTEXT",baseType:"record",value:t.qtiContext.QTI_CONTEXT,cardinality:"record",type:"context"}):t.context.variables.find(function(t){return t.identifier===i})||null}case"qti-multiple":{var o=e.getResult();return console.debug("values",o),(o===null||o===void 0?void 0:o.length)>0?{identifier:"",baseType:o[0].baseType,value:o.map(function(t){return t.value}),cardinality:"multiple",type:"response"}:null}case"qti-ordered":{var a=e.getResult();return(a===null||a===void 0?void 0:a.length)>0?{identifier:"",baseType:a[0].baseType,value:a.map(function(t){return t.value}),cardinality:"ordered",type:"response"}:null}case"qti-repeat":{var s=e.getResult();return(s===null||s===void 0?void 0:s.length)>0?s:null}case"qti-correct":{var l,u;var c=e.getAttribute("identifier")||"",d=((u=t.context)===null||u===void 0?void 0:(l=u.variables)===null||l===void 0?void 0:l.find(function(t){return t.identifier===c}))||null;return{baseType:d.baseType,value:d.correctResponse,cardinality:d.cardinality}}default:{try{var h;return{baseType:"integer",value:((h=e.getResult())===null||h===void 0?void 0:h.toString())||null,cardinality:"single"}}catch(t){console.warn("default not sufficient")}return null}}}).flatMap(function(t){return Array.isArray(t)?t:[t]}).filter(function(t){return t!==null})};return t}d(e,[{key:"render",value:function t(){return ol(F(),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}(oR);ac.styles=iM(z()),rj([u()],ac.prototype,"result",2),rj([e({context:oV,subscribe:!0}),u()],ac.prototype,"context",2),rj([e({context:oF,subscribe:!0}),u()],ac.prototype,"qtiContext",2);var ad=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(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}(ac);var ah=function t(){return new Intl.NumberFormat().format(.1).replace(/\d/g,"")},af=function t(t){if(typeof t=="string")return t;var e=ah();return e==="."?t.toLocaleString():t.toString().replace(".","").replace(e,".")};var ap,av,am=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,ap);t.showHide="show";return t}d(e,[{key:"connectedCallback",value:function t(){f(p(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=!q(this.identifier)&&!q(e===null||e===void 0?void 0:e.value)&&this.identifier===e.value||!1,rQ(this,ap,av).call(this,n)}}]);return e}(oR);ap=new WeakSet,av=function t(t){this.showStatus=t&&this.showHide==="show"||!t&&this.showHide==="hide"?"on":"off"},rj([o({type:String,attribute:"show-hide"})],am.prototype,"showHide",2),rj([o({type:String,attribute:"outcome-identifier"})],am.prototype,"outcomeIdentifier",2),rj([o({type:String})],am.prototype,"identifier",2),rj([o({type:String,attribute:!1})],am.prototype,"showStatus",2),rj([e({context:oV,subscribe:!0}),u()],am.prototype,"_context",2);var ag=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}return e}(oR);var ay=/*#__PURE__*/function(){"use strict";function t(){l(this,t)}d(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 i=T(t.split(" ").map(Number),2),o=i[0],a=i[1],s=O(e.split(",")),l=s[0],u=s.slice(1),c=u.map(Number);switch(l.toLowerCase()){case"circle":case"default":{var d=T(c,3),h=d[0],f=d[1],p=d[2];return c.length!==3?(console.warn("Invalid circle definition: ".concat(e)),!1):Math.sqrt(Math.pow(o-h,2)+Math.pow(a-f,2))<=p}case"rect":{var v=T(c,4),m=v[0],g=v[1],y=v[2],b=v[3];return c.length!==4?(console.warn("Invalid rectangle definition: ".concat(e)),!1):o>=m&&o<=y&&a>=g&&a<=b}case"ellipse":{var w=T(c,4),q=w[0],k=w[1],x=w[2],_=w[3];if(c.length!==4)return console.warn("Invalid ellipse definition: ".concat(e)),!1;var E=Math.pow(o-q,2)/Math.pow(x,2),C=Math.pow(a-k,2)/Math.pow(_,2);return E+C<=1}case"poly":{if(c.length<6||c.length%2!==0)return console.warn("Invalid polygon definition: ".concat(e)),!1;var S=[];for(var A=0;A<c.length;A+=2)S.push({x:c[A],y:c[A+1]});return this.isPointInPolygon({x:o,y:a},S)}default:return console.warn("Unsupported shape type: ".concat(l)),!1}}},{key:"isPointInPolygon",value:function t(t,e){var n=!1;for(var i=0,o=e.length-1;i<e.length;o=i++){var a=e[i].x,s=e[i].y,l=e[o].x,u=e[o].y;s>t.y!=u>t.y&&t.x<(l-a)*(t.y-s)/(u-s)+a&&(n=!n)}return n}},{key:"compareSingleValues",value:function t(t,e,n){switch(n){case"identifier":case"string":return t===e;case"integer":{var i=parseInt(t,10),o=parseInt(e,10);if(!isNaN(i)&&!isNaN(o))return i===o;console.error("Cannot convert ".concat(t," and/or ").concat(e," to int."));break}case"float":{var a=parseFloat(t),s=parseFloat(e);if(!isNaN(a)&&!isNaN(s))return a===s;console.error("couldn't convert ".concat(t," and/or ").concat(e," to float."));break}case"pair":case"directedPair":{var l=t.split(" ").sort(),u=e.split(" ").sort();if(l.length===2&&u.length===2)return n==="pair"&&(l.sort(),u.sort()),l.join(" ")===u.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 ab,aw=/*#__PURE__*/function(){"use strict";function t(e){l(this,t);rB(this,ab);if(!m(e,Uint8Array))throw new TypeError("SeededRandom seed must be a Uint8Array.");if(e.length>32)throw new RangeError("SeededRandom seed must be 32 bytes or less.");var n=new Uint8Array(32);n.set(e,32-e.length),rH(this,ab,nF(n))}d(t,[{key:"random",value:function t(){rH(this,ab,rz(this,ab)|0),rH(this,ab,rz(this,ab)+0x6d2b79f5|0);var t=Math.imul(rz(this,ab)^rz(this,ab)>>>15,1|rz(this,ab));return t=t+Math.imul(t^t>>>7,61|t)^t,((t^t>>>14)>>>0)/0x100000000}}],[{key:"fromSeed",value:function e(e){if(e.length!==32)throw new RangeError("SeededRandom.fromSeed requires a 32-byte seed.");return new t(e)}},{key:"fromFixed",value:function e(e){if(typeof e!="number")throw new TypeError("SeededRandom.fromFixed requires a number.");if(!Number.isInteger(e)||e<0||e>255)throw new RangeError("SeededRandom.fromFixed requires an integer from 0 to 255.");var n=new Uint8Array(32);return n[31]=e,new t(n)}},{key:"fromSeedKey",value:function e(e){var n=new t(new Uint8Array);return rH(n,ab,V("".concat(e))),n}}]);return t}();ab=new WeakMap;var aq=aw;var ak=function t(t){return typeof t=="function"?t():t.random()};function ax(t,e){if(t.nodeType===Node.ELEMENT_NODE){var n=t,i;!n.namespaceURI||n.namespaceURI.startsWith("http://www.imsglobal.org/xsd/qti/")||n.namespaceURI.startsWith("http://www.imsglobal.org/xsd/imsqti")?i=e.createElement(n.localName):i=e.createElementNS(n.namespaceURI,n.tagName);for(var o=0;o<n.attributes.length;o++){var a=n.attributes[o];i.setAttribute(a.localName,a.value)}for(var s=0;s<n.childNodes.length;s++)i.appendChild(ax(n.childNodes[s],e));return i}return t.cloneNode(!1)}var a_=function t(){var t,e="",n={load:function i(i,o){return e=i,nG(i,o).then(function(e){return t=e,n})},parse:function i(i){return t=nJ(i),e="",n},path:function i(i){return nK(t,i),e=null,n},fn:function e(e){return e(t),n},pciHooks:function e(e){return P(t,e),n},configurePci:function e(e,i){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"qti-portable-custom-interaction";return a(function(){return $(this,function(a){switch(a.label){case 0:return[4,S(t,e,i,o)];case 1:return[2,(a.sent(),n)]}})})()},shuffleInteractions:function i(i){var o=typeof i=="string"?i.trim():i;if(o==null||o===""){var a=e||"default-item-seed";return console.warn('[qtiTransformItem] No QTI_CONTEXT.seed provided; using "'.concat(a,'" as deterministic fallback seed.')),nQ(t,a),n}return nQ(t,o),n},extendElementName:function e(e,i){return A(t,e,i),n},extendElementsWithClass:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"extend";return I(t,e),n},customInteraction:function e(e,i){var o=t.querySelector("qti-custom-interaction"),a=o.querySelector("object");return o.setAttribute("data-base-ref",e),o.setAttribute("data-base-item",e+i),o.setAttribute("data",a.getAttribute("data")),o.setAttribute("width",a.getAttribute("width")),o.setAttribute("height",a.getAttribute("height")),o.removeChild(a),n},convertCDATAtoComment:function e(){return C(t),n},stripStyleSheets:function e(){return nX(t),n},html:function n(){return e!==null&&nK(t,e.substring(0,e.lastIndexOf("/"))),new XMLSerializer().serializeToString(nY(t))},xml:function e(){return new XMLSerializer().serializeToString(t)},htmlDoc:function n(){return e!==null&&nK(t,e.substring(0,e.lastIndexOf("/"))),nY(t)},xmlDoc:function e(){return t}};return n};var aE=function t(){var t,e={load:function n(n,i){return a(function(){return $(this,function(o){return[2,new Promise(function(o){nG(n,i).then(function(n){return t=n,o(e)})})]})})()},parse:function e(e){t=nJ(e)},assessmentTest:function e(){var e=t.querySelector('resource[type="imsqti_test_xmlv3p0"]');return{href:e.getAttribute("href"),identifier:e.getAttribute("identifier")}}};return e};var aC=function t(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++){n[i-1]=arguments[i]}var o,a;return n.includes(t.localName)||n.includes((a=t.localName)===null||a===void 0?void 0:(o=a.toLowerCase)===null||o===void 0?void 0:o.call(a))},aS=function t(t){return aC(t,"qti-assessment-item-ref","assessmentitemref")},aA=function t(t){return aC(t,"qti-assessment-section","assessmentsection")},aR=function t(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++){n[i-1]=arguments[i]}return n.some(function(e){var n;var i=((n=t.getAttribute(e))!==null&&n!==void 0?n:"").trim().toLowerCase();return i==="true"||i==="1"})},aI=function t(t){return Array.from(t.children).filter(function(t){return aC(t,"qti-ordering","ordering")&&aR(t,"shuffle")})},aT=function t(t,e){return L("".concat(t,":").concat(e))};function aM(t,e){var n;var i=true,o=false,a=undefined;try{for(var s=Array.from(t.children)[Symbol.iterator](),l;!(i=(l=s.next()).done);i=true){var u=l.value;aA(u)&&aM(u,e)}}catch(t){o=true;a=t}finally{try{if(!i&&s.return!=null){s.return()}}finally{if(o){throw a}}}var c=aI(t);if(c.length===0)return;var d=[],h=[];var f=true,p=false,v=undefined;try{for(var m=Array.from(t.children)[Symbol.iterator](),g;!(f=(g=m.next()).done);f=true){var y=g.value;if(aS(y))d.push({nodes:[y],fixed:aR(y,"fixed")}),h.push(y);else if(aA(y))if(aR(y,"keep-together","keeptogether")||aR(y,"visible"))d.push({nodes:[y],fixed:aR(y,"fixed")}),h.push(y);else{var b=true,w=false,q=undefined;try{for(var k=Array.from(y.children)[Symbol.iterator](),x;!(b=(x=k.next()).done);b=true){var _=x.value;(aS(_)||aA(_))&&d.push({nodes:[_],fixed:aR(_,"fixed")})}}catch(t){w=true;q=t}finally{try{if(!b&&k.return!=null){k.return()}}finally{if(w){throw q}}}h.push(y)}}}catch(t){p=true;v=t}finally{try{if(!f&&m.return!=null){m.return()}}finally{if(p){throw v}}}if(d.length<=1){var E=true,C=false,S=undefined;try{for(var A=c[Symbol.iterator](),R;!(E=(R=A.next()).done);E=true){var I=R.value;I.remove()}}catch(t){C=true;S=t}finally{try{if(!E&&A.return!=null){A.return()}}finally{if(C){throw S}}}return}var T=(n=t.getAttribute("identifier"))!==null&&n!==void 0?n:"",M=nB(d,aT(e,T));var P=true,O=false,N=undefined;try{for(var U=h[Symbol.iterator](),L;!(P=(L=U.next()).done);P=true){var D=L.value;D.remove()}}catch(t){O=true;N=t}finally{try{if(!P&&U.return!=null){U.return()}}finally{if(O){throw N}}}var V=true,$=false,W=undefined,j=true,F=false,z=undefined;try{for(var B=M[Symbol.iterator](),H;!(j=(H=B.next()).done);j=true){var Q=H.value;try{for(var X=Q.nodes[Symbol.iterator](),G;!(V=(G=X.next()).done);V=true){var J=G.value;t.appendChild(J)}}catch(t){$=true;W=t}finally{try{if(!V&&X.return!=null){X.return()}}finally{if($){throw W}}}}}catch(t){F=true;z=t}finally{try{if(!j&&B.return!=null){B.return()}}finally{if(F){throw z}}}var Y=true,K=false,Z=undefined;try{for(var tt=c[Symbol.iterator](),te;!(Y=(te=tt.next()).done);Y=true){var tn=te.value;tn.remove()}}catch(t){K=true;Z=t}finally{try{if(!Y&&tt.return!=null){tt.return()}}finally{if(K){throw Z}}}}var aP=function t(){var t,e="",n={load:function i(i,o){return a(function(){return $(this,function(a){return[2,new Promise(function(a,s){nG(i,o).then(function(o){return t=o,e=i,n.path(i.substring(0,i.lastIndexOf("/"))),a(n)})})]})})()},parse:function i(i){return t=nJ(i),e="",n},path:function e(e){return nK(t,e),n},fn:function e(e){return e(t),n},shuffleOrdering:function i(i){var o=typeof i=="string"?i.trim():i;if(o==null||o===""){var a=e||"default-test-seed";return console.warn('[qtiTransformTest] No QTI_CONTEXT.seed provided; using "'.concat(a,'" as deterministic fallback seed.')),n0(t,a),n}return n0(t,o),n},items:function e(){return nZ(t)},html:function e(){return new XMLSerializer().serializeToString(nY(t))},xml:function e(){return new XMLSerializer().serializeToString(t)},htmlDoc:function e(){return nY(t)},xmlDoc:function e(){return t}};return n};var aO=function t(t){var e=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++){n[i]=arguments[i]}l(this,e);var o;o=s(this,e,N(n));o.navigate=null;o.requestTimeout=3e4;o.postLoadTransformCallback=null;o.postLoadTestTransformCallback=null;o._activeController=null;o._loadResults=[];o._navigationId=0;o._loadingState={expectedItems:0,connectedItems:0,expectedStimulus:0,loadedStimulus:0,isComplete:!1};o._loadedStimulusHrefs=new Set;o._loadingStimulusHrefs=new Set;o._bindEventHandlers();return o}d(e,[{key:"navigateTo",value:function t(t,e){var n=e||this._getDefaultNavigationId(t);n&&this.dispatchEvent(new CustomEvent("qti-request-navigation",{detail:{type:t,id:n},bubbles:!0,composed:!0}))}},{key:"_bindEventHandlers",value:function t(){this.addEventListener("qti-request-navigation",this._handleNavigationRequest.bind(this)),this.addEventListener("qti-assessment-test-connected",this._handleTestConnected.bind(this)),this.addEventListener("qti-assessment-item-connected",this._handleItemConnected.bind(this)),this.addEventListener("qti-assessment-stimulus-ref-connected",this._handleStimulusRefConnected.bind(this))}},{key:"_handleTestConnected",value:function t(t){this._testElement=t.detail,this._initializeNavigation()}},{key:"_handleItemConnected",value:function t(t){var e=t.detail;this._loadingState.connectedItems++;var n=e.querySelectorAll("qti-assessment-stimulus-ref");this._loadingState.expectedStimulus+=n.length,this._checkLoadingComplete()}},{key:"_handleStimulusRefConnected",value:function t(t){return a(function(){var e,n,i;return $(this,function(o){switch(o.label){case 0:t.preventDefault();e=t.element,n=t.item;if(console.info("Stimulus ref connected:",{identifier:e.identifier,href:e.href,item:n.identifier}),this._loadedStimulusHrefs.has(e.href)){console.info("Stimulus already loaded, skipping:",e.href),this._loadingState.loadedStimulus++,this._checkLoadingComplete();return[2]}if(this._loadingStimulusHrefs.has(e.href)){console.info("Stimulus already loading, skipping duplicate:",e.href),this._loadingState.loadedStimulus++,this._checkLoadingComplete();return[2]}this._loadingStimulusHrefs.add(e.href),console.info("Starting stimulus load:",e.href);o.label=1;case 1:o.trys.push([1,3,4,5]);return[4,this._loadStimulusRef(e,n)];case 2:o.sent(),this._loadedStimulusHrefs.add(e.href),this._loadingState.loadedStimulus++,console.info("Stimulus loaded successfully:",e.href),this._checkLoadingComplete();return[3,5];case 3:i=o.sent();i.name!=="AbortError"&&console.warn("Failed to load stimulus ".concat(e.identifier,":"),i),this._loadingState.loadedStimulus++,this._checkLoadingComplete();return[3,5];case 4:this._loadingStimulusHrefs.delete(e.href);return[7];case 5:return[2]}})}).call(this)}},{key:"_getDefaultNavigationId",value:function t(t){var e;var n,i,o,a,s;return t==="section"?(i=this._testElement)===null||i===void 0?void 0:(n=i.querySelector("qti-assessment-section"))===null||n===void 0?void 0:n.identifier:(e=(o=this.sessionContext)===null||o===void 0?void 0:o.navItemRefId)!==null&&e!==void 0?e:(s=this._testElement)===null||s===void 0?void 0:(a=s.querySelector("qti-assessment-item-ref"))===null||a===void 0?void 0:a.identifier}},{key:"_initializeNavigation",value:function t(){if(!this.navigate)return;var t=this._getDefaultNavigationId(this.navigate);t&&this.navigateTo(this.navigate,t)}},{key:"_handleNavigationRequest",value:function t(t){return a(function(t){var e,n,i,o;return $(this,function(a){switch(a.label){case 0:e=t.detail;if(!(e===null||e===void 0?void 0:e.id))return[2];this._cancelPreviousNavigation();n=++this._navigationId,i=new AbortController;a.label=1;case 1:a.trys.push([1,3,4,5]);this._dispatchLoadingStarted(e.type,e.id),this._activeController=i;return[4,this._executeNavigation(e.type,e.id,n,i)];case 2:a.sent();return[3,5];case 3:o=a.sent();this._handleNavigationError(o,e.type,e.id);return[3,5];case 4:this._activeController===i&&(this._activeController=null),this._dispatchLoadingEnded(e.type,e.id);return[7];case 5:return[2]}})}).apply(this,arguments)}},{key:"_handleNavigationError",value:function t(t,e,n){t.name!=="AbortError"&&this._dispatchError(this._createNavigationError(t,e,n))}},{key:"_executeNavigation",value:function t(t,e,n,i){return a(function(){var o;return $(this,function(a){switch(a.label){case 0:if(!(t==="item"))return[3,2];return[4,this._navigateToItem(e,n,i)];case 1:o=a.sent();return[3,4];case 2:return[4,this._navigateToSection(e,n,i)];case 3:o=a.sent();a.label=4;case 4:o;return[2]}})}).call(this)}},{key:"_navigateToItem",value:function t(t,e,n){return a(function(){var i;return $(this,function(o){switch(o.label){case 0:i=this._findItemRef(t);this._updateSessionContext(i,t),this._resetLoadingState(),this._loadingState.expectedItems=1;return[4,this._loadItems([t],e,n)];case 1:o.sent();return[4,this._waitForLoadingComplete(e,n)];case 2:o.sent(),!this._isStaleNavigation(e,n)&&this._dispatchTestLoaded(this._loadResults);return[2]}})}).call(this)}},{key:"_navigateToSection",value:function t(t,e,n){return a(function(){var i,o,a,s;return $(this,function(l){switch(l.label){case 0:a=(o=this._findSection(t))===null||o===void 0?void 0:(i=o.closest("qti-test-part"))===null||i===void 0?void 0:i.identifier;this.sessionContext=_(k({},this.sessionContext),{navPartId:a,navSectionId:t,navItemRefId:null});s=this._getSectionItemIds(t);this._resetLoadingState(),this._loadingState.expectedItems=s.length;return[4,this._loadItems(s,e,n)];case 1:l.sent();return[4,this._waitForLoadingComplete(e,n)];case 2:l.sent(),!this._isStaleNavigation(e,n)&&this._dispatchTestLoaded(this._loadResults);return[2]}})}).call(this)}},{key:"_resetLoadingState",value:function t(){this._loadingState={expectedItems:0,connectedItems:0,expectedStimulus:0,loadedStimulus:0,isComplete:!1},this._loadedStimulusHrefs.clear(),this._loadingStimulusHrefs.clear()}},{key:"_checkLoadingComplete",value:function t(){var t=this._loadingState.connectedItems>=this._loadingState.expectedItems,e=this._loadingState.loadedStimulus>=this._loadingState.expectedStimulus;t&&e&&!this._loadingState.isComplete&&(this._loadingState.isComplete=!0)}},{key:"_waitForLoadingComplete",value:function t(t,e){return a(function(){return $(this,function(n){switch(n.label){case 0:if(!!this._loadingState.isComplete)return[3,3];if(this._isStaleNavigation(t,e))return[2];return[4,new Promise(function(t){return setTimeout(t,10)})];case 1:n.sent();n.label=2;case 2:return[3,0];case 3:return[2]}})}).call(this)}},{key:"getLoadingProgress",value:function t(){return k({},this._loadingState)}},{key:"_loadStimulusRef",value:function t(t,e){return a(function(){var n;return $(this,function(i){switch(i.label){case 0:console.info("Loading stimulus:",t.href);return[4,this._loadStimulus(t.href)];case 1:n=i.sent();console.info("Stimulus loaded, applying content:",n?"has content":"no content"),this._applyStimulusContent(n,t,e);return[2]}})}).call(this)}},{key:"_applyStimulusContent",value:function t(t,e,n){if(!t){console.warn("No stimulus content to apply");return}var i=t.querySelectorAll("qti-stimulus-body, qti-stylesheet");if(console.info("Found ".concat(i.length," stimulus elements to apply for ").concat(e.identifier)),i.length===0){console.warn("No qti-stimulus-body or qti-stylesheet elements found in stimulus");return}var o=[],a=n.querySelector('[data-stimulus-idref="'.concat(e.identifier,'"]'));if(a)o.push(a),console.info("Found specific target:",a);else{var s=Array.from(this.querySelectorAll('[data-stimulus-idref="'.concat(e.identifier,'"]')));if(s.length>0)o=s,console.info("Found targets by identifier:",s.length);else{var l=Array.from(this.querySelectorAll("[data-stimulus-idref]"));o=l,console.info("Using fallback targets:",l.length)}}if(o.length===0){console.warn("No targets found for stimulus content");return}o.forEach(function(t,e){var n;t.innerHTML="";var a=Array.from(i).map(function(t){return t.cloneNode(!0)});(n=t).append.apply(n,N(a)),console.info("Applied stimulus content to target ".concat(e+1,"/").concat(o.length))})}},{key:"_cancelPreviousNavigation",value:function t(){this._activeController&&(this._activeController.abort(),console.info("Previous navigation request cancelled")),this._clearNavigationState()}},{key:"_clearNavigationState",value:function t(){this._clearLoadedItems(),this._resetLoadingState(),this._loadResults=[]}},{key:"_loadItems",value:function t(t,e,n){return a(function(){var i,o,a;return $(this,function(s){switch(s.label){case 0:i=this;if(!this._testElement||t.length===0)return[2];o=t.map(function(t){return i._findItemRef(t)});this._clearLoadedItems(),this._clearStimulusRef();return[4,Promise.all(o.map(function(t){return i._loadSingleItem(t,e,n)}))];case 1:a=s.sent().filter(Boolean);this._isStaleNavigation(e,n)||(a.forEach(function(t){var e=t.itemRef,n=t.doc;e&&n&&(e.xmlDoc=n)}),a.forEach(function(t){var e=t.itemRef;var n;var o=e===null||e===void 0?void 0:e.identifier;if(!e||!o)return;var a=(n=i.testContext.items.find(function(t){return t.identifier===o}))===null||n===void 0?void 0:n.state;a!==void 0&&e.updateComplete.then(function(){var t=e.assessmentItem;t&&(t.state=a)})}),this._loadResults=a);return[2]}})}).call(this)}},{key:"_loadSingleItem",value:function t(t,e,n){return a(function(){var i,o,a,s,l,u,c;return $(this,function(d){switch(d.label){case 0:d.trys.push([0,4,,5]);s=(a=this.querySelector("test-navigation"))===null||a===void 0?void 0:(o=a.qtiContext)===null||o===void 0?void 0:(i=o.QTI_CONTEXT)===null||i===void 0?void 0:i.seed;return[4,a_().load(t.href,n.signal)];case 1:l=d.sent().shuffleInteractions(s);u=this.postLoadTransformCallback;if(!u)return[3,3];return[4,this.postLoadTransformCallback(l,t)];case 2:u=l=d.sent();d.label=3;case 3:return[2,(u,this._isStaleNavigation(e,n)?null:{itemRef:t,doc:l.htmlDoc()})];case 4:c=d.sent();if(c.name==="AbortError")throw console.info("Item load for ".concat(t.identifier," was aborted")),c;return[2,(console.warn("Failed to load item ".concat(t.identifier,":"),c),null)];case 5:return[2]}})}).call(this)}},{key:"_loadStimulus",value:function t(t){return a(function(){var e;return $(this,function(n){switch(n.label){case 0:return[4,a_().load(t,(e=this._activeController)===null||e===void 0?void 0:e.signal)];case 1:return[2,n.sent().htmlDoc()]}})}).call(this)}},{key:"_findItemRef",value:function t(t){var e;var n=(e=this._testElement)===null||e===void 0?void 0:e.querySelector('qti-assessment-item-ref[identifier="'.concat(t,'"]'));if(!n)throw new Error('Item with identifier "'.concat(t,'" not found'));return n}},{key:"_findSection",value:function t(t){var e;return((e=this._testElement)===null||e===void 0?void 0:e.querySelector('qti-assessment-section[identifier="'.concat(t,'"]')))||null}},{key:"_updateSessionContext",value:function t(t,e){var n,i;var o=(n=t.closest("qti-test-part"))===null||n===void 0?void 0:n.identifier,a=(i=t.closest("qti-assessment-section"))===null||i===void 0?void 0:i.identifier;this.sessionContext=_(k({},this.sessionContext),{navPartId:o,navSectionId:a,navItemRefId:e})}},{key:"_getSectionItemIds",value:function t(t){return Array.from(this._testElement.querySelectorAll('qti-assessment-section[identifier="'.concat(t,'"] > qti-assessment-item-ref'))).map(function(t){return t.identifier}).filter(Boolean)}},{key:"_clearLoadedItems",value:function t(){var t;var e=(t=this._testElement)===null||t===void 0?void 0:t.querySelectorAll("qti-assessment-item-ref");Array.from(e||[]).forEach(function(t){t.xmlDoc=null})}},{key:"_clearStimulusRef",value:function t(){this.querySelectorAll("[data-stimulus-idref]").forEach(function(t){return t.innerHTML=""})}},{key:"_isStaleNavigation",value:function t(t,e){return e.signal.aborted||t!==this._navigationId}},{key:"_createNavigationError",value:function t(t,e,n){return{message:t.message||"Failed to load ".concat(e,": ").concat(n),details:t,itemId:e==="item"?n:void 0,sectionId:e==="section"?n:void 0}}},{key:"_dispatchLoadingStarted",value:function t(t,e){this.dispatchEvent(new CustomEvent("qti-navigation-loading-started",{detail:{type:t,id:e},bubbles:!0,composed:!0}))}},{key:"_dispatchLoadingEnded",value:function t(t,e){this.dispatchEvent(new CustomEvent("qti-navigation-loading-ended",{detail:{type:t,id:e},bubbles:!0,composed:!0}))}},{key:"_dispatchError",value:function t(t){this.dispatchEvent(new CustomEvent("qti-navigation-error",{detail:t,bubbles:!0,composed:!0}))}},{key:"_dispatchTestLoaded",value:function t(t){var e=this;requestAnimationFrame(function(){e.dispatchEvent(new CustomEvent("qti-test-loaded",{detail:t.map(function(t){var e=t.itemRef;return{identifier:e===null||e===void 0?void 0:e.identifier,element:e}}),bubbles:!0,composed:!0}))})}}]);return e}(t);return rj([o({type:String})],e.prototype,"navigate",2),rj([o({type:Number})],e.prototype,"requestTimeout",2),rj([o({attribute:!1})],e.prototype,"postLoadTransformCallback",2),rj([o({attribute:!1})],e.prototype,"postLoadTestTransformCallback",2),e};var aN=function t(t){var e=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++){n[i]=arguments[i]}l(this,e);var o;o=s(this,e,N(n)),o.sessionContext=_(k({},o.sessionContext),{view:"candidate"}),o.addEventListener("on-test-switch-view",function(t){o.sessionContext=_(k({},o.sessionContext),{view:t.detail}),o._updateElementView()}),o.addEventListener("qti-assessment-test-connected",function(){o._updateElementView()}),o.addEventListener("qti-assessment-item-connected",function(t){o._updateElementView(),o._setCorrectResponseVisibility(t.detail)});return o}d(e,[{key:"willUpdate",value:function t(t){f(p(e.prototype),"willUpdate",this).call(this,t),t.has("sessionContext")&&this._updateElementView()}},{key:"_updateElementView",value:function t(){var t=this;if(this._testElement){var e;Array.from(this._testElement.querySelectorAll("[view]")).forEach(function(e){e.classList.toggle("show",e.getAttribute("view")===t.sessionContext.view)});var n=(e=this._testElement.querySelector('qti-assessment-item-ref[identifier="'.concat(this.sessionContext.navItemRefId,'"]')))===null||e===void 0?void 0:e.assessmentItem;n&&n.showCorrectResponse(this.sessionContext.view==="scorer")}}},{key:"_setCorrectResponseVisibility",value:function t(t){t.showCorrectResponse(this.sessionContext.view==="scorer")}}]);return e}(t);return e};var aU=function e(e){var n=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++){n[i]=arguments[i]}l(this,e);var o;o=s(this,e,N(n));o.testContext=oH;o.sessionContext=oz;o._updateItemInTestContext=function(t){var e;var n=t._context,i=n.identifier,a=n.variables,s=o.testContext.items.find(function(t){return(t===null||t===void 0?void 0:t.identifier)===i});if(!s){console.warn("Item IDs between assessment.xml and item.xml should match: ".concat(i," is not found!"));return}if(((e=s.variables)===null||e===void 0?void 0:e.length)===1)o._updateItemVariablesInTestContext(i,a);else{var l=N(t.variables);var u=true,c=false,d=undefined;try{var h=function(){var t=p.value;var e=l.find(function(e){return e.identifier===t.identifier});e?e.value=t.value:l.push(t)};for(var f=s.variables[Symbol.iterator](),p;!(u=(p=f.next()).done);u=true)h()}catch(t){c=true;d=t}finally{try{if(!u&&f.return!=null){f.return()}}finally{if(c){throw d}}}t.variables=l}};o._initializeEventListeners();return o}d(e,[{key:"updateItemVariables",value:function t(t,e){var n=this.testContext.items.find(function(e){return e.identifier===t});n&&(n.variables=n.variables.map(function(t){var n=e.find(function(e){return e.identifier===t.identifier});return n?k({},t,n):t}));var i=this._testElement.querySelector('qti-assessment-item-ref[identifier="'.concat(t,'"]'));i&&i.assessmentItem&&(i.assessmentItem.variables=e)}},{key:"_initializeEventListeners",value:function t(){var t=this;this.addEventListener("qti-assessment-test-connected",function(e){if(t.testContext=oH,t.sessionContext=oz,t.testContext&&t.testContext.items.length>0)return;t._testElement=e.detail;var n=Array.from(t._testElement.querySelectorAll("qti-assessment-item-ref")).map(function(t){return{href:t.href,identifier:t.identifier,category:t.category,variables:[{identifier:"completionStatus",value:"not_attempted",type:"outcome"}]}});t.testContext=_(k({},t.testContext),{items:n})}),this.addEventListener("qti-assessment-item-connected",function(e){var n;var i=e.detail,o=(n=i.closest("qti-assessment-item-ref"))===null||n===void 0?void 0:n.identifier;o&&(i.assessmentItemRefId=o),t._updateItemInTestContext(e.detail)}),this.addEventListener("qti-item-context-updated",function(e){t._updateItemVariablesInTestContext(e.detail.itemContext.identifier,e.detail.itemContext.variables,e.detail.itemContext.state)})}},{key:"_updateItemVariablesInTestContext",value:function t(t,e,n){this.testContext=_(k({},this.testContext),{items:this.testContext.items.map(function(i){return i.identifier!==t?i:k(_(k({},i),{variables:e.map(function(t){var e=i.variables.find(function(e){return e.identifier===t.identifier});return e?k({},e,t):t})}),n!==void 0?{state:n?k({},n):void 0}:{})})}),this.dispatchEvent(new CustomEvent("qti-test-context-updated",{detail:this.testContext,bubbles:!1,composed:!1}))}}]);return e}(e);return rj([o({attribute:!1,type:Object}),t({context:oQ})],n.prototype,"testContext",2),rj([o({attribute:!1,type:Object}),t({context:oB})],n.prototype,"sessionContext",2),n},aL=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}return e}(aU(oR));var aD=function t(t){var e=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++){n[i]=arguments[i]}l(this,e);var o;o=s(this,e,N(n)),o.addEventListener("qti-register-variable",function(t){o.testContext=_(k({},o.testContext),{testOutcomeVariables:N(o.testContext.testOutcomeVariables||[]).concat([t.detail.variable])}),t.stopPropagation()}),o.addEventListener("qti-set-outcome-value",function(t){var e=t.detail,n=e.outcomeIdentifier,i=e.value;o.updateOutcomeVariable(n,i),t.stopPropagation()});return o}d(e,[{key:"outcomeProcessing",value:function t(){var t=this.querySelector("qti-outcome-processing");return t?(t===null||t===void 0?void 0:t.process(),!0):!1}},{key:"updateOutcomeVariable",value:function t(t,e){var n;var i=this.getOutcome(t);if(!i){console.warn("Can not set qti-outcome-identifier: ".concat(t,", it is not available"));return}this.testContext=_(k({},this.testContext),{testOutcomeVariables:(n=this.testContext.testOutcomeVariables)===null||n===void 0?void 0:n.map(function(n){return n.identifier!==t?n:_(k({},n),{value:i.cardinality==="single"?e:N(n.value).concat([e])})})})}},{key:"getOutcome",value:function t(t){return this.getVariable(t)}},{key:"getVariable",value:function t(t){var e;return((e=this.testContext.testOutcomeVariables)===null||e===void 0?void 0:e.find(function(e){return e.identifier===t}))||null}}]);return e}(t);return e};var aV=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.configContext={};return t}d(e,[{key:"connectedCallback",value:function t(){var t=this;var n=this,i=function n(){return f(p(e.prototype),"connectedCallback",t)};return a(function(){return $(this,function(t){switch(t.label){case 0:i().call(n);return[4,this.updateComplete];case 1:t.sent(),this.dispatchEvent(new CustomEvent("qti-test-connected",{detail:this}));return[2]}})}).call(this)}},{key:"render",value:function t(){return ol(B())}}]);return e}(aO(aN(aD(aU(oR)))));rj([u(),t({context:oL})],aV.prototype,"configContext",2),aV=rj([oT("qti-test")],aV);var a$={fromAttribute:function t(t){return t==="true"},toAttribute:function t(t){return t?"true":"false"}},aW=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.weigths=new Map;return t}d(e,[{key:"createRenderRoot",value:function t(){return this}},{key:"assessmentItem",get:function t(){var t;return(t=this.renderRoot)===null||t===void 0?void 0:t.querySelector("qti-assessment-item")}},{key:"connectedCallback",value:function t(){var t=this;var n=this,i=function n(){return f(p(e.prototype),"connectedCallback",t)};return a(function(){return $(this,function(t){switch(t.label){case 0:i().call(n);return[4,this.updateComplete];case 1:t.sent(),this.dispatchEvent(new CustomEvent("qti-assessment-item-ref-connected",{bubbles:!0,composed:!0,detail:{identifier:this.identifier,href:this.href,category:this.category}}));return[2]}})}).call(this)}},{key:"render",value:function t(){return this.myTemplate?this.myTemplate({xmlDoc:this.xmlDoc}):this.xmlDoc}}]);return e}(oR);rj([o({type:String})],aW.prototype,"category",2),rj([o({type:String})],aW.prototype,"identifier",2),rj([o({type:Boolean,converter:a$})],aW.prototype,"required",2),rj([o({type:Boolean,converter:a$})],aW.prototype,"fixed",2),rj([o({type:String})],aW.prototype,"href",2),rj([o({type:Object,attribute:!1})],aW.prototype,"xmlDoc",2);customElements.get("qti-assessment-item-ref")||customElements.define("qti-assessment-item-ref",aW);var aj={fromAttribute:function t(t){return t==="true"},toAttribute:function t(t){return t?"true":"false"}},aF,az=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,aF,"");return t}d(e,[{key:"title",get:function t(){return rz(this,aF)},set:function t(t){rH(this,aF,t),this.removeAttribute("title"),this.setAttribute("data-title",t)}},{key:"connectedCallback",value:function t(){var t=this;var n=this,i=function n(){return f(p(e.prototype),"connectedCallback",t)};return a(function(){return $(this,function(t){switch(t.label){case 0:rH(this,aF,this.getAttribute("title")||""),i().call(n);return[4,this.updateComplete];case 1:t.sent(),this.dispatchEvent(new Event("qti-assessment-section-connected",{bubbles:!0,composed:!0}));return[2]}})}).call(this)}},{key:"render",value:function t(){return ol(H())}}]);return e}(oR);aF=new WeakMap,rj([o({type:String})],az.prototype,"identifier",2),rj([o({type:String})],az.prototype,"required",2),rj([o({type:Boolean,converter:aj})],az.prototype,"fixed",2),rj([o({type:Boolean,converter:aj})],az.prototype,"visible",2),rj([o({type:Boolean,converter:aj,attribute:"keep-together"})],az.prototype,"keepTogether",2),rj([e({context:oQ,subscribe:!0})],az.prototype,"_testContext",2);customElements.get("qti-assessment-section")||customElements.define("qti-assessment-section",az);var aB,aH=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,aB,"");return t}d(e,[{key:"title",get:function t(){return rz(this,aB)},set:function t(t){rH(this,aB,t),this.removeAttribute("title"),this.setAttribute("data-title",t)}},{key:"connectedCallback",value:function t(){var t=this;var n=this,i=function n(){return f(p(e.prototype),"connectedCallback",t)};return a(function(){return $(this,function(t){switch(t.label){case 0:i().call(n);return[4,this.updateComplete];case 1:t.sent(),this.dispatchEvent(new CustomEvent("qti-assessment-test-connected",{detail:this,bubbles:!0,composed:!0}));return[2]}})}).call(this)}},{key:"render",value:function t(){return ol(Q())}}]);return e}(oR);aB=new WeakMap,rj([o({type:String})],aH.prototype,"identifier",2),rj([o({type:String})],aH.prototype,"title",1),rj([e({context:oQ,subscribe:!0})],aH.prototype,"_testContext",2),aH=rj([oT("qti-assessment-test")],aH);var aQ,aX=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.identifier="";t.class="";t.navigationMode="nonlinear";t.submissionMode="individual";rB(t,aQ,"");return t}d(e,[{key:"title",get:function t(){return rz(this,aQ)},set:function t(t){rH(this,aQ,t),this.removeAttribute("title"),this.setAttribute("data-title",t)}},{key:"connectedCallback",value:function t(){var t=this;var n=this,i=function n(){return f(p(e.prototype),"connectedCallback",t)};return a(function(){return $(this,function(t){switch(t.label){case 0:i().call(n);return[4,this.updateComplete];case 1:t.sent(),this.dispatchEvent(new Event("qti-test-part-connected",{bubbles:!0,composed:!0}));return[2]}})}).call(this)}},{key:"render",value:function t(){return ol(X())}}]);return e}(oR);aQ=new WeakMap,rj([o({type:String})],aX.prototype,"identifier",2),rj([o({type:String})],aX.prototype,"class",2),rj([o({type:String,attribute:"navigation-mode"})],aX.prototype,"navigationMode",2),rj([o({type:String,attribute:"submission-mode"})],aX.prototype,"submissionMode",2),aX=rj([oT("qti-test-part")],aX);customElements.get("qti-test-part")||customElements.define("qti-test-part",aX);var aG,aJ,aY,aK,aZ,a0,a1,a2,a3,a5,a4,a6,a8,a7,a9,st,se,sn,sr,si=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,a0);rB(t,aG);rB(t,aJ,null);t.identifier="";t.adaptive="false";t.timeDependent=null;t._handleDisabledChange=function(e,n){rz(t,aZ).forEach(function(t){return t.disabled=n})};t._handleReadonlyChange=function(e,n){return rz(t,aZ).forEach(function(t){return t.readonly=n})};t._context={variables:oD};rB(t,aY,_(k({},t._context),{variables:t._context.variables}));rB(t,aK,[]);rB(t,aZ,[]);rB(t,a3,function(e){e.stopImmediatePropagation(),t._context=_(k({},t._context),{variables:N(t._context.variables).concat([e.detail.variable])}),rH(t,aY,t._context),e.stopPropagation()});rB(t,a5,function(e){var n;e.stopImmediatePropagation();var i=e.detail;rz(t,aK).push(i),(Number((n=t._context.variables.find(function(t){return t.identifier==="numAttempts"}))===null||n===void 0?void 0:n.value)||0)>0&&i.checkShowFeedback(i.outcomeIdentifier)});rB(t,a4,function(e){e.stopImmediatePropagation(),rz(t,aZ).push(e.detail.interactionElement)});rB(t,a6,function(e){e.stopImmediatePropagation();var n=e.detail,i=n.responseIdentifier,o=n.countAttempt;t.validate(),t.updateResponseVariable(i,"true"),t.processResponse(o)});rB(t,a8,function(e){e.stopImmediatePropagation();var n=e.detail,i=n.outcomeIdentifier,o=n.value;t.updateOutcomeVariable(i,o),e.stopPropagation()});rB(t,a7,function(e){e.stopImmediatePropagation();var n=e.detail,i=n.templateIdentifier,o=n.value;t.updateTemplateVariable(i,o!==null&&o!==void 0?o:void 0),e.stopPropagation()});rB(t,a9,function(e){e.stopImmediatePropagation();var n=e.detail,i=n.responseIdentifier,o=n.value;t.updateCorrectResponse(i,o!==null&&o!==void 0?o:void 0),e.stopPropagation()});rB(t,st,function(e){e.stopImmediatePropagation();var n=e.detail,i=n.responseIdentifier,o=n.response,a=n.state;t.updateResponseVariable(i,o),a!==void 0&&(t._context=_(k({},t._context),{state:_(k({},t._context.state||{}),h({},i,a))})),t.dispatchEvent(new CustomEvent("qti-item-context-updated",{bubbles:!0,composed:!0,detail:{itemContext:t._context}}))});return t}d(e,[{key:"title",get:function t(){return rz(this,aG)},set:function t(t){rH(this,aG,t),this.removeAttribute("title"),this.setAttribute("data-title",t)}},{key:"assessmentItemRefId",get:function t(){return this._context.identifier},set:function t(t){this._context=_(k({},this._context),{identifier:t})}},{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=_(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),{interpolationTable:e.interpolationTable}):e})}),this._context.variables.forEach(function(t){if(t.type==="response"){var n=rz(e,aZ).find(function(e){return e.responseIdentifier===t.identifier});n&&(n.response=t.value)}}),this.variables.forEach(function(t){t.type==="outcome"&&rz(e,aK).forEach(function(e){return e.checkShowFeedback(t.identifier)})})}},{key:"state",get:function t(){return this._context.state},set:function t(t){this._context=_(k({},this._context),{state:t?k({},t):void 0})}},{key:"responses",set:function t(t){var e=true,n=false,i=undefined;if(t)try{var o,a=function(){var t=l.value;o.getResponse(t.responseIdentifier)&&o.updateResponseVariable(t.responseIdentifier,t.response);var e=rz(o,aZ).find(function(e){return e.getAttribute("response-identifier")===t.responseIdentifier});e&&(e.response=t.response)};for(var s=t[Symbol.iterator](),l;!(e=(l=s.next()).done);e=true)o=this,a()}catch(t){n=true;i=t}finally{try{if(!e&&s.return!=null){s.return()}}finally{if(n){throw i}}}}},{key:"render",value:function t(){return ol(G())}},{key:"connectedCallback",value:function t(){var t=this;rQ(this,a0,a1).call(this),f(p(e.prototype),"connectedCallback",this).call(this),this.updateComplete.then(function(){t.dispatchEvent(new CustomEvent("qti-assessment-item-connected",{bubbles:!0,composed:!0,detail:t})),rQ(t,a0,se).call(t)})}},{key:"disconnectedCallback",value:function t(){rQ(this,a0,a2).call(this),f(p(e.prototype),"disconnectedCallback",this).call(this)}},{key:"showCorrectResponse",value:function t(t){var e=true,n=false,i=undefined;try{for(var o=rz(this,aZ)[Symbol.iterator](),a;!(e=(a=o.next()).done);e=true){var s=a.value;s.toggleCorrectResponse(t)}}catch(t){n=true;i=t}finally{try{if(!e&&o.return!=null){o.return()}}finally{if(n){throw i}}}document.querySelectorAll("item-show-correct-response").forEach(function(e){e.shown=t})}},{key:"showCandidateCorrection",value:function t(t){var e=true,n=false,i=undefined;try{for(var o=rz(this,aZ)[Symbol.iterator](),a;!(e=(a=o.next()).done);e=true){var s=a.value;s.toggleCandidateCorrection(t)}}catch(t){n=true;i=t}finally{try{if(!e&&o.return!=null){o.return()}}finally{if(n){throw i}}}document.querySelectorAll("item-show-candidate-correction").forEach(function(e){e.shown=t})}},{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),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.adaptive==="false"&&rQ(this,a0,sr).call(this);var i=this.querySelector("qti-response-processing"),o=!!(i&&typeof i.process=="function");return o&&i.process(),this.adaptive==="false"&&this.updateOutcomeVariable("completionStatus",rQ(this,a0,sn).call(this)),this.dispatchEvent(new CustomEvent("qti-item-context-updated",{bubbles:!0,composed:!0,detail:{itemContext:this._context}})),o}},{key:"resetResponses",value:function t(){this._context=rz(this,aY)}},{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=_(k({},this._context),{variables:this._context.variables.map(function(n){return n.identifier!==t?n:_(k({},n),{value:e})})}),this.showCandidateCorrection(!1),this.dispatchEvent(new CustomEvent("qti-interaction-changed",{bubbles:!0,composed:!0,detail:{item:this.identifier,responseIdentifier:t,response:Array.isArray(e)?N(e):e}})),this.adaptive==="false"&&this.updateOutcomeVariable("completionStatus",rQ(this,a0,sn).call(this))}},{key:"updateTemplateVariable",value:function t(t,e){var n=this._context.variables.find(function(e){return e.identifier===t&&e.type==="template"});if(!n){console.warn("Can not set qti-template-identifier: ".concat(t,", it is not available"));return}var i=n.cardinality==="single"?Array.isArray(e)?e[0]:e!==null&&e!==void 0?e:null:e==null?null:Array.isArray(e)?e:[e];this._context=_(k({},this._context),{variables:this._context.variables.map(function(e){return e.identifier!==t?e:_(k({},e),{value:i})})}),this.dispatchEvent(new CustomEvent("qti-item-context-updated",{bubbles:!0,composed:!0,detail:{itemContext:this._context}}))}},{key:"updateCorrectResponse",value:function t(t,e){var n=this.getResponse(t);if(!n){console.warn("Can not set correct response for identifier: ".concat(t,", it is not available"));return}var i=n.cardinality==="single"?Array.isArray(e)?e[0]:e!==null&&e!==void 0?e:null:e==null?null:Array.isArray(e)?e:[e];this._context=_(k({},this._context),{variables:this._context.variables.map(function(e){return e.identifier!==t?e:_(k({},e),{correctResponse:i})})}),this.dispatchEvent(new CustomEvent("qti-item-context-updated",{bubbles:!0,composed:!0,detail:{itemContext:this._context}}))}},{key:"setOutcomeVariable",value:function t(t,e){this.updateOutcomeVariable(t,e),this.dispatchEvent(new CustomEvent("qti-item-context-updated",{bubbles:!0,composed:!0,detail:{itemContext:this._context}}))}},{key:"updateOutcomeVariable",value:function t(t,e){var n;var i=this.getOutcome(t);if(!i){console.warn("Can not set qti-outcome-identifier: ".concat(t,", it is not available"));return}this._context=_(k({},this._context),{variables:this._context.variables.map(function(n){return n.identifier!==t?n:_(k({},n),{value:i.cardinality==="single"||Array.isArray(e)?e:[e]})})}),rz(this,aK).forEach(function(e){return e.checkShowFeedback(t)}),this.dispatchEvent(new CustomEvent("qti-outcome-changed",{bubbles:!0,composed:!0,detail:{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;var e=rz(this,aZ).every(function(t){return t.validate()});return t&&this.reportValidity(),e}},{key:"reportValidity",value:function t(){var t=true,e=false,n=undefined;try{for(var i=rz(this,aZ)[Symbol.iterator](),o;!(t=(o=i.next()).done);t=true){var a=o.value;a.reportValidity()}}catch(t){e=true;n=t}finally{try{if(!t&&i.return!=null){i.return()}}finally{if(e){throw n}}}}}]);return e}(oR);aG=new WeakMap,aJ=new WeakMap,aY=new WeakMap,aK=new WeakMap,aZ=new WeakMap,a0=new WeakSet,a1=function t(){this.addEventListener("qti-register-variable",rz(this,a3)),this.addEventListener("qti-register-feedback",rz(this,a5)),this.addEventListener("qti-register-interaction",rz(this,a4)),this.addEventListener("end-attempt",rz(this,a6)),this.addEventListener("qti-set-outcome-value",rz(this,a8)),this.addEventListener("qti-set-template-value",rz(this,a7)),this.addEventListener("qti-set-correct-response",rz(this,a9)),this.addEventListener("qti-interaction-response",rz(this,st))},a2=function t(){this.removeEventListener("qti-register-variable",rz(this,a3)),this.removeEventListener("qti-register-feedback",rz(this,a5)),this.removeEventListener("qti-register-interaction",rz(this,a4)),this.removeEventListener("end-attempt",rz(this,a6)),this.removeEventListener("qti-set-outcome-value",rz(this,a8)),this.removeEventListener("qti-set-template-value",rz(this,a7)),this.removeEventListener("qti-set-correct-response",rz(this,a9)),this.removeEventListener("qti-interaction-response",rz(this,st))},a3=new WeakMap,a5=new WeakMap,a4=new WeakMap,a6=new WeakMap,a8=new WeakMap,a7=new WeakMap,a9=new WeakMap,st=new WeakMap,se=function t(){return a(function(){var t,e;return $(this,function(n){switch(n.label){case 0:t=Array.from(this.querySelectorAll("qti-template-declaration"));e=t.length>0;if(!e)return[3,3];return[4,Promise.all(t.map(function(t){return t.updateComplete}))];case 1:n.sent();return[4,Promise.resolve()];case 2:e=n.sent();n.label=3;case 3:e,rH(this,aJ,this.querySelector("qti-template-processing")),rz(this,aJ)&&(rz(this,aJ).process(),rH(this,aY,_(k({},this._context),{variables:this._context.variables})));return[2]}})}).call(this)},sn=function t(){var t=this.validate(!1);return t===!0?"completed":t===!1?"incomplete":"not_attempted"},sr=function t(){this._context=_(k({},this._context),{variables:this._context.variables.map(function(t){var e;if(t.type!=="outcome")return t;var n=(e="defaultValue"in t?t.defaultValue:null)!==null&&e!==void 0?e:null;return n==null&&(t.baseType==="integer"||t.baseType==="float")&&(n="0"),_(k({},t),{value:n})})})},rj([o({type:String})],si.prototype,"identifier",2),rj([o({type:String})],si.prototype,"adaptive",2),rj([o({type:String})],si.prototype,"timeDependent",2),rj([o({type:String})],si.prototype,"title",1),rj([o({type:Boolean})],si.prototype,"disabled",2),rj([y("disabled",{waitUntilFirstUpdate:!0})],si.prototype,"_handleDisabledChange",2),rj([o({type:Boolean})],si.prototype,"readonly",2),rj([y("readonly",{waitUntilFirstUpdate:!0})],si.prototype,"_handleReadonlyChange",2),rj([t({context:oV})],si.prototype,"_context",2),si=rj([oT("qti-assessment-item")],si);var so=/*#__PURE__*/function(t){"use strict";v(e,t);function e(t,n){l(this,e);var i;i=s(this,e,[e.eventName,{bubbles:!0,composed:!0,cancelable:!0}]);i.element=t;i.item=n;return i}return e}(D(Event));so.eventName="qti-assessment-stimulus-ref-connected";var sa=so,ss=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.identifier="";t.href="";return t}d(e,[{key:"connectedCallback",value:function t(){var t=this;var n=this,i=function n(){return f(p(e.prototype),"connectedCallback",t)};return a(function(){var t,e,o,a;return $(this,function(s){switch(s.label){case 0:i().call(n);return[4,this.updateComplete];case 1:s.sent();t=this.closest("qti-assessment-item"),e=new sa(this,t);this.dispatchEvent(e);o=t===null||t===void 0?void 0:t.querySelector('[data-stimulus-idref="'.concat(this.identifier,'"]'));a=!e.defaultPrevented&&o;if(!a)return[3,3];return[4,this.updateStimulusRef(o)];case 2:a=s.sent();s.label=3;case 3:a;return[2]}})}).call(this)}},{key:"updateStimulusRef",value:function t(t){return a(function(){var e,n,i;return $(this,function(o){switch(o.label){case 0:return[4,a_().load(this.href).then(function(t){return t.htmlDoc()})];case 1:e=o.sent();if(e){;i=e.querySelectorAll("qti-stimulus-body, qti-stylesheet");t.innerHTML="",(n=t).append.apply(n,N(i))}return[2]}})}).call(this)}}]);return e}(oR);rj([o({type:String})],ss.prototype,"identifier",2),rj([o({type:String})],ss.prototype,"href",2),ss=rj([oT("qti-assessment-stimulus-ref")],ss);var sl=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}return e}(oR);sl=rj([oT("qti-companion-materials-info")],sl);var su,sc=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,su);return t}d(e,[{key:"render",value:function t(){return ol(J(),this.handleSlotChange)}},{key:"handleSlotChange",value:function t(){var t;var e;var n=Array.from((t=(e=this.firstElementChild)===null||e===void 0?void 0:e.childNodes)!==null&&t!==void 0?t:[]).find(function(t){return t.nodeType===Node.COMMENT_NODE});try{var i;rH(this,su,new Function("context","fn","item",(i=n===null||n===void 0?void 0:n.textContent)!==null&&i!==void 0?i:""))}catch(t){console.error("custom-operator contains invalid javascript code",t)}}},{key:"calculate",value:function t(){var t=this;var e={variable:function e(e){var n;var i,o;return(n=(o=t._context)===null||o===void 0?void 0:(i=o.variables.find(function(t){return t.identifier===e}))===null||i===void 0?void 0:i.value)!==null&&n!==void 0?n:""},correct:function e(e){var n;var i,o;return(n=(o=t._context)===null||o===void 0?void 0:(i=o.variables.find(function(t){return t.identifier===e}))===null||i===void 0?void 0:i.correctResponse)!==null&&n!==void 0?n:""}},n={getVariable:function e(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(e,n){t.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:e,value:n}}))},updateResponseVariable:function e(e,n){t.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:e,response:n}}))}};return rz(this,su).call(this,this._context,e,n)}}]);return e}(oR);su=new WeakMap,rj([e({context:oV,subscribe:!0}),u()],sc.prototype,"_context",2),sc=rj([oT("qti-custom-operator")],sc);var sd=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){return ol(Y(),this.showStatus)}},{key:"connectedCallback",value:function t(){f(p(e.prototype),"connectedCallback",this).call(this),this.checkShowFeedback(this.outcomeIdentifier)}}]);return e}(am);sd.styles=iM(K()),sd=rj([oT("qti-feedback-block")],sd);var sh=function t(t){return t!==null&&t!==void 0?t:oh};var sf=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.render=function(){return ol(Z(),sh(t.showStatus))};return t}d(e,[{key:"connectedCallback",value:function t(){f(p(e.prototype),"connectedCallback",this).call(this),this.checkShowFeedback(this.outcomeIdentifier)}}]);return e}(am);sf.styles=iM(tt()),sf=rj([oT("qti-feedback-inline")],sf);var sp=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){return ol(te(),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(){f(p(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}(am);sp.styles=iM(tn()),sp=rj([oT("qti-modal-feedback")],sp);var sv=iM(tr());var sm=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){return ol(ti())}}]);return e}(oR);sm.styles=sv,sm=rj([oT("qti-item-body")],sm);var sg,sy,sb,sw=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,sg);return t}d(e,[{key:"render",value:function t(){return ol(to(),rQ(this,sg,sy))}},{key:"connectedCallback",value:function t(){var t=this;f(p(e.prototype),"connectedCallback",this).call(this),this.updateComplete.then(function(){return rQ(t,sg,sy).call(t)})}},{key:"updated",value:function t(t){t.has("context")&&rQ(this,sg,sy).call(this)}}]);return e}(oR);sg=new WeakSet,sy=function t(){var t;var e;var n=new Map,i=((t=(e=this.context)===null||e===void 0?void 0:e.variables)!==null&&t!==void 0?t:[]).filter(function(t){return t.type==="template"});var o=true,a=false,s=undefined;try{for(var l=i[Symbol.iterator](),u;!(o=(u=l.next()).done);o=true){var c=u.value;var d=c;d.mathVariable!==!0||d.value===null||d.value===void 0||n.set(d.identifier,rQ(this,sg,sb).call(this,d.value))}}catch(t){a=true;s=t}finally{try{if(!o&&l.return!=null){l.return()}}finally{if(a){throw s}}}if(n.size===0)return;var h=Array.from(this.querySelectorAll("*")).filter(function(t){return t.localName.toLowerCase()==="mi"||t.localName.toLowerCase()==="mn"});var f=true,p=false,v=undefined;try{for(var m=h[Symbol.iterator](),g;!(f=(g=m.next()).done);f=true){var y=g.value;var b,w;var q;var k=(b=(w=y.getAttribute("data-qti-math-variable-source"))!==null&&w!==void 0?w:(q=y.textContent)===null||q===void 0?void 0:q.trim())!==null&&b!==void 0?b:"",x=n.get(k);if(!x)continue;if(y.localName.toLowerCase()==="mn"){y.textContent=x,y.setAttribute("data-qti-math-variable-source",k);continue}var _=document.createElement("mn");_.textContent=x,_.setAttribute("data-qti-math-variable-source",k),y.replaceWith(_)}}catch(t){p=true;v=t}finally{try{if(!f&&m.return!=null){m.return()}}finally{if(p){throw v}}}},sb=function t(t){var e;return Array.isArray(t)?t.join(" "):(e=t===null||t===void 0?void 0:t.toString())!==null&&e!==void 0?e:""},rj([e({context:oV,subscribe:!0}),u()],sw.prototype,"context",2),sw=rj([oT("qti-content-body")],sw);var sq=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"handleclassNamesChange",value:function t(){var t=this;this.classNames.split(" ").forEach(function(e){switch(e){case"qti-rubric-discretionary-placement":{var n=new CustomEvent("qti-rubric:discretionary-placement",{detail:{className:e,element:t},bubbles:!0,composed:!0,cancelable:!0});if(!t.dispatchEvent(n))return;t.setAttribute("slot","qti-rubric-block")}break;case"qti-rubric-inline":t.setAttribute("slot","");break;default:break}})}},{key:"render",value:function t(){return ol(ta())}}]);return e}(oR);sq.styles=iM(ts()),rj([o({type:String})],sq.prototype,"id",2),rj([o({type:String})],sq.prototype,"use",2),rj([o({type:String})],sq.prototype,"view",2),rj([o({type:String,attribute:"class"})],sq.prototype,"classNames",2),rj([y("classNames",{waitUntilFirstUpdate:!0})],sq.prototype,"handleclassNamesChange",1),sq=rj([oT("qti-rubric-block")],sq);var sk,sx,s_,sE=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,sx);rB(t,sk,null);return t}d(e,[{key:"firstUpdated",value:function t(t){var n=this;f(p(e.prototype),"firstUpdated",this).call(this,t);var i=this.getAttribute("href");if(i!==null&&fetch(i).then(function(t){return t.text()}).then(function(t){var e=rQ(n,sx,s_).call(n,t);rH(n,sk,document.createElement("style")),rz(n,sk).media="screen",rz(n,sk).textContent="@scope {".concat(e,"}"),n.parentElement?n.parentElement.appendChild(rz(n,sk)):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 o=rQ(this,sx,s_).call(this,this.textContent);rH(this,sk,document.createElement("style")),rz(this,sk).media="screen",rz(this,sk).textContent="@scope {".concat(o,"}"),this.parentElement?this.parentElement.appendChild(rz(this,sk)):console.warn("No parent element to append the scoped stylesheet to.")}}},{key:"disconnectedCallback",value:function t(){if(rz(this,sk))try{rz(this,sk).remove()}catch(t){console.error("Could not remove stylesheet:",t)}f(p(e.prototype),"disconnectedCallback",this).call(this)}}]);return e}(oR);sk=new WeakMap,sx=new WeakSet,s_=function t(t){return t.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\s+/g," ").replace(/\s*([{}:;])\s*/g,"$1").trim()},sE=rj([oT("qti-stylesheet")],sE);var sC,sS,sA,sR,sI=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,sC);return t}d(e,[{key:"render",value:function t(){var t=this;var e,n;var i=(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 ol(tl(),JSON.stringify(i,null,2))}},{key:"connectedCallback",value:function t(){f(p(e.prototype),"connectedCallback",this).call(this);var t=this.defaultValues(this.cardinality),n={baseType:this.baseType,identifier:this.identifier,correctResponse:rz(this,sC,sS),cardinality:this.cardinality||"single",mapping:rz(this,sC,sA),defaultValue:t,areaMapping:rz(this,sC,sR),value:null,type:"response",candidateResponse:null};n.value=t,this.dispatchEvent(new CustomEvent("qti-register-variable",{bubbles:!0,composed:!0,detail:{variable:n}}))}}]);return e}(au);sC=new WeakSet,sS=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 i=0;i<n.length;i++)t.push(n[i].textContent.trim()),n[i].remove()}}return t},sA=function t(){var t=this.querySelector("qti-mapping"),e=parseFloat(t===null||t===void 0?void 0:t.getAttribute("lower-bound")),n=parseFloat(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":!1}})}},sR=function t(){var t=this.querySelector("qti-area-mapping"),e=Number(t===null||t===void 0?void 0:t.getAttribute("default-value"))||0,n=parseFloat(t===null||t===void 0?void 0:t.getAttribute("lower-bound")),i=parseFloat(t===null||t===void 0?void 0:t.getAttribute("upper-bound")),o=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(i)?null:i,areaMapEntries:o}},sI.styles=[iM(tu())],rj([o({type:String,attribute:"base-type"})],sI.prototype,"baseType",2),rj([o({type:String})],sI.prototype,"identifier",2),rj([o({type:String})],sI.prototype,"cardinality",2),rj([e({context:oV,subscribe:!0}),u()],sI.prototype,"itemContext",2),sI=rj([oT("qti-response-declaration")],sI);var sT=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.externalScored=null;return t}d(e,[{key:"render",value:function t(){var t=this;var e,n;var i=(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 ol(tc(),JSON.stringify(i,null,2))}},{key:"interpolationTable",get:function t(){var t=this.querySelector("qti-interpolation-table");if(t){var e=new Map;var n=true,i=false,o=undefined;try{for(var a=t.querySelectorAll("qti-interpolation-table-entry")[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;!l.getAttribute("source-value")&&l.getAttribute("target-value")&&console.error("source-value or target-value is missing in qti-interpolation-table-entry");var u=parseFloat(l.getAttribute("source-value")),c=parseFloat(l.getAttribute("target-value"));(isNaN(u)||isNaN(c))&&console.error("source-value or target-value is not a number in qti-interpolation-table-entry"),e.set(u,c)}}catch(t){i=true;o=t}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(i){throw o}}}return e}return null}},{key:"connectedCallback",value:function t(){f(p(e.prototype),"connectedCallback",this).call(this);var t=this.defaultValues(this.cardinality),n={identifier:this.identifier,cardinality:this.cardinality,baseType:this.baseType,defaultValue:t,type:"outcome",value:null,interpolationTable:this.interpolationTable,externalScored:this.externalScored};n.value=t,(n.value===null||n.value==null)&&(n.baseType==="integer"||n.baseType==="float")&&(n.value="0"),this.dispatchEvent(new CustomEvent("qti-register-variable",{bubbles:!0,composed:!0,detail:{variable:n}}))}}]);return e}(au);sT.styles=[iM(td())],rj([o({type:String,attribute:"base-type"})],sT.prototype,"baseType",2),rj([o({type:String,attribute:"external-scored"})],sT.prototype,"externalScored",2),rj([o({type:String})],sT.prototype,"identifier",2),rj([o({type:String})],sT.prototype,"cardinality",2),rj([e({context:oV,subscribe:!0}),u()],sT.prototype,"itemContext",2),sT=rj([oT("qti-outcome-declaration")],sT);var sM='<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>',sP='<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>',sO='<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 sN,sU,sL=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,sN);return t}d(e,[{key:"render",value:function t(){return ol(th())}},{key:"process",value:function t(){if(!this.closest("qti-assessment-item"))return;var t=N(this.children);var e=true,n=false,i=undefined;try{for(var o=t[Symbol.iterator](),a;!(e=(a=o.next()).done);e=true){var s=a.value;s.process()}}catch(t){n=true;i=t}finally{try{if(!e&&o.return!=null){o.return()}}finally{if(n){throw i}}}}},{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(rQ(this,sN,sU).call(this,sP).firstElementChild.firstElementChild);break}case"map_response_point":{this.appendChild(rQ(this,sN,sU).call(this,sO).firstElementChild.firstElementChild);break}case"match_correct":this.appendChild(rQ(this,sN,sU).call(this,sM).firstElementChild.firstElementChild);break}}}}]);return e}(oR);sN=new WeakSet,sU=function t(t){return document.createRange().createContextualFragment(t)},sL.styles=[iM(tf())],sL=rj([oT("qti-response-processing")],sL);var sD,sV,s$,sW,sj,sF=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,sV);t.identifier="";t.cardinality="single";t.baseType="string";t.mathVariable=!1;t.paramVariable=!1;rB(t,sD,null);return t}d(e,[{key:"render",value:function t(){return ol(tp())}},{key:"connectedCallback",value:function t(){var t=this;f(p(e.prototype),"connectedCallback",this).call(this),this.updateComplete.then(function(){rQ(t,sV,s$).call(t),rQ(t,sV,sj).call(t)})}},{key:"getTemplateVariable",value:function t(){return{identifier:this.identifier,cardinality:this.cardinality,baseType:this.baseType,value:rz(this,sD),type:"template",mathVariable:this.mathVariable,paramVariable:this.paramVariable}}}]);return e}(oR);sD=new WeakMap,sV=new WeakSet,s$=function t(){var t;var e=this.querySelector("qti-default-value");if(!e)return;var n=((t=e.textContent)===null||t===void 0?void 0:t.trim())||"";rH(this,sD,rQ(this,sV,sW).call(this,n))},sW=function t(t){if(!t)return null;switch(this.baseType){case"integer":return parseInt(t,10);case"float":case"duration":return parseFloat(t);case"boolean":return t.toLowerCase()==="true";default:return t}},sj=function t(){var t;var e=_(k({},{identifier:this.identifier,cardinality:this.cardinality,baseType:this.baseType,defaultValue:rz(this,sD),value:rz(this,sD),type:"template",mathVariable:this.mathVariable,paramVariable:this.paramVariable}),{value:((t=rz(this,sD))===null||t===void 0?void 0:t.toString())||""});this.dispatchEvent(new CustomEvent("qti-register-variable",{bubbles:!0,composed:!0,detail:{variable:e}}))},sF.styles=[iM(tv())],rj([o({type:String})],sF.prototype,"identifier",2),rj([o({type:String})],sF.prototype,"cardinality",2),rj([o({type:String,attribute:"base-type"})],sF.prototype,"baseType",2),rj([o({type:Boolean,attribute:"math-variable"})],sF.prototype,"mathVariable",2),rj([o({type:Boolean,attribute:"param-variable"})],sF.prototype,"paramVariable",2),sF=rj([oT("qti-template-declaration")],sF);var sz,sB=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,sz,100);return t}d(e,[{key:"render",value:function t(){return ol(tm())}},{key:"process",value:function t(){if(!this.closest("qti-assessment-item")){console.warn("qti-template-processing must be inside qti-assessment-item");return}var t=0,e=!1;do{if(e=!1,t++,t>rz(this,sz)){console.error("Template processing exceeded maximum iterations. Possible infinite loop.");break}try{var n=N(this.children);var i=true,o=false,a=undefined;try{for(var s=n[Symbol.iterator](),l;!(i=(l=s.next()).done);i=true){var u=l.value;if(u.tagName.toLowerCase()==="qti-template-constraint"){if(u.calculate()===!1){e=!0;break}}else u.process()}}catch(t){o=true;a=t}finally{try{if(!i&&s.return!=null){s.return()}}finally{if(o){throw a}}}}catch(t){console.error("Error during template processing:",t);break}}while(e);this.dispatchEvent(new CustomEvent("qti-template-processing-complete",{bubbles:!0,composed:!0,detail:{iterations:t}}))}},{key:"firstUpdated",value:function t(t){this.getAttribute("template")&&console.info("Template processing with external template not yet implemented")}}]);return e}(oR);sz=new WeakMap,sB.styles=[iM(tg())],sB=rj([oT("qti-template-processing")],sB);var sH=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){return ol(ty())}},{key:"calculate",value:function t(){var t=N(this.children);if(t.length!==1)return console.error("qti-template-constraint must have exactly one child expression"),!0;try{return!!t[0].calculate()}catch(t){return console.error("Error evaluating template constraint:",t),!0}}},{key:"getSubRules",value:function t(){return[]}},{key:"process",value:function t(){var t=this.calculate();return t||console.debug("Template constraint not satisfied, restarting template processing"),t}}]);return e}(oR);sH=rj([oT("qti-template-constraint")],sH);var sQ=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.identifier="";t.cardinality="record";return t}d(e,[{key:"render",value:function t(){return ol(tb())}}]);return e}(oR);sQ.styles=[iM(tw())],rj([o({type:String})],sQ.prototype,"identifier",2),rj([o({type:String})],sQ.prototype,"cardinality",2),sQ=rj([oT("qti-context-declaration")],sQ);var sX=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){return ol(tq())}}]);return e}(sp);sX.styles=iM(tk()),sX=rj([oT("qti-test-feedback")],sX);var sG,sJ,sY,sK,sZ,s0,s1,s2,s3,s5,s4=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e);rB(t,sJ);t.identifier=void 0;t.initContext=[];t.qtiContext={QTI_CONTEXT:{testIdentifier:"",candidateIdentifier:"",environmentIdentifier:"default"}};t.configContext={};t.autoScoreItems=!1;rB(t,sG);t.addEventListener("qti-assessment-test-connected",rQ(t,sJ,s2).bind(t)),t.addEventListener("qti-assessment-item-connected",rQ(t,sJ,s5).bind(t)),t.addEventListener("qti-interaction-changed",rQ(t,sJ,s1).bind(t)),t.addEventListener("test-end-attempt",rQ(t,sJ,sY).bind(t)),t.addEventListener("test-show-correct-response",rQ(t,sJ,sK).bind(t)),t.addEventListener("test-show-candidate-correction",rQ(t,sJ,sZ).bind(t)),t.addEventListener("test-update-outcome-variable",rQ(t,sJ,s0).bind(t));return t}d(e,[{key:"render",value:function t(){return ol(tx())}},{key:"willUpdate",value:function t(t){var e=this;var n;if(!this.computedContext)return;var i=1;this.computedContext=_(k({},this.computedContext),{view:(n=this._sessionContext)===null||n===void 0?void 0:n.view,testParts:this.computedContext.testParts.map(function(t){var n;return _(k({},t),{active:((n=e._sessionContext)===null||n===void 0?void 0:n.navPartId)===t.identifier||!1,sections:t.sections.map(function(t){var n;return _(k({},t),{active:((n=e._sessionContext)===null||n===void 0?void 0:n.navSectionId)===t.identifier||!1,completed:t.items.every(function(t){var n;return((n=e._testContext.items.find(function(e){return e.identifier===t.identifier}))===null||n===void 0?void 0:n.variables.find(function(t){return t.identifier==="completionStatus"}).value)==="completed"}),items:t.items.map(function(t){var n,o,a,s,l,u,c,d,h,f,p,v,m,g;var y=(n=e._testContext)===null||n===void 0?void 0:n.items.find(function(e){return e.identifier===t.identifier}),b=k({},t,y,(o=e.initContext)===null||o===void 0?void 0:o.find(function(e){return e.identifier===t.identifier})),w=(s=b.variables)===null||s===void 0?void 0:(a=s.find(function(t){return t.identifier=="SCORE"}))===null||a===void 0?void 0:a.value,q=w==null?null:parseFloat(w===null||w===void 0?void 0:w.toString()),x=(u=b.variables)===null||u===void 0?void 0:(l=u.find(function(t){return t.identifier==="completionStatus"}))===null||l===void 0?void 0:l.value,E=((d=b.variables)===null||d===void 0?void 0:(c=d.find(function(t){return t.identifier==="RESPONSE"}))===null||c===void 0?void 0:c.value)||"",C=((f=b.variables)===null||f===void 0?void 0:(h=f.find(function(t){return t.identifier==="numAttempts"}))===null||h===void 0?void 0:h.value)||0,S=((p=e._sessionContext)===null||p===void 0?void 0:p.navItemRefId)===b.identifier||!1,A=t.categories.includes((v=e.configContext)===null||v===void 0?void 0:v.infoItemCategory)?null:i++,R=(g=t.variables)===null||g===void 0?void 0:(m=g.find(function(t){return t.identifier=="MAXSCORE"}))===null||m===void 0?void 0:m.value,I=R==null?null:parseFloat(R===null||R===void 0?void 0:R.toString());return _(k({},b),{completionStatus:x,numAttempts:C,score:q,response:E,index:A,active:S,maxScore:I})})})})})})}),this.dispatchEvent(new CustomEvent("qti-computed-context-updated",{detail:this.computedContext,bubbles:!0}))}}]);return e}(oR);sG=new WeakMap,sJ=new WeakSet,sY=function t(t){var e;var n=rz(this,sG).querySelector('qti-assessment-item-ref[identifier="'.concat(this._sessionContext.navItemRefId,'"]')).assessmentItem,i=((e=this.configContext)===null||e===void 0?void 0:e.reportValidityAfterScoring)===!0;n.processResponse(!0,i)},sK=function t(t){var e=rz(this,sG).querySelector('qti-assessment-item-ref[identifier="'.concat(this._sessionContext.navItemRefId,'"]')).assessmentItem;e&&e.showCorrectResponse(t.detail)},sZ=function t(t){rz(this,sG).querySelector('qti-assessment-item-ref[identifier="'.concat(this._sessionContext.navItemRefId,'"]')).assessmentItem.showCandidateCorrection(t.detail)},s0=function t(t){rz(this,sG).querySelector('qti-assessment-item-ref[identifier="'.concat(t.detail.assessmentItemRefId,'"]')).assessmentItem.setOutcomeVariable(t.detail.outcomeVariableId,t.detail.value)},s1=function t(t){if(this.autoScoreItems){var e=t.composedPath()[0].closest("qti-assessment-item"),n=e.variables.find(function(t){return t.identifier==="SCORE"});if(n&&n.externalScored===null&&e.adaptive==="false"){var i;var o=((i=this.configContext)===null||i===void 0?void 0:i.reportValidityAfterScoring)===!0;e.processResponse(!0,o)}}},s2=function t(t){var e=this;var n,i,o;if(rH(this,sG,t.detail),!((n=this.qtiContext.QTI_CONTEXT)===null||n===void 0?void 0:n.testIdentifier)){var a=this.qtiContext.QTI_CONTEXT||{testIdentifier:"",candidateIdentifier:"not set",environmentIdentifier:"default"};this.qtiContext={QTI_CONTEXT:_(k({},a),{testIdentifier:rz(this,sG).identifier,environmentIdentifier:a.environmentIdentifier||"default"})}}rz(this,sG).querySelectorAll('qti-context-declaration[identifier="QTI_CONTEXT"]').forEach(function(t){var n=rQ(e,sJ,s3).call(e,t);Object.keys(n).length>0&&(e.qtiContext={QTI_CONTEXT:k({},n,e.qtiContext.QTI_CONTEXT)})});var s=Array.from(((i=rz(this,sG))===null||i===void 0?void 0:i.querySelectorAll("qti-test-part"))||[]);this.computedContext={identifier:rz(this,sG).identifier,title:rz(this,sG).title,view:(o=this._sessionContext)===null||o===void 0?void 0:o.view,testParts:s.map(function(t){var n=N(t.querySelectorAll("qti-assessment-section"));return{active:!1,identifier:t.identifier,navigationMode:t.navigationMode,submissionMode:t.submissionMode,sections:n.map(function(t){var n=N(t.querySelectorAll("qti-assessment-item-ref"));return{active:!1,identifier:t.identifier,title:t.title,items:n.map(function(t){var n,i;return _(k({},(n=e.initContext)===null||n===void 0?void 0:n.find(function(e){return e.identifier===t.identifier})),{active:!1,identifier:t.identifier,categories:t.category?(i=t.category)===null||i===void 0?void 0:i.split(" "):[],href:t.href,variables:[]})})}})}})}},s3=function t(t){var e={},n=t.querySelector("qti-default-value");return n&&n.querySelectorAll("qti-value[field-identifier]").forEach(function(t){var n;var i=t.getAttribute("field-identifier"),o=t.getAttribute("base-type")||"string",a=((n=t.textContent)===null||n===void 0?void 0:n.trim())||"";if(i){var s=a;switch(o){case"integer":s=parseInt(a,10);break;case"float":case"duration":s=parseFloat(a);break;case"boolean":s=a.toLowerCase()==="true";break;default:s=a;break}e[i]=s}}),e},s5=function t(t){var e=t.detail;this.computedContext=_(k({},this.computedContext),{testParts:this.computedContext.testParts.map(function(t){return _(k({},t),{sections:t.sections.map(function(t){return _(k({},t),{items:t.items.map(function(t){var n;if(t.identifier!==e.parentElement.getAttribute("identifier"))return t;var i=(n=e.querySelector("qti-outcome-declaration[identifier='SCORE']"))===null||n===void 0?void 0:n.getAttribute("externalScored"),o=e.querySelectorAll("qti-response-declaration"),a=Array.from(o).some(function(t){return t.querySelector("qti-correct-response")}),s=Array.from(o).some(function(t){var e=t.querySelector("qti-mapping"),n=t.querySelector("qti-area-mapping");return(e===null||e===void 0?void 0:e.querySelector("qti-map-entry"))||(n===null||n===void 0?void 0:n.querySelector("qti-area-map-entry"))}),l=a||s,u=!!e.querySelector("qti-response-processing");return _(k({},t),{assessmentItemIdentifier:e.getAttribute("identifier"),label:e.getAttribute("label"),title:e.title,externalScored:i,adaptive:e.adaptive=="true"||!1,timeDependent:e.timeDependent=="true"||!1,variables:e.variables,hasCorrectResponse:l,hasResponseProcessing:u})})})})})})})},rj([o({type:String})],s4.prototype,"identifier",2),rj([u()],s4.prototype,"initContext",2),rj([u(),t({context:oF})],s4.prototype,"qtiContext",2),rj([u(),e({context:oL,subscribe:!0})],s4.prototype,"configContext",2),rj([u(),e({context:oQ,subscribe:!0})],s4.prototype,"_testContext",2),rj([u(),e({context:oB,subscribe:!0})],s4.prototype,"_sessionContext",2),rj([u(),t({context:oU})],s4.prototype,"computedContext",2),rj([o({type:Boolean,attribute:"auto-score-items"})],s4.prototype,"autoScoreItems",2),s4=rj([oT("test-navigation")],s4);var s6=iM(t_()),s8=iM(tE(),s6),s7=iM(tC()),s9=iM(tS(),s6);var lt,le=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e);t._internalDisabled=!0;rB(t,lt);rH(t,lt,t.attachInternals()),rz(t,lt).role="button",rz(t,lt).ariaLabel="Next item",t.addEventListener("click",function(e){e.preventDefault(),t._internalDisabled||t._requestItem(t.sectionItems[t.itemIndex+1].identifier)});return t}d(e,[{key:"_handleTestElementChange",value:function t(t,e){e&&(this._internalDisabled=!1)}},{key:"connectedCallback",value:function t(){f(p(e.prototype),"connectedCallback",this).call(this),this.checkDisabled()}},{key:"willUpdate",value:function t(t){var e;if(!this.computedContext)return;var n=(e=this.computedContext)===null||e===void 0?void 0:e.testParts.find(function(t){return t.active});n&&(this.sectionItems=n.sections.flatMap(function(t){return t.items}),this.itemIndex=this.sectionItems.findIndex(function(t){return t.active}),this.checkDisabled())}},{key:"checkDisabled",value:function t(){var t;this._internalDisabled=!this.computedContext||this.itemIndex<0||this.itemIndex>=((t=this.sectionItems)===null||t===void 0?void 0:t.length)-1}},{key:"_requestItem",value:function t(t){this.dispatchEvent(new CustomEvent("qti-request-navigation",{composed:!0,bubbles:!0,detail:{type:"item",id:t}}))}},{key:"render",value:function t(){return ol(tA())}}]);return e}(oR);lt=new WeakMap,le.styles=iM(tR(),s8,s7),rj([o({type:Boolean,reflect:!0,attribute:"disabled"})],le.prototype,"_internalDisabled",2),rj([e({context:oU,subscribe:!0})],le.prototype,"computedContext",2),rj([y("computedContext")],le.prototype,"_handleTestElementChange",1),le=rj([oT("test-next")],le);var ln=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e);t._internalDisabled=!0;t.addEventListener("click",function(e){e.preventDefault(),t._internalDisabled||t._requestItem(t.sectionItems[t.itemIndex-1].identifier)});return t}d(e,[{key:"_handleTestElementChange",value:function t(t,e){e&&(this._internalDisabled=!1)}},{key:"willUpdate",value:function t(t){var e;if(!this.computedContext)return;var n=(e=this.computedContext)===null||e===void 0?void 0:e.testParts.find(function(t){return t.active});n&&(this.sectionItems=n.sections.flatMap(function(t){return t.items}),this.itemIndex=this.sectionItems.findIndex(function(t){return t.active}),this.checkDisabled())}},{key:"checkDisabled",value:function t(){this._internalDisabled=!this.computedContext||this.itemIndex===0||this.itemIndex===-1}},{key:"_requestItem",value:function t(t){this.dispatchEvent(new CustomEvent("qti-request-navigation",{composed:!0,bubbles:!0,detail:{type:"item",id:t}}))}},{key:"render",value:function t(){return ol(tI())}}]);return e}(oR);ln.styles=iM(tT(),s8,s7),rj([o({type:Boolean,reflect:!0,attribute:"disabled"})],ln.prototype,"_internalDisabled",2),rj([e({context:oU,subscribe:!0})],ln.prototype,"computedContext",2),rj([y("computedContext")],ln.prototype,"_handleTestElementChange",1),ln=rj([oT("test-prev")],ln);var lr,li,lo=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,lr);t.label="view";t._handleViewOptionsChange=function(){rQ(t,lr,li).call(t)};t._viewOptions=lo.DEFAULT_VIEW_OPTIONS;return t}d(e,[{key:"connectedCallback",value:function t(){f(p(e.prototype),"connectedCallback",this).call(this),rQ(this,lr,li).call(this)}},{key:"_switchView",value:function t(t){this.dispatchEvent(new CustomEvent("on-test-switch-view",{composed:!0,bubbles:!0,detail:t}))}},{key:"render",value:function t(){var t=this;return ol(tP(),this.label,function(e){var n=e.target;t._switchView(n.value)},this._viewOptions.map(function(e){return ol(tM(),e,e===t.sessionContext.view,e)}))}}]);return e}(oR);lr=new WeakSet,li=function t(){if(this.viewOptions){var t=this.viewOptions.split(",").map(function(t){return t.trim()});this._viewOptions=t.filter(function(t){return lo.DEFAULT_VIEW_OPTIONS.includes(t)})}else this._viewOptions=lo.DEFAULT_VIEW_OPTIONS},lo.DEFAULT_VIEW_OPTIONS=["author","candidate","proctor","scorer","testConstructor","tutor"],rj([e({context:oB,subscribe:!0})],lo.prototype,"sessionContext",2),rj([o({type:String})],lo.prototype,"label",2),rj([o({type:String,attribute:"view-options"})],lo.prototype,"viewOptions",2),rj([y("viewOptions",{waitUntilFirstUpdate:!0})],lo.prototype,"_handleViewOptionsChange",2),rj([u()],lo.prototype,"_viewOptions",2),lo=rj([oT("test-view")],lo);var la=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e);t.itemId=null;t.addEventListener("click",function(){return t._requestItem(t.itemId)});return t}d(e,[{key:"_requestItem",value:function t(t){this.dispatchEvent(new CustomEvent("qti-request-navigation",{composed:!0,bubbles:!0,detail:{type:"item",id:t}}))}},{key:"render",value:function t(){return ol(tO())}}]);return e}(oR);la.styles=iM(tN(),s8,s7),rj([o({type:String,attribute:"item-id"})],la.prototype,"itemId",2),la=rj([oT("test-item-link")],la);var ls=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e),t.addEventListener("click",function(){return t.dispatchEvent(new CustomEvent("test-end-attempt",{bubbles:!0}))});return t}d(e,[{key:"render",value:function t(){return ol(tU())}}]);return e}(oR);ls.styles=iM(tL(),s8,s7),ls=rj([oT("test-end-attempt")],ls);var ll,lu,lc,ld,lh=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,lu);t.shown=!1;t.disabled=!1;t.showCorrectText="Show correct response";t.hideCorrectText="Hide correct response";t.noCorrectResponseText="No correct response specified";rB(t,ll);return t}d(e,[{key:"willUpdate",value:function t(t){var e;var n=(e=this.computedContext)===null||e===void 0?void 0:e.testParts.flatMap(function(t){return t.sections.flatMap(function(t){return t.items})}).find(function(t){return t.active});if(rz(this,ll)!==n&&(this.shown=!1,rH(this,ll,n)),n){var i,o;var a=!!(n===null||n===void 0?void 0:(i=n.variables)===null||i===void 0?void 0:i.some(function(t){return t.correctResponse})),s=!!(n===null||n===void 0?void 0:(o=n.variables)===null||o===void 0?void 0:o.some(function(t){var e,n,i,o;return((n=t.mapping)===null||n===void 0?void 0:(e=n.mapEntries)===null||e===void 0?void 0:e.length)>0||((o=t.areaMapping)===null||o===void 0?void 0:(i=o.areaMapEntries)===null||i===void 0?void 0:i.length)>0}));this.disabled=!a&&!s}else this.disabled=!0}},{key:"render",value:function t(){return ol(tD(),rQ(this,lu,lc),rQ(this,lu,ld).call(this))}}]);return e}(oR);ll=new WeakMap,lu=new WeakSet,lc=function t(){this.disabled||(this.shown=!this.shown,this.dispatchEvent(new CustomEvent("test-show-correct-response",{detail:this.shown,bubbles:!0})))},ld=function t(){return this.disabled?this.noCorrectResponseText:this.shown?this.hideCorrectText:this.showCorrectText},lh.styles=iM(tV(),s8,s7),rj([e({context:oU,subscribe:!0})],lh.prototype,"computedContext",2),rj([o({type:Boolean,reflect:!0})],lh.prototype,"shown",2),rj([o({type:Boolean,reflect:!0})],lh.prototype,"disabled",2),rj([o({type:String})],lh.prototype,"showCorrectText",2),rj([o({type:String})],lh.prototype,"hideCorrectText",2),rj([o({type:String})],lh.prototype,"noCorrectResponseText",2),lh=rj([oT("test-show-correct-response")],lh);var lf=globalThis,lp=lf.trustedTypes,lv=lp?lp.createPolicy("lit-html",{createHTML:function t(t){return t}}):void 0,lm="$lit$",lg="lit$".concat(Math.random().toFixed(9).slice(2),"$"),ly="?"+lg,lb="<".concat(ly,">"),lw=lf.document===void 0?{createTreeWalker:function t(){return{}}}:document,lq=function t(){return lw.createComment("")},lk=function t(t){return t===null||(typeof t==="undefined"?"undefined":U(t))!="object"&&typeof t!="function"},lx=Array.isArray,l_=function t(t){return lx(t)||typeof(t===null||t===void 0?void 0:t[Symbol.iterator])=="function"},lE="[ \n\f\r]",lC=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,lS=/-->/g,lA=/>/g,lR=RegExp(">|".concat(lE,"(?:([^\\s\"'>=/]+)(").concat(lE,"*=").concat(lE,"*(?:[^ \n\f\r\"'`<>=]|(\"|')|))|$)"),"g"),lI=/'/g,lT=/"/g,lM=/^(?:script|style|textarea|title)$/i,lP=function t(t){return function(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++){i[o-1]=arguments[o]}return{_$litType$:t,strings:e,values:i}}},lO=lP(1),lN=lP(2),lU=lP(3),lL=Symbol.for("lit-noChange"),lD=Symbol.for("lit-nothing"),lV=new WeakMap,l$=lw.createTreeWalker(lw,129);var lW=function t(t,e){var n=t.length-1,i=[],o,a=e===2?"<svg>":e===3?"<math>":"",s=lC;for(var l=0;l<n;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===lC?d[1]==="!--"?s=lS:d[1]!==void 0?s=lA:d[2]!==void 0?(lM.test(d[2])&&(o=RegExp("</"+d[2],"g")),s=lR):d[3]!==void 0&&(s=lR):s===lR?d[0]===">"?(s=o!==null&&o!==void 0?o:lC,h=-1):d[1]===void 0?h=-2:(h=s.lastIndex-d[2].length,c=d[1],s=d[3]===void 0?lR:d[3]==='"'?lT:lI):s===lT||s===lI?s=lR:s===lS||s===lA?s=lC:(s=lR,o=void 0);var p=s===lR&&t[l+1].startsWith("/>")?" ":"";a+=s===lC?u+lb:h>=0?(i.push(c),u.slice(0,h)+lm+u.slice(h)+lg+p):u+lg+(h===-2?l:p)}return[n1(t,a+(t[n]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]},lj=/*#__PURE__*/function(){"use strict";function t(e,n){var i=e.strings,o=e._$litType$;l(this,t);var a;this.parts=[];var s=0,u=0,c=i.length-1,d=this.parts,h=T(lW(i,o),2),f=h[0],p=h[1];if(this.el=t.createElement(f,n),l$.currentNode=this.el.content,o===2||o===3){var v;var m=this.el.content.firstChild;(v=m).replaceWith.apply(v,N(m.childNodes))}for(;(a=l$.nextNode())!==null&&d.length<c;){if(a.nodeType===1){var g=true,y=false,b=undefined;if(a.hasAttributes())try{for(var w=a.getAttributeNames()[Symbol.iterator](),q;!(g=(q=w.next()).done);g=true){var k=q.value;if(k.endsWith(lm)){var x=p[u++],_=a.getAttribute(k).split(lg),E=/([.?@])?(.*)/.exec(x);d.push({type:1,index:s,name:E[2],strings:_,ctor:E[1]==="."?lQ:E[1]==="?"?lX:E[1]==="@"?lG:lH}),a.removeAttribute(k)}else k.startsWith(lg)&&(d.push({type:6,index:s}),a.removeAttribute(k))}}catch(t){y=true;b=t}finally{try{if(!g&&w.return!=null){w.return()}}finally{if(y){throw b}}}if(lM.test(a.tagName)){var C=a.textContent.split(lg),S=C.length-1;if(S>0){a.textContent=lp?lp.emptyScript:"";for(var A=0;A<S;A++)a.append(C[A],lq()),l$.nextNode(),d.push({type:2,index:++s});a.append(C[S],lq())}}}else if(a.nodeType===8)if(a.data===ly)d.push({type:2,index:s});else{var R=-1;for(;(R=a.data.indexOf(lg,R+1))!==-1;)d.push({type:7,index:s}),R+=lg.length-1}s++}}d(t,null,[{key:"createElement",value:function t(t,e){var n=lw.createElement("template");return n.innerHTML=t,n}}]);return t}();function lF(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t,i=arguments.length>3?arguments[3]:void 0;var o;var a,s;if(e===lL)return e;var l=i!==void 0?(a=n._$Co)===null||a===void 0?void 0:a[i]:n._$Cl,u=lk(e)?void 0:e._$litDirective$;return(l===null||l===void 0?void 0:l.constructor)!==u&&(l===null||l===void 0?void 0:(s=l._$AO)===null||s===void 0?void 0:s.call(l,!1),u===void 0?l=void 0:(l=new u(t),l._$AT(t,n,i)),i!==void 0?((o=n._$Co)!==null&&o!==void 0?o:n._$Co=[])[i]=l:n._$Cl=l),l!==void 0&&(e=lF(t,l._$AS(t,e.values),l,i)),e}var lz=/*#__PURE__*/function(){"use strict";function t(e,n){l(this,t);this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=n}d(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,i=n.el,o=i.content,a=n.parts,s=((e=t===null||t===void 0?void 0:t.creationScope)!==null&&e!==void 0?e:lw).importNode(o,!0);l$.currentNode=s;var l=l$.nextNode(),u=0,c=0,d=a[0];for(;d!==void 0;){if(u===d.index){var h=void 0;d.type===2?h=new lB(l,l.nextSibling,this,t):d.type===1?h=new d.ctor(l,d.name,d.strings,this,t):d.type===6&&(h=new lJ(l,this,t)),this._$AV.push(h),d=a[++c]}u!==(d===null||d===void 0?void 0:d.index)&&(l=l$.nextNode(),u++)}return l$.currentNode=lw,s}},{key:"p",value:function t(t){var e=0;var n=true,i=false,o=undefined;try{for(var a=this._$AV[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;l!==void 0&&(l.strings!==void 0?(l._$AI(t,l,e),e+=l.strings.length-2):l._$AI(t[e])),e++}}catch(t){i=true;o=t}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(i){throw o}}}}}]);return t}(),lB=/*#__PURE__*/function(){"use strict";function t(e,n,i,o){l(this,t);var a;this.type=2,this._$AH=lD,this._$AN=void 0,this._$AA=e,this._$AB=n,this._$AM=i,this.options=o,this._$Cv=(a=o===null||o===void 0?void 0:o.isConnected)!==null&&a!==void 0?a:!0}d(t,[{key:"_$AU",get:function t(){var t;var e;return(t=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&t!==void 0?t: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=lF(this,t,e),lk(t)?t===lD||t==null||t===""?(this._$AH!==lD&&this._$AR(),this._$AH=lD):t!==this._$AH&&t!==lL&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):l_(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!==lD&&lk(this._$AH)?this._$AA.nextSibling.data=t:this.T(lw.createTextNode(t)),this._$AH=t}},{key:"$",value:function t(t){var e;var n=t.values,i=t._$litType$,o=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=lj.createElement(n1(i.h,i.h[0]),this.options)),i);if(((e=this._$AH)===null||e===void 0?void 0:e._$AD)===o)this._$AH.p(n);else{var a=new lz(o,this),s=a.u(this.options);a.p(n),this.T(s),this._$AH=a}}},{key:"_$AC",value:function t(t){var e=lV.get(t.strings);return e===void 0&&lV.set(t.strings,e=new lj(t)),e}},{key:"k",value:function e(e){lx(this._$AH)||(this._$AH=[],this._$AR());var n=this._$AH,i,o=0;var a=true,s=false,l=undefined;try{for(var u=e[Symbol.iterator](),c;!(a=(c=u.next()).done);a=true){var d=c.value;o===n.length?n.push(i=new t(this.O(lq()),this.O(lq()),this,this.options)):i=n[o],i._$AI(d),o++}}catch(t){s=true;l=t}finally{try{if(!a&&u.return!=null){u.return()}}finally{if(s){throw l}}}o<n.length&&(this._$AR(i&&i._$AB.nextSibling,o),n.length=o)}},{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,i;for((n=(i=this)._$AP)===null||n===void 0?void 0:n.call(i,!1,!0,e);t!==this._$AB;){var o=t.nextSibling;t.remove(),t=o}}},{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}(),lH=/*#__PURE__*/function(){"use strict";function t(e,n,i,o,a){l(this,t);this.type=1,this._$AH=lD,this._$AN=void 0,this.element=e,this.name=n,this._$AM=o,this.options=a,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=lD}d(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,i=arguments.length>3?arguments[3]:void 0;var o=this.strings,a=!1;if(o===void 0)t=lF(this,t,e,0),a=!lk(t)||t!==this._$AH&&t!==lL,a&&(this._$AH=t);else{var s=t,l,u;for(t=o[0],l=0;l<o.length-1;l++)u=lF(this,s[n+l],e,l),u===lL&&(u=this._$AH[l]),a||(a=!lk(u)||u!==this._$AH[l]),u===lD?t=lD:t!==lD&&(t+=(u!==null&&u!==void 0?u:"")+o[l+1]),this._$AH[l]=u}a&&!i&&this.j(t)}},{key:"j",value:function t(t){t===lD?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t!==null&&t!==void 0?t:"")}}]);return t}(),lQ=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments),t.type=3;return t}d(e,[{key:"j",value:function t(t){this.element[this.name]=t===lD?void 0:t}}]);return e}(lH),lX=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments),t.type=4;return t}d(e,[{key:"j",value:function t(t){this.element.toggleAttribute(this.name,!!t&&t!==lD)}}]);return e}(lH),lG=/*#__PURE__*/function(t){"use strict";v(e,t);function e(t,n,i,o,a){l(this,e);var u;u=s(this,e,[t,n,i,o,a]),u.type=5;return u}d(e,[{key:"_$AI",value:function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this;var n;if((t=(n=lF(this,t,e,0))!==null&&n!==void 0?n:lD)===lL)return;var i=this._$AH,o=t===lD&&i!==lD||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,a=t!==lD&&(i===lD||o);o&&this.element.removeEventListener(this.name,this,i),a&&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((e=(n=this.options)===null||n===void 0?void 0:n.host)!==null&&e!==void 0?e:this.element,t):this._$AH.handleEvent(t)}}]);return e}(lH),lJ=/*#__PURE__*/function(){"use strict";function t(e,n,i){l(this,t);this.element=e,this.type=6,this._$AN=void 0,this._$AM=n,this.options=i}d(t,[{key:"_$AU",get:function t(){return this._$AM._$AU}},{key:"_$AI",value:function t(t){lF(this,t)}}]);return t}(),lY={M:lm,P:lg,A:ly,C:1,L:lW,R:lz,D:l_,V:lF,I:lB,H:lH,N:lX,U:lG,B:lQ,F:lJ},lK=lf.litHtmlPolyfillSupport;lK===null||lK===void 0?void 0:lK(lj,lB),((rM=lf.litHtmlVersions)!==null&&rM!==void 0?rM:lf.litHtmlVersions=[]).push("3.3.1");var lZ=["this"],l0=["+","-","!"],l1=["=","+","-","*","/","%","^","==","!=",">","<",">=","<=","||","&&","??","&","===","!==","|","|>"],l2={"!":0,":":0,",":0,")":0,"]":0,"}":0,"|>":1,"?":2,"??":3,"||":4,"&&":5,"|":6,"^":7,"&":8,"!=":9,"==":9,"!==":9,"===":9,">=":10,">":10,"<=":10,"<":10,"+":11,"-":11,"%":12,"/":12,"*":12,"(":13,"[":13,".":13,"{":13},l3=13;var l5=["==","!=","<=",">=","||","&&","??","|>"],l4=["===","!=="],l6;(function(t){t[t.STRING=1]="STRING",t[t.IDENTIFIER=2]="IDENTIFIER",t[t.DOT=3]="DOT",t[t.COMMA=4]="COMMA",t[t.COLON=5]="COLON",t[t.INTEGER=6]="INTEGER",t[t.DECIMAL=7]="DECIMAL",t[t.OPERATOR=8]="OPERATOR",t[t.GROUPER=9]="GROUPER",t[t.KEYWORD=10]="KEYWORD",t[t.ARROW=11]="ARROW"})(l6||(l6={}));var l8=function t(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return{kind:t,value:e,precedence:n}},l7=function t(t){return t===9||t===10||t===13||t===32},l9=function t(t){return t===95||t===36||(t&=-33,65<=t&&t<=90)},ut=function t(t){return l9(t)||ur(t)},ue=function t(t){return lZ.indexOf(t)!==-1},un=function t(t){return t===34||t===39},ur=function t(t){return 48<=t&&t<=57},ui=function t(t){return t===43||t===45||t===42||t===47||t===33||t===38||t===37||t===60||t===61||t===62||t===63||t===94||t===124},uo=function t(t){return t===40||t===41||t===91||t===93||t===123||t===125},ua=function t(t){return t.replace(/\\(.)/g,function(t,e){switch(e){case"n":return"\n";case"r":return"\r";case"t":return" ";case"b":return"\b";case"f":return"\f";default:return e}})},us,ul,uu,uc,ud,uh,uf,up,uv,um,ug,uy,ub,uw,uq,uk,ux,u_=/*#__PURE__*/function(){"use strict";function t(e){l(this,t);rB(this,ud);rB(this,us);rB(this,ul,-1);rB(this,uu,0);rB(this,uc);rH(this,us,e),rQ(this,ud,uh).call(this)}d(t,[{key:"nextToken",value:function t(){for(;l7(rz(this,uc));)rQ(this,ud,uh).call(this,!0);if(un(rz(this,uc)))return rQ(this,ud,uv).call(this);if(l9(rz(this,uc)))return rQ(this,ud,um).call(this);if(ur(rz(this,uc)))return rQ(this,ud,ug).call(this);if(rz(this,uc)===46)return rQ(this,ud,uy).call(this);if(rz(this,uc)===44)return rQ(this,ud,ub).call(this);if(rz(this,uc)===58)return rQ(this,ud,uw).call(this);if(ui(rz(this,uc)))return rQ(this,ud,uk).call(this);if(uo(rz(this,uc)))return rQ(this,ud,ux).call(this);if(rQ(this,ud,uh).call(this),rz(this,uc)!==void 0)throw new Error("Expected end of input, got ".concat(rz(this,uc)))}}]);return t}();us=new WeakMap,ul=new WeakMap,uu=new WeakMap,uc=new WeakMap,ud=new WeakSet,uh=function t(t){rX(this,ul)._++,rz(this,ul)<rz(this,us).length?(rH(this,uc,rz(this,us).charCodeAt(rz(this,ul))),t===!0&&rH(this,uu,rz(this,ul))):rH(this,uc,void 0)},uf=function t(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;var e=rz(this,us).substring(rz(this,uu),rz(this,ul)+t);return t===0&&rQ(this,ud,up).call(this),e},up=function t(){rH(this,uu,rz(this,ul))},uv=function t(){var t="unterminated string",e=rz(this,uc);for(rQ(this,ud,uh).call(this,!0);rz(this,uc)!==e;){if(rz(this,uc)===void 0)throw new Error(t);if(rz(this,uc)===92&&(rQ(this,ud,uh).call(this),rz(this,uc)===void 0))throw new Error(t);rQ(this,ud,uh).call(this)}var n=l8(l6.STRING,ua(rQ(this,ud,uf).call(this)));return rQ(this,ud,uh).call(this),n},um=function t(){do rQ(this,ud,uh).call(this);while(ut(rz(this,uc)));var t=rQ(this,ud,uf).call(this),e=ue(t)?l6.KEYWORD:l6.IDENTIFIER;return l8(e,t)},ug=function t(){do rQ(this,ud,uh).call(this);while(ur(rz(this,uc)));return rz(this,uc)===46?rQ(this,ud,uy).call(this):l8(l6.INTEGER,rQ(this,ud,uf).call(this))},uy=function t(){return rQ(this,ud,uh).call(this),ur(rz(this,uc))?rQ(this,ud,uq).call(this):(rQ(this,ud,up).call(this),l8(l6.DOT,".",l3))},ub=function t(){return rQ(this,ud,uh).call(this,!0),l8(l6.COMMA,",")},uw=function t(){return rQ(this,ud,uh).call(this,!0),l8(l6.COLON,":")},uq=function t(){do rQ(this,ud,uh).call(this);while(ur(rz(this,uc)));return l8(l6.DECIMAL,rQ(this,ud,uf).call(this))},uk=function t(){rQ(this,ud,uh).call(this);var t=rQ(this,ud,uf).call(this,2);if(l4.indexOf(t)!==-1)rQ(this,ud,uh).call(this),rQ(this,ud,uh).call(this);else{if(t=rQ(this,ud,uf).call(this,1),t==="=>")return rQ(this,ud,uh).call(this),l8(l6.ARROW,t);l5.indexOf(t)!==-1&&rQ(this,ud,uh).call(this)}return t=rQ(this,ud,uf).call(this),l8(l6.OPERATOR,t,l2[t])},ux=function t(){var t=String.fromCharCode(rz(this,uc)),e=l8(l6.GROUPER,t,l2[t]);return rQ(this,ud,uh).call(this,!0),e};var uE=function t(t,e){return new uJ(t,e).parse()},uC,uS,uA,uR,uI,uT,uM,uP,uO,uN,uU,uL,uD,uV,u$,uW,uj,uF,uz,uB,uH,uQ,uX,uG,uJ=/*#__PURE__*/function(){"use strict";function t(e,n){l(this,t);rB(this,uT);rB(this,uC);rB(this,uS);rB(this,uA);rB(this,uR);rB(this,uI);rH(this,uS,new u_(e)),rH(this,uA,n)}d(t,[{key:"parse",value:function t(){return rQ(this,uT,uM).call(this),rQ(this,uT,uP).call(this)}},{key:"_matches",value:function t(t,e){return!(t&&rz(this,uC)!==t||e&&rz(this,uI)!==e)}}]);return t}();uC=new WeakMap,uS=new WeakMap,uA=new WeakMap,uR=new WeakMap,uI=new WeakMap,uT=new WeakSet,uM=function t(t,e){var n,i;if(!this._matches(t,e))throw new Error("Expected kind ".concat(t," (").concat(e,"), was ").concat((n=rz(this,uR))===null||n===void 0?void 0:n.kind," (").concat((i=rz(this,uR))===null||i===void 0?void 0:i.value,")"));var o=rz(this,uS).nextToken();rH(this,uR,o),rH(this,uC,o===null||o===void 0?void 0:o.kind),rH(this,uI,o===null||o===void 0?void 0:o.value)},uP=function t(){if(!rz(this,uR))return rz(this,uA).empty();var t=rQ(this,uT,uL).call(this);return t===void 0?void 0:rQ(this,uT,uO).call(this,t,0)},uO=function t(t,e){if(t===void 0)throw new Error("Expected left to be defined.");for(;rz(this,uR);)if(this._matches(l6.GROUPER,"(")){var n=rQ(this,uT,uz).call(this);t=rz(this,uA).invoke(t,void 0,n)}else if(this._matches(l6.GROUPER,"[")){var i=rQ(this,uT,uB).call(this);t=rz(this,uA).index(t,i)}else if(this._matches(l6.DOT)){rQ(this,uT,uM).call(this);var o=rQ(this,uT,uL).call(this);t=rQ(this,uT,uN).call(this,t,o)}else{if(this._matches(l6.KEYWORD))break;if(this._matches(l6.OPERATOR)&&rz(this,uR).precedence>=e)t=rz(this,uI)==="?"?rQ(this,uT,uD).call(this,t):rQ(this,uT,uU).call(this,t,rz(this,uR));else break}return t},uN=function t(t,e){if(e===void 0)throw new Error("expected identifier");if(e.type==="ID")return rz(this,uA).getter(t,e.value);if(e.type==="Invoke"&&e.receiver.type==="ID"){var n=e.receiver;return rz(this,uA).invoke(t,n.value,e.arguments)}else throw new Error("expected identifier: ".concat(e))},uU=function t(t,e){if(l1.indexOf(e.value)===-1)throw new Error("unknown operator: ".concat(e.value));rQ(this,uT,uM).call(this);var n=rQ(this,uT,uL).call(this);for(;(rz(this,uC)===l6.OPERATOR||rz(this,uC)===l6.DOT||rz(this,uC)===l6.GROUPER)&&rz(this,uR).precedence>e.precedence;)n=rQ(this,uT,uO).call(this,n,rz(this,uR).precedence);return rz(this,uA).binary(t,e.value,n)},uL=function t(){if(this._matches(l6.OPERATOR)){var t=rz(this,uI);if(rQ(this,uT,uM).call(this),t==="+"||t==="-"){if(this._matches(l6.INTEGER))return rQ(this,uT,uX).call(this,t);if(this._matches(l6.DECIMAL))return rQ(this,uT,uG).call(this,t)}if(l0.indexOf(t)===-1)throw new Error("unexpected token: ".concat(t));var e=rQ(this,uT,uO).call(this,rQ(this,uT,uV).call(this),l3);return rz(this,uA).unary(t,e)}return rQ(this,uT,uV).call(this)},uD=function t(t){rQ(this,uT,uM).call(this,l6.OPERATOR,"?");var e=rQ(this,uT,uP).call(this);rQ(this,uT,uM).call(this,l6.COLON);var n=rQ(this,uT,uP).call(this);return rz(this,uA).ternary(t,e,n)},uV=function t(){switch(rz(this,uC)){case l6.KEYWORD:var t=rz(this,uI);if(t==="this")return rQ(this,uT,uM).call(this),rz(this,uA).id(t);throw lZ.indexOf(t)!==-1?new Error("unexpected keyword: ".concat(t)):new Error("unrecognized keyword: ".concat(t));case l6.IDENTIFIER:return rQ(this,uT,uj).call(this);case l6.STRING:return rQ(this,uT,uQ).call(this);case l6.INTEGER:return rQ(this,uT,uX).call(this);case l6.DECIMAL:return rQ(this,uT,uG).call(this);case l6.GROUPER:return rz(this,uI)==="("?rQ(this,uT,uH).call(this):rz(this,uI)==="{"?rQ(this,uT,uW).call(this):rz(this,uI)==="["?rQ(this,uT,u$).call(this):void 0;case l6.COLON:throw new Error('unexpected token ":"');default:return}},u$=function t(){var t=[];do{if(rQ(this,uT,uM).call(this),this._matches(l6.GROUPER,"]"))break;t.push(rQ(this,uT,uP).call(this))}while(this._matches(l6.COMMA));return rQ(this,uT,uM).call(this,l6.GROUPER,"]"),rz(this,uA).list(t)},uW=function t(){var t={};do{if(rQ(this,uT,uM).call(this),this._matches(l6.GROUPER,"}"))break;var e=rz(this,uI);(this._matches(l6.STRING)||this._matches(l6.IDENTIFIER))&&rQ(this,uT,uM).call(this),rQ(this,uT,uM).call(this,l6.COLON),t[e]=rQ(this,uT,uP).call(this)}while(this._matches(l6.COMMA));return rQ(this,uT,uM).call(this,l6.GROUPER,"}"),rz(this,uA).map(t)},uj=function t(){var t=rz(this,uI);if(t==="true")return rQ(this,uT,uM).call(this),rz(this,uA).literal(!0);if(t==="false")return rQ(this,uT,uM).call(this),rz(this,uA).literal(!1);if(t==="null")return rQ(this,uT,uM).call(this),rz(this,uA).literal(null);if(t==="undefined")return rQ(this,uT,uM).call(this),rz(this,uA).literal(void 0);var e=rQ(this,uT,uF).call(this),n=rQ(this,uT,uz).call(this);return n?rz(this,uA).invoke(e,void 0,n):e},uF=function t(){if(!this._matches(l6.IDENTIFIER))throw new Error("expected identifier: ".concat(rz(this,uI)));var t=rz(this,uI);return rQ(this,uT,uM).call(this),rz(this,uA).id(t)},uz=function t(){if(!this._matches(l6.GROUPER,"("))return;var t=[];do{if(rQ(this,uT,uM).call(this),this._matches(l6.GROUPER,")"))break;var e=rQ(this,uT,uP).call(this);t.push(e)}while(this._matches(l6.COMMA));return rQ(this,uT,uM).call(this,l6.GROUPER,")"),t},uB=function t(){rQ(this,uT,uM).call(this);var t=rQ(this,uT,uP).call(this);return rQ(this,uT,uM).call(this,l6.GROUPER,"]"),t},uH=function t(){var t=rQ(this,uT,uz).call(this);if(this._matches(l6.ARROW)){var e;rQ(this,uT,uM).call(this);var n=rQ(this,uT,uP).call(this),i=(e=t===null||t===void 0?void 0:t.map(function(t){return t.value}))!==null&&e!==void 0?e:[];return rz(this,uA).arrowFunction(i,n)}else return rz(this,uA).paren(t[0])},uQ=function t(){var t=rz(this,uA).literal(rz(this,uI));return rQ(this,uT,uM).call(this),t},uX=function t(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";var e=rz(this,uA).literal(parseInt("".concat(t).concat(rz(this,uI)),10));return rQ(this,uT,uM).call(this),e},uG=function t(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";var e=rz(this,uA).literal(parseFloat("".concat(t).concat(rz(this,uI))));return rQ(this,uT,uM).call(this),e};var uY=Object.hasOwn,uK=Object.fromEntries,uZ={"+":function(t,e){return t+e},"-":function(t,e){return t-e},"*":function(t,e){return t*e},"/":function(t,e){return t/e},"%":function(t,e){return t%e},"==":function(t,e){return t==e},"!=":function(t,e){return t!=e},"===":function(t,e){return t===e},"!==":function(t,e){return t!==e},">":function(t,e){return t>e},">=":function(t,e){return t>=e},"<":function(t,e){return t<e},"<=":function(t,e){return t<=e},"||":function(t,e){return t||e},"&&":function(t,e){return t&&e},"??":function(t,e){return t!==null&&t!==void 0?t:e},"|":function(t,e){return e(t)},"|>":function(t,e){return e(t)}},u0={"+":function(t){return t},"-":function(t){return-t},"!":function(t){return!t}},u1=/*#__PURE__*/function(){"use strict";function t(){l(this,t)}d(t,[{key:"empty",value:function t(){return{type:"Empty",evaluate:function t(t){return t},getIds:function t(t){return t}}}},{key:"literal",value:function t(t){return{type:"Literal",value:t,evaluate:function t(t){return this.value},getIds:function t(t){return t}}}},{key:"id",value:function t(t){return{type:"ID",value:t,evaluate:function t(t){return this.value==="this"?t:t===null||t===void 0?void 0:t[this.value]},getIds:function t(t){return t.push(this.value),t}}}},{key:"unary",value:function t(t,e){var n=u0[t];return{type:"Unary",operator:t,child:e,evaluate:function t(t){return n(this.child.evaluate(t))},getIds:function t(t){return this.child.getIds(t)}}}},{key:"binary",value:function t(t,e,n){var i=uZ[e];return{type:"Binary",operator:e,left:t,right:n,evaluate:function t(t){if(this.operator==="="){if(this.left.type!=="ID"&&this.left.type!=="Getter"&&this.left.type!=="Index")throw new Error("Invalid assignment target: ".concat(this.left));var e=this.right.evaluate(t),n,o;return this.left.type==="Getter"?(n=this.left.receiver.evaluate(t),o=this.left.name):this.left.type==="Index"?(n=this.left.receiver.evaluate(t),o=this.left.argument.evaluate(t)):this.left.type==="ID"&&(n=t,o=this.left.value),n===void 0?void 0:n[o]=e}return i(this.left.evaluate(t),this.right.evaluate(t))},getIds:function t(t){return this.left.getIds(t),this.right.getIds(t),t}}}},{key:"getter",value:function t(t,e){return{type:"Getter",receiver:t,name:e,evaluate:function t(t){var e;return(e=this.receiver.evaluate(t))===null||e===void 0?void 0:e[this.name]},getIds:function t(t){return this.receiver.getIds(t),t}}}},{key:"invoke",value:function t(t,e,n){if(e!=null&&typeof e!="string")throw new Error("method not a string");return{type:"Invoke",receiver:t,method:e,arguments:n,evaluate:function t(t){var n,i;var o;var a=this.receiver.evaluate(t),s=this.method?a:(n=t===null||t===void 0?void 0:t.this)!==null&&n!==void 0?n:t,l=this.method?a===null||a===void 0?void 0:a[e]:a,u=((i=this.arguments)!==null&&i!==void 0?i:[]).map(function(e){return e===null||e===void 0?void 0:e.evaluate(t)});return l===null||l===void 0?void 0:(o=l.apply)===null||o===void 0?void 0:o.call(l,s,u)},getIds:function t(t){var e;return this.receiver.getIds(t),(e=this.arguments)===null||e===void 0?void 0:e.forEach(function(e){return e===null||e===void 0?void 0:e.getIds(t)}),t}}}},{key:"paren",value:function t(t){return t}},{key:"index",value:function t(t,e){return{type:"Index",receiver:t,argument:e,evaluate:function t(t){var e;return(e=this.receiver.evaluate(t))===null||e===void 0?void 0:e[this.argument.evaluate(t)]},getIds:function t(t){return this.receiver.getIds(t),t}}}},{key:"ternary",value:function t(t,e,n){return{type:"Ternary",condition:t,trueExpr:e,falseExpr:n,evaluate:function t(t){return this.condition.evaluate(t)?this.trueExpr.evaluate(t):this.falseExpr.evaluate(t)},getIds:function t(t){return this.condition.getIds(t),this.trueExpr.getIds(t),this.falseExpr.getIds(t),t}}}},{key:"map",value:function t(t){return{type:"Map",entries:t,evaluate:function e(e){var n={};if(t&&this.entries)for(var i in t){var o=this.entries[i];o&&(n[i]=o.evaluate(e))}return n},getIds:function e(e){if(t&&this.entries)for(var n in t){var i=this.entries[n];i&&i.getIds(e)}return e}}}},{key:"list",value:function t(t){return{type:"List",items:t,evaluate:function t(t){var e;return(e=this.items)===null||e===void 0?void 0:e.map(function(e){return e===null||e===void 0?void 0:e.evaluate(t)})},getIds:function t(t){var e;return(e=this.items)===null||e===void 0?void 0:e.forEach(function(e){return e===null||e===void 0?void 0:e.getIds(t)}),t}}}},{key:"arrowFunction",value:function t(t,e){return{type:"ArrowFunction",params:t,body:e,evaluate:function t(t){var e=this.params,n=this.body;return function(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++){o[a]=arguments[a]}var s=uK(e.map(function(t,e){return[t,o[e]]})),l=new Proxy(t!==null&&t!==void 0?t:{},{set:function t(t,e,n){return uY(s,e)&&(s[e]=n),t[e]=n},get:function t(t,e){return uY(s,e)?s[e]:t[e]}});return n.evaluate(l)}},getIds:function t(t){var e=this;return this.body.getIds(t).filter(function(t){return!e.params.includes(t)})}}}}]);return t}();var u2=null,u3={boundAttributeSuffix:lY.M,marker:lY.P,markerMatch:lY.A,HTML_RESULT:lY.C,getTemplateHtml:lY.L,overrideDirectiveResolve:function t(t,e){var n=/*#__PURE__*/function(t){"use strict";v(n,t);function n(){l(this,n);return s(this,n,arguments)}d(n,[{key:"_$AS",value:function t(t,n){return e(this,n)}}]);return n}(t);return n},patchDirectiveResolve:function t(t,e){if(t.prototype._$AS.name!==e.name){u2!==null&&u2!==void 0?u2:u2=t.prototype._$AS.name;for(var n=t.prototype;n!==Object.prototype;n=Object.getPrototypeOf(n))if(n.hasOwnProperty(u2))return void(n[u2]=e);throw Error("Internal error: It is possible that both dev mode and production mode Lit was mixed together during SSR. Please comment on the issue: https://github.com/lit/lit/issues/4527")}},setDirectiveClass:function t(t,e){t._$litDirective$=e},getAttributePartCommittedValue:function t(t,e,n){var i=lL;return t.j=function(t){return i=t},t._$AI(e,t,n),i},connectedDisconnectable:function t(t){return _(k({},t),{_$AU:!0})},resolveDirective:lY.V,AttributePart:lY.H,PropertyPart:lY.B,BooleanAttributePart:lY.N,EventPart:lY.U,ElementPart:lY.F,TemplateInstance:lY.R,isIterable:lY.D,ChildPart:lY.I};var u5=u3.AttributePart,u4=u3.PropertyPart,u6=u3.BooleanAttributePart,u8=u3.EventPart,u7=new u1,u9=new Map,ct=function t(t){return t.replace(/-(-|\w)/g,function(t,e){return e.toUpperCase()})},ce=function t(t,e){var n=u9.get(t);if(n===void 0){if(u9.has(t))return;if(t=t.trim(),t.startsWith("{{")&&t.endsWith("}}")){var i=t.substring(2,t.length-2).trim();n=new uJ(i,u7).parse(),u9.set(t,n)}}return n===null||n===void 0?void 0:n.evaluate(e)},cn=function t(t,e,n,i){var o=t.getAttribute("if");if(o!==null&&ce(o,e))return cu(t,e,n,i)},cr=RegExp("(?<!\\\\){{(.*?)(?:(?<!\\\\)}})","g"),ci=function t(t){return/(?:\\{{)|(?:\\}})/g.test(t)},co=function t(t){return t.replaceAll(/\\{{/g,"{{").replace(/\\}}/g,"}}")},ca=function t(t,e,n,i){var o=t.getAttribute("repeat");if(o!==null){var a=ce(o,e);if(!a[Symbol.iterator])return lD;var s=cd(t),l=-1,u=[];var c=true,d=false,h=undefined;try{for(var f=a[Symbol.iterator](),p;!(c=(p=f.next()).done);c=true){var v=p.value;var m;l++;var g=Object.create(e);g.item=v,g.index=l,g.this=(m=e.this)!==null&&m!==void 0?m:e;var y=[];var b=true,w=false,q=undefined;try{for(var k=s.parts[Symbol.iterator](),x;!(b=(x=k.next()).done);b=true){var _=x.value;var E;var C=_.update(g,n,i);_.type===1?(E=y).push.apply(E,N(C)):y.push(C)}}catch(t){w=true;q=t}finally{try{if(!b&&k.return!=null){k.return()}}finally{if(w){throw q}}}var S={_$litType$:s,values:y};u.push(S)}}catch(t){d=true;h=t}finally{try{if(!c&&f.return!=null){f.return()}}finally{if(d){throw h}}}return u}},cs={if:cn,repeat:ca},cl=function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:cs,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;var o=cd(t).renderers;if(i){var a=cd(i).renderers,s=o.super;s!==void 0?n=_(k({},o,n),{super:function t(t,e,n){return n=_(k({},a,n),{super:function t(t,e,n){return cu(i,t,e,n)}}),s(t,e,n)}}):(n=k({},a,o,n),t=i)}else n=k({},o,n);return function(i){return cu(t,i,e,n)}};var cu=function t(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:cs,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};var o=cd(t),a=[];var s=true,l=false,u=undefined;try{for(var c=o.parts[Symbol.iterator](),d;!(s=(d=c.next()).done);s=true){var h=d.value;var f;var p=h.update(e,n,i);h.type===1?(f=a).push.apply(f,N(p)):a.push(p)}}catch(t){l=true;u=t}finally{try{if(!s&&c.return!=null){c.return()}}finally{if(l){throw u}}}return{_$litType$:o,values:a}},cc=new Map,cd=function t(t){var e=cc.get(t);return e===void 0&&cc.set(t,e=ch(t)),e},ch=function t(t){var e=function(){if(o.nodeType===Node.COMMENT_NODE)a++;else if(o.nodeType===Node.ELEMENT_NODE){a++;var t=o;if(t.tagName==="TEMPLATE"){var e=t.getAttribute("type"),l=t.getAttribute("name"),u=t.getAttribute("call");if(u!==null||e!==null||l!==null){t.parentNode.insertBefore(document.createComment(""),t),s.push(t);var c=void 0;if(u!==null){var d=u.trim(),h=d.startsWith("{{")&&d.endsWith("}}");c=function e(e,n,i){var o;var a=t.getAttribute("data"),s=a===null?void 0:ce(a,e);return(o=h?ce(d,e):i[u])===null||o===void 0?void 0:o(s,n,i)}}else e!==null?c=function n(n,i,o){var a=i[e];return a===null||a===void 0?void 0:a(t,n,i,o)}:(l==="super"?n.renderers.super=function(e,n,i){var o=i.super,a=cd(t);return i=k({},i,a.renderers),o(e,n,i)}:n.renderers[l]=function(e,n,i){return cu(t,e,n,i)},c=function t(t,e,n){var i=n[l];return i===null||i===void 0?void 0:i(t,e,n)});n.parts.push({type:2,index:a,update:c});return"continue"}}var f=t.getAttributeNames();var p=true,v=false,m=undefined;try{var g=function(){var e=b.value;var i=t.getAttribute(e),o=i.split(cr);if(o.length===1){ci(i)&&t.setAttribute(e,co(i));return"continue"}t.removeAttribute(e);var s=e,l=u5,u=e[0];u==="."?(s=ct(e.substring(1)),l=u4):u==="?"?(s=e.substring(1),l=u6):u==="@"&&(s=ct(e.substring(1)),l=u8);var c=[co(o[0])],d=[];for(var h=1;h<o.length;h+=2){var f=o[h];d.push(uE(f,u7)),c.push(co(o[h+1]))}n.parts.push({type:1,index:a,name:s,strings:c,ctor:l,update:function t(t,e,n){return d.map(function(e){return e.evaluate(t)})}})};for(var y=f[Symbol.iterator](),b;!(p=(b=y.next()).done);p=true)g()}catch(t){v=true;m=t}finally{try{if(!p&&y.return!=null){y.return()}}finally{if(v){throw m}}}}else if(o.nodeType===Node.TEXT_NODE){var w=function(t){var e=_[t],o=uE(e,u7);n.parts.push({type:2,index:++a,update:function t(t,e){return o.evaluate(t)}});var s=new Text(_[t+1].replace("\\{{","{{"));q.parentNode.insertBefore(s,q.nextSibling),q.parentNode.insertBefore(document.createComment(""),q.nextSibling),q=s,i.currentNode=s};var q=o,x=q.textContent,_=x.split(cr);_.length>1?q.textContent=co(_[0]):ci(x)&&(q.textContent=co(x));for(var E=1;E<_.length;E+=2)w(E)}};var n={h:void 0,el:t.cloneNode(!0),parts:[],renderers:{}},i=document.createTreeWalker(n.el.content,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT|NodeFilter.SHOW_COMMENT),o=i.currentNode,a=-1,s=[];for(;(o=i.nextNode())!==null;)e();var l=true,u=false,c=undefined;try{for(var d=s[Symbol.iterator](),h;!(l=(h=d.next()).done);l=true){var f=h.value;f.remove()}}catch(t){u=true;c=t}finally{try{if(!l&&d.return!=null){d.return()}}finally{if(u){throw c}}}return n};var cf,cp=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e);rB(t,cf);rH(t,cf,t.attachInternals()),rz(t,cf).ariaLabel="pagination";return t}d(e,[{key:"createRenderRoot",value:function t(){return this}},{key:"connectedCallback",value:function t(){f(p(e.prototype),"connectedCallback",this).call(this);var t=this.querySelector("template");this.myTemplate=cl(t)}},{key:"render",value:function t(){var t=this;if(!this.computedContext)return ol(t$());var e=this.computedContext.testParts.flatMap(function(t){return t.sections.flatMap(function(t){return t.items})});return ol(tW(),e.map(function(e){return t.myTemplate({item:e,view:t.computedContext.view})}))}}]);return e}(oR);cf=new WeakMap,rj([e({context:oU,subscribe:!0})],cp.prototype,"computedContext",2),cp=rj([oT("test-paging-buttons-stamp")],cp);var cv=/*#__PURE__*/function(){"use strict";function t(e){l(this,t);this.G=e}d(t,[{key:"disconnect",value:function t(){this.G=void 0}},{key:"reconnect",value:function t(t){this.G=t}},{key:"deref",value:function t(){return this.G}}]);return t}(),cm=/*#__PURE__*/function(){"use strict";function t(){l(this,t);this.Y=void 0,this.Z=void 0}d(t,[{key:"get",value:function t(){return this.Y}},{key:"pause",value:function t(){var t=this;var e;(e=this.Y)!==null&&e!==void 0?e:this.Y=new Promise(function(e){return t.Z=e})}},{key:"resume",value:function t(){var t,e;(t=(e=this).Z)===null||t===void 0?void 0:t.call(e),this.Y=this.Z=void 0}}]);return t}();var cg=function t(t){return!oZ(t)&&typeof t.then=="function"},cy=0x3fffffff,cb=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments),t._$Cwt=cy,t._$Cbt=[],t._$CK=new cv(t),t._$CX=new cm;return t}d(e,[{key:"render",value:function t(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++){e[n]=arguments[n]}var i;return(i=e.find(function(t){return!cg(t)}))!==null&&i!==void 0?i:od}},{key:"update",value:function t(t,e){var n,i=function(t){var i=e[t];if(!cg(i))return{v:(n._$Cwt=t,i)};t<s&&i===o[t]||(n._$Cwt=cy,s=0,Promise.resolve(i).then(function(t){return a(function(){var e,n;return $(this,function(o){switch(o.label){case 0:if(!u.get())return[3,3];return[4,u.get()];case 1:o.sent();o.label=2;case 2:return[3,0];case 3:e=l.deref();if(e!==void 0){n=e._$Cbt.indexOf(i);n>-1&&n<e._$Cwt&&(e._$Cwt=n,e.setValue(t))}return[2]}})})()}))};var o=this._$Cbt,s=o.length;this._$Cbt=e;var l=this._$CK,u=this._$CX;this.isConnected||this.disconnected();for(var c=0;c<e.length&&!(c>this._$Cwt);c++){var d=(n=this,i(c));if(U(d)==="object")return d.v}return od}},{key:"disconnected",value:function t(){this._$CK.disconnect(),this._$CX.pause()}},{key:"reconnected",value:function t(){this._$CK.reconnect(this),this._$CX.resume()}}]);return e}(an),cw=oG(cb);var cq="@layer qti-base, qti-components, qti-utilities, qti-variants, qti-extended;\n\n/* https://www.imsglobal.org/sites/default/files/spec/qti/v3/guide/img/qti3p0.css */\n\n/* ============================\n QTI 3 shared css\n 1. Display\n 2. Special Flex styles\n 3. Margin\n 4. Padding\n 5. Horizontal Alignment styles\n 6. Vertical Alignment styles\n 7. Height\n 8. Width\n 9. Text-Indent\n 10. List Style\n 11. Layout\n 12. Other QTI 3 presentation utilities\n ============================ */\n\n/* ==========\n Display css\n =========== */\n\n.qti-display-inline {\n display: inline;\n}\n\n.qti-display-inline-block {\n display: inline-block;\n}\n\n.qti-display-block {\n display: block;\n}\n\n.qti-display-flex {\n display: flex;\n}\n\n.qti-display-inline-flex {\n display: inline-flex;\n}\n\n.qti-display-grid {\n display: grid;\n}\n\n.qti-display-inline-grid {\n display: inline-grid;\n}\n\n.qti-display-table {\n display: table;\n}\n\n.qti-display-table-cell {\n display: table-cell;\n}\n\n.qti-display-table-row {\n display: table-row;\n}\n\n.qti-display-list-item {\n display: list-item;\n}\n\n.qti-display-inherit {\n display: inherit;\n}\n\n/* \n * hidden to screen readers and sighted\n */\n\n.qti-hidden {\n display: none;\n}\n\n/*\n * visible to screen readers, hidden to sighted\n */\n\n.qti-visually-hidden {\n position: fixed !important;\n overflow: hidden;\n clip: rect(1px 1px 1px 1px);\n height: 1px;\n width: 1px;\n border: 0;\n margin: -1px;\n}\n\n/* =============================\n Special flex styles\n ============================= */\n\n.qti-flex-direction-column {\n flex-direction: column;\n}\n\n.qti-flex-direction-row {\n flex-direction: row;\n}\n\n.qti-flex-grow-1 {\n flex-grow: 1;\n}\n\n.qti-flex-grow-0 {\n flex-grow: 0;\n}\n\n/* =========\n Margin css\n ========== */\n\n/**\n * For margin Top and Bottom and Left and Right\n */\n\n.qti-margin-0 {\n margin: 0 !important;\n}\n\n.qti-margin-1 {\n margin: 0.25rem !important;\n}\n\n.qti-margin-2 {\n margin: 0.5rem !important;\n}\n\n.qti-margin-3 {\n margin: 1rem !important;\n}\n\n.qti-margin-4 {\n margin: 1.5rem !important;\n}\n\n.qti-margin-5 {\n margin: 3rem !important;\n}\n\n.qti-margin-auto {\n margin: auto !important;\n}\n\n/*\n For margin Left and Right\n */\n\n.qti-margin-x-0 {\n margin-right: 0 !important;\n margin-left: 0 !important;\n}\n\n.qti-margin-x-1 {\n margin-right: 0.25rem !important;\n margin-left: 0.25rem !important;\n}\n\n.qti-margin-x-2 {\n margin-right: 0.5rem !important;\n margin-left: 0.5rem !important;\n}\n\n.qti-margin-x-3 {\n margin-right: 1rem !important;\n margin-left: 1rem !important;\n}\n\n.qti-margin-x-4 {\n margin-right: 1.5rem !important;\n margin-left: 1.5rem !important;\n}\n\n.qti-margin-x-5 {\n margin-right: 3rem !important;\n margin-left: 3rem !important;\n}\n\n.qti-margin-x-auto {\n margin-right: auto !important;\n margin-left: auto !important;\n}\n\n/*\n For margin Top and Bottom\n */\n\n.qti-margin-y-0 {\n margin-top: 0 !important;\n margin-bottom: 0 !important;\n}\n\n.qti-margin-y-1 {\n margin-top: 0.25rem !important;\n margin-bottom: 0.25rem !important;\n}\n\n.qti-margin-y-2 {\n margin-top: 0.5rem !important;\n margin-bottom: 0.5rem !important;\n}\n\n.qti-margin-y-3 {\n margin-top: 1rem !important;\n margin-bottom: 1rem !important;\n}\n\n.qti-margin-y-4 {\n margin-top: 1.5rem !important;\n margin-bottom: 1.5rem !important;\n}\n\n.qti-margin-y-5 {\n margin-top: 3rem !important;\n margin-bottom: 3rem !important;\n}\n\n.qti-margin-y-auto {\n margin-top: auto !important;\n margin-bottom: auto !important;\n}\n\n/*\n For margin Top\n */\n\n.qti-margin-t-0 {\n margin-top: 0 !important;\n}\n\n.qti-margin-t-1 {\n margin-top: 0.25rem !important;\n}\n\n.qti-margin-t-2 {\n margin-top: 0.5rem !important;\n}\n\n.qti-margin-t-3 {\n margin-top: 1rem !important;\n}\n\n.qti-margin-t-4 {\n margin-top: 1.5rem !important;\n}\n\n.qti-margin-t-5 {\n margin-top: 3rem !important;\n}\n\n.qti-margin-t-auto {\n margin-top: auto !important;\n}\n\n/* \n For margin Bottom\n */\n\n.qti-margin-b-0 {\n margin-bottom: 0 !important;\n}\n\n.qti-margin-b-1 {\n margin-bottom: 0.25rem !important;\n}\n\n.qti-margin-b-2 {\n margin-bottom: 0.5rem !important;\n}\n\n.qti-margin-b-3 {\n margin-bottom: 1rem !important;\n}\n\n.qti-margin-b-4 {\n margin-bottom: 1.5rem !important;\n}\n\n.qti-margin-b-5 {\n margin-bottom: 3rem !important;\n}\n\n.qti-margin-b-auto {\n margin-bottom: auto !important;\n}\n\n/*\n For margin Start LTR\n */\n\n.qti-margin-s-0 {\n margin-left: 0 !important;\n}\n\n.qti-margin-s-1 {\n margin-left: 0.25rem !important;\n}\n\n.qti-margin-s-2 {\n margin-left: 0.5rem !important;\n}\n\n.qti-margin-s-3 {\n margin-left: 1rem !important;\n}\n\n.qti-margin-s-4 {\n margin-left: 1.5rem !important;\n}\n\n.qti-margin-s-5 {\n margin-left: 3rem !important;\n}\n\n.qti-margin-s-auto {\n margin-left: auto !important;\n}\n\n/* \n For margin End LTR\n */\n\n.qti-margin-e-0 {\n margin-right: 0 !important;\n}\n\n.qti-margin-e-1 {\n margin-right: 0.25rem !important;\n}\n\n.qti-margin-e-2 {\n margin-right: 0.5rem !important;\n}\n\n.qti-margin-e-3 {\n margin-right: 1rem !important;\n}\n\n.qti-margin-e-4 {\n margin-right: 1.5rem !important;\n}\n\n.qti-margin-e-5 {\n margin-right: 3rem !important;\n}\n\n.qti-margin-e-auto {\n margin-right: auto !important;\n}\n\n/* =========\n Padding css\n ========== */\n\n/*\n For padding Top and Bottom and Left and Right\n */\n\n.qti-padding-0 {\n padding: 0 !important;\n}\n\n.qti-padding-1 {\n padding: 0.25rem !important;\n}\n\n.qti-padding-2 {\n padding: 0.5rem !important;\n}\n\n.qti-padding-3 {\n padding: 1rem !important;\n}\n\n.qti-padding-4 {\n padding: 1.5rem !important;\n}\n\n.qti-padding-5 {\n padding: 3rem !important;\n}\n\n/*\n For padding Left and Right\n */\n\n.qti-padding-x-0 {\n padding-right: 0 !important;\n padding-left: 0 !important;\n}\n\n.qti-padding-x-1 {\n padding-right: 0.25rem !important;\n padding-left: 0.25rem !important;\n}\n\n.qti-padding-x-2 {\n padding-right: 0.5rem !important;\n padding-left: 0.5rem !important;\n}\n\n.qti-padding-x-3 {\n padding-right: 1rem !important;\n padding-left: 1rem !important;\n}\n\n.qti-padding-x-4 {\n padding-right: 1.5rem !important;\n padding-left: 1.5rem !important;\n}\n\n.qti-padding-x-5 {\n padding-right: 3rem !important;\n padding-left: 3rem !important;\n}\n\n/*\n For padding Top and Bottom\n */\n\n.qti-padding-y-0 {\n padding-top: 0 !important;\n padding-bottom: 0 !important;\n}\n\n.qti-padding-y-1 {\n padding-top: 0.25rem !important;\n padding-bottom: 0.25rem !important;\n}\n\n.qti-padding-y-2 {\n padding-top: 0.5rem !important;\n padding-bottom: 0.5rem !important;\n}\n\n.qti-padding-y-3 {\n padding-top: 1rem !important;\n padding-bottom: 1rem !important;\n}\n\n.qti-padding-y-4 {\n padding-top: 1.5rem !important;\n padding-bottom: 1.5rem !important;\n}\n\n.qti-padding-y-5 {\n padding-top: 3rem !important;\n padding-bottom: 3rem !important;\n}\n\n/*\n For padding Top\n */\n\n.qti-padding-t-0 {\n padding-top: 0 !important;\n}\n\n.qti-padding-t-1 {\n padding-top: 0.25rem !important;\n}\n\n.qti-padding-t-2 {\n padding-top: 0.5rem !important;\n}\n\n.qti-padding-t-3 {\n padding-top: 1rem !important;\n}\n\n.qti-padding-t-4 {\n padding-top: 1.5rem !important;\n}\n\n.qti-padding-t-5 {\n padding-top: 3rem !important;\n}\n\n/*\n For padding Bottom\n */\n\n.qti-padding-b-0 {\n padding-bottom: 0 !important;\n}\n\n.qti-padding-b-1 {\n padding-bottom: 0.25rem !important;\n}\n\n.qti-padding-b-2 {\n padding-bottom: 0.5rem !important;\n}\n\n.qti-padding-b-3 {\n padding-bottom: 1rem !important;\n}\n\n.qti-padding-b-4 {\n padding-bottom: 1.5rem !important;\n}\n\n.qti-padding-b-5 {\n padding-bottom: 3rem !important;\n}\n\n/*\n For padding Start LTR\n */\n\n.qti-padding-s-0 {\n padding-left: 0 !important;\n}\n\n.qti-padding-s-1 {\n padding-left: 0.25rem !important;\n}\n\n.qti-padding-s-2 {\n padding-left: 0.5rem !important;\n}\n\n.qti-padding-s-3 {\n padding-left: 1rem !important;\n}\n\n.qti-padding-s-4 {\n padding-left: 1.5rem !important;\n}\n\n.qti-padding-s-5 {\n padding-left: 3rem !important;\n}\n\n/*\n For padding End LTR\n */\n\n.qti-padding-e-0 {\n padding-right: 0 !important;\n}\n\n.qti-padding-e-1 {\n padding-right: 0.25rem !important;\n}\n\n.qti-padding-e-2 {\n padding-right: 0.5rem !important;\n}\n\n.qti-padding-e-3 {\n padding-right: 1rem !important;\n}\n\n.qti-padding-e-4 {\n padding-right: 1.5rem !important;\n}\n\n.qti-padding-e-5 {\n padding-right: 3rem !important;\n}\n\n/* ====================\n Horizontal alignment\n ==================== */\n\n.qti-align-left {\n text-align: left;\n}\n\n.qti-align-center {\n text-align: center;\n}\n\n.qti-align-right {\n text-align: right;\n}\n\n/* ==================\n Vertical alignment\n ================== */\n\n.qti-valign-top {\n vertical-align: top;\n}\n\n.qti-valign-middle {\n vertical-align: middle;\n}\n\n.qti-valign-baseline {\n vertical-align: baseline;\n}\n\n.qti-valign-bottom {\n vertical-align: bottom;\n}\n\n/* =============\n Height styles\n ============= */\n\n.qti-height-0 {\n height: 0;\n}\n\n.qti-height-px {\n height: 1px;\n}\n\n.qti-height-0p5 {\n height: 0.125rem;\n}\n\n.qti-height-1 {\n height: 0.25rem;\n}\n\n.qti-height-1p5 {\n height: 0.375rem;\n}\n\n.qti-height-2 {\n height: 0.5rem;\n}\n\n.qti-height-2p5 {\n height: 0.625rem;\n}\n\n.qti-height-3 {\n height: 0.75rem;\n}\n\n.qti-height-3p5 {\n height: 0.875rem;\n}\n\n.qti-height-4 {\n height: 1rem;\n}\n\n.qti-height-5 {\n height: 1.25rem;\n}\n\n.qti-height-6 {\n height: 1.5rem;\n}\n\n.qti-height-7 {\n height: 1.75rem;\n}\n\n.qti-height-8 {\n height: 2rem;\n}\n\n.qti-height-9 {\n height: 2.25rem;\n}\n\n.qti-height-10 {\n height: 2.5rem;\n}\n\n.qti-height-11 {\n height: 2.75rem;\n}\n\n.qti-height-12 {\n height: 3rem;\n}\n\n.qti-height-14 {\n height: 3.5rem;\n}\n\n.qti-height-16 {\n height: 4rem;\n}\n\n.qti-height-20 {\n height: 5rem;\n}\n\n.qti-height-24 {\n height: 6rem;\n}\n\n.qti-height-28 {\n height: 7rem;\n}\n\n.qti-height-32 {\n height: 8rem;\n}\n\n.qti-height-36 {\n height: 9rem;\n}\n\n.qti-height-40 {\n height: 10rem;\n}\n\n.qti-height-44 {\n height: 11rem;\n}\n\n.qti-height-48 {\n height: 12rem;\n}\n\n.qti-height-52 {\n height: 13rem;\n}\n\n.qti-height-56 {\n height: 14rem;\n}\n\n.qti-height-60 {\n height: 15rem;\n}\n\n.qti-height-64 {\n height: 16rem;\n}\n\n.qti-height-72 {\n height: 18rem;\n}\n\n.qti-height-80 {\n height: 20rem;\n}\n\n.qti-height-96 {\n height: 24rem;\n}\n\n.qti-height-1-2 {\n height: 50%;\n}\n\n.qti-height-1-3 {\n height: 33.3333%;\n}\n\n.qti-height-2-3 {\n height: 66.6667%;\n}\n\n.qti-height-1-4 {\n height: 25%;\n}\n\n.qti-height-2-4 {\n height: 50%;\n}\n\n.qti-height-3-4 {\n height: 75%;\n}\n\n.qti-height-1-5 {\n height: 20%;\n}\n\n.qti-height-2-5 {\n height: 40%;\n}\n\n.qti-height-3-5 {\n height: 60%;\n}\n\n.qti-height-4-5 {\n height: 80%;\n}\n\n.qti-height-1-6 {\n height: 16.6667%;\n}\n\n.qti-height-2-6 {\n height: 33.3333%;\n}\n\n.qti-height-3-6 {\n height: 50%;\n}\n\n.qti-height-4-6 {\n height: 66.6667%;\n}\n\n.qti-height-5-6 {\n height: 83.3333%;\n}\n\n.qti-height-auto {\n height: auto;\n}\n\n.qti-height-full {\n height: 100%;\n}\n\n/* ============\n Width styles\n ============ */\n\n.qti-width-0 {\n width: 0;\n}\n\n.qti-width-px {\n width: 1px;\n}\n\n.qti-width-0p5 {\n width: 0.125rem;\n}\n\n.qti-width-1 {\n width: 0.25rem;\n}\n\n.qti-width-1p5 {\n width: 0.375rem;\n}\n\n.qti-width-2 {\n width: 0.5rem;\n}\n\n.qti-width-2p5 {\n width: 0.625rem;\n}\n\n.qti-width-3 {\n width: 0.75rem;\n}\n\n.qti-width-3p5 {\n width: 0.875rem;\n}\n\n.qti-width-4 {\n width: 1rem;\n}\n\n.qti-width-5 {\n width: 1.25rem;\n}\n\n.qti-width-6 {\n width: 1.5rem;\n}\n\n.qti-width-7 {\n width: 1.75rem;\n}\n\n.qti-width-8 {\n width: 2rem;\n}\n\n.qti-width-9 {\n width: 2.25rem;\n}\n\n.qti-width-10 {\n width: 2.5rem;\n}\n\n.qti-width-11 {\n width: 2.75rem;\n}\n\n.qti-width-12 {\n width: 3rem;\n}\n\n.qti-width-14 {\n width: 3.5rem;\n}\n\n.qti-width-16 {\n width: 4rem;\n}\n\n.qti-width-20 {\n width: 5rem;\n}\n\n.qti-width-24 {\n width: 6rem;\n}\n\n.qti-width-28 {\n width: 7rem;\n}\n\n.qti-width-32 {\n width: 8rem;\n}\n\n.qti-width-36 {\n width: 9rem;\n}\n\n.qti-width-40 {\n width: 10rem;\n}\n\n.qti-width-44 {\n width: 11rem;\n}\n\n.qti-width-48 {\n width: 12rem;\n}\n\n.qti-width-52 {\n width: 13rem;\n}\n\n.qti-width-56 {\n width: 14rem;\n}\n\n.qti-width-60 {\n width: 15rem;\n}\n\n.qti-width-64 {\n width: 16rem;\n}\n\n.qti-width-72 {\n width: 18rem;\n}\n\n.qti-width-80 {\n width: 20rem;\n}\n\n.qti-width-96 {\n width: 24rem;\n}\n\n.qti-width-auto {\n width: auto;\n}\n\n.qti-width-1-2 {\n width: 50%;\n}\n\n.qti-width-1-3 {\n width: 33.3333%;\n}\n\n.qti-width-2-3 {\n width: 66.6667%;\n}\n\n.qti-width-1-4 {\n width: 25%;\n}\n\n.qti-width-2-4 {\n width: 50%;\n}\n\n.qti-width-3-4 {\n width: 75%;\n}\n\n.qti-width-1-5 {\n width: 20%;\n}\n\n.qti-width-2-5 {\n width: 40%;\n}\n\n.qti-width-3-5 {\n width: 60%;\n}\n\n.qti-width-4-5 {\n width: 80%;\n}\n\n.qti-width-1-6 {\n width: 16.6667%;\n}\n\n.qti-width-2-6 {\n width: 33.3333%;\n}\n\n.qti-width-3-6 {\n width: 50%;\n}\n\n.qti-width-4-6 {\n width: 66.6667%;\n}\n\n.qti-width-5-6 {\n width: 83.3333%;\n}\n\n.qti-width-1-12 {\n width: 8.3333%;\n}\n\n.qti-width-2-12 {\n width: 16.6667%;\n}\n\n.qti-width-3-12 {\n width: 25%;\n}\n\n.qti-width-4-12 {\n width: 33.3333%;\n}\n\n.qti-width-5-12 {\n width: 41.6667%;\n}\n\n.qti-width-6-12 {\n width: 50%;\n}\n\n.qti-width-7-12 {\n width: 58.3333%;\n}\n\n.qti-width-8-12 {\n width: 66.6667%;\n}\n\n.qti-width-9-12 {\n width: 75%;\n}\n\n.qti-width-10-12 {\n width: 83.3333%;\n}\n\n.qti-width-11-12 {\n width: 91.6667%;\n}\n\n.qti-width-full,\n.qti-fullwidth {\n width: 100%;\n}\n\n/* ==================\n Text Indent styles\n ================== */\n\n.qti-text-indent-0 {\n text-indent: 0;\n}\n\n.qti-text-indent-px {\n text-indent: 1px;\n}\n\n.qti-text-indent-0p5 {\n text-indent: 0.125rem;\n}\n\n.qti-text-indent-1 {\n text-indent: 0.25rem;\n}\n\n.qti-text-indent-1p5 {\n text-indent: 0.375rem;\n}\n\n.qti-text-indent-2 {\n text-indent: 0.5rem;\n}\n\n.qti-text-indent-2p5 {\n text-indent: 0.625rem;\n}\n\n.qti-text-indent-3 {\n text-indent: 0.75rem;\n}\n\n.qti-text-indent-3p5 {\n text-indent: 0.875rem;\n}\n\n.qti-text-indent-4 {\n text-indent: 1rem;\n}\n\n.qti-text-indent-5 {\n text-indent: 1.25rem;\n}\n\n.qti-text-indent-6 {\n text-indent: 1.5rem;\n}\n\n.qti-text-indent-7 {\n text-indent: 1.75rem;\n}\n\n.qti-text-indent-8 {\n text-indent: 2rem;\n}\n\n.qti-text-indent-12 {\n text-indent: 3rem;\n}\n\n.qti-text-indent-16 {\n text-indent: 4rem;\n}\n\n.qti-text-indent-20 {\n text-indent: 5rem;\n}\n\n.qti-text-indent-24 {\n text-indent: 6rem;\n}\n\n.qti-text-indent-28 {\n text-indent: 7rem;\n}\n\n.qti-text-indent-32 {\n text-indent: 8rem;\n}\n\n/* =================\n List Style styles\n ================= */\n\n.qti-list-style-type-none {\n list-style-type: none;\n}\n\n.qti-list-style-type-disc {\n list-style-type: disc;\n}\n\n.qti-list-style-type-circle {\n list-style-type: circle;\n}\n\n.qti-list-style-type-square {\n list-style-type: square;\n}\n\n.qti-list-style-type-decimal {\n list-style-type: decimal;\n}\n\n.qti-list-style-type-decimal-leading-zero {\n list-style-type: decimal-leading-zero;\n}\n\n.qti-list-style-type-lower-alpha {\n list-style-type: lower-alpha;\n}\n\n.qti-list-style-type-upper-alpha {\n list-style-type: upper-alpha;\n}\n\n.qti-list-style-type-lower-roman {\n list-style-type: lower-roman;\n}\n\n.qti-list-style-type-upper-roman {\n list-style-type: upper-roman;\n}\n\n.qti-list-style-type-lower-latin {\n list-style-type: lower-latin;\n}\n\n.qti-list-style-type-upper-latin {\n list-style-type: upper-latin;\n}\n\n.qti-list-style-type-lower-greek {\n list-style-type: lower-greek;\n}\n\n.qti-list-style-type-arabic-indic {\n list-style-type: arabic-indic;\n}\n\n.qti-list-style-type-armenian {\n list-style-type: armenian;\n}\n\n.qti-list-style-type-lower-armenian {\n list-style-type: lower-armenian;\n}\n\n.qti-list-style-type-upper-armenian {\n list-style-type: upper-armenian;\n}\n\n.qti-list-style-type-bengali {\n list-style-type: bengali;\n}\n\n.qti-list-style-type-cambodian {\n list-style-type: cambodian;\n}\n\n.qti-list-style-type-simp-chinese-formal {\n list-style-type: simp-chinese-formal;\n}\n\n.qti-list-style-type-simp-chinese-informal {\n list-style-type: simp-chinese-informal;\n}\n\n.qti-list-style-type-trad-chinese-formal {\n list-style-type: trad-chinese-formal;\n}\n\n.qti-list-style-type-trad-chinese-informal {\n list-style-type: trad-chinese-informal;\n}\n\n.qti-list-style-type-cjk-ideographic {\n list-style-type: cjk-ideographic;\n}\n\n.qti-list-style-type-cjk-heavenly-stem {\n list-style-type: cjk-heavenly-stem;\n}\n\n.qti-list-style-type-cjk-earthly-branch {\n list-style-type: cjk-earthly-branch;\n}\n\n.qti-list-style-type-devanagari {\n list-style-type: devanagari;\n}\n\n.qti-list-style-type-ethiopic-halehame-ti-er {\n list-style-type: ethiopic-halehame-ti-er;\n}\n\n.qti-list-style-type-ethiopic-halehame-ti-et {\n list-style-type: ethiopic-halehame-ti-et;\n}\n\n.qti-list-style-type-ethiopic-halehame-am {\n list-style-type: ethiopic-halehame-am;\n}\n\n.qti-list-style-type-ethiopic-halehame {\n list-style-type: ethiopic-halehame;\n}\n\n.qti-list-style-type-georgian {\n list-style-type: georgian;\n}\n\n.qti-list-style-type-gujarati {\n list-style-type: gujarati;\n}\n\n.qti-list-style-type-gurmukhi {\n list-style-type: gurmukhi;\n}\n\n.qti-list-style-type-hangul {\n list-style-type: hangul;\n}\n\n.qti-list-style-type-hangul-consonant {\n list-style-type: hangul-consonant;\n}\n\n.qti-list-style-type-hebrew {\n list-style-type: hebrew;\n}\n\n.qti-list-style-type-hiragana {\n list-style-type: hiragana;\n}\n\n.qti-list-style-type-hiragana-iroha {\n list-style-type: hiragana-iroha;\n}\n\n.qti-list-style-type-khmer {\n list-style-type: khmer;\n}\n\n.qti-list-style-type-korean-hangul-formal {\n list-style-type: korean-hangul-formal;\n}\n\n.qti-list-style-type-korean-hanja-formal {\n list-style-type: korean-hanja-formal;\n}\n\n.qti-list-style-type-korean-hanja-informal {\n list-style-type: korean-hanja-informal;\n}\n\n.qti-list-style-type-lao {\n list-style-type: lao;\n}\n\n.qti-list-style-type-malayalam {\n list-style-type: malayalam;\n}\n\n.qti-list-style-type-mongolian {\n list-style-type: mongolian;\n}\n\n.qti-list-style-type-myanmar {\n list-style-type: myanmar;\n}\n\n.qti-list-style-type-oriya {\n list-style-type: oriya;\n}\n\n.qti-list-style-type-persian {\n list-style-type: persian;\n}\n\n.qti-list-style-type-thai {\n list-style-type: thai;\n}\n\n.qti-list-style-type-tibetan {\n list-style-type: tibetan;\n}\n\n.qti-list-style-type-telugu {\n list-style-type: telugu;\n}\n\n.qti-list-style-type-urdu {\n list-style-type: urdu;\n}\n\n/* =========================\n Other QTI 3 Presentation Utilities\n ========================= */\n\n.qti-bordered {\n border: 1px solid var(--table-border-color);\n}\n\n.qti-underline {\n text-decoration: underline;\n text-decoration-color: var(--foreground);\n}\n\n.qti-italic {\n font-style: italic;\n}\n\n.qti-well {\n min-height: 20px;\n padding: 19px;\n margin-bottom: 20px;\n background-color: var(--well-bg);\n border: var(--well-border);\n border-radius: 4px;\n box-shadow: var(--well-box-shadow);\n}\n\n/* Set writing-mode to vertical-rl \n Typical for CJK vertical text */\n\n.qti-writing-mode-vertical-rl {\n writing-mode: vertical-rl;\n}\n\n/* Set writing-mode to vertical-lr\n Typical for Mongolian vertical text */\n\n.qti-writing-mode-vertical-lr {\n writing-mode: vertical-lr;\n}\n\n/* Set writing-mode to horizontal-tb \n Browser default */\n\n.qti-writing-mode-horizontal-tb {\n writing-mode: horizontal-tb;\n}\n\n/* Float an element left */\n\n.qti-float-left {\n float: left;\n}\n\n/* Float an element right */\n\n.qti-float-right {\n float: right;\n}\n\n/* Remove a float */\n\n.qti-float-none {\n float: none;\n}\n\n/* Clearfix Hack to apply to a container of \n floated content that overflows the container. */\n\n.qti-float-clearfix::after {\n content: '';\n clear: both;\n display: table;\n}\n\n.qti-float-clear-left\n .qti-float-clear-right\n .qti-float-clear-both\n \n /* Set text-orientation to upright */\n .qti-text-orientation-upright {\n text-orientation: upright;\n}\n\n@layer qti-base {\n .qti-layout-row {\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n gap: 2.1276595745%;\n }\n\n .qti-layout-row [class*='qti-layout-col']:not(:empty) {\n box-sizing: border-box;\n }\n\n .qti-layout-row [class*='qti-layout-col']:empty {\n width: 0;\n overflow: hidden; /* to fully collapse if there’s padding or borders */\n }\n\n .qti-layout-col1 {\n width: 6.3829787234%;\n }\n\n .qti-layout-col2 {\n width: 14.8936170213%;\n }\n\n .qti-layout-col3 {\n width: 23.4042553191%;\n }\n\n .qti-layout-col4 {\n width: 31.914893617%;\n }\n\n .qti-layout-col5 {\n width: 40.4255319149%;\n }\n\n .qti-layout-col6 {\n width: 48.9361702128%;\n }\n\n .qti-layout-col7 {\n width: 57.4468085106%;\n }\n\n .qti-layout-col8 {\n width: 65.9574468085%;\n }\n\n .qti-layout-col9 {\n width: 74.4680851064%;\n }\n\n .qti-layout-col10 {\n width: 82.9787234043%;\n }\n\n .qti-layout-col11 {\n width: 91.4893617021%;\n }\n\n .qti-layout-col12 {\n width: 100%;\n }\n\n .qti-layout-offset1 {\n margin-left: 8.5106382979%;\n }\n\n .qti-layout-offset2 {\n margin-left: 17.0212765957%;\n }\n\n .qti-layout-offset3 {\n margin-left: 25.5319148936%;\n }\n\n .qti-layout-offset4 {\n margin-left: 34.0425531915%;\n }\n\n .qti-layout-offset5 {\n margin-left: 42.5531914894%;\n }\n\n .qti-layout-offset6 {\n margin-left: 51.0638297872%;\n }\n\n .qti-layout-offset7 {\n margin-left: 59.5744680851%;\n }\n\n .qti-layout-offset8 {\n margin-left: 68.085106383%;\n }\n\n .qti-layout-offset9 {\n margin-left: 76.5957446809%;\n }\n\n .qti-layout-offset10 {\n margin-left: 85.1063829787%;\n }\n\n .qti-layout-offset11 {\n margin-left: 93.6170212766%;\n }\n\n .qti-layout-offset12 {\n margin-left: 102.1276595745%;\n }\n\n @media (width <= 767px) {\n [class*='qti-layout-col'] {\n width: 100%;\n }\n }\n}\n\n:root,\n:host {\n /* Active colors */\n --qti-bg-active: #ffecec;\n --qti-border-active: #f86d70;\n\n /* Correct colors */\n --qti-correct-light: #c8e6c9;\n --qti-correct: #66bb6a;\n\n /** Partially correct colors */\n --qti-partially-correct-light: #fff3e0;\n --qti-partially-correct: #ffeb3b;\n\n /* Incorrect colors */\n --qti-incorrect-light: #ef9a9a;\n --qti-incorrect: #ef5350;\n\n /* Validation colors */\n --qti-validation-error-bg: #fffbeb;\n --qti-validation-text: #92400e;\n\n /* Gap size */\n --qti-gap-size: 1rem;\n\n /* Background colors */\n --qti-bg: white;\n --qti-hover-bg: #f9fafb;\n\n /* Light theme colors */\n --qti-light-bg-active: #f0f0f0; /* Light gray */\n --qti-light-border-active: #d0d0d0; /* Medium gray */\n\n /* Dark theme colors */\n --qti-dark-bg-active: #1f2937; /* Dark gray */\n --qti-dark-border-active: #64748b; /* Medium gray */\n\n /* Disabled colors */\n --qti-disabled-bg: #f3f4f6;\n --qti-disabled-color: #45484f;\n\n /* Border properties */\n --qti-border-thickness: 2px;\n --qti-border-style: solid;\n --qti-border-color: #c6cad0;\n --qti-border-radius: 0.3rem;\n --qti-drop-border-radius: calc(var(--qti-border-radius) + var(--qti-border-thickness));\n\n /* Focus & active states */\n --qti-focus-border-width: 5px;\n --qti-focus-color: #bddcff7e;\n\n /* Class-specific variables */\n\n /* Form elements */\n --qti-form-size: 1rem;\n\n /* Order buttons */\n --qti-order-size: 2rem;\n\n /* Generic padding for all elements */\n --qti-padding-vertical: 0.5rem; /* py-2 */\n --qti-padding-horizontal: 0.5rem; /* px-2 */\n\n /* Dropzones */\n --qti-dropzone-padding: 0rem;\n}\n\n/* SVG masks and backgrounds */\n\n.chevron {\n background: url(\"data:image/svg+xml,%3Csvg fill='currentColor' width='22' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' aria-hidden='true'%3E%3Cpath clip-rule='evenodd' fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z'%3E%3C/path%3E%3C/svg%3E\")\n no-repeat center right 6px;\n}\n\n.handle {\n background-image: radial-gradient(\n circle at center,\n rgb(0 0 0 / 10%) 0,\n rgb(0 0 0 / 20%) 2px,\n rgb(255 255 255 / 0%) 2px,\n rgb(255 255 255 / 0%) 100%\n );\n background-repeat: repeat-y;\n background-position: left center;\n background-size: 14px 8px;\n}\n\n.check-mask {\n -webkit-mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E\");\n mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E\");\n}\n\n/*\n Following are classes that can be applied to elements and element states, so they are not used directly\n The @apply directive is used to apply these classes to elements\n*/\n\n/* Apply .bordered to an element */\n\n.bordered {\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n}\n\n/* Apply .form rules for checkbox and radiobutton */\n\n.form {\n\n /* background-color: var(--qti-bg); */\n display: grid;\n place-content: center;\n width: var(--qti-form-size);\n height: var(--qti-form-size);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n}\n\n/* Apply .button rules for button-like elements, such as drags and buttons */\n\n.button {\n\n border-radius: var(--qti-border-radius);\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n background: var(--qti-bg);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n}\n\n/* Apply .select for the select dropdown element */\n\n.select {\n\n border-radius: var(--qti-border-radius);\n position: relative;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n padding-right: calc(var(--qti-padding-horizontal) + 1.5rem); /* 1.5rem for the chevron */ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color); outline: none; background: url(\"data:image/svg+xml,%3Csvg fill='currentColor' width='22' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' aria-hidden='true'%3E%3Cpath clip-rule='evenodd' fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z'%3E%3C/path%3E%3C/svg%3E\")\n no-repeat center right 6px;\n}\n\n/* Apply .dropdown-trigger for button trigger controls */\n\n.dropdown-trigger {\n\n display: inline-flex;\n align-items: center;\n justify-content: space-between;\n gap: 0.5rem;\n border-radius: var(--qti-border-radius);\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n background: var(--qti-bg);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n}\n\n/* Apply .dropdown-menu for popover and listbox containers */\n\n.dropdown-menu {\n background: var(--qti-bg);\n border-radius: var(--qti-border-radius);\n padding: 0.25rem;\n box-sizing: border-box;\n overflow: auto;\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n}\n\n/* Apply .dropdown-option for listbox option rows */\n\n.dropdown-option {\n display: flex;\n align-items: center;\n width: 100%;\n min-height: 2.25rem;\n box-sizing: border-box;\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n border: 0;\n border-radius: calc(var(--qti-border-radius) - 2px);\n background: transparent;\n text-align: left;\n font: inherit;\n color: inherit;\n cursor: pointer;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n/* Apply .dropdown-icon for trigger caret indicators */\n\n.dropdown-icon {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: 0 0 auto;\n transition: transform 150ms ease;\n transform-origin: 50% 50%;\n color: var(--qti-border-color);\n line-height: 1;\n}\n\n/* Apply .dropdown-icon-open for expanded trigger caret indicators */\n\n.dropdown-icon-open {\n transform: rotate(180deg);\n color: var(--qti-border-active);\n}\n\n/* Apply .text for the input text and textarea */\n\n.text {\n border-radius: 0;\n cursor: text;\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n background: var(--qti-bg);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n}\n\n/* Apply .spot for hotspot shapes */\n\n.spot {\n\n width: 100%;\n height: 100%;\n background-color: transparent;\n margin: 0 !important;\n padding: 0 !important;\n border: 0 !important;\n box-sizing: border-box !important;\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n}\n\n/* Apply .point for circular small hotspots */\n\n.point {\n\n box-sizing: border-box;\n border-radius: 100%;\n border: 1px solid white;\n background-color: black;\n opacity: 0.5;\n padding: 0;\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n}\n\n/* Apply .drag for draggable elements */\n\n.drag {\n\n box-sizing: border-box;\n transition:\n transform 200ms ease-out,\n box-shadow 200ms ease-out,\n rotate 200ms ease-out;\n cursor: grab;\n background-color: var(--qti-bg);\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n border-radius: var(--qti-border-radius);\n\n /* padding-left: calc(var(--qti-padding-horizontal) + 0.5rem) !important; */\n\n /* 1.5rem for the drag */\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none;\n}\n\n/* Apply .dragging for the dragging state of a draggable element */\n\n.dragging {\n pointer-events: none;\n rotate: -2deg;\n box-shadow:\n 0 8px 12px rgb(0 0 0 / 20%),\n 0 4px 8px rgb(0 0 0 / 10%);\n}\n\n/* Apply .drop for an element where you can drop the draggable */\n\n.drop {\n /* @apply bordered; */\n border: var(--qti-border-thickness) dashed var(--qti-border-color);\n background: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\"><circle cx=\"10\" cy=\"10\" r=\"7\" stroke=\"%23CCCCCC\" stroke-width=\"1\" fill=\"transparent\" /></svg>')\n center no-repeat;\n border-radius: var(--qti-border-radius);\n position: relative;\n background-color: var(--qti-bg);\n}\n\n/* Apply .dropping for an indicator where you can drop the draggable */\n\n.dropping {\n background-color: var(--qti-bg-active);\n}\n\n/* Apply .order for a small circular button */\n\n.order {\n\n display: grid;\n place-content: center;\n\n /* background-color: var(--qti-bg-active); */\n box-sizing: border-box;\n border-radius: 100%;\n width: var(--qti-order-size);\n height: var(--qti-order-size);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n}\n\n/* Apply .check-size for radio and checkbox size */\n\n.check-size {\n width: calc(var(--qti-form-size) - 6px);\n height: calc(var(--qti-form-size) - 6px);\n}\n\n/* Apply .check for checkbox */\n\n.check {\n gap: 0.5rem;\n background-color: var(--qti-bg);\n border-radius: var(--qti-border-radius);\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n outline: none;\n cursor: pointer;\n}\n\n.validation-message {\n display: none;\n color: var(--qti-validation-text, #000);\n background-color: var(--qti-validation-error-bg, #fff);\n padding: 10px;\n border: 3px solid var(--qti-validation-text, #000);\n border-radius: 4px;\n margin-top: 8px;\n}\n\n/* Apply .check-radio for outer circle of the radio buttons */\n\n.check-radio {\n\n border-radius: 100%;\n\n display: grid;\n\n place-content: center;\n\n width: var(--qti-form-size);\n\n height: var(--qti-form-size);\n\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n outline: none;\n}\n\n/* Apply .check-radio-checked for the inner checked radio */\n\n.check-radio-checked {\n background-color: var(--qti-border-active);\n border-radius: 100%;\n}\n\n/* Apply .check-checkbox for outer square of the checkbox */\n\n.check-checkbox {\n\n display: flex;\n place-items: center;\n border-radius: var(--qti-border-radius);\n display: grid;\n place-content: center;\n width: var(--qti-form-size);\n height: var(--qti-form-size);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n}\n\n/* Apply .check-checkbox-checked for the inner checkmark */\n\n.check-checkbox-checked {\n background-color: var(--qti-border-active);\n -webkit-mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E\");\n mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E\");\n}\n\n/* Apply .hov for hover state */\n\n.hov {\n /* background-color: var(--qti-hover-bg); */\n}\n\n/* Apply .foc for focus state */\n\n.foc {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n}\n\n/* Apply .act for active state */\n\n.act {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n}\n\n.act-bg {\n background-color: var(--qti-bg-active);\n}\n\n.act-bor {\n border-color: var(--qti-border-active);\n}\n\n/* Apply .rdo for readonly state */\n\n.rdo {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n}\n\n/* Apply .dis for disabled state */\n\n.dis {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n}\n\n@layer qti-components {\n qti-choice-interaction {\n &::part(message) {\n display: none;\n color: var(--qti-validation-text, #000);\n background-color: var(--qti-validation-error-bg, #fff);\n padding: 10px;\n border: 3px solid var(--qti-validation-text, #000);\n border-radius: 4px;\n margin-top: 8px;\n }\n\n &.qti-input-control-hidden {\n & qti-simple-choice {\n position: relative;\n &:hover {\n }\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n &::part(ch) {\n display: none;\n }\n &:state(--checked),\n &[aria-checked='true'] {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n &:state(readonly),\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n &:state(disabled),\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n &:state(correct-response),\n &[data-correct-response='true'] {\n border: 3px solid var(--qti-correct) !important;\n padding-right: 30px;\n &::after {\n content: '\\02714';\n color: var(--qti-correct);\n position: absolute;\n top: 5px;\n right: 5px;\n font-size: 1.2em;\n font-weight: bold;\n }\n }\n border-radius: var(--qti-border-radius);\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n background: var(--qti-bg);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none\n }\n }\n\n &:not(.qti-input-control-hidden) {\n & qti-simple-choice {\n &:not([aria-disabled='true'], [aria-readonly='true'], :state(--checked)):hover {\n }\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n &:state(--checked),\n &[aria-checked='true'] {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n &:state(candidate-correct) {\n background-color: var(--qti-correct);\n }\n &:state(candidate-incorrect) {\n background-color: var(--qti-incorrect);\n }\n &:state(readonly),\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n &:state(disabled),\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n &::part(cha) {\n width: calc(var(--qti-form-size) - 6px);\n height: calc(var(--qti-form-size) - 6px);\n }\n &:state(radio)::part(ch) {\n border-radius: 100%;\n display: grid;\n place-content: center;\n width: var(--qti-form-size);\n height: var(--qti-form-size);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n }\n &:state(radio):state(--checked)::part(cha) {\n background-color: var(--qti-border-active);\n border-radius: 100%;\n }\n &:state(checkbox)::part(ch) {\n display: flex;\n place-items: center;\n border-radius: var(--qti-border-radius);\n display: grid;\n place-content: center;\n width: var(--qti-form-size);\n height: var(--qti-form-size);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n }\n &:state(checkbox):state(--checked)::part(cha) {\n background-color: var(--qti-border-active);\n -webkit-mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E\");\n mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E\");\n }\n gap: 0.5rem;\n background-color: var(--qti-bg);\n border-radius: var(--qti-border-radius);\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n outline: none;\n cursor: pointer\n }\n }\n\n & qti-simple-choice {\n width: -moz-fit-content;\n width: fit-content;\n cursor: pointer;\n &:state(correct-response),\n &[data-correct-response='true'] {\n &::after {\n content: '\\02714';\n color: var(--qti-correct);\n }\n }\n }\n\n & qti-simple-choice > p {\n margin: 0 !important;\n padding: 0 !important;\n }\n }\n}\n\n@layer qti-components {\n qti-graphic-gap-match-interaction {\n &::part(message) {\n display: none;\n color: var(--qti-validation-text, #000);\n background-color: var(--qti-validation-error-bg, #fff);\n padding: 10px;\n border: 3px solid var(--qti-validation-text, #000);\n border-radius: 4px;\n margin-top: 8px;\n }\n position: relative;\n &.qti-selections-light {\n &:state(--dragzone-active)::part(drags) {\n background-color: var(--qti-light-bg-active);\n border-color: var(--qti-light-border-active);\n }\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-light-bg-active);\n }\n }\n &.qti-selections-dark {\n &:state(--dragzone-active)::part(drags) {\n background-color: var(--qti-dark-bg-active);\n border-color: var(--qti-dark-border-active);\n }\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-dark-bg-active);\n }\n }\n &:state(--dragzone-active)::part(drags) {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-bg-active);\n }\n & qti-gap-img,\n qti-gap-text {\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: grab;\n }\n & qti-associable-hotspot {\n display: flex;\n justify-content: center;\n align-items: center;\n border: 2px solid transparent;\n &[enabled] {\n .qti-selections-light {\n background-color: var(--qti-light-bg-active);\n }\n .qti-selections-dark {\n background-color: var(--qti-dark-bg-active);\n }\n background-color: var(--qti-bg-active)\n }\n &[active] {\n .qti-selections-light {\n background-color: var(--qti-light-bg-active);\n border-color: var(--qti-light-border-active);\n }\n .qti-selections-dark {\n background-color: var(--qti-dark-bg-active);\n border-color: var(--qti-dark-border-active);\n }\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active)\n }\n &[disabled] {\n &:not(:empty) {\n cursor: default !important;\n }\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg)\n }\n &:not(:empty) {\n border-color: var(--qti-border) !important;\n }\n &:empty::after {\n padding: var(--qti-padding-md) var(--qti-padding-lg);\n content: '\\0000a0';\n }\n &:not(:empty) {\n padding: 0;\n width: auto;\n }\n &:not(:empty) > * {\n flex: 1;\n transform: rotate(0);\n box-shadow: 0 0 0 1px #e5e7eb;\n }\n }\n &.qti-selections-light qti-associable-hotspot:not(:empty) {\n background-color: var(--qti-light-bg-active) !important;\n border-color: var(--qti-light-border-active) !important;\n }\n &.qti-selections-dark qti-associable-hotspot:not(:empty) {\n background-color: var(--qti-dark-bg-active) !important;\n border-color: var(--qti-dark-border-active) !important;\n }\n & img {\n margin: 0;\n padding: 0;\n }\n }\n}\n\n@layer qti-components {\n qti-text-entry-interaction {\n &:state(candidate-correct) {\n &::part(input) {\n background-color: var(--qti-correct);\n }\n }\n &:state(candidate-partially-correct) {\n &::part(input) {\n background-color: var(--qti-partially-correct);\n }\n }\n &:state(candidate-incorrect) {\n &::part(input) {\n background-color: var(--qti-incorrect);\n }\n }\n &::part(input) {\n border-radius: 0;\n cursor: text;\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n background: var(--qti-bg);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n }\n &:hover {\n }\n &:focus-within {\n &::part(input) {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n border-color: var(--qti-border-active);\n }\n }\n }\n}\n\n@layer qti-components {\n qti-extended-text-interaction {\n &::part(textarea) {\n border-radius: 0;\n cursor: text;\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n background: var(--qti-bg);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n }\n &:hover {\n }\n &:focus-within {\n &::part(textarea) {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n border-color: var(--qti-border-active);\n }\n }\n }\n}\n\n@layer qti-components {\n qti-gap-match-interaction {\n &.qti-selections-light {\n &:state(--dragzone-active)::part(drags) {\n background-color: var(--qti-light-bg-active);\n border-color: var(--qti-light-border-active);\n }\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-light-bg-active);\n }\n }\n &.qti-selections-dark {\n &:state(--dragzone-active)::part(drags) {\n background-color: var(--qti-dark-bg-active);\n border-color: var(--qti-dark-border-active);\n }\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-dark-bg-active);\n }\n }\n &:state(--dragzone-active)::part(drags) {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-bg-active);\n }\n & qti-gap-text {\n &[dragging] {\n pointer-events: none;\n rotate: -2deg;\n box-shadow: 0 8px 12px rgb(0 0 0 / 20%),\n 0 4px 8px rgb(0 0 0 / 10%);\n }\n &:hover {\n }\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n &:state(candidate-correct) {\n background-color: var(--qti-correct);\n }\n &:state(candidate-incorrect) {\n background-color: var(--qti-incorrect);\n }\n box-sizing: border-box;\n transition: transform 200ms ease-out,\n box-shadow 200ms ease-out,\n rotate 200ms ease-out;\n cursor: grab;\n background-color: var(--qti-bg);\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n border-radius: var(--qti-border-radius);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none\n }\n & qti-gap {\n &[disabled] {\n &:not(:empty) {\n cursor: default !important;\n }\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg)\n }\n &[enabled] {\n .qti-selections-light {\n border-color: var(--qti-light-border-active);\n }\n .qti-selections-dark {\n border-color: var(--qti-dark-border-active);\n }\n background-color: var(--qti-bg-active)\n }\n &[active] {\n .qti-selections-light {\n background-color: var(--qti-light-bg-active);\n border-color: var(--qti-light-border-active);\n }\n .qti-selections-dark {\n background-color: var(--qti-dark-bg-active);\n border-color: var(--qti-dark-border-active);\n }\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active)\n }\n display: inline-flex;\n align-items: center;\n vertical-align: middle;\n &:empty::after {\n padding: var(--qti-padding-md) var(--qti-padding-lg);\n content: '\\0000a0';\n }\n &:not(:empty) {\n display: inline-flex;\n padding: 0;\n width: auto;\n }\n &:not(:empty) > * {\n flex: 1;\n transform: rotate(0);\n box-shadow: 0 0 0 1px #e5e7eb;\n }\n border: var(--qti-border-thickness) dashed var(--qti-border-color);\n background: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\"><circle cx=\"10\" cy=\"10\" r=\"7\" stroke=\"%23CCCCCC\" stroke-width=\"1\" fill=\"transparent\" /></svg>')\n center no-repeat;\n border-radius: var(--qti-border-radius);\n position: relative;\n background-color: var(--qti-bg)\n }\n }\n}\n\n@layer qti-components {\n qti-hotspot-interaction {\n & qti-hotspot-choice {\n &[shape='circle'] {\n &:hover {\n }\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n &:state(--checked),\n &[aria-checked='true'] {\n border-color: var(--qti-border-active);\n }\n &:state(--readonly),\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n &:state(--disabled),\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n width: 100%;\n height: 100%;\n background-color: transparent;\n margin: 0;\n padding: 0;\n border: 0;\n box-sizing: border-box;\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none\n }\n &[shape='rect'] {\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n &:state(--checked),\n &[aria-checked='true'] {\n border-color: var(--qti-border-active);\n }\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n width: 100%;\n height: 100%;\n background-color: transparent;\n margin: 0;\n padding: 0;\n border: 0;\n box-sizing: border-box;\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none\n }\n &[shape='poly'] {\n &:hover::after {\n content: '';\n width: 100%;\n height: 100%;\n background: repeating-linear-gradient(\n 45deg,\n var(--qti-border-active),\n var(--qti-border-active) 5px,\n transparent 5px,\n transparent 10px\n );\n display: block;\n }\n &:state(--checked)::after,\n &[aria-checked='true']::after {\n content: '';\n width: 100%;\n height: 100%;\n background: repeating-linear-gradient(\n 45deg,\n transparent,\n transparent 5px,\n var(--qti-border-active) 5px,\n var(--qti-border-active) 10px\n );\n display: block;\n }\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n }\n }\n }\n}\n\n@layer qti-components {\n qti-hottext-interaction {\n &::part(message) {\n display: none;\n color: var(--qti-validation-text, #000);\n background-color: var(--qti-validation-error-bg, #fff);\n padding: 10px;\n border: 3px solid var(--qti-validation-text, #000);\n border-radius: 4px;\n margin-top: 8px;\n }\n qti-hottext {\n display: inline-flex;\n align-items: center;\n &:hover {\n }\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n &::part(cha) {\n width: calc(var(--qti-form-size) - 6px);\n height: calc(var(--qti-form-size) - 6px);\n }\n &:state(radio)::part(ch) {\n border-radius: 100%;\n display: grid;\n place-content: center;\n width: var(--qti-form-size);\n height: var(--qti-form-size);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n }\n &:state(radio):state(--checked)::part(cha) {\n background-color: var(--qti-border-active);\n border-radius: 100%;\n }\n &:state(checkbox)::part(ch) {\n display: flex;\n place-items: center;\n border-radius: var(--qti-border-radius);\n display: grid;\n place-content: center;\n width: var(--qti-form-size);\n height: var(--qti-form-size);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n }\n &:state(checkbox):state(--checked)::part(cha) {\n background-color: var(--qti-border-active);\n -webkit-mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E\");\n mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E\");\n }\n &:state(correct-response),\n &[data-correct-response='true'] {\n &::after {\n content: '\\02714';\n color: #16a34a;\n }\n }\n gap: 0.5rem;\n background-color: var(--qti-bg);\n border-radius: var(--qti-border-radius);\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n outline: none;\n cursor: pointer\n }\n &.qti-input-control-hidden {\n qti-hottext {\n &:hover {\n }\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n &::part(ch) {\n display: none;\n }\n &:state(--checked) {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n border-radius: var(--qti-border-radius);\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n background: var(--qti-bg);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none\n }\n }\n &.qti-unselected-hidden {\n qti-hottext {\n &:hover {\n }\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n cursor: pointer;\n &::part(ch) {\n display: none;\n }\n &:state(--checked) {\n background-color: var(--qti-bg-active);\n }\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n }\n }\n }\n}\n\n@layer qti-components {\n qti-inline-choice-interaction {\n &:state(candidate-correct) {\n &::part(trigger) {\n background-color: var(--qti-correct);\n }\n }\n &:state(candidate-incorrect) {\n &::part(trigger) {\n background-color: var(--qti-incorrect);\n }\n }\n &::part(trigger) {\n font-size: inherit;\n vertical-align: baseline;\n min-width: var(--qti-calculated-min-width, auto);\n &:focus-visible {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n display: inline-flex;\n align-items: center;\n justify-content: space-between;\n gap: 0.5rem;\n border-radius: var(--qti-border-radius);\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n background: var(--qti-bg);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none\n }\n &:not(:state(readonly)):not([readonly])::part(trigger):hover {\n }\n &:state(disabled)::part(trigger),\n &[disabled]::part(trigger) {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n &:state(readonly)::part(trigger),\n &[readonly]::part(trigger) {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n &::part(dropdown-icon) {\n font-size: 1.75em;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: 0 0 auto;\n transition: transform 150ms ease;\n transform-origin: 50% 50%;\n color: var(--qti-border-color);\n line-height: 1;\n }\n &::part(dropdown-icon-open) {\n transform: rotate(180deg);\n color: var(--qti-border-active);\n }\n &::part(menu) {\n background: var(--qti-bg);\n border-radius: var(--qti-border-radius);\n padding: 0.25rem;\n box-sizing: border-box;\n overflow: auto;\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n }\n &::part(option) {\n display: flex;\n align-items: center;\n width: 100%;\n min-height: 2.25rem;\n box-sizing: border-box;\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n border: 0;\n border-radius: calc(var(--qti-border-radius) - 2px);\n background: transparent;\n text-align: left;\n font: inherit;\n color: inherit;\n cursor: pointer;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n &::part(option):hover {\n }\n &::part(option):focus-visible {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n &::part(option-selected) {\n background-color: var(--qti-bg-active);\n }\n & qti-inline-choice {\n display: flex;\n align-items: center;\n width: 100%;\n min-height: 2.25rem;\n box-sizing: border-box;\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n border: 0;\n border-radius: calc(var(--qti-border-radius) - 2px);\n background: transparent;\n text-align: left;\n font: inherit;\n color: inherit;\n cursor: pointer;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n & qti-inline-choice:hover {\n }\n & qti-inline-choice:focus-visible {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n & qti-inline-choice:state(--checked) {\n background-color: var(--qti-bg-active);\n }\n }\n}\n\n@layer qti-components {\n qti-match-interaction.qti-match-tabular {\n &::part(message) {\n display: none;\n color: var(--qti-validation-text, #000);\n background-color: var(--qti-validation-error-bg, #fff);\n padding: 10px;\n border: 3px solid var(--qti-validation-text, #000);\n border-radius: 4px;\n margin-top: 8px;\n }\n &::part(table) {\n border-collapse: collapse;\n width: 100%;\n }\n &::part(r-header) {\n background-color: var(--qti-bg-active, #f8f8f8);\n font-weight: 500;\n text-align: center;\n padding: 8px 15px;\n border: 1px solid #ddd;\n width: auto;\n word-wrap: break-word;\n white-space: wrap;\n min-width: 4rem;\n }\n &::part(c-header) {\n background-color: var(--qti-bg-active, #f8f8f8);\n font-weight: 500;\n text-align: left;\n padding: 8px;\n border: 1px solid #ddd;\n width: 8rem;\n white-space: normal;\n }\n &::part(row) {\n border-bottom: 1px solid #ddd;\n }\n &::part(input-cell) {\n text-align: center;\n vertical-align: middle;\n height: 48px;\n border: 1px solid #ddd;\n padding: 8px;\n width: 1%;\n }\n &::part(rb) {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n border: 2px solid var(--qti-border-active, #2196f3);\n background-color: transparent !important;\n margin: 0 auto;\n cursor: pointer;\n display: block;\n }\n &::part(rb-checked) {\n box-shadow: inset 0 0 0 6px var(--qti-border-active, #2196f3);\n }\n &::part(cb) {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n width: 24px;\n height: 24px;\n border-radius: 3px;\n border: 2px solid var(--qti-border-active, #2196f3);\n background-color: transparent !important;\n margin: 0 auto;\n cursor: pointer;\n display: block;\n }\n &::part(cb-checked) {\n background-color: var(--qti-border-active, #2196f3) !important;\n }\n &::part(checkmark) {\n position: absolute;\n width: 18px;\n height: 18px;\n top: 3px;\n left: 3px;\n pointer-events: none;\n }\n &::part(rb-correct) {\n border-color: var(--qti-correct, #4caf50);\n }\n &::part(rb-checked rb-correct) {\n box-shadow: inset 0 0 0 6px var(--qti-correct, #4caf50);\n }\n &::part(cb-correct) {\n border-color: var(--qti-correct, #4caf50);\n }\n &::part(cb-checked cb-correct) {\n background-color: var(--qti-correct, #4caf50) !important;\n }\n &::part(rb-incorrect) {\n border-color: var(--qti-incorrect, #f44336);\n }\n &::part(rb-checked rb-incorrect) {\n box-shadow: inset 0 0 0 6px var(--qti-incorrect, #f44336);\n }\n &::part(cb-incorrect) {\n border-color: var(--qti-incorrect, #f44336);\n }\n &::part(cb-checked cb-incorrect) {\n background-color: var(--qti-incorrect, #f44336) !important;\n }\n }\n qti-match-interaction:not(.qti-match-tabular) {\n &:state(--dragzone-enabled) qti-simple-match-set:first-of-type {\n background-color: var(--qti-bg-active);\n }\n &:state(--dragzone-active) qti-simple-match-set:first-of-type {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n & qti-simple-match-set:first-of-type {\n display: flex;\n flex-wrap: wrap;\n align-items: flex-start;\n gap: var(--qti-gap-size);\n border: 2px solid transparent;\n & qti-simple-associable-choice {\n &[dragging] {\n pointer-events: none;\n rotate: -2deg;\n box-shadow: 0 8px 12px rgb(0 0 0 / 20%),\n 0 4px 8px rgb(0 0 0 / 10%);\n }\n &:hover {\n }\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n box-sizing: border-box;\n transition: transform 200ms ease-out,\n box-shadow 200ms ease-out,\n rotate 200ms ease-out;\n cursor: grab;\n background-color: var(--qti-bg);\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n border-radius: var(--qti-border-radius);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none\n }\n }\n & qti-simple-match-set:last-of-type {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));\n grid-auto-flow: unset;\n grid-auto-columns: unset;\n gap: var(--qti-gap-size);\n & > qti-simple-associable-choice {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n grid-row: unset;\n box-sizing: border-box;\n & img {\n max-width: 100%;\n height: auto;\n }\n &[enabled] {\n &::part(dropslot) {\n background-color: var(--qti-bg-active);\n }\n }\n &[disabled] {\n &::part(dropslot) {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n }\n &[active] {\n &::part(dropslot) {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n }\n &::part(dropslot) {\n &[dragging] {\n pointer-events: none;\n rotate: -2deg;\n box-shadow: 0 8px 12px rgb(0 0 0 / 20%),\n 0 4px 8px rgb(0 0 0 / 10%);\n }\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n padding: var(--qti-dropzone-padding);\n margin-top: 0.5rem;\n gap: 0.5rem;\n display: flex;\n flex-wrap: wrap;\n justify-content: center;\n align-items: center;\n border: var(--qti-border-thickness) dashed var(--qti-border-color);\n background: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\"><circle cx=\"10\" cy=\"10\" r=\"7\" stroke=\"%23CCCCCC\" stroke-width=\"1\" fill=\"transparent\" /></svg>')\n center no-repeat;\n border-radius: var(--qti-border-radius);\n position: relative;\n background-color: var(--qti-bg);\n }\n & > *:not(qti-simple-associable-choice) {\n pointer-events: none;\n }\n & > qti-simple-associable-choice {\n &:state(candidate-correct) {\n background-color: var(--qti-correct);\n }\n &:state(candidate-incorrect) {\n background-color: var(--qti-incorrect);\n }\n &::part(dropslot) {\n display: none;\n }\n &:hover {\n }\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n flex-basis: fit-content;\n box-sizing: border-box;\n transition: transform 200ms ease-out,\n box-shadow 200ms ease-out,\n rotate 200ms ease-out;\n cursor: grab;\n background-color: var(--qti-bg);\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n border-radius: var(--qti-border-radius);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n }\n }\n }\n }\n}\n\n@layer qti-components {\n qti-order-interaction {\n &:state(--dragzone-active)::part(drags) {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-bg-active);\n }\n &::part(qti-simple-choice),\n & qti-simple-choice {\n &[dragging] {\n pointer-events: none;\n rotate: -2deg;\n box-shadow: 0 8px 12px rgb(0 0 0 / 20%),\n 0 4px 8px rgb(0 0 0 / 10%);\n }\n &:hover {\n }\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n box-sizing: border-box;\n transition: transform 200ms ease-out,\n box-shadow 200ms ease-out,\n rotate 200ms ease-out;\n cursor: grab;\n background-color: var(--qti-bg);\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n border-radius: var(--qti-border-radius);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none\n }\n &::part(qti-simple-choice) {\n display: flex;\n overflow: hidden;\n align-items: center;\n width: 100%;\n text-overflow: ellipsis;\n }\n &::part(drops) {\n gap: 0.5rem;\n }\n &::part(drags) {\n gap: 0.5rem;\n }\n &::part(drop-list) {\n &[enabled] {\n .qti-selections-light {\n border-color: var(--qti-light-border-active);\n }\n .qti-selections-dark {\n border-color: var(--qti-dark-border-active);\n }\n background-color: var(--qti-bg-active)\n }\n &:hover {\n }\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n display: flex;\n min-height: 4rem;\n border: var(--qti-border-thickness) dashed var(--qti-border-color);\n background: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\"><circle cx=\"10\" cy=\"10\" r=\"7\" stroke=\"%23CCCCCC\" stroke-width=\"1\" fill=\"transparent\" /></svg>')\n center no-repeat;\n border-radius: var(--qti-border-radius);\n position: relative;\n background-color: var(--qti-bg);\n }\n &::part(active) {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n & drop-list {\n &[shape='circle'] {\n &:hover {\n }\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n &[aria-checked='true'] {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n width: 100%;\n height: 100%;\n background-color: transparent;\n margin: 0;\n padding: 0;\n border: 0;\n box-sizing: border-box;\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none\n }\n &[shape='square'] {\n &:hover {\n }\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n &[aria-checked='true'] {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n width: 100%;\n height: 100%;\n background-color: transparent;\n margin: 0;\n padding: 0;\n border: 0;\n box-sizing: border-box;\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none\n }\n }\n }\n}\n\n@layer qti-components {\n qti-associate-interaction {\n &::part(message) {\n display: none;\n color: var(--qti-validation-text, #000);\n background-color: var(--qti-validation-error-bg, #fff);\n padding: 10px;\n border: 3px solid var(--qti-validation-text, #000);\n border-radius: 4px;\n margin-top: 8px;\n }\n &:state(--dragzone-active) slot[name='qti-simple-associable-choice'] {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n &:state(--dragzone-enabled) slot[name='qti-simple-associable-choice'] {\n background-color: var(--qti-bg-active);\n }\n & qti-simple-associable-choice,\n &::part(qti-simple-associable-choice) {\n &:hover {\n }\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n &[dragging] {\n pointer-events: none;\n rotate: -2deg;\n box-shadow: 0 8px 12px rgb(0 0 0 / 20%),\n 0 4px 8px rgb(0 0 0 / 10%);\n }\n box-sizing: border-box;\n transition: transform 200ms ease-out,\n box-shadow 200ms ease-out,\n rotate 200ms ease-out;\n cursor: grab;\n background-color: var(--qti-bg);\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n border-radius: var(--qti-border-radius);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none\n }\n &::part(drop-list) {\n display: grid;\n height: 3rem;\n min-width: 10rem;\n border: var(--qti-border-thickness) dashed var(--qti-border-color);\n background: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\"><circle cx=\"10\" cy=\"10\" r=\"7\" stroke=\"%23CCCCCC\" stroke-width=\"1\" fill=\"transparent\" /></svg>')\n center no-repeat;\n border-radius: var(--qti-border-radius);\n position: relative;\n background-color: var(--qti-bg);\n }\n &::part(drop-list):focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n &::part(drop-list)[dragging] {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n }\n}\n\n@layer qti-components {\n qti-graphic-order-interaction {\n &::part(message) {\n display: none;\n color: var(--qti-validation-text, #000);\n background-color: var(--qti-validation-error-bg, #fff);\n padding: 10px;\n border: 3px solid var(--qti-validation-text, #000);\n border-radius: 4px;\n margin-top: 8px;\n }\n & qti-hotspot-choice {\n width: 100%;\n height: 100%;\n background-color: rgb(128 128 128 / 30%);\n padding: 0;\n &:hover {\n background-color: rgb(128 128 128 / 70%);\n }\n &:focus {\n background-color: rgb(128 128 128 / 70%);\n }\n &:state(--checked),\n &[aria-checked='true'] {\n background-color: rgb(128 128 128 / 70%);\n }\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n &[aria-ordervalue] {\n display: grid;\n place-content: center;\n }\n &[aria-ordervalue]::after {\n content: attr(aria-ordervalue) !important;\n }\n &[aria-ordercorrectvalue] {\n display: grid;\n place-content: center;\n }\n &[aria-ordercorrectvalue][aria-ordervalue]::after {\n content: 'C=' attr(aria-ordercorrectvalue) ' R=' attr(aria-ordervalue) !important;\n color: var(--qti-correct);\n }\n &[aria-ordercorrectvalue]:not([aria-ordervalue])::after {\n content: 'C=' attr(aria-ordercorrectvalue) !important;\n color: var(--qti-correct);\n }\n }\n &.qti-selections-light {\n &:state(--dragzone-active)::part(drags) {\n background-color: var(--qti-light-bg-active);\n border-color: var(--qti-light-border-active);\n }\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-light-bg-active);\n }\n }\n &.qti-selections-dark {\n &:state(--dragzone-active)::part(drags) {\n background-color: var(--qti-dark-bg-active);\n border-color: var(--qti-dark-border-active);\n }\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-dark-bg-active);\n }\n }\n &:state(--dragzone-active)::part(drags) {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-bg-active);\n }\n }\n}\n\n@layer qti-components {\n qti-graphic-associate-interaction {\n &::part(message) {\n display: none;\n color: var(--qti-validation-text, #000);\n background-color: var(--qti-validation-error-bg, #fff);\n padding: 10px;\n border: 3px solid var(--qti-validation-text, #000);\n border-radius: 4px;\n margin-top: 8px;\n }\n position: relative;\n display: block;\n & qti-associable-hotspot {\n &[shape='circle'] {\n &:hover {\n }\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n &[aria-checked='true'] {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n width: 100%;\n height: 100%;\n background-color: transparent;\n margin: 0;\n padding: 0;\n border: 0;\n box-sizing: border-box;\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none\n }\n &[shape='square'] {\n &:hover {\n }\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n &[aria-checked='true'] {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n &[aria-readonly='true'] {\n cursor: pointer;\n background-color: var(--qti-bg);\n outline: 0;\n border: none;\n }\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n border-color: var(--qti-border-color);\n outline: 4px solid var(--qti-disabled-bg);\n }\n width: 100%;\n height: 100%;\n background-color: transparent;\n margin: 0;\n padding: 0;\n border: 0;\n box-sizing: border-box;\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none\n }\n }\n &.qti-selections-light {\n &:state(--dragzone-active)::part(drags) {\n background-color: var(--qti-light-bg-active);\n border-color: var(--qti-light-border-active);\n }\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-light-bg-active);\n }\n }\n &.qti-selections-dark {\n &:state(--dragzone-active)::part(drags) {\n background-color: var(--qti-dark-bg-active);\n border-color: var(--qti-dark-border-active);\n }\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-dark-bg-active);\n }\n }\n &:state(--dragzone-active)::part(drags) {\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n &:state(--dragzone-enabled)::part(drags) {\n background-color: var(--qti-bg-active);\n }\n }\n}\n\n@layer qti-components {\n qti-slider-interaction {\n --qti-tick-color: rgb(229 231 235 / 100%);\n --qti-tick-width: 1px;\n }\n}\n\n@layer qti-components {\n qti-select-point-interaction {\n &::part(point) {\n &:hover {\n }\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n box-sizing: border-box;\n border-radius: 100%;\n border: 1px solid white;\n background-color: black;\n opacity: 0.5;\n padding: 0;\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n outline: none;\n }\n &::part(correct) {\n background-color: var(--qti-correct);\n }\n &::part(incorrect) {\n background-color: var(--qti-incorrect);\n }\n }\n}\n\n@layer qti-components {\n qti-position-object-stage {\n & qti-position-object-interaction {\n /* no styles necessary, only layout styles, defined in the component */\n }\n }\n}\n\n@layer qti-components {\n qti-prompt {\n margin: 0.5rem 0;\n display: block;\n width: 100%;\n }\n}\n\n[view],\nqti-outcome-declaration,\nqti-response-declaration {\n display: none;\n}\n\n[view].show {\n display: block;\n}\n\n:host {\n box-sizing: border-box;\n}\n\nqti-test-part:not(:has(qti-assessment-item)),\nqti-assessment-section:not(:has(qti-assessment-item)),\nqti-assessment-item-ref:not(:has(qti-assessment-item)) {\n display: none;\n}\n\ndiv.full-correct-response {\n border: 1px solid #39a7c0;\n background-color: #d9e8ee;\n}\n\ndiv.full-correct-response-block {\n display: block;\n margin-top: var(--qti-padding-vertical);\n padding: 0.5rem;\n}\n\ndiv.full-correct-response-inline {\n display: inline-block;\n margin-left: var(--qti-padding-horizontal);\n margin-right: var(--qti-padding-horizontal);\n padding: 0.2rem;\n}\n";var ck,cx,c_,cE,cC=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,cx);t.testURL=null;t.testDoc=null;t.testXML=null;t.qtiContext={QTI_CONTEXT:{testIdentifier:"",candidateIdentifier:"",environmentIdentifier:"default"}};rB(t,ck,null);return t}d(e,[{key:"handleTestURLChange",value:function t(){return a(function(){var t,e,n,i,o,a,s,l;return $(this,function(u){switch(u.label){case 0:if(!this.testURL)return[3,7];u.label=1;case 1:u.trys.push([1,6,,7]);n=(e=this.qtiContext)===null||e===void 0?void 0:(t=e.QTI_CONTEXT)===null||t===void 0?void 0:t.seed;return[4,aP().load(this.testURL)];case 2:i=u.sent().shuffleOrdering(n),o=this.closest("qti-test");if(!(o===null||o===void 0?void 0:o.postLoadTestTransformCallback))return[3,5];a=i.htmlDoc().querySelector("qti-assessment-test");s=a;if(!s)return[3,4];return[4,o.postLoadTestTransformCallback(i,a)];case 3:s=i=u.sent();u.label=4;case 4:s;u.label=5;case 5:this.testDoc=i.htmlDoc();return[3,7];case 6:l=u.sent();console.error("Error loading or parsing XML:",l);return[3,7];case 7:return[2]}})}).call(this)}},{key:"handleTestXMLChange",value:function t(){if(this.testXML)try{this.testDoc=aP().parse(this.testXML).htmlDoc()}catch(t){console.error("Error parsing XML:",t)}}},{key:"connectedCallback",value:function t(){var t=this;var n=this,i=function n(){return f(p(e.prototype),"connectedCallback",t)};return a(function(){return $(this,function(t){i().call(n),rQ(this,cx,c_).call(this),rQ(this,cx,cE).call(this),this.testURL&&this.handleTestURLChange(),this.testXML&&this.handleTestXMLChange();return[2]})}).call(this)}},{key:"render",value:function t(){return ol(tF(),rz(this,ck),cw(this.testDoc,ol(tj())))}}]);return e}(oR);ck=new WeakMap,cx=new WeakSet,c_=function t(){var t=this.querySelector("template");rH(this,ck,t?t.content:ol(tz()))},cE=function t(){var t=new CSSStyleSheet;t.replaceSync(cq),this.shadowRoot.adoptedStyleSheets=[t]},rj([o({type:String,attribute:"test-url"})],cC.prototype,"testURL",2),rj([u()],cC.prototype,"testDoc",2),rj([u()],cC.prototype,"testXML",2),rj([u(),e({context:oF,subscribe:!0})],cC.prototype,"qtiContext",2),rj([y("testURL",{waitUntilFirstUpdate:!0})],cC.prototype,"handleTestURLChange",1),rj([y("testXML",{waitUntilFirstUpdate:!0})],cC.prototype,"handleTestXMLChange",1),cC=rj([oT("test-container")],cC);var cS=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){var t;var e=(t=this.computedContext)===null||t===void 0?void 0:t.testParts.flatMap(function(t){return t.sections.flatMap(function(t){return t.items})}).find(function(t){return t.active});if(!e||!e.variables)return ol(tB());var n=e.variables.filter(function(t){return t.type==="response"}),i=e.variables.filter(function(t){return t.type==="outcome"}),o=function t(t,e){return ol(tQ(),e,t.map(function(t){var e,n,i,o;var a=t.correctResponse?Array.isArray(t.correctResponse)?t.correctResponse.join(", "):t.correctResponse:"",s=((n=t.mapping)===null||n===void 0?void 0:(e=n.mapEntries)===null||e===void 0?void 0:e.map(function(t){return"".concat(t.mapKey,"=").concat(t.mappedValue,"pt")}).join(", "))||"",l=((o=t.areaMapping)===null||o===void 0?void 0:(i=o.areaMapEntries)===null||i===void 0?void 0:i.map(function(t){return"".concat(t.shape,"(").concat(t.coords,")=").concat(t.mappedValue,"pt")}).join(", "))||"";return ol(tH(),t.identifier,Array.isArray(t.value)?t.value.join(", "):t.value,t.cardinality,t.baseType,a||s||l)}))};return ol(tX(),o(n,"Response Variables"),o(i,"Outcome Variables"))}}]);return e}(oR);cS.styles=iM(tG()),rj([e({context:oU,subscribe:!0})],cS.prototype,"computedContext",2),cS=rj([oT("test-print-item-variables")],cS);var cA,cR=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e);rB(t,cA);rH(t,cA,t.attachInternals()),rz(t,cA).ariaLabel="pagination";return t}d(e,[{key:"createRenderRoot",value:function t(){return this}},{key:"connectedCallback",value:function t(){f(p(e.prototype),"connectedCallback",this).call(this);var t=this.querySelector("template");this.myTemplate=cl(t)}},{key:"render",value:function t(){var t=this;if(!this.computedContext)return ol(tJ());var e=this.computedContext.testParts.flatMap(function(t){return t.sections});return ol(tY(),e.map(function(e){return t.myTemplate({item:e})}))}}]);return e}(oR);cA=new WeakMap,rj([e({context:oU,subscribe:!0})],cR.prototype,"computedContext",2),cR=rj([oT("test-section-buttons-stamp")],cR);var cI,cT,cM=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e);rB(t,cI);t.sectionId=null;t.addEventListener("click",function(){return rQ(t,cI,cT).call(t,t.sectionId)});return t}d(e,[{key:"render",value:function t(){return ol(tK())}}]);return e}(oR);cI=new WeakSet,cT=function t(t){this.dispatchEvent(new CustomEvent("qti-request-navigation",{composed:!0,bubbles:!0,detail:{type:"section",id:t}}))},cM.styles=iM(tZ(),s8,s7),rj([o({type:String,attribute:"section-id"})],cM.prototype,"sectionId",2),cM=rj([oT("test-section-link")],cM);var cP=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){return ol(t0(),JSON.stringify(this.computedContext,null,2))}}]);return e}(oR);rj([u(),e({context:oU,subscribe:!0})],cP.prototype,"computedContext",2),cP=rj([oT("test-print-context")],cP);var cO=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.debug=!1;t.stampContext={view:"candidate",activeItem:{},activeSection:{items:[]},activeTestpart:{items:[],sections:[]},test:{}};return t}d(e,[{key:"createRenderRoot",value:function t(){return this}},{key:"connectedCallback",value:function t(){f(p(e.prototype),"connectedCallback",this).call(this);var t=this.querySelector("template");if(!t){this.myTemplate=null;return}this.myTemplate=cl(t)}},{key:"willUpdate",value:function t(t){if(!this.computedContext)return;var e=this.computedContext.testParts.find(function(t){return t.active}),n=e===null||e===void 0?void 0:e.sections.find(function(t){return t.active}),i=n===null||n===void 0?void 0:n.items.find(function(t){return t.active}),o=i||{},a=o.variables,s=E(o,["variables"]);if(!e||!n||!i)return;var l=_(k({},e),{items:e.sections.flatMap(function(t){return t.items.map(function(t){var e=t.variables,n=E(t,["variables"]);return n})}),sections:e.sections.map(function(t){return _(k({},t),{items:t.items.map(function(t){var e=t.variables,n=E(t,["variables"]);return n})})})}),u=_(k({},n),{items:n.items.map(function(t){var e=t.variables,n=E(t,["variables"]);return n})}),c=this.computedContext,d=c.testParts,h=E(c,["testParts"]);this.stampContext={view:this.computedContext.view,activeItem:s,activeSection:u,activeTestpart:l,test:h},this.dispatchEvent(new CustomEvent("qti-stamp-context-updated",{detail:this.stampContext,bubbles:!0}))}},{key:"render",value:function t(){return ol(t2(),this.debug?ol(t1(),JSON.stringify(this.stampContext,null,2)):oh,this.myTemplate?this.myTemplate(this.stampContext):oh)}}]);return e}(oR);rj([o({type:Boolean,reflect:!0})],cO.prototype,"debug",2),rj([u(),e({context:oU,subscribe:!0})],cO.prototype,"computedContext",2),rj([u()],cO.prototype,"stampContext",2),cO=rj([oT("test-stamp")],cO);var cN,cU,cL=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e);rB(t,cN);t.view="";t.disabled=!1;t.myTemplate=null;t.addEventListener("click",function(e){var n=e.target,i=parseFloat(n.value);n.tagName==="INPUT"&&rQ(t,cN,cU).call(t,i)});return t}d(e,[{key:"createRenderRoot",value:function t(){return this}},{key:"connectedCallback",value:function t(){f(p(e.prototype),"connectedCallback",this).call(this);var t=this.querySelector("template");if(!t){this.myTemplate=null;return}this.myTemplate=cl(t)}},{key:"render",value:function t(){var t,e;var n=(t=this.computedContext)===null||t===void 0?void 0:t.testParts.flatMap(function(t){return t.sections.flatMap(function(t){return t.items})}).find(function(t){return t.active});if(!n||!n.variables)return ol(t3());var i=(e=n.variables.find(function(t){return t.identifier=="MAXSCORE"}))===null||e===void 0?void 0:e.value,o=n.variables.find(function(t){return t.identifier=="SCORE"}),a=o===null||o===void 0?void 0:o.value,s=(o===null||o===void 0?void 0:o.externalScored)!=="human";if(!i||!o)return oh;var l=N(Array(Number(i)+1).keys());return ol(t5(),this.myTemplate?this.myTemplate({scores:l,score:a,disabled:s}):oh)}}]);return e}(oR);cN=new WeakSet,cU=function t(t){var e,n;var i=(e=((n=this.computedContext)===null||n===void 0?void 0:n.testParts.find(function(t){return t.active})).sections.flatMap(function(t){return t.items}).find(function(t){return t.active}))===null||e===void 0?void 0:e.identifier;this.dispatchEvent(new CustomEvent("test-update-outcome-variable",{detail:{assessmentItemRefId:i,outcomeVariableId:"SCORE",value:t},bubbles:!0}))},rj([o({type:String,attribute:"view"})],cL.prototype,"view",2),rj([o({type:Boolean})],cL.prototype,"disabled",2),rj([e({context:oU,subscribe:!0})],cL.prototype,"computedContext",2),cL=rj([oT("test-scoring-buttons")],cL);var cD=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"createRenderRoot",value:function t(){return this}},{key:"connectedCallback",value:function t(){f(p(e.prototype),"connectedCallback",this).call(this);var t=this.querySelector("template");if(!t){this.myTemplate=null;return}this.myTemplate=cl(t)}},{key:"_switchView",value:function t(t){this.dispatchEvent(new CustomEvent("on-test-switch-view",{composed:!0,bubbles:!0,detail:t}))}},{key:"firstUpdated",value:function t(t){var e=this;this.addEventListener("click",function(){var t;((t=e.sessionContext)===null||t===void 0?void 0:t.view)==="scorer"?e._switchView("candidate"):e._switchView("scorer")})}},{key:"render",value:function t(){var t;return ol(t4(),this.myTemplate?this.myTemplate({view:(t=this.sessionContext)===null||t===void 0?void 0:t.view}):oh)}}]);return e}(oR);rj([e({context:oB,subscribe:!0})],cD.prototype,"sessionContext",2),cD=rj([oT("test-view-toggle")],cD);var cV=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.view=null;return t}d(e,[{key:"render",value:function t(){var t,e;var n=(t=this.computedContext)===null||t===void 0?void 0:t.testParts.flatMap(function(t){return t.sections.flatMap(function(t){return t.items})}).find(function(t){return t.active});if(!n||!n.variables)return ol(t6());if(n.category==="dep-informational")return ol(t8(),this.dataset.informational);var i=n===null||n===void 0?void 0:(e=n.variables.find(function(t){return t.identifier==="completionStatus"}))===null||e===void 0?void 0:e.value,o=n===null||n===void 0?void 0:n.variables.find(function(t){return t.identifier=="SCORE"}),a=parseFloat(o===null||o===void 0?void 0:o.value),s=n.externalScored;return ol(t7(),i!=="completed"?this.dataset.textNoResponse:!s&&a!==void 0&&!Number.isNaN(a)?a>0?this.dataset.textCorrect:this.dataset.textIncorrect:s==="externalMachine"?Number.isNaN(a)||a===void 0?this.dataset.scoreUnknown:"We hebben je antwoord ".concat(a===0?"geen punten":a==1?"\xe9\xe9n punt":"".concat(a," punten")," gegeven. Je kunt je score zelf aanpassen als je denkt dat dat niet klopt."):s==="human"?Number.isNaN(a)?"":"Deze score heb je zelf toegekend.":this.dataset.inProgress)}}]);return e}(oR);rj([e({context:oU,subscribe:!0})],cV.prototype,"computedContext",2),rj([o({type:String,attribute:"view"})],cV.prototype,"view",2),cV=rj([oT("test-scoring-feedback")],cV);var c$=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e),t.addEventListener("click",function(){t.dispatchEvent(new CustomEvent("test-end-attempt",{bubbles:!0})),t.dispatchEvent(new CustomEvent("test-show-correct-response",{detail:!0,bubbles:!0}));var e=t.closest("qti-test").querySelector("test-container");Array.from(e.shadowRoot.querySelectorAll("[view]")).forEach(function(t){t.classList.toggle("show",!0)})});return t}d(e,[{key:"render",value:function t(){return ol(t9())}}]);return e}(oR);c$.styles=iM(et(),s8,s7),c$=rj([oT("test-check-item")],c$);var cW,cj,cF,cz,cB=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,cj);t.itemURL=null;t.itemDoc=null;t.itemXML=null;t.qtiContext={QTI_CONTEXT:{testIdentifier:"",candidateIdentifier:"",environmentIdentifier:"default"}};rB(t,cW,null);return t}d(e,[{key:"handleItemURLChange",value:function t(){return a(function(){var t,e,n,i,o;return $(this,function(a){switch(a.label){case 0:if(!this.itemURL)return[3,4];a.label=1;case 1:a.trys.push([1,3,,4]);n=(e=this.qtiContext)===null||e===void 0?void 0:(t=e.QTI_CONTEXT)===null||t===void 0?void 0:t.seed;return[4,a_().load(this.itemURL)];case 2:i=a.sent().shuffleInteractions(n);this.itemDoc=i.htmlDoc();return[3,4];case 3:o=a.sent();console.error("Error loading or parsing XML:",o);return[3,4];case 4:return[2]}})}).call(this)}},{key:"handleItemXMLChange",value:function t(){if(this.itemXML)try{this.itemDoc=a_().parse(this.itemXML).htmlDoc()}catch(t){console.error("Error parsing XML:",t)}}},{key:"connectedCallback",value:function t(){var t=this;var n=this,i=function n(){return f(p(e.prototype),"connectedCallback",t)};return a(function(){return $(this,function(t){i().call(n),rQ(this,cj,cF).call(this),rQ(this,cj,cz).call(this),this.itemURL&&this.handleItemURLChange(),this.itemXML&&this.handleItemXMLChange();return[2]})}).call(this)}},{key:"render",value:function t(){return ol(en(),rz(this,cW),cw(this.itemDoc,ol(ee())))}}]);return e}(oR);cW=new WeakMap,cj=new WeakSet,cF=function t(){var t=this.querySelector("template");rH(this,cW,t?t.content:ol(er()))},cz=function t(){var t=new CSSStyleSheet;t.replaceSync(cq),this.shadowRoot.adoptedStyleSheets=[t]},rj([o({type:String,attribute:"item-url"})],cB.prototype,"itemURL",2),rj([u()],cB.prototype,"itemDoc",2),rj([u()],cB.prototype,"itemXML",2),rj([u(),e({context:oF,subscribe:!0})],cB.prototype,"qtiContext",2),rj([y("itemURL",{waitUntilFirstUpdate:!0})],cB.prototype,"handleItemURLChange",1),rj([y("itemXML",{waitUntilFirstUpdate:!0})],cB.prototype,"handleItemXMLChange",1),cB=rj([oT("item-container")],cB);var cH,cQ,cX=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,cH);t.label="Correct response mode";t._options={internal:"Internal",full:"Full (copy)"};return t}d(e,[{key:"render",value:function t(){var t=this;return ol(eo(),this.label,function(e){var n=e.target;rQ(t,cH,cQ).call(t,n.value)},Object.keys(this._options).map(function(e){var n;return ol(ei(),e,e===((n=t.itemContext)===null||n===void 0?void 0:n.correctResponseMode),t._options[e])}))}}]);return e}(oR);cH=new WeakSet,cQ=function t(t){this.dispatchEvent(new CustomEvent("item-switch-correct-response-mode",{detail:t,bubbles:!0}))},rj([e({context:oL,subscribe:!0})],cX.prototype,"itemContext",2),rj([o({type:String})],cX.prototype,"label",2),rj([u()],cX.prototype,"_options",2),cX=rj([oT("item-correct-response-mode")],cX);var cG=iM(ea()),cJ=iM(es(),cG),cY=iM(el()),cK=iM(eu(),cG);var cZ,c0,c1,c2,c3,c5=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e);rB(t,c1);t.shown=!1;t.disabled=!1;t.showCandidateCorrectionText="Show candidate correction";t.hideCandidateCorrectionText="Hide candidate correction";t.noCorrectResponseText="No correct response specified";rB(t,cZ,!1);rB(t,c0,"");return t}d(e,[{key:"updated",value:function t(){var t;if(!rz(this,cZ)||rz(this,c0)!==((t=this.computedContext)===null||t===void 0?void 0:t.identifier)){var e,n,i;rH(this,c0,(e=this.computedContext)===null||e===void 0?void 0:e.identifier);var o=!!((n=this.computedContext)===null||n===void 0?void 0:n.variables.some(function(t){return t.correctResponse})),a=!!((i=this.computedContext)===null||i===void 0?void 0:i.variables.some(function(t){var e,n,i,o;return((n=t.mapping)===null||n===void 0?void 0:(e=n.mapEntries)===null||e===void 0?void 0:e.length)>0||((o=t.areaMapping)===null||o===void 0?void 0:(i=o.areaMapEntries)===null||i===void 0?void 0:i.length)>0}));rH(this,cZ,o||a)}this.disabled=!rz(this,cZ)}},{key:"render",value:function t(){return ol(ec(),rQ(this,c1,c2),rQ(this,c1,c3).call(this))}}]);return e}(oR);cZ=new WeakMap,c0=new WeakMap,c1=new WeakSet,c2=function t(){this.disabled||this.dispatchEvent(new CustomEvent("item-show-candidate-correction",{detail:!this.shown,bubbles:!0}))},c3=function t(){return this.disabled?this.noCorrectResponseText:this.shown?this.hideCandidateCorrectionText:this.showCandidateCorrectionText},c5.styles=iM(ed(),cJ,cY),rj([e({context:oN,subscribe:!0})],c5.prototype,"computedContext",2),rj([o({type:Boolean,reflect:!0})],c5.prototype,"shown",2),rj([o({type:Boolean,reflect:!0})],c5.prototype,"disabled",2),rj([o({type:String})],c5.prototype,"showCandidateCorrectionText",2),rj([o({type:String})],c5.prototype,"hideCandidateCorrectionText",2),rj([o({type:String})],c5.prototype,"noCorrectResponseText",2),c5=rj([oT("item-show-candidate-correction")],c5);var c4,c6,c8,c7,c9,dt=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,c8);t.shown=!1;t.disabled=!1;t.showCorrectText="Show correct response";t.hideCorrectText="Hide correct response";t.noCorrectResponseText="No correct response specified";rB(t,c4,!1);rB(t,c6,"");return t}d(e,[{key:"updated",value:function t(){var t;if(!rz(this,c4)||rz(this,c6)!==((t=this.computedContext)===null||t===void 0?void 0:t.identifier)){var e,n,i;rH(this,c6,(e=this.computedContext)===null||e===void 0?void 0:e.identifier);var o=!!((n=this.computedContext)===null||n===void 0?void 0:n.variables.some(function(t){return t.correctResponse})),a=!!((i=this.computedContext)===null||i===void 0?void 0:i.variables.some(function(t){var e,n,i,o;return((n=t.mapping)===null||n===void 0?void 0:(e=n.mapEntries)===null||e===void 0?void 0:e.length)>0||((o=t.areaMapping)===null||o===void 0?void 0:(i=o.areaMapEntries)===null||i===void 0?void 0:i.length)>0}));rH(this,c4,o||a)}this.disabled=!rz(this,c4)}},{key:"render",value:function t(){return ol(eh(),rQ(this,c8,c7),rQ(this,c8,c9).call(this))}}]);return e}(oR);c4=new WeakMap,c6=new WeakMap,c8=new WeakSet,c7=function t(){this.disabled||this.dispatchEvent(new CustomEvent("item-show-correct-response",{detail:!this.shown,bubbles:!0}))},c9=function t(){return this.disabled?this.noCorrectResponseText:this.shown?this.hideCorrectText:this.showCorrectText},dt.styles=iM(ef(),cJ,cY),rj([e({context:oN,subscribe:!0})],dt.prototype,"computedContext",2),rj([o({type:Boolean,reflect:!0})],dt.prototype,"shown",2),rj([o({type:Boolean,reflect:!0})],dt.prototype,"disabled",2),rj([o({type:String})],dt.prototype,"showCorrectText",2),rj([o({type:String})],dt.prototype,"hideCorrectText",2),rj([o({type:String})],dt.prototype,"noCorrectResponseText",2),dt=rj([oT("item-show-correct-response")],dt);var de=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){var t=this.computedContext;if(!t||!t.variables)return ol(ep());var e=t.variables.filter(function(t){return t.type==="response"}),n=t.variables.filter(function(t){return t.type==="outcome"}),i=function t(t,e){return ol(em(),e,t.map(function(t){var e,n,i,o;var a=t.correctResponse?Array.isArray(t.correctResponse)?t.correctResponse.join(", "):t.correctResponse:"",s=((n=t.mapping)===null||n===void 0?void 0:(e=n.mapEntries)===null||e===void 0?void 0:e.map(function(t){return"".concat(t.mapKey,"=").concat(t.mappedValue,"pt")}).join(", "))||"",l=((o=t.areaMapping)===null||o===void 0?void 0:(i=o.areaMapEntries)===null||i===void 0?void 0:i.map(function(t){return"".concat(t.shape,"(").concat(t.coords,")=").concat(t.mappedValue,"pt")}).join(", "))||"";return ol(ev(),t.identifier,Array.isArray(t.value)?t.value.join(", "):t.value,t.cardinality,t.baseType,a||s||l)}))};return ol(eg(),i(e,"Response Variables"),i(n,"Outcome Variables"))}}]);return e}(oR);de.styles=iM(ey()),rj([e({context:oN,subscribe:!0})],de.prototype,"computedContext",2),de=rj([oT("item-print-variables")],de);var dn,dr,di,da,ds,dl,du,dc,dd,dh,df,dp,dv,dm=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e);rB(t,du);rB(t,dn);t.configContext={};t.qtiContext={QTI_CONTEXT:{testIdentifier:"",candidateIdentifier:"",environmentIdentifier:"default"}};rB(t,dr,rQ(t,du,dc).bind(t));rB(t,di,rQ(t,du,dd).bind(t));rB(t,da,rQ(t,du,dh).bind(t));rB(t,ds,rQ(t,du,df).bind(t));rB(t,dl,rQ(t,du,dp).bind(t));t.addEventListener("qti-item-context-updated",rz(t,dr)),t.addEventListener("qti-assessment-item-connected",rz(t,di)),t.addEventListener("item-show-correct-response",rz(t,da)),t.addEventListener("item-show-candidate-correction",rz(t,ds)),t.addEventListener("item-switch-correct-response-mode",rz(t,dl));return t}d(e,[{key:"render",value:function t(){return ol(eb())}},{key:"disconnectedCallback",value:function t(){f(p(e.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("qti-item-context-changed",rz(this,dr)),this.removeEventListener("qti-assessment-item-connected",rz(this,di))}}]);return e}(oR);dn=new WeakMap,dr=new WeakMap,di=new WeakMap,da=new WeakMap,ds=new WeakMap,dl=new WeakMap,du=new WeakSet,dc=function t(t){var e,n;rQ(this,du,dv).call(this,t.detail.itemContext.identifier,((n=t.detail)===null||n===void 0?void 0:(e=n.itemContext)===null||e===void 0?void 0:e.variables)||[])},dd=function t(t){var e,n;var i=t.detail._context.variables;rH(this,dn,t.detail),this.computedContext=((e=this.computedContext)===null||e===void 0?void 0:e.identifier)===rz(this,dn).identifier?_(k({},this.computedContext),{title:rz(this,dn).title}):{identifier:rz(this,dn).identifier,title:rz(this,dn).title,adaptive:((n=rz(this,dn).getAttribute("adaptive"))===null||n===void 0?void 0:n.toLowerCase())==="true"||!1,variables:i,correctResponseMode:"internal"},rQ(this,du,dv).call(this,rz(this,dn).identifier,i||[])},dh=function t(t){rz(this,dn)&&rz(this,dn).showCorrectResponse(t.detail)},df=function t(t){rz(this,dn)&&rz(this,dn).showCandidateCorrection(t.detail)},dp=function t(t){rQ(this,du,dh).call(this,new CustomEvent("item-show-correct-response",{detail:!1,bubbles:!0})),this.configContext=_(k({},this.configContext),{correctResponseMode:t.detail})},dv=function t(t,e){var n,i;var o=e===null||e===void 0?void 0:(n=e.find(function(t){return t.identifier=="SCORE"}))===null||n===void 0?void 0:n.value,a=parseFloat(o===null||o===void 0?void 0:o.toString()),s=e===null||e===void 0?void 0:(i=e.find(function(t){return t.identifier==="completionStatus"}))===null||i===void 0?void 0:i.value,l=a!==void 0&&!isNaN(a)&&a>0,u=a!==void 0&&!isNaN(a)&&a<=0,c=s==="completed";this.computedContext=_(k({},this.computedContext),{identifier:t,correct:l,incorrect:u,completed:c,variables:e})},rj([u(),t({context:oN})],dm.prototype,"computedContext",2),rj([u(),t({context:oL})],dm.prototype,"configContext",2),rj([u(),t({context:oF})],dm.prototype,"qtiContext",2),dm=rj([oT("qti-item")],dm);var dg=iM(ew());var dy=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"connectedCallback",value:function t(){f(p(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 ol(eq())}}]);return e}(oR);dy.styles=dg;customElements.define("qti-associable-hotspot",dy);var db=iM(ek());var dw=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.tabindex=0;return t}d(e,[{key:"render",value:function t(){return ol(ex())}}]);return e}(oR);dw.styles=db,rj([o({type:Number,reflect:!0})],dw.prototype,"tabindex",2);customElements.define("qti-gap",dw);var dq=iM(e_());var dk=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.tabindex=0;return t}d(e,[{key:"connectedCallback",value:function t(){this.setAttribute("slot","drags")}}]);return e}(oR);dk.styles=dq,rj([o({type:Number,reflect:!0})],dk.prototype,"tabindex",2);customElements.define("qti-gap-img",dk);var dx={toAttribute:function t(t){return t?"true":"false"},fromAttribute:function t(t){return t==="true"}};var d_=iM(eE());var dE=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.tabindex=0;return t}d(e,[{key:"connectedCallback",value:function t(){f(p(e.prototype),"connectedCallback",this).call(this),this.setAttribute("slot","drags")}},{key:"render",value:function t(){return ol(eC())}}]);return e}(n2(oR,"qti-gap-text"));dE.styles=d_,rj([o({type:Number,reflect:!0})],dE.prototype,"tabindex",2);customElements.define("qti-gap-text",dE);var dC=iM(eS());var dS=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}return e}(n2(oR,"qti-hotspot-choice"));dS.styles=dC,rj([o({attribute:"aria-ordervalue",type:Number,reflect:!0})],dS.prototype,"order",2),rj([o({attribute:"aria-ordercorrectvalue",type:Number,reflect:!0})],dS.prototype,"orderCorrect",2);customElements.define("qti-hotspot-choice",dS);var dA=iM(eA());var dR=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){return ol(eR())}}]);return e}(n2(oR,"qti-hottext"));dR.styles=dA;customElements.define("qti-hottext",dR);var dI=iM(eI()),dT=dI;var dM,dP,dO=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,dM);return t}d(e,[{key:"connectedCallback",value:function t(){f(p(e.prototype),"connectedCallback",this).call(this),this.addEventListener("click",rQ(this,dM,dP)),this.dispatchEvent(new CustomEvent("qti-inline-choice-register",{bubbles:!0,composed:!0,cancelable:!1}))}},{key:"disconnectedCallback",value:function t(){this.removeEventListener("click",rQ(this,dM,dP))}},{key:"render",value:function t(){return ol(eT())}}]);return e}(n2(oR,"qti-inline-choice"));dM=new WeakSet,dP=function t(){this.dispatchEvent(new CustomEvent("qti-inline-choice-select",{bubbles:!0,cancelable:!1,composed:!0,detail:{identifier:this.identifier}}))},dO.styles=dT,rj([o({type:String})],dO.prototype,"identifier",2);customElements.define("qti-inline-choice",dO);var dN=iM(eM());var dU=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){return ol(eP())}},{key:"connectedCallback",value:function t(){this.parentElement.tagName.endsWith("INTERACTION")&&this.setAttribute("slot","prompt")}}]);return e}(oR);dU.styles=dN;customElements.define("qti-prompt",dU);var dL=iM(eO());var dD=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.matchMin=0;t.matchMax=1;t.fixed=!1;return t}d(e,[{key:"connectedCallback",value:function t(){f(p(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 ol(eN())}}]);return e}(n2(oR,"qti-simple-associable-choice"));dD.styles=dL,rj([o({type:Number,attribute:"match-min"})],dD.prototype,"matchMin",2),rj([o({type:Number,attribute:"match-max"})],dD.prototype,"matchMax",2),rj([o({type:String,attribute:"fixed",converter:{fromAttribute:function t(t){return t==="true"},toAttribute:function t(t){return String(t)}}})],dD.prototype,"fixed",2);customElements.define("qti-simple-associable-choice",dD);var dV=iM(eU());var d$=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.templateIdentifier=null;t.showHide="show";t.fixed=!1;return t}d(e,[{key:"checked",get:function t(){return this.internals.states.has("--checked")}},{key:"render",value:function t(){return ol(eD(),this.marker?ol(eL(),this.marker):oh)}}]);return e}(n2(oR,"qti-simple-choice"));d$.styles=dV,rj([o({type:String,attribute:"template-identifier"})],d$.prototype,"templateIdentifier",2),rj([o({type:String,attribute:"show-hide"})],d$.prototype,"showHide",2),rj([o({type:Boolean,converter:{fromAttribute:function t(t){return t==="true"},toAttribute:function t(t){return String(t)}}})],d$.prototype,"fixed",2),rj([o({type:String,attribute:!1})],d$.prototype,"marker",2);customElements.define("qti-simple-choice",d$);var dW=globalThis.AbortController,dj=globalThis.AbortSignal,dF=globalThis.WeakMap,dz=globalThis.WeakRef,dB=globalThis.Window,dH=globalThis.reportError,dQ=dH===void 0?console.log:dH,dX=function t(t){return t&&t.defaultView!==null&&t.defaultView.document===t&&(t.defaultView.top===t.defaultView||dX(t.defaultView.parent.document))},dG=function t(){return!!dB&&m(globalThis,dB)},dJ=Symbol("unset"),dY=T(function(){var t=function t(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;Object.defineProperty(t,e,_(k({},Object.getOwnPropertyDescriptor(t,e)),{enumerable:n}))};var e=function t(t,e){var n=e.call(t);if(n===null||(typeof n==="undefined"?"undefined":U(n))!="object")throw new TypeError("Iterator is not an object");return n};var n=function t(t){var e=Object.create(h);return c.set(e,{syncIteratorRecord:t}),e};var i=function t(t,i){var o;if(i){if(o=t[Symbol.asyncIterator],o==null){if(o=t[Symbol.iterator],o==null)throw new TypeError("Object is not async iterable");var a=e(t,o);return n(a)}}else o=t[Symbol.iterator];if(o==null)throw new TypeError("Object is not iterable");return e(t,o)};var o=function t(t,e){var n=c.get(t);if(n===null||n===void 0?void 0:n.active){n.active=!1,n.subscriptionController.abort(e);var i=true,o=false,a=undefined;try{for(var s=n.teardowns.reverse()[Symbol.iterator](),l;!(i=(l=s.next()).done);i=true){var u=l.value;if(dG()&&!dX(document))return;try{u()}catch(t){dQ(t)}}}catch(t){o=true;a=t}finally{try{if(!i&&s.return!=null){s.return()}}finally{if(o){throw a}}}}};var a=function t(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var i;if(dG()&&!dX(document))return;var a;typeof e=="function"?a=new v({next:e}):e&&!m(e,v)?a=new v(e):a=e||new v;var s=c.get(t),l=(i=s.weakSubscriber)===null||i===void 0?void 0:i.deref();if(l===null||l===void 0?void 0:l.active){var u=l,d=c.get(u);d.observers.add(a),n.signal&&(n.signal.aborted?d.observers.delete(a):n.signal.addEventListener("abort",function(){var t=c.get(u);(t===null||t===void 0?void 0:t.active)&&(t.observers.delete(a),t.observers.size==0&&o(u,n.signal.reason))}));return}var h=new g(a);if(s.weakSubscriber=new dz(h),"signal"in n&&(n.signal.aborted?o(h,n.signal.reason):n.signal.addEventListener("abort",function(){var t=c.get(h);(t===null||t===void 0?void 0:t.active)&&(t.observers.delete(a),t.observers.size==0&&o(h,n.signal.reason))})),s.subscribeCallback)try{s.subscribeCallback(h)}catch(t){h.error(t)}};var s="try"in Promise?Promise.try.bind(Promise):function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++){n[i-1]=arguments[i]}return new Promise(function(e){return e(t.apply(void 0,N(n)))})},u="withResolvers"in Promise?Promise.withResolvers.bind(Promise):function(){var t,e;return{promise:new Promise(function(n,i){return t=n,e=i}),resolve:t,reject:e}};var c=new dF,h={next:function t(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++){e[n]=arguments[n]}var i;var o=this,a=c.get(o);if(!(a===null||a===void 0?void 0:a.syncIteratorRecord))throw new TypeError("AsyncFromSyncIteratorPrototype.next called on invalid object");var l=a.syncIteratorRecord;return s(function(){return(i=l).next.apply(i,N(e))})},return:function t(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++){e[n]=arguments[n]}var i;var o=this,a=c.get(o);if(!(a===null||a===void 0?void 0:a.syncIteratorRecord))throw new TypeError("AsyncFromSyncIteratorPrototype.return called on invalid object");var l=a.syncIteratorRecord;return s(function(){return l.return?(i=l).return.apply(i,N(e)):{value:void 0,done:!0}})},throw:function t(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++){e[n]=arguments[n]}var i=this,o=c.get(i);if(!(o===null||o===void 0?void 0:o.syncIteratorRecord))throw new TypeError("AsyncFromSyncIteratorPrototype.throw called on invalid object");var a=o.syncIteratorRecord;return s(function(){var t;if(!a.throw)throw a.return(),new TypeError("no throw method");return(t=a).throw.apply(t,N(e))})}};var f="any"in dj?dj.any.bind(dj):function(t){var e=new dW;var n=true,i=false,o=undefined;try{for(var a=t[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;if(l.aborted)return e.abort(l.reason),e.signal}}catch(t){i=true;o=t}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(i){throw o}}}var u=true,c=false,d=undefined;try{var h=function(){var t=p.value;t.addEventListener("abort",function(){e.abort(t.reason)},{signal:e.signal})};for(var f=t[Symbol.iterator](),p;!(u=(p=f.next()).done);u=true)h()}catch(t){c=true;d=t}finally{try{if(!u&&f.return!=null){f.return()}}finally{if(c){throw d}}}return e.signal},p=function t(t){return f(t.filter(Boolean))};var v=/*#__PURE__*/function(){"use strict";function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.next,i=e.error,o=e.complete;l(this,t);c.set(this,{next:n,error:i,complete:o})}d(t,[{key:"next",value:function t(t){var e=c.get(this)||{},n=e.next;n&&n(t)}},{key:"error",value:function t(t){var e=c.get(this)||{},n=e.error;n?n(t):dQ(t)}},{key:"complete",value:function t(){var t=c.get(this)||{},e=t.complete;e&&e()}}]);return t}();var g=/*#__PURE__*/function(){"use strict";function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;l(this,t);if(!m(e,v))throw new TypeError("Illegal constructor");c.set(this,{active:!0,observers:new Set([e]),teardowns:[],subscriptionController:new dW})}d(t,[{key:Symbol.toStringTag,get:function t(){return"Subscriber"}},{key:"next",value:function e(e){if(!m(this,t))throw new TypeError("illegal invocation");if(!arguments.length)throw new TypeError("too few arguments");var n=c.get(this);if(!(n===null||n===void 0?void 0:n.active)||dG()&&!dX(document))return;var i=new Set(n.observers);var o=true,a=false,s=undefined;try{for(var l=i[Symbol.iterator](),u;!(o=(u=l.next()).done);o=true){var d=u.value;d.next(e)}}catch(t){a=true;s=t}finally{try{if(!o&&l.return!=null){l.return()}}finally{if(a){throw s}}}}},{key:"error",value:function e(e){if(!m(this,t))throw new TypeError("illegal invocation");if(!arguments.length)throw new TypeError("too few arguments");var n=c.get(this);if(!(n===null||n===void 0?void 0:n.active)){dQ(e);return}if(dG()&&!dX(document))return;o(this,e);var i=new Set(n.observers);var a=true,s=false,l=undefined;try{for(var u=i[Symbol.iterator](),d;!(a=(d=u.next()).done);a=true){var h=d.value;h.error(e)}}catch(t){s=true;l=t}finally{try{if(!a&&u.return!=null){u.return()}}finally{if(s){throw l}}}}},{key:"complete",value:function e(){if(!m(this,t))throw new TypeError("illegal invocation");var e=c.get(this);if(!(e===null||e===void 0?void 0:e.active)||dG()&&!dX(document))return;o(this);var n=new Set(e.observers);var i=true,a=false,s=undefined;try{for(var l=n[Symbol.iterator](),u;!(i=(u=l.next()).done);i=true){var d=u.value;d.complete()}}catch(t){a=true;s=t}finally{try{if(!i&&l.return!=null){l.return()}}finally{if(a){throw s}}}}},{key:"addTeardown",value:function e(e){if(!m(this,t))throw new TypeError("illegal invocation");if(typeof e!="function")throw new TypeError("Parameter 1 is not of type 'Function'");if(dG()&&!dX(document))return;var n=c.get(this);(n===null||n===void 0?void 0:n.active)?n.teardowns.push(e):e()}},{key:"active",get:function e(){var e;if(!m(this,t))throw new TypeError("illegal invocation");return!!((e=c.get(this))===null||e===void 0?void 0:e.active)}},{key:"signal",get:function e(){if(!m(this,t))throw new TypeError("illegal invocation");if(!c.has(this)){var e=new dW;return e.abort(),e.signal}return c.get(this).subscriptionController.signal}}]);return t}();t(g.prototype,"next"),t(g.prototype,"error"),t(g.prototype,"complete"),t(g.prototype,"addTeardown"),t(g.prototype,"active"),t(g.prototype,"signal");var y=/*#__PURE__*/function(){"use strict";function t(e){l(this,t);if(!e)throw new TypeError("1 argument required but 0 present");c.set(this,{weakSubscriber:null,subscribeCallback:e})}d(t,[{key:Symbol.toStringTag,get:function t(){return"Observable"}},{key:"subscribe",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!m(this,t))throw new TypeError("illegal invocation");a(this,e,n)}},{key:"takeUntil",value:function e(e){if(!m(this,t))throw new TypeError("illegal invocation");var n=this,i=t.from(e);return new t(function(t){var e=new v({next:function e(){t.complete()},error:function e(){t.complete()}}),o={signal:t.signal};if(a(i,e,o),!t.active)return;var s=new v({next:function e(e){t.next(e)},error:function e(e){t.error(e)},complete:function e(){t.complete()}});a(n,s,o)})}},{key:"map",value:function e(e){if(!m(this,t))throw new TypeError("illegal invocation");if(typeof e!="function")throw new TypeError("Parameter 1 is not of type 'Function'");var n=this;return new t(function(t){var i=0,o=new v({next:function n(n){var o;try{o=e(n,i)}catch(e){t.error(e);return}i+=1,t.next(o)},error:function e(e){t.error(e)},complete:function e(){t.complete()}}),s={signal:t.signal};a(n,o,s)})}},{key:"inspect",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var n=null,i=null,o=null,s=null,l=null;typeof e=="function"?i=e:e&&(typeof e==="undefined"?"undefined":U(e))=="object"&&("subscribe"in e&&(n=e.subscribe),"next"in e&&(i=e.next),"error"in e&&(o=e.error),"complete"in e&&(s=e.complete),"abort"in e&&(l=e.abort));var u=this;return new t(function(t){if(n!==null)try{n()}catch(e){t.error(e);return}var e=function e(){try{l!==null&&l(t.signal.reason)}catch(t){dQ(t)}};t.signal.addEventListener("abort",e,{once:!0});var c=new v({next:function n(n){if(i!==null)try{i(n)}catch(n){t.signal.removeEventListener("abort",e),t.error(n);return}t.next(n)},error:function n(n){if(t.signal.removeEventListener("abort",e),o!==null)try{o(n)}catch(e){t.error(e);return}t.error(n)},complete:function n(){if(t.signal.removeEventListener("abort",e),s!==null)try{s()}catch(e){t.error(e);return}t.complete()}}),d={signal:t.signal};a(u,c,d)})}},{key:"filter",value:function e(e){if(!m(this,t))throw new TypeError("illegal invocation");if(typeof e!="function")throw new TypeError("Parameter 1 is not of type 'Function'");var n=this;return new t(function(t){var i=0,o=new v({next:function n(n){var o=!1;try{o=e(n,i)}catch(e){t.error(e);return}i+=1,o&&t.next(n)},error:function e(e){t.error(e)},complete:function e(){t.complete()}}),s={signal:t.signal};a(n,o,s)})}},{key:"take",value:function e(e){if(!m(this,t))throw new TypeError("illegal invocation");var n=this;return new t(function(t){var i=e;if(i==0)return t.complete();var o=new v({next:function e(e){t.next(e),i-=1,i==0&&t.complete()},error:function e(e){t.error(e)},complete:function e(){t.complete()}}),s={signal:t.signal};a(n,o,s)})}},{key:"drop",value:function e(e){if(!m(this,t))throw new TypeError("illegal invocation");var n=this;return new t(function(t){var i=e,o=new v({next:function e(e){if(i>0)return i-=1;i==0&&t.next(e)},error:function e(e){t.error(e)},complete:function e(){t.complete()}}),s={signal:t.signal};a(n,o,s)})}},{key:"flatMap",value:function e(e){if(!m(this,t))throw new TypeError("illegal invocation");if(typeof e!="function")throw new TypeError("Parameter 1 is not of type 'Function'");var n=this;return new t(function(i){var o=0,s=!1,l=[];function u(n){var d;try{d=e(n,o)}catch(t){return i.error(t)}o+=1;var h;try{h=t.from(d)}catch(t){return i.error(t)}var f=new v({next:function t(t){i.next(t)},error:function t(t){i.error(t)},complete:function t(){if(l.length){var t=l.shift();u(t)}else c=!1,s&&i.complete()}}),p={signal:i.signal};a(h,f,p)}var c=!1,d=new v({next:function t(t){c?l.push(t):(c=!0,u(t))},error:function t(t){i.error(t)},complete:function t(){s=!0,!c&&!l.length&&i.complete()}}),h={signal:i.signal};a(n,d,h)})}},{key:"switchMap",value:function e(e){if(!m(this,t))throw new TypeError("illegal invocation");if(typeof e!="function")throw new TypeError("Parameter 1 is not of type 'Function'");var n=this;return new t(function(i){var o=function n(n){var o;try{o=e(n,s)}catch(t){return i.error(t)}s+=1;var c;try{c=t.from(o)}catch(t){return i.error(t)}var d=new v({next:function t(t){i.next(t)},error:function t(t){i.error(t)},complete:function t(t){l?i.complete():u=null}}),h={signal:p([u.signal,i.signal])};a(c,d,h)};var s=0,l=!1,u=null;var c=new v({next:function t(t){u&&u.abort(),u=new dW,o(t)},error:function t(t){i.error(t)},complete:function t(){l=!0,u||i.complete()}}),d={signal:i.signal};a(n,c,d)})}},{key:"catch",value:function e(e){if(!m(this,t))throw new TypeError("illegal invocation");if(typeof e!="function")throw new TypeError("Parameter 1 is not of type 'Function'");var n=this;return new t(function(i){var o=new v({next:function t(t){i.next(t)},error:function n(n){var o;try{o=e(n)}catch(t){i.error(t);return}var s;try{s=t.from(o)}catch(t){i.error(t);return}var l=new v({next:function t(t){i.next(t)},error:function t(t){i.error(t)},complete:function t(){i.complete()}}),u={signal:i.signal};a(s,l,u)},complete:function t(){i.complete()}}),s={signal:i.signal};a(n,o,s)})}},{key:"finally",value:function e(e){if(!m(this,t))throw new TypeError("illegal invocation");if(typeof e!="function")throw new TypeError("Parameter 1 is not of type 'Function'");var n=this;return new t(function(t){t.addTeardown(e);var i=new v({next:function e(e){t.next(e)},error:function e(e){t.error(e)},complete:function e(){t.complete()}}),o={signal:t.signal};a(n,i,o)})}},{key:"toArray",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!m(this,t))throw new TypeError("illegal invocation");var n=u(),i=n.promise,o=n.resolve,s=n.reject;if(e.signal){if(e.signal.aborted)return Promise.reject(e.signal.reason);e.signal.addEventListener("abort",function(){s(e.signal.reason)})}var l=[],c=new v({next:function t(t){l.push(t)},error:function t(t){s(t)},complete:function t(){o(l)}});return a(this,c,e),i}},{key:"forEach",value:function e(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!m(this,t))throw new TypeError("illegal invocation");if(typeof e!="function")throw new TypeError("Parameter 1 is not of type 'Function'");var i=u(),o=i.promise,s=i.resolve,l=i.reject,c=new dW,d={signal:p([c.signal,n.signal])};if(d.signal.aborted)return l(d.signal.reason),o;d.signal.addEventListener("abort",function(){l(d.signal.reason)});var h=0,f=new v({next:function t(t){try{e(t,h)}catch(t){l(t),c.abort(t)}h+=1},error:function t(t){l(t)},complete:function t(){s()}});return a(this,f,d),o}},{key:"every",value:function e(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!m(this,t))throw new TypeError("illegal invocation");if(typeof e!="function")throw new TypeError("Parameter 1 is not of type 'Function'");var i=u(),o=i.promise,s=i.resolve,l=i.reject,c=new dW,d={signal:p([c.signal,n.signal])};if(d.signal.aborted)return l(d.signal.reason),o;d.signal.addEventListener("abort",function(){l(d.signal.reason)});var h=0,f=new v({next:function t(t){var n=!1;try{n=e(t,h)}catch(t){l(t),c.abort(t)}h+=1,n||(s(!1),c.abort())},error:function t(t){l(t)},complete:function t(){s(!0)}});return a(this,f,d),o}},{key:"first",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!m(this,t))throw new TypeError("illegal invocation");var n=u(),i=n.promise,o=n.resolve,s=n.reject,l=new dW,c={signal:p([l.signal,e.signal])};if(c.signal.aborted)return s(c.signal.reason),i;c.signal.addEventListener("abort",function(){s(c.signal.reason)});var d=new v({next:function t(t){o(t),l.abort()},error:function t(t){s(t)},complete:function t(){s(new RangeError("No values in Observable"))}});return a(this,d,c),i}},{key:"last",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!m(this,t))throw new TypeError("illegal invocation");var n=u(),i=n.promise,o=n.resolve,s=n.reject;if(e.signal){if(e.signal.aborted)return s(e.signal.reason),i;e.signal.addEventListener("abort",function(){s(e.signal.reason)})}var l=null,c=!1,d=new v({next:function t(t){c=!0,l=t},error:function t(t){s(t)},complete:function t(){c?o(l):s(new RangeError("No values in Observable"))}});return a(this,d,e),i}},{key:"find",value:function e(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!m(this,t))throw new TypeError("illegal invocation");if(typeof e!="function")throw new TypeError("Parameter 1 is not of type 'Function'");var i=u(),o=i.promise,s=i.resolve,l=i.reject,c=new dW,d={signal:p([c.signal,n.signal])};if(d.signal.aborted)return l(d.signal.reason),o;d.signal.addEventListener("abort",function(){l(d.signal.reason)});var h=0,f=new v({next:function t(t){var n=!1;try{n=e(t,h)}catch(t){l(t),c.abort(t)}h+=1,n&&(s(t),c.abort())},error:function t(t){l(t)},complete:function t(){s()}});return a(this,f,d),o}},{key:"some",value:function e(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!m(this,t))throw new TypeError("illegal invocation");if(typeof e!="function")throw new TypeError("Parameter 1 is not of type 'Function'");var i=u(),o=i.promise,s=i.resolve,l=i.reject,c=new dW,d={signal:p([c.signal,n.signal])};if(d.signal.aborted)return l(d.signal.reason),o;d.signal.addEventListener("abort",function(){l(d.signal.reason)});var h=0,f=new v({next:function t(t){var n=!1;try{n=e(t,h)}catch(t){l(t),c.abort(t)}h+=1,n&&(s(!0),c.abort())},error:function t(t){l(t)},complete:function t(){s(!1)}});return a(this,f,d),o}},{key:"reduce",value:function e(e,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!m(this,t))throw new TypeError("illegal invocation");if(typeof e!="function")throw new TypeError("Parameter 1 is not of type 'Function'");var o=u(),s=o.promise,l=o.resolve,c=o.reject,d=new dW,h={signal:p([d.signal,i.signal])};if(h.signal.aborted)return c(h.signal.reason),s;h.signal.addEventListener("abort",function(){c(h.signal.reason)},{once:!0});var f=0,g=arguments.length>1?n:dJ,y=new v({next:function t(t){if(g===dJ){g=t,f++;return}try{var n=e(g,t,f);f++,g=n}catch(t){c(t),d.abort(t);return}},error:function t(t){c(t)},complete:function t(){g!==dJ?l(g):c(new TypeError("no initial value provided and no values emitted"))}});return a(this,y,h),s}}],[{key:"from",value:function e(e){if(e===null||(typeof e==="undefined"?"undefined":U(e))!="object")throw new TypeError("Observable.from only accepts objects");if(m(e,t))return e;if(typeof(Symbol.asyncIterator in e&&e[Symbol.asyncIterator])=="function"){var n=function t(t,e){if(t.signal.aborted)return;var i;try{var a=e.next();i=Promise.resolve(a)}catch(t){i=Promise.reject(t)}i.then(function(i){if(i===null||(typeof i==="undefined"?"undefined":U(i))!="object"){t.error(new TypeError("Not an IteratorResult."));return}try{var a;a=i,o=a.done,a}catch(e){t.error(e);return}if(o){t.complete();return}var s;try{s=i.value}catch(e){t.error(e);return}t.next(s),n(t,e)},function(e){t.error(e)})},o=!1;return new t(function(t){if(t.signal.aborted)return;var a;try{a=i(e,!0)}catch(e){t.error(e);return}var l=a;t.signal.aborted||(t.signal.addEventListener("abort",function(){if(typeof l.return!="function"||o)return;s(function(){return l.return(t.signal.reason)}).then(function(t){if(t===null||(typeof t==="undefined"?"undefined":U(t))!="object")throw new TypeError("Iterator .return() must return an Object")})}),n(t,l))})}if(typeof(Symbol.iterator in e&&e[Symbol.iterator])=="function")return new t(function(t){if(t.signal.aborted)return;var n;try{n=i(e,!1)}catch(e){t.error(e);return}var o=!1,a=n;if(!t.signal.aborted)for(t.signal.addEventListener("abort",function(){if(typeof a.return!="function"||o)return;var t=a.return();if(t===null||(typeof t==="undefined"?"undefined":U(t))!="object")throw new TypeError("Iterator .return() must return an Object")});;)try{var s=a.next();var l;if(l=s,o=l.done,l,o){t.complete();return}if(t.next(s.value),t.signal.aborted)break}catch(e){t.error(e);break}});if(m(e,Promise)||typeof e.then=="function")return new t(function(t){e.then(function(e){t.next(e),t.complete()},function(e){t.error(e)})});throw new TypeError("Could not convert value to Observable")}}]);return t}();return t(y.prototype,"subscribe"),[y,g]}(),2),dK=dY[0],dZ=dY[1];n3()||n5();var d0=new WeakSet;var d1=function t(t,e,n){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:'slot[part="drags"]',o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"pointerWithin";var u=/*#__PURE__*/function(t){"use strict";v(u,t);function u(){l(this,u);var t;t=s(this,u,arguments);t.trackedDraggables=[];t.trackedDroppables=[];t.trackedDragContainers=[];t.allDropzones=[];t.collisionDetectionAlgorithm=o;t.dragState={dragging:!1,dragSource:null,dragClone:null,startOffset:{x:0,y:0},currentTarget:null,sourceDroppable:null,inputType:null};t.subscriptions=[];t.dragSubscriptions=[];t.lastPointerDownAt=0;t.lastTouchStartAt=0;return t}d(u,[{key:"connectedCallback",value:function t(){var t;f(p(u.prototype),"connectedCallback",this).call(this),ru((t=this.ownerDocument)===null||t===void 0?void 0:t.defaultView),this.setupDragDrop()}},{key:"disconnectedCallback",value:function t(){f(p(u.prototype),"disconnectedCallback",this).call(this),this.cleanup()}},{key:"setupDragDrop",value:function t(){return a(function(){return $(this,function(t){switch(t.label){case 0:return[4,this.updateComplete];case 1:t.sent(),this.cacheInteractiveElements(),this.afterCache(),this.setupDragObservables();return[2]}})}).call(this)}},{key:"afterCache",value:function t(){}},{key:"cacheInteractiveElements",value:function t(){var t=function t(t,e){var n;return Array.from((n=e===null||e===void 0?void 0:e.querySelectorAll(t))!==null&&n!==void 0?n:[])},o=t(e,this),a=t(e,this.shadowRoot),s=t('[qti-draggable="true"]:not([data-drag-clone])',this),l=t('[qti-draggable="true"]:not([data-drag-clone])',this.shadowRoot);this.trackedDraggables=Array.from(new Set(N(o).concat(N(a),N(s),N(l))));var u=t(n,this),c=t(n,this.shadowRoot);this.trackedDroppables=Array.from(new Set(N(u).concat(N(c))));var d=t(i,this),h=t(i,this.shadowRoot);this.trackedDragContainers=Array.from(new Set(N(d).concat(N(h)))),this.allDropzones=N(this.trackedDroppables).concat(N(this.trackedDragContainers)),this.trackedDraggables.forEach(function(t){t.style.cursor="grab",t.style.userSelect="none",t.style.touchAction="none",t.style.webkitUserSelect="none",t.style.webkitTouchCallout="none",t.setAttribute("qti-draggable","true"),t.setAttribute("tabindex","0")})}},{key:"setupDragObservables",value:function t(){var t=this;var n=this.shadowRoot;if(!n){console.error("❌ [Observable DnD] No shadow root found!");return}var i=n.when("pointerdown").filter(function(n){if(!n.isTrusted)return!1;var i=rn(n,e),o=t.disabled||t.readonly,a=(i===null||i===void 0?void 0:i.hasAttribute("disabled"))||(i===null||i===void 0?void 0:i.getAttribute("aria-disabled"))==="true",s=Date.now()-t.lastTouchStartAt<50;return i&&n.isPrimary!==!1&&n.button===0&&!o&&!a&&!s}).subscribe(function(n){t.lastPointerDownAt=Date.now();var i=rn(n,e);if(!i){console.warn("⚠️ [Observable DnD] No draggable target found");return}n.pointerType==="touch"&&(n.preventDefault(),n.stopPropagation());var o=n.isTrusted?n.pointerType==="touch"?100:10:0;if(t.dragState.activationTimeout&&clearTimeout(t.dragState.activationTimeout),o===0){t.dragState.dragging||t.initiateDrag(i,n.clientX,n.clientY,n.pointerType,"pointer",n.pointerId,n.isTrusted);return}var a=function e(){t.dragState.activationTimeout&&(clearTimeout(t.dragState.activationTimeout),t.dragState.activationTimeout=void 0),document.removeEventListener("pointerup",a,!0),document.removeEventListener("pointercancel",a,!0)};document.addEventListener("pointerup",a,{once:!0,capture:!0}),document.addEventListener("pointercancel",a,{once:!0,capture:!0}),t.dragState.activationTimeout=window.setTimeout(function(){t.dragState.activationTimeout=void 0,document.removeEventListener("pointerup",a,!0),document.removeEventListener("pointercancel",a,!0),t.dragState.dragging||t.initiateDrag(i,n.clientX,n.clientY,n.pointerType,"pointer",n.pointerId,n.isTrusted)},o)}),o=n.when("mousedown").filter(function(n){var i=rn(n,e),o=t.disabled||t.readonly,a=(i===null||i===void 0?void 0:i.hasAttribute("disabled"))||(i===null||i===void 0?void 0:i.getAttribute("aria-disabled"))==="true",s=n.button===0,l=Date.now()-t.lastPointerDownAt<50;return i&&s&&!o&&!a&&!l}).subscribe(function(n){var i=rn(n,e);!i||t.dragState.dragging||(n.preventDefault(),t.initiateDrag(i,n.clientX,n.clientY,"mouse","mouse",void 0,n.isTrusted))}),a=n.when("touchstart").filter(function(n){var i,o;var a=rn(n,e),s=t.disabled||t.readonly,l=(a===null||a===void 0?void 0:a.hasAttribute("disabled"))||(a===null||a===void 0?void 0:a.getAttribute("aria-disabled"))==="true",u=!!(((i=n.touches)===null||i===void 0?void 0:i[0])||((o=n.changedTouches)===null||o===void 0?void 0:o[0])),c=Date.now()-t.lastPointerDownAt<50;return a&&u&&!s&&!l&&!c}).subscribe(function(n){var i,o;var a=rn(n,e),s=((i=n.touches)===null||i===void 0?void 0:i[0])||((o=n.changedTouches)===null||o===void 0?void 0:o[0]);!a||!s||t.dragState.dragging||(t.lastTouchStartAt=Date.now(),n.preventDefault(),n.stopPropagation(),t.initiateDrag(a,s.clientX,s.clientY,"touch","touch",void 0,n.isTrusted))}),s={dragging:!1,dragElement:null,dragIndex:0,dropIndex:0,dropElement:null},l=n.when("keydown").subscribe(function(n){var i=t.trackedDraggables.filter(function(t){return t.style.opacity!=="0"}),o=N(t.trackedDroppables).concat(N(t.trackedDragContainers));if(s.dragging)switch(n.code){case"ArrowRight":case"ArrowDown":{n.preventDefault();var a=(s.dropIndex+1)%o.length;s=_(k({},s),{dropIndex:a,dropElement:o[a]});break}case"ArrowLeft":case"ArrowUp":{n.preventDefault();var l=(s.dropIndex-1+o.length)%o.length;s=_(k({},s),{dropIndex:l,dropElement:o[l]});break}case"Space":case"Enter":case"Tab":{n.preventDefault(),s.dragElement&&s.dropElement&&(t.allowDrop(s.dragElement,s.dropElement)||t.trackedDragContainers.includes(s.dropElement)?t.handleDrop(s.dragElement,s.dropElement):t.handleInvalidDrop(s.dragElement)),t.trackedDraggables.forEach(function(t){return t.removeAttribute("data-keyboard-dragging")}),t.saveResponse(),s={dragging:!1,dragElement:null,dragIndex:0,dropIndex:0,dropElement:null};break}case"Escape":{n.preventDefault(),t.trackedDraggables.forEach(function(t){return t.removeAttribute("data-keyboard-dragging")}),s={dragging:!1,dragElement:null,dragIndex:0,dropIndex:0,dropElement:null};break}}else{var u=rn(n,e),c=t.disabled||t.readonly,d=(u===null||u===void 0?void 0:u.hasAttribute("disabled"))||(u===null||u===void 0?void 0:u.getAttribute("aria-disabled"))==="true";u&&["Space","Enter"].includes(n.code)&&!c&&!d&&(n.preventDefault(),u.setAttribute("data-keyboard-dragging","true"),s={dragging:!0,dragElement:u,dragIndex:i.indexOf(u),dropIndex:0,dropElement:o[0]})}t.allDropzones.forEach(function(t){return t.removeAttribute("hover")}),s.dragging&&s.dropElement&&(s.dropElement.setAttribute("hover",""),s.dropElement.hasAttribute("tabindex")&&s.dropElement.getAttribute("tabindex")!=="-1"&&s.dropElement.focus())});this.subscriptions.push(i,o,a,l)}},{key:"initiateDrag",value:function t(t,e,n,i){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"pointer",a=arguments.length>5?arguments[5]:void 0,s=arguments.length>6?arguments[6]:void 0;var l,u;if(this.dragState.dragging){console.warn("⚠️ [Observable DnD] Already dragging, ignoring initiateDrag");return}if(t.hasAttribute("data-drag-clone")){console.warn("⚠️ [Observable DnD] Attempted to drag visual clone, ignoring");return}var c=this.trackedDroppables.some(function(e){return e.contains(t)}),d=this.trackedDroppables.find(function(e){return e.contains(t)})||null,h=t.getBoundingClientRect();this.dragState={dragging:!0,dragSource:t,dragClone:this.createDragClone(t,h),startOffset:{x:e-h.left,y:n-h.top},currentTarget:null,sourceDroppable:d,inputType:i,pointerId:a,startedFromTrustedEvent:s,initialCoordinates:{x:e,y:n}},c?((l=this.dragState.dragClone)===null||l===void 0?void 0:l.setAttribute("data-drag-origin","droppable"),t.remove(),this.cacheInteractiveElements(),d&&d.setAttribute("data-drag-source","true")):((u=this.dragState.dragClone)===null||u===void 0?void 0:u.setAttribute("data-drag-origin","inventory"),t.style.opacity="0",t.style.pointerEvents="none"),this.updateClonePosition(e,n),this.activateAllDroppables(),this.setupMoveObservables(i,o)}},{key:"setupMoveObservables",value:function t(t){var e=this;var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"pointer";var i;if(t==="touch"){if(n==="pointer")try{var o=this.dragState.dragSource,a=this.dragState.pointerId;o&&a!==void 0&&o.setPointerCapture&&o.setPointerCapture(a)}catch(t){}var s=function t(t){t.cancelable&&(t.preventDefault(),n==="pointer"&&t.stopPropagation())};document.addEventListener("touchmove",s,{passive:!1,capture:!0}),document.addEventListener("touchstart",s,{passive:!1,capture:!0}),document.addEventListener("touchend",s,{passive:!1,capture:!0}),document.addEventListener("gesturestart",s,{passive:!1}),document.addEventListener("gesturechange",s,{passive:!1}),document.addEventListener("gestureend",s,{passive:!1});var l=function t(){if(document.removeEventListener("touchmove",s,{capture:!0}),document.removeEventListener("touchstart",s,{capture:!0}),document.removeEventListener("touchend",s,{capture:!0}),document.removeEventListener("gesturestart",s),document.removeEventListener("gesturechange",s),document.removeEventListener("gestureend",s),n==="pointer")try{var t=e.dragState.dragSource,i=e.dragState.pointerId;t&&i!==void 0&&t.releasePointerCapture&&t.releasePointerCapture(i)}catch(t){}};this.dragState.touchCleanup=l}var u=n==="mouse"?"mousemove":n==="touch"?"touchmove":"pointermove",c=n==="mouse"?"mouseup":n==="touch"?"touchend":"pointerup",d=function t(t){var n=e.dragState.startedFromTrustedEvent;return n===void 0||t.isTrusted===n},h=document.when(u).takeUntil(document.when(c)).subscribe({next:function t(t){if(d(t)){if(t.preventDefault(),t.stopPropagation(),n==="touch"){var i,o;var a=((i=t.touches)===null||i===void 0?void 0:i[0])||((o=t.changedTouches)===null||o===void 0?void 0:o[0]);if(!a)return;e.handleDragMove(a.clientX,a.clientY);return}if(n==="mouse"){var s=t;if(typeof s.buttons=="number"&&(s.buttons&1)!==1)return}e.handleDragMove(t.clientX,t.clientY)}}}),f=document.when(c).subscribe({next:function t(t){d(t)&&(t.preventDefault(),t.stopPropagation(),e.handleDragEnd())}}),p=n==="touch"?document.when("touchcancel").subscribe({next:function t(t){d(t)&&e.handleDragEnd()}}):n==="mouse"?null:document.when("pointercancel").subscribe({next:function t(t){d(t)&&e.handleDragEnd()}}),v=document.when("keydown").filter(function(t){return t.key==="Escape"}).subscribe({next:function t(t){d(t)&&e.handleDragEnd()}}),m=[h,f,v];p&&m.push(p),(i=this.dragSubscriptions).push.apply(i,N(m))}},{key:"handleDragMove",value:function t(t,e){if(!this.dragState.dragging||!this.dragState.dragClone)return;this.updateClonePosition(t,e);var n=re(this.allDropzones,t,e,this.dragState.dragClone,this.collisionDetectionAlgorithm,this.trackedDragContainers),i=Date.now(),o=i-(this.dragState.lastTargetChangeTime||0);n!==this.dragState.currentTarget&&(n===null||o>=50)&&(this.allDropzones.forEach(function(t){return t.removeAttribute("hover")}),n&&n.setAttribute("hover",""),this.dragState.currentTarget=n,this.dragState.lastTargetChangeTime=i)}},{key:"handleDragEnd",value:function t(){if(!this.dragState.dragging)return;var t=this.dragState,e=t.dragSource,n=t.dragClone,i=t.currentTarget,o=t.sourceDroppable,a=i;if(!a&&n){var s,l;var u,c;var d=n.getBoundingClientRect(),h=(s=(u=this.dragState.initialCoordinates)===null||u===void 0?void 0:u.x)!==null&&s!==void 0?s:d.left+d.width/2,f=(l=(c=this.dragState.initialCoordinates)===null||c===void 0?void 0:c.y)!==null&&l!==void 0?l:d.top+d.height/2;a=re(this.allDropzones,h,f,n,this.collisionDetectionAlgorithm,this.trackedDragContainers)}var p=(a===null||a===void 0?void 0:a.hasAttribute("disabled"))&&a.hasAttribute("data-drag-source");!!e&&!!a&&this.allowDrop(e,a)&&(!a.hasAttribute("disabled")||p)&&e&&a?this.handleDrop(e,a):this.handleInvalidDrop(e),n&&n.remove(),this.dragState.touchCleanup&&this.dragState.touchCleanup(),this.resetDragState(),this.deactivateAllDroppables(),this.saveResponse(),o&&o.removeAttribute("data-drag-source"),this.cacheInteractiveElements();var v=this.checkAllMaxAssociations;typeof v=="function"&&v.call(this)}},{key:"allowDrop",value:function t(t,e){return this.trackedDroppables.includes(e)||this.trackedDragContainers.includes(e)}},{key:"handleInvalidDrop",value:function t(t){t&&(t.style.opacity="1.0",t.style.pointerEvents="auto")}},{key:"createDragClone",value:function t(t,e){var n=t.cloneNode(!0),i=window.getComputedStyle(t);for(var o=0;o<i.length;o++){var a=i[o];n.style.setProperty(a,i.getPropertyValue(a))}return n.style.position="fixed",n.style.width="".concat(e.width,"px"),n.style.height="".concat(e.height,"px"),n.style.zIndex="9999",n.style.pointerEvents="none",n.style.touchAction="none",n.style.userSelect="none",n.style.opacity="0.8",n.removeAttribute("qti-draggable"),n.removeAttribute("tabindex"),n.setAttribute("data-drag-clone","true"),document.body.appendChild(n),n}},{key:"updateClonePosition",value:function t(t,e){if(!this.dragState.dragClone)return;var n=this.dragState,i=n.startOffset,o=t-i.x,a=e-i.y;this.dragState.dragClone.style.left="".concat(o,"px"),this.dragState.dragClone.style.top="".concat(a,"px")}},{key:"activateAllDroppables",value:function t(){this.setInternalsState("--dragzone-enabled",!0),this.setInternalsState("--dragzone-active",!0),this.allDropzones.forEach(function(t){t.setAttribute("enabled",""),t.setAttribute("active","")})}},{key:"deactivateAllDroppables",value:function t(){this.setInternalsState("--dragzone-enabled",!1),this.setInternalsState("--dragzone-active",!1),this.allDropzones.forEach(function(t){t.removeAttribute("enabled"),t.removeAttribute("active"),t.removeAttribute("hover")})}},{key:"resetDragState",value:function t(){if(this.dragState.activationTimeout&&clearTimeout(this.dragState.activationTimeout),this.dragState.touchCleanup)try{this.dragState.touchCleanup()}catch(t){console.warn("⚠️ [Observable DnD] Error during touch cleanup:",t)}this.dragSubscriptions.forEach(function(t){try{t&&typeof t.unsubscribe=="function"&&t.unsubscribe()}catch(t){console.warn("⚠️ [Observable DnD] Error unsubscribing:",t)}}),this.dragSubscriptions=[],this.dragState={dragging:!1,dragSource:null,dragClone:null,startOffset:{x:0,y:0},currentTarget:null,sourceDroppable:null,inputType:null,pointerId:void 0,startedFromTrustedEvent:void 0,touchCleanup:void 0}}},{key:"setInternalsState",value:function t(t,e){var n=this._internals;(n===null||n===void 0?void 0:n.states)&&(e?n.states.add(t):n.states.delete(t))}},{key:"cleanup",value:function t(){this.subscriptions.forEach(function(t){try{t.unsubscribe()}catch(t){}}),this.subscriptions=[],this.dragState.dragClone&&this.dragState.dragClone.remove(),this.resetDragState()}}]);return u}(t);return u};var d2={duration:250,easing:"ease",fill:"both"};var d3=function t(t,e,n){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:'slot[part="drags"]',a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"closestCornersWithInventoryPriority";var u=d1(t,e,n,i,a);var c=/*#__PURE__*/function(t){"use strict";v(n,t);function n(){l(this,n);var t;t=s(this,n,arguments);t.configuration={copyStylesDragClone:!0,dragCanBePlacedBack:!0,dragOnClick:!1};t.minAssociations=1;t._maxAssociations=0;t._maxAssociationsDefaultApplied=!1;t._response=[];t._dropBlockedDueToMax=!1;t.flipAnimationConfig={duration:200,easing:"ease"};t._enableFlipAnimations=!0;t.autoSizeDropzones=!1;return t}d(n,[{key:"maxAssociations",get:function t(){if(!this._maxAssociationsDefaultApplied){var t;this._maxAssociationsDefaultApplied=!0;var e=((t=this.tagName)===null||t===void 0?void 0:t.toLowerCase())||"";(e==="qti-graphic-gap-match-interaction"||e==="qti-gap-match-interaction")&&!this.hasAttribute("max-associations")&&this._maxAssociations===0&&(this._maxAssociations=1)}return this._maxAssociations},set:function t(t){var e=this._maxAssociations;this._maxAssociations=t,this.requestUpdate("maxAssociations",e)}},{key:"disableAnimations",get:function t(){return!this._enableFlipAnimations},set:function t(t){this._enableFlipAnimations=!t}},{key:"enableFlipAnimations",get:function t(){return this._enableFlipAnimations}},{key:"response",get:function t(){var t=this.getResponse,n=typeof t=="function"?t.call(this):void 0;return(Array.isArray(n)?n:(this.cacheInteractiveElements(),rs(this.trackedDroppables,e))).join(",")},set:function t(t){var n=this;if(Array.isArray(t)){var i=this.getValue,o=typeof i=="function"?i.call(this,t):t,a=Array.isArray(o)?o:typeof o=="string"&&o.length>0?[o]:[];this.reset(!1),a.forEach(function(t){return n.placeResponse(t)});var s=this.getResponse,l=typeof s=="function"?s.call(this):void 0;this._response=Array.isArray(l)?l:(this.cacheInteractiveElements(),rs(this.trackedDroppables,e))}else this._response=typeof t=="string"&&t.length>0?[t]:[];this._internals.setFormValue(JSON.stringify(this._response))}},{key:"afterCache",value:function t(){this.applyConfiguredChoicesContainerWidth(),this.updateMinDimensionsForDropZones()}},{key:"applyConfiguredChoicesContainerWidth",value:function t(){var t=this.dataset.choicesContainerWidth;t&&this.trackedDroppables.forEach(function(e){e.style.width="".concat(t,"px"),e.style.boxSizing="border-box"})}},{key:"shouldTreatBlockedMaxAsInvalid",value:function t(){return!0}},{key:"shouldReturnToInventoryOnInventoryDrop",value:function t(){return!1}},{key:"getFirstMessageAttribute",value:function t(t){var e=true,n=false,i=undefined;try{for(var o=t[Symbol.iterator](),a;!(e=(a=o.next()).done);e=true){var s=a.value;var l=this.getAttribute(s);if(l&&l.trim().length>0)return l}}catch(t){n=true;i=t}finally{try{if(!e&&o.return!=null){o.return()}}finally{if(n){throw i}}}var u=t.map(function(t){return t.toLowerCase()});var c=true,d=false,h=undefined;try{for(var f=Array.from(this.attributes)[Symbol.iterator](),p;!(c=(p=f.next()).done);c=true){var v=p.value;if(u.includes(v.name.toLowerCase())&&v.value.trim().length>0)return v.value}}catch(t){d=true;h=t}finally{try{if(!c&&f.return!=null){f.return()}}finally{if(d){throw h}}}return null}},{key:"allowDrop",value:function t(t,e){if(this.trackedDragContainers.includes(e))return!0;var n=this.trackedDroppables.includes(e),i=e.hasAttribute("disabled"),o=e.hasAttribute("data-drag-source");return n&&(!i||o)}},{key:"handleDrop",value:function t(t,n){var i;var o=(i=this.dragState.dragClone)===null||i===void 0?void 0:i.getBoundingClientRect();this.dropDraggableInDroppable(t,n,o);var a=t.getAttribute("identifier");a&&this.updateInventoryBasedOnMatchMax(a);var s=ra(this.trackedDroppables,e);this.maxAssociations>0&&s>this.maxAssociations&&(this._dropBlockedDueToMax=!0,this.validate(),this.reportValidity())}},{key:"handleInvalidDrop",value:function t(t){var n=this.dragState.sourceDroppable,i=this.dragState.currentTarget,o=!i,a=this.trackedDragContainers[0]||null;if(!t)return;n&&o&&a&&this.configuration.dragCanBePlacedBack!==!1?this.dropDraggableInDroppable(t,a):n&&this.trackedDroppables.includes(n)?this.dropDraggableInDroppable(t,n):t.style.opacity==="0"&&(this.restoreInventoryItem(t),this.cacheInteractiveElements(),this.checkAllMaxAssociations());var s=ra(this.trackedDroppables,e),l=this.maxAssociations>0&&s>=this.maxAssociations,u=!!i&&i.hasAttribute("disabled")&&!i.hasAttribute("data-drag-source");this._dropBlockedDueToMax=u&&l,this.validate(),this.reportValidity()}},{key:"updateMinDimensionsForDropZones",value:function t(){this.trackedDraggables.length!==0&&rl(this.trackedDraggables,this.trackedDroppables,this.trackedDragContainers)}},{key:"restoreInventoryItem",value:function t(t){t.style.opacity="1.0",t.style.display="",t.style.position="",t.style.pointerEvents="auto"}},{key:"placeResponse",value:function t(t){var e=this;var n=O(t.split(" ").reverse()),i=n[0],o=n.slice(1),a=this.trackedDroppables.find(function(t){return t.getAttribute("identifier")===i});a&&o.forEach(function(t){if(!t)return;var n=rr(e.trackedDragContainers,t).at(0)||e.trackedDraggables.find(function(e){return e.getAttribute("identifier")===t});n&&e.dropDraggableInDroppable(n,a)})}},{key:"dropDraggableInDroppable",value:function t(t,n,i){var o=this;if(this.trackedDragContainers.includes(n)){if(!this.dragState.sourceDroppable){if(this.shouldReturnToInventoryOnInventoryDrop()){this.returnToInventory(t),this._dropBlockedDueToMax=!1,this.validate();return}this.restoreInventoryItem(t),this.cacheInteractiveElements(),this.checkAllMaxAssociations(),this._dropBlockedDueToMax=!1,this.validate();return}var a=t.getAttribute("identifier");t.remove(),a&&this.restoreOriginalInInventory(a),this.cacheInteractiveElements(),this.checkAllMaxAssociations(),this._dropBlockedDueToMax=!1,this.validate();return}var s=parseInt(n.getAttribute("match-max")||"1",10),l=Number.isNaN(s)?1:s,u=l===0||l>1,c=Array.from(n.querySelectorAll('[qti-draggable="true"]')),d=this.enableFlipAnimations&&c.length>0?rd(c):null;if(!u){var h=n.querySelector(e)||n.querySelector('[qti-draggable="true"]');if(h){var f=h.getAttribute("identifier");h.remove(),f&&this.restoreOriginalInInventory(f)}}var p=t.cloneNode(!0);p.removeAttribute("style"),p.removeAttribute("data-keyboard-dragging"),p.setAttribute("qti-draggable","true"),p.setAttribute("tabindex","0"),n.tagName==="SLOT"?p.setAttribute("slot",n.getAttribute("name")||""):n.tagName==="QTI-SIMPLE-ASSOCIABLE-CHOICE"?(p.setAttribute("slot","qti-simple-associable-choice"),n.appendChild(p),n.setAttribute("data-has-drop","true")):n.appendChild(p),d&&this.enableFlipAnimations&&rp(d,this.flipAnimationConfig),i&&this.enableFlipAnimations&&requestAnimationFrame(function(){var t=p.getBoundingClientRect(),e=i.left-t.left,n=i.top-t.top;(e!==0||n!==0)&&p.animate([{transform:"translate(".concat(e,"px, ").concat(n,"px)"),opacity:.8},{transform:"translate(0, 0)",opacity:1}],{duration:o.flipAnimationConfig.duration||200,easing:o.flipAnimationConfig.easing||"ease",fill:"both"})});var v=t.getAttribute("identifier");v&&this.updateInventoryBasedOnMatchMax(v),this.cacheInteractiveElements(),this.checkAllMaxAssociations()}},{key:"returnToInventory",value:function t(t){var e=t.getAttribute("identifier");e&&(this.trackedDroppables.forEach(function(t){Array.from(t.querySelectorAll('[identifier="'.concat(e,'"][qti-draggable="true"]'))).forEach(function(e){e.remove(),t.tagName==="QTI-SIMPLE-ASSOCIABLE-CHOICE"&&t.removeAttribute("data-has-drop")})}),this.restoreOriginalInInventory(e)),this.cacheInteractiveElements(),this.checkAllMaxAssociations()}},{key:"restoreOriginalInInventory",value:function t(t){var e=rr(this.trackedDragContainers,t),n=[];this.trackedDragContainers.forEach(function(t){var e;(e=n).push.apply(e,N(Array.from(t.querySelectorAll('[qti-draggable="true"]'))))});var i=this.enableFlipAnimations&&n.length>0?rd(n):null;e.forEach(function(t){t.style.opacity="1.0",t.style.pointerEvents="auto",t.style.display="",t.style.visibility="visible",t.style.setProperty("opacity","1.0","important"),t.style.setProperty("pointer-events","auto","important")}),i&&this.enableFlipAnimations&&rp(i,this.flipAnimationConfig)}},{key:"updateInventoryBasedOnMatchMax",value:function t(t){var e=rr(this.trackedDragContainers,t),n=ri(this.trackedDraggables,t),i=this.trackedDroppables.reduce(function(e,n){var i=n.querySelectorAll('[identifier="'.concat(t,'"]'));return e+i.length},0);e.forEach(function(t){n!==0&&i>=n?(t.style.opacity="0.0",t.style.pointerEvents="none"):(t.style.opacity="1.0",t.style.pointerEvents="auto")})}},{key:"checkAllMaxAssociations",value:function t(){var t=ra(this.trackedDroppables,e),n=this.maxAssociations>0&&t>=this.maxAssociations;this.trackedDroppables.forEach(function(t){var i=t.hasAttribute("data-drag-source"),o=ro(t,e);(n||o)&&!i?t.setAttribute("disabled",""):t.removeAttribute("disabled")})}},{key:"saveResponse",value:function t(t){var n=this.getResponse,i=t!==null&&t!==void 0?t:typeof n=="function"?n.call(this):void 0,o=Array.isArray(i)?i:typeof i=="string"?[i]:(this.cacheInteractiveElements(),rs(this.trackedDroppables,e));this._response=o,this._internals.setFormValue(JSON.stringify(this._response)),this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:this.responseIdentifier,response:o}})),this.requestUpdate()}},{key:"reset",value:function t(){var t=this;var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.trackedDroppables.forEach(function(t){Array.from(t.querySelectorAll(e)).forEach(function(t){return t.remove()}),t.tagName==="QTI-SIMPLE-ASSOCIABLE-CHOICE"&&t.removeAttribute("data-has-drop")}),this.trackedDraggables.forEach(function(e){var n=e.getAttribute("identifier");n&&t.restoreOriginalInInventory(n)}),this.resetDragState(),this.cacheInteractiveElements(),this._response=[],this._internals.setFormValue(JSON.stringify(this._response)),n&&this.saveResponse()}},{key:"validate",value:function t(){var t,n;var i=ra(this.trackedDroppables,e),o=this.maxAssociations>0&&i>=this.maxAssociations,a=this.maxAssociations>0&&i>this.maxAssociations,s=this.minAssociations>0&&i<this.minAssociations,l="",u=!0;a?(l=this.getFirstMessageAttribute(["data-max-associations-message","data-max-selections-message"])||this.dataset.maxAssociationsMessage||this.dataset.maxSelectionsMessage||"You've selected too many associations. Maximum allowed is ".concat(this.maxAssociations,"."),u=!1):o&&this._dropBlockedDueToMax&&this.shouldTreatBlockedMaxAsInvalid()?(l=this.getFirstMessageAttribute(["data-max-associations-message","data-max-selections-message"])||this.dataset.maxAssociationsMessage||this.dataset.maxSelectionsMessage||"You've selected too many associations. Maximum allowed is ".concat(this.maxAssociations,"."),u=!1):s?(l=this.getFirstMessageAttribute(["data-min-associations-message","data-min-selections-message"])||this.dataset.minAssociationsMessage||this.dataset.minSelectionsMessage||"Please select at least ".concat(this.minAssociations," ").concat(this.minAssociations===1?"association":"associations","."),u=!1,this._dropBlockedDueToMax=!1):this._dropBlockedDueToMax=!1;var c=(t=(n=this.trackedDroppables[0])!==null&&n!==void 0?n:this.trackedDraggables[0])!==null&&t!==void 0?t:this;return this._internals.setValidity(u?{}:{customError:!0},l,c),u}},{key:"reportValidity",value:function t(){var t;var e=this._internals.reportValidity(),n=(t=this.shadowRoot)===null||t===void 0?void 0:t.querySelector("#validation-message");return n&&(e?(n.textContent="",n.style.display="none"):(n.textContent=this._internals.validationMessage,n.style.setProperty("display","block","important"))),e}}]);return n}(u);return rj([o({attribute:!1,type:Object})],c.prototype,"configuration",2),rj([o({type:Number,reflect:!0,attribute:"min-associations"})],c.prototype,"minAssociations",2),rj([o({type:Number,reflect:!0,attribute:"max-associations"})],c.prototype,"maxAssociations",1),rj([o({type:Boolean,attribute:"disable-animations"})],c.prototype,"disableAnimations",1),rj([o({type:Boolean,attribute:"auto-size-dropzones"})],c.prototype,"autoSizeDropzones",2),c};var d5=/*#__PURE__*/function(){"use strict";function t(){l(this,t)}d(t,[{key:"getInsertPosition",value:function t(t,e,n,i,o){var a=t.indexOf(n);if(a===-1)return null;var s=n.getBoundingClientRect(),l=(o-s.top)/s.height,u=Math.min(1,Math.max(0,l))>.5;return{index:a,placeAfter:u}}}]);return t}();var d4=new d5;var d6={borderStyle:"2px dashed",borderColor:"var(--qti-drop-placeholder, #c1c1c1)",background:"transparent",transitionDuration:150};var d8=function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:'[qti-draggable="true"]';var n,i,o,a,u,c,h,m,g,y,b,w,q;var k=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,u);rB(t,n,null);rB(t,i,rv());rB(t,o,{hoveredSlot:null,originalPositions:new Map});rB(t,a,new Set);t.allowReorder=!0;t.sortablePlaceholderConfig={};t.sortableAnimationConfig={duration:150,easing:"ease"};return t}d(e,[{key:"isDraggingFromSlot",get:function t(){return rz(this,n)!==null}},{key:"findContainingDroppable",value:function t(t){return ry(t,this.trackedDroppables)}},{key:"initiateDrag",value:function t(t,o,s,l){var c=this;for(var d=arguments.length,v=new Array(d>4?d-4:0),m=4;m<d;m++){v[m-4]=arguments[m]}rH(this,n,null),rH(this,i,rv()),rQ(this,u,b).call(this);var g=this.findContainingDroppable(t);if(g&&this.allowReorder){rH(this,n,g),rz(this,i).sortContainer=g;var w=t.getBoundingClientRect();rz(this,i).placeholder=rg(t,w,this.sortablePlaceholderConfig);var q=t.getAttribute("slot");q&&rz(this,i).placeholder.setAttribute("slot",q),rz(this,i).placeholder.style.visibility="hidden",g.appendChild(rz(this,i).placeholder),this.trackedDroppables.forEach(function(t){if(t!==g&&t.hasAttribute("disabled")){if(rQ(c,u,h).call(c,t)&&rQ(c,u,y).call(c,t))return;t.removeAttribute("disabled"),rz(c,a).add(t)}})}var k=T(v,1),x=k[0];f(p(e.prototype),"initiateDrag",this).call(this,t,o,s,l,x)}},{key:"cleanupSortableState",value:function t(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;var e=true,s=false,l=undefined;if(t)try{for(var c=rz(this,o).originalPositions[Symbol.iterator](),d;!(e=(d=c.next()).done);e=true){var h=T(d.value,2),f=h[0],p=h[1];p.appendChild(f)}}catch(t){s=true;l=t}finally{try{if(!e&&c.return!=null){c.return()}}finally{if(s){throw l}}}rz(this,i).placeholder&&rz(this,i).placeholder.remove(),rm(rz(this,i)),rz(this,a).clear(),rH(this,n,null),rQ(this,u,b).call(this)}},{key:"onSortableDragMove",value:function t(t,e){if(!this.isDraggingFromSlot)return;var n=re(this.trackedDroppables,t,e,this.dragState.dragClone,this.collisionDetectionAlgorithm);n?rQ(this,u,w).call(this,n):rQ(this,u,q).call(this)}},{key:"handleDragMove",value:function t(t,n){var i;(i=Object.getPrototypeOf(e.prototype).handleDragMove)===null||i===void 0?void 0:i.call(this,t,n),this.onSortableDragMove(t,n)}},{key:"allowDrop",value:function t(t,n){return this.isDraggingFromSlot&&this.trackedDroppables.includes(n)?rQ(this,u,h).call(this,n)?!rQ(this,u,y).call(this,n):!0:this.isDraggingFromSlot&&this.trackedDragContainers.includes(n)?!0:f(p(e.prototype),"allowDrop",this).call(this,t,n)}},{key:"handleDrop",value:function t(t,n){f(p(e.prototype),"handleDrop",this).call(this,t,n),this.cleanupSortableState(!1)}},{key:"handleInvalidDrop",value:function t(t){this.cleanupSortableState(),f(p(e.prototype),"handleInvalidDrop",this).call(this,t)}}]);return e}(t);n=new WeakMap,i=new WeakMap,o=new WeakMap,a=new WeakMap,u=new WeakSet,c=function t(t){return t.querySelector(e)},h=function t(t){var e=rQ(this,u,m).call(this,t);return e===0||e>1},m=function t(t){var e=parseInt(t.getAttribute("match-max")||"1",10);return Number.isNaN(e)?1:e},g=function t(t){return t.querySelectorAll(e).length},y=function t(t){var e=rQ(this,u,m).call(this,t);return e===0?!1:rQ(this,u,g).call(this,t)>=e},b=function t(){rH(this,o,{hoveredSlot:null,originalPositions:new Map})},w=function t(t){if(!rz(this,n)||t===rz(this,n)){rQ(this,u,q).call(this);return}if(rz(this,o).hoveredSlot===t)return;rQ(this,u,q).call(this);var e=rQ(this,u,c).call(this,t);if(!e){rz(this,i).placeholder&&t.appendChild(rz(this,i).placeholder),rz(this,o).hoveredSlot=t;return}if(rQ(this,u,h).call(this,t)){if(rQ(this,u,y).call(this,t)){rz(this,i).placeholder&&rz(this,n)&&rz(this,n).appendChild(rz(this,i).placeholder),rz(this,o).hoveredSlot=null;return}rz(this,i).placeholder&&t.appendChild(rz(this,i).placeholder),rz(this,o).hoveredSlot=t;return}var a=rd([e]);rz(this,o).originalPositions.set(e,t),rz(this,i).placeholder&&rz(this,i).placeholder.parentElement&&rz(this,i).placeholder.remove(),rz(this,n).appendChild(e),rz(this,i).placeholder&&t.appendChild(rz(this,i).placeholder),rz(this,o).hoveredSlot=t,rp(a,this.sortableAnimationConfig)},q=function t(){if(rz(this,o).originalPositions.size===0&&rz(this,o).hoveredSlot===null)return;var t=Array.from(rz(this,o).originalPositions.keys()),e=t.length>0?rd(t):null;var a=true,s=false,l=undefined;try{for(var u=rz(this,o).originalPositions[Symbol.iterator](),c;!(a=(c=u.next()).done);a=true){var d=T(c.value,2),h=d[0],f=d[1];f.appendChild(h)}}catch(t){s=true;l=t}finally{try{if(!a&&u.return!=null){u.return()}}finally{if(s){throw l}}}rz(this,i).placeholder&&rz(this,n)&&rz(this,n).appendChild(rz(this,i).placeholder),e&&rp(e,this.sortableAnimationConfig),rz(this,o).originalPositions.clear(),rz(this,o).hoveredSlot=null};var x=k;return x};var d7=iM(eV());var d9=d3(al,"qti-simple-associable-choice",".dl","slot[name='qti-simple-associable-choice']","pointerWithin"),ht=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e);t._childrenMap=[];t._registerChoiceHandler=t._registerChoice.bind(t),t.addEventListener("register-qti-simple-associable-choice",t._registerChoiceHandler);return t}d(e,[{key:"_registerChoice",value:function t(t){var e;var n=t.composedPath()[0];if((e=this.shadowRoot)===null||e===void 0?void 0:e.contains(n))return;var i=n;this._childrenMap.includes(i)||(this._childrenMap=N(this._childrenMap).concat([i]))}},{key:"getResponse",value:function t(){var t=Math.ceil(this._childrenMap.length/2),e=[];for(var n=0;n<t;n++){var i,o,a,s;var l=(i=this.shadowRoot)===null||i===void 0?void 0:i.querySelector('.dl[identifier="droplist'.concat(n,'_left"]')),u=(o=this.shadowRoot)===null||o===void 0?void 0:o.querySelector('.dl[identifier="droplist'.concat(n,'_right"]')),c=l===null||l===void 0?void 0:(a=l.querySelector('[qti-draggable="true"]'))===null||a===void 0?void 0:a.getAttribute("identifier"),d=u===null||u===void 0?void 0:(s=u.querySelector('[qti-draggable="true"]'))===null||s===void 0?void 0:s.getAttribute("identifier");c&&d&&e.push("".concat(c," ").concat(d))}return e}},{key:"getValue",value:function t(t){var e;return(e=t===null||t===void 0?void 0:t.flatMap(function(t,e){var n=t.split(" ");return n.length!==2?[]:["".concat(n[0]," droplist").concat(e,"_left"),"".concat(n[1]," droplist").concat(e,"_right")]}))!==null&&e!==void 0?e:[]}},{key:"render",value:function t(){return ol(eW(),this._childrenMap.length>0&&Array.from(Array(Math.ceil(this._childrenMap.length/2)).keys()).map(function(t,e){return ol(e$(),e,e,e,e)}))}},{key:"updated",value:function t(t){f(p(e.prototype),"updated",this).call(this,t),t.has("_childrenMap")&&this.cacheInteractiveElements()}},{key:"disconnectedCallback",value:function t(){f(p(e.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("register-qti-simple-associable-choice",this._registerChoiceHandler)}}]);return e}(d8(d9,'[qti-draggable="true"]'));ht.styles=d7,rj([u()],ht.prototype,"_childrenMap",2);customElements.define("qti-associate-interaction",ht);var he=function t(t,n){var i=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t._choiceElements=[];t._mutationObserver=null;t._validationMessageShown=!1;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.response="";t._handleValueChange=function(){t._internals.setFormValue(t.value),t._updateChoiceSelection()};return t}d(e,[{key:"_handleMaxChoicesChange",value:function t(t,e){this._determineInputType()}},{key:"value",get:function t(){return Array.isArray(this.response)&&this.response.length===0||this.response===""?null:Array.isArray(this.response)?this.response.join(","):this.response},set:function t(t){this.maxChoices>1&&(typeof t=="string"||t===null)?this.response=t?t.toString().split(","):[]:this.response=t||""}},{key:"toggleInternalCorrectResponse",value:function t(t){var e=this.correctResponse;if(e){var n=Array.isArray(e)?e:[e];this._choiceElements.forEach(function(e){e.internals.states.delete("correct-response"),e.internals.states.delete("incorrect-response"),t&&n.length>0&&(n.includes(e.identifier)?e.internals.states.add("correct-response"):e.internals.states.add("incorrect-response"))})}}},{key:"toggleCandidateCorrection",value:function t(t){var n=this.correctResponse;if(!n)return;var i=Array.isArray(n)?n:[n],o=this.response,a=Array.isArray(o)?o:o?[o]:[];this._choiceElements.forEach(function(e){e.internals.states.delete("candidate-correct"),e.internals.states.delete("candidate-incorrect"),t&&a.includes(e.identifier)&&(i.includes(e.identifier)?e.internals.states.add("candidate-correct"):e.internals.states.add("candidate-incorrect"))}),f(p(e.prototype),"toggleCandidateCorrection",this).call(this,t)}},{key:"connectedCallback",value:function t(){var t=this;f(p(e.prototype),"connectedCallback",this).call(this),this.addEventListener("activate-".concat(n),this._choiceElementSelectedHandler),this._mutationObserver=new MutationObserver(function(){return t._syncChoicesFromDOM()}),this._mutationObserver.observe(this,{childList:!0,subtree:!0}),this._syncChoicesFromDOM()}},{key:"disconnectedCallback",value:function t(){f(p(e.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("activate-".concat(n),this._choiceElementSelectedHandler),this._mutationObserver&&(this._mutationObserver.disconnect(),this._mutationObserver=null)}},{key:"_syncChoicesFromDOM",value:function t(){var t=this;var e=new Set(this._choiceElements);this._choiceElements=Array.from(this.querySelectorAll(n)),this._choiceElements.forEach(function(n){e.has(n)||(t.disabled&&(n.disabled=!0),n.readonly=t.readonly,n.internals&&!n.internals.ariaChecked&&(n.internals.ariaChecked="false"),t._setInputType(n))});var i=new Set(this._choiceElements.map(function(t){return t.identifier}));if(Array.isArray(this.response)){var o=this.response.filter(function(t){return i.has(t)});o.length!==this.response.length&&(this.response=o)}else this.response&&!i.has(this.response)&&(this.response="");this._updateChoiceSelection()}},{key:"validate",value:function t(){var t=this;var e=this._choiceElements.filter(function(e){return t._getChoiceChecked(e)}).length,n=!0,i="";this.maxChoices!==0&&e>this.maxChoices?(n=!1,i=this.dataset.maxSelectionsMessage||"Please select no more than ".concat(this.maxChoices," ").concat(this.maxChoices===1?"option":"options",".")):e<this.minChoices&&(n=!1,i=this.dataset.minSelectionsMessage||"Please select at least ".concat(this.minChoices," ").concat(this.minChoices===1?"option":"options","."));var o=this._choiceElements.find(function(e){return t.contains(e)})||this;return this._internals.setValidity(n?{}:{customError:!0},i,o),n}},{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.setProperty("display","block","important"),this._validationMessageShown=!0)),this._internals.validity.valid}},{key:"_determineInputType",value:function t(){var t=this;this._choiceElements.forEach(function(e){t._setInputType(e)})}},{key:"_setInputType",value:function t(t){return a(function(){var e;return $(this,function(n){if(this._internals.role=this.maxChoices===1?"radiogroup":null,t.internals){e=this.maxChoices===1?"radio":"checkbox";t.internals.role=e,t.internals.states.delete(e==="radio"?"checkbox":"radio"),t.internals.states.add(e)}return[2]})}).call(this)}},{key:"_choiceElementSelectedHandler",value:function t(t){var e=this;var n;this._toggleChoiceChecked(t.target),this.maxChoices===1?this._choiceElements.forEach(function(n){n.identifier!==t.detail.identifier&&e._setChoiceChecked(n,!1)}):this.maxChoices!==0&&((n=this._configContext)===null||n===void 0?void 0:n.disableAfterIfMaxChoicesReached)&&(this._choiceElements.filter(function(t){return e._getChoiceChecked(t)}).length>=this.maxChoices?this._choiceElements.forEach(function(t){e._getChoiceChecked(t)||(t.disabled=!0)}):this._choiceElements.forEach(function(t){return t.disabled=!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.response=this.maxChoices===1?e[0]||"":e,this.validate(),this._validationMessageShown&&(this.reportValidity(),this._internals.validity.valid&&(this._validationMessageShown=!1)),this.saveResponse(this.response)}},{key:"_updateChoiceSelection",value:function t(){var t=this;var e=Array.isArray(this.response)?this.response:[this.response];this._choiceElements.forEach(function(n){var i=e.includes(n.identifier);t._setChoiceChecked(n,i)})}}]);return e}(t);return rj([c("#validation-message")],i.prototype,"_validationMessageElement",2),rj([o({type:Number,attribute:"min-choices"})],i.prototype,"minChoices",2),rj([o({type:Number,attribute:"max-choices"})],i.prototype,"maxChoices",2),rj([y("maxChoices")],i.prototype,"_handleMaxChoicesChange",1),rj([y("disabled",{waitUntilFirstUpdate:!0})],i.prototype,"_handleDisabledChange",2),rj([y("readonly",{waitUntilFirstUpdate:!0})],i.prototype,"_handleReadonlyChange",2),rj([u()],i.prototype,"response",2),rj([y("response",{waitUntilFirstUpdate:!0})],i.prototype,"_handleValueChange",2),rj([u(),e({context:oL,subscribe:!0})],i.prototype,"_configContext",2),i};var hn=function t(t,e){var n,i,a,u,c,h,m,g,y,b,w,q;var k=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,c);rB(t,n,[]);rB(t,i,["qti-labels-none","qti-labels-decimal","qti-labels-lower-alpha","qti-labels-upper-alpha"]);rB(t,a,["qti-labels-suffix-none","qti-labels-suffix-period","qti-labels-suffix-parenthesis"]);rB(t,u,null);return t}d(e,[{key:"class",get:function t(){return rz(this,n).join(" ")},set:function t(t){rH(this,n,rQ(this,c,h).call(this,t)),rQ(this,c,m).call(this)}},{key:"attributeChangedCallback",value:function t(t,n,i){f(p(e.prototype),"attributeChangedCallback",this).call(this,t,n,i),t==="class"&&n!==i&&(this.class=i!==null&&i!==void 0?i:"")}},{key:"updated",value:function t(t){f(p(e.prototype),"updated",this).call(this,t),rQ(this,c,m).call(this)}},{key:"connectedCallback",value:function t(){var t=this;var n;f(p(e.prototype),"connectedCallback",this).call(this),this.class=(n=this.getAttribute("class"))!==null&&n!==void 0?n:"",rH(this,u,new MutationObserver(function(e){e.some(function(t){return t.type==="childList"||t.type==="attributes"&&t.attributeName==="style"})&&rQ(t,c,m).call(t)})),rz(this,u).observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]})}},{key:"disconnectedCallback",value:function t(){var t;f(p(e.prototype),"disconnectedCallback",this).call(this),(t=rz(this,u))===null||t===void 0?void 0:t.disconnect(),rH(this,u,null)}}]);return e}(t);return n=new WeakMap,i=new WeakMap,a=new WeakMap,u=new WeakMap,c=new WeakSet,h=function t(t){return t?t.split(/\s+/).map(function(t){return t.trim()}).filter(Boolean).filter(function(t,e,n){return n.indexOf(t)===e}):[]},m=function t(){var t=this;var e=Array.from(this.querySelectorAll("qti-simple-choice")).map(function(t){return t}),n=rQ(this,c,g).call(this,e),i=rQ(this,c,y).call(this),o=rQ(this,c,b).call(this);n.forEach(function(e,n){e.marker=rQ(t,c,w).call(t,n+1,i,o)})},g=function t(t){return t.map(function(t,e){var n=Number(t.style.order);return{el:t,order:Number.isFinite(n)?n:e+1,index:e}}).sort(function(t,e){return t.order-e.order||t.index-e.index}).map(function(t){return t.el})},y=function t(){var t=this;var e;return(e=rz(this,n).filter(function(e){return rz(t,i).includes(e)}).pop())!==null&&e!==void 0?e:null},b=function t(){var t=this;var e;return(e=rz(this,n).filter(function(e){return rz(t,a).includes(e)}).pop())!==null&&e!==void 0?e:null},w=function t(t,e,n){var i=e;if(!i&&n&&n!=="qti-labels-suffix-none"&&(i="qti-labels-upper-alpha"),!i||i==="qti-labels-none")return"";var o="";switch(i){case"qti-labels-decimal":o="".concat(t);break;case"qti-labels-lower-alpha":o=rQ(this,c,q).call(this,t,"lower");break;case"qti-labels-upper-alpha":o=rQ(this,c,q).call(this,t,"upper");break}return n==="qti-labels-suffix-period"?"".concat(o,"."):n==="qti-labels-suffix-parenthesis"?"".concat(o,")"):o},q=function t(t,e){var n=t,i="",o=e==="lower"?97:65;for(;n>0;)n-=1,i=String.fromCharCode(o+n%26)+i,n=Math.floor(n/26);return i},rj([o({type:String,attribute:"class"})],k.prototype,"class",1),k};var hr=iM(ej());var hi,ho,ha=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,hi);t.orientation="vertical";return t}d(e,[{key:"render",value:function t(){return ol(eF(),rQ(this,hi,ho))}}]);return e}(hn(he(al,"qti-simple-choice"),"qti-simple-choice"));hi=new WeakSet,ho=function t(){var t=this.querySelectorAll("qti-simple-choice");this.style.setProperty("--item-count",t.length.toString())},ha.styles=hr,rj([o({type:String})],ha.prototype,"orientation",2);customElements.define("qti-choice-interaction",ha);var hs=iM(ez());var hl='\nconst postToParentWindows = (type, data) => {\n window.top.postMessage(data ? { type, data } : { type }, \'*\');\n let w = window.parent;\n while (w) {\n if (w !== window.top) {\n w.postMessage({ type, data }, \'*\');\n }\n if (w !== w.parent) {\n w = w.parent;\n } else {\n w = null;\n }\n }\n};\n\nwindow.CES = {\n media: null,\n response: null,\n load: () => {\n let resolveCount = 0;\n\n const handleMessage = (event) => {\n if (event.data.type === "mediaData") {\n const media = event.data.data;\n CES.media = media;\n resolveCount++;\n } else if (event.data.type === "responseData") {\n const response = event.data.data;\n if (response && Array.isArray(response) && response.length > 0) {\n // state is stored in the first element of the array\n CES.response = response[0];\n // Wait a short moment to ensure CES.response is set\n setTimeout(() => {\n // Re-create the Controller instance if it exists\n if (typeof Controller === \'function\') {\n console.log("Re-creating Controller instance");\n ctrl = new Controller();\n }\n }, 50);\n } else { \n CES.response = response;\n }\n resolveCount++;\n }\n if (resolveCount === 2) {\n //window.removeEventListener("message", handleMessage);\n }\n };\n window.addEventListener("message", handleMessage);\n postToParentWindows("getMedia");\n postToParentWindows("getResponse");\n },\n setResponse: (data) => {\n postToParentWindows("setResponse", data);\n },\n getResponse: () => {\n return CES.response;\n },\n getMedia: () => {\n return CES.media;\n },\n setStageHeight: () => {\n postToParentWindows("setStageHeight");\n },\n};\nCES.load();\n',hu="\n (function() {\n var blobUrlReceived = null;\n \n const createIframe = () => {\n if (!blobUrlReceived || !document.body) return;\n var n = document.createElement('iframe');\n n.frameBorder = '0';\n n.scrolling = 'no';\n n.src = blobUrlReceived;\n n.style.width = '100%';\n n.style.height = '100%';\n document.body.appendChild(n);\n };\n \n const handleMessage = (event) => {\n if (event.data.type === 'blobUrl') {\n blobUrlReceived = event.data.data;\n window.removeEventListener('message', handleMessage);\n createIframe();\n }\n };\n \n window.addEventListener('message', handleMessage);\n \n // Wait for document ready before requesting blobUrl\n const requestBlobUrl = () => {\n let w = window.parent;\n while (w) {\n w.postMessage({ type: 'getBlobUrl' }, '*');\n if (w !== w.parent) {\n w = w.parent;\n } else {\n w = null;\n }\n }\n };\n \n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', requestBlobUrl);\n } else {\n requestBlobUrl();\n }\n })();\n",hc,hd,hh,hf,hp,hv,hm,hg,hy,hb,hw,hq,hk=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e);rB(t,hp);rB(t,hc,"");rB(t,hd,null);rB(t,hh,null);t._errorMessage=null;rB(t,hf,null);t.handlePostMessage=t.handlePostMessage.bind(t);return t}d(e,[{key:"connectedCallback",value:function t(){var t=this;f(p(e.prototype),"connectedCallback",this).call(this);var n=this.data;if(!n){var i=this.querySelector("object[data]");if(i){n=i.getAttribute("data");var o=i.getAttribute("width"),a=i.getAttribute("height");o&&this.setAttribute("width",o),a&&this.setAttribute("height",a)}}if(!n){this._errorMessage="No manifest path found (neither data attribute nor object child)";return}var s=n.startsWith("http")||n.startsWith("blob")?n:x((this.baseItemUrl||"")+"/"+n);rH(this,hd,new URL(s,window.location.href).toString()),fetch(s).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(){return a(function(){var t,e,n,i,o,a,s,l,u,c,d,h,f,p,v,m,g,y,b,w,q,k,x,_,E,C,S,A,R,I,T,M,P,O,N,U,L;return $(this,function(D){switch(D.label){case 0:return[4,this.updateComplete];case 1:D.sent();l=(o=this.shadowRoot)===null||o===void 0?void 0:o.querySelector("#pciContainer");if(!l){this._errorMessage="pciContainer iframe not found";return[2]}l.getAttribute("src")||l.setAttribute("src","about:blank");u=(t=(e=l.contentDocument)!==null&&e!==void 0?e:(a=l.contentWindow)===null||a===void 0?void 0:a.document)!==null&&t!==void 0?t:null;c=u;if(c)return[3,3];return[4,new Promise(function(t){return l.addEventListener("load",function(){return t()},{once:!0})})];case 2:c=(D.sent(),u=(n=(i=l.contentDocument)!==null&&i!==void 0?i:(s=l.contentWindow)===null||s===void 0?void 0:s.document)!==null&&n!==void 0?n:null);D.label=3;case 3:if(c,!u){this._errorMessage="pciContainer iframe document not available";return[2]}if(!this.manifest.script||this.manifest.script.length===0){this._errorMessage="No script found in manifest";return[2]}if(!this.manifest.style||this.manifest.style.length===0){this._errorMessage="No style found in manifest";return[2]}d=this.manifest.style[0],h=rQ(this,hp,hy).call(this);return[4,rQ(this,hp,hq).call(this,d,h)];case 4:f=D.sent(),p=f.url;if(!(f.baseUrl&&!rz(this,hh)&&rH(this,hh,f.baseUrl),!0))return[3,15];v="";if(!(this.manifest.media&&this.manifest.media.length>0))return[3,6];m=this.manifest.media[0];return[4,rQ(this,hp,hq).call(this,m,h,{returnText:!0})];case 5:g=D.sent();if(v=g.url,g.baseUrl&&!rz(this,hh)&&rH(this,hh,g.baseUrl),g.text){y=g.text;if(!(y.includes("postToParentWindows")||y.includes("window.CES"))){b="<script>"+hl+"<\/script>",w=y.indexOf("<head>");w!==-1?y=y.slice(0,w+6)+b+y.slice(w+6):y=b+y}q=new Blob([y],{type:"text/html"});rH(this,hf,URL.createObjectURL(q))}return[3,8];case 6:k=this.data||"manifest.json",x=k.includes("/")?k.substring(0,k.lastIndexOf("/")):"",_=x?"".concat(x,"/index.html"):"index.html";return[4,rQ(this,hp,hq).call(this,_,h,{returnText:!0})];case 7:E=D.sent();if(v=E.url,E.baseUrl&&!rz(this,hh)&&rH(this,hh,E.baseUrl),E.text){C=E.text;if(!(C.includes("postToParentWindows")||C.includes("window.CES"))){S="<script>"+hl+"<\/script>",A=C.indexOf("<head>");A!==-1?C=C.slice(0,A+6)+S+C.slice(A+6):C=S+C}R=new Blob([C],{type:"text/html"});rH(this,hf,URL.createObjectURL(R))}D.label=8;case 8:if(!(v&&!rz(this,hf)))return[3,15];D.label=9;case 9:D.trys.push([9,14,,15]);return[4,fetch(v)];case 10:I=D.sent();if(!I.ok)return[3,12];return[4,I.text()];case 11:T=D.sent();if(!(T.includes("postToParentWindows")||T.includes("window.CES"))){M="<script>"+hl+"<\/script>",P=T.indexOf("<head>");P!==-1?T=T.slice(0,P+6)+M+T.slice(P+6):T=M+T}O=new Blob([T],{type:"text/html"});rH(this,hf,URL.createObjectURL(O));return[3,13];case 12:console.error("Failed to fetch index.html: ".concat(I.status));D.label=13;case 13:return[3,15];case 14:N=D.sent();console.error("Error fetching index.html: ".concat(N));return[3,15];case 15:U="<script>".concat(hu,"<\/script>");window.addEventListener("message",this.handlePostMessage);L="\n <!DOCTYPE html>\n <html>\n <head>\n ".concat(p?"<link href='".concat(p,'\' rel="stylesheet" />'):"","\n ").concat(U,"\n </head>\n <body></body>\n </html>\n ");l.srcdoc=L;return[2]}})}).call(this)}},{key:"handlePostMessage",value:function t(t){var e=this;var n=t.data,i=n.type,o=n.data;switch(i){case"setResponse":(o===null||!(Array.isArray(o)&&o.length===1&&o[0]===""))&&(rH(this,hc,o),this.saveResponse(o));break;case"getResponse":{rQ(this,hp,hg).call(this,"responseData",rz(this,hc));break}case"getBlobUrl":{rz(this,hf)&&(rQ(this,hp,hg).call(this,"blobUrl",rz(this,hf)),t.source&&t.source!==window&&t.source.postMessage({type:"blobUrl",data:rz(this,hf)},"*"));break}case"getMedia":{var a=rQ(this,hp,hy).call(this),s=this.manifest.media.map(function(t){if(t.startsWith("http")||t.startsWith("blob"))return t;var n=rz(e,hh)||a[0];return n?new URL(t,n.endsWith("/")?n:"".concat(n,"/")).toString():t});rQ(this,hp,hg).call(this,"mediaData",s);break}case"setStageHeight":console.log("setStageHeight not implemented");break}}},{key:"validate",value:function t(){if(!rz(this,hc))return!1;if(Array.isArray(rz(this,hc))){if(rz(this,hc).length===0)return!1;var t=true,e=false,n=undefined;try{for(var i=rz(this,hc)[Symbol.iterator](),o;!(t=(o=i.next()).done);t=true){var a=o.value;if(a!==""&&a!==null)return!0}}catch(t){e=true;n=t}finally{try{if(!t&&i.return!=null){i.return()}}finally{if(e){throw n}}}}return!0}},{key:"response",get:function t(){return rz(this,hc)||null},set:function t(t){if(typeof t=="string")rH(this,hc,t),this.saveResponse(t);else if(Array.isArray(t))rH(this,hc,t);else if(t)throw new Error("Value must be a string or an array of strings")}},{key:"disconnectedCallback",value:function t(){window.removeEventListener("message",this.handlePostMessage),f(p(e.prototype),"disconnectedCallback",this).call(this)}},{key:"render",value:function t(){return ol(eH(),this.getAttribute("width"),this.getAttribute("height"),this._errorMessage&&ol(eB(),this._errorMessage))}}]);return e}(al);hc=new WeakMap,hd=new WeakMap,hh=new WeakMap,hf=new WeakMap,hp=new WeakSet,hv=function t(){var t=this.shadowRoot.querySelectorAll("iframe"),e=this.querySelectorAll("iframe"),n=N(t).concat(N(e));var i=true,o=false,a=undefined;try{for(var s=n[Symbol.iterator](),l;!(i=(l=s.next()).done);i=true){var u=l.value;var c=u.src;if(new URL(c,window.location.href).origin===window.location.origin)try{var d=u.contentDocument||u.contentWindow.document;d&&rQ(this,hp,hm).call(this,d,n)}catch(t){console.error("Error accessing nested iframe:",t)}}}catch(t){o=true;a=t}finally{try{if(!i&&s.return!=null){s.return()}}finally{if(o){throw a}}}return n.forEach(function(t,e){n.indexOf(t)!==e&&n.splice(e,1)}),n},hm=function(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 i=t.src;if(new URL(i,window.location.href).origin===window.location.origin)try{var o=t.contentDocument||t.contentWindow.document;rQ(e,hp,hm).call(e,o,n)}catch(t){console.error("Error accessing nested iframe:",t)}else console.warn("Skipped cross-origin iframe:",i)}),n},hg=function t(t,e){window.postMessage({type:t,data:e},"*");var n=rQ(this,hp,hv).call(this);var i=true,o=false,a=undefined;try{for(var s=n[Symbol.iterator](),l;!(i=(l=s.next()).done);i=true){var u=l.value;u.contentWindow&&u.contentWindow.postMessage({type:t,data:e},"*")}}catch(t){o=true;a=t}finally{try{if(!i&&s.return!=null){s.return()}}finally{if(o){throw a}}}},hy=function t(){var t=[rz(this,hh),this.baseRefUrl,this.baseItemUrl,rQ(this,hp,hb).call(this)].filter(Boolean).map(function(t){return new URL(t,window.location.href).toString()}),e=rQ(this,hp,hw).call(this);return e&&t.push(e),N(new Set(t))},hb=function t(){return rz(this,hd)?new URL(".",rz(this,hd)).toString():null},hw=function t(){return rz(this,hd)?new URL("..",rz(this,hd)).toString():null},hq=function t(t,e){return a(function(t,e){var n,i,o,a,s,l,u,c,d,h,f,p,v;var m=arguments;return $(this,function(g){switch(g.label){case 0:n=m.length>2&&m[2]!==void 0?m[2]:{};if(!t)return[2,{url:"",baseUrl:null}];if(t.startsWith("http")||t.startsWith("blob"))return[2,{url:t,baseUrl:null}];i=true,o=false,a=undefined;g.label=1;case 1:g.trys.push([1,11,12,13]);s=e[Symbol.iterator]();g.label=2;case 2:if(!!(i=(l=s.next()).done))return[3,10];u=l.value;c=new URL(u,window.location.href).toString(),d=new URL(t,c.endsWith("/")?c:"".concat(c,"/")).toString();g.label=3;case 3:g.trys.push([3,8,,9]);return[4,fetch(d)];case 4:h=g.sent();if(!h.ok)return[3,7];if(!n.returnText)return[3,6];return[4,h.text()];case 5:f=g.sent();return[2,{url:d,baseUrl:c,text:f}];case 6:return[2,{url:d,baseUrl:c}];case 7:return[3,9];case 8:p=g.sent();return[3,9];case 9:i=true;return[3,2];case 10:return[3,13];case 11:v=g.sent();o=true;a=v;return[3,13];case 12:try{if(!i&&s.return!=null){s.return()}}finally{if(o){throw a}}return[7];case 13:return[2,{url:"",baseUrl:null}]}})}).apply(this,arguments)},hk.styles=hs,rj([o({type:String,attribute:"data"})],hk.prototype,"data",2),rj([o({type:String,attribute:"data-base-item"})],hk.prototype,"baseItemUrl",2),rj([o({type:String,attribute:"data-base-ref"})],hk.prototype,"baseRefUrl",2),rj([o({type:String,attribute:"id"})],hk.prototype,"id",2),rj([u()],hk.prototype,"_errorMessage",2);customElements.define("qti-custom-interaction",hk);var hx=iM(eQ());var h_=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.disabled=!1;t.countAttempt=null;t.title="end attempt";return t}d(e,[{key:"render",value:function t(){return ol(eX(),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}(oR);h_.styles=hx,rj([o({type:String,attribute:"response-identifier"})],h_.prototype,"responseIdentifier",2),rj([o({reflect:!0,type:Boolean})],h_.prototype,"disabled",2),rj([o({type:String,attribute:"count-attempt"})],h_.prototype,"countAttempt",2),rj([o({type:String})],h_.prototype,"title",2);customElements.define("qti-end-attempt-interaction",h_);var hE=iM(eG());var hC=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t._rows=5;t.response=null;t._handleResponseChange=function(){t._internals.setFormValue(t.value),t.validate()};return t}d(e,[{key:"handleclassNamesChange",value:function t(t,e){var n=this;var i=e.split(" "),o=!1;if(i.forEach(function(t){if(t.startsWith("qti-height-lines-")){var e=t.replace("qti-height-lines-","");n._rows=parseInt(e),o=!0}}),!o&&this.expectedLength){var a=Math.ceil(this.expectedLength/50);this._rows=a}}},{key:"value",get:function t(){return this.response||null},set:function t(t){this.response=t||null}},{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 i=t.checkValidity();this._internals.setValidity(i?{}:{customError:!1})}return!!this.response&&t.checkValidity()}},{key:"toggleCorrectResponse",value:function t(){}},{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 ol(eJ(),this.responseIdentifier,5e3,function(t){return t.stopImmediatePropagation()},this.textChanged,this.textChanged,function(e){t.reportValidity()},sh(this.placeholderText?this.placeholderText:void 0),this._rows,this.disabled,this.readonly,this.response)}},{key:"textChanged",value:function t(t){if(this.disabled||this.readonly)return;var e=t.target;this.setEmptyAttribute(e.value),this.response!==e.value&&(this.value=e.value,this.saveResponse(e.value))}},{key:"setEmptyAttribute",value:function t(t){this.setAttribute("empty",t===""?"true":"false")}}]);return e}(al);hC.styles=hE,rj([u()],hC.prototype,"_rows",2),rj([o({type:Number,attribute:"expected-length"})],hC.prototype,"expectedLength",2),rj([o({type:String,attribute:"pattern-mask"})],hC.prototype,"patternMask",2),rj([o({type:String,attribute:"placeholder-text"})],hC.prototype,"placeholderText",2),rj([o({type:String,attribute:"data-patternmask-message"})],hC.prototype,"dataPatternmaskMessage",2),rj([o({type:String,attribute:"class"})],hC.prototype,"classNames",2),rj([y("classNames")],hC.prototype,"handleclassNamesChange",1),rj([u()],hC.prototype,"response",2),rj([y("response",{waitUntilFirstUpdate:!0})],hC.prototype,"_handleResponseChange",2);customElements.define("qti-extended-text-interaction",hC);var hS=iM(eY());var hA=d3(al,"qti-gap-text","qti-gap","slot[part='drags']"),hR,hI,hT=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,hR);return t}d(e,[{key:"render",value:function t(){return ol(eK())}},{key:"toggleCorrectResponse",value:function t(t){var e=this;var n=this.responseVariable;if(t&&(n===null||n===void 0?void 0:n.correctResponse)){var i=[],o=Array.isArray(n.correctResponse)?n.correctResponse:[n.correctResponse];o&&(i=o.map(function(t){var e=t.split(" ");return{text:e[0],gap:e[1]}})),this.querySelectorAll("qti-gap").forEach(function(t){var n,o,a;var s=t.getAttribute("identifier"),l=(n=i.find(function(t){return t.gap===s}))===null||n===void 0?void 0:n.text,u=(o=e.querySelector('qti-gap-text[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",t.insertAdjacentElement("afterend",d)}}else((a=t.nextElementSibling)===null||a===void 0?void 0:a.classList.contains("correct-option"))&&t.nextElementSibling.remove()})}else this.querySelectorAll(".correct-option").forEach(function(t){t.remove()})}},{key:"toggleCandidateCorrection",value:function t(t){var e=this.responseVariable;if(!(e===null||e===void 0?void 0:e.correctResponse))return;var n=rQ(this,hR,hI).call(this,e);Array.from(this.querySelectorAll("qti-gap")).forEach(function(e){var i=e.getAttribute("identifier"),o=n.filter(function(t){return t.target===i});e.querySelectorAll("qti-gap-text").forEach(function(e){var n;if(e.internals.states.delete("candidate-correct"),e.internals.states.delete("candidate-incorrect"),!t)return;((n=o.find(function(t){return t.source===e.identifier}))===null||n===void 0?void 0:n.source)!==void 0?e.internals.states.add("candidate-correct"):e.internals.states.add("candidate-incorrect")})})}}]);return e}(d8(hA,'[qti-draggable="true"]'));hR=new WeakSet,hI=function t(t){if(!t.correctResponse)return[];var e=Array.isArray(t.correctResponse)?t.correctResponse:[t.correctResponse],n=[];return e&&e.forEach(function(t){var e=t.split(" ");n.push({source:e[0],target:e[1]})}),n},hT.styles=hS;customElements.define("qti-gap-match-interaction",hT);var hM=function t(t,e,n){var i=new Map;for(var o=e;o<=n;o++)i.set(t[o],o);return i},hP=oG(/*#__PURE__*/function(t){"use strict";v(e,t);function e(t){l(this,e);var n;if(n=s(this,e,[t]),t.type!==oX.CHILD)throw Error("repeat() can only be used in text expressions");return n}d(e,[{key:"dt",value:function t(t,e,n){var i;n===void 0?n=e:e!==void 0&&(i=e);var o=[],a=[],s=0;var l=true,u=false,c=undefined;try{for(var d=t[Symbol.iterator](),h;!(l=(h=d.next()).done);l=true){var f=h.value;o[s]=i?i(f,s):s,a[s]=n(f,s),s++}}catch(t){u=true;c=t}finally{try{if(!l&&d.return!=null){d.return()}}finally{if(u){throw c}}}return{values:a,keys:o}}},{key:"render",value:function t(t,e,n){return this.dt(t,e,n).values}},{key:"update",value:function t(t,e){var n=T(e,3),i=n[0],o=n[1],a=n[2];var s;var l=o6(t),u=this.dt(i,o,a),c=u.values,d=u.keys;if(!Array.isArray(l))return this.ut=d,c;var h=(s=this.ut)!==null&&s!==void 0?s:this.ut=[],f=[],p,v,m=0,g=l.length-1,y=0,b=c.length-1;for(;m<=g&&y<=b;)if(l[m]===null)m++;else if(l[g]===null)g--;else if(h[m]===d[y])f[y]=o3(l[m],c[y]),m++,y++;else if(h[g]===d[b])f[b]=o3(l[g],c[b]),g--,b--;else if(h[m]===d[b])f[b]=o3(l[m],c[b]),o2(t,f[b+1],l[m]),m++,b--;else if(h[g]===d[y])f[y]=o3(l[g],c[y]),o2(t,l[m],l[g]),g--,y++;else if(p===void 0&&(p=hM(d,y,b),v=hM(h,m,g)),p.has(h[m]))if(p.has(h[g])){var w=v.get(d[y]),q=w!==void 0?l[w]:null;if(q===null){var k=o2(t,l[m]);o3(k,c[y]),f[y]=k}else f[y]=o3(q,c[y]),o2(t,l[m],q),l[w]=null;y++}else o8(l[g]),g--;else o8(l[m]),m++;for(;y<=b;){var x=o2(t,f[b+1]);o3(x,c[y]),f[y++]=x}for(;m<=g;){var _=l[m++];_!==null&&o8(_)}return this.ut=d,o4(t,f),od}}]);return e}(oJ));var hO=iM(eZ());var hN,hU,hL,hD,hV,h$,hW,hj=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e);rB(t,hD);rB(t,hN);rB(t,hU,null);rB(t,hL,null);t._correctLines=[];t._response=[];t.addEventListener("qti-register-hotspot",rQ(t,hD,hW));return t}d(e,[{key:"reset",value:function t(){this._response=[],this._correctLines=[]}},{key:"validate",value:function t(){return rQ(this,hD,h$).call(this).length>0}},{key:"response",get:function t(){return this._response},set:function t(t){this._response=rQ(this,hD,hV).call(this,t)}},{key:"toggleInternalCorrectResponse",value:function t(t){var e=this.responseVariable;if(!t||!e){this._correctLines=[];return}if(!e.correctResponse){console.error("No correct response found for this interaction.");return}var n=Array.isArray(e.correctResponse)?e.correctResponse:[e.correctResponse];this._correctLines=n}},{key:"render",value:function t(){var t=this;var e,n,i,o;return ol(e3(),sh((e=this.grImage[0])===null||e===void 0?void 0:e.width),sh((n=this.grImage[0])===null||n===void 0?void 0:n.height),(i=this.grImage[0])===null||i===void 0?void 0:i.width,(o=this.grImage[0])===null||o===void 0?void 0:o.height,hP(rQ(this,hD,h$).call(this),function(t){return t},function(e,n){return ou(e0(),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._response=t._response.filter(function(t,e){return e!==n}),t.saveResponse(t.response)})}),hP(this._correctLines||[],function(t){return t},function(e,n){return ou(e1(),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))}),rz(this,hU)&&ou(e2(),this.startCoord.x,this.startCoord.y,this.mouseCoord.x,this.mouseCoord.y))}},{key:"firstUpdated",value:function t(){var t=this;rH(this,hN,this.querySelectorAll("qti-associable-hotspot")),this.addEventListener("mousemove",function(e){var n=t.grImage[0];if(!n)return;var i=n.getBoundingClientRect();t.mouseCoord={x:e.clientX-i.left,y:e.clientY-i.top}}),rz(this,hN).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){rz(t,hU)?rz(t,hL)||(rH(t,hL,e.target),t._response=rQ(t,hD,h$).call(t),t._response=N(t._response).concat(["".concat(rz(t,hU).getAttribute("identifier")," ").concat(rz(t,hL).getAttribute("identifier"))]),t.saveResponse(t.response),rH(t,hU,null),rH(t,hL,null)):(rH(t,hU,e.target),t.startCoord={x:parseInt(rz(t,hU).getAttribute("coords").split(",")[0]),y:parseInt(rz(t,hU).getAttribute("coords").split(",")[1])})})})}},{key:"disconnectedCallback",value:function t(){f(p(e.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("qti-register-hotspot",rQ(this,hD,hW))}}]);return e}(al);hN=new WeakMap,hU=new WeakMap,hL=new WeakMap,hD=new WeakSet,hV=function t(t){return t==null||t===""?[]:Array.isArray(t)?t:[t]},h$=function t(){return rQ(this,hD,hV).call(this,this._response)},hW=function t(t){var e=this.querySelector("img"),n=t.target,i=n.getAttribute("coords"),o=n.getAttribute("shape"),a=i.split(",").map(function(t){return parseInt(t)});rb(o,a,e,n)},hj.styles=hO,rj([u()],hj.prototype,"_correctLines",2),rj([u()],hj.prototype,"startCoord",2),rj([u()],hj.prototype,"mouseCoord",2),rj([g({selector:"img"})],hj.prototype,"grImage",2),rj([u()],hj.prototype,"_response",2);customElements.define("qti-graphic-associate-interaction",hj);var hF=iM(e5());var hz=d3(al,"qti-gap-img, qti-gap-text","qti-associable-hotspot","slot[part='drags']"),hB,hH,hQ=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,hB);return t}d(e,[{key:"render",value:function t(){return ol(e4())}},{key:"shouldReturnToInventoryOnInventoryDrop",value:function t(){return!0}},{key:"connectedCallback",value:function t(){f(p(e.prototype),"connectedCallback",this).call(this),this.addEventListener("qti-register-hotspot",rQ(this,hB,hH))}},{key:"disconnectedCallback",value:function t(){f(p(e.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("qti-register-hotspot",rQ(this,hB,hH))}}]);return e}(d8(hz,'[qti-draggable="true"]'));hB=new WeakSet,hH=function t(t){var e=t.target,n=e.getAttribute("coords"),i=e.getAttribute("shape"),o=n.split(",").map(function(t){return parseInt(t)});switch(i){case"circle":{var a=T(o,3),s=a[0],l=a[1],u=a[2];e.style.left=s-u+"px",e.style.top=l-u+"px",e.style.width=e.style.height=2*u+"px"}break;case"rect":{var c=T(o,4),d=c[0],h=c[1],f=c[2],p=c[3];e.style.left=d+"px",e.style.top=h+"px",e.style.width=f-d+"px",e.style.height=p-h+"px"}break;default:break}},hQ.styles=hF;customElements.define("qti-graphic-gap-match-interaction",hQ);var hX=iM(e6());var hG,hJ,hY,hK=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,hG);t._choiceElements=[];return t}d(e,[{key:"render",value:function t(){return ol(e8())}},{key:"toggleCorrectResponse",value:function t(t){var e;var n=this.responseVariable,i=this._choiceElements;var o=true,a=false,s=undefined;try{var l=function(){var i=c.value;if(t&&(n===null||n===void 0?void 0:(e=n.correctResponse)===null||e===void 0?void 0:e.length)>0&&Array.isArray(n.correctResponse)){var o=n.correctResponse.findIndex(function(t){return t===i.identifier});o>=0?i.orderCorrect=o+1:i.orderCorrect=null}else i.orderCorrect=null};for(var u=i[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}}}}},{key:"connectedCallback",value:function t(){f(p(e.prototype),"connectedCallback",this).call(this),this.addEventListener("activate-qti-hotspot-choice",rQ(this,hG,hJ)),this.addEventListener("register-qti-hotspot-choice",rQ(this,hG,hY))}},{key:"disconnectedCallback",value:function t(){f(p(e.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("activate-qti-hotspot-choice",rQ(this,hG,hJ)),this.removeEventListener("register-qti-hotspot-choice",rQ(this,hG,hY))}}]);return e}(he(al,"qti-hotspot-choice"));hG=new WeakSet,hJ=function t(t){var e=t.detail,n=e.identifier,i=this._choiceElements.find(function(t){return t.getAttribute("identifier")===n});if(!i)return;var o=this._choiceElements.length;if(!this.choiceOrdering){if(this.choiceOrdering=!0,i.order==null){var a=this._choiceElements.filter(function(t){return t.order!=null}).length;if(a>=o){this.choiceOrdering=!1;return}i.order=a+1}else{var s=i.order;i.order=null,this._choiceElements.forEach(function(t){t.order!=null&&t.order>s&&t.order--})}this.choiceOrdering=!1}},hY=function t(t){var e=this.querySelector("img"),n=t.target,i=n.getAttribute("coords"),o=n.getAttribute("shape"),a=i.split(",").map(function(t){return parseInt(t)});rb(o,a,e,n)},hK.styles=hX;customElements.define("qti-graphic-order-interaction",hK);var hZ=iM(e7());var h0,h1,h2,h3,h5=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,h1);rB(t,h0,null);return t}d(e,[{key:"render",value:function t(){return ol(e9())}},{key:"connectedCallback",value:function t(){f(p(e.prototype),"connectedCallback",this).call(this),this.addEventListener("register-qti-hotspot-choice",rQ(this,h1,h3))}},{key:"disconnectedCallback",value:function t(){f(p(e.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("unregister-qti-hotspot-choice",rQ(this,h1,h3))}}]);return e}(he(al,"qti-hotspot-choice"));h0=new WeakMap,h1=new WeakSet,h2=function t(t){return rz(this,h0)||(t.naturalWidth>0&&t.naturalHeight>0?rH(this,h0,Promise.resolve(t)):rH(this,h0,new Promise(function(e){var n=function i(){t.removeEventListener("load",n),e(t)};t.addEventListener("load",n)}))),rz(this,h0)},h3=function t(t){return a(function(){var e,n,i,o,a,s;return $(this,function(l){switch(l.label){case 0:e=this.querySelector("img"),n=t.target,i=n.getAttribute("coords"),o=n.getAttribute("shape"),a=i.split(",").map(function(t){return parseInt(t)});return[4,rQ(this,h1,h2).call(this,e)];case 1:s=l.sent();rb(o,a,s,n);return[2]}})}).call(this)},h5.styles=hZ;customElements.define("qti-hotspot-interaction",h5);var h4=iM(nt());var h6,h8,h7,h9=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,h6);t.class="";t.render=function(){return ol(ne())};return t}d(e,[{key:"connectedCallback",value:function t(){f(p(e.prototype),"connectedCallback",this).call(this),rQ(this,h6,h7).call(this)}},{key:"updated",value:function t(t){f(p(e.prototype),"updated",this).call(this,t),rQ(this,h6,h7).call(this)}}]);return e}(he(al,"qti-hottext"));h6=new WeakSet,h8=function t(){var t={"qti-input-control-hidden":!0};return this.class&&this.class.split(" ").forEach(function(e){e.trim()&&(t[e.trim()]=!0)}),t},h7=function t(){var t=Object.keys(rz(this,h6,h8)).join(" ");this.className=t},h9.styles=h4,rj([o({type:String,reflect:!0})],h9.prototype,"class",2);customElements.define("qti-hottext-interaction",h9);var ft=iM(nn()),fe=ft;var fn=0,fr,fi,fo,fa,fs,fl,fu,fc,fd,fh,ff,fp,fv,fm,fg,fy,fb,fw,fq,fk,fx=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e);rB(t,fr);t.options=[];t.correctOption=oh;t._dropdownOpen=!1;t._slotObserver=null;t._menuId="qti-inline-choice-menu-".concat(fn++);rB(t,fu,function(e){(t.disabled||t.readonly)&&e.preventDefault()});rB(t,fc,function(e){t.disabled||t.readonly||(e.key==="ArrowDown"||e.key==="Enter"||e.key===" ")&&(e.preventDefault(),rQ(t,fr,fl).call(t,!0))});rB(t,fd,function(e){var n=e.newState==="open";t._dropdownOpen!==n&&(t._dropdownOpen=n)});rB(t,fh,function(e){var n,i;if(!t._dropdownOpen)return;if(e.key==="Escape"){e.preventDefault(),rQ(t,fr,fl).call(t,!1),rQ(t,fr,ff).call(t);return}var o=rQ(t,fr,fk).call(t),a=t.renderRoot.activeElement,s=rQ(t,fr,fp).call(t),l=a||(m(s,HTMLElement)&&rQ(t,fr,fv).call(t,s)?s:null),u=o.findIndex(function(t){return t===l});if(e.key==="ArrowDown"&&(e.preventDefault(),(n=o[Math.min(o.length-1,Math.max(0,u+1))])===null||n===void 0?void 0:n.focus()),e.key==="ArrowUp"&&(e.preventDefault(),(i=o[Math.max(0,u-1)])===null||i===void 0?void 0:i.focus()),e.key==="Enter"||e.key===" "){if(!l)return;if(e.preventDefault(),m(l,HTMLButtonElement))l.click();else{var c;var d=(c=l.getAttribute("identifier"))!==null&&c!==void 0?c:"";rQ(t,fr,fs).call(t,d)}}});rB(t,fy,function(){rQ(t,fr,fo).call(t)});rB(t,fb,function(e){var n;if(t.disabled||t.readonly)return;var i=(n=e.currentTarget.getAttribute("identifier"))!==null&&n!==void 0?n:"";rQ(t,fr,fs).call(t,i)});t.internals.role="listbox";return t}d(e,[{key:"isInline",get:function t(){return!0}},{key:"render",value:function t(){var t=this;var e,n,i;var o=rQ(this,fr,fi).call(this);return ol(nr(),rz(this,fu),rz(this,fc),this._dropdownOpen?"true":"false",this._menuId,this._menuId,this.disabled,this.readonly?"true":"false",o===null||o===void 0?void 0:o.content,this._dropdownOpen?"dropdown-icon dropdown-icon-open":"dropdown-icon",this._menuId,rz(this,fd),rz(this,fh),((e=this.options[0])===null||e===void 0?void 0:e.selected)?"option option-prompt option-selected":"option option-prompt",((n=this.options[0])===null||n===void 0?void 0:n.selected)?"true":"false",function(){return rQ(t,fr,fs).call(t,"")},(i=this.options[0])===null||i===void 0?void 0:i.content,rz(this,fy),this.correctOption)}},{key:"connectedCallback",value:function t(){var t=this;var n=this,i=function n(){return f(p(e.prototype),"connectedCallback",t)};return a(function(){return $(this,function(t){switch(t.label){case 0:i().call(n),rQ(this,fr,fo).call(this),rQ(this,fr,fg).call(this);return[4,this.updateComplete];case 1:t.sent(),rQ(this,fr,fa).call(this);return[2]}})}).call(this)}},{key:"disconnectedCallback",value:function t(){var t;f(p(e.prototype),"disconnectedCallback",this).call(this),rQ(this,fr,fw).call(this),(t=this._slotObserver)===null||t===void 0?void 0:t.disconnect(),this._slotObserver=null}},{key:"willUpdate",value:function t(t){t.has("configContext")&&rQ(this,fr,fo).call(this)}},{key:"updated",value:function t(t){var e;t.has("_dropdownOpen")&&this._dropdownOpen&&(rQ(this,fr,fq).call(this),(e=rQ(this,fr,fk).call(this)[0])===null||e===void 0?void 0:e.focus()),(t.has("disabled")||t.has("readonly"))&&rQ(this,fr,fq).call(this)}},{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(){rQ(this,fr,fl).call(this,!1),this.options=this.options.map(function(t,e){return _(k({},t),{selected:e===0})}),rQ(this,fr,fq).call(this)}},{key:"response",get:function t(){var t;var e;var n=(t=(e=this.options.find(function(t){return t.selected}))===null||e===void 0?void 0:e.value)!==null&&t!==void 0?t:"";return n===""?null:n},set:function t(t){var e=t!==null&&t!==void 0?t:"";this.options=this.options.map(function(t){return _(k({},t),{selected:t.value===e})}),rQ(this,fr,fq).call(this)}},{key:"toggleInternalCorrectResponse",value:function t(t){f(p(e.prototype),"toggleInternalCorrectResponse",this).call(this,t);var n=this.correctResponse;if(!t||!n){this.correctOption=oh;return}var i=this.options.find(function(t){return n===t.value});if(!i){this.correctOption=oh;return}this.correctOption=ol(ni(),i.content)}}],[{key:"styles",get:function t(){return[fe]}}]);return e}(al);fr=new WeakSet,fi=function t(){var t;return(t=this.options.find(function(t){return t.selected}))!==null&&t!==void 0?t:this.options[0]},fo=function t(){var t;var e,n;var i=Array.from(this.querySelectorAll("qti-inline-choice")),o=this.dataset.prompt||((e=this.configContext)===null||e===void 0?void 0:e.inlineChoicePrompt)||"select",a=(t=(n=this.options.find(function(t){return t.selected}))===null||n===void 0?void 0:n.value)!==null&&t!==void 0?t:"",s=[{content:o,value:"",selected:a===""}].concat(N(i.map(function(t){var e;var n=(e=t.getAttribute("identifier"))!==null&&e!==void 0?e:"";return{content:Array.from(t.childNodes).map(function(t){return t.cloneNode(!0)}),value:n,selected:n!==""&&n===a}}))),l=s.some(function(t){return t.selected});this.options=l?s:s.map(function(t,e){return _(k({},t),{selected:e===0})}),rQ(this,fr,fq).call(this),rQ(this,fr,fa).call(this)},fa=function t(){var t=rQ(this,fr,fm).call(this),e=this.renderRoot.querySelector('button[part="trigger"]');if(!t||!e)return;var n=e.querySelector('span[part~="dropdown-icon"]'),i=n?n.getBoundingClientRect().width:0,o=t.matches(":popover-open"),a=t.style.visibility,s=t.style.display;o||(t.style.visibility="hidden",t.style.display="block",t.showPopover());var l=t.getBoundingClientRect().width,u=Math.max(l,t.scrollWidth);o||(t.hidePopover(),t.style.visibility=a,t.style.display=s),e.style.width="".concat(u+i,"px")},fs=function t(t){this.options=this.options.map(function(e){return _(k({},e),{selected:e.value===t})}),rQ(this,fr,fq).call(this),this.saveResponse(t),rQ(this,fr,fl).call(this,!1)},fl=function t(t){var e=rQ(this,fr,fm).call(this);if(e){if(t){e.matches(":popover-open")||e.showPopover();return}e.matches(":popover-open")&&e.hidePopover()}},fu=new WeakMap,fc=new WeakMap,fd=new WeakMap,fh=new WeakMap,ff=function t(){var t;(t=this.renderRoot.querySelector('button[part="trigger"]'))===null||t===void 0?void 0:t.focus()},fp=function t(){var t;var e=document.activeElement;for(;e&&m(e,HTMLElement)&&((t=e.shadowRoot)===null||t===void 0?void 0:t.activeElement);)e=e.shadowRoot.activeElement;return e},fv=function t(t){return t===this||this.contains(t)||this.renderRoot.contains(t)},fm=function t(){return this.renderRoot.querySelector("#".concat(this._menuId))},fg=function t(){var t=this;this._slotObserver=new MutationObserver(function(){return rQ(t,fr,fo).call(t)}),this._slotObserver.observe(this,{childList:!0,subtree:!0})},fy=new WeakMap,fb=new WeakMap,fw=function t(){var t=Array.from(this.querySelectorAll("qti-inline-choice"));var e=true,n=false,i=undefined;try{for(var o=t[Symbol.iterator](),a;!(e=(a=o.next()).done);e=true){var s=a.value;s.removeEventListener("click",rz(this,fb)),s.removeAttribute("tabindex"),s.internals.role=null,s.internals.ariaSelected=null,s.internals.ariaChecked="false",s.internals.states.delete("--checked")}}catch(t){n=true;i=t}finally{try{if(!e&&o.return!=null){o.return()}}finally{if(n){throw i}}}},fq=function t(){return a(function(){var t,e,n,i,o,a,s,l,u,c,d,h;return $(this,function(f){switch(f.label){case 0:return[4,this.updateComplete];case 1:f.sent();n=(t=(e=this.options.find(function(t){return t.selected}))===null||e===void 0?void 0:e.value)!==null&&t!==void 0?t:"",i=Array.from(this.querySelectorAll("qti-inline-choice"));o=true,a=false,s=undefined;try{for(l=i[Symbol.iterator]();!(o=(u=l.next()).done);o=true){c=u.value;h=((d=c.getAttribute("identifier"))!==null&&d!==void 0?d:"")===n;c.removeEventListener("click",rz(this,fb)),c.addEventListener("click",rz(this,fb)),c.disabled=this.disabled,c.readonly=this.readonly,c.internals.role="option",c.internals.ariaSelected=h?"true":"false",c.internals.ariaChecked=h?"true":"false",c.internals.ariaDisabled=this.disabled?"true":"false",c.internals.ariaReadOnly=this.readonly?"true":"false",c.removeAttribute("aria-disabled"),c.removeAttribute("aria-readonly"),h?c.internals.states.add("--checked"):c.internals.states.delete("--checked"),c.tabIndex=-1}}catch(t){a=true;s=t}finally{try{if(!o&&l.return!=null){l.return()}}finally{if(a){throw s}}}return[2]}})}).call(this)},fk=function t(){var t=this.renderRoot.querySelector('button[part~="option"]'),e=Array.from(this.querySelectorAll("qti-inline-choice"));return N(t?[t]:[]).concat(N(e))},rj([u()],fx.prototype,"options",2),rj([u()],fx.prototype,"correctOption",2),rj([u()],fx.prototype,"_dropdownOpen",2),rj([e({context:oL,subscribe:!0}),o({attribute:!1})],fx.prototype,"configContext",2);customElements.define("qti-inline-choice-interaction",fx);var f_=iM(no());var fE=d3(al,"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"),fC,fS,fA=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,fC);t.lastCheckedRadio=null;t.class="";t._response=[];t.responseIdentifier="";t.correctOptions=null;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,i=n.value,o=n.name,a=n.type;n.checked?(t.response?t.response.indexOf(i)===-1&&(a==="radio"&&(t.response=(t.response||[]).filter(function(t){return t.indexOf(o)===-1})),t.response=N(t.response).concat([i])):t.response=[i],t.lastCheckedRadio=n):(t.response=(t.response||[]).filter(function(t){return t!==i}),t.lastCheckedRadio=null),t.requestUpdate(),t.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:t.responseIdentifier,response:Array.isArray(t.response)?N(t.response):t.response}}))};return t}d(e,[{key:"response",get:function t(){return this.classList.contains("qti-match-tabular")?this._response:f(p(e.prototype),"response",this)},set:function t(t){this.classList.contains("qti-match-tabular")?this._response=t:R(p(e.prototype),"response",t,this,true)}},{key:"connectedCallback",value:function t(){var t=this;var n=this,i=function n(){return f(p(e.prototype),"connectedCallback",t)};return a(function(){return $(this,function(t){i().call(n),this.sourceChoices=Array.from(this.querySelectorAll("qti-simple-match-set:first-of-type qti-simple-associable-choice")),this.targetChoices=Array.from(this.querySelectorAll("qti-simple-match-set:last-of-type qti-simple-associable-choice")),this.response=[];return[2]})}).call(this)}},{key:"validate",value:function t(){var t;return this.class.split(" ").includes("qti-match-tabular")?((t=this.response)===null||t===void 0?void 0:t.length)===this.sourceChoices.length:f(p(e.prototype),"validate",this).call(this)}},{key:"toggleInternalCorrectResponse",value:function t(t){var e=this;var n=this.responseVariable;if(!(n===null||n===void 0?void 0:n.correctResponse)){this.querySelectorAll(".correct-option").forEach(function(t){return t.remove()});return}var i=rQ(this,fC,fS).call(this,n);this.class.split(" ").includes("qti-match-tabular")?t?this.correctOptions=i||[]:this.correctOptions=null:t?(this.querySelectorAll(".correct-option").forEach(function(t){return t.remove()}),this.targetChoices.forEach(function(t){var n=t.getAttribute("identifier"),o=i.find(function(t){return t.target===n});if(o===null||o===void 0?void 0:o.source){var a;var s=e.querySelector('qti-simple-associable-choice[identifier="'.concat(o.source,'"]')),l=Array.from((s===null||s===void 0?void 0:s.childNodes)||[]).map(function(t){return t.cloneNode(!0)});if(l.length>0&&!((a=t.previousElementSibling)===null||a===void 0?void 0:a.classList.contains("correct-option"))){var u=document.createElement("span");u.classList.add("correct-option"),l.forEach(function(t){return u.appendChild(t)}),u.style.border="1px solid var(--qti-correct)",u.style.borderRadius="4px",u.style.padding="2px 4px",u.style.display="inline-block",t.insertAdjacentElement("beforebegin",u)}}})):this.correctOptions=null}},{key:"toggleCandidateCorrection",value:function t(t){var e=this.responseVariable;if(!(e===null||e===void 0?void 0:e.correctResponse))return;var n=rQ(this,fC,fS).call(this,e);this.targetChoices.forEach(function(e){var i=e.getAttribute("identifier"),o=n.filter(function(t){return t.target===i});e.querySelectorAll("qti-simple-associable-choice").forEach(function(e){var n;if(e.internals.states.delete("candidate-correct"),e.internals.states.delete("candidate-incorrect"),!t)return;((n=o.find(function(t){return t.source===e.identifier}))===null||n===void 0?void 0:n.source)!==void 0?e.internals.states.add("candidate-correct"):e.internals.states.add("candidate-incorrect")})})}},{key:"render",value:function t(){var t=this;var e=this.class.split(" ").includes("qti-match-tabular"),n=this.correctOptions!==null;return ol(nd(),e,e?ol(nc(),this.targetChoices.map(function(t){return ol(na(),Array.from(t.childNodes).map(function(t){return t.cloneNode(!0)}))}),this.sourceChoices.map(function(e){return ol(nu(),Array.from(e.childNodes).map(function(t){return t.cloneNode(!0)}),t.targetChoices.map(function(i){var o,a,s;var l=e.getAttribute("identifier"),u=i.getAttribute("identifier"),c="".concat(l," ").concat(u),d=(t.response||[]).filter(function(t){return t.split(" ")[0]===l}).length||0,h=((o=t.response)===null||o===void 0?void 0:o.includes(c))||!1,f=e.matchMax===1?"radio":"checkbox",p=!!((a=t.correctOptions)===null||a===void 0?void 0:a.find(function(t){return t.source===l&&t.target===u})),v=f==="radio"?"rb ".concat(h?"rb-checked":""," ").concat(n?p?"rb-correct":"rb-incorrect":""):"cb ".concat(h?"cb-checked":""," ").concat(n?p?"cb-correct":"cb-incorrect":""),m=((s=t.correctOptions)===null||s===void 0?void 0:s.length)>0?!0:e.matchMax===1?!1:e.matchMax!==0&&d>=e.matchMax&&!h;return ol(nl(),f,v,l,c,m,function(e){return t.handleRadioChange(e)},function(n){return e.matchMax===1?t.handleRadioClick(n):null},f==="checkbox"&&h?ol(ns()):"")}))})):oh)}}]);return e}(d8(fE,'[qti-draggable="true"]'));fC=new WeakSet,fS=function t(t){if(!t.correctResponse)return[];var e=Array.isArray(t.correctResponse)?t.correctResponse:[t.correctResponse],n=[];return e&&e.forEach(function(t){var e=t.split(" ");n.push({source:e[0],target:e[1]})}),n},fA.styles=f_,rj([o({type:String})],fA.prototype,"class",2),rj([u()],fA.prototype,"_response",2),rj([o({type:String,attribute:"response-identifier"})],fA.prototype,"responseIdentifier",2),rj([u()],fA.prototype,"correctOptions",2);customElements.define("qti-match-interaction",fA);var fR=iM(nh());var fI,fT=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e);rB(t,fI,null);return t}d(e,[{key:"reset",value:function t(){rH(this,fI,null)}},{key:"validate",value:function t(){return!0}},{key:"response",get:function t(){return rz(this,fI)?rz(this,fI).toString():null},set:function t(t){if(t)if(!isNaN(parseInt(t===null||t===void 0?void 0:t.toString())))rH(this,fI,parseInt(t.toString()));else throw new Error("Value must be a number ".concat(t))}},{key:"render",value:function t(){return ol(nf())}},{key:"connectedCallback",value:function t(){var t=this;f(p(e.prototype),"connectedCallback",this).call(this);var n=this.querySelector("audio")||this.querySelector("video")||this.querySelector("object");n&&n.addEventListener("ended",function(){rX(t,fI)._++,t.saveResponse(t.value)})}}],[{key:"properties",get:function t(){return _(k({},al.properties),{step:{type:Number,attribute:"step",default:10}})}}]);return e}(al);fI=new WeakMap,fT.styles=fR;customElements.define("qti-media-interaction",fT);var fM=iM(np());var fP=d3(al,"qti-simple-choice","drop-list","slot[part='drags']"),fO,fN,fU=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,fO);t.nrChoices=0;t.correctResponses=[];t.showCorrectResponses=!1;return t}d(e,[{key:"render",value:function t(){var t=Array.from(this.querySelectorAll("qti-simple-choice"));return this.nrChoices<t.length&&(this.nrChoices=t.length),ol(nm(),N(Array(this.nrChoices)).map(function(t,e){return ol(nv(),e)}))}},{key:"toggleCorrectResponse",value:function t(t){var e=this;if(this.shadowRoot.querySelectorAll(".correct-option").forEach(function(t){return t.remove()}),t){var n=rQ(this,fO,fN).call(this),i=new Map;Array.from(this.querySelectorAll("qti-simple-choice")).forEach(function(t){var e;var n=t.getAttribute("identifier"),o=(e=t.textContent)===null||e===void 0?void 0:e.trim();n&&o&&i.set(n,o)}),n.forEach(function(t){var n=t.identifier,o=t.dropIndex;var a=i.get(n);if(!a)return;var s=e.shadowRoot.querySelector('drop-list[identifier="droplist'.concat(o,'"]'));if(!s)return;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.display="inline-block",l.style.marginTop="4px",s.insertAdjacentElement("afterend",l)})}}},{key:"toggleCandidateCorrection",value:function t(t){if(f(p(e.prototype),"toggleCandidateCorrection",this).call(this,t),Array.from(this.shadowRoot.querySelectorAll('drop-list [qti-draggable="true"]')).forEach(function(t){t.internals.states.delete("candidate-correct"),t.internals.states.delete("candidate-incorrect")}),!t)return;var n=rQ(this,fO,fN).call(this),i=new Map;n.forEach(function(t){return i.set(t.dropIndex,t.identifier)}),Array.from(this.shadowRoot.querySelectorAll("drop-list")).forEach(function(t,e){var n=t.querySelector('[qti-draggable="true"]');if(!n)return;var o=i.get(e),a=n.getAttribute("identifier");o&&a===o?n.internals.states.add("candidate-correct"):n.internals.states.add("candidate-incorrect")})}},{key:"getValue",value:function t(t){return(t===null||t===void 0?void 0:t.map(function(t,e){return"".concat(t," droplist").concat(e)}))||[]}},{key:"getResponse",value:function t(){return Array.from(this.shadowRoot.querySelectorAll("drop-list")).map(function(t){var e=t.querySelectorAll('[qti-draggable="true"]');return N(Array.from(e).map(function(t){return t.getAttribute("identifier")})).join(" ")})}},{key:"shouldTreatBlockedMaxAsInvalid",value:function t(){return!1}},{key:"firstUpdated",value:function t(){var t=this;var n=this,i=function n(){return f(p(e.prototype),"firstUpdated",t)};return a(function(){return $(this,function(t){i().call(n),this.childrenMap=Array.from(this.querySelectorAll("qti-simple-choice")),this.childrenMap.forEach(function(t){return t.setAttribute("part","qti-simple-choice")});return[2]})}).call(this)}}]);return e}(d8(fP,'[qti-draggable="true"]'));fO=new WeakSet,fN=function t(){var t=this.responseVariable;return(t===null||t===void 0?void 0:t.correctResponse)?(Array.isArray(t.correctResponse)?t.correctResponse:[t.correctResponse]).map(function(t,e){var n=T(t.split(" "),2),i=n[0],o=n[1],a=(o===null||o===void 0?void 0:o.startsWith("droplist"))?parseInt(o.replace("droplist",""),10):e,s=Number.isNaN(a)?e:a;return{identifier:i,dropIndex:s}}).filter(function(t){return!!t.identifier}):[]},fU.styles=fM,rj([u()],fU.prototype,"nrChoices",2),rj([u()],fU.prototype,"correctResponses",2),rj([u()],fU.prototype,"showCorrectResponses",2),rj([o({type:String})],fU.prototype,"orientation",2);customElements.define("qti-order-interaction",fU);var fL=iM(ng());var fD,fV,f$,fW,fj,fF,fz,fB,fH,fQ,fX,fG,fJ,fY,fK,fZ,f0,f1,f2,f3,f5,f4,f6,f8=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,fF);rB(t,fD);t._iframeLoaded=!1;t._pendingMessages=[];t._iframeMessageOrigin=null;t._iframeObjectUrl=null;t.requirePathsJson="";t.requireShimJson="";t.requireJsUrl="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js";t.baseUrl="";t.useDefaultPaths=!1;t._errorMessage=null;t.response=null;rB(t,fV,null);rB(t,f$,null);rB(t,fW,null);rB(t,fj,"");t.handleIframeMessage=function(e){var n;var i=e.data;if(!(!i||i.source!=="qti-pci-iframe")&&!(!((n=t.iframe)===null||n===void 0?void 0:n.contentWindow)||e.source!==t.iframe.contentWindow)&&!(i.responseIdentifier&&i.responseIdentifier!==t.responseIdentifier)){if(t._iframeMessageOrigin===null)t._iframeMessageOrigin=e.origin;else if(e.origin!==t._iframeMessageOrigin)return;switch(i.method){case"iframeReady":rQ(t,fF,f4).call(t),rQ(t,fF,f1).call(t),t.dispatchEvent(new CustomEvent("qti-portable-custom-interaction-loaded",{bubbles:!0}));break;case"resize":typeof i.height=="number"&&t.iframe&&(t.iframe.style.height="".concat(i.height,"px"),t.iframe.style.width="".concat(i.width,"px"));break;case"console":t.dispatchEvent(new CustomEvent("qti-pci-console",{detail:{level:i.level,args:i.args},bubbles:!0}));break;case"interactionChanged":{var o,a,s,l;var u=i===null||i===void 0?void 0:(o=i.params)===null||o===void 0?void 0:o.value,c=u&&(typeof u==="undefined"?"undefined":U(u))=="object"?rQ(t,fF,fX).call(t,u):null,d=typeof(i===null||i===void 0?void 0:(a=i.params)===null||a===void 0?void 0:a.valid)=="boolean"?i.params.valid:null,h=typeof(i===null||i===void 0?void 0:(s=i.params)===null||s===void 0?void 0:s.customValidity)=="string"?i.params.customValidity:null;d!==null&&(rH(t,fW,d),d&&h===null&&rH(t,fj,"")),h!==null&&rH(t,fj,h);var f=i===null||i===void 0?void 0:(l=i.params)===null||l===void 0?void 0:l.state,p;if(f===void 0)p=void 0;else if(f===null)p=null;else if(typeof f=="string")p=f;else try{p="__qti_json__::".concat(JSON.stringify(f))}catch(t){p=null}if(c===null){var v;var m=((v=t.responseVariable)===null||v===void 0?void 0:v.cardinality)==="single"?"":[];t.response=m,t.validate(),t.saveResponse(m,p);break}t.response=c,t.validate(),t.saveResponse(c,p);break}case"error":t._errorMessage=i.params.message,console.error("Error from PCI iframe:",i.params.message);break}}};rB(t,f6,null);return t}d(e,[{key:"getDirectChildrenByTag",value:function t(t){var e=t.toLowerCase();return Array.from(this.children).filter(function(t){return t.tagName.toLowerCase()===e})}},{key:"coerceBaseValue",value:function t(t,e){if(t==null)return t;switch(e){case"integer":{if(typeof t=="number")return t;var n=parseInt(String(t),10);return Number.isNaN(n)?t:n}case"float":case"duration":{if(typeof t=="number")return t;var i=parseFloat(String(t));return Number.isNaN(i)?t:i}case"boolean":{if(typeof t=="boolean")return t;if(typeof t=="string"){var o=t.toLowerCase();if(o==="true")return!0;if(o==="false")return!1}return t}default:return String(t)}}},{key:"normalizeListValue",value:function t(t){return t==null?[]:Array.isArray(t)?t:[t]}},{key:"variableToQtiVariableJSON",value:function t(t,e,n){var i=this;if(e==="record"||n==="record")return this.recordToQtiVariableJSON(t);if(e!=="single"){var o=this.normalizeListValue(t).map(function(t){return i.coerceBaseValue(t,n)});return{list:h({},n,o)}}return{base:h({},n,this.coerceBaseValue(t,n))}}},{key:"recordToQtiVariableJSON",value:function t(t){if(!t||(typeof t==="undefined"?"undefined":U(t))!="object")return{record:[]};var e=[];var n=true,i=false,o=undefined;try{for(var a=Object.entries(t)[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=T(s.value,2),u=l[0],c=l[1];e.push(this.recordEntryFromValue(u,c))}}catch(t){i=true;o=t}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(i){throw o}}}return{record:e}}},{key:"recordEntryFromValue",value:function t(t,e){if(Array.isArray(e)){var n=e.filter(function(t){return t!=null});if(n.length&&n.every(function(t){return typeof t=="boolean"}))return{name:t,list:{boolean:n}};if(n.length&&n.every(function(t){return typeof t=="number"})){var i=n,o=i.every(function(t){return Number.isInteger(t)});return{name:t,list:h({},o?"integer":"float",i)}}return{name:t,list:{string:e.map(function(t){return t==null?"":String(t)})}}}if(typeof e=="boolean")return{name:t,base:{boolean:e}};if(typeof e=="number")return Number.isInteger(e)?{name:t,base:{integer:e}}:{name:t,base:{float:e}};if(e==null)return{name:t,base:{string:""}};if((typeof e==="undefined"?"undefined":U(e))=="object")try{return{name:t,base:{string:JSON.stringify(e)}}}catch(n){return{name:t,base:{string:String(e)}}}return{name:t,base:{string:String(e)}}}},{key:"getQtiContextDefaultsFromItem",value:function t(){var t=this;var e=this.closest("qti-assessment-item");if(!e)return{};var n={};return e.querySelectorAll('qti-context-declaration[identifier="QTI_CONTEXT"]').forEach(function(e){var i=e.querySelector("qti-default-value");if(!i)return;i.querySelectorAll("qti-value[field-identifier]").forEach(function(e){var i;var o=e.getAttribute("field-identifier");if(!o)return;var a=e.getAttribute("base-type")||"string",s=((i=e.textContent)===null||i===void 0?void 0:i.trim())||"";n[o]=t.coerceBaseValue(s,a)})}),n}},{key:"getQtiContextRecord",value:function t(){var t,e,n;var i;var o=this.getQtiContextDefaultsFromItem(),a=((i=this.qtiContext)===null||i===void 0?void 0:i.QTI_CONTEXT)||{},s=k({},o,a);if(!Object.keys(s).length)return null;var l=k({candidateIdentifier:(t=s.candidateIdentifier)!==null&&t!==void 0?t:"",testIdentifier:(e=s.testIdentifier)!==null&&e!==void 0?e:"",environmentIdentifier:(n=s.environmentIdentifier)!==null&&n!==void 0?n:""},s);return this.recordToQtiVariableJSON(l)}},{key:"getTemplateVariables",value:function t(){var t=this;var e={},n=this.getDirectChildrenByTag("qti-template-variable");return n.length&&n.forEach(function(n){var i,o;var a=n.getAttribute("template-identifier")||n.getAttribute("identifier")||"";if(!a)return;var s=(o=t.context)===null||o===void 0?void 0:(i=o.variables)===null||i===void 0?void 0:i.find(function(t){return t.identifier===a});if(!s)return;var l=s.cardinality||"single",u=s.baseType||"string";e[a]=t.variableToQtiVariableJSON(s.value,l,u)}),e}},{key:"getContextVariables",value:function t(){var t=this;var e={},n=this.getDirectChildrenByTag("qti-context-variable");return n.length&&n.forEach(function(n){var i,o;var a=n.getAttribute("identifier")||"";if(!a)return;if(a==="QTI_CONTEXT"){var s=t.getQtiContextRecord();s&&(e[a]=s);return}var l=(o=t.context)===null||o===void 0?void 0:(i=o.variables)===null||i===void 0?void 0:i.find(function(t){return t.identifier===a});if(!l)return;var u=l.cardinality||"single",c=l.baseType||"string";e[a]=t.variableToQtiVariableJSON(l.value,u,c)}),e}},{key:"responseVariablesToQtiVariableJSON",value:function t(t,e,n){if(e!=="single"){var i={list:{}};return i.list[n]=t,i}else{var o={base:{}};return o.base[n]=t,o}}},{key:"validate",value:function t(){var t=typeof rz(this,fW)=="boolean"?rz(this,fW):rQ(this,fF,fY).call(this);return rQ(this,fF,fK).call(this,t,rz(this,fj)),t}},{key:"value",get:function t(){return rz(this,fD)===null||rz(this,fD)===void 0?null:Array.isArray(rz(this,fD))?rz(this,fD).join(","):String(rz(this,fD))},set:function t(t){t===null?rH(this,fD,[]):rH(this,fD,Array.isArray(t)?t:t.split(","))}},{key:"boundTo",get:function t(){var t=this;var e,n;var i={};if((n=this.context)===null||n===void 0?void 0:(e=n.variables)===null||e===void 0?void 0:e.find(function(e){return e.identifier===t.responseIdentifier})){var o,a,s,l,u,c,d,h,f;var p=((s=this.context)===null||s===void 0?void 0:(a=s.variables)===null||a===void 0?void 0:(o=a.find(function(e){return e.identifier===t.responseIdentifier}))===null||o===void 0?void 0:o.cardinality)||"single",v=((c=this.context)===null||c===void 0?void 0:(u=c.variables)===null||u===void 0?void 0:(l=u.find(function(e){return e.identifier===t.responseIdentifier}))===null||l===void 0?void 0:l.baseType)||"string",m=((f=this.context)===null||f===void 0?void 0:(h=f.variables)===null||h===void 0?void 0:(d=h.find(function(e){return e.identifier===t.responseIdentifier}))===null||d===void 0?void 0:d.value)||null,g=this.responseVariablesToQtiVariableJSON(m,p,v);i[this.responseIdentifier]=g}return i},set:function t(t){if(!t||!t[this.responseIdentifier])return;var e=rQ(this,fF,fX).call(this,t[this.responseIdentifier]);rH(this,fD,e),this.saveResponse(e)}},{key:"disconnectedCallback",value:function t(){f(p(e.prototype),"disconnectedCallback",this).call(this),window.removeEventListener("message",this.handleIframeMessage),this._iframeObjectUrl&&(URL.revokeObjectURL(this._iframeObjectUrl),this._iframeObjectUrl=null)}},{key:"sendMessageToIframe",value:function t(t,e){var n;var i=(n=this.iframe)===null||n===void 0?void 0:n.contentWindow;if(!this._iframeLoaded||!i){this._pendingMessages.push({method:t,params:e});return}i.postMessage({source:"qti-portable-custom-interaction",responseIdentifier:this.responseIdentifier,method:t,params:e},"*")}},{key:"createIframe",value:function t(){var t=this;this._iframeObjectUrl&&(URL.revokeObjectURL(this._iframeObjectUrl),this._iframeObjectUrl=null),this.iframe=document.createElement("iframe"),this.iframe.id="pci-iframe-".concat(this.responseIdentifier),this.iframe.setAttribute("title","QTI PCI Iframe"),this.iframe.setAttribute("aria-label","QTI PCI Iframe"),this.iframe.setAttribute("aria-hidden","false"),this.iframe.setAttribute("role","application"),this.iframe.style.width="100%",this.iframe.style.border="none",this.iframe.style.display="block",this.iframe.onload=function(){t._iframeLoaded=!0,t._iframeObjectUrl&&(URL.revokeObjectURL(t._iframeObjectUrl),t._iframeObjectUrl=null),rQ(t,fF,f5).call(t),rQ(t,fF,f2).call(t)};var e="qti-pci-".concat(this.responseIdentifier,"-").concat(Date.now());this.iframe.name=e;var n=this.generateIframeContent();try{var i=new Blob([n],{type:"text/html"});this._iframeObjectUrl=URL.createObjectURL(i),this.iframe.src=this._iframeObjectUrl}catch(t){var o=encodeURIComponent(n);this.iframe.src="data:text/html;charset=utf-8,".concat(o)}this.appendChild(this.iframe)}},{key:"connectedCallback",value:function t(){var t;var n;f(p(e.prototype),"connectedCallback",this).call(this),rH(this,fW,null),rH(this,fj,""),this.response=(t=(n=this.responseVariable)===null||n===void 0?void 0:n.value)!==null&&t!==void 0?t:null,window.addEventListener("message",this.handleIframeMessage),this.createIframe()}},{key:"generateIframeContent",value:function t(){var t=window.getComputedStyle(document.body),e=JSON.stringify(rQ(this,fF,fH).call(this)),n=JSON.stringify(rQ(this,fF,fQ).call(this)),i=this.dataset.baseUrl?this.dataset.baseUrl.startsWith("/")?"".concat(window.location.origin).concat(this.dataset.baseUrl):this.dataset.baseUrl:"",o=this.dataset.forwardConsole==="true",a=window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1",s=a?"".concat(window.location.origin,"/cdn/index.js"):"https://unpkg.com/@citolab/qti-components/cdn",l=a?"".concat(window.location.origin,"/dist/item.css"):"https://unpkg.com/@citolab/qti-components@latest/dist/item.css",u=this.dataset.componentsCdnUrl||s,c=this.dataset.componentsCssUrl||l,d="\n font-family: ".concat(t.getPropertyValue("font-family"),";\n font-size: ").concat(t.getPropertyValue("font-size"),";\n line-height: ").concat(t.getPropertyValue("line-height"),";\n font-weight: ").concat(t.getPropertyValue("font-weight"),";\n color: ").concat(t.getPropertyValue("color"),";\n ");return'<!DOCTYPE html>\n <html lang="en">\n <head>\n <meta charset="utf-8" />\n <title>QTI PCI Container</title>\n <base href="'.concat(window.location.origin,'" />\n <script type="module">\n import \'').concat(u,"';\n <\/script>\n <style>\n body, html {\n margin: 0;\n padding: 0;\n width: 100%;\n height: auto;\n overflow: hidden;\n /* Add the extracted font styles here */\n ").concat(d,'\n };\n .qti-customInteraction {\n width: 100%;\n height: 100%;\n }\n #pci-container {\n width: 100%;\n }\n qti-interaction-markup {\n display: block;\n width: 100%;\n min-height: 50px;\n }\n </style>\n <link href="').concat(c,'" rel="stylesheet" />\n <script src="').concat(this.requireJsUrl,'"><\/script>\n <script>\n const forwardConsole = ').concat(o?"true":"false",";\n if (forwardConsole) {\n const originalLog = console.log.bind(console);\n const originalError = console.error.bind(console);\n const stringifyArgs = args =>\n args.map(arg => {\n if (typeof arg === 'string') return arg;\n try {\n return JSON.stringify(arg);\n } catch (e) {\n return String(arg);\n }\n });\n console.log = (...args) => {\n originalLog(...args);\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: (window.PCIManager && window.PCIManager.responseIdentifier) || null,\n method: 'console',\n level: 'log',\n args: stringifyArgs(args)\n },\n '*'\n );\n };\n console.error = (...args) => {\n originalError(...args);\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: (window.PCIManager && window.PCIManager.responseIdentifier) || null,\n method: 'console',\n level: 'error',\n args: stringifyArgs(args)\n },\n '*'\n );\n };\n }\n // Define standard paths and shims\n window.requirePaths = ").concat(e,";\n\n window.requireShim = ").concat(n,";\n\n // Single initial RequireJS configuration with error handling\n window.requirejs.config({\n catchError: true,\n waitSeconds: 30,\n paths: window.requirePaths,\n baseUrl: '").concat(i,"',\n shim: window.requireShim,\n onNodeCreated: function (node, config, moduleName, url) {\n // Add error handler to script node\n node.addEventListener('error', function (evt) {\n console.error('Script load error for module:', moduleName, 'URL:', url, 'Event:', evt);\n });\n },\n onError: function (err) {\n console.error('RequireJS error:', {\n type: err.requireType,\n modules: err.requireModules,\n error: err\n });\n\n if (err.requireType === 'scripterror') {\n console.error('Script error usually indicates a network or CORS issue with:', err.requireModules);\n }\n\n // Notify parent window about the error\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: (window.PCIManager && window.PCIManager.responseIdentifier) || null,\n method: 'error',\n params: {\n message: 'RequireJS ' + err.requireType + ' error for modules: ' + err.requireModules,\n details: {\n type: err.requireType,\n modules: err.requireModules,\n error: err.toString()\n }\n }\n },\n '*'\n );\n }\n });\n\n // PCI Manager for iframe implementation\n window.PCIManager = {\n pciInstance: null,\n container: null,\n markupEl: null,\n propertiesEl: null,\n customInteractionTypeIdentifier: null,\n responseIdentifier: null,\n pendingBoundTo: null,\n pendingMarkup: null,\n pendingProperties: null,\n pendingState: null,\n pendingStylesheets: null,\n stylesheetKeys: {},\n interactionChangedViaEvent: false,\n eventBridgeAttached: false,\n lastResponseStr: null,\n hadResponse: false,\n\n initialize: function (config) {\n this.customInteractionTypeIdentifier = config.customInteractionTypeIdentifier;\n this.responseIdentifier = config.responseIdentifier;\n this.container = document.getElementById('pci-container');\n this.container.classList.add('qti-customInteraction');\n\n function qtiVariableHasValue(qtiVar) {\n if (!qtiVar) return false;\n if (qtiVar.base) {\n for (const k in qtiVar.base) {\n if (!Object.prototype.hasOwnProperty.call(qtiVar.base, k)) continue;\n const v = qtiVar.base[k];\n if (v !== null && v !== undefined && v !== '') return true;\n }\n }\n if (qtiVar.list) {\n for (const k in qtiVar.list) {\n if (!Object.prototype.hasOwnProperty.call(qtiVar.list, k)) continue;\n const v = qtiVar.list[k];\n if (Array.isArray(v) && v.some(x => x !== null && x !== undefined && x !== '')) return true;\n }\n }\n if (Array.isArray(qtiVar.record) && qtiVar.record.length > 0) return true;\n return false;\n }\n\n const initialBoundTo = config.boundTo && config.boundTo[this.responseIdentifier];\n this.hadResponse = qtiVariableHasValue(initialBoundTo);\n this.lastResponseStr = this.hadResponse ? JSON.stringify(initialBoundTo) : null;\n // Ensure expected DOM structure exists (markup + properties)\n this.markupEl = this.container.querySelector('qti-interaction-markup');\n if (!this.markupEl) {\n this.markupEl = document.createElement('qti-interaction-markup');\n this.container.appendChild(this.markupEl);\n }\n this.markupEl.classList.add('qti-customInteraction');\n this.propertiesEl = this.container.querySelector('properties');\n if (!this.propertiesEl) {\n this.propertiesEl = document.createElement('properties');\n this.propertiesEl.style.display = 'none';\n this.container.appendChild(this.propertiesEl);\n } else {\n this.propertiesEl.style.display = 'none';\n }\n\n // Apply any markup/properties that arrived before initialization\n if (this.pendingMarkup !== null) {\n this.setMarkup(this.pendingMarkup);\n this.pendingMarkup = null;\n }\n if (this.pendingProperties !== null) {\n this.setProperties(this.pendingProperties);\n this.pendingProperties = null;\n }\n if (this.pendingStylesheets !== null) {\n this.setStylesheets(this.pendingStylesheets);\n this.pendingStylesheets = null;\n }\n\n // Bridge qti-interaction-changed events (preferred over polling)\n if (!this.eventBridgeAttached) {\n this.eventBridgeAttached = true;\n const self = this;\n this.container.addEventListener(\n 'qti-interaction-changed',\n function (evt) {\n try {\n self.interactionChangedViaEvent = true;\n const value = evt && evt.detail ? evt.detail.value : undefined;\n if (value !== undefined) {\n const validFromEvent =\n evt && evt.detail && typeof evt.detail.valid === 'boolean' ? evt.detail.valid : undefined;\n let valid = validFromEvent;\n if (valid === undefined && self.pciInstance && typeof self.pciInstance.checkValidity === 'function') {\n try {\n valid = self.pciInstance.checkValidity();\n } catch (e) {\n // Keep undefined on PCI validity read errors.\n }\n }\n const customValidityFromEvent =\n evt && evt.detail && typeof evt.detail.customValidity === 'string'\n ? evt.detail.customValidity\n : undefined;\n let customValidity = customValidityFromEvent;\n if (\n customValidity === undefined &&\n self.pciInstance &&\n typeof self.pciInstance.getCustomValidity === 'function'\n ) {\n try {\n customValidity = self.pciInstance.getCustomValidity();\n } catch (e) {\n // Keep undefined on PCI custom validity read errors.\n }\n }\n const state =\n self.pciInstance && typeof self.pciInstance.getState === 'function'\n ? self.pciInstance.getState()\n : null;\n self.notifyInteractionChanged(value, state, valid, customValidity);\n }\n } catch (e) {\n // ignore bridge errors, polling fallback may still work\n }\n },\n true\n );\n }\n\n function getResolvablePath(path, basePath) {\n if (Array.isArray(path)) {\n return path.map(p => getResolvablePathString(p, basePath));\n } else {\n return getResolvablePathString(path, basePath);\n }\n }\n\n function removeDoubleSlashes(str) {\n return str\n .replace(/([^:\\/])\\/\\/+/g, '$1/')\n .replace(/\\/\\//g, '/')\n .replace('http:/', 'http://')\n .replace('https:/', 'https://');\n }\n\n function ensureDirectoryBasePath(basePath) {\n if (!basePath) return basePath;\n if (basePath.endsWith('/')) return basePath;\n return basePath + '/';\n }\n\n\n\n function combineRequireResolvePaths(path1, path2, baseUrl) {\n path1 = getResolvablePath(path1, baseUrl);\n const path1Array = Array.isArray(path1) ? path1 : [path1];\n if (!path2) {\n return path1Array;\n }\n path2 = getResolvablePath(path2, baseUrl);\n const path2Array = Array.isArray(path2) ? path2 : [path2];\n return path1Array.concat(path2Array).filter((value, index, self) => self.indexOf(value) === index);\n }\n\n // Update paths with modules from the config\n if (config.interactionModules && config.interactionModules.length > 0) {\n config.interactionModules.forEach(module => {\n if (module.id && module.primaryPath) {\n const currentPath = window.requirePaths[module.id] || [];\n const currentPaths = Array.isArray(currentPath) ? currentPath : [currentPath];\n const newPath = combineRequireResolvePaths(\n module.primaryPath,\n module.fallbackPath,\n config.baseUrl\n );\n window.requirePaths[module.id] = newPath.concat(currentPaths)\n .filter((value, index, self) => self.indexOf(value) === index);\n }\n });\n }\n\n // The ONLY other requirejs.config call - with the context for this specific PCI\n window.requirejs.config({\n context: this.customInteractionTypeIdentifier,\n paths: window.requirePaths,\n shim: window.requireShim\n });\n\n // Define qtiCustomInteractionContext for the PCI\n define('qtiCustomInteractionContext', () => {\n return {\n register: pciInstance => {\n this.pciInstance = pciInstance;\n // Configure PCI instance\n const pciConfig = {\n properties: config.properties || {},\n contextVariables: config.contextVariables || {},\n templateVariables: config.templateVariables || {},\n onready: pciInstance => {\n this.pciInstance = pciInstance;\n // Apply any pending updates that arrived before onready\n if (this.pendingBoundTo) {\n this.applyBoundTo(this.pendingBoundTo);\n this.pendingBoundTo = null;\n }\n if (this.pendingState && typeof this.pciInstance.setState === 'function') {\n this.pciInstance.setState(this.pendingState);\n this.pendingState = null;\n }\n this.notifyReady();\n },\n ondone: (pciInstance, response, state, status) => {\n const valid =\n this.pciInstance && typeof this.pciInstance.checkValidity === 'function'\n ? this.pciInstance.checkValidity()\n : undefined;\n const customValidity =\n this.pciInstance && typeof this.pciInstance.getCustomValidity === 'function'\n ? this.pciInstance.getCustomValidity()\n : undefined;\n this.notifyInteractionChanged(\n response,\n typeof state === 'string' ? state : null,\n valid,\n customValidity\n );\n },\n responseIdentifier: config.responseIdentifier,\n boundTo: config.boundTo\n };\n\n if (pciInstance.getInstance) {\n const dom = this.markupEl || this.container;\n // Round-trip support for object states (stored as a prefixed JSON string by the host).\n // For strict string-based PCIs we pass the original string through unchanged.\n let restoredState = config.state;\n if (typeof restoredState === 'string' && restoredState.indexOf('__qti_json__::') === 0) {\n try {\n restoredState = JSON.parse(restoredState.substring('__qti_json__::'.length));\n } catch (e) {\n // If parsing fails, fall back to the raw string.\n restoredState = config.state;\n }\n }\n pciInstance.getInstance(dom, pciConfig, restoredState || undefined);\n } else {\n this.notifyError('Loaded PCI module has no getInstance().');\n }\n },\n notifyReady: () => {\n PCIManager.notifyReady();\n }\n };\n });\n\n function getResolvablePathString(path, basePath) {\n path = path.replace(/\\.js$/, '');\n if (/^[a-z][a-z0-9+.-]*:/i.test(path) || !basePath) {\n return path;\n }\n\n if (path.startsWith('/') && !path.startsWith('//')) {\n path = path.slice(1);\n }\n\n try {\n const resolved = new URL(path, ensureDirectoryBasePath(basePath)).toString();\n return resolved.replace(/\\.js$/, '');\n } catch (error) {\n return removeDoubleSlashes(ensureDirectoryBasePath(basePath) + path);\n }\n }\n\n // Load the PCI module\n this.loadModule(config.module);\n },\n\n loadModule: function (modulePath) {\n try {\n // Get the context-specific require\n const contextRequire = window.requirejs.config({\n context: this.customInteractionTypeIdentifier\n });\n contextRequire(['require'], require => {\n // Now load the actual module\n require([modulePath], () => {}, err => {\n console.error('Error loading module:', modulePath, err);\n this.notifyError('Module load error: ' + err.toString());\n });\n });\n } catch (error) {\n console.error('Exception in loadModule:', modulePath);\n console.error(error);\n this.notifyError('Error in require call: ' + error.toString());\n }\n },\n\n notifyReady: function () {\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: this.responseIdentifier,\n method: 'iframeReady'\n },\n '*'\n );\n },\n\n notifyInteractionChanged: function (response, state, valid, customValidity) {\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: this.responseIdentifier,\n method: 'interactionChanged',\n params: {\n value: response,\n state: state,\n valid: typeof valid === 'boolean' ? valid : undefined,\n customValidity: typeof customValidity === 'string' ? customValidity : undefined\n }\n },\n '*'\n );\n },\n\n notifyError: function (message) {\n console.error('PCI Error:', message);\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: this.responseIdentifier,\n method: 'error',\n params: { message: message }\n },\n '*'\n );\n },\n\n setMarkup: function (markupHtml) {\n if (!this.container) {\n this.container = document.getElementById('pci-container');\n }\n if (!this.container) {\n this.pendingMarkup = markupHtml;\n return;\n }\n this.markupEl = this.container.querySelector('qti-interaction-markup');\n if (!this.markupEl) {\n this.markupEl = document.createElement('qti-interaction-markup');\n this.container.appendChild(this.markupEl);\n }\n this.markupEl.classList.add('qti-customInteraction');\n this.markupEl.innerHTML = markupHtml || '';\n },\n\n setProperties: function (propertiesHtml) {\n if (!this.container) {\n this.container = document.getElementById('pci-container');\n }\n if (!this.container) {\n this.pendingProperties = propertiesHtml;\n return;\n }\n this.propertiesEl = this.container.querySelector('properties');\n if (!this.propertiesEl) {\n this.propertiesEl = document.createElement('properties');\n this.container.appendChild(this.propertiesEl);\n }\n this.propertiesEl.style.display = 'none';\n this.propertiesEl.innerHTML = propertiesHtml || '';\n },\n\n minifyCss: function (cssContent) {\n return cssContent\n .replace(/\\/\\*[\\s\\S]*?\\*\\//g, '')\n .replace(/\\s+/g, ' ')\n .replace(/\\s*([{}:;])\\s*/g, '$1')\n .trim();\n },\n\n setStylesheets: function (stylesheetsHtml) {\n if (!stylesheetsHtml) return;\n if (!this.container) {\n this.container = document.getElementById('pci-container');\n }\n const target = this.container || document.body;\n if (!target) return;\n target.insertAdjacentHTML('afterbegin', stylesheetsHtml);\n },\n\n\n applyBoundTo: function (boundTo) {\n if (!this.pciInstance || typeof this.pciInstance.setResponse !== 'function') return;\n const value = boundTo && (boundTo[this.responseIdentifier] || boundTo[Object.keys(boundTo)[0]]);\n if (value) this.pciInstance.setResponse(value);\n }\n };\n\n // Set up message listener for communication with parent\n let expectedParentOrigin = null;\n window.addEventListener('message', function (event) {\n const { data } = event;\n\n // Ensure the message is from our parent\n if (event.source !== window.parent || !data || data.source !== 'qti-portable-custom-interaction') {\n return;\n }\n if (expectedParentOrigin === null) {\n expectedParentOrigin = event.origin;\n } else if (event.origin !== expectedParentOrigin) {\n return;\n }\n\n function deepQuerySelector(root, selector) {\n if (!root) return null;\n try {\n const direct = root.querySelector ? root.querySelector(selector) : null;\n if (direct) return direct;\n } catch (e) {\n // ignore invalid selector for this root\n }\n if (!root.querySelectorAll) return null;\n const nodes = root.querySelectorAll('*');\n for (const node of nodes) {\n if (node && node.shadowRoot) {\n const found = deepQuerySelector(node.shadowRoot, selector);\n if (found) return found;\n }\n }\n return null;\n }\n\n function deepFindElementByExactText(root, text) {\n if (!root || !text) return null;\n if (root.querySelectorAll) {\n const nodes = root.querySelectorAll('*');\n for (const node of nodes) {\n if ((node.textContent || '').trim() === text) return node;\n if (node.shadowRoot) {\n const found = deepFindElementByExactText(node.shadowRoot, text);\n if (found) return found;\n }\n }\n }\n return null;\n }\n\n switch (data.method) {\n case 'initialize':\n PCIManager.initialize(data.params);\n break;\n\n case 'setMarkup':\n PCIManager.setMarkup(data.params);\n break;\n\n case 'setBoundTo':\n if (PCIManager.pciInstance) {\n PCIManager.applyBoundTo(data.params);\n } else {\n PCIManager.pendingBoundTo = data.params;\n }\n break;\n\n case 'setProperties':\n PCIManager.setProperties(data.params);\n break;\n\n case 'setStylesheets':\n PCIManager.setStylesheets(data.params);\n break;\n\n case 'setState':\n if (PCIManager.pciInstance && typeof PCIManager.pciInstance.setState === 'function') {\n PCIManager.pciInstance.setState((data.params && data.params.state) || data.params);\n } else {\n PCIManager.pendingState = (data.params && data.params.state) || data.params;\n }\n break;\n\n case 'getContent': {\n const messageId = data.params && data.params.messageId;\n const collectShadowHtml = root => {\n const parts = [];\n if (!root || !root.querySelectorAll) return parts;\n const nodes = root.querySelectorAll('*');\n for (const node of nodes) {\n if (node && node.shadowRoot) {\n parts.push(node.shadowRoot.innerHTML || '');\n parts.push(...collectShadowHtml(node.shadowRoot));\n }\n }\n return parts;\n };\n const shadowHtml = collectShadowHtml(document).join('\\n');\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'getContentResponse',\n messageId: messageId,\n content: (document.documentElement ? document.documentElement.outerHTML : '') + '\\n' + shadowHtml\n },\n '*'\n );\n break;\n }\n\n case 'simulateClick': {\n const messageId = data.params && data.params.messageId;\n const x = data.params && data.params.x;\n const y = data.params && data.params.y;\n const el = typeof x === 'number' && typeof y === 'number' ? document.elementFromPoint(x, y) : null;\n const target = (el && el.closest && el.closest('.hitbox')) || document.querySelector('.hitbox') || el;\n if (target) {\n const evt = new MouseEvent('click', {\n bubbles: true,\n clientX: x,\n clientY: y,\n screenX: x,\n screenY: y,\n view: window\n });\n target.dispatchEvent(evt);\n }\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'clickResponse',\n messageId: messageId\n },\n '*'\n );\n break;\n }\n\n case 'getBoundingRect': {\n const messageId = data.params && data.params.messageId;\n const selector = data.params && data.params.selector;\n const el = selector ? deepQuerySelector(document, selector) : null;\n const rect = el && typeof el.getBoundingClientRect === 'function' ? el.getBoundingClientRect() : null;\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'getBoundingRectResponse',\n messageId: messageId,\n rect: rect\n ? {\n left: rect.left,\n top: rect.top,\n width: rect.width,\n height: rect.height\n }\n : null\n },\n '*'\n );\n break;\n }\n\n case 'clickOnSelector': {\n const messageId = data.params && data.params.messageId;\n const selector = data.params && data.params.selector;\n const el = selector ? deepQuerySelector(document, selector) : null;\n const success = !!el;\n if (el && typeof el.click === 'function') el.click();\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'clickSelectorResponse',\n messageId: messageId,\n success: success\n },\n '*'\n );\n break;\n }\n\n case 'clickOnElementByText': {\n const messageId = data.params && data.params.messageId;\n const text = data.params && data.params.text;\n const target = text ? deepFindElementByExactText(document, text) : null;\n const success = !!target;\n if (target && typeof target.click === 'function') target.click();\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'clickTextResponse',\n messageId: messageId,\n success: success\n },\n '*'\n );\n break;\n }\n\n case 'setValueElement': {\n const messageId = data.params && data.params.messageId;\n const selector = data.params && data.params.selector;\n const value = data.params && data.params.value;\n const el = selector ? deepQuerySelector(document, selector) : null;\n let success = false;\n if (el && 'value' in el) {\n try {\n el.value = value;\n el.dispatchEvent(new Event('input', { bubbles: true }));\n el.dispatchEvent(new Event('change', { bubbles: true }));\n success = true;\n } catch (e) {\n success = false;\n }\n }\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'setValueResponse',\n messageId: messageId,\n success: success\n },\n '*'\n );\n break;\n }\n\n case 'console':\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'console',\n level: data.level,\n args: data.args\n },\n '*'\n );\n break;\n }\n });\n\n let resizeTimeout;\n let previousHeight = 0;\n const notifyResize = () => {\n const container = document.getElementById('pci-container');\n const newHeight = container.scrollHeight + 100;\n if (newHeight !== previousHeight) {\n previousHeight = newHeight;\n clearTimeout(resizeTimeout);\n resizeTimeout = setTimeout(() => {\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'resize',\n height: newHeight,\n width: container.scrollWidth\n },\n '*'\n );\n }, 100); // Adjust debounce time as needed\n }\n };\n\n function setupResizeObserver() {\n const container = document.getElementById('pci-container');\n if (!container || !(container instanceof Element)) {\n console.warn('ResizeObserver: document.container is not an Element');\n return;\n }\n\n const resizeObserver = new ResizeObserver(() => {\n notifyResize();\n });\n\n resizeObserver.observe(container);\n }\n\n // Run setup once DOM is ready\n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', () => {\n notifyResize(); // initial resize\n setupResizeObserver();\n });\n } else {\n notifyResize();\n setupResizeObserver();\n }\n\n window.addEventListener('load', () => {\n notifyResize();\n });\n let lastResponseStr = '';\n setInterval(() => {\n if (PCIManager.interactionChangedViaEvent) return;\n if (PCIManager.pciInstance && PCIManager.pciInstance.getResponse) {\n const response = PCIManager.pciInstance.getResponse();\n const valid =\n PCIManager.pciInstance && typeof PCIManager.pciInstance.checkValidity === 'function'\n ? PCIManager.pciInstance.checkValidity()\n : undefined;\n const customValidity =\n PCIManager.pciInstance && typeof PCIManager.pciInstance.getCustomValidity === 'function'\n ? PCIManager.pciInstance.getCustomValidity()\n : undefined;\n if (response === undefined) {\n // Don't emit an initial empty on load; only emit a clear if we previously had a value\n if (!PCIManager.hadResponse) return;\n PCIManager.hadResponse = false;\n PCIManager.lastResponseStr = null;\n const state =\n PCIManager.pciInstance && typeof PCIManager.pciInstance.getState === 'function'\n ? PCIManager.pciInstance.getState()\n : null;\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'interactionChanged',\n params: { value: null, state: state, valid: valid, customValidity: customValidity }\n },\n '*'\n );\n return;\n }\n\n const responseStr = JSON.stringify(response);\n\n if (responseStr !== PCIManager.lastResponseStr) {\n PCIManager.lastResponseStr = responseStr;\n PCIManager.hadResponse = true;\n const state =\n PCIManager.pciInstance && typeof PCIManager.pciInstance.getState === 'function'\n ? PCIManager.pciInstance.getState()\n : null;\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'interactionChanged',\n params: { value: response, state: state, valid: valid, customValidity: customValidity }\n },\n '*'\n );\n }\n }\n }, 500); // Check every 500ms\n <\/script>\n </head>\n <body>\n <div id=\"pci-container\"></div>\n </body>\n </html>")}},{key:"toggleInternalCorrectResponse",value:function t(t){var e;var n=this.responseVariable;this.correctResponse=t?n===null||n===void 0?void 0:n.correctResponse:n.cardinality==="single"?"":[];var i="correct-response-container-".concat(this.responseIdentifier),o=(e=this.parentElement)===null||e===void 0?void 0:e.querySelectorAll("#".concat(i));if(o&&o.forEach(function(t){t.remove()}),t)this.disable();else{this.enable();return}if(!t||!(n===null||n===void 0?void 0:n.correctResponse))return;var a=document.createElement("div");a.id=i,a.className="pci-correct-response-container",a.style.position="relative",a.style.marginTop="20px",a.style.border="2px solid green",a.style.padding="16px",a.style.borderRadius="4px",a.style.backgroundColor="rgba(0, 128, 0, 0.05)";var s=document.createElement("div");s.textContent="Correct Response:",s.style.fontWeight="bold",s.style.marginBottom="10px",s.style.color="green",a.appendChild(s);var l=document.createElement("qti-portable-custom-interaction");Array.from(this.attributes).forEach(function(t){t.name!=="id"&&t.name!=="response-identifier"&&l.setAttribute(t.name,t.value)});var u=this.responseIdentifier;l.responseIdentifier="".concat(u,"-correct"),Array.from(this.children).forEach(function(t){var e=t.cloneNode(!0);l.appendChild(e)});var c=n.correctResponse,d=l.connectedCallback;l.connectedCallback=function(){var t=this;d.call(this);var e=function e(){var e=t.responseVariablesToQtiVariableJSON(c,n.cardinality,n.baseType);t.sendMessageToIframe("setBoundTo",h({},u,e)),t.sendMessageToIframe("setState",{state:"review"})};this._iframeLoaded?e():this.addEventListener("qti-portable-custom-interaction-loaded",e,{once:!0})},l.style.pointerEvents="none",a.appendChild(l),this.after(a)}},{key:"disable",value:function t(){if(rH(this,f6,{pointerEvents:this.style.pointerEvents,position:this.style.position}),this.sendMessageToIframe("setState",{state:"disabled"}),!this.querySelector(".pci-interaction-overlay")){var t=document.createElement("div");t.className="pci-interaction-overlay",t.style.position="absolute",t.style.top="0",t.style.left="0",t.style.width="100%",t.style.height="100%",t.style.backgroundColor="rgba(200, 200, 200, 0.3)",t.style.zIndex="100",t.style.pointerEvents="all",t.style.cursor="not-allowed",getComputedStyle(this).position==="static"&&(this.style.position="relative"),this.appendChild(t)}}},{key:"enable",value:function t(){var t=this.querySelector(".pci-interaction-overlay");t&&t.remove(),rz(this,f6)&&(rz(this,f6).pointerEvents&&(this.style.pointerEvents=rz(this,f6).pointerEvents),rz(this,f6).position&&(this.style.position=rz(this,f6).position),rH(this,f6,null)),this.sendMessageToIframe("setState",{state:"interacting"})}},{key:"render",value:function t(){return ol(nb(),this._errorMessage?ol(ny(),this._errorMessage):"")}}]);return e}(al);fD=new WeakMap,fV=new WeakMap,f$=new WeakMap,fW=new WeakMap,fj=new WeakMap,fF=new WeakSet,fz=function t(){if(rz(this,fV)===null&&this.requirePathsJson)try{var t=JSON.parse(this.requirePathsJson);if(Array.isArray(t)||!t||(typeof t==="undefined"?"undefined":U(t))!="object")throw new Error("Require paths must be a JSON object.");rH(this,fV,t)}catch(t){console.error("Error parsing require paths JSON:",t),this._errorMessage="Error parsing require paths JSON: ".concat(t.message),rH(this,fV,{})}return rz(this,fV)||{}},fB=function t(){if(rz(this,f$)===null&&this.requireShimJson)try{rH(this,f$,JSON.parse(this.requireShimJson))}catch(t){console.error("Error parsing require shim JSON:",t),this._errorMessage="Error parsing require shim JSON: ".concat(t.message),rH(this,f$,{})}return rz(this,f$)||{}},fH=function t(){return rQ(this,fF,fz).call(this)},fQ=function t(){return rQ(this,fF,fB).call(this)},fX=function t(t){for(var e in t)if(t.hasOwnProperty(e)){var n=t[e];if(n){for(var i in n)if(n.hasOwnProperty(i)){var o=n[i];if(Array.isArray(o))return o.map(String);if(o!=null)return String(o)}}}return null},fG=function t(t){var e=k({},t);for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var i=n.replace(/[A-Z]/g,function(t){return"-".concat(t.toLowerCase())});e[i]=t[n]}return e},fJ=function t(t){var e=k({},t),n=function t(t,e,n){var i=t;for(var o=0;o<e.length;o+=1){var a=e[o];if(o===e.length-1){i[a]=n;return}(!i[a]||U(i[a])!="object"||Array.isArray(i[a]))&&(i[a]={}),i=i[a]}};var i=true,o=false,a=undefined;try{for(var s=Object.entries(t)[Symbol.iterator](),l;!(i=(l=s.next()).done);i=true){var u=T(l.value,2),c=u[0],d=u[1];if(!c.includes("__"))continue;var h=c.split("__").filter(Boolean);h.length<2||n(e,h,d)}}catch(t){o=true;a=t}finally{try{if(!i&&s.return!=null){s.return()}}finally{if(o){throw a}}}return e},fY=function t(){return this.response===null||this.response===void 0?!1:Array.isArray(this.response)?this.response.length===0?!1:this.response.some(function(t){return t!==""&&t!==null&&t!==void 0}):this.response!==""},fK=function t(t,e){var n=this.dataset.invalidresponsemessage||"Invalid response.",i=t?"":e&&e.trim().length>0?e:n;this._internals.setValidity(t?{}:{customError:!0},i)},fZ=function t(t){return t&&t.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#x27;/g,"'").replace(/&#x2F;/g,"/").replace(/&#x60;/g,"`").replace(/&#x3D;/g,"=")},f0=function t(t){var e={};var n=true,i=false,o=undefined;try{for(var a=Object.entries(t)[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=T(s.value,2),u=l[0],c=l[1];typeof c=="string"?e[u]=rQ(this,fF,fZ).call(this,c):e[u]=c}}catch(t){i=true;o=t}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(i){throw o}}}return e},f1=function t(){var t=this;this._pendingMessages.length&&(this._pendingMessages.forEach(function(e){t.sendMessageToIframe(e.method,e.params)}),this._pendingMessages=[])},f2=function t(){var t,e;var n=rQ(this,fF,fG).call(this,rQ(this,fF,fJ).call(this,rQ(this,fF,f0).call(this,k({},this.dataset)))),i=(e=this.context)===null||e===void 0?void 0:(t=e.state)===null||t===void 0?void 0:t[this.responseIdentifier],o=typeof i=="string"&&i.length>0?i:null,a={module:this.module,customInteractionTypeIdentifier:this.customInteractionTypeIdentifier,baseUrl:this.baseUrl?this.baseUrl.startsWith("http")||this.baseUrl.startsWith("blob")||this.baseUrl.startsWith("base64")?this.baseUrl:x("".concat(window.location.origin).concat(this.baseUrl)):window.location.origin,responseIdentifier:this.responseIdentifier,properties:n,contextVariables:this.getContextVariables(),templateVariables:this.getTemplateVariables(),dataAttributes:k({},this.dataset),interactionModules:rQ(this,fF,f3).call(this),boundTo:o?null:this.boundTo,state:o};this.sendMessageToIframe("initialize",a)},f3=function t(){var t=[],e=this.querySelector("qti-interaction-modules");if(e){var n=e.querySelectorAll("qti-interaction-module");var i=true,o=false,a=undefined;try{for(var s=n[Symbol.iterator](),l;!(i=(l=s.next()).done);i=true){var u=l.value;t.push({id:u.getAttribute("id"),primaryPath:u.getAttribute("primary-path"),fallbackPath:u.getAttribute("fallback-path")})}}catch(t){o=true;a=t}finally{try{if(!i&&s.return!=null){s.return()}}finally{if(o){throw a}}}}return t},f5=function t(){var t=this.querySelector("qti-interaction-markup");t&&this.sendMessageToIframe("setMarkup",t.innerHTML);var e=Array.from(this.querySelectorAll("qti-stylesheet"));if(e.length){var n=e.map(function(t){return t.outerHTML}).join("\n");this.sendMessageToIframe("setStylesheets",n)}var i=this.querySelector("properties");i&&this.sendMessageToIframe("setProperties",i.innerHTML)},f4=function t(){},f6=new WeakMap,f8.styles=[fL,iM(nw())],rj([o({type:String,attribute:"module"})],f8.prototype,"module",2),rj([o({type:String,attribute:"custom-interaction-type-identifier"})],f8.prototype,"customInteractionTypeIdentifier",2),rj([o({type:String,attribute:"data-require-paths"})],f8.prototype,"requirePathsJson",2),rj([o({type:String,attribute:"data-require-shim"})],f8.prototype,"requireShimJson",2),rj([o({type:String,attribute:"data-require-js-url"})],f8.prototype,"requireJsUrl",2),rj([o({type:String,attribute:"data-base-url"})],f8.prototype,"baseUrl",2),rj([o({type:Boolean,attribute:"data-use-default-paths"})],f8.prototype,"useDefaultPaths",2),rj([u()],f8.prototype,"_errorMessage",2),rj([e({context:oV,subscribe:!0}),u()],f8.prototype,"context",2),rj([e({context:oF,subscribe:!0}),u()],f8.prototype,"qtiContext",2),rj([u()],f8.prototype,"response",2);var f7,f9=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,f7,!1);return t}d(e,[{key:"getIFrameContent",value:function t(){return a(function(){var t;return $(this,function(e){t=this;return[2,new Promise(function(e){var n="get-content-".concat(Date.now()),i=function o(o){var a=o.data;(a===null||a===void 0?void 0:a.source)==="qti-pci-iframe"&&(!(a===null||a===void 0?void 0:a.responseIdentifier)||(a===null||a===void 0?void 0:a.responseIdentifier)===t.responseIdentifier)&&(a===null||a===void 0?void 0:a.method)==="getContentResponse"&&(a===null||a===void 0?void 0:a.messageId)===n&&(window.removeEventListener("message",i),e(a.content))};window.addEventListener("message",i),t.sendMessageToIframe("getContent",{messageId:n}),setTimeout(function(){window.removeEventListener("message",i),e("")},5e3)})]})}).call(this)}},{key:"setTestContext",value:function t(t){var e=this;this.context=t,this.updateComplete.then(function(){var n;e.value=t===null||t===void 0?void 0:(n=t.variables)===null||n===void 0?void 0:n.find(function(t){return t.identifier===e.responseIdentifier}).value})}},{key:"recreateIframe",value:function t(){return a(function(){var t;return $(this,function(e){t=this;rH(this,f7,!0);try{return[2,(this.iframe&&(this._iframeLoaded=!1,this.iframe.remove()),this._pendingMessages=[],this.createIframe(),new Promise(function(e){var n=function i(){t.removeEventListener("qti-portable-custom-interaction-loaded",n),e()};t.addEventListener("qti-portable-custom-interaction-loaded",n),setTimeout(function(){t.removeEventListener("qti-portable-custom-interaction-loaded",n),e()},5e3)}))]}finally{rH(this,f7,!1)}return[2]})}).call(this)}},{key:"disconnectedCallback",value:function t(){rz(this,f7)||f(p(e.prototype),"disconnectedCallback",this).call(this)}},{key:"iFrameMouseClick",value:function t(t,e){return a(function(){var n;return $(this,function(i){n=this;return[2,new Promise(function(i){var o="click-".concat(Date.now()),a=function t(t){var e=t.data;(e===null||e===void 0?void 0:e.source)==="qti-pci-iframe"&&(!(e===null||e===void 0?void 0:e.responseIdentifier)||(e===null||e===void 0?void 0:e.responseIdentifier)===n.responseIdentifier)&&(e===null||e===void 0?void 0:e.method)==="clickResponse"&&(e===null||e===void 0?void 0:e.messageId)===o&&(window.removeEventListener("message",a),i())};window.addEventListener("message",a),n.sendMessageToIframe("simulateClick",{x:t,y:e,messageId:o}),setTimeout(function(){window.removeEventListener("message",a),i()},5e3)})]})}).call(this)}},{key:"iFrameClickOnElement",value:function t(t){return a(function(){var e;return $(this,function(n){e=this;return[2,new Promise(function(n){var i="click-selector-".concat(Date.now()),o=function t(t){var a=t.data;(a===null||a===void 0?void 0:a.source)==="qti-pci-iframe"&&(!(a===null||a===void 0?void 0:a.responseIdentifier)||(a===null||a===void 0?void 0:a.responseIdentifier)===e.responseIdentifier)&&(a===null||a===void 0?void 0:a.method)==="clickSelectorResponse"&&(a===null||a===void 0?void 0:a.messageId)===i&&(window.removeEventListener("message",o),n(a.success))};window.addEventListener("message",o),e.sendMessageToIframe("clickOnSelector",{selector:t,messageId:i}),setTimeout(function(){window.removeEventListener("message",o),n(!1)},5e3)})]})}).call(this)}},{key:"iFrameClickOnElementByText",value:function t(t){return a(function(){var e;return $(this,function(n){e=this;return[2,new Promise(function(n){var i="click-text-".concat(Date.now()),o=function t(t){var a=t.data;(a===null||a===void 0?void 0:a.source)==="qti-pci-iframe"&&(!(a===null||a===void 0?void 0:a.responseIdentifier)||(a===null||a===void 0?void 0:a.responseIdentifier)===e.responseIdentifier)&&(a===null||a===void 0?void 0:a.method)==="clickTextResponse"&&(a===null||a===void 0?void 0:a.messageId)===i&&(window.removeEventListener("message",o),n(a.success))};window.addEventListener("message",o),e.sendMessageToIframe("clickOnElementByText",{text:t,messageId:i}),setTimeout(function(){window.removeEventListener("message",o),n(!1)},5e3)})]})}).call(this)}},{key:"iFrameSetValueElement",value:function t(t,e){return a(function(){var n;return $(this,function(i){n=this;return[2,new Promise(function(i){var o="set-value-".concat(Date.now()),a=function t(t){var e=t.data;(e===null||e===void 0?void 0:e.source)==="qti-pci-iframe"&&(!(e===null||e===void 0?void 0:e.responseIdentifier)||(e===null||e===void 0?void 0:e.responseIdentifier)===n.responseIdentifier)&&(e===null||e===void 0?void 0:e.method)==="setValueResponse"&&(e===null||e===void 0?void 0:e.messageId)===o&&(window.removeEventListener("message",a),i(e.success))};window.addEventListener("message",a),n.sendMessageToIframe("setValueElement",{selector:t,value:e,messageId:o}),setTimeout(function(){window.removeEventListener("message",a),i(!1)},5e3)})]})}).call(this)}},{key:"iFrameGetBoundingClientRect",value:function t(t){return a(function(){var e;return $(this,function(n){e=this;return[2,new Promise(function(n){var i="get-bounding-rect-".concat(Date.now()),o=function t(t){var a;var s=t.data;(s===null||s===void 0?void 0:s.source)==="qti-pci-iframe"&&(!(s===null||s===void 0?void 0:s.responseIdentifier)||(s===null||s===void 0?void 0:s.responseIdentifier)===e.responseIdentifier)&&(s===null||s===void 0?void 0:s.method)==="getBoundingRectResponse"&&(s===null||s===void 0?void 0:s.messageId)===i&&(window.removeEventListener("message",o),n((a=s.rect)!==null&&a!==void 0?a:null))};window.addEventListener("message",o),e.sendMessageToIframe("getBoundingRect",{selector:t,messageId:i}),setTimeout(function(){window.removeEventListener("message",o),n(null)},5e3)})]})}).call(this)}},{key:"iFrameSetValueElementByText",value:function t(t,e){return a(function(){var n;return $(this,function(i){n=this;return[2,new Promise(function(i){var o="set-value-text-".concat(Date.now()),a=function t(t){var e=t.data;(e===null||e===void 0?void 0:e.source)==="qti-pci-iframe"&&(!(e===null||e===void 0?void 0:e.responseIdentifier)||(e===null||e===void 0?void 0:e.responseIdentifier)===n.responseIdentifier)&&(e===null||e===void 0?void 0:e.method)==="setValueByTextResponse"&&(e===null||e===void 0?void 0:e.messageId)===o&&(window.removeEventListener("message",a),i(e.success))};window.addEventListener("message",a),n.sendMessageToIframe("setValueElementByText",{text:t,value:e,messageId:o}),setTimeout(function(){window.removeEventListener("message",a),i(!1)},5e3)})]})}).call(this)}},{key:"iFrameMousedownOnElement",value:function t(t){return a(function(){var e;return $(this,function(n){e=this;return[2,new Promise(function(n){var i="mousedown-selector-".concat(Date.now()),o=function t(t){var a=t.data;(a===null||a===void 0?void 0:a.source)==="qti-pci-iframe"&&(!(a===null||a===void 0?void 0:a.responseIdentifier)||(a===null||a===void 0?void 0:a.responseIdentifier)===e.responseIdentifier)&&(a===null||a===void 0?void 0:a.method)==="mousedownSelectorResponse"&&(a===null||a===void 0?void 0:a.messageId)===i&&(window.removeEventListener("message",o),n(a.success))};window.addEventListener("message",o),e.sendMessageToIframe("mousedownOnSelector",{selector:t,messageId:i}),setTimeout(function(){window.removeEventListener("message",o),n(!1)},5e3)})]})}).call(this)}},{key:"generateIframeContent",value:function t(){var t=f(p(e.prototype),"generateIframeContent",this).call(this),n="\n // Test helper functions for QtiPortableCustomInteractionTest\n // Base iframe implementation already provides PCIManager.getContent\n \n // Base iframe implementation already provides PCIManager.simulateClick\n \n // Base iframe implementation already provides PCIManager.clickOnSelector\n \n // Base iframe implementation already provides PCIManager.clickOnElementByText\n \n // Base iframe implementation already provides PCIManager.setValueElement\n \n function deepQuerySelector(root, selector) {\n if (!root) return null;\n try {\n const direct = root.querySelector ? root.querySelector(selector) : null;\n if (direct) return direct;\n } catch (e) {\n // ignore invalid selector for this root\n }\n if (!root.querySelectorAll) return null;\n const nodes = root.querySelectorAll('*');\n for (const node of nodes) {\n if (node && node.shadowRoot) {\n const found = deepQuerySelector(node.shadowRoot, selector);\n if (found) return found;\n }\n }\n return null;\n }\n\n function deepFindElementByExactText(root, text) {\n if (!root || !text) return null;\n if (root.querySelectorAll) {\n const nodes = root.querySelectorAll('*');\n for (const node of nodes) {\n if ((node.textContent || '').trim() === text) return node;\n if (node.shadowRoot) {\n const found = deepFindElementByExactText(node.shadowRoot, text);\n if (found) return found;\n }\n }\n }\n return null;\n }\n\n function escapeSelectorId(id) {\n try {\n if (window.CSS && typeof window.CSS.escape === 'function') return window.CSS.escape(id);\n } catch (e) {\n // ignore\n }\n return String(id).replace(/([ #;?%&,.+*~\\':\"!^$[\\]()=>|\\/])/g, '\\\\$1');\n }\n\n PCIManager.setValueElementByText = function(params) {\n const messageId = params && params.messageId;\n try {\n const text = params && params.text;\n const value = params && params.value;\n\n const textEl = text ? deepFindElementByExactText(document, text) : null;\n let target = null;\n\n if (textEl) {\n const tag = (textEl.tagName || '').toUpperCase();\n if (tag === 'INPUT' || tag === 'TEXTAREA' || tag === 'SELECT') {\n target = textEl;\n } else if (tag === 'LABEL' && textEl.htmlFor) {\n const id = escapeSelectorId(textEl.htmlFor);\n target = deepQuerySelector(document, '#' + id);\n }\n\n if (!target) {\n let parent = textEl.parentElement;\n while (parent) {\n const candidate = parent.querySelector ? parent.querySelector('input, textarea, select') : null;\n if (candidate) {\n target = candidate;\n break;\n }\n parent = parent.parentElement;\n }\n }\n }\n\n const success = !!target && setValueOnElement(target, value);\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'setValueByTextResponse',\n messageId: messageId,\n success: success\n },\n '*'\n );\n } catch (error) {\n console.error('Error setting value by text:', error);\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'setValueByTextResponse',\n messageId: messageId,\n success: false,\n error: error.toString()\n },\n '*'\n );\n }\n };\n \n PCIManager.mousedownOnSelector = function(params) {\n try {\n const element = params && params.selector ? deepQuerySelector(document, params.selector) : null;\n \n let success = false;\n \n if (element) {\n const rect = element.getBoundingClientRect();\n const mousedownEvent = new MouseEvent('mousedown', {\n bubbles: true,\n cancelable: true,\n view: window,\n clientX: rect.left + rect.width / 2,\n clientY: rect.top + rect.height / 2\n });\n element.dispatchEvent(mousedownEvent);\n success = true;\n }\n \n window.parent.postMessage({\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'mousedownSelectorResponse',\n messageId: params.messageId,\n success\n }, '*');\n } catch (error) {\n console.error('Error performing mousedown on selector:', error);\n window.parent.postMessage({\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'mousedownSelectorResponse',\n messageId: params.messageId,\n success: false,\n error: error.toString()\n }, '*');\n }\n };\n \n // Helper function for setting values on elements\n function setValueOnElement(element, value) {\n if (element.tagName === 'INPUT' || element.tagName === 'TEXTAREA') {\n element.value = value;\n element.dispatchEvent(new Event('input', { bubbles: true }));\n element.dispatchEvent(new Event('change', { bubbles: true }));\n return true;\n } else if (element.tagName === 'SELECT') {\n element.value = value;\n element.dispatchEvent(new Event('change', { bubbles: true }));\n return true;\n } else if (element.isContentEditable) {\n element.textContent = value;\n element.dispatchEvent(new Event('input', { bubbles: true }));\n return true;\n }\n return false;\n }\n \n // Add test-related message handlers (do not override global handlers)\n let expectedParentOriginTest = null;\n window.addEventListener(\n 'message',\n function(event) {\n const { data } = event;\n\n if (event.source !== window.parent || !data || data.source !== 'qti-portable-custom-interaction') return;\n if (expectedParentOriginTest === null) expectedParentOriginTest = event.origin;\n else if (event.origin !== expectedParentOriginTest) return;\n if (data.responseIdentifier && data.responseIdentifier !== PCIManager.responseIdentifier) return;\n\n switch (data.method) {\n case 'setValueElementByText':\n PCIManager.setValueElementByText(data.params);\n return;\n case 'mousedownOnSelector':\n PCIManager.mousedownOnSelector(data.params);\n return;\n }\n },\n true\n );",i=t.lastIndexOf("<\/script>");return t.substring(0,i)+n+t.substring(i)}}]);return e}(f8);f7=new WeakMap;customElements.define("qti-portable-custom-interaction",f8);customElements.define("qti-portable-custom-interaction-test",f9);var pt=iM(nq());var pe=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){return ol(nk())}}]);return e}(oR);pe.styles=pt;var pn=iM(nx());var pr=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e),t.removeMoveListener=t.removeMoveListener.bind(t),t.dragElementHandler=t.dragElementHandler.bind(t);return t}d(e,[{key:"render",value:function t(){return ol(n_())}},{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;f(p(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(){f(p(e.prototype),"disconnectedCallback",this).call(this),document.removeEventListener("mousemove",this.dragElementHandler),document.removeEventListener("mouseup",this.removeMoveListener)}}]);return e}(oR);pr.styles=pn;customElements.define("qti-position-object-interaction",pe);customElements.define("qti-position-object-stage",pr);var pi="important",po=" !"+pi,pa=oG(/*#__PURE__*/function(t){"use strict";v(e,t);function e(t){l(this,e);var n;var i;if(n=s(this,e,[t]),t.type!==oX.ATTRIBUTE||t.name!=="style"||((i=t.strings)===null||i===void 0?void 0:i.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}d(e,[{key:"render",value:function t(t){return Object.keys(t).reduce(function(e,n){var i=t[n];return i==null?e:e+"".concat(n=n.includes("-")?n:n.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase(),":").concat(i,";")},"")}},{key:"update",value:function t(t,e){var n=T(e,1),i=n[0];var o=t.element,a=o.style;if(this.ft===void 0)return this.ft=new Set(Object.keys(i)),this.render(i);var s=true,l=false,u=undefined;try{for(var c=this.ft[Symbol.iterator](),d;!(s=(d=c.next()).done);s=true){var h=d.value;i[h]==null&&(this.ft.delete(h),h.includes("-")?a.removeProperty(h):a[h]=null)}}catch(t){l=true;u=t}finally{try{if(!s&&c.return!=null){c.return()}}finally{if(l){throw u}}}for(var f in i){var p=i[f];if(p!=null){this.ft.add(f);var v=typeof p=="string"&&p.endsWith(po);f.includes("-")||v?a.setProperty(f,v?p.slice(0,-11):p,v?pi:""):a[f]=p}}return od}}]);return e}(oJ));var ps=iM(nE());var pl,pu,pc,pd,ph,pf,pp,pv,pm,pg=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,pv);t.maxChoices=1/0;t.minChoices=0;t.response=null;t._correctAreas=[];t._responseCorrection=[];rB(t,pl,null);rB(t,pu,1);rB(t,pc,1);rB(t,pd,0);rB(t,ph,0);rB(t,pf,function(e){if(t.disabled)return;if(!rz(t,pl)){console.warn("No <img> element found in <qti-select-point-interaction>");return}rQ(t,pv,pm).call(t);var n=rz(t,pl).getBoundingClientRect(),i=(e.clientX-n.left)*rz(t,pu),o=(e.clientY-n.top)*rz(t,pc),a="".concat(i.toFixed()," ").concat(o.toFixed());t.maxChoices===1?t.response=[a]:(t.maxChoices===0||(t.response||[]).length<t.maxChoices)&&(t.response=N(t.response||[]).concat([a])),t.saveResponse(t.response)});rB(t,pp,function(){rQ(t,pv,pm).call(t)});return t}d(e,[{key:"connectedCallback",value:function t(){f(p(e.prototype),"connectedCallback",this).call(this),window.addEventListener("resize",rz(this,pp))}},{key:"responsePoints",get:function t(){return(this.response||[]).filter(function(t){return t}).map(function(t){var e=T(t.split(" ").map(Number),2),n=e[0],i=e[1];return{x:n,y:i}})}},{key:"toggleCandidateCorrection",value:function t(t){var e=this;this._responseCorrection=[],t&&this.responsePoints.forEach(function(t){var n=e.responseVariable.areaMapping.areaMapEntries.some(function(n){return ay.isPointInArea("".concat(t.x," ").concat(t.y),"".concat(n.shape,",").concat(n.coords),e.responseVariable.baseType)});e._responseCorrection.push(n)})}},{key:"toggleCorrectResponse",value:function t(t){var e=this.responseVariable;if(!t||!e){this._correctAreas=[];return}var n=e.areaMapping,i=[];if(!n||n.areaMapEntries.length===0)if(e.correctResponse){var o=Array.isArray(e.correctResponse)?e.correctResponse:[e.correctResponse];if(o.length===0||o.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."),i=o.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 i=n.areaMapEntries;this._correctAreas=i.map(function(t){return{coords:t.coords,shape:t.shape}})}},{key:"updated",value:function t(t){f(p(e.prototype),"updated",this).call(this,t);var n=rz(this,pl);n&&t.has("_correctAreas")&&this._correctAreas.length>0&&(rQ(this,pv,pm).call(this),this.shadowRoot.querySelectorAll("div").forEach(function(t){var e=t.dataset.coord,i=t.dataset.shape;e&&i&&rb(i,e.split(",").map(function(t){return+t}),n,t)}))}},{key:"render",value:function t(){var t=this;var e;return ol(nA(),hP((this.response||[]).filter(function(t){return t}),function(t){return t},function(e,n){var i=T(e.split(" ").map(Number),2),o=i[0],a=i[1],s=o/(rz(t,pd)||1)*100,l=a/(rz(t,ph)||1)*100,u=16,c=u/(rz(t,pd)||1)*100,d=u/(rz(t,ph)||1)*100,h="";return t._responseCorrection[n]===!0?h=" correct":t._responseCorrection[n]===!1&&(h=" incorrect"),ol(nC(),h,pa({pointerEvents:t.maxChoices===1?"none":"auto",position:"absolute",transform:"translate(-50%, -50%)",left:"".concat(s,"%"),top:"".concat(l,"%"),width:"min(".concat(c,"%, 1rem)"),height:"min(".concat(d,"%, 1rem)"),minWidth:"min(".concat(c,"%, 1rem)"),minHeight:"min(".concat(d,"%, 1rem)"),borderRadius:"50%",background:"red"}),e,t.disabled,function(e){e.stopPropagation(),t.response=(t.response||[]).filter(function(t,e){return e!==n}),t.saveResponse(t.response)})}),hP(((e=this._correctAreas)===null||e===void 0?void 0:e.filter(function(t){return t}))||[],function(t){return t},function(t,e){return ol(nS(),pa({position:"absolute",pointerEvents:"none",backgroundColor:"var(--qti-correct)",opacity:"0.5"}),t.coords,"correct-response-".concat(e+1),t.shape)}))}},{key:"validate",value:function t(){return this.response!==null&&this.response.length>=this.minChoices&&this.response.length<=this.maxChoices}},{key:"firstUpdated",value:function t(){rH(this,pl,this.querySelector("img")),rz(this,pl)?(rQ(this,pv,pm).call(this),rz(this,pl).addEventListener("click",rz(this,pf))):console.warn("No <img> element found in <qti-select-point-interaction>")}},{key:"disconnectedCallback",value:function t(){f(p(e.prototype),"disconnectedCallback",this).call(this),window.removeEventListener("resize",rz(this,pp)),rz(this,pl)&&rz(this,pl).removeEventListener("click",rz(this,pf))}}]);return e}(al);pl=new WeakMap,pu=new WeakMap,pc=new WeakMap,pd=new WeakMap,ph=new WeakMap,pf=new WeakMap,pp=new WeakMap,pv=new WeakSet,pm=function t(){rH(this,pd,rz(this,pl).getAttribute("width")?parseFloat(rz(this,pl).getAttribute("width")):rz(this,pl).naturalWidth),rH(this,ph,rz(this,pl).getAttribute("height")?parseFloat(rz(this,pl).getAttribute("height")):rz(this,pl).naturalHeight);var t=rz(this,pl).getBoundingClientRect();rH(this,pu,t.width===0?1:rz(this,pd)/t.width),rH(this,pc,t.height===0?1:rz(this,ph)/t.height)},pg.styles=ps,rj([o({type:Number,attribute:"max-choices"})],pg.prototype,"maxChoices",2),rj([o({type:Number,attribute:"min-choices"})],pg.prototype,"minChoices",2),rj([u()],pg.prototype,"response",2),rj([u()],pg.prototype,"_correctAreas",2),rj([u()],pg.prototype,"_responseCorrection",2);customElements.define("qti-select-point-interaction",pg);var py=iM(nR());var pb,pw,pq,pk,px,p_,pE,pC,pS,pA=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,pq);rB(t,pb,0);rB(t,pw,null);t.min=0;t.max=100;t.step=1;return t}d(e,[{key:"validate",value:function t(){return!0}},{key:"connectedCallback",value:function t(){f(p(e.prototype),"connectedCallback",this).call(this),rQ(this,pq,pk).call(this,this.min),this.setAttribute("tabindex","0"),this.setAttribute("role","slider")}},{key:"response",get:function t(){return rz(this,pb).toString()},set:function t(t){var e=parseInt(t,10);isNaN(e)||rQ(this,pq,pk).call(this,e)}},{key:"toggleCorrectResponse",value:function t(t){var e=this.responseVariable;if(e===null||e===void 0?void 0:e.correctResponse){if(t){this._correctResponse=e.correctResponse.toString();var n=parseFloat(e.correctResponse.toString());if(isNaN(n))rH(this,pw,null);else{rH(this,pw,n);var i=(rz(this,pw)-this.min)/(this.max-this.min)*100;this.style.setProperty("--value-percentage-correct","".concat(i,"%"))}}else rH(this,pw,null);this.requestUpdate()}}},{key:"render",value:function t(){return ol(nT(),this.min,this.max,rQ(this,pq,px),rQ(this,pq,p_),this.response,rz(this,pw)!==null?ol(nI(),rz(this,pw)):null)}}]);return e}(al);pb=new WeakMap,pw=new WeakMap,pq=new WeakSet,pk=function t(t){var e=rz(this,pb);if(rH(this,pb,Math.min(this.max,Math.max(this.min,t))),rz(this,pb)===e)return;var n=(rz(this,pb)-this.min)/(this.max-this.min)*100;this.style.setProperty("--value-percentage","".concat(n,"%")),this._internals.setFormValue(this.value),this.saveResponse(this.response),this.requestUpdate()},px=function t(t){var e=this;rQ(this,pq,pE).call(this,t.pageX);var n=function t(t){return rQ(e,pq,pC).call(e,t.pageX)},i=function t(){document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",i),rQ(e,pq,pS).call(e)};document.addEventListener("mousemove",n),document.addEventListener("mouseup",i)},p_=function t(t){var e=this;rQ(this,pq,pE).call(this,t.touches[0].pageX);var n=function t(t){return rQ(e,pq,pC).call(e,t.touches[0].pageX)},i=function t(){document.removeEventListener("touchmove",n),document.removeEventListener("touchend",i),rQ(e,pq,pS).call(e)};document.addEventListener("touchmove",n,{passive:!1}),document.addEventListener("touchend",i)},pE=function t(t){rQ(this,pq,pC).call(this,t)},pC=function t(t){var e=this._rail.getBoundingClientRect(),n=t-e.left,i=Math.min(1,Math.max(0,n/e.width)),o=this.min+Math.round(i*(this.max-this.min)/this.step)*this.step;rQ(this,pq,pk).call(this,o)},pS=function t(){this.dispatchEvent(new Event("change",{bubbles:!0}))},pA.styles=py,rj([c("#rail")],pA.prototype,"_rail",2),rj([o({type:Number,attribute:"lower-bound"})],pA.prototype,"min",2),rj([o({type:Number,attribute:"upper-bound"})],pA.prototype,"max",2),rj([o({type:Number,attribute:"step"})],pA.prototype,"step",2);customElements.define("qti-slider-interaction",pA);var pR=function t(){return new pI},pI=function t(){"use strict";l(this,t)},pT=new WeakMap,pM=oG(/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(t){return oh}},{key:"update",value:function t(t,e){var n=T(e,1),i=n[0];var o;var a=i!==this.G;return a&&this.G!==void 0&&this.rt(void 0),(a||this.lt!==this.ct)&&(this.G=i,this.ht=(o=t.options)===null||o===void 0?void 0:o.host,this.rt(this.ct=t.element)),oh}},{key:"rt",value:function t(t){if(this.isConnected||(t=void 0),typeof this.G=="function"){var e;var n=(e=this.ht)!==null&&e!==void 0?e:globalThis,i=pT.get(n);i===void 0&&(i=new WeakMap,pT.set(n,i)),i.get(this.G)!==void 0&&this.G.call(this.ht,void 0),i.set(this.G,t),t!==void 0&&this.G.call(this.ht,t)}else this.G.value=t}},{key:"lt",get:function t(){var t;var e,n;return typeof this.G=="function"?(e=pT.get((t=this.ht)!==null&&t!==void 0?t:globalThis))===null||e===void 0?void 0:e.get(this.G):(n=this.G)===null||n===void 0?void 0:n.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}(an));var pP=iM(nM());var pO,pN,pU=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,pO);t.inputRef=pR();t.response=null;t._handleValueChange=function(){t._internals.setFormValue(t.value),t.validate()};return t}d(e,[{key:"value",get:function t(){return this.response||null},set:function t(t){this.response=t||null}},{key:"correctness",get:function t(){var t=this.responseVariable;if(!t)return null;if(t.value===null)return"incorrect";if(t.mapping){var e=t.mapping.mapEntries.reduce(function(t,e){return Math.max(e.mappedValue,t)},0);var n=true,i=false,o=undefined;try{for(var a=t.mapping.mapEntries[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;var u=l.mapKey,c=t.value;if(l.caseSensitive||(u=u.toLowerCase(),c=c.toLowerCase()),u===c)return l.mappedValue===e?"correct":l.mappedValue<=(t.mapping.defaultValue||0)?"incorrect":"partially-correct"}}catch(t){i=true;o=t}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(i){throw o}}}}return t.correctResponse===t.value?"correct":"incorrect"}},{key:"isInline",get:function t(){return!0}},{key:"validate",value:function t(){if(!this._input)return!1;if(this.patternMask&&this.dataPatternmaskMessage)this._internals.setValidity({}),this._input.setCustomValidity(""),this._input.checkValidity()||(this._internals.setValidity({customError:!0},this.dataPatternmaskMessage),this._input.setCustomValidity(this.dataPatternmaskMessage));else{var t=this._input.checkValidity();this._internals.setValidity(t?{}:{customError:!1})}return this.response!==""&&this._input.checkValidity()}},{key:"toggleInternalCorrectResponse",value:function t(t){var e=this.responseVariable;if(t&&(e===null||e===void 0?void 0:e.correctResponse)){var n=e.correctResponse.toString();this._correctResponse=n}else this._correctResponse=null}},{key:"render",value:function t(){var t=this;return ol(nO(),this.responseIdentifier,function(e){t.reportValidity()},function(t){return t.stopImmediatePropagation()},this.textChanged,this.textChanged,this.patternMask=="[0-9]*"?"number":"text",sh(this.placeholderText?this.placeholderText:void 0),this.response,sh(this.patternMask?this.patternMask:void 0),1e3,this.disabled,this.readonly,this._correctResponse?ol(nP(),this._correctResponse):oh)}},{key:"textChanged",value:function t(t){if(this.disabled||this.readonly)return;var e=t.target;rQ(this,pO,pN).call(this,e.value),this.response!==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.response=""}}]);return e}(al);pO=new WeakSet,pN=function t(t){this.setAttribute("empty",t===""?"true":"false")},pU.styles=pP,rj([o({type:Number,attribute:"expected-length"})],pU.prototype,"expectedLength",2),rj([o({type:String,attribute:"pattern-mask"})],pU.prototype,"patternMask",2),rj([o({type:String,attribute:"placeholder-text"})],pU.prototype,"placeholderText",2),rj([o({type:String,attribute:"data-patternmask-message"})],pU.prototype,"dataPatternmaskMessage",2),rj([u()],pU.prototype,"response",2),rj([c("input")],pU.prototype,"_input",2),rj([y("response",{waitUntilFirstUpdate:!0})],pU.prototype,"_handleValueChange",2);customElements.define("qti-text-entry-interaction",pU);var pL=iM(nN());var pD,pV,p$,pW,pj,pF=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,p$);rB(t,pD,null);rB(t,pV,null);return t}d(e,[{key:"reset",value:function t(){rH(this,pD,null),rH(this,pV,null),this.saveResponse(null)}},{key:"validate",value:function t(){return rz(this,pV)!==null}},{key:"response",get:function t(){return rz(this,pV)},set:function t(t){if(typeof t=="string")rH(this,pV,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 ol(nU(),rQ(this,p$,pW),this.disabled,this.readonly)}}],[{key:"properties",get:function t(){return k({},al.properties)}}]);return e}(al);pD=new WeakMap,pV=new WeakMap,p$=new WeakSet,pW=function t(t){return a(function(){var e,n,i;return $(this,function(o){switch(o.label){case 0:e=t.target;n=e.files&&e.files.length>0;if(!n)return[3,2];rH(this,pD,e.files[0]);i=[this,pV];return[4,rQ(this,p$,pj).call(this,rz(this,pD))];case 1:n=(rH.apply(void 0,i.concat([o.sent()])),this.saveResponse(rz(this,pV)),this.dispatchEvent(new CustomEvent("qti-interaction-response",{detail:{response:rz(this,pV)}})));o.label=2;case 2:n;return[2]}})}).call(this)},pj=function t(t){return new Promise(function(e,n){var i=new FileReader;i.onload=function(){return e(i.result)},i.onerror=function(){return n(i.error)},i.readAsDataURL(t)})},pF.styles=pL;customElements.define("qti-upload-interaction",pF);var pz=function t(t){return a(function(){var e,n,i,o,a,s;return $(this,function(l){switch(l.label){case 0:e=t.substring(0,t.lastIndexOf("/"));return[4,aE().load("".concat(t)).then(function(t){return t.assessmentTest()})];case 1:n=l.sent();return[4,aP().load("".concat(e,"/").concat(n.href)).then(function(t){return t.htmlDoc()})];case 2:i=l.sent();return[4,aP().load("".concat(e,"/").concat(n.href)).then(function(t){return t.items()})];case 3:o=l.sent(),a="".concat(e,"/").concat(n.href),s="".concat(e,"/").concat(n.href.substring(0,n.href.lastIndexOf("/")));return[2,{testHTMLDoc:i,testURI:s,testURL:a,items:o,testIdentifier:n.identifier}]}})})()},pB=function t(t){return a(function(){return $(this,function(e){return[2,a_().load(t).then(function(t){return t.htmlDoc().firstElementChild})]})})()};var pH=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){return ol(nL())}},{key:"process",value:function t(){throw new Error("Not implemented")}}]);return e}(oR);pH=rj([oT("qti-rule")],pH);var pQ=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"childExpression",get:function t(){return this.firstElementChild}},{key:"process",value:function t(){var t=this.getAttribute("identifier"),e=this.context.variables.find(function(e){return e.identifier===t})||null,n;return e.interpolationTable&&(n=e.interpolationTable.get(parseFloat(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:af(n)}})),n)}}]);return e}(pH);rj([o({type:String})],pQ.prototype,"identifier",2),rj([e({context:oV,subscribe:!0}),u()],pQ.prototype,"context",2);customElements.define("qti-lookup-outcome-value",pQ);var pX=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){return ol(nD())}},{key:"process",value:function t(){var t=N(this.children);for(var e=0;e<t.length;e++){var n=t[e];if(n.calculate()){n.process();return}}}}]);return e}(pH);customElements.define("qti-response-condition",pX);var pG,pJ,pY=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,pG);return t}d(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 pK(e).process();this.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:t,value:rQ(this,pG,pJ).call(this,n)}}))}}]);return e}(pH);pG=new WeakSet,pJ=function t(t){return Array.isArray(t)?t.map(af):t!==null?af(t):null};var pK=/*#__PURE__*/function(){"use strict";function t(e){l(this,t);this.expression=e}d(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",pY);var pZ=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){return ol(nV())}},{key:"calculate",value:function t(){return!0}},{key:"getSubRules",value:function t(){return N(this.children)}},{key:"process",value:function t(){var t=this.getSubRules();for(var e=0;e<t.length;e++)t[e].process()}}]);return e}(oR);customElements.define("qti-response-else",pZ);var p0=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(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}(pZ);customElements.define("qti-response-if",p0);var p1=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){return ol(n$(),f(p(e.prototype),"render",this).call(this))}}]);return e}(p0);customElements.define("qti-response-else-if",p1);var p2=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"calculate",value:function t(){return this.calculateChildren(Array.from(this.children))}}]);return e}(rw(ad));p2=rj([oT("qti-and")],p2);var p3=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.min=0;t.max=1/0;return t}d(e,[{key:"getResult",value:function t(){var t=this.getVariables();if(!t||t.length===0)return console.error("qti-any-n requires at least one child expression"),null;if(this.min<0||this.max<this.min)return console.error("qti-any-n requires 0 <= min <= max"),null;var e=0;var n=true,i=false,o=undefined;try{for(var a=t[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;if(l.cardinality!=="single"||Array.isArray(l.value))return console.error("qti-any-n requires single cardinality boolean expressions"),null;if(l.baseType!=="boolean")return console.error("qti-any-n requires boolean base-type"),null;if(l.value===null||l.value===void 0)return null;l.value==="true"&&e++}}catch(t){i=true;o=t}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(i){throw o}}}return e>=this.min&&e<=this.max}}]);return e}(ac);rj([o({type:Number})],p3.prototype,"min",2),rj([o({type:Number})],p3.prototype,"max",2);customElements.define("qti-any-n",p3);var p5=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.baseType="string";return t}d(e,[{key:"getResult",value:function t(){return this.textContent.trim()}}]);return e}(ac);rj([o({type:String,attribute:"base-type"})],p5.prototype,"baseType",2);customElements.define("qti-base-value",p5);var p4=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"getResult",value:function t(){var t;if(((t=this.children)===null||t===void 0?void 0:t.length)!==1)return console.error("qti-container-size must have exactly one child expression"),0;var e=this.getVariables();if(!e||(e===null||e===void 0?void 0:e.length)===0)return 0;var n=e[0];return n.value===null||n.value===void 0?0:n.cardinality!=="multiple"&&n.cardinality!=="ordered"?(console.error("qti-container-size requires multiple or ordered cardinality"),0):Array.isArray(n.value)?n.value.length:(console.error("qti-container-size: expected array value for multiple/ordered cardinality"),0)}}]);return e}(ac);customElements.define("qti-container-size",p4);var p6=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(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 i=e.value,o=n.value;return i.filter(function(t){return o.includes(t)}).length>0}else if(e.baseType==="directedPair"&&n.baseType==="directedPair"&&e.cardinality==="single"){var a=e.value;return n.value.includes(a)}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}(ad);customElements.define("qti-contains",p6);var p8=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(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}(ac);customElements.define("qti-correct",p8);var p7=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.identifier="";return t}d(e,[{key:"getResult",value:function t(){var t;if(!this.identifier)return console.error("qti-default requires an identifier attribute"),null;var e=this.identifier.split("."),n=null,i;if(e.length===2)n=e[0],i=e[1];else if(e.length===1)i=e[0];else return console.error("qti-default: invalid identifier format"),null;if(n){var o;var a=this._testContext.items.find(function(t){return t.identifier===n});if(console.debug("itemContext: ".concat(JSON.stringify(a))),!this._testContext||!a)return console.warn('qti-default: item "'.concat(n,'" not found in test context')),null;var s=(o=this._testContext.items.find(function(t){return t.identifier===n}))===null||o===void 0?void 0:o.variables.find(function(t){return t.identifier===i});return s?s.defaultValue||null:(console.warn('qti-default: variable "'.concat(i,'" not found in item "').concat(n,'"')),null)}if(!((t=this.context)===null||t===void 0?void 0:t.variables))return console.warn("qti-default: no variables found in item context"),null;var l=this.context.variables.find(function(t){return t.identifier===i});return l?l.defaultValue||null:(console.warn('qti-default: variable "'.concat(i,'" not found in item context')),null)}}]);return e}(ac);rj([o({type:String})],p7.prototype,"identifier",2),rj([e({context:oV,subscribe:!0}),u()],p7.prototype,"context",2),rj([u(),e({context:oQ,subscribe:!0})],p7.prototype,"_testContext",2);customElements.define("qti-default",p7);var p9=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.roundingMode="significantFigures";return t}d(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 i=parseFloat(e.value),o=parseFloat(n.value);if(!isNaN(i)&&!isNaN(o))return this.roundingMode==="significantFigures"?i.toPrecision(this.figures)===o.toPrecision(this.figures):Math.round(i*Math.pow(10,this.figures))/Math.pow(10,this.figures)===Math.round(o*Math.pow(10,this.figures))/Math.pow(10,this.figures);console.error("value cannot be casted to numeric value in equalRounded operator: ".concat(i,", ").concat(o));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}(ac);rj([o({type:String})],p9.prototype,"roundingMode",2);customElements.define("qti-equal-rounded",p9);var vt=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"getResult",value:function t(){if(this.children.length!==1)return console.error("qti-round must have exactly one child expression"),null;var t=this.getVariables();if(!t||t.length===0)return null;var e=t[0];if(e.cardinality!=="single")return console.error("qti-round requires single cardinality"),null;if(Array.isArray(e.value))return console.error("qti-round unexpected array value for single cardinality"),null;if(e.value===null||e.value===void 0)return null;if(e.baseType!=="integer"&&e.baseType!=="float")return console.error("qti-round requires numerical base-type (integer or float)"),null;var n=parseFloat(e.value);return isNaN(n)?(console.warn("qti-round: NaN input results in NULL"),null):isFinite(n)?Math.floor(n+.5):n===1/0?1/0:n===-1/0?-1/0:null}}]);return e}(ac);customElements.define("qti-round",vt);var ve,vn,vr,vi=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,ve);t.roundingMode="significantFigures";t.figures=3;return t}d(e,[{key:"getResult",value:function t(){if(this.children.length!==1)return console.error("qti-round-to must have exactly one child expression"),null;var t=this.getVariables();if(!t||t.length===0)return null;var e=t[0];if(e.cardinality!=="single")return console.error("qti-round-to requires single cardinality"),null;if(Array.isArray(e.value))return console.error("qti-round-to unexpected array value for single cardinality"),null;if(e.value===null||e.value===void 0)return null;if(e.baseType!=="integer"&&e.baseType!=="float")return console.error("qti-round-to requires numerical base-type"),null;var n=parseFloat(e.value);return isNaN(n)?null:isFinite(n)?this.figures<0?(console.error("qti-round-to: figures must be non-negative"),null):this.roundingMode==="significantFigures"&&this.figures<1?(console.error("qti-round-to: figures must be at least 1 for significantFigures mode"),null):this.roundingMode==="decimalPlaces"?rQ(this,ve,vn).call(this,n,this.figures):rQ(this,ve,vr).call(this,n,this.figures):n===1/0?1/0:n===-1/0?-1/0:null}}]);return e}(ac);ve=new WeakSet,vn=function t(t,e){if(t===0)return 0;var n=Math.pow(10,e);return Math.round(t*n)/n},vr=function t(t,e){if(t===0)return 0;var n=Math.floor(Math.log10(Math.abs(t))),i=Math.pow(10,e-n-1);return Math.round(t*i)/i},rj([o({type:String,attribute:"rounding-mode"})],vi.prototype,"roundingMode",2),rj([o({type:Number})],vi.prototype,"figures",2);customElements.define("qti-round-to",vi);var vo=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.toleranceMode="exact";return t}d(e,[{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),e=t[0],n=t[1];return!e||!n?null: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):e.value===null||n.value===null||e.value===void 0||n.value===void 0?null:ay.compareSingleValues(e.value,n.value,e.baseType)}return console.error("unexpected number of children in qti-equal"),null}}]);return e}(ac);rj([o({type:String})],vo.prototype,"toleranceMode",2);customElements.define("qti-equal",vo);var va,vs,vl=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,va);return t}d(e,[{key:"getResult",value:function t(){var t=rQ(this,va,vs).call(this,this.getVariables());return t.length!==2?(console.warn("qti-divide: expected exactly 2 numeric values"),null):t[1]===0?(console.warn("qti-divide: division by zero"),null):t[0]/t[1]}}]);return e}(ac);va=new WeakSet,vs=function t(t){var e=[];var n=true,i=false,o=undefined;try{var a=function(){var t=l.value;if(!t)return"continue";var n=function t(t){if(t==null)return;var n=parseFloat(t.toString());if(Number.isNaN(n)){console.warn("qti-divide: non-numeric value encountered");return}e.push(n)};if(Array.isArray(t.value)){t.value.forEach(function(t){return n(t)});return"continue"}n(t.value)};for(var s=t[Symbol.iterator](),l;!(n=(l=s.next()).done);n=true)a()}catch(t){i=true;o=t}finally{try{if(!n&&s.return!=null){s.return()}}finally{if(i){throw o}}}return e};customElements.define("qti-divide",vl);var vu,vc,vd,vh=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,vu);return t}d(e,[{key:"getResult",value:function t(){var t=rQ(this,vu,vc).call(this);return t?t[0]>=t[1]:null}}]);return e}(ac);vu=new WeakSet,vc=function t(){var t=this;var e=this.getVariables();if(e.length!==2)return console.error("qti-duration-gte requires exactly 2 duration expressions"),null;var n=e.map(function(e){return rQ(t,vu,vd).call(t,e)});return n.some(function(t){return t===null})?null:n},vd=function t(t){if(t.cardinality!=="single"||Array.isArray(t.value))return console.error("qti-duration-gte requires single cardinality"),null;if(t.baseType!=="duration")return console.error("qti-duration-gte requires duration base-type"),null;if(t.value===null||t.value===void 0)return null;var e=Number.parseFloat(t.value.toString());return Number.isNaN(e)?(console.error('qti-duration-gte requires duration values expressed in seconds, got "'.concat(t.value.toString(),'"')),null):e};customElements.define("qti-duration-gte",vh);var vf,vp,vv,vm=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,vf);return t}d(e,[{key:"getResult",value:function t(){var t=rQ(this,vf,vp).call(this);return t?t[0]<t[1]:null}}]);return e}(ac);vf=new WeakSet,vp=function t(){var t=this;var e=this.getVariables();if(e.length!==2)return console.error("qti-duration-lt requires exactly 2 duration expressions"),null;var n=e.map(function(e){return rQ(t,vf,vv).call(t,e)});return n.some(function(t){return t===null})?null:n},vv=function t(t){if(t.cardinality!=="single"||Array.isArray(t.value))return console.error("qti-duration-lt requires single cardinality"),null;if(t.baseType!=="duration")return console.error("qti-duration-lt requires duration base-type"),null;if(t.value===null||t.value===void 0)return null;var e=Number.parseFloat(t.value.toString());return Number.isNaN(e)?(console.error('qti-duration-lt requires duration values expressed in seconds, got "'.concat(t.value.toString(),'"')),null):e};customElements.define("qti-duration-lt",vm);var vg,vy,vb,vw=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,vg);return t}d(e,[{key:"getResult",value:function t(){if(this.children.length===0)return console.error("qti-gcd must have at least one child expression"),null;var t=this.getVariables();if(!t||t.length===0)return null;var e=[];var n=true,i=false,o=undefined;try{for(var a=t[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;if(l.baseType!=="integer")return console.error("qti-gcd requires integer base-type"),null;if(l.value===null||l.value===void 0)return null;if(l.cardinality==="single"){if(Array.isArray(l.value))return console.error("qti-gcd unexpected array value for single cardinality"),null;var u=parseInt(l.value,10);if(isNaN(u))return console.error("qti-gcd non-numerical value"),null;e.push(u)}else if(l.cardinality==="multiple"||l.cardinality==="ordered"){if(!Array.isArray(l.value))return console.error("qti-gcd expected array value for multiple/ordered cardinality"),null;var c=true,d=false,h=undefined;try{for(var f=l.value[Symbol.iterator](),p;!(c=(p=f.next()).done);c=true){var v=p.value;if(v==null)return null;var m=parseInt(v,10);if(isNaN(m))return console.error("qti-gcd non-numerical value"),null;e.push(m)}}catch(t){d=true;h=t}finally{try{if(!c&&f.return!=null){f.return()}}finally{if(d){throw h}}}}else return console.error("qti-gcd unsupported cardinality"),null}}catch(t){i=true;o=t}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(i){throw o}}}return e.length===0?null:rQ(this,vg,vy).call(this,e)}}]);return e}(ac);vg=new WeakSet,vy=function t(t){if(t.length===0)return 0;if(t.length===1)return Math.abs(t[0]);var e=Math.abs(t[0]);for(var n=1;n<t.length&&(e=rQ(this,vg,vb).call(this,e,Math.abs(t[n])),e!==1);n++);return e},vb=function t(t,e){if(t===0&&e===0)return 0;if(t===0)return e;if(e===0)return t;for(;e!==0;){var n=e;e=t%e,t=n}return t};customElements.define("qti-gcd",vw);var vq=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(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}(ac);customElements.define("qti-gt",vq);var vk=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(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}(ad);customElements.define("qti-gte",vk);var vx,v_,vE,vC,vS,vA,vR,vI=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,vx);t.shape="";t.coords="";return t}d(e,[{key:"getResult",value:function t(){var t=this.getVariables();if(t.length!==1)return console.error("qti-inside requires exactly one point expression"),null;var e=t[0];if(e.cardinality!=="single"||Array.isArray(e.value))return console.error("qti-inside requires single cardinality"),null;if(e.value===null||e.value===void 0)return null;if(!this.shape||!this.coords)return console.error("qti-inside requires shape and coords attributes"),null;var n=rQ(this,vx,v_).call(this,e.value.toString()),i=rQ(this,vx,vE).call(this,this.coords);if(!n||i.length===0)return null;switch(this.shape.toLowerCase()){case"circle":return rQ(this,vx,vC).call(this,n,i);case"rect":return rQ(this,vx,vS).call(this,n,i);case"ellipse":return rQ(this,vx,vA).call(this,n,i);case"poly":case"polygon":return rQ(this,vx,vR).call(this,n,i);default:return console.error('qti-inside does not support shape "'.concat(this.shape,'"')),null}}}]);return e}(ac);vx=new WeakSet,v_=function t(t){var e=t.split(/[,\s]+/).map(function(t){return t.trim()}).filter(Boolean);if(e.length!==2)return console.error('qti-inside requires a point value formatted as "x y" or "x,y"'),null;var n=Number.parseFloat(e[0]),i=Number.parseFloat(e[1]);return Number.isNaN(n)||Number.isNaN(i)?(console.error("qti-inside requires numeric point coordinates"),null):{x:n,y:i}},vE=function t(t){var e=t.split(",").map(function(t){return t.trim()}).filter(Boolean).map(function(t){return Number.parseFloat(t)});return e.some(function(t){return Number.isNaN(t)})?(console.error("qti-inside requires numeric coords"),[]):e},vC=function t(t,e){if(e.length!==3)return console.error("qti-inside circle requires x,y,r"),null;var n=T(e,3),i=n[0],o=n[1],a=n[2];return Math.pow(t.x-i,2)+Math.pow(t.y-o,2)<=Math.pow(a,2)},vS=function t(t,e){if(e.length!==4)return console.error("qti-inside rect requires left,top,right,bottom"),null;var n=T(e,4),i=n[0],o=n[1],a=n[2],s=n[3],l=Math.min(i,a),u=Math.max(i,a),c=Math.min(o,s),d=Math.max(o,s);return t.x>=l&&t.x<=u&&t.y>=c&&t.y<=d},vA=function t(t,e){if(e.length!==4)return console.error("qti-inside ellipse requires centerX,centerY,radiusX,radiusY"),null;var n=T(e,4),i=n[0],o=n[1],a=n[2],s=n[3];return a===0||s===0?!1:Math.pow(t.x-i,2)/Math.pow(a,2)+Math.pow(t.y-o,2)/Math.pow(s,2)<=1},vR=function t(t,e){if(e.length<6||e.length%2!==0)return console.error("qti-inside polygon requires at least 3 coordinate pairs"),null;var n=!1;for(var i=0,o=e.length-2;i<e.length;i+=2){var a=e[i],s=e[i+1],l=e[o],u=e[o+1];s>t.y!=u>t.y&&t.x<(l-a)*(t.y-s)/(u-s||Number.EPSILON)+a&&(n=!n),o=i}return n},rj([o({type:String})],vI.prototype,"shape",2),rj([o({type:String})],vI.prototype,"coords",2);customElements.define("qti-inside",vI);var vT,vM,vP=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,vT);return t}d(e,[{key:"getResult",value:function t(){var t=rQ(this,vT,vM).call(this,this.getVariables());return t.length!==2?(console.error("qti-integer-divide requires exactly 2 integer values"),null):t[1]===0?(console.error("qti-integer-divide: division by zero"),null):Math.floor(t[0]/t[1])}}]);return e}(ac);vT=new WeakSet,vM=function t(t){var e=[];var n=true,i=false,o=undefined;try{for(var a=t[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;if(l.baseType!=="integer")return console.error("qti-integer-divide requires integer base-type"),[];if(l.cardinality!=="single"||Array.isArray(l.value))return console.error("qti-integer-divide requires single cardinality"),[];if(l.value===null||l.value===void 0)return[];var u=Number.parseInt(l.value,10);if(Number.isNaN(u))return console.error("qti-integer-divide requires integer values"),[];e.push(u)}}catch(t){i=true;o=t}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(i){throw o}}}return e};customElements.define("qti-integer-divide",vP);var vO,vN,vU=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,vO);return t}d(e,[{key:"getResult",value:function t(){var t=rQ(this,vO,vN).call(this,this.getVariables());return t.length!==2?(console.error("qti-integer-modulus requires exactly 2 integer values"),null):t[1]===0?(console.error("qti-integer-modulus: division by zero"),null):t[0]%t[1]}}]);return e}(ac);vO=new WeakSet,vN=function t(t){var e=[];var n=true,i=false,o=undefined;try{for(var a=t[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;if(l.baseType!=="integer")return console.error("qti-integer-modulus requires integer base-type"),[];if(l.cardinality!=="single"||Array.isArray(l.value))return console.error("qti-integer-modulus requires single cardinality"),[];if(l.value===null||l.value===void 0)return[];var u=Number.parseInt(l.value,10);if(Number.isNaN(u))return console.error("qti-integer-modulus requires integer values"),[];e.push(u)}}catch(t){i=true;o=t}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(i){throw o}}}return e};customElements.define("qti-integer-modulus",vU);var vL=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"getResult",value:function t(){var t=this.getVariables();if(t.length!==1)return console.error("qti-integer-to-float requires exactly one child expression"),null;var e=t[0];if(e.baseType!=="integer")return console.error("qti-integer-to-float requires integer base-type"),null;if(e.cardinality!=="single"||Array.isArray(e.value))return console.error("qti-integer-to-float requires single cardinality"),null;if(e.value===null||e.value===void 0)return null;var n=Number.parseInt(e.value,10);return Number.isNaN(n)?(console.error("qti-integer-to-float requires an integer value"),null):n}}]);return e}(ac);customElements.define("qti-integer-to-float",vL);var vD,vV,v$,vW,vj=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,vD);return t}d(e,[{key:"getResult",value:function t(){var t=this;var e=rQ(this,vD,vV).call(this,this.getVariables());return e.length===0?(console.error("qti-lcm requires at least one integer value"),null):e.reduce(function(e,n){return rQ(t,vD,vW).call(t,e,n)})}}]);return e}(ac);vD=new WeakSet,vV=function t(t){var e=[];var n=true,i=false,o=undefined;try{for(var a=t[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;if(l.baseType!=="integer")return console.error("qti-lcm requires integer base-type"),[];if(l.value===null||l.value===void 0)return[];if(l.cardinality==="single"){if(Array.isArray(l.value))return console.error("qti-lcm unexpected array value for single cardinality"),[];var u=Number.parseInt(l.value,10);if(Number.isNaN(u))return console.error("qti-lcm requires integer values"),[];e.push(u);continue}if(l.cardinality!=="multiple"&&l.cardinality!=="ordered")return console.error("qti-lcm unsupported cardinality"),[];if(!Array.isArray(l.value))return console.error("qti-lcm expected array value for container cardinality"),[];var c=true,d=false,h=undefined;try{for(var f=l.value[Symbol.iterator](),p;!(c=(p=f.next()).done);c=true){var v=p.value;var m=Number.parseInt(v,10);if(Number.isNaN(m))return console.error("qti-lcm requires integer values"),[];e.push(m)}}catch(t){d=true;h=t}finally{try{if(!c&&f.return!=null){f.return()}}finally{if(d){throw h}}}}}catch(t){i=true;o=t}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(i){throw o}}}return e},v$=function t(t,e){var n=Math.abs(t),i=Math.abs(e);for(;i!==0;){var o=n%i;n=i,i=o}return n},vW=function t(t,e){return t===0||e===0?0:Math.abs(t*e/rQ(this,vD,v$).call(this,t,e))};customElements.define("qti-lcm",vj);var vF=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"getResult",value:function t(){return null}}]);return e}(ac);customElements.define("qti-null",vF);var vz=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(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}(ac);customElements.define("qti-is-null",vz);var vB=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"getResult",value:function t(){var t=this.getAttribute("field-identifier");if(!t)throw new Error("field-identifier attribute is required");if(Array.from(this.children).length!==1)throw new Error("qti-field-value must have exactly one child expression");var e=this.getVariables()[0];if(e.baseType!=="record"||e.value===null)throw new Error("qti-field-value child expression must return a record");var n=e.value[t];if(n===void 0)throw new Error('Field "'.concat(t,'" not found in record'));return n}}]);return e}(ac);customElements.define("qti-field-value",vB);var vH=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(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}(ac);customElements.define("qti-lt",vH);var vQ=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(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}(ad);customElements.define("qti-lte",vQ);var vX=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(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,i=Array.isArray(e.value)?e.value:[e.value],o=0;var a=true,s=false,l=undefined;try{var u=function(){var t=d.value;var i=n.mapEntries.filter(function(n){return e.baseType==="string"&&!n.caseSensitive?ay.compareSingleValues(n.mapKey.toLowerCase(),t.toLowerCase(),e.baseType):ay.compareSingleValues(n.mapKey,t,e.baseType)}),a=i.reduce(function(t,e){return t.mappedValue>e.mappedValue?t:e},i.length>0?i[0]:{mapKey:null,mappedValue:null});a===null||a.mappedValue==null?o+=n.defaultValue:o+=a.mappedValue};for(var c=i[Symbol.iterator](),d;!(a=(d=c.next()).done);a=true)u()}catch(t){s=true;l=t}finally{try{if(!a&&c.return!=null){c.return()}}finally{if(s){throw l}}}return(n===null||n===void 0?void 0:n.lowerBound)!==null&&(n===null||n===void 0?void 0:n.lowerBound)!==void 0&&(o=Math.max(n.lowerBound,o)),(n===null||n===void 0?void 0:n.upperBound)!==null&&(n===null||n===void 0?void 0:n.upperBound)!==void 0&&(o=Math.min(n.upperBound,o)),o}}]);return e}(ac);rj([o({type:String})],vX.prototype,"identifier",2);customElements.define("qti-map-response",vX);var vG=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(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 i=Array.isArray(e.value)?e.value:[e.value];if(!i||i.length===0)return console.warn("No candidate responses for response ".concat(this.identifier)),null;var o=0,a=new Set;var s=true,l=false,u=undefined,c=true,d=false,h=undefined;try{for(var f=i[Symbol.iterator](),p;!(c=(p=f.next()).done);c=true){var v=p.value;try{for(var m=n.areaMapEntries[Symbol.iterator](),g;!(s=(g=m.next()).done);s=true){var y=g.value;var b;if(a.has(y.coords))continue;ay.isPointInArea(v,"".concat(y.shape,",").concat(y.coords),e.baseType)&&(o+=(b=y.mappedValue)!==null&&b!==void 0?b:0,a.add(y.coords))}}catch(t){l=true;u=t}finally{try{if(!s&&m.return!=null){m.return()}}finally{if(l){throw u}}}}}catch(t){d=true;h=t}finally{try{if(!c&&f.return!=null){f.return()}}finally{if(d){throw h}}}return a.size<i.length&&(o+=n.defaultValue),n.lowerBound!=null&&(o=Math.max(n.lowerBound,o)),n.upperBound!=null&&(o=Math.min(n.upperBound,o)),o}}]);return e}(ac);rj([o({type:String})],vG.prototype,"identifier",2);customElements.define("qti-map-response-point",vG);var vJ,vY,vK=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,vJ);t.name="";return t}d(e,[{key:"getResult",value:function t(){if(!this.name)return console.error("qti-math-operator requires a name attribute"),null;var t=this.getVariables();if(!t||t.length===0)return null;var e=[];var n=true,i=false,o=undefined;try{for(var a=t[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;if(l.cardinality!=="single")return console.error("qti-math-operator requires single cardinality"),null;if(Array.isArray(l.value))return console.error("qti-math-operator unexpected array value for single cardinality"),null;if(l.value===null||l.value===void 0)return null;if(l.baseType!=="integer"&&l.baseType!=="float")return console.error("qti-math-operator requires numerical base-type"),null;var u=parseFloat(l.value);if(isNaN(u))return console.error("qti-math-operator non-numerical value"),null;e.push(u)}}catch(t){i=true;o=t}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(i){throw o}}}return rQ(this,vJ,vY).call(this,this.name,e)}}]);return e}(ac);vJ=new WeakSet,vY=function t(t,e){try{switch(t.toLowerCase()){case"sin":return e.length!==1?null:Math.sin(e[0]);case"cos":return e.length!==1?null:Math.cos(e[0]);case"tan":return e.length!==1?null:Math.tan(e[0]);case"asin":return e.length!==1||e[0]<-1||e[0]>1?null:Math.asin(e[0]);case"acos":return e.length!==1||e[0]<-1||e[0]>1?null:Math.acos(e[0]);case"atan":return e.length!==1?null:Math.atan(e[0]);case"sinh":return e.length!==1?null:Math.sinh(e[0]);case"cosh":return e.length!==1?null:Math.cosh(e[0]);case"tanh":return e.length!==1?null:Math.tanh(e[0]);case"log":return e.length!==1||e[0]<=0?null:Math.log(e[0]);case"ln":return e.length!==1||e[0]<=0?null:Math.log(e[0]);case"log10":return e.length!==1||e[0]<=0?null:Math.log10(e[0]);case"exp":return e.length!==1?null:Math.exp(e[0]);case"abs":return e.length!==1?null:Math.abs(e[0]);case"sqrt":return e.length!==1||e[0]<0?null:Math.sqrt(e[0]);case"signum":return e.length!==1?null:Math.sign(e[0]);case"floor":return e.length!==1?null:Math.floor(e[0]);case"ceil":return e.length!==1?null:Math.ceil(e[0]);case"round":return e.length!==1?null:Math.round(e[0]);case"atan2":return e.length!==2?null:Math.atan2(e[0],e[1]);case"pow":{if(e.length!==2)return null;var n=e[0],i=e[1];return n===0&&i<=0||n<0&&!Number.isInteger(i)?null:Math.pow(n,i)}case"log_base":{if(e.length!==2)return null;var o=e[0],a=e[1];return o<=0||a<=0||a===1?null:Math.log(o)/Math.log(a)}case"mod":return e.length!==2||e[1]===0?null:e[0]%e[1];case"max":var s;return e.length<1?null:(s=Math).max.apply(s,N(e));case"min":var l;return e.length<1?null:(l=Math).min.apply(l,N(e));default:return console.error('qti-math-operator: unknown operation "'.concat(t,'"')),null}}catch(e){return console.error('qti-math-operator: error performing operation "'.concat(t,'":'),e),null}},rj([o({type:String})],vK.prototype,"name",2);customElements.define("qti-math-operator",vK);var vZ=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),n=t[0],i=t[1];return e.match(n,i)}return console.error("unexpected number of children in match"),null}}],[{key:"match",value:function t(t,e){if(t.value===null)return!1;switch(e.cardinality){case"single":var n;return Array.isArray(t.value)||Array.isArray(e.value)?(console.error("unexpected cardinality in qti match"),!1):ay.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 i=0;i<t.value.length;i++)if(!ay.compareSingleValues(e.value[i],t.value[i],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 o=0;var a=true,s=false,l=undefined;try{for(var u=e.value[Symbol.iterator](),c;!(a=(c=u.next()).done);a=true){var d=c.value;var h=null,f=N(t.value);var p=true,v=false,m=undefined;try{for(var g=f[Symbol.iterator](),y;!(p=(y=g.next()).done);p=true){var b=y.value;if(ay.compareSingleValues(d,b,e.baseType)){h=b;break}}}catch(t){v=true;m=t}finally{try{if(!p&&g.return!=null){g.return()}}finally{if(v){throw m}}}if(h!==null)f.splice(f.indexOf(h),1);else return!1;o++}}catch(t){s=true;l=t}finally{try{if(!a&&u.return!=null){u.return()}}finally{if(s){throw l}}}return!0}default:return console.error("unexpected cardinality in qti match"),!1}}}]);return e}(ac);customElements.define("qti-match",vZ);var v0,v1,v2=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,v0);return t}d(e,[{key:"getResult",value:function t(){var t;var e=rQ(this,v0,v1).call(this,this.getVariables());return e.length===0?(console.warn("qti-max: no numeric values provided"),null):(t=Math).max.apply(t,N(e))}}]);return e}(ac);v0=new WeakSet,v1=function t(t){var e=[];var n=true,i=false,o=undefined;try{var a=function(){var t=l.value;if(!t)return"continue";var n=function t(t){if(t==null)return;var n=parseFloat(t.toString());if(Number.isNaN(n)){console.warn("qti-max: non-numeric value encountered");return}e.push(n)};if(Array.isArray(t.value)){t.value.forEach(function(t){return n(t)});return"continue"}n(t.value)};for(var s=t[Symbol.iterator](),l;!(n=(l=s.next()).done);n=true)a()}catch(t){i=true;o=t}finally{try{if(!n&&s.return!=null){s.return()}}finally{if(i){throw o}}}return e};customElements.define("qti-max",v2);var v3=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(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=T(t,2),n=e[0],i=e[1];if(n.baseType===i.baseType||n.baseType==="integer"&&i.baseType==="float"||n.baseType==="float"&&i.baseType==="integer"||console.warn("Which must both have the same base-type"),i.cardinality==="multiple"||i.cardinality==="ordered"||console.warn("and the second must be a multiple or ordered container"),(n.baseType==="float"||i.baseType==="float")&&console.warn("The member operator should not be used on sub-expressions with a base-type of float"),(n.baseType==="duration"||i.baseType==="duration")&&console.warn("It must not be used on sub-expressions with a base-type of duration"),n.value===null||i.value===null)return null;var o=n.value;return i.value.includes(o)}}]);return e}(ac);customElements.define("qti-member",v3);var v5,v4,v6=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,v5);return t}d(e,[{key:"getResult",value:function t(){var t;var e=rQ(this,v5,v4).call(this,this.getVariables());return e.length===0?(console.warn("qti-min: no numeric values provided"),null):(t=Math).min.apply(t,N(e))}}]);return e}(ac);v5=new WeakSet,v4=function t(t){var e=[];var n=true,i=false,o=undefined;try{var a=function(){var t=l.value;if(!t)return"continue";var n=function t(t){if(t==null)return;var n=parseFloat(t.toString());if(Number.isNaN(n)){console.warn("qti-min: non-numeric value encountered");return}e.push(n)};if(Array.isArray(t.value)){t.value.forEach(function(t){return n(t)});return"continue"}n(t.value)};for(var s=t[Symbol.iterator](),l;!(n=(l=s.next()).done);n=true)a()}catch(t){i=true;o=t}finally{try{if(!n&&s.return!=null){s.return()}}finally{if(i){throw o}}}return e};customElements.define("qti-min",v6);var v8=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"getResult",value:function t(){console.debug("qti-multiple getResult called",this.innerHTML);var t=this.getVariables();if(t.length===0)return console.error("unexpected number of children in qti multiple"),null;var e=true,n=false,i=undefined;try{for(var o=t[Symbol.iterator](),a;!(e=(a=o.next()).done);e=true){var s=a.value;if(s.cardinality!=="multiple"&&s.cardinality!=="single")return console.error("unexpected cardinality in qti multiple"),[]}}catch(t){n=true;i=t}finally{try{if(!e&&o.return!=null){o.return()}}finally{if(n){throw i}}}return t}}]);return e}(ac);customElements.define("qti-multiple",v8);var v7=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){return ol(nW(),f(p(e.prototype),"render",this).call(this))}},{key:"getResult",value:function t(){return!this.firstElementChild.calculate()}}]);return e}(ac);customElements.define("qti-not",v7);var v9=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(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(),i=!1;if(typeof n=="string")if(n==="true")i=!0;else if(n==="false")i=!1;else return console.error("unexpected val in qti-or, expected boolean"),null;else typeof n=="boolean"&&(i=n);return i}).some(function(t){return typeof t=="boolean"&&t})}}]);return e}(ad);customElements.define("qti-or",v9);var mt=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(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,i=undefined;try{for(var o=t[Symbol.iterator](),a;!(e=(a=o.next()).done);e=true){var s=a.value;if(s.cardinality!=="ordered"&&s.cardinality!=="single")return console.error("unexpected cardinality in qti ordered"),[]}}catch(t){n=true;i=t}finally{try{if(!e&&o.return!=null){o.return()}}finally{if(n){throw i}}}return t}}]);return e}(ac);customElements.define("qti-ordered",mt);var me=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"getResult",value:function t(){if(this.children.length!==2)return console.error("qti-power must have exactly two child expressions"),null;var t=this.getVariables();if(!t||t.length!==2)return null;var e=T(t,2),n=e[0],i=e[1];if(n.cardinality!=="single"||i.cardinality!=="single")return console.error("qti-power requires single cardinality for both expressions"),null;if(Array.isArray(n.value)||Array.isArray(i.value))return console.error("qti-power unexpected array value for single cardinality"),null;if(n.value===null||n.value===void 0||i.value===null||i.value===void 0)return null;if(n.baseType!=="integer"&&n.baseType!=="float"||i.baseType!=="integer"&&i.baseType!=="float")return console.error("qti-power requires numerical base-types"),null;var o=parseFloat(n.value),a=parseFloat(i.value);if(isNaN(o)||isNaN(a))return console.error("qti-power: non-numerical values encountered"),null;if(o===0&&a<=0||o<0&&!Number.isInteger(a))return null;var s;try{s=Math.pow(o,a)}catch(t){return console.error("qti-power: error calculating power:",t),null}if(isNaN(s))return null;if(s===1/0||s===-1/0)return s;if(!isFinite(s)||Math.abs(s)>Number.MAX_VALUE||s!==0&&Math.abs(s)<Number.MIN_VALUE)return null;if(isFinite(s)&&s!==0){var l=Math.floor(Math.log10(Math.abs(s))),u=Math.max(0,14-l),c=Math.pow(10,u);s=Math.round(s*c)/c}return s}}]);return e}(ac);customElements.define("qti-power",me);var mn=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.pattern="";return t}d(e,[{key:"getResult",value:function t(){var t=this.getVariables();if(t.length!==1)return console.error("qti-pattern-match requires exactly one child expression"),null;if(!this.pattern)return console.error("qti-pattern-match requires a pattern attribute"),null;var e=t[0];if(e.cardinality!=="single"||Array.isArray(e.value))return console.error("qti-pattern-match requires single cardinality"),null;if(e.value===null||e.value===void 0)return null;try{return new RegExp(this.pattern).test(e.value.toString())}catch(t){return console.error("qti-pattern-match requires a valid regular expression",t),null}}}]);return e}(ac);rj([o({type:String})],mn.prototype,"pattern",2);customElements.define("qti-pattern-match",mn);var mr=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"render",value:function t(){var t=this;var e,n;var i=(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 i===null?oh:ol(nj(),JSON.stringify(i,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}(oR);rj([o({type:String})],mr.prototype,"identifier",2),rj([e({context:oV,subscribe:!0}),u()],mr.prototype,"context",2);customElements.define("qti-printed-variable",mr);var mi=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"getResult",value:function t(){return this.getVariables().reduce(function(t,e){if(e.baseType=="float"||e.baseType=="integer")try{return t*parseFloat(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}(ac);customElements.define("qti-product",mi);var mo,ma,ms,ml=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,mo);t.numberRepeats="";return t}d(e,[{key:"getResult",value:function t(){var t=rQ(this,mo,ma).call(this);if(t<=0)return[];var e=this.firstElementChild;if(!e)return console.warn("qti-repeat: missing child expression"),[];var n=[];for(var i=0;i<t;i++){var o=e.calculate(),a=rQ(this,mo,ms).call(this,o);a&&n.push(a)}return n}}]);return e}(ac);mo=new WeakSet,ma=function t(){var t;var e,n;if(!this.numberRepeats)return console.warn("qti-repeat: missing number-repeats attribute"),0;var i=parseInt(this.numberRepeats,10);if(!Number.isNaN(i))return i;var o=this.numberRepeats,a=(n=this.context)===null||n===void 0?void 0:(e=n.variables)===null||e===void 0?void 0:e.find(function(t){return t.identifier===o});if(!a)return console.warn('qti-repeat: unknown identifier "'.concat(o,'"')),0;var s=Array.isArray(a.value)?a.value[0]:a.value,l=parseInt((t=s===null||s===void 0?void 0:s.toString())!==null&&t!==void 0?t:"",10);return Number.isNaN(l)?(console.warn('qti-repeat: invalid repeat count from "'.concat(o,'"')),0):l},ms=function t(t){if(t==null)return null;if(typeof t=="number")return{identifier:"",cardinality:"single",baseType:Number.isInteger(t)?"integer":"float",value:t.toString(),type:"response"};if(typeof t=="string"){var e=parseFloat(t);if(!Number.isNaN(e))return{identifier:"",cardinality:"single",baseType:Number.isInteger(e)?"integer":"float",value:t.toString(),type:"response"}}if(t&&(typeof t==="undefined"?"undefined":U(t))=="object"&&"value"in t){var n;var i=t.value;return{identifier:"",cardinality:"single",baseType:(n=t.baseType)!==null&&n!==void 0?n:"string",value:i!=null?i.toString():null,type:"response"}}return{identifier:"",cardinality:"single",baseType:"string",value:t.toString(),type:"response"}},rj([o({type:String,attribute:"number-repeats"})],ml.prototype,"numberRepeats",2);customElements.define("qti-repeat",ml);var mu,mc,md,mh=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,mu);return t}d(e,[{key:"process",value:function t(){var t=this.getAttribute("identifier");if(!t){console.warn('QtiSetCorrectResponse: Missing "identifier" attribute.');return}var e=this.firstElementChild;if(!e){console.warn("QtiSetCorrectResponse: No expression found.");return}var n=new mv(e).process();this.dispatchEvent(new CustomEvent("qti-set-correct-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:t,value:rQ(this,mu,mc).call(this,n)}}))}}]);return e}(pH);mu=new WeakSet,mc=function t(t){var e=this;return t==null?null:Array.isArray(t)?t.map(function(t){return af(rQ(e,mu,md).call(e,t))}):af(rQ(this,mu,md).call(this,t))},md=function t(t){var e;if(t&&(typeof t==="undefined"?"undefined":U(t))=="object"&&"value"in t){var n=t.value;return n!=null?n.toString():""}return(e=t===null||t===void 0?void 0:t.toString())!==null&&e!==void 0?e:""};var mf,mp,mv=/*#__PURE__*/function(){"use strict";function t(e){l(this,t);this.expression=e;rB(this,mf)}d(t,[{key:"process",value:function t(){var t=this;var e;var n=(e=this.expression.calculate())!==null&&e!==void 0?e:null;return n===null&&console.warn("QtiSetCorrectResponseRule: Evaluated value is null."),Array.isArray(n)?n.map(function(e){return rQ(t,mf,mp).call(t,e)}):rQ(this,mf,mp).call(this,n)}}]);return t}();mf=new WeakSet,mp=function t(t){return t&&(typeof t==="undefined"?"undefined":U(t))=="object"&&"value"in t?t.value:t};customElements.define("qti-set-correct-response",mh);var mm,mg,my,mb=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,mm);return t}d(e,[{key:"process",value:function t(){var t=this.getAttribute("identifier");if(!t){console.warn('QtiSetTemplateValue: Missing "identifier" attribute.');return}var e=this.firstElementChild;if(!e){console.warn("QtiSetTemplateValue: No expression found.");return}var n=new mk(e).process();this.dispatchEvent(new CustomEvent("qti-set-template-value",{bubbles:!0,composed:!0,detail:{templateIdentifier:t,value:rQ(this,mm,mg).call(this,n)}}))}}]);return e}(pH);mm=new WeakSet,mg=function t(t){var e=this;return t==null?null:Array.isArray(t)?t.map(function(t){return af(rQ(e,mm,my).call(e,t))}):af(rQ(this,mm,my).call(this,t))},my=function t(t){var e;if(t&&(typeof t==="undefined"?"undefined":U(t))=="object"&&"value"in t){var n=t.value;return n!=null?n.toString():""}return(e=t===null||t===void 0?void 0:t.toString())!==null&&e!==void 0?e:""};var mw,mq,mk=/*#__PURE__*/function(){"use strict";function t(e){l(this,t);this.expression=e;rB(this,mw)}d(t,[{key:"process",value:function t(){var t=this;var e;var n=(e=this.expression.calculate())!==null&&e!==void 0?e:null;return n===null&&console.warn("QtiSetTemplateValueRule: Evaluated value is null."),Array.isArray(n)?n.map(function(e){return rQ(t,mw,mq).call(t,e)}):rQ(this,mw,mq).call(this,n)}}]);return t}();mw=new WeakSet,mq=function t(t){return t&&(typeof t==="undefined"?"undefined":U(t))=="object"&&"value"in t?t.value:t};customElements.define("qti-set-template-value",mb);var mx,m_,mE,mC=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,mx);t.name="";return t}d(e,[{key:"getResult",value:function t(){if(!this.name)return console.warn("qti-stats-operator: missing name attribute"),null;var t=rQ(this,mx,mE).call(this,this.getVariables());if(t.length===0)return console.warn("qti-stats-operator: no numeric values provided"),null;switch(this.name.toLowerCase()){case"mean":return t.reduce(function(t,e){return t+e},0)/t.length;case"popsd":return rQ(this,mx,m_).call(this,t);default:return console.warn('qti-stats-operator: unsupported operator "'.concat(this.name,'"')),null}}}]);return e}(ac);mx=new WeakSet,m_=function t(t){var e=t.reduce(function(t,e){return t+e},0)/t.length,n=t.reduce(function(t,n){return t+Math.pow(n-e,2)},0)/t.length;return Math.sqrt(n)},mE=function t(t){var e=[];var n=true,i=false,o=undefined;try{var a=function(){var t=l.value;if(!t)return"continue";var n=function t(t){if(t==null)return;var n=parseFloat(t.toString());if(Number.isNaN(n)){console.warn("qti-stats-operator: non-numeric value encountered");return}e.push(n)};if(Array.isArray(t.value)){t.value.forEach(function(t){return n(t)});return"continue"}n(t.value)};for(var s=t[Symbol.iterator](),l;!(n=(l=s.next()).done);n=true)a()}catch(t){i=true;o=t}finally{try{if(!n&&s.return!=null){s.return()}}finally{if(i){throw o}}}return e},rj([o({type:String})],mC.prototype,"name",2);customElements.define("qti-stats-operator",mC);var mS=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"getResult",value:function t(){return this.calculateChildren(Array.from(this.children))}}]);return e}(rq(ac));customElements.define("qti-subtract",mS);var mA=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.caseSensitive="true";return t}d(e,[{key:"getResult",value:function t(){var t=this.getVariables();if(t.length!==2)return console.error("qti-substring requires exactly 2 child expressions"),null;var e=T(t,2),n=e[0],i=e[1];if(n.cardinality!=="single"||i.cardinality!=="single"||Array.isArray(n.value)||Array.isArray(i.value))return console.error("qti-substring requires single cardinality"),null;if(n.value===null||i.value===null||n.value===void 0||i.value===void 0)return null;var o=n.value.toString(),a=i.value.toString();return this.caseSensitive!=="true"?a.toLowerCase().includes(o.toLowerCase()):a.includes(o)}}]);return e}(ac);rj([o({type:String,attribute:"case-sensitive"})],mA.prototype,"caseSensitive",2);customElements.define("qti-substring",mA);var mR=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.caseSensitive="true";return t}d(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 i=this.caseSensitive==="true"?e.value:e.value.toLowerCase(),o=this.caseSensitive==="true"?n.value:n.value.toLowerCase();return ay.compareSingleValues(i,o,e.baseType)}return console.error("unexpected number of children in qti-string-match"),null}}]);return e}(ac);rj([o({type:String,attribute:"case-sensitive"})],mR.prototype,"caseSensitive",2);customElements.define("qti-string-match",mR);var mI=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"getResult",value:function t(){return new mT(Array.from(this.children)).calculate()}}]);return e}(ac),mT=/*#__PURE__*/function(){"use strict";function t(e){l(this,t);this.expressions=e}d(t,[{key:"calculate",value:function t(){return this.expressions.filter(function(t){return t.calculate!==void 0}).some(function(t){return t.calculate()===null})?null:this.expressions.map(function(t){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",mI);var mM=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(e,[{key:"getResult",value:function t(){var t=this.getVariables();if(t.length!==1)return console.error("qti-truncate requires exactly one child expression"),null;var e=t[0];if(e.cardinality!=="single"||Array.isArray(e.value))return console.error("qti-truncate requires single cardinality"),null;if(e.baseType!=="integer"&&e.baseType!=="float")return console.error("qti-truncate requires numerical base-type"),null;if(e.value===null||e.value===void 0)return null;var n=Number.parseFloat(e.value);return Number.isNaN(n)?(console.error("qti-truncate requires a numerical value"),null):Math.trunc(n)}}]);return e}(ac);customElements.define("qti-truncate",mM);var mP=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(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}(ac);customElements.define("qti-variable",mP);var mO=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);t.min=0;t.max=10;t.step=1;return t}d(e,[{key:"getResult",value:function t(){if(this.min>this.max)return console.error("qti-random-integer: min cannot be greater than max"),this.min;if(this.step<=0)return console.error("qti-random-integer: step must be positive"),this.min;var t=[],e=0;for(;;){var n=this.min+this.step*e;if(n>this.max)break;Number.isInteger(n)&&t.push(n),e++}if(t.length===0)return console.warn("qti-random-integer: no valid integer values in range"),Number.isInteger(this.min)?this.min:Math.floor(this.min);var i=Math.floor(Math.random()*t.length);return t[i]}},{key:"getPossibleValues",value:function t(){var t=[];if(this.min>this.max||this.step<=0)return[Number.isInteger(this.min)?this.min:Math.floor(this.min)];var e=0;for(;;){var n=this.min+this.step*e;if(n>this.max)break;Number.isInteger(n)&&t.push(n),e++}return t.length>0?t:[Number.isInteger(this.min)?this.min:Math.floor(this.min)]}}]);return e}(ac);rj([o({type:Number})],mO.prototype,"min",2),rj([o({type:Number})],mO.prototype,"max",2),rj([o({type:Number})],mO.prototype,"step",2);customElements.define("qti-random-integer",mO);var mN=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(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}(ac);customElements.define("qti-random",mN);var mU=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);return s(this,e,arguments)}d(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 null}}]);return e}(ac);customElements.define("qti-delete",mU);var mL,mD,mV=/*#__PURE__*/function(t){"use strict";v(e,t);function e(){l(this,e);var t;t=s(this,e,arguments);rB(t,mL);return t}d(e,[{key:"getResult",value:function t(){if(!this.n)return console.error('qti-index: missing required attribute "n"'),null;if(this.children.length!==1)return console.error("qti-index: must have exactly one child container element"),null;var t=this.getVariables()[0];if(!t)return console.error("qti-index: missing container"),null;var e;if(!isNaN(Number(this.n)))e=Number(this.n);else{var n=rQ(this,mL,mD).call(this,this.n);if(n===null)return console.error('qti-index: variable "'.concat(this.n,'" is not a valid number')),null;e=Number(n)}if(e<=0||!Number.isInteger(e))return console.error("qti-index: index must be a positive integer"),null;if(t.cardinality==="ordered"){var i=Array.isArray(t.value)?t.value:[t.value];return t.value===null||e>i.length?null:i[e-1]}else return console.error("qti-index: child must have ordered cardinality"),null}}]);return e}(ac);mL=new WeakSet,mD=function t(t){var e;var n=(e=this.context.variables.find(function(e){return e.identifier===t}))===null||e===void 0?void 0:e.value;return n===null||isNaN(Number(n))?null:Number(n)},rj([o({type:String})],mV.prototype,"n",2),mV=rj([oT("qti-index")],mV);return rW(rG)}();
1
+ function e(e,t){if(t==null||t>e.length)t=e.length;for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function t(e){if(Array.isArray(e))return e}function n(t){if(Array.isArray(t))return e(t)}function r(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function o(e,t,n,r,o,a,s){try{var l=e[a](s);var c=l.value}catch(e){n(e);return}if(l.done){t(c)}else{Promise.resolve(c).then(r,o)}}function a(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var s=e.apply(t,n);function l(e){o(s,r,a,l,c,"next",e)}function c(e){o(s,r,a,l,c,"throw",e)}l(undefined)})}}function s(e,t,n){t=f(t);return S(e,j()?Reflect.construct(t,n||[],f(e).constructor):t.apply(e,n))}function l(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function c(e,t,n){if(j()){c=Reflect.construct}else{c=function e(e,t,n){var r=[null];r.push.apply(r,t);var o=Function.bind.apply(e,r);var a=new o;if(n)T(a,n.prototype);return a}}return c.apply(null,arguments)}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||false;r.configurable=true;if("value"in r)r.writable=true;Object.defineProperty(e,r.key,r)}}function d(e,t,n){if(t)u(e.prototype,t);if(n)u(e,n);return e}function h(e,t,n){if(t in e){Object.defineProperty(e,t,{value:n,enumerable:true,configurable:true,writable:true})}else{e[t]=n}return e}function p(e,t,n){if(typeof Reflect!=="undefined"&&Reflect.get){p=Reflect.get}else{p=function e(e,t,n){var r=P(e,t);if(!r)return;var o=Object.getOwnPropertyDescriptor(r,t);if(o.get){return o.get.call(n||e)}return o.value}}return p(e,t,n||e)}function f(e){f=Object.setPrototypeOf?Object.getPrototypeOf:function e(e){return e.__proto__||Object.getPrototypeOf(e)};return f(e)}function v(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function")}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:true,configurable:true}});if(t)T(e,t)}function g(e,t){if(t!=null&&typeof Symbol!=="undefined"&&t[Symbol.hasInstance]){return!!t[Symbol.hasInstance](e)}else{return e instanceof t}}function m(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function b(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function y(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var o=true;var a=false;var s,l;try{for(n=n.call(e);!(o=(s=n.next()).done);o=true){r.push(s.value);if(t&&r.length===t)break}}catch(e){a=true;l=e}finally{try{if(!o&&n["return"]!=null)n["return"]()}finally{if(a)throw l}}return r}function w(){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 q(){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(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};var r=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))}r.forEach(function(t){h(e,t,n[t])})}return e}function x(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);if(t){r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}n.push.apply(n,r)}return n}function _(e,t){t=t!=null?t:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(t))}else{x(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function E(e,t){if(e==null)return{};var n={},r,o,a;if(typeof Reflect!=="undefined"&&Reflect.ownKeys){r=Reflect.ownKeys(e);for(a=0;a<r.length;a++){o=r[a];if(t.indexOf(o)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,o))continue;n[o]=e[o]}return n}n=C(e,t);if(Object.getOwnPropertySymbols){r=Object.getOwnPropertySymbols(e);for(a=0;a<r.length;a++){o=r[a];if(t.indexOf(o)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,o))continue;n[o]=e[o]}}return n}function C(e,t){if(e==null)return{};var n={},r=Object.getOwnPropertyNames(e),o,a;for(a=0;a<r.length;a++){o=r[a];if(t.indexOf(o)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,o))continue;n[o]=e[o]}return n}function S(e,t){if(t&&(D(t)==="object"||typeof t==="function")){return t}return r(e)}function R(e,t,n,r){if(typeof Reflect!=="undefined"&&Reflect.set){R=Reflect.set}else{R=function e(e,t,n,r){var o=P(e,t);var a;if(o){a=Object.getOwnPropertyDescriptor(o,t);if(a.set){a.set.call(r,n);return true}else if(!a.writable){return false}}a=Object.getOwnPropertyDescriptor(r,t);if(a){if(!a.writable){return false}a.value=n;Object.defineProperty(r,t,a)}else{h(r,t,n)}return true}}return R(e,t,n,r)}function A(e,t,n,r,o){var a=R(e,t,n,r||e);if(!a&&o){throw new Error("failed to set property")}return n}function T(e,t){T=Object.setPrototypeOf||function e(e,t){e.__proto__=t;return e};return T(e,t)}function I(e,n){return t(e)||y(e,n)||L(e,n)||w()}function P(e,t){while(!Object.prototype.hasOwnProperty.call(e,t)){e=f(e);if(e===null)break}return e}function O(e,t){if(!t){t=e.slice(0)}return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function M(e){return t(e)||b(e)||L(e)||w()}function N(e){return n(e)||b(e)||L(e)||q()}function D(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function L(t,n){if(!t)return;if(typeof t==="string")return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.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 e(t,n)}function U(e){var t=typeof Map==="function"?new Map:undefined;U=function e(e){if(e===null||!m(e))return e;if(typeof e!=="function"){throw new TypeError("Super expression must either be null or a function")}if(typeof t!=="undefined"){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return c(e,arguments,f(this).constructor)}n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:false,writable:true,configurable:true}});return T(n,e)};return U(e)}function j(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(j=function(){return!!e})()}function z(e,t){var n,r,o,a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},s=Object.create((typeof Iterator==="function"?Iterator:Object).prototype),l=Object.defineProperty;return l(s,"next",{value:c(0)}),l(s,"throw",{value:c(1)}),l(s,"return",{value:c(2)}),typeof Symbol==="function"&&l(s,Symbol.iterator,{value:function(){return this}}),s;function c(e){return function(t){return u([e,t])}}function u(l){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,l[0]&&(a=0)),a)try{if(n=1,r&&(o=l[0]&2?r["return"]:l[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;if(r=0,o)l=[l[0]&2,o.value];switch(l[0]){case 0:case 1:o=l;break;case 4:a.label++;return{value:l[1],done:false};case 5:a.label++;r=l[1];l=[0];continue;case 7:l=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){a=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){a.label=l[1];break}if(l[0]===6&&a.label<o[1]){a.label=o[1];o=l;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(l);break}if(o[2])a.ops.pop();a.trys.pop();continue}l=t.call(e,a)}catch(e){l=[6,e];r=0}finally{n=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}}function V(){var e=O(["<slot></slot>"]);V=function t(){return e};return e}function W(){var e=O(["\n :host {\n box-sizing: border-box;\n }\n\n *,\n *::before,\n *::after {\n box-sizing: inherit;\n }\n"]);W=function t(){return e};return e}function F(){var e=O(["\n [part~='drop'] {\n /*\n * The one deliberate opt-out from the border-box reset.\n *\n * --qti-dropzone-min-* is the border-box of the largest chip, and what has to hold that chip is\n * this region's *content* area. Under border-box a theme's dashed drop border is subtracted\n * from the chip's own size, the content comes up short, and the drop grows the moment a chip\n * lands in it. Order's drop did exactly that: 64px empty, 66px full, for a 1px border.\n */\n box-sizing: content-box;\n\n /*\n * No padding, and no token for one.\n *\n * A drop reserves --qti-dropzone-min-*, which is the chip's BORDER-box, as this region's CONTENT\n * area — so the chip already fits exactly, with nothing to spare and nothing squeezed. An inset\n * on top would only make the drop bigger than the thing it holds.\n *\n * There was a 1px one, to make the drop read as a frame a hair outside the chip. It never painted:\n * an EMPTY slot has nothing inside the inset to separate from, and a FILLED one hides its edge\n * (DROP-SIZING.md \xa74), so both states spent 2px on an invisible ring. The one drop that genuinely\n * wants breathing room — match's category card — declares padding on its own rule, which a\n * theme reaches with ::part(drop). A token in between bought nothing.\n */\n display: flex;\n flex-wrap: wrap;\n align-items: flex-start;\n justify-content: flex-start;\n /* No gap either: 0 is the flex initial value, so the declaration only existed to host a token.\n A drop that wants space between chips sets gap on its own rule. */\n /* Containing block for anything a theme draws over the drop. Was 'position: relative' in the\n theme's 'drop' mixin, which put a document stylesheet in charge of a shadow node's position. */\n position: relative;\n }\n\n [part~='drop'] > * {\n flex: 0 1 auto;\n align-self: flex-start;\n }\n"]);F=function t(){return e};return e}function B(){var e=O(["\n [part~='message'] {\n display: none;\n }\n"]);B=function t(){return e};return e}function $(){var e=O(["<slot></slot>"]);$=function t(){return e};return e}function H(){var e=O(["<pre>","</pre>\n <slot></slot>"]);H=function t(){return e};return e}function Q(){var e=O(["\n slot {\n display: none;\n }\n "]);Q=function t(){return e};return e}function G(){var e=O(['<slot name="qti-rubric-block"></slot><slot></slot>']);G=function t(){return e};return e}function X(){var e=O([" <slot></slot>"]);X=function t(){return e};return e}function K(){var e=O(["<slot></slot>"]);K=function t(){return e};return e}function Y(){var e=O(["\n :host {\n display: none;\n }\n "]);Y=function t(){return e};return e}function J(){var e=O(["<slot></slot>"]);J=function t(){return e};return e}function Z(){var e=O(["<slot @slotchange=","></slot>"]);Z=function t(){return e};return e}function ee(){var e=O(["<slot></slot>"]);ee=function t(){return e};return e}function et(){var e=O(["\n :host {\n display: none;\n }\n "]);et=function t(){return e};return e}function en(){var e=O(["<slot @slotchange=","></slot>"]);en=function t(){return e};return e}function er(){var e=O([' <slot part="feedback" class="feedback ','"></slot> ']);er=function t(){return e};return e}function ei(){var e=O(["\n :host {\n display: block;\n }\n .on {\n display: block;\n }\n .off {\n display: none;\n }\n "]);ei=function t(){return e};return e}function eo(){var e=O([' <slot part="feedback" class="','"></slot> ']);eo=function t(){return e};return e}function ea(){var e=O(["\n .on {\n display: inline-block;\n }\n .off {\n display: none;\n }\n "]);ea=function t(){return e};return e}function es(){var e=O(["\n :host {\n display: block;\n }\n"]);es=function t(){return e};return e}function el(){var e=O(['<slot part="qti-rubric-blocks" name="qti-rubric-block"></slot><slot></slot>']);el=function t(){return e};return e}function ec(){var e=O(['\n <dialog class="cito-dialog" part="feedback" ?open="','">\n <slot></slot>\n <div style="margin-top: var(--qti-gap); text-align: center;">\n <button class="button close-button" @click="','">Close</button>\n </div>\n </dialog>\n ']);ec=function t(){return e};return e}function eu(){var e=O(["\n .cito-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-box);\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-box);\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 /* Inlined from --qti-disabled-bg / --qti-disabled-color, which this button was the only reader\n of anywhere in the repo. They were named as a global disabled vocabulary but no interaction\n ever used them: the theme's disabled treatment is cursor only (see the note in qti-mixins.css). */\n .button:disabled {\n background-color: transparent;\n color: var(--qti-fg);\n cursor: not-allowed;\n }\n\n .button:focus {\n outline: var(--qti-focus-border-width) solid var(--qti-focus-color);\n }\n "]);eu=function t(){return e};return e}function ed(){var e=O(["",""]);ed=function t(){return e};return e}function eh(){var e=O(["\n :host {\n display: none;\n }\n "]);eh=function t(){return e};return e}function ep(){var e=O(["",""]);ep=function t(){return e};return e}function ef(){var e=O(["\n :host {\n display: none;\n }\n "]);ef=function t(){return e};return e}function ev(){var e=O(["<slot></slot>"]);ev=function t(){return e};return e}function eg(){var e=O(["\n :host {\n display: none;\n }\n "]);eg=function t(){return e};return e}function em(){var e=O(["<slot></slot>"]);em=function t(){return e};return e}function eb(){var e=O(["\n :host {\n display: block;\n }\n "]);eb=function t(){return e};return e}function ey(){var e=O(["<slot></slot>"]);ey=function t(){return e};return e}function ew(){var e=O(["<slot></slot>"]);ew=function t(){return e};return e}function eq(){var e=O(["\n :host {\n display: none;\n }\n "]);eq=function t(){return e};return e}function ek(){var e=O(["<slot></slot>"]);ek=function t(){return e};return e}function ex(){var e=O(["\n :host {\n display: none;\n }\n "]);ex=function t(){return e};return e}function e_(){var e=O([""]);e_=function t(){return e};return e}function eE(){var e=O(["\n :host {\n color: gray;\n }\n "]);eE=function t(){return e};return e}function eC(){var e=O([" <slot></slot>"]);eC=function t(){return e};return e}function eS(){var e=O(["<slot></slot>"]);eS=function t(){return e};return e}function eR(){var e=O(["\n display: inline-flex;\n align-items: center;\n cursor: pointer;\n padding: 0.5rem 1rem;\n border-radius: 0.25rem;\n user-select: none;\n"]);eR=function t(){return e};return e}function eA(){var e=O(["\n background-color: lightgray;\n ",";\n"]);eA=function t(){return e};return e}function eT(){var e=O(["\n cursor: not-allowed;\n opacity: 0.8;\n"]);eT=function t(){return e};return e}function eI(){var e=O(["\n ",";\n border: 1px solid gray;\n"]);eI=function t(){return e};return e}function eP(){var e=O([" <slot></slot> "]);eP=function t(){return e};return e}function eO(){var e=O(["\n :host {\n ",";\n }\n :host([disabled]) {\n ",";\n }\n "]);eO=function t(){return e};return e}function eM(){var e=O(["<span>Loading...</span>"]);eM=function t(){return e};return e}function eN(){var e=O(["\n ","\n <slot></slot>\n ","\n "]);eN=function t(){return e};return e}function eD(){var e=O([""]);eD=function t(){return e};return e}function eL(){var e=O([" <slot></slot> "]);eL=function t(){return e};return e}function eU(){var e=O(["\n :host {\n ",";\n }\n :host([disabled]) {\n ",";\n }\n "]);eU=function t(){return e};return e}function ej(){var e=O([" <slot></slot> "]);ej=function t(){return e};return e}function ez(){var e=O(["\n :host {\n ",";\n }\n :host([disabled]) {\n ",";\n }\n "]);ez=function t(){return e};return e}function eV(){var e=O(["\n :host {\n display: inline-block;\n }\n button {\n cursor: pointer;\n }\n button:disabled {\n opacity: 0.4;\n cursor: default;\n }\n "]);eV=function t(){return e};return e}function eW(){var e=O(["<slot></slot>"]);eW=function t(){return e};return e}function eF(){var e=O(['<slot name="pause">⏸</slot>']);eF=function t(){return e};return e}function eB(){var e=O(['<slot name="play">▶</slot>']);eB=function t(){return e};return e}function e$(){var e=O(['\n <button part="button" @click=',">\n ","\n </button>\n "]);e$=function t(){return e};return e}function eH(){var e=O(['\n <button part="button" ?disabled='," @click=",">\n <slot>⏸</slot>\n </button>\n "]);eH=function t(){return e};return e}function eQ(){var e=O(['\n <button part="button" ?disabled='," @click=",">\n <slot>▶</slot>\n </button>\n "]);eQ=function t(){return e};return e}function eG(){var e=O(['\n <button part="button" ?disabled='," @click=",">\n <slot>■</slot>\n </button>\n "]);eG=function t(){return e};return e}function eX(){var e=O(['\n <button part="button" ?disabled='," @click=",">\n <slot>◀◀</slot>\n </button>\n "]);eX=function t(){return e};return e}function eK(){var e=O(['\n <button part="button" ?disabled='," @click=",">\n <slot>▶▶</slot>\n </button>\n "]);eK=function t(){return e};return e}function eY(){var e=O(["<slot></slot>"]);eY=function t(){return e};return e}function eJ(){var e=O(["<slot></slot>"]);eJ=function t(){return e};return e}function eZ(){var e=O(["\n :host {\n ",";\n }\n :host([disabled]) {\n ",";\n }\n "]);eZ=function t(){return e};return e}function e0(){var e=O([""]);e0=function t(){return e};return e}function e1(){var e=O([" "," "]);e1=function t(){return e};return e}function e3(){var e=O(["<slot></slot>"]);e3=function t(){return e};return e}function e2(){var e=O(["\n :host {\n ",";\n }\n :host([disabled]) {\n ",";\n }\n "]);e2=function t(){return e};return e}function e5(){var e=O([" <small><pre>","</pre></small> "]);e5=function t(){return e};return e}function e4(){var e=O([""]);e4=function t(){return e};return e}function e6(){var e=O(["\n <tr>\n <td>","</td>\n <td>","</td>\n <td>","</td>\n <td>","</td>\n <td>","</td>\n </tr>\n "]);e6=function t(){return e};return e}function e8(){var e=O(["\n <h3>","</h3>\n <table>\n <thead>\n <tr>\n <th>Identifier</th>\n <th>Value</th>\n <th>Cardinality</th>\n <th>Base Type</th>\n <th>Correct Response / Mappings</th>\n </tr>\n </thead>\n <tbody>\n ","\n </tbody>\n </table>\n "]);e8=function t(){return e};return e}function e7(){var e=O(["\n "," ","\n "]);e7=function t(){return e};return e}function e9(){var e=O(["\n table {\n width: 100%;\n border-collapse: collapse;\n margin: 20px 0;\n font-size: 14px;\n text-align: left;\n }\n th,\n td {\n border: 1px solid #ddd;\n padding: 8px;\n }\n th {\n background-color: #f4f4f4;\n font-weight: bold;\n }\n h3 {\n margin-top: 20px;\n font-size: 16px;\n }\n "]);e9=function t(){return e};return e}function te(){var e=O([""]);te=function t(){return e};return e}function tt(){var e=O(["",""]);tt=function t(){return e};return e}function tn(){var e=O([""]);tn=function t(){return e};return e}function tr(){var e=O(["<div>","</div>"]);tr=function t(){return e};return e}function ti(){var e=O(["<div>","</div>"]);ti=function t(){return e};return e}function to(){var e=O([""]);to=function t(){return e};return e}function ta(){var e=O([" "," "]);ta=function t(){return e};return e}function ts(){var e=O([" <slot></slot> "]);ts=function t(){return e};return e}function tl(){var e=O(["\n :host {\n ",";\n }\n :host([disabled]) {\n ",";\n }\n "]);tl=function t(){return e};return e}function tc(){var e=O(["<small><pre>","</pre></small>"]);tc=function t(){return e};return e}function tu(){var e=O([" ","\n ",""]);tu=function t(){return e};return e}function td(){var e=O(['<option value="','" ?selected=',">","</option>"]);td=function t(){return e};return e}function th(){var e=O(['\n <label part="label" for="viewSelect">','</label>\n <select\n part="select"\n id="viewSelect"\n @change=',"\n >\n ","\n </select>\n "]);th=function t(){return e};return e}function tp(){var e=O(["",""]);tp=function t(){return e};return e}function tf(){var e=O(["<span>Loading...</span>"]);tf=function t(){return e};return e}function tv(){var e=O(["\n ","\n <slot></slot>\n ","\n "]);tv=function t(){return e};return e}function tg(){var e=O([""]);tg=function t(){return e};return e}function tm(){var e=O([""]);tm=function t(){return e};return e}function tb(){var e=O(["\n <tr>\n <td>","</td>\n <td>","</td>\n <td>","</td>\n <td>","</td>\n <td>","</td>\n </tr>\n "]);tb=function t(){return e};return e}function ty(){var e=O(["\n <h3>","</h3>\n <table>\n <thead>\n <tr>\n <th>Identifier</th>\n <th>Value</th>\n <th>Cardinality</th>\n <th>Base Type</th>\n <th>Correct Response / Mappings</th>\n </tr>\n </thead>\n <tbody>\n ","\n </tbody>\n </table>\n "]);ty=function t(){return e};return e}function tw(){var e=O(["\n "," ","\n "]);tw=function t(){return e};return e}function tq(){var e=O(["\n table {\n width: 100%;\n border-collapse: collapse;\n margin: 20px 0;\n font-size: 14px;\n text-align: left;\n }\n th,\n td {\n border: 1px solid #ddd;\n padding: 8px;\n }\n th {\n background-color: #f4f4f4;\n font-weight: bold;\n }\n h3 {\n margin-top: 20px;\n font-size: 16px;\n }\n "]);tq=function t(){return e};return e}function tk(){var e=O(["<slot></slot>"]);tk=function t(){return e};return e}function tx(){var e=O(["\n /* A drop target — see qti-gap.styles.ts. The interaction publishes the chip measurements as\n custom properties on its host; the properties themselves live here. */\n :host {\n display: flex;\n align-items: center;\n justify-content: center;\n user-select: none;\n position: absolute;\n min-height: var(--qti-dropzone-min-height, 0);\n min-width: var(--qti-dropzone-min-width, 0);\n }\n\n /* The hotspot's own box comes from its authored coords; the drop region simply fills it. */\n [part~='drop'] {\n width: 100%;\n height: 100%;\n }\n "]);tx=function t(){return e};return e}function t_(){var e=O(['<div part="drop">\n ',"\n </div>"]);t_=function t(){return e};return e}function tE(){var e=O(["\n /*\n * A drop target. The interaction measures its chips and publishes the result as custom\n * properties on its own host; the actual CSS properties live here, not in a style attribute.\n *\n * An authored data-choices-container-width takes the width axis: autoSizeDropzoneWidth goes\n * false and the mixin never publishes --qti-dropzone-min-width at all, so the fallback below\n * applies and the authored inline width is free to win. That works only because the token is\n * never declared globally — min-width beats width, so a declared floor would silently outrank\n * the author. See DROP-SIZING.md \xa72 and tools/stylelint/no-declared-measured-token.js.\n */\n /*\n * A gap sits in a line of prose, so it is inline-flex and rides the text baseline. All four of\n * these were in the theme, set on this host from the document — which also meant the\n * 'display: flex' this file declared never took effect.\n */\n :host {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n vertical-align: middle;\n user-select: none;\n }\n\n /*\n * The chip's box is reserved on the slot, not on the host.\n *\n * --qti-dropzone-min-* is the border-box of the widest and tallest chip, so whatever carries\n * that minimum must have no border or padding of its own — otherwise the theme's dashed gap\n * border eats into the reservation, the gap comes up short, and it grows the instant a chip\n * lands in it. That reflows the sentence and drags the neighbouring gaps sideways while the\n * user is still on their way to one.\n *\n * It cannot live on :host. A theme's universal reset matches the host element from the\n * document, and document rules outrank :host — so the host is border-box no matter what this\n * file says. This div is inside the shadow tree, out of the document's reach, and inherits\n * border-box harmlessly since it has no border or padding of its own.\n */\n [part~='drop'] {\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: var(--qti-dropzone-min-height, 0);\n min-width: var(--qti-dropzone-min-width, 0);\n }\n "]);tE=function t(){return e};return e}function tC(){var e=O(['<div part="drop">\n ',"\n </div>"]);tC=function t(){return e};return e}function tS(){var e=O(["\n /* Centred, because a gap-img is a picture inside a drop the same size as it. Was in the theme's\n graphic-gap-match rules, on the host from the document. */\n :host {\n display: flex;\n align-items: center;\n justify-content: center;\n user-select: none;\n }\n "]);tS=function t(){return e};return e}function tR(){var e=O(["\n /*\n * A chip's own box. Both drag-drop interactions that use this element laid it out from the\n * theme — gap-match with 'display: flex !important; align-items: center !important',\n * graphic-gap-match with the same plus centred justification — and both were overriding the\n * 'inline-flex' this file used to declare. Flex is what actually rendered, so flex is what it\n * says now.\n *\n * Justification is a variable because only graphic-gap-match centres, where a chip is a tile\n * filling its hotspot. A gap-match chip hugs its text, and centring moved that text.\n */\n /*\n * Centred wherever it lives — this is the one-line follow-up the note here used to promise.\n *\n * It read :host(:not([part~='drag'])), which reproduced an older accident: the centring rule\n * used to be a document selector ('qti-gap-match-interaction qti-gap-text'), and a placed chip\n * lives inside qti-gap's shadow root where no document selector reaches. So a chip in the bank was\n * centred and the same chip in a gap was not, and the stylesheet gave no hint why.\n *\n * That contradicts the layout-invariance contract — a chip is the same chip wherever it stands —\n * and it showed: the correction badge centred in the bank and rode to the top once placed. The\n * badge now sets align-self and no longer depends on this, but the label and the drag grip\n * still did. Making it unconditional costs a one-pixel text shift on placed chips, which is the\n * rendering change the old note was deferring, and a VRT re-baseline.\n */\n :host {\n display: flex;\n align-items: center;\n justify-content: var(--qti-drag-justify-content, normal);\n user-select: none;\n }\n "]);tR=function t(){return e};return e}function tA(){var e=O(['<div part="control"></div>\n <slot part="label"></slot>']);tA=function t(){return e};return e}function tT(){var e=O(["\n :host {\n display: flex;\n user-select: none;\n position: absolute;\n }\n\n /*\n * Graphic-order paints an order pin anchored to this hotspot, and the pin sits outside the\n * hotspot's own box. Both of these were in the theme, keyed on the same ARIA attributes the\n * interaction already writes to the host.\n */\n :host([aria-ordervalue]) {\n overflow: visible;\n }\n\n :host([aria-ordercorrectvalue]) {\n display: grid;\n place-content: center;\n }\n "]);tT=function t(){return e};return e}function tI(){var e=O(["\n /* 'position: relative' is the containing block for the answer-key tick the theme draws as an\n absolutely positioned ::before. See CONTRACT.md \xa77. */\n :host {\n display: inline-flex;\n align-items: center;\n position: relative;\n padding: var(--qti-padding-inline, 1px 4px);\n }\n\n /*\n * A hottext never shows the native radio/checkbox box — every theme variant draws selection on\n * the word itself. The control stays in the tree for the accessibility mapping, out of the flow.\n *\n * This was three identical '::part(control) { display: none }' rules in the theme, one per\n * variant, under a fourth that had already hidden it unconditionally.\n */\n [part='control'] {\n display: none;\n }\n "]);tI=function t(){return e};return e}function tP(){var e=O(['<div part="control"><div part="control-mark"></div></div>\n <slot part="label"></slot>']);tP=function t(){return e};return e}function tO(){var e=O(["\n /*\n * An option row: one line, clipped, with its text centred against the row's min-height. All four\n * were in the theme, set on this host from the document — which is also why the 'display: block'\n * this file declared never took effect.\n */\n :host {\n display: inline-flex;\n align-items: center;\n white-space: nowrap;\n overflow: hidden;\n box-sizing: border-box;\n }\n\n slot {\n display: inline;\n }\n"]);tO=function t(){return e};return e}function tM(){var e=O([" <slot></slot> "]);tM=function t(){return e};return e}function tN(){var e=O(["\n :host {\n display: block;\n margin: var(--qti-gap) 0;\n width: 100%;\n }\n "]);tN=function t(){return e};return e}function tD(){var e=O(["<slot></slot>"]);tD=function t(){return e};return e}function tL(){var e=O(["\n /*\n * 'align-items' / 'justify-content' are variables because one caller cannot be reached any other\n * way. In tabular match this element is a light-DOM *grandchild* of the slotted\n * <qti-simple-match-set>, so no selector in the interaction's shadow root reaches it —\n * '::slotted()' takes no descendants — and the element itself cannot tell it is in a tabular\n * match. The theme sets the two properties on the match-set and they inherit down; the box model\n * stays here. Defaults are the flex initial values, so every other caller is unaffected.\n */\n :host {\n display: flex;\n align-items: var(--qti-choice-align-items, normal);\n justify-content: var(--qti-choice-justify-content, normal);\n user-select: none;\n }\n\n /*\n * This element plays two parts. In associate-interaction and in match's first match-set it is a\n * draggable chip; in match's last match-set it is a drop target. In tabular match it is neither —\n * drag-drop is off and it is a row or column header in a grid.\n *\n * So the drop-target rules key on :state(droppable), which the interaction sets on exactly the\n * elements it tracks as droppables. Keying on the *absence* of a chip marker instead\n * (:not(:state(drag))) swept up every tabular header cell and gave each one a 4rem minimum.\n *\n * A state rather than an attribute, and this used to be written both ways. An attribute cannot\n * be used by every host: the editor renders these choices inside a ProseMirror document, whose\n * mutation observer reverts any attribute outside the schema — and the revert re-triggers the\n * observer that wrote it, which hard-freezes the tab. ElementInternals states are invisible to\n * that observer, so the state is the form that works everywhere and the [qti-droppable]\n * attribute that used to accompany it is gone. Positive opt-in, so tabular headers are untouched.\n */\n :host(:state(droppable)) {\n /*\n * The CARD token, not the slot one. This element is a droppable only in match, and match\n * publishes no measurement — so reading --qti-dropzone-min-height here meant reading a name\n * whose whole purpose is to carry a measurement that never arrives, and relying on the 4rem\n * fallback to be the real value. That held only while the slot name stayed undeclared: the\n * moment it was declared at 3rem the fallback became unreachable and every card silently lost\n * 16px, with no rule mentioning cards anywhere in the diff.\n *\n * The width stays on the slot name. It is still 0 when unmeasured — a card is as wide as its\n * grid track gives it, and the track has its own floor (--qti-drop-track-min-width).\n */\n min-height: var(--qti-drop-card-min-height, 4rem);\n min-width: var(--qti-dropzone-min-width, 0);\n\n /*\n * A target is a card: label pinned to the top, drop region filling the rest. Was\n * 'display: flex; flex-direction: column; justify-content: space-between' in the theme's\n * match-interaction rules, on a light-DOM grandchild it reached by descendant selector.\n * A 'grid-row: unset' went with it — the initial value, on an element whose grid placement\n * nothing sets.\n */\n flex-direction: column;\n justify-content: space-between;\n }\n\n :host(:state(droppable)) [part~='drop'] {\n /*\n * Match's dropzones are NOT auto-sized from the chips: a match target is a category, and\n * should look able to hold several answers rather than hugging the widest one. So this reads\n * the card's OWN token rather than the measured one — qti-match-interaction publishes no\n * measurement, and a name that exists to carry one is the wrong place to keep a constant.\n * A theme retunes every card by setting --qti-drop-card-min-height.\n *\n * Deliberately NOT conditional on this target's own match-max. Whether a drop is a category or\n * a slot is a property of the interaction, not of one target: a match-max=\"1\" target is still a\n * category that happens to take one answer, and it sits in a grid beside targets that take\n * several. Sizing each to its own contents would make that grid ragged. qti-match-interaction\n * turns measurement off for the whole interaction for the same reason.\n */\n min-height: var(--qti-drop-card-min-height, 4rem);\n\n /*\n * A card has room in it, so its contents sit inside a margin rather than against the edge, and\n * two answers in the same card do not touch. The one drop in the library that wants either.\n *\n * Declared, not routed through a token. A slot-shaped drop wants neither (dropRegion), and a\n * theme retunes these by reaching the same element with ::part(drop) from the document — so a\n * custom property in between would add a name without adding reach.\n */\n padding: 0.25rem;\n gap: 0.25rem;\n\n /*\n * The one place a drop centres its chips rather than packing them to the start, overriding\n * dropRegion. A match target is a category card with room to spare, so chips sitting in the\n * middle of it reads as deliberate where a lone chip pinned to the top-left reads as broken.\n * Centring positions without resizing — 'align-items: center' suppresses the stretch just as\n * 'flex-start' does — so the chip-is-the-same-chip invariant holds either way.\n */\n justify-content: center;\n align-items: center;\n flex-grow: 1;\n }\n\n /* The label sits against the drop region below it. */\n :host(:state(droppable)) [part~='label'] {\n align-content: flex-end;\n }\n\n /*\n * A chip has no drop region. It renders one anyway — same element, both parts — and an empty\n * region with a minimum height made every placed chip 20px taller than the same chip in the\n * bank. The <slot> this replaced collapsed to nothing by accident; a div has to be told.\n *\n * Two conditions, because a chip identifies itself two ways:\n * :state(drag) a chip in the light-DOM bank, from the interaction's draggablesSelector\n * [part~='drag'] a chip a drop target renders, where that selector cannot reach it — match's\n * selector names a light-DOM ancestry the placed clone no longer has\n */\n :host(:state(drag)) [part~='drop'],\n :host([part~='drag']) [part~='drop'] {\n display: none;\n }\n\n /*\n * The label's box type is a variable for the same reason as the two above: only the interaction\n * knows which arrangement it is running. Non-tabular match wants an inline label so a chip hugs\n * its text; everywhere else the label is a block that fills the choice. The theme spent an\n * 'display: inline !important' on ::part(label) to say so, from the document.\n */\n slot {\n width: 100%;\n display: var(--qti-choice-label-display, block);\n }\n\n slot[name='qti-simple-associable-choice'] {\n width: auto;\n }\n\n /* Author markup inside a chip runs inline — a <p> would otherwise break the chip onto its own\n line. The theme keeps the matching 'margin: 0', which is spacing. */\n ::slotted(p) {\n display: inline;\n }\n "]);tL=function t(){return e};return e}function tU(){var e=O(['\n <div part="control"></div>\n <slot part="label"></slot>\n <div part="drop">\n ',"\n </div>\n "]);tU=function t(){return e};return e}function tj(){var e=O(["\n /*\n * 'position: relative' unconditionally, because this element can carry a correction badge and a\n * badge needs a containing block. The theme draws the badge as an absolutely positioned ::after\n * and used to declare the containing block too — from the document, and only for the\n * .qti-input-control-hidden variant, so the anchor and the thing anchored to it were set in two\n * different stylesheets. See CONTRACT.md \xa77.\n */\n :host {\n display: flex;\n align-items: center;\n position: relative;\n user-select: none;\n }\n /*\n * The label's box type is a variable because only the interaction knows the arrangement.\n * choice-interaction wants an inline label so a choice hugs its text; order-interaction uses\n * this same element as a chip and wants the flex default. The theme said so with an\n * '::part(label) { display: inline !important }'.\n */\n slot {\n width: 100%;\n display: var(--qti-choice-label-display, flex);\n align-items: center;\n }\n /*\n * The variant that hides the native control ('.qti-input-control-hidden') is a presentation\n * class only the interaction sees, on a box only this file can lay out. The theme sets the\n * variable; the property stays here.\n */\n [part='control'] {\n display: var(--qti-control-display, flex);\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n }\n "]);tj=function t(){return e};return e}function tz(){var e=O(['<div id="label" part="marker">',"</div>"]);tz=function t(){return e};return e}function tV(){var e=O(['<div part="control" tabindex="0"><div part="control-mark"></div></div>\n ','\n <slot part="label"></slot>']);tV=function t(){return e};return e}function tW(){var e=O(["\n :host {\n display: block; /* necessary to calculate scaling position */\n }\n /* The bank WRAPS. Without flex-wrap the row is nowrap, and a flex item's default flex-shrink: 1\n then compresses the chips instead of moving them down: a bank of six squeezed the last chip\n until only its grip was left, at no width the author could see coming. A chip is a fixed\n thing, so the only place the overflow can go is the next line. */\n slot[part~='drags'] {\n display: flex;\n flex-wrap: wrap;\n align-items: flex-start;\n flex: 1;\n border: 2px solid transparent;\n margin: 1rem 0;\n border-radius: 0.3rem;\n gap: 0.5rem;\n }\n\n /* Drop target. --qti-dropzone-min-height is published by the interaction from the measured\n chip height; 3rem is the fallback when there is nothing to measure. Was an inline style. */\n [part~='drop'] {\n display: grid;\n min-height: var(--qti-dropzone-min-height, 3rem);\n min-width: var(--qti-dropzone-min-width, 3rem);\n border: 1px solid var(--qti-border-color, #d1d5db);\n border-radius: 0.25rem;\n overflow: hidden;\n }\n\n [part='drops'] {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n }\n\n :host::part(drop-row) {\n display: flex;\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) calc(50%),\n rgb(0 0 0 / 0%) calc(50% + 1px)\n );\n }\n\n /* An answer key shows the answer, not the bank you would have dragged it from. The attribute is\n set on the clone by the correct-response mixin; the theme used to do this with a\n '.full-correct-response' descendant selector, from the document. */\n :host([answer-key]) ::slotted(qti-simple-associable-choice) {\n display: none;\n }\n "]);tW=function t(){return e};return e}function tF(){var e=O(['<div part="drop-row">\n ',"\n ","\n </div>"]);tF=function t(){return e};return e}function tB(){var e=O([' <slot name="prompt"></slot>\n <slot part="drags" name="qti-simple-associable-choice"></slot>\n <div part="drops">\n ','\n\n <div role="alert" part="message" id="validation-message"></div>\n </div>']);tB=function t(){return e};return e}function t$(){var e=O(["<div name=",' part="drop" data-declarative-drops identifier=',">\n ","\n </div>"]);t$=function t(){return e};return e}function tH(){var e=O(["\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\n /* Default slot item layout */\n ::slotted(qti-simple-choice) {\n display: flex;\n align-items: center;\n white-space: normal;\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 "]);tH=function t(){return e};return e}function tQ(){var e=O(['\n <slot part="prompt" name="prompt"></slot>\n <slot part="slot" @slotchange=','></slot>\n <div part="message" role="alert" id="validation-message"></div>\n ']);tQ=function t(){return e};return e}function tG(){var e=O(["\n /* The box this element already had. See the note in qti-match-interaction.styles.ts. */\n :host {\n display: block;\n }\n "]);tG=function t(){return e};return e}function tX(){var e=O(['<div style="color:red">\n <h1>Error</h1>\n ',"\n </div>"]);tX=function t(){return e};return e}function tK(){var e=O(["<iframe\n width=","\n height=",'\n frameborder="0"\n title="pciContainer"\n id="pciContainer"\n >\n </iframe>\n ',""]);tK=function t(){return e};return e}function tY(){var e=O(["<button ?disabled=",' part="button" @click=',">","</button>"]);tY=function t(){return e};return e}function tJ(){var e=O(["\n /* PK: display host as block, else design will be collapsed */\n /* 'position: relative' anchors the correction glyph the theme draws over the textarea. */\n :host {\n display: block;\n position: relative;\n }\n textarea {\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n border: 0;\n }\n "]);tJ=function t(){return e};return e}function tZ(){var e=O(['<slot name="prompt"></slot>']);tZ=function t(){return e};return e}function t0(){var e=O(['<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>"]);t0=function t(){return e};return e}function t1(){var e=O(['<div id="validation-message" part="message" role="alert" style="display:none;"></div>']);t1=function t(){return e};return e}function t3(){var e=O(["",""," ",""]);t3=function t(){return e};return e}function t2(){var e=O(["\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 /* Wraps, for the reason spelled out on associate's identical bank: nowrap does not overflow, it\n shrinks, and a squeezed chip is worse than a second line. */\n [name='drags'] {\n display: flex;\n flex-wrap: wrap;\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 /* An answer key shows the answer, not the bank you would have dragged it from. The attribute is\n set on the clone by the correct-response mixin; the theme used to do this with a\n '.full-correct-response' descendant selector, from the document. */\n :host([answer-key]) [part~='drags'] {\n display: none;\n }\n "]);t2=function t(){return e};return e}function t5(){var e=O(['<slot name="prompt"> </slot>\n <slot part="drags" name="drags"></slot>\n <slot part="drops"></slot>\n <div role="alert" part="message" id="validation-message"></div>']);t5=function t(){return e};return e}function t4(){var e=O(["\n /* Containing block for the absolutely positioned hotspots over the image. Was on this host in\n the theme, together with a 'display: block' this component now owns. */\n :host {\n display: block;\n position: relative;\n }\n\n slot:not([name='prompt']) {\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 "]);t4=function t(){return e};return e}function t6(){var e=O(['\n <line\n part="line"\n x1=',"\n y1=","\n x2=","\n y2=",'\n stroke="red"\n stroke-width="3"\n @click=',"\n />\n "]);t6=function t(){return e};return e}function t8(){var e=O(['<line\n part="point"\n x1=',"\n y1=","\n x2=","\n y2=",'\n stroke="var(--qti-border-active)"\n stroke-width="3"\n />']);t8=function t(){return e};return e}function t7(){var e=O(['<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" part="message" id="validation-message"></div>']);t7=function t(){return e};return e}function t9(){var e=O(["\n :host {\n display: flex;\n align-items: flex-start;\n flex-direction: column;\n flex-wrap: wrap;\n gap: 0.5rem;\n /* Containing block for the absolutely positioned hotspots over the image. Was set on this\n host from the theme. */\n position: relative;\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 "]);t9=function t(){return e};return e}function ne(){var e=O([' <slot name="prompt"></slot>\n <slot part="image"></slot>\n <slot part="drags" name="drags" class="hover-border"></slot>\n <div role="alert" part="message" id="validation-message"></div>']);ne=function t(){return e};return e}function nt(){var e=O(["\n /* The order pins are anchored outside their hotspot's box. */\n :host {\n /* The box this element already had. See the note in qti-match-interaction.styles.ts. */\n display: block;\n overflow: visible;\n }\n\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\n /*\n * The order pin. A light-DOM <span> this interaction appends (see #LOCATOR_CLASS), so it lands\n * in the default slot above and ::slotted() reaches it — its containing block is that slot.\n *\n * Placement only. The pin's face — the teardrop SVG, its fill, the number's colour and size —\n * is paint and stays in the theme, which is also where the --qti-graphic-order-pin-* tokens\n * live. 'position-anchor' is repeated as a declaration because the JS writes the per-hotspot\n * anchor name inline; this is the property's home, the inline style is its value.\n */\n ::slotted(.cito-graphic-order-marker) {\n position: absolute;\n left: anchor(center);\n top: anchor(center);\n transform: translate(-50%, var(--qti-graphic-order-pin-anchor));\n display: flex;\n justify-content: center;\n align-items: flex-start;\n z-index: 3;\n }\n ::slotted(img) {\n /* image not selectable anymore */\n pointer-events: none;\n user-select: none;\n }\n "]);nt=function t(){return e};return e}function nn(){var e=O(['\n <slot name="prompt"></slot>\n <slot></slot>\n <div role="alert" part="message" id="validation-message"></div>\n ']);nn=function t(){return e};return e}function nr(){var e=O(["\n :host {\n display: block;\n }\n /*\n * This slot is the coordinate space the hotspots sit on. Every qti-hotspot-choice is\n * position:absolute and placed with left/top percentages (positionShapes, hotspot.ts), so the\n * slot must be both (a) a positioning context and (b) exactly the box of the image — or those\n * percentages resolve against the wrong rectangle and every hotspot is offset from the picture.\n *\n * position: relative the containing block the percent offsets resolve against. Without it\n * they would position against the nearest positioned ancestor.\n * display: inline-block shrink-wraps the slot to its content instead of a full-width block,\n * width: fit-content and caps that at the width of the image, so the slot never extends\n * past the picture and drags a 100%-wide hotspot out with it.\n *\n * A line-height:0 used to sit here to kill the inline descender gap under an image. The image is\n * display:block below, which has no such gap, so it was redundant and is gone.\n */\n slot:not([name='prompt']) {\n position: relative;\n display: inline-block;\n width: fit-content;\n }\n ::slotted(img) {\n display: block; /* out of the inline flow; also why the slot needs no line-height reset */\n pointer-events: none; /* image not selectable; clicks belong to the hotspots over it */\n user-select: none;\n /*\n * Fluid, and unconditionally, unlike the global reset rule img:not([width]) that leaves an\n * authored-size image fixed. A hotspot image is the coordinate space its hotspots sit on (they\n * are percentages of this box), so it MUST fit the viewport: a fixed-width image on a narrow\n * screen would overflow and carry its hotspots off the visible area.\n *\n * max-width: 100% caps the image at the container. NOT width:100%, which would force the\n * image to fill and upscale a small picture past its natural size into\n * blur; max-width shrinks on narrow and never upscales. (With the\n * fit-content slot above the two render the same today, but max-width says\n * the actual intent.)\n * height: auto lets the height follow the aspect ratio the width and height attributes\n * declare. Without it a height attribute pins the height while the width\n * shrinks, and the image squashes horizontally into an ellipse.\n *\n * The hotspots are percentages of this image, so they scale with it and stay registered; the\n * poly ring masks stretch with their element and keep a uniform stroke.\n */\n max-width: 100%;\n height: auto;\n }\n "]);nr=function t(){return e};return e}function ni(){var e=O(['\n <slot name="prompt"></slot>\n <slot></slot>\n <div part="message" role="alert" id="validation-message"></div>\n ']);ni=function t(){return e};return e}function no(){var e=O(["\n /* The box this element already had. See the note in qti-match-interaction.styles.ts. */\n :host {\n display: block;\n }\n "]);no=function t(){return e};return e}function na(){var e=O(['<slot></slot>\n <div part="message" role="alert" id="validation-message"></div>']);na=function t(){return e};return e}function ns(){var e=O(["\n /* ── Host ──────────────────────────────────────────────────────────────────\n Inline-block so the element flows with surrounding text.\n --qti-inline-choice-width is the single width control surface:\n 0 (default) → trigger sizes to its content\n set by qti-input-width-* classes → trigger has a character-count minimum\n set by autosizing JS (inlineChoiceAutosize) → trigger matches widest option\n */\n :host {\n /*\n * The menu anchors to the HOST, not to the trigger inside it.\n *\n * The host is the box that paints the field border (@mixin field in the theme); the trigger is\n * transparent and border-less and therefore sits one border-width in on every side. Anchoring to\n * the trigger lined the menu up with that inner box, so the open control was 1px narrower than\n * the closed one on each side — measured: host 96.38→465.80, menu 97.38→464.80. Anchoring to the\n * host lines the menu up with the edge you can actually see.\n */\n anchor-name: --qti-inline-choice-anchor;\n\n display: inline-flex;\n align-items: center;\n vertical-align: baseline;\n position: relative;\n --qti-inline-choice-width: 0;\n /*\n * Four component-local tokens used to sit here and all four are gone.\n *\n * Three were pure aliases — --qti-inline-choice-overlay-z-index, -popover-z-index and\n * -motion-duration-fast each held nothing but var() of the global token of the same meaning,\n * were read exactly once, and were reachable from nowhere else. A second name for one value is\n * not an override surface; a theme retunes --qti-overlay-z-index and every reader follows.\n *\n * The fourth, --qti-inline-choice-trigger-gap, was calc(var(--qti-gap) / 2) — the arithmetic\n * the spacing vocabulary explicitly rules out: \"a call site that needs half of a gap is\n * describing a fourth value that does not exist in the vocabulary, and the answer is to pick the\n * nearest of the three, not to do arithmetic\" (qti-variables.css). The nearest is --qti-gap,\n * which is what the trigger spends now.\n */\n }\n\n /* ── QTI mandatory input-width shared vocabulary (15 values) ─────────────── */\n :host(.qti-input-width-1) {\n --qti-inline-choice-width: 1ch;\n }\n :host(.qti-input-width-2) {\n --qti-inline-choice-width: 2ch;\n }\n :host(.qti-input-width-3) {\n --qti-inline-choice-width: 3ch;\n }\n :host(.qti-input-width-4) {\n --qti-inline-choice-width: 4ch;\n }\n :host(.qti-input-width-6) {\n --qti-inline-choice-width: 6ch;\n }\n :host(.qti-input-width-10) {\n --qti-inline-choice-width: 10ch;\n }\n :host(.qti-input-width-15) {\n --qti-inline-choice-width: 15ch;\n }\n :host(.qti-input-width-20) {\n --qti-inline-choice-width: 20ch;\n }\n :host(.qti-input-width-25) {\n --qti-inline-choice-width: 25ch;\n }\n :host(.qti-input-width-30) {\n --qti-inline-choice-width: 30ch;\n }\n :host(.qti-input-width-35) {\n --qti-inline-choice-width: 35ch;\n }\n :host(.qti-input-width-40) {\n --qti-inline-choice-width: 40ch;\n }\n :host(.qti-input-width-45) {\n --qti-inline-choice-width: 45ch;\n }\n :host(.qti-input-width-50) {\n --qti-inline-choice-width: 50ch;\n }\n :host(.qti-input-width-72) {\n --qti-inline-choice-width: 72ch;\n }\n\n /* ── Trigger button — layout only, all paint lives in the theme ───────────── */\n button[part='trigger'] {\n display: inline-grid;\n grid-template-columns: minmax(0, 1fr) auto;\n align-items: center;\n column-gap: var(--qti-glyph-gap);\n box-sizing: border-box;\n min-width: var(--qti-inline-choice-width);\n vertical-align: baseline;\n }\n\n [part='value'] {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n text-align: left;\n }\n\n /* ── Chevron icon ─────────────────────────────────────────────────────────────\n Rendered as a CSS mask so the theme controls its colour via color:.\n The span in the template is empty; this CSS provides the visual.\n */\n [part~='dropdown-icon'] {\n flex: 0 0 auto;\n display: inline-block;\n width: 1em;\n height: 1em;\n background-color: currentColor;\n mask: var(--qti-chevron-mask) no-repeat center / contain;\n -webkit-mask: var(--qti-chevron-mask) no-repeat center / contain;\n transition: transform var(--qti-motion-duration-fast) ease;\n transform-origin: center;\n }\n\n [part~='dropdown-icon-open'] {\n transform: rotate(180deg);\n }\n\n /* ── Popover menu — anchor positioning only, all paint in the theme ──────── */\n [part='menu'] {\n position-anchor: --qti-inline-choice-anchor;\n inset: auto;\n margin: 0;\n z-index: var(--qti-popover-z-index);\n top: anchor(bottom);\n left: anchor(left);\n min-width: anchor-size(width);\n max-width: min(90vw, 36rem);\n max-height: min(40vh, 20rem);\n overflow: auto;\n box-sizing: border-box;\n position-try-fallbacks: flip-block, flip-inline;\n }\n\n /* ── Option rows — layout only, all paint in the theme ─────────────────── */\n button[part~='option'] {\n display: flex;\n align-items: center;\n width: 100%;\n box-sizing: border-box;\n text-align: left;\n font: inherit;\n color: inherit;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n [part='option-content'] {\n flex: 1 1 auto;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n img {\n display: inline-block;\n vertical-align: middle;\n }\n\n /* ── Validation message ────────────────────────────────────────────────────\n Absolutely positioned below the trigger so it does not push surrounding\n inline text and cannot be obscured by the open popover menu.\n */\n [part='message'] {\n position: absolute;\n inset-block-start: 100%;\n inset-inline-start: 0;\n z-index: var(--qti-overlay-z-index);\n white-space: nowrap;\n }\n"]);ns=function t(){return e};return e}function nl(){var e=O(['\n <button\n part="trigger"\n type="button"\n @click=',"\n @keydown=",'\n aria-haspopup="listbox"\n aria-expanded="','"\n aria-controls="','"\n popovertarget="','"\n popovertargetaction="toggle"\n ?disabled="','"\n data-readonly="','"\n >\n <span part="value">','</span>\n <span\n part="','"\n aria-hidden="true"\n ></span>\n </button>\n ']);nl=function t(){return e};return e}function nc(){var e=O(['\n <div\n id="','"\n part="menu"\n role="listbox"\n popover="auto"\n @toggle=',"\n @keydown=",'\n >\n <button\n part="','"\n type="button"\n role="option"\n aria-selected="','"\n @click=','\n >\n <span part="option-content">',"</span>\n </button>\n <slot @slotchange=","></slot>\n </div>\n "]);nc=function t(){return e};return e}function nu(){var e=O(['<div id="validation-message" part="message" role="alert" style="display:none;"></div>']);nu=function t(){return e};return e}function nd(){var e=O([" "," "," "," "]);nd=function t(){return e};return e}function nh(){var e=O(["\n /*\n * A custom element is inline unless it says otherwise, and this one never did. Its shadow content\n * is block-level, so block-in-inline generated the anonymous block boxes and it looked correct —\n * but an inline box whose children are all block has no background area of its own, so the host\n * could not be painted, outlined or given a radius by anything downstream. Declaring the box the\n * element already had is layout-neutral: measured on ITEM009, the element rect and the following\n * sibling's position are identical to the pixel with and without this.\n */\n :host {\n display: block;\n\n /*\n * Match's columns are wider than the shared default, because each one is a category card\n * rather than a slot holding one chip. This was the 150px fallback inside the grid rule\n * below; a fallback could hold it only while nothing declared the token, so it is a real\n * declaration now. On :host, so it survives with or without the theme — and so a theme can\n * still retune it from the document, which outranks :host for the element it matches.\n */\n --qti-drop-track-min-width: 150px;\n }\n\n slot:not([hidden]) {\n /* slot where the */\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\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\n /*\n * The two match sets, in drag-drop mode. Both are slotted, so ::slotted() reaches them; the\n * theme used to lay them out by descendant selector from the document.\n *\n * First set is the chip bank — a wrapping row. Last set is the target grid, whose track floor is\n * a token so a theme can decide how wide a category card gets. That floor used to be a bare\n * '150px' in the theme, the one responsive breakpoint hiding in a stylesheet that is meant to\n * hold none.\n *\n * The gaps stay in the theme: gap is spacing.\n */\n :host(:not(.qti-match-tabular)) ::slotted(qti-simple-match-set:first-of-type) {\n display: flex;\n flex-wrap: wrap;\n\n /*\n * Two different properties, and the bank needs both.\n *\n * align-items packs a chip to the top of ITS OWN line. align-content packs the LINES to the\n * top of the container, and was missing — so it took the initial normal, which for a\n * multi-line flex container behaves as stretch.\n *\n * That only shows once the bank wraps AND is taller than its content, which is exactly the\n * side-by-side arrangement: the bank and the target grid are flex siblings, so the bank is\n * stretched to the grid's height. Measured on ITEM008 at 740px, where the bank wraps to two\n * lines: container 272px tall for 37px chips, the two lines stretched to 136px each, and the\n * second row of chips floating 144px below the first instead of 53px.\n */\n align-items: flex-start;\n align-content: flex-start;\n }\n\n :host(:not(.qti-match-tabular)) ::slotted(qti-simple-match-set:last-of-type) {\n display: grid;\n /*\n * The track floor by name — see the same rule in qti-order-interaction.styles.ts. Match sets\n * it wider than the shared default below, because a category card has to look able to hold\n * several answers. The measured term is still in the max() and still resolves to 0px here:\n * this interaction sets autoSizeDropzones = false, so nothing ever publishes it. Written out\n * anyway so the two grids read identically and neither has to be understood as the special one.\n */\n grid-template-columns: repeat(\n auto-fit,\n minmax(max(var(--qti-drop-track-min-width, 150px), var(--qti-dropzone-min-width, 0px)), 1fr)\n );\n }\n\n /* An answer key shows the answer, not the bank you would have dragged it from. The attribute is\n set on the clone by the correct-response mixin; the theme used to do this with a\n '.full-correct-response' descendant selector, from the document. */\n :host([answer-key]:not(.qti-match-tabular)) ::slotted(qti-simple-match-set:first-of-type) {\n display: none;\n }\n\n /* Same for a disabled interaction: nothing left to drag, so no bank. */\n :host(:disabled:not(.qti-match-tabular)) ::slotted(qti-simple-match-set:first-of-type) {\n display: none;\n }\n "]);nh=function t(){return e};return e}function np(){var e=O(["\n :host(.qti-match-tabular) slot:not([hidden]) {\n display: contents;\n }\n :host(.qti-match-tabular) [part='grid'] {\n display: grid;\n /* Clips the cell rules — which are the grid's own background showing through a 1px gap — to the\n theme's border-radius. */\n overflow: hidden;\n width: fit-content;\n max-width: 100%;\n grid-template-columns: minmax(min-content, max-content) repeat(var(--qti-match-cols, 1), auto);\n grid-template-rows: auto repeat(var(--qti-match-rows, 1), auto);\n }\n /* Subgrid wrappers carry the slotted choices and the input cells into the\n outer grid's tracks. This structure is shared with the editor's tabular\n template so both can inherit the same theme CSS. No per-choice inline\n style writes are needed — auto-flow + subgrid handle placement. */\n :host(.qti-match-tabular) [part='cols-wrap'] {\n grid-column: 2 / -1;\n grid-row: 1;\n display: grid;\n grid-template-columns: subgrid;\n }\n :host(.qti-match-tabular) [part='rows-wrap'] {\n grid-column: 1;\n grid-row: 2 / -1;\n display: grid;\n grid-template-rows: subgrid;\n }\n :host(.qti-match-tabular) [part='checkbox-grid'] {\n grid-column: 2 / -1;\n grid-row: 2 / -1;\n display: grid;\n grid-template-columns: subgrid;\n grid-template-rows: subgrid;\n }\n :host(.qti-match-tabular) ::slotted(qti-simple-match-set) {\n display: contents;\n }\n\n /*\n * The radio/checkbox box centres its own mark. qti-simple-choice.styles.ts does the same for\n * the non-tabular control; here the cells are plain spans in this shadow root, so the rule\n * belongs to this file.\n *\n * The theme's 'form' mixin used to carry 'display: grid; place-content: center', which centred\n * both — from a document stylesheet, overriding qti-simple-choice's own flex centring. The mixin\n * keeps the box's size and paint; the box itself is laid out here.\n */\n :host(.qti-match-tabular) [part~='control'] {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n }\n "]);np=function t(){return e};return e}function nf(){var e=O(['\n <label\n part="input-cell"\n role="gridcell"\n style="grid-row: ',"; grid-column: ",'; display: flex; align-items: center; justify-content: center; cursor: pointer;"\n >\n <input\n type=',"\n hidden\n name=","\n value=","\n .checked=","\n .disabled=","\n @change=","\n @click=","\n />\n <span part="," role="," aria-checked=",">\n <span part=","></span>\n </span>\n </label>\n "]);nf=function t(){return e};return e}function nv(){var e=O(['\n <div role="row" style="display: contents;">\n ',"\n </div>\n "]);nv=function t(){return e};return e}function ng(){var e=O(['\n <div\n part="grid"\n role="grid"\n style="--qti-match-rows: ',"; --qti-match-cols: ",';"\n >\n <div part="corner"></div>\n <div part="cols-wrap" role="row"><slot name="match-cols" part="c-header"></slot></div>\n <div part="rows-wrap"><slot name="match-rows" part="r-header"></slot></div>\n <div part="checkbox-grid">\n ',"\n </div>\n </div>\n "]);ng=function t(){return e};return e}function nm(){var e=O(['\n <slot name="prompt"></slot>\n <slot ?hidden=',"></slot>\n\n ",'\n\n <div role="alert" part="message" id="validation-message"></div>\n ']);nm=function t(){return e};return e}function nb(){var e=O(["\n /* The box this element already had. See the note in qti-match-interaction.styles.ts. */\n :host {\n display: block;\n }\n "]);nb=function t(){return e};return e}function ny(){var e=O([' <slot name="prompt"></slot>\n <slot></slot>']);ny=function t(){return e};return e}function nw(){var e=O(["\n /* The box this element already had. See the note in qti-match-interaction.styles.ts. */\n :host {\n display: block;\n }\n\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: row;\n /*\n * A column floor and a drop's own min-width are two jobs, and this asks for both by name\n * rather than letting one token mean both. --qti-drop-track-min-width is the policy: a column\n * stays usable however narrow the chips are. --qti-dropzone-min-width is the measurement: a\n * column is never narrower than the chip it holds. max() of the two is what the grid wants,\n * and the 0px fallback is what makes this correct for an interaction that never measures.\n *\n * One name did both until --qti-drop-min-width was deleted for exactly that (it meant the\n * track floor here and a drop's own min-width in the match target). Folding the track back\n * onto --qti-dropzone-min-width brought the conflation back: a theme setting it to give\n * unmeasured drops a floor also set every column, and a code path that stopped publishing a\n * measured width stopped meaning \"no floor\".\n */\n grid-template-columns: repeat(\n auto-fit,\n minmax(max(var(--qti-drop-track-min-width, 120px), var(--qti-dropzone-min-width, 0px)), 1fr)\n );\n gap: 0.5rem;\n }\n\n :host([orientation='horizontal']) [part='drags'],\n :host(.qti-orientation-horizontal) [part='drags'] {\n flex-direction: row;\n }\n /*\n * Horizontal adds nothing to [part='drops']: the base rule above is already the horizontal\n * layout — auto-fit columns that wrap. Only 'vertical' overrides it, to a single column.\n *\n * There used to be a 'grid-auto-flow: column' here, which forced every drop onto one\n * non-wrapping line. The theme cancelled it by restating the base rule at\n * qti-order-interaction.css, but only for '[orientation='horizontal']' — so the attribute\n * wrapped and the '.qti-orientation-horizontal' class did not. The theme's rule is gone and so\n * is this one; both spellings now wrap, which is what the attribute already did.\n */\n :host([orientation='vertical']) [part='drags'],\n :host(.qti-orientation-vertical) [part='drags'] {\n flex-direction: column;\n }\n :host([orientation='vertical']) [part='drops'],\n :host(.qti-orientation-vertical) [part='drops'] {\n grid-template-columns: 1fr;\n }\n\n /* Drop target. The interaction measures its chips and publishes the result as a custom\n property on its host; the property itself lives here, not in a style attribute. */\n [part~='drop'] {\n display: flex;\n flex: 1;\n min-height: var(--qti-dropzone-min-height, 0);\n\n /*\n * Both axes, not just the height.\n *\n * The width was measured and published all along and then thrown away: the drop is a grid item\n * and stretched to its track, which is 1fr, so a slot in the vertical layout came out 669px\n * wide for a 149px chip. justify-self: start stops the stretch and the measured minimum then\n * decides, so a slot is exactly as wide as the widest chip — the same rule the height has\n * always followed.\n *\n * The grid is untouched: the tracks still lay the slots out and still wrap in the horizontal\n * layout. Only the slot inside the track stops filling it.\n */\n min-width: var(--qti-dropzone-min-width, 0);\n justify-self: start;\n\n /* A chip's drop shadow hangs outside its column. */\n overflow: visible;\n }\n\n [part='drops'] {\n overflow: visible;\n }\n\n /* Once a drop holds a chip it stops stretching to the row and sits at the top of it. */\n :host(:has(qti-simple-choice)) [part~='drop'] {\n align-self: flex-start;\n }\n\n /*\n * The chip a drop renders.\n *\n * 'overflow: visible', not 'hidden'. The theme declared both, in two '::part(drag)' blocks at\n * equal specificity in the same layer, so the later one won and the chip has always been\n * unclipped. The 'text-overflow: ellipsis' still sitting beside the first one has therefore\n * never done anything; it is left in the theme rather than deleted here, since removing it is a\n * decision about how a long label should behave, not a relocation.\n */\n [part~='drag'] {\n display: flex;\n align-items: center;\n overflow: visible;\n }\n\n [part='container'] {\n display: grid;\n grid-template-areas:\n 'drags drops'\n 'message message';\n grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);\n align-items: start;\n gap: 0.5rem;\n }\n\n slot[part~='drags'] {\n grid-area: drags;\n }\n\n [part='drops'] {\n grid-area: drops;\n }\n\n [part='message'] {\n grid-area: message;\n width: 100%;\n justify-self: start;\n }\n\n /*\n * The PLATFORM DEFAULT for container positioning, when the orientation is horizontal.\n *\n * Read that carefully, because the two things are separate axes in QTI 3 and this rule does not\n * merge them. Vocabulary \xa71.2.9.3 defines qti-choices-* as where the choices container sits\n * relative to the order-target container; orientation is how items flow WITHIN a container.\n * They compose: \xa71.2.9.2 Figure 73 is orientation=\"vertical\" class=\"qti-choices-left\" and\n * renders two COLUMNS SIDE BY SIDE — vertical does not stack the containers, and horizontal does\n * not imply that it should.\n *\n * What makes this rule legitimate is that \xa71.2.9.3 declines to specify the positioning at all\n * when no class is given: \"In the absence of choices | order target container positioning,\n * delivery systems should render platform defaults.\" That default is ours, and for a horizontal\n * flow the useful one is stacked, because a row needs the width. An author who wants something\n * else says so with qti-choices-*, which is exactly what the spec provides it for — and those\n * rules below still win (see the source-order note).\n *\n * Side by side used to work here anyway, but only because a slot could be narrower\n * than the chip standing in it: the theme gave a placed chip width: 100%, so a 218px chip was\n * squeezed into a 184px track and three of them fitted in half the width. That squeeze is gone\n * (DROP-SIZING.md \xa75), and without it \"van links naar rechts\" collapsed to a single column,\n * because 384px cannot hold two 218px chips.\n *\n * Measured on ITEM013: side by side gives the slots 384px and one 384px track; stacked gives them\n * 800px and three 256px tracks, each wider than the chip. Vertical is untouched — one column is\n * what it wants, and the split suits it.\n *\n * Deliberately BEFORE the qti-choices-* rules below, not after. Those tie on specificity, so\n * source order decides: an author who writes qti-choices-left still gets it, and this is only the\n * default for an orientation that has no such class.\n */\n :host([orientation='horizontal']) [part='container'],\n :host(.qti-orientation-horizontal) [part='container'] {\n grid-template-areas:\n 'drags'\n 'drops'\n 'message';\n grid-template-columns: minmax(0, 1fr);\n }\n\n :host(.qti-choices-top) [part='container'] {\n grid-template-areas:\n 'drags'\n 'drops'\n 'message';\n grid-template-columns: minmax(0, 1fr);\n }\n\n :host(.qti-choices-bottom) [part='container'] {\n grid-template-areas:\n 'drops'\n 'drags'\n 'message';\n grid-template-columns: minmax(0, 1fr);\n }\n\n :host(.qti-choices-left) [part='container'] {\n grid-template-areas:\n 'drags drops'\n 'message message';\n grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);\n }\n\n :host(.qti-choices-right) [part='container'] {\n grid-template-areas:\n 'drops drags'\n 'message message';\n grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);\n }\n\n /* An answer key shows the answer, not the bank you would have dragged it from. The attribute is\n set on the clone by the correct-response mixin; the theme used to do this with a\n '.full-correct-response' descendant selector, from the document. */\n :host([answer-key]) [part~='drags'] {\n display: none;\n }\n "]);nw=function t(){return e};return e}function nq(){var e=O(['<div role="region" part="drop" data-declarative-drops identifier=',">\n ","\n </div>"]);nq=function t(){return e};return e}function nk(){var e=O([' <slot name="prompt"> </slot>\n <div part="container">\n <slot part="drags"> </slot>\n <div part="drops">\n ','\n </div>\n <div id="validation-message" part="message" role="alert" style="display:none;"></div>\n </div>']);nk=function t(){return e};return e}function nx(){var e=O(["\n :host {\n display: block;\n width: 100%;\n min-height: 50px;\n }\n\n ::slotted(qti-interaction-markup) {\n display: none;\n }\n "]);nx=function t(){return e};return e}function n_(){var e=O(['<div style="color:red">\n <h1>Error</h1>\n ',"\n </div>"]);n_=function t(){return e};return e}function nE(){var e=O(["\n <slot></slot>\n ","\n "]);nE=function t(){return e};return e}function nC(){var e=O(["\n :host {\n display: block;\n width: 100%;\n min-height: 50px;\n }\n "]);nC=function t(){return e};return e}function nS(){var e=O(["\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 "]);nS=function t(){return e};return e}function nR(){var e=O(["<slot></slot>"]);nR=function t(){return e};return e}function nA(){var e=O(["\n :host {\n display: inline-block;\n position: relative;\n }\n "]);nA=function t(){return e};return e}function nT(){var e=O(["<slot></slot>"]);nT=function t(){return e};return e}function nI(){var e=O(["\n :host {\n display: block;\n --qti-select-point-marker-size: 1.5rem;\n --qti-select-point-marker-anchor: -100%;\n --qti-select-point-icon: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512'%3E%3Cpath d='M172.268 501.67C26.97 291.031 0 269.413 0 192 0 85.961 85.961 0 192 0s192 85.961 192 192c0 77.413-26.97 99.031-172.268 309.67-9.535 13.774-29.93 13.773-39.464 0zM192 272c44.183 0 80-35.817 80-80s-35.817-80-80-80-80 35.817-80 80 35.817 80 80 80z'/%3E%3C/svg%3E\");\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\n [part~='point'] {\n transform: translate(-50%, var(--qti-select-point-marker-anchor));\n width: var(--qti-select-point-marker-size);\n height: var(--qti-select-point-marker-size);\n min-width: var(--qti-select-point-marker-size);\n min-height: var(--qti-select-point-marker-size);\n padding: 0;\n margin: 0;\n border: none;\n background: transparent;\n color: inherit;\n cursor: pointer;\n background-color: var(--qti-select-point-marker-color, currentColor);\n -webkit-mask: var(--qti-select-point-icon) no-repeat center / contain;\n mask: var(--qti-select-point-icon) no-repeat center / contain;\n }\n "]);nI=function t(){return e};return e}function nP(){var e=O(["\n <button\n part=","\n style=",'\n aria-label="Remove point at ','"\n ?disabled=',"\n @click=","\n ></button>\n "]);nP=function t(){return e};return e}function nO(){var e=O([' <slot name="prompt"></slot>\n <point-container>\n ',"\n ","\n <slot></slot>\n </point-container>"]);nO=function t(){return e};return e}function nM(){var e=O(["\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)\n repeat-x 0 center / calc(calc(100% - var(--qti-border-thickness)) / ((var(--max) - var(--min)) / var(--step)))\n 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='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 "]);nM=function t(){return e};return e}function nN(){var e=O(['\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 "]);nN=function t(){return e};return e}function nD(){var e=O(["\n :host {\n display: inline-flex;\n align-items: center;\n vertical-align: middle;\n }\n\n /*\n * The QTI presentation class .qti-input-width-N promises room for N characters, so the CSS\n * says exactly that: N times the width of a zero glyph, which is the definition of the ch\n * unit — the same metric the HTML size attribute uses, and the one the conformance suite\n * measures against (see inputCharCapacity in the Q20 stories).\n *\n * This used to be a ladder of sixteen hand-tuned rem values, and they were only approximately\n * N: about 1.1rem per character up to -6, then about 0.8rem per character from -10 up. So the\n * small classes were roughly double what they claimed and the large ones about 1.5x. Worse, a\n * rem is fixed while a character is not, so every theme that changed the input's font silently\n * changed how many characters fit. In ch the promise holds in any font at any size.\n *\n * Two details:\n *\n * content-box is what makes the unit mean anything. Under the border-box reset above, the\n * theme's padding and border would be taken *out* of the N characters, and .qti-input-width-1\n * would leave no room for the one character it names. The input is inside this shadow tree, so\n * it can opt out; a document-level reset never reaches it.\n *\n * The 2px is the caret's column. Without it the final character scrolls out from under the\n * cursor as it is typed. It also keeps clientWidth — which the CSSOM rounds to a whole pixel —\n * from landing a hair under N characters and failing the conformance assertion.\n *\n * Both the width and the content-box are gated on the class being present. An input with no\n * qti-input-width-N keeps the width its theme gives it and stays border-box like everything\n * else; only an input that has been *promised* N characters opts out to guarantee them.\n */\n :host([class*='qti-input-width-']) [part='input'] {\n box-sizing: content-box;\n width: calc(var(--qti-input-width) * 1ch + 2px);\n min-width: calc(var(--qti-input-width) * 1ch + 2px);\n }\n\n [part='input'] {\n padding: var(--qti-padding-box);\n }\n\n :host(.qti-input-width-1) {\n --qti-input-width: 1;\n }\n :host(.qti-input-width-2) {\n --qti-input-width: 2;\n }\n :host(.qti-input-width-3) {\n --qti-input-width: 3;\n }\n :host(.qti-input-width-4) {\n --qti-input-width: 4;\n }\n :host(.qti-input-width-6) {\n --qti-input-width: 6;\n }\n :host(.qti-input-width-10) {\n --qti-input-width: 10;\n }\n :host(.qti-input-width-15) {\n --qti-input-width: 15;\n }\n :host(.qti-input-width-20) {\n --qti-input-width: 20;\n }\n :host(.qti-input-width-25) {\n --qti-input-width: 25;\n }\n :host(.qti-input-width-30) {\n --qti-input-width: 30;\n }\n :host(.qti-input-width-35) {\n --qti-input-width: 35;\n }\n :host(.qti-input-width-40) {\n --qti-input-width: 40;\n }\n :host(.qti-input-width-45) {\n --qti-input-width: 45;\n }\n :host(.qti-input-width-50) {\n --qti-input-width: 50;\n }\n :host(.qti-input-width-72) {\n --qti-input-width: 72;\n }\n "]);nD=function t(){return e};return e}function nL(){var e=O(['<div part="answer" aria-hidden="true"></div>']);nL=function t(){return e};return e}function nU(){var e=O(['<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 />']);nU=function t(){return e};return e}function nj(){var e=O(['<div id="validation-message" part="message" role="alert" style="display:none;"></div>']);nj=function t(){return e};return e}function nz(){var e=O([" "," "," "," "]);nz=function t(){return e};return e}function nV(){var e=O(["\n :host {\n display: block;\n margin: 1em 0;\n }\n input[type='file'] {\n display: block;\n margin-top: 0.5em;\n }\n "]);nV=function t(){return e};return e}function nW(){var e=O(['\n <div>\n <slot name="prompt"></slot>\n <input type="file" @change="','" ?disabled="','" ?readonly="','" />\n </div>\n ']);nW=function t(){return e};return e}function nF(){var e=O(["<slot></slot>"]);nF=function t(){return e};return e}function nB(){var e=O(["",""]);nB=function t(){return e};return e}function n$(){var e=O(["",""]);n$=function t(){return e};return e}function nH(){var e=O(["<slot></slot>"]);nH=function t(){return e};return e}function nQ(){var e=O(["<slot></slot>"]);nQ=function t(){return e};return e}function nG(){var e=O(["",""]);nG=function t(){return e};return e}function nX(){var e=O(["\n /* Nothing at all until the item judges this element. */\n [part~='correction'] {\n display: none;\n }\n\n [part~='correction-correct'],\n [part~='correction-incorrect'],\n [part~='correction-partially-correct'] {\n display: inline-flex;\n flex: 0 0 auto;\n\n /*\n * The badge aligns ITSELF, and that is the whole of the vertical story.\n *\n * It is a flex item with a definite height, so left alone its cross-axis position is decided by\n * whatever its host says — and the hosts disagree: qti-simple-associable-choice defaults to\n * align-items: normal, and qti-gap-text gates center behind :not([part~='drag']), so the\n * same chip centred its badge in the bank and top-aligned it once placed. align-self settles it\n * from the badge's side, in one line, without touching a single container.\n *\n * This replaces an align-items/justify-content: center pair that had never done anything: the\n * badge is empty — a mask painted over a background — so centring its CONTENTS centres nothing.\n */\n align-self: center;\n\n box-sizing: border-box;\n width: var(--qti-correction-size, 1em);\n height: var(--qti-correction-size, 1em);\n margin-left: var(--qti-glyph-gap, 0.5em);\n\n pointer-events: none;\n }\n"]);nX=function t(){return e};return e}function nK(){var e=O(['<div part="control"></div>\n <slot part="label"></slot>\n <span part=',' aria-hidden="true"></span>']);nK=function t(){return e};return e}function nY(){var e=O(['<div part="control"><div part="control-mark"></div></div>\n <slot part="label"></slot>\n <span part=',' aria-hidden="true"></span>']);nY=function t(){return e};return e}function nJ(){var e=O(['\n <div part="control"></div>\n <slot part="label"></slot>\n <span part=',' aria-hidden="true"></span>\n <div part="drop">\n ',"\n </div>\n "]);nJ=function t(){return e};return e}function nZ(){var e=O(['<div id="label" part="marker">',"</div>"]);nZ=function t(){return e};return e}function n0(){var e=O(['<div part="control" tabindex="0"><div part="control-mark"></div></div>\n ','\n <slot part="label"></slot>\n <span part=',' aria-hidden="true"></span>']);n0=function t(){return e};return e}function n1(){var e=O(['<option value="','" ?selected=',">\n ","\n </option>"]);n1=function t(){return e};return e}function n3(){var e=O(['\n <label part="label" for="modeSelect">','</label>\n <select\n part="select"\n id="modeSelect"\n @change=',"\n >\n ","\n </select>\n "]);n3=function t(){return e};return e}function n2(){var e=O(["\n display: inline-flex;\n align-items: center;\n cursor: pointer;\n padding: 0.5rem 1rem;\n border-radius: 0.25rem;\n user-select: none;\n"]);n2=function t(){return e};return e}function n5(){var e=O(["\n background-color: lightgray;\n ",";\n"]);n5=function t(){return e};return e}function n4(){var e=O(["\n cursor: not-allowed;\n opacity: 0.8;\n"]);n4=function t(){return e};return e}function n6(){var e=O(["\n ",";\n border: 1px solid gray;\n"]);n6=function t(){return e};return e}function n8(){var e=O([' <div @click="','">',"</div> "]);n8=function t(){return e};return e}function n7(){var e=O(["\n :host {\n ",";\n }\n :host([disabled]) {\n ",";\n }\n "]);n7=function t(){return e};return e}function n9(){var e=O([' <div @click="','">',"</div> "]);n9=function t(){return e};return e}function re(){var e=O(["\n :host {\n ",";\n }\n :host([disabled]) {\n ",";\n }\n "]);re=function t(){return e};return e}function rt(){var e=O([' <div @click="','">',"</div> "]);rt=function t(){return e};return e}function rn(){var e=O(["\n :host {\n ",";\n }\n :host([disabled]) {\n ",";\n }\n "]);rn=function t(){return e};return e}function rr(){var e=O(["","","\n <span part=",' aria-hidden="true"></span>\n ',""]);rr=function t(){return e};return e}function ri(){var e=O(["\n /*\n * Placement only — the glyph itself is the theme's, keyed on ::part(correction-*). That split\n * is the contract in correction.styles.ts, which deliberately leaves the shared badge in flow\n * and invites a component to lift it out if it wants a corner badge.\n *\n * A textarea is a box the candidate writes in, so the badge goes over its top-left corner\n * rather than trailing the text the way a chip's does, and the theme reserves the gutter for it\n * (padding-left on ::part(textarea)).\n *\n * Anchored to the TEXTAREA, not to the host. The badge's containing block is :host, and the\n * host also contains the prompt slot — so a plain top: 0.85rem measured from the host lands on\n * the prompt and the badge floats above the field, which is exactly what it did. Only the\n * vertical offset needs anchoring: the textarea spans the host's full width, so the left\n * offset is the same measured from either.\n */\n [part~='textarea'] {\n anchor-name: --qti-extended-text-field;\n }\n\n [part~='correction'] {\n position: absolute;\n position-anchor: --qti-extended-text-field;\n margin: 0;\n width: var(--qti-correction-size);\n\n /*\n * One FIELD line tall, not square — this is what puts the glyph on the text rather than near\n * it. The mask is drawn center / contain, so in a box exactly one line high it centres itself\n * on that line while the width still governs the glyph's size.\n *\n * Not 1lh: that unit resolves against the BADGE's own inherited line-height (measured 18.4px),\n * not the textarea's (24px), so it landed a third of a line low. --qti-field-line-height is\n * the same number @mixin field-typography gives the field, so the two cannot drift.\n */\n height: calc(var(--qti-correction-size) * var(--qti-field-line-height));\n\n /* Inset exactly as the text is: the same trailing token the two field-shaped interactions\n use, read here as a LEADING inset because this badge lives in a left gutter. */\n left: var(--qti-correction-inset);\n\n /* Anchored to the field's first line: its top edge plus the field's own padding-top. */\n top: calc(anchor(top) + var(--qti-spacing));\n }\n\n /*\n * Fallback for engines without anchor positioning, where the top above does not parse and the\n * badge would fall to its static position below the field. The bottom of the gutter needs no\n * knowledge of where the field starts, and the gutter runs the full height, so the badge still\n * clears the text.\n *\n * Scoped by @supports rather than declared alongside. Both were set at first, on the assumption\n * that top + height over-constrains the box and bottom is ignored — it is not: measured, the\n * bottom won and put the badge on the third line.\n */\n @supports not (anchor-name: --probe) {\n [part~='correction'] {\n top: auto;\n bottom: var(--qti-correction-inset);\n }\n }\n "]);ri=function t(){return e};return e}function ro(){var e=O(['\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 ']);ro=function t(){return e};return e}function ra(){var e=O(["\n /*\n * Only the TRAILING inset — the leading gap is the shared --qti-glyph-gap, like every other\n * badge. This used to set both margins to --qti-gap (1rem), twice everyone else's 0.5em, on\n * the one token qti-variables.css calls \"the page's rhythm … an order of magnitude too wide\n * for a glyph sitting inside a line\".\n *\n * The trailing inset is needed here, and in text-entry, because these two put the field's box\n * on the HOST while its padding sits on an inner element (::part(trigger), ::part(input)) —\n * so a badge that is a child of the host falls outside that padding and lands on the border.\n * Chips, choices and hottext carry their padding on the host, so their badge is already inset\n * by it and needs nothing.\n */\n [part~='correction'] {\n margin-inline-end: var(--qti-correction-inset);\n }\n "]);ra=function t(){return e};return e}function rs(){var e=O(["\n "," "," ","\n <span part=",' aria-hidden="true"></span>\n ']);rs=function t(){return e};return e}function rl(){var e=O(["<div\n style=","\n data-correction-area\n data-coord=","\n data-shape=","\n alt=","\n ></div>"]);rl=function t(){return e};return e}function rc(){var e=O(["\n [part~='correct'] {\n --qti-select-point-marker-color: var(--qti-correct);\n }\n [part~='incorrect'] {\n --qti-select-point-marker-color: var(--qti-incorrect);\n }\n "]);rc=function t(){return e};return e}function ru(){var e=O(['<div id="knob-correct" part="knob-correct">\n <div id="value" part="value">',"</div>\n </div>"]);ru=function t(){return e};return e}function rd(){var e=O(["\n [part='knob-correct'] {\n background-color: var(--qti-correct-light);\n border: 2px solid var(--qti-correct);\n position: relative;\n height: 1rem;\n width: 1rem;\n transform-origin: center;\n transform: translateX(-50%);\n cursor: pointer;\n border-radius: 9999px;\n left: var(--value-percentage-correct);\n }\n "]);rd=function t(){return e};return e}function rh(){var e=O(["\n "," ","\n <span part=",' aria-hidden="true"></span>\n ',"\n "]);rh=function t(){return e};return e}function rp(){var e=O(["\n /*\n * The trailing inset only — size and leading gap come from the shared sheet.\n *\n * This block used to also set position: static; translate: none (dead: nothing positions this\n * badge) and size it with --qti-control-size, the radio/checkbox token — 1rem, absolute, where\n * every other badge is 1em and scales with the text it annotates. The two agreed only while the\n * item's font-size happened to equal the root's.\n *\n * The inset is needed because the field's box is the HOST while its padding is on ::part(input),\n * so the badge — a child of the host — falls outside that padding and lands flush on the border.\n * Measured at 0px from the border, against 16px for a choice and 12.8px for a chip.\n */\n [part~='correction'] {\n margin-inline-end: var(--qti-correction-inset);\n }\n :host {\n position: relative;\n anchor-name: --text-entry-host, --qti-correction-anchor;\n }\n [part='correct'] {\n position: absolute;\n position-anchor: --text-entry-host;\n position-area: top span-right;\n margin-bottom: 0.25rem;\n padding: var(--qti-padding-box);\n background-color: var(--qti-bg);\n white-space: nowrap;\n }\n "]);rp=function t(){return e};return e}var QtiComponents=function(){var e=function e(){var e,t;return{promise:new Promise(function(n,r){e=n,t=r}),resolve:e,reject:t}};var t=function e(e,t){if(!oQ(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return oj!==void 0?oj.createHTML(t):t};var n=function e(e){return function(t,n){return(typeof n==="undefined"?"undefined":D(n))=="object"?ab(e,t,n):function(e,t,n){var r=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),r?Object.getOwnPropertyDescriptor(t,n):void 0}(e,t,n)}};var r=function e(e){return n(_(k({},e),{state:!0,attribute:!1}))};var o=function e(e,t){return function(n,r,o){var a=function t(t){var n;var r;return(n=(r=t.renderRoot)===null||r===void 0?void 0:r.querySelector(e))!==null&&n!==void 0?n:null};if(t){var s=(typeof r==="undefined"?"undefined":D(r))=="object"?n:o!==null&&o!==void 0?o:function(){var e=Symbol();return{get:function t(){return this[e]},set:function t(t){this[e]=t}}}(),l=s.get,c=s.set;return ay(n,r,{get:function e(){var e=l.call(this);return e===void 0&&(e=a(this),(e!==null||this.hasUpdated)&&c.call(this,e)),e}})}return ay(n,r,{get:function e(){return a(this)}})}};var c=function e(e){return function(t,n){var r=e!==null&&e!==void 0?e:{},o=r.slot,a=r.selector,s="slot"+(o?"[name=".concat(o,"]"):":not([name])");return ay(t,n,{get:function t(){var t;var n;var r=(n=this.renderRoot)===null||n===void 0?void 0:n.querySelector(s),o=(t=r===null||r===void 0?void 0:r.assignedElements(e))!==null&&t!==void 0?t:[];return a===void 0?o:o.filter(function(e){return e.matches(a)})}})}};var u=function e(e){var t=e.context;return function(e,n){var r=new WeakMap;if((typeof n==="undefined"?"undefined":D(n))=="object")return{get:function t(){return e.get.call(this)},set:function t(t){return r.get(this).setValue(t),e.set.call(this,t)},init:function e(e){return r.set(this,new aS(this,{context:t,initialValue:e})),e}};{e.constructor.addInitializer(function(e){r.set(e,new aS(e,{context:t}))});var o=Object.getOwnPropertyDescriptor(e,n),a;if(o===void 0){var s=new WeakMap;a={get:function e(){return s.get(this)},set:function e(e){r.get(this).setValue(e),s.set(this,e)},configurable:!0,enumerable:!0}}else{var l=o.set;a=_(k({},o),{set:function e(e){r.get(this).setValue(e),l===null||l===void 0?void 0:l.call(this,e)}})}return void Object.defineProperty(e,n,a)}}};var m=function e(e){var t=e.context,n=e.subscribe;return function(e,r){(typeof r==="undefined"?"undefined":D(r))=="object"?r.addInitializer(function(){var r=this;new a_(this,{context:t,callback:function t(t){e.set.call(r,t)},subscribe:n})}):e.constructor.addInitializer(function(e){new a_(e,{context:t,callback:function t(t){e[r]=t},subscribe:n})})}};var b=function e(e){return e==null};var y=function e(e){return e.replace(/([^:]\/)\/+/g,"$1").replace(/\/\//g,"/").replace("http:/","http://").replace("https:/","https://")};var w=function e(e){if(e==null)return null;if(!e.includes(",")){var t=e.trim();return t.length>0?t:null}var n=e.split(",").map(function(e){return e.trim()}).filter(function(e){return e.length>0});return n.length===0?null:n.length===1?n[0]:n};var q=function e(e){if(e==null)return null;if(Array.isArray(e)){var t=e.map(function(e){return e.trim()}).filter(function(e){return e.length>0});return t.length>0?t.join(","):null}var n=e.trim();return n.length>0?n:null};var x=function e(e){var t,n,r,o,a,s,l,c,u,d,h,p,f,v,g,m,b,y,w,u;return z(this,function(q){switch(q.label){case 0:if(!(e!=null))return[3,22];if(!Array.isArray(e))return[3,10];t=true,n=false,r=undefined;q.label=1;case 1:q.trys.push([1,7,8,9]);o=e[Symbol.iterator]();q.label=2;case 2:if(!!(t=(a=o.next()).done))return[3,6];s=a.value;l=s.trim();c=l;if(!c)return[3,4];return[4,l];case 3:c=q.sent();q.label=4;case 4:c;q.label=5;case 5:t=true;return[3,2];case 6:return[3,9];case 7:u=q.sent();n=true;r=u;return[3,9];case 8:try{if(!t&&o.return!=null){o.return()}}finally{if(n){throw r}}return[7];case 9:return[2];case 10:if(!!e.includes(","))return[3,13];d=e.trim();h=d;if(!h)return[3,12];return[4,d];case 11:h=q.sent();q.label=12;case 12:h;return[2];case 13:p=true,f=false,v=undefined;q.label=14;case 14:q.trys.push([14,20,21,22]);g=e.split(",")[Symbol.iterator]();q.label=15;case 15:if(!!(p=(m=g.next()).done))return[3,19];b=m.value;y=b.trim();w=y;if(!w)return[3,17];return[4,y];case 16:w=q.sent();q.label=17;case 17:w;q.label=18;case 18:p=true;return[3,15];case 19:return[3,22];case 20:u=q.sent();f=true;v=u;return[3,22];case 21:try{if(!p&&g.return!=null){g.return()}}finally{if(f){throw v}}return[7];case 22:return[2]}})};var C=function e(e){var t=M(e.trim().split(/\s+/)),n=t[0],r=t[1],o=t.slice(2);if(!n||!r||o.length>0)throw new Error('malformed directed-pair value: "'.concat(e,'" (expected "source target")'));return{source:n,target:r}};var S=function e(e,t){return"".concat(e," ").concat(t)};var R=function e(e){var t=M(e.trim().split(/\s+/)),n=t[0],r=t[1],o=t.slice(2),a=Number(n),s=Number(r);if(!Number.isFinite(a)||!Number.isFinite(s)||o.length>0)throw new Error('malformed point value: "'.concat(e,'" (expected "x y" numeric coords)'));return{x:a,y:s}};var T=function e(e,t){return"".concat(e," ").concat(t)};var P=function e(e){var t=e.emptyAs,n=function e(e){return e===t||e==null||e===""||Array.isArray(e)&&e.length===0};return{fromAttribute:function e(e){var n=w(e);return n===null?t:n},toAttribute:function e(e){return n(e)?null:q(e)}}};var O=function e(e,t){var n=k({waitUntilFirstUpdate:!1},t);return function(t,r){var o=t.update,a=Array.isArray(e)?e:[e];t.update=function(e){var t=this;a.forEach(function(o){var a=o;if(e.has(a)){var s=e.get(a),l=t[a];s!==l&&(!n.waitUntilFirstUpdate||t.hasUpdated)&&t[r](s,l)}}),o.call(this,e)}}};var L=function e(e){this._$AN!==void 0?(sP(this),this._$AM=e,sO(this)):this._$AM=e};var j=function e(e){var t=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,o=this._$AN;if(o!==void 0&&o.size!==0)if(t)if(Array.isArray(r))for(var a=n;a<r.length;a++)sI(r[a],!1),sP(r[a]);else r!=null&&(sI(r,!1),sP(r));else sI(this,e)};var rf=function e(e){e.querySelectorAll('qti-custom-operator[class="js.org"] > qti-base-value').forEach(function(e){var t=document.createComment(e.textContent);e.replaceChild(t,e.firstChild)})};var rv=function e(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"qti-portable-custom-interaction";return a(function(){var o,s,l,c,u,d,h,p,f,v,g,m,b,y,w,q,k,x,_,E,C,S,R,A,T,I,P,O,M,N,D,L,U,j;return z(this,function(P){switch(P.label){case 0:o=[],s=e.querySelectorAll(r);if(s.length===0)return[2];l=null,c=null,u=function e(){return a(function(){var e,r;return z(this,function(o){switch(o.label){case 0:if(!(l===null))return[3,4];o.label=1;case 1:o.trys.push([1,3,,4]);return[4,n(t,"/modules/module_resolution.js")];case 2:l=o.sent();return[3,4];case 3:e=o.sent();l=null;return[3,4];case 4:if(!(c===null))return[3,8];o.label=5;case 5:o.trys.push([5,7,,8]);return[4,n(t,"/modules/fallback_module_resolution.js")];case 6:c=o.sent();return[3,8];case 7:r=o.sent();c=null;return[3,8];case 8:return[2]}})})()};d=true,h=false,p=undefined;P.label=1;case 1:P.trys.push([1,12,13,14]);f=Array.from(s)[Symbol.iterator]();P.label=2;case 2:if(!!(d=(v=f.next()).done))return[3,11];g=v.value;g.setAttribute("data-base-url",t);m=g.getAttribute("custom-interaction-type-identifier");m&&o.includes(m)&&(m=m+o.length,g.setAttribute("custom-interaction-type-identifier",m),o.push(m)),m&&o.push(m);b=g.querySelector("qti-interaction-modules");if(!(b&&b.getAttribute("primary-configuration")))return[3,8];return[4,u()];case 3:P.sent();y=b.getAttribute("primary-configuration");if(!y)return[3,7];P.label=4;case 4:P.trys.push([4,6,,7]);return[4,n(t,"/".concat(y))];case 5:w=P.sent(),q=Array.from(b.querySelectorAll("qti-interaction-module"));k=true,x=false,_=undefined;try{for(E=q[Symbol.iterator]();!(k=(C=E.next()).done);k=true){S=C.value;R=S.getAttribute("id");if(R&&w.paths&&w.paths[R]){A=w.paths[R],T=Array.isArray(A)?A[0]:A;if(S.setAttribute("primary-path",T),c&&c.paths&&c.paths[R]){I=c.paths[R];Array.isArray(I)?S.setAttribute("fallback-path",I[0]):S.setAttribute("fallback-path",I)}}}}catch(e){x=true;_=e}finally{try{if(!k&&E.return!=null){E.return()}}finally{if(x){throw _}}}if(w.paths){for(var U in w.paths)if(!b.querySelector('qti-interaction-module[id="'.concat(U,'"]'))){O=e.createElement("qti-interaction-module");O.setAttribute("id",U);M=Array.isArray(w.paths[U])?w.paths[U][0]:w.paths[U];if(O.setAttribute("primary-path",M),c&&c.paths&&c.paths[U]){N=c.paths[U];Array.isArray(N)?O.setAttribute("fallback-path",N[0]):O.setAttribute("fallback-path",N)}b.appendChild(O)}}w.urlArgs&&b.setAttribute("url-args",w.urlArgs);return[3,7];case 6:D=P.sent();console.warn("Failed to load primary configuration: ".concat(y),D);return[3,7];case 7:return[3,10];case 8:return[4,u()];case 9:if(P.sent(),l){L=function(t){var n=l.paths[t],r="";c&&c.paths&&c.paths[t]&&(r=c.paths[t]);var o=Array.isArray(n)?n:[n],a=Array.isArray(r)?r:[r],s=o.map(function(e,t){var n=a.length>t?a[t]:"";return{primaryPath:e,fallbackPath:n}});var u=true,d=false,h=undefined;try{var p=function(){var e=v.value;s.some(function(t){return t.fallbackPath===e})||s.push({primaryPath:o.length>0?o[0]:e,fallbackPath:e})};for(var f=a[Symbol.iterator](),v;!(u=(v=f.next()).done);u=true)p()}catch(e){d=true;h=e}finally{try{if(!u&&f.return!=null){f.return()}}finally{if(d){throw h}}}var g=true,m=false,y=undefined;try{for(var w=s[Symbol.iterator](),q;!(g=(q=w.next()).done);g=true){var k=q.value;var x=e.createElement("qti-interaction-module");k.fallbackPath&&x.setAttribute("fallback-path",k.fallbackPath),x.setAttribute("id",t),x.setAttribute("primary-path",k.primaryPath),b&&b.appendChild(x)}}catch(e){m=true;y=e}finally{try{if(!g&&w.return!=null){w.return()}}finally{if(m){throw y}}}};g.querySelector("qti-interaction-modules")===null?(b=e.createElement("qti-interaction-modules"),g.appendChild(b)):b=g.querySelector("qti-interaction-modules");for(var V in l.paths)L(V)}P.label=10;case 10:d=true;return[3,2];case 11:return[3,14];case 12:j=P.sent();h=true;p=j;return[3,14];case 13:try{if(!d&&f.return!=null){f.return()}}finally{if(h){throw p}}return[7];case 14:return[2]}})})()};var rg=function e(e,t,n){Array.from(e.getElementsByTagName("*")).filter(function(e){var n;return e.localName===t||((n=e.localName)===null||n===void 0?void 0:n.toLowerCase())===t.toLowerCase()}).forEach(function(e){var r="".concat(t,"-").concat(n),o=rb(e,r);e.replaceWith(o)})};var rm=function e(e,t){e.querySelectorAll("*").forEach(function(e){var n=e.classList;n&&n.forEach(function(n){if(n.startsWith("".concat(t,":"))){var r=n.slice("".concat(t,":").length),o="".concat(e.nodeName,"-").concat(r),a=rb(e,o);e.replaceWith(a)}})})};var rb=function e(e,t){var n=e.ownerDocument.createElement(t);var r=true,o=false,a=undefined;try{for(var s=e.attributes[Symbol.iterator](),l;!(r=(l=s.next()).done);r=true){var c=l.value;n.setAttribute(c.name,c.value)}}catch(e){o=true;a=e}finally{try{if(!r&&s.return!=null){s.return()}}finally{if(o){throw a}}}for(;e.firstChild;)n.appendChild(e.firstChild);return n};var ry=function e(e,t){var n=["hook","module"],r=t.substring(0,t.lastIndexOf("/"));var o=true,a=false,s=undefined;try{var l=function(){var n=u.value;e.querySelectorAll("["+n+"]").forEach(function(e){var o=e.getAttribute(n);!o.startsWith("data:")&&!o.startsWith("http")&&(e.setAttribute("base-url",t),e.setAttribute("module",r+"/"+encodeURI(o+(o.endsWith(".js")?"":".js"))))})};for(var c=n[Symbol.iterator](),u;!(o=(u=c.next()).done);o=true)l()}catch(e){a=true;s=e}finally{try{if(!o&&c.return!=null){c.return()}}finally{if(a){throw s}}}};var rw=function e(e){return s7.fromSeedKey(e)};var rq=function e(e){var t=0x6a09e667^e.length;for(var n=0;n<e.length;n++)t=Math.imul(t^e.charCodeAt(n),0xcc9e2d51),t=t<<13|t>>>19;return rx(t)};var rk=function e(e){var t=0x6a09e667^e.length;for(var n=0;n<e.length;n++)t=Math.imul(t^e[n],0xcc9e2d51),t=t<<13|t>>>19;return rx(t)};var rx=function e(e){var t=Math.imul(e^e>>>16,0x85ebca6b);return t=Math.imul(t^t>>>13,0xc2b2ae35),(t^t>>>16)>>>0};var r_=function e(e,t){var n=e.filter(function(e){return!e.fixed});for(var r=n.length-1;r>0;r--){var o=Math.floor(s9(t)*(r+1));var a;a=[n[o],n[r]],n[r]=a[0],n[o]=a[1],a}var s=0;return e.map(function(e){return e.fixed?e:n[s++]})};var rE=function e(e){switch(e){case"qti-choice-interaction":case"qti-order-interaction":return"qti-simple-choice";case"qti-inline-choice-interaction":return"qti-inline-choice";case"qti-match-interaction":return["qti-simple-match-set:first-of-type qti-simple-associable-choice","qti-simple-match-set:last-of-type > qti-simple-associable-choice"];case"qti-gap-match-interaction":return"qti-gap-text";case"qti-associate-interaction":return"qti-simple-associable-choice";default:return null}};var rC=function e(e,t){var n;var r,o;var a=e.querySelectorAll('[shuffle="true"]'),s=Array.from(a).filter(function(e){var t;return(t=e.tagName)===null||t===void 0?void 0:t.toLowerCase().endsWith("-interaction")}),l=t!=null&&"".concat(t).length>0,c=(n=(o=e.querySelector)===null||o===void 0?void 0:(r=o.call(e,"qti-assessment-item"))===null||r===void 0?void 0:r.getAttribute("identifier"))!==null&&n!==void 0?n:"",u=0;var d=true,h=false,p=undefined;try{for(var f=s[Symbol.iterator](),v;!(d=(v=f.next()).done);d=true){var g=v.value;var m;var b=(m=g.getAttribute("response-identifier"))!==null&&m!==void 0?m:"".concat(u);u++;var y=rE(g.tagName.toLowerCase()),w=Array.isArray(y)?y:[y],q=!1,k=0;var x=true,_=false,E=undefined;try{var C=function(){var e=R.value;if(!e)return"continue";var n=l?rw("".concat(t,":").concat(c,":").concat(b,":").concat(k)):Math.random;k++;var r=Array.from(g.querySelectorAll(e)).filter(function(e){return e.parentElement!==null});if(r.filter(function(e){return e.getAttribute("fixed")!=="true"}).length<=1){console.warn("Shuffling is not possible with fewer than 2 non-fixed elements.");return"continue"}var o=r[0].parentElement;if(!o||r.some(function(e){return e.parentElement!==o})){console.warn("Shuffling is not possible when choices do not share the same parent element.");return"continue"}var a=r[r.length-1].nextSibling,s=r_(r.map(function(e){return{element:e,fixed:e.getAttribute("fixed")==="true"}}),n);var u=true,d=false,h=undefined;try{for(var p=r[Symbol.iterator](),f;!(u=(f=p.next()).done);u=true){var v=f.value;v.remove()}}catch(e){d=true;h=e}finally{try{if(!u&&p.return!=null){p.return()}}finally{if(d){throw h}}}var m=true,y=false,w=undefined;try{for(var x=s[Symbol.iterator](),_;!(m=(_=x.next()).done);m=true){var E=_.value,C=E.element;o.insertBefore(C,a)}}catch(e){y=true;w=e}finally{try{if(!m&&x.return!=null){x.return()}}finally{if(y){throw w}}}q=!0};for(var S=w[Symbol.iterator](),R;!(x=(R=S.next()).done);x=true)C()}catch(e){_=true;E=e}finally{try{if(!x&&S.return!=null){S.return()}}finally{if(_){throw E}}}q&&g.removeAttribute("shuffle")}}catch(e){h=true;p=e}finally{try{if(!d&&f.return!=null){f.return()}}finally{if(h){throw p}}}};var rS=function e(e){e.querySelectorAll("qti-stylesheet").forEach(function(e){return e.remove()})};var rR=function e(e,t){le||(le=!0,console.warn("[".concat(e,'] No QTI_CONTEXT.seed provided; using "').concat(t,'" as deterministic fallback seed.')))};var rA=function e(e,t){return fetch(e,{signal:t}).then(function(e){if(!e.ok)throw new Error("HTTP error! status: ".concat(e.status));return e.text()}).then(function(e){return new DOMParser().parseFromString(e,"text/xml")}).catch(function(e){throw e.name==="AbortError"?e:new Error("Failed to load XML: ".concat(e.message))})};var rT=function e(e){return new DOMParser().parseFromString(e,"text/xml")};var rI=function e(e,t){var n=document.createDocumentFragment();for(var r=0;r<e.childNodes.length;r++)n.appendChild(lt(e.childNodes[r],document,t));return n};var rP=function e(e,t){t.endsWith("/")||(t+="/"),e.querySelectorAll("*").forEach(function(e){for(var n=0,r=["src","href","srcset","poster"];n<r.length;n++){var o=r[n];var a;var s=(a=e.getAttribute(o))===null||a===void 0?void 0:a.trim();if(s&&!/^(data:|https?:|blob:)/.test(s)){var l=t+encodeURI(s);e.setAttribute(o,l)}}})};var rO=function e(e){var t=[];return e.querySelectorAll("qti-assessment-item-ref").forEach(function(e){var n=e.getAttribute("identifier"),r=e.getAttribute("href"),o=e.getAttribute("category");t.push({identifier:n,href:r,category:o})}),t};var rM=function e(e){var t=[],n=[],r=function e(e){var o=true,a=false,s=undefined;try{for(var l=Array.from(e.children)[Symbol.iterator](),c;!(o=(c=l.next()).done);o=true){var u=c.value;lo(u)?t.push(u):la(u)?r(u):!lc(u)&&!lu(u)&&n.push(u.localName)}}catch(e){a=true;s=e}finally{try{if(!o&&l.return!=null){l.return()}}finally{if(a){throw s}}}};return r(e),{itemRefs:t,dropped:n}};var rN=function e(e,t){var n;if(t.length===0)return;var r=(n=e.getAttribute("identifier"))!==null&&n!==void 0?n:"(no identifier)";console.warn('[qtiTransformTest] Subsection "'.concat(r,'" is consumed by section ordering; discarding its ').concat(N(new Set(t)).join(", "),"."))};var rD=function e(e){return Array.from(e.getElementsByTagName("*")).some(function(e){return lc(e)&&ls(e,"shuffle")})};var rL=function e(e,t){var n=Array.from(e.getElementsByTagName("*")).filter(function(e){return la(e)});var r=true,o=false,a=undefined;try{for(var s=n[Symbol.iterator](),l;!(r=(l=s.next()).done);r=true){var c=l.value;if(!c.parentNode)continue;var u=c.parentElement;u&&la(u)||lp(c,t)}}catch(e){o=true;a=e}finally{try{if(!r&&s.return!=null){s.return()}}finally{if(o){throw a}}}};var rU=function e(){return c6||(c6=new CSSStyleSheet,c6.replaceSync("\n ::highlight(".concat(c5,") { background-color: #dbeafe; color: inherit; }\n ::highlight(").concat(c4,") { background-color: #ffe066; color: inherit; }\n "))),c6};var rj=function e(e,t){var o,a,c;var u=/*#__PURE__*/function(e){"use strict";v(n,e);function n(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}l(this,n);var c;c=s(this,n,N(t));iU(c,a);iU(c,o);c.identifier="",c.tabIndex=0,c.disabled=!1,c.readonly=!1,ij(c,o,null),c.internals=c.attachInternals();return c}d(n,[{key:"handleDisabledChange",value:function e(e,t){t?(this.internals.ariaDisabled="true",this.internals.states.add("disabled"),this.blur()):(this.internals.ariaDisabled=null,this.internals.states.delete("disabled")),this.tabIndex=t?-1:0}},{key:"handleReadonlyChange",value:function e(e,t){t?(this.internals.ariaReadOnly="true",this.internals.states.add("readonly")):(this.internals.ariaReadOnly=null,this.internals.states.delete("readonly"))}},{key:"willUpdate",value:function e(e){p(f(n.prototype),"willUpdate",this).call(this,e),iz(this,a,c).call(this)}},{key:"connectedCallback",value:function e(){p(f(n.prototype),"connectedCallback",this).call(this),this.internals.ariaChecked="false",this.disabled&&(this.internals.ariaDisabled="true",this.internals.states.add("disabled"),this.tabIndex=-1),this.readonly&&(this.internals.ariaReadOnly="true",this.internals.states.add("readonly")),this.addEventListener("keyup",this._onKeyUp),this.addEventListener("click",this._onClick),this.dispatchEvent(new CustomEvent("register-".concat(t),{bubbles:!0,composed:!0}))}},{key:"disconnectedCallback",value:function e(){p(f(n.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("keyup",this._onKeyUp),this.removeEventListener("click",this._onClick),this.dispatchEvent(new CustomEvent("unregister-".concat(t),{bubbles:!0,composed:!0}))}},{key:"_onKeyUp",value:function e(e){e.altKey||(e.code==="Space"||e.code==="Enter")&&(e.preventDefault(),this._activate())}},{key:"_onClick",value:function e(){this.disabled||this.readonly||(this.focus(),this._activate())}},{key:"_activate",value:function e(){this.disabled||this.readonly||this.dispatchEvent(new CustomEvent("activate-".concat(t),{bubbles:!0,composed:!0,detail:{identifier:this.identifier}}))}},{key:"render",value:function e(){return o5(V())}}]);return n}(e);return o=new WeakMap,a=new WeakSet,c=function e(){var e;var t;var n=(e=(t=this._interactionContext)===null||t===void 0?void 0:t.choiceRole)!==null&&e!==void 0?e:null;n!==iL(this,o)&&(iL(this,o)&&this.internals.states.delete(iL(this,o)),ij(this,o,n),this.internals.role=n,n&&this.internals.states.add(n))},pG([n({type:String})],u.prototype,"identifier",void 0),pG([n({type:Number,reflect:!0,attribute:"tabindex"})],u.prototype,"tabIndex",void 0),pG([n({type:Boolean,attribute:"aria-disabled",converter:pX})],u.prototype,"disabled",void 0),pG([n({type:Boolean,attribute:"aria-readonly",converter:pX})],u.prototype,"readonly",void 0),pG([m({context:az,subscribe:!0}),r()],u.prototype,"_interactionContext",void 0),pG([O("disabled",{waitUntilFirstUpdate:!0})],u.prototype,"handleDisabledChange",null),pG([O("readonly",{waitUntilFirstUpdate:!0})],u.prototype,"handleReadonlyChange",null),u};var rz=function e(e,t,n,r){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{};var a,s;var l;var c=(a=o.publishWidth)!==null&&a!==void 0?a:!0,u=(s=o.hostWindow)!==null&&s!==void 0?s:(typeof window==="undefined"?"undefined":D(window))<"u"?window:null;if(!t.length||!n.length||!u)return;var d=0,h=0,p=r.length?r:[e],f=p.map(function(e){return{el:e,reservation:e.style.getPropertyValue("--qti-drag-min-width"),hadStyleAttribute:e.hasAttribute("style")}});p.forEach(function(e){return e.style.setProperty("--qti-drag-min-width","0px")}),t.forEach(function(e){var t=e.getBoundingClientRect();d=Math.max(d,t.height),h=Math.max(h,t.width)}),f.forEach(function(e){var t=e.el,n=e.reservation,r=e.hadStyleAttribute;n?t.style.setProperty("--qti-drag-min-width",n):t.style.removeProperty("--qti-drag-min-width"),!r&&t.getAttribute("style")===""&&t.removeAttribute("style")}),((l=o.hasChanged)===null||l===void 0?void 0:l.call(o,{height:d,width:h}))!==!1&&(e.style.setProperty("--qti-dropzone-min-height","".concat(d,"px")),c&&(e.style.setProperty("--qti-dropzone-min-width","".concat(h,"px")),e.style.setProperty("--qti-drag-min-width","".concat(h,"px"))),r.forEach(function(e){e.style.minHeight="var(--qti-drag-container-min-height, ".concat(d,"px)"),e.style.setProperty("--qti-dropzone-min-height","".concat(d,"px")),c&&(e.style.setProperty("--qti-dropzone-min-width","".concat(h,"px")),e.style.setProperty("--qti-drag-min-width","".concat(h,"px")))}))};var rV=function e(){return typeof globalThis.Observable=="function"};var rW=function e(){Object.defineProperties(globalThis,{Observable:{value:fD,configurable:!0,writable:!0},Subscriber:{value:fL,configurable:!0,writable:!0}}),EventTarget.prototype.when=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(fO()&&!fP(document))return;var n=this;return new fD(function(r){if(!n||r.signal.aborted)return;var o=function e(e){r.next(e)};n.addEventListener(e,o,{capture:t.capture||!1,passive:t.passive,once:!1,signal:r.signal})})}};var rF=function e(e,t,n){var r=e.filter(function(e){return!e.hasAttribute("disabled")});var o=true,a=false,s=undefined;try{for(var l=r[Symbol.iterator](),c;!(o=(c=l.next()).done);o=true){var u=c.value;var d=u.getBoundingClientRect();if(t>=d.left&&t<=d.right&&n>=d.top&&n<=d.bottom)return u}}catch(e){a=true;s=e}finally{try{if(!o&&l.return!=null){l.return()}}finally{if(a){throw s}}}return null};var rB=function e(e,t,n,r){if(!r)return null;var o=e.filter(function(e){return!e.hasAttribute("disabled")}),a=r.getBoundingClientRect();var s=true,l=false,c=undefined;try{for(var u=o[Symbol.iterator](),d;!(s=(d=u.next()).done);s=true){var h=d.value;var p=h.getBoundingClientRect();if(!(a.right<p.left||a.left>p.right||a.bottom<p.top||a.top>p.bottom))return h}}catch(e){l=true;c=e}finally{try{if(!s&&u.return!=null){u.return()}}finally{if(l){throw c}}}return null};var r$=function e(e,t,n,r){var o=e.filter(function(e){return!e.hasAttribute("disabled")});if(o.length===0)return null;var a,s;if(r){var l=r.getBoundingClientRect();a=l.left+l.width/2,s=l.top+l.height/2}else a=t,s=n;var c=null,u=1/0;var d=true,h=false,p=undefined;try{for(var f=o[Symbol.iterator](),v;!(d=(v=f.next()).done);d=true){var g=v.value;var m=g.getBoundingClientRect(),b=m.left+m.width/2,y=m.top+m.height/2,w=Math.sqrt(Math.pow(a-b,2)+Math.pow(s-y,2));w<u&&(u=w,c=g)}}catch(e){h=true;p=e}finally{try{if(!d&&f.return!=null){f.return()}}finally{if(h){throw p}}}return c};var rH=function e(e,t,n,r){var o=e.filter(function(e){return!e.hasAttribute("disabled")});if(o.length===0)return null;var a;if(r){var s=r.getBoundingClientRect();a=[{x:s.left,y:s.top},{x:s.right,y:s.top},{x:s.left,y:s.bottom},{x:s.right,y:s.bottom}]}else a=[{x:t,y:n},{x:t,y:n},{x:t,y:n},{x:t,y:n}];var l=null,c=1/0;var u=true,d=false,h=undefined;try{for(var p=o[Symbol.iterator](),f;!(u=(f=p.next()).done);u=true){var v=f.value;var g=v.getBoundingClientRect(),m=[{x:g.left,y:g.top},{x:g.right,y:g.top},{x:g.left,y:g.bottom},{x:g.right,y:g.bottom}],b=0,y=0;var w=true,q=false,k=undefined,x=true,_=false,E=undefined;try{for(var C=a[Symbol.iterator](),S;!(x=(S=C.next()).done);x=true){var R=S.value;try{for(var A=m[Symbol.iterator](),T;!(w=(T=A.next()).done);w=true){var I=T.value;var P=Math.sqrt(Math.pow(R.x-I.x,2)+Math.pow(R.y-I.y,2));b+=P,y++}}catch(e){q=true;k=e}finally{try{if(!w&&A.return!=null){A.return()}}finally{if(q){throw k}}}}}catch(e){_=true;E=e}finally{try{if(!x&&C.return!=null){C.return()}}finally{if(_){throw E}}}var O=b/y;O<c&&(c=O,l=v)}}catch(e){d=true;h=e}finally{try{if(!u&&p.return!=null){p.return()}}finally{if(d){throw h}}}return l};var rQ=function e(e,t,n,r,o){var a=o&&o.length>0?e.filter(function(e){return o.includes(e)}):e.filter(function(e){var t;return e.tagName==="SLOT"&&e.hasAttribute("part")&&((t=e.getAttribute("part"))===null||t===void 0?void 0:t.includes("drags"))}),s=e.filter(function(e){return!a.includes(e)});if(a.length===0&&s.length===0)return null;var l;if(r){var c=r.getBoundingClientRect();l=[{x:c.left,y:c.top},{x:c.right,y:c.top},{x:c.left,y:c.bottom},{x:c.right,y:c.bottom}]}else l=[{x:t,y:n},{x:t,y:n},{x:t,y:n},{x:t,y:n}];var u=function e(e){var t=e.getBoundingClientRect(),n=[{x:t.left,y:t.top},{x:t.right,y:t.top},{x:t.left,y:t.bottom},{x:t.right,y:t.bottom}],r=0,o=0;var a=true,s=false,c=undefined,u=true,d=false,h=undefined;try{for(var p=l[Symbol.iterator](),f;!(u=(f=p.next()).done);u=true){var v=f.value;try{for(var g=n[Symbol.iterator](),m;!(a=(m=g.next()).done);a=true){var b=m.value;var y=Math.sqrt(Math.pow(v.x-b.x,2)+Math.pow(v.y-b.y,2));r+=y,o++}}catch(e){s=true;c=e}finally{try{if(!a&&g.return!=null){g.return()}}finally{if(s){throw c}}}}}catch(e){d=true;h=e}finally{try{if(!u&&p.return!=null){p.return()}}finally{if(d){throw h}}}return r/o},d=null,h=1/0;var p=true,f=false,v=undefined;try{for(var g=a[Symbol.iterator](),m;!(p=(m=g.next()).done);p=true){var b=m.value;var y=u(b);y<h&&(h=y,d=b)}}catch(e){f=true;v=e}finally{try{if(!p&&g.return!=null){g.return()}}finally{if(f){throw v}}}var w=null,q=1/0;var k=true,x=false,_=undefined;try{for(var E=s[Symbol.iterator](),C;!(k=(C=E.next()).done);k=true){var S=C.value;var R=u(S);R<q&&(q=R,w=S)}}catch(e){x=true;_=e}finally{try{if(!k&&E.return!=null){E.return()}}finally{if(x){throw _}}}if(d&&r){var A=r.getBoundingClientRect(),T=d.getBoundingClientRect(),I=A.left+A.width/2,P=A.top+A.height/2;if(I>=T.left&&I<=T.right&&P>=T.top&&P<=T.bottom)return d}var O=(r===null||r===void 0?void 0:r.getAttribute("data-drag-origin"))==="droppable"?.85:1.5;return d&&w?h<=q*O?d:w:d||w};var rG=function e(e){switch(e){case"pointerWithin":return rF;case"rectangleIntersection":return rB;case"closestCenter":return r$;case"closestCorners":return rH;case"closestCornersWithInventoryPriority":return rQ;default:return rF}};var rX=function e(e,t,n,r){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"pointerWithin",a=arguments.length>5?arguments[5]:void 0;return rG(o)(e,t,n,r,a)};var rK=function e(e,t){var n=e.composedPath?e.composedPath():[e.target];var r=true,o=false,a=undefined;try{for(var s=n[Symbol.iterator](),l;!(r=(l=s.next()).done);r=true){var c=l.value;if(g(c,HTMLElement)&&c.tagName!=="SLOT"){if(c.matches(t)||c.hasAttribute("qti-draggable"))return c;var u=c.closest(t)||c.closest('[qti-draggable="true"]');if(u)return u}}}catch(e){o=true;a=e}finally{try{if(!r&&s.return!=null){s.return()}}finally{if(o){throw a}}}return null};var rY=function e(e){var t;var n,r;return e?e.hasAttribute("disabled")?!0:(t=(r=e.internals)===null||r===void 0?void 0:(n=r.states)===null||n===void 0?void 0:n.has("disabled"))!==null&&t!==void 0?t:!1:!1};var rJ=function e(e,t,n){var r;var o=(r=fU(e))===null||r===void 0?void 0:r.states;o&&(n?o.add(t):o.delete(t))};var rZ=function e(e,t){var n;var r,o;return(n=(o=fU(e))===null||o===void 0?void 0:(r=o.states)===null||r===void 0?void 0:r.has(t))!==null&&n!==void 0?n:!1};var r0=function e(e){rJ(e,"dragging",!1),rJ(e,"placeholder",!1),rJ(e,"return-anchor",!1)};var r1=function e(e){return rZ(e,"dragging")||rZ(e,"placeholder")};var r3=function e(e,t,n){var r;var o;if(!e)return;n?e.setAttribute(t,""):e.removeAttribute(t);var a=(o=fU(e))===null||o===void 0?void 0:o.states;if(a){n?a.add(t):a.delete(t);return}var s=new Set(((r=e.getAttribute("part"))!==null&&r!==void 0?r:"").split(/\s+/).filter(Boolean));s.has("drop")&&(n?s.add(t):s.delete(t),e.setAttribute("part",N(s).join(" ")))};var r2=function e(e,t){r3(e,"filled",t)};var r5=function e(e,t){var n=[];return e.forEach(function(e){var r;var o=[];e.tagName.toLowerCase()==="slot"?o=e.assignedElements({flatten:!0}).filter(function(e){return e.getAttribute("identifier")===t}):o=Array.from(e.querySelectorAll('[identifier="'.concat(t,'"]'))),(r=n).push.apply(r,N(o))}),n};var r4=function e(e,t){var n=e.find(function(e){return e.getAttribute("identifier")===t});if(!n)return 1;var r=n.getAttribute("match-max");return r?parseInt(r,10)||0:1};var r6=function e(e){!e||fQ.has(e)||(e.addEventListener("touchmove",function(){},{capture:!1,passive:!1}),fQ.add(e))};var r8=function e(e){var t=e.getBoundingClientRect();return{left:t.left,top:t.top,width:t.width,height:t.height}};var r7=function e(e){return{left:e.left,top:e.top,width:e.width,height:e.height}};var r9=function e(e){var t=new Map;return e.forEach(function(e){t.set(e,r8(e))}),t};var ie=function e(e,t){return{deltaX:e.left-t.left,deltaY:e.top-t.top,deltaW:e.width/t.width,deltaH:e.height/t.height}};var it=function e(e){if((typeof window==="undefined"?"undefined":D(window))<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return 0;if(!e)return 1;var t=getComputedStyle(e).getPropertyValue("--qti-motion").trim();if(t==="")return 1;var n=Number.parseFloat(t);return Number.isFinite(n)&&n>0?n:0};var ir=function e(e){return it(e)>0};var ii=function e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=it(e);if(r<=0)return null;var o=r8(e),a=ie(t,o),s=a.deltaX,l=a.deltaY,c=a.deltaW,u=a.deltaH;if(s===0&&l===0&&c===1&&u===1)return null;var d=k({},fK,n),h=d.duration,p=d.easing,f=d.fill;return e.animate([{transformOrigin:"top left",transform:"translate(".concat(s,"px, ").concat(l,"px) scale(").concat(c,", ").concat(u,")")},{transformOrigin:"top left",transform:"none"}],{duration:h*r,easing:p,fill:f})};var io=function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var n=new Map;return e.forEach(function(e,r){if(!g(r,HTMLElement))return;var o=ii(r,e,t);o&&n.set(r,o)}),n};var ia=function e(){return{placeholder:null,lastHoverTarget:null,lastPlacement:null,sortContainer:null}};var is=function e(e){var t;(t=e.placeholder)===null||t===void 0?void 0:t.remove(),e.placeholder=null,e.lastHoverTarget=null,e.lastPlacement=null,e.sortContainer=null};var il=function e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=k({},f1,n),o=document.createElement("div");return o.setAttribute("data-drop-placeholder","true"),o.style.width="".concat(t.width,"px"),o.style.height="".concat(t.height,"px"),o.style.margin=window.getComputedStyle(e).margin,o.style.boxSizing="border-box",o.style.border="".concat(r.borderStyle," ").concat(r.borderColor),o.style.borderRadius=getComputedStyle(e).borderRadius,o.style.background=r.background,o.style.transition="transform ".concat(r.transitionDuration*it(e),"ms ease"),o.style.pointerEvents="none",o};var ic=function e(e,t){var n=true,r=false,o=undefined;try{for(var a=t[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;if(l.contains(e)&&l!==e)return l}}catch(e){r=true;o=e}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(r){throw o}}}return null};var iu=function e(e,t,n,r){var o=n.getAttribute("width")?parseFloat(n.getAttribute("width")):n.naturalWidth,a=n.getAttribute("height")?parseFloat(n.getAttribute("height")):n.naturalHeight;switch(e){case"circle":{if(t.length!==3){console.error("Invalid circle coordinates:",t);return}var s=I(t,3),l=s[0],c=s[1],u=s[2],d=l/o*100,h=c/a*100,p=u/o*100,f=u/a*100;r.style.left=d-p+"%",r.style.top=h-f+"%",r.style.width=2*p+"%",r.style.height=2*f+"%",r.style.borderRadius="50%"}break;case"rect":{if(t.length!==4){console.error("Invalid rectangle coordinates:",t);return}var v=I(t,4),g=v[0],m=v[1],b=v[2],y=v[3],w=g/o*100,q=m/a*100,k=b/o*100,x=y/a*100;r.style.left=w+"%",r.style.top=q+"%",r.style.width=k-w+"%",r.style.height=x-q+"%"}break;case"ellipse":{if(t.length!==4){console.error("Invalid ellipse coordinates:",t);return}var _=I(t,4),E=_[0],C=_[1],S=_[2],R=_[3],A=E/o*100,T=C/a*100,P=S/o*100,O=R/a*100;r.style.left=A-P+"%",r.style.top=T-O+"%",r.style.width=2*P+"%",r.style.height=2*O+"%",r.style.borderRadius="50%"}break;case"poly":{var M,D,L,U;if(t.length<6||t.length%2!==0){console.error("Invalid polygon coordinates:",t);return}var j=[];for(var z=0;z<t.length;z+=2)j.push({x:t[z],y:t[z+1]});var V=(M=Math).min.apply(M,N(j.map(function(e){return e.x}))),W=(D=Math).max.apply(D,N(j.map(function(e){return e.x}))),F=(L=Math).min.apply(L,N(j.map(function(e){return e.y}))),B=(U=Math).max.apply(U,N(j.map(function(e){return e.y}))),$=V/o*100,H=F/a*100,Q=W/o*100,G=B/a*100;r.style.left=$+"%",r.style.top=H+"%",r.style.width=Q-$+"%",r.style.height=G-H+"%";var X=j.map(function(e){return{x:(e.x-V)/(W-V)*100,y:(e.y-F)/(B-F)*100}}),K=X.map(function(e){return"".concat(e.x,"% ").concat(e.y,"%")}).join(",");r.style.clipPath="polygon(".concat(K,")");var Y=X.map(function(e){return"".concat(e.x,",").concat(e.y)}).join(" "),J=function e(e){return'url("data:image/svg+xml,'.concat(encodeURIComponent("<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'><polygon points='".concat(Y,"' fill='none' stroke='black' stroke-width='").concat(e,"' vector-effect='non-scaling-stroke' stroke-linejoin='round'/></svg>")),'")')};r.style.setProperty("--qti-shape-outline",J(4)),r.style.setProperty("--qti-shape-outline-bold",J(8))}break;default:console.error("Unsupported shape: ".concat(e));break}};var id=function e(e){return e==null?!1:Array.isArray(e)?e.length>0:e!==""};var ih=function e(e){return /*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"calculateChildren",value:function e(e){return e.map(function(e){var t=e;if(!t.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;var n=t.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(e){return typeof e=="boolean"&&e})}}]);return t}(e)};var ip=function e(e){return /*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"calculateChildren",value:function e(e){var t=e.map(function(e){if(!e.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;var t=e.calculate();return Number.isNaN(t)?(console.error("Unexpected value in qti-subtract, expected number"),null):Number(t)});return t.some(function(e){return e===null})?(console.error("One or more child expressions returned invalid values"),0):t[0]-t[1]}}]);return t}(e)};var iv=function e(e){if(e.length===0)return new Set;var t=new Array(e.length).fill(1),n=new Array(e.length).fill(-1);for(var r=0;r<e.length;r++)for(var o=0;o<r;o++)e[o]<e[r]&&t[o]+1>t[r]&&(t[r]=t[o]+1,n[r]=o);var a=0;for(var s=1;s<e.length;s++)t[s]>t[a]&&(a=s);var l=new Set;for(var c=a;c!==-1;c=n[c])l.add(c);return l};var ig=function e(e,t){var n=new Map(t.map(function(e,t){return[e,t]})),r=e.filter(function(e){return n.has(e)}),o=r.map(function(e){return n.get(e)}),a=iv(o),s=new Set;return a.forEach(function(e){return s.add(r[e])}),s};var im,ib,iy,iw,iq,ik,ix,i_,iE,iC;var iS;var iR=Object.defineProperty;var iA=Object.getOwnPropertyDescriptor;var iT=Object.getOwnPropertyNames;var iI=Object.prototype.hasOwnProperty;var iP=function e(e){throw TypeError(e)};var iO=function e(e,t){for(var n in t)iR(e,n,{get:t[n],enumerable:!0})},iM=function e(e,t,n,r){var o=true,a=false,s=undefined;if(t&&(typeof t==="undefined"?"undefined":D(t))=="object"||typeof t=="function")try{var l=function(){var o=u.value;!iI.call(e,o)&&o!==n&&iR(e,o,{get:function e(){return t[o]},enumerable:!(r=iA(t,o))||r.enumerable})};for(var c=iT(t)[Symbol.iterator](),u;!(o=(u=c.next()).done);o=true)l()}catch(e){a=true;s=e}finally{try{if(!o&&c.return!=null){c.return()}}finally{if(a){throw s}}}return e};var iN=function e(e){return iM(iR({},"__esModule",{value:!0}),e)};var iD=function e(e,t,n){return t.has(e)||iP("Cannot "+n)};var iL=function e(e,t,n){return iD(e,t,"read from private field"),n?n.call(e):t.get(e)},iU=function e(e,t,n){return t.has(e)?iP("Cannot add the same private member more than once"):g(t,WeakSet)?t.add(e):t.set(e,n)},ij=function e(e,t,n,r){return iD(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n},iz=function e(e,t,n){return iD(e,t,"access private method"),n};var iV=function e(e,t,n,r){return{set _(i){ij(e,t,i,n)},get _(){return iL(e,t,r)}}};var iW={};iO(iW,{CandidateCorrectionMixin:function e(){return xG},ChoiceCorrectionMixin:function e(){return xX},CorrectResponseMixin:function e(){return x$},Correctness:function e(){return xB},INITIAL_SESSION_CONTEXT:function e(){return aQ},INITIAL_TEST_CONTEXT:function e(){return aX},Interaction:function e(){return a2},IsNullOrUndefined:function e(){return b},ItemContainer:function e(){return pt},ItemCorrectResponseMode:function e(){return _u},ItemPrintVariables:function e(){return pi},ItemShowCandidateCorrection:function e(){return _k},ItemShowCorrectResponse:function e(){return _T},QtiAnd:function e(){return qq},QtiAnyN:function e(){return qx},QtiAssessmentItem:function e(){return s4},QtiAssessmentItemCorrection:function e(){return x8},QtiAssessmentItemRef:function e(){return ak},QtiAssessmentSection:function e(){return su},QtiAssessmentStimulusRef:function e(){return lb},QtiAssessmentStimulusRefConnectedEvent:function e(){return lm},QtiAssessmentTest:function e(){return sp},QtiAssociableHotspot:function e(){return pD},QtiAssociateInteraction:function e(){return ve},QtiAssociateInteractionCorrection:function e(){return _j},QtiBaseValue:function e(){return qE},QtiChoiceInteraction:function e(){return vd},QtiChoiceInteractionCorrection:function e(){return _z},QtiCompanionMaterialsInfo:function e(){return ly},QtiConditionExpression:function e(){return a7},QtiContainerSize:function e(){return qC},QtiContains:function e(){return qS},QtiContentBody:function e(){return l_},QtiContextDeclaration:function e(){return lS},QtiCorrect:function e(){return qR},QtiCustomInteraction:function e(){return vT},QtiCustomOperator:function e(){return lT},QtiDefault:function e(){return qT},QtiDelete:function e(){return qI},QtiDivide:function e(){return qM},QtiDurationGte:function e(){return qU},QtiDurationLt:function e(){return qW},QtiEndAttemptInteraction:function e(){return vN},QtiEqual:function e(){return qH},QtiEqualRounded:function e(){return qB},QtiExpression:function e(){return a8},QtiExtendedTextInteraction:function e(){return vQ},QtiExtendedTextInteractionCorrection:function e(){return _F},QtiFeedback:function e(){return si},QtiFeedbackBlock:function e(){return lP},QtiFeedbackInline:function e(){return lN},QtiFieldValue:function e(){return qQ},QtiGap:function e(){return pV},QtiGapImg:function e(){return pH},QtiGapMatchInteraction:function e(){return vY},QtiGapMatchInteractionCorrection:function e(){return _$},QtiGapText:function e(){return pZ},QtiGapTextCorrection:function e(){return xJ},QtiGcd:function e(){return qY},QtiGraphicAssociateInteraction:function e(){return v9},QtiGraphicAssociateInteractionCorrection:function e(){return _Q},QtiGraphicGapMatchInteraction:function e(){return ga},QtiGraphicGapMatchInteractionCorrection:function e(){return _G},QtiGraphicOrderInteraction:function e(){return gv},QtiGraphicOrderInteractionCorrection:function e(){return _X},QtiGt:function e(){return qJ},QtiGte:function e(){return qZ},QtiHotspotChoice:function e(){return p5},QtiHotspotChoiceCorrection:function e(){return x0},QtiHotspotInteraction:function e(){return gx},QtiHotspotInteractionCorrection:function e(){return _K},QtiHottext:function e(){return p7},QtiHottextCorrection:function e(){return x3},QtiHottextInteraction:function e(){return gS},QtiHottextInteractionCorrection:function e(){return _Y},QtiIndex:function e(){return q2},QtiInlineChoice:function e(){return fa},QtiInlineChoiceInteraction:function e(){return g0},QtiInlineChoiceInteractionCorrection:function e(){return _J},QtiInside:function e(){return kn},QtiIntegerDivide:function e(){return ko},QtiIntegerModulus:function e(){return kl},QtiIntegerToFloat:function e(){return kc},QtiIsNull:function e(){return ku},QtiItem:function e(){return ph},QtiItemBody:function e(){return lU},QtiItemCorrection:function e(){return _t},QtiLcm:function e(){return kv},QtiLookupOutcomeValue:function e(){return kb},QtiLt:function e(){return ky},QtiLte:function e(){return kw},QtiMapResponse:function e(){return k_},QtiMapResponsePoint:function e(){return kk},QtiMatch:function e(){return kE},QtiMatchInteraction:function e(){return g6},QtiMatchInteractionCorrection:function e(){return _0},QtiMathOperator:function e(){return kA},QtiMax:function e(){return kP},QtiMediaInteraction:function e(){return mt},QtiMember:function e(){return kO},QtiMin:function e(){return kD},QtiModalFeedback:function e(){return lz},QtiMultiple:function e(){return kL},QtiNot:function e(){return kU},QtiNull:function e(){return kj},QtiOr:function e(){return kz},QtiOrderInteraction:function e(){return ms},QtiOrderInteractionCorrection:function e(){return _1},QtiOrdered:function e(){return kV},QtiOutcomeDeclaration:function e(){return lF},QtiOutcomeProcessing:function e(){return sv},QtiOutcomeProcessingProcessor:function e(){return sg},QtiPatternMatch:function e(){return kF},QtiPortableCustomInteraction:function e(){return mU},QtiPortableCustomInteractionCorrection:function e(){return _3},QtiPositionObjectInteraction:function e(){return mB},QtiPositionObjectStage:function e(){return mQ},QtiPower:function e(){return kB},QtiPrintedVariable:function e(){return kH},QtiProduct:function e(){return kQ},QtiPrompt:function e(){return fu},QtiRandom:function e(){return kK},QtiRandomInteger:function e(){return kX},QtiRepeat:function e(){return k1},QtiResponseCondition:function e(){return k3},QtiResponseDeclaration:function e(){return lK},QtiResponseElse:function e(){return k2},QtiResponseElseIf:function e(){return k4},QtiResponseIf:function e(){return k5},QtiResponseProcessing:function e(){return l2},QtiRound:function e(){return xt},QtiRoundTo:function e(){return xe},QtiRubricBlock:function e(){return l6},QtiRuleElement:function e(){return so},QtiSelectPointInteraction:function e(){return bt},QtiSelectPointInteractionCorrection:function e(){return _6},QtiSetCorrectResponse:function e(){return xo},QtiSetCorrectResponseRule:function e(){return xl},QtiSetOutcomeValue:function e(){return xd},QtiSetOutcomeValueRule:function e(){return xh},QtiSetTemplateValue:function e(){return xg},QtiSetTemplateValueRule:function e(){return xy},QtiSimpleAssociableChoice:function e(){return fv},QtiSimpleAssociableChoiceCorrection:function e(){return x5},QtiSimpleChoice:function e(){return fw},QtiSimpleChoiceCorrection:function e(){return x6},QtiSliderInteraction:function e(){return bf},QtiSliderInteractionCorrection:function e(){return _9},QtiStatsOperator:function e(){return x_},QtiStringMatch:function e(){return xC},QtiStylesheet:function e(){return ce},QtiSubstring:function e(){return xR},QtiSubtract:function e(){return xA},QtiSum:function e(){return xT},QtiSumExpression:function e(){return xI},QtiTemplateConstraint:function e(){return ct},QtiTemplateDeclaration:function e(){return cc},QtiTemplateProcessing:function e(){return ch},QtiTest:function e(){return cI},QtiTestCorrection:function e(){return _o},QtiTestFeedback:function e(){return cv},QtiTestPart:function e(){return cb},QtiTestVariables:function e(){return cq},QtiTestVariablesExpression:function e(){return ck},QtiTextEntryInteraction:function e(){return bx},QtiTextEntryInteractionCorrection:function e(){return Et},QtiTruncate:function e(){return xP},QtiUploadInteraction:function e(){return bP},QtiVariable:function e(){return xO},QtiVariableDeclaration:function e(){return a5},ScoringHelper:function e(){return sa},TestCheckItem:function e(){return cL},TestCheckItemCorrection:function e(){return _a},TestContainer:function e(){return cY},TestEndAttempt:function e(){return cZ},TestItemLink:function e(){return c3},TestItemToSpeech:function e(){return uI},TestNavigation:function e(){return uX},TestNavigationCorrection:function e(){return _i},TestNext:function e(){return uZ},TestPagingButtonsStamp:function e(){return hm},TestPrev:function e(){return hw},TestPrintContext:function e(){return hk},TestPrintVariables:function e(){return hE},TestScoringButtons:function e(){return hA},TestScoringFeedback:function e(){return hI},TestSectionButtonsStamp:function e(){return hM},TestSectionLink:function e(){return hj},TestShowCorrectResponse:function e(){return _L},TestStamp:function e(){return hV},TestTtsNext:function e(){return uj},TestTtsPause:function e(){return uN},TestTtsPlay:function e(){return uM},TestTtsPrev:function e(){return uU},TestTtsResume:function e(){return uD},TestTtsStop:function e(){return uL},TestView:function e(){return hQ},TestViewToggle:function e(){return hX},asSeed:function e(){return a$},boxSizing:function e(){return aY},computedContext:function e(){return aU},computedItemContext:function e(){return aL},configContext:function e(){return aj},convertNumberToUniversalFormat:function e(){return se},correctionPart:function e(){return xH},decimalSeparator:function e(){return a9},dropRegion:function e(){return aJ},getItemByUri:function e(){return qw},getManifestInfo:function e(){return qy},interactionContext:function e(){return az},isSeed:function e(){return aB},itemContext:function e(){return aV},itemContextVariables:function e(){return aW},iterResponseValues:function e(){return x},parsePair:function e(){return C},parsePoint:function e(){return R},parseResponseAttribute:function e(){return w},qtiAndMixin:function e(){return ih},qtiContext:function e(){return aH},qtiInteractionElements:function e(){return bM},qtiSubtractMixin:function e(){return ip},qtiTransformItem:function e(){return ln},qtiTransformManifest:function e(){return lr},qtiTransformTest:function e(){return lf},removeDoubleSlashes:function e(){return y},responseAttributeConverter:function e(){return P},serializePair:function e(){return S},serializePoint:function e(){return T},serializeResponseAttribute:function e(){return q},sessionContext:function e(){return aG},testContext:function e(){return aK},ttsContext:function e(){return c8},validationMessage:function e(){return aZ}});var iF=/*#__PURE__*/function(){"use strict";function e(t){l(this,e);this.ariaActiveDescendantElement=null,this.ariaAtomic="",this.ariaAutoComplete="",this.ariaBrailleLabel="",this.ariaBrailleRoleDescription="",this.ariaBusy="",this.ariaChecked="",this.ariaColCount="",this.ariaColIndex="",this.ariaColIndexText="",this.ariaColSpan="",this.ariaControlsElements=null,this.ariaCurrent="",this.ariaDescribedByElements=null,this.ariaDescription="",this.ariaDetailsElements=null,this.ariaDisabled="",this.ariaErrorMessageElements=null,this.ariaExpanded="",this.ariaFlowToElements=null,this.ariaHasPopup="",this.ariaHidden="",this.ariaInvalid="",this.ariaKeyShortcuts="",this.ariaLabel="",this.ariaLabelledByElements=null,this.ariaLevel="",this.ariaLive="",this.ariaModal="",this.ariaMultiLine="",this.ariaMultiSelectable="",this.ariaOrientation="",this.ariaOwnsElements=null,this.ariaPlaceholder="",this.ariaPosInSet="",this.ariaPressed="",this.ariaReadOnly="",this.ariaRelevant="",this.ariaRequired="",this.ariaRoleDescription="",this.ariaRowCount="",this.ariaRowIndex="",this.ariaRowIndexText="",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=t}d(e,[{key:"shadowRoot",get:function e(){return this.__host.__shadowRoot}},{key:"checkValidity",value:function e(){return console.warn("`ElementInternals.checkValidity()` was called on the server.This method always returns true."),!0}},{key:"reportValidity",value:function e(){return!0}},{key:"setFormValue",value:function e(){}},{key:"setValidity",value:function e(){}}]);return e}();var iB=function e(e,t,n,r,o){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?o.call(e,n):o?o.value=n:t.set(e,n),n},i$=function e(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},iH,iQ,iG,iX,iK,iY,iJ,iZ,i0,i1,i3,i2,i5=function e(e){var t;return typeof e=="boolean"?e:(t=e===null||e===void 0?void 0:e.capture)!==null&&t!==void 0?t:!1};var i4=/*#__PURE__*/function(){"use strict";function e(){l(this,e);this.__eventListeners=new Map,this.__captureEventListeners=new Map}d(e,[{key:"addEventListener",value:function e(e,t,n){var r=this;var o;if(t==null)return;var a=i5(n)?this.__captureEventListeners:this.__eventListeners,s=a.get(e);if(s===void 0)s=new Map,a.set(e,s);else if(s.has(t))return;var l=(typeof n==="undefined"?"undefined":D(n))=="object"&&n?n:{};(o=l.signal)===null||o===void 0?void 0:o.addEventListener("abort",function(){return r.removeEventListener(e,t,n)}),s.set(t,l!==null&&l!==void 0?l:{})}},{key:"removeEventListener",value:function e(e,t,n){if(t==null)return;var r=i5(n)?this.__captureEventListeners:this.__eventListeners,o=r.get(e);o!==void 0&&(o.delete(t),o.size||r.delete(e))}},{key:"dispatchEvent",value:function e(e){var t=this;var n=[this],r=this.__eventTargetParent;if(e.composed)for(;r;)n.push(r),r=r.__eventTargetParent;else for(;r&&r!==this.__host;)n.push(r),r=r.__eventTargetParent;var o=!1,a=!1,s=0,l=null,c=null,u=null,d=e.stopPropagation,h=e.stopImmediatePropagation;Object.defineProperties(e,{target:k({get:function e(){return l!==null&&l!==void 0?l:c}},i8),srcElement:k({get:function t(){return e.target}},i8),currentTarget:k({get:function e(){return u}},i8),eventPhase:k({get:function e(){return s}},i8),composedPath:k({value:function e(){return n}},i8),stopPropagation:k({value:function t(){o=!0,d.call(e)}},i8),stopImmediatePropagation:k({value:function t(){a=!0,h.call(e)}},i8)});var p=function t(t,n,r){typeof t=="function"?t(e):typeof(t===null||t===void 0?void 0:t.handleEvent)=="function"&&t.handleEvent(e),n.once&&r.delete(t)},f=function t(){return u=null,s=0,!e.defaultPrevented},v=n.slice().reverse();l=!this.__host||!e.composed?this:null;var g=function e(e){for(c=t;c.__host&&e.includes(c.__host);)c=c.__host};var m=true,b=false,y=undefined;try{for(var w=v[Symbol.iterator](),q;!(m=(q=w.next()).done);m=true){var x=q.value;!l&&(!c||c===x.__host)&&g(v.slice(v.indexOf(x))),u=x,s=x===e.target?2:1;var _=x.__captureEventListeners.get(e.type);if(_){var E=true,C=false,S=undefined;try{for(var R=_[Symbol.iterator](),A;!(E=(A=R.next()).done);E=true){var T=I(A.value,2),P=T[0],O=T[1];if(p(P,O,_),a)return f()}}catch(e){C=true;S=e}finally{try{if(!E&&R.return!=null){R.return()}}finally{if(C){throw S}}}}if(o)return f()}}catch(e){b=true;y=e}finally{try{if(!m&&w.return!=null){w.return()}}finally{if(b){throw y}}}var M=e.bubbles?n:[this];c=null;var N=true,D=false,L=undefined;try{for(var U=M[Symbol.iterator](),j;!(N=(j=U.next()).done);N=true){var z=j.value;!l&&(!c||z===c.__host)&&g(M.slice(0,M.indexOf(z)+1)),u=z,s=z===e.target?2:3;var V=z.__eventListeners.get(e.type);if(V){var W=true,F=false,B=undefined;try{for(var $=V[Symbol.iterator](),H;!(W=(H=$.next()).done);W=true){var Q=I(H.value,2),G=Q[0],X=Q[1];if(p(G,X,V),a)return f()}}catch(e){F=true;B=e}finally{try{if(!W&&$.return!=null){$.return()}}finally{if(F){throw B}}}}if(o)return f()}}catch(e){D=true;L=e}finally{try{if(!N&&U.return!=null){U.return()}}finally{if(D){throw L}}}return f()}}]);return e}(),i6=i4;var i8={__proto__:null};i8.enumerable=!0;Object.freeze(i8);var i7=(i1=/*#__PURE__*/function(){"use strict";function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};l(this,e);if(iH.set(this,!1),iQ.set(this,!1),iG.set(this,!1),iX.set(this,!1),iK.set(this,Date.now()),iY.set(this,!1),iJ.set(this,void 0),iZ.set(this,void 0),i0.set(this,void 0),this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,arguments.length===0)throw new Error("The type argument must be specified");if((typeof n==="undefined"?"undefined":D(n))!="object"||!n)throw new Error('The "options" argument must be an object');var r=n.bubbles,o=n.cancelable,a=n.composed;iB(this,iH,!!o,"f"),iB(this,iQ,!!r,"f"),iB(this,iG,!!a,"f"),iB(this,iJ,"".concat(t),"f"),iB(this,iZ,null,"f"),iB(this,i0,!1,"f")}d(e,[{key:"initEvent",value:function e(e,t,n){throw new Error("Method not implemented.")}},{key:"stopImmediatePropagation",value:function e(){this.stopPropagation()}},{key:"preventDefault",value:function e(){iB(this,iX,!0,"f")}},{key:"target",get:function e(){return i$(this,iZ,"f")}},{key:"currentTarget",get:function e(){return i$(this,iZ,"f")}},{key:"srcElement",get:function e(){return i$(this,iZ,"f")}},{key:"type",get:function e(){return i$(this,iJ,"f")}},{key:"cancelable",get:function e(){return i$(this,iH,"f")}},{key:"defaultPrevented",get:function e(){return i$(this,iH,"f")&&i$(this,iX,"f")}},{key:"timeStamp",get:function e(){return i$(this,iK,"f")}},{key:"composedPath",value:function e(){return i$(this,i0,"f")?[i$(this,iZ,"f")]:[]}},{key:"returnValue",get:function e(){return!i$(this,iH,"f")||!i$(this,iX,"f")}},{key:"bubbles",get:function e(){return i$(this,iQ,"f")}},{key:"composed",get:function e(){return i$(this,iG,"f")}},{key:"eventPhase",get:function e(){return i$(this,i0,"f")?i1.AT_TARGET:i1.NONE}},{key:"cancelBubble",get:function e(){return i$(this,iY,"f")},set:function e(e){e&&iB(this,iY,!0,"f")}},{key:"stopPropagation",value:function e(){iB(this,iY,!0,"f")}},{key:"isTrusted",get:function e(){return!1}}]);return e}(),iH=new WeakMap,iQ=new WeakMap,iG=new WeakMap,iX=new WeakMap,iK=new WeakMap,iY=new WeakMap,iJ=new WeakMap,iZ=new WeakMap,i0=new WeakMap,i1.NONE=0,i1.CAPTURING_PHASE=1,i1.AT_TARGET=2,i1.BUBBLING_PHASE=3,i1);Object.defineProperties(i7.prototype,{initEvent:i8,stopImmediatePropagation:i8,preventDefault:i8,target:i8,currentTarget:i8,srcElement:i8,type:i8,cancelable:i8,defaultPrevented:i8,timeStamp:i8,composedPath:i8,returnValue:i8,bubbles:i8,composed:i8,eventPhase:i8,cancelBubble:i8,stopPropagation:i8,isTrusted:i8});var i9=(i2=/*#__PURE__*/function(e){"use strict";v(t,e);function t(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};l(this,t);var r;var o;r=s(this,t,[e,n]),i3.set(r,void 0),iB(r,i3,(o=n===null||n===void 0?void 0:n.detail)!==null&&o!==void 0?o:null,"f");return r}d(t,[{key:"initCustomEvent",value:function e(e,t,n,r){throw new Error("Method not implemented.")}},{key:"detail",get:function e(){return i$(this,i3,"f")}}]);return t}(i7),i3=new WeakMap,i2);Object.defineProperties(i9.prototype,{detail:i8});var oe=i7,ot=i9;var on;var or=(on=/*#__PURE__*/function(){"use strict";function e(){l(this,e);this.STYLE_RULE=1,this.CHARSET_RULE=2,this.IMPORT_RULE=3,this.MEDIA_RULE=4,this.FONT_FACE_RULE=5,this.PAGE_RULE=6,this.NAMESPACE_RULE=10,this.KEYFRAMES_RULE=7,this.KEYFRAME_RULE=8,this.SUPPORTS_RULE=12,this.COUNTER_STYLE_RULE=11,this.FONT_FEATURE_VALUES_RULE=14,this.__parentStyleSheet=null,this.cssText=""}d(e,[{key:"parentRule",get:function e(){return null}},{key:"parentStyleSheet",get:function e(){return this.__parentStyleSheet}},{key:"type",get:function e(){return 0}}]);return e}(),on.STYLE_RULE=1,on.CHARSET_RULE=2,on.IMPORT_RULE=3,on.MEDIA_RULE=4,on.FONT_FACE_RULE=5,on.PAGE_RULE=6,on.NAMESPACE_RULE=10,on.KEYFRAMES_RULE=7,on.KEYFRAME_RULE=8,on.SUPPORTS_RULE=12,on.COUNTER_STYLE_RULE=11,on.FONT_FEATURE_VALUES_RULE=14,on);(im=globalThis.Event)!==null&&im!==void 0?im:globalThis.Event=oe;(ib=globalThis.CustomEvent)!==null&&ib!==void 0?ib:globalThis.CustomEvent=ot;var oi=new WeakMap,oo=function e(e){var t=oi.get(e);return t===void 0&&oi.set(e,t=new Map),t},oa=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments),e.__shadowRootMode=null,e.__shadowRoot=null,e.__internals=null;return e}d(t,[{key:"attributes",get:function e(){return Array.from(oo(this)).map(function(e){var t=I(e,2),n=t[0],r=t[1];return{name:n,value:r}})}},{key:"shadowRoot",get:function e(){return this.__shadowRootMode==="closed"?null:this.__shadowRoot}},{key:"localName",get:function e(){return this.constructor.__localName}},{key:"tagName",get:function e(){var e;return(e=this.localName)===null||e===void 0?void 0:e.toUpperCase()}},{key:"setAttribute",value:function e(e,t){oo(this).set(e,String(t))}},{key:"removeAttribute",value:function e(e){oo(this).delete(e)}},{key:"toggleAttribute",value:function e(e,t){if(this.hasAttribute(e)){if(t===void 0||!t)return this.removeAttribute(e),!1}else return t===void 0||t?(this.setAttribute(e,""),!0):!1;return!0}},{key:"hasAttribute",value:function e(e){return oo(this).has(e)}},{key:"attachShadow",value:function e(e){var t={host:this};return this.__shadowRootMode=e.mode,e&&e.mode==="open"&&(this.__shadowRoot=t),t}},{key:"attachInternals",value:function e(){if(this.__internals!==null)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");var e=new iF(this);return this.__internals=e,e}},{key:"getAttribute",value:function e(e){var t;return(t=oo(this).get(e))!==null&&t!==void 0?t:null}}]);return t}(i6);var os=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}return t}(oa),ol=os;(iy=globalThis.litServerRoot)!==null&&iy!==void 0?iy:globalThis.litServerRoot=Object.defineProperty(new ol,"localName",{get:function e(){return"lit-server-root"}});var oc=/*#__PURE__*/function(){"use strict";function t(){l(this,t);this.__definitions=new Map,this.__reverseDefinitions=new Map,this.__pendingWhenDefineds=new Map}d(t,[{key:"define",value:function e(e,t){var n;var r;if(this.__definitions.has(e))if(process.env.NODE_ENV==="development")console.warn("'CustomElementRegistry' already has \"".concat(e,'" 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(e,'" has already been used with this registry'));if(this.__reverseDefinitions.has(t))throw new Error("Failed to execute 'define' on 'CustomElementRegistry': the constructor has already been used with this registry for the tag name ".concat(this.__reverseDefinitions.get(t)));t.__localName=e,this.__definitions.set(e,{ctor:t,observedAttributes:(n=t.observedAttributes)!==null&&n!==void 0?n:[]}),this.__reverseDefinitions.set(t,e),(r=this.__pendingWhenDefineds.get(e))===null||r===void 0?void 0:r.resolve(t),this.__pendingWhenDefineds.delete(e)}},{key:"get",value:function e(e){var t;return(t=this.__definitions.get(e))===null||t===void 0?void 0:t.ctor}},{key:"getName",value:function e(e){var t;return(t=this.__reverseDefinitions.get(e))!==null&&t!==void 0?t:null}},{key:"upgrade",value:function e(e){throw new Error("customElements.upgrade is not currently supported in SSR. Please file a bug if you need it.")}},{key:"whenDefined",value:function t(t){return a(function(){var n,r;return z(this,function(o){n=this.__definitions.get(t);if(n)return[2,n.ctor];r=this.__pendingWhenDefineds.get(t);return[2,(r||(r=e(),this.__pendingWhenDefineds.set(t,r)),r.promise)]})}).call(this)}}]);return t}(),ou=oc;var od=new ou;var oh=globalThis,op=oh.ShadowRoot&&(oh.ShadyCSS===void 0||oh.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,of=Symbol(),ov=new WeakMap,og=/*#__PURE__*/function(){"use strict";function e(t,n,r){l(this,e);if(this._$cssResult$=!0,r!==of)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=n}d(e,[{key:"styleSheet",get:function e(){var e=this.o,t=this.t;if(op&&e===void 0){var n=t!==void 0&&t.length===1;n&&(e=ov.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&ov.set(t,e))}return e}},{key:"toString",value:function e(){return this.cssText}}]);return e}(),om=function e(e){return new og(typeof e=="string"?e:e+"",void 0,of)},ob=function e(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++){n[r-1]=arguments[r]}var o=e.length===1?e[0]:n.reduce(function(t,n,r){return t+function(e){if(e._$cssResult$===!0)return e.cssText;if(typeof e=="number")return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")}(n)+e[r+1]},e[0]);return new og(o,e,of)},oy=function e(e,t){var n=true,r=false,o=undefined;if(op)e.adoptedStyleSheets=t.map(function(e){return g(e,CSSStyleSheet)?e:e.styleSheet});else try{for(var a=t[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;var c=document.createElement("style"),u=oh.litNonce;u!==void 0&&c.setAttribute("nonce",u),c.textContent=l.cssText,e.appendChild(c)}}catch(e){r=true;o=e}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(r){throw o}}}},ow=op||oh.CSSStyleSheet===void 0?function(e){return e}:function(e){return g(e,CSSStyleSheet)?function(e){var t="";var n=true,r=false,o=undefined;try{for(var a=e.cssRules[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;t+=l.cssText}}catch(e){r=true;o=e}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(r){throw o}}}return om(t)}(e):e};var oq=Object.is,ok=Object.defineProperty,ox=Object.getOwnPropertyDescriptor,o_=Object.getOwnPropertyNames,oE=Object.getOwnPropertySymbols,oC=Object.getPrototypeOf,oS=globalThis;(iw=oS.customElements)!==null&&iw!==void 0?iw:oS.customElements=od;var oR=oS.trustedTypes,oA=oR?oR.emptyScript:"",oT=oS.reactiveElementPolyfillSupport,oI=function e(e,t){return e},oP={toAttribute:function e(e,t){switch(t){case Boolean:e=e?oA:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute:function e(e,t){var n=e;switch(t){case Boolean:n=e!==null;break;case Number:n=e===null?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch(e){n=null}}return n}},oO=function e(e,t){return!oq(e,t)},oM={attribute:!0,type:String,converter:oP,reflect:!1,useDefault:!1,hasChanged:oO};(iq=Symbol.metadata)!==null&&iq!==void 0?iq:Symbol.metadata=Symbol("metadata"),(ik=oS.litPropertyMetadata)!==null&&ik!==void 0?ik:oS.litPropertyMetadata=new WeakMap;var oN=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t),e._$Ep=void 0,e.isUpdatePending=!1,e.hasUpdated=!1,e._$Em=null,e._$Ev();return e}d(t,[{key:"_$Ev",value:function e(){var e=this;var t;this._$ES=new Promise(function(t){return e.enableUpdating=t}),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)===null||t===void 0?void 0:t.forEach(function(t){return t(e)})}},{key:"addController",value:function e(e){var t;var n;((t=this._$EO)!==null&&t!==void 0?t:this._$EO=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&((n=e.hostConnected)===null||n===void 0?void 0:n.call(e))}},{key:"removeController",value:function e(e){var t;(t=this._$EO)===null||t===void 0?void 0:t.delete(e)}},{key:"_$E_",value:function e(){var e=new Map,t=this.constructor.elementProperties;var n=true,r=false,o=undefined;try{for(var a=t.keys()[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;this.hasOwnProperty(l)&&(e.set(l,this[l]),delete this[l])}}catch(e){r=true;o=e}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(r){throw o}}}e.size>0&&(this._$Ep=e)}},{key:"createRenderRoot",value:function e(){var e;var t=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return oy(t,this.constructor.elementStyles),t}},{key:"connectedCallback",value:function e(){var e;var t;(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(e){var t;return(t=e.hostConnected)===null||t===void 0?void 0:t.call(e)})}},{key:"enableUpdating",value:function e(e){}},{key:"disconnectedCallback",value:function e(){var e;(e=this._$EO)===null||e===void 0?void 0:e.forEach(function(e){var t;return(t=e.hostDisconnected)===null||t===void 0?void 0:t.call(e)})}},{key:"attributeChangedCallback",value:function e(e,t,n){this._$AK(e,n)}},{key:"_$ET",value:function e(e,t){var n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(r!==void 0&&n.reflect===!0){var o;var a=(((o=n.converter)===null||o===void 0?void 0:o.toAttribute)!==void 0?n.converter:oP).toAttribute(t,n.type);this._$Em=e,a==null?this.removeAttribute(r):this.setAttribute(r,a),this._$Em=null}}},{key:"_$AK",value:function e(e,t){var n=this.constructor,r=n._$Eh.get(e);if(r!==void 0&&this._$Em!==r){var o;var a,s;var l=n.getPropertyOptions(r),c=typeof l.converter=="function"?{fromAttribute:l.converter}:((a=l.converter)===null||a===void 0?void 0:a.fromAttribute)!==void 0?l.converter:oP;this._$Em=r;var u=c.fromAttribute(t,l.type);this[r]=(o=u!==null&&u!==void 0?u:(s=this._$Ej)===null||s===void 0?void 0:s.get(r))!==null&&o!==void 0?o:u,this._$Em=null}}},{key:"requestUpdate",value:function e(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,o=arguments.length>4?arguments[4]:void 0;if(e!==void 0){var a;var s;var l=this.constructor;if(r===!1&&(o=this[e]),n!==null&&n!==void 0?n:n=l.getPropertyOptions(e),!(((a=n.hasChanged)!==null&&a!==void 0?a:oO)(o,t)||n.useDefault&&n.reflect&&o===((s=this._$Ej)===null||s===void 0?void 0:s.get(e))&&!this.hasAttribute(l._$Eu(e,n))))return;this.C(e,t,n)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}},{key:"C",value:function e(e,t,n,r){var o=n.useDefault,a=n.reflect,s=n.wrapped;var l,c,u;o&&!((l=this._$Ej)!==null&&l!==void 0?l:this._$Ej=new Map).has(e)&&(this._$Ej.set(e,(c=r!==null&&r!==void 0?r:t)!==null&&c!==void 0?c:this[e]),s!==!0||r!==void 0)||(this._$AL.has(e)||(this.hasUpdated||o||(t=void 0),this._$AL.set(e,t)),a===!0&&this._$Em!==e&&((u=this._$Eq)!==null&&u!==void 0?u:this._$Eq=new Set).add(e))}},{key:"_$EP",value:function e(){return a(function(){var e,t,n;return z(this,function(r){switch(r.label){case 0:this.isUpdatePending=!0;r.label=1;case 1:r.trys.push([1,3,,4]);return[4,this._$ES];case 2:r.sent();return[3,4];case 3:e=r.sent();Promise.reject(e);return[3,4];case 4:t=this.scheduleUpdate();n=t!=null;if(!n)return[3,6];return[4,t];case 5:n=r.sent();r.label=6;case 6:return[2,(n,!this.isUpdatePending)]}})}).call(this)}},{key:"scheduleUpdate",value:function e(){return this.performUpdate()}},{key:"performUpdate",value:function e(){if(!this.isUpdatePending)return;if(!this.hasUpdated){var e;if((e=this.renderRoot)!==null&&e!==void 0?e:this.renderRoot=this.createRenderRoot(),this._$Ep){var t=true,n=false,r=undefined;try{for(var o=this._$Ep[Symbol.iterator](),a;!(t=(a=o.next()).done);t=true){var s=I(a.value,2),l=s[0],c=s[1];this[l]=c}}catch(e){n=true;r=e}finally{try{if(!t&&o.return!=null){o.return()}}finally{if(n){throw r}}}this._$Ep=void 0}var u=this.constructor.elementProperties;var d=true,h=false,p=undefined;if(u.size>0)try{for(var f=u[Symbol.iterator](),v;!(d=(v=f.next()).done);d=true){var g=I(v.value,2),m=g[0],b=g[1];var y=b.wrapped,w=this[m];y!==!0||this._$AL.has(m)||w===void 0||this.C(m,void 0,b,w)}}catch(e){h=true;p=e}finally{try{if(!d&&f.return!=null){f.return()}}finally{if(h){throw p}}}}var q=!1,k=this._$AL;try{var x;q=this.shouldUpdate(k),q?(this.willUpdate(k),(x=this._$EO)===null||x===void 0?void 0:x.forEach(function(e){var t;return(t=e.hostUpdate)===null||t===void 0?void 0:t.call(e)}),this.update(k)):this._$EM()}catch(e){throw q=!1,this._$EM(),e}q&&this._$AE(k)}},{key:"willUpdate",value:function e(e){}},{key:"_$AE",value:function e(e){var t;(t=this._$EO)===null||t===void 0?void 0:t.forEach(function(e){var t;return(t=e.hostUpdated)===null||t===void 0?void 0:t.call(e)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}},{key:"_$EM",value:function e(){this._$AL=new Map,this.isUpdatePending=!1}},{key:"updateComplete",get:function e(){return this.getUpdateComplete()}},{key:"getUpdateComplete",value:function e(){return this._$ES}},{key:"shouldUpdate",value:function e(e){return!0}},{key:"update",value:function e(e){var t=this;this._$Eq&&(this._$Eq=this._$Eq.forEach(function(e){return t._$ET(e,t[e])})),this._$EM()}},{key:"updated",value:function e(e){}},{key:"firstUpdated",value:function e(e){}}],[{key:"addInitializer",value:function e(e){var t;this._$Ei(),((t=this.l)!==null&&t!==void 0?t:this.l=[]).push(e)}},{key:"observedAttributes",get:function e(){return this.finalize(),this._$Eh&&N(this._$Eh.keys())}},{key:"createProperty",value:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:oM;if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){var n=Symbol(),r=this.getPropertyDescriptor(e,n,t);r!==void 0&&ok(this.prototype,e,r)}}},{key:"getPropertyDescriptor",value:function e(e,t,n){var r;var o=(r=ox(this.prototype,e))!==null&&r!==void 0?r:{get:function e(){return this[t]},set:function e(e){this[t]=e}},a=o.get,s=o.set;return{get:a,set:function t(t){var r=a===null||a===void 0?void 0:a.call(this);s===null||s===void 0?void 0:s.call(this,t),this.requestUpdate(e,r,n)},configurable:!0,enumerable:!0}}},{key:"getPropertyOptions",value:function e(e){var t;return(t=this.elementProperties.get(e))!==null&&t!==void 0?t:oM}},{key:"_$Ei",value:function e(){if(this.hasOwnProperty(oI("elementProperties")))return;var e=oC(this);e.finalize(),e.l!==void 0&&(this.l=N(e.l)),this.elementProperties=new Map(e.elementProperties)}},{key:"finalize",value:function e(){if(this.hasOwnProperty(oI("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(oI("properties"))){var e=this.properties,t=N(o_(e)).concat(N(oE(e)));var n=true,r=false,o=undefined;try{for(var a=t[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;this.createProperty(l,e[l])}}catch(e){r=true;o=e}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(r){throw o}}}}var c=this[Symbol.metadata];if(c!==null){var u=litPropertyMetadata.get(c);var d=true,h=false,p=undefined;if(u!==void 0)try{for(var f=u[Symbol.iterator](),v;!(d=(v=f.next()).done);d=true){var g=I(v.value,2),m=g[0],b=g[1];this.elementProperties.set(m,b)}}catch(e){h=true;p=e}finally{try{if(!d&&f.return!=null){f.return()}}finally{if(h){throw p}}}}this._$Eh=new Map;var y=true,w=false,q=undefined;try{for(var k=this.elementProperties[Symbol.iterator](),x;!(y=(x=k.next()).done);y=true){var _=I(x.value,2),E=_[0],C=_[1];var S=this._$Eu(E,C);S!==void 0&&this._$Eh.set(S,E)}}catch(e){w=true;q=e}finally{try{if(!y&&k.return!=null){k.return()}}finally{if(w){throw q}}}this.elementStyles=this.finalizeStyles(this.styles)}},{key:"finalizeStyles",value:function e(e){var t=[];if(Array.isArray(e)){var n=new Set(e.flat(1/0).reverse());var r=true,o=false,a=undefined;try{for(var s=n[Symbol.iterator](),l;!(r=(l=s.next()).done);r=true){var c=l.value;t.unshift(ow(c))}}catch(e){o=true;a=e}finally{try{if(!r&&s.return!=null){s.return()}}finally{if(o){throw a}}}}else e!==void 0&&t.push(ow(e));return t}},{key:"_$Eu",value:function e(e,t){var n=t.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}}]);return t}((ix=globalThis.HTMLElement)!==null&&ix!==void 0?ix:ol);oN.elementStyles=[],oN.shadowRootOptions={mode:"open"},oN[oI("elementProperties")]=new Map,oN[oI("finalized")]=new Map,oT===null||oT===void 0?void 0:oT({ReactiveElement:oN}),((i_=oS.reactiveElementVersions)!==null&&i_!==void 0?i_:oS.reactiveElementVersions=[]).push("2.1.2");var oD=globalThis,oL=function e(e){return e},oU=oD.trustedTypes,oj=oU?oU.createPolicy("lit-html",{createHTML:function e(e){return e}}):void 0,oz="$lit$",oV="lit$".concat(Math.random().toFixed(9).slice(2),"$"),oW="?"+oV,oF="<".concat(oW,">"),oB=oD.document===void 0?{createTreeWalker:function e(){return{}}}:document,o$=function e(){return oB.createComment("")},oH=function e(e){return e===null||(typeof e==="undefined"?"undefined":D(e))!="object"&&typeof e!="function"},oQ=Array.isArray,oG=function e(e){return oQ(e)||typeof(e===null||e===void 0?void 0:e[Symbol.iterator])=="function"},oX="[ \n\f\r]",oK=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,oY=/-->/g,oJ=/>/g,oZ=RegExp(">|".concat(oX,"(?:([^\\s\"'>=/]+)(").concat(oX,"*=").concat(oX,"*(?:[^ \n\f\r\"'`<>=]|(\"|')|))|$)"),"g"),o0=/'/g,o1=/"/g,o3=/^(?:script|style|textarea|title)$/i,o2=function e(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++){r[o-1]=arguments[o]}return{_$litType$:e,strings:t,values:r}}},o5=o2(1),o4=o2(2),o6=o2(3),o8=Symbol.for("lit-noChange"),o7=Symbol.for("lit-nothing"),o9=new WeakMap,ae=oB.createTreeWalker(oB,129);var at=function e(e,n){var r=e.length-1,o=[],a,s=n===2?"<svg>":n===3?"<math>":"",l=oK;for(var c=0;c<r;c++){var u=e[c],d=void 0,h=void 0,p=-1,f=0;for(;f<u.length&&(l.lastIndex=f,h=l.exec(u),h!==null);)f=l.lastIndex,l===oK?h[1]==="!--"?l=oY:h[1]!==void 0?l=oJ:h[2]!==void 0?(o3.test(h[2])&&(a=RegExp("</"+h[2],"g")),l=oZ):h[3]!==void 0&&(l=oZ):l===oZ?h[0]===">"?(l=a!==null&&a!==void 0?a:oK,p=-1):h[1]===void 0?p=-2:(p=l.lastIndex-h[2].length,d=h[1],l=h[3]===void 0?oZ:h[3]==='"'?o1:o0):l===o1||l===o0?l=oZ:l===oY||l===oJ?l=oK:(l=oZ,a=void 0);var v=l===oZ&&e[c+1].startsWith("/>")?" ":"";s+=l===oK?u+oF:p>=0?(o.push(d),u.slice(0,p)+oz+u.slice(p)+oV+v):u+oV+(p===-2?c:v)}return[t(e,s+(e[r]||"<?>")+(n===2?"</svg>":n===3?"</math>":"")),o]},an=/*#__PURE__*/function(){"use strict";function e(t,n){var r=t.strings,o=t._$litType$;l(this,e);var a;this.parts=[];var s=0,c=0,u=r.length-1,d=this.parts,h=I(at(r,o),2),p=h[0],f=h[1];if(this.el=e.createElement(p,n),ae.currentNode=this.el.content,o===2||o===3){var v;var g=this.el.content.firstChild;(v=g).replaceWith.apply(v,N(g.childNodes))}for(;(a=ae.nextNode())!==null&&d.length<u;){if(a.nodeType===1){var m=true,b=false,y=undefined;if(a.hasAttributes())try{for(var w=a.getAttributeNames()[Symbol.iterator](),q;!(m=(q=w.next()).done);m=true){var k=q.value;if(k.endsWith(oz)){var x=f[c++],_=a.getAttribute(k).split(oV),E=/([.?@])?(.*)/.exec(x);d.push({type:1,index:s,name:E[2],strings:_,ctor:E[1]==="."?as:E[1]==="?"?al:E[1]==="@"?ac:aa}),a.removeAttribute(k)}else k.startsWith(oV)&&(d.push({type:6,index:s}),a.removeAttribute(k))}}catch(e){b=true;y=e}finally{try{if(!m&&w.return!=null){w.return()}}finally{if(b){throw y}}}if(o3.test(a.tagName)){var C=a.textContent.split(oV),S=C.length-1;if(S>0){a.textContent=oU?oU.emptyScript:"";for(var R=0;R<S;R++)a.append(C[R],o$()),ae.nextNode(),d.push({type:2,index:++s});a.append(C[S],o$())}}}else if(a.nodeType===8)if(a.data===oW)d.push({type:2,index:s});else{var A=-1;for(;(A=a.data.indexOf(oV,A+1))!==-1;)d.push({type:7,index:s}),A+=oV.length-1}s++}}d(e,null,[{key:"createElement",value:function e(e,t){var n=oB.createElement("template");return n.innerHTML=e,n}}]);return e}();function ar(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e,r=arguments.length>3?arguments[3]:void 0;var o;var a,s;if(t===o8)return t;var l=r!==void 0?(a=n._$Co)===null||a===void 0?void 0:a[r]:n._$Cl,c=oH(t)?void 0:t._$litDirective$;return(l===null||l===void 0?void 0:l.constructor)!==c&&(l===null||l===void 0?void 0:(s=l._$AO)===null||s===void 0?void 0:s.call(l,!1),c===void 0?l=void 0:(l=new c(e),l._$AT(e,n,r)),r!==void 0?((o=n._$Co)!==null&&o!==void 0?o:n._$Co=[])[r]=l:n._$Cl=l),l!==void 0&&(t=ar(e,l._$AS(e,t.values),l,r)),t}var ai=/*#__PURE__*/function(){"use strict";function e(t,n){l(this,e);this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=n}d(e,[{key:"parentNode",get:function e(){return this._$AM.parentNode}},{key:"_$AU",get:function e(){return this._$AM._$AU}},{key:"u",value:function e(e){var t;var n=this._$AD,r=n.el,o=r.content,a=n.parts,s=((t=e===null||e===void 0?void 0:e.creationScope)!==null&&t!==void 0?t:oB).importNode(o,!0);ae.currentNode=s;var l=ae.nextNode(),c=0,u=0,d=a[0];for(;d!==void 0;){if(c===d.index){var h=void 0;d.type===2?h=new ao(l,l.nextSibling,this,e):d.type===1?h=new d.ctor(l,d.name,d.strings,this,e):d.type===6&&(h=new au(l,this,e)),this._$AV.push(h),d=a[++u]}c!==(d===null||d===void 0?void 0:d.index)&&(l=ae.nextNode(),c++)}return ae.currentNode=oB,s}},{key:"p",value:function e(e){var t=0;var n=true,r=false,o=undefined;try{for(var a=this._$AV[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;l!==void 0&&(l.strings!==void 0?(l._$AI(e,l,t),t+=l.strings.length-2):l._$AI(e[t])),t++}}catch(e){r=true;o=e}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(r){throw o}}}}}]);return e}(),ao=/*#__PURE__*/function(){"use strict";function e(t,n,r,o){l(this,e);var a;this.type=2,this._$AH=o7,this._$AN=void 0,this._$AA=t,this._$AB=n,this._$AM=r,this.options=o,this._$Cv=(a=o===null||o===void 0?void 0:o.isConnected)!==null&&a!==void 0?a:!0}d(e,[{key:"_$AU",get:function e(){var e;var t;return(e=(t=this._$AM)===null||t===void 0?void 0:t._$AU)!==null&&e!==void 0?e:this._$Cv}},{key:"parentNode",get:function e(){var e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&(e===null||e===void 0?void 0:e.nodeType)===11&&(e=t.parentNode),e}},{key:"startNode",get:function e(){return this._$AA}},{key:"endNode",get:function e(){return this._$AB}},{key:"_$AI",value:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this;e=ar(this,e,t),oH(e)?e===o7||e==null||e===""?(this._$AH!==o7&&this._$AR(),this._$AH=o7):e!==this._$AH&&e!==o8&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):oG(e)?this.k(e):this._(e)}},{key:"O",value:function e(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}},{key:"T",value:function e(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}},{key:"_",value:function e(e){this._$AH!==o7&&oH(this._$AH)?this._$AA.nextSibling.data=e:this.T(oB.createTextNode(e)),this._$AH=e}},{key:"$",value:function e(e){var n;var r=e.values,o=e._$litType$,a=typeof o=="number"?this._$AC(e):(o.el===void 0&&(o.el=an.createElement(t(o.h,o.h[0]),this.options)),o);if(((n=this._$AH)===null||n===void 0?void 0:n._$AD)===a)this._$AH.p(r);else{var s=new ai(a,this),l=s.u(this.options);s.p(r),this.T(l),this._$AH=s}}},{key:"_$AC",value:function e(e){var t=o9.get(e.strings);return t===void 0&&o9.set(e.strings,t=new an(e)),t}},{key:"k",value:function t(t){oQ(this._$AH)||(this._$AH=[],this._$AR());var n=this._$AH,r,o=0;var a=true,s=false,l=undefined;try{for(var c=t[Symbol.iterator](),u;!(a=(u=c.next()).done);a=true){var d=u.value;o===n.length?n.push(r=new e(this.O(o$()),this.O(o$()),this,this.options)):r=n[o],r._$AI(d),o++}}catch(e){s=true;l=e}finally{try{if(!a&&c.return!=null){c.return()}}finally{if(s){throw l}}}o<n.length&&(this._$AR(r&&r._$AB.nextSibling,o),n.length=o)}},{key:"_$AR",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this._$AA.nextSibling,t=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,t);e!==this._$AB;){var o=oL(e).nextSibling;oL(e).remove(),e=o}}},{key:"setConnected",value:function e(e){var t,n;this._$AM===void 0&&(this._$Cv=e,(t=(n=this)._$AP)===null||t===void 0?void 0:t.call(n,e))}}]);return e}(),aa=/*#__PURE__*/function(){"use strict";function e(t,n,r,o,a){l(this,e);this.type=1,this._$AH=o7,this._$AN=void 0,this.element=t,this.name=n,this._$AM=o,this.options=a,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=o7}d(e,[{key:"tagName",get:function e(){return this.element.tagName}},{key:"_$AU",get:function e(){return this._$AM._$AU}},{key:"_$AI",value:function e(e){var t=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 o=this.strings,a=!1;if(o===void 0)e=ar(this,e,t,0),a=!oH(e)||e!==this._$AH&&e!==o8,a&&(this._$AH=e);else{var s=e,l,c;for(e=o[0],l=0;l<o.length-1;l++)c=ar(this,s[n+l],t,l),c===o8&&(c=this._$AH[l]),a||(a=!oH(c)||c!==this._$AH[l]),c===o7?e=o7:e!==o7&&(e+=(c!==null&&c!==void 0?c:"")+o[l+1]),this._$AH[l]=c}a&&!r&&this.j(e)}},{key:"j",value:function e(e){e===o7?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e!==null&&e!==void 0?e:"")}}]);return e}(),as=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments),e.type=3;return e}d(t,[{key:"j",value:function e(e){this.element[this.name]=e===o7?void 0:e}}]);return t}(aa),al=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments),e.type=4;return e}d(t,[{key:"j",value:function e(e){this.element.toggleAttribute(this.name,!!e&&e!==o7)}}]);return t}(aa),ac=/*#__PURE__*/function(e){"use strict";v(t,e);function t(e,n,r,o,a){l(this,t);var c;c=s(this,t,[e,n,r,o,a]),c.type=5;return c}d(t,[{key:"_$AI",value:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this;var n;if((e=(n=ar(this,e,t,0))!==null&&n!==void 0?n:o7)===o8)return;var r=this._$AH,o=e===o7&&r!==o7||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,a=e!==o7&&(r===o7||o);o&&this.element.removeEventListener(this.name,this,r),a&&this.element.addEventListener(this.name,this,e),this._$AH=e}},{key:"handleEvent",value:function e(e){var t;var n;typeof this._$AH=="function"?this._$AH.call((t=(n=this.options)===null||n===void 0?void 0:n.host)!==null&&t!==void 0?t:this.element,e):this._$AH.handleEvent(e)}}]);return t}(aa),au=/*#__PURE__*/function(){"use strict";function e(t,n,r){l(this,e);this.element=t,this.type=6,this._$AN=void 0,this._$AM=n,this.options=r}d(e,[{key:"_$AU",get:function e(){return this._$AM._$AU}},{key:"_$AI",value:function e(e){ar(this,e)}}]);return e}(),ad={M:oz,P:oV,A:oW,C:1,L:at,R:ai,D:oG,V:ar,I:ao,H:aa,N:al,U:ac,B:as,F:au},ah=oD.litHtmlPolyfillSupport;ah===null||ah===void 0?void 0:ah(an,ao),((iE=oD.litHtmlVersions)!==null&&iE!==void 0?iE:oD.litHtmlVersions=[]).push("3.3.2");var ap=function e(e,t,n){var r;var o=(r=n===null||n===void 0?void 0:n.renderBefore)!==null&&r!==void 0?r:t,a=o._$litPart$;if(a===void 0){var s;var l=(s=n===null||n===void 0?void 0:n.renderBefore)!==null&&s!==void 0?s:null;o._$litPart$=a=new ao(t.insertBefore(o$(),l),l,void 0,n!==null&&n!==void 0?n:{})}return a._$AI(e),a};var af=globalThis,av=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments),e.renderOptions={host:e},e._$Do=void 0;return e}d(t,[{key:"createRenderRoot",value:function e(){var e;var n;var r=p(f(t.prototype),"createRenderRoot",this).call(this);return(e=(n=this.renderOptions).renderBefore)!==null&&e!==void 0?e:n.renderBefore=r.firstChild,r}},{key:"update",value:function e(e){var n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),p(f(t.prototype),"update",this).call(this,e),this._$Do=ap(n,this.renderRoot,this.renderOptions)}},{key:"connectedCallback",value:function e(){var e;p(f(t.prototype),"connectedCallback",this).call(this),(e=this._$Do)===null||e===void 0?void 0:e.setConnected(!0)}},{key:"disconnectedCallback",value:function e(){var e;p(f(t.prototype),"disconnectedCallback",this).call(this),(e=this._$Do)===null||e===void 0?void 0:e.setConnected(!1)}},{key:"render",value:function e(){return o8}}]);return t}(oN);av._$litElement$=!0,av.finalized=!0,(iS=af.litElementHydrateSupport)===null||iS===void 0?void 0:iS.call(af,{LitElement:av});var ag=af.litElementPolyfillSupport;ag===null||ag===void 0?void 0:ag({LitElement:av});((iC=af.litElementVersions)!==null&&iC!==void 0?iC:af.litElementVersions=[]).push("4.2.2");var am={attribute:!0,type:String,converter:oP,reflect:!1,hasChanged:oO},ab=function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:am,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;var r=n.kind,o=n.metadata,a=globalThis.litPropertyMetadata.get(o);if(a===void 0&&globalThis.litPropertyMetadata.set(o,a=new Map),r==="setter"&&((e=Object.create(e)).wrapped=!0),a.set(n.name,e),r==="accessor"){var s=n.name;return{set:function n(n){var r=t.get.call(this);t.set.call(this,n),this.requestUpdate(s,r,e,!0,n)},init:function t(t){return t!==void 0&&this.C(s,void 0,e,t),t}}}if(r==="setter"){var l=n.name;return function(n){var r=this[l];t.call(this,n),this.requestUpdate(l,r,e,!0,n)}}throw Error("Unsupported decorator location: "+r)};var ay=function e(e,t,n){return n.configurable=!0,n.enumerable=!0,Reflect.decorate&&(typeof t==="undefined"?"undefined":D(t))!="object"&&Object.defineProperty(e,t,n),n};var aw=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},aq={fromAttribute:function e(e){return e==="true"},toAttribute:function e(e){return e?"true":"false"}},ak=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments),e.weigths=new Map;return e}d(t,[{key:"createRenderRoot",value:function e(){return this}},{key:"assessmentItem",get:function e(){var e;return(e=this.renderRoot)===null||e===void 0?void 0:e.querySelector("qti-assessment-item")}},{key:"connectedCallback",value:function e(){var e=this;var n=this,r=function n(){return p(f(t.prototype),"connectedCallback",e)};return a(function(){return z(this,function(e){switch(e.label){case 0:r().call(n);return[4,this.updateComplete];case 1:e.sent(),this.dispatchEvent(new CustomEvent("qti-assessment-item-ref-connected",{bubbles:!0,composed:!0,detail:{identifier:this.identifier,href:this.href,category:this.category}}));return[2]}})}).call(this)}},{key:"render",value:function e(){return this.myTemplate?this.myTemplate({xmlDoc:this.xmlDoc}):this.xmlDoc}}]);return t}(av);aw([n({type:String})],ak.prototype,"category",void 0);aw([n({type:String})],ak.prototype,"identifier",void 0);aw([n({type:Boolean,converter:aq})],ak.prototype,"required",void 0);aw([n({type:Boolean,converter:aq})],ak.prototype,"fixed",void 0);aw([n({type:String})],ak.prototype,"href",void 0);aw([n({type:Object,attribute:!1})],ak.prototype,"xmlDoc",void 0);var ax=/*#__PURE__*/function(e){"use strict";v(t,e);function t(e,n,r,o){l(this,t);var a;a=s(this,t,["context-request",{bubbles:!0,composed:!0}]),a.context=e,a.contextTarget=n,a.callback=r,a.subscribe=o!==null&&o!==void 0?o:!1;return a}return t}(U(Event));var a_=/*#__PURE__*/function(){"use strict";function e(t,n,r,o){var a=this;l(this,e);if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=function(e,t){a.unsubscribe&&(a.unsubscribe!==t&&(a.provided=!1,a.unsubscribe()),a.subscribe||a.unsubscribe()),a.value=e,a.host.requestUpdate(),a.provided&&!a.subscribe||(a.provided=!0,a.callback&&a.callback(e,t)),a.unsubscribe=t},this.host=t,n.context!==void 0){var s;var c=n;this.context=c.context,this.callback=c.callback,this.subscribe=(s=c.subscribe)!==null&&s!==void 0?s:!1}else this.context=n,this.callback=r,this.subscribe=o!==null&&o!==void 0?o:!1;this.host.addController(this)}d(e,[{key:"hostConnected",value:function e(){this.dispatchRequest()}},{key:"hostDisconnected",value:function e(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}},{key:"dispatchRequest",value:function e(){this.host.dispatchEvent(new ax(this.context,this.host,this.t,this.subscribe))}}]);return e}();var aE=/*#__PURE__*/function(){"use strict";function e(t){var n=this;l(this,e);this.subscriptions=new Map,this.updateObservers=function(){var e=true,t=false,r=undefined;try{for(var o=n.subscriptions[Symbol.iterator](),a;!(e=(a=o.next()).done);e=true){var s=I(a.value,2),l=s[0],c=s[1],u=c.disposer;l(n.o,u)}}catch(e){t=true;r=e}finally{try{if(!e&&o.return!=null){o.return()}}finally{if(t){throw r}}}},t!==void 0&&(this.value=t)}d(e,[{key:"value",get:function e(){return this.o},set:function e(e){this.setValue(e)}},{key:"setValue",value:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;var n=t||!Object.is(e,this.o);this.o=e,n&&this.updateObservers()}},{key:"addCallback",value:function e(e,t,n){var r=this;if(!n)return void e(this.value);this.subscriptions.has(e)||this.subscriptions.set(e,{disposer:function t(){r.subscriptions.delete(e)},consumerHost:t});var o=this.subscriptions.get(e),a=o.disposer;e(this.value,a)}},{key:"clearCallbacks",value:function e(){this.subscriptions.clear()}}]);return e}();var aC=/*#__PURE__*/function(e){"use strict";v(t,e);function t(e,n){l(this,t);var r;r=s(this,t,["context-provider",{bubbles:!0,composed:!0}]),r.context=e,r.contextTarget=n;return r}return t}(U(Event)),aS=/*#__PURE__*/function(e){"use strict";v(t,e);function t(e,n,r){l(this,t);var o;var a,c;o=s(this,t,[n.context!==void 0?n.initialValue:r]),o.onContextRequest=function(e){var t;if(e.context!==o.context)return;var n=(t=e.contextTarget)!==null&&t!==void 0?t:e.composedPath()[0];n!==o.host&&(e.stopPropagation(),o.addCallback(e.callback,n,e.subscribe))},o.onProviderRequest=function(e){var t;if(e.context!==o.context||((t=e.contextTarget)!==null&&t!==void 0?t:e.composedPath()[0])===o.host)return;var n=new Set;var r=true,a=false,s=undefined;try{for(var l=o.subscriptions[Symbol.iterator](),c;!(r=(c=l.next()).done);r=true){var u=I(c.value,2),d=u[0],h=u[1],p=h.consumerHost;n.has(d)||(n.add(d),p.dispatchEvent(new ax(o.context,p,d,!0)))}}catch(e){a=true;s=e}finally{try{if(!r&&l.return!=null){l.return()}}finally{if(a){throw s}}}e.stopPropagation()},o.host=e,n.context!==void 0?o.context=n.context:o.context=n,o.attachListeners(),(a=(c=o.host).addController)===null||a===void 0?void 0:a.call(c,o);return o}d(t,[{key:"attachListeners",value:function e(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}},{key:"hostConnected",value:function e(){this.host.dispatchEvent(new aC(this.context,this.host))}}]);return t}(aE);var aR=[];var aA=true,aT=false,aI=undefined;try{for(var aP=aR[Symbol.iterator](),aO;!(aA=(aO=aP.next()).done);aA=true){var aM=aO.value,aN=aM.tag,aD=aM.ctor;customElements.get(aN)||customElements.define(aN,aD)}}catch(e){aT=true;aI=e}finally{try{if(!aA&&aP.return!=null){aP.return()}}finally{if(aT){throw aI}}}var aL=Symbol("computedItemContext");var aU=Symbol("computedContext");var aj=Symbol("configContext");var az=Symbol("interactionContext");var aV=Symbol("item");var aW=[{identifier:"completionStatus",cardinality:"single",baseType:"string",value:"unknown",type:"outcome"},{identifier:"numAttempts",cardinality:"single",baseType:"integer",value:"0",type:"response"}];var aF=/^[A-Za-z0-9-]+$/,aB=function e(e){return typeof e=="string"&&aF.test(e)},a$=function e(e){return aB(e)?e:void 0},aH=Symbol("qtiContext");var aQ={view:"candidate"},aG=Symbol("testContext");var aX={items:[],testOutcomeVariables:[]},aK=Symbol("testContext");var aY=ob(W());var aJ=ob(F());var aZ=ob(B());var a0=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},a1,a3=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t);iU(e,a1);ij(e,a1,!1),e._interactionContext={choiceRole:null,draggablesSelector:null},e.disabled=!1,e.readonly=!1,e._internals=e.attachInternals();return e}d(t,[{key:"internals",get:function e(){return this._internals}},{key:"registersWithItem",get:function e(){return!0}},{key:"isInline",get:function e(){return!1}},{key:"responseVariable",get:function e(){var e;if(!((e=this._context)===null||e===void 0?void 0:e.variables))return;var t=this._context.variables.filter(function(e){return e.type==="response"}),n=this.getAttribute("response-identifier");return t.find(function(e){return e.identifier===n})}},{key:"value",get:function e(){return JSON.stringify(this.response)},set:function e(e){this.response=e?JSON.parse(e):null}},{key:"reportValidity",value:function e(){var e=this._internals.validity.valid,t=this.validationDisplayMode;return(t==="native"||t==="both")&&this._internals.reportValidity(),t==="inline"||t==="both"?this.updateInlineValidationMessage():this.clearInlineValidationMessage(),t==="none"&&this.clearInlineValidationMessage(),e}},{key:"validationDisplayMode",get:function e(){var e;var t;return(e=(t=this.configContext)===null||t===void 0?void 0:t.validationDisplayMode)!==null&&e!==void 0?e:"inline"}},{key:"resolveAllowReorder",value:function e(e){var t;var n=(t=e===null||e===void 0?void 0:e.defaultWhenUnset)!==null&&t!==void 0?t:!0,r=this.configContext;return r&&r.allowReorder!==void 0?r.allowReorder:n}},{key:"resolveDisableAfterMaxReached",value:function e(e){var t;var n=(t=e===null||e===void 0?void 0:e.defaultWhenUnset)!==null&&t!==void 0?t:!1,r=this.configContext;return r?r.disableAfterMaxReached!==void 0?r.disableAfterMaxReached:r.disableAfterIfMaxChoicesReached!==void 0?(iL(this,a1)||(ij(this,a1,!0),console.log("[QTI Config] `disableAfterIfMaxChoicesReached` is deprecated. Use `disableAfterMaxReached` instead.")),r.disableAfterIfMaxChoicesReached):n:n}},{key:"setInteractionValidity",value:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;var o=n!==null&&n!==void 0?n:this;this._internals.setValidity(e?{}:{customError:!0},t,o),(r===null||r===void 0?void 0:r.suppressInline)!==!0&&(this.validationDisplayMode==="inline"||this.validationDisplayMode==="both")&&this.updateInlineValidationMessage()}},{key:"updateInlineValidationMessage",value:function e(){var e=this.getValidationMessageElement();if(e){if(!this._internals.validity.valid){e.textContent=this._internals.validationMessage,e.style.setProperty("display","block","important");return}e.textContent="",e.style.display="none"}}},{key:"clearInlineValidationMessage",value:function e(){var e=this.getValidationMessageElement();e&&(e.textContent="",e.style.display="none")}},{key:"getValidationMessageElement",value:function e(){var e;return(e=this.shadowRoot)===null||e===void 0?void 0:e.querySelector("#validation-message")}},{key:"reset",value:function e(){this.response=null}},{key:"formResetCallback",value:function e(){this.reset()}},{key:"connectedCallback",value:function e(){p(f(t.prototype),"connectedCallback",this).call(this),this.registersWithItem&&this.dispatchEvent(new CustomEvent("qti-register-interaction",{bubbles:!0,composed:!0,cancelable:!1,detail:{interactionElement:this,responseIdentifier:this.responseIdentifier}}))}},{key:"saveResponse",value:function e(e,t){this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,cancelable:!1,detail:k({responseIdentifier:this.responseIdentifier,response:Array.isArray(e)?N(e):e},t!==void 0?{state:t}:{})}))}},{key:"firstUpdated",value:function e(e){}}]);return t}(av);a1=new WeakMap,a3.formAssociated=!0;var a2=a3;a0([m({context:aV,subscribe:!0})],a2.prototype,"_context",void 0);a0([m({context:aj,subscribe:!0})],a2.prototype,"configContext",void 0);a0([u({context:az})],a2.prototype,"_interactionContext",void 0);a0([n({type:String,attribute:"response-identifier"})],a2.prototype,"responseIdentifier",void 0);a0([n({reflect:!0,type:Boolean})],a2.prototype,"disabled",void 0);a0([n({reflect:!0,type:Boolean})],a2.prototype,"readonly",void 0);a0([n({type:String})],a2.prototype,"name",void 0);var a5=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"render",value:function e(){return o5($())}},{key:"defaultValues",value:function e(e){var t=Array.from(this.querySelectorAll("qti-default-value > qti-value"));if(t.length===0)return null;var n=t.map(function(e){return e.innerHTML.trim()});return n.length>1||e==="multiple"||e==="ordered"?n:n[0]}}]);return t}(av);var a4=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},a6=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments),e.getVariables=function(){return Array.from(e.children).map(function(t){switch(console.debug("getVariables",t.tagName.toLowerCase()),t.tagName.toLowerCase()){case"qti-base-value":return{baseType:t.getAttribute("base-type"),value:t.textContent.trim(),cardinality:"single"};case"qti-variable":{var n;var r=t.getAttribute("identifier")||"";return r==="QTI_CONTEXT"?((n=e.qtiContext)===null||n===void 0?void 0:n.QTI_CONTEXT)?{identifier:"QTI_CONTEXT",baseType:"record",value:e.qtiContext.QTI_CONTEXT,cardinality:"record",type:"context"}:(console.warn("QTI_CONTEXT not available"),{identifier:"QTI_CONTEXT",baseType:"record",value:e.qtiContext.QTI_CONTEXT,cardinality:"record",type:"context"}):e.context.variables.find(function(e){return e.identifier===r})||null}case"qti-multiple":{var o=t.getResult();return console.debug("values",o),(o===null||o===void 0?void 0:o.length)>0?{identifier:"",baseType:o[0].baseType,value:o.map(function(e){return e.value}),cardinality:"multiple",type:"response"}:null}case"qti-ordered":{var a=t.getResult();return(a===null||a===void 0?void 0:a.length)>0?{identifier:"",baseType:a[0].baseType,value:a.map(function(e){return e.value}),cardinality:"ordered",type:"response"}:null}case"qti-repeat":{var s=t.getResult();return(s===null||s===void 0?void 0:s.length)>0?s:null}case"qti-correct":{var l,c;var u=t.getAttribute("identifier")||"",d=((c=e.context)===null||c===void 0?void 0:(l=c.variables)===null||l===void 0?void 0:l.find(function(e){return e.identifier===u}))||null;return{baseType:d.baseType,value:d.correctResponse,cardinality:d.cardinality}}default:{try{var h;return{baseType:"integer",value:((h=t.getResult())===null||h===void 0?void 0:h.toString())||null,cardinality:"single"}}catch(e){console.warn("default not sufficient")}return null}}}).flatMap(function(e){return Array.isArray(e)?e:[e]}).filter(function(e){return e!==null})};return e}d(t,[{key:"render",value:function e(){return o5(H(),JSON.stringify(this.result,null,2))}},{key:"calculate",value:function e(){return this.result=this.getResult(),this.result}},{key:"getResult",value:function e(){throw new Error("Not implemented")}}]);return t}(av);a6.styles=ob(Q());var a8=a6;a4([r()],a8.prototype,"result",void 0);a4([m({context:aV,subscribe:!0}),r()],a8.prototype,"context",void 0);a4([m({context:aH,subscribe:!0}),r()],a8.prototype,"qtiContext",void 0);var a7=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"calculate",value:function e(){return this.result=this.getResult(),this.result}},{key:"getResult",value:function e(){throw new Error("Not implemented")}}]);return t}(a8);var a9=function e(){return new Intl.NumberFormat().format(.1).replace(/\d/g,"")},se=function e(e){if(typeof e=="string")return e;var t=a9();return t==="."?e.toLocaleString():e.toString().replace(".","").replace(t,".")};var st=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},sn,sr,si=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,sn);e.showHide="show";return e}d(t,[{key:"connectedCallback",value:function e(){p(f(t.prototype),"connectedCallback",this).call(this),this.dispatchEvent(new CustomEvent("qti-register-feedback",{bubbles:!0,composed:!0,detail:this}))}},{key:"checkShowFeedback",value:function e(e){var t=this._context.variables.find(function(t){return t.identifier===e})||null;if(this.outcomeIdentifier!==e||!t)return;var n=!1;Array.isArray(t.value)?n=t.value.includes(this.identifier):n=!b(this.identifier)&&!b(t===null||t===void 0?void 0:t.value)&&this.identifier===t.value||!1,iz(this,sn,sr).call(this,n)}}]);return t}(av);sn=new WeakSet,sr=function e(e){this.showStatus=e&&this.showHide==="show"||!e&&this.showHide==="hide"?"on":"off"};st([n({type:String,attribute:"show-hide"})],si.prototype,"showHide",void 0);st([n({type:String,attribute:"outcome-identifier"})],si.prototype,"outcomeIdentifier",void 0);st([n({type:String})],si.prototype,"identifier",void 0);st([n({type:String,attribute:!1})],si.prototype,"showStatus",void 0);st([m({context:aV,subscribe:!0}),r()],si.prototype,"_context",void 0);var so=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}return t}(av);var sa=/*#__PURE__*/function(){"use strict";function e(){l(this,e)}d(e,null,[{key:"isPointInArea",value:function e(e,t,n){if(n!=="point")return console.warn("Base type ".concat(n," is not supported for point area mapping.")),!1;var r=I(e.split(" ").map(Number),2),o=r[0],a=r[1],s=M(t.split(",")),l=s[0],c=s.slice(1),u=c.map(Number);switch(l.toLowerCase()){case"circle":case"default":{var d=I(u,3),h=d[0],p=d[1],f=d[2];return u.length!==3?(console.warn("Invalid circle definition: ".concat(t)),!1):Math.sqrt(Math.pow(o-h,2)+Math.pow(a-p,2))<=f}case"rect":{var v=I(u,4),g=v[0],m=v[1],b=v[2],y=v[3];return u.length!==4?(console.warn("Invalid rectangle definition: ".concat(t)),!1):o>=g&&o<=b&&a>=m&&a<=y}case"ellipse":{var w=I(u,4),q=w[0],k=w[1],x=w[2],_=w[3];if(u.length!==4)return console.warn("Invalid ellipse definition: ".concat(t)),!1;var E=Math.pow(o-q,2)/Math.pow(x,2),C=Math.pow(a-k,2)/Math.pow(_,2);return E+C<=1}case"poly":{if(u.length<6||u.length%2!==0)return console.warn("Invalid polygon definition: ".concat(t)),!1;var S=[];for(var R=0;R<u.length;R+=2)S.push({x:u[R],y:u[R+1]});return this.isPointInPolygon({x:o,y:a},S)}default:return console.warn("Unsupported shape type: ".concat(l)),!1}}},{key:"isPointInPolygon",value:function e(e,t){var n=!1;for(var r=0,o=t.length-1;r<t.length;o=r++){var a=t[r].x,s=t[r].y,l=t[o].x,c=t[o].y;s>e.y!=c>e.y&&e.x<(l-a)*(e.y-s)/(c-s)+a&&(n=!n)}return n}},{key:"compareSingleValues",value:function e(e,t,n){switch(n){case"identifier":case"string":return e===t;case"integer":{var r=parseInt(e,10),o=parseInt(t,10);if(!isNaN(r)&&!isNaN(o))return r===o;console.error("Cannot convert ".concat(e," and/or ").concat(t," to int."));break}case"float":{var a=parseFloat(e),s=parseFloat(t);if(!isNaN(a)&&!isNaN(s))return a===s;console.error("couldn't convert ".concat(e," and/or ").concat(t," to float."));break}case"pair":case"directedPair":{var l=e.split(" ").sort(),c=t.split(" ").sort();if(l.length===2&&c.length===2)return n==="pair"&&(l.sort(),c.sort()),l.join(" ")===c.join(" ");console.error("compared two pair but one of the values does not have 2 values: 1: ".concat(e," 2: ").concat(t));break}}return!1}}]);return e}();var ss=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},sl={fromAttribute:function e(e){return e==="true"},toAttribute:function e(e){return e?"true":"false"}},sc,su=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,sc,"");return e}d(t,[{key:"title",get:function e(){return iL(this,sc)},set:function e(e){ij(this,sc,e),this.removeAttribute("title"),this.setAttribute("data-title",e)}},{key:"connectedCallback",value:function e(){var e=this;var n=this,r=function n(){return p(f(t.prototype),"connectedCallback",e)};return a(function(){return z(this,function(e){switch(e.label){case 0:ij(this,sc,this.getAttribute("title")||""),r().call(n);return[4,this.updateComplete];case 1:e.sent(),this.dispatchEvent(new Event("qti-assessment-section-connected",{bubbles:!0,composed:!0}));return[2]}})}).call(this)}},{key:"render",value:function e(){return o5(G())}}]);return t}(av);sc=new WeakMap;ss([n({type:String})],su.prototype,"identifier",void 0);ss([n({type:String})],su.prototype,"required",void 0);ss([n({type:Boolean,converter:sl})],su.prototype,"fixed",void 0);ss([n({type:Boolean,converter:sl})],su.prototype,"visible",void 0);ss([n({type:Boolean,converter:sl,attribute:"keep-together"})],su.prototype,"keepTogether",void 0);ss([m({context:aK,subscribe:!0})],su.prototype,"_testContext",void 0);var sd=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},sh,sp=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,sh,"");return e}d(t,[{key:"title",get:function e(){return iL(this,sh)},set:function e(e){ij(this,sh,e),this.removeAttribute("title"),this.setAttribute("data-title",e)}},{key:"connectedCallback",value:function e(){var e=this;var n=this,r=function n(){return p(f(t.prototype),"connectedCallback",e)};return a(function(){return z(this,function(e){switch(e.label){case 0:r().call(n);return[4,this.updateComplete];case 1:e.sent(),this.dispatchEvent(new CustomEvent("qti-assessment-test-connected",{detail:this,bubbles:!0,composed:!0}));return[2]}})}).call(this)}},{key:"render",value:function e(){return o5(X())}}]);return t}(av);sh=new WeakMap;sd([n({type:String})],sp.prototype,"identifier",void 0);sd([n({type:String})],sp.prototype,"title",null);sd([m({context:aK,subscribe:!0})],sp.prototype,"_testContext",void 0);var sf=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"render",value:function e(){return o5(K())}},{key:"process",value:function e(){var e=new sg,t=N(this.children);e.process(t)}}]);return t}(av);sf.styles=[ob(Y())];var sv=sf,sg=/*#__PURE__*/function(){"use strict";function e(){l(this,e)}d(e,[{key:"process",value:function e(e){var t=true,n=false,r=undefined;try{for(var o=e[Symbol.iterator](),a;!(t=(a=o.next()).done);t=true){var s=a.value;s.process()}}catch(e){n=true;r=e}finally{try{if(!t&&o.return!=null){o.return()}}finally{if(n){throw r}}}}}]);return e}();var sm={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},sb=function e(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++){n[r]=arguments[r]}return{_$litDirective$:e,values:n}}},sy=/*#__PURE__*/function(){"use strict";function e(t){l(this,e)}d(e,[{key:"_$AU",get:function e(){return this._$AM._$AU}},{key:"_$AT",value:function e(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}},{key:"_$AS",value:function e(e,t){return this.update(e,t)}},{key:"update",value:function e(e,t){return this.render.apply(this,N(t))}}]);return e}();var sw=ad.I,sq=function e(e){return e},sk=function e(e){return e===null||(typeof e==="undefined"?"undefined":D(e))!="object"&&typeof e!="function"};var sx=function e(e){return e.strings===void 0},s_=function e(){return document.createComment("")},sE=function e(e,t,n){var r=e._$AA.parentNode,o=t===void 0?e._$AB:t._$AA;if(n===void 0){var a=r.insertBefore(s_(),o),s=r.insertBefore(s_(),o);n=new sw(a,s,e,e.options)}else{var l=n._$AB.nextSibling,c=n._$AM,u=c!==e;if(u){var d;var h;(d=n._$AQ)===null||d===void 0?void 0:d.call(n,e),n._$AM=e,n._$AP!==void 0&&(h=e._$AU)!==c._$AU&&n._$AP(h)}if(l!==o||u){var p=n._$AA;for(;p!==l;){var f=sq(p).nextSibling;sq(r).insertBefore(p,o),p=f}}}return n},sC=function e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e;return e._$AI(t,n),e},sS={},sR=function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:sS;return e._$AH=t},sA=function e(e){return e._$AH},sT=function e(e){e._$AR(),e._$AA.remove()};var sI=function e(e,t){var n;var r=e._$AN;if(r===void 0)return!1;var o=true,a=false,s=undefined;try{for(var l=r[Symbol.iterator](),c;!(o=(c=l.next()).done);o=true){var u=c.value;(n=u._$AO)===null||n===void 0?void 0:n.call(u,t,!1),sI(u,t)}}catch(e){a=true;s=e}finally{try{if(!o&&l.return!=null){l.return()}}finally{if(a){throw s}}}return!0},sP=function e(e){var t,n;do{if((t=e._$AM)===void 0)break;n=t._$AN,n.delete(e),e=t}while((n===null||n===void 0?void 0:n.size)===0)},sO=function e(e){for(var t;t=e._$AM;e=t){var n=t._$AN;if(n===void 0)t._$AN=n=new Set;else if(n.has(e))break;n.add(e),sM(t)}};var sM=function e(e){var t,n;e.type==sm.CHILD&&((t=e._$AP)!==null&&t!==void 0?t:e._$AP=j,(n=e._$AQ)!==null&&n!==void 0?n:e._$AQ=L)},sN=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments),e._$AN=void 0;return e}d(t,[{key:"_$AT",value:function e(e,n,r){p(f(t.prototype),"_$AT",this).call(this,e,n,r),sO(this),this.isConnected=e._$AU}},{key:"_$AO",value:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;var n,r,o,a;e!==this.isConnected&&(this.isConnected=e,e?(n=(r=this).reconnected)===null||n===void 0?void 0:n.call(r):(o=(a=this).disconnected)===null||o===void 0?void 0:o.call(a)),t&&(sI(this,e),sP(this))}},{key:"setValue",value:function e(e){if(sx(this._$Ct))this._$Ct._$AI(e,this);else{var t=N(this._$Ct._$AH);t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}},{key:"disconnected",value:function e(){}},{key:"reconnected",value:function e(){}}]);return t}(sy);var sD,sL,sU=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,sD);e.prevData={};return e}d(t,[{key:"render",value:function e(e){return o7}},{key:"update",value:function e(e,t){var n=I(t,1),r=n[0];var o;return this.element!==e.element&&(this.element=e.element),this.host=((o=e.options)===null||o===void 0?void 0:o.host)||this.element,this.apply(r),this.groom(r),this.prevData=k({},r),o7}},{key:"apply",value:function e(e){var t=iz(this,sD,sL).call(this,e),n=this,r=n.prevData,o=n.element;for(var a in t){var s=t[a];s!==r[a]&&(s===!0?o.setAttribute(a,""):s===!1?o.removeAttribute(a):s!=null?o.setAttribute(a,String(s)):o.removeAttribute(a))}}},{key:"groom",value:function e(e){var t=this,n=t.prevData,r=t.element;if(!n)return;var o=e?iz(this,sD,sL).call(this,e):{};for(var a in n)(!o||!(a in o))&&r.removeAttribute(a)}}]);return t}(sN);sD=new WeakSet,sL=function e(e){return Object.fromEntries(Object.entries(e).filter(function(e){var t=I(e,2),n=t[0],r=t[1];return typeof r=="function"?!1:n==="max-choices"&&r===0?!0:!(r===""||r===null||r===void 0)}))};var sj=sb(sU);var sz=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},sV,sW,sF,sB,s$,sH,sQ,sG,sX,sK,sY,sJ,sZ,s0,s1,s3,s2,s5,s4=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,s$);iU(e,sV);iU(e,sW);iU(e,sF);iU(e,sB);iU(e,sG);iU(e,sX);iU(e,sK);iU(e,sY);iU(e,sJ);iU(e,sZ);iU(e,s0);iU(e,s1);ij(e,sW,null),e.identifier="",e.adaptive="false",e.timeDependent=null,e._handleDisabledChange=function(t,n){e.interactionElements.forEach(function(e){return e.disabled=n})},e._handleReadonlyChange=function(t,n){return e.interactionElements.forEach(function(e){return e.readonly=n})},e._context={variables:aW},ij(e,sF,_(k({},e._context),{variables:e._context.variables})),ij(e,sB,[]),e.interactionElements=[],ij(e,sG,function(t){t.stopImmediatePropagation(),e._context=_(k({},e._context),{variables:N(e._context.variables).concat([t.detail.variable])}),ij(e,sF,e._context),t.stopPropagation()}),ij(e,sX,function(t){var n;t.stopImmediatePropagation();var r=t.detail;iL(e,sB).push(r),(Number((n=e._context.variables.find(function(e){return e.identifier==="numAttempts"}))===null||n===void 0?void 0:n.value)||0)>0&&r.checkShowFeedback(r.outcomeIdentifier)}),ij(e,sK,function(t){t.stopImmediatePropagation(),e.interactionElements.push(t.detail.interactionElement)}),ij(e,sY,function(t){t.stopImmediatePropagation();var n=t.detail,r=n.responseIdentifier,o=n.countAttempt;e.validate(),e.updateResponseVariable(r,"true"),e.processResponse(o)}),ij(e,sJ,function(t){t.stopImmediatePropagation();var n=t.detail,r=n.outcomeIdentifier,o=n.value;e.updateOutcomeVariable(r,o),t.stopPropagation()}),ij(e,sZ,function(t){t.stopImmediatePropagation();var n=t.detail,r=n.templateIdentifier,o=n.value;e.updateTemplateVariable(r,o!==null&&o!==void 0?o:void 0),t.stopPropagation()}),ij(e,s0,function(t){t.stopImmediatePropagation();var n=t.detail,r=n.responseIdentifier,o=n.value;e.updateCorrectResponse(r,o!==null&&o!==void 0?o:void 0),t.stopPropagation()}),ij(e,s1,function(t){t.stopImmediatePropagation();var n=t.detail,r=n.responseIdentifier,o=n.response,a=n.state;e.updateResponseVariable(r,o),a!==void 0&&(e._context=_(k({},e._context),{state:_(k({},e._context.state||{}),h({},r,a))})),e.dispatchEvent(new CustomEvent("qti-item-context-updated",{bubbles:!0,composed:!0,detail:{itemContext:e._context}}))});return e}d(t,[{key:"title",get:function e(){return iL(this,sV)},set:function e(e){ij(this,sV,e),this.removeAttribute("title"),this.setAttribute("data-title",e)}},{key:"assessmentItemRefId",get:function e(){return this._context.identifier},set:function e(e){this._context=_(k({},this._context),{identifier:e})}},{key:"variables",get:function e(){return this._context.variables.map(function(e){return k({identifier:e.identifier,value:e.value,type:e.type},e.type==="outcome"&&e.identifier==="SCORE"?{externalScored:e.externalScored}:{})})},set:function e(e){var t=this;if(!Array.isArray(e)||e.some(function(e){return!("identifier"in e)})){console.warn("variables property should be an array of VariableDeclaration");return}this._context=_(k({},this._context),{variables:this._context.variables.map(function(t){var n=e.find(function(e){return e.identifier===t.identifier});return n?_(k({},t,n),{interpolationTable:t.interpolationTable}):t})}),this._context.variables.forEach(function(e){if(e.type==="response"){var n=t.interactionElements.find(function(t){return t.responseIdentifier===e.identifier});n&&(n.response=e.value)}}),this.variables.forEach(function(e){e.type==="outcome"&&iL(t,sB).forEach(function(t){return t.checkShowFeedback(e.identifier)})})}},{key:"state",get:function e(){return this._context.state},set:function e(e){this._context=_(k({},this._context),{state:e?k({},e):void 0})}},{key:"responses",set:function e(e){var t=true,n=false,r=undefined;if(e)try{var o,a=function(){var e=l.value;o.getResponse(e.responseIdentifier)&&o.updateResponseVariable(e.responseIdentifier,e.response);var t=o.interactionElements.find(function(t){return t.getAttribute("response-identifier")===e.responseIdentifier});t&&(t.response=e.response)};for(var s=e[Symbol.iterator](),l;!(t=(l=s.next()).done);t=true)o=this,a()}catch(e){n=true;r=e}finally{try{if(!t&&s.return!=null){s.return()}}finally{if(n){throw r}}}}},{key:"render",value:function e(){return o5(J())}},{key:"connectedCallback",value:function e(){var e=this;iz(this,s$,sH).call(this),p(f(t.prototype),"connectedCallback",this).call(this),this.updateComplete.then(function(){e.dispatchEvent(new CustomEvent("qti-assessment-item-connected",{bubbles:!0,composed:!0,detail:e})),iz(e,s$,s3).call(e)})}},{key:"disconnectedCallback",value:function e(){iz(this,s$,sQ).call(this),p(f(t.prototype),"disconnectedCallback",this).call(this)}},{key:"processResponse",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;var n;this.validate(t),e&&this.updateOutcomeVariable("numAttempts",(+((n=this._context.variables.find(function(e){return e.identifier==="numAttempts"}))===null||n===void 0?void 0:n.value)+1).toString()),this.adaptive==="false"&&iz(this,s$,s5).call(this);var r=this.querySelector("qti-response-processing"),o=!!(r&&typeof r.process=="function");return o&&r.process(),this.adaptive==="false"&&this.updateOutcomeVariable("completionStatus",iz(this,s$,s2).call(this)),this.dispatchEvent(new CustomEvent("qti-item-context-updated",{bubbles:!0,composed:!0,detail:{itemContext:this._context}})),o}},{key:"resetResponses",value:function e(){this._context=iL(this,sF)}},{key:"getResponse",value:function e(e){return this.getVariable(e)}},{key:"getOutcome",value:function e(e){return this.getVariable(e)}},{key:"getVariable",value:function e(e){return this._context.variables.find(function(t){return t.identifier===e})||null}},{key:"afterResponseVariableUpdated",value:function e(){}},{key:"updateResponseVariable",value:function e(e,t){this._context=_(k({},this._context),{variables:this._context.variables.map(function(n){return n.identifier!==e?n:_(k({},n),{value:t})})}),this.afterResponseVariableUpdated(),this.dispatchEvent(new CustomEvent("qti-interaction-changed",{bubbles:!0,composed:!0,detail:{item:this.identifier,responseIdentifier:e,response:Array.isArray(t)?N(t):t}})),this.adaptive==="false"&&this.updateOutcomeVariable("completionStatus",iz(this,s$,s2).call(this))}},{key:"updateTemplateVariable",value:function e(e,t){var n=this._context.variables.find(function(t){return t.identifier===e&&t.type==="template"});if(!n){console.warn("Can not set qti-template-identifier: ".concat(e,", it is not available"));return}var r=n.cardinality==="single"?Array.isArray(t)?t[0]:t!==null&&t!==void 0?t:null:t==null?null:Array.isArray(t)?t:[t];this._context=_(k({},this._context),{variables:this._context.variables.map(function(t){return t.identifier!==e?t:_(k({},t),{value:r})})}),this.dispatchEvent(new CustomEvent("qti-item-context-updated",{bubbles:!0,composed:!0,detail:{itemContext:this._context}}))}},{key:"updateCorrectResponse",value:function e(e,t){var n=this.getResponse(e);if(!n){console.warn("Can not set correct response for identifier: ".concat(e,", it is not available"));return}var r=n.cardinality==="single"?Array.isArray(t)?t[0]:t!==null&&t!==void 0?t:null:t==null?null:Array.isArray(t)?t:[t];this._context=_(k({},this._context),{variables:this._context.variables.map(function(t){return t.identifier!==e?t:_(k({},t),{correctResponse:r})})}),this.dispatchEvent(new CustomEvent("qti-item-context-updated",{bubbles:!0,composed:!0,detail:{itemContext:this._context}}))}},{key:"setOutcomeVariable",value:function e(e,t){this.updateOutcomeVariable(e,t),this.dispatchEvent(new CustomEvent("qti-item-context-updated",{bubbles:!0,composed:!0,detail:{itemContext:this._context}}))}},{key:"updateOutcomeVariable",value:function e(e,t){var n;var r=this.getOutcome(e);if(!r){console.warn("Can not set qti-outcome-identifier: ".concat(e,", it is not available"));return}this._context=_(k({},this._context),{variables:this._context.variables.map(function(n){return n.identifier!==e?n:_(k({},n),{value:r.cardinality==="single"||Array.isArray(t)?t:[t]})})}),iL(this,sB).forEach(function(t){return t.checkShowFeedback(e)}),this.dispatchEvent(new CustomEvent("qti-outcome-changed",{bubbles:!0,composed:!0,detail:{item:this.identifier,outcomeIdentifier:e,value:(n=this._context.variables.find(function(t){return t.identifier===e}))===null||n===void 0?void 0:n.value}}))}},{key:"validate",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;var t=this.interactionElements.every(function(e){return e.validate()});return e&&this.reportValidity(),t}},{key:"reportValidity",value:function e(){var e=true,t=false,n=undefined;try{for(var r=this.interactionElements[Symbol.iterator](),o;!(e=(o=r.next()).done);e=true){var a=o.value;a.reportValidity()}}catch(e){t=true;n=e}finally{try{if(!e&&r.return!=null){r.return()}}finally{if(t){throw n}}}}}]);return t}(av);sV=new WeakMap,sW=new WeakMap,sF=new WeakMap,sB=new WeakMap,s$=new WeakSet,sH=function e(){this.addEventListener("qti-register-variable",iL(this,sG)),this.addEventListener("qti-register-feedback",iL(this,sX)),this.addEventListener("qti-register-interaction",iL(this,sK)),this.addEventListener("end-attempt",iL(this,sY)),this.addEventListener("qti-set-outcome-value",iL(this,sJ)),this.addEventListener("qti-set-template-value",iL(this,sZ)),this.addEventListener("qti-set-correct-response",iL(this,s0)),this.addEventListener("qti-interaction-response",iL(this,s1))},sQ=function e(){this.removeEventListener("qti-register-variable",iL(this,sG)),this.removeEventListener("qti-register-feedback",iL(this,sX)),this.removeEventListener("qti-register-interaction",iL(this,sK)),this.removeEventListener("end-attempt",iL(this,sY)),this.removeEventListener("qti-set-outcome-value",iL(this,sJ)),this.removeEventListener("qti-set-template-value",iL(this,sZ)),this.removeEventListener("qti-set-correct-response",iL(this,s0)),this.removeEventListener("qti-interaction-response",iL(this,s1))},sG=new WeakMap,sX=new WeakMap,sK=new WeakMap,sY=new WeakMap,sJ=new WeakMap,sZ=new WeakMap,s0=new WeakMap,s1=new WeakMap,s3=function e(){return a(function(){var e,t;return z(this,function(n){switch(n.label){case 0:e=Array.from(this.querySelectorAll("qti-template-declaration"));t=e.length>0;if(!t)return[3,3];return[4,Promise.all(e.map(function(e){return e.updateComplete}))];case 1:n.sent();return[4,Promise.resolve()];case 2:t=n.sent();n.label=3;case 3:t,ij(this,sW,this.querySelector("qti-template-processing")),iL(this,sW)&&(iL(this,sW).process(),ij(this,sF,_(k({},this._context),{variables:this._context.variables})));return[2]}})}).call(this)},s2=function e(){var e=this.validate(!1);return e===!0?"completed":e===!1?"incomplete":"not_attempted"},s5=function e(){this._context=_(k({},this._context),{variables:this._context.variables.map(function(e){var t;if(e.type!=="outcome")return e;var n=(t="defaultValue"in e?e.defaultValue:null)!==null&&t!==void 0?t:null;return n==null&&(e.baseType==="integer"||e.baseType==="float")&&(n="0"),_(k({},e),{value:n})})})};sz([n({type:String})],s4.prototype,"identifier",void 0);sz([n({type:String})],s4.prototype,"adaptive",void 0);sz([n({type:String})],s4.prototype,"timeDependent",void 0);sz([n({type:String})],s4.prototype,"title",null);sz([n({type:Boolean})],s4.prototype,"disabled",void 0);sz([O("disabled",{waitUntilFirstUpdate:!0})],s4.prototype,"_handleDisabledChange",void 0);sz([n({type:Boolean})],s4.prototype,"readonly",void 0);sz([O("readonly",{waitUntilFirstUpdate:!0})],s4.prototype,"_handleReadonlyChange",void 0);sz([u({context:aV})],s4.prototype,"_context",void 0);var s6,s8=/*#__PURE__*/function(){"use strict";function e(t){l(this,e);iU(this,s6);if(!g(t,Uint8Array))throw new TypeError("SeededRandom seed must be a Uint8Array.");if(t.length>32)throw new RangeError("SeededRandom seed must be 32 bytes or less.");var n=new Uint8Array(32);n.set(t,32-t.length),ij(this,s6,rk(n))}d(e,[{key:"random",value:function e(){ij(this,s6,iL(this,s6)|0),ij(this,s6,iL(this,s6)+0x6d2b79f5|0);var e=Math.imul(iL(this,s6)^iL(this,s6)>>>15,1|iL(this,s6));return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/0x100000000}}],[{key:"fromSeed",value:function t(t){if(t.length!==32)throw new RangeError("SeededRandom.fromSeed requires a 32-byte seed.");return new e(t)}},{key:"fromFixed",value:function t(t){if(typeof t!="number")throw new TypeError("SeededRandom.fromFixed requires a number.");if(!Number.isInteger(t)||t<0||t>255)throw new RangeError("SeededRandom.fromFixed requires an integer from 0 to 255.");var n=new Uint8Array(32);return n[31]=t,new e(n)}},{key:"fromSeedKey",value:function t(t){var n=new e(new Uint8Array);return ij(n,s6,rq("".concat(t))),n}}]);return e}();s6=new WeakMap;var s7=s8;var s9=function e(e){return typeof e=="function"?e():e.random()};var le=!1;function lt(e,t,n){if(e.nodeType===Node.ELEMENT_NODE){var r=e,o;!r.namespaceURI||r.namespaceURI.startsWith("http://www.imsglobal.org/xsd/qti/")||r.namespaceURI.startsWith("http://www.imsglobal.org/xsd/imsqti")?o=n?t.createElement(r.localName,{customElementRegistry:n}):t.createElement(r.localName):o=t.createElementNS(r.namespaceURI,r.tagName);for(var a=0;a<r.attributes.length;a++){var s=r.attributes[a];o.setAttribute(s.localName,s.value)}for(var l=0;l<r.childNodes.length;l++)o.appendChild(lt(r.childNodes[l],t,n));return o}return e.cloneNode(!1)}var ln=function e(){var e,t="",n={load:function r(r,o){return t=r,rA(r,o).then(function(t){return e=t,n})},parse:function r(r){return e=rT(r),t="",n},path:function r(r){return rP(e,r),t=null,n},fn:function t(t){return t(e),n},pciHooks:function t(t){return ry(e,t),n},configurePci:function t(t,r){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"qti-portable-custom-interaction";return a(function(){return z(this,function(a){switch(a.label){case 0:return[4,rv(e,t,r,o)];case 1:return[2,(a.sent(),n)]}})})()},shuffleInteractions:function r(r){var o=typeof r=="string"?r.trim():r;if(o==null||o===""){var a=t||"default-item-seed";return rR("qtiTransformItem",a),rC(e,a),n}return rC(e,o),n},extendElementName:function t(t,r){return rg(e,t,r),n},extendElementsWithClass:function t(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"extend";return rm(e,t),n},customInteraction:function t(t,r){var o=e.querySelector("qti-custom-interaction"),a=o.querySelector("object");return o.setAttribute("data-base-ref",t),o.setAttribute("data-base-item",t+r),o.setAttribute("data",a.getAttribute("data")),o.setAttribute("width",a.getAttribute("width")),o.setAttribute("height",a.getAttribute("height")),o.removeChild(a),n},convertCDATAtoComment:function t(){return rf(e),n},stripStyleSheets:function t(){return rS(e),n},html:function n(){return t!==null&&rP(e,t.substring(0,t.lastIndexOf("/"))),new XMLSerializer().serializeToString(rI(e))},xml:function t(){return new XMLSerializer().serializeToString(e)},htmlDoc:function n(n){return t!==null&&rP(e,t.substring(0,t.lastIndexOf("/"))),rI(e,n)},xmlDoc:function t(){return e}};return n};var lr=function e(){var e,t={load:function n(n,r){return a(function(){return z(this,function(o){return[2,new Promise(function(o){rA(n,r).then(function(n){return e=n,o(t)})})]})})()},parse:function t(t){e=rT(t)},assessmentTest:function t(){var t=e.querySelector('resource[type="imsqti_test_xmlv3p0"]');return{href:t.getAttribute("href"),identifier:t.getAttribute("identifier")}}};return t};var li=function e(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++){n[r-1]=arguments[r]}var o,a;return n.includes(e.localName)||n.includes((a=e.localName)===null||a===void 0?void 0:(o=a.toLowerCase)===null||o===void 0?void 0:o.call(a))},lo=function e(e){return li(e,"qti-assessment-item-ref","assessmentitemref")},la=function e(e){return li(e,"qti-assessment-section","assessmentsection")},ls=function e(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++){n[r-1]=arguments[r]}return n.some(function(t){var n;var r=((n=e.getAttribute(t))!==null&&n!==void 0?n:"").trim().toLowerCase();return r==="true"||r==="1"})},ll=function e(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++){n[r-1]=arguments[r]}return n.some(function(t){var n;var r=((n=e.getAttribute(t))!==null&&n!==void 0?n:"").trim().toLowerCase();return r==="false"||r==="0"})},lc=function e(e){return li(e,"qti-ordering","ordering")},lu=function e(e){return li(e,"qti-selection","selection")},ld=function e(e){return Array.from(e.children).filter(function(e){return lc(e)&&ls(e,"shuffle")})},lh=function e(e,t){return rw("".concat(e,":").concat(t))};function lp(e,t){var n;var r=true,o=false,a=undefined;try{for(var s=Array.from(e.children)[Symbol.iterator](),l;!(r=(l=s.next()).done);r=true){var c=l.value;la(c)&&lp(c,t)}}catch(e){o=true;a=e}finally{try{if(!r&&s.return!=null){s.return()}}finally{if(o){throw a}}}var u=ld(e);if(u.length===0)return;var d=[],h=[];var p=true,f=false,v=undefined;try{for(var g=Array.from(e.children)[Symbol.iterator](),m;!(p=(m=g.next()).done);p=true){var b=m.value;if(lo(b))d.push({nodes:[b],fixed:ls(b,"fixed")}),h.push(b);else if(la(b)){var y=rM(b),w=y.itemRefs,q=y.dropped;var k=true,x=false,_=undefined;if(rN(b,q),ll(b,"keep-together","keeptogether"))try{for(var E=w[Symbol.iterator](),C;!(k=(C=E.next()).done);k=true){var S=C.value;d.push({nodes:[S],fixed:ls(S,"fixed")})}}catch(e){x=true;_=e}finally{try{if(!k&&E.return!=null){E.return()}}finally{if(x){throw _}}}else w.length>0&&d.push({nodes:w,fixed:ls(b,"fixed")});h.push(b)}}}catch(e){f=true;v=e}finally{try{if(!p&&g.return!=null){g.return()}}finally{if(f){throw v}}}var R=h.length>0?h[h.length-1].nextSibling:null,A=(n=e.getAttribute("identifier"))!==null&&n!==void 0?n:"",T=r_(d,lh(t,A));var I=true,P=false,O=undefined;try{for(var M=h[Symbol.iterator](),N;!(I=(N=M.next()).done);I=true){var D=N.value;D.remove()}}catch(e){P=true;O=e}finally{try{if(!I&&M.return!=null){M.return()}}finally{if(P){throw O}}}var L=true,U=false,j=undefined,z=true,V=false,W=undefined;try{for(var F=T[Symbol.iterator](),B;!(z=(B=F.next()).done);z=true){var $=B.value;try{for(var H=$.nodes[Symbol.iterator](),Q;!(L=(Q=H.next()).done);L=true){var G=Q.value;e.insertBefore(G,R)}}catch(e){U=true;j=e}finally{try{if(!L&&H.return!=null){H.return()}}finally{if(U){throw j}}}}}catch(e){V=true;W=e}finally{try{if(!z&&F.return!=null){F.return()}}finally{if(V){throw W}}}var X=true,K=false,Y=undefined;try{for(var J=u[Symbol.iterator](),Z;!(X=(Z=J.next()).done);X=true){var ee=Z.value;ee.remove()}}catch(e){K=true;Y=e}finally{try{if(!X&&J.return!=null){J.return()}}finally{if(K){throw Y}}}}var lf=function e(){var e,t="",n={load:function r(r,o){return a(function(){return z(this,function(a){return[2,new Promise(function(a,s){rA(r,o).then(function(o){return e=o,t=r,n.path(r.substring(0,r.lastIndexOf("/"))),a(n)})})]})})()},parse:function r(r){return e=rT(r),t="",n},path:function t(t){return rP(e,t),n},fn:function t(t){return t(e),n},shuffleOrdering:function r(r){if(!rD(e))return n;var o=typeof r=="string"?r.trim():r;if(o==null||o===""){var a=t||"default-test-seed";return rR("qtiTransformTest",a),rL(e,a),n}return rL(e,o),n},items:function t(){return rO(e)},html:function t(){return new XMLSerializer().serializeToString(rI(e))},xml:function t(){return new XMLSerializer().serializeToString(e)},htmlDoc:function t(t){return rI(e,t)},xmlDoc:function t(){return e}};return n};var lv=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},lg=/*#__PURE__*/function(e){"use strict";v(t,e);function t(e,n){l(this,t);var r;r=s(this,t,[t.eventName,{bubbles:!0,composed:!0,cancelable:!0}]),r.element=e,r.item=n;return r}return t}(U(Event));lg.eventName="qti-assessment-stimulus-ref-connected";var lm=lg,lb=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments),e.identifier="",e.href="";return e}d(t,[{key:"connectedCallback",value:function e(){var e=this;var n=this,r=function n(){return p(f(t.prototype),"connectedCallback",e)};return a(function(){var e,t,o,a;return z(this,function(s){switch(s.label){case 0:r().call(n);return[4,this.updateComplete];case 1:s.sent();e=this.closest("qti-assessment-item"),t=new lm(this,e);this.dispatchEvent(t);o=e===null||e===void 0?void 0:e.querySelector('[data-stimulus-idref="'.concat(this.identifier,'"]'));a=!t.defaultPrevented&&o;if(!a)return[3,3];return[4,this.updateStimulusRef(o)];case 2:a=s.sent();s.label=3;case 3:a;return[2]}})}).call(this)}},{key:"updateStimulusRef",value:function e(e){return a(function(){var t,n,r;return z(this,function(o){switch(o.label){case 0:return[4,ln().load(this.href).then(function(e){return e.htmlDoc()})];case 1:t=o.sent();if(t){;r=t.querySelectorAll("qti-stimulus-body, qti-stylesheet");e.innerHTML="",(n=e).append.apply(n,N(r))}return[2]}})}).call(this)}}]);return t}(av);lv([n({type:String})],lb.prototype,"identifier",void 0);lv([n({type:String})],lb.prototype,"href",void 0);var ly=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}return t}(av);var lw=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},lq,lk,lx,l_=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,lq);return e}d(t,[{key:"render",value:function e(){return o5(Z(),iz(this,lq,lk))}},{key:"connectedCallback",value:function e(){var e=this;p(f(t.prototype),"connectedCallback",this).call(this),this.updateComplete.then(function(){return iz(e,lq,lk).call(e)})}},{key:"updated",value:function e(e){e.has("context")&&iz(this,lq,lk).call(this)}}]);return t}(av);lq=new WeakSet,lk=function e(){var e;var t;var n=new Map,r=((e=(t=this.context)===null||t===void 0?void 0:t.variables)!==null&&e!==void 0?e:[]).filter(function(e){return e.type==="template"});var o=true,a=false,s=undefined;try{for(var l=r[Symbol.iterator](),c;!(o=(c=l.next()).done);o=true){var u=c.value;var d=u;d.mathVariable!==!0||d.value===null||d.value===void 0||n.set(d.identifier,iz(this,lq,lx).call(this,d.value))}}catch(e){a=true;s=e}finally{try{if(!o&&l.return!=null){l.return()}}finally{if(a){throw s}}}if(n.size===0)return;var h=Array.from(this.querySelectorAll("*")).filter(function(e){return e.localName.toLowerCase()==="mi"||e.localName.toLowerCase()==="mn"});var p=true,f=false,v=undefined;try{for(var g=h[Symbol.iterator](),m;!(p=(m=g.next()).done);p=true){var b=m.value;var y,w;var q;var k=(y=(w=b.getAttribute("data-qti-math-variable-source"))!==null&&w!==void 0?w:(q=b.textContent)===null||q===void 0?void 0:q.trim())!==null&&y!==void 0?y:"",x=n.get(k);if(!x)continue;if(b.localName.toLowerCase()==="mn"){b.textContent=x,b.setAttribute("data-qti-math-variable-source",k);continue}var _=document.createElement("mn");_.textContent=x,_.setAttribute("data-qti-math-variable-source",k),b.replaceWith(_)}}catch(e){f=true;v=e}finally{try{if(!p&&g.return!=null){g.return()}}finally{if(f){throw v}}}},lx=function e(e){var t;return Array.isArray(e)?e.join(" "):(t=e===null||e===void 0?void 0:e.toString())!==null&&t!==void 0?t:""};lw([m({context:aV,subscribe:!0}),r()],l_.prototype,"context",void 0);var lE=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},lC=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments),e.identifier="",e.cardinality="record";return e}d(t,[{key:"render",value:function e(){return o5(ee())}}]);return t}(av);lC.styles=[ob(et())];var lS=lC;lE([n({type:String})],lS.prototype,"identifier",void 0);lE([n({type:String})],lS.prototype,"cardinality",void 0);var lR=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},lA,lT=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,lA);return e}d(t,[{key:"render",value:function e(){return o5(en(),this.handleSlotChange)}},{key:"handleSlotChange",value:function e(){var e;var t;var n=Array.from((e=(t=this.firstElementChild)===null||t===void 0?void 0:t.childNodes)!==null&&e!==void 0?e:[]).find(function(e){return e.nodeType===Node.COMMENT_NODE});try{var r;ij(this,lA,new Function("context","fn","item",(r=n===null||n===void 0?void 0:n.textContent)!==null&&r!==void 0?r:""))}catch(e){console.error("custom-operator contains invalid javascript code",e)}}},{key:"calculate",value:function e(){var e=this;var t={variable:function t(t){var n;var r,o;return(n=(o=e._context)===null||o===void 0?void 0:(r=o.variables.find(function(e){return e.identifier===t}))===null||r===void 0?void 0:r.value)!==null&&n!==void 0?n:""},correct:function t(t){var n;var r,o;return(n=(o=e._context)===null||o===void 0?void 0:(r=o.variables.find(function(e){return e.identifier===t}))===null||r===void 0?void 0:r.correctResponse)!==null&&n!==void 0?n:""}},n={getVariable:function t(t){var n;return(n=e._context)===null||n===void 0?void 0:n.variables.find(function(e){return e.identifier===t})},updateOutcomeVariable:function t(t,n){e.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:t,value:n}}))},updateResponseVariable:function t(t,n){e.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:t,response:n}}))}};return iL(this,lA).call(this,this._context,t,n)}}]);return t}(av);lA=new WeakMap;lR([m({context:aV,subscribe:!0}),r()],lT.prototype,"_context",void 0);var lI=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"render",value:function e(){return o5(er(),this.showStatus)}},{key:"connectedCallback",value:function e(){p(f(t.prototype),"connectedCallback",this).call(this),this.checkShowFeedback(this.outcomeIdentifier)}}]);return t}(si);lI.styles=ob(ei());var lP=lI;var lO=function e(e){return e!==null&&e!==void 0?e:o7};var lM=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments),e.render=function(){return o5(eo(),lO(e.showStatus))};return e}d(t,[{key:"connectedCallback",value:function e(){p(f(t.prototype),"connectedCallback",this).call(this),this.checkShowFeedback(this.outcomeIdentifier)}}]);return t}(si);lM.styles=ob(ea());var lN=lM;var lD=ob(es());var lL=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"render",value:function e(){return o5(el())}}]);return t}(av);lL.styles=lD;var lU=lL;var lj=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"render",value:function e(){return o5(ec(),this.showStatus==="on",this.closeFeedback)}},{key:"openFeedback",value:function e(){var e;var t=(e=this.shadowRoot)===null||e===void 0?void 0:e.querySelector("dialog");t&&!t.open&&t.showModal()}},{key:"closeFeedback",value:function e(){var e;var t=(e=this.shadowRoot)===null||e===void 0?void 0:e.querySelector("dialog");t&&t.open&&(t.close(),this.showStatus="off")}},{key:"connectedCallback",value:function e(){p(f(t.prototype),"connectedCallback",this).call(this),this.showStatus==="on"&&this.openFeedback()}},{key:"updated",value:function e(e){e.has("showStatus")&&(this.showStatus==="on"?this.openFeedback():this.closeFeedback())}}]);return t}(si);lj.styles=ob(eu());var lz=lj;var lV=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},lW=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments),e.externalScored=null;return e}d(t,[{key:"render",value:function e(){var e=this;var t,n;var r=(n=this.itemContext)===null||n===void 0?void 0:(t=n.variables.find(function(t){return t.identifier===e.identifier}))===null||t===void 0?void 0:t.value;return o5(ed(),JSON.stringify(r,null,2))}},{key:"interpolationTable",get:function e(){var e=this.querySelector("qti-interpolation-table");if(e){var t=new Map;var n=true,r=false,o=undefined;try{for(var a=e.querySelectorAll("qti-interpolation-table-entry")[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;!l.getAttribute("source-value")&&l.getAttribute("target-value")&&console.error("source-value or target-value is missing in qti-interpolation-table-entry");var c=parseFloat(l.getAttribute("source-value")),u=parseFloat(l.getAttribute("target-value"));(isNaN(c)||isNaN(u))&&console.error("source-value or target-value is not a number in qti-interpolation-table-entry"),t.set(c,u)}}catch(e){r=true;o=e}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(r){throw o}}}return t}return null}},{key:"connectedCallback",value:function e(){p(f(t.prototype),"connectedCallback",this).call(this);var e=this.defaultValues(this.cardinality),n={identifier:this.identifier,cardinality:this.cardinality,baseType:this.baseType,defaultValue:e,type:"outcome",value:null,interpolationTable:this.interpolationTable,externalScored:this.externalScored};n.value=e,(n.value===null||n.value==null)&&(n.baseType==="integer"||n.baseType==="float")&&(n.value="0"),this.dispatchEvent(new CustomEvent("qti-register-variable",{bubbles:!0,composed:!0,detail:{variable:n}}))}}]);return t}(a5);lW.styles=[ob(eh())];var lF=lW;lV([n({type:String,attribute:"base-type"})],lF.prototype,"baseType",void 0);lV([n({type:String,attribute:"external-scored"})],lF.prototype,"externalScored",void 0);lV([n({type:String})],lF.prototype,"identifier",void 0);lV([n({type:String})],lF.prototype,"cardinality",void 0);lV([m({context:aV,subscribe:!0}),r()],lF.prototype,"itemContext",void 0);var lB=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},l$,lH,lQ,lG,lX=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,l$);return e}d(t,[{key:"render",value:function e(){var e=this;var t,n;var r=(n=this.itemContext)===null||n===void 0?void 0:(t=n.variables.find(function(t){return t.identifier===e.identifier}))===null||t===void 0?void 0:t.value;return o5(ep(),JSON.stringify(r,null,2))}},{key:"connectedCallback",value:function e(){p(f(t.prototype),"connectedCallback",this).call(this);var e=this.defaultValues(this.cardinality),n={baseType:this.baseType,identifier:this.identifier,correctResponse:iL(this,l$,lH),cardinality:this.cardinality||"single",mapping:iL(this,l$,lQ),defaultValue:e,areaMapping:iL(this,l$,lG),value:null,type:"response",candidateResponse:null};n.value=e,this.dispatchEvent(new CustomEvent("qti-register-variable",{bubbles:!0,composed:!0,detail:{variable:n}}))}}]);return t}(a5);l$=new WeakSet,lH=function e(){var e,t=this.querySelector("qti-correct-response");if(t){var n=t.querySelectorAll("qti-value");if(this.cardinality==="single"&&n.length>0)e=n[0].textContent.trim(),n[0].remove();else if(this.cardinality!=="single"){e=[];for(var r=0;r<n.length;r++)e.push(n[r].textContent.trim()),n[r].remove()}}return e},lQ=function e(){var e=this.querySelector("qti-mapping"),t=parseFloat(e===null||e===void 0?void 0:e.getAttribute("lower-bound")),n=parseFloat(e===null||e===void 0?void 0:e.getAttribute("upper-bound"));return{defaultValue:Number(e===null||e===void 0?void 0:e.getAttribute("default-value"))||0,lowerBound:isNaN(t)?null:t,upperBound:isNaN(n)?null:n,mapEntries:Array.from((e===null||e===void 0?void 0:e.querySelectorAll("qti-map-entry"))||[]).map(function(e){return{mapKey:e.getAttribute("map-key")||"",mappedValue:Number(e.getAttribute("mapped-value"))||0,caseSensitive:e.hasAttribute("case-sensitive")?e.getAttribute("case-sensitive")!=="false":!1}})}},lG=function e(){var e=this.querySelector("qti-area-mapping"),t=Number(e===null||e===void 0?void 0:e.getAttribute("default-value"))||0,n=parseFloat(e===null||e===void 0?void 0:e.getAttribute("lower-bound")),r=parseFloat(e===null||e===void 0?void 0:e.getAttribute("upper-bound")),o=Array.from((e===null||e===void 0?void 0:e.querySelectorAll("qti-area-map-entry"))||[]).map(function(e){return{shape:e.getAttribute("shape")||"default",coords:e.getAttribute("coords")||"",mappedValue:Number(e.getAttribute("mapped-value"))||0,defaultValue:Number(e.getAttribute("default-value"))||0}});return{defaultValue:t,lowerBound:isNaN(n)?null:n,upperBound:isNaN(r)?null:r,areaMapEntries:o}},lX.styles=[ob(ef())];var lK=lX;lB([n({type:String,attribute:"base-type"})],lK.prototype,"baseType",void 0);lB([n({type:String})],lK.prototype,"identifier",void 0);lB([n({type:String})],lK.prototype,"cardinality",void 0);lB([m({context:aV,subscribe:!0}),r()],lK.prototype,"itemContext",void 0);var lY='<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>',lJ='<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>',lZ='<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 l0,l1,l3=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,l0);return e}d(t,[{key:"render",value:function e(){return o5(ev())}},{key:"process",value:function e(){if(!this.closest("qti-assessment-item"))return;var e=N(this.children);var t=true,n=false,r=undefined;try{for(var o=e[Symbol.iterator](),a;!(t=(a=o.next()).done);t=true){var s=a.value;s.process()}}catch(e){n=true;r=e}finally{try{if(!t&&o.return!=null){o.return()}}finally{if(n){throw r}}}}},{key:"firstUpdated",value:function e(e){if(this.getAttribute("template")){var t=this.getAttribute("template").split("/"),n=t[t.length-1].replace(".xml","");switch(this.innerHTML="",n){case"map_response":{this.appendChild(iz(this,l0,l1).call(this,lJ).firstElementChild.firstElementChild);break}case"map_response_point":{this.appendChild(iz(this,l0,l1).call(this,lZ).firstElementChild.firstElementChild);break}case"match_correct":this.appendChild(iz(this,l0,l1).call(this,lY).firstElementChild.firstElementChild);break}}}}]);return t}(av);l0=new WeakSet,l1=function e(e){return document.createRange().createContextualFragment(e)},l3.styles=[ob(eg())];var l2=l3;var l5=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},l4=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"handleclassNamesChange",value:function e(){var e=this;this.classNames.split(" ").forEach(function(t){switch(t){case"qti-rubric-discretionary-placement":{var n=new CustomEvent("qti-rubric:discretionary-placement",{detail:{className:t,element:e},bubbles:!0,composed:!0,cancelable:!0});if(!e.dispatchEvent(n))return;e.setAttribute("slot","qti-rubric-block")}break;case"qti-rubric-inline":e.setAttribute("slot","");break;default:break}})}},{key:"render",value:function e(){return o5(em())}}]);return t}(av);l4.styles=ob(eb());var l6=l4;l5([n({type:String})],l6.prototype,"id",void 0);l5([n({type:String})],l6.prototype,"use",void 0);l5([n({type:String})],l6.prototype,"view",void 0);l5([n({type:String,attribute:"class"})],l6.prototype,"classNames",void 0);l5([O("classNames",{waitUntilFirstUpdate:!0})],l6.prototype,"handleclassNamesChange",null);var l8,l7,l9,ce=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,l7);iU(e,l8,null);return e}d(t,[{key:"firstUpdated",value:function e(e){var n=this;p(f(t.prototype),"firstUpdated",this).call(this,e);var r=this.getAttribute("href");if(r!==null&&fetch(r).then(function(e){return e.text()}).then(function(e){var t=iz(n,l7,l9).call(n,e);ij(n,l8,document.createElement("style")),iL(n,l8).media="screen",iL(n,l8).textContent="@scope {".concat(t,"}"),n.parentElement?n.parentElement.appendChild(iL(n,l8)):console.warn("No parent element to append the scoped stylesheet to.")}).catch(function(e){console.error("Failed to load stylesheet:",e)}),this.textContent!==null&&this.textContent.trim()!==""){var o=iz(this,l7,l9).call(this,this.textContent);ij(this,l8,document.createElement("style")),iL(this,l8).media="screen",iL(this,l8).textContent="@scope {".concat(o,"}"),this.parentElement?this.parentElement.appendChild(iL(this,l8)):console.warn("No parent element to append the scoped stylesheet to.")}}},{key:"disconnectedCallback",value:function e(){if(iL(this,l8))try{iL(this,l8).remove()}catch(e){console.error("Could not remove stylesheet:",e)}p(f(t.prototype),"disconnectedCallback",this).call(this)}}]);return t}(av);l8=new WeakMap,l7=new WeakSet,l9=function e(e){return e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\s+/g," ").replace(/\s*([{}:;])\s*/g,"$1").trim()};var ct=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"render",value:function e(){return o5(ey())}},{key:"calculate",value:function e(){var e=N(this.children);if(e.length!==1)return console.error("qti-template-constraint must have exactly one child expression"),!0;try{return!!e[0].calculate()}catch(e){return console.error("Error evaluating template constraint:",e),!0}}},{key:"getSubRules",value:function e(){return[]}},{key:"process",value:function e(){var e=this.calculate();return e||console.debug("Template constraint not satisfied, restarting template processing"),e}}]);return t}(av);var cn=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},cr,ci,co,ca,cs,cl=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,ci);iU(e,cr);e.identifier="",e.cardinality="single",e.baseType="string",e.mathVariable=!1,e.paramVariable=!1,ij(e,cr,null);return e}d(t,[{key:"render",value:function e(){return o5(ew())}},{key:"connectedCallback",value:function e(){var e=this;p(f(t.prototype),"connectedCallback",this).call(this),this.updateComplete.then(function(){iz(e,ci,co).call(e),iz(e,ci,cs).call(e)})}},{key:"getTemplateVariable",value:function e(){return{identifier:this.identifier,cardinality:this.cardinality,baseType:this.baseType,value:iL(this,cr),type:"template",mathVariable:this.mathVariable,paramVariable:this.paramVariable}}}]);return t}(av);cr=new WeakMap,ci=new WeakSet,co=function e(){var e;var t=this.querySelector("qti-default-value");if(!t)return;var n=((e=t.textContent)===null||e===void 0?void 0:e.trim())||"";ij(this,cr,iz(this,ci,ca).call(this,n))},ca=function e(e){if(!e)return null;switch(this.baseType){case"integer":return parseInt(e,10);case"float":case"duration":return parseFloat(e);case"boolean":return e.toLowerCase()==="true";default:return e}},cs=function e(){var e;var t=_(k({},{identifier:this.identifier,cardinality:this.cardinality,baseType:this.baseType,defaultValue:iL(this,cr),value:iL(this,cr),type:"template",mathVariable:this.mathVariable,paramVariable:this.paramVariable}),{value:((e=iL(this,cr))===null||e===void 0?void 0:e.toString())||""});this.dispatchEvent(new CustomEvent("qti-register-variable",{bubbles:!0,composed:!0,detail:{variable:t}}))},cl.styles=[ob(eq())];var cc=cl;cn([n({type:String})],cc.prototype,"identifier",void 0);cn([n({type:String})],cc.prototype,"cardinality",void 0);cn([n({type:String,attribute:"base-type"})],cc.prototype,"baseType",void 0);cn([n({type:Boolean,attribute:"math-variable"})],cc.prototype,"mathVariable",void 0);cn([n({type:Boolean,attribute:"param-variable"})],cc.prototype,"paramVariable",void 0);var cu,cd=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,cu,100);return e}d(t,[{key:"render",value:function e(){return o5(ek())}},{key:"process",value:function e(){if(!this.closest("qti-assessment-item")){console.warn("qti-template-processing must be inside qti-assessment-item");return}var e=0,t=!1;do{if(t=!1,e++,e>iL(this,cu)){console.error("Template processing exceeded maximum iterations. Possible infinite loop.");break}try{var n=N(this.children);var r=true,o=false,a=undefined;try{for(var s=n[Symbol.iterator](),l;!(r=(l=s.next()).done);r=true){var c=l.value;if(c.tagName.toLowerCase()==="qti-template-constraint"){if(c.calculate()===!1){t=!0;break}}else c.process()}}catch(e){o=true;a=e}finally{try{if(!r&&s.return!=null){s.return()}}finally{if(o){throw a}}}}catch(e){console.error("Error during template processing:",e);break}}while(t);this.dispatchEvent(new CustomEvent("qti-template-processing-complete",{bubbles:!0,composed:!0,detail:{iterations:e}}))}},{key:"firstUpdated",value:function e(e){this.getAttribute("template")&&console.info("Template processing with external template not yet implemented")}}]);return t}(av);cu=new WeakMap,cd.styles=[ob(ex())];var ch=cd;var cp=[{tag:"qti-assessment-item",ctor:s4},{tag:"qti-assessment-stimulus-ref",ctor:lb},{tag:"qti-companion-materials-info",ctor:ly},{tag:"qti-content-body",ctor:l_},{tag:"qti-context-declaration",ctor:lS},{tag:"qti-custom-operator",ctor:lT},{tag:"qti-feedback-block",ctor:lP},{tag:"qti-feedback-inline",ctor:lN},{tag:"qti-item-body",ctor:lU},{tag:"qti-modal-feedback",ctor:lz},{tag:"qti-outcome-declaration",ctor:lF},{tag:"qti-response-declaration",ctor:lK},{tag:"qti-response-processing",ctor:l2},{tag:"qti-rubric-block",ctor:l6},{tag:"qti-stylesheet",ctor:ce},{tag:"qti-template-constraint",ctor:ct},{tag:"qti-template-declaration",ctor:cc},{tag:"qti-template-processing",ctor:ch}];var cf=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"render",value:function e(){return o5(e_())}}]);return t}(lz);cf.styles=ob(eE());var cv=cf;var cg=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},cm,cb=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,cm);e.identifier="",e.class="",e.navigationMode="nonlinear",e.submissionMode="individual",ij(e,cm,"");return e}d(t,[{key:"title",get:function e(){return iL(this,cm)},set:function e(e){ij(this,cm,e),this.removeAttribute("title"),this.setAttribute("data-title",e)}},{key:"connectedCallback",value:function e(){var e=this;var n=this,r=function n(){return p(f(t.prototype),"connectedCallback",e)};return a(function(){return z(this,function(e){switch(e.label){case 0:r().call(n);return[4,this.updateComplete];case 1:e.sent(),this.dispatchEvent(new Event("qti-test-part-connected",{bubbles:!0,composed:!0}));return[2]}})}).call(this)}},{key:"render",value:function e(){return o5(eC())}}]);return t}(av);cm=new WeakMap;cg([n({type:String})],cb.prototype,"identifier",void 0);cg([n({type:String})],cb.prototype,"class",void 0);cg([n({type:String,attribute:"navigation-mode"})],cb.prototype,"navigationMode",void 0);cg([n({type:String,attribute:"submission-mode"})],cb.prototype,"submissionMode",void 0);var cy=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},cw,cq=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t);iU(e,cw);e.addEventListener("qti-assessment-test-connected",function(t){return ij(e,cw,t.detail)});return e}d(t,[{key:"getResult",value:function e(){var e,t,n;var r,o;var a=(e=(r=this.getAttribute("include-category"))===null||r===void 0?void 0:r.split(" "))!==null&&e!==void 0?e:[],s=(t=(o=this.getAttribute("exclude-category"))===null||o===void 0?void 0:o.split(" "))!==null&&t!==void 0?t:[],l=(n=this.getAttribute("weight-identifier"))!==null&&n!==void 0?n:"",c=this.getAttribute("variable-identifier"),u=Array.from(iL(this,cw).querySelectorAll("qti-asssessment-test qti-assessment-item-ref")).filter(function(e){var t=!0;return a.length>0&&(t=a.includes(e.category)),s.length>0&&(t=!s.includes(e.category)),t}).map(function(e){var t=1;if(l){var n=e.weigths.get(l);n!=null&&(t=n)}return{item:e.identifier,weight:t}});return new ck(this._testContext,c,u).calculate()}},{key:"calculate",value:function e(){return this.getResult()}}]);return t}(a8);cw=new WeakMap;cy([m({context:aK,subscribe:!0})],cq.prototype,"_testContext",void 0);var ck=/*#__PURE__*/function(){"use strict";function e(t,n,r){l(this,e);this.testContext=t,this.itemVariable=n,this.includedItems=r}d(e,[{key:"calculate",value:function e(){var e=this;var t=this.testContext,n=t.items,r=0,o=N(new Set(this.includedItems.map(function(e){return e.item})));return n.forEach(function(t){if(o.includes(t.identifier)){var n;var a;var s=t.variables.find(function(t){return t.identifier===e.itemVariable}),l=(n=(a=e.includedItems.find(function(e){return e.item===t.identifier}))===null||a===void 0?void 0:a.weight)!==null&&n!==void 0?n:1;s&&(r+=Number(s.value)*l)}}),r}}]);return e}();var cx=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},c_=function e(e){var t=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++){n[r]=arguments[r]}l(this,t);var o;o=s(this,t,N(n)),o.navigate=null,o.requestTimeout=3e4,o.postLoadTransformCallback=null,o.postLoadTestTransformCallback=null,o._activeController=null,o._loadResults=[],o._navigationId=0,o._loadingState={expectedItems:0,connectedItems:0,expectedStimulus:0,loadedStimulus:0,isComplete:!1},o._loadedStimulusHrefs=new Set,o._loadingStimulusHrefs=new Set,o._bindEventHandlers();return o}d(t,[{key:"navigateTo",value:function e(e,t){var n=t||this._getDefaultNavigationId(e);n&&this.dispatchEvent(new CustomEvent("qti-request-navigation",{detail:{type:e,id:n},bubbles:!0,composed:!0}))}},{key:"_bindEventHandlers",value:function e(){this.addEventListener("qti-request-navigation",this._handleNavigationRequest.bind(this)),this.addEventListener("qti-assessment-test-connected",this._handleTestConnected.bind(this)),this.addEventListener("qti-assessment-item-connected",this._handleItemConnected.bind(this)),this.addEventListener("qti-assessment-stimulus-ref-connected",this._handleStimulusRefConnected.bind(this))}},{key:"_handleTestConnected",value:function e(e){this._testElement=e.detail,this._initializeNavigation()}},{key:"_handleItemConnected",value:function e(e){var t=e.detail;this._loadingState.connectedItems++;var n=t.querySelectorAll("qti-assessment-stimulus-ref");this._loadingState.expectedStimulus+=n.length,this._checkLoadingComplete()}},{key:"_handleStimulusRefConnected",value:function e(e){return a(function(){var t,n,r;return z(this,function(o){switch(o.label){case 0:e.preventDefault();t=e.element,n=e.item;if(console.info("Stimulus ref connected:",{identifier:t.identifier,href:t.href,item:n.identifier}),this._loadedStimulusHrefs.has(t.href)){console.info("Stimulus already loaded, skipping:",t.href),this._loadingState.loadedStimulus++,this._checkLoadingComplete();return[2]}if(this._loadingStimulusHrefs.has(t.href)){console.info("Stimulus already loading, skipping duplicate:",t.href),this._loadingState.loadedStimulus++,this._checkLoadingComplete();return[2]}this._loadingStimulusHrefs.add(t.href),console.info("Starting stimulus load:",t.href);o.label=1;case 1:o.trys.push([1,3,4,5]);return[4,this._loadStimulusRef(t,n)];case 2:o.sent(),this._loadedStimulusHrefs.add(t.href),this._loadingState.loadedStimulus++,console.info("Stimulus loaded successfully:",t.href),this._checkLoadingComplete();return[3,5];case 3:r=o.sent();r.name!=="AbortError"&&console.warn("Failed to load stimulus ".concat(t.identifier,":"),r),this._loadingState.loadedStimulus++,this._checkLoadingComplete();return[3,5];case 4:this._loadingStimulusHrefs.delete(t.href);return[7];case 5:return[2]}})}).call(this)}},{key:"_getDefaultNavigationId",value:function e(e){var t;var n,r,o,a,s;return e==="section"?(r=this._testElement)===null||r===void 0?void 0:(n=r.querySelector("qti-assessment-section"))===null||n===void 0?void 0:n.identifier:(t=(o=this.sessionContext)===null||o===void 0?void 0:o.navItemRefId)!==null&&t!==void 0?t:(s=this._testElement)===null||s===void 0?void 0:(a=s.querySelector("qti-assessment-item-ref"))===null||a===void 0?void 0:a.identifier}},{key:"_initializeNavigation",value:function e(){if(!this.navigate)return;var e=this._getDefaultNavigationId(this.navigate);e&&this.navigateTo(this.navigate,e)}},{key:"_handleNavigationRequest",value:function e(e){return a(function(e){var t,n,r,o;return z(this,function(a){switch(a.label){case 0:t=e.detail;if(!(t===null||t===void 0?void 0:t.id))return[2];this._cancelPreviousNavigation();n=++this._navigationId,r=new AbortController;a.label=1;case 1:a.trys.push([1,3,4,5]);this._dispatchLoadingStarted(t.type,t.id),this._activeController=r;return[4,this._executeNavigation(t.type,t.id,n,r)];case 2:a.sent();return[3,5];case 3:o=a.sent();this._handleNavigationError(o,t.type,t.id);return[3,5];case 4:this._activeController===r&&(this._activeController=null),this._dispatchLoadingEnded(t.type,t.id);return[7];case 5:return[2]}})}).apply(this,arguments)}},{key:"_handleNavigationError",value:function e(e,t,n){e.name!=="AbortError"&&this._dispatchError(this._createNavigationError(e,t,n))}},{key:"_executeNavigation",value:function e(e,t,n,r){return a(function(){var o;return z(this,function(a){switch(a.label){case 0:if(!(e==="item"))return[3,2];return[4,this._navigateToItem(t,n,r)];case 1:o=a.sent();return[3,4];case 2:return[4,this._navigateToSection(t,n,r)];case 3:o=a.sent();a.label=4;case 4:o;return[2]}})}).call(this)}},{key:"_navigateToItem",value:function e(e,t,n){return a(function(){var r;return z(this,function(o){switch(o.label){case 0:r=this._findItemRef(e);this._updateSessionContext(r,e),this._resetLoadingState(),this._loadingState.expectedItems=1;return[4,this._loadItems([e],t,n)];case 1:o.sent();return[4,this._waitForLoadingComplete(t,n)];case 2:o.sent(),!this._isStaleNavigation(t,n)&&this._dispatchTestLoaded(this._loadResults);return[2]}})}).call(this)}},{key:"_navigateToSection",value:function e(e,t,n){return a(function(){var r,o,a,s;return z(this,function(l){switch(l.label){case 0:a=(o=this._findSection(e))===null||o===void 0?void 0:(r=o.closest("qti-test-part"))===null||r===void 0?void 0:r.identifier;this.sessionContext=_(k({},this.sessionContext),{navPartId:a,navSectionId:e,navItemRefId:null});s=this._getSectionItemIds(e);this._resetLoadingState(),this._loadingState.expectedItems=s.length;return[4,this._loadItems(s,t,n)];case 1:l.sent();return[4,this._waitForLoadingComplete(t,n)];case 2:l.sent(),!this._isStaleNavigation(t,n)&&this._dispatchTestLoaded(this._loadResults);return[2]}})}).call(this)}},{key:"_resetLoadingState",value:function e(){this._loadingState={expectedItems:0,connectedItems:0,expectedStimulus:0,loadedStimulus:0,isComplete:!1},this._loadedStimulusHrefs.clear(),this._loadingStimulusHrefs.clear()}},{key:"_checkLoadingComplete",value:function e(){var e=this._loadingState.connectedItems>=this._loadingState.expectedItems,t=this._loadingState.loadedStimulus>=this._loadingState.expectedStimulus;e&&t&&!this._loadingState.isComplete&&(this._loadingState.isComplete=!0)}},{key:"_waitForLoadingComplete",value:function e(e,t){return a(function(){return z(this,function(n){switch(n.label){case 0:if(!!this._loadingState.isComplete)return[3,3];if(this._isStaleNavigation(e,t))return[2];return[4,new Promise(function(e){return setTimeout(e,10)})];case 1:n.sent();n.label=2;case 2:return[3,0];case 3:return[2]}})}).call(this)}},{key:"getLoadingProgress",value:function e(){return k({},this._loadingState)}},{key:"_loadStimulusRef",value:function e(e,t){return a(function(){var n;return z(this,function(r){switch(r.label){case 0:console.info("Loading stimulus:",e.href);return[4,this._loadStimulus(e.href)];case 1:n=r.sent();console.info("Stimulus loaded, applying content:",n?"has content":"no content"),this._applyStimulusContent(n,e,t);return[2]}})}).call(this)}},{key:"_applyStimulusContent",value:function e(e,t,n){if(!e){console.warn("No stimulus content to apply");return}var r=e.querySelectorAll("qti-stimulus-body, qti-stylesheet");if(console.info("Found ".concat(r.length," stimulus elements to apply for ").concat(t.identifier)),r.length===0){console.warn("No qti-stimulus-body or qti-stylesheet elements found in stimulus");return}var o=[],a=n.querySelector('[data-stimulus-idref="'.concat(t.identifier,'"]'));if(a)o.push(a),console.info("Found specific target:",a);else{var s=Array.from(this.querySelectorAll('[data-stimulus-idref="'.concat(t.identifier,'"]')));if(s.length>0)o=s,console.info("Found targets by identifier:",s.length);else{var l=Array.from(this.querySelectorAll("[data-stimulus-idref]"));o=l,console.info("Using fallback targets:",l.length)}}if(o.length===0){console.warn("No targets found for stimulus content");return}o.forEach(function(e,t){var n;e.innerHTML="";var a=Array.from(r).map(function(e){return e.cloneNode(!0)});(n=e).append.apply(n,N(a)),console.info("Applied stimulus content to target ".concat(t+1,"/").concat(o.length))})}},{key:"_cancelPreviousNavigation",value:function e(){this._activeController&&(this._activeController.abort(),console.info("Previous navigation request cancelled")),this._clearNavigationState()}},{key:"_clearNavigationState",value:function e(){this._clearLoadedItems(),this._resetLoadingState(),this._loadResults=[]}},{key:"_loadItems",value:function e(e,t,n){return a(function(){var r,o,a;return z(this,function(s){switch(s.label){case 0:r=this;if(!this._testElement||e.length===0)return[2];o=e.map(function(e){return r._findItemRef(e)});this._clearLoadedItems(),this._clearStimulusRef();return[4,Promise.all(o.map(function(e){return r._loadSingleItem(e,t,n)}))];case 1:a=s.sent().filter(Boolean);this._isStaleNavigation(t,n)||(a.forEach(function(e){var t=e.itemRef,n=e.doc;t&&n&&(t.xmlDoc=n)}),a.forEach(function(e){var t=e.itemRef;var n;var o=t===null||t===void 0?void 0:t.identifier;if(!t||!o)return;var a=(n=r.testContext.items.find(function(e){return e.identifier===o}))===null||n===void 0?void 0:n.state;a!==void 0&&t.updateComplete.then(function(){var e=t.assessmentItem;e&&(e.state=a)})}),this._loadResults=a);return[2]}})}).call(this)}},{key:"_loadSingleItem",value:function e(e,t,n){return a(function(){var r,o,a,s,l,c,u;return z(this,function(d){switch(d.label){case 0:d.trys.push([0,4,,5]);s=(a=this.querySelector("test-navigation"))===null||a===void 0?void 0:(o=a.qtiContext)===null||o===void 0?void 0:(r=o.QTI_CONTEXT)===null||r===void 0?void 0:r.seed;return[4,ln().load(e.href,n.signal)];case 1:l=d.sent().shuffleInteractions(s);c=this.postLoadTransformCallback;if(!c)return[3,3];return[4,this.postLoadTransformCallback(l,e)];case 2:c=l=d.sent();d.label=3;case 3:return[2,(c,this._isStaleNavigation(t,n)?null:{itemRef:e,doc:l.htmlDoc(this._customElementRegistry())})];case 4:u=d.sent();if(u.name==="AbortError")throw console.info("Item load for ".concat(e.identifier," was aborted")),u;return[2,(console.warn("Failed to load item ".concat(e.identifier,":"),u),null)];case 5:return[2]}})}).call(this)}},{key:"_loadStimulus",value:function e(e){return a(function(){var t;return z(this,function(n){switch(n.label){case 0:return[4,ln().load(e,(t=this._activeController)===null||t===void 0?void 0:t.signal)];case 1:return[2,n.sent().htmlDoc(this._customElementRegistry())]}})}).call(this)}},{key:"_customElementRegistry",value:function e(){var e;var t=this.querySelector("test-container");if(t)return(e=t.customElementRegistry)!==null&&e!==void 0?e:void 0}},{key:"_findItemRef",value:function e(e){var t;var n=(t=this._testElement)===null||t===void 0?void 0:t.querySelector('qti-assessment-item-ref[identifier="'.concat(e,'"]'));if(!n)throw new Error('Item with identifier "'.concat(e,'" not found'));return n}},{key:"_findSection",value:function e(e){var t;return((t=this._testElement)===null||t===void 0?void 0:t.querySelector('qti-assessment-section[identifier="'.concat(e,'"]')))||null}},{key:"_updateSessionContext",value:function e(e,t){var n,r;var o=(n=e.closest("qti-test-part"))===null||n===void 0?void 0:n.identifier,a=(r=e.closest("qti-assessment-section"))===null||r===void 0?void 0:r.identifier;this.sessionContext=_(k({},this.sessionContext),{navPartId:o,navSectionId:a,navItemRefId:t})}},{key:"_getSectionItemIds",value:function e(e){return Array.from(this._testElement.querySelectorAll('qti-assessment-section[identifier="'.concat(e,'"] > qti-assessment-item-ref'))).map(function(e){return e.identifier}).filter(Boolean)}},{key:"_clearLoadedItems",value:function e(){var e;var t=(e=this._testElement)===null||e===void 0?void 0:e.querySelectorAll("qti-assessment-item-ref");Array.from(t||[]).forEach(function(e){e.xmlDoc=null})}},{key:"_clearStimulusRef",value:function e(){this.querySelectorAll("[data-stimulus-idref]").forEach(function(e){return e.innerHTML=""})}},{key:"_isStaleNavigation",value:function e(e,t){return t.signal.aborted||e!==this._navigationId}},{key:"_createNavigationError",value:function e(e,t,n){return{message:e.message||"Failed to load ".concat(t,": ").concat(n),details:e,itemId:t==="item"?n:void 0,sectionId:t==="section"?n:void 0}}},{key:"_dispatchLoadingStarted",value:function e(e,t){this.dispatchEvent(new CustomEvent("qti-navigation-loading-started",{detail:{type:e,id:t},bubbles:!0,composed:!0}))}},{key:"_dispatchLoadingEnded",value:function e(e,t){this.dispatchEvent(new CustomEvent("qti-navigation-loading-ended",{detail:{type:e,id:t},bubbles:!0,composed:!0}))}},{key:"_dispatchError",value:function e(e){this.dispatchEvent(new CustomEvent("qti-navigation-error",{detail:e,bubbles:!0,composed:!0}))}},{key:"_dispatchTestLoaded",value:function e(e){var t=this;requestAnimationFrame(function(){t.dispatchEvent(new CustomEvent("qti-test-loaded",{detail:e.map(function(e){var t=e.itemRef;return{identifier:t===null||t===void 0?void 0:t.identifier,element:t}}),bubbles:!0,composed:!0}))})}}]);return t}(e);return cx([n({type:String})],t.prototype,"navigate",void 0),cx([n({type:Number})],t.prototype,"requestTimeout",void 0),cx([n({attribute:!1})],t.prototype,"postLoadTransformCallback",void 0),cx([n({attribute:!1})],t.prototype,"postLoadTestTransformCallback",void 0),t};var cE=function e(e){var t=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++){n[r]=arguments[r]}l(this,t);var o;o=s(this,t,N(n)),o.sessionContext=_(k({},o.sessionContext),{view:"candidate"}),o.addEventListener("on-test-switch-view",function(e){o.sessionContext=_(k({},o.sessionContext),{view:e.detail}),o._updateElementView()}),o.addEventListener("qti-assessment-test-connected",function(){o._updateElementView()}),o.addEventListener("qti-assessment-item-connected",function(e){o._updateElementView(),o._setCorrectResponseVisibility(e.detail)});return o}d(t,[{key:"willUpdate",value:function e(e){p(f(t.prototype),"willUpdate",this).call(this,e),e.has("sessionContext")&&this._updateElementView()}},{key:"_updateElementView",value:function e(){var e=this;if(this._testElement){var t;Array.from(this._testElement.querySelectorAll("[view]")).forEach(function(t){t.classList.toggle("show",t.getAttribute("view")===e.sessionContext.view)});var n=(t=this._testElement.querySelector('qti-assessment-item-ref[identifier="'.concat(this.sessionContext.navItemRefId,'"]')))===null||t===void 0?void 0:t.assessmentItem;n&&this.updateAssessmentItemView(n,this.sessionContext.view)}}},{key:"_setCorrectResponseVisibility",value:function e(e){this.updateAssessmentItemView(e,this.sessionContext.view)}},{key:"updateAssessmentItemView",value:function e(e,t){}}]);return t}(e);return t};var cC=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},cS=function e(e){var t=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++){n[r]=arguments[r]}l(this,t);var o;o=s(this,t,N(n)),o.testContext=aX,o.sessionContext=aQ,o._updateItemInTestContext=function(e){var t;var n=e._context,r=n.identifier,a=n.variables,s=o.testContext.items.find(function(e){return(e===null||e===void 0?void 0:e.identifier)===r});if(!s){console.warn("Item IDs between assessment.xml and item.xml should match: ".concat(r," is not found!"));return}if(((t=s.variables)===null||t===void 0?void 0:t.length)===1)o._updateItemVariablesInTestContext(r,a);else{var l=N(e.variables);var c=true,u=false,d=undefined;try{var h=function(){var e=f.value;var t=l.find(function(t){return t.identifier===e.identifier});t?t.value=e.value:l.push(e)};for(var p=s.variables[Symbol.iterator](),f;!(c=(f=p.next()).done);c=true)h()}catch(e){u=true;d=e}finally{try{if(!c&&p.return!=null){p.return()}}finally{if(u){throw d}}}e.variables=l}},o._initializeEventListeners();return o}d(t,[{key:"updateItemVariables",value:function e(e,t){var n=this.testContext.items.find(function(t){return t.identifier===e});n&&(n.variables=n.variables.map(function(e){var n=t.find(function(t){return t.identifier===e.identifier});return n?k({},e,n):e}));var r=this._testElement.querySelector('qti-assessment-item-ref[identifier="'.concat(e,'"]'));r&&r.assessmentItem&&(r.assessmentItem.variables=t)}},{key:"_initializeEventListeners",value:function e(){var e=this;this.addEventListener("qti-assessment-test-connected",function(t){if(e.testContext=aX,e.sessionContext=aQ,e.testContext&&e.testContext.items.length>0)return;e._testElement=t.detail;var n=Array.from(e._testElement.querySelectorAll("qti-assessment-item-ref")).map(function(e){return{href:e.href,identifier:e.identifier,category:e.category,variables:[{identifier:"completionStatus",value:"not_attempted",type:"outcome"}]}});e.testContext=_(k({},e.testContext),{items:n})}),this.addEventListener("qti-assessment-item-connected",function(t){var n;var r=t.detail,o=(n=r.closest("qti-assessment-item-ref"))===null||n===void 0?void 0:n.identifier;o&&(r.assessmentItemRefId=o),e._updateItemInTestContext(t.detail)}),this.addEventListener("qti-item-context-updated",function(t){e._updateItemVariablesInTestContext(t.detail.itemContext.identifier,t.detail.itemContext.variables,t.detail.itemContext.state)})}},{key:"_updateItemVariablesInTestContext",value:function e(e,t,n){this.testContext=_(k({},this.testContext),{items:this.testContext.items.map(function(r){return r.identifier!==e?r:k(_(k({},r),{variables:t.map(function(e){var t=r.variables.find(function(t){return t.identifier===e.identifier});return t?k({},t,e):e})}),n!==void 0?{state:n?k({},n):void 0}:{})})}),this.dispatchEvent(new CustomEvent("qti-test-context-updated",{detail:this.testContext,bubbles:!1,composed:!1}))}}]);return t}(e);return cC([n({attribute:!1,type:Object}),u({context:aK})],t.prototype,"testContext",void 0),cC([n({attribute:!1,type:Object}),u({context:aG})],t.prototype,"sessionContext",void 0),t},cR=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}return t}(cS(av));var cA=function e(e){var t=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++){n[r]=arguments[r]}l(this,t);var o;o=s(this,t,N(n)),o.addEventListener("qti-register-variable",function(e){o.testContext=_(k({},o.testContext),{testOutcomeVariables:N(o.testContext.testOutcomeVariables||[]).concat([e.detail.variable])}),e.stopPropagation()}),o.addEventListener("qti-set-outcome-value",function(e){var t=e.detail,n=t.outcomeIdentifier,r=t.value;o.updateOutcomeVariable(n,r),e.stopPropagation()});return o}d(t,[{key:"outcomeProcessing",value:function e(){var e=this.querySelector("qti-outcome-processing");return e?(e===null||e===void 0?void 0:e.process(),!0):!1}},{key:"updateOutcomeVariable",value:function e(e,t){var n;var r=this.getOutcome(e);if(!r){console.warn("Can not set qti-outcome-identifier: ".concat(e,", it is not available"));return}this.testContext=_(k({},this.testContext),{testOutcomeVariables:(n=this.testContext.testOutcomeVariables)===null||n===void 0?void 0:n.map(function(n){return n.identifier!==e?n:_(k({},n),{value:r.cardinality==="single"?t:N(n.value).concat([t])})})})}},{key:"getOutcome",value:function e(e){return this.getVariable(e)}},{key:"getVariable",value:function e(e){var t;return((t=this.testContext.testOutcomeVariables)===null||t===void 0?void 0:t.find(function(t){return t.identifier===e}))||null}}]);return t}(e);return t};var cT=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},cI=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments),e.configContext={};return e}d(t,[{key:"connectedCallback",value:function e(){var e=this;var n=this,r=function n(){return p(f(t.prototype),"connectedCallback",e)};return a(function(){return z(this,function(e){switch(e.label){case 0:r().call(n);return[4,this.updateComplete];case 1:e.sent(),this.dispatchEvent(new CustomEvent("qti-test-connected",{detail:this}));return[2]}})}).call(this)}},{key:"render",value:function e(){return o5(eS())}}]);return t}(c_(cE(cA(cS(av)))));cT([r(),u({context:aj})],cI.prototype,"configContext",void 0);var cP=ob(eR()),cO=ob(eA(),cP),cM=ob(eT()),cN=ob(eI(),cP);var cD=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t),e.addEventListener("click",function(){e.dispatchEvent(new CustomEvent("test-end-attempt",{bubbles:!0}));var t=e.closest("qti-test").querySelector("test-container");Array.from(t.shadowRoot.querySelectorAll("[view]")).forEach(function(e){e.classList.toggle("show",!0)})});return e}d(t,[{key:"render",value:function e(){return o5(eP())}}]);return t}(av);cD.styles=ob(eO(),cO,cM);var cL=cD;var cU=/*#__PURE__*/function(){"use strict";function e(t){l(this,e);this.G=t}d(e,[{key:"disconnect",value:function e(){this.G=void 0}},{key:"reconnect",value:function e(e){this.G=e}},{key:"deref",value:function e(){return this.G}}]);return e}(),cj=/*#__PURE__*/function(){"use strict";function e(){l(this,e);this.Y=void 0,this.Z=void 0}d(e,[{key:"get",value:function e(){return this.Y}},{key:"pause",value:function e(){var e=this;var t;(t=this.Y)!==null&&t!==void 0?t:this.Y=new Promise(function(t){return e.Z=t})}},{key:"resume",value:function e(){var e,t;(e=(t=this).Z)===null||e===void 0?void 0:e.call(t),this.Y=this.Z=void 0}}]);return e}();var cz=function e(e){return!sk(e)&&typeof e.then=="function"},cV=0x3fffffff,cW=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments),e._$Cwt=cV,e._$Cbt=[],e._$CK=new cU(e),e._$CX=new cj;return e}d(t,[{key:"render",value:function e(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=t.find(function(e){return!cz(e)}))!==null&&r!==void 0?r:o8}},{key:"update",value:function e(e,t){var n,r=function(e){var r=t[e];if(!cz(r))return{v:(n._$Cwt=e,r)};e<s&&r===o[e]||(n._$Cwt=cV,s=0,Promise.resolve(r).then(function(e){return a(function(){var t,n;return z(this,function(o){switch(o.label){case 0:if(!c.get())return[3,3];return[4,c.get()];case 1:o.sent();o.label=2;case 2:return[3,0];case 3:t=l.deref();if(t!==void 0){n=t._$Cbt.indexOf(r);n>-1&&n<t._$Cwt&&(t._$Cwt=n,t.setValue(e))}return[2]}})})()}))};var o=this._$Cbt,s=o.length;this._$Cbt=t;var l=this._$CK,c=this._$CX;this.isConnected||this.disconnected();for(var u=0;u<t.length&&!(u>this._$Cwt);u++){var d=(n=this,r(u));if(D(d)==="object")return d.v}return o8}},{key:"disconnected",value:function e(){this._$CK.disconnect(),this._$CX.pause()}},{key:"reconnected",value:function e(){this._$CK.reconnect(this),this._$CX.resume()}}]);return t}(sN),cF=sb(cW);var cB="\n@layer qti-base, qti-components, qti-extended;\n@layer qti-components.reset, qti-components.global, qti-components.interactions.base,\n qti-components.interactions.brand, qti-components.interactions.states,\n qti-components.interactions.corrections, qti-components.elements, qti-components.overrides;\n/*\n * Layer order, weakest first.\n *\n * qti-base the QTI 3.0 shared class vocabulary and its layout overrides\n * qti-components everything this theme paints (sublayers declared in styles/qti-theme/index.css)\n * qti-extended reserved for the consumer — empty here, and it beats everything above\n *\n * Every stylesheet below is assigned a layer, at its import wherever the file belongs to just one.\n * Nothing is left unlayered: unlayered CSS outranks every layer, so a single stray rule here would\n * sit above the whole theme AND above the `qti-extended` slot consumers are told to author in.\n */\n@layer qti-base{\n/* https://www.imsglobal.org/sites/default/files/spec/qti/v3/guide/img/qti3p0.css */\n/* ============================\n QTI 3 shared css\n 1. Display\n 2. Special Flex styles\n 3. Margin\n 4. Padding\n 5. Horizontal Alignment styles\n 6. Vertical Alignment styles\n 7. Height\n 8. Width\n 9. Text-Indent\n 10. List Style\n 11. Layout\n 12. Other QTI 3 presentation utilities\n ============================ */\n\n/* ==========\n Display css\n =========== */\n\n.qti-display-inline {\n display: inline;\n}\n\n.qti-display-inline-block {\n display: inline-block;\n}\n\n.qti-display-block {\n display: block;\n}\n\n.qti-display-flex {\n display: flex;\n}\n\n.qti-display-inline-flex {\n display: inline-flex;\n}\n\n.qti-display-grid {\n display: grid;\n}\n\n.qti-display-inline-grid {\n display: inline-grid;\n}\n\n.qti-display-table {\n display: table;\n}\n\n.qti-display-table-cell {\n display: table-cell;\n}\n\n.qti-display-table-row {\n display: table-row;\n}\n\n.qti-display-list-item {\n display: list-item;\n}\n\n.qti-display-inherit {\n display: inherit;\n}\n\n/* \n * hidden to screen readers and sighted\n */\n.qti-hidden {\n display: none;\n}\n\n/*\n * visible to screen readers, hidden to sighted\n */\n.qti-visually-hidden {\n position: fixed !important;\n overflow: hidden;\n clip: rect(1px 1px 1px 1px);\n height: 1px;\n width: 1px;\n border: 0;\n margin: -1px;\n}\n\n/* =============================\n Special flex styles\n ============================= */\n\n.qti-flex-direction-column {\n flex-direction: column;\n}\n\n.qti-flex-direction-row {\n flex-direction: row;\n}\n\n.qti-flex-grow-1 {\n flex-grow: 1;\n}\n\n.qti-flex-grow-0 {\n flex-grow: 0;\n}\n\n/* =========\n Margin css\n ========== */\n\n/**\n * For margin Top and Bottom and Left and Right\n */\n.qti-margin-0 {\n margin: 0 !important;\n}\n\n.qti-margin-1 {\n margin: 0.25rem !important;\n}\n\n.qti-margin-2 {\n margin: 0.5rem !important;\n}\n\n.qti-margin-3 {\n margin: 1rem !important;\n}\n\n.qti-margin-4 {\n margin: 1.5rem !important;\n}\n\n.qti-margin-5 {\n margin: 3rem !important;\n}\n\n.qti-margin-auto {\n margin: auto !important;\n}\n\n/*\n For margin Left and Right\n */\n.qti-margin-x-0 {\n margin-right: 0 !important;\n margin-left: 0 !important;\n}\n\n.qti-margin-x-1 {\n margin-right: 0.25rem !important;\n margin-left: 0.25rem !important;\n}\n\n.qti-margin-x-2 {\n margin-right: 0.5rem !important;\n margin-left: 0.5rem !important;\n}\n\n.qti-margin-x-3 {\n margin-right: 1rem !important;\n margin-left: 1rem !important;\n}\n\n.qti-margin-x-4 {\n margin-right: 1.5rem !important;\n margin-left: 1.5rem !important;\n}\n\n.qti-margin-x-5 {\n margin-right: 3rem !important;\n margin-left: 3rem !important;\n}\n\n.qti-margin-x-auto {\n margin-right: auto !important;\n margin-left: auto !important;\n}\n\n/*\n For margin Top and Bottom\n */\n.qti-margin-y-0 {\n margin-top: 0 !important;\n margin-bottom: 0 !important;\n}\n\n.qti-margin-y-1 {\n margin-top: 0.25rem !important;\n margin-bottom: 0.25rem !important;\n}\n\n.qti-margin-y-2 {\n margin-top: 0.5rem !important;\n margin-bottom: 0.5rem !important;\n}\n\n.qti-margin-y-3 {\n margin-top: 1rem !important;\n margin-bottom: 1rem !important;\n}\n\n.qti-margin-y-4 {\n margin-top: 1.5rem !important;\n margin-bottom: 1.5rem !important;\n}\n\n.qti-margin-y-5 {\n margin-top: 3rem !important;\n margin-bottom: 3rem !important;\n}\n\n.qti-margin-y-auto {\n margin-top: auto !important;\n margin-bottom: auto !important;\n}\n\n/*\n For margin Top\n */\n.qti-margin-t-0 {\n margin-top: 0 !important;\n}\n\n.qti-margin-t-1 {\n margin-top: 0.25rem !important;\n}\n\n.qti-margin-t-2 {\n margin-top: 0.5rem !important;\n}\n\n.qti-margin-t-3 {\n margin-top: 1rem !important;\n}\n\n.qti-margin-t-4 {\n margin-top: 1.5rem !important;\n}\n\n.qti-margin-t-5 {\n margin-top: 3rem !important;\n}\n\n.qti-margin-t-auto {\n margin-top: auto !important;\n}\n\n/* \n For margin Bottom\n */\n.qti-margin-b-0 {\n margin-bottom: 0 !important;\n}\n\n.qti-margin-b-1 {\n margin-bottom: 0.25rem !important;\n}\n\n.qti-margin-b-2 {\n margin-bottom: 0.5rem !important;\n}\n\n.qti-margin-b-3 {\n margin-bottom: 1rem !important;\n}\n\n.qti-margin-b-4 {\n margin-bottom: 1.5rem !important;\n}\n\n.qti-margin-b-5 {\n margin-bottom: 3rem !important;\n}\n\n.qti-margin-b-auto {\n margin-bottom: auto !important;\n}\n\n/*\n For margin Start LTR\n */\n.qti-margin-s-0 {\n margin-left: 0 !important;\n}\n\n.qti-margin-s-1 {\n margin-left: 0.25rem !important;\n}\n\n.qti-margin-s-2 {\n margin-left: 0.5rem !important;\n}\n\n.qti-margin-s-3 {\n margin-left: 1rem !important;\n}\n\n.qti-margin-s-4 {\n margin-left: 1.5rem !important;\n}\n\n.qti-margin-s-5 {\n margin-left: 3rem !important;\n}\n\n.qti-margin-s-auto {\n margin-left: auto !important;\n}\n\n/* \n For margin End LTR\n */\n.qti-margin-e-0 {\n margin-right: 0 !important;\n}\n\n.qti-margin-e-1 {\n margin-right: 0.25rem !important;\n}\n\n.qti-margin-e-2 {\n margin-right: 0.5rem !important;\n}\n\n.qti-margin-e-3 {\n margin-right: 1rem !important;\n}\n\n.qti-margin-e-4 {\n margin-right: 1.5rem !important;\n}\n\n.qti-margin-e-5 {\n margin-right: 3rem !important;\n}\n\n.qti-margin-e-auto {\n margin-right: auto !important;\n}\n\n/* =========\n Padding css\n ========== */\n\n/*\n For padding Top and Bottom and Left and Right\n */\n.qti-padding-0 {\n padding: 0 !important;\n}\n\n.qti-padding-1 {\n padding: 0.25rem !important;\n}\n\n.qti-padding-2 {\n padding: 0.5rem !important;\n}\n\n.qti-padding-3 {\n padding: 1rem !important;\n}\n\n.qti-padding-4 {\n padding: 1.5rem !important;\n}\n\n.qti-padding-5 {\n padding: 3rem !important;\n}\n\n/*\n For padding Left and Right\n */\n.qti-padding-x-0 {\n padding-right: 0 !important;\n padding-left: 0 !important;\n}\n\n.qti-padding-x-1 {\n padding-right: 0.25rem !important;\n padding-left: 0.25rem !important;\n}\n\n.qti-padding-x-2 {\n padding-right: 0.5rem !important;\n padding-left: 0.5rem !important;\n}\n\n.qti-padding-x-3 {\n padding-right: 1rem !important;\n padding-left: 1rem !important;\n}\n\n.qti-padding-x-4 {\n padding-right: 1.5rem !important;\n padding-left: 1.5rem !important;\n}\n\n.qti-padding-x-5 {\n padding-right: 3rem !important;\n padding-left: 3rem !important;\n}\n\n/*\n For padding Top and Bottom\n */\n.qti-padding-y-0 {\n padding-top: 0 !important;\n padding-bottom: 0 !important;\n}\n\n.qti-padding-y-1 {\n padding-top: 0.25rem !important;\n padding-bottom: 0.25rem !important;\n}\n\n.qti-padding-y-2 {\n padding-top: 0.5rem !important;\n padding-bottom: 0.5rem !important;\n}\n\n.qti-padding-y-3 {\n padding-top: 1rem !important;\n padding-bottom: 1rem !important;\n}\n\n.qti-padding-y-4 {\n padding-top: 1.5rem !important;\n padding-bottom: 1.5rem !important;\n}\n\n.qti-padding-y-5 {\n padding-top: 3rem !important;\n padding-bottom: 3rem !important;\n}\n\n/*\n For padding Top\n */\n.qti-padding-t-0 {\n padding-top: 0 !important;\n}\n\n.qti-padding-t-1 {\n padding-top: 0.25rem !important;\n}\n\n.qti-padding-t-2 {\n padding-top: 0.5rem !important;\n}\n\n.qti-padding-t-3 {\n padding-top: 1rem !important;\n}\n\n.qti-padding-t-4 {\n padding-top: 1.5rem !important;\n}\n\n.qti-padding-t-5 {\n padding-top: 3rem !important;\n}\n\n/*\n For padding Bottom\n */\n.qti-padding-b-0 {\n padding-bottom: 0 !important;\n}\n\n.qti-padding-b-1 {\n padding-bottom: 0.25rem !important;\n}\n\n.qti-padding-b-2 {\n padding-bottom: 0.5rem !important;\n}\n\n.qti-padding-b-3 {\n padding-bottom: 1rem !important;\n}\n\n.qti-padding-b-4 {\n padding-bottom: 1.5rem !important;\n}\n\n.qti-padding-b-5 {\n padding-bottom: 3rem !important;\n}\n\n/*\n For padding Start LTR\n */\n.qti-padding-s-0 {\n padding-left: 0 !important;\n}\n\n.qti-padding-s-1 {\n padding-left: 0.25rem !important;\n}\n\n.qti-padding-s-2 {\n padding-left: 0.5rem !important;\n}\n\n.qti-padding-s-3 {\n padding-left: 1rem !important;\n}\n\n.qti-padding-s-4 {\n padding-left: 1.5rem !important;\n}\n\n.qti-padding-s-5 {\n padding-left: 3rem !important;\n}\n\n/*\n For padding End LTR\n */\n.qti-padding-e-0 {\n padding-right: 0 !important;\n}\n\n.qti-padding-e-1 {\n padding-right: 0.25rem !important;\n}\n\n.qti-padding-e-2 {\n padding-right: 0.5rem !important;\n}\n\n.qti-padding-e-3 {\n padding-right: 1rem !important;\n}\n\n.qti-padding-e-4 {\n padding-right: 1.5rem !important;\n}\n\n.qti-padding-e-5 {\n padding-right: 3rem !important;\n}\n\n/* ====================\n Horizontal alignment\n ==================== */\n\n.qti-align-left {\n text-align: left;\n}\n\n.qti-align-center {\n text-align: center;\n}\n\n.qti-align-right {\n text-align: right;\n}\n\n/* ==================\n Vertical alignment\n ================== */\n\n.qti-valign-top {\n vertical-align: top;\n}\n\n.qti-valign-middle {\n vertical-align: middle;\n}\n\n.qti-valign-baseline {\n vertical-align: baseline;\n}\n\n.qti-valign-bottom {\n vertical-align: bottom;\n}\n\n/* =============\n Height styles\n ============= */\n\n.qti-height-0 {\n height: 0;\n}\n\n.qti-height-px {\n height: 1px;\n}\n\n.qti-height-0p5 {\n height: 0.125rem;\n}\n\n.qti-height-1 {\n height: 0.25rem;\n}\n\n.qti-height-1p5 {\n height: 0.375rem;\n}\n\n.qti-height-2 {\n height: 0.5rem;\n}\n\n.qti-height-2p5 {\n height: 0.625rem;\n}\n\n.qti-height-3 {\n height: 0.75rem;\n}\n\n.qti-height-3p5 {\n height: 0.875rem;\n}\n\n.qti-height-4 {\n height: 1rem;\n}\n\n.qti-height-5 {\n height: 1.25rem;\n}\n\n.qti-height-6 {\n height: 1.5rem;\n}\n\n.qti-height-7 {\n height: 1.75rem;\n}\n\n.qti-height-8 {\n height: 2rem;\n}\n\n.qti-height-9 {\n height: 2.25rem;\n}\n\n.qti-height-10 {\n height: 2.5rem;\n}\n\n.qti-height-11 {\n height: 2.75rem;\n}\n\n.qti-height-12 {\n height: 3rem;\n}\n\n.qti-height-14 {\n height: 3.5rem;\n}\n\n.qti-height-16 {\n height: 4rem;\n}\n\n.qti-height-20 {\n height: 5rem;\n}\n\n.qti-height-24 {\n height: 6rem;\n}\n\n.qti-height-28 {\n height: 7rem;\n}\n\n.qti-height-32 {\n height: 8rem;\n}\n\n.qti-height-36 {\n height: 9rem;\n}\n\n.qti-height-40 {\n height: 10rem;\n}\n\n.qti-height-44 {\n height: 11rem;\n}\n\n.qti-height-48 {\n height: 12rem;\n}\n\n.qti-height-52 {\n height: 13rem;\n}\n\n.qti-height-56 {\n height: 14rem;\n}\n\n.qti-height-60 {\n height: 15rem;\n}\n\n.qti-height-64 {\n height: 16rem;\n}\n\n.qti-height-72 {\n height: 18rem;\n}\n\n.qti-height-80 {\n height: 20rem;\n}\n\n.qti-height-96 {\n height: 24rem;\n}\n\n.qti-height-1-2 {\n height: 50%;\n}\n\n.qti-height-1-3 {\n height: 33.3333%;\n}\n\n.qti-height-2-3 {\n height: 66.6667%;\n}\n\n.qti-height-1-4 {\n height: 25%;\n}\n\n.qti-height-2-4 {\n height: 50%;\n}\n\n.qti-height-3-4 {\n height: 75%;\n}\n\n.qti-height-1-5 {\n height: 20%;\n}\n\n.qti-height-2-5 {\n height: 40%;\n}\n\n.qti-height-3-5 {\n height: 60%;\n}\n\n.qti-height-4-5 {\n height: 80%;\n}\n\n.qti-height-1-6 {\n height: 16.6667%;\n}\n\n.qti-height-2-6 {\n height: 33.3333%;\n}\n\n.qti-height-3-6 {\n height: 50%;\n}\n\n.qti-height-4-6 {\n height: 66.6667%;\n}\n\n.qti-height-5-6 {\n height: 83.3333%;\n}\n\n.qti-height-auto {\n height: auto;\n}\n\n.qti-height-full {\n height: 100%;\n}\n\n/* ============\n Width styles\n ============ */\n\n.qti-width-0 {\n width: 0;\n}\n\n.qti-width-px {\n width: 1px;\n}\n\n.qti-width-0p5 {\n width: 0.125rem;\n}\n\n.qti-width-1 {\n width: 0.25rem;\n}\n\n.qti-width-1p5 {\n width: 0.375rem;\n}\n\n.qti-width-2 {\n width: 0.5rem;\n}\n\n.qti-width-2p5 {\n width: 0.625rem;\n}\n\n.qti-width-3 {\n width: 0.75rem;\n}\n\n.qti-width-3p5 {\n width: 0.875rem;\n}\n\n.qti-width-4 {\n width: 1rem;\n}\n\n.qti-width-5 {\n width: 1.25rem;\n}\n\n.qti-width-6 {\n width: 1.5rem;\n}\n\n.qti-width-7 {\n width: 1.75rem;\n}\n\n.qti-width-8 {\n width: 2rem;\n}\n\n.qti-width-9 {\n width: 2.25rem;\n}\n\n.qti-width-10 {\n width: 2.5rem;\n}\n\n.qti-width-11 {\n width: 2.75rem;\n}\n\n.qti-width-12 {\n width: 3rem;\n}\n\n.qti-width-14 {\n width: 3.5rem;\n}\n\n.qti-width-16 {\n width: 4rem;\n}\n\n.qti-width-20 {\n width: 5rem;\n}\n\n.qti-width-24 {\n width: 6rem;\n}\n\n.qti-width-28 {\n width: 7rem;\n}\n\n.qti-width-32 {\n width: 8rem;\n}\n\n.qti-width-36 {\n width: 9rem;\n}\n\n.qti-width-40 {\n width: 10rem;\n}\n\n.qti-width-44 {\n width: 11rem;\n}\n\n.qti-width-48 {\n width: 12rem;\n}\n\n.qti-width-52 {\n width: 13rem;\n}\n\n.qti-width-56 {\n width: 14rem;\n}\n\n.qti-width-60 {\n width: 15rem;\n}\n\n.qti-width-64 {\n width: 16rem;\n}\n\n.qti-width-72 {\n width: 18rem;\n}\n\n.qti-width-80 {\n width: 20rem;\n}\n\n.qti-width-96 {\n width: 24rem;\n}\n\n.qti-width-auto {\n width: auto;\n}\n\n.qti-width-1-2 {\n width: 50%;\n}\n\n.qti-width-1-3 {\n width: 33.3333%;\n}\n\n.qti-width-2-3 {\n width: 66.6667%;\n}\n\n.qti-width-1-4 {\n width: 25%;\n}\n\n.qti-width-2-4 {\n width: 50%;\n}\n\n.qti-width-3-4 {\n width: 75%;\n}\n\n.qti-width-1-5 {\n width: 20%;\n}\n\n.qti-width-2-5 {\n width: 40%;\n}\n\n.qti-width-3-5 {\n width: 60%;\n}\n\n.qti-width-4-5 {\n width: 80%;\n}\n\n.qti-width-1-6 {\n width: 16.6667%;\n}\n\n.qti-width-2-6 {\n width: 33.3333%;\n}\n\n.qti-width-3-6 {\n width: 50%;\n}\n\n.qti-width-4-6 {\n width: 66.6667%;\n}\n\n.qti-width-5-6 {\n width: 83.3333%;\n}\n\n.qti-width-1-12 {\n width: 8.3333%;\n}\n\n.qti-width-2-12 {\n width: 16.6667%;\n}\n\n.qti-width-3-12 {\n width: 25%;\n}\n\n.qti-width-4-12 {\n width: 33.3333%;\n}\n\n.qti-width-5-12 {\n width: 41.6667%;\n}\n\n.qti-width-6-12 {\n width: 50%;\n}\n\n.qti-width-7-12 {\n width: 58.3333%;\n}\n\n.qti-width-8-12 {\n width: 66.6667%;\n}\n\n.qti-width-9-12 {\n width: 75%;\n}\n\n.qti-width-10-12 {\n width: 83.3333%;\n}\n\n.qti-width-11-12 {\n width: 91.6667%;\n}\n\n.qti-width-full,\n.qti-fullwidth {\n width: 100%;\n}\n\n/* ==================\n Text Indent styles\n ================== */\n\n.qti-text-indent-0 {\n text-indent: 0;\n}\n\n.qti-text-indent-px {\n text-indent: 1px;\n}\n\n.qti-text-indent-0p5 {\n text-indent: 0.125rem;\n}\n\n.qti-text-indent-1 {\n text-indent: 0.25rem;\n}\n\n.qti-text-indent-1p5 {\n text-indent: 0.375rem;\n}\n\n.qti-text-indent-2 {\n text-indent: 0.5rem;\n}\n\n.qti-text-indent-2p5 {\n text-indent: 0.625rem;\n}\n\n.qti-text-indent-3 {\n text-indent: 0.75rem;\n}\n\n.qti-text-indent-3p5 {\n text-indent: 0.875rem;\n}\n\n.qti-text-indent-4 {\n text-indent: 1rem;\n}\n\n.qti-text-indent-5 {\n text-indent: 1.25rem;\n}\n\n.qti-text-indent-6 {\n text-indent: 1.5rem;\n}\n\n.qti-text-indent-7 {\n text-indent: 1.75rem;\n}\n\n.qti-text-indent-8 {\n text-indent: 2rem;\n}\n\n.qti-text-indent-12 {\n text-indent: 3rem;\n}\n\n.qti-text-indent-16 {\n text-indent: 4rem;\n}\n\n.qti-text-indent-20 {\n text-indent: 5rem;\n}\n\n.qti-text-indent-24 {\n text-indent: 6rem;\n}\n\n.qti-text-indent-28 {\n text-indent: 7rem;\n}\n\n.qti-text-indent-32 {\n text-indent: 8rem;\n}\n\n/* =================\n List Style styles\n ================= */\n\n.qti-list-style-type-none {\n list-style-type: none;\n}\n\n.qti-list-style-type-disc {\n list-style-type: disc;\n}\n\n.qti-list-style-type-circle {\n list-style-type: circle;\n}\n\n.qti-list-style-type-square {\n list-style-type: square;\n}\n\n.qti-list-style-type-decimal {\n list-style-type: decimal;\n}\n\n.qti-list-style-type-decimal-leading-zero {\n list-style-type: decimal-leading-zero;\n}\n\n.qti-list-style-type-lower-alpha {\n list-style-type: lower-alpha;\n}\n\n.qti-list-style-type-upper-alpha {\n list-style-type: upper-alpha;\n}\n\n.qti-list-style-type-lower-roman {\n list-style-type: lower-roman;\n}\n\n.qti-list-style-type-upper-roman {\n list-style-type: upper-roman;\n}\n\n.qti-list-style-type-lower-latin {\n list-style-type: lower-latin;\n}\n\n.qti-list-style-type-upper-latin {\n list-style-type: upper-latin;\n}\n\n.qti-list-style-type-lower-greek {\n list-style-type: lower-greek;\n}\n\n.qti-list-style-type-arabic-indic {\n list-style-type: arabic-indic;\n}\n\n.qti-list-style-type-armenian {\n list-style-type: armenian;\n}\n\n.qti-list-style-type-lower-armenian {\n list-style-type: lower-armenian;\n}\n\n.qti-list-style-type-upper-armenian {\n list-style-type: upper-armenian;\n}\n\n.qti-list-style-type-bengali {\n list-style-type: bengali;\n}\n\n.qti-list-style-type-cambodian {\n list-style-type: cambodian;\n}\n\n.qti-list-style-type-simp-chinese-formal {\n list-style-type: simp-chinese-formal;\n}\n\n.qti-list-style-type-simp-chinese-informal {\n list-style-type: simp-chinese-informal;\n}\n\n.qti-list-style-type-trad-chinese-formal {\n list-style-type: trad-chinese-formal;\n}\n\n.qti-list-style-type-trad-chinese-informal {\n list-style-type: trad-chinese-informal;\n}\n\n.qti-list-style-type-cjk-ideographic {\n list-style-type: cjk-ideographic;\n}\n\n.qti-list-style-type-cjk-heavenly-stem {\n list-style-type: cjk-heavenly-stem;\n}\n\n.qti-list-style-type-cjk-earthly-branch {\n list-style-type: cjk-earthly-branch;\n}\n\n.qti-list-style-type-devanagari {\n list-style-type: devanagari;\n}\n\n.qti-list-style-type-ethiopic-halehame-ti-er {\n list-style-type: ethiopic-halehame-ti-er;\n}\n\n.qti-list-style-type-ethiopic-halehame-ti-et {\n list-style-type: ethiopic-halehame-ti-et;\n}\n\n.qti-list-style-type-ethiopic-halehame-am {\n list-style-type: ethiopic-halehame-am;\n}\n\n.qti-list-style-type-ethiopic-halehame {\n list-style-type: ethiopic-halehame;\n}\n\n.qti-list-style-type-georgian {\n list-style-type: georgian;\n}\n\n.qti-list-style-type-gujarati {\n list-style-type: gujarati;\n}\n\n.qti-list-style-type-gurmukhi {\n list-style-type: gurmukhi;\n}\n\n.qti-list-style-type-hangul {\n list-style-type: hangul;\n}\n\n.qti-list-style-type-hangul-consonant {\n list-style-type: hangul-consonant;\n}\n\n.qti-list-style-type-hebrew {\n list-style-type: hebrew;\n}\n\n.qti-list-style-type-hiragana {\n list-style-type: hiragana;\n}\n\n.qti-list-style-type-hiragana-iroha {\n list-style-type: hiragana-iroha;\n}\n\n.qti-list-style-type-khmer {\n list-style-type: khmer;\n}\n\n.qti-list-style-type-korean-hangul-formal {\n list-style-type: korean-hangul-formal;\n}\n\n.qti-list-style-type-korean-hanja-formal {\n list-style-type: korean-hanja-formal;\n}\n\n.qti-list-style-type-korean-hanja-informal {\n list-style-type: korean-hanja-informal;\n}\n\n.qti-list-style-type-lao {\n list-style-type: lao;\n}\n\n.qti-list-style-type-malayalam {\n list-style-type: malayalam;\n}\n\n.qti-list-style-type-mongolian {\n list-style-type: mongolian;\n}\n\n.qti-list-style-type-myanmar {\n list-style-type: myanmar;\n}\n\n.qti-list-style-type-oriya {\n list-style-type: oriya;\n}\n\n.qti-list-style-type-persian {\n list-style-type: persian;\n}\n\n.qti-list-style-type-thai {\n list-style-type: thai;\n}\n\n.qti-list-style-type-tibetan {\n list-style-type: tibetan;\n}\n\n.qti-list-style-type-telugu {\n list-style-type: telugu;\n}\n\n.qti-list-style-type-urdu {\n list-style-type: urdu;\n}\n\n/* =========================\n Other QTI 3 Presentation Utilities\n ========================= */\n\n.qti-bordered {\n border: 1px solid var(--table-border-color);\n}\n\n.qti-underline {\n text-decoration: underline;\n text-decoration-color: var(--foreground);\n}\n\n.qti-italic {\n font-style: italic;\n}\n\n.qti-well {\n min-height: 20px;\n padding: 19px;\n margin-bottom: 20px;\n background-color: var(--well-bg);\n border: var(--well-border);\n border-radius: 4px;\n box-shadow: var(--well-box-shadow);\n}\n\n/* Set writing-mode to vertical-rl \n Typical for CJK vertical text */\n.qti-writing-mode-vertical-rl {\n writing-mode: vertical-rl;\n}\n\n/* Set writing-mode to vertical-lr\n Typical for Mongolian vertical text */\n.qti-writing-mode-vertical-lr {\n writing-mode: vertical-lr;\n}\n\n/* Set writing-mode to horizontal-tb \n Browser default */\n.qti-writing-mode-horizontal-tb {\n writing-mode: horizontal-tb;\n}\n\n/* Float an element left */\n.qti-float-left {\n float: left;\n}\n\n/* Float an element right */\n.qti-float-right {\n float: right;\n}\n\n/* Remove a float */\n.qti-float-none {\n float: none;\n}\n\n/* Clearfix Hack to apply to a container of \n floated content that overflows the container. */\n.qti-float-clearfix::after {\n content: '';\n clear: both;\n display: table;\n}\n\n.qti-float-clear-left\n .qti-float-clear-right\n .qti-float-clear-both\n \n /* Set text-orientation to upright */\n .qti-text-orientation-upright {\n text-orientation: upright;\n}\n}\n@layer qti-base{\n\n.qti-layout-row {\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n gap: 2.1276595745%;\n}\n\n.qti-layout-row [class*='qti-layout-col']:not(:empty) {\n box-sizing: border-box;\n}\n\n.qti-layout-row [class*='qti-layout-col']:empty {\n width: 0;\n overflow: hidden; /* to fully collapse if there’s padding or borders */\n}\n\n.qti-layout-col1 {\n width: 6.3829787234%;\n}\n\n.qti-layout-col2 {\n width: 14.8936170213%;\n}\n\n.qti-layout-col3 {\n width: 23.4042553191%;\n}\n\n.qti-layout-col4 {\n width: 31.914893617%;\n}\n\n.qti-layout-col5 {\n width: 40.4255319149%;\n}\n\n.qti-layout-col6 {\n width: 48.9361702128%;\n}\n\n.qti-layout-col7 {\n width: 57.4468085106%;\n}\n\n.qti-layout-col8 {\n width: 65.9574468085%;\n}\n\n.qti-layout-col9 {\n width: 74.4680851064%;\n}\n\n.qti-layout-col10 {\n width: 82.9787234043%;\n}\n\n.qti-layout-col11 {\n width: 91.4893617021%;\n}\n\n.qti-layout-col12 {\n width: 100%;\n}\n\n.qti-layout-offset1 {\n margin-left: 8.5106382979%;\n}\n\n.qti-layout-offset2 {\n margin-left: 17.0212765957%;\n}\n\n.qti-layout-offset3 {\n margin-left: 25.5319148936%;\n}\n\n.qti-layout-offset4 {\n margin-left: 34.0425531915%;\n}\n\n.qti-layout-offset5 {\n margin-left: 42.5531914894%;\n}\n\n.qti-layout-offset6 {\n margin-left: 51.0638297872%;\n}\n\n.qti-layout-offset7 {\n margin-left: 59.5744680851%;\n}\n\n.qti-layout-offset8 {\n margin-left: 68.085106383%;\n}\n\n.qti-layout-offset9 {\n margin-left: 76.5957446809%;\n}\n\n.qti-layout-offset10 {\n margin-left: 85.1063829787%;\n}\n\n.qti-layout-offset11 {\n margin-left: 93.6170212766%;\n}\n\n@media (width <= 767px) {\n [class*='qti-layout-col'] {\n width: 100%;\n }\n}\n}\n/**\n * Layer order for everything the theme ships, and the imports that fill it.\n *\n * A file is assigned its layer HERE, at its import, wherever it belongs to exactly one layer —\n * so the ordering is readable in one place and the file itself stays free of wrapper blocks.\n * The files imported without `layer()` below span several layers internally and declare their\n * own `@layer` blocks; splitting them per layer is the only way to import-assign them, and is\n * not worth the file count.\n *\n * `interactions.brand` and `overrides` hold nothing here ON PURPOSE — they are the extension points\n * a brand sheet writes into (apps/e2e/src/stories/kennisnet/kennisnet.css uses `interactions.brand`).\n * They must stay DECLARED even while empty: a layer first created by a consumer's own `@layer`\n * block is appended after every declared layer, which would put brand paint above the state and\n * correction paint it is meant to sit under. Deleting the two names moved 7 of the 17 VRT baselines.\n */\n@layer qti-components.reset{\n@scope (qti-item-body, .ProseMirror) {\n :scope,\n :scope * {\n box-sizing: border-box;\n }\n\n :scope *::before,\n :scope *::after {\n box-sizing: border-box;\n }\n\n button,\n input,\n textarea,\n select {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n color: inherit;\n font: inherit;\n }\n\n img {\n max-width: 100%;\n height: auto;\n }\n\n [response-identifier] img {\n max-width: none;\n }\n\n /* Normalize author markup paragraphs only in text-bearing QTI elements:\n - If a paragraph is the only child, remove all margins.\n - Keep this explicit allowlist to avoid resetting arbitrary wrapper markup. */\n :scope\n :is(\n qti-prompt,\n qti-simple-choice,\n qti-associable-choice,\n qti-simple-associable-choice,\n qti-gap,\n qti-gap-text,\n qti-inline-choice,\n qti-hottext\n )\n > p:only-of-type {\n margin: 0;\n }\n}\n}\n@layer qti-components.elements{\n\n/**\n * Prose — plain HTML author markup: tables, lists, headings, rules.\n *\n * Sibling to reset.css and scoped the same way, to (qti-item-body, .ProseMirror), so one definition\n * covers a rendered item body and an editor document. reset.css normalises author markup; this file\n * is where it is given a look.\n *\n * ── Why the two scopes ───────────────────────────────────────────────────────────────────────\n *\n * Rendered QTI deliberately has almost no prose look. A table in an item body is author content, and\n * the QTI presentation vocabulary makes its appearance an author decision — `.qti-bordered` exists\n * precisely so borders are opt-in. Styling tables by default here would take that decision away and\n * silently restyle every delivered item.\n *\n * Authoring is the opposite: you cannot edit a grid you cannot see. So the visible grid is scoped to\n * `.ProseMirror` alone, and the shared scope stays reserved for rules that are genuinely wanted in\n * both places. Keeping the split explicit is the point — a rule moved from the second scope to the\n * first is a change to delivered items, and should be made on purpose (and re-baselined: the\n * Kennisnet VRT set covers this markup).\n *\n * Values route through the theme tokens with a literal fallback, so prose tracks a brand for free.\n * The --qti-prose-* names are the override surface.\n */\n\n/*\n * Shared — rendered item bodies AND editor documents.\n *\n * Intentionally empty. Every candidate rule so far (border-collapse, cell padding) moves rendered\n * items, which is a product decision rather than a styling gap. Add here only with that in mind.\n */\n\n/*\n * Authoring only — the editor's document.\n */\n@scope (.ProseMirror) {\n :scope table {\n border-collapse: collapse;\n margin: var(--qti-prose-table-margin, 0.5rem 0);\n }\n\n :scope th,\n :scope td {\n border: var(--qti-prose-table-border-width, var(--qti-border-thickness, 1px))\n var(--qti-prose-table-border-style, var(--qti-border-style, solid))\n var(--qti-prose-table-border-color, var(--qti-border-color, #c6cad0));\n padding: var(--qti-prose-table-cell-padding, 0.25rem 0.5rem);\n text-align: left;\n /* No vertical-align here: that is layout, and the theme does not do layout (CONTRACT.md \xa77,\n enforced by qti/no-layout-in-theme). Cells keep the UA default. */\n }\n\n :scope th {\n background: var(--qti-prose-table-header-bg, var(--qti-bg-active, #f6f8fa));\n font-weight: 600;\n }\n}\n}\n/* Multi-layer: declares global + interactions.{base,states,corrections} internally. */\n/* QTI base — design variables. The theme's tokens; a substrate overrides their VALUES to\n * express its look (value first). Split from qti-base.css. See also qti-mixins.css.\n *\n * Grouped into the same cascade layers the rest of the theme uses (see index.css and\n * CONTRACT.md \xa72), so the declaring layer documents which kind of rule OWNS a token.\n *\n * The layer is documentation, not scope: custom properties are inherited computed values, so a\n * token declared in `global` is readable from a rule in any layer, and `var()` substitution across\n * these blocks (--qti-correct reads --qti-success) is layer-independent. Nothing here renders\n * differently for being grouped this way.\n */\n/* ============================================================================\n * global — the foundation every layer reads.\n * ========================================================================== */\n@layer qti-components.global {\n :root,\n :host {\n /* ── Base palette — six concrete brand colours. A theme replaces just these. ── */\n --qti-primary: #0175aa; /* purple — chips, selection, active border */\n --qti-success: #2b830e; /* green */\n --qti-warning: #ffa700; /* amber */\n --qti-error: #df0000; /* red */\n --qti-info: #007ac3; /* blue — the answer key */\n\n /* Foreground on a primary fill. */\n --qti-primary-fg: #fff;\n\n /* ── Rhythm ──\n *\n * --qti-spacing is THE unit, and the only knob here a substrate normally touches. Everything\n * else in this group is a multiple of it, so retuning the whole theme's rhythm is one value.\n *\n * It replaces --qti-padding-vertical (0.5rem) and --qti-padding-horizontal (1rem). Those were\n * always the unit and twice the unit, and every derived value in the theme was a half, whole\n * or double of one of them, so the pair carried no information the single token doesn't.\n *\n * This is the SPACING axis — distance between and around things. The SIZING axis is separate\n * and deliberately not derived from it: --qti-control-size (radio/checkbox), --qti-correction-size,\n * --qti-graphic-order-pin-size, --qti-select-point-marker-size. A control's size tracks its\n * content and its hit target, not the page's rhythm, so the two scales move independently.\n *\n * THE CONTRACT: an interaction reads exactly one of the three composites below, whole. Never\n * --qti-spacing itself, and never a calc() over one of them — a call site that needs \"half of\n * a gap\" is describing a fourth value that does not exist in the vocabulary, and the answer is\n * to pick the nearest of the three, not to do arithmetic:\n *\n * --qti-padding-box the block box (choice, rubric, modal, field, listbox row, cell)\n * --qti-padding-inline the inline box (hottext, inline-choice trigger, gap)\n * --qti-gap every scalar (flex/grid gap, margin, offset, inset)\n *\n * --qti-spacing is the unit those are cut from, not a value to paint with. It is the only knob\n * a substrate normally sets; the three move with it.\n *\n * --qti-gap doubling as \"every scalar\" is the load-bearing compromise. Two of the three tokens\n * are shorthands, so nothing else in the vocabulary can express a bare length — which is why\n * the theme's old 0.25rem and 0.5rem one-off offsets are now all 1rem. That was chosen over\n * adding scalar steps: one obvious gap everywhere beats six near-identical spacings nobody can\n * tell apart. If a specific spot genuinely needs to be tighter, give it a NAMED component token\n * (like --qti-drag-padding below) rather than reaching back for --qti-spacing.\n *\n * --qti-padding-inline was the literal `2px 4px`, which is exactly a quarter and a half of the\n * unit at a 16px root. Deriving it means it now scales with the rhythm rather than staying\n * pinned to device pixels — the same reason nothing else here is a literal.\n *\n * Widening boxes without touching the vertical rhythm means re-declaring --qti-padding-box,\n * which is deliberate: that is a different look, not a different unit. */\n --qti-spacing: 0.5rem;\n --qti-padding-box: var(--qti-spacing) calc(var(--qti-spacing) * 2);\n --qti-padding-inline: calc(var(--qti-spacing) / 4) calc(var(--qti-spacing) / 2);\n --qti-gap: calc(var(--qti-spacing) * 2);\n\n --qti-popover-z-index: 1000;\n --qti-overlay-z-index: 1;\n /* Motion master switch — a unitless multiplier every animation scales by. 1 = normal, 0 = no\n motion. CSS transitions read it through the calc below; the drag-drop FLIP engine reads\n --qti-motion directly (see flip.utils.ts resolveMotionScale), so this one token silences both\n CSS motion and JS FLIP. A theme or PNP profile can set 0.5 to slow motion or 0 to stop it. */\n --qti-motion: 1;\n --qti-motion-duration-fast: calc(150ms * var(--qti-motion));\n\n /* ── The component surface ──\n The theme's base surface and border. Read by the paint contract below, and — separately — by\n ~30 rules that draw a box WITHOUT going through it (tables, the modal, hotspot rings, the\n slider track). Those two readerships are why this group and the --qti-component-* group below\n are not one group: this is \"the theme's surface colour\", that is \"what a component paints when\n it says nothing\", and only the second is the paint contract's business. */\n --qti-bg: white;\n\n /*\n * THE body text colour — the foreground half of the --qti-bg / --qti-fg pair.\n *\n * `inherit`, deliberately: the base theme does not impose a text colour. What a candidate reads\n * is the host page's, and a brand that wants its own sets this token (kennisnet.css declares\n * #3e144e). A base theme that cannot pick the colour also cannot pick a failing one.\n *\n * This is a FIX that changes nothing, which is the point. It read `var(#aaaaaa)` — a value\n * wrapped in var() by mistake in 925bdf14. var() takes a custom-property name, so `#aaaaaa` made\n * the whole thing invalid and --qti-fg computed to the guaranteed-invalid value; every\n * `color: var(--qti-fg)` was then invalid at computed-value time and, `color` being inherited,\n * fell back to the inherited colour. Measured, and `inherit` is precisely that behaviour said out\n * loud.\n *\n * Not restored to a literal `#aaaaaa`: at 2.3:1 on white that fails WCAG AA for body text, and\n * the readers here are the candidate's own typed answer (@mixin field-typography paints the\n * text-entry input and the extended-text textarea), the inline-choice value, the validation\n * message and modal feedback.\n *\n * Every reader is a colour context, which is what makes the keyword safe: it reaches `color`\n * either directly or through a role slot (--field-color, --drag-color, @mixin candidate).\n */\n --qti-fg: inherit;\n --qti-border-thickness: 1px; /* some places need the width alone (invariance, calcs) */\n --qti-border-style: solid;\n --qti-border-color: var(--qti-primary); /* THE border colour — the border half of the --qti-bg / --qti-fg pair */\n --qti-border-radius: 0.2rem;\n --qti-border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n\n /* ── The paint contract's resting look ──\n *\n * One token per PAINT property, and the whole of what a role paints when it sets nothing. These\n * used to be written inline in the mixin, as the second half of `var(--component-x, var(--qti-y))`\n * — the fallbacks were the resting look, but you had to read the mixin to find out what it was.\n * They are tokens now, so the resting box reads in one place and a substrate can retune it here\n * (value first) without touching a mixin.\n *\n * `@mixin paint $role` in qti-mixins.css binds each property to exactly one of these, behind a\n * per-role override SLOT: `var(--drag-background-color, var(--qti-component-background-color))`.\n * Two tiers, and they are different kinds of name on purpose —\n * --qti-component-* a TOKEN. Declared here, has a value, applies to every role at once.\n * --drag-* / --drop-* a SLOT. Declared nowhere; only ever read with this fallback. Setting one\n * repaints that role alone, so a drop can no longer leak its fill into a\n * chip standing in it (custom properties inherit — the old single\n * --component-* namespace meant every nested component shared one value).\n *\n * `color: inherit` is the resting rule for text, not a colour: a component's text is whatever the\n * text around it is. It reaches `color` through the same two-tier chain as everything else, and\n * lands on the inherited colour either way — the keyword substitutes, and if a browser rejects a\n * CSS-wide keyword out of var() it is invalid at computed-value time, which for an inherited\n * property is also the inherited value. */\n --qti-component-background-color: var(--qti-bg);\n --qti-component-background-image: none;\n --qti-component-border-width: var(--qti-border-thickness);\n --qti-component-border-style: var(--qti-border-style);\n --qti-component-border-color: var(--qti-border-color);\n --qti-component-border-radius: var(--qti-border-radius);\n --qti-component-box-shadow: none;\n --qti-component-color: inherit;\n --qti-component-opacity: 1;\n --qti-component-filter: none;\n\n /* Interaction icon masks. Kept in the QTI namespace so the theme has no FontAwesome runtime\n dependency. One vocabulary, kept together even though --qti-times-mask is read only from\n the corrections layer. */\n --qti-check-mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3Cpath d='M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z'/%3E%3C/svg%3E\");\n --qti-times-mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512'%3E%3Cpath d='M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z'/%3E%3C/svg%3E\");\n /* fa-minus. The third verdict glyph, beside the tick and the cross: neither right nor wrong.\n A SHAPE rather than a shade, deliberately — colour alone would leave partial credit\n indistinguishable from correct for a colour-blind candidate, or in greyscale print. */\n --qti-partial-mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3Cpath d='M432 256c0 17.7-14.3 32-32 32L48 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l352 0c17.7 0 32 14.3 32 32z'/%3E%3C/svg%3E\");\n --qti-grip-mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 512'%3E%3Cpath d='M40 352l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40zm192 0l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40zM40 320c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0zM232 192l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40zM40 160c-22.1 0-40-17.9-40-40L0 72C0 49.9 17.9 32 40 32l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0zM232 32l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40z'/%3E%3C/svg%3E\");\n --qti-chevron-mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z'/%3E%3C/svg%3E\");\n\n /*\n * Accent-tinted \"active / selected surface\" — the canonical pair, and one of the global knobs a\n * theme flips. Read by `@mixin act` and ~27 call sites across drag-drop, inline-choice,\n * match-tabular, slider and modal-feedback: the paint for \"this box is active / open / a drop\n * target.\" Derived from --qti-primary over --qti-bg so it tracks the accent colour (and, later, a\n * light/dark surface). The --qti-drop-highlight-* vocabulary in interactions.states is the\n * drop-specific SUPERSET that derives from THESE and adds the shadow + `enabled` variants.\n *\n * Deliberately in `global`: they are read from both interactions.base and interactions.states,\n * so no single interaction layer could own them.\n */\n --qti-bg-active: color-mix(in srgb, var(--qti-primary) 8%, var(--qti-bg));\n --qti-border-active: var(--qti-primary);\n\n /* ── Slated for removal — still referenced across mixins/interactions ──\n *\n * focus → a single :focus-visible outline (no vars)\n * Two treatments already read these two tokens: `@mixin foc` draws a box-shadow, while\n * hotspot and graphic-order draw an outline. The box-shadow half is the problem — four\n * rules contest that one property on a drag (the resting lift, the in-flight elevation,\n * the placeholder's inset, the focus ring) and the last one declared wins, so focusing a\n * drag mid-interaction drops either its ring or its elevation. An outline joins no such\n * fight and costs no layout. The theme also still says `:focus` 24 times against\n * `:focus-visible` 10, so most rings show on mouse click too. Once it is an outline on\n * :focus-visible, a width and a colour are not worth tokenising.\n * The four --qti-light-* and --qti-dark-* tokens that used to sit here are now\n * --qti-selections-*, in the interactions.states block below. They are not a page-level light\n * and dark theme, which is what the old names suggested and why they were mistaken for dead.\n */\n --qti-focus-border-width: 2px;\n --qti-focus-color: var(--qti-info);\n }\n\n /* Honour the OS \"reduce motion\" request through the same knob, so CSS transitions and the JS FLIP\n engine switch off together. A theme can still force motion back on by re-declaring --qti-motion\n with higher specificity. */\n @media (prefers-reduced-motion: reduce) {\n :root,\n :host {\n --qti-motion: 0;\n }\n }\n}\n/* ============================================================================\n * interactions.base — interaction-local geometry. Neutral, no judgement colour.\n * ========================================================================== */\n@layer qti-components.interactions.base {\n :root,\n :host {\n /*\n * The radio/checkbox box. Named for what it is — every other name around it already says\n * \"control\": part=\"control\", part=\"control-mark\", the control-selected mixin. \"form\" was the odd\n * one out and needed a comment to say which form thing it meant.\n *\n * `em`, so a control is sized by the text it belongs to. A radio labels its choice; when that\n * choice's text is set larger or smaller the control should follow, which `rem` cannot do — it\n * is pinned to the root regardless of the type around it. Same reasoning, and the same value, as\n * --qti-correction-size above: \"em keeps a badge sized by the text it annotates\". It is also\n * what the SIZING note at the top of this file already claims for these tokens — that a\n * control's size tracks its content rather than the page's rhythm.\n *\n * Costs nothing to adopt: every control host in the interactions renders at the root size today\n * (measured across choice, tabular match and hottext), so 1em and 1rem compute identically and\n * no baseline moves. It simply starts behaving when someone scales type.\n *\n * The one thing to watch is the hit target in deliberately small text, where the control now\n * shrinks with it. Nothing in the theme sets a smaller size yet, so a floor would be a magic\n * number guarding a case that does not exist; add `max()` here if a real one turns up.\n */\n --qti-control-size: 1em;\n\n /* The correction badge's box. Named in two comments above and read by correction.styles.ts, but\n never actually declared until now — every badge has been running on that file's `1em`\n fallback. Declared at the same value, so nothing moves; it is a real token now rather than a\n promise, and `em` keeps a badge sized by the text it annotates (same reasoning as\n --qti-glyph-gap below). */\n --qti-correction-size: 1em;\n\n /*\n * How far a correction badge sits from the trailing edge of the box it annotates.\n *\n * Only two interactions need it. Everywhere else the badge is a child of the element that carries\n * the padding, so it is inset by that padding for free — 12.8px on a chip, 16px on a choice, 4px\n * on a hottext, each matching how far that container insets its own text. text-entry and\n * inline-choice are the exception: their field box is the HOST, but the padding lives on an inner\n * ::part(input) / ::part(trigger), so their badge falls outside it and lands on the border. This\n * gives it back the same inset the text has.\n *\n * A NAMED token rather than a calc over --qti-padding-box, which the rhythm contract above\n * forbids; --qti-drag-padding is the precedent. It is --qti-gap because that IS the horizontal\n * half of --qti-padding-box, which is the padding those two inner elements use.\n */\n --qti-correction-inset: var(--qti-gap);\n\n /* The line-height @mixin field-typography gives a field. A token because the correction badge\n has to be exactly one field-line tall to centre on the text, and `1lh` cannot be used for it:\n that unit resolves against the badge's own inherited line-height, not the field's. */\n --qti-field-line-height: 1.5;\n\n /*\n * The left gutter a multi-line field reserves for its correction badge.\n *\n * DERIVED, so it cannot drift from the thing it makes room for: the badge's own inset, plus the\n * badge, plus the gap that separates it from the first character. It used to be a literal\n * `2.4rem` in the theme that had to be kept in agreement, by hand and across two packages, with a\n * `0.75rem` left offset in the correction component.\n *\n * Reserved unconditionally, graded or not — padding is layout, and switching it on a verdict\n * would re-wrap the candidate's answer at the moment they are marked.\n */\n --qti-correction-gutter: calc(var(--qti-correction-inset) + var(--qti-correction-size) + var(--qti-glyph-gap));\n\n /* The gap between a masked glyph and the text it sits beside — the drag-handle grip before a\n label, the correction badge after one. `em`, because a glyph is sized off the text it\n annotates (see --qti-correction-size, --qti-grip-mask), so its gap has to scale with the same\n text rather than with the root.\n Deliberately NOT --qti-gap: that token is the page's rhythm at 1rem, an order of magnitude too\n wide for a glyph sitting inside a line. This is the \"named component token\" escape hatch the\n rhythm block above sanctions, and it is ONE token rather than two because the grip's 0.5em and\n the badge's 0.4em were the same measurement written twice.\n 0.5em is the grip's old value, so the grip is untouched and the badge moved out by 0.1em. That\n is not cosmetic in the VRT corpus: the badge is inline, so a tenth of an em reflows the line it\n sits on, and 10 of 17 kennisnet snapshots shifted (up to 2.9% of pixels). Bisected the other\n way, 0.4em holds the badge still and moves 5 drag/order snapshots instead — there is no value\n that is neutral for both, which is exactly why the duplication was worth collapsing. */\n --qti-glyph-gap: 0.5em;\n /*\n * ── Drop sizing ─────────────────────────────────────────────────────────────────────────────\n *\n * Four names, one job each, and — the load-bearing part — TWO OF THEM ARE DELIBERATELY NOT\n * DECLARED HERE:\n *\n * --qti-dropzone-min-height / -min-width MEASURED. The box a drop reserves for one chip.\n * --qti-drag-min-width MEASURED. A chip's own floor — the mixin writes it the same value\n * as the drop's, which is what keeps a chip and its slot the same\n * size without a rule relating the two. Unmeasured it is 0, from\n * the fallback in `@mixin drag`, so a chip keeps its natural width.\n * --qti-drop-card-min-height a category card: match's targets, which collect several answers.\n * --qti-drop-track-min-width the floor of a drops-grid COLUMN. Not a drop's own width.\n *\n * Only the last two are declared below. The measured three are written at runtime and never\n * declared anywhere — see the paragraph under this list, and no-declared-measured-token.mjs.\n *\n * WHY THE MEASURED PAIR MUST STAY UNDECLARED. Every consumer reads them as\n * `var(--qti-dropzone-min-*, N)`, where N is what that drop is worth when nothing measured it.\n * Declaring them here makes every one of those fallbacks unreachable — the inherited value\n * always substitutes — so the whole \"unmeasured\" branch silently disappears, and code that\n * DECLINES to publish a measurement (see `autoSizeDropzoneWidth`, which is how an authored\n * `data-choices-container-width` takes the width axis) no longer means \"no floor\", it means\n * \"whatever is declared here\". That is not hypothetical: declaring them at 3rem/8rem gave a\n * graphic-gap-match hotspot a 128px min-width that beat its authored 100px `width`, and shrank\n * match's cards from 4rem to 3rem without any rule mentioning cards. Both were one commit.\n *\n * If you want to size drops by hand with no mixin involved, set the two names on the\n * interaction — closer than :root, which is where an owner of an axis is supposed to speak.\n * `tools/stylelint/no-declared-measured-token.js` enforces the rule so this cannot come back.\n *\n * WHY A CHIP AND A DROP HAVE SEPARATE WIDTHS, when the measurement gives them the same value:\n * their unmeasured defaults differ. A chip with no measurement keeps its natural width, so 0.\n * A drop with no measurement is at its consumer's fallback. `@mixin drag` reads\n * --qti-drag-min-width; everything else reads --qti-dropzone-min-width.\n *\n * WHY THE CARD IS SEPARATE: match publishes no measurement at all, so a card sized off\n * --qti-dropzone-min-height depends entirely on a fallback literal — fragile, as above. Whether\n * a drop is a slot or a card is a property of the INTERACTION, not of a drop's own `match-max`:\n * a match-max=\"1\" target is still a category that happens to take one answer, and it sits in a\n * grid beside targets that take several.\n *\n * WHY THE TRACK IS SEPARATE: a column floor and a drop's own min-width are unrelated jobs that\n * happened to want the same number in order. --qti-drop-min-width already died of exactly that\n * conflation (it meant the track floor in order and a drop's min-width in the match target),\n * and folding the track back into --qti-dropzone-min-width reintroduced it. A track that must\n * also fit a measured chip asks for both by hand:\n * minmax(max(var(--qti-drop-track-min-width), var(--qti-dropzone-min-width, 0px)), 1fr)\n *\n * Everything else that used to be a token here is a plain declaration on the one rule that wants\n * it, because `::part(drop)` already reaches every drop from the document and a custom property\n * in between adds a name without adding reach:\n *\n * --qti-drop-min-height, --qti-drop-min-width, --qti-match-target-min-width collapsed into\n * the names above.\n * --qti-dropzone-padding, --qti-drop-gap deleted outright. A slot needs no inset at all (its\n * reservation is already the chip's border-box, so nothing is squeezed\n * and nothing shows), and the one drop that wants room — match's card —\n * declares padding and gap on its own rule.\n *\n * See DROP-SIZING.md.\n */\n --qti-drop-card-min-height: 4rem;\n --qti-drop-track-min-width: 7.5rem;\n\n /* Hotspot selection ring (qti-hotspot-interaction.css). Resting stroke width — :state(checked)\n and the correction states double it. The halo is the near-white outline either side of the\n ring that keeps it legible over any background image (vocab \xa71.2.5.1 \"suitable contrast\").\n --qti-hotspot-ring-color is intentionally NOT defined here: it is neutral by default and set\n contextually by the qti-selections-* classes and the correction states. */\n --qti-hotspot-ring-width: 2px;\n --qti-hotspot-halo: rgb(255 255 255 / 85%);\n\n /*\n * A drag's own padding, deliberately not --qti-padding-box.\n *\n * `em`, so a drag scales with the text it wraps rather than with the root — a drag is a token\n * around a word, and a word that grows should take its box with it.\n *\n * It is a token because the two mixins that used to draw a drag disagreed here: `drag` paid the\n * horizontal padding (then --qti-padding-horizontal, now `calc(var(--qti-spacing) * 2)`) and\n * the old `chip` paid `0.8em`, and which one you got depended on the layer the call site\n * happened to sit in. That is the associate bug recorded in drag-drop.invariance.spec.ts — one\n * drag, two box models, depending on where it was standing.\n */\n --qti-drag-padding: var(--qti-spacing) 0.8em;\n }\n}\n/* ============================================================================\n * interactions.states — state paint. Selection, drag, and drop-target highlight.\n * ========================================================================== */\n@layer qti-components.interactions.states {\n :root,\n :host {\n /* Selection is a semantic alias of the primary action colour. */\n --qti-selected-bg: var(--qti-primary);\n --qti-selected-color: var(--qti-primary-fg);\n\n /* The hole a lifted / placed chip leaves — derived from primary. */\n --qti-placeholder-bg: color-mix(in srgb, var(--qti-primary) 20%, white);\n --qti-placeholder-shadow: 0 4px color-mix(in srgb, var(--qti-primary) 30%, white);\n\n /*\n * Selections theming, for the two interactions Appendix B.1 of the QTI 3 implementation guide\n * defines it on: qti-hotspot-interaction and qti-graphic-gap-match-interaction.\n *\n * `light` and `dark` name the colour the *selection* is drawn in, not a page theme — light for\n * a selection sitting over a dark image, dark for one over a light image. The point is that a\n * selection stays visible whatever the picture underneath it looks like, which is why the item\n * author chooses, not the substrate.\n *\n * These were --qti-selections-light-bg and friends, in `global`. Both halves of that were wrong:\n * the names read as a light/dark page theme, which is how they came to be mistaken for a dead\n * feature, and `global` claimed an ownership they never had — nothing outside these two\n * interactions' state rules reads them.\n */\n --qti-selections-light-bg: #f0f0f0;\n --qti-selections-light-border: #d0d0d0;\n --qti-selections-dark-bg: #1f2937;\n --qti-selections-dark-border: #64748b;\n\n /* A drop-zone highlight is a background FILL only — no border, no ring — which keeps it\n layout-invariant for free (a fill never reflows; the old inset ring existed only to avoid the\n 2px shift a real border would cause). One authored knob:\n --qti-drop-highlight-bg the fill on the hovered / active target (follows --qti-bg-active)\n --qti-drop-highlight-enabled-bg every droppable zone: a fainter wash, derived from it\n --qti-drop-highlight-border-color / -border-width stay ONLY for the chip-in-flight outline\n (the dragging / return-anchor states), which marks the dragged element, not the zone. */\n --qti-drop-highlight-bg: var(--qti-bg-active);\n --qti-drop-highlight-enabled-bg: color-mix(in srgb, var(--qti-drop-highlight-bg) 50%, transparent);\n --qti-drop-highlight-border-color: var(--qti-border-active);\n --qti-drop-highlight-border-width: 2px;\n }\n}\n/* ============================================================================\n * interactions.corrections — answer-key and judgement paint.\n * ========================================================================== */\n@layer qti-components.interactions.corrections {\n :root,\n :host {\n /* ── Correction — derived from the semantic colours, never set directly. ── */\n --qti-correct: var(--qti-success);\n --qti-incorrect: var(--qti-error);\n --qti-partially-correct: var(--qti-warning);\n --qti-correct-light: color-mix(in srgb, var(--qti-correct) 5%, white);\n --qti-incorrect-light: color-mix(in srgb, var(--qti-incorrect) 5%, white);\n --qti-partially-correct-light: color-mix(in srgb, var(--qti-partially-correct) 5%, white);\n\n /* The answer key — the info blue, deliberately NOT the correct green. */\n --qti-answer-fg: var(--qti-info);\n --qti-answer-bg: color-mix(in srgb, var(--qti-info) 5%, white);\n --qti-answer-border: var(--qti-info);\n }\n}\n/* Mixin definitions only — emits nothing on its own, so it takes no layer. */\n/* QTI base — shared theme utilities and semantic mixins. Only styles >=2 interactions share.\n * They read the variables in qti-variables.css; a substrate re-colours by overriding those, not\n * by editing these. Split from qti-base.css. */\n/* ============================================================================\n * Shared semantic mixins. Only styles ≥2 interactions share belong here.\n * A substrate expresses its look by overriding the --qti-* variables above\n * (value first), not by editing these.\n * ========================================================================== */\n/*\n * Semantic PostCSS mixins. Interaction files wire these to their own parts and states; the mixins\n * own the shared visual vocabulary.\n */\n/*\n * A candidate correction, painted through the corrected element's own role.\n *\n * $role is whatever that element already is — `drag`, `button`, `text`, `field` — so this is the same\n * shape as `@mixin paint $role`, and obeys the same rule: a state repaints by SWITCHING a variable,\n * never by re-declaring the property. A brand's `--drag-*` and a correction's `--drag-*` are then the\n * same kind of declaration, resolved by the cascade rather than by one of them being a direct\n * property that the other can never outrank.\n *\n * This replaces the `candidate-chip` / `candidate-tint` pair. That split existed for one reason,\n * stated in candidate-chip's own comment: only chips had a paint binding, so everything else had to\n * correct by writing the four properties directly. Choices are `button`, text fields are `text` and\n * inline-choice is `field` now, so the reason is gone and one parameterized mixin covers all of them.\n *\n * `candidate-tint` below survives for the one corrected element with no role: qti-hottext.\n */\n/*\n * THE paint contract. Every visual component is, at rest, a bordered box on the theme's surface.\n * This mixin binds each PAINT property to a variable exactly once, so a state — or a theme —\n * repaints by SWITCHING a variable, never by re-declaring the property. Selectors choose state;\n * variables describe appearance; this block renders it.\n *\n * $role is what the thing IS — `drag`, `drop`, `button`, `text`, `field`, `menu`, `message`. Nothing\n * calls this mixin directly: each role below calls it once with its own name, and that is the only\n * place a role name is written. Every property then reads a two-tier chain:\n *\n * var(--$(role)-background-color, var(--qti-component-background-color))\n * ^ per-role SLOT, declared nowhere ^ TOKEN, declared in qti-variables.css\n *\n * The role in the slot name is the point. It replaces a single shared --component-* namespace, and\n * custom properties INHERIT: under one namespace a drop that set --component-background-color\n * repainted every chip standing inside it, and --component-box-shadow set on a drop mid-drag leaked\n * its elevation onto nested chips (the bug the `no @mixin dragging on the drop` note in\n * qti-match-interaction.css records). A chip reads --drag-*, its drop reads --drop-*, so the values\n * still inherit but no longer collide, and `border-style` no longer has to be set as a direct\n * property to stay off the chips (see `drop`).\n *\n * Only paint lives here. box-sizing / padding / margin are STRUCTURAL and stay on the role (see\n * `drag`) — a state must never switch them or the layout-invariance contract breaks. For the same\n * reason border-WIDTH and -radius are bound but must be treated as constant: a state may switch\n * --drag-border-color, never --drag-border-width.\n *\n * Deliberately NOT bound yet (they need their own VRT-checked step): `outline` (touches focus\n * rings) and a MULTI-SLOT box-shadow (so an element's resting lift, in-flight elevation and focus\n * ring compose instead of the last one winning — the documented four-rule box-shadow contention).\n */\n/*\n * A drag: the movable token a candidate drags into a gap, a drop target or an order slot.\n *\n * This used to be two mixins. `drag` drew the box — box-sizing, colours, a full `border`\n * shorthand, padding, `cursor: grab` — and a second one, `chip`, drew the skin over it: the same\n * colours again, the same radius, a lift, and `border-color` alone. Because that second mixin only\n * ever recoloured a border it could not create, the two had to be applied in that order, from two\n * different cascade layers, to every drag. Nine call sites did; a few did not, and those are where\n * the box models diverged — see the `associate` note in drag-drop.invariance.spec.ts.\n *\n * They are one mixin now, and it is the whole drag. Nothing has to run before it.\n *\n * `box-sizing` is deliberate and load-bearing: the floating clone is appended to document.body,\n * outside reset.css's `@scope (qti-item-body)`, so it inherits no border-box from anywhere else.\n * Under content-box the clone's padding would be added to the width the drag code measured off the\n * bank drag, and it would jump the instant it was picked up.\n */\n/*\n * The hole a drag leaves behind: lifted mid-drag, or spent because its copy is already placed.\n *\n * A modifier, not a look of its own. It repaints a drag and must be applied *with* `drag`, never\n * instead of it — `border-color: transparent` needs a border to make transparent, and the padding\n * holding the hole open is the drag's own. That is why `:state(drag)` survives `:state(placeholder)`:\n * an element that stopped being a drag when it was placed would take its footprint with it, and the\n * bank would reflow around a hole 20px narrower than the thing that left it. Measured in\n * drag-drop.invariance.spec.ts, \"a spent drag keeps its footprint\".\n */\n/*\n * The drag handle glyph.\n *\n * `display` and `vertical-align` are layout, and stay here under the pseudo-element exception in\n * CONTRACT.md \xa77: the theme creates this ::before, so no component can lay it out. One of its three\n * call sites is `[data-drag-clone]::before`, on a div the drag-drop JS builds at pointer-down —\n * there is no shadow root to delegate to at all.\n *\n * The exception is narrow on purpose: a theme-authored pseudo may place its own box and nothing\n * else. This one is in flow and takes real width, which is why it reserves an explicit width/height\n * rather than leaning on the glyph's intrinsic size.\n */\n/*\n * The radio and the checkbox: the other two things this theme draws as boxes, and so the other two\n * paint roles. A control is a bordered box on the theme's surface exactly like a chip is, and now it\n * says so — a third party restyles a checkbox through --checkbox-background-color the same way it\n * restyles a chip through --drag-background-color, with no specificity contest and nothing to\n * redeclare.\n *\n * They replace `form`, and the single-use `bordered` it wrapped, which hand-wrote this same paint\n * outside the contract: a `border` shorthand, then `border-width: thin` over the top of it, then a\n * hardcoded `background-color: white`. All three land on identical computed values through the\n * contract — `thin` computes to 1px, which is what --qti-component-border-width is, and\n * --qti-component-background-color resolves through --qti-bg to white. Measured, not assumed. The\n * one behavioural difference is the improvement: the fill now tracks the theme's surface instead of\n * being pinned to the literal `white`.\n *\n * Size stays a DIRECT property, deliberately. --qti-control-size is the control's box, and the\n * layout-invariance contract says a state may repaint a control but must never resize it, so this is\n * not a paint slot. Centring the mark is the component's job — qti-simple-choice.styles.ts already\n * flex-centres [part='control'].\n */\n/*\n * The mark inside a control at rest — the box the tick or dot is drawn into. Structural.\n *\n * A FRACTION of the control, not a px subtraction. `calc(size - 6px)` only holds its proportion at\n * one size: override --qti-control-size to 12px and the mark is 6px (50%) instead of 10px (62.5%),\n * and at 6px it disappears. The ratio is what the design is; the subtraction was that ratio frozen\n * at 16px. 0.625 reproduces today's 10px exactly, so nothing moves.\n *\n * A percentage would resolve against the control's CONTENT box, which is the border-box minus its\n * border — so it would silently shrink by the border width and change with it. Multiplying the token\n * keeps the mark proportional to the control's outer size, which is the size anyone reasons about.\n */\n/* A choice with its native control shown (radio/checkbox visible) is the button component with its\n border made TRANSPARENT — no visible box, but the 1px edge is still there, so it is the same box\n as the `.qti-input-control-hidden` choice (which keeps the border visible because the whole choice\n is the control). Only the border COLOUR differs between the two, never the geometry. */\n/*\n * The mark a checked control shows: a dot for a radio, a tick for a checkbox.\n *\n * A glyph, not a box — the same kind of thing as `grip` and `answer-check`, so it gets a colour slot\n * rather than a whole paint role. It is drawn ON the checked control's accent fill (see\n * `control-selected`), so the two belong together: override --checkbox-background-color and you will\n * usually want --checkbox-mark-color with it. `white` is the resting value, not a fixed one.\n */\n/*\n * `act`, `readonly` and `dis` used to live here. They are written out at their call sites now, for\n * two different reasons.\n *\n * `readonly` and `dis` were a single `cursor` declaration each — `pointer` and `not-allowed`. A mixin\n * that expands to one property is a name you have to look up to read the rule, and thirteen call\n * sites had to. THE POLICY THEY CARRIED IS STILL THE POLICY, and is worth stating once here rather\n * than losing with them: **the theme's disabled and readonly treatments are cursor ONLY.** No dimming,\n * no desaturation, no border change. A disabled control keeps its box and its colour so the page does\n * not reflow or change meaning when an item locks; the pointer is the whole affordance. If that ever\n * stops being true it becomes a state that PAINTS, and it belongs in the contract below, not in a\n * one-line mixin.\n *\n * `act` set `border-color` + `background-color` directly, which is what the paint contract exists to\n * stop: a state repaints by SWITCHING a variable, never by re-declaring the property. Its three call\n * sites split two ways — the selected choice now switches --button-* (see qti-choice-interaction.css,\n * where half of `act` turned out to be dead code), while the two `::part(drags)` containers keep\n * direct properties because a bare slot container has no paint role to switch.\n *\n * `act-bor` was deleted outright: zero call sites anywhere in the repo.\n */\n/* `foc` stays a mixin, deliberately, and is the one state still painting a property directly.\n * Twenty call sites read it, and it draws a `box-shadow` — the property the contract has NOT bound\n * (see `paint` above). Routing it through --<role>-box-shadow would not fix anything: focus would\n * then fight the resting lift and the in-flight elevation over one slot, last-declared winning,\n * which is the four-rule contention already documented in qti-variables.css. The intended fix\n * recorded there is a single `outline` on `:focus-visible`, and that is its own VRT-checked step. */\n/* A choice — the clickable box a candidate picks. Nothing but the resting paint box; its padding is\n the interaction's (qti-choice-interaction.css), because a choice's box differs per interaction and\n a chip's does not. */\n/* A text field: the paint box, plus the cursor that says you can type in it. */\n/*\n * A drop target: the paint box with a DASHED edge, the one thing that distinguishes it from every\n * other role.\n *\n * The re-declaration is deliberate. `@mixin paint drop` has just bound `border-style` to\n * `var(--drop-border-style, var(--qti-component-border-style))` — solid, like everything else — and\n * this overrides it with the same slot in front, so `dashed` is the drop's DEFAULT rather than a\n * value welded shut: a brand still switches the edge with --drop-border-style.\n *\n * It could not be expressed as a variable at all under the old shared namespace. `border-style` was\n * a direct property precisely because setting --component-border-style would have inherited the\n * dashed edge onto any chip standing in the drop (it did — a chip in a drop went dashed). Now that\n * the chip reads --drag-border-style, the drop's value inherits past it harmlessly.\n */\n/* The initial `display: none` moved to `validationMessage` in qti-base — the message is a shadow\n node, and `Interaction.reportValidity` already owns showing and hiding it with an inline style.\n What is left here is paint. */\n/*\n * The three roles qti-inline-choice-interaction is built from. They are separate roles rather than\n * one, because they nest: the menu and the message live in the field's shadow root, so under a\n * shared namespace the field's own paint inherited into both and a brand could not restyle the\n * field without restyling its popover.\n *\n * `field` the closed combobox — the box a candidate reads the chosen option in.\n * `menu` the popover the options are listed in.\n * `message` the validation box. Its warning colouring is the interaction's, not the role's.\n */\n/*\n * A drag in flight. The other `drag` modifier — applied with `drag`, never instead of it.\n *\n * `rotate` is paint: a transform never reflows, which is what lets a drag tilt under the cursor\n * without the bank shifting behind it.\n */\n/*\n * A drag darkens a little under the pointer. The one hover affordance in the theme.\n *\n * Guarded by `@media (hover: hover)` because touch does not lack hover — it emulates it, and the\n * emulated state sticks after a tap. Without the guard a tapped drag stays darkened until the\n * candidate taps somewhere else, which is worse than no hover at all.\n *\n * So this may only ever decorate. Everything it says is also said by `:focus-visible` for a keyboard\n * and by the resting state for a finger; nothing is communicated by hover alone.\n *\n * A background darken, not a lift: it costs no layout (paint only, never reflows the bank), and it\n * reads the chip's own `--drag-background-color`, so it tracks whatever the brand painted the\n * chip — primary under Kennisnet, white otherwise. `background-color` is a DIRECT property (not\n * `--drag-background-color`): it overrides the `@mixin paint drag` binding on `:hover`, does not\n * self-reference the var it reads, and — being a real property — never inherits into children.\n *\n * It replaces `hov`, an empty mixin invoked 21 times, applied to drags, drop targets, textareas,\n * hotspots and choices alike where no single rule suited all of them. This one is called from drags\n * only.\n */\n/* Per-interaction sheets; each import carries its layer where the file has just one. */\n@layer qti-components.interactions.base {\n qti-choice-interaction {\n /* A choice hugs its text here, unlike order-interaction, which uses the same element as a chip.\n Handed to qti-simple-choice.styles.ts, which owns the label's box; this was an\n `::part(label) { display: inline !important }`. */\n --qti-choice-label-display: inline;\n\n & qti-simple-choice {\n padding: var(--qti-padding-box);\n width: -moz-fit-content;\n width: fit-content;\n cursor: pointer;\n }\n\n &.qti-input-control-hidden {\n & qti-simple-choice {\n background-color: var(--button-background-color, var(--qti-component-background-color));\n background-image: var(--button-background-image, var(--qti-component-background-image));\n border-width: var(--button-border-width, var(--qti-component-border-width));\n border-style: var(--button-border-style, var(--qti-component-border-style));\n border-color: var(--button-border-color, var(--qti-component-border-color));\n border-radius: var(--button-border-radius, var(--qti-component-border-radius));\n box-shadow: var(--button-box-shadow, var(--qti-component-box-shadow));\n color: var(--button-color, var(--qti-component-color));\n opacity: var(--button-opacity, var(--qti-component-opacity));\n filter: var(--button-filter, var(--qti-component-filter));\n --qti-control-display: none;\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n }\n }\n\n &:not(.qti-input-control-hidden) {\n & qti-simple-choice {\n background-color: var(--button-background-color, var(--qti-component-background-color));\n background-image: var(--button-background-image, var(--qti-component-background-image));\n border-width: var(--button-border-width, var(--qti-component-border-width));\n border-style: var(--button-border-style, var(--qti-component-border-style));\n border-color: var(--button-border-color, var(--qti-component-border-color));\n border-radius: var(--button-border-radius, var(--qti-component-border-radius));\n box-shadow: var(--button-box-shadow, var(--qti-component-box-shadow));\n color: var(--button-color, var(--qti-component-color));\n opacity: var(--button-opacity, var(--qti-component-opacity));\n filter: var(--button-filter, var(--qti-component-filter));\n --button-border-color: transparent;\n gap: 0.5rem;\n outline: none;\n cursor: pointer;\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n &::part(control-mark) {\n width: calc(var(--qti-control-size) * 0.625);\n height: calc(var(--qti-control-size) * 0.625);\n }\n }\n }\n }\n}\n@layer qti-components.interactions.states {\n qti-choice-interaction {\n &.qti-input-control-hidden qti-simple-choice {\n /* A selected choice, repainted through the button role's slots rather than by re-declaring the\n properties — the choice is `@mixin button`, so switching a variable is all a state has to do.\n This used to be `@mixin act` followed by two direct declarations, and half of `act` was dead\n on arrival: it set `background-color: var(--qti-bg-active)` and the very next line overwrote\n it with the selected fill. Only its border-colour ever survived, which is written out here. */\n &:state(checked) {\n --button-border-color: var(--qti-border-active);\n --button-background-color: var(--qti-selected-bg);\n --button-color: var(--qti-selected-color);\n }\n\n &:state(readonly) {\n cursor: pointer;\n }\n\n &:state(disabled) {\n cursor: not-allowed;\n }\n }\n\n &:not(.qti-input-control-hidden) qti-simple-choice {\n &:state(readonly) {\n cursor: pointer;\n }\n\n &:state(disabled) {\n cursor: not-allowed;\n }\n\n &:state(radio)::part(control) {\n background-color: var(--radio-background-color, var(--qti-component-background-color));\n background-image: var(--radio-background-image, var(--qti-component-background-image));\n border-width: var(--radio-border-width, var(--qti-component-border-width));\n border-style: var(--radio-border-style, var(--qti-component-border-style));\n border-color: var(--radio-border-color, var(--qti-component-border-color));\n border-radius: var(--radio-border-radius, var(--qti-component-border-radius));\n box-shadow: var(--radio-box-shadow, var(--qti-component-box-shadow));\n color: var(--radio-color, var(--qti-component-color));\n opacity: var(--radio-opacity, var(--qti-component-opacity));\n filter: var(--radio-filter, var(--qti-component-filter));\n width: var(--qti-control-size);\n height: var(--qti-control-size);\n /* Round. Re-declared with the slot in FRONT of the default, the same shape as the drop's dashed\n edge, so a brand can square a radio off without having to out-specify this rule. */\n border-radius: var(--radio-border-radius, 100%);\n }\n\n &:state(radio):state(checked)::part(control),\n &:state(checkbox):state(checked)::part(control) {\n border-color: var(--qti-primary);\n background-color: var(--qti-primary);\n }\n\n &:state(radio):state(checked)::part(control-mark) {\n /* 0.5 reproduces today's 8px at the default 1rem — see mark-size for why this is a fraction. */\n width: calc(var(--qti-control-size) * 0.5);\n height: calc(var(--qti-control-size) * 0.5);\n background-color: var(--radio-mark-color, white);\n border-radius: 100%;\n }\n\n &:state(checkbox)::part(control) {\n background-color: var(--checkbox-background-color, var(--qti-component-background-color));\n background-image: var(--checkbox-background-image, var(--qti-component-background-image));\n border-width: var(--checkbox-border-width, var(--qti-component-border-width));\n border-style: var(--checkbox-border-style, var(--qti-component-border-style));\n border-color: var(--checkbox-border-color, var(--qti-component-border-color));\n border-radius: var(--checkbox-border-radius, var(--qti-component-border-radius));\n box-shadow: var(--checkbox-box-shadow, var(--qti-component-box-shadow));\n color: var(--checkbox-color, var(--qti-component-color));\n opacity: var(--checkbox-opacity, var(--qti-component-opacity));\n filter: var(--checkbox-filter, var(--qti-component-filter));\n width: var(--qti-control-size);\n height: var(--qti-control-size);\n }\n\n &:state(checkbox):state(checked)::part(control-mark) {\n background-color: var(--checkbox-mark-color, white);\n -webkit-mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E\");\n mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E\");\n }\n }\n }\n}\n@layer qti-components.interactions.corrections {\n qti-choice-interaction {\n & qti-simple-choice {\n &:state(correct-response),\n &[data-correct-response='true'] {\n &::after {\n content: '\\02714';\n color: var(--qti-correct);\n }\n }\n }\n\n &.qti-input-control-hidden qti-simple-choice {\n /*\n * Paint only. This used to set `border: 3px` over a 1px base and add `padding-right: 30px`,\n * so revealing the answer key grew every correct choice and reflowed the list around it.\n *\n * The thicker edge is now an inset shadow, which paints inside the existing border box and\n * costs no layout. The 30px that kept the label clear of the tick is reserved in the base\n * rule for this variant, whether or not a tick ever appears.\n */\n &:state(correct-response),\n &[data-correct-response='true'] {\n border-color: var(--qti-correct) !important;\n box-shadow: inset 0 0 0 2px var(--qti-correct);\n\n &::after {\n content: '\\02714';\n color: var(--qti-correct);\n position: absolute;\n top: 5px;\n right: 5px;\n font-size: 1.2em;\n font-weight: bold;\n }\n }\n\n /* Candidate judgement follows checked/correct-response paint so it can\n recolour the same stable box without changing its geometry. */\n &:state(candidate-correct) {\n --button-background-color: var(--qti-correct-light);\n --button-color: var(--qti-correct);\n --button-border-color: var(--qti-correct);\n --button-box-shadow: none;\n }\n\n &:state(candidate-incorrect) {\n --button-background-color: var(--qti-incorrect-light);\n --button-color: var(--qti-incorrect);\n --button-border-color: var(--qti-incorrect);\n --button-box-shadow: none;\n }\n }\n\n &:not(.qti-input-control-hidden) qti-simple-choice {\n &:state(candidate-correct) {\n background-color: transparent;\n\n &:state(radio):state(checked)::part(control),\n &:state(checkbox):state(checked)::part(control) {\n border-color: var(--qti-correct);\n background-color: var(--qti-correct);\n }\n }\n\n &:state(candidate-incorrect) {\n background-color: transparent;\n\n &:state(radio):state(checked)::part(control),\n &:state(checkbox):state(checked)::part(control) {\n border-color: var(--qti-incorrect);\n background-color: var(--qti-incorrect);\n }\n }\n }\n }\n\n .full-correct-response qti-choice-interaction {\n qti-simple-choice {\n &:state(radio):state(checked)::part(control),\n &:state(checkbox):state(checked)::part(control) {\n background-color: var(--qti-answer-bg);\n color: var(--qti-answer-fg);\n border-color: var(--qti-answer-border);\n }\n\n &:state(radio):state(checked)::part(control-mark),\n &:state(checkbox):state(checked)::part(control-mark) {\n background-color: var(--qti-answer-fg);\n }\n }\n\n &.qti-input-control-hidden qti-simple-choice:state(checked) {\n background-color: var(--qti-answer-bg);\n color: var(--qti-answer-fg);\n border-color: var(--qti-answer-border);\n }\n }\n}\n@layer qti-components.interactions.base {\n qti-graphic-gap-match-interaction {\n &.qti-selections-light {\n &:state(dragzone-active)::part(drags) {\n background-color: var(--qti-selections-light-bg);\n border-color: var(--qti-selections-light-border);\n }\n &:state(dragzone-enabled)::part(drags) {\n background-color: var(--qti-selections-light-bg);\n }\n }\n &.qti-selections-dark {\n &:state(dragzone-active)::part(drags) {\n background-color: var(--qti-selections-dark-bg);\n border-color: var(--qti-selections-dark-border);\n }\n &:state(dragzone-enabled)::part(drags) {\n background-color: var(--qti-selections-dark-bg);\n }\n }\n &:state(dragzone-active)::part(drags) {\n background-color: var(--qti-bg-active);\n }\n &:state(dragzone-enabled)::part(drags) {\n background-color: var(--qti-bg-active);\n }\n /*\n * A graphic-gap-match chip is an image, not a card. No drag-card styling — no border, no padding,\n * no background — the tile is its picture and nothing else.\n *\n * The bank chip and the placed chip must still be the same size (drag-drop.invariance.spec.ts),\n * and they are: NEITHER gets chip styling. The earlier 18px height jump came from the bank being\n * plain while the placed chip picked up drag-card styling through `::part(drag)` — fixed then by\n * giving both the card, fixed better now by giving neither.\n */\n /* A chip here is a tile filling its hotspot, so it centres its content — see\n qti-gap-img.styles.ts and qti-gap-text.styles.ts. gap-match's chips hug their text instead,\n which is why the justification is a variable rather than the element's default. */\n & qti-gap-img,\n & qti-gap-text {\n --qti-drag-justify-content: center;\n cursor: grab;\n }\n /* The placed chip, in the hotspot's shadow. Plain too, to match the bank. Focus ring only. */\n & qti-associable-hotspot::part(drag) {\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n }\n /*\n * The hotspot centres its chip in qti-associable-hotspot.styles.ts.\n *\n * There is no `.qti-unselected-hidden` rule for this interaction, and none is needed. Appendix\n * B.1 lists the class here, and \xa73.2.6's requirement is to hide hotspots in their unselected and\n * unfocused state — which this transparent border already does, for every item, whether or not\n * the author sets the class. An empty hotspot shows nothing; `:state(filled)` paints the\n * selection, and `:state(enabled)` / `:state(hover)` / `:state(active)` bring the drop targets\n * up for the duration of a drag so the candidate can still aim.\n *\n * Adding a rule would be a redundant restatement of this line. Left as a note rather than code\n * because the absence is the kind of thing that reads as an oversight.\n */\n & qti-associable-hotspot {\n border: 2px solid transparent;\n /* No .qti-selections-* branches in here. They used to sit inside both of these blocks as\n *descendant* selectors — and the class is on the interaction, an ancestor of this hotspot,\n so they never matched anything. The pair that works is scoped from the interaction down;\n see the :state(filled) rules below.\n A drop target lighting up mid-drag is not a \"selection\" anyway — Appendix B calls this\n Selections theming, and the selection is the chip once it has landed. */\n &[enabled] {\n background-color: var(--qti-bg-active);\n }\n &[active] {\n background-color: var(--qti-bg-active);\n }\n &[disabled] {\n cursor: not-allowed;\n &:not(:empty) {\n cursor: default !important;\n }\n }\n &:not(:empty) {\n border-color: var(--qti-border) !important;\n }\n /*\n * Two rules were deleted here, both unreachable, both about padding:\n *\n * &:empty::after { padding: var(--qti-padding-md) var(--qti-padding-lg); content: '\\0000a0' }\n * &:not(:empty) { padding: 0; width: auto }\n *\n * `--qti-padding-md` / `--qti-padding-lg` are defined nowhere in the repo, so the first was\n * invalid at computed-value time and paid no padding. It could not have rendered regardless:\n * a hotspot renders its chips into `<div part=\"drop\">` in its own shadow root and has no\n * `<slot>`, so the host is always `:empty` to a selector AND its `::after` — light-tree\n * content — is never assigned anywhere. The nbsp was not holding an empty hotspot open;\n * --qti-dropzone-min-* on the host is. By the same reasoning `:not(:empty)` never matches.\n *\n * They are named here rather than silently dropped because they read like the hotspot's\n * padding story, and the next person to give drops an inset should know there isn't one.\n */\n\n /* `flex: 1` left with the rest of the drop's layout; dropRegion in qti-base gives a hosted\n chip `flex: 0 0 auto`, which is the invariance rule this was quietly fighting. */\n &:not(:empty) > * {\n transform: rotate(0);\n box-shadow: 0 0 0 1px #e5e7eb;\n }\n }\n /* `:not(:empty)` tested light-DOM children. The hotspot renders its chips into its own shadow\n root now, so it is always \"empty\" to a selector — `:state(filled)` is the occupancy hook. */\n &.qti-selections-light qti-associable-hotspot:state(filled) {\n background-color: var(--qti-selections-light-bg) !important;\n border-color: var(--qti-selections-light-border) !important;\n }\n &.qti-selections-dark qti-associable-hotspot:state(filled) {\n background-color: var(--qti-selections-dark-bg) !important;\n border-color: var(--qti-selections-dark-border) !important;\n }\n & img {\n margin: 0;\n padding: 0;\n }\n }\n}\n@layer qti-components.interactions.states {\n qti-graphic-gap-match-interaction qti-gap-img:state(placeholder),\n qti-graphic-gap-match-interaction qti-gap-text:state(placeholder) {\n /* The hole a spent/lifted chip leaves. Like the chip (see `drag`), it sets NO fill / border /\n shadow of its own — those inherit from the resting chip (neutral by default, the brand's fill\n when an overlay is on), so a brand can restyle the hole via a `:state(placeholder)` overlay\n with no specificity contest. The one thing a placeholder always does, in every brand, is hide\n its text; the default hole is then just the resting chip (white + border) with its text gone. */\n --drag-color: transparent;\n --drag-opacity: 1;\n pointer-events: none;\n }\n\n qti-graphic-gap-match-interaction qti-gap-img:state(dragging),\n qti-graphic-gap-match-interaction qti-gap-text:state(dragging) {\n /* The hole a spent/lifted chip leaves. Like the chip (see `drag`), it sets NO fill / border /\n shadow of its own — those inherit from the resting chip (neutral by default, the brand's fill\n when an overlay is on), so a brand can restyle the hole via a `:state(placeholder)` overlay\n with no specificity contest. The one thing a placeholder always does, in every brand, is hide\n its text; the default hole is then just the resting chip (white + border) with its text gone. */\n --drag-color: transparent;\n --drag-opacity: 1;\n border-color: var(--qti-drop-highlight-border-color);\n box-shadow: inset 0 0 0 var(--qti-drop-highlight-border-width, 2px)\n color-mix(in srgb, var(--qti-drop-highlight-border-color) 55%, transparent);\n pointer-events: none;\n }\n\n qti-graphic-gap-match-interaction qti-gap-img:state(return-anchor),\n qti-graphic-gap-match-interaction qti-gap-text:state(return-anchor) {\n border-color: var(--qti-drop-highlight-border-color);\n box-shadow: inset 0 0 0 var(--qti-drop-highlight-border-width, 2px)\n color-mix(in srgb, var(--qti-drop-highlight-border-color) 55%, transparent);\n }\n\n qti-graphic-gap-match-interaction qti-gap-img:state(placeholder) > *,\n qti-graphic-gap-match-interaction qti-gap-text:state(placeholder) > *,\n qti-graphic-gap-match-interaction qti-gap-img:state(dragging) > *,\n qti-graphic-gap-match-interaction qti-gap-text:state(dragging) > * {\n visibility: hidden;\n }\n\n qti-graphic-gap-match-interaction qti-associable-hotspot:state(hover),\n qti-graphic-gap-match-interaction qti-associable-hotspot:state(active) {\n background-color: var(--qti-drop-highlight-bg);\n }\n\n qti-graphic-gap-match-interaction qti-associable-hotspot:state(enabled) {\n background-color: var(--qti-drop-highlight-enabled-bg);\n }\n}\n@layer qti-components.interactions.corrections {\n /*\n * The one place this interaction joins the shared chip vocabulary: its chips take no card, but they\n * do take a correction.\n *\n * And it is the one that must stay DIRECT. Everywhere else a correction switches --<role>-* slots\n * (`@mixin candidate drag`), because the chip is painted by `@mixin paint drag` and reads them.\n * A ggm chip is a photograph on a picture with no paint role at all — nothing reads --drag-*, so\n * routing the correction through a slot would simply erase it. Measured: a corrected ggm chip is\n * pale-green filled with a green tint on its text and no border at all.\n *\n * Moved here from qti-corrections.css, whose unscoped `:state(drag)` rule covered these chips\n * along with everyone else's.\n */\n qti-graphic-gap-match-interaction :state(drag):state(candidate-correct),\n qti-graphic-gap-match-interaction qti-associable-hotspot::part(drag):state(candidate-correct) {\n background-color: var(--qti-correct-light);\n color: var(--qti-correct);\n border-color: var(--qti-correct);\n box-shadow: none;\n }\n\n qti-graphic-gap-match-interaction :state(drag):state(candidate-incorrect),\n qti-graphic-gap-match-interaction qti-associable-hotspot::part(drag):state(candidate-incorrect) {\n background-color: var(--qti-incorrect-light);\n color: var(--qti-incorrect);\n border-color: var(--qti-incorrect);\n box-shadow: none;\n }\n}\n@layer qti-components.interactions.base {\n qti-text-entry-interaction {\n background-color: var(--text-background-color, var(--qti-component-background-color));\n background-image: var(--text-background-image, var(--qti-component-background-image));\n border-width: var(--text-border-width, var(--qti-component-border-width));\n border-style: var(--text-border-style, var(--qti-component-border-style));\n border-color: var(--text-border-color, var(--qti-component-border-color));\n border-radius: var(--text-border-radius, var(--qti-component-border-radius));\n box-shadow: var(--text-box-shadow, var(--qti-component-box-shadow));\n color: var(--text-color, var(--qti-component-color));\n opacity: var(--text-opacity, var(--qti-component-opacity));\n filter: var(--text-filter, var(--qti-component-filter));\n cursor: text;\n\n &::part(input) {\n color: var(--qti-fg);\n font-family: inherit;\n font-size: 1rem;\n line-height: 1.5;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n border: none;\n background-color: transparent;\n }\n }\n}\n@layer qti-components.interactions.corrections {\n qti-text-entry-interaction {\n &:state(candidate-partially-correct) {\n --text-background-color: var(--qti-partially-correct-light);\n --text-color: var(--qti-partially-correct);\n --text-border-color: var(--qti-partially-correct);\n --text-box-shadow: none;\n }\n\n &:state(candidate-correct) {\n --text-background-color: var(--qti-correct-light);\n --text-color: var(--qti-correct);\n --text-border-color: var(--qti-correct);\n --text-box-shadow: none;\n }\n\n &:state(candidate-incorrect) {\n --text-background-color: var(--qti-incorrect-light);\n --text-color: var(--qti-incorrect);\n --text-border-color: var(--qti-incorrect);\n --text-box-shadow: none;\n }\n }\n\n /* The answer key, moved here from the shared qti-corrections.css: it names this interaction, so\n this file owns it. */\n .full-correct-response qti-text-entry-interaction {\n background-color: var(--qti-answer-bg);\n color: var(--qti-answer-fg);\n border-color: var(--qti-answer-border);\n\n &::part(input) {\n color: var(--qti-answer-fg);\n }\n\n &::part(answer) {\n content: '';\n background-color: var(--qti-answer-fg);\n mask: var(--qti-check-mask) no-repeat center / contain;\n -webkit-mask: var(--qti-check-mask) no-repeat center / contain;\n }\n }\n}\n@layer qti-components.interactions.base {\n qti-extended-text-interaction {\n /*\n * One block, and the ORDER inside it matters.\n *\n * These were two separate `::part(textarea)` rules, `@mixin text` first and\n * `@mixin field-typography` second. Both declare `color`, so the later one won and the textarea's\n * text was pinned to `--qti-fg` — which meant the paint contract's `color` binding was dead, and\n * a correction switching --text-color could not recolour a single character. Measured: a\n * corrected extended-text stayed black.\n *\n * `@mixin text` goes last so the binding is the winning declaration. Nothing moves at rest: the\n * slot is unset, so it falls through to --qti-component-color, which is `inherit` — the same\n * colour the textarea already had.\n */\n &::part(textarea) {\n color: var(--qti-fg);\n font-family: inherit;\n font-size: 1rem;\n line-height: 1.5;\n /*\n * The left gutter is reserved ALWAYS, graded or not.\n *\n * It holds the correction badge, and it is stated here rather than in the corrections layer\n * because padding is layout: switching it on `:state(candidate-*)` would re-wrap every line of\n * the candidate's answer at the moment the verdict appears. That is the layout-invariance\n * contract, and the lint rule enforces it — the old class-based rules broke it and were never\n * live enough for anyone to notice.\n *\n * qti-choice-interaction reserves its answer-key tick the same way, for the same reason: \"the\n * 30px that kept the label clear of the tick is reserved in the base rule, whether or not a\n * tick ever appears.\"\n *\n * --qti-correction-gutter is derived from the badge's inset, size and glyph gap, so this\n * padding and the badge's own offsets cannot drift apart. It was a literal 2.4rem that had to\n * be kept in agreement by hand with numbers in a different package.\n */\n padding: var(--qti-spacing) var(--qti-correction-inset) var(--qti-spacing)\n var(--qti-correction-gutter);\n\n background-color: var(--text-background-color, var(--qti-component-background-color));\n\n background-image: var(--text-background-image, var(--qti-component-background-image));\n\n border-width: var(--text-border-width, var(--qti-component-border-width));\n\n border-style: var(--text-border-style, var(--qti-component-border-style));\n\n border-color: var(--text-border-color, var(--qti-component-border-color));\n\n border-radius: var(--text-border-radius, var(--qti-component-border-radius));\n\n box-shadow: var(--text-box-shadow, var(--qti-component-box-shadow));\n\n color: var(--text-color, var(--qti-component-color));\n\n opacity: var(--text-opacity, var(--qti-component-opacity));\n\n filter: var(--text-filter, var(--qti-component-filter));\n\n cursor: text;\n }\n\n /*\n * format=\"preformatted\". Painted here rather than in the component's shadow root, because\n * `field-typography` above sets `font-family: inherit` through `::part()` — a document rule,\n * which beats any shadow-root rule no matter its specificity. A `:host([format=...])` rule\n * inside the component would simply never win once this theme is loaded.\n *\n * A textarea already preserves whitespace, so what preformatted adds is the monospace grid\n * that makes the preserved indentation legible. Typography only — the box does not move, so\n * the layout-invariance contract holds.\n */\n &[format='preformatted']::part(textarea) {\n font-family: monospace;\n -moz-tab-size: 2;\n -o-tab-size: 2;\n tab-size: 2;\n }\n }\n}\n/*\n * Corrections for the one interaction that cannot judge itself.\n *\n * An extended-text response is free prose, so there is no correct answer to compare against and the\n * component computes no verdict — it extends `Interaction` directly, exactly as\n * correct-response.mixin.ts prescribes for extended-text, upload and media. The verdict arrives from\n * OUTSIDE instead (a teacher, a marking service), through qti-extended-text-interaction-correction.ts,\n * which publishes it as the same `:state(candidate-*)` custom states every other interaction uses.\n * From here the difference is invisible: these rules are the same shape as text-entry's.\n *\n * They were keyed on `.correct`, `.partiallyCorrect` and `.incorrect` until now — plain light-DOM\n * classes that nothing in the repo ever set, with the camelCase among kebab-case states marking them\n * as an older API. They never rendered once. The `padding-left` is the part of them that was right\n * all along: a gutter reserved for a glyph that until now was never drawn.\n *\n * The gutter is spacing, not paint, so it stays a direct declaration. The badge that sits in it is\n * positioned by the component and painted by ::part(correction-*) in qti-corrections.css.\n */\n@layer qti-components.interactions.corrections {\n qti-extended-text-interaction {\n &:state(candidate-correct)::part(textarea) {\n --text-background-color: var(--qti-correct-light);\n --text-color: var(--qti-correct);\n --text-border-color: var(--qti-correct);\n --text-box-shadow: none;\n }\n\n /* Amber throughout — text, edge and wash — exactly like text-entry's partial rule, which is the\n reference for a field taking a verdict. It read `var(--qti-fg)` for the text until now, so the\n words stayed the body colour while everything around them went amber; that was carried over\n verbatim from the dead class-based rules, where it had never rendered and so was never seen to\n be wrong. With --qti-fg now correctly resolving to `inherit`, it would have been more visibly\n wrong still. */\n &:state(candidate-partially-correct)::part(textarea) {\n --text-background-color: var(--qti-partially-correct-light);\n --text-color: var(--qti-partially-correct);\n --text-border-color: var(--qti-partially-correct);\n --text-box-shadow: none;\n }\n\n &:state(candidate-incorrect)::part(textarea) {\n --text-background-color: var(--qti-incorrect-light);\n --text-color: var(--qti-incorrect);\n --text-border-color: var(--qti-incorrect);\n --text-box-shadow: none;\n }\n }\n}\n/* This interaction's chip vocabulary — the bank chip, the placed chip, and the floating clone. One\n such block per drag-drop interaction, opt-in; graphic-gap-match deliberately declares none. See\n qti-states.css. Kept in the `global` layer, where these rules used to live, so cascade position is\n unchanged.\n\n The clone is matched by [data-drag-interaction] rather than by ancestry because it is a SIBLING of\n the interaction, not a descendant: createDragClone appends it to the interaction's ROOT (the\n item's shadow root), which is the same tree — so the theme can reach it — but not the same\n subtree. The attribute is also what tells one interaction's chip in flight from another's, which\n is how graphic-gap-match stays out without anyone writing an exclusion.\n\n Its grip hangs off ::part(control)::before, the same place the resting chip's does, so a chip does\n not move its handle when you pick it up. That the part is reachable at all is new: while the clone\n sat on document.body it was in a different tree from the adopted stylesheet, and nothing — no\n part, no attribute — could style it. */\n@layer qti-components.global {\n qti-gap-match-interaction :state(drag),\n [data-drag-clone][data-drag-interaction='qti-gap-match-interaction'] {\n /* Structural — the load-bearing box, never state-switched (layout-invariance contract).\n box-sizing is deliberate: the clone is appended to document.body outside reset.css's\n @scope, so it inherits no border-box from anywhere else and this sets it. */\n box-sizing: border-box;\n padding: var(--qti-drag-padding);\n cursor: grab;\n /*\n * A chip is as wide as the drop it belongs in — the SAME token the drop reserves with.\n *\n * That one shared name is what makes a drag and its drop the same size without any arithmetic\n * relating them: the interaction measures the widest chip, publishes it once, and both the chip\n * and the slot read it. See DROP-SIZING.md.\n *\n * It applies in the bank as well as in the drop, which is the point: the chip already has the\n * width before it is dropped, so nothing changes size at the moment of landing. That keeps \"a chip\n * is the same chip wherever it lives\" true (drag-drop.invariance.spec.ts) and keeps the return\n * animation from ending in a snap. A `width: 100%` on the placed chip gives the same still image\n * and breaks both — it is what order used to do, and why order was the one entry in\n * CHIP_BOX_KNOWN_BAD.\n *\n * min-width, not width, so a chip whose own text is wider than the widest measured chip still\n * fits. Defaults to 0 where nothing is measured (match, whose targets are cards, not slots), so\n * those chips keep their natural width with no rule needed to say so.\n *\n * --qti-drag-min-width, not --qti-dropzone-min-width: the mixin writes the same measured value to\n * both, so a chip and its slot still match, but the two need OPPOSITE defaults when nothing is\n * measured — a chip must stay at its natural width, while a drops-grid track must not collapse.\n * See the note on both names in qti-variables.css.\n */\n min-width: var(--qti-drag-min-width, 0);\n /* Paint via the contract, nothing more — the --qti-component-* tokens already make a neutral\n bordered box (white surface, theme border, no shadow). The chip sets NO --drag-* of its own,\n and that is load-bearing: if it did (e.g. `--drag-background-color: white`), that declaration\n would ride the interaction's HIGH-specificity chip selector\n (`qti-gap-match-interaction qti-gap::part(drag)`) and out-specify a brand overlay's bare\n `qti-gap::part(drag)`, so the brand could never win. With nothing set here, the overlay's\n --drag-* is the only declaration and wins with no specificity/layer contest. */\n background-color: var(--drag-background-color, var(--qti-component-background-color));\n background-image: var(--drag-background-image, var(--qti-component-background-image));\n border-width: var(--drag-border-width, var(--qti-component-border-width));\n border-style: var(--drag-border-style, var(--qti-component-border-style));\n border-color: var(--drag-border-color, var(--qti-component-border-color));\n border-radius: var(--drag-border-radius, var(--qti-component-border-radius));\n box-shadow: var(--drag-box-shadow, var(--qti-component-box-shadow));\n color: var(--drag-color, var(--qti-component-color));\n opacity: var(--drag-opacity, var(--qti-component-opacity));\n filter: var(--drag-filter, var(--qti-component-filter));\n }\n\n qti-gap-match-interaction :state(drag)::part(control)::before,\n qti-gap-match-interaction::part(drag-control)::before,\n qti-gap-match-interaction ::part(drag-control)::before,\n [data-drag-clone][data-drag-interaction='qti-gap-match-interaction']::part(control)::before {\n content: '';\n display: inline-block;\n vertical-align: middle;\n width: 0.75em;\n height: 1em;\n margin-right: var(--qti-glyph-gap);\n background-color: currentColor;\n mask: var(--qti-grip-mask) no-repeat center / contain;\n -webkit-mask: var(--qti-grip-mask) no-repeat center / contain;\n }\n}\n@layer qti-components.interactions.base {\n qti-gap-match-interaction {\n /* No qti-selections-light / -dark here. Appendix B.1 of the QTI 3 implementation guide defines\n that class pair for qti-hotspot-interaction and qti-graphic-gap-match-interaction only, and no\n item in this repo ever set it on a gap-match interaction. What was here overrode the neutral\n drag-bank highlight below with --qti-light-* and --qti-dark-* colours that nothing could reach. */\n &:state(dragzone-active)::part(drags) {\n background-color: var(--qti-bg-active);\n }\n &:state(dragzone-enabled)::part(drags) {\n background-color: var(--qti-bg-active);\n }\n /* Editor fake-drag projected into a filled <qti-gap>'s shadow. Same `drag`\n styling so the editor preview matches runtime when a gap is filled. */\n & qti-gap::part(drag) {\n /* Structural — the load-bearing box, never state-switched (layout-invariance contract).\n box-sizing is deliberate: the clone is appended to document.body outside reset.css's\n @scope, so it inherits no border-box from anywhere else and this sets it. */\n box-sizing: border-box;\n padding: var(--qti-drag-padding);\n cursor: grab;\n /*\n * A chip is as wide as the drop it belongs in — the SAME token the drop reserves with.\n *\n * That one shared name is what makes a drag and its drop the same size without any arithmetic\n * relating them: the interaction measures the widest chip, publishes it once, and both the chip\n * and the slot read it. See DROP-SIZING.md.\n *\n * It applies in the bank as well as in the drop, which is the point: the chip already has the\n * width before it is dropped, so nothing changes size at the moment of landing. That keeps \"a chip\n * is the same chip wherever it lives\" true (drag-drop.invariance.spec.ts) and keeps the return\n * animation from ending in a snap. A `width: 100%` on the placed chip gives the same still image\n * and breaks both — it is what order used to do, and why order was the one entry in\n * CHIP_BOX_KNOWN_BAD.\n *\n * min-width, not width, so a chip whose own text is wider than the widest measured chip still\n * fits. Defaults to 0 where nothing is measured (match, whose targets are cards, not slots), so\n * those chips keep their natural width with no rule needed to say so.\n *\n * --qti-drag-min-width, not --qti-dropzone-min-width: the mixin writes the same measured value to\n * both, so a chip and its slot still match, but the two need OPPOSITE defaults when nothing is\n * measured — a chip must stay at its natural width, while a drops-grid track must not collapse.\n * See the note on both names in qti-variables.css.\n */\n min-width: var(--qti-drag-min-width, 0);\n /* Paint via the contract, nothing more — the --qti-component-* tokens already make a neutral\n bordered box (white surface, theme border, no shadow). The chip sets NO --drag-* of its own,\n and that is load-bearing: if it did (e.g. `--drag-background-color: white`), that declaration\n would ride the interaction's HIGH-specificity chip selector\n (`qti-gap-match-interaction qti-gap::part(drag)`) and out-specify a brand overlay's bare\n `qti-gap::part(drag)`, so the brand could never win. With nothing set here, the overlay's\n --drag-* is the only declaration and wins with no specificity/layer contest. */\n background-color: var(--drag-background-color, var(--qti-component-background-color));\n background-image: var(--drag-background-image, var(--qti-component-background-image));\n border-width: var(--drag-border-width, var(--qti-component-border-width));\n border-style: var(--drag-border-style, var(--qti-component-border-style));\n border-color: var(--drag-border-color, var(--qti-component-border-color));\n border-radius: var(--drag-border-radius, var(--qti-component-border-radius));\n box-shadow: var(--drag-box-shadow, var(--qti-component-box-shadow));\n color: var(--drag-color, var(--qti-component-color));\n opacity: var(--drag-opacity, var(--qti-component-opacity));\n filter: var(--drag-filter, var(--qti-component-filter));\n &:hover {\n @media (hover: hover) {\n background-color: color-mix(\n in srgb,\n var(--drag-background-color, var(--qti-component-background-color)) 92%,\n black\n );\n }\n }\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n }\n & qti-gap-text {\n /* Structural — the load-bearing box, never state-switched (layout-invariance contract).\n box-sizing is deliberate: the clone is appended to document.body outside reset.css's\n @scope, so it inherits no border-box from anywhere else and this sets it. */\n box-sizing: border-box;\n padding: var(--qti-drag-padding);\n cursor: grab;\n /*\n * A chip is as wide as the drop it belongs in — the SAME token the drop reserves with.\n *\n * That one shared name is what makes a drag and its drop the same size without any arithmetic\n * relating them: the interaction measures the widest chip, publishes it once, and both the chip\n * and the slot read it. See DROP-SIZING.md.\n *\n * It applies in the bank as well as in the drop, which is the point: the chip already has the\n * width before it is dropped, so nothing changes size at the moment of landing. That keeps \"a chip\n * is the same chip wherever it lives\" true (drag-drop.invariance.spec.ts) and keeps the return\n * animation from ending in a snap. A `width: 100%` on the placed chip gives the same still image\n * and breaks both — it is what order used to do, and why order was the one entry in\n * CHIP_BOX_KNOWN_BAD.\n *\n * min-width, not width, so a chip whose own text is wider than the widest measured chip still\n * fits. Defaults to 0 where nothing is measured (match, whose targets are cards, not slots), so\n * those chips keep their natural width with no rule needed to say so.\n *\n * --qti-drag-min-width, not --qti-dropzone-min-width: the mixin writes the same measured value to\n * both, so a chip and its slot still match, but the two need OPPOSITE defaults when nothing is\n * measured — a chip must stay at its natural width, while a drops-grid track must not collapse.\n * See the note on both names in qti-variables.css.\n */\n min-width: var(--qti-drag-min-width, 0);\n /* Paint via the contract, nothing more — the --qti-component-* tokens already make a neutral\n bordered box (white surface, theme border, no shadow). The chip sets NO --drag-* of its own,\n and that is load-bearing: if it did (e.g. `--drag-background-color: white`), that declaration\n would ride the interaction's HIGH-specificity chip selector\n (`qti-gap-match-interaction qti-gap::part(drag)`) and out-specify a brand overlay's bare\n `qti-gap::part(drag)`, so the brand could never win. With nothing set here, the overlay's\n --drag-* is the only declaration and wins with no specificity/layer contest. */\n background-color: var(--drag-background-color, var(--qti-component-background-color));\n background-image: var(--drag-background-image, var(--qti-component-background-image));\n border-width: var(--drag-border-width, var(--qti-component-border-width));\n border-style: var(--drag-border-style, var(--qti-component-border-style));\n border-color: var(--drag-border-color, var(--qti-component-border-color));\n border-radius: var(--drag-border-radius, var(--qti-component-border-radius));\n box-shadow: var(--drag-box-shadow, var(--qti-component-box-shadow));\n color: var(--drag-color, var(--qti-component-color));\n opacity: var(--drag-opacity, var(--qti-component-opacity));\n filter: var(--drag-filter, var(--qti-component-filter));\n &[dragging] {\n pointer-events: none;\n rotate: -2deg;\n --drag-box-shadow: 0 8px 12px rgb(0 0 0 / 20%), 0 4px 8px rgb(0 0 0 / 10%);\n }\n &:hover {\n @media (hover: hover) {\n background-color: color-mix(\n in srgb,\n var(--drag-background-color, var(--qti-component-background-color)) 92%,\n black\n );\n }\n }\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n }\n & qti-gap {\n background-color: var(--drop-background-color, var(--qti-component-background-color));\n background-image: var(--drop-background-image, var(--qti-component-background-image));\n border-width: var(--drop-border-width, var(--qti-component-border-width));\n border-style: var(--drop-border-style, var(--qti-component-border-style));\n border-color: var(--drop-border-color, var(--qti-component-border-color));\n border-radius: var(--drop-border-radius, var(--qti-component-border-radius));\n box-shadow: var(--drop-box-shadow, var(--qti-component-box-shadow));\n color: var(--drop-color, var(--qti-component-color));\n opacity: var(--drop-opacity, var(--qti-component-opacity));\n filter: var(--drop-filter, var(--qti-component-filter));\n border-style: var(--drop-border-style, dashed);\n\n /*\n * A filled gap hides its dashed edge, exactly as a filled order slot does\n * (qti-order-interaction.css, `::part(filled)`).\n *\n * The dashed edge says \"something goes here\". Once something does, it is only a second frame\n * drawn a pixel outside the chip's own border — two nested outlines around one word, which is\n * what the drop inset made visible: before it, the two borders sat on top of each other and\n * the duplication did not show.\n *\n * Transparent rather than `none`, and the width is untouched: `@mixin paint drop` binds\n * border-width and border-color to separate slots, so switching only the colour keeps the\n * gap's box identical empty or filled. `border-style: none` would collapse the width and move\n * every word on the line the instant a chip landed — the exact reflow qti-gap.styles.ts and\n * drag-drop.invariance.spec.ts exist to prevent.\n */\n &:state(filled):is(:not([match-max]), [match-max='1']) {\n --drop-border-color: transparent;\n }\n\n &[disabled] {\n cursor: not-allowed;\n /* `:not(:empty)` tested light-DOM children; the gap renders its chips into its own shadow\n root now, so it is always \"empty\" to a selector. `:state(filled)` is the occupancy hook. */\n &:state(filled) {\n cursor: default !important;\n }\n }\n &[enabled] {\n background-color: var(--qti-bg-active);\n }\n &[active] {\n background-color: var(--qti-bg-active);\n }\n /* The gap's own box — inline-flex, centred, baseline-aligned — is in qti-gap.styles.ts. */\n\n /*\n * A gap is the same size empty or filled.\n *\n * It used to be sized two different ways: empty, by a padded non-breaking space; filled,\n * by `padding: 0` and whatever the chip happened to be. So a gap resized the moment a chip\n * landed in it, and — worse — every *other* gap on the line reflowed with it. Now the\n * interaction publishes the widest and tallest chip as --qti-dropzone-min-*, and the gap\n * reserves exactly that on its slot (see qti-gap.styles.ts).\n *\n * The `&:empty::after { content: '\\0000a0' }` that used to hold an empty gap open is gone\n * with it: it sat *beside* the slot, so an empty gap was one non-breaking space wider than\n * the same gap once filled.\n */\n\n /*\n * No `flex: 1`. A chip is the same size wherever it lives — in the bank, mid-drag as a\n * clone, or dropped. Stretching it to its container's width made the drop the one place\n * where that stopped being true.\n *\n * The chip is in the gap's shadow root, so `> *` cannot select it and `::part(drag)` is the\n * only way in.\n */\n /* `flex: 0 0 auto` is dropRegion's, in qti-base — a drop hosts a chip, it never sizes one.\n The rotate reset and the outline are paint. */\n &::part(drag) {\n transform: rotate(0);\n /* Through the drag slot so a correction (which sets --drag-box-shadow) composes over it\n instead of this leaking onto a corrected chip. */\n --drag-box-shadow: 0 0 0 1px #e5e7eb;\n }\n }\n }\n\n /* The source and placed chip share one visual component. */\n qti-gap-match-interaction qti-gap-text:state(drag),\n qti-gap-match-interaction qti-gap::part(drag) {\n /* Structural — the load-bearing box, never state-switched (layout-invariance contract).\n box-sizing is deliberate: the clone is appended to document.body outside reset.css's\n @scope, so it inherits no border-box from anywhere else and this sets it. */\n box-sizing: border-box;\n padding: var(--qti-drag-padding);\n cursor: grab;\n /*\n * A chip is as wide as the drop it belongs in — the SAME token the drop reserves with.\n *\n * That one shared name is what makes a drag and its drop the same size without any arithmetic\n * relating them: the interaction measures the widest chip, publishes it once, and both the chip\n * and the slot read it. See DROP-SIZING.md.\n *\n * It applies in the bank as well as in the drop, which is the point: the chip already has the\n * width before it is dropped, so nothing changes size at the moment of landing. That keeps \"a chip\n * is the same chip wherever it lives\" true (drag-drop.invariance.spec.ts) and keeps the return\n * animation from ending in a snap. A `width: 100%` on the placed chip gives the same still image\n * and breaks both — it is what order used to do, and why order was the one entry in\n * CHIP_BOX_KNOWN_BAD.\n *\n * min-width, not width, so a chip whose own text is wider than the widest measured chip still\n * fits. Defaults to 0 where nothing is measured (match, whose targets are cards, not slots), so\n * those chips keep their natural width with no rule needed to say so.\n *\n * --qti-drag-min-width, not --qti-dropzone-min-width: the mixin writes the same measured value to\n * both, so a chip and its slot still match, but the two need OPPOSITE defaults when nothing is\n * measured — a chip must stay at its natural width, while a drops-grid track must not collapse.\n * See the note on both names in qti-variables.css.\n */\n min-width: var(--qti-drag-min-width, 0);\n /* Paint via the contract, nothing more — the --qti-component-* tokens already make a neutral\n bordered box (white surface, theme border, no shadow). The chip sets NO --drag-* of its own,\n and that is load-bearing: if it did (e.g. `--drag-background-color: white`), that declaration\n would ride the interaction's HIGH-specificity chip selector\n (`qti-gap-match-interaction qti-gap::part(drag)`) and out-specify a brand overlay's bare\n `qti-gap::part(drag)`, so the brand could never win. With nothing set here, the overlay's\n --drag-* is the only declaration and wins with no specificity/layer contest. */\n background-color: var(--drag-background-color, var(--qti-component-background-color));\n background-image: var(--drag-background-image, var(--qti-component-background-image));\n border-width: var(--drag-border-width, var(--qti-component-border-width));\n border-style: var(--drag-border-style, var(--qti-component-border-style));\n border-color: var(--drag-border-color, var(--qti-component-border-color));\n border-radius: var(--drag-border-radius, var(--qti-component-border-radius));\n box-shadow: var(--drag-box-shadow, var(--qti-component-box-shadow));\n color: var(--drag-color, var(--qti-component-color));\n opacity: var(--drag-opacity, var(--qti-component-opacity));\n filter: var(--drag-filter, var(--qti-component-filter));\n }\n}\n@layer qti-components.interactions.states {\n /* One chip vocabulary across the bank and placed drags for gap-match only. */\n qti-gap::part(drag) {\n /* Structural — the load-bearing box, never state-switched (layout-invariance contract).\n box-sizing is deliberate: the clone is appended to document.body outside reset.css's\n @scope, so it inherits no border-box from anywhere else and this sets it. */\n box-sizing: border-box;\n padding: var(--qti-drag-padding);\n cursor: grab;\n /*\n * A chip is as wide as the drop it belongs in — the SAME token the drop reserves with.\n *\n * That one shared name is what makes a drag and its drop the same size without any arithmetic\n * relating them: the interaction measures the widest chip, publishes it once, and both the chip\n * and the slot read it. See DROP-SIZING.md.\n *\n * It applies in the bank as well as in the drop, which is the point: the chip already has the\n * width before it is dropped, so nothing changes size at the moment of landing. That keeps \"a chip\n * is the same chip wherever it lives\" true (drag-drop.invariance.spec.ts) and keeps the return\n * animation from ending in a snap. A `width: 100%` on the placed chip gives the same still image\n * and breaks both — it is what order used to do, and why order was the one entry in\n * CHIP_BOX_KNOWN_BAD.\n *\n * min-width, not width, so a chip whose own text is wider than the widest measured chip still\n * fits. Defaults to 0 where nothing is measured (match, whose targets are cards, not slots), so\n * those chips keep their natural width with no rule needed to say so.\n *\n * --qti-drag-min-width, not --qti-dropzone-min-width: the mixin writes the same measured value to\n * both, so a chip and its slot still match, but the two need OPPOSITE defaults when nothing is\n * measured — a chip must stay at its natural width, while a drops-grid track must not collapse.\n * See the note on both names in qti-variables.css.\n */\n min-width: var(--qti-drag-min-width, 0);\n /* Paint via the contract, nothing more — the --qti-component-* tokens already make a neutral\n bordered box (white surface, theme border, no shadow). The chip sets NO --drag-* of its own,\n and that is load-bearing: if it did (e.g. `--drag-background-color: white`), that declaration\n would ride the interaction's HIGH-specificity chip selector\n (`qti-gap-match-interaction qti-gap::part(drag)`) and out-specify a brand overlay's bare\n `qti-gap::part(drag)`, so the brand could never win. With nothing set here, the overlay's\n --drag-* is the only declaration and wins with no specificity/layer contest. */\n background-color: var(--drag-background-color, var(--qti-component-background-color));\n background-image: var(--drag-background-image, var(--qti-component-background-image));\n border-width: var(--drag-border-width, var(--qti-component-border-width));\n border-style: var(--drag-border-style, var(--qti-component-border-style));\n border-color: var(--drag-border-color, var(--qti-component-border-color));\n border-radius: var(--drag-border-radius, var(--qti-component-border-radius));\n box-shadow: var(--drag-box-shadow, var(--qti-component-box-shadow));\n color: var(--drag-color, var(--qti-component-color));\n opacity: var(--drag-opacity, var(--qti-component-opacity));\n filter: var(--drag-filter, var(--qti-component-filter));\n }\n\n qti-gap-match-interaction qti-gap-text:state(placeholder) {\n /* The hole a spent/lifted chip leaves. Like the chip (see `drag`), it sets NO fill / border /\n shadow of its own — those inherit from the resting chip (neutral by default, the brand's fill\n when an overlay is on), so a brand can restyle the hole via a `:state(placeholder)` overlay\n with no specificity contest. The one thing a placeholder always does, in every brand, is hide\n its text; the default hole is then just the resting chip (white + border) with its text gone. */\n --drag-color: transparent;\n --drag-opacity: 1;\n pointer-events: none;\n }\n\n qti-gap-match-interaction qti-gap-text:state(dragging) {\n /* The hole a spent/lifted chip leaves. Like the chip (see `drag`), it sets NO fill / border /\n shadow of its own — those inherit from the resting chip (neutral by default, the brand's fill\n when an overlay is on), so a brand can restyle the hole via a `:state(placeholder)` overlay\n with no specificity contest. The one thing a placeholder always does, in every brand, is hide\n its text; the default hole is then just the resting chip (white + border) with its text gone. */\n --drag-color: transparent;\n --drag-opacity: 1;\n border-color: var(--qti-drop-highlight-border-color);\n box-shadow: inset 0 0 0 var(--qti-drop-highlight-border-width, 2px)\n color-mix(in srgb, var(--qti-drop-highlight-border-color) 55%, transparent);\n pointer-events: none;\n }\n\n qti-gap-match-interaction qti-gap-text:state(return-anchor) {\n border-color: var(--qti-drop-highlight-border-color);\n box-shadow: inset 0 0 0 var(--qti-drop-highlight-border-width, 2px)\n color-mix(in srgb, var(--qti-drop-highlight-border-color) 55%, transparent);\n }\n\n qti-gap-match-interaction qti-gap:state(hover),\n qti-gap-match-interaction qti-gap:state(active) {\n background-color: var(--qti-drop-highlight-bg);\n }\n\n qti-gap-match-interaction qti-gap:state(enabled) {\n background-color: var(--qti-drop-highlight-enabled-bg);\n }\n}\n@layer qti-components.interactions.corrections {\n /* A corrected chip — in the bank, and where it landed. Moved here from the shared\n qti-corrections.css, which claimed `:state(drag)` for EVERY interaction in one unscoped rule:\n the same shape the chip vocabulary had before it was sprayed, and moved for the same reason.\n `[data-drag-clone]:state(candidate-*)` went with it and is deliberately NOT reproduced — a clone\n carries no custom states at all, because cloneNode does not copy ElementInternals (measured), so\n that selector never matched anything. */\n /* The two `qti-gap-text:state(candidate-*) { --drag-background-color: var(--qti-correct) }` rules\n that used to sit here are gone, and were already dead: the shared rule declared `background-color`\n DIRECTLY, which outranks the paint binding that reads --drag-background-color, so the solid fill\n they asked for never rendered — a corrected gap-text has always been the pale tint. Left in place\n they would have come alive the moment the shared rule left, and turned solid. */\n qti-gap-match-interaction :state(drag):state(candidate-correct),\n qti-gap::part(drag):state(candidate-correct) {\n --drag-background-color: var(--qti-correct-light);\n --drag-color: var(--qti-correct);\n --drag-border-color: var(--qti-correct);\n --drag-box-shadow: none;\n }\n\n qti-gap-match-interaction :state(drag):state(candidate-incorrect),\n qti-gap::part(drag):state(candidate-incorrect) {\n --drag-background-color: var(--qti-incorrect-light);\n --drag-color: var(--qti-incorrect);\n --drag-border-color: var(--qti-incorrect);\n --drag-box-shadow: none;\n }\n\n /* The bank is hidden by the interaction itself, on :host([answer-key]) — see\n qti-gap-match-interaction.styles.ts. */\n}\n/*\n * A hotspot is indicated by a RING, not a fill — matching QTI 3's own figures (Impl-Guide Fig\n * 54/55) and its shared-vocab wording (\"selection lines and fills\", the line being the ring).\n *\n * The ring is drawn on the INSIDE of the shape, two ways, because the shapes are two kinds of box:\n *\n * circle / ellipse / rect an inset `box-shadow` — it follows `border-radius`, sits inside the\n * element edge, and never changes the footprint or the hit area.\n *\n * poly a `clip-path` box has no border-box edge for a shadow or border to\n * paint on, so the outline comes from an SVG stroke used as a `mask`,\n * published per-hotspot by positionShapes (hotspot.ts) as\n * --qti-shape-outline. clip-path stays ON (it is the click hit-area) and\n * the mask layers over it, so the stroke's outer half is clipped and a\n * clean inner-edge ring remains — the same inner edge the box shapes get.\n *\n * Colour and weight are one vocabulary across both:\n * --qti-hotspot-ring-color the ring colour. Unset by default (neutral); set by the selections\n * classes and the correction states below.\n * --qti-hotspot-ring-width resting stroke width; :state(checked) doubles it.\n * --qti-hotspot-halo a near-white outline either side of the ring, so it stays legible on\n * any photograph — the spec's \"suitable contrast against a background\".\n *\n * This replaces the previous fill treatment and the `@mixin spot` era entirely.\n */\n@layer qti-components.interactions.base {\n qti-hotspot-interaction qti-hotspot-choice {\n /* Resting: a faint neutral ring, so the regions are discoverable before any interaction. */\n --hs-ring: color-mix(in srgb, var(--qti-hotspot-ring-color, var(--qti-border-color)) 60%, transparent);\n --hs-width: var(--qti-hotspot-ring-width, 2px);\n --hs-halo: var(--qti-hotspot-halo, rgb(255 255 255 / 85%));\n\n background-color: transparent;\n cursor: pointer;\n transition:\n background-color 0.15s ease,\n box-shadow 0.15s ease;\n }\n\n /* Box shapes: the ring is an inset shadow, with a halo just inside it and 1px just outside. */\n qti-hotspot-interaction qti-hotspot-choice:not([shape='poly']) {\n box-shadow:\n inset 0 0 0 var(--hs-width) var(--hs-ring),\n inset 0 0 0 calc(var(--hs-width) + 1px) var(--hs-halo),\n 0 0 0 1px var(--hs-halo);\n }\n\n /*\n * Poly: the ring is the published outline, coloured by `background-color` and clipped to the\n * inside by the clip-path positionShapes leaves in place. The masked stroke has an alpha edge, so\n * its halo comes from `drop-shadow` tracing that edge — no second mask or pseudo-element, and it\n * follows the ring on both sides. (Box shapes can't do this: their ring is a box-shadow, so a\n * drop-shadow would trace the whole box, not the ring — hence the inset-shadow halo above.)\n */\n qti-hotspot-interaction qti-hotspot-choice[shape='poly'] {\n background-color: var(--hs-ring);\n mask: var(--qti-shape-outline) center / 100% 100% no-repeat;\n -webkit-mask: var(--qti-shape-outline) center / 100% 100% no-repeat;\n filter: drop-shadow(0 0 1px var(--hs-halo)) drop-shadow(0 0 1px var(--hs-halo));\n }\n\n /* Hover strengthens the resting ring rather than filling the shape. */\n qti-hotspot-interaction qti-hotspot-choice:hover {\n --hs-ring: color-mix(in srgb, var(--qti-hotspot-ring-color, var(--qti-border-active)) 90%, transparent);\n }\n\n qti-hotspot-interaction qti-hotspot-choice:focus-visible {\n outline: var(--qti-focus-border-width) solid var(--qti-focus-color);\n outline-offset: 2px;\n }\n}\n@layer qti-components.interactions.states {\n /*\n * Selected: a bold, saturated ring — the Fig-54 weight jump. Same var, so poly and box shapes\n * move together; poly additionally swaps to the bold outline mask.\n */\n qti-hotspot-interaction qti-hotspot-choice:state(checked) {\n --hs-ring: var(--qti-hotspot-ring-color, var(--qti-selected-bg));\n --hs-width: calc(var(--qti-hotspot-ring-width, 2px) * 2);\n }\n\n qti-hotspot-interaction qti-hotspot-choice[shape='poly']:state(checked) {\n mask-image: var(--qti-shape-outline-bold);\n -webkit-mask-image: var(--qti-shape-outline-bold);\n }\n\n /*\n * Selections theming — QTI 3 shared interaction vocabulary, Appendix B.1 / vocab \xa71.2.5.1.\n *\n * The image under a hotspot is one the theme has never seen, so the item author picks the\n * contrast. Per the spec, the class names describe the SELECTION colour:\n * qti-selections-light → a light selection, for a dark background image\n * qti-selections-dark → a dark selection, for a light background image\n * Both just set the one ring-colour var; the -border token is the line colour, matching how\n * graphic-gap-match already spends these tokens.\n */\n qti-hotspot-interaction.qti-selections-light qti-hotspot-choice {\n --qti-hotspot-ring-color: var(--qti-selections-light-border);\n }\n\n qti-hotspot-interaction.qti-selections-dark qti-hotspot-choice {\n --qti-hotspot-ring-color: var(--qti-selections-dark-border);\n }\n\n /*\n * qti-unselected-hidden — vocab \xa71.2.5.1: selections \"visually hidden until focused or selected\".\n *\n * Blank the ring and its halo while a hotspot is neither selected nor keyboard-focused. Both\n * halves matter: the picture reads cleanly, and a *focused* hotspot returns, which is the only\n * thing that keeps the interaction operable from a keyboard — drop `:not(:focus-visible)` and\n * tabbing through an item shows nothing.\n *\n * In `states` so it outranks the base ring and the `:hover` strengthen: hover must NOT reveal, or\n * sweeping the pointer hands back the answer regions one at a time.\n */\n qti-hotspot-interaction.qti-unselected-hidden qti-hotspot-choice:not(:state(checked)):not(:focus-visible) {\n --hs-ring: transparent;\n --hs-halo: transparent;\n }\n\n qti-hotspot-interaction qti-hotspot-choice:state(disabled),\n qti-hotspot-interaction qti-hotspot-choice:state(readonly) {\n cursor: not-allowed;\n pointer-events: none;\n }\n}\n@layer qti-components.interactions.corrections {\n /*\n * Correction and answer-key views recolour the same ring — one var, so circle and poly stay in\n * step. Answer-key first, so a candidate's own judgement wins when both are present.\n */\n qti-hotspot-interaction qti-hotspot-choice:state(correct-response) {\n --qti-hotspot-ring-color: var(--qti-answer-border);\n }\n\n qti-hotspot-interaction qti-hotspot-choice:state(candidate-correct) {\n --qti-hotspot-ring-color: var(--qti-correct);\n }\n\n qti-hotspot-interaction qti-hotspot-choice:state(candidate-incorrect) {\n --qti-hotspot-ring-color: var(--qti-incorrect);\n }\n\n .full-correct-response qti-hotspot-interaction qti-hotspot-choice:state(checked) {\n --qti-hotspot-ring-color: var(--qti-answer-border);\n }\n\n /*\n * A correction or answer-key ring reads at full strength and bold weight, whether or not the\n * candidate selected that hotspot — an unselected correct answer still needs to be seen. (A\n * candidate-* hotspot is usually also :state(checked) and would be bold anyway; correct-response\n * on an unselected region is the case this covers.)\n */\n qti-hotspot-interaction qti-hotspot-choice:state(correct-response),\n qti-hotspot-interaction qti-hotspot-choice:state(candidate-correct),\n qti-hotspot-interaction qti-hotspot-choice:state(candidate-incorrect),\n .full-correct-response qti-hotspot-interaction qti-hotspot-choice:state(checked) {\n --hs-ring: var(--qti-hotspot-ring-color);\n --hs-width: calc(var(--qti-hotspot-ring-width, 2px) * 2);\n }\n\n qti-hotspot-interaction qti-hotspot-choice[shape='poly']:state(correct-response),\n qti-hotspot-interaction qti-hotspot-choice[shape='poly']:state(candidate-correct),\n qti-hotspot-interaction qti-hotspot-choice[shape='poly']:state(candidate-incorrect),\n .full-correct-response qti-hotspot-interaction qti-hotspot-choice[shape='poly']:state(checked) {\n mask-image: var(--qti-shape-outline-bold);\n -webkit-mask-image: var(--qti-shape-outline-bold);\n }\n}\n@layer qti-components.interactions.base {\n qti-hottext-interaction {\n --qti-hottext-selected-padding: var(--qti-padding-inline);\n\n /* The native radio/checkbox control is never rendered for a hottext — every variant uses custom\n styling. That is unconditional, so it lives in qti-hottext.styles.ts, which hides [part='control']\n outright. It used to be repeated here three times, once per variant, under an unconditional rule\n that had already hidden it. */\n /*\n * The selected padding, reserved unselected.\n *\n * :state(checked) used to swap 'var(--qti-border-thickness) 0' for the padding above, so\n * clicking a word grew it and reflowed the sentence around it — every following word moved, and\n * on a wrapping line so did the paragraph. That is the 'checked' entry the .stylelintrc.mjs\n * comment describes.\n *\n * Reserving it here is the same move as the 'border: 2px solid transparent' that holds a drop\n * target's active border: pay the space once, up front, so the state has only to repaint. Every\n * hottext is now the size a selected one used to be, which is also a larger target to click.\n */\n qti-hottext {\n padding: var(--qti-hottext-selected-padding);\n }\n\n &.qti-input-control-hidden {\n qti-hottext {\n border: var(--qti-border);\n border-radius: var(--qti-border-radius);\n\n background: var(--qti-bg);\n\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n }\n }\n\n &.qti-unselected-hidden {\n qti-hottext {\n border: 0;\n border-radius: var(--qti-border-radius);\n background-color: transparent;\n outline: none;\n cursor: pointer;\n\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n }\n }\n\n &:not(.qti-input-control-hidden, .qti-unselected-hidden) {\n qti-hottext {\n border: var(--qti-border);\n border-radius: var(--qti-border-radius);\n\n\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n }\n }\n }\n}\n@layer qti-components.interactions.states {\n qti-hottext-interaction {\n &.qti-input-control-hidden qti-hottext {\n &:state(checked) {\n border-color: var(--qti-border-active);\n background-color: var(--qti-selected-bg);\n color: var(--qti-selected-color);\n }\n\n &:state(readonly) {\n cursor: pointer;\n }\n\n &:state(disabled) {\n cursor: not-allowed;\n }\n }\n\n &.qti-unselected-hidden qti-hottext,\n &:not(.qti-input-control-hidden, .qti-unselected-hidden) qti-hottext {\n &:state(checked) {\n background-color: var(--qti-selected-bg);\n color: var(--qti-selected-color);\n }\n\n &:state(readonly) {\n cursor: pointer;\n }\n\n &:state(disabled) {\n cursor: not-allowed;\n }\n }\n }\n}\n@layer qti-components.interactions.corrections {\n qti-hottext-interaction {\n qti-hottext {\n &:state(correct-response),\n &[data-correct-response='true'] {\n &::after {\n content: '\\02714';\n color: var(--qti-correct);\n }\n }\n }\n\n &.qti-input-control-hidden qti-hottext {\n &:state(candidate-correct) {\n background-color: var(--qti-correct-light);\n color: var(--qti-correct);\n border-color: var(--qti-correct);\n box-shadow: none;\n }\n\n &:state(candidate-incorrect) {\n background-color: var(--qti-incorrect-light);\n color: var(--qti-incorrect);\n border-color: var(--qti-incorrect);\n box-shadow: none;\n }\n }\n\n &.qti-unselected-hidden qti-hottext,\n &:not(.qti-input-control-hidden, .qti-unselected-hidden) qti-hottext {\n &:state(candidate-correct) {\n background-color: var(--qti-correct-light);\n color: var(--qti-correct);\n border-color: var(--qti-correct);\n box-shadow: none;\n box-shadow: inset 0 0 0 var(--qti-border-thickness) var(--qti-correct);\n }\n\n &:state(candidate-incorrect) {\n background-color: var(--qti-incorrect-light);\n color: var(--qti-incorrect);\n border-color: var(--qti-incorrect);\n box-shadow: none;\n box-shadow: inset 0 0 0 var(--qti-border-thickness) var(--qti-incorrect);\n }\n }\n }\n\n .full-correct-response qti-hottext-interaction.qti-input-control-hidden qti-hottext:state(checked),\n .full-correct-response qti-hottext-interaction.qti-unselected-hidden qti-hottext:state(checked),\n .full-correct-response\n qti-hottext-interaction:not(.qti-input-control-hidden, .qti-unselected-hidden)\n qti-hottext:state(checked) {\n background-color: var(--qti-answer-bg);\n color: var(--qti-answer-fg);\n border-color: var(--qti-answer-border);\n\n border-width: var(--qti-border-thickness);\n border-style: var(--qti-border-style);\n padding-inline-start: calc(1em + var(--qti-gap));\n padding-inline-end: var(--qti-gap);\n\n /* The icon must not become the inline-flex container's first baseline item. */\n &::before {\n content: '';\n background-color: var(--qti-answer-fg);\n mask: var(--qti-check-mask) no-repeat center / contain;\n -webkit-mask: var(--qti-check-mask) no-repeat center / contain;\n\n position: absolute;\n inset-inline-start: var(--qti-gap);\n top: 50%;\n translate: 0 -50%;\n display: block;\n width: 1em;\n height: 1em;\n }\n }\n}\n@layer qti-components.interactions.base {\n qti-inline-choice-interaction {\n /* ── Host: the closed combobox, painted through the paint contract so a brand can restyle the\n field the same way it restyles chips/buttons/text-fields. Its one field-specific default (fg\n text, rather than the contract's `inherit`) is set as --field-* so it stays overridable — and\n being the field's own slot, it no longer inherits into the menu and message below. Those two\n still land on the same colour: they inherit the field's computed `color`. */\n background-color: var(--field-background-color, var(--qti-component-background-color));\n background-image: var(--field-background-image, var(--qti-component-background-image));\n border-width: var(--field-border-width, var(--qti-component-border-width));\n border-style: var(--field-border-style, var(--qti-component-border-style));\n border-color: var(--field-border-color, var(--qti-component-border-color));\n border-radius: var(--field-border-radius, var(--qti-component-border-radius));\n box-shadow: var(--field-box-shadow, var(--qti-component-box-shadow));\n color: var(--field-color, var(--qti-component-color));\n opacity: var(--field-opacity, var(--qti-component-opacity));\n filter: var(--field-filter, var(--qti-component-filter));\n --field-color: var(--qti-fg);\n\n /* ── Trigger: transparent inside the field border ───────────────────────── */\n &::part(trigger) {\n padding: var(--qti-padding-box);\n background: transparent;\n border: none;\n border-radius: inherit;\n color: inherit;\n cursor: pointer;\n font-size: inherit;\n }\n\n &::part(trigger):focus-visible {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n outline: none;\n }\n\n &:state(disabled)::part(trigger),\n &[disabled]::part(trigger) {\n cursor: not-allowed;\n }\n\n &:state(readonly)::part(trigger),\n &[readonly]::part(trigger) {\n cursor: pointer;\n }\n\n /* ── Chevron icon: color only; transform/mask/size live in shadow DOM ────── */\n &::part(dropdown-icon) {\n color: inherit;\n }\n\n &::part(dropdown-icon-open) {\n color: inherit;\n }\n\n /* ── Popover menu: the neutral paint box (fill + border + radius all default). ── */\n /*\n * No padding of its own — the rows go edge to edge, and each row pays --qti-padding-box, the\n * SAME token the trigger pays.\n *\n * That is what makes the closed and the open control read as one thing: the selected value in\n * the trigger and the option rows beneath it now start on exactly the same vertical line\n * (measured: both 17px from the visible edge; before, the option text sat at 21px because the\n * menu added --qti-padding-inline on top of the row's own --qti-padding-box).\n *\n * It also fixes the disproportion: the highlighted row used to float with 5px beside it and 3px\n * above it. Two spacing tokens for one box is the whole bug — the vocabulary says pick one and\n * spend it whole (see the CONTRACT note on --qti-padding-box / -inline / --qti-gap).\n */\n &::part(menu) {\n background-color: var(--menu-background-color, var(--qti-component-background-color));\n background-image: var(--menu-background-image, var(--qti-component-background-image));\n border-width: var(--menu-border-width, var(--qti-component-border-width));\n border-style: var(--menu-border-style, var(--qti-component-border-style));\n border-color: var(--menu-border-color, var(--qti-component-border-color));\n border-radius: var(--menu-border-radius, var(--qti-component-border-radius));\n box-shadow: var(--menu-box-shadow, var(--qti-component-box-shadow));\n color: var(--menu-color, var(--qti-component-color));\n opacity: var(--menu-opacity, var(--qti-component-opacity));\n filter: var(--menu-filter, var(--qti-component-filter));\n padding: 0;\n }\n\n /*\n * Open, the trigger and the menu are one shape, so the edges that meet lose their rounding.\n *\n * Both boxes are rounded on all four corners at rest, and the sides already line up to the pixel\n * (measured: trigger and menu both 97.38 → 464.80, seam at 0.00). What read as \"not quite\n * meeting\" was purely the two curves pinching inward at the join, with the two borders stacked\n * between them.\n *\n * Paint only — border-radius changes nothing about where anything sits, so this is safe in a\n * state (CONTRACT.md \xa72: a state must not change layout metrics).\n *\n * The host is the box that carries the field's border; the trigger inside it is transparent with\n * `border-radius: inherit`, so squaring the host is what squares the visible bottom edge.\n *\n * Known limit: the menu may flip above the trigger when there is no room below\n * (`position-try-fallbacks: flip-block` in the shadow styles). These two rules assume it sits\n * below, so a flipped menu keeps its rounding at the join. There is no selector for \"which\n * position-try fallback applied\", so fixing that needs a signal from script, and it is not worth\n * one for the rarer case.\n */\n &:state(open) {\n border-end-start-radius: 0;\n border-end-end-radius: 0;\n }\n\n &::part(menu):popover-open {\n border-start-start-radius: 0;\n border-start-end-radius: 0;\n }\n\n /* ── Option rows ─────────────────────────────────────────────────────────── */\n &::part(option) {\n padding: var(--qti-padding-box);\n border: 0;\n /* Square, because a row now spans the full width of the menu. The menu's own radius still\n rounds the first and last row, since it clips them (overflow: auto). A radius here would\n only show as a notch inside a straight edge. */\n border-radius: 0;\n background: transparent;\n cursor: pointer;\n }\n\n &::part(option):focus-visible {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n outline: none;\n }\n\n &::part(option-selected) {\n background-color: var(--qti-bg-active);\n }\n\n /* ── Slotted qti-inline-choice elements (light DOM) ──────────────────────── */\n /* The option row's own box — flex, centred, single-line, clipped — is in\n qti-inline-choice.styles.ts. */\n & qti-inline-choice {\n width: 100%;\n box-sizing: border-box;\n padding: var(--qti-padding-box);\n border: 0;\n /* Square, for the same reason as ::part(option) above — these are the other half of the same\n list (the prompt row is a part, the authored choices are slotted), and they have to agree. */\n border-radius: 0;\n background: transparent;\n text-align: left;\n font: inherit;\n color: inherit;\n cursor: pointer;\n text-overflow: ellipsis;\n }\n\n & qti-inline-choice:focus-visible {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n outline: none;\n }\n\n & qti-inline-choice:state(checked) {\n background-color: var(--qti-bg-active);\n }\n\n /* ── Validation message: a warning box, painted through the contract. Its non-neutral bits\n (fg text, amber-tinted fill, amber border) are --message-* overrides; width/style/radius\n come from the defaults. ── */\n &::part(message) {\n background-color: var(--message-background-color, var(--qti-component-background-color));\n background-image: var(--message-background-image, var(--qti-component-background-image));\n border-width: var(--message-border-width, var(--qti-component-border-width));\n border-style: var(--message-border-style, var(--qti-component-border-style));\n border-color: var(--message-border-color, var(--qti-component-border-color));\n border-radius: var(--message-border-radius, var(--qti-component-border-radius));\n box-shadow: var(--message-box-shadow, var(--qti-component-box-shadow));\n color: var(--message-color, var(--qti-component-color));\n opacity: var(--message-opacity, var(--qti-component-opacity));\n filter: var(--message-filter, var(--qti-component-filter));\n --message-color: var(--qti-fg);\n --message-background-color: color-mix(in srgb, var(--qti-warning) 5%, white);\n --message-border-color: var(--qti-warning);\n padding: var(--qti-padding-box);\n }\n }\n}\n@layer qti-components.interactions.corrections {\n /* The answer key, moved here from the shared qti-corrections.css: it names this interaction, so\n this file owns it. */\n .full-correct-response qti-inline-choice-interaction {\n background-color: var(--qti-answer-bg);\n color: var(--qti-answer-fg);\n border-color: var(--qti-answer-border);\n\n &::part(value) {\n color: var(--qti-answer-fg);\n }\n }\n\n qti-inline-choice-interaction {\n &:state(candidate-correct) {\n --field-background-color: var(--qti-correct-light);\n --field-color: var(--qti-correct);\n --field-border-color: var(--qti-correct);\n --field-box-shadow: none;\n\n &::part(trigger) {\n background: transparent;\n }\n }\n\n &:state(candidate-incorrect) {\n --field-background-color: var(--qti-incorrect-light);\n --field-color: var(--qti-incorrect);\n --field-border-color: var(--qti-incorrect);\n --field-box-shadow: none;\n\n &::part(trigger) {\n background: transparent;\n }\n }\n }\n}\n/* This interaction's chip vocabulary — the bank chip, the placed chip, and the floating clone. One\n such block per drag-drop interaction, opt-in; graphic-gap-match deliberately declares none. See\n qti-states.css. Kept in the `global` layer, where these rules used to live, so cascade position is\n unchanged.\n\n The clone is matched by [data-drag-interaction] rather than by ancestry because it is a SIBLING of\n the interaction, not a descendant: createDragClone appends it to the interaction's ROOT (the\n item's shadow root), which is the same tree — so the theme can reach it — but not the same\n subtree. The attribute is also what tells one interaction's chip in flight from another's, which\n is how graphic-gap-match stays out without anyone writing an exclusion.\n\n Its grip hangs off ::part(control)::before, the same place the resting chip's does, so a chip does\n not move its handle when you pick it up. That the part is reachable at all is new: while the clone\n sat on document.body it was in a different tree from the adopted stylesheet, and nothing — no\n part, no attribute — could style it. */\n@layer qti-components.global {\n qti-match-interaction :state(drag),\n [data-drag-clone][data-drag-interaction='qti-match-interaction'] {\n /* Structural — the load-bearing box, never state-switched (layout-invariance contract).\n box-sizing is deliberate: the clone is appended to document.body outside reset.css's\n @scope, so it inherits no border-box from anywhere else and this sets it. */\n box-sizing: border-box;\n padding: var(--qti-drag-padding);\n cursor: grab;\n /*\n * A chip is as wide as the drop it belongs in — the SAME token the drop reserves with.\n *\n * That one shared name is what makes a drag and its drop the same size without any arithmetic\n * relating them: the interaction measures the widest chip, publishes it once, and both the chip\n * and the slot read it. See DROP-SIZING.md.\n *\n * It applies in the bank as well as in the drop, which is the point: the chip already has the\n * width before it is dropped, so nothing changes size at the moment of landing. That keeps \"a chip\n * is the same chip wherever it lives\" true (drag-drop.invariance.spec.ts) and keeps the return\n * animation from ending in a snap. A `width: 100%` on the placed chip gives the same still image\n * and breaks both — it is what order used to do, and why order was the one entry in\n * CHIP_BOX_KNOWN_BAD.\n *\n * min-width, not width, so a chip whose own text is wider than the widest measured chip still\n * fits. Defaults to 0 where nothing is measured (match, whose targets are cards, not slots), so\n * those chips keep their natural width with no rule needed to say so.\n *\n * --qti-drag-min-width, not --qti-dropzone-min-width: the mixin writes the same measured value to\n * both, so a chip and its slot still match, but the two need OPPOSITE defaults when nothing is\n * measured — a chip must stay at its natural width, while a drops-grid track must not collapse.\n * See the note on both names in qti-variables.css.\n */\n min-width: var(--qti-drag-min-width, 0);\n /* Paint via the contract, nothing more — the --qti-component-* tokens already make a neutral\n bordered box (white surface, theme border, no shadow). The chip sets NO --drag-* of its own,\n and that is load-bearing: if it did (e.g. `--drag-background-color: white`), that declaration\n would ride the interaction's HIGH-specificity chip selector\n (`qti-gap-match-interaction qti-gap::part(drag)`) and out-specify a brand overlay's bare\n `qti-gap::part(drag)`, so the brand could never win. With nothing set here, the overlay's\n --drag-* is the only declaration and wins with no specificity/layer contest. */\n background-color: var(--drag-background-color, var(--qti-component-background-color));\n background-image: var(--drag-background-image, var(--qti-component-background-image));\n border-width: var(--drag-border-width, var(--qti-component-border-width));\n border-style: var(--drag-border-style, var(--qti-component-border-style));\n border-color: var(--drag-border-color, var(--qti-component-border-color));\n border-radius: var(--drag-border-radius, var(--qti-component-border-radius));\n box-shadow: var(--drag-box-shadow, var(--qti-component-box-shadow));\n color: var(--drag-color, var(--qti-component-color));\n opacity: var(--drag-opacity, var(--qti-component-opacity));\n filter: var(--drag-filter, var(--qti-component-filter));\n }\n\n qti-match-interaction :state(drag)::part(control)::before,\n qti-match-interaction::part(drag-control)::before,\n qti-match-interaction ::part(drag-control)::before,\n [data-drag-clone][data-drag-interaction='qti-match-interaction']::part(control)::before {\n content: '';\n display: inline-block;\n vertical-align: middle;\n width: 0.75em;\n height: 1em;\n margin-right: var(--qti-glyph-gap);\n background-color: currentColor;\n mask: var(--qti-grip-mask) no-repeat center / contain;\n -webkit-mask: var(--qti-grip-mask) no-repeat center / contain;\n }\n}\n@layer qti-components.interactions.base {\n /* Editor fake-drag projected into the target choice's `drop` shadow.\n Reuses the same `drag` styling so the editor preview matches what students\n see when an answer is dropped onto a target at runtime. */\n qti-simple-associable-choice::part(drag) {\n /* Structural — the load-bearing box, never state-switched (layout-invariance contract).\n box-sizing is deliberate: the clone is appended to document.body outside reset.css's\n @scope, so it inherits no border-box from anywhere else and this sets it. */\n box-sizing: border-box;\n padding: var(--qti-drag-padding);\n cursor: grab;\n /*\n * A chip is as wide as the drop it belongs in — the SAME token the drop reserves with.\n *\n * That one shared name is what makes a drag and its drop the same size without any arithmetic\n * relating them: the interaction measures the widest chip, publishes it once, and both the chip\n * and the slot read it. See DROP-SIZING.md.\n *\n * It applies in the bank as well as in the drop, which is the point: the chip already has the\n * width before it is dropped, so nothing changes size at the moment of landing. That keeps \"a chip\n * is the same chip wherever it lives\" true (drag-drop.invariance.spec.ts) and keeps the return\n * animation from ending in a snap. A `width: 100%` on the placed chip gives the same still image\n * and breaks both — it is what order used to do, and why order was the one entry in\n * CHIP_BOX_KNOWN_BAD.\n *\n * min-width, not width, so a chip whose own text is wider than the widest measured chip still\n * fits. Defaults to 0 where nothing is measured (match, whose targets are cards, not slots), so\n * those chips keep their natural width with no rule needed to say so.\n *\n * --qti-drag-min-width, not --qti-dropzone-min-width: the mixin writes the same measured value to\n * both, so a chip and its slot still match, but the two need OPPOSITE defaults when nothing is\n * measured — a chip must stay at its natural width, while a drops-grid track must not collapse.\n * See the note on both names in qti-variables.css.\n */\n min-width: var(--qti-drag-min-width, 0);\n /* Paint via the contract, nothing more — the --qti-component-* tokens already make a neutral\n bordered box (white surface, theme border, no shadow). The chip sets NO --drag-* of its own,\n and that is load-bearing: if it did (e.g. `--drag-background-color: white`), that declaration\n would ride the interaction's HIGH-specificity chip selector\n (`qti-gap-match-interaction qti-gap::part(drag)`) and out-specify a brand overlay's bare\n `qti-gap::part(drag)`, so the brand could never win. With nothing set here, the overlay's\n --drag-* is the only declaration and wins with no specificity/layer contest. */\n background-color: var(--drag-background-color, var(--qti-component-background-color));\n background-image: var(--drag-background-image, var(--qti-component-background-image));\n border-width: var(--drag-border-width, var(--qti-component-border-width));\n border-style: var(--drag-border-style, var(--qti-component-border-style));\n border-color: var(--drag-border-color, var(--qti-component-border-color));\n border-radius: var(--drag-border-radius, var(--qti-component-border-radius));\n box-shadow: var(--drag-box-shadow, var(--qti-component-box-shadow));\n color: var(--drag-color, var(--qti-component-color));\n opacity: var(--drag-opacity, var(--qti-component-opacity));\n filter: var(--drag-filter, var(--qti-component-filter));\n &:hover {\n @media (hover: hover) {\n background-color: color-mix(\n in srgb,\n var(--drag-background-color, var(--qti-component-background-color)) 92%,\n black\n );\n }\n }\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n }\n\n qti-match-interaction:not(.qti-match-tabular) {\n /*\n * The drag bank does not light up while you drag.\n *\n * `:state(dragzone-enabled)` filled it, `:state(dragzone-active)` drew a solid\n * `--qti-border-active` box around it, and both fired the instant a chip was picked up — so\n * lifting a chip framed the container the chip had just left. The one thing worth looking at is\n * the hole, and the chip paints that itself via `:state(dragging)` / `:state(placeholder)`.\n *\n * `border: 2px solid transparent` went with them. It was reserving space for the active border,\n * so that a transient state could repaint without resizing. With nothing left to repaint, it is\n * 4px of nothing.\n */\n /* Non-tabular match wants an inline label, so a chip hugs its text. Handed to\n qti-simple-associable-choice.styles.ts, which owns its own box; this used to be an\n `::part(label) { display: inline !important }` further down the file. */\n --qti-choice-label-display: inline;\n\n /* The bank and the target grid are laid out in qti-match-interaction.styles.ts. Only the gaps\n are still set here — gap is spacing. */\n & qti-simple-match-set:first-of-type {\n gap: var(--qti-gap);\n & qti-simple-associable-choice {\n /* Structural — the load-bearing box, never state-switched (layout-invariance contract).\n box-sizing is deliberate: the clone is appended to document.body outside reset.css's\n @scope, so it inherits no border-box from anywhere else and this sets it. */\n box-sizing: border-box;\n padding: var(--qti-drag-padding);\n cursor: grab;\n /*\n * A chip is as wide as the drop it belongs in — the SAME token the drop reserves with.\n *\n * That one shared name is what makes a drag and its drop the same size without any arithmetic\n * relating them: the interaction measures the widest chip, publishes it once, and both the chip\n * and the slot read it. See DROP-SIZING.md.\n *\n * It applies in the bank as well as in the drop, which is the point: the chip already has the\n * width before it is dropped, so nothing changes size at the moment of landing. That keeps \"a chip\n * is the same chip wherever it lives\" true (drag-drop.invariance.spec.ts) and keeps the return\n * animation from ending in a snap. A `width: 100%` on the placed chip gives the same still image\n * and breaks both — it is what order used to do, and why order was the one entry in\n * CHIP_BOX_KNOWN_BAD.\n *\n * min-width, not width, so a chip whose own text is wider than the widest measured chip still\n * fits. Defaults to 0 where nothing is measured (match, whose targets are cards, not slots), so\n * those chips keep their natural width with no rule needed to say so.\n *\n * --qti-drag-min-width, not --qti-dropzone-min-width: the mixin writes the same measured value to\n * both, so a chip and its slot still match, but the two need OPPOSITE defaults when nothing is\n * measured — a chip must stay at its natural width, while a drops-grid track must not collapse.\n * See the note on both names in qti-variables.css.\n */\n min-width: var(--qti-drag-min-width, 0);\n /* Paint via the contract, nothing more — the --qti-component-* tokens already make a neutral\n bordered box (white surface, theme border, no shadow). The chip sets NO --drag-* of its own,\n and that is load-bearing: if it did (e.g. `--drag-background-color: white`), that declaration\n would ride the interaction's HIGH-specificity chip selector\n (`qti-gap-match-interaction qti-gap::part(drag)`) and out-specify a brand overlay's bare\n `qti-gap::part(drag)`, so the brand could never win. With nothing set here, the overlay's\n --drag-* is the only declaration and wins with no specificity/layer contest. */\n background-color: var(--drag-background-color, var(--qti-component-background-color));\n background-image: var(--drag-background-image, var(--qti-component-background-image));\n border-width: var(--drag-border-width, var(--qti-component-border-width));\n border-style: var(--drag-border-style, var(--qti-component-border-style));\n border-color: var(--drag-border-color, var(--qti-component-border-color));\n border-radius: var(--drag-border-radius, var(--qti-component-border-radius));\n box-shadow: var(--drag-box-shadow, var(--qti-component-box-shadow));\n color: var(--drag-color, var(--qti-component-color));\n opacity: var(--drag-opacity, var(--qti-component-opacity));\n filter: var(--drag-filter, var(--qti-component-filter));\n &[dragging] {\n pointer-events: none;\n rotate: -2deg;\n --drag-box-shadow: 0 8px 12px rgb(0 0 0 / 20%), 0 4px 8px rgb(0 0 0 / 10%);\n }\n &:hover {\n @media (hover: hover) {\n background-color: color-mix(\n in srgb,\n var(--drag-background-color, var(--qti-component-background-color)) 92%,\n black\n );\n }\n }\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n }\n }\n & qti-simple-match-set:last-of-type {\n gap: var(--qti-gap);\n & > qti-simple-associable-choice {\n & img {\n max-width: 100%;\n height: auto;\n }\n &[disabled] {\n &::part(drop) {\n cursor: not-allowed;\n }\n }\n /*\n * No `[active]` highlight. Lifting a chip used to draw a solid `--qti-border-active` border\n * around every drop container at once, which says \"any of these\" — the least useful thing to\n * say. What the candidate wants to see is the hole the chip left, and that is painted on the\n * chip's own `:state(dragging)` / `:state(placeholder)`.\n */\n &::part(drop) {\n background-color: var(--drop-background-color, var(--qti-component-background-color));\n background-image: var(--drop-background-image, var(--qti-component-background-image));\n border-width: var(--drop-border-width, var(--qti-component-border-width));\n border-style: var(--drop-border-style, var(--qti-component-border-style));\n border-color: var(--drop-border-color, var(--qti-component-border-color));\n border-radius: var(--drop-border-radius, var(--qti-component-border-radius));\n box-shadow: var(--drop-box-shadow, var(--qti-component-box-shadow));\n color: var(--drop-color, var(--qti-component-color));\n opacity: var(--drop-opacity, var(--qti-component-opacity));\n filter: var(--drop-filter, var(--qti-component-filter));\n border-style: var(--drop-border-style, dashed);\n /* No `@mixin dragging` on the drop. It is a chip-in-flight look (rotate, pointer-events:\n none, elevation) that never belonged on a drop. Per the comment above, a drop shows\n nothing while a drag is in flight; the hole is painted on the chip. (Its elevation also\n used to LEAK: `dragging` sets --component-box-shadow, one shared namespace, so it\n inherited onto every chip nested in the drop. That half is now structural — `dragging`\n sets --drag-box-shadow, which a drop does not read.) */\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n margin-top: var(--qti-gap);\n gap: var(--qti-gap);\n }\n & > *:not(qti-simple-associable-choice) {\n pointer-events: none;\n }\n /* A chip nested in a drop target renders no drop region of its own. That is the component's\n own rule — qti-simple-associable-choice.styles.ts hides [part~='drop'] for both\n :host(:state(drag)) and :host([part~='drag']), which covers the placed clone this\n selector could not reach. */\n & > qti-simple-associable-choice {\n /* Structural — the load-bearing box, never state-switched (layout-invariance contract).\n box-sizing is deliberate: the clone is appended to document.body outside reset.css's\n @scope, so it inherits no border-box from anywhere else and this sets it. */\n box-sizing: border-box;\n padding: var(--qti-drag-padding);\n cursor: grab;\n /*\n * A chip is as wide as the drop it belongs in — the SAME token the drop reserves with.\n *\n * That one shared name is what makes a drag and its drop the same size without any arithmetic\n * relating them: the interaction measures the widest chip, publishes it once, and both the chip\n * and the slot read it. See DROP-SIZING.md.\n *\n * It applies in the bank as well as in the drop, which is the point: the chip already has the\n * width before it is dropped, so nothing changes size at the moment of landing. That keeps \"a chip\n * is the same chip wherever it lives\" true (drag-drop.invariance.spec.ts) and keeps the return\n * animation from ending in a snap. A `width: 100%` on the placed chip gives the same still image\n * and breaks both — it is what order used to do, and why order was the one entry in\n * CHIP_BOX_KNOWN_BAD.\n *\n * min-width, not width, so a chip whose own text is wider than the widest measured chip still\n * fits. Defaults to 0 where nothing is measured (match, whose targets are cards, not slots), so\n * those chips keep their natural width with no rule needed to say so.\n *\n * --qti-drag-min-width, not --qti-dropzone-min-width: the mixin writes the same measured value to\n * both, so a chip and its slot still match, but the two need OPPOSITE defaults when nothing is\n * measured — a chip must stay at its natural width, while a drops-grid track must not collapse.\n * See the note on both names in qti-variables.css.\n */\n min-width: var(--qti-drag-min-width, 0);\n /* Paint via the contract, nothing more — the --qti-component-* tokens already make a neutral\n bordered box (white surface, theme border, no shadow). The chip sets NO --drag-* of its own,\n and that is load-bearing: if it did (e.g. `--drag-background-color: white`), that declaration\n would ride the interaction's HIGH-specificity chip selector\n (`qti-gap-match-interaction qti-gap::part(drag)`) and out-specify a brand overlay's bare\n `qti-gap::part(drag)`, so the brand could never win. With nothing set here, the overlay's\n --drag-* is the only declaration and wins with no specificity/layer contest. */\n background-color: var(--drag-background-color, var(--qti-component-background-color));\n background-image: var(--drag-background-image, var(--qti-component-background-image));\n border-width: var(--drag-border-width, var(--qti-component-border-width));\n border-style: var(--drag-border-style, var(--qti-component-border-style));\n border-color: var(--drag-border-color, var(--qti-component-border-color));\n border-radius: var(--drag-border-radius, var(--qti-component-border-radius));\n box-shadow: var(--drag-box-shadow, var(--qti-component-box-shadow));\n color: var(--drag-color, var(--qti-component-color));\n opacity: var(--drag-opacity, var(--qti-component-opacity));\n filter: var(--drag-filter, var(--qti-component-filter));\n &:hover {\n @media (hover: hover) {\n background-color: color-mix(\n in srgb,\n var(--drag-background-color, var(--qti-component-background-color)) 92%,\n black\n );\n }\n }\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n }\n }\n }\n }\n\n qti-match-interaction:not(.qti-match-tabular)\n qti-simple-match-set:first-of-type\n qti-simple-associable-choice:state(drag),\n qti-match-interaction:not(.qti-match-tabular) qti-simple-associable-choice::part(drag) {\n /* Structural — the load-bearing box, never state-switched (layout-invariance contract).\n box-sizing is deliberate: the clone is appended to document.body outside reset.css's\n @scope, so it inherits no border-box from anywhere else and this sets it. */\n box-sizing: border-box;\n padding: var(--qti-drag-padding);\n cursor: grab;\n /*\n * A chip is as wide as the drop it belongs in — the SAME token the drop reserves with.\n *\n * That one shared name is what makes a drag and its drop the same size without any arithmetic\n * relating them: the interaction measures the widest chip, publishes it once, and both the chip\n * and the slot read it. See DROP-SIZING.md.\n *\n * It applies in the bank as well as in the drop, which is the point: the chip already has the\n * width before it is dropped, so nothing changes size at the moment of landing. That keeps \"a chip\n * is the same chip wherever it lives\" true (drag-drop.invariance.spec.ts) and keeps the return\n * animation from ending in a snap. A `width: 100%` on the placed chip gives the same still image\n * and breaks both — it is what order used to do, and why order was the one entry in\n * CHIP_BOX_KNOWN_BAD.\n *\n * min-width, not width, so a chip whose own text is wider than the widest measured chip still\n * fits. Defaults to 0 where nothing is measured (match, whose targets are cards, not slots), so\n * those chips keep their natural width with no rule needed to say so.\n *\n * --qti-drag-min-width, not --qti-dropzone-min-width: the mixin writes the same measured value to\n * both, so a chip and its slot still match, but the two need OPPOSITE defaults when nothing is\n * measured — a chip must stay at its natural width, while a drops-grid track must not collapse.\n * See the note on both names in qti-variables.css.\n */\n min-width: var(--qti-drag-min-width, 0);\n /* Paint via the contract, nothing more — the --qti-component-* tokens already make a neutral\n bordered box (white surface, theme border, no shadow). The chip sets NO --drag-* of its own,\n and that is load-bearing: if it did (e.g. `--drag-background-color: white`), that declaration\n would ride the interaction's HIGH-specificity chip selector\n (`qti-gap-match-interaction qti-gap::part(drag)`) and out-specify a brand overlay's bare\n `qti-gap::part(drag)`, so the brand could never win. With nothing set here, the overlay's\n --drag-* is the only declaration and wins with no specificity/layer contest. */\n background-color: var(--drag-background-color, var(--qti-component-background-color));\n background-image: var(--drag-background-image, var(--qti-component-background-image));\n border-width: var(--drag-border-width, var(--qti-component-border-width));\n border-style: var(--drag-border-style, var(--qti-component-border-style));\n border-color: var(--drag-border-color, var(--qti-component-border-color));\n border-radius: var(--drag-border-radius, var(--qti-component-border-radius));\n box-shadow: var(--drag-box-shadow, var(--qti-component-box-shadow));\n color: var(--drag-color, var(--qti-component-color));\n opacity: var(--drag-opacity, var(--qti-component-opacity));\n filter: var(--drag-filter, var(--qti-component-filter));\n }\n\n qti-match-interaction:not(.qti-match-tabular) qti-simple-match-set:last-of-type > qti-simple-associable-choice {\n /* The label's `align-content` and the drop's `flex-grow` are the target card's own box, and live\n in qti-simple-associable-choice.styles.ts under :host(:state(droppable)). `box-sizing` went with\n them: border-box is already the reset, and content-box is what dropRegion sets. */\n &::part(label) {\n border: var(--qti-border);\n border-top-left-radius: var(--qti-border-radius);\n border-top-right-radius: var(--qti-border-radius);\n padding: 0.5rem;\n }\n\n &::part(drop) {\n margin-top: 0;\n border-top: none;\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n background: none;\n }\n\n }\n}\n@layer qti-components.interactions.states {\n qti-match-interaction:not(.qti-match-tabular)\n qti-simple-match-set:first-of-type\n qti-simple-associable-choice:state(dragging),\n qti-match-interaction:not(.qti-match-tabular)\n qti-simple-match-set:first-of-type\n qti-simple-associable-choice:state(placeholder) {\n /* The hole a spent/lifted chip leaves. Like the chip (see `drag`), it sets NO fill / border /\n shadow of its own — those inherit from the resting chip (neutral by default, the brand's fill\n when an overlay is on), so a brand can restyle the hole via a `:state(placeholder)` overlay\n with no specificity contest. The one thing a placeholder always does, in every brand, is hide\n its text; the default hole is then just the resting chip (white + border) with its text gone. */\n --drag-color: transparent;\n --drag-opacity: 1;\n pointer-events: none;\n }\n\n qti-match-interaction:not(.qti-match-tabular)\n qti-simple-match-set:first-of-type\n qti-simple-associable-choice:state(dragging)\n > *,\n qti-match-interaction:not(.qti-match-tabular)\n qti-simple-match-set:first-of-type\n qti-simple-associable-choice:state(placeholder)\n > * {\n visibility: hidden;\n }\n\n qti-match-interaction:not(.qti-match-tabular)\n qti-simple-match-set:first-of-type\n qti-simple-associable-choice:state(dragging)::part(label),\n qti-match-interaction:not(.qti-match-tabular)\n qti-simple-match-set:first-of-type\n qti-simple-associable-choice:state(placeholder)::part(label) {\n visibility: hidden;\n }\n\n qti-match-interaction:not(.qti-match-tabular)\n qti-simple-match-set:last-of-type\n > qti-simple-associable-choice:state(hover)::part(drop),\n qti-match-interaction:not(.qti-match-tabular)\n qti-simple-match-set:last-of-type\n > qti-simple-associable-choice:state(active)::part(drop) {\n background-color: var(--qti-drop-highlight-bg);\n }\n\n qti-match-interaction:not(.qti-match-tabular)\n qti-simple-match-set:last-of-type\n > qti-simple-associable-choice:state(enabled)::part(drop) {\n background-color: var(--qti-drop-highlight-enabled-bg);\n }\n\n qti-match-interaction:not(.qti-match-tabular)\n qti-simple-match-set:first-of-type\n qti-simple-associable-choice:state(dragging) {\n border-color: var(--qti-drop-highlight-border-color);\n box-shadow: inset 0 0 0 var(--qti-drop-highlight-border-width, 2px)\n color-mix(in srgb, var(--qti-drop-highlight-border-color) 55%, transparent);\n }\n\n qti-match-interaction:not(.qti-match-tabular)\n qti-simple-match-set:first-of-type\n qti-simple-associable-choice:state(return-anchor) {\n border-color: var(--qti-drop-highlight-border-color);\n box-shadow: inset 0 0 0 var(--qti-drop-highlight-border-width, 2px)\n color-mix(in srgb, var(--qti-drop-highlight-border-color) 55%, transparent);\n }\n}\n@layer qti-components.interactions.corrections {\n /* A corrected chip — in the bank, and where it landed. Moved here from the shared\n qti-corrections.css, which claimed `:state(drag)` for EVERY interaction in one unscoped rule:\n the same shape the chip vocabulary had before it was sprayed, and moved for the same reason.\n `[data-drag-clone]:state(candidate-*)` went with it and is deliberately NOT reproduced — a clone\n carries no custom states at all, because cloneNode does not copy ElementInternals (measured), so\n that selector never matched anything. */\n /* Two rules setting `--drag-background-color` on the placed chip are gone from here, dead for the\n same reason as gap-match's: the shared rule's DIRECT `background-color` outranked the binding\n that reads them, so their solid fill never rendered. They out-specify this block, so leaving them\n would have flipped a corrected placed chip from the pale tint to solid. */\n qti-match-interaction:not(.qti-match-tabular) :state(drag):state(candidate-correct),\n qti-match-interaction:not(.qti-match-tabular) qti-simple-associable-choice::part(drag):state(candidate-correct) {\n --drag-background-color: var(--qti-correct-light);\n --drag-color: var(--qti-correct);\n --drag-border-color: var(--qti-correct);\n --drag-box-shadow: none;\n }\n\n qti-match-interaction:not(.qti-match-tabular) :state(drag):state(candidate-incorrect),\n qti-match-interaction:not(.qti-match-tabular) qti-simple-associable-choice::part(drag):state(candidate-incorrect) {\n --drag-background-color: var(--qti-incorrect-light);\n --drag-color: var(--qti-incorrect);\n --drag-border-color: var(--qti-incorrect);\n --drag-box-shadow: none;\n }\n\n /* The bank is hidden by the interaction itself, on :host([answer-key]) — see\n qti-match-interaction.styles.ts. */\n}\n@layer qti-components.interactions.base {\n qti-match-interaction.qti-match-tabular {\n &::part(corner) {\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n background-color: var(--qti-bg-active);\n }\n\n &::part(input-cell) {\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n padding: var(--qti-padding-box);\n transition: background-color 0.1s ease;\n }\n &::part(input-cell):hover {\n background-color: var(--qti-bg-active);\n }\n\n /* Indicator parts mirror qti-choice-interaction / qti-hottext-interaction: `control` is the\n outer box, `control-mark` the inner indicator.\n\n The cells are plain spans in this interaction's shadow root, so they have no\n ElementInternals and cannot carry `:state()` — and `::part(x):state(y)` needs the state on\n the part's own element. They therefore carry variant *part tokens*, which deliberately\n reuse the state vocabulary: radio | checkbox, checked, correct | incorrect. */\n &::part(control radio) {\n background-color: var(--radio-background-color, var(--qti-component-background-color));\n background-image: var(--radio-background-image, var(--qti-component-background-image));\n border-width: var(--radio-border-width, var(--qti-component-border-width));\n border-style: var(--radio-border-style, var(--qti-component-border-style));\n border-color: var(--radio-border-color, var(--qti-component-border-color));\n border-radius: var(--radio-border-radius, var(--qti-component-border-radius));\n box-shadow: var(--radio-box-shadow, var(--qti-component-box-shadow));\n color: var(--radio-color, var(--qti-component-color));\n opacity: var(--radio-opacity, var(--qti-component-opacity));\n filter: var(--radio-filter, var(--qti-component-filter));\n width: var(--qti-control-size);\n height: var(--qti-control-size);\n /* Round. Re-declared with the slot in FRONT of the default, the same shape as the drop's dashed\n edge, so a brand can square a radio off without having to out-specify this rule. */\n border-radius: var(--radio-border-radius, 100%);\n }\n &::part(control checkbox) {\n background-color: var(--checkbox-background-color, var(--qti-component-background-color));\n background-image: var(--checkbox-background-image, var(--qti-component-background-image));\n border-width: var(--checkbox-border-width, var(--qti-component-border-width));\n border-style: var(--checkbox-border-style, var(--qti-component-border-style));\n border-color: var(--checkbox-border-color, var(--qti-component-border-color));\n border-radius: var(--checkbox-border-radius, var(--qti-component-border-radius));\n box-shadow: var(--checkbox-box-shadow, var(--qti-component-box-shadow));\n color: var(--checkbox-color, var(--qti-component-color));\n opacity: var(--checkbox-opacity, var(--qti-component-opacity));\n filter: var(--checkbox-filter, var(--qti-component-filter));\n width: var(--qti-control-size);\n height: var(--qti-control-size);\n }\n &::part(control-mark) {\n width: calc(var(--qti-control-size) * 0.625);\n height: calc(var(--qti-control-size) * 0.625);\n }\n /* Both `control` and `control-mark` carry the variant tokens, so themes can repaint the\n outer box and the inner indicator independently. Scope the base inner-fill rules to\n `control-mark` so the classic dot-in-ring look stays intact; themes wanting the inverted\n look (outer filled, e.g. Kennisnet) add their own `::part(control checked)` rules. */\n &::part(control-mark radio checked) {\n /* 0.5 reproduces today's 8px at the default 1rem — see mark-size for why this is a fraction. */\n width: calc(var(--qti-control-size) * 0.5);\n height: calc(var(--qti-control-size) * 0.5);\n background-color: var(--radio-mark-color, white);\n border-radius: 100%;\n }\n &::part(control-mark checkbox checked) {\n background-color: var(--checkbox-mark-color, white);\n -webkit-mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E\");\n mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E\");\n }\n }\n\n /* Header cells — the two slotted <qti-simple-match-set>s have display:contents\n so their child choices act as row/column header cells. Written as a fully-\n qualified descendant selector (not nested under qti-match-tabular's `&`)\n because native CSS nesting parses `& <ident>` as compound, not descendant,\n and the rule wouldn't match. :first-of-type / :last-of-type drive the\n row vs col differentiation in both runtime (slot attribute set\n declaratively) and the editor (manual slot assignment, no slot attribute).\n Drag is disabled in tabular mode; override the mixin's inline cursor:grab. */\n qti-match-interaction.qti-match-tabular qti-simple-match-set qti-simple-associable-choice {\n background-color: var(--qti-bg-active);\n font-weight: 500;\n padding: var(--qti-padding-box);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n cursor: default !important;\n }\n\n /* A header cell centres its label. The choice is a light-DOM grandchild of the slotted match-set,\n so nothing in the interaction's shadow root can select it; these two variables are the hand-off,\n and qti-simple-associable-choice.styles.ts spends them on its own :host box. */\n qti-match-interaction.qti-match-tabular qti-simple-match-set {\n --qti-choice-align-items: center;\n }\n qti-match-interaction.qti-match-tabular qti-simple-match-set:last-of-type {\n --qti-choice-justify-content: center;\n }\n qti-match-interaction.qti-match-tabular qti-simple-match-set:last-of-type qti-simple-associable-choice {\n text-align: center;\n }\n\n qti-match-interaction.qti-match-tabular {\n /* The 1px gap is the grid's own background showing through, which is what draws the cell rules.\n Clipping it to the rounded corners is layout and lives in qti-match-interaction-tabular.styles.ts. */\n &::part(grid) {\n gap: 1px;\n background-color: var(--qti-border-color);\n border: var(--qti-border-thickness) solid var(--qti-border-color);\n border-radius: var(--qti-border-radius);\n }\n\n &::part(corner),\n &::part(input-cell) {\n border: none;\n background-color: white;\n }\n\n &::part(control checked) {\n border-color: var(--qti-primary);\n background-color: var(--qti-primary);\n }\n\n &::part(control-mark radio checked) {\n background-color: white;\n width: calc(var(--qti-control-size) * 0.5);\n height: calc(var(--qti-control-size) * 0.5);\n }\n\n &::part(control-mark checkbox checked) {\n background-color: white;\n }\n }\n\n qti-match-interaction.qti-match-tabular qti-simple-match-set qti-simple-associable-choice {\n border: none;\n background-color: white;\n }\n}\n@layer qti-components.interactions.corrections {\n qti-match-interaction.qti-match-tabular {\n /* Correct / incorrect overlays — border on the outer box, and a matching fill on the inner\n indicator when checked. */\n &::part(control correct) {\n border-color: var(--qti-correct);\n }\n &::part(control incorrect) {\n border-color: var(--qti-incorrect);\n }\n\n &::part(control checked correct) {\n border-color: var(--qti-correct);\n background-color: var(--qti-correct);\n }\n\n &::part(control checked incorrect) {\n border-color: var(--qti-incorrect);\n background-color: var(--qti-incorrect);\n }\n }\n\n .full-correct-response qti-match-interaction.qti-match-tabular {\n &::part(control checked) {\n background-color: var(--qti-answer-bg);\n color: var(--qti-answer-fg);\n border-color: var(--qti-answer-border);\n }\n\n &::part(control-mark radio checked),\n &::part(control-mark checkbox checked) {\n background-color: var(--qti-answer-fg);\n }\n }\n}\n/* This interaction's chip vocabulary — the bank chip, the placed chip, and the floating clone. One\n such block per drag-drop interaction, opt-in; graphic-gap-match deliberately declares none. See\n qti-states.css. Kept in the `global` layer, where these rules used to live, so cascade position is\n unchanged.\n\n The clone is matched by [data-drag-interaction] rather than by ancestry because it is a SIBLING of\n the interaction, not a descendant: createDragClone appends it to the interaction's ROOT (the\n item's shadow root), which is the same tree — so the theme can reach it — but not the same\n subtree. The attribute is also what tells one interaction's chip in flight from another's, which\n is how graphic-gap-match stays out without anyone writing an exclusion.\n\n Its grip hangs off ::part(control)::before, the same place the resting chip's does, so a chip does\n not move its handle when you pick it up. That the part is reachable at all is new: while the clone\n sat on document.body it was in a different tree from the adopted stylesheet, and nothing — no\n part, no attribute — could style it. */\n@layer qti-components.global {\n qti-order-interaction :state(drag),\n [data-drag-clone][data-drag-interaction='qti-order-interaction'] {\n /* Structural — the load-bearing box, never state-switched (layout-invariance contract).\n box-sizing is deliberate: the clone is appended to document.body outside reset.css's\n @scope, so it inherits no border-box from anywhere else and this sets it. */\n box-sizing: border-box;\n padding: var(--qti-drag-padding);\n cursor: grab;\n /*\n * A chip is as wide as the drop it belongs in — the SAME token the drop reserves with.\n *\n * That one shared name is what makes a drag and its drop the same size without any arithmetic\n * relating them: the interaction measures the widest chip, publishes it once, and both the chip\n * and the slot read it. See DROP-SIZING.md.\n *\n * It applies in the bank as well as in the drop, which is the point: the chip already has the\n * width before it is dropped, so nothing changes size at the moment of landing. That keeps \"a chip\n * is the same chip wherever it lives\" true (drag-drop.invariance.spec.ts) and keeps the return\n * animation from ending in a snap. A `width: 100%` on the placed chip gives the same still image\n * and breaks both — it is what order used to do, and why order was the one entry in\n * CHIP_BOX_KNOWN_BAD.\n *\n * min-width, not width, so a chip whose own text is wider than the widest measured chip still\n * fits. Defaults to 0 where nothing is measured (match, whose targets are cards, not slots), so\n * those chips keep their natural width with no rule needed to say so.\n *\n * --qti-drag-min-width, not --qti-dropzone-min-width: the mixin writes the same measured value to\n * both, so a chip and its slot still match, but the two need OPPOSITE defaults when nothing is\n * measured — a chip must stay at its natural width, while a drops-grid track must not collapse.\n * See the note on both names in qti-variables.css.\n */\n min-width: var(--qti-drag-min-width, 0);\n /* Paint via the contract, nothing more — the --qti-component-* tokens already make a neutral\n bordered box (white surface, theme border, no shadow). The chip sets NO --drag-* of its own,\n and that is load-bearing: if it did (e.g. `--drag-background-color: white`), that declaration\n would ride the interaction's HIGH-specificity chip selector\n (`qti-gap-match-interaction qti-gap::part(drag)`) and out-specify a brand overlay's bare\n `qti-gap::part(drag)`, so the brand could never win. With nothing set here, the overlay's\n --drag-* is the only declaration and wins with no specificity/layer contest. */\n background-color: var(--drag-background-color, var(--qti-component-background-color));\n background-image: var(--drag-background-image, var(--qti-component-background-image));\n border-width: var(--drag-border-width, var(--qti-component-border-width));\n border-style: var(--drag-border-style, var(--qti-component-border-style));\n border-color: var(--drag-border-color, var(--qti-component-border-color));\n border-radius: var(--drag-border-radius, var(--qti-component-border-radius));\n box-shadow: var(--drag-box-shadow, var(--qti-component-box-shadow));\n color: var(--drag-color, var(--qti-component-color));\n opacity: var(--drag-opacity, var(--qti-component-opacity));\n filter: var(--drag-filter, var(--qti-component-filter));\n }\n\n qti-order-interaction :state(drag)::part(control)::before,\n qti-order-interaction::part(drag-control)::before,\n qti-order-interaction ::part(drag-control)::before,\n [data-drag-clone][data-drag-interaction='qti-order-interaction']::part(control)::before {\n content: '';\n display: inline-block;\n vertical-align: middle;\n width: 0.75em;\n height: 1em;\n margin-right: var(--qti-glyph-gap);\n background-color: currentColor;\n mask: var(--qti-grip-mask) no-repeat center / contain;\n -webkit-mask: var(--qti-grip-mask) no-repeat center / contain;\n }\n}\n@layer qti-components.interactions.base {\n qti-order-interaction {\n &:state(dragzone-active)::part(drags) {\n background-color: var(--qti-bg-active);\n }\n &:state(dragzone-enabled)::part(drags) {\n background-color: var(--qti-bg-active);\n }\n &::part(drag),\n & qti-simple-choice,\n /* Editor fake-drag projected into the interaction's drop-target shadow.\n Same `drag` styling so editor previews match runtime visuals. */\n &::part(drag) {\n /* Structural — the load-bearing box, never state-switched (layout-invariance contract).\n box-sizing is deliberate: the clone is appended to document.body outside reset.css's\n @scope, so it inherits no border-box from anywhere else and this sets it. */\n box-sizing: border-box;\n padding: var(--qti-drag-padding);\n cursor: grab;\n /*\n * A chip is as wide as the drop it belongs in — the SAME token the drop reserves with.\n *\n * That one shared name is what makes a drag and its drop the same size without any arithmetic\n * relating them: the interaction measures the widest chip, publishes it once, and both the chip\n * and the slot read it. See DROP-SIZING.md.\n *\n * It applies in the bank as well as in the drop, which is the point: the chip already has the\n * width before it is dropped, so nothing changes size at the moment of landing. That keeps \"a chip\n * is the same chip wherever it lives\" true (drag-drop.invariance.spec.ts) and keeps the return\n * animation from ending in a snap. A `width: 100%` on the placed chip gives the same still image\n * and breaks both — it is what order used to do, and why order was the one entry in\n * CHIP_BOX_KNOWN_BAD.\n *\n * min-width, not width, so a chip whose own text is wider than the widest measured chip still\n * fits. Defaults to 0 where nothing is measured (match, whose targets are cards, not slots), so\n * those chips keep their natural width with no rule needed to say so.\n *\n * --qti-drag-min-width, not --qti-dropzone-min-width: the mixin writes the same measured value to\n * both, so a chip and its slot still match, but the two need OPPOSITE defaults when nothing is\n * measured — a chip must stay at its natural width, while a drops-grid track must not collapse.\n * See the note on both names in qti-variables.css.\n */\n min-width: var(--qti-drag-min-width, 0);\n /* Paint via the contract, nothing more — the --qti-component-* tokens already make a neutral\n bordered box (white surface, theme border, no shadow). The chip sets NO --drag-* of its own,\n and that is load-bearing: if it did (e.g. `--drag-background-color: white`), that declaration\n would ride the interaction's HIGH-specificity chip selector\n (`qti-gap-match-interaction qti-gap::part(drag)`) and out-specify a brand overlay's bare\n `qti-gap::part(drag)`, so the brand could never win. With nothing set here, the overlay's\n --drag-* is the only declaration and wins with no specificity/layer contest. */\n background-color: var(--drag-background-color, var(--qti-component-background-color));\n background-image: var(--drag-background-image, var(--qti-component-background-image));\n border-width: var(--drag-border-width, var(--qti-component-border-width));\n border-style: var(--drag-border-style, var(--qti-component-border-style));\n border-color: var(--drag-border-color, var(--qti-component-border-color));\n border-radius: var(--drag-border-radius, var(--qti-component-border-radius));\n box-shadow: var(--drag-box-shadow, var(--qti-component-box-shadow));\n color: var(--drag-color, var(--qti-component-color));\n opacity: var(--drag-opacity, var(--qti-component-opacity));\n filter: var(--drag-filter, var(--qti-component-filter));\n &[dragging] {\n pointer-events: none;\n rotate: -2deg;\n --drag-box-shadow: 0 8px 12px rgb(0 0 0 / 20%), 0 4px 8px rgb(0 0 0 / 10%);\n }\n &:hover {\n @media (hover: hover) {\n background-color: color-mix(\n in srgb,\n var(--drag-background-color, var(--qti-component-background-color)) 92%,\n black\n );\n }\n }\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n }\n /* Editor fake-drag projected into the interaction's drop-target shadow.\n Same `drag` styling so editor previews match runtime visuals.\n Kept as its own block (separate from the runtime-drag selector list\n above) because a CSS comment between commas inside a nested selector\n list is silently dropped by Chrome's nesting parser. */\n &::part(drag) {\n /* Structural — the load-bearing box, never state-switched (layout-invariance contract).\n box-sizing is deliberate: the clone is appended to document.body outside reset.css's\n @scope, so it inherits no border-box from anywhere else and this sets it. */\n box-sizing: border-box;\n padding: var(--qti-drag-padding);\n cursor: grab;\n /*\n * A chip is as wide as the drop it belongs in — the SAME token the drop reserves with.\n *\n * That one shared name is what makes a drag and its drop the same size without any arithmetic\n * relating them: the interaction measures the widest chip, publishes it once, and both the chip\n * and the slot read it. See DROP-SIZING.md.\n *\n * It applies in the bank as well as in the drop, which is the point: the chip already has the\n * width before it is dropped, so nothing changes size at the moment of landing. That keeps \"a chip\n * is the same chip wherever it lives\" true (drag-drop.invariance.spec.ts) and keeps the return\n * animation from ending in a snap. A `width: 100%` on the placed chip gives the same still image\n * and breaks both — it is what order used to do, and why order was the one entry in\n * CHIP_BOX_KNOWN_BAD.\n *\n * min-width, not width, so a chip whose own text is wider than the widest measured chip still\n * fits. Defaults to 0 where nothing is measured (match, whose targets are cards, not slots), so\n * those chips keep their natural width with no rule needed to say so.\n *\n * --qti-drag-min-width, not --qti-dropzone-min-width: the mixin writes the same measured value to\n * both, so a chip and its slot still match, but the two need OPPOSITE defaults when nothing is\n * measured — a chip must stay at its natural width, while a drops-grid track must not collapse.\n * See the note on both names in qti-variables.css.\n */\n min-width: var(--qti-drag-min-width, 0);\n /* Paint via the contract, nothing more — the --qti-component-* tokens already make a neutral\n bordered box (white surface, theme border, no shadow). The chip sets NO --drag-* of its own,\n and that is load-bearing: if it did (e.g. `--drag-background-color: white`), that declaration\n would ride the interaction's HIGH-specificity chip selector\n (`qti-gap-match-interaction qti-gap::part(drag)`) and out-specify a brand overlay's bare\n `qti-gap::part(drag)`, so the brand could never win. With nothing set here, the overlay's\n --drag-* is the only declaration and wins with no specificity/layer contest. */\n background-color: var(--drag-background-color, var(--qti-component-background-color));\n background-image: var(--drag-background-image, var(--qti-component-background-image));\n border-width: var(--drag-border-width, var(--qti-component-border-width));\n border-style: var(--drag-border-style, var(--qti-component-border-style));\n border-color: var(--drag-border-color, var(--qti-component-border-color));\n border-radius: var(--drag-border-radius, var(--qti-component-border-radius));\n box-shadow: var(--drag-box-shadow, var(--qti-component-box-shadow));\n color: var(--drag-color, var(--qti-component-color));\n opacity: var(--drag-opacity, var(--qti-component-opacity));\n filter: var(--drag-filter, var(--qti-component-filter));\n &:hover {\n @media (hover: hover) {\n background-color: color-mix(\n in srgb,\n var(--drag-background-color, var(--qti-component-background-color)) 92%,\n black\n );\n }\n }\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n }\n /* The drag's box — flex, centred, clipped — is in qti-order-interaction.styles.ts. */\n &::part(drag) {\n /*\n * No `width: 100%`. It stretched a placed chip to its slot, which is why order was the one\n * entry in CHIP_BOX_KNOWN_BAD (\"the placed chip stretches to fill its drop slot\") — a 55px\n * chip in the bank became 666px once dropped. The slot is now sized from the chip instead of\n * the other way round (qti-order-interaction.styles.ts), so there is nothing left to fill.\n *\n * Every chip now takes --qti-dropzone-min-width instead (see `@mixin drag`), the same name the\n * slot reserves with — so chip and slot are the same size by construction, in the bank as well\n * as in the drop, and nothing changes size at the moment of landing.\n */\n text-overflow: ellipsis;\n }\n /*\n * Moved out of qti-order-interaction.styles.ts, which is layout-only now.\n *\n * The drop's flags are part tokens rather than attributes: an attribute selector cannot follow\n * `::part()`, and a <div> cannot carry a custom state (attachInternals throws). See setDropFlag.\n */\n &::part(active) {\n background-color: var(--qti-bg-active);\n }\n\n &::part(enabled) {\n background-color: var(--qti-bg-active);\n }\n\n /* A filled drop hides its dashed outline and drop-here glyph. Hides — the border keeps its\n width, or the column shifts 2px the instant a chip lands. */\n &::part(filled) {\n --qti-drop-border: var(--qti-border-thickness, 1px) solid transparent;\n --qti-drop-bg-img: none;\n }\n\n &::part(drops) {\n gap: var(--qti-gap);\n }\n &::part(drags) {\n gap: var(--qti-gap);\n }\n &::part(drop) {\n background-color: var(--drop-background-color, var(--qti-component-background-color));\n background-image: var(--drop-background-image, var(--qti-component-background-image));\n border-width: var(--drop-border-width, var(--qti-component-border-width));\n border-style: var(--drop-border-style, var(--qti-component-border-style));\n border-color: var(--drop-border-color, var(--qti-component-border-color));\n border-radius: var(--drop-border-radius, var(--qti-component-border-radius));\n box-shadow: var(--drop-box-shadow, var(--qti-component-box-shadow));\n color: var(--drop-color, var(--qti-component-color));\n opacity: var(--drop-opacity, var(--qti-component-opacity));\n filter: var(--drop-filter, var(--qti-component-filter));\n border-style: var(--drop-border-style, dashed);\n &[enabled] {\n background-color: var(--qti-bg-active);\n }\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n }\n &::part(active) {\n background-color: var(--qti-bg-active);\n }\n }\n\n qti-order-interaction {\n &::part(drops) {\n margin: 0;\n border-radius: var(--qti-border-radius);\n }\n\n /* No `height: 100%` here. The drop is a grid item, so `align-self: stretch` already fills the\n row — and because dropRegion makes it content-box, a percentage height made its border-box\n overhang the row by the border (42px row, 44px drop), which the drop's padding then doubled.\n It also defeated `:has(qti-simple-choice) [part~='drop'] { align-self: flex-start }` in\n qti-order-interaction.styles.ts. */\n &::part(drop) {\n border: var(--qti-drop-border, var(--qti-border-thickness) dashed var(--qti-border-color));\n border-radius: var(--qti-border-radius);\n background-color: transparent;\n background-image: var(--qti-drop-bg-img, revert-layer);\n }\n\n &::part(active) {\n background-color: var(--qti-bg-active);\n }\n\n &::part(enabled) {\n background-color: var(--qti-bg-active);\n }\n\n /* `align-self` on a populated drop, and the drops' and drag's `overflow: visible` that let a\n chip's shadow escape its column, are laid out in qti-order-interaction.styles.ts. */\n /* The placed order chip's INVERTED look (white fill, dark text, neutral border) is\n Kennisnet-specific — a light chip against the primary bank — so it lives in the Kennisnet brand\n overlay (apps/e2e/src/stories/kennisnet/kennisnet.css), not here. In the base theme a placed\n chip is just the neutral chip (@mixin drag), and its corrections route through --drag-*\n like every other chip. */\n & qti-simple-choice {\n /* Structural — the load-bearing box, never state-switched (layout-invariance contract).\n box-sizing is deliberate: the clone is appended to document.body outside reset.css's\n @scope, so it inherits no border-box from anywhere else and this sets it. */\n box-sizing: border-box;\n padding: var(--qti-drag-padding);\n cursor: grab;\n /*\n * A chip is as wide as the drop it belongs in — the SAME token the drop reserves with.\n *\n * That one shared name is what makes a drag and its drop the same size without any arithmetic\n * relating them: the interaction measures the widest chip, publishes it once, and both the chip\n * and the slot read it. See DROP-SIZING.md.\n *\n * It applies in the bank as well as in the drop, which is the point: the chip already has the\n * width before it is dropped, so nothing changes size at the moment of landing. That keeps \"a chip\n * is the same chip wherever it lives\" true (drag-drop.invariance.spec.ts) and keeps the return\n * animation from ending in a snap. A `width: 100%` on the placed chip gives the same still image\n * and breaks both — it is what order used to do, and why order was the one entry in\n * CHIP_BOX_KNOWN_BAD.\n *\n * min-width, not width, so a chip whose own text is wider than the widest measured chip still\n * fits. Defaults to 0 where nothing is measured (match, whose targets are cards, not slots), so\n * those chips keep their natural width with no rule needed to say so.\n *\n * --qti-drag-min-width, not --qti-dropzone-min-width: the mixin writes the same measured value to\n * both, so a chip and its slot still match, but the two need OPPOSITE defaults when nothing is\n * measured — a chip must stay at its natural width, while a drops-grid track must not collapse.\n * See the note on both names in qti-variables.css.\n */\n min-width: var(--qti-drag-min-width, 0);\n /* Paint via the contract, nothing more — the --qti-component-* tokens already make a neutral\n bordered box (white surface, theme border, no shadow). The chip sets NO --drag-* of its own,\n and that is load-bearing: if it did (e.g. `--drag-background-color: white`), that declaration\n would ride the interaction's HIGH-specificity chip selector\n (`qti-gap-match-interaction qti-gap::part(drag)`) and out-specify a brand overlay's bare\n `qti-gap::part(drag)`, so the brand could never win. With nothing set here, the overlay's\n --drag-* is the only declaration and wins with no specificity/layer contest. */\n background-color: var(--drag-background-color, var(--qti-component-background-color));\n background-image: var(--drag-background-image, var(--qti-component-background-image));\n border-width: var(--drag-border-width, var(--qti-component-border-width));\n border-style: var(--drag-border-style, var(--qti-component-border-style));\n border-color: var(--drag-border-color, var(--qti-component-border-color));\n border-radius: var(--drag-border-radius, var(--qti-component-border-radius));\n box-shadow: var(--drag-box-shadow, var(--qti-component-box-shadow));\n color: var(--drag-color, var(--qti-component-color));\n opacity: var(--drag-opacity, var(--qti-component-opacity));\n filter: var(--drag-filter, var(--qti-component-filter));\n }\n\n &::part(container) {\n gap: 2rem;\n }\n\n /*\n * Orientation is laid out by qti-order-interaction.styles.ts. What used to be here:\n *\n * [orientation='horizontal']::part(drops) restated the styles.ts base rule verbatim, which\n * cancelled that file's `grid-auto-flow: column`. It only matched the attribute, so\n * `orientation=\"horizontal\"` wrapped while `class=\"qti-orientation-horizontal\"` did not —\n * two spellings of one QTI concept rendering differently. Both now wrap; see styles.ts.\n *\n * ::part(container) { flex-direction } inert. The container is `display: grid` with\n * grid-template-areas, so flex-direction never applied. It was reaching for \"horizontal puts\n * the bank above the drops\" — that is what the qti-choices-top/bottom/left/right classes\n * already do, and wiring orientation to them is a behaviour change, not a move.\n */\n &[orientation='vertical'] {\n & qti-simple-choice,\n &::part(drag) {\n width: auto;\n }\n }\n }\n}\n@layer qti-components.interactions.states {\n qti-order-interaction qti-simple-choice:state(placeholder) {\n /* The hole a spent/lifted chip leaves. Like the chip (see `drag`), it sets NO fill / border /\n shadow of its own — those inherit from the resting chip (neutral by default, the brand's fill\n when an overlay is on), so a brand can restyle the hole via a `:state(placeholder)` overlay\n with no specificity contest. The one thing a placeholder always does, in every brand, is hide\n its text; the default hole is then just the resting chip (white + border) with its text gone. */\n --drag-color: transparent;\n --drag-opacity: 1;\n pointer-events: none;\n }\n\n qti-order-interaction qti-simple-choice:state(dragging) {\n /* The hole a spent/lifted chip leaves. Like the chip (see `drag`), it sets NO fill / border /\n shadow of its own — those inherit from the resting chip (neutral by default, the brand's fill\n when an overlay is on), so a brand can restyle the hole via a `:state(placeholder)` overlay\n with no specificity contest. The one thing a placeholder always does, in every brand, is hide\n its text; the default hole is then just the resting chip (white + border) with its text gone. */\n --drag-color: transparent;\n --drag-opacity: 1;\n border-color: var(--qti-drop-highlight-border-color);\n box-shadow: inset 0 0 0 var(--qti-drop-highlight-border-width, 2px)\n color-mix(in srgb, var(--qti-drop-highlight-border-color) 55%, transparent);\n pointer-events: none;\n }\n\n qti-order-interaction qti-simple-choice:state(return-anchor) {\n border-color: var(--qti-drop-highlight-border-color);\n box-shadow: inset 0 0 0 var(--qti-drop-highlight-border-width, 2px)\n color-mix(in srgb, var(--qti-drop-highlight-border-color) 55%, transparent);\n }\n\n qti-order-interaction::part(hover),\n qti-order-interaction::part(active) {\n background-color: var(--qti-drop-highlight-bg);\n }\n\n qti-order-interaction::part(enabled) {\n background-color: var(--qti-drop-highlight-enabled-bg);\n }\n}\n@layer qti-components.interactions.corrections {\n /*\n * Judgement paint, via the shared mixin — every other drag-drop interaction already uses it.\n *\n * Order hand-rolled this, and set `background-color` and `border-color` but never `color`. The\n * drag handle is `background-color: currentColor` behind a mask (see `@mixin grip`), so it can\n * only be as green as the element's `color` — and `color` stayed at the `--qti-fg` the\n * base layer gives a drag, which is #3e144e and reads as black. Every other interaction's grip\n * turned green or red because `candidate-tint` sets all three.\n *\n * Two rules went with it, both dead: a `background-color: var(--qti-correct-response, …)` pair\n * that the blocks below overrode at equal specificity, naming a `--qti-correct-response` token\n * that is not defined anywhere in the repo.\n *\n * Keep :state() in the same selector as ::part(). Native nesting after a pseudo-element is not\n * parsed consistently by the browser toolchain.\n */\n /* A corrected chip — in the bank, and where it landed. Moved here from the shared\n qti-corrections.css, which claimed `:state(drag)` for EVERY interaction in one unscoped rule:\n the same shape the chip vocabulary had before it was sprayed, and moved for the same reason.\n `[data-drag-clone]:state(candidate-*)` went with it and is deliberately NOT reproduced — a clone\n carries no custom states at all, because cloneNode does not copy ElementInternals (measured), so\n that selector never matched anything. */\n qti-order-interaction :state(drag):state(candidate-correct),\n qti-order-interaction::part(drag):state(candidate-correct) {\n --drag-background-color: var(--qti-correct-light);\n --drag-color: var(--qti-correct);\n --drag-border-color: var(--qti-correct);\n --drag-box-shadow: none;\n }\n\n qti-order-interaction :state(drag):state(candidate-incorrect),\n qti-order-interaction::part(drag):state(candidate-incorrect) {\n --drag-background-color: var(--qti-incorrect-light);\n --drag-color: var(--qti-incorrect);\n --drag-border-color: var(--qti-incorrect);\n --drag-box-shadow: none;\n }\n\n /* The bank is hidden by the interaction itself, on :host([answer-key]) — see\n qti-order-interaction.styles.ts. */\n}\n/* This interaction's chip vocabulary — the bank chip, the placed chip, and the floating clone. One\n such block per drag-drop interaction, opt-in; graphic-gap-match deliberately declares none. See\n qti-states.css. Kept in the `global` layer, where these rules used to live, so cascade position is\n unchanged.\n\n The clone is matched by [data-drag-interaction] rather than by ancestry because it is a SIBLING of\n the interaction, not a descendant: createDragClone appends it to the interaction's ROOT (the\n item's shadow root), which is the same tree — so the theme can reach it — but not the same\n subtree. The attribute is also what tells one interaction's chip in flight from another's, which\n is how graphic-gap-match stays out without anyone writing an exclusion.\n\n Its grip hangs off ::part(control)::before, the same place the resting chip's does, so a chip does\n not move its handle when you pick it up. That the part is reachable at all is new: while the clone\n sat on document.body it was in a different tree from the adopted stylesheet, and nothing — no\n part, no attribute — could style it.\n\n This interaction is the one that needed the global rule most: every `@mixin drag` further down\n targets `::part(drag)`, the PLACED chip, so the light-DOM bank chip drew its fill, radius, cursor\n and text colour from the removed rule and nothing else. Deleting that rule without this block\n turned the associate bank chips transparent, square and un-grabbable — measured, not guessed. */\n@layer qti-components.global {\n qti-associate-interaction :state(drag),\n [data-drag-clone][data-drag-interaction='qti-associate-interaction'] {\n /* Structural — the load-bearing box, never state-switched (layout-invariance contract).\n box-sizing is deliberate: the clone is appended to document.body outside reset.css's\n @scope, so it inherits no border-box from anywhere else and this sets it. */\n box-sizing: border-box;\n padding: var(--qti-drag-padding);\n cursor: grab;\n /*\n * A chip is as wide as the drop it belongs in — the SAME token the drop reserves with.\n *\n * That one shared name is what makes a drag and its drop the same size without any arithmetic\n * relating them: the interaction measures the widest chip, publishes it once, and both the chip\n * and the slot read it. See DROP-SIZING.md.\n *\n * It applies in the bank as well as in the drop, which is the point: the chip already has the\n * width before it is dropped, so nothing changes size at the moment of landing. That keeps \"a chip\n * is the same chip wherever it lives\" true (drag-drop.invariance.spec.ts) and keeps the return\n * animation from ending in a snap. A `width: 100%` on the placed chip gives the same still image\n * and breaks both — it is what order used to do, and why order was the one entry in\n * CHIP_BOX_KNOWN_BAD.\n *\n * min-width, not width, so a chip whose own text is wider than the widest measured chip still\n * fits. Defaults to 0 where nothing is measured (match, whose targets are cards, not slots), so\n * those chips keep their natural width with no rule needed to say so.\n *\n * --qti-drag-min-width, not --qti-dropzone-min-width: the mixin writes the same measured value to\n * both, so a chip and its slot still match, but the two need OPPOSITE defaults when nothing is\n * measured — a chip must stay at its natural width, while a drops-grid track must not collapse.\n * See the note on both names in qti-variables.css.\n */\n min-width: var(--qti-drag-min-width, 0);\n /* Paint via the contract, nothing more — the --qti-component-* tokens already make a neutral\n bordered box (white surface, theme border, no shadow). The chip sets NO --drag-* of its own,\n and that is load-bearing: if it did (e.g. `--drag-background-color: white`), that declaration\n would ride the interaction's HIGH-specificity chip selector\n (`qti-gap-match-interaction qti-gap::part(drag)`) and out-specify a brand overlay's bare\n `qti-gap::part(drag)`, so the brand could never win. With nothing set here, the overlay's\n --drag-* is the only declaration and wins with no specificity/layer contest. */\n background-color: var(--drag-background-color, var(--qti-component-background-color));\n background-image: var(--drag-background-image, var(--qti-component-background-image));\n border-width: var(--drag-border-width, var(--qti-component-border-width));\n border-style: var(--drag-border-style, var(--qti-component-border-style));\n border-color: var(--drag-border-color, var(--qti-component-border-color));\n border-radius: var(--drag-border-radius, var(--qti-component-border-radius));\n box-shadow: var(--drag-box-shadow, var(--qti-component-box-shadow));\n color: var(--drag-color, var(--qti-component-color));\n opacity: var(--drag-opacity, var(--qti-component-opacity));\n filter: var(--drag-filter, var(--qti-component-filter));\n }\n\n qti-associate-interaction :state(drag)::part(control)::before,\n qti-associate-interaction::part(drag-control)::before,\n qti-associate-interaction ::part(drag-control)::before,\n [data-drag-clone][data-drag-interaction='qti-associate-interaction']::part(control)::before {\n content: '';\n display: inline-block;\n vertical-align: middle;\n width: 0.75em;\n height: 1em;\n margin-right: var(--qti-glyph-gap);\n background-color: currentColor;\n mask: var(--qti-grip-mask) no-repeat center / contain;\n -webkit-mask: var(--qti-grip-mask) no-repeat center / contain;\n }\n}\n@layer qti-components.interactions.base {\n qti-associate-interaction {\n /*\n * NO `--drag-border-color: transparent` here, and that absence is the rule.\n *\n * It used to say transparent, on the reasoning that the bank chip's border should be INVISIBLE\n * rather than absent — same box as a placed chip, only the colour differs, so a chip does not\n * resize when it lands. The box argument is sound and unaffected either way: `@mixin drag` sets\n * border-WIDTH, so the 1px is reserved whatever the colour is.\n *\n * What it missed is that the neutral theme has no fill to fall back on. A bank chip is\n * --qti-component-background-color (white) on a white page, so zeroing the only edge it had left\n * bare text with a grip — no chip at all. It read as correct only under a brand, where the fill\n * draws the shape and the border is genuinely redundant (kennisnet sets its own transparent).\n * Associate was the only interaction doing this; match, order and gap-match all let the bank\n * chip take --qti-component-border-color, and now so does this one.\n */\n & qti-simple-associable-choice {\n padding: var(--qti-drag-padding);\n }\n\n &:state(dragzone-active) slot[name='qti-simple-associable-choice'] {\n background-color: var(--qti-bg-active);\n }\n &:state(dragzone-enabled) slot[name='qti-simple-associable-choice'] {\n background-color: var(--qti-bg-active);\n }\n & qti-simple-associable-choice::part(drag),\n /* A placed chip lives in a shadow root; `::part(drag)` is the only way in. This used to be\n `::part(qti-simple-associable-choice)`, a part named after the tag. */\n &::part(drag) {\n /* Structural — the load-bearing box, never state-switched (layout-invariance contract).\n box-sizing is deliberate: the clone is appended to document.body outside reset.css's\n @scope, so it inherits no border-box from anywhere else and this sets it. */\n box-sizing: border-box;\n padding: var(--qti-drag-padding);\n cursor: grab;\n /*\n * A chip is as wide as the drop it belongs in — the SAME token the drop reserves with.\n *\n * That one shared name is what makes a drag and its drop the same size without any arithmetic\n * relating them: the interaction measures the widest chip, publishes it once, and both the chip\n * and the slot read it. See DROP-SIZING.md.\n *\n * It applies in the bank as well as in the drop, which is the point: the chip already has the\n * width before it is dropped, so nothing changes size at the moment of landing. That keeps \"a chip\n * is the same chip wherever it lives\" true (drag-drop.invariance.spec.ts) and keeps the return\n * animation from ending in a snap. A `width: 100%` on the placed chip gives the same still image\n * and breaks both — it is what order used to do, and why order was the one entry in\n * CHIP_BOX_KNOWN_BAD.\n *\n * min-width, not width, so a chip whose own text is wider than the widest measured chip still\n * fits. Defaults to 0 where nothing is measured (match, whose targets are cards, not slots), so\n * those chips keep their natural width with no rule needed to say so.\n *\n * --qti-drag-min-width, not --qti-dropzone-min-width: the mixin writes the same measured value to\n * both, so a chip and its slot still match, but the two need OPPOSITE defaults when nothing is\n * measured — a chip must stay at its natural width, while a drops-grid track must not collapse.\n * See the note on both names in qti-variables.css.\n */\n min-width: var(--qti-drag-min-width, 0);\n /* Paint via the contract, nothing more — the --qti-component-* tokens already make a neutral\n bordered box (white surface, theme border, no shadow). The chip sets NO --drag-* of its own,\n and that is load-bearing: if it did (e.g. `--drag-background-color: white`), that declaration\n would ride the interaction's HIGH-specificity chip selector\n (`qti-gap-match-interaction qti-gap::part(drag)`) and out-specify a brand overlay's bare\n `qti-gap::part(drag)`, so the brand could never win. With nothing set here, the overlay's\n --drag-* is the only declaration and wins with no specificity/layer contest. */\n background-color: var(--drag-background-color, var(--qti-component-background-color));\n background-image: var(--drag-background-image, var(--qti-component-background-image));\n border-width: var(--drag-border-width, var(--qti-component-border-width));\n border-style: var(--drag-border-style, var(--qti-component-border-style));\n border-color: var(--drag-border-color, var(--qti-component-border-color));\n border-radius: var(--drag-border-radius, var(--qti-component-border-radius));\n box-shadow: var(--drag-box-shadow, var(--qti-component-box-shadow));\n color: var(--drag-color, var(--qti-component-color));\n opacity: var(--drag-opacity, var(--qti-component-opacity));\n filter: var(--drag-filter, var(--qti-component-filter));\n &:hover {\n @media (hover: hover) {\n background-color: color-mix(\n in srgb,\n var(--drag-background-color, var(--qti-component-background-color)) 92%,\n black\n );\n }\n }\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n &[dragging] {\n pointer-events: none;\n rotate: -2deg;\n --drag-box-shadow: 0 8px 12px rgb(0 0 0 / 20%), 0 4px 8px rgb(0 0 0 / 10%);\n }\n }\n /* Editor fake-drag projected into the interaction's drop-target shadow.\n Kept as a separate block (not merged into the comma list above)\n because a CSS comment between commas in a nested selector list is\n silently dropped by Chrome's nesting parser. */\n &::part(drag) {\n /* Structural — the load-bearing box, never state-switched (layout-invariance contract).\n box-sizing is deliberate: the clone is appended to document.body outside reset.css's\n @scope, so it inherits no border-box from anywhere else and this sets it. */\n box-sizing: border-box;\n padding: var(--qti-drag-padding);\n cursor: grab;\n /*\n * A chip is as wide as the drop it belongs in — the SAME token the drop reserves with.\n *\n * That one shared name is what makes a drag and its drop the same size without any arithmetic\n * relating them: the interaction measures the widest chip, publishes it once, and both the chip\n * and the slot read it. See DROP-SIZING.md.\n *\n * It applies in the bank as well as in the drop, which is the point: the chip already has the\n * width before it is dropped, so nothing changes size at the moment of landing. That keeps \"a chip\n * is the same chip wherever it lives\" true (drag-drop.invariance.spec.ts) and keeps the return\n * animation from ending in a snap. A `width: 100%` on the placed chip gives the same still image\n * and breaks both — it is what order used to do, and why order was the one entry in\n * CHIP_BOX_KNOWN_BAD.\n *\n * min-width, not width, so a chip whose own text is wider than the widest measured chip still\n * fits. Defaults to 0 where nothing is measured (match, whose targets are cards, not slots), so\n * those chips keep their natural width with no rule needed to say so.\n *\n * --qti-drag-min-width, not --qti-dropzone-min-width: the mixin writes the same measured value to\n * both, so a chip and its slot still match, but the two need OPPOSITE defaults when nothing is\n * measured — a chip must stay at its natural width, while a drops-grid track must not collapse.\n * See the note on both names in qti-variables.css.\n */\n min-width: var(--qti-drag-min-width, 0);\n /* Paint via the contract, nothing more — the --qti-component-* tokens already make a neutral\n bordered box (white surface, theme border, no shadow). The chip sets NO --drag-* of its own,\n and that is load-bearing: if it did (e.g. `--drag-background-color: white`), that declaration\n would ride the interaction's HIGH-specificity chip selector\n (`qti-gap-match-interaction qti-gap::part(drag)`) and out-specify a brand overlay's bare\n `qti-gap::part(drag)`, so the brand could never win. With nothing set here, the overlay's\n --drag-* is the only declaration and wins with no specificity/layer contest. */\n background-color: var(--drag-background-color, var(--qti-component-background-color));\n background-image: var(--drag-background-image, var(--qti-component-background-image));\n border-width: var(--drag-border-width, var(--qti-component-border-width));\n border-style: var(--drag-border-style, var(--qti-component-border-style));\n border-color: var(--drag-border-color, var(--qti-component-border-color));\n border-radius: var(--drag-border-radius, var(--qti-component-border-radius));\n box-shadow: var(--drag-box-shadow, var(--qti-component-box-shadow));\n color: var(--drag-color, var(--qti-component-color));\n opacity: var(--drag-opacity, var(--qti-component-opacity));\n filter: var(--drag-filter, var(--qti-component-filter));\n &:hover {\n @media (hover: hover) {\n background-color: color-mix(\n in srgb,\n var(--drag-background-color, var(--qti-component-background-color)) 92%,\n black\n );\n }\n }\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n }\n /* `display: grid` lives in qti-associate-interaction.styles.ts, which already declares it on\n [part~='drop'] alongside the drop's min-height/min-width. */\n /* A filled drop hides its dashed edge — see the note in qti-gap-match-interaction.css. Every\n associate drop holds exactly one chip (the div never carries match-max), so no capacity guard\n is needed here. Colour only: the width stays, or the row shifts when a chip lands. */\n &::part(filled) {\n --drop-border-color: transparent;\n }\n\n &::part(drop) {\n background-color: var(--drop-background-color, var(--qti-component-background-color));\n background-image: var(--drop-background-image, var(--qti-component-background-image));\n border-width: var(--drop-border-width, var(--qti-component-border-width));\n border-style: var(--drop-border-style, var(--qti-component-border-style));\n border-color: var(--drop-border-color, var(--qti-component-border-color));\n border-radius: var(--drop-border-radius, var(--qti-component-border-radius));\n box-shadow: var(--drop-box-shadow, var(--qti-component-box-shadow));\n color: var(--drop-color, var(--qti-component-color));\n opacity: var(--drop-opacity, var(--qti-component-opacity));\n filter: var(--drop-filter, var(--qti-component-filter));\n border-style: var(--drop-border-style, dashed);\n }\n &::part(drop):focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n\n /*\n * Moved out of qti-associate-interaction.styles.ts, which is layout-only now. The drop's flags\n * are part tokens, not attributes: an attribute selector cannot follow ::part(), and a <div>\n * cannot carry a custom state (attachInternals throws). See setDropFlag.\n *\n * These come *after* ::part(drop). They tie it on specificity, so source order decides — put\n * them first and the idle drop repaints over its own active highlight.\n *\n * Deleted here: `&::part(drop)[dragging] { @mixin act }`. An attribute selector after ::part()\n * never matches; that rule has never applied.\n */\n &::part(active) {\n background-color: var(--qti-bg-active);\n }\n\n &::part(enabled) {\n background-color: var(--qti-bg-active);\n }\n }\n}\n@layer qti-components.interactions.states {\n qti-simple-associable-choice::part(drag),\n qti-associate-interaction::part(drag) {\n /* Structural — the load-bearing box, never state-switched (layout-invariance contract).\n box-sizing is deliberate: the clone is appended to document.body outside reset.css's\n @scope, so it inherits no border-box from anywhere else and this sets it. */\n box-sizing: border-box;\n padding: var(--qti-drag-padding);\n cursor: grab;\n /*\n * A chip is as wide as the drop it belongs in — the SAME token the drop reserves with.\n *\n * That one shared name is what makes a drag and its drop the same size without any arithmetic\n * relating them: the interaction measures the widest chip, publishes it once, and both the chip\n * and the slot read it. See DROP-SIZING.md.\n *\n * It applies in the bank as well as in the drop, which is the point: the chip already has the\n * width before it is dropped, so nothing changes size at the moment of landing. That keeps \"a chip\n * is the same chip wherever it lives\" true (drag-drop.invariance.spec.ts) and keeps the return\n * animation from ending in a snap. A `width: 100%` on the placed chip gives the same still image\n * and breaks both — it is what order used to do, and why order was the one entry in\n * CHIP_BOX_KNOWN_BAD.\n *\n * min-width, not width, so a chip whose own text is wider than the widest measured chip still\n * fits. Defaults to 0 where nothing is measured (match, whose targets are cards, not slots), so\n * those chips keep their natural width with no rule needed to say so.\n *\n * --qti-drag-min-width, not --qti-dropzone-min-width: the mixin writes the same measured value to\n * both, so a chip and its slot still match, but the two need OPPOSITE defaults when nothing is\n * measured — a chip must stay at its natural width, while a drops-grid track must not collapse.\n * See the note on both names in qti-variables.css.\n */\n min-width: var(--qti-drag-min-width, 0);\n /* Paint via the contract, nothing more — the --qti-component-* tokens already make a neutral\n bordered box (white surface, theme border, no shadow). The chip sets NO --drag-* of its own,\n and that is load-bearing: if it did (e.g. `--drag-background-color: white`), that declaration\n would ride the interaction's HIGH-specificity chip selector\n (`qti-gap-match-interaction qti-gap::part(drag)`) and out-specify a brand overlay's bare\n `qti-gap::part(drag)`, so the brand could never win. With nothing set here, the overlay's\n --drag-* is the only declaration and wins with no specificity/layer contest. */\n background-color: var(--drag-background-color, var(--qti-component-background-color));\n background-image: var(--drag-background-image, var(--qti-component-background-image));\n border-width: var(--drag-border-width, var(--qti-component-border-width));\n border-style: var(--drag-border-style, var(--qti-component-border-style));\n border-color: var(--drag-border-color, var(--qti-component-border-color));\n border-radius: var(--drag-border-radius, var(--qti-component-border-radius));\n box-shadow: var(--drag-box-shadow, var(--qti-component-box-shadow));\n color: var(--drag-color, var(--qti-component-color));\n opacity: var(--drag-opacity, var(--qti-component-opacity));\n filter: var(--drag-filter, var(--qti-component-filter));\n }\n\n qti-associate-interaction::part(hover),\n qti-associate-interaction::part(active) {\n background-color: var(--qti-drop-highlight-bg);\n }\n\n qti-associate-interaction::part(enabled) {\n background-color: var(--qti-drop-highlight-enabled-bg);\n }\n\n qti-associate-interaction qti-simple-associable-choice:state(placeholder) {\n /* The hole a spent/lifted chip leaves. Like the chip (see `drag`), it sets NO fill / border /\n shadow of its own — those inherit from the resting chip (neutral by default, the brand's fill\n when an overlay is on), so a brand can restyle the hole via a `:state(placeholder)` overlay\n with no specificity contest. The one thing a placeholder always does, in every brand, is hide\n its text; the default hole is then just the resting chip (white + border) with its text gone. */\n --drag-color: transparent;\n --drag-opacity: 1;\n border-color: transparent;\n pointer-events: none;\n }\n\n qti-associate-interaction qti-simple-associable-choice:state(dragging) {\n /* The hole a spent/lifted chip leaves. Like the chip (see `drag`), it sets NO fill / border /\n shadow of its own — those inherit from the resting chip (neutral by default, the brand's fill\n when an overlay is on), so a brand can restyle the hole via a `:state(placeholder)` overlay\n with no specificity contest. The one thing a placeholder always does, in every brand, is hide\n its text; the default hole is then just the resting chip (white + border) with its text gone. */\n --drag-color: transparent;\n --drag-opacity: 1;\n border-color: var(--qti-drop-highlight-border-color);\n box-shadow: inset 0 0 0 var(--qti-drop-highlight-border-width, 2px)\n color-mix(in srgb, var(--qti-drop-highlight-border-color) 55%, transparent);\n pointer-events: none;\n }\n\n qti-associate-interaction qti-simple-associable-choice:state(placeholder) > *,\n qti-associate-interaction qti-simple-associable-choice:state(dragging) > * {\n visibility: hidden;\n }\n\n qti-associate-interaction qti-simple-associable-choice:state(placeholder)::part(label),\n qti-associate-interaction qti-simple-associable-choice:state(dragging)::part(label) {\n visibility: hidden;\n }\n\n qti-associate-interaction qti-simple-associable-choice:state(return-anchor) {\n border-color: var(--qti-drop-highlight-border-color);\n box-shadow: inset 0 0 0 var(--qti-drop-highlight-border-width, 2px)\n color-mix(in srgb, var(--qti-drop-highlight-border-color) 55%, transparent);\n }\n}\n@layer qti-components.interactions.corrections {\n /* A corrected chip — in the bank, and where it landed. Moved here from the shared\n qti-corrections.css, which claimed `:state(drag)` for EVERY interaction in one unscoped rule:\n the same shape the chip vocabulary had before it was sprayed, and moved for the same reason.\n `[data-drag-clone]:state(candidate-*)` went with it and is deliberately NOT reproduced — a clone\n carries no custom states at all, because cloneNode does not copy ElementInternals (measured), so\n that selector never matched anything. */\n qti-associate-interaction :state(drag):state(candidate-correct),\n qti-simple-associable-choice::part(drag):state(candidate-correct),\n qti-associate-interaction::part(drag):state(candidate-correct) {\n --drag-background-color: var(--qti-correct-light);\n --drag-color: var(--qti-correct);\n --drag-border-color: var(--qti-correct);\n --drag-box-shadow: none;\n }\n\n qti-associate-interaction :state(drag):state(candidate-incorrect),\n qti-simple-associable-choice::part(drag):state(candidate-incorrect),\n qti-associate-interaction::part(drag):state(candidate-incorrect) {\n --drag-background-color: var(--qti-incorrect-light);\n --drag-color: var(--qti-incorrect);\n --drag-border-color: var(--qti-incorrect);\n --drag-box-shadow: none;\n }\n\n /* The bank is hidden by the interaction itself, on :host([answer-key]) — see\n qti-associate-interaction.styles.ts. */\n}\n@layer qti-components.interactions.base {\n qti-graphic-order-interaction {\n --qti-graphic-order-pin-size: calc(var(--qti-select-point-marker-size, 1.5rem) * 1.2);\n --qti-graphic-order-pin-anchor: -100%;\n --qti-graphic-order-pin-fill: var(--qti-background, #fff);\n --qti-graphic-order-pin-number-size: calc(var(--qti-graphic-order-pin-size) * 0.5);\n --qti-graphic-order-pin-svg: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512'%3E%3Cpath d='M192 500C145 434 106 386 77 344C49 305 32 272 32 224C32 135.6 103.6 64 192 64s160 71.6 160 160c0 48-17 81-45 120c-29 42-68 90-115 156z' fill='white' stroke='currentColor' stroke-width='28' stroke-linejoin='round'/%3E%3C/svg%3E\");\n\n & qti-hotspot-choice {\n width: 100%;\n height: 100%;\n background-color: color-mix(in srgb, var(--qti-border-color) 18%, transparent);\n padding: 0;\n cursor: pointer;\n transition:\n background-color var(--qti-motion-duration-fast, 0.15s) ease,\n border-color var(--qti-motion-duration-fast, 0.15s) ease;\n\n &[shape='circle'] {\n min-width: calc(var(--qti-graphic-order-pin-size) * 0.6);\n min-height: calc(var(--qti-graphic-order-pin-size) * 0.6);\n }\n\n &[shape='poly'] {\n background-color: color-mix(in srgb, var(--qti-border-color) 18%, transparent);\n box-shadow: none;\n }\n\n &[shape='circle']:hover,\n &[shape='rect']:hover,\n &[shape='ellipse']:hover {\n background-color: color-mix(in srgb, var(--qti-border-active) 12%, transparent);\n }\n\n &[shape='poly']:hover {\n background-color: color-mix(in srgb, var(--qti-border-active) 20%, transparent);\n box-shadow: none;\n }\n\n &[shape='circle']:focus-visible,\n &[shape='rect']:focus-visible,\n &[shape='ellipse']:focus-visible {\n outline: var(--qti-focus-border-width) solid var(--qti-focus-color);\n outline-offset: 2px;\n }\n\n &[shape='poly']:focus-visible {\n outline: var(--qti-focus-border-width) solid var(--qti-focus-color);\n outline-offset: 2px;\n }\n\n &[aria-ordervalue] {\n border: 0 !important;\n box-shadow: none;\n background-color: color-mix(in srgb, var(--qti-selected-bg) 35%, transparent);\n }\n\n &[aria-ordervalue]:hover,\n &[aria-ordervalue]:focus-visible {\n border-color: transparent !important;\n }\n &[aria-ordercorrectvalue][aria-ordervalue]:not([shape='circle'])::after {\n content: 'C=' attr(aria-ordercorrectvalue) ' R=' attr(aria-ordervalue) !important;\n color: var(--qti-correct);\n }\n &[aria-ordercorrectvalue]:not([aria-ordervalue]):not([shape='circle'])::after {\n content: 'C=' attr(aria-ordercorrectvalue) !important;\n color: var(--qti-correct);\n }\n }\n\n /* The pin's face. Where it sits — absolute, anchored to its hotspot, above the image — is\n placement, and lives in qti-graphic-order-interaction.styles.ts as ::slotted(). */\n & .cito-graphic-order-marker {\n width: var(--qti-graphic-order-pin-size);\n height: var(--qti-graphic-order-pin-size);\n padding-top: calc(var(--qti-graphic-order-pin-size) * 0.2);\n font-weight: 700;\n font-size: var(--qti-graphic-order-pin-number-size);\n line-height: 1;\n color: var(--qti-graphic-order-pin-color, var(--qti-selected-bg));\n text-shadow: 0 0 1px var(--qti-graphic-order-pin-fill);\n background: var(--qti-graphic-order-pin-svg) no-repeat center / contain;\n pointer-events: none;\n }\n\n & .cito-graphic-order-marker--poly {\n width: calc(var(--qti-select-point-marker-size, 1.5rem) * 0.72);\n height: calc(var(--qti-select-point-marker-size, 1.5rem) * 0.72);\n font-size: calc(var(--qti-select-point-marker-size, 1.5rem) * 0.45);\n padding-top: calc(var(--qti-select-point-marker-size, 1.5rem) * 0.14);\n }\n }\n}\n@layer qti-components.interactions.states {\n qti-graphic-order-interaction {\n & qti-hotspot-choice {\n &:state(readonly) {\n cursor: pointer;\n }\n\n &:state(disabled) {\n cursor: not-allowed;\n }\n\n &[shape='circle']:state(checked),\n &[shape='rect']:state(checked),\n &[shape='ellipse']:state(checked) {\n background-color: color-mix(in srgb, var(--qti-selected-bg) 35%, transparent);\n }\n\n &[shape='poly']:state(checked) {\n background-color: color-mix(in srgb, var(--qti-selected-bg) 40%, transparent);\n box-shadow: none;\n }\n\n &[aria-ordervalue]:state(checked),\n &[aria-ordervalue] {\n border-color: transparent !important;\n }\n }\n\n /* No qti-selections-light / -dark here. Appendix B.1 of the QTI 3 implementation guide defines\n that class pair for qti-hotspot-interaction and qti-graphic-gap-match-interaction only, and no\n item in this repo ever set it on a graphic-order interaction. What was here overrode the neutral\n drag-bank highlight below with --qti-light-* and --qti-dark-* colours that nothing could reach. */\n &:state(dragzone-active)::part(drags) {\n /* Direct properties, not slots: ::part(drags) is a bare slot container with no paint role of\n its own (the other interactions paint it with `@mixin dropping`, also direct), so there is\n no --<role>-* to switch. Inlined from `@mixin act`. */\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &:state(dragzone-enabled)::part(drags) {\n background-color: var(--qti-bg-active);\n }\n }\n}\n@layer qti-components.interactions.corrections {\n qti-graphic-order-interaction {\n & qti-hotspot-choice {\n &[shape='circle']:state(correct-response),\n &[shape='rect']:state(correct-response),\n &[shape='ellipse']:state(correct-response) {\n background-color: color-mix(in srgb, var(--qti-answer-bg) 75%, transparent);\n }\n\n &[shape='poly']:state(correct-response) {\n background-color: color-mix(in srgb, var(--qti-answer-bg) 80%, transparent);\n box-shadow: none;\n }\n\n &[shape='circle']:state(candidate-correct),\n &[shape='rect']:state(candidate-correct),\n &[shape='ellipse']:state(candidate-correct) {\n background-color: color-mix(in srgb, var(--qti-correct) 35%, transparent);\n }\n\n &[shape='poly']:state(candidate-correct) {\n background-color: color-mix(in srgb, var(--qti-correct) 40%, transparent);\n box-shadow: none;\n }\n\n &[shape='circle']:state(candidate-incorrect),\n &[shape='rect']:state(candidate-incorrect),\n &[shape='ellipse']:state(candidate-incorrect) {\n background-color: color-mix(in srgb, var(--qti-incorrect) 35%, transparent);\n }\n\n &[shape='poly']:state(candidate-incorrect) {\n background-color: color-mix(in srgb, var(--qti-incorrect) 40%, transparent);\n box-shadow: none;\n }\n\n &[aria-ordervalue]:state(correct-response),\n &[aria-ordervalue]:state(candidate-correct),\n &[aria-ordervalue]:state(candidate-incorrect) {\n border-color: transparent !important;\n }\n }\n }\n}\n@layer qti-components.interactions.base {\n qti-graphic-associate-interaction {\n /*\n * qti-associable-hotspot does not use ActiveElementMixin, so it carries no\n * checked/disabled/readonly custom states. Selection and correction are drawn as\n * ::part(line) / ::part(point) instead. Give it a `part=\"drag\"` and the\n * ActiveElementMixin states before adding state-dependent rules here.\n */\n & qti-associable-hotspot {\n /* `[shape='square']` used to be in this selector. It is not a QTI shape — the spec has\n circle, default, ellipse, poly and rect — positionShapes has no branch for it, and no item\n in the repo sets it. */\n &[shape='circle'] {\n background-color: transparent;\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n }\n }\n }\n}\n@layer qti-components.interactions.states {\n qti-graphic-associate-interaction {\n\n\n /* No qti-selections-light / -dark here. Appendix B.1 of the QTI 3 implementation guide defines\n that class pair for qti-hotspot-interaction and qti-graphic-gap-match-interaction only, and no\n item in this repo ever set it on a graphic-associate interaction. What was here overrode the neutral\n drag-bank highlight below with --qti-light-* and --qti-dark-* colours that nothing could reach. */\n &:state(dragzone-active)::part(drags) {\n /* Direct properties, not slots: ::part(drags) is a bare slot container with no paint role of\n its own (the other interactions paint it with `@mixin dropping`, also direct), so there is\n no --<role>-* to switch. Inlined from `@mixin act`. */\n border-color: var(--qti-border-active);\n background-color: var(--qti-bg-active);\n }\n\n &:state(dragzone-enabled)::part(drags) {\n background-color: var(--qti-bg-active);\n }\n }\n}\n@layer qti-components.interactions.base{\nqti-slider-interaction {\n --qti-tick-color: rgb(229 231 235 / 100%);\n --qti-tick-width: 1px;\n}\n}\n@layer qti-components.interactions.base {\n qti-select-point-interaction {\n /*\n * Paint the marker through its own variable, not through `color`.\n *\n * This used to be `color: var(--qti-primary)` on the host, because the marker's mask is filled\n * with `var(--qti-select-point-marker-color, currentColor)`. But `color` inherits, so it also\n * repainted everything else inside the interaction — most visibly the `qti-prompt`, which turned\n * the question text primary-coloured for no reason.\n *\n * `--qti-select-point-marker-color` is the seam the component already publishes, and the one the\n * corrections mixin writes to. Setting it here rather than `color` leaves the prompt inheriting\n * ordinary body text, and corrections still win: they set the same variable on the point element\n * itself (`[part~='correct']`), which is deeper than this host declaration.\n */\n --qti-select-point-marker-color: var(--qti-primary);\n\n &::part(point) {\n &:focus {\n box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);\n }\n }\n }\n}\n@layer qti-components.interactions.corrections {\n qti-select-point-interaction {\n /* Same knob as the resting colour above — these set `color` before, which stopped reaching the\n marker once it was no longer painted with `currentColor`. */\n &::part(correct) {\n --qti-select-point-marker-color: var(--qti-correct);\n }\n\n &::part(incorrect) {\n --qti-select-point-marker-color: var(--qti-incorrect);\n }\n }\n}\n@layer qti-components.interactions.base{\nqti-position-object-stage {\n & qti-position-object-interaction {\n /* no styles necessary, only layout styles, defined in the component */\n }\n}\n}\n@layer qti-components.interactions.base{\n/* `display: block` lives in qti-prompt.styles.ts, which already declares it on :host. */\n}\n@layer qti-components.interactions.corrections{\n/*\n * What is LEFT here is what the base class owns.\n *\n * The chip corrections that used to head this file are gone, into the five drag interactions. They\n * were one unscoped `:state(drag)` rule claiming every interaction at once — the same shape the chip\n * vocabulary had in qti-states.css, moved for the same reason: an interaction's rules belong in that\n * interaction's file, and a shared rule is only honest when no interaction can own it.\n *\n * The rules below pass that test. `part=\"correction\"` is stamped by the correction machinery on every\n * corrected element, whichever interaction it belongs to, so no single file could own the badge; the\n * same goes for the `.full-correct-response` answer-key presentation, which is a property of the\n * cloned item rather than of any interaction. Spraying those would be four rules copied N times with\n * nothing gained and one of them eventually missed.\n *\n * Two things died in the move, both measured rather than reasoned:\n * - `[data-drag-clone]:state(candidate-*)` matched nothing, ever. cloneNode does not copy\n * ElementInternals, so a floating clone carries no custom states at all.\n * - a pair of `--drag-background-color` rules in gap-match and match asked for a SOLID fill that\n * never rendered, because the shared rule declared `background-color` directly and outranked the\n * binding that reads them. Deleted with the rule that was hiding them.\n */\n/*\n * The candidate-correction badge, `part=\"correction\"` on every corrected element.\n *\n * A token list, so `::part(correction-correct)` reaches the badge in the drag bank, on the\n * floating clone, and inside a drop target's shadow root — a token survives `exportparts`,\n * where a chained `::part()` would not.\n */\n::part(correction-correct) {\n background-color: var(--qti-correct);\n mask: var(--qti-check-mask) no-repeat center / contain;\n -webkit-mask: var(--qti-check-mask) no-repeat center / contain;\n}\n\n::part(correction-incorrect) {\n background-color: var(--qti-incorrect);\n mask: var(--qti-times-mask) no-repeat center / contain;\n -webkit-mask: var(--qti-times-mask) no-repeat center / contain;\n}\n\n/*\n * The third verdict. correction.styles.ts has always SIZED `correction-partially-correct` beside\n * its two siblings, but no rule anywhere ever painted it — so a partially-correct badge has been\n * an invisible 1em gap in every interaction, not just extended-text. This is repo-wide, and the\n * reason it went unnoticed is that partial credit needs a mapping to arise at all.\n */\n::part(correction-partially-correct) {\n background-color: var(--qti-partially-correct);\n mask: var(--qti-partial-mask) no-repeat center / contain;\n -webkit-mask: var(--qti-partial-mask) no-repeat center / contain;\n}\n\n/* A cloned interaction presents the answer key rather than a candidate judgement. What is left\n here is the part no interaction owns: any chip, anywhere. The text-entry and inline-choice\n halves moved into their own files — those name one interaction each, so they belong to it. */\n.full-correct-response :state(drag),\n.full-correct-response ::part(drag) {\n background-color: var(--qti-answer-bg);\n color: var(--qti-answer-fg);\n border-color: var(--qti-answer-border);\n}\n\n.full-correct-response :state(drag)::part(control)::before,\n.full-correct-response ::part(drag-control)::before {\n content: '';\n background-color: var(--qti-answer-fg);\n mask: var(--qti-check-mask) no-repeat center / contain;\n -webkit-mask: var(--qti-check-mask) no-repeat center / contain;\n}\n}\n@layer qti-components.elements{\n/* `display: block` is declared by the element itself, in qti-rubric-block.ts. */\nqti-rubric-block {\n border: var(--qti-border-thickness) solid var(--qti-info);\n background-color: color-mix(in srgb, var(--qti-info) 5%, white);\n border-radius: var(--qti-border-radius);\n padding: var(--qti-padding-box);\n margin-top: var(--qti-gap);\n}\n}\n@layer qti-components.elements{\nqti-feedback-inline::part(feedback) {\n}\n}\n@layer qti-components.elements{\nqti-feedback-block::part(feedback) {\n}\n}\n@layer qti-components.elements{\n/*\n * Neither selector below matches anything this repo renders — `qti-modal-feedback-custom` is not a\n * registered element and nothing sets `.custom-modal-feedback`. They are kept as a downstream\n * integration point rather than deleted from a published stylesheet.\n *\n * Their `display` declarations are gone: a host app that renders these owns their box. What is left\n * is paint and spacing.\n */\n.custom-modal-feedback {\n width: 100%;\n border: var(--qti-border-thickness) solid var(--qti-info);\n background-color: var(--qti-bg);\n border-radius: var(--qti-border-radius);\n padding: var(--qti-padding-box);\n margin-top: var(--qti-gap);\n}\n}\n@layer qti-components.global{\n/*\n * Cross-interaction custom states.\n *\n * These states are set by the base `Interaction` class rather than by any one interaction,\n * so they mean the same thing everywhere and are styled once here instead of being copied\n * into each interaction's stylesheet.\n *\n * Per-interaction states (`checked`, `radio`, `dragzone-active`, …) stay in their own files.\n *\n * The chip vocabulary used to live here too — one unscoped rule giving `@mixin drag` and `@mixin\n * grip` to every `:state(drag)` element and every floating clone. It is now declared once per\n * drag-drop interaction, in that interaction's own file (gap-match, order, associate, match), still\n * in this `global` layer so the cascade is unchanged.\n *\n * The move is what removed the exclusions. A universal claim (\"every drag is a chip\") needed a\n * carve-out for graphic-gap-match, whose chips are photographs sitting on a picture and must take\n * no card styling at all — written twice here as\n * `:where(:not(qti-graphic-gap-match-interaction *, [data-drag-interaction='…']))`, and mirrored a\n * third and fourth time in the Kennisnet overlay. Declared per interaction the rule is an opt-in:\n * graphic-gap-match simply never states one, and there is no exception to write down anywhere.\n */\n::part(message) {\n color: var(--qti-fg);\n background-color: color-mix(in srgb, var(--qti-warning) 5%, white);\n padding: var(--qti-padding-box);\n border: var(--qti-border-thickness) solid var(--qti-warning);\n border-radius: var(--qti-border-radius);\n margin-top: var(--qti-gap);\n}\n\n/*\n * The interaction is presenting the answer key rather than the candidate's own response.\n * Set on the interaction host by `Interaction.toggleInternalCorrectResponse`.\n *\n * Reaches the host wherever that base implementation runs, which is more than it looks: besides\n * `qti-extended-text-interaction`, both `ChoiceCorrectionMixin` and most per-interaction overrides\n * call `super`, so choice, hottext, select-point, slider, graphic-order and the rest set the host\n * state AND mark their individual choices with `correct-response` / `incorrect-response`.\n *\n * Three do not, and so never paint this outline: the drag-drop mixin replaces the implementation\n * outright, and the two inline interactions — text-entry and inline-choice — hand internal mode to\n * the full correct response, which presents the key in a sibling wrapper rather than on the host.\n *\n * The outline went unseen on hottext until its host stopped being an inline box (see the note in\n * qti-match-interaction.styles.ts) — an inline box whose children are all block has no area to\n * paint. If the double indication ever reads as too much, the fix is here or in the mixin, not\n * a display value.\n */\n:state(show-correct-response) {\n outline: var(--qti-border-thickness) dashed var(--qti-correct);\n outline-offset: 0.25rem;\n}\n}\n/* Item-shell structure (what is shown, what is hidden). Kept out of styles/qti-theme/ because it is\n structure rather than paint — that directory is where the no-layout-in-theme lint rule applies. */\n@layer qti-components.global{\n\n/**\n * Structural rules for the item shell itself — what is shown and what is hidden.\n *\n * Lives in a file of its own so it can be assigned a layer at its import (see index.css). Rules\n * written straight into item.css would be unlayered, and unlayered CSS outranks every layer,\n * including the `qti-extended` slot consumers are told to author in.\n */\n\n[view],\nqti-outcome-declaration,\nqti-response-declaration {\n display: none;\n}\n\n[view].show {\n display: block;\n}\n\n:host {\n box-sizing: border-box;\n}\n\nqti-test-part:not(:has(qti-assessment-item)),\nqti-assessment-section:not(:has(qti-assessment-item)),\nqti-assessment-item-ref:not(:has(qti-assessment-item)) {\n display: none;\n}\n\ndiv.full-correct-response-block {\n display: block;\n}\n\ndiv.full-correct-response-inline {\n display: inline-block;\n}\n}\n";var c$=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},cH,cQ,cG,cX,cK,cY=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,cG);iU(e,cH);iU(e,cQ);e.customElementRegistry=null,e.testURL=null,e.testDoc=null,e.testXML=null,e.qtiContext={QTI_CONTEXT:{testIdentifier:"",candidateIdentifier:"",environmentIdentifier:"default"}},ij(e,cH,null),ij(e,cQ,null);return e}d(t,[{key:"createRenderRoot",value:function e(){var e;var t=this.customElementRegistry;return ij(this,cQ,t),(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(k({},this.constructor.shadowRootOptions,t?{customElementRegistry:t}:{}))}},{key:"handleTestURLChange",value:function e(){return a(function(){var e,t,n,r,o,a,s,l,c,u;return z(this,function(d){switch(d.label){case 0:if(!this.testURL)return[3,7];d.label=1;case 1:d.trys.push([1,6,,7]);r=(n=this.qtiContext)===null||n===void 0?void 0:(t=n.QTI_CONTEXT)===null||t===void 0?void 0:t.seed;return[4,lf().load(this.testURL)];case 2:o=d.sent().shuffleOrdering(r),a=this.closest("qti-test");if(!(a===null||a===void 0?void 0:a.postLoadTestTransformCallback))return[3,5];l=o.htmlDoc((s=iL(this,cQ))!==null&&s!==void 0?s:void 0).querySelector("qti-assessment-test");c=l;if(!c)return[3,4];return[4,a.postLoadTestTransformCallback(o,l)];case 3:c=o=d.sent();d.label=4;case 4:c;d.label=5;case 5:this.testDoc=o.htmlDoc((e=iL(this,cQ))!==null&&e!==void 0?e:void 0);return[3,7];case 6:u=d.sent();console.error("Error loading or parsing XML:",u);return[3,7];case 7:return[2]}})}).call(this)}},{key:"handleTestXMLChange",value:function e(){if(this.testXML)try{var e;var t,n;var r=(n=this.qtiContext)===null||n===void 0?void 0:(t=n.QTI_CONTEXT)===null||t===void 0?void 0:t.seed;this.testDoc=lf().parse(this.testXML).shuffleOrdering(r).htmlDoc((e=iL(this,cQ))!==null&&e!==void 0?e:void 0)}catch(e){console.error("Error parsing XML:",e)}}},{key:"connectedCallback",value:function e(){var e=this;var n=this,r=function n(){return p(f(t.prototype),"connectedCallback",e)};return a(function(){return z(this,function(e){r().call(n),iz(this,cG,cX).call(this),iz(this,cG,cK).call(this),this.testURL&&this.handleTestURLChange(),this.testXML&&this.handleTestXMLChange();return[2]})}).call(this)}},{key:"render",value:function e(){return o5(eN(),iL(this,cH),cF(this.testDoc,o5(eM())))}}]);return t}(av);cH=new WeakMap,cQ=new WeakMap,cG=new WeakSet,cX=function e(){var e=this.querySelector("template");ij(this,cH,e?e.content:o5(eD()))},cK=function e(){var e=new CSSStyleSheet;e.replaceSync(cB),this.shadowRoot.adoptedStyleSheets=[e]};c$([n({attribute:!1})],cY.prototype,"customElementRegistry",void 0);c$([n({type:String,attribute:"test-url"})],cY.prototype,"testURL",void 0);c$([r()],cY.prototype,"testDoc",void 0);c$([r()],cY.prototype,"testXML",void 0);c$([r(),m({context:aH,subscribe:!0})],cY.prototype,"qtiContext",void 0);c$([O("testURL",{waitUntilFirstUpdate:!0})],cY.prototype,"handleTestURLChange",null);c$([O("testXML",{waitUntilFirstUpdate:!0})],cY.prototype,"handleTestXMLChange",null);var cJ=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t),e.addEventListener("click",function(){return e.dispatchEvent(new CustomEvent("test-end-attempt",{bubbles:!0}))});return e}d(t,[{key:"render",value:function e(){return o5(eL())}}]);return t}(av);cJ.styles=ob(eU(),cO,cM);var cZ=cJ;var c0=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},c1=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t),e.itemId=null,e.addEventListener("click",function(){return e._requestItem(e.itemId)});return e}d(t,[{key:"_requestItem",value:function e(e){this.dispatchEvent(new CustomEvent("qti-request-navigation",{composed:!0,bubbles:!0,detail:{type:"item",id:e}}))}},{key:"render",value:function e(){return o5(ej())}}]);return t}(av);c1.styles=ob(ez(),cO,cM);var c3=c1;c0([n({type:String,attribute:"item-id"})],c3.prototype,"itemId",void 0);var c2=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},c5="tts-element",c4="tts-word",c6=null;var c8=Symbol("tts-context"),c7,c9=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,c7,e.attachInternals());return e}d(t,[{key:"updated",value:function e(e){var t;e.has("_tts")&&(iL(this,c7).states.clear(),((t=this._tts)===null||t===void 0?void 0:t.state)&&iL(this,c7).states.add(this._tts.state))}}]);return t}(av);c7=new WeakMap,c9.styles=ob(eV());var ue=c9;c2([m({context:c8,subscribe:!0})],ue.prototype,"_tts",void 0);var ut,un,ur,ui,uo,ua,us,ul,uc,uu,ud,uh,up,uf,uv,ug,um,ub,uy,uw,uq,uk,ux,u_,uE,uC,uS,uR,uA,uT,uI=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t);iU(e,uh);iU(e,ut);iU(e,un);iU(e,ur);iU(e,ui);iU(e,uo);iU(e,ua);iU(e,us);iU(e,ul);iU(e,uc);iU(e,uu);iU(e,ud);e.language="nl-NL",ij(e,ut,e.attachInternals()),ij(e,un,new Map),ij(e,ur,iz(e,uh,up).bind(e)),ij(e,ui,null),ij(e,uo,null),ij(e,ua,0),ij(e,us,[]),ij(e,ul,new Highlight),ij(e,uc,new Highlight),ij(e,uu,void 0),ij(e,ud,function(){return iz(e,uh,uq).call(e)}),e._ttsContext={state:"idle",currentElementIndex:0,elementCount:0,play:function t(){return iz(e,uh,um).call(e)},pause:function t(){return iz(e,uh,uy).call(e)},resume:function t(){return iz(e,uh,uw).call(e)},stop:function t(){return iz(e,uh,uq).call(e)},prevElement:function t(){return iz(e,uh,uk).call(e)},nextElement:function t(){return iz(e,uh,ux).call(e)}};return e}d(t,[{key:"willUpdate",value:function e(e){}},{key:"updated",value:function e(e){var t;var n;var r=(t=(n=this._sessionContext)===null||n===void 0?void 0:n.navItemRefId)!==null&&t!==void 0?t:null;iL(this,uu)!==void 0&&iL(this,uu)!==r&&(iz(this,uh,uq).call(this),ij(this,uo,null),ij(this,ua,0),iz(this,uh,uv).call(this)),ij(this,uu,r)}},{key:"connectedCallback",value:function e(){var e,n;p(f(t.prototype),"connectedCallback",this).call(this),iz(this,uh,uf).call(this,"idle"),ij(this,ui,(e=(n=this.closest("test-navigation"))!==null&&n!==void 0?n:this.closest("qti-test"))!==null&&e!==void 0?e:this.getRootNode()),iL(this,ui).addEventListener("qti-assessment-item-connected",iL(this,ur)),iL(this,ui).addEventListener("qti-request-navigation",iL(this,ud))}},{key:"disconnectedCallback",value:function e(){var e,n;p(f(t.prototype),"disconnectedCallback",this).call(this),speechSynthesis.cancel(),iz(this,uh,uR).call(this),(e=iL(this,ui))===null||e===void 0?void 0:e.removeEventListener("qti-assessment-item-connected",iL(this,ur)),(n=iL(this,ui))===null||n===void 0?void 0:n.removeEventListener("qti-request-navigation",iL(this,ud)),ij(this,ui,null),iL(this,un).clear()}},{key:"render",value:function e(){return o5(eW())}}]);return t}(av);ut=new WeakMap,un=new WeakMap,ur=new WeakMap,ui=new WeakMap,uo=new WeakMap,ua=new WeakMap,us=new WeakMap,ul=new WeakMap,uc=new WeakMap,uu=new WeakMap,ud=new WeakMap,uh=new WeakSet,up=function e(e){var t=e.detail;(t===null||t===void 0?void 0:t.identifier)&&iL(this,un).set(t.identifier,t)},uf=function e(e){this._ttsContext=_(k({},this._ttsContext),{state:e}),iL(this,ut).states.delete("idle"),iL(this,ut).states.delete("playing"),iL(this,ut).states.delete("paused"),iL(this,ut).states.add(e)},uv=function e(){var e;var t;this._ttsContext=_(k({},this._ttsContext),{currentElementIndex:iL(this,ua),elementCount:(e=(t=iL(this,uo))===null||t===void 0?void 0:t.length)!==null&&e!==void 0?e:0})},ug=function e(){var e;if(iL(this,uo)!==null)return iL(this,uo);var t=(e=this._sessionContext)===null||e===void 0?void 0:e.navItemRefId;if(!t)return[];var n=iL(this,un).get(t);if(!n)return[];var r=n.querySelector("qti-item-body");return r?(ij(this,uo,Array.from(r.querySelectorAll("p, h1, h2, h3, h4, h5, h6, li, blockquote, figcaption")).filter(function(e){var t;return((t=e.textContent)!==null&&t!==void 0?t:"").trim().length>0})),iL(this,uo)):[]},um=function e(){if(!iz(this,uh,ug).call(this).length){console.warn("test-item-to-speech: no readable elements found in qti-item-body");return}iz(this,uh,ub).call(this,iL(this,ua))},ub=function(e){var t=this;var n;var r=(n=iL(this,uo))!==null&&n!==void 0?n:[];if(e>=r.length){iz(this,uh,uS).call(this),ij(this,ua,r.length-1),r.length>0&&iz(this,uh,uE).call(this,r[iL(this,ua)]),iz(this,uh,uf).call(this,"idle"),iz(this,uh,uv).call(this);return}ij(this,ua,e),iz(this,uh,uv).call(this);var o=r[e];o.scrollIntoView({behavior:"smooth",block:"nearest"}),iz(this,uh,uE).call(this,o),ij(this,us,iz(this,uh,u_).call(this,o));var a=iL(this,us).map(function(e){var t;return(t=e.textContent)!==null&&t!==void 0?t:""}).join("");if(!a.trim()){iz(this,uh,ub).call(this,e+1);return}var s=new SpeechSynthesisUtterance(a);s.lang=this.language,s.rate=1,s.onboundary=function(e){var n;e.name==="word"&&iz(t,uh,uC).call(t,e.charIndex,(n=e.charLength)!==null&&n!==void 0?n:0)},s.onend=function(){iz(t,uh,uS).call(t),iz(t,uh,ub).call(t,iL(t,ua)+1)},speechSynthesis.speak(s),iz(this,uh,uf).call(this,"playing")},uy=function e(){speechSynthesis.pause(),iz(this,uh,uf).call(this,"paused")},uw=function e(){speechSynthesis.resume(),iz(this,uh,uf).call(this,"playing")},uq=function e(){speechSynthesis.cancel(),iz(this,uh,uR).call(this),iz(this,uh,uf).call(this,"idle")},uk=function e(){var e=iz(this,uh,ug).call(this);if(!e.length)return;speechSynthesis.cancel(),iz(this,uh,uS).call(this),ij(this,ua,Math.max(0,iL(this,ua)-1)),iz(this,uh,uv).call(this);var t=e[iL(this,ua)];t.scrollIntoView({behavior:"smooth",block:"nearest"}),iz(this,uh,uE).call(this,t),iz(this,uh,uf).call(this,"idle")},ux=function e(){var e=iz(this,uh,ug).call(this);if(!e.length)return;speechSynthesis.cancel(),iz(this,uh,uS).call(this),ij(this,ua,Math.min(e.length-1,iL(this,ua)+1)),iz(this,uh,uv).call(this);var t=e[iL(this,ua)];t.scrollIntoView({behavior:"smooth",block:"nearest"}),iz(this,uh,uE).call(this,t),iz(this,uh,uf).call(this,"idle")},u_=function e(e){var t;var n=[],r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),o;for(;o=r.nextNode();)((t=o.textContent)!==null&&t!==void 0?t:"").length>0&&n.push(o);return n},uE=function e(e){if(!("highlights"in CSS))return;iz(this,uh,uT).call(this),iL(this,ul).clear();var t=new Range;t.selectNodeContents(e),iL(this,ul).add(t),CSS.highlights.set(c5,iL(this,ul))},uC=function e(e,t){if(!("highlights"in CSS))return;iz(this,uh,uT).call(this),iL(this,uc).clear();var n=iL(this,us).map(function(e){var t;return(t=e.textContent)!==null&&t!==void 0?t:""}).join(""),r=e+(t>0?t:iz(this,uh,uA).call(this,e,n)),o=0,a=null,s=0,l=null,c=0;var u=true,d=false,h=undefined;try{for(var p=iL(this,us)[Symbol.iterator](),f;!(u=(f=p.next()).done);u=true){var v=f.value;var g;var m;var b=(g=(m=v.textContent)===null||m===void 0?void 0:m.length)!==null&&g!==void 0?g:0;if(!a&&o+b>e&&(a=v,s=e-o),a&&o+b>=r){l=v,c=r-o;break}o+=b}}catch(e){d=true;h=e}finally{try{if(!u&&p.return!=null){p.return()}}finally{if(d){throw h}}}if(a&&l){var y=new Range;y.setStart(a,s),y.setEnd(l,c),iL(this,uc).add(y),CSS.highlights.set(c4,iL(this,uc))}},uS=function e(){"highlights"in CSS&&(iL(this,uc).clear(),CSS.highlights.delete(c4))},uR=function e(){"highlights"in CSS&&(iL(this,uc).clear(),CSS.highlights.delete(c4),iL(this,ul).clear(),CSS.highlights.delete(c5))},uA=function e(e,t){var n=t.slice(e).search(/\s/);return n<0?t.length-e:n},uT=function e(){var e;var t,n,r;if(!("highlights"in CSS))return;var o=rU();document.adoptedStyleSheets.includes(o)||(document.adoptedStyleSheets=N(document.adoptedStyleSheets).concat([o]));var a=(t=(e=(n=this.closest("test-navigation"))===null||n===void 0?void 0:n.querySelector("test-container"))!==null&&e!==void 0?e:(r=this.closest("qti-test"))===null||r===void 0?void 0:r.querySelector("test-container"))===null||t===void 0?void 0:t.shadowRoot;a&&!a.adoptedStyleSheets.includes(o)&&(a.adoptedStyleSheets=N(a.adoptedStyleSheets).concat([o]))};c2([n({type:String})],uI.prototype,"language",void 0);c2([m({context:aG,subscribe:!0})],uI.prototype,"_sessionContext",void 0);c2([r(),u({context:c8})],uI.prototype,"_ttsContext",void 0);var uP,uO,uM=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,uP);return e}d(t,[{key:"render",value:function e(){var e;var t=((e=this._tts)===null||e===void 0?void 0:e.state)==="playing";return o5(e$(),iz(this,uP,uO),t?o5(eF()):o5(eB()))}}]);return t}(ue);uP=new WeakSet,uO=function e(){this._tts&&(this._tts.state==="idle"?this._tts.play():this._tts.state==="playing"?this._tts.pause():this._tts.resume())};var uN=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"render",value:function e(){var e=this;var t;return o5(eH(),((t=this._tts)===null||t===void 0?void 0:t.state)!=="playing",function(){var t;return(t=e._tts)===null||t===void 0?void 0:t.pause()})}}]);return t}(ue),uD=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"render",value:function e(){var e=this;var t;return o5(eQ(),((t=this._tts)===null||t===void 0?void 0:t.state)!=="paused",function(){var t;return(t=e._tts)===null||t===void 0?void 0:t.resume()})}}]);return t}(ue),uL=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"render",value:function e(){var e=this;var t;return o5(eG(),((t=this._tts)===null||t===void 0?void 0:t.state)==="idle",function(){var t;return(t=e._tts)===null||t===void 0?void 0:t.stop()})}}]);return t}(ue),uU=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"render",value:function e(){var e=this;var t,n;var r,o;var a=((t=(r=this._tts)===null||r===void 0?void 0:r.currentElementIndex)!==null&&t!==void 0?t:0)===0,s=((n=(o=this._tts)===null||o===void 0?void 0:o.elementCount)!==null&&n!==void 0?n:0)===0;return o5(eX(),s||a,function(){var t;return(t=e._tts)===null||t===void 0?void 0:t.prevElement()})}}]);return t}(ue),uj=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"render",value:function e(){var e=this;var t,n,r,o;var a,s,l,c;var u=((t=(a=this._tts)===null||a===void 0?void 0:a.elementCount)!==null&&t!==void 0?t:0)>0&&((n=(s=this._tts)===null||s===void 0?void 0:s.currentElementIndex)!==null&&n!==void 0?n:0)>=((r=(l=this._tts)===null||l===void 0?void 0:l.elementCount)!==null&&r!==void 0?r:0)-1,d=((o=(c=this._tts)===null||c===void 0?void 0:c.elementCount)!==null&&o!==void 0?o:0)===0;return o5(eK(),d||u,function(){var t;return(t=e._tts)===null||t===void 0?void 0:t.nextElement()})}}]);return t}(ue);var uz=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},uV,uW,uF,uB,u$,uH,uQ,uG,uX=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t);iU(e,uW);iU(e,uV);e.identifier=void 0,e.initContext=[],e.qtiContext={QTI_CONTEXT:{testIdentifier:"",candidateIdentifier:"",environmentIdentifier:"default"}},e.configContext={},e.autoScoreItems=!1,e.addEventListener("qti-assessment-test-connected",iz(e,uW,uH).bind(e)),e.addEventListener("qti-assessment-item-connected",iz(e,uW,uG).bind(e)),e.addEventListener("qti-interaction-changed",iz(e,uW,u$).bind(e)),e.addEventListener("test-end-attempt",iz(e,uW,uF).bind(e)),e.addEventListener("test-update-outcome-variable",iz(e,uW,uB).bind(e));return e}d(t,[{key:"activeAssessmentItem",get:function e(){var e,t;if(!(!iL(this,uV)||!((e=this._sessionContext)===null||e===void 0?void 0:e.navItemRefId)))return(t=iL(this,uV).querySelector('qti-assessment-item-ref[identifier="'.concat(this._sessionContext.navItemRefId,'"]')))===null||t===void 0?void 0:t.assessmentItem}},{key:"render",value:function e(){return o5(eY())}},{key:"willUpdate",value:function e(e){var t=this;var n;if(!this.computedContext)return;var r=1;this.computedContext=_(k({},this.computedContext),{view:(n=this._sessionContext)===null||n===void 0?void 0:n.view,testParts:this.computedContext.testParts.map(function(e){var n;return _(k({},e),{active:((n=t._sessionContext)===null||n===void 0?void 0:n.navPartId)===e.identifier||!1,sections:e.sections.map(function(e){var n;return _(k({},e),{active:((n=t._sessionContext)===null||n===void 0?void 0:n.navSectionId)===e.identifier||!1,completed:e.items.every(function(e){var n;return((n=t._testContext.items.find(function(t){return t.identifier===e.identifier}))===null||n===void 0?void 0:n.variables.find(function(e){return e.identifier==="completionStatus"}).value)==="completed"}),items:e.items.map(function(e){var n,o,a,s,l,c,u,d,h,p,f,v,g,m;var b=(n=t._testContext)===null||n===void 0?void 0:n.items.find(function(t){return t.identifier===e.identifier}),y=k({},e,b,(o=t.initContext)===null||o===void 0?void 0:o.find(function(t){return t.identifier===e.identifier})),w=(s=y.variables)===null||s===void 0?void 0:(a=s.find(function(e){return e.identifier=="SCORE"}))===null||a===void 0?void 0:a.value,q=w==null?null:parseFloat(w===null||w===void 0?void 0:w.toString()),x=(c=y.variables)===null||c===void 0?void 0:(l=c.find(function(e){return e.identifier==="completionStatus"}))===null||l===void 0?void 0:l.value,E=((d=y.variables)===null||d===void 0?void 0:(u=d.find(function(e){return e.identifier==="RESPONSE"}))===null||u===void 0?void 0:u.value)||"",C=((p=y.variables)===null||p===void 0?void 0:(h=p.find(function(e){return e.identifier==="numAttempts"}))===null||h===void 0?void 0:h.value)||0,S=((f=t._sessionContext)===null||f===void 0?void 0:f.navItemRefId)===y.identifier||!1,R=e.categories.includes((v=t.configContext)===null||v===void 0?void 0:v.infoItemCategory)?null:r++,A=(m=e.variables)===null||m===void 0?void 0:(g=m.find(function(e){return e.identifier=="MAXSCORE"}))===null||g===void 0?void 0:g.value,T=A==null?null:parseFloat(A===null||A===void 0?void 0:A.toString());return _(k({},y),{completionStatus:x,numAttempts:C,score:q,response:E,index:R,active:S,maxScore:T})})})})})})}),this.dispatchEvent(new CustomEvent("qti-computed-context-updated",{detail:this.computedContext,bubbles:!0}))}}]);return t}(av);uV=new WeakMap,uW=new WeakSet,uF=function e(e){var t;var n=iL(this,uV).querySelector('qti-assessment-item-ref[identifier="'.concat(this._sessionContext.navItemRefId,'"]')).assessmentItem,r=((t=this.configContext)===null||t===void 0?void 0:t.reportValidityAfterScoring)===!0;n.processResponse(!0,r)},uB=function e(e){iL(this,uV).querySelector('qti-assessment-item-ref[identifier="'.concat(e.detail.assessmentItemRefId,'"]')).assessmentItem.setOutcomeVariable(e.detail.outcomeVariableId,e.detail.value)},u$=function e(e){if(this.autoScoreItems){var t=e.composedPath()[0].closest("qti-assessment-item"),n=t.variables.find(function(e){return e.identifier==="SCORE"});if(n&&n.externalScored===null&&t.adaptive==="false"){var r;var o=((r=this.configContext)===null||r===void 0?void 0:r.reportValidityAfterScoring)===!0;t.processResponse(!0,o)}}},uH=function e(e){var t=this;var n,r,o;if(ij(this,uV,e.detail),!((n=this.qtiContext.QTI_CONTEXT)===null||n===void 0?void 0:n.testIdentifier)){var a=this.qtiContext.QTI_CONTEXT||{testIdentifier:"",candidateIdentifier:"not set",environmentIdentifier:"default"};this.qtiContext={QTI_CONTEXT:_(k({},a),{testIdentifier:iL(this,uV).identifier,environmentIdentifier:a.environmentIdentifier||"default"})}}iL(this,uV).querySelectorAll('qti-context-declaration[identifier="QTI_CONTEXT"]').forEach(function(e){var n=iz(t,uW,uQ).call(t,e);Object.keys(n).length>0&&(t.qtiContext={QTI_CONTEXT:k({},n,t.qtiContext.QTI_CONTEXT)})});var s=Array.from(((r=iL(this,uV))===null||r===void 0?void 0:r.querySelectorAll("qti-test-part"))||[]);this.computedContext={identifier:iL(this,uV).identifier,title:iL(this,uV).title,view:(o=this._sessionContext)===null||o===void 0?void 0:o.view,testParts:s.map(function(e){var n=N(e.querySelectorAll("qti-assessment-section"));return{active:!1,identifier:e.identifier,navigationMode:e.navigationMode,submissionMode:e.submissionMode,sections:n.map(function(e){var n=N(e.querySelectorAll("qti-assessment-item-ref"));return{active:!1,identifier:e.identifier,title:e.title,items:n.map(function(e){var n,r;return _(k({},(n=t.initContext)===null||n===void 0?void 0:n.find(function(t){return t.identifier===e.identifier})),{active:!1,identifier:e.identifier,categories:e.category?(r=e.category)===null||r===void 0?void 0:r.split(" "):[],href:e.href,variables:[]})})}})}})}},uQ=function e(e){var t={},n=e.querySelector("qti-default-value");return n&&n.querySelectorAll("qti-value[field-identifier]").forEach(function(e){var n;var r=e.getAttribute("field-identifier"),o=e.getAttribute("base-type")||"string",a=((n=e.textContent)===null||n===void 0?void 0:n.trim())||"";if(r){var s=a;switch(o){case"integer":s=parseInt(a,10);break;case"float":case"duration":s=parseFloat(a);break;case"boolean":s=a.toLowerCase()==="true";break;default:s=a;break}t[r]=s}}),t},uG=function e(e){var t=e.detail;this.computedContext=_(k({},this.computedContext),{testParts:this.computedContext.testParts.map(function(e){return _(k({},e),{sections:e.sections.map(function(e){return _(k({},e),{items:e.items.map(function(e){var n;if(e.identifier!==t.parentElement.getAttribute("identifier"))return e;var r=(n=t.querySelector("qti-outcome-declaration[identifier='SCORE']"))===null||n===void 0?void 0:n.getAttribute("externalScored"),o=t.querySelectorAll("qti-response-declaration"),a=Array.from(o).some(function(e){return e.querySelector("qti-correct-response")}),s=Array.from(o).some(function(e){var t=e.querySelector("qti-mapping"),n=e.querySelector("qti-area-mapping");return(t===null||t===void 0?void 0:t.querySelector("qti-map-entry"))||(n===null||n===void 0?void 0:n.querySelector("qti-area-map-entry"))}),l=a||s,c=!!t.querySelector("qti-response-processing");return _(k({},e),{assessmentItemIdentifier:t.getAttribute("identifier"),label:t.getAttribute("label"),title:t.title,externalScored:r,adaptive:t.adaptive=="true"||!1,timeDependent:t.timeDependent=="true"||!1,variables:t.variables,hasCorrectResponse:l,hasResponseProcessing:c})})})})})})})};uz([n({type:String})],uX.prototype,"identifier",void 0);uz([r()],uX.prototype,"initContext",void 0);uz([r(),u({context:aH})],uX.prototype,"qtiContext",void 0);uz([r(),m({context:aj,subscribe:!0})],uX.prototype,"configContext",void 0);uz([r(),m({context:aK,subscribe:!0})],uX.prototype,"_testContext",void 0);uz([r(),m({context:aG,subscribe:!0})],uX.prototype,"_sessionContext",void 0);uz([r(),u({context:aU})],uX.prototype,"computedContext",void 0);uz([n({type:Boolean,attribute:"auto-score-items"})],uX.prototype,"autoScoreItems",void 0);var uK=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},uY,uJ=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t);iU(e,uY);e._internalDisabled=!0,ij(e,uY,e.attachInternals()),iL(e,uY).role="button",iL(e,uY).ariaLabel="Next item",e.addEventListener("click",function(t){t.preventDefault(),e._internalDisabled||e._requestItem(e.sectionItems[e.itemIndex+1].identifier)});return e}d(t,[{key:"_handleTestElementChange",value:function e(e,t){t&&(this._internalDisabled=!1)}},{key:"connectedCallback",value:function e(){p(f(t.prototype),"connectedCallback",this).call(this),this.checkDisabled()}},{key:"willUpdate",value:function e(e){var t;if(!this.computedContext)return;var n=(t=this.computedContext)===null||t===void 0?void 0:t.testParts.find(function(e){return e.active});n&&(this.sectionItems=n.sections.flatMap(function(e){return e.items}),this.itemIndex=this.sectionItems.findIndex(function(e){return e.active}),this.checkDisabled())}},{key:"checkDisabled",value:function e(){var e;this._internalDisabled=!this.computedContext||this.itemIndex<0||this.itemIndex>=((e=this.sectionItems)===null||e===void 0?void 0:e.length)-1}},{key:"_requestItem",value:function e(e){this.dispatchEvent(new CustomEvent("qti-request-navigation",{composed:!0,bubbles:!0,detail:{type:"item",id:e}}))}},{key:"render",value:function e(){return o5(eJ())}}]);return t}(av);uY=new WeakMap,uJ.styles=ob(eZ(),cO,cM);var uZ=uJ;uK([n({type:Boolean,reflect:!0,attribute:"disabled"})],uZ.prototype,"_internalDisabled",void 0);uK([m({context:aU,subscribe:!0})],uZ.prototype,"computedContext",void 0);uK([O("computedContext")],uZ.prototype,"_handleTestElementChange",null);var u0=["this"],u1=["+","-","!"],u3=["=","+","-","*","/","%","^","==","!=",">","<",">=","<=","||","&&","??","&","===","!==","|","|>"],u2={"!":0,":":0,",":0,")":0,"]":0,"}":0,"|>":1,"?":2,"??":3,"||":4,"&&":5,"|":6,"^":7,"&":8,"!=":9,"==":9,"!==":9,"===":9,">=":10,">":10,"<=":10,"<":10,"+":11,"-":11,"%":12,"/":12,"*":12,"(":13,"[":13,".":13,"{":13},u5=13;var u4=["==","!=","<=",">=","||","&&","??","|>"],u6=["===","!=="],u8;(function(e){e[e.STRING=1]="STRING",e[e.IDENTIFIER=2]="IDENTIFIER",e[e.DOT=3]="DOT",e[e.COMMA=4]="COMMA",e[e.COLON=5]="COLON",e[e.INTEGER=6]="INTEGER",e[e.DECIMAL=7]="DECIMAL",e[e.OPERATOR=8]="OPERATOR",e[e.GROUPER=9]="GROUPER",e[e.KEYWORD=10]="KEYWORD",e[e.ARROW=11]="ARROW"})(u8||(u8={}));var u7=function e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return{kind:e,value:t,precedence:n}},u9=function e(e){return e===9||e===10||e===13||e===32},de=function e(e){return e===95||e===36||(e&=-33,65<=e&&e<=90)},dt=function e(e){return de(e)||di(e)},dn=function e(e){return u0.indexOf(e)!==-1},dr=function e(e){return e===34||e===39},di=function e(e){return 48<=e&&e<=57},da=function e(e){return e===43||e===45||e===42||e===47||e===33||e===38||e===37||e===60||e===61||e===62||e===63||e===94||e===124},ds=function e(e){return e===40||e===41||e===91||e===93||e===123||e===125},dl=function e(e){return e.replace(/\\(.)/g,function(e,t){switch(t){case"n":return"\n";case"r":return"\r";case"t":return" ";case"b":return"\b";case"f":return"\f";default:return t}})},dc,du,dd,dh,dp,df,dv,dg,dm,db,dy,dw,dq,dk,dx,d_,dE,dC=/*#__PURE__*/function(){"use strict";function e(t){l(this,e);iU(this,dp);iU(this,dc);iU(this,du,-1);iU(this,dd,0);iU(this,dh);ij(this,dc,t),iz(this,dp,df).call(this)}d(e,[{key:"nextToken",value:function e(){for(;u9(iL(this,dh));)iz(this,dp,df).call(this,!0);if(dr(iL(this,dh)))return iz(this,dp,dm).call(this);if(de(iL(this,dh)))return iz(this,dp,db).call(this);if(di(iL(this,dh)))return iz(this,dp,dy).call(this);if(iL(this,dh)===46)return iz(this,dp,dw).call(this);if(iL(this,dh)===44)return iz(this,dp,dq).call(this);if(iL(this,dh)===58)return iz(this,dp,dk).call(this);if(da(iL(this,dh)))return iz(this,dp,d_).call(this);if(ds(iL(this,dh)))return iz(this,dp,dE).call(this);if(iz(this,dp,df).call(this),iL(this,dh)!==void 0)throw new Error("Expected end of input, got ".concat(iL(this,dh)))}}]);return e}();dc=new WeakMap,du=new WeakMap,dd=new WeakMap,dh=new WeakMap,dp=new WeakSet,df=function e(e){iV(this,du)._++,iL(this,du)<iL(this,dc).length?(ij(this,dh,iL(this,dc).charCodeAt(iL(this,du))),e===!0&&ij(this,dd,iL(this,du))):ij(this,dh,void 0)},dv=function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;var t=iL(this,dc).substring(iL(this,dd),iL(this,du)+e);return e===0&&iz(this,dp,dg).call(this),t},dg=function e(){ij(this,dd,iL(this,du))},dm=function e(){var e="unterminated string",t=iL(this,dh);for(iz(this,dp,df).call(this,!0);iL(this,dh)!==t;){if(iL(this,dh)===void 0)throw new Error(e);if(iL(this,dh)===92&&(iz(this,dp,df).call(this),iL(this,dh)===void 0))throw new Error(e);iz(this,dp,df).call(this)}var n=u7(u8.STRING,dl(iz(this,dp,dv).call(this)));return iz(this,dp,df).call(this),n},db=function e(){do iz(this,dp,df).call(this);while(dt(iL(this,dh)));var e=iz(this,dp,dv).call(this),t=dn(e)?u8.KEYWORD:u8.IDENTIFIER;return u7(t,e)},dy=function e(){do iz(this,dp,df).call(this);while(di(iL(this,dh)));return iL(this,dh)===46?iz(this,dp,dw).call(this):u7(u8.INTEGER,iz(this,dp,dv).call(this))},dw=function e(){return iz(this,dp,df).call(this),di(iL(this,dh))?iz(this,dp,dx).call(this):(iz(this,dp,dg).call(this),u7(u8.DOT,".",u5))},dq=function e(){return iz(this,dp,df).call(this,!0),u7(u8.COMMA,",")},dk=function e(){return iz(this,dp,df).call(this,!0),u7(u8.COLON,":")},dx=function e(){do iz(this,dp,df).call(this);while(di(iL(this,dh)));return u7(u8.DECIMAL,iz(this,dp,dv).call(this))},d_=function e(){iz(this,dp,df).call(this);var e=iz(this,dp,dv).call(this,2);if(u6.indexOf(e)!==-1)iz(this,dp,df).call(this),iz(this,dp,df).call(this);else{if(e=iz(this,dp,dv).call(this,1),e==="=>")return iz(this,dp,df).call(this),u7(u8.ARROW,e);u4.indexOf(e)!==-1&&iz(this,dp,df).call(this)}return e=iz(this,dp,dv).call(this),u7(u8.OPERATOR,e,u2[e])},dE=function e(){var e=String.fromCharCode(iL(this,dh)),t=u7(u8.GROUPER,e,u2[e]);return iz(this,dp,df).call(this,!0),t};var dS=function e(e,t){return new dJ(e,t).parse()},dR,dA,dT,dI,dP,dO,dM,dN,dD,dL,dU,dj,dz,dV,dW,dF,dB,d$,dH,dQ,dG,dX,dK,dY,dJ=/*#__PURE__*/function(){"use strict";function e(t,n){l(this,e);iU(this,dO);iU(this,dR);iU(this,dA);iU(this,dT);iU(this,dI);iU(this,dP);ij(this,dA,new dC(t)),ij(this,dT,n)}d(e,[{key:"parse",value:function e(){return iz(this,dO,dM).call(this),iz(this,dO,dN).call(this)}},{key:"_matches",value:function e(e,t){return!(e&&iL(this,dR)!==e||t&&iL(this,dP)!==t)}}]);return e}();dR=new WeakMap,dA=new WeakMap,dT=new WeakMap,dI=new WeakMap,dP=new WeakMap,dO=new WeakSet,dM=function e(e,t){var n,r;if(!this._matches(e,t))throw new Error("Expected kind ".concat(e," (").concat(t,"), was ").concat((n=iL(this,dI))===null||n===void 0?void 0:n.kind," (").concat((r=iL(this,dI))===null||r===void 0?void 0:r.value,")"));var o=iL(this,dA).nextToken();ij(this,dI,o),ij(this,dR,o===null||o===void 0?void 0:o.kind),ij(this,dP,o===null||o===void 0?void 0:o.value)},dN=function e(){if(!iL(this,dI))return iL(this,dT).empty();var e=iz(this,dO,dj).call(this);return e===void 0?void 0:iz(this,dO,dD).call(this,e,0)},dD=function e(e,t){if(e===void 0)throw new Error("Expected left to be defined.");for(;iL(this,dI);)if(this._matches(u8.GROUPER,"(")){var n=iz(this,dO,dH).call(this);e=iL(this,dT).invoke(e,void 0,n)}else if(this._matches(u8.GROUPER,"[")){var r=iz(this,dO,dQ).call(this);e=iL(this,dT).index(e,r)}else if(this._matches(u8.DOT)){iz(this,dO,dM).call(this);var o=iz(this,dO,dj).call(this);e=iz(this,dO,dL).call(this,e,o)}else{if(this._matches(u8.KEYWORD))break;if(this._matches(u8.OPERATOR)&&iL(this,dI).precedence>=t)e=iL(this,dP)==="?"?iz(this,dO,dz).call(this,e):iz(this,dO,dU).call(this,e,iL(this,dI));else break}return e},dL=function e(e,t){if(t===void 0)throw new Error("expected identifier");if(t.type==="ID")return iL(this,dT).getter(e,t.value);if(t.type==="Invoke"&&t.receiver.type==="ID"){var n=t.receiver;return iL(this,dT).invoke(e,n.value,t.arguments)}else throw new Error("expected identifier: ".concat(t))},dU=function e(e,t){if(u3.indexOf(t.value)===-1)throw new Error("unknown operator: ".concat(t.value));iz(this,dO,dM).call(this);var n=iz(this,dO,dj).call(this);for(;(iL(this,dR)===u8.OPERATOR||iL(this,dR)===u8.DOT||iL(this,dR)===u8.GROUPER)&&iL(this,dI).precedence>t.precedence;)n=iz(this,dO,dD).call(this,n,iL(this,dI).precedence);return iL(this,dT).binary(e,t.value,n)},dj=function e(){if(this._matches(u8.OPERATOR)){var e=iL(this,dP);if(iz(this,dO,dM).call(this),e==="+"||e==="-"){if(this._matches(u8.INTEGER))return iz(this,dO,dK).call(this,e);if(this._matches(u8.DECIMAL))return iz(this,dO,dY).call(this,e)}if(u1.indexOf(e)===-1)throw new Error("unexpected token: ".concat(e));var t=iz(this,dO,dD).call(this,iz(this,dO,dV).call(this),u5);return iL(this,dT).unary(e,t)}return iz(this,dO,dV).call(this)},dz=function e(e){iz(this,dO,dM).call(this,u8.OPERATOR,"?");var t=iz(this,dO,dN).call(this);iz(this,dO,dM).call(this,u8.COLON);var n=iz(this,dO,dN).call(this);return iL(this,dT).ternary(e,t,n)},dV=function e(){switch(iL(this,dR)){case u8.KEYWORD:var e=iL(this,dP);if(e==="this")return iz(this,dO,dM).call(this),iL(this,dT).id(e);throw u0.indexOf(e)!==-1?new Error("unexpected keyword: ".concat(e)):new Error("unrecognized keyword: ".concat(e));case u8.IDENTIFIER:return iz(this,dO,dB).call(this);case u8.STRING:return iz(this,dO,dX).call(this);case u8.INTEGER:return iz(this,dO,dK).call(this);case u8.DECIMAL:return iz(this,dO,dY).call(this);case u8.GROUPER:return iL(this,dP)==="("?iz(this,dO,dG).call(this):iL(this,dP)==="{"?iz(this,dO,dF).call(this):iL(this,dP)==="["?iz(this,dO,dW).call(this):void 0;case u8.COLON:throw new Error('unexpected token ":"');default:return}},dW=function e(){var e=[];do{if(iz(this,dO,dM).call(this),this._matches(u8.GROUPER,"]"))break;e.push(iz(this,dO,dN).call(this))}while(this._matches(u8.COMMA));return iz(this,dO,dM).call(this,u8.GROUPER,"]"),iL(this,dT).list(e)},dF=function e(){var e={};do{if(iz(this,dO,dM).call(this),this._matches(u8.GROUPER,"}"))break;var t=iL(this,dP);(this._matches(u8.STRING)||this._matches(u8.IDENTIFIER))&&iz(this,dO,dM).call(this),iz(this,dO,dM).call(this,u8.COLON),e[t]=iz(this,dO,dN).call(this)}while(this._matches(u8.COMMA));return iz(this,dO,dM).call(this,u8.GROUPER,"}"),iL(this,dT).map(e)},dB=function e(){var e=iL(this,dP);if(e==="true")return iz(this,dO,dM).call(this),iL(this,dT).literal(!0);if(e==="false")return iz(this,dO,dM).call(this),iL(this,dT).literal(!1);if(e==="null")return iz(this,dO,dM).call(this),iL(this,dT).literal(null);if(e==="undefined")return iz(this,dO,dM).call(this),iL(this,dT).literal(void 0);var t=iz(this,dO,d$).call(this),n=iz(this,dO,dH).call(this);return n?iL(this,dT).invoke(t,void 0,n):t},d$=function e(){if(!this._matches(u8.IDENTIFIER))throw new Error("expected identifier: ".concat(iL(this,dP)));var e=iL(this,dP);return iz(this,dO,dM).call(this),iL(this,dT).id(e)},dH=function e(){if(!this._matches(u8.GROUPER,"("))return;var e=[];do{if(iz(this,dO,dM).call(this),this._matches(u8.GROUPER,")"))break;var t=iz(this,dO,dN).call(this);e.push(t)}while(this._matches(u8.COMMA));return iz(this,dO,dM).call(this,u8.GROUPER,")"),e},dQ=function e(){iz(this,dO,dM).call(this);var e=iz(this,dO,dN).call(this);return iz(this,dO,dM).call(this,u8.GROUPER,"]"),e},dG=function e(){var e=iz(this,dO,dH).call(this);if(this._matches(u8.ARROW)){var t;iz(this,dO,dM).call(this);var n=iz(this,dO,dN).call(this),r=(t=e===null||e===void 0?void 0:e.map(function(e){return e.value}))!==null&&t!==void 0?t:[];return iL(this,dT).arrowFunction(r,n)}else return iL(this,dT).paren(e[0])},dX=function e(){var e=iL(this,dT).literal(iL(this,dP));return iz(this,dO,dM).call(this),e},dK=function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";var t=iL(this,dT).literal(parseInt("".concat(e).concat(iL(this,dP)),10));return iz(this,dO,dM).call(this),t},dY=function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";var t=iL(this,dT).literal(parseFloat("".concat(e).concat(iL(this,dP))));return iz(this,dO,dM).call(this),t};var dZ=Object.hasOwn,d0=Object.fromEntries,d1={"+":function(e,t){return e+t},"-":function(e,t){return e-t},"*":function(e,t){return e*t},"/":function(e,t){return e/t},"%":function(e,t){return e%t},"==":function(e,t){return e==t},"!=":function(e,t){return e!=t},"===":function(e,t){return e===t},"!==":function(e,t){return e!==t},">":function(e,t){return e>t},">=":function(e,t){return e>=t},"<":function(e,t){return e<t},"<=":function(e,t){return e<=t},"||":function(e,t){return e||t},"&&":function(e,t){return e&&t},"??":function(e,t){return e!==null&&e!==void 0?e:t},"|":function(e,t){return t(e)},"|>":function(e,t){return t(e)}},d3={"+":function(e){return e},"-":function(e){return-e},"!":function(e){return!e}},d2=/*#__PURE__*/function(){"use strict";function e(){l(this,e)}d(e,[{key:"empty",value:function e(){return{type:"Empty",evaluate:function e(e){return e},getIds:function e(e){return e}}}},{key:"literal",value:function e(e){return{type:"Literal",value:e,evaluate:function e(e){return this.value},getIds:function e(e){return e}}}},{key:"id",value:function e(e){return{type:"ID",value:e,evaluate:function e(e){return this.value==="this"?e:e===null||e===void 0?void 0:e[this.value]},getIds:function e(e){return e.push(this.value),e}}}},{key:"unary",value:function e(e,t){var n=d3[e];return{type:"Unary",operator:e,child:t,evaluate:function e(e){return n(this.child.evaluate(e))},getIds:function e(e){return this.child.getIds(e)}}}},{key:"binary",value:function e(e,t,n){var r=d1[t];return{type:"Binary",operator:t,left:e,right:n,evaluate:function e(e){if(this.operator==="="){if(this.left.type!=="ID"&&this.left.type!=="Getter"&&this.left.type!=="Index")throw new Error("Invalid assignment target: ".concat(this.left));var t=this.right.evaluate(e),n,o;return this.left.type==="Getter"?(n=this.left.receiver.evaluate(e),o=this.left.name):this.left.type==="Index"?(n=this.left.receiver.evaluate(e),o=this.left.argument.evaluate(e)):this.left.type==="ID"&&(n=e,o=this.left.value),n===void 0?void 0:n[o]=t}return r(this.left.evaluate(e),this.right.evaluate(e))},getIds:function e(e){return this.left.getIds(e),this.right.getIds(e),e}}}},{key:"getter",value:function e(e,t){return{type:"Getter",receiver:e,name:t,evaluate:function e(e){var t;return(t=this.receiver.evaluate(e))===null||t===void 0?void 0:t[this.name]},getIds:function e(e){return this.receiver.getIds(e),e}}}},{key:"invoke",value:function e(e,t,n){if(t!=null&&typeof t!="string")throw new Error("method not a string");return{type:"Invoke",receiver:e,method:t,arguments:n,evaluate:function e(e){var n,r;var o;var a=this.receiver.evaluate(e),s=this.method?a:(n=e===null||e===void 0?void 0:e.this)!==null&&n!==void 0?n:e,l=this.method?a===null||a===void 0?void 0:a[t]:a,c=((r=this.arguments)!==null&&r!==void 0?r:[]).map(function(t){return t===null||t===void 0?void 0:t.evaluate(e)});return l===null||l===void 0?void 0:(o=l.apply)===null||o===void 0?void 0:o.call(l,s,c)},getIds:function e(e){var t;return this.receiver.getIds(e),(t=this.arguments)===null||t===void 0?void 0:t.forEach(function(t){return t===null||t===void 0?void 0:t.getIds(e)}),e}}}},{key:"paren",value:function e(e){return e}},{key:"index",value:function e(e,t){return{type:"Index",receiver:e,argument:t,evaluate:function e(e){var t;return(t=this.receiver.evaluate(e))===null||t===void 0?void 0:t[this.argument.evaluate(e)]},getIds:function e(e){return this.receiver.getIds(e),e}}}},{key:"ternary",value:function e(e,t,n){return{type:"Ternary",condition:e,trueExpr:t,falseExpr:n,evaluate:function e(e){return this.condition.evaluate(e)?this.trueExpr.evaluate(e):this.falseExpr.evaluate(e)},getIds:function e(e){return this.condition.getIds(e),this.trueExpr.getIds(e),this.falseExpr.getIds(e),e}}}},{key:"map",value:function e(e){return{type:"Map",entries:e,evaluate:function t(t){var n={};if(e&&this.entries)for(var r in e){var o=this.entries[r];o&&(n[r]=o.evaluate(t))}return n},getIds:function t(t){if(e&&this.entries)for(var n in e){var r=this.entries[n];r&&r.getIds(t)}return t}}}},{key:"list",value:function e(e){return{type:"List",items:e,evaluate:function e(e){var t;return(t=this.items)===null||t===void 0?void 0:t.map(function(t){return t===null||t===void 0?void 0:t.evaluate(e)})},getIds:function e(e){var t;return(t=this.items)===null||t===void 0?void 0:t.forEach(function(t){return t===null||t===void 0?void 0:t.getIds(e)}),e}}}},{key:"arrowFunction",value:function e(e,t){return{type:"ArrowFunction",params:e,body:t,evaluate:function e(e){var t=this.params,n=this.body;return function(){for(var r=arguments.length,o=new Array(r),a=0;a<r;a++){o[a]=arguments[a]}var s=d0(t.map(function(e,t){return[e,o[t]]})),l=new Proxy(e!==null&&e!==void 0?e:{},{set:function e(e,t,n){return dZ(s,t)&&(s[t]=n),e[t]=n},get:function e(e,t){return dZ(s,t)?s[t]:e[t]}});return n.evaluate(l)}},getIds:function e(e){var t=this;return this.body.getIds(e).filter(function(e){return!t.params.includes(e)})}}}}]);return e}();var d5=null,d4={boundAttributeSuffix:ad.M,marker:ad.P,markerMatch:ad.A,HTML_RESULT:ad.C,getTemplateHtml:ad.L,overrideDirectiveResolve:function e(e,t){var n=/*#__PURE__*/function(e){"use strict";v(n,e);function n(){l(this,n);return s(this,n,arguments)}d(n,[{key:"_$AS",value:function e(e,n){return t(this,n)}}]);return n}(e);return n},patchDirectiveResolve:function e(e,t){if(e.prototype._$AS.name!==t.name){d5!==null&&d5!==void 0?d5:d5=e.prototype._$AS.name;for(var n=e.prototype;n!==Object.prototype;n=Object.getPrototypeOf(n))if(n.hasOwnProperty(d5))return void(n[d5]=t);throw Error("Internal error: It is possible that both dev mode and production mode Lit was mixed together during SSR. Please comment on the issue: https://github.com/lit/lit/issues/4527")}},setDirectiveClass:function e(e,t){e._$litDirective$=t},getAttributePartCommittedValue:function e(e,t,n){var r=o8;return e.j=function(e){return r=e},e._$AI(t,e,n),r},connectedDisconnectable:function e(e){return _(k({},e),{_$AU:!0})},resolveDirective:ad.V,AttributePart:ad.H,PropertyPart:ad.B,BooleanAttributePart:ad.N,EventPart:ad.U,ElementPart:ad.F,TemplateInstance:ad.R,isIterable:ad.D,ChildPart:ad.I};var d6=d4.AttributePart,d8=d4.PropertyPart,d7=d4.BooleanAttributePart,d9=d4.EventPart,he=new d2,ht=new Map,hn=function e(e){return e.replace(/-(-|\w)/g,function(e,t){return t.toUpperCase()})},hr=function e(e,t){var n=ht.get(e);if(n===void 0){if(ht.has(e))return;if(e=e.trim(),e.startsWith("{{")&&e.endsWith("}}")){var r=e.substring(2,e.length-2).trim();n=new dJ(r,he).parse(),ht.set(e,n)}}return n===null||n===void 0?void 0:n.evaluate(t)},hi=function e(e,t,n,r){var o=e.getAttribute("if");if(o!==null&&hr(o,t))return hd(e,t,n,r)},ho=RegExp("(?<!\\\\){{(.*?)(?:(?<!\\\\)}})","g"),ha=function e(e){return/(?:\\{{)|(?:\\}})/g.test(e)},hs=function e(e){return e.replaceAll(/\\{{/g,"{{").replace(/\\}}/g,"}}")},hl=function e(e,t,n,r){var o=e.getAttribute("repeat");if(o!==null){var a=hr(o,t);if(!a[Symbol.iterator])return o7;var s=hp(e),l=-1,c=[];var u=true,d=false,h=undefined;try{for(var p=a[Symbol.iterator](),f;!(u=(f=p.next()).done);u=true){var v=f.value;var g;l++;var m=Object.create(t);m.item=v,m.index=l,m.this=(g=t.this)!==null&&g!==void 0?g:t;var b=[];var y=true,w=false,q=undefined;try{for(var k=s.parts[Symbol.iterator](),x;!(y=(x=k.next()).done);y=true){var _=x.value;var E;var C=_.update(m,n,r);_.type===1?(E=b).push.apply(E,N(C)):b.push(C)}}catch(e){w=true;q=e}finally{try{if(!y&&k.return!=null){k.return()}}finally{if(w){throw q}}}var S={_$litType$:s,values:b};c.push(S)}}catch(e){d=true;h=e}finally{try{if(!u&&p.return!=null){p.return()}}finally{if(d){throw h}}}return c}},hc={if:hi,repeat:hl},hu=function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:hc,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;var o=hp(e).renderers;if(r){var a=hp(r).renderers,s=o.super;s!==void 0?n=_(k({},o,n),{super:function e(e,t,n){return n=_(k({},a,n),{super:function e(e,t,n){return hd(r,e,t,n)}}),s(e,t,n)}}):(n=k({},a,o,n),e=r)}else n=k({},o,n);return function(r){return hd(e,r,t,n)}};var hd=function e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:hc,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};var o=hp(e),a=[];var s=true,l=false,c=undefined;try{for(var u=o.parts[Symbol.iterator](),d;!(s=(d=u.next()).done);s=true){var h=d.value;var p;var f=h.update(t,n,r);h.type===1?(p=a).push.apply(p,N(f)):a.push(f)}}catch(e){l=true;c=e}finally{try{if(!s&&u.return!=null){u.return()}}finally{if(l){throw c}}}return{_$litType$:o,values:a}},hh=new Map,hp=function e(e){var t=hh.get(e);return t===void 0&&hh.set(e,t=hf(e)),t},hf=function e(e){var t=function(){if(o.nodeType===Node.COMMENT_NODE)a++;else if(o.nodeType===Node.ELEMENT_NODE){a++;var e=o;if(e.tagName==="TEMPLATE"){var t=e.getAttribute("type"),l=e.getAttribute("name"),c=e.getAttribute("call");if(c!==null||t!==null||l!==null){e.parentNode.insertBefore(document.createComment(""),e),s.push(e);var u=void 0;if(c!==null){var d=c.trim(),h=d.startsWith("{{")&&d.endsWith("}}");u=function t(t,n,r){var o;var a=e.getAttribute("data"),s=a===null?void 0:hr(a,t);return(o=h?hr(d,t):r[c])===null||o===void 0?void 0:o(s,n,r)}}else t!==null?u=function n(n,r,o){var a=r[t];return a===null||a===void 0?void 0:a(e,n,r,o)}:(l==="super"?n.renderers.super=function(t,n,r){var o=r.super,a=hp(e);return r=k({},r,a.renderers),o(t,n,r)}:n.renderers[l]=function(t,n,r){return hd(e,t,n,r)},u=function e(e,t,n){var r=n[l];return r===null||r===void 0?void 0:r(e,t,n)});n.parts.push({type:2,index:a,update:u});return"continue"}}var p=e.getAttributeNames();var f=true,v=false,g=undefined;try{var m=function(){var t=y.value;var r=e.getAttribute(t),o=r.split(ho);if(o.length===1){ha(r)&&e.setAttribute(t,hs(r));return"continue"}e.removeAttribute(t);var s=t,l=d6,c=t[0];c==="."?(s=hn(t.substring(1)),l=d8):c==="?"?(s=t.substring(1),l=d7):c==="@"&&(s=hn(t.substring(1)),l=d9);var u=[hs(o[0])],d=[];for(var h=1;h<o.length;h+=2){var p=o[h];d.push(dS(p,he)),u.push(hs(o[h+1]))}n.parts.push({type:1,index:a,name:s,strings:u,ctor:l,update:function e(e,t,n){return d.map(function(t){return t.evaluate(e)})}})};for(var b=p[Symbol.iterator](),y;!(f=(y=b.next()).done);f=true)m()}catch(e){v=true;g=e}finally{try{if(!f&&b.return!=null){b.return()}}finally{if(v){throw g}}}}else if(o.nodeType===Node.TEXT_NODE){var w=function(e){var t=_[e],o=dS(t,he);n.parts.push({type:2,index:++a,update:function e(e,t){return o.evaluate(e)}});var s=new Text(_[e+1].replace("\\{{","{{"));q.parentNode.insertBefore(s,q.nextSibling),q.parentNode.insertBefore(document.createComment(""),q.nextSibling),q=s,r.currentNode=s};var q=o,x=q.textContent,_=x.split(ho);_.length>1?q.textContent=hs(_[0]):ha(x)&&(q.textContent=hs(x));for(var E=1;E<_.length;E+=2)w(E)}};var n={h:void 0,el:e.cloneNode(!0),parts:[],renderers:{}},r=document.createTreeWalker(n.el.content,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT|NodeFilter.SHOW_COMMENT),o=r.currentNode,a=-1,s=[];for(;(o=r.nextNode())!==null;)t();var l=true,c=false,u=undefined;try{for(var d=s[Symbol.iterator](),h;!(l=(h=d.next()).done);l=true){var p=h.value;p.remove()}}catch(e){c=true;u=e}finally{try{if(!l&&d.return!=null){d.return()}}finally{if(c){throw u}}}return n};var hv=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},hg,hm=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t);iU(e,hg);ij(e,hg,e.attachInternals()),iL(e,hg).ariaLabel="pagination";return e}d(t,[{key:"createRenderRoot",value:function e(){return this}},{key:"connectedCallback",value:function e(){p(f(t.prototype),"connectedCallback",this).call(this);var e=this.querySelector("template");this.myTemplate=hu(e)}},{key:"render",value:function e(){var e=this;if(!this.computedContext)return o5(e0());var t=this.computedContext.testParts.flatMap(function(e){return e.sections.flatMap(function(e){return e.items})});return o5(e1(),t.map(function(t){return e.myTemplate({item:t,view:e.computedContext.view})}))}}]);return t}(av);hg=new WeakMap;hv([m({context:aU,subscribe:!0})],hm.prototype,"computedContext",void 0);var hb=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},hy=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t),e._internalDisabled=!0,e.addEventListener("click",function(t){t.preventDefault(),e._internalDisabled||e._requestItem(e.sectionItems[e.itemIndex-1].identifier)});return e}d(t,[{key:"_handleTestElementChange",value:function e(e,t){t&&(this._internalDisabled=!1)}},{key:"willUpdate",value:function e(e){var t;if(!this.computedContext)return;var n=(t=this.computedContext)===null||t===void 0?void 0:t.testParts.find(function(e){return e.active});n&&(this.sectionItems=n.sections.flatMap(function(e){return e.items}),this.itemIndex=this.sectionItems.findIndex(function(e){return e.active}),this.checkDisabled())}},{key:"checkDisabled",value:function e(){this._internalDisabled=!this.computedContext||this.itemIndex===0||this.itemIndex===-1}},{key:"_requestItem",value:function e(e){this.dispatchEvent(new CustomEvent("qti-request-navigation",{composed:!0,bubbles:!0,detail:{type:"item",id:e}}))}},{key:"render",value:function e(){return o5(e3())}}]);return t}(av);hy.styles=ob(e2(),cO,cM);var hw=hy;hb([n({type:Boolean,reflect:!0,attribute:"disabled"})],hw.prototype,"_internalDisabled",void 0);hb([m({context:aU,subscribe:!0})],hw.prototype,"computedContext",void 0);hb([O("computedContext")],hw.prototype,"_handleTestElementChange",null);var hq=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},hk=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"render",value:function e(){return o5(e5(),JSON.stringify(this.computedContext,null,2))}}]);return t}(av);hq([r(),m({context:aU,subscribe:!0})],hk.prototype,"computedContext",void 0);var hx=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},h_=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"render",value:function e(){var e;var t=(e=this.computedContext)===null||e===void 0?void 0:e.testParts.flatMap(function(e){return e.sections.flatMap(function(e){return e.items})}).find(function(e){return e.active});if(!t||!t.variables)return o5(e4());var n=t.variables.filter(function(e){return e.type==="response"}),r=t.variables.filter(function(e){return e.type==="outcome"}),o=function e(e,t){return o5(e8(),t,e.map(function(e){var t,n,r,o;var a=e.correctResponse?Array.isArray(e.correctResponse)?e.correctResponse.join(", "):e.correctResponse:"",s=((n=e.mapping)===null||n===void 0?void 0:(t=n.mapEntries)===null||t===void 0?void 0:t.map(function(e){return"".concat(e.mapKey,"=").concat(e.mappedValue,"pt")}).join(", "))||"",l=((o=e.areaMapping)===null||o===void 0?void 0:(r=o.areaMapEntries)===null||r===void 0?void 0:r.map(function(e){return"".concat(e.shape,"(").concat(e.coords,")=").concat(e.mappedValue,"pt")}).join(", "))||"";return o5(e6(),e.identifier,Array.isArray(e.value)?e.value.join(", "):e.value,e.cardinality,e.baseType,a||s||l)}))};return o5(e7(),o(n,"Response Variables"),o(r,"Outcome Variables"))}}]);return t}(av);h_.styles=ob(e9());var hE=h_;hx([m({context:aU,subscribe:!0})],hE.prototype,"computedContext",void 0);var hC=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},hS,hR,hA=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t);iU(e,hS);e.view="",e.disabled=!1,e.myTemplate=null,e.addEventListener("click",function(t){var n=t.target,r=parseFloat(n.value);n.tagName==="INPUT"&&iz(e,hS,hR).call(e,r)});return e}d(t,[{key:"createRenderRoot",value:function e(){return this}},{key:"connectedCallback",value:function e(){p(f(t.prototype),"connectedCallback",this).call(this);var e=this.querySelector("template");if(!e){this.myTemplate=null;return}this.myTemplate=hu(e)}},{key:"render",value:function e(){var e,t;var n=(e=this.computedContext)===null||e===void 0?void 0:e.testParts.flatMap(function(e){return e.sections.flatMap(function(e){return e.items})}).find(function(e){return e.active});if(!n||!n.variables)return o5(te());var r=(t=n.variables.find(function(e){return e.identifier=="MAXSCORE"}))===null||t===void 0?void 0:t.value,o=n.variables.find(function(e){return e.identifier=="SCORE"}),a=o===null||o===void 0?void 0:o.value,s=(o===null||o===void 0?void 0:o.externalScored)!=="human";if(!r||!o)return o7;var l=N(Array(Number(r)+1).keys());return o5(tt(),this.myTemplate?this.myTemplate({scores:l,score:a,disabled:s}):o7)}}]);return t}(av);hS=new WeakSet,hR=function e(e){var t,n;var r=(t=((n=this.computedContext)===null||n===void 0?void 0:n.testParts.find(function(e){return e.active})).sections.flatMap(function(e){return e.items}).find(function(e){return e.active}))===null||t===void 0?void 0:t.identifier;this.dispatchEvent(new CustomEvent("test-update-outcome-variable",{detail:{assessmentItemRefId:r,outcomeVariableId:"SCORE",value:e},bubbles:!0}))};hC([n({type:String,attribute:"view"})],hA.prototype,"view",void 0);hC([n({type:Boolean})],hA.prototype,"disabled",void 0);hC([m({context:aU,subscribe:!0})],hA.prototype,"computedContext",void 0);var hT=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},hI=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments),e.view=null;return e}d(t,[{key:"render",value:function e(){var e,t;var n=(e=this.computedContext)===null||e===void 0?void 0:e.testParts.flatMap(function(e){return e.sections.flatMap(function(e){return e.items})}).find(function(e){return e.active});if(!n||!n.variables)return o5(tn());if(n.category==="dep-informational")return o5(tr(),this.dataset.informational);var r=n===null||n===void 0?void 0:(t=n.variables.find(function(e){return e.identifier==="completionStatus"}))===null||t===void 0?void 0:t.value,o=n===null||n===void 0?void 0:n.variables.find(function(e){return e.identifier=="SCORE"}),a=parseFloat(o===null||o===void 0?void 0:o.value),s=n.externalScored;return o5(ti(),r!=="completed"?this.dataset.textNoResponse:!s&&a!==void 0&&!Number.isNaN(a)?a>0?this.dataset.textCorrect:this.dataset.textIncorrect:s==="externalMachine"?Number.isNaN(a)||a===void 0?this.dataset.scoreUnknown:"We hebben je antwoord ".concat(a===0?"geen punten":a==1?"\xe9\xe9n punt":"".concat(a," punten")," gegeven. Je kunt je score zelf aanpassen als je denkt dat dat niet klopt."):s==="human"?Number.isNaN(a)?"":"Deze score heb je zelf toegekend.":this.dataset.inProgress)}}]);return t}(av);hT([m({context:aU,subscribe:!0})],hI.prototype,"computedContext",void 0);hT([n({type:String,attribute:"view"})],hI.prototype,"view",void 0);var hP=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},hO,hM=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t);iU(e,hO);ij(e,hO,e.attachInternals()),iL(e,hO).ariaLabel="pagination";return e}d(t,[{key:"createRenderRoot",value:function e(){return this}},{key:"connectedCallback",value:function e(){p(f(t.prototype),"connectedCallback",this).call(this);var e=this.querySelector("template");this.myTemplate=hu(e)}},{key:"render",value:function e(){var e=this;if(!this.computedContext)return o5(to());var t=this.computedContext.testParts.flatMap(function(e){return e.sections});return o5(ta(),t.map(function(t){return e.myTemplate({item:t})}))}}]);return t}(av);hO=new WeakMap;hP([m({context:aU,subscribe:!0})],hM.prototype,"computedContext",void 0);var hN=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},hD,hL,hU=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t);iU(e,hD);e.sectionId=null,e.addEventListener("click",function(){return iz(e,hD,hL).call(e,e.sectionId)});return e}d(t,[{key:"render",value:function e(){return o5(ts())}}]);return t}(av);hD=new WeakSet,hL=function e(e){this.dispatchEvent(new CustomEvent("qti-request-navigation",{composed:!0,bubbles:!0,detail:{type:"section",id:e}}))},hU.styles=ob(tl(),cO,cM);var hj=hU;hN([n({type:String,attribute:"section-id"})],hj.prototype,"sectionId",void 0);var hz=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},hV=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments),e.debug=!1,e.stampContext={view:"candidate",activeItem:{},activeSection:{items:[]},activeTestpart:{items:[],sections:[]},test:{}};return e}d(t,[{key:"createRenderRoot",value:function e(){return this}},{key:"connectedCallback",value:function e(){p(f(t.prototype),"connectedCallback",this).call(this);var e=this.querySelector("template");if(!e){this.myTemplate=null;return}this.myTemplate=hu(e)}},{key:"willUpdate",value:function e(e){if(!this.computedContext)return;var t=this.computedContext.testParts.find(function(e){return e.active}),n=t===null||t===void 0?void 0:t.sections.find(function(e){return e.active}),r=n===null||n===void 0?void 0:n.items.find(function(e){return e.active}),o=r||{},a=o.variables,s=E(o,["variables"]);if(!t||!n||!r)return;var l=_(k({},t),{items:t.sections.flatMap(function(e){return e.items.map(function(e){var t=e.variables,n=E(e,["variables"]);return n})}),sections:t.sections.map(function(e){return _(k({},e),{items:e.items.map(function(e){var t=e.variables,n=E(e,["variables"]);return n})})})}),c=_(k({},n),{items:n.items.map(function(e){var t=e.variables,n=E(e,["variables"]);return n})}),u=this.computedContext,d=u.testParts,h=E(u,["testParts"]);this.stampContext={view:this.computedContext.view,activeItem:s,activeSection:c,activeTestpart:l,test:h},this.dispatchEvent(new CustomEvent("qti-stamp-context-updated",{detail:this.stampContext,bubbles:!0}))}},{key:"render",value:function e(){return o5(tu(),this.debug?o5(tc(),JSON.stringify(this.stampContext,null,2)):o7,this.myTemplate?this.myTemplate(this.stampContext):o7)}}]);return t}(av);hz([n({type:Boolean,reflect:!0})],hV.prototype,"debug",void 0);hz([r(),m({context:aU,subscribe:!0})],hV.prototype,"computedContext",void 0);hz([r()],hV.prototype,"stampContext",void 0);var hW=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},hF,hB,h$,hH=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,hB);e.label="view",e._handleViewOptionsChange=function(){iz(e,hB,h$).call(e)},e._viewOptions=hF.DEFAULT_VIEW_OPTIONS;return e}d(t,[{key:"connectedCallback",value:function e(){p(f(t.prototype),"connectedCallback",this).call(this),iz(this,hB,h$).call(this)}},{key:"_switchView",value:function e(e){this.dispatchEvent(new CustomEvent("on-test-switch-view",{composed:!0,bubbles:!0,detail:e}))}},{key:"render",value:function e(){var e=this;return o5(th(),this.label,function(t){var n=t.target;e._switchView(n.value)},this._viewOptions.map(function(t){return o5(td(),t,t===e.sessionContext.view,t)}))}}]);return t}(av);hB=new WeakSet,h$=function e(){if(this.viewOptions){var e=this.viewOptions.split(",").map(function(e){return e.trim()});this._viewOptions=e.filter(function(e){return hF.DEFAULT_VIEW_OPTIONS.includes(e)})}else this._viewOptions=hF.DEFAULT_VIEW_OPTIONS},hH.DEFAULT_VIEW_OPTIONS=["author","candidate","proctor","scorer","testConstructor","tutor"];var hQ=hH;hF=hQ;hW([m({context:aG,subscribe:!0})],hQ.prototype,"sessionContext",void 0);hW([n({type:String})],hQ.prototype,"label",void 0);hW([n({type:String,attribute:"view-options"})],hQ.prototype,"viewOptions",void 0);hW([O("viewOptions",{waitUntilFirstUpdate:!0})],hQ.prototype,"_handleViewOptionsChange",void 0);hW([r()],hQ.prototype,"_viewOptions",void 0);var hG=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},hX=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"createRenderRoot",value:function e(){return this}},{key:"connectedCallback",value:function e(){p(f(t.prototype),"connectedCallback",this).call(this);var e=this.querySelector("template");if(!e){this.myTemplate=null;return}this.myTemplate=hu(e)}},{key:"_switchView",value:function e(e){this.dispatchEvent(new CustomEvent("on-test-switch-view",{composed:!0,bubbles:!0,detail:e}))}},{key:"firstUpdated",value:function e(e){var t=this;this.addEventListener("click",function(){var e;((e=t.sessionContext)===null||e===void 0?void 0:e.view)==="scorer"?t._switchView("candidate"):t._switchView("scorer")})}},{key:"render",value:function e(){var e;return o5(tp(),this.myTemplate?this.myTemplate({view:(e=this.sessionContext)===null||e===void 0?void 0:e.view}):o7)}}]);return t}(av);hG([m({context:aG,subscribe:!0})],hX.prototype,"sessionContext",void 0);var hK=[{tag:"qti-assessment-item-ref",ctor:ak},{tag:"qti-assessment-section",ctor:su},{tag:"qti-assessment-test",ctor:sp},{tag:"qti-outcome-processing",ctor:sv},{tag:"qti-test",ctor:cI},{tag:"qti-test-feedback",ctor:cv},{tag:"qti-test-part",ctor:cb},{tag:"qti-test-variables",ctor:cq},{tag:"test-check-item",ctor:cL},{tag:"test-container",ctor:cY},{tag:"test-end-attempt",ctor:cZ},{tag:"test-item-link",ctor:c3},{tag:"test-item-to-speech",ctor:uI},{tag:"test-navigation",ctor:uX},{tag:"test-next",ctor:uZ},{tag:"test-paging-buttons-stamp",ctor:hm},{tag:"test-prev",ctor:hw},{tag:"test-print-context",ctor:hk},{tag:"test-print-item-variables",ctor:hE},{tag:"test-scoring-buttons",ctor:hA},{tag:"test-scoring-feedback",ctor:hI},{tag:"test-section-buttons-stamp",ctor:hM},{tag:"test-section-link",ctor:hj},{tag:"test-stamp",ctor:hV},{tag:"test-tts-next",ctor:uj},{tag:"test-tts-pause",ctor:uN},{tag:"test-tts-play",ctor:uM},{tag:"test-tts-prev",ctor:uU},{tag:"test-tts-resume",ctor:uD},{tag:"test-tts-stop",ctor:uL},{tag:"test-view",ctor:hQ},{tag:"test-view-toggle",ctor:hX}];var hY=true,hJ=false,hZ=undefined;try{for(var h0=hK[Symbol.iterator](),h1;!(hY=(h1=h0.next()).done);hY=true){var h3=h1.value,h2=h3.tag,h5=h3.ctor;customElements.get(h2)||customElements.define(h2,h5)}}catch(e){hJ=true;hZ=e}finally{try{if(!hY&&h0.return!=null){h0.return()}}finally{if(hJ){throw hZ}}}var h4=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},h6,h8,h7,h9,pe,pt=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,h7);iU(e,h6);iU(e,h8);e.customElementRegistry=null,e.itemURL=null,e.itemDoc=null,e.itemXML=null,e.qtiContext={QTI_CONTEXT:{testIdentifier:"",candidateIdentifier:"",environmentIdentifier:"default"}},ij(e,h6,null),ij(e,h8,null);return e}d(t,[{key:"createRenderRoot",value:function e(){var e;var t=this.customElementRegistry;return ij(this,h8,t),(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(k({},this.constructor.shadowRootOptions,t?{customElementRegistry:t}:{}))}},{key:"handleItemURLChange",value:function e(){return a(function(){var e,t,n,r,o,a;return z(this,function(s){switch(s.label){case 0:if(!this.itemURL)return[3,4];s.label=1;case 1:s.trys.push([1,3,,4]);r=(n=this.qtiContext)===null||n===void 0?void 0:(t=n.QTI_CONTEXT)===null||t===void 0?void 0:t.seed;return[4,ln().load(this.itemURL)];case 2:o=s.sent().shuffleInteractions(r);this.itemDoc=o.htmlDoc((e=iL(this,h8))!==null&&e!==void 0?e:void 0);return[3,4];case 3:a=s.sent();console.error("Error loading or parsing XML:",a);return[3,4];case 4:return[2]}})}).call(this)}},{key:"handleItemXMLChange",value:function e(){if(this.itemXML)try{var e;this.itemDoc=ln().parse(this.itemXML).htmlDoc((e=iL(this,h8))!==null&&e!==void 0?e:void 0)}catch(e){console.error("Error parsing XML:",e)}}},{key:"connectedCallback",value:function e(){var e=this;var n=this,r=function n(){return p(f(t.prototype),"connectedCallback",e)};return a(function(){return z(this,function(e){r().call(n),iz(this,h7,h9).call(this),iz(this,h7,pe).call(this),this.itemURL&&this.handleItemURLChange(),this.itemXML&&this.handleItemXMLChange();return[2]})}).call(this)}},{key:"render",value:function e(){return o5(tv(),iL(this,h6),cF(this.itemDoc,o5(tf())))}}]);return t}(av);h6=new WeakMap,h8=new WeakMap,h7=new WeakSet,h9=function e(){var e=this.querySelector("template");ij(this,h6,e?e.content:o5(tg()))},pe=function e(){var e=new CSSStyleSheet;e.replaceSync(cB),this.shadowRoot.adoptedStyleSheets=[e]};h4([n({attribute:!1})],pt.prototype,"customElementRegistry",void 0);h4([n({type:String,attribute:"item-url"})],pt.prototype,"itemURL",void 0);h4([r()],pt.prototype,"itemDoc",void 0);h4([r()],pt.prototype,"itemXML",void 0);h4([r(),m({context:aH,subscribe:!0})],pt.prototype,"qtiContext",void 0);h4([O("itemURL",{waitUntilFirstUpdate:!0})],pt.prototype,"handleItemURLChange",null);h4([O("itemXML",{waitUntilFirstUpdate:!0})],pt.prototype,"handleItemXMLChange",null);var pn=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},pr=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"render",value:function e(){var e=this.computedContext;if(!e||!e.variables)return o5(tm());var t=e.variables.filter(function(e){return e.type==="response"}),n=e.variables.filter(function(e){return e.type==="outcome"}),r=function e(e,t){return o5(ty(),t,e.map(function(e){var t,n,r,o;var a=e.correctResponse?Array.isArray(e.correctResponse)?e.correctResponse.join(", "):e.correctResponse:"",s=((n=e.mapping)===null||n===void 0?void 0:(t=n.mapEntries)===null||t===void 0?void 0:t.map(function(e){return"".concat(e.mapKey,"=").concat(e.mappedValue,"pt")}).join(", "))||"",l=((o=e.areaMapping)===null||o===void 0?void 0:(r=o.areaMapEntries)===null||r===void 0?void 0:r.map(function(e){return"".concat(e.shape,"(").concat(e.coords,")=").concat(e.mappedValue,"pt")}).join(", "))||"";return o5(tb(),e.identifier,Array.isArray(e.value)?e.value.join(", "):e.value,e.cardinality,e.baseType,a||s||l)}))};return o5(tw(),r(t,"Response Variables"),r(n,"Outcome Variables"))}}]);return t}(av);pr.styles=ob(tq());var pi=pr;pn([m({context:aL,subscribe:!0})],pi.prototype,"computedContext",void 0);var po=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},pa,ps,pl,pc,pu,pd,ph=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t);iU(e,pl);iU(e,pa);iU(e,ps);e.configContext={},e.qtiContext={QTI_CONTEXT:{testIdentifier:"",candidateIdentifier:"",environmentIdentifier:"default"}},ij(e,pa,iz(e,pl,pc).bind(e)),ij(e,ps,iz(e,pl,pu).bind(e)),e.addEventListener("qti-item-context-updated",iL(e,pa)),e.addEventListener("qti-assessment-item-connected",iL(e,ps));return e}d(t,[{key:"render",value:function e(){return o5(tk())}},{key:"disconnectedCallback",value:function e(){p(f(t.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("qti-item-context-changed",iL(this,pa)),this.removeEventListener("qti-assessment-item-connected",iL(this,ps))}}]);return t}(av);pa=new WeakMap,ps=new WeakMap,pl=new WeakSet,pc=function e(e){var t,n;iz(this,pl,pd).call(this,e.detail.itemContext.identifier,((n=e.detail)===null||n===void 0?void 0:(t=n.itemContext)===null||t===void 0?void 0:t.variables)||[])},pu=function e(e){var t,n;var r=e.detail._context.variables;this.assessmentItem=e.detail,this.computedContext=((t=this.computedContext)===null||t===void 0?void 0:t.identifier)===this.assessmentItem.identifier?_(k({},this.computedContext),{title:this.assessmentItem.title}):{identifier:this.assessmentItem.identifier,title:this.assessmentItem.title,adaptive:((n=this.assessmentItem.getAttribute("adaptive"))===null||n===void 0?void 0:n.toLowerCase())==="true"||!1,variables:r},iz(this,pl,pd).call(this,this.assessmentItem.identifier,r||[])},pd=function e(e,t){var n,r;var o=t===null||t===void 0?void 0:(n=t.find(function(e){return e.identifier=="SCORE"}))===null||n===void 0?void 0:n.value,a=parseFloat(o===null||o===void 0?void 0:o.toString()),s=t===null||t===void 0?void 0:(r=t.find(function(e){return e.identifier==="completionStatus"}))===null||r===void 0?void 0:r.value,l=a!==void 0&&!isNaN(a)&&a>0,c=a!==void 0&&!isNaN(a)&&a<=0,u=s==="completed";this.computedContext=_(k({},this.computedContext),{identifier:e,correct:l,incorrect:c,completed:u,variables:t})};po([r(),u({context:aL})],ph.prototype,"computedContext",void 0);po([r(),u({context:aj})],ph.prototype,"configContext",void 0);po([r(),u({context:aH})],ph.prototype,"qtiContext",void 0);var pp=[{tag:"item-container",ctor:pt},{tag:"item-print-variables",ctor:pi},{tag:"qti-item",ctor:ph}];var pf=true,pv=false,pg=undefined;try{for(var pm=pp[Symbol.iterator](),pb;!(pf=(pb=pm.next()).done);pf=true){var py=pb.value,pw=py.tag,pq=py.ctor;customElements.get(pw)||customElements.define(pw,pq)}}catch(e){pv=true;pg=e}finally{try{if(!pf&&pm.return!=null){pm.return()}}finally{if(pv){throw pg}}}var pk=true,px=false,p_=undefined;try{for(var pE=cp[Symbol.iterator](),pC;!(pk=(pC=pE.next()).done);pk=true){var pS=pC.value,pR=pS.tag,pA=pS.ctor;customElements.get(pR)||customElements.define(pR,pA)}}catch(e){px=true;p_=e}finally{try{if(!pk&&pE.return!=null){pE.return()}}finally{if(px){throw p_}}}var pT=function e(e,t,n){var r=new Map;for(var o=t;o<=n;o++)r.set(e[o],o);return r},pI=sb(/*#__PURE__*/function(e){"use strict";v(t,e);function t(e){l(this,t);var n;if(n=s(this,t,[e]),e.type!==sm.CHILD)throw Error("repeat() can only be used in text expressions");return n}d(t,[{key:"dt",value:function e(e,t,n){var r;n===void 0?n=t:t!==void 0&&(r=t);var o=[],a=[],s=0;var l=true,c=false,u=undefined;try{for(var d=e[Symbol.iterator](),h;!(l=(h=d.next()).done);l=true){var p=h.value;o[s]=r?r(p,s):s,a[s]=n(p,s),s++}}catch(e){c=true;u=e}finally{try{if(!l&&d.return!=null){d.return()}}finally{if(c){throw u}}}return{values:a,keys:o}}},{key:"render",value:function e(e,t,n){return this.dt(e,t,n).values}},{key:"update",value:function e(e,t){var n=I(t,3),r=n[0],o=n[1],a=n[2];var s;var l=sA(e),c=this.dt(r,o,a),u=c.values,d=c.keys;if(!Array.isArray(l))return this.ut=d,u;var h=(s=this.ut)!==null&&s!==void 0?s:this.ut=[],p=[],f,v,g=0,m=l.length-1,b=0,y=u.length-1;for(;g<=m&&b<=y;)if(l[g]===null)g++;else if(l[m]===null)m--;else if(h[g]===d[b])p[b]=sC(l[g],u[b]),g++,b++;else if(h[m]===d[y])p[y]=sC(l[m],u[y]),m--,y--;else if(h[g]===d[y])p[y]=sC(l[g],u[y]),sE(e,p[y+1],l[g]),g++,y--;else if(h[m]===d[b])p[b]=sC(l[m],u[b]),sE(e,l[g],l[m]),m--,b++;else if(f===void 0&&(f=pT(d,b,y),v=pT(h,g,m)),f.has(h[g]))if(f.has(h[m])){var w=v.get(d[b]),q=w!==void 0?l[w]:null;if(q===null){var k=sE(e,l[g]);sC(k,u[b]),p[b]=k}else p[b]=sC(q,u[b]),sE(e,l[g],q),l[w]=null;b++}else sT(l[m]),m--;else sT(l[g]),g++;for(;b<=y;){var x=sE(e,p[y+1]);sC(x,u[b]),p[b++]=x}for(;g<=m;){var _=l[g++];_!==null&&sT(_)}return this.ut=d,sR(e,p),o8}}]);return t}(sy));var pP=Symbol("dragDropContext");var pO=[aY,aJ,ob(tx())];var pM=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},pN=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments),e.internals=e.attachInternals(),e.acceptsDeclarativeDrops=!0;return e}d(t,[{key:"drags",get:function e(){var e;var t,n;return(e=(n=this._dragDrop)===null||n===void 0?void 0:(t=n.nodesByTarget)===null||t===void 0?void 0:t[this.identifier])!==null&&e!==void 0?e:[]}},{key:"connectedCallback",value:function e(){p(f(t.prototype),"connectedCallback",this).call(this),this.dispatchEvent(new CustomEvent("qti-register-hotspot",{bubbles:!0,composed:!0,cancelable:!1}))}},{key:"render",value:function e(){return o5(t_(),pI(this.drags,function(e){return e.getAttribute("identifier")},function(e){return e}))}}]);return t}(av);pN.styles=pO;var pD=pN;pM([n({type:String,reflect:!0})],pD.prototype,"identifier",void 0);pM([m({context:pP,subscribe:!0}),r()],pD.prototype,"_dragDrop",void 0);var pL=[{tag:"qti-associable-hotspot",ctor:pD}];var pU=[aY,aJ,ob(tE())];var pj=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},pz=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments),e.internals=e.attachInternals(),e.acceptsDeclarativeDrops=!0,e.tabindex=0;return e}d(t,[{key:"drags",get:function e(){var e;var t,n;return(e=(n=this._dragDrop)===null||n===void 0?void 0:(t=n.nodesByTarget)===null||t===void 0?void 0:t[this.identifier])!==null&&e!==void 0?e:[]}},{key:"render",value:function e(){return o5(tC(),pI(this.drags,function(e){return e.getAttribute("identifier")},function(e){return e}))}}]);return t}(av);pz.styles=pU;var pV=pz;pj([n({type:Number,reflect:!0})],pV.prototype,"tabindex",void 0);pj([n({type:String,reflect:!0})],pV.prototype,"identifier",void 0);pj([m({context:pP,subscribe:!0}),r()],pV.prototype,"_dragDrop",void 0);var pW=[{tag:"qti-gap",ctor:pV}];var pF=[aY,ob(tS())];var pB=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},p$=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments),e.tabindex=0,e.internals=e.attachInternals();return e}d(t,[{key:"connectedCallback",value:function e(){this.setAttribute("slot","drags")}}]);return t}(av);p$.styles=pF;var pH=p$;pB([n({type:Number,reflect:!0})],pH.prototype,"tabindex",void 0);var pQ=[{tag:"qti-gap-img",ctor:pH}];var pG=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},pX={toAttribute:function e(e){return e?"true":"false"},fromAttribute:function e(e){return e==="true"}};var pK=[aY,ob(tR())];var pY=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},pJ=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments),e.tabindex=0;return e}d(t,[{key:"connectedCallback",value:function e(){p(f(t.prototype),"connectedCallback",this).call(this),this.setAttribute("slot","drags")}},{key:"render",value:function e(){return o5(tA())}}]);return t}(rj(av,"qti-gap-text"));pJ.styles=pK;var pZ=pJ;pY([n({type:Number,reflect:!0})],pZ.prototype,"tabindex",void 0);var p0=[{tag:"qti-gap-text",ctor:pZ}];var p1=[aY,ob(tT())];var p3=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},p2=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}return t}(rj(av,"qti-hotspot-choice"));p2.styles=p1;var p5=p2;p3([n({attribute:"aria-ordervalue",type:Number,reflect:!0})],p5.prototype,"order",void 0);var p4=[{tag:"qti-hotspot-choice",ctor:p5}];var p6=[aY,ob(tI())];var p8=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"render",value:function e(){return o5(tP())}}]);return t}(rj(av,"qti-hottext"));p8.styles=p6;var p7=p8;var p9=[{tag:"qti-hottext",ctor:p7}];var fe=ob(tO()),ft=fe;var fn=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},fr,fi,fo=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,fr);return e}d(t,[{key:"connectedCallback",value:function e(){p(f(t.prototype),"connectedCallback",this).call(this),this.addEventListener("click",iz(this,fr,fi)),this.dispatchEvent(new CustomEvent("qti-inline-choice-register",{bubbles:!0,composed:!0,cancelable:!1}))}},{key:"disconnectedCallback",value:function e(){this.removeEventListener("click",iz(this,fr,fi))}},{key:"render",value:function e(){return o5(tM())}}]);return t}(rj(av,"qti-inline-choice"));fr=new WeakSet,fi=function e(){this.dispatchEvent(new CustomEvent("qti-inline-choice-select",{bubbles:!0,cancelable:!1,composed:!0,detail:{identifier:this.identifier}}))},fo.styles=ft;var fa=fo;fn([n({type:String})],fa.prototype,"identifier",void 0);var fs=[{tag:"qti-inline-choice",ctor:fa}];var fl=[aY,ob(tN())];var fc=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"render",value:function e(){return o5(tD())}},{key:"connectedCallback",value:function e(){var e;p(f(t.prototype),"connectedCallback",this).call(this),((e=this.parentElement)===null||e===void 0?void 0:e.tagName.endsWith("INTERACTION"))&&this.setAttribute("slot","prompt")}}]);return t}(av);fc.styles=fl;var fu=fc;var fd=[{tag:"qti-prompt",ctor:fu}];var fh=[aY,aJ,ob(tL())];var fp=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},ff=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments),e.matchMin=0,e.matchMax=1,e.fixed=!1,e.acceptsDeclarativeDrops=!0;return e}d(t,[{key:"connectedCallback",value:function e(){p(f(t.prototype),"connectedCallback",this).call(this),this.setAttribute("slot","qti-simple-associable-choice")}},{key:"drags",get:function e(){var e;var t,n;return(e=(n=this._dragDrop)===null||n===void 0?void 0:(t=n.nodesByTarget)===null||t===void 0?void 0:t[this.identifier])!==null&&e!==void 0?e:[]}},{key:"render",value:function e(){return o5(tU(),pI(this.drags,function(e){return e.getAttribute("identifier")},function(e){return e}))}}]);return t}(rj(av,"qti-simple-associable-choice"));ff.styles=fh;var fv=ff;fp([n({type:Number,attribute:"match-min"})],fv.prototype,"matchMin",void 0);fp([n({type:Number,attribute:"match-max"})],fv.prototype,"matchMax",void 0);fp([n({type:String,attribute:"fixed",converter:{fromAttribute:function e(e){return e==="true"},toAttribute:function e(e){return String(e)}}})],fv.prototype,"fixed",void 0);fp([m({context:pP,subscribe:!0}),r()],fv.prototype,"_dragDrop",void 0);var fg=[{tag:"qti-simple-associable-choice",ctor:fv}];var fm=[aY,ob(tj())];var fb=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},fy=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments),e.templateIdentifier=null,e.showHide="show",e.fixed=!1;return e}d(t,[{key:"checked",get:function e(){return this.internals.states.has("checked")}},{key:"render",value:function e(){return o5(tV(),this.marker?o5(tz(),this.marker):o7)}}]);return t}(rj(av,"qti-simple-choice"));fy.styles=fm,fy.shadowRootOptions=_(k({},av.shadowRootOptions),{delegatesFocus:!0});var fw=fy;fb([n({type:String,attribute:"template-identifier"})],fw.prototype,"templateIdentifier",void 0);fb([n({type:String,attribute:"show-hide"})],fw.prototype,"showHide",void 0);fb([n({type:Boolean,converter:{fromAttribute:function e(e){return e==="true"},toAttribute:function e(e){return String(e)}}})],fw.prototype,"fixed",void 0);fb([n({type:String,attribute:!1})],fw.prototype,"marker",void 0);var fq=[{tag:"qti-simple-choice",ctor:fw}];var fk=N(pL).concat(N(pW),N(pQ),N(p0),N(p4),N(p9),N(fs),N(fd),N(fg),N(fq));var fx=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};var f_=function e(e,t,r){var o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:'slot[part="drags"]';var a,c,u,h,g,m,b,y,w;var q=/*#__PURE__*/function(e){"use strict";v(n,e);function n(){l(this,n);var e;e=s(this,n,arguments);iU(e,m);iU(e,a);iU(e,c);iU(e,u);iU(e,h);iU(e,g);e.autoSizeDropzones=!0,ij(e,a,null),ij(e,c,new Set),ij(e,u,null),ij(e,h,0),ij(e,g,null);return e}d(n,[{key:"autoSizeDropzoneWidth",get:function e(){return!0}},{key:"collectAutoSizeTargets",value:function e(){var e=function e(e,t){var n;return Array.from((n=t===null||t===void 0?void 0:t.querySelectorAll(e))!==null&&n!==void 0?n:[])};return{draggables:N(e(t,this)).concat(N(e(t,this.shadowRoot))),droppables:N(e(r,this)).concat(N(e(r,this.shadowRoot))),dragContainers:N(e(o,this)).concat(N(e(o,this.shadowRoot)))}}},{key:"dropzonePropertyTarget",value:function e(){return this}},{key:"updateMinDimensionsForDropZones",value:function e(){var e=this;if(!this.autoSizeDropzones)return;var t=this.collectAutoSizeTargets(),n=t.draggables,r=t.droppables,o=t.dragContainers;n.length!==0&&(rz(this.dropzonePropertyTarget(),n,r,o,{publishWidth:this.autoSizeDropzoneWidth,hasChanged:function t(t){var n=iL(e,g);return n&&n.height===t.height&&n.width===t.width?!1:(ij(e,g,t),!0)}}),iz(this,m,w).call(this,n),iz(this,m,b).call(this))}},{key:"disconnectedCallback",value:function e(){var e,t;(e=iL(this,a))===null||e===void 0?void 0:e.disconnect(),ij(this,a,null),iL(this,c).clear(),(t=iL(this,u))===null||t===void 0?void 0:t.disconnect(),ij(this,u,null),iL(this,h)&&cancelAnimationFrame(iL(this,h)),ij(this,h,0),p(f(n.prototype),"disconnectedCallback",this).call(this)}}]);return n}(e);return a=new WeakMap,c=new WeakMap,u=new WeakMap,h=new WeakMap,g=new WeakMap,m=new WeakSet,b=function e(){var e=this;(typeof MutationObserver==="undefined"?"undefined":D(MutationObserver))>"u"||iL(this,u)||(ij(this,u,new MutationObserver(function(){return iz(e,m,y).call(e)})),iL(this,u).observe(this,{childList:!0,subtree:!0,characterData:!0}))},y=function e(){var e=this;iL(this,h)||ij(this,h,requestAnimationFrame(function(){ij(e,h,0),e.updateMinDimensionsForDropZones()}))},w=function e(e){var t=this;var n;if((typeof ResizeObserver==="undefined"?"undefined":D(ResizeObserver))>"u")return;(n=iL(this,a))!==null&&n!==void 0?n:ij(this,a,new ResizeObserver(function(){return iz(t,m,y).call(t)}));var r=new Set(e);var o=true,s=false,l=undefined;try{for(var u=iL(this,c)[Symbol.iterator](),d;!(o=(d=u.next()).done);o=true){var h=d.value;r.has(h)||iL(this,a).unobserve(h)}}catch(e){s=true;l=e}finally{try{if(!o&&u.return!=null){u.return()}}finally{if(s){throw l}}}var p=true,f=false,v=undefined;try{for(var g=r[Symbol.iterator](),b;!(p=(b=g.next()).done);p=true){var w=b.value;iL(this,c).has(w)||iL(this,a).observe(w)}}catch(e){f=true;v=e}finally{try{if(!p&&g.return!=null){g.return()}}finally{if(f){throw v}}}ij(this,c,r)},fx([n({type:Boolean,attribute:"auto-size-dropzones"})],q.prototype,"autoSizeDropzones",void 0),q};var fE=globalThis.AbortController,fC=globalThis.AbortSignal,fS=globalThis.WeakMap,fR=globalThis.WeakRef,fA=globalThis.Window,fT=globalThis.reportError,fI=fT===void 0?console.log:fT,fP=function e(e){return e&&e.defaultView!==null&&e.defaultView.document===e&&(e.defaultView.top===e.defaultView||fP(e.defaultView.parent.document))},fO=function e(){return!!fA&&g(globalThis,fA)},fM=Symbol("unset"),fN=I(function(){var e=function e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;Object.defineProperty(e,t,_(k({},Object.getOwnPropertyDescriptor(e,t)),{enumerable:n}))};var t=function e(e,t){var n=t.call(e);if(n===null||(typeof n==="undefined"?"undefined":D(n))!="object")throw new TypeError("Iterator is not an object");return n};var n=function e(e){var t=Object.create(h);return u.set(t,{syncIteratorRecord:e}),t};var r=function e(e,r){var o;if(r){if(o=e[Symbol.asyncIterator],o==null){if(o=e[Symbol.iterator],o==null)throw new TypeError("Object is not async iterable");var a=t(e,o);return n(a)}}else o=e[Symbol.iterator];if(o==null)throw new TypeError("Object is not iterable");return t(e,o)};var o=function e(e,t){var n=u.get(e);if(n===null||n===void 0?void 0:n.active){n.active=!1,n.subscriptionController.abort(t);var r=true,o=false,a=undefined;try{for(var s=n.teardowns.reverse()[Symbol.iterator](),l;!(r=(l=s.next()).done);r=true){var c=l.value;if(fO()&&!fP(document))return;try{c()}catch(e){fI(e)}}}catch(e){o=true;a=e}finally{try{if(!r&&s.return!=null){s.return()}}finally{if(o){throw a}}}}};var a=function e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r;if(fO()&&!fP(document))return;var a;typeof t=="function"?a=new v({next:t}):t&&!g(t,v)?a=new v(t):a=t||new v;var s=u.get(e),l=(r=s.weakSubscriber)===null||r===void 0?void 0:r.deref();if(l===null||l===void 0?void 0:l.active){var c=l,d=u.get(c);d.observers.add(a),n.signal&&(n.signal.aborted?d.observers.delete(a):n.signal.addEventListener("abort",function(){var e=u.get(c);(e===null||e===void 0?void 0:e.active)&&(e.observers.delete(a),e.observers.size==0&&o(c,n.signal.reason))}));return}var h=new m(a);if(s.weakSubscriber=new fR(h),"signal"in n&&(n.signal.aborted?o(h,n.signal.reason):n.signal.addEventListener("abort",function(){var e=u.get(h);(e===null||e===void 0?void 0:e.active)&&(e.observers.delete(a),e.observers.size==0&&o(h,n.signal.reason))})),s.subscribeCallback)try{s.subscribeCallback(h)}catch(e){h.error(e)}};var s="try"in Promise?Promise.try.bind(Promise):function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++){n[r-1]=arguments[r]}return new Promise(function(t){return t(e.apply(void 0,N(n)))})},c="withResolvers"in Promise?Promise.withResolvers.bind(Promise):function(){var e,t;return{promise:new Promise(function(n,r){return e=n,t=r}),resolve:e,reject:t}};var u=new fS,h={next:function e(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;var o=this,a=u.get(o);if(!(a===null||a===void 0?void 0:a.syncIteratorRecord))throw new TypeError("AsyncFromSyncIteratorPrototype.next called on invalid object");var l=a.syncIteratorRecord;return s(function(){return(r=l).next.apply(r,N(t))})},return:function e(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;var o=this,a=u.get(o);if(!(a===null||a===void 0?void 0:a.syncIteratorRecord))throw new TypeError("AsyncFromSyncIteratorPrototype.return called on invalid object");var l=a.syncIteratorRecord;return s(function(){return l.return?(r=l).return.apply(r,N(t)):{value:void 0,done:!0}})},throw:function e(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r=this,o=u.get(r);if(!(o===null||o===void 0?void 0:o.syncIteratorRecord))throw new TypeError("AsyncFromSyncIteratorPrototype.throw called on invalid object");var a=o.syncIteratorRecord;return s(function(){var e;if(!a.throw)throw a.return(),new TypeError("no throw method");return(e=a).throw.apply(e,N(t))})}};var p="any"in fC?fC.any.bind(fC):function(e){var t=new fE;var n=true,r=false,o=undefined;try{for(var a=e[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;if(l.aborted)return t.abort(l.reason),t.signal}}catch(e){r=true;o=e}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(r){throw o}}}var c=true,u=false,d=undefined;try{var h=function(){var e=f.value;e.addEventListener("abort",function(){t.abort(e.reason)},{signal:t.signal})};for(var p=e[Symbol.iterator](),f;!(c=(f=p.next()).done);c=true)h()}catch(e){u=true;d=e}finally{try{if(!c&&p.return!=null){p.return()}}finally{if(u){throw d}}}return t.signal},f=function e(e){return p(e.filter(Boolean))};var v=/*#__PURE__*/function(){"use strict";function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.next,r=t.error,o=t.complete;l(this,e);u.set(this,{next:n,error:r,complete:o})}d(e,[{key:"next",value:function e(e){var t=u.get(this)||{},n=t.next;n&&n(e)}},{key:"error",value:function e(e){var t=u.get(this)||{},n=t.error;n?n(e):fI(e)}},{key:"complete",value:function e(){var e=u.get(this)||{},t=e.complete;t&&t()}}]);return e}();var m=/*#__PURE__*/function(){"use strict";function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;l(this,e);if(!g(t,v))throw new TypeError("Illegal constructor");u.set(this,{active:!0,observers:new Set([t]),teardowns:[],subscriptionController:new fE})}d(e,[{key:Symbol.toStringTag,get:function e(){return"Subscriber"}},{key:"next",value:function t(t){if(!g(this,e))throw new TypeError("illegal invocation");if(!arguments.length)throw new TypeError("too few arguments");var n=u.get(this);if(!(n===null||n===void 0?void 0:n.active)||fO()&&!fP(document))return;var r=new Set(n.observers);var o=true,a=false,s=undefined;try{for(var l=r[Symbol.iterator](),c;!(o=(c=l.next()).done);o=true){var d=c.value;d.next(t)}}catch(e){a=true;s=e}finally{try{if(!o&&l.return!=null){l.return()}}finally{if(a){throw s}}}}},{key:"error",value:function t(t){if(!g(this,e))throw new TypeError("illegal invocation");if(!arguments.length)throw new TypeError("too few arguments");var n=u.get(this);if(!(n===null||n===void 0?void 0:n.active)){fI(t);return}if(fO()&&!fP(document))return;o(this,t);var r=new Set(n.observers);var a=true,s=false,l=undefined;try{for(var c=r[Symbol.iterator](),d;!(a=(d=c.next()).done);a=true){var h=d.value;h.error(t)}}catch(e){s=true;l=e}finally{try{if(!a&&c.return!=null){c.return()}}finally{if(s){throw l}}}}},{key:"complete",value:function t(){if(!g(this,e))throw new TypeError("illegal invocation");var t=u.get(this);if(!(t===null||t===void 0?void 0:t.active)||fO()&&!fP(document))return;o(this);var n=new Set(t.observers);var r=true,a=false,s=undefined;try{for(var l=n[Symbol.iterator](),c;!(r=(c=l.next()).done);r=true){var d=c.value;d.complete()}}catch(e){a=true;s=e}finally{try{if(!r&&l.return!=null){l.return()}}finally{if(a){throw s}}}}},{key:"addTeardown",value:function t(t){if(!g(this,e))throw new TypeError("illegal invocation");if(typeof t!="function")throw new TypeError("Parameter 1 is not of type 'Function'");if(fO()&&!fP(document))return;var n=u.get(this);(n===null||n===void 0?void 0:n.active)?n.teardowns.push(t):t()}},{key:"active",get:function t(){var t;if(!g(this,e))throw new TypeError("illegal invocation");return!!((t=u.get(this))===null||t===void 0?void 0:t.active)}},{key:"signal",get:function t(){if(!g(this,e))throw new TypeError("illegal invocation");if(!u.has(this)){var t=new fE;return t.abort(),t.signal}return u.get(this).subscriptionController.signal}}]);return e}();e(m.prototype,"next"),e(m.prototype,"error"),e(m.prototype,"complete"),e(m.prototype,"addTeardown"),e(m.prototype,"active"),e(m.prototype,"signal");var b=/*#__PURE__*/function(){"use strict";function e(t){l(this,e);if(!t)throw new TypeError("1 argument required but 0 present");u.set(this,{weakSubscriber:null,subscribeCallback:t})}d(e,[{key:Symbol.toStringTag,get:function e(){return"Observable"}},{key:"subscribe",value:function t(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!g(this,e))throw new TypeError("illegal invocation");a(this,t,n)}},{key:"takeUntil",value:function t(t){if(!g(this,e))throw new TypeError("illegal invocation");var n=this,r=e.from(t);return new e(function(e){var t=new v({next:function t(){e.complete()},error:function t(){e.complete()}}),o={signal:e.signal};if(a(r,t,o),!e.active)return;var s=new v({next:function t(t){e.next(t)},error:function t(t){e.error(t)},complete:function t(){e.complete()}});a(n,s,o)})}},{key:"map",value:function t(t){if(!g(this,e))throw new TypeError("illegal invocation");if(typeof t!="function")throw new TypeError("Parameter 1 is not of type 'Function'");var n=this;return new e(function(e){var r=0,o=new v({next:function n(n){var o;try{o=t(n,r)}catch(t){e.error(t);return}r+=1,e.next(o)},error:function t(t){e.error(t)},complete:function t(){e.complete()}}),s={signal:e.signal};a(n,o,s)})}},{key:"inspect",value:function t(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var n=null,r=null,o=null,s=null,l=null;typeof t=="function"?r=t:t&&(typeof t==="undefined"?"undefined":D(t))=="object"&&("subscribe"in t&&(n=t.subscribe),"next"in t&&(r=t.next),"error"in t&&(o=t.error),"complete"in t&&(s=t.complete),"abort"in t&&(l=t.abort));var c=this;return new e(function(e){if(n!==null)try{n()}catch(t){e.error(t);return}var t=function t(){try{l!==null&&l(e.signal.reason)}catch(e){fI(e)}};e.signal.addEventListener("abort",t,{once:!0});var u=new v({next:function n(n){if(r!==null)try{r(n)}catch(n){e.signal.removeEventListener("abort",t),e.error(n);return}e.next(n)},error:function n(n){if(e.signal.removeEventListener("abort",t),o!==null)try{o(n)}catch(t){e.error(t);return}e.error(n)},complete:function n(){if(e.signal.removeEventListener("abort",t),s!==null)try{s()}catch(t){e.error(t);return}e.complete()}}),d={signal:e.signal};a(c,u,d)})}},{key:"filter",value:function t(t){if(!g(this,e))throw new TypeError("illegal invocation");if(typeof t!="function")throw new TypeError("Parameter 1 is not of type 'Function'");var n=this;return new e(function(e){var r=0,o=new v({next:function n(n){var o=!1;try{o=t(n,r)}catch(t){e.error(t);return}r+=1,o&&e.next(n)},error:function t(t){e.error(t)},complete:function t(){e.complete()}}),s={signal:e.signal};a(n,o,s)})}},{key:"take",value:function t(t){if(!g(this,e))throw new TypeError("illegal invocation");var n=this;return new e(function(e){var r=t;if(r==0)return e.complete();var o=new v({next:function t(t){e.next(t),r-=1,r==0&&e.complete()},error:function t(t){e.error(t)},complete:function t(){e.complete()}}),s={signal:e.signal};a(n,o,s)})}},{key:"drop",value:function t(t){if(!g(this,e))throw new TypeError("illegal invocation");var n=this;return new e(function(e){var r=t,o=new v({next:function t(t){if(r>0)return r-=1;r==0&&e.next(t)},error:function t(t){e.error(t)},complete:function t(){e.complete()}}),s={signal:e.signal};a(n,o,s)})}},{key:"flatMap",value:function t(t){if(!g(this,e))throw new TypeError("illegal invocation");if(typeof t!="function")throw new TypeError("Parameter 1 is not of type 'Function'");var n=this;return new e(function(r){var o=0,s=!1,l=[];function c(n){var d;try{d=t(n,o)}catch(e){return r.error(e)}o+=1;var h;try{h=e.from(d)}catch(e){return r.error(e)}var p=new v({next:function e(e){r.next(e)},error:function e(e){r.error(e)},complete:function e(){if(l.length){var e=l.shift();c(e)}else u=!1,s&&r.complete()}}),f={signal:r.signal};a(h,p,f)}var u=!1,d=new v({next:function e(e){u?l.push(e):(u=!0,c(e))},error:function e(e){r.error(e)},complete:function e(){s=!0,!u&&!l.length&&r.complete()}}),h={signal:r.signal};a(n,d,h)})}},{key:"switchMap",value:function t(t){if(!g(this,e))throw new TypeError("illegal invocation");if(typeof t!="function")throw new TypeError("Parameter 1 is not of type 'Function'");var n=this;return new e(function(r){var o=function n(n){var o;try{o=t(n,s)}catch(e){return r.error(e)}s+=1;var u;try{u=e.from(o)}catch(e){return r.error(e)}var d=new v({next:function e(e){r.next(e)},error:function e(e){r.error(e)},complete:function e(e){l?r.complete():c=null}}),h={signal:f([c.signal,r.signal])};a(u,d,h)};var s=0,l=!1,c=null;var u=new v({next:function e(e){c&&c.abort(),c=new fE,o(e)},error:function e(e){r.error(e)},complete:function e(){l=!0,c||r.complete()}}),d={signal:r.signal};a(n,u,d)})}},{key:"catch",value:function t(t){if(!g(this,e))throw new TypeError("illegal invocation");if(typeof t!="function")throw new TypeError("Parameter 1 is not of type 'Function'");var n=this;return new e(function(r){var o=new v({next:function e(e){r.next(e)},error:function n(n){var o;try{o=t(n)}catch(e){r.error(e);return}var s;try{s=e.from(o)}catch(e){r.error(e);return}var l=new v({next:function e(e){r.next(e)},error:function e(e){r.error(e)},complete:function e(){r.complete()}}),c={signal:r.signal};a(s,l,c)},complete:function e(){r.complete()}}),s={signal:r.signal};a(n,o,s)})}},{key:"finally",value:function t(t){if(!g(this,e))throw new TypeError("illegal invocation");if(typeof t!="function")throw new TypeError("Parameter 1 is not of type 'Function'");var n=this;return new e(function(e){e.addTeardown(t);var r=new v({next:function t(t){e.next(t)},error:function t(t){e.error(t)},complete:function t(){e.complete()}}),o={signal:e.signal};a(n,r,o)})}},{key:"toArray",value:function t(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!g(this,e))throw new TypeError("illegal invocation");var n=c(),r=n.promise,o=n.resolve,s=n.reject;if(t.signal){if(t.signal.aborted)return Promise.reject(t.signal.reason);t.signal.addEventListener("abort",function(){s(t.signal.reason)})}var l=[],u=new v({next:function e(e){l.push(e)},error:function e(e){s(e)},complete:function e(){o(l)}});return a(this,u,t),r}},{key:"forEach",value:function t(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!g(this,e))throw new TypeError("illegal invocation");if(typeof t!="function")throw new TypeError("Parameter 1 is not of type 'Function'");var r=c(),o=r.promise,s=r.resolve,l=r.reject,u=new fE,d={signal:f([u.signal,n.signal])};if(d.signal.aborted)return l(d.signal.reason),o;d.signal.addEventListener("abort",function(){l(d.signal.reason)});var h=0,p=new v({next:function e(e){try{t(e,h)}catch(e){l(e),u.abort(e)}h+=1},error:function e(e){l(e)},complete:function e(){s()}});return a(this,p,d),o}},{key:"every",value:function t(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!g(this,e))throw new TypeError("illegal invocation");if(typeof t!="function")throw new TypeError("Parameter 1 is not of type 'Function'");var r=c(),o=r.promise,s=r.resolve,l=r.reject,u=new fE,d={signal:f([u.signal,n.signal])};if(d.signal.aborted)return l(d.signal.reason),o;d.signal.addEventListener("abort",function(){l(d.signal.reason)});var h=0,p=new v({next:function e(e){var n=!1;try{n=t(e,h)}catch(e){l(e),u.abort(e)}h+=1,n||(s(!1),u.abort())},error:function e(e){l(e)},complete:function e(){s(!0)}});return a(this,p,d),o}},{key:"first",value:function t(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!g(this,e))throw new TypeError("illegal invocation");var n=c(),r=n.promise,o=n.resolve,s=n.reject,l=new fE,u={signal:f([l.signal,t.signal])};if(u.signal.aborted)return s(u.signal.reason),r;u.signal.addEventListener("abort",function(){s(u.signal.reason)});var d=new v({next:function e(e){o(e),l.abort()},error:function e(e){s(e)},complete:function e(){s(new RangeError("No values in Observable"))}});return a(this,d,u),r}},{key:"last",value:function t(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!g(this,e))throw new TypeError("illegal invocation");var n=c(),r=n.promise,o=n.resolve,s=n.reject;if(t.signal){if(t.signal.aborted)return s(t.signal.reason),r;t.signal.addEventListener("abort",function(){s(t.signal.reason)})}var l=null,u=!1,d=new v({next:function e(e){u=!0,l=e},error:function e(e){s(e)},complete:function e(){u?o(l):s(new RangeError("No values in Observable"))}});return a(this,d,t),r}},{key:"find",value:function t(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!g(this,e))throw new TypeError("illegal invocation");if(typeof t!="function")throw new TypeError("Parameter 1 is not of type 'Function'");var r=c(),o=r.promise,s=r.resolve,l=r.reject,u=new fE,d={signal:f([u.signal,n.signal])};if(d.signal.aborted)return l(d.signal.reason),o;d.signal.addEventListener("abort",function(){l(d.signal.reason)});var h=0,p=new v({next:function e(e){var n=!1;try{n=t(e,h)}catch(e){l(e),u.abort(e)}h+=1,n&&(s(e),u.abort())},error:function e(e){l(e)},complete:function e(){s()}});return a(this,p,d),o}},{key:"some",value:function t(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!g(this,e))throw new TypeError("illegal invocation");if(typeof t!="function")throw new TypeError("Parameter 1 is not of type 'Function'");var r=c(),o=r.promise,s=r.resolve,l=r.reject,u=new fE,d={signal:f([u.signal,n.signal])};if(d.signal.aborted)return l(d.signal.reason),o;d.signal.addEventListener("abort",function(){l(d.signal.reason)});var h=0,p=new v({next:function e(e){var n=!1;try{n=t(e,h)}catch(e){l(e),u.abort(e)}h+=1,n&&(s(!0),u.abort())},error:function e(e){l(e)},complete:function e(){s(!1)}});return a(this,p,d),o}},{key:"reduce",value:function t(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!g(this,e))throw new TypeError("illegal invocation");if(typeof t!="function")throw new TypeError("Parameter 1 is not of type 'Function'");var o=c(),s=o.promise,l=o.resolve,u=o.reject,d=new fE,h={signal:f([d.signal,r.signal])};if(h.signal.aborted)return u(h.signal.reason),s;h.signal.addEventListener("abort",function(){u(h.signal.reason)},{once:!0});var p=0,m=arguments.length>1?n:fM,b=new v({next:function e(e){if(m===fM){m=e,p++;return}try{var n=t(m,e,p);p++,m=n}catch(e){u(e),d.abort(e);return}},error:function e(e){u(e)},complete:function e(){m!==fM?l(m):u(new TypeError("no initial value provided and no values emitted"))}});return a(this,b,h),s}}],[{key:"from",value:function t(t){if(t===null||(typeof t==="undefined"?"undefined":D(t))!="object")throw new TypeError("Observable.from only accepts objects");if(g(t,e))return t;if(typeof(Symbol.asyncIterator in t&&t[Symbol.asyncIterator])=="function"){var n=function e(e,t){if(e.signal.aborted)return;var r;try{var a=t.next();r=Promise.resolve(a)}catch(e){r=Promise.reject(e)}r.then(function(r){if(r===null||(typeof r==="undefined"?"undefined":D(r))!="object"){e.error(new TypeError("Not an IteratorResult."));return}try{var a;a=r,o=a.done,a}catch(t){e.error(t);return}if(o){e.complete();return}var s;try{s=r.value}catch(t){e.error(t);return}e.next(s),n(e,t)},function(t){e.error(t)})},o=!1;return new e(function(e){if(e.signal.aborted)return;var a;try{a=r(t,!0)}catch(t){e.error(t);return}var l=a;e.signal.aborted||(e.signal.addEventListener("abort",function(){if(typeof l.return!="function"||o)return;s(function(){return l.return(e.signal.reason)}).then(function(e){if(e===null||(typeof e==="undefined"?"undefined":D(e))!="object")throw new TypeError("Iterator .return() must return an Object")})}),n(e,l))})}if(typeof(Symbol.iterator in t&&t[Symbol.iterator])=="function")return new e(function(e){if(e.signal.aborted)return;var n;try{n=r(t,!1)}catch(t){e.error(t);return}var o=!1,a=n;if(!e.signal.aborted)for(e.signal.addEventListener("abort",function(){if(typeof a.return!="function"||o)return;var e=a.return();if(e===null||(typeof e==="undefined"?"undefined":D(e))!="object")throw new TypeError("Iterator .return() must return an Object")});;)try{var s=a.next();var l;if(l=s,o=l.done,l,o){e.complete();return}if(e.next(s.value),e.signal.aborted)break}catch(t){e.error(t);break}});if(g(t,Promise)||typeof t.then=="function")return new e(function(e){t.then(function(t){e.next(t),e.complete()},function(t){e.error(t)})});throw new TypeError("Could not convert value to Observable")}}]);return e}();return e(b.prototype,"subscribe"),[b,m]}(),2),fD=fN[0],fL=fN[1];var fU=function e(e){return e===null||e===void 0?void 0:e.internals};var fj={origin:{x:0,y:0},scale:{x:1,y:1}},fz=100,fV=function e(e){var t,n;var r=(t=(n=e.fullscreenElement)!==null&&n!==void 0?n:e.webkitFullscreenElement)!==null&&t!==void 0?t:null;for(;g(r,HTMLElement);){var o;var a;var s=(o=(a=r.shadowRoot)===null||a===void 0?void 0:a.fullscreenElement)!==null&&o!==void 0?o:null;if(!s||s===r)break;r=s}return g(r,HTMLElement)?r:null},fW=function e(e){var t=e.shadowRoot;return t?t.querySelector("slot:not([name])")?e:t:e},fF=function e(e,t){var n=t;for(;n;){var r,o;if(n===e)return!0;n=(r=(o=n.parentNode)!==null&&o!==void 0?o:n.host)!==null&&r!==void 0?r:null}return!1},fB=function e(e,t){var n;var r=(n=e.ownerDocument)!==null&&n!==void 0?n:document,o=t!==null&&t!==void 0?t:r.body,a=fV(r);return a&&!fF(a,o)?fW(a):o},f$=function e(e){var t;var n=((t=e.ownerDocument)!==null&&t!==void 0?t:document).createElement("div");n.style.cssText="position:fixed;left:0;top:0;width:".concat(fz,"px;height:").concat(fz,"px;margin:0;padding:0;border:0;visibility:hidden;pointer-events:none;"),e.appendChild(n);var r=n.getBoundingClientRect();return n.remove(),{origin:{x:r.left,y:r.top},scale:{x:r.width/fz||1,y:r.height/fz||1}}},fH=function e(e,t,n){return{x:(t-e.origin.x)/e.scale.x,y:(n-e.origin.y)/e.scale.y}};rV()||rW();var fQ=new WeakSet;var fG=function e(e){var t;return!!((t=e.internals)===null||t===void 0?void 0:t.states)},fX=function e(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:'slot[part="drags"]',o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"pointerWithin";var c,u,h;var m=/*#__PURE__*/function(e){"use strict";v(m,e);function m(){l(this,m);var e;e=s(this,m,arguments);iU(e,c);iU(e,u);iU(e,h);e.trackedDraggables=[],e.trackedDroppables=[],e.trackedDragContainers=[],e.allDropzones=[],e.collisionDetectionAlgorithm=o,e.dragState={dragging:!1,dragSource:null,dragClone:null,startOffset:{x:0,y:0},currentTarget:null,sourceDroppable:null,inputType:null,returnAnchorItems:[]},e.cloneFrame=fj,e.subscriptions=[],e.dragSubscriptions=[],e.lastPointerDownAt=0,e.lastTouchStartAt=0,ij(e,c,new Set),ij(e,u,new Set),ij(e,h,function(t){var n=t;if(n.context!==az)return;var r=n.contextTarget;g(r,HTMLElement)&&iL(e,u).add(r)});return e}d(m,[{key:"isDragDropEnabled",value:function e(){return!0}},{key:"publishDraggablesSelector",value:function e(){var e=this.isDragDropEnabled()?t:null;this._interactionContext.draggablesSelector!==e&&(this._interactionContext=_(k({},this._interactionContext),{draggablesSelector:e}))}},{key:"connectedCallback",value:function e(){var e;p(f(m.prototype),"connectedCallback",this).call(this),this.addEventListener("context-request",iL(this,h),{capture:!0}),r6((e=this.ownerDocument)===null||e===void 0?void 0:e.defaultView),this.publishDraggablesSelector(),this.setupDragDrop()}},{key:"disconnectedCallback",value:function e(){p(f(m.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("context-request",iL(this,h),{capture:!0}),iL(this,u).clear(),this.cleanup()}},{key:"setupDragDrop",value:function e(){return a(function(){return z(this,function(e){switch(e.label){case 0:return[4,this.updateComplete];case 1:e.sent(),this.cacheInteractiveElements(),this.afterCache(),this.setupDragObservables();return[2]}})}).call(this)}},{key:"afterCache",value:function e(){}},{key:"removeChipFromDroppable",value:function e(e,t){t.remove()}},{key:"registeredMatching",value:function e(e){var t=true,n=false,r=undefined;try{for(var o=iL(this,u)[Symbol.iterator](),a;!(t=(a=o.next()).done);t=true){var s=a.value;s.isConnected||iL(this,u).delete(s)}}catch(e){n=true;r=e}finally{try{if(!t&&o.return!=null){o.return()}}finally{if(n){throw r}}}return N(iL(this,u)).filter(function(t){return t.matches(e)})}},{key:"cacheInteractiveElements",value:function e(){var e=function e(e,t){var n;return Array.from((n=t===null||t===void 0?void 0:t.querySelectorAll(e))!==null&&n!==void 0?n:[])},o=e(t,this),a=e(t,this.shadowRoot),s=e('[qti-draggable="true"]:not([data-drag-clone])',this),l=e('[qti-draggable="true"]:not([data-drag-clone])',this.shadowRoot),u=this.registeredMatching(t);this.trackedDraggables=Array.from(new Set(N(o).concat(N(a),N(s),N(l),N(u))));var d=e(n,this),h=e(n,this.shadowRoot);this.trackedDroppables=Array.from(new Set(N(d).concat(N(h))));var p=e(r,this),f=e(r,this.shadowRoot);this.trackedDragContainers=Array.from(new Set(N(p).concat(N(f)))),this.allDropzones=N(this.trackedDroppables).concat(N(this.trackedDragContainers));var v=this.isDragDropEnabled(),g=new Set(this.trackedDraggables),m=new Set(this.trackedDroppables),b=v?g:new Set,y=v?m:new Set,w=new Set(N(g).concat(N(m)).filter(fG));var q=true,k=false,x=undefined;try{for(var _=iL(this,c)[Symbol.iterator](),E;!(q=(E=_.next()).done);q=true){var C=E.value;w.has(C)||(C.internals.states.delete("drag"),C.internals.states.delete("droppable"))}}catch(e){k=true;x=e}finally{try{if(!q&&_.return!=null){_.return()}}finally{if(k){throw x}}}var S=true,R=false,A=undefined;try{for(var T=w[Symbol.iterator](),I;!(S=(I=T.next()).done);S=true){var P=I.value;var O=b.has(P),M=!O&&y.has(P);O?P.internals.states.add("drag"):P.internals.states.delete("drag"),M?P.internals.states.add("droppable"):P.internals.states.delete("droppable")}}catch(e){R=true;A=e}finally{try{if(!S&&T.return!=null){T.return()}}finally{if(R){throw A}}}ij(this,c,w),this.trackedDraggables.forEach(function(e){var t=r1(e);v&&!t?(e.style.cursor="grab",e.style.userSelect="none",e.style.touchAction="none",e.style.webkitUserSelect="none",e.style.webkitTouchCallout="none",e.setAttribute("qti-draggable","true"),e.setAttribute("tabindex","0")):(e.style.cursor="",e.style.userSelect="",e.style.touchAction="",e.style.webkitUserSelect="",e.style.webkitTouchCallout="",e.removeAttribute("qti-draggable"),e.getAttribute("tabindex")==="0"&&e.removeAttribute("tabindex"))})}},{key:"setupDragObservables",value:function e(){var e=this;var n=this.shadowRoot;if(!n){console.error("❌ [Observable DnD] No shadow root found!");return}var r=n.when("pointerdown").filter(function(n){if(!n.isTrusted)return!1;var r=rK(n,t),o=e.disabled||e.readonly,a=rY(r)||r1(r),s=Date.now()-e.lastTouchStartAt<50;return r&&n.isPrimary!==!1&&n.button===0&&!o&&!a&&!s}).subscribe(function(n){e.lastPointerDownAt=Date.now();var r=rK(n,t);if(!r){console.warn("⚠️ [Observable DnD] No draggable target found");return}n.pointerType==="touch"&&(n.preventDefault(),n.stopPropagation());var o=n.isTrusted?n.pointerType==="touch"?100:10:0;if(e.dragState.activationTimeout&&clearTimeout(e.dragState.activationTimeout),o===0){e.dragState.dragging||e.initiateDrag(r,n.clientX,n.clientY,n.pointerType,"pointer",n.pointerId,n.isTrusted);return}var a=function t(){e.dragState.activationTimeout&&(clearTimeout(e.dragState.activationTimeout),e.dragState.activationTimeout=void 0),document.removeEventListener("pointerup",a,!0),document.removeEventListener("pointercancel",a,!0)};document.addEventListener("pointerup",a,{once:!0,capture:!0}),document.addEventListener("pointercancel",a,{once:!0,capture:!0}),e.dragState.activationTimeout=window.setTimeout(function(){e.dragState.activationTimeout=void 0,document.removeEventListener("pointerup",a,!0),document.removeEventListener("pointercancel",a,!0),e.dragState.dragging||e.initiateDrag(r,n.clientX,n.clientY,n.pointerType,"pointer",n.pointerId,n.isTrusted)},o)}),o=n.when("mousedown").filter(function(n){var r=rK(n,t),o=e.disabled||e.readonly,a=rY(r)||r1(r),s=n.button===0,l=Date.now()-e.lastPointerDownAt<50;return r&&s&&!o&&!a&&!l}).subscribe(function(n){var r=rK(n,t);!r||e.dragState.dragging||(n.preventDefault(),e.initiateDrag(r,n.clientX,n.clientY,"mouse","mouse",void 0,n.isTrusted))}),a=n.when("touchstart").filter(function(n){var r,o;var a=rK(n,t),s=e.disabled||e.readonly,l=rY(a)||r1(a),c=!!(((r=n.touches)===null||r===void 0?void 0:r[0])||((o=n.changedTouches)===null||o===void 0?void 0:o[0])),u=Date.now()-e.lastPointerDownAt<50;return a&&c&&!s&&!l&&!u}).subscribe(function(n){var r,o;var a=rK(n,t),s=((r=n.touches)===null||r===void 0?void 0:r[0])||((o=n.changedTouches)===null||o===void 0?void 0:o[0]);!a||!s||e.dragState.dragging||(e.lastTouchStartAt=Date.now(),n.preventDefault(),n.stopPropagation(),e.initiateDrag(a,s.clientX,s.clientY,"touch","touch",void 0,n.isTrusted))}),s={dragging:!1,dragElement:null,dragIndex:0,dropIndex:0,dropElement:null},l=n.when("keydown").subscribe(function(n){var r=e.trackedDraggables.filter(function(e){return!r1(e)}),o=N(e.trackedDroppables).concat(N(e.trackedDragContainers));if(s.dragging)switch(n.code){case"ArrowRight":case"ArrowDown":{n.preventDefault();var a=(s.dropIndex+1)%o.length;s=_(k({},s),{dropIndex:a,dropElement:o[a]});break}case"ArrowLeft":case"ArrowUp":{n.preventDefault();var l=(s.dropIndex-1+o.length)%o.length;s=_(k({},s),{dropIndex:l,dropElement:o[l]});break}case"Space":case"Enter":case"Tab":{n.preventDefault(),s.dragElement&&s.dropElement&&(e.allowDrop(s.dragElement,s.dropElement)||e.trackedDragContainers.includes(s.dropElement)?e.handleDrop(s.dragElement,s.dropElement):e.handleInvalidDrop(s.dragElement)),e.trackedDraggables.forEach(function(e){return e.removeAttribute("data-keyboard-dragging")}),e.saveResponse(),s={dragging:!1,dragElement:null,dragIndex:0,dropIndex:0,dropElement:null};break}case"Escape":{n.preventDefault(),e.trackedDraggables.forEach(function(e){return e.removeAttribute("data-keyboard-dragging")}),s={dragging:!1,dragElement:null,dragIndex:0,dropIndex:0,dropElement:null};break}}else{var c=rK(n,t),u=e.disabled||e.readonly,d=rY(c)||r1(c);c&&["Space","Enter"].includes(n.code)&&!u&&!d&&(n.preventDefault(),c.setAttribute("data-keyboard-dragging","true"),s={dragging:!0,dragElement:c,dragIndex:r.indexOf(c),dropIndex:0,dropElement:o[0]})}e.allDropzones.forEach(function(e){return e.removeAttribute("hover")}),s.dragging&&s.dropElement&&(s.dropElement.setAttribute("hover",""),s.dropElement.hasAttribute("tabindex")&&s.dropElement.getAttribute("tabindex")!=="-1"&&s.dropElement.focus())});this.subscriptions.push(r,o,a,l)}},{key:"initiateDrag",value:function e(e,t,n,r){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"pointer",a=arguments.length>5?arguments[5]:void 0,s=arguments.length>6?arguments[6]:void 0;var l;if(this.dragState.dragging){console.warn("⚠️ [Observable DnD] Already dragging, ignoring initiateDrag");return}if(e.hasAttribute("data-drag-clone")){console.warn("⚠️ [Observable DnD] Attempted to drag visual clone, ignoring");return}var c=function t(t){var n;return t.contains(e)||!!((n=t.shadowRoot)===null||n===void 0?void 0:n.contains(e))},u=this.trackedDroppables.some(c),d=this.trackedDroppables.find(c)||null;e.getAnimations().forEach(function(e){return e.cancel()});var h=e.getBoundingClientRect();if(this.dragState={dragging:!0,dragSource:e,dragClone:this.createDragClone(e,h),startOffset:{x:t-h.left,y:n-h.top},currentTarget:null,sourceDroppable:d,inputType:r,pointerId:a,startedFromTrustedEvent:s,initialCoordinates:{x:t,y:n},returnAnchorItems:[]},u){var p;(p=this.dragState.dragClone)===null||p===void 0?void 0:p.setAttribute("data-drag-origin","droppable"),this.removeChipFromDroppable(d,e),this.cacheInteractiveElements(),d&&d.setAttribute("data-drag-source","true");var f=e.getAttribute("identifier");if(f){var v=r5(this.trackedDragContainers,f);v.forEach(function(e){return rJ(e,"return-anchor",!0)}),this.dragState.returnAnchorItems=v}}else(l=this.dragState.dragClone)===null||l===void 0?void 0:l.setAttribute("data-drag-origin","inventory"),rJ(e,"dragging",!0);this.updateClonePosition(t,n),this.activateAllDroppables(),this.watchDragCloneHost(),this.setupMoveObservables(r,o)}},{key:"setupMoveObservables",value:function e(e){var t=this;var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"pointer";var r;if(e==="touch"){if(n==="pointer")try{var o=this.dragState.dragSource,a=this.dragState.pointerId;o&&a!==void 0&&o.setPointerCapture&&o.setPointerCapture(a)}catch(e){}var s=function e(e){e.cancelable&&(e.preventDefault(),n==="pointer"&&e.stopPropagation())};document.addEventListener("touchmove",s,{passive:!1,capture:!0}),document.addEventListener("touchstart",s,{passive:!1,capture:!0}),document.addEventListener("touchend",s,{passive:!1,capture:!0}),document.addEventListener("gesturestart",s,{passive:!1}),document.addEventListener("gesturechange",s,{passive:!1}),document.addEventListener("gestureend",s,{passive:!1});var l=function e(){if(document.removeEventListener("touchmove",s,{capture:!0}),document.removeEventListener("touchstart",s,{capture:!0}),document.removeEventListener("touchend",s,{capture:!0}),document.removeEventListener("gesturestart",s),document.removeEventListener("gesturechange",s),document.removeEventListener("gestureend",s),n==="pointer")try{var e=t.dragState.dragSource,r=t.dragState.pointerId;e&&r!==void 0&&e.releasePointerCapture&&e.releasePointerCapture(r)}catch(e){}};this.dragState.touchCleanup=l}var c=n==="mouse"?"mousemove":n==="touch"?"touchmove":"pointermove",u=n==="mouse"?"mouseup":n==="touch"?"touchend":"pointerup",d=function e(e){var n=t.dragState.startedFromTrustedEvent;return n===void 0||e.isTrusted===n},h=document.when(c).takeUntil(document.when(u)).subscribe({next:function e(e){if(d(e)){if(e.preventDefault(),e.stopPropagation(),n==="touch"){var r,o;var a=((r=e.touches)===null||r===void 0?void 0:r[0])||((o=e.changedTouches)===null||o===void 0?void 0:o[0]);if(!a)return;t.handleDragMove(a.clientX,a.clientY);return}if(n==="mouse"){var s=e;if(typeof s.buttons=="number"&&(s.buttons&1)!==1)return}t.handleDragMove(e.clientX,e.clientY)}}}),p=document.when(u).subscribe({next:function e(e){d(e)&&(e.preventDefault(),e.stopPropagation(),t.handleDragEnd())}}),f=n==="touch"?document.when("touchcancel").subscribe({next:function e(e){d(e)&&t.handleDragEnd()}}):n==="mouse"?null:document.when("pointercancel").subscribe({next:function e(e){d(e)&&t.handleDragEnd()}}),v=document.when("keydown").filter(function(e){return e.key==="Escape"}).subscribe({next:function e(e){d(e)&&t.handleDragEnd()}}),g=[h,p,v];f&&g.push(f),(r=this.dragSubscriptions).push.apply(r,N(g))}},{key:"handleDragMove",value:function e(e,t){if(!this.dragState.dragging||!this.dragState.dragClone)return;this.updateClonePosition(e,t);var n=rX(this.allDropzones,e,t,this.dragState.dragClone,this.collisionDetectionAlgorithm,this.trackedDragContainers),r=Date.now(),o=r-(this.dragState.lastTargetChangeTime||0);n!==this.dragState.currentTarget&&(n===null||o>=50)&&(this.allDropzones.forEach(function(e){return r3(e,"hover",!1)}),n&&r3(n,"hover",!0),this.dragState.currentTarget=n,this.dragState.lastTargetChangeTime=r)}},{key:"handleDragEnd",value:function e(){if(!this.dragState.dragging)return;var e=this.dragState,t=e.dragSource,n=e.dragClone,r=e.currentTarget,o=e.sourceDroppable,a=r;if(n){var s;var l=n.getBoundingClientRect();a=(s=rX(this.allDropzones,l.left+l.width/2,l.top+l.height/2,n,this.collisionDetectionAlgorithm,this.trackedDragContainers))!==null&&s!==void 0?s:r}!!t&&!!a&&this.allowDrop(t,a)&&t&&a?(this.handleDrop(t,a),rJ(t,"dragging",!1)):this.handleInvalidDrop(t),n&&n.remove(),(this.dragState.returnAnchorItems||[]).forEach(function(e){rJ(e,"return-anchor",!1)}),this.dragState.touchCleanup&&this.dragState.touchCleanup(),this.resetDragState(),this.deactivateAllDroppables(),this.saveResponse(),o&&o.removeAttribute("data-drag-source"),this.cacheInteractiveElements();var c=this.checkAllMaxAssociations;typeof c=="function"&&c.call(this)}},{key:"allowDrop",value:function e(e,t){return this.trackedDroppables.includes(t)||this.trackedDragContainers.includes(t)}},{key:"handleInvalidDrop",value:function e(e){r0(e)}},{key:"createDragClone",value:function e(e,t){var n=e.cloneNode(!0),r=window.getComputedStyle(e);for(var o=0;o<r.length;o++){var a=r[o];n.style.setProperty(a,r.getPropertyValue(a))}var s=fB(e.isConnected?e:this,this.dragCloneRoot());return this.cloneFrame=f$(s),n.style.position="fixed",n.style.width="".concat(t.width/this.cloneFrame.scale.x,"px"),n.style.height="".concat(t.height/this.cloneFrame.scale.y,"px"),n.style.zIndex="9999",n.style.pointerEvents="none",n.style.touchAction="none",n.style.userSelect="none",n.style.opacity="0.8",n.removeAttribute("qti-draggable"),n.removeAttribute("tabindex"),n.setAttribute("data-drag-clone","true"),n.setAttribute("data-drag-interaction",this.tagName.toLowerCase()),s.appendChild(n),n}},{key:"dragCloneRoot",value:function e(){var e=this.getRootNode();return g(e,ShadowRoot)?e:null}},{key:"updateClonePosition",value:function e(e,t){if(this.dragState.lastCoordinates={x:e,y:t},!this.dragState.dragClone)return;var n=this.dragState,r=n.startOffset,o=fH(this.cloneFrame,e-r.x,t-r.y),a=o.x,s=o.y;this.dragState.dragClone.style.left="".concat(a,"px"),this.dragState.dragClone.style.top="".concat(s,"px")}},{key:"watchDragCloneHost",value:function e(){var e=this;var t;var n=(t=this.ownerDocument)!==null&&t!==void 0?t:document,r=function t(){var t=e.dragState,n=t.dragClone,r=t.dragSource,o=t.lastCoordinates;if(!n)return;var a=(r===null||r===void 0?void 0:r.isConnected)?r:e,s=fB(a,e.dragCloneRoot());s!==n.parentNode&&(s.appendChild(n),e.cloneFrame=f$(s),o&&e.updateClonePosition(o.x,o.y))};n.addEventListener("fullscreenchange",r),n.addEventListener("webkitfullscreenchange",r),this.dragSubscriptions.push({unsubscribe:function e(){n.removeEventListener("fullscreenchange",r),n.removeEventListener("webkitfullscreenchange",r)}})}},{key:"activateAllDroppables",value:function e(){this.setInternalsState("dragzone-enabled",!0),this.setInternalsState("dragzone-active",!0),this.allDropzones.forEach(function(e){r3(e,"enabled",!0),r3(e,"active",!0)})}},{key:"deactivateAllDroppables",value:function e(){this.setInternalsState("dragzone-enabled",!1),this.setInternalsState("dragzone-active",!1),this.allDropzones.forEach(function(e){r3(e,"enabled",!1),r3(e,"active",!1),r3(e,"hover",!1)})}},{key:"resetDragState",value:function e(){if(this.dragState.activationTimeout&&clearTimeout(this.dragState.activationTimeout),(this.dragState.returnAnchorItems||[]).forEach(function(e){rJ(e,"return-anchor",!1)}),this.dragState.touchCleanup)try{this.dragState.touchCleanup()}catch(e){console.warn("⚠️ [Observable DnD] Error during touch cleanup:",e)}this.dragSubscriptions.forEach(function(e){try{e&&typeof e.unsubscribe=="function"&&e.unsubscribe()}catch(e){console.warn("⚠️ [Observable DnD] Error unsubscribing:",e)}}),this.dragSubscriptions=[],this.cloneFrame=fj,this.dragState={dragging:!1,dragSource:null,dragClone:null,startOffset:{x:0,y:0},currentTarget:null,sourceDroppable:null,inputType:null,pointerId:void 0,startedFromTrustedEvent:void 0,touchCleanup:void 0,returnAnchorItems:[]}}},{key:"setInternalsState",value:function e(e,t){var n=this._internals;(n===null||n===void 0?void 0:n.states)&&(t?n.states.add(e):n.states.delete(e))}},{key:"cleanup",value:function e(){this.subscriptions.forEach(function(e){try{e.unsubscribe()}catch(e){}}),this.subscriptions=[],this.dragState.dragClone&&this.dragState.dragClone.remove();var e=true,t=false,n=undefined;try{for(var r=iL(this,c)[Symbol.iterator](),o;!(e=(o=r.next()).done);e=true){var a=o.value;fG(a)&&(a.internals.states.delete("drag"),a.internals.states.delete("droppable"))}}catch(e){t=true;n=e}finally{try{if(!e&&r.return!=null){r.return()}}finally{if(t){throw n}}}iL(this,c).clear(),this.resetDragState()}}]);return m}(e);return c=new WeakMap,u=new WeakMap,h=new WeakMap,m};var fK={duration:250,easing:"ease",fill:"both"};var fY=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},fJ=function e(e,t,r){var o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:'slot[part="drags"]',a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"closestCornersWithInventoryPriority";var c;var h=f_(e,t,r,o),g=fX(h,t,r,o,a);var m=/*#__PURE__*/function(e){"use strict";v(n,e);function n(){l(this,n);var e;e=s(this,n,arguments);iU(e,c);e.minAssociations=1,e._maxAssociations=0,e._maxAssociationsDefaultApplied=!1,e._response=[],e._dragDrop={dragsByTarget:{},countByTarget:{},nodesByTarget:{}},ij(e,c,new WeakMap),e._dropBlockedDueToMax=!1,e.flipAnimationConfig={duration:200,easing:"ease"},e._enableFlipAnimations=!0,e._pendingResponse=void 0;return e}d(n,[{key:"maxAssociations",get:function e(){if(!this._maxAssociationsDefaultApplied){var e;this._maxAssociationsDefaultApplied=!0;var t=((e=this.tagName)===null||e===void 0?void 0:e.toLowerCase())||"";(t==="qti-graphic-gap-match-interaction"||t==="qti-gap-match-interaction")&&!this.hasAttribute("max-associations")&&this._maxAssociations===0&&(this._maxAssociations=1)}return this._maxAssociations},set:function e(e){var t=this._maxAssociations;this._maxAssociations=e,this.requestUpdate("maxAssociations",t)}},{key:"isSwapTarget",value:function e(e){var t=this.dragState.sourceDroppable,n=parseInt(e.getAttribute("match-max")||"1",10);return(Number.isNaN(n)?1:n)===1&&this.isDeclarativeTarget(e)&&!!t&&t!==e&&this.trackedDroppables.includes(t)}},{key:"isDeclarativeTarget",value:function e(e){return e?e.acceptsDeclarativeDrops===!0?!0:e.hasAttribute("data-declarative-drops"):!1}},{key:"chipsIn",value:function e(e){var n;return this.isDeclarativeTarget(e)?N((n=iL(this,c).get(e))!==null&&n!==void 0?n:[]):Array.from(e.querySelectorAll(t))}},{key:"droppableHolding",value:function e(e){var t=this;var n;return(n=this.trackedDroppables.find(function(n){var r;return t.chipsIn(n).includes(e)||n.contains(e)||!!((r=n.shadowRoot)===null||r===void 0?void 0:r.contains(e))}))!==null&&n!==void 0?n:null}},{key:"placeChip",value:function e(e,t){var n;iL(this,c).set(e,N((n=iL(this,c).get(e))!==null&&n!==void 0?n:[]).concat([t]))}},{key:"removeChipFromDroppable",value:function e(e,t){var n=e!==null&&e!==void 0?e:this.droppableHolding(t);if(n&&this.isDeclarativeTarget(n)){var r;var o=((r=iL(this,c).get(n))!==null&&r!==void 0?r:[]).filter(function(e){return e!==t});iL(this,c).set(n,o),o.length===0&&r2(n,!1),this.syncDragDropState();return}t.remove()}},{key:"clearChips",value:function e(e){this.isDeclarativeTarget(e)?(iL(this,c).set(e,[]),this.syncDragDropState()):this.chipsIn(e).forEach(function(e){return e.remove()}),r2(e,!1)}},{key:"syncDragDropState",value:function e(){var e={},t={},n={};var r=true,o=false,a=undefined;try{for(var s=this.trackedDroppables[Symbol.iterator](),l;!(r=(l=s.next()).done);r=true){var c=l.value;var u=c.getAttribute("identifier");if(!u)continue;var d=this.chipsIn(c),h=this.isDeclarativeTarget(c)?d:Array.from(c.querySelectorAll('[qti-draggable="true"]'));e[u]=d.map(function(e){return e.getAttribute("identifier")}).filter(function(e){return!!e}),t[u]=Math.max(d.length,h.length),n[u]=d}}catch(e){o=true;a=e}finally{try{if(!r&&s.return!=null){s.return()}}finally{if(o){throw a}}}this._dragDrop={dragsByTarget:e,countByTarget:t,nodesByTarget:n},this.requestUpdate()}},{key:"responseFromState",value:function e(){this.syncDragDropState();var e=this._dragDrop,t=e.dragsByTarget;return this.trackedDroppables.flatMap(function(e){var n;var r=e.getAttribute("identifier");return r?((n=t[r])!==null&&n!==void 0?n:[]).map(function(e){return"".concat(e," ").concat(r)}):[]})}},{key:"totalAssociationsFromState",value:function e(){return this.syncDragDropState(),Object.values(this._dragDrop.countByTarget).reduce(function(e,t){return e+t},0)}},{key:"droppableAtCapacityFromState",value:function e(e){var t;var n=parseInt(e.getAttribute("match-max")||"1",10),r=Number.isNaN(n)?1:n;if(r===0)return!1;var o=e.getAttribute("identifier");return(o?(t=this._dragDrop.countByTarget[o])!==null&&t!==void 0?t:0:0)>=r}},{key:"disableAnimations",get:function e(){return!this._enableFlipAnimations},set:function e(e){this._enableFlipAnimations=!e}},{key:"enableFlipAnimations",get:function e(){return this._enableFlipAnimations&&ir(this)}},{key:"collectAutoSizeTargets",value:function e(){return{draggables:this.trackedDraggables,droppables:this.trackedDroppables,dragContainers:this.trackedDragContainers}}},{key:"response",get:function e(){var e=this.getResponse,t=typeof e=="function"?e.call(this):void 0;return(Array.isArray(t)?t:(this.cacheInteractiveElements(),this.responseFromState())).join(",")},set:function e(e){var t=this;if(Array.isArray(e)){if(!this.trackedDroppables||this.trackedDroppables.length===0){this._pendingResponse=e,this._internals.setFormValue(JSON.stringify(e));return}var n=this.getValue,r=typeof n=="function"?n.call(this,e):e,o=Array.isArray(r)?r:typeof r=="string"&&r.length>0?[r]:[];this.reset(!1),o.forEach(function(e){return t.placeResponse(e)});var a=this.getResponse,s=typeof a=="function"?a.call(this):void 0;this._response=Array.isArray(s)?s:(this.cacheInteractiveElements(),this.responseFromState())}else this._response=typeof e=="string"&&e.length>0?[e]:[];this._internals.setFormValue(JSON.stringify(this._response))}},{key:"afterCache",value:function e(){if(this.updateMinDimensionsForDropZones(),this.applyConfiguredChoicesContainerWidth(),this._pendingResponse!==void 0){var e=this._pendingResponse;this._pendingResponse=void 0,this.response=e}}},{key:"autoSizeDropzoneWidth",get:function e(){return!this.dataset.choicesContainerWidth}},{key:"applyConfiguredChoicesContainerWidth",value:function e(){var e=this.dataset.choicesContainerWidth;e&&this.trackedDroppables.forEach(function(t){t.style.width="".concat(e,"px"),t.style.boxSizing="border-box"})}},{key:"shouldTreatBlockedMaxAsInvalid",value:function e(){return!0}},{key:"shouldReturnToInventoryOnInventoryDrop",value:function e(){return!1}},{key:"getFirstMessageAttribute",value:function e(e){var t=true,n=false,r=undefined;try{for(var o=e[Symbol.iterator](),a;!(t=(a=o.next()).done);t=true){var s=a.value;var l=this.getAttribute(s);if(l&&l.trim().length>0)return l}}catch(e){n=true;r=e}finally{try{if(!t&&o.return!=null){o.return()}}finally{if(n){throw r}}}var c=e.map(function(e){return e.toLowerCase()});var u=true,d=false,h=undefined;try{for(var p=Array.from(this.attributes)[Symbol.iterator](),f;!(u=(f=p.next()).done);u=true){var v=f.value;if(c.includes(v.name.toLowerCase())&&v.value.trim().length>0)return v.value}}catch(e){d=true;h=e}finally{try{if(!u&&p.return!=null){p.return()}}finally{if(d){throw h}}}return null}},{key:"allowDrop",value:function e(e,t){if(this.trackedDragContainers.includes(t))return!0;var n=this.trackedDroppables.includes(t),r=t.hasAttribute("disabled"),o=t.hasAttribute("data-drag-source");return r&&this.isSwapTarget(t)?!0:n&&(!r||o)}},{key:"handleDrop",value:function e(e,t){var n;var r=(n=this.dragState.dragClone)===null||n===void 0?void 0:n.getBoundingClientRect();this.dropDraggableInDroppable(e,t,r);var o=e.getAttribute("identifier");o&&this.updateInventoryBasedOnMatchMax(o),this.validate(),this.reportValidity()}},{key:"handleInvalidDrop",value:function e(e){var t;var n=this.dragState.sourceDroppable,r=this.dragState.currentTarget,o=!r,a=this.trackedDragContainers[0]||null;if(!e)return;if(n&&o&&a)this.dropDraggableInDroppable(e,a);else if(n&&this.trackedDroppables.includes(n))this.dropDraggableInDroppable(e,n,(t=this.dragState.dragClone)===null||t===void 0?void 0:t.getBoundingClientRect());else if(rZ(e,"dragging")){var s;this.restoreInventoryItem(e,(s=this.dragState.dragClone)===null||s===void 0?void 0:s.getBoundingClientRect());var l=e.getAttribute("identifier");l&&this.updateInventoryBasedOnMatchMax(l),this.cacheInteractiveElements(),this.checkAllMaxAssociations()}var c=this.totalAssociationsFromState(),u=this.maxAssociations>0&&c>=this.maxAssociations,d=!!r&&r.hasAttribute("disabled")&&!r.hasAttribute("data-drag-source");this._dropBlockedDueToMax=d&&u,this.validate(),this.reportValidity()}},{key:"animateReturn",value:function e(e,t){var n=this;!e||!t||!this.enableFlipAnimations||requestAnimationFrame(function(){ii(e,r7(t),n.flipAnimationConfig)})}},{key:"restoreInventoryItem",value:function e(e,t){r0(e),e.style.display="",e.style.position="",this.animateReturn(e,t)}},{key:"placeResponse",value:function e(e){var t=this;var n=M(e.split(" ").reverse()),r=n[0],o=n.slice(1),a=this.trackedDroppables.find(function(e){return e.getAttribute("identifier")===r});a&&o.forEach(function(e){if(!e)return;var n=r5(t.trackedDragContainers,e).at(0)||t.trackedDraggables.find(function(t){return t.getAttribute("identifier")===e});n&&t.dropDraggableInDroppable(n,a)})}},{key:"dropDraggableInDroppable",value:function e(e,t,n){var r=this;if(this.trackedDragContainers.includes(t)){if(!this.dragState.sourceDroppable){if(this.shouldReturnToInventoryOnInventoryDrop()){this.returnToInventory(e,n),this._dropBlockedDueToMax=!1,this.validate();return}this.restoreInventoryItem(e,n),this.cacheInteractiveElements(),this.checkAllMaxAssociations(),this._dropBlockedDueToMax=!1,this.validate();return}var o=e.getAttribute("identifier");this.removeChipFromDroppable(this.droppableHolding(e),e),o&&this.restoreOriginalInInventory(o,n),this.cacheInteractiveElements(),this.checkAllMaxAssociations(),this._dropBlockedDueToMax=!1,this.validate();return}var a=parseInt(t.getAttribute("match-max")||"1",10),s=Number.isNaN(a)?1:a,l=s===0||s>1,c=Array.from(t.querySelectorAll('[qti-draggable="true"]')),u=this.enableFlipAnimations&&c.length>0?r9(c):null;if(!l){var d;var h=(d=this.chipsIn(t)[0])!==null&&d!==void 0?d:this.isDeclarativeTarget(t)?null:t.querySelector('[qti-draggable="true"]');if(h){var p=h.getAttribute("identifier"),f=h.getBoundingClientRect();this.removeChipFromDroppable(t,h);var v=this.dragState.sourceDroppable,g=this.isDeclarativeTarget(t)&&v&&v!==t&&this.isDeclarativeTarget(v)?v:null;g?(this.placeChip(g,h),r2(g,!0),this.animateReturn(h,f)):p&&this.restoreOriginalInInventory(p,f)}}var m=e.cloneNode(!0);m.removeAttribute("style"),m.removeAttribute("data-keyboard-dragging"),m.setAttribute("qti-draggable","true"),m.setAttribute("tabindex","0"),this.isDeclarativeTarget(t)?(m.setAttribute("part","drag"),m.setAttribute("exportparts","control: drag-control, label: drag-label, correction, correction-correct, correction-incorrect"),this.placeChip(t,m)):t.tagName==="SLOT"?m.setAttribute("slot",t.getAttribute("name")||""):(t.tagName==="QTI-SIMPLE-ASSOCIABLE-CHOICE"&&m.setAttribute("slot","qti-simple-associable-choice"),t.appendChild(m)),r2(t,!0),this.syncDragDropState(),u&&this.enableFlipAnimations&&io(u,this.flipAnimationConfig),n&&this.enableFlipAnimations&&requestAnimationFrame(function(){var e=m.getBoundingClientRect(),t=n.left-e.left,o=n.top-e.top;(t!==0||o!==0)&&m.animate([{transform:"translate(".concat(t,"px, ").concat(o,"px)"),opacity:.8},{transform:"translate(0, 0)",opacity:1}],{duration:r.flipAnimationConfig.duration||200,easing:r.flipAnimationConfig.easing||"ease",fill:"both"})});var b=e.getAttribute("identifier");b&&this.updateInventoryBasedOnMatchMax(b),this.cacheInteractiveElements(),this.checkAllMaxAssociations()}},{key:"returnToInventory",value:function e(e,t){var n=this;var r=e.getAttribute("identifier");r&&(this.trackedDroppables.forEach(function(e){var t=n.chipsIn(e).filter(function(e){return e.getAttribute("identifier")===r});t.forEach(function(t){return n.removeChipFromDroppable(e,t)}),t.length>0&&n.chipsIn(e).length===0&&r2(e,!1)}),this.restoreOriginalInInventory(r,t)),this.cacheInteractiveElements(),this.checkAllMaxAssociations()}},{key:"restoreOriginalInInventory",value:function e(e,t){var n=this;var r=r5(this.trackedDragContainers,e),o=new Set(r),a=[];this.trackedDragContainers.forEach(function(e){e.querySelectorAll('[qti-draggable="true"]').forEach(function(e){return!o.has(e)&&a.push(e)})});var s=this.enableFlipAnimations&&a.length>0?r9(a):null;r.forEach(function(e){r0(e),e.style.display="",e.style.visibility="visible"}),s&&this.enableFlipAnimations&&io(s,this.flipAnimationConfig),r.forEach(function(e){return n.animateReturn(e,t)})}},{key:"updateInventoryBasedOnMatchMax",value:function e(e){var t=this;var n=r5(this.trackedDragContainers,e),r=r4(this.trackedDraggables,e),o=this.trackedDroppables.reduce(function(n,r){return t.isDeclarativeTarget(r)?n+t.chipsIn(r).filter(function(t){return t.getAttribute("identifier")===e}).length:n+r.querySelectorAll('[identifier="'.concat(e,'"]')).length},0);n.forEach(function(e){rJ(e,"placeholder",r!==0&&o>=r)})}},{key:"checkAllMaxAssociations",value:function e(){var e=this;var t=this.totalAssociationsFromState(),n=this.resolveDisableAfterMaxReached({defaultWhenUnset:!0}),r=this.maxAssociations>0&&t>=this.maxAssociations;this.trackedDroppables.forEach(function(t){var o=t.hasAttribute("data-drag-source");(e.droppableAtCapacityFromState(t)||n&&r)&&!o?t.setAttribute("disabled",""):t.removeAttribute("disabled")})}},{key:"saveResponse",value:function e(e){var t=this.getResponse,n=e!==null&&e!==void 0?e:typeof t=="function"?t.call(this):void 0,r=Array.isArray(n)?n:typeof n=="string"?[n]:(this.cacheInteractiveElements(),this.responseFromState());this._response=r,this._internals.setFormValue(JSON.stringify(this._response)),this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:this.responseIdentifier,response:r}})),this.requestUpdate()}},{key:"reset",value:function e(){var e=this;var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.trackedDroppables.forEach(function(t){e.clearChips(t)}),this.trackedDraggables.forEach(function(t){var n=t.getAttribute("identifier");n&&e.restoreOriginalInInventory(n)}),this.resetDragState(),this.cacheInteractiveElements(),this._response=[],this._internals.setFormValue(JSON.stringify(this._response)),t&&this.saveResponse()}},{key:"validate",value:function e(){var e,t;var n=this.totalAssociationsFromState(),r=this.maxAssociations>0&&n>=this.maxAssociations,o=this.maxAssociations>0&&n>this.maxAssociations,a=this.minAssociations>0&&n<this.minAssociations,s="",l=!0;o?(s=this.getFirstMessageAttribute(["data-max-associations-message","data-max-selections-message"])||this.dataset.maxAssociationsMessage||this.dataset.maxSelectionsMessage||"You've selected too many associations. Maximum allowed is ".concat(this.maxAssociations,"."),l=!1):r&&this._dropBlockedDueToMax&&this.shouldTreatBlockedMaxAsInvalid()?(s=this.getFirstMessageAttribute(["data-max-associations-message","data-max-selections-message"])||this.dataset.maxAssociationsMessage||this.dataset.maxSelectionsMessage||"You've selected too many associations. Maximum allowed is ".concat(this.maxAssociations,"."),l=!1):a?(s=this.getFirstMessageAttribute(["data-min-associations-message","data-min-selections-message"])||this.dataset.minAssociationsMessage||this.dataset.minSelectionsMessage||"Please select at least ".concat(this.minAssociations," ").concat(this.minAssociations===1?"association":"associations","."),l=!1,this._dropBlockedDueToMax=!1):this._dropBlockedDueToMax=!1;var c=(e=(t=this.trackedDroppables[0])!==null&&t!==void 0?t:this.trackedDraggables[0])!==null&&e!==void 0?e:this;return this.setInteractionValidity(l,s,c,{suppressInline:!0}),l}},{key:"reportValidity",value:function e(){return p(f(n.prototype),"reportValidity",this).call(this)}}]);return n}(g);return c=new WeakMap,fY([n({type:Number,reflect:!0,attribute:"min-associations"})],m.prototype,"minAssociations",void 0),fY([n({type:Number,reflect:!0,attribute:"max-associations"})],m.prototype,"maxAssociations",null),fY([u({context:pP})],m.prototype,"_dragDrop",void 0),fY([n({type:Boolean,attribute:"disable-animations"})],m.prototype,"disableAnimations",null),fY([n({attribute:"response",reflect:!1,noAccessor:!0,converter:P({emptyAs:[]})})],m.prototype,"response",null),m};var fZ=/*#__PURE__*/function(){"use strict";function e(){l(this,e)}d(e,[{key:"getInsertPosition",value:function e(e,t,n,r,o){var a=e.indexOf(n);if(a===-1)return null;var s=n.getBoundingClientRect(),l=(o-s.top)/s.height,c=Math.min(1,Math.max(0,l))>.5;return{index:a,placeAfter:c}}}]);return e}();var f0=new fZ;var f1={borderStyle:"2px dashed",borderColor:"var(--qti-drop-highlight-border-color, #c1c1c1)",background:"transparent",transitionDuration:150};var f3=function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:'[qti-draggable="true"]';var n,r,o,a,c,u,h,g,m,b,y,w,q,k,x;var _=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,h);iU(e,n);iU(e,r);iU(e,o);iU(e,a);iU(e,c);iU(e,u);ij(e,n,null),ij(e,r,null),ij(e,o,ia()),ij(e,a,{hoveredSlot:null,originalPositions:new Map}),ij(e,c,new Set),e.sortablePlaceholderConfig={},e.sortableAnimationConfig={duration:150,easing:"ease"};return e}d(t,[{key:"allowReorder",get:function e(){var e;return(e=iL(this,u))!==null&&e!==void 0?e:this.resolveAllowReorder({defaultWhenUnset:!0})},set:function e(e){ij(this,u,e)}},{key:"isDraggingFromSlot",get:function e(){return iL(this,n)!==null}},{key:"findContainingDroppable",value:function e(e){return ic(e,this.trackedDroppables)}},{key:"initiateDrag",value:function e(e,a,s,l){var u=this;for(var d=arguments.length,v=new Array(d>4?d-4:0),g=4;g<d;g++){v[g-4]=arguments[g]}ij(this,n,null),ij(this,o,ia()),iz(this,h,q).call(this);var b=this.findContainingDroppable(e);if(ij(this,r,b),b&&this.allowReorder){ij(this,n,b),iL(this,o).sortContainer=b;var y=e.getBoundingClientRect();iL(this,o).placeholder=il(e,y,this.sortablePlaceholderConfig);var k=e.getAttribute("slot");k&&iL(this,o).placeholder.setAttribute("slot",k),iL(this,o).placeholder.style.visibility="hidden",b.appendChild(iL(this,o).placeholder),this.trackedDroppables.forEach(function(e){if(e!==b&&e.hasAttribute("disabled")){if(iz(u,h,m).call(u,e)&&iz(u,h,w).call(u,e))return;e.removeAttribute("disabled"),iL(u,c).add(e)}})}var x=I(v,1),_=x[0];p(f(t.prototype),"initiateDrag",this).call(this,e,a,s,l,_)}},{key:"cleanupSortableState",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;var t=true,r=false,s=undefined;if(e)try{for(var l=iL(this,a).originalPositions[Symbol.iterator](),u;!(t=(u=l.next()).done);t=true){var d=I(u.value,2),p=d[0],f=d[1];f.appendChild(p)}}catch(e){r=true;s=e}finally{try{if(!t&&l.return!=null){l.return()}}finally{if(r){throw s}}}iL(this,o).placeholder&&iL(this,o).placeholder.remove(),is(iL(this,o)),iL(this,c).clear(),ij(this,n,null),iz(this,h,q).call(this)}},{key:"onSortableDragMove",value:function e(e,t){if(!this.isDraggingFromSlot)return;var n=rX(this.trackedDroppables,e,t,this.dragState.dragClone,this.collisionDetectionAlgorithm);n?iz(this,h,k).call(this,n):iz(this,h,x).call(this)}},{key:"handleDragMove",value:function e(e,n){var r;(r=Object.getPrototypeOf(t.prototype).handleDragMove)===null||r===void 0?void 0:r.call(this,e,n),this.onSortableDragMove(e,n)}},{key:"allowDrop",value:function e(e,n){return!this.allowReorder&&iL(this,r)&&!this.trackedDragContainers.includes(iL(this,r))&&n!==iL(this,r)&&this.trackedDroppables.includes(n)?!1:this.isDraggingFromSlot&&this.trackedDroppables.includes(n)?iz(this,h,m).call(this,n)?!iz(this,h,w).call(this,n):!0:this.isDraggingFromSlot&&this.trackedDragContainers.includes(n)?!0:p(f(t.prototype),"allowDrop",this).call(this,e,n)}},{key:"handleDrop",value:function e(e,n){p(f(t.prototype),"handleDrop",this).call(this,e,n),this.cleanupSortableState(!1)}},{key:"handleInvalidDrop",value:function e(e){this.cleanupSortableState(),p(f(t.prototype),"handleInvalidDrop",this).call(this,e)}}]);return t}(e);n=new WeakMap,r=new WeakMap,o=new WeakMap,a=new WeakMap,c=new WeakMap,u=new WeakMap,h=new WeakSet,g=function e(e){return e.querySelector(t)},m=function e(e){var t=iz(this,h,b).call(this,e);return t===0||t>1},b=function e(e){var t=parseInt(e.getAttribute("match-max")||"1",10);return Number.isNaN(t)?1:t},y=function e(e){return e.querySelectorAll(t).length},w=function e(e){var t=iz(this,h,b).call(this,e);return t===0?!1:iz(this,h,y).call(this,e)>=t},q=function e(){ij(this,a,{hoveredSlot:null,originalPositions:new Map})},k=function e(e){if(!iL(this,n)||e===iL(this,n)){iz(this,h,x).call(this);return}if(iL(this,a).hoveredSlot===e)return;iz(this,h,x).call(this);var t=iz(this,h,g).call(this,e);if(!t){iL(this,o).placeholder&&e.appendChild(iL(this,o).placeholder),iL(this,a).hoveredSlot=e;return}if(iz(this,h,m).call(this,e)){if(iz(this,h,w).call(this,e)){iL(this,o).placeholder&&iL(this,n)&&iL(this,n).appendChild(iL(this,o).placeholder),iL(this,a).hoveredSlot=null;return}iL(this,o).placeholder&&e.appendChild(iL(this,o).placeholder),iL(this,a).hoveredSlot=e;return}if(this.isDeclarativeTarget(e)){var r;((r=iL(this,o).placeholder)===null||r===void 0?void 0:r.parentElement)&&iL(this,o).placeholder.remove(),iL(this,a).hoveredSlot=e;return}var s=r9([t]);iL(this,a).originalPositions.set(t,e),iL(this,o).placeholder&&iL(this,o).placeholder.parentElement&&iL(this,o).placeholder.remove(),iL(this,n).appendChild(t),iL(this,o).placeholder&&e.appendChild(iL(this,o).placeholder),iL(this,a).hoveredSlot=e,io(s,this.sortableAnimationConfig)},x=function e(){if(iL(this,a).originalPositions.size===0&&iL(this,a).hoveredSlot===null)return;var e=Array.from(iL(this,a).originalPositions.keys()),t=e.length>0?r9(e):null;var r=true,s=false,l=undefined;try{for(var c=iL(this,a).originalPositions[Symbol.iterator](),u;!(r=(u=c.next()).done);r=true){var d=I(u.value,2),h=d[0],p=d[1];p.appendChild(h)}}catch(e){s=true;l=e}finally{try{if(!r&&c.return!=null){c.return()}}finally{if(s){throw l}}}iL(this,o).placeholder&&iL(this,n)&&iL(this,n).appendChild(iL(this,o).placeholder),t&&io(t,this.sortableAnimationConfig),iL(this,a).originalPositions.clear(),iL(this,a).hoveredSlot=null};var E=_;return E};var f2=[aY,aZ,aJ,ob(tW())];var f5=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},f4=fJ(a2,"qti-simple-associable-choice","[part~='drop']","slot[name='qti-simple-associable-choice']","pointerWithin"),f6,f8,f7,f9=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t);iU(e,f6);e._childrenMap=[],e._registerChoiceHandler=e._registerChoice.bind(e),e.addEventListener("register-qti-simple-associable-choice",e._registerChoiceHandler);return e}d(t,[{key:"_registerChoice",value:function e(e){var t;var n=e.composedPath()[0];if((t=this.shadowRoot)===null||t===void 0?void 0:t.contains(n))return;var r=n;this._childrenMap.includes(r)||(this._childrenMap=N(this._childrenMap).concat([r]))}},{key:"getResponse",value:function e(){var e=[];for(var t=0;t<iL(this,f6,f7);t++){var n,r,o,a;var s=(n=this.shadowRoot)===null||n===void 0?void 0:n.querySelector("[part~='drop'][identifier=\"droplist".concat(t,'_left"]')),l=(r=this.shadowRoot)===null||r===void 0?void 0:r.querySelector("[part~='drop'][identifier=\"droplist".concat(t,'_right"]')),c=s&&((o=this.chipsIn(s)[0])===null||o===void 0?void 0:o.getAttribute("identifier")),u=l&&((a=this.chipsIn(l)[0])===null||a===void 0?void 0:a.getAttribute("identifier"));c&&u&&e.push("".concat(c," ").concat(u))}return e}},{key:"totalAssociationsFromState",value:function e(){return this.syncDragDropState(),this.getResponse().length}},{key:"getValue",value:function e(e){var t;return(t=e===null||e===void 0?void 0:e.flatMap(function(e,t){var n=e.split(" ");return n.length!==2?[]:["".concat(n[0]," droplist").concat(t,"_left"),"".concat(n[1]," droplist").concat(t,"_right")]}))!==null&&t!==void 0?t:[]}},{key:"render",value:function e(){var e=this;return o5(tB(),this._childrenMap.length>0&&Array.from({length:iL(this,f6,f7)},function(t,n){return o5(tF(),iz(e,f6,f8).call(e,"droplist".concat(n,"_left"),"left".concat(n)),iz(e,f6,f8).call(e,"droplist".concat(n,"_right"),"right".concat(n)))}))}},{key:"updated",value:function e(e){p(f(t.prototype),"updated",this).call(this,e),e.has("_childrenMap")&&this.cacheInteractiveElements()}},{key:"disconnectedCallback",value:function e(){p(f(t.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("register-qti-simple-associable-choice",this._registerChoiceHandler)}}]);return t}(f3(f4,'[qti-draggable="true"]'));f6=new WeakSet,f8=function e(e,t){var n;var r,o;var a=(n=(o=this._dragDrop)===null||o===void 0?void 0:(r=o.nodesByTarget)===null||r===void 0?void 0:r[e])!==null&&n!==void 0?n:[];return o5(t$(),t,e,pI(a,function(e){return e.getAttribute("identifier")},function(e){return e}))},f7=function e(){return this.maxAssociations>0?this.maxAssociations:Math.ceil(this._childrenMap.length/2)},f9.styles=f2;var ve=f9;f5([r()],ve.prototype,"_childrenMap",void 0);var vt=[{tag:"qti-associate-interaction",ctor:ve}];var vn=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},vr=function e(e,t){var r;var a=/*#__PURE__*/function(e){"use strict";v(n,e);function n(){l(this,n);var e;e=s(this,n,arguments);iU(e,r);e._choiceElements=[],ij(e,r,null),e.minChoices=0,e.maxChoices=1,e._handleDisabledChange=function(t,n){e._choiceElements.forEach(function(e){return e.disabled=n})},e._handleReadonlyChange=function(t,n){e._choiceElements.forEach(function(e){return e.readonly=n})},e.response="",e._handleValueChange=function(){e._internals.setFormValue(e.value),e._updateChoiceSelection()};return e}d(n,[{key:"_handleMaxChoicesChange",value:function e(e,t){this._determineInputType()}},{key:"value",get:function e(){return Array.isArray(this.response)&&this.response.length===0||this.response===""?null:Array.isArray(this.response)?this.response.join(","):this.response},set:function e(e){this.maxChoices>1&&(typeof e=="string"||e===null)?this.response=e?e.toString().split(","):[]:this.response=e||""}},{key:"firstUpdated",value:function e(){p(f(n.prototype),"firstUpdated",this).call(this),this._updateChoiceSelection()}},{key:"connectedCallback",value:function e(){var e=this;p(f(n.prototype),"connectedCallback",this).call(this),this.addEventListener("activate-".concat(t),this._choiceElementSelectedHandler),ij(this,r,new MutationObserver(function(){return e._syncChoicesFromDOM()})),iL(this,r).observe(this,{childList:!0,subtree:!0}),this._syncChoicesFromDOM()}},{key:"disconnectedCallback",value:function e(){p(f(n.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("activate-".concat(t),this._choiceElementSelectedHandler),iL(this,r)&&(iL(this,r).disconnect(),ij(this,r,null))}},{key:"_syncChoicesFromDOM",value:function e(){var e=this;var n=new Set(this._choiceElements);this._choiceElements=Array.from(this.querySelectorAll(t)),this._choiceElements.forEach(function(t){n.has(t)||(e.disabled&&(t.disabled=!0),t.readonly=e.readonly,t.internals&&!t.internals.ariaChecked&&(t.internals.ariaChecked="false"))}),this._determineInputType();var r=new Set(this._choiceElements.map(function(e){return e.identifier}));if(Array.isArray(this.response)){var o=this.response.filter(function(e){return r.has(e)});o.length!==this.response.length&&(this.response=o)}else this.response&&!r.has(this.response)&&(this.response="");this._updateChoiceSelection()}},{key:"validate",value:function e(){var e=this;var t=this._choiceElements.filter(function(t){return e._getChoiceChecked(t)}).length,n=!0,r="";this.maxChoices!==0&&t>this.maxChoices?(n=!1,r=this.dataset.maxSelectionsMessage||"Please select no more than ".concat(this.maxChoices," ").concat(this.maxChoices===1?"option":"options",".")):t<this.minChoices&&(n=!1,r=this.dataset.minSelectionsMessage||"Please select at least ".concat(this.minChoices," ").concat(this.minChoices===1?"option":"options","."));var o=this._choiceElements.find(function(t){return e.contains(t)})||this;return this.setInteractionValidity(n,r,o,{suppressInline:!0}),n}},{key:"reportValidity",value:function e(){return p(f(n.prototype),"reportValidity",this).call(this)}},{key:"_determineInputType",value:function e(){this._internals.role=this.maxChoices===1?"radiogroup":null;var e=this.maxChoices===1?"radio":"checkbox";this._interactionContext.choiceRole!==e&&(this._interactionContext=_(k({},this._interactionContext),{choiceRole:e}))}},{key:"_choiceElementSelectedHandler",value:function e(e){var t=this;this._toggleChoiceChecked(e.target);var n=this.resolveDisableAfterMaxReached({defaultWhenUnset:!1});this.maxChoices===1?this._choiceElements.forEach(function(n){n.identifier!==e.detail.identifier&&t._setChoiceChecked(n,!1)}):this.maxChoices!==0&&n&&(this._choiceElements.filter(function(e){return t._getChoiceChecked(e)}).length>=this.maxChoices?this._choiceElements.forEach(function(e){t._getChoiceChecked(e)||(e.disabled=!0)}):this._choiceElements.forEach(function(e){return e.disabled=!1})),this._handleChoiceSelection()}},{key:"_setChoiceChecked",value:function e(e,t){var n;((n=e.internals)===null||n===void 0?void 0:n.states)&&(t?(e.internals.states.add("checked"),e.internals.ariaChecked="true"):(e.internals.states.delete("checked"),e.internals.ariaChecked="false"))}},{key:"_getChoiceChecked",value:function e(e){return e.internals.states.has("checked")}},{key:"_toggleChoiceChecked",value:function e(e){var t=this._getChoiceChecked(e);this._setChoiceChecked(e,!t)}},{key:"_handleChoiceSelection",value:function e(){var e=this;var t=this._choiceElements.filter(function(t){return e._getChoiceChecked(t)}).map(function(e){return e.identifier});this.response=this.maxChoices===1?t[0]||"":t,this.validate(),this.reportValidity(),this.saveResponse(this.response)}},{key:"_updateChoiceSelection",value:function e(){var e=this;var t=Array.isArray(this.response)?this.response:[this.response];this._choiceElements.forEach(function(n){var r=t.includes(n.identifier);e._setChoiceChecked(n,r)})}}]);return n}(e);return r=new WeakMap,vn([o("#validation-message")],a.prototype,"_validationMessageElement",void 0),vn([n({type:Number,attribute:"min-choices"})],a.prototype,"minChoices",void 0),vn([n({type:Number,attribute:"max-choices"})],a.prototype,"maxChoices",void 0),vn([O("maxChoices")],a.prototype,"_handleMaxChoicesChange",null),vn([O("disabled",{waitUntilFirstUpdate:!0})],a.prototype,"_handleDisabledChange",void 0),vn([O("readonly",{waitUntilFirstUpdate:!0})],a.prototype,"_handleReadonlyChange",void 0),vn([n({attribute:"response",reflect:!1,converter:P({emptyAs:""})})],a.prototype,"response",void 0),vn([O("response",{waitUntilFirstUpdate:!0})],a.prototype,"_handleValueChange",void 0),a};var vi=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},vo=function e(e,t){var r,o,a,c,u,h,g,m,b,y,w,q;var k=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,u);iU(e,r,[]);iU(e,o,["qti-labels-none","qti-labels-decimal","qti-labels-lower-alpha","qti-labels-upper-alpha"]);iU(e,a,["qti-labels-suffix-none","qti-labels-suffix-period","qti-labels-suffix-parenthesis"]);iU(e,c,null);return e}d(t,[{key:"class",get:function e(){return iL(this,r).join(" ")},set:function e(e){ij(this,r,iz(this,u,h).call(this,e)),iz(this,u,g).call(this)}},{key:"attributeChangedCallback",value:function e(e,n,r){p(f(t.prototype),"attributeChangedCallback",this).call(this,e,n,r),e==="class"&&n!==r&&(this.class=r!==null&&r!==void 0?r:"")}},{key:"updated",value:function e(e){p(f(t.prototype),"updated",this).call(this,e),iz(this,u,g).call(this)}},{key:"connectedCallback",value:function e(){var e=this;var n;p(f(t.prototype),"connectedCallback",this).call(this),this.class=(n=this.getAttribute("class"))!==null&&n!==void 0?n:"",ij(this,c,new MutationObserver(function(t){t.some(function(e){return e.type==="childList"||e.type==="attributes"&&e.attributeName==="style"})&&iz(e,u,g).call(e)})),iL(this,c).observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]})}},{key:"disconnectedCallback",value:function e(){var e;p(f(t.prototype),"disconnectedCallback",this).call(this),(e=iL(this,c))===null||e===void 0?void 0:e.disconnect(),ij(this,c,null)}}]);return t}(e);return r=new WeakMap,o=new WeakMap,a=new WeakMap,c=new WeakMap,u=new WeakSet,h=function e(e){return e?e.split(/\s+/).map(function(e){return e.trim()}).filter(Boolean).filter(function(e,t,n){return n.indexOf(e)===t}):[]},g=function e(){var e=this;var t=Array.from(this.querySelectorAll("qti-simple-choice")).map(function(e){return e}),n=iz(this,u,m).call(this,t),r=iz(this,u,b).call(this),o=iz(this,u,y).call(this);n.forEach(function(t,n){t.marker=iz(e,u,w).call(e,n+1,r,o)})},m=function e(e){return e.map(function(e,t){var n=Number(e.style.order);return{el:e,order:Number.isFinite(n)?n:t+1,index:t}}).sort(function(e,t){return e.order-t.order||e.index-t.index}).map(function(e){return e.el})},b=function e(){var e=this;var t;return(t=iL(this,r).filter(function(t){return iL(e,o).includes(t)}).pop())!==null&&t!==void 0?t:null},y=function e(){var e=this;var t;return(t=iL(this,r).filter(function(t){return iL(e,a).includes(t)}).pop())!==null&&t!==void 0?t:null},w=function e(e,t,n){var r=t;if(!r&&n&&n!=="qti-labels-suffix-none"&&(r="qti-labels-upper-alpha"),!r||r==="qti-labels-none")return"";var o="";switch(r){case"qti-labels-decimal":o="".concat(e);break;case"qti-labels-lower-alpha":o=iz(this,u,q).call(this,e,"lower");break;case"qti-labels-upper-alpha":o=iz(this,u,q).call(this,e,"upper");break}return n==="qti-labels-suffix-period"?"".concat(o,"."):n==="qti-labels-suffix-parenthesis"?"".concat(o,")"):o},q=function e(e,t){var n=e,r="",o=t==="lower"?97:65;for(;n>0;)n-=1,r=String.fromCharCode(o+n%26)+r,n=Math.floor(n/26);return r},vi([n({type:String,attribute:"class"})],k.prototype,"class",null),k};var va=[aY,aZ,ob(tH())];var vs=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},vl,vc,vu=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,vl);e.orientation="vertical";return e}d(t,[{key:"render",value:function e(){return o5(tQ(),iz(this,vl,vc))}}]);return t}(vo(vr(a2,"qti-simple-choice"),"qti-simple-choice"));vl=new WeakSet,vc=function e(){var e=this.querySelectorAll("qti-simple-choice");this.style.setProperty("--item-count",e.length.toString())},vu.styles=va;var vd=vu;vs([n({type:String})],vd.prototype,"orientation",void 0);var vh=[{tag:"qti-choice-interaction",ctor:vd}];var vp=[aY,ob(tG())];var vf=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},vv='\nconst postToParentWindows = (type, data) => {\n window.top.postMessage(data ? { type, data } : { type }, \'*\');\n let w = window.parent;\n while (w) {\n if (w !== window.top) {\n w.postMessage({ type, data }, \'*\');\n }\n if (w !== w.parent) {\n w = w.parent;\n } else {\n w = null;\n }\n }\n};\n\nwindow.CES = {\n media: null,\n response: null,\n load: () => {\n let resolveCount = 0;\n\n const handleMessage = (event) => {\n if (event.data.type === "mediaData") {\n const media = event.data.data;\n CES.media = media;\n resolveCount++;\n } else if (event.data.type === "responseData") {\n const response = event.data.data;\n if (response && Array.isArray(response) && response.length > 0) {\n // state is stored in the first element of the array\n CES.response = response[0];\n // Wait a short moment to ensure CES.response is set\n setTimeout(() => {\n // Re-create the Controller instance if it exists\n if (typeof Controller === \'function\') {\n console.log("Re-creating Controller instance");\n ctrl = new Controller();\n }\n }, 50);\n } else { \n CES.response = response;\n }\n resolveCount++;\n }\n if (resolveCount === 2) {\n //window.removeEventListener("message", handleMessage);\n }\n };\n window.addEventListener("message", handleMessage);\n postToParentWindows("getMedia");\n postToParentWindows("getResponse");\n },\n setResponse: (data) => {\n postToParentWindows("setResponse", data);\n },\n getResponse: () => {\n return CES.response;\n },\n getMedia: () => {\n return CES.media;\n },\n setStageHeight: () => {\n postToParentWindows("setStageHeight");\n },\n};\nCES.load();\n',vg="\n (function() {\n var blobUrlReceived = null;\n \n const createIframe = () => {\n if (!blobUrlReceived || !document.body) return;\n var n = document.createElement('iframe');\n n.frameBorder = '0';\n n.scrolling = 'no';\n n.src = blobUrlReceived;\n n.style.width = '100%';\n n.style.height = '100%';\n document.body.appendChild(n);\n };\n \n const handleMessage = (event) => {\n if (event.data.type === 'blobUrl') {\n blobUrlReceived = event.data.data;\n window.removeEventListener('message', handleMessage);\n createIframe();\n }\n };\n \n window.addEventListener('message', handleMessage);\n \n // Wait for document ready before requesting blobUrl\n const requestBlobUrl = () => {\n let w = window.parent;\n while (w) {\n w.postMessage({ type: 'getBlobUrl' }, '*');\n if (w !== w.parent) {\n w = w.parent;\n } else {\n w = null;\n }\n }\n };\n \n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', requestBlobUrl);\n } else {\n requestBlobUrl();\n }\n })();\n",vm,vb,vy,vw,vq,vk,vx,v_,vE,vC,vS,vR,vA=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t);iU(e,vq);iU(e,vm);iU(e,vb);iU(e,vy);iU(e,vw);ij(e,vm,""),ij(e,vb,null),ij(e,vy,null),e._errorMessage=null,ij(e,vw,null),e.handlePostMessage=e.handlePostMessage.bind(e);return e}d(t,[{key:"connectedCallback",value:function e(){var e=this;p(f(t.prototype),"connectedCallback",this).call(this);var n=this.data;if(!n){var r=this.querySelector("object[data]");if(r){n=r.getAttribute("data");var o=r.getAttribute("width"),a=r.getAttribute("height");o&&this.setAttribute("width",o),a&&this.setAttribute("height",a)}}if(!n){this._errorMessage="No manifest path found (neither data attribute nor object child)";return}var s=n.startsWith("http")||n.startsWith("blob")?n:y((this.baseItemUrl||"")+"/"+n);ij(this,vb,new URL(s,window.location.href).toString()),fetch(s).then(function(e){return e.json()}).then(function(t){e.manifest=t,e.setupCES()}).catch(function(t){e._errorMessage=t})}},{key:"setupCES",value:function e(){return a(function(){var e,t,n,r,o,a,s,l,c,u,d,h,p,f,v,g,m,b,y,w,q,k,x,_,E,C,S,R,A,T,I,P,O,M,N,D,L;return z(this,function(U){switch(U.label){case 0:return[4,this.updateComplete];case 1:U.sent();l=(o=this.shadowRoot)===null||o===void 0?void 0:o.querySelector("#pciContainer");if(!l){this._errorMessage="pciContainer iframe not found";return[2]}l.getAttribute("src")||l.setAttribute("src","about:blank");c=(e=(t=l.contentDocument)!==null&&t!==void 0?t:(a=l.contentWindow)===null||a===void 0?void 0:a.document)!==null&&e!==void 0?e:null;u=c;if(u)return[3,3];return[4,new Promise(function(e){return l.addEventListener("load",function(){return e()},{once:!0})})];case 2:u=(U.sent(),c=(n=(r=l.contentDocument)!==null&&r!==void 0?r:(s=l.contentWindow)===null||s===void 0?void 0:s.document)!==null&&n!==void 0?n:null);U.label=3;case 3:if(u,!c){this._errorMessage="pciContainer iframe document not available";return[2]}if(!this.manifest.script||this.manifest.script.length===0){this._errorMessage="No script found in manifest";return[2]}if(!this.manifest.style||this.manifest.style.length===0){this._errorMessage="No style found in manifest";return[2]}d=this.manifest.style[0],h=iz(this,vq,vE).call(this);return[4,iz(this,vq,vR).call(this,d,h)];case 4:p=U.sent(),f=p.url;if(!(p.baseUrl&&!iL(this,vy)&&ij(this,vy,p.baseUrl),!0))return[3,15];v="";if(!(this.manifest.media&&this.manifest.media.length>0))return[3,6];g=this.manifest.media[0];return[4,iz(this,vq,vR).call(this,g,h,{returnText:!0})];case 5:m=U.sent();if(v=m.url,m.baseUrl&&!iL(this,vy)&&ij(this,vy,m.baseUrl),m.text){b=m.text;if(!(b.includes("postToParentWindows")||b.includes("window.CES"))){y="<script>"+vv+"<\/script>",w=b.indexOf("<head>");w!==-1?b=b.slice(0,w+6)+y+b.slice(w+6):b=y+b}q=new Blob([b],{type:"text/html"});ij(this,vw,URL.createObjectURL(q))}return[3,8];case 6:k=this.data||"manifest.json",x=k.includes("/")?k.substring(0,k.lastIndexOf("/")):"",_=x?"".concat(x,"/index.html"):"index.html";return[4,iz(this,vq,vR).call(this,_,h,{returnText:!0})];case 7:E=U.sent();if(v=E.url,E.baseUrl&&!iL(this,vy)&&ij(this,vy,E.baseUrl),E.text){C=E.text;if(!(C.includes("postToParentWindows")||C.includes("window.CES"))){S="<script>"+vv+"<\/script>",R=C.indexOf("<head>");R!==-1?C=C.slice(0,R+6)+S+C.slice(R+6):C=S+C}A=new Blob([C],{type:"text/html"});ij(this,vw,URL.createObjectURL(A))}U.label=8;case 8:if(!(v&&!iL(this,vw)))return[3,15];U.label=9;case 9:U.trys.push([9,14,,15]);return[4,fetch(v)];case 10:T=U.sent();if(!T.ok)return[3,12];return[4,T.text()];case 11:I=U.sent();if(!(I.includes("postToParentWindows")||I.includes("window.CES"))){P="<script>"+vv+"<\/script>",O=I.indexOf("<head>");O!==-1?I=I.slice(0,O+6)+P+I.slice(O+6):I=P+I}M=new Blob([I],{type:"text/html"});ij(this,vw,URL.createObjectURL(M));return[3,13];case 12:console.error("Failed to fetch index.html: ".concat(T.status));U.label=13;case 13:return[3,15];case 14:N=U.sent();console.error("Error fetching index.html: ".concat(N));return[3,15];case 15:D="<script>".concat(vg,"<\/script>");window.addEventListener("message",this.handlePostMessage);L="\n <!DOCTYPE html>\n <html>\n <head>\n ".concat(f?"<link href='".concat(f,'\' rel="stylesheet" />'):"","\n ").concat(D,"\n </head>\n <body></body>\n </html>\n ");l.srcdoc=L;return[2]}})}).call(this)}},{key:"handlePostMessage",value:function e(e){var t=this;var n=e.data,r=n.type,o=n.data;switch(r){case"setResponse":(o===null||!(Array.isArray(o)&&o.length===1&&o[0]===""))&&(ij(this,vm,o),this.saveResponse(o));break;case"getResponse":{iz(this,vq,v_).call(this,"responseData",iL(this,vm));break}case"getBlobUrl":{iL(this,vw)&&(iz(this,vq,v_).call(this,"blobUrl",iL(this,vw)),e.source&&e.source!==window&&e.source.postMessage({type:"blobUrl",data:iL(this,vw)},"*"));break}case"getMedia":{var a=iz(this,vq,vE).call(this),s=this.manifest.media.map(function(e){if(e.startsWith("http")||e.startsWith("blob"))return e;var n=iL(t,vy)||a[0];return n?new URL(e,n.endsWith("/")?n:"".concat(n,"/")).toString():e});iz(this,vq,v_).call(this,"mediaData",s);break}case"setStageHeight":console.log("setStageHeight not implemented");break}}},{key:"validate",value:function e(){if(!iL(this,vm))return!1;if(Array.isArray(iL(this,vm))){if(iL(this,vm).length===0)return!1;var e=true,t=false,n=undefined;try{for(var r=iL(this,vm)[Symbol.iterator](),o;!(e=(o=r.next()).done);e=true){var a=o.value;if(a!==""&&a!==null)return!0}}catch(e){t=true;n=e}finally{try{if(!e&&r.return!=null){r.return()}}finally{if(t){throw n}}}}return!0}},{key:"response",get:function e(){return iL(this,vm)||null},set:function e(e){if(typeof e=="string")ij(this,vm,e),this.saveResponse(e);else if(Array.isArray(e))ij(this,vm,e);else if(e)throw new Error("Value must be a string or an array of strings")}},{key:"disconnectedCallback",value:function e(){window.removeEventListener("message",this.handlePostMessage),p(f(t.prototype),"disconnectedCallback",this).call(this)}},{key:"render",value:function e(){return o5(tK(),this.getAttribute("width"),this.getAttribute("height"),this._errorMessage&&o5(tX(),this._errorMessage))}}]);return t}(a2);vm=new WeakMap,vb=new WeakMap,vy=new WeakMap,vw=new WeakMap,vq=new WeakSet,vk=function e(){var e=this.shadowRoot.querySelectorAll("iframe"),t=this.querySelectorAll("iframe"),n=N(e).concat(N(t));var r=true,o=false,a=undefined;try{for(var s=n[Symbol.iterator](),l;!(r=(l=s.next()).done);r=true){var c=l.value;var u=c.src;if(new URL(u,window.location.href).origin===window.location.origin)try{var d=c.contentDocument||c.contentWindow.document;d&&iz(this,vq,vx).call(this,d,n)}catch(e){console.error("Error accessing nested iframe:",e)}}}catch(e){o=true;a=e}finally{try{if(!r&&s.return!=null){s.return()}}finally{if(o){throw a}}}return n.forEach(function(e,t){n.indexOf(e)!==t&&n.splice(t,1)}),n},vx=function(e){var t=this;var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.querySelectorAll("iframe").forEach(function(e){n.push(e);var r=e.src;if(new URL(r,window.location.href).origin===window.location.origin)try{var o=e.contentDocument||e.contentWindow.document;iz(t,vq,vx).call(t,o,n)}catch(e){console.error("Error accessing nested iframe:",e)}else console.warn("Skipped cross-origin iframe:",r)}),n},v_=function e(e,t){window.postMessage({type:e,data:t},"*");var n=iz(this,vq,vk).call(this);var r=true,o=false,a=undefined;try{for(var s=n[Symbol.iterator](),l;!(r=(l=s.next()).done);r=true){var c=l.value;c.contentWindow&&c.contentWindow.postMessage({type:e,data:t},"*")}}catch(e){o=true;a=e}finally{try{if(!r&&s.return!=null){s.return()}}finally{if(o){throw a}}}},vE=function e(){var e=[iL(this,vy),this.baseRefUrl,this.baseItemUrl,iz(this,vq,vC).call(this)].filter(Boolean).map(function(e){return new URL(e,window.location.href).toString()}),t=iz(this,vq,vS).call(this);return t&&e.push(t),N(new Set(e))},vC=function e(){return iL(this,vb)?new URL(".",iL(this,vb)).toString():null},vS=function e(){return iL(this,vb)?new URL("..",iL(this,vb)).toString():null},vR=function e(e,t){return a(function(e,t){var n,r,o,a,s,l,c,u,d,h,p,f,v;var g=arguments;return z(this,function(m){switch(m.label){case 0:n=g.length>2&&g[2]!==void 0?g[2]:{};if(!e)return[2,{url:"",baseUrl:null}];if(e.startsWith("http")||e.startsWith("blob"))return[2,{url:e,baseUrl:null}];r=true,o=false,a=undefined;m.label=1;case 1:m.trys.push([1,11,12,13]);s=t[Symbol.iterator]();m.label=2;case 2:if(!!(r=(l=s.next()).done))return[3,10];c=l.value;u=new URL(c,window.location.href).toString(),d=new URL(e,u.endsWith("/")?u:"".concat(u,"/")).toString();m.label=3;case 3:m.trys.push([3,8,,9]);return[4,fetch(d)];case 4:h=m.sent();if(!h.ok)return[3,7];if(!n.returnText)return[3,6];return[4,h.text()];case 5:p=m.sent();return[2,{url:d,baseUrl:u,text:p}];case 6:return[2,{url:d,baseUrl:u}];case 7:return[3,9];case 8:f=m.sent();return[3,9];case 9:r=true;return[3,2];case 10:return[3,13];case 11:v=m.sent();o=true;a=v;return[3,13];case 12:try{if(!r&&s.return!=null){s.return()}}finally{if(o){throw a}}return[7];case 13:return[2,{url:"",baseUrl:null}]}})}).apply(this,arguments)},vA.styles=vp;var vT=vA;vf([n({type:String,attribute:"data"})],vT.prototype,"data",void 0);vf([n({type:String,attribute:"data-base-item"})],vT.prototype,"baseItemUrl",void 0);vf([n({type:String,attribute:"data-base-ref"})],vT.prototype,"baseRefUrl",void 0);vf([n({type:String,attribute:"id"})],vT.prototype,"id",void 0);vf([r()],vT.prototype,"_errorMessage",void 0);var vI=[{tag:"qti-custom-interaction",ctor:vT}];var vP=[aY];var vO=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},vM=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments),e.disabled=!1,e.countAttempt=null,e.title="end attempt";return e}d(t,[{key:"render",value:function e(){return o5(tY(),this.disabled,this.endAttempt,this.title)}},{key:"endAttempt",value:function e(e){this.dispatchEvent(new CustomEvent("end-attempt",{bubbles:!0,composed:!0,detail:{responseIdentifier:this.responseIdentifier,countAttempt:this.countAttempt==="true"}}))}}]);return t}(av);vM.styles=vP;var vN=vM;vO([n({type:String,attribute:"response-identifier"})],vN.prototype,"responseIdentifier",void 0);vO([n({reflect:!0,type:Boolean})],vN.prototype,"disabled",void 0);vO([n({type:String,attribute:"count-attempt"})],vN.prototype,"countAttempt",void 0);vO([n({type:String})],vN.prototype,"title",void 0);var vD=[{tag:"qti-end-attempt-interaction",ctor:vN}];var vL=[aY,ob(tJ())];var vU=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},vj=5,vz=50,vV="qti-height-lines-",vW=!1,vF,vB,v$,vH=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,vF);e._rows=vj,e.format="plain",e._handleFormatChange=function(){e.format!=="xhtml"||vW||(vW=!0,console.warn('<qti-extended-text-interaction format="xhtml"> renders as plain text. The interaction has no rich-text editor; the recorded response will contain no markup.'))},e.response=null,e._handleResponseChange=function(){e._internals.setFormValue(e.value),e.validate()};return e}d(t,[{key:"_handleRowsInputChange",value:function e(){this._rows=iz(this,vF,vB).call(this)}},{key:"value",get:function e(){return this.response||null},set:function e(e){this.response=e||null}},{key:"validate",value:function e(){var e=this.shadowRoot.querySelector("textarea");if(!e)return!1;var t="",n=!1;if(this.patternMask&&this.dataPatternmaskMessage){e.setCustomValidity("");var r=this.patternMask.startsWith("^")&&this.patternMask.endsWith("$")?this.patternMask:"^".concat(this.patternMask,"$"),o=new RegExp(r);n=e.checkValidity()&&o.test(e.value),n||(t=this.dataPatternmaskMessage,e.setCustomValidity(this.dataPatternmaskMessage))}else n=e.checkValidity();return n&&!this.response&&(n=!1),!n&&!t&&(t=e.validationMessage||"Invalid value."),this.setInteractionValidity(n,t,e,{suppressInline:!0}),n}},{key:"reportValidity",value:function e(){return this.validate(),p(f(t.prototype),"reportValidity",this).call(this)}},{key:"renderPrompt",value:function e(){return o5(tZ())}},{key:"renderTextarea",value:function e(){var e=this;return o5(t0(),this.responseIdentifier,5e3,function(e){return e.stopImmediatePropagation()},this.textChanged,this.textChanged,function(t){e.reportValidity()},lO(this.placeholderText?this.placeholderText:void 0),this._rows,this.disabled,this.readonly,this.response)}},{key:"renderValidationMessage",value:function e(){return o5(t1())}},{key:"render",value:function e(){return o5(t3(),this.renderPrompt(),this.renderTextarea(),this.renderValidationMessage())}},{key:"textChanged",value:function e(e){if(this.disabled||this.readonly)return;var t=e.target;this.response!==t.value&&(this.value=t.value,this.saveResponse(t.value))}}]);return t}(a2);vF=new WeakSet,vB=function e(){var e=iz(this,vF,v$).call(this);return e!==null?e:this.expectedLines>0?this.expectedLines:this.expectedLength>0?Math.ceil(this.expectedLength/vz):vj},v$=function e(){var e;var t=true,n=false,r=undefined;try{for(var o=((e=this.classNames)!==null&&e!==void 0?e:"").split(" ")[Symbol.iterator](),a;!(t=(a=o.next()).done);t=true){var s=a.value;if(!s.startsWith(vV))continue;var l=parseInt(s.slice(vV.length),10);if(!Number.isNaN(l)&&l>0)return l}}catch(e){n=true;r=e}finally{try{if(!t&&o.return!=null){o.return()}}finally{if(n){throw r}}}return null},vH.styles=vL;var vQ=vH;vU([r()],vQ.prototype,"_rows",void 0);vU([n({type:Number,attribute:"expected-length"})],vQ.prototype,"expectedLength",void 0);vU([n({type:Number,attribute:"expected-lines"})],vQ.prototype,"expectedLines",void 0);vU([n({type:String,reflect:!0})],vQ.prototype,"format",void 0);vU([O("format")],vQ.prototype,"_handleFormatChange",void 0);vU([n({type:String,attribute:"pattern-mask"})],vQ.prototype,"patternMask",void 0);vU([n({type:String,attribute:"placeholder-text"})],vQ.prototype,"placeholderText",void 0);vU([n({type:String,attribute:"data-patternmask-message"})],vQ.prototype,"dataPatternmaskMessage",void 0);vU([n({type:String,attribute:"class"})],vQ.prototype,"classNames",void 0);vU([O(["classNames","expectedLines","expectedLength"])],vQ.prototype,"_handleRowsInputChange",null);vU([n({type:String,attribute:"response",reflect:!1})],vQ.prototype,"response",void 0);vU([O("response",{waitUntilFirstUpdate:!0})],vQ.prototype,"_handleResponseChange",void 0);var vG=[{tag:"qti-extended-text-interaction",ctor:vQ}];var vX=[aY,aZ,ob(t2())];var vK=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"render",value:function e(){return o5(t5())}}]);return t}(f3(fJ(a2,"qti-gap-text","qti-gap","slot[part~='drags']"),'[qti-draggable="true"]'));vK.styles=vX;var vY=vK;var vJ=[{tag:"qti-gap-match-interaction",ctor:vY}];var vZ=[aY,aZ,ob(t4())];var v0=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},v1,v3,v2,v5,v4,v6,v8,v7=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t);iU(e,v5);iU(e,v1);iU(e,v3);iU(e,v2);ij(e,v3,null),ij(e,v2,null),e._response=[],e.addEventListener("qti-register-hotspot",iz(e,v5,v8));return e}d(t,[{key:"reset",value:function e(){this._response=[]}},{key:"validate",value:function e(){return iz(this,v5,v6).call(this).length>0}},{key:"response",get:function e(){return this._response},set:function e(e){this._response=iz(this,v5,v4).call(this,e)}},{key:"renderSupplementalLines",value:function e(){return o7}},{key:"render",value:function e(){var e=this;var t,n,r,o;return o5(t7(),lO((t=this.grImage[0])===null||t===void 0?void 0:t.width),lO((n=this.grImage[0])===null||n===void 0?void 0:n.height),(r=this.grImage[0])===null||r===void 0?void 0:r.width,(o=this.grImage[0])===null||o===void 0?void 0:o.height,pI(iz(this,v5,v6).call(this),function(e){return e},function(t,n){return o4(t6(),parseInt(e.querySelector("[identifier=".concat(t.split(" ")[0],"]")).style.left),parseInt(e.querySelector("[identifier=".concat(t.split(" ")[0],"]")).style.top),parseInt(e.querySelector("[identifier=".concat(t.split(" ")[1],"]")).style.left),parseInt(e.querySelector("[identifier=".concat(t.split(" ")[1],"]")).style.top),function(t){t.stopPropagation(),e._response=e._response.filter(function(e,t){return t!==n}),e.saveResponse(e.response)})}),this.renderSupplementalLines(),iL(this,v3)&&o4(t8(),this.startCoord.x,this.startCoord.y,this.mouseCoord.x,this.mouseCoord.y))}},{key:"firstUpdated",value:function e(){var e=this;p(f(t.prototype),"firstUpdated",this).call(this),ij(this,v1,this.querySelectorAll("qti-associable-hotspot")),this.addEventListener("mousemove",function(t){var n=e.grImage[0];if(!n)return;var r=n.getBoundingClientRect();e.mouseCoord={x:t.clientX-r.left,y:t.clientY-r.top}}),iL(this,v1).forEach(function(t){t.style.left=t.getAttribute("coords").split(",")[0]+"px",t.style.top=t.getAttribute("coords").split(",")[1]+"px",t.addEventListener("click",function(t){iL(e,v3)?iL(e,v2)||(ij(e,v2,t.target),e._response=iz(e,v5,v6).call(e),e._response=N(e._response).concat(["".concat(iL(e,v3).getAttribute("identifier")," ").concat(iL(e,v2).getAttribute("identifier"))]),e.saveResponse(e.response),ij(e,v3,null),ij(e,v2,null)):(ij(e,v3,t.target),e.startCoord={x:parseInt(iL(e,v3).getAttribute("coords").split(",")[0]),y:parseInt(iL(e,v3).getAttribute("coords").split(",")[1])})})})}},{key:"disconnectedCallback",value:function e(){p(f(t.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("qti-register-hotspot",iz(this,v5,v8))}}]);return t}(a2);v1=new WeakMap,v3=new WeakMap,v2=new WeakMap,v5=new WeakSet,v4=function e(e){return e==null||e===""?[]:Array.isArray(e)?e:[e]},v6=function e(){return iz(this,v5,v4).call(this,this._response)},v8=function e(e){var t=this.querySelector("img"),n=e.target,r=n.getAttribute("coords"),o=n.getAttribute("shape"),a=r.split(",").map(function(e){return parseInt(e)});iu(o,a,t,n)},v7.styles=vZ;var v9=v7;v0([r()],v9.prototype,"startCoord",void 0);v0([r()],v9.prototype,"mouseCoord",void 0);v0([c({selector:"img"})],v9.prototype,"grImage",void 0);v0([r()],v9.prototype,"_response",void 0);v0([n({attribute:"response",reflect:!1,noAccessor:!0,converter:P({emptyAs:[]})})],v9.prototype,"response",null);var ge=[{tag:"qti-graphic-associate-interaction",ctor:v9}];var gt=[aY,aZ,ob(t9())];var gn=fJ(a2,"qti-gap-img, qti-gap-text","qti-associable-hotspot","slot[part~='drags']"),gr,gi,go=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,gr);return e}d(t,[{key:"render",value:function e(){return o5(ne())}},{key:"shouldReturnToInventoryOnInventoryDrop",value:function e(){return!0}},{key:"connectedCallback",value:function e(){p(f(t.prototype),"connectedCallback",this).call(this),this.addEventListener("qti-register-hotspot",iz(this,gr,gi))}},{key:"disconnectedCallback",value:function e(){p(f(t.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("qti-register-hotspot",iz(this,gr,gi))}}]);return t}(f3(gn,'[qti-draggable="true"]'));gr=new WeakSet,gi=function e(e){var t=e.target,n=t.getAttribute("coords"),r=t.getAttribute("shape"),o=n.split(",").map(function(e){return parseInt(e)});switch(r){case"circle":{var a=I(o,3),s=a[0],l=a[1],c=a[2];t.style.left=s-c+"px",t.style.top=l-c+"px",t.style.width=t.style.height=2*c+"px"}break;case"rect":{var u=I(o,4),d=u[0],h=u[1],p=u[2],f=u[3];t.style.left=d+"px",t.style.top=h+"px",t.style.width=p-d+"px",t.style.height=f-h+"px"}break;default:break}},go.styles=gt;var ga=go;var gs=[{tag:"qti-graphic-gap-match-interaction",ctor:ga}];var gl=[aY,aZ,ob(nt())];var gc,gu,gd,gh,gp,gf=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,gu);e._choiceElements=[];return e}d(t,[{key:"render",value:function e(){return o5(nn())}},{key:"resolvePinColor",value:function e(e){return"var(--qti-selected-bg)"}},{key:"refreshLocatorPins",value:function e(){var e=this;this.querySelectorAll(".".concat(iL(t,gc))).forEach(function(e){return e.remove()}),this._choiceElements.forEach(function(e){e.style.removeProperty("anchor-name")}),this._choiceElements.filter(function(e){return e.order!=null}).sort(function(e,t){return e.order-t.order}).forEach(function(n){var r=iz(e,gu,gh).call(e,n);n.style.setProperty("anchor-name",r);var o=document.createElement("span");o.className=iL(t,gc),o.style.setProperty("position-anchor",r),o.style.setProperty("--qti-graphic-order-pin-color",e.resolvePinColor(n)),n.getAttribute("shape")==="poly"&&o.classList.add("cito-graphic-order-marker--poly"),o.setAttribute("aria-hidden","true"),o.textContent=String(n.order),e.append(o)})}},{key:"connectedCallback",value:function e(){p(f(t.prototype),"connectedCallback",this).call(this),this.addEventListener("activate-qti-hotspot-choice",iz(this,gu,gd)),this.addEventListener("register-qti-hotspot-choice",iz(this,gu,gp)),this.refreshLocatorPins()}},{key:"disconnectedCallback",value:function e(){this.querySelectorAll(".".concat(iL(t,gc))).forEach(function(e){return e.remove()}),p(f(t.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("activate-qti-hotspot-choice",iz(this,gu,gd)),this.removeEventListener("register-qti-hotspot-choice",iz(this,gu,gp))}}]);return t}(vr(a2,"qti-hotspot-choice"));gc=new WeakMap,gu=new WeakSet,gd=function e(e){var t=e.detail,n=t.identifier,r=this._choiceElements.find(function(e){return e.getAttribute("identifier")===n});if(!r)return;var o=this._choiceElements.length;if(!this.choiceOrdering){if(this.choiceOrdering=!0,r.order==null){var a=this._choiceElements.filter(function(e){return e.order!=null}).length;if(a>=o){this.choiceOrdering=!1;return}r.order=a+1}else{var s=r.order;r.order=null,this._choiceElements.forEach(function(e){e.order!=null&&e.order>s&&e.order--})}this.refreshLocatorPins(),this.choiceOrdering=!1}},gh=function e(e){return"--qti-graphic-order-".concat((e.identifier||e.getAttribute("identifier")||"hotspot").toLowerCase().replace(/[^a-z0-9_-]/g,"-"))},gp=function e(e){var t=this.querySelector("img"),n=e.target,r=n.getAttribute("coords"),o=n.getAttribute("shape"),a=r.split(",").map(function(e){return parseInt(e)});iu(o,a,t,n)},gf.styles=gl,iU(gf,gc,"cito-graphic-order-marker");var gv=gf;var gg=[{tag:"qti-graphic-order-interaction",ctor:gv}];var gm=[aY,aZ,ob(nr())];var gb,gy,gw,gq,gk=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,gy);iU(e,gb,null);return e}d(t,[{key:"render",value:function e(){return o5(ni())}},{key:"connectedCallback",value:function e(){p(f(t.prototype),"connectedCallback",this).call(this),this.addEventListener("register-qti-hotspot-choice",iz(this,gy,gq))}},{key:"disconnectedCallback",value:function e(){p(f(t.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("unregister-qti-hotspot-choice",iz(this,gy,gq))}}]);return t}(vr(a2,"qti-hotspot-choice"));gb=new WeakMap,gy=new WeakSet,gw=function e(e){return iL(this,gb)||(e.naturalWidth>0&&e.naturalHeight>0?ij(this,gb,Promise.resolve(e)):ij(this,gb,new Promise(function(t){var n=function r(){e.removeEventListener("load",n),t(e)};e.addEventListener("load",n)}))),iL(this,gb)},gq=function e(e){return a(function(){var t,n,r,o,a,s;return z(this,function(l){switch(l.label){case 0:t=this.querySelector("img"),n=e.target,r=n.getAttribute("coords"),o=n.getAttribute("shape"),a=r.split(",").map(function(e){return parseInt(e)});return[4,iz(this,gy,gw).call(this,t)];case 1:s=l.sent();iu(o,a,s,n);return[2]}})}).call(this)},gk.styles=gm;var gx=gk;var g_=[{tag:"qti-hotspot-interaction",ctor:gx}];var gE=[aY,aZ,ob(no())];var gC=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments),e.render=function(){return o5(na())};return e}return t}(vr(a2,"qti-hottext"));gC.styles=gE;var gS=gC;var gR=[{tag:"qti-hottext-interaction",ctor:gS}];var gA=function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"[part='menu']",n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"[part='trigger']",r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"--qti-inline-choice-width";var o,a,c,u,h,m,b,y,w,q;var k=/*#__PURE__*/function(e){"use strict";v(w,e);function w(){l(this,w);var e;e=s(this,w,arguments);iU(e,m);iU(e,o,null);iU(e,a,null);iU(e,c,null);iU(e,u,0);iU(e,h,null);return e}d(w,[{key:"shouldAutoSizeMenu",value:function e(){return!1}},{key:"menuAutoSizeExtraWidth",value:function e(){return 0}},{key:"menuAutoSizePropertyTarget",value:function e(){var e;var t;return(e=(t=this.renderRoot)===null||t===void 0?void 0:t.querySelector(n))!==null&&e!==void 0?e:null}},{key:"menuAutoSizeRows",value:function e(){var e;var n=(e=this.renderRoot)===null||e===void 0?void 0:e.querySelector(t);return n?Array.from(n.children).flatMap(function(e){return g(e,HTMLSlotElement)?e.assignedElements().filter(function(e){return g(e,HTMLElement)}):g(e,HTMLElement)?[e]:[]}):[]}},{key:"withMenuMeasurable",value:function e(e){var n,r;var o=(n=this.renderRoot)===null||n===void 0?void 0:n.querySelector(t);if(!o)return e();var a=o.matches(":popover-open"),s=o.style.visibility,l=o.style.display;a||(o.style.visibility="hidden",o.style.display="block",(r=o.showPopover)===null||r===void 0?void 0:r.call(o));try{return e()}finally{var c;a||((c=o.hidePopover)===null||c===void 0?void 0:c.call(o),o.style.visibility=s,o.style.display=l)}}},{key:"updateMenuWidth",value:function e(){var e;if(!this.isConnected||!this.shouldAutoSizeMenu())return;var n=this.menuAutoSizePropertyTarget();if(!n)return;var o=(e=this.renderRoot)===null||e===void 0?void 0:e.querySelector(t);o&&iz(this,m,q).call(this,o),iz(this,m,y).call(this);var a=iz(this,m,b).call(this)+this.menuAutoSizeExtraWidth();a<=0||a===iL(this,h)||(ij(this,h,a),n.style.setProperty(r,"".concat(a,"px")))}},{key:"disconnectedCallback",value:function e(){var e,t;(e=iL(this,o))===null||e===void 0?void 0:e.disconnect(),ij(this,o,null),ij(this,a,null),(t=iL(this,c))===null||t===void 0?void 0:t.disconnect(),ij(this,c,null),iL(this,u)&&cancelAnimationFrame(iL(this,u)),ij(this,u,0),p(f(w.prototype),"disconnectedCallback",this).call(this)}}]);return w}(e);return o=new WeakMap,a=new WeakMap,c=new WeakMap,u=new WeakMap,h=new WeakMap,m=new WeakSet,b=function e(){var e=this;return this.withMenuMeasurable(function(){var n;var r=0;var o=true,a=false,s=undefined;try{for(var l=e.menuAutoSizeRows()[Symbol.iterator](),c;!(o=(c=l.next()).done);o=true){var u=c.value;var d=u.style.width;u.style.width="max-content",r=Math.max(r,u.getBoundingClientRect().width),u.style.width=d}}catch(e){a=true;s=e}finally{try{if(!o&&l.return!=null){l.return()}}finally{if(a){throw s}}}if(r<=0)return 0;var h=(n=e.renderRoot)===null||n===void 0?void 0:n.querySelector(t);if(!h)return r;var p=getComputedStyle(h);return r+parseFloat(p.paddingLeft)+parseFloat(p.paddingRight)+parseFloat(p.borderLeftWidth)+parseFloat(p.borderRightWidth)})},y=function e(){var e=this;(typeof MutationObserver==="undefined"?"undefined":D(MutationObserver))>"u"||iL(this,c)||(ij(this,c,new MutationObserver(function(){return iz(e,m,w).call(e)})),iL(this,c).observe(this,{childList:!0,subtree:!0,characterData:!0}))},w=function e(){var e=this;iL(this,u)||ij(this,u,requestAnimationFrame(function(){ij(e,u,0),e.updateMenuWidth()}))},q=function e(e){var t=this;var n;(typeof ResizeObserver==="undefined"?"undefined":D(ResizeObserver))>"u"||iL(this,a)===e||((n=iL(this,o))!==null&&n!==void 0?n:ij(this,o,new ResizeObserver(function(){var e;((e=iL(t,a))===null||e===void 0?void 0:e.matches(":popover-open"))&&iz(t,m,w).call(t)})),iL(this,a)&&iL(this,o).unobserve(iL(this,a)),iL(this,o).observe(e),ij(this,a,e))},k};var gT=ob(ns()),gI=gT,gP=gI;var gO=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},gM=0,gN,gD,gL,gU,gj,gz,gV,gW,gF,gB,g$,gH,gQ,gG,gX,gK,gY,gJ,gZ,g0=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t);iU(e,gN);iU(e,gz);iU(e,gV);iU(e,gW);iU(e,gF);iU(e,gX);iU(e,gK);e.options=[],e._dropdownOpen=!1,e._slotObserver=null,e._menuId="qti-inline-choice-menu-".concat(gM++),e._handleDataPromptChange=function(){iz(e,gN,gL).call(e)},e.required=!1,e.minChoices=0,e._handleRequiredChange=function(){e.validate(),e.reportValidity()},e._pendingResponse=void 0,ij(e,gz,function(t){(e.disabled||e.readonly)&&t.preventDefault()}),ij(e,gV,function(t){e.disabled||e.readonly||(t.key==="ArrowDown"||t.key==="Enter"||t.key===" ")&&(t.preventDefault(),iz(e,gN,gj).call(e,!0))}),ij(e,gW,function(t){var n=t.newState==="open";e._dropdownOpen!==n&&(e._dropdownOpen=n),n?e._internals.states.add("open"):e._internals.states.delete("open")}),ij(e,gF,function(t){var n,r;if(!e._dropdownOpen)return;if(t.key==="Escape"){t.preventDefault(),iz(e,gN,gj).call(e,!1),iz(e,gN,gB).call(e);return}var o=iz(e,gN,gZ).call(e),a=e.renderRoot.activeElement,s=iz(e,gN,g$).call(e),l=a||(g(s,HTMLElement)&&iz(e,gN,gH).call(e,s)?s:null),c=o.findIndex(function(e){return e===l});if(t.key==="ArrowDown"&&(t.preventDefault(),(n=o[Math.min(o.length-1,Math.max(0,c+1))])===null||n===void 0?void 0:n.focus()),t.key==="ArrowUp"&&(t.preventDefault(),(r=o[Math.max(0,c-1)])===null||r===void 0?void 0:r.focus()),t.key==="Enter"||t.key===" "){if(!l)return;if(t.preventDefault(),g(l,HTMLButtonElement))l.click();else{var u;var d=(u=l.getAttribute("identifier"))!==null&&u!==void 0?u:"";iz(e,gN,gU).call(e,d)}}}),ij(e,gX,function(){iz(e,gN,gL).call(e)}),ij(e,gK,function(t){var n;if(e.disabled||e.readonly)return;var r=(n=t.currentTarget.getAttribute("identifier"))!==null&&n!==void 0?n:"";iz(e,gN,gU).call(e,r)}),e.internals.role="listbox";return e}d(t,[{key:"isInline",get:function e(){return!0}},{key:"renderTrigger",value:function e(){var e=iz(this,gN,gD).call(this);return o5(nl(),iL(this,gz),iL(this,gV),this._dropdownOpen?"true":"false",this._menuId,this._menuId,this.disabled,this.readonly?"true":"false",e===null||e===void 0?void 0:e.content,this._dropdownOpen?"dropdown-icon dropdown-icon-open":"dropdown-icon")}},{key:"renderMenu",value:function e(){var e=this;var t,n,r;return o5(nc(),this._menuId,iL(this,gW),iL(this,gF),((t=this.options[0])===null||t===void 0?void 0:t.selected)?"option option-prompt option-selected":"option option-prompt",((n=this.options[0])===null||n===void 0?void 0:n.selected)?"true":"false",function(){return iz(e,gN,gU).call(e,"")},(r=this.options[0])===null||r===void 0?void 0:r.content,iL(this,gX))}},{key:"renderValidationMessage",value:function e(){return o5(nu())}},{key:"render",value:function e(){return o5(nd(),this.renderTrigger(),this.renderMenu(),this.renderValidationMessage())}},{key:"connectedCallback",value:function e(){var e=this;var n=this,r=function n(){return p(f(t.prototype),"connectedCallback",e)};return a(function(){return z(this,function(e){switch(e.label){case 0:r().call(n),iz(this,gN,gL).call(this),iz(this,gN,gG).call(this);return[4,this.updateComplete];case 1:e.sent(),this.isConnected&&this.updateMenuWidth();return[2]}})}).call(this)}},{key:"disconnectedCallback",value:function e(){var e;p(f(t.prototype),"disconnectedCallback",this).call(this),iz(this,gN,gY).call(this),(e=this._slotObserver)===null||e===void 0?void 0:e.disconnect(),this._slotObserver=null}},{key:"willUpdate",value:function e(e){e.has("configContext")&&iz(this,gN,gL).call(this)}},{key:"updated",value:function e(e){var t;e.has("_dropdownOpen")&&this._dropdownOpen&&(iz(this,gN,gJ).call(this),(t=iz(this,gN,gZ).call(this)[0])===null||t===void 0?void 0:t.focus()),(e.has("disabled")||e.has("readonly"))&&iz(this,gN,gJ).call(this)}},{key:"shouldAutoSizeMenu",value:function e(){var e;return((e=this.configContext)===null||e===void 0?void 0:e.inlineChoiceAutosize)?!Array.from(this.classList).some(function(e){return e.startsWith("qti-input-width-")}):!1}},{key:"menuAutoSizeExtraWidth",value:function e(){var e;var t;return(e=(t=this.renderRoot.querySelector('span[part~="dropdown-icon"]'))===null||t===void 0?void 0:t.offsetWidth)!==null&&e!==void 0?e:0}},{key:"validate",value:function e(){var e=this.options.find(function(e){return e.selected}),t=e?e.value!=="":!1,n=this.required||this.minChoices>=1,r=t||!n,o=this.dataset.minChoicesMessage||"Please select an option.";return this.setInteractionValidity(r,r?"":o,this,{suppressInline:!0}),r}},{key:"reportValidity",value:function e(){return p(f(t.prototype),"reportValidity",this).call(this)}},{key:"reset",value:function e(){iz(this,gN,gj).call(this,!1),this.options=this.options.map(function(e,t){return _(k({},e),{selected:t===0})}),iz(this,gN,gJ).call(this)}},{key:"response",get:function e(){var e;var t;var n=(e=(t=this.options.find(function(e){return e.selected}))===null||t===void 0?void 0:t.value)!==null&&e!==void 0?e:"";return n===""?null:n},set:function e(e){var t=e!==null&&e!==void 0?e:"";if(this.options.length===0){this._pendingResponse=e;return}this.options=this.options.map(function(e){return _(k({},e),{selected:e.value===t})}),iz(this,gN,gJ).call(this)}}],[{key:"styles",get:function e(){return[gP]}}]);return t}(gA(a2));gN=new WeakSet,gD=function e(){var e;return(e=this.options.find(function(e){return e.selected}))!==null&&e!==void 0?e:this.options[0]},gL=function e(){var e;var t,n;var r=Array.from(this.querySelectorAll("qti-inline-choice")),o=this.dataPrompt||((t=this.configContext)===null||t===void 0?void 0:t.inlineChoicePrompt)||"select",a=this._pendingResponse,s=a!==void 0?a!==null&&a!==void 0?a:"":(e=(n=this.options.find(function(e){return e.selected}))===null||n===void 0?void 0:n.value)!==null&&e!==void 0?e:"",l=[{content:o,value:"",selected:s===""}].concat(N(r.map(function(e){var t;var n=(t=e.getAttribute("identifier"))!==null&&t!==void 0?t:"";return{content:Array.from(e.childNodes).map(function(e){return e.cloneNode(!0)}),value:n,selected:n!==""&&n===s}}))),c=l.some(function(e){return e.selected});this.options=c?l:l.map(function(e,t){return _(k({},e),{selected:t===0})}),this._pendingResponse=void 0,iz(this,gN,gJ).call(this),this.updateMenuWidth()},gU=function e(e){this.options=this.options.map(function(t){return _(k({},t),{selected:t.value===e})}),iz(this,gN,gJ).call(this),this.validate(),this.reportValidity(),this.saveResponse(e),iz(this,gN,gj).call(this,!1)},gj=function e(e){var t=iz(this,gN,gQ).call(this);if(t){if(e){t.matches(":popover-open")||t.showPopover();return}t.matches(":popover-open")&&t.hidePopover()}},gz=new WeakMap,gV=new WeakMap,gW=new WeakMap,gF=new WeakMap,gB=function e(){var e;(e=this.renderRoot.querySelector('button[part="trigger"]'))===null||e===void 0?void 0:e.focus()},g$=function e(){var e;var t=document.activeElement;for(;t&&g(t,HTMLElement)&&((e=t.shadowRoot)===null||e===void 0?void 0:e.activeElement);)t=t.shadowRoot.activeElement;return t},gH=function e(e){return e===this||this.contains(e)||this.renderRoot.contains(e)},gQ=function e(){return this.renderRoot.querySelector("#".concat(this._menuId))},gG=function e(){var e=this;this._slotObserver=new MutationObserver(function(){return iz(e,gN,gL).call(e)}),this._slotObserver.observe(this,{childList:!0,subtree:!0})},gX=new WeakMap,gK=new WeakMap,gY=function e(){var e=Array.from(this.querySelectorAll("qti-inline-choice"));var t=true,n=false,r=undefined;try{for(var o=e[Symbol.iterator](),a;!(t=(a=o.next()).done);t=true){var s=a.value;s.removeEventListener("click",iL(this,gK)),s.removeAttribute("tabindex"),s.internals.role=null,s.internals.ariaSelected=null,s.internals.ariaChecked="false",s.internals.states.delete("checked")}}catch(e){n=true;r=e}finally{try{if(!t&&o.return!=null){o.return()}}finally{if(n){throw r}}}},gJ=function e(){return a(function(){var e,t,n,r,o,a,s,l,c,u,d,h;return z(this,function(p){switch(p.label){case 0:return[4,this.updateComplete];case 1:p.sent();n=(e=(t=this.options.find(function(e){return e.selected}))===null||t===void 0?void 0:t.value)!==null&&e!==void 0?e:"",r=Array.from(this.querySelectorAll("qti-inline-choice"));o=true,a=false,s=undefined;try{for(l=r[Symbol.iterator]();!(o=(c=l.next()).done);o=true){u=c.value;h=((d=u.getAttribute("identifier"))!==null&&d!==void 0?d:"")===n;u.removeEventListener("click",iL(this,gK)),u.addEventListener("click",iL(this,gK)),u.disabled=this.disabled,u.readonly=this.readonly,u.internals.role="option",u.internals.ariaSelected=h?"true":"false",u.internals.ariaChecked=h?"true":"false",u.internals.ariaDisabled=this.disabled?"true":"false",u.internals.ariaReadOnly=this.readonly?"true":"false",h?u.internals.states.add("checked"):u.internals.states.delete("checked"),u.tabIndex=-1}}catch(e){a=true;s=e}finally{try{if(!o&&l.return!=null){l.return()}}finally{if(a){throw s}}}return[2]}})}).call(this)},gZ=function e(){var e=this.renderRoot.querySelector('button[part~="option"]'),t=Array.from(this.querySelectorAll("qti-inline-choice"));return N(e?[e]:[]).concat(N(t))};gO([r()],g0.prototype,"options",void 0);gO([r()],g0.prototype,"_dropdownOpen",void 0);gO([m({context:aj,subscribe:!0}),n({attribute:!1})],g0.prototype,"configContext",void 0);gO([n({type:String,attribute:"data-prompt"})],g0.prototype,"dataPrompt",void 0);gO([O("dataPrompt",{waitUntilFirstUpdate:!0})],g0.prototype,"_handleDataPromptChange",void 0);gO([n({type:Boolean,reflect:!0,converter:{fromAttribute:function e(e){return e==="true"||e===""},toAttribute:function e(e){return e?"true":null}}})],g0.prototype,"required",void 0);gO([n({type:Number,attribute:"min-choices"})],g0.prototype,"minChoices",void 0);gO([O(["required","minChoices"],{waitUntilFirstUpdate:!0})],g0.prototype,"_handleRequiredChange",void 0);gO([n({attribute:"response",reflect:!1,noAccessor:!0})],g0.prototype,"response",null);var g1=[{tag:"qti-inline-choice-interaction",ctor:g0}];var g3=[aY,aZ,ob(nh())];var g2=[aY,ob(np())];var g5=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},g4=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments),e.autoSizeDropzones=!1,e.lastCheckedRadio=null,e.class="",e._response=[],e.responseIdentifier="",e.handleRadioClick=function(t){var n=t.target;e.lastCheckedRadio===n?(n.checked=!1,e.lastCheckedRadio=null,e.handleRadioChange(t)):e.lastCheckedRadio=n},e.handleRadioChange=function(t){var n=t.target,r=n.value,o=n.name,a=n.type;n.checked?(e.response?e.response.indexOf(r)===-1&&(a==="radio"&&(e.response=(e.response||[]).filter(function(e){return e.indexOf(o)===-1})),e.response=N(e.response).concat([r])):e.response=[r],e.lastCheckedRadio=n):(e.response=(e.response||[]).filter(function(e){return e!==r}),e.lastCheckedRadio=null),e.requestUpdate(),e.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:e.responseIdentifier,response:Array.isArray(e.response)?N(e.response):e.response}}))};return e}d(t,[{key:"response",get:function e(){return this.classList.contains("qti-match-tabular")?this._response:p(f(t.prototype),"response",this)},set:function e(e){this.classList.contains("qti-match-tabular")?this._response=e:A(f(t.prototype),"response",e,this,true)}},{key:"isDragDropEnabled",value:function e(){return!this.classList.contains("qti-match-tabular")}},{key:"initiateDrag",value:function e(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++){n[r]=arguments[r]}var o;this.classList.contains("qti-match-tabular")||(o=p(f(t.prototype),"initiateDrag",this)).call.apply(o,[this].concat(N(n)))}},{key:"afterCache",value:function e(){this.classList.contains("qti-match-tabular")||p(f(t.prototype),"afterCache",this).call(this)}},{key:"connectedCallback",value:function e(){var e=this;var n=this,r=function n(){return p(f(t.prototype),"connectedCallback",e)};return a(function(){return z(this,function(e){r().call(n),this.sourceChoices=Array.from(this.querySelectorAll("qti-simple-match-set:first-of-type qti-simple-associable-choice")),this.targetChoices=Array.from(this.querySelectorAll("qti-simple-match-set:last-of-type qti-simple-associable-choice")),this.syncTabularSlotting();return[2]})}).call(this)}},{key:"willUpdate",value:function e(e){var n;(n=p(f(t.prototype),"willUpdate",this))===null||n===void 0?void 0:n.call(this,e),e.has("class")&&this.syncTabularSlotting()}},{key:"syncTabularSlotting",value:function e(){var e,t,n,r;var o=this.classList.contains("qti-match-tabular"),a=this.querySelectorAll(":scope > qti-simple-match-set"),s=a[0],l=a[1],c=function e(e){e.style.removeProperty("min-width"),e.style.removeProperty("min-height"),e.style.removeProperty("--qti-dropzone-min-height")};o?(s===null||s===void 0?void 0:s.setAttribute("slot","match-rows"),l===null||l===void 0?void 0:l.setAttribute("slot","match-cols"),(e=this.sourceChoices)===null||e===void 0?void 0:e.forEach(function(e){c(e),e.setAttribute("role","rowheader")}),(t=this.targetChoices)===null||t===void 0?void 0:t.forEach(function(e){c(e),e.setAttribute("role","columnheader")})):(s===null||s===void 0?void 0:s.removeAttribute("slot"),l===null||l===void 0?void 0:l.removeAttribute("slot"),(n=this.sourceChoices)===null||n===void 0?void 0:n.forEach(function(e){return e.removeAttribute("role")}),(r=this.targetChoices)===null||r===void 0?void 0:r.forEach(function(e){return e.removeAttribute("role")}))}},{key:"validate",value:function e(){var e;return this.class.split(" ").includes("qti-match-tabular")?((e=this.response)===null||e===void 0?void 0:e.length)===this.sourceChoices.length:p(f(t.prototype),"validate",this).call(this)}},{key:"getCellStateVariant",value:function e(e,t){return""}},{key:"render",value:function e(){var e=this;var t=this.class.split(" ").includes("qti-match-tabular");return o5(nm(),t,t?o5(ng(),this.sourceChoices.length,this.targetChoices.length,this.sourceChoices.map(function(t,n){return o5(nv(),e.targetChoices.map(function(r,o){var a;var s=t.getAttribute("identifier"),l=r.getAttribute("identifier"),c="".concat(s," ").concat(l),u=(e.response||[]).filter(function(e){return e.split(" ")[0]===s}).length||0,d=((a=e.response)===null||a===void 0?void 0:a.includes(c))||!1,h=t.matchMax===1?"radio":"checkbox",p=e.getCellStateVariant(c,d),f=d?"checked":"",v="control ".concat(h," ").concat(f," ").concat(p).trim(),g="control-mark ".concat(h," ").concat(f," ").concat(p).trim(),m=t.matchMax===1?!1:t.matchMax!==0&&u>=t.matchMax&&!d;return o5(nf(),n+1,o+1,h,s,c,d,m,function(t){return e.handleRadioChange(t)},function(n){return t.matchMax===1?e.handleRadioClick(n):null},v,h,d?"true":"false",g)}))})):o7)}}]);return t}(f3(fJ(a2,"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"),'[qti-draggable="true"]'));g4.styles=[g3,g2];var g6=g4;g5([n({type:String})],g6.prototype,"class",void 0);g5([r()],g6.prototype,"_response",void 0);g5([n({type:String,attribute:"response-identifier"})],g6.prototype,"responseIdentifier",void 0);var g8=[{tag:"qti-match-interaction",ctor:g6}];var g7=[aY,ob(nb())];var g9,me=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t);iU(e,g9,null);return e}d(t,[{key:"reset",value:function e(){ij(this,g9,null)}},{key:"validate",value:function e(){return!0}},{key:"response",get:function e(){return iL(this,g9)?iL(this,g9).toString():null},set:function e(e){if(e)if(!isNaN(parseInt(e===null||e===void 0?void 0:e.toString())))ij(this,g9,parseInt(e.toString()));else throw new Error("Value must be a number ".concat(e))}},{key:"render",value:function e(){return o5(ny())}},{key:"connectedCallback",value:function e(){var e=this;p(f(t.prototype),"connectedCallback",this).call(this);var n=this.querySelector("audio")||this.querySelector("video")||this.querySelector("object");n&&n.addEventListener("ended",function(){iV(e,g9)._++,e.saveResponse(e.value)})}}],[{key:"properties",get:function e(){return _(k({},a2.properties),{step:{type:Number,attribute:"step",default:10}})}}]);return t}(a2);g9=new WeakMap,me.styles=g7;var mt=me;var mn=[{tag:"qti-media-interaction",ctor:mt}];var mr=[aY,aZ,aJ,ob(nw())];var mi=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},mo=fJ(a2,"qti-simple-choice","[part~='drop']","slot[part~='drags']"),ma=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments),e.nrChoices=0;return e}d(t,[{key:"render",value:function e(){var e=this;var t=Array.from(this.querySelectorAll("qti-simple-choice"));return this.nrChoices<t.length&&(this.nrChoices=t.length),o5(nk(),N(Array(this.nrChoices)).map(function(t,n){var r;var o,a;var s="droplist".concat(n),l=(r=(a=e._dragDrop)===null||a===void 0?void 0:(o=a.nodesByTarget)===null||o===void 0?void 0:o[s])!==null&&r!==void 0?r:[];return o5(nq(),s,pI(l,function(e){return e.getAttribute("identifier")},function(e){return e}))}))}},{key:"getValue",value:function e(e){return(e===null||e===void 0?void 0:e.map(function(e,t){return"".concat(e," droplist").concat(t)}))||[]}},{key:"getResponse",value:function e(){var e=this;return Array.from(this.shadowRoot.querySelectorAll("[part~='drop']")).map(function(t){return e.chipsIn(t).map(function(e){return e.getAttribute("identifier")}).join(" ")})}},{key:"shouldTreatBlockedMaxAsInvalid",value:function e(){return!1}},{key:"firstUpdated",value:function e(){var e=this;var n=this,r=function n(){return p(f(t.prototype),"firstUpdated",e)};return a(function(){return z(this,function(e){r().call(n),this.childrenMap=Array.from(this.querySelectorAll("qti-simple-choice"));return[2]})}).call(this)}}]);return t}(f3(mo,'[qti-draggable="true"]'));ma.styles=mr;var ms=ma;mi([r()],ms.prototype,"nrChoices",void 0);mi([n({type:String})],ms.prototype,"orientation",void 0);var ml=[{tag:"qti-order-interaction",ctor:ms}];var mc=[aY,ob(nx())];var mu=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},md=["solution","review"];var mh,mp,mf,mv,mg,mm,mb,my,mw,mq,mk,mx,m_,mE,mC,mS,mR,mA,mT,mI,mP,mO,mM,mN,mD,mL=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,mf);iU(e,mh);iU(e,mp);iU(e,mg);iU(e,mm);iU(e,mb);iU(e,my);iU(e,mD);e._iframeLoaded=!1,e._interactionReady=!1,e._pendingMessages=[],e._iframeMessageOrigin=null,e.requirePathsJson="",e.requireShimJson="",e.requireJsUrl="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js",e.baseUrl="",e.useDefaultPaths=!1,e.status="interacting",ij(e,mp,null),e._errorMessage=null,e.response=null,ij(e,mg,null),ij(e,mm,null),ij(e,mb,null),ij(e,my,""),e.handleIframeMessage=function(t){var n;var r=t.data;if(!(!r||r.source!=="qti-pci-iframe")&&!(!((n=e.iframe)===null||n===void 0?void 0:n.contentWindow)||t.source!==e.iframe.contentWindow)&&!(r.responseIdentifier&&r.responseIdentifier!==e.responseIdentifier)){if(e._iframeMessageOrigin===null)e._iframeMessageOrigin=t.origin;else if(t.origin!==e._iframeMessageOrigin)return;switch(r.method){case"iframeReady":e._interactionReady=!0,iz(e,mf,mN).call(e),iz(e,mf,mI).call(e),e.dispatchEvent(new CustomEvent("qti-portable-custom-interaction-loaded",{bubbles:!0}));break;case"resize":typeof r.height=="number"&&e.iframe&&(e.iframe.style.height="".concat(r.height,"px"),e.iframe.style.width="".concat(r.width,"px"));break;case"console":e.dispatchEvent(new CustomEvent("qti-pci-console",{detail:{level:r.level,args:r.args},bubbles:!0}));break;case"interactionChanged":{var o,a,s,l;var c=r===null||r===void 0?void 0:(o=r.params)===null||o===void 0?void 0:o.value,u=c&&(typeof c==="undefined"?"undefined":D(c))=="object"?iz(e,mf,m_).call(e,c):null,d=typeof(r===null||r===void 0?void 0:(a=r.params)===null||a===void 0?void 0:a.valid)=="boolean"?r.params.valid:null,h=typeof(r===null||r===void 0?void 0:(s=r.params)===null||s===void 0?void 0:s.customValidity)=="string"?r.params.customValidity:null;d!==null&&(ij(e,mb,d),d&&h===null&&ij(e,my,"")),h!==null&&ij(e,my,h);var p=r===null||r===void 0?void 0:(l=r.params)===null||l===void 0?void 0:l.state,f;if(p===void 0)f=void 0;else if(p===null)f=null;else if(typeof p=="string")f=p;else try{f="__qti_json__::".concat(JSON.stringify(p))}catch(e){f=null}if(u===null){var v;var g=((v=e.responseVariable)===null||v===void 0?void 0:v.cardinality)==="single"?"":[];e.response=g,e.validate(),e.saveResponse(g,f);break}e.response=u,e.validate(),e.saveResponse(u,f);break}case"error":e._errorMessage=r.params.message,console.error("Error from PCI iframe:",r.params.message);break}}},ij(e,mD,null);return e}d(t,[{key:"responseDeclaration",get:function e(){if(iL(this,mp))return iL(this,mp);var e=this.responseVariable;if(!e)return null;var t={baseType:e.baseType,cardinality:e.cardinality},n=e.correctResponse;return id(n)&&(t.correctResponse={value:n}),t},set:function e(e){ij(this,mp,e)}},{key:"getDirectChildrenByTag",value:function e(e){var t=e.toLowerCase();return Array.from(this.children).filter(function(e){return e.tagName.toLowerCase()===t})}},{key:"coerceBaseValue",value:function e(e,t){if(e==null)return e;switch(t){case"integer":{if(typeof e=="number")return e;var n=parseInt(String(e),10);return Number.isNaN(n)?e:n}case"float":case"duration":{if(typeof e=="number")return e;var r=parseFloat(String(e));return Number.isNaN(r)?e:r}case"boolean":{if(typeof e=="boolean")return e;if(typeof e=="string"){var o=e.toLowerCase();if(o==="true")return!0;if(o==="false")return!1}return e}default:return String(e)}}},{key:"normalizeListValue",value:function e(e){return e==null?[]:Array.isArray(e)?e:[e]}},{key:"variableToQtiVariableJSON",value:function e(e,t,n){var r=this;if(t==="record"||n==="record")return this.recordToQtiVariableJSON(e);if(t!=="single"){var o=this.normalizeListValue(e).map(function(e){return r.coerceBaseValue(e,n)});return{list:h({},n,o)}}return{base:h({},n,this.coerceBaseValue(e,n))}}},{key:"recordToQtiVariableJSON",value:function e(e){if(!e||(typeof e==="undefined"?"undefined":D(e))!="object")return{record:[]};var t=[];var n=true,r=false,o=undefined;try{for(var a=Object.entries(e)[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=I(s.value,2),c=l[0],u=l[1];t.push(this.recordEntryFromValue(c,u))}}catch(e){r=true;o=e}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(r){throw o}}}return{record:t}}},{key:"recordEntryFromValue",value:function e(e,t){if(Array.isArray(t)){var n=t.filter(function(e){return e!=null});if(n.length&&n.every(function(e){return typeof e=="boolean"}))return{name:e,list:{boolean:n}};if(n.length&&n.every(function(e){return typeof e=="number"})){var r=n,o=r.every(function(e){return Number.isInteger(e)});return{name:e,list:h({},o?"integer":"float",r)}}return{name:e,list:{string:t.map(function(e){return e==null?"":String(e)})}}}if(typeof t=="boolean")return{name:e,base:{boolean:t}};if(typeof t=="number")return Number.isInteger(t)?{name:e,base:{integer:t}}:{name:e,base:{float:t}};if(t==null)return{name:e,base:{string:""}};if((typeof t==="undefined"?"undefined":D(t))=="object")try{return{name:e,base:{string:JSON.stringify(t)}}}catch(n){return{name:e,base:{string:String(t)}}}return{name:e,base:{string:String(t)}}}},{key:"getQtiContextDefaultsFromItem",value:function e(){var e=this;var t=this.closest("qti-assessment-item");if(!t)return{};var n={};return t.querySelectorAll('qti-context-declaration[identifier="QTI_CONTEXT"]').forEach(function(t){var r=t.querySelector("qti-default-value");if(!r)return;r.querySelectorAll("qti-value[field-identifier]").forEach(function(t){var r;var o=t.getAttribute("field-identifier");if(!o)return;var a=t.getAttribute("base-type")||"string",s=((r=t.textContent)===null||r===void 0?void 0:r.trim())||"";n[o]=e.coerceBaseValue(s,a)})}),n}},{key:"getQtiContextRecord",value:function e(){var e,t,n;var r;var o=this.getQtiContextDefaultsFromItem(),a=((r=this.qtiContext)===null||r===void 0?void 0:r.QTI_CONTEXT)||{},s=k({},o,a);if(!Object.keys(s).length)return null;var l=k({candidateIdentifier:(e=s.candidateIdentifier)!==null&&e!==void 0?e:"",testIdentifier:(t=s.testIdentifier)!==null&&t!==void 0?t:"",environmentIdentifier:(n=s.environmentIdentifier)!==null&&n!==void 0?n:""},s);return this.recordToQtiVariableJSON(l)}},{key:"getTemplateVariables",value:function e(){var e=this;var t={},n=this.getDirectChildrenByTag("qti-template-variable");return n.length&&n.forEach(function(n){var r,o;var a=n.getAttribute("template-identifier")||n.getAttribute("identifier")||"";if(!a)return;var s=(o=e.context)===null||o===void 0?void 0:(r=o.variables)===null||r===void 0?void 0:r.find(function(e){return e.identifier===a});if(!s)return;var l=s.cardinality||"single",c=s.baseType||"string";t[a]=e.variableToQtiVariableJSON(s.value,l,c)}),t}},{key:"getContextVariables",value:function e(){var e=this;var t={},n=this.getDirectChildrenByTag("qti-context-variable");return n.length&&n.forEach(function(n){var r,o;var a=n.getAttribute("identifier")||"";if(!a)return;if(a==="QTI_CONTEXT"){var s=e.getQtiContextRecord();s&&(t[a]=s);return}var l=(o=e.context)===null||o===void 0?void 0:(r=o.variables)===null||r===void 0?void 0:r.find(function(e){return e.identifier===a});if(!l)return;var c=l.cardinality||"single",u=l.baseType||"string";t[a]=e.variableToQtiVariableJSON(l.value,c,u)}),t}},{key:"responseVariablesToQtiVariableJSON",value:function e(e,t,n){if(t!=="single"){var r={list:{}};return r.list[n]=e,r}else{var o={base:{}};return o.base[n]=e,o}}},{key:"validate",value:function e(){var e=typeof iL(this,mb)=="boolean"?iL(this,mb):iz(this,mf,mS).call(this);return iz(this,mf,mR).call(this,e,iL(this,my)),e}},{key:"value",get:function e(){return iL(this,mh)===null||iL(this,mh)===void 0?null:Array.isArray(iL(this,mh))?iL(this,mh).join(","):String(iL(this,mh))},set:function e(e){e===null?ij(this,mh,[]):ij(this,mh,Array.isArray(e)?e:e.split(","))}},{key:"boundTo",get:function e(){var e=this;var t,n;var r={};if((n=this.context)===null||n===void 0?void 0:(t=n.variables)===null||t===void 0?void 0:t.find(function(t){return t.identifier===e.responseIdentifier})){var o,a,s,l,c,u,d,h,p;var f=((s=this.context)===null||s===void 0?void 0:(a=s.variables)===null||a===void 0?void 0:(o=a.find(function(t){return t.identifier===e.responseIdentifier}))===null||o===void 0?void 0:o.cardinality)||"single",v=((u=this.context)===null||u===void 0?void 0:(c=u.variables)===null||c===void 0?void 0:(l=c.find(function(t){return t.identifier===e.responseIdentifier}))===null||l===void 0?void 0:l.baseType)||"string",g=((p=this.context)===null||p===void 0?void 0:(h=p.variables)===null||h===void 0?void 0:(d=h.find(function(t){return t.identifier===e.responseIdentifier}))===null||d===void 0?void 0:d.value)||null,m=this.responseVariablesToQtiVariableJSON(g,f,v);r[this.responseIdentifier]=m}return r},set:function e(e){if(!e||!e[this.responseIdentifier])return;var t=iz(this,mf,m_).call(this,e[this.responseIdentifier]);ij(this,mh,t),this.saveResponse(t)}},{key:"disconnectedCallback",value:function e(){p(f(t.prototype),"disconnectedCallback",this).call(this),window.removeEventListener("message",this.handleIframeMessage)}},{key:"sendMessageToIframe",value:function e(e,t){var n;var r=(n=this.iframe)===null||n===void 0?void 0:n.contentWindow;if(!this._iframeLoaded||!r){this._pendingMessages.push({method:e,params:t});return}r.postMessage({source:"qti-portable-custom-interaction",responseIdentifier:this.responseIdentifier,method:e,params:t},"*")}},{key:"createIframe",value:function e(){var e=this;this._interactionReady=!1,this.iframe=document.createElement("iframe"),this.iframe.id="pci-iframe-".concat(this.responseIdentifier),this.iframe.setAttribute("title","QTI PCI Iframe"),this.iframe.setAttribute("aria-label","QTI PCI Iframe"),this.iframe.setAttribute("aria-hidden","false"),this.iframe.setAttribute("role","application"),this.iframe.style.width="100%",this.iframe.style.border="none",this.iframe.style.display="block",this.iframe.onload=function(){e._iframeLoaded=!0,iz(e,mf,mM).call(e),iz(e,mf,mP).call(e)};var t="qti-pci-".concat(this.responseIdentifier,"-").concat(Date.now());this.iframe.name=t;var n=this.generateIframeContent();this.iframe.srcdoc=n,this.appendChild(this.iframe)}},{key:"connectedCallback",value:function e(){var e;var n;p(f(t.prototype),"connectedCallback",this).call(this),ij(this,mb,null),ij(this,my,"");var r=this.response;(Array.isArray(r)?r.length>0:r)||(this.response=(e=(n=this.responseVariable)===null||n===void 0?void 0:n.value)!==null&&e!==void 0?e:null),window.addEventListener("message",this.handleIframeMessage),this.createIframe()}},{key:"generateIframeContent",value:function e(){var e=window.getComputedStyle(document.body),t=JSON.stringify(iz(this,mf,mk).call(this)),n=JSON.stringify(iz(this,mf,mx).call(this)),r=this.dataset.baseUrl?this.dataset.baseUrl.startsWith("/")?"".concat(window.location.origin).concat(this.dataset.baseUrl):this.dataset.baseUrl:"",o=r?r.endsWith("/")?r:"".concat(r,"/"):"".concat(window.location.origin,"/"),a=this.dataset.forwardConsole==="true",s=window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1",l=s?"".concat(window.location.origin,"/cdn/index.js"):"https://unpkg.com/@citolab/qti-components/cdn",c=s?"".concat(window.location.origin,"/dist/item.css"):"https://unpkg.com/@citolab/qti-components@latest/dist/item.css",u=this.dataset.componentsCdnUrl||l,d=this.dataset.componentsCssUrl||c,h="\n font-family: ".concat(e.getPropertyValue("font-family"),";\n font-size: ").concat(e.getPropertyValue("font-size"),";\n line-height: ").concat(e.getPropertyValue("line-height"),";\n font-weight: ").concat(e.getPropertyValue("font-weight"),";\n color: ").concat(e.getPropertyValue("color"),";\n ");return'<!DOCTYPE html>\n <html lang="en">\n <head>\n <meta charset="utf-8" />\n <title>QTI PCI Container</title>\n <base href="'.concat(o,'" />\n <script type="module">\n import \'').concat(u,"';\n <\/script>\n <style>\n body, html {\n margin: 0;\n padding: 0;\n width: 100%;\n height: auto;\n overflow: hidden;\n /* Add the extracted font styles here */\n ").concat(h,'\n };\n .qti-customInteraction {\n width: 100%;\n height: 100%;\n }\n #pci-container {\n width: 100%;\n }\n qti-interaction-markup {\n display: block;\n width: 100%;\n min-height: 50px;\n }\n </style>\n <link href="').concat(d,'" rel="stylesheet" />\n <script src="').concat(this.requireJsUrl,'"><\/script>\n <script>\n const forwardConsole = ').concat(a?"true":"false",";\n if (forwardConsole) {\n const originalLog = console.log.bind(console);\n const originalError = console.error.bind(console);\n const stringifyArgs = args =>\n args.map(arg => {\n if (typeof arg === 'string') return arg;\n try {\n return JSON.stringify(arg);\n } catch (e) {\n return String(arg);\n }\n });\n console.log = (...args) => {\n originalLog(...args);\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: (window.PCIManager && window.PCIManager.responseIdentifier) || null,\n method: 'console',\n level: 'log',\n args: stringifyArgs(args)\n },\n '*'\n );\n };\n console.error = (...args) => {\n originalError(...args);\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: (window.PCIManager && window.PCIManager.responseIdentifier) || null,\n method: 'console',\n level: 'error',\n args: stringifyArgs(args)\n },\n '*'\n );\n };\n }\n // Define standard paths and shims\n window.requirePaths = ").concat(t,";\n\n window.requireShim = ").concat(n,";\n\n // Single initial RequireJS configuration with error handling\n window.requirejs.config({\n catchError: true,\n waitSeconds: 30,\n paths: window.requirePaths,\n baseUrl: '").concat(r,"',\n shim: window.requireShim,\n onNodeCreated: function (node, config, moduleName, url) {\n // Add error handler to script node\n node.addEventListener('error', function (evt) {\n console.error('Script load error for module:', moduleName, 'URL:', url, 'Event:', evt);\n });\n },\n onError: function (err) {\n console.error('RequireJS error:', {\n type: err.requireType,\n modules: err.requireModules,\n error: err\n });\n\n if (err.requireType === 'scripterror') {\n console.error('Script error usually indicates a network or CORS issue with:', err.requireModules);\n }\n\n // Notify parent window about the error\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: (window.PCIManager && window.PCIManager.responseIdentifier) || null,\n method: 'error',\n params: {\n message: 'RequireJS ' + err.requireType + ' error for modules: ' + err.requireModules,\n details: {\n type: err.requireType,\n modules: err.requireModules,\n error: err.toString()\n }\n }\n },\n '*'\n );\n }\n });\n\n // PCI Manager for iframe implementation\n window.PCIManager = {\n pciInstance: null,\n pciConfig: null,\n container: null,\n markupEl: null,\n propertiesEl: null,\n customInteractionTypeIdentifier: null,\n responseIdentifier: null,\n pendingBoundTo: null,\n pendingMarkup: null,\n pendingProperties: null,\n pendingState: null,\n pendingStylesheets: null,\n stylesheetKeys: {},\n interactionChangedViaEvent: false,\n eventBridgeAttached: false,\n lastResponseStr: null,\n hadResponse: false,\n\n initialize: function (config) {\n this.customInteractionTypeIdentifier = config.customInteractionTypeIdentifier;\n this.responseIdentifier = config.responseIdentifier;\n this.container = document.getElementById('pci-container');\n this.container.classList.add('qti-customInteraction');\n\n function qtiVariableHasValue(qtiVar) {\n if (!qtiVar) return false;\n if (qtiVar.base) {\n for (const k in qtiVar.base) {\n if (!Object.prototype.hasOwnProperty.call(qtiVar.base, k)) continue;\n const v = qtiVar.base[k];\n if (v !== null && v !== undefined && v !== '') return true;\n }\n }\n if (qtiVar.list) {\n for (const k in qtiVar.list) {\n if (!Object.prototype.hasOwnProperty.call(qtiVar.list, k)) continue;\n const v = qtiVar.list[k];\n if (Array.isArray(v) && v.some(x => x !== null && x !== undefined && x !== '')) return true;\n }\n }\n if (Array.isArray(qtiVar.record) && qtiVar.record.length > 0) return true;\n return false;\n }\n\n const initialBoundTo = config.boundTo && config.boundTo[this.responseIdentifier];\n this.hadResponse = qtiVariableHasValue(initialBoundTo);\n this.lastResponseStr = this.hadResponse ? JSON.stringify(initialBoundTo) : null;\n // Ensure expected DOM structure exists (markup + properties)\n this.markupEl = this.container.querySelector('qti-interaction-markup');\n if (!this.markupEl) {\n this.markupEl = document.createElement('qti-interaction-markup');\n this.container.appendChild(this.markupEl);\n }\n this.markupEl.classList.add('qti-customInteraction');\n this.propertiesEl = this.container.querySelector('properties');\n if (!this.propertiesEl) {\n this.propertiesEl = document.createElement('properties');\n this.propertiesEl.style.display = 'none';\n this.container.appendChild(this.propertiesEl);\n } else {\n this.propertiesEl.style.display = 'none';\n }\n\n // Apply any markup/properties that arrived before initialization\n if (this.pendingMarkup !== null) {\n this.setMarkup(this.pendingMarkup);\n this.pendingMarkup = null;\n }\n if (this.pendingProperties !== null) {\n this.setProperties(this.pendingProperties);\n this.pendingProperties = null;\n }\n if (this.pendingStylesheets !== null) {\n this.setStylesheets(this.pendingStylesheets);\n this.pendingStylesheets = null;\n }\n\n // Bridge qti-interaction-changed events (preferred over polling)\n if (!this.eventBridgeAttached) {\n this.eventBridgeAttached = true;\n const self = this;\n this.container.addEventListener(\n 'qti-interaction-changed',\n function (evt) {\n try {\n self.interactionChangedViaEvent = true;\n const value = evt && evt.detail ? evt.detail.value : undefined;\n if (value !== undefined) {\n const validFromEvent =\n evt && evt.detail && typeof evt.detail.valid === 'boolean' ? evt.detail.valid : undefined;\n let valid = validFromEvent;\n if (valid === undefined && self.pciInstance && typeof self.pciInstance.checkValidity === 'function') {\n try {\n valid = self.pciInstance.checkValidity();\n } catch (e) {\n // Keep undefined on PCI validity read errors.\n }\n }\n const customValidityFromEvent =\n evt && evt.detail && typeof evt.detail.customValidity === 'string'\n ? evt.detail.customValidity\n : undefined;\n let customValidity = customValidityFromEvent;\n if (\n customValidity === undefined &&\n self.pciInstance &&\n typeof self.pciInstance.getCustomValidity === 'function'\n ) {\n try {\n customValidity = self.pciInstance.getCustomValidity();\n } catch (e) {\n // Keep undefined on PCI custom validity read errors.\n }\n }\n const state =\n self.pciInstance && typeof self.pciInstance.getState === 'function'\n ? self.pciInstance.getState()\n : null;\n self.notifyInteractionChanged(value, state, valid, customValidity);\n }\n } catch (e) {\n // ignore bridge errors, polling fallback may still work\n }\n },\n true\n );\n }\n\n function getResolvablePath(path, basePath) {\n if (Array.isArray(path)) {\n return path.map(p => getResolvablePathString(p, basePath));\n } else {\n return getResolvablePathString(path, basePath);\n }\n }\n\n function removeDoubleSlashes(str) {\n return str\n .replace(/([^:\\/])\\/\\/+/g, '$1/')\n .replace(/\\/\\//g, '/')\n .replace('http:/', 'http://')\n .replace('https:/', 'https://');\n }\n\n function ensureDirectoryBasePath(basePath) {\n if (!basePath) return basePath;\n if (basePath.endsWith('/')) return basePath;\n return basePath + '/';\n }\n\n\n\n function combineRequireResolvePaths(path1, path2, baseUrl) {\n path1 = getResolvablePath(path1, baseUrl);\n const path1Array = Array.isArray(path1) ? path1 : [path1];\n if (!path2) {\n return path1Array;\n }\n path2 = getResolvablePath(path2, baseUrl);\n const path2Array = Array.isArray(path2) ? path2 : [path2];\n return path1Array.concat(path2Array).filter((value, index, self) => self.indexOf(value) === index);\n }\n\n // Update paths with modules from the config\n if (config.interactionModules && config.interactionModules.length > 0) {\n config.interactionModules.forEach(module => {\n if (module.id && module.primaryPath) {\n const currentPath = window.requirePaths[module.id] || [];\n const currentPaths = Array.isArray(currentPath) ? currentPath : [currentPath];\n const newPath = combineRequireResolvePaths(\n module.primaryPath,\n module.fallbackPath,\n config.baseUrl\n );\n window.requirePaths[module.id] = newPath.concat(currentPaths)\n .filter((value, index, self) => self.indexOf(value) === index);\n }\n });\n }\n\n // The ONLY other requirejs.config call - with the context for this specific PCI\n window.requirejs.config({\n context: this.customInteractionTypeIdentifier,\n paths: window.requirePaths,\n shim: window.requireShim\n });\n\n // Define qtiCustomInteractionContext for the PCI\n define('qtiCustomInteractionContext', () => {\n return {\n register: pciInstance => {\n this.pciInstance = pciInstance;\n // Configure PCI instance\n const pciConfig = {\n properties: config.properties || {},\n contextVariables: config.contextVariables || {},\n templateVariables: config.templateVariables || {},\n onready: pciInstance => {\n this.pciInstance = pciInstance;\n // Apply any pending updates that arrived before onready\n if (this.pendingBoundTo) {\n this.applyBoundTo(this.pendingBoundTo);\n this.pendingBoundTo = null;\n }\n if (this.pendingState && typeof this.pciInstance.setState === 'function') {\n this.pciInstance.setState(this.pendingState);\n this.pendingState = null;\n }\n this.notifyReady();\n },\n ondone: (pciInstance, response, state, status) => {\n const valid =\n this.pciInstance && typeof this.pciInstance.checkValidity === 'function'\n ? this.pciInstance.checkValidity()\n : undefined;\n const customValidity =\n this.pciInstance && typeof this.pciInstance.getCustomValidity === 'function'\n ? this.pciInstance.getCustomValidity()\n : undefined;\n this.notifyInteractionChanged(\n response,\n typeof state === 'string' ? state : null,\n valid,\n customValidity\n );\n },\n responseIdentifier: config.responseIdentifier,\n boundTo: config.boundTo,\n responseDeclaration: config.responseDeclaration || undefined,\n status: config.status || 'interacting'\n };\n\n if (pciInstance.getInstance) {\n const dom = this.markupEl || this.container;\n // Round-trip support for object states (stored as a prefixed JSON string by the host).\n // For strict string-based PCIs we pass the original string through unchanged.\n let restoredState = config.state;\n if (typeof restoredState === 'string' && restoredState.indexOf('__qti_json__::') === 0) {\n try {\n restoredState = JSON.parse(restoredState.substring('__qti_json__::'.length));\n } catch (e) {\n // If parsing fails, fall back to the raw string.\n restoredState = config.state;\n }\n }\n // Keep the configuration around next to the instance, it carries the\n // status and response declaration this PCI was constructed with.\n this.pciConfig = pciConfig;\n pciInstance.getInstance(dom, pciConfig, restoredState || undefined);\n } else {\n this.notifyError('Loaded PCI module has no getInstance().');\n }\n },\n notifyReady: () => {\n PCIManager.notifyReady();\n }\n };\n });\n\n function getResolvablePathString(path, basePath) {\n path = path.replace(/\\.js$/, '');\n if (/^[a-z][a-z0-9+.-]*:/i.test(path) || !basePath) {\n return path;\n }\n\n if (path.startsWith('/') && !path.startsWith('//')) {\n path = path.slice(1);\n }\n\n try {\n const resolved = new URL(path, ensureDirectoryBasePath(basePath)).toString();\n return resolved.replace(/\\.js$/, '');\n } catch (error) {\n return removeDoubleSlashes(ensureDirectoryBasePath(basePath) + path);\n }\n }\n\n // Load the PCI module\n this.loadModule(config.module);\n },\n\n loadModule: function (modulePath) {\n try {\n // Get the context-specific require\n const contextRequire = window.requirejs.config({\n context: this.customInteractionTypeIdentifier\n });\n contextRequire(['require'], require => {\n // Now load the actual module\n require([modulePath], () => {}, err => {\n console.error('Error loading module:', modulePath, err);\n this.notifyError('Module load error: ' + err.toString());\n });\n });\n } catch (error) {\n console.error('Exception in loadModule:', modulePath);\n console.error(error);\n this.notifyError('Error in require call: ' + error.toString());\n }\n },\n\n notifyReady: function () {\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: this.responseIdentifier,\n method: 'iframeReady'\n },\n '*'\n );\n },\n\n notifyInteractionChanged: function (response, state, valid, customValidity) {\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: this.responseIdentifier,\n method: 'interactionChanged',\n params: {\n value: response,\n state: state,\n valid: typeof valid === 'boolean' ? valid : undefined,\n customValidity: typeof customValidity === 'string' ? customValidity : undefined\n }\n },\n '*'\n );\n },\n\n notifyError: function (message) {\n console.error('PCI Error:', message);\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: this.responseIdentifier,\n method: 'error',\n params: { message: message }\n },\n '*'\n );\n },\n\n setMarkup: function (markupHtml) {\n if (!this.container) {\n this.container = document.getElementById('pci-container');\n }\n if (!this.container) {\n this.pendingMarkup = markupHtml;\n return;\n }\n this.markupEl = this.container.querySelector('qti-interaction-markup');\n if (!this.markupEl) {\n this.markupEl = document.createElement('qti-interaction-markup');\n this.container.appendChild(this.markupEl);\n }\n this.markupEl.classList.add('qti-customInteraction');\n this.markupEl.innerHTML = markupHtml || '';\n },\n\n setProperties: function (propertiesHtml) {\n if (!this.container) {\n this.container = document.getElementById('pci-container');\n }\n if (!this.container) {\n this.pendingProperties = propertiesHtml;\n return;\n }\n this.propertiesEl = this.container.querySelector('properties');\n if (!this.propertiesEl) {\n this.propertiesEl = document.createElement('properties');\n this.container.appendChild(this.propertiesEl);\n }\n this.propertiesEl.style.display = 'none';\n this.propertiesEl.innerHTML = propertiesHtml || '';\n },\n\n minifyCss: function (cssContent) {\n return cssContent\n .replace(/\\/\\*[\\s\\S]*?\\*\\//g, '')\n .replace(/\\s+/g, ' ')\n .replace(/\\s*([{}:;])\\s*/g, '$1')\n .trim();\n },\n\n setStylesheets: function (stylesheetsHtml) {\n if (!stylesheetsHtml) return;\n if (!this.container) {\n this.container = document.getElementById('pci-container');\n }\n const target = this.container || document.body;\n if (!target) return;\n target.insertAdjacentHTML('afterbegin', stylesheetsHtml);\n },\n\n\n applyBoundTo: function (boundTo) {\n if (!this.pciInstance || typeof this.pciInstance.setResponse !== 'function') return;\n const value = boundTo && (boundTo[this.responseIdentifier] || boundTo[Object.keys(boundTo)[0]]);\n if (value) this.pciInstance.setResponse(value);\n }\n };\n\n // Set up message listener for communication with parent\n let expectedParentOrigin = null;\n window.addEventListener('message', function (event) {\n const { data } = event;\n\n // Ensure the message is from our parent\n if (event.source !== window.parent || !data || data.source !== 'qti-portable-custom-interaction') {\n return;\n }\n if (expectedParentOrigin === null) {\n expectedParentOrigin = event.origin;\n } else if (event.origin !== expectedParentOrigin) {\n return;\n }\n\n function deepQuerySelector(root, selector) {\n if (!root) return null;\n try {\n const direct = root.querySelector ? root.querySelector(selector) : null;\n if (direct) return direct;\n } catch (e) {\n // ignore invalid selector for this root\n }\n if (!root.querySelectorAll) return null;\n const nodes = root.querySelectorAll('*');\n for (const node of nodes) {\n if (node && node.shadowRoot) {\n const found = deepQuerySelector(node.shadowRoot, selector);\n if (found) return found;\n }\n }\n return null;\n }\n\n function deepFindElementByExactText(root, text) {\n if (!root || !text) return null;\n if (root.querySelectorAll) {\n const nodes = root.querySelectorAll('*');\n for (const node of nodes) {\n if ((node.textContent || '').trim() === text) return node;\n if (node.shadowRoot) {\n const found = deepFindElementByExactText(node.shadowRoot, text);\n if (found) return found;\n }\n }\n }\n return null;\n }\n\n switch (data.method) {\n case 'initialize':\n PCIManager.initialize(data.params);\n break;\n\n case 'setMarkup':\n PCIManager.setMarkup(data.params);\n break;\n\n case 'setBoundTo':\n if (PCIManager.pciInstance) {\n PCIManager.applyBoundTo(data.params);\n } else {\n PCIManager.pendingBoundTo = data.params;\n }\n break;\n\n case 'setProperties':\n PCIManager.setProperties(data.params);\n break;\n\n case 'setStylesheets':\n PCIManager.setStylesheets(data.params);\n break;\n\n case 'setState':\n if (PCIManager.pciInstance && typeof PCIManager.pciInstance.setState === 'function') {\n PCIManager.pciInstance.setState((data.params && data.params.state) || data.params);\n } else {\n PCIManager.pendingState = (data.params && data.params.state) || data.params;\n }\n break;\n\n case 'getContent': {\n const messageId = data.params && data.params.messageId;\n const collectShadowHtml = root => {\n const parts = [];\n if (!root || !root.querySelectorAll) return parts;\n const nodes = root.querySelectorAll('*');\n for (const node of nodes) {\n if (node && node.shadowRoot) {\n parts.push(node.shadowRoot.innerHTML || '');\n parts.push(...collectShadowHtml(node.shadowRoot));\n }\n }\n return parts;\n };\n const shadowHtml = collectShadowHtml(document).join('\\n');\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'getContentResponse',\n messageId: messageId,\n content: (document.documentElement ? document.documentElement.outerHTML : '') + '\\n' + shadowHtml\n },\n '*'\n );\n break;\n }\n\n case 'simulateClick': {\n const messageId = data.params && data.params.messageId;\n const x = data.params && data.params.x;\n const y = data.params && data.params.y;\n const el = typeof x === 'number' && typeof y === 'number' ? document.elementFromPoint(x, y) : null;\n const target = (el && el.closest && el.closest('.hitbox')) || document.querySelector('.hitbox') || el;\n if (target) {\n const evt = new MouseEvent('click', {\n bubbles: true,\n clientX: x,\n clientY: y,\n screenX: x,\n screenY: y,\n view: window\n });\n target.dispatchEvent(evt);\n }\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'clickResponse',\n messageId: messageId\n },\n '*'\n );\n break;\n }\n\n case 'getBoundingRect': {\n const messageId = data.params && data.params.messageId;\n const selector = data.params && data.params.selector;\n const el = selector ? deepQuerySelector(document, selector) : null;\n const rect = el && typeof el.getBoundingClientRect === 'function' ? el.getBoundingClientRect() : null;\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'getBoundingRectResponse',\n messageId: messageId,\n rect: rect\n ? {\n left: rect.left,\n top: rect.top,\n width: rect.width,\n height: rect.height\n }\n : null\n },\n '*'\n );\n break;\n }\n\n case 'clickOnSelector': {\n const messageId = data.params && data.params.messageId;\n const selector = data.params && data.params.selector;\n const el = selector ? deepQuerySelector(document, selector) : null;\n const success = !!el;\n if (el && typeof el.click === 'function') el.click();\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'clickSelectorResponse',\n messageId: messageId,\n success: success\n },\n '*'\n );\n break;\n }\n\n case 'clickOnElementByText': {\n const messageId = data.params && data.params.messageId;\n const text = data.params && data.params.text;\n const target = text ? deepFindElementByExactText(document, text) : null;\n const success = !!target;\n if (target && typeof target.click === 'function') target.click();\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'clickTextResponse',\n messageId: messageId,\n success: success\n },\n '*'\n );\n break;\n }\n\n case 'setValueElement': {\n const messageId = data.params && data.params.messageId;\n const selector = data.params && data.params.selector;\n const value = data.params && data.params.value;\n const el = selector ? deepQuerySelector(document, selector) : null;\n let success = false;\n if (el && 'value' in el) {\n try {\n el.value = value;\n el.dispatchEvent(new Event('input', { bubbles: true }));\n el.dispatchEvent(new Event('change', { bubbles: true }));\n success = true;\n } catch (e) {\n success = false;\n }\n }\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'setValueResponse',\n messageId: messageId,\n success: success\n },\n '*'\n );\n break;\n }\n\n case 'console':\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'console',\n level: data.level,\n args: data.args\n },\n '*'\n );\n break;\n }\n });\n\n let resizeTimeout;\n let previousHeight = 0;\n const notifyResize = () => {\n const container = document.getElementById('pci-container');\n const newHeight = container.scrollHeight + 100;\n if (newHeight !== previousHeight) {\n previousHeight = newHeight;\n clearTimeout(resizeTimeout);\n resizeTimeout = setTimeout(() => {\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'resize',\n height: newHeight,\n width: container.scrollWidth\n },\n '*'\n );\n }, 100); // Adjust debounce time as needed\n }\n };\n\n function setupResizeObserver() {\n const container = document.getElementById('pci-container');\n if (!container || !(container instanceof Element)) {\n console.warn('ResizeObserver: document.container is not an Element');\n return;\n }\n\n const resizeObserver = new ResizeObserver(() => {\n notifyResize();\n });\n\n resizeObserver.observe(container);\n }\n\n // Run setup once DOM is ready\n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', () => {\n notifyResize(); // initial resize\n setupResizeObserver();\n });\n } else {\n notifyResize();\n setupResizeObserver();\n }\n\n window.addEventListener('load', () => {\n notifyResize();\n });\n let lastResponseStr = '';\n setInterval(() => {\n if (PCIManager.interactionChangedViaEvent) return;\n if (PCIManager.pciInstance && PCIManager.pciInstance.getResponse) {\n const response = PCIManager.pciInstance.getResponse();\n const valid =\n PCIManager.pciInstance && typeof PCIManager.pciInstance.checkValidity === 'function'\n ? PCIManager.pciInstance.checkValidity()\n : undefined;\n const customValidity =\n PCIManager.pciInstance && typeof PCIManager.pciInstance.getCustomValidity === 'function'\n ? PCIManager.pciInstance.getCustomValidity()\n : undefined;\n if (response === undefined) {\n // Don't emit an initial empty on load; only emit a clear if we previously had a value\n if (!PCIManager.hadResponse) return;\n PCIManager.hadResponse = false;\n PCIManager.lastResponseStr = null;\n const state =\n PCIManager.pciInstance && typeof PCIManager.pciInstance.getState === 'function'\n ? PCIManager.pciInstance.getState()\n : null;\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'interactionChanged',\n params: { value: null, state: state, valid: valid, customValidity: customValidity }\n },\n '*'\n );\n return;\n }\n\n const responseStr = JSON.stringify(response);\n\n if (responseStr !== PCIManager.lastResponseStr) {\n PCIManager.lastResponseStr = responseStr;\n PCIManager.hadResponse = true;\n const state =\n PCIManager.pciInstance && typeof PCIManager.pciInstance.getState === 'function'\n ? PCIManager.pciInstance.getState()\n : null;\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'interactionChanged',\n params: { value: response, state: state, valid: valid, customValidity: customValidity }\n },\n '*'\n );\n }\n }\n }, 500); // Check every 500ms\n <\/script>\n </head>\n <body>\n <div id=\"pci-container\"></div>\n </body>\n </html>")}},{key:"disable",value:function e(){if(ij(this,mD,{pointerEvents:this.style.pointerEvents,position:this.style.position}),this.sendMessageToIframe("setState",{state:"disabled"}),!this.querySelector(".pci-interaction-overlay")){var e=document.createElement("div");e.className="pci-interaction-overlay",e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.width="100%",e.style.height="100%",e.style.backgroundColor="rgba(200, 200, 200, 0.3)",e.style.zIndex="100",e.style.pointerEvents="all",e.style.cursor="not-allowed",getComputedStyle(this).position==="static"&&(this.style.position="relative"),this.appendChild(e)}}},{key:"enable",value:function e(){var e=this.querySelector(".pci-interaction-overlay");e&&e.remove(),iL(this,mD)&&(iL(this,mD).pointerEvents&&(this.style.pointerEvents=iL(this,mD).pointerEvents),iL(this,mD).position&&(this.style.position=iL(this,mD).position),ij(this,mD,null)),this.sendMessageToIframe("setState",{state:"interacting"})}},{key:"render",value:function e(){return o5(nE(),this._errorMessage?o5(n_(),this._errorMessage):"")}}]);return t}(a2);mh=new WeakMap,mp=new WeakMap,mf=new WeakSet,mv=function e(){var e=this.responseDeclaration;if(!(e===null||e===void 0?void 0:e.correctResponse)||md.includes(this.status))return e;var t=e.correctResponse,n=E(e,["correctResponse"]);return n},mg=new WeakMap,mm=new WeakMap,mb=new WeakMap,my=new WeakMap,mw=function e(){if(iL(this,mg)===null&&this.requirePathsJson)try{var e=JSON.parse(this.requirePathsJson);if(Array.isArray(e)||!e||(typeof e==="undefined"?"undefined":D(e))!="object")throw new Error("Require paths must be a JSON object.");ij(this,mg,e)}catch(e){console.error("Error parsing require paths JSON:",e),this._errorMessage="Error parsing require paths JSON: ".concat(e.message),ij(this,mg,{})}return iL(this,mg)||{}},mq=function e(){if(iL(this,mm)===null&&this.requireShimJson)try{ij(this,mm,JSON.parse(this.requireShimJson))}catch(e){console.error("Error parsing require shim JSON:",e),this._errorMessage="Error parsing require shim JSON: ".concat(e.message),ij(this,mm,{})}return iL(this,mm)||{}},mk=function e(){return iz(this,mf,mw).call(this)},mx=function e(){return iz(this,mf,mq).call(this)},m_=function e(e){for(var t in e)if(e.hasOwnProperty(t)){var n=e[t];if(n){for(var r in n)if(n.hasOwnProperty(r)){var o=n[r];if(Array.isArray(o))return o.map(String);if(o!=null)return String(o)}}}return null},mE=function e(e){var t=k({},e);for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=n.replace(/[A-Z]/g,function(e){return"-".concat(e.toLowerCase())});t[r]=e[n]}return t},mC=function e(e){var t=k({},e),n=function e(e,t,n){var r=e;for(var o=0;o<t.length;o+=1){var a=t[o];if(o===t.length-1){r[a]=n;return}(!r[a]||D(r[a])!="object"||Array.isArray(r[a]))&&(r[a]={}),r=r[a]}};var r=true,o=false,a=undefined;try{for(var s=Object.entries(e)[Symbol.iterator](),l;!(r=(l=s.next()).done);r=true){var c=I(l.value,2),u=c[0],d=c[1];if(!u.includes("__"))continue;var h=u.split("__").filter(Boolean);h.length<2||n(t,h,d)}}catch(e){o=true;a=e}finally{try{if(!r&&s.return!=null){s.return()}}finally{if(o){throw a}}}return t},mS=function e(){return this.response===null||this.response===void 0?!1:Array.isArray(this.response)?this.response.length===0?!1:this.response.some(function(e){return e!==""&&e!==null&&e!==void 0}):this.response!==""},mR=function e(e,t){var n=this.dataset.invalidresponsemessage||"Invalid response.",r=e?"":t&&t.trim().length>0?t:n;this._internals.setValidity(e?{}:{customError:!0},r)},mA=function e(e){return e&&e.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#x27;/g,"'").replace(/&#x2F;/g,"/").replace(/&#x60;/g,"`").replace(/&#x3D;/g,"=")},mT=function e(e){var t={};var n=true,r=false,o=undefined;try{for(var a=Object.entries(e)[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=I(s.value,2),c=l[0],u=l[1];typeof u=="string"?t[c]=iz(this,mf,mA).call(this,u):t[c]=u}}catch(e){r=true;o=e}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(r){throw o}}}return t},mI=function e(){var e=this;this._pendingMessages.length&&(this._pendingMessages.forEach(function(t){e.sendMessageToIframe(t.method,t.params)}),this._pendingMessages=[])},mP=function e(){var e,t;var n=iz(this,mf,mE).call(this,iz(this,mf,mC).call(this,iz(this,mf,mT).call(this,k({},this.dataset)))),r=(t=this.context)===null||t===void 0?void 0:(e=t.state)===null||e===void 0?void 0:e[this.responseIdentifier],o=typeof r=="string"&&r.length>0?r:null,a={module:this.module,customInteractionTypeIdentifier:this.customInteractionTypeIdentifier,baseUrl:this.baseUrl?this.baseUrl.startsWith("http")||this.baseUrl.startsWith("blob")||this.baseUrl.startsWith("base64")?this.baseUrl:y("".concat(window.location.origin).concat(this.baseUrl)):window.location.origin,responseIdentifier:this.responseIdentifier,properties:n,contextVariables:this.getContextVariables(),templateVariables:this.getTemplateVariables(),dataAttributes:k({},this.dataset),interactionModules:iz(this,mf,mO).call(this),boundTo:o?null:this.boundTo,responseDeclaration:iz(this,mf,mv).call(this),status:this.status,state:o};this.sendMessageToIframe("initialize",a)},mO=function e(){var e=[],t=this.querySelector("qti-interaction-modules");if(t){var n=t.querySelectorAll("qti-interaction-module");var r=true,o=false,a=undefined;try{for(var s=n[Symbol.iterator](),l;!(r=(l=s.next()).done);r=true){var c=l.value;e.push({id:c.getAttribute("id"),primaryPath:c.getAttribute("primary-path"),fallbackPath:c.getAttribute("fallback-path")})}}catch(e){o=true;a=e}finally{try{if(!r&&s.return!=null){s.return()}}finally{if(o){throw a}}}}return e},mM=function e(){var e=this.querySelector("qti-interaction-markup");e&&this.sendMessageToIframe("setMarkup",e.innerHTML);var t=Array.from(this.querySelectorAll("qti-stylesheet"));if(t.length){var n=t.map(function(e){return e.outerHTML}).join("\n");this.sendMessageToIframe("setStylesheets",n)}var r=this.querySelector("properties");r&&this.sendMessageToIframe("setProperties",r.innerHTML)},mN=function e(){},mD=new WeakMap,mL.styles=[mc,ob(nC())];var mU=mL;mu([n({type:String,attribute:"module"})],mU.prototype,"module",void 0);mu([n({type:String,attribute:"custom-interaction-type-identifier"})],mU.prototype,"customInteractionTypeIdentifier",void 0);mu([n({type:String,attribute:"data-require-paths"})],mU.prototype,"requirePathsJson",void 0);mu([n({type:String,attribute:"data-require-shim"})],mU.prototype,"requireShimJson",void 0);mu([n({type:String,attribute:"data-require-js-url"})],mU.prototype,"requireJsUrl",void 0);mu([n({type:String,attribute:"data-base-url"})],mU.prototype,"baseUrl",void 0);mu([n({type:Boolean,attribute:"data-use-default-paths"})],mU.prototype,"useDefaultPaths",void 0);mu([n({type:String,attribute:"data-status"})],mU.prototype,"status",void 0);mu([r()],mU.prototype,"_errorMessage",void 0);mu([m({context:aV,subscribe:!0}),r()],mU.prototype,"context",void 0);mu([m({context:aH,subscribe:!0}),r()],mU.prototype,"qtiContext",void 0);mu([n({attribute:"response",reflect:!1,converter:P({emptyAs:null})})],mU.prototype,"response",void 0);var mj,mz=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,mj,!1);return e}d(t,[{key:"waitForReady",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:5e3;return a(function(){var t,n;return z(this,function(r){switch(r.label){case 0:t=this;n=this._interactionReady;if(n)return[3,2];return[4,new Promise(function(n,r){var o=function e(){window.clearTimeout(a),n()},a=window.setTimeout(function(){t.removeEventListener("qti-portable-custom-interaction-loaded",o),r(new Error("Portable custom interaction did not become ready within ".concat(e,"ms")))},e);t.addEventListener("qti-portable-custom-interaction-loaded",o,{once:!0})})];case 1:n=r.sent();r.label=2;case 2:n;return[2]}})}).call(this)}},{key:"getIFrameContent",value:function e(){return a(function(){var e;return z(this,function(t){e=this;return[2,new Promise(function(t){var n="get-content-".concat(Date.now()),r=function o(o){var a=o.data;(a===null||a===void 0?void 0:a.source)==="qti-pci-iframe"&&(!(a===null||a===void 0?void 0:a.responseIdentifier)||(a===null||a===void 0?void 0:a.responseIdentifier)===e.responseIdentifier)&&(a===null||a===void 0?void 0:a.method)==="getContentResponse"&&(a===null||a===void 0?void 0:a.messageId)===n&&(window.removeEventListener("message",r),t(a.content))};window.addEventListener("message",r),e.sendMessageToIframe("getContent",{messageId:n}),setTimeout(function(){window.removeEventListener("message",r),t("")},5e3)})]})}).call(this)}},{key:"setTestContext",value:function e(e){var t=this;this.context=e,this.updateComplete.then(function(){var n;t.value=e===null||e===void 0?void 0:(n=e.variables)===null||n===void 0?void 0:n.find(function(e){return e.identifier===t.responseIdentifier}).value})}},{key:"recreateIframe",value:function e(){return a(function(){return z(this,function(e){switch(e.label){case 0:ij(this,mj,!0);e.label=1;case 1:e.trys.push([1,,3,4]);this.iframe&&(this._iframeLoaded=!1,this.iframe.remove()),this._pendingMessages=[],this.createIframe();return[4,this.waitForReady()];case 2:e.sent();return[3,4];case 3:ij(this,mj,!1);return[7];case 4:return[2]}})}).call(this)}},{key:"disconnectedCallback",value:function e(){iL(this,mj)||p(f(t.prototype),"disconnectedCallback",this).call(this)}},{key:"iFrameMouseClick",value:function e(e,t){return a(function(){var n;return z(this,function(r){n=this;return[2,new Promise(function(r){var o="click-".concat(Date.now()),a=function e(e){var t=e.data;(t===null||t===void 0?void 0:t.source)==="qti-pci-iframe"&&(!(t===null||t===void 0?void 0:t.responseIdentifier)||(t===null||t===void 0?void 0:t.responseIdentifier)===n.responseIdentifier)&&(t===null||t===void 0?void 0:t.method)==="clickResponse"&&(t===null||t===void 0?void 0:t.messageId)===o&&(window.removeEventListener("message",a),r())};window.addEventListener("message",a),n.sendMessageToIframe("simulateClick",{x:e,y:t,messageId:o}),setTimeout(function(){window.removeEventListener("message",a),r()},5e3)})]})}).call(this)}},{key:"iFrameClickOnElement",value:function e(e){return a(function(){var t;return z(this,function(n){t=this;return[2,new Promise(function(n){var r="click-selector-".concat(Date.now()),o=function e(e){var a=e.data;(a===null||a===void 0?void 0:a.source)==="qti-pci-iframe"&&(!(a===null||a===void 0?void 0:a.responseIdentifier)||(a===null||a===void 0?void 0:a.responseIdentifier)===t.responseIdentifier)&&(a===null||a===void 0?void 0:a.method)==="clickSelectorResponse"&&(a===null||a===void 0?void 0:a.messageId)===r&&(window.removeEventListener("message",o),n(a.success))};window.addEventListener("message",o),t.sendMessageToIframe("clickOnSelector",{selector:e,messageId:r}),setTimeout(function(){window.removeEventListener("message",o),n(!1)},5e3)})]})}).call(this)}},{key:"iFrameClickOnElementByText",value:function e(e){return a(function(){var t;return z(this,function(n){t=this;return[2,new Promise(function(n){var r="click-text-".concat(Date.now()),o=function e(e){var a=e.data;(a===null||a===void 0?void 0:a.source)==="qti-pci-iframe"&&(!(a===null||a===void 0?void 0:a.responseIdentifier)||(a===null||a===void 0?void 0:a.responseIdentifier)===t.responseIdentifier)&&(a===null||a===void 0?void 0:a.method)==="clickTextResponse"&&(a===null||a===void 0?void 0:a.messageId)===r&&(window.removeEventListener("message",o),n(a.success))};window.addEventListener("message",o),t.sendMessageToIframe("clickOnElementByText",{text:e,messageId:r}),setTimeout(function(){window.removeEventListener("message",o),n(!1)},5e3)})]})}).call(this)}},{key:"iFrameSetValueElement",value:function e(e,t){return a(function(){var n;return z(this,function(r){n=this;return[2,new Promise(function(r){var o="set-value-".concat(Date.now()),a=function e(e){var t=e.data;(t===null||t===void 0?void 0:t.source)==="qti-pci-iframe"&&(!(t===null||t===void 0?void 0:t.responseIdentifier)||(t===null||t===void 0?void 0:t.responseIdentifier)===n.responseIdentifier)&&(t===null||t===void 0?void 0:t.method)==="setValueResponse"&&(t===null||t===void 0?void 0:t.messageId)===o&&(window.removeEventListener("message",a),r(t.success))};window.addEventListener("message",a),n.sendMessageToIframe("setValueElement",{selector:e,value:t,messageId:o}),setTimeout(function(){window.removeEventListener("message",a),r(!1)},5e3)})]})}).call(this)}},{key:"iFrameGetBoundingClientRect",value:function e(e){return a(function(){var t;return z(this,function(n){t=this;return[2,new Promise(function(n){var r="get-bounding-rect-".concat(Date.now()),o=function e(e){var a;var s=e.data;(s===null||s===void 0?void 0:s.source)==="qti-pci-iframe"&&(!(s===null||s===void 0?void 0:s.responseIdentifier)||(s===null||s===void 0?void 0:s.responseIdentifier)===t.responseIdentifier)&&(s===null||s===void 0?void 0:s.method)==="getBoundingRectResponse"&&(s===null||s===void 0?void 0:s.messageId)===r&&(window.removeEventListener("message",o),n((a=s.rect)!==null&&a!==void 0?a:null))};window.addEventListener("message",o),t.sendMessageToIframe("getBoundingRect",{selector:e,messageId:r}),setTimeout(function(){window.removeEventListener("message",o),n(null)},5e3)})]})}).call(this)}},{key:"iFrameSetValueElementByText",value:function e(e,t){return a(function(){var n;return z(this,function(r){n=this;return[2,new Promise(function(r){var o="set-value-text-".concat(Date.now()),a=function e(e){var t=e.data;(t===null||t===void 0?void 0:t.source)==="qti-pci-iframe"&&(!(t===null||t===void 0?void 0:t.responseIdentifier)||(t===null||t===void 0?void 0:t.responseIdentifier)===n.responseIdentifier)&&(t===null||t===void 0?void 0:t.method)==="setValueByTextResponse"&&(t===null||t===void 0?void 0:t.messageId)===o&&(window.removeEventListener("message",a),r(t.success))};window.addEventListener("message",a),n.sendMessageToIframe("setValueElementByText",{text:e,value:t,messageId:o}),setTimeout(function(){window.removeEventListener("message",a),r(!1)},5e3)})]})}).call(this)}},{key:"iFrameMousedownOnElement",value:function e(e){return a(function(){var t;return z(this,function(n){t=this;return[2,new Promise(function(n){var r="mousedown-selector-".concat(Date.now()),o=function e(e){var a=e.data;(a===null||a===void 0?void 0:a.source)==="qti-pci-iframe"&&(!(a===null||a===void 0?void 0:a.responseIdentifier)||(a===null||a===void 0?void 0:a.responseIdentifier)===t.responseIdentifier)&&(a===null||a===void 0?void 0:a.method)==="mousedownSelectorResponse"&&(a===null||a===void 0?void 0:a.messageId)===r&&(window.removeEventListener("message",o),n(a.success))};window.addEventListener("message",o),t.sendMessageToIframe("mousedownOnSelector",{selector:e,messageId:r}),setTimeout(function(){window.removeEventListener("message",o),n(!1)},5e3)})]})}).call(this)}},{key:"generateIframeContent",value:function e(){var e=p(f(t.prototype),"generateIframeContent",this).call(this),n="\n // Test helper functions for QtiPortableCustomInteractionTest\n // Base iframe implementation already provides PCIManager.getContent\n \n // Base iframe implementation already provides PCIManager.simulateClick\n \n // Base iframe implementation already provides PCIManager.clickOnSelector\n \n // Base iframe implementation already provides PCIManager.clickOnElementByText\n \n // Base iframe implementation already provides PCIManager.setValueElement\n \n function deepQuerySelector(root, selector) {\n if (!root) return null;\n try {\n const direct = root.querySelector ? root.querySelector(selector) : null;\n if (direct) return direct;\n } catch (e) {\n // ignore invalid selector for this root\n }\n if (!root.querySelectorAll) return null;\n const nodes = root.querySelectorAll('*');\n for (const node of nodes) {\n if (node && node.shadowRoot) {\n const found = deepQuerySelector(node.shadowRoot, selector);\n if (found) return found;\n }\n }\n return null;\n }\n\n function deepFindElementByExactText(root, text) {\n if (!root || !text) return null;\n if (root.querySelectorAll) {\n const nodes = root.querySelectorAll('*');\n for (const node of nodes) {\n if ((node.textContent || '').trim() === text) return node;\n if (node.shadowRoot) {\n const found = deepFindElementByExactText(node.shadowRoot, text);\n if (found) return found;\n }\n }\n }\n return null;\n }\n\n function escapeSelectorId(id) {\n try {\n if (window.CSS && typeof window.CSS.escape === 'function') return window.CSS.escape(id);\n } catch (e) {\n // ignore\n }\n return String(id).replace(/([ #;?%&,.+*~\\':\"!^$[\\]()=>|\\/])/g, '\\\\$1');\n }\n\n PCIManager.setValueElementByText = function(params) {\n const messageId = params && params.messageId;\n try {\n const text = params && params.text;\n const value = params && params.value;\n\n const textEl = text ? deepFindElementByExactText(document, text) : null;\n let target = null;\n\n if (textEl) {\n const tag = (textEl.tagName || '').toUpperCase();\n if (tag === 'INPUT' || tag === 'TEXTAREA' || tag === 'SELECT') {\n target = textEl;\n } else if (tag === 'LABEL' && textEl.htmlFor) {\n const id = escapeSelectorId(textEl.htmlFor);\n target = deepQuerySelector(document, '#' + id);\n }\n\n if (!target) {\n let parent = textEl.parentElement;\n while (parent) {\n const candidate = parent.querySelector ? parent.querySelector('input, textarea, select') : null;\n if (candidate) {\n target = candidate;\n break;\n }\n parent = parent.parentElement;\n }\n }\n }\n\n const success = !!target && setValueOnElement(target, value);\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'setValueByTextResponse',\n messageId: messageId,\n success: success\n },\n '*'\n );\n } catch (error) {\n console.error('Error setting value by text:', error);\n window.parent.postMessage(\n {\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'setValueByTextResponse',\n messageId: messageId,\n success: false,\n error: error.toString()\n },\n '*'\n );\n }\n };\n \n PCIManager.mousedownOnSelector = function(params) {\n try {\n const element = params && params.selector ? deepQuerySelector(document, params.selector) : null;\n \n let success = false;\n \n if (element) {\n const rect = element.getBoundingClientRect();\n const mousedownEvent = new MouseEvent('mousedown', {\n bubbles: true,\n cancelable: true,\n view: window,\n clientX: rect.left + rect.width / 2,\n clientY: rect.top + rect.height / 2\n });\n element.dispatchEvent(mousedownEvent);\n success = true;\n }\n \n window.parent.postMessage({\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'mousedownSelectorResponse',\n messageId: params.messageId,\n success\n }, '*');\n } catch (error) {\n console.error('Error performing mousedown on selector:', error);\n window.parent.postMessage({\n source: 'qti-pci-iframe',\n responseIdentifier: PCIManager.responseIdentifier,\n method: 'mousedownSelectorResponse',\n messageId: params.messageId,\n success: false,\n error: error.toString()\n }, '*');\n }\n };\n \n // Helper function for setting values on elements\n function setValueOnElement(element, value) {\n if (element.tagName === 'INPUT' || element.tagName === 'TEXTAREA') {\n element.value = value;\n element.dispatchEvent(new Event('input', { bubbles: true }));\n element.dispatchEvent(new Event('change', { bubbles: true }));\n return true;\n } else if (element.tagName === 'SELECT') {\n element.value = value;\n element.dispatchEvent(new Event('change', { bubbles: true }));\n return true;\n } else if (element.isContentEditable) {\n element.textContent = value;\n element.dispatchEvent(new Event('input', { bubbles: true }));\n return true;\n }\n return false;\n }\n \n // Add test-related message handlers (do not override global handlers)\n let expectedParentOriginTest = null;\n window.addEventListener(\n 'message',\n function(event) {\n const { data } = event;\n\n if (event.source !== window.parent || !data || data.source !== 'qti-portable-custom-interaction') return;\n if (expectedParentOriginTest === null) expectedParentOriginTest = event.origin;\n else if (event.origin !== expectedParentOriginTest) return;\n if (data.responseIdentifier && data.responseIdentifier !== PCIManager.responseIdentifier) return;\n\n switch (data.method) {\n case 'setValueElementByText':\n PCIManager.setValueElementByText(data.params);\n return;\n case 'mousedownOnSelector':\n PCIManager.mousedownOnSelector(data.params);\n return;\n }\n },\n true\n );",r=e.lastIndexOf("<\/script>");return e.substring(0,r)+n+e.substring(r)}}]);return t}(mU);mj=new WeakMap;var mV=[{tag:"qti-portable-custom-interaction",ctor:mU},{tag:"qti-portable-custom-interaction-test",ctor:mz}];var mW=[aY,ob(nS())];var mF=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"render",value:function e(){return o5(nR())}}]);return t}(av);mF.styles=mW;var mB=mF;var m$=[aY,ob(nA())];var mH=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t),e.removeMoveListener=e.removeMoveListener.bind(e),e.dragElementHandler=e.dragElementHandler.bind(e);return e}d(t,[{key:"render",value:function e(){return o5(nT())}},{key:"dragElementHandler",value:function e(e){e.preventDefault();var t=e.clientX-this.startX,n=e.clientY-this.startY;this.dragElement.style.left=this.dragElement.offsetLeft+t+"px",this.dragElement.style.top=this.dragElement.offsetTop+n+"px",this.startX=e.clientX,this.startY=e.clientY}},{key:"firstUpdated",value:function e(e){var n=this;p(f(t.prototype),"firstUpdated",this).call(this,e),this.dragElement=this.querySelector("qti-position-object-interaction>img"),this.startX=0,this.startY=0,this.dragElement.addEventListener("mousedown",function(e){n.startX=e.clientX,n.startY=e.clientY,document.addEventListener("mousemove",n.dragElementHandler,!0)}),document.addEventListener("mouseup",this.removeMoveListener)}},{key:"removeMoveListener",value:function e(){document.removeEventListener("mousemove",this.dragElementHandler,!0)}},{key:"disconnectedCallback",value:function e(){p(f(t.prototype),"disconnectedCallback",this).call(this),document.removeEventListener("mousemove",this.dragElementHandler),document.removeEventListener("mouseup",this.removeMoveListener)}}]);return t}(av);mH.styles=m$;var mQ=mH;var mG=[{tag:"qti-position-object-interaction",ctor:mB},{tag:"qti-position-object-stage",ctor:mQ}];var mX="important",mK=" !"+mX,mY=sb(/*#__PURE__*/function(e){"use strict";v(t,e);function t(e){l(this,t);var n;var r;if(n=s(this,t,[e]),e.type!==sm.ATTRIBUTE||e.name!=="style"||((r=e.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}d(t,[{key:"render",value:function e(e){return Object.keys(e).reduce(function(t,n){var r=e[n];return r==null?t:t+"".concat(n=n.includes("-")?n:n.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase(),":").concat(r,";")},"")}},{key:"update",value:function e(e,t){var n=I(t,1),r=n[0];var o=e.element,a=o.style;if(this.ft===void 0)return this.ft=new Set(Object.keys(r)),this.render(r);var s=true,l=false,c=undefined;try{for(var u=this.ft[Symbol.iterator](),d;!(s=(d=u.next()).done);s=true){var h=d.value;r[h]==null&&(this.ft.delete(h),h.includes("-")?a.removeProperty(h):a[h]=null)}}catch(e){l=true;c=e}finally{try{if(!s&&u.return!=null){u.return()}}finally{if(l){throw c}}}for(var p in r){var f=r[p];if(f!=null){this.ft.add(p);var v=typeof f=="string"&&f.endsWith(mK);p.includes("-")||v?a.setProperty(p,v?f.slice(0,-11):f,v?mX:""):a[p]=f}}return o8}}]);return t}(sy));var mJ=[aY,ob(nI())];var mZ=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},m0,m1,m3,m2,m5,m4,m6,m8,m7,m9,be=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,m0);iU(e,m3);iU(e,m2);iU(e,m5);iU(e,m4);iU(e,m6);iU(e,m8);iU(e,m7);e.maxChoices=1/0,e.minChoices=0,e.response=null,e.areaMappings=null,e._areaEntries=[],e._handleAreaMappingsChange=function(){iz(e,m0,m1).call(e)},ij(e,m3,null),ij(e,m2,1),ij(e,m5,1),ij(e,m4,0),ij(e,m6,0),ij(e,m8,function(t){if(e.disabled)return;if(!iL(e,m3)){console.warn("No <img> element found in <qti-select-point-interaction>");return}iz(e,m0,m9).call(e);var n=iL(e,m3).getBoundingClientRect(),r=(t.clientX-n.left)*iL(e,m2),o=(t.clientY-n.top)*iL(e,m5),a="".concat(r.toFixed()," ").concat(o.toFixed());e.maxChoices===1?e.response=[a]:(e.maxChoices===0||(e.response||[]).length<e.maxChoices)&&(e.response=N(e.response||[]).concat([a])),e.saveResponse(e.response)}),ij(e,m7,function(){iz(e,m0,m9).call(e)});return e}d(t,[{key:"_effectiveAreaEntries",get:function e(){var e,t;var n=(t=this.responseVariable)===null||t===void 0?void 0:(e=t.areaMapping)===null||e===void 0?void 0:e.areaMapEntries;return(n===null||n===void 0?void 0:n.length)?n:this._areaEntries}},{key:"connectedCallback",value:function e(){p(f(t.prototype),"connectedCallback",this).call(this),window.addEventListener("resize",iL(this,m7))}},{key:"responsePoints",get:function e(){var e=this.response;return(Array.isArray(e)?e:e?[e]:[]).filter(function(e){return e}).map(function(e){var t=I(e.split(" ").map(Number),2),n=t[0],r=t[1];return{x:n,y:r}})}},{key:"pointPart",value:function e(e,t){return"point"}},{key:"renderSupplementalLayer",value:function e(){return o7}},{key:"positionOverlayElements",value:function e(e){var t=iL(this,m3);if(t){iz(this,m0,m9).call(this);var n=true,r=false,o=undefined;try{for(var a=e[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;var c=l.dataset.coord,u=l.dataset.shape;!c||!u||iu(u,c.split(",").map(function(e){return+e}),t,l)}}catch(e){r=true;o=e}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(r){throw o}}}}}},{key:"render",value:function e(){var e=this;var t=this.response,n=Array.isArray(t)?t:t?[t]:[];return o5(nO(),pI(n.filter(function(e){return e}),function(e){return e},function(t,n){var r=I(t.split(" ").map(Number),2),o=r[0],a=r[1],s=o/(iL(e,m4)||1)*100,l=a/(iL(e,m6)||1)*100;return o5(nP(),e.pointPart(t,n),mY({pointerEvents:e.maxChoices===1?"none":"auto",position:"absolute",left:"".concat(s,"%"),top:"".concat(l,"%")}),t,e.disabled,function(t){t.stopPropagation(),e.response=(e.response||[]).filter(function(e,t){return t!==n}),e.saveResponse(e.response)})}),this.renderSupplementalLayer())}},{key:"validate",value:function e(){var e,t;var n;var r=(e=(n=this.response)===null||n===void 0?void 0:n.length)!==null&&e!==void 0?e:0,o=this.maxChoices!==0&&Number.isFinite(this.maxChoices)&&r>this.maxChoices,a=r<this.minChoices,s=!0,l="";return o?(s=!1,l=this.dataset.maxSelectionsMessage||"Please select no more than ".concat(this.maxChoices," ").concat(this.maxChoices===1?"point":"points",".")):a&&(s=!1,l=this.dataset.minSelectionsMessage||"Please select at least ".concat(this.minChoices," ").concat(this.minChoices===1?"point":"points",".")),this.setInteractionValidity(s,l,(t=iL(this,m3))!==null&&t!==void 0?t:this,{suppressInline:!0}),s}},{key:"reportValidity",value:function e(){return p(f(t.prototype),"reportValidity",this).call(this)}},{key:"firstUpdated",value:function e(){p(f(t.prototype),"firstUpdated",this).call(this),ij(this,m3,this.querySelector("img")),iL(this,m3)?(iz(this,m0,m9).call(this),iL(this,m3).addEventListener("click",iL(this,m8))):console.warn("No <img> element found in <qti-select-point-interaction>")}},{key:"disconnectedCallback",value:function e(){p(f(t.prototype),"disconnectedCallback",this).call(this),window.removeEventListener("resize",iL(this,m7)),iL(this,m3)&&iL(this,m3).removeEventListener("click",iL(this,m8))}}]);return t}(a2);m0=new WeakSet,m1=function e(){try{var e=JSON.parse(this.areaMappings||"[]");if(!Array.isArray(e)){this._areaEntries=[];return}this._areaEntries=e.filter(function(e){return e&&(e.shape==="circle"||e.shape==="rect")&&typeof e.coords=="string"}).map(function(e){var t,n;return{shape:e.shape,coords:String(e.coords),mappedValue:Number((t=e.mappedValue)!==null&&t!==void 0?t:1),defaultValue:Number((n=e.defaultValue)!==null&&n!==void 0?n:0)}})}catch(e){this._areaEntries=[]}},m3=new WeakMap,m2=new WeakMap,m5=new WeakMap,m4=new WeakMap,m6=new WeakMap,m8=new WeakMap,m7=new WeakMap,m9=function e(){ij(this,m4,iL(this,m3).getAttribute("width")?parseFloat(iL(this,m3).getAttribute("width")):iL(this,m3).naturalWidth),ij(this,m6,iL(this,m3).getAttribute("height")?parseFloat(iL(this,m3).getAttribute("height")):iL(this,m3).naturalHeight);var e=iL(this,m3).getBoundingClientRect();ij(this,m2,e.width===0?1:iL(this,m4)/e.width),ij(this,m5,e.height===0?1:iL(this,m6)/e.height)},be.styles=mJ;var bt=be;mZ([n({type:Number,attribute:"max-choices"})],bt.prototype,"maxChoices",void 0);mZ([n({type:Number,attribute:"min-choices"})],bt.prototype,"minChoices",void 0);mZ([n({attribute:"response",reflect:!1,converter:{fromAttribute:function e(e){var t=w(e);return t===null?null:Array.isArray(t)?t:[t]},toAttribute:function e(e){return q(e)}}})],bt.prototype,"response",void 0);mZ([n({attribute:"area-mappings"})],bt.prototype,"areaMappings",void 0);mZ([r()],bt.prototype,"_areaEntries",void 0);mZ([O("areaMappings")],bt.prototype,"_handleAreaMappingsChange",void 0);var bn=[{tag:"qti-select-point-interaction",ctor:bt}];var br=[aY,ob(nM())];var bi=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},bo,ba,bs,bl,bc,bu,bd,bh,bp=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,ba);iU(e,bo);ij(e,bo,0),e.min=0,e.max=100,e.step=1;return e}d(t,[{key:"validate",value:function e(){return!0}},{key:"connectedCallback",value:function e(){p(f(t.prototype),"connectedCallback",this).call(this),this.hasAttribute("response")||iz(this,ba,bs).call(this,this.min),this.setAttribute("tabindex","0"),this.setAttribute("role","slider")}},{key:"response",get:function e(){return iL(this,bo).toString()},set:function e(e){if(e===null||e==="")return;var t=parseFloat(e);isNaN(t)||iz(this,ba,bs).call(this,t)}},{key:"renderRailSupplement",value:function e(){return o7}},{key:"render",value:function e(){return o5(nN(),this.min,this.max,iz(this,ba,bl),iz(this,ba,bc),this.response,this.renderRailSupplement())}}]);return t}(a2);bo=new WeakMap,ba=new WeakSet,bs=function e(e){var t=iL(this,bo);if(ij(this,bo,Math.min(this.max,Math.max(this.min,e))),iL(this,bo)===t)return;var n=(iL(this,bo)-this.min)/(this.max-this.min)*100;this.style.setProperty("--value-percentage","".concat(n,"%")),this._internals.setFormValue(this.value),this.saveResponse(this.response),this.requestUpdate()},bl=function e(e){var t=this;iz(this,ba,bu).call(this,e.pageX);var n=function e(e){return iz(t,ba,bd).call(t,e.pageX)},r=function e(){document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",r),iz(t,ba,bh).call(t)};document.addEventListener("mousemove",n),document.addEventListener("mouseup",r)},bc=function e(e){var t=this;iz(this,ba,bu).call(this,e.touches[0].pageX);var n=function e(e){return iz(t,ba,bd).call(t,e.touches[0].pageX)},r=function e(){document.removeEventListener("touchmove",n),document.removeEventListener("touchend",r),iz(t,ba,bh).call(t)};document.addEventListener("touchmove",n,{passive:!1}),document.addEventListener("touchend",r)},bu=function e(e){iz(this,ba,bd).call(this,e)},bd=function e(e){var t=this._rail.getBoundingClientRect(),n=e-t.left,r=Math.min(1,Math.max(0,n/t.width)),o=this.min+Math.round(r*(this.max-this.min)/this.step)*this.step;iz(this,ba,bs).call(this,o)},bh=function e(){this.dispatchEvent(new Event("change",{bubbles:!0}))},bp.styles=br;var bf=bp;bi([o("#rail")],bf.prototype,"_rail",void 0);bi([n({type:Number,attribute:"lower-bound"})],bf.prototype,"min",void 0);bi([n({type:Number,attribute:"upper-bound"})],bf.prototype,"max",void 0);bi([n({type:Number,attribute:"step"})],bf.prototype,"step",void 0);bi([n({attribute:"response",reflect:!1,noAccessor:!0})],bf.prototype,"response",null);var bv=[{tag:"qti-slider-interaction",ctor:bf}];var bg=function e(){return new bm},bm=function e(){"use strict";l(this,e)},bb=new WeakMap,by=sb(/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"render",value:function e(e){return o7}},{key:"update",value:function e(e,t){var n=I(t,1),r=n[0];var o;var a=r!==this.G;return a&&this.G!==void 0&&this.rt(void 0),(a||this.lt!==this.ct)&&(this.G=r,this.ht=(o=e.options)===null||o===void 0?void 0:o.host,this.rt(this.ct=e.element)),o7}},{key:"rt",value:function e(e){if(this.isConnected||(e=void 0),typeof this.G=="function"){var t;var n=(t=this.ht)!==null&&t!==void 0?t:globalThis,r=bb.get(n);r===void 0&&(r=new WeakMap,bb.set(n,r)),r.get(this.G)!==void 0&&this.G.call(this.ht,void 0),r.set(this.G,e),e!==void 0&&this.G.call(this.ht,e)}else this.G.value=e}},{key:"lt",get:function e(){var e;var t,n;return typeof this.G=="function"?(t=bb.get((e=this.ht)!==null&&e!==void 0?e:globalThis))===null||t===void 0?void 0:t.get(this.G):(n=this.G)===null||n===void 0?void 0:n.value}},{key:"disconnected",value:function e(){this.lt===this.ct&&this.rt(void 0)}},{key:"reconnected",value:function e(){this.rt(this.ct)}}]);return t}(sN));var bw=[aY,ob(nD())];var bq=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},bk=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments),e.inputRef=bg(),e.response=null,e._handleValueChange=function(){e._internals.setFormValue(e.value),e.validate()};return e}d(t,[{key:"value",get:function e(){return this.response||null},set:function e(e){this.response=e||null}},{key:"isInline",get:function e(){return!0}},{key:"validate",value:function e(){if(!this._input)return!1;var e="",t=!1;return this.patternMask&&this.dataPatternmaskMessage?(this._input.setCustomValidity(""),t=this._input.checkValidity(),t||(e=this.dataPatternmaskMessage,this._input.setCustomValidity(this.dataPatternmaskMessage))):t=this._input.checkValidity(),t&&this.response===""&&(t=!1),!t&&!e&&(e=this._input.validationMessage||"Invalid value."),this.setInteractionValidity(t,e,this._input,{suppressInline:!0}),t}},{key:"renderAnswer",value:function e(){return o5(nL())}},{key:"renderInput",value:function e(){var e=this;return o5(nU(),this.responseIdentifier,function(t){e.reportValidity()},function(e){return e.stopImmediatePropagation()},this.textChanged,this.textChanged,this.patternMask=="[0-9]*"?"number":"text",lO(this.placeholderText?this.placeholderText:void 0),this.response,lO(this.patternMask?this.patternMask:void 0),1e3,this.disabled,this.readonly)}},{key:"renderValidationMessage",value:function e(){return o5(nj())}},{key:"render",value:function e(){return o5(nz(),this.renderAnswer(),this.renderInput(),this.renderValidationMessage())}},{key:"textChanged",value:function e(e){if(this.disabled||this.readonly)return;var t=e.target;this.response!==t.value&&(this.value=t.value,this.saveResponse(t.value))}},{key:"reportValidity",value:function e(){return this.validate(),p(f(t.prototype),"reportValidity",this).call(this)}},{key:"reset",value:function e(){this.response=""}}]);return t}(a2);bk.styles=bw;var bx=bk;bq([n({type:Number,attribute:"expected-length"})],bx.prototype,"expectedLength",void 0);bq([n({type:String,attribute:"pattern-mask"})],bx.prototype,"patternMask",void 0);bq([n({type:String,attribute:"placeholder-text"})],bx.prototype,"placeholderText",void 0);bq([n({type:String,attribute:"data-patternmask-message"})],bx.prototype,"dataPatternmaskMessage",void 0);bq([n({type:String,attribute:"response",reflect:!1})],bx.prototype,"response",void 0);bq([o("input")],bx.prototype,"_input",void 0);bq([O("response",{waitUntilFirstUpdate:!0})],bx.prototype,"_handleValueChange",void 0);var b_=[{tag:"qti-text-entry-interaction",ctor:bx}];var bE=[aY,ob(nV())];var bC,bS,bR,bA,bT,bI=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,bR);iU(e,bC,null);iU(e,bS,null);return e}d(t,[{key:"reset",value:function e(){ij(this,bC,null),ij(this,bS,null),this.saveResponse(null)}},{key:"validate",value:function e(){return iL(this,bS)!==null}},{key:"response",get:function e(){return iL(this,bS)},set:function e(e){if(typeof e=="string")ij(this,bS,e),this.saveResponse(e);else if(e===null)this.reset();else throw new Error("Value must be a Base64-encoded string or null")}},{key:"render",value:function e(){return o5(nW(),iz(this,bR,bA),this.disabled,this.readonly)}}],[{key:"properties",get:function e(){return k({},a2.properties)}}]);return t}(a2);bC=new WeakMap,bS=new WeakMap,bR=new WeakSet,bA=function e(e){return a(function(){var t,n,r;return z(this,function(o){switch(o.label){case 0:t=e.target;n=t.files&&t.files.length>0;if(!n)return[3,2];ij(this,bC,t.files[0]);r=[this,bS];return[4,iz(this,bR,bT).call(this,iL(this,bC))];case 1:n=(ij.apply(void 0,r.concat([o.sent()])),this.saveResponse(iL(this,bS)),this.dispatchEvent(new CustomEvent("qti-interaction-response",{detail:{response:iL(this,bS)}})));o.label=2;case 2:n;return[2]}})}).call(this)},bT=function e(e){return new Promise(function(t,n){var r=new FileReader;r.onload=function(){return t(r.result)},r.onerror=function(){return n(r.error)},r.readAsDataURL(e)})},bI.styles=bE;var bP=bI;var bO=[{tag:"qti-upload-interaction",ctor:bP}];var bM=N(fk).concat(N(vt),N(vh),N(vI),N(vD),N(vG),N(vJ),N(ge),N(gs),N(gg),N(g_),N(gR),N(g1),N(g8),N(mn),N(ml),N(mV),N(mG),N(bn),N(bv),N(b_),N(bO));var bN=true,bD=false,bL=undefined;try{for(var bU=bM[Symbol.iterator](),bj;!(bN=(bj=bU.next()).done);bN=true){var bz=bj.value,bV=bz.tag,bW=bz.ctor;customElements.get(bV)||customElements.define(bV,bW)}}catch(e){bD=true;bL=e}finally{try{if(!bN&&bU.return!=null){bU.return()}}finally{if(bD){throw bL}}}var bF=true,bB=false,b$=undefined;try{for(var bH=vt[Symbol.iterator](),bQ;!(bF=(bQ=bH.next()).done);bF=true){var bG=bQ.value,bX=bG.tag,bK=bG.ctor;customElements.get(bX)||customElements.define(bX,bK)}}catch(e){bB=true;b$=e}finally{try{if(!bF&&bH.return!=null){bH.return()}}finally{if(bB){throw b$}}}var bY=true,bJ=false,bZ=undefined;try{for(var b0=vh[Symbol.iterator](),b1;!(bY=(b1=b0.next()).done);bY=true){var b3=b1.value,b2=b3.tag,b5=b3.ctor;customElements.get(b2)||customElements.define(b2,b5)}}catch(e){bJ=true;bZ=e}finally{try{if(!bY&&b0.return!=null){b0.return()}}finally{if(bJ){throw bZ}}}var b4=true,b6=false,b8=undefined;try{for(var b7=vI[Symbol.iterator](),b9;!(b4=(b9=b7.next()).done);b4=true){var ye=b9.value,yt=ye.tag,yn=ye.ctor;customElements.get(yt)||customElements.define(yt,yn)}}catch(e){b6=true;b8=e}finally{try{if(!b4&&b7.return!=null){b7.return()}}finally{if(b6){throw b8}}}var yr=true,yi=false,yo=undefined;try{for(var ya=vD[Symbol.iterator](),ys;!(yr=(ys=ya.next()).done);yr=true){var yl=ys.value,yc=yl.tag,yu=yl.ctor;customElements.get(yc)||customElements.define(yc,yu)}}catch(e){yi=true;yo=e}finally{try{if(!yr&&ya.return!=null){ya.return()}}finally{if(yi){throw yo}}}var yd=true,yh=false,yp=undefined;try{for(var yf=vG[Symbol.iterator](),yv;!(yd=(yv=yf.next()).done);yd=true){var yg=yv.value,ym=yg.tag,yb=yg.ctor;customElements.get(ym)||customElements.define(ym,yb)}}catch(e){yh=true;yp=e}finally{try{if(!yd&&yf.return!=null){yf.return()}}finally{if(yh){throw yp}}}var yy=true,yw=false,yq=undefined;try{for(var yk=vJ[Symbol.iterator](),yx;!(yy=(yx=yk.next()).done);yy=true){var y_=yx.value,yE=y_.tag,yC=y_.ctor;customElements.get(yE)||customElements.define(yE,yC)}}catch(e){yw=true;yq=e}finally{try{if(!yy&&yk.return!=null){yk.return()}}finally{if(yw){throw yq}}}var yS=true,yR=false,yA=undefined;try{for(var yT=ge[Symbol.iterator](),yI;!(yS=(yI=yT.next()).done);yS=true){var yP=yI.value,yO=yP.tag,yM=yP.ctor;customElements.get(yO)||customElements.define(yO,yM)}}catch(e){yR=true;yA=e}finally{try{if(!yS&&yT.return!=null){yT.return()}}finally{if(yR){throw yA}}}var yN=true,yD=false,yL=undefined;try{for(var yU=gs[Symbol.iterator](),yj;!(yN=(yj=yU.next()).done);yN=true){var yz=yj.value,yV=yz.tag,yW=yz.ctor;customElements.get(yV)||customElements.define(yV,yW)}}catch(e){yD=true;yL=e}finally{try{if(!yN&&yU.return!=null){yU.return()}}finally{if(yD){throw yL}}}var yF=true,yB=false,y$=undefined;try{for(var yH=gg[Symbol.iterator](),yQ;!(yF=(yQ=yH.next()).done);yF=true){var yG=yQ.value,yX=yG.tag,yK=yG.ctor;customElements.get(yX)||customElements.define(yX,yK)}}catch(e){yB=true;y$=e}finally{try{if(!yF&&yH.return!=null){yH.return()}}finally{if(yB){throw y$}}}var yY=true,yJ=false,yZ=undefined;try{for(var y0=g_[Symbol.iterator](),y1;!(yY=(y1=y0.next()).done);yY=true){var y3=y1.value,y2=y3.tag,y5=y3.ctor;customElements.get(y2)||customElements.define(y2,y5)}}catch(e){yJ=true;yZ=e}finally{try{if(!yY&&y0.return!=null){y0.return()}}finally{if(yJ){throw yZ}}}var y4=true,y6=false,y8=undefined;try{for(var y7=gR[Symbol.iterator](),y9;!(y4=(y9=y7.next()).done);y4=true){var we=y9.value,wt=we.tag,wn=we.ctor;customElements.get(wt)||customElements.define(wt,wn)}}catch(e){y6=true;y8=e}finally{try{if(!y4&&y7.return!=null){y7.return()}}finally{if(y6){throw y8}}}var wr=true,wi=false,wo=undefined;try{for(var wa=g1[Symbol.iterator](),ws;!(wr=(ws=wa.next()).done);wr=true){var wl=ws.value,wc=wl.tag,wu=wl.ctor;customElements.get(wc)||customElements.define(wc,wu)}}catch(e){wi=true;wo=e}finally{try{if(!wr&&wa.return!=null){wa.return()}}finally{if(wi){throw wo}}}var wd=true,wh=false,wp=undefined;try{for(var wf=g8[Symbol.iterator](),wv;!(wd=(wv=wf.next()).done);wd=true){var wg=wv.value,wm=wg.tag,wb=wg.ctor;customElements.get(wm)||customElements.define(wm,wb)}}catch(e){wh=true;wp=e}finally{try{if(!wd&&wf.return!=null){wf.return()}}finally{if(wh){throw wp}}}var wy=true,ww=false,wq=undefined;try{for(var wk=mn[Symbol.iterator](),wx;!(wy=(wx=wk.next()).done);wy=true){var w_=wx.value,wE=w_.tag,wC=w_.ctor;customElements.get(wE)||customElements.define(wE,wC)}}catch(e){ww=true;wq=e}finally{try{if(!wy&&wk.return!=null){wk.return()}}finally{if(ww){throw wq}}}var wS=true,wR=false,wA=undefined;try{for(var wT=ml[Symbol.iterator](),wI;!(wS=(wI=wT.next()).done);wS=true){var wP=wI.value,wO=wP.tag,wM=wP.ctor;customElements.get(wO)||customElements.define(wO,wM)}}catch(e){wR=true;wA=e}finally{try{if(!wS&&wT.return!=null){wT.return()}}finally{if(wR){throw wA}}}var wN=true,wD=false,wL=undefined;try{for(var wU=mV[Symbol.iterator](),wj;!(wN=(wj=wU.next()).done);wN=true){var wz=wj.value,wV=wz.tag,wW=wz.ctor;customElements.get(wV)||customElements.define(wV,wW)}}catch(e){wD=true;wL=e}finally{try{if(!wN&&wU.return!=null){wU.return()}}finally{if(wD){throw wL}}}var wF=true,wB=false,w$=undefined;try{for(var wH=mG[Symbol.iterator](),wQ;!(wF=(wQ=wH.next()).done);wF=true){var wG=wQ.value,wX=wG.tag,wK=wG.ctor;customElements.get(wX)||customElements.define(wX,wK)}}catch(e){wB=true;w$=e}finally{try{if(!wF&&wH.return!=null){wH.return()}}finally{if(wB){throw w$}}}var wY=true,wJ=false,wZ=undefined;try{for(var w0=bn[Symbol.iterator](),w1;!(wY=(w1=w0.next()).done);wY=true){var w3=w1.value,w2=w3.tag,w5=w3.ctor;customElements.get(w2)||customElements.define(w2,w5)}}catch(e){wJ=true;wZ=e}finally{try{if(!wY&&w0.return!=null){w0.return()}}finally{if(wJ){throw wZ}}}var w4=true,w6=false,w8=undefined;try{for(var w7=bv[Symbol.iterator](),w9;!(w4=(w9=w7.next()).done);w4=true){var qe=w9.value,qt=qe.tag,qn=qe.ctor;customElements.get(qt)||customElements.define(qt,qn)}}catch(e){w6=true;w8=e}finally{try{if(!w4&&w7.return!=null){w7.return()}}finally{if(w6){throw w8}}}var qr=true,qi=false,qo=undefined;try{for(var qa=b_[Symbol.iterator](),qs;!(qr=(qs=qa.next()).done);qr=true){var ql=qs.value,qc=ql.tag,qu=ql.ctor;customElements.get(qc)||customElements.define(qc,qu)}}catch(e){qi=true;qo=e}finally{try{if(!qr&&qa.return!=null){qa.return()}}finally{if(qi){throw qo}}}var qd=true,qh=false,qp=undefined;try{for(var qf=bO[Symbol.iterator](),qv;!(qd=(qv=qf.next()).done);qd=true){var qg=qv.value,qm=qg.tag,qb=qg.ctor;customElements.get(qm)||customElements.define(qm,qb)}}catch(e){qh=true;qp=e}finally{try{if(!qd&&qf.return!=null){qf.return()}}finally{if(qh){throw qp}}}var qy=function e(e){return a(function(){var t,n,r,o,a,s;return z(this,function(l){switch(l.label){case 0:t=e.substring(0,e.lastIndexOf("/"));return[4,lr().load("".concat(e)).then(function(e){return e.assessmentTest()})];case 1:n=l.sent();return[4,lf().load("".concat(t,"/").concat(n.href)).then(function(e){return e.htmlDoc()})];case 2:r=l.sent();return[4,lf().load("".concat(t,"/").concat(n.href)).then(function(e){return e.items()})];case 3:o=l.sent(),a="".concat(t,"/").concat(n.href),s="".concat(t,"/").concat(n.href.substring(0,n.href.lastIndexOf("/")));return[2,{testHTMLDoc:r,testURI:s,testURL:a,items:o,testIdentifier:n.identifier}]}})})()},qw=function e(e){return a(function(){return z(this,function(t){return[2,ln().load(e).then(function(e){return e.htmlDoc().firstElementChild})]})})()};var qq=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"calculate",value:function e(){return this.calculateChildren(Array.from(this.children))}}]);return t}(ih(a7));var qk=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},qx=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments),e.min=0,e.max=1/0;return e}d(t,[{key:"getResult",value:function e(){var e=this.getVariables();if(!e||e.length===0)return console.error("qti-any-n requires at least one child expression"),null;if(this.min<0||this.max<this.min)return console.error("qti-any-n requires 0 <= min <= max"),null;var t=0;var n=true,r=false,o=undefined;try{for(var a=e[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;if(l.cardinality!=="single"||Array.isArray(l.value))return console.error("qti-any-n requires single cardinality boolean expressions"),null;if(l.baseType!=="boolean")return console.error("qti-any-n requires boolean base-type"),null;if(l.value===null||l.value===void 0)return null;l.value==="true"&&t++}}catch(e){r=true;o=e}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(r){throw o}}}return t>=this.min&&t<=this.max}}]);return t}(a8);qk([n({type:Number})],qx.prototype,"min",void 0);qk([n({type:Number})],qx.prototype,"max",void 0);var q_=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},qE=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments),e.baseType="string";return e}d(t,[{key:"getResult",value:function e(){return this.textContent.trim()}}]);return t}(a8);q_([n({type:String,attribute:"base-type"})],qE.prototype,"baseType",void 0);var qC=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"getResult",value:function e(){var e;if(((e=this.children)===null||e===void 0?void 0:e.length)!==1)return console.error("qti-container-size must have exactly one child expression"),0;var t=this.getVariables();if(!t||(t===null||t===void 0?void 0:t.length)===0)return 0;var n=t[0];return n.value===null||n.value===void 0?0:n.cardinality!=="multiple"&&n.cardinality!=="ordered"?(console.error("qti-container-size requires multiple or ordered cardinality"),0):Array.isArray(n.value)?n.value.length:(console.error("qti-container-size: expected array value for multiple/ordered cardinality"),0)}}]);return t}(a8);var qS=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"getResult",value:function e(){var e=this.getVariables();if(this.children.length===2){var t=e[0],n=e[1];if(t.baseType==="directedPair"&&n.baseType==="directedPair"&&t.cardinality==="multiple"){var r=t.value,o=n.value;return r.filter(function(e){return o.includes(e)}).length>0}else if(t.baseType==="directedPair"&&n.baseType==="directedPair"&&t.cardinality==="single"){var a=t.value;return n.value.includes(a)}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 t}(a7);var qR=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"interpretation",get:function e(){return this.getAttribute("interpretation")||""}},{key:"getResult",value:function e(){var e=this.getAttribute("identifier")||"",t=this.context.variables.find(function(t){return t.identifier===e})||null;return t.cardinality!=="single"?t.correctResponse.length>0?t.correctResponse[0]:"":t.correctResponse}}]);return t}(a8);var qA=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},qT=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments),e.identifier="";return e}d(t,[{key:"getResult",value:function e(){var e;if(!this.identifier)return console.error("qti-default requires an identifier attribute"),null;var t=this.identifier.split("."),n=null,r;if(t.length===2)n=t[0],r=t[1];else if(t.length===1)r=t[0];else return console.error("qti-default: invalid identifier format"),null;if(n){var o;var a=this._testContext.items.find(function(e){return e.identifier===n});if(console.debug("itemContext: ".concat(JSON.stringify(a))),!this._testContext||!a)return console.warn('qti-default: item "'.concat(n,'" not found in test context')),null;var s=(o=this._testContext.items.find(function(e){return e.identifier===n}))===null||o===void 0?void 0:o.variables.find(function(e){return e.identifier===r});return s?s.defaultValue||null:(console.warn('qti-default: variable "'.concat(r,'" not found in item "').concat(n,'"')),null)}if(!((e=this.context)===null||e===void 0?void 0:e.variables))return console.warn("qti-default: no variables found in item context"),null;var l=this.context.variables.find(function(e){return e.identifier===r});return l?l.defaultValue||null:(console.warn('qti-default: variable "'.concat(r,'" not found in item context')),null)}}]);return t}(a8);qA([n({type:String})],qT.prototype,"identifier",void 0);qA([m({context:aV,subscribe:!0}),r()],qT.prototype,"context",void 0);qA([r(),m({context:aK,subscribe:!0})],qT.prototype,"_testContext",void 0);var qI=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"getResult",value:function e(){if(this.children.length===2){var e=this.getVariables(),t=e[0],n=e[1];return t.cardinality!=="single"||!Array.isArray(n.value)?(console.error("unexpected cardinality in qti equal"),null):e[0].baseType!==e[1].baseType?(console.error("The baseType of the two variables is different"),null):n.value.filter(function(e){return!t.value.includes(e)})}return null}}]);return t}(a8);var qP,qO,qM=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,qP);return e}d(t,[{key:"getResult",value:function e(){var e=iz(this,qP,qO).call(this,this.getVariables());return e.length!==2?(console.warn("qti-divide: expected exactly 2 numeric values"),null):e[1]===0?(console.warn("qti-divide: division by zero"),null):e[0]/e[1]}}]);return t}(a8);qP=new WeakSet,qO=function e(e){var t=[];var n=true,r=false,o=undefined;try{var a=function(){var e=l.value;if(!e)return"continue";var n=function e(e){if(e==null)return;var n=parseFloat(e.toString());if(Number.isNaN(n)){console.warn("qti-divide: non-numeric value encountered");return}t.push(n)};if(Array.isArray(e.value)){e.value.forEach(function(e){return n(e)});return"continue"}n(e.value)};for(var s=e[Symbol.iterator](),l;!(n=(l=s.next()).done);n=true)a()}catch(e){r=true;o=e}finally{try{if(!n&&s.return!=null){s.return()}}finally{if(r){throw o}}}return t};var qN,qD,qL,qU=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,qN);return e}d(t,[{key:"getResult",value:function e(){var e=iz(this,qN,qD).call(this);return e?e[0]>=e[1]:null}}]);return t}(a8);qN=new WeakSet,qD=function e(){var e=this;var t=this.getVariables();if(t.length!==2)return console.error("qti-duration-gte requires exactly 2 duration expressions"),null;var n=t.map(function(t){return iz(e,qN,qL).call(e,t)});return n.some(function(e){return e===null})?null:n},qL=function e(e){if(e.cardinality!=="single"||Array.isArray(e.value))return console.error("qti-duration-gte requires single cardinality"),null;if(e.baseType!=="duration")return console.error("qti-duration-gte requires duration base-type"),null;if(e.value===null||e.value===void 0)return null;var t=Number.parseFloat(e.value.toString());return Number.isNaN(t)?(console.error('qti-duration-gte requires duration values expressed in seconds, got "'.concat(e.value.toString(),'"')),null):t};var qj,qz,qV,qW=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,qj);return e}d(t,[{key:"getResult",value:function e(){var e=iz(this,qj,qz).call(this);return e?e[0]<e[1]:null}}]);return t}(a8);qj=new WeakSet,qz=function e(){var e=this;var t=this.getVariables();if(t.length!==2)return console.error("qti-duration-lt requires exactly 2 duration expressions"),null;var n=t.map(function(t){return iz(e,qj,qV).call(e,t)});return n.some(function(e){return e===null})?null:n},qV=function e(e){if(e.cardinality!=="single"||Array.isArray(e.value))return console.error("qti-duration-lt requires single cardinality"),null;if(e.baseType!=="duration")return console.error("qti-duration-lt requires duration base-type"),null;if(e.value===null||e.value===void 0)return null;var t=Number.parseFloat(e.value.toString());return Number.isNaN(t)?(console.error('qti-duration-lt requires duration values expressed in seconds, got "'.concat(e.value.toString(),'"')),null):t};var qF=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},qB=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments),e.roundingMode="significantFigures";return e}d(t,[{key:"figures",get:function e(){if(!this.getAttribute("figures"))return console.error("figures attribute is missing"),null;var e=parseInt(this.getAttribute("figures")||"0");return isNaN(e)?(console.error("figures attribute is not a number"),null):e<0?(console.error("figures attribute is negative"),null):e<1&&this.roundingMode==="significantFigures"?(console.error("figures cannot be smaller than 1 for RoundingMode significantFigures"),null):e}},{key:"getResult",value:function e(){if(this.children.length===2){var e=this.getVariables(),t=e[0],n=e[1];if(this.roundingMode===null)return null;if(t.cardinality!=="single"||n.cardinality!=="single"||Array.isArray(t.value)||Array.isArray(n.value))return console.error("unexpected cardinality in qti equal"),!1;switch(e[0].baseType){case"integer":case"float":{var r=parseFloat(t.value),o=parseFloat(n.value);if(!isNaN(r)&&!isNaN(o))return this.roundingMode==="significantFigures"?r.toPrecision(this.figures)===o.toPrecision(this.figures):Math.round(r*Math.pow(10,this.figures))/Math.pow(10,this.figures)===Math.round(o*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(o));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 t}(a8);qF([n({type:String})],qB.prototype,"roundingMode",void 0);var q$=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},qH=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments),e.toleranceMode="exact";return e}d(t,[{key:"getResult",value:function e(){if(this.children.length===2){var e=this.getVariables(),t=e[0],n=e[1];return!t||!n?null:this.toleranceMode!=="exact"?(console.error("toleranceMode is not supported yet"),!1):t.cardinality!=="single"||n.cardinality!=="single"||Array.isArray(t.value)||Array.isArray(n.value)?(console.error("unexpected cardinality in qti equal"),!1):t.value===null||n.value===null||t.value===void 0||n.value===void 0?null:sa.compareSingleValues(t.value,n.value,t.baseType)}return console.error("unexpected number of children in qti-equal"),null}}]);return t}(a8);q$([n({type:String})],qH.prototype,"toleranceMode",void 0);var qQ=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"getResult",value:function e(){var e=this.getAttribute("field-identifier");if(!e)throw new Error("field-identifier attribute is required");if(Array.from(this.children).length!==1)throw new Error("qti-field-value must have exactly one child expression");var t=this.getVariables()[0];if(t.baseType!=="record"||t.value===null)throw new Error("qti-field-value child expression must return a record");var n=t.value[e];if(n===void 0)throw new Error('Field "'.concat(e,'" not found in record'));return n}}]);return t}(a8);var qG,qX,qK,qY=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,qG);return e}d(t,[{key:"getResult",value:function e(){if(this.children.length===0)return console.error("qti-gcd must have at least one child expression"),null;var e=this.getVariables();if(!e||e.length===0)return null;var t=[];var n=true,r=false,o=undefined;try{for(var a=e[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;if(l.baseType!=="integer")return console.error("qti-gcd requires integer base-type"),null;if(l.value===null||l.value===void 0)return null;if(l.cardinality==="single"){if(Array.isArray(l.value))return console.error("qti-gcd unexpected array value for single cardinality"),null;var c=parseInt(l.value,10);if(isNaN(c))return console.error("qti-gcd non-numerical value"),null;t.push(c)}else if(l.cardinality==="multiple"||l.cardinality==="ordered"){if(!Array.isArray(l.value))return console.error("qti-gcd expected array value for multiple/ordered cardinality"),null;var u=true,d=false,h=undefined;try{for(var p=l.value[Symbol.iterator](),f;!(u=(f=p.next()).done);u=true){var v=f.value;if(v==null)return null;var g=parseInt(v,10);if(isNaN(g))return console.error("qti-gcd non-numerical value"),null;t.push(g)}}catch(e){d=true;h=e}finally{try{if(!u&&p.return!=null){p.return()}}finally{if(d){throw h}}}}else return console.error("qti-gcd unsupported cardinality"),null}}catch(e){r=true;o=e}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(r){throw o}}}return t.length===0?null:iz(this,qG,qX).call(this,t)}}]);return t}(a8);qG=new WeakSet,qX=function e(e){if(e.length===0)return 0;if(e.length===1)return Math.abs(e[0]);var t=Math.abs(e[0]);for(var n=1;n<e.length&&(t=iz(this,qG,qK).call(this,t,Math.abs(e[n])),t!==1);n++);return t},qK=function e(e,t){if(e===0&&t===0)return 0;if(e===0)return t;if(t===0)return e;for(;t!==0;){var n=t;t=e%t,e=n}return e};var qJ=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"getResult",value:function e(){if(this.children.length===2){var e=this.getVariables(),t=e[0],n=e[1];if((t.baseType==="integer"||t.baseType==="float")&&(n.baseType==="integer"||n.baseType==="float"))return+t.value>+n.value;console.error("unexpected baseType or cardinality in qti gt")}return console.error("unexpected number of children in qt"),null}}]);return t}(a8);var qZ=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"getResult",value:function e(){if(this.children.length===2){var e=this.getVariables(),t=e[0],n=e[1];return(t.baseType==="integer"||t.baseType==="float")&&(n.baseType==="integer"||n.baseType==="float")?+t.value>=+n.value:(console.error("unexpected baseType or cardinality in qti gte"),null)}return console.log("unexpected number of children in qte"),null}}]);return t}(a7);var q0=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},q1,q3,q2=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,q1);return e}d(t,[{key:"getResult",value:function e(){if(!this.n)return console.error('qti-index: missing required attribute "n"'),null;if(this.children.length!==1)return console.error("qti-index: must have exactly one child container element"),null;var e=this.getVariables()[0];if(!e)return console.error("qti-index: missing container"),null;var t;if(!isNaN(Number(this.n)))t=Number(this.n);else{var n=iz(this,q1,q3).call(this,this.n);if(n===null)return console.error('qti-index: variable "'.concat(this.n,'" is not a valid number')),null;t=Number(n)}if(t<=0||!Number.isInteger(t))return console.error("qti-index: index must be a positive integer"),null;if(e.cardinality==="ordered"){var r=Array.isArray(e.value)?e.value:[e.value];return e.value===null||t>r.length?null:r[t-1]}else return console.error("qti-index: child must have ordered cardinality"),null}}]);return t}(a8);q1=new WeakSet,q3=function e(e){var t;var n=(t=this.context.variables.find(function(t){return t.identifier===e}))===null||t===void 0?void 0:t.value;return n===null||isNaN(Number(n))?null:Number(n)};q0([n({type:String})],q2.prototype,"n",void 0);var q5=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},q4,q6,q8,q7,q9,ke,kt,kn=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,q4);e.shape="",e.coords="";return e}d(t,[{key:"getResult",value:function e(){var e=this.getVariables();if(e.length!==1)return console.error("qti-inside requires exactly one point expression"),null;var t=e[0];if(t.cardinality!=="single"||Array.isArray(t.value))return console.error("qti-inside requires single cardinality"),null;if(t.value===null||t.value===void 0)return null;if(!this.shape||!this.coords)return console.error("qti-inside requires shape and coords attributes"),null;var n=iz(this,q4,q6).call(this,t.value.toString()),r=iz(this,q4,q8).call(this,this.coords);if(!n||r.length===0)return null;switch(this.shape.toLowerCase()){case"circle":return iz(this,q4,q7).call(this,n,r);case"rect":return iz(this,q4,q9).call(this,n,r);case"ellipse":return iz(this,q4,ke).call(this,n,r);case"poly":case"polygon":return iz(this,q4,kt).call(this,n,r);default:return console.error('qti-inside does not support shape "'.concat(this.shape,'"')),null}}}]);return t}(a8);q4=new WeakSet,q6=function e(e){var t=e.split(/[,\s]+/).map(function(e){return e.trim()}).filter(Boolean);if(t.length!==2)return console.error('qti-inside requires a point value formatted as "x y" or "x,y"'),null;var n=Number.parseFloat(t[0]),r=Number.parseFloat(t[1]);return Number.isNaN(n)||Number.isNaN(r)?(console.error("qti-inside requires numeric point coordinates"),null):{x:n,y:r}},q8=function e(e){var t=e.split(",").map(function(e){return e.trim()}).filter(Boolean).map(function(e){return Number.parseFloat(e)});return t.some(function(e){return Number.isNaN(e)})?(console.error("qti-inside requires numeric coords"),[]):t},q7=function e(e,t){if(t.length!==3)return console.error("qti-inside circle requires x,y,r"),null;var n=I(t,3),r=n[0],o=n[1],a=n[2];return Math.pow(e.x-r,2)+Math.pow(e.y-o,2)<=Math.pow(a,2)},q9=function e(e,t){if(t.length!==4)return console.error("qti-inside rect requires left,top,right,bottom"),null;var n=I(t,4),r=n[0],o=n[1],a=n[2],s=n[3],l=Math.min(r,a),c=Math.max(r,a),u=Math.min(o,s),d=Math.max(o,s);return e.x>=l&&e.x<=c&&e.y>=u&&e.y<=d},ke=function e(e,t){if(t.length!==4)return console.error("qti-inside ellipse requires centerX,centerY,radiusX,radiusY"),null;var n=I(t,4),r=n[0],o=n[1],a=n[2],s=n[3];return a===0||s===0?!1:Math.pow(e.x-r,2)/Math.pow(a,2)+Math.pow(e.y-o,2)/Math.pow(s,2)<=1},kt=function e(e,t){if(t.length<6||t.length%2!==0)return console.error("qti-inside polygon requires at least 3 coordinate pairs"),null;var n=!1;for(var r=0,o=t.length-2;r<t.length;r+=2){var a=t[r],s=t[r+1],l=t[o],c=t[o+1];s>e.y!=c>e.y&&e.x<(l-a)*(e.y-s)/(c-s||Number.EPSILON)+a&&(n=!n),o=r}return n};q5([n({type:String})],kn.prototype,"shape",void 0);q5([n({type:String})],kn.prototype,"coords",void 0);var kr,ki,ko=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,kr);return e}d(t,[{key:"getResult",value:function e(){var e=iz(this,kr,ki).call(this,this.getVariables());return e.length!==2?(console.error("qti-integer-divide requires exactly 2 integer values"),null):e[1]===0?(console.error("qti-integer-divide: division by zero"),null):Math.floor(e[0]/e[1])}}]);return t}(a8);kr=new WeakSet,ki=function e(e){var t=[];var n=true,r=false,o=undefined;try{for(var a=e[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;if(l.baseType!=="integer")return console.error("qti-integer-divide requires integer base-type"),[];if(l.cardinality!=="single"||Array.isArray(l.value))return console.error("qti-integer-divide requires single cardinality"),[];if(l.value===null||l.value===void 0)return[];var c=Number.parseInt(l.value,10);if(Number.isNaN(c))return console.error("qti-integer-divide requires integer values"),[];t.push(c)}}catch(e){r=true;o=e}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(r){throw o}}}return t};var ka,ks,kl=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,ka);return e}d(t,[{key:"getResult",value:function e(){var e=iz(this,ka,ks).call(this,this.getVariables());return e.length!==2?(console.error("qti-integer-modulus requires exactly 2 integer values"),null):e[1]===0?(console.error("qti-integer-modulus: division by zero"),null):e[0]%e[1]}}]);return t}(a8);ka=new WeakSet,ks=function e(e){var t=[];var n=true,r=false,o=undefined;try{for(var a=e[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;if(l.baseType!=="integer")return console.error("qti-integer-modulus requires integer base-type"),[];if(l.cardinality!=="single"||Array.isArray(l.value))return console.error("qti-integer-modulus requires single cardinality"),[];if(l.value===null||l.value===void 0)return[];var c=Number.parseInt(l.value,10);if(Number.isNaN(c))return console.error("qti-integer-modulus requires integer values"),[];t.push(c)}}catch(e){r=true;o=e}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(r){throw o}}}return t};var kc=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"getResult",value:function e(){var e=this.getVariables();if(e.length!==1)return console.error("qti-integer-to-float requires exactly one child expression"),null;var t=e[0];if(t.baseType!=="integer")return console.error("qti-integer-to-float requires integer base-type"),null;if(t.cardinality!=="single"||Array.isArray(t.value))return console.error("qti-integer-to-float requires single cardinality"),null;if(t.value===null||t.value===void 0)return null;var n=Number.parseInt(t.value,10);return Number.isNaN(n)?(console.error("qti-integer-to-float requires an integer value"),null):n}}]);return t}(a8);var ku=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"getResult",value:function e(){if(this.children.length===1){var e=this.getVariables();if(!e)return!0;var t=e[0].value;return t==null||t==null||t===""}return console.error("unexpected number of children in qti Null"),null}}]);return t}(a8);var kd,kh,kp,kf,kv=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,kd);return e}d(t,[{key:"getResult",value:function e(){var e=this;var t=iz(this,kd,kh).call(this,this.getVariables());return t.length===0?(console.error("qti-lcm requires at least one integer value"),null):t.reduce(function(t,n){return iz(e,kd,kf).call(e,t,n)})}}]);return t}(a8);kd=new WeakSet,kh=function e(e){var t=[];var n=true,r=false,o=undefined;try{for(var a=e[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;if(l.baseType!=="integer")return console.error("qti-lcm requires integer base-type"),[];if(l.value===null||l.value===void 0)return[];if(l.cardinality==="single"){if(Array.isArray(l.value))return console.error("qti-lcm unexpected array value for single cardinality"),[];var c=Number.parseInt(l.value,10);if(Number.isNaN(c))return console.error("qti-lcm requires integer values"),[];t.push(c);continue}if(l.cardinality!=="multiple"&&l.cardinality!=="ordered")return console.error("qti-lcm unsupported cardinality"),[];if(!Array.isArray(l.value))return console.error("qti-lcm expected array value for container cardinality"),[];var u=true,d=false,h=undefined;try{for(var p=l.value[Symbol.iterator](),f;!(u=(f=p.next()).done);u=true){var v=f.value;var g=Number.parseInt(v,10);if(Number.isNaN(g))return console.error("qti-lcm requires integer values"),[];t.push(g)}}catch(e){d=true;h=e}finally{try{if(!u&&p.return!=null){p.return()}}finally{if(d){throw h}}}}}catch(e){r=true;o=e}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(r){throw o}}}return t},kp=function e(e,t){var n=Math.abs(e),r=Math.abs(t);for(;r!==0;){var o=n%r;n=r,r=o}return n},kf=function e(e,t){return e===0||t===0?0:Math.abs(e*t/iz(this,kd,kp).call(this,e,t))};var kg=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"render",value:function e(){return o5(nF())}},{key:"process",value:function e(){throw new Error("Not implemented")}}]);return t}(av);var km=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},kb=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"childExpression",get:function e(){return this.firstElementChild}},{key:"process",value:function e(){var e=this.getAttribute("identifier"),t=this.context.variables.find(function(t){return t.identifier===e})||null,n;return t.interpolationTable&&(n=t.interpolationTable.get(parseFloat(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:se(n)}})),n)}}]);return t}(kg);km([n({type:String})],kb.prototype,"identifier",void 0);km([m({context:aV,subscribe:!0}),r()],kb.prototype,"context",void 0);var ky=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"getResult",value:function e(){if(this.children.length===2){var e=this.getVariables(),t=e[0],n=e[1];if((t.baseType==="integer"||t.baseType==="float")&&(n.baseType==="integer"||n.baseType==="float"))return+t.value<+n.value;console.error("unexpected baseType or cardinality in qti lt")}return console.error("unexpected number of children in lt"),null}}]);return t}(a8);var kw=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"getResult",value:function e(){if(this.children.length===2){var e=this.getVariables(),t=e[0],n=e[1];return(t.baseType==="integer"||t.baseType==="float")&&(n.baseType==="integer"||n.baseType==="float")?+t.value<=+n.value:(console.error("unexpected baseType or cardinality in qti lte"),null)}return console.log("unexpected number of children in lte"),null}}]);return t}(a7);var kq=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},kk=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"getResult",value:function e(){var e=this;var t=this.context.variables.find(function(t){return t.identifier===e.identifier});if(!t)return console.warn("Response ".concat(this.identifier," cannot be found")),null;var n=t.areaMapping;if(!n)return console.warn("Area mapping not found for response ".concat(this.identifier)),null;var r=Array.isArray(t.value)?t.value:[t.value];if(!r||r.length===0)return console.warn("No candidate responses for response ".concat(this.identifier)),null;var o=0,a=new Set;var s=true,l=false,c=undefined,u=true,d=false,h=undefined;try{for(var p=r[Symbol.iterator](),f;!(u=(f=p.next()).done);u=true){var v=f.value;try{for(var g=n.areaMapEntries[Symbol.iterator](),m;!(s=(m=g.next()).done);s=true){var b=m.value;var y;if(a.has(b.coords))continue;sa.isPointInArea(v,"".concat(b.shape,",").concat(b.coords),t.baseType)&&(o+=(y=b.mappedValue)!==null&&y!==void 0?y:0,a.add(b.coords))}}catch(e){l=true;c=e}finally{try{if(!s&&g.return!=null){g.return()}}finally{if(l){throw c}}}}}catch(e){d=true;h=e}finally{try{if(!u&&p.return!=null){p.return()}}finally{if(d){throw h}}}return a.size<r.length&&(o+=n.defaultValue),n.lowerBound!=null&&(o=Math.max(n.lowerBound,o)),n.upperBound!=null&&(o=Math.min(n.upperBound,o)),o}}]);return t}(a8);kq([n({type:String})],kk.prototype,"identifier",void 0);var kx=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},k_=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"getResult",value:function e(){var e=this;var t=this.context.variables.find(function(t){return t.identifier===e.identifier});if(!t||!t.mapping)return console.error("Response ".concat(this.identifier," can not be found")),null;var n=t.mapping,r=Array.isArray(t.value)?t.value:[t.value],o=0;var a=true,s=false,l=undefined;try{var c=function(){var e=d.value;var r=n.mapEntries.filter(function(n){return t.baseType==="string"&&!n.caseSensitive?sa.compareSingleValues(n.mapKey.toLowerCase(),e.toLowerCase(),t.baseType):sa.compareSingleValues(n.mapKey,e,t.baseType)}),a=r.reduce(function(e,t){return e.mappedValue>t.mappedValue?e:t},r.length>0?r[0]:{mapKey:null,mappedValue:null});a===null||a.mappedValue==null?o+=n.defaultValue:o+=a.mappedValue};for(var u=r[Symbol.iterator](),d;!(a=(d=u.next()).done);a=true)c()}catch(e){s=true;l=e}finally{try{if(!a&&u.return!=null){u.return()}}finally{if(s){throw l}}}return(n===null||n===void 0?void 0:n.lowerBound)!==null&&(n===null||n===void 0?void 0:n.lowerBound)!==void 0&&(o=Math.max(n.lowerBound,o)),(n===null||n===void 0?void 0:n.upperBound)!==null&&(n===null||n===void 0?void 0:n.upperBound)!==void 0&&(o=Math.min(n.upperBound,o)),o}}]);return t}(a8);kx([n({type:String})],k_.prototype,"identifier",void 0);var kE=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"getResult",value:function e(){if(this.children.length===2){var e=this.getVariables(),n=e[0],r=e[1];return t.match(n,r)}return console.error("unexpected number of children in match"),null}}],[{key:"match",value:function e(e,t){if(e.value===null)return!1;switch(t.cardinality){case"single":var n;return Array.isArray(e.value)||Array.isArray(t.value)?(console.error("unexpected cardinality in qti match"),!1):sa.compareSingleValues((n=e.value)===null||n===void 0?void 0:n.toString(),t.value.toString(),t.baseType);case"ordered":{if(!Array.isArray(e.value)||!Array.isArray(t.value))return console.error("unexpected cardinality in qti match"),!1;if(e.value.length!==t.value.length)return!1;for(var r=0;r<e.value.length;r++)if(!sa.compareSingleValues(t.value[r],e.value[r],t.baseType))return!1;return!0}case"multiple":{if(!Array.isArray(e.value)||!Array.isArray(t.value))return console.error("unexpected cardinality in qti match"),!1;if(e.value.length!==t.value.length)return!1;var o=0;var a=true,s=false,l=undefined;try{for(var c=t.value[Symbol.iterator](),u;!(a=(u=c.next()).done);a=true){var d=u.value;var h=null,p=N(e.value);var f=true,v=false,g=undefined;try{for(var m=p[Symbol.iterator](),b;!(f=(b=m.next()).done);f=true){var y=b.value;if(sa.compareSingleValues(d,y,t.baseType)){h=y;break}}}catch(e){v=true;g=e}finally{try{if(!f&&m.return!=null){m.return()}}finally{if(v){throw g}}}if(h!==null)p.splice(p.indexOf(h),1);else return!1;o++}}catch(e){s=true;l=e}finally{try{if(!a&&c.return!=null){c.return()}}finally{if(s){throw l}}}return!0}default:return console.error("unexpected cardinality in qti match"),!1}}}]);return t}(a8);var kC=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},kS,kR,kA=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,kS);e.name="";return e}d(t,[{key:"getResult",value:function e(){if(!this.name)return console.error("qti-math-operator requires a name attribute"),null;var e=this.getVariables();if(!e||e.length===0)return null;var t=[];var n=true,r=false,o=undefined;try{for(var a=e[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;if(l.cardinality!=="single")return console.error("qti-math-operator requires single cardinality"),null;if(Array.isArray(l.value))return console.error("qti-math-operator unexpected array value for single cardinality"),null;if(l.value===null||l.value===void 0)return null;if(l.baseType!=="integer"&&l.baseType!=="float")return console.error("qti-math-operator requires numerical base-type"),null;var c=parseFloat(l.value);if(isNaN(c))return console.error("qti-math-operator non-numerical value"),null;t.push(c)}}catch(e){r=true;o=e}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(r){throw o}}}return iz(this,kS,kR).call(this,this.name,t)}}]);return t}(a8);kS=new WeakSet,kR=function e(e,t){try{switch(e.toLowerCase()){case"sin":return t.length!==1?null:Math.sin(t[0]);case"cos":return t.length!==1?null:Math.cos(t[0]);case"tan":return t.length!==1?null:Math.tan(t[0]);case"asin":return t.length!==1||t[0]<-1||t[0]>1?null:Math.asin(t[0]);case"acos":return t.length!==1||t[0]<-1||t[0]>1?null:Math.acos(t[0]);case"atan":return t.length!==1?null:Math.atan(t[0]);case"sinh":return t.length!==1?null:Math.sinh(t[0]);case"cosh":return t.length!==1?null:Math.cosh(t[0]);case"tanh":return t.length!==1?null:Math.tanh(t[0]);case"log":return t.length!==1||t[0]<=0?null:Math.log(t[0]);case"ln":return t.length!==1||t[0]<=0?null:Math.log(t[0]);case"log10":return t.length!==1||t[0]<=0?null:Math.log10(t[0]);case"exp":return t.length!==1?null:Math.exp(t[0]);case"abs":return t.length!==1?null:Math.abs(t[0]);case"sqrt":return t.length!==1||t[0]<0?null:Math.sqrt(t[0]);case"signum":return t.length!==1?null:Math.sign(t[0]);case"floor":return t.length!==1?null:Math.floor(t[0]);case"ceil":return t.length!==1?null:Math.ceil(t[0]);case"round":return t.length!==1?null:Math.round(t[0]);case"atan2":return t.length!==2?null:Math.atan2(t[0],t[1]);case"pow":{if(t.length!==2)return null;var n=t[0],r=t[1];return n===0&&r<=0||n<0&&!Number.isInteger(r)?null:Math.pow(n,r)}case"log_base":{if(t.length!==2)return null;var o=t[0],a=t[1];return o<=0||a<=0||a===1?null:Math.log(o)/Math.log(a)}case"mod":return t.length!==2||t[1]===0?null:t[0]%t[1];case"max":var s;return t.length<1?null:(s=Math).max.apply(s,N(t));case"min":var l;return t.length<1?null:(l=Math).min.apply(l,N(t));default:return console.error('qti-math-operator: unknown operation "'.concat(e,'"')),null}}catch(t){return console.error('qti-math-operator: error performing operation "'.concat(e,'":'),t),null}};kC([n({type:String})],kA.prototype,"name",void 0);var kT,kI,kP=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,kT);return e}d(t,[{key:"getResult",value:function e(){var e;var t=iz(this,kT,kI).call(this,this.getVariables());return t.length===0?(console.warn("qti-max: no numeric values provided"),null):(e=Math).max.apply(e,N(t))}}]);return t}(a8);kT=new WeakSet,kI=function e(e){var t=[];var n=true,r=false,o=undefined;try{var a=function(){var e=l.value;if(!e)return"continue";var n=function e(e){if(e==null)return;var n=parseFloat(e.toString());if(Number.isNaN(n)){console.warn("qti-max: non-numeric value encountered");return}t.push(n)};if(Array.isArray(e.value)){e.value.forEach(function(e){return n(e)});return"continue"}n(e.value)};for(var s=e[Symbol.iterator](),l;!(n=(l=s.next()).done);n=true)a()}catch(e){r=true;o=e}finally{try{if(!n&&s.return!=null){s.return()}}finally{if(r){throw o}}}return t};var kO=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"getResult",value:function e(){var e=this.getVariables();this.children.length!==2&&console.warn("The member operator takes two sub-expressions");var t=I(e,2),n=t[0],r=t[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 o=n.value;return r.value.includes(o)}}]);return t}(a8);var kM,kN,kD=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,kM);return e}d(t,[{key:"getResult",value:function e(){var e;var t=iz(this,kM,kN).call(this,this.getVariables());return t.length===0?(console.warn("qti-min: no numeric values provided"),null):(e=Math).min.apply(e,N(t))}}]);return t}(a8);kM=new WeakSet,kN=function e(e){var t=[];var n=true,r=false,o=undefined;try{var a=function(){var e=l.value;if(!e)return"continue";var n=function e(e){if(e==null)return;var n=parseFloat(e.toString());if(Number.isNaN(n)){console.warn("qti-min: non-numeric value encountered");return}t.push(n)};if(Array.isArray(e.value)){e.value.forEach(function(e){return n(e)});return"continue"}n(e.value)};for(var s=e[Symbol.iterator](),l;!(n=(l=s.next()).done);n=true)a()}catch(e){r=true;o=e}finally{try{if(!n&&s.return!=null){s.return()}}finally{if(r){throw o}}}return t};var kL=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"getResult",value:function e(){console.debug("qti-multiple getResult called",this.innerHTML);var e=this.getVariables();if(e.length===0)return console.error("unexpected number of children in qti multiple"),null;var t=true,n=false,r=undefined;try{for(var o=e[Symbol.iterator](),a;!(t=(a=o.next()).done);t=true){var s=a.value;if(s.cardinality!=="multiple"&&s.cardinality!=="single")return console.error("unexpected cardinality in qti multiple"),[]}}catch(e){n=true;r=e}finally{try{if(!t&&o.return!=null){o.return()}}finally{if(n){throw r}}}return e}}]);return t}(a8);var kU=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"render",value:function e(){return o5(nB(),p(f(t.prototype),"render",this).call(this))}},{key:"getResult",value:function e(){return!this.firstElementChild.calculate()}}]);return t}(a8);var kj=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"getResult",value:function e(){return null}}]);return t}(a8);var kz=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"getResult",value:function e(){return Array.from(this.children).map(function(e){var t=e;if(!t.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;var n=t.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(e){return typeof e=="boolean"&&e})}}]);return t}(a7);var kV=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"getResult",value:function e(){var e=this.getVariables();if(e.length===0)return console.error("unexpected number of children in qti multiple"),null;var t=true,n=false,r=undefined;try{for(var o=e[Symbol.iterator](),a;!(t=(a=o.next()).done);t=true){var s=a.value;if(s.cardinality!=="ordered"&&s.cardinality!=="single")return console.error("unexpected cardinality in qti ordered"),[]}}catch(e){n=true;r=e}finally{try{if(!t&&o.return!=null){o.return()}}finally{if(n){throw r}}}return e}}]);return t}(a8);var kW=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},kF=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments),e.pattern="";return e}d(t,[{key:"getResult",value:function e(){var e=this.getVariables();if(e.length!==1)return console.error("qti-pattern-match requires exactly one child expression"),null;if(!this.pattern)return console.error("qti-pattern-match requires a pattern attribute"),null;var t=e[0];if(t.cardinality!=="single"||Array.isArray(t.value))return console.error("qti-pattern-match requires single cardinality"),null;if(t.value===null||t.value===void 0)return null;try{return new RegExp(this.pattern).test(t.value.toString())}catch(e){return console.error("qti-pattern-match requires a valid regular expression",e),null}}}]);return t}(a8);kW([n({type:String})],kF.prototype,"pattern",void 0);var kB=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"getResult",value:function e(){if(this.children.length!==2)return console.error("qti-power must have exactly two child expressions"),null;var e=this.getVariables();if(!e||e.length!==2)return null;var t=I(e,2),n=t[0],r=t[1];if(n.cardinality!=="single"||r.cardinality!=="single")return console.error("qti-power requires single cardinality for both expressions"),null;if(Array.isArray(n.value)||Array.isArray(r.value))return console.error("qti-power unexpected array value for single cardinality"),null;if(n.value===null||n.value===void 0||r.value===null||r.value===void 0)return null;if(n.baseType!=="integer"&&n.baseType!=="float"||r.baseType!=="integer"&&r.baseType!=="float")return console.error("qti-power requires numerical base-types"),null;var o=parseFloat(n.value),a=parseFloat(r.value);if(isNaN(o)||isNaN(a))return console.error("qti-power: non-numerical values encountered"),null;if(o===0&&a<=0||o<0&&!Number.isInteger(a))return null;var s;try{s=Math.pow(o,a)}catch(e){return console.error("qti-power: error calculating power:",e),null}if(isNaN(s))return null;if(s===1/0||s===-1/0)return s;if(!isFinite(s)||Math.abs(s)>Number.MAX_VALUE||s!==0&&Math.abs(s)<Number.MIN_VALUE)return null;if(isFinite(s)&&s!==0){var l=Math.floor(Math.log10(Math.abs(s))),c=Math.max(0,14-l),u=Math.pow(10,c);s=Math.round(s*u)/u}return s}}]);return t}(a8);var k$=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},kH=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"render",value:function e(){var e=this;var t,n;var r=(n=this.context)===null||n===void 0?void 0:(t=n.variables.find(function(t){return t.identifier===e.identifier}))===null||t===void 0?void 0:t.value;return r===null?o7:o5(n$(),JSON.stringify(r,null,2))}},{key:"calculate",value:function e(){var e=this;return this.context.variables.find(function(t){return t.identifier===e.identifier})||null}}]);return t}(av);k$([n({type:String})],kH.prototype,"identifier",void 0);k$([m({context:aV,subscribe:!0}),r()],kH.prototype,"context",void 0);var kQ=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"getResult",value:function e(){return this.getVariables().reduce(function(e,t){if(t.baseType=="float"||t.baseType=="integer")try{return e*parseFloat(t.value.toString())}catch(e){console.warn("can not convert to number")}else console.warn("has another baseType ".concat(t.baseType));return e},1)}}]);return t}(a8);var kG=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},kX=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments),e.min=0,e.max=10,e.step=1;return e}d(t,[{key:"getResult",value:function e(){if(this.min>this.max)return console.error("qti-random-integer: min cannot be greater than max"),this.min;if(this.step<=0)return console.error("qti-random-integer: step must be positive"),this.min;var e=[],t=0;for(;;){var n=this.min+this.step*t;if(n>this.max)break;Number.isInteger(n)&&e.push(n),t++}if(e.length===0)return console.warn("qti-random-integer: no valid integer values in range"),Number.isInteger(this.min)?this.min:Math.floor(this.min);var r=Math.floor(Math.random()*e.length);return e[r]}},{key:"getPossibleValues",value:function e(){var e=[];if(this.min>this.max||this.step<=0)return[Number.isInteger(this.min)?this.min:Math.floor(this.min)];var t=0;for(;;){var n=this.min+this.step*t;if(n>this.max)break;Number.isInteger(n)&&e.push(n),t++}return e.length>0?e:[Number.isInteger(this.min)?this.min:Math.floor(this.min)]}}]);return t}(a8);kG([n({type:Number})],kX.prototype,"min",void 0);kG([n({type:Number})],kX.prototype,"max",void 0);kG([n({type:Number})],kX.prototype,"step",void 0);var kK=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"getResult",value:function e(){var e=this.getVariables();if(e.length===1){var t=e[0].value;if(Array.isArray(t)){var n=Math.floor(Math.random()*t.length);return t[n]}return t}return console.error("unexpected number of children in match"),null}}]);return t}(a8);var kY=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},kJ,kZ,k0,k1=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,kJ);e.numberRepeats="";return e}d(t,[{key:"getResult",value:function e(){var e=iz(this,kJ,kZ).call(this);if(e<=0)return[];var t=this.firstElementChild;if(!t)return console.warn("qti-repeat: missing child expression"),[];var n=[];for(var r=0;r<e;r++){var o=t.calculate(),a=iz(this,kJ,k0).call(this,o);a&&n.push(a)}return n}}]);return t}(a8);kJ=new WeakSet,kZ=function e(){var e;var t,n;if(!this.numberRepeats)return console.warn("qti-repeat: missing number-repeats attribute"),0;var r=parseInt(this.numberRepeats,10);if(!Number.isNaN(r))return r;var o=this.numberRepeats,a=(n=this.context)===null||n===void 0?void 0:(t=n.variables)===null||t===void 0?void 0:t.find(function(e){return e.identifier===o});if(!a)return console.warn('qti-repeat: unknown identifier "'.concat(o,'"')),0;var s=Array.isArray(a.value)?a.value[0]:a.value,l=parseInt((e=s===null||s===void 0?void 0:s.toString())!==null&&e!==void 0?e:"",10);return Number.isNaN(l)?(console.warn('qti-repeat: invalid repeat count from "'.concat(o,'"')),0):l},k0=function e(e){if(e==null)return null;if(typeof e=="number")return{identifier:"",cardinality:"single",baseType:Number.isInteger(e)?"integer":"float",value:e.toString(),type:"response"};if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return{identifier:"",cardinality:"single",baseType:Number.isInteger(t)?"integer":"float",value:e.toString(),type:"response"}}if(e&&(typeof e==="undefined"?"undefined":D(e))=="object"&&"value"in e){var n;var r=e.value;return{identifier:"",cardinality:"single",baseType:(n=e.baseType)!==null&&n!==void 0?n:"string",value:r!=null?r.toString():null,type:"response"}}return{identifier:"",cardinality:"single",baseType:"string",value:e.toString(),type:"response"}};kY([n({type:String,attribute:"number-repeats"})],k1.prototype,"numberRepeats",void 0);var k3=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"render",value:function e(){return o5(nH())}},{key:"process",value:function e(){var e=N(this.children);for(var t=0;t<e.length;t++){var n=e[t];if(n.calculate()){n.process();return}}}}]);return t}(kg);var k2=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"render",value:function e(){return o5(nQ())}},{key:"calculate",value:function e(){return!0}},{key:"getSubRules",value:function e(){return N(this.children)}},{key:"process",value:function e(){var e=this.getSubRules();for(var t=0;t<e.length;t++)e[t].process()}}]);return t}(av);var k5=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"calculate",value:function e(){return this.firstElementChild.calculate()}},{key:"getSubRules",value:function e(){var e=[];for(var t=1;t<this.children.length;t++)e.push(this.children[t]);return e}}]);return t}(k2);var k4=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"render",value:function e(){return o5(nG(),p(f(t.prototype),"render",this).call(this))}}]);return t}(k5);var k6=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},k8,k7,k9,xe=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,k8);e.roundingMode="significantFigures",e.figures=3;return e}d(t,[{key:"getResult",value:function e(){if(this.children.length!==1)return console.error("qti-round-to must have exactly one child expression"),null;var e=this.getVariables();if(!e||e.length===0)return null;var t=e[0];if(t.cardinality!=="single")return console.error("qti-round-to requires single cardinality"),null;if(Array.isArray(t.value))return console.error("qti-round-to unexpected array value for single cardinality"),null;if(t.value===null||t.value===void 0)return null;if(t.baseType!=="integer"&&t.baseType!=="float")return console.error("qti-round-to requires numerical base-type"),null;var n=parseFloat(t.value);return isNaN(n)?null:isFinite(n)?this.figures<0?(console.error("qti-round-to: figures must be non-negative"),null):this.roundingMode==="significantFigures"&&this.figures<1?(console.error("qti-round-to: figures must be at least 1 for significantFigures mode"),null):this.roundingMode==="decimalPlaces"?iz(this,k8,k7).call(this,n,this.figures):iz(this,k8,k9).call(this,n,this.figures):n===1/0?1/0:n===-1/0?-1/0:null}}]);return t}(a8);k8=new WeakSet,k7=function e(e,t){if(e===0)return 0;var n=Math.pow(10,t);return Math.round(e*n)/n},k9=function e(e,t){if(e===0)return 0;var n=Math.floor(Math.log10(Math.abs(e))),r=Math.pow(10,t-n-1);return Math.round(e*r)/r};k6([n({type:String,attribute:"rounding-mode"})],xe.prototype,"roundingMode",void 0);k6([n({type:Number})],xe.prototype,"figures",void 0);var xt=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"getResult",value:function e(){if(this.children.length!==1)return console.error("qti-round must have exactly one child expression"),null;var e=this.getVariables();if(!e||e.length===0)return null;var t=e[0];if(t.cardinality!=="single")return console.error("qti-round requires single cardinality"),null;if(Array.isArray(t.value))return console.error("qti-round unexpected array value for single cardinality"),null;if(t.value===null||t.value===void 0)return null;if(t.baseType!=="integer"&&t.baseType!=="float")return console.error("qti-round requires numerical base-type (integer or float)"),null;var n=parseFloat(t.value);return isNaN(n)?(console.warn("qti-round: NaN input results in NULL"),null):isFinite(n)?Math.floor(n+.5):n===1/0?1/0:n===-1/0?-1/0:null}}]);return t}(a8);var xn,xr,xi,xo=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,xn);return e}d(t,[{key:"process",value:function e(){var e=this.getAttribute("identifier");if(!e){console.warn('QtiSetCorrectResponse: Missing "identifier" attribute.');return}var t=this.firstElementChild;if(!t){console.warn("QtiSetCorrectResponse: No expression found.");return}var n=new xl(t).process();this.dispatchEvent(new CustomEvent("qti-set-correct-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:e,value:iz(this,xn,xr).call(this,n)}}))}}]);return t}(kg);xn=new WeakSet,xr=function e(e){var t=this;return e==null?null:Array.isArray(e)?e.map(function(e){return se(iz(t,xn,xi).call(t,e))}):se(iz(this,xn,xi).call(this,e))},xi=function e(e){var t;if(e&&(typeof e==="undefined"?"undefined":D(e))=="object"&&"value"in e){var n=e.value;return n!=null?n.toString():""}return(t=e===null||e===void 0?void 0:e.toString())!==null&&t!==void 0?t:""};var xa,xs,xl=/*#__PURE__*/function(){"use strict";function e(t){l(this,e);iU(this,xa);this.expression=t}d(e,[{key:"process",value:function e(){var e=this;var t;var n=(t=this.expression.calculate())!==null&&t!==void 0?t:null;return n===null&&console.warn("QtiSetCorrectResponseRule: Evaluated value is null."),Array.isArray(n)?n.map(function(t){return iz(e,xa,xs).call(e,t)}):iz(this,xa,xs).call(this,n)}}]);return e}();xa=new WeakSet,xs=function e(e){return e&&(typeof e==="undefined"?"undefined":D(e))=="object"&&"value"in e?e.value:e};var xc,xu,xd=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,xc);return e}d(t,[{key:"process",value:function e(){var e=this.getAttribute("identifier");if(!e){console.warn('QtiSetOutcomeValue: Missing "identifier" attribute.');return}var t=this.firstElementChild;if(!t){console.warn("QtiSetOutcomeValue: No expression found.");return}var n=new xh(t).process();this.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:e,value:iz(this,xc,xu).call(this,n)}}))}}]);return t}(kg);xc=new WeakSet,xu=function e(e){return Array.isArray(e)?e.map(se):e!==null?se(e):null};var xh=/*#__PURE__*/function(){"use strict";function e(t){l(this,e);this.expression=t}d(e,[{key:"process",value:function e(){var e;var t=(e=this.expression.calculate())!==null&&e!==void 0?e:null;return t===null&&console.warn("QtiSetOutcomeValueRule: Evaluated value is null."),Array.isArray(t)?t.map(function(e){return e.value?e.value:e}):t}}]);return e}();var xp,xf,xv,xg=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,xp);return e}d(t,[{key:"process",value:function e(){var e=this.getAttribute("identifier");if(!e){console.warn('QtiSetTemplateValue: Missing "identifier" attribute.');return}var t=this.firstElementChild;if(!t){console.warn("QtiSetTemplateValue: No expression found.");return}var n=new xy(t).process();this.dispatchEvent(new CustomEvent("qti-set-template-value",{bubbles:!0,composed:!0,detail:{templateIdentifier:e,value:iz(this,xp,xf).call(this,n)}}))}}]);return t}(kg);xp=new WeakSet,xf=function e(e){var t=this;return e==null?null:Array.isArray(e)?e.map(function(e){return se(iz(t,xp,xv).call(t,e))}):se(iz(this,xp,xv).call(this,e))},xv=function e(e){var t;if(e&&(typeof e==="undefined"?"undefined":D(e))=="object"&&"value"in e){var n=e.value;return n!=null?n.toString():""}return(t=e===null||e===void 0?void 0:e.toString())!==null&&t!==void 0?t:""};var xm,xb,xy=/*#__PURE__*/function(){"use strict";function e(t){l(this,e);iU(this,xm);this.expression=t}d(e,[{key:"process",value:function e(){var e=this;var t;var n=(t=this.expression.calculate())!==null&&t!==void 0?t:null;return n===null&&console.warn("QtiSetTemplateValueRule: Evaluated value is null."),Array.isArray(n)?n.map(function(t){return iz(e,xm,xb).call(e,t)}):iz(this,xm,xb).call(this,n)}}]);return e}();xm=new WeakSet,xb=function e(e){return e&&(typeof e==="undefined"?"undefined":D(e))=="object"&&"value"in e?e.value:e};var xw=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},xq,xk,xx,x_=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,xq);e.name="";return e}d(t,[{key:"getResult",value:function e(){if(!this.name)return console.warn("qti-stats-operator: missing name attribute"),null;var e=iz(this,xq,xx).call(this,this.getVariables());if(e.length===0)return console.warn("qti-stats-operator: no numeric values provided"),null;switch(this.name.toLowerCase()){case"mean":return e.reduce(function(e,t){return e+t},0)/e.length;case"popsd":return iz(this,xq,xk).call(this,e);default:return console.warn('qti-stats-operator: unsupported operator "'.concat(this.name,'"')),null}}}]);return t}(a8);xq=new WeakSet,xk=function e(e){var t=e.reduce(function(e,t){return e+t},0)/e.length,n=e.reduce(function(e,n){return e+Math.pow(n-t,2)},0)/e.length;return Math.sqrt(n)},xx=function e(e){var t=[];var n=true,r=false,o=undefined;try{var a=function(){var e=l.value;if(!e)return"continue";var n=function e(e){if(e==null)return;var n=parseFloat(e.toString());if(Number.isNaN(n)){console.warn("qti-stats-operator: non-numeric value encountered");return}t.push(n)};if(Array.isArray(e.value)){e.value.forEach(function(e){return n(e)});return"continue"}n(e.value)};for(var s=e[Symbol.iterator](),l;!(n=(l=s.next()).done);n=true)a()}catch(e){r=true;o=e}finally{try{if(!n&&s.return!=null){s.return()}}finally{if(r){throw o}}}return t};xw([n({type:String})],x_.prototype,"name",void 0);var xE=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},xC=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments),e.caseSensitive="true";return e}d(t,[{key:"getResult",value:function e(){if(this.children.length===2){var e=this.getVariables(),t=e[0],n=e[1];if(t.cardinality!=="single"||n.cardinality!=="single"||Array.isArray(t.value)||Array.isArray(n.value))return console.error("unexpected cardinality in qti string-match"),!1;var r=this.caseSensitive==="true"?t.value:t.value.toLowerCase(),o=this.caseSensitive==="true"?n.value:n.value.toLowerCase();return sa.compareSingleValues(r,o,t.baseType)}return console.error("unexpected number of children in qti-string-match"),null}}]);return t}(a8);xE([n({type:String,attribute:"case-sensitive"})],xC.prototype,"caseSensitive",void 0);var xS=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},xR=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments),e.caseSensitive="true";return e}d(t,[{key:"getResult",value:function e(){var e=this.getVariables();if(e.length!==2)return console.error("qti-substring requires exactly 2 child expressions"),null;var t=I(e,2),n=t[0],r=t[1];if(n.cardinality!=="single"||r.cardinality!=="single"||Array.isArray(n.value)||Array.isArray(r.value))return console.error("qti-substring requires single cardinality"),null;if(n.value===null||r.value===null||n.value===void 0||r.value===void 0)return null;var o=n.value.toString(),a=r.value.toString();return this.caseSensitive!=="true"?a.toLowerCase().includes(o.toLowerCase()):a.includes(o)}}]);return t}(a8);xS([n({type:String,attribute:"case-sensitive"})],xR.prototype,"caseSensitive",void 0);var xA=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"getResult",value:function e(){return this.calculateChildren(Array.from(this.children))}}]);return t}(ip(a8));var xT=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"getResult",value:function e(){return new xI(Array.from(this.children)).calculate()}}]);return t}(a8),xI=/*#__PURE__*/function(){"use strict";function e(t){l(this,e);this.expressions=t}d(e,[{key:"calculate",value:function e(){return this.expressions.filter(function(e){return e.calculate!==void 0}).some(function(e){return e.calculate()===null})?null:this.expressions.map(function(e){var t=e.calculate();return Number.isNaN(t)?(console.error("unexpected value in qti-sum, expected number"),null):Number(t)}).reduce(function(e,t){return e+t},0)}}]);return e}();var xP=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"getResult",value:function e(){var e=this.getVariables();if(e.length!==1)return console.error("qti-truncate requires exactly one child expression"),null;var t=e[0];if(t.cardinality!=="single"||Array.isArray(t.value))return console.error("qti-truncate requires single cardinality"),null;if(t.baseType!=="integer"&&t.baseType!=="float")return console.error("qti-truncate requires numerical base-type"),null;if(t.value===null||t.value===void 0)return null;var n=Number.parseFloat(t.value);return Number.isNaN(n)?(console.error("qti-truncate requires a numerical value"),null):Math.trunc(n)}}]);return t}(a8);var xO=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"getResult",value:function e(){var e=this.getAttribute("identifier");return this.context.variables.find(function(t){return t.identifier===e}).value}}]);return t}(a8);var xM=[{tag:"qti-and",ctor:qq},{tag:"qti-any-n",ctor:qx},{tag:"qti-base-value",ctor:qE},{tag:"qti-container-size",ctor:qC},{tag:"qti-contains",ctor:qS},{tag:"qti-correct",ctor:qR},{tag:"qti-default",ctor:qT},{tag:"qti-delete",ctor:qI},{tag:"qti-divide",ctor:qM},{tag:"qti-duration-gte",ctor:qU},{tag:"qti-duration-lt",ctor:qW},{tag:"qti-equal",ctor:qH},{tag:"qti-equal-rounded",ctor:qB},{tag:"qti-field-value",ctor:qQ},{tag:"qti-gcd",ctor:qY},{tag:"qti-gt",ctor:qJ},{tag:"qti-gte",ctor:qZ},{tag:"qti-index",ctor:q2},{tag:"qti-inside",ctor:kn},{tag:"qti-integer-divide",ctor:ko},{tag:"qti-integer-modulus",ctor:kl},{tag:"qti-integer-to-float",ctor:kc},{tag:"qti-is-null",ctor:ku},{tag:"qti-lcm",ctor:kv},{tag:"qti-lookup-outcome-value",ctor:kb},{tag:"qti-lt",ctor:ky},{tag:"qti-lte",ctor:kw},{tag:"qti-map-response",ctor:k_},{tag:"qti-map-response-point",ctor:kk},{tag:"qti-match",ctor:kE},{tag:"qti-math-operator",ctor:kA},{tag:"qti-max",ctor:kP},{tag:"qti-member",ctor:kO},{tag:"qti-min",ctor:kD},{tag:"qti-multiple",ctor:kL},{tag:"qti-not",ctor:kU},{tag:"qti-null",ctor:kj},{tag:"qti-or",ctor:kz},{tag:"qti-ordered",ctor:kV},{tag:"qti-pattern-match",ctor:kF},{tag:"qti-power",ctor:kB},{tag:"qti-printed-variable",ctor:kH},{tag:"qti-product",ctor:kQ},{tag:"qti-random",ctor:kK},{tag:"qti-random-integer",ctor:kX},{tag:"qti-repeat",ctor:k1},{tag:"qti-response-condition",ctor:k3},{tag:"qti-response-else",ctor:k2},{tag:"qti-response-else-if",ctor:k4},{tag:"qti-response-if",ctor:k5},{tag:"qti-round",ctor:xt},{tag:"qti-round-to",ctor:xe},{tag:"qti-rule",ctor:kg},{tag:"qti-set-correct-response",ctor:xo},{tag:"qti-set-outcome-value",ctor:xd},{tag:"qti-set-template-value",ctor:xg},{tag:"qti-stats-operator",ctor:x_},{tag:"qti-string-match",ctor:xC},{tag:"qti-substring",ctor:xR},{tag:"qti-subtract",ctor:xA},{tag:"qti-sum",ctor:xT},{tag:"qti-truncate",ctor:xP},{tag:"qti-variable",ctor:xO}];var xN=true,xD=false,xL=undefined;try{for(var xU=xM[Symbol.iterator](),xj;!(xN=(xj=xU.next()).done);xN=true){var xz=xj.value,xV=xz.tag,xW=xz.ctor;customElements.get(xV)||customElements.define(xV,xW)}}catch(e){xD=true;xL=e}finally{try{if(!xN&&xU.return!=null){xU.return()}}finally{if(xD){throw xL}}}var xF=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},xB;(function(e){e.Correct="correct",e.PartiallyCorrect="partially-correct",e.Incorrect="incorrect"})(xB||(xB={}));var x$=function e(e){var t=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments),e.showCorrectResponse=!1,e._handleShowCorrectResponseChange=function(t,n){e.toggleInternalCorrectResponse(n)},e.showFullCorrectResponse=!1,e._handleShowFullCorrectResponseChange=function(t,n){e.toggleFullCorrectResponse(n)},e.showCandidateCorrection=!1,e._handleShowCandidateCorrectionChange=function(t,n){e.toggleCandidateCorrection(n)},e._correctResponse=null;return e}d(t,[{key:"correctResponseAttr",get:function e(){return this._correctResponse},set:function e(e){this._correctResponse=e}},{key:"isFullCorrectResponse",get:function e(){return this._isFullCorrectResponse},set:function e(e){this._isFullCorrectResponse=e,e&&(this.setAttribute("inert",""),this.setAttribute("response-identifier",this.responseIdentifier+"_cr"),this.setAttribute("answer-key",""))}},{key:"registersWithItem",get:function e(){return!this.isFullCorrectResponse&&p(f(t.prototype),"registersWithItem",this)}},{key:"correctResponse",get:function e(){var e=this.responseVariable;return(e===null||e===void 0?void 0:e.correctResponse)?e.correctResponse:this._correctResponse},set:function e(e){var t=this._correctResponse;this._correctResponse=e,e==null?this.removeAttribute("correct-response"):this.setAttribute("correct-response",Array.isArray(e)?e.join(","):e),this.requestUpdate("_correctResponse",t)}},{key:"correctness",get:function e(){var e=this.correctResponse;if(!e)return null;var t=this.response;if(t==null||t===""||Array.isArray(t)&&t.length===0)return null;var n=Array.isArray(e)?e:[e],r=(Array.isArray(t)?t:[t]).filter(function(e){return e!==""});if(r.length===0)return null;var o=r.filter(function(e){return n.includes(e)}).length,a=r.filter(function(e){return!n.includes(e)}).length;return o===n.length&&a===0&&r.length===n.length?xB.Correct:o>0&&(o<n.length||a>0)?xB.PartiallyCorrect:xB.Incorrect}},{key:"correctionPart",get:function e(){return"correction"}},{key:"toggleCorrectResponse",value:function e(e){var t;(((t=this.configContext)===null||t===void 0?void 0:t.correctResponseMode)||"internal")==="full"?this.toggleFullCorrectResponse(e):this.toggleInternalCorrectResponse(e)}},{key:"withholdsFullCorrectResponseWhenCorrect",get:function e(){var e;return((e=this.configContext)===null||e===void 0?void 0:e.fullCorrectResponseOnlyWhenIncorrect)!==!1}},{key:"toggleFullCorrectResponse",value:function e(e){return a(function(){var t,n,r,o,a,s,l;return z(this,function(c){switch(c.label){case 0:n=this.nextSibling,r=g(n,HTMLDivElement)&&(n===null||n===void 0?void 0:n.classList.contains("full-correct-response")),o=this.correctResponse;if(!o)return[2];if(!(e&&(!this.withholdsFullCorrectResponseWhenCorrect||this.correctness!==xB.Correct))){;if(!r)return[2];(a=this.parentElement)===null||a===void 0?void 0:a.removeChild(n);return[2]}if(r)return[2];s=this.cloneNode(!0);s.removeAttribute("show-full-correct-response"),s.removeAttribute("show-correct-response"),s.removeAttribute("show-candidate-correction");l=document.createElement("div");l.classList.add("full-correct-response"),this.isInline?l.classList.add("full-correct-response-inline"):l.classList.add("full-correct-response-block"),l.role="full-correct-response",l.appendChild(s),s.isFullCorrectResponse=!0,(t=this.parentElement)===null||t===void 0?void 0:t.insertBefore(l,this.nextSibling);return[4,s.updateComplete];case 1:c.sent(),s.response=Array.isArray(o)?N(o):o;return[2]}})}).call(this)}},{key:"toggleInternalCorrectResponse",value:function e(e){this._internals.states.delete("show-correct-response"),e&&this.correctResponse&&this._internals.states.add("show-correct-response")}},{key:"toggleCandidateCorrection",value:function e(e){}},{key:"firstUpdated",value:function e(){p(f(t.prototype),"firstUpdated",this).call(this),!this.isFullCorrectResponse&&(this.showCorrectResponse&&this.toggleInternalCorrectResponse(!0),this.showFullCorrectResponse&&this.toggleFullCorrectResponse(!0))}}]);return t}(e);return xF([n({attribute:"correct-response",reflect:!0,converter:P({emptyAs:null})})],t.prototype,"correctResponseAttr",null),xF([n({type:Boolean,attribute:"show-correct-response",reflect:!0})],t.prototype,"showCorrectResponse",void 0),xF([O("showCorrectResponse",{waitUntilFirstUpdate:!0})],t.prototype,"_handleShowCorrectResponseChange",void 0),xF([n({type:Boolean,attribute:"show-full-correct-response",reflect:!0})],t.prototype,"showFullCorrectResponse",void 0),xF([O("showFullCorrectResponse",{waitUntilFirstUpdate:!0})],t.prototype,"_handleShowFullCorrectResponseChange",void 0),xF([n({type:Boolean,attribute:"show-candidate-correction",reflect:!0})],t.prototype,"showCandidateCorrection",void 0),xF([O("showCandidateCorrection",{waitUntilFirstUpdate:!0})],t.prototype,"_handleShowCandidateCorrectionChange",void 0),xF([r()],t.prototype,"_isFullCorrectResponse",void 0),xF([r()],t.prototype,"_correctResponse",void 0),t};var xH=ob(nX());var xQ=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},xG=function e(e){var t=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments),e._candidateCorrection=null;return e}d(t,[{key:"correctionPart",get:function e(){return this._candidateCorrection?"correction correction-".concat(this._candidateCorrection):"correction"}},{key:"toggleCandidateCorrection",value:function e(e){this.showCandidateCorrection!==e&&(this.showCandidateCorrection=e),p(f(t.prototype),"toggleCandidateCorrection",this).call(this,e);var n=this._internals;n.states.delete("candidate-correct"),n.states.delete("candidate-partially-correct"),n.states.delete("candidate-incorrect");var r=null;e&&(this.correctness===xB.Correct&&(n.states.add("candidate-correct"),r="correct"),this.correctness===xB.PartiallyCorrect&&(n.states.add("candidate-partially-correct"),r="partially-correct"),this.correctness===xB.Incorrect&&(n.states.add("candidate-incorrect"),r="incorrect")),this._candidateCorrection!==r&&(this._candidateCorrection=r)}},{key:"connectedCallback",value:function e(){var e=this;var n;(n=p(f(t.prototype),"connectedCallback",this))===null||n===void 0?void 0:n.call(this),queueMicrotask(function(){!e.isConnected||e.isFullCorrectResponse||e.showCandidateCorrection&&e.toggleCandidateCorrection(!0)})}}]);return t}(x$(e));return xQ([r()],t.prototype,"_candidateCorrection",void 0),t};var xX=function e(e){var t=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"toggleInternalCorrectResponse",value:function e(e){p(f(t.prototype),"toggleInternalCorrectResponse",this).call(this,e);var n=this.correctResponse,r=n?Array.isArray(n)?n:[n]:[];var o=true,a=false,s=undefined;try{for(var l=this._choiceElements[Symbol.iterator](),c;!(o=(c=l.next()).done);o=true){var u=c.value;u.internals.states.delete("correct-response"),u.internals.states.delete("incorrect-response"),e&&r.length>0&&u.internals.states.add(r.includes(u.identifier)?"correct-response":"incorrect-response")}}catch(e){a=true;s=e}finally{try{if(!o&&l.return!=null){l.return()}}finally{if(a){throw s}}}}},{key:"toggleCandidateCorrection",value:function e(e){p(f(t.prototype),"toggleCandidateCorrection",this).call(this,e);var n=true,r=false,o=undefined;try{for(var a=this._choiceElements[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;l.candidateCorrection=null}}catch(e){r=true;o=e}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(r){throw o}}}if(!e||!this.correctResponse)return;var c=Array.isArray(this.correctResponse)?this.correctResponse:[this.correctResponse],u=Array.isArray(this.response)?this.response:this.response?[this.response]:[];var d=true,h=false,v=undefined;try{for(var g=this._choiceElements[Symbol.iterator](),m;!(d=(m=g.next()).done);d=true){var b=m.value;u.includes(b.identifier)&&(b.candidateCorrection=c.includes(b.identifier)?"correct":"incorrect")}}catch(e){h=true;v=e}finally{try{if(!d&&g.return!=null){g.return()}}finally{if(h){throw v}}}}}]);return t}(xG(e));return t};var xK=function e(e){var t;var n=/*#__PURE__*/function(e){"use strict";v(n,e);function n(){l(this,n);var e;e=s(this,n,arguments);iU(e,t,null);return e}d(n,[{key:"candidateCorrection",get:function e(){return iL(this,t)},set:function e(e){if(iL(this,t)===e)return;var n=iL(this,t);ij(this,t,e);var r=this.internals.states;r.delete("candidate-correct"),r.delete("candidate-incorrect"),r.delete("candidate-partially-correct"),e&&r.add("candidate-".concat(e)),this.requestUpdate("candidateCorrection",n)}},{key:"correctionPart",get:function e(){return iL(this,t)?"correction correction-".concat(iL(this,t)):"correction"}}]);return n}(e);return t=new WeakMap,n};var xY=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"render",value:function e(){return o5(nK(),this.correctionPart)}}]);return t}(xK(pZ));xY.styles=[pZ.styles,xH];var xJ=xY;var xZ=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},x0=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments),e.orderCorrect=null;return e}return t}(xK(p5));xZ([n({attribute:"aria-ordercorrectvalue",type:Number,reflect:!0})],x0.prototype,"orderCorrect",void 0);var x1=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"render",value:function e(){return o5(nY(),this.correctionPart)}}]);return t}(xK(p7));x1.styles=[p7.styles,xH];var x3=x1;var x2=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"render",value:function e(){return o5(nJ(),this.correctionPart,pI(this.drags,function(e){return e.getAttribute("identifier")},function(e){return e}))}}]);return t}(xK(fv));x2.styles=[fv.styles,xH];var x5=x2;var x4=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"render",value:function e(){return o5(n0(),this.marker?o5(nZ(),this.marker):o7,this.correctionPart)}}]);return t}(xK(fw));x4.styles=[fw.styles,xH];var x6=x4;var x8=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"showCorrectResponse",value:function e(e){var t;var n=true,r=false,o=undefined;try{for(var a=this.interactionElements[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;(t=l.toggleCorrectResponse)===null||t===void 0?void 0:t.call(l,e)}}catch(e){r=true;o=e}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(r){throw o}}}this.updateControlState("item-show-correct-response",e)}},{key:"showCandidateCorrection",value:function e(e){var t;var n=true,r=false,o=undefined;try{for(var a=this.interactionElements[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var l=s.value;(t=l.toggleCandidateCorrection)===null||t===void 0?void 0:t.call(l,e)}}catch(e){r=true;o=e}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(r){throw o}}}this.updateControlState("item-show-candidate-correction",e)}},{key:"afterResponseVariableUpdated",value:function e(){this.showCandidateCorrection(!1)}},{key:"updateControlState",value:function e(e,t){var n=this.getRootNode();for(;;){if(n.querySelectorAll(e).forEach(function(e){return e.shown=t}),!g(n,ShadowRoot))return;n=n.host.getRootNode()}}}]);return t}(s4);var x7,x9,_e,_t=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t);iU(e,x7,function(t){var n,r;var o=t.detail;(r=e.assessmentItem)===null||r===void 0?void 0:(n=r.showCorrectResponse)===null||n===void 0?void 0:n.call(r,o),e.updateControlState("item-show-correct-response",o)});iU(e,x9,function(t){var n,r;var o=t.detail;(r=e.assessmentItem)===null||r===void 0?void 0:(n=r.showCandidateCorrection)===null||n===void 0?void 0:n.call(r,o),e.updateControlState("item-show-candidate-correction",o)});iU(e,_e,function(t){var n,r;(r=e.assessmentItem)===null||r===void 0?void 0:(n=r.showCorrectResponse)===null||n===void 0?void 0:n.call(r,!1),e.configContext=_(k({},e.configContext),{correctResponseMode:t.detail})});e.addEventListener("item-show-correct-response",iL(e,x7)),e.addEventListener("item-show-candidate-correction",iL(e,x9)),e.addEventListener("item-switch-correct-response-mode",iL(e,_e));return e}d(t,[{key:"updateControlState",value:function e(e,t){this.querySelectorAll(e).forEach(function(e){return e.shown=t})}},{key:"disconnectedCallback",value:function e(){this.removeEventListener("item-show-correct-response",iL(this,x7)),this.removeEventListener("item-show-candidate-correction",iL(this,x9)),this.removeEventListener("item-switch-correct-response-mode",iL(this,_e)),p(f(t.prototype),"disconnectedCallback",this).call(this)}}]);return t}(ph);x7=new WeakMap,x9=new WeakMap,_e=new WeakMap;var _n,_r,_i=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t);iU(e,_n,function(t){var n,r;(r=e.activeAssessmentItem)===null||r===void 0?void 0:(n=r.showCorrectResponse)===null||n===void 0?void 0:n.call(r,t.detail)});iU(e,_r,function(t){var n,r;(r=e.activeAssessmentItem)===null||r===void 0?void 0:(n=r.showCandidateCorrection)===null||n===void 0?void 0:n.call(r,t.detail)});e.addEventListener("test-show-correct-response",iL(e,_n)),e.addEventListener("test-show-candidate-correction",iL(e,_r));return e}d(t,[{key:"disconnectedCallback",value:function e(){this.removeEventListener("test-show-correct-response",iL(this,_n)),this.removeEventListener("test-show-candidate-correction",iL(this,_r)),p(f(t.prototype),"disconnectedCallback",this).call(this)}}]);return t}(uX);_n=new WeakMap,_r=new WeakMap;var _o=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"updateAssessmentItemView",value:function e(e,t){var n;(n=e.showCorrectResponse)===null||n===void 0?void 0:n.call(e,t==="scorer")}}]);return t}(cI),_a=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t),e.addEventListener("click",function(){e.dispatchEvent(new CustomEvent("test-show-correct-response",{detail:!0,bubbles:!0}))});return e}return t}(cL);var _s=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},_l,_c,_u=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,_l);e.label="Correct response mode",e._options={internal:"Internal",full:"Full (copy)"};return e}d(t,[{key:"render",value:function e(){var e=this;return o5(n3(),this.label,function(t){var n=t.target;iz(e,_l,_c).call(e,n.value)},Object.keys(this._options).map(function(t){var n;return o5(n1(),t,t===((n=e.itemContext)===null||n===void 0?void 0:n.correctResponseMode),e._options[t])}))}}]);return t}(av);_l=new WeakSet,_c=function e(e){this.dispatchEvent(new CustomEvent("item-switch-correct-response-mode",{detail:e,bubbles:!0}))};_s([m({context:aj,subscribe:!0})],_u.prototype,"itemContext",void 0);_s([n({type:String})],_u.prototype,"label",void 0);_s([r()],_u.prototype,"_options",void 0);var _d=ob(n2()),_h=ob(n5(),_d),_p=ob(n4()),_f=ob(n6(),_d);var _v=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},_g,_m,_b,_y,_w,_q=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t);iU(e,_b);iU(e,_g);iU(e,_m);e.shown=!1,e.disabled=!1,e.showCandidateCorrectionText="Show candidate correction",e.hideCandidateCorrectionText="Hide candidate correction",e.noCorrectResponseText="No correct response specified",ij(e,_g,!1),ij(e,_m,"");return e}d(t,[{key:"updated",value:function e(){var e;if(!iL(this,_g)||iL(this,_m)!==((e=this.computedContext)===null||e===void 0?void 0:e.identifier)){var t,n,r;ij(this,_m,(t=this.computedContext)===null||t===void 0?void 0:t.identifier);var o=!!((n=this.computedContext)===null||n===void 0?void 0:n.variables.some(function(e){return e.correctResponse})),a=!!((r=this.computedContext)===null||r===void 0?void 0:r.variables.some(function(e){var t,n,r,o;return((n=e.mapping)===null||n===void 0?void 0:(t=n.mapEntries)===null||t===void 0?void 0:t.length)>0||((o=e.areaMapping)===null||o===void 0?void 0:(r=o.areaMapEntries)===null||r===void 0?void 0:r.length)>0}));ij(this,_g,o||a)}this.disabled=!iL(this,_g)}},{key:"render",value:function e(){return o5(n8(),iz(this,_b,_y),iz(this,_b,_w).call(this))}}]);return t}(av);_g=new WeakMap,_m=new WeakMap,_b=new WeakSet,_y=function e(){this.disabled||this.dispatchEvent(new CustomEvent("item-show-candidate-correction",{detail:!this.shown,bubbles:!0}))},_w=function e(){return this.disabled?this.noCorrectResponseText:this.shown?this.hideCandidateCorrectionText:this.showCandidateCorrectionText},_q.styles=ob(n7(),_h,_p);var _k=_q;_v([m({context:aL,subscribe:!0})],_k.prototype,"computedContext",void 0);_v([n({type:Boolean,reflect:!0})],_k.prototype,"shown",void 0);_v([n({type:Boolean,reflect:!0})],_k.prototype,"disabled",void 0);_v([n({type:String})],_k.prototype,"showCandidateCorrectionText",void 0);_v([n({type:String})],_k.prototype,"hideCandidateCorrectionText",void 0);_v([n({type:String})],_k.prototype,"noCorrectResponseText",void 0);var _x=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},__,_E,_C,_S,_R,_A=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,_C);iU(e,__);iU(e,_E);e.shown=!1,e.disabled=!1,e.showCorrectText="Show correct response",e.hideCorrectText="Hide correct response",e.noCorrectResponseText="No correct response specified",ij(e,__,!1),ij(e,_E,"");return e}d(t,[{key:"updated",value:function e(){var e;if(!iL(this,__)||iL(this,_E)!==((e=this.computedContext)===null||e===void 0?void 0:e.identifier)){var t,n,r;ij(this,_E,(t=this.computedContext)===null||t===void 0?void 0:t.identifier);var o=!!((n=this.computedContext)===null||n===void 0?void 0:n.variables.some(function(e){return e.correctResponse})),a=!!((r=this.computedContext)===null||r===void 0?void 0:r.variables.some(function(e){var t,n,r,o;return((n=e.mapping)===null||n===void 0?void 0:(t=n.mapEntries)===null||t===void 0?void 0:t.length)>0||((o=e.areaMapping)===null||o===void 0?void 0:(r=o.areaMapEntries)===null||r===void 0?void 0:r.length)>0}));ij(this,__,o||a)}this.disabled=!iL(this,__)}},{key:"render",value:function e(){return o5(n9(),iz(this,_C,_S),iz(this,_C,_R).call(this))}}]);return t}(av);__=new WeakMap,_E=new WeakMap,_C=new WeakSet,_S=function e(){this.disabled||this.dispatchEvent(new CustomEvent("item-show-correct-response",{detail:!this.shown,bubbles:!0}))},_R=function e(){return this.disabled?this.noCorrectResponseText:this.shown?this.hideCorrectText:this.showCorrectText},_A.styles=ob(re(),_h,_p);var _T=_A;_x([m({context:aL,subscribe:!0})],_T.prototype,"computedContext",void 0);_x([n({type:Boolean,reflect:!0})],_T.prototype,"shown",void 0);_x([n({type:Boolean,reflect:!0})],_T.prototype,"disabled",void 0);_x([n({type:String})],_T.prototype,"showCorrectText",void 0);_x([n({type:String})],_T.prototype,"hideCorrectText",void 0);_x([n({type:String})],_T.prototype,"noCorrectResponseText",void 0);var _I=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},_P,_O,_M,_N,_D=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,_O);iU(e,_P);e.shown=!1,e.disabled=!1,e.showCorrectText="Show correct response",e.hideCorrectText="Hide correct response",e.noCorrectResponseText="No correct response specified";return e}d(t,[{key:"willUpdate",value:function e(e){var t;var n=(t=this.computedContext)===null||t===void 0?void 0:t.testParts.flatMap(function(e){return e.sections.flatMap(function(e){return e.items})}).find(function(e){return e.active});if(iL(this,_P)!==n&&(this.shown=!1,ij(this,_P,n)),n){var r,o;var a=!!(n===null||n===void 0?void 0:(r=n.variables)===null||r===void 0?void 0:r.some(function(e){return e.correctResponse})),s=!!(n===null||n===void 0?void 0:(o=n.variables)===null||o===void 0?void 0:o.some(function(e){var t,n,r,o;return((n=e.mapping)===null||n===void 0?void 0:(t=n.mapEntries)===null||t===void 0?void 0:t.length)>0||((o=e.areaMapping)===null||o===void 0?void 0:(r=o.areaMapEntries)===null||r===void 0?void 0:r.length)>0}));this.disabled=!a&&!s}else this.disabled=!0}},{key:"render",value:function e(){return o5(rt(),iz(this,_O,_M),iz(this,_O,_N).call(this))}}]);return t}(av);_P=new WeakMap,_O=new WeakSet,_M=function e(){this.disabled||(this.shown=!this.shown,this.dispatchEvent(new CustomEvent("test-show-correct-response",{detail:this.shown,bubbles:!0})))},_N=function e(){return this.disabled?this.noCorrectResponseText:this.shown?this.hideCorrectText:this.showCorrectText},_D.styles=ob(rn(),_h,_p);var _L=_D;_I([m({context:aU,subscribe:!0})],_L.prototype,"computedContext",void 0);_I([n({type:Boolean,reflect:!0})],_L.prototype,"shown",void 0);_I([n({type:Boolean,reflect:!0})],_L.prototype,"disabled",void 0);_I([n({type:String})],_L.prototype,"showCorrectText",void 0);_I([n({type:String})],_L.prototype,"hideCorrectText",void 0);_I([n({type:String})],_L.prototype,"noCorrectResponseText",void 0);var _U=function e(e){var t=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"toggleInternalCorrectResponse",value:function e(e){this.showFullCorrectResponse||this.toggleFullCorrectResponse(e)}},{key:"afterCache",value:function e(){p(f(t.prototype),"afterCache",this).call(this),this.showCorrectResponse&&this.toggleInternalCorrectResponse(!0),this.showCandidateCorrection&&this.toggleCandidateCorrection(!0),this.showFullCorrectResponse&&this.toggleFullCorrectResponse(!0)}}]);return t}(xG(e));return t};var _j=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}return t}(_U(ve));var _z=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}return t}(xX(vd));var _V=function e(e,t,n,r){var o=arguments.length,a=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if((typeof Reflect==="undefined"?"undefined":D(Reflect))=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(o<3?s(a):o>3?s(t,n,a):s(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},_W=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"render",value:function e(){return o5(rr(),this.renderPrompt(),this.renderTextarea(),this.correctionPart,this.renderValidationMessage())}}]);return t}(xK(vQ));_W.styles=[vQ.styles,xH,ob(ri())];var _F=_W;_V([n({attribute:"candidate-correction",reflect:!0,noAccessor:!0})],_F.prototype,"candidateCorrection",void 0);var _B=function e(e){return e?(Array.isArray(e)?e:[e]).map(function(e){var t=I(e.split(" "),2),n=t[0],r=t[1];return{source:n,target:r}}):[]};var _$=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"toggleCandidateCorrection",value:function e(e){p(f(t.prototype),"toggleCandidateCorrection",this).call(this,e);var n=_B(this.correctResponse);var r=true,o=false,a=undefined;try{var s=function(){var t=c.value;var r=t.getAttribute("identifier"),o=t.drags;var a=true,s=false,l=undefined;try{var u=function(){var t=h.value;t.candidateCorrection=null,e&&n.some(function(e){return e.source===t.identifier&&e.target===r})?t.candidateCorrection="correct":e&&(t.candidateCorrection="incorrect")};for(var d=o[Symbol.iterator](),h;!(a=(h=d.next()).done);a=true)u()}catch(e){s=true;l=e}finally{try{if(!a&&d.return!=null){d.return()}}finally{if(s){throw l}}}};for(var l=this.querySelectorAll("qti-gap")[Symbol.iterator](),c;!(r=(c=l.next()).done);r=true)s()}catch(e){o=true;a=e}finally{try{if(!r&&l.return!=null){l.return()}}finally{if(o){throw a}}}}}]);return t}(_U(vY));var _H,_Q=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,_H,[]);return e}d(t,[{key:"toggleInternalCorrectResponse",value:function e(e){p(f(t.prototype),"toggleInternalCorrectResponse",this).call(this,e);var n=this.correctResponse,r=iL(this,_H);ij(this,_H,e&&n?Array.isArray(n)?N(n):[n]:[]),this.requestUpdate("correctLines",r)}},{key:"renderSupplementalLines",value:function e(){var e=this;return pI(iL(this,_H),function(e){return e},function(t){return o4(ro(),parseInt(e.querySelector("[identifier=".concat(t.split(" ")[0],"]")).style.left),parseInt(e.querySelector("[identifier=".concat(t.split(" ")[0],"]")).style.top),parseInt(e.querySelector("[identifier=".concat(t.split(" ")[1],"]")).style.left),parseInt(e.querySelector("[identifier=".concat(t.split(" ")[1],"]")).style.top))})}}]);return t}(xG(v9));_H=new WeakMap;var _G=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}return t}(_U(ga));var _X=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"resolvePinColor",value:function e(e){var n=e;return n.matches(":state(candidate-incorrect)")?"var(--qti-incorrect)":n.matches(":state(candidate-correct)")?"var(--qti-correct)":n.matches(":state(correct-response)")?"var(--qti-answer-border)":p(f(t.prototype),"resolvePinColor",this).call(this,e)}},{key:"toggleInternalCorrectResponse",value:function e(e){p(f(t.prototype),"toggleInternalCorrectResponse",this).call(this,e);var n=this.correctResponse,r=n?Array.isArray(n)?n:[n]:[];var o=true,a=false,s=undefined;try{for(var l=this._choiceElements[Symbol.iterator](),c;!(o=(c=l.next()).done);o=true){var u=c.value;var d=r.indexOf(u.identifier);u.orderCorrect=e&&d>=0?d+1:null}}catch(e){a=true;s=e}finally{try{if(!o&&l.return!=null){l.return()}}finally{if(a){throw s}}}this.refreshLocatorPins()}},{key:"toggleCandidateCorrection",value:function e(e){p(f(t.prototype),"toggleCandidateCorrection",this).call(this,e);var n=this.correctResponse,r=n?Array.isArray(n)?n:[n]:[];var o=true,a=false,s=undefined;try{for(var l=this._choiceElements[Symbol.iterator](),c;!(o=(c=l.next()).done);o=true){var u=c.value;u.candidateCorrection=null,e&&u.order!=null&&(u.candidateCorrection=r[u.order-1]===u.identifier?"correct":"incorrect")}}catch(e){a=true;s=e}finally{try{if(!o&&l.return!=null){l.return()}}finally{if(a){throw s}}}this.refreshLocatorPins()}}]);return t}(xG(gv));var _K=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}return t}(xX(gx));var _Y=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}return t}(xX(gS));var _J=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"toggleInternalCorrectResponse",value:function e(e){this.showFullCorrectResponse||this.toggleFullCorrectResponse(e)}},{key:"withholdsFullCorrectResponseWhenCorrect",get:function e(){return!1}},{key:"render",value:function e(){return o5(rs(),this.renderTrigger(),this.renderMenu(),this.renderValidationMessage(),this.correctionPart)}}],[{key:"styles",get:function e(){return[g0.styles,xH,ob(ra())]}}]);return t}(xG(g0));var _Z,_0=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,_Z,new Set);return e}d(t,[{key:"toggleCandidateCorrection",value:function e(e){p(f(t.prototype),"toggleCandidateCorrection",this).call(this,e);var n=_B(this.correctResponse);ij(this,_Z,e?new Set(n.map(function(e){return"".concat(e.source," ").concat(e.target)})):new Set);var r=true,o=false,a=undefined;try{for(var s=this.targetChoices[Symbol.iterator](),l;!(r=(l=s.next()).done);r=true){var c=l.value;var u=c.getAttribute("identifier"),d=c.drags;var h=true,v=false,g=undefined;try{for(var m=d[Symbol.iterator](),b;!(h=(b=m.next()).done);h=true){var y=b.value;y.candidateCorrection=null,e&&(y.candidateCorrection=iL(this,_Z).has("".concat(y.identifier," ").concat(u))?"correct":"incorrect")}}catch(e){v=true;g=e}finally{try{if(!h&&m.return!=null){m.return()}}finally{if(v){throw g}}}}}catch(e){o=true;a=e}finally{try{if(!r&&s.return!=null){s.return()}}finally{if(o){throw a}}}this.requestUpdate()}},{key:"getCellStateVariant",value:function e(e,t){return!this.showCandidateCorrection||!t?"":iL(this,_Z).has(e)?"correct":"incorrect"}}]);return t}(_U(g6));_Z=new WeakMap;var _1=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"toggleCandidateCorrection",value:function e(e){var n=this;p(f(t.prototype),"toggleCandidateCorrection",this).call(this,e);var r=Array.from(this.shadowRoot.querySelectorAll("[part~='drop']")).flatMap(function(e){return n.chipsIn(e)});var o=true,a=false,s=undefined;try{for(var l=r[Symbol.iterator](),c;!(o=(c=l.next()).done);o=true){var u=c.value;u.candidateCorrection=null}}catch(e){a=true;s=e}finally{try{if(!o&&l.return!=null){l.return()}}finally{if(a){throw s}}}if(!e)return;var d=this.correctResponse,h=(d?Array.isArray(d)?d:[d]:[]).map(function(e,t){var n=I(e.split(" "),2),r=n[0],o=n[1],a=(o===null||o===void 0?void 0:o.startsWith("droplist"))?parseInt(o.slice(8),10):t;return{identifier:r,dropIndex:Number.isNaN(a)?t:a}}).filter(function(e){return e.identifier}).sort(function(e,t){return e.dropIndex-t.dropIndex}).map(function(e){return e.identifier});if(h.length===0)return;var v=r.map(function(e){return{choice:e,identifier:e.getAttribute("identifier")}}).filter(function(e){return!!e.identifier}),g=ig(v.map(function(e){return e.identifier}),h);var m=true,b=false,y=undefined;try{for(var w=v[Symbol.iterator](),q;!(m=(q=w.next()).done);m=true){var k=q.value,x=k.choice,_=k.identifier;x.candidateCorrection=g.has(_)?"correct":"incorrect"}}catch(e){b=true;y=e}finally{try{if(!m&&w.return!=null){w.return()}}finally{if(b){throw y}}}}}]);return t}(_U(ms));var _3=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"toggleInternalCorrectResponse",value:function e(e){var n,r,o;var a;p(f(t.prototype),"toggleInternalCorrectResponse",this).call(this,e);var s=this.responseVariable,l=(n=s===null||s===void 0?void 0:s.correctResponse)!==null&&n!==void 0?n:this.correctResponse;this.correctResponse=e?l:(s===null||s===void 0?void 0:s.cardinality)==="single"?"":[];var c="correct-response-container-".concat(this.responseIdentifier);if((a=this.parentElement)===null||a===void 0?void 0:a.querySelectorAll("#".concat(c)).forEach(function(e){return e.remove()}),!e){this.enable();return}if(this.disable(),!this.correctResponse)return;var u=document.createElement("div");u.id=c,u.className="pci-correct-response-container",Object.assign(u.style,{position:"relative",marginTop:"20px",border:"2px solid green",padding:"16px",borderRadius:"4px",backgroundColor:"rgba(0, 128, 0, 0.05)"});var d=document.createElement("div");d.textContent="Correct Response:",Object.assign(d.style,{fontWeight:"bold",marginBottom:"10px",color:"green"}),u.append(d);var v=this.cloneNode(!1);v.removeAttribute("id"),v.removeAttribute("show-correct-response"),v.removeAttribute("show-full-correct-response"),v.removeAttribute("show-candidate-correction"),v.isFullCorrectResponse=!0;var g=this.responseIdentifier;v.responseIdentifier="".concat(g,"-correct");var m=true,b=false,y=undefined;try{for(var w=Array.from(this.children)[Symbol.iterator](),q;!(m=(q=w.next()).done);m=true){var k=q.value;k.tagName.startsWith("QTI-")&&v.append(k.cloneNode(!0))}}catch(e){b=true;y=e}finally{try{if(!m&&w.return!=null){w.return()}}finally{if(b){throw y}}}var x=this.correctResponse,_=(r=s===null||s===void 0?void 0:s.cardinality)!==null&&r!==void 0?r:Array.isArray(x)?"multiple":"single",E=(o=s===null||s===void 0?void 0:s.baseType)!==null&&o!==void 0?o:"string";v.status="solution",v.responseDeclaration={baseType:E,cardinality:_,correctResponse:{value:x}},v.addEventListener("qti-portable-custom-interaction-loaded",function(){var e=v.responseVariablesToQtiVariableJSON(x,_,E);v.sendMessageToIframe("setBoundTo",h({},g,e)),v.sendMessageToIframe("setState",{state:"review"})},{once:!0}),v.style.pointerEvents="none",u.append(v),this.after(u)}}]);return t}(xG(mU));var _2,_5,_4=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,_2,[]);iU(e,_5,[]);return e}d(t,[{key:"toggleCandidateCorrection",value:function e(e){var n;p(f(t.prototype),"toggleCandidateCorrection",this).call(this,e);var r=iL(this,_5);if(ij(this,_5,[]),!e){this.requestUpdate("responseCorrection",r);return}var o=this._effectiveAreaEntries,a=(n=this.responseVariable)===null||n===void 0?void 0:n.baseType,s=this.correctResponse;var l=true,c=false,u=undefined;try{var d,h=function(){var e=g.value;var t=o.some(function(t){return sa.isPointInArea("".concat(e.x," ").concat(e.y),"".concat(t.shape,",").concat(t.coords),a)});!o.length&&s&&(t=(Array.isArray(s)?s:[s]).some(function(t){var n=I(t.split(" ").map(Number),2),r=n[0],o=n[1];return Number.isFinite(r)&&Number.isFinite(o)&&Math.hypot(e.x-r,e.y-o)<=10})),iL(d,_5).push(t)};for(var v=this.responsePoints[Symbol.iterator](),g;!(l=(g=v.next()).done);l=true)d=this,h()}catch(e){c=true;u=e}finally{try{if(!l&&v.return!=null){v.return()}}finally{if(c){throw u}}}this.requestUpdate("responseCorrection",r)}},{key:"toggleInternalCorrectResponse",value:function e(e){if(p(f(t.prototype),"toggleInternalCorrectResponse",this).call(this,e),!e){var n=iL(this,_2);ij(this,_2,[]),this.requestUpdate("correctAreas",n);return}var r=this._effectiveAreaEntries;if(!r.length){var o=this.correctResponse,a=o?Array.isArray(o)?o:[o]:[];if(a.some(function(e){return e.split(" ").length<2})){console.error("No valid correct responses found.");return}r=a.map(function(e){return{shape:"circle",coords:"".concat(e.split(" ").join(","),",10"),defaultValue:1,mappedValue:1}})}var s=iL(this,_2);ij(this,_2,r.map(function(e){return{shape:e.shape,coords:e.coords}})),this.requestUpdate("correctAreas",s)}},{key:"pointPart",value:function e(e,t){var n=iL(this,_5)[t];return n===void 0?"point":"point ".concat(n?"correct":"incorrect")}},{key:"renderSupplementalLayer",value:function e(){return pI(iL(this,_2),function(e){return"".concat(e.shape,":").concat(e.coords)},function(e,t){return o5(rl(),mY({position:"absolute",pointerEvents:"none",backgroundColor:"var(--qti-correct)",opacity:"0.5"}),e.coords,e.shape,"correct-response-".concat(t+1))})}},{key:"updated",value:function e(e){p(f(t.prototype),"updated",this).call(this,e),e.has("correctAreas")&&this.positionOverlayElements(this.shadowRoot.querySelectorAll("[data-correction-area]"))}}]);return t}(xG(bt));_2=new WeakMap,_5=new WeakMap,_4.styles=[bt.styles,ob(rc())];var _6=_4;var _8,_7=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);var e;e=s(this,t,arguments);iU(e,_8,null);return e}d(t,[{key:"toggleInternalCorrectResponse",value:function e(e){p(f(t.prototype),"toggleInternalCorrectResponse",this).call(this,e);var n=this.correctResponse,r=Array.isArray(n)?n[0]:n,o=e&&r?parseFloat(r):NaN,a=iL(this,_8);if(ij(this,_8,Number.isFinite(o)?o:null),iL(this,_8)!==null){var s=(iL(this,_8)-this.min)/(this.max-this.min)*100;this.style.setProperty("--value-percentage-correct","".concat(s,"%"))}else this.style.removeProperty("--value-percentage-correct");this.requestUpdate("correctResponseNumber",a)}},{key:"renderRailSupplement",value:function e(){return iL(this,_8)===null?o7:o5(ru(),iL(this,_8))}}]);return t}(xG(bf));_8=new WeakMap,_7.styles=[bf.styles,ob(rd())];var _9=_7;var Ee=/*#__PURE__*/function(e){"use strict";v(t,e);function t(){l(this,t);return s(this,t,arguments)}d(t,[{key:"correctness",get:function e(){var e=this.responseVariable;if(!e)return p(f(t.prototype),"correctness",this);if(e.value===null)return xB.Incorrect;if(e.mapping){var n=e.mapping.mapEntries.reduce(function(e,t){return Math.max(t.mappedValue,e)},0);var r=true,o=false,a=undefined;try{for(var s=e.mapping.mapEntries[Symbol.iterator](),l;!(r=(l=s.next()).done);r=true){var c=l.value;var u=c.mapKey,d=e.value;if(c.caseSensitive||(u=u.toLowerCase(),d=d.toLowerCase()),u===d)return c.mappedValue===n?xB.Correct:c.mappedValue<=(e.mapping.defaultValue||0)?xB.Incorrect:xB.PartiallyCorrect}}catch(e){o=true;a=e}finally{try{if(!r&&s.return!=null){s.return()}}finally{if(o){throw a}}}}return e.correctResponse===e.value?xB.Correct:xB.Incorrect}},{key:"toggleInternalCorrectResponse",value:function e(e){this.showFullCorrectResponse||this.toggleFullCorrectResponse(e)}},{key:"render",value:function e(){return o5(rh(),this.renderAnswer(),this.renderInput(),this.correctionPart,this.renderValidationMessage())}}]);return t}(xG(bx));Ee.styles=[bx.styles,xH,ob(rp())];var Et=Ee;return iN(iW)}();