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