@vue-skuilder/db 0.2.29 → 0.2.31

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 (45) hide show
  1. package/dist/{contentSource-CqJmbOZN.d.ts → contentSource-DMduBjDC.d.ts} +19 -4
  2. package/dist/{contentSource-B6FrSihy.d.cts → contentSource-Doh1aVBJ.d.cts} +19 -4
  3. package/dist/core/index.d.cts +3 -3
  4. package/dist/core/index.d.ts +3 -3
  5. package/dist/core/index.js +128 -82
  6. package/dist/core/index.js.map +1 -1
  7. package/dist/core/index.mjs +80 -33
  8. package/dist/core/index.mjs.map +1 -1
  9. package/dist/{dataLayerProvider-DUxDqMtZ.d.cts → dataLayerProvider-BW1CBAbb.d.cts} +1 -1
  10. package/dist/{dataLayerProvider-B9_UCvkR.d.ts → dataLayerProvider-Cxfe4nSK.d.ts} +1 -1
  11. package/dist/diagnostics/index.d.cts +18 -3
  12. package/dist/diagnostics/index.d.ts +18 -3
  13. package/dist/diagnostics/index.js +159 -135
  14. package/dist/diagnostics/index.js.map +1 -1
  15. package/dist/diagnostics/index.mjs +156 -135
  16. package/dist/diagnostics/index.mjs.map +1 -1
  17. package/dist/impl/couch/index.d.cts +2 -2
  18. package/dist/impl/couch/index.d.ts +2 -2
  19. package/dist/impl/couch/index.js +132 -86
  20. package/dist/impl/couch/index.js.map +1 -1
  21. package/dist/impl/couch/index.mjs +80 -33
  22. package/dist/impl/couch/index.mjs.map +1 -1
  23. package/dist/impl/static/index.d.cts +2 -2
  24. package/dist/impl/static/index.d.ts +2 -2
  25. package/dist/impl/static/index.js +119 -73
  26. package/dist/impl/static/index.js.map +1 -1
  27. package/dist/impl/static/index.mjs +80 -33
  28. package/dist/impl/static/index.mjs.map +1 -1
  29. package/dist/index.d.cts +3 -3
  30. package/dist/index.d.ts +3 -3
  31. package/dist/index.js +181 -116
  32. package/dist/index.js.map +1 -1
  33. package/dist/index.mjs +105 -39
  34. package/dist/index.mjs.map +1 -1
  35. package/package.json +3 -3
  36. package/src/core/navigators/PipelineDebugger.ts +42 -23
  37. package/src/core/navigators/filters/eloDistance.ts +79 -21
  38. package/src/core/navigators/generators/elo.ts +8 -2
  39. package/src/core/navigators/generators/prescribed.ts +7 -5
  40. package/src/core/types/studySession.ts +12 -1
  41. package/src/diagnostics/derive.ts +5 -2
  42. package/src/diagnostics/pipeline.ts +28 -0
  43. package/src/diagnostics/text.ts +11 -4
  44. package/src/study/SessionController.ts +3 -1
  45. package/src/study/services/EloService.ts +33 -6
@@ -695,13 +695,12 @@ function clearRunHistory() {
695
695
  _pendingRuns = [];
696
696
  }
697
697
  function getOrigin(card) {
698
- const firstEntry = card.provenance[0];
699
- if (!firstEntry) return "unknown";
700
- const reason = firstEntry.reason?.toLowerCase() || "";
701
- const strategy = firstEntry.strategy?.toLowerCase() || "";
702
- if (reason.includes("new card") || strategy.includes("elo")) return "new";
703
- if (reason.includes("review") || strategy.includes("srs")) return "review";
704
- return "unknown";
698
+ return card.reviewID ? "review" : "new";
699
+ }
700
+ function requiredBy(card) {
701
+ return card.provenance.find(
702
+ (p) => p.strategy === "ephemeralHint" && p.score === Number.POSITIVE_INFINITY
703
+ )?.strategyName;
705
704
  }
706
705
  function captureRun(report) {
707
706
  const fullReport = {
@@ -725,17 +724,23 @@ function parseCardElo(provenance) {
725
724
  }
726
725
  function buildRunReport(courseId, courseName, generatorName, generators, generatedCount, filters, allCards, selectedCards, userElo, hints, scoredCards, regulators) {
727
726
  const selectedIds = new Set(selectedCards.map((c) => c.cardId));
728
- const toReport = (card) => ({
729
- cardId: card.cardId,
730
- courseId: card.courseId,
731
- origin: getOrigin(card),
732
- generator: card.provenance[0]?.strategyName || card.provenance[0]?.strategy,
733
- finalScore: card.score,
734
- cardElo: card.cardElo ?? parseCardElo(card.provenance),
735
- provenance: card.provenance,
736
- tags: card.tags,
737
- selected: selectedIds.has(card.cardId)
738
- });
727
+ const toReport = (card) => {
728
+ const required = requiredBy(card);
729
+ const first = card.provenance[0];
730
+ const generator = first && first.strategy !== "ephemeralHint" ? first.strategyName || first.strategy : void 0;
731
+ return {
732
+ cardId: card.cardId,
733
+ courseId: card.courseId,
734
+ origin: getOrigin(card),
735
+ ...generator ? { generator } : {},
736
+ ...required ? { required } : {},
737
+ finalScore: card.score,
738
+ cardElo: card.cardElo ?? parseCardElo(card.provenance),
739
+ provenance: card.provenance,
740
+ tags: card.tags,
741
+ selected: selectedIds.has(card.cardId)
742
+ };
743
+ };
739
744
  const selectedReported = [];
740
745
  const nearMissReported = [];
741
746
  const discardedTailCards = [];
@@ -1864,10 +1869,14 @@ var init_elo = __esm({
1864
1869
  const userElo = (0, import_common5.toCourseElo)(courseReg.elo);
1865
1870
  userGlobalElo = userElo.global.score;
1866
1871
  }
1867
- const activeCards = await this.user.getActiveCards();
1872
+ const [activeCards, seenCards] = await Promise.all([
1873
+ this.user.getActiveCards(),
1874
+ this.user.getSeenCards(this.course.getCourseID()).catch(() => [])
1875
+ ]);
1876
+ const notNew = /* @__PURE__ */ new Set([...activeCards.map((ac) => ac.cardID), ...seenCards]);
1868
1877
  const newCards = (await this.course.getCardsCenteredAtELO(
1869
1878
  { limit, elo: "user" },
1870
- (c) => !activeCards.some((ac) => c.cardID === ac.cardID)
1879
+ (c) => !notNew.has(c.cardID)
1871
1880
  )).map((c) => ({ ...c, status: "new" }));
1872
1881
  const scored = newCards.map((c) => {
1873
1882
  const cardElo = c.elo ?? 1e3;
@@ -1960,11 +1969,11 @@ function formatAge(ms) {
1960
1969
  }
1961
1970
  function unmetIntroExposeTags(tags, userTagElo, minCount) {
1962
1971
  if (minCount <= 0) return [];
1963
- const exposeTags = new Set(tags.filter((tag) => tag.startsWith("gpc:expose:")));
1972
+ const exposeTags = new Set(tags.filter((tag) => (0, import_common6.tagRole)(tag) === "expose"));
1964
1973
  for (const tag of tags) {
1965
- if (!tag.startsWith("gpc:intro:")) continue;
1966
- const suffix = tag.slice("gpc:intro:".length);
1967
- if (suffix) exposeTags.add(`gpc:expose:${suffix}`);
1974
+ if ((0, import_common6.tagRole)(tag) !== "intro") continue;
1975
+ const expose = (0, import_common6.withTagRole)(tag, "expose");
1976
+ if (expose) exposeTags.add(expose);
1968
1977
  }
1969
1978
  return [...exposeTags].filter((tag) => {
1970
1979
  const tagElo = userTagElo[tag];
@@ -1974,10 +1983,11 @@ function unmetIntroExposeTags(tags, userTagElo, minCount) {
1974
1983
  function pickTopByScore(cards, limit) {
1975
1984
  return [...cards].sort((a, b) => b.score - a.score || a.cardId.localeCompare(b.cardId)).slice(0, limit);
1976
1985
  }
1977
- var DEFAULT_FRESHNESS_WINDOW, DEFAULT_MAX_DIRECT_PER_RUN, DEFAULT_MAX_SUPPORT_PER_RUN, DEFAULT_HIERARCHY_DEPTH, DEFAULT_MIN_COUNT, DEFAULT_PRACTICE_MIN_COUNT, DEFAULT_MAX_PRACTICE_PER_RUN, BASE_TARGET_SCORE, BASE_SUPPORT_SCORE, DISCOVERED_SUPPORT_SCORE, BASE_PRACTICE_SCORE, PRACTICE_BASE_MULT, MAX_PRACTICE_MULTIPLIER, PRACTICE_STALENESS_BUMP_PER_DAY, MAX_TARGET_MULTIPLIER, MAX_SUPPORT_MULTIPLIER, PRESCRIBED_DEBUG_VERSION, PrescribedCardsGenerator;
1986
+ var import_common6, DEFAULT_FRESHNESS_WINDOW, DEFAULT_MAX_DIRECT_PER_RUN, DEFAULT_MAX_SUPPORT_PER_RUN, DEFAULT_HIERARCHY_DEPTH, DEFAULT_MIN_COUNT, DEFAULT_PRACTICE_MIN_COUNT, DEFAULT_MAX_PRACTICE_PER_RUN, BASE_TARGET_SCORE, BASE_SUPPORT_SCORE, DISCOVERED_SUPPORT_SCORE, BASE_PRACTICE_SCORE, PRACTICE_BASE_MULT, MAX_PRACTICE_MULTIPLIER, PRACTICE_STALENESS_BUMP_PER_DAY, MAX_TARGET_MULTIPLIER, MAX_SUPPORT_MULTIPLIER, PRESCRIBED_DEBUG_VERSION, PrescribedCardsGenerator;
1978
1987
  var init_prescribed = __esm({
1979
1988
  "src/core/navigators/generators/prescribed.ts"() {
1980
1989
  "use strict";
1990
+ import_common6 = require("@vue-skuilder/common");
1981
1991
  init_navigators();
1982
1992
  init_StrategyPressureDebugger();
1983
1993
  init_logger();
@@ -3163,6 +3173,7 @@ __export(eloDistance_exports, {
3163
3173
  DEFAULT_ELO_DISTANCE_CONFIG: () => DEFAULT_ELO_DISTANCE_CONFIG,
3164
3174
  createEloDistanceFilter: () => createEloDistanceFilter,
3165
3175
  default: () => EloDistanceFilter,
3176
+ mountMultiDimEloToggle: () => mountMultiDimEloToggle,
3166
3177
  tagAwareGap: () => tagAwareGap
3167
3178
  });
3168
3179
  function computeMultiplier(distance, halfLife, minMultiplier, maxMultiplier) {
@@ -3173,12 +3184,43 @@ function computeMultiplier(distance, halfLife, minMultiplier, maxMultiplier) {
3173
3184
  function resolveConfig(config) {
3174
3185
  return { ...DEFAULT_ELO_DISTANCE_CONFIG, ...config };
3175
3186
  }
3187
+ function readMultiDimElo() {
3188
+ try {
3189
+ return typeof localStorage !== "undefined" && localStorage.getItem(MULTI_DIM_ELO_KEY) === "true";
3190
+ } catch {
3191
+ return false;
3192
+ }
3193
+ }
3194
+ function mountMultiDimEloToggle() {
3195
+ if (typeof window === "undefined") return;
3196
+ const win = window;
3197
+ win.skuilder = win.skuilder || {};
3198
+ Object.defineProperty(win.skuilder, "multiDimElo", {
3199
+ configurable: true,
3200
+ enumerable: true,
3201
+ get: () => multiDimElo,
3202
+ set: (on) => {
3203
+ multiDimElo = on === true;
3204
+ try {
3205
+ if (multiDimElo) localStorage.setItem(MULTI_DIM_ELO_KEY, "true");
3206
+ else localStorage.removeItem(MULTI_DIM_ELO_KEY);
3207
+ } catch (e) {
3208
+ logger.warn(`[EloDistance] multiDimElo not persisted (localStorage unavailable): ${e}`);
3209
+ }
3210
+ logger.info(
3211
+ `[EloDistance] multiDimElo ${multiDimElo ? "on: tag-aware" : "off: per strategy config"} ELO distance from the next replan`
3212
+ );
3213
+ }
3214
+ });
3215
+ }
3176
3216
  function tagAwareGap(cardTags, cardElo, userElo, minTagCount) {
3177
3217
  const globalGap = cardElo.global.score - userElo.global.score;
3178
3218
  const tags = [];
3179
3219
  for (const tag of cardTags) {
3180
3220
  const user = userElo.tags[tag];
3181
- if (!user || user.score === COUNT_ONLY_SENTINEL || user.count < minTagCount) continue;
3221
+ if ((0, import_common7.isCountOnlyTag)(tag) || !user || user.score === import_common7.COUNT_ONLY_SCORE || user.count < minTagCount) {
3222
+ continue;
3223
+ }
3182
3224
  const card = cardElo.tags[tag]?.score ?? cardElo.global.score;
3183
3225
  tags.push({
3184
3226
  tag,
@@ -3200,7 +3242,7 @@ function tagReason(tags, globalGap) {
3200
3242
  async function applyEloDistance(cards, context, config, source) {
3201
3243
  const { course, userElo, userCourseElo } = context;
3202
3244
  const { halfLife, minMultiplier, maxMultiplier } = config;
3203
- const tagAware = config.tagAware && userCourseElo !== void 0;
3245
+ const tagAware = (config.tagAware || multiDimElo) && userCourseElo !== void 0;
3204
3246
  const missing = cards.filter((c) => tagAware || c.cardElo === void 0).map((c) => c.cardId);
3205
3247
  const fetched = /* @__PURE__ */ new Map();
3206
3248
  if (missing.length > 0) {
@@ -3214,10 +3256,10 @@ async function applyEloDistance(cards, context, config, source) {
3214
3256
  const cardElo = full?.global?.score ?? card.cardElo ?? DEFAULT_CARD_ELO;
3215
3257
  let distance = Math.abs(cardElo - userElo);
3216
3258
  let how = "";
3217
- if (tagAware && full) {
3218
- const t = tagAwareGap(card.tags ?? [], full, userCourseElo, config.minTagCount);
3219
- distance = Math.abs(t.gap);
3220
- if (t.tags.length > 0) how = tagReason(t.tags, t.globalGap);
3259
+ if (tagAware) {
3260
+ const t = full ? tagAwareGap(card.tags ?? [], full, userCourseElo, config.minTagCount) : void 0;
3261
+ if (t) distance = Math.abs(t.gap);
3262
+ how = t?.tags.length ? `, tag-aware${tagReason(t.tags, t.globalGap)}` : ", tag-aware: global (no shared tags)";
3221
3263
  }
3222
3264
  const multiplier = computeMultiplier(distance, halfLife, minMultiplier, maxMultiplier);
3223
3265
  const newScore = card.score * multiplier;
@@ -3250,21 +3292,25 @@ function createEloDistanceFilter(config) {
3250
3292
  transform: (cards, context) => applyEloDistance(cards, context, resolved, source)
3251
3293
  };
3252
3294
  }
3253
- var DEFAULT_ELO_DISTANCE_CONFIG, TAG_CONFIDENCE_HALF, COUNT_ONLY_SENTINEL, DEFAULT_CARD_ELO, EloDistanceFilter;
3295
+ var import_common7, DEFAULT_ELO_DISTANCE_CONFIG, TAG_CONFIDENCE_HALF, DEFAULT_CARD_ELO, MULTI_DIM_ELO_KEY, multiDimElo, EloDistanceFilter;
3254
3296
  var init_eloDistance = __esm({
3255
3297
  "src/core/navigators/filters/eloDistance.ts"() {
3256
3298
  "use strict";
3257
3299
  init_navigators();
3300
+ import_common7 = require("@vue-skuilder/common");
3301
+ init_logger();
3258
3302
  DEFAULT_ELO_DISTANCE_CONFIG = {
3259
3303
  halfLife: 300,
3260
3304
  minMultiplier: 0.05,
3261
3305
  maxMultiplier: 1,
3262
- tagAware: true,
3306
+ tagAware: false,
3263
3307
  minTagCount: 3
3264
3308
  };
3265
3309
  TAG_CONFIDENCE_HALF = 10;
3266
- COUNT_ONLY_SENTINEL = -1;
3267
3310
  DEFAULT_CARD_ELO = 1e3;
3311
+ MULTI_DIM_ELO_KEY = "skuilder:multiDimElo";
3312
+ multiDimElo = readMultiDimElo();
3313
+ mountMultiDimEloToggle();
3268
3314
  EloDistanceFilter = class _EloDistanceFilter extends ContentNavigator {
3269
3315
  name;
3270
3316
  /** See CardFilter.kind. Static, so the pipeline plan can read it without an instance. */
@@ -3303,12 +3349,12 @@ var hierarchyDefinition_exports = {};
3303
3349
  __export(hierarchyDefinition_exports, {
3304
3350
  default: () => HierarchyDefinitionNavigator
3305
3351
  });
3306
- var import_common6, DEFAULT_MIN_COUNT2, HierarchyDefinitionNavigator;
3352
+ var import_common8, DEFAULT_MIN_COUNT2, HierarchyDefinitionNavigator;
3307
3353
  var init_hierarchyDefinition = __esm({
3308
3354
  "src/core/navigators/filters/hierarchyDefinition.ts"() {
3309
3355
  "use strict";
3310
3356
  init_navigators();
3311
- import_common6 = require("@vue-skuilder/common");
3357
+ import_common8 = require("@vue-skuilder/common");
3312
3358
  init_logger();
3313
3359
  DEFAULT_MIN_COUNT2 = 3;
3314
3360
  HierarchyDefinitionNavigator = class _HierarchyDefinitionNavigator extends ContentNavigator {
@@ -3358,7 +3404,7 @@ var init_hierarchyDefinition = __esm({
3358
3404
  const mastered = /* @__PURE__ */ new Set();
3359
3405
  try {
3360
3406
  const courseReg = await context.user.getCourseRegDoc(context.course.getCourseID());
3361
- const userElo = (0, import_common6.toCourseElo)(courseReg.elo);
3407
+ const userElo = (0, import_common8.toCourseElo)(courseReg.elo);
3362
3408
  for (const prereqs of Object.values(this.config.prerequisites)) {
3363
3409
  for (const prereq of prereqs) {
3364
3410
  const tagElo = userElo.tags[prereq.tag];
@@ -3730,12 +3776,12 @@ var interferenceMitigator_exports = {};
3730
3776
  __export(interferenceMitigator_exports, {
3731
3777
  default: () => InterferenceMitigatorNavigator
3732
3778
  });
3733
- var import_common7, DEFAULT_MIN_COUNT3, DEFAULT_MIN_ELAPSED_DAYS, DEFAULT_INTERFERENCE_DECAY, InterferenceMitigatorNavigator;
3779
+ var import_common9, DEFAULT_MIN_COUNT3, DEFAULT_MIN_ELAPSED_DAYS, DEFAULT_INTERFERENCE_DECAY, InterferenceMitigatorNavigator;
3734
3780
  var init_interferenceMitigator = __esm({
3735
3781
  "src/core/navigators/filters/interferenceMitigator.ts"() {
3736
3782
  "use strict";
3737
3783
  init_navigators();
3738
- import_common7 = require("@vue-skuilder/common");
3784
+ import_common9 = require("@vue-skuilder/common");
3739
3785
  DEFAULT_MIN_COUNT3 = 10;
3740
3786
  DEFAULT_MIN_ELAPSED_DAYS = 3;
3741
3787
  DEFAULT_INTERFERENCE_DECAY = 0.8;
@@ -3820,7 +3866,7 @@ var init_interferenceMitigator = __esm({
3820
3866
  const immature = /* @__PURE__ */ new Set();
3821
3867
  try {
3822
3868
  const courseReg = await context.user.getCourseRegDoc(context.course.getCourseID());
3823
- const userElo = (0, import_common7.toCourseElo)(courseReg.elo);
3869
+ const userElo = (0, import_common9.toCourseElo)(courseReg.elo);
3824
3870
  const minCount = this.config.maturityThreshold?.minCount ?? DEFAULT_MIN_COUNT3;
3825
3871
  const minElo = this.config.maturityThreshold?.minElo;
3826
3872
  const minElapsedDays = this.config.maturityThreshold?.minElapsedDays ?? DEFAULT_MIN_ELAPSED_DAYS;
@@ -4611,11 +4657,11 @@ function logCardProvenance(cards, maxCards = 3) {
4611
4657
  }
4612
4658
  }
4613
4659
  }
4614
- var import_common8, VERBOSE_RESULTS, Pipeline;
4660
+ var import_common10, VERBOSE_RESULTS, Pipeline;
4615
4661
  var init_Pipeline = __esm({
4616
4662
  "src/core/navigators/Pipeline.ts"() {
4617
4663
  "use strict";
4618
- import_common8 = require("@vue-skuilder/common");
4664
+ import_common10 = require("@vue-skuilder/common");
4619
4665
  init_navigators();
4620
4666
  init_logger();
4621
4667
  init_orchestration();
@@ -5104,7 +5150,7 @@ var init_Pipeline = __esm({
5104
5150
  let userCourseElo;
5105
5151
  try {
5106
5152
  const courseReg = await this.user.getCourseRegDoc(this.course.getCourseID());
5107
- userCourseElo = (0, import_common8.toCourseElo)(courseReg.elo);
5153
+ userCourseElo = (0, import_common10.toCourseElo)(courseReg.elo);
5108
5154
  userElo = userCourseElo.global.score;
5109
5155
  } catch (e) {
5110
5156
  logger.debug(`[Pipeline] Could not get user ELO, using default: ${e}`);
@@ -5166,7 +5212,7 @@ var init_Pipeline = __esm({
5166
5212
  */
5167
5213
  async getTagEloStatus(tagFilter) {
5168
5214
  const courseReg = await this.user.getCourseRegDoc(this.course.getCourseID());
5169
- const courseElo = (0, import_common8.toCourseElo)(courseReg.elo);
5215
+ const courseElo = (0, import_common10.toCourseElo)(courseReg.elo);
5170
5216
  const result = {};
5171
5217
  if (!tagFilter) {
5172
5218
  for (const [tag, data] of Object.entries(courseElo.tags)) {
@@ -6067,11 +6113,11 @@ ${JSON.stringify(config)}
6067
6113
  function isSuccessRow(row) {
6068
6114
  return "doc" in row && row.doc !== null && row.doc !== void 0;
6069
6115
  }
6070
- var import_common9, CourseDB;
6116
+ var import_common11, CourseDB;
6071
6117
  var init_courseDB = __esm({
6072
6118
  "src/impl/couch/courseDB.ts"() {
6073
6119
  "use strict";
6074
- import_common9 = require("@vue-skuilder/common");
6120
+ import_common11 = require("@vue-skuilder/common");
6075
6121
  init_couch();
6076
6122
  init_updateQueue();
6077
6123
  init_types_legacy();
@@ -6175,14 +6221,14 @@ var init_courseDB = __esm({
6175
6221
  docs.rows.forEach((r) => {
6176
6222
  if (isSuccessRow(r)) {
6177
6223
  if (r.doc && r.doc.elo) {
6178
- ret.push((0, import_common9.toCourseElo)(r.doc.elo));
6224
+ ret.push((0, import_common11.toCourseElo)(r.doc.elo));
6179
6225
  } else {
6180
6226
  logger.warn("no elo data for card: " + r.id);
6181
- ret.push((0, import_common9.blankCourseElo)());
6227
+ ret.push((0, import_common11.blankCourseElo)());
6182
6228
  }
6183
6229
  } else {
6184
6230
  logger.warn("no elo data for card: " + JSON.stringify(r));
6185
- ret.push((0, import_common9.blankCourseElo)());
6231
+ ret.push((0, import_common11.blankCourseElo)());
6186
6232
  }
6187
6233
  });
6188
6234
  return ret;
@@ -6385,7 +6431,7 @@ ${above.rows.map((r) => ` ${r.id}-${r.key}
6385
6431
  async getCourseTagStubs() {
6386
6432
  return getCourseTagStubs(this.id);
6387
6433
  }
6388
- async addNote(codeCourse, shape, data, author, tags, uploads, elo = (0, import_common9.blankCourseElo)()) {
6434
+ async addNote(codeCourse, shape, data, author, tags, uploads, elo = (0, import_common11.blankCourseElo)()) {
6389
6435
  try {
6390
6436
  const resp = await addNote55(this.id, codeCourse, shape, data, author, tags, uploads, elo);
6391
6437
  if (resp.ok) {
@@ -6394,19 +6440,19 @@ ${above.rows.map((r) => ` ${r.id}-${r.key}
6394
6440
  `[courseDB.addNote] Note added but card creation failed: ${resp.cardCreationError}`
6395
6441
  );
6396
6442
  return {
6397
- status: import_common9.Status.error,
6443
+ status: import_common11.Status.error,
6398
6444
  message: `Note was added but no cards were created: ${resp.cardCreationError}`,
6399
6445
  id: resp.id
6400
6446
  };
6401
6447
  }
6402
6448
  return {
6403
- status: import_common9.Status.ok,
6449
+ status: import_common11.Status.ok,
6404
6450
  message: "",
6405
6451
  id: resp.id
6406
6452
  };
6407
6453
  } else {
6408
6454
  return {
6409
- status: import_common9.Status.error,
6455
+ status: import_common11.Status.error,
6410
6456
  message: "Unexpected error adding note"
6411
6457
  };
6412
6458
  }
@@ -6418,7 +6464,7 @@ ${above.rows.map((r) => ` ${r.id}-${r.key}
6418
6464
  message: ${err.message}`
6419
6465
  );
6420
6466
  return {
6421
- status: import_common9.Status.error,
6467
+ status: import_common11.Status.error,
6422
6468
  message: `Error adding note to course. ${e.reason || err.message}`
6423
6469
  };
6424
6470
  }
@@ -6612,7 +6658,7 @@ ${e.stack}` : JSON.stringify(e);
6612
6658
  const courseDoc = (await u.getCourseRegistrationsDoc()).courses.find((c) => {
6613
6659
  return c.courseID === this.id;
6614
6660
  });
6615
- targetElo = (0, import_common9.EloToNumber)(courseDoc.elo);
6661
+ targetElo = (0, import_common11.EloToNumber)(courseDoc.elo);
6616
6662
  } catch {
6617
6663
  targetElo = 1e3;
6618
6664
  }
@@ -6976,14 +7022,14 @@ var init_auth = __esm({
6976
7022
  });
6977
7023
 
6978
7024
  // src/impl/couch/CouchDBSyncStrategy.ts
6979
- var import_common10;
7025
+ var import_common12;
6980
7026
  var init_CouchDBSyncStrategy = __esm({
6981
7027
  "src/impl/couch/CouchDBSyncStrategy.ts"() {
6982
7028
  "use strict";
6983
7029
  init_factory();
6984
7030
  init_types_legacy();
6985
7031
  init_logger();
6986
- import_common10 = require("@vue-skuilder/common");
7032
+ import_common12 = require("@vue-skuilder/common");
6987
7033
  init_common();
6988
7034
  init_pouchdb_setup();
6989
7035
  init_couch();
@@ -7081,13 +7127,13 @@ function getStreak(records) {
7081
7127
  function getLapses(records) {
7082
7128
  return records.filter((r) => r.isCorrect === false).length;
7083
7129
  }
7084
- var import_moment4, import_common12, duration;
7130
+ var import_moment4, import_common14, duration;
7085
7131
  var init_SpacedRepetition = __esm({
7086
7132
  "src/study/SpacedRepetition.ts"() {
7087
7133
  "use strict";
7088
7134
  init_util();
7089
7135
  import_moment4 = __toESM(require("moment"), 1);
7090
- import_common12 = require("@vue-skuilder/common");
7136
+ import_common14 = require("@vue-skuilder/common");
7091
7137
  init_logger();
7092
7138
  duration = import_moment4.default.duration;
7093
7139
  }
@@ -7106,42 +7152,42 @@ var init_SrsService = __esm({
7106
7152
  });
7107
7153
 
7108
7154
  // src/study/services/tagRecent.ts
7109
- var import_common13;
7155
+ var import_common15;
7110
7156
  var init_tagRecent = __esm({
7111
7157
  "src/study/services/tagRecent.ts"() {
7112
7158
  "use strict";
7113
- import_common13 = require("@vue-skuilder/common");
7159
+ import_common15 = require("@vue-skuilder/common");
7114
7160
  }
7115
7161
  });
7116
7162
 
7117
7163
  // src/study/services/EloService.ts
7118
- var import_common14;
7164
+ var import_common16;
7119
7165
  var init_EloService = __esm({
7120
7166
  "src/study/services/EloService.ts"() {
7121
7167
  "use strict";
7122
- import_common14 = require("@vue-skuilder/common");
7168
+ import_common16 = require("@vue-skuilder/common");
7123
7169
  init_logger();
7124
7170
  init_tagRecent();
7125
7171
  }
7126
7172
  });
7127
7173
 
7128
7174
  // src/study/services/ResponseProcessor.ts
7129
- var import_common15;
7175
+ var import_common17;
7130
7176
  var init_ResponseProcessor = __esm({
7131
7177
  "src/study/services/ResponseProcessor.ts"() {
7132
7178
  "use strict";
7133
7179
  init_core();
7134
7180
  init_logger();
7135
- import_common15 = require("@vue-skuilder/common");
7181
+ import_common17 = require("@vue-skuilder/common");
7136
7182
  }
7137
7183
  });
7138
7184
 
7139
7185
  // src/study/services/CardHydrationService.ts
7140
- var import_common16;
7186
+ var import_common18;
7141
7187
  var init_CardHydrationService = __esm({
7142
7188
  "src/study/services/CardHydrationService.ts"() {
7143
7189
  "use strict";
7144
- import_common16 = require("@vue-skuilder/common");
7190
+ import_common18 = require("@vue-skuilder/common");
7145
7191
  init_logger();
7146
7192
  }
7147
7193
  });
@@ -9080,11 +9126,11 @@ var init_SessionController = __esm({
9080
9126
  });
9081
9127
 
9082
9128
  // src/study/TagFilteredContentSource.ts
9083
- var import_common17, TagFilteredContentSource;
9129
+ var import_common19, TagFilteredContentSource;
9084
9130
  var init_TagFilteredContentSource = __esm({
9085
9131
  "src/study/TagFilteredContentSource.ts"() {
9086
9132
  "use strict";
9087
- import_common17 = require("@vue-skuilder/common");
9133
+ import_common19 = require("@vue-skuilder/common");
9088
9134
  init_courseDB();
9089
9135
  init_logger();
9090
9136
  TagFilteredContentSource = class {
@@ -9170,7 +9216,7 @@ var init_TagFilteredContentSource = __esm({
9170
9216
  * @returns Cards sorted by score descending (all scores = 1.0)
9171
9217
  */
9172
9218
  async getWeightedCards(limit) {
9173
- if (!(0, import_common17.hasActiveFilter)(this.filter)) {
9219
+ if (!(0, import_common19.hasActiveFilter)(this.filter)) {
9174
9220
  logger.warn("[TagFilteredContentSource] getWeightedCards called with no active filter");
9175
9221
  return { cards: [] };
9176
9222
  }
@@ -9501,13 +9547,13 @@ async function dropUserFromClassroom(user, classID) {
9501
9547
  async function getUserClassrooms(user) {
9502
9548
  return getOrCreateClassroomRegistrationsDoc(user);
9503
9549
  }
9504
- var import_common18, import_moment8, log3, HYDRATION_TIMEOUT_MS, BaseUser, userCoursesDoc, userClassroomsDoc;
9550
+ var import_common20, import_moment8, log3, HYDRATION_TIMEOUT_MS, BaseUser, userCoursesDoc, userClassroomsDoc;
9505
9551
  var init_BaseUserDB = __esm({
9506
9552
  "src/impl/common/BaseUserDB.ts"() {
9507
9553
  "use strict";
9508
9554
  init_core();
9509
9555
  init_util();
9510
- import_common18 = require("@vue-skuilder/common");
9556
+ import_common20 = require("@vue-skuilder/common");
9511
9557
  import_moment8 = __toESM(require("moment"), 1);
9512
9558
  init_types_legacy();
9513
9559
  init_logger();
@@ -9610,7 +9656,7 @@ Currently logged-in as ${this._username}.`
9610
9656
  );
9611
9657
  }
9612
9658
  const result = await this.syncStrategy.createAccount(username, password);
9613
- if (result.status === import_common18.Status.ok) {
9659
+ if (result.status === import_common20.Status.ok) {
9614
9660
  log3(`Account created successfully, updating username to ${username}`);
9615
9661
  this._username = username;
9616
9662
  try {
@@ -9686,7 +9732,7 @@ Currently logged-in as ${this._username}.`
9686
9732
  async resetUserData() {
9687
9733
  if (this.syncStrategy.canAuthenticate()) {
9688
9734
  return {
9689
- status: import_common18.Status.error,
9735
+ status: import_common20.Status.error,
9690
9736
  error: "Reset user data is only available for local-only mode. Use logout instead for remote sync."
9691
9737
  };
9692
9738
  }
@@ -9708,11 +9754,11 @@ Currently logged-in as ${this._username}.`
9708
9754
  await localDB.bulkDocs(docsToDelete);
9709
9755
  }
9710
9756
  await this.init();
9711
- return { status: import_common18.Status.ok };
9757
+ return { status: import_common20.Status.ok };
9712
9758
  } catch (error) {
9713
9759
  logger.error("Failed to reset user data:", error);
9714
9760
  return {
9715
- status: import_common18.Status.error,
9761
+ status: import_common20.Status.error,
9716
9762
  error: error instanceof Error ? error.message : "Unknown error during reset"
9717
9763
  };
9718
9764
  }
@@ -10650,19 +10696,19 @@ async function getStudySource(source, user) {
10650
10696
  if (source.type === "classroom") {
10651
10697
  return await StudentClassroomDB.factory(source.id, user);
10652
10698
  } else {
10653
- if ((0, import_common20.hasActiveFilter)(source.tagFilter)) {
10699
+ if ((0, import_common22.hasActiveFilter)(source.tagFilter)) {
10654
10700
  return new TagFilteredContentSource(source.id, source.tagFilter, user);
10655
10701
  }
10656
10702
  return getDataLayer().getCourseDB(source.id);
10657
10703
  }
10658
10704
  }
10659
- var import_common20;
10705
+ var import_common22;
10660
10706
  var init_contentSource = __esm({
10661
10707
  "src/core/interfaces/contentSource.ts"() {
10662
10708
  "use strict";
10663
10709
  init_factory();
10664
10710
  init_classroomDB2();
10665
- import_common20 = require("@vue-skuilder/common");
10711
+ import_common22 = require("@vue-skuilder/common");
10666
10712
  init_TagFilteredContentSource();
10667
10713
  }
10668
10714
  });
@@ -10802,7 +10848,7 @@ elo: ${elo}`;
10802
10848
  misc: {}
10803
10849
  } : void 0
10804
10850
  );
10805
- if (result.status === import_common21.Status.ok) {
10851
+ if (result.status === import_common23.Status.ok) {
10806
10852
  return {
10807
10853
  originalText,
10808
10854
  status: "success",
@@ -10846,11 +10892,11 @@ function validateProcessorConfig(config) {
10846
10892
  }
10847
10893
  return { isValid: true };
10848
10894
  }
10849
- var import_common21;
10895
+ var import_common23;
10850
10896
  var init_cardProcessor = __esm({
10851
10897
  "src/core/bulkImport/cardProcessor.ts"() {
10852
10898
  "use strict";
10853
- import_common21 = require("@vue-skuilder/common");
10899
+ import_common23 = require("@vue-skuilder/common");
10854
10900
  init_logger();
10855
10901
  }
10856
10902
  });