@alfadocs/ui-kit 1.145.0 → 1.147.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 (72) hide show
  1. package/dist/_chunks/prescription-history-CFs3JMIE.js +1773 -0
  2. package/dist/_chunks/registry-connection-panel-BEAkwivy.js +503 -0
  3. package/dist/agent-catalog.json +115 -1
  4. package/dist/agent-i18n/en.json +12 -0
  5. package/dist/browser-support.js +1 -1
  6. package/dist/components/_shared/medication.d.ts +4 -0
  7. package/dist/components/index.d.ts +1 -0
  8. package/dist/components/registry-connection-panel/index.d.ts +3 -0
  9. package/dist/components/registry-connection-panel/index.js +5 -0
  10. package/dist/components/registry-connection-panel/registry-connection-panel.agent.d.ts +4 -0
  11. package/dist/components/registry-connection-panel/registry-connection-panel.d.ts +67 -0
  12. package/dist/i18n/locales/ar.d.ts +31 -0
  13. package/dist/i18n/locales/ar.js +32 -1
  14. package/dist/i18n/locales/de.d.ts +31 -0
  15. package/dist/i18n/locales/de.js +32 -1
  16. package/dist/i18n/locales/el.d.ts +31 -0
  17. package/dist/i18n/locales/el.js +32 -1
  18. package/dist/i18n/locales/en.d.ts +31 -0
  19. package/dist/i18n/locales/en.js +32 -1
  20. package/dist/i18n/locales/es.d.ts +31 -0
  21. package/dist/i18n/locales/es.js +32 -1
  22. package/dist/i18n/locales/fr.d.ts +31 -0
  23. package/dist/i18n/locales/fr.js +32 -1
  24. package/dist/i18n/locales/hi.d.ts +31 -0
  25. package/dist/i18n/locales/hi.js +32 -1
  26. package/dist/i18n/locales/it.d.ts +31 -0
  27. package/dist/i18n/locales/it.js +32 -1
  28. package/dist/i18n/locales/ja.d.ts +31 -0
  29. package/dist/i18n/locales/ja.js +32 -1
  30. package/dist/i18n/locales/nl.d.ts +31 -0
  31. package/dist/i18n/locales/nl.js +32 -1
  32. package/dist/i18n/locales/pl.d.ts +31 -0
  33. package/dist/i18n/locales/pl.js +32 -1
  34. package/dist/i18n/locales/pt.d.ts +31 -0
  35. package/dist/i18n/locales/pt.js +32 -1
  36. package/dist/i18n/locales/ro.d.ts +31 -0
  37. package/dist/i18n/locales/ro.js +32 -1
  38. package/dist/i18n/locales/ru.d.ts +31 -0
  39. package/dist/i18n/locales/ru.js +32 -1
  40. package/dist/i18n/locales/sq.d.ts +31 -0
  41. package/dist/i18n/locales/sq.js +32 -1
  42. package/dist/i18n/locales/sv.d.ts +31 -0
  43. package/dist/i18n/locales/sv.js +32 -1
  44. package/dist/i18n/locales/tr.d.ts +31 -0
  45. package/dist/i18n/locales/tr.js +32 -1
  46. package/dist/i18n/locales/zh.d.ts +31 -0
  47. package/dist/i18n/locales/zh.js +32 -1
  48. package/dist/index.js +859 -857
  49. package/dist/locales/ar.json +32 -1
  50. package/dist/locales/de.json +32 -1
  51. package/dist/locales/el.json +32 -1
  52. package/dist/locales/en.json +32 -1
  53. package/dist/locales/es.json +32 -1
  54. package/dist/locales/fr.json +32 -1
  55. package/dist/locales/hi.json +32 -1
  56. package/dist/locales/it.json +32 -1
  57. package/dist/locales/ja.json +32 -1
  58. package/dist/locales/nl.json +32 -1
  59. package/dist/locales/pl.json +32 -1
  60. package/dist/locales/pt.json +32 -1
  61. package/dist/locales/ro.json +32 -1
  62. package/dist/locales/ru.json +32 -1
  63. package/dist/locales/sq.json +32 -1
  64. package/dist/locales/sv.json +32 -1
  65. package/dist/locales/tr.json +32 -1
  66. package/dist/locales/zh.json +32 -1
  67. package/dist/patterns/prescription/index.js +1 -1
  68. package/dist/patterns/prescription/prescription-composer.d.ts +2 -0
  69. package/dist/patterns/prescription/prescription-sheet.d.ts +7 -1
  70. package/dist/patterns/prescription/prescription-validation.d.ts +7 -3
  71. package/package.json +5 -1
  72. package/dist/_chunks/prescription-history-CD3e3U3I.js +0 -1719
@@ -0,0 +1,503 @@
1
+ import { jsx as t, jsxs as v } from "react/jsx-runtime";
2
+ import { forwardRef as Be, useId as k, useRef as h, useState as g, useEffect as T, useCallback as f, useMemo as me, useImperativeHandle as _e } from "react";
3
+ import { useTranslation as He } from "react-i18next";
4
+ import { u as De } from "./registry-DvAUVLHh.js";
5
+ import { u as Ke } from "./use-controllable-state-BiY4xTzM.js";
6
+ import { f as Oe } from "./intl-locale-FWh-Y5_3.js";
7
+ import { A as x } from "./alert-C4WKViaS.js";
8
+ import { B as Ee } from "./badge-BUk4RjTS.js";
9
+ import { B as q } from "./button-Dp4j9ygh.js";
10
+ import { F as pe } from "./form-field-CyHfOVKF.js";
11
+ import { P as We } from "./panel-header-CbtlTe85.js";
12
+ import { P as he } from "./panel-subview-DjBwNV16.js";
13
+ import { P as Ze } from "./password-input-SJGHFdOO.js";
14
+ import { S as $e } from "./scroll-area-CY5SLYNw.js";
15
+ import { S as Je } from "./select-Bw5FvGJ7.js";
16
+ import { T as ge } from "./text-input-B6iAgCr3.js";
17
+ import { S as fe } from "./settings-d25ju_6L.js";
18
+ import { C as Ge } from "./check-DrFSN__t.js";
19
+ import { C as Qe } from "./circle-alert-rGDZ73Wh.js";
20
+ import { c as Ue } from "./createLucideIcon-DhHxpK9K.js";
21
+ /**
22
+ * @license lucide-react v1.22.0 - ISC
23
+ *
24
+ * This source code is licensed under the ISC license.
25
+ * See the LICENSE file in the root directory of this source tree.
26
+ */
27
+ const Xe = [
28
+ ["path", { d: "m19 5 3-3", key: "yk6iyv" }],
29
+ ["path", { d: "m2 22 3-3", key: "19mgm9" }],
30
+ [
31
+ "path",
32
+ { d: "M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z", key: "goz73y" }
33
+ ],
34
+ ["path", { d: "M7.5 13.5 10 11", key: "7xgeeb" }],
35
+ ["path", { d: "M10.5 16.5 13 14", key: "10btkg" }],
36
+ [
37
+ "path",
38
+ { d: "m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z", key: "1snsnr" }
39
+ ]
40
+ ], Ye = Ue("unplug", Xe), et = {
41
+ id: "registry-connection-panel",
42
+ capabilities: ["view_change", "submit"],
43
+ state: {
44
+ status: {
45
+ type: "'connected' | 'disconnected' | 'incomplete'",
46
+ descriptionKey: "ui.agent.registryConnectionPanel.state.status",
47
+ description: "Connection state: connected (a session is open), disconnected (settings saved, no session) or incomplete (settings not saved yet).",
48
+ read: (i) => i.getStatus()
49
+ },
50
+ view: {
51
+ type: "'overview' | 'connect'",
52
+ descriptionKey: "ui.agent.registryConnectionPanel.state.view",
53
+ description: "The open view: the overview (status and settings) or the connect view (the one-time code step).",
54
+ read: (i) => i.getView()
55
+ }
56
+ },
57
+ actions: {
58
+ set_view: {
59
+ safety: "write",
60
+ argsType: "{ view: 'overview' | 'connect' }",
61
+ argsSchema: {
62
+ type: "object",
63
+ properties: {
64
+ view: { type: "string", enum: ["overview", "connect"] }
65
+ },
66
+ required: ["view"]
67
+ },
68
+ idempotent: !0,
69
+ descriptionKey: "ui.agent.registryConnectionPanel.actions.setView",
70
+ description: "Open the overview or the connect view (the code step). Nothing is sent to the registry.",
71
+ examples: [{ args: { view: "connect" }, note: "Open the code step." }],
72
+ invoke: (i, n) => i.setView(n.view)
73
+ },
74
+ submit_settings: {
75
+ safety: "write",
76
+ idempotent: !0,
77
+ openWorld: !0,
78
+ errors: [
79
+ "A required field is empty: the panel shows the message and does not call the host.",
80
+ "The host refused the settings. The panel shows the host's message."
81
+ ],
82
+ descriptionKey: "ui.agent.registryConnectionPanel.actions.submitSettings",
83
+ description: "Save the settings as they stand in the panel, through the host. The agent supplies no values and reads none: the fields hold credentials. Required fields are checked first.",
84
+ invoke: (i) => i.saveSettings()
85
+ },
86
+ confirm_code: {
87
+ safety: "write",
88
+ argsType: "{ code: string }",
89
+ argsSchema: {
90
+ type: "object",
91
+ properties: {
92
+ code: {
93
+ type: "string",
94
+ description: "The one-time code the registry sent."
95
+ }
96
+ },
97
+ required: ["code"]
98
+ },
99
+ openWorld: !0,
100
+ errors: [
101
+ "The code is empty: the panel refuses it without calling the host.",
102
+ "The host refused the code. The panel shows the host's message."
103
+ ],
104
+ descriptionKey: "ui.agent.registryConnectionPanel.actions.confirmCode",
105
+ description: "Confirm the one-time code, through the host, to open a session. Read status afterwards: the host changes it on success and the panel returns to the overview.",
106
+ invoke: (i, n) => i.connect(n.code)
107
+ }
108
+ },
109
+ domHooks: {
110
+ root: {
111
+ attr: "data-component",
112
+ value: "registry-connection-panel",
113
+ description: "Marks the RegistryConnectionPanel region."
114
+ },
115
+ instanceId: {
116
+ attr: "data-component-id",
117
+ sourceProp: "id",
118
+ description: "Sourced from the id prop. Required to address a specific panel from the agent. The root also carries data-status and data-view."
119
+ }
120
+ }
121
+ };
122
+ function ve(i) {
123
+ return typeof i == "object" && i !== null && typeof i.then == "function";
124
+ }
125
+ function tt(i) {
126
+ if (typeof globalThis.reportError == "function") {
127
+ globalThis.reportError(i);
128
+ return;
129
+ }
130
+ setTimeout(() => {
131
+ throw i;
132
+ }, 0);
133
+ }
134
+ const nt = {
135
+ connected: "success",
136
+ disconnected: "neutral",
137
+ incomplete: "warning"
138
+ }, ye = "ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:p-[var(--spacing-md)]", ot = Be(
139
+ ({
140
+ registryName: i,
141
+ status: n,
142
+ connectedUntil: y,
143
+ notice: W,
144
+ fields: N,
145
+ values: R,
146
+ fieldErrors: I,
147
+ onSaveSettings: Z,
148
+ codeExplanation: $,
149
+ onRequestCode: L,
150
+ onConnect: J,
151
+ view: Ce,
152
+ defaultView: we = "overview",
153
+ onViewChange: be,
154
+ error: G,
155
+ id: Q,
156
+ className: Pe
157
+ }, Se) => {
158
+ const { t: r, i18n: ke } = He("ui"), U = k(), X = k(), Y = k(), Te = k(), ee = h(null), A = h(null), [xe, C] = Ke({
159
+ value: Ce,
160
+ defaultValue: we,
161
+ onChange: be
162
+ }), u = xe ?? "overview", qe = JSON.stringify(R), [V, te] = g(() => ({
163
+ ...R
164
+ }));
165
+ T(() => {
166
+ te({ ...R });
167
+ }, [qe]);
168
+ const [Ne, ne] = g({}), [w, oe] = g(""), [z, b] = g(), [Re, M] = g(!1), [F, re] = g(
169
+ () => /* @__PURE__ */ new Set()
170
+ ), m = h(/* @__PURE__ */ new Set()), P = h(!0);
171
+ T(() => (P.current = !0, () => {
172
+ P.current = !1;
173
+ }), []);
174
+ const c = h({
175
+ status: n,
176
+ view: u,
177
+ draft: V,
178
+ fields: N,
179
+ onSaveSettings: Z,
180
+ onRequestCode: L,
181
+ onConnect: J,
182
+ code: w
183
+ });
184
+ c.current = {
185
+ status: n,
186
+ view: u,
187
+ draft: V,
188
+ fields: N,
189
+ onSaveSettings: Z,
190
+ onRequestCode: L,
191
+ onConnect: J,
192
+ code: w
193
+ };
194
+ const p = f(
195
+ (e, s) => {
196
+ if (m.current.has(e)) return Promise.resolve();
197
+ let o;
198
+ try {
199
+ o = s();
200
+ } catch (d) {
201
+ return tt(d), Promise.resolve();
202
+ }
203
+ if (!ve(o)) return Promise.resolve();
204
+ m.current.add(e), re(new Set(m.current));
205
+ const a = () => {
206
+ m.current.delete(e), P.current && re(new Set(m.current));
207
+ };
208
+ return Promise.resolve(o).then(a, a);
209
+ },
210
+ []
211
+ ), S = f(
212
+ (e) => {
213
+ e !== c.current.view && C(e);
214
+ },
215
+ [C]
216
+ ), ie = h(n);
217
+ T(() => {
218
+ const e = ie.current;
219
+ ie.current = n, e !== "connected" && n === "connected" && c.current.view === "connect" && C("overview");
220
+ }, [n, C]), T(() => {
221
+ u !== "connect" && (oe(""), b(void 0), M(!1));
222
+ }, [u]);
223
+ const se = r("registryConnectionPanel.errors.required"), ae = f(() => {
224
+ const { fields: e, draft: s } = c.current, o = {};
225
+ for (const a of e)
226
+ a.required !== !1 && (a.kind === "secret" && a.stored || (s[a.name] ?? "").trim() === "" && (o[a.name] = se));
227
+ return o;
228
+ }, [se]), j = f(() => {
229
+ var o, a;
230
+ const e = ae();
231
+ ne(e);
232
+ const s = Object.keys(e)[0];
233
+ if (s !== void 0) {
234
+ const d = (a = (o = ee.current) == null ? void 0 : o.querySelector(`[data-field-name="${s}"]`)) == null ? void 0 : a.querySelector('input, button, [role="combobox"]');
235
+ return d == null || d.focus(), Promise.resolve();
236
+ }
237
+ return p(
238
+ "save",
239
+ () => c.current.onSaveSettings(c.current.draft)
240
+ );
241
+ }, [ae, p]), B = (e, s) => {
242
+ te((o) => ({ ...o, [e]: s })), ne((o) => {
243
+ if (!(e in o)) return o;
244
+ const { [e]: a, ...d } = o;
245
+ return d;
246
+ });
247
+ }, _ = f(
248
+ (e) => {
249
+ var o;
250
+ const s = e.trim();
251
+ return s === "" ? (b(r("registryConnectionPanel.errors.codeRequired")), (o = A.current) == null || o.focus(), Promise.resolve()) : (b(void 0), p("connect", () => c.current.onConnect(s)));
252
+ },
253
+ [p, r]
254
+ ), Ie = f(
255
+ () => p("requestCode", () => {
256
+ var s, o;
257
+ const e = (o = (s = c.current).onRequestCode) == null ? void 0 : o.call(s);
258
+ if (ve(e))
259
+ return Promise.resolve(e).then(() => {
260
+ P.current && M(!0);
261
+ });
262
+ M(!0);
263
+ }),
264
+ [p]
265
+ ), H = me(
266
+ () => ({
267
+ getStatus: () => c.current.status,
268
+ getView: () => c.current.view,
269
+ setView: S,
270
+ saveSettings: j,
271
+ connect: (e) => _(e)
272
+ }),
273
+ [S, j, _]
274
+ );
275
+ _e(Se, () => H, [H]), De(et, H, Q);
276
+ const ce = Oe(ke.language), de = me(() => n !== "connected" || !y || Number.isNaN(y.getTime()) ? null : new Intl.DateTimeFormat(ce, { timeStyle: "short" }).format(
277
+ y
278
+ ), [n, y, ce]), Le = n === "connected" ? de ? r("registryConnectionPanel.status.connectedUntil", { time: de }) : r("registryConnectionPanel.status.connected") : r(n === "incomplete" ? "registryConnectionPanel.status.incomplete" : "registryConnectionPanel.status.disconnected"), Ae = n === "connected" ? /* @__PURE__ */ t(Ge, { "aria-hidden": "true" }) : n === "incomplete" ? /* @__PURE__ */ t(Qe, { "aria-hidden": "true" }) : /* @__PURE__ */ t(Ye, { "aria-hidden": "true" }), D = n === "incomplete" ? r("registryConnectionPanel.help.incomplete", { registryName: i }) : n === "disconnected" ? r("registryConnectionPanel.help.disconnected", { registryName: i }) : null, le = (e) => G ? /* @__PURE__ */ t(x, { variant: "error", "data-registry-error": e, children: /* @__PURE__ */ t(x.Description, { children: G }) }) : null, Ve = (e) => {
279
+ e.preventDefault(), j();
280
+ }, ze = (e) => {
281
+ e.preventDefault(), _(w);
282
+ }, Me = (e) => {
283
+ const s = e.kind ?? "text", o = (I == null ? void 0 : I[e.name]) ?? Ne[e.name], a = s === "secret" && e.stored === !0, d = [
284
+ e.hint,
285
+ a ? r("registryConnectionPanel.secretStored") : void 0
286
+ ].filter(Boolean).join(" ") || void 0, ue = e.required === !1, je = !ue && !a, O = V[e.name] ?? "", E = o ? "error" : void 0;
287
+ return /* @__PURE__ */ t(
288
+ pe,
289
+ {
290
+ "data-field-name": e.name,
291
+ label: e.label,
292
+ description: d,
293
+ error: o,
294
+ ...ue ? { optional: !0 } : { required: je },
295
+ children: s === "select" ? /* @__PURE__ */ t(
296
+ Je,
297
+ {
298
+ options: (e.options ?? []).map((l) => ({
299
+ value: l.value,
300
+ label: l.label
301
+ })),
302
+ value: O,
303
+ placeholder: r("registryConnectionPanel.choose"),
304
+ tone: E,
305
+ onValueChange: (l) => B(e.name, l)
306
+ }
307
+ ) : s === "secret" ? /* @__PURE__ */ t(
308
+ Ze,
309
+ {
310
+ value: O,
311
+ maxLength: e.maxLength,
312
+ inputMode: e.inputMode,
313
+ autoCapitalize: e.autoCapitalize,
314
+ autoComplete: "off",
315
+ tone: E,
316
+ onChange: (l) => B(e.name, l.target.value)
317
+ }
318
+ ) : /* @__PURE__ */ t(
319
+ ge,
320
+ {
321
+ value: O,
322
+ maxLength: e.maxLength,
323
+ inputMode: e.inputMode,
324
+ autoCapitalize: e.autoCapitalize,
325
+ autoComplete: "off",
326
+ tone: E,
327
+ onChange: (l) => B(e.name, l.target.value)
328
+ }
329
+ )
330
+ },
331
+ e.name
332
+ );
333
+ }, Fe = r(n === "connected" ? "registryConnectionPanel.connectAgain" : "registryConnectionPanel.connect"), K = n === "incomplete";
334
+ return /* @__PURE__ */ t(
335
+ "section",
336
+ {
337
+ ref: ee,
338
+ "data-component": "registry-connection-panel",
339
+ "data-component-id": Q,
340
+ "data-status": n,
341
+ "data-view": u,
342
+ "aria-labelledby": U,
343
+ className: ["ds:flex ds:h-full ds:min-h-0 ds:flex-col", Pe].filter(Boolean).join(" "),
344
+ children: /* @__PURE__ */ v(he.Host, { className: "ds:flex-1", children: [
345
+ /* @__PURE__ */ t(
346
+ We,
347
+ {
348
+ title: r("registryConnectionPanel.title", { registryName: i }),
349
+ icon: /* @__PURE__ */ t(fe, { "aria-hidden": "true" }),
350
+ headingId: U,
351
+ divider: !0
352
+ }
353
+ ),
354
+ /* @__PURE__ */ t($e, { orientation: "vertical", className: "ds:min-h-0 ds:flex-1", children: /* @__PURE__ */ v("div", { className: ye, children: [
355
+ W ? /* @__PURE__ */ t(x, { variant: "info", "data-registry-notice": "", children: /* @__PURE__ */ t(x.Description, { children: W }) }) : null,
356
+ u === "overview" ? le("overview") : null,
357
+ /* @__PURE__ */ v(
358
+ "div",
359
+ {
360
+ "data-registry-status": "",
361
+ className: "ds:flex ds:flex-col ds:items-start ds:gap-[var(--spacing-sm)]",
362
+ children: [
363
+ /* @__PURE__ */ t(
364
+ Ee,
365
+ {
366
+ size: "sm",
367
+ variant: nt[n],
368
+ leading: Ae,
369
+ children: Le
370
+ }
371
+ ),
372
+ D ? /* @__PURE__ */ t(
373
+ "p",
374
+ {
375
+ id: X,
376
+ className: "ds:m-0 type-body-sm ds:text-muted-foreground",
377
+ children: D
378
+ }
379
+ ) : null,
380
+ /* @__PURE__ */ t(
381
+ q,
382
+ {
383
+ type: "button",
384
+ intent: n === "connected" ? "secondary" : "primary",
385
+ "aria-disabled": K || void 0,
386
+ "aria-describedby": K && D ? X : void 0,
387
+ onClick: () => {
388
+ K || S("connect");
389
+ },
390
+ "data-action": "connect",
391
+ className: "ds:min-h-[var(--min-target-size)]",
392
+ children: Fe
393
+ }
394
+ )
395
+ ]
396
+ }
397
+ ),
398
+ /* @__PURE__ */ v(
399
+ "form",
400
+ {
401
+ id: Te,
402
+ noValidate: !0,
403
+ onSubmit: Ve,
404
+ className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
405
+ children: [
406
+ /* @__PURE__ */ t("h3", { className: "ds:m-0 type-title-item", children: r("registryConnectionPanel.settings") }),
407
+ N.map(Me),
408
+ /* @__PURE__ */ t(
409
+ q,
410
+ {
411
+ type: "submit",
412
+ intent: n === "incomplete" ? "primary" : "secondary",
413
+ loading: F.has("save"),
414
+ "data-action": "save",
415
+ className: "ds:min-h-[var(--min-target-size)] ds:self-start",
416
+ children: r("registryConnectionPanel.save")
417
+ }
418
+ )
419
+ ]
420
+ }
421
+ )
422
+ ] }) }),
423
+ /* @__PURE__ */ t(
424
+ he,
425
+ {
426
+ open: u === "connect",
427
+ title: r("registryConnectionPanel.connectTitle", { registryName: i }),
428
+ icon: /* @__PURE__ */ t(fe, { "aria-hidden": "true" }),
429
+ backLabel: r("registryConnectionPanel.back"),
430
+ headingLevel: 2,
431
+ initialFocusRef: A,
432
+ onBack: () => {
433
+ m.current.has("connect") || S("overview");
434
+ },
435
+ footer: /* @__PURE__ */ t(
436
+ q,
437
+ {
438
+ type: "submit",
439
+ form: Y,
440
+ loading: F.has("connect"),
441
+ "data-action": "confirm",
442
+ className: "ds:min-h-[var(--min-target-size)]",
443
+ children: r("common.confirm")
444
+ }
445
+ ),
446
+ children: /* @__PURE__ */ v(
447
+ "form",
448
+ {
449
+ id: Y,
450
+ noValidate: !0,
451
+ onSubmit: ze,
452
+ className: `ds:-m-[var(--panel-subview-inset)] ${ye}`,
453
+ children: [
454
+ le("connect"),
455
+ $ ? /* @__PURE__ */ t("p", { className: "ds:m-0 type-body", children: $ }) : null,
456
+ L ? /* @__PURE__ */ t(
457
+ q,
458
+ {
459
+ type: "button",
460
+ intent: "secondary",
461
+ loading: F.has("requestCode"),
462
+ onClick: () => void Ie(),
463
+ "data-action": "request-code",
464
+ className: "ds:min-h-[var(--min-target-size)] ds:self-start",
465
+ children: r(Re ? "registryConnectionPanel.sendCodeAgain" : "registryConnectionPanel.sendCode")
466
+ }
467
+ ) : null,
468
+ /* @__PURE__ */ t(
469
+ pe,
470
+ {
471
+ label: r("registryConnectionPanel.codeLabel"),
472
+ required: !0,
473
+ error: z,
474
+ children: /* @__PURE__ */ t(
475
+ ge,
476
+ {
477
+ ref: A,
478
+ value: w,
479
+ autoComplete: "one-time-code",
480
+ autoCapitalize: "characters",
481
+ tone: z ? "error" : void 0,
482
+ onChange: (e) => {
483
+ oe(e.target.value), z && b(void 0);
484
+ }
485
+ }
486
+ )
487
+ }
488
+ )
489
+ ]
490
+ }
491
+ )
492
+ }
493
+ )
494
+ ] })
495
+ }
496
+ );
497
+ }
498
+ );
499
+ ot.displayName = "RegistryConnectionPanel";
500
+ export {
501
+ ot as R
502
+ };
503
+ //# sourceMappingURL=registry-connection-panel-BEAkwivy.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "packageVersion": "1.145.0",
3
+ "packageVersion": "1.147.0",
4
4
  "components": [
5
5
  {
6
6
  "kind": "component",
@@ -15605,6 +15605,109 @@
15605
15605
  }
15606
15606
  }
15607
15607
  },
15608
+ {
15609
+ "kind": "component",
15610
+ "id": "registry-connection-panel",
15611
+ "capabilities": [
15612
+ "view_change",
15613
+ "submit"
15614
+ ],
15615
+ "state": [
15616
+ {
15617
+ "name": "status",
15618
+ "type": "'connected' | 'disconnected' | 'incomplete'",
15619
+ "description": "Connection state: connected (a session is open), disconnected (settings saved, no session) or incomplete (settings not saved yet).",
15620
+ "descriptionKey": "ui.agent.registryConnectionPanel.state.status"
15621
+ },
15622
+ {
15623
+ "name": "view",
15624
+ "type": "'overview' | 'connect'",
15625
+ "description": "The open view: the overview (status and settings) or the connect view (the one-time code step).",
15626
+ "descriptionKey": "ui.agent.registryConnectionPanel.state.view"
15627
+ }
15628
+ ],
15629
+ "actions": [
15630
+ {
15631
+ "name": "set_view",
15632
+ "safety": "write",
15633
+ "argsType": "{ view: 'overview' | 'connect' }",
15634
+ "argsSchema": {
15635
+ "type": "object",
15636
+ "properties": {
15637
+ "view": {
15638
+ "type": "string",
15639
+ "enum": [
15640
+ "overview",
15641
+ "connect"
15642
+ ]
15643
+ }
15644
+ },
15645
+ "required": [
15646
+ "view"
15647
+ ]
15648
+ },
15649
+ "idempotent": true,
15650
+ "examples": [
15651
+ {
15652
+ "args": {
15653
+ "view": "connect"
15654
+ },
15655
+ "note": "Open the code step."
15656
+ }
15657
+ ],
15658
+ "description": "Open the overview or the connect view (the code step). Nothing is sent to the registry.",
15659
+ "descriptionKey": "ui.agent.registryConnectionPanel.actions.setView"
15660
+ },
15661
+ {
15662
+ "name": "submit_settings",
15663
+ "safety": "write",
15664
+ "idempotent": true,
15665
+ "openWorld": true,
15666
+ "errors": [
15667
+ "A required field is empty: the panel shows the message and does not call the host.",
15668
+ "The host refused the settings. The panel shows the host's message."
15669
+ ],
15670
+ "description": "Save the settings as they stand in the panel, through the host. The agent supplies no values and reads none: the fields hold credentials. Required fields are checked first.",
15671
+ "descriptionKey": "ui.agent.registryConnectionPanel.actions.submitSettings"
15672
+ },
15673
+ {
15674
+ "name": "confirm_code",
15675
+ "safety": "write",
15676
+ "argsType": "{ code: string }",
15677
+ "argsSchema": {
15678
+ "type": "object",
15679
+ "properties": {
15680
+ "code": {
15681
+ "type": "string",
15682
+ "description": "The one-time code the registry sent."
15683
+ }
15684
+ },
15685
+ "required": [
15686
+ "code"
15687
+ ]
15688
+ },
15689
+ "openWorld": true,
15690
+ "errors": [
15691
+ "The code is empty: the panel refuses it without calling the host.",
15692
+ "The host refused the code. The panel shows the host's message."
15693
+ ],
15694
+ "description": "Confirm the one-time code, through the host, to open a session. Read status afterwards: the host changes it on success and the panel returns to the overview.",
15695
+ "descriptionKey": "ui.agent.registryConnectionPanel.actions.confirmCode"
15696
+ }
15697
+ ],
15698
+ "domHooks": {
15699
+ "root": {
15700
+ "attr": "data-component",
15701
+ "value": "registry-connection-panel",
15702
+ "description": "Marks the RegistryConnectionPanel region."
15703
+ },
15704
+ "instanceId": {
15705
+ "attr": "data-component-id",
15706
+ "sourceProp": "id",
15707
+ "description": "Sourced from the id prop. Required to address a specific panel from the agent. The root also carries data-status and data-view."
15708
+ }
15709
+ }
15710
+ },
15608
15711
  {
15609
15712
  "kind": "component",
15610
15713
  "id": "resizable",
@@ -26036,6 +26139,17 @@
26036
26139
  "prescription.send"
26037
26140
  ]
26038
26141
  },
26142
+ {
26143
+ "name": "edit_failed_prescription",
26144
+ "safety": "phi",
26145
+ "description": "Correct a prescription the registry refused. The sheet shows an \"Edit\" button beside \"Send again\" only for a failed send, and only when the host passes onEdit. The kit only calls the host callback: the host reopens the prescription in the composer, prefilled, and sends the corrected one. The packs of a medication may be capped by the host (maxPacks), which is a common reason for a refusal.",
26146
+ "descriptionKey": "ui.agent.prescription.workflows.editFailedPrescription",
26147
+ "uiActions": [],
26148
+ "apiActions": [
26149
+ "prescription.update",
26150
+ "prescription.send"
26151
+ ]
26152
+ },
26039
26153
  {
26040
26154
  "name": "review_history",
26041
26155
  "safety": "phi",
@@ -1500,6 +1500,17 @@
1500
1500
  "reset": "Clear the current token and re-roll the captcha. Irreversible."
1501
1501
  }
1502
1502
  },
1503
+ "registryConnectionPanel": {
1504
+ "state": {
1505
+ "status": "Connection state: connected (a session is open), disconnected (settings saved, no session) or incomplete (settings not saved yet).",
1506
+ "view": "The open view: the overview (status and settings) or the connect view (the one-time code step)."
1507
+ },
1508
+ "actions": {
1509
+ "setView": "Open the overview or the connect view (the code step). Nothing is sent to the registry.",
1510
+ "submitSettings": "Save the settings as they stand in the panel, through the host. The agent supplies no values and reads none: the fields hold credentials. Required fields are checked first.",
1511
+ "confirmCode": "Confirm the one-time code, through the host, to open a session. Read status afterwards: the host changes it on success and the panel returns to the overview."
1512
+ }
1513
+ },
1503
1514
  "resizable": {
1504
1515
  "state": {
1505
1516
  "sizes": "Current per-panel sizes as percentages of the group."
@@ -2321,6 +2332,7 @@
2321
2332
  "printPrescription": "Print the saved prescription. Who prints follows the sheet's printMode, which is 'host' when the record has a send status (an electronic prescription) and 'sheet' otherwise. In host mode the sheet is an on-screen summary: Print and Download PDF only call the host's callbacks, and the host opens the official document the registry issues. In sheet mode the kit prints the sheet through the browser's print dialog, forced to the light theme; under privacy mode it prints masked, exactly as shown. A prescription whose send is under way or failed cannot be printed or shared in either mode. The sheet registers no print action with the agent runtime, so an assistant asks the host to print.",
2322
2333
  "sendPrescription": "Share the sent prescription with the patient by email, SMS or WhatsApp. It cannot be printed or shared until the registry has accepted it. The kit only calls the host callback for the chosen channel: the host builds and sends the message.",
2323
2334
  "resendPrescription": "Send a prescription again after the send to the national registry failed. The sheet shows a \"Send again\" button only for a failed send. The kit only calls the host callback: the host sends to the registry and passes the updated record.",
2335
+ "editFailedPrescription": "Correct a prescription the registry refused. The sheet shows an \"Edit\" button beside \"Send again\" only for a failed send, and only when the host passes onEdit. The kit only calls the host callback: the host reopens the prescription in the composer, prefilled, and sends the corrected one. The packs of a medication may be capped by the host (maxPacks), which is a common reason for a refusal.",
2324
2336
  "reviewHistory": "Read saved prescriptions, newest first: one patient's, or the whole practice's when the table shows a Patient column (date, number, send status, patient name, treatment, care plan, one tag per medication, prescriber, specialty), sorted and filtered by column. Reopening a row and printing it again are host callbacks: the host shows that record in a sheet, which then prints like any other. The table never shows a fiscal code or date of birth, and under privacy mode it masks the patient name."
2325
2337
  }
2326
2338
  },