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