@citolab/qti-components 7.3.20 → 7.3.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cdn/chunks/chunk-2BSPQRNR.js +6 -0
- package/cdn/chunks/chunk-2IJBTWWT.js +2 -0
- package/cdn/chunks/chunk-3BPUHYAN.js +1 -0
- package/cdn/chunks/chunk-3CVBBZDT.js +17 -0
- package/cdn/chunks/chunk-3IBGLVHA.js +1 -0
- package/cdn/chunks/chunk-4AGE7DVK.js +48 -0
- package/cdn/chunks/chunk-4DXCBZFR.js +3698 -0
- package/cdn/chunks/chunk-4FBS7ODL.js +6 -0
- package/cdn/chunks/chunk-4IWCVQQJ.js +8 -0
- package/cdn/chunks/chunk-522JFYKC.js +6 -0
- package/cdn/chunks/chunk-5L5JXKEA.js +1 -0
- package/cdn/chunks/chunk-5TEGKCEI.js +48 -0
- package/cdn/chunks/chunk-5WLHU3FH.js +8 -0
- package/cdn/chunks/chunk-6ELXCFB2.js +1 -0
- package/cdn/chunks/chunk-6Q3S6QYF.js +1471 -0
- package/cdn/chunks/chunk-6SGFGN34.js +8 -0
- package/cdn/chunks/chunk-6XVY32RS.js +1 -0
- package/cdn/chunks/chunk-6ZE2IMSJ.js +1471 -0
- package/cdn/chunks/chunk-73RDXCTO.js +1 -0
- package/cdn/chunks/chunk-73YTM4JU.js +8 -0
- package/cdn/chunks/chunk-A57EJSRU.js +1 -0
- package/cdn/chunks/chunk-AAZIKH5Z.js +3650 -0
- package/cdn/chunks/chunk-AMJIIPBQ.js +48 -0
- package/cdn/chunks/chunk-BGFVQO5N.js +8 -0
- package/cdn/chunks/chunk-BRXZ5HLX.js +8 -0
- package/cdn/chunks/chunk-BSBPPIVO.js +5 -0
- package/cdn/chunks/chunk-BURSTFDF.js +2 -0
- package/cdn/chunks/chunk-C7AO3IVZ.js +48 -0
- package/cdn/chunks/chunk-CTNAGYH7.js +1 -0
- package/cdn/chunks/chunk-DESMFZJW.js +5 -0
- package/cdn/chunks/chunk-DNBBQ7LY.js +1 -0
- package/cdn/chunks/chunk-DP5FVJRS.js +21 -0
- package/cdn/chunks/chunk-E46BCOOW.js +1 -0
- package/cdn/chunks/chunk-EGFC4XQG.js +5 -0
- package/cdn/chunks/chunk-EQ4LUVQK.js +8 -0
- package/cdn/chunks/chunk-EXVHRHST.js +8 -0
- package/cdn/chunks/chunk-FC7HXYUV.js +8 -0
- package/cdn/chunks/chunk-FEJUVLN4.js +6 -0
- package/cdn/chunks/chunk-FLQBFTRW.js +37 -0
- package/cdn/chunks/chunk-FUGKKQ6E.js +1 -0
- package/cdn/chunks/chunk-FWFPMNDO.js +5 -0
- package/cdn/chunks/chunk-FYXNIYGH.js +1 -0
- package/cdn/chunks/chunk-GFO3YUEH.js +1 -0
- package/cdn/chunks/chunk-HAE5ZHID.js +1 -0
- package/cdn/chunks/chunk-HCXHHI6V.js +18 -0
- package/cdn/chunks/chunk-HDMF4QZO.js +48 -0
- package/cdn/chunks/chunk-HKUIQBCM.js +1 -0
- package/cdn/chunks/chunk-HKWYQB5Z.js +37 -0
- package/cdn/chunks/chunk-HO6JOQX4.js +25 -0
- package/cdn/chunks/chunk-HTH5YCZO.js +8 -0
- package/cdn/chunks/chunk-IHVTWACH.js +8 -0
- package/cdn/chunks/chunk-ILEDSBLL.js +8 -0
- package/cdn/chunks/chunk-IYZLVTNL.js +5 -0
- package/cdn/chunks/chunk-J5P2GBPV.js +1 -0
- package/cdn/chunks/chunk-KASON6Y7.js +17 -0
- package/cdn/chunks/chunk-KKQK6WIG.js +1 -0
- package/cdn/chunks/chunk-LBMZYOKF.js +8 -0
- package/cdn/chunks/chunk-LC7KE332.js +1 -0
- package/cdn/chunks/chunk-LIUOA3YV.js +1 -0
- package/cdn/chunks/chunk-LO4MJ72X.js +8 -0
- package/cdn/chunks/chunk-LRGALTZX.js +1 -0
- package/cdn/chunks/chunk-LRIOWAOJ.js +8 -0
- package/cdn/chunks/chunk-LVKOQVTZ.js +17 -0
- package/cdn/chunks/chunk-M4VO4BD3.js +1471 -0
- package/cdn/chunks/chunk-M53CKFQE.js +5 -0
- package/cdn/chunks/chunk-MD33BNWM.js +1 -0
- package/cdn/chunks/chunk-MLEUGPRW.js +8 -0
- package/cdn/chunks/chunk-MM76ZODZ.js +8 -0
- package/cdn/chunks/chunk-MQVMYZ75.js +1 -0
- package/cdn/chunks/chunk-MRQ46JRY.js +8 -0
- package/cdn/chunks/chunk-MSOBQUON.js +10 -0
- package/cdn/chunks/chunk-NDMZ2RAB.js +48 -0
- package/cdn/chunks/chunk-NJP4VZB3.js +8 -0
- package/cdn/chunks/chunk-NO3TZB6T.js +5 -0
- package/cdn/chunks/chunk-NRY6IJSD.js +5 -0
- package/cdn/chunks/chunk-O4RAJ3LM.js +25 -0
- package/cdn/chunks/chunk-OEZI5WCY.js +18 -0
- package/cdn/chunks/chunk-OR67S36X.js +5 -0
- package/cdn/chunks/chunk-OSLUHYFD.js +8 -0
- package/cdn/chunks/chunk-P6L4B5GC.js +1 -0
- package/cdn/chunks/chunk-PF74FX32.js +1 -0
- package/cdn/chunks/chunk-PFCJVHJ3.js +10 -0
- package/cdn/chunks/chunk-PP62N3C4.js +8 -0
- package/cdn/chunks/chunk-PQLJWD6V.js +21 -0
- package/cdn/chunks/chunk-PTQFS3S5.js +2 -0
- package/cdn/chunks/chunk-PU7OABT3.js +1 -0
- package/cdn/chunks/chunk-Q2CKZUYX.js +1 -0
- package/cdn/chunks/chunk-QEFO63QX.js +8 -0
- package/cdn/chunks/chunk-QIZBL4QP.js +1 -0
- package/cdn/chunks/chunk-RGNFAPWY.js +2 -0
- package/cdn/chunks/chunk-RHEBGA4B.js +1 -0
- package/cdn/chunks/chunk-S5QDLZ6J.js +1 -0
- package/cdn/chunks/chunk-SBWSYKE5.js +5 -0
- package/cdn/chunks/chunk-SXRIA7VB.js +8 -0
- package/cdn/chunks/chunk-SYTQX5DA.js +1 -0
- package/cdn/chunks/chunk-TLK5RNXE.js +1 -0
- package/cdn/chunks/chunk-TR7WXOQR.js +1 -0
- package/cdn/chunks/chunk-UMDZKG6K.js +1 -0
- package/cdn/chunks/chunk-UNK5GKOK.js +5 -0
- package/cdn/chunks/chunk-V2AJKKRF.js +1470 -0
- package/cdn/chunks/chunk-VEG7LKS3.js +48 -0
- package/cdn/chunks/chunk-VQ2JX2OE.js +5 -0
- package/cdn/chunks/chunk-W73FT5JE.js +48 -0
- package/cdn/chunks/chunk-W7O6UFTQ.js +5 -0
- package/cdn/chunks/chunk-WCCTDLQ4.js +8 -0
- package/cdn/chunks/chunk-WV5B4HNF.js +1471 -0
- package/cdn/chunks/chunk-WWMMW7RJ.js +1 -0
- package/cdn/chunks/chunk-X3JAXGAZ.js +8 -0
- package/cdn/chunks/chunk-XJWUPDZ4.js +10 -0
- package/cdn/chunks/chunk-XMKJLLUL.js +1 -0
- package/cdn/chunks/chunk-XMS6AFBV.js +5 -0
- package/cdn/chunks/chunk-XSVPZFGN.js +1 -0
- package/cdn/chunks/chunk-Y2P4IF3E.js +1 -0
- package/cdn/chunks/chunk-YCBNF5QU.js +17 -0
- package/cdn/chunks/chunk-YEGYR7SL.js +5 -0
- package/cdn/chunks/chunk-YHLQ2JQ2.js +1 -0
- package/cdn/chunks/chunk-ZO5G6CHW.js +1470 -0
- package/cdn/chunks/chunk-ZPCQH3EY.js +10 -0
- package/cdn/chunks/chunk-ZUQ72RIQ.js +8 -0
- package/cdn/chunks/chunk-ZZNCHSYH.js +5 -0
- package/cdn/exports/computed-item.context.js +1 -1
- package/cdn/exports/computed.context.js +1 -1
- package/cdn/exports/config.context.js +1 -1
- package/cdn/exports/interaction.js +1 -1
- package/cdn/exports/qti-assessment-item.context.js +1 -1
- package/cdn/exports/qti-condition-expression.js +1 -1
- package/cdn/exports/qti-expression.js +1 -1
- package/cdn/exports/qti.context.js +1 -1
- package/cdn/exports/session.context.js +1 -1
- package/cdn/exports/test.context.js +1 -1
- package/cdn/index.global.js +1 -1
- package/cdn/index.js +1 -1
- package/cdn/qti-components/index.js +1 -1
- package/cdn/qti-item/components/item-container.js +1 -1
- package/cdn/qti-item/components/item-correct-response-mode.js +1 -1
- package/cdn/qti-item/components/item-show-candidate-correction.js +1 -1
- package/cdn/qti-item/components/item-show-correct-response.js +1 -1
- package/cdn/qti-item/components/print-item-variables.js +1 -1
- package/cdn/qti-item/components/styles.js +1 -1
- package/cdn/qti-item/core/index.js +1 -1
- package/cdn/qti-test/components/index.js +1 -1
- package/cdn/qti-test/components/styles.js +1 -1
- package/cdn/qti-test/components/test-check-item.js +1 -1
- package/cdn/qti-test/components/test-container.js +1 -1
- package/cdn/qti-test/components/test-end-attempt.js +1 -1
- package/cdn/qti-test/components/test-item-link.js +1 -1
- package/cdn/qti-test/components/test-navigation.js +1 -1
- package/cdn/qti-test/components/test-next.js +1 -1
- package/cdn/qti-test/components/test-paging-buttons-stamp.js +1 -1
- package/cdn/qti-test/components/test-prev.js +1 -1
- package/cdn/qti-test/components/test-print-context.js +1 -1
- package/cdn/qti-test/components/test-print-item-variables.js +1 -1
- package/cdn/qti-test/components/test-scoring-buttons.js +1 -1
- package/cdn/qti-test/components/test-scoring-feedback.js +1 -1
- package/cdn/qti-test/components/test-section-buttons-stamp.js +1 -1
- package/cdn/qti-test/components/test-section-link.js +1 -1
- package/cdn/qti-test/components/test-show-correct-response.js +1 -1
- package/cdn/qti-test/components/test-stamp.js +1 -1
- package/cdn/qti-test/components/test-view-toggle.js +1 -1
- package/cdn/qti-test/components/test-view.js +1 -1
- package/cdn/qti-test/core/index.js +1 -1
- package/dist/chunks/chunk-3JJM4BKK.js +367 -0
- package/dist/chunks/chunk-3JJM4BKK.js.map +1 -0
- package/dist/chunks/chunk-3LX4O663.js +3688 -0
- package/dist/chunks/chunk-3LX4O663.js.map +1 -0
- package/dist/chunks/chunk-4PG2PZHY.js +8924 -0
- package/dist/chunks/chunk-4PG2PZHY.js.map +1 -0
- package/dist/chunks/chunk-55C6NAK5.js +142 -0
- package/dist/chunks/chunk-55C6NAK5.js.map +1 -0
- package/dist/chunks/chunk-5P64MALP.js +3640 -0
- package/dist/chunks/chunk-5P64MALP.js.map +1 -0
- package/dist/chunks/chunk-65YQSKWV.js +94 -0
- package/dist/chunks/chunk-65YQSKWV.js.map +1 -0
- package/dist/chunks/chunk-ARBFS6D6.js +8924 -0
- package/dist/chunks/chunk-ARBFS6D6.js.map +1 -0
- package/dist/chunks/chunk-EB3ZESWL.js +367 -0
- package/dist/chunks/chunk-EB3ZESWL.js.map +1 -0
- package/dist/chunks/chunk-ERYHQVOT.js +8 -0
- package/dist/chunks/chunk-ERYHQVOT.js.map +1 -0
- package/dist/chunks/chunk-FL72PF4D.js +19 -0
- package/dist/chunks/chunk-FL72PF4D.js.map +1 -0
- package/dist/chunks/chunk-HFAUM56X.js +208 -0
- package/dist/chunks/chunk-HFAUM56X.js.map +1 -0
- package/dist/chunks/chunk-JOASLKRQ.js +914 -0
- package/dist/chunks/chunk-JOASLKRQ.js.map +1 -0
- package/dist/chunks/chunk-K4QJBUIX.js +367 -0
- package/dist/chunks/chunk-K4QJBUIX.js.map +1 -0
- package/dist/chunks/chunk-KYN4AAHS.js +8839 -0
- package/dist/chunks/chunk-KYN4AAHS.js.map +1 -0
- package/dist/chunks/chunk-MLRMRXGZ.js +367 -0
- package/dist/chunks/chunk-MLRMRXGZ.js.map +1 -0
- package/dist/chunks/chunk-MOIHNOX3.js +94 -0
- package/dist/chunks/chunk-MOIHNOX3.js.map +1 -0
- package/dist/chunks/chunk-P2PRB5IZ.js +94 -0
- package/dist/chunks/chunk-P2PRB5IZ.js.map +1 -0
- package/dist/chunks/chunk-PF5X3SZR.js +94 -0
- package/dist/chunks/chunk-PF5X3SZR.js.map +1 -0
- package/dist/chunks/chunk-QCB6P7DH.js +146 -0
- package/dist/chunks/chunk-QCB6P7DH.js.map +1 -0
- package/dist/chunks/chunk-QU7KR7VX.js +367 -0
- package/dist/chunks/chunk-QU7KR7VX.js.map +1 -0
- package/dist/chunks/chunk-RTSIFU3A.js +8924 -0
- package/dist/chunks/chunk-RTSIFU3A.js.map +1 -0
- package/dist/chunks/chunk-SZ3DDAJ7.js +142 -0
- package/dist/chunks/chunk-SZ3DDAJ7.js.map +1 -0
- package/dist/chunks/chunk-SZTQ6IWR.js +8835 -0
- package/dist/chunks/chunk-SZTQ6IWR.js.map +1 -0
- package/dist/chunks/chunk-UUM4KYBV.js +914 -0
- package/dist/chunks/chunk-UUM4KYBV.js.map +1 -0
- package/dist/chunks/chunk-V4L4ONOK.js +914 -0
- package/dist/chunks/chunk-V4L4ONOK.js.map +1 -0
- package/dist/chunks/chunk-V7ACRMW7.js +914 -0
- package/dist/chunks/chunk-V7ACRMW7.js.map +1 -0
- package/dist/chunks/chunk-WEKBCXNI.js +8839 -0
- package/dist/chunks/chunk-WEKBCXNI.js.map +1 -0
- package/dist/chunks/chunk-WN6TJQI2.js +103 -0
- package/dist/chunks/chunk-WN6TJQI2.js.map +1 -0
- package/dist/chunks/chunk-XM2JOPVU.js +914 -0
- package/dist/chunks/chunk-XM2JOPVU.js.map +1 -0
- package/dist/chunks/chunk-ZZIDNW4D.js +914 -0
- package/dist/chunks/chunk-ZZIDNW4D.js.map +1 -0
- package/dist/exports/computed-item.context.d.ts +2 -1
- package/dist/exports/computed.context.d.ts +3 -2
- package/dist/exports/config.context.d.ts +1 -0
- package/dist/exports/config.context.js +1 -1
- package/dist/exports/interaction.d.ts +2 -1
- package/dist/exports/interaction.js +5 -2
- package/dist/exports/item.context.d.ts +2 -1
- package/dist/exports/qti-assessment-item.context.d.ts +2 -1
- package/dist/exports/qti-condition-expression.d.ts +2 -1
- package/dist/exports/qti-condition-expression.js +3 -3
- package/dist/exports/qti-expression.d.ts +2 -1
- package/dist/exports/qti-expression.js +2 -2
- package/dist/exports/qti-test.d.ts +3 -2
- package/dist/exports/session.context.d.ts +3 -2
- package/dist/exports/test.context.d.ts +2 -1
- package/dist/exports/variables.d.ts +2 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +12 -12
- package/dist/item.css +66 -6
- package/dist/qti-components/index.d.ts +16 -5
- package/dist/qti-components/index.js +6 -6
- package/dist/qti-components-jsx.d.ts +29 -18
- package/dist/qti-item/components/item-container.js +2 -2
- package/dist/qti-item/components/item-correct-response-mode.js +1 -1
- package/dist/qti-item/components/item-show-candidate-correction.d.ts +2 -1
- package/dist/qti-item/components/item-show-correct-response.d.ts +2 -1
- package/dist/qti-item/components/print-item-variables.d.ts +2 -1
- package/dist/qti-item/core/index.d.ts +1 -1
- package/dist/qti-item/core/index.js +4 -4
- package/dist/qti-loader/index.d.ts +2 -1
- package/dist/qti-response-declaration-BKOw2_Pl.d.ts +1378 -0
- package/dist/qti-response-declaration-DKr08ANy.d.ts +1397 -0
- package/dist/qti-response-declaration-Dz6D30cF.d.ts +1397 -0
- package/dist/qti-response-declaration-d_tAAEFq.d.ts +1378 -0
- package/dist/qti-test/components/index.d.ts +3 -3
- package/dist/qti-test/components/index.js +4 -4
- package/dist/qti-test/components/test-container.js +2 -2
- package/dist/qti-test/components/test-navigation.d.ts +2 -2
- package/dist/qti-test/components/test-navigation.js +2 -2
- package/dist/qti-test/components/test-next.d.ts +3 -2
- package/dist/qti-test/components/test-prev.d.ts +3 -2
- package/dist/qti-test/components/test-print-context.d.ts +3 -2
- package/dist/qti-test/components/test-print-item-variables.d.ts +3 -2
- package/dist/qti-test/components/test-scoring-buttons.d.ts +3 -2
- package/dist/qti-test/components/test-scoring-feedback.d.ts +3 -2
- package/dist/qti-test/components/test-show-correct-response.d.ts +3 -2
- package/dist/qti-test/core/index.d.ts +4 -3
- package/dist/qti-test/core/index.js +7 -7
- package/dist/qti-test-feedback-Bskvq3FE.d.ts +91 -0
- package/dist/qti-test-feedback-CZsbp6z4.d.ts +91 -0
- package/dist/qti-test-feedback-dSr4W5Ft.d.ts +91 -0
- package/dist/qti-test-feedback-jBGxkr5n.d.ts +91 -0
- package/dist/vscode.html-custom-data.json +3 -2
- package/package.json +1 -1
package/cdn/index.global.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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 i(e,t,n,r,i,o,a){try{var s=e[o](a);var l=s.value}catch(e){n(e);return}if(s.done){t(l)}else{Promise.resolve(l).then(r,i)}}function o(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function s(e){i(a,r,o,s,l,"next",e)}function l(e){i(a,r,o,s,l,"throw",e)}s(undefined)})}}function a(e,t,n){t=f(t);return E(e,U()?Reflect.construct(t,n||[],f(e).constructor):t.apply(e,n))}function s(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function l(e,t,n){if(U()){l=Reflect.construct}else{l=function e(e,t,n){var r=[null];r.push.apply(r,t);var i=Function.bind.apply(e,r);var o=new i;if(n)C(o,n.prototype);return o}}return l.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 c(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 d(e,t,n){if(typeof Reflect!=="undefined"&&Reflect.get){d=Reflect.get}else{d=function e(e,t,n){var r=R(e,t);if(!r)return;var i=Object.getOwnPropertyDescriptor(r,t);if(i.get){return i.get.call(n||e)}return i.value}}return d(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 p(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)C(e,t)}function v(e,t){if(t!=null&&typeof Symbol!=="undefined"&&t[Symbol.hasInstance]){return!!t[Symbol.hasInstance](e)}else{return e instanceof t}}function y(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function m(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function g(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var i=true;var o=false;var a,s;try{for(n=n.call(e);!(i=(a=n.next()).done);i=true){r.push(a.value);if(t&&r.length===t)break}}catch(e){o=true;s=e}finally{try{if(!i&&n["return"]!=null)n["return"]()}finally{if(o)throw s}}return r}function b(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function k(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 w(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 x(e,t){t=t!=null?t:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(t))}else{w(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function E(e,t){if(t&&(I(t)==="object"||typeof t==="function")){return t}return r(e)}function q(e,t,n,r){if(typeof Reflect!=="undefined"&&Reflect.set){q=Reflect.set}else{q=function e(e,t,n,r){var i=R(e,t);var o;if(i){o=Object.getOwnPropertyDescriptor(i,t);if(o.set){o.set.call(r,n);return true}else if(!o.writable){return false}}o=Object.getOwnPropertyDescriptor(r,t);if(o){if(!o.writable){return false}o.value=n;Object.defineProperty(r,t,o)}else{h(r,t,n)}return true}}return q(e,t,n,r)}function A(e,t,n,r,i){var o=q(e,t,n,r||e);if(!o&&i){throw new Error("failed to set property")}return n}function C(e,t){C=Object.setPrototypeOf||function e(e,t){e.__proto__=t;return e};return C(e,t)}function S(e,n){return t(e)||g(e,n)||O(e,n)||b()}function R(e,t){while(!Object.prototype.hasOwnProperty.call(e,t)){e=f(e);if(e===null)break}return e}function P(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)||m(e)||O(e)||b()}function T(e){return n(e)||m(e)||O(e)||_()}function I(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function O(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 N(e){var t=typeof Map==="function"?new Map:undefined;N=function e(e){if(e===null||!y(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 l(e,arguments,f(this).constructor)}n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:false,writable:true,configurable:true}});return C(n,e)};return N(e)}function U(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(U=function(){return!!e})()}function L(e,t){var n,r,i,o={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return a.next=s(0),a["throw"]=s(1),a["return"]=s(2),typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(t){return l([e,t])}}function l(s){if(n)throw new TypeError("Generator is already executing.");while(a&&(a=0,s[0]&&(o=0)),o)try{if(n=1,r&&(i=s[0]&2?r["return"]:s[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;if(r=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:o.label++;return{value:s[1],done:false};case 5:o.label++;r=s[1];s=[0];continue;case 7:s=o.ops.pop();o.trys.pop();continue;default:if(!(i=o.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){o=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(s[0]===6&&o.label<i[1]){o.label=i[1];i=s;break}if(i&&o.label<i[2]){o.label=i[2];o.ops.push(s);break}if(i[2])o.ops.pop();o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e];r=0}finally{n=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}}function $(){var e=P(["<slot></slot>"]);$=function t(){return e};return e}function D(){var e=P(["<slot></slot>"]);D=function t(){return e};return e}function V(){var e=P(['<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">\n<xsl:output method="html" version="5.0" encoding="UTF-8" indent="yes" />\n <xsl:template match="@*|node()">\n <xsl:copy>\n <xsl:apply-templates select="@*|node()"/>\n </xsl:copy>\n </xsl:template>\n\n \x3c!-- remove existing namespaces --\x3e\n <xsl:template match="*">\n \x3c!-- remove element prefix --\x3e\n <xsl:element name="{local-name()}">\n \x3c!-- process attributes --\x3e\n <xsl:for-each select="@*">\n \x3c!-- remove attribute prefix --\x3e\n <xsl:attribute name="{local-name()}">\n <xsl:value-of select="."/>\n </xsl:attribute>\n </xsl:for-each>\n <xsl:apply-templates/>\n </xsl:element>\n</xsl:template>\n</xsl:stylesheet>']);V=function t(){return e};return e}function j(){var e=P(["<slot @slotchange=","></slot>"]);j=function t(){return e};return e}function H(){var e=P([' <slot part="feedback" class="feedback ','"></slot> ']);H=function t(){return e};return e}function Q(){var e=P(["\n :host {\n display: block;\n }\n .on {\n display: block;\n }\n .off {\n display: none;\n }\n "]);Q=function t(){return e};return e}function F(){var e=P([' <slot part="feedback" class="','"></slot> ']);F=function t(){return e};return e}function z(){var e=P(["\n .on {\n display: inline-block;\n }\n .off {\n display: none;\n }\n "]);z=function t(){return e};return e}function B(){var e=P(['\n <dialog class="qti-dialog" part="feedback" ?open="','">\n <slot></slot>\n <div style="margin-top: var(--qti-gap-size); text-align: center;">\n <button class="button close-button" @click="','">Close</button>\n </div>\n </dialog>\n ']);B=function t(){return e};return e}function W(){var e=P(["\n .qti-dialog {\n background: var(--qti-bg);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n border-radius: var(--qti-border-radius);\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1000;\n width: auto;\n max-width: 90%;\n }\n\n .button {\n border-radius: var(--qti-border-radius);\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n background-color: var(--qti-bg-active);\n border: var(--qti-border-active);\n cursor: pointer;\n position: relative;\n display: inline-block;\n }\n\n .button:hover {\n background-color: var(--qti-hover-bg);\n }\n\n .button:disabled {\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n cursor: not-allowed;\n }\n\n .button:focus {\n outline: var(--qti-focus-border-width) solid var(--qti-focus-color);\n }\n "]);W=function t(){return e};return e}function J(){var e=P([' <slot name="drags"></slot> ']);J=function t(){return e};return e}function G(){var e=P(["\n :host {\n display: flex;\n user-select: none;\n position: absolute;\n }\n "]);G=function t(){return e};return e}function X(){var e=P(["\n :host {\n display: block; /* necessary to calculate scaling position */\n }\n slot[name='qti-simple-associable-choice'] {\n display: flex;\n align-items: flex-start;\n flex: 1;\n border: 2px solid transparent;\n padding: 0.3rem;\n border-radius: 0.3rem;\n gap: 0.5rem;\n }\n\n :host::part(associables-container) {\n display: flex;\n padding: 0.5rem;\n justify-content: space-between;\n background: linear-gradient(\n 180deg,\n rgb(0 0 0 / 0%) calc(50% - 1px),\n var(--qti-border-color-gray) calc(50%),\n rgb(0 0 0 / 0%) calc(50% + 1px)\n );\n }\n"]);X=function t(){return e};return e}function Y(){var e=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>']);Y=function t(){return e};return e}function K(){var e=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>']);K=function t(){return e};return e}function Z(){var e=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"]);Z=function t(){return e};return e}function ee(){var e=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 ']);ee=function t(){return e};return e}function et(){var e=P(['<div style="color:red">\n <h1>Error</h1>\n ',"\n </div>"]);et=function t(){return e};return e}function en(){var e=P(["<iframe\n width=","\n height=",'\n frameborder="0"\n title="pciContainer"\n id="pciContainer"\n >\n </iframe>\n ',""]);en=function t(){return e};return e}function er(){var e=P(["<button ?disabled=",' part="button" @click=',">","</button>"]);er=function t(){return e};return e}function ei(){var e=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"]);ei=function t(){return e};return e}function eo(){var e=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>"]);eo=function t(){return e};return e}function ea(){var e=P(["\n :host {\n display: flex;\n user-select: none;\n }\n "]);ea=function t(){return e};return e}function es(){var e=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"]);es=function t(){return e};return e}function el(){var e=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>']);el=function t(){return e};return e}function eu(){var e=P(["<slot></slot>"]);eu=function t(){return e};return e}function ec(){var e=P(["\n :host {\n display: inline-flex;\n user-select: none;\n }\n "]);ec=function t(){return e};return e}function eh(){var e=P([' <slot name="drags"></slot>']);eh=function t(){return e};return e}function ed(){var e=P(["\n :host {\n display: flex;\n user-select: none;\n }\n "]);ed=function t(){return e};return e}function ef(){var e=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"]);ef=function t(){return e};return e}function ep(){var e=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 "]);ep=function t(){return e};return e}function ev(){var e=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 ']);ev=function t(){return e};return e}function ey(){var e=P(['<line\n part="point"\n x1=',"\n y1=","\n x2=","\n y2=",'\n stroke="var(--qti-border-active)"\n stroke-width="3"\n />']);ey=function t(){return e};return e}function em(){var e=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>']);em=function t(){return e};return e}function eg(){var e=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"]);eg=function t(){return e};return e}function eb(){var e=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>']);eb=function t(){return e};return e}function e_(){var e=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"]);e_=function t(){return e};return e}function ek(){var e=P(['\n <slot name="prompt"></slot>\n <slot></slot>\n <div role="alert" part="message" id="validation-message"></div>\n ']);ek=function t(){return e};return e}function ew(){var e=P(["\n :host {\n display: flex;\n user-select: none;\n position: absolute;\n }\n "]);ew=function t(){return e};return e}function ex(){var e=P(["\n slot:not([name='prompt']) {\n position: relative; /* qti-hotspot-choice relative to the slot */\n display: block;\n width: fit-content; /* hotspots not stretching further if image is at max size */\n }\n ::slotted(img) {\n /* image not selectable anymore */\n pointer-events: none;\n user-select: none;\n /* width:100%; */\n }\n"]);ex=function t(){return e};return e}function eE(){var e=P(['\n <slot name="prompt"></slot>\n <slot></slot>\n ']);eE=function t(){return e};return e}function eq(){var e=P([' <slot></slot>\n <div part="message" role="alert" id="validation-message"></div>']);eq=function t(){return e};return e}function eA(){var e=P(['<div part="ch"><div part="cha"></div></div>\n <slot></slot> ']);eA=function t(){return e};return e}function eC(){var e=P(["\n :host {\n display: flex;\n user-select: none;\n }\n "]);eC=function t(){return e};return e}function eS(){var e=P(["\n :host {\n display: inline-block;\n }\n slot {\n display: flex;\n flex-direction: column;\n }\n [role='menu'] {\n position: absolute;\n z-index: 1000;\n }\n .anchor {\n /* anchor-name: --infobox; */\n width: fit-content;\n }\n\n .positionedElement {\n position: absolute;\n /* position-anchor: --infobox; */\n /* top: anchor(bottom); */\n }\n "]);eS=function t(){return e};return e}function eR(){var e=P(['\n <option value="','" ?selected="','">',"</option>\n "]);eR=function t(){return e};return e}function eP(){var e=P(['\n <select part="select" @change="','" ?disabled="','" ?readonly="','">\n ',"\n </select>\n\n ","\n "]);eP=function t(){return e};return e}function eM(){var e=P(["\n :host {\n display: block;\n cursor: pointer;\n }\n "]);eM=function t(){return e};return e}function eT(){var e=P([" <slot></slot> "]);eT=function t(){return e};return e}function eI(){var e=P(['\n <slot part="slot"></slot>\n <slot part="dropslot" name="qti-simple-associable-choice"></slot>\n ']);eI=function t(){return e};return e}function eO(){var e=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 t(){return e};return e}function eN(){var e=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"]);eN=function t(){return e};return e}function eU(){var e=P(['<th part="r-header">',"</th>"]);eU=function t(){return e};return e}function eL(){var e=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 ']);eL=function t(){return e};return e}function e$(){var e=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>"]);e$=function t(){return e};return e}function eD(){var e=P(['<tr part="row">\n <td part="c-header">',"</td>\n ","\n </tr>"]);eD=function t(){return e};return e}function eV(){var e=P(['\n <table part="table">\n <tr part="r-header">\n <td></td>\n ',"\n </tr>\n\n ","\n </table>\n "]);eV=function t(){return e};return e}function ej(){var e=P(['\n <slot name="prompt"></slot>\n <slot ?hidden=',"></slot>\n\n ",'\n\n <div role="alert" part="message" id="validation-message"></div>\n ']);ej=function t(){return e};return e}function eH(){var e=P([' <slot name="prompt"></slot>\n <slot></slot>']);eH=function t(){return e};return e}function eQ(){var e=P([""]);eQ=function t(){return e};return e}function eF(){var e=P(["\n [part='drags'] {\n display: flex;\n align-items: flex-start;\n flex: 1;\n flex-wrap: wrap;\n }\n\n [part='drops'] {\n flex: 1;\n display: grid;\n grid-auto-flow: column;\n grid-auto-columns: 1fr;\n }\n\n :host([orientation='horizontal']) [part='drags'] {\n flex-direction: row;\n }\n :host([orientation='horizontal']) [part='drops'] {\n grid-auto-flow: column;\n }\n :host([orientation='vertical']) [part='drags'] {\n flex-direction: column;\n }\n :host([orientation='vertical']) [part='drops'] {\n grid-auto-flow: row;\n }\n\n [part='drop-list'] {\n display: block;\n flex: 1;\n }\n\n [part='container'] {\n display: flex;\n gap: 0.5rem;\n }\n :host(.qti-choices-top) [part='container'] {\n flex-direction: column;\n }\n :host(.qti-choices-bottom) [part='container'] {\n flex-direction: column-reverse;\n }\n :host(.qti-choices-left) [part='container'] {\n flex-direction: row;\n }\n :host(.qti-choices-right) [part='container'] {\n flex-direction: row-reverse;\n }\n"]);eF=function t(){return e};return e}function ez(){var e=P(['<drop-list role="region" part="drop-list" identifier="droplist','"></drop-list>']);ez=function t(){return e};return e}function eB(){var e=P([' <slot name="prompt"> </slot>\n <div part="container">\n <slot part="drags"> </slot>\n <div part="drops">\n ',"\n </div>\n </div>"]);eB=function t(){return e};return e}function eW(){var e=P(["\n ::slotted(qti-interaction-markup) {\n display: none;\n }\n"]);eW=function t(){return e};return e}function eJ(){var e=P(['<div style="color:red">\n <h1>Error</h1>\n ',"\n </div>"]);eJ=function t(){return e};return e}function eG(){var e=P(["\n <slot></slot>\n ","\n "]);eG=function t(){return e};return e}function eX(){var e=P(["\n :host {\n display: block;\n width: 100%;\n min-height: 50px;\n }\n .qti-customInteraction {\n display: block;\n width: 100%;\n min-height: 50px;\n }\n "]);eX=function t(){return e};return e}function eY(){var e=P(["<slot></slot>"]);eY=function t(){return e};return e}function eK(){var e=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 "]);eK=function t(){return e};return e}function eZ(){var e=P(["<slot></slot>"]);eZ=function t(){return e};return e}function e0(){var e=P(["\n :host {\n display: inline-block;\n position: relative;\n }\n "]);e0=function t(){return e};return e}function e1(){var e=P(['\n <button\n part="point"\n style=','\n aria-label="Remove point at ','"\n @click=',"\n ></button>\n "]);e1=function t(){return e};return e}function e2(){var e=P(["<div\n style=",'\n data-coord="','"\n alt=','\n data-shape="','"\n ></div>']);e2=function t(){return e};return e}function e3(){var e=P([' <slot name="prompt"></slot>\n <point-container>\n ',"\n ","\n <slot></slot>\n </point-container>"]);e3=function t(){return e};return e}function e4(){var e=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 "]);e4=function t(){return e};return e}function e5(){var e=P(['<div id="label">',"</div>"]);e5=function t(){return e};return e}function e6(){var e=P(['<div part="ch">\n <div part="cha"></div>\n </div>\n ','\n <slot part="slot"></slot>']);e6=function t(){return e};return e}function e9(){var e=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 "]);e9=function t(){return e};return e}function e7(){var e=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"]);e7=function t(){return e};return e}function e8(){var e=P(['\n <div id="knob-correct" part="knob-correct">\n <div id="value" part="value">',"</div>\n </div>\n "]);e8=function t(){return e};return e}function te(){var e=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 "]);te=function t(){return e};return e}function tt(){var e=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"]);tt=function t(){return e};return e}function tn(){var e=P(['<div part="correct">',"</div>"]);tn=function t(){return e};return e}function tr(){var e=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 "]);tr=function t(){return e};return e}function ti(){var e=P(['\n <div>\n <slot name="prompt"></slot>\n <input type="file" @change="','" ?disabled="','" ?readonly="','" />\n </div>\n ']);ti=function t(){return e};return e}function to(){var e=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 "]);to=function t(){return e};return e}function ta(){var e=P(["\n :host {\n display: block;\n }\n"]);ta=function t(){return e};return e}function ts(){var e=P(['<slot part="qti-rubric-blocks" name="qti-rubric-block"></slot><slot></slot>']);ts=function t(){return e};return e}function tl(){var e=P(["<slot></slot>"]);tl=function t(){return e};return e}function tu(){var e=P(["\n :host {\n display: none;\n }\n "]);tu=function t(){return e};return e}function tc(){var e=P(["<slot></slot>"]);tc=function t(){return e};return e}function th(){var e=P(["<slot></slot>"]);th=function t(){return e};return e}function td(){var e=P(["\n :host {\n display: none;\n }\n "]);td=function t(){return e};return e}function tf(){var e=P(["<slot></slot>"]);tf=function t(){return e};return e}function tp(){var e=P(["<slot></slot>"]);tp=function t(){return e};return e}function tv(){var e=P(["<slot></slot>"]);tv=function t(){return e};return e}function ty(){var e=P(["",""]);ty=function t(){return e};return e}function tm(){var e=P(["<pre>","</pre>\n <slot></slot>"]);tm=function t(){return e};return e}function tg(){var e=P(["\n slot {\n display: none;\n }\n "]);tg=function t(){return e};return e}function tb(){var e=P(["",""]);tb=function t(){return e};return e}function t_(){var e=P(["",""]);t_=function t(){return e};return e}function tk(){var e=P(["<slot></slot>"]);tk=function t(){return e};return e}function tw(){var e=P(["<slot></slot>"]);tw=function t(){return e};return e}function tx(){var e=P(["\n :host {\n display: block;\n }\n "]);tx=function t(){return e};return e}function tE(){var e=P(["<slot></slot>"]);tE=function t(){return e};return e}function tq(){var e=P(["",""]);tq=function t(){return e};return e}function tA(){var e=P(["\n :host {\n display: none;\n }\n "]);tA=function t(){return e};return e}function tC(){var e=P(["",""]);tC=function t(){return e};return e}function tS(){var e=P(["\n :host {\n display: none;\n }\n "]);tS=function t(){return e};return e}var QtiComponents=function(){var e=function e(e){var t=e.context;return function(e,n){var r=new WeakMap;if((typeof n==="undefined"?"undefined":I(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 tX(this,{context:t,initialValue:e})),e}};{e.constructor.addInitializer(function(e){r.set(e,new tX(e,{context:t}))});var i=Object.getOwnPropertyDescriptor(e,n),o;if(i===void 0){var a=new WeakMap;o={get:function e(){return a.get(this)},set:function e(e){r.get(this).setValue(e),a.set(this,e)},configurable:!0,enumerable:!0}}else{var s=i.set;o=x(k({},i),{set:function e(e){r.get(this).setValue(e),s===null||s===void 0?void 0:s.call(this,e)}})}return void Object.defineProperty(e,n,o)}}};var t=function e(e){var t=e.context,n=e.subscribe;return function(e,r){(typeof r==="undefined"?"undefined":I(r))=="object"?r.addInitializer(function(){var r=this;new tW(this,{context:t,callback:function(t){e.set.call(r,t)},subscribe:n})}):e.constructor.addInitializer(function(e){new tW(e,{context:t,callback:function(t){e[r]=t},subscribe:n})})}};var n=function e(e,t){if(!n6(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return nK!==void 0?nK.createHTML(t):t};var r=function e(e){return function(t,n){return(typeof n==="undefined"?"undefined":I(n))=="object"?rO(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 i=function e(e){return r(x(k({},e),{state:!0,attribute:!1}))};var l=function e(e,t){return function(n,r,i){var o=function(t){var n;var r;return(r=(n=t.renderRoot)===null||n===void 0?void 0:n.querySelector(e))!==null&&r!==void 0?r:null};if(t){var a=(typeof r==="undefined"?"undefined":I(r))=="object"?n:i!==null&&i!==void 0?i:function(){var e=Symbol();return{get:function t(){return this[e]},set:function t(t){this[e]=t}}}(),s=a.get,l=a.set;return rN(n,r,{get:function e(){var e=s.call(this);return e===void 0&&(e=o(this),(e!==null||this.hasUpdated)&&l.call(this,e)),e}})}return rN(n,r,{get:function e(){return o(this)}})}};var u=function e(e){return function(t,n){var r=e!==null&&e!==void 0?e:{},i=r.slot,o=r.selector,a="slot"+(i?"[name=".concat(i,"]"):":not([name])");return rN(t,n,{get:function t(){var t;var n;var r=(t=this.renderRoot)===null||t===void 0?void 0:t.querySelector(a),i=(n=r===null||r===void 0?void 0:r.assignedElements(e))!==null&&n!==void 0?n:[];return o===void 0?i:i.filter(function(e){return e.matches(o)})}})}};var y=function e(e,t){var n;return function(t,r){var i=t.connectedCallback,o=t.disconnectedCallback;t.connectedCallback=function(){var t=this;var o;i.call(this);var a=function(n){var i;var o=Array.from(t.querySelectorAll(e)).concat(Array.from(((i=t.shadowRoot)===null||i===void 0?void 0:i.querySelectorAll(e))||[]));var a=true,s=false,l=undefined;try{for(var u=n[Symbol.iterator](),c;!(a=(c=u.next()).done);a=true){var h=c.value;var d=Array.from(h.addedNodes).map(function(e){return e}),f=Array.from(h.addedNodes).map(function(e){return e});h.type==="childList"&&d.find(function(e){return o.includes(e)})&&t[r](d,f)}}catch(e){s=true;l=e}finally{try{if(!a&&u.return!=null){u.return()}}finally{if(s){throw l}}}};n=new MutationObserver(a),n.observe(this,{childList:!0,subtree:!0});var s=Array.from(this.querySelectorAll(e)).concat(Array.from(((o=this.shadowRoot)===null||o===void 0?void 0:o.querySelectorAll(e))||[]));this[r](Array.from(s),[])},t.disconnectedCallback=function(){o.call(this),n.disconnect()}}};var m=function e(e,t){var n=k({waitUntilFirstUpdate:!1},t);return function(t,r){var i=t.update,o=Array.isArray(e)?e:[e];t.update=function(e){var t=this;o.forEach(function(i){var o=i;if(e.has(o)){var a=e.get(o),s=t[o];a!==s&&(!n.waitUntilFirstUpdate||t.hasUpdated)&&t[r](a,s)}}),i.call(this,e)}}};var g=function e(e,t,n){e.querySelectorAll(t).forEach(function(e){var r="".concat(t,"-").concat(n),i=_(e,r);e.replaceWith(i)})};var b=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),i="".concat(e.nodeName,"-").concat(r),o=_(e,i);e.replaceWith(o)}})})};var _=function e(e,t){var n=document.createElement(t);var r=true,i=false,o=undefined;try{for(var a=e.attributes[Symbol.iterator](),s;!(r=(s=a.next()).done);r=true){var l=s.value;n.setAttribute(l.name,l.value)}}catch(e){i=true;o=e}finally{try{if(!r&&a.return!=null){a.return()}}finally{if(i){throw o}}}for(;e.firstChild;)n.appendChild(e.firstChild);return n};var w=function e(e){var t=new XMLHttpRequest;return{promise:new Promise(function(n,r){t.open("GET",e,!0),t.responseType="document",t.onload=function(){t.status>=200&&t.status<300?n(t.responseXML):r(t.statusText)},t.onerror=function(){r(t.statusText)},t.send()}),xhr:t}};var E=function e(e){return new DOMParser().parseFromString(e,"text/xml")};var q=function e(e){var t=new XSLTProcessor,n=new DOMParser().parseFromString(rV,"text/xml");return t.importStylesheet(n),t.transformToFragment(e,document)};var C=function e(e,t){t.endsWith("/")||(t+="/"),e.querySelectorAll("[src],[href],[primary-path]").forEach(function(e){var n;var r="";e.getAttribute("src")&&(r="src"),e.getAttribute("href")&&(r="href"),e.getAttribute("primary-path")&&(r="primary-path");var i=(n=e.getAttribute(r))===null||n===void 0?void 0:n.trim();if(!/^(data:|https?:|blob:)/.test(i)){var o=t+encodeURI(i);e.setAttribute(r,o)}})};var R=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 P=function e(e){e.querySelectorAll("qti-stylesheet").forEach(function(e){return e.remove()})};var O=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:}};var U=function e(e){return e==null};var tR=function e(e){return e.replace(/([^:]\/)\/+/g,"$1").replace(/\/\//g,"/").replace("http:/","http://").replace("https:/","https://")};var tP=function e(e,t){var n=/*#__PURE__*/function(e){"use strict";p(n,e);function n(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}s(this,n);var i;i=a(this,n,T(t));i.identifier="";i.tabIndex=0;i.disabled=!1;i.readonly=!1;i.internals=i.attachInternals();return i}c(n,[{key:"handleDisabledChange",value:function e(e,t){this.tabIndex=t?-1:0,t&&this.blur()}},{key:"connectedCallback",value:function e(){d(f(n.prototype),"connectedCallback",this).call(this),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(){d(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.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 rs($())}}]);return n}(e);return tF([r({type:String})],n.prototype,"identifier",2),tF([r({type:Number,reflect:!0,attribute:"tabindex"})],n.prototype,"tabIndex",2),tF([r({type:Boolean,reflect:!0,attribute:"aria-disabled",converter:is})],n.prototype,"disabled",2),tF([r({type:Boolean,reflect:!0,attribute:"aria-readonly",converter:is})],n.prototype,"readonly",2),tF([m("disabled",{waitUntilFirstUpdate:!0})],n.prototype,"handleDisabledChange",1),n};var tM=function e(e,t,n,r){var i=n.getAttribute("width")?parseFloat(n.getAttribute("width")):n.naturalWidth,o=n.getAttribute("height")?parseFloat(n.getAttribute("height")):n.naturalHeight;switch(e){case"circle":{if(t.length!==3){console.error("Invalid cirlce coordinates:",t);return}var a=S(t,3),s=a[0],l=a[1],u=a[2],c=s/i*100,h=l/o*100,d=u/i*100;r.style.left=c-d+"%",r.style.top=h-d+"%";var f=u/i*100,p=u/o*100;r.style.width=2*f+"%",r.style.height=2*p+"%",r.style.borderRadius="50%"}break;case"rect":{if(t.length!==4){console.error("Invalid rectangle coordinates:",t);return}var v=S(t,4),y=v[0],m=v[1],g=v[2],b=v[3],_=y/i*100,k=m/o*100,w=g/i*100,x=b/o*100;r.style.left=_+"%",r.style.top=k+"%",r.style.width=w-_+"%",r.style.height=x-k+"%"}break;case"ellipse":{if(t.length!==4){console.error("Invalid ellipse coordinates:",t);return}var E=S(t,4),q=E[0],A=E[1],C=E[2],R=E[3],P=q/i*100,M=A/o*100,I=C/i*100,O=R/o*100;r.style.left=P-I+"%",r.style.top=M-O+"%",r.style.width=2*I+"%",r.style.height=2*O+"%",r.style.borderRadius="50%"}break;case"poly":{var N,U,L,$;if(t.length<6||t.length%2!==0){console.error("Invalid polygon coordinates:",t);return}var D=[];for(var V=0;V<t.length;V+=2)D.push({x:t[V],y:t[V+1]});var j=(N=Math).min.apply(N,T(D.map(function(e){return e.x}))),H=(U=Math).max.apply(U,T(D.map(function(e){return e.x}))),Q=(L=Math).min.apply(L,T(D.map(function(e){return e.y}))),F=($=Math).max.apply($,T(D.map(function(e){return e.y}))),z=j/i*100,B=Q/o*100,W=H/i*100,J=F/o*100;r.style.left=z+"%",r.style.top=B+"%",r.style.width=W-z+"%",r.style.height=J-B+"%";var G=D.map(function(e){return{x:(e.x-j)/(H-j)*100,y:(e.y-Q)/(F-Q)*100}}).map(function(e){return"".concat(e.x,"% ").concat(e.y,"%")}).join(",");r.style.clipPath="polygon(".concat(G,")")}break;default:console.error("Unsupported shape: ".concat(e));break}};var tT=function e(e){this._$AN!==void 0?(i4(this),this._$AM=e,i5(this)):this._$AM=e};var tI=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,i=this._$AN;if(i!==void 0&&i.size!==0)if(t)if(Array.isArray(r))for(var o=n;o<r.length;o++)i3(r[o],!1),i4(r[o]);else r!=null&&(i3(r,!1),i4(r));else i3(this,e)};var tO=function e(e){return /*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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 tN=function e(e){return /*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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 tU;var tL=Object.defineProperty;var t$=Object.getOwnPropertyDescriptor;var tD=Object.getOwnPropertyNames;var tV=Object.prototype.hasOwnProperty;var tj=function(e,t){for(var n in t)tL(e,n,{get:t[n],enumerable:!0})},tH=function(e,t,n,r){var i=true,o=false,a=undefined;if(t&&(typeof t==="undefined"?"undefined":I(t))=="object"||typeof t=="function")try{var s=function(){var i=u.value;!tV.call(e,i)&&i!==n&&tL(e,i,{get:function(){return t[i]},enumerable:!(r=t$(t,i))||r.enumerable})};for(var l=tD(t)[Symbol.iterator](),u;!(i=(u=l.next()).done);i=true)s()}catch(e){o=true;a=e}finally{try{if(!i&&l.return!=null){l.return()}}finally{if(o){throw a}}}return e};var tQ=function(e){return tH(tL({},"__esModule",{value:!0}),e)},tF=function(e,t,n,r){for(var i=r>1?void 0:r?t$(t,n):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(r?a(t,n,i):a(i))||i);return r&&i&&tL(t,n,i),i};var tz={};tj(tz,{QtiAnd:function(){return oq},QtiAssessmentItem:function(){return r$},QtiAssessmentStimulusRef:function(){return rH},QtiAssociableHotspot:function(){return rK},QtiAssociateInteraction:function(){return r4},QtiBaseValue:function(){return oA},QtiChoiceInteraction:function(){return r7},QtiCompanionMaterialsInfo:function(){return rQ},QtiContainerSize:function(){return oC},QtiContains:function(){return oS},QtiContentBody:function(){return an},QtiCorrect:function(){return oR},QtiCustomInteraction:function(){return r8},QtiCustomOperator:function(){return rF},QtiDefault:function(){return oM},QtiDelete:function(){return ae},QtiEndAttemptInteraction:function(){return ie},QtiEqual:function(){return oU},QtiEqualRounded:function(){return oT},QtiExtendedTextInteraction:function(){return ir},QtiFeedbackBlock:function(){return rJ},QtiFeedbackInline:function(){return rX},QtiFieldValue:function(){return oH},QtiGap:function(){return iu},QtiGapImg:function(){return ii},QtiGapMatchInteraction:function(){return ia},QtiGapText:function(){return il},QtiGcd:function(){return oL},QtiGraphicAssociateInteraction:function(){return iA},QtiGraphicGapMatchInteraction:function(){return iS},QtiGraphicOrderInteraction:function(){return iP},QtiGt:function(){return o$},QtiGte:function(){return oD},QtiHotspotChoice:function(){return iM},QtiHotspotInteraction:function(){return iI},QtiHottext:function(){return iN},QtiHottextInteraction:function(){return iO},QtiIndex:function(){return at},QtiInlineChoice:function(){return iD},QtiInlineChoiceInteraction:function(){return i$},QtiIsNull:function(){return oj},QtiItemBody:function(){return oa},QtiLookupOutcomeValue:function(){return ov},QtiLt:function(){return oQ},QtiLte:function(){return oF},QtiMapResponse:function(){return oz},QtiMapResponsePoint:function(){return oB},QtiMatch:function(){return oJ},QtiMatchInteraction:function(){return iH},QtiMathOperator:function(){return oW},QtiMediaInteraction:function(){return iQ},QtiMember:function(){return oG},QtiModalFeedback:function(){return rY},QtiMultiple:function(){return oX},QtiNot:function(){return oY},QtiNull:function(){return oV},QtiOr:function(){return oK},QtiOrderInteraction:function(){return iz},QtiOrdered:function(){return oZ},QtiOutcomeDeclaration:function(){return aa},QtiOutcomeProcessing:function(){return os},QtiOutcomeProcessingProcessor:function(){return ol},QtiPortableCustomInteraction:function(){return iW},QtiPositionObjectInteraction:function(){return iJ},QtiPositionObjectStage:function(){return iG},QtiPower:function(){return o0},QtiPrintedVariable:function(){return o1},QtiProduct:function(){return o2},QtiPrompt:function(){return ou},QtiRandom:function(){return o8},QtiRandomInteger:function(){return o7},QtiResponseCondition:function(){return oy},QtiResponseDeclaration:function(){return as},QtiResponseElse:function(){return ob},QtiResponseElseIf:function(){return ok},QtiResponseIf:function(){return o_},QtiResponseProcessing:function(){return of},QtiRound:function(){return oI},QtiRoundTo:function(){return oO},QtiRubricBlock:function(){return ar},QtiRule:function(){return op},QtiSelectPointInteraction:function(){return iZ},QtiSetOutcomeValue:function(){return om},QtiSetOutcomeValueRule:function(){return og},QtiSimpleAssociableChoice:function(){return iV},QtiSimpleChoice:function(){return i0},QtiSliderInteraction:function(){return i2},QtiStringMatch:function(){return o4},QtiStylesheet:function(){return ai},QtiSubtract:function(){return o3},QtiSum:function(){return o5},QtiSumExpression:function(){return o6},QtiTextEntryInteraction:function(){return or},QtiUploadInteraction:function(){return oi},QtiVariable:function(){return o9},qtiAndMixin:function(){return tO},qtiSubtractMixin:function(){return tN}});var tB=/*#__PURE__*/function(e){"use strict";p(t,e);function t(e,n,r,i){s(this,t);var o;o=a(this,t,["context-request",{bubbles:!0,composed:!0}]),o.context=e,o.contextTarget=n,o.callback=r,o.subscribe=i!==null&&i!==void 0?i:!1;return o}return t}(N(Event));var tW=/*#__PURE__*/function(){"use strict";function e(t,n,r,i){var o=this;s(this,e);if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=function(e,t){o.unsubscribe&&(o.unsubscribe!==t&&(o.provided=!1,o.unsubscribe()),o.subscribe||o.unsubscribe()),o.value=e,o.host.requestUpdate(),o.provided&&!o.subscribe||(o.provided=!0,o.callback&&o.callback(e,t)),o.unsubscribe=t},this.host=t,n.context!==void 0){var a=n;var l;this.context=a.context,this.callback=a.callback,this.subscribe=(l=a.subscribe)!==null&&l!==void 0?l:!1}else this.context=n,this.callback=r,this.subscribe=i!==null&&i!==void 0?i:!1;this.host.addController(this)}c(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 tB(this.context,this.host,this.t,this.subscribe))}}]);return e}();var tJ=/*#__PURE__*/function(){"use strict";function e(t){var n=this;s(this,e);this.subscriptions=new Map,this.updateObservers=function(){var e=true,t=false,r=undefined;try{for(var i=n.subscriptions[Symbol.iterator](),o;!(e=(o=i.next()).done);e=true){var a=S(o.value,2),s=a[0],l=a[1],u=l.disposer;s(n.o,u)}}catch(e){t=true;r=e}finally{try{if(!e&&i.return!=null){i.return()}}finally{if(t){throw r}}}},t!==void 0&&(this.value=t)}c(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(){r.subscriptions.delete(e)},consumerHost:t});var i=this.subscriptions.get(e),o=i.disposer;e(this.value,o)}},{key:"clearCallbacks",value:function e(){this.subscriptions.clear()}}]);return e}();var tG=/*#__PURE__*/function(e){"use strict";p(t,e);function t(e,n){s(this,t);var r;r=a(this,t,["context-provider",{bubbles:!0,composed:!0}]),r.context=e,r.contextTarget=n;return r}return t}(N(Event)),tX=/*#__PURE__*/function(e){"use strict";p(t,e);function t(e,n,r){s(this,t);var i;var o,l;i=a(this,t,[n.context!==void 0?n.initialValue:r]),i.onContextRequest=function(e){if(e.context!==i.context)return;var t;var n=(t=e.contextTarget)!==null&&t!==void 0?t:e.composedPath()[0];n!==i.host&&(e.stopPropagation(),i.addCallback(e.callback,n,e.subscribe))},i.onProviderRequest=function(e){var t;if(e.context!==i.context||((t=e.contextTarget)!==null&&t!==void 0?t:e.composedPath()[0])===i.host)return;var n=new Set;var r=true,o=false,a=undefined;try{for(var s=i.subscriptions[Symbol.iterator](),l;!(r=(l=s.next()).done);r=true){var u=S(l.value,2),c=u[0],h=u[1],d=h.consumerHost;n.has(c)||(n.add(c),d.dispatchEvent(new tB(i.context,d,c,!0)))}}catch(e){o=true;a=e}finally{try{if(!r&&s.return!=null){s.return()}}finally{if(o){throw a}}}e.stopPropagation()},i.host=e,n.context!==void 0?i.context=n.context:i.context=n,i.attachListeners(),(o=(l=i.host).addController)===null||o===void 0?void 0:o.call(l,i);return i}c(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 tG(this.context,this.host))}}]);return t}(tJ);var tY=/*#__PURE__*/function(){"use strict";function e(t){s(this,e);this.ariaAtomic="",this.ariaAutoComplete="",this.ariaBrailleLabel="",this.ariaBrailleRoleDescription="",this.ariaBusy="",this.ariaChecked="",this.ariaColCount="",this.ariaColIndex="",this.ariaColSpan="",this.ariaCurrent="",this.ariaDescription="",this.ariaDisabled="",this.ariaExpanded="",this.ariaHasPopup="",this.ariaHidden="",this.ariaInvalid="",this.ariaKeyShortcuts="",this.ariaLabel="",this.ariaLevel="",this.ariaLive="",this.ariaModal="",this.ariaMultiLine="",this.ariaMultiSelectable="",this.ariaOrientation="",this.ariaPlaceholder="",this.ariaPosInSet="",this.ariaPressed="",this.ariaReadOnly="",this.ariaRequired="",this.ariaRoleDescription="",this.ariaRowCount="",this.ariaRowIndex="",this.ariaRowSpan="",this.ariaSelected="",this.ariaSetSize="",this.ariaSort="",this.ariaValueMax="",this.ariaValueMin="",this.ariaValueNow="",this.ariaValueText="",this.role="",this.form=null,this.labels=[],this.states=new Set,this.validationMessage="",this.validity={},this.willValidate=!0,this.__host=t}c(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 tK=function e(e,t,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(e,n):i?i.value=n:t.set(e,n),n},tZ=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)},t0,t1,t2,t3,t4,t5,t6,t9,t7,t8,ne,nt,nn=function(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 nr=/*#__PURE__*/function(){"use strict";function e(){s(this,e);this.__eventListeners=new Map,this.__captureEventListeners=new Map}c(e,[{key:"addEventListener",value:function e(e,t,n){var r=this;var i;if(t==null)return;var o=nn(n)?this.__captureEventListeners:this.__eventListeners,a=o.get(e);if(a===void 0)a=new Map,o.set(e,a);else if(a.has(t))return;var s=(typeof n==="undefined"?"undefined":I(n))=="object"&&n?n:{};(i=s.signal)===null||i===void 0?void 0:i.addEventListener("abort",function(){return r.removeEventListener(e,t,n)}),a.set(t,s!==null&&s!==void 0?s:{})}},{key:"removeEventListener",value:function e(e,t,n){if(t==null)return;var r=nn(n)?this.__captureEventListeners:this.__eventListeners,i=r.get(e);i!==void 0&&(i.delete(t),i.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 i=!1,o=!1,a=0,s=null,l=null,u=null,c=e.stopPropagation,h=e.stopImmediatePropagation;Object.defineProperties(e,{target:k({get:function e(){return s!==null&&s!==void 0?s:l}},no),srcElement:k({get:function t(){return e.target}},no),currentTarget:k({get:function e(){return u}},no),eventPhase:k({get:function e(){return a}},no),composedPath:k({value:function(){return n}},no),stopPropagation:k({value:function(){i=!0,c.call(e)}},no),stopImmediatePropagation:k({value:function(){o=!0,h.call(e)}},no)});var d=function(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(){return u=null,a=0,!e.defaultPrevented},p=n.slice().reverse();s=!this.__host||!e.composed?this:null;var v=function(e){for(l=t;l.__host&&e.includes(l.__host);)l=l.__host};var y=true,m=false,g=undefined;try{for(var b=p[Symbol.iterator](),_;!(y=(_=b.next()).done);y=true){var w=_.value;!s&&(!l||l===w.__host)&&v(p.slice(p.indexOf(w))),u=w,a=w===e.target?2:1;var x=w.__captureEventListeners.get(e.type);if(x){var E=true,q=false,A=undefined;try{for(var C=x[Symbol.iterator](),R;!(E=(R=C.next()).done);E=true){var P=S(R.value,2),M=P[0],T=P[1];if(d(M,T,x),o)return f()}}catch(e){q=true;A=e}finally{try{if(!E&&C.return!=null){C.return()}}finally{if(q){throw A}}}}if(i)return f()}}catch(e){m=true;g=e}finally{try{if(!y&&b.return!=null){b.return()}}finally{if(m){throw g}}}var I=e.bubbles?n:[this];l=null;var O=true,N=false,U=undefined;try{for(var L=I[Symbol.iterator](),$;!(O=($=L.next()).done);O=true){var D=$.value;!s&&(!l||D===l.__host)&&v(I.slice(0,I.indexOf(D)+1)),u=D,a=D===e.target?2:3;var V=D.__eventListeners.get(e.type);if(V){var j=true,H=false,Q=undefined;try{for(var F=V[Symbol.iterator](),z;!(j=(z=F.next()).done);j=true){var B=S(z.value,2),W=B[0],J=B[1];if(d(W,J,V),o)return f()}}catch(e){H=true;Q=e}finally{try{if(!j&&F.return!=null){F.return()}}finally{if(H){throw Q}}}}if(i)return f()}}catch(e){N=true;U=e}finally{try{if(!O&&L.return!=null){L.return()}}finally{if(N){throw U}}}return f()}}]);return e}(),ni=nr;var no={__proto__:null};no.enumerable=!0;Object.freeze(no);var na=(t8=/*#__PURE__*/function(){"use strict";function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};s(this,e);if(t0.set(this,!1),t1.set(this,!1),t2.set(this,!1),t3.set(this,!1),t4.set(this,Date.now()),t5.set(this,!1),t6.set(this,void 0),t9.set(this,void 0),t7.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":I(n))!="object"||!n)throw new Error('The "options" argument must be an object');var r=n.bubbles,i=n.cancelable,o=n.composed;tK(this,t0,!!i,"f"),tK(this,t1,!!r,"f"),tK(this,t2,!!o,"f"),tK(this,t6,"".concat(t),"f"),tK(this,t9,null,"f"),tK(this,t7,!1,"f")}c(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(){tK(this,t3,!0,"f")}},{key:"target",get:function e(){return tZ(this,t9,"f")}},{key:"currentTarget",get:function e(){return tZ(this,t9,"f")}},{key:"srcElement",get:function e(){return tZ(this,t9,"f")}},{key:"type",get:function e(){return tZ(this,t6,"f")}},{key:"cancelable",get:function e(){return tZ(this,t0,"f")}},{key:"defaultPrevented",get:function e(){return tZ(this,t0,"f")&&tZ(this,t3,"f")}},{key:"timeStamp",get:function e(){return tZ(this,t4,"f")}},{key:"composedPath",value:function e(){return tZ(this,t7,"f")?[tZ(this,t9,"f")]:[]}},{key:"returnValue",get:function e(){return!tZ(this,t0,"f")||!tZ(this,t3,"f")}},{key:"bubbles",get:function e(){return tZ(this,t1,"f")}},{key:"composed",get:function e(){return tZ(this,t2,"f")}},{key:"eventPhase",get:function e(){return tZ(this,t7,"f")?t8.AT_TARGET:t8.NONE}},{key:"cancelBubble",get:function e(){return tZ(this,t5,"f")},set:function e(e){e&&tK(this,t5,!0,"f")}},{key:"stopPropagation",value:function e(){tK(this,t5,!0,"f")}},{key:"isTrusted",get:function e(){return!1}}]);return e}(),t0=new WeakMap,t1=new WeakMap,t2=new WeakMap,t3=new WeakMap,t4=new WeakMap,t5=new WeakMap,t6=new WeakMap,t9=new WeakMap,t7=new WeakMap,t8.NONE=0,t8.CAPTURING_PHASE=1,t8.AT_TARGET=2,t8.BUBBLING_PHASE=3,t8);Object.defineProperties(na.prototype,{initEvent:no,stopImmediatePropagation:no,preventDefault:no,target:no,currentTarget:no,srcElement:no,type:no,cancelable:no,defaultPrevented:no,timeStamp:no,composedPath:no,returnValue:no,bubbles:no,composed:no,eventPhase:no,cancelBubble:no,stopPropagation:no,isTrusted:no});var ns=(nt=/*#__PURE__*/function(e){"use strict";p(t,e);function t(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};s(this,t);var r;var i;r=a(this,t,[e,n]),ne.set(r,void 0),tK(r,ne,(i=n===null||n===void 0?void 0:n.detail)!==null&&i!==void 0?i:null,"f");return r}c(t,[{key:"initCustomEvent",value:function e(e,t,n,r){throw new Error("Method not implemented.")}},{key:"detail",get:function e(){return tZ(this,ne,"f")}}]);return t}(na),ne=new WeakMap,nt);Object.defineProperties(ns.prototype,{detail:no});var nl=na,nu=ns;var nc;(nc=globalThis.Event)!==null&&nc!==void 0?nc:globalThis.Event=nl;var nh;(nh=globalThis.CustomEvent)!==null&&nh!==void 0?nh:globalThis.CustomEvent=nu;var nd=new WeakMap,nf=function(e){var t=nd.get(e);return t===void 0&&nd.set(e,t=new Map),t},np=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments),e.__shadowRootMode=null,e.__shadowRoot=null,e.__internals=null;return e}c(t,[{key:"attributes",get:function e(){return Array.from(nf(this)).map(function(e){var t=S(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){nf(this).set(e,String(t))}},{key:"removeAttribute",value:function e(e){nf(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 nf(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 tY(this);return this.__internals=e,e}},{key:"getAttribute",value:function e(e){var t;return(t=nf(this).get(e))!==null&&t!==void 0?t:null}}]);return t}(ni);var nv=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}return t}(np),ny=nv;var nm;(nm=globalThis.litServerRoot)!==null&&nm!==void 0?nm:globalThis.litServerRoot=Object.defineProperty(new ny,"localName",{get:function e(){return"lit-server-root"}});var ng=/*#__PURE__*/function(){"use strict";function e(){s(this,e);this.__definitions=new Map}c(e,[{key:"define",value:function e(e,t){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'));var n;t.__localName=e,this.__definitions.set(e,{ctor:t,observedAttributes:(n=t.observedAttributes)!==null&&n!==void 0?n:[]})}},{key:"get",value:function e(e){var t;return(t=this.__definitions.get(e))===null||t===void 0?void 0:t.ctor}}]);return e}(),nb=ng;var n_=new nb;var nk=globalThis,nw=nk.ShadowRoot&&(nk.ShadyCSS===void 0||nk.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,nx=Symbol(),nE=new WeakMap,nq=/*#__PURE__*/function(){"use strict";function e(t,n,r){s(this,e);if(this._$cssResult$=!0,r!==nx)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=n}c(e,[{key:"styleSheet",get:function e(){var e=this.o,t=this.t;if(nw&&e===void 0){var n=t!==void 0&&t.length===1;n&&(e=nE.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&nE.set(t,e))}return e}},{key:"toString",value:function e(){return this.cssText}}]);return e}(),nA=function(e){return new nq(typeof e=="string"?e:e+"",void 0,nx)},nC=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]}var i=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 nq(i,e,nx)},nS=function(e,t){var n=true,r=false,i=undefined;if(nw)e.adoptedStyleSheets=t.map(function(e){return v(e,CSSStyleSheet)?e:e.styleSheet});else try{for(var o=t[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){var s=a.value;var l=document.createElement("style"),u=nk.litNonce;u!==void 0&&l.setAttribute("nonce",u),l.textContent=s.cssText,e.appendChild(l)}}catch(e){r=true;i=e}finally{try{if(!n&&o.return!=null){o.return()}}finally{if(r){throw i}}}},nR=nw||nk.CSSStyleSheet===void 0?function(e){return e}:function(e){return v(e,CSSStyleSheet)?function(e){var t="";var n=true,r=false,i=undefined;try{for(var o=e.cssRules[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){var s=a.value;t+=s.cssText}}catch(e){r=true;i=e}finally{try{if(!n&&o.return!=null){o.return()}}finally{if(r){throw i}}}return nA(t)}(e):e};var nP=Object.is,nM=Object.defineProperty,nT=Object.getOwnPropertyDescriptor,nI=Object.getOwnPropertyNames,nO=Object.getOwnPropertySymbols,nN=Object.getPrototypeOf,nU=globalThis;var nL;(nL=nU.customElements)!==null&&nL!==void 0?nL:nU.customElements=n_;var n$=nU.trustedTypes,nD=n$?n$.emptyScript:"",nV=nU.reactiveElementPolyfillSupport,nj=function(e,t){return e},nH={toAttribute:function e(e,t){switch(t){case Boolean:e=e?nD: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}},nQ=function(e,t){return!nP(e,t)},nF={attribute:!0,type:String,converter:nH,reflect:!1,useDefault:!1,hasChanged:nQ};var nz,nB;(nz=Symbol.metadata)!==null&&nz!==void 0?nz:Symbol.metadata=Symbol("metadata"),(nB=nU.litPropertyMetadata)!==null&&nB!==void 0?nB:nU.litPropertyMetadata=new WeakMap;var nW;var nJ=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t),e._$Ep=void 0,e.isUpdatePending=!1,e.hasUpdated=!1,e._$Em=null,e._$Ev();return e}c(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;((n=this._$EO)!==null&&n!==void 0?n:this._$EO=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)===null||t===void 0?void 0:t.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,i=undefined;try{for(var o=t.keys()[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){var s=a.value;this.hasOwnProperty(s)&&(e.set(s,this[s]),delete this[s])}}catch(e){r=true;i=e}finally{try{if(!n&&o.return!=null){o.return()}}finally{if(r){throw i}}}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 nS(t,this.constructor.elementStyles),t}},{key:"connectedCallback",value:function e(){var e;var t;(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(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 i;var o=(((i=n.converter)===null||i===void 0?void 0:i.toAttribute)!==void 0?n.converter:nH).toAttribute(t,n.type);this._$Em=e,o==null?this.removeAttribute(r):this.setAttribute(r,o),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 i,o;var a=n.getPropertyOptions(r),s=typeof a.converter=="function"?{fromAttribute:a.converter}:((i=a.converter)===null||i===void 0?void 0:i.fromAttribute)!==void 0?a.converter:nH;var l,u;this._$Em=r,this[r]=(u=(l=s.fromAttribute(t,a.type))!==null&&l!==void 0?l:(o=this._$Ej)===null||o===void 0?void 0:o.get(r))!==null&&u!==void 0?u:null,this._$Em=null}}},{key:"requestUpdate",value:function e(e,t,n){if(e!==void 0){var r;var i=this.constructor,o=this[e];var a;if(n!==null&&n!==void 0?n:n=i.getPropertyOptions(e),!(((a=n.hasChanged)!==null&&a!==void 0?a:nQ)(o,t)||n.useDefault&&n.reflect&&o===((r=this._$Ej)===null||r===void 0?void 0:r.get(e))&&!this.hasAttribute(i._$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 i=n.useDefault,o=n.reflect,a=n.wrapped;var s,l,u;i&&!((s=this._$Ej)!==null&&s!==void 0?s:this._$Ej=new Map).has(e)&&(this._$Ej.set(e,(l=r!==null&&r!==void 0?r:t)!==null&&l!==void 0?l:this[e]),a!==!0||r!==void 0)||(this._$AL.has(e)||(this.hasUpdated||i||(t=void 0),this._$AL.set(e,t)),o===!0&&this._$Em!==e&&((u=this._$Eq)!==null&&u!==void 0?u:this._$Eq=new Set).add(e))}},{key:"_$EP",value:function e(){return o(function(){var e,t,n;return L(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 i=this._$Ep[Symbol.iterator](),o;!(t=(o=i.next()).done);t=true){var a=S(o.value,2),s=a[0],l=a[1];this[s]=l}}catch(e){n=true;r=e}finally{try{if(!t&&i.return!=null){i.return()}}finally{if(n){throw r}}}this._$Ep=void 0}var u=this.constructor.elementProperties;var c=true,h=false,d=undefined;if(u.size>0)try{for(var f=u[Symbol.iterator](),p;!(c=(p=f.next()).done);c=true){var v=S(p.value,2),y=v[0],m=v[1];var g=m.wrapped,b=this[y];g!==!0||this._$AL.has(y)||b===void 0||this.C(y,void 0,m,b)}}catch(e){h=true;d=e}finally{try{if(!c&&f.return!=null){f.return()}}finally{if(h){throw d}}}}var _=!1,k=this._$AL;try{var w;_=this.shouldUpdate(k),_?(this.willUpdate(k),(w=this._$EO)===null||w===void 0?void 0:w.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 _=!1,this._$EM(),e}_&&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&&T(this._$Eh.keys())}},{key:"createProperty",value:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:nF;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&&nM(this.prototype,e,r)}}},{key:"getPropertyDescriptor",value:function e(e,t,n){var r;var i=(r=nT(this.prototype,e))!==null&&r!==void 0?r:{get:function e(){return this[t]},set:function e(e){this[t]=e}},o=i.get,a=i.set;return{get:o,set:function t(t){var r=o===null||o===void 0?void 0:o.call(this);a===null||a===void 0?void 0:a.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:nF}},{key:"_$Ei",value:function e(){if(this.hasOwnProperty(nj("elementProperties")))return;var e=nN(this);e.finalize(),e.l!==void 0&&(this.l=T(e.l)),this.elementProperties=new Map(e.elementProperties)}},{key:"finalize",value:function e(){if(this.hasOwnProperty(nj("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(nj("properties"))){var e=this.properties,t=T(nI(e)).concat(T(nO(e)));var n=true,r=false,i=undefined;try{for(var o=t[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){var s=a.value;this.createProperty(s,e[s])}}catch(e){r=true;i=e}finally{try{if(!n&&o.return!=null){o.return()}}finally{if(r){throw i}}}}var l=this[Symbol.metadata];if(l!==null){var u=litPropertyMetadata.get(l);var c=true,h=false,d=undefined;if(u!==void 0)try{for(var f=u[Symbol.iterator](),p;!(c=(p=f.next()).done);c=true){var v=S(p.value,2),y=v[0],m=v[1];this.elementProperties.set(y,m)}}catch(e){h=true;d=e}finally{try{if(!c&&f.return!=null){f.return()}}finally{if(h){throw d}}}}this._$Eh=new Map;var g=true,b=false,_=undefined;try{for(var k=this.elementProperties[Symbol.iterator](),w;!(g=(w=k.next()).done);g=true){var x=S(w.value,2),E=x[0],q=x[1];var A=this._$Eu(E,q);A!==void 0&&this._$Eh.set(A,E)}}catch(e){b=true;_=e}finally{try{if(!g&&k.return!=null){k.return()}}finally{if(b){throw _}}}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,i=false,o=undefined;try{for(var a=n[Symbol.iterator](),s;!(r=(s=a.next()).done);r=true){var l=s.value;t.unshift(nR(l))}}catch(e){i=true;o=e}finally{try{if(!r&&a.return!=null){a.return()}}finally{if(i){throw o}}}}else e!==void 0&&t.push(nR(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}((nW=globalThis.HTMLElement)!==null&&nW!==void 0?nW:ny);var nG;nJ.elementStyles=[],nJ.shadowRootOptions={mode:"open"},nJ[nj("elementProperties")]=new Map,nJ[nj("finalized")]=new Map,nV===null||nV===void 0?void 0:nV({ReactiveElement:nJ}),((nG=nU.reactiveElementVersions)!==null&&nG!==void 0?nG:nU.reactiveElementVersions=[]).push("2.1.0");var nX=globalThis,nY=nX.trustedTypes,nK=nY?nY.createPolicy("lit-html",{createHTML:function(e){return e}}):void 0,nZ="$lit$",n0="lit$".concat(Math.random().toFixed(9).slice(2),"$"),n1="?"+n0,n2="<".concat(n1,">"),n3=nX.document===void 0?{createTreeWalker:function(){return{}}}:document,n4=function(){return n3.createComment("")},n5=function(e){return e===null||(typeof e==="undefined"?"undefined":I(e))!="object"&&typeof e!="function"},n6=Array.isArray,n9=function(e){return n6(e)||typeof(e===null||e===void 0?void 0:e[Symbol.iterator])=="function"},n7="[ \n\f\r]",n8=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,re=/-->/g,rt=/>/g,rn=RegExp(">|".concat(n7,"(?:([^\\s\"'>=/]+)(").concat(n7,"*=").concat(n7,"*(?:[^ \n\f\r\"'`<>=]|(\"|')|))|$)"),"g"),rr=/'/g,ri=/"/g,ro=/^(?:script|style|textarea|title)$/i,ra=function(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++){r[i-1]=arguments[i]}return{_$litType$:e,strings:t,values:r}}},rs=ra(1),rl=ra(2),ru=ra(3),rc=Symbol.for("lit-noChange"),rh=Symbol.for("lit-nothing"),rd=new WeakMap,rf=n3.createTreeWalker(n3,129);var rp=function(e,t){var r=e.length-1,i=[],o,a=t===2?"<svg>":t===3?"<math>":"",s=n8;for(var l=0;l<r;l++){var u=e[l],c=void 0,h=void 0,d=-1,f=0;for(;f<u.length&&(s.lastIndex=f,h=s.exec(u),h!==null);)f=s.lastIndex,s===n8?h[1]==="!--"?s=re:h[1]!==void 0?s=rt:h[2]!==void 0?(ro.test(h[2])&&(o=RegExp("</"+h[2],"g")),s=rn):h[3]!==void 0&&(s=rn):s===rn?h[0]===">"?(s=o!==null&&o!==void 0?o:n8,d=-1):h[1]===void 0?d=-2:(d=s.lastIndex-h[2].length,c=h[1],s=h[3]===void 0?rn:h[3]==='"'?ri:rr):s===ri||s===rr?s=rn:s===re||s===rt?s=n8:(s=rn,o=void 0);var p=s===rn&&e[l+1].startsWith("/>")?" ":"";a+=s===n8?u+n2:d>=0?(i.push(c),u.slice(0,d)+nZ+u.slice(d)+n0+p):u+n0+(d===-2?l:p)}return[n(e,a+(e[r]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),i]},rv=/*#__PURE__*/function(){"use strict";function e(t,n){var r=t.strings,i=t._$litType$;s(this,e);var o;this.parts=[];var a=0,l=0,u=r.length-1,c=this.parts,h=S(rp(r,i),2),d=h[0],f=h[1];if(this.el=e.createElement(d,n),rf.currentNode=this.el.content,i===2||i===3){var p;var v=this.el.content.firstChild;(p=v).replaceWith.apply(p,T(v.childNodes))}for(;(o=rf.nextNode())!==null&&c.length<u;){if(o.nodeType===1){var y=true,m=false,g=undefined;if(o.hasAttributes())try{for(var b=o.getAttributeNames()[Symbol.iterator](),_;!(y=(_=b.next()).done);y=true){var k=_.value;if(k.endsWith(nZ)){var w=f[l++],x=o.getAttribute(k).split(n0),E=/([.?@])?(.*)/.exec(w);c.push({type:1,index:a,name:E[2],strings:x,ctor:E[1]==="."?r_:E[1]==="?"?rk:E[1]==="@"?rw:rb}),o.removeAttribute(k)}else k.startsWith(n0)&&(c.push({type:6,index:a}),o.removeAttribute(k))}}catch(e){m=true;g=e}finally{try{if(!y&&b.return!=null){b.return()}}finally{if(m){throw g}}}if(ro.test(o.tagName)){var q=o.textContent.split(n0),A=q.length-1;if(A>0){o.textContent=nY?nY.emptyScript:"";for(var C=0;C<A;C++)o.append(q[C],n4()),rf.nextNode(),c.push({type:2,index:++a});o.append(q[A],n4())}}}else if(o.nodeType===8)if(o.data===n1)c.push({type:2,index:a});else{var R=-1;for(;(R=o.data.indexOf(n0,R+1))!==-1;)c.push({type:7,index:a}),R+=n0.length-1}a++}}c(e,null,[{key:"createElement",value:function e(e,t){var n=n3.createElement("template");return n.innerHTML=e,n}}]);return e}();function ry(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e,r=arguments.length>3?arguments[3]:void 0;var i,o;if(t===rc)return t;var a=r!==void 0?(i=n._$Co)===null||i===void 0?void 0:i[r]:n._$Cl,s=n5(t)?void 0:t._$litDirective$;var l;return(a===null||a===void 0?void 0:a.constructor)!==s&&(a===null||a===void 0?void 0:(o=a._$AO)===null||o===void 0?void 0:o.call(a,!1),s===void 0?a=void 0:(a=new s(e),a._$AT(e,n,r)),r!==void 0?((l=n._$Co)!==null&&l!==void 0?l:n._$Co=[])[r]=a:n._$Cl=a),a!==void 0&&(t=ry(e,a._$AS(e,t.values),a,r)),t}var rm=/*#__PURE__*/function(){"use strict";function e(t,n){s(this,e);this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=n}c(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,i=r.content,o=n.parts,a=((t=e===null||e===void 0?void 0:e.creationScope)!==null&&t!==void 0?t:n3).importNode(i,!0);rf.currentNode=a;var s=rf.nextNode(),l=0,u=0,c=o[0];for(;c!==void 0;){if(l===c.index){var h=void 0;c.type===2?h=new rg(s,s.nextSibling,this,e):c.type===1?h=new c.ctor(s,c.name,c.strings,this,e):c.type===6&&(h=new rx(s,this,e)),this._$AV.push(h),c=o[++u]}l!==(c===null||c===void 0?void 0:c.index)&&(s=rf.nextNode(),l++)}return rf.currentNode=n3,a}},{key:"p",value:function e(e){var t=0;var n=true,r=false,i=undefined;try{for(var o=this._$AV[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){var s=a.value;s!==void 0&&(s.strings!==void 0?(s._$AI(e,s,t),t+=s.strings.length-2):s._$AI(e[t])),t++}}catch(e){r=true;i=e}finally{try{if(!n&&o.return!=null){o.return()}}finally{if(r){throw i}}}}}]);return e}(),rg=/*#__PURE__*/function(){"use strict";function e(t,n,r,i){s(this,e);var o;this.type=2,this._$AH=rh,this._$AN=void 0,this._$AA=t,this._$AB=n,this._$AM=r,this.options=i,this._$Cv=(o=i===null||i===void 0?void 0:i.isConnected)!==null&&o!==void 0?o:!0}c(e,[{key:"_$AU",get:function e(){var e;var t;return(t=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&t!==void 0?t: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=ry(this,e,t),n5(e)?e===rh||e==null||e===""?(this._$AH!==rh&&this._$AR(),this._$AH=rh):e!==this._$AH&&e!==rc&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):n9(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!==rh&&n5(this._$AH)?this._$AA.nextSibling.data=e:this.T(n3.createTextNode(e)),this._$AH=e}},{key:"$",value:function e(e){var t;var r=e.values,i=e._$litType$,o=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=rv.createElement(n(i.h,i.h[0]),this.options)),i);if(((t=this._$AH)===null||t===void 0?void 0:t._$AD)===o)this._$AH.p(r);else{var a=new rm(o,this),s=a.u(this.options);a.p(r),this.T(s),this._$AH=a}}},{key:"_$AC",value:function e(e){var t=rd.get(e.strings);return t===void 0&&rd.set(e.strings,t=new rv(e)),t}},{key:"k",value:function t(t){n6(this._$AH)||(this._$AH=[],this._$AR());var n=this._$AH,r,i=0;var o=true,a=false,s=undefined;try{for(var l=t[Symbol.iterator](),u;!(o=(u=l.next()).done);o=true){var c=u.value;i===n.length?n.push(r=new e(this.O(n4()),this.O(n4()),this,this.options)):r=n[i],r._$AI(c),i++}}catch(e){a=true;s=e}finally{try{if(!o&&l.return!=null){l.return()}}finally{if(a){throw s}}}i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}},{key:"_$AR",value:function 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&&e!==this._$AB;){var i=e.nextSibling;e.remove(),e=i}}},{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}(),rb=/*#__PURE__*/function(){"use strict";function e(t,n,r,i,o){s(this,e);this.type=1,this._$AH=rh,this._$AN=void 0,this.element=t,this.name=n,this._$AM=i,this.options=o,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=rh}c(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 i=this.strings,o=!1;if(i===void 0)e=ry(this,e,t,0),o=!n5(e)||e!==this._$AH&&e!==rc,o&&(this._$AH=e);else{var a=e,s,l;for(e=i[0],s=0;s<i.length-1;s++)l=ry(this,a[n+s],t,s),l===rc&&(l=this._$AH[s]),o||(o=!n5(l)||l!==this._$AH[s]),l===rh?e=rh:e!==rh&&(e+=(l!==null&&l!==void 0?l:"")+i[s+1]),this._$AH[s]=l}o&&!r&&this.j(e)}},{key:"j",value:function e(e){e===rh?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e!==null&&e!==void 0?e:"")}}]);return e}(),r_=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments),e.type=3;return e}c(t,[{key:"j",value:function e(e){this.element[this.name]=e===rh?void 0:e}}]);return t}(rb),rk=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments),e.type=4;return e}c(t,[{key:"j",value:function e(e){this.element.toggleAttribute(this.name,!!e&&e!==rh)}}]);return t}(rb),rw=/*#__PURE__*/function(e){"use strict";p(t,e);function t(e,n,r,i,o){s(this,t);var l;l=a(this,t,[e,n,r,i,o]),l.type=5;return l}c(t,[{key:"_$AI",value:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this;var n;if((e=(n=ry(this,e,t,0))!==null&&n!==void 0?n:rh)===rc)return;var r=this._$AH,i=e===rh&&r!==rh||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,o=e!==rh&&(r===rh||i);i&&this.element.removeEventListener(this.name,this,r),o&&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((n=(t=this.options)===null||t===void 0?void 0:t.host)!==null&&n!==void 0?n:this.element,e):this._$AH.handleEvent(e)}}]);return t}(rb),rx=/*#__PURE__*/function(){"use strict";function e(t,n,r){s(this,e);this.element=t,this.type=6,this._$AN=void 0,this._$AM=n,this.options=r}c(e,[{key:"_$AU",get:function e(){return this._$AM._$AU}},{key:"_$AI",value:function e(e){ry(this,e)}}]);return e}(),rE={M:nZ,P:n0,A:n1,C:1,L:rp,R:rm,D:n9,V:ry,I:rg,H:rb,N:rk,U:rw,B:r_,F:rx},rq=nX.litHtmlPolyfillSupport;var rA;rq===null||rq===void 0?void 0:rq(rv,rg),((rA=nX.litHtmlVersions)!==null&&rA!==void 0?rA:nX.litHtmlVersions=[]).push("3.3.0");var rC=function(e,t,n){var r;var i=(r=n===null||n===void 0?void 0:n.renderBefore)!==null&&r!==void 0?r:t,o=i._$litPart$;if(o===void 0){var a;var s=(a=n===null||n===void 0?void 0:n.renderBefore)!==null&&a!==void 0?a:null;i._$litPart$=o=new rg(t.insertBefore(n4(),s),s,void 0,n!==null&&n!==void 0?n:{})}return o._$AI(e),o};var rS=globalThis,rR=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments),e.renderOptions={host:e},e._$Do=void 0;return e}c(t,[{key:"createRenderRoot",value:function e(){var e;var n=d(f(t.prototype),"createRenderRoot",this).call(this);var r;return(r=(e=this.renderOptions).renderBefore)!==null&&r!==void 0?r:e.renderBefore=n.firstChild,n}},{key:"update",value:function e(e){var n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),d(f(t.prototype),"update",this).call(this,e),this._$Do=rC(n,this.renderRoot,this.renderOptions)}},{key:"connectedCallback",value:function e(){var e;d(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;d(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 rc}}]);return t}(nJ);rR._$litElement$=!0,rR.finalized=!0,(tU=rS.litElementHydrateSupport)===null||tU===void 0?void 0:tU.call(rS,{LitElement:rR});var rP=rS.litElementPolyfillSupport;rP===null||rP===void 0?void 0:rP({LitElement:rR});var rM;((rM=rS.litElementVersions)!==null&&rM!==void 0?rM:rS.litElementVersions=[]).push("4.2.0");var rT=function(e){return function(t,n){n!==void 0?n.addInitializer(function(){customElements.define(e,t)}):customElements.define(e,t)}};var rI={attribute:!0,type:String,converter:nH,reflect:!1,hasChanged:nQ},rO=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:rI,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;var r=n.kind,i=n.metadata,o=globalThis.litPropertyMetadata.get(i);if(o===void 0&&globalThis.litPropertyMetadata.set(i,o=new Map),r==="setter"&&((e=Object.create(e)).wrapped=!0),o.set(n.name,e),r==="accessor"){var a=n.name;return{set:function n(n){var r=t.get.call(this);t.set.call(this,n),this.requestUpdate(a,r,e)},init:function t(t){return t!==void 0&&this.C(a,void 0,e,t),t}}}if(r==="setter"){var s=n.name;return function n(n){var r=this[s];t.call(this,n),this.requestUpdate(s,r,e)}}throw Error("Unsupported decorator location: "+r)};var rN=function(e,t,n){return n.configurable=!0,n.enumerable=!0,Reflect.decorate&&(typeof t==="undefined"?"undefined":I(t))!="object"&&Object.defineProperty(e,t,n),n};var rU=Symbol("item");var rL=[{identifier:"completionStatus",cardinality:"single",baseType:"string",value:"unknown",type:"outcome"},{identifier:"numAttempts",cardinality:"single",baseType:"integer",value:"0",type:"response"}];var r$=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e._templateProcessing=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:rL};e._initialContext=x(k({},e._context),{variables:e._context.variables});e._feedbackElements=[];e._interactionElements=[];e._handleRegisterVariable=function(t){t.stopImmediatePropagation(),e._context=x(k({},e._context),{variables:T(e._context.variables).concat([t.detail.variable])}),e._initialContext=e._context,t.stopPropagation()};e._handleRegisterFeedback=function(t){var n;t.stopImmediatePropagation();var r=t.detail;e._feedbackElements.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)};e._handleRegisterInteraction=function(t){t.stopImmediatePropagation(),e._interactionElements.push(t.detail.interactionElement)};e._handleEndAttempt=function(t){t.stopImmediatePropagation();var n=t.detail,r=n.responseIdentifier,i=n.countAttempt;e.validate(),e.updateResponseVariable(r,"true"),e.processResponse(i)};e._handleSetOutcomeValue=function(t){t.stopImmediatePropagation();var n=t.detail,r=n.outcomeIdentifier,i=n.value;e.updateOutcomeVariable(r,i),t.stopPropagation()};e._handleUpdateResponseVariable=function(t){t.stopImmediatePropagation();var n=t.detail,r=n.responseIdentifier,i=n.response;e.updateResponseVariable(r,i),e.dispatchEvent(new CustomEvent("qti-item-context-updated",{bubbles:!0,composed:!0,detail:{itemContext:e._context}}))};return e}c(t,[{key:"title",get:function e(){return this._itemTitle},set:function e(e){this._itemTitle=e,this.removeAttribute("title"),this.setAttribute("data-title",e)}},{key:"assessmentItemRefId",get:function e(){return this._context.identifier},set:function e(e){this._context=x(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=x(k({},this._context),{variables:this._context.variables.map(function(t){var n=e.find(function(e){return e.identifier===t.identifier});return n?x(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"&&t._feedbackElements.forEach(function(t){return t.checkShowFeedback(e.identifier)})})}},{key:"responses",set:function e(e){var t=true,n=false,r=undefined;if(e)try{var i,o=function(){var e=s.value;i.getResponse(e.responseIdentifier)&&i.updateResponseVariable(e.responseIdentifier,e.response);var t=i._interactionElements.find(function(t){return t.getAttribute("response-identifier")===e.responseIdentifier});t&&(t.response=e.response)};for(var a=e[Symbol.iterator](),s;!(t=(s=a.next()).done);t=true)i=this,o()}catch(e){n=true;r=e}finally{try{if(!t&&a.return!=null){a.return()}}finally{if(n){throw r}}}}},{key:"render",value:function e(){return rs(D())}},{key:"connectedCallback",value:function e(){var e=this;this._attachEventListeners(),d(f(t.prototype),"connectedCallback",this).call(this),this.updateComplete.then(function(){e._processTemplates(),e.dispatchEvent(new CustomEvent("qti-assessment-item-connected",{bubbles:!0,composed:!0,detail:e}))})}},{key:"disconnectedCallback",value:function e(){this._removeEventListeners(),d(f(t.prototype),"disconnectedCallback",this).call(this)}},{key:"_attachEventListeners",value:function e(){this.addEventListener("qti-register-variable",this._handleRegisterVariable),this.addEventListener("qti-register-feedback",this._handleRegisterFeedback),this.addEventListener("qti-register-interaction",this._handleRegisterInteraction),this.addEventListener("end-attempt",this._handleEndAttempt),this.addEventListener("qti-set-outcome-value",this._handleSetOutcomeValue),this.addEventListener("qti-interaction-response",this._handleUpdateResponseVariable)}},{key:"_removeEventListeners",value:function e(){this.removeEventListener("qti-register-variable",this._handleRegisterVariable),this.removeEventListener("qti-register-feedback",this._handleRegisterFeedback),this.removeEventListener("qti-register-interaction",this._handleRegisterInteraction),this.removeEventListener("end-attempt",this._handleEndAttempt),this.removeEventListener("qti-set-outcome-value",this._handleSetOutcomeValue),this.removeEventListener("qti-interaction-response",this._handleUpdateResponseVariable)}},{key:"showCorrectResponse",value:function e(e){var t=this._context.variables.filter(function(e){return e.type==="response"});var n=true,r=false,i=undefined;try{var o=function(){var n=s.value;var r=n.getAttribute("response-identifier"),i=t.find(function(e){return e.identifier===r});i&&n.toggleCorrectResponse(i,e)};for(var a=this._interactionElements[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true)o()}catch(e){r=true;i=e}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(r){throw i}}}document.querySelectorAll("item-show-correct-response").forEach(function(t){t.shown=e})}},{key:"showCandidateCorrection",value:function e(e){var t=this._context.variables.filter(function(e){return e.type==="response"});var n=true,r=false,i=undefined;try{var o=function(){var n=s.value;var r=n.getAttribute("response-identifier"),i=t.find(function(e){return e.identifier===r});i&&n.toggleCandidateCorrection(i,e)};for(var a=this._interactionElements[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true)o()}catch(e){r=true;i=e}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(r){throw i}}}document.querySelectorAll("item-show-candidate-correction").forEach(function(t){t.shown=e})}},{key:"_processTemplates",value:function e(){this._templateProcessing=this.querySelector("qti-template-processing"),this._templateProcessing&&this._templateProcessing.process()}},{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());var r=this.querySelector("qti-response-processing");return!r||!r.process?!1:(r.process(),this.adaptive==="false"&&this.updateOutcomeVariable("completionStatus",this._getCompletionStatus()),this.dispatchEvent(new CustomEvent("qti-item-context-updated",{bubbles:!0,composed:!0,detail:{itemContext:this._context}})),!0)}},{key:"resetResponses",value:function e(){this._context=this._initialContext}},{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:"updateResponseVariable",value:function e(e,t){this._context=x(k({},this._context),{variables:this._context.variables.map(function(n){return n.identifier!==e?n:x(k({},n),{value:t})})}),this.showCandidateCorrection(!1),this.dispatchEvent(new CustomEvent("qti-interaction-changed",{bubbles:!0,composed:!0,detail:{item:this.identifier,responseIdentifier:e,response:Array.isArray(t)?T(t):t}})),this.adaptive==="false"&&this.updateOutcomeVariable("completionStatus",this._getCompletionStatus())}},{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=x(k({},this._context),{variables:this._context.variables.map(function(n){return n.identifier!==e?n:x(k({},n),{value:r.cardinality==="single"||Array.isArray(t)?t:[t]})})}),this._feedbackElements.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](),i;!(e=(i=r.next()).done);e=true){var o=i.value;o.reportValidity()}}catch(e){t=true;n=e}finally{try{if(!e&&r.return!=null){r.return()}}finally{if(t){throw n}}}}},{key:"_getCompletionStatus",value:function e(){var e=this.validate(!1);return e===!0?"completed":e===!1?"incomplete":"not_attempted"}}]);return t}(rR);tF([r({type:String})],r$.prototype,"identifier",2),tF([r({type:String})],r$.prototype,"adaptive",2),tF([r({type:String})],r$.prototype,"timeDependent",2),tF([r({type:String})],r$.prototype,"title",1),tF([r({type:Boolean})],r$.prototype,"disabled",2),tF([m("disabled",{waitUntilFirstUpdate:!0})],r$.prototype,"_handleDisabledChange",2),tF([r({type:Boolean})],r$.prototype,"readonly",2),tF([m("readonly",{waitUntilFirstUpdate:!0})],r$.prototype,"_handleReadonlyChange",2),tF([e({context:rU})],r$.prototype,"_context",2),r$=tF([rT("qti-assessment-item")],r$);var rD=String.raw,rV=rD(V());var rj=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;var t,n="",r={load:function i(i){n=i;var o=encodeURI(i);if(e&&sessionStorage.getItem(o))return{promise:Promise.resolve(r.parse(sessionStorage.getItem(o))),request:null};var a=w(i),s=a.promise,l=a.xhr;return{promise:new Promise(function(n){s.then(function(i){return t=i,r.shuffleInteractions(),e&&sessionStorage.setItem(o,new XMLSerializer().serializeToString(t)),n(r)})}),request:l}},parse:function e(e){return t=E(e),r},path:function(e){return C(t,e),n=null,r},fn:function e(e){return e(t),r},pciHooks:function e(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 r=t.getAttribute(n);!r.startsWith("data:")&&!r.startsWith("http")&&(t.setAttribute("base-url",e),t.setAttribute("module",i+"/"+encodeURI(r+(r.endsWith(".js")?"":".js"))))})};for(var u=n[Symbol.iterator](),c;!(o=(c=u.next()).done);o=true)l()}catch(e){a=true;s=e}finally{try{if(!o&&u.return!=null){u.return()}}finally{if(a){throw s}}}return r},configurePci:function e(e,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"qti-portable-custom-interaction";return o(function(){var o,a,s,l,u,c,h,d,f,p,v,y,m,g,b,_,k,w,x,E,q,A,C,S,R,P,M,T,I,O,N,U,$;return L(this,function(P){switch(P.label){case 0:o=[],a=t.querySelectorAll(i);return[4,n(e,"/modules/module_resolution.js")];case 1:s=P.sent();return[4,n(e,"/modules/fallback_module_resolution.js")];case 2:l=P.sent();u=true,c=false,h=undefined;if(!(a.length>0))return[3,14];P.label=3;case 3:P.trys.push([3,12,13,14]);d=Array.from(a)[Symbol.iterator]();P.label=4;case 4:if(!!(u=(f=d.next()).done))return[3,11];p=f.value;p.setAttribute("data-base-url",e);v=p.getAttribute("custom-interaction-type-identifier");v&&o.includes(v)&&(v=v+o.length,p.setAttribute("custom-interaction-type-identifier",v),o.push(v)),v&&o.push(v);y=p.querySelector("qti-interaction-modules");if(!(y&&y.getAttribute("primary-configuration")))return[3,9];m=y.getAttribute("primary-configuration");if(!m)return[3,8];P.label=5;case 5:P.trys.push([5,7,,8]);return[4,n(e,"/".concat(m))];case 6:g=P.sent(),b=Array.from(y.querySelectorAll("qti-interaction-module"));_=true,k=false,w=undefined;try{for(x=b[Symbol.iterator]();!(_=(E=x.next()).done);_=true){q=E.value;A=q.getAttribute("id");if(A&&g.paths&&g.paths[A]){C=g.paths[A],S=Array.isArray(C)?C[0]:C;if(q.setAttribute("primary-path",S),l&&l.paths&&l.paths[A]){R=l.paths[A];Array.isArray(R)?q.setAttribute("fallback-path",R[0]):q.setAttribute("fallback-path",R)}}}}catch(e){k=true;w=e}finally{try{if(!_&&x.return!=null){x.return()}}finally{if(k){throw w}}}if(g.paths){for(var U in g.paths)if(!y.querySelector('qti-interaction-module[id="'.concat(U,'"]'))){M=t.createElement("qti-interaction-module");M.setAttribute("id",U);T=Array.isArray(g.paths[U])?g.paths[U][0]:g.paths[U];if(M.setAttribute("primary-path",T),l&&l.paths&&l.paths[U]){I=l.paths[U];Array.isArray(I)?M.setAttribute("fallback-path",I[0]):M.setAttribute("fallback-path",I)}y.appendChild(M)}}g.urlArgs&&y.setAttribute("url-args",g.urlArgs);return[3,8];case 7:O=P.sent();console.warn("Failed to load primary configuration: ".concat(m),O);return[3,8];case 8:return[3,10];case 9:if(s){N=function(e){var n=s.paths[e],r="";l&&l.paths&&l.paths[e]&&(r=l.paths[e]);var i=Array.isArray(n)?n:[n],o=Array.isArray(r)?r:[r],a=i.map(function(e,t){var n=o.length>t?o[t]:"";return{primaryPath:e,fallbackPath:n}});var u=true,c=false,h=undefined;try{var d=function(){var e=p.value;a.some(function(t){return t.fallbackPath===e})||a.push({primaryPath:i.length>0?i[0]:e,fallbackPath:e})};for(var f=o[Symbol.iterator](),p;!(u=(p=f.next()).done);u=true)d()}catch(e){c=true;h=e}finally{try{if(!u&&f.return!=null){f.return()}}finally{if(c){throw h}}}var v=true,m=false,g=undefined;try{for(var b=a[Symbol.iterator](),_;!(v=(_=b.next()).done);v=true){var k=_.value;var w=t.createElement("qti-interaction-module");k.fallbackPath&&w.setAttribute("fallback-path",k.fallbackPath),w.setAttribute("id",e),w.setAttribute("primary-path",k.primaryPath),y&&y.appendChild(w)}}catch(e){m=true;g=e}finally{try{if(!v&&b.return!=null){b.return()}}finally{if(m){throw g}}}};p.querySelector("qti-interaction-modules")===null?(y=t.createElement("qti-interaction-modules"),p.appendChild(y)):y=p.querySelector("qti-interaction-modules");for(var L in s.paths)N(L)}P.label=10;case 10:u=true;return[3,4];case 11:return[3,14];case 12:$=P.sent();c=true;h=$;return[3,14];case 13:try{if(!u&&d.return!=null){d.return()}}finally{if(c){throw h}}return[7];case 14:return[2,r]}})})()},shuffleInteractions:function e(){var e=t.querySelectorAll('[shuffle="true"]'),n=Array.from(e).filter(function(e){var t;return(t=e.tagName)===null||t===void 0?void 0:t.toLowerCase().endsWith("-interaction")});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=O(u.tagName.toLowerCase()),h=Array.isArray(c)?c:[c];var d=true,f=false,p=undefined;try{var v=function(){var e=m.value;var t;var n=Array.from(u.querySelectorAll(e)),i=n.map(function(e,t){return{element:e,fixed:e.hasAttribute("fixed")&&e.getAttribute("fixed")==="true",originalOrder:t}}).filter(function(e){return e.fixed}),o=n.filter(function(e){return!e.hasAttribute("fixed")||e.getAttribute("fixed")!=="true"});if(o.length<=1)return{v:(console.warn("Shuffling is not possible with fewer than 2 non-fixed elements."),r)};var a=T(o),s=!1,l=0;for(;!s&&l<20;){l++;for(var c=o.length-1;c>0;c--){var h=Math.floor(Math.random()*(c+1));var d;d=[o[h],o[c]],o[c]=d[0],o[h]=d[1],d}s=!o.every(function(e,t){return e===a[t]})}if(!s)return{v:(console.warn("Failed to shuffle the choices after multiple attempts."),null)};u.removeAttribute("shuffle");var f=0;var p=true,v=false,y=undefined;try{for(var g=o[Symbol.iterator](),b;!(p=(b=g.next()).done);p=true){var _=b.value;_.parentElement.insertBefore(_,(t=i[f])===null||t===void 0?void 0:t.element),f++}}catch(e){v=true;y=e}finally{try{if(!p&&g.return!=null){g.return()}}finally{if(v){throw y}}}var k=true,w=false,x=undefined;try{for(var E=i[Symbol.iterator](),q;!(k=(q=E.next()).done);k=true){var A=q.value;A.element.parentElement.insertBefore(A.element,o[A.originalOrder])}}catch(e){w=true;x=e}finally{try{if(!k&&E.return!=null){E.return()}}finally{if(w){throw x}}}};for(var y=h[Symbol.iterator](),m;!(d=(m=y.next()).done);d=true){var g=v();if(I(g)==="object")return g.v}}catch(e){f=true;p=e}finally{try{if(!d&&y.return!=null){y.return()}}finally{if(f){throw p}}}}}catch(e){o=true;a=e}finally{try{if(!i&&s.return!=null){s.return()}}finally{if(o){throw a}}}return r},extendElementName:function(e,n){return g(t,e,n),r},extendElementsWithClass:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"extend";return b(t,e),r},customInteraction:function e(e,n){var i=t.querySelector("qti-custom-interaction"),o=i.querySelector("object");return i.setAttribute("data-base-ref",e),i.setAttribute("data-base-item",e+n),i.setAttribute("data",o.getAttribute("data")),i.setAttribute("width",o.getAttribute("width")),i.setAttribute("height",o.getAttribute("height")),i.removeChild(o),r},convertCDATAtoComment:function e(){return R(t),r},stripStyleSheets:function e(){return P(t),r},html:function e(){return n!==null&&C(t,n.substring(0,n.lastIndexOf("/"))),new XMLSerializer().serializeToString(q(t))},xml:function e(){return new XMLSerializer().serializeToString(t)},htmlDoc:function e(){return n!==null&&C(t,n.substring(0,n.lastIndexOf("/"))),q(t)},xmlDoc:function e(){return t}};return r};var rH=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e.identifier="";e.href="";return e}c(t,[{key:"connectedCallback",value:function e(){var e=this;var n=this,r=function(){return d(f(t.prototype),"connectedCallback",e)};return o(function(){var e,t,i;return L(this,function(o){switch(o.label){case 0:r().call(n);e=new Event("qti-assessment-stimulus-ref-connected",{cancelable:!0,bubbles:!0,composed:!0});if(!this.dispatchEvent(e))return[3,4];t=this.closest("qti-assessment-item").querySelector("[data-stimulus-idref=".concat(this.identifier,"]"));if(!t)return[3,2];return[4,this.updateStimulusRef(t)];case 1:i=o.sent();return[3,3];case 2:i=console.warn("Stimulus with data-stimulus-idref ".concat(this.identifier," not found"));o.label=3;case 3:i;o.label=4;case 4:return[2]}})}).call(this)}},{key:"updateStimulusRef",value:function e(e){return o(function(){var t,n,r;return L(this,function(i){switch(i.label){case 0:return[4,rj().load(this.href).promise.then(function(e){return e.htmlDoc()})];case 1:t=i.sent();if(t){;r=t.querySelectorAll("qti-stimulus-body, qti-stylesheet");e.innerHTML="",(n=e).append.apply(n,T(r))}return[2]}})}).call(this)}}]);return t}(rR);tF([r({type:String})],rH.prototype,"identifier",2),tF([r({type:String})],rH.prototype,"href",2),rH=tF([rT("qti-assessment-stimulus-ref")],rH);var rQ=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}return t}(rR);rQ=tF([rT("qti-companion-materials-info")],rQ);var rF=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"render",value:function e(){return rs(j(),this.handleSlotChange)}},{key:"handleSlotChange",value:function e(){var e;var t;var n=Array.from((t=(e=this.firstElementChild)===null||e===void 0?void 0:e.childNodes)!==null&&t!==void 0?t:[]).find(function(e){return e.nodeType===Node.COMMENT_NODE});try{var r;this.operatorFunction=new Function("context","fn","item",(r=n===null||n===void 0?void 0:n.textContent)!==null&&r!==void 0?r:"")}catch(e){console.error("custom-operator contains invalid javascript code",e)}}},{key:"calculate",value:function e(){var e=this;var t={variable:function(t){var n,r;var i;return(i=(r=e._context)===null||r===void 0?void 0:(n=r.variables.find(function(e){return e.identifier===t}))===null||n===void 0?void 0:n.value)!==null&&i!==void 0?i:""},correct:function(t){var n,r;var i;return(i=(r=e._context)===null||r===void 0?void 0:(n=r.variables.find(function(e){return e.identifier===t}))===null||n===void 0?void 0:n.correctResponse)!==null&&i!==void 0?i:""}},n={getVariable:function(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,n){e.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:t,value:n}}))},updateResponseVariable:function(t,n){e.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:t,response:n}}))}};return this.operatorFunction(this._context,t,n)}}]);return t}(rR);tF([t({context:rU,subscribe:!0}),i()],rF.prototype,"_context",2),rF=tF([rT("qti-custom-operator")],rF);var rz=function(){return new Intl.NumberFormat().format(.1).replace(/\d/g,"")},rB=function(e){if(typeof e=="string")return e;var t=rz();return t==="."?e.toLocaleString():e.toString().replace(".","").replace(t,".")};var rW=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"connectedCallback",value:function e(){d(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=!U(this.identifier)&&!U(t===null||t===void 0?void 0:t.value)&&this.identifier===t.value||!1,this.showFeedback(n)}},{key:"showFeedback",value:function e(e){this.showStatus=e&&this.showHide==="show"||!e&&this.showHide==="hide"?"on":"off"}}]);return t}(rR);tF([r({type:String,attribute:"show-hide"})],rW.prototype,"showHide",2),tF([r({type:String,attribute:"outcome-identifier"})],rW.prototype,"outcomeIdentifier",2),tF([r({type:String})],rW.prototype,"identifier",2),tF([r({type:String,attribute:!1})],rW.prototype,"showStatus",2),tF([t({context:rU,subscribe:!0}),i()],rW.prototype,"_context",2);var rJ=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"render",value:function e(){return rs(H(),this.showStatus)}},{key:"connectedCallback",value:function e(){d(f(t.prototype),"connectedCallback",this).call(this),this.checkShowFeedback(this.outcomeIdentifier)}}]);return t}(rW);rJ.styles=nC(Q()),rJ=tF([rT("qti-feedback-block")],rJ);var rG=function(e){return e!==null&&e!==void 0?e:rh};var rX=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e.render=function(){return rs(F(),rG(e.showStatus))};return e}c(t,[{key:"connectedCallback",value:function e(){d(f(t.prototype),"connectedCallback",this).call(this),this.checkShowFeedback(this.outcomeIdentifier)}}]);return t}(rW);rX.styles=nC(z()),rX=tF([rT("qti-feedback-inline")],rX);var rY=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"render",value:function e(){return rs(B(),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(){d(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}(rW);rY.styles=nC(W()),rY=tF([rT("qti-modal-feedback")],rY);var rK=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"connectedCallback",value:function e(){d(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 rs(J())}}]);return t}(rR);rK.styles=nC(G()),rK=tF([rT("qti-associable-hotspot")],rK);var rZ=function(e,t,n){var r=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}return t}(e);return r};var r0=function(e,t,n,i){var l=/*#__PURE__*/function(e){"use strict";p(r,e);function r(){s(this,r);var e;e=a(this,r,arguments);e.observer=null;e.droppableObsever=null;e.resizeObserver=null;e.draggables=[];e.droppables=[];e.dragContainers=[];e.dragClone=null;e.dragSource=null;e.touchStartPoint=null;e.isDraggable=!1;e.cloneOffset={x:0,y:0};e.isDragging=!1;e.allDropzones=[];e.lastTarget=null;e.currentDropTarget=null;e.MIN_DRAG_DISTANCE=5;e.DRAG_CLONE_OPACITY=1;e.dataTransfer={data:{},setData:function e(e,t){this.data[e]=t},getData:function e(e){return this.data[e]},effectAllowed:"move"};e.configuration={copyStylesDragClone:!0,dragCanBePlacedBack:!0,dragOnClick:!1};e.minAssociations=1;e.maxAssociations=0;e.draggablesModified=function(t,n){if(e.isMatchTabular())return;var r=true,i=false,o=undefined;try{var a=function(){var t=l.value;e.draggables.includes(t)&&(e.draggables=e.draggables.filter(function(e){return e!==t}),t.removeAttribute("tabindex"),t.removeEventListener("touchstart",e.handleTouchStart.bind(e)),t.removeEventListener("mousedown",e.handleTouchStart.bind(e)))};for(var s=n[Symbol.iterator](),l;!(r=(l=s.next()).done);r=true)a()}catch(e){i=true;o=e}finally{try{if(!r&&s.return!=null){s.return()}}finally{if(i){throw o}}}var u=true,c=false,h=undefined;try{for(var d=t[Symbol.iterator](),f;!(u=(f=d.next()).done);u=true){var p=f.value;e.draggables.includes(p)||(e.draggables.push(p),p.setAttribute("tabindex","0"),p.hasTouchStartListener||(p.addEventListener("touchstart",e.handleTouchStart.bind(e),{passive:!1}),p.addEventListener("mousedown",e.handleTouchStart.bind(e),{passive:!1}),p.hasTouchStartListener=!0))}}catch(e){c=true;h=e}finally{try{if(!u&&d.return!=null){d.return()}}finally{if(c){throw h}}}var v=0;e.draggables.forEach(function(t){t.style.viewTransitionName="drag-".concat(v,"-").concat(e.getAttribute("identifier")||crypto.randomUUID()),t.setAttribute("qti-draggable","true"),v++})};e.droppablesModified=function(t,n){if(!e.isMatchTabular()){var r=true,i=false,o=undefined;try{var a=function(){var t=l.value;e.droppables.includes(t)&&(e.droppables=e.droppables.filter(function(e){return e!==t}),e.allDropzones=e.allDropzones.filter(function(e){return e!==t}))};for(var s=n[Symbol.iterator](),l;!(r=(l=s.next()).done);r=true)a()}catch(e){i=true;o=e}finally{try{if(!r&&s.return!=null){s.return()}}finally{if(i){throw o}}}var u=true,c=false,h=undefined;try{for(var d=t[Symbol.iterator](),f;!(u=(f=d.next()).done);u=true){var p=f.value;e.droppables.includes(p)||(e.droppables.push(p),e.allDropzones.push(p))}}catch(e){c=true;h=e}finally{try{if(!u&&d.return!=null){d.return()}}finally{if(c){throw h}}}var v=true,y=false,m=undefined;try{for(var g=e.droppables[Symbol.iterator](),b;!(v=(b=g.next()).done);v=true){var _=b.value;e.dataset.choicesContainerWidth&&(_.style.width="".concat(e.dataset.choicesContainerWidth,"px"),_.style.boxSizing="border-box")}}catch(e){y=true;m=e}finally{try{if(!v&&g.return!=null){g.return()}}finally{if(y){throw m}}}}};return e}c(r,[{key:"handleDraggableContainerChange",value:function e(e,t){this.isMatchTabular()||(e.length>0||t.length>0)&&this.dragContainersModified(e||[],t||[])}},{key:"dragContainersModified",value:function e(e,t){var n=true,r=false,i=undefined;try{var o,a=function(){var e=l.value;o.dragContainers.includes(e)&&(o.dragContainers=o.dragContainers.filter(function(t){return t!==e}),o.allDropzones=o.allDropzones.filter(function(t){return t!==e}))};for(var s=t[Symbol.iterator](),l;!(n=(l=s.next()).done);n=true)o=this,a()}catch(e){r=true;i=e}finally{try{if(!n&&s.return!=null){s.return()}}finally{if(r){throw i}}}var u=true,c=false,h=undefined;try{for(var d=e[Symbol.iterator](),f;!(u=(f=d.next()).done);u=true){var p=f.value;this.dragContainers.includes(p)||(this.dragContainers.push(p),this.allDropzones.push(p))}}catch(e){c=true;h=e}finally{try{if(!u&&d.return!=null){d.return()}}finally{if(c){throw h}}}}},{key:"handleDraggablesChange",value:function e(e,t){this.isMatchTabular()||(e.length>0||t.length>0)&&this.draggablesModified(e||[],t||[])}},{key:"handleDroppablesChange",value:function e(e,t){this.isMatchTabular()||(e.length>0||t.length>0)&&this.droppablesModified(e||[],t||[])}},{key:"firstUpdated",value:function e(e){var o=this;var a,s,l;if(d(f(r.prototype),"firstUpdated",this).call(this,e),this.isMatchTabular())return;this.hasAttribute("disabled")||(document.addEventListener("touchmove",this.handleTouchMove.bind(this),{passive:!1}),document.addEventListener("mousemove",this.handleTouchMove.bind(this),{passive:!1}),document.addEventListener("touchend",this.handleTouchEnd.bind(this),{passive:!1}),document.addEventListener("mouseup",this.handleTouchEnd.bind(this),{passive:!1}),document.addEventListener("touchcancel",this.handleTouchCancel.bind(this),{passive:!1}));var u=Array.from(this.querySelectorAll(t)||[]).concat(Array.from(((a=this.shadowRoot)===null||a===void 0?void 0:a.querySelectorAll(t))||[])),c=Array.from(this.querySelectorAll(n)||[]).concat(Array.from(((s=this.shadowRoot)===null||s===void 0?void 0:s.querySelectorAll(n))||[])),h=Array.from(this.querySelectorAll(i)||[]).concat(Array.from(((l=this.shadowRoot)===null||l===void 0?void 0:l.querySelectorAll(i))||[]));this.dragContainersModified(h,[]),this.droppablesModified(c,[]),this.draggablesModified(u,[]),this.updateMinDimensionsForDropZones(),this.observer=new MutationObserver(function(){return o.updateMinDimensionsForDropZones()}),this.observer.observe(this,{childList:!0,subtree:!0}),this.resizeObserver=new ResizeObserver(function(){return o.updateMinDimensionsForDropZones()}),this.querySelectorAll("qti-gap-text").forEach(function(e){var t;return(t=o.resizeObserver)===null||t===void 0?void 0:t.observe(e)})}},{key:"moveDraggableToDroppable",value:function e(e,t){return o(function(){var n;return L(this,function(r){n=this;if(this.isMatchTabular())return[2];(function(){e.style.transform="translate(0, 0)",t.tagName==="SLOT"?e.setAttribute("slot",t.getAttribute("name")):t.appendChild(e),n.checkAllMaxAssociations(),n.saveResponse()})();return[2]})}).call(this)}},{key:"activateDroppable",value:function e(e){this.dragContainers.includes(e)?(this._internals.states.add("--dragzone-active"),e.setAttribute("active","")):(this._internals.states.delete("--dragzone-active"),e.setAttribute("active",""))}},{key:"deactivateDroppable",value:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;t&&this._internals.states.add("--dragzone-active"),e.removeAttribute("active")}},{key:"connectedCallback",value:function e(){d(f(r.prototype),"connectedCallback",this).call(this)}},{key:"isMatchTabular",value:function e(){return this.classList.contains("qti-match-tabular")}},{key:"updateMinDimensionsForDropZones",value:function e(){return o(function(){var e,r,o,a,s,l,u,c,h,d,f,p,v,y,m,g;return L(this,function(b){switch(b.label){case 0:return[4,this.updateComplete];case 1:if(b.sent(),this.isMatchTabular())return[2];o=this.querySelectorAll(t),a=Array.from(this.querySelectorAll(n)).map(function(e){return e}),s=0,l=0;o.forEach(function(e){var t=e.getBoundingClientRect();s=Math.max(s,t.height),l=Math.max(l,t.width)});u=this.querySelector(i)||((e=this.shadowRoot)===null||e===void 0?void 0:e.querySelector(i)),c=(r=a[0])===null||r===void 0?void 0:r.parentElement;c&&(c.style.gridTemplateColumns="repeat(auto-fit, minmax(".concat(l,"px, 1fr))")),u&&(u.style.minHeight="".concat(s,"px"),u.style.minWidth="".concat(l,"px"));h=true,d=false,f=undefined;try{for(p=a[Symbol.iterator]();!(h=(v=p.next()).done);h=true){y=v.value;y.style.minHeight="".concat(s,"px"),y.style.minWidth="".concat(l,"px");g=(m=y.shadowRoot)===null||m===void 0?void 0:m.querySelector('slot[part="dropslot"]');g&&(g.style.minHeight="".concat(s,"px"),g.style.minWidth="".concat(l,"px"))}}catch(e){d=true;f=e}finally{try{if(!h&&p.return!=null){p.return()}}finally{if(d){throw f}}}return[2]}})}).call(this)}},{key:"activateDroppables",value:function e(e){if(this.isMatchTabular())return;this.dragContainers.forEach(function(t){t.setAttribute("enabled",""),t.hasAttribute("disabled")&&(t.contains(e)||t.shadowRoot&&t.shadowRoot.contains(e))&&t.removeAttribute("disabled")}),this.droppables.forEach(function(t){t.setAttribute("enabled",""),t.hasAttribute("disabled")&&(t.contains(e)||t.shadowRoot&&t.shadowRoot.contains(e))&&t.removeAttribute("disabled")})}},{key:"activateDragLocation",value:function e(){this._internals.states.add("--dragzone-enabled")}},{key:"deactivateDragLocation",value:function e(){this._internals.states.delete("--dragzone-enabled")}},{key:"deactivateDroppables",value:function e(){this.dragContainers.forEach(function(e){e.removeAttribute("enabled"),e.removeAttribute("active")}),this.droppables.forEach(function(e){e.removeAttribute("enabled"),e.removeAttribute("active")})}},{key:"disconnectedCallback",value:function e(){d(f(r.prototype),"disconnectedCallback",this).call(this),this.observer&&(this.observer.disconnect(),this.observer=null),this.droppableObsever&&(this.droppableObsever.disconnect(),this.droppableObsever=null),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),document.removeEventListener("touchmove",this.handleTouchMove),document.removeEventListener("mousemove",this.handleTouchMove),document.removeEventListener("touchend",this.handleTouchEnd),document.removeEventListener("mouseup",this.handleTouchEnd),document.removeEventListener("touchcancel",this.handleTouchCancel)}},{key:"handleTouchMove",value:function e(e){if(!this.isMatchTabular()&&this.isDraggable&&this.dragClone){var t=this.getEventCoordinates(e),n=t.x,r=t.y,i={clientX:n,clientY:r};this.calculateDragDistance(i)>=this.MIN_DRAG_DISTANCE&&(this.isDragging=!0,this.updateDragClonePosition(i));var o=this.findClosestDropzone();this.currentDropTarget=o,o!==this.lastTarget&&(this.lastTarget&&(this.deactivateDroppable(this.lastTarget),this.dispatchCustomEvent(this.lastTarget,"dragleave")),o&&(this.activateDroppable(o),this.dispatchCustomEvent(o,"dragenter")),this.lastTarget=o),this.currentDropTarget&&this.dispatchCustomEvent(this.currentDropTarget,"dragover"),e.preventDefault()}}},{key:"handleTouchEnd",value:function e(e){this.isMatchTabular()||(this.isDragging&&this.resetDragState(),this._internals.states.delete("--dragzone-active"),this.checkAllMaxAssociations(),this._internals.states.delete("--dragzone-enabled"),this._internals.states.delete("--dragzone-active"),this.deactivateDragLocation(),this.deactivateDroppables(),this.draggables.forEach(function(e){e.removeAttribute("dragging")}),e.preventDefault())}},{key:"handleTouchCancel",value:function e(e){this.resetDragState()}},{key:"validate",value:function e(){if(this.isMatchTabular())return;if(!this.shadowRoot)return!1;var e=this.getValidAssociations(),t=!0,n="";this.maxAssociations>0&&e>this.maxAssociations?(t=!1,n=this.dataset.maxSelectionsMessage||"You've selected too many associations. Maximum allowed is ".concat(this.maxAssociations,".")):this.minAssociations>0&&e<this.minAssociations&&(t=!1,n=this.dataset.minSelectionsMessage||"You haven't selected enough associations. Minimum required is ".concat(this.minAssociations,"."));var r=this.lastElementChild;return this._internals.setValidity(t?{}:{customError:!0},n,r),t}},{key:"reportValidity",value:function e(){var e=this.shadowRoot.querySelector("#validation-message");return e&&(this._internals.validity.valid?(e.textContent="",e.style.display="none"):(e.textContent=this._internals.validationMessage,e.style.setProperty("display","block","important"))),this._internals.validity.valid}},{key:"checkMaxAssociations",value:function e(e){var t=this.getMatchMaxValue(e),n=e.querySelectorAll('[qti-draggable="true"]').length;return!(t===0)&&n>=t}},{key:"dropDraggableInDroppable",value:function e(e,t){var n=e.cloneNode(!0);n.removeAttribute("style"),this.moveDraggableToDroppable(n,t),this.draggablesModified([n],[]);var r=this.getMatchMaxValue(e),i=this.draggables.filter(function(t){return t.getAttribute("identifier")===e.getAttribute("identifier")});r!==0&&i.length>=r?(e.style.opacity="0.0",e.style.pointerEvents="none"):e.style.opacity="1.0"}},{key:"resetDragState",value:function e(){if(this.dragClone){var e=this.currentDropTarget!==null,t=!e||this.dragContainers.includes(this.currentDropTarget);e&&this.currentDropTarget&&!t&&this.dropDraggableInDroppable(this.dragSource,this.currentDropTarget),t&&(this.dragSource.style.opacity="1.0",this.dragSource.style.display="block",this.dragSource.style.position="static",this.dragSource.style.pointerEvents="auto",this.saveResponse()),this.dragClone.remove(),this.draggablesModified([],[this.dragClone])}this.isDragging=!1,this.isDraggable=!1,this.dragSource=null,this.dragClone=null,this.touchStartPoint=null,this.currentDropTarget=null,this.lastTarget=null,this.deactivateDroppables()}},{key:"checkAllMaxAssociations",value:function e(){var e=this;var t=this.getValidAssociations(),n=this.maxAssociations!==0&&t>=this.maxAssociations;this.droppables.forEach(function(t){n?e.disableDroppable(t):e.checkMaxAssociations(t)?e.disableDroppable(t):e.enableDroppable(t)})}},{key:"getMatchMaxValue",value:function e(e){var t=e.getAttribute("match-max");return t?parseInt(t,10):1}},{key:"disableDroppable",value:function e(e){e.setAttribute("disabled","")}},{key:"enableDroppable",value:function e(e){e.removeAttribute("disabled")}},{key:"response",get:function e(){var e;return typeof this.getResponse=="function"?e=this.getResponse():e=this.collectResponseData(),e.join(",")},set:function e(e){var t=this;if(!this.isMatchTabular())if(typeof this.getValue=="function"&&(e=this.getValue(e)),Array.isArray(e)){this.reset(!1),e===null||e===void 0?void 0:e.forEach(function(e){return t.placeResponse(e)});var n=new FormData;e.forEach(function(e){n.append(t.responseIdentifier,e)}),this._internals.setFormValue(n)}else this._internals.setFormValue(e||"")}},{key:"placeResponse",value:function e(e){var t=this;var n=M(e.split(" ").reverse()),r=n[0],i=n.slice(1),o=Array.from(this.draggables),a=Array.from(this.droppables);i.forEach(function(e){if(e==="")return;var n=o.find(function(t){return t.getAttribute("identifier")===e}),i=a.find(function(e){return e.getAttribute("identifier")===r});t.dropDraggableInDroppable(n,i)})}},{key:"getValidAssociations",value:function e(){var e=0;var t=true,n=false,r=undefined;try{for(var i=this.droppables[Symbol.iterator](),o;!(t=(o=i.next()).done);t=true){var a=o.value;e=e+this.getDraggablesFromDroppable(a).length}}catch(e){n=true;r=e}finally{try{if(!t&&i.return!=null){i.return()}}finally{if(n){throw r}}}return e}},{key:"saveResponse",value:function e(){var e;typeof this.getResponse=="function"?e=this.getResponse():e=this.collectResponseData(),this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:this.responseIdentifier,response:e}}))}},{key:"collectResponseData",value:function e(){var e=this;return this.droppables.map(function(t){var n=e.getDraggablesFromDroppable(t).map(function(e){return e.getAttribute("identifier")}),r=t.getAttribute("identifier");return n.map(function(e){return"".concat(e," ").concat(r)})}).flat()}},{key:"getDraggablesFromDroppable",value:function e(e){return this.draggables.map(function(e){return e.getAttribute("identifier")}).filter(function(e,t,n){return n.indexOf(e)===t}).flatMap(function(t){return Array.from(e.querySelectorAll("[identifier='".concat(t,"']")))}).filter(function(e){return!!e}).map(function(e){return e})}},{key:"reset",value:function e(){var e=this;var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.droppables.forEach(function(t){e.getDraggablesFromDroppable(t).forEach(function(t){t.remove(),e.draggablesModified([],[t])})}),this.dragContainers.forEach(function(e){Array.from(e.querySelectorAll('[qti-draggable="true"]')).forEach(function(e){e.style.opacity="1.0"})}),this.dragClone=null,this.dragSource=null,this.isDragging=!1,this.isDraggable=!1,this.currentDropTarget=null,this.lastTarget=null,t&&this.saveResponse()}},{key:"updateDragClonePosition",value:function e(e){if(!this.isDragging||!this.dragClone)return;var t=e.clientX-this.cloneOffset.x,n=e.clientY-this.cloneOffset.y,r=this.applyInteractionBoundaries(t,n,this.dragClone),i=r.newLeft,o=r.newTop;this.dragClone.style.left="".concat(i,"px"),this.dragClone.style.top="".concat(o,"px")}},{key:"applyInteractionBoundaries",value:function e(e,t,n){var r=this.getBoundingClientRect(),i=n.getBoundingClientRect(),o=i.width,a=i.height,s=Math.max(r.left,Math.min(e,r.right-o)),l=Math.max(r.top,Math.min(t,r.bottom-a));return{newLeft:s,newTop:l}}},{key:"getEventCoordinates",value:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;var n=e.touches?e.touches[0]:e;return{x:t?n.pageX:n.clientX,y:t?n.pageY:n.clientY}}},{key:"calculateDragDistance",value:function e(e){var t=Math.abs(e.clientX-this.touchStartPoint.x),n=Math.abs(e.clientY-this.touchStartPoint.y);return t+n}},{key:"findClosestDropzone",value:function e(){var e=this.allDropzones.filter(function(e){return!e.hasAttribute("disabled")});if(!this.dragClone||e.length===0)return null;var t=this.dragClone.getBoundingClientRect(),n=null,r=0;var i=true,o=false,a=undefined;try{for(var s=e[Symbol.iterator](),l;!(i=(l=s.next()).done);i=true){var u=l.value;var c=u.getBoundingClientRect(),h=this.calculateOverlapArea(t,c);h>r&&(r=h,n=u)}}catch(e){o=true;a=e}finally{try{if(!i&&s.return!=null){s.return()}}finally{if(o){throw a}}}if(!n){var d=200;var f=true,p=false,v=undefined;try{for(var y=e[Symbol.iterator](),m;!(f=(m=y.next()).done);f=true){var g=m.value;var b=g.getBoundingClientRect(),_=Math.sqrt(Math.pow(t.left-b.left,2)+Math.pow(t.top-b.top,2));_<d&&(d=_,n=g)}}catch(e){p=true;v=e}finally{try{if(!f&&y.return!=null){y.return()}}finally{if(p){throw v}}}}return n}},{key:"calculateOverlapArea",value:function e(e,t){var n=Math.max(0,Math.min(e.right,t.right)-Math.max(e.left,t.left)),r=Math.max(0,Math.min(e.bottom,t.bottom)-Math.max(e.top,t.top));return n*r}},{key:"dispatchCustomEvent",value:function e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e)return;var r=new CustomEvent(t,{bubbles:n,cancelable:!0});r.dataTransfer=this.dataTransfer,e.dispatchEvent(r)}},{key:"appendClone",value:function e(){document.body.appendChild(this.dragClone)}},{key:"handleTouchStart",value:function e(e){var t=this;if(this.isMatchTabular()||v(e,MouseEvent)&&e.button!==0||this.isDragging)return;var n=this.getEventCoordinates(e),r=n.x,i=n.y;this.touchStartPoint={x:r,y:i},this.dragSource=e.currentTarget,this.isDraggable=!0,this._internals.states.add("--dragzone-enabled"),this._internals.states.add("--dragzone-active"),this.activateDragLocation(),this.activateDroppables(this.dragSource);var o=this.findDraggableInDraggableContainer(this.dragSource.getAttribute("identifier")),a=this.droppables.some(function(e){return Array.from(e.children).some(function(e){return e===t.dragSource})}),s=this.dragSource.getBoundingClientRect();a&&(this.dragSource.remove(),this.draggablesModified([],[this.dragSource]),this.dragSource=o),this.cloneOffset.x=r-s.left,this.cloneOffset.y=i-s.top,this.dragClone=o.cloneNode(!0);var l=window.getComputedStyle(o);for(var u=0;u<l.length;u++){var c=l[u];this.dragClone.style.setProperty(c,l.getPropertyValue(c))}var h=o.getBoundingClientRect();this.dragClone.style.width="".concat(h.width,"px"),this.dragClone.style.height="".concat(h.height,"px"),s&&this.setDragCloneStyles(s),this.dragClone.style.display="block",this.dragClone.style.opacity="1",this.appendClone();var d=this.getMatchMaxValue(this.dragSource),f=this.draggables.filter(function(e){return e.getAttribute("identifier")===t.dragSource.getAttribute("identifier")});d!==0&&f.length>=d?(o.style.opacity="0.0",o.style.pointerEvents="none"):o.style.opacity="1.0",e.preventDefault(),this.dragClone.setAttribute("dragging","")}},{key:"findDraggableInDraggableContainer",value:function e(e){var n=this.dragContainers.flat();var r=true,i=false,o=undefined;try{for(var a=n[Symbol.iterator](),s;!(r=(s=a.next()).done);r=true){var l=s.value;if(l.getAttribute("identifier")===e)return l;var u=void 0;v(l,HTMLSlotElement)?u=Array.from((l===null||l===void 0?void 0:l.assignedElements())||[]):u=Array.from(l.querySelectorAll(t));var c=u.find(function(t){return t.getAttribute("identifier")===e});if(c)return c}}catch(e){i=true;o=e}finally{try{if(!r&&a.return!=null){a.return()}}finally{if(i){throw o}}}}},{key:"setDragCloneStyles",value:function e(e){this.dragClone.style.position="fixed",this.dragClone.style.top="".concat(e.top,"px"),this.dragClone.style.left="".concat(e.left,"px"),this.dragClone.style.setProperty("box-sizing","border-box","important"),this.dragClone.style.zIndex="9999",this.dragClone.style.pointerEvents="none",this.dragClone.style.opacity=this.DRAG_CLONE_OPACITY.toString(),this.dragClone.style.display="block"}}]);return r}(rZ(e,n,t));return tF([r({attribute:!1,type:Object})],l.prototype,"configuration",2),tF([r({type:Number,reflect:!0,attribute:"min-associations"})],l.prototype,"minAssociations",2),tF([r({type:Number,reflect:!0,attribute:"max-associations"})],l.prototype,"maxAssociations",2),tF([y(i)],l.prototype,"handleDraggableContainerChange",1),tF([y(t)],l.prototype,"handleDraggablesChange",1),tF([y(n)],l.prototype,"handleDroppablesChange",1),l};var r1=nC(X());var r2=Symbol("configContext");var r3=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t);e.disabled=!1;e.readonly=!1;e._isCorrect=null;e._internals=e.attachInternals();return e}c(t,[{key:"isFullCorrectResponse",get:function e(){return this._isFullCorrectResponse},set:function e(e){this._isFullCorrectResponse=e}},{key:"correctResponse",get:function e(){return this._correctResponse},set:function e(e){this._correctResponse=e}},{key:"isCorrect",get:function e(){return this._isCorrect},set:function e(e){this._isCorrect=e}},{key:"toggleCorrectResponse",value:function e(e,t){var n,r;(((r=this)===null||r===void 0?void 0:(n=r.configContext)===null||n===void 0?void 0:n.correctResponseMode)||"internal")==="full"?this.toggleFullCorrectResponse(e,t):this.toggleInternalCorrectResponse(e,t)}},{key:"toggleFullCorrectResponse",value:function e(e,t){return o(function(){var n,r,i,o,a,s,l,u;return L(this,function(c){switch(c.label){case 0:r=this.nextElementSibling,i=r===null||r===void 0?void 0:r.classList.contains("full-correct-response"),o=e.correctResponse===e.value;if(!t||o){;if(!i)return[2];(a=this.parentElement)===null||a===void 0?void 0:a.removeChild(r)}if(i||o)return[2];s=this.cloneNode(!0);s.isFullCorrectResponse=!0,s.disabled=!0;l=document.createElement("div");l.classList.add("full-correct-response"),l.role="full-correct-response",l.appendChild(s),s.setAttribute("response-identifier",this.responseIdentifier+"_cr"),(n=this.parentElement)===null||n===void 0?void 0:n.insertBefore(l,this.nextElementSibling);return[4,s.updateComplete];case 1:c.sent(),s.response=Array.isArray(e.correctResponse)?T(e.correctResponse):e.correctResponse;u=k({},e);u.value=e.correctResponse,s.toggleCandidateCorrection(u,!0);return[2]}})}).call(this)}},{key:"toggleInternalCorrectResponse",value:function e(e,t){this.correctResponse=t?e===null||e===void 0?void 0:e.correctResponse:(e===null||e===void 0?void 0:e.cardinality)==="single"?"":[]}},{key:"toggleCandidateCorrection",value:function e(e,t){this.isCorrect=t?e.correctResponse===e.value:null,this._internals.states.delete("candidate-correct"),this._internals.states.delete("candidate-incorrect"),this.isCorrect===!0&&this._internals.states.add("candidate-correct"),this.isCorrect===!1&&this._internals.states.add("candidate-incorrect")}},{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(){return this._internals.reportValidity()}},{key:"reset",value:function e(){this.response=null}},{key:"connectedCallback",value:function e(){d(f(t.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:"saveResponse",value:function e(e){this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,cancelable:!1,detail:{responseIdentifier:this.responseIdentifier,response:Array.isArray(e)?T(e):e}}))}}]);return t}(rR);r3.formAssociated=!0,tF([t({context:r2,subscribe:!0})],r3.prototype,"configContext",2),tF([r({type:String,attribute:"response-identifier"})],r3.prototype,"responseIdentifier",2),tF([r({reflect:!0,type:Boolean})],r3.prototype,"disabled",2),tF([r({reflect:!0,type:Boolean})],r3.prototype,"readonly",2),tF([i()],r3.prototype,"_isFullCorrectResponse",2),tF([i()],r3.prototype,"_correctResponse",2),tF([i()],r3.prototype,"_isCorrect",2);var r4=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t);e._childrenMap=[];e._registerChoiceHandler=e._registerChoice.bind(e),e.addEventListener("register-qti-simple-associable-choice",e._registerChoiceHandler);return e}c(t,[{key:"_registerChoice",value:function e(e){var t=e.target;this._childrenMap.push(t)}},{key:"render",value:function e(){return rs(K(),this._childrenMap.length>0&&Array.from(Array(Math.ceil(this._childrenMap.length/2)).keys()).map(function(e,t){return rs(Y(),t,t,t,t)}))}},{key:"disconnectedCallback",value:function e(){d(f(t.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("register-qti-simple-associable-choice",this._registerChoiceHandler)}}]);return t}(r0(r3,"qti-simple-associable-choice",".dl","slot[name='qti-simple-associable-choice']"));r4.styles=r1,tF([i()],r4.prototype,"_childrenMap",2),r4=tF([rT("qti-associate-interaction")],r4);var r5=function(e,n){var o=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e._choiceElements=[];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}c(t,[{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:"toggleInternalCorrectResponse",value:function e(e,t){if(e.correctResponse){var n=Array.isArray(e.correctResponse)?e.correctResponse:[e.correctResponse];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 e(e,t){if(!e.correctResponse)return;this.isCorrect=t?e.correctResponse===e.value:null;var n=Array.isArray(e.correctResponse)?e.correctResponse:[e.correctResponse],r=Array.isArray(e.value)?e.value:[e.value];this._choiceElements.forEach(function(e){e.internals.states.delete("candidate-correct"),e.internals.states.delete("candidate-incorrect"),t&&r.includes(e.identifier)&&(n.includes(e.identifier)?e.internals.states.add("candidate-correct"):e.internals.states.add("candidate-incorrect"))})}},{key:"connectedCallback",value:function e(){d(f(t.prototype),"connectedCallback",this).call(this),this.addEventListener("register-".concat(n),this._registerChoiceElement),this.addEventListener("unregister-".concat(n),this._unregisterChoiceElement),this.addEventListener("activate-".concat(n),this._choiceElementSelectedHandler)}},{key:"disconnectedCallback",value:function e(){d(f(t.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("register-".concat(n),this._registerChoiceElement),this.removeEventListener("unregister-".concat(n),this._unregisterChoiceElement),this.removeEventListener("activate-".concat(n),this._choiceElementSelectedHandler)}},{key:"validate",value:function e(){var e=this;var t=this._choiceElements.filter(function(t){return e._getChoiceChecked(t)}),n=t.length,r=!0,i="";return this.maxChoices!==0&&n>this.maxChoices?(r=!1,i=this.dataset.maxSelectionsMessage||"Please select no more than ".concat(this.maxChoices," ").concat(this.maxChoices===1?"option":"options",".")):n<this.minChoices&&(r=!1,i=this.dataset.minSelectionsMessage||"Please select at least ".concat(this.minChoices," ").concat(this.minChoices===1?"option":"options",".")),t.length>0&&this._internals.setValidity(r?{}:{customError:!0},i,t[n-1]||this._choiceElements[0]||this),r}},{key:"reportValidity",value:function e(){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._internals.validity.valid}},{key:"_registerChoiceElement",value:function e(e){e.stopPropagation();var t=e.target;t.disabled=this.disabled,this._choiceElements.push(t),this._setInputType(t)}},{key:"_unregisterChoiceElement",value:function e(e){e.stopPropagation();var t=e.target;this._choiceElements=this._choiceElements.filter(function(e){return e!==t})}},{key:"_determineInputType",value:function e(){var e=this;this._choiceElements.forEach(function(t){e._setInputType(t)})}},{key:"_setInputType",value:function e(e){this._internals.role=this.maxChoices===1?"radiogroup":null;var t=this.maxChoices===1?"radio":"checkbox";e.internals.role=t,e.internals.states.delete(t==="radio"?"checkbox":"radio"),e.internals.states.add(t)}},{key:"_choiceElementSelectedHandler",value:function e(e){var t=this;var n;this._toggleChoiceChecked(e.target),this.maxChoices===1?this._choiceElements.forEach(function(n){n.identifier!==e.detail.identifier&&t._setChoiceChecked(n,!1)}):((n=this._configContext)===null||n===void 0?void 0:n.disableAfterIfMaxChoicesReached)&&(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.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 t}(e);return tF([l("#validation-message")],o.prototype,"_validationMessageElement",2),tF([r({type:Number,attribute:"min-choices"})],o.prototype,"minChoices",2),tF([r({type:Number,attribute:"max-choices"})],o.prototype,"maxChoices",2),tF([m("maxChoices",{waitUntilFirstUpdate:!0})],o.prototype,"_handleMaxChoicesChange",1),tF([m("disabled",{waitUntilFirstUpdate:!0})],o.prototype,"_handleDisabledChange",2),tF([m("readonly",{waitUntilFirstUpdate:!0})],o.prototype,"_handleReadonlyChange",2),tF([i()],o.prototype,"response",2),tF([m("response",{waitUntilFirstUpdate:!0})],o.prototype,"_handleValueChange",2),tF([i(),t({context:r2,subscribe:!0})],o.prototype,"_configContext",2),o};var r6=function(e,t){var n=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e._classes=[];e._allLabels=["qti-labels-decimal","qti-labels-lower-alpha","qti-labels-upper-alpha"];e._allLabelSuffixes=["qti-labels-suffix-period","qti-labels-suffix-parenthesis"];return e}c(t,[{key:"class",get:function e(){var e;return((e=this._classes)===null||e===void 0?void 0:e.join(" "))||""},set:function e(e){e&&(this._classes=e.split(" "),this._addLabels())}},{key:"updated",value:function e(e){d(f(t.prototype),"updated",this).call(this,e),this._addLabels()}},{key:"_addLabels",value:function e(){var e=this;var t=this._classes.some(function(t){return e._allLabels.includes(t)||e._allLabelSuffixes.includes(t)}),n=function(e){return!isNaN(+e)};if(t){var r=Array.from(this.querySelectorAll("qti-simple-choice")).map(function(e){return e}).map(function(e,t){return{el:e,order:n(e.style.order)?+e.style.order:t+1}}).sort(function(e,t){return e.order-t.order}).map(function(e){return e.el});for(var i=0;i<r.length;i++)r[i].marker=this._getLabel(i+1)}}},{key:"_getLabel",value:function e(e){var t=this;var n=this._classes.filter(function(e){return t._allLabels.includes(e)}).pop(),r=this._classes.filter(function(e){return t._allLabelSuffixes.includes(e)}).pop();!n&&r&&(n="qti-labels-upper-alpha");var i="";switch(n){case"qti-labels-decimal":i="".concat(e);break;case"qti-labels-lower-alpha":i="".concat(String.fromCharCode(97+e-1));break;case"qti-labels-upper-alpha":i="".concat(String.fromCharCode(65+e-1));break}return r==="qti-labels-suffix-period"?i+=".":r==="qti-labels-suffix-parenthesis"&&(i+=")"),i}}]);return t}(e);return tF([r({type:String,reflect:!0})],n.prototype,"class",1),n};var r9=nC(Z());var r7=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e.orientation="vertical";return e}c(t,[{key:"_handleSlotChange",value:function e(){var e=this.querySelectorAll("qti-simple-choice");this.style.setProperty("--item-count",e.length.toString())}},{key:"render",value:function e(){return rs(ee(),this._handleSlotChange)}}]);return t}(r6(r5(r3,"qti-simple-choice"),"qti-simple-choice"));r7.styles=r9,tF([r({type:String})],r7.prototype,"orientation",2),r7=tF([rT("qti-choice-interaction")],r7);var r8=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t);e.rawResponse="";e._errorMessage=null;e.handlePostMessage=e.handlePostMessage.bind(e);return e}c(t,[{key:"connectedCallback",value:function e(){var e=this;d(f(t.prototype),"connectedCallback",this).call(this);var n=this.data.startsWith("http")||this.data.startsWith("blob")?this.data:tR(this.baseItemUrl+"/"+this.data);fetch(n).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(){var e=this.shadowRoot.querySelector("#pciContainer").contentDocument;if(!this.manifest.script||this.manifest.script.length===0){this._errorMessage="No script found in manifest";return}if(!this.manifest.style||this.manifest.style.length===0){this._errorMessage="No style found in manifest";return}var t=this.manifest.style[0],n=t.startsWith("http")||t.startsWith("blob")?t:tR("".concat(this.baseRefUrl,"/").concat(t)),r=this.manifest.script[0],i=r.startsWith("http")||r.startsWith("blob")?r:tR("".concat(this.baseRefUrl,"/").concat(r));window.addEventListener("message",this.handlePostMessage),e.open(),e.write("\n <html>\n <head>\n <link href='".concat(n,"' rel=\"stylesheet\" />\n <script src='").concat(i,"'><\/script>\n </head>\n <body></body>\n </html>\n ")),e.close()}},{key:"getIFrames",value:function e(){var e=this.shadowRoot.querySelectorAll("iframe"),t=this.querySelectorAll("iframe"),n=T(e).concat(T(t));var r=true,i=false,o=undefined;try{for(var a=n[Symbol.iterator](),s;!(r=(s=a.next()).done);r=true){var l=s.value;var u=l.src;if(new URL(u,window.location.href).origin===window.location.origin)try{var c=l.contentDocument||l.contentWindow.document;c&&this.getInnerIFrames(c,n)}catch(e){console.error("Error accessing nested iframe:",e)}}}catch(e){i=true;o=e}finally{try{if(!r&&a.return!=null){a.return()}}finally{if(i){throw o}}}return n.forEach(function(e,t){n.indexOf(e)!==t&&n.splice(t,1)}),n}},{key:"getInnerIFrames",value:function e(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 i=e.contentDocument||e.contentWindow.document;t.getInnerIFrames(i,n)}catch(e){console.error("Error accessing nested iframe:",e)}else console.warn("Skipped cross-origin iframe:",r)}),n}},{key:"postToWindowAndIframes",value:function e(e,t){window.postMessage({type:e,data:t},"*");var n=this.getIFrames();var r=true,i=false,o=undefined;try{for(var a=n[Symbol.iterator](),s;!(r=(s=a.next()).done);r=true){var l=s.value;l.contentWindow&&l.contentWindow.postMessage({type:e,data:t},"*")}}catch(e){i=true;o=e}finally{try{if(!r&&a.return!=null){a.return()}}finally{if(i){throw o}}}}},{key:"handlePostMessage",value:function e(e){var t=this;var n=e.data,r=n.type,i=n.data;switch(r){case"setResponse":(i===null||!(Array.isArray(i)&&i.length===1&&i[0]===""))&&(this.rawResponse=i,this.saveResponse(i));break;case"getResponse":{this.postToWindowAndIframes("responseData",this.rawResponse);break}case"getMedia":{var o=this.manifest.media.map(function(e){return e.startsWith("http")||e.startsWith("blob")?e:tR(t.baseRefUrl+"/"+e)});this.postToWindowAndIframes("mediaData",o);break}case"setStageHeight":console.log("setStageHeight not implemented");break}}},{key:"validate",value:function e(){if(!this.rawResponse)return!1;if(Array.isArray(this.rawResponse)){if(this.rawResponse.length===0)return!1;var e=true,t=false,n=undefined;try{for(var r=this.rawResponse[Symbol.iterator](),i;!(e=(i=r.next()).done);e=true){var o=i.value;if(o!==""&&o!==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 this.rawResponse||null},set:function e(e){if(typeof e=="string")this.rawResponse=e,this.saveResponse(e);else if(Array.isArray(e))this.rawResponse=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),d(f(t.prototype),"disconnectedCallback",this).call(this)}},{key:"render",value:function e(){return rs(en(),this.getAttribute("width"),this.getAttribute("height"),this._errorMessage&&rs(et(),this._errorMessage))}}]);return t}(r3);tF([r({type:String,attribute:"data"})],r8.prototype,"data",2),tF([r({type:String,attribute:"data-base-item"})],r8.prototype,"baseItemUrl",2),tF([r({type:String,attribute:"data-base-ref"})],r8.prototype,"baseRefUrl",2),tF([r({type:String,attribute:"id"})],r8.prototype,"id",2),tF([i()],r8.prototype,"_errorMessage",2),r8=tF([rT("qti-custom-interaction")],r8);var ie=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e.disabled=!1;e.countAttempt=null;e.title="end attempt";return e}c(t,[{key:"render",value:function e(){return rs(er(),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}(rR);tF([r({type:String,attribute:"response-identifier"})],ie.prototype,"responseIdentifier",2),tF([r({reflect:!0,type:Boolean})],ie.prototype,"disabled",2),tF([r({type:String,attribute:"count-attempt"})],ie.prototype,"countAttempt",2),tF([r({type:String})],ie.prototype,"title",2),ie=tF([rT("qti-end-attempt-interaction")],ie);var it=nC(ei());var ir=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e._rows=5;e.response=null;e._handleResponseChange=function(){e._internals.setFormValue(e.value),e.validate()};return e}c(t,[{key:"handleclassNamesChange",value:function e(e,t){var n=this;var r=t.split(" "),i=!1;if(r.forEach(function(e){if(e.startsWith("qti-height-lines-")){var t=e.replace("qti-height-lines-","");n._rows=parseInt(t),i=!0}}),!i&&this.expectedLength){var o=Math.ceil(this.expectedLength/50);this._rows=o}}},{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;if(this.patternMask&&this.dataPatternmaskMessage){this._internals.setValidity({}),e.setCustomValidity("");var t=this.patternMask.startsWith("^")&&this.patternMask.endsWith("$")?this.patternMask:"^".concat(this.patternMask,"$"),n=new RegExp(t);e.checkValidity()&&n.test(e.value)||(this._internals.setValidity({customError:!0},this.dataPatternmaskMessage),e.setCustomValidity(this.dataPatternmaskMessage))}else{var r=e.checkValidity();this._internals.setValidity(r?{}:{customError:!1})}return!!this.response&&e.checkValidity()}},{key:"toggleCorrectResponse",value:function e(){}},{key:"reportValidity",value:function e(){var e=this.shadowRoot.querySelector("textarea");if(!e)return!1;var t=this.validate();return t||e.reportValidity(),t}},{key:"render",value:function e(){var e=this;return rs(eo(),this.responseIdentifier,5e3,function(e){return e.stopImmediatePropagation()},this.textChanged,this.textChanged,function(t){e.reportValidity()},rG(this.placeholderText?this.placeholderText:void 0),this._rows,this.disabled,this.readonly,this.response)}},{key:"textChanged",value:function e(e){if(this.disabled||this.readonly)return;var t=e.target;this.setEmptyAttribute(t.value),this.response!==t.value&&(this.value=t.value,this.saveResponse(t.value))}},{key:"setEmptyAttribute",value:function e(e){this.setAttribute("empty",e===""?"true":"false")}}]);return t}(r3);ir.styles=it,tF([i()],ir.prototype,"_rows",2),tF([r({type:Number,attribute:"expected-length"})],ir.prototype,"expectedLength",2),tF([r({type:String,attribute:"pattern-mask"})],ir.prototype,"patternMask",2),tF([r({type:String,attribute:"placeholder-text"})],ir.prototype,"placeholderText",2),tF([r({type:String,attribute:"data-patternmask-message"})],ir.prototype,"dataPatternmaskMessage",2),tF([r({type:String,attribute:"class"})],ir.prototype,"classNames",2),tF([m("classNames")],ir.prototype,"handleclassNamesChange",1),tF([i()],ir.prototype,"response",2),tF([m("response",{waitUntilFirstUpdate:!0})],ir.prototype,"_handleResponseChange",2),ir=tF([rT("qti-extended-text-interaction")],ir);var ii=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e.tabindex=0;return e}c(t,[{key:"connectedCallback",value:function e(){this.setAttribute("slot","drags")}}]);return t}(rR);ii.styles=nC(ea()),tF([r({type:Number,reflect:!0})],ii.prototype,"tabindex",2),ii=tF([rT("qti-gap-img")],ii);var io=nC(es());var ia=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"render",value:function e(){return rs(el())}},{key:"toggleCorrectResponse",value:function e(e,t){var n=this;if(t&&e.correctResponse){var r=[],i=Array.isArray(e.correctResponse)?e.correctResponse:[e.correctResponse];i&&(r=i.map(function(e){var t=e.split(" ");return{text:t[0],gap:t[1]}})),this.querySelectorAll("qti-gap").forEach(function(e){var t,i,o;var a=e.getAttribute("identifier"),s=(t=r.find(function(e){return e.gap===a}))===null||t===void 0?void 0:t.text,l=(i=n.querySelector('qti-gap-text[identifier="'.concat(s,'"]')))===null||i===void 0?void 0:i.textContent.trim();if(s&&l){var u;if(!((u=e.nextElementSibling)===null||u===void 0?void 0:u.classList.contains("correct-option"))){var c=document.createElement("span");c.classList.add("correct-option"),c.textContent=l,c.style.border="1px solid var(--qti-correct)",c.style.borderRadius="4px",c.style.padding="2px 4px",c.style.display="inline-block",e.insertAdjacentElement("afterend",c)}}else((o=e.nextElementSibling)===null||o===void 0?void 0:o.classList.contains("correct-option"))&&e.nextElementSibling.remove()})}else this.querySelectorAll(".correct-option").forEach(function(e){e.remove()})}}]);return t}(r0(r3,"qti-gap-text","qti-gap","slot[part='drags']"));ia.styles=io,ia=tF([rT("qti-gap-match-interaction")],ia);var is={toAttribute:function(e){return e?"true":"false"},fromAttribute:function(e){return e==="true"}};var il=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e.tabindex=0;return e}c(t,[{key:"connectedCallback",value:function e(){d(f(t.prototype),"connectedCallback",this).call(this),this.setAttribute("slot","drags")}},{key:"render",value:function e(){return rs(eu())}}]);return t}(tP(rR,"qti-gap-text"));il.styles=nC(ec()),tF([r({type:Number,reflect:!0})],il.prototype,"tabindex",2),il=tF([rT("qti-gap-text")],il);var iu=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e.tabindex=0;return e}c(t,[{key:"render",value:function e(){return rs(eh())}}]);return t}(rR);iu.styles=nC(ed()),tF([r({type:Number,reflect:!0})],iu.prototype,"tabindex",2),iu=tF([rT("qti-gap")],iu);var ic={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},ih=function(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}}},id=/*#__PURE__*/function(){"use strict";function e(t){s(this,e)}c(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,T(t))}}]);return e}();var ip=rE.I;var iv=function(e){return e.strings===void 0},iy=function(){return document.createComment("")},im=function(e,t,n){var r=e._$AA.parentNode,i=t===void 0?e._$AB:t._$AA;if(n===void 0){var o=r.insertBefore(iy(),i),a=r.insertBefore(iy(),i);n=new ip(o,a,e,e.options)}else{var s=n._$AB.nextSibling,l=n._$AM,u=l!==e;if(u){var c;var h;(c=n._$AQ)===null||c===void 0?void 0:c.call(n,e),n._$AM=e,n._$AP!==void 0&&(h=e._$AU)!==l._$AU&&n._$AP(h)}if(s!==i||u){var d=n._$AA;for(;d!==s;){var f=d.nextSibling;r.insertBefore(d,i),d=f}}}return n},ig=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e;return e._$AI(t,n),e},ib={},i_=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ib;return e._$AH=t},ik=function(e){return e._$AH},iw=function(e){var t;(t=e._$AP)===null||t===void 0?void 0:t.call(e,!1,!0);var n=e._$AA,r=e._$AB.nextSibling;for(;n!==r;){var i=n.nextSibling;n.remove(),n=i}};var ix=function(e,t,n){var r=new Map;for(var i=t;i<=n;i++)r.set(e[i],i);return r},iE=ih(/*#__PURE__*/function(e){"use strict";p(t,e);function t(e){s(this,t);var n;if(n=a(this,t,[e]),e.type!==ic.CHILD)throw Error("repeat() can only be used in text expressions");return n}c(t,[{key:"dt",value:function e(e,t,n){var r;n===void 0?n=t:t!==void 0&&(r=t);var i=[],o=[],a=0;var s=true,l=false,u=undefined;try{for(var c=e[Symbol.iterator](),h;!(s=(h=c.next()).done);s=true){var d=h.value;i[a]=r?r(d,a):a,o[a]=n(d,a),a++}}catch(e){l=true;u=e}finally{try{if(!s&&c.return!=null){c.return()}}finally{if(l){throw u}}}return{values:o,keys:i}}},{key:"render",value:function e(e,t,n){return this.dt(e,t,n).values}},{key:"update",value:function e(e,t){var n=S(t,3),r=n[0],i=n[1],o=n[2];var a=ik(e),s=this.dt(r,i,o),l=s.values,u=s.keys;if(!Array.isArray(a))return this.ut=u,l;var c;var h=(c=this.ut)!==null&&c!==void 0?c:this.ut=[],d=[],f,p,v=0,y=a.length-1,m=0,g=l.length-1;for(;v<=y&&m<=g;)if(a[v]===null)v++;else if(a[y]===null)y--;else if(h[v]===u[m])d[m]=ig(a[v],l[m]),v++,m++;else if(h[y]===u[g])d[g]=ig(a[y],l[g]),y--,g--;else if(h[v]===u[g])d[g]=ig(a[v],l[g]),im(e,d[g+1],a[v]),v++,g--;else if(h[y]===u[m])d[m]=ig(a[y],l[m]),im(e,a[v],a[y]),y--,m++;else if(f===void 0&&(f=ix(u,m,g),p=ix(h,v,y)),f.has(h[v]))if(f.has(h[y])){var b=p.get(u[m]),_=b!==void 0?a[b]:null;if(_===null){var k=im(e,a[v]);ig(k,l[m]),d[m]=k}else d[m]=ig(_,l[m]),im(e,a[v],_),a[b]=null;m++}else iw(a[y]),y--;else iw(a[v]),v++;for(;m<=g;){var w=im(e,d[g+1]);ig(w,l[m]),d[m++]=w}for(;v<=y;){var x=a[v++];x!==null&&iw(x)}return this.ut=u,i_(e,d),rc}}]);return t}(id));var iq=nC(ef());var iA=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t);e.startPoint=null;e.endPoint=null;e._correctLines=[];e._response=[];e.addEventListener("qti-register-hotspot",e.positionHotspotOnRegister);return e}c(t,[{key:"reset",value:function e(){this._response=[],this._correctLines=[]}},{key:"validate",value:function e(){return this.response.length>0}},{key:"response",get:function e(){return this._response},set:function e(e){this._response=e}},{key:"toggleInternalCorrectResponse",value:function e(e,t){if(!t){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 e(){var e=this;var t,n,r,i;return rs(em(),rG((t=this.grImage[0])===null||t===void 0?void 0:t.width),rG((n=this.grImage[0])===null||n===void 0?void 0:n.height),(r=this.grImage[0])===null||r===void 0?void 0:r.width,(i=this.grImage[0])===null||i===void 0?void 0:i.height,iE(this.response||[],function(e){return e},function(t,n){return rl(ep(),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)})}),iE(this._correctLines||[],function(e){return e},function(t,n){return rl(ev(),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))}),this.startPoint&&rl(ey(),this.startCoord.x,this.startCoord.y,this.mouseCoord.x,this.mouseCoord.y))}},{key:"positionHotspotOnRegister",value:function e(e){var t=this.querySelector("img"),n=e.target,r=n.getAttribute("coords"),i=n.getAttribute("shape"),o=r.split(",").map(function(e){return parseInt(e)});tM(i,o,t,n)}},{key:"firstUpdated",value:function e(){var e=this;this.hotspots=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}}),this.hotspots.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){e.startPoint?e.endPoint||(e.endPoint=t.target,e._response=T(e.response).concat(["".concat(e.startPoint.getAttribute("identifier")," ").concat(e.endPoint.getAttribute("identifier"))]),e.saveResponse(e.response),e.startPoint=null,e.endPoint=null):(e.startPoint=t.target,e.startCoord={x:parseInt(e.startPoint.getAttribute("coords").split(",")[0]),y:parseInt(e.startPoint.getAttribute("coords").split(",")[1])})})})}},{key:"disconnectedCallback",value:function e(){d(f(t.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}}]);return t}(r3);iA.styles=iq,tF([i()],iA.prototype,"_correctLines",2),tF([i()],iA.prototype,"startCoord",2),tF([i()],iA.prototype,"mouseCoord",2),tF([u({selector:"img"})],iA.prototype,"grImage",2),tF([i()],iA.prototype,"_response",2),iA=tF([rT("qti-graphic-associate-interaction")],iA);var iC=nC(eg());var iS=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"render",value:function e(){return rs(eb())}},{key:"positionHotspotOnRegister",value:function e(e){var t=e.target,n=t.getAttribute("coords"),r=t.getAttribute("shape"),i=n.split(",").map(function(e){return parseInt(e)});switch(r){case"circle":{var o=S(i,3),a=o[0],s=o[1],l=o[2];t.style.left=a-l+"px",t.style.top=s-l+"px",t.style.width=t.style.height=2*l+"px"}break;case"rect":{var u=S(i,4),c=u[0],h=u[1],d=u[2],f=u[3];t.style.left=c+"px",t.style.top=h+"px",t.style.width=d-c+"px",t.style.height=f-h+"px"}break;default:break}}},{key:"connectedCallback",value:function e(){d(f(t.prototype),"connectedCallback",this).call(this),this.addEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}},{key:"disconnectedCallback",value:function e(){d(f(t.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}}]);return t}(r0(r3,"qti-gap-img, qti-gap-text","qti-associable-hotspot","slot[part='drags']"));iS.styles=iC,iS=tF([rT("qti-graphic-gap-match-interaction")],iS);var iR=nC(e_());var iP=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e._choiceElements=[];return e}c(t,[{key:"render",value:function e(){return rs(ek())}},{key:"setHotspotOrder",value: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 i=this._choiceElements.length;if(!this.choiceOrdering){if(this.choiceOrdering=!0,r.order==null){var o=this._choiceElements.filter(function(e){return e.order!=null}).length;if(o>=i){this.choiceOrdering=!1;return}r.order=o+1}else{var a=r.order;r.order=null,this._choiceElements.forEach(function(e){e.order!=null&&e.order>a&&e.order--})}this.choiceOrdering=!1}}},{key:"toggleCorrectResponse",value:function e(e,t){var n;var r=this._choiceElements;var i=true,o=false,a=undefined;try{var s=function(){var r=u.value;if(t&&((n=e.correctResponse)===null||n===void 0?void 0:n.length)>0&&Array.isArray(e.correctResponse)){var i=e.correctResponse.findIndex(function(e){return e===r.identifier});i>=0?r.orderCorrect=i+1:r.orderCorrect=null}else r.orderCorrect=null};for(var l=r[Symbol.iterator](),u;!(i=(u=l.next()).done);i=true)s()}catch(e){o=true;a=e}finally{try{if(!i&&l.return!=null){l.return()}}finally{if(o){throw a}}}}},{key:"positionHotspotOnRegister",value:function e(e){var t=this.querySelector("img"),n=e.target,r=n.getAttribute("coords"),i=n.getAttribute("shape"),o=r.split(",").map(function(e){return parseInt(e)});tM(i,o,t,n)}},{key:"connectedCallback",value:function e(){d(f(t.prototype),"connectedCallback",this).call(this),this.addEventListener("activate-qti-hotspot-choice",this.setHotspotOrder),this.addEventListener("register-qti-hotspot-choice",this.positionHotspotOnRegister)}},{key:"disconnectedCallback",value:function e(){d(f(t.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("activate-qti-hotspot-choice",this.setHotspotOrder),this.removeEventListener("register-qti-hotspot-choice",this.positionHotspotOnRegister)}}]);return t}(r5(r3,"qti-hotspot-choice"));iP.styles=iR,iP=tF([rT("qti-graphic-order-interaction")],iP);var iM=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}return t}(tP(rR,"qti-hotspot-choice"));iM.styles=nC(ew()),tF([r({attribute:"aria-ordervalue",type:Number,reflect:!0})],iM.prototype,"order",2),tF([r({attribute:"aria-ordercorrectvalue",type:Number,reflect:!0})],iM.prototype,"orderCorrect",2),iM=tF([rT("qti-hotspot-choice")],iM);var iT=nC(ex());var iI=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"render",value:function e(){return rs(eE())}},{key:"positionHotspotOnRegister",value:function e(e){var t=this.querySelector("img"),n=e.target,r=n.getAttribute("coords"),i=n.getAttribute("shape"),o=r.split(",").map(function(e){return parseInt(e)});tM(i,o,t,n)}},{key:"connectedCallback",value:function e(){d(f(t.prototype),"connectedCallback",this).call(this),this.addEventListener("register-qti-hotspot-choice",this.positionHotspotOnRegister)}},{key:"disconnectedCallback",value:function e(){d(f(t.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("unregister-qti-hotspot-choice",this.positionHotspotOnRegister)}}]);return t}(r5(r3,"qti-hotspot-choice"));iI.styles=iT,iI=tF([rT("qti-hotspot-interaction")],iI);var iO=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e.render=function(){return rs(eq())};return e}return t}(r5(r3,"qti-hottext"));iO=tF([rT("qti-hottext-interaction")],iO);var iN=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"render",value:function e(){return rs(eA())}}]);return t}(tP(rR,"qti-hottext"));iN.styles=nC(eC()),iN=tF([rT("qti-hottext")],iN);var iU=/*#__PURE__*/function(e){"use strict";p(t,e);function t(e){s(this,t);var n;if(n=a(this,t,[e]),n.it=rh,e.type!==ic.CHILD)throw Error(n.constructor.directiveName+"() can only be used in child bindings");return n}c(t,[{key:"render",value:function e(e){if(e===rh||e==null)return this._t=void 0,this.it=e;if(e===rc)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;var t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}}]);return t}(id);iU.directiveName="unsafeHTML",iU.resultType=1;var iL=ih(iU);var i$=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e.options=[];e.correctOption="";e.dataPrompt="select";return e}c(t,[{key:"render",value:function e(){return rs(eP(),this.choiceSelected,this.disabled,this.readonly,this.options.map(function(e){return rs(eR(),e.value,e.selected,iL(e.textContent))}),iL(this.correctOption))}},{key:"connectedCallback",value:function e(){d(f(t.prototype),"connectedCallback",this).call(this),this.addEventListener("on-dropdown-selected",this.choiceSelected);var e=Array.from(this.querySelectorAll("qti-inline-choice"));this.options=[{textContent:this.dataPrompt,value:"",selected:!1}].concat(T(e.map(function(e){return{textContent:e.innerHTML,value:e.getAttribute("identifier"),selected:!1}})))}},{key:"disconnectedCallback",value:function e(){this.removeEventListener("on-dropdown-selected",this.choiceSelected)}},{key:"validate",value:function e(){var e=this.options.find(function(e){return e.selected});return e?e.value!=="":!1}},{key:"reset",value:function e(){this.options=this.options.map(function(e,t){return x(k({},e),{selected:t===0})})}},{key:"response",get:function e(){var e;return((e=this.options.find(function(e){return e.selected}))===null||e===void 0?void 0:e.value)||null},set:function e(e){this.options=this.options.map(function(t){return e&&e===t.value&&(t.selected=!0),t})}},{key:"toggleInternalCorrectResponse",value:function e(e,t){var n=this;var r;if(this.correctResponse=t&&((r=e.correctResponse)===null||r===void 0?void 0:r.toString()),!this.correctResponse){this.correctOption="";return}this.correctOption='<span part="correct-option" style="border:1px solid var(--qti-correct); border-radius:4px; padding: 2px 4px; margin: 4px; display:inline-block">'.concat(this.options.find(function(e){return n.correctResponse===e.value}).textContent,"</span>")}},{key:"choiceSelected",value:function e(e){var t=e.target.value;this.options=this.options.map(function(e){return x(k({},e),{selected:e.value===t})}),this.saveResponse(t)}}],[{key:"styles",get:function e(){return[nC(eS())]}}]);return t}(r3);i$.inputWidthClass=["","qti-input-width-2","qti-input-width-1","qti-input-width-3","qti-input-width-4","qti-input-width-6","qti-input-width-10","qti-input-width-15","qti-input-width-20","qti-input-width-72"],tF([i()],i$.prototype,"options",2),tF([i()],i$.prototype,"correctOption",2),tF([r({attribute:"data-prompt",type:String})],i$.prototype,"dataPrompt",2),i$=tF([rT("qti-inline-choice-interaction")],i$);var iD=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"connectedCallback",value:function e(){d(f(t.prototype),"connectedCallback",this).call(this),this.addEventListener("click",this._onSelectInlineChoice),this.dispatchEvent(new CustomEvent("qti-inline-choice-register",{bubbles:!0,composed:!0,cancelable:!1}))}},{key:"disconnectedCallback",value:function e(){this.removeEventListener("click",this._onSelectInlineChoice)}},{key:"render",value:function e(){return rs(eT())}},{key:"_onSelectInlineChoice",value:function e(){this.dispatchEvent(new CustomEvent("qti-inline-choice-select",{bubbles:!0,cancelable:!1,composed:!0,detail:{identifier:this.identifier}}))}}],[{key:"styles",get:function e(){return[nC(eM())]}}]);return t}(rR);tF([r({type:String})],iD.prototype,"identifier",2),iD=tF([rT("qti-inline-choice")],iD);var iV=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e.matchMin=0;e.matchMax=1;e.fixed=!1;return e}c(t,[{key:"connectedCallback",value:function e(){d(f(t.prototype),"connectedCallback",this).call(this),this.setAttribute("slot","qti-simple-associable-choice"),this.setAttribute("part","qti-simple-associable-choice")}},{key:"render",value:function e(){return rs(eI())}}]);return t}(tP(rR,"qti-simple-associable-choice"));iV.styles=nC(eO()),tF([r({type:Number,attribute:"match-min"})],iV.prototype,"matchMin",2),tF([r({type:Number,attribute:"match-max"})],iV.prototype,"matchMax",2),tF([r({type:String,attribute:"fixed",converter:{fromAttribute:function(e){return e==="true"},toAttribute:function(e){return String(e)}}})],iV.prototype,"fixed",2),iV=tF([rT("qti-simple-associable-choice")],iV);var ij=nC(eN());var iH=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e.lastCheckedRadio=null;e.class="";e._response=[];e.responseIdentifier="";e.correctOptions=null;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,i=n.name,o=n.type;n.checked?(e.response?e.response.indexOf(r)===-1&&(o==="radio"&&(e.response=(e.response||[]).filter(function(e){return e.indexOf(i)===-1})),e.response=T(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)?T(e.response):e.response}}))};return e}c(t,[{key:"response",get:function e(){return this.classList.contains("qti-match-tabular")?this._response:d(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:"connectedCallback",value:function e(){var e=this;var n=this,r=function(){return d(f(t.prototype),"connectedCallback",e)};return o(function(){return L(this,function(e){r().call(n),this.rows=Array.from(this.querySelectorAll("qti-simple-match-set:first-of-type qti-simple-associable-choice")),this.cols=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 e(){var e;return this.class.split(" ").includes("qti-match-tabular")?((e=this.response)===null||e===void 0?void 0:e.length)===this.rows.length:d(f(t.prototype),"validate",this).call(this)}},{key:"toggleCorrectResponse",value:function e(e,t){var n=this;if(e.correctResponse){var r=(Array.isArray(e.correctResponse)?e.correctResponse:[e.correctResponse]).map(function(e){var t=S(e.split(" "),2),n=t[0],r=t[1];return{text:n,gap:r}});this.class.split(" ").includes("qti-match-tabular")?t?this.correctOptions=r||[]:this.correctOptions=null:t?(this.querySelectorAll(".correct-option").forEach(function(e){return e.remove()}),this.cols.forEach(function(e){var t=e.getAttribute("identifier"),i=r.find(function(e){return e.gap===t});if(i===null||i===void 0?void 0:i.text){var o,a,s;var l=(a=n.querySelector('qti-simple-associable-choice[identifier="'.concat(i.text,'"]')))===null||a===void 0?void 0:(o=a.textContent)===null||o===void 0?void 0:o.trim();if(l&&!((s=e.previousElementSibling)===null||s===void 0?void 0:s.classList.contains("correct-option"))){var u=document.createElement("span");u.classList.add("correct-option"),u.textContent=l,u.style.border="1px solid var(--qti-correct)",u.style.borderRadius="4px",u.style.padding="2px 4px",u.style.display="inline-block",e.insertAdjacentElement("beforebegin",u)}}})):this.correctOptions=null}else this.querySelectorAll(".correct-option").forEach(function(e){return e.remove()})}},{key:"render",value:function e(){var e=this;var t=this.class.split(" ").includes("qti-match-tabular"),n=this.correctOptions!==null;return rs(ej(),t,t?rs(eV(),this.cols.map(function(e){return rs(eU(),iL(e.innerHTML))}),this.rows.map(function(t){return rs(eD(),iL(t.innerHTML),e.cols.map(function(r){var i,o,a;var s=t.getAttribute("identifier"),l=r.getAttribute("identifier"),u="".concat(s," ").concat(l),c=(e.response||[]).filter(function(e){return e.split(" ")[0]===s}).length||0,h=((i=e.response)===null||i===void 0?void 0:i.includes(u))||!1,d=t.matchMax===1?"radio":"checkbox",f=!!((o=e.correctOptions)===null||o===void 0?void 0:o.find(function(e){return e.text===s&&e.gap===l})),p=d==="radio"?"rb ".concat(h?"rb-checked":""," ").concat(n?f?"rb-correct":"rb-incorrect":""):"cb ".concat(h?"cb-checked":""," ").concat(n?f?"cb-correct":"cb-incorrect":""),v=((a=e.correctOptions)===null||a===void 0?void 0:a.length)>0?!0:t.matchMax===1?!1:t.matchMax!==0&&c>=t.matchMax&&!h;return rs(e$(),d,p,s,u,v,function(t){return e.handleRadioChange(t)},function(n){return t.matchMax===1?e.handleRadioClick(n):null},d==="checkbox"&&h?rs(eL()):"")}))})):rh)}}]);return t}(r0(r3,"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"));iH.styles=ij,tF([r({type:String})],iH.prototype,"class",2),tF([i()],iH.prototype,"_response",2),tF([r({type:String,attribute:"response-identifier"})],iH.prototype,"responseIdentifier",2),tF([i()],iH.prototype,"correctOptions",2),iH=tF([rT("qti-match-interaction")],iH);var iQ=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t);e._value=null;return e}c(t,[{key:"reset",value:function e(){}},{key:"validate",value:function e(){return!0}},{key:"response",get:function e(){return this._value?this._value.toString():null},set:function e(e){if(e)if(!isNaN(parseInt(e===null||e===void 0?void 0:e.toString())))this._value=parseInt(e.toString());else throw new Error("Value must be a number ".concat(e))}},{key:"render",value:function e(){return rs(eH())}},{key:"connectedCallback",value:function e(){var e=this;d(f(t.prototype),"connectedCallback",this).call(this);var n=this.querySelector("audio")||this.querySelector("video")||this.querySelector("object");n&&n.addEventListener("ended",function(){e._value++,e.saveResponse(e.value)})}}],[{key:"properties",get:function e(){return x(k({},r3.properties),{step:{type:Number,attribute:"step",default:10}})}}]);return t}(r3);iQ.styles=[nC(eQ())],iQ=tF([rT("qti-media-interaction")],iQ);var iF=nC(eF());var iz=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e.nrChoices=0;e.correctResponses=[];e.showCorrectResponses=!1;return e}c(t,[{key:"render",value:function e(){var e=Array.from(this.querySelectorAll("qti-simple-choice"));return this.nrChoices<e.length&&(this.nrChoices=e.length),rs(eB(),T(Array(this.nrChoices)).map(function(e,t){return rs(ez(),t)}))}},{key:"toggleCorrectResponse",value:function e(e,t){var n=this;if(this.shadowRoot.querySelectorAll(".correct-option").forEach(function(e){return e.remove()}),t&&e.correctResponse){var r=(Array.isArray(e.correctResponse)?e.correctResponse:[e.correctResponse]).map(function(e){return e.split(" ")[0]}),i=new Set;this.querySelectorAll("qti-simple-choice").forEach(function(e,t){var o;var a=e.getAttribute("identifier");if(!a||!r.includes(a)||i.has(a))return;i.add(a);var s=(o=e.textContent)===null||o===void 0?void 0:o.trim();if(!s)return;var l=n.shadowRoot.querySelector('drop-list[identifier="droplist'.concat(t,'"]'));if(!l)return;var u=document.createElement("span");u.classList.add("correct-option"),u.textContent=s,u.style.border="1px solid var(--qti-correct)",u.style.borderRadius="4px",u.style.padding="2px 4px",u.style.display="inline-block",u.style.marginTop="4px",l.insertAdjacentElement("afterend",u)})}}},{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(){return Array.from(this.shadowRoot.querySelectorAll("drop-list")).map(function(e){var t=e.querySelectorAll('[qti-draggable="true"]');return T(Array.from(t).map(function(e){return e.getAttribute("identifier")})).join(" ")})}},{key:"firstUpdated",value:function e(e){var n=this;var r=this,i=function(){return d(f(t.prototype),"firstUpdated",n)};return o(function(){return L(this,function(t){i().call(r,e),this.childrenMap=Array.from(this.querySelectorAll("qti-simple-choice")),this.childrenMap.forEach(function(e){return e.setAttribute("part","qti-simple-choice")});return[2]})}).call(this)}}]);return t}(r0(r3,"qti-simple-choice","drop-list","slot[part='drags']"));iz.styles=iF,tF([i()],iz.prototype,"nrChoices",2),tF([i()],iz.prototype,"correctResponses",2),tF([i()],iz.prototype,"showCorrectResponses",2),tF([r({type:String})],iz.prototype,"orientation",2),iz=tF([rT("qti-order-interaction")],iz);var iB=nC(eW());var iW=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;var n,r=arguments;e=a(this,t,T(r)),n=e;n._iframeLoaded=!1;n._pendingMessages=[];n._responseCheckInterval=null;n.requirePathsJson="";n.requireShimJson="";n.requireJsUrl="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js";n.baseUrl="";n.useIframe=!1;n.useDefaultShims=!1;n.useDefaultPaths=!1;n._errorMessage=null;n.response=[];n._parsedRequirePaths=null;n._parsedRequireShim=null;n.handleIframeMessage=function(e){var t=e.data;if(!(!t||t.source!=="qti-pci-iframe"))switch(t.method){case"iframeReady":n.initializeInteraction(),n.processPendingMessages(),n.dispatchEvent(new CustomEvent("qti-portable-custom-interaction-loaded",{bubbles:!0}));break;case"resize":typeof t.height=="number"&&n.iframe&&(n.iframe.style.height="".concat(t.height,"px"),n.iframe.style.width="".concat(t.width,"px"));break;case"interactionChanged":{var r=n.convertQtiVariableJSON(t.params.value);n.response=r,n.validate(),n.saveResponse(n.response);break}case"error":n._errorMessage=t.params.message,console.error("Error from PCI iframe:",t.params.message);break}};n._onInteractionChanged=function(e){e.stopPropagation();var t=n.convertQtiVariableJSON(e.detail.value);n.response=t,n.saveResponse(t)};n.loadConfig=function(e,t){return o(function(){var r,i,o,a;return L(this,function(o){switch(o.label){case 0:e=n.removeDoubleSlashes(e);o.label=1;case 1:o.trys.push([1,5,,6]);return[4,fetch(e)];case 2:r=o.sent();if(!r.ok)return[3,4];return[4,r.json()];case 3:i=o.sent();for(var s in i.paths)t&&(i.paths[s]=n.getResolvablePath(i.paths[s],t));return[2,i];case 4:return[3,6];case 5:a=o.sent();return[3,6];case 6:return[2,null]}})})()};n.getResolvablePathString=function(e,t){return e=e.replace(/\.js$/,""),(e===null||e===void 0?void 0:e.toLocaleLowerCase().startsWith("http"))||!t?e:n.removeDoubleSlashes("".concat(t,"/").concat(e))};n.getResolvablePath=function(e,t){return Array.isArray(e)?e.map(function(e){return n.getResolvablePathString(e,t)}):n.getResolvablePathString(e,t)};n._previousState=null;return e}c(t,[{key:"getRequirePaths",value:function e(){var e=this;if(this._parsedRequirePaths===null&&this.requirePathsJson)try{var t=JSON.parse(this.requirePathsJson);Array.isArray(t)?(this._parsedRequirePaths={},t.forEach(function(t){t.name&&t.value&&(e._parsedRequirePaths[t.name]=t.value)})):this._parsedRequirePaths=t}catch(e){console.error("Error parsing require paths JSON:",e),this._errorMessage="Error parsing require paths JSON: ".concat(e.message),this._parsedRequirePaths={}}return this._parsedRequirePaths||{}}},{key:"getRequireShim",value:function e(){if(this._parsedRequireShim===null&&this.requireShimJson)try{this._parsedRequireShim=JSON.parse(this.requireShimJson)}catch(e){console.error("Error parsing require shim JSON:",e),this._errorMessage="Error parsing require shim JSON: ".concat(e.message),this._parsedRequireShim={}}return this._parsedRequireShim||{}}},{key:"getDefaultRequirePaths",value:function e(){return{"taoQtiItem/portableLib/OAT/util/event":"/assets/pci-scripts/portableLib/OAT/util/event","taoQtiItem/portableLib/OAT/util/html":"/assets/pci-scripts/portableLib/OAT/util/html","taoQtiItem/portableLib/OAT/util/EventMgr":"/assets/pci-scripts/portableLib/OAT/util/EventMgr","taoQtiItem/portableLib/OAT/util/math":"/assets/pci-scripts/portableLib/OAT/util/math","taoQtiItem/portableLib/OAT/util/xml":"/assets/pci-scripts/portableLib/OAT/util/xml","taoQtiItem/portableLib/OAT/util/tooltip":"/assets/pci-scripts/portableLib/OAT/util/tooltip","taoQtiItem/portableLib/jquery_2_1_1":"/assets/pci-scripts/portableLib/jquery_2_1_1","taoQtiItem/pci-scripts/portableLib/jquery.qtip":"/assets/portableLib/jquery.qtip","taoQtiItem/pci-scripts/portableLib/lodash":"/assets/pci-scripts/portableLib/lodash","taoQtiItem/pci-scripts/portableLib/raphael":"/assets/pci-scripts/portableLib/raphael","IMSGlobal/jquery_2_1_1":"/assets/pci-scripts/IMSGlobal/jquery_2_1_1","OAT/util/event":"/assets/pci-scripts/legacyPortableSharedLib/OAT/util/event","OAT/util/html":"/assets/pci-scripts/legacyPortableSharedLib/OAT/util/html","OAT/util/EventMgr":"/assets/pci-scripts/legacyPortableSharedLib/OAT/util/EventMgr","OAT/util/math":"/assets/pci-scripts/legacyPortableSharedLib/OAT/util/math","OAT/util/xml":"/assets/pci-scripts/legacyPortableSharedLib/OAT/util/xml","OAT/util/tooltip":"/assets/pci-scripts/legacyPortableSharedLib/OAT/util/tooltip","OAT/lodash":"/assets/pci-scripts/legacyPortableSharedLib/lodash",mathJax:"/assets/pci-scripts/mathjax/mathJax",css:"/assets/pci-scripts/css/css"}}},{key:"getDefaultRequireShim",value:function e(){return{mathJax:{exports:"MathJax",init:function e(){var e=window;if(e.MathJax)return e.MathJax.Hub.Config({showMathMenu:!1,showMathMenuMSIE:!1,menuSettings:{inTabOrder:!1}}),e.MathJax.Hub.Startup.MenuZoom=function(){},e.MathJax.Hub.Startup.onload(),e.MathJax}}}}},{key:"getFinalRequirePaths",value:function e(){var e=this.getDefaultRequirePaths(),t=this.getRequirePaths();return this.useDefaultPaths?k({},e,t):t}},{key:"getFinalRequireShim",value:function e(){var e=this.getRequireShim(),t=this.getDefaultRequireShim();return this.useDefaultShims?k({},t,e):e}},{key:"convertQtiVariableJSON",value: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 i=n[r];if(Array.isArray(i))return i.map(String);if(i!=null)return String(i)}}}return null}},{key:"addHyphenatedKeys",value: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}},{key:"responseVariablesToQtiVariableJSON",value:function e(e,t,n){if(t!=="single"){var r={list:{}};return r.list[n]=e,r}else{var i={base:{}};return i.base[n]=e,i}}},{key:"validate",value:function e(){return!0}},{key:"value",get:function e(){var e,t;if(this.useIframe)return((e=this._value)===null||e===void 0?void 0:e.toString())||null;{var n;var r=(n=this.pci)===null||n===void 0?void 0:n.getResponse();if(r){var i=this.convertQtiVariableJSON(r);return Array.isArray(i)?i.join(","):i}}return Array.isArray(this._value)?this._value.join(","):((t=this._value)===null||t===void 0?void 0:t.toString())||null},set:function e(e){e===null?this._value=[]:this._value=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 i,o,a,s,l,u,c,h,d;var f=((a=this.context)===null||a===void 0?void 0:(o=a.variables)===null||o===void 0?void 0:(i=o.find(function(t){return t.identifier===e.responseIdentifier}))===null||i===void 0?void 0:i.cardinality)||"single",p=((u=this.context)===null||u===void 0?void 0:(l=u.variables)===null||l===void 0?void 0:(s=l.find(function(t){return t.identifier===e.responseIdentifier}))===null||s===void 0?void 0:s.baseType)||"string",v=((d=this.context)===null||d===void 0?void 0:(h=d.variables)===null||h===void 0?void 0:(c=h.find(function(t){return t.identifier===e.responseIdentifier}))===null||c===void 0?void 0:c.value)||null,y=this.responseVariablesToQtiVariableJSON(v,f,p);r[this.responseIdentifier]=y}return r},set:function e(e){if(!e||!e[this.responseIdentifier])return;var t=this.convertQtiVariableJSON(e[this.responseIdentifier]);this._value=t,this.saveResponse(t)}},{key:"unescapeHtml",value:function e(e){return e&&e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(///g,"/").replace(/`/g,"`").replace(/=/g,"=")}},{key:"unescapeDataAttributes",value:function e(e){var t={};var n=true,r=false,i=undefined;try{for(var o=Object.entries(e)[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){var s=S(a.value,2),l=s[0],u=s[1];typeof u=="string"?t[l]=this.unescapeHtml(u):t[l]=u}}catch(e){r=true;i=e}finally{try{if(!n&&o.return!=null){o.return()}}finally{if(r){throw i}}}return t}},{key:"register",value:function e(e){var t=this;this.pci=e,this.dom=this.querySelector("qti-interaction-markup"),this.dom||(this.dom=document.createElement("div"),this.appendChild(this.dom)),this.dom.classList.add("qti-customInteraction"),this.dom.style.width="100%",this.dom.style.minHeight="50px",this.dom.style.display="block",this.dom.addEventListener("qti-interaction-changed",this._onInteractionChanged),this.querySelector("properties")&&(this.querySelector("properties").style.display="none");var n={properties:this.addHyphenatedKeys(this.unescapeDataAttributes(k({},this.dataset))),contextVariables:{},templateVariables:{},onready:function(e){t.pci=e;try{var n=new ResizeObserver(function(e){var n=true,r=false,i=undefined;try{for(var o=e[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){var s=a.value;s.contentRect&&s.contentRect.height>0&&(t.style.height="".concat(s.contentRect.height+20,"px"))}}catch(e){r=true;i=e}finally{try{if(!n&&o.return!=null){o.return()}}finally{if(r){throw i}}}});n.observe(t.dom),t._resizeObserver=n}catch(e){console.warn("ResizeObserver not supported, falling back to static sizing")}},ondone:function(e,n,r,i){t.response=t.convertQtiVariableJSON(n),t.saveResponse(t.response)},responseIdentifier:this.responseIdentifier,boundTo:this.boundTo};if(e.getInstance)e.getInstance(this.dom,n,void 0);else{var r=function(e){var t={},n=function(e){var t={};Object.entries(e.dataset).forEach(function(e){var n=S(e,2),r=n[0],i=n[1];r.includes("__")||(t[r]=i)});var n={};return Object.entries(e.dataset).forEach(function(e){var t=S(e,2),r=t[0],i=t[1];var o=r.split("__");if(o.length>1){var a=S(o,3),s=a[0],l=a[1],u=a[2];n[s]=n[s]||{},n[s][l]=n[s][l]||{},n[s][l][u]=i}}),Object.entries(n).forEach(function(e){var n=S(e,2),r=n[0],i=n[1];t[r]=Object.values(i)}),t}(e);for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];r==="config"?t[r]=JSON.parse(i):t[r]=i}return t}(this);e.initialize(this.customInteractionTypeIdentifier,this.dom.firstElementChild||this.dom,Object.keys(r).length?r:null)}}},{key:"disconnectedCallback",value:function e(){if(d(f(t.prototype),"disconnectedCallback",this).call(this),this.useIframe)window.removeEventListener("message",this.handleIframeMessage);else{this.stopResponseCheck(),this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null),requirejs.undef(this.customInteractionTypeIdentifier);var e=requirejs.s.contexts;delete e[this.customInteractionTypeIdentifier],this.removeEventListener("qti-interaction-changed",this._onInteractionChanged)}}},{key:"sendMessageToIframe",value:function e(e,t){if(!this._iframeLoaded){this._pendingMessages.push({method:e,params:t});return}this.iframe.contentWindow.postMessage({source:"qti-portable-custom-interaction",method:e,params:t},"*")}},{key:"processPendingMessages",value:function e(){var e=this;this._pendingMessages.length&&(this._pendingMessages.forEach(function(t){e.sendMessageToIframe(t.method,t.params)}),this._pendingMessages=[])}},{key:"createIframe",value:function e(){var e=this;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,e.addMarkupToIframe(),e.sendIframeInitData()};var t="qti-pci-".concat(this.responseIdentifier,"-").concat(Date.now());this.iframe.name=t;var n=this.generateIframeContent(),r=encodeURIComponent(n);this.iframe.src="data:text/html;charset=utf-8,".concat(r),this.appendChild(this.iframe)}},{key:"sendIframeInitData",value:function e(){var e={module:this.module,customInteractionTypeIdentifier:this.customInteractionTypeIdentifier,baseUrl:this.baseUrl?this.baseUrl.startsWith("http")||this.baseUrl.startsWith("blob")||this.baseUrl.startsWith("base64")?this.baseUrl:tR("".concat(window.location.origin).concat(this.baseUrl)):window.location.origin,responseIdentifier:this.responseIdentifier,dataAttributes:k({},this.dataset),interactionModules:this.getInteractionModules(),boundTo:this.boundTo};this.sendMessageToIframe("initialize",e)}},{key:"getInteractionModules",value:function e(){var e=[],t=this.querySelector("qti-interaction-modules");if(t){var n=t.querySelectorAll("qti-interaction-module");var r=true,i=false,o=undefined;try{for(var a=n[Symbol.iterator](),s;!(r=(s=a.next()).done);r=true){var l=s.value;e.push({id:l.getAttribute("id"),primaryPath:l.getAttribute("primary-path"),fallbackPath:l.getAttribute("fallback-path")})}}catch(e){i=true;o=e}finally{try{if(!r&&a.return!=null){a.return()}}finally{if(i){throw o}}}}return e}},{key:"addMarkupToIframe",value:function e(){var e=this.querySelector("qti-interaction-markup");e&&this.sendMessageToIframe("setMarkup",e.innerHTML);var t=this.querySelector("properties");t&&this.sendMessageToIframe("setProperties",t.innerHTML)}},{key:"initializeInteraction",value:function e(){}},{key:"connectedCallback",value:function e(){var e=this;if(d(f(t.prototype),"connectedCallback",this).call(this),this.useIframe)window.addEventListener("message",this.handleIframeMessage),this.createIframe();else{define("qtiCustomInteractionContext",function(){return{register:function(t){e.register(t)},notifyReady:function(){}}});var n=this.buildRequireConfig();if(n){var r=requirejs.config(n);requirejs.onError=function(e){throw console.error("RequireJS error:",e),e.requireType==="timeout"&&console.error("Modules that timed out:",e.requireModules),e},r(["require"],function(t){try{t([e.module],function(){},function(e){console.error("Error loading module:",e)})}catch(e){console.error("Error in require call:",e)}})}}}},{key:"stopResponseCheck",value:function e(){this._responseCheckInterval!==null&&(window.clearInterval(this._responseCheckInterval),this._responseCheckInterval=null)}},{key:"buildRequireConfig",value:function e(){var e={context:this.customInteractionTypeIdentifier,catchError:!0,paths:k({},this.getFinalRequirePaths(),window.requirePaths||{}),shim:k({},this.getFinalRequireShim(),window.requireShim||{})};if(!globalThis.require)return this._errorMessage="RequireJS not found. Please load it via CDN: https://cdnjs.com/libraries/require.js",null;var t=this.getAttribute("data-base-url"),n=this.querySelector("qti-interaction-modules");if(n){var r=n.querySelectorAll("qti-interaction-module");var i=true,o=false,a=undefined;try{for(var s=r[Symbol.iterator](),l;!(i=(l=s.next()).done);i=true){var u=l.value;var c=u.getAttribute("id"),h=u.getAttribute("primary-path"),d=u.getAttribute("fallback-path");if(c&&h){var f=d?this.combineRequireResolvePaths(this.getResolvablePath(h,t),this.getResolvablePath(d,t)):this.getResolvablePath(h,t),p=e.paths[c]||[];e.paths[c]=this.combineRequireResolvePaths(p,f)}}}catch(e){o=true;a=e}finally{try{if(!i&&s.return!=null){s.return()}}finally{if(o){throw a}}}}return e}},{key:"combineRequireResolvePaths",value:function e(e,t){var n=Array.isArray(e)?e:[e],r=Array.isArray(t)?t:[t];return n.concat(r).filter(function(e,t,n){return n.indexOf(e)===t})}},{key:"removeDoubleSlashes",value:function e(e){return e.replace(/([^:]\/)\/+/g,"$1").replace(/\/\//g,"/").replace("http:/","http://").replace("https:/","https://")}},{key:"generateIframeContent",value:function e(){var e=window.getComputedStyle(document.body),t=JSON.stringify(this.getFinalRequirePaths()),n=JSON.stringify(this.getFinalRequireShim()),r="\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(window.location.origin,'" />\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(r,'\n }\n .qti-customInteraction {\n width: 100%;\n height: 100%;\n }\n #pci-container {\n width: 100%;\n </style>\n <script src="').concat(this.requireJsUrl,'"><\/script>\n <script>\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(this.dataset.baseUrl,"',\n shim: window.requireShim,\n onNodeCreated: function(node, config, moduleName, url) {\n console.log('RequireJS creating node for module:', moduleName, 'URL:', url);\n\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 source: 'qti-pci-iframe',\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 // PCI Manager for iframe implementation\n window.PCIManager = {\n pciInstance: null,\n container: null,\n customInteractionTypeIdentifier: null,\n\n initialize: function(config) {\n this.customInteractionTypeIdentifier = config.customInteractionTypeIdentifier;\n this.container = document.getElementById('pci-container');\n this.container.classList.add('qti-customInteraction');\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 getResolvablePathString(path, basePath) {\n path = path.replace(/\\.js$/, '');\n return path?.toLocaleLowerCase().startsWith('http') || !basePath\n ? path\n : removeDoubleSlashes(`${basePath}/${path}`);\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, module.fallbackPath, config.baseUrl\n );\n window.requirePaths[module.id] = currentPaths.concat(newPath).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: this.addHyphenatedKeys(this.unescapeDataAttributes({ ...config.dataAttributes })),\n contextVariables: config.contextVariables || {},\n templateVariables: config.templateVariables || {},\n onready: pciInstance => {\n this.pciInstance = pciInstance;\n this.notifyReady();\n },\n ondone: (pciInstance, response, state, status) => {\n this.notifyInteractionChanged(response);\n },\n responseIdentifier: config.responseIdentifier,\n boundTo: config.boundTo,\n };\n\n if (pciInstance.getInstance) {\n pciInstance.getInstance(this.container, pciConfig, undefined);\n } else {\n // TAO custom interaction initialization\n const restoreTAOConfig = (dataset) => {\n const config = {};\n const parseDataAttributes = () => {\n const result = {};\n\n // Separate direct attributes from nested ones\n Object.entries(dataset || []).forEach(([key, value]) => {\n if (!key.includes('__')) {\n // Direct attributes (like version)\n result[key] = value;\n }\n });\n\n // Parse nested attributes\n const nestedData = {};\n\n Object.entries(dataset || []).forEach(([key, value]) => {\n const parts = key.split('__');\n if (parts.length > 1) {\n const [group, index, prop] = parts;\n nestedData[group] = nestedData[group] || {};\n nestedData[group][index] = nestedData[group][index] || {};\n nestedData[group][index][prop] = value;\n }\n });\n\n // Convert nested groups to arrays\n Object.entries(nestedData).forEach(([key, group]) => {\n result[key] = Object.values(group);\n });\n return result;\n };\n const data = parseDataAttributes();\n for (const key in data) {\n if (Object.prototype.hasOwnProperty.call(data, key)) {\n const value = data[key];\n if (key === 'config') {\n config[key] = JSON.parse(value);\n } else {\n config[key] = value;\n }\n }\n }\n return config;\n };\n const taoConfig = restoreTAOConfig(config.dataAttributes);\n\n this.pciInstance.initialize(\n this.customInteractionTypeIdentifier,\n this.container.firstElementChild || this.container,\n Object.keys(taoConfig).length ? taoConfig : null\n );\n }\n },\n notifyReady: () => {\n // Notify parent that the PCI is ready\n window.parent.postMessage({\n source: 'qti-pci-iframe',\n method: 'pciReady'\n }, '*');\n }\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], () => {\n }, 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 source: 'qti-pci-iframe',\n method: 'iframeReady'\n }, '*');\n },\n\n notifyInteractionChanged: function(response) {\n window.parent.postMessage({\n source: 'qti-pci-iframe',\n method: 'interactionChanged',\n params: { value: response }\n }, '*');\n },\n\n notifyError: function(message) {\n console.error('PCI Error:', message);\n window.parent.postMessage({\n source: 'qti-pci-iframe',\n method: 'error',\n params: { message: message }\n }, '*');\n },\n\n setMarkup: function(markupHtml) {\n this.container = document.getElementById('pci-container');\n this.container.innerHTML = markupHtml;\n },\n\n addHyphenatedKeys: function(properties) {\n const updatedProperties = { ...properties };\n for (const key in properties) {\n if (Object.prototype.hasOwnProperty.call(properties, key)) {\n const hyphenatedKey = key.replace(/[A-Z]/g, char => `-${char.toLowerCase()}`);\n updatedProperties[hyphenatedKey] = properties[key];\n }\n }\n return updatedProperties;\n },\n unescapeDataAttributes: function(obj) {\n const unescaped = {};\n for (const [key, value] of Object.entries(obj)) {\n if (typeof value === 'string') {\n unescaped[key] = value\n .replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>')\n .replace(/"/g, '\"')\n .replace(/'/g, \"'\")\n .replace(///g, '/')\n .replace(/`/g, '`')\n .replace(/=/g, '=');\n } else {\n unescaped[key] = value;\n }\n }\n return unescaped;\n },\n };\n\n // Set up message listener for communication with parent\n window.addEventListener('message', function(event) {\n const { data } = event;\n\n // Ensure the message is from our parent\n if (!data || data.source !== 'qti-portable-custom-interaction') {\n return;\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 // Handle setting boundTo\n break;\n\n case 'setProperties':\n // Handle setting properties\n break;\n }\n });\n\n // Notify parent that iframe has loaded\n window.addEventListener('load', function() {\n window.parent.postMessage({\n source: 'qti-pci-iframe',\n method: 'iframeLoaded'\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 source: 'qti-pci-iframe',\n method: 'resize',\n height: newHeight,\n width: container.scrollWidth\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.pciInstance && PCIManager.pciInstance.getResponse) {\n const response = PCIManager.pciInstance.getResponse();\n const responseStr = JSON.stringify(response);\n\n if (responseStr !== lastResponseStr) {\n lastResponseStr = responseStr;\n window.parent.postMessage({\n source: 'qti-pci-iframe',\n method: 'interactionChanged',\n params: { value: response }\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 e(e,t){var n;this.correctResponse=t?e===null||e===void 0?void 0:e.correctResponse:e.cardinality==="single"?"":[];var r="correct-response-container-".concat(this.responseIdentifier),i=(n=this.parentElement)===null||n===void 0?void 0:n.querySelectorAll("#".concat(r));if(i&&i.forEach(function(e){e.remove()}),t)this.disable();else{this.enable();return}if(!t||!(e===null||e===void 0?void 0:e.correctResponse))return;var o=document.createElement("div");o.id=r,o.className="pci-correct-response-container",o.style.position="relative",o.style.marginTop="20px",o.style.border="2px solid green",o.style.padding="16px",o.style.borderRadius="4px",o.style.backgroundColor="rgba(0, 128, 0, 0.05)";var a=document.createElement("div");a.textContent="Correct Response:",a.style.fontWeight="bold",a.style.marginBottom="10px",a.style.color="green",o.appendChild(a);var s=document.createElement("qti-portable-custom-interaction");Array.from(this.attributes).forEach(function(e){e.name!=="id"&&e.name!=="response-identifier"&&s.setAttribute(e.name,e.value)});var l=this.responseIdentifier;s.responseIdentifier="".concat(l,"-correct"),Array.from(this.children).forEach(function(e){var t=e.cloneNode(!0);s.appendChild(t)});var u=e.correctResponse;if(this.useIframe){var c=s.connectedCallback;s.connectedCallback=function(){var t=this;c.call(this);var n=function(){return t._iframeLoaded?(setTimeout(function(){var n=t.responseVariablesToQtiVariableJSON(u,e.cardinality,e.baseType);t.sendMessageToIframe("setBoundTo",h({},l,n)),t.sendMessageToIframe("setState",{state:"review"})},1e3),!0):!1};if(!n()){var r=setInterval(function(){n()&&clearInterval(r)},100);setTimeout(function(){clearInterval(r)},1e4)}}}else{var d=s.register;s.register=function(t){var n=this;d.call(this,t);var r=function(){if(n.pci&&typeof n.pci.setResponse=="function"){var t=n.responseVariablesToQtiVariableJSON(u,e.cardinality,e.baseType);return n.pci.setResponse(t),typeof n.pci.setState=="function"&&n.pci.setState("review"),!0}return!1};setTimeout(function(){if(!r()){var e=setInterval(function(){r()&&clearInterval(e)},200);setTimeout(function(){clearInterval(e)},5e3)}},500)}}s.style.pointerEvents="none",o.appendChild(s),this.after(o)}},{key:"disable",value:function e(){if(this._previousState={pointerEvents:this.style.pointerEvents,position:this.style.position},this.useIframe&&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(),this._previousState&&(this._previousState.pointerEvents&&(this.style.pointerEvents=this._previousState.pointerEvents),this._previousState.position&&(this.style.position=this._previousState.position),this._previousState=null),this.useIframe&&this.sendMessageToIframe("setState",{state:"interacting"})}},{key:"render",value:function e(){return rs(eG(),this._errorMessage?rs(eJ(),this._errorMessage):"")}}]);return t}(r3);iW.styles=[iB,nC(eX())],tF([r({type:String,attribute:"module"})],iW.prototype,"module",2),tF([r({type:String,attribute:"custom-interaction-type-identifier"})],iW.prototype,"customInteractionTypeIdentifier",2),tF([r({type:String,attribute:"data-require-paths"})],iW.prototype,"requirePathsJson",2),tF([r({type:String,attribute:"data-require-shim"})],iW.prototype,"requireShimJson",2),tF([r({type:String,attribute:"data-require-js-url"})],iW.prototype,"requireJsUrl",2),tF([r({type:String,attribute:"data-base-url"})],iW.prototype,"baseUrl",2),tF([r({type:Boolean,attribute:"data-use-iframe"})],iW.prototype,"useIframe",2),tF([r({type:Boolean,attribute:"data-use-default-shims"})],iW.prototype,"useDefaultShims",2),tF([r({type:Boolean,attribute:"data-use-default-paths"})],iW.prototype,"useDefaultPaths",2),tF([i()],iW.prototype,"_errorMessage",2),tF([t({context:rU,subscribe:!0}),i()],iW.prototype,"context",2),tF([i()],iW.prototype,"response",2),iW=tF([rT("qti-portable-custom-interaction")],iW);var iJ=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"render",value:function e(){return rs(eY())}}]);return t}(rR);iJ.styles=[nC(eK())];customElements.define("qti-position-object-interaction",iJ);var iG=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t),e.removeMoveListener=e.removeMoveListener.bind(e),e.dragElementHandler=e.dragElementHandler.bind(e);return e}c(t,[{key:"render",value:function e(){return rs(eZ())}},{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;d(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(){d(f(t.prototype),"disconnectedCallback",this).call(this),document.removeEventListener("mousemove",this.dragElementHandler),document.removeEventListener("mouseup",this.removeMoveListener)}}]);return t}(rR);iG.styles=[nC(e0())],iG=tF([rT("qti-position-object-stage")],iG);var iX="important",iY=" !"+iX,iK=ih(/*#__PURE__*/function(e){"use strict";p(t,e);function t(e){s(this,t);var n;var r;if(n=a(this,t,[e]),e.type!==ic.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}c(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=S(t,1),r=n[0];var i=e.element,o=i.style;if(this.ft===void 0)return this.ft=new Set(Object.keys(r)),this.render(r);var a=true,s=false,l=undefined;try{for(var u=this.ft[Symbol.iterator](),c;!(a=(c=u.next()).done);a=true){var h=c.value;r[h]==null&&(this.ft.delete(h),h.includes("-")?o.removeProperty(h):o[h]=null)}}catch(e){s=true;l=e}finally{try{if(!a&&u.return!=null){u.return()}}finally{if(s){throw l}}}for(var d in r){var f=r[d];if(f!=null){this.ft.add(d);var p=typeof f=="string"&&f.endsWith(iY);d.includes("-")||p?o.setProperty(d,p?f.slice(0,-11):f,p?iX:""):o[d]=f}}return rc}}]);return t}(id));var iZ=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e.maxChoices=1/0;e.minChoices=0;e.response=[];e._correctAreas=[];e._imgElement=null;e._scaleX=1;e._scaleY=1;e._imageWidthOrginal=0;e._imageHeightOrginal=0;e._onImageClick=function(t){if(!e._imgElement){console.warn("No <img> element found in <qti-select-point-interaction>");return}e.calculateScale();var n=e._imgElement.getBoundingClientRect(),r=(t.clientX-n.left)*e._scaleX,i=(t.clientY-n.top)*e._scaleY,o="".concat(r.toFixed()," ").concat(i.toFixed());e.maxChoices===1?e.response=[o]:(e.maxChoices===0||e.response.length<e.maxChoices)&&(e.response=T(e.response).concat([o])),e.saveResponse(e.response)};e._onResize=function(){e.calculateScale()};return e}c(t,[{key:"connectedCallback",value:function e(){d(f(t.prototype),"connectedCallback",this).call(this),window.addEventListener("resize",this._onResize)}},{key:"toggleCorrectResponse",value:function e(e,t){if(!t){this._correctAreas=[];return}var n=e.areaMapping,r=[];if(!n||n.areaMapEntries.length===0)if(e.correctResponse){var i=Array.isArray(e.correctResponse)?e.correctResponse:[e.correctResponse];if(i.length===0||i.find(function(e){return e.split(" ").length<2}))return console.error("No valid correct responses found for the response variable."),null;console.warn("No area mapping found for the response variable. Using the correct responses to display the correct response but it probably won't score correct."),r=i.map(function(e){return{shape:"circle",coords:e.split(" ").join(",").concat(",10"),defaultValue:1,mappedValue:1}})}else{console.error("No area mapping found for the response variable.");return}else r=n.areaMapEntries;this._correctAreas=r.map(function(e){return{coords:e.coords,shape:e.shape}})}},{key:"updated",value:function e(e){d(f(t.prototype),"updated",this).call(this,e);var n=this._imgElement;n&&e.has("_correctAreas")&&this._correctAreas.length>0&&(this.calculateScale(),this.shadowRoot.querySelectorAll("div").forEach(function(e){var t=e.dataset.coord,r=e.dataset.shape;t&&r&&tM(r,t.split(",").map(function(e){return+e}),n,e)}))}},{key:"render",value:function e(){var e=this;var t,n;return rs(e3(),iE(((t=this.response)===null||t===void 0?void 0:t.filter(function(e){return e}))||[],function(e){return e},function(t,n){var r=S(t.split(" ").map(Number),2),i=r[0],o=r[1],a=i/(e._imageWidthOrginal||1)*100,s=o/(e._imageHeightOrginal||1)*100,l=16,u=l/(e._imageWidthOrginal||1)*100,c=l/(e._imageHeightOrginal||1)*100;return rs(e1(),iK({pointerEvents:e.maxChoices===1?"none":"auto",position:"absolute",transform:"translate(-50%, -50%)",left:"".concat(a,"%"),top:"".concat(s,"%"),width:"min(".concat(u,"%, 1rem)"),height:"min(".concat(c,"%, 1rem)"),minWidth:"min(".concat(u,"%, 1rem)"),minHeight:"min(".concat(c,"%, 1rem)"),borderRadius:"50%",background:"red"}),t,function(t){t.stopPropagation(),e.response=(e.response||[]).filter(function(e,t){return t!==n}),e.saveResponse(e.response)})}),iE(((n=this._correctAreas)===null||n===void 0?void 0:n.filter(function(e){return e}))||[],function(e){return e},function(e,t){return rs(e2(),iK({position:"absolute",pointerEvents:"none",backgroundColor:"var(--qti-correct)",opacity:"0.5"}),e.coords,"correct-response-".concat(t+1),e.shape)}))}},{key:"reset",value:function e(){this.response=null}},{key:"validate",value:function e(){return this.response.length>=this.minChoices&&this.response.length<=this.maxChoices}},{key:"calculateScale",value:function e(){this._imageWidthOrginal=this._imgElement.getAttribute("width")?parseFloat(this._imgElement.getAttribute("width")):this._imgElement.naturalWidth,this._imageHeightOrginal=this._imgElement.getAttribute("height")?parseFloat(this._imgElement.getAttribute("height")):this._imgElement.naturalHeight;var e=this._imgElement.getBoundingClientRect();this._scaleX=e.width===0?1:this._imageWidthOrginal/e.width,this._scaleY=e.height===0?1:this._imageHeightOrginal/e.height}},{key:"firstUpdated",value:function e(){this._imgElement=this.querySelector("img"),this._imgElement?(this.calculateScale(),this._imgElement.addEventListener("click",this._onImageClick)):console.warn("No <img> element found in <qti-select-point-interaction>")}},{key:"disconnectedCallback",value:function e(){d(f(t.prototype),"disconnectedCallback",this).call(this),window.removeEventListener("resize",this._onResize),this._imgElement&&this._imgElement.removeEventListener("click",this._onImageClick)}}]);return t}(r3);iZ.styles=[nC(e4())],tF([r({type:Number,attribute:"max-choices"})],iZ.prototype,"maxChoices",2),tF([r({type:Number,attribute:"min-choices"})],iZ.prototype,"minChoices",2),tF([i()],iZ.prototype,"response",2),tF([i()],iZ.prototype,"_correctAreas",2),iZ=tF([rT("qti-select-point-interaction")],iZ);var i0=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e.templateIdentifier=null;e.showHide="show";e.fixed=!1;return e}c(t,[{key:"checked",get:function e(){return this.internals.states.has("--checked")}},{key:"render",value:function e(){return rs(e6(),this.marker?rs(e5(),this.marker):rh)}}]);return t}(tP(rR,"qti-simple-choice"));i0.styles=nC(e9()),tF([r({type:String,attribute:"template-identifier"})],i0.prototype,"templateIdentifier",2),tF([r({type:String,attribute:"show-hide"})],i0.prototype,"showHide",2),tF([r({type:Boolean,converter:{fromAttribute:function(e){return e==="true"},toAttribute:function(e){return String(e)}}})],i0.prototype,"fixed",2),tF([r({type:String,attribute:!1})],i0.prototype,"marker",2),i0=tF([rT("qti-simple-choice")],i0);var i1=nC(e7());var i2=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e._value=0;e._correctResponseNumber=null;e.min=0;e.max=100;e.step=1;return e}c(t,[{key:"validate",value:function e(){return!0}},{key:"connectedCallback",value:function e(){d(f(t.prototype),"connectedCallback",this).call(this),this._updateValue(this.min),this.setAttribute("tabindex","0"),this.setAttribute("role","slider")}},{key:"response",get:function e(){return this._value.toString()},set:function e(e){var t=parseInt(e,10);isNaN(t)||this._updateValue(t)}},{key:"toggleCorrectResponse",value:function e(e,t){if(t){this._correctResponse=e.correctResponse.toString();var n=parseFloat(e.correctResponse.toString());if(isNaN(n))this._correctResponseNumber=null;else{this._correctResponseNumber=n;var r=(this._correctResponseNumber-this.min)/(this.max-this.min)*100;this.style.setProperty("--value-percentage-correct","".concat(r,"%"))}}else this._correctResponseNumber=null;this.requestUpdate()}},{key:"_updateValue",value:function e(e){var t=this._value;if(this._value=Math.min(this.max,Math.max(this.min,e)),this._value===t)return;var n=(this._value-this.min)/(this.max-this.min)*100;this.style.setProperty("--value-percentage","".concat(n,"%")),this._internals.setFormValue(this.value),this.saveResponse(this.response),this.requestUpdate()}},{key:"render",value:function e(){return rs(te(),this.min,this.max,this._onMouseDown,this._onTouchStart,this.response,this._correctResponseNumber!==null?rs(e8(),this._correctResponseNumber):null)}},{key:"_onMouseDown",value:function e(e){var t=this;this._startDrag(e.pageX);var n=function(e){return t._onDrag(e.pageX)},r=function(){document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",r),t._onDragEnd()};document.addEventListener("mousemove",n),document.addEventListener("mouseup",r)}},{key:"_onTouchStart",value:function e(e){var t=this;this._startDrag(e.touches[0].pageX);var n=function(e){return t._onDrag(e.touches[0].pageX)},r=function(){document.removeEventListener("touchmove",n),document.removeEventListener("touchend",r),t._onDragEnd()};document.addEventListener("touchmove",n,{passive:!1}),document.addEventListener("touchend",r)}},{key:"_startDrag",value:function e(e){this._onDrag(e)}},{key:"_onDrag",value:function e(e){var t=this._rail.getBoundingClientRect(),n=e-t.left,r=Math.min(1,Math.max(0,n/t.width)),i=this.min+Math.round(r*(this.max-this.min)/this.step)*this.step;this._updateValue(i)}},{key:"_onDragEnd",value:function e(){this.dispatchEvent(new Event("change",{bubbles:!0}))}}]);return t}(r3);i2.styles=i1,tF([l("#rail")],i2.prototype,"_rail",2),tF([r({type:Number,attribute:"lower-bound"})],i2.prototype,"min",2),tF([r({type:Number,attribute:"upper-bound"})],i2.prototype,"max",2),tF([r({type:Number,attribute:"step"})],i2.prototype,"step",2),i2=tF([rT("qti-slider-interaction")],i2);var i3=function(e,t){var n;var r=e._$AN;if(r===void 0)return!1;var i=true,o=false,a=undefined;try{for(var s=r[Symbol.iterator](),l;!(i=(l=s.next()).done);i=true){var u=l.value;(n=u._$AO)===null||n===void 0?void 0:n.call(u,t,!1),i3(u,t)}}catch(e){o=true;a=e}finally{try{if(!i&&s.return!=null){s.return()}}finally{if(o){throw a}}}return!0},i4=function(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)},i5=function(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),i6(t)}};var i6=function(e){var t,n;e.type==ic.CHILD&&((t=e._$AP)!==null&&t!==void 0?t:e._$AP=tI,(n=e._$AQ)!==null&&n!==void 0?n:e._$AQ=tT)},i9=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments),e._$AN=void 0;return e}c(t,[{key:"_$AT",value:function e(e,n,r){d(f(t.prototype),"_$AT",this).call(this,e,n,r),i5(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,i,o;e!==this.isConnected&&(this.isConnected=e,e?(n=(r=this).reconnected)===null||n===void 0?void 0:n.call(r):(i=(o=this).disconnected)===null||i===void 0?void 0:i.call(o)),t&&(i3(this,e),i4(this))}},{key:"setValue",value:function e(e){if(iv(this._$Ct))this._$Ct._$AI(e,this);else{var t=T(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}(id);var i7=function(){return new i8},i8=function e(){"use strict";s(this,e)},oe=new WeakMap,ot=ih(/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"render",value:function e(e){return rh}},{key:"update",value:function e(e,t){var n=S(t,1),r=n[0];var i;var o=r!==this.G;return o&&this.G!==void 0&&this.rt(void 0),(o||this.lt!==this.ct)&&(this.G=r,this.ht=(i=e.options)===null||i===void 0?void 0:i.host,this.rt(this.ct=e.element)),rh}},{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=oe.get(n);r===void 0&&(r=new WeakMap,oe.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,t;var n;return typeof this.G=="function"?(e=oe.get((n=this.ht)!==null&&n!==void 0?n:globalThis))===null||e===void 0?void 0:e.get(this.G):(t=this.G)===null||t===void 0?void 0:t.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}(i9));var on=nC(tt());var or=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e.inputRef=i7();e.response=null;e._handleValueChange=function(){e._internals.setFormValue(e.value),e.validate()};return e}c(t,[{key:"value",get:function e(){return this.response||null},set:function e(e){this.response=e||null}},{key:"validate",value:function e(){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 e=this._input.checkValidity();this._internals.setValidity(e?{}:{customError:!1})}return this.response!==""&&this._input.checkValidity()}},{key:"toggleInternalCorrectResponse",value:function e(e,t){if(t&&e.correctResponse){var n=e.correctResponse.toString();this._correctResponse=n}else this._correctResponse=null}},{key:"render",value:function e(){var e=this;return rs(tr(),this.responseIdentifier,function(t){e.reportValidity()},function(e){return e.stopImmediatePropagation()},this.textChanged,this.textChanged,this.patternMask=="[0-9]*"?"number":"text",rG(this.placeholderText?this.placeholderText:void 0),this.response,rG(this.patternMask?this.patternMask:void 0),1e3,this.disabled,this.readonly,this._correctResponse?rs(tn(),this._correctResponse):rh)}},{key:"textChanged",value:function e(e){if(this.disabled||this.readonly)return;var t=e.target;this.setEmptyAttribute(t.value),this.response!==t.value&&(this.value=t.value,this.saveResponse(t.value))}},{key:"reportValidity",value:function e(){var e=this.shadowRoot.querySelector("input");if(!e)return!1;var t=this.validate();return t||e.reportValidity(),t}},{key:"reset",value:function e(){this.response=""}},{key:"setEmptyAttribute",value:function e(e){this.setAttribute("empty",e===""?"true":"false")}}]);return t}(r3);or.styles=on,tF([r({type:Number,attribute:"expected-length"})],or.prototype,"expectedLength",2),tF([r({type:String,attribute:"pattern-mask"})],or.prototype,"patternMask",2),tF([r({type:String,attribute:"placeholder-text"})],or.prototype,"placeholderText",2),tF([r({type:String,attribute:"data-patternmask-message"})],or.prototype,"dataPatternmaskMessage",2),tF([i()],or.prototype,"response",2),tF([l("input")],or.prototype,"_input",2),tF([m("response",{waitUntilFirstUpdate:!0})],or.prototype,"_handleValueChange",2),or=tF([rT("qti-text-entry-interaction")],or);var oi=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e._file=null;e._base64=null;return e}c(t,[{key:"reset",value:function e(){this._file=null,this._base64=null,this.saveResponse(null)}},{key:"validate",value:function e(){return this._base64!==null}},{key:"response",get:function e(){return this._base64},set:function e(e){if(typeof e=="string")this._base64=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 rs(ti(),this._onFileChange,this.disabled,this.readonly)}},{key:"_onFileChange",value:function e(e){return o(function(){var t,n,r;return L(this,function(i){switch(i.label){case 0:t=e.target;n=t.files&&t.files.length>0;if(!n)return[3,2];this._file=t.files[0];r=this;return[4,this._convertToBase64(this._file)];case 1:n=(r._base64=i.sent(),this.saveResponse(this._base64),this.dispatchEvent(new CustomEvent("qti-interaction-response",{detail:{response:this._base64}})));i.label=2;case 2:n;return[2]}})}).call(this)}},{key:"_convertToBase64",value: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)})}}],[{key:"properties",get:function e(){return k({},r3.properties)}}]);return t}(r3);oi.styles=[nC(to())],oi=tF([rT("qti-upload-interaction")],oi);var oo=nC(ta());var oa=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"render",value:function e(){return rs(ts())}}]);return t}(rR);oa.styles=oo,oa=tF([rT("qti-item-body")],oa);var os=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"render",value:function e(){return rs(tl())}},{key:"process",value:function e(){var e=new ol,t=T(this.children);e.process(t)}}]);return t}(rR);os.styles=[nC(tu())],os=tF([rT("qti-outcome-processing")],os);var ol=/*#__PURE__*/function(){"use strict";function e(){s(this,e)}c(e,[{key:"process",value:function e(e){var t=true,n=false,r=undefined;try{for(var i=e[Symbol.iterator](),o;!(t=(o=i.next()).done);t=true){var a=o.value;a.process()}}catch(e){n=true;r=e}finally{try{if(!t&&i.return!=null){i.return()}}finally{if(n){throw r}}}}}]);return e}();var ou=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"render",value:function e(){return rs(tc())}},{key:"connectedCallback",value:function e(){this.parentElement.tagName.endsWith("INTERACTION")&&this.setAttribute("slot","prompt")}}]);return t}(rR);ou=tF([rT("qti-prompt")],ou);var oc='<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>',oh='<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>',od='<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 of=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"render",value:function e(){return rs(th())}},{key:"process",value:function e(){if(!this.closest("qti-assessment-item"))return;var e=T(this.children);var t=true,n=false,r=undefined;try{for(var i=e[Symbol.iterator](),o;!(t=(o=i.next()).done);t=true){var a=o.value;a.process()}}catch(e){n=true;r=e}finally{try{if(!t&&i.return!=null){i.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(this.fragmentFromString(oh).firstElementChild.firstElementChild);break}case"map_response_point":{this.appendChild(this.fragmentFromString(od).firstElementChild.firstElementChild);break}case"match_correct":this.appendChild(this.fragmentFromString(oc).firstElementChild.firstElementChild);break}}}},{key:"fragmentFromString",value:function e(e){return document.createRange().createContextualFragment(e)}}]);return t}(rR);of.styles=[nC(td())],of=tF([rT("qti-response-processing")],of);var op=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"render",value:function e(){return rs(tf())}},{key:"process",value:function e(){throw new Error("Not implemented")}}]);return t}(rR);op=tF([rT("qti-rule")],op);var ov=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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:rB(n)}})),n)}}]);return t}(op);tF([r({type:String})],ov.prototype,"identifier",2),tF([t({context:rU,subscribe:!0}),i()],ov.prototype,"context",2);customElements.define("qti-lookup-outcome-value",ov);var oy=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"render",value:function e(){return rs(tp())}},{key:"process",value:function e(){var e=T(this.children);for(var t=0;t<e.length;t++){var n=e[t];if(n.calculate()){n.process();return}}}}]);return t}(op);customElements.define("qti-response-condition",oy);var om=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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 og(t).process();this.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:e,value:this.formatValue(n)}}))}},{key:"formatValue",value:function e(e){return Array.isArray(e)?e.map(rB):e!==null?rB(e):null}}]);return t}(op),og=/*#__PURE__*/function(){"use strict";function e(t){s(this,e);this.expression=t}c(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}();customElements.define("qti-set-outcome-value",om);var ob=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"render",value:function e(){return rs(tv())}},{key:"calculate",value:function e(){return!0}},{key:"getSubRules",value:function e(){return T(this.children)}},{key:"process",value:function e(){var e=this.getSubRules();for(var t=0;t<e.length;t++)e[t].process()}}]);return t}(rR);customElements.define("qti-response-else",ob);var o_=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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}(ob);customElements.define("qti-response-if",o_);var ok=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"render",value:function e(){return rs(ty(),d(f(t.prototype),"render",this).call(this))}}]);return t}(o_);customElements.define("qti-response-else-if",ok);var ow=Symbol("qtiContext");var ox=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(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 i=t.getResult();return console.debug("values",i),(i===null||i===void 0?void 0:i.length)>0?{identifier:"",baseType:i[0].baseType,value:i.map(function(e){return e.value}),cardinality:"multiple",type:"response"}:null}case"qti-ordered":{var o=t.getResult();return(o===null||o===void 0?void 0:o.length)>0?{identifier:"",baseType:o[0].baseType,value:o.map(function(e){return e.value}),cardinality:"ordered",type:"response"}:null}case"qti-correct":{var a=t.getAttribute("identifier")||"",s=e.context.variables.find(function(e){return e.identifier===a})||null;return{baseType:s.baseType,value:s.correctResponse,cardinality:s.cardinality}}default:{try{var l;return{baseType:"integer",value:((l=t.getResult())===null||l===void 0?void 0:l.toString())||null,cardinality:"single"}}catch(e){console.warn("default not sufficient")}return null}}}).filter(function(e){return e!==null})};return e}c(t,[{key:"render",value:function e(){return rs(tm(),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}(rR);ox.styles=nC(tg()),tF([i()],ox.prototype,"result",2),tF([t({context:rU,subscribe:!0}),i()],ox.prototype,"context",2),tF([t({context:ow,subscribe:!0}),i()],ox.prototype,"qtiContext",2);var oE=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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}(ox);var oq=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"calculate",value:function e(){return this.calculateChildren(Array.from(this.children))}}]);return t}(tO(oE));oq=tF([rT("qti-and")],oq);var oA=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e.baseType="string";return e}c(t,[{key:"getResult",value:function e(){return this.textContent.trim()}}]);return t}(ox);tF([r({type:String,attribute:"base-type"})],oA.prototype,"baseType",2);customElements.define("qti-base-value",oA);var oC=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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}(ox);customElements.define("qti-container-size",oC);var oS=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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,i=n.value;return r.filter(function(e){return i.includes(e)}).length>0}else if(t.baseType==="directedPair"&&n.baseType==="directedPair"&&t.cardinality==="single"){var o=t.value;return n.value.includes(o)}else console.error("unsupported baseType or cardinality in qti contains, only baseType: directedPair and cardinality: multiple is supported")}else console.error("unexpected number of children in qti contains");return!1}}]);return t}(oE);customElements.define("qti-contains",oS);var oR=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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}(ox);customElements.define("qti-correct",oR);var oP=Symbol("testContext");var oM=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e.identifier="";return e}c(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 i;var o=this._testContext.items.find(function(e){return e.identifier===n});if(console.debug("itemContext: ".concat(JSON.stringify(o))),!this._testContext||!o)return console.warn('qti-default: item "'.concat(n,'" not found in test context')),null;var a=(i=this._testContext.items.find(function(e){return e.identifier===n}))===null||i===void 0?void 0:i.variables.find(function(e){return e.identifier===r});return a?a.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 s=this.context.variables.find(function(e){return e.identifier===r});return s?s.defaultValue||null:(console.warn('qti-default: variable "'.concat(r,'" not found in item context')),null)}}]);return t}(ox);tF([r({type:String})],oM.prototype,"identifier",2),tF([t({context:rU,subscribe:!0}),i()],oM.prototype,"context",2),tF([i(),t({context:oP,subscribe:!0})],oM.prototype,"_testContext",2);customElements.define("qti-default",oM);var oT=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e.roundingMode="significantFigures";return e}c(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),i=parseFloat(n.value);if(!isNaN(r)&&!isNaN(i))return this.roundingMode==="significantFigures"?r.toPrecision(this.figures)===i.toPrecision(this.figures):Math.round(r*Math.pow(10,this.figures))/Math.pow(10,this.figures)===Math.round(i*Math.pow(10,this.figures))/Math.pow(10,this.figures);console.error("value cannot be casted to numeric value in equalRounded operator: ".concat(r,", ").concat(i));break}default:{console.error("values other than float and int cannot be used in equalRounded operator.");break}}return!1}return console.error("unexpected number of children in qti-equal-rounded"),null}}]);return t}(ox);tF([r({type:String})],oT.prototype,"roundingMode",2);customElements.define("qti-equal-rounded",oT);var oI=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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}(ox);customElements.define("qti-round",oI);var oO=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e.roundingMode="significantFigures";e.figures=3;return e}c(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"?this._roundToDecimalPlaces(n,this.figures):this._roundToSignificantFigures(n,this.figures):n===1/0?1/0:n===-1/0?-1/0:null}},{key:"_roundToDecimalPlaces",value:function e(e,t){if(e===0)return 0;var n=Math.pow(10,t);return Math.round(e*n)/n}},{key:"_roundToSignificantFigures",value: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}}]);return t}(ox);tF([r({type:String,attribute:"rounding-mode"})],oO.prototype,"roundingMode",2),tF([r({type:Number})],oO.prototype,"figures",2);customElements.define("qti-round-to",oO);var oN=/*#__PURE__*/function(){"use strict";function e(){s(this,e)}c(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=S(e.split(" ").map(Number),2),i=r[0],o=r[1],a=M(t.split(",")),s=a[0],l=a.slice(1),u=l.map(Number);switch(s.toLowerCase()){case"circle":case"default":{var c=S(u,3),h=c[0],d=c[1],f=c[2];return u.length!==3?(console.warn("Invalid circle definition: ".concat(t)),!1):Math.sqrt(Math.pow(i-h,2)+Math.pow(o-d,2))<=f}case"rect":{var p=S(u,4),v=p[0],y=p[1],m=p[2],g=p[3];return u.length!==4?(console.warn("Invalid rectangle definition: ".concat(t)),!1):i>=v&&i<=m&&o>=y&&o<=g}case"ellipse":{var b=S(u,4),_=b[0],k=b[1],w=b[2],x=b[3];if(u.length!==4)return console.warn("Invalid ellipse definition: ".concat(t)),!1;var E=Math.pow(i-_,2)/Math.pow(w,2),q=Math.pow(o-k,2)/Math.pow(x,2);return E+q<=1}case"poly":{if(u.length<6||u.length%2!==0)return console.warn("Invalid polygon definition: ".concat(t)),!1;var A=[];for(var C=0;C<u.length;C+=2)A.push({x:u[C],y:u[C+1]});return this.isPointInPolygon({x:i,y:o},A)}default:return console.warn("Unsupported shape type: ".concat(s)),!1}}},{key:"isPointInPolygon",value:function e(e,t){var n=!1;for(var r=0,i=t.length-1;r<t.length;i=r++){var o=t[r].x,a=t[r].y,s=t[i].x,l=t[i].y;a>e.y!=l>e.y&&e.x<(s-o)*(e.y-a)/(l-a)+o&&(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),i=parseInt(t,10);if(!isNaN(r)&&!isNaN(i))return r===i;console.error("Cannot convert ".concat(e," and/or ").concat(t," to int."));break}case"float":{var o=parseFloat(e),a=parseFloat(t);if(!isNaN(o)&&!isNaN(a))return o===a;console.error("couldn't convert ".concat(e," and/or ").concat(t," to float."));break}case"pair":case"directedPair":{var s=e.split(" ").sort(),l=t.split(" ").sort();if(s.length===2&&l.length===2)return n==="pair"&&(s.sort(),l.sort()),s.join(" ")===l.join(" ");console.error("compared two pair but one of the values does not have 2 values: 1: ".concat(e," 2: ").concat(t));break}}return!1}}]);return e}();var oU=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e.toleranceMode="exact";return e}c(t,[{key:"getResult",value:function e(){if(this.children.length===2){var e=this.getVariables(),t=e[0],n=e[1];return 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):oN.compareSingleValues(t.value,n.value,t.baseType)}return console.error("unexpected number of children in qti-equal"),null}}]);return t}(ox);tF([r({type:String})],oU.prototype,"toleranceMode",2);customElements.define("qti-equal",oU);var oL=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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,i=undefined;try{for(var o=e[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){var s=a.value;if(s.baseType!=="integer")return console.error("qti-gcd requires integer base-type"),null;if(s.value===null||s.value===void 0)return null;if(s.cardinality==="single"){if(Array.isArray(s.value))return console.error("qti-gcd unexpected array value for single cardinality"),null;var l=parseInt(s.value,10);if(isNaN(l))return console.error("qti-gcd non-numerical value"),null;t.push(l)}else if(s.cardinality==="multiple"||s.cardinality==="ordered"){if(!Array.isArray(s.value))return console.error("qti-gcd expected array value for multiple/ordered cardinality"),null;var u=true,c=false,h=undefined;try{for(var d=s.value[Symbol.iterator](),f;!(u=(f=d.next()).done);u=true){var p=f.value;if(p==null)return null;var v=parseInt(p,10);if(isNaN(v))return console.error("qti-gcd non-numerical value"),null;t.push(v)}}catch(e){c=true;h=e}finally{try{if(!u&&d.return!=null){d.return()}}finally{if(c){throw h}}}}else return console.error("qti-gcd unsupported cardinality"),null}}catch(e){r=true;i=e}finally{try{if(!n&&o.return!=null){o.return()}}finally{if(r){throw i}}}return t.length===0?null:this._calculateGcd(t)}},{key:"_calculateGcd",value: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=this._gcdTwoNumbers(t,Math.abs(e[n])),t!==1);n++);return t}},{key:"_gcdTwoNumbers",value: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}}]);return t}(ox);customElements.define("qti-gcd",oL);var o$=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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}(ox);customElements.define("qti-gt",o$);var oD=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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}(oE);customElements.define("qti-gte",oD);var oV=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"getResult",value:function e(){return null}}]);return t}(ox);customElements.define("qti-null",oV);var oj=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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}(ox);customElements.define("qti-is-null",oj);var oH=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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}(ox);customElements.define("qti-field-value",oH);var oQ=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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}(ox);customElements.define("qti-lt",oQ);var oF=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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}(oE);customElements.define("qti-lte",oF);var oz=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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],i=0;var o=true,a=false,s=undefined;try{var l=function(){var e=c.value;var r=n.mapEntries.filter(function(n){return t.baseType==="string"&&!n.caseSensitive?oN.compareSingleValues(n.mapKey.toLowerCase(),e.toLowerCase(),t.baseType):oN.compareSingleValues(n.mapKey,e,t.baseType)}),o=r.reduce(function(e,t){return e.mappedValue>t.mappedValue?e:t},r.length>0?r[0]:{mapKey:null,mappedValue:null});o===null||o.mappedValue==null?i+=n.defaultValue:i+=o.mappedValue};for(var u=r[Symbol.iterator](),c;!(o=(c=u.next()).done);o=true)l()}catch(e){a=true;s=e}finally{try{if(!o&&u.return!=null){u.return()}}finally{if(a){throw s}}}return(n===null||n===void 0?void 0:n.lowerBound)!==null&&(n===null||n===void 0?void 0:n.lowerBound)!==void 0&&(i=Math.max(n.lowerBound,i)),(n===null||n===void 0?void 0:n.upperBound)!==null&&(n===null||n===void 0?void 0:n.upperBound)!==void 0&&(i=Math.min(n.upperBound,i)),i}}]);return t}(ox);tF([r({type:String})],oz.prototype,"identifier",2);customElements.define("qti-map-response",oz);var oB=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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 i=0,o=new Set;var a=true,s=false,l=undefined,u=true,c=false,h=undefined;try{for(var d=r[Symbol.iterator](),f;!(u=(f=d.next()).done);u=true){var p=f.value;try{for(var v=n.areaMapEntries[Symbol.iterator](),y;!(a=(y=v.next()).done);a=true){var m=y.value;if(o.has(m.coords))continue;var g;oN.isPointInArea(p,"".concat(m.shape,",").concat(m.coords),t.baseType)&&(i+=(g=m.mappedValue)!==null&&g!==void 0?g:0,o.add(m.coords))}}catch(e){s=true;l=e}finally{try{if(!a&&v.return!=null){v.return()}}finally{if(s){throw l}}}}}catch(e){c=true;h=e}finally{try{if(!u&&d.return!=null){d.return()}}finally{if(c){throw h}}}return o.size<r.length&&(i+=n.defaultValue),n.lowerBound!=null&&(i=Math.max(n.lowerBound,i)),n.upperBound!=null&&(i=Math.min(n.upperBound,i)),i}}]);return t}(ox);tF([r({type:String})],oB.prototype,"identifier",2);customElements.define("qti-map-response-point",oB);var oW=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e.name="";return e}c(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,i=undefined;try{for(var o=e[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){var s=a.value;if(s.cardinality!=="single")return console.error("qti-math-operator requires single cardinality"),null;if(Array.isArray(s.value))return console.error("qti-math-operator unexpected array value for single cardinality"),null;if(s.value===null||s.value===void 0)return null;if(s.baseType!=="integer"&&s.baseType!=="float")return console.error("qti-math-operator requires numerical base-type"),null;var l=parseFloat(s.value);if(isNaN(l))return console.error("qti-math-operator non-numerical value"),null;t.push(l)}}catch(e){r=true;i=e}finally{try{if(!n&&o.return!=null){o.return()}}finally{if(r){throw i}}}return this._performOperation(this.name,t)}},{key:"_performOperation",value: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 i=t[0],o=t[1];return i<=0||o<=0||o===1?null:Math.log(i)/Math.log(o)}case"mod":return t.length!==2||t[1]===0?null:t[0]%t[1];case"max":var a;return t.length<1?null:(a=Math).max.apply(a,T(t));case"min":var s;return t.length<1?null:(s=Math).min.apply(s,T(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}}}]);return t}(ox);tF([r({type:String})],oW.prototype,"name",2);customElements.define("qti-math-operator",oW);var oJ=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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):oN.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(!oN.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 i=0;var o=true,a=false,s=undefined;try{for(var l=t.value[Symbol.iterator](),u;!(o=(u=l.next()).done);o=true){var c=u.value;var h=null,d=T(e.value);var f=true,p=false,v=undefined;try{for(var y=d[Symbol.iterator](),m;!(f=(m=y.next()).done);f=true){var g=m.value;if(oN.compareSingleValues(c,g,t.baseType)){h=g;break}}}catch(e){p=true;v=e}finally{try{if(!f&&y.return!=null){y.return()}}finally{if(p){throw v}}}if(h!==null)d.splice(d.indexOf(h),1);else return!1;i++}}catch(e){a=true;s=e}finally{try{if(!o&&l.return!=null){l.return()}}finally{if(a){throw s}}}return!0}default:return console.error("unexpected cardinality in qti match"),!1}}}]);return t}(ox);customElements.define("qti-match",oJ);var oG=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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=S(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 i=n.value;return r.value.includes(i)}}]);return t}(ox);customElements.define("qti-member",oG);var oX=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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 i=e[Symbol.iterator](),o;!(t=(o=i.next()).done);t=true){var a=o.value;if(a.cardinality!=="multiple"&&a.cardinality!=="single")return console.error("unexpected cardinality in qti multiple"),[]}}catch(e){n=true;r=e}finally{try{if(!t&&i.return!=null){i.return()}}finally{if(n){throw r}}}return e}}]);return t}(ox);customElements.define("qti-multiple",oX);var oY=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"render",value:function e(){return rs(tb(),d(f(t.prototype),"render",this).call(this))}},{key:"getResult",value:function e(){return!this.firstElementChild.calculate()}}]);return t}(ox);customElements.define("qti-not",oY);var oK=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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}(oE);customElements.define("qti-or",oK);var oZ=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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 i=e[Symbol.iterator](),o;!(t=(o=i.next()).done);t=true){var a=o.value;if(a.cardinality!=="ordered"&&a.cardinality!=="single")return console.error("unexpected cardinality in qti ordered"),[]}}catch(e){n=true;r=e}finally{try{if(!t&&i.return!=null){i.return()}}finally{if(n){throw r}}}return e}}]);return t}(ox);customElements.define("qti-ordered",oZ);var o0=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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=S(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 i=parseFloat(n.value),o=parseFloat(r.value);if(isNaN(i)||isNaN(o))return console.error("qti-power: non-numerical values encountered"),null;if(i===0&&o<=0||i<0&&!Number.isInteger(o))return null;var a;try{a=Math.pow(i,o)}catch(e){return console.error("qti-power: error calculating power:",e),null}if(isNaN(a))return null;if(a===1/0||a===-1/0)return a;if(!isFinite(a)||Math.abs(a)>Number.MAX_VALUE||a!==0&&Math.abs(a)<Number.MIN_VALUE)return null;if(isFinite(a)&&a!==0){var s=Math.floor(Math.log10(Math.abs(a))),l=Math.max(0,14-s),u=Math.pow(10,l);a=Math.round(a*u)/u}return a}}]);return t}(ox);customElements.define("qti-power",o0);var o1=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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?rh:rs(t_(),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}(rR);tF([r({type:String})],o1.prototype,"identifier",2),tF([t({context:rU,subscribe:!0}),i()],o1.prototype,"context",2);customElements.define("qti-printed-variable",o1);var o2=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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}(ox);customElements.define("qti-product",o2);var o3=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"getResult",value:function e(){return this.calculateChildren(Array.from(this.children))}}]);return t}(tN(ox));customElements.define("qti-subtract",o3);var o4=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e.caseSensitive="true";return e}c(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(),i=this.caseSensitive==="true"?n.value:n.value.toLowerCase();return oN.compareSingleValues(r,i,t.baseType)}return console.error("unexpected number of children in qti-string-match"),null}}]);return t}(ox);tF([r({type:String,attribute:"case-sensitive"})],o4.prototype,"caseSensitive",2);customElements.define("qti-string-match",o4);var o5=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t),e._expression=new o6(Array.from(e.children));return e}c(t,[{key:"getResult",value:function e(){return this._expression.calculate()}}]);return t}(ox),o6=/*#__PURE__*/function(){"use strict";function e(t){s(this,e);this.expressions=t}c(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}();customElements.define("qti-sum",o5);var o9=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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}(ox);customElements.define("qti-variable",o9);var o7=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e.min=0;e.max=10;e.step=1;return e}c(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}(ox);tF([r({type:Number})],o7.prototype,"min",2),tF([r({type:Number})],o7.prototype,"max",2),tF([r({type:Number})],o7.prototype,"step",2);customElements.define("qti-random-integer",o7);var o8=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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}(ox);customElements.define("qti-random",o8);var ae=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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 t}(ox);customElements.define("qti-delete",ae);var at=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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=this.lookupVariableValue(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}},{key:"lookupVariableValue",value: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)}}]);return t}(ox);tF([r({type:String})],at.prototype,"n",2),at=tF([rT("qti-index")],at);var an=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"render",value:function e(){return rs(tk())}}]);return t}(rR);an=tF([rT("qti-content-body")],an);var ar=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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 rs(tw())}}]);return t}(rR);ar.styles=nC(tx()),tF([r({type:String})],ar.prototype,"id",2),tF([r({type:String})],ar.prototype,"use",2),tF([r({type:String})],ar.prototype,"view",2),tF([r({type:String,attribute:"class"})],ar.prototype,"classNames",2),tF([m("classNames",{waitUntilFirstUpdate:!0})],ar.prototype,"handleclassNamesChange",1),ar=tF([rT("qti-rubric-block")],ar);var ai=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e.styleElement=null;return e}c(t,[{key:"firstUpdated",value:function e(e){var n=this;d(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=n.minifyCss(e);n.styleElement=document.createElement("style"),n.styleElement.media="screen",n.styleElement.textContent="@scope {".concat(t,"}"),n.parentElement?n.parentElement.appendChild(n.styleElement):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 i=this.minifyCss(this.textContent);this.styleElement=document.createElement("style"),this.styleElement.media="screen",this.styleElement.textContent="@scope {".concat(i,"}"),this.parentElement?this.parentElement.appendChild(this.styleElement):console.warn("No parent element to append the scoped stylesheet to.")}}},{key:"minifyCss",value:function e(e){return e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\s+/g," ").replace(/\s*([{}:;])\s*/g,"$1").trim()}},{key:"disconnectedCallback",value:function e(){if(this.styleElement)try{this.styleElement.remove()}catch(e){console.error("Could not remove stylesheet:",e)}d(f(t.prototype),"disconnectedCallback",this).call(this)}}]);return t}(rR);ai=tF([rT("qti-stylesheet")],ai);var ao=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"render",value:function e(){return rs(tE())}},{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}(rR);ao=tF([rT("qti-variabledeclaration")],ao);var aa=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e.externalScored=null;return e}c(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 rs(tq(),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,i=undefined;try{for(var o=e.querySelectorAll("qti-interpolation-table-entry")[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){var s=a.value;!s.getAttribute("source-value")&&s.getAttribute("target-value")&&console.error("source-value or target-value is missing in qti-interpolation-table-entry");var l=parseFloat(s.getAttribute("source-value")),u=parseFloat(s.getAttribute("target-value"));(isNaN(l)||isNaN(u))&&console.error("source-value or target-value is not a number in qti-interpolation-table-entry"),t.set(l,u)}}catch(e){r=true;i=e}finally{try{if(!n&&o.return!=null){o.return()}}finally{if(r){throw i}}}return t}return null}},{key:"connectedCallback",value:function e(){d(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}(ao);aa.styles=[nC(tA())],tF([r({type:String,attribute:"base-type"})],aa.prototype,"baseType",2),tF([r({type:String,attribute:"external-scored"})],aa.prototype,"externalScored",2),tF([r({type:String})],aa.prototype,"identifier",2),tF([r({type:String})],aa.prototype,"cardinality",2),tF([t({context:rU,subscribe:!0}),i()],aa.prototype,"itemContext",2),aa=tF([rT("qti-outcome-declaration")],aa);var as=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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 rs(tC(),JSON.stringify(r,null,2))}},{key:"connectedCallback",value:function e(){d(f(t.prototype),"connectedCallback",this).call(this);var e=this.defaultValues(this.cardinality),n={baseType:this.baseType,identifier:this.identifier,correctResponse:this.correctResponse,cardinality:this.cardinality||"single",mapping:this.mapping,defaultValue:e,areaMapping:this.areaMapping,value:null,type:"response",candidateResponse:null};n.value=e,this.dispatchEvent(new CustomEvent("qti-register-variable",{bubbles:!0,composed:!0,detail:{variable:n}}))}},{key:"correctResponse",get: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}},{key:"mapping",get: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":!0}})}}},{key:"areaMapping",get: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")),i=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:i}}}]);return t}(ao);as.styles=[nC(tS())],tF([r({type:String,attribute:"base-type"})],as.prototype,"baseType",2),tF([r({type:String})],as.prototype,"identifier",2),tF([r({type:String})],as.prototype,"cardinality",2),tF([t({context:rU,subscribe:!0}),i()],as.prototype,"itemContext",2),as=tF([rT("qti-response-declaration")],as);return tQ(tz)}();
|
|
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 i(e,t,n,r,i,o,a){try{var s=e[o](a);var l=s.value}catch(e){n(e);return}if(s.done){t(l)}else{Promise.resolve(l).then(r,i)}}function o(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function s(e){i(a,r,o,s,l,"next",e)}function l(e){i(a,r,o,s,l,"throw",e)}s(undefined)})}}function a(e,t,n){t=f(t);return E(e,U()?Reflect.construct(t,n||[],f(e).constructor):t.apply(e,n))}function s(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function l(e,t,n){if(U()){l=Reflect.construct}else{l=function e(e,t,n){var r=[null];r.push.apply(r,t);var i=Function.bind.apply(e,r);var o=new i;if(n)C(o,n.prototype);return o}}return l.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 c(e,t,n){if(t)u(e.prototype,t);if(n)u(e,n);return e}function d(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 h(e,t,n){if(typeof Reflect!=="undefined"&&Reflect.get){h=Reflect.get}else{h=function e(e,t,n){var r=R(e,t);if(!r)return;var i=Object.getOwnPropertyDescriptor(r,t);if(i.get){return i.get.call(n||e)}return i.value}}return h(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 p(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)C(e,t)}function v(e,t){if(t!=null&&typeof Symbol!=="undefined"&&t[Symbol.hasInstance]){return!!t[Symbol.hasInstance](e)}else{return e instanceof t}}function y(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function m(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function g(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var i=true;var o=false;var a,s;try{for(n=n.call(e);!(i=(a=n.next()).done);i=true){r.push(a.value);if(t&&r.length===t)break}}catch(e){o=true;s=e}finally{try{if(!i&&n["return"]!=null)n["return"]()}finally{if(o)throw s}}return r}function b(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function k(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){d(e,t,n[t])})}return e}function w(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 x(e,t){t=t!=null?t:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(t))}else{w(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function E(e,t){if(t&&(I(t)==="object"||typeof t==="function")){return t}return r(e)}function q(e,t,n,r){if(typeof Reflect!=="undefined"&&Reflect.set){q=Reflect.set}else{q=function e(e,t,n,r){var i=R(e,t);var o;if(i){o=Object.getOwnPropertyDescriptor(i,t);if(o.set){o.set.call(r,n);return true}else if(!o.writable){return false}}o=Object.getOwnPropertyDescriptor(r,t);if(o){if(!o.writable){return false}o.value=n;Object.defineProperty(r,t,o)}else{d(r,t,n)}return true}}return q(e,t,n,r)}function A(e,t,n,r,i){var o=q(e,t,n,r||e);if(!o&&i){throw new Error("failed to set property")}return n}function C(e,t){C=Object.setPrototypeOf||function e(e,t){e.__proto__=t;return e};return C(e,t)}function S(e,n){return t(e)||g(e,n)||O(e,n)||b()}function R(e,t){while(!Object.prototype.hasOwnProperty.call(e,t)){e=f(e);if(e===null)break}return e}function P(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)||m(e)||O(e)||b()}function T(e){return n(e)||m(e)||O(e)||_()}function I(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function O(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 N(e){var t=typeof Map==="function"?new Map:undefined;N=function e(e){if(e===null||!y(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 l(e,arguments,f(this).constructor)}n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:false,writable:true,configurable:true}});return C(n,e)};return N(e)}function U(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(U=function(){return!!e})()}function L(e,t){var n,r,i,o={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return a.next=s(0),a["throw"]=s(1),a["return"]=s(2),typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(t){return l([e,t])}}function l(s){if(n)throw new TypeError("Generator is already executing.");while(a&&(a=0,s[0]&&(o=0)),o)try{if(n=1,r&&(i=s[0]&2?r["return"]:s[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;if(r=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:o.label++;return{value:s[1],done:false};case 5:o.label++;r=s[1];s=[0];continue;case 7:s=o.ops.pop();o.trys.pop();continue;default:if(!(i=o.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){o=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(s[0]===6&&o.label<i[1]){o.label=i[1];i=s;break}if(i&&o.label<i[2]){o.label=i[2];o.ops.push(s);break}if(i[2])o.ops.pop();o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e];r=0}finally{n=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}}function $(){var e=P(["<slot></slot>"]);$=function t(){return e};return e}function D(){var e=P(["<slot></slot>"]);D=function t(){return e};return e}function V(){var e=P(['<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">\n<xsl:output method="html" version="5.0" encoding="UTF-8" indent="yes" />\n <xsl:template match="@*|node()">\n <xsl:copy>\n <xsl:apply-templates select="@*|node()"/>\n </xsl:copy>\n </xsl:template>\n\n \x3c!-- remove existing namespaces --\x3e\n <xsl:template match="*">\n \x3c!-- remove element prefix --\x3e\n <xsl:element name="{local-name()}">\n \x3c!-- process attributes --\x3e\n <xsl:for-each select="@*">\n \x3c!-- remove attribute prefix --\x3e\n <xsl:attribute name="{local-name()}">\n <xsl:value-of select="."/>\n </xsl:attribute>\n </xsl:for-each>\n <xsl:apply-templates/>\n </xsl:element>\n</xsl:template>\n</xsl:stylesheet>']);V=function t(){return e};return e}function j(){var e=P(["<slot @slotchange=","></slot>"]);j=function t(){return e};return e}function H(){var e=P([' <slot part="feedback" class="feedback ','"></slot> ']);H=function t(){return e};return e}function Q(){var e=P(["\n :host {\n display: block;\n }\n .on {\n display: block;\n }\n .off {\n display: none;\n }\n "]);Q=function t(){return e};return e}function F(){var e=P([' <slot part="feedback" class="','"></slot> ']);F=function t(){return e};return e}function z(){var e=P(["\n .on {\n display: inline-block;\n }\n .off {\n display: none;\n }\n "]);z=function t(){return e};return e}function B(){var e=P(['\n <dialog class="qti-dialog" part="feedback" ?open="','">\n <slot></slot>\n <div style="margin-top: var(--qti-gap-size); text-align: center;">\n <button class="button close-button" @click="','">Close</button>\n </div>\n </dialog>\n ']);B=function t(){return e};return e}function W(){var e=P(["\n .qti-dialog {\n background: var(--qti-bg);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n border-radius: var(--qti-border-radius);\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1000;\n width: auto;\n max-width: 90%;\n }\n\n .button {\n border-radius: var(--qti-border-radius);\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n background-color: var(--qti-bg-active);\n border: var(--qti-border-active);\n cursor: pointer;\n position: relative;\n display: inline-block;\n }\n\n .button:hover {\n background-color: var(--qti-hover-bg);\n }\n\n .button:disabled {\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n cursor: not-allowed;\n }\n\n .button:focus {\n outline: var(--qti-focus-border-width) solid var(--qti-focus-color);\n }\n "]);W=function t(){return e};return e}function J(){var e=P([' <slot name="drags"></slot> ']);J=function t(){return e};return e}function G(){var e=P(["\n :host {\n display: flex;\n user-select: none;\n position: absolute;\n }\n "]);G=function t(){return e};return e}function X(){var e=P(["\n :host {\n display: block; /* necessary to calculate scaling position */\n }\n slot[name='qti-simple-associable-choice'] {\n display: flex;\n align-items: flex-start;\n flex: 1;\n border: 2px solid transparent;\n padding: 0.3rem;\n border-radius: 0.3rem;\n gap: 0.5rem;\n }\n\n :host::part(associables-container) {\n display: flex;\n padding: 0.5rem;\n justify-content: space-between;\n background: linear-gradient(\n 180deg,\n rgb(0 0 0 / 0%) calc(50% - 1px),\n var(--qti-border-color-gray) calc(50%),\n rgb(0 0 0 / 0%) calc(50% + 1px)\n );\n }\n"]);X=function t(){return e};return e}function Y(){var e=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>']);Y=function t(){return e};return e}function K(){var e=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>']);K=function t(){return e};return e}function Z(){var e=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"]);Z=function t(){return e};return e}function ee(){var e=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 ']);ee=function t(){return e};return e}function et(){var e=P(['<div style="color:red">\n <h1>Error</h1>\n ',"\n </div>"]);et=function t(){return e};return e}function en(){var e=P(["<iframe\n width=","\n height=",'\n frameborder="0"\n title="pciContainer"\n id="pciContainer"\n >\n </iframe>\n ',""]);en=function t(){return e};return e}function er(){var e=P(["<button ?disabled=",' part="button" @click=',">","</button>"]);er=function t(){return e};return e}function ei(){var e=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"]);ei=function t(){return e};return e}function eo(){var e=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>"]);eo=function t(){return e};return e}function ea(){var e=P(["\n :host {\n display: flex;\n user-select: none;\n }\n "]);ea=function t(){return e};return e}function es(){var e=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"]);es=function t(){return e};return e}function el(){var e=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>']);el=function t(){return e};return e}function eu(){var e=P(["<slot></slot>"]);eu=function t(){return e};return e}function ec(){var e=P(["\n :host {\n display: inline-flex;\n user-select: none;\n }\n "]);ec=function t(){return e};return e}function ed(){var e=P([' <slot name="drags"></slot>']);ed=function t(){return e};return e}function eh(){var e=P(["\n :host {\n display: flex;\n user-select: none;\n }\n "]);eh=function t(){return e};return e}function ef(){var e=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"]);ef=function t(){return e};return e}function ep(){var e=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 "]);ep=function t(){return e};return e}function ev(){var e=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 ']);ev=function t(){return e};return e}function ey(){var e=P(['<line\n part="point"\n x1=',"\n y1=","\n x2=","\n y2=",'\n stroke="var(--qti-border-active)"\n stroke-width="3"\n />']);ey=function t(){return e};return e}function em(){var e=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>']);em=function t(){return e};return e}function eg(){var e=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"]);eg=function t(){return e};return e}function eb(){var e=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>']);eb=function t(){return e};return e}function e_(){var e=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"]);e_=function t(){return e};return e}function ek(){var e=P(['\n <slot name="prompt"></slot>\n <slot></slot>\n <div role="alert" part="message" id="validation-message"></div>\n ']);ek=function t(){return e};return e}function ew(){var e=P(["\n :host {\n display: flex;\n user-select: none;\n position: absolute;\n }\n "]);ew=function t(){return e};return e}function ex(){var e=P(["\n slot:not([name='prompt']) {\n position: relative; /* qti-hotspot-choice relative to the slot */\n display: block;\n width: fit-content; /* hotspots not stretching further if image is at max size */\n }\n ::slotted(img) {\n /* image not selectable anymore */\n pointer-events: none;\n user-select: none;\n /* width:100%; */\n }\n"]);ex=function t(){return e};return e}function eE(){var e=P(['\n <slot name="prompt"></slot>\n <slot></slot>\n ']);eE=function t(){return e};return e}function eq(){var e=P(['<slot></slot>\n <div part="message" role="alert" id="validation-message"></div>']);eq=function t(){return e};return e}function eA(){var e=P(['<div part="ch"><div part="cha"></div></div>\n <slot></slot> ']);eA=function t(){return e};return e}function eC(){var e=P(["\n :host {\n display: flex;\n user-select: none;\n }\n "]);eC=function t(){return e};return e}function eS(){var e=P(["\n :host {\n display: inline-block;\n }\n slot {\n display: flex;\n flex-direction: column;\n }\n [role='menu'] {\n position: absolute;\n z-index: 1000;\n }\n .anchor {\n /* anchor-name: --infobox; */\n width: fit-content;\n }\n\n .positionedElement {\n position: absolute;\n /* position-anchor: --infobox; */\n /* top: anchor(bottom); */\n }\n "]);eS=function t(){return e};return e}function eR(){var e=P(['\n <option value="','" ?selected="','">',"</option>\n "]);eR=function t(){return e};return e}function eP(){var e=P(['\n <select part="select" @change="','" ?disabled="','" ?readonly="','">\n ',"\n </select>\n\n ","\n "]);eP=function t(){return e};return e}function eM(){var e=P(["\n :host {\n display: block;\n cursor: pointer;\n }\n "]);eM=function t(){return e};return e}function eT(){var e=P([" <slot></slot> "]);eT=function t(){return e};return e}function eI(){var e=P(['\n <slot part="slot"></slot>\n <slot part="dropslot" name="qti-simple-associable-choice"></slot>\n ']);eI=function t(){return e};return e}function eO(){var e=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 t(){return e};return e}function eN(){var e=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"]);eN=function t(){return e};return e}function eU(){var e=P(['<th part="r-header">',"</th>"]);eU=function t(){return e};return e}function eL(){var e=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 ']);eL=function t(){return e};return e}function e$(){var e=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>"]);e$=function t(){return e};return e}function eD(){var e=P(['<tr part="row">\n <td part="c-header">',"</td>\n ","\n </tr>"]);eD=function t(){return e};return e}function eV(){var e=P(['\n <table part="table">\n <tr part="r-header">\n <td></td>\n ',"\n </tr>\n\n ","\n </table>\n "]);eV=function t(){return e};return e}function ej(){var e=P(['\n <slot name="prompt"></slot>\n <slot ?hidden=',"></slot>\n\n ",'\n\n <div role="alert" part="message" id="validation-message"></div>\n ']);ej=function t(){return e};return e}function eH(){var e=P([' <slot name="prompt"></slot>\n <slot></slot>']);eH=function t(){return e};return e}function eQ(){var e=P([""]);eQ=function t(){return e};return e}function eF(){var e=P(["\n [part='drags'] {\n display: flex;\n align-items: flex-start;\n flex: 1;\n flex-wrap: wrap;\n }\n\n [part='drops'] {\n flex: 1;\n display: grid;\n grid-auto-flow: column;\n grid-auto-columns: 1fr;\n }\n\n :host([orientation='horizontal']) [part='drags'] {\n flex-direction: row;\n }\n :host([orientation='horizontal']) [part='drops'] {\n grid-auto-flow: column;\n }\n :host([orientation='vertical']) [part='drags'] {\n flex-direction: column;\n }\n :host([orientation='vertical']) [part='drops'] {\n grid-auto-flow: row;\n }\n\n [part='drop-list'] {\n display: block;\n flex: 1;\n }\n\n [part='container'] {\n display: flex;\n gap: 0.5rem;\n }\n :host(.qti-choices-top) [part='container'] {\n flex-direction: column;\n }\n :host(.qti-choices-bottom) [part='container'] {\n flex-direction: column-reverse;\n }\n :host(.qti-choices-left) [part='container'] {\n flex-direction: row;\n }\n :host(.qti-choices-right) [part='container'] {\n flex-direction: row-reverse;\n }\n"]);eF=function t(){return e};return e}function ez(){var e=P(['<drop-list role="region" part="drop-list" identifier="droplist','"></drop-list>']);ez=function t(){return e};return e}function eB(){var e=P([' <slot name="prompt"> </slot>\n <div part="container">\n <slot part="drags"> </slot>\n <div part="drops">\n ',"\n </div>\n </div>"]);eB=function t(){return e};return e}function eW(){var e=P(["\n ::slotted(qti-interaction-markup) {\n display: none;\n }\n"]);eW=function t(){return e};return e}function eJ(){var e=P(['<div style="color:red">\n <h1>Error</h1>\n ',"\n </div>"]);eJ=function t(){return e};return e}function eG(){var e=P(["\n <slot></slot>\n ","\n "]);eG=function t(){return e};return e}function eX(){var e=P(["\n :host {\n display: block;\n width: 100%;\n min-height: 50px;\n }\n .qti-customInteraction {\n display: block;\n width: 100%;\n min-height: 50px;\n }\n "]);eX=function t(){return e};return e}function eY(){var e=P(["<slot></slot>"]);eY=function t(){return e};return e}function eK(){var e=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 "]);eK=function t(){return e};return e}function eZ(){var e=P(["<slot></slot>"]);eZ=function t(){return e};return e}function e0(){var e=P(["\n :host {\n display: inline-block;\n position: relative;\n }\n "]);e0=function t(){return e};return e}function e1(){var e=P(['\n <button\n part="point','"\n style=','\n aria-label="Remove point at ','"\n ?disabled=',"\n @click=","\n ></button>\n "]);e1=function t(){return e};return e}function e2(){var e=P(["<div\n style=",'\n data-coord="','"\n alt=','\n data-shape="','"\n ></div>']);e2=function t(){return e};return e}function e3(){var e=P([' <slot name="prompt"></slot>\n <point-container>\n ',"\n ","\n <slot></slot>\n </point-container>"]);e3=function t(){return e};return e}function e4(){var e=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 "]);e4=function t(){return e};return e}function e5(){var e=P(['<div id="label">',"</div>"]);e5=function t(){return e};return e}function e6(){var e=P(['<div part="ch">\n <div part="cha"></div>\n </div>\n ','\n <slot part="slot"></slot>']);e6=function t(){return e};return e}function e9(){var e=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 "]);e9=function t(){return e};return e}function e7(){var e=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"]);e7=function t(){return e};return e}function e8(){var e=P(['\n <div id="knob-correct" part="knob-correct">\n <div id="value" part="value">',"</div>\n </div>\n "]);e8=function t(){return e};return e}function te(){var e=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 "]);te=function t(){return e};return e}function tt(){var e=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"]);tt=function t(){return e};return e}function tn(){var e=P(['<div part="correct">',"</div>"]);tn=function t(){return e};return e}function tr(){var e=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 "]);tr=function t(){return e};return e}function ti(){var e=P(['\n <div>\n <slot name="prompt"></slot>\n <input type="file" @change="','" ?disabled="','" ?readonly="','" />\n </div>\n ']);ti=function t(){return e};return e}function to(){var e=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 "]);to=function t(){return e};return e}function ta(){var e=P(["\n :host {\n display: block;\n }\n"]);ta=function t(){return e};return e}function ts(){var e=P(['<slot part="qti-rubric-blocks" name="qti-rubric-block"></slot><slot></slot>']);ts=function t(){return e};return e}function tl(){var e=P(["<slot></slot>"]);tl=function t(){return e};return e}function tu(){var e=P(["\n :host {\n display: none;\n }\n "]);tu=function t(){return e};return e}function tc(){var e=P(["<slot></slot>"]);tc=function t(){return e};return e}function td(){var e=P(["<slot></slot>"]);td=function t(){return e};return e}function th(){var e=P(["\n :host {\n display: none;\n }\n "]);th=function t(){return e};return e}function tf(){var e=P(["<slot></slot>"]);tf=function t(){return e};return e}function tp(){var e=P(["<slot></slot>"]);tp=function t(){return e};return e}function tv(){var e=P(["<slot></slot>"]);tv=function t(){return e};return e}function ty(){var e=P(["",""]);ty=function t(){return e};return e}function tm(){var e=P(["<pre>","</pre>\n <slot></slot>"]);tm=function t(){return e};return e}function tg(){var e=P(["\n slot {\n display: none;\n }\n "]);tg=function t(){return e};return e}function tb(){var e=P(["",""]);tb=function t(){return e};return e}function t_(){var e=P(["",""]);t_=function t(){return e};return e}function tk(){var e=P(["<slot></slot>"]);tk=function t(){return e};return e}function tw(){var e=P(["<slot></slot>"]);tw=function t(){return e};return e}function tx(){var e=P(["\n :host {\n display: block;\n }\n "]);tx=function t(){return e};return e}function tE(){var e=P(["<slot></slot>"]);tE=function t(){return e};return e}function tq(){var e=P(["",""]);tq=function t(){return e};return e}function tA(){var e=P(["\n :host {\n display: none;\n }\n "]);tA=function t(){return e};return e}function tC(){var e=P(["",""]);tC=function t(){return e};return e}function tS(){var e=P(["\n :host {\n display: none;\n }\n "]);tS=function t(){return e};return e}var QtiComponents=function(){var e=function e(e){var t=e.context;return function(e,n){var r=new WeakMap;if((typeof n==="undefined"?"undefined":I(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 tY(this,{context:t,initialValue:e})),e}};{e.constructor.addInitializer(function(e){r.set(e,new tY(e,{context:t}))});var i=Object.getOwnPropertyDescriptor(e,n),o;if(i===void 0){var a=new WeakMap;o={get:function e(){return a.get(this)},set:function e(e){r.get(this).setValue(e),a.set(this,e)},configurable:!0,enumerable:!0}}else{var s=i.set;o=x(k({},i),{set:function e(e){r.get(this).setValue(e),s===null||s===void 0?void 0:s.call(this,e)}})}return void Object.defineProperty(e,n,o)}}};var t=function e(e){var t=e.context,n=e.subscribe;return function(e,r){(typeof r==="undefined"?"undefined":I(r))=="object"?r.addInitializer(function(){var r=this;new tJ(this,{context:t,callback:function(t){e.set.call(r,t)},subscribe:n})}):e.constructor.addInitializer(function(e){new tJ(e,{context:t,callback:function(t){e[r]=t},subscribe:n})})}};var n=function e(){var e,t;return{promise:new Promise(function(n,r){e=n,t=r}),resolve:e,reject:t}};var r=function e(e,t){if(!n9(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return nZ!==void 0?nZ.createHTML(t):t};var i=function e(e){return function(t,n){return(typeof n==="undefined"?"undefined":I(n))=="object"?rN(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 l=function e(e){return i(x(k({},e),{state:!0,attribute:!1}))};var u=function e(e,t){return function(n,r,i){var o=function(t){var n;var r;return(r=(n=t.renderRoot)===null||n===void 0?void 0:n.querySelector(e))!==null&&r!==void 0?r:null};if(t){var a=(typeof r==="undefined"?"undefined":I(r))=="object"?n:i!==null&&i!==void 0?i:function(){var e=Symbol();return{get:function t(){return this[e]},set:function t(t){this[e]=t}}}(),s=a.get,l=a.set;return rU(n,r,{get:function e(){var e=s.call(this);return e===void 0&&(e=o(this),(e!==null||this.hasUpdated)&&l.call(this,e)),e}})}return rU(n,r,{get:function e(){return o(this)}})}};var y=function e(e){return function(t,n){var r=e!==null&&e!==void 0?e:{},i=r.slot,o=r.selector,a="slot"+(i?"[name=".concat(i,"]"):":not([name])");return rU(t,n,{get:function t(){var t;var n;var r=(t=this.renderRoot)===null||t===void 0?void 0:t.querySelector(a),i=(n=r===null||r===void 0?void 0:r.assignedElements(e))!==null&&n!==void 0?n:[];return o===void 0?i:i.filter(function(e){return e.matches(o)})}})}};var m=function e(e,t){var n;return function(t,r){var i=t.connectedCallback,o=t.disconnectedCallback;t.connectedCallback=function(){var t=this;var o;i.call(this);var a=function(n){var i;var o=Array.from(t.querySelectorAll(e)).concat(Array.from(((i=t.shadowRoot)===null||i===void 0?void 0:i.querySelectorAll(e))||[]));var a=true,s=false,l=undefined;try{for(var u=n[Symbol.iterator](),c;!(a=(c=u.next()).done);a=true){var d=c.value;var h=Array.from(d.addedNodes).map(function(e){return e}),f=Array.from(d.addedNodes).map(function(e){return e});d.type==="childList"&&h.find(function(e){return o.includes(e)})&&t[r](h,f)}}catch(e){s=true;l=e}finally{try{if(!a&&u.return!=null){u.return()}}finally{if(s){throw l}}}};n=new MutationObserver(a),n.observe(this,{childList:!0,subtree:!0});var s=Array.from(this.querySelectorAll(e)).concat(Array.from(((o=this.shadowRoot)===null||o===void 0?void 0:o.querySelectorAll(e))||[]));this[r](Array.from(s),[])},t.disconnectedCallback=function(){o.call(this),n.disconnect()}}};var g=function e(e,t){var n=k({waitUntilFirstUpdate:!1},t);return function(t,r){var i=t.update,o=Array.isArray(e)?e:[e];t.update=function(e){var t=this;o.forEach(function(i){var o=i;if(e.has(o)){var a=e.get(o),s=t[o];a!==s&&(!n.waitUntilFirstUpdate||t.hasUpdated)&&t[r](a,s)}}),i.call(this,e)}}};var b=function e(e,t,n){e.querySelectorAll(t).forEach(function(e){var r="".concat(t,"-").concat(n),i=w(e,r);e.replaceWith(i)})};var _=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),i="".concat(e.nodeName,"-").concat(r),o=w(e,i);e.replaceWith(o)}})})};var w=function e(e,t){var n=document.createElement(t);var r=true,i=false,o=undefined;try{for(var a=e.attributes[Symbol.iterator](),s;!(r=(s=a.next()).done);r=true){var l=s.value;n.setAttribute(l.name,l.value)}}catch(e){i=true;o=e}finally{try{if(!r&&a.return!=null){a.return()}}finally{if(i){throw o}}}for(;e.firstChild;)n.appendChild(e.firstChild);return n};var E=function e(e){var t=new XMLHttpRequest;return{promise:new Promise(function(n,r){t.open("GET",e,!0),t.responseType="document",t.onload=function(){t.status>=200&&t.status<300?n(t.responseXML):r(t.statusText)},t.onerror=function(){r(t.statusText)},t.send()}),xhr:t}};var q=function e(e){return new DOMParser().parseFromString(e,"text/xml")};var C=function e(e){var t=new XSLTProcessor,n=new DOMParser().parseFromString(rj,"text/xml");return t.importStylesheet(n),t.transformToFragment(e,document)};var R=function e(e,t){t.endsWith("/")||(t+="/"),e.querySelectorAll("[src],[href],[primary-path]").forEach(function(e){var n;var r="";e.getAttribute("src")&&(r="src"),e.getAttribute("href")&&(r="href"),e.getAttribute("primary-path")&&(r="primary-path");var i=(n=e.getAttribute(r))===null||n===void 0?void 0:n.trim();if(!/^(data:|https?:|blob:)/.test(i)){var o=t+encodeURI(i);e.setAttribute(r,o)}})};var P=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 O=function e(e){e.querySelectorAll("qti-stylesheet").forEach(function(e){return e.remove()})};var U=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:}};var tR=function e(e){return e==null};var tP=function e(e){return e.replace(/([^:]\/)\/+/g,"$1").replace(/\/\//g,"/").replace("http:/","http://").replace("https:/","https://")};var tM=function e(e,t){var n=/*#__PURE__*/function(e){"use strict";p(n,e);function n(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}s(this,n);var i;i=a(this,n,T(t));i.identifier="";i.tabIndex=0;i.disabled=!1;i.readonly=!1;i.internals=i.attachInternals();return i}c(n,[{key:"handleDisabledChange",value:function e(e,t){this.tabIndex=t?-1:0,t&&this.blur()}},{key:"connectedCallback",value:function e(){h(f(n.prototype),"connectedCallback",this).call(this),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(){h(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.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 rl($())}}]);return n}(e);return tz([i({type:String})],n.prototype,"identifier",2),tz([i({type:Number,reflect:!0,attribute:"tabindex"})],n.prototype,"tabIndex",2),tz([i({type:Boolean,reflect:!0,attribute:"aria-disabled",converter:il})],n.prototype,"disabled",2),tz([i({type:Boolean,reflect:!0,attribute:"aria-readonly",converter:il})],n.prototype,"readonly",2),tz([g("disabled",{waitUntilFirstUpdate:!0})],n.prototype,"handleDisabledChange",1),n};var tT=function e(e,t,n,r){var i=n.getAttribute("width")?parseFloat(n.getAttribute("width")):n.naturalWidth,o=n.getAttribute("height")?parseFloat(n.getAttribute("height")):n.naturalHeight;switch(e){case"circle":{if(t.length!==3){console.error("Invalid cirlce coordinates:",t);return}var a=S(t,3),s=a[0],l=a[1],u=a[2],c=s/i*100,d=l/o*100,h=u/i*100;r.style.left=c-h+"%",r.style.top=d-h+"%";var f=u/i*100,p=u/o*100;r.style.width=2*f+"%",r.style.height=2*p+"%",r.style.borderRadius="50%"}break;case"rect":{if(t.length!==4){console.error("Invalid rectangle coordinates:",t);return}var v=S(t,4),y=v[0],m=v[1],g=v[2],b=v[3],_=y/i*100,k=m/o*100,w=g/i*100,x=b/o*100;r.style.left=_+"%",r.style.top=k+"%",r.style.width=w-_+"%",r.style.height=x-k+"%"}break;case"ellipse":{if(t.length!==4){console.error("Invalid ellipse coordinates:",t);return}var E=S(t,4),q=E[0],A=E[1],C=E[2],R=E[3],P=q/i*100,M=A/o*100,I=C/i*100,O=R/o*100;r.style.left=P-I+"%",r.style.top=M-O+"%",r.style.width=2*I+"%",r.style.height=2*O+"%",r.style.borderRadius="50%"}break;case"poly":{var N,U,L,$;if(t.length<6||t.length%2!==0){console.error("Invalid polygon coordinates:",t);return}var D=[];for(var V=0;V<t.length;V+=2)D.push({x:t[V],y:t[V+1]});var j=(N=Math).min.apply(N,T(D.map(function(e){return e.x}))),H=(U=Math).max.apply(U,T(D.map(function(e){return e.x}))),Q=(L=Math).min.apply(L,T(D.map(function(e){return e.y}))),F=($=Math).max.apply($,T(D.map(function(e){return e.y}))),z=j/i*100,B=Q/o*100,W=H/i*100,J=F/o*100;r.style.left=z+"%",r.style.top=B+"%",r.style.width=W-z+"%",r.style.height=J-B+"%";var G=D.map(function(e){return{x:(e.x-j)/(H-j)*100,y:(e.y-Q)/(F-Q)*100}}).map(function(e){return"".concat(e.x,"% ").concat(e.y,"%")}).join(",");r.style.clipPath="polygon(".concat(G,")")}break;default:console.error("Unsupported shape: ".concat(e));break}};var tI=function e(e){this._$AN!==void 0?(i6(this),this._$AM=e,i9(this)):this._$AM=e};var tO=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,i=this._$AN;if(i!==void 0&&i.size!==0)if(t)if(Array.isArray(r))for(var o=n;o<r.length;o++)i5(r[o],!1),i6(r[o]);else r!=null&&(i5(r,!1),i6(r));else i5(this,e)};var tN=function e(e){return /*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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 tU=function e(e){return /*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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 tL;var t$=Object.defineProperty;var tD=Object.getOwnPropertyDescriptor;var tV=Object.getOwnPropertyNames;var tj=Object.prototype.hasOwnProperty;var tH=function(e,t){for(var n in t)t$(e,n,{get:t[n],enumerable:!0})},tQ=function(e,t,n,r){var i=true,o=false,a=undefined;if(t&&(typeof t==="undefined"?"undefined":I(t))=="object"||typeof t=="function")try{var s=function(){var i=u.value;!tj.call(e,i)&&i!==n&&t$(e,i,{get:function(){return t[i]},enumerable:!(r=tD(t,i))||r.enumerable})};for(var l=tV(t)[Symbol.iterator](),u;!(i=(u=l.next()).done);i=true)s()}catch(e){o=true;a=e}finally{try{if(!i&&l.return!=null){l.return()}}finally{if(o){throw a}}}return e};var tF=function(e){return tQ(t$({},"__esModule",{value:!0}),e)},tz=function(e,t,n,r){for(var i=r>1?void 0:r?tD(t,n):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(r?a(t,n,i):a(i))||i);return r&&i&&t$(t,n,i),i};var tB={};tH(tB,{QtiAnd:function(){return oC},QtiAssessmentItem:function(){return rD},QtiAssessmentStimulusRef:function(){return rQ},QtiAssociableHotspot:function(){return rZ},QtiAssociateInteraction:function(){return r5},QtiBaseValue:function(){return oS},QtiChoiceInteraction:function(){return r8},QtiCompanionMaterialsInfo:function(){return rF},QtiContainerSize:function(){return oR},QtiContains:function(){return oP},QtiContentBody:function(){return ar},QtiCorrect:function(){return oM},QtiCustomInteraction:function(){return ie},QtiCustomOperator:function(){return rz},QtiDefault:function(){return oI},QtiDelete:function(){return at},QtiEndAttemptInteraction:function(){return it},QtiEqual:function(){return oL},QtiEqualRounded:function(){return oO},QtiExtendedTextInteraction:function(){return ii},QtiFeedbackBlock:function(){return rG},QtiFeedbackInline:function(){return rY},QtiFieldValue:function(){return oQ},QtiGap:function(){return ic},QtiGapImg:function(){return io},QtiGapMatchInteraction:function(){return is},QtiGapText:function(){return iu},QtiGcd:function(){return o$},QtiGraphicAssociateInteraction:function(){return iC},QtiGraphicGapMatchInteraction:function(){return iR},QtiGraphicOrderInteraction:function(){return iM},QtiGt:function(){return oD},QtiGte:function(){return oV},QtiHotspotChoice:function(){return iT},QtiHotspotInteraction:function(){return iO},QtiHottext:function(){return iU},QtiHottextInteraction:function(){return iN},QtiIndex:function(){return an},QtiInlineChoice:function(){return iV},QtiInlineChoiceInteraction:function(){return iD},QtiIsNull:function(){return oH},QtiItemBody:function(){return ol},QtiLookupOutcomeValue:function(){return om},QtiLt:function(){return oF},QtiLte:function(){return oz},QtiMapResponse:function(){return oB},QtiMapResponsePoint:function(){return oW},QtiMatch:function(){return oG},QtiMatchInteraction:function(){return iQ},QtiMathOperator:function(){return oJ},QtiMediaInteraction:function(){return iF},QtiMember:function(){return oX},QtiModalFeedback:function(){return rK},QtiMultiple:function(){return oY},QtiNot:function(){return oK},QtiNull:function(){return oj},QtiOr:function(){return oZ},QtiOrderInteraction:function(){return iB},QtiOrdered:function(){return o0},QtiOutcomeDeclaration:function(){return as},QtiOutcomeProcessing:function(){return ou},QtiOutcomeProcessingProcessor:function(){return oc},QtiPortableCustomInteraction:function(){return iJ},QtiPositionObjectInteraction:function(){return iG},QtiPositionObjectStage:function(){return iX},QtiPower:function(){return o1},QtiPrintedVariable:function(){return o2},QtiProduct:function(){return o3},QtiPrompt:function(){return od},QtiRandom:function(){return ae},QtiRandomInteger:function(){return o8},QtiResponseCondition:function(){return og},QtiResponseDeclaration:function(){return al},QtiResponseElse:function(){return ok},QtiResponseElseIf:function(){return ox},QtiResponseIf:function(){return ow},QtiResponseProcessing:function(){return ov},QtiRound:function(){return oN},QtiRoundTo:function(){return oU},QtiRubricBlock:function(){return ai},QtiRule:function(){return oy},QtiSelectPointInteraction:function(){return i1},QtiSetOutcomeValue:function(){return ob},QtiSetOutcomeValueRule:function(){return o_},QtiSimpleAssociableChoice:function(){return ij},QtiSimpleChoice:function(){return i2},QtiSliderInteraction:function(){return i4},QtiStringMatch:function(){return o5},QtiStylesheet:function(){return ao},QtiSubtract:function(){return o4},QtiSum:function(){return o6},QtiSumExpression:function(){return o9},QtiTextEntryInteraction:function(){return oo},QtiUploadInteraction:function(){return oa},QtiVariable:function(){return o7},qtiAndMixin:function(){return tN},qtiSubtractMixin:function(){return tU}});var tW=/*#__PURE__*/function(e){"use strict";p(t,e);function t(e,n,r,i){s(this,t);var o;o=a(this,t,["context-request",{bubbles:!0,composed:!0}]),o.context=e,o.contextTarget=n,o.callback=r,o.subscribe=i!==null&&i!==void 0?i:!1;return o}return t}(N(Event));var tJ=/*#__PURE__*/function(){"use strict";function e(t,n,r,i){var o=this;s(this,e);if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=function(e,t){o.unsubscribe&&(o.unsubscribe!==t&&(o.provided=!1,o.unsubscribe()),o.subscribe||o.unsubscribe()),o.value=e,o.host.requestUpdate(),o.provided&&!o.subscribe||(o.provided=!0,o.callback&&o.callback(e,t)),o.unsubscribe=t},this.host=t,n.context!==void 0){var a=n;var l;this.context=a.context,this.callback=a.callback,this.subscribe=(l=a.subscribe)!==null&&l!==void 0?l:!1}else this.context=n,this.callback=r,this.subscribe=i!==null&&i!==void 0?i:!1;this.host.addController(this)}c(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 tW(this.context,this.host,this.t,this.subscribe))}}]);return e}();var tG=/*#__PURE__*/function(){"use strict";function e(t){var n=this;s(this,e);this.subscriptions=new Map,this.updateObservers=function(){var e=true,t=false,r=undefined;try{for(var i=n.subscriptions[Symbol.iterator](),o;!(e=(o=i.next()).done);e=true){var a=S(o.value,2),s=a[0],l=a[1],u=l.disposer;s(n.o,u)}}catch(e){t=true;r=e}finally{try{if(!e&&i.return!=null){i.return()}}finally{if(t){throw r}}}},t!==void 0&&(this.value=t)}c(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(){r.subscriptions.delete(e)},consumerHost:t});var i=this.subscriptions.get(e),o=i.disposer;e(this.value,o)}},{key:"clearCallbacks",value:function e(){this.subscriptions.clear()}}]);return e}();var tX=/*#__PURE__*/function(e){"use strict";p(t,e);function t(e,n){s(this,t);var r;r=a(this,t,["context-provider",{bubbles:!0,composed:!0}]),r.context=e,r.contextTarget=n;return r}return t}(N(Event)),tY=/*#__PURE__*/function(e){"use strict";p(t,e);function t(e,n,r){s(this,t);var i;var o,l;i=a(this,t,[n.context!==void 0?n.initialValue:r]),i.onContextRequest=function(e){if(e.context!==i.context)return;var t;var n=(t=e.contextTarget)!==null&&t!==void 0?t:e.composedPath()[0];n!==i.host&&(e.stopPropagation(),i.addCallback(e.callback,n,e.subscribe))},i.onProviderRequest=function(e){var t;if(e.context!==i.context||((t=e.contextTarget)!==null&&t!==void 0?t:e.composedPath()[0])===i.host)return;var n=new Set;var r=true,o=false,a=undefined;try{for(var s=i.subscriptions[Symbol.iterator](),l;!(r=(l=s.next()).done);r=true){var u=S(l.value,2),c=u[0],d=u[1],h=d.consumerHost;n.has(c)||(n.add(c),h.dispatchEvent(new tW(i.context,h,c,!0)))}}catch(e){o=true;a=e}finally{try{if(!r&&s.return!=null){s.return()}}finally{if(o){throw a}}}e.stopPropagation()},i.host=e,n.context!==void 0?i.context=n.context:i.context=n,i.attachListeners(),(o=(l=i.host).addController)===null||o===void 0?void 0:o.call(l,i);return i}c(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 tX(this.context,this.host))}}]);return t}(tG);var tK=/*#__PURE__*/function(){"use strict";function e(t){s(this,e);this.ariaAtomic="",this.ariaAutoComplete="",this.ariaBrailleLabel="",this.ariaBrailleRoleDescription="",this.ariaBusy="",this.ariaChecked="",this.ariaColCount="",this.ariaColIndex="",this.ariaColSpan="",this.ariaCurrent="",this.ariaDescription="",this.ariaDisabled="",this.ariaExpanded="",this.ariaHasPopup="",this.ariaHidden="",this.ariaInvalid="",this.ariaKeyShortcuts="",this.ariaLabel="",this.ariaLevel="",this.ariaLive="",this.ariaModal="",this.ariaMultiLine="",this.ariaMultiSelectable="",this.ariaOrientation="",this.ariaPlaceholder="",this.ariaPosInSet="",this.ariaPressed="",this.ariaReadOnly="",this.ariaRequired="",this.ariaRoleDescription="",this.ariaRowCount="",this.ariaRowIndex="",this.ariaRowSpan="",this.ariaSelected="",this.ariaSetSize="",this.ariaSort="",this.ariaValueMax="",this.ariaValueMin="",this.ariaValueNow="",this.ariaValueText="",this.role="",this.form=null,this.labels=[],this.states=new Set,this.validationMessage="",this.validity={},this.willValidate=!0,this.__host=t}c(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 tZ=function e(e,t,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(e,n):i?i.value=n:t.set(e,n),n},t0=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)},t1,t2,t3,t4,t5,t6,t9,t7,t8,ne,nt,nn,nr=function(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 ni=/*#__PURE__*/function(){"use strict";function e(){s(this,e);this.__eventListeners=new Map,this.__captureEventListeners=new Map}c(e,[{key:"addEventListener",value:function e(e,t,n){var r=this;var i;if(t==null)return;var o=nr(n)?this.__captureEventListeners:this.__eventListeners,a=o.get(e);if(a===void 0)a=new Map,o.set(e,a);else if(a.has(t))return;var s=(typeof n==="undefined"?"undefined":I(n))=="object"&&n?n:{};(i=s.signal)===null||i===void 0?void 0:i.addEventListener("abort",function(){return r.removeEventListener(e,t,n)}),a.set(t,s!==null&&s!==void 0?s:{})}},{key:"removeEventListener",value:function e(e,t,n){if(t==null)return;var r=nr(n)?this.__captureEventListeners:this.__eventListeners,i=r.get(e);i!==void 0&&(i.delete(t),i.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 i=!1,o=!1,a=0,s=null,l=null,u=null,c=e.stopPropagation,d=e.stopImmediatePropagation;Object.defineProperties(e,{target:k({get:function e(){return s!==null&&s!==void 0?s:l}},na),srcElement:k({get:function t(){return e.target}},na),currentTarget:k({get:function e(){return u}},na),eventPhase:k({get:function e(){return a}},na),composedPath:k({value:function(){return n}},na),stopPropagation:k({value:function(){i=!0,c.call(e)}},na),stopImmediatePropagation:k({value:function(){o=!0,d.call(e)}},na)});var h=function(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(){return u=null,a=0,!e.defaultPrevented},p=n.slice().reverse();s=!this.__host||!e.composed?this:null;var v=function(e){for(l=t;l.__host&&e.includes(l.__host);)l=l.__host};var y=true,m=false,g=undefined;try{for(var b=p[Symbol.iterator](),_;!(y=(_=b.next()).done);y=true){var w=_.value;!s&&(!l||l===w.__host)&&v(p.slice(p.indexOf(w))),u=w,a=w===e.target?2:1;var x=w.__captureEventListeners.get(e.type);if(x){var E=true,q=false,A=undefined;try{for(var C=x[Symbol.iterator](),R;!(E=(R=C.next()).done);E=true){var P=S(R.value,2),M=P[0],T=P[1];if(h(M,T,x),o)return f()}}catch(e){q=true;A=e}finally{try{if(!E&&C.return!=null){C.return()}}finally{if(q){throw A}}}}if(i)return f()}}catch(e){m=true;g=e}finally{try{if(!y&&b.return!=null){b.return()}}finally{if(m){throw g}}}var I=e.bubbles?n:[this];l=null;var O=true,N=false,U=undefined;try{for(var L=I[Symbol.iterator](),$;!(O=($=L.next()).done);O=true){var D=$.value;!s&&(!l||D===l.__host)&&v(I.slice(0,I.indexOf(D)+1)),u=D,a=D===e.target?2:3;var V=D.__eventListeners.get(e.type);if(V){var j=true,H=false,Q=undefined;try{for(var F=V[Symbol.iterator](),z;!(j=(z=F.next()).done);j=true){var B=S(z.value,2),W=B[0],J=B[1];if(h(W,J,V),o)return f()}}catch(e){H=true;Q=e}finally{try{if(!j&&F.return!=null){F.return()}}finally{if(H){throw Q}}}}if(i)return f()}}catch(e){N=true;U=e}finally{try{if(!O&&L.return!=null){L.return()}}finally{if(N){throw U}}}return f()}}]);return e}(),no=ni;var na={__proto__:null};na.enumerable=!0;Object.freeze(na);var ns=(ne=/*#__PURE__*/function(){"use strict";function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};s(this,e);if(t1.set(this,!1),t2.set(this,!1),t3.set(this,!1),t4.set(this,!1),t5.set(this,Date.now()),t6.set(this,!1),t9.set(this,void 0),t7.set(this,void 0),t8.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":I(n))!="object"||!n)throw new Error('The "options" argument must be an object');var r=n.bubbles,i=n.cancelable,o=n.composed;tZ(this,t1,!!i,"f"),tZ(this,t2,!!r,"f"),tZ(this,t3,!!o,"f"),tZ(this,t9,"".concat(t),"f"),tZ(this,t7,null,"f"),tZ(this,t8,!1,"f")}c(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(){tZ(this,t4,!0,"f")}},{key:"target",get:function e(){return t0(this,t7,"f")}},{key:"currentTarget",get:function e(){return t0(this,t7,"f")}},{key:"srcElement",get:function e(){return t0(this,t7,"f")}},{key:"type",get:function e(){return t0(this,t9,"f")}},{key:"cancelable",get:function e(){return t0(this,t1,"f")}},{key:"defaultPrevented",get:function e(){return t0(this,t1,"f")&&t0(this,t4,"f")}},{key:"timeStamp",get:function e(){return t0(this,t5,"f")}},{key:"composedPath",value:function e(){return t0(this,t8,"f")?[t0(this,t7,"f")]:[]}},{key:"returnValue",get:function e(){return!t0(this,t1,"f")||!t0(this,t4,"f")}},{key:"bubbles",get:function e(){return t0(this,t2,"f")}},{key:"composed",get:function e(){return t0(this,t3,"f")}},{key:"eventPhase",get:function e(){return t0(this,t8,"f")?ne.AT_TARGET:ne.NONE}},{key:"cancelBubble",get:function e(){return t0(this,t6,"f")},set:function e(e){e&&tZ(this,t6,!0,"f")}},{key:"stopPropagation",value:function e(){tZ(this,t6,!0,"f")}},{key:"isTrusted",get:function e(){return!1}}]);return e}(),t1=new WeakMap,t2=new WeakMap,t3=new WeakMap,t4=new WeakMap,t5=new WeakMap,t6=new WeakMap,t9=new WeakMap,t7=new WeakMap,t8=new WeakMap,ne.NONE=0,ne.CAPTURING_PHASE=1,ne.AT_TARGET=2,ne.BUBBLING_PHASE=3,ne);Object.defineProperties(ns.prototype,{initEvent:na,stopImmediatePropagation:na,preventDefault:na,target:na,currentTarget:na,srcElement:na,type:na,cancelable:na,defaultPrevented:na,timeStamp:na,composedPath:na,returnValue:na,bubbles:na,composed:na,eventPhase:na,cancelBubble:na,stopPropagation:na,isTrusted:na});var nl=(nn=/*#__PURE__*/function(e){"use strict";p(t,e);function t(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};s(this,t);var r;var i;r=a(this,t,[e,n]),nt.set(r,void 0),tZ(r,nt,(i=n===null||n===void 0?void 0:n.detail)!==null&&i!==void 0?i:null,"f");return r}c(t,[{key:"initCustomEvent",value:function e(e,t,n,r){throw new Error("Method not implemented.")}},{key:"detail",get:function e(){return t0(this,nt,"f")}}]);return t}(ns),nt=new WeakMap,nn);Object.defineProperties(nl.prototype,{detail:na});var nu=ns,nc=nl;var nd;(nd=globalThis.Event)!==null&&nd!==void 0?nd:globalThis.Event=nu;var nh;(nh=globalThis.CustomEvent)!==null&&nh!==void 0?nh:globalThis.CustomEvent=nc;var nf=new WeakMap,np=function(e){var t=nf.get(e);return t===void 0&&nf.set(e,t=new Map),t},nv=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments),e.__shadowRootMode=null,e.__shadowRoot=null,e.__internals=null;return e}c(t,[{key:"attributes",get:function e(){return Array.from(np(this)).map(function(e){var t=S(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){np(this).set(e,String(t))}},{key:"removeAttribute",value:function e(e){np(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 np(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 tK(this);return this.__internals=e,e}},{key:"getAttribute",value:function e(e){var t;return(t=np(this).get(e))!==null&&t!==void 0?t:null}}]);return t}(no);var ny=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}return t}(nv),nm=ny;var ng;(ng=globalThis.litServerRoot)!==null&&ng!==void 0?ng:globalThis.litServerRoot=Object.defineProperty(new nm,"localName",{get:function e(){return"lit-server-root"}});var nb=/*#__PURE__*/function(){"use strict";function e(){s(this,e);this.__definitions=new Map,this.__reverseDefinitions=new Map,this.__pendingWhenDefineds=new Map}c(e,[{key:"define",value:function e(e,t){var n;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)));var r;t.__localName=e,this.__definitions.set(e,{ctor:t,observedAttributes:(r=t.observedAttributes)!==null&&r!==void 0?r:[]}),this.__reverseDefinitions.set(t,e),(n=this.__pendingWhenDefineds.get(e))===null||n===void 0?void 0:n.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 e(e){return o(function(){var t,r;return L(this,function(i){t=this.__definitions.get(e);if(t)return[2,t.ctor];r=this.__pendingWhenDefineds.get(e);return[2,(r||(r=n(),this.__pendingWhenDefineds.set(e,r)),r.promise)]})}).call(this)}}]);return e}(),n_=nb;var nk=new n_;var nw=globalThis,nx=nw.ShadowRoot&&(nw.ShadyCSS===void 0||nw.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,nE=Symbol(),nq=new WeakMap,nA=/*#__PURE__*/function(){"use strict";function e(t,n,r){s(this,e);if(this._$cssResult$=!0,r!==nE)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=n}c(e,[{key:"styleSheet",get:function e(){var e=this.o,t=this.t;if(nx&&e===void 0){var n=t!==void 0&&t.length===1;n&&(e=nq.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&nq.set(t,e))}return e}},{key:"toString",value:function e(){return this.cssText}}]);return e}(),nC=function(e){return new nA(typeof e=="string"?e:e+"",void 0,nE)},nS=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]}var i=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 nA(i,e,nE)},nR=function(e,t){var n=true,r=false,i=undefined;if(nx)e.adoptedStyleSheets=t.map(function(e){return v(e,CSSStyleSheet)?e:e.styleSheet});else try{for(var o=t[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){var s=a.value;var l=document.createElement("style"),u=nw.litNonce;u!==void 0&&l.setAttribute("nonce",u),l.textContent=s.cssText,e.appendChild(l)}}catch(e){r=true;i=e}finally{try{if(!n&&o.return!=null){o.return()}}finally{if(r){throw i}}}},nP=nx||nw.CSSStyleSheet===void 0?function(e){return e}:function(e){return v(e,CSSStyleSheet)?function(e){var t="";var n=true,r=false,i=undefined;try{for(var o=e.cssRules[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){var s=a.value;t+=s.cssText}}catch(e){r=true;i=e}finally{try{if(!n&&o.return!=null){o.return()}}finally{if(r){throw i}}}return nC(t)}(e):e};var nM=Object.is,nT=Object.defineProperty,nI=Object.getOwnPropertyDescriptor,nO=Object.getOwnPropertyNames,nN=Object.getOwnPropertySymbols,nU=Object.getPrototypeOf,nL=globalThis;var n$;(n$=nL.customElements)!==null&&n$!==void 0?n$:nL.customElements=nk;var nD=nL.trustedTypes,nV=nD?nD.emptyScript:"",nj=nL.reactiveElementPolyfillSupport,nH=function(e,t){return e},nQ={toAttribute:function e(e,t){switch(t){case Boolean:e=e?nV: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}},nF=function(e,t){return!nM(e,t)},nz={attribute:!0,type:String,converter:nQ,reflect:!1,useDefault:!1,hasChanged:nF};var nB,nW;(nB=Symbol.metadata)!==null&&nB!==void 0?nB:Symbol.metadata=Symbol("metadata"),(nW=nL.litPropertyMetadata)!==null&&nW!==void 0?nW:nL.litPropertyMetadata=new WeakMap;var nJ;var nG=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t),e._$Ep=void 0,e.isUpdatePending=!1,e.hasUpdated=!1,e._$Em=null,e._$Ev();return e}c(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;((n=this._$EO)!==null&&n!==void 0?n:this._$EO=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)===null||t===void 0?void 0:t.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,i=undefined;try{for(var o=t.keys()[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){var s=a.value;this.hasOwnProperty(s)&&(e.set(s,this[s]),delete this[s])}}catch(e){r=true;i=e}finally{try{if(!n&&o.return!=null){o.return()}}finally{if(r){throw i}}}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 nR(t,this.constructor.elementStyles),t}},{key:"connectedCallback",value:function e(){var e;var t;(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(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 i;var o=(((i=n.converter)===null||i===void 0?void 0:i.toAttribute)!==void 0?n.converter:nQ).toAttribute(t,n.type);this._$Em=e,o==null?this.removeAttribute(r):this.setAttribute(r,o),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 i,o;var a=n.getPropertyOptions(r),s=typeof a.converter=="function"?{fromAttribute:a.converter}:((i=a.converter)===null||i===void 0?void 0:i.fromAttribute)!==void 0?a.converter:nQ;this._$Em=r;var l=s.fromAttribute(t,a.type);var u;this[r]=(u=l!==null&&l!==void 0?l:(o=this._$Ej)===null||o===void 0?void 0:o.get(r))!==null&&u!==void 0?u:l,this._$Em=null}}},{key:"requestUpdate",value:function e(e,t,n){if(e!==void 0){var r;var i=this.constructor,o=this[e];var a;if(n!==null&&n!==void 0?n:n=i.getPropertyOptions(e),!(((a=n.hasChanged)!==null&&a!==void 0?a:nF)(o,t)||n.useDefault&&n.reflect&&o===((r=this._$Ej)===null||r===void 0?void 0:r.get(e))&&!this.hasAttribute(i._$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 i=n.useDefault,o=n.reflect,a=n.wrapped;var s,l,u;i&&!((s=this._$Ej)!==null&&s!==void 0?s:this._$Ej=new Map).has(e)&&(this._$Ej.set(e,(l=r!==null&&r!==void 0?r:t)!==null&&l!==void 0?l:this[e]),a!==!0||r!==void 0)||(this._$AL.has(e)||(this.hasUpdated||i||(t=void 0),this._$AL.set(e,t)),o===!0&&this._$Em!==e&&((u=this._$Eq)!==null&&u!==void 0?u:this._$Eq=new Set).add(e))}},{key:"_$EP",value:function e(){return o(function(){var e,t,n;return L(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 i=this._$Ep[Symbol.iterator](),o;!(t=(o=i.next()).done);t=true){var a=S(o.value,2),s=a[0],l=a[1];this[s]=l}}catch(e){n=true;r=e}finally{try{if(!t&&i.return!=null){i.return()}}finally{if(n){throw r}}}this._$Ep=void 0}var u=this.constructor.elementProperties;var c=true,d=false,h=undefined;if(u.size>0)try{for(var f=u[Symbol.iterator](),p;!(c=(p=f.next()).done);c=true){var v=S(p.value,2),y=v[0],m=v[1];var g=m.wrapped,b=this[y];g!==!0||this._$AL.has(y)||b===void 0||this.C(y,void 0,m,b)}}catch(e){d=true;h=e}finally{try{if(!c&&f.return!=null){f.return()}}finally{if(d){throw h}}}}var _=!1,k=this._$AL;try{var w;_=this.shouldUpdate(k),_?(this.willUpdate(k),(w=this._$EO)===null||w===void 0?void 0:w.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 _=!1,this._$EM(),e}_&&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&&T(this._$Eh.keys())}},{key:"createProperty",value:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:nz;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&&nT(this.prototype,e,r)}}},{key:"getPropertyDescriptor",value:function e(e,t,n){var r;var i=(r=nI(this.prototype,e))!==null&&r!==void 0?r:{get:function e(){return this[t]},set:function e(e){this[t]=e}},o=i.get,a=i.set;return{get:o,set:function t(t){var r=o===null||o===void 0?void 0:o.call(this);a===null||a===void 0?void 0:a.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:nz}},{key:"_$Ei",value:function e(){if(this.hasOwnProperty(nH("elementProperties")))return;var e=nU(this);e.finalize(),e.l!==void 0&&(this.l=T(e.l)),this.elementProperties=new Map(e.elementProperties)}},{key:"finalize",value:function e(){if(this.hasOwnProperty(nH("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(nH("properties"))){var e=this.properties,t=T(nO(e)).concat(T(nN(e)));var n=true,r=false,i=undefined;try{for(var o=t[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){var s=a.value;this.createProperty(s,e[s])}}catch(e){r=true;i=e}finally{try{if(!n&&o.return!=null){o.return()}}finally{if(r){throw i}}}}var l=this[Symbol.metadata];if(l!==null){var u=litPropertyMetadata.get(l);var c=true,d=false,h=undefined;if(u!==void 0)try{for(var f=u[Symbol.iterator](),p;!(c=(p=f.next()).done);c=true){var v=S(p.value,2),y=v[0],m=v[1];this.elementProperties.set(y,m)}}catch(e){d=true;h=e}finally{try{if(!c&&f.return!=null){f.return()}}finally{if(d){throw h}}}}this._$Eh=new Map;var g=true,b=false,_=undefined;try{for(var k=this.elementProperties[Symbol.iterator](),w;!(g=(w=k.next()).done);g=true){var x=S(w.value,2),E=x[0],q=x[1];var A=this._$Eu(E,q);A!==void 0&&this._$Eh.set(A,E)}}catch(e){b=true;_=e}finally{try{if(!g&&k.return!=null){k.return()}}finally{if(b){throw _}}}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,i=false,o=undefined;try{for(var a=n[Symbol.iterator](),s;!(r=(s=a.next()).done);r=true){var l=s.value;t.unshift(nP(l))}}catch(e){i=true;o=e}finally{try{if(!r&&a.return!=null){a.return()}}finally{if(i){throw o}}}}else e!==void 0&&t.push(nP(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}((nJ=globalThis.HTMLElement)!==null&&nJ!==void 0?nJ:nm);var nX;nG.elementStyles=[],nG.shadowRootOptions={mode:"open"},nG[nH("elementProperties")]=new Map,nG[nH("finalized")]=new Map,nj===null||nj===void 0?void 0:nj({ReactiveElement:nG}),((nX=nL.reactiveElementVersions)!==null&&nX!==void 0?nX:nL.reactiveElementVersions=[]).push("2.1.1");var nY=globalThis,nK=nY.trustedTypes,nZ=nK?nK.createPolicy("lit-html",{createHTML:function(e){return e}}):void 0,n0="$lit$",n1="lit$".concat(Math.random().toFixed(9).slice(2),"$"),n2="?"+n1,n3="<".concat(n2,">"),n4=nY.document===void 0?{createTreeWalker:function(){return{}}}:document,n5=function(){return n4.createComment("")},n6=function(e){return e===null||(typeof e==="undefined"?"undefined":I(e))!="object"&&typeof e!="function"},n9=Array.isArray,n7=function(e){return n9(e)||typeof(e===null||e===void 0?void 0:e[Symbol.iterator])=="function"},n8="[ \n\f\r]",re=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,rt=/-->/g,rn=/>/g,rr=RegExp(">|".concat(n8,"(?:([^\\s\"'>=/]+)(").concat(n8,"*=").concat(n8,"*(?:[^ \n\f\r\"'`<>=]|(\"|')|))|$)"),"g"),ri=/'/g,ro=/"/g,ra=/^(?:script|style|textarea|title)$/i,rs=function(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++){r[i-1]=arguments[i]}return{_$litType$:e,strings:t,values:r}}},rl=rs(1),ru=rs(2),rc=rs(3),rd=Symbol.for("lit-noChange"),rh=Symbol.for("lit-nothing"),rf=new WeakMap,rp=n4.createTreeWalker(n4,129);var rv=function(e,t){var n=e.length-1,i=[],o,a=t===2?"<svg>":t===3?"<math>":"",s=re;for(var l=0;l<n;l++){var u=e[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===re?d[1]==="!--"?s=rt:d[1]!==void 0?s=rn:d[2]!==void 0?(ra.test(d[2])&&(o=RegExp("</"+d[2],"g")),s=rr):d[3]!==void 0&&(s=rr):s===rr?d[0]===">"?(s=o!==null&&o!==void 0?o:re,h=-1):d[1]===void 0?h=-2:(h=s.lastIndex-d[2].length,c=d[1],s=d[3]===void 0?rr:d[3]==='"'?ro:ri):s===ro||s===ri?s=rr:s===rt||s===rn?s=re:(s=rr,o=void 0);var p=s===rr&&e[l+1].startsWith("/>")?" ":"";a+=s===re?u+n3:h>=0?(i.push(c),u.slice(0,h)+n0+u.slice(h)+n1+p):u+n1+(h===-2?l:p)}return[r(e,a+(e[n]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),i]},ry=/*#__PURE__*/function(){"use strict";function e(t,n){var r=t.strings,i=t._$litType$;s(this,e);var o;this.parts=[];var a=0,l=0,u=r.length-1,c=this.parts,d=S(rv(r,i),2),h=d[0],f=d[1];if(this.el=e.createElement(h,n),rp.currentNode=this.el.content,i===2||i===3){var p;var v=this.el.content.firstChild;(p=v).replaceWith.apply(p,T(v.childNodes))}for(;(o=rp.nextNode())!==null&&c.length<u;){if(o.nodeType===1){var y=true,m=false,g=undefined;if(o.hasAttributes())try{for(var b=o.getAttributeNames()[Symbol.iterator](),_;!(y=(_=b.next()).done);y=true){var k=_.value;if(k.endsWith(n0)){var w=f[l++],x=o.getAttribute(k).split(n1),E=/([.?@])?(.*)/.exec(w);c.push({type:1,index:a,name:E[2],strings:x,ctor:E[1]==="."?rk:E[1]==="?"?rw:E[1]==="@"?rx:r_}),o.removeAttribute(k)}else k.startsWith(n1)&&(c.push({type:6,index:a}),o.removeAttribute(k))}}catch(e){m=true;g=e}finally{try{if(!y&&b.return!=null){b.return()}}finally{if(m){throw g}}}if(ra.test(o.tagName)){var q=o.textContent.split(n1),A=q.length-1;if(A>0){o.textContent=nK?nK.emptyScript:"";for(var C=0;C<A;C++)o.append(q[C],n5()),rp.nextNode(),c.push({type:2,index:++a});o.append(q[A],n5())}}}else if(o.nodeType===8)if(o.data===n2)c.push({type:2,index:a});else{var R=-1;for(;(R=o.data.indexOf(n1,R+1))!==-1;)c.push({type:7,index:a}),R+=n1.length-1}a++}}c(e,null,[{key:"createElement",value:function e(e,t){var n=n4.createElement("template");return n.innerHTML=e,n}}]);return e}();function rm(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e,r=arguments.length>3?arguments[3]:void 0;var i,o;if(t===rd)return t;var a=r!==void 0?(i=n._$Co)===null||i===void 0?void 0:i[r]:n._$Cl,s=n6(t)?void 0:t._$litDirective$;var l;return(a===null||a===void 0?void 0:a.constructor)!==s&&(a===null||a===void 0?void 0:(o=a._$AO)===null||o===void 0?void 0:o.call(a,!1),s===void 0?a=void 0:(a=new s(e),a._$AT(e,n,r)),r!==void 0?((l=n._$Co)!==null&&l!==void 0?l:n._$Co=[])[r]=a:n._$Cl=a),a!==void 0&&(t=rm(e,a._$AS(e,t.values),a,r)),t}var rg=/*#__PURE__*/function(){"use strict";function e(t,n){s(this,e);this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=n}c(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,i=r.content,o=n.parts,a=((t=e===null||e===void 0?void 0:e.creationScope)!==null&&t!==void 0?t:n4).importNode(i,!0);rp.currentNode=a;var s=rp.nextNode(),l=0,u=0,c=o[0];for(;c!==void 0;){if(l===c.index){var d=void 0;c.type===2?d=new rb(s,s.nextSibling,this,e):c.type===1?d=new c.ctor(s,c.name,c.strings,this,e):c.type===6&&(d=new rE(s,this,e)),this._$AV.push(d),c=o[++u]}l!==(c===null||c===void 0?void 0:c.index)&&(s=rp.nextNode(),l++)}return rp.currentNode=n4,a}},{key:"p",value:function e(e){var t=0;var n=true,r=false,i=undefined;try{for(var o=this._$AV[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){var s=a.value;s!==void 0&&(s.strings!==void 0?(s._$AI(e,s,t),t+=s.strings.length-2):s._$AI(e[t])),t++}}catch(e){r=true;i=e}finally{try{if(!n&&o.return!=null){o.return()}}finally{if(r){throw i}}}}}]);return e}(),rb=/*#__PURE__*/function(){"use strict";function e(t,n,r,i){s(this,e);var o;this.type=2,this._$AH=rh,this._$AN=void 0,this._$AA=t,this._$AB=n,this._$AM=r,this.options=i,this._$Cv=(o=i===null||i===void 0?void 0:i.isConnected)!==null&&o!==void 0?o:!0}c(e,[{key:"_$AU",get:function e(){var e;var t;return(t=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&t!==void 0?t: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=rm(this,e,t),n6(e)?e===rh||e==null||e===""?(this._$AH!==rh&&this._$AR(),this._$AH=rh):e!==this._$AH&&e!==rd&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):n7(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!==rh&&n6(this._$AH)?this._$AA.nextSibling.data=e:this.T(n4.createTextNode(e)),this._$AH=e}},{key:"$",value:function e(e){var t;var n=e.values,i=e._$litType$,o=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=ry.createElement(r(i.h,i.h[0]),this.options)),i);if(((t=this._$AH)===null||t===void 0?void 0:t._$AD)===o)this._$AH.p(n);else{var a=new rg(o,this),s=a.u(this.options);a.p(n),this.T(s),this._$AH=a}}},{key:"_$AC",value:function e(e){var t=rf.get(e.strings);return t===void 0&&rf.set(e.strings,t=new ry(e)),t}},{key:"k",value:function t(t){n9(this._$AH)||(this._$AH=[],this._$AR());var n=this._$AH,r,i=0;var o=true,a=false,s=undefined;try{for(var l=t[Symbol.iterator](),u;!(o=(u=l.next()).done);o=true){var c=u.value;i===n.length?n.push(r=new e(this.O(n5()),this.O(n5()),this,this.options)):r=n[i],r._$AI(c),i++}}catch(e){a=true;s=e}finally{try{if(!o&&l.return!=null){l.return()}}finally{if(a){throw s}}}i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}},{key:"_$AR",value:function 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 i=e.nextSibling;e.remove(),e=i}}},{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}(),r_=/*#__PURE__*/function(){"use strict";function e(t,n,r,i,o){s(this,e);this.type=1,this._$AH=rh,this._$AN=void 0,this.element=t,this.name=n,this._$AM=i,this.options=o,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=rh}c(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 i=this.strings,o=!1;if(i===void 0)e=rm(this,e,t,0),o=!n6(e)||e!==this._$AH&&e!==rd,o&&(this._$AH=e);else{var a=e,s,l;for(e=i[0],s=0;s<i.length-1;s++)l=rm(this,a[n+s],t,s),l===rd&&(l=this._$AH[s]),o||(o=!n6(l)||l!==this._$AH[s]),l===rh?e=rh:e!==rh&&(e+=(l!==null&&l!==void 0?l:"")+i[s+1]),this._$AH[s]=l}o&&!r&&this.j(e)}},{key:"j",value:function e(e){e===rh?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e!==null&&e!==void 0?e:"")}}]);return e}(),rk=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments),e.type=3;return e}c(t,[{key:"j",value:function e(e){this.element[this.name]=e===rh?void 0:e}}]);return t}(r_),rw=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments),e.type=4;return e}c(t,[{key:"j",value:function e(e){this.element.toggleAttribute(this.name,!!e&&e!==rh)}}]);return t}(r_),rx=/*#__PURE__*/function(e){"use strict";p(t,e);function t(e,n,r,i,o){s(this,t);var l;l=a(this,t,[e,n,r,i,o]),l.type=5;return l}c(t,[{key:"_$AI",value:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this;var n;if((e=(n=rm(this,e,t,0))!==null&&n!==void 0?n:rh)===rd)return;var r=this._$AH,i=e===rh&&r!==rh||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,o=e!==rh&&(r===rh||i);i&&this.element.removeEventListener(this.name,this,r),o&&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((n=(t=this.options)===null||t===void 0?void 0:t.host)!==null&&n!==void 0?n:this.element,e):this._$AH.handleEvent(e)}}]);return t}(r_),rE=/*#__PURE__*/function(){"use strict";function e(t,n,r){s(this,e);this.element=t,this.type=6,this._$AN=void 0,this._$AM=n,this.options=r}c(e,[{key:"_$AU",get:function e(){return this._$AM._$AU}},{key:"_$AI",value:function e(e){rm(this,e)}}]);return e}(),rq={M:n0,P:n1,A:n2,C:1,L:rv,R:rg,D:n7,V:rm,I:rb,H:r_,N:rw,U:rx,B:rk,F:rE},rA=nY.litHtmlPolyfillSupport;var rC;rA===null||rA===void 0?void 0:rA(ry,rb),((rC=nY.litHtmlVersions)!==null&&rC!==void 0?rC:nY.litHtmlVersions=[]).push("3.3.1");var rS=function(e,t,n){var r;var i=(r=n===null||n===void 0?void 0:n.renderBefore)!==null&&r!==void 0?r:t,o=i._$litPart$;if(o===void 0){var a;var s=(a=n===null||n===void 0?void 0:n.renderBefore)!==null&&a!==void 0?a:null;i._$litPart$=o=new rb(t.insertBefore(n5(),s),s,void 0,n!==null&&n!==void 0?n:{})}return o._$AI(e),o};var rR=globalThis,rP=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments),e.renderOptions={host:e},e._$Do=void 0;return e}c(t,[{key:"createRenderRoot",value:function e(){var e;var n=h(f(t.prototype),"createRenderRoot",this).call(this);var r;return(r=(e=this.renderOptions).renderBefore)!==null&&r!==void 0?r:e.renderBefore=n.firstChild,n}},{key:"update",value:function e(e){var n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),h(f(t.prototype),"update",this).call(this,e),this._$Do=rS(n,this.renderRoot,this.renderOptions)}},{key:"connectedCallback",value:function e(){var e;h(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;h(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 rd}}]);return t}(nG);rP._$litElement$=!0,rP.finalized=!0,(tL=rR.litElementHydrateSupport)===null||tL===void 0?void 0:tL.call(rR,{LitElement:rP});var rM=rR.litElementPolyfillSupport;rM===null||rM===void 0?void 0:rM({LitElement:rP});var rT;((rT=rR.litElementVersions)!==null&&rT!==void 0?rT:rR.litElementVersions=[]).push("4.2.1");var rI=function(e){return function(t,n){n!==void 0?n.addInitializer(function(){customElements.define(e,t)}):customElements.define(e,t)}};var rO={attribute:!0,type:String,converter:nQ,reflect:!1,hasChanged:nF},rN=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:rO,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;var r=n.kind,i=n.metadata,o=globalThis.litPropertyMetadata.get(i);if(o===void 0&&globalThis.litPropertyMetadata.set(i,o=new Map),r==="setter"&&((e=Object.create(e)).wrapped=!0),o.set(n.name,e),r==="accessor"){var a=n.name;return{set:function n(n){var r=t.get.call(this);t.set.call(this,n),this.requestUpdate(a,r,e)},init:function t(t){return t!==void 0&&this.C(a,void 0,e,t),t}}}if(r==="setter"){var s=n.name;return function n(n){var r=this[s];t.call(this,n),this.requestUpdate(s,r,e)}}throw Error("Unsupported decorator location: "+r)};var rU=function(e,t,n){return n.configurable=!0,n.enumerable=!0,Reflect.decorate&&(typeof t==="undefined"?"undefined":I(t))!="object"&&Object.defineProperty(e,t,n),n};var rL=Symbol("item");var r$=[{identifier:"completionStatus",cardinality:"single",baseType:"string",value:"unknown",type:"outcome"},{identifier:"numAttempts",cardinality:"single",baseType:"integer",value:"0",type:"response"}];var rD=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e._templateProcessing=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:r$};e._initialContext=x(k({},e._context),{variables:e._context.variables});e._feedbackElements=[];e._interactionElements=[];e._handleRegisterVariable=function(t){t.stopImmediatePropagation(),e._context=x(k({},e._context),{variables:T(e._context.variables).concat([t.detail.variable])}),e._initialContext=e._context,t.stopPropagation()};e._handleRegisterFeedback=function(t){var n;t.stopImmediatePropagation();var r=t.detail;e._feedbackElements.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)};e._handleRegisterInteraction=function(t){t.stopImmediatePropagation(),e._interactionElements.push(t.detail.interactionElement)};e._handleEndAttempt=function(t){t.stopImmediatePropagation();var n=t.detail,r=n.responseIdentifier,i=n.countAttempt;e.validate(),e.updateResponseVariable(r,"true"),e.processResponse(i)};e._handleSetOutcomeValue=function(t){t.stopImmediatePropagation();var n=t.detail,r=n.outcomeIdentifier,i=n.value;e.updateOutcomeVariable(r,i),t.stopPropagation()};e._handleUpdateResponseVariable=function(t){t.stopImmediatePropagation();var n=t.detail,r=n.responseIdentifier,i=n.response;e.updateResponseVariable(r,i),e.dispatchEvent(new CustomEvent("qti-item-context-updated",{bubbles:!0,composed:!0,detail:{itemContext:e._context}}))};return e}c(t,[{key:"title",get:function e(){return this._itemTitle},set:function e(e){this._itemTitle=e,this.removeAttribute("title"),this.setAttribute("data-title",e)}},{key:"assessmentItemRefId",get:function e(){return this._context.identifier},set:function e(e){this._context=x(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=x(k({},this._context),{variables:this._context.variables.map(function(t){var n=e.find(function(e){return e.identifier===t.identifier});return n?x(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"&&t._feedbackElements.forEach(function(t){return t.checkShowFeedback(e.identifier)})})}},{key:"responses",set:function e(e){var t=true,n=false,r=undefined;if(e)try{var i,o=function(){var e=s.value;i.getResponse(e.responseIdentifier)&&i.updateResponseVariable(e.responseIdentifier,e.response);var t=i._interactionElements.find(function(t){return t.getAttribute("response-identifier")===e.responseIdentifier});t&&(t.response=e.response)};for(var a=e[Symbol.iterator](),s;!(t=(s=a.next()).done);t=true)i=this,o()}catch(e){n=true;r=e}finally{try{if(!t&&a.return!=null){a.return()}}finally{if(n){throw r}}}}},{key:"render",value:function e(){return rl(D())}},{key:"connectedCallback",value:function e(){var e=this;this._attachEventListeners(),h(f(t.prototype),"connectedCallback",this).call(this),this.updateComplete.then(function(){e._processTemplates(),e.dispatchEvent(new CustomEvent("qti-assessment-item-connected",{bubbles:!0,composed:!0,detail:e}))})}},{key:"disconnectedCallback",value:function e(){this._removeEventListeners(),h(f(t.prototype),"disconnectedCallback",this).call(this)}},{key:"_attachEventListeners",value:function e(){this.addEventListener("qti-register-variable",this._handleRegisterVariable),this.addEventListener("qti-register-feedback",this._handleRegisterFeedback),this.addEventListener("qti-register-interaction",this._handleRegisterInteraction),this.addEventListener("end-attempt",this._handleEndAttempt),this.addEventListener("qti-set-outcome-value",this._handleSetOutcomeValue),this.addEventListener("qti-interaction-response",this._handleUpdateResponseVariable)}},{key:"_removeEventListeners",value:function e(){this.removeEventListener("qti-register-variable",this._handleRegisterVariable),this.removeEventListener("qti-register-feedback",this._handleRegisterFeedback),this.removeEventListener("qti-register-interaction",this._handleRegisterInteraction),this.removeEventListener("end-attempt",this._handleEndAttempt),this.removeEventListener("qti-set-outcome-value",this._handleSetOutcomeValue),this.removeEventListener("qti-interaction-response",this._handleUpdateResponseVariable)}},{key:"showCorrectResponse",value:function e(e){var t=true,n=false,r=undefined;try{for(var i=this._interactionElements[Symbol.iterator](),o;!(t=(o=i.next()).done);t=true){var a=o.value;a.toggleCorrectResponse(e)}}catch(e){n=true;r=e}finally{try{if(!t&&i.return!=null){i.return()}}finally{if(n){throw r}}}document.querySelectorAll("item-show-correct-response").forEach(function(t){t.shown=e})}},{key:"showCandidateCorrection",value:function e(e){var t=true,n=false,r=undefined;try{for(var i=this._interactionElements[Symbol.iterator](),o;!(t=(o=i.next()).done);t=true){var a=o.value;a.toggleCandidateCorrection(e)}}catch(e){n=true;r=e}finally{try{if(!t&&i.return!=null){i.return()}}finally{if(n){throw r}}}document.querySelectorAll("item-show-candidate-correction").forEach(function(t){t.shown=e})}},{key:"_processTemplates",value:function e(){this._templateProcessing=this.querySelector("qti-template-processing"),this._templateProcessing&&this._templateProcessing.process()}},{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());var r=this.querySelector("qti-response-processing");return!r||!r.process?!1:(r.process(),this.adaptive==="false"&&this.updateOutcomeVariable("completionStatus",this._getCompletionStatus()),this.dispatchEvent(new CustomEvent("qti-item-context-updated",{bubbles:!0,composed:!0,detail:{itemContext:this._context}})),!0)}},{key:"resetResponses",value:function e(){this._context=this._initialContext}},{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:"updateResponseVariable",value:function e(e,t){this._context=x(k({},this._context),{variables:this._context.variables.map(function(n){return n.identifier!==e?n:x(k({},n),{value:t})})}),this.showCandidateCorrection(!1),this.dispatchEvent(new CustomEvent("qti-interaction-changed",{bubbles:!0,composed:!0,detail:{item:this.identifier,responseIdentifier:e,response:Array.isArray(t)?T(t):t}})),this.adaptive==="false"&&this.updateOutcomeVariable("completionStatus",this._getCompletionStatus())}},{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=x(k({},this._context),{variables:this._context.variables.map(function(n){return n.identifier!==e?n:x(k({},n),{value:r.cardinality==="single"||Array.isArray(t)?t:[t]})})}),this._feedbackElements.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](),i;!(e=(i=r.next()).done);e=true){var o=i.value;o.reportValidity()}}catch(e){t=true;n=e}finally{try{if(!e&&r.return!=null){r.return()}}finally{if(t){throw n}}}}},{key:"_getCompletionStatus",value:function e(){var e=this.validate(!1);return e===!0?"completed":e===!1?"incomplete":"not_attempted"}}]);return t}(rP);tz([i({type:String})],rD.prototype,"identifier",2),tz([i({type:String})],rD.prototype,"adaptive",2),tz([i({type:String})],rD.prototype,"timeDependent",2),tz([i({type:String})],rD.prototype,"title",1),tz([i({type:Boolean})],rD.prototype,"disabled",2),tz([g("disabled",{waitUntilFirstUpdate:!0})],rD.prototype,"_handleDisabledChange",2),tz([i({type:Boolean})],rD.prototype,"readonly",2),tz([g("readonly",{waitUntilFirstUpdate:!0})],rD.prototype,"_handleReadonlyChange",2),tz([e({context:rL})],rD.prototype,"_context",2),rD=tz([rI("qti-assessment-item")],rD);var rV=String.raw,rj=rV(V());var rH=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;var t,n="",r={load:function i(i){n=i;var o=encodeURI(i);if(e&&sessionStorage.getItem(o))return{promise:Promise.resolve(r.parse(sessionStorage.getItem(o))),request:null};var a=E(i),s=a.promise,l=a.xhr;return{promise:new Promise(function(n){s.then(function(i){return t=i,r.shuffleInteractions(),e&&sessionStorage.setItem(o,new XMLSerializer().serializeToString(t)),n(r)})}),request:l}},parse:function e(e){return t=q(e),r},path:function(e){return R(t,e),n=null,r},fn:function e(e){return e(t),r},pciHooks:function e(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 r=t.getAttribute(n);!r.startsWith("data:")&&!r.startsWith("http")&&(t.setAttribute("base-url",e),t.setAttribute("module",i+"/"+encodeURI(r+(r.endsWith(".js")?"":".js"))))})};for(var u=n[Symbol.iterator](),c;!(o=(c=u.next()).done);o=true)l()}catch(e){a=true;s=e}finally{try{if(!o&&u.return!=null){u.return()}}finally{if(a){throw s}}}return r},configurePci:function e(e,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"qti-portable-custom-interaction";return o(function(){var o,a,s,l,u,c,d,h,f,p,v,y,m,g,b,_,k,w,x,E,q,A,C,S,R,P,M,T,I,O,N,U,$;return L(this,function(P){switch(P.label){case 0:o=[],a=t.querySelectorAll(i);return[4,n(e,"/modules/module_resolution.js")];case 1:s=P.sent();return[4,n(e,"/modules/fallback_module_resolution.js")];case 2:l=P.sent();u=true,c=false,d=undefined;if(!(a.length>0))return[3,14];P.label=3;case 3:P.trys.push([3,12,13,14]);h=Array.from(a)[Symbol.iterator]();P.label=4;case 4:if(!!(u=(f=h.next()).done))return[3,11];p=f.value;p.setAttribute("data-base-url",e);v=p.getAttribute("custom-interaction-type-identifier");v&&o.includes(v)&&(v=v+o.length,p.setAttribute("custom-interaction-type-identifier",v),o.push(v)),v&&o.push(v);y=p.querySelector("qti-interaction-modules");if(!(y&&y.getAttribute("primary-configuration")))return[3,9];m=y.getAttribute("primary-configuration");if(!m)return[3,8];P.label=5;case 5:P.trys.push([5,7,,8]);return[4,n(e,"/".concat(m))];case 6:g=P.sent(),b=Array.from(y.querySelectorAll("qti-interaction-module"));_=true,k=false,w=undefined;try{for(x=b[Symbol.iterator]();!(_=(E=x.next()).done);_=true){q=E.value;A=q.getAttribute("id");if(A&&g.paths&&g.paths[A]){C=g.paths[A],S=Array.isArray(C)?C[0]:C;if(q.setAttribute("primary-path",S),l&&l.paths&&l.paths[A]){R=l.paths[A];Array.isArray(R)?q.setAttribute("fallback-path",R[0]):q.setAttribute("fallback-path",R)}}}}catch(e){k=true;w=e}finally{try{if(!_&&x.return!=null){x.return()}}finally{if(k){throw w}}}if(g.paths){for(var U in g.paths)if(!y.querySelector('qti-interaction-module[id="'.concat(U,'"]'))){M=t.createElement("qti-interaction-module");M.setAttribute("id",U);T=Array.isArray(g.paths[U])?g.paths[U][0]:g.paths[U];if(M.setAttribute("primary-path",T),l&&l.paths&&l.paths[U]){I=l.paths[U];Array.isArray(I)?M.setAttribute("fallback-path",I[0]):M.setAttribute("fallback-path",I)}y.appendChild(M)}}g.urlArgs&&y.setAttribute("url-args",g.urlArgs);return[3,8];case 7:O=P.sent();console.warn("Failed to load primary configuration: ".concat(m),O);return[3,8];case 8:return[3,10];case 9:if(s){N=function(e){var n=s.paths[e],r="";l&&l.paths&&l.paths[e]&&(r=l.paths[e]);var i=Array.isArray(n)?n:[n],o=Array.isArray(r)?r:[r],a=i.map(function(e,t){var n=o.length>t?o[t]:"";return{primaryPath:e,fallbackPath:n}});var u=true,c=false,d=undefined;try{var h=function(){var e=p.value;a.some(function(t){return t.fallbackPath===e})||a.push({primaryPath:i.length>0?i[0]:e,fallbackPath:e})};for(var f=o[Symbol.iterator](),p;!(u=(p=f.next()).done);u=true)h()}catch(e){c=true;d=e}finally{try{if(!u&&f.return!=null){f.return()}}finally{if(c){throw d}}}var v=true,m=false,g=undefined;try{for(var b=a[Symbol.iterator](),_;!(v=(_=b.next()).done);v=true){var k=_.value;var w=t.createElement("qti-interaction-module");k.fallbackPath&&w.setAttribute("fallback-path",k.fallbackPath),w.setAttribute("id",e),w.setAttribute("primary-path",k.primaryPath),y&&y.appendChild(w)}}catch(e){m=true;g=e}finally{try{if(!v&&b.return!=null){b.return()}}finally{if(m){throw g}}}};p.querySelector("qti-interaction-modules")===null?(y=t.createElement("qti-interaction-modules"),p.appendChild(y)):y=p.querySelector("qti-interaction-modules");for(var L in s.paths)N(L)}P.label=10;case 10:u=true;return[3,4];case 11:return[3,14];case 12:$=P.sent();c=true;d=$;return[3,14];case 13:try{if(!u&&h.return!=null){h.return()}}finally{if(c){throw d}}return[7];case 14:return[2,r]}})})()},shuffleInteractions:function e(){var e=t.querySelectorAll('[shuffle="true"]'),n=Array.from(e).filter(function(e){var t;return(t=e.tagName)===null||t===void 0?void 0:t.toLowerCase().endsWith("-interaction")});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(u.tagName.toLowerCase()),d=Array.isArray(c)?c:[c];var h=true,f=false,p=undefined;try{var v=function(){var e=m.value;var t;var n=Array.from(u.querySelectorAll(e)),i=n.map(function(e,t){return{element:e,fixed:e.hasAttribute("fixed")&&e.getAttribute("fixed")==="true",originalOrder:t}}).filter(function(e){return e.fixed}),o=n.filter(function(e){return!e.hasAttribute("fixed")||e.getAttribute("fixed")!=="true"});if(o.length<=1)return{v:(console.warn("Shuffling is not possible with fewer than 2 non-fixed elements."),r)};var a=T(o),s=!1,l=0;for(;!s&&l<20;){l++;for(var c=o.length-1;c>0;c--){var d=Math.floor(Math.random()*(c+1));var h;h=[o[d],o[c]],o[c]=h[0],o[d]=h[1],h}s=!o.every(function(e,t){return e===a[t]})}if(!s)return{v:(console.warn("Failed to shuffle the choices after multiple attempts."),null)};u.removeAttribute("shuffle");var f=0;var p=true,v=false,y=undefined;try{for(var g=o[Symbol.iterator](),b;!(p=(b=g.next()).done);p=true){var _=b.value;_.parentElement.insertBefore(_,(t=i[f])===null||t===void 0?void 0:t.element),f++}}catch(e){v=true;y=e}finally{try{if(!p&&g.return!=null){g.return()}}finally{if(v){throw y}}}var k=true,w=false,x=undefined;try{for(var E=i[Symbol.iterator](),q;!(k=(q=E.next()).done);k=true){var A=q.value;A.element.parentElement.insertBefore(A.element,o[A.originalOrder])}}catch(e){w=true;x=e}finally{try{if(!k&&E.return!=null){E.return()}}finally{if(w){throw x}}}};for(var y=d[Symbol.iterator](),m;!(h=(m=y.next()).done);h=true){var g=v();if(I(g)==="object")return g.v}}catch(e){f=true;p=e}finally{try{if(!h&&y.return!=null){y.return()}}finally{if(f){throw p}}}}}catch(e){o=true;a=e}finally{try{if(!i&&s.return!=null){s.return()}}finally{if(o){throw a}}}return r},extendElementName:function(e,n){return b(t,e,n),r},extendElementsWithClass:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"extend";return _(t,e),r},customInteraction:function e(e,n){var i=t.querySelector("qti-custom-interaction"),o=i.querySelector("object");return i.setAttribute("data-base-ref",e),i.setAttribute("data-base-item",e+n),i.setAttribute("data",o.getAttribute("data")),i.setAttribute("width",o.getAttribute("width")),i.setAttribute("height",o.getAttribute("height")),i.removeChild(o),r},convertCDATAtoComment:function e(){return P(t),r},stripStyleSheets:function e(){return O(t),r},html:function e(){return n!==null&&R(t,n.substring(0,n.lastIndexOf("/"))),new XMLSerializer().serializeToString(C(t))},xml:function e(){return new XMLSerializer().serializeToString(t)},htmlDoc:function e(){return n!==null&&R(t,n.substring(0,n.lastIndexOf("/"))),C(t)},xmlDoc:function e(){return t}};return r};var rQ=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e.identifier="";e.href="";return e}c(t,[{key:"connectedCallback",value:function e(){var e=this;var n=this,r=function(){return h(f(t.prototype),"connectedCallback",e)};return o(function(){var e,t,i;return L(this,function(o){switch(o.label){case 0:r().call(n);e=new Event("qti-assessment-stimulus-ref-connected",{cancelable:!0,bubbles:!0,composed:!0});if(!this.dispatchEvent(e))return[3,4];t=this.closest("qti-assessment-item").querySelector("[data-stimulus-idref=".concat(this.identifier,"]"));if(!t)return[3,2];return[4,this.updateStimulusRef(t)];case 1:i=o.sent();return[3,3];case 2:i=console.warn("Stimulus with data-stimulus-idref ".concat(this.identifier," not found"));o.label=3;case 3:i;o.label=4;case 4:return[2]}})}).call(this)}},{key:"updateStimulusRef",value:function e(e){return o(function(){var t,n,r;return L(this,function(i){switch(i.label){case 0:return[4,rH().load(this.href).promise.then(function(e){return e.htmlDoc()})];case 1:t=i.sent();if(t){;r=t.querySelectorAll("qti-stimulus-body, qti-stylesheet");e.innerHTML="",(n=e).append.apply(n,T(r))}return[2]}})}).call(this)}}]);return t}(rP);tz([i({type:String})],rQ.prototype,"identifier",2),tz([i({type:String})],rQ.prototype,"href",2),rQ=tz([rI("qti-assessment-stimulus-ref")],rQ);var rF=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}return t}(rP);rF=tz([rI("qti-companion-materials-info")],rF);var rz=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"render",value:function e(){return rl(j(),this.handleSlotChange)}},{key:"handleSlotChange",value:function e(){var e;var t;var n=Array.from((t=(e=this.firstElementChild)===null||e===void 0?void 0:e.childNodes)!==null&&t!==void 0?t:[]).find(function(e){return e.nodeType===Node.COMMENT_NODE});try{var r;this.operatorFunction=new Function("context","fn","item",(r=n===null||n===void 0?void 0:n.textContent)!==null&&r!==void 0?r:"")}catch(e){console.error("custom-operator contains invalid javascript code",e)}}},{key:"calculate",value:function e(){var e=this;var t={variable:function(t){var n,r;var i;return(i=(r=e._context)===null||r===void 0?void 0:(n=r.variables.find(function(e){return e.identifier===t}))===null||n===void 0?void 0:n.value)!==null&&i!==void 0?i:""},correct:function(t){var n,r;var i;return(i=(r=e._context)===null||r===void 0?void 0:(n=r.variables.find(function(e){return e.identifier===t}))===null||n===void 0?void 0:n.correctResponse)!==null&&i!==void 0?i:""}},n={getVariable:function(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,n){e.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:t,value:n}}))},updateResponseVariable:function(t,n){e.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:t,response:n}}))}};return this.operatorFunction(this._context,t,n)}}]);return t}(rP);tz([t({context:rL,subscribe:!0}),l()],rz.prototype,"_context",2),rz=tz([rI("qti-custom-operator")],rz);var rB=function(){return new Intl.NumberFormat().format(.1).replace(/\d/g,"")},rW=function(e){if(typeof e=="string")return e;var t=rB();return t==="."?e.toLocaleString():e.toString().replace(".","").replace(t,".")};var rJ=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"connectedCallback",value:function e(){h(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=!tR(this.identifier)&&!tR(t===null||t===void 0?void 0:t.value)&&this.identifier===t.value||!1,this.showFeedback(n)}},{key:"showFeedback",value:function e(e){this.showStatus=e&&this.showHide==="show"||!e&&this.showHide==="hide"?"on":"off"}}]);return t}(rP);tz([i({type:String,attribute:"show-hide"})],rJ.prototype,"showHide",2),tz([i({type:String,attribute:"outcome-identifier"})],rJ.prototype,"outcomeIdentifier",2),tz([i({type:String})],rJ.prototype,"identifier",2),tz([i({type:String,attribute:!1})],rJ.prototype,"showStatus",2),tz([t({context:rL,subscribe:!0}),l()],rJ.prototype,"_context",2);var rG=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"render",value:function e(){return rl(H(),this.showStatus)}},{key:"connectedCallback",value:function e(){h(f(t.prototype),"connectedCallback",this).call(this),this.checkShowFeedback(this.outcomeIdentifier)}}]);return t}(rJ);rG.styles=nS(Q()),rG=tz([rI("qti-feedback-block")],rG);var rX=function(e){return e!==null&&e!==void 0?e:rh};var rY=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e.render=function(){return rl(F(),rX(e.showStatus))};return e}c(t,[{key:"connectedCallback",value:function e(){h(f(t.prototype),"connectedCallback",this).call(this),this.checkShowFeedback(this.outcomeIdentifier)}}]);return t}(rJ);rY.styles=nS(z()),rY=tz([rI("qti-feedback-inline")],rY);var rK=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"render",value:function e(){return rl(B(),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(){h(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}(rJ);rK.styles=nS(W()),rK=tz([rI("qti-modal-feedback")],rK);var rZ=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"connectedCallback",value:function e(){h(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 rl(J())}}]);return t}(rP);rZ.styles=nS(G()),rZ=tz([rI("qti-associable-hotspot")],rZ);var r0=function(e,t,n){var r=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}return t}(e);return r};var r1=function(e,t,n,r){var l=/*#__PURE__*/function(e){"use strict";p(i,e);function i(){s(this,i);var e;e=a(this,i,arguments);e.observer=null;e.droppableObsever=null;e.resizeObserver=null;e.draggables=[];e.droppables=[];e.dragContainers=[];e.dragClone=null;e.dragSource=null;e.touchStartPoint=null;e.isDraggable=!1;e.cloneOffset={x:0,y:0};e.isDragging=!1;e.allDropzones=[];e.lastTarget=null;e.currentDropTarget=null;e.MIN_DRAG_DISTANCE=5;e.DRAG_CLONE_OPACITY=1;e.dataTransfer={data:{},setData:function e(e,t){this.data[e]=t},getData:function e(e){return this.data[e]},effectAllowed:"move"};e.configuration={copyStylesDragClone:!0,dragCanBePlacedBack:!0,dragOnClick:!1};e.minAssociations=1;e.maxAssociations=0;e.draggablesModified=function(t,n){if(e.isMatchTabular())return;var r=true,i=false,o=undefined;try{var a=function(){var t=l.value;e.draggables.includes(t)&&(e.draggables=e.draggables.filter(function(e){return e!==t}),t.removeAttribute("tabindex"),t.removeEventListener("touchstart",e.handleTouchStart.bind(e)),t.removeEventListener("mousedown",e.handleTouchStart.bind(e)))};for(var s=n[Symbol.iterator](),l;!(r=(l=s.next()).done);r=true)a()}catch(e){i=true;o=e}finally{try{if(!r&&s.return!=null){s.return()}}finally{if(i){throw o}}}var u=true,c=false,d=undefined;try{for(var h=t[Symbol.iterator](),f;!(u=(f=h.next()).done);u=true){var p=f.value;e.draggables.includes(p)||(e.draggables.push(p),p.setAttribute("tabindex","0"),p.hasTouchStartListener||(p.addEventListener("touchstart",e.handleTouchStart.bind(e),{passive:!1}),p.addEventListener("mousedown",e.handleTouchStart.bind(e),{passive:!1}),p.hasTouchStartListener=!0))}}catch(e){c=true;d=e}finally{try{if(!u&&h.return!=null){h.return()}}finally{if(c){throw d}}}var v=0;e.draggables.forEach(function(t){t.style.viewTransitionName="drag-".concat(v,"-").concat(e.getAttribute("identifier")||crypto.randomUUID()),t.setAttribute("qti-draggable","true"),v++})};e.droppablesModified=function(t,n){if(!e.isMatchTabular()){var r=true,i=false,o=undefined;try{var a=function(){var t=l.value;e.droppables.includes(t)&&(e.droppables=e.droppables.filter(function(e){return e!==t}),e.allDropzones=e.allDropzones.filter(function(e){return e!==t}))};for(var s=n[Symbol.iterator](),l;!(r=(l=s.next()).done);r=true)a()}catch(e){i=true;o=e}finally{try{if(!r&&s.return!=null){s.return()}}finally{if(i){throw o}}}var u=true,c=false,d=undefined;try{for(var h=t[Symbol.iterator](),f;!(u=(f=h.next()).done);u=true){var p=f.value;e.droppables.includes(p)||(e.droppables.push(p),e.allDropzones.push(p))}}catch(e){c=true;d=e}finally{try{if(!u&&h.return!=null){h.return()}}finally{if(c){throw d}}}var v=true,y=false,m=undefined;try{for(var g=e.droppables[Symbol.iterator](),b;!(v=(b=g.next()).done);v=true){var _=b.value;e.dataset.choicesContainerWidth&&(_.style.width="".concat(e.dataset.choicesContainerWidth,"px"),_.style.boxSizing="border-box")}}catch(e){y=true;m=e}finally{try{if(!v&&g.return!=null){g.return()}}finally{if(y){throw m}}}}};return e}c(i,[{key:"handleDraggableContainerChange",value:function e(e,t){this.isMatchTabular()||(e.length>0||t.length>0)&&this.dragContainersModified(e||[],t||[])}},{key:"dragContainersModified",value:function e(e,t){var n=true,r=false,i=undefined;try{var o,a=function(){var e=l.value;o.dragContainers.includes(e)&&(o.dragContainers=o.dragContainers.filter(function(t){return t!==e}),o.allDropzones=o.allDropzones.filter(function(t){return t!==e}))};for(var s=t[Symbol.iterator](),l;!(n=(l=s.next()).done);n=true)o=this,a()}catch(e){r=true;i=e}finally{try{if(!n&&s.return!=null){s.return()}}finally{if(r){throw i}}}var u=true,c=false,d=undefined;try{for(var h=e[Symbol.iterator](),f;!(u=(f=h.next()).done);u=true){var p=f.value;this.dragContainers.includes(p)||(this.dragContainers.push(p),this.allDropzones.push(p))}}catch(e){c=true;d=e}finally{try{if(!u&&h.return!=null){h.return()}}finally{if(c){throw d}}}}},{key:"handleDraggablesChange",value:function e(e,t){this.isMatchTabular()||(e.length>0||t.length>0)&&this.draggablesModified(e||[],t||[])}},{key:"handleDroppablesChange",value:function e(e,t){this.isMatchTabular()||(e.length>0||t.length>0)&&this.droppablesModified(e||[],t||[])}},{key:"firstUpdated",value:function e(e){var o=this;var a,s,l;if(h(f(i.prototype),"firstUpdated",this).call(this,e),this.isMatchTabular())return;this.hasAttribute("disabled")||(document.addEventListener("touchmove",this.handleTouchMove.bind(this),{passive:!1}),document.addEventListener("mousemove",this.handleTouchMove.bind(this),{passive:!1}),document.addEventListener("touchend",this.handleTouchEnd.bind(this),{passive:!1}),document.addEventListener("mouseup",this.handleTouchEnd.bind(this),{passive:!1}),document.addEventListener("touchcancel",this.handleTouchCancel.bind(this),{passive:!1}));var u=Array.from(this.querySelectorAll(t)||[]).concat(Array.from(((a=this.shadowRoot)===null||a===void 0?void 0:a.querySelectorAll(t))||[])),c=Array.from(this.querySelectorAll(n)||[]).concat(Array.from(((s=this.shadowRoot)===null||s===void 0?void 0:s.querySelectorAll(n))||[])),d=Array.from(this.querySelectorAll(r)||[]).concat(Array.from(((l=this.shadowRoot)===null||l===void 0?void 0:l.querySelectorAll(r))||[]));this.dragContainersModified(d,[]),this.droppablesModified(c,[]),this.draggablesModified(u,[]),this.updateMinDimensionsForDropZones(),this.observer=new MutationObserver(function(){return o.updateMinDimensionsForDropZones()}),this.observer.observe(this,{childList:!0,subtree:!0}),this.resizeObserver=new ResizeObserver(function(){return o.updateMinDimensionsForDropZones()}),this.querySelectorAll("qti-gap-text").forEach(function(e){var t;return(t=o.resizeObserver)===null||t===void 0?void 0:t.observe(e)})}},{key:"moveDraggableToDroppable",value:function e(e,t){return o(function(){var n;return L(this,function(r){n=this;if(this.isMatchTabular())return[2];(function(){e.style.transform="translate(0, 0)",t.tagName==="SLOT"?e.setAttribute("slot",t.getAttribute("name")):t.appendChild(e),n.checkAllMaxAssociations(),n.saveResponse()})();return[2]})}).call(this)}},{key:"activateDroppable",value:function e(e){this.dragContainers.includes(e)?(this._internals.states.add("--dragzone-active"),e.setAttribute("active","")):(this._internals.states.delete("--dragzone-active"),e.setAttribute("active",""))}},{key:"deactivateDroppable",value:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;t&&this._internals.states.add("--dragzone-active"),e.removeAttribute("active")}},{key:"connectedCallback",value:function e(){h(f(i.prototype),"connectedCallback",this).call(this)}},{key:"isMatchTabular",value:function e(){return this.classList.contains("qti-match-tabular")}},{key:"updateMinDimensionsForDropZones",value:function e(){return o(function(){var e,i,o,a,s,l,u,c,d,h,f,p,v,y,m,g;return L(this,function(b){switch(b.label){case 0:return[4,this.updateComplete];case 1:if(b.sent(),this.isMatchTabular())return[2];o=this.querySelectorAll(t),a=Array.from(this.querySelectorAll(n)).map(function(e){return e}),s=0,l=0;o.forEach(function(e){var t=e.getBoundingClientRect();s=Math.max(s,t.height),l=Math.max(l,t.width)});u=this.querySelector(r)||((e=this.shadowRoot)===null||e===void 0?void 0:e.querySelector(r)),c=(i=a[0])===null||i===void 0?void 0:i.parentElement;c&&(c.style.gridTemplateColumns="repeat(auto-fit, minmax(calc(".concat(l,"px + 2 * var(--qti-dropzone-padding)), 1fr))")),u&&(u.style.minHeight="".concat(s,"px"),u.style.minWidth="".concat(l,"px"));d=true,h=false,f=undefined;try{for(p=a[Symbol.iterator]();!(d=(v=p.next()).done);d=true){y=v.value;y.style.minHeight="".concat(s,"px"),y.style.minWidth="".concat(l,"px");g=(m=y.shadowRoot)===null||m===void 0?void 0:m.querySelector('slot[part="dropslot"]');g&&(g.style.minHeight="".concat(s,"px"),g.style.minWidth="".concat(l,"px"))}}catch(e){h=true;f=e}finally{try{if(!d&&p.return!=null){p.return()}}finally{if(h){throw f}}}return[2]}})}).call(this)}},{key:"activateDroppables",value:function e(e){if(this.isMatchTabular())return;this.dragContainers.forEach(function(t){t.setAttribute("enabled",""),t.hasAttribute("disabled")&&(t.contains(e)||t.shadowRoot&&t.shadowRoot.contains(e))&&t.removeAttribute("disabled")}),this.droppables.forEach(function(t){t.setAttribute("enabled",""),t.hasAttribute("disabled")&&(t.contains(e)||t.shadowRoot&&t.shadowRoot.contains(e))&&t.removeAttribute("disabled")})}},{key:"activateDragLocation",value:function e(){this._internals.states.add("--dragzone-enabled")}},{key:"deactivateDragLocation",value:function e(){this._internals.states.delete("--dragzone-enabled")}},{key:"deactivateDroppables",value:function e(){this.dragContainers.forEach(function(e){e.removeAttribute("enabled"),e.removeAttribute("active")}),this.droppables.forEach(function(e){e.removeAttribute("enabled"),e.removeAttribute("active")})}},{key:"disconnectedCallback",value:function e(){h(f(i.prototype),"disconnectedCallback",this).call(this),this.observer&&(this.observer.disconnect(),this.observer=null),this.droppableObsever&&(this.droppableObsever.disconnect(),this.droppableObsever=null),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),document.removeEventListener("touchmove",this.handleTouchMove),document.removeEventListener("mousemove",this.handleTouchMove),document.removeEventListener("touchend",this.handleTouchEnd),document.removeEventListener("mouseup",this.handleTouchEnd),document.removeEventListener("touchcancel",this.handleTouchCancel)}},{key:"handleTouchMove",value:function e(e){if(!this.isMatchTabular()&&this.isDraggable&&this.dragClone){var t=this.getEventCoordinates(e),n=t.x,r=t.y,i={clientX:n,clientY:r};this.calculateDragDistance(i)>=this.MIN_DRAG_DISTANCE&&(this.isDragging=!0,this.updateDragClonePosition(i));var o=this.findClosestDropzone();this.currentDropTarget=o,o!==this.lastTarget&&(this.lastTarget&&(this.deactivateDroppable(this.lastTarget),this.dispatchCustomEvent(this.lastTarget,"dragleave")),o&&(this.activateDroppable(o),this.dispatchCustomEvent(o,"dragenter")),this.lastTarget=o),this.currentDropTarget&&this.dispatchCustomEvent(this.currentDropTarget,"dragover"),e.preventDefault()}}},{key:"handleTouchEnd",value:function e(e){this.isMatchTabular()||(this.isDragging&&this.resetDragState(),this._internals.states.delete("--dragzone-active"),this.checkAllMaxAssociations(),this._internals.states.delete("--dragzone-enabled"),this._internals.states.delete("--dragzone-active"),this.deactivateDragLocation(),this.deactivateDroppables(),this.draggables.forEach(function(e){e.removeAttribute("dragging")}),e.preventDefault())}},{key:"handleTouchCancel",value:function e(e){this.resetDragState()}},{key:"validate",value:function e(){if(this.isMatchTabular())return;if(!this.shadowRoot)return!1;var e=this.getValidAssociations(),t=!0,n="";this.maxAssociations>0&&e>this.maxAssociations?(t=!1,n=this.dataset.maxSelectionsMessage||"You've selected too many associations. Maximum allowed is ".concat(this.maxAssociations,".")):this.minAssociations>0&&e<this.minAssociations&&(t=!1,n=this.dataset.minSelectionsMessage||"You haven't selected enough associations. Minimum required is ".concat(this.minAssociations,"."));var r=this.lastElementChild;return this._internals.setValidity(t?{}:{customError:!0},n,r),t}},{key:"reportValidity",value:function e(){var e=this.shadowRoot.querySelector("#validation-message");return e&&(this._internals.validity.valid?(e.textContent="",e.style.display="none"):(e.textContent=this._internals.validationMessage,e.style.setProperty("display","block","important"))),this._internals.validity.valid}},{key:"checkMaxAssociations",value:function e(e){var t=this.getMatchMaxValue(e),n=e.querySelectorAll('[qti-draggable="true"]').length;return!(t===0)&&n>=t}},{key:"dropDraggableInDroppable",value:function e(e,t){var n=e.cloneNode(!0);n.removeAttribute("style"),this.moveDraggableToDroppable(n,t),this.draggablesModified([n],[]);var r=this.getMatchMaxValue(e),i=this.draggables.filter(function(t){return t.getAttribute("identifier")===e.getAttribute("identifier")});r!==0&&i.length>=r?(e.style.opacity="0.0",e.style.pointerEvents="none"):e.style.opacity="1.0"}},{key:"resetDragState",value:function e(){if(this.dragClone){var e=this.currentDropTarget!==null,t=!e||this.dragContainers.includes(this.currentDropTarget);e&&this.currentDropTarget&&!t&&this.dropDraggableInDroppable(this.dragSource,this.currentDropTarget),t&&(this.dragSource.style.opacity="1.0",this.dragSource.style.display="block",this.dragSource.style.position="static",this.dragSource.style.pointerEvents="auto",this.saveResponse()),this.dragClone.remove(),this.draggablesModified([],[this.dragClone])}this.isDragging=!1,this.isDraggable=!1,this.dragSource=null,this.dragClone=null,this.touchStartPoint=null,this.currentDropTarget=null,this.lastTarget=null,this.deactivateDroppables()}},{key:"checkAllMaxAssociations",value:function e(){var e=this;var t=this.getValidAssociations(),n=this.maxAssociations!==0&&t>=this.maxAssociations;this.droppables.forEach(function(t){n?e.disableDroppable(t):e.checkMaxAssociations(t)?e.disableDroppable(t):e.enableDroppable(t)})}},{key:"getMatchMaxValue",value:function e(e){var t=e.getAttribute("match-max");return t?parseInt(t,10):1}},{key:"disableDroppable",value:function e(e){e.setAttribute("disabled","")}},{key:"enableDroppable",value:function e(e){e.removeAttribute("disabled")}},{key:"response",get:function e(){var e;return typeof this.getResponse=="function"?e=this.getResponse():e=this.collectResponseData(),e.join(",")},set:function e(e){var t=this;if(!this.isMatchTabular())if(typeof this.getValue=="function"&&(e=this.getValue(e)),Array.isArray(e)){this.reset(!1),e===null||e===void 0?void 0:e.forEach(function(e){return t.placeResponse(e)});var n=new FormData;e.forEach(function(e){n.append(t.responseIdentifier,e)}),this._internals.setFormValue(n)}else this._internals.setFormValue(e||"")}},{key:"placeResponse",value:function e(e){var t=this;var n=M(e.split(" ").reverse()),r=n[0],i=n.slice(1),o=Array.from(this.draggables),a=Array.from(this.droppables);i.forEach(function(e){if(e==="")return;var n=o.find(function(t){return t.getAttribute("identifier")===e}),i=a.find(function(e){return e.getAttribute("identifier")===r});t.dropDraggableInDroppable(n,i)})}},{key:"getValidAssociations",value:function e(){var e=0;var t=true,n=false,r=undefined;try{for(var i=this.droppables[Symbol.iterator](),o;!(t=(o=i.next()).done);t=true){var a=o.value;e=e+this.getDraggablesFromDroppable(a).length}}catch(e){n=true;r=e}finally{try{if(!t&&i.return!=null){i.return()}}finally{if(n){throw r}}}return e}},{key:"saveResponse",value:function e(){var e;typeof this.getResponse=="function"?e=this.getResponse():e=this.collectResponseData(),this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:this.responseIdentifier,response:e}}))}},{key:"collectResponseData",value:function e(){var e=this;return this.droppables.map(function(t){var n=e.getDraggablesFromDroppable(t).map(function(e){return e.getAttribute("identifier")}),r=t.getAttribute("identifier");return n.map(function(e){return"".concat(e," ").concat(r)})}).flat()}},{key:"getDraggablesFromDroppable",value:function e(e){return this.draggables.map(function(e){return e.getAttribute("identifier")}).filter(function(e,t,n){return n.indexOf(e)===t}).flatMap(function(t){return Array.from(e.querySelectorAll("[identifier='".concat(t,"']")))}).filter(function(e){return!!e}).map(function(e){return e})}},{key:"reset",value:function e(){var e=this;var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.droppables.forEach(function(t){e.getDraggablesFromDroppable(t).forEach(function(t){t.remove(),e.draggablesModified([],[t])})}),this.dragContainers.forEach(function(e){Array.from(e.querySelectorAll('[qti-draggable="true"]')).forEach(function(e){e.style.opacity="1.0"})}),this.dragClone=null,this.dragSource=null,this.isDragging=!1,this.isDraggable=!1,this.currentDropTarget=null,this.lastTarget=null,t&&this.saveResponse()}},{key:"updateDragClonePosition",value:function e(e){if(!this.isDragging||!this.dragClone)return;var t=e.clientX-this.cloneOffset.x,n=e.clientY-this.cloneOffset.y,r=this.applyInteractionBoundaries(t,n,this.dragClone),i=r.newLeft,o=r.newTop;this.dragClone.style.left="".concat(i,"px"),this.dragClone.style.top="".concat(o,"px")}},{key:"applyInteractionBoundaries",value:function e(e,t,n){var r=this.getBoundingClientRect(),i=n.getBoundingClientRect(),o=i.width,a=i.height,s=Math.max(r.left,Math.min(e,r.right-o)),l=Math.max(r.top,Math.min(t,r.bottom-a));return{newLeft:s,newTop:l}}},{key:"getEventCoordinates",value:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;var n=e.touches?e.touches[0]:e;return{x:t?n.pageX:n.clientX,y:t?n.pageY:n.clientY}}},{key:"calculateDragDistance",value:function e(e){var t=Math.abs(e.clientX-this.touchStartPoint.x),n=Math.abs(e.clientY-this.touchStartPoint.y);return t+n}},{key:"findClosestDropzone",value:function e(){var e=this.allDropzones.filter(function(e){return!e.hasAttribute("disabled")});if(!this.dragClone||e.length===0)return null;var t=this.dragClone.getBoundingClientRect(),n=null,r=0;var i=true,o=false,a=undefined;try{for(var s=e[Symbol.iterator](),l;!(i=(l=s.next()).done);i=true){var u=l.value;var c=u.getBoundingClientRect(),d=this.calculateOverlapArea(t,c);d>r&&(r=d,n=u)}}catch(e){o=true;a=e}finally{try{if(!i&&s.return!=null){s.return()}}finally{if(o){throw a}}}if(!n){var h=200;var f=true,p=false,v=undefined;try{for(var y=e[Symbol.iterator](),m;!(f=(m=y.next()).done);f=true){var g=m.value;var b=g.getBoundingClientRect(),_=Math.sqrt(Math.pow(t.left-b.left,2)+Math.pow(t.top-b.top,2));_<h&&(h=_,n=g)}}catch(e){p=true;v=e}finally{try{if(!f&&y.return!=null){y.return()}}finally{if(p){throw v}}}}return n}},{key:"calculateOverlapArea",value:function e(e,t){var n=Math.max(0,Math.min(e.right,t.right)-Math.max(e.left,t.left)),r=Math.max(0,Math.min(e.bottom,t.bottom)-Math.max(e.top,t.top));return n*r}},{key:"dispatchCustomEvent",value:function e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e)return;var r=new CustomEvent(t,{bubbles:n,cancelable:!0});r.dataTransfer=this.dataTransfer,e.dispatchEvent(r)}},{key:"appendClone",value:function e(){document.body.appendChild(this.dragClone)}},{key:"handleTouchStart",value:function e(e){var t=this;if(this.isMatchTabular()||v(e,MouseEvent)&&e.button!==0||this.isDragging)return;var n=this.getEventCoordinates(e),r=n.x,i=n.y;this.touchStartPoint={x:r,y:i},this.dragSource=e.currentTarget,this.isDraggable=!0,this._internals.states.add("--dragzone-enabled"),this._internals.states.add("--dragzone-active"),this.activateDragLocation(),this.activateDroppables(this.dragSource);var o=this.findDraggableInDraggableContainer(this.dragSource.getAttribute("identifier")),a=this.droppables.some(function(e){return Array.from(e.children).some(function(e){return e===t.dragSource})}),s=this.dragSource.getBoundingClientRect();a&&(this.dragSource.remove(),this.draggablesModified([],[this.dragSource]),this.dragSource=o),this.cloneOffset.x=r-s.left,this.cloneOffset.y=i-s.top,this.dragClone=o.cloneNode(!0);var l=window.getComputedStyle(o);for(var u=0;u<l.length;u++){var c=l[u];this.dragClone.style.setProperty(c,l.getPropertyValue(c))}var d=o.getBoundingClientRect();this.dragClone.style.width="".concat(d.width,"px"),this.dragClone.style.height="".concat(d.height,"px"),s&&this.setDragCloneStyles(s),this.dragClone.style.display="block",this.dragClone.style.opacity="1",this.appendClone();var h=this.getMatchMaxValue(this.dragSource),f=this.draggables.filter(function(e){return e.getAttribute("identifier")===t.dragSource.getAttribute("identifier")});h!==0&&f.length>=h?(o.style.opacity="0.0",o.style.pointerEvents="none"):o.style.opacity="1.0",e.preventDefault(),this.dragClone.setAttribute("dragging","")}},{key:"findDraggableInDraggableContainer",value:function e(e){var n=this.dragContainers.flat();var r=true,i=false,o=undefined;try{for(var a=n[Symbol.iterator](),s;!(r=(s=a.next()).done);r=true){var l=s.value;if(l.getAttribute("identifier")===e)return l;var u=void 0;v(l,HTMLSlotElement)?u=Array.from((l===null||l===void 0?void 0:l.assignedElements())||[]):u=Array.from(l.querySelectorAll(t));var c=u.find(function(t){return t.getAttribute("identifier")===e});if(c)return c}}catch(e){i=true;o=e}finally{try{if(!r&&a.return!=null){a.return()}}finally{if(i){throw o}}}}},{key:"setDragCloneStyles",value:function e(e){this.dragClone.style.position="fixed",this.dragClone.style.top="".concat(e.top,"px"),this.dragClone.style.left="".concat(e.left,"px"),this.dragClone.style.setProperty("box-sizing","border-box","important"),this.dragClone.style.zIndex="9999",this.dragClone.style.pointerEvents="none",this.dragClone.style.opacity=this.DRAG_CLONE_OPACITY.toString(),this.dragClone.style.display="block"}}]);return i}(r0(e,n,t));return tz([i({attribute:!1,type:Object})],l.prototype,"configuration",2),tz([i({type:Number,reflect:!0,attribute:"min-associations"})],l.prototype,"minAssociations",2),tz([i({type:Number,reflect:!0,attribute:"max-associations"})],l.prototype,"maxAssociations",2),tz([m(r)],l.prototype,"handleDraggableContainerChange",1),tz([m(t)],l.prototype,"handleDraggablesChange",1),tz([m(n)],l.prototype,"handleDroppablesChange",1),l};var r2=nS(X());var r3=Symbol("configContext");var r4=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t);e.disabled=!1;e.readonly=!1;e._internals=e.attachInternals();return e}c(t,[{key:"internals",get:function e(){return this._internals}},{key:"isFullCorrectResponse",get:function e(){return this._isFullCorrectResponse},set:function e(e){this._isFullCorrectResponse=e,e&&(this.disabled=!0,this.setAttribute("response-identifier",this.responseIdentifier+"_cr"))}},{key:"correctResponse",get:function e(){return this._correctResponse},set:function e(e){this._correctResponse=e}},{key:"correctness",get:function e(){var e=this.responseVariable;return!e||e.correctResponse===null?null:e.correctResponse===e.value?"correct":"incorrect"}},{key:"isInline",get:function e(){return!1}},{key:"responseVariable",get:function e(){var e=this._context.variables.filter(function(e){return e.type==="response"}),t=this.getAttribute("response-identifier");return e.find(function(e){return e.identifier===t})}},{key:"toggleCorrectResponse",value:function e(e){var t,n;(((n=this)===null||n===void 0?void 0:(t=n.configContext)===null||t===void 0?void 0:t.correctResponseMode)||"internal")==="full"?this.toggleFullCorrectResponse(e):this.toggleInternalCorrectResponse(e)}},{key:"toggleFullCorrectResponse",value:function e(e){return o(function(){var t,n,r,i,o,a,s;return L(this,function(l){switch(l.label){case 0:n=this.nextSibling,r=v(n,HTMLDivElement)&&(n===null||n===void 0?void 0:n.classList.contains("full-correct-response")),i=this.responseVariable;if(!i)return[2];if(!e||this.correctness==="correct"){;if(!r)return[2];(o=this.parentElement)===null||o===void 0?void 0:o.removeChild(n)}if(r||this.correctness==="correct")return[2];a=this.cloneNode(!0),s=document.createElement("div");s.classList.add("full-correct-response"),this.isInline?s.classList.add("full-correct-response-inline"):s.classList.add("full-correct-response-block"),s.role="full-correct-response",s.appendChild(a),a.isFullCorrectResponse=!0,(t=this.parentElement)===null||t===void 0?void 0:t.insertBefore(s,this.nextSibling);return[4,a.updateComplete];case 1:l.sent(),a.response=Array.isArray(i.correctResponse)?T(i.correctResponse):i.correctResponse;return[2]}})}).call(this)}},{key:"toggleInternalCorrectResponse",value:function e(e){var t=this.responseVariable;this.correctResponse=e?t===null||t===void 0?void 0:t.correctResponse:(t===null||t===void 0?void 0:t.cardinality)==="single"?"":[]}},{key:"toggleCandidateCorrection",value:function e(e){this.responseVariable&&(this._internals.states.delete("candidate-correct"),this._internals.states.delete("candidate-partially-correct"),this._internals.states.delete("candidate-incorrect"),e&&(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 e(){return JSON.stringify(this.response)},set:function e(e){this.response=e?JSON.parse(e):null}},{key:"reportValidity",value:function e(){return this._internals.reportValidity()}},{key:"reset",value:function e(){this.response=null}},{key:"connectedCallback",value:function e(){h(f(t.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:"saveResponse",value:function e(e){this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,cancelable:!1,detail:{responseIdentifier:this.responseIdentifier,response:Array.isArray(e)?T(e):e}}))}}]);return t}(rP);r4.formAssociated=!0,tz([t({context:rL,subscribe:!0})],r4.prototype,"_context",2),tz([t({context:r3,subscribe:!0})],r4.prototype,"configContext",2),tz([i({type:String,attribute:"response-identifier"})],r4.prototype,"responseIdentifier",2),tz([i({reflect:!0,type:Boolean})],r4.prototype,"disabled",2),tz([i({reflect:!0,type:Boolean})],r4.prototype,"readonly",2),tz([l()],r4.prototype,"_isFullCorrectResponse",2),tz([l()],r4.prototype,"_correctResponse",2);var r5=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t);e._childrenMap=[];e._registerChoiceHandler=e._registerChoice.bind(e),e.addEventListener("register-qti-simple-associable-choice",e._registerChoiceHandler);return e}c(t,[{key:"_registerChoice",value:function e(e){var t=e.target;this._childrenMap.push(t)}},{key:"render",value:function e(){return rl(K(),this._childrenMap.length>0&&Array.from(Array(Math.ceil(this._childrenMap.length/2)).keys()).map(function(e,t){return rl(Y(),t,t,t,t)}))}},{key:"disconnectedCallback",value:function e(){h(f(t.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("register-qti-simple-associable-choice",this._registerChoiceHandler)}}]);return t}(r1(r4,"qti-simple-associable-choice",".dl","slot[name='qti-simple-associable-choice']"));r5.styles=r2,tz([l()],r5.prototype,"_childrenMap",2),r5=tz([rI("qti-associate-interaction")],r5);var r6=function(e,n){var r=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e._choiceElements=[];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}c(t,[{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:"toggleInternalCorrectResponse",value:function e(e){var t=this.responseVariable;if(t===null||t===void 0?void 0:t.correctResponse){var n=Array.isArray(t.correctResponse)?t.correctResponse:[t.correctResponse];this._choiceElements.forEach(function(t){t.internals.states.delete("correct-response"),t.internals.states.delete("incorrect-response"),e&&n.length>0&&(n.includes(t.identifier)?t.internals.states.add("correct-response"):t.internals.states.add("incorrect-response"))})}}},{key:"toggleCandidateCorrection",value:function e(e){var t=this.responseVariable;if(!(t===null||t===void 0?void 0:t.correctResponse))return;var n=Array.isArray(t.correctResponse)?t.correctResponse:[t.correctResponse],r=Array.isArray(t.value)?t.value:[t.value];this._choiceElements.forEach(function(t){t.internals.states.delete("candidate-correct"),t.internals.states.delete("candidate-incorrect"),e&&r.includes(t.identifier)&&(n.includes(t.identifier)?t.internals.states.add("candidate-correct"):t.internals.states.add("candidate-incorrect"))})}},{key:"connectedCallback",value:function e(){h(f(t.prototype),"connectedCallback",this).call(this),this.addEventListener("register-".concat(n),this._registerChoiceElement),this.addEventListener("unregister-".concat(n),this._unregisterChoiceElement),this.addEventListener("activate-".concat(n),this._choiceElementSelectedHandler)}},{key:"disconnectedCallback",value:function e(){h(f(t.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("register-".concat(n),this._registerChoiceElement),this.removeEventListener("unregister-".concat(n),this._unregisterChoiceElement),this.removeEventListener("activate-".concat(n),this._choiceElementSelectedHandler)}},{key:"validate",value:function e(){var e=this;var t=this._choiceElements.filter(function(t){return e._getChoiceChecked(t)}),n=t.length,r=!0,i="";return this.maxChoices!==0&&n>this.maxChoices?(r=!1,i=this.dataset.maxSelectionsMessage||"Please select no more than ".concat(this.maxChoices," ").concat(this.maxChoices===1?"option":"options",".")):n<this.minChoices&&(r=!1,i=this.dataset.minSelectionsMessage||"Please select at least ".concat(this.minChoices," ").concat(this.minChoices===1?"option":"options",".")),t.length>0&&this._internals.setValidity(r?{}:{customError:!0},i,t[n-1]||this._choiceElements[0]||this),r}},{key:"reportValidity",value:function e(){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._internals.validity.valid}},{key:"_registerChoiceElement",value:function e(e){e.stopPropagation();var t=e.target;t.disabled=this.disabled,this._choiceElements.push(t),this._setInputType(t)}},{key:"_unregisterChoiceElement",value:function e(e){e.stopPropagation();var t=e.target;this._choiceElements=this._choiceElements.filter(function(e){return e!==t})}},{key:"_determineInputType",value:function e(){var e=this;this._choiceElements.forEach(function(t){e._setInputType(t)})}},{key:"_setInputType",value:function e(e){this._internals.role=this.maxChoices===1?"radiogroup":null;var t=this.maxChoices===1?"radio":"checkbox";e.internals.role=t,e.internals.states.delete(t==="radio"?"checkbox":"radio"),e.internals.states.add(t)}},{key:"_choiceElementSelectedHandler",value:function e(e){var t=this;var n;this._toggleChoiceChecked(e.target),this.maxChoices===1?this._choiceElements.forEach(function(n){n.identifier!==e.detail.identifier&&t._setChoiceChecked(n,!1)}):((n=this._configContext)===null||n===void 0?void 0:n.disableAfterIfMaxChoicesReached)&&(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.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 t}(e);return tz([u("#validation-message")],r.prototype,"_validationMessageElement",2),tz([i({type:Number,attribute:"min-choices"})],r.prototype,"minChoices",2),tz([i({type:Number,attribute:"max-choices"})],r.prototype,"maxChoices",2),tz([g("maxChoices",{waitUntilFirstUpdate:!0})],r.prototype,"_handleMaxChoicesChange",1),tz([g("disabled",{waitUntilFirstUpdate:!0})],r.prototype,"_handleDisabledChange",2),tz([g("readonly",{waitUntilFirstUpdate:!0})],r.prototype,"_handleReadonlyChange",2),tz([l()],r.prototype,"response",2),tz([g("response",{waitUntilFirstUpdate:!0})],r.prototype,"_handleValueChange",2),tz([l(),t({context:r3,subscribe:!0})],r.prototype,"_configContext",2),r};var r9=function(e,t){var n=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e._classes=[];e._allLabels=["qti-labels-decimal","qti-labels-lower-alpha","qti-labels-upper-alpha"];e._allLabelSuffixes=["qti-labels-suffix-period","qti-labels-suffix-parenthesis"];return e}c(t,[{key:"class",get:function e(){var e;return((e=this._classes)===null||e===void 0?void 0:e.join(" "))||""},set:function e(e){e&&(this._classes=e.split(" "),this._addLabels())}},{key:"updated",value:function e(e){h(f(t.prototype),"updated",this).call(this,e),this._addLabels()}},{key:"_addLabels",value:function e(){var e=this;var t=this._classes.some(function(t){return e._allLabels.includes(t)||e._allLabelSuffixes.includes(t)}),n=function(e){return!isNaN(+e)};if(t){var r=Array.from(this.querySelectorAll("qti-simple-choice")).map(function(e){return e}).map(function(e,t){return{el:e,order:n(e.style.order)?+e.style.order:t+1}}).sort(function(e,t){return e.order-t.order}).map(function(e){return e.el});for(var i=0;i<r.length;i++)r[i].marker=this._getLabel(i+1)}}},{key:"_getLabel",value:function e(e){var t=this;var n=this._classes.filter(function(e){return t._allLabels.includes(e)}).pop(),r=this._classes.filter(function(e){return t._allLabelSuffixes.includes(e)}).pop();!n&&r&&(n="qti-labels-upper-alpha");var i="";switch(n){case"qti-labels-decimal":i="".concat(e);break;case"qti-labels-lower-alpha":i="".concat(String.fromCharCode(97+e-1));break;case"qti-labels-upper-alpha":i="".concat(String.fromCharCode(65+e-1));break}return r==="qti-labels-suffix-period"?i+=".":r==="qti-labels-suffix-parenthesis"&&(i+=")"),i}}]);return t}(e);return tz([i({type:String,reflect:!0})],n.prototype,"class",1),n};var r7=nS(Z());var r8=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e.orientation="vertical";return e}c(t,[{key:"_handleSlotChange",value:function e(){var e=this.querySelectorAll("qti-simple-choice");this.style.setProperty("--item-count",e.length.toString())}},{key:"render",value:function e(){return rl(ee(),this._handleSlotChange)}}]);return t}(r9(r6(r4,"qti-simple-choice"),"qti-simple-choice"));r8.styles=r7,tz([i({type:String})],r8.prototype,"orientation",2),r8=tz([rI("qti-choice-interaction")],r8);var ie=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t);e.rawResponse="";e._errorMessage=null;e.handlePostMessage=e.handlePostMessage.bind(e);return e}c(t,[{key:"connectedCallback",value:function e(){var e=this;h(f(t.prototype),"connectedCallback",this).call(this);var n=this.data.startsWith("http")||this.data.startsWith("blob")?this.data:tP(this.baseItemUrl+"/"+this.data);fetch(n).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(){var e=this.shadowRoot.querySelector("#pciContainer").contentDocument;if(!this.manifest.script||this.manifest.script.length===0){this._errorMessage="No script found in manifest";return}if(!this.manifest.style||this.manifest.style.length===0){this._errorMessage="No style found in manifest";return}var t=this.manifest.style[0],n=t.startsWith("http")||t.startsWith("blob")?t:tP("".concat(this.baseRefUrl,"/").concat(t)),r=this.manifest.script[0],i=r.startsWith("http")||r.startsWith("blob")?r:tP("".concat(this.baseRefUrl,"/").concat(r));window.addEventListener("message",this.handlePostMessage),e.open(),e.write("\n <html>\n <head>\n <link href='".concat(n,"' rel=\"stylesheet\" />\n <script src='").concat(i,"'><\/script>\n </head>\n <body></body>\n </html>\n ")),e.close()}},{key:"getIFrames",value:function e(){var e=this.shadowRoot.querySelectorAll("iframe"),t=this.querySelectorAll("iframe"),n=T(e).concat(T(t));var r=true,i=false,o=undefined;try{for(var a=n[Symbol.iterator](),s;!(r=(s=a.next()).done);r=true){var l=s.value;var u=l.src;if(new URL(u,window.location.href).origin===window.location.origin)try{var c=l.contentDocument||l.contentWindow.document;c&&this.getInnerIFrames(c,n)}catch(e){console.error("Error accessing nested iframe:",e)}}}catch(e){i=true;o=e}finally{try{if(!r&&a.return!=null){a.return()}}finally{if(i){throw o}}}return n.forEach(function(e,t){n.indexOf(e)!==t&&n.splice(t,1)}),n}},{key:"getInnerIFrames",value:function e(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 i=e.contentDocument||e.contentWindow.document;t.getInnerIFrames(i,n)}catch(e){console.error("Error accessing nested iframe:",e)}else console.warn("Skipped cross-origin iframe:",r)}),n}},{key:"postToWindowAndIframes",value:function e(e,t){window.postMessage({type:e,data:t},"*");var n=this.getIFrames();var r=true,i=false,o=undefined;try{for(var a=n[Symbol.iterator](),s;!(r=(s=a.next()).done);r=true){var l=s.value;l.contentWindow&&l.contentWindow.postMessage({type:e,data:t},"*")}}catch(e){i=true;o=e}finally{try{if(!r&&a.return!=null){a.return()}}finally{if(i){throw o}}}}},{key:"handlePostMessage",value:function e(e){var t=this;var n=e.data,r=n.type,i=n.data;switch(r){case"setResponse":(i===null||!(Array.isArray(i)&&i.length===1&&i[0]===""))&&(this.rawResponse=i,this.saveResponse(i));break;case"getResponse":{this.postToWindowAndIframes("responseData",this.rawResponse);break}case"getMedia":{var o=this.manifest.media.map(function(e){return e.startsWith("http")||e.startsWith("blob")?e:tP(t.baseRefUrl+"/"+e)});this.postToWindowAndIframes("mediaData",o);break}case"setStageHeight":console.log("setStageHeight not implemented");break}}},{key:"validate",value:function e(){if(!this.rawResponse)return!1;if(Array.isArray(this.rawResponse)){if(this.rawResponse.length===0)return!1;var e=true,t=false,n=undefined;try{for(var r=this.rawResponse[Symbol.iterator](),i;!(e=(i=r.next()).done);e=true){var o=i.value;if(o!==""&&o!==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 this.rawResponse||null},set:function e(e){if(typeof e=="string")this.rawResponse=e,this.saveResponse(e);else if(Array.isArray(e))this.rawResponse=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),h(f(t.prototype),"disconnectedCallback",this).call(this)}},{key:"render",value:function e(){return rl(en(),this.getAttribute("width"),this.getAttribute("height"),this._errorMessage&&rl(et(),this._errorMessage))}}]);return t}(r4);tz([i({type:String,attribute:"data"})],ie.prototype,"data",2),tz([i({type:String,attribute:"data-base-item"})],ie.prototype,"baseItemUrl",2),tz([i({type:String,attribute:"data-base-ref"})],ie.prototype,"baseRefUrl",2),tz([i({type:String,attribute:"id"})],ie.prototype,"id",2),tz([l()],ie.prototype,"_errorMessage",2),ie=tz([rI("qti-custom-interaction")],ie);var it=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e.disabled=!1;e.countAttempt=null;e.title="end attempt";return e}c(t,[{key:"render",value:function e(){return rl(er(),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}(rP);tz([i({type:String,attribute:"response-identifier"})],it.prototype,"responseIdentifier",2),tz([i({reflect:!0,type:Boolean})],it.prototype,"disabled",2),tz([i({type:String,attribute:"count-attempt"})],it.prototype,"countAttempt",2),tz([i({type:String})],it.prototype,"title",2),it=tz([rI("qti-end-attempt-interaction")],it);var ir=nS(ei());var ii=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e._rows=5;e.response=null;e._handleResponseChange=function(){e._internals.setFormValue(e.value),e.validate()};return e}c(t,[{key:"handleclassNamesChange",value:function e(e,t){var n=this;var r=t.split(" "),i=!1;if(r.forEach(function(e){if(e.startsWith("qti-height-lines-")){var t=e.replace("qti-height-lines-","");n._rows=parseInt(t),i=!0}}),!i&&this.expectedLength){var o=Math.ceil(this.expectedLength/50);this._rows=o}}},{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;if(this.patternMask&&this.dataPatternmaskMessage){this._internals.setValidity({}),e.setCustomValidity("");var t=this.patternMask.startsWith("^")&&this.patternMask.endsWith("$")?this.patternMask:"^".concat(this.patternMask,"$"),n=new RegExp(t);e.checkValidity()&&n.test(e.value)||(this._internals.setValidity({customError:!0},this.dataPatternmaskMessage),e.setCustomValidity(this.dataPatternmaskMessage))}else{var r=e.checkValidity();this._internals.setValidity(r?{}:{customError:!1})}return!!this.response&&e.checkValidity()}},{key:"toggleCorrectResponse",value:function e(){}},{key:"reportValidity",value:function e(){var e=this.shadowRoot.querySelector("textarea");if(!e)return!1;var t=this.validate();return t||e.reportValidity(),t}},{key:"render",value:function e(){var e=this;return rl(eo(),this.responseIdentifier,5e3,function(e){return e.stopImmediatePropagation()},this.textChanged,this.textChanged,function(t){e.reportValidity()},rX(this.placeholderText?this.placeholderText:void 0),this._rows,this.disabled,this.readonly,this.response)}},{key:"textChanged",value:function e(e){if(this.disabled||this.readonly)return;var t=e.target;this.setEmptyAttribute(t.value),this.response!==t.value&&(this.value=t.value,this.saveResponse(t.value))}},{key:"setEmptyAttribute",value:function e(e){this.setAttribute("empty",e===""?"true":"false")}}]);return t}(r4);ii.styles=ir,tz([l()],ii.prototype,"_rows",2),tz([i({type:Number,attribute:"expected-length"})],ii.prototype,"expectedLength",2),tz([i({type:String,attribute:"pattern-mask"})],ii.prototype,"patternMask",2),tz([i({type:String,attribute:"placeholder-text"})],ii.prototype,"placeholderText",2),tz([i({type:String,attribute:"data-patternmask-message"})],ii.prototype,"dataPatternmaskMessage",2),tz([i({type:String,attribute:"class"})],ii.prototype,"classNames",2),tz([g("classNames")],ii.prototype,"handleclassNamesChange",1),tz([l()],ii.prototype,"response",2),tz([g("response",{waitUntilFirstUpdate:!0})],ii.prototype,"_handleResponseChange",2),ii=tz([rI("qti-extended-text-interaction")],ii);var io=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e.tabindex=0;return e}c(t,[{key:"connectedCallback",value:function e(){this.setAttribute("slot","drags")}}]);return t}(rP);io.styles=nS(ea()),tz([i({type:Number,reflect:!0})],io.prototype,"tabindex",2),io=tz([rI("qti-gap-img")],io);var ia=nS(es());var is=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"render",value:function e(){return rl(el())}},{key:"toggleCorrectResponse",value:function e(e){var t=this;var n=this.responseVariable;if(e&&(n===null||n===void 0?void 0:n.correctResponse)){var r=[],i=Array.isArray(n.correctResponse)?n.correctResponse:[n.correctResponse];i&&(r=i.map(function(e){var t=e.split(" ");return{text:t[0],gap:t[1]}})),this.querySelectorAll("qti-gap").forEach(function(e){var n,i,o;var a=e.getAttribute("identifier"),s=(n=r.find(function(e){return e.gap===a}))===null||n===void 0?void 0:n.text,l=(i=t.querySelector('qti-gap-text[identifier="'.concat(s,'"]')))===null||i===void 0?void 0:i.textContent.trim();if(s&&l){var u;if(!((u=e.nextElementSibling)===null||u===void 0?void 0:u.classList.contains("correct-option"))){var c=document.createElement("span");c.classList.add("correct-option"),c.textContent=l,c.style.border="1px solid var(--qti-correct)",c.style.borderRadius="4px",c.style.padding="2px 4px",c.style.display="inline-block",e.insertAdjacentElement("afterend",c)}}else((o=e.nextElementSibling)===null||o===void 0?void 0:o.classList.contains("correct-option"))&&e.nextElementSibling.remove()})}else this.querySelectorAll(".correct-option").forEach(function(e){e.remove()})}}]);return t}(r1(r4,"qti-gap-text","qti-gap","slot[part='drags']"));is.styles=ia,is=tz([rI("qti-gap-match-interaction")],is);var il={toAttribute:function(e){return e?"true":"false"},fromAttribute:function(e){return e==="true"}};var iu=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e.tabindex=0;return e}c(t,[{key:"connectedCallback",value:function e(){h(f(t.prototype),"connectedCallback",this).call(this),this.setAttribute("slot","drags")}},{key:"render",value:function e(){return rl(eu())}}]);return t}(tM(rP,"qti-gap-text"));iu.styles=nS(ec()),tz([i({type:Number,reflect:!0})],iu.prototype,"tabindex",2),iu=tz([rI("qti-gap-text")],iu);var ic=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e.tabindex=0;return e}c(t,[{key:"render",value:function e(){return rl(ed())}}]);return t}(rP);ic.styles=nS(eh()),tz([i({type:Number,reflect:!0})],ic.prototype,"tabindex",2),ic=tz([rI("qti-gap")],ic);var id={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},ih=function(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}}},ip=/*#__PURE__*/function(){"use strict";function e(t){s(this,e)}c(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,T(t))}}]);return e}();var iv=rq.I;var iy=function(e){return e.strings===void 0},im=function(){return document.createComment("")},ig=function(e,t,n){var r=e._$AA.parentNode,i=t===void 0?e._$AB:t._$AA;if(n===void 0){var o=r.insertBefore(im(),i),a=r.insertBefore(im(),i);n=new iv(o,a,e,e.options)}else{var s=n._$AB.nextSibling,l=n._$AM,u=l!==e;if(u){var c;var d;(c=n._$AQ)===null||c===void 0?void 0:c.call(n,e),n._$AM=e,n._$AP!==void 0&&(d=e._$AU)!==l._$AU&&n._$AP(d)}if(s!==i||u){var h=n._$AA;for(;h!==s;){var f=h.nextSibling;r.insertBefore(h,i),h=f}}}return n},ib=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e;return e._$AI(t,n),e},i_={},ik=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:i_;return e._$AH=t},iw=function(e){return e._$AH},ix=function(e){e._$AR(),e._$AA.remove()};var iE=function(e,t,n){var r=new Map;for(var i=t;i<=n;i++)r.set(e[i],i);return r},iq=ih(/*#__PURE__*/function(e){"use strict";p(t,e);function t(e){s(this,t);var n;if(n=a(this,t,[e]),e.type!==id.CHILD)throw Error("repeat() can only be used in text expressions");return n}c(t,[{key:"dt",value:function e(e,t,n){var r;n===void 0?n=t:t!==void 0&&(r=t);var i=[],o=[],a=0;var s=true,l=false,u=undefined;try{for(var c=e[Symbol.iterator](),d;!(s=(d=c.next()).done);s=true){var h=d.value;i[a]=r?r(h,a):a,o[a]=n(h,a),a++}}catch(e){l=true;u=e}finally{try{if(!s&&c.return!=null){c.return()}}finally{if(l){throw u}}}return{values:o,keys:i}}},{key:"render",value:function e(e,t,n){return this.dt(e,t,n).values}},{key:"update",value:function e(e,t){var n=S(t,3),r=n[0],i=n[1],o=n[2];var a=iw(e),s=this.dt(r,i,o),l=s.values,u=s.keys;if(!Array.isArray(a))return this.ut=u,l;var c;var d=(c=this.ut)!==null&&c!==void 0?c:this.ut=[],h=[],f,p,v=0,y=a.length-1,m=0,g=l.length-1;for(;v<=y&&m<=g;)if(a[v]===null)v++;else if(a[y]===null)y--;else if(d[v]===u[m])h[m]=ib(a[v],l[m]),v++,m++;else if(d[y]===u[g])h[g]=ib(a[y],l[g]),y--,g--;else if(d[v]===u[g])h[g]=ib(a[v],l[g]),ig(e,h[g+1],a[v]),v++,g--;else if(d[y]===u[m])h[m]=ib(a[y],l[m]),ig(e,a[v],a[y]),y--,m++;else if(f===void 0&&(f=iE(u,m,g),p=iE(d,v,y)),f.has(d[v]))if(f.has(d[y])){var b=p.get(u[m]),_=b!==void 0?a[b]:null;if(_===null){var k=ig(e,a[v]);ib(k,l[m]),h[m]=k}else h[m]=ib(_,l[m]),ig(e,a[v],_),a[b]=null;m++}else ix(a[y]),y--;else ix(a[v]),v++;for(;m<=g;){var w=ig(e,h[g+1]);ib(w,l[m]),h[m++]=w}for(;v<=y;){var x=a[v++];x!==null&&ix(x)}return this.ut=u,ik(e,h),rd}}]);return t}(ip));var iA=nS(ef());var iC=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t);e.startPoint=null;e.endPoint=null;e._correctLines=[];e._response=[];e.addEventListener("qti-register-hotspot",e.positionHotspotOnRegister);return e}c(t,[{key:"reset",value:function e(){this._response=[],this._correctLines=[]}},{key:"validate",value:function e(){return this.response.length>0}},{key:"response",get:function e(){return this._response},set:function e(e){this._response=e}},{key:"toggleInternalCorrectResponse",value:function e(e){var t=this.responseVariable;if(!e||!t){this._correctLines=[];return}if(!t.correctResponse){console.error("No correct response found for this interaction.");return}var n=Array.isArray(t.correctResponse)?t.correctResponse:[t.correctResponse];this._correctLines=n}},{key:"render",value:function e(){var e=this;var t,n,r,i;return rl(em(),rX((t=this.grImage[0])===null||t===void 0?void 0:t.width),rX((n=this.grImage[0])===null||n===void 0?void 0:n.height),(r=this.grImage[0])===null||r===void 0?void 0:r.width,(i=this.grImage[0])===null||i===void 0?void 0:i.height,iq(this.response||[],function(e){return e},function(t,n){return ru(ep(),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)})}),iq(this._correctLines||[],function(e){return e},function(t,n){return ru(ev(),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))}),this.startPoint&&ru(ey(),this.startCoord.x,this.startCoord.y,this.mouseCoord.x,this.mouseCoord.y))}},{key:"positionHotspotOnRegister",value:function e(e){var t=this.querySelector("img"),n=e.target,r=n.getAttribute("coords"),i=n.getAttribute("shape"),o=r.split(",").map(function(e){return parseInt(e)});tT(i,o,t,n)}},{key:"firstUpdated",value:function e(){var e=this;this.hotspots=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}}),this.hotspots.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){e.startPoint?e.endPoint||(e.endPoint=t.target,e._response=T(e.response).concat(["".concat(e.startPoint.getAttribute("identifier")," ").concat(e.endPoint.getAttribute("identifier"))]),e.saveResponse(e.response),e.startPoint=null,e.endPoint=null):(e.startPoint=t.target,e.startCoord={x:parseInt(e.startPoint.getAttribute("coords").split(",")[0]),y:parseInt(e.startPoint.getAttribute("coords").split(",")[1])})})})}},{key:"disconnectedCallback",value:function e(){h(f(t.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}}]);return t}(r4);iC.styles=iA,tz([l()],iC.prototype,"_correctLines",2),tz([l()],iC.prototype,"startCoord",2),tz([l()],iC.prototype,"mouseCoord",2),tz([y({selector:"img"})],iC.prototype,"grImage",2),tz([l()],iC.prototype,"_response",2),iC=tz([rI("qti-graphic-associate-interaction")],iC);var iS=nS(eg());var iR=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"render",value:function e(){return rl(eb())}},{key:"positionHotspotOnRegister",value:function e(e){var t=e.target,n=t.getAttribute("coords"),r=t.getAttribute("shape"),i=n.split(",").map(function(e){return parseInt(e)});switch(r){case"circle":{var o=S(i,3),a=o[0],s=o[1],l=o[2];t.style.left=a-l+"px",t.style.top=s-l+"px",t.style.width=t.style.height=2*l+"px"}break;case"rect":{var u=S(i,4),c=u[0],d=u[1],h=u[2],f=u[3];t.style.left=c+"px",t.style.top=d+"px",t.style.width=h-c+"px",t.style.height=f-d+"px"}break;default:break}}},{key:"connectedCallback",value:function e(){h(f(t.prototype),"connectedCallback",this).call(this),this.addEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}},{key:"disconnectedCallback",value:function e(){h(f(t.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}}]);return t}(r1(r4,"qti-gap-img, qti-gap-text","qti-associable-hotspot","slot[part='drags']"));iR.styles=iS,iR=tz([rI("qti-graphic-gap-match-interaction")],iR);var iP=nS(e_());var iM=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e._choiceElements=[];return e}c(t,[{key:"render",value:function e(){return rl(ek())}},{key:"setHotspotOrder",value: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 i=this._choiceElements.length;if(!this.choiceOrdering){if(this.choiceOrdering=!0,r.order==null){var o=this._choiceElements.filter(function(e){return e.order!=null}).length;if(o>=i){this.choiceOrdering=!1;return}r.order=o+1}else{var a=r.order;r.order=null,this._choiceElements.forEach(function(e){e.order!=null&&e.order>a&&e.order--})}this.choiceOrdering=!1}}},{key:"toggleCorrectResponse",value:function e(e){var t;var n=this.responseVariable,r=this._choiceElements;var i=true,o=false,a=undefined;try{var s=function(){var r=u.value;if(e&&(n===null||n===void 0?void 0:(t=n.correctResponse)===null||t===void 0?void 0:t.length)>0&&Array.isArray(n.correctResponse)){var i=n.correctResponse.findIndex(function(e){return e===r.identifier});i>=0?r.orderCorrect=i+1:r.orderCorrect=null}else r.orderCorrect=null};for(var l=r[Symbol.iterator](),u;!(i=(u=l.next()).done);i=true)s()}catch(e){o=true;a=e}finally{try{if(!i&&l.return!=null){l.return()}}finally{if(o){throw a}}}}},{key:"positionHotspotOnRegister",value:function e(e){var t=this.querySelector("img"),n=e.target,r=n.getAttribute("coords"),i=n.getAttribute("shape"),o=r.split(",").map(function(e){return parseInt(e)});tT(i,o,t,n)}},{key:"connectedCallback",value:function e(){h(f(t.prototype),"connectedCallback",this).call(this),this.addEventListener("activate-qti-hotspot-choice",this.setHotspotOrder),this.addEventListener("register-qti-hotspot-choice",this.positionHotspotOnRegister)}},{key:"disconnectedCallback",value:function e(){h(f(t.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("activate-qti-hotspot-choice",this.setHotspotOrder),this.removeEventListener("register-qti-hotspot-choice",this.positionHotspotOnRegister)}}]);return t}(r6(r4,"qti-hotspot-choice"));iM.styles=iP,iM=tz([rI("qti-graphic-order-interaction")],iM);var iT=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}return t}(tM(rP,"qti-hotspot-choice"));iT.styles=nS(ew()),tz([i({attribute:"aria-ordervalue",type:Number,reflect:!0})],iT.prototype,"order",2),tz([i({attribute:"aria-ordercorrectvalue",type:Number,reflect:!0})],iT.prototype,"orderCorrect",2),iT=tz([rI("qti-hotspot-choice")],iT);var iI=nS(ex());var iO=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"render",value:function e(){return rl(eE())}},{key:"positionHotspotOnRegister",value:function e(e){var t=this.querySelector("img"),n=e.target,r=n.getAttribute("coords"),i=n.getAttribute("shape"),o=r.split(",").map(function(e){return parseInt(e)});tT(i,o,t,n)}},{key:"connectedCallback",value:function e(){h(f(t.prototype),"connectedCallback",this).call(this),this.addEventListener("register-qti-hotspot-choice",this.positionHotspotOnRegister)}},{key:"disconnectedCallback",value:function e(){h(f(t.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("unregister-qti-hotspot-choice",this.positionHotspotOnRegister)}}]);return t}(r6(r4,"qti-hotspot-choice"));iO.styles=iI,iO=tz([rI("qti-hotspot-interaction")],iO);var iN=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e.class="";e.render=function(){return rl(eq())};return e}c(t,[{key:"classObject",get:function e(){var e={"qti-input-control-hidden":!0};return this.class&&this.class.split(" ").forEach(function(t){t.trim()&&(e[t.trim()]=!0)}),e}},{key:"connectedCallback",value:function e(){h(f(t.prototype),"connectedCallback",this).call(this),this.updateHostClasses()}},{key:"updated",value:function e(e){h(f(t.prototype),"updated",this).call(this,e),this.updateHostClasses()}},{key:"updateHostClasses",value:function e(){var e=Object.keys(this.classObject).join(" ");this.className=e}}]);return t}(r6(r4,"qti-hottext"));tz([i({type:String,reflect:!0})],iN.prototype,"class",2),iN=tz([rI("qti-hottext-interaction")],iN);var iU=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"render",value:function e(){return rl(eA())}}]);return t}(tM(rP,"qti-hottext"));iU.styles=nS(eC()),iU=tz([rI("qti-hottext")],iU);var iL=/*#__PURE__*/function(e){"use strict";p(t,e);function t(e){s(this,t);var n;if(n=a(this,t,[e]),n.it=rh,e.type!==id.CHILD)throw Error(n.constructor.directiveName+"() can only be used in child bindings");return n}c(t,[{key:"render",value:function e(e){if(e===rh||e==null)return this._t=void 0,this.it=e;if(e===rd)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;var t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}}]);return t}(ip);iL.directiveName="unsafeHTML",iL.resultType=1;var i$=ih(iL);var iD=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e.options=[];e.correctOption="";e.dataPrompt="";return e}c(t,[{key:"isInline",get:function e(){return!0}},{key:"render",value:function e(){return rl(eP(),this.choiceSelected,this.disabled,this.readonly,this.options.map(function(e){return rl(eR(),e.value,e.selected,i$(e.textContent))}),i$(this.correctOption))}},{key:"connectedCallback",value:function e(){h(f(t.prototype),"connectedCallback",this).call(this),this.addEventListener("on-dropdown-selected",this.choiceSelected)}},{key:"disconnectedCallback",value:function e(){h(f(t.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("on-dropdown-selected",this.choiceSelected)}},{key:"willUpdate",value:function e(e){(e.has("configContext")||e.has("dataPrompt"))&&this._updateOptions()}},{key:"_updateOptions",value:function e(){var e;var t=Array.from(this.querySelectorAll("qti-inline-choice")),n=this.dataPrompt||((e=this.configContext)===null||e===void 0?void 0:e.inlineChoicePrompt)||"select";this.options=[{textContent:n,value:"",selected:!1}].concat(T(t.map(function(e){return{textContent:e.innerHTML,value:e.getAttribute("identifier"),selected:!1}})))}},{key:"validate",value:function e(){var e=this.options.find(function(e){return e.selected});return e?e.value!=="":!1}},{key:"reset",value:function e(){this.options=this.options.map(function(e,t){return x(k({},e),{selected:t===0})})}},{key:"response",get:function e(){var e;return((e=this.options.find(function(e){return e.selected}))===null||e===void 0?void 0:e.value)||null},set:function e(e){this.options=this.options.map(function(t){return e&&e===t.value&&(t.selected=!0),t})}},{key:"toggleInternalCorrectResponse",value:function e(e){var t=this;var n,r;if(this.correctResponse=e&&((r=this.responseVariable)===null||r===void 0?void 0:(n=r.correctResponse)===null||n===void 0?void 0:n.toString()),!this.correctResponse){this.correctOption="";return}this.correctOption='<span part="correct-option" style="border:1px solid var(--qti-correct); border-radius:4px; padding: 2px 4px; margin: 4px; display:inline-block">'.concat(this.options.find(function(e){return t.correctResponse===e.value}).textContent,"</span>")}},{key:"choiceSelected",value:function e(e){var t=e.target.value;this.options=this.options.map(function(e){return x(k({},e),{selected:e.value===t})}),this.saveResponse(t)}}],[{key:"styles",get:function e(){return[nS(eS())]}}]);return t}(r4);iD.inputWidthClass=["","qti-input-width-2","qti-input-width-1","qti-input-width-3","qti-input-width-4","qti-input-width-6","qti-input-width-10","qti-input-width-15","qti-input-width-20","qti-input-width-72"],tz([l()],iD.prototype,"options",2),tz([l()],iD.prototype,"correctOption",2),tz([i({attribute:"data-prompt",type:String})],iD.prototype,"dataPrompt",2),tz([t({context:r3,subscribe:!0}),i({attribute:!1})],iD.prototype,"configContext",2),iD=tz([rI("qti-inline-choice-interaction")],iD);var iV=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"connectedCallback",value:function e(){h(f(t.prototype),"connectedCallback",this).call(this),this.addEventListener("click",this._onSelectInlineChoice),this.dispatchEvent(new CustomEvent("qti-inline-choice-register",{bubbles:!0,composed:!0,cancelable:!1}))}},{key:"disconnectedCallback",value:function e(){this.removeEventListener("click",this._onSelectInlineChoice)}},{key:"render",value:function e(){return rl(eT())}},{key:"_onSelectInlineChoice",value:function e(){this.dispatchEvent(new CustomEvent("qti-inline-choice-select",{bubbles:!0,cancelable:!1,composed:!0,detail:{identifier:this.identifier}}))}}],[{key:"styles",get:function e(){return[nS(eM())]}}]);return t}(rP);tz([i({type:String})],iV.prototype,"identifier",2),iV=tz([rI("qti-inline-choice")],iV);var ij=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e.matchMin=0;e.matchMax=1;e.fixed=!1;return e}c(t,[{key:"connectedCallback",value:function e(){h(f(t.prototype),"connectedCallback",this).call(this),this.setAttribute("slot","qti-simple-associable-choice"),this.setAttribute("part","qti-simple-associable-choice")}},{key:"render",value:function e(){return rl(eI())}}]);return t}(tM(rP,"qti-simple-associable-choice"));ij.styles=nS(eO()),tz([i({type:Number,attribute:"match-min"})],ij.prototype,"matchMin",2),tz([i({type:Number,attribute:"match-max"})],ij.prototype,"matchMax",2),tz([i({type:String,attribute:"fixed",converter:{fromAttribute:function(e){return e==="true"},toAttribute:function(e){return String(e)}}})],ij.prototype,"fixed",2),ij=tz([rI("qti-simple-associable-choice")],ij);var iH=nS(eN());var iQ=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e.lastCheckedRadio=null;e.class="";e._response=[];e.responseIdentifier="";e.correctOptions=null;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,i=n.name,o=n.type;n.checked?(e.response?e.response.indexOf(r)===-1&&(o==="radio"&&(e.response=(e.response||[]).filter(function(e){return e.indexOf(i)===-1})),e.response=T(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)?T(e.response):e.response}}))};return e}c(t,[{key:"response",get:function e(){return this.classList.contains("qti-match-tabular")?this._response:h(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:"connectedCallback",value:function e(){var e=this;var n=this,r=function(){return h(f(t.prototype),"connectedCallback",e)};return o(function(){return L(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.response=[];return[2]})}).call(this)}},{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:h(f(t.prototype),"validate",this).call(this)}},{key:"getMatches",value:function e(e){if(!e.correctResponse)return[];var t=Array.isArray(e.correctResponse)?e.correctResponse:[e.correctResponse],n=[];return t&&t.forEach(function(e){var t=e.split(" ");n.push({source:t[0],target:t[1]})}),n}},{key:"toggleInternalCorrectResponse",value:function e(e){var t=this;var n=this.responseVariable;if(!(n===null||n===void 0?void 0:n.correctResponse)){this.querySelectorAll(".correct-option").forEach(function(e){return e.remove()});return}var r=this.getMatches(n);this.class.split(" ").includes("qti-match-tabular")?e?this.correctOptions=r||[]:this.correctOptions=null:e?(this.querySelectorAll(".correct-option").forEach(function(e){return e.remove()}),this.targetChoices.forEach(function(e){var n=e.getAttribute("identifier"),i=r.find(function(e){return e.target===n});if(i===null||i===void 0?void 0:i.source){var o,a,s;var l=(a=t.querySelector('qti-simple-associable-choice[identifier="'.concat(i.source,'"]')))===null||a===void 0?void 0:(o=a.textContent)===null||o===void 0?void 0:o.trim();if(l&&!((s=e.previousElementSibling)===null||s===void 0?void 0:s.classList.contains("correct-option"))){var u=document.createElement("span");u.classList.add("correct-option"),u.textContent=l,u.style.border="1px solid var(--qti-correct)",u.style.borderRadius="4px",u.style.padding="2px 4px",u.style.display="inline-block",e.insertAdjacentElement("beforebegin",u)}}})):this.correctOptions=null}},{key:"toggleCandidateCorrection",value:function e(e){var t=this.responseVariable;if(!(t===null||t===void 0?void 0:t.correctResponse))return;var n=this.getMatches(t);this.targetChoices.forEach(function(t){var r=t.getAttribute("identifier"),i=n.filter(function(e){return e.target===r});t.querySelectorAll("qti-simple-associable-choice").forEach(function(t){var n;if(t.internals.states.delete("candidate-correct"),t.internals.states.delete("candidate-incorrect"),!e)return;((n=i.find(function(e){return e.source===t.identifier}))===null||n===void 0?void 0:n.source)!==void 0?t.internals.states.add("candidate-correct"):t.internals.states.add("candidate-incorrect")})})}},{key:"render",value:function e(){var e=this;var t=this.class.split(" ").includes("qti-match-tabular"),n=this.correctOptions!==null;return rl(ej(),t,t?rl(eV(),this.targetChoices.map(function(e){return rl(eU(),i$(e.innerHTML))}),this.sourceChoices.map(function(t){return rl(eD(),i$(t.innerHTML),e.targetChoices.map(function(r){var i,o,a;var s=t.getAttribute("identifier"),l=r.getAttribute("identifier"),u="".concat(s," ").concat(l),c=(e.response||[]).filter(function(e){return e.split(" ")[0]===s}).length||0,d=((i=e.response)===null||i===void 0?void 0:i.includes(u))||!1,h=t.matchMax===1?"radio":"checkbox",f=!!((o=e.correctOptions)===null||o===void 0?void 0:o.find(function(e){return e.source===s&&e.target===l})),p=h==="radio"?"rb ".concat(d?"rb-checked":""," ").concat(n?f?"rb-correct":"rb-incorrect":""):"cb ".concat(d?"cb-checked":""," ").concat(n?f?"cb-correct":"cb-incorrect":""),v=((a=e.correctOptions)===null||a===void 0?void 0:a.length)>0?!0:t.matchMax===1?!1:t.matchMax!==0&&c>=t.matchMax&&!d;return rl(e$(),h,p,s,u,v,function(t){return e.handleRadioChange(t)},function(n){return t.matchMax===1?e.handleRadioClick(n):null},h==="checkbox"&&d?rl(eL()):"")}))})):rh)}}]);return t}(r1(r4,"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"));iQ.styles=iH,tz([i({type:String})],iQ.prototype,"class",2),tz([l()],iQ.prototype,"_response",2),tz([i({type:String,attribute:"response-identifier"})],iQ.prototype,"responseIdentifier",2),tz([l()],iQ.prototype,"correctOptions",2),iQ=tz([rI("qti-match-interaction")],iQ);var iF=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t);e._value=null;return e}c(t,[{key:"reset",value:function e(){}},{key:"validate",value:function e(){return!0}},{key:"response",get:function e(){return this._value?this._value.toString():null},set:function e(e){if(e)if(!isNaN(parseInt(e===null||e===void 0?void 0:e.toString())))this._value=parseInt(e.toString());else throw new Error("Value must be a number ".concat(e))}},{key:"render",value:function e(){return rl(eH())}},{key:"connectedCallback",value:function e(){var e=this;h(f(t.prototype),"connectedCallback",this).call(this);var n=this.querySelector("audio")||this.querySelector("video")||this.querySelector("object");n&&n.addEventListener("ended",function(){e._value++,e.saveResponse(e.value)})}}],[{key:"properties",get:function e(){return x(k({},r4.properties),{step:{type:Number,attribute:"step",default:10}})}}]);return t}(r4);iF.styles=[nS(eQ())],iF=tz([rI("qti-media-interaction")],iF);var iz=nS(eF());var iB=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e.nrChoices=0;e.correctResponses=[];e.showCorrectResponses=!1;return e}c(t,[{key:"render",value:function e(){var e=Array.from(this.querySelectorAll("qti-simple-choice"));return this.nrChoices<e.length&&(this.nrChoices=e.length),rl(eB(),T(Array(this.nrChoices)).map(function(e,t){return rl(ez(),t)}))}},{key:"toggleCorrectResponse",value:function e(e){var t=this;var n=this.responseVariable;if(this.shadowRoot.querySelectorAll(".correct-option").forEach(function(e){return e.remove()}),e&&(n===null||n===void 0?void 0:n.correctResponse)){var r=(Array.isArray(n.correctResponse)?n.correctResponse:[n.correctResponse]).map(function(e){return e.split(" ")[0]}),i=new Set;this.querySelectorAll("qti-simple-choice").forEach(function(e,n){var o;var a=e.getAttribute("identifier");if(!a||!r.includes(a)||i.has(a))return;i.add(a);var s=(o=e.textContent)===null||o===void 0?void 0:o.trim();if(!s)return;var l=t.shadowRoot.querySelector('drop-list[identifier="droplist'.concat(n,'"]'));if(!l)return;var u=document.createElement("span");u.classList.add("correct-option"),u.textContent=s,u.style.border="1px solid var(--qti-correct)",u.style.borderRadius="4px",u.style.padding="2px 4px",u.style.display="inline-block",u.style.marginTop="4px",l.insertAdjacentElement("afterend",u)})}}},{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(){return Array.from(this.shadowRoot.querySelectorAll("drop-list")).map(function(e){var t=e.querySelectorAll('[qti-draggable="true"]');return T(Array.from(t).map(function(e){return e.getAttribute("identifier")})).join(" ")})}},{key:"firstUpdated",value:function e(e){var n=this;var r=this,i=function(){return h(f(t.prototype),"firstUpdated",n)};return o(function(){return L(this,function(t){i().call(r,e),this.childrenMap=Array.from(this.querySelectorAll("qti-simple-choice")),this.childrenMap.forEach(function(e){return e.setAttribute("part","qti-simple-choice")});return[2]})}).call(this)}}]);return t}(r1(r4,"qti-simple-choice","drop-list","slot[part='drags']"));iB.styles=iz,tz([l()],iB.prototype,"nrChoices",2),tz([l()],iB.prototype,"correctResponses",2),tz([l()],iB.prototype,"showCorrectResponses",2),tz([i({type:String})],iB.prototype,"orientation",2),iB=tz([rI("qti-order-interaction")],iB);var iW=nS(eW());var iJ=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;var n,r=arguments;e=a(this,t,T(r)),n=e;n._iframeLoaded=!1;n._pendingMessages=[];n._responseCheckInterval=null;n.requirePathsJson="";n.requireShimJson="";n.requireJsUrl="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js";n.baseUrl="";n.useIframe=!1;n.useDefaultShims=!1;n.useDefaultPaths=!1;n._errorMessage=null;n.response=[];n._parsedRequirePaths=null;n._parsedRequireShim=null;n.handleIframeMessage=function(e){var t=e.data;if(!(!t||t.source!=="qti-pci-iframe"))switch(t.method){case"iframeReady":n.initializeInteraction(),n.processPendingMessages(),n.dispatchEvent(new CustomEvent("qti-portable-custom-interaction-loaded",{bubbles:!0}));break;case"resize":typeof t.height=="number"&&n.iframe&&(n.iframe.style.height="".concat(t.height,"px"),n.iframe.style.width="".concat(t.width,"px"));break;case"interactionChanged":{var r=n.convertQtiVariableJSON(t.params.value);n.response=r,n.validate(),n.saveResponse(n.response);break}case"error":n._errorMessage=t.params.message,console.error("Error from PCI iframe:",t.params.message);break}};n._onInteractionChanged=function(e){e.stopPropagation();var t=n.convertQtiVariableJSON(e.detail.value);n.response=t,n.saveResponse(t)};n.loadConfig=function(e,t){return o(function(){var r,i,o,a;return L(this,function(o){switch(o.label){case 0:e=n.removeDoubleSlashes(e);o.label=1;case 1:o.trys.push([1,5,,6]);return[4,fetch(e)];case 2:r=o.sent();if(!r.ok)return[3,4];return[4,r.json()];case 3:i=o.sent();for(var s in i.paths)t&&(i.paths[s]=n.getResolvablePath(i.paths[s],t));return[2,i];case 4:return[3,6];case 5:a=o.sent();return[3,6];case 6:return[2,null]}})})()};n.getResolvablePathString=function(e,t){return e=e.replace(/\.js$/,""),(e===null||e===void 0?void 0:e.toLocaleLowerCase().startsWith("http"))||!t?e:n.removeDoubleSlashes("".concat(t,"/").concat(e))};n.getResolvablePath=function(e,t){return Array.isArray(e)?e.map(function(e){return n.getResolvablePathString(e,t)}):n.getResolvablePathString(e,t)};n._previousState=null;return e}c(t,[{key:"getRequirePaths",value:function e(){var e=this;if(this._parsedRequirePaths===null&&this.requirePathsJson)try{var t=JSON.parse(this.requirePathsJson);Array.isArray(t)?(this._parsedRequirePaths={},t.forEach(function(t){t.name&&t.value&&(e._parsedRequirePaths[t.name]=t.value)})):this._parsedRequirePaths=t}catch(e){console.error("Error parsing require paths JSON:",e),this._errorMessage="Error parsing require paths JSON: ".concat(e.message),this._parsedRequirePaths={}}return this._parsedRequirePaths||{}}},{key:"getRequireShim",value:function e(){if(this._parsedRequireShim===null&&this.requireShimJson)try{this._parsedRequireShim=JSON.parse(this.requireShimJson)}catch(e){console.error("Error parsing require shim JSON:",e),this._errorMessage="Error parsing require shim JSON: ".concat(e.message),this._parsedRequireShim={}}return this._parsedRequireShim||{}}},{key:"getDefaultRequirePaths",value:function e(){return{"taoQtiItem/portableLib/OAT/util/event":"/assets/pci-scripts/portableLib/OAT/util/event","taoQtiItem/portableLib/OAT/util/html":"/assets/pci-scripts/portableLib/OAT/util/html","taoQtiItem/portableLib/OAT/util/EventMgr":"/assets/pci-scripts/portableLib/OAT/util/EventMgr","taoQtiItem/portableLib/OAT/util/math":"/assets/pci-scripts/portableLib/OAT/util/math","taoQtiItem/portableLib/OAT/util/xml":"/assets/pci-scripts/portableLib/OAT/util/xml","taoQtiItem/portableLib/OAT/util/tooltip":"/assets/pci-scripts/portableLib/OAT/util/tooltip","taoQtiItem/portableLib/jquery_2_1_1":"/assets/pci-scripts/portableLib/jquery_2_1_1","taoQtiItem/pci-scripts/portableLib/jquery.qtip":"/assets/portableLib/jquery.qtip","taoQtiItem/pci-scripts/portableLib/lodash":"/assets/pci-scripts/portableLib/lodash","taoQtiItem/pci-scripts/portableLib/raphael":"/assets/pci-scripts/portableLib/raphael","IMSGlobal/jquery_2_1_1":"/assets/pci-scripts/IMSGlobal/jquery_2_1_1","OAT/util/event":"/assets/pci-scripts/legacyPortableSharedLib/OAT/util/event","OAT/util/html":"/assets/pci-scripts/legacyPortableSharedLib/OAT/util/html","OAT/util/EventMgr":"/assets/pci-scripts/legacyPortableSharedLib/OAT/util/EventMgr","OAT/util/math":"/assets/pci-scripts/legacyPortableSharedLib/OAT/util/math","OAT/util/xml":"/assets/pci-scripts/legacyPortableSharedLib/OAT/util/xml","OAT/util/tooltip":"/assets/pci-scripts/legacyPortableSharedLib/OAT/util/tooltip","OAT/lodash":"/assets/pci-scripts/legacyPortableSharedLib/lodash",mathJax:"/assets/pci-scripts/mathjax/mathJax",css:"/assets/pci-scripts/css/css"}}},{key:"getDefaultRequireShim",value:function e(){return{mathJax:{exports:"MathJax",init:function e(){var e=window;if(e.MathJax)return e.MathJax.Hub.Config({showMathMenu:!1,showMathMenuMSIE:!1,menuSettings:{inTabOrder:!1}}),e.MathJax.Hub.Startup.MenuZoom=function(){},e.MathJax.Hub.Startup.onload(),e.MathJax}}}}},{key:"getFinalRequirePaths",value:function e(){var e=this.getDefaultRequirePaths(),t=this.getRequirePaths();return this.useDefaultPaths?k({},e,t):t}},{key:"getFinalRequireShim",value:function e(){var e=this.getRequireShim(),t=this.getDefaultRequireShim();return this.useDefaultShims?k({},t,e):e}},{key:"convertQtiVariableJSON",value: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 i=n[r];if(Array.isArray(i))return i.map(String);if(i!=null)return String(i)}}}return null}},{key:"addHyphenatedKeys",value: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}},{key:"responseVariablesToQtiVariableJSON",value:function e(e,t,n){if(t!=="single"){var r={list:{}};return r.list[n]=e,r}else{var i={base:{}};return i.base[n]=e,i}}},{key:"validate",value:function e(){return!0}},{key:"value",get:function e(){var e,t;if(this.useIframe)return((e=this._value)===null||e===void 0?void 0:e.toString())||null;{var n;var r=(n=this.pci)===null||n===void 0?void 0:n.getResponse();if(r){var i=this.convertQtiVariableJSON(r);return Array.isArray(i)?i.join(","):i}}return Array.isArray(this._value)?this._value.join(","):((t=this._value)===null||t===void 0?void 0:t.toString())||null},set:function e(e){e===null?this._value=[]:this._value=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 i,o,a,s,l,u,c,d,h;var f=((a=this.context)===null||a===void 0?void 0:(o=a.variables)===null||o===void 0?void 0:(i=o.find(function(t){return t.identifier===e.responseIdentifier}))===null||i===void 0?void 0:i.cardinality)||"single",p=((u=this.context)===null||u===void 0?void 0:(l=u.variables)===null||l===void 0?void 0:(s=l.find(function(t){return t.identifier===e.responseIdentifier}))===null||s===void 0?void 0:s.baseType)||"string",v=((h=this.context)===null||h===void 0?void 0:(d=h.variables)===null||d===void 0?void 0:(c=d.find(function(t){return t.identifier===e.responseIdentifier}))===null||c===void 0?void 0:c.value)||null,y=this.responseVariablesToQtiVariableJSON(v,f,p);r[this.responseIdentifier]=y}return r},set:function e(e){if(!e||!e[this.responseIdentifier])return;var t=this.convertQtiVariableJSON(e[this.responseIdentifier]);this._value=t,this.saveResponse(t)}},{key:"unescapeHtml",value:function e(e){return e&&e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(///g,"/").replace(/`/g,"`").replace(/=/g,"=")}},{key:"unescapeDataAttributes",value:function e(e){var t={};var n=true,r=false,i=undefined;try{for(var o=Object.entries(e)[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){var s=S(a.value,2),l=s[0],u=s[1];typeof u=="string"?t[l]=this.unescapeHtml(u):t[l]=u}}catch(e){r=true;i=e}finally{try{if(!n&&o.return!=null){o.return()}}finally{if(r){throw i}}}return t}},{key:"register",value:function e(e){var t=this;this.pci=e,this.dom=this.querySelector("qti-interaction-markup"),this.dom||(this.dom=document.createElement("div"),this.appendChild(this.dom)),this.dom.classList.add("qti-customInteraction"),this.dom.style.width="100%",this.dom.style.minHeight="50px",this.dom.style.display="block",this.dom.addEventListener("qti-interaction-changed",this._onInteractionChanged),this.querySelector("properties")&&(this.querySelector("properties").style.display="none");var n={properties:this.addHyphenatedKeys(this.unescapeDataAttributes(k({},this.dataset))),contextVariables:{},templateVariables:{},onready:function(e){t.pci=e;try{var n=new ResizeObserver(function(e){var n=true,r=false,i=undefined;try{for(var o=e[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){var s=a.value;s.contentRect&&s.contentRect.height>0&&(t.style.height="".concat(s.contentRect.height+20,"px"))}}catch(e){r=true;i=e}finally{try{if(!n&&o.return!=null){o.return()}}finally{if(r){throw i}}}});n.observe(t.dom),t._resizeObserver=n}catch(e){console.warn("ResizeObserver not supported, falling back to static sizing")}},ondone:function(e,n,r,i){t.response=t.convertQtiVariableJSON(n),t.saveResponse(t.response)},responseIdentifier:this.responseIdentifier,boundTo:this.boundTo};if(e.getInstance)e.getInstance(this.dom,n,void 0);else{var r=function(e){var t={},n=function(e){var t={};Object.entries(e.dataset).forEach(function(e){var n=S(e,2),r=n[0],i=n[1];r.includes("__")||(t[r]=i)});var n={};return Object.entries(e.dataset).forEach(function(e){var t=S(e,2),r=t[0],i=t[1];var o=r.split("__");if(o.length>1){var a=S(o,3),s=a[0],l=a[1],u=a[2];n[s]=n[s]||{},n[s][l]=n[s][l]||{},n[s][l][u]=i}}),Object.entries(n).forEach(function(e){var n=S(e,2),r=n[0],i=n[1];t[r]=Object.values(i)}),t}(e);for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];r==="config"?t[r]=JSON.parse(i):t[r]=i}return t}(this);e.initialize(this.customInteractionTypeIdentifier,this.dom.firstElementChild||this.dom,Object.keys(r).length?r:null)}}},{key:"disconnectedCallback",value:function e(){if(h(f(t.prototype),"disconnectedCallback",this).call(this),this.useIframe)window.removeEventListener("message",this.handleIframeMessage);else{this.stopResponseCheck(),this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null),requirejs.undef(this.customInteractionTypeIdentifier);var e=requirejs.s.contexts;delete e[this.customInteractionTypeIdentifier],this.removeEventListener("qti-interaction-changed",this._onInteractionChanged)}}},{key:"sendMessageToIframe",value:function e(e,t){if(!this._iframeLoaded){this._pendingMessages.push({method:e,params:t});return}this.iframe.contentWindow.postMessage({source:"qti-portable-custom-interaction",method:e,params:t},"*")}},{key:"processPendingMessages",value:function e(){var e=this;this._pendingMessages.length&&(this._pendingMessages.forEach(function(t){e.sendMessageToIframe(t.method,t.params)}),this._pendingMessages=[])}},{key:"createIframe",value:function e(){var e=this;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,e.addMarkupToIframe(),e.sendIframeInitData()};var t="qti-pci-".concat(this.responseIdentifier,"-").concat(Date.now());this.iframe.name=t;var n=this.generateIframeContent(),r=encodeURIComponent(n);this.iframe.src="data:text/html;charset=utf-8,".concat(r),this.appendChild(this.iframe)}},{key:"sendIframeInitData",value:function e(){var e={module:this.module,customInteractionTypeIdentifier:this.customInteractionTypeIdentifier,baseUrl:this.baseUrl?this.baseUrl.startsWith("http")||this.baseUrl.startsWith("blob")||this.baseUrl.startsWith("base64")?this.baseUrl:tP("".concat(window.location.origin).concat(this.baseUrl)):window.location.origin,responseIdentifier:this.responseIdentifier,dataAttributes:k({},this.dataset),interactionModules:this.getInteractionModules(),boundTo:this.boundTo};this.sendMessageToIframe("initialize",e)}},{key:"getInteractionModules",value:function e(){var e=[],t=this.querySelector("qti-interaction-modules");if(t){var n=t.querySelectorAll("qti-interaction-module");var r=true,i=false,o=undefined;try{for(var a=n[Symbol.iterator](),s;!(r=(s=a.next()).done);r=true){var l=s.value;e.push({id:l.getAttribute("id"),primaryPath:l.getAttribute("primary-path"),fallbackPath:l.getAttribute("fallback-path")})}}catch(e){i=true;o=e}finally{try{if(!r&&a.return!=null){a.return()}}finally{if(i){throw o}}}}return e}},{key:"addMarkupToIframe",value:function e(){var e=this.querySelector("qti-interaction-markup");e&&this.sendMessageToIframe("setMarkup",e.innerHTML);var t=this.querySelector("properties");t&&this.sendMessageToIframe("setProperties",t.innerHTML)}},{key:"initializeInteraction",value:function e(){}},{key:"connectedCallback",value:function e(){var e=this;if(h(f(t.prototype),"connectedCallback",this).call(this),this.useIframe)window.addEventListener("message",this.handleIframeMessage),this.createIframe();else{define("qtiCustomInteractionContext",function(){return{register:function(t){e.register(t)},notifyReady:function(){}}});var n=this.buildRequireConfig();if(n){var r=requirejs.config(n);requirejs.onError=function(e){throw console.error("RequireJS error:",e),e.requireType==="timeout"&&console.error("Modules that timed out:",e.requireModules),e},r(["require"],function(t){try{t([e.module],function(){},function(e){console.error("Error loading module:",e)})}catch(e){console.error("Error in require call:",e)}})}}}},{key:"stopResponseCheck",value:function e(){this._responseCheckInterval!==null&&(window.clearInterval(this._responseCheckInterval),this._responseCheckInterval=null)}},{key:"buildRequireConfig",value:function e(){var e={context:this.customInteractionTypeIdentifier,catchError:!0,paths:k({},this.getFinalRequirePaths(),window.requirePaths||{}),shim:k({},this.getFinalRequireShim(),window.requireShim||{})};if(!globalThis.require)return this._errorMessage="RequireJS not found. Please load it via CDN: https://cdnjs.com/libraries/require.js",null;var t=this.getAttribute("data-base-url"),n=this.querySelector("qti-interaction-modules");if(n){var r=n.querySelectorAll("qti-interaction-module");var i=true,o=false,a=undefined;try{for(var s=r[Symbol.iterator](),l;!(i=(l=s.next()).done);i=true){var u=l.value;var c=u.getAttribute("id"),d=u.getAttribute("primary-path"),h=u.getAttribute("fallback-path");if(c&&d){var f=h?this.combineRequireResolvePaths(this.getResolvablePath(d,t),this.getResolvablePath(h,t)):this.getResolvablePath(d,t),p=e.paths[c]||[];e.paths[c]=this.combineRequireResolvePaths(p,f)}}}catch(e){o=true;a=e}finally{try{if(!i&&s.return!=null){s.return()}}finally{if(o){throw a}}}}return e}},{key:"combineRequireResolvePaths",value:function e(e,t){var n=Array.isArray(e)?e:[e],r=Array.isArray(t)?t:[t];return n.concat(r).filter(function(e,t,n){return n.indexOf(e)===t})}},{key:"removeDoubleSlashes",value:function e(e){return e.replace(/([^:]\/)\/+/g,"$1").replace(/\/\//g,"/").replace("http:/","http://").replace("https:/","https://")}},{key:"generateIframeContent",value:function e(){var e=window.getComputedStyle(document.body),t=JSON.stringify(this.getFinalRequirePaths()),n=JSON.stringify(this.getFinalRequireShim()),r="\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(window.location.origin,'" />\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(r,'\n }\n .qti-customInteraction {\n width: 100%;\n height: 100%;\n }\n #pci-container {\n width: 100%;\n </style>\n <script src="').concat(this.requireJsUrl,'"><\/script>\n <script>\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(this.dataset.baseUrl,"',\n shim: window.requireShim,\n onNodeCreated: function(node, config, moduleName, url) {\n console.log('RequireJS creating node for module:', moduleName, 'URL:', url);\n\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 source: 'qti-pci-iframe',\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 // PCI Manager for iframe implementation\n window.PCIManager = {\n pciInstance: null,\n container: null,\n customInteractionTypeIdentifier: null,\n\n initialize: function(config) {\n this.customInteractionTypeIdentifier = config.customInteractionTypeIdentifier;\n this.container = document.getElementById('pci-container');\n this.container.classList.add('qti-customInteraction');\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 getResolvablePathString(path, basePath) {\n path = path.replace(/\\.js$/, '');\n return path?.toLocaleLowerCase().startsWith('http') || !basePath\n ? path\n : removeDoubleSlashes(`${basePath}/${path}`);\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, module.fallbackPath, config.baseUrl\n );\n window.requirePaths[module.id] = currentPaths.concat(newPath).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: this.addHyphenatedKeys(this.unescapeDataAttributes({ ...config.dataAttributes })),\n contextVariables: config.contextVariables || {},\n templateVariables: config.templateVariables || {},\n onready: pciInstance => {\n this.pciInstance = pciInstance;\n this.notifyReady();\n },\n ondone: (pciInstance, response, state, status) => {\n this.notifyInteractionChanged(response);\n },\n responseIdentifier: config.responseIdentifier,\n boundTo: config.boundTo,\n };\n\n if (pciInstance.getInstance) {\n pciInstance.getInstance(this.container, pciConfig, undefined);\n } else {\n // TAO custom interaction initialization\n const restoreTAOConfig = (dataset) => {\n const config = {};\n const parseDataAttributes = () => {\n const result = {};\n\n // Separate direct attributes from nested ones\n Object.entries(dataset || []).forEach(([key, value]) => {\n if (!key.includes('__')) {\n // Direct attributes (like version)\n result[key] = value;\n }\n });\n\n // Parse nested attributes\n const nestedData = {};\n\n Object.entries(dataset || []).forEach(([key, value]) => {\n const parts = key.split('__');\n if (parts.length > 1) {\n const [group, index, prop] = parts;\n nestedData[group] = nestedData[group] || {};\n nestedData[group][index] = nestedData[group][index] || {};\n nestedData[group][index][prop] = value;\n }\n });\n\n // Convert nested groups to arrays\n Object.entries(nestedData).forEach(([key, group]) => {\n result[key] = Object.values(group);\n });\n return result;\n };\n const data = parseDataAttributes();\n for (const key in data) {\n if (Object.prototype.hasOwnProperty.call(data, key)) {\n const value = data[key];\n if (key === 'config') {\n config[key] = JSON.parse(value);\n } else {\n config[key] = value;\n }\n }\n }\n return config;\n };\n const taoConfig = restoreTAOConfig(config.dataAttributes);\n\n this.pciInstance.initialize(\n this.customInteractionTypeIdentifier,\n this.container.firstElementChild || this.container,\n Object.keys(taoConfig).length ? taoConfig : null\n );\n }\n },\n notifyReady: () => {\n // Notify parent that the PCI is ready\n window.parent.postMessage({\n source: 'qti-pci-iframe',\n method: 'pciReady'\n }, '*');\n }\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], () => {\n }, 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 source: 'qti-pci-iframe',\n method: 'iframeReady'\n }, '*');\n },\n\n notifyInteractionChanged: function(response) {\n window.parent.postMessage({\n source: 'qti-pci-iframe',\n method: 'interactionChanged',\n params: { value: response }\n }, '*');\n },\n\n notifyError: function(message) {\n console.error('PCI Error:', message);\n window.parent.postMessage({\n source: 'qti-pci-iframe',\n method: 'error',\n params: { message: message }\n }, '*');\n },\n\n setMarkup: function(markupHtml) {\n this.container = document.getElementById('pci-container');\n this.container.innerHTML = markupHtml;\n },\n\n addHyphenatedKeys: function(properties) {\n const updatedProperties = { ...properties };\n for (const key in properties) {\n if (Object.prototype.hasOwnProperty.call(properties, key)) {\n const hyphenatedKey = key.replace(/[A-Z]/g, char => `-${char.toLowerCase()}`);\n updatedProperties[hyphenatedKey] = properties[key];\n }\n }\n return updatedProperties;\n },\n unescapeDataAttributes: function(obj) {\n const unescaped = {};\n for (const [key, value] of Object.entries(obj)) {\n if (typeof value === 'string') {\n unescaped[key] = value\n .replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>')\n .replace(/"/g, '\"')\n .replace(/'/g, \"'\")\n .replace(///g, '/')\n .replace(/`/g, '`')\n .replace(/=/g, '=');\n } else {\n unescaped[key] = value;\n }\n }\n return unescaped;\n },\n };\n\n // Set up message listener for communication with parent\n window.addEventListener('message', function(event) {\n const { data } = event;\n\n // Ensure the message is from our parent\n if (!data || data.source !== 'qti-portable-custom-interaction') {\n return;\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 // Handle setting boundTo\n break;\n\n case 'setProperties':\n // Handle setting properties\n break;\n }\n });\n\n // Notify parent that iframe has loaded\n window.addEventListener('load', function() {\n window.parent.postMessage({\n source: 'qti-pci-iframe',\n method: 'iframeLoaded'\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 source: 'qti-pci-iframe',\n method: 'resize',\n height: newHeight,\n width: container.scrollWidth\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.pciInstance && PCIManager.pciInstance.getResponse) {\n const response = PCIManager.pciInstance.getResponse();\n const responseStr = JSON.stringify(response);\n\n if (responseStr !== lastResponseStr) {\n lastResponseStr = responseStr;\n window.parent.postMessage({\n source: 'qti-pci-iframe',\n method: 'interactionChanged',\n params: { value: response }\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 e(e){var t;var n=this.responseVariable;this.correctResponse=e?n===null||n===void 0?void 0:n.correctResponse:n.cardinality==="single"?"":[];var r="correct-response-container-".concat(this.responseIdentifier),i=(t=this.parentElement)===null||t===void 0?void 0:t.querySelectorAll("#".concat(r));if(i&&i.forEach(function(e){e.remove()}),e)this.disable();else{this.enable();return}if(!e||!(n===null||n===void 0?void 0:n.correctResponse))return;var o=document.createElement("div");o.id=r,o.className="pci-correct-response-container",o.style.position="relative",o.style.marginTop="20px",o.style.border="2px solid green",o.style.padding="16px",o.style.borderRadius="4px",o.style.backgroundColor="rgba(0, 128, 0, 0.05)";var a=document.createElement("div");a.textContent="Correct Response:",a.style.fontWeight="bold",a.style.marginBottom="10px",a.style.color="green",o.appendChild(a);var s=document.createElement("qti-portable-custom-interaction");Array.from(this.attributes).forEach(function(e){e.name!=="id"&&e.name!=="response-identifier"&&s.setAttribute(e.name,e.value)});var l=this.responseIdentifier;s.responseIdentifier="".concat(l,"-correct"),Array.from(this.children).forEach(function(e){var t=e.cloneNode(!0);s.appendChild(t)});var u=n.correctResponse;if(this.useIframe){var c=s.connectedCallback;s.connectedCallback=function(){var e=this;c.call(this);var t=function(){return e._iframeLoaded?(setTimeout(function(){var t=e.responseVariablesToQtiVariableJSON(u,n.cardinality,n.baseType);e.sendMessageToIframe("setBoundTo",d({},l,t)),e.sendMessageToIframe("setState",{state:"review"})},1e3),!0):!1};if(!t()){var r=setInterval(function(){t()&&clearInterval(r)},100);setTimeout(function(){clearInterval(r)},1e4)}}}else{var h=s.register;s.register=function(e){var t=this;h.call(this,e);var r=function(){if(t.pci&&typeof t.pci.setResponse=="function"){var e=t.responseVariablesToQtiVariableJSON(u,n.cardinality,n.baseType);return t.pci.setResponse(e),typeof t.pci.setState=="function"&&t.pci.setState("review"),!0}return!1};setTimeout(function(){if(!r()){var e=setInterval(function(){r()&&clearInterval(e)},200);setTimeout(function(){clearInterval(e)},5e3)}},500)}}s.style.pointerEvents="none",o.appendChild(s),this.after(o)}},{key:"disable",value:function e(){if(this._previousState={pointerEvents:this.style.pointerEvents,position:this.style.position},this.useIframe&&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(),this._previousState&&(this._previousState.pointerEvents&&(this.style.pointerEvents=this._previousState.pointerEvents),this._previousState.position&&(this.style.position=this._previousState.position),this._previousState=null),this.useIframe&&this.sendMessageToIframe("setState",{state:"interacting"})}},{key:"render",value:function e(){return rl(eG(),this._errorMessage?rl(eJ(),this._errorMessage):"")}}]);return t}(r4);iJ.styles=[iW,nS(eX())],tz([i({type:String,attribute:"module"})],iJ.prototype,"module",2),tz([i({type:String,attribute:"custom-interaction-type-identifier"})],iJ.prototype,"customInteractionTypeIdentifier",2),tz([i({type:String,attribute:"data-require-paths"})],iJ.prototype,"requirePathsJson",2),tz([i({type:String,attribute:"data-require-shim"})],iJ.prototype,"requireShimJson",2),tz([i({type:String,attribute:"data-require-js-url"})],iJ.prototype,"requireJsUrl",2),tz([i({type:String,attribute:"data-base-url"})],iJ.prototype,"baseUrl",2),tz([i({type:Boolean,attribute:"data-use-iframe"})],iJ.prototype,"useIframe",2),tz([i({type:Boolean,attribute:"data-use-default-shims"})],iJ.prototype,"useDefaultShims",2),tz([i({type:Boolean,attribute:"data-use-default-paths"})],iJ.prototype,"useDefaultPaths",2),tz([l()],iJ.prototype,"_errorMessage",2),tz([t({context:rL,subscribe:!0}),l()],iJ.prototype,"context",2),tz([l()],iJ.prototype,"response",2),iJ=tz([rI("qti-portable-custom-interaction")],iJ);var iG=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"render",value:function e(){return rl(eY())}}]);return t}(rP);iG.styles=[nS(eK())];customElements.define("qti-position-object-interaction",iG);var iX=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t),e.removeMoveListener=e.removeMoveListener.bind(e),e.dragElementHandler=e.dragElementHandler.bind(e);return e}c(t,[{key:"render",value:function e(){return rl(eZ())}},{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;h(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(){h(f(t.prototype),"disconnectedCallback",this).call(this),document.removeEventListener("mousemove",this.dragElementHandler),document.removeEventListener("mouseup",this.removeMoveListener)}}]);return t}(rP);iX.styles=[nS(e0())],iX=tz([rI("qti-position-object-stage")],iX);var iY="important",iK=" !"+iY,iZ=ih(/*#__PURE__*/function(e){"use strict";p(t,e);function t(e){s(this,t);var n;var r;if(n=a(this,t,[e]),e.type!==id.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}c(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=S(t,1),r=n[0];var i=e.element,o=i.style;if(this.ft===void 0)return this.ft=new Set(Object.keys(r)),this.render(r);var a=true,s=false,l=undefined;try{for(var u=this.ft[Symbol.iterator](),c;!(a=(c=u.next()).done);a=true){var d=c.value;r[d]==null&&(this.ft.delete(d),d.includes("-")?o.removeProperty(d):o[d]=null)}}catch(e){s=true;l=e}finally{try{if(!a&&u.return!=null){u.return()}}finally{if(s){throw l}}}for(var h in r){var f=r[h];if(f!=null){this.ft.add(h);var p=typeof f=="string"&&f.endsWith(iK);h.includes("-")||p?o.setProperty(h,p?f.slice(0,-11):f,p?iY:""):o[h]=f}}return rd}}]);return t}(ip));var i0=/*#__PURE__*/function(){"use strict";function e(){s(this,e)}c(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=S(e.split(" ").map(Number),2),i=r[0],o=r[1],a=M(t.split(",")),s=a[0],l=a.slice(1),u=l.map(Number);switch(s.toLowerCase()){case"circle":case"default":{var c=S(u,3),d=c[0],h=c[1],f=c[2];return u.length!==3?(console.warn("Invalid circle definition: ".concat(t)),!1):Math.sqrt(Math.pow(i-d,2)+Math.pow(o-h,2))<=f}case"rect":{var p=S(u,4),v=p[0],y=p[1],m=p[2],g=p[3];return u.length!==4?(console.warn("Invalid rectangle definition: ".concat(t)),!1):i>=v&&i<=m&&o>=y&&o<=g}case"ellipse":{var b=S(u,4),_=b[0],k=b[1],w=b[2],x=b[3];if(u.length!==4)return console.warn("Invalid ellipse definition: ".concat(t)),!1;var E=Math.pow(i-_,2)/Math.pow(w,2),q=Math.pow(o-k,2)/Math.pow(x,2);return E+q<=1}case"poly":{if(u.length<6||u.length%2!==0)return console.warn("Invalid polygon definition: ".concat(t)),!1;var A=[];for(var C=0;C<u.length;C+=2)A.push({x:u[C],y:u[C+1]});return this.isPointInPolygon({x:i,y:o},A)}default:return console.warn("Unsupported shape type: ".concat(s)),!1}}},{key:"isPointInPolygon",value:function e(e,t){var n=!1;for(var r=0,i=t.length-1;r<t.length;i=r++){var o=t[r].x,a=t[r].y,s=t[i].x,l=t[i].y;a>e.y!=l>e.y&&e.x<(s-o)*(e.y-a)/(l-a)+o&&(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),i=parseInt(t,10);if(!isNaN(r)&&!isNaN(i))return r===i;console.error("Cannot convert ".concat(e," and/or ").concat(t," to int."));break}case"float":{var o=parseFloat(e),a=parseFloat(t);if(!isNaN(o)&&!isNaN(a))return o===a;console.error("couldn't convert ".concat(e," and/or ").concat(t," to float."));break}case"pair":case"directedPair":{var s=e.split(" ").sort(),l=t.split(" ").sort();if(s.length===2&&l.length===2)return n==="pair"&&(s.sort(),l.sort()),s.join(" ")===l.join(" ");console.error("compared two pair but one of the values does not have 2 values: 1: ".concat(e," 2: ").concat(t));break}}return!1}}]);return e}();var i1=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e.maxChoices=1/0;e.minChoices=0;e.response=null;e._correctAreas=[];e._responseCorrection=[];e._imgElement=null;e._scaleX=1;e._scaleY=1;e._imageWidthOriginal=0;e._imageHeightOriginal=0;e._onImageClick=function(t){if(e.disabled)return;if(!e._imgElement){console.warn("No <img> element found in <qti-select-point-interaction>");return}e.calculateScale();var n=e._imgElement.getBoundingClientRect(),r=(t.clientX-n.left)*e._scaleX,i=(t.clientY-n.top)*e._scaleY,o="".concat(r.toFixed()," ").concat(i.toFixed());e.maxChoices===1?e.response=[o]:(e.maxChoices===0||(e.response||[]).length<e.maxChoices)&&(e.response=T(e.response||[]).concat([o])),e.saveResponse(e.response)};e._onResize=function(){e.calculateScale()};return e}c(t,[{key:"connectedCallback",value:function e(){h(f(t.prototype),"connectedCallback",this).call(this),window.addEventListener("resize",this._onResize)}},{key:"responsePoints",get:function e(){return(this.response||[]).filter(function(e){return e}).map(function(e){var t=S(e.split(" ").map(Number),2),n=t[0],r=t[1];return{x:n,y:r}})}},{key:"toggleCandidateCorrection",value:function e(e){var t=this;this._responseCorrection=[],e&&this.responsePoints.forEach(function(e){var n=t.responseVariable.areaMapping.areaMapEntries.some(function(n){return i0.isPointInArea("".concat(e.x," ").concat(e.y),"".concat(n.shape,",").concat(n.coords),t.responseVariable.baseType)});t._responseCorrection.push(n)})}},{key:"toggleCorrectResponse",value:function e(e){var t=this.responseVariable;if(!e||!t){this._correctAreas=[];return}var n=t.areaMapping,r=[];if(!n||n.areaMapEntries.length===0)if(t.correctResponse){var i=Array.isArray(t.correctResponse)?t.correctResponse:[t.correctResponse];if(i.length===0||i.find(function(e){return e.split(" ").length<2}))return console.error("No valid correct responses found for the response variable."),null;console.warn("No area mapping found for the response variable. Using the correct responses to display the correct response but it probably won't score correct."),r=i.map(function(e){return{shape:"circle",coords:e.split(" ").join(",").concat(",10"),defaultValue:1,mappedValue:1}})}else{console.error("No area mapping found for the response variable.");return}else r=n.areaMapEntries;this._correctAreas=r.map(function(e){return{coords:e.coords,shape:e.shape}})}},{key:"updated",value:function e(e){h(f(t.prototype),"updated",this).call(this,e);var n=this._imgElement;n&&e.has("_correctAreas")&&this._correctAreas.length>0&&(this.calculateScale(),this.shadowRoot.querySelectorAll("div").forEach(function(e){var t=e.dataset.coord,r=e.dataset.shape;t&&r&&tT(r,t.split(",").map(function(e){return+e}),n,e)}))}},{key:"render",value:function e(){var e=this;var t;return rl(e3(),iq((this.response||[]).filter(function(e){return e}),function(e){return e},function(t,n){var r=S(t.split(" ").map(Number),2),i=r[0],o=r[1],a=i/(e._imageWidthOriginal||1)*100,s=o/(e._imageHeightOriginal||1)*100,l=16,u=l/(e._imageWidthOriginal||1)*100,c=l/(e._imageHeightOriginal||1)*100,d="";return e._responseCorrection[n]===!0?d=" correct":e._responseCorrection[n]===!1&&(d=" incorrect"),rl(e1(),d,iZ({pointerEvents:e.maxChoices===1?"none":"auto",position:"absolute",transform:"translate(-50%, -50%)",left:"".concat(a,"%"),top:"".concat(s,"%"),width:"min(".concat(u,"%, 1rem)"),height:"min(".concat(c,"%, 1rem)"),minWidth:"min(".concat(u,"%, 1rem)"),minHeight:"min(".concat(c,"%, 1rem)"),borderRadius:"50%",background:"red"}),t,e.disabled,function(t){t.stopPropagation(),e.response=(e.response||[]).filter(function(e,t){return t!==n}),e.saveResponse(e.response)})}),iq(((t=this._correctAreas)===null||t===void 0?void 0:t.filter(function(e){return e}))||[],function(e){return e},function(e,t){return rl(e2(),iZ({position:"absolute",pointerEvents:"none",backgroundColor:"var(--qti-correct)",opacity:"0.5"}),e.coords,"correct-response-".concat(t+1),e.shape)}))}},{key:"validate",value:function e(){return this.response!==null&&this.response.length>=this.minChoices&&this.response.length<=this.maxChoices}},{key:"calculateScale",value:function e(){this._imageWidthOriginal=this._imgElement.getAttribute("width")?parseFloat(this._imgElement.getAttribute("width")):this._imgElement.naturalWidth,this._imageHeightOriginal=this._imgElement.getAttribute("height")?parseFloat(this._imgElement.getAttribute("height")):this._imgElement.naturalHeight;var e=this._imgElement.getBoundingClientRect();this._scaleX=e.width===0?1:this._imageWidthOriginal/e.width,this._scaleY=e.height===0?1:this._imageHeightOriginal/e.height}},{key:"firstUpdated",value:function e(){this._imgElement=this.querySelector("img"),this._imgElement?(this.calculateScale(),this._imgElement.addEventListener("click",this._onImageClick)):console.warn("No <img> element found in <qti-select-point-interaction>")}},{key:"disconnectedCallback",value:function e(){h(f(t.prototype),"disconnectedCallback",this).call(this),window.removeEventListener("resize",this._onResize),this._imgElement&&this._imgElement.removeEventListener("click",this._onImageClick)}}]);return t}(r4);i1.styles=[nS(e4())],tz([i({type:Number,attribute:"max-choices"})],i1.prototype,"maxChoices",2),tz([i({type:Number,attribute:"min-choices"})],i1.prototype,"minChoices",2),tz([l()],i1.prototype,"response",2),tz([l()],i1.prototype,"_correctAreas",2),tz([l()],i1.prototype,"_responseCorrection",2),i1=tz([rI("qti-select-point-interaction")],i1);var i2=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e.templateIdentifier=null;e.showHide="show";e.fixed=!1;return e}c(t,[{key:"checked",get:function e(){return this.internals.states.has("--checked")}},{key:"render",value:function e(){return rl(e6(),this.marker?rl(e5(),this.marker):rh)}}]);return t}(tM(rP,"qti-simple-choice"));i2.styles=nS(e9()),tz([i({type:String,attribute:"template-identifier"})],i2.prototype,"templateIdentifier",2),tz([i({type:String,attribute:"show-hide"})],i2.prototype,"showHide",2),tz([i({type:Boolean,converter:{fromAttribute:function(e){return e==="true"},toAttribute:function(e){return String(e)}}})],i2.prototype,"fixed",2),tz([i({type:String,attribute:!1})],i2.prototype,"marker",2),i2=tz([rI("qti-simple-choice")],i2);var i3=nS(e7());var i4=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e._value=0;e._correctResponseNumber=null;e.min=0;e.max=100;e.step=1;return e}c(t,[{key:"validate",value:function e(){return!0}},{key:"connectedCallback",value:function e(){h(f(t.prototype),"connectedCallback",this).call(this),this._updateValue(this.min),this.setAttribute("tabindex","0"),this.setAttribute("role","slider")}},{key:"response",get:function e(){return this._value.toString()},set:function e(e){var t=parseInt(e,10);isNaN(t)||this._updateValue(t)}},{key:"toggleCorrectResponse",value:function e(e){var t=this.responseVariable;if(t===null||t===void 0?void 0:t.correctResponse){if(e){this._correctResponse=t.correctResponse.toString();var n=parseFloat(t.correctResponse.toString());if(isNaN(n))this._correctResponseNumber=null;else{this._correctResponseNumber=n;var r=(this._correctResponseNumber-this.min)/(this.max-this.min)*100;this.style.setProperty("--value-percentage-correct","".concat(r,"%"))}}else this._correctResponseNumber=null;this.requestUpdate()}}},{key:"_updateValue",value:function e(e){var t=this._value;if(this._value=Math.min(this.max,Math.max(this.min,e)),this._value===t)return;var n=(this._value-this.min)/(this.max-this.min)*100;this.style.setProperty("--value-percentage","".concat(n,"%")),this._internals.setFormValue(this.value),this.saveResponse(this.response),this.requestUpdate()}},{key:"render",value:function e(){return rl(te(),this.min,this.max,this._onMouseDown,this._onTouchStart,this.response,this._correctResponseNumber!==null?rl(e8(),this._correctResponseNumber):null)}},{key:"_onMouseDown",value:function e(e){var t=this;this._startDrag(e.pageX);var n=function(e){return t._onDrag(e.pageX)},r=function(){document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",r),t._onDragEnd()};document.addEventListener("mousemove",n),document.addEventListener("mouseup",r)}},{key:"_onTouchStart",value:function e(e){var t=this;this._startDrag(e.touches[0].pageX);var n=function(e){return t._onDrag(e.touches[0].pageX)},r=function(){document.removeEventListener("touchmove",n),document.removeEventListener("touchend",r),t._onDragEnd()};document.addEventListener("touchmove",n,{passive:!1}),document.addEventListener("touchend",r)}},{key:"_startDrag",value:function e(e){this._onDrag(e)}},{key:"_onDrag",value:function e(e){var t=this._rail.getBoundingClientRect(),n=e-t.left,r=Math.min(1,Math.max(0,n/t.width)),i=this.min+Math.round(r*(this.max-this.min)/this.step)*this.step;this._updateValue(i)}},{key:"_onDragEnd",value:function e(){this.dispatchEvent(new Event("change",{bubbles:!0}))}}]);return t}(r4);i4.styles=i3,tz([u("#rail")],i4.prototype,"_rail",2),tz([i({type:Number,attribute:"lower-bound"})],i4.prototype,"min",2),tz([i({type:Number,attribute:"upper-bound"})],i4.prototype,"max",2),tz([i({type:Number,attribute:"step"})],i4.prototype,"step",2),i4=tz([rI("qti-slider-interaction")],i4);var i5=function(e,t){var n;var r=e._$AN;if(r===void 0)return!1;var i=true,o=false,a=undefined;try{for(var s=r[Symbol.iterator](),l;!(i=(l=s.next()).done);i=true){var u=l.value;(n=u._$AO)===null||n===void 0?void 0:n.call(u,t,!1),i5(u,t)}}catch(e){o=true;a=e}finally{try{if(!i&&s.return!=null){s.return()}}finally{if(o){throw a}}}return!0},i6=function(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)},i9=function(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),i7(t)}};var i7=function(e){var t,n;e.type==id.CHILD&&((t=e._$AP)!==null&&t!==void 0?t:e._$AP=tO,(n=e._$AQ)!==null&&n!==void 0?n:e._$AQ=tI)},i8=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments),e._$AN=void 0;return e}c(t,[{key:"_$AT",value:function e(e,n,r){h(f(t.prototype),"_$AT",this).call(this,e,n,r),i9(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,i,o;e!==this.isConnected&&(this.isConnected=e,e?(n=(r=this).reconnected)===null||n===void 0?void 0:n.call(r):(i=(o=this).disconnected)===null||i===void 0?void 0:i.call(o)),t&&(i5(this,e),i6(this))}},{key:"setValue",value:function e(e){if(iy(this._$Ct))this._$Ct._$AI(e,this);else{var t=T(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}(ip);var oe=function(){return new ot},ot=function e(){"use strict";s(this,e)},on=new WeakMap,or=ih(/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"render",value:function e(e){return rh}},{key:"update",value:function e(e,t){var n=S(t,1),r=n[0];var i;var o=r!==this.G;return o&&this.G!==void 0&&this.rt(void 0),(o||this.lt!==this.ct)&&(this.G=r,this.ht=(i=e.options)===null||i===void 0?void 0:i.host,this.rt(this.ct=e.element)),rh}},{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=on.get(n);r===void 0&&(r=new WeakMap,on.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,t;var n;return typeof this.G=="function"?(e=on.get((n=this.ht)!==null&&n!==void 0?n:globalThis))===null||e===void 0?void 0:e.get(this.G):(t=this.G)===null||t===void 0?void 0:t.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}(i8));var oi=nS(tt());var oo=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e.inputRef=oe();e.response=null;e._handleValueChange=function(){e._internals.setFormValue(e.value),e.validate()};return e}c(t,[{key:"value",get:function e(){return this.response||null},set:function e(e){this.response=e||null}},{key:"correctness",get:function e(){var e=this.responseVariable;if(!e||e.value===null)return null;if(e.mapping){var t=e.mapping.mapEntries.reduce(function(e,t){return Math.max(t.mappedValue,e)},0);var n=true,r=false,i=undefined;try{for(var o=e.mapping.mapEntries[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){var s=a.value;var l=s.mapKey,u=e.value;if(s.caseSensitive||(l=l.toLowerCase(),u=u.toLowerCase()),l===u)return s.mappedValue===t?"correct":s.mappedValue<=(e.mapping.defaultValue||0)?"incorrect":"partially-correct"}}catch(e){r=true;i=e}finally{try{if(!n&&o.return!=null){o.return()}}finally{if(r){throw i}}}}return e.correctResponse===e.value?"correct":"incorrect"}},{key:"isInline",get:function e(){return!0}},{key:"validate",value:function e(){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 e=this._input.checkValidity();this._internals.setValidity(e?{}:{customError:!1})}return this.response!==""&&this._input.checkValidity()}},{key:"toggleInternalCorrectResponse",value:function e(e){var t=this.responseVariable;if(e&&(t===null||t===void 0?void 0:t.correctResponse)){var n=t.correctResponse.toString();this._correctResponse=n}else this._correctResponse=null}},{key:"render",value:function e(){var e=this;return rl(tr(),this.responseIdentifier,function(t){e.reportValidity()},function(e){return e.stopImmediatePropagation()},this.textChanged,this.textChanged,this.patternMask=="[0-9]*"?"number":"text",rX(this.placeholderText?this.placeholderText:void 0),this.response,rX(this.patternMask?this.patternMask:void 0),1e3,this.disabled,this.readonly,this._correctResponse?rl(tn(),this._correctResponse):rh)}},{key:"textChanged",value:function e(e){if(this.disabled||this.readonly)return;var t=e.target;this.setEmptyAttribute(t.value),this.response!==t.value&&(this.value=t.value,this.saveResponse(t.value))}},{key:"reportValidity",value:function e(){var e=this.shadowRoot.querySelector("input");if(!e)return!1;var t=this.validate();return t||e.reportValidity(),t}},{key:"reset",value:function e(){this.response=""}},{key:"setEmptyAttribute",value:function e(e){this.setAttribute("empty",e===""?"true":"false")}}]);return t}(r4);oo.styles=oi,tz([i({type:Number,attribute:"expected-length"})],oo.prototype,"expectedLength",2),tz([i({type:String,attribute:"pattern-mask"})],oo.prototype,"patternMask",2),tz([i({type:String,attribute:"placeholder-text"})],oo.prototype,"placeholderText",2),tz([i({type:String,attribute:"data-patternmask-message"})],oo.prototype,"dataPatternmaskMessage",2),tz([l()],oo.prototype,"response",2),tz([u("input")],oo.prototype,"_input",2),tz([g("response",{waitUntilFirstUpdate:!0})],oo.prototype,"_handleValueChange",2),oo=tz([rI("qti-text-entry-interaction")],oo);var oa=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e._file=null;e._base64=null;return e}c(t,[{key:"reset",value:function e(){this._file=null,this._base64=null,this.saveResponse(null)}},{key:"validate",value:function e(){return this._base64!==null}},{key:"response",get:function e(){return this._base64},set:function e(e){if(typeof e=="string")this._base64=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 rl(ti(),this._onFileChange,this.disabled,this.readonly)}},{key:"_onFileChange",value:function e(e){return o(function(){var t,n,r;return L(this,function(i){switch(i.label){case 0:t=e.target;n=t.files&&t.files.length>0;if(!n)return[3,2];this._file=t.files[0];r=this;return[4,this._convertToBase64(this._file)];case 1:n=(r._base64=i.sent(),this.saveResponse(this._base64),this.dispatchEvent(new CustomEvent("qti-interaction-response",{detail:{response:this._base64}})));i.label=2;case 2:n;return[2]}})}).call(this)}},{key:"_convertToBase64",value: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)})}}],[{key:"properties",get:function e(){return k({},r4.properties)}}]);return t}(r4);oa.styles=[nS(to())],oa=tz([rI("qti-upload-interaction")],oa);var os=nS(ta());var ol=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"render",value:function e(){return rl(ts())}}]);return t}(rP);ol.styles=os,ol=tz([rI("qti-item-body")],ol);var ou=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"render",value:function e(){return rl(tl())}},{key:"process",value:function e(){var e=new oc,t=T(this.children);e.process(t)}}]);return t}(rP);ou.styles=[nS(tu())],ou=tz([rI("qti-outcome-processing")],ou);var oc=/*#__PURE__*/function(){"use strict";function e(){s(this,e)}c(e,[{key:"process",value:function e(e){var t=true,n=false,r=undefined;try{for(var i=e[Symbol.iterator](),o;!(t=(o=i.next()).done);t=true){var a=o.value;a.process()}}catch(e){n=true;r=e}finally{try{if(!t&&i.return!=null){i.return()}}finally{if(n){throw r}}}}}]);return e}();var od=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"render",value:function e(){return rl(tc())}},{key:"connectedCallback",value:function e(){this.parentElement.tagName.endsWith("INTERACTION")&&this.setAttribute("slot","prompt")}}]);return t}(rP);od=tz([rI("qti-prompt")],od);var oh='<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>',of='<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>',op='<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 ov=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"render",value:function e(){return rl(td())}},{key:"process",value:function e(){if(!this.closest("qti-assessment-item"))return;var e=T(this.children);var t=true,n=false,r=undefined;try{for(var i=e[Symbol.iterator](),o;!(t=(o=i.next()).done);t=true){var a=o.value;a.process()}}catch(e){n=true;r=e}finally{try{if(!t&&i.return!=null){i.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(this.fragmentFromString(of).firstElementChild.firstElementChild);break}case"map_response_point":{this.appendChild(this.fragmentFromString(op).firstElementChild.firstElementChild);break}case"match_correct":this.appendChild(this.fragmentFromString(oh).firstElementChild.firstElementChild);break}}}},{key:"fragmentFromString",value:function e(e){return document.createRange().createContextualFragment(e)}}]);return t}(rP);ov.styles=[nS(th())],ov=tz([rI("qti-response-processing")],ov);var oy=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"render",value:function e(){return rl(tf())}},{key:"process",value:function e(){throw new Error("Not implemented")}}]);return t}(rP);oy=tz([rI("qti-rule")],oy);var om=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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:rW(n)}})),n)}}]);return t}(oy);tz([i({type:String})],om.prototype,"identifier",2),tz([t({context:rL,subscribe:!0}),l()],om.prototype,"context",2);customElements.define("qti-lookup-outcome-value",om);var og=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"render",value:function e(){return rl(tp())}},{key:"process",value:function e(){var e=T(this.children);for(var t=0;t<e.length;t++){var n=e[t];if(n.calculate()){n.process();return}}}}]);return t}(oy);customElements.define("qti-response-condition",og);var ob=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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 o_(t).process();this.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:e,value:this.formatValue(n)}}))}},{key:"formatValue",value:function e(e){return Array.isArray(e)?e.map(rW):e!==null?rW(e):null}}]);return t}(oy),o_=/*#__PURE__*/function(){"use strict";function e(t){s(this,e);this.expression=t}c(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}();customElements.define("qti-set-outcome-value",ob);var ok=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"render",value:function e(){return rl(tv())}},{key:"calculate",value:function e(){return!0}},{key:"getSubRules",value:function e(){return T(this.children)}},{key:"process",value:function e(){var e=this.getSubRules();for(var t=0;t<e.length;t++)e[t].process()}}]);return t}(rP);customElements.define("qti-response-else",ok);var ow=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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}(ok);customElements.define("qti-response-if",ow);var ox=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"render",value:function e(){return rl(ty(),h(f(t.prototype),"render",this).call(this))}}]);return t}(ow);customElements.define("qti-response-else-if",ox);var oE=Symbol("qtiContext");var oq=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(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 i=t.getResult();return console.debug("values",i),(i===null||i===void 0?void 0:i.length)>0?{identifier:"",baseType:i[0].baseType,value:i.map(function(e){return e.value}),cardinality:"multiple",type:"response"}:null}case"qti-ordered":{var o=t.getResult();return(o===null||o===void 0?void 0:o.length)>0?{identifier:"",baseType:o[0].baseType,value:o.map(function(e){return e.value}),cardinality:"ordered",type:"response"}:null}case"qti-correct":{var a=t.getAttribute("identifier")||"",s=e.context.variables.find(function(e){return e.identifier===a})||null;return{baseType:s.baseType,value:s.correctResponse,cardinality:s.cardinality}}default:{try{var l;return{baseType:"integer",value:((l=t.getResult())===null||l===void 0?void 0:l.toString())||null,cardinality:"single"}}catch(e){console.warn("default not sufficient")}return null}}}).filter(function(e){return e!==null})};return e}c(t,[{key:"render",value:function e(){return rl(tm(),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}(rP);oq.styles=nS(tg()),tz([l()],oq.prototype,"result",2),tz([t({context:rL,subscribe:!0}),l()],oq.prototype,"context",2),tz([t({context:oE,subscribe:!0}),l()],oq.prototype,"qtiContext",2);var oA=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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}(oq);var oC=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"calculate",value:function e(){return this.calculateChildren(Array.from(this.children))}}]);return t}(tN(oA));oC=tz([rI("qti-and")],oC);var oS=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e.baseType="string";return e}c(t,[{key:"getResult",value:function e(){return this.textContent.trim()}}]);return t}(oq);tz([i({type:String,attribute:"base-type"})],oS.prototype,"baseType",2);customElements.define("qti-base-value",oS);var oR=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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}(oq);customElements.define("qti-container-size",oR);var oP=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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,i=n.value;return r.filter(function(e){return i.includes(e)}).length>0}else if(t.baseType==="directedPair"&&n.baseType==="directedPair"&&t.cardinality==="single"){var o=t.value;return n.value.includes(o)}else console.error("unsupported baseType or cardinality in qti contains, only baseType: directedPair and cardinality: multiple is supported")}else console.error("unexpected number of children in qti contains");return!1}}]);return t}(oA);customElements.define("qti-contains",oP);var oM=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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}(oq);customElements.define("qti-correct",oM);var oT=Symbol("testContext");var oI=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e.identifier="";return e}c(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 i;var o=this._testContext.items.find(function(e){return e.identifier===n});if(console.debug("itemContext: ".concat(JSON.stringify(o))),!this._testContext||!o)return console.warn('qti-default: item "'.concat(n,'" not found in test context')),null;var a=(i=this._testContext.items.find(function(e){return e.identifier===n}))===null||i===void 0?void 0:i.variables.find(function(e){return e.identifier===r});return a?a.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 s=this.context.variables.find(function(e){return e.identifier===r});return s?s.defaultValue||null:(console.warn('qti-default: variable "'.concat(r,'" not found in item context')),null)}}]);return t}(oq);tz([i({type:String})],oI.prototype,"identifier",2),tz([t({context:rL,subscribe:!0}),l()],oI.prototype,"context",2),tz([l(),t({context:oT,subscribe:!0})],oI.prototype,"_testContext",2);customElements.define("qti-default",oI);var oO=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e.roundingMode="significantFigures";return e}c(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),i=parseFloat(n.value);if(!isNaN(r)&&!isNaN(i))return this.roundingMode==="significantFigures"?r.toPrecision(this.figures)===i.toPrecision(this.figures):Math.round(r*Math.pow(10,this.figures))/Math.pow(10,this.figures)===Math.round(i*Math.pow(10,this.figures))/Math.pow(10,this.figures);console.error("value cannot be casted to numeric value in equalRounded operator: ".concat(r,", ").concat(i));break}default:{console.error("values other than float and int cannot be used in equalRounded operator.");break}}return!1}return console.error("unexpected number of children in qti-equal-rounded"),null}}]);return t}(oq);tz([i({type:String})],oO.prototype,"roundingMode",2);customElements.define("qti-equal-rounded",oO);var oN=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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}(oq);customElements.define("qti-round",oN);var oU=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e.roundingMode="significantFigures";e.figures=3;return e}c(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"?this._roundToDecimalPlaces(n,this.figures):this._roundToSignificantFigures(n,this.figures):n===1/0?1/0:n===-1/0?-1/0:null}},{key:"_roundToDecimalPlaces",value:function e(e,t){if(e===0)return 0;var n=Math.pow(10,t);return Math.round(e*n)/n}},{key:"_roundToSignificantFigures",value: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}}]);return t}(oq);tz([i({type:String,attribute:"rounding-mode"})],oU.prototype,"roundingMode",2),tz([i({type:Number})],oU.prototype,"figures",2);customElements.define("qti-round-to",oU);var oL=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e.toleranceMode="exact";return e}c(t,[{key:"getResult",value:function e(){if(this.children.length===2){var e=this.getVariables(),t=e[0],n=e[1];return 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):i0.compareSingleValues(t.value,n.value,t.baseType)}return console.error("unexpected number of children in qti-equal"),null}}]);return t}(oq);tz([i({type:String})],oL.prototype,"toleranceMode",2);customElements.define("qti-equal",oL);var o$=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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,i=undefined;try{for(var o=e[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){var s=a.value;if(s.baseType!=="integer")return console.error("qti-gcd requires integer base-type"),null;if(s.value===null||s.value===void 0)return null;if(s.cardinality==="single"){if(Array.isArray(s.value))return console.error("qti-gcd unexpected array value for single cardinality"),null;var l=parseInt(s.value,10);if(isNaN(l))return console.error("qti-gcd non-numerical value"),null;t.push(l)}else if(s.cardinality==="multiple"||s.cardinality==="ordered"){if(!Array.isArray(s.value))return console.error("qti-gcd expected array value for multiple/ordered cardinality"),null;var u=true,c=false,d=undefined;try{for(var h=s.value[Symbol.iterator](),f;!(u=(f=h.next()).done);u=true){var p=f.value;if(p==null)return null;var v=parseInt(p,10);if(isNaN(v))return console.error("qti-gcd non-numerical value"),null;t.push(v)}}catch(e){c=true;d=e}finally{try{if(!u&&h.return!=null){h.return()}}finally{if(c){throw d}}}}else return console.error("qti-gcd unsupported cardinality"),null}}catch(e){r=true;i=e}finally{try{if(!n&&o.return!=null){o.return()}}finally{if(r){throw i}}}return t.length===0?null:this._calculateGcd(t)}},{key:"_calculateGcd",value: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=this._gcdTwoNumbers(t,Math.abs(e[n])),t!==1);n++);return t}},{key:"_gcdTwoNumbers",value: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}}]);return t}(oq);customElements.define("qti-gcd",o$);var oD=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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}(oq);customElements.define("qti-gt",oD);var oV=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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}(oA);customElements.define("qti-gte",oV);var oj=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"getResult",value:function e(){return null}}]);return t}(oq);customElements.define("qti-null",oj);var oH=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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}(oq);customElements.define("qti-is-null",oH);var oQ=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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}(oq);customElements.define("qti-field-value",oQ);var oF=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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}(oq);customElements.define("qti-lt",oF);var oz=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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}(oA);customElements.define("qti-lte",oz);var oB=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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],i=0;var o=true,a=false,s=undefined;try{var l=function(){var e=c.value;var r=n.mapEntries.filter(function(n){return t.baseType==="string"&&!n.caseSensitive?i0.compareSingleValues(n.mapKey.toLowerCase(),e.toLowerCase(),t.baseType):i0.compareSingleValues(n.mapKey,e,t.baseType)}),o=r.reduce(function(e,t){return e.mappedValue>t.mappedValue?e:t},r.length>0?r[0]:{mapKey:null,mappedValue:null});o===null||o.mappedValue==null?i+=n.defaultValue:i+=o.mappedValue};for(var u=r[Symbol.iterator](),c;!(o=(c=u.next()).done);o=true)l()}catch(e){a=true;s=e}finally{try{if(!o&&u.return!=null){u.return()}}finally{if(a){throw s}}}return(n===null||n===void 0?void 0:n.lowerBound)!==null&&(n===null||n===void 0?void 0:n.lowerBound)!==void 0&&(i=Math.max(n.lowerBound,i)),(n===null||n===void 0?void 0:n.upperBound)!==null&&(n===null||n===void 0?void 0:n.upperBound)!==void 0&&(i=Math.min(n.upperBound,i)),i}}]);return t}(oq);tz([i({type:String})],oB.prototype,"identifier",2);customElements.define("qti-map-response",oB);var oW=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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 i=0,o=new Set;var a=true,s=false,l=undefined,u=true,c=false,d=undefined;try{for(var h=r[Symbol.iterator](),f;!(u=(f=h.next()).done);u=true){var p=f.value;try{for(var v=n.areaMapEntries[Symbol.iterator](),y;!(a=(y=v.next()).done);a=true){var m=y.value;if(o.has(m.coords))continue;var g;i0.isPointInArea(p,"".concat(m.shape,",").concat(m.coords),t.baseType)&&(i+=(g=m.mappedValue)!==null&&g!==void 0?g:0,o.add(m.coords))}}catch(e){s=true;l=e}finally{try{if(!a&&v.return!=null){v.return()}}finally{if(s){throw l}}}}}catch(e){c=true;d=e}finally{try{if(!u&&h.return!=null){h.return()}}finally{if(c){throw d}}}return o.size<r.length&&(i+=n.defaultValue),n.lowerBound!=null&&(i=Math.max(n.lowerBound,i)),n.upperBound!=null&&(i=Math.min(n.upperBound,i)),i}}]);return t}(oq);tz([i({type:String})],oW.prototype,"identifier",2);customElements.define("qti-map-response-point",oW);var oJ=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e.name="";return e}c(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,i=undefined;try{for(var o=e[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){var s=a.value;if(s.cardinality!=="single")return console.error("qti-math-operator requires single cardinality"),null;if(Array.isArray(s.value))return console.error("qti-math-operator unexpected array value for single cardinality"),null;if(s.value===null||s.value===void 0)return null;if(s.baseType!=="integer"&&s.baseType!=="float")return console.error("qti-math-operator requires numerical base-type"),null;var l=parseFloat(s.value);if(isNaN(l))return console.error("qti-math-operator non-numerical value"),null;t.push(l)}}catch(e){r=true;i=e}finally{try{if(!n&&o.return!=null){o.return()}}finally{if(r){throw i}}}return this._performOperation(this.name,t)}},{key:"_performOperation",value: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 i=t[0],o=t[1];return i<=0||o<=0||o===1?null:Math.log(i)/Math.log(o)}case"mod":return t.length!==2||t[1]===0?null:t[0]%t[1];case"max":var a;return t.length<1?null:(a=Math).max.apply(a,T(t));case"min":var s;return t.length<1?null:(s=Math).min.apply(s,T(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}}}]);return t}(oq);tz([i({type:String})],oJ.prototype,"name",2);customElements.define("qti-math-operator",oJ);var oG=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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):i0.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(!i0.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 i=0;var o=true,a=false,s=undefined;try{for(var l=t.value[Symbol.iterator](),u;!(o=(u=l.next()).done);o=true){var c=u.value;var d=null,h=T(e.value);var f=true,p=false,v=undefined;try{for(var y=h[Symbol.iterator](),m;!(f=(m=y.next()).done);f=true){var g=m.value;if(i0.compareSingleValues(c,g,t.baseType)){d=g;break}}}catch(e){p=true;v=e}finally{try{if(!f&&y.return!=null){y.return()}}finally{if(p){throw v}}}if(d!==null)h.splice(h.indexOf(d),1);else return!1;i++}}catch(e){a=true;s=e}finally{try{if(!o&&l.return!=null){l.return()}}finally{if(a){throw s}}}return!0}default:return console.error("unexpected cardinality in qti match"),!1}}}]);return t}(oq);customElements.define("qti-match",oG);var oX=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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=S(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 i=n.value;return r.value.includes(i)}}]);return t}(oq);customElements.define("qti-member",oX);var oY=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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 i=e[Symbol.iterator](),o;!(t=(o=i.next()).done);t=true){var a=o.value;if(a.cardinality!=="multiple"&&a.cardinality!=="single")return console.error("unexpected cardinality in qti multiple"),[]}}catch(e){n=true;r=e}finally{try{if(!t&&i.return!=null){i.return()}}finally{if(n){throw r}}}return e}}]);return t}(oq);customElements.define("qti-multiple",oY);var oK=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"render",value:function e(){return rl(tb(),h(f(t.prototype),"render",this).call(this))}},{key:"getResult",value:function e(){return!this.firstElementChild.calculate()}}]);return t}(oq);customElements.define("qti-not",oK);var oZ=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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}(oA);customElements.define("qti-or",oZ);var o0=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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 i=e[Symbol.iterator](),o;!(t=(o=i.next()).done);t=true){var a=o.value;if(a.cardinality!=="ordered"&&a.cardinality!=="single")return console.error("unexpected cardinality in qti ordered"),[]}}catch(e){n=true;r=e}finally{try{if(!t&&i.return!=null){i.return()}}finally{if(n){throw r}}}return e}}]);return t}(oq);customElements.define("qti-ordered",o0);var o1=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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=S(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 i=parseFloat(n.value),o=parseFloat(r.value);if(isNaN(i)||isNaN(o))return console.error("qti-power: non-numerical values encountered"),null;if(i===0&&o<=0||i<0&&!Number.isInteger(o))return null;var a;try{a=Math.pow(i,o)}catch(e){return console.error("qti-power: error calculating power:",e),null}if(isNaN(a))return null;if(a===1/0||a===-1/0)return a;if(!isFinite(a)||Math.abs(a)>Number.MAX_VALUE||a!==0&&Math.abs(a)<Number.MIN_VALUE)return null;if(isFinite(a)&&a!==0){var s=Math.floor(Math.log10(Math.abs(a))),l=Math.max(0,14-s),u=Math.pow(10,l);a=Math.round(a*u)/u}return a}}]);return t}(oq);customElements.define("qti-power",o1);var o2=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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?rh:rl(t_(),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}(rP);tz([i({type:String})],o2.prototype,"identifier",2),tz([t({context:rL,subscribe:!0}),l()],o2.prototype,"context",2);customElements.define("qti-printed-variable",o2);var o3=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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}(oq);customElements.define("qti-product",o3);var o4=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"getResult",value:function e(){return this.calculateChildren(Array.from(this.children))}}]);return t}(tU(oq));customElements.define("qti-subtract",o4);var o5=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e.caseSensitive="true";return e}c(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(),i=this.caseSensitive==="true"?n.value:n.value.toLowerCase();return i0.compareSingleValues(r,i,t.baseType)}return console.error("unexpected number of children in qti-string-match"),null}}]);return t}(oq);tz([i({type:String,attribute:"case-sensitive"})],o5.prototype,"caseSensitive",2);customElements.define("qti-string-match",o5);var o6=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t),e._expression=new o9(Array.from(e.children));return e}c(t,[{key:"getResult",value:function e(){return this._expression.calculate()}}]);return t}(oq),o9=/*#__PURE__*/function(){"use strict";function e(t){s(this,e);this.expressions=t}c(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}();customElements.define("qti-sum",o6);var o7=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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}(oq);customElements.define("qti-variable",o7);var o8=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e.min=0;e.max=10;e.step=1;return e}c(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}(oq);tz([i({type:Number})],o8.prototype,"min",2),tz([i({type:Number})],o8.prototype,"max",2),tz([i({type:Number})],o8.prototype,"step",2);customElements.define("qti-random-integer",o8);var ae=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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}(oq);customElements.define("qti-random",ae);var at=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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 t}(oq);customElements.define("qti-delete",at);var an=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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=this.lookupVariableValue(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}},{key:"lookupVariableValue",value: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)}}]);return t}(oq);tz([i({type:String})],an.prototype,"n",2),an=tz([rI("qti-index")],an);var ar=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"render",value:function e(){return rl(tk())}}]);return t}(rP);ar=tz([rI("qti-content-body")],ar);var ai=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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 rl(tw())}}]);return t}(rP);ai.styles=nS(tx()),tz([i({type:String})],ai.prototype,"id",2),tz([i({type:String})],ai.prototype,"use",2),tz([i({type:String})],ai.prototype,"view",2),tz([i({type:String,attribute:"class"})],ai.prototype,"classNames",2),tz([g("classNames",{waitUntilFirstUpdate:!0})],ai.prototype,"handleclassNamesChange",1),ai=tz([rI("qti-rubric-block")],ai);var ao=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e.styleElement=null;return e}c(t,[{key:"firstUpdated",value:function e(e){var n=this;h(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=n.minifyCss(e);n.styleElement=document.createElement("style"),n.styleElement.media="screen",n.styleElement.textContent="@scope {".concat(t,"}"),n.parentElement?n.parentElement.appendChild(n.styleElement):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 i=this.minifyCss(this.textContent);this.styleElement=document.createElement("style"),this.styleElement.media="screen",this.styleElement.textContent="@scope {".concat(i,"}"),this.parentElement?this.parentElement.appendChild(this.styleElement):console.warn("No parent element to append the scoped stylesheet to.")}}},{key:"minifyCss",value:function e(e){return e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\s+/g," ").replace(/\s*([{}:;])\s*/g,"$1").trim()}},{key:"disconnectedCallback",value:function e(){if(this.styleElement)try{this.styleElement.remove()}catch(e){console.error("Could not remove stylesheet:",e)}h(f(t.prototype),"disconnectedCallback",this).call(this)}}]);return t}(rP);ao=tz([rI("qti-stylesheet")],ao);var aa=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(t,[{key:"render",value:function e(){return rl(tE())}},{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}(rP);aa=tz([rI("qti-variabledeclaration")],aa);var as=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);var e;e=a(this,t,arguments);e.externalScored=null;return e}c(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 rl(tq(),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,i=undefined;try{for(var o=e.querySelectorAll("qti-interpolation-table-entry")[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){var s=a.value;!s.getAttribute("source-value")&&s.getAttribute("target-value")&&console.error("source-value or target-value is missing in qti-interpolation-table-entry");var l=parseFloat(s.getAttribute("source-value")),u=parseFloat(s.getAttribute("target-value"));(isNaN(l)||isNaN(u))&&console.error("source-value or target-value is not a number in qti-interpolation-table-entry"),t.set(l,u)}}catch(e){r=true;i=e}finally{try{if(!n&&o.return!=null){o.return()}}finally{if(r){throw i}}}return t}return null}},{key:"connectedCallback",value:function e(){h(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}(aa);as.styles=[nS(tA())],tz([i({type:String,attribute:"base-type"})],as.prototype,"baseType",2),tz([i({type:String,attribute:"external-scored"})],as.prototype,"externalScored",2),tz([i({type:String})],as.prototype,"identifier",2),tz([i({type:String})],as.prototype,"cardinality",2),tz([t({context:rL,subscribe:!0}),l()],as.prototype,"itemContext",2),as=tz([rI("qti-outcome-declaration")],as);var al=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){s(this,t);return a(this,t,arguments)}c(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 rl(tC(),JSON.stringify(r,null,2))}},{key:"connectedCallback",value:function e(){h(f(t.prototype),"connectedCallback",this).call(this);var e=this.defaultValues(this.cardinality),n={baseType:this.baseType,identifier:this.identifier,correctResponse:this.correctResponse,cardinality:this.cardinality||"single",mapping:this.mapping,defaultValue:e,areaMapping:this.areaMapping,value:null,type:"response",candidateResponse:null};n.value=e,this.dispatchEvent(new CustomEvent("qti-register-variable",{bubbles:!0,composed:!0,detail:{variable:n}}))}},{key:"correctResponse",get: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}},{key:"mapping",get: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}})}}},{key:"areaMapping",get: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")),i=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:i}}}]);return t}(aa);al.styles=[nS(tS())],tz([i({type:String,attribute:"base-type"})],al.prototype,"baseType",2),tz([i({type:String})],al.prototype,"identifier",2),tz([i({type:String})],al.prototype,"cardinality",2),tz([t({context:rL,subscribe:!0}),l()],al.prototype,"itemContext",2),al=tz([rI("qti-response-declaration")],al);return tF(tB)}();
|