@pie-element/multiple-choice 13.2.2-next.0 → 13.2.2-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (185) hide show
  1. package/dist/author/index.js +23 -23
  2. package/dist/author/main.js +67 -67
  3. package/dist/browser/{debounce-PkR6OuzU.js → Radio-DADh6qUM.js} +2549 -2639
  4. package/dist/browser/Radio-DADh6qUM.js.map +1 -0
  5. package/dist/browser/author/index.js +7819 -8261
  6. package/dist/browser/author/index.js.map +1 -1
  7. package/dist/browser/controller/index.js +1 -1
  8. package/dist/browser/controller/index.js.map +1 -1
  9. package/dist/browser/delivery/index.js +9 -8
  10. package/dist/browser/delivery/index.js.map +1 -1
  11. package/dist/browser/dist-nl5urzAW.js +107 -0
  12. package/dist/browser/dist-nl5urzAW.js.map +1 -0
  13. package/dist/browser/{main-CmP4Uwst.js → main-C4I_9OBk.js} +220 -220
  14. package/dist/browser/{main-CmP4Uwst.js.map → main-C4I_9OBk.js.map} +1 -1
  15. package/dist/browser/print/index.js +11 -16
  16. package/dist/browser/print/index.js.map +1 -1
  17. package/dist/controller/index.js +26 -26
  18. package/dist/controller/utils.js +1 -1
  19. package/dist/delivery/choice-input.js +73 -73
  20. package/dist/delivery/index.js +19 -19
  21. package/dist/delivery/multiple-choice.js +72 -72
  22. package/dist/index.iife.js +21 -21
  23. package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js +16 -0
  24. package/dist/print/index.js +10 -11
  25. package/dist/runtime-support.d.ts +12 -0
  26. package/dist/runtime-support.js +12 -0
  27. package/package.json +13 -10
  28. package/dist/browser/_Uint8Array-CUOjhemR.js +0 -396
  29. package/dist/browser/_Uint8Array-CUOjhemR.js.map +0 -1
  30. package/dist/browser/_baseClone-fFvdZAu5.js +0 -245
  31. package/dist/browser/_baseClone-fFvdZAu5.js.map +0 -1
  32. package/dist/browser/debounce-PkR6OuzU.js.map +0 -1
  33. package/dist/browser/isEqual-CnAlrBXo.js +0 -182
  34. package/dist/browser/isEqual-CnAlrBXo.js.map +0 -1
  35. package/dist/browser/isObject-B-uKF3Sg.js +0 -38
  36. package/dist/browser/isObject-B-uKF3Sg.js.map +0 -1
  37. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_DataView.js +0 -6
  38. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Hash.js +0 -16
  39. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_ListCache.js +0 -16
  40. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Map.js +0 -6
  41. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_MapCache.js +0 -16
  42. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Promise.js +0 -6
  43. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Set.js +0 -6
  44. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_SetCache.js +0 -11
  45. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Stack.js +0 -14
  46. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Symbol.js +0 -5
  47. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Uint8Array.js +0 -5
  48. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_WeakMap.js +0 -6
  49. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_apply.js +0 -12
  50. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayEach.js +0 -7
  51. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayFilter.js +0 -10
  52. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayLikeKeys.js +0 -15
  53. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayPush.js +0 -7
  54. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arraySome.js +0 -7
  55. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assignMergeValue.js +0 -8
  56. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assignValue.js +0 -10
  57. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assocIndexOf.js +0 -8
  58. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssign.js +0 -8
  59. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignIn.js +0 -8
  60. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignValue.js +0 -12
  61. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseClone.js +0 -57
  62. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseCreate.js +0 -14
  63. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseFor.js +0 -5
  64. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetAllKeys.js +0 -9
  65. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.js +0 -10
  66. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsArguments.js +0 -9
  67. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqual.js +0 -8
  68. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqualDeep.js +0 -30
  69. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsMap.js +0 -9
  70. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNative.js +0 -11
  71. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsSet.js +0 -9
  72. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsTypedArray.js +0 -11
  73. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeys.js +0 -12
  74. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeysIn.js +0 -13
  75. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseMerge.js +0 -19
  76. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseMergeDeep.js +0 -31
  77. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseRest.js +0 -9
  78. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseSetToString.js +0 -14
  79. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTimes.js +0 -7
  80. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTrim.js +0 -8
  81. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUnary.js +0 -8
  82. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cacheHas.js +0 -6
  83. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneArrayBuffer.js +0 -8
  84. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneBuffer.js +0 -10
  85. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneDataView.js +0 -8
  86. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneRegExp.js +0 -8
  87. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneSymbol.js +0 -8
  88. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneTypedArray.js +0 -8
  89. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyArray.js +0 -8
  90. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyObject.js +0 -14
  91. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbols.js +0 -8
  92. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbolsIn.js +0 -8
  93. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_coreJsData.js +0 -5
  94. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createAssigner.js +0 -15
  95. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createBaseFor.js +0 -12
  96. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_defineProperty.js +0 -10
  97. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalArrays.js +0 -35
  98. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalByTag.js +0 -35
  99. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalObjects.js +0 -32
  100. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.js +0 -4
  101. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeys.js +0 -9
  102. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeysIn.js +0 -9
  103. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getMapData.js +0 -8
  104. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getNative.js +0 -9
  105. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getPrototype.js +0 -5
  106. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.js +0 -14
  107. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbols.js +0 -10
  108. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbolsIn.js +0 -11
  109. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getTag.js +0 -23
  110. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getValue.js +0 -6
  111. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashClear.js +0 -7
  112. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashDelete.js +0 -7
  113. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashGet.js +0 -13
  114. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashHas.js +0 -9
  115. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashSet.js +0 -9
  116. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneArray.js +0 -8
  117. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneByTag.js +0 -33
  118. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneObject.js +0 -9
  119. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIndex.js +0 -8
  120. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIterateeCall.js +0 -12
  121. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKeyable.js +0 -7
  122. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isMasked.js +0 -11
  123. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isPrototype.js +0 -8
  124. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheClear.js +0 -6
  125. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheDelete.js +0 -9
  126. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheGet.js +0 -8
  127. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheHas.js +0 -7
  128. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheSet.js +0 -8
  129. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheClear.js +0 -13
  130. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheDelete.js +0 -8
  131. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheGet.js +0 -7
  132. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheHas.js +0 -7
  133. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheSet.js +0 -8
  134. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapToArray.js +0 -9
  135. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeCreate.js +0 -5
  136. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeys.js +0 -5
  137. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeysIn.js +0 -8
  138. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nodeUtil.js +0 -9
  139. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.js +0 -7
  140. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overArg.js +0 -8
  141. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overRest.js +0 -13
  142. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_root.js +0 -5
  143. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_safeGet.js +0 -6
  144. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheAdd.js +0 -7
  145. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheHas.js +0 -6
  146. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setToArray.js +0 -9
  147. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setToString.js +0 -6
  148. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_shortOut.js +0 -14
  149. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackClear.js +0 -7
  150. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackDelete.js +0 -7
  151. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackGet.js +0 -6
  152. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackHas.js +0 -6
  153. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackSet.js +0 -16
  154. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toSource.js +0 -15
  155. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_trimmedEndIndex.js +0 -8
  156. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/cloneDeep.js +0 -8
  157. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/constant.js +0 -8
  158. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/debounce.js +0 -50
  159. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/defaults.js +0 -16
  160. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/eq.js +0 -6
  161. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/identity.js +0 -6
  162. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArguments.js +0 -10
  163. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArray.js +0 -4
  164. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLike.js +0 -8
  165. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLikeObject.js +0 -8
  166. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isBuffer.js +0 -6
  167. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.js +0 -21
  168. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEqual.js +0 -7
  169. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isFunction.js +0 -11
  170. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isLength.js +0 -7
  171. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isMap.js +0 -7
  172. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObject.js +0 -7
  173. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObjectLike.js +0 -6
  174. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isPlainObject.js +0 -14
  175. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSet.js +0 -7
  176. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSymbol.js +0 -9
  177. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isTypedArray.js +0 -7
  178. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keys.js +0 -9
  179. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keysIn.js +0 -9
  180. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/merge.js +0 -8
  181. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/now.js +0 -7
  182. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubArray.js +0 -6
  183. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubFalse.js +0 -6
  184. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/toNumber.js +0 -19
  185. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/toPlainObject.js +0 -8
@@ -1,31 +1,26 @@
1
- import { Gt as e, I as t, t as n, z as r } from "../debounce-PkR6OuzU.js";
2
- import { t as i } from "../main-CmP4Uwst.js";
3
- import { t as a } from "../_baseClone-fFvdZAu5.js";
1
+ import { F as e, N as t, Vt as n } from "../Radio-DADh6qUM.js";
2
+ import { t as r } from "../main-C4I_9OBk.js";
3
+ import { c as i, l as a } from "../dist-nl5urzAW.js";
4
4
  import o from "react";
5
5
  import { createRoot as s } from "react-dom/client";
6
- //#region ../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/cloneDeep.js
7
- var c = 1, l = 4;
8
- function u(e) {
9
- return a(e, c | l);
10
- }
11
- var d = (0, (/* @__PURE__ */ e(r(), 1)).default)("pie-element:multiple-choice:print"), f = (e, t) => {
6
+ var c = (0, (/* @__PURE__ */ n(e(), 1)).default)("pie-element:multiple-choice:print"), l = (e, t) => {
12
7
  let n = t.role === "instructor";
13
- return e.prompt = e.promptEnabled === !1 ? void 0 : e.prompt, e.teacherInstructions = n && e.teacherInstructionsEnabled !== !1 ? e.teacherInstructions : void 0, e.showTeacherInstructions = n, e.alwaysShowCorrect = n, e.mode = n ? "evaluate" : e.mode, e.disabled = !0, e.animationsDisabled = !0, e.lockChoiceOrder = !0, e.choicesLayout = e.choicesLayout || "vertical", e.choices = u(e.choices).map((t) => (t.rationale = n && e.rationaleEnabled !== !1 ? t.rationale : void 0, t.hideTick = n, t.feedback = void 0, t)), e.keyMode = e.choicePrefix || "letters", e;
14
- }, p = class extends HTMLElement {
8
+ return e.prompt = e.promptEnabled === !1 ? void 0 : e.prompt, e.teacherInstructions = n && e.teacherInstructionsEnabled !== !1 ? e.teacherInstructions : void 0, e.showTeacherInstructions = n, e.alwaysShowCorrect = n, e.mode = n ? "evaluate" : e.mode, e.disabled = !0, e.animationsDisabled = !0, e.lockChoiceOrder = !0, e.choicesLayout = e.choicesLayout || "vertical", e.choices = a(e.choices).map((t) => (t.rationale = n && e.rationaleEnabled !== !1 ? t.rationale : void 0, t.hideTick = n, t.feedback = void 0, t)), e.keyMode = e.choicePrefix || "letters", e;
9
+ }, u = class extends HTMLElement {
15
10
  constructor() {
16
- super(), this._options = null, this._model = null, this._session = [], this._root = null, this._rerender = n(() => {
11
+ super(), this._options = null, this._model = null, this._session = [], this._root = null, this._rerender = i(() => {
17
12
  if (this._model && this._session) {
18
- let e = f(this._model, this._options), n = this._options && o.createElement(i, {
13
+ let e = l(this._model, this._options), n = this._options && o.createElement(r, {
19
14
  model: e,
20
15
  session: {},
21
16
  options: this._options
22
17
  });
23
18
  this._root ||= s(this), this._root.render(n), requestAnimationFrame(() => {
24
19
  requestAnimationFrame(() => {
25
- d("render complete - render math"), t(this);
20
+ c("render complete - render math"), t(this);
26
21
  });
27
22
  });
28
- } else d("skip");
23
+ } else c("skip");
29
24
  }, 50, {
30
25
  leading: !1,
31
26
  trailing: !0
@@ -43,6 +38,6 @@ var d = (0, (/* @__PURE__ */ e(r(), 1)).default)("pie-element:multiple-choice:pr
43
38
  }
44
39
  };
45
40
  //#endregion
46
- export { p as default };
41
+ export { u as default };
47
42
 
48
43
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/cloneDeep.js","../../../src/print/index.tsx"],"sourcesContent":["import baseClone from './_baseClone.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\nfunction cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n}\n\nexport default cloneDeep;\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/multiple-choice/src/print.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport { cloneDeep, debounce } from 'lodash-es';\nimport Main from '../delivery/main.js';\nimport { renderMath } from '@pie-element/shared-math-rendering-mathjax';\nimport debug from 'debug';\n\nconst log = debug('pie-element:multiple-choice:print');\n\n/**\n * Live in same package as main element - so we can access some of the shared comps!\n *\n * - update pslb to build print if src/print.js is there\n * - update demo el\n * - get configure/controller building\n */\n\nconst preparePrintModel = (model, opts) => {\n const instr = opts.role === 'instructor';\n\n model.prompt = model.promptEnabled !== false ? model.prompt : undefined;\n model.teacherInstructions =\n instr && model.teacherInstructionsEnabled !== false ? model.teacherInstructions : undefined;\n model.showTeacherInstructions = instr;\n model.alwaysShowCorrect = instr;\n model.mode = instr ? 'evaluate' : model.mode;\n\n model.disabled = true;\n model.animationsDisabled = true;\n model.lockChoiceOrder = true;\n model.choicesLayout = model.choicesLayout || 'vertical';\n\n const choices = cloneDeep(model.choices);\n\n model.choices = choices.map((c) => {\n c.rationale = instr && model.rationaleEnabled !== false ? c.rationale : undefined;\n c.hideTick = instr;\n c.feedback = undefined;\n return c;\n });\n\n model.keyMode = model.choicePrefix || 'letters';\n\n return model;\n};\n\nexport default class MultipleChoicePrint extends HTMLElement {\n constructor() {\n super();\n this._options = null;\n this._model = null;\n this._session = [];\n this._root = null;\n this._rerender = debounce(\n () => {\n if (this._model && this._session) {\n const printModel = preparePrintModel(this._model, this._options);\n\n const element =\n this._options &&\n React.createElement(Main, {\n model: printModel,\n session: {},\n options: this._options,\n });\n\n if (!this._root) {\n this._root = createRoot(this);\n }\n this._root.render(element);\n // Use double requestAnimationFrame so React has committed to the DOM before we render math\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n log('render complete - render math');\n renderMath(this);\n });\n });\n } else {\n log('skip');\n }\n },\n 50,\n { leading: false, trailing: true },\n );\n }\n set options(o) {\n this._options = o;\n }\n\n set model(s) {\n this._model = s;\n this._rerender();\n }\n\n connectedCallback() {}\n\n disconnectedCallback() {\n if (this._root) {\n this._root.unmount();\n }\n }\n}\n"],"x_google_ignoreList":[0],"mappings":";;;;;;AAGA,IAAI,IAAkB,GAClB,IAAqB;AAoBzB,SAAS,EAAU,GAAO;CACxB,OAAO,EAAU,GAAO,IAAkB,CAAkB;AAC9D;ACTA,IAAM,KAAA,IAAA,wBAAA,GAAA,SAAY,mCAAmC,GAU/C,KAAqB,GAAO,MAAS;CACzC,IAAM,IAAQ,EAAK,SAAS;CAyB5B,OAvBA,EAAM,SAAS,EAAM,kBAAkB,KAAuB,KAAA,IAAf,EAAM,QACrD,EAAM,sBACJ,KAAS,EAAM,+BAA+B,KAAQ,EAAM,sBAAsB,KAAA,GACpF,EAAM,0BAA0B,GAChC,EAAM,oBAAoB,GAC1B,EAAM,OAAO,IAAQ,aAAa,EAAM,MAExC,EAAM,WAAW,IACjB,EAAM,qBAAqB,IAC3B,EAAM,kBAAkB,IACxB,EAAM,gBAAgB,EAAM,iBAAiB,YAI7C,EAAM,UAFU,EAAU,EAAM,OAEhB,EAAQ,KAAK,OAC3B,EAAE,YAAY,KAAS,EAAM,qBAAqB,KAAQ,EAAE,YAAY,KAAA,GACxE,EAAE,WAAW,GACb,EAAE,WAAW,KAAA,GACN,EACR,GAED,EAAM,UAAU,EAAM,gBAAgB,WAE/B;AACT,GAEqB,IAArB,cAAiD,YAAY;CAC3D,cAAc;EAMZ,AALA,MAAM,GACN,KAAK,WAAW,MAChB,KAAK,SAAS,MACd,KAAK,WAAW,CAAC,GACjB,KAAK,QAAQ,MACb,KAAK,YAAY,QACT;GACJ,IAAI,KAAK,UAAU,KAAK,UAAU;IAChC,IAAM,IAAa,EAAkB,KAAK,QAAQ,KAAK,QAAQ,GAEzD,IACJ,KAAK,YACL,EAAM,cAAc,GAAM;KACxB,OAAO;KACP,SAAS,CAAC;KACV,SAAS,KAAK;IAChB,CAAC;IAOH,AALA,AACE,KAAK,UAAQ,EAAW,IAAI,GAE9B,KAAK,MAAM,OAAO,CAAO,GAEzB,4BAA4B;KAC1B,4BAA4B;MAE1B,AADA,EAAI,+BAA+B,GACnC,EAAW,IAAI;KACjB,CAAC;IACH,CAAC;GACH,OACE,EAAI,MAAM;EAEd,GACA,IACA;GAAE,SAAS;GAAO,UAAU;EAAK,CACnC;CACF;CACA,IAAI,QAAQ,GAAG;EACb,KAAK,WAAW;CAClB;CAEA,IAAI,MAAM,GAAG;EAEX,AADA,KAAK,SAAS,GACd,KAAK,UAAU;CACjB;CAEA,oBAAoB,CAAC;CAErB,uBAAuB;EACrB,AAAI,KAAK,SACP,KAAK,MAAM,QAAQ;CAEvB;AACF"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/print/index.tsx"],"sourcesContent":["// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/multiple-choice/src/print.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport { cloneDeep, debounce } from '@pie-element/shared-lodash';\nimport Main from '../delivery/main.js';\nimport { renderMath } from '@pie-element/shared-math-rendering-mathjax';\nimport debug from 'debug';\n\nconst log = debug('pie-element:multiple-choice:print');\n\n/**\n * Live in same package as main element - so we can access some of the shared comps!\n *\n * - update pslb to build print if src/print.js is there\n * - update demo el\n * - get configure/controller building\n */\n\nconst preparePrintModel = (model, opts) => {\n const instr = opts.role === 'instructor';\n\n model.prompt = model.promptEnabled !== false ? model.prompt : undefined;\n model.teacherInstructions =\n instr && model.teacherInstructionsEnabled !== false ? model.teacherInstructions : undefined;\n model.showTeacherInstructions = instr;\n model.alwaysShowCorrect = instr;\n model.mode = instr ? 'evaluate' : model.mode;\n\n model.disabled = true;\n model.animationsDisabled = true;\n model.lockChoiceOrder = true;\n model.choicesLayout = model.choicesLayout || 'vertical';\n\n const choices = cloneDeep(model.choices);\n\n model.choices = choices.map((c) => {\n c.rationale = instr && model.rationaleEnabled !== false ? c.rationale : undefined;\n c.hideTick = instr;\n c.feedback = undefined;\n return c;\n });\n\n model.keyMode = model.choicePrefix || 'letters';\n\n return model;\n};\n\nexport default class MultipleChoicePrint extends HTMLElement {\n constructor() {\n super();\n this._options = null;\n this._model = null;\n this._session = [];\n this._root = null;\n this._rerender = debounce(\n () => {\n if (this._model && this._session) {\n const printModel = preparePrintModel(this._model, this._options);\n\n const element =\n this._options &&\n React.createElement(Main, {\n model: printModel,\n session: {},\n options: this._options,\n });\n\n if (!this._root) {\n this._root = createRoot(this);\n }\n this._root.render(element);\n // Use double requestAnimationFrame so React has committed to the DOM before we render math\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n log('render complete - render math');\n renderMath(this);\n });\n });\n } else {\n log('skip');\n }\n },\n 50,\n { leading: false, trailing: true },\n );\n }\n set options(o) {\n this._options = o;\n }\n\n set model(s) {\n this._model = s;\n this._rerender();\n }\n\n connectedCallback() {}\n\n disconnectedCallback() {\n if (this._root) {\n this._root.unmount();\n }\n }\n}\n"],"mappings":";;;;;AAiBA,IAAM,KAAA,IAAA,wBAAA,GAAA,SAAY,mCAAmC,GAU/C,KAAqB,GAAO,MAAS;CACzC,IAAM,IAAQ,EAAK,SAAS;CAyB5B,OAvBA,EAAM,SAAS,EAAM,kBAAkB,KAAuB,KAAA,IAAf,EAAM,QACrD,EAAM,sBACJ,KAAS,EAAM,+BAA+B,KAAQ,EAAM,sBAAsB,KAAA,GACpF,EAAM,0BAA0B,GAChC,EAAM,oBAAoB,GAC1B,EAAM,OAAO,IAAQ,aAAa,EAAM,MAExC,EAAM,WAAW,IACjB,EAAM,qBAAqB,IAC3B,EAAM,kBAAkB,IACxB,EAAM,gBAAgB,EAAM,iBAAiB,YAI7C,EAAM,UAFU,EAAU,EAAM,OAEhB,EAAQ,KAAK,OAC3B,EAAE,YAAY,KAAS,EAAM,qBAAqB,KAAQ,EAAE,YAAY,KAAA,GACxE,EAAE,WAAW,GACb,EAAE,WAAW,KAAA,GACN,EACR,GAED,EAAM,UAAU,EAAM,gBAAgB,WAE/B;AACT,GAEqB,IAArB,cAAiD,YAAY;CAC3D,cAAc;EAMZ,AALA,MAAM,GACN,KAAK,WAAW,MAChB,KAAK,SAAS,MACd,KAAK,WAAW,CAAC,GACjB,KAAK,QAAQ,MACb,KAAK,YAAY,QACT;GACJ,IAAI,KAAK,UAAU,KAAK,UAAU;IAChC,IAAM,IAAa,EAAkB,KAAK,QAAQ,KAAK,QAAQ,GAEzD,IACJ,KAAK,YACL,EAAM,cAAc,GAAM;KACxB,OAAO;KACP,SAAS,CAAC;KACV,SAAS,KAAK;IAChB,CAAC;IAOH,AALA,AACE,KAAK,UAAQ,EAAW,IAAI,GAE9B,KAAK,MAAM,OAAO,CAAO,GAEzB,4BAA4B;KAC1B,4BAA4B;MAE1B,AADA,EAAI,+BAA+B,GACnC,EAAW,IAAI;KACjB,CAAC;IACH,CAAC;GACH,OACE,EAAI,MAAM;EAEd,GACA,IACA;GAAE,SAAS;GAAO,UAAU;EAAK,CACnC;CACF;CACA,IAAI,QAAQ,GAAG;EACb,KAAK,WAAW;CAClB;CAEA,IAAI,MAAM,GAAG;EAEX,AADA,KAAK,SAAS,GACd,KAAK,UAAU;CACjB;CAEA,oBAAoB,CAAC;CAErB,uBAAuB;EACrB,AAAI,KAAK,SACP,KAAK,MAAM,QAAQ;CAEvB;AACF"}
@@ -1,6 +1,6 @@
1
- import e from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.js";
2
- import { isResponseCorrect as t } from "./utils.js";
3
- import n from "./defaults.js";
1
+ import { isResponseCorrect as e } from "./utils.js";
2
+ import t from "./defaults.js";
3
+ import { isEmpty as n } from "@pie-element/shared-lodash";
4
4
  import { getShuffledChoices as r, lockChoices as i, partialScoring as a } from "@pie-element/shared-controller-utils";
5
5
  //#region src/controller/index.ts
6
6
  var o = (e, t, n) => (r) => {
@@ -15,21 +15,21 @@ var o = (e, t, n) => (r) => {
15
15
  return o;
16
16
  };
17
17
  function s(e = {}) {
18
- return new Promise((t) => t({
19
- ...n,
18
+ return new Promise((n) => n({
19
+ ...t,
20
20
  ...e
21
21
  }));
22
22
  }
23
23
  var c = (e) => {
24
- let { verticalMode: t, choicesLayout: r, ...i } = e || {};
24
+ let { verticalMode: n, choicesLayout: r, ...i } = e || {};
25
25
  return {
26
- ...n,
26
+ ...t,
27
27
  ...i,
28
- choicesLayout: r || t === !1 && "horizontal" || n.choicesLayout
28
+ choicesLayout: r || n === !1 && "horizontal" || t.choicesLayout
29
29
  };
30
30
  };
31
- async function l(e, n, a, s) {
32
- let l = c(e), u = Object.assign({
31
+ async function l(t, n, a, s) {
32
+ let l = c(t), u = Object.assign({
33
33
  correct: "Correct",
34
34
  incorrect: "Incorrect"
35
35
  }, l.defaultFeedback), d = (l.choices || []).map(o(l, a, u));
@@ -43,7 +43,7 @@ async function l(e, n, a, s) {
43
43
  choiceMode: l.choiceMode,
44
44
  keyMode: l.choicePrefix,
45
45
  choices: d,
46
- responseCorrect: a.mode === "evaluate" ? t(l, n) : void 0,
46
+ responseCorrect: a.mode === "evaluate" ? e(l, n) : void 0,
47
47
  language: l.language,
48
48
  extraCSSRules: l.extraCSSRules,
49
49
  fontSizeFactor: l.fontSizeFactor,
@@ -63,9 +63,9 @@ async function l(e, n, a, s) {
63
63
  }, { role: p, mode: m } = a || {};
64
64
  return p === "instructor" && (m === "view" || m === "evaluate") ? f.teacherInstructions = l.teacherInstructionsEnabled ? l.teacherInstructions : null : f.teacherInstructions = null, f;
65
65
  }
66
- var u = (t, n) => {
67
- if (!n || e(n)) return 0;
68
- let r = n.value || [], i = (t.choices || []).filter((e) => e.correct), a = r.reduce((e, t) => e + +!!i.find((e) => e.value === t), 0);
66
+ var u = (e, t) => {
67
+ if (!t || n(t)) return 0;
68
+ let r = t.value || [], i = (e.choices || []).filter((e) => e.correct), a = r.reduce((e, t) => e + +!!i.find((e) => e.value === t), 0);
69
69
  i.length < r.length && (a -= r.length - i.length, a < 0 && (a = 0));
70
70
  let o = i.length ? a / i.length : 0;
71
71
  return parseFloat(o.toFixed(2));
@@ -82,19 +82,19 @@ var u = (t, n) => {
82
82
  let d = u(e, t);
83
83
  return r.push(`Final score: ${d}.`), r;
84
84
  };
85
- function f(t, n, r) {
85
+ function f(e, t, r) {
86
86
  return new Promise((i) => {
87
- if (!n || e(n)) i({
87
+ if (!t || n(t)) i({
88
88
  score: 0,
89
89
  empty: !0,
90
90
  traceLog: ["Student did not select any answers. Score is 0."]
91
91
  });
92
92
  else {
93
- let e = d(t, n, r), o = u(t, n);
93
+ let n = d(e, t, r), o = u(e, t);
94
94
  i({
95
- score: a.enabled(t, r) && t.choiceMode !== "radio" ? o : +(o === 1),
95
+ score: a.enabled(e, r) && e.choiceMode !== "radio" ? o : +(o === 1),
96
96
  empty: !1,
97
- traceLog: e
97
+ traceLog: n
98
98
  });
99
99
  }
100
100
  });
@@ -107,18 +107,18 @@ var p = (e, t) => new Promise((n) => {
107
107
  value: t.filter((e) => e.correct).map((e) => e.value)
108
108
  });
109
109
  } else n(null);
110
- }), m = (e) => (e || "").replace(/(<(?!img|iframe|source)([^>]+)>)/gi, ""), h = (t = {}, n = {}) => {
111
- let { choices: r } = t, { minAnswerChoices: i = 2, maxAnswerChoices: a } = n, o = [...r || []].reverse(), s = {}, c = {}, l = {};
112
- ["teacherInstructions", "prompt"].forEach((e) => {
113
- n[e]?.required && !m(t[e]) && (l[e] = "This field is required.");
110
+ }), m = (e) => (e || "").replace(/(<(?!img|iframe|source)([^>]+)>)/gi, ""), h = (e = {}, t = {}) => {
111
+ let { choices: r } = e, { minAnswerChoices: i = 2, maxAnswerChoices: a } = t, o = [...r || []].reverse(), s = {}, c = {}, l = {};
112
+ ["teacherInstructions", "prompt"].forEach((n) => {
113
+ t[n]?.required && !m(e[n]) && (l[n] = "This field is required.");
114
114
  });
115
115
  let u = !1;
116
- o.forEach((e, t) => {
116
+ o.forEach((e, n) => {
117
117
  let { correct: r, value: i, label: a, rationale: l } = e;
118
- r && (u = !0), m(a) ? o.slice(t + 1).some((e) => e.label === a) && (s[i] = "Content should be unique.") : s[i] = "Content should not be empty.", n.rationale?.required && !m(l) && (c[i] = "This field is required.");
118
+ r && (u = !0), m(a) ? o.slice(n + 1).some((e) => e.label === a) && (s[i] = "Content should be unique.") : s[i] = "Content should not be empty.", t.rationale?.required && !m(l) && (c[i] = "This field is required.");
119
119
  });
120
120
  let d = (r || []).length;
121
- return d < i ? l.answerChoices = `There should be at least ${i} choices defined.` : d > a && (l.answerChoices = `No more than ${a} choices should be defined.`), u || (l.correctResponse = "No correct response defined."), e(s) || (l.choices = s), e(c) || (l.rationale = c), l;
121
+ return d < i ? l.answerChoices = `There should be at least ${i} choices defined.` : d > a && (l.answerChoices = `No more than ${a} choices should be defined.`), u || (l.correctResponse = "No correct response defined."), n(s) || (l.choices = s), n(c) || (l.rationale = c), l;
122
122
  };
123
123
  //#endregion
124
124
  export { p as createCorrectResponseSession, s as createDefaultModel, d as getLogTrace, u as getScore, l as model, c as normalize, f as outcome, h as validate };
@@ -1,4 +1,4 @@
1
- import e from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEqual.js";
1
+ import { isEqual as e } from "@pie-element/shared-lodash";
2
2
  //#region src/controller/utils.ts
3
3
  var t = (e) => e.filter((e) => e.correct).map((e) => e.value).sort(), n = (n, r) => {
4
4
  let i = t(n.choices);
@@ -1,10 +1,10 @@
1
- import e from "./feedback-tick.js";
2
- import t from "react";
3
- import n from "prop-types";
4
- import * as r from "@pie-lib/render-ui";
5
- import { Feedback as i, PreviewPrompt as a, color as o } from "@pie-lib/render-ui";
6
- import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
7
- import u from "classnames";
1
+ import e from "../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
2
+ import t from "./feedback-tick.js";
3
+ import n from "react";
4
+ import r from "prop-types";
5
+ import * as i from "@pie-lib/render-ui";
6
+ import { Feedback as a, PreviewPrompt as o, color as s } from "@pie-lib/render-ui";
7
+ import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
8
8
  import { styled as d } from "@mui/material/styles";
9
9
  import f from "@mui/material/Box";
10
10
  import p from "@mui/material/FormControlLabel";
@@ -17,18 +17,18 @@ function g(e) {
17
17
  function _(e, t) {
18
18
  return !e || g(e) ? e : g(e.default) ? e.default : t && g(e[t]) ? e[t] : t && g(e[t]?.default) ? e[t].default : e;
19
19
  }
20
- var v = _(a, "PreviewPrompt") || _(S.PreviewPrompt, "PreviewPrompt"), y = _(i, "Feedback") || _(S.Feedback, "Feedback"), b = r, x = b.default, S = x && typeof x == "object" ? x : b, C = "multiple-choice-component", w = d(f)({
20
+ var v = _(o, "PreviewPrompt") || _(S.PreviewPrompt, "PreviewPrompt"), y = _(a, "Feedback") || _(S.Feedback, "Feedback"), b = i, x = b.default, S = x && typeof x == "object" ? x : b, C = "multiple-choice-component", w = d(f)({
21
21
  display: "flex",
22
22
  alignItems: "center",
23
- backgroundColor: o.background()
23
+ backgroundColor: s.background()
24
24
  }), T = d(f)({
25
25
  display: "flex",
26
26
  alignItems: "center",
27
- backgroundColor: o.background(),
27
+ backgroundColor: s.background(),
28
28
  flex: 1,
29
29
  "& .MuiFormControlLabel-root": { marginLeft: "-14px" },
30
30
  "& label": {
31
- color: o.text(),
31
+ color: s.text(),
32
32
  "& > span": { fontSize: "inherit" },
33
33
  "& > .MuiButtonBase-root": { padding: "12px" }
34
34
  }
@@ -45,8 +45,8 @@ var v = _(a, "PreviewPrompt") || _(S.PreviewPrompt, "PreviewPrompt"), y = _(i, "
45
45
  overflow: "hidden"
46
46
  }), O = d(p)({
47
47
  "& .MuiFormControlLabel-label": {
48
- color: `${o.text()} !important`,
49
- backgroundColor: o.background(),
48
+ color: `${s.text()} !important`,
49
+ backgroundColor: s.background(),
50
50
  letterSpacing: "normal"
51
51
  },
52
52
  "&.Mui-disabled *": { cursor: "not-allowed !important" }
@@ -54,30 +54,30 @@ var v = _(a, "PreviewPrompt") || _(S.PreviewPrompt, "PreviewPrompt"), y = _(i, "
54
54
  let t = (t) => e ? `${e}-${t}` : t;
55
55
  return {
56
56
  [t("root")]: {
57
- ...k("color", o.text()),
58
- ...e ? {} : { "&:hover": { color: `${o.primaryLight()} !important` } },
59
- ...e === "correct" ? k("correct-color", o.text()) : {},
60
- ...e === "incorrect" ? k("incorrect-color", o.incorrect()) : {}
57
+ ...k("color", s.text()),
58
+ ...e ? {} : { "&:hover": { color: `${s.primaryLight()} !important` } },
59
+ ...e === "correct" ? k("correct-color", s.text()) : {},
60
+ ...e === "incorrect" ? k("incorrect-color", s.incorrect()) : {}
61
61
  },
62
62
  [t("checked")]: {
63
- ...e === "correct" ? k("correct-selected-color", o.correct()) : {},
64
- ...e === "incorrect" ? k("incorrect-checked", o.incorrect()) : {},
65
- ...e ? {} : k("selected-color", o.primary())
63
+ ...e === "correct" ? k("correct-selected-color", s.correct()) : {},
64
+ ...e === "incorrect" ? k("incorrect-checked", s.incorrect()) : {},
65
+ ...e ? {} : k("selected-color", s.primary())
66
66
  },
67
67
  [t("disabled")]: {
68
- ...k("disabled-color", o.text()),
69
- ...e === "correct" ? k("correct-disabled-color", o.disabled()) : {},
70
- ...e === "incorrect" ? k("incorrect-disabled-color", o.disabled()) : {},
68
+ ...k("disabled-color", s.text()),
69
+ ...e === "correct" ? k("correct-disabled-color", s.disabled()) : {},
70
+ ...e === "incorrect" ? k("incorrect-disabled-color", s.disabled()) : {},
71
71
  opacity: .6,
72
72
  cursor: "not-allowed !important",
73
73
  pointerEvents: "initial !important"
74
74
  },
75
75
  focusVisibleUnchecked: {
76
- outline: `2px solid ${o.keyBoardFocusIndicator()}`,
76
+ outline: `2px solid ${s.keyBoardFocusIndicator()}`,
77
77
  backgroundColor: "transparent"
78
78
  },
79
79
  focusVisibleChecked: {
80
- outline: `2px solid ${o.keyBoardFocusIndicator()}`,
80
+ outline: `2px solid ${s.keyBoardFocusIndicator()}`,
81
81
  backgroundColor: "transparent"
82
82
  }
83
83
  };
@@ -95,10 +95,10 @@ var v = _(a, "PreviewPrompt") || _(S.PreviewPrompt, "PreviewPrompt"), y = _(i, "
95
95
  }
96
96
  };
97
97
  }), M = (e) => {
98
- let { correctness: t, checked: n, onChange: r, disabled: i, value: a, id: o, onKeyDown: s, inputRef: l } = e;
99
- return /* @__PURE__ */ c(j, {
98
+ let { correctness: t, checked: n, onChange: r, disabled: i, value: a, id: o, onKeyDown: s, inputRef: c } = e;
99
+ return /* @__PURE__ */ l(j, {
100
100
  id: o,
101
- slotProps: { input: { ref: l } },
101
+ slotProps: { input: { ref: c } },
102
102
  onKeyDown: s,
103
103
  disableRipple: !0,
104
104
  checked: n,
@@ -123,10 +123,10 @@ var v = _(a, "PreviewPrompt") || _(S.PreviewPrompt, "PreviewPrompt"), y = _(i, "
123
123
  }
124
124
  };
125
125
  }), P = (e) => {
126
- let { correctness: t, checked: n, onChange: r, disabled: i, value: a, id: o, tagName: s, inputRef: l } = e;
127
- return /* @__PURE__ */ c(N, {
126
+ let { correctness: t, checked: n, onChange: r, disabled: i, value: a, id: o, tagName: s, inputRef: c } = e;
127
+ return /* @__PURE__ */ l(N, {
128
128
  id: o,
129
- slotProps: { input: { ref: l } },
129
+ slotProps: { input: { ref: c } },
130
130
  disableRipple: !0,
131
131
  checked: n,
132
132
  onChange: r,
@@ -136,28 +136,28 @@ var v = _(a, "PreviewPrompt") || _(S.PreviewPrompt, "PreviewPrompt"), y = _(i, "
136
136
  className: C,
137
137
  name: s
138
138
  });
139
- }, F = class extends t.Component {
139
+ }, F = class extends n.Component {
140
140
  static propTypes = {
141
- choiceMode: n.oneOf(["radio", "checkbox"]),
142
- displayKey: n.string,
143
- checked: n.bool.isRequired,
144
- correctness: n.string,
145
- disabled: n.bool.isRequired,
146
- feedback: n.string,
147
- label: n.string.isRequired,
148
- rationale: n.string,
149
- onChange: n.func.isRequired,
150
- value: n.string.isRequired,
151
- className: n.string,
152
- tagName: n.string,
153
- hideTick: n.bool,
154
- isEvaluateMode: n.bool,
155
- choicesLayout: n.oneOf([
141
+ choiceMode: r.oneOf(["radio", "checkbox"]),
142
+ displayKey: r.string,
143
+ checked: r.bool.isRequired,
144
+ correctness: r.string,
145
+ disabled: r.bool.isRequired,
146
+ feedback: r.string,
147
+ label: r.string.isRequired,
148
+ rationale: r.string,
149
+ onChange: r.func.isRequired,
150
+ value: r.string.isRequired,
151
+ className: r.string,
152
+ tagName: r.string,
153
+ hideTick: r.bool,
154
+ isEvaluateMode: r.bool,
155
+ choicesLayout: r.oneOf([
156
156
  "vertical",
157
157
  "grid",
158
158
  "horizontal"
159
159
  ]),
160
- isSelectionButtonBelow: n.bool
160
+ isSelectionButtonBelow: r.bool
161
161
  };
162
162
  static defaultProps = {
163
163
  rationale: null,
@@ -189,7 +189,7 @@ var v = _(a, "PreviewPrompt") || _(S.PreviewPrompt, "PreviewPrompt"), y = _(i, "
189
189
  c && c.focus();
190
190
  };
191
191
  render() {
192
- let { choiceMode: t, disabled: n, displayKey: r, feedback: i, label: a, correctness: o, className: d, rationale: f, hideTick: p, isEvaluateMode: m, choicesLayout: h, value: g, checked: _, tagName: b, isSelectionButtonBelow: x } = this.props, S = t === "checkbox" ? M : P, k = t === "checkbox" ? "checkbox" : "radio-button", A = {
192
+ let { choiceMode: n, disabled: r, displayKey: i, feedback: a, label: o, correctness: s, className: d, rationale: f, hideTick: p, isEvaluateMode: m, choicesLayout: h, value: g, checked: _, tagName: b, isSelectionButtonBelow: x } = this.props, S = n === "checkbox" ? M : P, k = n === "checkbox" ? "checkbox" : "radio-button", A = {
193
193
  ...h === "horizontal" && { [`& .${C}`]: {
194
194
  padding: "8px",
195
195
  margin: "4px 0 4px 4px"
@@ -199,55 +199,55 @@ var v = _(a, "PreviewPrompt") || _(S.PreviewPrompt, "PreviewPrompt"), y = _(i, "
199
199
  justifyContent: "center",
200
200
  "& > label": { alignItems: "center" }
201
201
  }
202
- }, j = typeof a == "string" && (a.includes("<math") || a.includes("\\(") || a.includes("\\[") || a.includes("<img") || a.includes("data-latex") || a.includes("data-raw") || a.includes("<mjx-container")), N = r ? /* @__PURE__ */ c(D, {
202
+ }, j = typeof o == "string" && (o.includes("<math") || o.includes("\\(") || o.includes("\\[") || o.includes("<img") || o.includes("data-latex") || o.includes("data-raw") || o.includes("<mjx-container")), N = i ? /* @__PURE__ */ l(D, {
203
203
  id: this.descId,
204
- children: j ? `Pick the answer below, ${r}` : r
205
- }) : null, F = /* @__PURE__ */ c(s, { children: r && !x ? /* @__PURE__ */ l(w, {
204
+ children: j ? `Pick the answer below, ${i}` : i
205
+ }) : null, F = /* @__PURE__ */ l(c, { children: i && !x ? /* @__PURE__ */ u(w, {
206
206
  component: "span",
207
- children: [/* @__PURE__ */ l("span", {
207
+ children: [/* @__PURE__ */ u("span", {
208
208
  "aria-hidden": "true",
209
209
  children: [
210
- r,
210
+ i,
211
211
  ".",
212
212
  "\xA0"
213
213
  ]
214
- }), /* @__PURE__ */ c(v, {
214
+ }), /* @__PURE__ */ l(v, {
215
215
  className: "prompt-label",
216
- prompt: a,
216
+ prompt: o,
217
217
  tagName: "span"
218
218
  })]
219
- }) : /* @__PURE__ */ c(v, {
219
+ }) : /* @__PURE__ */ l(v, {
220
220
  className: "prompt-label",
221
- prompt: a,
221
+ prompt: o,
222
222
  tagName: "span"
223
223
  }) }), I = {
224
- disabled: n,
224
+ disabled: r,
225
225
  checked: _,
226
- correctness: o,
226
+ correctness: s,
227
227
  tagName: b,
228
228
  value: g,
229
229
  id: this.choiceId,
230
230
  onChange: this.onToggleChoice,
231
231
  onKeyDown: this.handleKeyDown,
232
232
  ...N ? { "aria-describedby": this.descId } : {}
233
- }, L = x ? /* @__PURE__ */ l(E, { children: [
233
+ }, L = x ? /* @__PURE__ */ u(E, { children: [
234
234
  N,
235
- /* @__PURE__ */ c(S, {
235
+ /* @__PURE__ */ l(S, {
236
236
  ...I,
237
237
  style: { padding: 0 }
238
238
  }),
239
- /* @__PURE__ */ c("span", {
239
+ /* @__PURE__ */ l("span", {
240
240
  "aria-hidden": "true",
241
- children: r ? `${r}.` : ""
241
+ children: i ? `${i}.` : ""
242
242
  })
243
- ] }) : /* @__PURE__ */ l(s, { children: [N, /* @__PURE__ */ c(S, { ...I })] });
244
- return /* @__PURE__ */ l("div", {
245
- className: u(d, "corespring-" + k, "choice-input"),
243
+ ] }) : /* @__PURE__ */ u(c, { children: [N, /* @__PURE__ */ l(S, { ...I })] });
244
+ return /* @__PURE__ */ u("div", {
245
+ className: e(d, "corespring-" + k, "choice-input"),
246
246
  children: [
247
- /* @__PURE__ */ l(w, { children: [!p && m && /* @__PURE__ */ c(e, { correctness: o }), /* @__PURE__ */ c(T, {
247
+ /* @__PURE__ */ u(w, { children: [!p && m && /* @__PURE__ */ l(t, { correctness: s }), /* @__PURE__ */ l(T, {
248
248
  className: "checkbox-holder",
249
249
  sx: A,
250
- children: /* @__PURE__ */ c(O, {
250
+ children: /* @__PURE__ */ l(O, {
251
251
  label: F,
252
252
  value: g,
253
253
  htmlFor: this.choiceId,
@@ -255,14 +255,14 @@ var v = _(a, "PreviewPrompt") || _(S.PreviewPrompt, "PreviewPrompt"), y = _(i, "
255
255
  control: L
256
256
  })
257
257
  })] }),
258
- f && /* @__PURE__ */ c(v, {
258
+ f && /* @__PURE__ */ l(v, {
259
259
  className: "rationale",
260
260
  defaultClassName: "rationale",
261
261
  prompt: f
262
262
  }),
263
- /* @__PURE__ */ c(y, {
264
- feedback: i,
265
- correctness: o
263
+ /* @__PURE__ */ l(y, {
264
+ feedback: a,
265
+ correctness: s
266
266
  })
267
267
  ]
268
268
  });
@@ -1,10 +1,10 @@
1
1
  import e from "./main.js";
2
- import t from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/debounce.js";
3
- import { updateSessionMetadata as n, updateSessionValue as r } from "./session-updater.js";
4
- import i from "react";
5
- import * as a from "@pie-lib/render-ui";
6
- import { EnableAudioAutoplayImage as o } from "@pie-lib/render-ui";
7
- import { createRoot as s } from "react-dom/client";
2
+ import { updateSessionMetadata as t, updateSessionValue as n } from "./session-updater.js";
3
+ import r from "react";
4
+ import * as i from "@pie-lib/render-ui";
5
+ import { EnableAudioAutoplayImage as a } from "@pie-lib/render-ui";
6
+ import { createRoot as o } from "react-dom/client";
7
+ import { debounce as s } from "@pie-element/shared-lodash";
8
8
  import c from "debug";
9
9
  import { ModelSetEvent as l, SessionChangedEvent as u } from "@pie-element/shared-player-events";
10
10
  import { renderMath as d } from "@pie-element/shared-math-rendering-mathjax";
@@ -15,7 +15,7 @@ function f(e) {
15
15
  function p(e, t) {
16
16
  return !e || f(e) ? e : f(e.default) ? e.default : t && f(e[t]) ? e[t] : t && f(e[t]?.default) ? e[t].default : e;
17
17
  }
18
- var m = p(o, "EnableAudioAutoplayImage") || p(_.EnableAudioAutoplayImage, "EnableAudioAutoplayImage"), h = a, g = h.default, _ = g && typeof g == "object" ? g : h, v = c("pie-ui:multiple-choice"), y = (e, t, n, r) => {
18
+ var m = p(a, "EnableAudioAutoplayImage") || p(_.EnableAudioAutoplayImage, "EnableAudioAutoplayImage"), h = i, g = h.default, _ = g && typeof g == "object" ? g : h, v = c("pie-ui:multiple-choice"), y = (e, t, n, r) => {
19
19
  let { autoplayAudioEnabled: i, completeAudioEnabled: a } = t || {};
20
20
  if (i && a && !n && r) {
21
21
  let e = r.querySelector("audio"), t = e && e.closest("#preview-prompt");
@@ -49,9 +49,9 @@ function x(e) {
49
49
  }
50
50
  var S = class extends HTMLElement {
51
51
  constructor() {
52
- super(), this._model = null, this._session = null, this._options = null, this.audioComplete = !1, this._boundHandleKeyDown = this.handleKeyDown.bind(this), this._keyboardEventsEnabled = !1, this._audioInitialized = !1, this._root = null, this._mathObserver = null, this._mathRenderPending = !1, this._rerender = t(() => {
52
+ super(), this._model = null, this._session = null, this._options = null, this.audioComplete = !1, this._boundHandleKeyDown = this.handleKeyDown.bind(this), this._keyboardEventsEnabled = !1, this._audioInitialized = !1, this._root = null, this._mathObserver = null, this._mathRenderPending = !1, this._rerender = s(() => {
53
53
  if (this._model && this._session) {
54
- var t = i.createElement(e, {
54
+ var t = r.createElement(e, {
55
55
  model: this._model,
56
56
  session: this._session,
57
57
  options: this._options,
@@ -59,14 +59,14 @@ var S = class extends HTMLElement {
59
59
  onShowCorrectToggle: this.onShowCorrectToggle.bind(this),
60
60
  ...x(this)
61
61
  });
62
- this.setAttribute("aria-label", this._model.choiceMode === "radio" ? "Multiple Choice Question" : "Multiple Correct Answer Question"), this.setAttribute("role", "region"), this.setLangAttribute(), this._initMathObserver(), this._root ||= s(this), this._root.render(t), this._model.keyboardEventsEnabled === !0 && !this._keyboardEventsEnabled && this.enableKeyboardEvents();
62
+ this.setAttribute("aria-label", this._model.choiceMode === "radio" ? "Multiple Choice Question" : "Multiple Correct Answer Question"), this.setAttribute("role", "region"), this.setLangAttribute(), this._initMathObserver(), this._root ||= o(this), this._root.render(t), this._model.keyboardEventsEnabled === !0 && !this._keyboardEventsEnabled && this.enableKeyboardEvents();
63
63
  } else v("skip");
64
64
  }, 50, {
65
65
  leading: !1,
66
66
  trailing: !0
67
- }), this._dispatchResponseChanged = t(() => {
67
+ }), this._dispatchResponseChanged = s(() => {
68
68
  this.dispatchEvent(new u(this.tagName.toLowerCase(), y(this._session, this._model, this.audioComplete, this)));
69
- }), this._dispatchModelSet = t(() => {
69
+ }), this._dispatchModelSet = s(() => {
70
70
  this.dispatchEvent(new l(this.tagName.toLowerCase(), y(this._session, this._model, this.audioComplete, this), this._model !== void 0));
71
71
  }, 50, {
72
72
  leading: !1,
@@ -121,7 +121,7 @@ var S = class extends HTMLElement {
121
121
  this._session = e, this._rerender(), this._dispatchResponseChanged();
122
122
  }
123
123
  _onChange(e) {
124
- r(this._session, this._model.choiceMode, e), this._dispatchResponseChanged(), this._rerender();
124
+ n(this._session, this._model.choiceMode, e), this._dispatchResponseChanged(), this._rerender();
125
125
  }
126
126
  _createAudioInfoToast() {
127
127
  let e = document.createElement("div");
@@ -141,7 +141,7 @@ var S = class extends HTMLElement {
141
141
  return t.src = m, t.alt = "Click anywhere to enable audio autoplay", t.width = 500, t.height = 300, e.appendChild(t), e;
142
142
  }
143
143
  connectedCallback() {
144
- this._initMathObserver(), this._initPlayerObserver(), this._rerender(), new MutationObserver((e, t) => {
144
+ this._initMathObserver(), this._initPlayerObserver(), this._rerender(), new MutationObserver((e, n) => {
145
145
  e.forEach((e) => {
146
146
  if (e.type === "childList") {
147
147
  if (this._audioInitialized) return;
@@ -154,15 +154,15 @@ var S = class extends HTMLElement {
154
154
  e.paused && !this.querySelector("#play-audio-info") ? (a.appendChild(i), document.addEventListener("click", o)) : document.removeEventListener("click", o);
155
155
  }, 500);
156
156
  let s = () => {
157
- n(this._session, { audioStartTime: (/* @__PURE__ */ new Date()).getTime() });
158
- let t = this.querySelector("#play-audio-info");
159
- t && a.removeChild(t), e.removeEventListener("playing", s);
157
+ t(this._session, { audioStartTime: (/* @__PURE__ */ new Date()).getTime() });
158
+ let n = this.querySelector("#play-audio-info");
159
+ n && a.removeChild(n), e.removeEventListener("playing", s);
160
160
  };
161
161
  e.addEventListener("playing", s);
162
162
  let c = () => {
163
- n(this._session, { audioEndTime: (/* @__PURE__ */ new Date()).getTime() }), this.audioComplete = !0, this._dispatchResponseChanged(), e.removeEventListener("ended", c);
163
+ t(this._session, { audioEndTime: (/* @__PURE__ */ new Date()).getTime() }), this.audioComplete = !0, this._dispatchResponseChanged(), e.removeEventListener("ended", c);
164
164
  };
165
- e.addEventListener("ended", c), this._audio = e, this._handlePlaying = s, this._handleEnded = c, this._enableAudio = o, this._audioInitialized = !0, t.disconnect();
165
+ e.addEventListener("ended", c), this._audio = e, this._handlePlaying = s, this._handleEnded = c, this._enableAudio = o, this._audioInitialized = !0, n.disconnect();
166
166
  }
167
167
  });
168
168
  }).observe(this, {