@alfadocs/ui-kit 0.46.0 → 0.48.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{agenda-card-CFyWSX7Z.js → agenda-card-BaSfVfrL.js} +25 -29
- package/dist/_chunks/{agenda-tray-Dyj9ChHC.js → agenda-tray-DQayYmQ0.js} +50 -67
- package/dist/_chunks/ai-consent-banner-DO5ingMq.js +169 -0
- package/dist/_chunks/ai-tools-rail-CxYG04cw.js +280 -0
- package/dist/_chunks/alia-sidebar-DlvyXgVC.js +1126 -0
- package/dist/_chunks/anamnesis-card-CmkBVAln.js +156 -0
- package/dist/_chunks/appointment-tray-BwDHhWWC.js +419 -0
- package/dist/_chunks/{audio-recorder-C1rhKhSN.js → audio-recorder-DC-v9YFW.js} +81 -91
- package/dist/_chunks/{bmi-calculator-CQqXTVNL.js → bmi-calculator-DdylQzT6.js} +2 -2
- package/dist/_chunks/{booking-DlDVuWMd.js → booking-WV2GSru5.js} +291 -303
- package/dist/_chunks/{calculator-dialog-D-nfvteH.js → calculator-dialog-CFk4I91b.js} +2 -2
- package/dist/_chunks/calendar-days-C4BmpCZg.js +23 -0
- package/dist/_chunks/{calendar-YHFknAGv.js → calendar-oYWOCrnf.js} +195 -210
- package/dist/_chunks/care-plan-card-QmNpGggC.js +252 -0
- package/dist/_chunks/care-plan-entry-card-Cnra7vUc.js +318 -0
- package/dist/_chunks/{chat-input-CQe7nR_v.js → chat-input-CFwc7JxL.js} +2 -1
- package/dist/_chunks/{chat-message-ASgGtj-L.js → chat-message-Dm8U2RY1.js} +81 -74
- package/dist/_chunks/clinical-note-card-BYo437dU.js +333 -0
- package/dist/_chunks/code-block-HoddNOKJ.js +106 -0
- package/dist/_chunks/{contact-profile-card-DHyuAPXM.js → contact-profile-card-DvvVfAA2.js} +102 -115
- package/dist/_chunks/{cycle-calculator-KxA8dqDf.js → cycle-calculator-DYvGm_m1.js} +2 -2
- package/dist/_chunks/{dialog-BTpZV6It.js → dialog-DMGnSelc.js} +55 -55
- package/dist/_chunks/download-CDF1sbL9.js +16 -0
- package/dist/_chunks/{due-date-calculator-mFxpHLml.js → due-date-calculator-BXd3ANj7.js} +2 -2
- package/dist/_chunks/{editable-currency-cell-renderer-BEBUQl9P.js → editable-currency-cell-renderer-CLil9B29.js} +283 -293
- package/dist/_chunks/entity-card-COhmqHly.js +69 -0
- package/dist/_chunks/{gestational-age-calculator-gWI_uRA1.js → gestational-age-calculator-Crj6FgZw.js} +2 -2
- package/dist/_chunks/{insert-result-C5ABnzDl.js → insert-result-DNdi_JYW.js} +140 -168
- package/dist/_chunks/is-safe-url-DkETxeHz.js +7 -0
- package/dist/_chunks/languages-DsVf_WzT.js +19 -0
- package/dist/_chunks/layers-pzGcbLPj.js +34 -0
- package/dist/_chunks/{message-card-DSPw5ghw.js → message-card-Dvl1TgaN.js} +15 -19
- package/dist/_chunks/{message-tray-hSQff9u4.js → message-tray-Dl6GQaaV.js} +2 -2
- package/dist/_chunks/mic-B4Gog3Gi.js +16 -0
- package/dist/_chunks/operator-hero-CM8949Hd.js +198 -0
- package/dist/_chunks/patient-summary-card-BnTqxcTr.js +443 -0
- package/dist/_chunks/payment-request-card-B_lyobd0.js +478 -0
- package/dist/_chunks/{pdf-viewer-CWEXTlwq.js → pdf-viewer-G8SU6Azw.js} +3 -3
- package/dist/_chunks/pencil-CfQX-0Qc.js +21 -0
- package/dist/_chunks/periodontal-chart-card-BYs9hax1.js +455 -0
- package/dist/_chunks/phone-Bi5yUm4I.js +20 -0
- package/dist/_chunks/{practice-results-DDi-kvaD.js → practice-results-BFL_mcDW.js} +3 -2
- package/dist/_chunks/{pregnancy-weight-gain-BtEHaSqy.js → pregnancy-weight-gain-C7dK89jE.js} +2 -2
- package/dist/_chunks/scan-line-lGioFwLC.js +18 -0
- package/dist/_chunks/shield-check-BjCGH_Sr.js +21 -0
- package/dist/_chunks/{sign-document-BCyLpFHJ.js → sign-document-DPI2pY9V.js} +2 -2
- package/dist/_chunks/{streaming-text-GH07yIYh.js → streaming-text-CfhDqtIT.js} +49 -45
- package/dist/_chunks/{transaction-chip-B8ujzowA.js → transaction-chip-BZCa6XDn.js} +8 -6
- package/dist/_chunks/{unit-converter-u3CwNDpP.js → unit-converter-jWp3Z85y.js} +2 -2
- package/dist/_chunks/user-cog-BS_qc8nA.js +24 -0
- package/dist/_chunks/video-BAeICxCT.js +21 -0
- package/dist/_chunks/{workflow-map-BFNpzTiw.js → workflow-map-ZXw-zsZ8.js} +186 -219
- package/dist/agent-catalog.json +324 -1
- package/dist/components/_shared/code-block.d.ts +39 -0
- package/dist/components/_shared/entity-card/entity-card.d.ts +40 -0
- package/dist/components/_shared/entity-card/index.d.ts +3 -0
- package/dist/components/_shared/index.d.ts +2 -0
- package/dist/components/_shared/is-safe-url.d.ts +13 -0
- package/dist/components/agenda-card/agenda-card.d.ts +1 -2
- package/dist/components/agenda-card/index.d.ts +2 -1
- package/dist/components/agenda-card/index.js +6 -5
- package/dist/components/agenda-tray/index.js +1 -1
- package/dist/components/ai-consent-banner/ai-consent-banner.agent.d.ts +4 -0
- package/dist/components/ai-consent-banner/ai-consent-banner.d.ts +45 -0
- package/dist/components/ai-consent-banner/index.d.ts +4 -0
- package/dist/components/ai-consent-banner/index.js +6 -0
- package/dist/components/ai-tools-rail/ai-tools-rail.agent.d.ts +4 -0
- package/dist/components/ai-tools-rail/ai-tools-rail.d.ts +60 -0
- package/dist/components/ai-tools-rail/index.d.ts +4 -0
- package/dist/components/ai-tools-rail/index.js +6 -0
- package/dist/components/anamnesis-card/anamnesis-card.d.ts +68 -0
- package/dist/components/anamnesis-card/index.d.ts +3 -0
- package/dist/components/anamnesis-card/index.js +5 -0
- package/dist/components/appointment-card/appointment-card.agent.d.ts +3 -0
- package/dist/components/appointment-card/appointment-card.d.ts +93 -0
- package/dist/components/appointment-card/appointment-tray.agent.d.ts +4 -0
- package/dist/components/appointment-card/appointment-tray.d.ts +48 -0
- package/dist/components/appointment-card/index.d.ts +8 -0
- package/dist/components/appointment-card/index.js +10 -0
- package/dist/components/audio-recorder/index.js +1 -1
- package/dist/components/badge/badge.d.ts +1 -1
- package/dist/components/bmi-calculator/index.js +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/calculator-dialog/index.js +1 -1
- package/dist/components/calendar/index.js +1 -1
- package/dist/components/card/card.d.ts +1 -1
- package/dist/components/care-plan-card/care-plan-card.agent.d.ts +4 -0
- package/dist/components/care-plan-card/care-plan-card.d.ts +102 -0
- package/dist/components/care-plan-card/index.d.ts +4 -0
- package/dist/components/care-plan-card/index.js +6 -0
- package/dist/components/care-plan-entry-card/care-plan-entry-card.agent.d.ts +4 -0
- package/dist/components/care-plan-entry-card/care-plan-entry-card.d.ts +110 -0
- package/dist/components/care-plan-entry-card/index.d.ts +4 -0
- package/dist/components/care-plan-entry-card/index.js +6 -0
- package/dist/components/chat-input/index.js +1 -1
- package/dist/components/chat-message/chat-message.d.ts +13 -0
- package/dist/components/chat-message/index.js +1 -1
- package/dist/components/clinical-note-card/clinical-note-card.agent.d.ts +4 -0
- package/dist/components/clinical-note-card/clinical-note-card.d.ts +98 -0
- package/dist/components/clinical-note-card/index.d.ts +4 -0
- package/dist/components/clinical-note-card/index.js +6 -0
- package/dist/components/contact-profile-card/index.js +1 -1
- package/dist/components/cycle-calculator/index.js +1 -1
- package/dist/components/data-table/index.js +1 -1
- package/dist/components/dialog/dialog.d.ts +7 -0
- package/dist/components/dialog/index.js +1 -1
- package/dist/components/due-date-calculator/index.js +1 -1
- package/dist/components/gestational-age-calculator/index.js +1 -1
- package/dist/components/index.d.ts +10 -0
- package/dist/components/message-card/index.js +5 -4
- package/dist/components/message-card/message-card.d.ts +1 -2
- package/dist/components/message-tray/index.js +1 -1
- package/dist/components/operator-hero/index.js +1 -1
- package/dist/components/operator-hero/operator-hero.d.ts +9 -0
- package/dist/components/patient-summary-card/index.d.ts +4 -0
- package/dist/components/patient-summary-card/index.js +6 -0
- package/dist/components/patient-summary-card/patient-summary-card.agent.d.ts +4 -0
- package/dist/components/patient-summary-card/patient-summary-card.d.ts +120 -0
- package/dist/components/payment-card/index.d.ts +7 -0
- package/dist/components/payment-card/index.js +8 -0
- package/dist/components/payment-card/payment-card.agent.d.ts +4 -0
- package/dist/components/payment-card/payment-card.d.ts +71 -0
- package/dist/components/payment-card/payment-request-card.agent.d.ts +4 -0
- package/dist/components/payment-card/payment-request-card.d.ts +43 -0
- package/dist/components/pdf-viewer/index.js +1 -1
- package/dist/components/periodontal-chart-card/index.d.ts +4 -0
- package/dist/components/periodontal-chart-card/index.js +7 -0
- package/dist/components/periodontal-chart-card/periodontal-chart-card.agent.d.ts +4 -0
- package/dist/components/periodontal-chart-card/periodontal-chart-card.d.ts +74 -0
- package/dist/components/practice-results/index.js +1 -1
- package/dist/components/pregnancy-weight-gain/index.js +1 -1
- package/dist/components/public-header/public-header.d.ts +1 -1
- package/dist/components/sign-document/index.js +1 -1
- package/dist/components/stat/stat.d.ts +1 -1
- package/dist/components/streaming-text/index.js +1 -1
- package/dist/components/transaction-chip/index.js +1 -1
- package/dist/components/unit-converter/index.js +1 -1
- package/dist/components/workflow/index.js +1 -1
- package/dist/i18n/locales/ar.d.ts +366 -0
- package/dist/i18n/locales/ar.js +367 -1
- package/dist/i18n/locales/de.d.ts +366 -0
- package/dist/i18n/locales/de.js +367 -1
- package/dist/i18n/locales/el.d.ts +366 -0
- package/dist/i18n/locales/el.js +367 -1
- package/dist/i18n/locales/en.d.ts +366 -0
- package/dist/i18n/locales/en.js +367 -1
- package/dist/i18n/locales/es.d.ts +366 -0
- package/dist/i18n/locales/es.js +367 -1
- package/dist/i18n/locales/fr.d.ts +366 -0
- package/dist/i18n/locales/fr.js +367 -1
- package/dist/i18n/locales/hi.d.ts +366 -0
- package/dist/i18n/locales/hi.js +367 -1
- package/dist/i18n/locales/it.d.ts +366 -0
- package/dist/i18n/locales/it.js +367 -1
- package/dist/i18n/locales/ja.d.ts +366 -0
- package/dist/i18n/locales/ja.js +367 -1
- package/dist/i18n/locales/nl.d.ts +366 -0
- package/dist/i18n/locales/nl.js +367 -1
- package/dist/i18n/locales/pl.d.ts +366 -0
- package/dist/i18n/locales/pl.js +367 -1
- package/dist/i18n/locales/pt.d.ts +366 -0
- package/dist/i18n/locales/pt.js +367 -1
- package/dist/i18n/locales/ro.d.ts +366 -0
- package/dist/i18n/locales/ro.js +367 -1
- package/dist/i18n/locales/ru.d.ts +366 -0
- package/dist/i18n/locales/ru.js +367 -1
- package/dist/i18n/locales/sq.d.ts +366 -0
- package/dist/i18n/locales/sq.js +367 -1
- package/dist/i18n/locales/sv.d.ts +366 -0
- package/dist/i18n/locales/sv.js +367 -1
- package/dist/i18n/locales/tr.d.ts +366 -0
- package/dist/i18n/locales/tr.js +367 -1
- package/dist/i18n/locales/zh.d.ts +366 -0
- package/dist/i18n/locales/zh.js +367 -1
- package/dist/index.js +527 -491
- package/dist/locales/ar.json +367 -1
- package/dist/locales/de.json +367 -1
- package/dist/locales/el.json +367 -1
- package/dist/locales/en.json +367 -1
- package/dist/locales/es.json +367 -1
- package/dist/locales/fr.json +367 -1
- package/dist/locales/hi.json +367 -1
- package/dist/locales/it.json +367 -1
- package/dist/locales/ja.json +367 -1
- package/dist/locales/nl.json +367 -1
- package/dist/locales/pl.json +367 -1
- package/dist/locales/pt.json +367 -1
- package/dist/locales/ro.json +367 -1
- package/dist/locales/ru.json +367 -1
- package/dist/locales/sq.json +367 -1
- package/dist/locales/sv.json +367 -1
- package/dist/locales/tr.json +367 -1
- package/dist/locales/zh.json +367 -1
- package/dist/patterns/alia-assistant/alia-types.d.ts +76 -0
- package/dist/patterns/alia-assistant/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +42 -1
- package/dist/_chunks/alia-sidebar-Be8FhKYd.js +0 -837
- package/dist/_chunks/operator-hero-7LiiP7zi.js +0 -171
- package/dist/_chunks/shield-check-C73ma9Cs.js +0 -36
|
@@ -1,44 +1,34 @@
|
|
|
1
1
|
import { jsxs as R, jsx as s, Fragment as se } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
2
|
+
import { forwardRef as ae, useReducer as ne, useState as x, useRef as l, useEffect as D, useCallback as h, useMemo as de, useImperativeHandle as ce } from "react";
|
|
3
3
|
import { c as oe } from "./index-D2ZczOXr.js";
|
|
4
4
|
import { useTranslation as ue } from "react-i18next";
|
|
5
|
-
import { B as
|
|
6
|
-
import { I as
|
|
5
|
+
import { B as G } from "./button-DD_0Xdmr.js";
|
|
6
|
+
import { I as N } from "./icon-button-CKEOrN37.js";
|
|
7
7
|
import { S as pe } from "./select-hsCaJSX3.js";
|
|
8
8
|
import { A as le } from "./audio-visualiser-l6zPd0AG.js";
|
|
9
9
|
import { A as F } from "./alert-ywPR59NE.js";
|
|
10
10
|
import { u as me } from "./registry-nPAVE19X.js";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
11
|
+
import { M as fe } from "./mic-B4Gog3Gi.js";
|
|
12
|
+
import { c as J } from "./createLucideIcon-CrFbzy84.js";
|
|
13
|
+
import { S as ge } from "./square-CZoGU14v.js";
|
|
14
|
+
import { X as he } from "./x-CCcI3eJp.js";
|
|
14
15
|
/**
|
|
15
16
|
* @license lucide-react v1.8.0 - ISC
|
|
16
17
|
*
|
|
17
18
|
* This source code is licensed under the ISC license.
|
|
18
19
|
* See the LICENSE file in the root directory of this source tree.
|
|
19
20
|
*/
|
|
20
|
-
const
|
|
21
|
-
["path", { d: "M12 19v3", key: "npa21l" }],
|
|
22
|
-
["path", { d: "M19 10v2a7 7 0 0 1-14 0v-2", key: "1vc78b" }],
|
|
23
|
-
["rect", { x: "9", y: "2", width: "6", height: "13", rx: "3", key: "s6n7sd" }]
|
|
24
|
-
], ve = V("mic", he);
|
|
25
|
-
/**
|
|
26
|
-
* @license lucide-react v1.8.0 - ISC
|
|
27
|
-
*
|
|
28
|
-
* This source code is licensed under the ISC license.
|
|
29
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
30
|
-
*/
|
|
31
|
-
const ye = [
|
|
21
|
+
const ve = [
|
|
32
22
|
["rect", { x: "14", y: "3", width: "5", height: "18", rx: "1", key: "kaeet6" }],
|
|
33
23
|
["rect", { x: "5", y: "3", width: "5", height: "18", rx: "1", key: "1wsw3u" }]
|
|
34
|
-
],
|
|
24
|
+
], ye = J("pause", ve);
|
|
35
25
|
/**
|
|
36
26
|
* @license lucide-react v1.8.0 - ISC
|
|
37
27
|
*
|
|
38
28
|
* This source code is licensed under the ISC license.
|
|
39
29
|
* See the LICENSE file in the root directory of this source tree.
|
|
40
30
|
*/
|
|
41
|
-
const
|
|
31
|
+
const ke = [
|
|
42
32
|
[
|
|
43
33
|
"path",
|
|
44
34
|
{
|
|
@@ -46,7 +36,7 @@ const be = [
|
|
|
46
36
|
key: "10ikf1"
|
|
47
37
|
}
|
|
48
38
|
]
|
|
49
|
-
],
|
|
39
|
+
], be = J("play", ke), Re = {
|
|
50
40
|
id: "audio-recorder",
|
|
51
41
|
capabilities: ["submit"],
|
|
52
42
|
state: {
|
|
@@ -114,7 +104,7 @@ const be = [
|
|
|
114
104
|
}
|
|
115
105
|
}
|
|
116
106
|
};
|
|
117
|
-
function
|
|
107
|
+
function we(r, u) {
|
|
118
108
|
switch (u.type) {
|
|
119
109
|
case "request":
|
|
120
110
|
return { kind: "requesting" };
|
|
@@ -162,15 +152,15 @@ const Ae = oe(
|
|
|
162
152
|
},
|
|
163
153
|
defaultVariants: { size: "md" }
|
|
164
154
|
}
|
|
165
|
-
),
|
|
155
|
+
), Me = [
|
|
166
156
|
"audio/webm;codecs=opus",
|
|
167
157
|
"audio/webm",
|
|
168
158
|
"audio/mp4",
|
|
169
159
|
"audio/ogg;codecs=opus"
|
|
170
160
|
];
|
|
171
|
-
function
|
|
161
|
+
function xe() {
|
|
172
162
|
if (!(typeof MediaRecorder > "u")) {
|
|
173
|
-
for (const r of
|
|
163
|
+
for (const r of Me)
|
|
174
164
|
if (MediaRecorder.isTypeSupported(r)) return r;
|
|
175
165
|
}
|
|
176
166
|
}
|
|
@@ -178,7 +168,7 @@ function De(r, u) {
|
|
|
178
168
|
const m = Math.max(0, Math.floor(r / 1e3)), i = Math.floor(m / 60), f = m % 60, v = (S) => new Intl.NumberFormat(u, { minimumIntegerDigits: 2 }).format(S);
|
|
179
169
|
return `${v(i)}:${v(f)}`;
|
|
180
170
|
}
|
|
181
|
-
const
|
|
171
|
+
const Ne = ae(
|
|
182
172
|
({
|
|
183
173
|
size: r = "md",
|
|
184
174
|
onRecordingComplete: u,
|
|
@@ -189,23 +179,23 @@ const Se = ne(
|
|
|
189
179
|
className: S,
|
|
190
180
|
...I
|
|
191
181
|
}, Q) => {
|
|
192
|
-
const { t: d, i18n: W } = ue(), [t, p] =
|
|
193
|
-
|
|
182
|
+
const { t: d, i18n: W } = ue(), [t, p] = ne(we, { kind: "idle" }), [z, T] = x(null), [Y, Z] = x(Date.now()), [E, ee] = x([]), [w, te] = x(""), c = l(null), y = l([]), _ = l(0), V = l(0), g = l(null), B = l(!1), k = l(!1), H = l(0), b = typeof MediaRecorder < "u";
|
|
183
|
+
D(() => {
|
|
194
184
|
var e;
|
|
195
|
-
!b || !((e = navigator.mediaDevices) != null && e.enumerateDevices) || navigator.mediaDevices.enumerateDevices().then((
|
|
196
|
-
const o =
|
|
185
|
+
!b || !((e = navigator.mediaDevices) != null && e.enumerateDevices) || navigator.mediaDevices.enumerateDevices().then((a) => {
|
|
186
|
+
const o = a.filter((n) => n.kind === "audioinput");
|
|
197
187
|
ee(o);
|
|
198
188
|
}).catch(() => {
|
|
199
189
|
});
|
|
200
|
-
}, [b]),
|
|
190
|
+
}, [b]), D(() => {
|
|
201
191
|
if (t.kind !== "recording") return;
|
|
202
192
|
const e = window.setInterval(() => Z(Date.now()), 250);
|
|
203
193
|
return () => window.clearInterval(e);
|
|
204
194
|
}, [t.kind]);
|
|
205
|
-
const
|
|
195
|
+
const $ = h(() => {
|
|
206
196
|
const e = g.current ?? z;
|
|
207
|
-
e == null || e.getTracks().forEach((
|
|
208
|
-
}, [z]),
|
|
197
|
+
e == null || e.getTracks().forEach((a) => a.stop()), g.current = null, T(null);
|
|
198
|
+
}, [z]), A = h(async () => {
|
|
209
199
|
if (!b) {
|
|
210
200
|
p({ type: "error", kind: "unsupported" }), i == null || i("unsupported");
|
|
211
201
|
return;
|
|
@@ -216,17 +206,17 @@ const Se = ne(
|
|
|
216
206
|
audio: w ? { deviceId: { exact: w } } : !0
|
|
217
207
|
});
|
|
218
208
|
if (B.current || k.current) {
|
|
219
|
-
e.getTracks().forEach((
|
|
209
|
+
e.getTracks().forEach((n) => n.stop());
|
|
220
210
|
return;
|
|
221
211
|
}
|
|
222
212
|
g.current = e, T(e);
|
|
223
|
-
const
|
|
213
|
+
const a = xe(), o = new MediaRecorder(
|
|
224
214
|
e,
|
|
225
|
-
|
|
215
|
+
a ? { mimeType: a } : void 0
|
|
226
216
|
);
|
|
227
|
-
c.current = o, y.current = [], _.current = 0, o.ondataavailable = (
|
|
228
|
-
var
|
|
229
|
-
if (
|
|
217
|
+
c.current = o, y.current = [], _.current = 0, o.ondataavailable = (n) => {
|
|
218
|
+
var X;
|
|
219
|
+
if (n.data && n.data.size > 0 && (y.current.push(n.data), _.current += n.data.size, typeof v == "number" && _.current >= v && ((X = c.current) == null ? void 0 : X.state) === "recording")) {
|
|
230
220
|
i == null || i("max-size");
|
|
231
221
|
try {
|
|
232
222
|
c.current.stop();
|
|
@@ -235,16 +225,16 @@ const Se = ne(
|
|
|
235
225
|
}
|
|
236
226
|
}, o.onstop = () => {
|
|
237
227
|
if (!k.current) {
|
|
238
|
-
const
|
|
239
|
-
type:
|
|
228
|
+
const n = new Blob(y.current, {
|
|
229
|
+
type: a ?? "audio/webm"
|
|
240
230
|
});
|
|
241
|
-
u == null || u(
|
|
231
|
+
u == null || u(n, V.current);
|
|
242
232
|
}
|
|
243
|
-
y.current = [], c.current = null, e.getTracks().forEach((
|
|
233
|
+
y.current = [], c.current = null, e.getTracks().forEach((n) => n.stop()), g.current = null, T(null), k.current = !1;
|
|
244
234
|
}, H.current = performance.now(), o.start(1e3), p({ type: "start" });
|
|
245
235
|
} catch (e) {
|
|
246
|
-
const
|
|
247
|
-
|
|
236
|
+
const a = e instanceof Error ? e.name : "";
|
|
237
|
+
a === "NotAllowedError" || a === "SecurityError" ? (p({ type: "error", kind: "permission-denied" }), i == null || i("permission-denied")) : a === "NotFoundError" || a === "OverconstrainedError" ? (p({ type: "error", kind: "no-device" }), i == null || i("no-device")) : (p({ type: "error", kind: "capture-failed" }), i == null || i("capture-failed"));
|
|
248
238
|
}
|
|
249
239
|
}, [i, u, w, b]), re = h(() => {
|
|
250
240
|
var e;
|
|
@@ -255,8 +245,8 @@ const Se = ne(
|
|
|
255
245
|
}, []), q = h(() => {
|
|
256
246
|
var e;
|
|
257
247
|
if (t.kind === "recording" || t.kind === "paused") {
|
|
258
|
-
const
|
|
259
|
-
|
|
248
|
+
const a = t.startedAt, o = t.pausedMs, n = Date.now() - a - o;
|
|
249
|
+
V.current = Math.max(0, n), p({ type: "stop", duration: n });
|
|
260
250
|
}
|
|
261
251
|
try {
|
|
262
252
|
(e = c.current) == null || e.stop();
|
|
@@ -269,46 +259,46 @@ const Se = ne(
|
|
|
269
259
|
(e = c.current) == null || e.stop();
|
|
270
260
|
} catch {
|
|
271
261
|
}
|
|
272
|
-
y.current = [], c.current = null,
|
|
273
|
-
}, [
|
|
274
|
-
|
|
262
|
+
y.current = [], c.current = null, $(), p({ type: "cancel" }), m == null || m();
|
|
263
|
+
}, [$, m]);
|
|
264
|
+
D(() => {
|
|
275
265
|
if (t.kind !== "recording" || typeof f != "number" || f <= 0) return;
|
|
276
|
-
const e = performance.now() - H.current - t.pausedMs,
|
|
277
|
-
var
|
|
278
|
-
if (((
|
|
266
|
+
const e = performance.now() - H.current - t.pausedMs, a = Math.max(0, f - e), o = window.setTimeout(() => {
|
|
267
|
+
var n;
|
|
268
|
+
if (((n = c.current) == null ? void 0 : n.state) === "recording") {
|
|
279
269
|
i == null || i("max-duration");
|
|
280
270
|
try {
|
|
281
271
|
c.current.stop();
|
|
282
272
|
} catch {
|
|
283
273
|
}
|
|
284
274
|
}
|
|
285
|
-
},
|
|
275
|
+
}, a);
|
|
286
276
|
return () => window.clearTimeout(o);
|
|
287
|
-
}, [t, f, i]),
|
|
288
|
-
var e,
|
|
277
|
+
}, [t, f, i]), D(() => () => {
|
|
278
|
+
var e, a;
|
|
289
279
|
B.current = !0;
|
|
290
280
|
try {
|
|
291
281
|
(e = c.current) == null || e.stop();
|
|
292
282
|
} catch {
|
|
293
283
|
}
|
|
294
|
-
(
|
|
284
|
+
(a = g.current) == null || a.getTracks().forEach((o) => o.stop()), g.current = null;
|
|
295
285
|
}, []);
|
|
296
286
|
const j = t.kind === "recording" ? Y - t.startedAt - t.pausedMs : t.kind === "paused" ? t.pausedAt - t.startedAt - t.pausedMs : t.kind === "stopped" ? t.duration : 0, P = de(
|
|
297
287
|
() => ({
|
|
298
288
|
isRecording: () => t.kind === "recording",
|
|
299
289
|
getDuration: () => j,
|
|
300
290
|
hasRecording: () => t.kind === "stopped",
|
|
301
|
-
startRecording: () =>
|
|
291
|
+
startRecording: () => A(),
|
|
302
292
|
stopRecording: () => q(),
|
|
303
293
|
discard: () => K()
|
|
304
294
|
}),
|
|
305
|
-
[t, j,
|
|
295
|
+
[t, j, A, q, K]
|
|
306
296
|
);
|
|
307
|
-
ce(Q, () => P, [P]), me(
|
|
308
|
-
const
|
|
297
|
+
ce(Q, () => P, [P]), me(Re, P, I.id);
|
|
298
|
+
const C = E.map((e) => ({
|
|
309
299
|
value: e.deviceId,
|
|
310
300
|
label: e.label || d("chat.audio.selectDevice")
|
|
311
|
-
})),
|
|
301
|
+
})), O = (() => {
|
|
312
302
|
switch (t.kind) {
|
|
313
303
|
case "idle":
|
|
314
304
|
return d("chat.audio.idle");
|
|
@@ -323,7 +313,7 @@ const Se = ne(
|
|
|
323
313
|
case "error":
|
|
324
314
|
return t.type === "permission-denied" ? d("chat.audio.permissionDenied") : t.type === "unsupported" ? d("chat.audio.unsupported") : d("chat.audio.idle");
|
|
325
315
|
}
|
|
326
|
-
})(),
|
|
316
|
+
})(), M = t.kind === "recording", L = t.kind === "paused", U = t.kind === "error";
|
|
327
317
|
return /* @__PURE__ */ R(
|
|
328
318
|
"div",
|
|
329
319
|
{
|
|
@@ -339,9 +329,9 @@ const Se = ne(
|
|
|
339
329
|
"aria-hidden": "true",
|
|
340
330
|
className: [
|
|
341
331
|
"ds:relative ds:inline-flex ds:size-3 ds:items-center ds:justify-center ds:rounded-[var(--radius-full)]",
|
|
342
|
-
|
|
332
|
+
M ? "ds:bg-[color:var(--destructive)]" : "ds:bg-[color:var(--muted)]"
|
|
343
333
|
].join(" "),
|
|
344
|
-
children:
|
|
334
|
+
children: M ? /* @__PURE__ */ s(
|
|
345
335
|
"span",
|
|
346
336
|
{
|
|
347
337
|
className: [
|
|
@@ -373,44 +363,44 @@ const Se = ne(
|
|
|
373
363
|
}
|
|
374
364
|
)
|
|
375
365
|
] }),
|
|
376
|
-
/* @__PURE__ */ s("span", { role: "status", "aria-live": "polite", className: "ds:sr-only", children:
|
|
366
|
+
/* @__PURE__ */ s("span", { role: "status", "aria-live": "polite", className: "ds:sr-only", children: O }),
|
|
377
367
|
/* @__PURE__ */ R("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
|
|
378
|
-
t.kind === "idle" || t.kind === "stopped" ||
|
|
379
|
-
|
|
368
|
+
t.kind === "idle" || t.kind === "stopped" || U ? /* @__PURE__ */ s(
|
|
369
|
+
G,
|
|
380
370
|
{
|
|
381
371
|
intent: "primary",
|
|
382
372
|
size: "sm",
|
|
383
|
-
startIcon: /* @__PURE__ */ s(
|
|
384
|
-
onClick:
|
|
373
|
+
startIcon: /* @__PURE__ */ s(fe, {}),
|
|
374
|
+
onClick: A,
|
|
385
375
|
disabled: !b,
|
|
386
376
|
children: d("chat.audio.record")
|
|
387
377
|
}
|
|
388
378
|
) : null,
|
|
389
|
-
|
|
390
|
-
|
|
379
|
+
M ? /* @__PURE__ */ s(
|
|
380
|
+
N,
|
|
391
381
|
{
|
|
392
|
-
icon: /* @__PURE__ */ s(
|
|
382
|
+
icon: /* @__PURE__ */ s(ye, {}),
|
|
393
383
|
"aria-label": d("chat.audio.pause"),
|
|
394
384
|
intent: "secondary",
|
|
395
385
|
size: "sm",
|
|
396
386
|
onClick: re
|
|
397
387
|
}
|
|
398
388
|
) : null,
|
|
399
|
-
|
|
400
|
-
|
|
389
|
+
L ? /* @__PURE__ */ s(
|
|
390
|
+
N,
|
|
401
391
|
{
|
|
402
|
-
icon: /* @__PURE__ */ s(
|
|
392
|
+
icon: /* @__PURE__ */ s(be, {}),
|
|
403
393
|
"aria-label": d("chat.audio.resume"),
|
|
404
394
|
intent: "secondary",
|
|
405
395
|
size: "sm",
|
|
406
396
|
onClick: ie
|
|
407
397
|
}
|
|
408
398
|
) : null,
|
|
409
|
-
|
|
399
|
+
M || L ? /* @__PURE__ */ R(se, { children: [
|
|
410
400
|
/* @__PURE__ */ s(
|
|
411
|
-
|
|
401
|
+
N,
|
|
412
402
|
{
|
|
413
|
-
icon: /* @__PURE__ */ s(
|
|
403
|
+
icon: /* @__PURE__ */ s(ge, {}),
|
|
414
404
|
"aria-label": d("chat.audio.stop"),
|
|
415
405
|
intent: "primary",
|
|
416
406
|
size: "sm",
|
|
@@ -418,9 +408,9 @@ const Se = ne(
|
|
|
418
408
|
}
|
|
419
409
|
),
|
|
420
410
|
/* @__PURE__ */ s(
|
|
421
|
-
|
|
411
|
+
N,
|
|
422
412
|
{
|
|
423
|
-
icon: /* @__PURE__ */ s(
|
|
413
|
+
icon: /* @__PURE__ */ s(he, {}),
|
|
424
414
|
"aria-label": d("chat.audio.cancel"),
|
|
425
415
|
intent: "ghost",
|
|
426
416
|
size: "sm",
|
|
@@ -428,11 +418,11 @@ const Se = ne(
|
|
|
428
418
|
}
|
|
429
419
|
)
|
|
430
420
|
] }) : null,
|
|
431
|
-
t.kind === "idle" &&
|
|
421
|
+
t.kind === "idle" && C.length > 1 ? /* @__PURE__ */ s("div", { className: "ds:ms-auto ds:min-w-[160px]", children: /* @__PURE__ */ s(
|
|
432
422
|
pe,
|
|
433
423
|
{
|
|
434
424
|
"aria-label": d("chat.audio.selectDevice"),
|
|
435
|
-
options:
|
|
425
|
+
options: C,
|
|
436
426
|
value: w,
|
|
437
427
|
onValueChange: (e) => te(e),
|
|
438
428
|
size: "sm",
|
|
@@ -440,18 +430,18 @@ const Se = ne(
|
|
|
440
430
|
}
|
|
441
431
|
) }) : null
|
|
442
432
|
] }),
|
|
443
|
-
|
|
444
|
-
/* @__PURE__ */ s(F.Description, { children:
|
|
445
|
-
t.type === "permission-denied" ? /* @__PURE__ */ s(F.Action, { children: /* @__PURE__ */ s(
|
|
433
|
+
U && t.kind === "error" ? /* @__PURE__ */ R(F, { variant: "error", live: "polite", children: [
|
|
434
|
+
/* @__PURE__ */ s(F.Description, { children: O }),
|
|
435
|
+
t.type === "permission-denied" ? /* @__PURE__ */ s(F.Action, { children: /* @__PURE__ */ s(G, { intent: "ghost", size: "sm", onClick: A, children: d("chat.audio.retry") }) }) : null
|
|
446
436
|
] }) : null
|
|
447
437
|
]
|
|
448
438
|
}
|
|
449
439
|
);
|
|
450
440
|
}
|
|
451
441
|
);
|
|
452
|
-
|
|
442
|
+
Ne.displayName = "AudioRecorder";
|
|
453
443
|
export {
|
|
454
|
-
|
|
455
|
-
|
|
444
|
+
Ne as A,
|
|
445
|
+
Re as a
|
|
456
446
|
};
|
|
457
|
-
//# sourceMappingURL=audio-recorder-
|
|
447
|
+
//# sourceMappingURL=audio-recorder-DC-v9YFW.js.map
|
|
@@ -8,7 +8,7 @@ import { F as D } from "./form-field-BOm9hK35.js";
|
|
|
8
8
|
import { N as p } from "./number-input-Dj5L3pXK.js";
|
|
9
9
|
import { C as M } from "./card-DPmk26CL.js";
|
|
10
10
|
import { B as na } from "./badge-zsf5i5bH.js";
|
|
11
|
-
import { B as ra, I as sa, b as oa } from "./insert-result-
|
|
11
|
+
import { B as ra, I as sa, b as oa } from "./insert-result-DNdi_JYW.js";
|
|
12
12
|
import { b as ca, e as ma, c as da, f as O, l as W, k as ua } from "./bmi-BxD-tFzU.js";
|
|
13
13
|
const ga = la("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
|
|
14
14
|
variants: {
|
|
@@ -255,4 +255,4 @@ pa.displayName = "BmiCalculator";
|
|
|
255
255
|
export {
|
|
256
256
|
pa as B
|
|
257
257
|
};
|
|
258
|
-
//# sourceMappingURL=bmi-calculator-
|
|
258
|
+
//# sourceMappingURL=bmi-calculator-DdylQzT6.js.map
|