@alfadocs/ui-kit-debug 1.1.0 → 1.2.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.
Files changed (112) hide show
  1. package/dist/_chunks/notes-panel-CCz0J140.js +370 -0
  2. package/dist/_chunks/notes-panel-CCz0J140.js.map +1 -0
  3. package/dist/_chunks/sparkline-DJtZBe7O.js +501 -0
  4. package/dist/_chunks/sparkline-DJtZBe7O.js.map +1 -0
  5. package/dist/agent-catalog.json +27 -1
  6. package/dist/agent-i18n/en.json +4 -2
  7. package/dist/components/notes-panel/index.js +1 -1
  8. package/dist/components/notes-panel/notes-panel.agent.d.ts.map +1 -1
  9. package/dist/components/notes-panel/notes-panel.d.ts +45 -2
  10. package/dist/components/notes-panel/notes-panel.d.ts.map +1 -1
  11. package/dist/components/sparkline/index.js +1 -1
  12. package/dist/components/sparkline/sparkline.agent.d.ts.map +1 -1
  13. package/dist/components/sparkline/sparkline.d.ts +24 -0
  14. package/dist/components/sparkline/sparkline.d.ts.map +1 -1
  15. package/dist/host-compat.css +4 -1
  16. package/dist/i18n/locales/ar.d.ts +2 -0
  17. package/dist/i18n/locales/ar.d.ts.map +1 -1
  18. package/dist/i18n/locales/ar.js +2 -0
  19. package/dist/i18n/locales/ar.js.map +1 -1
  20. package/dist/i18n/locales/de.d.ts +2 -0
  21. package/dist/i18n/locales/de.d.ts.map +1 -1
  22. package/dist/i18n/locales/de.js +2 -0
  23. package/dist/i18n/locales/de.js.map +1 -1
  24. package/dist/i18n/locales/el.d.ts +2 -0
  25. package/dist/i18n/locales/el.d.ts.map +1 -1
  26. package/dist/i18n/locales/el.js +2 -0
  27. package/dist/i18n/locales/el.js.map +1 -1
  28. package/dist/i18n/locales/en.d.ts +2 -0
  29. package/dist/i18n/locales/en.d.ts.map +1 -1
  30. package/dist/i18n/locales/en.js +2 -0
  31. package/dist/i18n/locales/en.js.map +1 -1
  32. package/dist/i18n/locales/es.d.ts +2 -0
  33. package/dist/i18n/locales/es.d.ts.map +1 -1
  34. package/dist/i18n/locales/es.js +2 -0
  35. package/dist/i18n/locales/es.js.map +1 -1
  36. package/dist/i18n/locales/fr.d.ts +2 -0
  37. package/dist/i18n/locales/fr.d.ts.map +1 -1
  38. package/dist/i18n/locales/fr.js +2 -0
  39. package/dist/i18n/locales/fr.js.map +1 -1
  40. package/dist/i18n/locales/hi.d.ts +2 -0
  41. package/dist/i18n/locales/hi.d.ts.map +1 -1
  42. package/dist/i18n/locales/hi.js +2 -0
  43. package/dist/i18n/locales/hi.js.map +1 -1
  44. package/dist/i18n/locales/it.d.ts +2 -0
  45. package/dist/i18n/locales/it.d.ts.map +1 -1
  46. package/dist/i18n/locales/it.js +2 -0
  47. package/dist/i18n/locales/it.js.map +1 -1
  48. package/dist/i18n/locales/ja.d.ts +2 -0
  49. package/dist/i18n/locales/ja.d.ts.map +1 -1
  50. package/dist/i18n/locales/ja.js +2 -0
  51. package/dist/i18n/locales/ja.js.map +1 -1
  52. package/dist/i18n/locales/nl.d.ts +2 -0
  53. package/dist/i18n/locales/nl.d.ts.map +1 -1
  54. package/dist/i18n/locales/nl.js +2 -0
  55. package/dist/i18n/locales/nl.js.map +1 -1
  56. package/dist/i18n/locales/pl.d.ts +2 -0
  57. package/dist/i18n/locales/pl.d.ts.map +1 -1
  58. package/dist/i18n/locales/pl.js +2 -0
  59. package/dist/i18n/locales/pl.js.map +1 -1
  60. package/dist/i18n/locales/pt.d.ts +2 -0
  61. package/dist/i18n/locales/pt.d.ts.map +1 -1
  62. package/dist/i18n/locales/pt.js +2 -0
  63. package/dist/i18n/locales/pt.js.map +1 -1
  64. package/dist/i18n/locales/ro.d.ts +2 -0
  65. package/dist/i18n/locales/ro.d.ts.map +1 -1
  66. package/dist/i18n/locales/ro.js +2 -0
  67. package/dist/i18n/locales/ro.js.map +1 -1
  68. package/dist/i18n/locales/ru.d.ts +2 -0
  69. package/dist/i18n/locales/ru.d.ts.map +1 -1
  70. package/dist/i18n/locales/ru.js +2 -0
  71. package/dist/i18n/locales/ru.js.map +1 -1
  72. package/dist/i18n/locales/sq.d.ts +2 -0
  73. package/dist/i18n/locales/sq.d.ts.map +1 -1
  74. package/dist/i18n/locales/sq.js +2 -0
  75. package/dist/i18n/locales/sq.js.map +1 -1
  76. package/dist/i18n/locales/sv.d.ts +2 -0
  77. package/dist/i18n/locales/sv.d.ts.map +1 -1
  78. package/dist/i18n/locales/sv.js +2 -0
  79. package/dist/i18n/locales/sv.js.map +1 -1
  80. package/dist/i18n/locales/tr.d.ts +2 -0
  81. package/dist/i18n/locales/tr.d.ts.map +1 -1
  82. package/dist/i18n/locales/tr.js +2 -0
  83. package/dist/i18n/locales/tr.js.map +1 -1
  84. package/dist/i18n/locales/zh.d.ts +2 -0
  85. package/dist/i18n/locales/zh.d.ts.map +1 -1
  86. package/dist/i18n/locales/zh.js +2 -0
  87. package/dist/i18n/locales/zh.js.map +1 -1
  88. package/dist/index.js +2 -2
  89. package/dist/locales/ar.json +2 -0
  90. package/dist/locales/de.json +2 -0
  91. package/dist/locales/el.json +2 -0
  92. package/dist/locales/en.json +2 -0
  93. package/dist/locales/es.json +2 -0
  94. package/dist/locales/fr.json +2 -0
  95. package/dist/locales/hi.json +2 -0
  96. package/dist/locales/it.json +2 -0
  97. package/dist/locales/ja.json +2 -0
  98. package/dist/locales/nl.json +2 -0
  99. package/dist/locales/pl.json +2 -0
  100. package/dist/locales/pt.json +2 -0
  101. package/dist/locales/ro.json +2 -0
  102. package/dist/locales/ru.json +2 -0
  103. package/dist/locales/sq.json +2 -0
  104. package/dist/locales/sv.json +2 -0
  105. package/dist/locales/tr.json +2 -0
  106. package/dist/locales/zh.json +2 -0
  107. package/dist/tokens.css +1 -1
  108. package/package.json +1 -1
  109. package/dist/_chunks/notes-panel-CTcOLLVo.js +0 -324
  110. package/dist/_chunks/notes-panel-CTcOLLVo.js.map +0 -1
  111. package/dist/_chunks/sparkline-DLq7xwic.js +0 -394
  112. package/dist/_chunks/sparkline-DLq7xwic.js.map +0 -1
@@ -0,0 +1,370 @@
1
+ import { jsxs as p, jsx as i } from "react/jsx-runtime";
2
+ import { forwardRef as se, useRef as r, useState as T, useId as oe, useCallback as le, useEffect as ce, useImperativeHandle as de, useMemo as ue } from "react";
3
+ import { c as pe } from "./index-D2ZczOXr.js";
4
+ import { useTranslation as fe } from "react-i18next";
5
+ import { u as me } from "./registry-DvAUVLHh.js";
6
+ import { C as ge } from "./clinical-note-card-D63x_AkK.js";
7
+ import { R as he } from "./rich-text-editor-CfeXPPWs.js";
8
+ import { T as be } from "./text-area-Bt3p7Pt0.js";
9
+ import { B as ve } from "./button-CPGiR_bH.js";
10
+ import { C as ye } from "./checkbox-BuZ1u__2.js";
11
+ import { P as xe } from "./panel-header-D313n_9-.js";
12
+ import { c as Pe } from "./createLucideIcon-DhHxpK9K.js";
13
+ /**
14
+ * @license lucide-react v1.22.0 - ISC
15
+ *
16
+ * This source code is licensed under the ISC license.
17
+ * See the LICENSE file in the root directory of this source tree.
18
+ */
19
+ const ke = [
20
+ ["path", { d: "M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4", key: "re6nr2" }],
21
+ ["path", { d: "M2 6h4", key: "aawbzj" }],
22
+ ["path", { d: "M2 10h4", key: "l0bgd4" }],
23
+ ["path", { d: "M2 14h4", key: "1gsvsf" }],
24
+ ["path", { d: "M2 18h4", key: "1bu2t1" }],
25
+ [
26
+ "path",
27
+ {
28
+ d: "M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",
29
+ key: "pqwjuv"
30
+ }
31
+ ]
32
+ ], Ce = Pe("notebook-pen", ke), Ne = {
33
+ id: "notes-panel",
34
+ // 'submit' backs add_note (compose + commit a note). pin / flag are toggles
35
+ // with no dedicated capability in the closed vocabulary.
36
+ capabilities: ["submit"],
37
+ state: {
38
+ notes: {
39
+ type: "Array<{ id?: string; pinned: boolean; flagged: boolean; clinical: boolean }>",
40
+ descriptionKey: "ui.agent.notesPanel.state.notes",
41
+ description: "Timeline note ids + pinned / flagged / clinical flags. Never the note body or author (both PHI).",
42
+ read: (n) => n.getNotes()
43
+ },
44
+ canAddClinical: {
45
+ type: "boolean",
46
+ descriptionKey: "ui.agent.notesPanel.state.canAddClinical",
47
+ description: "Whether the current user may write clinical notes (the practice_add_clinical_note permission gate).",
48
+ read: (n) => n.canAddClinical()
49
+ },
50
+ currentNoteId: {
51
+ type: "string | null",
52
+ descriptionKey: "ui.agent.notesPanel.state.currentNoteId",
53
+ description: "Id of the note the host has addressed — the one marked, scrolled to and focused. Null when none is. An id only, never note content.",
54
+ read: (n) => n.getCurrentNoteId()
55
+ }
56
+ },
57
+ actions: {
58
+ add_note: {
59
+ // Writes a clinical/admin note body — patient-identifiable content. PHI.
60
+ safety: "phi",
61
+ argsType: "{ content: string; clinical: boolean }",
62
+ argsSchema: {
63
+ type: "object",
64
+ properties: {
65
+ content: {
66
+ type: "string",
67
+ description: "Note body. Rich HTML for the rich composer, else plain text."
68
+ },
69
+ clinical: {
70
+ type: "boolean",
71
+ description: "Whether the note is clinical. Requires the clinical-note permission; the submission is dropped when the gate is closed."
72
+ }
73
+ },
74
+ required: ["content", "clinical"]
75
+ },
76
+ openWorld: !0,
77
+ descriptionKey: "ui.agent.notesPanel.actions.addNote",
78
+ description: "Compose and commit a new note. A clinical note requires the clinical-note permission (read canAddClinical first).",
79
+ examples: [
80
+ {
81
+ args: { content: "Patient reported improvement.", clinical: !0 },
82
+ note: "Add a clinical note."
83
+ }
84
+ ],
85
+ invoke: (n, s) => {
86
+ n.addNote(s);
87
+ }
88
+ },
89
+ toggle_pin: {
90
+ // Re-orders the timeline (pinned notes lead) — reversible view write.
91
+ safety: "write",
92
+ argsType: "{ id: string }",
93
+ argsSchema: {
94
+ type: "object",
95
+ properties: { id: { type: "string" } },
96
+ required: ["id"]
97
+ },
98
+ idempotent: !1,
99
+ descriptionKey: "ui.agent.notesPanel.actions.togglePin",
100
+ description: "Toggle the pinned state of the note with the given id.",
101
+ invoke: (n, s) => {
102
+ n.togglePin(s.id);
103
+ }
104
+ },
105
+ toggle_flag: {
106
+ safety: "write",
107
+ argsType: "{ id: string }",
108
+ argsSchema: {
109
+ type: "object",
110
+ properties: { id: { type: "string" } },
111
+ required: ["id"]
112
+ },
113
+ idempotent: !1,
114
+ descriptionKey: "ui.agent.notesPanel.actions.toggleFlag",
115
+ description: "Toggle the flagged state of the note with the given id.",
116
+ invoke: (n, s) => {
117
+ n.toggleFlag(s.id);
118
+ }
119
+ }
120
+ },
121
+ domHooks: {
122
+ root: {
123
+ attr: "data-component",
124
+ value: "notes-panel",
125
+ description: "Marks the NotesPanel region."
126
+ },
127
+ instanceId: {
128
+ attr: "data-component-id",
129
+ sourceProp: "id",
130
+ description: "Sourced from the id prop. Required to address a specific notes panel from the agent."
131
+ }
132
+ }
133
+ }, we = pe(
134
+ "ds:flex ds:flex-col ds:rounded-[var(--radius-md)] ds:border-s-2 ds:ps-[var(--spacing-sm)]",
135
+ {
136
+ variants: {
137
+ current: {
138
+ true: "ds:border-[color:var(--info)] ds:bg-[color:var(--info)]/10 ds:focus:outline-[length:var(--focus-ring-width)] ds:focus:outline-solid ds:focus:outline-[color:var(--ring)] ds:focus:outline-offset-[length:var(--focus-ring-offset)]",
139
+ false: "ds:border-transparent"
140
+ }
141
+ },
142
+ defaultVariants: { current: !1 }
143
+ }
144
+ );
145
+ function z(n) {
146
+ return n ? /<img\b/i.test(n) ? !0 : n.replace(/<[^>]*>/g, "").replace(/&nbsp;/gi, " ").trim().length > 0 : !1;
147
+ }
148
+ const Se = se(
149
+ function({
150
+ id: s,
151
+ notes: x,
152
+ onAddNote: l,
153
+ currentNoteId: c,
154
+ currentNoteKey: S,
155
+ composer: f = "rich",
156
+ editorToolbar: L = "standard",
157
+ redactor: B,
158
+ imageUploadUrl: W,
159
+ showClinicalToggle: I = !0,
160
+ canAddClinicalNote: m = !0,
161
+ clinicalGatedReason: E,
162
+ defaultClinical: P = !1,
163
+ onRequestAiDraft: D,
164
+ aiDraftFormat: G,
165
+ aiPrivacyNotice: Y,
166
+ onDictate: F,
167
+ onProofread: J,
168
+ onAutoFormat: O,
169
+ onTogglePin: g,
170
+ onToggleFlag: h,
171
+ title: Q,
172
+ composerPlaceholder: U,
173
+ addNoteLabel: X,
174
+ emptyState: Z,
175
+ className: $,
176
+ "aria-label": k,
177
+ ...ee
178
+ }, te) {
179
+ const { t: o } = fe(), C = r(null), [d, N] = T(""), [b, j] = T(P), ne = Q ?? o("notesPanel.title", { defaultValue: "Notes" }), V = oe(), M = U ?? o("notesPanel.placeholder", { defaultValue: "Add a note…" }), H = o("notesPanel.composerLabel", {
180
+ defaultValue: "New note"
181
+ }), ae = f === "rich" ? z(d) : d.trim().length > 0, ie = le(() => {
182
+ var e, t;
183
+ if (l) {
184
+ if (f === "rich") {
185
+ const a = ((e = C.current) == null ? void 0 : e.getHTML()) ?? d;
186
+ if (!z(a)) return;
187
+ l({ content: a, clinical: b }), (t = C.current) == null || t.clear();
188
+ } else {
189
+ const a = d.trim();
190
+ if (!a) return;
191
+ l({ content: a, clinical: b });
192
+ }
193
+ N(""), j(P);
194
+ }
195
+ }, [f, d, b, P, l]), _ = [...x].sort(
196
+ (e, t) => Number(t.pinned ?? !1) - Number(e.pinned ?? !1)
197
+ ), w = r(null);
198
+ ce(() => {
199
+ var e, t;
200
+ c && ((e = w.current) == null || e.scrollIntoView({ block: "center" }), (t = w.current) == null || t.focus());
201
+ }, [c, S]);
202
+ const q = r(x);
203
+ q.current = x;
204
+ const u = r(l);
205
+ u.current = l;
206
+ const v = r(g);
207
+ v.current = g;
208
+ const y = r(h);
209
+ y.current = h;
210
+ const R = r(m);
211
+ R.current = m;
212
+ const A = r(c);
213
+ A.current = c;
214
+ const K = r(null);
215
+ de(te, () => K.current, []);
216
+ const re = ue(
217
+ () => ({
218
+ // Ids + flags only — never the note body or author (both PHI).
219
+ getNotes: () => q.current.map((e) => ({
220
+ id: e.id,
221
+ pinned: !!e.pinned,
222
+ flagged: !!e.flagged,
223
+ clinical: !!e.clinical
224
+ })),
225
+ canAddNote: () => !!u.current,
226
+ canAddClinical: () => R.current,
227
+ getCurrentNoteId: () => A.current ?? null,
228
+ addNote: (e) => {
229
+ var t;
230
+ e.clinical && !R.current || (t = u.current) == null || t.call(u, e);
231
+ },
232
+ togglePin: (e) => {
233
+ var t;
234
+ return (t = v.current) == null ? void 0 : t.call(v, e);
235
+ },
236
+ toggleFlag: (e) => {
237
+ var t;
238
+ return (t = y.current) == null ? void 0 : t.call(y, e);
239
+ }
240
+ }),
241
+ []
242
+ );
243
+ return me(Ne, re, s), /* @__PURE__ */ p(
244
+ "section",
245
+ {
246
+ ref: K,
247
+ "data-component": "notes-panel",
248
+ "data-component-id": s,
249
+ "aria-labelledby": k ? void 0 : V,
250
+ "aria-label": k,
251
+ className: ["ds:flex ds:flex-col", $].filter(Boolean).join(" "),
252
+ ...ee,
253
+ children: [
254
+ /* @__PURE__ */ i(
255
+ xe,
256
+ {
257
+ title: ne,
258
+ icon: /* @__PURE__ */ i(Ce, { "aria-hidden": "true" }),
259
+ headingId: k ? void 0 : V,
260
+ sticky: !0,
261
+ divider: !0
262
+ }
263
+ ),
264
+ /* @__PURE__ */ p("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:p-[var(--spacing-md)]", children: [
265
+ l ? /* @__PURE__ */ p("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
266
+ f === "rich" ? /* @__PURE__ */ i(
267
+ he,
268
+ {
269
+ ref: C,
270
+ ariaLabel: H,
271
+ placeholder: M,
272
+ toolbar: L,
273
+ minHeight: "sm",
274
+ redactor: B,
275
+ imageUploadUrl: W,
276
+ onChange: ({ html: e }) => N(e),
277
+ onRequestAiDraft: D,
278
+ aiDraftFormat: G,
279
+ aiPrivacyNotice: Y,
280
+ onDictate: F,
281
+ onProofread: J,
282
+ onAutoFormat: O
283
+ }
284
+ ) : /* @__PURE__ */ i(
285
+ be,
286
+ {
287
+ value: d,
288
+ onChange: (e) => N(e.target.value),
289
+ placeholder: M,
290
+ autoResize: !0,
291
+ minRows: 2,
292
+ maxRows: 6,
293
+ "aria-label": H
294
+ }
295
+ ),
296
+ /* @__PURE__ */ p(
297
+ "div",
298
+ {
299
+ className: [
300
+ "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]",
301
+ I ? "ds:justify-between" : "ds:justify-end"
302
+ ].join(" "),
303
+ children: [
304
+ I ? /* @__PURE__ */ i(
305
+ ye,
306
+ {
307
+ size: "sm",
308
+ label: o("notesPanel.clinicalToggle", {
309
+ defaultValue: "Clinical note"
310
+ }),
311
+ checked: b,
312
+ onCheckedChange: (e) => j(e === !0),
313
+ disabled: !m,
314
+ disabledReason: m ? void 0 : E ?? o("notesPanel.clinicalGated", {
315
+ defaultValue: "You do not have permission to write clinical notes."
316
+ })
317
+ }
318
+ ) : null,
319
+ /* @__PURE__ */ i(
320
+ ve,
321
+ {
322
+ type: "button",
323
+ size: "sm",
324
+ onClick: ie,
325
+ disabled: !ae,
326
+ children: X ?? o("notesPanel.add", { defaultValue: "Add note" })
327
+ }
328
+ )
329
+ ]
330
+ }
331
+ )
332
+ ] }) : null,
333
+ _.length > 0 ? /* @__PURE__ */ i("ul", { className: "ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-0", children: _.map((e, t) => {
334
+ const a = c != null && e.id === c;
335
+ return /* @__PURE__ */ p(
336
+ "li",
337
+ {
338
+ ref: a ? w : void 0,
339
+ tabIndex: a ? -1 : void 0,
340
+ "aria-current": a ? "true" : void 0,
341
+ className: we({ current: a }),
342
+ children: [
343
+ a ? /* @__PURE__ */ i("span", { className: "ds:sr-only", children: o("notesPanel.current", {
344
+ defaultValue: "Current note"
345
+ }) }) : null,
346
+ /* @__PURE__ */ i(
347
+ ge,
348
+ {
349
+ surface: "elevated",
350
+ truncate: !a,
351
+ ...e,
352
+ onTogglePin: g && e.id ? () => g(e.id) : void 0,
353
+ onToggleFlag: h && e.id ? () => h(e.id) : void 0
354
+ }
355
+ )
356
+ ]
357
+ },
358
+ e.id ?? t
359
+ );
360
+ }) }) : Z ?? /* @__PURE__ */ i("p", { className: "ds:m-0 type-body-sm ds:text-[color:var(--muted-foreground)]", children: o("notesPanel.empty", { defaultValue: "No notes yet." }) })
361
+ ] })
362
+ ]
363
+ }
364
+ );
365
+ }
366
+ );
367
+ export {
368
+ Se as N
369
+ };
370
+ //# sourceMappingURL=notes-panel-CCz0J140.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notes-panel-CCz0J140.js","sources":["../../node_modules/lucide-react/dist/esm/icons/notebook-pen.mjs","../../src/components/notes-panel/notes-panel.agent.ts","../../src/components/notes-panel/notes-panel.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4\", key: \"re6nr2\" }],\n [\"path\", { d: \"M2 6h4\", key: \"aawbzj\" }],\n [\"path\", { d: \"M2 10h4\", key: \"l0bgd4\" }],\n [\"path\", { d: \"M2 14h4\", key: \"1gsvsf\" }],\n [\"path\", { d: \"M2 18h4\", key: \"1bu2t1\" }],\n [\n \"path\",\n {\n d: \"M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z\",\n key: \"pqwjuv\"\n }\n ]\n];\nconst NotebookPen = createLucideIcon(\"notebook-pen\", __iconNode);\n\nexport { __iconNode, NotebookPen as default };\n//# sourceMappingURL=notebook-pen.mjs.map\n","/* -------------------------------------------------------------------- */\n/* Agent adapter — NotesPanel. */\n/* */\n/* The Notes tool: a composer over a note timeline. The agent reads the */\n/* timeline STRUCTURE (note ids + pinned / flagged / clinical flags — */\n/* never the note body or author, both PHI), composes and commits a new */\n/* note, and toggles a note's pinned / flagged state. `add_note` carries */\n/* the `phi` safety class: a note body is patient-identifiable clinical */\n/* content, so the host gates it behind the same confirm-before-act as a */\n/* destructive write and never auto-confirms. A clinical submission also */\n/* requires the host's `practice_add_clinical_note` permission (the */\n/* handle drops it when the gate is closed). */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { NotesPanelHandle } from './notes-panel';\n\nexport const notesPanelAgent: AgentAdapter<NotesPanelHandle> = {\n id: 'notes-panel',\n // 'submit' backs add_note (compose + commit a note). pin / flag are toggles\n // with no dedicated capability in the closed vocabulary.\n capabilities: ['submit'],\n state: {\n notes: {\n type: 'Array<{ id?: string; pinned: boolean; flagged: boolean; clinical: boolean }>',\n descriptionKey: 'ui.agent.notesPanel.state.notes',\n description:\n 'Timeline note ids + pinned / flagged / clinical flags. Never the note body or author (both PHI).',\n read: (handle) => handle.getNotes(),\n },\n canAddClinical: {\n type: 'boolean',\n descriptionKey: 'ui.agent.notesPanel.state.canAddClinical',\n description:\n 'Whether the current user may write clinical notes (the practice_add_clinical_note permission gate).',\n read: (handle) => handle.canAddClinical(),\n },\n currentNoteId: {\n type: 'string | null',\n descriptionKey: 'ui.agent.notesPanel.state.currentNoteId',\n description:\n 'Id of the note the host has addressed — the one marked, scrolled to and focused. Null when none is. An id only, never note content.',\n read: (handle) => handle.getCurrentNoteId(),\n },\n },\n actions: {\n add_note: {\n // Writes a clinical/admin note body — patient-identifiable content. PHI.\n safety: 'phi',\n argsType: '{ content: string; clinical: boolean }',\n argsSchema: {\n type: 'object',\n properties: {\n content: {\n type: 'string',\n description:\n 'Note body. Rich HTML for the rich composer, else plain text.',\n },\n clinical: {\n type: 'boolean',\n description:\n 'Whether the note is clinical. Requires the clinical-note permission; the submission is dropped when the gate is closed.',\n },\n },\n required: ['content', 'clinical'],\n },\n openWorld: true,\n descriptionKey: 'ui.agent.notesPanel.actions.addNote',\n description:\n 'Compose and commit a new note. A clinical note requires the clinical-note permission (read canAddClinical first).',\n examples: [\n {\n args: { content: 'Patient reported improvement.', clinical: true },\n note: 'Add a clinical note.',\n },\n ],\n invoke: (handle, args: { content: string; clinical: boolean }) => {\n handle.addNote(args);\n },\n },\n toggle_pin: {\n // Re-orders the timeline (pinned notes lead) — reversible view write.\n safety: 'write',\n argsType: '{ id: string }',\n argsSchema: {\n type: 'object',\n properties: { id: { type: 'string' } },\n required: ['id'],\n },\n idempotent: false,\n descriptionKey: 'ui.agent.notesPanel.actions.togglePin',\n description: 'Toggle the pinned state of the note with the given id.',\n invoke: (handle, args: { id: string }) => {\n handle.togglePin(args.id);\n },\n },\n toggle_flag: {\n safety: 'write',\n argsType: '{ id: string }',\n argsSchema: {\n type: 'object',\n properties: { id: { type: 'string' } },\n required: ['id'],\n },\n idempotent: false,\n descriptionKey: 'ui.agent.notesPanel.actions.toggleFlag',\n description: 'Toggle the flagged state of the note with the given id.',\n invoke: (handle, args: { id: string }) => {\n handle.toggleFlag(args.id);\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'notes-panel',\n description: 'Marks the NotesPanel region.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description:\n 'Sourced from the id prop. Required to address a specific notes panel from the agent.',\n },\n },\n};\n","import {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { cva } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { notesPanelAgent } from './notes-panel.agent';\nimport { ClinicalNoteCard } from '../clinical-note-card';\nimport type { ClinicalNoteCardProps } from '../clinical-note-card';\nimport { RichTextEditor } from '../rich-text-editor';\nimport type {\n RichTextEditorHandle,\n RichTextEditorProps,\n RichTextEditorToolbar,\n RedactorFactory,\n} from '../rich-text-editor';\nimport { TextArea } from '../text-area';\nimport { Button } from '../button';\nimport { Checkbox } from '../checkbox';\nimport { NotebookPen } from 'lucide-react';\nimport { PanelHeader } from '../panel-header';\n\n/* ------------------------------------------------------------------ */\n/* NotesPanel — the Notes tool for the Control Room rail. */\n/* */\n/* A composer over an elevated ClinicalNoteCard timeline. Drops */\n/* into a ControlRoomRail tool `panel`, the patient profile, or the */\n/* care-plan editor — anywhere notes about the open entity belong. */\n/* The composer is the kit RichTextEditor by default (degrades to a */\n/* textarea where Redactor is absent), carries a permission-gated */\n/* \"clinical note\" toggle, and forwards the editor's AI affordances. */\n/* The note attaches to whatever entity the host is showing — the */\n/* host owns the attachment; the panel only emits content + clinical. */\n/* Pinned notes lead; pin / flag are inline per-note toggles. */\n/* ------------------------------------------------------------------ */\n\n/**\n * One note in the panel — the data subset of `ClinicalNoteCard`.\n *\n * `aria-label` names the card for assistive tech. Set it whenever a row is not\n * a clinical note: the card's fallback name is \"Clinical note\", so an entry\n * that is something else (a dated event, an import) is announced as one.\n */\nexport type NotesPanelNote = Pick<\n ClinicalNoteCardProps,\n | 'id'\n | 'dateIso'\n | 'createdAtIso'\n | 'author'\n | 'clinical'\n | 'attachedTo'\n | 'content'\n | 'contentFormat'\n | 'pinned'\n | 'flagged'\n | 'aria-label'\n>;\n\n/**\n * Curated agent handle for NotesPanel. Reads the note timeline's STRUCTURE\n * (ids + pinned / flagged / clinical flags — never the note body or author,\n * both PHI) and drives the composer + per-note toggles. See\n * `notes-panel.agent.ts`.\n */\nexport interface NotesPanelHandle {\n /** Timeline snapshot — ids + flags only, never note content (PHI). */\n getNotes: () => Array<{\n id?: string;\n pinned: boolean;\n flagged: boolean;\n clinical: boolean;\n }>;\n /** Whether the composer is mounted (onAddNote is wired). */\n canAddNote: () => boolean;\n /** Whether clinical notes may be written (the permission gate). */\n canAddClinical: () => boolean;\n /** Id of the note the host has addressed, or null when none is. */\n getCurrentNoteId: () => string | null;\n /** Commit a new note with explicit content (mirrors the composer's submit). */\n addNote: (submission: NotesPanelSubmission) => void;\n /** Toggle a note's pinned state (mirrors onTogglePin). */\n togglePin: (id: string) => void;\n /** Toggle a note's flagged state (mirrors onToggleFlag). */\n toggleFlag: (id: string) => void;\n}\n\n/** Payload handed to `onAddNote` when the composer commits. */\nexport interface NotesPanelSubmission {\n /** The note body — rich HTML (`composer='rich'`) or plain text. */\n content: string;\n /** Whether the \"clinical note\" toggle was set. */\n clinical: boolean;\n}\n\nexport interface NotesPanelProps extends Omit<\n HTMLAttributes<HTMLElement>,\n 'title' | 'children'\n> {\n /**\n * Stable instance id. Surfaced on the root as `data-component-id` so an\n * agent / MCP UI bridge can address this specific notes panel.\n */\n id?: string;\n /** Notes to render, newest-first by convention. Pinned notes lead. */\n notes: NotesPanelNote[];\n /** Commit a new note. Omit to hide the composer (read-only timeline). */\n onAddNote?: (submission: NotesPanelSubmission) => void;\n /**\n * The note the reader ASKED for, addressed by id from somewhere else in the\n * record — a marker in a chart, a row in a grid, an agent. The panel marks\n * it, scrolls it to the middle of its own scroll region and moves focus to\n * it, and renders it unclamped so the thing that was asked for is readable\n * in full without a second click.\n *\n * Opening a panel is not the same as answering a question: a rail's\n * `setActiveTool` moves no focus and announces nothing, so a control whose\n * name promises \"in the notes panel\" produces no perceivable change for a\n * keyboard or screen-reader reader unless the panel lands them on the note.\n * That is what this prop is for; without it, a host has to reach into the\n * panel's DOM to do the same job.\n *\n * Marked on three channels, never colour alone (WCAG 1.4.1): a solid\n * inline-start bar the other notes do not have, a tinted gutter, and\n * `aria-current` plus a visually-hidden sentence naming the mark.\n *\n * Ids that match no note are ignored. To address the SAME note twice — the\n * reader pressing the same marker again after scrolling away — bump\n * `currentNoteKey` alongside it; this prop alone is a value, not a request.\n */\n currentNoteId?: string;\n /**\n * Bump on every address to re-scroll and re-focus the note in `currentNoteId`\n * even when the id has not changed.\n *\n * Addressing is a request, not a value: a reader who presses the same marker\n * a second time (having scrolled away, or having moved focus off the note) is\n * asking to be taken back, and a control whose name promises the notes panel\n * must do something perceivable every time it is pressed. Without this the\n * second press is inert — the panel is already showing that note, so nothing\n * re-runs. Hosts increment a counter in the same handler that opens the tool.\n */\n currentNoteKey?: string | number;\n\n /* ----- Composer ----- */\n /**\n * `'rich'` (default) mounts the kit `RichTextEditor` (Redactor; degrades to a\n * textarea where Redactor is absent). `'plain'` keeps a simple `TextArea` for\n * lightweight surfaces / deterministic tests.\n */\n composer?: 'rich' | 'plain';\n /** Toolbar preset for the rich composer. Defaults to `'standard'`. */\n editorToolbar?: RichTextEditorToolbar;\n /** Inject the Redactor factory for the rich composer (else `window.$R`). */\n redactor?: RedactorFactory;\n /** Consumer image-upload endpoint for the rich composer. */\n imageUploadUrl?: string;\n\n /* ----- Clinical flag (permission-gated) ----- */\n /** Show the \"clinical note\" toggle in the composer. Default `true`. */\n showClinicalToggle?: boolean;\n /**\n * Permission gate — when `false` the clinical toggle is disabled and shows\n * `clinicalGatedReason` on hover/focus. Mirrors platform's\n * `practice_add_clinical_note` permission. Default `true`.\n */\n canAddClinicalNote?: boolean;\n /** Tooltip shown when the clinical toggle is gated off. */\n clinicalGatedReason?: string;\n /** Initial state of the clinical toggle. Default `false`. */\n defaultClinical?: boolean;\n\n /* ----- AI assistance (forwarded to RichTextEditor) ----- */\n onRequestAiDraft?: RichTextEditorProps['onRequestAiDraft'];\n aiDraftFormat?: RichTextEditorProps['aiDraftFormat'];\n aiPrivacyNotice?: RichTextEditorProps['aiPrivacyNotice'];\n onDictate?: RichTextEditorProps['onDictate'];\n onProofread?: RichTextEditorProps['onProofread'];\n onAutoFormat?: RichTextEditorProps['onAutoFormat'];\n\n /* ----- Per-note actions ----- */\n /** Toggle a note's pinned state — renders an inline pin button per note. */\n onTogglePin?: (id: string) => void;\n /** Toggle a note's flagged state — renders an inline flag button per note. */\n onToggleFlag?: (id: string) => void;\n\n /* ----- Labels / chrome ----- */\n /** Panel heading. Defaults to the localised \"Notes\". */\n title?: string;\n /** Composer placeholder. */\n composerPlaceholder?: string;\n /** Save-button label. */\n addNoteLabel?: string;\n /** Rendered when there are no notes. */\n emptyState?: ReactNode;\n /** Accessible name for the panel region (defaults to `title`). */\n 'aria-label'?: string;\n}\n\n/* The timeline row. The addressed note wears a solid inline-start bar the\n others do not — a shape channel, so the mark is not colour alone. Every row\n reserves the bar's width in `transparent`, so marking one shifts nothing. */\nconst noteItemVariants = cva(\n 'ds:flex ds:flex-col ds:rounded-[var(--radius-md)] ds:border-s-2 ds:ps-[var(--spacing-sm)]',\n {\n variants: {\n current: {\n true: 'ds:border-[color:var(--info)] ds:bg-[color:var(--info)]/10 ds:focus:outline-[length:var(--focus-ring-width)] ds:focus:outline-solid ds:focus:outline-[color:var(--ring)] ds:focus:outline-offset-[length:var(--focus-ring-offset)]',\n false: 'ds:border-transparent',\n },\n },\n defaultVariants: { current: false },\n },\n);\n\n/** Strip tags / entities to test whether a rich draft holds real content. */\nfunction hasRichContent(html: string): boolean {\n if (!html) return false;\n if (/<img\\b/i.test(html)) return true;\n return (\n html\n .replace(/<[^>]*>/g, '')\n .replace(/&nbsp;/gi, ' ')\n .trim().length > 0\n );\n}\n\nexport const NotesPanel = forwardRef<HTMLElement, NotesPanelProps>(\n function NotesPanel(\n {\n id,\n notes,\n onAddNote,\n currentNoteId,\n currentNoteKey,\n composer = 'rich',\n editorToolbar = 'standard',\n redactor,\n imageUploadUrl,\n showClinicalToggle = true,\n canAddClinicalNote = true,\n clinicalGatedReason,\n defaultClinical = false,\n onRequestAiDraft,\n aiDraftFormat,\n aiPrivacyNotice,\n onDictate,\n onProofread,\n onAutoFormat,\n onTogglePin,\n onToggleFlag,\n title,\n composerPlaceholder,\n addNoteLabel,\n emptyState,\n className,\n 'aria-label': ariaLabel,\n ...rest\n },\n ref,\n ) {\n const { t } = useTranslation();\n const editorRef = useRef<RichTextEditorHandle>(null);\n const [draft, setDraft] = useState('');\n const [clinical, setClinical] = useState(defaultClinical);\n\n const heading = title ?? t('notesPanel.title', { defaultValue: 'Notes' });\n const headingId = useId();\n const placeholder =\n composerPlaceholder ??\n t('notesPanel.placeholder', { defaultValue: 'Add a note…' });\n const composerLabel = t('notesPanel.composerLabel', {\n defaultValue: 'New note',\n });\n\n // Live content check: plain reads the draft directly; rich strips the draft\n // (debounced) for the disabled state but commits from the editor handle.\n const hasContent =\n composer === 'rich' ? hasRichContent(draft) : draft.trim().length > 0;\n\n const commit = useCallback(() => {\n if (!onAddNote) return;\n if (composer === 'rich') {\n const html = editorRef.current?.getHTML() ?? draft;\n if (!hasRichContent(html)) return;\n onAddNote({ content: html, clinical });\n editorRef.current?.clear();\n } else {\n const text = draft.trim();\n if (!text) return;\n onAddNote({ content: text, clinical });\n }\n setDraft('');\n setClinical(defaultClinical);\n }, [composer, draft, clinical, defaultClinical, onAddNote]);\n\n // Pinned notes lead; order within each group is preserved.\n const ordered = [...notes].sort(\n (a, b) => Number(b.pinned ?? false) - Number(a.pinned ?? false),\n );\n\n /* ----- The addressed note (see `currentNoteId`) ----- */\n const currentItemRef = useRef<HTMLLIElement>(null);\n useEffect(() => {\n if (!currentNoteId) return;\n // `center`, not `nearest`: nearest parks the note flush against the edge\n // of the scroll region, which is the least readable place to land.\n currentItemRef.current?.scrollIntoView({ block: 'center' });\n currentItemRef.current?.focus();\n // `currentNoteKey` is in the deps so a REPEAT address of the same note\n // re-runs — see the prop doc. Addressing is a request, not a value.\n }, [currentNoteId, currentNoteKey]);\n\n /* ----- Agent handle (structural reads + composer / toggles) ----- */\n const notesRef = useRef(notes);\n notesRef.current = notes;\n const onAddNoteRef = useRef(onAddNote);\n onAddNoteRef.current = onAddNote;\n const onTogglePinRef = useRef(onTogglePin);\n onTogglePinRef.current = onTogglePin;\n const onToggleFlagRef = useRef(onToggleFlag);\n onToggleFlagRef.current = onToggleFlag;\n const canAddClinicalRef = useRef(canAddClinicalNote);\n canAddClinicalRef.current = canAddClinicalNote;\n const currentNoteIdRef = useRef(currentNoteId);\n currentNoteIdRef.current = currentNoteId;\n\n const rootRef = useRef<HTMLElement>(null);\n useImperativeHandle(ref, () => rootRef.current as HTMLElement, []);\n\n const handle = useMemo<NotesPanelHandle>(\n () => ({\n // Ids + flags only — never the note body or author (both PHI).\n getNotes: () =>\n notesRef.current.map((n) => ({\n id: n.id,\n pinned: !!n.pinned,\n flagged: !!n.flagged,\n clinical: !!n.clinical,\n })),\n canAddNote: () => !!onAddNoteRef.current,\n canAddClinical: () => canAddClinicalRef.current,\n getCurrentNoteId: () => currentNoteIdRef.current ?? null,\n addNote: (submission) => {\n // A clinical submission requires the permission gate to be open.\n if (submission.clinical && !canAddClinicalRef.current) return;\n onAddNoteRef.current?.(submission);\n },\n togglePin: (noteId) => onTogglePinRef.current?.(noteId),\n toggleFlag: (noteId) => onToggleFlagRef.current?.(noteId),\n }),\n [],\n );\n useAgentRegistration(notesPanelAgent, handle, id);\n\n return (\n <section\n ref={rootRef}\n data-component=\"notes-panel\"\n data-component-id={id}\n aria-labelledby={ariaLabel ? undefined : headingId}\n aria-label={ariaLabel}\n className={['ds:flex ds:flex-col', className].filter(Boolean).join(' ')}\n {...rest}\n >\n {/* Shared rail header — pins to the top of the panel's scroll region\n while the composer + note timeline scroll beneath it. The rail\n injects the favourite / close actions via PanelHeaderActionsProvider. */}\n <PanelHeader\n title={heading}\n icon={<NotebookPen aria-hidden=\"true\" />}\n headingId={ariaLabel ? undefined : headingId}\n sticky\n divider\n />\n\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:p-[var(--spacing-md)]\">\n {onAddNote ? (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]\">\n {composer === 'rich' ? (\n <RichTextEditor\n ref={editorRef}\n ariaLabel={composerLabel}\n placeholder={placeholder}\n toolbar={editorToolbar}\n minHeight=\"sm\"\n redactor={redactor}\n imageUploadUrl={imageUploadUrl}\n onChange={({ html }) => setDraft(html)}\n onRequestAiDraft={onRequestAiDraft}\n aiDraftFormat={aiDraftFormat}\n aiPrivacyNotice={aiPrivacyNotice}\n onDictate={onDictate}\n onProofread={onProofread}\n onAutoFormat={onAutoFormat}\n />\n ) : (\n <TextArea\n value={draft}\n onChange={(event) => setDraft(event.target.value)}\n placeholder={placeholder}\n autoResize\n minRows={2}\n maxRows={6}\n aria-label={composerLabel}\n />\n )}\n <div\n className={[\n 'ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]',\n showClinicalToggle ? 'ds:justify-between' : 'ds:justify-end',\n ].join(' ')}\n >\n {showClinicalToggle ? (\n <Checkbox\n size=\"sm\"\n label={t('notesPanel.clinicalToggle', {\n defaultValue: 'Clinical note',\n })}\n checked={clinical}\n onCheckedChange={(next) => setClinical(next === true)}\n disabled={!canAddClinicalNote}\n disabledReason={\n canAddClinicalNote\n ? undefined\n : (clinicalGatedReason ??\n t('notesPanel.clinicalGated', {\n defaultValue:\n 'You do not have permission to write clinical notes.',\n }))\n }\n />\n ) : null}\n <Button\n type=\"button\"\n size=\"sm\"\n onClick={commit}\n disabled={!hasContent}\n >\n {addNoteLabel ??\n t('notesPanel.add', { defaultValue: 'Add note' })}\n </Button>\n </div>\n </div>\n ) : null}\n\n {ordered.length > 0 ? (\n <ul className=\"ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-0\">\n {ordered.map((note, index) => {\n const isCurrent =\n currentNoteId != null && note.id === currentNoteId;\n return (\n <li\n key={note.id ?? index}\n ref={isCurrent ? currentItemRef : undefined}\n // Focus lands on the row, not inside the card, so the\n // sentence below and `aria-current` are read out before the\n // note — and the rail's own Escape still bubbles.\n tabIndex={isCurrent ? -1 : undefined}\n aria-current={isCurrent ? 'true' : undefined}\n className={noteItemVariants({ current: isCurrent })}\n >\n {isCurrent ? (\n <span className=\"ds:sr-only\">\n {t('notesPanel.current', {\n defaultValue: 'Current note',\n })}\n </span>\n ) : null}\n {/* Elevated card per note; the list gap (not a separator)\n spaces them. Bodies clamp to five lines with read-more —\n except the addressed one, which is what the reader came\n for and opens in full. */}\n <ClinicalNoteCard\n surface=\"elevated\"\n truncate={!isCurrent}\n {...note}\n onTogglePin={\n onTogglePin && note.id\n ? () => onTogglePin(note.id as string)\n : undefined\n }\n onToggleFlag={\n onToggleFlag && note.id\n ? () => onToggleFlag(note.id as string)\n : undefined\n }\n />\n </li>\n );\n })}\n </ul>\n ) : (\n (emptyState ?? (\n <p className=\"ds:m-0 type-body-sm ds:text-[color:var(--muted-foreground)]\">\n {t('notesPanel.empty', { defaultValue: 'No notes yet.' })}\n </p>\n ))\n )}\n </div>\n </section>\n );\n },\n);\n"],"names":["__iconNode","NotebookPen","createLucideIcon","notesPanelAgent","handle","args","noteItemVariants","cva","hasRichContent","html","NotesPanel","forwardRef","id","notes","onAddNote","currentNoteId","currentNoteKey","composer","editorToolbar","redactor","imageUploadUrl","showClinicalToggle","canAddClinicalNote","clinicalGatedReason","defaultClinical","onRequestAiDraft","aiDraftFormat","aiPrivacyNotice","onDictate","onProofread","onAutoFormat","onTogglePin","onToggleFlag","title","composerPlaceholder","addNoteLabel","emptyState","className","ariaLabel","rest","ref","t","useTranslation","editorRef","useRef","draft","setDraft","useState","clinical","setClinical","heading","headingId","useId","placeholder","composerLabel","hasContent","commit","useCallback","_a","_b","text","ordered","a","b","currentItemRef","useEffect","notesRef","onAddNoteRef","onTogglePinRef","onToggleFlagRef","canAddClinicalRef","currentNoteIdRef","rootRef","useImperativeHandle","useMemo","n","submission","noteId","useAgentRegistration","jsxs","jsx","PanelHeader","RichTextEditor","TextArea","event","Checkbox","next","Button","note","index","isCurrent","ClinicalNoteCard"],"mappings":";;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,kEAAkE,KAAK,SAAQ,CAAE;AAAA,EAC/F,CAAC,QAAQ,EAAE,GAAG,U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