@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
@@ -770,13 +770,12 @@ function clearRunHistory() {
770
770
  _pendingRuns = [];
771
771
  }
772
772
  function getOrigin(card) {
773
- const firstEntry = card.provenance[0];
774
- if (!firstEntry) return "unknown";
775
- const reason = firstEntry.reason?.toLowerCase() || "";
776
- const strategy = firstEntry.strategy?.toLowerCase() || "";
777
- if (reason.includes("new card") || strategy.includes("elo")) return "new";
778
- if (reason.includes("review") || strategy.includes("srs")) return "review";
779
- return "unknown";
773
+ return card.reviewID ? "review" : "new";
774
+ }
775
+ function requiredBy(card) {
776
+ return card.provenance.find(
777
+ (p) => p.strategy === "ephemeralHint" && p.score === Number.POSITIVE_INFINITY
778
+ )?.strategyName;
780
779
  }
781
780
  function captureRun(report) {
782
781
  const fullReport = {
@@ -800,17 +799,23 @@ function parseCardElo(provenance) {
800
799
  }
801
800
  function buildRunReport(courseId, courseName, generatorName, generators, generatedCount, filters, allCards, selectedCards, userElo, hints, scoredCards, regulators) {
802
801
  const selectedIds = new Set(selectedCards.map((c) => c.cardId));
803
- const toReport = (card) => ({
804
- cardId: card.cardId,
805
- courseId: card.courseId,
806
- origin: getOrigin(card),
807
- generator: card.provenance[0]?.strategyName || card.provenance[0]?.strategy,
808
- finalScore: card.score,
809
- cardElo: card.cardElo ?? parseCardElo(card.provenance),
810
- provenance: card.provenance,
811
- tags: card.tags,
812
- selected: selectedIds.has(card.cardId)
813
- });
802
+ const toReport = (card) => {
803
+ const required = requiredBy(card);
804
+ const first = card.provenance[0];
805
+ const generator = first && first.strategy !== "ephemeralHint" ? first.strategyName || first.strategy : void 0;
806
+ return {
807
+ cardId: card.cardId,
808
+ courseId: card.courseId,
809
+ origin: getOrigin(card),
810
+ ...generator ? { generator } : {},
811
+ ...required ? { required } : {},
812
+ finalScore: card.score,
813
+ cardElo: card.cardElo ?? parseCardElo(card.provenance),
814
+ provenance: card.provenance,
815
+ tags: card.tags,
816
+ selected: selectedIds.has(card.cardId)
817
+ };
818
+ };
814
819
  const selectedReported = [];
815
820
  const nearMissReported = [];
816
821
  const discardedTailCards = [];
@@ -1939,10 +1944,14 @@ var init_elo = __esm({
1939
1944
  const userElo = (0, import_common5.toCourseElo)(courseReg.elo);
1940
1945
  userGlobalElo = userElo.global.score;
1941
1946
  }
1942
- const activeCards = await this.user.getActiveCards();
1947
+ const [activeCards, seenCards] = await Promise.all([
1948
+ this.user.getActiveCards(),
1949
+ this.user.getSeenCards(this.course.getCourseID()).catch(() => [])
1950
+ ]);
1951
+ const notNew = /* @__PURE__ */ new Set([...activeCards.map((ac) => ac.cardID), ...seenCards]);
1943
1952
  const newCards = (await this.course.getCardsCenteredAtELO(
1944
1953
  { limit, elo: "user" },
1945
- (c) => !activeCards.some((ac) => c.cardID === ac.cardID)
1954
+ (c) => !notNew.has(c.cardID)
1946
1955
  )).map((c) => ({ ...c, status: "new" }));
1947
1956
  const scored = newCards.map((c) => {
1948
1957
  const cardElo = c.elo ?? 1e3;
@@ -2035,11 +2044,11 @@ function formatAge(ms) {
2035
2044
  }
2036
2045
  function unmetIntroExposeTags(tags, userTagElo, minCount) {
2037
2046
  if (minCount <= 0) return [];
2038
- const exposeTags = new Set(tags.filter((tag) => tag.startsWith("gpc:expose:")));
2047
+ const exposeTags = new Set(tags.filter((tag) => (0, import_common6.tagRole)(tag) === "expose"));
2039
2048
  for (const tag of tags) {
2040
- if (!tag.startsWith("gpc:intro:")) continue;
2041
- const suffix = tag.slice("gpc:intro:".length);
2042
- if (suffix) exposeTags.add(`gpc:expose:${suffix}`);
2049
+ if ((0, import_common6.tagRole)(tag) !== "intro") continue;
2050
+ const expose = (0, import_common6.withTagRole)(tag, "expose");
2051
+ if (expose) exposeTags.add(expose);
2043
2052
  }
2044
2053
  return [...exposeTags].filter((tag) => {
2045
2054
  const tagElo = userTagElo[tag];
@@ -2049,10 +2058,11 @@ function unmetIntroExposeTags(tags, userTagElo, minCount) {
2049
2058
  function pickTopByScore(cards, limit) {
2050
2059
  return [...cards].sort((a, b) => b.score - a.score || a.cardId.localeCompare(b.cardId)).slice(0, limit);
2051
2060
  }
2052
- 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;
2061
+ 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;
2053
2062
  var init_prescribed = __esm({
2054
2063
  "src/core/navigators/generators/prescribed.ts"() {
2055
2064
  "use strict";
2065
+ import_common6 = require("@vue-skuilder/common");
2056
2066
  init_navigators();
2057
2067
  init_StrategyPressureDebugger();
2058
2068
  init_logger();
@@ -3238,6 +3248,7 @@ __export(eloDistance_exports, {
3238
3248
  DEFAULT_ELO_DISTANCE_CONFIG: () => DEFAULT_ELO_DISTANCE_CONFIG,
3239
3249
  createEloDistanceFilter: () => createEloDistanceFilter,
3240
3250
  default: () => EloDistanceFilter,
3251
+ mountMultiDimEloToggle: () => mountMultiDimEloToggle,
3241
3252
  tagAwareGap: () => tagAwareGap
3242
3253
  });
3243
3254
  function computeMultiplier(distance, halfLife, minMultiplier, maxMultiplier) {
@@ -3248,12 +3259,43 @@ function computeMultiplier(distance, halfLife, minMultiplier, maxMultiplier) {
3248
3259
  function resolveConfig(config) {
3249
3260
  return { ...DEFAULT_ELO_DISTANCE_CONFIG, ...config };
3250
3261
  }
3262
+ function readMultiDimElo() {
3263
+ try {
3264
+ return typeof localStorage !== "undefined" && localStorage.getItem(MULTI_DIM_ELO_KEY) === "true";
3265
+ } catch {
3266
+ return false;
3267
+ }
3268
+ }
3269
+ function mountMultiDimEloToggle() {
3270
+ if (typeof window === "undefined") return;
3271
+ const win = window;
3272
+ win.skuilder = win.skuilder || {};
3273
+ Object.defineProperty(win.skuilder, "multiDimElo", {
3274
+ configurable: true,
3275
+ enumerable: true,
3276
+ get: () => multiDimElo,
3277
+ set: (on) => {
3278
+ multiDimElo = on === true;
3279
+ try {
3280
+ if (multiDimElo) localStorage.setItem(MULTI_DIM_ELO_KEY, "true");
3281
+ else localStorage.removeItem(MULTI_DIM_ELO_KEY);
3282
+ } catch (e) {
3283
+ logger.warn(`[EloDistance] multiDimElo not persisted (localStorage unavailable): ${e}`);
3284
+ }
3285
+ logger.info(
3286
+ `[EloDistance] multiDimElo ${multiDimElo ? "on: tag-aware" : "off: per strategy config"} ELO distance from the next replan`
3287
+ );
3288
+ }
3289
+ });
3290
+ }
3251
3291
  function tagAwareGap(cardTags, cardElo, userElo, minTagCount) {
3252
3292
  const globalGap = cardElo.global.score - userElo.global.score;
3253
3293
  const tags = [];
3254
3294
  for (const tag of cardTags) {
3255
3295
  const user = userElo.tags[tag];
3256
- if (!user || user.score === COUNT_ONLY_SENTINEL || user.count < minTagCount) continue;
3296
+ if ((0, import_common7.isCountOnlyTag)(tag) || !user || user.score === import_common7.COUNT_ONLY_SCORE || user.count < minTagCount) {
3297
+ continue;
3298
+ }
3257
3299
  const card = cardElo.tags[tag]?.score ?? cardElo.global.score;
3258
3300
  tags.push({
3259
3301
  tag,
@@ -3275,7 +3317,7 @@ function tagReason(tags, globalGap) {
3275
3317
  async function applyEloDistance(cards, context, config, source) {
3276
3318
  const { course, userElo, userCourseElo } = context;
3277
3319
  const { halfLife, minMultiplier, maxMultiplier } = config;
3278
- const tagAware = config.tagAware && userCourseElo !== void 0;
3320
+ const tagAware = (config.tagAware || multiDimElo) && userCourseElo !== void 0;
3279
3321
  const missing = cards.filter((c) => tagAware || c.cardElo === void 0).map((c) => c.cardId);
3280
3322
  const fetched = /* @__PURE__ */ new Map();
3281
3323
  if (missing.length > 0) {
@@ -3289,10 +3331,10 @@ async function applyEloDistance(cards, context, config, source) {
3289
3331
  const cardElo = full?.global?.score ?? card.cardElo ?? DEFAULT_CARD_ELO;
3290
3332
  let distance = Math.abs(cardElo - userElo);
3291
3333
  let how = "";
3292
- if (tagAware && full) {
3293
- const t = tagAwareGap(card.tags ?? [], full, userCourseElo, config.minTagCount);
3294
- distance = Math.abs(t.gap);
3295
- if (t.tags.length > 0) how = tagReason(t.tags, t.globalGap);
3334
+ if (tagAware) {
3335
+ const t = full ? tagAwareGap(card.tags ?? [], full, userCourseElo, config.minTagCount) : void 0;
3336
+ if (t) distance = Math.abs(t.gap);
3337
+ how = t?.tags.length ? `, tag-aware${tagReason(t.tags, t.globalGap)}` : ", tag-aware: global (no shared tags)";
3296
3338
  }
3297
3339
  const multiplier = computeMultiplier(distance, halfLife, minMultiplier, maxMultiplier);
3298
3340
  const newScore = card.score * multiplier;
@@ -3325,21 +3367,25 @@ function createEloDistanceFilter(config) {
3325
3367
  transform: (cards, context) => applyEloDistance(cards, context, resolved, source)
3326
3368
  };
3327
3369
  }
3328
- var DEFAULT_ELO_DISTANCE_CONFIG, TAG_CONFIDENCE_HALF, COUNT_ONLY_SENTINEL, DEFAULT_CARD_ELO, EloDistanceFilter;
3370
+ var import_common7, DEFAULT_ELO_DISTANCE_CONFIG, TAG_CONFIDENCE_HALF, DEFAULT_CARD_ELO, MULTI_DIM_ELO_KEY, multiDimElo, EloDistanceFilter;
3329
3371
  var init_eloDistance = __esm({
3330
3372
  "src/core/navigators/filters/eloDistance.ts"() {
3331
3373
  "use strict";
3332
3374
  init_navigators();
3375
+ import_common7 = require("@vue-skuilder/common");
3376
+ init_logger();
3333
3377
  DEFAULT_ELO_DISTANCE_CONFIG = {
3334
3378
  halfLife: 300,
3335
3379
  minMultiplier: 0.05,
3336
3380
  maxMultiplier: 1,
3337
- tagAware: true,
3381
+ tagAware: false,
3338
3382
  minTagCount: 3
3339
3383
  };
3340
3384
  TAG_CONFIDENCE_HALF = 10;
3341
- COUNT_ONLY_SENTINEL = -1;
3342
3385
  DEFAULT_CARD_ELO = 1e3;
3386
+ MULTI_DIM_ELO_KEY = "skuilder:multiDimElo";
3387
+ multiDimElo = readMultiDimElo();
3388
+ mountMultiDimEloToggle();
3343
3389
  EloDistanceFilter = class _EloDistanceFilter extends ContentNavigator {
3344
3390
  name;
3345
3391
  /** See CardFilter.kind. Static, so the pipeline plan can read it without an instance. */
@@ -3378,12 +3424,12 @@ var hierarchyDefinition_exports = {};
3378
3424
  __export(hierarchyDefinition_exports, {
3379
3425
  default: () => HierarchyDefinitionNavigator
3380
3426
  });
3381
- var import_common6, DEFAULT_MIN_COUNT2, HierarchyDefinitionNavigator;
3427
+ var import_common8, DEFAULT_MIN_COUNT2, HierarchyDefinitionNavigator;
3382
3428
  var init_hierarchyDefinition = __esm({
3383
3429
  "src/core/navigators/filters/hierarchyDefinition.ts"() {
3384
3430
  "use strict";
3385
3431
  init_navigators();
3386
- import_common6 = require("@vue-skuilder/common");
3432
+ import_common8 = require("@vue-skuilder/common");
3387
3433
  init_logger();
3388
3434
  DEFAULT_MIN_COUNT2 = 3;
3389
3435
  HierarchyDefinitionNavigator = class _HierarchyDefinitionNavigator extends ContentNavigator {
@@ -3433,7 +3479,7 @@ var init_hierarchyDefinition = __esm({
3433
3479
  const mastered = /* @__PURE__ */ new Set();
3434
3480
  try {
3435
3481
  const courseReg = await context.user.getCourseRegDoc(context.course.getCourseID());
3436
- const userElo = (0, import_common6.toCourseElo)(courseReg.elo);
3482
+ const userElo = (0, import_common8.toCourseElo)(courseReg.elo);
3437
3483
  for (const prereqs of Object.values(this.config.prerequisites)) {
3438
3484
  for (const prereq of prereqs) {
3439
3485
  const tagElo = userElo.tags[prereq.tag];
@@ -3805,12 +3851,12 @@ var interferenceMitigator_exports = {};
3805
3851
  __export(interferenceMitigator_exports, {
3806
3852
  default: () => InterferenceMitigatorNavigator
3807
3853
  });
3808
- var import_common7, DEFAULT_MIN_COUNT3, DEFAULT_MIN_ELAPSED_DAYS, DEFAULT_INTERFERENCE_DECAY, InterferenceMitigatorNavigator;
3854
+ var import_common9, DEFAULT_MIN_COUNT3, DEFAULT_MIN_ELAPSED_DAYS, DEFAULT_INTERFERENCE_DECAY, InterferenceMitigatorNavigator;
3809
3855
  var init_interferenceMitigator = __esm({
3810
3856
  "src/core/navigators/filters/interferenceMitigator.ts"() {
3811
3857
  "use strict";
3812
3858
  init_navigators();
3813
- import_common7 = require("@vue-skuilder/common");
3859
+ import_common9 = require("@vue-skuilder/common");
3814
3860
  DEFAULT_MIN_COUNT3 = 10;
3815
3861
  DEFAULT_MIN_ELAPSED_DAYS = 3;
3816
3862
  DEFAULT_INTERFERENCE_DECAY = 0.8;
@@ -3895,7 +3941,7 @@ var init_interferenceMitigator = __esm({
3895
3941
  const immature = /* @__PURE__ */ new Set();
3896
3942
  try {
3897
3943
  const courseReg = await context.user.getCourseRegDoc(context.course.getCourseID());
3898
- const userElo = (0, import_common7.toCourseElo)(courseReg.elo);
3944
+ const userElo = (0, import_common9.toCourseElo)(courseReg.elo);
3899
3945
  const minCount = this.config.maturityThreshold?.minCount ?? DEFAULT_MIN_COUNT3;
3900
3946
  const minElo = this.config.maturityThreshold?.minElo;
3901
3947
  const minElapsedDays = this.config.maturityThreshold?.minElapsedDays ?? DEFAULT_MIN_ELAPSED_DAYS;
@@ -4440,11 +4486,11 @@ function logCardProvenance(cards, maxCards = 3) {
4440
4486
  }
4441
4487
  }
4442
4488
  }
4443
- var import_common8, VERBOSE_RESULTS, Pipeline;
4489
+ var import_common10, VERBOSE_RESULTS, Pipeline;
4444
4490
  var init_Pipeline = __esm({
4445
4491
  "src/core/navigators/Pipeline.ts"() {
4446
4492
  "use strict";
4447
- import_common8 = require("@vue-skuilder/common");
4493
+ import_common10 = require("@vue-skuilder/common");
4448
4494
  init_navigators();
4449
4495
  init_logger();
4450
4496
  init_orchestration();
@@ -4933,7 +4979,7 @@ var init_Pipeline = __esm({
4933
4979
  let userCourseElo;
4934
4980
  try {
4935
4981
  const courseReg = await this.user.getCourseRegDoc(this.course.getCourseID());
4936
- userCourseElo = (0, import_common8.toCourseElo)(courseReg.elo);
4982
+ userCourseElo = (0, import_common10.toCourseElo)(courseReg.elo);
4937
4983
  userElo = userCourseElo.global.score;
4938
4984
  } catch (e) {
4939
4985
  logger.debug(`[Pipeline] Could not get user ELO, using default: ${e}`);
@@ -4995,7 +5041,7 @@ var init_Pipeline = __esm({
4995
5041
  */
4996
5042
  async getTagEloStatus(tagFilter) {
4997
5043
  const courseReg = await this.user.getCourseRegDoc(this.course.getCourseID());
4998
- const courseElo = (0, import_common8.toCourseElo)(courseReg.elo);
5044
+ const courseElo = (0, import_common10.toCourseElo)(courseReg.elo);
4999
5045
  const result = {};
5000
5046
  if (!tagFilter) {
5001
5047
  for (const [tag, data] of Object.entries(courseElo.tags)) {
@@ -5938,11 +5984,11 @@ ${JSON.stringify(config)}
5938
5984
  function isSuccessRow(row) {
5939
5985
  return "doc" in row && row.doc !== null && row.doc !== void 0;
5940
5986
  }
5941
- var import_common9, CoursesDB, CourseDB;
5987
+ var import_common11, CoursesDB, CourseDB;
5942
5988
  var init_courseDB = __esm({
5943
5989
  "src/impl/couch/courseDB.ts"() {
5944
5990
  "use strict";
5945
- import_common9 = require("@vue-skuilder/common");
5991
+ import_common11 = require("@vue-skuilder/common");
5946
5992
  init_couch();
5947
5993
  init_updateQueue();
5948
5994
  init_types_legacy();
@@ -6091,14 +6137,14 @@ var init_courseDB = __esm({
6091
6137
  docs.rows.forEach((r) => {
6092
6138
  if (isSuccessRow(r)) {
6093
6139
  if (r.doc && r.doc.elo) {
6094
- ret.push((0, import_common9.toCourseElo)(r.doc.elo));
6140
+ ret.push((0, import_common11.toCourseElo)(r.doc.elo));
6095
6141
  } else {
6096
6142
  logger.warn("no elo data for card: " + r.id);
6097
- ret.push((0, import_common9.blankCourseElo)());
6143
+ ret.push((0, import_common11.blankCourseElo)());
6098
6144
  }
6099
6145
  } else {
6100
6146
  logger.warn("no elo data for card: " + JSON.stringify(r));
6101
- ret.push((0, import_common9.blankCourseElo)());
6147
+ ret.push((0, import_common11.blankCourseElo)());
6102
6148
  }
6103
6149
  });
6104
6150
  return ret;
@@ -6301,7 +6347,7 @@ ${above.rows.map((r) => ` ${r.id}-${r.key}
6301
6347
  async getCourseTagStubs() {
6302
6348
  return getCourseTagStubs(this.id);
6303
6349
  }
6304
- async addNote(codeCourse, shape, data, author, tags, uploads, elo = (0, import_common9.blankCourseElo)()) {
6350
+ async addNote(codeCourse, shape, data, author, tags, uploads, elo = (0, import_common11.blankCourseElo)()) {
6305
6351
  try {
6306
6352
  const resp = await addNote55(this.id, codeCourse, shape, data, author, tags, uploads, elo);
6307
6353
  if (resp.ok) {
@@ -6310,19 +6356,19 @@ ${above.rows.map((r) => ` ${r.id}-${r.key}
6310
6356
  `[courseDB.addNote] Note added but card creation failed: ${resp.cardCreationError}`
6311
6357
  );
6312
6358
  return {
6313
- status: import_common9.Status.error,
6359
+ status: import_common11.Status.error,
6314
6360
  message: `Note was added but no cards were created: ${resp.cardCreationError}`,
6315
6361
  id: resp.id
6316
6362
  };
6317
6363
  }
6318
6364
  return {
6319
- status: import_common9.Status.ok,
6365
+ status: import_common11.Status.ok,
6320
6366
  message: "",
6321
6367
  id: resp.id
6322
6368
  };
6323
6369
  } else {
6324
6370
  return {
6325
- status: import_common9.Status.error,
6371
+ status: import_common11.Status.error,
6326
6372
  message: "Unexpected error adding note"
6327
6373
  };
6328
6374
  }
@@ -6334,7 +6380,7 @@ ${above.rows.map((r) => ` ${r.id}-${r.key}
6334
6380
  message: ${err.message}`
6335
6381
  );
6336
6382
  return {
6337
- status: import_common9.Status.error,
6383
+ status: import_common11.Status.error,
6338
6384
  message: `Error adding note to course. ${e.reason || err.message}`
6339
6385
  };
6340
6386
  }
@@ -6528,7 +6574,7 @@ ${e.stack}` : JSON.stringify(e);
6528
6574
  const courseDoc = (await u.getCourseRegistrationsDoc()).courses.find((c) => {
6529
6575
  return c.courseID === this.id;
6530
6576
  });
6531
- targetElo = (0, import_common9.EloToNumber)(courseDoc.elo);
6577
+ targetElo = (0, import_common11.EloToNumber)(courseDoc.elo);
6532
6578
  } catch {
6533
6579
  targetElo = 1e3;
6534
6580
  }
@@ -6951,11 +6997,11 @@ var init_classroomDB2 = __esm({
6951
6997
  });
6952
6998
 
6953
6999
  // src/study/TagFilteredContentSource.ts
6954
- var import_common10, TagFilteredContentSource;
7000
+ var import_common12, TagFilteredContentSource;
6955
7001
  var init_TagFilteredContentSource = __esm({
6956
7002
  "src/study/TagFilteredContentSource.ts"() {
6957
7003
  "use strict";
6958
- import_common10 = require("@vue-skuilder/common");
7004
+ import_common12 = require("@vue-skuilder/common");
6959
7005
  init_courseDB();
6960
7006
  init_logger();
6961
7007
  TagFilteredContentSource = class {
@@ -7041,7 +7087,7 @@ var init_TagFilteredContentSource = __esm({
7041
7087
  * @returns Cards sorted by score descending (all scores = 1.0)
7042
7088
  */
7043
7089
  async getWeightedCards(limit) {
7044
- if (!(0, import_common10.hasActiveFilter)(this.filter)) {
7090
+ if (!(0, import_common12.hasActiveFilter)(this.filter)) {
7045
7091
  logger.warn("[TagFilteredContentSource] getWeightedCards called with no active filter");
7046
7092
  return { cards: [] };
7047
7093
  }
@@ -7129,19 +7175,19 @@ async function getStudySource(source, user) {
7129
7175
  if (source.type === "classroom") {
7130
7176
  return await StudentClassroomDB.factory(source.id, user);
7131
7177
  } else {
7132
- if ((0, import_common11.hasActiveFilter)(source.tagFilter)) {
7178
+ if ((0, import_common13.hasActiveFilter)(source.tagFilter)) {
7133
7179
  return new TagFilteredContentSource(source.id, source.tagFilter, user);
7134
7180
  }
7135
7181
  return getDataLayer().getCourseDB(source.id);
7136
7182
  }
7137
7183
  }
7138
- var import_common11;
7184
+ var import_common13;
7139
7185
  var init_contentSource = __esm({
7140
7186
  "src/core/interfaces/contentSource.ts"() {
7141
7187
  "use strict";
7142
7188
  init_factory();
7143
7189
  init_classroomDB2();
7144
- import_common11 = require("@vue-skuilder/common");
7190
+ import_common13 = require("@vue-skuilder/common");
7145
7191
  init_TagFilteredContentSource();
7146
7192
  }
7147
7193
  });
@@ -7239,11 +7285,11 @@ var init_util = __esm({
7239
7285
  });
7240
7286
 
7241
7287
  // src/core/bulkImport/cardProcessor.ts
7242
- var import_common12;
7288
+ var import_common14;
7243
7289
  var init_cardProcessor = __esm({
7244
7290
  "src/core/bulkImport/cardProcessor.ts"() {
7245
7291
  "use strict";
7246
- import_common12 = require("@vue-skuilder/common");
7292
+ import_common14 = require("@vue-skuilder/common");
7247
7293
  init_logger();
7248
7294
  }
7249
7295
  });
@@ -7748,13 +7794,13 @@ function getStreak(records) {
7748
7794
  function getLapses(records) {
7749
7795
  return records.filter((r) => r.isCorrect === false).length;
7750
7796
  }
7751
- var import_moment4, import_common13, duration;
7797
+ var import_moment4, import_common15, duration;
7752
7798
  var init_SpacedRepetition = __esm({
7753
7799
  "src/study/SpacedRepetition.ts"() {
7754
7800
  "use strict";
7755
7801
  init_util();
7756
7802
  import_moment4 = __toESM(require("moment"), 1);
7757
- import_common13 = require("@vue-skuilder/common");
7803
+ import_common15 = require("@vue-skuilder/common");
7758
7804
  init_logger();
7759
7805
  duration = import_moment4.default.duration;
7760
7806
  }
@@ -7773,42 +7819,42 @@ var init_SrsService = __esm({
7773
7819
  });
7774
7820
 
7775
7821
  // src/study/services/tagRecent.ts
7776
- var import_common14;
7822
+ var import_common16;
7777
7823
  var init_tagRecent = __esm({
7778
7824
  "src/study/services/tagRecent.ts"() {
7779
7825
  "use strict";
7780
- import_common14 = require("@vue-skuilder/common");
7826
+ import_common16 = require("@vue-skuilder/common");
7781
7827
  }
7782
7828
  });
7783
7829
 
7784
7830
  // src/study/services/EloService.ts
7785
- var import_common15;
7831
+ var import_common17;
7786
7832
  var init_EloService = __esm({
7787
7833
  "src/study/services/EloService.ts"() {
7788
7834
  "use strict";
7789
- import_common15 = require("@vue-skuilder/common");
7835
+ import_common17 = require("@vue-skuilder/common");
7790
7836
  init_logger();
7791
7837
  init_tagRecent();
7792
7838
  }
7793
7839
  });
7794
7840
 
7795
7841
  // src/study/services/ResponseProcessor.ts
7796
- var import_common16;
7842
+ var import_common18;
7797
7843
  var init_ResponseProcessor = __esm({
7798
7844
  "src/study/services/ResponseProcessor.ts"() {
7799
7845
  "use strict";
7800
7846
  init_core();
7801
7847
  init_logger();
7802
- import_common16 = require("@vue-skuilder/common");
7848
+ import_common18 = require("@vue-skuilder/common");
7803
7849
  }
7804
7850
  });
7805
7851
 
7806
7852
  // src/study/services/CardHydrationService.ts
7807
- var import_common17;
7853
+ var import_common19;
7808
7854
  var init_CardHydrationService = __esm({
7809
7855
  "src/study/services/CardHydrationService.ts"() {
7810
7856
  "use strict";
7811
- import_common17 = require("@vue-skuilder/common");
7857
+ import_common19 = require("@vue-skuilder/common");
7812
7858
  init_logger();
7813
7859
  }
7814
7860
  });
@@ -9974,13 +10020,13 @@ async function dropUserFromClassroom(user, classID) {
9974
10020
  async function getUserClassrooms(user) {
9975
10021
  return getOrCreateClassroomRegistrationsDoc(user);
9976
10022
  }
9977
- var import_common18, import_moment7, log3, HYDRATION_TIMEOUT_MS, BaseUser, userCoursesDoc, userClassroomsDoc;
10023
+ var import_common20, import_moment7, log3, HYDRATION_TIMEOUT_MS, BaseUser, userCoursesDoc, userClassroomsDoc;
9978
10024
  var init_BaseUserDB = __esm({
9979
10025
  "src/impl/common/BaseUserDB.ts"() {
9980
10026
  "use strict";
9981
10027
  init_core();
9982
10028
  init_util();
9983
- import_common18 = require("@vue-skuilder/common");
10029
+ import_common20 = require("@vue-skuilder/common");
9984
10030
  import_moment7 = __toESM(require("moment"), 1);
9985
10031
  init_types_legacy();
9986
10032
  init_logger();
@@ -10083,7 +10129,7 @@ Currently logged-in as ${this._username}.`
10083
10129
  );
10084
10130
  }
10085
10131
  const result = await this.syncStrategy.createAccount(username, password);
10086
- if (result.status === import_common18.Status.ok) {
10132
+ if (result.status === import_common20.Status.ok) {
10087
10133
  log3(`Account created successfully, updating username to ${username}`);
10088
10134
  this._username = username;
10089
10135
  try {
@@ -10159,7 +10205,7 @@ Currently logged-in as ${this._username}.`
10159
10205
  async resetUserData() {
10160
10206
  if (this.syncStrategy.canAuthenticate()) {
10161
10207
  return {
10162
- status: import_common18.Status.error,
10208
+ status: import_common20.Status.error,
10163
10209
  error: "Reset user data is only available for local-only mode. Use logout instead for remote sync."
10164
10210
  };
10165
10211
  }
@@ -10181,11 +10227,11 @@ Currently logged-in as ${this._username}.`
10181
10227
  await localDB.bulkDocs(docsToDelete);
10182
10228
  }
10183
10229
  await this.init();
10184
- return { status: import_common18.Status.ok };
10230
+ return { status: import_common20.Status.ok };
10185
10231
  } catch (error) {
10186
10232
  logger.error("Failed to reset user data:", error);
10187
10233
  return {
10188
- status: import_common18.Status.error,
10234
+ status: import_common20.Status.error,
10189
10235
  error: error instanceof Error ? error.message : "Unknown error during reset"
10190
10236
  };
10191
10237
  }
@@ -11526,14 +11572,14 @@ var init_auth = __esm({
11526
11572
  });
11527
11573
 
11528
11574
  // src/impl/couch/CouchDBSyncStrategy.ts
11529
- var import_common20, log4, CouchDBSyncStrategy;
11575
+ var import_common22, log4, CouchDBSyncStrategy;
11530
11576
  var init_CouchDBSyncStrategy = __esm({
11531
11577
  "src/impl/couch/CouchDBSyncStrategy.ts"() {
11532
11578
  "use strict";
11533
11579
  init_factory();
11534
11580
  init_types_legacy();
11535
11581
  init_logger();
11536
- import_common20 = require("@vue-skuilder/common");
11582
+ import_common22 = require("@vue-skuilder/common");
11537
11583
  init_common();
11538
11584
  init_pouchdb_setup();
11539
11585
  init_couch();
@@ -11674,32 +11720,32 @@ var init_CouchDBSyncStrategy = __esm({
11674
11720
  }
11675
11721
  }
11676
11722
  return {
11677
- status: import_common20.Status.ok,
11723
+ status: import_common22.Status.ok,
11678
11724
  error: void 0
11679
11725
  };
11680
11726
  } else {
11681
11727
  return {
11682
- status: import_common20.Status.error,
11728
+ status: import_common22.Status.error,
11683
11729
  error: "Failed to log in after account creation"
11684
11730
  };
11685
11731
  }
11686
11732
  } else {
11687
11733
  logger.warn(`Signup not OK: ${JSON.stringify(signupRequest)}`);
11688
11734
  return {
11689
- status: import_common20.Status.error,
11735
+ status: import_common22.Status.error,
11690
11736
  error: "Account creation failed"
11691
11737
  };
11692
11738
  }
11693
11739
  } catch (e) {
11694
11740
  if (e.reason === "Document update conflict.") {
11695
11741
  return {
11696
- status: import_common20.Status.error,
11742
+ status: import_common22.Status.error,
11697
11743
  error: "This username is taken!"
11698
11744
  };
11699
11745
  }
11700
11746
  logger.error(`Error on signup: ${JSON.stringify(e)}`);
11701
11747
  return {
11702
- status: import_common20.Status.error,
11748
+ status: import_common22.Status.error,
11703
11749
  error: e.message || "Unknown error during account creation"
11704
11750
  };
11705
11751
  }