@ews-admin/global-design-system 1.35.0 → 1.37.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 (61) hide show
  1. package/dist/assistant/index.d.ts +5 -0
  2. package/dist/assistant/index.d.ts.map +1 -0
  3. package/dist/assistant/store.d.ts +17 -0
  4. package/dist/assistant/store.d.ts.map +1 -0
  5. package/dist/assistant/transport.d.ts +20 -0
  6. package/dist/assistant/transport.d.ts.map +1 -0
  7. package/dist/components/AssistantChat/AssistantChat.d.ts +15 -0
  8. package/dist/components/AssistantChat/AssistantChat.d.ts.map +1 -0
  9. package/dist/components/AssistantChat/AssistantChat.types.d.ts +173 -0
  10. package/dist/components/AssistantChat/AssistantChat.types.d.ts.map +1 -0
  11. package/dist/components/AssistantChat/AssistantComposer.d.ts +24 -0
  12. package/dist/components/AssistantChat/AssistantComposer.d.ts.map +1 -0
  13. package/dist/components/AssistantChat/AssistantConfirmationCard.d.ts +20 -0
  14. package/dist/components/AssistantChat/AssistantConfirmationCard.d.ts.map +1 -0
  15. package/dist/components/AssistantChat/AssistantConversationList.d.ts +19 -0
  16. package/dist/components/AssistantChat/AssistantConversationList.d.ts.map +1 -0
  17. package/dist/components/AssistantChat/AssistantMessages.d.ts +21 -0
  18. package/dist/components/AssistantChat/AssistantMessages.d.ts.map +1 -0
  19. package/dist/components/AssistantChat/AssistantSuggestionCard.d.ts +12 -0
  20. package/dist/components/AssistantChat/AssistantSuggestionCard.d.ts.map +1 -0
  21. package/dist/components/AssistantChat/assistantMarkdown.d.ts +14 -0
  22. package/dist/components/AssistantChat/assistantMarkdown.d.ts.map +1 -0
  23. package/dist/components/AssistantChat/index.d.ts +15 -0
  24. package/dist/components/AssistantChat/index.d.ts.map +1 -0
  25. package/dist/components/AssistantLauncher/AssistantLauncher.d.ts +58 -0
  26. package/dist/components/AssistantLauncher/AssistantLauncher.d.ts.map +1 -0
  27. package/dist/components/AssistantLauncher/index.d.ts +3 -0
  28. package/dist/components/AssistantLauncher/index.d.ts.map +1 -0
  29. package/dist/hooks/index.d.ts +2 -0
  30. package/dist/hooks/index.d.ts.map +1 -1
  31. package/dist/hooks/useSpeechRecognition.d.ts +40 -0
  32. package/dist/hooks/useSpeechRecognition.d.ts.map +1 -0
  33. package/dist/index.css +1 -1
  34. package/dist/index.d.ts +418 -2
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.esm.css +1 -1
  37. package/dist/index.esm.js +732 -2
  38. package/dist/index.esm.js.map +1 -1
  39. package/dist/index.js +751 -0
  40. package/dist/index.js.map +1 -1
  41. package/dist/utils/env-config.d.ts +3 -0
  42. package/dist/utils/env-config.d.ts.map +1 -1
  43. package/package.json +2 -1
  44. package/src/assistant/index.ts +11 -0
  45. package/src/assistant/store.ts +77 -0
  46. package/src/assistant/transport.ts +159 -0
  47. package/src/components/AssistantChat/AssistantChat.tsx +390 -0
  48. package/src/components/AssistantChat/AssistantChat.types.ts +171 -0
  49. package/src/components/AssistantChat/AssistantComposer.tsx +134 -0
  50. package/src/components/AssistantChat/AssistantConfirmationCard.tsx +58 -0
  51. package/src/components/AssistantChat/AssistantConversationList.tsx +85 -0
  52. package/src/components/AssistantChat/AssistantMessages.tsx +123 -0
  53. package/src/components/AssistantChat/AssistantSuggestionCard.tsx +48 -0
  54. package/src/components/AssistantChat/assistantMarkdown.tsx +105 -0
  55. package/src/components/AssistantChat/index.ts +25 -0
  56. package/src/components/AssistantLauncher/AssistantLauncher.tsx +408 -0
  57. package/src/components/AssistantLauncher/index.ts +2 -0
  58. package/src/hooks/index.ts +2 -0
  59. package/src/hooks/useSpeechRecognition.ts +95 -0
  60. package/src/index.ts +50 -0
  61. package/src/utils/env-config.ts +6 -0
@@ -0,0 +1,5 @@
1
+ export { createAssistantTransport, parseAssistantEventStream } from "./transport";
2
+ export type { AssistantTransportOptions } from "./transport";
3
+ export { ASSISTANT_CLIENT_ID_KEY, ASSISTANT_CONVERSATIONS_KEY, ASSISTANT_MAX_CONVERSATIONS, getAssistantClientId, listAssistantConversations, saveAssistantConversation, } from "./store";
4
+ export type { AssistantStorage } from "./store";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/assistant/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAClF,YAAY,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EACL,uBAAuB,EACvB,2BAA2B,EAC3B,2BAA2B,EAC3B,oBAAoB,EACpB,0BAA0B,EAC1B,yBAAyB,GAC1B,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,17 @@
1
+ import type { AssistantConversationSummary } from "../components/AssistantChat/AssistantChat.types";
2
+ /**
3
+ * Anonymous memory of the assistant, in the browser only (MED-1784, shared by
4
+ * every app since MED-1787): a stable client id and the conversations started
5
+ * here, newest first. Nothing is sent to a server to list them; signing in
6
+ * (phase 2) will attach them to the account.
7
+ */
8
+ export declare const ASSISTANT_CLIENT_ID_KEY = "assistant.clientId";
9
+ export declare const ASSISTANT_CONVERSATIONS_KEY = "assistant.conversations";
10
+ export declare const ASSISTANT_MAX_CONVERSATIONS = 20;
11
+ export type AssistantStorage = Pick<Storage, "getItem" | "setItem">;
12
+ /** The browser's client id, created on first use. A fresh id per page when storage is unavailable. */
13
+ export declare function getAssistantClientId(store?: AssistantStorage | null): string;
14
+ export declare function listAssistantConversations(store?: AssistantStorage | null): AssistantConversationSummary[];
15
+ /** Adds or refreshes a conversation at the top of the list, capped at ASSISTANT_MAX_CONVERSATIONS. */
16
+ export declare function saveAssistantConversation(conversation: AssistantConversationSummary, store?: AssistantStorage | null): AssistantConversationSummary[];
17
+ //# sourceMappingURL=store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/assistant/store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,iDAAiD,CAAC;AAEpG;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,uBAAuB,CAAC;AAC5D,eAAO,MAAM,2BAA2B,4BAA4B,CAAC;AACrE,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAE9C,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,OAAO,EAAE,SAAS,GAAG,SAAS,CAAC,CAAC;AAiBpE,sGAAsG;AACtG,wBAAgB,oBAAoB,CAAC,KAAK,GAAE,gBAAgB,GAAG,IAAgB,GAAG,MAAM,CAUvF;AAED,wBAAgB,0BAA0B,CACxC,KAAK,GAAE,gBAAgB,GAAG,IAAgB,GACzC,4BAA4B,EAAE,CAehC;AAED,sGAAsG;AACtG,wBAAgB,yBAAyB,CACvC,YAAY,EAAE,4BAA4B,EAC1C,KAAK,GAAE,gBAAgB,GAAG,IAAgB,GACzC,4BAA4B,EAAE,CAWhC"}
@@ -0,0 +1,20 @@
1
+ import type { AssistantEvent, AssistantLanguage, AssistantTransport } from "../components/AssistantChat/AssistantChat.types";
2
+ /**
3
+ * The assistant BFF client shared by every app (MED-1787; contract in
4
+ * projects/medecine360-mcp/docs/assistant-api-contract.md). Fetch rather than
5
+ * EventSource: the message endpoint is a POST. Requests carry the platform
6
+ * session cookie (`credentials: "include"`) so the assistant BFF can derive
7
+ * the persona server-side once it supports it.
8
+ */
9
+ export interface AssistantTransportOptions {
10
+ /** Base URL up to and including /api/v1 (createEnvConfig().assistantBffUrl). */
11
+ baseUrl: string;
12
+ /** Stable browser identifier, for rate limiting and conversation listing. */
13
+ clientId: string;
14
+ language: AssistantLanguage;
15
+ fetchImpl?: typeof fetch;
16
+ }
17
+ /** Turns one SSE text stream into assistant events; frames may arrive split across chunks. */
18
+ export declare function parseAssistantEventStream(body: ReadableStream<Uint8Array>): AsyncGenerator<AssistantEvent>;
19
+ export declare function createAssistantTransport({ baseUrl, clientId, language, fetchImpl, }: AssistantTransportOptions): AssistantTransport;
20
+ //# sourceMappingURL=transport.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../src/assistant/transport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EAEjB,kBAAkB,EACnB,MAAM,iDAAiD,CAAC;AAEzD;;;;;;GAMG;AACH,MAAM,WAAW,yBAAyB;IACxC,gFAAgF;IAChF,OAAO,EAAE,MAAM,CAAC;IAChB,6EAA6E;IAC7E,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;CAC1B;AAQD,8FAA8F;AAC9F,wBAAuB,yBAAyB,CAC9C,IAAI,EAAE,cAAc,CAAC,UAAU,CAAC,GAC/B,cAAc,CAAC,cAAc,CAAC,CAuBhC;AA4CD,wBAAgB,wBAAwB,CAAC,EACvC,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,SAAS,GACV,EAAE,yBAAyB,GAAG,kBAAkB,CAsDhD"}
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ import type { AssistantChatProps } from "./AssistantChat.types";
3
+ /** A conversation title is its first message, cut like the mockup's sidebar. */
4
+ export declare function conversationTitle(firstMessage: string, max?: number): string;
5
+ /**
6
+ * The chat home of the Medecine360 assistant (MED-1783, mockup med1):
7
+ * conversation list, header with brand badge, hero with suggestion cards,
8
+ * streamed thread, composer with push-to-talk. UI only: the app provides the
9
+ * transport, the texts, the conversation memory and the links.
10
+ *
11
+ * Server-rendering safe: nothing touches `window` at render time, the
12
+ * speech API is detected after mount.
13
+ */
14
+ export declare const AssistantChat: React.FC<AssistantChatProps>;
15
+ //# sourceMappingURL=AssistantChat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AssistantChat.d.ts","sourceRoot":"","sources":["../../../src/components/AssistantChat/AssistantChat.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAExE,OAAO,KAAK,EACV,kBAAkB,EAInB,MAAM,uBAAuB,CAAC;AAa/B,gFAAgF;AAChF,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,SAAK,GAAG,MAAM,CAGxE;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAiWtD,CAAC"}
@@ -0,0 +1,173 @@
1
+ import type { ReactNode } from "react";
2
+ /** Languages the assistant speaks; `ar` renders right-to-left. */
3
+ export type AssistantLanguage = "fr" | "en" | "ar";
4
+ /**
5
+ * Events streamed by the assistant BFF for one answer
6
+ * (projects/medecine360-mcp/docs/assistant-api-contract.md).
7
+ */
8
+ export type AssistantEvent = {
9
+ type: "message_start";
10
+ messageId: string;
11
+ } | {
12
+ type: "text_delta";
13
+ text: string;
14
+ } | {
15
+ type: "tool_call";
16
+ name: string;
17
+ status: "started" | "done" | "failed";
18
+ label: string;
19
+ } | {
20
+ type: "citation";
21
+ title: string;
22
+ url: string;
23
+ } | {
24
+ type: "message_end";
25
+ messageId: string;
26
+ usage?: {
27
+ inputTokens: number;
28
+ outputTokens: number;
29
+ };
30
+ } | {
31
+ type: "error";
32
+ code: "MODEL_UNAVAILABLE" | "RATE_LIMITED" | "CONVERSATION_NOT_FOUND" | "INVALID_MESSAGE" | "NETWORK" | string;
33
+ message: string;
34
+ retryAfterSeconds?: number;
35
+ };
36
+ export interface AssistantCitation {
37
+ title: string;
38
+ url: string;
39
+ }
40
+ export interface AssistantMessage {
41
+ id: string;
42
+ role: "user" | "assistant";
43
+ content: string;
44
+ citations?: AssistantCitation[];
45
+ /** Streaming state of an assistant message. */
46
+ status?: "streaming" | "done" | "error";
47
+ /** Set when `status` is `error`: what to show, and whether a retry makes sense. */
48
+ error?: {
49
+ message: string;
50
+ retryAfterSeconds?: number;
51
+ };
52
+ }
53
+ export interface AssistantConversationSummary {
54
+ id: string;
55
+ title: string;
56
+ createdAt: string;
57
+ }
58
+ /**
59
+ * The transport is the app's job: the component never knows a URL. The
60
+ * async iterable returned by `sendMessage` must end after `message_end` or
61
+ * `error`; a thrown error is treated as a network failure.
62
+ */
63
+ export interface AssistantTransport {
64
+ startConversation(language: AssistantLanguage): Promise<{
65
+ id: string;
66
+ }>;
67
+ sendMessage(conversationId: string, content: string, options?: {
68
+ signal?: AbortSignal;
69
+ }): AsyncIterable<AssistantEvent>;
70
+ getConversation?(conversationId: string): Promise<{
71
+ id: string;
72
+ messages: AssistantMessage[];
73
+ }>;
74
+ }
75
+ export interface AssistantSuggestion {
76
+ id: string;
77
+ title: string;
78
+ description?: string;
79
+ /** What is sent when the card is clicked. */
80
+ prompt: string;
81
+ icon?: ReactNode;
82
+ /** Marks the "example question" card of the mockup. */
83
+ kind?: "action" | "example";
84
+ }
85
+ /** Every string the component shows; the app translates them. */
86
+ export interface AssistantChatTexts {
87
+ brandName: string;
88
+ online: string;
89
+ newConversation: string;
90
+ recentConversations: string;
91
+ signIn: string;
92
+ signInHint: string;
93
+ heroTitle: string;
94
+ heroSubtitle: string;
95
+ composerPlaceholder: string;
96
+ composerHint: string;
97
+ send: string;
98
+ /** Mic button: hold to talk. */
99
+ holdToTalk: string;
100
+ listening: string;
101
+ thinking: string;
102
+ retry: string;
103
+ rateLimited: (seconds: number) => string;
104
+ genericError: string;
105
+ sources: string;
106
+ exampleLabel: string;
107
+ confirm: string;
108
+ cancel: string;
109
+ /** The history button of the panel layout; falls back to `recentConversations`. */
110
+ history?: string;
111
+ }
112
+ export interface AssistantConfirmation {
113
+ id: string;
114
+ title: string;
115
+ details: Array<{
116
+ label: string;
117
+ value: string;
118
+ }>;
119
+ }
120
+ export interface AssistantChatProps {
121
+ transport: AssistantTransport;
122
+ language: AssistantLanguage;
123
+ texts: AssistantChatTexts;
124
+ suggestions: AssistantSuggestion[];
125
+ /** Conversations the app remembers (local storage or account). */
126
+ conversations?: AssistantConversationSummary[];
127
+ activeConversationId?: string | null;
128
+ /** Messages of the active conversation, when the app restores one. */
129
+ initialMessages?: AssistantMessage[];
130
+ onConversationCreated?: (conversation: AssistantConversationSummary) => void;
131
+ onSelectConversation?: (conversationId: string) => void;
132
+ onNewConversation?: () => void;
133
+ /** Where "Se connecter" goes. Hidden when absent. */
134
+ signInHref?: string;
135
+ /** Rendered in the header, right side (e.g. "Réserver un appel"). */
136
+ headerAction?: ReactNode;
137
+ /** Rendered under the composer (sources, no medical advice, privacy link). */
138
+ disclaimer?: ReactNode;
139
+ /** Decorative image or gradient behind the hero. */
140
+ heroBackground?: ReactNode;
141
+ /** Push-to-talk through the browser speech API. Default true; hidden anyway where unsupported. */
142
+ voice?: boolean;
143
+ /** Phase 2: a confirmation the assistant asks before a write. */
144
+ pendingConfirmation?: AssistantConfirmation | null;
145
+ onConfirm?: (confirmation: AssistantConfirmation) => void;
146
+ onCancelConfirmation?: (confirmation: AssistantConfirmation) => void;
147
+ /**
148
+ * `page` (default): the chat home with the conversation list beside the
149
+ * thread. `panel` (MED-1787): one narrow column for a slide-over, the
150
+ * conversation list behind a history button, a "new conversation" button
151
+ * in the header. `wide`: the expanded slide-over, list beside the thread.
152
+ */
153
+ layout?: "page" | "panel" | "wide";
154
+ /** Panel layout: the conversation list is shown over the thread. */
155
+ historyOpen?: boolean;
156
+ onHistoryOpenChange?: (open: boolean) => void;
157
+ /**
158
+ * MED-1787: a message typed outside the chat (the launcher bar) to send as
159
+ * soon as possible. Each `id` is sent once; a new id sends again.
160
+ */
161
+ queuedPrompt?: {
162
+ id: string;
163
+ content: string;
164
+ } | null;
165
+ /**
166
+ * Called when a link in an answer is clicked. Return true when the host
167
+ * navigated itself (e.g. its router): the browser then does not follow the
168
+ * link. Links to other origins always open in a new tab.
169
+ */
170
+ onNavigate?: (href: string) => boolean | void;
171
+ className?: string;
172
+ }
173
+ //# sourceMappingURL=AssistantChat.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AssistantChat.types.d.ts","sourceRoot":"","sources":["../../../src/components/AssistantChat/AssistantChat.types.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,24 @@
1
+ import React from "react";
2
+ import type { AssistantLanguage } from "./AssistantChat.types";
3
+ export interface AssistantComposerProps {
4
+ language: AssistantLanguage;
5
+ onSend: (content: string) => void;
6
+ disabled?: boolean;
7
+ /** Mic button; hidden anyway where the browser has no speech API. */
8
+ voice?: boolean;
9
+ texts: {
10
+ placeholder: string;
11
+ hint: string;
12
+ send: string;
13
+ holdToTalk: string;
14
+ listening: string;
15
+ };
16
+ className?: string;
17
+ }
18
+ export declare const MAX_MESSAGE_LENGTH = 2000;
19
+ /**
20
+ * The composer of the mockup: textarea, hint, push-to-talk mic (hold to
21
+ * record, release to send) and a send button. Enter sends, Shift+Enter breaks.
22
+ */
23
+ export declare const AssistantComposer: React.FC<AssistantComposerProps>;
24
+ //# sourceMappingURL=AssistantComposer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AssistantComposer.d.ts","sourceRoot":"","sources":["../../../src/components/AssistantChat/AssistantComposer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAG7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qEAAqE;IACrE,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE;QACL,WAAW,EAAE,MAAM,CAAC;QACpB,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,kBAAkB,OAAO,CAAC;AAEvC;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAyG9D,CAAC"}
@@ -0,0 +1,20 @@
1
+ import React from "react";
2
+ import type { AssistantConfirmation } from "./AssistantChat.types";
3
+ export interface AssistantConfirmationCardProps {
4
+ confirmation: AssistantConfirmation;
5
+ onConfirm: (confirmation: AssistantConfirmation) => void;
6
+ onCancel: (confirmation: AssistantConfirmation) => void;
7
+ texts: {
8
+ confirm: string;
9
+ cancel: string;
10
+ };
11
+ busy?: boolean;
12
+ className?: string;
13
+ }
14
+ /**
15
+ * Reserved for phase 2 (MED-1779): the card the assistant shows before a
16
+ * write (booking, cancellation). Title, details, confirm and cancel wired to
17
+ * the app, so phase 2 needs no component change.
18
+ */
19
+ export declare const AssistantConfirmationCard: React.FC<AssistantConfirmationCardProps>;
20
+ //# sourceMappingURL=AssistantConfirmationCard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AssistantConfirmationCard.d.ts","sourceRoot":"","sources":["../../../src/components/AssistantChat/AssistantConfirmationCard.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAEnE,MAAM,WAAW,8BAA8B;IAC7C,YAAY,EAAE,qBAAqB,CAAC;IACpC,SAAS,EAAE,CAAC,YAAY,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACzD,QAAQ,EAAE,CAAC,YAAY,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACxD,KAAK,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3C,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,EAAE,KAAK,CAAC,EAAE,CAAC,8BAA8B,CAqC9E,CAAC"}
@@ -0,0 +1,19 @@
1
+ import React from "react";
2
+ import type { AssistantConversationSummary } from "./AssistantChat.types";
3
+ export interface AssistantConversationListProps {
4
+ conversations: AssistantConversationSummary[];
5
+ activeConversationId?: string | null;
6
+ onSelect?: (conversationId: string) => void;
7
+ onNew?: () => void;
8
+ texts: {
9
+ newConversation: string;
10
+ recentConversations: string;
11
+ signIn: string;
12
+ signInHint: string;
13
+ };
14
+ signInHref?: string;
15
+ className?: string;
16
+ }
17
+ /** Left column of the mockup: new discussion, recent ones, sign-in prompt at the bottom. */
18
+ export declare const AssistantConversationList: React.FC<AssistantConversationListProps>;
19
+ //# sourceMappingURL=AssistantConversationList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AssistantConversationList.d.ts","sourceRoot":"","sources":["../../../src/components/AssistantChat/AssistantConversationList.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AAE1E,MAAM,WAAW,8BAA8B;IAC7C,aAAa,EAAE,4BAA4B,EAAE,CAAC;IAC9C,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,QAAQ,CAAC,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;IACnB,KAAK,EAAE;QACL,eAAe,EAAE,MAAM,CAAC;QACxB,mBAAmB,EAAE,MAAM,CAAC;QAC5B,MAAM,EAAE,MAAM,CAAC;QACf,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,4FAA4F;AAC5F,eAAO,MAAM,yBAAyB,EAAE,KAAK,CAAC,EAAE,CAAC,8BAA8B,CA+D9E,CAAC"}
@@ -0,0 +1,21 @@
1
+ import React from "react";
2
+ import type { AssistantMessage } from "./AssistantChat.types";
3
+ import type { AssistantMarkdownOptions } from "./assistantMarkdown";
4
+ export interface AssistantMessagesProps {
5
+ messages: AssistantMessage[];
6
+ /** The tool activity line shown under the streaming answer, e.g. "Recherche de médecins…". */
7
+ activity?: string | null;
8
+ onRetry?: (message: AssistantMessage) => void;
9
+ texts: {
10
+ thinking: string;
11
+ retry: string;
12
+ sources: string;
13
+ brandName: string;
14
+ };
15
+ /** Link handling of the answers (same-tab navigation through the host router). */
16
+ linkOptions?: AssistantMarkdownOptions;
17
+ className?: string;
18
+ }
19
+ /** The thread: user bubbles on the end side, assistant answers on the start side, auto-scrolled. */
20
+ export declare const AssistantMessages: React.FC<AssistantMessagesProps>;
21
+ //# sourceMappingURL=AssistantMessages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AssistantMessages.d.ts","sourceRoot":"","sources":["../../../src/components/AssistantChat/AssistantMessages.tsx"],"names":[],"mappings":"AACA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAEjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAEpE,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,8FAA8F;IAC9F,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC9C,KAAK,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/E,kFAAkF;IAClF,WAAW,CAAC,EAAE,wBAAwB,CAAC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,oGAAoG;AACpG,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAuG9D,CAAC"}
@@ -0,0 +1,12 @@
1
+ import React from "react";
2
+ import type { AssistantSuggestion } from "./AssistantChat.types";
3
+ export interface AssistantSuggestionCardProps {
4
+ suggestion: AssistantSuggestion;
5
+ onSelect: (suggestion: AssistantSuggestion) => void;
6
+ exampleLabel: string;
7
+ disabled?: boolean;
8
+ className?: string;
9
+ }
10
+ /** One of the cards under the hero (mockup med1): title, description, sent as a prompt on click. */
11
+ export declare const AssistantSuggestionCard: React.FC<AssistantSuggestionCardProps>;
12
+ //# sourceMappingURL=AssistantSuggestionCard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AssistantSuggestionCard.d.ts","sourceRoot":"","sources":["../../../src/components/AssistantChat/AssistantSuggestionCard.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE,MAAM,WAAW,4BAA4B;IAC3C,UAAU,EAAE,mBAAmB,CAAC;IAChC,QAAQ,EAAE,CAAC,UAAU,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACpD,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,oGAAoG;AACpG,eAAO,MAAM,uBAAuB,EAAE,KAAK,CAAC,EAAE,CAAC,4BAA4B,CAiC1E,CAAC"}
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+ export interface AssistantMarkdownOptions {
3
+ /**
4
+ * Called when a link is clicked, before the browser follows it. Call
5
+ * `event.preventDefault()` to navigate otherwise (e.g. the host router).
6
+ */
7
+ onLinkClick?: (href: string, event: React.MouseEvent<HTMLAnchorElement>) => void;
8
+ /** Whether a link leaves the current site; such links open in a new tab. */
9
+ isExternal?: (href: string) => boolean;
10
+ }
11
+ /** Absolute URL on another origin. Without a window (server rendering) every absolute URL counts as external. */
12
+ export declare function isExternalLink(href: string): boolean;
13
+ export declare function renderAssistantMarkdown(content: string, options?: AssistantMarkdownOptions): React.ReactNode[];
14
+ //# sourceMappingURL=assistantMarkdown.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assistantMarkdown.d.ts","sourceRoot":"","sources":["../../../src/components/AssistantChat/assistantMarkdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B,MAAM,WAAW,wBAAwB;IACvC;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IACjF,4EAA4E;IAC5E,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;CACxC;AAED,iHAAiH;AACjH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAQpD;AAwCD,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,wBAA6B,GACrC,KAAK,CAAC,SAAS,EAAE,CA+BnB"}
@@ -0,0 +1,15 @@
1
+ export { AssistantChat, conversationTitle } from "./AssistantChat";
2
+ export { AssistantComposer, MAX_MESSAGE_LENGTH } from "./AssistantComposer";
3
+ export type { AssistantComposerProps } from "./AssistantComposer";
4
+ export { AssistantConfirmationCard } from "./AssistantConfirmationCard";
5
+ export type { AssistantConfirmationCardProps } from "./AssistantConfirmationCard";
6
+ export { AssistantConversationList } from "./AssistantConversationList";
7
+ export type { AssistantConversationListProps } from "./AssistantConversationList";
8
+ export { AssistantMessages } from "./AssistantMessages";
9
+ export type { AssistantMessagesProps } from "./AssistantMessages";
10
+ export { AssistantSuggestionCard } from "./AssistantSuggestionCard";
11
+ export type { AssistantSuggestionCardProps } from "./AssistantSuggestionCard";
12
+ export { isExternalLink, renderAssistantMarkdown } from "./assistantMarkdown";
13
+ export type { AssistantMarkdownOptions } from "./assistantMarkdown";
14
+ export type { AssistantChatProps, AssistantChatTexts, AssistantCitation, AssistantConfirmation, AssistantConversationSummary, AssistantEvent, AssistantLanguage, AssistantMessage, AssistantSuggestion, AssistantTransport, } from "./AssistantChat.types";
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/AssistantChat/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC5E,YAAY,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,YAAY,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAC;AAClF,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,YAAY,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAC;AAClF,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,YAAY,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9E,YAAY,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AACpE,YAAY,EACV,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,4BAA4B,EAC5B,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,58 @@
1
+ import React from "react";
2
+ import type { AssistantChatProps } from "../AssistantChat/AssistantChat.types";
3
+ export interface AssistantLauncherTexts {
4
+ /** Placeholder of the bar ("Posez une question…"); also the dialog's accessible name. */
5
+ open: string;
6
+ /** The close button of the panel. */
7
+ close: string;
8
+ /** The voice button of the bar; falls back to `open`. */
9
+ voice?: string;
10
+ /** The expand / collapse button of the panel; fall back to `open` / `close`. */
11
+ expand?: string;
12
+ collapse?: string;
13
+ /** The history button of the panel; falls back to `texts.recentConversations`. */
14
+ history?: string;
15
+ }
16
+ export interface AssistantLauncherProps extends Omit<AssistantChatProps, "className" | "layout" | "queuedPrompt" | "historyOpen" | "onHistoryOpenChange"> {
17
+ launcherTexts: AssistantLauncherTexts;
18
+ /** Controlled open state; the launcher manages it when absent. */
19
+ open?: boolean;
20
+ defaultOpen?: boolean;
21
+ onOpenChange?: (open: boolean) => void;
22
+ /** Controlled expanded (wide) state; the launcher manages it when absent. */
23
+ expanded?: boolean;
24
+ defaultExpanded?: boolean;
25
+ onExpandedChange?: (expanded: boolean) => void;
26
+ /**
27
+ * Pixels between the bar and the bottom of the viewport, so the bar sits
28
+ * above a host bottom navigation. Default 16.
29
+ */
30
+ bottomOffset?: number;
31
+ /** Renders nothing at all (e.g. a feature toggle off). */
32
+ hidden?: boolean;
33
+ /** Extra classes on the bar. */
34
+ className?: string;
35
+ /** Extra classes on the panel (e.g. a wider max width). */
36
+ panelClassName?: string;
37
+ }
38
+ /**
39
+ * MED-1787: the in-app entry to the assistant for Medecine360-ui and the
40
+ * dashboard. A floating bar at the bottom of the page (brand badge, a text
41
+ * field "Posez une question…", push-to-talk mic, voice button, send) opens a
42
+ * slide-over panel hosting AssistantChat in its `panel` layout; clicking the
43
+ * field opens the panel too, a spoken question is sent as it opens. From
44
+ * tablets up the panel can be expanded to a dashboard reaching the middle of
45
+ * the screen, with the conversation list beside the thread; in the narrow
46
+ * layout a history button shows that list over the thread.
47
+ *
48
+ * Conversation history is managed here with the shared browser store unless
49
+ * the host passes `conversations` itself: new conversations are remembered,
50
+ * selecting one loads it through `transport.getConversation`.
51
+ *
52
+ * The chat stays mounted while the panel is closed, so the conversation in
53
+ * progress survives open/close. Escape and the overlay close the panel; focus
54
+ * goes to the composer on open and back to the bar on close. In Arabic the
55
+ * panel slides from the left (`end-0` follows `dir`).
56
+ */
57
+ export declare const AssistantLauncher: React.FC<AssistantLauncherProps>;
58
+ //# sourceMappingURL=AssistantLauncher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AssistantLauncher.d.ts","sourceRoot":"","sources":["../../../src/components/AssistantLauncher/AssistantLauncher.tsx"],"names":[],"mappings":"AACA,OAAO,KAA0D,MAAM,OAAO,CAAC;AAK/E,OAAO,KAAK,EACV,kBAAkB,EAGnB,MAAM,sCAAsC,CAAC;AAG9C,MAAM,WAAW,sBAAsB;IACrC,yFAAyF;IACzF,IAAI,EAAE,MAAM,CAAC;IACb,qCAAqC;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,yDAAyD;IACzD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gFAAgF;IAChF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kFAAkF;IAClF,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,sBACf,SAAQ,IAAI,CAAC,kBAAkB,EAAE,WAAW,GAAG,QAAQ,GAAG,cAAc,GAAG,aAAa,GAAG,qBAAqB,CAAC;IACjH,aAAa,EAAE,sBAAsB,CAAC;IACtC,kEAAkE;IAClE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,0DAA0D;IAC1D,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,gCAAgC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2DAA2D;IAC3D,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAQD;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CA2U9D,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { AssistantLauncher } from "./AssistantLauncher";
2
+ export type { AssistantLauncherProps, AssistantLauncherTexts } from "./AssistantLauncher";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/AssistantLauncher/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC"}
@@ -4,4 +4,6 @@ export { useIdleLock } from "./useIdleLock";
4
4
  export type { UseIdleLockOptions, UseIdleLockResult } from "./useIdleLock";
5
5
  export { useSelectField } from "./useSelectField";
6
6
  export type { UseSelectFieldProps } from "./useSelectField";
7
+ export { useSpeechRecognition, getSpeechRecognition } from "./useSpeechRecognition";
8
+ export type { UseSpeechRecognitionOptions } from "./useSpeechRecognition";
7
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACpF,YAAY,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC"}
@@ -0,0 +1,40 @@
1
+ /** The subset of the Web Speech API the hook uses; browsers expose it unprefixed or as webkit*. */
2
+ interface SpeechRecognitionLike {
3
+ lang: string;
4
+ interimResults: boolean;
5
+ continuous: boolean;
6
+ onresult: ((event: {
7
+ results: ArrayLike<ArrayLike<{
8
+ transcript: string;
9
+ }>>;
10
+ }) => void) | null;
11
+ onerror: ((event: {
12
+ error?: string;
13
+ }) => void) | null;
14
+ onend: (() => void) | null;
15
+ start(): void;
16
+ stop(): void;
17
+ abort(): void;
18
+ }
19
+ type SpeechRecognitionCtor = new () => SpeechRecognitionLike;
20
+ export declare function getSpeechRecognition(): SpeechRecognitionCtor | undefined;
21
+ export interface UseSpeechRecognitionOptions {
22
+ /** `fr`, `en`, `ar` or a BCP 47 tag. */
23
+ language: string;
24
+ /** Called with the final transcript when recognition stops. */
25
+ onResult: (transcript: string) => void;
26
+ /** Called with interim text while the user speaks. */
27
+ onInterim?: (transcript: string) => void;
28
+ }
29
+ /**
30
+ * Push-to-talk on the browser speech API (MED-1783). `supported` is false on
31
+ * the server and in browsers without the API, so the app can hide the mic.
32
+ */
33
+ export declare function useSpeechRecognition({ language, onResult, onInterim, }: UseSpeechRecognitionOptions): {
34
+ supported: boolean;
35
+ listening: boolean;
36
+ start: () => void;
37
+ stop: () => void;
38
+ };
39
+ export {};
40
+ //# sourceMappingURL=useSpeechRecognition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSpeechRecognition.d.ts","sourceRoot":"","sources":["../../src/hooks/useSpeechRecognition.ts"],"names":[],"mappings":"AAEA,mGAAmG;AACnG,UAAU,qBAAqB;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,OAAO,CAAC;IACxB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,CAAC,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,SAAS,CAAC,SAAS,CAAC;YAAE,UAAU,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC,CAAA;KAAE,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC;IAC9F,OAAO,EAAE,CAAC,CAAC,KAAK,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC;IACtD,KAAK,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAC;IAC3B,KAAK,IAAI,IAAI,CAAC;IACd,IAAI,IAAI,IAAI,CAAC;IACb,KAAK,IAAI,IAAI,CAAC;CACf;AAED,KAAK,qBAAqB,GAAG,UAAU,qBAAqB,CAAC;AAI7D,wBAAgB,oBAAoB,IAAI,qBAAqB,GAAG,SAAS,CAOxE;AAED,MAAM,WAAW,2BAA2B;IAC1C,wCAAwC;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,+DAA+D;IAC/D,QAAQ,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,sDAAsD;IACtD,SAAS,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1C;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,QAAQ,EACR,QAAQ,EACR,SAAS,GACV,EAAE,2BAA2B;;;;;EAiD7B"}