@instructure/platform-notebook 1.10.2 → 1.11.0

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