@instructure/platform-notebook 1.5.0 → 1.5.2

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,14 +1,14 @@
1
- import { jsx as i, jsxs as S, Fragment as rt } from "react/jsx-runtime";
2
- import { createContext as Ge, useMemo as de, useContext as ze, useReducer as We, useRef as X, useEffect as V, useState as U, useCallback as Y } from "react";
1
+ import { jsx as i, jsxs as T, Fragment as rt } from "react/jsx-runtime";
2
+ import { createContext as je, useMemo as ge, useContext as ze, useReducer as We, useRef as K, useEffect as V, useState as U, useCallback as Y } from "react";
3
3
  import { createPortal as st } from "react-dom";
4
- import { z as d } from "zod";
4
+ import { z as u } from "zod";
5
5
  import it from "diff-match-patch";
6
6
  import { useQueryClient as Ie, useMutation as xe, useQuery as at } from "@tanstack/react-query";
7
7
  import { CloseButton as lt, Button as ee, IconButton as le } from "@instructure/ui-buttons";
8
8
  import { Flex as v } from "@instructure/ui-flex";
9
9
  import { Heading as pe } from "@instructure/ui-heading";
10
10
  import { Tray as ct } from "@instructure/ui-tray";
11
- import { View as W } from "@instructure/ui-view";
11
+ import { View as j } from "@instructure/ui-view";
12
12
  import { IconQuestionLine as ke, IconPinLine as we, IconWarningLine as dt, IconNoteLine as ut, IconEditLine as Se, IconTrashLine as he, IconArrowStartLine as ft } from "@instructure/ui-icons";
13
13
  import { Menu as ie } from "@instructure/ui-menu";
14
14
  import { TruncateText as Te } from "@instructure/ui-truncate-text";
@@ -19,88 +19,88 @@ import { TextArea as qe } from "@instructure/ui-text-area";
19
19
  import { Pill as Me } from "@instructure/ui-pill";
20
20
  import { Pagination as gt } from "@instructure/ui-pagination";
21
21
  import { Spinner as ht } from "@instructure/ui-spinner";
22
- const pt = d.object({
23
- startContainer: d.string(),
24
- endContainer: d.string(),
25
- startOffset: d.number(),
26
- endOffset: d.number()
27
- }), Nt = d.object({
28
- start: d.number(),
29
- end: d.number()
30
- }), Oe = d.object({
31
- selectedText: d.string(),
32
- hasNoHighlightAnymore: d.boolean().optional(),
22
+ const pt = u.object({
23
+ startContainer: u.string(),
24
+ endContainer: u.string(),
25
+ startOffset: u.number(),
26
+ endOffset: u.number()
27
+ }), Nt = u.object({
28
+ start: u.number(),
29
+ end: u.number()
30
+ }), Oe = u.object({
31
+ selectedText: u.string(),
32
+ hasNoHighlightAnymore: u.boolean().optional(),
33
33
  textPosition: Nt.nullable(),
34
34
  range: pt.nullable(),
35
- pageLastModifiedAt: d.string()
35
+ pageLastModifiedAt: u.string()
36
36
  });
37
- var k = /* @__PURE__ */ ((t) => (t.IMPORTANT = "Important", t.CONFUSING = "Confusing", t))(k || {});
38
- const Re = d.enum([
37
+ var x = /* @__PURE__ */ ((t) => (t.IMPORTANT = "Important", t.CONFUSING = "Confusing", t))(x || {});
38
+ const Re = u.enum([
39
39
  "Important",
40
40
  "Confusing"
41
41
  /* CONFUSING */
42
- ]), yt = d.object({
43
- totalCount: d.number().nullish(),
44
- totalNrOfPages: d.number().nullish()
45
- }), Ne = d.object({
46
- id: d.string(),
47
- rootAccountUuid: d.string(),
48
- userId: d.string(),
49
- courseId: d.string(),
50
- objectId: d.string(),
51
- objectType: d.string(),
52
- userText: d.string().optional(),
53
- reaction: d.array(Re),
42
+ ]), yt = u.object({
43
+ totalCount: u.number().nullish(),
44
+ totalNrOfPages: u.number().nullish()
45
+ }), Ne = u.object({
46
+ id: u.string(),
47
+ rootAccountUuid: u.string(),
48
+ userId: u.string(),
49
+ courseId: u.string(),
50
+ objectId: u.string(),
51
+ objectType: u.string(),
52
+ userText: u.string().optional(),
53
+ reaction: u.array(Re),
54
54
  highlightData: Oe,
55
- createdAt: d.string(),
56
- updatedAt: d.string()
57
- }), bt = d.object({
58
- cursor: d.string(),
55
+ createdAt: u.string(),
56
+ updatedAt: u.string()
57
+ }), bt = u.object({
58
+ cursor: u.string(),
59
59
  node: Ne
60
60
  });
61
- d.object({
62
- notes: d.object({
63
- edges: d.array(bt),
64
- nodes: d.array(Ne),
61
+ u.object({
62
+ notes: u.object({
63
+ edges: u.array(bt),
64
+ nodes: u.array(Ne),
65
65
  pageInfo: yt
66
66
  })
67
67
  });
68
- const Et = d.object({
69
- type: d.string(),
70
- id: d.string()
71
- }), St = d.object({
72
- courseId: d.string().optional(),
68
+ const Et = u.object({
69
+ type: u.string(),
70
+ id: u.string()
71
+ }), St = u.object({
72
+ courseId: u.string().optional(),
73
73
  learningObject: Et.optional(),
74
- reactions: d.array(d.string()).optional()
74
+ reactions: u.array(u.string()).optional()
75
75
  }).optional();
76
- d.object({
77
- courseId: d.string().optional(),
76
+ u.object({
77
+ courseId: u.string().optional(),
78
78
  filter: St,
79
- offset: d.number().optional(),
80
- pageSize: d.number().optional()
79
+ offset: u.number().optional(),
80
+ pageSize: u.number().optional()
81
81
  });
82
- d.object({
83
- courseId: d.string(),
84
- objectId: d.string(),
85
- objectType: d.string(),
86
- userText: d.string().optional(),
87
- reaction: d.array(Re),
82
+ u.object({
83
+ courseId: u.string(),
84
+ objectId: u.string(),
85
+ objectType: u.string(),
86
+ userText: u.string().optional(),
87
+ reaction: u.array(Re),
88
88
  highlightData: Oe
89
89
  });
90
- d.object({
90
+ u.object({
91
91
  createNote: Ne
92
92
  });
93
- d.object({
94
- id: d.string(),
95
- userText: d.string().optional(),
96
- reaction: d.array(Re),
93
+ u.object({
94
+ id: u.string(),
95
+ userText: u.string().optional(),
96
+ reaction: u.array(Re),
97
97
  highlightData: Oe
98
98
  });
99
- d.object({
99
+ u.object({
100
100
  updateNote: Ne
101
101
  });
102
- d.object({
103
- deleteNote: d.string()
102
+ u.object({
103
+ deleteNote: u.string()
104
104
  });
105
105
  var Ke = /* @__PURE__ */ ((t) => (t[t.FORWARDS = 1] = "FORWARDS", t[t.BACKWARDS = 2] = "BACKWARDS", t))(Ke || {});
106
106
  class te {
@@ -121,17 +121,17 @@ class te {
121
121
  return o.setStart(e.node, e.offset), o.setEnd(n.node, n.offset), o;
122
122
  }
123
123
  static fromRange(e) {
124
- const n = z.fromPoint(e.startContainer, e.startOffset), o = z.fromPoint(e.endContainer, e.endOffset);
124
+ const n = G.fromPoint(e.startContainer, e.startOffset), o = G.fromPoint(e.endContainer, e.endOffset);
125
125
  return !n || !o ? null : new te(n, o);
126
126
  }
127
127
  static fromOffsets(e, n, o) {
128
- return new te(new z(e, n), new z(e, o));
128
+ return new te(new G(e, n), new G(e, o));
129
129
  }
130
130
  relativeTo(e) {
131
131
  return new te(this.start.relativeTo(e), this.end.relativeTo(e));
132
132
  }
133
133
  }
134
- class z {
134
+ class G {
135
135
  constructor(e, n) {
136
136
  n < 0 && console.error("Offset is invalid"), this.element = e, this.offset = n;
137
137
  }
@@ -153,9 +153,9 @@ class z {
153
153
  static fromCharOffset(e, n) {
154
154
  switch (e.nodeType) {
155
155
  case Node.TEXT_NODE:
156
- return z.fromPoint(e, n);
156
+ return G.fromPoint(e, n);
157
157
  case Node.ELEMENT_NODE:
158
- return new z(e, n);
158
+ return new G(e, n);
159
159
  default:
160
160
  return console.error("Node is not an element or text node"), null;
161
161
  }
@@ -167,8 +167,8 @@ class z {
167
167
  return console.error("Text node offset is out of range"), null;
168
168
  if (!e.parentElement)
169
169
  return console.error("Text node has no parent"), null;
170
- const o = He(e) + n;
171
- return new z(e.parentElement, o);
170
+ const o = $e(e) + n;
171
+ return new G(e.parentElement, o);
172
172
  }
173
173
  case Node.ELEMENT_NODE: {
174
174
  if (n < 0 || n > e.childNodes.length)
@@ -176,7 +176,7 @@ class z {
176
176
  let o = 0;
177
177
  for (let r = 0; r < n; r++)
178
178
  o += Xe(e.childNodes[r]);
179
- return new z(e, o);
179
+ return new G(e, o);
180
180
  }
181
181
  default:
182
182
  return console.error("Point is not in an element or text node"), null;
@@ -187,8 +187,8 @@ class z {
187
187
  throw new Error("Parent is not an ancestor of current element");
188
188
  let n = this.element, o = this.offset;
189
189
  for (; n !== e; )
190
- o += He(n), n.parentElement && (n = n.parentElement);
191
- return new z(n, o);
190
+ o += $e(n), n.parentElement && (n = n.parentElement);
191
+ return new G(n, o);
192
192
  }
193
193
  }
194
194
  const Tt = (t) => {
@@ -231,21 +231,21 @@ const Ct = (t) => {
231
231
  o.shift();
232
232
  for (const s of o) {
233
233
  let a, l;
234
- const m = s.indexOf("[");
235
- if (m !== -1) {
236
- a = s.slice(0, m);
237
- const h = s.slice(m + 1, s.indexOf("]"));
234
+ const g = s.indexOf("[");
235
+ if (g !== -1) {
236
+ a = s.slice(0, g);
237
+ const h = s.slice(g + 1, s.indexOf("]"));
238
238
  if (l = Number.parseInt(h, 10) - 1, l < 0)
239
239
  return null;
240
240
  } else
241
241
  a = s, l = 0;
242
- const c = It(r, a, l);
243
- if (!c)
242
+ const d = It(r, a, l);
243
+ if (!d)
244
244
  return null;
245
- r = c;
245
+ r = d;
246
246
  }
247
247
  return r;
248
- }, $e = (t, e = document.body) => {
248
+ }, He = (t, e = document.body) => {
249
249
  try {
250
250
  return xt(t, e);
251
251
  } catch {
@@ -262,13 +262,13 @@ class oe {
262
262
  static fromSelector(e, n) {
263
263
  if (!(n != null && n.startContainer) || !(n != null && n.endContainer))
264
264
  return console.error("No start or end container in selector"), null;
265
- const o = $e(n.startContainer, e);
265
+ const o = He(n.startContainer, e);
266
266
  if (!o)
267
267
  return console.error("Failed to resolve startContainer XPath"), null;
268
- const r = $e(n.endContainer, e);
268
+ const r = He(n.endContainer, e);
269
269
  if (!r)
270
270
  return console.error("Failed to resolve endContainer XPath"), null;
271
- const s = z.fromCharOffset(o, n.startOffset), a = z.fromCharOffset(r, n.endOffset);
271
+ const s = G.fromCharOffset(o, n.startOffset), a = G.fromCharOffset(r, n.endOffset);
272
272
  if (!s || !a)
273
273
  return null;
274
274
  const l = new te(s, a).toRange();
@@ -319,7 +319,7 @@ const Xe = (t) => {
319
319
  default:
320
320
  return 0;
321
321
  }
322
- }, He = (t) => {
322
+ }, $e = (t) => {
323
323
  let e = t.previousSibling, n = 0;
324
324
  for (; e; )
325
325
  n += Xe(e), e = e.previousSibling;
@@ -346,18 +346,18 @@ const Xe = (t) => {
346
346
  if (!s)
347
347
  return null;
348
348
  if (e.length > 32) {
349
- const a = e.slice(0, 32), l = e.slice(-32), m = o - n;
350
- let c = r.match_main(s, a, n);
351
- const h = r.match_main(s, l, o), g = h + l.length;
352
- if (c === -1 || h === -1)
349
+ const a = e.slice(0, 32), l = e.slice(-32), g = o - n;
350
+ let d = r.match_main(s, a, n);
351
+ const h = r.match_main(s, l, o), c = h + l.length;
352
+ if (d === -1 || h === -1)
353
353
  return null;
354
- const f = g - c, N = Math.abs(f - m);
355
- if ((c > g || N > 5) && (r.Match_Distance = e.length + 100, c = r.match_main(s, a, g), c !== -1 && c < g))
356
- return kt(t, c, g, m);
357
- if (c < g && N <= 5)
354
+ const S = c - d, p = Math.abs(S - g);
355
+ if ((d > c || p > 5) && (r.Match_Distance = e.length + 100, d = r.match_main(s, a, c), d !== -1 && d < c))
356
+ return kt(t, d, c, g);
357
+ if (d < c && p <= 5)
358
358
  return ne.fromSelector(t, {
359
- start: c,
360
- end: g
359
+ start: d,
360
+ end: c
361
361
  });
362
362
  } else {
363
363
  const a = r.match_main(s, e, n);
@@ -382,16 +382,16 @@ const Xe = (t) => {
382
382
  for (const s of e) {
383
383
  const a = Ot(s, t);
384
384
  if (a) {
385
- const l = a.toRange(), m = l && oe.fromRange(t, l), c = (l == null ? void 0 : l.toString().trim()) || s.highlightData.selectedText;
385
+ const l = a.toRange(), g = l && oe.fromRange(t, l), d = (l == null ? void 0 : l.toString().trim()) || s.highlightData.selectedText;
386
386
  o.push({
387
387
  id: s.id,
388
388
  reaction: s.reaction,
389
389
  userText: s.userText,
390
390
  highlightData: {
391
391
  ...s.highlightData,
392
- selectedText: c,
392
+ selectedText: d,
393
393
  hasNoHighlightAnymore: !1,
394
- range: (m == null ? void 0 : m.toSelector()) ?? null,
394
+ range: (g == null ? void 0 : g.toSelector()) ?? null,
395
395
  textPosition: a.toSelector(),
396
396
  pageLastModifiedAt: n
397
397
  }
@@ -413,7 +413,7 @@ const Xe = (t) => {
413
413
  var a;
414
414
  if (!e) return;
415
415
  const { highlightData: n, id: o } = t, { range: r } = n ?? {};
416
- r && ((a = oe.fromSelector(e, r)) == null ? void 0 : a.toRange()) && Ht({ id: o });
416
+ r && ((a = oe.fromSelector(e, r)) == null ? void 0 : a.toRange()) && Ut({ id: o });
417
417
  }, At = (t) => {
418
418
  const n = document.querySelector(
419
419
  `[data-highlight-id="${CSS.escape(t)}"].highlight-content`
@@ -422,48 +422,48 @@ const Xe = (t) => {
422
422
  const o = n.getBoundingClientRect();
423
423
  o.top >= 0 && o.bottom <= (window.innerHeight || document.documentElement.clientHeight) || n.scrollIntoView({ behavior: "smooth", block: "center" });
424
424
  }
425
- }, fe = 90, me = 172, Dt = (t) => {
425
+ }, ue = 90, fe = 172, Lt = (t) => {
426
426
  const e = t.getClientRects();
427
427
  if (!e.length)
428
428
  return null;
429
- const n = e[0], o = e[e.length - 1], r = 4, s = 16, a = window.innerWidth || document.documentElement.clientWidth, l = window.innerHeight || document.documentElement.clientHeight, m = (p) => {
430
- const y = p + me;
431
- return p >= s && y <= a - s;
432
- }, c = (p) => {
433
- const y = p + fe;
434
- return p >= s && y <= l - s;
429
+ const n = e[0], o = e[e.length - 1], r = 4, s = 16, a = window.innerWidth || document.documentElement.clientWidth, l = window.innerHeight || document.documentElement.clientHeight, g = (b) => {
430
+ const y = b + fe;
431
+ return b >= s && y <= a - s;
432
+ }, d = (b) => {
433
+ const y = b + ue;
434
+ return b >= s && y <= l - s;
435
435
  };
436
436
  let h;
437
- const g = n.right - me;
438
- if (m(g))
439
- h = g;
437
+ const c = n.right - fe;
438
+ if (g(c))
439
+ h = c;
440
440
  else {
441
- const p = n.left;
442
- if (m(p))
443
- h = p;
441
+ const b = n.left;
442
+ if (g(b))
443
+ h = b;
444
444
  else {
445
- const b = (n.left + n.right) / 2 - me / 2;
446
- m(b) ? h = b : g < s ? h = s : h = a - me - s;
445
+ const N = (n.left + n.right) / 2 - fe / 2;
446
+ g(N) ? h = N : c < s ? h = s : h = a - fe - s;
447
447
  }
448
448
  }
449
- let f;
450
- const N = o.bottom + r;
451
- if (c(N))
452
- f = N;
449
+ let S;
450
+ const p = o.bottom + r;
451
+ if (d(p))
452
+ S = p;
453
453
  else {
454
- const p = n.top - fe - r;
455
- c(p) ? f = p : N + fe > l - s ? f = l - fe - s : f = s;
454
+ const b = n.top - ue - r;
455
+ d(b) ? S = b : p + ue > l - s ? S = l - ue - s : S = s;
456
456
  }
457
- return { top: f, left: h };
458
- }, Pt = (t, e) => {
457
+ return { top: S, left: h };
458
+ }, Dt = (t, e) => {
459
459
  for (const n of e)
460
460
  if (t.start < n.end && t.end > n.start)
461
461
  return !0;
462
462
  return !1;
463
- }, Ae = (t) => `highlight-wrapper-${t}`, ye = (t) => `${Ae(t)}-start`, Ye = (t) => `${Ae(t)}-end`, ce = (t) => `[data-highlight-id="${CSS.escape(t)}"]`, Lt = "2px", _t = "3px", De = (t, e) => {
463
+ }, Ae = (t) => `highlight-wrapper-${t}`, ye = (t) => `${Ae(t)}-start`, Ye = (t) => `${Ae(t)}-end`, ce = (t) => `[data-highlight-id="${CSS.escape(t)}"]`, Pt = "2px", _t = "3px", Ft = "Notebook note", Le = (t, e) => {
464
464
  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);
465
465
  return `rgba(${n}, ${o}, ${r}, ${e})`;
466
- }, Ft = (t, e) => {
466
+ }, Mt = (t, e) => {
467
467
  var n;
468
468
  try {
469
469
  const o = ((n = e.nodeValue) == null ? void 0 : n.length) ?? e.childNodes.length;
@@ -471,7 +471,7 @@ const Xe = (t) => {
471
471
  } catch {
472
472
  return !1;
473
473
  }
474
- }, Mt = (t) => {
474
+ }, Bt = (t) => {
475
475
  var s;
476
476
  if (t.collapsed)
477
477
  return [];
@@ -481,7 +481,7 @@ const Xe = (t) => {
481
481
  const n = [], o = (s = e == null ? void 0 : e.ownerDocument) == null ? void 0 : s.createNodeIterator(e, NodeFilter.SHOW_TEXT);
482
482
  let r = (o == null ? void 0 : o.nextNode()) || null;
483
483
  for (; r; ) {
484
- if (!Ft(t, r)) {
484
+ if (!Mt(t, r)) {
485
485
  r = (o == null ? void 0 : o.nextNode()) || null;
486
486
  continue;
487
487
  }
@@ -493,71 +493,71 @@ const Xe = (t) => {
493
493
  a === t.endContainer && t.endOffset < a.data.length && a.splitText(t.endOffset), n.push(a), r = (o == null ? void 0 : o.nextNode()) || null;
494
494
  }
495
495
  return n;
496
- }, Bt = (t, e, n) => {
496
+ }, Ht = (t, e, n) => {
497
497
  if (t.collapsed) return;
498
498
  const o = e.id ?? "", r = Ae(o);
499
499
  if (document.getElementById(ye(o))) {
500
500
  $t(e, n);
501
501
  return;
502
502
  }
503
- const a = e.type === k.IMPORTANT ? n.colors.importantBackground : n.colors.confusingBackground, l = e.id === e.selectedNoteId, m = l ? a : De(a, 0.5), c = e.type === k.IMPORTANT ? n.colors.importantUnderline : n.colors.confusingUnderline, h = e.type === k.IMPORTANT ? "solid" : "dashed", g = t.toString(), f = document.createElement("span");
504
- f.id = `${r}-start`, f.className = "highlight-marker-start", f.dataset.highlightId = o || "";
505
- const N = e.labelPrefix ? `${e.labelPrefix}: ${g}` : g;
506
- f.setAttribute("role", "button"), f.setAttribute("tabindex", "0"), f.setAttribute("aria-label", N), f.setAttribute("aria-haspopup", "dialog"), f.setAttribute("aria-expanded", String(l && !!e.isTrayOpen)), e.popupId && f.setAttribute("aria-controls", e.popupId), f.style.position = "relative", f.style.fontSize = "0", f.style.lineHeight = "0", f.style.width = "0", f.style.height = "0", f.style.margin = "0", f.style.padding = "0", f.style.border = "0", f.style.outline = "none";
503
+ const a = e.type === x.IMPORTANT ? n.colors.importantBackground : n.colors.confusingBackground, l = e.id === e.selectedNoteId, g = l ? a : Le(a, 0.5), d = e.type === x.IMPORTANT ? n.colors.importantUnderline : n.colors.confusingUnderline, h = e.type === x.IMPORTANT ? "solid" : "dashed", c = document.createElement("span");
504
+ c.id = `${r}-start`, c.className = "highlight-marker-start", c.dataset.highlightId = o || "";
505
+ const S = e.labelPrefix ?? Ft;
506
+ c.setAttribute("role", "button"), c.setAttribute("tabindex", "0"), c.setAttribute("aria-label", S), c.setAttribute("aria-haspopup", "dialog"), c.setAttribute("aria-expanded", String(l && !!e.isTrayOpen)), e.popupId && c.setAttribute("aria-controls", e.popupId), c.style.position = "relative", c.style.fontSize = "0", c.style.lineHeight = "0", c.style.width = "0", c.style.height = "0", c.style.margin = "0", c.style.padding = "0", c.style.border = "0", c.style.outline = "none";
507
507
  const p = document.createElement("span");
508
508
  p.id = Ye(o), p.className = "highlight-marker-end", p.dataset.highlightId = o || "";
509
- const y = t.cloneRange();
510
- y.collapse(!1), y.insertNode(p);
511
509
  const b = t.cloneRange();
512
- b.collapse(!0), b.insertNode(f);
513
- const P = document.createRange();
514
- P.setStartAfter(f), P.setEndBefore(p);
515
- const R = Mt(P).filter((E) => E.textContent && E.textContent.length > 0);
516
- R.forEach((E, T) => {
517
- var q;
518
- const C = E.parentElement;
519
- if ((C == null ? void 0 : C.dataset.highlightId) === o) return;
520
- const L = T === 0, w = T === R.length - 1, H = R.length === 1;
521
- let j;
522
- H ? j = "single" : L ? j = "first" : w ? j = "last" : j = "middle";
523
- const x = document.createElement("span");
524
- x.className = "highlight-content", x.dataset.highlightId = o || "", x.dataset.position = j, x.style.backgroundColor = m, x.style.textDecorationLine = "underline", x.style.textDecorationColor = c, x.style.textDecorationStyle = h, x.style.textDecorationThickness = n.borderWidthSmall, x.style.textUnderlineOffset = n.underlineOffset, x.style.cursor = "pointer", x.addEventListener("click", (G) => {
525
- var _;
526
- G.target.tagName !== "A" && ((_ = e.onClick) == null || _.call(e));
527
- }), (q = E.parentNode) == null || q.insertBefore(x, E), x.appendChild(E);
528
- }), f.addEventListener("click", (E) => {
529
- var T;
530
- E.target.tagName !== "A" && ((T = e.onClick) == null || T.call(e));
531
- }), f.addEventListener("keydown", (E) => {
532
- var T;
533
- if (E.key === "Enter" || E.key === " ")
534
- E.preventDefault(), (T = e.onClick) == null || T.call(e);
535
- else if (E.key === "Tab" && !E.shiftKey) {
536
- const C = document.querySelectorAll(ce(o));
537
- for (const L of C) {
538
- const w = L.querySelector("a");
539
- if (w) {
540
- E.preventDefault(), w.focus();
510
+ b.collapse(!1), b.insertNode(p);
511
+ const y = t.cloneRange();
512
+ y.collapse(!0), y.insertNode(c);
513
+ const N = document.createRange();
514
+ N.setStartAfter(c), N.setEndBefore(p);
515
+ const O = Bt(N).filter((m) => m.textContent && m.textContent.length > 0);
516
+ O.forEach((m, E) => {
517
+ var W;
518
+ const I = m.parentElement;
519
+ if ((I == null ? void 0 : I.dataset.highlightId) === o) return;
520
+ const L = E === 0, F = E === O.length - 1, z = O.length === 1;
521
+ let B;
522
+ z ? B = "single" : L ? B = "first" : F ? B = "last" : B = "middle";
523
+ const k = document.createElement("span");
524
+ k.className = "highlight-content", k.dataset.highlightId = o || "", k.dataset.position = B, k.style.backgroundColor = g, k.style.textDecorationLine = "underline", k.style.textDecorationColor = d, k.style.textDecorationStyle = h, k.style.textDecorationThickness = n.borderWidthSmall, k.style.textUnderlineOffset = n.underlineOffset, k.style.cursor = "pointer", k.addEventListener("click", (X) => {
525
+ var H;
526
+ X.target.tagName !== "A" && ((H = e.onClick) == null || H.call(e));
527
+ }), (W = m.parentNode) == null || W.insertBefore(k, m), k.appendChild(m);
528
+ }), c.addEventListener("click", (m) => {
529
+ var E;
530
+ m.target.tagName !== "A" && ((E = e.onClick) == null || E.call(e));
531
+ }), c.addEventListener("keydown", (m) => {
532
+ var E;
533
+ if (m.key === "Enter" || m.key === " ")
534
+ m.preventDefault(), (E = e.onClick) == null || E.call(e);
535
+ else if (m.key === "Tab" && !m.shiftKey) {
536
+ const I = document.querySelectorAll(ce(o));
537
+ for (const L of I) {
538
+ const F = L.querySelector("a");
539
+ if (F) {
540
+ m.preventDefault(), F.focus();
541
541
  break;
542
542
  }
543
543
  }
544
544
  }
545
- }), f.addEventListener("focus", () => {
545
+ }), c.addEventListener("focus", () => {
546
546
  document.querySelectorAll(
547
547
  `.highlight-content${ce(o)}`
548
- ).forEach((T) => {
549
- T.style.boxShadow = `0 0 0 ${Lt} ${n.colors.focusOutline}`, T.style.borderRadius = _t;
548
+ ).forEach((E) => {
549
+ E.style.boxShadow = `0 0 0 ${Pt} ${n.colors.focusOutline}`, E.style.borderRadius = _t;
550
550
  });
551
- }), f.addEventListener("blur", () => {
551
+ }), c.addEventListener("blur", () => {
552
552
  document.querySelectorAll(
553
553
  `.highlight-content${ce(o)}`
554
- ).forEach((T) => {
555
- T.style.boxShadow = "", T.style.borderRadius = "";
554
+ ).forEach((E) => {
555
+ E.style.boxShadow = "", E.style.borderRadius = "";
556
556
  });
557
557
  });
558
558
  };
559
559
  function $t(t, e) {
560
- const n = t.type === k.IMPORTANT ? e.colors.importantBackground : e.colors.confusingBackground, o = t.id === t.selectedNoteId, r = o ? n : De(n, 0.5);
560
+ const n = t.type === x.IMPORTANT ? e.colors.importantBackground : e.colors.confusingBackground, o = t.id === t.selectedNoteId, r = o ? n : Le(n, 0.5);
561
561
  document.querySelectorAll(
562
562
  ce(t.id ?? "")
563
563
  ).forEach((l) => {
@@ -568,7 +568,7 @@ function $t(t, e) {
568
568
  );
569
569
  a && a.setAttribute("aria-expanded", String(o && !!t.isTrayOpen));
570
570
  }
571
- const Ht = (t) => {
571
+ const Ut = (t) => {
572
572
  const e = t.id ?? "", n = document.getElementById(ye(e)), o = document.getElementById(Ye(e));
573
573
  document.querySelectorAll(
574
574
  ce(e)
@@ -582,7 +582,7 @@ const Ht = (t) => {
582
582
  all: ["notebook"],
583
583
  notes: (t) => ["notebook", "notes", t]
584
584
  };
585
- function Ut(t) {
585
+ function Gt(t) {
586
586
  const e = Ie();
587
587
  return xe({
588
588
  mutationFn: (n) => t.createNote(n),
@@ -611,7 +611,7 @@ function ve({
611
611
  enabled: e
612
612
  });
613
613
  }
614
- function Gt(t) {
614
+ function zt(t) {
615
615
  const e = Ie();
616
616
  return xe({
617
617
  mutationFn: ({ id: n, input: o }) => t.updateNote(n, o),
@@ -619,11 +619,11 @@ function Gt(t) {
619
619
  await e.cancelQueries({ queryKey: ae.all });
620
620
  const s = e.getQueryCache().findAll({ queryKey: ae.all }), a = /* @__PURE__ */ new Map();
621
621
  for (const l of s) {
622
- const m = l.state.data;
623
- m && (a.set(l.queryKey, m), e.setQueryData(l.queryKey, {
624
- ...m,
625
- notes: m.notes.map(
626
- (c) => c.id === n ? { ...c, ...o, updatedAt: (/* @__PURE__ */ new Date()).toISOString() } : c
622
+ const g = l.state.data;
623
+ g && (a.set(l.queryKey, g), e.setQueryData(l.queryKey, {
624
+ ...g,
625
+ notes: g.notes.map(
626
+ (d) => d.id === n ? { ...d, ...o, updatedAt: (/* @__PURE__ */ new Date()).toISOString() } : d
627
627
  )
628
628
  }));
629
629
  }
@@ -639,57 +639,57 @@ function Gt(t) {
639
639
  }
640
640
  });
641
641
  }
642
- const zt = "Notebook", Wt = "Notes", qt = "Important", Kt = "Unclear", Xt = "Back", Qt = "Edit note", Yt = "Save", Vt = "Cancel", Zt = "Delete note", Jt = "note", en = "Add note (optional)", tn = "Remove from Notebook", nn = "Add a note (optional)", on = "Mark important", rn = "Mark unclear", sn = "Saved to Notebook.", an = "Note updated", ln = "Note deleted", cn = "Error saving to Notebook.", dn = "Error updating note", un = "Note deletion failed", fn = "Loading notes", mn = "Failed to load notes", gn = "Start capturing your notes", hn = "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.", pn = "Nothing here yet", Nn = "Adjust your filters or create a new note to get started.", yn = "You have no notes for the selected filter", bn = "Filter", En = "Previous page", Sn = "Next page", Tn = "All courses", vn = "All notes", Cn = "Close Notebook panel", In = "To use the Notebook feature, highlight an excerpt from your learning material to flag it as 'confusing' or 'important' and leave an optional note.", xn = "The content you highlighted is no longer available.", kn = "Notebook note", Pe = {
643
- notebook: zt,
644
- notes: Wt,
645
- important: qt,
646
- unclear: Kt,
647
- back: Xt,
648
- editNote: Qt,
649
- save: Yt,
650
- cancel: Vt,
651
- deleteNote: Zt,
652
- note: Jt,
653
- addNotePrompt: en,
654
- removeFromNotebook: tn,
655
- addNoteOptional: nn,
656
- markImportant: on,
657
- markUnclear: rn,
658
- savedToNotebook: sn,
659
- noteUpdated: an,
660
- noteDeleted: ln,
661
- errorSavingNote: cn,
662
- errorUpdatingNote: dn,
663
- noteDeletionFailed: un,
664
- loadingNotes: fn,
665
- failedToLoadNotes: mn,
666
- emptyStateHeading: gn,
667
- emptyStateDescription: hn,
668
- nothingHereYet: pn,
669
- adjustFiltersOrCreate: Nn,
670
- noNotesForFilter: yn,
671
- filter: bn,
672
- previousPage: En,
673
- nextPage: Sn,
674
- allCourses: Tn,
675
- allNotes: vn,
676
- closeNotebookPanel: Cn,
677
- featureDescription: In,
678
- highlightUnavailable: xn,
679
- notebookNote: kn
680
- }, Ve = Ge(null);
642
+ const Wt = "Notebook", qt = "Notes", Kt = "Important", Xt = "Unclear", Qt = "Back", Yt = "Edit note", Vt = "Save", Zt = "Cancel", Jt = "Delete note", en = "note", tn = "Add note (optional)", nn = "Remove from Notebook", on = "Add a note (optional)", rn = "Mark important", sn = "Mark unclear", an = "Saved to Notebook.", ln = "Note updated", cn = "Note deleted", dn = "Error saving to Notebook.", un = "Error updating note", fn = "Note deletion failed", mn = "Loading notes", gn = "Failed to load notes", hn = "Start capturing your notes", pn = "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.", Nn = "Nothing here yet", yn = "Adjust your filters or create a new note to get started.", bn = "You have no notes for the selected filter", En = "Filter", Sn = "Previous page", Tn = "Next page", vn = "All courses", Cn = "All notes", In = "Close Notebook panel", xn = "To use the Notebook feature, highlight an excerpt from your learning material to flag it as 'confusing' or 'important' and leave an optional note.", kn = "The content you highlighted is no longer available.", wn = "Notebook note", De = {
643
+ notebook: Wt,
644
+ notes: qt,
645
+ important: Kt,
646
+ unclear: Xt,
647
+ back: Qt,
648
+ editNote: Yt,
649
+ save: Vt,
650
+ cancel: Zt,
651
+ deleteNote: Jt,
652
+ note: en,
653
+ addNotePrompt: tn,
654
+ removeFromNotebook: nn,
655
+ addNoteOptional: on,
656
+ markImportant: rn,
657
+ markUnclear: sn,
658
+ savedToNotebook: an,
659
+ noteUpdated: ln,
660
+ noteDeleted: cn,
661
+ errorSavingNote: dn,
662
+ errorUpdatingNote: un,
663
+ noteDeletionFailed: fn,
664
+ loadingNotes: mn,
665
+ failedToLoadNotes: gn,
666
+ emptyStateHeading: hn,
667
+ emptyStateDescription: pn,
668
+ nothingHereYet: Nn,
669
+ adjustFiltersOrCreate: yn,
670
+ noNotesForFilter: bn,
671
+ filter: En,
672
+ previousPage: Sn,
673
+ nextPage: Tn,
674
+ allCourses: vn,
675
+ allNotes: Cn,
676
+ closeNotebookPanel: In,
677
+ featureDescription: xn,
678
+ highlightUnavailable: kn,
679
+ notebookNote: wn
680
+ }, Ve = je(null);
681
681
  function Ze(t, e) {
682
- const n = Pe[t] ?? t;
682
+ const n = De[t] ?? t;
683
683
  return e ? n.replace(/%\{([^}]+)}/g, (o, r) => String(e[r] ?? `%{${r}}`)) : n;
684
684
  }
685
- function wn({
685
+ function On({
686
686
  translations: t,
687
687
  translate: e,
688
688
  children: n
689
689
  }) {
690
- const o = de(
690
+ const o = ge(
691
691
  () => ({
692
- translations: { ...Pe, ...t },
692
+ translations: { ...De, ...t },
693
693
  translate: e ?? Ze
694
694
  }),
695
695
  [t, e]
@@ -698,14 +698,14 @@ function wn({
698
698
  }
699
699
  function Z() {
700
700
  const t = ze(Ve);
701
- return t || { translations: Pe, translate: Ze };
701
+ return t || { translations: De, translate: Ze };
702
702
  }
703
- const On = (t) => ({
703
+ const Rn = (t) => ({
704
704
  selectedNoteId: t ?? null,
705
705
  isNoteEditing: !1,
706
706
  isTrayOpen: t != null
707
707
  });
708
- function Rn(t, e) {
708
+ function An(t, e) {
709
709
  switch (e.type) {
710
710
  case "SELECT_NOTE":
711
711
  return {
@@ -725,8 +725,8 @@ function Rn(t, e) {
725
725
  return t;
726
726
  }
727
727
  }
728
- const Je = Ge(null);
729
- function co({
728
+ const Je = je(null);
729
+ function lo({
730
730
  api: t,
731
731
  currentUserId: e,
732
732
  objectId: n,
@@ -735,12 +735,12 @@ function co({
735
735
  pageLastModifiedAt: s,
736
736
  onAnalyticsEvent: a,
737
737
  onOpen: l,
738
- initialNoteId: m,
739
- translations: c,
738
+ initialNoteId: g,
739
+ translations: d,
740
740
  translate: h,
741
- children: g
741
+ children: c
742
742
  }) {
743
- const [f, N] = We(Rn, On(m)), p = X(m != null), y = de(
743
+ const [S, p] = We(An, Rn(g)), b = K(g != null), y = ge(
744
744
  () => ({
745
745
  api: t,
746
746
  currentUserId: e,
@@ -749,15 +749,15 @@ function co({
749
749
  courseId: r,
750
750
  pageLastModifiedAt: s,
751
751
  onAnalyticsEvent: a,
752
- ...f,
753
- selectNote: (b, P = !1) => N({ type: "SELECT_NOTE", payload: { id: b, isEditing: P } }),
754
- clearSelectedNote: () => N({ type: "CLEAR_SELECTED_NOTE" }),
755
- setEditing: (b) => N({ type: "SET_EDITING", payload: b }),
752
+ ...S,
753
+ selectNote: (N, _ = !1) => p({ type: "SELECT_NOTE", payload: { id: N, isEditing: _ } }),
754
+ clearSelectedNote: () => p({ type: "CLEAR_SELECTED_NOTE" }),
755
+ setEditing: (N) => p({ type: "SET_EDITING", payload: N }),
756
756
  openTray: () => {
757
- p.current || (p.current = !0, l == null || l()), N({ type: "OPEN_TRAY" });
757
+ b.current || (b.current = !0, l == null || l()), p({ type: "OPEN_TRAY" });
758
758
  },
759
759
  closeTray: () => {
760
- p.current = !1, N({ type: "CLOSE_TRAY" });
760
+ b.current = !1, p({ type: "CLOSE_TRAY" });
761
761
  }
762
762
  }),
763
763
  [
@@ -769,10 +769,10 @@ function co({
769
769
  s,
770
770
  a,
771
771
  l,
772
- f
772
+ S
773
773
  ]
774
774
  );
775
- return /* @__PURE__ */ i(Je.Provider, { value: y, children: /* @__PURE__ */ i(wn, { translations: c, translate: h, children: g }) });
775
+ return /* @__PURE__ */ i(Je.Provider, { value: y, children: /* @__PURE__ */ i(On, { translations: d, translate: h, children: c }) });
776
776
  }
777
777
  function et() {
778
778
  const t = ze(Je);
@@ -780,7 +780,7 @@ function et() {
780
780
  throw new Error("useNotebook must be used within a NotebookProvider");
781
781
  return t;
782
782
  }
783
- const tt = "notebook-tray-content", uo = ({ children: t }) => {
783
+ const tt = "notebook-tray-content", co = ({ children: t }) => {
784
784
  const { isTrayOpen: e, closeTray: n } = et(), { translations: o } = Z();
785
785
  return /* @__PURE__ */ i(
786
786
  ct,
@@ -790,8 +790,8 @@ const tt = "notebook-tray-content", uo = ({ children: t }) => {
790
790
  onDismiss: n,
791
791
  placement: "end",
792
792
  size: "regular",
793
- children: /* @__PURE__ */ S(v, { direction: "column", height: "100vh", id: tt, children: [
794
- /* @__PURE__ */ i(v.Item, { children: /* @__PURE__ */ i(W, { as: "div", padding: "small medium", borderWidth: "0 0 small 0", children: /* @__PURE__ */ S(v, { justifyItems: "space-between", alignItems: "center", children: [
793
+ children: /* @__PURE__ */ T(v, { direction: "column", height: "100vh", id: tt, children: [
794
+ /* @__PURE__ */ i(v.Item, { children: /* @__PURE__ */ i(j, { as: "div", padding: "small medium", borderWidth: "0 0 small 0", children: /* @__PURE__ */ T(v, { justifyItems: "space-between", alignItems: "center", children: [
795
795
  /* @__PURE__ */ i(pe, { level: "h3", children: o.notebook }),
796
796
  /* @__PURE__ */ i(
797
797
  lt,
@@ -807,12 +807,12 @@ const tt = "notebook-tray-content", uo = ({ children: t }) => {
807
807
  ] })
808
808
  }
809
809
  );
810
- }, An = ({ currentType: t, onSelectReaction: e }) => {
811
- const { translations: n } = Z(), o = X(null), r = X(null);
810
+ }, Ln = ({ currentType: t, onSelectReaction: e }) => {
811
+ const { translations: n } = Z(), o = K(null), r = K(null);
812
812
  return V(() => {
813
- t === k.CONFUSING && o.current ? o.current.focus() : t === k.IMPORTANT && r.current ? r.current.focus() : o.current && o.current.focus();
813
+ t === x.CONFUSING && o.current ? o.current.focus() : t === x.IMPORTANT && r.current ? r.current.focus() : o.current && o.current.focus();
814
814
  }, [t]), /* @__PURE__ */ i(
815
- W,
815
+ j,
816
816
  {
817
817
  as: "div",
818
818
  background: "primary",
@@ -820,23 +820,23 @@ const tt = "notebook-tray-content", uo = ({ children: t }) => {
820
820
  borderColor: "secondary",
821
821
  borderRadius: "medium",
822
822
  shadow: "resting",
823
- children: /* @__PURE__ */ S(ie, { children: [
824
- /* @__PURE__ */ S(
823
+ children: /* @__PURE__ */ T(ie, { children: [
824
+ /* @__PURE__ */ T(
825
825
  ie.Item,
826
826
  {
827
827
  ref: o,
828
- onClick: () => e(k.CONFUSING),
828
+ onClick: () => e(x.CONFUSING),
829
829
  children: [
830
830
  /* @__PURE__ */ i(ke, { size: "x-small" }),
831
831
  ` ${n.markUnclear}`
832
832
  ]
833
833
  }
834
834
  ),
835
- /* @__PURE__ */ S(
835
+ /* @__PURE__ */ T(
836
836
  ie.Item,
837
837
  {
838
838
  ref: r,
839
- onClick: () => e(k.IMPORTANT),
839
+ onClick: () => e(x.IMPORTANT),
840
840
  children: [
841
841
  /* @__PURE__ */ i(we, { size: "x-small" }),
842
842
  ` ${n.markImportant}`
@@ -847,7 +847,7 @@ const tt = "notebook-tray-content", uo = ({ children: t }) => {
847
847
  }
848
848
  );
849
849
  }, be = "notebook-inline-reaction-menu";
850
- function fo({
850
+ function uo({
851
851
  containerRef: t,
852
852
  highlightTheme: e,
853
853
  debounceTime: n = 500,
@@ -858,162 +858,162 @@ function fo({
858
858
  const {
859
859
  api: a,
860
860
  objectId: l,
861
- objectType: m,
862
- courseId: c,
861
+ objectType: g,
862
+ courseId: d,
863
863
  pageLastModifiedAt: h,
864
- selectedNoteId: g,
865
- isTrayOpen: f,
866
- selectNote: N,
867
- openTray: p
868
- } = et(), { translations: y } = Z(), { data: b } = ve({
864
+ selectedNoteId: c,
865
+ isTrayOpen: S,
866
+ selectNote: p,
867
+ openTray: b
868
+ } = et(), { translations: y } = Z(), { data: N } = ve({
869
869
  api: a,
870
870
  filter: {
871
- learningObject: { type: m, id: l }
871
+ learningObject: { type: g, id: l }
872
872
  },
873
- courseId: c,
873
+ courseId: d,
874
874
  pageSize: 100
875
- }), { mutate: P } = Ut(a), { mutateAsync: M } = Gt(a), { mutate: R } = jt(a), E = X([]), [T, C] = U([]), [L, w] = U(null), [H, j] = U(""), [x, q] = U(null), [G, _] = U(!1);
875
+ }), { mutate: _ } = Gt(a), { mutateAsync: O } = zt(a), { mutate: m } = jt(a), E = K([]), [I, L] = U([]), [F, z] = U(null), [B, k] = U(""), [W, X] = U(null), [H, $] = U(!1);
876
876
  V(() => {
877
- const A = t.current;
878
- if (!A) return;
879
- const u = A.closest(".user_content") ?? A;
880
- if (u.classList.contains("enhanced")) {
881
- _(!0);
877
+ const R = t.current;
878
+ if (!R) return;
879
+ const f = R.closest(".user_content") ?? R;
880
+ if (f.classList.contains("enhanced")) {
881
+ $(!0);
882
882
  return;
883
883
  }
884
- const O = new MutationObserver((F) => {
885
- for (const $ of F)
886
- if ($.type === "attributes" && $.attributeName === "class" && $.target.classList.contains("enhanced")) {
887
- _(!0), O.disconnect();
884
+ const w = new MutationObserver((D) => {
885
+ for (const M of D)
886
+ if (M.type === "attributes" && M.attributeName === "class" && M.target.classList.contains("enhanced")) {
887
+ $(!0), w.disconnect();
888
888
  return;
889
889
  }
890
890
  });
891
- return O.observe(u, { attributes: !0, attributeFilter: ["class"] }), () => O.disconnect();
891
+ return w.observe(f, { attributes: !0, attributeFilter: ["class"] }), () => w.disconnect();
892
892
  }, [t]);
893
- const K = Y(() => {
894
- q(null), w(null), j("");
893
+ const q = Y(() => {
894
+ X(null), z(null), k("");
895
895
  }, []);
896
896
  V(() => {
897
- if (!G || !t.current) return;
898
- let u = null;
899
- const O = () => {
900
- u && clearTimeout(u), u = setTimeout(() => {
897
+ if (!H || !t.current) return;
898
+ let f = null;
899
+ const w = () => {
900
+ f && clearTimeout(f), f = setTimeout(() => {
901
901
  var _e;
902
- const I = window.getSelection(), B = t.current;
903
- if (!(I != null && I.rangeCount) || !B) return;
904
- const re = I.toString().trim();
902
+ const C = window.getSelection(), P = t.current;
903
+ if (!(C != null && C.rangeCount) || !P) return;
904
+ const re = C.toString().trim();
905
905
  if (re === "") return;
906
- const se = I.getRangeAt(0);
907
- if (!B.contains(se.commonAncestorContainer)) return;
908
- const Le = (_e = ne.fromRange(B, se)) == null ? void 0 : _e.toSelector();
909
- Le && !Pt(Le, T) && (w(se.cloneRange()), j(re), q(Dt(se)));
906
+ const se = C.getRangeAt(0);
907
+ if (!P.contains(se.commonAncestorContainer)) return;
908
+ const Pe = (_e = ne.fromRange(P, se)) == null ? void 0 : _e.toSelector();
909
+ Pe && !Dt(Pe, I) && (z(se.cloneRange()), k(re), X(Lt(se)));
910
910
  }, n);
911
- }, F = (I) => {
912
- if (!(I.target instanceof Node)) return;
913
- const B = document.getElementById(be);
914
- B != null && B.contains(I.target) ? (I.preventDefault(), I.stopImmediatePropagation()) : K();
915
- }, $ = () => {
916
- K();
917
- }, D = (I) => {
918
- I.key === "Escape" && K();
911
+ }, D = (C) => {
912
+ if (!(C.target instanceof Node)) return;
913
+ const P = document.getElementById(be);
914
+ P != null && P.contains(C.target) ? (C.preventDefault(), C.stopImmediatePropagation()) : q();
915
+ }, M = () => {
916
+ q();
917
+ }, A = (C) => {
918
+ C.key === "Escape" && q();
919
919
  };
920
- return document.addEventListener("selectionchange", O), document.addEventListener("mousedown", F), document.addEventListener("touchstart", F), document.addEventListener("keydown", D), window.addEventListener("scroll", $, !0), () => {
921
- u && clearTimeout(u), document.removeEventListener("selectionchange", O), document.removeEventListener("mousedown", F), document.removeEventListener("touchstart", F), document.removeEventListener("keydown", D), window.removeEventListener("scroll", $, !0);
920
+ return document.addEventListener("selectionchange", w), document.addEventListener("mousedown", D), document.addEventListener("touchstart", D), document.addEventListener("keydown", A), window.addEventListener("scroll", M, !0), () => {
921
+ f && clearTimeout(f), document.removeEventListener("selectionchange", w), document.removeEventListener("mousedown", D), document.removeEventListener("touchstart", D), document.removeEventListener("keydown", A), window.removeEventListener("scroll", M, !0);
922
922
  };
923
- }, [G, T, n, t, K]);
923
+ }, [H, I, n, t, q]);
924
924
  const Q = Y(
925
- (A) => {
926
- var B;
927
- const u = t.current;
928
- if (!u || !A.highlightData) return null;
929
- const { highlightData: O, reaction: F, id: $ } = A, { range: D } = O, I = D && ((B = oe.fromSelector(u, D)) == null ? void 0 : B.toRange());
930
- if (I) {
931
- const re = F[0] === k.IMPORTANT ? y.important : y.unclear, se = {
932
- id: $,
933
- selectedNoteId: g,
934
- type: F[0],
935
- isTrayOpen: f,
925
+ (R) => {
926
+ var P;
927
+ const f = t.current;
928
+ if (!f || !R.highlightData) return null;
929
+ const { highlightData: w, reaction: D, id: M } = R, { range: A } = w, C = A && ((P = oe.fromSelector(f, A)) == null ? void 0 : P.toRange());
930
+ if (C) {
931
+ const re = D[0] === x.IMPORTANT ? y.important : y.unclear, se = {
932
+ id: M,
933
+ selectedNoteId: c,
934
+ type: D[0],
935
+ isTrayOpen: S,
936
936
  labelPrefix: `${y.notebookNote} (${re})`,
937
937
  popupId: tt,
938
938
  onClick: () => {
939
- N($), p();
939
+ p(M), b();
940
940
  }
941
941
  };
942
- return Bt(I, se, e), O.textPosition;
942
+ return Ht(C, se, e), w.textPosition;
943
943
  }
944
944
  return null;
945
945
  },
946
- [t, g, f, e, y, N, p]
946
+ [t, c, S, e, y, p, b]
947
947
  );
948
948
  V(() => {
949
- if (!G || !b || !t.current) return;
950
- const A = t.current, u = b.notes, O = /* @__PURE__ */ new Set(), F = [], $ = [];
951
- if (u.length === 0) {
949
+ if (!H || !N || !t.current) return;
950
+ const R = t.current, f = N.notes, w = /* @__PURE__ */ new Set(), D = [], M = [];
951
+ if (f.length === 0) {
952
952
  if (E.current.length > 0) {
953
- for (const D of E.current)
954
- Ue(D, A);
955
- E.current = [], C([]);
953
+ for (const A of E.current)
954
+ Ue(A, R);
955
+ E.current = [], L([]);
956
956
  }
957
957
  return;
958
958
  }
959
- if (h && u[0].highlightData.pageLastModifiedAt !== h) {
960
- const { notesForUpdate: D, noteIdsForDelete: I } = Rt(
961
- A,
962
- u,
959
+ if (h && f[0].highlightData.pageLastModifiedAt !== h) {
960
+ const { notesForUpdate: A, noteIdsForDelete: C } = Rt(
961
+ R,
962
+ f,
963
963
  h
964
964
  );
965
- for (const B of D)
966
- M({ id: B.id, input: B }).catch((re) => r == null ? void 0 : r(re));
967
- for (const B of I)
968
- R(B, { onError: s });
965
+ for (const P of A)
966
+ O({ id: P.id, input: P }).catch((re) => r == null ? void 0 : r(re));
967
+ for (const P of C)
968
+ m(P, { onError: s });
969
969
  } else {
970
- for (const D of u) {
971
- const I = Q(D);
972
- O.add(D.id), I && (F.push(D), $.push(I));
970
+ for (const A of f) {
971
+ const C = Q(A);
972
+ w.add(A.id), C && (D.push(A), M.push(C));
973
973
  }
974
- for (const D of E.current)
975
- O.has(D.id) || Ue(D, A);
976
- C($), E.current = F, g && At(g);
974
+ for (const A of E.current)
975
+ w.has(A.id) || Ue(A, R);
976
+ L(M), E.current = D, c && At(c);
977
977
  }
978
978
  }, [
979
- G,
980
- b,
979
+ H,
980
+ N,
981
981
  Q,
982
982
  h,
983
983
  t,
984
- M,
985
- R,
986
- g
984
+ O,
985
+ m,
986
+ c
987
987
  ]);
988
- const ue = (A) => {
989
- const u = t.current;
990
- if (!L || !u) return;
991
- const O = oe.fromRange(u, L), F = ne.fromRange(u, L);
992
- P(
988
+ const de = (R) => {
989
+ const f = t.current;
990
+ if (!F || !f) return;
991
+ const w = oe.fromRange(f, F), D = ne.fromRange(f, F);
992
+ _(
993
993
  {
994
- courseId: c,
994
+ courseId: d,
995
995
  objectId: l,
996
- objectType: m,
996
+ objectType: g,
997
997
  userText: "",
998
- reaction: [A],
998
+ reaction: [R],
999
999
  highlightData: {
1000
- selectedText: H,
1001
- textPosition: (F == null ? void 0 : F.toSelector()) ?? null,
1002
- range: O.toSelector(),
1000
+ selectedText: B,
1001
+ textPosition: (D == null ? void 0 : D.toSelector()) ?? null,
1002
+ range: w.toSelector(),
1003
1003
  pageLastModifiedAt: h ?? ""
1004
1004
  }
1005
1005
  },
1006
1006
  {
1007
- onSuccess: ($) => {
1008
- var I;
1009
- const D = $.id;
1010
- K(), (I = window.getSelection()) == null || I.removeAllRanges(), N(D), p();
1007
+ onSuccess: (M) => {
1008
+ var C;
1009
+ const A = M.id;
1010
+ q(), (C = window.getSelection()) == null || C.removeAllRanges(), p(A), b();
1011
1011
  },
1012
1012
  onError: o
1013
1013
  }
1014
1014
  );
1015
1015
  };
1016
- return !L || !x ? null : st(
1016
+ return !F || !W ? null : st(
1017
1017
  /* @__PURE__ */ i(
1018
1018
  "div",
1019
1019
  {
@@ -1022,33 +1022,33 @@ function fo({
1022
1022
  style: {
1023
1023
  position: "fixed",
1024
1024
  zIndex: 100,
1025
- top: x.top,
1026
- left: x.left,
1025
+ top: W.top,
1026
+ left: W.left,
1027
1027
  whiteSpace: "nowrap"
1028
1028
  },
1029
- onBlur: (A) => {
1030
- const u = document.getElementById(be);
1031
- u != null && u.contains(A.relatedTarget) || K();
1029
+ onBlur: (R) => {
1030
+ const f = document.getElementById(be);
1031
+ f != null && f.contains(R.relatedTarget) || q();
1032
1032
  },
1033
- children: /* @__PURE__ */ i(An, { onSelectReaction: ue })
1033
+ children: /* @__PURE__ */ i(Ln, { onSelectReaction: de })
1034
1034
  }
1035
1035
  ),
1036
1036
  document.body
1037
1037
  );
1038
1038
  }
1039
1039
  const Dn = (t, e) => ({
1040
- backgroundColor: t === k.IMPORTANT ? e.colors.importantBackground : e.colors.confusingBackground,
1041
- underlineColor: t === k.IMPORTANT ? e.colors.importantUnderline : e.colors.confusingUnderline,
1042
- underlineStyle: t === k.IMPORTANT ? "solid" : "dashed"
1040
+ backgroundColor: t === x.IMPORTANT ? e.colors.importantBackground : e.colors.confusingBackground,
1041
+ underlineColor: t === x.IMPORTANT ? e.colors.importantUnderline : e.colors.confusingUnderline,
1042
+ underlineStyle: t === x.IMPORTANT ? "solid" : "dashed"
1043
1043
  }), Ce = ({
1044
1044
  children: t,
1045
- type: e = k.IMPORTANT,
1045
+ type: e = x.IMPORTANT,
1046
1046
  isCardActive: n = !0,
1047
1047
  theme: o
1048
1048
  }) => {
1049
1049
  const r = Dn(e, o), a = {
1050
1050
  position: "relative",
1051
- backgroundColor: n ? r.backgroundColor : De(r.backgroundColor, 0.5),
1051
+ backgroundColor: n ? r.backgroundColor : Le(r.backgroundColor, 0.5),
1052
1052
  textDecorationLine: "underline",
1053
1053
  textDecorationStyle: r.underlineStyle,
1054
1054
  textDecorationColor: r.underlineColor,
@@ -1059,45 +1059,45 @@ const Dn = (t, e) => ({
1059
1059
  return /* @__PURE__ */ i("span", { "data-note-highlight": "true", style: a, children: t });
1060
1060
  }, nt = () => {
1061
1061
  const { translations: t } = Z();
1062
- return /* @__PURE__ */ S(v, { gap: "xx-small", alignItems: "start", as: "div", children: [
1062
+ return /* @__PURE__ */ T(v, { gap: "xx-small", alignItems: "start", as: "div", children: [
1063
1063
  /* @__PURE__ */ i(v.Item, { as: "div", children: /* @__PURE__ */ i(dt, { color: "error" }) }),
1064
1064
  /* @__PURE__ */ i(v.Item, { padding: "xxx-small none", shouldShrink: !0, children: /* @__PURE__ */ i(Te, { maxLines: 3, children: t.highlightUnavailable }) })
1065
1065
  ] });
1066
- }, Pn = 100, Ln = {
1066
+ }, Pn = 100, _n = {
1067
1067
  filter: null,
1068
1068
  courseFilter: null,
1069
1069
  currentPage: 1,
1070
1070
  totalPages: void 0
1071
1071
  };
1072
- function ge(t, e) {
1072
+ function me(t, e) {
1073
1073
  const n = typeof e == "number" ? Math.min(e, t) : t;
1074
1074
  return Math.max(1, n);
1075
1075
  }
1076
- function _n(t, e) {
1076
+ function Fn(t, e) {
1077
1077
  switch (e.type) {
1078
1078
  case "SET_FILTER":
1079
1079
  return { ...t, filter: e.payload, currentPage: 1 };
1080
1080
  case "SET_COURSE_FILTER":
1081
1081
  return { ...t, courseFilter: e.payload, currentPage: 1 };
1082
1082
  case "SET_PAGE":
1083
- return { ...t, currentPage: ge(e.payload, t.totalPages) };
1083
+ return { ...t, currentPage: me(e.payload, t.totalPages) };
1084
1084
  case "FOCUS_PAGE":
1085
1085
  return { ...t, currentPage: Math.max(1, e.payload) };
1086
1086
  case "INCREMENT_PAGE":
1087
- return { ...t, currentPage: ge(t.currentPage + 1, t.totalPages) };
1087
+ return { ...t, currentPage: me(t.currentPage + 1, t.totalPages) };
1088
1088
  case "DECREMENT_PAGE":
1089
- return { ...t, currentPage: ge(t.currentPage - 1, t.totalPages) };
1089
+ return { ...t, currentPage: me(t.currentPage - 1, t.totalPages) };
1090
1090
  case "SET_TOTAL_PAGES":
1091
1091
  return t.totalPages === e.payload ? t : {
1092
1092
  ...t,
1093
1093
  totalPages: e.payload,
1094
- currentPage: ge(t.currentPage, e.payload)
1094
+ currentPage: me(t.currentPage, e.payload)
1095
1095
  };
1096
1096
  default:
1097
1097
  return t;
1098
1098
  }
1099
1099
  }
1100
- function mo({
1100
+ function fo({
1101
1101
  api: t,
1102
1102
  courseId: e,
1103
1103
  enableCourseFilter: n = !1,
@@ -1105,82 +1105,82 @@ function mo({
1105
1105
  pageSize: r = 16,
1106
1106
  focusNoteId: s
1107
1107
  }) {
1108
- const [a, l] = We(_n, Ln), { filter: m, courseFilter: c, currentPage: h, totalPages: g } = a;
1108
+ const [a, l] = We(Fn, _n), { filter: g, courseFilter: d, currentPage: h, totalPages: c } = a;
1109
1109
  V(() => {
1110
1110
  l({ type: "SET_PAGE", payload: 1 });
1111
1111
  }, [r]);
1112
- const f = n ? c : e, N = (h - 1) * r, p = {
1113
- ...f ? { courseId: f } : {},
1114
- ...m ? { reactions: [m] } : {},
1112
+ const S = n ? d : e, p = (h - 1) * r, b = {
1113
+ ...S ? { courseId: S } : {},
1114
+ ...g ? { reactions: [g] } : {},
1115
1115
  ...o ? { learningObject: o } : {}
1116
- }, { data: y, isLoading: b, isError: P } = ve({
1116
+ }, { data: y, isLoading: N, isError: _ } = ve({
1117
1117
  api: t,
1118
- filter: p,
1119
- offset: N,
1118
+ filter: b,
1119
+ offset: p,
1120
1120
  pageSize: r
1121
- }), { data: M } = ve({
1121
+ }), { data: O } = ve({
1122
1122
  api: t,
1123
- filter: p,
1123
+ filter: b,
1124
1124
  offset: 0,
1125
1125
  pageSize: Pn,
1126
1126
  enabled: !!s
1127
- }), R = X(null);
1127
+ }), m = K(null);
1128
1128
  V(() => {
1129
1129
  if (!s) {
1130
- R.current = null;
1130
+ m.current = null;
1131
1131
  return;
1132
1132
  }
1133
- if (R.current === s) return;
1134
- const _ = (M == null ? void 0 : M.notes.findIndex((Q) => Q.id === s)) ?? -1;
1135
- if (_ === -1) return;
1136
- R.current = s;
1137
- const K = Math.floor(_ / r) + 1;
1138
- K !== h && l({ type: "FOCUS_PAGE", payload: K });
1139
- }, [s, M, r, h]);
1140
- const E = (y == null ? void 0 : y.notes) ?? [], T = y == null ? void 0 : y.pageInfo, C = (T == null ? void 0 : T.totalNrOfPages) ?? void 0, L = s && M ? Math.ceil(M.notes.length / r) : void 0, w = C === void 0 && L === void 0 ? void 0 : Math.max(C ?? 0, L ?? 0);
1133
+ if (m.current === s) return;
1134
+ const $ = (O == null ? void 0 : O.notes.findIndex((Q) => Q.id === s)) ?? -1;
1135
+ if ($ === -1) return;
1136
+ m.current = s;
1137
+ const q = Math.floor($ / r) + 1;
1138
+ q !== h && l({ type: "FOCUS_PAGE", payload: q });
1139
+ }, [s, O, r, h]);
1140
+ const E = (y == null ? void 0 : y.notes) ?? [], I = y == null ? void 0 : y.pageInfo, L = (I == null ? void 0 : I.totalNrOfPages) ?? void 0, F = s && O ? Math.ceil(O.notes.length / r) : void 0, z = L === void 0 && F === void 0 ? void 0 : Math.max(L ?? 0, F ?? 0);
1141
1141
  V(() => {
1142
- l({ type: "SET_TOTAL_PAGES", payload: w });
1143
- }, [w]);
1144
- const H = Y((_) => {
1145
- l({ type: "SET_PAGE", payload: _ });
1146
- }, []), j = Y(() => {
1142
+ l({ type: "SET_TOTAL_PAGES", payload: z });
1143
+ }, [z]);
1144
+ const B = Y(($) => {
1145
+ l({ type: "SET_PAGE", payload: $ });
1146
+ }, []), k = Y(() => {
1147
1147
  l({
1148
1148
  type: "INCREMENT_PAGE"
1149
1149
  /* IncrementPage */
1150
1150
  });
1151
- }, []), x = Y(() => {
1151
+ }, []), W = Y(() => {
1152
1152
  l({
1153
1153
  type: "DECREMENT_PAGE"
1154
1154
  /* DecrementPage */
1155
1155
  });
1156
- }, []), q = Y((_) => {
1157
- l({ type: "SET_FILTER", payload: _ });
1158
- }, []), G = Y((_) => {
1159
- l({ type: "SET_COURSE_FILTER", payload: _ });
1156
+ }, []), X = Y(($) => {
1157
+ l({ type: "SET_FILTER", payload: $ });
1158
+ }, []), H = Y(($) => {
1159
+ l({ type: "SET_COURSE_FILTER", payload: $ });
1160
1160
  }, []);
1161
1161
  return {
1162
1162
  notes: E,
1163
- pageInfo: T,
1164
- isLoading: b,
1165
- isError: P,
1166
- filter: m,
1167
- courseFilter: c,
1163
+ pageInfo: I,
1164
+ isLoading: N,
1165
+ isError: _,
1166
+ filter: g,
1167
+ courseFilter: d,
1168
1168
  currentPage: h,
1169
- totalPages: g,
1170
- setFilter: q,
1171
- setCourseFilter: G,
1172
- setPage: H,
1173
- fetchNextPage: j,
1174
- fetchPreviousPage: x
1169
+ totalPages: c,
1170
+ setFilter: X,
1171
+ setCourseFilter: H,
1172
+ setPage: B,
1173
+ fetchNextPage: k,
1174
+ fetchPreviousPage: W
1175
1175
  };
1176
1176
  }
1177
1177
  const Ee = "all";
1178
- function go({ filter: t, setFilter: e }) {
1179
- const { translations: n } = Z(), o = de(
1178
+ function mo({ filter: t, setFilter: e }) {
1179
+ const { translations: n } = Z(), o = ge(
1180
1180
  () => [
1181
1181
  { label: n.allNotes, value: Ee },
1182
- { label: n.important, value: k.IMPORTANT },
1183
- { label: n.unclear, value: k.CONFUSING }
1182
+ { label: n.important, value: x.IMPORTANT },
1183
+ { label: n.unclear, value: x.CONFUSING }
1184
1184
  ],
1185
1185
  [n]
1186
1186
  ), r = Y(
@@ -1190,7 +1190,7 @@ function go({ filter: t, setFilter: e }) {
1190
1190
  [e]
1191
1191
  );
1192
1192
  return {
1193
- filterElement: de(
1193
+ filterElement: ge(
1194
1194
  () => /* @__PURE__ */ i(
1195
1195
  Fe,
1196
1196
  {
@@ -1206,71 +1206,71 @@ function go({ filter: t, setFilter: e }) {
1206
1206
  handleReactionFilterChange: r
1207
1207
  };
1208
1208
  }
1209
- const Fn = ({ hasActiveFilter: t = !1 }) => {
1209
+ const Mn = ({ hasActiveFilter: t = !1 }) => {
1210
1210
  const { translations: e } = Z(), n = t ? e.nothingHereYet : e.emptyStateHeading, o = t ? e.adjustFiltersOrCreate : e.emptyStateDescription;
1211
- return /* @__PURE__ */ i(W, { as: "div", textAlign: "center", children: /* @__PURE__ */ S(v, { direction: "column", alignItems: "center", gap: "small", children: [
1211
+ return /* @__PURE__ */ i(j, { as: "div", textAlign: "center", children: /* @__PURE__ */ T(v, { direction: "column", alignItems: "center", gap: "small", children: [
1212
1212
  !t && /* @__PURE__ */ i(ut, { size: "medium" }),
1213
1213
  /* @__PURE__ */ i(pe, { level: "h3", children: n }),
1214
1214
  /* @__PURE__ */ i(J, { color: "secondary", children: o })
1215
1215
  ] }) });
1216
- }, Mn = {
1217
- [k.IMPORTANT]: {
1216
+ }, Bn = {
1217
+ [x.IMPORTANT]: {
1218
1218
  color: "success",
1219
1219
  translationKey: "important",
1220
1220
  icon: /* @__PURE__ */ i(we, { size: "x-small" })
1221
1221
  },
1222
- [k.CONFUSING]: {
1222
+ [x.CONFUSING]: {
1223
1223
  color: "danger",
1224
1224
  translationKey: "unclear",
1225
1225
  icon: /* @__PURE__ */ i(ke, { size: "x-small" })
1226
1226
  }
1227
1227
  }, ot = ({ type: t, onTypeChange: e, renderAsMenuTrigger: n = !1 }) => {
1228
- const { translations: o } = Z(), r = Mn[t], s = o[r.translationKey], [a, l] = U(!1), m = X(null), c = X(null), h = Y(
1229
- (g) => {
1230
- e == null || e(g), l(!1);
1228
+ const { translations: o } = Z(), r = Bn[t], s = o[r.translationKey], [a, l] = U(!1), g = K(null), d = K(null), h = Y(
1229
+ (c) => {
1230
+ e == null || e(c), l(!1);
1231
1231
  },
1232
1232
  [e]
1233
1233
  );
1234
1234
  return V(() => {
1235
1235
  if (!a) return;
1236
- const g = (N) => {
1237
- N.key === "Escape" && N.stopPropagation();
1238
- }, f = (N) => {
1239
- N.key === "Escape" && (N.stopPropagation(), l(!1));
1236
+ const c = (p) => {
1237
+ p.key === "Escape" && p.stopPropagation();
1238
+ }, S = (p) => {
1239
+ p.key === "Escape" && (p.stopPropagation(), l(!1));
1240
1240
  };
1241
- return document.addEventListener("keydown", g, !0), document.addEventListener("keyup", f, !0), () => {
1242
- document.removeEventListener("keydown", g, !0), document.removeEventListener("keyup", f, !0);
1241
+ return document.addEventListener("keydown", c, !0), document.addEventListener("keyup", S, !0), () => {
1242
+ document.removeEventListener("keydown", c, !0), document.removeEventListener("keyup", S, !0);
1243
1243
  };
1244
- }, [a]), n && e ? /* @__PURE__ */ S(
1244
+ }, [a]), n && e ? /* @__PURE__ */ T(
1245
1245
  ie,
1246
1246
  {
1247
1247
  placement: "bottom start",
1248
1248
  show: a,
1249
- onToggle: (g) => l(g),
1249
+ onToggle: (c) => l(c),
1250
1250
  shouldHideOnSelect: !0,
1251
1251
  shouldFocusTriggerOnClose: !0,
1252
1252
  trigger: /* @__PURE__ */ i(Me, { color: r.color, renderIcon: r.icon, children: s }),
1253
1253
  children: [
1254
- /* @__PURE__ */ S(ie.Item, { ref: m, onClick: () => h(k.CONFUSING), children: [
1254
+ /* @__PURE__ */ T(ie.Item, { ref: g, onClick: () => h(x.CONFUSING), children: [
1255
1255
  /* @__PURE__ */ i(ke, { size: "x-small" }),
1256
1256
  ` ${o.markUnclear}`
1257
1257
  ] }),
1258
- /* @__PURE__ */ S(ie.Item, { ref: c, onClick: () => h(k.IMPORTANT), children: [
1258
+ /* @__PURE__ */ T(ie.Item, { ref: d, onClick: () => h(x.IMPORTANT), children: [
1259
1259
  /* @__PURE__ */ i(we, { size: "x-small" }),
1260
1260
  ` ${o.markImportant}`
1261
1261
  ] })
1262
1262
  ]
1263
1263
  }
1264
- ) : /* @__PURE__ */ i(W, { display: "inline-flex", children: /* @__PURE__ */ i(Me, { color: r.color, renderIcon: r.icon, children: s }) });
1264
+ ) : /* @__PURE__ */ i(j, { display: "inline-flex", children: /* @__PURE__ */ i(Me, { color: r.color, renderIcon: r.icon, children: s }) });
1265
1265
  };
1266
- function je(t, e) {
1266
+ function Ge(t, e) {
1267
1267
  return (t instanceof Date ? t : new Date(t)).toLocaleString(e, {
1268
1268
  year: "numeric",
1269
1269
  month: "short",
1270
1270
  day: "numeric"
1271
1271
  });
1272
1272
  }
1273
- const Bn = ({
1273
+ const Hn = ({
1274
1274
  noteId: t,
1275
1275
  date: e,
1276
1276
  highlight: n,
@@ -1279,90 +1279,91 @@ const Bn = ({
1279
1279
  onClick: s,
1280
1280
  onDelete: a,
1281
1281
  onSaveNote: l,
1282
- onTypeChange: m,
1283
- isActive: c,
1282
+ onTypeChange: g,
1283
+ isActive: d,
1284
1284
  isPanelView: h = !1,
1285
- courseName: g,
1286
- locale: f,
1287
- highlightTheme: N,
1288
- renderLink: p,
1285
+ courseName: c,
1286
+ locale: S,
1287
+ highlightTheme: p,
1288
+ renderLink: b,
1289
1289
  href: y
1290
1290
  }) => {
1291
- const { translations: b } = Z(), [P, M] = U(!1), [R, E] = U(!1), [T, C] = U(o || ""), [L, w] = U(!1), H = X(null), j = Y((u) => {
1292
- H.current = u;
1293
- }, []), x = X(null), q = X(null), G = X(!1);
1291
+ const { translations: N } = Z(), [_, O] = U(!1), [m, E] = U(!1), [I, L] = U(o || ""), [F, z] = U(!1), B = K(null), k = Y((f) => {
1292
+ B.current = f;
1293
+ }, []), W = K(null), X = K(null), H = K(!1);
1294
1294
  V(() => {
1295
- var u, O;
1296
- c && ((u = H.current) == null || u.scrollIntoView({ behavior: "smooth", block: "nearest" }), (O = H.current) == null || O.focus());
1297
- }, [c]), V(() => {
1298
- var u, O;
1299
- R ? (G.current = !0, (u = x.current) == null || u.focus()) : G.current && (G.current = !1, (O = q.current) == null || O.focus());
1300
- }, [R]);
1301
- const _ = r === k.IMPORTANT ? b.important : b.unclear, K = (u) => {
1302
- u.key === "Enter" && (u.preventDefault(), s == null || s());
1303
- }, Q = [_, b.note];
1304
- n && Q.push(n), o && Q.push(o), e && Q.push(je(e, f)), g && Q.push(g);
1305
- const ue = Q.join(", "), A = /* @__PURE__ */ S(
1306
- W,
1295
+ var f, w;
1296
+ d && ((f = B.current) == null || f.scrollIntoView({ behavior: "smooth", block: "nearest" }), (w = B.current) == null || w.focus());
1297
+ }, [d]), V(() => {
1298
+ var f, w;
1299
+ m ? (H.current = !0, (f = W.current) == null || f.focus()) : H.current && (H.current = !1, (w = X.current) == null || w.focus());
1300
+ }, [m]);
1301
+ const $ = r === x.IMPORTANT ? N.important : N.unclear, q = (f) => {
1302
+ f.key === "Enter" && (f.preventDefault(), s == null || s());
1303
+ }, Q = [$, N.note];
1304
+ n && Q.push(n), o && Q.push(o), e && Q.push(Ge(e, S)), c && Q.push(c);
1305
+ const de = Q.join(", "), R = /* @__PURE__ */ T(
1306
+ j,
1307
1307
  {
1308
1308
  as: "div",
1309
+ height: "100%",
1309
1310
  borderWidth: "small",
1310
1311
  borderRadius: "medium",
1311
1312
  padding: "small",
1312
1313
  position: "relative",
1313
- role: y || R ? void 0 : "button",
1314
- "aria-label": y ? void 0 : ue,
1315
- "aria-pressed": y || R ? void 0 : c,
1316
- tabIndex: y || c ? -1 : 0,
1314
+ role: y || m ? void 0 : "button",
1315
+ "aria-label": y ? void 0 : de,
1316
+ "aria-pressed": y || m ? void 0 : d,
1317
+ tabIndex: y || d ? -1 : 0,
1317
1318
  "data-testid": `note-card-${t}`,
1318
- elementRef: j,
1319
- onClick: c ? void 0 : s,
1320
- onMouseEnter: () => M(!0),
1321
- onMouseLeave: () => M(!1),
1322
- onKeyDown: c ? void 0 : K,
1323
- cursor: R ? "default" : "pointer",
1319
+ elementRef: k,
1320
+ onClick: d ? void 0 : s,
1321
+ onMouseEnter: () => O(!0),
1322
+ onMouseLeave: () => O(!1),
1323
+ onKeyDown: d ? void 0 : q,
1324
+ cursor: m ? "default" : "pointer",
1324
1325
  children: [
1325
- /* @__PURE__ */ S(v, { direction: "column", gap: "small", children: [
1326
+ /* @__PURE__ */ T(v, { direction: "column", gap: "small", height: "100%", children: [
1326
1327
  /* @__PURE__ */ i(
1327
1328
  ot,
1328
1329
  {
1329
1330
  type: r,
1330
- onTypeChange: h && m ? (u) => m(t, u) : void 0,
1331
- renderAsMenuTrigger: h && !!m && !!c
1331
+ onTypeChange: h && g ? (f) => g(t, f) : void 0,
1332
+ renderAsMenuTrigger: h && !!g && !!d
1332
1333
  }
1333
1334
  ),
1334
- n ? /* @__PURE__ */ i("div", { style: { wordBreak: "break-word", overflowWrap: "break-word" }, children: /* @__PURE__ */ i(J, { children: c && h ? /* @__PURE__ */ i(
1335
+ n ? /* @__PURE__ */ i("div", { style: { wordBreak: "break-word", overflowWrap: "break-word" }, children: /* @__PURE__ */ i(J, { children: d && h ? /* @__PURE__ */ i(
1335
1336
  Ce,
1336
1337
  {
1337
1338
  type: r,
1338
- isCardActive: !!c || P,
1339
- theme: N,
1339
+ isCardActive: !!d || _,
1340
+ theme: p,
1340
1341
  children: n
1341
1342
  }
1342
1343
  ) : /* @__PURE__ */ i(Te, { maxLines: 3, truncate: "word", children: /* @__PURE__ */ i(
1343
1344
  Ce,
1344
1345
  {
1345
1346
  type: r,
1346
- isCardActive: !!c || P,
1347
- theme: N,
1347
+ isCardActive: !!d || _,
1348
+ theme: p,
1348
1349
  children: n
1349
1350
  }
1350
1351
  ) }) }) }) : /* @__PURE__ */ i(nt, {}),
1351
- /* @__PURE__ */ S(v, { direction: "column", gap: "small", children: [
1352
- R && h ? /* @__PURE__ */ S(v, { direction: "column", gap: "x-small", children: [
1352
+ /* @__PURE__ */ i(v.Item, { shouldGrow: !0, children: /* @__PURE__ */ T(v, { direction: "column", gap: "small", height: "100%", children: [
1353
+ m && h ? /* @__PURE__ */ T(v, { direction: "column", gap: "x-small", children: [
1353
1354
  /* @__PURE__ */ i(
1354
1355
  qe,
1355
1356
  {
1356
- label: /* @__PURE__ */ i(mt, { children: b.editNote }),
1357
- value: T,
1358
- onChange: (u) => C(u.target.value),
1359
- placeholder: b.addNoteOptional,
1360
- textareaRef: (u) => {
1361
- x.current = u;
1357
+ label: /* @__PURE__ */ i(mt, { children: N.editNote }),
1358
+ value: I,
1359
+ onChange: (f) => L(f.target.value),
1360
+ placeholder: N.addNoteOptional,
1361
+ textareaRef: (f) => {
1362
+ W.current = f;
1362
1363
  }
1363
1364
  }
1364
1365
  ),
1365
- /* @__PURE__ */ S(v, { gap: "xx-small", children: [
1366
+ /* @__PURE__ */ T(v, { gap: "xx-small", children: [
1366
1367
  /* @__PURE__ */ i(v.Item, { shouldGrow: !0, children: /* @__PURE__ */ i(
1367
1368
  ee,
1368
1369
  {
@@ -1370,9 +1371,9 @@ const Bn = ({
1370
1371
  size: "small",
1371
1372
  "data-testid": `note-card-${t}-cancel`,
1372
1373
  onClick: () => {
1373
- C(o || ""), E(!1);
1374
+ L(o || ""), E(!1);
1374
1375
  },
1375
- children: b.cancel
1376
+ children: N.cancel
1376
1377
  }
1377
1378
  ) }),
1378
1379
  /* @__PURE__ */ i(v.Item, { shouldGrow: !0, children: /* @__PURE__ */ i(
@@ -1383,13 +1384,13 @@ const Bn = ({
1383
1384
  size: "small",
1384
1385
  "data-testid": `note-card-${t}-save`,
1385
1386
  onClick: () => {
1386
- l == null || l(t, T.trim()), E(!1);
1387
+ l == null || l(t, I.trim()), E(!1);
1387
1388
  },
1388
- children: b.save
1389
+ children: N.save
1389
1390
  }
1390
1391
  ) })
1391
1392
  ] })
1392
- ] }) : o ? /* @__PURE__ */ i("div", { style: { wordBreak: "break-word", overflowWrap: "break-word" }, children: c && h ? /* @__PURE__ */ S(J, { children: [
1393
+ ] }) : o ? /* @__PURE__ */ i("div", { style: { wordBreak: "break-word", overflowWrap: "break-word" }, children: d && h ? /* @__PURE__ */ T(J, { children: [
1393
1394
  o,
1394
1395
  " ",
1395
1396
  /* @__PURE__ */ i(
@@ -1399,19 +1400,19 @@ const Bn = ({
1399
1400
  withBackground: !1,
1400
1401
  withBorder: !1,
1401
1402
  margin: "0 0 0 xxx-small",
1402
- screenReaderLabel: b.editNote,
1403
+ screenReaderLabel: N.editNote,
1403
1404
  "data-testid": `note-card-${t}-edit`,
1404
- elementRef: (u) => {
1405
- q.current = u;
1405
+ elementRef: (f) => {
1406
+ X.current = f;
1406
1407
  },
1407
- onClick: (u) => {
1408
- u.stopPropagation(), E(!0);
1408
+ onClick: (f) => {
1409
+ f.stopPropagation(), E(!0);
1409
1410
  },
1410
1411
  children: /* @__PURE__ */ i(Se, {})
1411
1412
  }
1412
1413
  )
1413
- ] }) : /* @__PURE__ */ i(J, { children: /* @__PURE__ */ i(Te, { maxLines: 3, truncate: "word", children: o }) }) }) : h && c ? /* @__PURE__ */ i("div", { children: /* @__PURE__ */ S(J, { color: "secondary", children: [
1414
- b.addNotePrompt,
1414
+ ] }) : /* @__PURE__ */ i(J, { children: /* @__PURE__ */ i(Te, { maxLines: 3, truncate: "word", children: o }) }) }) : h && d ? /* @__PURE__ */ i("div", { children: /* @__PURE__ */ T(J, { color: "secondary", children: [
1415
+ N.addNotePrompt,
1415
1416
  " ",
1416
1417
  /* @__PURE__ */ i(
1417
1418
  le,
@@ -1420,41 +1421,41 @@ const Bn = ({
1420
1421
  withBackground: !1,
1421
1422
  withBorder: !1,
1422
1423
  margin: "0 0 0 xxx-small",
1423
- screenReaderLabel: b.editNote,
1424
+ screenReaderLabel: N.editNote,
1424
1425
  "data-testid": `note-card-${t}-edit`,
1425
- elementRef: (u) => {
1426
- q.current = u;
1426
+ elementRef: (f) => {
1427
+ X.current = f;
1427
1428
  },
1428
- onClick: (u) => {
1429
- u.stopPropagation(), E(!0);
1429
+ onClick: (f) => {
1430
+ f.stopPropagation(), E(!0);
1430
1431
  },
1431
1432
  children: /* @__PURE__ */ i(Se, {})
1432
1433
  }
1433
1434
  )
1434
1435
  ] }) }) : null,
1435
- /* @__PURE__ */ S(v, { justifyItems: "space-between", alignItems: "center", children: [
1436
- /* @__PURE__ */ i(J, { size: "small", color: "secondary", children: je(e, f) }),
1437
- c && a && /* @__PURE__ */ i(
1436
+ /* @__PURE__ */ T(v, { justifyItems: "space-between", alignItems: "center", margin: "auto 0 0 0", children: [
1437
+ /* @__PURE__ */ i(J, { size: "small", color: "secondary", children: Ge(e, S) }),
1438
+ d && a && /* @__PURE__ */ i(
1438
1439
  le,
1439
1440
  {
1440
1441
  size: "small",
1441
1442
  withBackground: !1,
1442
1443
  withBorder: !1,
1443
1444
  color: "danger",
1444
- screenReaderLabel: b.deleteNote,
1445
+ screenReaderLabel: N.deleteNote,
1445
1446
  "data-testid": `note-card-${t}-delete`,
1446
- onClick: (u) => {
1447
- u.stopPropagation(), w(!0);
1447
+ onClick: (f) => {
1448
+ f.stopPropagation(), z(!0);
1448
1449
  },
1449
1450
  children: /* @__PURE__ */ i(he, {})
1450
1451
  }
1451
1452
  )
1452
1453
  ] }),
1453
- g && /* @__PURE__ */ i(J, { size: "small", color: "secondary", children: g })
1454
- ] })
1454
+ c && /* @__PURE__ */ i(J, { size: "small", color: "secondary", children: c })
1455
+ ] }) })
1455
1456
  ] }),
1456
- L && a && /* @__PURE__ */ i(
1457
- W,
1457
+ F && a && /* @__PURE__ */ i(
1458
+ j,
1458
1459
  {
1459
1460
  as: "div",
1460
1461
  background: "primary",
@@ -1466,7 +1467,7 @@ const Bn = ({
1466
1467
  insetInlineStart: "0",
1467
1468
  insetInlineEnd: "0",
1468
1469
  stacking: "above",
1469
- children: /* @__PURE__ */ S(
1470
+ children: /* @__PURE__ */ T(
1470
1471
  v,
1471
1472
  {
1472
1473
  direction: "column",
@@ -1483,10 +1484,10 @@ const Bn = ({
1483
1484
  size: "small",
1484
1485
  renderIcon: /* @__PURE__ */ i(he, {}),
1485
1486
  "data-testid": `note-card-${t}-confirm-delete`,
1486
- onClick: (u) => {
1487
- u.stopPropagation(), a(t), w(!1);
1487
+ onClick: (f) => {
1488
+ f.stopPropagation(), a(t), z(!1);
1488
1489
  },
1489
- children: b.deleteNote
1490
+ children: N.deleteNote
1490
1491
  }
1491
1492
  ),
1492
1493
  /* @__PURE__ */ i(
@@ -1495,10 +1496,10 @@ const Bn = ({
1495
1496
  display: "block",
1496
1497
  size: "small",
1497
1498
  "data-testid": `note-card-${t}-cancel-delete`,
1498
- onClick: (u) => {
1499
- u.stopPropagation(), w(!1);
1499
+ onClick: (f) => {
1500
+ f.stopPropagation(), z(!1);
1500
1501
  },
1501
- children: b.cancel
1502
+ children: N.cancel
1502
1503
  }
1503
1504
  )
1504
1505
  ]
@@ -1509,27 +1510,16 @@ const Bn = ({
1509
1510
  ]
1510
1511
  }
1511
1512
  );
1512
- return y && p ? p({ href: y, children: A, ariaLabel: ue }) : A;
1513
- };
1514
- function $n(t, e) {
1515
- const n = Array.from({ length: e }, () => []);
1516
- return t.forEach((o, r) => {
1517
- n[r % e].push(o);
1518
- }), n;
1519
- }
1520
- const Hn = {
1521
- display: "flex",
1513
+ return y && b ? b({ href: y, children: R, ariaLabel: de }) : R;
1514
+ }, $n = {
1515
+ display: "grid",
1522
1516
  gap: "1rem",
1523
1517
  boxSizing: "border-box",
1524
1518
  width: "100%",
1525
- alignItems: "flex-start"
1526
- }, Un = {
1527
- display: "flex",
1528
- flexDirection: "column",
1529
- gap: "1rem",
1530
- flex: 1,
1531
- minWidth: 0
1532
- }, ho = ({
1519
+ margin: 0,
1520
+ padding: 0,
1521
+ listStyle: "none"
1522
+ }, go = ({
1533
1523
  notes: t,
1534
1524
  isLoading: e,
1535
1525
  isError: n,
@@ -1538,69 +1528,70 @@ const Hn = {
1538
1528
  onPageChange: s,
1539
1529
  onNoteSelect: a,
1540
1530
  onNoteDelete: l,
1541
- onNoteSave: m,
1542
- onNoteTypeChange: c,
1531
+ onNoteSave: g,
1532
+ onNoteTypeChange: d,
1543
1533
  selectedNoteId: h,
1544
- hasActiveFilter: g = !1,
1545
- columnCount: f = 1,
1546
- highlightTheme: N,
1547
- locale: p,
1534
+ hasActiveFilter: c = !1,
1535
+ columnCount: S = 1,
1536
+ highlightTheme: p,
1537
+ locale: b,
1548
1538
  renderNoteLink: y,
1549
- noteHref: b
1539
+ noteHref: N
1550
1540
  }) => {
1551
- const { translations: P } = Z(), M = de(
1552
- () => $n(t, f),
1553
- [t, f]
1554
- );
1541
+ const { translations: _ } = Z();
1555
1542
  if (e)
1556
- return /* @__PURE__ */ i(W, { as: "div", textAlign: "center", padding: "large", "data-testid": "notes-loading", children: /* @__PURE__ */ i(ht, { renderTitle: P.loadingNotes }) });
1543
+ return /* @__PURE__ */ i(j, { as: "div", textAlign: "center", padding: "large", "data-testid": "notes-loading", children: /* @__PURE__ */ i(ht, { renderTitle: _.loadingNotes }) });
1557
1544
  if (n)
1558
- return /* @__PURE__ */ i(W, { as: "div", textAlign: "center", padding: "large", "data-testid": "notes-error", children: /* @__PURE__ */ i(pe, { level: "h4", children: P.failedToLoadNotes }) });
1545
+ return /* @__PURE__ */ i(j, { as: "div", textAlign: "center", padding: "large", "data-testid": "notes-error", children: /* @__PURE__ */ i(pe, { level: "h4", children: _.failedToLoadNotes }) });
1559
1546
  if (t.length === 0)
1560
- return /* @__PURE__ */ i(W, { as: "div", padding: "large", "data-testid": "empty-notes", children: /* @__PURE__ */ i(Fn, { hasActiveFilter: g }) });
1561
- const R = typeof o == "number" && typeof r == "number" && r > 1 && s !== void 0;
1562
- return /* @__PURE__ */ S(rt, { children: [
1563
- /* @__PURE__ */ i("div", { style: Hn, "data-testid": "notes-grid", children: M.map((E, T) => (
1564
- // oxlint-disable-next-line react/no-array-index-key -- columns are positional, index is stable
1565
- /* @__PURE__ */ i("div", { style: Un, children: E.map((C) => {
1566
- var L;
1567
- return /* @__PURE__ */ i(
1568
- Bn,
1569
- {
1570
- noteId: C.id,
1571
- date: C.createdAt,
1572
- type: C.reaction[0] ?? k.IMPORTANT,
1573
- highlight: (L = C.highlightData) == null ? void 0 : L.selectedText,
1574
- note: C.userText,
1575
- isActive: h === C.id,
1576
- isPanelView: !!h,
1577
- onClick: a ? () => a(C.id) : void 0,
1578
- onDelete: l ? (w) => l(w) : void 0,
1579
- onSaveNote: m ? (w, H) => m(w, H) : void 0,
1580
- onTypeChange: c ? (w, H) => c(w, H) : void 0,
1581
- highlightTheme: N,
1582
- locale: p,
1583
- renderLink: y,
1584
- href: b ? b(C.id, C) : void 0
1585
- },
1586
- C.id
1587
- );
1588
- }) }, T)
1589
- )) }),
1590
- R && /* @__PURE__ */ i(v, { justifyItems: "center", padding: "small", "data-testid": "notes-pagination", children: /* @__PURE__ */ i(v.Item, { children: /* @__PURE__ */ i(
1547
+ return /* @__PURE__ */ i(j, { as: "div", padding: "large", "data-testid": "empty-notes", children: /* @__PURE__ */ i(Mn, { hasActiveFilter: c }) });
1548
+ const O = typeof o == "number" && typeof r == "number" && r > 1 && s !== void 0;
1549
+ return /* @__PURE__ */ T(rt, { children: [
1550
+ /* @__PURE__ */ i(
1551
+ "ul",
1552
+ {
1553
+ style: { ...$n, gridTemplateColumns: `repeat(${S}, minmax(0, 1fr))` },
1554
+ role: "list",
1555
+ "data-testid": "notes-grid",
1556
+ children: t.map((m) => {
1557
+ var E;
1558
+ return /* @__PURE__ */ i("li", { children: /* @__PURE__ */ i(
1559
+ Hn,
1560
+ {
1561
+ noteId: m.id,
1562
+ date: m.createdAt,
1563
+ type: m.reaction[0] ?? x.IMPORTANT,
1564
+ highlight: (E = m.highlightData) == null ? void 0 : E.selectedText,
1565
+ note: m.userText,
1566
+ isActive: h === m.id,
1567
+ isPanelView: !!h,
1568
+ onClick: a ? () => a(m.id) : void 0,
1569
+ onDelete: l ? (I) => l(I) : void 0,
1570
+ onSaveNote: g ? (I, L) => g(I, L) : void 0,
1571
+ onTypeChange: d ? (I, L) => d(I, L) : void 0,
1572
+ highlightTheme: p,
1573
+ locale: b,
1574
+ renderLink: y,
1575
+ href: N ? N(m.id, m) : void 0
1576
+ }
1577
+ ) }, m.id);
1578
+ })
1579
+ }
1580
+ ),
1581
+ O && /* @__PURE__ */ i(v, { justifyItems: "center", padding: "small", "data-testid": "notes-pagination", children: /* @__PURE__ */ i(v.Item, { children: /* @__PURE__ */ i(
1591
1582
  gt,
1592
1583
  {
1593
1584
  as: "nav",
1594
1585
  variant: "input",
1595
- labelNext: P.nextPage,
1596
- labelPrev: P.previousPage,
1586
+ labelNext: _.nextPage,
1587
+ labelPrev: _.previousPage,
1597
1588
  currentPage: o,
1598
1589
  totalPageNumber: r,
1599
1590
  onPageChange: s
1600
1591
  }
1601
1592
  ) }) })
1602
1593
  ] });
1603
- }, po = ({
1594
+ }, ho = ({
1604
1595
  noteText: t,
1605
1596
  reaction: e,
1606
1597
  highlightText: n,
@@ -1609,23 +1600,23 @@ const Hn = {
1609
1600
  onDelete: s,
1610
1601
  onTypeChange: a,
1611
1602
  onBack: l,
1612
- editing: m = !1
1603
+ editing: g = !1
1613
1604
  }) => {
1614
- const { translations: c } = Z(), [h, g] = U(m), [f, N] = U(t || ""), [p, y] = U(!1);
1615
- return /* @__PURE__ */ S(v, { direction: "column", gap: "small", "data-testid": "single-note", children: [
1616
- n != null ? /* @__PURE__ */ i(W, { as: "div", children: /* @__PURE__ */ i(J, { children: /* @__PURE__ */ i(Ce, { type: e, isCardActive: !0, theme: o, children: n }) }) }) : /* @__PURE__ */ i(nt, {}),
1605
+ const { translations: d } = Z(), [h, c] = U(g), [S, p] = U(t || ""), [b, y] = U(!1);
1606
+ return /* @__PURE__ */ T(v, { direction: "column", gap: "small", "data-testid": "single-note", children: [
1607
+ n != null ? /* @__PURE__ */ i(j, { as: "div", children: /* @__PURE__ */ i(J, { children: /* @__PURE__ */ i(Ce, { type: e, isCardActive: !0, theme: o, children: n }) }) }) : /* @__PURE__ */ i(nt, {}),
1617
1608
  /* @__PURE__ */ i(ot, { type: e, onTypeChange: a, renderAsMenuTrigger: !!a }),
1618
- h ? /* @__PURE__ */ S(v, { direction: "column", gap: "x-small", children: [
1609
+ h ? /* @__PURE__ */ T(v, { direction: "column", gap: "x-small", children: [
1619
1610
  /* @__PURE__ */ i(
1620
1611
  qe,
1621
1612
  {
1622
- label: c.addNoteOptional,
1623
- value: f,
1624
- onChange: (b) => N(b.target.value),
1613
+ label: d.addNoteOptional,
1614
+ value: S,
1615
+ onChange: (N) => p(N.target.value),
1625
1616
  resize: "vertical"
1626
1617
  }
1627
1618
  ),
1628
- /* @__PURE__ */ S(v, { gap: "xx-small", children: [
1619
+ /* @__PURE__ */ T(v, { gap: "xx-small", children: [
1629
1620
  /* @__PURE__ */ i(v.Item, { shouldGrow: !0, children: /* @__PURE__ */ i(
1630
1621
  ee,
1631
1622
  {
@@ -1633,9 +1624,9 @@ const Hn = {
1633
1624
  size: "small",
1634
1625
  "data-testid": "single-note-cancel",
1635
1626
  onClick: () => {
1636
- N(t || ""), g(!1);
1627
+ p(t || ""), c(!1);
1637
1628
  },
1638
- children: c.cancel
1629
+ children: d.cancel
1639
1630
  }
1640
1631
  ) }),
1641
1632
  /* @__PURE__ */ i(v.Item, { shouldGrow: !0, children: /* @__PURE__ */ i(
@@ -1646,18 +1637,18 @@ const Hn = {
1646
1637
  size: "small",
1647
1638
  "data-testid": "single-note-save",
1648
1639
  onClick: () => {
1649
- r(f), g(!1);
1640
+ r(S), c(!1);
1650
1641
  },
1651
- children: c.save
1642
+ children: d.save
1652
1643
  }
1653
1644
  ) })
1654
1645
  ] })
1655
- ] }) : /* @__PURE__ */ S(v, { direction: "column", gap: "small", children: [
1656
- t && /* @__PURE__ */ S(W, { as: "div", children: [
1657
- /* @__PURE__ */ i(pe, { level: "h4", margin: "0 0 xx-small 0", children: c.note }),
1646
+ ] }) : /* @__PURE__ */ T(v, { direction: "column", gap: "small", children: [
1647
+ t && /* @__PURE__ */ T(j, { as: "div", children: [
1648
+ /* @__PURE__ */ i(pe, { level: "h4", margin: "0 0 xx-small 0", children: d.note }),
1658
1649
  /* @__PURE__ */ i(J, { children: t })
1659
1650
  ] }),
1660
- /* @__PURE__ */ S(v, { justifyItems: "space-between", children: [
1651
+ /* @__PURE__ */ T(v, { justifyItems: "space-between", children: [
1661
1652
  /* @__PURE__ */ i(
1662
1653
  ee,
1663
1654
  {
@@ -1665,10 +1656,10 @@ const Hn = {
1665
1656
  renderIcon: /* @__PURE__ */ i(ft, {}),
1666
1657
  "data-testid": "single-note-back",
1667
1658
  onClick: () => l == null ? void 0 : l(),
1668
- children: c.back
1659
+ children: d.back
1669
1660
  }
1670
1661
  ),
1671
- /* @__PURE__ */ S(v, { gap: "xx-small", children: [
1662
+ /* @__PURE__ */ T(v, { gap: "xx-small", children: [
1672
1663
  s && /* @__PURE__ */ i(
1673
1664
  le,
1674
1665
  {
@@ -1676,7 +1667,7 @@ const Hn = {
1676
1667
  withBackground: !1,
1677
1668
  withBorder: !1,
1678
1669
  color: "danger",
1679
- screenReaderLabel: c.deleteNote,
1670
+ screenReaderLabel: d.deleteNote,
1680
1671
  "data-testid": "single-note-delete",
1681
1672
  onClick: () => y(!0),
1682
1673
  children: /* @__PURE__ */ i(he, {})
@@ -1688,15 +1679,15 @@ const Hn = {
1688
1679
  size: "small",
1689
1680
  withBackground: !1,
1690
1681
  withBorder: !1,
1691
- screenReaderLabel: c.editNote,
1682
+ screenReaderLabel: d.editNote,
1692
1683
  "data-testid": "single-note-edit",
1693
- onClick: () => g(!0),
1684
+ onClick: () => c(!0),
1694
1685
  children: /* @__PURE__ */ i(Se, {})
1695
1686
  }
1696
1687
  )
1697
1688
  ] })
1698
1689
  ] }),
1699
- p && s && /* @__PURE__ */ i(W, { as: "div", background: "primary", padding: "medium", borderRadius: "large", children: /* @__PURE__ */ S(v, { direction: "column", justifyItems: "center", alignItems: "center", gap: "x-small", children: [
1690
+ b && s && /* @__PURE__ */ i(j, { as: "div", background: "primary", padding: "medium", borderRadius: "large", children: /* @__PURE__ */ T(v, { direction: "column", justifyItems: "center", alignItems: "center", gap: "x-small", children: [
1700
1691
  /* @__PURE__ */ i(
1701
1692
  ee,
1702
1693
  {
@@ -1708,7 +1699,7 @@ const Hn = {
1708
1699
  onClick: () => {
1709
1700
  s(), y(!1);
1710
1701
  },
1711
- children: c.deleteNote
1702
+ children: d.deleteNote
1712
1703
  }
1713
1704
  ),
1714
1705
  /* @__PURE__ */ i(
@@ -1718,7 +1709,7 @@ const Hn = {
1718
1709
  size: "small",
1719
1710
  "data-testid": "single-note-cancel-delete",
1720
1711
  onClick: () => y(!1),
1721
- children: c.cancel
1712
+ children: d.cancel
1722
1713
  }
1723
1714
  )
1724
1715
  ] }) })
@@ -1726,26 +1717,26 @@ const Hn = {
1726
1717
  ] });
1727
1718
  };
1728
1719
  export {
1729
- fo as ContentWithNoteWrapper,
1720
+ uo as ContentWithNoteWrapper,
1730
1721
  Ce as Highlight,
1731
1722
  nt as HighlightError,
1732
- Bn as NoteCard,
1723
+ Hn as NoteCard,
1733
1724
  ot as NoteChip,
1734
- An as NoteReactionMenu,
1735
- Fn as NotebookEmptyState,
1736
- co as NotebookProvider,
1737
- wn as NotebookTranslationsProvider,
1738
- uo as NotebookTray,
1739
- ho as NotesListView,
1740
- k as REACTION_TYPE,
1741
- po as SingleNote,
1742
- De as createTransparentColor,
1743
- Ut as useCreateNote,
1725
+ Ln as NoteReactionMenu,
1726
+ Mn as NotebookEmptyState,
1727
+ lo as NotebookProvider,
1728
+ On as NotebookTranslationsProvider,
1729
+ co as NotebookTray,
1730
+ go as NotesListView,
1731
+ x as REACTION_TYPE,
1732
+ ho as SingleNote,
1733
+ Le as createTransparentColor,
1734
+ Gt as useCreateNote,
1744
1735
  jt as useDeleteNote,
1745
1736
  ve as useGetNotes,
1746
1737
  et as useNotebook,
1747
1738
  Z as useNotebookTranslations,
1748
- mo as useNotesData,
1749
- go as useReactionFilter,
1750
- Gt as useUpdateNote
1739
+ fo as useNotesData,
1740
+ mo as useReactionFilter,
1741
+ zt as useUpdateNote
1751
1742
  };