@instructure/platform-notebook 1.9.1 → 1.9.3

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,110 +1,110 @@
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
- import { z as f } from "zod";
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
- import { Flex as x } from "@instructure/ui-flex";
9
- import { Heading as Ne } from "@instructure/ui-heading";
10
- import { Tray as pt } from "@instructure/ui-tray";
11
- import { View as Q } from "@instructure/ui-view";
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
- import { Menu as ce } from "@instructure/ui-menu";
14
- import { TruncateText as Ce } from "@instructure/ui-truncate-text";
1
+ import { jsx as s, jsxs as S, Fragment as qe } from "react/jsx-runtime";
2
+ import { createContext as Ke, useMemo as he, useContext as Xe, useReducer as Qe, useRef as $, useEffect as z, useState as j, useCallback as q } from "react";
3
+ import { createPortal as mt } from "react-dom";
4
+ import { z as u } from "zod";
5
+ import gt from "diff-match-patch";
6
+ import { useQueryClient as we, useMutation as Oe, useQuery as ht } from "@tanstack/react-query";
7
+ import { CloseButton as pt, Button as re, IconButton as me } from "@instructure/ui-buttons";
8
+ import { Flex as k } from "@instructure/ui-flex";
9
+ import { Heading as Se } from "@instructure/ui-heading";
10
+ import { Tray as yt } from "@instructure/ui-tray";
11
+ import { View as X } from "@instructure/ui-view";
12
+ import { IconQuestionLine as Le, IconPinLine as Ae, IconWarningLine as Nt, IconNoteLine as bt, IconEditLine as ke, IconTrashLine as Te, IconArrowStartLine as Et } from "@instructure/ui-icons";
13
+ import { Menu as ue } from "@instructure/ui-menu";
14
+ import { TruncateText as Ee } from "@instructure/ui-truncate-text";
15
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
- import { Dialog as Et } from "@instructure/ui-dialog";
16
+ import { Text as oe } from "@instructure/ui-text";
17
+ import { ScreenReaderContent as pe } from "@instructure/ui-a11y-content";
18
+ import { Dialog as Tt } from "@instructure/ui-dialog";
19
19
  import { TextArea as Ye } from "@instructure/ui-text-area";
20
20
  import { Pill as $e } from "@instructure/ui-pill";
21
21
  import { Pagination as St } from "@instructure/ui-pagination";
22
- import { Spinner as Tt } from "@instructure/ui-spinner";
23
- const vt = f.object({
24
- startContainer: f.string(),
25
- endContainer: f.string(),
26
- startOffset: f.number(),
27
- endOffset: f.number()
28
- }), It = f.object({
29
- start: f.number(),
30
- end: f.number()
31
- }), Le = f.object({
32
- selectedText: f.string(),
33
- hasNoHighlightAnymore: f.boolean().optional(),
34
- textPosition: It.nullable(),
35
- range: vt.nullable(),
36
- pageLastModifiedAt: f.string()
22
+ import { Spinner as vt } from "@instructure/ui-spinner";
23
+ const It = u.object({
24
+ startContainer: u.string(),
25
+ endContainer: u.string(),
26
+ startOffset: u.number(),
27
+ endOffset: u.number()
28
+ }), Ct = u.object({
29
+ start: u.number(),
30
+ end: u.number()
31
+ }), De = u.object({
32
+ selectedText: u.string(),
33
+ hasNoHighlightAnymore: u.boolean().optional(),
34
+ textPosition: Ct.nullable(),
35
+ range: It.nullable(),
36
+ pageLastModifiedAt: u.string()
37
37
  });
38
- var O = /* @__PURE__ */ ((t) => (t.IMPORTANT = "Important", t.CONFUSING = "Confusing", t))(O || {});
39
- const Ae = f.enum([
38
+ var R = /* @__PURE__ */ ((t) => (t.IMPORTANT = "Important", t.CONFUSING = "Confusing", t))(R || {});
39
+ const Pe = u.enum([
40
40
  "Important",
41
41
  "Confusing"
42
42
  /* CONFUSING */
43
- ]), Ct = f.object({
44
- totalCount: f.number().nullish(),
45
- totalNrOfPages: f.number().nullish()
46
- }), be = f.object({
47
- id: f.string(),
48
- rootAccountUuid: f.string(),
49
- userId: f.string(),
50
- courseId: f.string(),
51
- objectId: f.string(),
52
- objectType: f.string(),
53
- userText: f.string().optional(),
54
- reaction: f.array(Ae),
55
- highlightData: Le,
56
- createdAt: f.string(),
57
- updatedAt: f.string()
58
- }), xt = f.object({
59
- cursor: f.string(),
60
- node: be
43
+ ]), xt = u.object({
44
+ totalCount: u.number().nullish(),
45
+ totalNrOfPages: u.number().nullish()
46
+ }), ve = u.object({
47
+ id: u.string(),
48
+ rootAccountUuid: u.string(),
49
+ userId: u.string(),
50
+ courseId: u.string(),
51
+ objectId: u.string(),
52
+ objectType: u.string(),
53
+ userText: u.string().optional(),
54
+ reaction: u.array(Pe),
55
+ highlightData: De,
56
+ createdAt: u.string(),
57
+ updatedAt: u.string()
58
+ }), kt = u.object({
59
+ cursor: u.string(),
60
+ node: ve
61
61
  });
62
- f.object({
63
- notes: f.object({
64
- edges: f.array(xt),
65
- nodes: f.array(be),
66
- pageInfo: Ct
62
+ u.object({
63
+ notes: u.object({
64
+ edges: u.array(kt),
65
+ nodes: u.array(ve),
66
+ pageInfo: xt
67
67
  })
68
68
  });
69
- const Rt = f.object({
70
- type: f.string(),
71
- id: f.string()
72
- }), kt = f.object({
73
- courseId: f.string().optional(),
69
+ const Rt = u.object({
70
+ type: u.string(),
71
+ id: u.string()
72
+ }), wt = u.object({
73
+ courseId: u.string().optional(),
74
74
  learningObject: Rt.optional(),
75
- reactions: f.array(f.string()).optional()
75
+ reactions: u.array(u.string()).optional()
76
76
  }).optional();
77
- f.object({
78
- courseId: f.string().optional(),
79
- filter: kt,
80
- offset: f.number().optional(),
81
- pageSize: f.number().optional()
77
+ u.object({
78
+ courseId: u.string().optional(),
79
+ filter: wt,
80
+ offset: u.number().optional(),
81
+ pageSize: u.number().optional()
82
82
  });
83
- f.object({
84
- courseId: f.string(),
85
- objectId: f.string(),
86
- objectType: f.string(),
87
- userText: f.string().optional(),
88
- reaction: f.array(Ae),
89
- highlightData: Le
83
+ u.object({
84
+ courseId: u.string(),
85
+ objectId: u.string(),
86
+ objectType: u.string(),
87
+ userText: u.string().optional(),
88
+ reaction: u.array(Pe),
89
+ highlightData: De
90
90
  });
91
- f.object({
92
- createNote: be
91
+ u.object({
92
+ createNote: ve
93
93
  });
94
- f.object({
95
- id: f.string(),
96
- userText: f.string().optional(),
97
- reaction: f.array(Ae),
98
- highlightData: Le
94
+ u.object({
95
+ id: u.string(),
96
+ userText: u.string().optional(),
97
+ reaction: u.array(Pe),
98
+ highlightData: De
99
99
  });
100
- f.object({
101
- updateNote: be
100
+ u.object({
101
+ updateNote: ve
102
102
  });
103
- f.object({
104
- deleteNote: f.string()
103
+ u.object({
104
+ deleteNote: u.string()
105
105
  });
106
106
  var Ve = /* @__PURE__ */ ((t) => (t[t.FORWARDS = 1] = "FORWARDS", t[t.BACKWARDS = 2] = "BACKWARDS", t))(Ve || {});
107
- class oe {
107
+ class se {
108
108
  constructor(e, n) {
109
109
  this.start = e, this.end = n;
110
110
  }
@@ -122,17 +122,17 @@ class oe {
122
122
  return o.setStart(e.node, e.offset), o.setEnd(n.node, n.offset), o;
123
123
  }
124
124
  static fromRange(e) {
125
- const n = X.fromPoint(e.startContainer, e.startOffset), o = X.fromPoint(e.endContainer, e.endOffset);
126
- return !n || !o ? null : new oe(n, o);
125
+ const n = K.fromPoint(e.startContainer, e.startOffset), o = K.fromPoint(e.endContainer, e.endOffset);
126
+ return !n || !o ? null : new se(n, o);
127
127
  }
128
128
  static fromOffsets(e, n, o) {
129
- return new oe(new X(e, n), new X(e, o));
129
+ return new se(new K(e, n), new K(e, o));
130
130
  }
131
131
  relativeTo(e) {
132
- return new oe(this.start.relativeTo(e), this.end.relativeTo(e));
132
+ return new se(this.start.relativeTo(e), this.end.relativeTo(e));
133
133
  }
134
134
  }
135
- class X {
135
+ class K {
136
136
  constructor(e, n) {
137
137
  n < 0 && console.error("Offset is invalid"), this.element = e, this.offset = n;
138
138
  }
@@ -154,9 +154,9 @@ class X {
154
154
  static fromCharOffset(e, n) {
155
155
  switch (e.nodeType) {
156
156
  case Node.TEXT_NODE:
157
- return X.fromPoint(e, n);
157
+ return K.fromPoint(e, n);
158
158
  case Node.ELEMENT_NODE:
159
- return new X(e, n);
159
+ return new K(e, n);
160
160
  default:
161
161
  return console.error("Node is not an element or text node"), null;
162
162
  }
@@ -168,8 +168,8 @@ 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 = Ue(e) + n;
172
- return new X(e.parentElement, o);
171
+ const o = Ge(e) + n;
172
+ return new K(e.parentElement, o);
173
173
  }
174
174
  case Node.ELEMENT_NODE: {
175
175
  if (n < 0 || n > e.childNodes.length)
@@ -177,7 +177,7 @@ class X {
177
177
  let o = 0;
178
178
  for (let r = 0; r < n; r++)
179
179
  o += Ze(e.childNodes[r]);
180
- return new X(e, o);
180
+ return new K(e, o);
181
181
  }
182
182
  default:
183
183
  return console.error("Point is not in an element or text node"), null;
@@ -188,22 +188,22 @@ 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 += Ue(n), n.parentElement && (n = n.parentElement);
192
- return new X(n, o);
191
+ o += Ge(n), n.parentElement && (n = n.parentElement);
192
+ return new K(n, o);
193
193
  }
194
194
  }
195
- const wt = (t) => {
195
+ const Ot = (t) => {
196
196
  const e = t.nodeName.toLowerCase();
197
197
  return e === "#text" ? "text()" : e;
198
198
  };
199
- function Ot(t) {
199
+ function Lt(t) {
200
200
  let e = 0, n = t;
201
201
  for (; n; )
202
202
  n.nodeName === t.nodeName && (e += 1), n = n.previousSibling;
203
203
  return e;
204
204
  }
205
- const Lt = (t) => {
206
- const e = wt(t), n = Ot(t);
205
+ const At = (t) => {
206
+ const e = Ot(t), n = Lt(t);
207
207
  return `${e}[${n}]`;
208
208
  }, He = (t, e) => {
209
209
  let n = "", o = t;
@@ -212,10 +212,10 @@ const Lt = (t) => {
212
212
  console.error("Node is not a descendant of root");
213
213
  return;
214
214
  }
215
- n = `${Lt(o)}/${n}`, o = o.parentNode;
215
+ n = `${At(o)}/${n}`, o = o.parentNode;
216
216
  }
217
217
  return n = `/${n}`, n = n.replace(/\/$/, ""), n;
218
- }, At = (t, e, n) => {
218
+ }, Dt = (t, e, n) => {
219
219
  const o = e.toUpperCase();
220
220
  let r = -1;
221
221
  for (let i = 0; i < t.children.length; i++) {
@@ -224,7 +224,7 @@ const Lt = (t) => {
224
224
  return l;
225
225
  }
226
226
  return null;
227
- }, Dt = (t, e) => {
227
+ }, Pt = (t, e) => {
228
228
  if (!(t.match(/^(\/[A-Za-z0-9-]+(\[[0-9]+])?)+$/) !== null))
229
229
  return console.error("Expression is not a simple XPath"), null;
230
230
  const o = t.split("/");
@@ -235,52 +235,52 @@ const Lt = (t) => {
235
235
  const m = i.indexOf("[");
236
236
  if (m !== -1) {
237
237
  l = i.slice(0, m);
238
- const p = i.slice(m + 1, i.indexOf("]"));
239
- if (a = Number.parseInt(p, 10) - 1, a < 0)
238
+ const y = i.slice(m + 1, i.indexOf("]"));
239
+ if (a = Number.parseInt(y, 10) - 1, a < 0)
240
240
  return null;
241
241
  } else
242
242
  l = i, a = 0;
243
- const c = At(r, l, a);
243
+ const c = Dt(r, l, a);
244
244
  if (!c)
245
245
  return null;
246
246
  r = c;
247
247
  }
248
248
  return r;
249
- }, Ge = (t, e = document.body) => {
249
+ }, Ue = (t, e = document.body) => {
250
250
  try {
251
- return Dt(t, e);
251
+ return Pt(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 le {
256
+ class ae {
257
257
  constructor(e, n) {
258
258
  this.root = e, this.range = n;
259
259
  }
260
260
  static fromRange(e, n) {
261
- return new le(e, n);
261
+ return new ae(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 = Ge(n.startContainer, e);
266
+ const o = Ue(n.startContainer, e);
267
267
  if (!o)
268
268
  return console.error("Failed to resolve startContainer XPath"), null;
269
- const r = Ge(n.endContainer, e);
269
+ const r = Ue(n.endContainer, e);
270
270
  if (!r)
271
271
  return console.error("Failed to resolve endContainer XPath"), null;
272
- const i = X.fromCharOffset(o, n.startOffset), l = X.fromCharOffset(r, n.endOffset);
272
+ const i = K.fromCharOffset(o, n.startOffset), l = K.fromCharOffset(r, n.endOffset);
273
273
  if (!i || !l)
274
274
  return null;
275
- const a = new oe(i, l).toRange();
276
- return a ? new le(e, a) : null;
275
+ const a = new se(i, l).toRange();
276
+ return a ? new ae(e, a) : null;
277
277
  }
278
278
  toRange() {
279
279
  return this.range;
280
280
  }
281
281
  toSelector() {
282
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);
283
+ const e = (i = se.fromRange(this.range)) == null ? void 0 : i.toRange(), n = e && se.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 le {
289
289
  };
290
290
  }
291
291
  }
292
- class ie {
292
+ class le {
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 = oe.fromRange(n)) == null ? void 0 : r.relativeTo(e);
299
- return o ? new ie(e, o.start.offset, o.end.offset) : null;
298
+ const o = (r = se.fromRange(n)) == null ? void 0 : r.relativeTo(e);
299
+ return o ? new le(e, o.start.offset, o.end.offset) : null;
300
300
  }
301
301
  static fromSelector(e, n) {
302
- return new ie(e, n.start, n.end);
302
+ return new le(e, n.start, n.end);
303
303
  }
304
304
  toSelector() {
305
305
  return {
@@ -308,7 +308,7 @@ class ie {
308
308
  };
309
309
  }
310
310
  toRange() {
311
- return oe.fromOffsets(this.root, this.start, this.end).toRange();
311
+ return se.fromOffsets(this.root, this.start, this.end).toRange();
312
312
  }
313
313
  }
314
314
  const Ze = (t) => {
@@ -320,7 +320,7 @@ const Ze = (t) => {
320
320
  default:
321
321
  return 0;
322
322
  }
323
- }, Ue = (t) => {
323
+ }, Ge = (t) => {
324
324
  let e = t.previousSibling, n = 0;
325
325
  for (; e; )
326
326
  n += Ze(e), e = e.previousSibling;
@@ -334,14 +334,14 @@ const Ze = (t) => {
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
- }, Pt = (t, e, n, o) => {
337
+ }, _t = (t, e, n, o) => {
338
338
  const r = n - e;
339
- return Math.abs(r - o) <= 5 ? ie.fromSelector(t, {
339
+ return Math.abs(r - o) <= 5 ? le.fromSelector(t, {
340
340
  start: e,
341
341
  end: n
342
342
  }) : null;
343
- }, _t = (t, e, n, o) => {
344
- const r = new mt();
343
+ }, Ft = (t, e, n, o) => {
344
+ const r = new gt();
345
345
  r.Match_Distance = 5e3;
346
346
  const i = t.textContent;
347
347
  if (!i)
@@ -349,41 +349,41 @@ const Ze = (t) => {
349
349
  if (e.length > 32) {
350
350
  const l = e.slice(0, 32), a = e.slice(-32), m = o - n;
351
351
  let c = r.match_main(i, l, n);
352
- const p = r.match_main(i, a, o), d = p + a.length;
353
- if (c === -1 || p === -1)
352
+ const y = r.match_main(i, a, o), d = y + a.length;
353
+ if (c === -1 || y === -1)
354
354
  return null;
355
355
  const h = d - c, b = Math.abs(h - m);
356
356
  if ((c > d || b > 5) && (r.Match_Distance = e.length + 100, c = r.match_main(i, l, d), c !== -1 && c < d))
357
- return Pt(t, c, d, m);
357
+ return _t(t, c, d, m);
358
358
  if (c < d && b <= 5)
359
- return ie.fromSelector(t, {
359
+ return le.fromSelector(t, {
360
360
  start: c,
361
361
  end: d
362
362
  });
363
363
  } else {
364
364
  const l = r.match_main(i, e, n);
365
365
  if (l !== -1)
366
- return ie.fromSelector(t, {
366
+ return le.fromSelector(t, {
367
367
  start: l,
368
368
  end: l + e.length
369
369
  });
370
370
  }
371
371
  return null;
372
- }, Ft = (t, e) => {
372
+ }, Mt = (t, e) => {
373
373
  if (!e) return null;
374
374
  const { highlightData: n } = t, { textPosition: o, selectedText: r } = n;
375
- return _t(
375
+ return Ft(
376
376
  e,
377
377
  r,
378
378
  (o == null ? void 0 : o.start) ?? 0,
379
379
  (o == null ? void 0 : o.end) ?? 0
380
380
  );
381
- }, Mt = (t, e, n) => {
381
+ }, Bt = (t, e, n) => {
382
382
  const o = [], r = [];
383
383
  for (const i of e) {
384
- const l = Ft(i, t);
384
+ const l = Mt(i, t);
385
385
  if (l) {
386
- const a = l.toRange(), m = a && le.fromRange(t, a), c = (a == null ? void 0 : a.toString().trim()) || i.highlightData.selectedText;
386
+ const a = l.toRange(), m = a && ae.fromRange(t, a), c = (a == null ? void 0 : a.toString().trim()) || i.highlightData.selectedText;
387
387
  o.push({
388
388
  id: i.id,
389
389
  reaction: i.reaction,
@@ -414,37 +414,37 @@ const Ze = (t) => {
414
414
  var l;
415
415
  if (!e) return;
416
416
  const { highlightData: n, id: o } = t, { range: r } = n ?? {};
417
- r && ((l = le.fromSelector(e, r)) == null ? void 0 : l.toRange()) && Yt({ id: o });
418
- }, Bt = (t) => {
417
+ r && ((l = ae.fromSelector(e, r)) == null ? void 0 : l.toRange()) && Yt({ id: o });
418
+ }, $t = (t) => {
419
419
  const n = document.querySelector(
420
420
  `[data-highlight-id="${CSS.escape(t)}"].highlight-content`
421
- ) ?? document.getElementById(Ee(t));
421
+ ) ?? document.getElementById(Ie(t));
422
422
  if (n) {
423
423
  const o = n.getBoundingClientRect();
424
424
  o.top >= 0 && o.bottom <= (window.innerHeight || document.documentElement.clientHeight) || n.scrollIntoView({ behavior: "smooth", block: "center" });
425
425
  }
426
- }, ge = 90, he = 172, $t = (t) => {
426
+ }, ye = 90, Ne = 172, Ht = (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, 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
- }, c = (y) => {
434
- const E = y + ge;
435
- return y >= i && E <= a - i;
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 = (p) => {
431
+ const E = p + Ne;
432
+ return p >= i && E <= l - i;
433
+ }, c = (p) => {
434
+ const E = p + ye;
435
+ return p >= i && E <= a - i;
436
436
  };
437
- let p;
438
- const d = n.right - he;
437
+ let y;
438
+ const d = n.right - Ne;
439
439
  if (m(d))
440
- p = d;
440
+ y = d;
441
441
  else {
442
- const y = n.left;
443
- if (m(y))
444
- p = y;
442
+ const p = n.left;
443
+ if (m(p))
444
+ y = p;
445
445
  else {
446
- const g = (n.left + n.right) / 2 - he / 2;
447
- m(g) ? p = g : d < i ? p = i : p = l - he - i;
446
+ const g = (n.left + n.right) / 2 - Ne / 2;
447
+ m(g) ? y = g : d < i ? y = i : y = l - Ne - i;
448
448
  }
449
449
  }
450
450
  let h;
@@ -452,20 +452,20 @@ const Ze = (t) => {
452
452
  if (c(b))
453
453
  h = b;
454
454
  else {
455
- const y = n.top - ge - r;
456
- c(y) ? h = y : b + ge > a - i ? h = a - ge - i : h = i;
455
+ const p = n.top - ye - r;
456
+ c(p) ? h = p : b + ye > a - i ? h = a - ye - i : h = i;
457
457
  }
458
- return { top: h, left: p };
459
- }, Ht = (t, e) => {
458
+ return { top: h, left: y };
459
+ }, Ut = (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
- }, 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) => {
464
+ }, _e = (t) => `highlight-wrapper-${t}`, Ie = (t) => `${_e(t)}-start`, et = (t) => `${_e(t)}-end`, ge = (t) => `[data-highlight-id="${CSS.escape(t)}"]`, Gt = "2px", jt = "3px", Wt = "1px", tt = "3px", zt = "1px", nt = "Notebook note", Fe = (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
- }, 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 = "");
467
+ }, ot = (t, e, n, o, r) => {
468
+ t.style.backgroundColor = n, t.style.textDecorationColor = o, t.style.textDecorationStyle = r, e ? (t.dataset.selected = "true", t.style.outline = `${Wt} ${r} ${o}`, t.style.outlineOffset = zt, 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 {
@@ -498,36 +498,36 @@ const Ze = (t) => {
498
498
  return n;
499
499
  }, Xt = (t, e, n) => {
500
500
  if (t.collapsed) return;
501
- const o = e.id ?? "", r = De(o);
502
- if (document.getElementById(Ee(o))) {
501
+ const o = e.id ?? "", r = _e(o);
502
+ if (document.getElementById(Ie(o))) {
503
503
  Qt(e, n);
504
504
  return;
505
505
  }
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");
506
+ const l = e.type === R.IMPORTANT ? n.colors.importantBackground : n.colors.confusingBackground, a = e.id === e.selectedNoteId, m = a ? l : Fe(l, 0.5), c = e.type === R.IMPORTANT ? n.colors.importantUnderline : n.colors.confusingUnderline, y = e.type === R.IMPORTANT ? "solid" : "dashed", d = document.createElement("span");
507
507
  d.id = `${r}-start`, d.className = "highlight-marker-start", d.dataset.highlightId = o || "";
508
- const h = e.labelPrefix ?? zt;
508
+ const h = e.labelPrefix ?? nt;
509
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
510
  const b = document.createElement("span");
511
511
  b.id = et(o), b.className = "highlight-marker-end", b.dataset.highlightId = o || "";
512
- const y = t.cloneRange();
513
- y.collapse(!1), y.insertNode(b);
512
+ const p = t.cloneRange();
513
+ p.collapse(!1), p.insertNode(b);
514
514
  const E = t.cloneRange();
515
515
  E.collapse(!0), E.insertNode(d);
516
516
  const g = document.createRange();
517
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
- const P = N.parentElement;
522
- if ((P == null ? void 0 : P.dataset.highlightId) === o) return;
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);
518
+ const W = Kt(g).filter((N) => N.textContent && N.textContent.length > 0);
519
+ W.forEach((N, C) => {
520
+ var M;
521
+ const D = N.parentElement;
522
+ if ((D == null ? void 0 : D.dataset.highlightId) === o) return;
523
+ const H = C === 0, P = C === W.length - 1, T = W.length === 1;
524
+ let O;
525
+ T ? O = "single" : H ? O = "first" : P ? O = "last" : O = "middle";
526
+ const x = document.createElement("span");
527
+ x.className = "highlight-content", x.dataset.highlightId = o || "", x.dataset.position = O, x.style.textDecorationLine = "underline", x.style.textDecorationThickness = n.borderWidthSmall, x.style.textUnderlineOffset = n.underlineOffset, x.style.cursor = "pointer", ot(x, a, m, c, y), x.addEventListener("click", (V) => {
528
+ var Z;
529
+ V.target.tagName !== "A" && ((Z = e.onClick) == null || Z.call(e));
530
+ }), (M = N.parentNode) == null || M.insertBefore(x, N), x.appendChild(N);
531
531
  }), d.addEventListener("click", (N) => {
532
532
  var C;
533
533
  N.target.tagName !== "A" && ((C = e.onClick) == null || C.call(e));
@@ -536,93 +536,93 @@ const Ze = (t) => {
536
536
  if (N.key === "Enter" || N.key === " ")
537
537
  N.preventDefault(), (C = e.onClick) == null || C.call(e);
538
538
  else if (N.key === "Tab" && !N.shiftKey) {
539
- const P = document.querySelectorAll(fe(o));
540
- for (const $ of P) {
541
- const _ = $.querySelector("a");
542
- if (_) {
543
- N.preventDefault(), _.focus();
539
+ const D = document.querySelectorAll(ge(o));
540
+ for (const H of D) {
541
+ const P = H.querySelector("a");
542
+ if (P) {
543
+ N.preventDefault(), P.focus();
544
544
  break;
545
545
  }
546
546
  }
547
547
  }
548
548
  }), d.addEventListener("focus", () => {
549
549
  document.querySelectorAll(
550
- `.highlight-content${fe(o)}`
550
+ `.highlight-content${ge(o)}`
551
551
  ).forEach((C) => {
552
- C.style.boxShadow = `0 0 0 ${Gt} ${n.colors.focusOutline}`, C.style.borderRadius = Ut;
552
+ C.style.boxShadow = `0 0 0 ${Gt} ${n.colors.focusOutline}`, C.style.borderRadius = jt;
553
553
  });
554
554
  }), d.addEventListener("blur", () => {
555
555
  document.querySelectorAll(
556
- `.highlight-content${fe(o)}`
556
+ `.highlight-content${ge(o)}`
557
557
  ).forEach((C) => {
558
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 === 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";
563
+ const n = t.type === R.IMPORTANT ? e.colors.importantBackground : e.colors.confusingBackground, o = t.id === t.selectedNoteId, r = o ? n : Fe(n, 0.5), i = t.type === R.IMPORTANT ? e.colors.importantUnderline : e.colors.confusingUnderline, l = t.type === R.IMPORTANT ? "solid" : "dashed";
564
564
  document.querySelectorAll(
565
- `.highlight-content${fe(t.id ?? "")}`
565
+ `.highlight-content${ge(t.id ?? "")}`
566
566
  ).forEach((c) => {
567
- nt(c, o, r, i, l);
567
+ ot(c, o, r, i, l);
568
568
  });
569
569
  const m = document.getElementById(
570
- Ee(t.id ?? "")
570
+ Ie(t.id ?? "")
571
571
  );
572
- m && (m.setAttribute("aria-expanded", String(o && !!t.isTrayOpen)), o ? m.setAttribute("aria-current", "true") : m.removeAttribute("aria-current"));
572
+ m && (m.setAttribute("aria-label", t.labelPrefix ?? nt), 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(et(e));
575
+ const e = t.id ?? "", n = document.getElementById(Ie(e)), o = document.getElementById(et(e));
576
576
  document.querySelectorAll(
577
- fe(e)
577
+ ge(e)
578
578
  ).forEach((i) => {
579
579
  var l;
580
580
  for (; i.firstChild; )
581
581
  (l = i.parentNode) == null || l.insertBefore(i.firstChild, i);
582
582
  i.remove();
583
583
  }), n == null || n.remove(), o == null || o.remove();
584
- }, de = {
584
+ }, fe = {
585
585
  all: ["notebook"],
586
586
  notes: (t) => ["notebook", "notes", t]
587
587
  };
588
588
  function Vt(t) {
589
- const e = Re();
590
- return ke({
589
+ const e = we();
590
+ return Oe({
591
591
  mutationFn: (n) => t.createNote(n),
592
592
  onSuccess: () => {
593
- e.invalidateQueries({ queryKey: de.all });
593
+ e.invalidateQueries({ queryKey: fe.all });
594
594
  }
595
595
  });
596
596
  }
597
597
  function Zt(t) {
598
- const e = Re();
599
- return ke({
598
+ const e = we();
599
+ return Oe({
600
600
  mutationFn: (n) => t.deleteNote(n),
601
601
  onSuccess: () => {
602
- e.invalidateQueries({ queryKey: de.all });
602
+ e.invalidateQueries({ queryKey: fe.all });
603
603
  }
604
604
  });
605
605
  }
606
- function ot({
606
+ function rt({
607
607
  api: t,
608
608
  enabled: e = !0,
609
609
  ...n
610
610
  }) {
611
- return gt({
612
- queryKey: de.notes(n),
611
+ return ht({
612
+ queryKey: fe.notes(n),
613
613
  queryFn: () => t.getNotes(n),
614
614
  enabled: e
615
615
  });
616
616
  }
617
617
  const Jt = 100;
618
- function rt({
618
+ function st({
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 ot({
625
+ return rt({
626
626
  api: t,
627
627
  filter: {
628
628
  ...e ? { courseId: e } : {},
@@ -635,12 +635,12 @@ function rt({
635
635
  });
636
636
  }
637
637
  function en(t) {
638
- const e = Re();
639
- return ke({
638
+ const e = we();
639
+ return Oe({
640
640
  mutationFn: ({ id: n, input: o }) => t.updateNote(n, o),
641
641
  onMutate: async ({ id: n, input: o }) => {
642
- await e.cancelQueries({ queryKey: de.all });
643
- const i = e.getQueryCache().findAll({ queryKey: de.all }), l = /* @__PURE__ */ new Map();
642
+ await e.cancelQueries({ queryKey: fe.all });
643
+ const i = e.getQueryCache().findAll({ queryKey: fe.all }), l = /* @__PURE__ */ new Map();
644
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, {
@@ -658,11 +658,11 @@ function en(t) {
658
658
  e.setQueryData(i, l);
659
659
  },
660
660
  onSettled: () => {
661
- e.invalidateQueries({ queryKey: de.all });
661
+ e.invalidateQueries({ queryKey: fe.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", _e = {
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", Tn = "Error saving to Notebook.", Sn = "Error updating note", vn = "Note deletion failed", In = "Loading notes", Cn = "Failed to load notes", xn = "Start capturing your notes", kn = "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.", Rn = "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", Me = {
666
666
  notebook: tn,
667
667
  notes: nn,
668
668
  important: on,
@@ -682,14 +682,14 @@ const tn = "Notebook", nn = "Notes", on = "Important", rn = "Unclear", sn = "Bac
682
682
  savedToNotebook: Nn,
683
683
  noteUpdated: bn,
684
684
  noteDeleted: En,
685
- errorSavingNote: Sn,
686
- errorUpdatingNote: Tn,
685
+ errorSavingNote: Tn,
686
+ errorUpdatingNote: Sn,
687
687
  noteDeletionFailed: vn,
688
688
  loadingNotes: In,
689
689
  failedToLoadNotes: Cn,
690
690
  emptyStateHeading: xn,
691
- emptyStateDescription: Rn,
692
- nothingHereYet: kn,
691
+ emptyStateDescription: kn,
692
+ nothingHereYet: Rn,
693
693
  adjustFiltersOrCreate: wn,
694
694
  noNotesForFilter: On,
695
695
  filter: Ln,
@@ -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
- }, st = Ke(null);
705
- function it(t, e) {
706
- const n = _e[t] ?? t;
704
+ }, it = Ke(null);
705
+ function lt(t, e) {
706
+ const n = Me[t] ?? t;
707
707
  return e ? n.replace(/%\{([^}]+)}/g, (o, r) => String(e[r] ?? `%{${r}}`)) : n;
708
708
  }
709
709
  function Hn({
@@ -711,25 +711,25 @@ function Hn({
711
711
  translate: e,
712
712
  children: n
713
713
  }) {
714
- const o = me(
714
+ const o = he(
715
715
  () => ({
716
- translations: { ..._e, ...t },
717
- translate: e ?? it
716
+ translations: { ...Me, ...t },
717
+ translate: e ?? lt
718
718
  }),
719
719
  [t, e]
720
720
  );
721
- return /* @__PURE__ */ s(st.Provider, { value: o, children: n });
721
+ return /* @__PURE__ */ s(it.Provider, { value: o, children: n });
722
722
  }
723
- function J() {
724
- const t = Xe(st);
725
- return t || { translations: _e, translate: it };
723
+ function ee() {
724
+ const t = Xe(it);
725
+ return t || { translations: Me, translate: lt };
726
726
  }
727
- const Gn = (t) => ({
727
+ const Un = (t) => ({
728
728
  selectedNoteId: t ?? null,
729
729
  isNoteEditing: !1,
730
730
  isTrayOpen: t != null
731
731
  });
732
- function Un(t, e) {
732
+ function Gn(t, e) {
733
733
  switch (e.type) {
734
734
  case "SELECT_NOTE":
735
735
  return {
@@ -749,7 +749,7 @@ function Un(t, e) {
749
749
  return t;
750
750
  }
751
751
  }
752
- const lt = Ke(null);
752
+ const at = Ke(null);
753
753
  function Eo({
754
754
  api: t,
755
755
  currentUserId: e,
@@ -761,9 +761,9 @@ function Eo({
761
761
  initialNoteId: a,
762
762
  translations: m,
763
763
  translate: c,
764
- children: p
764
+ children: y
765
765
  }) {
766
- const [d, h] = Qe(Un, Gn(a)), b = B(a != null), y = me(
766
+ const [d, h] = Qe(Gn, Un(a)), b = $(a != null), p = he(
767
767
  () => ({
768
768
  api: t,
769
769
  currentUserId: e,
@@ -784,29 +784,29 @@ function Eo({
784
784
  }),
785
785
  [t, e, n, o, r, i, l, d]
786
786
  );
787
- return /* @__PURE__ */ s(lt.Provider, { value: y, children: /* @__PURE__ */ s(Hn, { translations: m, translate: c, children: p }) });
787
+ return /* @__PURE__ */ s(at.Provider, { value: p, children: /* @__PURE__ */ s(Hn, { translations: m, translate: c, children: y }) });
788
788
  }
789
- function at() {
790
- const t = Xe(lt);
789
+ function ct() {
790
+ const t = Xe(at);
791
791
  if (!t)
792
792
  throw new Error("useNotebook must be used within a NotebookProvider");
793
793
  return t;
794
794
  }
795
- const ct = "notebook-tray-content", So = ({ children: t }) => {
796
- const { isTrayOpen: e, closeTray: n } = at(), { translations: o } = J();
795
+ const dt = "notebook-tray-content", To = ({ children: t }) => {
796
+ const { isTrayOpen: e, closeTray: n } = ct(), { translations: o } = ee();
797
797
  return /* @__PURE__ */ s(
798
- pt,
798
+ yt,
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__ */ 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 }),
805
+ children: /* @__PURE__ */ S(k, { direction: "column", height: "100vh", id: dt, children: [
806
+ /* @__PURE__ */ s(k.Item, { children: /* @__PURE__ */ s(X, { as: "div", padding: "small medium", borderWidth: "0 0 small 0", children: /* @__PURE__ */ S(k, { justifyItems: "space-between", alignItems: "center", children: [
807
+ /* @__PURE__ */ s(Se, { level: "h3", children: o.notebook }),
808
808
  /* @__PURE__ */ s(
809
- ht,
809
+ pt,
810
810
  {
811
811
  screenReaderLabel: o.closeNotebookPanel,
812
812
  onClick: n,
@@ -815,16 +815,16 @@ const ct = "notebook-tray-content", So = ({ children: t }) => {
815
815
  }
816
816
  )
817
817
  ] }) }) }),
818
- /* @__PURE__ */ s(x.Item, { shouldGrow: !0, shouldShrink: !0, overflowY: "auto", overflowX: "hidden", children: t })
818
+ /* @__PURE__ */ s(k.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 } = 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();
823
+ const { translations: n } = ee(), o = $(null), r = $(null);
824
+ return z(() => {
825
+ t === R.CONFUSING && o.current ? o.current.focus() : t === R.IMPORTANT && r.current ? r.current.focus() : o.current && o.current.focus();
826
826
  }, [t]), /* @__PURE__ */ s(
827
- Q,
827
+ X,
828
828
  {
829
829
  as: "div",
830
830
  background: "primary",
@@ -832,25 +832,25 @@ const ct = "notebook-tray-content", So = ({ children: t }) => {
832
832
  borderColor: "secondary",
833
833
  borderRadius: "medium",
834
834
  shadow: "resting",
835
- children: /* @__PURE__ */ I(ce, { children: [
836
- /* @__PURE__ */ I(
837
- ce.Item,
835
+ children: /* @__PURE__ */ S(ue, { children: [
836
+ /* @__PURE__ */ S(
837
+ ue.Item,
838
838
  {
839
839
  ref: o,
840
- onClick: () => e(O.CONFUSING),
840
+ onClick: () => e(R.CONFUSING),
841
841
  children: [
842
- /* @__PURE__ */ s(we, { size: "x-small" }),
842
+ /* @__PURE__ */ s(Le, { size: "x-small" }),
843
843
  ` ${n.markUnclear}`
844
844
  ]
845
845
  }
846
846
  ),
847
- /* @__PURE__ */ I(
848
- ce.Item,
847
+ /* @__PURE__ */ S(
848
+ ue.Item,
849
849
  {
850
850
  ref: r,
851
- onClick: () => e(O.IMPORTANT),
851
+ onClick: () => e(R.IMPORTANT),
852
852
  children: [
853
- /* @__PURE__ */ s(Oe, { size: "x-small" }),
853
+ /* @__PURE__ */ s(Ae, { size: "x-small" }),
854
854
  ` ${n.markImportant}`
855
855
  ]
856
856
  }
@@ -858,8 +858,8 @@ const ct = "notebook-tray-content", So = ({ children: t }) => {
858
858
  ] })
859
859
  }
860
860
  );
861
- }, Te = "notebook-inline-reaction-menu";
862
- function To({
861
+ }, Ce = "notebook-inline-reaction-menu";
862
+ function So({
863
863
  containerRef: t,
864
864
  highlightTheme: e,
865
865
  debounceTime: n = 500,
@@ -872,195 +872,195 @@ function To({
872
872
  api: a,
873
873
  objectId: m,
874
874
  objectType: c,
875
- courseId: p,
875
+ courseId: y,
876
876
  pageLastModifiedAt: d,
877
877
  selectedNoteId: h,
878
878
  isTrayOpen: b,
879
- selectNote: y,
879
+ selectNote: p,
880
880
  openTray: E
881
- } = at(), { translations: g } = J(), { data: Y } = rt({
881
+ } = ct(), { translations: g } = ee(), { data: Q } = st({
882
882
  api: a,
883
- courseId: p,
883
+ courseId: y,
884
884
  learningObject: { type: c, id: m }
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(() => {
885
+ }), { mutate: W } = Vt(a), { mutateAsync: N } = en(a), { mutate: C } = Zt(a), D = $([]), [H, P] = j([]), [T, O] = j(null), [x, M] = j(""), [V, Z] = j(null), ce = $(null);
886
+ ce.current = V;
887
+ const [J, de] = j(!1);
888
+ z(() => {
889
889
  const w = t.current;
890
890
  if (!w) return;
891
- const T = w.closest(".user_content") ?? w;
892
- if (T.classList.contains("enhanced")) {
893
- re(!0);
891
+ const I = w.closest(".user_content") ?? w;
892
+ if (I.classList.contains("enhanced")) {
893
+ de(!0);
894
894
  return;
895
895
  }
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();
896
+ const F = new MutationObserver((A) => {
897
+ for (const G of A)
898
+ if (G.type === "attributes" && G.attributeName === "class" && G.target.classList.contains("enhanced")) {
899
+ de(!0), F.disconnect();
900
900
  return;
901
901
  }
902
902
  });
903
- return G.observe(T, { attributes: !0, attributeFilter: ["class"] }), () => G.disconnect();
903
+ return F.observe(I, { attributes: !0, attributeFilter: ["class"] }), () => F.disconnect();
904
904
  }, [t]);
905
- const z = K(() => {
906
- V(null), L(null), F("");
905
+ const Y = q(() => {
906
+ Z(null), O(null), M("");
907
907
  }, []);
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)));
908
+ z(() => {
909
+ if (!J || !t.current) return;
910
+ let I = null;
911
+ const F = () => {
912
+ I && clearTimeout(I), I = setTimeout(() => {
913
+ var ie;
914
+ const v = window.getSelection(), B = t.current;
915
+ if (!(v != null && v.rangeCount) || !B) return;
916
+ const ne = v.toString().trim();
917
+ if (ne === "") return;
918
+ const f = v.getRangeAt(0);
919
+ if (!B.contains(f.commonAncestorContainer)) return;
920
+ const L = (ie = le.fromRange(B, f)) == null ? void 0 : ie.toSelector();
921
+ L && !Ut(L, H) && (O(f.cloneRange()), M(ne), Z(Ht(f)));
922
922
  }, n);
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());
923
+ }, A = (v) => {
924
+ if (!(v.target instanceof Node)) return;
925
+ const B = document.getElementById(Ce);
926
+ B != null && B.contains(v.target) ? (v.preventDefault(), v.stopImmediatePropagation()) : Y();
927
+ }, G = () => {
928
+ Y();
929
+ }, _ = (v) => {
930
+ v.key === "Escape" && ce.current !== null && (Y(), v.stopImmediatePropagation());
931
931
  };
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);
932
+ return document.addEventListener("selectionchange", F), document.addEventListener("mousedown", A), document.addEventListener("touchstart", A), document.addEventListener("keydown", _), window.addEventListener("scroll", G, !0), () => {
933
+ I && clearTimeout(I), document.removeEventListener("selectionchange", F), document.removeEventListener("mousedown", A), document.removeEventListener("touchstart", A), document.removeEventListener("keydown", _), window.removeEventListener("scroll", G, !0);
934
934
  };
935
- }, [ee, $, n, t, z]);
936
- const se = K(
935
+ }, [J, H, n, t, Y]);
936
+ const te = q(
937
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,
938
+ var B;
939
+ const I = t.current;
940
+ if (!I || !w.highlightData) return null;
941
+ const { highlightData: F, reaction: A, id: G } = w, { range: _ } = F, v = _ && ((B = ae.fromSelector(I, _)) == null ? void 0 : B.toRange());
942
+ if (v) {
943
+ const ne = A[0] === R.IMPORTANT ? g.important : g.unclear, f = {
944
+ id: G,
945
945
  selectedNoteId: h,
946
- type: M[0],
946
+ type: A[0],
947
947
  isTrayOpen: b,
948
- labelPrefix: `${g.notebookNote} (${k})`,
949
- popupId: ct,
948
+ labelPrefix: `${g.notebookNote} (${ne})`,
949
+ popupId: dt,
950
950
  onClick: () => {
951
- y(A), E();
951
+ p(G), E();
952
952
  }
953
953
  };
954
- return Xt(R, q, e), G.textPosition;
954
+ return Xt(v, f, e), F.textPosition;
955
955
  }
956
956
  return null;
957
957
  },
958
- [t, h, b, e, g, y, E]
958
+ [t, h, b, e, g, p, E]
959
959
  );
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
- if (P.current.length > 0) {
965
- for (const D of P.current)
966
- je(D, w);
967
- P.current = [], _([]);
960
+ z(() => {
961
+ if (!J || !Q || !t.current) return;
962
+ const w = t.current, I = Q.notes, F = /* @__PURE__ */ new Set(), A = [], G = [];
963
+ if (I.length === 0) {
964
+ if (D.current.length > 0) {
965
+ for (const _ of D.current)
966
+ je(_, w);
967
+ D.current = [], P([]);
968
968
  }
969
969
  return;
970
970
  }
971
- if (d && T[0].highlightData.pageLastModifiedAt !== d) {
972
- const { notesForUpdate: D, noteIdsForDelete: R } = Mt(
971
+ if (d && I[0].highlightData.pageLastModifiedAt !== d) {
972
+ const { notesForUpdate: _, noteIdsForDelete: v } = Bt(
973
973
  w,
974
- T,
974
+ I,
975
975
  d
976
976
  );
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 });
977
+ for (const B of _)
978
+ N({ id: B.id, input: B }).catch((ne) => r == null ? void 0 : r(ne));
979
+ for (const B of v)
980
+ C(B, { onError: i });
981
981
  } else {
982
- for (const D of T) {
983
- const R = se(D);
984
- G.add(D.id), R && (M.push(D), A.push(R));
982
+ for (const _ of I) {
983
+ const v = te(_);
984
+ F.add(_.id), v && (A.push(_), G.push(v));
985
985
  }
986
- for (const D of P.current)
987
- G.has(D.id) || je(D, w);
988
- _(A), P.current = M, h && Bt(h);
986
+ for (const _ of D.current)
987
+ F.has(_.id) || je(_, w);
988
+ P(G), D.current = A, h && $t(h);
989
989
  }
990
990
  }, [
991
- ee,
992
- Y,
993
- se,
991
+ J,
992
+ Q,
993
+ te,
994
994
  d,
995
995
  t,
996
996
  N,
997
997
  C,
998
998
  h
999
999
  ]);
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(
1000
+ const U = (w) => {
1001
+ const I = t.current;
1002
+ if (!T || !I) return;
1003
+ const F = ae.fromRange(I, T), A = le.fromRange(I, T);
1004
+ W(
1005
1005
  {
1006
- courseId: p,
1006
+ courseId: y,
1007
1007
  objectId: m,
1008
1008
  objectType: c,
1009
1009
  userText: "",
1010
1010
  reaction: [w],
1011
1011
  highlightData: {
1012
- selectedText: v,
1013
- textPosition: (M == null ? void 0 : M.toSelector()) ?? null,
1014
- range: G.toSelector(),
1012
+ selectedText: x,
1013
+ textPosition: (A == null ? void 0 : A.toSelector()) ?? null,
1014
+ range: F.toSelector(),
1015
1015
  pageLastModifiedAt: d ?? ""
1016
1016
  }
1017
1017
  },
1018
1018
  {
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);
1019
+ onSuccess: (G) => {
1020
+ var v;
1021
+ const _ = G.id;
1022
+ Y(), (v = window.getSelection()) == null || v.removeAllRanges(), p(_), E(), l == null || l(G);
1023
1023
  },
1024
1024
  onError: o
1025
1025
  }
1026
1026
  );
1027
1027
  };
1028
- return !S || !Z ? null : ft(
1028
+ return !T || !V ? null : mt(
1029
1029
  /* @__PURE__ */ s(
1030
1030
  "div",
1031
1031
  {
1032
- id: Te,
1032
+ id: Ce,
1033
1033
  role: "toolbar",
1034
1034
  style: {
1035
1035
  position: "fixed",
1036
1036
  zIndex: 100,
1037
- top: Z.top,
1038
- left: Z.left,
1037
+ top: V.top,
1038
+ left: V.left,
1039
1039
  whiteSpace: "nowrap"
1040
1040
  },
1041
1041
  onBlur: (w) => {
1042
- const T = document.getElementById(Te);
1043
- T != null && T.contains(w.relatedTarget) || z();
1042
+ const I = document.getElementById(Ce);
1043
+ I != null && I.contains(w.relatedTarget) || Y();
1044
1044
  },
1045
- children: /* @__PURE__ */ s(jn, { onSelectReaction: H })
1045
+ children: /* @__PURE__ */ s(jn, { onSelectReaction: U })
1046
1046
  }
1047
1047
  ),
1048
1048
  document.body
1049
1049
  );
1050
1050
  }
1051
1051
  const Wn = (t, e) => ({
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 = ({
1052
+ backgroundColor: t === R.IMPORTANT ? e.colors.importantBackground : e.colors.confusingBackground,
1053
+ underlineColor: t === R.IMPORTANT ? e.colors.importantUnderline : e.colors.confusingUnderline,
1054
+ underlineStyle: t === R.IMPORTANT ? "solid" : "dashed"
1055
+ }), Re = ({
1056
1056
  children: t,
1057
- type: e = O.IMPORTANT,
1057
+ type: e = R.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 : Pe(r.backgroundColor, 0.5),
1063
+ backgroundColor: n ? r.backgroundColor : Fe(r.backgroundColor, 0.5),
1064
1064
  textDecorationLine: "underline",
1065
1065
  textDecorationStyle: r.underlineStyle,
1066
1066
  textDecorationColor: r.underlineColor,
@@ -1069,11 +1069,11 @@ const Wn = (t, e) => ({
1069
1069
  lineHeight: "normal"
1070
1070
  };
1071
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 }) })
1072
+ }, ut = () => {
1073
+ const { translations: t } = ee();
1074
+ return /* @__PURE__ */ S(k, { gap: "xx-small", alignItems: "start", as: "div", children: [
1075
+ /* @__PURE__ */ s(k.Item, { as: "div", children: /* @__PURE__ */ s(Nt, { color: "error" }) }),
1076
+ /* @__PURE__ */ s(k.Item, { padding: "xxx-small none", shouldShrink: !0, children: /* @__PURE__ */ s(Ee, { maxLines: 3, children: t.highlightUnavailable }) })
1077
1077
  ] });
1078
1078
  }, zn = {
1079
1079
  filter: null,
@@ -1081,7 +1081,7 @@ const Wn = (t, e) => ({
1081
1081
  currentPage: 1,
1082
1082
  totalPages: void 0
1083
1083
  };
1084
- function pe(t, e) {
1084
+ function be(t, e) {
1085
1085
  const n = typeof e == "number" ? Math.min(e, t) : t;
1086
1086
  return Math.max(1, n);
1087
1087
  }
@@ -1092,18 +1092,18 @@ function qn(t, e) {
1092
1092
  case "SET_COURSE_FILTER":
1093
1093
  return { ...t, courseFilter: e.payload, currentPage: 1 };
1094
1094
  case "SET_PAGE":
1095
- return { ...t, currentPage: pe(e.payload, t.totalPages) };
1095
+ return { ...t, currentPage: be(e.payload, t.totalPages) };
1096
1096
  case "FOCUS_PAGE":
1097
1097
  return { ...t, currentPage: Math.max(1, e.payload) };
1098
1098
  case "INCREMENT_PAGE":
1099
- return { ...t, currentPage: pe(t.currentPage + 1, t.totalPages) };
1099
+ return { ...t, currentPage: be(t.currentPage + 1, t.totalPages) };
1100
1100
  case "DECREMENT_PAGE":
1101
- return { ...t, currentPage: pe(t.currentPage - 1, t.totalPages) };
1101
+ return { ...t, currentPage: be(t.currentPage - 1, t.totalPages) };
1102
1102
  case "SET_TOTAL_PAGES":
1103
1103
  return t.totalPages === e.payload ? t : {
1104
1104
  ...t,
1105
1105
  totalPages: e.payload,
1106
- currentPage: pe(t.currentPage, e.payload)
1106
+ currentPage: be(t.currentPage, e.payload)
1107
1107
  };
1108
1108
  default:
1109
1109
  return t;
@@ -1117,109 +1117,109 @@ function vo({
1117
1117
  pageSize: r = 16,
1118
1118
  focusNoteId: i
1119
1119
  }) {
1120
- var se;
1121
- const [l, a] = Qe(qn, zn), { filter: m, courseFilter: c, currentPage: p, totalPages: d } = l;
1122
- W(() => {
1120
+ var te;
1121
+ const [l, a] = Qe(qn, zn), { filter: m, courseFilter: c, currentPage: y, totalPages: d } = l;
1122
+ z(() => {
1123
1123
  a({ type: "SET_PAGE", payload: 1 });
1124
1124
  }, [r]);
1125
- const h = n ? c : e, b = (p - 1) * r, y = !!o, E = {
1125
+ const h = n ? c : e, b = (y - 1) * r, p = !!o, E = {
1126
1126
  ...h ? { courseId: h } : {},
1127
1127
  ...m ? { reactions: [m] } : {},
1128
1128
  ...o ? { learningObject: o } : {}
1129
1129
  }, {
1130
1130
  data: g,
1131
- isLoading: Y,
1132
- isError: j
1133
- } = ot({
1131
+ isLoading: Q,
1132
+ isError: W
1133
+ } = rt({
1134
1134
  api: t,
1135
1135
  filter: E,
1136
1136
  offset: b,
1137
1137
  pageSize: r,
1138
- enabled: !y
1138
+ enabled: !p
1139
1139
  }), {
1140
1140
  data: N,
1141
1141
  isLoading: C,
1142
- isError: P
1143
- } = rt({
1142
+ isError: D
1143
+ } = st({
1144
1144
  api: t,
1145
1145
  courseId: h ?? void 0,
1146
1146
  learningObject: o,
1147
- enabled: y
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(() => {
1147
+ enabled: p
1148
+ }), H = he(() => {
1149
+ const U = (N == null ? void 0 : N.notes) ?? [];
1150
+ return m ? U.filter((w) => w.reaction.includes(m)) : U;
1151
+ }, [N, m]), P = $(null);
1152
+ z(() => {
1153
1153
  if (!i) {
1154
- _.current = null;
1154
+ P.current = null;
1155
1155
  return;
1156
1156
  }
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(() => {
1157
+ if (P.current === i) return;
1158
+ const U = H.findIndex((I) => I.id === i);
1159
+ if (U === -1) return;
1160
+ P.current = i;
1161
+ const w = Math.floor(U / r) + 1;
1162
+ w !== y && a({ type: "FOCUS_PAGE", payload: w });
1163
+ }, [i, H, r, y]);
1164
+ const T = p ? H.slice(b, b + r) : (g == null ? void 0 : g.notes) ?? [], O = p ? C : Q, x = p ? D : W, M = p ? Math.max(1, Math.ceil(H.length / r)) : ((te = g == null ? void 0 : g.pageInfo) == null ? void 0 : te.totalNrOfPages) ?? void 0, V = p ? { totalCount: H.length, totalNrOfPages: M } : g == null ? void 0 : g.pageInfo;
1165
+ z(() => {
1166
+ a({ type: "SET_TOTAL_PAGES", payload: M });
1167
+ }, [M]);
1168
+ const Z = q((U) => {
1169
+ a({ type: "SET_PAGE", payload: U });
1170
+ }, []), ce = q(() => {
1171
1171
  a({
1172
1172
  type: "INCREMENT_PAGE"
1173
1173
  /* IncrementPage */
1174
1174
  });
1175
- }, []), ee = K(() => {
1175
+ }, []), J = q(() => {
1176
1176
  a({
1177
1177
  type: "DECREMENT_PAGE"
1178
1178
  /* DecrementPage */
1179
1179
  });
1180
- }, []), re = K((H) => {
1181
- a({ type: "SET_FILTER", payload: H });
1182
- }, []), z = K((H) => {
1183
- a({ type: "SET_COURSE_FILTER", payload: H });
1180
+ }, []), de = q((U) => {
1181
+ a({ type: "SET_FILTER", payload: U });
1182
+ }, []), Y = q((U) => {
1183
+ a({ type: "SET_COURSE_FILTER", payload: U });
1184
1184
  }, []);
1185
1185
  return {
1186
- notes: S,
1187
- pageInfo: Z,
1188
- isLoading: L,
1189
- isError: v,
1186
+ notes: T,
1187
+ pageInfo: V,
1188
+ isLoading: O,
1189
+ isError: x,
1190
1190
  filter: m,
1191
1191
  courseFilter: c,
1192
- currentPage: p,
1192
+ currentPage: y,
1193
1193
  totalPages: d,
1194
- setFilter: re,
1195
- setCourseFilter: z,
1196
- setPage: V,
1197
- fetchNextPage: ae,
1198
- fetchPreviousPage: ee
1194
+ setFilter: de,
1195
+ setCourseFilter: Y,
1196
+ setPage: Z,
1197
+ fetchNextPage: ce,
1198
+ fetchPreviousPage: J
1199
1199
  };
1200
1200
  }
1201
- const ve = "all";
1201
+ const xe = "all";
1202
1202
  function Io({ filter: t, setFilter: e }) {
1203
- const { translations: n } = J(), o = me(
1203
+ const { translations: n } = ee(), o = he(
1204
1204
  () => [
1205
- { label: n.allNotes, value: ve },
1206
- { label: n.important, value: O.IMPORTANT },
1207
- { label: n.unclear, value: O.CONFUSING }
1205
+ { label: n.allNotes, value: xe },
1206
+ { label: n.important, value: R.IMPORTANT },
1207
+ { label: n.unclear, value: R.CONFUSING }
1208
1208
  ],
1209
1209
  [n]
1210
- ), r = K(
1210
+ ), r = q(
1211
1211
  (l, { value: a }) => {
1212
- e(!a || a === ve ? null : a);
1212
+ e(!a || a === xe ? null : a);
1213
1213
  },
1214
1214
  [e]
1215
1215
  );
1216
1216
  return {
1217
- filterElement: me(
1217
+ filterElement: he(
1218
1218
  () => /* @__PURE__ */ s(
1219
1219
  Be,
1220
1220
  {
1221
1221
  renderLabel: n.filter,
1222
- value: t ?? ve,
1222
+ value: t ?? xe,
1223
1223
  onChange: r,
1224
1224
  children: o.map((l) => /* @__PURE__ */ s(Be.Option, { id: l.value, value: l.value, children: l.label }, l.value))
1225
1225
  }
@@ -1231,43 +1231,43 @@ function Io({ filter: t, setFilter: e }) {
1231
1231
  };
1232
1232
  }
1233
1233
  const Kn = ({ hasActiveFilter: t = !1 }) => {
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 })
1234
+ const { translations: e } = ee(), n = t ? e.nothingHereYet : e.emptyStateHeading, o = t ? e.adjustFiltersOrCreate : e.emptyStateDescription;
1235
+ return /* @__PURE__ */ s(X, { as: "div", textAlign: "center", children: /* @__PURE__ */ S(k, { direction: "column", alignItems: "center", gap: "small", children: [
1236
+ !t && /* @__PURE__ */ s(bt, { size: "medium" }),
1237
+ /* @__PURE__ */ s(Se, { level: "h3", children: n }),
1238
+ /* @__PURE__ */ s(oe, { color: "secondary", children: o })
1239
1239
  ] }) });
1240
1240
  }, Xn = {
1241
- [O.IMPORTANT]: {
1241
+ [R.IMPORTANT]: {
1242
1242
  color: "success",
1243
1243
  translationKey: "important",
1244
- icon: /* @__PURE__ */ s(Oe, { size: "x-small" })
1244
+ icon: /* @__PURE__ */ s(Ae, { size: "x-small" })
1245
1245
  },
1246
- [O.CONFUSING]: {
1246
+ [R.CONFUSING]: {
1247
1247
  color: "danger",
1248
1248
  translationKey: "unclear",
1249
- icon: /* @__PURE__ */ s(we, { size: "x-small" })
1249
+ icon: /* @__PURE__ */ s(Le, { size: "x-small" })
1250
1250
  }
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(
1251
+ }, ft = ({ type: t, onTypeChange: e, renderAsMenuTrigger: n = !1 }) => {
1252
+ const { translations: o } = ee(), r = Xn[t], i = o[r.translationKey], [l, a] = j(!1), m = $(null), c = $(null), y = $(null), d = q(
1253
1253
  (h) => {
1254
1254
  e == null || e(h), a(!1);
1255
1255
  },
1256
1256
  [e]
1257
1257
  );
1258
- return W(() => {
1258
+ return z(() => {
1259
1259
  if (!l) return;
1260
- const h = (y) => {
1261
- y.key === "Escape" && y.stopPropagation();
1262
- }, b = (y) => {
1260
+ const h = (p) => {
1261
+ p.key === "Escape" && p.stopPropagation();
1262
+ }, b = (p) => {
1263
1263
  var E;
1264
- y.key === "Escape" && (y.stopPropagation(), a(!1), (E = p.current) == null || E.focus());
1264
+ p.key === "Escape" && (p.stopPropagation(), a(!1), (E = y.current) == null || E.focus());
1265
1265
  };
1266
1266
  return document.addEventListener("keydown", h, !0), document.addEventListener("keyup", b, !0), () => {
1267
1267
  document.removeEventListener("keydown", h, !0), document.removeEventListener("keyup", b, !0);
1268
1268
  };
1269
- }, [l]), n && e ? /* @__PURE__ */ I(
1270
- ce,
1269
+ }, [l]), n && e ? /* @__PURE__ */ S(
1270
+ ue,
1271
1271
  {
1272
1272
  placement: "bottom start",
1273
1273
  show: l,
@@ -1280,23 +1280,23 @@ const Kn = ({ hasActiveFilter: t = !1 }) => {
1280
1280
  color: r.color,
1281
1281
  renderIcon: r.icon,
1282
1282
  elementRef: (h) => {
1283
- p.current = h;
1283
+ y.current = h;
1284
1284
  },
1285
1285
  children: i
1286
1286
  }
1287
1287
  ),
1288
1288
  children: [
1289
- /* @__PURE__ */ I(ce.Item, { ref: m, onClick: () => d(O.CONFUSING), children: [
1290
- /* @__PURE__ */ s(we, { size: "x-small" }),
1289
+ /* @__PURE__ */ S(ue.Item, { ref: m, onClick: () => d(R.CONFUSING), children: [
1290
+ /* @__PURE__ */ s(Le, { size: "x-small" }),
1291
1291
  ` ${o.markUnclear}`
1292
1292
  ] }),
1293
- /* @__PURE__ */ I(ce.Item, { ref: c, onClick: () => d(O.IMPORTANT), children: [
1294
- /* @__PURE__ */ s(Oe, { size: "x-small" }),
1293
+ /* @__PURE__ */ S(ue.Item, { ref: c, onClick: () => d(R.IMPORTANT), children: [
1294
+ /* @__PURE__ */ s(Ae, { size: "x-small" }),
1295
1295
  ` ${o.markImportant}`
1296
1296
  ] })
1297
1297
  ]
1298
1298
  }
1299
- ) : /* @__PURE__ */ s(Q, { display: "inline-flex", children: /* @__PURE__ */ s($e, { color: r.color, renderIcon: r.icon, children: i }) });
1299
+ ) : /* @__PURE__ */ s(X, { display: "inline-flex", children: /* @__PURE__ */ s($e, { color: r.color, renderIcon: r.icon, children: i }) });
1300
1300
  }, We = "0.75rem";
1301
1301
  function ze(t, e) {
1302
1302
  return (t instanceof Date ? t : new Date(t)).toLocaleString(e, {
@@ -1316,49 +1316,49 @@ const Qn = ({
1316
1316
  onSaveNote: a,
1317
1317
  onTypeChange: m,
1318
1318
  isActive: c,
1319
- isPanelView: p = !1,
1319
+ isPanelView: y = !1,
1320
1320
  courseName: d,
1321
1321
  locale: h,
1322
1322
  highlightTheme: b,
1323
- renderLink: y,
1323
+ renderLink: p,
1324
1324
  href: E
1325
1325
  }) => {
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
- u != null && u.isConnected && u.focus();
1326
+ const { translations: g } = ee(), [Q, W] = j(!1), [N, C] = j(!1), [D, H] = j(o || ""), [P, T] = j(!1), [O, x] = j(!1), [M, V] = j(!1), [Z, ce] = j(!1), J = $(null), de = q((f) => {
1327
+ J.current = f;
1328
+ }, []), Y = $(null), te = $(null), U = $(!1), w = $(null), I = $(null), F = $(!1);
1329
+ z(() => {
1330
+ var f, L;
1331
+ c ? ((f = J.current) == null || f.scrollIntoView({ behavior: "smooth", block: "nearest" }), (L = J.current) == null || L.focus()) : T(!1);
1332
+ }, [c]), z(() => {
1333
+ var f, L;
1334
+ N ? (U.current = !0, (f = Y.current) == null || f.focus()) : U.current && (U.current = !1, (L = te.current) == null || L.focus());
1335
+ }, [N]), z(() => {
1336
+ if (!P && F.current) {
1337
+ F.current = !1;
1338
+ const f = w.current;
1339
+ f != null && f.isConnected && f.focus();
1340
1340
  }
1341
- }, [_]);
1342
- const T = K((u, k) => {
1343
- w.current = !k, S(!1);
1341
+ }, [P]);
1342
+ const A = q((f, L) => {
1343
+ F.current = !L, T(!1);
1344
1344
  }, []);
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());
1345
+ z(() => {
1346
+ if (!P) return;
1347
+ const f = (ie) => {
1348
+ ie.key === "Escape" && ie.stopPropagation();
1349
+ }, L = (ie) => {
1350
+ ie.key === "Escape" && (ie.stopPropagation(), A());
1351
1351
  };
1352
- return window.addEventListener("keydown", u, !0), window.addEventListener("keyup", k, !0), () => {
1353
- window.removeEventListener("keydown", u, !0), window.removeEventListener("keyup", k, !0);
1352
+ return window.addEventListener("keydown", f, !0), window.addEventListener("keyup", L, !0), () => {
1353
+ window.removeEventListener("keydown", f, !0), window.removeEventListener("keyup", L, !0);
1354
1354
  };
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
- Q,
1355
+ }, [P, A]);
1356
+ const G = r === R.IMPORTANT ? g.important : g.unclear, _ = (f) => {
1357
+ f.key === "Enter" && (f.preventDefault(), i == null || i());
1358
+ }, v = [g.note, G];
1359
+ v.push(n || g.highlightUnavailable), o && v.push(o), e && v.push(ze(e, h)), d && v.push(d);
1360
+ const B = v.join(", "), ne = /* @__PURE__ */ S(
1361
+ X,
1362
1362
  {
1363
1363
  as: "div",
1364
1364
  height: "100%",
@@ -1367,15 +1367,15 @@ const Qn = ({
1367
1367
  padding: "small",
1368
1368
  position: "relative",
1369
1369
  role: E ? void 0 : c || N ? "group" : "button",
1370
- "aria-label": E ? void 0 : D,
1370
+ "aria-label": E ? void 0 : B,
1371
1371
  "aria-pressed": E || c || N ? void 0 : c,
1372
1372
  tabIndex: E || c ? -1 : 0,
1373
1373
  "data-testid": `note-card-${t}`,
1374
- elementRef: ae,
1374
+ elementRef: de,
1375
1375
  onClick: c ? void 0 : i,
1376
- onMouseEnter: () => j(!0),
1377
- onMouseLeave: () => j(!1),
1378
- onKeyDown: c ? void 0 : M,
1376
+ onMouseEnter: () => W(!0),
1377
+ onMouseLeave: () => W(!1),
1378
+ onKeyDown: c ? void 0 : _,
1379
1379
  cursor: N ? "default" : "pointer",
1380
1380
  children: [
1381
1381
  /* @__PURE__ */ s(
@@ -1384,83 +1384,83 @@ const Qn = ({
1384
1384
  "data-testid": `note-card-${t}-content`,
1385
1385
  style: {
1386
1386
  height: "100%",
1387
- opacity: c && _ && l ? 0.25 : void 0
1387
+ opacity: c && P && l ? 0.25 : void 0
1388
1388
  },
1389
- children: /* @__PURE__ */ I(x, { direction: "column", gap: "small", height: "100%", children: [
1389
+ children: /* @__PURE__ */ S(k, { direction: "column", gap: "small", height: "100%", children: [
1390
1390
  /* @__PURE__ */ s(
1391
- ut,
1391
+ ft,
1392
1392
  {
1393
1393
  type: r,
1394
- onTypeChange: p && m ? (u) => m(t, u) : void 0,
1395
- renderAsMenuTrigger: p && !!m && !!c
1394
+ onTypeChange: y && m ? (f) => m(t, f) : void 0,
1395
+ renderAsMenuTrigger: y && !!m && !!c
1396
1396
  }
1397
1397
  ),
1398
- n ? /* @__PURE__ */ s("div", { style: { wordBreak: "break-word", overflowWrap: "break-word" }, children: /* @__PURE__ */ s(te, { children: c && p ? /* @__PURE__ */ s(
1399
- xe,
1398
+ n ? /* @__PURE__ */ s("div", { style: { wordBreak: "break-word", overflowWrap: "break-word" }, children: /* @__PURE__ */ s(oe, { children: c && y ? /* @__PURE__ */ s(
1399
+ Re,
1400
1400
  {
1401
1401
  type: r,
1402
- isCardActive: !!c || Y,
1402
+ isCardActive: !!c || Q,
1403
1403
  theme: b,
1404
1404
  children: n
1405
1405
  }
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,
1406
+ ) : /* @__PURE__ */ S(qe, { children: [
1407
+ O && /* @__PURE__ */ s(pe, { children: n }),
1408
+ /* @__PURE__ */ s("span", { "aria-hidden": O, style: { display: "block" }, children: /* @__PURE__ */ s(Ee, { maxLines: 3, truncate: "word", onUpdate: x, children: /* @__PURE__ */ s(
1409
+ Re,
1410
1410
  {
1411
1411
  type: r,
1412
- isCardActive: !!c || Y,
1412
+ isCardActive: !!c || Q,
1413
1413
  theme: b,
1414
1414
  children: n
1415
1415
  }
1416
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: [
1417
+ ] }) }) }) : /* @__PURE__ */ s(ut, {}),
1418
+ /* @__PURE__ */ s(k.Item, { shouldGrow: !0, children: /* @__PURE__ */ S(k, { direction: "column", gap: "small", height: "100%", children: [
1419
+ N && y ? /* @__PURE__ */ S(k, { direction: "column", gap: "x-small", margin: "xx-small", children: [
1420
1420
  /* @__PURE__ */ s(
1421
1421
  Ye,
1422
1422
  {
1423
- label: /* @__PURE__ */ s(Se, { children: g.editNote }),
1424
- value: P,
1425
- onChange: (u) => $(u.target.value),
1423
+ label: /* @__PURE__ */ s(pe, { children: g.editNote }),
1424
+ value: D,
1425
+ onChange: (f) => H(f.target.value),
1426
1426
  placeholder: g.addNoteOptional,
1427
- textareaRef: (u) => {
1428
- ee.current = u;
1427
+ textareaRef: (f) => {
1428
+ Y.current = f;
1429
1429
  }
1430
1430
  }
1431
1431
  ),
1432
- /* @__PURE__ */ I(x, { gap: "xx-small", children: [
1433
- /* @__PURE__ */ s(x.Item, { shouldGrow: !0, children: /* @__PURE__ */ s(
1434
- ne,
1432
+ /* @__PURE__ */ S(k, { gap: "xx-small", children: [
1433
+ /* @__PURE__ */ s(k.Item, { shouldGrow: !0, children: /* @__PURE__ */ s(
1434
+ re,
1435
1435
  {
1436
1436
  display: "block",
1437
1437
  size: "small",
1438
1438
  "data-testid": `note-card-${t}-cancel`,
1439
1439
  onClick: () => {
1440
- $(o || ""), C(!1);
1440
+ H(o || ""), C(!1);
1441
1441
  },
1442
1442
  children: g.cancel
1443
1443
  }
1444
1444
  ) }),
1445
- /* @__PURE__ */ s(x.Item, { shouldGrow: !0, children: /* @__PURE__ */ s(
1446
- ne,
1445
+ /* @__PURE__ */ s(k.Item, { shouldGrow: !0, children: /* @__PURE__ */ s(
1446
+ re,
1447
1447
  {
1448
1448
  display: "block",
1449
1449
  color: "primary",
1450
1450
  size: "small",
1451
1451
  "data-testid": `note-card-${t}-save`,
1452
1452
  onClick: () => {
1453
- a == null || a(t, P.trim()), C(!1);
1453
+ a == null || a(t, D.trim()), C(!1);
1454
1454
  },
1455
1455
  children: g.save
1456
1456
  }
1457
1457
  ) })
1458
1458
  ] })
1459
- ] }) : o ? /* @__PURE__ */ s("div", { style: { wordBreak: "break-word", overflowWrap: "break-word" }, children: c && p ? /* @__PURE__ */ I(te, { children: [
1459
+ ] }) : o ? /* @__PURE__ */ s("div", { style: { wordBreak: "break-word", overflowWrap: "break-word" }, children: c && y ? /* @__PURE__ */ S(oe, { children: [
1460
1460
  o,
1461
1461
  " ",
1462
1462
  /* @__PURE__ */ s(
1463
- ue,
1463
+ me,
1464
1464
  {
1465
1465
  size: "small",
1466
1466
  withBackground: !1,
@@ -1468,23 +1468,23 @@ const Qn = ({
1468
1468
  margin: "xx-small 0 0 xxx-small",
1469
1469
  screenReaderLabel: g.editNote,
1470
1470
  "data-testid": `note-card-${t}-edit`,
1471
- elementRef: (u) => {
1472
- re.current = u;
1471
+ elementRef: (f) => {
1472
+ te.current = f;
1473
1473
  },
1474
- onClick: (u) => {
1475
- u.stopPropagation(), C(!0);
1474
+ onClick: (f) => {
1475
+ f.stopPropagation(), C(!0);
1476
1476
  },
1477
- children: /* @__PURE__ */ s(Ie, {})
1477
+ children: /* @__PURE__ */ s(ke, {})
1478
1478
  }
1479
1479
  )
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: [
1480
+ ] }) : /* @__PURE__ */ S(oe, { children: [
1481
+ M && /* @__PURE__ */ s(pe, { children: o }),
1482
+ /* @__PURE__ */ s("span", { "aria-hidden": M, style: { display: "block" }, children: /* @__PURE__ */ s(Ee, { maxLines: 3, truncate: "word", onUpdate: V, children: o }) })
1483
+ ] }) }) : y && c ? /* @__PURE__ */ s("div", { children: /* @__PURE__ */ S(oe, { color: "secondary", children: [
1484
1484
  g.addNotePrompt,
1485
1485
  " ",
1486
1486
  /* @__PURE__ */ s(
1487
- ue,
1487
+ me,
1488
1488
  {
1489
1489
  size: "small",
1490
1490
  withBackground: !1,
@@ -1492,20 +1492,20 @@ const Qn = ({
1492
1492
  margin: "xx-small 0 0 xxx-small",
1493
1493
  screenReaderLabel: g.editNote,
1494
1494
  "data-testid": `note-card-${t}-edit`,
1495
- elementRef: (u) => {
1496
- re.current = u;
1495
+ elementRef: (f) => {
1496
+ te.current = f;
1497
1497
  },
1498
- onClick: (u) => {
1499
- u.stopPropagation(), C(!0);
1498
+ onClick: (f) => {
1499
+ f.stopPropagation(), C(!0);
1500
1500
  },
1501
- children: /* @__PURE__ */ s(Ie, {})
1501
+ children: /* @__PURE__ */ s(ke, {})
1502
1502
  }
1503
1503
  )
1504
1504
  ] }) }) : null,
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) }),
1505
+ /* @__PURE__ */ S(k, { justifyItems: "space-between", alignItems: "center", margin: "auto 0 0 0", children: [
1506
+ /* @__PURE__ */ s(oe, { as: "div", size: "small", color: "secondary", children: ze(e, h) }),
1507
1507
  c && l && /* @__PURE__ */ s(
1508
- ue,
1508
+ me,
1509
1509
  {
1510
1510
  size: "small",
1511
1511
  withBackground: !1,
@@ -1514,45 +1514,48 @@ const Qn = ({
1514
1514
  margin: "xx-small",
1515
1515
  screenReaderLabel: g.deleteNote,
1516
1516
  "data-testid": `note-card-${t}-delete`,
1517
- elementRef: (u) => {
1518
- se.current = u;
1517
+ elementRef: (f) => {
1518
+ w.current = f;
1519
1519
  },
1520
- onClick: (u) => {
1521
- u.stopPropagation(), w.current = !1, S(!0);
1520
+ onClick: (f) => {
1521
+ f.stopPropagation(), F.current = !1, T(!0);
1522
1522
  },
1523
- children: /* @__PURE__ */ s(ye, {})
1523
+ children: /* @__PURE__ */ s(Te, {})
1524
1524
  }
1525
1525
  )
1526
1526
  ] }),
1527
- d && /* @__PURE__ */ s(
1528
- te,
1527
+ d && /* @__PURE__ */ S(
1528
+ oe,
1529
1529
  {
1530
1530
  as: "div",
1531
1531
  size: "small",
1532
1532
  color: "secondary",
1533
1533
  "data-testid": `note-card-${t}-course`,
1534
- children: d
1534
+ children: [
1535
+ Z && /* @__PURE__ */ s(pe, { children: d }),
1536
+ /* @__PURE__ */ s("span", { "aria-hidden": Z, style: { display: "block" }, children: /* @__PURE__ */ s(Ee, { maxLines: 1, onUpdate: ce, children: d }) })
1537
+ ]
1535
1538
  }
1536
1539
  )
1537
1540
  ] }) })
1538
1541
  ] })
1539
1542
  }
1540
1543
  ),
1541
- c && _ && l && /* @__PURE__ */ s(
1542
- Et,
1544
+ c && P && l && /* @__PURE__ */ s(
1545
+ Tt,
1543
1546
  {
1544
1547
  open: !0,
1545
1548
  as: "div",
1546
1549
  label: g.deleteNoteConfirmation,
1547
1550
  shouldContainFocus: !0,
1548
1551
  shouldFocusOnOpen: !0,
1549
- defaultFocusElement: () => H.current,
1552
+ defaultFocusElement: () => I.current,
1550
1553
  shouldCloseOnDocumentClick: !0,
1551
1554
  shouldCloseOnEscape: !1,
1552
1555
  shouldReturnFocus: !1,
1553
- onDismiss: T,
1556
+ onDismiss: A,
1554
1557
  children: /* @__PURE__ */ s(
1555
- Q,
1558
+ X,
1556
1559
  {
1557
1560
  as: "div",
1558
1561
  padding: "medium",
@@ -1562,8 +1565,8 @@ const Qn = ({
1562
1565
  insetInlineStart: "0",
1563
1566
  insetInlineEnd: "0",
1564
1567
  stacking: "above",
1565
- children: /* @__PURE__ */ I(
1566
- x,
1568
+ children: /* @__PURE__ */ S(
1569
+ k,
1567
1570
  {
1568
1571
  direction: "column",
1569
1572
  justifyItems: "center",
@@ -1572,45 +1575,45 @@ const Qn = ({
1572
1575
  height: "100%",
1573
1576
  children: [
1574
1577
  /* @__PURE__ */ s(
1575
- ne,
1578
+ re,
1576
1579
  {
1577
1580
  display: "block",
1578
1581
  color: "danger",
1579
1582
  withBackground: !1,
1580
- themeOverride: (u, k) => ({
1583
+ themeOverride: (f, L) => ({
1581
1584
  borderRadius: We,
1582
1585
  // Ghost states default to translucent fills; the faded card would show through.
1583
- dangerGhostBackground: k.colors.contrasts.white1010,
1584
- dangerGhostHoverBackground: k.colors.contrasts.red1212,
1585
- dangerGhostActiveBackground: k.colors.contrasts.red1212,
1586
+ dangerGhostBackground: L.colors.contrasts.white1010,
1587
+ dangerGhostHoverBackground: L.colors.contrasts.red1212,
1588
+ dangerGhostActiveBackground: L.colors.contrasts.red1212,
1586
1589
  // red45 on the hover tint is 3.74:1; red57 clears AA in every state.
1587
- dangerGhostColor: k.colors.contrasts.red5782,
1588
- dangerGhostBorderColor: k.colors.contrasts.red5782
1590
+ dangerGhostColor: L.colors.contrasts.red5782,
1591
+ dangerGhostBorderColor: L.colors.contrasts.red5782
1589
1592
  }),
1590
- renderIcon: /* @__PURE__ */ s(ye, {}),
1593
+ renderIcon: /* @__PURE__ */ s(Te, {}),
1591
1594
  "data-testid": `note-card-${t}-confirm-delete`,
1592
- onClick: (u) => {
1593
- u.stopPropagation(), l(t), S(!1);
1595
+ onClick: (f) => {
1596
+ f.stopPropagation(), l(t), T(!1);
1594
1597
  },
1595
1598
  children: g.deleteNote
1596
1599
  }
1597
1600
  ),
1598
1601
  /* @__PURE__ */ s(
1599
- ne,
1602
+ re,
1600
1603
  {
1601
1604
  display: "block",
1602
1605
  withBackground: !1,
1603
- themeOverride: (u, k) => ({
1606
+ themeOverride: (f, L) => ({
1604
1607
  borderRadius: We,
1605
- secondaryGhostBackground: k.colors.contrasts.white1010,
1606
- secondaryGhostActiveBackground: k.colors.contrasts.grey1111
1608
+ secondaryGhostBackground: L.colors.contrasts.white1010,
1609
+ secondaryGhostActiveBackground: L.colors.contrasts.grey1111
1607
1610
  }),
1608
1611
  "data-testid": `note-card-${t}-cancel-delete`,
1609
- elementRef: (u) => {
1610
- H.current = u;
1612
+ elementRef: (f) => {
1613
+ I.current = f;
1611
1614
  },
1612
- onClick: (u) => {
1613
- u.stopPropagation(), T();
1615
+ onClick: (f) => {
1616
+ f.stopPropagation(), A();
1614
1617
  },
1615
1618
  children: g.cancel
1616
1619
  }
@@ -1625,7 +1628,7 @@ const Qn = ({
1625
1628
  ]
1626
1629
  }
1627
1630
  );
1628
- return E && y ? y({ href: E, children: R, ariaLabel: D }) : R;
1631
+ return E && p ? p({ href: E, children: ne, ariaLabel: B }) : ne;
1629
1632
  }, Yn = {
1630
1633
  display: "grid",
1631
1634
  gap: "1rem",
@@ -1645,44 +1648,44 @@ const Qn = ({
1645
1648
  onNoteDelete: a,
1646
1649
  onNoteSave: m,
1647
1650
  onNoteTypeChange: c,
1648
- onNotesEmptied: p,
1651
+ onNotesEmptied: y,
1649
1652
  selectedNoteId: d,
1650
1653
  hasActiveFilter: h = !1,
1651
1654
  columnCount: b = 1,
1652
- highlightTheme: y,
1655
+ highlightTheme: p,
1653
1656
  locale: E,
1654
1657
  courseNames: g,
1655
- renderNoteLink: Y,
1656
- noteHref: j
1658
+ renderNoteLink: Q,
1659
+ noteHref: W
1657
1660
  }) => {
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);
1661
+ const { translations: N } = ee(), C = $(null), D = $(null), H = q(
1662
+ (T) => {
1663
+ const O = t.findIndex((M) => M.id === T);
1664
+ let x = null;
1665
+ t.length > 1 && (x = O > 0 ? t[O - 1].id : t[1].id), D.current = { targetId: x }, a == null || a(T);
1663
1666
  },
1664
1667
  [t, a]
1665
1668
  );
1666
- if (W(() => {
1667
- var L;
1668
- const S = P.current;
1669
- if (S)
1670
- if (P.current = null, S.targetId === null)
1671
- p == null || p();
1669
+ if (z(() => {
1670
+ var O;
1671
+ const T = D.current;
1672
+ if (T)
1673
+ if (D.current = null, T.targetId === null)
1674
+ y == null || y();
1672
1675
  else {
1673
- const v = (L = C.current) == null ? void 0 : L.querySelector(
1674
- `[data-testid="note-card-${S.targetId}"]`
1676
+ const x = (O = C.current) == null ? void 0 : O.querySelector(
1677
+ `[data-testid="note-card-${T.targetId}"]`
1675
1678
  );
1676
- v == null || v.focus();
1679
+ x == null || x.focus();
1677
1680
  }
1678
- }, [t, p]), e)
1679
- return /* @__PURE__ */ s(Q, { as: "div", textAlign: "center", padding: "large", "data-testid": "notes-loading", children: /* @__PURE__ */ s(Tt, { renderTitle: N.loadingNotes }) });
1681
+ }, [t, y]), e)
1682
+ return /* @__PURE__ */ s(X, { as: "div", textAlign: "center", padding: "large", "data-testid": "notes-loading", children: /* @__PURE__ */ s(vt, { renderTitle: N.loadingNotes }) });
1680
1683
  if (n)
1681
- return /* @__PURE__ */ s(Q, { as: "div", textAlign: "center", padding: "large", "data-testid": "notes-error", children: /* @__PURE__ */ s(Ne, { level: "h4", children: N.failedToLoadNotes }) });
1684
+ return /* @__PURE__ */ s(X, { as: "div", textAlign: "center", padding: "large", "data-testid": "notes-error", children: /* @__PURE__ */ s(Se, { level: "h4", children: N.failedToLoadNotes }) });
1682
1685
  if (t.length === 0)
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
+ return /* @__PURE__ */ s(X, { as: "div", padding: "large", "data-testid": "empty-notes", children: /* @__PURE__ */ s(Kn, { hasActiveFilter: h }) });
1687
+ const P = typeof o == "number" && typeof r == "number" && r > 1 && i !== void 0;
1688
+ return /* @__PURE__ */ S(qe, { children: [
1686
1689
  /* @__PURE__ */ s(
1687
1690
  "ul",
1688
1691
  {
@@ -1690,33 +1693,33 @@ const Qn = ({
1690
1693
  style: { ...Yn, gridTemplateColumns: `repeat(${b}, minmax(0, 1fr))` },
1691
1694
  role: "list",
1692
1695
  "data-testid": "notes-grid",
1693
- children: t.map((S) => {
1694
- var L;
1696
+ children: t.map((T) => {
1697
+ var O;
1695
1698
  return /* @__PURE__ */ s("li", { children: /* @__PURE__ */ s(
1696
1699
  Qn,
1697
1700
  {
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,
1701
+ noteId: T.id,
1702
+ date: T.createdAt,
1703
+ type: T.reaction[0] ?? R.IMPORTANT,
1704
+ highlight: (O = T.highlightData) == null ? void 0 : O.selectedText,
1705
+ note: T.userText,
1706
+ isActive: d === T.id,
1704
1707
  isPanelView: !!d,
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,
1709
- highlightTheme: y,
1708
+ onClick: l ? () => l(T.id) : void 0,
1709
+ onDelete: a ? H : void 0,
1710
+ onSaveNote: m ? (x, M) => m(x, M) : void 0,
1711
+ onTypeChange: c ? (x, M) => c(x, M) : void 0,
1712
+ highlightTheme: p,
1710
1713
  locale: E,
1711
- courseName: g == null ? void 0 : g.get(S.courseId),
1712
- renderLink: Y,
1713
- href: j ? j(S.id, S) : void 0
1714
+ courseName: g == null ? void 0 : g.get(T.courseId),
1715
+ renderLink: Q,
1716
+ href: W ? W(T.id, T) : void 0
1714
1717
  }
1715
- ) }, S.id);
1718
+ ) }, T.id);
1716
1719
  })
1717
1720
  }
1718
1721
  ),
1719
- _ && /* @__PURE__ */ s(x, { justifyItems: "center", padding: "small", "data-testid": "notes-pagination", children: /* @__PURE__ */ s(x.Item, { children: /* @__PURE__ */ s(
1722
+ P && /* @__PURE__ */ s(k, { justifyItems: "center", padding: "small", "data-testid": "notes-pagination", children: /* @__PURE__ */ s(k.Item, { children: /* @__PURE__ */ s(
1720
1723
  St,
1721
1724
  {
1722
1725
  as: "nav",
@@ -1740,11 +1743,11 @@ const Qn = ({
1740
1743
  onBack: a,
1741
1744
  editing: m = !1
1742
1745
  }) => {
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: [
1746
+ const { translations: c } = ee(), [y, d] = j(m), [h, b] = j(t || ""), [p, E] = j(!1);
1747
+ return /* @__PURE__ */ S(k, { direction: "column", gap: "small", "data-testid": "single-note", children: [
1748
+ n != null ? /* @__PURE__ */ s(X, { as: "div", children: /* @__PURE__ */ s(oe, { children: /* @__PURE__ */ s(Re, { type: e, isCardActive: !0, theme: o, children: n }) }) }) : /* @__PURE__ */ s(ut, {}),
1749
+ /* @__PURE__ */ s(ft, { type: e, onTypeChange: l, renderAsMenuTrigger: !!l }),
1750
+ y ? /* @__PURE__ */ S(k, { direction: "column", gap: "x-small", children: [
1748
1751
  /* @__PURE__ */ s(
1749
1752
  Ye,
1750
1753
  {
@@ -1754,9 +1757,9 @@ const Qn = ({
1754
1757
  resize: "vertical"
1755
1758
  }
1756
1759
  ),
1757
- /* @__PURE__ */ I(x, { gap: "xx-small", children: [
1758
- /* @__PURE__ */ s(x.Item, { shouldGrow: !0, children: /* @__PURE__ */ s(
1759
- ne,
1760
+ /* @__PURE__ */ S(k, { gap: "xx-small", children: [
1761
+ /* @__PURE__ */ s(k.Item, { shouldGrow: !0, children: /* @__PURE__ */ s(
1762
+ re,
1760
1763
  {
1761
1764
  display: "block",
1762
1765
  size: "small",
@@ -1767,8 +1770,8 @@ const Qn = ({
1767
1770
  children: c.cancel
1768
1771
  }
1769
1772
  ) }),
1770
- /* @__PURE__ */ s(x.Item, { shouldGrow: !0, children: /* @__PURE__ */ s(
1771
- ne,
1773
+ /* @__PURE__ */ s(k.Item, { shouldGrow: !0, children: /* @__PURE__ */ s(
1774
+ re,
1772
1775
  {
1773
1776
  display: "block",
1774
1777
  color: "primary",
@@ -1781,25 +1784,25 @@ const Qn = ({
1781
1784
  }
1782
1785
  ) })
1783
1786
  ] })
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 })
1787
+ ] }) : /* @__PURE__ */ S(k, { direction: "column", gap: "small", children: [
1788
+ t && /* @__PURE__ */ S(X, { as: "div", children: [
1789
+ /* @__PURE__ */ s(Se, { level: "h4", margin: "0 0 xx-small 0", children: c.note }),
1790
+ /* @__PURE__ */ s(oe, { children: t })
1788
1791
  ] }),
1789
- /* @__PURE__ */ I(x, { justifyItems: "space-between", children: [
1792
+ /* @__PURE__ */ S(k, { justifyItems: "space-between", children: [
1790
1793
  /* @__PURE__ */ s(
1791
- ne,
1794
+ re,
1792
1795
  {
1793
1796
  size: "small",
1794
- renderIcon: /* @__PURE__ */ s(bt, {}),
1797
+ renderIcon: /* @__PURE__ */ s(Et, {}),
1795
1798
  "data-testid": "single-note-back",
1796
1799
  onClick: () => a == null ? void 0 : a(),
1797
1800
  children: c.back
1798
1801
  }
1799
1802
  ),
1800
- /* @__PURE__ */ I(x, { gap: "xx-small", children: [
1803
+ /* @__PURE__ */ S(k, { gap: "xx-small", children: [
1801
1804
  i && /* @__PURE__ */ s(
1802
- ue,
1805
+ me,
1803
1806
  {
1804
1807
  size: "small",
1805
1808
  withBackground: !1,
@@ -1808,11 +1811,11 @@ const Qn = ({
1808
1811
  screenReaderLabel: c.deleteNote,
1809
1812
  "data-testid": "single-note-delete",
1810
1813
  onClick: () => E(!0),
1811
- children: /* @__PURE__ */ s(ye, {})
1814
+ children: /* @__PURE__ */ s(Te, {})
1812
1815
  }
1813
1816
  ),
1814
1817
  /* @__PURE__ */ s(
1815
- ue,
1818
+ me,
1816
1819
  {
1817
1820
  size: "small",
1818
1821
  withBackground: !1,
@@ -1820,19 +1823,19 @@ const Qn = ({
1820
1823
  screenReaderLabel: c.editNote,
1821
1824
  "data-testid": "single-note-edit",
1822
1825
  onClick: () => d(!0),
1823
- children: /* @__PURE__ */ s(Ie, {})
1826
+ children: /* @__PURE__ */ s(ke, {})
1824
1827
  }
1825
1828
  )
1826
1829
  ] })
1827
1830
  ] }),
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: [
1831
+ p && i && /* @__PURE__ */ s(X, { as: "div", background: "primary", padding: "medium", borderRadius: "large", children: /* @__PURE__ */ S(k, { direction: "column", justifyItems: "center", alignItems: "center", gap: "x-small", children: [
1829
1832
  /* @__PURE__ */ s(
1830
- ne,
1833
+ re,
1831
1834
  {
1832
1835
  display: "block",
1833
1836
  color: "danger",
1834
1837
  size: "small",
1835
- renderIcon: /* @__PURE__ */ s(ye, {}),
1838
+ renderIcon: /* @__PURE__ */ s(Te, {}),
1836
1839
  "data-testid": "single-note-confirm-delete",
1837
1840
  onClick: () => {
1838
1841
  i(), E(!1);
@@ -1841,7 +1844,7 @@ const Qn = ({
1841
1844
  }
1842
1845
  ),
1843
1846
  /* @__PURE__ */ s(
1844
- ne,
1847
+ re,
1845
1848
  {
1846
1849
  display: "block",
1847
1850
  size: "small",
@@ -1855,25 +1858,25 @@ const Qn = ({
1855
1858
  ] });
1856
1859
  };
1857
1860
  export {
1858
- To as ContentWithNoteWrapper,
1859
- xe as Highlight,
1860
- dt as HighlightError,
1861
+ So as ContentWithNoteWrapper,
1862
+ Re as Highlight,
1863
+ ut as HighlightError,
1861
1864
  Qn as NoteCard,
1862
- ut as NoteChip,
1865
+ ft as NoteChip,
1863
1866
  jn as NoteReactionMenu,
1864
1867
  Kn as NotebookEmptyState,
1865
1868
  Eo as NotebookProvider,
1866
1869
  Hn as NotebookTranslationsProvider,
1867
- So as NotebookTray,
1870
+ To as NotebookTray,
1868
1871
  Co as NotesListView,
1869
- O as REACTION_TYPE,
1872
+ R as REACTION_TYPE,
1870
1873
  xo as SingleNote,
1871
- Pe as createTransparentColor,
1874
+ Fe as createTransparentColor,
1872
1875
  Vt as useCreateNote,
1873
1876
  Zt as useDeleteNote,
1874
- ot as useGetNotes,
1875
- at as useNotebook,
1876
- J as useNotebookTranslations,
1877
+ rt as useGetNotes,
1878
+ ct as useNotebook,
1879
+ ee as useNotebookTranslations,
1877
1880
  vo as useNotesData,
1878
1881
  Io as useReactionFilter,
1879
1882
  en as useUpdateNote