@vue-skuilder/platform-ui 0.2.34 → 0.2.36

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 (190) hide show
  1. package/dist/assets/{About-sUaZ0Srj.js → About-74htcNLT.js} +2 -2
  2. package/dist/assets/{About-sUaZ0Srj.js.map → About-74htcNLT.js.map} +1 -1
  3. package/dist/assets/AdminDashboard-B00qno2M.js +2 -0
  4. package/dist/assets/{AdminDashboard-cKNlDTB2.js.map → AdminDashboard-B00qno2M.js.map} +1 -1
  5. package/dist/assets/AdminLearner-SJNtSyJ_.js +2 -0
  6. package/dist/assets/{AdminLearner-DXeevw2h.js.map → AdminLearner-SJNtSyJ_.js.map} +1 -1
  7. package/dist/assets/BaseUserDB-CV2ZPZOR.js +1 -0
  8. package/dist/assets/ClassroomCtrlPanel-BSAG3h8B.js +2 -0
  9. package/dist/assets/{ClassroomCtrlPanel-BeSz_WX4.js.map → ClassroomCtrlPanel-BSAG3h8B.js.map} +1 -1
  10. package/dist/assets/{Classrooms-DTBqomQE.js → Classrooms-DXNEbtsM.js} +3 -3
  11. package/dist/assets/{Classrooms-DTBqomQE.js.map → Classrooms-DXNEbtsM.js.map} +1 -1
  12. package/dist/assets/CouchDBSyncStrategy-BjM7ROXC.js +1 -0
  13. package/dist/assets/CourseRouter-CsVa_92r.js +7 -0
  14. package/dist/assets/{CourseRouter-CL8v2Zdk.js.map → CourseRouter-CsVa_92r.js.map} +1 -1
  15. package/dist/assets/CourseSyncService-CPU_Ll1h.js +1 -0
  16. package/dist/assets/CourseWare-BTFRjgBR-DBp_fIwH.js +3 -0
  17. package/dist/assets/{CourseWare-BTFRjgBR-C3GJRVef.js.map → CourseWare-BTFRjgBR-DBp_fIwH.js.map} +1 -1
  18. package/dist/assets/{Courses-CUff-WLk.js → Courses-CB6GGtdm.js} +3 -3
  19. package/dist/assets/{Courses-CUff-WLk.js.map → Courses-CB6GGtdm.js.map} +1 -1
  20. package/dist/assets/EloModeration-DUBgs-Vh.js +2 -0
  21. package/dist/assets/{EloModeration-6MUDz-Mu.js.map → EloModeration-DUBgs-Vh.js.map} +1 -1
  22. package/dist/assets/{JoinCode-CW9Lk23D.js → JoinCode-BBvYapCA.js} +2 -2
  23. package/dist/assets/{JoinCode-CW9Lk23D.js.map → JoinCode-BBvYapCA.js.map} +1 -1
  24. package/dist/assets/MarkdownRenderer-WG9YrHpe.js +1 -0
  25. package/dist/assets/MarkdownRenderer-borh39Lq.js +53 -0
  26. package/dist/assets/MarkdownRenderer-borh39Lq.js.map +1 -0
  27. package/dist/assets/NewCourseDialog-DBgFVnt3.js +2 -0
  28. package/dist/assets/{NewCourseDialog-CLm1rQyB.js.map → NewCourseDialog-DBgFVnt3.js.map} +1 -1
  29. package/dist/assets/PipelineDebugger-BHaqzqZw.js +177 -0
  30. package/dist/assets/PipelineDebugger-BHaqzqZw.js.map +1 -0
  31. package/dist/assets/PouchDataLayerProvider-DxsnSIKd.js +2 -0
  32. package/dist/assets/PouchDataLayerProvider-DxsnSIKd.js.map +1 -0
  33. package/dist/assets/{ReleaseNotes-CmITE6hd.js → ReleaseNotes-Dg6mLL1C.js} +2 -2
  34. package/dist/assets/{ReleaseNotes-CmITE6hd.js.map → ReleaseNotes-Dg6mLL1C.js.map} +1 -1
  35. package/dist/assets/RequestPasswordReset-CcFMTnTc.js +2 -0
  36. package/dist/assets/{RequestPasswordReset-DPE6S2dU.js.map → RequestPasswordReset-CcFMTnTc.js.map} +1 -1
  37. package/dist/assets/ResetPassword-Dw_cBJU2.js +2 -0
  38. package/dist/assets/{ResetPassword-Dl6nj4jF.js.map → ResetPassword-Dw_cBJU2.js.map} +1 -1
  39. package/dist/assets/StaticDataLayerProvider-CtgU3VBh.js +2 -0
  40. package/dist/assets/StaticDataLayerProvider-CtgU3VBh.js.map +1 -0
  41. package/dist/assets/Study-DDsGQCTJ.js +2 -0
  42. package/dist/assets/{Study-Cf5yVLaY.js.map → Study-DDsGQCTJ.js.map} +1 -1
  43. package/dist/assets/TagInformation-DBLoXA2a.js +2 -0
  44. package/dist/assets/{TagInformation-tqHJGkyw.js.map → TagInformation-DBLoXA2a.js.map} +1 -1
  45. package/dist/assets/User-DfXUXjFb.js +2 -0
  46. package/dist/assets/User-DfXUXjFb.js.map +1 -0
  47. package/dist/assets/UserDBDebugger-DPqlc4O_.js +23 -0
  48. package/dist/assets/UserDBDebugger-DPqlc4O_.js.map +1 -0
  49. package/dist/assets/UserDBDebugger-xmycWjck.js +1 -0
  50. package/dist/assets/UserStats-C04YVYv7.js +2 -0
  51. package/dist/assets/{UserStats-B25DZy-D.js.map → UserStats-C04YVYv7.js.map} +1 -1
  52. package/dist/assets/VerifyEmail-Y05BSR57.js +2 -0
  53. package/dist/assets/{VerifyEmail-DyWRQweA.js.map → VerifyEmail-Y05BSR57.js.map} +1 -1
  54. package/dist/assets/{admin-Cfzt4Vei.css → admin-CMwKoROX.css} +1 -1
  55. package/dist/assets/admin-DcFjvYJw.js +21 -0
  56. package/dist/assets/admin-DcFjvYJw.js.map +1 -0
  57. package/dist/assets/chess-E2uOAyQS-BZi0vihz.js +7 -0
  58. package/dist/assets/{chess-E2uOAyQS-CP3XwSpG.js.map → chess-E2uOAyQS-BZi0vihz.js.map} +1 -1
  59. package/dist/assets/chess-Lfm7Fsvs-DgN08Qx9.js +1 -0
  60. package/dist/assets/contentSource-DwznMSMs.js +34 -0
  61. package/dist/assets/contentSource-DwznMSMs.js.map +1 -0
  62. package/dist/assets/defineProperty-y9rbOPYz.js +1 -0
  63. package/dist/assets/dist-BcwaOf54.js +1 -0
  64. package/dist/assets/dist-BsRvt0gH.js +38 -0
  65. package/dist/assets/dist-BsRvt0gH.js.map +1 -0
  66. package/dist/assets/dist-CAHkbl3M.js +18 -0
  67. package/dist/assets/dist-CAHkbl3M.js.map +1 -0
  68. package/dist/assets/dist-CgW7D_Gh.js +1 -0
  69. package/dist/assets/dist-Dnehy0sn.js +1 -0
  70. package/dist/assets/dist-Dp6eBE2S.js +64 -0
  71. package/dist/assets/dist-Dp6eBE2S.js.map +1 -0
  72. package/dist/assets/edit-ui.es-BWqvElsJ.js +1 -0
  73. package/dist/assets/edit-ui.es-UaQFL_My.js +41 -0
  74. package/dist/assets/edit-ui.es-UaQFL_My.js.map +1 -0
  75. package/dist/assets/elo-B5qCwvSC.js +2 -0
  76. package/dist/assets/elo-B5qCwvSC.js.map +1 -0
  77. package/dist/assets/elo-COgu6Hu5.js +2 -0
  78. package/dist/assets/elo-COgu6Hu5.js.map +1 -0
  79. package/dist/assets/elo-Cwa8a3Yo.js +1 -0
  80. package/dist/assets/eloDistance-BV7vfiK5.js +2 -0
  81. package/dist/assets/eloDistance-BV7vfiK5.js.map +1 -0
  82. package/dist/assets/eloDistance-MReQeAuj.js +1 -0
  83. package/dist/assets/french-Dk7YG8Td-CD7Hms2j.js +2 -0
  84. package/dist/assets/{french-Dk7YG8Td-Bfl4cirn.js.map → french-Dk7YG8Td-CD7Hms2j.js.map} +1 -1
  85. package/dist/assets/french-evUMlbbq-nGCjilG6.js +1 -0
  86. package/dist/assets/hierarchyDefinition-DLC5DjaA.js +2 -0
  87. package/dist/assets/hierarchyDefinition-DLC5DjaA.js.map +1 -0
  88. package/dist/assets/{index-NFrxkZjT.css → index-B7mmpKZd.css} +1 -1
  89. package/dist/assets/index-CK-rfSIx.js +4 -0
  90. package/dist/assets/{index-JRi1udkz.js.map → index-CK-rfSIx.js.map} +1 -1
  91. package/dist/assets/interferenceMitigator-D78KgOxz.js +2 -0
  92. package/dist/assets/interferenceMitigator-D78KgOxz.js.map +1 -0
  93. package/dist/assets/logshim-YQI0WloD.js +2 -0
  94. package/dist/assets/logshim-YQI0WloD.js.map +1 -0
  95. package/dist/assets/math-DR3fXDcX-C9KfHLHP.js +1 -0
  96. package/dist/assets/math-D_8HiEQR-E4QDLrWp.js +34 -0
  97. package/dist/assets/{math-D_8HiEQR-B9oNpF-3.js.map → math-D_8HiEQR-E4QDLrWp.js.map} +1 -1
  98. package/dist/assets/moment-DbT30ZpG.js +5 -0
  99. package/dist/assets/moment-DbT30ZpG.js.map +1 -0
  100. package/dist/assets/piano-BN5Btq91-CnKhyLGE.js +1 -0
  101. package/dist/assets/piano-DF1g6yaX-Ck3BH5EK.js +2 -0
  102. package/dist/assets/{piano-DF1g6yaX-CjD06Qz8.js.map → piano-DF1g6yaX-Ck3BH5EK.js.map} +1 -1
  103. package/dist/assets/pitch-CgGJFkZ1-Dd0LzmEe.js +2 -0
  104. package/dist/assets/{pitch-CgGJFkZ1-C-2hdk99.js.map → pitch-CgGJFkZ1-Dd0LzmEe.js.map} +1 -1
  105. package/dist/assets/pitch-Dn0iNqiS-BxAdpDDb.js +1 -0
  106. package/dist/assets/prescribed-BWO17Gan.js +2 -0
  107. package/dist/assets/prescribed-BWO17Gan.js.map +1 -0
  108. package/dist/assets/relativePriority-DwPMECAp.js +2 -0
  109. package/dist/assets/relativePriority-DwPMECAp.js.map +1 -0
  110. package/dist/assets/server-CqR7xtQy.js +2 -0
  111. package/dist/assets/server-CqR7xtQy.js.map +1 -0
  112. package/dist/assets/{sightsing-BFQ7HRig-8K5qd7-K.js → sightsing-BFQ7HRig-DV69ELZf.js} +23 -23
  113. package/dist/assets/{sightsing-BFQ7HRig-8K5qd7-K.js.map → sightsing-BFQ7HRig-DV69ELZf.js.map} +1 -1
  114. package/dist/assets/sightsing-CJX3k0Fd-CG94OiDr.js +1 -0
  115. package/dist/assets/srs-DGscV6W4.js +1 -0
  116. package/dist/assets/srs-DOsG9Y-i.js +2 -0
  117. package/dist/assets/srs-DOsG9Y-i.js.map +1 -0
  118. package/dist/assets/tagRoles-jR-PJAgj.js +2 -0
  119. package/dist/assets/tagRoles-jR-PJAgj.js.map +1 -0
  120. package/dist/assets/typing-BevtfWlp-CvStu5BY.js +2 -0
  121. package/dist/assets/{typing-BevtfWlp-BT263ZFw.js.map → typing-BevtfWlp-CvStu5BY.js.map} +1 -1
  122. package/dist/assets/typing-k-ojjO7G-AF8vU_q7.js +1 -0
  123. package/dist/assets/userDBKeys-DYLGKnVC.js +4 -0
  124. package/dist/assets/userDBKeys-DYLGKnVC.js.map +1 -0
  125. package/dist/assets/userTagPreference-cZCPqadC.js +2 -0
  126. package/dist/assets/userTagPreference-cZCPqadC.js.map +1 -0
  127. package/dist/assets/validators-lpYAHmRR.js +2 -0
  128. package/dist/assets/validators-lpYAHmRR.js.map +1 -0
  129. package/dist/assets/word-work-BOnRlZgd-CCGZdwyf.js +2 -0
  130. package/dist/assets/{word-work-BOnRlZgd-BFwc1KBd.js.map → word-work-BOnRlZgd-CCGZdwyf.js.map} +1 -1
  131. package/dist/assets/word-work-Dd6tIKrt-BNTSCq5F.js +1 -0
  132. package/dist/assets/{workbox-window.prod.es5-r2bRTooK.js → workbox-window.prod.es5-YsLcd14J.js} +1 -1
  133. package/dist/assets/{workbox-window.prod.es5-r2bRTooK.js.map → workbox-window.prod.es5-YsLcd14J.js.map} +1 -1
  134. package/dist/index.html +17 -7
  135. package/dist/sw.js +1 -1
  136. package/dist/sw.js.map +1 -1
  137. package/package.json +7 -7
  138. package/dist/assets/AdminDashboard-cKNlDTB2.js +0 -2
  139. package/dist/assets/AdminLearner-DXeevw2h.js +0 -2
  140. package/dist/assets/ClassroomCtrlPanel-BeSz_WX4.js +0 -2
  141. package/dist/assets/CourseRouter-CL8v2Zdk.js +0 -7
  142. package/dist/assets/CourseWare-BTFRjgBR-C3GJRVef.js +0 -3
  143. package/dist/assets/EloModeration-6MUDz-Mu.js +0 -2
  144. package/dist/assets/MarkdownRenderer-U_iPiA2x-DDruDu7E.js +0 -53
  145. package/dist/assets/MarkdownRenderer-U_iPiA2x-DDruDu7E.js.map +0 -1
  146. package/dist/assets/MarkdownRenderer-U_iPiA2x-VCa5mXh1.js +0 -1
  147. package/dist/assets/NewCourseDialog-CLm1rQyB.js +0 -2
  148. package/dist/assets/RequestPasswordReset-DPE6S2dU.js +0 -2
  149. package/dist/assets/ResetPassword-Dl6nj4jF.js +0 -2
  150. package/dist/assets/Study-Cf5yVLaY.js +0 -2
  151. package/dist/assets/TagInformation-tqHJGkyw.js +0 -2
  152. package/dist/assets/User-DCoA5JMB.js +0 -3
  153. package/dist/assets/User-DCoA5JMB.js.map +0 -1
  154. package/dist/assets/UserStats-B25DZy-D.js +0 -2
  155. package/dist/assets/VerifyEmail-DyWRQweA.js +0 -2
  156. package/dist/assets/admin-DCvFP6sY.js +0 -4
  157. package/dist/assets/admin-DCvFP6sY.js.map +0 -1
  158. package/dist/assets/chess-E2uOAyQS-CP3XwSpG.js +0 -7
  159. package/dist/assets/chess-Lfm7Fsvs-RoJ69a0B.js +0 -1
  160. package/dist/assets/common-ui.es-DHzI_ZVr.js +0 -1
  161. package/dist/assets/common-ui.es-te1li8kU.js +0 -38
  162. package/dist/assets/common-ui.es-te1li8kU.js.map +0 -1
  163. package/dist/assets/dist-BnMJdH50.js +0 -380
  164. package/dist/assets/dist-BnMJdH50.js.map +0 -1
  165. package/dist/assets/dist-CtnPlm6M.js +0 -18
  166. package/dist/assets/dist-CtnPlm6M.js.map +0 -1
  167. package/dist/assets/dist-D4MdLcof.js +0 -1
  168. package/dist/assets/dist-Db-U8O3Z.js +0 -1
  169. package/dist/assets/dist-V9Xbab2f.js +0 -12
  170. package/dist/assets/dist-V9Xbab2f.js.map +0 -1
  171. package/dist/assets/edit-ui.es-C7TI7NmB.js +0 -36
  172. package/dist/assets/edit-ui.es-C7TI7NmB.js.map +0 -1
  173. package/dist/assets/edit-ui.es-CiY2oEH8.js +0 -1
  174. package/dist/assets/french-Dk7YG8Td-Bfl4cirn.js +0 -2
  175. package/dist/assets/french-evUMlbbq-DuW1vCaS.js +0 -1
  176. package/dist/assets/index-JRi1udkz.js +0 -4
  177. package/dist/assets/math-DR3fXDcX-BFIht0j2.js +0 -1
  178. package/dist/assets/math-D_8HiEQR-B9oNpF-3.js +0 -34
  179. package/dist/assets/piano-BN5Btq91-Jqe2eqme.js +0 -1
  180. package/dist/assets/piano-DF1g6yaX-CjD06Qz8.js +0 -2
  181. package/dist/assets/pitch-CgGJFkZ1-C-2hdk99.js +0 -2
  182. package/dist/assets/pitch-Dn0iNqiS-DpEcsscT.js +0 -1
  183. package/dist/assets/server-D4lhkoe2.js +0 -2
  184. package/dist/assets/server-D4lhkoe2.js.map +0 -1
  185. package/dist/assets/sightsing-CJX3k0Fd-CA3ntnlE.js +0 -1
  186. package/dist/assets/typing-BevtfWlp-BT263ZFw.js +0 -2
  187. package/dist/assets/typing-k-ojjO7G-Bq4IfdFx.js +0 -1
  188. package/dist/assets/word-work-BOnRlZgd-BFwc1KBd.js +0 -2
  189. package/dist/assets/word-work-Dd6tIKrt-tFtMeyu1.js +0 -1
  190. /package/dist/assets/{common-ui-BY2Ut5jf.css → dist-BY2Ut5jf.css} +0 -0
@@ -0,0 +1,2 @@
1
+ import"./chunk-D6hFPZc3.js";import{C as e,H as t,K as n,S as r,T as i,b as a,f as o,g as s,ut as c,y as l,z as u}from"./vue.runtime.esm-bundler--Fxmd6l9.js";import{C as d,S as f}from"./MarkdownRenderer-borh39Lq.js";import{P as p,x as m}from"./dist-BsRvt0gH.js";import{K as h,U as g}from"./contentSource-DwznMSMs.js";import{t as _}from"./defineProperty-y9rbOPYz.js";import{m as v,n as y,s as b,t as x}from"./CourseWare-BTFRjgBR-DBp_fIwH.js";var S,C=i({name:`IdentifyChroma`,components:{RadioMultipleChoice:m},props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(e,{emit:t}){let n=d(e,t,`IdentifyChroma`),r=f(n),i=c(``),a=c(new AudioContext);r.question.value=new O(e.data);let o=s(()=>r.question.value),octaves=e=>{let t=[],n=e/2;for(;n>100;)t.push(n),n/=2;t.push(e);let r=e*2;for(;r<5e3;)t.push(r),r*=2;return t},tone=e=>{let t=a.value.createOscillator();t.type=`sine`,t.frequency.value=e;let n=a.value.createGain();console.log(`Max Gain: `+n.gain.maxValue),n.gain.setValueAtTime(0,0),n.gain.linearRampToValueAtTime(.5,15),t.connect(n),n.connect(a.value.destination),t.start(0),t.stop(14)};u(()=>{octaves(295).forEach(e=>tone(e))});let submit=()=>{o.value&&o.value.isCorrect(i.value)};return{...n,...r,answer:i,question:o,submit}}}),w={"data-viewable":`IdentifyChroma`};function _sfc_render(i,s,c,u,d,f){let p=n(`radio-multiple-choice`);return t(),a(`div`,w,[i.question?(t(),a(o,{key:0},[s[0]||(s[0]=r(` What note is being played? `)),e(p,{"choice-list":i.question.choiceList},null,8,[`choice-list`])],64)):l(``,!0)])}var T=x(C,[[`render`,_sfc_render]]),E=function(e){return e.A=`A`,e.B=`B`,e.C=`C`,e.D=`D`,e.E=`E`,e.F=`F`,e.G=`G`,e}(E||{}),D=[{name:`Chroma`,type:g.STRING,validator:{test:e=>Object.values(E).includes(e)?{status:h.ok,msg:``}:{status:h.error,msg:`That's not a chroma!`},instructions:`Enter a valid musical note (A-G)`}}],O=(S=class ChromaQuestion extends p{constructor(e){var _super=(...e)=>(super(...e),_(this,`chroma`,void 0),this);_super(e),this.chroma=e[0].Chroma}get baseFreq(){return this.chroma===`A`?440:this.chroma===`B`?440*2**(2/12):this.chroma===`C`?440*2**(3/12):440}get choiceList(){return b([this.chroma.toString(),`test`,`options`,`are`,`fun`])}isCorrect(e){return e.choiceList[e.selection]===this.chroma.toString()}dataShapes(){return ChromaQuestion.dataShapes}views(){return ChromaQuestion.views}},_(S,`dataShapes`,[{fields:D,name:v.PITCH_chroma}]),_(S,`views`,[T]),S),k=new y(`pitch`,[O]);export{k as t};
2
+ //# sourceMappingURL=pitch-CgGJFkZ1-Dd0LzmEe.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pitch-CgGJFkZ1-C-2hdk99.js","names":["l","h","_","g","f","i","p","d","o","r","s","c","a","e","y","b","m","t","v","n"],"sources":["../../../courseware/dist/pitch-CgGJFkZ1.js"],"sourcesContent":["import \"./shapes-BQUVJdp5.js\";\nimport { r as e, s as t, t as n } from \"./CourseWare-BTFRjgBR.js\";\nimport { Fragment as r, computed as i, createCommentVNode as a, createElementBlock as o, createTextVNode as s, createVNode as c, defineComponent as l, onMounted as u, openBlock as d, ref as f, resolveComponent as p } from \"vue\";\nimport { Question as m, RadioMultipleChoice as h, useQuestionView as g, useViewable as _ } from \"@vue-skuilder/common-ui\";\nimport { DataShapeName as v, FieldType as y, Status as b } from \"@vue-skuilder/common\";\n//#region src/pitch/questions/indentify/textBox.vue?vue&type=script&lang.ts\nvar x = l({\n\tname: \"IdentifyChroma\",\n\tcomponents: { RadioMultipleChoice: h },\n\tprops: {\n\t\tdata: {\n\t\t\ttype: Array,\n\t\t\trequired: !0\n\t\t},\n\t\tmodifyDifficulty: {\n\t\t\ttype: Number,\n\t\t\trequired: !1,\n\t\t\tdefault: 0\n\t\t}\n\t},\n\tsetup(e, { emit: t }) {\n\t\tlet n = _(e, t, \"IdentifyChroma\"), r = g(n), a = f(\"\"), o = f(new AudioContext());\n\t\tr.question.value = new E(e.data);\n\t\tlet s = i(() => r.question.value), octaves = (e) => {\n\t\t\tlet t = [], n = e / 2;\n\t\t\tfor (; n > 100;) t.push(n), n /= 2;\n\t\t\tt.push(e);\n\t\t\tlet r = e * 2;\n\t\t\tfor (; r < 5e3;) t.push(r), r *= 2;\n\t\t\treturn t;\n\t\t}, tone = (e) => {\n\t\t\tlet t = o.value.createOscillator();\n\t\t\tt.type = \"sine\", t.frequency.value = e;\n\t\t\tlet n = o.value.createGain();\n\t\t\tconsole.log(\"Max Gain: \" + n.gain.maxValue), n.gain.setValueAtTime(0, 0), n.gain.linearRampToValueAtTime(.5, 15), t.connect(n), n.connect(o.value.destination), t.start(0), t.stop(14);\n\t\t};\n\t\tu(() => {\n\t\t\toctaves(295).forEach((e) => tone(e));\n\t\t});\n\t\tlet submit = () => {\n\t\t\ts.value && s.value.isCorrect(a.value);\n\t\t};\n\t\treturn {\n\t\t\t...n,\n\t\t\t...r,\n\t\t\tanswer: a,\n\t\t\tquestion: s,\n\t\t\tsubmit\n\t\t};\n\t}\n}), S = { \"data-viewable\": \"IdentifyChroma\" };\nfunction _sfc_render(e, t, n, i, l, u) {\n\tlet f = p(\"radio-multiple-choice\");\n\treturn d(), o(\"div\", S, [e.question ? (d(), o(r, { key: 0 }, [t[0] ||= s(\" What note is being played? \"), c(f, { \"choice-list\": e.question.choiceList }, null, 8, [\"choice-list\"])], 64)) : a(\"\", !0)]);\n}\nvar C = /* @__PURE__ */ e(x, [[\"render\", _sfc_render]]), w = /* @__PURE__ */ function(e) {\n\treturn e.A = \"A\", e.B = \"B\", e.C = \"C\", e.D = \"D\", e.E = \"E\", e.F = \"F\", e.G = \"G\", e;\n}(w || {}), T = [{\n\tname: \"Chroma\",\n\ttype: y.STRING,\n\tvalidator: {\n\t\ttest: (e) => Object.values(w).includes(e) ? {\n\t\t\tstatus: b.ok,\n\t\t\tmsg: \"\"\n\t\t} : {\n\t\t\tstatus: b.error,\n\t\t\tmsg: \"That's not a chroma!\"\n\t\t},\n\t\tinstructions: \"Enter a valid musical note (A-G)\"\n\t}\n}], E = class ChromaQuestion extends m {\n\tstatic dataShapes = [{\n\t\tfields: T,\n\t\tname: v.PITCH_chroma\n\t}];\n\tstatic views = [C];\n\tchroma;\n\tconstructor(e) {\n\t\tsuper(e), this.chroma = e[0].Chroma;\n\t}\n\tget baseFreq() {\n\t\treturn this.chroma === \"A\" ? 440 : this.chroma === \"B\" ? 440 * 2 ** (2 / 12) : this.chroma === \"C\" ? 440 * 2 ** (3 / 12) : 440;\n\t}\n\tget choiceList() {\n\t\treturn t([\n\t\t\tthis.chroma.toString(),\n\t\t\t\"test\",\n\t\t\t\"options\",\n\t\t\t\"are\",\n\t\t\t\"fun\"\n\t\t]);\n\t}\n\tisCorrect(e) {\n\t\treturn e.choiceList[e.selection] === this.chroma.toString();\n\t}\n\tdataShapes() {\n\t\treturn ChromaQuestion.dataShapes;\n\t}\n\tviews() {\n\t\treturn ChromaQuestion.views;\n\t}\n}, D = new n(\"pitch\", [E]);\n//#endregion\nexport { D as t };\n\n//# sourceMappingURL=pitch-Cg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IAAI,YAAa,CAChB,OAAOC,EAAE,CACR,KAAK,OAAO,UAAU,CACtB,OACA,UACA,MACA,MACA,CAAC,CAEH,UAAU,EAAG,CACZ,OAAO,EAAE,WAAW,EAAE,aAAe,KAAK,OAAO,UAAU,CAE5D,YAAa,CACZ,OAAO,eAAe,WAEvB,OAAQ,CACP,OAAO,eAAe,YA5BhB,aAAa,CAAC,CACpB,OAAQ,EACR,KAAMC,EAAE,aACR,CAAC,CAAC,CAAA,EAAA,EACI,QAAQ,CAAC,EAAE,CAAC,CAAA,GA0BjB,EAAI,IAAIC,EAAE,QAAS,CAAC,EAAE,CAAC"}
1
+ {"version":3,"file":"pitch-CgGJFkZ1-Dd0LzmEe.js","names":["l","h","_","g","f","i","p","d","o","r","s","c","a","e","y","b","m","t","v","n"],"sources":["../../../courseware/dist/pitch-CgGJFkZ1.js"],"sourcesContent":["import \"./shapes-BQUVJdp5.js\";\nimport { r as e, s as t, t as n } from \"./CourseWare-BTFRjgBR.js\";\nimport { Fragment as r, computed as i, createCommentVNode as a, createElementBlock as o, createTextVNode as s, createVNode as c, defineComponent as l, onMounted as u, openBlock as d, ref as f, resolveComponent as p } from \"vue\";\nimport { Question as m, RadioMultipleChoice as h, useQuestionView as g, useViewable as _ } from \"@vue-skuilder/common-ui\";\nimport { DataShapeName as v, FieldType as y, Status as b } from \"@vue-skuilder/common\";\n//#region src/pitch/questions/indentify/textBox.vue?vue&type=script&lang.ts\nvar x = l({\n\tname: \"IdentifyChroma\",\n\tcomponents: { RadioMultipleChoice: h },\n\tprops: {\n\t\tdata: {\n\t\t\ttype: Array,\n\t\t\trequired: !0\n\t\t},\n\t\tmodifyDifficulty: {\n\t\t\ttype: Number,\n\t\t\trequired: !1,\n\t\t\tdefault: 0\n\t\t}\n\t},\n\tsetup(e, { emit: t }) {\n\t\tlet n = _(e, t, \"IdentifyChroma\"), r = g(n), a = f(\"\"), o = f(new AudioContext());\n\t\tr.question.value = new E(e.data);\n\t\tlet s = i(() => r.question.value), octaves = (e) => {\n\t\t\tlet t = [], n = e / 2;\n\t\t\tfor (; n > 100;) t.push(n), n /= 2;\n\t\t\tt.push(e);\n\t\t\tlet r = e * 2;\n\t\t\tfor (; r < 5e3;) t.push(r), r *= 2;\n\t\t\treturn t;\n\t\t}, tone = (e) => {\n\t\t\tlet t = o.value.createOscillator();\n\t\t\tt.type = \"sine\", t.frequency.value = e;\n\t\t\tlet n = o.value.createGain();\n\t\t\tconsole.log(\"Max Gain: \" + n.gain.maxValue), n.gain.setValueAtTime(0, 0), n.gain.linearRampToValueAtTime(.5, 15), t.connect(n), n.connect(o.value.destination), t.start(0), t.stop(14);\n\t\t};\n\t\tu(() => {\n\t\t\toctaves(295).forEach((e) => tone(e));\n\t\t});\n\t\tlet submit = () => {\n\t\t\ts.value && s.value.isCorrect(a.value);\n\t\t};\n\t\treturn {\n\t\t\t...n,\n\t\t\t...r,\n\t\t\tanswer: a,\n\t\t\tquestion: s,\n\t\t\tsubmit\n\t\t};\n\t}\n}), S = { \"data-viewable\": \"IdentifyChroma\" };\nfunction _sfc_render(e, t, n, i, l, u) {\n\tlet f = p(\"radio-multiple-choice\");\n\treturn d(), o(\"div\", S, [e.question ? (d(), o(r, { key: 0 }, [t[0] ||= s(\" What note is being played? \"), c(f, { \"choice-list\": e.question.choiceList }, null, 8, [\"choice-list\"])], 64)) : a(\"\", !0)]);\n}\nvar C = /* @__PURE__ */ e(x, [[\"render\", _sfc_render]]), w = /* @__PURE__ */ function(e) {\n\treturn e.A = \"A\", e.B = \"B\", e.C = \"C\", e.D = \"D\", e.E = \"E\", e.F = \"F\", e.G = \"G\", e;\n}(w || {}), T = [{\n\tname: \"Chroma\",\n\ttype: y.STRING,\n\tvalidator: {\n\t\ttest: (e) => Object.values(w).includes(e) ? {\n\t\t\tstatus: b.ok,\n\t\t\tmsg: \"\"\n\t\t} : {\n\t\t\tstatus: b.error,\n\t\t\tmsg: \"That's not a chroma!\"\n\t\t},\n\t\tinstructions: \"Enter a valid musical note (A-G)\"\n\t}\n}], E = class ChromaQuestion extends m {\n\tstatic dataShapes = [{\n\t\tfields: T,\n\t\tname: v.PITCH_chroma\n\t}];\n\tstatic views = [C];\n\tchroma;\n\tconstructor(e) {\n\t\tsuper(e), this.chroma = e[0].Chroma;\n\t}\n\tget baseFreq() {\n\t\treturn this.chroma === \"A\" ? 440 : this.chroma === \"B\" ? 440 * 2 ** (2 / 12) : this.chroma === \"C\" ? 440 * 2 ** (3 / 12) : 440;\n\t}\n\tget choiceList() {\n\t\treturn t([\n\t\t\tthis.chroma.toString(),\n\t\t\t\"test\",\n\t\t\t\"options\",\n\t\t\t\"are\",\n\t\t\t\"fun\"\n\t\t]);\n\t}\n\tisCorrect(e) {\n\t\treturn e.choiceList[e.selection] === this.chroma.toString();\n\t}\n\tdataShapes() {\n\t\treturn ChromaQuestion.dataShapes;\n\t}\n\tviews() {\n\t\treturn ChromaQuestion.views;\n\t}\n}, D = new n(\"pitch\", [E]);\n//#endregion\nexport { D as t };\n\n//# sourceMappingURL=pitch-CgGJFkZ1.js.map"],"mappings":"8bAMI,EAAIA,EAAE,CACT,KAAM,iBACN,WAAY,CAAE,oBAAqBC,EAAG,CACtC,MAAO,CACN,KAAM,CACL,KAAM,MACN,SAAU,CAAC,EACX,CACD,iBAAkB,CACjB,KAAM,OACN,SAAU,CAAC,EACX,QAAS,EACT,CACD,CACD,MAAM,EAAG,CAAE,KAAM,GAAK,CACrB,IAAI,EAAIC,EAAE,EAAG,EAAG,iBAAiB,CAAE,EAAIC,EAAE,EAAE,CAAE,EAAIC,EAAE,GAAG,CAAE,EAAIA,EAAE,IAAI,aAAe,CACjF,EAAE,SAAS,MAAQ,IAAI,EAAE,EAAE,KAAK,CAChC,IAAI,EAAIC,MAAQ,EAAE,SAAS,MAAM,CAAE,QAAW,GAAM,CACnD,IAAI,EAAI,EAAE,CAAE,EAAI,EAAI,EACpB,KAAO,EAAI,KAAM,EAAE,KAAK,EAAE,CAAE,GAAK,EACjC,EAAE,KAAK,E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AE,EAAI,IAAK,EAAE,EAAI,IAAK,EAAE,EAAI,IAAK,EAAE,EAAI,IAAK,EAAE,EAAI,IAAK,EAAE,EAAI,IAAK,GACnF,GAAK,EAAE,CAAC,CAAE,EAAI,CAAC,CAChB,KAAM,SACN,KAAMC,EAAE,OACR,UAAW,CACV,KAAO,GAAM,OAAO,OAAO,EAAE,CAAC,SAAS,EAAE,CAAG,CAC3C,OAAQC,EAAE,GACV,IAAK,GACL,CAAG,CACH,OAAQA,EAAE,MACV,IAAK,uBACL,CACD,aAAc,mCACd,CACD,CAAC,CAAE,GAAA,EAAI,MAAM,uBAAuBC,CAAE,CAOtC,YAAY,EAAG,wCADf,SAAA,IAAA,GAAO,CAAA,MAEN,OAAM,EAAE,CAAE,KAAK,OAAS,EAAE,GAAG,OAE9B,IAAI,UAAW,CACd,OAAO,KAAK,SAAW,IAAM,IAAM,KAAK,SAAW,IAAM,IAAM,IAAM,EAAI,IAAM,KAAK,SAAW,IAAM,IAAM,IAAM,EAAI,IAAM,IAE5H,IAAI,YAAa,CAChB,OAAOC,EAAE,CACR,KAAK,OAAO,UAAU,CACtB,OACA,UACA,MACA,MACA,CAAC,CAEH,UAAU,EAAG,CACZ,OAAO,EAAE,WAAW,EAAE,aAAe,KAAK,OAAO,UAAU,CAE5D,YAAa,CACZ,OAAO,eAAe,WAEvB,OAAQ,CACP,OAAO,eAAe,YA5BhB,aAAa,CAAC,CACpB,OAAQ,EACR,KAAMC,EAAE,aACR,CAAC,CAAC,CAAA,EAAA,EACI,QAAQ,CAAC,EAAE,CAAC,CAAA,GA0BjB,EAAI,IAAIC,EAAE,QAAS,CAAC,EAAE,CAAC"}
@@ -0,0 +1 @@
1
+ import"./vue.runtime.esm-bundler--Fxmd6l9.js";import"./MarkdownRenderer-borh39Lq.js";import"./moment-DbT30ZpG.js";import"./dist-BsRvt0gH.js";import"./contentSource-DwznMSMs.js";import"./dist-Dp6eBE2S.js";import"./CourseWare-BTFRjgBR-DBp_fIwH.js";import"./PipelineDebugger-BHaqzqZw.js";import"./eloDistance-BV7vfiK5.js";import{t as e}from"./pitch-CgGJFkZ1-Dd0LzmEe.js";export{e as default};
@@ -0,0 +1,2 @@
1
+ import"./chunk-D6hFPZc3.js";import{n as e,r as t}from"./tagRoles-jR-PJAgj.js";import{t as n}from"./defineProperty-y9rbOPYz.js";import{S as r,k as i,l as a}from"./PipelineDebugger-BHaqzqZw.js";var o=3,s=3,c=3,l=2,u=3,d=3,f=4,p=1,m=.8,h=12,g=1,_=2,v=4,y=.5,b=8,x=4,S=`testversion-prescribed-v3`;function dedupe(e){return[...new Set(e)]}function isoNow(){return new Date().toISOString()}function clamp(e,t,n){return Math.max(t,Math.min(n,e))}function matchesTagPattern(e,t){if(t===`*`)return!0;let n=t.replace(/[.+^${}()|[\]\\]/g,`\\$&`).replace(/\*/g,`.*`);return RegExp(`^${n}$`).test(e)}function extractWordStem(e){for(let t of[`c-ml-`,`c-ws-`,`c-spelling-`])if(e.startsWith(t)){let n=e.slice(t.length),r=n.lastIndexOf(`-`);return r>0?n.slice(0,r):n}return e}function shuffleInPlace(e){for(let t=e.length-1;t>0;t--){let n=Math.floor(Math.random()*(t+1));[e[t],e[n]]=[e[n],e[t]]}}function formatAge(e){let t=Math.max(0,Math.round(e/6e4));if(t<60)return`${t}m`;let n=Math.round(t/60);return n<24?`${n}h`:`${Math.round(n/24)}d`}function unmetIntroExposeTags(n,r,i){if(i<=0)return[];let a=new Set(n.filter(t=>e(t)===`expose`));for(let r of n){if(e(r)!==`intro`)continue;let n=t(r,`expose`);n&&a.add(n)}return[...a].filter(e=>{let t=r[e];return!t||t.count<i})}function pickTopByScore(e,t){return[...e].sort((e,t)=>t.score-e.score||e.cardId.localeCompare(t.cardId)).slice(0,t)}var PrescribedCardsGenerator=class extends a{constructor(e,t,r){super(e,t,r),n(this,`name`,void 0),n(this,`config`,void 0),this.name=r.name||`Prescribed Cards`,this.config=this.parseConfig(r.serializedData),i.debug(`[Prescribed] Initialized with ${this.config.groups.length} groups and ${this.config.groups.reduce((e,t)=>e+t.targetCardIds.length,0)} targets`)}get strategyKey(){return`PrescribedProgress`}async getWeightedCards(e,t){if(this.config.groups.length===0||e<=0)return{cards:[]};let n=this.course.getCourseID(),r=await this.user.getActiveCards(),a=new Set(r.map(e=>e.cardID)),o=await this.user.getSeenCards(n).catch(()=>[]),s=new Set(o),c=await this.getStrategyState()??{updatedAt:isoNow(),groups:{}},l=await this.loadHierarchyConfigs(),u=await this.user.getCourseRegDoc(n).catch(()=>null),d=typeof u?.elo==`number`?u.elo:u?.elo?.global?.score??t?.userElo??1e3,f=typeof u?.elo==`number`?{}:u?.elo?.tags??{},p=dedupe(this.config.groups.flatMap(e=>e.targetCardIds)),m=dedupe(this.config.groups.flatMap(e=>e.supportCardIds??[])),h=dedupe([...p,...m]),g=h.length>0?await this.course.getAppliedTagsBatch(h):new Map,_=await this.course.getCourseTagStubs().catch(()=>({rows:[],offset:0,total_rows:0})),v=new Map;for(let e of _.rows??[]){let t=e.doc;t?.name&&Array.isArray(t.taggedCards)&&v.set(t.name,[...t.taggedCards])}let y={updatedAt:isoNow(),groups:{}},b=[],x=new Set,C=[],w=c.practiceDebt??{},T={},E=new Map;for(let e of this.config.groups){let t=this.buildGroupRuntimeState({group:e,priorState:c.groups[e.id],activeIds:a,seenIds:s,tagsByCard:g,cardsByTag:v,hierarchyConfigs:l,userTagElo:f,userGlobalElo:d});C.push(t),i.info(`[Prescribed] Group '${e.id}': ${e.targetCardIds.length} targets total, ${t.encounteredTargets.size} encountered, ${t.pendingTargets.length} pending (${t.surfaceableTargets.length} surfaceable, ${t.blockedTargets.length} blocked), ${t.supportCandidates.length} authored support candidates, ${t.discoveredSupportCandidates.length} discovered support candidates, pressure=${t.pressureMultiplier.toFixed(2)}`),t.blockedTargets.length>0&&(i.info(`[Prescribed] Group '${e.id}' blocked targets: ${t.blockedTargets.join(`, `)}`),i.info(`[Prescribed] Group '${e.id}' support tags needed: ${t.supportTags.join(`, `)||`(none)`}`),i.info(`[Prescribed] Group '${e.id}' escalation mode: `+(t.supportCandidates.length>0?`direct-support`:t.discoveredSupportCandidates.length>0?`inserted-support-candidates`:`boost-only`)),t.discoveredSupportCandidates.length>0&&i.info(`[Prescribed] Group '${e.id}' discovered support candidates: ${t.discoveredSupportCandidates.join(`, `)}`)),y.groups[e.id]=this.buildNextGroupState(t,c.groups[e.id]);let r=this.buildDirectTargetCards(t,n,x),o=this.buildSupportCards(t,n,x),u=this.buildDiscoveredSupportCards(t,n,x),p=this.buildPracticeCards({group:e,courseId:n,emittedIds:x,cardsByTag:v,hierarchyConfigs:l,userTagElo:f,userGlobalElo:d,activeIds:a,seenIds:s,priorPracticeDebt:w,nextPracticeDebt:T});E.set(e.id,p.debts),b.push(...r,...o,...u,...p.cards)}y.practiceDebt=T;let D=this.buildSupportHintSummary(C),O=Object.keys(D.boostTags).length>0?{boostTags:D.boostTags,_label:`prescribed-support (${D.supportTags.length} tags; blocked=${D.blockedTargetIds.length}; testversion=${S})`}:void 0;if(O){let e=Object.entries(O.boostTags??{});i.info(`[Prescribed] Emitting ${e.length} boost hint(s): `+e.map(([e,t])=>`${e}×${t.toFixed(1)}`).join(`, `))}else i.info(`[Prescribed] No hints to emit (no blocked targets or no support tags)`);if(this.capturePressureSnapshot(n,C,E,b,O),b.length===0)return i.info(`[Prescribed] 0 cards emitted (all targets blocked, authored/discovered support candidates exhausted)`+(O?` — boost hints emitted but may not survive filters`:``)),await this.putStrategyState(y).catch(e=>{i.debug(`[Prescribed] Failed to persist empty-state update: ${e}`)}),O?{cards:[],hints:O}:{cards:[]};let k=pickTopByScore(b,e),A=new Map;for(let e of k){let t=e.provenance[0];if(t?.reason.includes(`mode=practice`))continue;let n=t?.reason.match(/group=([^;]+)/)?.[1],r=t?.reason.includes(`mode=support`)?`supportIds`:`targetIds`;n&&(A.has(n)||A.set(n,{targetIds:[],supportIds:[]}),A.get(n)[r].push(e.cardId))}for(let e of this.config.groups){let t=y.groups[e.id],n=A.get(e.id);n&&(n.targetIds.length>0||n.supportIds.length>0)&&(t.lastSurfacedAt=isoNow(),t.sessionsSinceSurfaced=0,n.supportIds.length>0&&(t.lastSupportAt=isoNow()))}return await this.putStrategyState(y).catch(e=>{i.debug(`[Prescribed] Failed to persist prescribed progress: ${e}`)}),i.info(`[Prescribed] Emitting ${k.length} cards (${k.filter(e=>e.provenance[0]?.reason.includes(`mode=target`)).length} target, ${k.filter(e=>e.provenance[0]?.reason.includes(`mode=support`)).length} support, ${k.filter(e=>e.provenance[0]?.reason.includes(`mode=discovered-support`)).length} discovered support)`),O?{cards:k,hints:O}:{cards:k}}buildSupportHintSummary(e){let t={},n=new Set,r=new Set;for(let i of e)if(!(i.blockedTargets.length===0||i.supportTags.length===0)){i.blockedTargets.forEach(e=>n.add(e));for(let e of i.supportTags)r.add(e),t[e]=(t[e]??1)*i.supportMultiplier}return{boostTags:t,blockedTargetIds:[...n].sort(),supportTags:[...r].sort()}}capturePressureSnapshot(e,t,n,i,a){let s=Date.now(),c=[];for(let e of t){let t=e.group,r=t.freshnessWindowSessions??o;if(c.push({id:`group:${t.id}:target`,label:`${t.id} targets`,multiplier:e.pressureMultiplier,max:b,detail:`${e.pendingTargets.length} pending (${e.surfaceableTargets.length} surfaceable, ${e.blockedTargets.length} blocked) · sinceSurfaced ${e.sessionsSinceSurfaced}/${r}`,items:e.blockedTargets.map(e=>({label:e,value:`blocked`}))}),e.blockedTargets.length>0){let n=e.supportCandidates.length>0?`direct-support`:e.discoveredSupportCandidates.length>0?`inserted-support`:`boost-only`;c.push({id:`group:${t.id}:support`,label:`${t.id} support`,multiplier:e.supportMultiplier,max:x,detail:`mode=${n} · ${e.supportTags.length} support tag(s)`,items:e.supportTags.map(e=>({label:e}))})}let i=n.get(t.id)??[];i.length>0&&c.push({id:`group:${t.id}:practice-debt`,label:`${t.id} practice debt`,multiplier:Math.max(...i.map(e=>e.multiplier)),max:v,detail:`${i.length} under-practiced skill(s)`,items:i.map(e=>({label:e.tag,value:`×${e.multiplier.toFixed(2)} · open ${formatAge(s-new Date(e.firstOwedAt).getTime())}`}))})}r({source:`prescribed`,courseId:e,gauges:c,topScore:i.length>0?Math.max(...i.map(e=>e.score)):null,hintsLabel:a?._label,timestamp:s})}parseConfig(e){try{let t=JSON.parse(e);return{groups:(Array.isArray(t.groups)?t.groups:[]).map((e,t)=>({id:typeof e.id==`string`&&e.id.trim().length>0?e.id:`group-${t+1}`,targetCardIds:dedupe(Array.isArray(e.targetCardIds)?e.targetCardIds.filter(e=>typeof e==`string`):[]),supportCardIds:dedupe(Array.isArray(e.supportCardIds)?e.supportCardIds.filter(e=>typeof e==`string`):[]),supportTagPatterns:dedupe(Array.isArray(e.supportTagPatterns)?e.supportTagPatterns.filter(e=>typeof e==`string`):[]),freshnessWindowSessions:typeof e.freshnessWindowSessions==`number`?e.freshnessWindowSessions:o,maxDirectTargetsPerRun:typeof e.maxDirectTargetsPerRun==`number`?e.maxDirectTargetsPerRun:s,maxSupportCardsPerRun:typeof e.maxSupportCardsPerRun==`number`?e.maxSupportCardsPerRun:c,introExposeMinCount:typeof e.introExposeMinCount==`number`?e.introExposeMinCount:u,hierarchyWalk:{enabled:e.hierarchyWalk?.enabled!==!1,maxDepth:typeof e.hierarchyWalk?.maxDepth==`number`?e.hierarchyWalk.maxDepth:l},retireOnEncounter:e.retireOnEncounter!==!1,practiceTagPatterns:dedupe(Array.isArray(e.practiceTagPatterns)?e.practiceTagPatterns.filter(e=>typeof e==`string`):[]),practiceMinCount:typeof e.practiceMinCount==`number`?e.practiceMinCount:d,maxPracticeCardsPerRun:typeof e.maxPracticeCardsPerRun==`number`?e.maxPracticeCardsPerRun:f})).filter(e=>e.targetCardIds.length>0)}}catch{return{groups:[]}}}async loadHierarchyConfigs(){try{return(await this.course.getAllNavigationStrategies()).filter(e=>e.implementingClass===`hierarchyDefinition`).map(e=>{try{return{prerequisites:JSON.parse(e.serializedData).prerequisites||{}}}catch{return{prerequisites:{}}}})}catch(e){return i.debug(`[Prescribed] Failed to load hierarchy configs: ${e}`),[]}}buildGroupRuntimeState(e){let{group:t,priorState:n,activeIds:r,seenIds:a,tagsByCard:s,cardsByTag:d,hierarchyConfigs:f,userTagElo:p,userGlobalElo:m}=e,h=new Set;for(let e of t.targetCardIds)(r.has(e)||a.has(e))&&h.add(e);if(n?.encounteredCardIds?.length)for(let e of n.encounteredCardIds)h.add(e);let g=t.targetCardIds.filter(e=>!h.has(e)),_=new Map;for(let e of g)_.set(e,s.get(e)??[]);let v=[],y=[],C=new Set;for(let e of g){let n=_.get(e)??[],r=this.resolveBlockedSupportTags(n,f,p,m,t.hierarchyWalk?.enabled!==!1,t.hierarchyWalk?.maxDepth??l),i=unmetIntroExposeTags(n,p,t.introExposeMinCount??u);i.length>0&&i.forEach(e=>C.add(e)),r.blocked||i.length>0?(v.push(e),r.supportTags.forEach(e=>C.add(e))):y.push(e)}let w=dedupe([...t.supportCardIds??[],...this.findSupportCardsByTags(t,s,[...C])]).filter(e=>!r.has(e)&&!a.has(e)),T=v.length>0&&C.size>0&&w.length===0?this.findDiscoveredSupportCards({supportTags:[...C],cardsByTag:d,activeIds:r,seenIds:a,excludedIds:new Set([...t.targetCardIds,...t.supportCardIds??[]]),limit:t.maxSupportCardsPerRun??c}):[];v.length>0&&C.size>0&&T.length===0&&i.info(`[Prescribed] Group '${t.id}' discovered 0 broader support candidates (blocked=${v.length}; authoredSupport=${w.length})`);let E=n?.sessionsSinceSurfaced??0,D=t.freshnessWindowSessions??o,O=Math.max(0,E-D),k=g.length===0?1:clamp(1+O*.75+Math.min(2,g.length*.1),1,b),A=v.length===0?1:clamp(1+O*.5+Math.min(1.5,v.length*.15),1,x);return{group:t,encounteredTargets:h,pendingTargets:g,blockedTargets:v,surfaceableTargets:y,targetTags:_,supportCandidates:w,discoveredSupportCandidates:T,supportTags:[...C],pressureMultiplier:k,supportMultiplier:A,sessionsSinceSurfaced:E,debugVersion:S}}buildNextGroupState(e,t){let n=t?.sessionsSinceSurfaced??0;return{encounteredCardIds:[...e.encounteredTargets].sort(),pendingTargetIds:[...e.pendingTargets].sort(),lastSurfacedAt:t?.lastSurfacedAt??null,sessionsSinceSurfaced:n+1,lastSupportAt:t?.lastSupportAt??null,blockedTargetIds:[...e.blockedTargets].sort(),lastResolvedSupportTags:[...e.supportTags].sort()}}buildDirectTargetCards(e,t,n){let r=e.group.maxDirectTargetsPerRun??s,i=e.surfaceableTargets.filter(e=>!n.has(e)).slice(0,r),a=[];for(let r of i)n.add(r),a.push({cardId:r,courseId:t,score:p*e.pressureMultiplier,provenance:[{strategy:`prescribed`,strategyName:this.strategyName||this.name,strategyId:this.strategyId||`NAVIGATION_STRATEGY-prescribed`,action:`generated`,score:p*e.pressureMultiplier,reason:`mode=target;group=${e.group.id};pending=${e.pendingTargets.length};surfaceable=${e.surfaceableTargets.length};blocked=${e.blockedTargets.length};blockedTargets=${e.blockedTargets.join(`|`)||`none`};supportTags=${e.supportTags.join(`|`)||`none`};multiplier=${e.pressureMultiplier.toFixed(2)};testversion=${e.debugVersion}`}]});return a}buildSupportCards(e,t,n){if(e.blockedTargets.length===0||e.supportCandidates.length===0)return[];let r=e.group.maxSupportCardsPerRun??c,i=e.supportCandidates.filter(e=>!n.has(e)).slice(0,r),a=[];for(let r of i)n.add(r),a.push({cardId:r,courseId:t,score:m*e.supportMultiplier,provenance:[{strategy:`prescribed`,strategyName:this.strategyName||this.name,strategyId:this.strategyId||`NAVIGATION_STRATEGY-prescribed`,action:`generated`,score:m*e.supportMultiplier,reason:`mode=support;group=${e.group.id};pending=${e.pendingTargets.length};blocked=${e.blockedTargets.length};blockedTargets=${e.blockedTargets.join(`|`)||`none`};supportCard=${r};supportTags=${e.supportTags.join(`|`)||`none`};multiplier=${e.supportMultiplier.toFixed(2)};testversion=${e.debugVersion}`}]});return a}buildDiscoveredSupportCards(e,t,n){if(e.blockedTargets.length===0||e.discoveredSupportCandidates.length===0)return[];let r=e.group.maxSupportCardsPerRun??c,i=e.discoveredSupportCandidates.filter(e=>!n.has(e)).slice(0,r),a=[];for(let r of i)n.add(r),a.push({cardId:r,courseId:t,score:h*e.supportMultiplier,provenance:[{strategy:`prescribed`,strategyName:this.strategyName||this.name,strategyId:this.strategyId||`NAVIGATION_STRATEGY-prescribed`,action:`generated`,score:h*e.supportMultiplier,reason:`mode=discovered-support;group=${e.group.id};pending=${e.pendingTargets.length};blocked=${e.blockedTargets.length};blockedTargets=${e.blockedTargets.join(`|`)||`none`};supportCard=${r};supportTags=${e.supportTags.join(`|`)||`none`};multiplier=${e.supportMultiplier.toFixed(2)};testversion=${e.debugVersion}`}]});return a}buildPracticeCards(e){let{group:t,courseId:n,emittedIds:r,cardsByTag:a,hierarchyConfigs:o,userTagElo:s,userGlobalElo:c,activeIds:l,seenIds:u,priorPracticeDebt:p,nextPracticeDebt:m}=e,h=t.practiceTagPatterns??[];if(h.length===0)return{cards:[],debts:[]};let b=t.practiceMinCount??d,x=t.maxPracticeCardsPerRun??f,C=[...a.keys()].filter(e=>h.some(t=>matchesTagPattern(e,t))&&this.isUnlockedGatedSkill(e,o,s,c)&&(s[e]?.count??0)<b);if(C.length===0)return{cards:[],debts:[]};let w=Date.now(),T=new Map;for(let e of C){let t=p[e]??isoNow();m[e]=t;let n=clamp(_+Math.max(0,(w-new Date(t).getTime())/864e5)*y,_,v);T.set(e,n)}let E=C.map(e=>({tag:e,multiplier:T.get(e)??_,firstOwedAt:m[e]})).sort((e,t)=>t.multiplier-e.multiplier||e.tag.localeCompare(t.tag)),D=this.findDiscoveredSupportCards({supportTags:C,cardsByTag:a,activeIds:l,seenIds:u,excludedIds:r,limit:x});if(D.length===0)return{cards:[],debts:E};i.info(`[Prescribed] Group '${t.id}' practice: ${C.length} unlocked under-practiced skill(s), emitting ${D.length} drill card(s)`);let O=[];for(let e of D){r.add(e);let i=_;for(let t of C)(a.get(t)?.includes(e)??!1)&&(i=Math.max(i,T.get(t)??_));let o=g*i;O.push({cardId:e,courseId:n,score:o,provenance:[{strategy:`prescribed`,strategyName:this.strategyName||this.name,strategyId:this.strategyId||`NAVIGATION_STRATEGY-prescribed`,action:`generated`,score:o,reason:`mode=practice;group=${t.id};debtMult=×${i.toFixed(2)};underPracticedSkills=${C.length};practiceTags=${C.slice(0,8).join(`|`)}${C.length>8?`|…`:``};testversion=${S}`}]})}return{cards:O,debts:E}}isUnlockedGatedSkill(e,t,n,r){let i=t.map(t=>t.prerequisites[e]).filter(e=>Array.isArray(e)&&e.length>0);return i.length===0?!1:i.every(e=>e.every(e=>this.isPrerequisiteMet(e,n[e.tag],r)))}findSupportCardsByTags(e,t,n){if(n.length===0)return[];let r=e.supportCardIds??[],i=e.supportTagPatterns??[];if(r.length===0&&i.length===0)return[];let a=new Set;for(let e of r){let r=t.get(e)??[],o=n.some(e=>r.includes(e)),s=i.some(e=>r.some(t=>matchesTagPattern(t,e)));(o||s)&&a.add(e)}return[...a]}findDiscoveredSupportCards(e){let{supportTags:t,cardsByTag:n,activeIds:r,seenIds:i,excludedIds:a,limit:o}=e,s=new Map;for(let e of t){let t=n.get(e)??[];for(let e of t){if(r.has(e)||i.has(e)||a.has(e))continue;let t=s.get(e);t?t.matches+=1:s.set(e,{cardId:e,matches:1})}}let c=[...s.values()].sort((e,t)=>t.matches-e.matches||e.cardId.localeCompare(t.cardId)),l=new Set,u=[],d=[];for(let e of c){let t=extractWordStem(e.cardId);l.has(t)?d.push(e):(l.add(t),u.push(e))}return shuffleInPlace(u),shuffleInPlace(d),[...u,...d].slice(0,o).map(e=>e.cardId)}resolveBlockedSupportTags(e,t,n,r,i,a){let o=new Set,s=!1;for(let c of e){let e=t.map(e=>e.prerequisites[c]).filter(e=>Array.isArray(e)&&e.length>0);if(e.length!==0&&e.some(e=>e.some(e=>!this.isPrerequisiteMet(e,n[e.tag],r)))){if(s=!0,!i){for(let t of e)for(let e of t)this.isPrerequisiteMet(e,n[e.tag],r)||o.add(e.tag);continue}for(let i of e)for(let e of i)this.isPrerequisiteMet(e,n[e.tag],r)||this.collectSupportTagsRecursive(e.tag,t,n,r,a,new Set,o)}}return{blocked:s,supportTags:[...o]}}collectSupportTagsRecursive(e,t,n,r,i,a,o){if(i<0||a.has(e))return;a.add(e);let s=!1;for(let c of t){let l=c.prerequisites[e];if(!l||l.length===0)continue;let u=l.filter(e=>!this.isPrerequisiteMet(e,n[e.tag],r));if(u.length>0&&i>0){s=!0;for(let e of u)this.collectSupportTagsRecursive(e.tag,t,n,r,i-1,a,o)}}s||o.add(e)}isPrerequisiteMet(e,t,n){if(!t)return!1;let r=e.masteryThreshold?.minCount??u;return t.count<r?!1:e.masteryThreshold?.minElo===void 0?e.masteryThreshold?.minCount===void 0?t.score>=n:!0:t.score>=e.masteryThreshold.minElo}};export{PrescribedCardsGenerator as default};
2
+ //# sourceMappingURL=prescribed-BWO17Gan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prescribed-BWO17Gan.js","names":[],"sources":["../../../db/dist/core/navigators/generators/prescribed.mjs"],"sourcesContent":["import \"../../../_virtual/_rolldown/runtime.mjs\";\nimport { logger } from \"../../../util/logger.mjs\";\nimport { captureStrategyPressure } from \"../StrategyPressureDebugger.mjs\";\nimport { ContentNavigator } from \"../index.mjs\";\nimport { tagRole, withTagRole } from \"@vue-skuilder/common\";\n//#region src/core/navigators/generators/prescribed.ts\nconst DEFAULT_FRESHNESS_WINDOW = 3;\nconst DEFAULT_MAX_DIRECT_PER_RUN = 3;\nconst DEFAULT_MAX_SUPPORT_PER_RUN = 3;\nconst DEFAULT_HIERARCHY_DEPTH = 2;\nconst DEFAULT_MIN_COUNT = 3;\nconst DEFAULT_PRACTICE_MIN_COUNT = 3;\nconst DEFAULT_MAX_PRACTICE_PER_RUN = 4;\nconst BASE_TARGET_SCORE = 1;\nconst BASE_SUPPORT_SCORE = .8;\nconst DISCOVERED_SUPPORT_SCORE = 12;\nconst BASE_PRACTICE_SCORE = 1;\nconst PRACTICE_BASE_MULT = 2;\nconst MAX_PRACTICE_MULTIPLIER = 4;\nconst PRACTICE_STALENESS_BUMP_PER_DAY = .5;\nconst MAX_TARGET_MULTIPLIER = 8;\nconst MAX_SUPPORT_MULTIPLIER = 4;\nconst PRESCRIBED_DEBUG_VERSION = \"testversion-prescribed-v3\";\nfunction dedupe(arr) {\n\treturn [...new Set(arr)];\n}\nfunction isoNow() {\n\treturn (/* @__PURE__ */ new Date()).toISOString();\n}\nfunction clamp(value, min, max) {\n\treturn Math.max(min, Math.min(max, value));\n}\nfunction matchesTagPattern(tag, pattern) {\n\tif (pattern === \"*\") return true;\n\tconst escaped = pattern.replace(/[.+^${}()|[\\]\\\\]/g, \"\\\\$&\").replace(/\\*/g, \".*\");\n\treturn new RegExp(`^${escaped}$`).test(tag);\n}\n/**\n* Extract the word stem from a card ID for deduplication.\n* ML: c-ml-{word}-{blanks} → {word}\n* WS: c-ws-{word}-{contrast} → {word}\n* Other: full cardId as fallback.\n*/\nfunction extractWordStem(cardId) {\n\tfor (const prefix of [\n\t\t\"c-ml-\",\n\t\t\"c-ws-\",\n\t\t\"c-spelling-\"\n\t]) if (cardId.startsWith(prefix)) {\n\t\tconst rest = cardId.slice(prefix.length);\n\t\tconst lastDash = rest.lastIndexOf(\"-\");\n\t\treturn lastDash > 0 ? rest.slice(0, lastDash) : rest;\n\t}\n\treturn cardId;\n}\n/** Fisher-Yates shuffle in place. */\nfunction shuffleInPlace(arr) {\n\tfor (let i = arr.length - 1; i > 0; i--) {\n\t\tconst j = Math.floor(Math.random() * (i + 1));\n\t\t[arr[i], arr[j]] = [arr[j], arr[i]];\n\t}\n}\n/** Compact age string for debt-open durations: 42m / 7h / 3d. */\nfunction formatAge(ms) {\n\tconst minutes = Math.max(0, Math.round(ms / 6e4));\n\tif (minutes < 60) return `${minutes}m`;\n\tconst hours = Math.round(minutes / 60);\n\tif (hours < 24) return `${hours}h`;\n\treturn `${Math.round(hours / 24)}d`;\n}\n/**\n* The exposure tags an intro target still lacks before it may surface: its own\n* `expose` tags plus the `expose` counterpart of each `intro` tag (tag roles,\n* see common's tagRoles.ts: `gpc:intro:X` → `gpc:expose:X`), each needing\n* `minCount` attempts. A `minCount` of 0 requires nothing — not even an entry\n* in `userTagElo`.\n*/\nfunction unmetIntroExposeTags(tags, userTagElo, minCount) {\n\tif (minCount <= 0) return [];\n\tconst exposeTags = new Set(tags.filter((tag) => tagRole(tag) === \"expose\"));\n\tfor (const tag of tags) {\n\t\tif (tagRole(tag) !== \"intro\") continue;\n\t\tconst expose = withTagRole(tag, \"expose\");\n\t\tif (expose) exposeTags.add(expose);\n\t}\n\treturn [...exposeTags].filter((tag) => {\n\t\tconst tagElo = userTagElo[tag];\n\t\treturn !tagElo || tagElo.count < minCount;\n\t});\n}\nfunction pickTopByScore(cards, limit) {\n\treturn [...cards].sort((a, b) => b.score - a.score || a.cardId.localeCompare(b.cardId)).slice(0, limit);\n}\nvar PrescribedCardsGenerator = class extends ContentNavigator {\n\tname;\n\tconfig;\n\tconstructor(user, course, strategyData) {\n\t\tsuper(user, course, strategyData);\n\t\tthis.name = strategyData.name || \"Prescribed Cards\";\n\t\tthis.config = this.parseConfig(strategyData.serializedData);\n\t\tlogger.debug(`[Prescribed] Initialized with ${this.config.groups.length} groups and ${this.config.groups.reduce((n, g) => n + g.targetCardIds.length, 0)} targets`);\n\t}\n\tget strategyKey() {\n\t\treturn \"PrescribedProgress\";\n\t}\n\tasync getWeightedCards(limit, context) {\n\t\tif (this.config.groups.length === 0 || limit <= 0) return { cards: [] };\n\t\tconst courseId = this.course.getCourseID();\n\t\tconst activeCards = await this.user.getActiveCards();\n\t\tconst activeIds = new Set(activeCards.map((ac) => ac.cardID));\n\t\tconst seenCards = await this.user.getSeenCards(courseId).catch(() => []);\n\t\tconst seenIds = new Set(seenCards);\n\t\tconst progress = await this.getStrategyState() ?? {\n\t\t\tupdatedAt: isoNow(),\n\t\t\tgroups: {}\n\t\t};\n\t\tconst hierarchyConfigs = await this.loadHierarchyConfigs();\n\t\tconst courseReg = await this.user.getCourseRegDoc(courseId).catch(() => null);\n\t\tconst userGlobalElo = typeof courseReg?.elo === \"number\" ? courseReg.elo : courseReg?.elo?.global?.score ?? context?.userElo ?? 1e3;\n\t\tconst userTagElo = typeof courseReg?.elo === \"number\" ? {} : courseReg?.elo?.tags ?? {};\n\t\tconst allTargetIds = dedupe(this.config.groups.flatMap((g) => g.targetCardIds));\n\t\tconst allSupportIds = dedupe(this.config.groups.flatMap((g) => g.supportCardIds ?? []));\n\t\tconst allRelevantIds = dedupe([...allTargetIds, ...allSupportIds]);\n\t\tconst tagsByCard = allRelevantIds.length > 0 ? await this.course.getAppliedTagsBatch(allRelevantIds) : /* @__PURE__ */ new Map();\n\t\tconst courseTagDocs = await this.course.getCourseTagStubs().catch(() => ({\n\t\t\trows: [],\n\t\t\toffset: 0,\n\t\t\ttotal_rows: 0\n\t\t}));\n\t\tconst cardsByTag = /* @__PURE__ */ new Map();\n\t\tfor (const row of courseTagDocs.rows ?? []) {\n\t\t\tconst tagDoc = row.doc;\n\t\t\tif (tagDoc?.name && Array.isArray(tagDoc.taggedCards)) cardsByTag.set(tagDoc.name, [...tagDoc.taggedCards]);\n\t\t}\n\t\tconst nextState = {\n\t\t\tupdatedAt: isoNow(),\n\t\t\tgroups: {}\n\t\t};\n\t\tconst emitted = [];\n\t\tconst emittedIds = /* @__PURE__ */ new Set();\n\t\tconst groupRuntimes = [];\n\t\tconst priorPracticeDebt = progress.practiceDebt ?? {};\n\t\tconst nextPracticeDebt = {};\n\t\tconst practiceDebtsByGroup = /* @__PURE__ */ new Map();\n\t\tfor (const group of this.config.groups) {\n\t\t\tconst runtime = this.buildGroupRuntimeState({\n\t\t\t\tgroup,\n\t\t\t\tpriorState: progress.groups[group.id],\n\t\t\t\tactiveIds,\n\t\t\t\tseenIds,\n\t\t\t\ttagsByCard,\n\t\t\t\tcardsByTag,\n\t\t\t\thierarchyConfigs,\n\t\t\t\tuserTagElo,\n\t\t\t\tuserGlobalElo\n\t\t\t});\n\t\t\tgroupRuntimes.push(runtime);\n\t\t\tlogger.info(`[Prescribed] Group '${group.id}': ${group.targetCardIds.length} targets total, ${runtime.encounteredTargets.size} encountered, ${runtime.pendingTargets.length} pending (${runtime.surfaceableTargets.length} surfaceable, ${runtime.blockedTargets.length} blocked), ${runtime.supportCandidates.length} authored support candidates, ${runtime.discoveredSupportCandidates.length} discovered support candidates, pressure=${runtime.pressureMultiplier.toFixed(2)}`);\n\t\t\tif (runtime.blockedTargets.length > 0) {\n\t\t\t\tlogger.info(`[Prescribed] Group '${group.id}' blocked targets: ${runtime.blockedTargets.join(\", \")}`);\n\t\t\t\tlogger.info(`[Prescribed] Group '${group.id}' support tags needed: ${runtime.supportTags.join(\", \") || \"(none)\"}`);\n\t\t\t\tlogger.info(`[Prescribed] Group '${group.id}' escalation mode: ` + (runtime.supportCandidates.length > 0 ? \"direct-support\" : runtime.discoveredSupportCandidates.length > 0 ? \"inserted-support-candidates\" : \"boost-only\"));\n\t\t\t\tif (runtime.discoveredSupportCandidates.length > 0) logger.info(`[Prescribed] Group '${group.id}' discovered support candidates: ${runtime.discoveredSupportCandidates.join(\", \")}`);\n\t\t\t}\n\t\t\tnextState.groups[group.id] = this.buildNextGroupState(runtime, progress.groups[group.id]);\n\t\t\tconst directCards = this.buildDirectTargetCards(runtime, courseId, emittedIds);\n\t\t\tconst supportCards = this.buildSupportCards(runtime, courseId, emittedIds);\n\t\t\tconst discoveredSupportCards = this.buildDiscoveredSupportCards(runtime, courseId, emittedIds);\n\t\t\tconst practice = this.buildPracticeCards({\n\t\t\t\tgroup,\n\t\t\t\tcourseId,\n\t\t\t\temittedIds,\n\t\t\t\tcardsByTag,\n\t\t\t\thierarchyConfigs,\n\t\t\t\tuserTagElo,\n\t\t\t\tuserGlobalElo,\n\t\t\t\tactiveIds,\n\t\t\t\tseenIds,\n\t\t\t\tpriorPracticeDebt,\n\t\t\t\tnextPracticeDebt\n\t\t\t});\n\t\t\tpracticeDebtsByGroup.set(group.id, practice.debts);\n\t\t\temitted.push(...directCards, ...supportCards, ...discoveredSupportCards, ...practice.cards);\n\t\t}\n\t\tnextState.practiceDebt = nextPracticeDebt;\n\t\tconst hintSummary = this.buildSupportHintSummary(groupRuntimes);\n\t\tconst hints = Object.keys(hintSummary.boostTags).length > 0 ? {\n\t\t\tboostTags: hintSummary.boostTags,\n\t\t\t_label: `prescribed-support (${hintSummary.supportTags.length} tags; blocked=${hintSummary.blockedTargetIds.length}; testversion=${PRESCRIBED_DEBUG_VERSION})`\n\t\t} : void 0;\n\t\tif (hints) {\n\t\t\tconst tagEntries = Object.entries(hints.boostTags ?? {});\n\t\t\tlogger.info(`[Prescribed] Emitting ${tagEntries.length} boost hint(s): ` + tagEntries.map(([tag, mult]) => `${tag}×${mult.toFixed(1)}`).join(\", \"));\n\t\t} else logger.info(\"[Prescribed] No hints to emit (no blocked targets or no support tags)\");\n\t\tthis.capturePressureSnapshot(courseId, groupRuntimes, practiceDebtsByGroup, emitted, hints);\n\t\tif (emitted.length === 0) {\n\t\t\tlogger.info(\"[Prescribed] 0 cards emitted (all targets blocked, authored/discovered support candidates exhausted)\" + (hints ? \" — boost hints emitted but may not survive filters\" : \"\"));\n\t\t\tawait this.putStrategyState(nextState).catch((e) => {\n\t\t\t\tlogger.debug(`[Prescribed] Failed to persist empty-state update: ${e}`);\n\t\t\t});\n\t\t\treturn hints ? {\n\t\t\t\tcards: [],\n\t\t\t\thints\n\t\t\t} : { cards: [] };\n\t\t}\n\t\tconst finalCards = pickTopByScore(emitted, limit);\n\t\tconst surfacedByGroup = /* @__PURE__ */ new Map();\n\t\tfor (const card of finalCards) {\n\t\t\tconst prov = card.provenance[0];\n\t\t\tif (prov?.reason.includes(\"mode=practice\")) continue;\n\t\t\tconst groupId = prov?.reason.match(/group=([^;]+)/)?.[1];\n\t\t\tconst mode = prov?.reason.includes(\"mode=support\") ? \"supportIds\" : \"targetIds\";\n\t\t\tif (!groupId) continue;\n\t\t\tif (!surfacedByGroup.has(groupId)) surfacedByGroup.set(groupId, {\n\t\t\t\ttargetIds: [],\n\t\t\t\tsupportIds: []\n\t\t\t});\n\t\t\tsurfacedByGroup.get(groupId)[mode].push(card.cardId);\n\t\t}\n\t\tfor (const group of this.config.groups) {\n\t\t\tconst groupState = nextState.groups[group.id];\n\t\t\tconst surfaced = surfacedByGroup.get(group.id);\n\t\t\tif (surfaced && (surfaced.targetIds.length > 0 || surfaced.supportIds.length > 0)) {\n\t\t\t\tgroupState.lastSurfacedAt = isoNow();\n\t\t\t\tgroupState.sessionsSinceSurfaced = 0;\n\t\t\t\tif (surfaced.supportIds.length > 0) groupState.lastSupportAt = isoNow();\n\t\t\t}\n\t\t}\n\t\tawait this.putStrategyState(nextState).catch((e) => {\n\t\t\tlogger.debug(`[Prescribed] Failed to persist prescribed progress: ${e}`);\n\t\t});\n\t\tlogger.info(`[Prescribed] Emitting ${finalCards.length} cards (${finalCards.filter((c) => c.provenance[0]?.reason.includes(\"mode=target\")).length} target, ${finalCards.filter((c) => c.provenance[0]?.reason.includes(\"mode=support\")).length} support, ${finalCards.filter((c) => c.provenance[0]?.reason.includes(\"mode=discovered-support\")).length} discovered support)`);\n\t\treturn hints ? {\n\t\t\tcards: finalCards,\n\t\t\thints\n\t\t} : { cards: finalCards };\n\t}\n\tbuildSupportHintSummary(groupRuntimes) {\n\t\tconst boostTags = {};\n\t\tconst blockedTargetIds = /* @__PURE__ */ new Set();\n\t\tconst supportTags = /* @__PURE__ */ new Set();\n\t\tfor (const runtime of groupRuntimes) {\n\t\t\tif (runtime.blockedTargets.length === 0 || runtime.supportTags.length === 0) continue;\n\t\t\truntime.blockedTargets.forEach((cardId) => blockedTargetIds.add(cardId));\n\t\t\tfor (const tag of runtime.supportTags) {\n\t\t\t\tsupportTags.add(tag);\n\t\t\t\tboostTags[tag] = (boostTags[tag] ?? 1) * runtime.supportMultiplier;\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\tboostTags,\n\t\t\tblockedTargetIds: [...blockedTargetIds].sort(),\n\t\t\tsupportTags: [...supportTags].sort()\n\t\t};\n\t}\n\t/**\n\t* Translate this run's per-group runtimes and practice debts into gauges on\n\t* the generic strategy-pressure debug channel (rendered by the live session\n\t* overlay's \"strategy backpressure\" section).\n\t*/\n\tcapturePressureSnapshot(courseId, groupRuntimes, practiceDebtsByGroup, emitted, hints) {\n\t\tconst now = Date.now();\n\t\tconst gauges = [];\n\t\tfor (const runtime of groupRuntimes) {\n\t\t\tconst group = runtime.group;\n\t\t\tconst window = group.freshnessWindowSessions ?? DEFAULT_FRESHNESS_WINDOW;\n\t\t\tgauges.push({\n\t\t\t\tid: `group:${group.id}:target`,\n\t\t\t\tlabel: `${group.id} targets`,\n\t\t\t\tmultiplier: runtime.pressureMultiplier,\n\t\t\t\tmax: MAX_TARGET_MULTIPLIER,\n\t\t\t\tdetail: `${runtime.pendingTargets.length} pending (${runtime.surfaceableTargets.length} surfaceable, ${runtime.blockedTargets.length} blocked) · sinceSurfaced ${runtime.sessionsSinceSurfaced}/${window}`,\n\t\t\t\titems: runtime.blockedTargets.map((cardId) => ({\n\t\t\t\t\tlabel: cardId,\n\t\t\t\t\tvalue: \"blocked\"\n\t\t\t\t}))\n\t\t\t});\n\t\t\tif (runtime.blockedTargets.length > 0) {\n\t\t\t\tconst mode = runtime.supportCandidates.length > 0 ? \"direct-support\" : runtime.discoveredSupportCandidates.length > 0 ? \"inserted-support\" : \"boost-only\";\n\t\t\t\tgauges.push({\n\t\t\t\t\tid: `group:${group.id}:support`,\n\t\t\t\t\tlabel: `${group.id} support`,\n\t\t\t\t\tmultiplier: runtime.supportMultiplier,\n\t\t\t\t\tmax: MAX_SUPPORT_MULTIPLIER,\n\t\t\t\t\tdetail: `mode=${mode} · ${runtime.supportTags.length} support tag(s)`,\n\t\t\t\t\titems: runtime.supportTags.map((tag) => ({ label: tag }))\n\t\t\t\t});\n\t\t\t}\n\t\t\tconst debts = practiceDebtsByGroup.get(group.id) ?? [];\n\t\t\tif (debts.length > 0) gauges.push({\n\t\t\t\tid: `group:${group.id}:practice-debt`,\n\t\t\t\tlabel: `${group.id} practice debt`,\n\t\t\t\tmultiplier: Math.max(...debts.map((d) => d.multiplier)),\n\t\t\t\tmax: MAX_PRACTICE_MULTIPLIER,\n\t\t\t\tdetail: `${debts.length} under-practiced skill(s)`,\n\t\t\t\titems: debts.map((d) => ({\n\t\t\t\t\tlabel: d.tag,\n\t\t\t\t\tvalue: `×${d.multiplier.toFixed(2)} · open ${formatAge(now - new Date(d.firstOwedAt).getTime())}`\n\t\t\t\t}))\n\t\t\t});\n\t\t}\n\t\tcaptureStrategyPressure({\n\t\t\tsource: \"prescribed\",\n\t\t\tcourseId,\n\t\t\tgauges,\n\t\t\ttopScore: emitted.length > 0 ? Math.max(...emitted.map((c) => c.score)) : null,\n\t\t\thintsLabel: hints?._label,\n\t\t\ttimestamp: now\n\t\t});\n\t}\n\tparseConfig(serializedData) {\n\t\ttry {\n\t\t\tconst parsed = JSON.parse(serializedData);\n\t\t\treturn { groups: (Array.isArray(parsed.groups) ? parsed.groups : []).map((raw, i) => ({\n\t\t\t\tid: typeof raw.id === \"string\" && raw.id.trim().length > 0 ? raw.id : `group-${i + 1}`,\n\t\t\t\ttargetCardIds: dedupe(Array.isArray(raw.targetCardIds) ? raw.targetCardIds.filter((v) => typeof v === \"string\") : []),\n\t\t\t\tsupportCardIds: dedupe(Array.isArray(raw.supportCardIds) ? raw.supportCardIds.filter((v) => typeof v === \"string\") : []),\n\t\t\t\tsupportTagPatterns: dedupe(Array.isArray(raw.supportTagPatterns) ? raw.supportTagPatterns.filter((v) => typeof v === \"string\") : []),\n\t\t\t\tfreshnessWindowSessions: typeof raw.freshnessWindowSessions === \"number\" ? raw.freshnessWindowSessions : DEFAULT_FRESHNESS_WINDOW,\n\t\t\t\tmaxDirectTargetsPerRun: typeof raw.maxDirectTargetsPerRun === \"number\" ? raw.maxDirectTargetsPerRun : DEFAULT_MAX_DIRECT_PER_RUN,\n\t\t\t\tmaxSupportCardsPerRun: typeof raw.maxSupportCardsPerRun === \"number\" ? raw.maxSupportCardsPerRun : DEFAULT_MAX_SUPPORT_PER_RUN,\n\t\t\t\tintroExposeMinCount: typeof raw.introExposeMinCount === \"number\" ? raw.introExposeMinCount : DEFAULT_MIN_COUNT,\n\t\t\t\thierarchyWalk: {\n\t\t\t\t\tenabled: raw.hierarchyWalk?.enabled !== false,\n\t\t\t\t\tmaxDepth: typeof raw.hierarchyWalk?.maxDepth === \"number\" ? raw.hierarchyWalk.maxDepth : DEFAULT_HIERARCHY_DEPTH\n\t\t\t\t},\n\t\t\t\tretireOnEncounter: raw.retireOnEncounter !== false,\n\t\t\t\tpracticeTagPatterns: dedupe(Array.isArray(raw.practiceTagPatterns) ? raw.practiceTagPatterns.filter((v) => typeof v === \"string\") : []),\n\t\t\t\tpracticeMinCount: typeof raw.practiceMinCount === \"number\" ? raw.practiceMinCount : DEFAULT_PRACTICE_MIN_COUNT,\n\t\t\t\tmaxPracticeCardsPerRun: typeof raw.maxPracticeCardsPerRun === \"number\" ? raw.maxPracticeCardsPerRun : DEFAULT_MAX_PRACTICE_PER_RUN\n\t\t\t})).filter((g) => g.targetCardIds.length > 0) };\n\t\t} catch {\n\t\t\treturn { groups: [] };\n\t\t}\n\t}\n\tasync loadHierarchyConfigs() {\n\t\ttry {\n\t\t\treturn (await this.course.getAllNavigationStrategies()).filter((s) => s.implementingClass === \"hierarchyDefinition\").map((s) => {\n\t\t\t\ttry {\n\t\t\t\t\treturn { prerequisites: JSON.parse(s.serializedData).prerequisites || {} };\n\t\t\t\t} catch {\n\t\t\t\t\treturn { prerequisites: {} };\n\t\t\t\t}\n\t\t\t});\n\t\t} catch (e) {\n\t\t\tlogger.debug(`[Prescribed] Failed to load hierarchy configs: ${e}`);\n\t\t\treturn [];\n\t\t}\n\t}\n\tbuildGroupRuntimeState(args) {\n\t\tconst { group, priorState, activeIds, seenIds, tagsByCard, cardsByTag, hierarchyConfigs, userTagElo, userGlobalElo } = args;\n\t\tconst encounteredTargets = /* @__PURE__ */ new Set();\n\t\tfor (const cardId of group.targetCardIds) if (activeIds.has(cardId) || seenIds.has(cardId)) encounteredTargets.add(cardId);\n\t\tif (priorState?.encounteredCardIds?.length) for (const cardId of priorState.encounteredCardIds) encounteredTargets.add(cardId);\n\t\tconst pendingTargets = group.targetCardIds.filter((id) => !encounteredTargets.has(id));\n\t\tconst targetTags = /* @__PURE__ */ new Map();\n\t\tfor (const cardId of pendingTargets) targetTags.set(cardId, tagsByCard.get(cardId) ?? []);\n\t\tconst blockedTargets = [];\n\t\tconst surfaceableTargets = [];\n\t\tconst supportTags = /* @__PURE__ */ new Set();\n\t\tfor (const cardId of pendingTargets) {\n\t\t\tconst tags = targetTags.get(cardId) ?? [];\n\t\t\tconst resolution = this.resolveBlockedSupportTags(tags, hierarchyConfigs, userTagElo, userGlobalElo, group.hierarchyWalk?.enabled !== false, group.hierarchyWalk?.maxDepth ?? DEFAULT_HIERARCHY_DEPTH);\n\t\t\tconst unmetExposeTags = unmetIntroExposeTags(tags, userTagElo, group.introExposeMinCount ?? DEFAULT_MIN_COUNT);\n\t\t\tif (unmetExposeTags.length > 0) unmetExposeTags.forEach((tag) => supportTags.add(tag));\n\t\t\tif (resolution.blocked || unmetExposeTags.length > 0) {\n\t\t\t\tblockedTargets.push(cardId);\n\t\t\t\tresolution.supportTags.forEach((t) => supportTags.add(t));\n\t\t\t} else surfaceableTargets.push(cardId);\n\t\t}\n\t\tconst supportCandidates = dedupe([...group.supportCardIds ?? [], ...this.findSupportCardsByTags(group, tagsByCard, [...supportTags])]).filter((id) => !activeIds.has(id) && !seenIds.has(id));\n\t\tconst discoveredSupportCandidates = blockedTargets.length > 0 && supportTags.size > 0 && supportCandidates.length === 0 ? this.findDiscoveredSupportCards({\n\t\t\tsupportTags: [...supportTags],\n\t\t\tcardsByTag,\n\t\t\tactiveIds,\n\t\t\tseenIds,\n\t\t\texcludedIds: new Set([...group.targetCardIds, ...group.supportCardIds ?? []]),\n\t\t\tlimit: group.maxSupportCardsPerRun ?? DEFAULT_MAX_SUPPORT_PER_RUN\n\t\t}) : [];\n\t\tif (blockedTargets.length > 0 && supportTags.size > 0 && discoveredSupportCandidates.length === 0) logger.info(`[Prescribed] Group '${group.id}' discovered 0 broader support candidates (blocked=${blockedTargets.length}; authoredSupport=${supportCandidates.length})`);\n\t\tconst sessionsSinceSurfaced = priorState?.sessionsSinceSurfaced ?? 0;\n\t\tconst freshnessWindow = group.freshnessWindowSessions ?? DEFAULT_FRESHNESS_WINDOW;\n\t\tconst staleSessions = Math.max(0, sessionsSinceSurfaced - freshnessWindow);\n\t\tconst pressureMultiplier = pendingTargets.length === 0 ? 1 : clamp(1 + staleSessions * .75 + Math.min(2, pendingTargets.length * .1), 1, MAX_TARGET_MULTIPLIER);\n\t\tconst supportMultiplier = blockedTargets.length === 0 ? 1 : clamp(1 + staleSessions * .5 + Math.min(1.5, blockedTargets.length * .15), 1, MAX_SUPPORT_MULTIPLIER);\n\t\treturn {\n\t\t\tgroup,\n\t\t\tencounteredTargets,\n\t\t\tpendingTargets,\n\t\t\tblockedTargets,\n\t\t\tsurfaceableTargets,\n\t\t\ttargetTags,\n\t\t\tsupportCandidates,\n\t\t\tdiscoveredSupportCandidates,\n\t\t\tsupportTags: [...supportTags],\n\t\t\tpressureMultiplier,\n\t\t\tsupportMultiplier,\n\t\t\tsessionsSinceSurfaced,\n\t\t\tdebugVersion: PRESCRIBED_DEBUG_VERSION\n\t\t};\n\t}\n\tbuildNextGroupState(runtime, prior) {\n\t\tconst carriedSessions = prior?.sessionsSinceSurfaced ?? 0;\n\t\treturn {\n\t\t\tencounteredCardIds: [...runtime.encounteredTargets].sort(),\n\t\t\tpendingTargetIds: [...runtime.pendingTargets].sort(),\n\t\t\tlastSurfacedAt: prior?.lastSurfacedAt ?? null,\n\t\t\tsessionsSinceSurfaced: carriedSessions + 1,\n\t\t\tlastSupportAt: prior?.lastSupportAt ?? null,\n\t\t\tblockedTargetIds: [...runtime.blockedTargets].sort(),\n\t\t\tlastResolvedSupportTags: [...runtime.supportTags].sort()\n\t\t};\n\t}\n\tbuildDirectTargetCards(runtime, courseId, emittedIds) {\n\t\tconst maxDirect = runtime.group.maxDirectTargetsPerRun ?? DEFAULT_MAX_DIRECT_PER_RUN;\n\t\tconst directIds = runtime.surfaceableTargets.filter((id) => !emittedIds.has(id)).slice(0, maxDirect);\n\t\tconst cards = [];\n\t\tfor (const cardId of directIds) {\n\t\t\temittedIds.add(cardId);\n\t\t\tcards.push({\n\t\t\t\tcardId,\n\t\t\t\tcourseId,\n\t\t\t\tscore: BASE_TARGET_SCORE * runtime.pressureMultiplier,\n\t\t\t\tprovenance: [{\n\t\t\t\t\tstrategy: \"prescribed\",\n\t\t\t\t\tstrategyName: this.strategyName || this.name,\n\t\t\t\t\tstrategyId: this.strategyId || \"NAVIGATION_STRATEGY-prescribed\",\n\t\t\t\t\taction: \"generated\",\n\t\t\t\t\tscore: BASE_TARGET_SCORE * runtime.pressureMultiplier,\n\t\t\t\t\treason: `mode=target;group=${runtime.group.id};pending=${runtime.pendingTargets.length};surfaceable=${runtime.surfaceableTargets.length};blocked=${runtime.blockedTargets.length};blockedTargets=${runtime.blockedTargets.join(\"|\") || \"none\"};supportTags=${runtime.supportTags.join(\"|\") || \"none\"};multiplier=${runtime.pressureMultiplier.toFixed(2)};testversion=${runtime.debugVersion}`\n\t\t\t\t}]\n\t\t\t});\n\t\t}\n\t\treturn cards;\n\t}\n\tbuildSupportCards(runtime, courseId, emittedIds) {\n\t\tif (runtime.blockedTargets.length === 0 || runtime.supportCandidates.length === 0) return [];\n\t\tconst maxSupport = runtime.group.maxSupportCardsPerRun ?? DEFAULT_MAX_SUPPORT_PER_RUN;\n\t\tconst supportIds = runtime.supportCandidates.filter((id) => !emittedIds.has(id)).slice(0, maxSupport);\n\t\tconst cards = [];\n\t\tfor (const cardId of supportIds) {\n\t\t\temittedIds.add(cardId);\n\t\t\tcards.push({\n\t\t\t\tcardId,\n\t\t\t\tcourseId,\n\t\t\t\tscore: BASE_SUPPORT_SCORE * runtime.supportMultiplier,\n\t\t\t\tprovenance: [{\n\t\t\t\t\tstrategy: \"prescribed\",\n\t\t\t\t\tstrategyName: this.strategyName || this.name,\n\t\t\t\t\tstrategyId: this.strategyId || \"NAVIGATION_STRATEGY-prescribed\",\n\t\t\t\t\taction: \"generated\",\n\t\t\t\t\tscore: BASE_SUPPORT_SCORE * runtime.supportMultiplier,\n\t\t\t\t\treason: `mode=support;group=${runtime.group.id};pending=${runtime.pendingTargets.length};blocked=${runtime.blockedTargets.length};blockedTargets=${runtime.blockedTargets.join(\"|\") || \"none\"};supportCard=${cardId};supportTags=${runtime.supportTags.join(\"|\") || \"none\"};multiplier=${runtime.supportMultiplier.toFixed(2)};testversion=${runtime.debugVersion}`\n\t\t\t\t}]\n\t\t\t});\n\t\t}\n\t\treturn cards;\n\t}\n\tbuildDiscoveredSupportCards(runtime, courseId, emittedIds) {\n\t\tif (runtime.blockedTargets.length === 0 || runtime.discoveredSupportCandidates.length === 0) return [];\n\t\tconst maxSupport = runtime.group.maxSupportCardsPerRun ?? DEFAULT_MAX_SUPPORT_PER_RUN;\n\t\tconst supportIds = runtime.discoveredSupportCandidates.filter((id) => !emittedIds.has(id)).slice(0, maxSupport);\n\t\tconst cards = [];\n\t\tfor (const cardId of supportIds) {\n\t\t\temittedIds.add(cardId);\n\t\t\tcards.push({\n\t\t\t\tcardId,\n\t\t\t\tcourseId,\n\t\t\t\tscore: DISCOVERED_SUPPORT_SCORE * runtime.supportMultiplier,\n\t\t\t\tprovenance: [{\n\t\t\t\t\tstrategy: \"prescribed\",\n\t\t\t\t\tstrategyName: this.strategyName || this.name,\n\t\t\t\t\tstrategyId: this.strategyId || \"NAVIGATION_STRATEGY-prescribed\",\n\t\t\t\t\taction: \"generated\",\n\t\t\t\t\tscore: DISCOVERED_SUPPORT_SCORE * runtime.supportMultiplier,\n\t\t\t\t\treason: `mode=discovered-support;group=${runtime.group.id};pending=${runtime.pendingTargets.length};blocked=${runtime.blockedTargets.length};blockedTargets=${runtime.blockedTargets.join(\"|\") || \"none\"};supportCard=${cardId};supportTags=${runtime.supportTags.join(\"|\") || \"none\"};multiplier=${runtime.supportMultiplier.toFixed(2)};testversion=${runtime.debugVersion}`\n\t\t\t\t}]\n\t\t\t});\n\t\t}\n\t\treturn cards;\n\t}\n\t/**\n\t* Emit drill cards for *unlocked-but-under-practiced* skills.\n\t*\n\t* For each course tag matching the group's `practiceTagPatterns` that is both\n\t* unlocked (all hierarchy prerequisites met — i.e. the learner has been\n\t* introduced to it) and under-practiced (per-tag attempt count below\n\t* `practiceMinCount`), this resolves cards carrying that tag and emits them\n\t* into the candidate pool. It exists because global-ELO retrieval\n\t* systematically fails to fetch the (low-ELO) drill cards for a\n\t* freshly-introduced skill — putting them in the pool here guarantees presence.\n\t*\n\t* Emphasis is a **practice-debt pressure** (parallel to SRS backlog pressure):\n\t* cards score `base × multiplier`, where the multiplier starts at\n\t* PRACTICE_BASE_MULT (so a few reps land promptly post-intro, competing with\n\t* pressured reviews) and escalates by how long the debt has stayed open\n\t* (per-tag, time-based via `priorPracticeDebt`/`nextPracticeDebt`), clamped at\n\t* MAX_PRACTICE_MULTIPLIER. The debt is durable and self-discharges the instant\n\t* the skill reaches `practiceMinCount` — so this no longer relies on the\n\t* session-scoped intro boost to actually surface.\n\t*\n\t* Fully data-driven: the unlock relation comes from the hierarchy config and\n\t* practice-status from per-tag ELO. No card-id or tag-namespace hard-coding.\n\t*/\n\tbuildPracticeCards(args) {\n\t\tconst { group, courseId, emittedIds, cardsByTag, hierarchyConfigs, userTagElo, userGlobalElo, activeIds, seenIds, priorPracticeDebt, nextPracticeDebt } = args;\n\t\tconst patterns = group.practiceTagPatterns ?? [];\n\t\tif (patterns.length === 0) return {\n\t\t\tcards: [],\n\t\t\tdebts: []\n\t\t};\n\t\tconst practiceMinCount = group.practiceMinCount ?? DEFAULT_PRACTICE_MIN_COUNT;\n\t\tconst maxPractice = group.maxPracticeCardsPerRun ?? DEFAULT_MAX_PRACTICE_PER_RUN;\n\t\tconst practiceTags = [...cardsByTag.keys()].filter((tag) => patterns.some((p) => matchesTagPattern(tag, p)) && this.isUnlockedGatedSkill(tag, hierarchyConfigs, userTagElo, userGlobalElo) && (userTagElo[tag]?.count ?? 0) < practiceMinCount);\n\t\tif (practiceTags.length === 0) return {\n\t\t\tcards: [],\n\t\t\tdebts: []\n\t\t};\n\t\tconst now = Date.now();\n\t\tconst DAY_MS = 1440 * 60 * 1e3;\n\t\tconst tagMultiplier = /* @__PURE__ */ new Map();\n\t\tfor (const tag of practiceTags) {\n\t\t\tconst firstOwedAt = priorPracticeDebt[tag] ?? isoNow();\n\t\t\tnextPracticeDebt[tag] = firstOwedAt;\n\t\t\tconst mult = clamp(PRACTICE_BASE_MULT + Math.max(0, (now - new Date(firstOwedAt).getTime()) / DAY_MS) * PRACTICE_STALENESS_BUMP_PER_DAY, PRACTICE_BASE_MULT, MAX_PRACTICE_MULTIPLIER);\n\t\t\ttagMultiplier.set(tag, mult);\n\t\t}\n\t\tconst debts = practiceTags.map((tag) => ({\n\t\t\ttag,\n\t\t\tmultiplier: tagMultiplier.get(tag) ?? PRACTICE_BASE_MULT,\n\t\t\tfirstOwedAt: nextPracticeDebt[tag]\n\t\t})).sort((a, b) => b.multiplier - a.multiplier || a.tag.localeCompare(b.tag));\n\t\tconst practiceCardIds = this.findDiscoveredSupportCards({\n\t\t\tsupportTags: practiceTags,\n\t\t\tcardsByTag,\n\t\t\tactiveIds,\n\t\t\tseenIds,\n\t\t\texcludedIds: emittedIds,\n\t\t\tlimit: maxPractice\n\t\t});\n\t\tif (practiceCardIds.length === 0) return {\n\t\t\tcards: [],\n\t\t\tdebts\n\t\t};\n\t\tlogger.info(`[Prescribed] Group '${group.id}' practice: ${practiceTags.length} unlocked under-practiced skill(s), emitting ${practiceCardIds.length} drill card(s)`);\n\t\tconst cards = [];\n\t\tfor (const cardId of practiceCardIds) {\n\t\t\temittedIds.add(cardId);\n\t\t\tlet mult = PRACTICE_BASE_MULT;\n\t\t\tfor (const tag of practiceTags) if (cardsByTag.get(tag)?.includes(cardId) ?? false) mult = Math.max(mult, tagMultiplier.get(tag) ?? PRACTICE_BASE_MULT);\n\t\t\tconst score = BASE_PRACTICE_SCORE * mult;\n\t\t\tcards.push({\n\t\t\t\tcardId,\n\t\t\t\tcourseId,\n\t\t\t\tscore,\n\t\t\t\tprovenance: [{\n\t\t\t\t\tstrategy: \"prescribed\",\n\t\t\t\t\tstrategyName: this.strategyName || this.name,\n\t\t\t\t\tstrategyId: this.strategyId || \"NAVIGATION_STRATEGY-prescribed\",\n\t\t\t\t\taction: \"generated\",\n\t\t\t\t\tscore,\n\t\t\t\t\treason: `mode=practice;group=${group.id};debtMult=×${mult.toFixed(2)};underPracticedSkills=${practiceTags.length};practiceTags=${practiceTags.slice(0, 8).join(\"|\")}${practiceTags.length > 8 ? \"|…\" : \"\"};testversion=${PRESCRIBED_DEBUG_VERSION}`\n\t\t\t\t}]\n\t\t\t});\n\t\t}\n\t\treturn {\n\t\t\tcards,\n\t\t\tdebts\n\t\t};\n\t}\n\t/**\n\t* True for a skill that was *gated and is now reached*: it has at least one\n\t* declared hierarchy prerequisite set, and every set is fully satisfied by the\n\t* learner's per-tag ELO. This deliberately EXCLUDES tags with no prerequisites\n\t* — an ungated tag was never \"introduced\" in the curricular sense, so it isn't\n\t* a post-intro drill target (e.g. whole-word spelling tags that share the\n\t* `gpc:exercise:*` prefix but have no intro gate). Those are left to normal\n\t* ELO retrieval. This is the precise population the retrieval gap strands:\n\t* just-unlocked, low-ELO skills.\n\t*/\n\tisUnlockedGatedSkill(tag, hierarchyConfigs, userTagElo, userGlobalElo) {\n\t\tconst prereqSets = hierarchyConfigs.map((hierarchy) => hierarchy.prerequisites[tag]).filter((prereqs) => Array.isArray(prereqs) && prereqs.length > 0);\n\t\tif (prereqSets.length === 0) return false;\n\t\treturn prereqSets.every((prereqs) => prereqs.every((pr) => this.isPrerequisiteMet(pr, userTagElo[pr.tag], userGlobalElo)));\n\t}\n\tfindSupportCardsByTags(group, tagsByCard, supportTags) {\n\t\tif (supportTags.length === 0) return [];\n\t\tconst explicitSupportIds = group.supportCardIds ?? [];\n\t\tconst explicitPatterns = group.supportTagPatterns ?? [];\n\t\tif (explicitSupportIds.length === 0 && explicitPatterns.length === 0) return [];\n\t\tconst candidates = /* @__PURE__ */ new Set();\n\t\tfor (const cardId of explicitSupportIds) {\n\t\t\tconst cardTags = tagsByCard.get(cardId) ?? [];\n\t\t\tconst matchesResolved = supportTags.some((supportTag) => cardTags.includes(supportTag));\n\t\t\tconst matchesPattern = explicitPatterns.some((pattern) => cardTags.some((tag) => matchesTagPattern(tag, pattern)));\n\t\t\tif (matchesResolved || matchesPattern) candidates.add(cardId);\n\t\t}\n\t\treturn [...candidates];\n\t}\n\tfindDiscoveredSupportCards(args) {\n\t\tconst { supportTags, cardsByTag, activeIds, seenIds, excludedIds, limit } = args;\n\t\tconst byCardId = /* @__PURE__ */ new Map();\n\t\tfor (const supportTag of supportTags) {\n\t\t\tconst taggedCards = cardsByTag.get(supportTag) ?? [];\n\t\t\tfor (const cardId of taggedCards) {\n\t\t\t\tif (activeIds.has(cardId) || seenIds.has(cardId) || excludedIds.has(cardId)) continue;\n\t\t\t\tconst existing = byCardId.get(cardId);\n\t\t\t\tif (existing) existing.matches += 1;\n\t\t\t\telse byCardId.set(cardId, {\n\t\t\t\t\tcardId,\n\t\t\t\t\tmatches: 1\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tconst candidates = [...byCardId.values()].sort((a, b) => b.matches - a.matches || a.cardId.localeCompare(b.cardId));\n\t\tconst usedStems = /* @__PURE__ */ new Set();\n\t\tconst diverse = [];\n\t\tconst deferred = [];\n\t\tfor (const entry of candidates) {\n\t\t\tconst stem = extractWordStem(entry.cardId);\n\t\t\tif (!usedStems.has(stem)) {\n\t\t\t\tusedStems.add(stem);\n\t\t\t\tdiverse.push(entry);\n\t\t\t} else deferred.push(entry);\n\t\t}\n\t\tshuffleInPlace(diverse);\n\t\tshuffleInPlace(deferred);\n\t\treturn [...diverse, ...deferred].slice(0, limit).map((entry) => entry.cardId);\n\t}\n\tresolveBlockedSupportTags(targetTags, hierarchyConfigs, userTagElo, userGlobalElo, hierarchyWalkEnabled, maxDepth) {\n\t\tconst supportTags = /* @__PURE__ */ new Set();\n\t\tlet blocked = false;\n\t\tfor (const targetTag of targetTags) {\n\t\t\tconst prereqSets = hierarchyConfigs.map((hierarchy) => hierarchy.prerequisites[targetTag]).filter((prereqs) => Array.isArray(prereqs) && prereqs.length > 0);\n\t\t\tif (prereqSets.length === 0) continue;\n\t\t\tif (!prereqSets.some((prereqs) => prereqs.some((pr) => !this.isPrerequisiteMet(pr, userTagElo[pr.tag], userGlobalElo)))) continue;\n\t\t\tblocked = true;\n\t\t\tif (!hierarchyWalkEnabled) {\n\t\t\t\tfor (const prereqs of prereqSets) for (const prereq of prereqs) if (!this.isPrerequisiteMet(prereq, userTagElo[prereq.tag], userGlobalElo)) supportTags.add(prereq.tag);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tfor (const prereqs of prereqSets) for (const prereq of prereqs) if (!this.isPrerequisiteMet(prereq, userTagElo[prereq.tag], userGlobalElo)) this.collectSupportTagsRecursive(prereq.tag, hierarchyConfigs, userTagElo, userGlobalElo, maxDepth, /* @__PURE__ */ new Set(), supportTags);\n\t\t}\n\t\treturn {\n\t\t\tblocked,\n\t\t\tsupportTags: [...supportTags]\n\t\t};\n\t}\n\tcollectSupportTagsRecursive(tag, hierarchyConfigs, userTagElo, userGlobalElo, depth, visited, out) {\n\t\tif (depth < 0 || visited.has(tag)) return;\n\t\tvisited.add(tag);\n\t\tlet walkedFurther = false;\n\t\tfor (const hierarchy of hierarchyConfigs) {\n\t\t\tconst prereqs = hierarchy.prerequisites[tag];\n\t\t\tif (!prereqs || prereqs.length === 0) continue;\n\t\t\tconst unmet = prereqs.filter((pr) => !this.isPrerequisiteMet(pr, userTagElo[pr.tag], userGlobalElo));\n\t\t\tif (unmet.length > 0 && depth > 0) {\n\t\t\t\twalkedFurther = true;\n\t\t\t\tfor (const prereq of unmet) this.collectSupportTagsRecursive(prereq.tag, hierarchyConfigs, userTagElo, userGlobalElo, depth - 1, visited, out);\n\t\t\t}\n\t\t}\n\t\tif (!walkedFurther) out.add(tag);\n\t}\n\tisPrerequisiteMet(prereq, userTagElo, userGlobalElo) {\n\t\tif (!userTagElo) return false;\n\t\tconst minCount = prereq.masteryThreshold?.minCount ?? DEFAULT_MIN_COUNT;\n\t\tif (userTagElo.count < minCount) return false;\n\t\tif (prereq.masteryThreshold?.minElo !== void 0) return userTagElo.score >= prereq.masteryThreshold.minElo;\n\t\tif (prereq.masteryThreshold?.minCount !== void 0) return true;\n\t\treturn userTagElo.score >= userGlobalElo;\n\t}\n};\n//#endregion\nexport { PrescribedCardsGenerator as default };\n\n//# sourceMappingURL=prescribed.mjs.map"],"mappings":"gMAMA,IAAM,EAA2B,EAC3B,EAA6B,EAC7B,EAA8B,EAC9B,EAA0B,EAC1B,EAAoB,EACpB,EAA6B,EAC7B,EAA+B,EAC/B,EAAoB,EACpB,EAAqB,GACrB,EAA2B,GAC3B,EAAsB,EACtB,EAAqB,EACrB,EAA0B,EAC1B,EAAkC,GAClC,EAAwB,EACxB,EAAyB,EACzB,EAA2B,4BACjC,SAAS,OAAO,EAAK,CACpB,MAAO,CAAC,GAAG,IAAI,IAAI,EAAI,CAAC,CAEzB,SAAS,QAAS,CACjB,OAAwB,IAAI,MAAM,CAAE,aAAa,CAElD,SAAS,MAAM,EAAO,EAAK,EAAK,CAC/B,OAAO,KAAK,IAAI,EAAK,KAAK,IAAI,EAAK,EAAM,CAAC,CAE3C,SAAS,kBAAkB,EAAK,EAAS,CACxC,GAAI,IAAY,IAAK,MAAO,GAC5B,IAAM,EAAU,EAAQ,QAAQ,oBAAqB,OAAO,CAAC,QAAQ,MAAO,KAAK,CACjF,OAAW,OAAO,IAAI,EAAQ,GAAG,CAAC,KAAK,EAAI,CAQ5C,SAAS,gBAAgB,EAAQ,CAChC,IAAK,IAAM,IAAU,CACpB,QACA,QACA,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GADF,EAAW,OAAS,EAAO,iBAAiB"}
@@ -0,0 +1,2 @@
1
+ import"./chunk-D6hFPZc3.js";import{t as e}from"./defineProperty-y9rbOPYz.js";import{l as t}from"./PipelineDebugger-BHaqzqZw.js";var n,r=.5,i=.5,a=`max`,o=(n=class RelativePriorityNavigator extends t{constructor(t,n,r){super(t,n,r),e(this,`config`,void 0),e(this,`name`,void 0),e(this,`kind`,RelativePriorityNavigator.kind),this.config=this.parseConfig(r.serializedData),this.name=r.name||`Relative Priority`}parseConfig(e){try{let t=JSON.parse(e);return{tagPriorities:t.tagPriorities||{},defaultPriority:t.defaultPriority??r,combineMode:t.combineMode??a,priorityInfluence:t.priorityInfluence??i}}catch{return{tagPriorities:{},defaultPriority:r,combineMode:a,priorityInfluence:i}}}getTagPriority(e){return this.config.tagPriorities[e]??this.config.defaultPriority??r}computeCardPriority(e){if(e.length===0)return this.config.defaultPriority??r;let t=e.map(e=>this.getTagPriority(e));switch(this.config.combineMode){case`max`:return Math.max(...t);case`min`:return Math.min(...t);case`average`:return t.reduce((e,t)=>e+t,0)/t.length;default:return Math.max(...t)}}computeBoostFactor(e){let t=this.config.priorityInfluence??i;return 1+(e-.5)*t}buildPriorityReason(e,t,n,r){if(e.length===0)return`No tags, neutral priority (${t.toFixed(2)})`;let i=e.slice(0,3).join(`, `),a=e.length>3?` (+${e.length-3} more)`:``;return n===1?`Neutral priority (${t.toFixed(2)}) for tags: ${i}${a}`:n>1?`High-priority tags: ${i}${a} (priority ${t.toFixed(2)} → boost ${n.toFixed(2)}x → ${r.toFixed(2)})`:`Low-priority tags: ${i}${a} (priority ${t.toFixed(2)} → reduce ${n.toFixed(2)}x → ${r.toFixed(2)})`}async transform(e,t){return await Promise.all(e.map(async e=>{let t=e.tags??[],n=this.computeCardPriority(t),r=this.computeBoostFactor(n),i=Math.max(0,e.score*r),a=r>1?`boosted`:r<1?`penalized`:`passed`,o=this.buildPriorityReason(t,n,r,i);return{...e,score:i,provenance:[...e.provenance,{strategy:`relativePriority`,strategyName:this.strategyName||this.name,strategyId:this.strategyId||`NAVIGATION_STRATEGY-priority`,action:a,score:i,reason:o}]}}))}async getWeightedCards(e){throw Error(`RelativePriorityNavigator is a filter and should not be used as a generator. Use Pipeline with a generator and this filter via transform().`)}},e(n,`kind`,`signal`),n);export{o as default};
2
+ //# sourceMappingURL=relativePriority-DwPMECAp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relativePriority-DwPMECAp.js","names":[],"sources":["../../../db/dist/core/navigators/filters/relativePriority.mjs"],"sourcesContent":["import \"../../../_virtual/_rolldown/runtime.mjs\";\nimport { ContentNavigator } from \"../index.mjs\";\n//#region src/core/navigators/filters/relativePriority.ts\nconst DEFAULT_PRIORITY = .5;\nconst DEFAULT_PRIORITY_INFLUENCE = .5;\nconst DEFAULT_COMBINE_MODE = \"max\";\n/**\n* A filter strategy that boosts scores for high-utility content.\n*\n* Course authors assign priority weights to tags. Cards with high-priority\n* tags get boosted scores, making them more likely to be presented first.\n* This allows teaching the most useful, well-behaved concepts before\n* moving on to rarer or more irregular ones.\n*\n* Example: When teaching phonics, prioritize common letters (s, t, a) over\n* rare ones (x, z, q) by assigning higher priority weights to common letters.\n*\n* Implements CardFilter for use in Pipeline architecture.\n* Also extends ContentNavigator for backward compatibility.\n*/\nvar RelativePriorityNavigator = class RelativePriorityNavigator extends ContentNavigator {\n\tconfig;\n\t/** Human-readable name for CardFilter interface */\n\tname;\n\t/** See CardFilter.kind. Static, so the pipeline plan can read it without an instance. */\n\tstatic kind = \"signal\";\n\tkind = RelativePriorityNavigator.kind;\n\tconstructor(user, course, strategyData) {\n\t\tsuper(user, course, strategyData);\n\t\tthis.config = this.parseConfig(strategyData.serializedData);\n\t\tthis.name = strategyData.name || \"Relative Priority\";\n\t}\n\tparseConfig(serializedData) {\n\t\ttry {\n\t\t\tconst parsed = JSON.parse(serializedData);\n\t\t\treturn {\n\t\t\t\ttagPriorities: parsed.tagPriorities || {},\n\t\t\t\tdefaultPriority: parsed.defaultPriority ?? DEFAULT_PRIORITY,\n\t\t\t\tcombineMode: parsed.combineMode ?? DEFAULT_COMBINE_MODE,\n\t\t\t\tpriorityInfluence: parsed.priorityInfluence ?? DEFAULT_PRIORITY_INFLUENCE\n\t\t\t};\n\t\t} catch {\n\t\t\treturn {\n\t\t\t\ttagPriorities: {},\n\t\t\t\tdefaultPriority: DEFAULT_PRIORITY,\n\t\t\t\tcombineMode: DEFAULT_COMBINE_MODE,\n\t\t\t\tpriorityInfluence: DEFAULT_PRIORITY_INFLUENCE\n\t\t\t};\n\t\t}\n\t}\n\t/**\n\t* Look up the priority for a tag.\n\t*/\n\tgetTagPriority(tagId) {\n\t\treturn this.config.tagPriorities[tagId] ?? this.config.defaultPriority ?? DEFAULT_PRIORITY;\n\t}\n\t/**\n\t* Compute combined priority for a card based on its tags.\n\t*/\n\tcomputeCardPriority(cardTags) {\n\t\tif (cardTags.length === 0) return this.config.defaultPriority ?? DEFAULT_PRIORITY;\n\t\tconst priorities = cardTags.map((tag) => this.getTagPriority(tag));\n\t\tswitch (this.config.combineMode) {\n\t\t\tcase \"max\": return Math.max(...priorities);\n\t\t\tcase \"min\": return Math.min(...priorities);\n\t\t\tcase \"average\": return priorities.reduce((sum, p) => sum + p, 0) / priorities.length;\n\t\t\tdefault: return Math.max(...priorities);\n\t\t}\n\t}\n\t/**\n\t* Compute boost factor based on priority.\n\t*\n\t* The formula: 1 + (priority - 0.5) * priorityInfluence\n\t*\n\t* This creates a multiplier centered around 1.0:\n\t* - Priority 1.0 with influence 0.5 → 1.25 (25% boost)\n\t* - Priority 0.5 with any influence → 1.00 (neutral)\n\t* - Priority 0.0 with influence 0.5 → 0.75 (25% reduction)\n\t*/\n\tcomputeBoostFactor(priority) {\n\t\tconst influence = this.config.priorityInfluence ?? DEFAULT_PRIORITY_INFLUENCE;\n\t\treturn 1 + (priority - .5) * influence;\n\t}\n\t/**\n\t* Build human-readable reason for priority adjustment.\n\t*/\n\tbuildPriorityReason(cardTags, priority, boostFactor, finalScore) {\n\t\tif (cardTags.length === 0) return `No tags, neutral priority (${priority.toFixed(2)})`;\n\t\tconst tagList = cardTags.slice(0, 3).join(\", \");\n\t\tconst more = cardTags.length > 3 ? ` (+${cardTags.length - 3} more)` : \"\";\n\t\tif (boostFactor === 1) return `Neutral priority (${priority.toFixed(2)}) for tags: ${tagList}${more}`;\n\t\telse if (boostFactor > 1) return `High-priority tags: ${tagList}${more} (priority ${priority.toFixed(2)} → boost ${boostFactor.toFixed(2)}x → ${finalScore.toFixed(2)})`;\n\t\telse return `Low-priority tags: ${tagList}${more} (priority ${priority.toFixed(2)} → reduce ${boostFactor.toFixed(2)}x → ${finalScore.toFixed(2)})`;\n\t}\n\t/**\n\t* CardFilter.transform implementation.\n\t*\n\t* Apply priority-adjusted scoring. Cards with high-priority tags get boosted,\n\t* cards with low-priority tags get reduced scores.\n\t*/\n\tasync transform(cards, _context) {\n\t\treturn await Promise.all(cards.map(async (card) => {\n\t\t\tconst cardTags = card.tags ?? [];\n\t\t\tconst priority = this.computeCardPriority(cardTags);\n\t\t\tconst boostFactor = this.computeBoostFactor(priority);\n\t\t\tconst finalScore = Math.max(0, card.score * boostFactor);\n\t\t\tconst action = boostFactor > 1 ? \"boosted\" : boostFactor < 1 ? \"penalized\" : \"passed\";\n\t\t\tconst reason = this.buildPriorityReason(cardTags, priority, boostFactor, finalScore);\n\t\t\treturn {\n\t\t\t\t...card,\n\t\t\t\tscore: finalScore,\n\t\t\t\tprovenance: [...card.provenance, {\n\t\t\t\t\tstrategy: \"relativePriority\",\n\t\t\t\t\tstrategyName: this.strategyName || this.name,\n\t\t\t\t\tstrategyId: this.strategyId || \"NAVIGATION_STRATEGY-priority\",\n\t\t\t\t\taction,\n\t\t\t\t\tscore: finalScore,\n\t\t\t\t\treason\n\t\t\t\t}]\n\t\t\t};\n\t\t}));\n\t}\n\t/**\n\t* Legacy getWeightedCards - now throws as filters should not be used as generators.\n\t*\n\t* Use transform() via Pipeline instead.\n\t*/\n\tasync getWeightedCards(_limit) {\n\t\tthrow new Error(\"RelativePriorityNavigator is a filter and should not be used as a generator. Use Pipeline with a generator and this filter via transform().\");\n\t}\n};\n//#endregion\nexport { RelativePriorityNavigator as default };\n\n//# sourceMappingURL=relativePriority.mjs.map"],"mappings":"sIAGM,EAAmB,GACnB,EAA6B,GAC7B,EAAuB,MAezB,GAAA,EAA4B,MAAM,kCAAkC,CAAiB,CAOxF,YAAY,EAAM,EAAQ,EAAc,CACvC,MAAM,EAAM,EAAQ,EAAa,QAPlC,SAAA,IAAA,GAAO,QAEP,OAAA,IAAA,GAAK,QAGL,OAAO,0BAA0B,KAAK,CAGrC,KAAK,OAAS,KAAK,YAAY,EAAa,eAAe,CAC3D,KAAK,KAAO,EAAa,MAAQ,oBAElC,YAAY,EAAgB,CAC3B,GAAI,CACH,IAAM,EAAS,KAAK,MAAM,EAAe,CACzC,MAAO,CACN,cAAe,EAAO,eAAiB,EAAE,CACzC,gBAAiB,EAAO,iBAAmB,EAC3C,YAAa,EAAO,aAAe,EACnC,kBAAmB,EAAO,mBAAqB,EAC/C,MACM,CACP,MAAO,CACN,cAAe,EAAE,CACjB,gBAAiB,EACjB,YAAa,EACb,kBAAmB,EACnB,EAMH,eAAe,EAAO,CACrB,OAAO,KAAK,OAAO,cAAc,IAAU,KAAK,OAAO,iBAAmB,EAK3E,oBAAoB,EAAU,CAC7B,GAAI,EAAS,SAAW,EAAG,OAAO,KAAK,OAAO,iBAAmB,EACjE,IAAM,EAAa,EAAS,IAAK,GAAQ,KAAK,eAAe,EAAI,CAAC,CAClE,OAAQ,KAAK,OAAO,YAApB,CACC,IAAK,MAAO,OAAO,KAAK,IAAI,GAAG,EAAW,CAC1C,IAAK,MAAO,OAAO,KAAK,IAAI,GAAG,EAAW,CAC1C,IAAK,UAAW,OAAO,EAAW,QAAQ,EAAK,IAAM,EAAM,EAAG,EAAE,CAAG,EAAW,OAC9E,QAAS,OAAO,KAAK,IAAI,GAAG,EAAW,EAazC,mBAAm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O,SAAS,CAAA"}
@@ -0,0 +1,2 @@
1
+ import"./chunk-D6hFPZc3.js";import{K as e}from"./contentSource-DwznMSMs.js";import{r as t}from"./index-CK-rfSIx.js";var n=t.EXPRESS_SERVER_PROTOCOL+`://`+t.EXPRESS_SERVER_URL;async function serverRequest(t){return new Promise(r=>{try{let i=new XMLHttpRequest;i.withCredentials=!0,i.open(`POST`,n,!0),i.setRequestHeader(`Content-Type`,`application/json`),i.timeout=t.timeout||7e3,i.onload=function(){try{t.response=JSON.parse(i.responseText),r(t)}catch(n){t.response={status:e.error,ok:!1,errorText:`Failed to parse response: ${n instanceof Error?n.message:JSON.stringify(n)}`},r(t)}},i.onerror=function(){t.response={status:e.error,ok:!1,errorText:`Network error occurred`},r(t)},i.ontimeout=function(){t.response={status:e.error,ok:!1,errorText:`Request timed out`},r(t)},i.send(JSON.stringify(t))}catch(n){t.response={status:e.error,ok:!1,errorText:n instanceof Error?n.message:JSON.stringify(n)},r(t)}})}export{serverRequest as t};
2
+ //# sourceMappingURL=server-CqR7xtQy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server-CqR7xtQy.js","names":[],"sources":["../../src/server/index.ts"],"sourcesContent":["import { Status } from '@vue-skuilder/common';\nimport ENV from '../ENVIRONMENT_VARS';\nimport { ServerRequest } from '@vue-skuilder/common';\n\nconst SERVER = ENV.EXPRESS_SERVER_PROTOCOL + '://' + ENV.EXPRESS_SERVER_URL;\n\n/**\n* Makes an authenticated request to the express backend and returns the response.\n\n* @param requestData\n* @returns\n*/\nexport default async function serverRequest<T extends ServerRequest>(requestData: T): Promise<T> {\n return new Promise<T>((resolve) => {\n try {\n const xml = new XMLHttpRequest();\n xml.withCredentials = true;\n xml.open('POST', SERVER, true);\n xml.setRequestHeader('Content-Type', 'application/json');\n xml.timeout = requestData.timeout || 7000;\n\n // Handle the response when it completes\n xml.onload = function () {\n try {\n requestData.response = JSON.parse(xml.responseText);\n resolve(requestData);\n } catch (parseError) {\n requestData.response = {\n status: Status.error,\n ok: false,\n errorText: `Failed to parse response: ${\n parseError instanceof Error ? parseError.message : JSON.stringify(parseError)\n }`,\n };\n resolve(requestData);\n }\n };\n\n // Handle network errors\n xml.onerror = function () {\n requestData.response = {\n status: Status.error,\n ok: false,\n errorText: 'Network error occurred',\n };\n resolve(requestData);\n };\n\n // Handle timeouts\n xml.ontimeout = function () {\n requestData.response = {\n status: Status.error,\n ok: false,\n errorText: 'Request timed out',\n };\n resolve(requestData);\n };\n\n // Send the request\n xml.send(JSON.stringify(requestData));\n } catch (error) {\n // Handle any errors that occur during setup\n requestData.response = {\n status: Status.error,\n ok: false,\n errorText: error instanceof Error ? error.message : JSON.stringify(error),\n };\n resolve(requestData);\n }\n });\n}\n"],"mappings":"oHAIA,IAAM,EAAS,EAAI,wBAA0B,MAAQ,EAAI,mBAQzD,eAA8B,cAAuC,EAA4B,CAC/F,OAAO,IAAI,QAAY,GAAY,CACjC,GAAI,CACF,IAAM,EAAM,IAAI,eAChB,EAAI,gBAAkB,GACtB,EAAI,KAAK,OAAQ,EAAQ,GAAK,CAC9B,EAAI,iBAAiB,eAAgB,mBAAmB,CACxD,EAAI,QAAU,EAAY,SAAW,IAGrC,EAAI,OAAS,UAAY,CACvB,GAAI,CACF,EAAY,SAAW,KAAK,MAAM,EAAI,aAAa,CACnD,EAAQ,EAAY,OACb,EAAY,CACnB,EAAY,SAAW,CACrB,OAAQ,EAAO,MACf,GAAI,GACJ,UAAW,6BACT,aAAsB,MAAQ,EAAW,QAAU,KAAK,UAAU,EAAW,GAEhF,CACD,EAAQ,EAAY,GAKxB,EAAI,QAAU,UAAY,CACxB,EAAY,SAAW,CACrB,OAAQ,EAAO,MACf,GAAI,GACJ,UAAW,yBACZ,CACD,EAAQ,EAAY,EAItB,EAAI,UAAY,UAAY,CAC1B,EAAY,SAAW,CACrB,OAAQ,EAAO,MACf,GAAI,GACJ,UAAW,oBACZ,CACD,EAAQ,EAAY,EAItB,EAAI,KAAK,KAAK,UAAU,EAAY,CAAC,OAC9B,EAAO,CAEd,EAAY,SAAW,CACrB,OAAQ,EAAO,MACf,GAAI,GACJ,UAAW,aAAiB,MAAQ,EAAM,QAAU,KAAK,UAAU,EAAM,CAC1E,CACD,EAAQ,EAAY,GAEtB"}