@instructure/platform-notebook 1.8.0 → 1.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,23 +1,23 @@
1
- import { jsx as i, jsxs as C, Fragment as dt } from "react/jsx-runtime";
2
- import { createContext as ze, useMemo as me, useContext as qe, useReducer as Ke, useRef as _, useEffect as j, useState as U, useCallback as K } from "react";
3
- import { createPortal as ut } from "react-dom";
1
+ import { jsx as s, jsxs as I, Fragment as qe } from "react/jsx-runtime";
2
+ import { createContext as Ke, useMemo as me, useContext as Xe, useReducer as Qe, useRef as B, useEffect as W, useState as U, useCallback as K } from "react";
3
+ import { createPortal as ft } from "react-dom";
4
4
  import { z as f } from "zod";
5
- import ft from "diff-match-patch";
6
- import { useQueryClient as xe, useMutation as Re, useQuery as mt } from "@tanstack/react-query";
7
- import { CloseButton as gt, Button as te, IconButton as ue } from "@instructure/ui-buttons";
5
+ import mt from "diff-match-patch";
6
+ import { useQueryClient as Re, useMutation as ke, useQuery as gt } from "@tanstack/react-query";
7
+ import { CloseButton as ht, Button as ne, IconButton as ue } from "@instructure/ui-buttons";
8
8
  import { Flex as x } from "@instructure/ui-flex";
9
9
  import { Heading as Ne } from "@instructure/ui-heading";
10
- import { Tray as ht } from "@instructure/ui-tray";
10
+ import { Tray as pt } from "@instructure/ui-tray";
11
11
  import { View as Q } from "@instructure/ui-view";
12
- import { IconQuestionLine as ke, IconPinLine as we, IconWarningLine as pt, IconNoteLine as yt, IconEditLine as ve, IconTrashLine as ye, IconArrowStartLine as Nt } from "@instructure/ui-icons";
12
+ import { IconQuestionLine as we, IconPinLine as Oe, IconWarningLine as yt, IconNoteLine as Nt, IconEditLine as Ie, IconTrashLine as ye, IconArrowStartLine as bt } from "@instructure/ui-icons";
13
13
  import { Menu as ce } from "@instructure/ui-menu";
14
- import { TruncateText as Ie } from "@instructure/ui-truncate-text";
15
- import { SimpleSelect as Me } from "@instructure/ui-simple-select";
16
- import { Text as ee } from "@instructure/ui-text";
17
- import { ScreenReaderContent as bt } from "@instructure/ui-a11y-content";
14
+ import { TruncateText as Ce } from "@instructure/ui-truncate-text";
15
+ import { SimpleSelect as Be } from "@instructure/ui-simple-select";
16
+ import { Text as te } from "@instructure/ui-text";
17
+ import { ScreenReaderContent as Se } from "@instructure/ui-a11y-content";
18
18
  import { Dialog as Et } from "@instructure/ui-dialog";
19
- import { TextArea as Xe } from "@instructure/ui-text-area";
20
- import { Pill as Be } from "@instructure/ui-pill";
19
+ import { TextArea as Ye } from "@instructure/ui-text-area";
20
+ import { Pill as $e } from "@instructure/ui-pill";
21
21
  import { Pagination as St } from "@instructure/ui-pagination";
22
22
  import { Spinner as Tt } from "@instructure/ui-spinner";
23
23
  const vt = f.object({
@@ -28,15 +28,15 @@ const vt = f.object({
28
28
  }), It = f.object({
29
29
  start: f.number(),
30
30
  end: f.number()
31
- }), Oe = f.object({
31
+ }), Le = f.object({
32
32
  selectedText: f.string(),
33
33
  hasNoHighlightAnymore: f.boolean().optional(),
34
34
  textPosition: It.nullable(),
35
35
  range: vt.nullable(),
36
36
  pageLastModifiedAt: f.string()
37
37
  });
38
- var A = /* @__PURE__ */ ((t) => (t.IMPORTANT = "Important", t.CONFUSING = "Confusing", t))(A || {});
39
- const Le = f.enum([
38
+ var O = /* @__PURE__ */ ((t) => (t.IMPORTANT = "Important", t.CONFUSING = "Confusing", t))(O || {});
39
+ const Ae = f.enum([
40
40
  "Important",
41
41
  "Confusing"
42
42
  /* CONFUSING */
@@ -51,8 +51,8 @@ const Le = f.enum([
51
51
  objectId: f.string(),
52
52
  objectType: f.string(),
53
53
  userText: f.string().optional(),
54
- reaction: f.array(Le),
55
- highlightData: Oe,
54
+ reaction: f.array(Ae),
55
+ highlightData: Le,
56
56
  createdAt: f.string(),
57
57
  updatedAt: f.string()
58
58
  }), xt = f.object({
@@ -85,8 +85,8 @@ f.object({
85
85
  objectId: f.string(),
86
86
  objectType: f.string(),
87
87
  userText: f.string().optional(),
88
- reaction: f.array(Le),
89
- highlightData: Oe
88
+ reaction: f.array(Ae),
89
+ highlightData: Le
90
90
  });
91
91
  f.object({
92
92
  createNote: be
@@ -94,8 +94,8 @@ f.object({
94
94
  f.object({
95
95
  id: f.string(),
96
96
  userText: f.string().optional(),
97
- reaction: f.array(Le),
98
- highlightData: Oe
97
+ reaction: f.array(Ae),
98
+ highlightData: Le
99
99
  });
100
100
  f.object({
101
101
  updateNote: be
@@ -103,14 +103,14 @@ f.object({
103
103
  f.object({
104
104
  deleteNote: f.string()
105
105
  });
106
- var Qe = /* @__PURE__ */ ((t) => (t[t.FORWARDS = 1] = "FORWARDS", t[t.BACKWARDS = 2] = "BACKWARDS", t))(Qe || {});
107
- class ne {
106
+ var Ve = /* @__PURE__ */ ((t) => (t[t.FORWARDS = 1] = "FORWARDS", t[t.BACKWARDS = 2] = "BACKWARDS", t))(Ve || {});
107
+ class oe {
108
108
  constructor(e, n) {
109
109
  this.start = e, this.end = n;
110
110
  }
111
111
  toRange() {
112
112
  let e, n;
113
- if (this.start.element === this.end.element && this.start.offset <= this.end.offset ? [e, n] = Ve(this.start.element, this.start.offset, this.end.offset) : (e = this.start.resolve({
113
+ if (this.start.element === this.end.element && this.start.offset <= this.end.offset ? [e, n] = Je(this.start.element, this.start.offset, this.end.offset) : (e = this.start.resolve({
114
114
  direction: 1
115
115
  /* FORWARDS */
116
116
  }), n = this.end.resolve({
@@ -123,13 +123,13 @@ class ne {
123
123
  }
124
124
  static fromRange(e) {
125
125
  const n = X.fromPoint(e.startContainer, e.startOffset), o = X.fromPoint(e.endContainer, e.endOffset);
126
- return !n || !o ? null : new ne(n, o);
126
+ return !n || !o ? null : new oe(n, o);
127
127
  }
128
128
  static fromOffsets(e, n, o) {
129
- return new ne(new X(e, n), new X(e, o));
129
+ return new oe(new X(e, n), new X(e, o));
130
130
  }
131
131
  relativeTo(e) {
132
- return new ne(this.start.relativeTo(e), this.end.relativeTo(e));
132
+ return new oe(this.start.relativeTo(e), this.end.relativeTo(e));
133
133
  }
134
134
  }
135
135
  class X {
@@ -138,15 +138,15 @@ class X {
138
138
  }
139
139
  resolve(e = {}) {
140
140
  try {
141
- return Ve(this.element, this.offset)[0];
141
+ return Je(this.element, this.offset)[0];
142
142
  } catch (n) {
143
143
  if (this.offset === 0 && e.direction !== void 0) {
144
144
  const o = document.createTreeWalker(this.element.getRootNode(), NodeFilter.SHOW_TEXT);
145
145
  o.currentNode = this.element;
146
- const r = e.direction === Qe.FORWARDS, s = r ? o.nextNode() : o.previousNode();
147
- if (!s)
146
+ const r = e.direction === Ve.FORWARDS, i = r ? o.nextNode() : o.previousNode();
147
+ if (!i)
148
148
  throw n;
149
- return { node: s, offset: r ? 0 : s.data.length };
149
+ return { node: i, offset: r ? 0 : i.data.length };
150
150
  }
151
151
  throw n;
152
152
  }
@@ -168,7 +168,7 @@ class X {
168
168
  return console.error("Text node offset is out of range"), null;
169
169
  if (!e.parentElement)
170
170
  return console.error("Text node has no parent"), null;
171
- const o = Ge(e) + n;
171
+ const o = Ue(e) + n;
172
172
  return new X(e.parentElement, o);
173
173
  }
174
174
  case Node.ELEMENT_NODE: {
@@ -176,7 +176,7 @@ class X {
176
176
  return console.error("Child node offset is out of range"), null;
177
177
  let o = 0;
178
178
  for (let r = 0; r < n; r++)
179
- o += Ye(e.childNodes[r]);
179
+ o += Ze(e.childNodes[r]);
180
180
  return new X(e, o);
181
181
  }
182
182
  default:
@@ -188,7 +188,7 @@ class X {
188
188
  throw new Error("Parent is not an ancestor of current element");
189
189
  let n = this.element, o = this.offset;
190
190
  for (; n !== e; )
191
- o += Ge(n), n.parentElement && (n = n.parentElement);
191
+ o += Ue(n), n.parentElement && (n = n.parentElement);
192
192
  return new X(n, o);
193
193
  }
194
194
  }
@@ -205,7 +205,7 @@ function Ot(t) {
205
205
  const Lt = (t) => {
206
206
  const e = wt(t), n = Ot(t);
207
207
  return `${e}[${n}]`;
208
- }, $e = (t, e) => {
208
+ }, He = (t, e) => {
209
209
  let n = "", o = t;
210
210
  for (; o !== e; ) {
211
211
  if (!o) {
@@ -218,8 +218,8 @@ const Lt = (t) => {
218
218
  }, At = (t, e, n) => {
219
219
  const o = e.toUpperCase();
220
220
  let r = -1;
221
- for (let s = 0; s < t.children.length; s++) {
222
- const l = t.children[s];
221
+ for (let i = 0; i < t.children.length; i++) {
222
+ const l = t.children[i];
223
223
  if (l.nodeName.toUpperCase() === o && (++r, r === n))
224
224
  return l;
225
225
  }
@@ -230,57 +230,57 @@ const Lt = (t) => {
230
230
  const o = t.split("/");
231
231
  let r = e;
232
232
  o.shift();
233
- for (const s of o) {
233
+ for (const i of o) {
234
234
  let l, a;
235
- const m = s.indexOf("[");
235
+ const m = i.indexOf("[");
236
236
  if (m !== -1) {
237
- l = s.slice(0, m);
238
- const p = s.slice(m + 1, s.indexOf("]"));
237
+ l = i.slice(0, m);
238
+ const p = i.slice(m + 1, i.indexOf("]"));
239
239
  if (a = Number.parseInt(p, 10) - 1, a < 0)
240
240
  return null;
241
241
  } else
242
- l = s, a = 0;
242
+ l = i, a = 0;
243
243
  const c = At(r, l, a);
244
244
  if (!c)
245
245
  return null;
246
246
  r = c;
247
247
  }
248
248
  return r;
249
- }, He = (t, e = document.body) => {
249
+ }, Ge = (t, e = document.body) => {
250
250
  try {
251
251
  return Dt(t, e);
252
252
  } catch {
253
253
  return document.evaluate(`.${t}`, e, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
254
254
  }
255
255
  };
256
- class ie {
256
+ class le {
257
257
  constructor(e, n) {
258
258
  this.root = e, this.range = n;
259
259
  }
260
260
  static fromRange(e, n) {
261
- return new ie(e, n);
261
+ return new le(e, n);
262
262
  }
263
263
  static fromSelector(e, n) {
264
264
  if (!(n != null && n.startContainer) || !(n != null && n.endContainer))
265
265
  return console.error("No start or end container in selector"), null;
266
- const o = He(n.startContainer, e);
266
+ const o = Ge(n.startContainer, e);
267
267
  if (!o)
268
268
  return console.error("Failed to resolve startContainer XPath"), null;
269
- const r = He(n.endContainer, e);
269
+ const r = Ge(n.endContainer, e);
270
270
  if (!r)
271
271
  return console.error("Failed to resolve endContainer XPath"), null;
272
- const s = X.fromCharOffset(o, n.startOffset), l = X.fromCharOffset(r, n.endOffset);
273
- if (!s || !l)
272
+ const i = X.fromCharOffset(o, n.startOffset), l = X.fromCharOffset(r, n.endOffset);
273
+ if (!i || !l)
274
274
  return null;
275
- const a = new ne(s, l).toRange();
276
- return a ? new ie(e, a) : null;
275
+ const a = new oe(i, l).toRange();
276
+ return a ? new le(e, a) : null;
277
277
  }
278
278
  toRange() {
279
279
  return this.range;
280
280
  }
281
281
  toSelector() {
282
- var s;
283
- const e = (s = ne.fromRange(this.range)) == null ? void 0 : s.toRange(), n = e && ne.fromRange(e), o = n && $e(n.start.element, this.root), r = n && $e(n.end.element, this.root);
282
+ var i;
283
+ const e = (i = oe.fromRange(this.range)) == null ? void 0 : i.toRange(), n = e && oe.fromRange(e), o = n && He(n.start.element, this.root), r = n && He(n.end.element, this.root);
284
284
  return !o || !r ? null : {
285
285
  startContainer: o,
286
286
  startOffset: n.start.offset,
@@ -289,17 +289,17 @@ class ie {
289
289
  };
290
290
  }
291
291
  }
292
- class oe {
292
+ class ie {
293
293
  constructor(e, n, o) {
294
294
  this.root = e, this.start = n, this.end = o;
295
295
  }
296
296
  static fromRange(e, n) {
297
297
  var r;
298
- const o = (r = ne.fromRange(n)) == null ? void 0 : r.relativeTo(e);
299
- return o ? new oe(e, o.start.offset, o.end.offset) : null;
298
+ const o = (r = oe.fromRange(n)) == null ? void 0 : r.relativeTo(e);
299
+ return o ? new ie(e, o.start.offset, o.end.offset) : null;
300
300
  }
301
301
  static fromSelector(e, n) {
302
- return new oe(e, n.start, n.end);
302
+ return new ie(e, n.start, n.end);
303
303
  }
304
304
  toSelector() {
305
305
  return {
@@ -308,10 +308,10 @@ class oe {
308
308
  };
309
309
  }
310
310
  toRange() {
311
- return ne.fromOffsets(this.root, this.start, this.end).toRange();
311
+ return oe.fromOffsets(this.root, this.start, this.end).toRange();
312
312
  }
313
313
  }
314
- const Ye = (t) => {
314
+ const Ze = (t) => {
315
315
  var e;
316
316
  switch (t.nodeType) {
317
317
  case Node.ELEMENT_NODE:
@@ -320,50 +320,50 @@ const Ye = (t) => {
320
320
  default:
321
321
  return 0;
322
322
  }
323
- }, Ge = (t) => {
323
+ }, Ue = (t) => {
324
324
  let e = t.previousSibling, n = 0;
325
325
  for (; e; )
326
- n += Ye(e), e = e.previousSibling;
326
+ n += Ze(e), e = e.previousSibling;
327
327
  return n;
328
- }, Ve = (t, ...e) => {
328
+ }, Je = (t, ...e) => {
329
329
  let n = e.shift();
330
330
  const o = t.ownerDocument.createNodeIterator(t, NodeFilter.SHOW_TEXT), r = [];
331
- let s = o.nextNode(), l = null, a = 0;
332
- for (; n !== void 0 && s; )
333
- l = s, a + l.data.length > n ? (r.push({ node: l, offset: n - a }), n = e.shift()) : (s = o.nextNode(), a += l.data.length);
331
+ let i = o.nextNode(), l = null, a = 0;
332
+ for (; n !== void 0 && i; )
333
+ l = i, a + l.data.length > n ? (r.push({ node: l, offset: n - a }), n = e.shift()) : (i = o.nextNode(), a += l.data.length);
334
334
  for (; n !== void 0 && l && a === n; )
335
335
  r.push({ node: l, offset: l.data.length }), n = e.shift();
336
336
  return n !== void 0 && console.error("Offset exceeds text length"), r;
337
337
  }, Pt = (t, e, n, o) => {
338
338
  const r = n - e;
339
- return Math.abs(r - o) <= 5 ? oe.fromSelector(t, {
339
+ return Math.abs(r - o) <= 5 ? ie.fromSelector(t, {
340
340
  start: e,
341
341
  end: n
342
342
  }) : null;
343
343
  }, _t = (t, e, n, o) => {
344
- const r = new ft();
344
+ const r = new mt();
345
345
  r.Match_Distance = 5e3;
346
- const s = t.textContent;
347
- if (!s)
346
+ const i = t.textContent;
347
+ if (!i)
348
348
  return null;
349
349
  if (e.length > 32) {
350
350
  const l = e.slice(0, 32), a = e.slice(-32), m = o - n;
351
- let c = r.match_main(s, l, n);
352
- const p = r.match_main(s, a, o), d = p + a.length;
351
+ let c = r.match_main(i, l, n);
352
+ const p = r.match_main(i, a, o), d = p + a.length;
353
353
  if (c === -1 || p === -1)
354
354
  return null;
355
- const g = d - c, S = Math.abs(g - m);
356
- if ((c > d || S > 5) && (r.Match_Distance = e.length + 100, c = r.match_main(s, l, d), c !== -1 && c < d))
355
+ const h = d - c, b = Math.abs(h - m);
356
+ if ((c > d || b > 5) && (r.Match_Distance = e.length + 100, c = r.match_main(i, l, d), c !== -1 && c < d))
357
357
  return Pt(t, c, d, m);
358
- if (c < d && S <= 5)
359
- return oe.fromSelector(t, {
358
+ if (c < d && b <= 5)
359
+ return ie.fromSelector(t, {
360
360
  start: c,
361
361
  end: d
362
362
  });
363
363
  } else {
364
- const l = r.match_main(s, e, n);
364
+ const l = r.match_main(i, e, n);
365
365
  if (l !== -1)
366
- return oe.fromSelector(t, {
366
+ return ie.fromSelector(t, {
367
367
  start: l,
368
368
  end: l + e.length
369
369
  });
@@ -380,16 +380,16 @@ const Ye = (t) => {
380
380
  );
381
381
  }, Mt = (t, e, n) => {
382
382
  const o = [], r = [];
383
- for (const s of e) {
384
- const l = Ft(s, t);
383
+ for (const i of e) {
384
+ const l = Ft(i, t);
385
385
  if (l) {
386
- const a = l.toRange(), m = a && ie.fromRange(t, a), c = (a == null ? void 0 : a.toString().trim()) || s.highlightData.selectedText;
386
+ const a = l.toRange(), m = a && le.fromRange(t, a), c = (a == null ? void 0 : a.toString().trim()) || i.highlightData.selectedText;
387
387
  o.push({
388
- id: s.id,
389
- reaction: s.reaction,
390
- userText: s.userText,
388
+ id: i.id,
389
+ reaction: i.reaction,
390
+ userText: i.userText,
391
391
  highlightData: {
392
- ...s.highlightData,
392
+ ...i.highlightData,
393
393
  selectedText: c,
394
394
  hasNoHighlightAnymore: !1,
395
395
  range: (m == null ? void 0 : m.toSelector()) ?? null,
@@ -398,23 +398,23 @@ const Ye = (t) => {
398
398
  }
399
399
  });
400
400
  } else
401
- s.userText ? o.push({
402
- id: s.id,
403
- reaction: s.reaction,
404
- userText: s.userText,
401
+ i.userText ? o.push({
402
+ id: i.id,
403
+ reaction: i.reaction,
404
+ userText: i.userText,
405
405
  highlightData: {
406
- ...s.highlightData,
406
+ ...i.highlightData,
407
407
  pageLastModifiedAt: n,
408
408
  hasNoHighlightAnymore: !0
409
409
  }
410
- }) : r.push(s.id);
410
+ }) : r.push(i.id);
411
411
  }
412
412
  return { notesForUpdate: o, noteIdsForDelete: r };
413
- }, Ue = (t, e) => {
413
+ }, je = (t, e) => {
414
414
  var l;
415
415
  if (!e) return;
416
416
  const { highlightData: n, id: o } = t, { range: r } = n ?? {};
417
- r && ((l = ie.fromSelector(e, r)) == null ? void 0 : l.toRange()) && Yt({ id: o });
417
+ r && ((l = le.fromSelector(e, r)) == null ? void 0 : l.toRange()) && Yt({ id: o });
418
418
  }, Bt = (t) => {
419
419
  const n = document.querySelector(
420
420
  `[data-highlight-id="${CSS.escape(t)}"].highlight-content`
@@ -427,12 +427,12 @@ const Ye = (t) => {
427
427
  const e = t.getClientRects();
428
428
  if (!e.length)
429
429
  return null;
430
- const n = e[0], o = e[e.length - 1], r = 4, s = 16, l = window.innerWidth || document.documentElement.clientWidth, a = window.innerHeight || document.documentElement.clientHeight, m = (y) => {
431
- const T = y + he;
432
- return y >= s && T <= l - s;
430
+ const n = e[0], o = e[e.length - 1], r = 4, i = 16, l = window.innerWidth || document.documentElement.clientWidth, a = window.innerHeight || document.documentElement.clientHeight, m = (y) => {
431
+ const E = y + he;
432
+ return y >= i && E <= l - i;
433
433
  }, c = (y) => {
434
- const T = y + ge;
435
- return y >= s && T <= a - s;
434
+ const E = y + ge;
435
+ return y >= i && E <= a - i;
436
436
  };
437
437
  let p;
438
438
  const d = n.right - he;
@@ -443,29 +443,29 @@ const Ye = (t) => {
443
443
  if (m(y))
444
444
  p = y;
445
445
  else {
446
- const h = (n.left + n.right) / 2 - he / 2;
447
- m(h) ? p = h : d < s ? p = s : p = l - he - s;
446
+ const g = (n.left + n.right) / 2 - he / 2;
447
+ m(g) ? p = g : d < i ? p = i : p = l - he - i;
448
448
  }
449
449
  }
450
- let g;
451
- const S = o.bottom + r;
452
- if (c(S))
453
- g = S;
450
+ let h;
451
+ const b = o.bottom + r;
452
+ if (c(b))
453
+ h = b;
454
454
  else {
455
455
  const y = n.top - ge - r;
456
- c(y) ? g = y : S + ge > a - s ? g = a - ge - s : g = s;
456
+ c(y) ? h = y : b + ge > a - i ? h = a - ge - i : h = i;
457
457
  }
458
- return { top: g, left: p };
458
+ return { top: h, left: p };
459
459
  }, Ht = (t, e) => {
460
460
  for (const n of e)
461
461
  if (t.start < n.end && t.end > n.start)
462
462
  return !0;
463
463
  return !1;
464
- }, Ae = (t) => `highlight-wrapper-${t}`, Ee = (t) => `${Ae(t)}-start`, Ze = (t) => `${Ae(t)}-end`, fe = (t) => `[data-highlight-id="${CSS.escape(t)}"]`, Gt = "2px", Ut = "3px", jt = "1px", Je = "3px", Wt = "1px", zt = "Notebook note", De = (t, e) => {
464
+ }, De = (t) => `highlight-wrapper-${t}`, Ee = (t) => `${De(t)}-start`, et = (t) => `${De(t)}-end`, fe = (t) => `[data-highlight-id="${CSS.escape(t)}"]`, Gt = "2px", Ut = "3px", jt = "1px", tt = "3px", Wt = "1px", zt = "Notebook note", Pe = (t, e) => {
465
465
  const n = Number.parseInt(t.slice(1, 3), 16), o = Number.parseInt(t.slice(3, 5), 16), r = Number.parseInt(t.slice(5, 7), 16);
466
466
  return `rgba(${n}, ${o}, ${r}, ${e})`;
467
- }, et = (t, e, n, o, r) => {
468
- t.style.backgroundColor = n, e ? (t.dataset.selected = "true", t.style.outline = `${jt} ${r} ${o}`, t.style.outlineOffset = Wt, t.style.borderRadius = Je, t.style.fontWeight = "bold") : (t.removeAttribute("data-selected"), t.style.outline = "", t.style.outlineOffset = "", t.style.borderRadius = "", t.style.fontWeight = "");
467
+ }, nt = (t, e, n, o, r) => {
468
+ t.style.backgroundColor = n, e ? (t.dataset.selected = "true", t.style.outline = `${jt} ${r} ${o}`, t.style.outlineOffset = Wt, t.style.borderRadius = tt, t.style.fontWeight = "bold") : (t.removeAttribute("data-selected"), t.style.outline = "", t.style.outlineOffset = "", t.style.borderRadius = "", t.style.fontWeight = "");
469
469
  }, qt = (t, e) => {
470
470
  var n;
471
471
  try {
@@ -475,13 +475,13 @@ const Ye = (t) => {
475
475
  return !1;
476
476
  }
477
477
  }, Kt = (t) => {
478
- var s;
478
+ var i;
479
479
  if (t.collapsed)
480
480
  return [];
481
481
  let e = t.commonAncestorContainer;
482
482
  if (e && e.nodeType !== Node.ELEMENT_NODE && (e = e.parentElement), !e)
483
483
  return [];
484
- const n = [], o = (s = e == null ? void 0 : e.ownerDocument) == null ? void 0 : s.createNodeIterator(e, NodeFilter.SHOW_TEXT);
484
+ const n = [], o = (i = e == null ? void 0 : e.ownerDocument) == null ? void 0 : i.createNodeIterator(e, NodeFilter.SHOW_TEXT);
485
485
  let r = (o == null ? void 0 : o.nextNode()) || null;
486
486
  for (; r; ) {
487
487
  if (!qt(t, r)) {
@@ -498,49 +498,49 @@ const Ye = (t) => {
498
498
  return n;
499
499
  }, Xt = (t, e, n) => {
500
500
  if (t.collapsed) return;
501
- const o = e.id ?? "", r = Ae(o);
501
+ const o = e.id ?? "", r = De(o);
502
502
  if (document.getElementById(Ee(o))) {
503
503
  Qt(e, n);
504
504
  return;
505
505
  }
506
- const l = e.type === A.IMPORTANT ? n.colors.importantBackground : n.colors.confusingBackground, a = e.id === e.selectedNoteId, m = a ? l : De(l, 0.5), c = e.type === A.IMPORTANT ? n.colors.importantUnderline : n.colors.confusingUnderline, p = e.type === A.IMPORTANT ? "solid" : "dashed", d = document.createElement("span");
506
+ const l = e.type === O.IMPORTANT ? n.colors.importantBackground : n.colors.confusingBackground, a = e.id === e.selectedNoteId, m = a ? l : Pe(l, 0.5), c = e.type === O.IMPORTANT ? n.colors.importantUnderline : n.colors.confusingUnderline, p = e.type === O.IMPORTANT ? "solid" : "dashed", d = document.createElement("span");
507
507
  d.id = `${r}-start`, d.className = "highlight-marker-start", d.dataset.highlightId = o || "";
508
- const g = e.labelPrefix ?? zt;
509
- d.setAttribute("role", "button"), d.setAttribute("tabindex", "0"), d.setAttribute("aria-label", g), d.setAttribute("aria-haspopup", "dialog"), d.setAttribute("aria-expanded", String(a && !!e.isTrayOpen)), a && d.setAttribute("aria-current", "true"), e.popupId && d.setAttribute("aria-controls", e.popupId), d.style.position = "relative", d.style.fontSize = "0", d.style.lineHeight = "0", d.style.width = "0", d.style.height = "0", d.style.margin = "0", d.style.padding = "0", d.style.border = "0", d.style.outline = "none";
510
- const S = document.createElement("span");
511
- S.id = Ze(o), S.className = "highlight-marker-end", S.dataset.highlightId = o || "";
508
+ const h = e.labelPrefix ?? zt;
509
+ d.setAttribute("role", "button"), d.setAttribute("tabindex", "0"), d.setAttribute("aria-label", h), d.setAttribute("aria-haspopup", "dialog"), d.setAttribute("aria-expanded", String(a && !!e.isTrayOpen)), a && d.setAttribute("aria-current", "true"), e.popupId && d.setAttribute("aria-controls", e.popupId), d.style.position = "relative", d.style.fontSize = "0", d.style.lineHeight = "0", d.style.width = "0", d.style.height = "0", d.style.margin = "0", d.style.padding = "0", d.style.border = "0", d.style.outline = "none";
510
+ const b = document.createElement("span");
511
+ b.id = et(o), b.className = "highlight-marker-end", b.dataset.highlightId = o || "";
512
512
  const y = t.cloneRange();
513
- y.collapse(!1), y.insertNode(S);
514
- const T = t.cloneRange();
515
- T.collapse(!0), T.insertNode(d);
516
- const h = document.createRange();
517
- h.setStartAfter(d), h.setEndBefore(S);
518
- const B = Kt(h).filter((N) => N.textContent && N.textContent.length > 0);
519
- B.forEach((N, v) => {
520
- var z;
513
+ y.collapse(!1), y.insertNode(b);
514
+ const E = t.cloneRange();
515
+ E.collapse(!0), E.insertNode(d);
516
+ const g = document.createRange();
517
+ g.setStartAfter(d), g.setEndBefore(b);
518
+ const j = Kt(g).filter((N) => N.textContent && N.textContent.length > 0);
519
+ j.forEach((N, C) => {
520
+ var F;
521
521
  const P = N.parentElement;
522
522
  if ((P == null ? void 0 : P.dataset.highlightId) === o) return;
523
- const F = v === 0, b = v === B.length - 1, D = B.length === 1;
524
- let k;
525
- D ? k = "single" : F ? k = "first" : b ? k = "last" : k = "middle";
526
- const w = document.createElement("span");
527
- w.className = "highlight-content", w.dataset.highlightId = o || "", w.dataset.position = k, w.style.textDecorationLine = "underline", w.style.textDecorationColor = c, w.style.textDecorationStyle = p, w.style.textDecorationThickness = n.borderWidthSmall, w.style.textUnderlineOffset = n.underlineOffset, w.style.cursor = "pointer", et(w, a, m, c, p), w.addEventListener("click", (q) => {
528
- var Y;
529
- q.target.tagName !== "A" && ((Y = e.onClick) == null || Y.call(e));
530
- }), (z = N.parentNode) == null || z.insertBefore(w, N), w.appendChild(N);
523
+ const $ = C === 0, _ = C === j.length - 1, S = j.length === 1;
524
+ let L;
525
+ S ? L = "single" : $ ? L = "first" : _ ? L = "last" : L = "middle";
526
+ const v = document.createElement("span");
527
+ v.className = "highlight-content", v.dataset.highlightId = o || "", v.dataset.position = L, v.style.textDecorationLine = "underline", v.style.textDecorationColor = c, v.style.textDecorationStyle = p, v.style.textDecorationThickness = n.borderWidthSmall, v.style.textUnderlineOffset = n.underlineOffset, v.style.cursor = "pointer", nt(v, a, m, c, p), v.addEventListener("click", (Z) => {
528
+ var V;
529
+ Z.target.tagName !== "A" && ((V = e.onClick) == null || V.call(e));
530
+ }), (F = N.parentNode) == null || F.insertBefore(v, N), v.appendChild(N);
531
531
  }), d.addEventListener("click", (N) => {
532
- var v;
533
- N.target.tagName !== "A" && ((v = e.onClick) == null || v.call(e));
532
+ var C;
533
+ N.target.tagName !== "A" && ((C = e.onClick) == null || C.call(e));
534
534
  }), d.addEventListener("keydown", (N) => {
535
- var v;
535
+ var C;
536
536
  if (N.key === "Enter" || N.key === " ")
537
- N.preventDefault(), (v = e.onClick) == null || v.call(e);
537
+ N.preventDefault(), (C = e.onClick) == null || C.call(e);
538
538
  else if (N.key === "Tab" && !N.shiftKey) {
539
539
  const P = document.querySelectorAll(fe(o));
540
- for (const F of P) {
541
- const b = F.querySelector("a");
542
- if (b) {
543
- N.preventDefault(), b.focus();
540
+ for (const $ of P) {
541
+ const _ = $.querySelector("a");
542
+ if (_) {
543
+ N.preventDefault(), _.focus();
544
544
  break;
545
545
  }
546
546
  }
@@ -548,23 +548,23 @@ const Ye = (t) => {
548
548
  }), d.addEventListener("focus", () => {
549
549
  document.querySelectorAll(
550
550
  `.highlight-content${fe(o)}`
551
- ).forEach((v) => {
552
- v.style.boxShadow = `0 0 0 ${Gt} ${n.colors.focusOutline}`, v.style.borderRadius = Ut;
551
+ ).forEach((C) => {
552
+ C.style.boxShadow = `0 0 0 ${Gt} ${n.colors.focusOutline}`, C.style.borderRadius = Ut;
553
553
  });
554
554
  }), d.addEventListener("blur", () => {
555
555
  document.querySelectorAll(
556
556
  `.highlight-content${fe(o)}`
557
- ).forEach((v) => {
558
- v.style.boxShadow = "", v.style.borderRadius = v.dataset.selected ? Je : "";
557
+ ).forEach((C) => {
558
+ C.style.boxShadow = "", C.style.borderRadius = C.dataset.selected ? tt : "";
559
559
  });
560
560
  });
561
561
  };
562
562
  function Qt(t, e) {
563
- const n = t.type === A.IMPORTANT ? e.colors.importantBackground : e.colors.confusingBackground, o = t.id === t.selectedNoteId, r = o ? n : De(n, 0.5), s = t.type === A.IMPORTANT ? e.colors.importantUnderline : e.colors.confusingUnderline, l = t.type === A.IMPORTANT ? "solid" : "dashed";
563
+ const n = t.type === O.IMPORTANT ? e.colors.importantBackground : e.colors.confusingBackground, o = t.id === t.selectedNoteId, r = o ? n : Pe(n, 0.5), i = t.type === O.IMPORTANT ? e.colors.importantUnderline : e.colors.confusingUnderline, l = t.type === O.IMPORTANT ? "solid" : "dashed";
564
564
  document.querySelectorAll(
565
565
  `.highlight-content${fe(t.id ?? "")}`
566
566
  ).forEach((c) => {
567
- et(c, o, r, s, l);
567
+ nt(c, o, r, i, l);
568
568
  });
569
569
  const m = document.getElementById(
570
570
  Ee(t.id ?? "")
@@ -572,22 +572,22 @@ function Qt(t, e) {
572
572
  m && (m.setAttribute("aria-expanded", String(o && !!t.isTrayOpen)), o ? m.setAttribute("aria-current", "true") : m.removeAttribute("aria-current"));
573
573
  }
574
574
  const Yt = (t) => {
575
- const e = t.id ?? "", n = document.getElementById(Ee(e)), o = document.getElementById(Ze(e));
575
+ const e = t.id ?? "", n = document.getElementById(Ee(e)), o = document.getElementById(et(e));
576
576
  document.querySelectorAll(
577
577
  fe(e)
578
- ).forEach((s) => {
578
+ ).forEach((i) => {
579
579
  var l;
580
- for (; s.firstChild; )
581
- (l = s.parentNode) == null || l.insertBefore(s.firstChild, s);
582
- s.remove();
580
+ for (; i.firstChild; )
581
+ (l = i.parentNode) == null || l.insertBefore(i.firstChild, i);
582
+ i.remove();
583
583
  }), n == null || n.remove(), o == null || o.remove();
584
584
  }, de = {
585
585
  all: ["notebook"],
586
586
  notes: (t) => ["notebook", "notes", t]
587
587
  };
588
588
  function Vt(t) {
589
- const e = xe();
590
- return Re({
589
+ const e = Re();
590
+ return ke({
591
591
  mutationFn: (n) => t.createNote(n),
592
592
  onSuccess: () => {
593
593
  e.invalidateQueries({ queryKey: de.all });
@@ -595,34 +595,34 @@ function Vt(t) {
595
595
  });
596
596
  }
597
597
  function Zt(t) {
598
- const e = xe();
599
- return Re({
598
+ const e = Re();
599
+ return ke({
600
600
  mutationFn: (n) => t.deleteNote(n),
601
601
  onSuccess: () => {
602
602
  e.invalidateQueries({ queryKey: de.all });
603
603
  }
604
604
  });
605
605
  }
606
- function tt({
606
+ function ot({
607
607
  api: t,
608
608
  enabled: e = !0,
609
609
  ...n
610
610
  }) {
611
- return mt({
611
+ return gt({
612
612
  queryKey: de.notes(n),
613
613
  queryFn: () => t.getNotes(n),
614
614
  enabled: e
615
615
  });
616
616
  }
617
617
  const Jt = 100;
618
- function nt({
618
+ function rt({
619
619
  api: t,
620
620
  courseId: e,
621
621
  learningObject: n,
622
622
  reactions: o,
623
623
  enabled: r = !0
624
624
  }) {
625
- return tt({
625
+ return ot({
626
626
  api: t,
627
627
  filter: {
628
628
  ...e ? { courseId: e } : {},
@@ -635,13 +635,13 @@ function nt({
635
635
  });
636
636
  }
637
637
  function en(t) {
638
- const e = xe();
639
- return Re({
638
+ const e = Re();
639
+ return ke({
640
640
  mutationFn: ({ id: n, input: o }) => t.updateNote(n, o),
641
641
  onMutate: async ({ id: n, input: o }) => {
642
642
  await e.cancelQueries({ queryKey: de.all });
643
- const s = e.getQueryCache().findAll({ queryKey: de.all }), l = /* @__PURE__ */ new Map();
644
- for (const a of s) {
643
+ const i = e.getQueryCache().findAll({ queryKey: de.all }), l = /* @__PURE__ */ new Map();
644
+ for (const a of i) {
645
645
  const m = a.state.data;
646
646
  m && (l.set(a.queryKey, m), e.setQueryData(a.queryKey, {
647
647
  ...m,
@@ -654,15 +654,15 @@ function en(t) {
654
654
  },
655
655
  onError: (n, o, r) => {
656
656
  if (r != null && r.previousData)
657
- for (const [s, l] of r.previousData)
658
- e.setQueryData(s, l);
657
+ for (const [i, l] of r.previousData)
658
+ e.setQueryData(i, l);
659
659
  },
660
660
  onSettled: () => {
661
661
  e.invalidateQueries({ queryKey: de.all });
662
662
  }
663
663
  });
664
664
  }
665
- const tn = "Notebook", nn = "Notes", on = "Important", rn = "Unclear", sn = "Back", ln = "Edit note", an = "Save", cn = "Cancel", dn = "Delete note", un = "Delete note confirmation", fn = "note", mn = "Add note (optional)", gn = "Remove from Notebook", hn = "Add a note (optional)", pn = "Mark important", yn = "Mark unclear", Nn = "Saved to Notebook.", bn = "Note updated", En = "Note deleted", Sn = "Error saving to Notebook.", Tn = "Error updating note", vn = "Note deletion failed", In = "Loading notes", Cn = "Failed to load notes", xn = "Start capturing your notes", Rn = "Your notes from learning materials will appear here. Highlight key ideas, reflections, or questions as you learn—they'll all be saved in your Notebook for easy review later.", kn = "Nothing here yet", wn = "Adjust your filters or create a new note to get started.", On = "You have no notes for the selected filter", Ln = "Filter", An = "Previous page", Dn = "Next page", Pn = "All courses", _n = "All notes", Fn = "Close Notebook panel", Mn = "To use the Notebook feature, highlight an excerpt from your learning material to flag it as 'confusing' or 'important' and leave an optional note.", Bn = "The content you highlighted is no longer available.", $n = "Notebook note", Pe = {
665
+ const tn = "Notebook", nn = "Notes", on = "Important", rn = "Unclear", sn = "Back", ln = "Edit note", an = "Save", cn = "Cancel", dn = "Delete note", un = "Delete note confirmation", fn = "note", mn = "Add note (optional)", gn = "Remove from Notebook", hn = "Add a note (optional)", pn = "Mark important", yn = "Mark unclear", Nn = "Saved to Notebook.", bn = "Note updated", En = "Note deleted", Sn = "Error saving to Notebook.", Tn = "Error updating note", vn = "Note deletion failed", In = "Loading notes", Cn = "Failed to load notes", xn = "Start capturing your notes", Rn = "Your notes from learning materials will appear here. Highlight key ideas, reflections, or questions as you learn—they'll all be saved in your Notebook for easy review later.", kn = "Nothing here yet", wn = "Adjust your filters or create a new note to get started.", On = "You have no notes for the selected filter", Ln = "Filter", An = "Previous page", Dn = "Next page", Pn = "All courses", _n = "All notes", Fn = "Close Notebook panel", Mn = "To use the Notebook feature, highlight an excerpt from your learning material to flag it as 'confusing' or 'important' and leave an optional note.", Bn = "The content you highlighted is no longer available.", $n = "Notebook note", _e = {
666
666
  notebook: tn,
667
667
  notes: nn,
668
668
  important: on,
@@ -701,9 +701,9 @@ const tn = "Notebook", nn = "Notes", on = "Important", rn = "Unclear", sn = "Bac
701
701
  featureDescription: Mn,
702
702
  highlightUnavailable: Bn,
703
703
  notebookNote: $n
704
- }, ot = ze(null);
705
- function rt(t, e) {
706
- const n = Pe[t] ?? t;
704
+ }, st = Ke(null);
705
+ function it(t, e) {
706
+ const n = _e[t] ?? t;
707
707
  return e ? n.replace(/%\{([^}]+)}/g, (o, r) => String(e[r] ?? `%{${r}}`)) : n;
708
708
  }
709
709
  function Hn({
@@ -713,16 +713,16 @@ function Hn({
713
713
  }) {
714
714
  const o = me(
715
715
  () => ({
716
- translations: { ...Pe, ...t },
717
- translate: e ?? rt
716
+ translations: { ..._e, ...t },
717
+ translate: e ?? it
718
718
  }),
719
719
  [t, e]
720
720
  );
721
- return /* @__PURE__ */ i(ot.Provider, { value: o, children: n });
721
+ return /* @__PURE__ */ s(st.Provider, { value: o, children: n });
722
722
  }
723
- function V() {
724
- const t = qe(ot);
725
- return t || { translations: Pe, translate: rt };
723
+ function J() {
724
+ const t = Xe(st);
725
+ return t || { translations: _e, translate: it };
726
726
  }
727
727
  const Gn = (t) => ({
728
728
  selectedNoteId: t ?? null,
@@ -749,64 +749,64 @@ function Un(t, e) {
749
749
  return t;
750
750
  }
751
751
  }
752
- const st = ze(null);
752
+ const lt = Ke(null);
753
753
  function Eo({
754
754
  api: t,
755
755
  currentUserId: e,
756
756
  objectId: n,
757
757
  objectType: o,
758
758
  courseId: r,
759
- pageLastModifiedAt: s,
759
+ pageLastModifiedAt: i,
760
760
  onOpen: l,
761
761
  initialNoteId: a,
762
762
  translations: m,
763
763
  translate: c,
764
764
  children: p
765
765
  }) {
766
- const [d, g] = Ke(Un, Gn(a)), S = _(a != null), y = me(
766
+ const [d, h] = Qe(Un, Gn(a)), b = B(a != null), y = me(
767
767
  () => ({
768
768
  api: t,
769
769
  currentUserId: e,
770
770
  objectId: n,
771
771
  objectType: o,
772
772
  courseId: r,
773
- pageLastModifiedAt: s,
773
+ pageLastModifiedAt: i,
774
774
  ...d,
775
- selectNote: (T, h = !1) => g({ type: "SELECT_NOTE", payload: { id: T, isEditing: h } }),
776
- clearSelectedNote: () => g({ type: "CLEAR_SELECTED_NOTE" }),
777
- setEditing: (T) => g({ type: "SET_EDITING", payload: T }),
775
+ selectNote: (E, g = !1) => h({ type: "SELECT_NOTE", payload: { id: E, isEditing: g } }),
776
+ clearSelectedNote: () => h({ type: "CLEAR_SELECTED_NOTE" }),
777
+ setEditing: (E) => h({ type: "SET_EDITING", payload: E }),
778
778
  openTray: () => {
779
- S.current || (S.current = !0, l == null || l()), g({ type: "OPEN_TRAY" });
779
+ b.current || (b.current = !0, l == null || l()), h({ type: "OPEN_TRAY" });
780
780
  },
781
781
  closeTray: () => {
782
- S.current = !1, g({ type: "CLOSE_TRAY" });
782
+ b.current = !1, h({ type: "CLOSE_TRAY" });
783
783
  }
784
784
  }),
785
- [t, e, n, o, r, s, l, d]
785
+ [t, e, n, o, r, i, l, d]
786
786
  );
787
- return /* @__PURE__ */ i(st.Provider, { value: y, children: /* @__PURE__ */ i(Hn, { translations: m, translate: c, children: p }) });
787
+ return /* @__PURE__ */ s(lt.Provider, { value: y, children: /* @__PURE__ */ s(Hn, { translations: m, translate: c, children: p }) });
788
788
  }
789
- function it() {
790
- const t = qe(st);
789
+ function at() {
790
+ const t = Xe(lt);
791
791
  if (!t)
792
792
  throw new Error("useNotebook must be used within a NotebookProvider");
793
793
  return t;
794
794
  }
795
- const lt = "notebook-tray-content", So = ({ children: t }) => {
796
- const { isTrayOpen: e, closeTray: n } = it(), { translations: o } = V();
797
- return /* @__PURE__ */ i(
798
- ht,
795
+ const ct = "notebook-tray-content", So = ({ children: t }) => {
796
+ const { isTrayOpen: e, closeTray: n } = at(), { translations: o } = J();
797
+ return /* @__PURE__ */ s(
798
+ pt,
799
799
  {
800
800
  label: o.notebook,
801
801
  open: e,
802
802
  onDismiss: n,
803
803
  placement: "end",
804
804
  size: "regular",
805
- children: /* @__PURE__ */ C(x, { direction: "column", height: "100vh", id: lt, children: [
806
- /* @__PURE__ */ i(x.Item, { children: /* @__PURE__ */ i(Q, { as: "div", padding: "small medium", borderWidth: "0 0 small 0", children: /* @__PURE__ */ C(x, { justifyItems: "space-between", alignItems: "center", children: [
807
- /* @__PURE__ */ i(Ne, { level: "h3", children: o.notebook }),
808
- /* @__PURE__ */ i(
809
- gt,
805
+ children: /* @__PURE__ */ I(x, { direction: "column", height: "100vh", id: ct, children: [
806
+ /* @__PURE__ */ s(x.Item, { children: /* @__PURE__ */ s(Q, { as: "div", padding: "small medium", borderWidth: "0 0 small 0", children: /* @__PURE__ */ I(x, { justifyItems: "space-between", alignItems: "center", children: [
807
+ /* @__PURE__ */ s(Ne, { level: "h3", children: o.notebook }),
808
+ /* @__PURE__ */ s(
809
+ ht,
810
810
  {
811
811
  screenReaderLabel: o.closeNotebookPanel,
812
812
  onClick: n,
@@ -815,15 +815,15 @@ const lt = "notebook-tray-content", So = ({ children: t }) => {
815
815
  }
816
816
  )
817
817
  ] }) }) }),
818
- /* @__PURE__ */ i(x.Item, { shouldGrow: !0, shouldShrink: !0, overflowY: "auto", overflowX: "hidden", children: t })
818
+ /* @__PURE__ */ s(x.Item, { shouldGrow: !0, shouldShrink: !0, overflowY: "auto", overflowX: "hidden", children: t })
819
819
  ] })
820
820
  }
821
821
  );
822
822
  }, jn = ({ currentType: t, onSelectReaction: e }) => {
823
- const { translations: n } = V(), o = _(null), r = _(null);
824
- return j(() => {
825
- t === A.CONFUSING && o.current ? o.current.focus() : t === A.IMPORTANT && r.current ? r.current.focus() : o.current && o.current.focus();
826
- }, [t]), /* @__PURE__ */ i(
823
+ const { translations: n } = J(), o = B(null), r = B(null);
824
+ return W(() => {
825
+ t === O.CONFUSING && o.current ? o.current.focus() : t === O.IMPORTANT && r.current ? r.current.focus() : o.current && o.current.focus();
826
+ }, [t]), /* @__PURE__ */ s(
827
827
  Q,
828
828
  {
829
829
  as: "div",
@@ -832,25 +832,25 @@ const lt = "notebook-tray-content", So = ({ children: t }) => {
832
832
  borderColor: "secondary",
833
833
  borderRadius: "medium",
834
834
  shadow: "resting",
835
- children: /* @__PURE__ */ C(ce, { children: [
836
- /* @__PURE__ */ C(
835
+ children: /* @__PURE__ */ I(ce, { children: [
836
+ /* @__PURE__ */ I(
837
837
  ce.Item,
838
838
  {
839
839
  ref: o,
840
- onClick: () => e(A.CONFUSING),
840
+ onClick: () => e(O.CONFUSING),
841
841
  children: [
842
- /* @__PURE__ */ i(ke, { size: "x-small" }),
842
+ /* @__PURE__ */ s(we, { size: "x-small" }),
843
843
  ` ${n.markUnclear}`
844
844
  ]
845
845
  }
846
846
  ),
847
- /* @__PURE__ */ C(
847
+ /* @__PURE__ */ I(
848
848
  ce.Item,
849
849
  {
850
850
  ref: r,
851
- onClick: () => e(A.IMPORTANT),
851
+ onClick: () => e(O.IMPORTANT),
852
852
  children: [
853
- /* @__PURE__ */ i(we, { size: "x-small" }),
853
+ /* @__PURE__ */ s(Oe, { size: "x-small" }),
854
854
  ` ${n.markImportant}`
855
855
  ]
856
856
  }
@@ -858,14 +858,14 @@ const lt = "notebook-tray-content", So = ({ children: t }) => {
858
858
  ] })
859
859
  }
860
860
  );
861
- }, Se = "notebook-inline-reaction-menu";
861
+ }, Te = "notebook-inline-reaction-menu";
862
862
  function To({
863
863
  containerRef: t,
864
864
  highlightTheme: e,
865
865
  debounceTime: n = 500,
866
866
  onCreateError: o,
867
867
  onUpdateError: r,
868
- onDeleteError: s,
868
+ onDeleteError: i,
869
869
  onNoteCreate: l
870
870
  }) {
871
871
  const {
@@ -874,193 +874,193 @@ function To({
874
874
  objectType: c,
875
875
  courseId: p,
876
876
  pageLastModifiedAt: d,
877
- selectedNoteId: g,
878
- isTrayOpen: S,
877
+ selectedNoteId: h,
878
+ isTrayOpen: b,
879
879
  selectNote: y,
880
- openTray: T
881
- } = it(), { translations: h } = V(), { data: W } = nt({
880
+ openTray: E
881
+ } = at(), { translations: g } = J(), { data: Y } = rt({
882
882
  api: a,
883
883
  courseId: p,
884
884
  learningObject: { type: c, id: m }
885
- }), { mutate: B } = Vt(a), { mutateAsync: N } = en(a), { mutate: v } = Zt(a), P = _([]), [F, b] = U([]), [D, k] = U(null), [w, z] = U(""), [q, Y] = U(null), re = _(null);
886
- re.current = q;
887
- const [Z, J] = U(!1);
888
- j(() => {
889
- const R = t.current;
890
- if (!R) return;
891
- const I = R.closest(".user_content") ?? R;
892
- if (I.classList.contains("enhanced")) {
893
- J(!0);
885
+ }), { mutate: j } = Vt(a), { mutateAsync: N } = en(a), { mutate: C } = Zt(a), P = B([]), [$, _] = U([]), [S, L] = U(null), [v, F] = U(""), [Z, V] = U(null), ae = B(null);
886
+ ae.current = Z;
887
+ const [ee, re] = U(!1);
888
+ W(() => {
889
+ const w = t.current;
890
+ if (!w) return;
891
+ const T = w.closest(".user_content") ?? w;
892
+ if (T.classList.contains("enhanced")) {
893
+ re(!0);
894
894
  return;
895
895
  }
896
- const M = new MutationObserver((u) => {
897
- for (const E of u)
898
- if (E.type === "attributes" && E.attributeName === "class" && E.target.classList.contains("enhanced")) {
899
- J(!0), M.disconnect();
896
+ const G = new MutationObserver((M) => {
897
+ for (const A of M)
898
+ if (A.type === "attributes" && A.attributeName === "class" && A.target.classList.contains("enhanced")) {
899
+ re(!0), G.disconnect();
900
900
  return;
901
901
  }
902
902
  });
903
- return M.observe(I, { attributes: !0, attributeFilter: ["class"] }), () => M.disconnect();
903
+ return G.observe(T, { attributes: !0, attributeFilter: ["class"] }), () => G.disconnect();
904
904
  }, [t]);
905
- const G = K(() => {
906
- Y(null), k(null), z("");
905
+ const z = K(() => {
906
+ V(null), L(null), F("");
907
907
  }, []);
908
- j(() => {
909
- if (!Z || !t.current) return;
910
- let I = null;
911
- const M = () => {
912
- I && clearTimeout(I), I = setTimeout(() => {
913
- var Fe;
914
- const L = window.getSelection(), H = t.current;
915
- if (!(L != null && L.rangeCount) || !H) return;
916
- const le = L.toString().trim();
917
- if (le === "") return;
918
- const ae = L.getRangeAt(0);
919
- if (!H.contains(ae.commonAncestorContainer)) return;
920
- const _e = (Fe = oe.fromRange(H, ae)) == null ? void 0 : Fe.toSelector();
921
- _e && !Ht(_e, F) && (k(ae.cloneRange()), z(le), Y($t(ae)));
908
+ W(() => {
909
+ if (!ee || !t.current) return;
910
+ let T = null;
911
+ const G = () => {
912
+ T && clearTimeout(T), T = setTimeout(() => {
913
+ var Me;
914
+ const R = window.getSelection(), u = t.current;
915
+ if (!(R != null && R.rangeCount) || !u) return;
916
+ const k = R.toString().trim();
917
+ if (k === "") return;
918
+ const q = R.getRangeAt(0);
919
+ if (!u.contains(q.commonAncestorContainer)) return;
920
+ const Fe = (Me = ie.fromRange(u, q)) == null ? void 0 : Me.toSelector();
921
+ Fe && !Ht(Fe, $) && (L(q.cloneRange()), F(k), V($t(q)));
922
922
  }, n);
923
- }, u = (L) => {
924
- if (!(L.target instanceof Node)) return;
925
- const H = document.getElementById(Se);
926
- H != null && H.contains(L.target) ? (L.preventDefault(), L.stopImmediatePropagation()) : G();
927
- }, E = () => {
928
- G();
929
- }, O = (L) => {
930
- L.key === "Escape" && re.current !== null && (G(), L.stopImmediatePropagation());
923
+ }, M = (R) => {
924
+ if (!(R.target instanceof Node)) return;
925
+ const u = document.getElementById(Te);
926
+ u != null && u.contains(R.target) ? (R.preventDefault(), R.stopImmediatePropagation()) : z();
927
+ }, A = () => {
928
+ z();
929
+ }, D = (R) => {
930
+ R.key === "Escape" && ae.current !== null && (z(), R.stopImmediatePropagation());
931
931
  };
932
- return document.addEventListener("selectionchange", M), document.addEventListener("mousedown", u), document.addEventListener("touchstart", u), document.addEventListener("keydown", O), window.addEventListener("scroll", E, !0), () => {
933
- I && clearTimeout(I), document.removeEventListener("selectionchange", M), document.removeEventListener("mousedown", u), document.removeEventListener("touchstart", u), document.removeEventListener("keydown", O), window.removeEventListener("scroll", E, !0);
932
+ return document.addEventListener("selectionchange", G), document.addEventListener("mousedown", M), document.addEventListener("touchstart", M), document.addEventListener("keydown", D), window.addEventListener("scroll", A, !0), () => {
933
+ T && clearTimeout(T), document.removeEventListener("selectionchange", G), document.removeEventListener("mousedown", M), document.removeEventListener("touchstart", M), document.removeEventListener("keydown", D), window.removeEventListener("scroll", A, !0);
934
934
  };
935
- }, [Z, F, n, t, G]);
935
+ }, [ee, $, n, t, z]);
936
936
  const se = K(
937
- (R) => {
938
- var H;
939
- const I = t.current;
940
- if (!I || !R.highlightData) return null;
941
- const { highlightData: M, reaction: u, id: E } = R, { range: O } = M, L = O && ((H = ie.fromSelector(I, O)) == null ? void 0 : H.toRange());
942
- if (L) {
943
- const le = u[0] === A.IMPORTANT ? h.important : h.unclear, ae = {
944
- id: E,
945
- selectedNoteId: g,
946
- type: u[0],
947
- isTrayOpen: S,
948
- labelPrefix: `${h.notebookNote} (${le})`,
949
- popupId: lt,
937
+ (w) => {
938
+ var u;
939
+ const T = t.current;
940
+ if (!T || !w.highlightData) return null;
941
+ const { highlightData: G, reaction: M, id: A } = w, { range: D } = G, R = D && ((u = le.fromSelector(T, D)) == null ? void 0 : u.toRange());
942
+ if (R) {
943
+ const k = M[0] === O.IMPORTANT ? g.important : g.unclear, q = {
944
+ id: A,
945
+ selectedNoteId: h,
946
+ type: M[0],
947
+ isTrayOpen: b,
948
+ labelPrefix: `${g.notebookNote} (${k})`,
949
+ popupId: ct,
950
950
  onClick: () => {
951
- y(E), T();
951
+ y(A), E();
952
952
  }
953
953
  };
954
- return Xt(L, ae, e), M.textPosition;
954
+ return Xt(R, q, e), G.textPosition;
955
955
  }
956
956
  return null;
957
957
  },
958
- [t, g, S, e, h, y, T]
958
+ [t, h, b, e, g, y, E]
959
959
  );
960
- j(() => {
961
- if (!Z || !W || !t.current) return;
962
- const R = t.current, I = W.notes, M = /* @__PURE__ */ new Set(), u = [], E = [];
963
- if (I.length === 0) {
960
+ W(() => {
961
+ if (!ee || !Y || !t.current) return;
962
+ const w = t.current, T = Y.notes, G = /* @__PURE__ */ new Set(), M = [], A = [];
963
+ if (T.length === 0) {
964
964
  if (P.current.length > 0) {
965
- for (const O of P.current)
966
- Ue(O, R);
967
- P.current = [], b([]);
965
+ for (const D of P.current)
966
+ je(D, w);
967
+ P.current = [], _([]);
968
968
  }
969
969
  return;
970
970
  }
971
- if (d && I[0].highlightData.pageLastModifiedAt !== d) {
972
- const { notesForUpdate: O, noteIdsForDelete: L } = Mt(
973
- R,
974
- I,
971
+ if (d && T[0].highlightData.pageLastModifiedAt !== d) {
972
+ const { notesForUpdate: D, noteIdsForDelete: R } = Mt(
973
+ w,
974
+ T,
975
975
  d
976
976
  );
977
- for (const H of O)
978
- N({ id: H.id, input: H }).catch((le) => r == null ? void 0 : r(le));
979
- for (const H of L)
980
- v(H, { onError: s });
977
+ for (const u of D)
978
+ N({ id: u.id, input: u }).catch((k) => r == null ? void 0 : r(k));
979
+ for (const u of R)
980
+ C(u, { onError: i });
981
981
  } else {
982
- for (const O of I) {
983
- const L = se(O);
984
- M.add(O.id), L && (u.push(O), E.push(L));
982
+ for (const D of T) {
983
+ const R = se(D);
984
+ G.add(D.id), R && (M.push(D), A.push(R));
985
985
  }
986
- for (const O of P.current)
987
- M.has(O.id) || Ue(O, R);
988
- b(E), P.current = u, g && Bt(g);
986
+ for (const D of P.current)
987
+ G.has(D.id) || je(D, w);
988
+ _(A), P.current = M, h && Bt(h);
989
989
  }
990
990
  }, [
991
- Z,
992
- W,
991
+ ee,
992
+ Y,
993
993
  se,
994
994
  d,
995
995
  t,
996
996
  N,
997
- v,
998
- g
997
+ C,
998
+ h
999
999
  ]);
1000
- const $ = (R) => {
1001
- const I = t.current;
1002
- if (!D || !I) return;
1003
- const M = ie.fromRange(I, D), u = oe.fromRange(I, D);
1004
- B(
1000
+ const H = (w) => {
1001
+ const T = t.current;
1002
+ if (!S || !T) return;
1003
+ const G = le.fromRange(T, S), M = ie.fromRange(T, S);
1004
+ j(
1005
1005
  {
1006
1006
  courseId: p,
1007
1007
  objectId: m,
1008
1008
  objectType: c,
1009
1009
  userText: "",
1010
- reaction: [R],
1010
+ reaction: [w],
1011
1011
  highlightData: {
1012
- selectedText: w,
1013
- textPosition: (u == null ? void 0 : u.toSelector()) ?? null,
1014
- range: M.toSelector(),
1012
+ selectedText: v,
1013
+ textPosition: (M == null ? void 0 : M.toSelector()) ?? null,
1014
+ range: G.toSelector(),
1015
1015
  pageLastModifiedAt: d ?? ""
1016
1016
  }
1017
1017
  },
1018
1018
  {
1019
- onSuccess: (E) => {
1020
- var L;
1021
- const O = E.id;
1022
- G(), (L = window.getSelection()) == null || L.removeAllRanges(), y(O), T(), l == null || l(E);
1019
+ onSuccess: (A) => {
1020
+ var R;
1021
+ const D = A.id;
1022
+ z(), (R = window.getSelection()) == null || R.removeAllRanges(), y(D), E(), l == null || l(A);
1023
1023
  },
1024
1024
  onError: o
1025
1025
  }
1026
1026
  );
1027
1027
  };
1028
- return !D || !q ? null : ut(
1029
- /* @__PURE__ */ i(
1028
+ return !S || !Z ? null : ft(
1029
+ /* @__PURE__ */ s(
1030
1030
  "div",
1031
1031
  {
1032
- id: Se,
1032
+ id: Te,
1033
1033
  role: "toolbar",
1034
1034
  style: {
1035
1035
  position: "fixed",
1036
1036
  zIndex: 100,
1037
- top: q.top,
1038
- left: q.left,
1037
+ top: Z.top,
1038
+ left: Z.left,
1039
1039
  whiteSpace: "nowrap"
1040
1040
  },
1041
- onBlur: (R) => {
1042
- const I = document.getElementById(Se);
1043
- I != null && I.contains(R.relatedTarget) || G();
1041
+ onBlur: (w) => {
1042
+ const T = document.getElementById(Te);
1043
+ T != null && T.contains(w.relatedTarget) || z();
1044
1044
  },
1045
- children: /* @__PURE__ */ i(jn, { onSelectReaction: $ })
1045
+ children: /* @__PURE__ */ s(jn, { onSelectReaction: H })
1046
1046
  }
1047
1047
  ),
1048
1048
  document.body
1049
1049
  );
1050
1050
  }
1051
1051
  const Wn = (t, e) => ({
1052
- backgroundColor: t === A.IMPORTANT ? e.colors.importantBackground : e.colors.confusingBackground,
1053
- underlineColor: t === A.IMPORTANT ? e.colors.importantUnderline : e.colors.confusingUnderline,
1054
- underlineStyle: t === A.IMPORTANT ? "solid" : "dashed"
1055
- }), Ce = ({
1052
+ backgroundColor: t === O.IMPORTANT ? e.colors.importantBackground : e.colors.confusingBackground,
1053
+ underlineColor: t === O.IMPORTANT ? e.colors.importantUnderline : e.colors.confusingUnderline,
1054
+ underlineStyle: t === O.IMPORTANT ? "solid" : "dashed"
1055
+ }), xe = ({
1056
1056
  children: t,
1057
- type: e = A.IMPORTANT,
1057
+ type: e = O.IMPORTANT,
1058
1058
  isCardActive: n = !0,
1059
1059
  theme: o
1060
1060
  }) => {
1061
1061
  const r = Wn(e, o), l = {
1062
1062
  position: "relative",
1063
- backgroundColor: n ? r.backgroundColor : De(r.backgroundColor, 0.5),
1063
+ backgroundColor: n ? r.backgroundColor : Pe(r.backgroundColor, 0.5),
1064
1064
  textDecorationLine: "underline",
1065
1065
  textDecorationStyle: r.underlineStyle,
1066
1066
  textDecorationColor: r.underlineColor,
@@ -1068,12 +1068,12 @@ const Wn = (t, e) => ({
1068
1068
  textUnderlineOffset: o.underlineOffset,
1069
1069
  lineHeight: "normal"
1070
1070
  };
1071
- return /* @__PURE__ */ i("span", { "data-note-highlight": "true", style: l, children: t });
1072
- }, at = () => {
1073
- const { translations: t } = V();
1074
- return /* @__PURE__ */ C(x, { gap: "xx-small", alignItems: "start", as: "div", children: [
1075
- /* @__PURE__ */ i(x.Item, { as: "div", children: /* @__PURE__ */ i(pt, { color: "error" }) }),
1076
- /* @__PURE__ */ i(x.Item, { padding: "xxx-small none", shouldShrink: !0, children: /* @__PURE__ */ i(Ie, { maxLines: 3, children: t.highlightUnavailable }) })
1071
+ return /* @__PURE__ */ s("span", { "data-note-highlight": "true", style: l, children: t });
1072
+ }, dt = () => {
1073
+ const { translations: t } = J();
1074
+ return /* @__PURE__ */ I(x, { gap: "xx-small", alignItems: "start", as: "div", children: [
1075
+ /* @__PURE__ */ s(x.Item, { as: "div", children: /* @__PURE__ */ s(yt, { color: "error" }) }),
1076
+ /* @__PURE__ */ s(x.Item, { padding: "xxx-small none", shouldShrink: !0, children: /* @__PURE__ */ s(Ce, { maxLines: 3, children: t.highlightUnavailable }) })
1077
1077
  ] });
1078
1078
  }, zn = {
1079
1079
  filter: null,
@@ -1115,113 +1115,113 @@ function vo({
1115
1115
  enableCourseFilter: n = !1,
1116
1116
  learningObject: o,
1117
1117
  pageSize: r = 16,
1118
- focusNoteId: s
1118
+ focusNoteId: i
1119
1119
  }) {
1120
1120
  var se;
1121
- const [l, a] = Ke(qn, zn), { filter: m, courseFilter: c, currentPage: p, totalPages: d } = l;
1122
- j(() => {
1121
+ const [l, a] = Qe(qn, zn), { filter: m, courseFilter: c, currentPage: p, totalPages: d } = l;
1122
+ W(() => {
1123
1123
  a({ type: "SET_PAGE", payload: 1 });
1124
1124
  }, [r]);
1125
- const g = n ? c : e, S = (p - 1) * r, y = !!o, T = {
1126
- ...g ? { courseId: g } : {},
1125
+ const h = n ? c : e, b = (p - 1) * r, y = !!o, E = {
1126
+ ...h ? { courseId: h } : {},
1127
1127
  ...m ? { reactions: [m] } : {},
1128
1128
  ...o ? { learningObject: o } : {}
1129
1129
  }, {
1130
- data: h,
1131
- isLoading: W,
1132
- isError: B
1133
- } = tt({
1130
+ data: g,
1131
+ isLoading: Y,
1132
+ isError: j
1133
+ } = ot({
1134
1134
  api: t,
1135
- filter: T,
1136
- offset: S,
1135
+ filter: E,
1136
+ offset: b,
1137
1137
  pageSize: r,
1138
1138
  enabled: !y
1139
1139
  }), {
1140
1140
  data: N,
1141
- isLoading: v,
1141
+ isLoading: C,
1142
1142
  isError: P
1143
- } = nt({
1143
+ } = rt({
1144
1144
  api: t,
1145
- courseId: g ?? void 0,
1145
+ courseId: h ?? void 0,
1146
1146
  learningObject: o,
1147
1147
  enabled: y
1148
- }), F = me(() => {
1149
- const $ = (N == null ? void 0 : N.notes) ?? [];
1150
- return m ? $.filter((R) => R.reaction.includes(m)) : $;
1151
- }, [N, m]), b = _(null);
1152
- j(() => {
1153
- if (!s) {
1154
- b.current = null;
1148
+ }), $ = me(() => {
1149
+ const H = (N == null ? void 0 : N.notes) ?? [];
1150
+ return m ? H.filter((w) => w.reaction.includes(m)) : H;
1151
+ }, [N, m]), _ = B(null);
1152
+ W(() => {
1153
+ if (!i) {
1154
+ _.current = null;
1155
1155
  return;
1156
1156
  }
1157
- if (b.current === s) return;
1158
- const $ = F.findIndex((I) => I.id === s);
1159
- if ($ === -1) return;
1160
- b.current = s;
1161
- const R = Math.floor($ / r) + 1;
1162
- R !== p && a({ type: "FOCUS_PAGE", payload: R });
1163
- }, [s, F, r, p]);
1164
- const D = y ? F.slice(S, S + r) : (h == null ? void 0 : h.notes) ?? [], k = y ? v : W, w = y ? P : B, z = y ? Math.max(1, Math.ceil(F.length / r)) : ((se = h == null ? void 0 : h.pageInfo) == null ? void 0 : se.totalNrOfPages) ?? void 0, q = y ? { totalCount: F.length, totalNrOfPages: z } : h == null ? void 0 : h.pageInfo;
1165
- j(() => {
1166
- a({ type: "SET_TOTAL_PAGES", payload: z });
1167
- }, [z]);
1168
- const Y = K(($) => {
1169
- a({ type: "SET_PAGE", payload: $ });
1170
- }, []), re = K(() => {
1157
+ if (_.current === i) return;
1158
+ const H = $.findIndex((T) => T.id === i);
1159
+ if (H === -1) return;
1160
+ _.current = i;
1161
+ const w = Math.floor(H / r) + 1;
1162
+ w !== p && a({ type: "FOCUS_PAGE", payload: w });
1163
+ }, [i, $, r, p]);
1164
+ const S = y ? $.slice(b, b + r) : (g == null ? void 0 : g.notes) ?? [], L = y ? C : Y, v = y ? P : j, F = y ? Math.max(1, Math.ceil($.length / r)) : ((se = g == null ? void 0 : g.pageInfo) == null ? void 0 : se.totalNrOfPages) ?? void 0, Z = y ? { totalCount: $.length, totalNrOfPages: F } : g == null ? void 0 : g.pageInfo;
1165
+ W(() => {
1166
+ a({ type: "SET_TOTAL_PAGES", payload: F });
1167
+ }, [F]);
1168
+ const V = K((H) => {
1169
+ a({ type: "SET_PAGE", payload: H });
1170
+ }, []), ae = K(() => {
1171
1171
  a({
1172
1172
  type: "INCREMENT_PAGE"
1173
1173
  /* IncrementPage */
1174
1174
  });
1175
- }, []), Z = K(() => {
1175
+ }, []), ee = K(() => {
1176
1176
  a({
1177
1177
  type: "DECREMENT_PAGE"
1178
1178
  /* DecrementPage */
1179
1179
  });
1180
- }, []), J = K(($) => {
1181
- a({ type: "SET_FILTER", payload: $ });
1182
- }, []), G = K(($) => {
1183
- a({ type: "SET_COURSE_FILTER", payload: $ });
1180
+ }, []), re = K((H) => {
1181
+ a({ type: "SET_FILTER", payload: H });
1182
+ }, []), z = K((H) => {
1183
+ a({ type: "SET_COURSE_FILTER", payload: H });
1184
1184
  }, []);
1185
1185
  return {
1186
- notes: D,
1187
- pageInfo: q,
1188
- isLoading: k,
1189
- isError: w,
1186
+ notes: S,
1187
+ pageInfo: Z,
1188
+ isLoading: L,
1189
+ isError: v,
1190
1190
  filter: m,
1191
1191
  courseFilter: c,
1192
1192
  currentPage: p,
1193
1193
  totalPages: d,
1194
- setFilter: J,
1195
- setCourseFilter: G,
1196
- setPage: Y,
1197
- fetchNextPage: re,
1198
- fetchPreviousPage: Z
1194
+ setFilter: re,
1195
+ setCourseFilter: z,
1196
+ setPage: V,
1197
+ fetchNextPage: ae,
1198
+ fetchPreviousPage: ee
1199
1199
  };
1200
1200
  }
1201
- const Te = "all";
1201
+ const ve = "all";
1202
1202
  function Io({ filter: t, setFilter: e }) {
1203
- const { translations: n } = V(), o = me(
1203
+ const { translations: n } = J(), o = me(
1204
1204
  () => [
1205
- { label: n.allNotes, value: Te },
1206
- { label: n.important, value: A.IMPORTANT },
1207
- { label: n.unclear, value: A.CONFUSING }
1205
+ { label: n.allNotes, value: ve },
1206
+ { label: n.important, value: O.IMPORTANT },
1207
+ { label: n.unclear, value: O.CONFUSING }
1208
1208
  ],
1209
1209
  [n]
1210
1210
  ), r = K(
1211
1211
  (l, { value: a }) => {
1212
- e(!a || a === Te ? null : a);
1212
+ e(!a || a === ve ? null : a);
1213
1213
  },
1214
1214
  [e]
1215
1215
  );
1216
1216
  return {
1217
1217
  filterElement: me(
1218
- () => /* @__PURE__ */ i(
1219
- Me,
1218
+ () => /* @__PURE__ */ s(
1219
+ Be,
1220
1220
  {
1221
1221
  renderLabel: n.filter,
1222
- value: t ?? Te,
1222
+ value: t ?? ve,
1223
1223
  onChange: r,
1224
- children: o.map((l) => /* @__PURE__ */ i(Me.Option, { id: l.value, value: l.value, children: l.label }, l.value))
1224
+ children: o.map((l) => /* @__PURE__ */ s(Be.Option, { id: l.value, value: l.value, children: l.label }, l.value))
1225
1225
  }
1226
1226
  ),
1227
1227
  [t, o, r, n.filter]
@@ -1231,74 +1231,74 @@ function Io({ filter: t, setFilter: e }) {
1231
1231
  };
1232
1232
  }
1233
1233
  const Kn = ({ hasActiveFilter: t = !1 }) => {
1234
- const { translations: e } = V(), n = t ? e.nothingHereYet : e.emptyStateHeading, o = t ? e.adjustFiltersOrCreate : e.emptyStateDescription;
1235
- return /* @__PURE__ */ i(Q, { as: "div", textAlign: "center", children: /* @__PURE__ */ C(x, { direction: "column", alignItems: "center", gap: "small", children: [
1236
- !t && /* @__PURE__ */ i(yt, { size: "medium" }),
1237
- /* @__PURE__ */ i(Ne, { level: "h3", children: n }),
1238
- /* @__PURE__ */ i(ee, { color: "secondary", children: o })
1234
+ const { translations: e } = J(), n = t ? e.nothingHereYet : e.emptyStateHeading, o = t ? e.adjustFiltersOrCreate : e.emptyStateDescription;
1235
+ return /* @__PURE__ */ s(Q, { as: "div", textAlign: "center", children: /* @__PURE__ */ I(x, { direction: "column", alignItems: "center", gap: "small", children: [
1236
+ !t && /* @__PURE__ */ s(Nt, { size: "medium" }),
1237
+ /* @__PURE__ */ s(Ne, { level: "h3", children: n }),
1238
+ /* @__PURE__ */ s(te, { color: "secondary", children: o })
1239
1239
  ] }) });
1240
1240
  }, Xn = {
1241
- [A.IMPORTANT]: {
1241
+ [O.IMPORTANT]: {
1242
1242
  color: "success",
1243
1243
  translationKey: "important",
1244
- icon: /* @__PURE__ */ i(we, { size: "x-small" })
1244
+ icon: /* @__PURE__ */ s(Oe, { size: "x-small" })
1245
1245
  },
1246
- [A.CONFUSING]: {
1246
+ [O.CONFUSING]: {
1247
1247
  color: "danger",
1248
1248
  translationKey: "unclear",
1249
- icon: /* @__PURE__ */ i(ke, { size: "x-small" })
1249
+ icon: /* @__PURE__ */ s(we, { size: "x-small" })
1250
1250
  }
1251
- }, ct = ({ type: t, onTypeChange: e, renderAsMenuTrigger: n = !1 }) => {
1252
- const { translations: o } = V(), r = Xn[t], s = o[r.translationKey], [l, a] = U(!1), m = _(null), c = _(null), p = _(null), d = K(
1253
- (g) => {
1254
- e == null || e(g), a(!1);
1251
+ }, ut = ({ type: t, onTypeChange: e, renderAsMenuTrigger: n = !1 }) => {
1252
+ const { translations: o } = J(), r = Xn[t], i = o[r.translationKey], [l, a] = U(!1), m = B(null), c = B(null), p = B(null), d = K(
1253
+ (h) => {
1254
+ e == null || e(h), a(!1);
1255
1255
  },
1256
1256
  [e]
1257
1257
  );
1258
- return j(() => {
1258
+ return W(() => {
1259
1259
  if (!l) return;
1260
- const g = (y) => {
1260
+ const h = (y) => {
1261
1261
  y.key === "Escape" && y.stopPropagation();
1262
- }, S = (y) => {
1263
- var T;
1264
- y.key === "Escape" && (y.stopPropagation(), a(!1), (T = p.current) == null || T.focus());
1262
+ }, b = (y) => {
1263
+ var E;
1264
+ y.key === "Escape" && (y.stopPropagation(), a(!1), (E = p.current) == null || E.focus());
1265
1265
  };
1266
- return document.addEventListener("keydown", g, !0), document.addEventListener("keyup", S, !0), () => {
1267
- document.removeEventListener("keydown", g, !0), document.removeEventListener("keyup", S, !0);
1266
+ return document.addEventListener("keydown", h, !0), document.addEventListener("keyup", b, !0), () => {
1267
+ document.removeEventListener("keydown", h, !0), document.removeEventListener("keyup", b, !0);
1268
1268
  };
1269
- }, [l]), n && e ? /* @__PURE__ */ C(
1269
+ }, [l]), n && e ? /* @__PURE__ */ I(
1270
1270
  ce,
1271
1271
  {
1272
1272
  placement: "bottom start",
1273
1273
  show: l,
1274
- onToggle: (g) => a(g),
1274
+ onToggle: (h) => a(h),
1275
1275
  shouldHideOnSelect: !0,
1276
1276
  shouldFocusTriggerOnClose: !0,
1277
- trigger: /* @__PURE__ */ i(
1278
- Be,
1277
+ trigger: /* @__PURE__ */ s(
1278
+ $e,
1279
1279
  {
1280
1280
  color: r.color,
1281
1281
  renderIcon: r.icon,
1282
- elementRef: (g) => {
1283
- p.current = g;
1282
+ elementRef: (h) => {
1283
+ p.current = h;
1284
1284
  },
1285
- children: s
1285
+ children: i
1286
1286
  }
1287
1287
  ),
1288
1288
  children: [
1289
- /* @__PURE__ */ C(ce.Item, { ref: m, onClick: () => d(A.CONFUSING), children: [
1290
- /* @__PURE__ */ i(ke, { size: "x-small" }),
1289
+ /* @__PURE__ */ I(ce.Item, { ref: m, onClick: () => d(O.CONFUSING), children: [
1290
+ /* @__PURE__ */ s(we, { size: "x-small" }),
1291
1291
  ` ${o.markUnclear}`
1292
1292
  ] }),
1293
- /* @__PURE__ */ C(ce.Item, { ref: c, onClick: () => d(A.IMPORTANT), children: [
1294
- /* @__PURE__ */ i(we, { size: "x-small" }),
1293
+ /* @__PURE__ */ I(ce.Item, { ref: c, onClick: () => d(O.IMPORTANT), children: [
1294
+ /* @__PURE__ */ s(Oe, { size: "x-small" }),
1295
1295
  ` ${o.markImportant}`
1296
1296
  ] })
1297
1297
  ]
1298
1298
  }
1299
- ) : /* @__PURE__ */ i(Q, { display: "inline-flex", children: /* @__PURE__ */ i(Be, { color: r.color, renderIcon: r.icon, children: s }) });
1300
- }, je = "0.75rem";
1301
- function We(t, e) {
1299
+ ) : /* @__PURE__ */ s(Q, { display: "inline-flex", children: /* @__PURE__ */ s($e, { color: r.color, renderIcon: r.icon, children: i }) });
1300
+ }, We = "0.75rem";
1301
+ function ze(t, e) {
1302
1302
  return (t instanceof Date ? t : new Date(t)).toLocaleString(e, {
1303
1303
  year: "numeric",
1304
1304
  month: "short",
@@ -1311,53 +1311,53 @@ const Qn = ({
1311
1311
  highlight: n,
1312
1312
  note: o,
1313
1313
  type: r,
1314
- onClick: s,
1314
+ onClick: i,
1315
1315
  onDelete: l,
1316
1316
  onSaveNote: a,
1317
1317
  onTypeChange: m,
1318
1318
  isActive: c,
1319
1319
  isPanelView: p = !1,
1320
1320
  courseName: d,
1321
- locale: g,
1322
- highlightTheme: S,
1321
+ locale: h,
1322
+ highlightTheme: b,
1323
1323
  renderLink: y,
1324
- href: T
1324
+ href: E
1325
1325
  }) => {
1326
- const { translations: h } = V(), [W, B] = U(!1), [N, v] = U(!1), [P, F] = U(o || ""), [b, D] = U(!1), k = _(null), w = K((u) => {
1327
- k.current = u;
1328
- }, []), z = _(null), q = _(null), Y = _(!1), re = _(null), Z = _(null), J = _(!1);
1329
- j(() => {
1330
- var u, E;
1331
- c ? ((u = k.current) == null || u.scrollIntoView({ behavior: "smooth", block: "nearest" }), (E = k.current) == null || E.focus()) : D(!1);
1332
- }, [c]), j(() => {
1333
- var u, E;
1334
- N ? (Y.current = !0, (u = z.current) == null || u.focus()) : Y.current && (Y.current = !1, (E = q.current) == null || E.focus());
1335
- }, [N]), j(() => {
1336
- if (!b && J.current) {
1337
- J.current = !1;
1338
- const u = re.current;
1326
+ const { translations: g } = J(), [Y, j] = U(!1), [N, C] = U(!1), [P, $] = U(o || ""), [_, S] = U(!1), [L, v] = U(!1), [F, Z] = U(!1), V = B(null), ae = K((u) => {
1327
+ V.current = u;
1328
+ }, []), ee = B(null), re = B(null), z = B(!1), se = B(null), H = B(null), w = B(!1);
1329
+ W(() => {
1330
+ var u, k;
1331
+ c ? ((u = V.current) == null || u.scrollIntoView({ behavior: "smooth", block: "nearest" }), (k = V.current) == null || k.focus()) : S(!1);
1332
+ }, [c]), W(() => {
1333
+ var u, k;
1334
+ N ? (z.current = !0, (u = ee.current) == null || u.focus()) : z.current && (z.current = !1, (k = re.current) == null || k.focus());
1335
+ }, [N]), W(() => {
1336
+ if (!_ && w.current) {
1337
+ w.current = !1;
1338
+ const u = se.current;
1339
1339
  u != null && u.isConnected && u.focus();
1340
1340
  }
1341
- }, [b]);
1342
- const G = K((u, E) => {
1343
- J.current = !E, D(!1);
1341
+ }, [_]);
1342
+ const T = K((u, k) => {
1343
+ w.current = !k, S(!1);
1344
1344
  }, []);
1345
- j(() => {
1346
- if (!b) return;
1347
- const u = (O) => {
1348
- O.key === "Escape" && O.stopPropagation();
1349
- }, E = (O) => {
1350
- O.key === "Escape" && (O.stopPropagation(), G());
1345
+ W(() => {
1346
+ if (!_) return;
1347
+ const u = (q) => {
1348
+ q.key === "Escape" && q.stopPropagation();
1349
+ }, k = (q) => {
1350
+ q.key === "Escape" && (q.stopPropagation(), T());
1351
1351
  };
1352
- return window.addEventListener("keydown", u, !0), window.addEventListener("keyup", E, !0), () => {
1353
- window.removeEventListener("keydown", u, !0), window.removeEventListener("keyup", E, !0);
1352
+ return window.addEventListener("keydown", u, !0), window.addEventListener("keyup", k, !0), () => {
1353
+ window.removeEventListener("keydown", u, !0), window.removeEventListener("keyup", k, !0);
1354
1354
  };
1355
- }, [b, G]);
1356
- const se = r === A.IMPORTANT ? h.important : h.unclear, $ = (u) => {
1357
- u.key === "Enter" && (u.preventDefault(), s == null || s());
1358
- }, R = [se, h.note];
1359
- n && R.push(n), o && R.push(o), e && R.push(We(e, g)), d && R.push(d);
1360
- const I = R.join(", "), M = /* @__PURE__ */ C(
1355
+ }, [_, T]);
1356
+ const G = r === O.IMPORTANT ? g.important : g.unclear, M = (u) => {
1357
+ u.key === "Enter" && (u.preventDefault(), i == null || i());
1358
+ }, A = [g.note, G];
1359
+ A.push(n || g.highlightUnavailable), o && A.push(o), e && A.push(ze(e, h)), d && A.push(d);
1360
+ const D = A.join(", "), R = /* @__PURE__ */ I(
1361
1361
  Q,
1362
1362
  {
1363
1363
  as: "div",
@@ -1366,139 +1366,145 @@ const Qn = ({
1366
1366
  borderRadius: "medium",
1367
1367
  padding: "small",
1368
1368
  position: "relative",
1369
- role: T ? void 0 : c || N ? "group" : "button",
1370
- "aria-label": T ? void 0 : I,
1371
- "aria-pressed": T || c || N ? void 0 : c,
1372
- tabIndex: T || c ? -1 : 0,
1369
+ role: E ? void 0 : c || N ? "group" : "button",
1370
+ "aria-label": E ? void 0 : D,
1371
+ "aria-pressed": E || c || N ? void 0 : c,
1372
+ tabIndex: E || c ? -1 : 0,
1373
1373
  "data-testid": `note-card-${t}`,
1374
- elementRef: w,
1375
- onClick: c ? void 0 : s,
1376
- onMouseEnter: () => B(!0),
1377
- onMouseLeave: () => B(!1),
1378
- onKeyDown: c ? void 0 : $,
1374
+ elementRef: ae,
1375
+ onClick: c ? void 0 : i,
1376
+ onMouseEnter: () => j(!0),
1377
+ onMouseLeave: () => j(!1),
1378
+ onKeyDown: c ? void 0 : M,
1379
1379
  cursor: N ? "default" : "pointer",
1380
1380
  children: [
1381
- /* @__PURE__ */ i(
1381
+ /* @__PURE__ */ s(
1382
1382
  "div",
1383
1383
  {
1384
1384
  "data-testid": `note-card-${t}-content`,
1385
1385
  style: {
1386
1386
  height: "100%",
1387
- opacity: c && b && l ? 0.25 : void 0
1387
+ opacity: c && _ && l ? 0.25 : void 0
1388
1388
  },
1389
- children: /* @__PURE__ */ C(x, { direction: "column", gap: "small", height: "100%", children: [
1390
- /* @__PURE__ */ i(
1391
- ct,
1389
+ children: /* @__PURE__ */ I(x, { direction: "column", gap: "small", height: "100%", children: [
1390
+ /* @__PURE__ */ s(
1391
+ ut,
1392
1392
  {
1393
1393
  type: r,
1394
1394
  onTypeChange: p && m ? (u) => m(t, u) : void 0,
1395
1395
  renderAsMenuTrigger: p && !!m && !!c
1396
1396
  }
1397
1397
  ),
1398
- n ? /* @__PURE__ */ i("div", { style: { wordBreak: "break-word", overflowWrap: "break-word" }, children: /* @__PURE__ */ i(ee, { children: c && p ? /* @__PURE__ */ i(
1399
- Ce,
1400
- {
1401
- type: r,
1402
- isCardActive: !!c || W,
1403
- theme: S,
1404
- children: n
1405
- }
1406
- ) : /* @__PURE__ */ i(Ie, { maxLines: 3, truncate: "word", children: /* @__PURE__ */ i(
1407
- Ce,
1398
+ n ? /* @__PURE__ */ s("div", { style: { wordBreak: "break-word", overflowWrap: "break-word" }, children: /* @__PURE__ */ s(te, { children: c && p ? /* @__PURE__ */ s(
1399
+ xe,
1408
1400
  {
1409
1401
  type: r,
1410
- isCardActive: !!c || W,
1411
- theme: S,
1402
+ isCardActive: !!c || Y,
1403
+ theme: b,
1412
1404
  children: n
1413
1405
  }
1414
- ) }) }) }) : /* @__PURE__ */ i(at, {}),
1415
- /* @__PURE__ */ i(x.Item, { shouldGrow: !0, children: /* @__PURE__ */ C(x, { direction: "column", gap: "small", height: "100%", children: [
1416
- N && p ? /* @__PURE__ */ C(x, { direction: "column", gap: "x-small", margin: "xx-small", children: [
1417
- /* @__PURE__ */ i(
1418
- Xe,
1406
+ ) : /* @__PURE__ */ I(qe, { children: [
1407
+ L && /* @__PURE__ */ s(Se, { children: n }),
1408
+ /* @__PURE__ */ s("span", { "aria-hidden": L, style: { display: "block" }, children: /* @__PURE__ */ s(Ce, { maxLines: 3, truncate: "word", onUpdate: v, children: /* @__PURE__ */ s(
1409
+ xe,
1410
+ {
1411
+ type: r,
1412
+ isCardActive: !!c || Y,
1413
+ theme: b,
1414
+ children: n
1415
+ }
1416
+ ) }) })
1417
+ ] }) }) }) : /* @__PURE__ */ s(dt, {}),
1418
+ /* @__PURE__ */ s(x.Item, { shouldGrow: !0, children: /* @__PURE__ */ I(x, { direction: "column", gap: "small", height: "100%", children: [
1419
+ N && p ? /* @__PURE__ */ I(x, { direction: "column", gap: "x-small", margin: "xx-small", children: [
1420
+ /* @__PURE__ */ s(
1421
+ Ye,
1419
1422
  {
1420
- label: /* @__PURE__ */ i(bt, { children: h.editNote }),
1423
+ label: /* @__PURE__ */ s(Se, { children: g.editNote }),
1421
1424
  value: P,
1422
- onChange: (u) => F(u.target.value),
1423
- placeholder: h.addNoteOptional,
1425
+ onChange: (u) => $(u.target.value),
1426
+ placeholder: g.addNoteOptional,
1424
1427
  textareaRef: (u) => {
1425
- z.current = u;
1428
+ ee.current = u;
1426
1429
  }
1427
1430
  }
1428
1431
  ),
1429
- /* @__PURE__ */ C(x, { gap: "xx-small", children: [
1430
- /* @__PURE__ */ i(x.Item, { shouldGrow: !0, children: /* @__PURE__ */ i(
1431
- te,
1432
+ /* @__PURE__ */ I(x, { gap: "xx-small", children: [
1433
+ /* @__PURE__ */ s(x.Item, { shouldGrow: !0, children: /* @__PURE__ */ s(
1434
+ ne,
1432
1435
  {
1433
1436
  display: "block",
1434
1437
  size: "small",
1435
1438
  "data-testid": `note-card-${t}-cancel`,
1436
1439
  onClick: () => {
1437
- F(o || ""), v(!1);
1440
+ $(o || ""), C(!1);
1438
1441
  },
1439
- children: h.cancel
1442
+ children: g.cancel
1440
1443
  }
1441
1444
  ) }),
1442
- /* @__PURE__ */ i(x.Item, { shouldGrow: !0, children: /* @__PURE__ */ i(
1443
- te,
1445
+ /* @__PURE__ */ s(x.Item, { shouldGrow: !0, children: /* @__PURE__ */ s(
1446
+ ne,
1444
1447
  {
1445
1448
  display: "block",
1446
1449
  color: "primary",
1447
1450
  size: "small",
1448
1451
  "data-testid": `note-card-${t}-save`,
1449
1452
  onClick: () => {
1450
- a == null || a(t, P.trim()), v(!1);
1453
+ a == null || a(t, P.trim()), C(!1);
1451
1454
  },
1452
- children: h.save
1455
+ children: g.save
1453
1456
  }
1454
1457
  ) })
1455
1458
  ] })
1456
- ] }) : o ? /* @__PURE__ */ i("div", { style: { wordBreak: "break-word", overflowWrap: "break-word" }, children: c && p ? /* @__PURE__ */ C(ee, { children: [
1459
+ ] }) : o ? /* @__PURE__ */ s("div", { style: { wordBreak: "break-word", overflowWrap: "break-word" }, children: c && p ? /* @__PURE__ */ I(te, { children: [
1457
1460
  o,
1458
1461
  " ",
1459
- /* @__PURE__ */ i(
1462
+ /* @__PURE__ */ s(
1460
1463
  ue,
1461
1464
  {
1462
1465
  size: "small",
1463
1466
  withBackground: !1,
1464
1467
  withBorder: !1,
1465
1468
  margin: "xx-small 0 0 xxx-small",
1466
- screenReaderLabel: h.editNote,
1469
+ screenReaderLabel: g.editNote,
1467
1470
  "data-testid": `note-card-${t}-edit`,
1468
1471
  elementRef: (u) => {
1469
- q.current = u;
1472
+ re.current = u;
1470
1473
  },
1471
1474
  onClick: (u) => {
1472
- u.stopPropagation(), v(!0);
1475
+ u.stopPropagation(), C(!0);
1473
1476
  },
1474
- children: /* @__PURE__ */ i(ve, {})
1477
+ children: /* @__PURE__ */ s(Ie, {})
1475
1478
  }
1476
1479
  )
1477
- ] }) : /* @__PURE__ */ i(ee, { children: /* @__PURE__ */ i(Ie, { maxLines: 3, truncate: "word", children: o }) }) }) : p && c ? /* @__PURE__ */ i("div", { children: /* @__PURE__ */ C(ee, { color: "secondary", children: [
1478
- h.addNotePrompt,
1480
+ ] }) : /* @__PURE__ */ I(te, { children: [
1481
+ F && /* @__PURE__ */ s(Se, { children: o }),
1482
+ /* @__PURE__ */ s("span", { "aria-hidden": F, style: { display: "block" }, children: /* @__PURE__ */ s(Ce, { maxLines: 3, truncate: "word", onUpdate: Z, children: o }) })
1483
+ ] }) }) : p && c ? /* @__PURE__ */ s("div", { children: /* @__PURE__ */ I(te, { color: "secondary", children: [
1484
+ g.addNotePrompt,
1479
1485
  " ",
1480
- /* @__PURE__ */ i(
1486
+ /* @__PURE__ */ s(
1481
1487
  ue,
1482
1488
  {
1483
1489
  size: "small",
1484
1490
  withBackground: !1,
1485
1491
  withBorder: !1,
1486
1492
  margin: "xx-small 0 0 xxx-small",
1487
- screenReaderLabel: h.editNote,
1493
+ screenReaderLabel: g.editNote,
1488
1494
  "data-testid": `note-card-${t}-edit`,
1489
1495
  elementRef: (u) => {
1490
- q.current = u;
1496
+ re.current = u;
1491
1497
  },
1492
1498
  onClick: (u) => {
1493
- u.stopPropagation(), v(!0);
1499
+ u.stopPropagation(), C(!0);
1494
1500
  },
1495
- children: /* @__PURE__ */ i(ve, {})
1501
+ children: /* @__PURE__ */ s(Ie, {})
1496
1502
  }
1497
1503
  )
1498
1504
  ] }) }) : null,
1499
- /* @__PURE__ */ C(x, { justifyItems: "space-between", alignItems: "center", margin: "auto 0 0 0", children: [
1500
- /* @__PURE__ */ i(ee, { size: "small", color: "secondary", children: We(e, g) }),
1501
- c && l && /* @__PURE__ */ i(
1505
+ /* @__PURE__ */ I(x, { justifyItems: "space-between", alignItems: "center", margin: "auto 0 0 0", children: [
1506
+ /* @__PURE__ */ s(te, { as: "div", size: "small", color: "secondary", children: ze(e, h) }),
1507
+ c && l && /* @__PURE__ */ s(
1502
1508
  ue,
1503
1509
  {
1504
1510
  size: "small",
@@ -1506,37 +1512,46 @@ const Qn = ({
1506
1512
  withBorder: !1,
1507
1513
  color: "danger",
1508
1514
  margin: "xx-small",
1509
- screenReaderLabel: h.deleteNote,
1515
+ screenReaderLabel: g.deleteNote,
1510
1516
  "data-testid": `note-card-${t}-delete`,
1511
1517
  elementRef: (u) => {
1512
- re.current = u;
1518
+ se.current = u;
1513
1519
  },
1514
1520
  onClick: (u) => {
1515
- u.stopPropagation(), J.current = !1, D(!0);
1521
+ u.stopPropagation(), w.current = !1, S(!0);
1516
1522
  },
1517
- children: /* @__PURE__ */ i(ye, {})
1523
+ children: /* @__PURE__ */ s(ye, {})
1518
1524
  }
1519
1525
  )
1520
1526
  ] }),
1521
- d && /* @__PURE__ */ i(ee, { size: "small", color: "secondary", children: d })
1527
+ d && /* @__PURE__ */ s(
1528
+ te,
1529
+ {
1530
+ as: "div",
1531
+ size: "small",
1532
+ color: "secondary",
1533
+ "data-testid": `note-card-${t}-course`,
1534
+ children: d
1535
+ }
1536
+ )
1522
1537
  ] }) })
1523
1538
  ] })
1524
1539
  }
1525
1540
  ),
1526
- c && b && l && /* @__PURE__ */ i(
1541
+ c && _ && l && /* @__PURE__ */ s(
1527
1542
  Et,
1528
1543
  {
1529
1544
  open: !0,
1530
1545
  as: "div",
1531
- label: h.deleteNoteConfirmation,
1546
+ label: g.deleteNoteConfirmation,
1532
1547
  shouldContainFocus: !0,
1533
1548
  shouldFocusOnOpen: !0,
1534
- defaultFocusElement: () => Z.current,
1549
+ defaultFocusElement: () => H.current,
1535
1550
  shouldCloseOnDocumentClick: !0,
1536
1551
  shouldCloseOnEscape: !1,
1537
1552
  shouldReturnFocus: !1,
1538
- onDismiss: G,
1539
- children: /* @__PURE__ */ i(
1553
+ onDismiss: T,
1554
+ children: /* @__PURE__ */ s(
1540
1555
  Q,
1541
1556
  {
1542
1557
  as: "div",
@@ -1547,7 +1562,7 @@ const Qn = ({
1547
1562
  insetInlineStart: "0",
1548
1563
  insetInlineEnd: "0",
1549
1564
  stacking: "above",
1550
- children: /* @__PURE__ */ C(
1565
+ children: /* @__PURE__ */ I(
1551
1566
  x,
1552
1567
  {
1553
1568
  direction: "column",
@@ -1556,48 +1571,48 @@ const Qn = ({
1556
1571
  gap: "x-small",
1557
1572
  height: "100%",
1558
1573
  children: [
1559
- /* @__PURE__ */ i(
1560
- te,
1574
+ /* @__PURE__ */ s(
1575
+ ne,
1561
1576
  {
1562
1577
  display: "block",
1563
1578
  color: "danger",
1564
1579
  withBackground: !1,
1565
- themeOverride: (u, E) => ({
1566
- borderRadius: je,
1580
+ themeOverride: (u, k) => ({
1581
+ borderRadius: We,
1567
1582
  // Ghost states default to translucent fills; the faded card would show through.
1568
- dangerGhostBackground: E.colors.contrasts.white1010,
1569
- dangerGhostHoverBackground: E.colors.contrasts.red1212,
1570
- dangerGhostActiveBackground: E.colors.contrasts.red1212,
1583
+ dangerGhostBackground: k.colors.contrasts.white1010,
1584
+ dangerGhostHoverBackground: k.colors.contrasts.red1212,
1585
+ dangerGhostActiveBackground: k.colors.contrasts.red1212,
1571
1586
  // red45 on the hover tint is 3.74:1; red57 clears AA in every state.
1572
- dangerGhostColor: E.colors.contrasts.red5782,
1573
- dangerGhostBorderColor: E.colors.contrasts.red5782
1587
+ dangerGhostColor: k.colors.contrasts.red5782,
1588
+ dangerGhostBorderColor: k.colors.contrasts.red5782
1574
1589
  }),
1575
- renderIcon: /* @__PURE__ */ i(ye, {}),
1590
+ renderIcon: /* @__PURE__ */ s(ye, {}),
1576
1591
  "data-testid": `note-card-${t}-confirm-delete`,
1577
1592
  onClick: (u) => {
1578
- u.stopPropagation(), l(t), D(!1);
1593
+ u.stopPropagation(), l(t), S(!1);
1579
1594
  },
1580
- children: h.deleteNote
1595
+ children: g.deleteNote
1581
1596
  }
1582
1597
  ),
1583
- /* @__PURE__ */ i(
1584
- te,
1598
+ /* @__PURE__ */ s(
1599
+ ne,
1585
1600
  {
1586
1601
  display: "block",
1587
1602
  withBackground: !1,
1588
- themeOverride: (u, E) => ({
1589
- borderRadius: je,
1590
- secondaryGhostBackground: E.colors.contrasts.white1010,
1591
- secondaryGhostActiveBackground: E.colors.contrasts.grey1111
1603
+ themeOverride: (u, k) => ({
1604
+ borderRadius: We,
1605
+ secondaryGhostBackground: k.colors.contrasts.white1010,
1606
+ secondaryGhostActiveBackground: k.colors.contrasts.grey1111
1592
1607
  }),
1593
1608
  "data-testid": `note-card-${t}-cancel-delete`,
1594
1609
  elementRef: (u) => {
1595
- Z.current = u;
1610
+ H.current = u;
1596
1611
  },
1597
1612
  onClick: (u) => {
1598
- u.stopPropagation(), G();
1613
+ u.stopPropagation(), T();
1599
1614
  },
1600
- children: h.cancel
1615
+ children: g.cancel
1601
1616
  }
1602
1617
  )
1603
1618
  ]
@@ -1610,7 +1625,7 @@ const Qn = ({
1610
1625
  ]
1611
1626
  }
1612
1627
  );
1613
- return T && y ? y({ href: T, children: M, ariaLabel: I }) : M;
1628
+ return E && y ? y({ href: E, children: R, ariaLabel: D }) : R;
1614
1629
  }, Yn = {
1615
1630
  display: "grid",
1616
1631
  gap: "1rem",
@@ -1625,90 +1640,92 @@ const Qn = ({
1625
1640
  isError: n,
1626
1641
  currentPage: o,
1627
1642
  totalPages: r,
1628
- onPageChange: s,
1643
+ onPageChange: i,
1629
1644
  onNoteSelect: l,
1630
1645
  onNoteDelete: a,
1631
1646
  onNoteSave: m,
1632
1647
  onNoteTypeChange: c,
1633
1648
  onNotesEmptied: p,
1634
1649
  selectedNoteId: d,
1635
- hasActiveFilter: g = !1,
1636
- columnCount: S = 1,
1650
+ hasActiveFilter: h = !1,
1651
+ columnCount: b = 1,
1637
1652
  highlightTheme: y,
1638
- locale: T,
1639
- renderNoteLink: h,
1640
- noteHref: W
1653
+ locale: E,
1654
+ courseNames: g,
1655
+ renderNoteLink: Y,
1656
+ noteHref: j
1641
1657
  }) => {
1642
- const { translations: B } = V(), N = _(null), v = _(null), P = K(
1643
- (b) => {
1644
- const D = t.findIndex((w) => w.id === b);
1645
- let k = null;
1646
- t.length > 1 && (k = D > 0 ? t[D - 1].id : t[1].id), v.current = { targetId: k }, a == null || a(b);
1658
+ const { translations: N } = J(), C = B(null), P = B(null), $ = K(
1659
+ (S) => {
1660
+ const L = t.findIndex((F) => F.id === S);
1661
+ let v = null;
1662
+ t.length > 1 && (v = L > 0 ? t[L - 1].id : t[1].id), P.current = { targetId: v }, a == null || a(S);
1647
1663
  },
1648
1664
  [t, a]
1649
1665
  );
1650
- if (j(() => {
1651
- var D;
1652
- const b = v.current;
1653
- if (b)
1654
- if (v.current = null, b.targetId === null)
1666
+ if (W(() => {
1667
+ var L;
1668
+ const S = P.current;
1669
+ if (S)
1670
+ if (P.current = null, S.targetId === null)
1655
1671
  p == null || p();
1656
1672
  else {
1657
- const k = (D = N.current) == null ? void 0 : D.querySelector(
1658
- `[data-testid="note-card-${b.targetId}"]`
1673
+ const v = (L = C.current) == null ? void 0 : L.querySelector(
1674
+ `[data-testid="note-card-${S.targetId}"]`
1659
1675
  );
1660
- k == null || k.focus();
1676
+ v == null || v.focus();
1661
1677
  }
1662
1678
  }, [t, p]), e)
1663
- return /* @__PURE__ */ i(Q, { as: "div", textAlign: "center", padding: "large", "data-testid": "notes-loading", children: /* @__PURE__ */ i(Tt, { renderTitle: B.loadingNotes }) });
1679
+ return /* @__PURE__ */ s(Q, { as: "div", textAlign: "center", padding: "large", "data-testid": "notes-loading", children: /* @__PURE__ */ s(Tt, { renderTitle: N.loadingNotes }) });
1664
1680
  if (n)
1665
- return /* @__PURE__ */ i(Q, { as: "div", textAlign: "center", padding: "large", "data-testid": "notes-error", children: /* @__PURE__ */ i(Ne, { level: "h4", children: B.failedToLoadNotes }) });
1681
+ return /* @__PURE__ */ s(Q, { as: "div", textAlign: "center", padding: "large", "data-testid": "notes-error", children: /* @__PURE__ */ s(Ne, { level: "h4", children: N.failedToLoadNotes }) });
1666
1682
  if (t.length === 0)
1667
- return /* @__PURE__ */ i(Q, { as: "div", padding: "large", "data-testid": "empty-notes", children: /* @__PURE__ */ i(Kn, { hasActiveFilter: g }) });
1668
- const F = typeof o == "number" && typeof r == "number" && r > 1 && s !== void 0;
1669
- return /* @__PURE__ */ C(dt, { children: [
1670
- /* @__PURE__ */ i(
1683
+ return /* @__PURE__ */ s(Q, { as: "div", padding: "large", "data-testid": "empty-notes", children: /* @__PURE__ */ s(Kn, { hasActiveFilter: h }) });
1684
+ const _ = typeof o == "number" && typeof r == "number" && r > 1 && i !== void 0;
1685
+ return /* @__PURE__ */ I(qe, { children: [
1686
+ /* @__PURE__ */ s(
1671
1687
  "ul",
1672
1688
  {
1673
- ref: N,
1674
- style: { ...Yn, gridTemplateColumns: `repeat(${S}, minmax(0, 1fr))` },
1689
+ ref: C,
1690
+ style: { ...Yn, gridTemplateColumns: `repeat(${b}, minmax(0, 1fr))` },
1675
1691
  role: "list",
1676
1692
  "data-testid": "notes-grid",
1677
- children: t.map((b) => {
1678
- var D;
1679
- return /* @__PURE__ */ i("li", { children: /* @__PURE__ */ i(
1693
+ children: t.map((S) => {
1694
+ var L;
1695
+ return /* @__PURE__ */ s("li", { children: /* @__PURE__ */ s(
1680
1696
  Qn,
1681
1697
  {
1682
- noteId: b.id,
1683
- date: b.createdAt,
1684
- type: b.reaction[0] ?? A.IMPORTANT,
1685
- highlight: (D = b.highlightData) == null ? void 0 : D.selectedText,
1686
- note: b.userText,
1687
- isActive: d === b.id,
1698
+ noteId: S.id,
1699
+ date: S.createdAt,
1700
+ type: S.reaction[0] ?? O.IMPORTANT,
1701
+ highlight: (L = S.highlightData) == null ? void 0 : L.selectedText,
1702
+ note: S.userText,
1703
+ isActive: d === S.id,
1688
1704
  isPanelView: !!d,
1689
- onClick: l ? () => l(b.id) : void 0,
1690
- onDelete: a ? P : void 0,
1691
- onSaveNote: m ? (k, w) => m(k, w) : void 0,
1692
- onTypeChange: c ? (k, w) => c(k, w) : void 0,
1705
+ onClick: l ? () => l(S.id) : void 0,
1706
+ onDelete: a ? $ : void 0,
1707
+ onSaveNote: m ? (v, F) => m(v, F) : void 0,
1708
+ onTypeChange: c ? (v, F) => c(v, F) : void 0,
1693
1709
  highlightTheme: y,
1694
- locale: T,
1695
- renderLink: h,
1696
- href: W ? W(b.id, b) : void 0
1710
+ locale: E,
1711
+ courseName: g == null ? void 0 : g.get(S.courseId),
1712
+ renderLink: Y,
1713
+ href: j ? j(S.id, S) : void 0
1697
1714
  }
1698
- ) }, b.id);
1715
+ ) }, S.id);
1699
1716
  })
1700
1717
  }
1701
1718
  ),
1702
- F && /* @__PURE__ */ i(x, { justifyItems: "center", padding: "small", "data-testid": "notes-pagination", children: /* @__PURE__ */ i(x.Item, { children: /* @__PURE__ */ i(
1719
+ _ && /* @__PURE__ */ s(x, { justifyItems: "center", padding: "small", "data-testid": "notes-pagination", children: /* @__PURE__ */ s(x.Item, { children: /* @__PURE__ */ s(
1703
1720
  St,
1704
1721
  {
1705
1722
  as: "nav",
1706
1723
  variant: "input",
1707
- labelNext: B.nextPage,
1708
- labelPrev: B.previousPage,
1724
+ labelNext: N.nextPage,
1725
+ labelPrev: N.previousPage,
1709
1726
  currentPage: o,
1710
1727
  totalPageNumber: r,
1711
- onPageChange: s
1728
+ onPageChange: i
1712
1729
  }
1713
1730
  ) }) })
1714
1731
  ] });
@@ -1718,70 +1735,70 @@ const Qn = ({
1718
1735
  highlightText: n,
1719
1736
  highlightTheme: o,
1720
1737
  onSave: r,
1721
- onDelete: s,
1738
+ onDelete: i,
1722
1739
  onTypeChange: l,
1723
1740
  onBack: a,
1724
1741
  editing: m = !1
1725
1742
  }) => {
1726
- const { translations: c } = V(), [p, d] = U(m), [g, S] = U(t || ""), [y, T] = U(!1);
1727
- return /* @__PURE__ */ C(x, { direction: "column", gap: "small", "data-testid": "single-note", children: [
1728
- n != null ? /* @__PURE__ */ i(Q, { as: "div", children: /* @__PURE__ */ i(ee, { children: /* @__PURE__ */ i(Ce, { type: e, isCardActive: !0, theme: o, children: n }) }) }) : /* @__PURE__ */ i(at, {}),
1729
- /* @__PURE__ */ i(ct, { type: e, onTypeChange: l, renderAsMenuTrigger: !!l }),
1730
- p ? /* @__PURE__ */ C(x, { direction: "column", gap: "x-small", children: [
1731
- /* @__PURE__ */ i(
1732
- Xe,
1743
+ const { translations: c } = J(), [p, d] = U(m), [h, b] = U(t || ""), [y, E] = U(!1);
1744
+ return /* @__PURE__ */ I(x, { direction: "column", gap: "small", "data-testid": "single-note", children: [
1745
+ n != null ? /* @__PURE__ */ s(Q, { as: "div", children: /* @__PURE__ */ s(te, { children: /* @__PURE__ */ s(xe, { type: e, isCardActive: !0, theme: o, children: n }) }) }) : /* @__PURE__ */ s(dt, {}),
1746
+ /* @__PURE__ */ s(ut, { type: e, onTypeChange: l, renderAsMenuTrigger: !!l }),
1747
+ p ? /* @__PURE__ */ I(x, { direction: "column", gap: "x-small", children: [
1748
+ /* @__PURE__ */ s(
1749
+ Ye,
1733
1750
  {
1734
1751
  label: c.addNoteOptional,
1735
- value: g,
1736
- onChange: (h) => S(h.target.value),
1752
+ value: h,
1753
+ onChange: (g) => b(g.target.value),
1737
1754
  resize: "vertical"
1738
1755
  }
1739
1756
  ),
1740
- /* @__PURE__ */ C(x, { gap: "xx-small", children: [
1741
- /* @__PURE__ */ i(x.Item, { shouldGrow: !0, children: /* @__PURE__ */ i(
1742
- te,
1757
+ /* @__PURE__ */ I(x, { gap: "xx-small", children: [
1758
+ /* @__PURE__ */ s(x.Item, { shouldGrow: !0, children: /* @__PURE__ */ s(
1759
+ ne,
1743
1760
  {
1744
1761
  display: "block",
1745
1762
  size: "small",
1746
1763
  "data-testid": "single-note-cancel",
1747
1764
  onClick: () => {
1748
- S(t || ""), d(!1);
1765
+ b(t || ""), d(!1);
1749
1766
  },
1750
1767
  children: c.cancel
1751
1768
  }
1752
1769
  ) }),
1753
- /* @__PURE__ */ i(x.Item, { shouldGrow: !0, children: /* @__PURE__ */ i(
1754
- te,
1770
+ /* @__PURE__ */ s(x.Item, { shouldGrow: !0, children: /* @__PURE__ */ s(
1771
+ ne,
1755
1772
  {
1756
1773
  display: "block",
1757
1774
  color: "primary",
1758
1775
  size: "small",
1759
1776
  "data-testid": "single-note-save",
1760
1777
  onClick: () => {
1761
- r(g), d(!1);
1778
+ r(h), d(!1);
1762
1779
  },
1763
1780
  children: c.save
1764
1781
  }
1765
1782
  ) })
1766
1783
  ] })
1767
- ] }) : /* @__PURE__ */ C(x, { direction: "column", gap: "small", children: [
1768
- t && /* @__PURE__ */ C(Q, { as: "div", children: [
1769
- /* @__PURE__ */ i(Ne, { level: "h4", margin: "0 0 xx-small 0", children: c.note }),
1770
- /* @__PURE__ */ i(ee, { children: t })
1784
+ ] }) : /* @__PURE__ */ I(x, { direction: "column", gap: "small", children: [
1785
+ t && /* @__PURE__ */ I(Q, { as: "div", children: [
1786
+ /* @__PURE__ */ s(Ne, { level: "h4", margin: "0 0 xx-small 0", children: c.note }),
1787
+ /* @__PURE__ */ s(te, { children: t })
1771
1788
  ] }),
1772
- /* @__PURE__ */ C(x, { justifyItems: "space-between", children: [
1773
- /* @__PURE__ */ i(
1774
- te,
1789
+ /* @__PURE__ */ I(x, { justifyItems: "space-between", children: [
1790
+ /* @__PURE__ */ s(
1791
+ ne,
1775
1792
  {
1776
1793
  size: "small",
1777
- renderIcon: /* @__PURE__ */ i(Nt, {}),
1794
+ renderIcon: /* @__PURE__ */ s(bt, {}),
1778
1795
  "data-testid": "single-note-back",
1779
1796
  onClick: () => a == null ? void 0 : a(),
1780
1797
  children: c.back
1781
1798
  }
1782
1799
  ),
1783
- /* @__PURE__ */ C(x, { gap: "xx-small", children: [
1784
- s && /* @__PURE__ */ i(
1800
+ /* @__PURE__ */ I(x, { gap: "xx-small", children: [
1801
+ i && /* @__PURE__ */ s(
1785
1802
  ue,
1786
1803
  {
1787
1804
  size: "small",
@@ -1790,11 +1807,11 @@ const Qn = ({
1790
1807
  color: "danger",
1791
1808
  screenReaderLabel: c.deleteNote,
1792
1809
  "data-testid": "single-note-delete",
1793
- onClick: () => T(!0),
1794
- children: /* @__PURE__ */ i(ye, {})
1810
+ onClick: () => E(!0),
1811
+ children: /* @__PURE__ */ s(ye, {})
1795
1812
  }
1796
1813
  ),
1797
- /* @__PURE__ */ i(
1814
+ /* @__PURE__ */ s(
1798
1815
  ue,
1799
1816
  {
1800
1817
  size: "small",
@@ -1803,33 +1820,33 @@ const Qn = ({
1803
1820
  screenReaderLabel: c.editNote,
1804
1821
  "data-testid": "single-note-edit",
1805
1822
  onClick: () => d(!0),
1806
- children: /* @__PURE__ */ i(ve, {})
1823
+ children: /* @__PURE__ */ s(Ie, {})
1807
1824
  }
1808
1825
  )
1809
1826
  ] })
1810
1827
  ] }),
1811
- y && s && /* @__PURE__ */ i(Q, { as: "div", background: "primary", padding: "medium", borderRadius: "large", children: /* @__PURE__ */ C(x, { direction: "column", justifyItems: "center", alignItems: "center", gap: "x-small", children: [
1812
- /* @__PURE__ */ i(
1813
- te,
1828
+ y && i && /* @__PURE__ */ s(Q, { as: "div", background: "primary", padding: "medium", borderRadius: "large", children: /* @__PURE__ */ I(x, { direction: "column", justifyItems: "center", alignItems: "center", gap: "x-small", children: [
1829
+ /* @__PURE__ */ s(
1830
+ ne,
1814
1831
  {
1815
1832
  display: "block",
1816
1833
  color: "danger",
1817
1834
  size: "small",
1818
- renderIcon: /* @__PURE__ */ i(ye, {}),
1835
+ renderIcon: /* @__PURE__ */ s(ye, {}),
1819
1836
  "data-testid": "single-note-confirm-delete",
1820
1837
  onClick: () => {
1821
- s(), T(!1);
1838
+ i(), E(!1);
1822
1839
  },
1823
1840
  children: c.deleteNote
1824
1841
  }
1825
1842
  ),
1826
- /* @__PURE__ */ i(
1827
- te,
1843
+ /* @__PURE__ */ s(
1844
+ ne,
1828
1845
  {
1829
1846
  display: "block",
1830
1847
  size: "small",
1831
1848
  "data-testid": "single-note-cancel-delete",
1832
- onClick: () => T(!1),
1849
+ onClick: () => E(!1),
1833
1850
  children: c.cancel
1834
1851
  }
1835
1852
  )
@@ -1839,24 +1856,24 @@ const Qn = ({
1839
1856
  };
1840
1857
  export {
1841
1858
  To as ContentWithNoteWrapper,
1842
- Ce as Highlight,
1843
- at as HighlightError,
1859
+ xe as Highlight,
1860
+ dt as HighlightError,
1844
1861
  Qn as NoteCard,
1845
- ct as NoteChip,
1862
+ ut as NoteChip,
1846
1863
  jn as NoteReactionMenu,
1847
1864
  Kn as NotebookEmptyState,
1848
1865
  Eo as NotebookProvider,
1849
1866
  Hn as NotebookTranslationsProvider,
1850
1867
  So as NotebookTray,
1851
1868
  Co as NotesListView,
1852
- A as REACTION_TYPE,
1869
+ O as REACTION_TYPE,
1853
1870
  xo as SingleNote,
1854
- De as createTransparentColor,
1871
+ Pe as createTransparentColor,
1855
1872
  Vt as useCreateNote,
1856
1873
  Zt as useDeleteNote,
1857
- tt as useGetNotes,
1858
- it as useNotebook,
1859
- V as useNotebookTranslations,
1874
+ ot as useGetNotes,
1875
+ at as useNotebook,
1876
+ J as useNotebookTranslations,
1860
1877
  vo as useNotesData,
1861
1878
  Io as useReactionFilter,
1862
1879
  en as useUpdateNote