interview-widget 0.1.3 → 0.1.5
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/README.md +69 -28
- package/dist/assets/bot-icon.d.ts +1 -0
- package/dist/assets/clock-fading-icon.d.ts +1 -0
- package/dist/assets/loader-icon.d.ts +1 -0
- package/dist/assets/shield-icon.d.ts +2 -0
- package/dist/assets/speak-icon.d.ts +1 -0
- package/dist/components/interview/answer-area.d.ts +3 -1
- package/dist/components/interview/phases/animated-blob.d.ts +13 -0
- package/dist/components/interview/phases/answering-phase.d.ts +10 -0
- package/dist/components/interview/phases/file-generation-animation.d.ts +1 -0
- package/dist/components/interview/phases/interview-completion-modal.d.ts +7 -0
- package/dist/components/interview/phases/question-reading-animation.d.ts +5 -0
- package/dist/components/interview/phases/thinking-phase.d.ts +8 -0
- package/dist/components/interview/phases/transcription-animation.d.ts +6 -0
- package/dist/components/interview/question-display.d.ts +1 -0
- package/dist/components/media/audio-wave-visualizer.d.ts +14 -0
- package/dist/components/timer/circular-timer.d.ts +11 -0
- package/dist/components/ui/extended/styled-button.d.ts +7 -0
- package/dist/hooks/use-timer.d.ts +1 -0
- package/dist/services/stt/stt-service.d.ts +1 -0
- package/dist/services/timer/timer-service.d.ts +5 -4
- package/dist/services/tts/tts-service.d.ts +1 -0
- package/dist/types.d.ts +1 -2
- package/dist/utils/constants.d.ts +1 -1
- package/dist/utils/helper.d.ts +1 -1
- package/dist/widget.css +1 -1
- package/dist/widget.es.js +1482 -1056
- package/dist/widget.umd.js +107 -2
- package/package.json +1 -1
package/dist/widget.es.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { createContext as
|
|
5
|
-
import { createPortal as
|
|
6
|
-
var
|
|
1
|
+
var ve = Object.defineProperty;
|
|
2
|
+
var je = (i, r, e) => r in i ? ve(i, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[r] = e;
|
|
3
|
+
var D = (i, r, e) => je(i, typeof r != "symbol" ? r + "" : r, e);
|
|
4
|
+
import ce, { createContext as Ne, useContext as Te, useRef as S, useState as T, useEffect as P, useCallback as A, useMemo as V } from "react";
|
|
5
|
+
import { createPortal as ke } from "react-dom";
|
|
6
|
+
var de = { exports: {} }, J = {};
|
|
7
7
|
/**
|
|
8
8
|
* @license React
|
|
9
9
|
* react-jsx-runtime.production.js
|
|
@@ -13,28 +13,28 @@ var X = { exports: {} }, U = {};
|
|
|
13
13
|
* This source code is licensed under the MIT license found in the
|
|
14
14
|
* LICENSE file in the root directory of this source tree.
|
|
15
15
|
*/
|
|
16
|
-
var
|
|
17
|
-
function
|
|
18
|
-
var
|
|
19
|
-
if (e !== void 0 && (
|
|
16
|
+
var Ie = Symbol.for("react.transitional.element"), Ee = Symbol.for("react.fragment");
|
|
17
|
+
function we(i, r, e) {
|
|
18
|
+
var o = null;
|
|
19
|
+
if (e !== void 0 && (o = "" + e), r.key !== void 0 && (o = "" + r.key), "key" in r) {
|
|
20
20
|
e = {};
|
|
21
|
-
for (var s in
|
|
22
|
-
s !== "key" && (e[s] =
|
|
23
|
-
} else e =
|
|
24
|
-
return
|
|
25
|
-
$$typeof:
|
|
21
|
+
for (var s in r)
|
|
22
|
+
s !== "key" && (e[s] = r[s]);
|
|
23
|
+
} else e = r;
|
|
24
|
+
return r = e.ref, {
|
|
25
|
+
$$typeof: Ie,
|
|
26
26
|
type: i,
|
|
27
|
-
key:
|
|
28
|
-
ref:
|
|
27
|
+
key: o,
|
|
28
|
+
ref: r !== void 0 ? r : null,
|
|
29
29
|
props: e
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
var
|
|
37
|
-
const
|
|
32
|
+
J.Fragment = Ee;
|
|
33
|
+
J.jsx = we;
|
|
34
|
+
J.jsxs = we;
|
|
35
|
+
de.exports = J;
|
|
36
|
+
var t = de.exports;
|
|
37
|
+
const $ = {
|
|
38
38
|
api: {
|
|
39
39
|
baseUrl: "/api",
|
|
40
40
|
retryConfig: {
|
|
@@ -62,214 +62,103 @@ const C = {
|
|
|
62
62
|
provider: "piper"
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
},
|
|
65
|
+
}, ue = Ne(
|
|
66
66
|
null
|
|
67
67
|
);
|
|
68
|
-
function
|
|
68
|
+
function Re({
|
|
69
69
|
config: i = {},
|
|
70
|
-
children:
|
|
70
|
+
children: r
|
|
71
71
|
}) {
|
|
72
|
-
var
|
|
72
|
+
var o, s, c, a;
|
|
73
73
|
const e = {
|
|
74
74
|
api: {
|
|
75
|
-
|
|
75
|
+
...$.api,
|
|
76
76
|
...i.api,
|
|
77
77
|
retryConfig: {
|
|
78
|
-
|
|
79
|
-
...(
|
|
78
|
+
...$.api.retryConfig,
|
|
79
|
+
...(o = i.api) == null ? void 0 : o.retryConfig
|
|
80
80
|
}
|
|
81
81
|
},
|
|
82
82
|
ui: {
|
|
83
|
-
|
|
83
|
+
...$.ui,
|
|
84
84
|
...i.ui
|
|
85
85
|
},
|
|
86
86
|
interview: {
|
|
87
|
-
|
|
87
|
+
...$.interview,
|
|
88
88
|
...i.interview,
|
|
89
89
|
timers: {
|
|
90
|
-
|
|
90
|
+
...$.interview.timers,
|
|
91
91
|
...(s = i.interview) == null ? void 0 : s.timers
|
|
92
92
|
},
|
|
93
93
|
stt: {
|
|
94
|
-
|
|
94
|
+
...$.interview.stt,
|
|
95
95
|
...(c = i.interview) == null ? void 0 : c.stt
|
|
96
96
|
},
|
|
97
97
|
tts: {
|
|
98
|
-
|
|
99
|
-
...(
|
|
98
|
+
...$.interview.tts,
|
|
99
|
+
...(a = i.interview) == null ? void 0 : a.tts
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
};
|
|
103
|
-
return /* @__PURE__ */
|
|
103
|
+
return /* @__PURE__ */ t.jsx(ue.Provider, { value: e, children: r });
|
|
104
104
|
}
|
|
105
|
-
function
|
|
106
|
-
const i =
|
|
105
|
+
function X() {
|
|
106
|
+
const i = Te(ue);
|
|
107
107
|
if (!i)
|
|
108
108
|
throw new Error(
|
|
109
109
|
"useInterviewConfig must be used within an InterviewWidgetProvider. Wrap your component tree with <InterviewWidgetProvider config={...}>"
|
|
110
110
|
);
|
|
111
111
|
return i;
|
|
112
112
|
}
|
|
113
|
-
function
|
|
114
|
-
return
|
|
113
|
+
function Se() {
|
|
114
|
+
return X().api || $.api;
|
|
115
115
|
}
|
|
116
|
-
function
|
|
117
|
-
return
|
|
116
|
+
function W() {
|
|
117
|
+
return X().ui || $.ui;
|
|
118
118
|
}
|
|
119
|
-
function
|
|
120
|
-
return
|
|
119
|
+
function Ce() {
|
|
120
|
+
return X().interview || $.interview;
|
|
121
121
|
}
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
"
|
|
146
|
-
{
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
"div",
|
|
153
|
-
{
|
|
154
|
-
className: `iw-relative iw-bg-white iw-rounded-lg iw-shadow-xl iw-max-w-md iw-w-full iw-mx-4 iw-max-h-[90vh] iw-overflow-hidden ${o}`,
|
|
155
|
-
role: "dialog",
|
|
156
|
-
"aria-modal": "true",
|
|
157
|
-
"aria-labelledby": a ? "dialog-title" : void 0,
|
|
158
|
-
children: [
|
|
159
|
-
(a || s) && /* @__PURE__ */ r.jsxs("div", { className: "iw-flex iw-items-center iw-justify-between iw-p-4 iw-border-b iw-border-gray-200", children: [
|
|
160
|
-
a && /* @__PURE__ */ r.jsx(
|
|
161
|
-
"h2",
|
|
162
|
-
{
|
|
163
|
-
id: "dialog-title",
|
|
164
|
-
className: "iw-text-lg iw-font-semibold iw-text-gray-900",
|
|
165
|
-
children: a
|
|
166
|
-
}
|
|
167
|
-
),
|
|
168
|
-
s && /* @__PURE__ */ r.jsx(
|
|
169
|
-
"button",
|
|
170
|
-
{
|
|
171
|
-
onClick: t,
|
|
172
|
-
className: "iw-p-1 iw-text-gray-400 iw-hover:text-gray-600 iw-transition-colors iw-rounded iw-hover:bg-gray-100",
|
|
173
|
-
"aria-label": "Close dialog",
|
|
174
|
-
children: /* @__PURE__ */ r.jsx(
|
|
175
|
-
"svg",
|
|
176
|
-
{
|
|
177
|
-
className: "iw-w-5 iw-h-5",
|
|
178
|
-
fill: "none",
|
|
179
|
-
stroke: "currentColor",
|
|
180
|
-
viewBox: "0 0 24 24",
|
|
181
|
-
children: /* @__PURE__ */ r.jsx(
|
|
182
|
-
"path",
|
|
183
|
-
{
|
|
184
|
-
strokeLinecap: "round",
|
|
185
|
-
strokeLinejoin: "round",
|
|
186
|
-
strokeWidth: 2,
|
|
187
|
-
d: "M6 18L18 6M6 6l12 12"
|
|
188
|
-
}
|
|
189
|
-
)
|
|
190
|
-
}
|
|
191
|
-
)
|
|
192
|
-
}
|
|
193
|
-
)
|
|
194
|
-
] }),
|
|
195
|
-
/* @__PURE__ */ r.jsx("div", { className: "iw-p-4 iw-overflow-y-auto", children: e })
|
|
196
|
-
]
|
|
197
|
-
}
|
|
198
|
-
)
|
|
199
|
-
] });
|
|
200
|
-
return pe(g, document.body);
|
|
201
|
-
}, Ee = ({
|
|
202
|
-
confirmExitInterview: i,
|
|
203
|
-
isOpen: t,
|
|
204
|
-
onClose: e
|
|
205
|
-
}) => /* @__PURE__ */ r.jsx(ve, { isOpen: t, onClose: e, title: "Exit Interview", children: /* @__PURE__ */ r.jsxs("div", { className: "iw-space-y-4", children: [
|
|
206
|
-
/* @__PURE__ */ r.jsx("p", { className: "iw-text-base iw-text-gray-700", children: "Are you sure you want to exit the interview? All progress will be lost and you will not be able to resume." }),
|
|
207
|
-
/* @__PURE__ */ r.jsxs("div", { className: "iw-flex iw-justify-end iw-space-x-2", children: [
|
|
208
|
-
/* @__PURE__ */ r.jsx(
|
|
209
|
-
"button",
|
|
210
|
-
{
|
|
211
|
-
className: "iw-px-4 iw-py-2 iw-bg-gray-200 iw-rounded iw-text-gray-700 iw-font-medium",
|
|
212
|
-
onClick: e,
|
|
213
|
-
children: "Cancel"
|
|
214
|
-
}
|
|
215
|
-
),
|
|
216
|
-
/* @__PURE__ */ r.jsx(
|
|
217
|
-
"button",
|
|
218
|
-
{
|
|
219
|
-
className: "iw-px-4 iw-py-2 iw-bg-red-600 iw-text-white iw-rounded iw-font-medium",
|
|
220
|
-
onClick: i,
|
|
221
|
-
children: "Confirm Exit"
|
|
222
|
-
}
|
|
223
|
-
)
|
|
224
|
-
] })
|
|
225
|
-
] }) }), je = ({ title: i, onExit: t }) => {
|
|
226
|
-
const { baseColor: e } = F(), [a, s] = y(!1);
|
|
227
|
-
return /* @__PURE__ */ r.jsxs("header", { className: "iw-w-full iw-text-gray-900", children: [
|
|
228
|
-
/* @__PURE__ */ r.jsxs("div", { className: "iw-mx-auto iw-flex iw-items-center iw-justify-between iw-px-4 iw-py-3", children: [
|
|
229
|
-
/* @__PURE__ */ r.jsxs("div", { className: "iw-flex iw-items-center iw-space-x-2", children: [
|
|
230
|
-
/* @__PURE__ */ r.jsx(
|
|
231
|
-
"div",
|
|
232
|
-
{
|
|
233
|
-
className: "iw-h-7 iw-w-7 iw-rounded-md iw-flex iw-items-center iw-justify-center iw-text-white iw-font-semibold",
|
|
234
|
-
style: { backgroundColor: e },
|
|
235
|
-
children: "N"
|
|
236
|
-
}
|
|
237
|
-
),
|
|
238
|
-
/* @__PURE__ */ r.jsx("p", { className: "iw-text-sm iw-font-medium", children: "Novara" })
|
|
239
|
-
] }),
|
|
240
|
-
/* @__PURE__ */ r.jsx("h1", { className: "iw-text-base iw-font-medium", children: i }),
|
|
241
|
-
/* @__PURE__ */ r.jsx(
|
|
242
|
-
"button",
|
|
243
|
-
{
|
|
244
|
-
className: "iw-text-sm iw-text-gray-500 hover:iw-text-gray-700",
|
|
245
|
-
onClick: () => s(!0),
|
|
246
|
-
children: "Exit Interview"
|
|
247
|
-
}
|
|
248
|
-
)
|
|
249
|
-
] }),
|
|
250
|
-
/* @__PURE__ */ r.jsx("div", { className: "iw-h-px iw-bg-gray-200" }),
|
|
251
|
-
/* @__PURE__ */ r.jsx(
|
|
252
|
-
Ee,
|
|
253
|
-
{
|
|
254
|
-
isOpen: a,
|
|
255
|
-
confirmExitInterview: () => {
|
|
256
|
-
t(), s(!1);
|
|
257
|
-
},
|
|
258
|
-
onClose: () => s(!1)
|
|
259
|
-
}
|
|
260
|
-
)
|
|
261
|
-
] });
|
|
262
|
-
}, $ = ({
|
|
122
|
+
const he = ({
|
|
123
|
+
className: i,
|
|
124
|
+
...r
|
|
125
|
+
}) => /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsxs(
|
|
126
|
+
"svg",
|
|
127
|
+
{
|
|
128
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
129
|
+
width: "20",
|
|
130
|
+
height: "20",
|
|
131
|
+
viewBox: "0 0 24 24",
|
|
132
|
+
fill: "none",
|
|
133
|
+
stroke: "currentColor",
|
|
134
|
+
strokeWidth: "2",
|
|
135
|
+
strokeLinecap: "round",
|
|
136
|
+
strokeLinejoin: "round",
|
|
137
|
+
className: `iw-animate-spin ${i}`,
|
|
138
|
+
...r,
|
|
139
|
+
children: [
|
|
140
|
+
/* @__PURE__ */ t.jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
|
|
141
|
+
/* @__PURE__ */ t.jsx("path", { d: "M12 6l0 -3" }),
|
|
142
|
+
/* @__PURE__ */ t.jsx("path", { d: "M16.25 7.75l2.15 -2.15" }),
|
|
143
|
+
/* @__PURE__ */ t.jsx("path", { d: "M18 12l3 0" }),
|
|
144
|
+
/* @__PURE__ */ t.jsx("path", { d: "M16.25 16.25l2.15 2.15" }),
|
|
145
|
+
/* @__PURE__ */ t.jsx("path", { d: "M12 18l0 3" }),
|
|
146
|
+
/* @__PURE__ */ t.jsx("path", { d: "M7.75 16.25l-2.15 2.15" }),
|
|
147
|
+
/* @__PURE__ */ t.jsx("path", { d: "M6 12l-3 0" }),
|
|
148
|
+
/* @__PURE__ */ t.jsx("path", { d: "M7.75 7.75l-2.15 -2.15" })
|
|
149
|
+
]
|
|
150
|
+
}
|
|
151
|
+
) }), se = ({
|
|
263
152
|
children: i,
|
|
264
|
-
variant:
|
|
153
|
+
variant: r = "primary",
|
|
265
154
|
size: e = "md",
|
|
266
|
-
fullWidth:
|
|
155
|
+
fullWidth: o = !1,
|
|
267
156
|
isLoading: s = !1,
|
|
268
157
|
disabled: c,
|
|
269
|
-
className:
|
|
270
|
-
...
|
|
158
|
+
className: a = "",
|
|
159
|
+
...n
|
|
271
160
|
}) => {
|
|
272
|
-
const
|
|
161
|
+
const w = "iw-inline-flex iw-items-center iw-justify-center iw-rounded-md iw-font-medium iw-transition-colors iw-focus:outline-none iw-focus:ring-2 iw-focus:ring-primary-500 iw-focus:ring-offset-2", m = {
|
|
273
162
|
primary: "iw-bg-primary-600 iw-text-white iw-hover:bg-primary-700 iw-border iw-border-transparent",
|
|
274
163
|
secondary: "iw-bg-primary-100 iw-text-primary-700 iw-hover:bg-primary-200 iw-border iw-border-transparent",
|
|
275
164
|
outline: "iw-bg-transparent iw-text-primary-700 iw-border iw-border-primary-500 iw-hover:bg-primary-50",
|
|
@@ -277,159 +166,194 @@ const ve = ({
|
|
|
277
166
|
gradient: "iw-text-white iw-border iw-border-transparent iw-bg-gradient-to-r iw-from-purple-500 iw-to-indigo-500 hover:iw-from-purple-600 hover:iw-to-indigo-600"
|
|
278
167
|
}, d = {
|
|
279
168
|
sm: "iw-px-3 iw-py-1.5 iw-text-sm",
|
|
280
|
-
md: "iw-px-4 iw-py-2 iw-text-sm",
|
|
281
|
-
lg: "iw-px-5 iw-py-
|
|
282
|
-
},
|
|
283
|
-
return /* @__PURE__ */
|
|
169
|
+
md: "iw-px-4 iw-py-2.5 iw-text-sm",
|
|
170
|
+
lg: "iw-px-5 iw-py-3 iw-text-base"
|
|
171
|
+
}, h = "iw-disabled:opacity-50 iw-disabled:cursor-not-allowed iw-disabled:pointer-events-none", u = o ? "iw-w-full" : "";
|
|
172
|
+
return /* @__PURE__ */ t.jsxs(
|
|
284
173
|
"button",
|
|
285
174
|
{
|
|
286
|
-
className: `${
|
|
175
|
+
className: `${w} ${m[r]} ${d[e]} ${u} ${h} ${a}`,
|
|
287
176
|
disabled: c || s,
|
|
288
|
-
...
|
|
177
|
+
...n,
|
|
289
178
|
children: [
|
|
290
|
-
s && /* @__PURE__ */
|
|
291
|
-
"svg",
|
|
292
|
-
{
|
|
293
|
-
className: "iw-animate-spin iw-mr-2 iw-h-4 iw-w-4 iw-text-white",
|
|
294
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
295
|
-
fill: "none",
|
|
296
|
-
viewBox: "0 0 24 24",
|
|
297
|
-
children: [
|
|
298
|
-
/* @__PURE__ */ r.jsx(
|
|
299
|
-
"circle",
|
|
300
|
-
{
|
|
301
|
-
className: "iw-opacity-25",
|
|
302
|
-
cx: "12",
|
|
303
|
-
cy: "12",
|
|
304
|
-
r: "10",
|
|
305
|
-
stroke: "currentColor",
|
|
306
|
-
strokeWidth: "4"
|
|
307
|
-
}
|
|
308
|
-
),
|
|
309
|
-
/* @__PURE__ */ r.jsx(
|
|
310
|
-
"path",
|
|
311
|
-
{
|
|
312
|
-
className: "iw-opacity-75",
|
|
313
|
-
fill: "currentColor",
|
|
314
|
-
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
315
|
-
}
|
|
316
|
-
)
|
|
317
|
-
]
|
|
318
|
-
}
|
|
319
|
-
),
|
|
179
|
+
s && /* @__PURE__ */ t.jsx(he, { height: 16, width: 16, style: { marginRight: "3px" } }),
|
|
320
180
|
i
|
|
321
181
|
]
|
|
322
182
|
}
|
|
323
183
|
);
|
|
324
|
-
}
|
|
184
|
+
};
|
|
185
|
+
function Me(i) {
|
|
186
|
+
const r = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(i);
|
|
187
|
+
return r ? {
|
|
188
|
+
r: parseInt(r[1], 16),
|
|
189
|
+
g: parseInt(r[2], 16),
|
|
190
|
+
b: parseInt(r[3], 16)
|
|
191
|
+
} : null;
|
|
192
|
+
}
|
|
193
|
+
function Ae(i, r, e) {
|
|
194
|
+
return "#" + [i, r, e].map((o) => {
|
|
195
|
+
const s = Math.round(o).toString(16);
|
|
196
|
+
return s.length === 1 ? "0" + s : s;
|
|
197
|
+
}).join("");
|
|
198
|
+
}
|
|
199
|
+
function me(i, r) {
|
|
200
|
+
const e = Me(i);
|
|
201
|
+
if (!e) return i;
|
|
202
|
+
const o = e.r + (255 - e.r) * r, s = e.g + (255 - e.g) * r, c = e.b + (255 - e.b) * r;
|
|
203
|
+
return Ae(o, s, c);
|
|
204
|
+
}
|
|
205
|
+
function De(i, r = 0.8) {
|
|
206
|
+
return {
|
|
207
|
+
background: `linear-gradient(to bottom, ${me(i, r)}, #ffffff)`,
|
|
208
|
+
color: "#1f2937"
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
function Pe(i) {
|
|
212
|
+
return new Promise((r) => setTimeout(r, i));
|
|
213
|
+
}
|
|
214
|
+
function ge(i) {
|
|
215
|
+
return `linear-gradient(to left, ${me(i, 0.4)}, ${i})`;
|
|
216
|
+
}
|
|
217
|
+
const $e = (i) => /* @__PURE__ */ t.jsxs(
|
|
218
|
+
"svg",
|
|
219
|
+
{
|
|
220
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
221
|
+
width: "24",
|
|
222
|
+
height: "24",
|
|
223
|
+
viewBox: "0 0 24 24",
|
|
224
|
+
fill: "none",
|
|
225
|
+
stroke: "currentColor",
|
|
226
|
+
strokeWidth: "2",
|
|
227
|
+
strokeLinecap: "round",
|
|
228
|
+
strokeLinejoin: "round",
|
|
229
|
+
...i,
|
|
230
|
+
children: [
|
|
231
|
+
/* @__PURE__ */ t.jsx("path", { d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z" }),
|
|
232
|
+
/* @__PURE__ */ t.jsx("path", { d: "m9 12 2 2 4-4" })
|
|
233
|
+
]
|
|
234
|
+
}
|
|
235
|
+
), _e = [
|
|
236
|
+
"Do not refresh or reload the page during your assessment",
|
|
237
|
+
"Refrain from switching tabs or opening other applications while the session is in progress",
|
|
238
|
+
"Ensure your face remains clearly visible on camera at all times",
|
|
239
|
+
"Avoid frequent distractions or leaving your seat during the session",
|
|
240
|
+
"Do not disable or interfere with audio/video monitoring",
|
|
241
|
+
"All activities are being recorded, and any violations may result in penalties, including disqualification"
|
|
242
|
+
], Le = ({
|
|
325
243
|
isOpen: i,
|
|
326
|
-
onStart:
|
|
244
|
+
onStart: r,
|
|
327
245
|
onClose: e
|
|
328
246
|
}) => {
|
|
329
|
-
var
|
|
330
|
-
const
|
|
331
|
-
s.current && (s.current.getTracks().forEach((
|
|
332
|
-
},
|
|
333
|
-
|
|
247
|
+
var j;
|
|
248
|
+
const o = S(null), s = S(null), { baseColor: c, borderRadius: a } = W(), [n, w] = T(!1), [m, d] = T(null), [h, u] = T(!1), g = () => {
|
|
249
|
+
s.current && (s.current.getTracks().forEach((l) => l.stop()), s.current = null);
|
|
250
|
+
}, y = async () => {
|
|
251
|
+
u(!0), d(null);
|
|
334
252
|
try {
|
|
335
|
-
const
|
|
253
|
+
const l = await navigator.mediaDevices.getUserMedia({
|
|
336
254
|
video: { width: { ideal: 1280 }, height: { ideal: 720 } },
|
|
337
255
|
audio: !0
|
|
338
256
|
});
|
|
339
|
-
s.current =
|
|
340
|
-
} catch (
|
|
341
|
-
console.error("Media permission error:",
|
|
257
|
+
s.current = l, o.current && (o.current.srcObject = l), w(!0);
|
|
258
|
+
} catch (l) {
|
|
259
|
+
console.error("Media permission error:", l);
|
|
342
260
|
let p = "Unable to access camera or microphone.";
|
|
343
|
-
(
|
|
261
|
+
(l == null ? void 0 : l.name) === "NotAllowedError" ? p = "Permissions denied. Please allow access to camera and microphone." : (l == null ? void 0 : l.name) === "NotFoundError" ? p = "No camera/microphone found. Please connect a device and retry." : l != null && l.message && (p = l.message), w(!1), d(p);
|
|
344
262
|
} finally {
|
|
345
|
-
|
|
263
|
+
u(!1);
|
|
346
264
|
}
|
|
347
265
|
};
|
|
348
|
-
if (
|
|
266
|
+
if (P(() => {
|
|
349
267
|
if (!i) {
|
|
350
|
-
|
|
268
|
+
g();
|
|
351
269
|
return;
|
|
352
270
|
}
|
|
353
|
-
return
|
|
354
|
-
|
|
271
|
+
return y(), () => {
|
|
272
|
+
g();
|
|
355
273
|
};
|
|
356
274
|
}, [i]), !i) return null;
|
|
357
|
-
const
|
|
358
|
-
|
|
275
|
+
const k = () => {
|
|
276
|
+
r(), g();
|
|
359
277
|
};
|
|
360
|
-
return /* @__PURE__ */
|
|
361
|
-
/* @__PURE__ */
|
|
362
|
-
/* @__PURE__ */
|
|
363
|
-
e && /* @__PURE__ */
|
|
278
|
+
return /* @__PURE__ */ t.jsx("div", { className: "iw-fixed iw-inset-0 iw-z-50 iw-flex iw-items-center iw-justify-center iw-bg-black/50 iw-backdrop-blur-sm", children: /* @__PURE__ */ t.jsxs("div", { className: "iw-bg-white iw-rounded-xl iw-shadow-2xl iw-w-full iw-max-w-[800px] iw-mx-4", children: [
|
|
279
|
+
/* @__PURE__ */ t.jsxs("div", { className: "iw-px-5 iw-py-4 iw-border-b iw-border-gray-200 iw-flex iw-items-center iw-justify-between", children: [
|
|
280
|
+
/* @__PURE__ */ t.jsx("h2", { className: "iw-text-base iw-font-semibold", children: "Interview Onboarding" }),
|
|
281
|
+
e && /* @__PURE__ */ t.jsx(
|
|
364
282
|
"button",
|
|
365
283
|
{
|
|
366
284
|
"aria-label": "Close",
|
|
367
285
|
className: "iw-text-gray-500 hover:iw-text-gray-700",
|
|
368
286
|
onClick: () => {
|
|
369
|
-
|
|
287
|
+
g(), e == null || e();
|
|
370
288
|
},
|
|
371
289
|
children: "✕"
|
|
372
290
|
}
|
|
373
291
|
)
|
|
374
292
|
] }),
|
|
375
|
-
/* @__PURE__ */
|
|
376
|
-
/* @__PURE__ */
|
|
377
|
-
"
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
/* @__PURE__ */
|
|
391
|
-
/* @__PURE__ */
|
|
392
|
-
|
|
293
|
+
/* @__PURE__ */ t.jsxs("div", { className: "iw-p-4 iw-grid iw-grid-cols-2 iw-gap-4", children: [
|
|
294
|
+
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
295
|
+
/* @__PURE__ */ t.jsx("div", { className: "iw-border iw-border-gray-200 iw-rounded-lg iw-overflow-hidden iw-bg-gray-900", children: /* @__PURE__ */ t.jsx(
|
|
296
|
+
"video",
|
|
297
|
+
{
|
|
298
|
+
ref: o,
|
|
299
|
+
autoPlay: !0,
|
|
300
|
+
playsInline: !0,
|
|
301
|
+
muted: !0,
|
|
302
|
+
className: "iw-w-full iw-h-64 iw-object-cover",
|
|
303
|
+
style: {
|
|
304
|
+
transform: "scaleX(-1)"
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
) }),
|
|
308
|
+
/* @__PURE__ */ t.jsxs("div", { className: "iw-grid iw-grid-cols-2 iw-gap-2 iw-mt-3", children: [
|
|
309
|
+
/* @__PURE__ */ t.jsx(
|
|
310
|
+
se,
|
|
393
311
|
{
|
|
394
|
-
onClick:
|
|
395
|
-
|
|
312
|
+
onClick: y,
|
|
313
|
+
disabled: h,
|
|
396
314
|
variant: "outline",
|
|
397
315
|
size: "sm",
|
|
398
316
|
style: {
|
|
399
317
|
borderColor: c,
|
|
400
|
-
borderRadius:
|
|
318
|
+
borderRadius: a,
|
|
401
319
|
color: c
|
|
402
320
|
},
|
|
403
|
-
children:
|
|
321
|
+
children: n ? "Recheck Permissions" : "Enable Camera & Mic"
|
|
404
322
|
}
|
|
405
323
|
),
|
|
406
|
-
/* @__PURE__ */
|
|
407
|
-
|
|
324
|
+
/* @__PURE__ */ t.jsx(
|
|
325
|
+
se,
|
|
408
326
|
{
|
|
409
|
-
onClick:
|
|
410
|
-
disabled: !
|
|
327
|
+
onClick: k,
|
|
328
|
+
disabled: !n,
|
|
411
329
|
size: "sm",
|
|
412
|
-
style: {
|
|
413
|
-
|
|
330
|
+
style: {
|
|
331
|
+
background: ge(c),
|
|
332
|
+
borderRadius: a
|
|
333
|
+
},
|
|
334
|
+
children: "Start Interview"
|
|
414
335
|
}
|
|
415
336
|
)
|
|
416
|
-
] }),
|
|
417
|
-
/* @__PURE__ */ r.jsxs("ul", { className: "iw-text-xs iw-text-gray-500 iw-pt-2 iw-list-disc iw-pl-4", children: [
|
|
418
|
-
/* @__PURE__ */ r.jsx("li", { children: "Your preview is muted to avoid echo." }),
|
|
419
|
-
/* @__PURE__ */ r.jsx("li", { children: "You can change devices from your browser’s site settings." })
|
|
420
337
|
] })
|
|
338
|
+
] }),
|
|
339
|
+
/* @__PURE__ */ t.jsxs("div", { className: "iw-flex iw-flex-col iw-gap-3", children: [
|
|
340
|
+
/* @__PURE__ */ t.jsxs("div", { className: "iw-flex iw-items-center iw-gap-2 iw-text-gray-800 iw-font-semibold", children: [
|
|
341
|
+
/* @__PURE__ */ t.jsx($e, {}),
|
|
342
|
+
/* @__PURE__ */ t.jsx("h3", { children: "Interview Guidelines" })
|
|
343
|
+
] }),
|
|
344
|
+
!((j = navigator.mediaDevices) != null && j.getUserMedia) && /* @__PURE__ */ t.jsx("div", { className: "iw-text-xs iw-text-red-600", children: "Your browser does not support media devices. Please use a modern browser like Chrome, Edge, or Firefox." }),
|
|
345
|
+
m && /* @__PURE__ */ t.jsx("div", { className: "iw-text-xs iw-text-red-600", children: m }),
|
|
346
|
+
/* @__PURE__ */ t.jsx("ul", { className: "iw-mt-1 iw-text-sm iw-text-gray-500 iw-list-disc iw-pl-4 iw-space-y-1.5", children: _e.map((l, p) => /* @__PURE__ */ t.jsx("li", { children: l }, p)) })
|
|
421
347
|
] })
|
|
422
348
|
] })
|
|
423
349
|
] }) });
|
|
424
350
|
};
|
|
425
|
-
var
|
|
426
|
-
const
|
|
351
|
+
var R = /* @__PURE__ */ ((i) => (i.IDLE = "idle", i.FETCHING_QUESTION = "fetching_question", i.READING_QUESTION = "reading_question", i.THINKING = "thinking", i.ANSWERING = "answering", i.TRANSCRIBING = "transcribing", i.EDITING = "editing", i.SUBMITTING = "submitting", i.COMPLETED = "completed", i))(R || {});
|
|
352
|
+
const Oe = {
|
|
427
353
|
thinkingDuration: 30,
|
|
428
354
|
answeringDuration: 120,
|
|
429
|
-
editingDuration: 30
|
|
430
|
-
|
|
431
|
-
minimumTimeForNextQuestion: 120
|
|
432
|
-
}, Ce = {
|
|
355
|
+
editingDuration: 30
|
|
356
|
+
}, Fe = {
|
|
433
357
|
idle: {
|
|
434
358
|
next: "fetching_question"
|
|
435
359
|
/* FETCHING_QUESTION */
|
|
@@ -458,17 +382,16 @@ const Re = {
|
|
|
458
382
|
/* COMPLETED */
|
|
459
383
|
}
|
|
460
384
|
};
|
|
461
|
-
class
|
|
462
|
-
constructor(
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
this.config = { ...
|
|
385
|
+
class Ue {
|
|
386
|
+
constructor(r = {}, e = {}) {
|
|
387
|
+
D(this, "config");
|
|
388
|
+
D(this, "state");
|
|
389
|
+
D(this, "phaseIntervalId", null);
|
|
390
|
+
D(this, "globalIntervalId", null);
|
|
391
|
+
D(this, "callbacks");
|
|
392
|
+
this.config = { ...Oe, ...r }, this.callbacks = e, this.state = {
|
|
469
393
|
phase: "idle",
|
|
470
394
|
currentPhaseTimeRemaining: 0,
|
|
471
|
-
totalTimeRemaining: this.config.totalInterviewDuration,
|
|
472
395
|
totalTimeElapsed: 0,
|
|
473
396
|
currentQuestionNumber: 0
|
|
474
397
|
};
|
|
@@ -483,22 +406,24 @@ class ke {
|
|
|
483
406
|
* Start a new question cycle
|
|
484
407
|
*/
|
|
485
408
|
startQuestion() {
|
|
486
|
-
var t, e;
|
|
487
|
-
if (this.state.totalTimeRemaining < this.config.minimumTimeForNextQuestion) {
|
|
488
|
-
this.state.phase = "completed", this.stopGlobalTimer(), this.stopPhaseTimer(), (e = (t = this.callbacks).onInterviewEnd) == null || e.call(t), this.notifyChange();
|
|
489
|
-
return;
|
|
490
|
-
}
|
|
491
409
|
this.state.currentQuestionNumber === 0 && this.startGlobalTimer(), this.state.currentQuestionNumber = this.state.currentQuestionNumber + 1, this.state.phase = "fetching_question", this.notifyChange();
|
|
492
410
|
}
|
|
493
411
|
/**
|
|
494
412
|
* Move to next phase
|
|
495
413
|
*/
|
|
496
414
|
nextPhase() {
|
|
497
|
-
const
|
|
415
|
+
const r = this.state.phase, e = Fe[r];
|
|
498
416
|
if (!e) return;
|
|
499
417
|
this.stopPhaseTimer(), this.state.phase = e.next;
|
|
500
|
-
const
|
|
501
|
-
|
|
418
|
+
const o = this.getDurationForPhase(e.next);
|
|
419
|
+
o > 0 ? (this.state.currentPhaseTimeRemaining = o, this.startPhaseTimer()) : this.state.currentPhaseTimeRemaining = 0, this.notifyChange();
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* Manually complete the interview
|
|
423
|
+
*/
|
|
424
|
+
completeInterview() {
|
|
425
|
+
var r, e;
|
|
426
|
+
this.stopGlobalTimer(), this.stopPhaseTimer(), this.state.phase = "completed", (e = (r = this.callbacks).onInterviewEnd) == null || e.call(r), this.notifyChange();
|
|
502
427
|
}
|
|
503
428
|
/**
|
|
504
429
|
* Cleanup
|
|
@@ -509,8 +434,8 @@ class ke {
|
|
|
509
434
|
/**
|
|
510
435
|
* Get duration for a phase
|
|
511
436
|
*/
|
|
512
|
-
getDurationForPhase(
|
|
513
|
-
switch (
|
|
437
|
+
getDurationForPhase(r) {
|
|
438
|
+
switch (r) {
|
|
514
439
|
case "thinking":
|
|
515
440
|
return this.config.thinkingDuration;
|
|
516
441
|
case "answering":
|
|
@@ -522,12 +447,12 @@ class ke {
|
|
|
522
447
|
}
|
|
523
448
|
}
|
|
524
449
|
/**
|
|
525
|
-
* Start global timer (runs continuously during entire interview)
|
|
450
|
+
* Start global timer (runs continuously during entire interview for tracking)
|
|
526
451
|
*/
|
|
527
452
|
startGlobalTimer() {
|
|
528
453
|
this.globalIntervalId = setInterval(() => {
|
|
529
|
-
var
|
|
530
|
-
this.state.
|
|
454
|
+
var r, e;
|
|
455
|
+
this.state.totalTimeElapsed++, (e = (r = this.callbacks).onTick) == null || e.call(r, this.getState());
|
|
531
456
|
}, 1e3);
|
|
532
457
|
}
|
|
533
458
|
/**
|
|
@@ -554,88 +479,91 @@ class ke {
|
|
|
554
479
|
* Notify phase change
|
|
555
480
|
*/
|
|
556
481
|
notifyChange() {
|
|
557
|
-
var
|
|
558
|
-
(e = (
|
|
482
|
+
var r, e;
|
|
483
|
+
(e = (r = this.callbacks).onPhaseChange) == null || e.call(r, this.state.phase, this.getState());
|
|
559
484
|
}
|
|
560
485
|
}
|
|
561
|
-
function
|
|
562
|
-
const { config:
|
|
563
|
-
|
|
564
|
-
const s =
|
|
565
|
-
|
|
486
|
+
function Ge(i = {}) {
|
|
487
|
+
const { config: r = {}, callbacks: e = {} } = i, o = S(null);
|
|
488
|
+
o.current || (o.current = new Ue(r, {}));
|
|
489
|
+
const s = o.current, [c, a] = T(s.getState()), n = A(() => {
|
|
490
|
+
a(s.getState());
|
|
566
491
|
}, [s]);
|
|
567
|
-
|
|
568
|
-
const
|
|
569
|
-
onPhaseChange: (u,
|
|
570
|
-
var
|
|
571
|
-
|
|
492
|
+
P(() => {
|
|
493
|
+
const h = {
|
|
494
|
+
onPhaseChange: (u, g) => {
|
|
495
|
+
var y;
|
|
496
|
+
n(), (y = e.onPhaseChange) == null || y.call(e, u, g);
|
|
572
497
|
},
|
|
573
498
|
onTick: (u) => {
|
|
574
|
-
var
|
|
575
|
-
|
|
499
|
+
var g;
|
|
500
|
+
n(), (g = e.onTick) == null || g.call(e, u);
|
|
576
501
|
},
|
|
577
502
|
onInterviewEnd: () => {
|
|
578
503
|
var u;
|
|
579
|
-
|
|
504
|
+
n(), (u = e.onInterviewEnd) == null || u.call(e);
|
|
580
505
|
}
|
|
581
506
|
};
|
|
582
|
-
s.callbacks =
|
|
583
|
-
}, [s, e,
|
|
507
|
+
s.callbacks = h;
|
|
508
|
+
}, [s, e, n]), P(() => () => {
|
|
584
509
|
s.destroy();
|
|
585
510
|
}, [s]);
|
|
586
|
-
const
|
|
587
|
-
s.startQuestion(),
|
|
588
|
-
}, [s,
|
|
589
|
-
s.nextPhase(),
|
|
590
|
-
}, [s,
|
|
511
|
+
const w = A(() => {
|
|
512
|
+
s.startQuestion(), n();
|
|
513
|
+
}, [s, n]), m = A(() => {
|
|
514
|
+
s.nextPhase(), n();
|
|
515
|
+
}, [s, n]), d = A(() => {
|
|
516
|
+
s.completeInterview(), n();
|
|
517
|
+
}, [s, n]);
|
|
591
518
|
return {
|
|
592
519
|
state: c,
|
|
593
|
-
startQuestion:
|
|
594
|
-
nextPhase:
|
|
520
|
+
startQuestion: w,
|
|
521
|
+
nextPhase: m,
|
|
522
|
+
completeInterview: d,
|
|
595
523
|
timerService: s
|
|
596
524
|
};
|
|
597
525
|
}
|
|
598
|
-
function
|
|
599
|
-
const [e,
|
|
526
|
+
function qe(i, r = {}) {
|
|
527
|
+
const [e, o] = T({
|
|
600
528
|
data: null,
|
|
601
529
|
loading: !1,
|
|
602
530
|
error: null
|
|
603
|
-
}), s =
|
|
531
|
+
}), s = A(
|
|
604
532
|
async (...c) => {
|
|
605
|
-
var n,
|
|
606
|
-
|
|
533
|
+
var a, n, w, m;
|
|
534
|
+
o((d) => ({ ...d, loading: !0, error: null }));
|
|
607
535
|
try {
|
|
608
536
|
const d = await i(...c);
|
|
609
|
-
|
|
610
|
-
...
|
|
537
|
+
o((h) => ({
|
|
538
|
+
...h,
|
|
611
539
|
data: d,
|
|
612
540
|
loading: !1,
|
|
613
541
|
error: null
|
|
614
|
-
})), (
|
|
542
|
+
})), (a = r.onSuccess) == null || a.call(r, d), (n = r.onSettled) == null || n.call(r, d, null);
|
|
615
543
|
} catch (d) {
|
|
616
|
-
const
|
|
544
|
+
const h = d.type ? d : {
|
|
617
545
|
type: "unknown",
|
|
618
546
|
message: d.message || "Unknown error",
|
|
619
547
|
retryable: !0,
|
|
620
548
|
userMessage: "Something went wrong. Please try again.",
|
|
621
549
|
originalError: d
|
|
622
550
|
};
|
|
623
|
-
|
|
624
|
-
...
|
|
551
|
+
o((u) => ({
|
|
552
|
+
...u,
|
|
625
553
|
loading: !1,
|
|
626
|
-
error:
|
|
627
|
-
})), (
|
|
554
|
+
error: h
|
|
555
|
+
})), (w = r.onError) == null || w.call(r, h), (m = r.onSettled) == null || m.call(r, null, h);
|
|
628
556
|
}
|
|
629
557
|
},
|
|
630
|
-
[i,
|
|
558
|
+
[i, r]
|
|
631
559
|
);
|
|
632
560
|
return {
|
|
633
561
|
...e,
|
|
634
562
|
execute: s
|
|
635
563
|
};
|
|
636
564
|
}
|
|
637
|
-
function
|
|
638
|
-
var
|
|
565
|
+
function Be(i) {
|
|
566
|
+
var r;
|
|
639
567
|
if (!navigator.onLine)
|
|
640
568
|
return {
|
|
641
569
|
type: "network",
|
|
@@ -643,7 +571,7 @@ function Ae(i) {
|
|
|
643
571
|
retryable: !0,
|
|
644
572
|
userMessage: "Please check your internet connection and try again."
|
|
645
573
|
};
|
|
646
|
-
if (i.name === "AbortError" || (
|
|
574
|
+
if (i.name === "AbortError" || (r = i.message) != null && r.includes("timeout"))
|
|
647
575
|
return {
|
|
648
576
|
type: "timeout",
|
|
649
577
|
message: "Request timed out",
|
|
@@ -693,122 +621,122 @@ function Ae(i) {
|
|
|
693
621
|
originalError: i
|
|
694
622
|
};
|
|
695
623
|
}
|
|
696
|
-
async function
|
|
624
|
+
async function ae(i, r = {}, e = {
|
|
697
625
|
attempts: 3,
|
|
698
626
|
backoff: "exponential",
|
|
699
627
|
baseDelay: 1e3,
|
|
700
628
|
maxDelay: 1e4,
|
|
701
629
|
jitter: !0
|
|
702
630
|
}) {
|
|
703
|
-
let
|
|
631
|
+
let o;
|
|
704
632
|
for (let s = 1; s <= e.attempts; s++)
|
|
705
633
|
try {
|
|
706
|
-
const c = new AbortController(),
|
|
707
|
-
...
|
|
634
|
+
const c = new AbortController(), a = setTimeout(() => c.abort(), 6e4), n = await fetch(i, {
|
|
635
|
+
...r,
|
|
708
636
|
signal: c.signal
|
|
709
637
|
});
|
|
710
|
-
if (clearTimeout(
|
|
711
|
-
return
|
|
712
|
-
if (!
|
|
713
|
-
throw new Error(`HTTP ${
|
|
714
|
-
return
|
|
638
|
+
if (clearTimeout(a), n.status >= 400 && n.status < 500 && n.status !== 429)
|
|
639
|
+
return n;
|
|
640
|
+
if (!n.ok)
|
|
641
|
+
throw new Error(`HTTP ${n.status}: ${n.statusText}`);
|
|
642
|
+
return n;
|
|
715
643
|
} catch (c) {
|
|
716
|
-
|
|
717
|
-
const
|
|
718
|
-
if (!
|
|
719
|
-
throw
|
|
720
|
-
const
|
|
644
|
+
o = c;
|
|
645
|
+
const a = Be(c);
|
|
646
|
+
if (!a.retryable || s === e.attempts)
|
|
647
|
+
throw a;
|
|
648
|
+
const n = ze(s, e);
|
|
721
649
|
console.warn(
|
|
722
|
-
`API request failed (attempt ${s}/${e.attempts}), retrying in ${
|
|
723
|
-
|
|
724
|
-
), await new Promise((
|
|
650
|
+
`API request failed (attempt ${s}/${e.attempts}), retrying in ${n}ms:`,
|
|
651
|
+
a.message
|
|
652
|
+
), await new Promise((w) => setTimeout(w, n));
|
|
725
653
|
}
|
|
726
|
-
throw
|
|
654
|
+
throw o;
|
|
727
655
|
}
|
|
728
|
-
function
|
|
656
|
+
function ze(i, r) {
|
|
729
657
|
let e;
|
|
730
|
-
return
|
|
658
|
+
return r.backoff === "exponential" ? e = r.baseDelay * Math.pow(2, i - 1) : e = r.baseDelay, e = Math.min(e, r.maxDelay), r.jitter && (e = e * (0.5 + Math.random() * 0.5)), Math.round(e);
|
|
731
659
|
}
|
|
732
|
-
class
|
|
733
|
-
constructor(
|
|
734
|
-
|
|
735
|
-
this.config =
|
|
660
|
+
class Qe {
|
|
661
|
+
constructor(r = {}) {
|
|
662
|
+
D(this, "config");
|
|
663
|
+
this.config = r;
|
|
736
664
|
}
|
|
737
665
|
/**
|
|
738
666
|
* Update configuration
|
|
739
667
|
*/
|
|
740
|
-
updateConfig(
|
|
741
|
-
this.config = { ...this.config, ...
|
|
668
|
+
updateConfig(r) {
|
|
669
|
+
this.config = { ...this.config, ...r };
|
|
742
670
|
}
|
|
743
671
|
/**
|
|
744
672
|
* Get default headers for API requests
|
|
745
673
|
*/
|
|
746
674
|
getHeaders() {
|
|
747
675
|
var e;
|
|
748
|
-
const
|
|
676
|
+
const r = {
|
|
749
677
|
"Content-Type": "application/json",
|
|
750
678
|
"X-Auth-Token": "appkey"
|
|
751
679
|
};
|
|
752
|
-
return (e = this.config) != null && e.authToken && (
|
|
680
|
+
return (e = this.config) != null && e.authToken && (r.Authorization = `Bearer ${this.config.authToken}`), r;
|
|
753
681
|
}
|
|
754
682
|
/**
|
|
755
683
|
* Get base URL from config with fallback
|
|
756
684
|
*/
|
|
757
685
|
getBaseUrl() {
|
|
758
|
-
var
|
|
759
|
-
return ((
|
|
686
|
+
var r;
|
|
687
|
+
return ((r = this.config) == null ? void 0 : r.baseUrl) || "/api";
|
|
760
688
|
}
|
|
761
689
|
/**
|
|
762
690
|
* Get questions for an interview
|
|
763
691
|
*/
|
|
764
692
|
async generateQuestion({
|
|
765
|
-
interviewId:
|
|
693
|
+
interviewId: r,
|
|
766
694
|
isInterviewDone: e = !1,
|
|
767
|
-
qnaId:
|
|
695
|
+
qnaId: o,
|
|
768
696
|
question: s,
|
|
769
697
|
answer: c,
|
|
770
|
-
answerDuration:
|
|
698
|
+
answerDuration: a
|
|
771
699
|
}) {
|
|
772
|
-
const
|
|
773
|
-
`${this.getBaseUrl()}/
|
|
700
|
+
const n = await ae(
|
|
701
|
+
`${this.getBaseUrl()}/questions/next`,
|
|
774
702
|
{
|
|
775
703
|
method: "POST",
|
|
776
704
|
headers: this.getHeaders(),
|
|
777
705
|
body: JSON.stringify({
|
|
778
|
-
interview_id:
|
|
706
|
+
interview_id: r,
|
|
779
707
|
is_interview_done: e,
|
|
780
|
-
qna_id:
|
|
708
|
+
qna_id: o,
|
|
781
709
|
question: s,
|
|
782
710
|
answer: c,
|
|
783
711
|
// TODO: Hardcoded for now, will be dynamic later
|
|
784
|
-
answer_duration:
|
|
712
|
+
answer_duration: a ?? "00:00:30"
|
|
785
713
|
})
|
|
786
714
|
}
|
|
787
715
|
);
|
|
788
|
-
if (!
|
|
789
|
-
throw new Error(`Failed to get questions: ${
|
|
790
|
-
return await
|
|
716
|
+
if (!n.ok)
|
|
717
|
+
throw new Error(`Failed to get questions: ${n.status}`);
|
|
718
|
+
return await n.json();
|
|
791
719
|
}
|
|
792
720
|
}
|
|
793
|
-
function
|
|
794
|
-
const i =
|
|
795
|
-
return
|
|
721
|
+
function We() {
|
|
722
|
+
const i = X();
|
|
723
|
+
return V(() => {
|
|
796
724
|
const e = i.api || {};
|
|
797
|
-
return new
|
|
725
|
+
return new Qe(e);
|
|
798
726
|
}, [i.api]);
|
|
799
727
|
}
|
|
800
|
-
class
|
|
801
|
-
constructor(
|
|
802
|
-
super(
|
|
728
|
+
class v extends Error {
|
|
729
|
+
constructor(r, e, o = !1) {
|
|
730
|
+
super(r), this.code = e, this.recoverable = o, this.name = "STTError";
|
|
803
731
|
}
|
|
804
732
|
}
|
|
805
|
-
class
|
|
806
|
-
constructor(
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
733
|
+
class He {
|
|
734
|
+
constructor(r = {}) {
|
|
735
|
+
D(this, "config");
|
|
736
|
+
D(this, "mediaRecorder", null);
|
|
737
|
+
D(this, "audioChunks", []);
|
|
738
|
+
D(this, "recordingStream", null);
|
|
739
|
+
D(this, "autoStopTimeoutId", null);
|
|
812
740
|
this.config = {
|
|
813
741
|
baseUrl: "http://localhost:8000",
|
|
814
742
|
provider: "groq",
|
|
@@ -816,14 +744,14 @@ class $e {
|
|
|
816
744
|
language: "en",
|
|
817
745
|
includeTimestamps: !1,
|
|
818
746
|
temperature: 0,
|
|
819
|
-
...
|
|
747
|
+
...r
|
|
820
748
|
};
|
|
821
749
|
}
|
|
822
750
|
/**
|
|
823
751
|
* Update STT configuration
|
|
824
752
|
*/
|
|
825
|
-
updateConfig(
|
|
826
|
-
this.config = { ...this.config, ...
|
|
753
|
+
updateConfig(r) {
|
|
754
|
+
this.config = { ...this.config, ...r };
|
|
827
755
|
}
|
|
828
756
|
/**
|
|
829
757
|
* Check if browser supports audio recording
|
|
@@ -834,16 +762,16 @@ class $e {
|
|
|
834
762
|
/**
|
|
835
763
|
* Start recording audio from user's microphone
|
|
836
764
|
*/
|
|
837
|
-
async startRecording(
|
|
838
|
-
var
|
|
765
|
+
async startRecording(r, e) {
|
|
766
|
+
var o;
|
|
839
767
|
if (!this.isRecordingSupported())
|
|
840
|
-
throw new
|
|
768
|
+
throw new v(
|
|
841
769
|
"Audio recording is not supported in this browser",
|
|
842
770
|
"RECORDING_NOT_SUPPORTED",
|
|
843
771
|
!1
|
|
844
772
|
);
|
|
845
773
|
if (this.isRecording())
|
|
846
|
-
throw new
|
|
774
|
+
throw new v(
|
|
847
775
|
"Recording is already in progress",
|
|
848
776
|
"ALREADY_RECORDING",
|
|
849
777
|
!0
|
|
@@ -860,34 +788,34 @@ class $e {
|
|
|
860
788
|
this.mediaRecorder = new MediaRecorder(this.recordingStream, {
|
|
861
789
|
mimeType: s
|
|
862
790
|
}), this.mediaRecorder.ondataavailable = (c) => {
|
|
863
|
-
var
|
|
864
|
-
c.data.size > 0 && (this.audioChunks.push(c.data), (
|
|
791
|
+
var a;
|
|
792
|
+
c.data.size > 0 && (this.audioChunks.push(c.data), (a = e == null ? void 0 : e.onDataAvailable) == null || a.call(e, c.data));
|
|
865
793
|
}, this.mediaRecorder.onstop = () => {
|
|
866
794
|
var c;
|
|
867
795
|
(c = e == null ? void 0 : e.onStop) == null || c.call(e);
|
|
868
796
|
}, this.mediaRecorder.onerror = (c) => {
|
|
869
|
-
var
|
|
870
|
-
const
|
|
797
|
+
var n;
|
|
798
|
+
const a = new v(
|
|
871
799
|
`Recording failed: ${c.error}`,
|
|
872
800
|
"RECORDING_ERROR",
|
|
873
801
|
!0
|
|
874
802
|
);
|
|
875
|
-
(
|
|
876
|
-
}, this.mediaRecorder.start(100), (
|
|
803
|
+
(n = e == null ? void 0 : e.onError) == null || n.call(e, a), this.cleanup();
|
|
804
|
+
}, this.mediaRecorder.start(100), (o = e == null ? void 0 : e.onStart) == null || o.call(e), r && r > 0 && (this.autoStopTimeoutId = setTimeout(() => {
|
|
877
805
|
this.isRecording() && this.stopRecording();
|
|
878
|
-
},
|
|
806
|
+
}, r * 1e3));
|
|
879
807
|
} catch (s) {
|
|
880
808
|
if (this.cleanup(), s instanceof Error) {
|
|
881
809
|
if (s.name === "NotAllowedError" || s.name === "PermissionDeniedError")
|
|
882
|
-
throw new
|
|
810
|
+
throw new v(
|
|
883
811
|
"Microphone permission was denied",
|
|
884
812
|
"PERMISSION_DENIED",
|
|
885
813
|
!1
|
|
886
814
|
);
|
|
887
815
|
if (s.name === "NotFoundError")
|
|
888
|
-
throw new
|
|
816
|
+
throw new v("No microphone found", "NO_MICROPHONE", !1);
|
|
889
817
|
}
|
|
890
|
-
throw new
|
|
818
|
+
throw new v(
|
|
891
819
|
`Failed to start recording: ${s instanceof Error ? s.message : String(s)}`,
|
|
892
820
|
"START_RECORDING_FAILED",
|
|
893
821
|
!0
|
|
@@ -899,25 +827,25 @@ class $e {
|
|
|
899
827
|
*/
|
|
900
828
|
async stopRecording() {
|
|
901
829
|
if (this.autoStopTimeoutId && (clearTimeout(this.autoStopTimeoutId), this.autoStopTimeoutId = null), !this.mediaRecorder || !this.isRecording())
|
|
902
|
-
throw new
|
|
830
|
+
throw new v(
|
|
903
831
|
"No active recording to stop",
|
|
904
832
|
"NO_ACTIVE_RECORDING",
|
|
905
833
|
!1
|
|
906
834
|
);
|
|
907
|
-
return new Promise((
|
|
835
|
+
return new Promise((r, e) => {
|
|
908
836
|
if (!this.mediaRecorder) {
|
|
909
837
|
e(
|
|
910
|
-
new
|
|
838
|
+
new v("MediaRecorder is null", "MEDIARECORDER_NULL", !1)
|
|
911
839
|
);
|
|
912
840
|
return;
|
|
913
841
|
}
|
|
914
|
-
const
|
|
842
|
+
const o = this.mediaRecorder, s = () => {
|
|
915
843
|
try {
|
|
916
|
-
const c =
|
|
917
|
-
this.cleanup(),
|
|
844
|
+
const c = o.mimeType || "audio/webm", a = new Blob(this.audioChunks, { type: c });
|
|
845
|
+
this.cleanup(), r(a);
|
|
918
846
|
} catch (c) {
|
|
919
847
|
e(
|
|
920
|
-
new
|
|
848
|
+
new v(
|
|
921
849
|
`Failed to create audio blob: ${c instanceof Error ? c.message : String(c)}`,
|
|
922
850
|
"BLOB_CREATION_FAILED",
|
|
923
851
|
!1
|
|
@@ -925,40 +853,43 @@ class $e {
|
|
|
925
853
|
);
|
|
926
854
|
}
|
|
927
855
|
};
|
|
928
|
-
|
|
856
|
+
o.addEventListener("stop", s, { once: !0 }), o.stop();
|
|
929
857
|
});
|
|
930
858
|
}
|
|
931
859
|
/**
|
|
932
860
|
* Transcribe audio blob using the STT API
|
|
933
861
|
*/
|
|
934
|
-
async transcribe(
|
|
862
|
+
async transcribe(r) {
|
|
935
863
|
const {
|
|
936
864
|
audioBlob: e,
|
|
937
|
-
model:
|
|
865
|
+
model: o = this.config.model,
|
|
938
866
|
language: s = this.config.language,
|
|
939
867
|
includeTimestamps: c = this.config.includeTimestamps,
|
|
940
|
-
temperature:
|
|
941
|
-
} =
|
|
868
|
+
temperature: a = this.config.temperature
|
|
869
|
+
} = r;
|
|
942
870
|
if (!e || e.size === 0)
|
|
943
|
-
throw new
|
|
871
|
+
throw new v(
|
|
944
872
|
"Audio blob is empty or invalid",
|
|
945
873
|
"INVALID_AUDIO",
|
|
946
874
|
!1
|
|
947
875
|
);
|
|
948
876
|
try {
|
|
949
|
-
const
|
|
877
|
+
const n = new FormData(), w = new File([e], "recording.wav", {
|
|
950
878
|
type: e.type || "audio/wav"
|
|
951
879
|
});
|
|
952
|
-
|
|
953
|
-
const
|
|
880
|
+
n.append("file", w), n.append("model", o || "whisper-large-v3-turbo"), n.append("language", s || "en"), n.append("include_timestamps", String(c || !1)), n.append("temperature", String(a || 0));
|
|
881
|
+
const m = await ae(
|
|
954
882
|
`${this.config.baseUrl}/speech/transcribe`,
|
|
955
883
|
{
|
|
956
884
|
method: "POST",
|
|
957
885
|
headers: {
|
|
958
886
|
accept: "application/json",
|
|
959
|
-
"X-STT-Provider": this.config.provider || "groq"
|
|
887
|
+
"X-STT-Provider": this.config.provider || "groq",
|
|
888
|
+
...this.config.authToken && {
|
|
889
|
+
Authorization: `Bearer ${this.config.authToken}`
|
|
890
|
+
}
|
|
960
891
|
},
|
|
961
|
-
body:
|
|
892
|
+
body: n
|
|
962
893
|
},
|
|
963
894
|
{
|
|
964
895
|
attempts: 1,
|
|
@@ -968,27 +899,27 @@ class $e {
|
|
|
968
899
|
jitter: !0
|
|
969
900
|
}
|
|
970
901
|
);
|
|
971
|
-
if (!
|
|
972
|
-
const
|
|
973
|
-
let
|
|
902
|
+
if (!m.ok) {
|
|
903
|
+
const h = await m.text();
|
|
904
|
+
let u = `STT request failed: ${m.status} ${m.statusText}`;
|
|
974
905
|
try {
|
|
975
|
-
const
|
|
976
|
-
|
|
906
|
+
const g = JSON.parse(h);
|
|
907
|
+
u = g.message || g.error || u;
|
|
977
908
|
} catch {
|
|
978
|
-
|
|
909
|
+
u = h || u;
|
|
979
910
|
}
|
|
980
|
-
throw new
|
|
981
|
-
|
|
982
|
-
`HTTP_${
|
|
983
|
-
|
|
911
|
+
throw new v(
|
|
912
|
+
u,
|
|
913
|
+
`HTTP_${m.status}`,
|
|
914
|
+
m.status >= 500
|
|
984
915
|
);
|
|
985
916
|
}
|
|
986
917
|
return {
|
|
987
|
-
transcript: (await
|
|
918
|
+
transcript: (await m.json()).data.text ?? ""
|
|
988
919
|
};
|
|
989
|
-
} catch (
|
|
990
|
-
throw
|
|
991
|
-
`Transcription failed: ${
|
|
920
|
+
} catch (n) {
|
|
921
|
+
throw n instanceof v ? n : new v(
|
|
922
|
+
`Transcription failed: ${n instanceof Error ? n.message : String(n)}`,
|
|
992
923
|
"TRANSCRIPTION_FAILED",
|
|
993
924
|
!0
|
|
994
925
|
);
|
|
@@ -1010,14 +941,14 @@ class $e {
|
|
|
1010
941
|
* Get supported MIME type for recording
|
|
1011
942
|
*/
|
|
1012
943
|
getSupportedMimeType() {
|
|
1013
|
-
const
|
|
944
|
+
const r = [
|
|
1014
945
|
"audio/webm",
|
|
1015
946
|
"audio/webm;codecs=opus",
|
|
1016
947
|
"audio/ogg;codecs=opus",
|
|
1017
948
|
"audio/mp4",
|
|
1018
949
|
"audio/wav"
|
|
1019
950
|
];
|
|
1020
|
-
for (const e of
|
|
951
|
+
for (const e of r)
|
|
1021
952
|
if (MediaRecorder.isTypeSupported(e))
|
|
1022
953
|
return e;
|
|
1023
954
|
return "audio/webm";
|
|
@@ -1026,122 +957,125 @@ class $e {
|
|
|
1026
957
|
* Clean up recording resources
|
|
1027
958
|
*/
|
|
1028
959
|
cleanup() {
|
|
1029
|
-
this.recordingStream && (this.recordingStream.getTracks().forEach((
|
|
960
|
+
this.recordingStream && (this.recordingStream.getTracks().forEach((r) => r.stop()), this.recordingStream = null), this.mediaRecorder = null, this.audioChunks = [], this.autoStopTimeoutId && (clearTimeout(this.autoStopTimeoutId), this.autoStopTimeoutId = null);
|
|
1030
961
|
}
|
|
1031
962
|
}
|
|
1032
|
-
const
|
|
1033
|
-
const [
|
|
1034
|
-
i.config &&
|
|
1035
|
-
const
|
|
1036
|
-
var
|
|
963
|
+
const Q = new He(), Ye = (i = {}) => {
|
|
964
|
+
const [r, e] = T(!1), [o, s] = T(!1), [c, a] = T(null), [n, w] = T(null), [m, d] = T(null);
|
|
965
|
+
i.config && Q.updateConfig(i.config);
|
|
966
|
+
const h = A(async (k) => {
|
|
967
|
+
var j;
|
|
1037
968
|
try {
|
|
1038
|
-
|
|
969
|
+
w(null), a(null), d(null), await Q.startRecording(k, {
|
|
1039
970
|
onStart: () => {
|
|
1040
|
-
var
|
|
1041
|
-
e(!0), (
|
|
971
|
+
var l;
|
|
972
|
+
e(!0), (l = i.onStart) == null || l.call(i);
|
|
1042
973
|
},
|
|
1043
974
|
onStop: () => {
|
|
1044
|
-
var
|
|
1045
|
-
e(!1), (
|
|
975
|
+
var l;
|
|
976
|
+
e(!1), (l = i.onStop) == null || l.call(i);
|
|
1046
977
|
},
|
|
1047
|
-
onError: (
|
|
1048
|
-
var
|
|
1049
|
-
const p =
|
|
1050
|
-
|
|
978
|
+
onError: (l) => {
|
|
979
|
+
var I;
|
|
980
|
+
const p = l instanceof v ? l : new v(l.message, "RECORDING_ERROR", !0);
|
|
981
|
+
w(p), e(!1), (I = i.onError) == null || I.call(i, p);
|
|
1051
982
|
}
|
|
1052
983
|
});
|
|
1053
|
-
} catch (
|
|
1054
|
-
const p =
|
|
1055
|
-
|
|
984
|
+
} catch (l) {
|
|
985
|
+
const p = l instanceof v ? l : new v(
|
|
986
|
+
l instanceof Error ? l.message : String(l),
|
|
1056
987
|
"START_FAILED",
|
|
1057
988
|
!1
|
|
1058
989
|
);
|
|
1059
|
-
throw
|
|
990
|
+
throw w(p), e(!1), (j = i.onError) == null || j.call(i, p), p;
|
|
1060
991
|
}
|
|
1061
|
-
}, []),
|
|
1062
|
-
var
|
|
992
|
+
}, []), u = A(async () => {
|
|
993
|
+
var k, j;
|
|
1063
994
|
try {
|
|
1064
|
-
const
|
|
1065
|
-
return d(
|
|
1066
|
-
} catch (
|
|
1067
|
-
const p =
|
|
1068
|
-
|
|
995
|
+
const l = await Q.stopRecording();
|
|
996
|
+
return d(l), e(!1), (k = i.onStop) == null || k.call(i), l;
|
|
997
|
+
} catch (l) {
|
|
998
|
+
const p = l instanceof v ? l : new v(
|
|
999
|
+
l instanceof Error ? l.message : String(l),
|
|
1069
1000
|
"STOP_FAILED",
|
|
1070
1001
|
!1
|
|
1071
1002
|
);
|
|
1072
|
-
throw
|
|
1003
|
+
throw w(p), e(!1), (j = i.onError) == null || j.call(i, p), p;
|
|
1073
1004
|
}
|
|
1074
|
-
}, []),
|
|
1075
|
-
async (
|
|
1076
|
-
var
|
|
1005
|
+
}, []), g = A(
|
|
1006
|
+
async (k, j = {}) => {
|
|
1007
|
+
var l, p;
|
|
1077
1008
|
try {
|
|
1078
|
-
|
|
1079
|
-
const
|
|
1080
|
-
audioBlob:
|
|
1081
|
-
...
|
|
1082
|
-
},
|
|
1083
|
-
return
|
|
1084
|
-
} catch (
|
|
1085
|
-
const
|
|
1086
|
-
|
|
1009
|
+
w(null), s(!0);
|
|
1010
|
+
const I = {
|
|
1011
|
+
audioBlob: k,
|
|
1012
|
+
...j
|
|
1013
|
+
}, b = await Q.transcribe(I);
|
|
1014
|
+
return a(b.transcript), s(!1), (l = i.onTranscriptionComplete) == null || l.call(i, b), b;
|
|
1015
|
+
} catch (I) {
|
|
1016
|
+
const b = I instanceof v ? I : new v(
|
|
1017
|
+
I instanceof Error ? I.message : String(I),
|
|
1087
1018
|
"TRANSCRIPTION_FAILED",
|
|
1088
1019
|
!0
|
|
1089
1020
|
);
|
|
1090
|
-
throw
|
|
1021
|
+
throw w(b), s(!1), (p = i.onError) == null || p.call(i, b), b;
|
|
1091
1022
|
}
|
|
1092
1023
|
},
|
|
1093
1024
|
[]
|
|
1094
|
-
),
|
|
1095
|
-
|
|
1025
|
+
), y = A(() => {
|
|
1026
|
+
Q.cancelRecording(), e(!1), d(null);
|
|
1096
1027
|
}, []);
|
|
1097
1028
|
return {
|
|
1098
|
-
startRecording:
|
|
1099
|
-
stopRecording:
|
|
1100
|
-
transcribe:
|
|
1101
|
-
cancelRecording:
|
|
1102
|
-
isRecording:
|
|
1103
|
-
isTranscribing:
|
|
1029
|
+
startRecording: h,
|
|
1030
|
+
stopRecording: u,
|
|
1031
|
+
transcribe: g,
|
|
1032
|
+
cancelRecording: y,
|
|
1033
|
+
isRecording: r,
|
|
1034
|
+
isTranscribing: o,
|
|
1104
1035
|
transcript: c,
|
|
1105
|
-
error:
|
|
1106
|
-
audioBlob:
|
|
1036
|
+
error: n,
|
|
1037
|
+
audioBlob: m
|
|
1107
1038
|
};
|
|
1108
1039
|
};
|
|
1109
|
-
class
|
|
1110
|
-
constructor(
|
|
1111
|
-
|
|
1112
|
-
|
|
1040
|
+
class Ve {
|
|
1041
|
+
constructor(r = {}) {
|
|
1042
|
+
D(this, "config");
|
|
1043
|
+
D(this, "currentAudio", null);
|
|
1113
1044
|
this.config = {
|
|
1114
1045
|
baseUrl: "http://localhost:8000",
|
|
1115
1046
|
provider: "piper",
|
|
1116
1047
|
voice: "string",
|
|
1117
1048
|
speed: 1,
|
|
1118
|
-
...
|
|
1049
|
+
...r
|
|
1119
1050
|
};
|
|
1120
1051
|
}
|
|
1121
1052
|
/**
|
|
1122
1053
|
* Update TTS configuration
|
|
1123
1054
|
*/
|
|
1124
|
-
updateConfig(
|
|
1125
|
-
this.config = { ...this.config, ...
|
|
1055
|
+
updateConfig(r) {
|
|
1056
|
+
this.config = { ...this.config, ...r };
|
|
1126
1057
|
}
|
|
1127
1058
|
/**
|
|
1128
1059
|
* Get TTS audio from the API and return as blob
|
|
1129
1060
|
*/
|
|
1130
|
-
async synthesizeSpeech(
|
|
1061
|
+
async synthesizeSpeech(r) {
|
|
1131
1062
|
const {
|
|
1132
1063
|
text: e,
|
|
1133
|
-
voice:
|
|
1064
|
+
voice: o = this.config.voice,
|
|
1134
1065
|
speed: s = this.config.speed
|
|
1135
|
-
} =
|
|
1136
|
-
c.append("text", e), c.append("voice",
|
|
1137
|
-
const
|
|
1066
|
+
} = r, c = new URLSearchParams();
|
|
1067
|
+
c.append("text", e), c.append("voice", o || "string"), c.append("speed", (s == null ? void 0 : s.toString()) || "1");
|
|
1068
|
+
const a = await ae(
|
|
1138
1069
|
`${this.config.baseUrl}/speech/synthesize`,
|
|
1139
1070
|
{
|
|
1140
1071
|
method: "POST",
|
|
1141
1072
|
headers: {
|
|
1142
1073
|
accept: "application/json",
|
|
1143
1074
|
"X-TTS-Provider": this.config.provider || "piper",
|
|
1144
|
-
"Content-Type": "application/x-www-form-urlencoded"
|
|
1075
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
|
1076
|
+
...this.config.authToken && {
|
|
1077
|
+
Authorization: `Bearer ${this.config.authToken}`
|
|
1078
|
+
}
|
|
1145
1079
|
},
|
|
1146
1080
|
body: c
|
|
1147
1081
|
},
|
|
@@ -1153,16 +1087,16 @@ class Le {
|
|
|
1153
1087
|
jitter: !1
|
|
1154
1088
|
}
|
|
1155
1089
|
);
|
|
1156
|
-
if (!
|
|
1090
|
+
if (!a.ok)
|
|
1157
1091
|
throw new Error(
|
|
1158
|
-
`TTS request failed: ${
|
|
1092
|
+
`TTS request failed: ${a.status} ${a.statusText}`
|
|
1159
1093
|
);
|
|
1160
|
-
const
|
|
1161
|
-
if (
|
|
1162
|
-
return
|
|
1094
|
+
const n = a.headers.get("content-type");
|
|
1095
|
+
if (n && n.includes("audio/"))
|
|
1096
|
+
return a.blob();
|
|
1163
1097
|
try {
|
|
1164
|
-
const
|
|
1165
|
-
throw new Error(`TTS Error: ${JSON.stringify(
|
|
1098
|
+
const w = await a.json();
|
|
1099
|
+
throw new Error(`TTS Error: ${JSON.stringify(w)}`);
|
|
1166
1100
|
} catch {
|
|
1167
1101
|
throw new Error("TTS request failed with unknown error");
|
|
1168
1102
|
}
|
|
@@ -1170,35 +1104,35 @@ class Le {
|
|
|
1170
1104
|
/**
|
|
1171
1105
|
* Speak text and return a promise that resolves when playback completes
|
|
1172
1106
|
*/
|
|
1173
|
-
async speak(
|
|
1174
|
-
var
|
|
1107
|
+
async speak(r, e) {
|
|
1108
|
+
var o, s;
|
|
1175
1109
|
try {
|
|
1176
|
-
this.stop(), (
|
|
1177
|
-
const c = await this.synthesizeSpeech(
|
|
1178
|
-
return this.currentAudio = new Audio(
|
|
1110
|
+
this.stop(), (o = e == null ? void 0 : e.onStart) == null || o.call(e);
|
|
1111
|
+
const c = await this.synthesizeSpeech(r), a = URL.createObjectURL(c);
|
|
1112
|
+
return this.currentAudio = new Audio(a), new Promise((n, w) => {
|
|
1179
1113
|
if (!this.currentAudio) {
|
|
1180
|
-
|
|
1114
|
+
w(new Error("Audio element not created"));
|
|
1181
1115
|
return;
|
|
1182
1116
|
}
|
|
1183
|
-
const
|
|
1184
|
-
|
|
1117
|
+
const m = this.currentAudio;
|
|
1118
|
+
m.onended = () => {
|
|
1185
1119
|
var d;
|
|
1186
|
-
URL.revokeObjectURL(
|
|
1187
|
-
},
|
|
1188
|
-
var
|
|
1189
|
-
URL.revokeObjectURL(
|
|
1190
|
-
const
|
|
1191
|
-
(
|
|
1192
|
-
},
|
|
1193
|
-
var
|
|
1194
|
-
URL.revokeObjectURL(
|
|
1195
|
-
const
|
|
1196
|
-
(
|
|
1120
|
+
URL.revokeObjectURL(a), this.currentAudio = null, (d = e == null ? void 0 : e.onEnd) == null || d.call(e), n();
|
|
1121
|
+
}, m.onerror = (d) => {
|
|
1122
|
+
var u;
|
|
1123
|
+
URL.revokeObjectURL(a), this.currentAudio = null;
|
|
1124
|
+
const h = new Error(`Audio playback failed: ${d}`);
|
|
1125
|
+
(u = e == null ? void 0 : e.onError) == null || u.call(e, h), w(h);
|
|
1126
|
+
}, m.play().catch((d) => {
|
|
1127
|
+
var u;
|
|
1128
|
+
URL.revokeObjectURL(a), this.currentAudio = null;
|
|
1129
|
+
const h = new Error(`Failed to play audio: ${d.message}`);
|
|
1130
|
+
(u = e == null ? void 0 : e.onError) == null || u.call(e, h), w(h);
|
|
1197
1131
|
});
|
|
1198
1132
|
});
|
|
1199
1133
|
} catch (c) {
|
|
1200
|
-
const
|
|
1201
|
-
throw (s = e == null ? void 0 : e.onError) == null || s.call(e,
|
|
1134
|
+
const a = c instanceof Error ? c : new Error(`TTS Error: ${String(c)}`);
|
|
1135
|
+
throw (s = e == null ? void 0 : e.onError) == null || s.call(e, a), a;
|
|
1202
1136
|
}
|
|
1203
1137
|
}
|
|
1204
1138
|
/**
|
|
@@ -1214,661 +1148,1153 @@ class Le {
|
|
|
1214
1148
|
return this.currentAudio !== null && !this.currentAudio.paused;
|
|
1215
1149
|
}
|
|
1216
1150
|
}
|
|
1217
|
-
const
|
|
1218
|
-
const [
|
|
1219
|
-
i.config &&
|
|
1220
|
-
const
|
|
1221
|
-
async (
|
|
1222
|
-
var
|
|
1151
|
+
const ie = new Ve(), Je = (i = {}) => {
|
|
1152
|
+
const [r, e] = T(!1), [o, s] = T(!1), [c, a] = T(null);
|
|
1153
|
+
i.config && ie.updateConfig(i.config);
|
|
1154
|
+
const n = A(
|
|
1155
|
+
async (m, d = {}) => {
|
|
1156
|
+
var h;
|
|
1223
1157
|
try {
|
|
1224
|
-
|
|
1225
|
-
const
|
|
1226
|
-
text:
|
|
1158
|
+
a(null), s(!0);
|
|
1159
|
+
const u = {
|
|
1160
|
+
text: m,
|
|
1227
1161
|
...d
|
|
1228
1162
|
};
|
|
1229
|
-
await
|
|
1163
|
+
await ie.speak(u, {
|
|
1230
1164
|
onStart: () => {
|
|
1231
|
-
var
|
|
1232
|
-
s(!1), e(!0), (
|
|
1165
|
+
var g;
|
|
1166
|
+
s(!1), e(!0), (g = i.onStart) == null || g.call(i);
|
|
1233
1167
|
},
|
|
1234
1168
|
onEnd: () => {
|
|
1235
|
-
var
|
|
1236
|
-
e(!1), (
|
|
1169
|
+
var g;
|
|
1170
|
+
e(!1), (g = i.onEnd) == null || g.call(i);
|
|
1237
1171
|
},
|
|
1238
|
-
onError: (
|
|
1239
|
-
var
|
|
1240
|
-
e(!1), s(!1),
|
|
1172
|
+
onError: (g) => {
|
|
1173
|
+
var y;
|
|
1174
|
+
e(!1), s(!1), a(g), (y = i.onError) == null || y.call(i, g);
|
|
1241
1175
|
}
|
|
1242
1176
|
});
|
|
1243
|
-
} catch (
|
|
1244
|
-
const
|
|
1245
|
-
throw
|
|
1177
|
+
} catch (u) {
|
|
1178
|
+
const g = u instanceof Error ? u : new Error(String(u));
|
|
1179
|
+
throw a(g), e(!1), s(!1), (h = i.onError) == null || h.call(i, g), g;
|
|
1246
1180
|
}
|
|
1247
1181
|
},
|
|
1248
1182
|
[i]
|
|
1249
|
-
),
|
|
1250
|
-
|
|
1183
|
+
), w = A(() => {
|
|
1184
|
+
ie.stop(), e(!1), s(!1);
|
|
1251
1185
|
}, []);
|
|
1252
1186
|
return {
|
|
1253
|
-
speak:
|
|
1254
|
-
stop:
|
|
1255
|
-
isPlaying:
|
|
1256
|
-
isLoading:
|
|
1187
|
+
speak: n,
|
|
1188
|
+
stop: w,
|
|
1189
|
+
isPlaying: r,
|
|
1190
|
+
isLoading: o,
|
|
1257
1191
|
error: c
|
|
1258
1192
|
};
|
|
1259
|
-
}
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
}
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
[l.READING_QUESTION]: "iw-bg-indigo-100 iw-text-indigo-800",
|
|
1323
|
-
[l.THINKING]: "iw-bg-yellow-100 iw-text-yellow-800",
|
|
1324
|
-
[l.ANSWERING]: "iw-bg-red-100 iw-text-red-800",
|
|
1325
|
-
[l.TRANSCRIBING]: "iw-bg-purple-100 iw-text-purple-800",
|
|
1326
|
-
[l.EDITING]: "iw-bg-orange-100 iw-text-orange-800",
|
|
1327
|
-
[l.SUBMITTING]: "iw-bg-green-100 iw-text-green-800",
|
|
1328
|
-
[l.COMPLETED]: "iw-bg-green-200 iw-text-green-900"
|
|
1329
|
-
})[d] || "iw-bg-gray-100 iw-text-gray-800", o = (d) => ({
|
|
1330
|
-
[l.IDLE]: "Ready to start next question.",
|
|
1331
|
-
[l.FETCHING_QUESTION]: "Please wait while we load the next question...",
|
|
1332
|
-
[l.READING_QUESTION]: "Listening to the question...",
|
|
1333
|
-
[l.THINKING]: "Take time to think about your answer.",
|
|
1334
|
-
[l.ANSWERING]: "Speak clearly into your microphone.",
|
|
1335
|
-
[l.TRANSCRIBING]: "Converting your speech to text...",
|
|
1336
|
-
[l.EDITING]: "Review and edit your answer.",
|
|
1337
|
-
[l.SUBMITTING]: "Submitting your answer...",
|
|
1338
|
-
[l.COMPLETED]: "Thank you for completing the interview!"
|
|
1339
|
-
})[d] || "";
|
|
1340
|
-
function m(d) {
|
|
1341
|
-
return {
|
|
1342
|
-
[l.THINKING]: e.thinking || 30,
|
|
1343
|
-
[l.ANSWERING]: e.answering || 120,
|
|
1344
|
-
[l.EDITING]: e.editing || 30
|
|
1345
|
-
}[d] || 1;
|
|
1193
|
+
}, Xe = ({ className: i = "" }) => {
|
|
1194
|
+
const r = S(null);
|
|
1195
|
+
return P(() => {
|
|
1196
|
+
let e = null;
|
|
1197
|
+
return (async () => {
|
|
1198
|
+
try {
|
|
1199
|
+
e = await navigator.mediaDevices.getUserMedia({
|
|
1200
|
+
video: !0,
|
|
1201
|
+
audio: !1
|
|
1202
|
+
}), r.current && (r.current.srcObject = e);
|
|
1203
|
+
} catch (s) {
|
|
1204
|
+
console.error("Error accessing camera:", s);
|
|
1205
|
+
}
|
|
1206
|
+
})(), () => {
|
|
1207
|
+
e && e.getTracks().forEach((s) => s.stop());
|
|
1208
|
+
};
|
|
1209
|
+
}, []), /* @__PURE__ */ t.jsx("div", { className: `iw-relative ${i}`, children: /* @__PURE__ */ t.jsx(
|
|
1210
|
+
"video",
|
|
1211
|
+
{
|
|
1212
|
+
ref: r,
|
|
1213
|
+
autoPlay: !0,
|
|
1214
|
+
playsInline: !0,
|
|
1215
|
+
muted: !0,
|
|
1216
|
+
className: "iw-w-full iw-h-full iw-object-cover iw-scale-75 iw-rounded-md iw-min-h-[400px] iw-max-h-[600px] iw-aspect-video",
|
|
1217
|
+
style: {
|
|
1218
|
+
transform: "scaleX(-1)"
|
|
1219
|
+
}
|
|
1220
|
+
}
|
|
1221
|
+
) });
|
|
1222
|
+
}, Z = (i) => {
|
|
1223
|
+
const { baseColor: r, borderRadius: e } = W(), { loading: o, children: s, ...c } = i;
|
|
1224
|
+
return /* @__PURE__ */ t.jsx(
|
|
1225
|
+
se,
|
|
1226
|
+
{
|
|
1227
|
+
style: {
|
|
1228
|
+
background: ge(r),
|
|
1229
|
+
borderRadius: e
|
|
1230
|
+
},
|
|
1231
|
+
...c,
|
|
1232
|
+
children: o ? /* @__PURE__ */ t.jsx(he, {}) : s
|
|
1233
|
+
}
|
|
1234
|
+
);
|
|
1235
|
+
}, ne = (i) => /* @__PURE__ */ t.jsxs(
|
|
1236
|
+
"svg",
|
|
1237
|
+
{
|
|
1238
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1239
|
+
width: "24",
|
|
1240
|
+
height: "24",
|
|
1241
|
+
viewBox: "0 0 24 24",
|
|
1242
|
+
fill: "none",
|
|
1243
|
+
stroke: "currentColor",
|
|
1244
|
+
strokeWidth: "2",
|
|
1245
|
+
strokeLinecap: "round",
|
|
1246
|
+
strokeLinejoin: "round",
|
|
1247
|
+
...i,
|
|
1248
|
+
children: [
|
|
1249
|
+
/* @__PURE__ */ t.jsx("path", { d: "M12 2a10 10 0 0 1 7.38 16.75" }),
|
|
1250
|
+
/* @__PURE__ */ t.jsx("path", { d: "M12 6v6l4 2" }),
|
|
1251
|
+
/* @__PURE__ */ t.jsx("path", { d: "M2.5 8.875a10 10 0 0 0-.5 3" }),
|
|
1252
|
+
/* @__PURE__ */ t.jsx("path", { d: "M2.83 16a10 10 0 0 0 2.43 3.4" }),
|
|
1253
|
+
/* @__PURE__ */ t.jsx("path", { d: "M4.636 5.235a10 10 0 0 1 .891-.857" }),
|
|
1254
|
+
/* @__PURE__ */ t.jsx("path", { d: "M8.644 21.42a10 10 0 0 0 7.631-.38" })
|
|
1255
|
+
]
|
|
1346
1256
|
}
|
|
1347
|
-
|
|
1348
|
-
|
|
1257
|
+
), Ze = (i, r, e) => Math.max(r, Math.min(e, i)), le = (i) => {
|
|
1258
|
+
const r = Math.max(0, Math.floor(i)), e = Math.floor(r / 60).toString().padStart(2, "0"), o = (r % 60).toString().padStart(2, "0");
|
|
1259
|
+
return `${e}:${o}`;
|
|
1260
|
+
}, oe = ({
|
|
1261
|
+
total: i,
|
|
1262
|
+
remaining: r,
|
|
1263
|
+
size: e = 64,
|
|
1264
|
+
strokeWidth: o = 6,
|
|
1265
|
+
className: s = "",
|
|
1266
|
+
showLabel: c = !0
|
|
1267
|
+
}) => {
|
|
1268
|
+
const a = Math.max(1, i || 1), n = Ze(r / a, 0, 1), { radius: w, circumference: m, dashOffset: d, center: h } = V(() => {
|
|
1269
|
+
const y = (e - o) / 2, k = 2 * Math.PI * y, j = k * (1 - n), l = Math.round(o) % 2 === 1, p = e / 2 + (l ? 0.5 : 0);
|
|
1270
|
+
return { radius: y, circumference: k, dashOffset: j, center: p };
|
|
1271
|
+
}, [e, o, n]), u = V(() => n <= 0.25 ? "iw-stroke-red-500" : n <= 0.5 ? "iw-stroke-yellow-500" : "iw-stroke-green-500", [n]), g = n <= 0.25 ? "iw-animate-pulse" : "";
|
|
1272
|
+
return /* @__PURE__ */ t.jsxs(
|
|
1349
1273
|
"div",
|
|
1350
1274
|
{
|
|
1351
|
-
className: `iw-iw-
|
|
1275
|
+
className: `iw-relative iw-inline-flex iw-items-center iw-justify-center iw-rounded-full iw-bg-white ${s}`,
|
|
1276
|
+
style: { width: e, height: e },
|
|
1277
|
+
"aria-label": `Time remaining ${le(r)}`,
|
|
1278
|
+
role: "timer",
|
|
1279
|
+
"aria-live": "polite",
|
|
1352
1280
|
children: [
|
|
1353
|
-
/* @__PURE__ */
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1281
|
+
/* @__PURE__ */ t.jsx(
|
|
1282
|
+
"svg",
|
|
1283
|
+
{
|
|
1284
|
+
width: e,
|
|
1285
|
+
height: e,
|
|
1286
|
+
viewBox: `0 0 ${e} ${e}`,
|
|
1287
|
+
preserveAspectRatio: "xMidYMid meet",
|
|
1288
|
+
children: /* @__PURE__ */ t.jsxs("g", { transform: `rotate(-90 ${h} ${h})`, children: [
|
|
1289
|
+
/* @__PURE__ */ t.jsx(
|
|
1290
|
+
"circle",
|
|
1361
1291
|
{
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1292
|
+
cx: h,
|
|
1293
|
+
cy: h,
|
|
1294
|
+
r: w,
|
|
1295
|
+
className: "iw-stroke-gray-200",
|
|
1296
|
+
strokeWidth: o,
|
|
1297
|
+
fill: "none",
|
|
1298
|
+
shapeRendering: "geometricPrecision",
|
|
1299
|
+
vectorEffect: "non-scaling-stroke"
|
|
1300
|
+
}
|
|
1301
|
+
),
|
|
1302
|
+
/* @__PURE__ */ t.jsx(
|
|
1303
|
+
"circle",
|
|
1304
|
+
{
|
|
1305
|
+
cx: h,
|
|
1306
|
+
cy: h,
|
|
1307
|
+
r: w,
|
|
1308
|
+
className: `${u} ${g}`,
|
|
1309
|
+
strokeWidth: o,
|
|
1310
|
+
strokeLinecap: "round",
|
|
1311
|
+
fill: "none",
|
|
1312
|
+
strokeDasharray: m,
|
|
1313
|
+
strokeDashoffset: d,
|
|
1314
|
+
shapeRendering: "geometricPrecision",
|
|
1315
|
+
vectorEffect: "non-scaling-stroke",
|
|
1316
|
+
style: {
|
|
1317
|
+
transition: "stroke-dashoffset 0.3s ease, stroke 0.2s ease"
|
|
1318
|
+
}
|
|
1366
1319
|
}
|
|
1367
1320
|
)
|
|
1368
|
-
] }),
|
|
1369
|
-
/* @__PURE__ */ r.jsxs("p", { className: "iw-text-xs iw-text-gray-700 iw-font-mono", children: [
|
|
1370
|
-
"Question ",
|
|
1371
|
-
i.currentQuestionNumber
|
|
1372
1321
|
] })
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
] })
|
|
1378
|
-
] }),
|
|
1379
|
-
/* @__PURE__ */ r.jsx("div", { className: "iw-mb-4", children: /* @__PURE__ */ r.jsx("div", { className: "iw-w-full iw-h-2 iw-iw-bg-gray-200 iw-rounded-full iw-overflow-hidden", children: /* @__PURE__ */ r.jsx(
|
|
1380
|
-
"div",
|
|
1322
|
+
}
|
|
1323
|
+
),
|
|
1324
|
+
c && /* @__PURE__ */ t.jsx("div", { className: "iw-absolute iw-inset-0 iw-flex iw-items-center iw-justify-center iw-rotate-0", children: /* @__PURE__ */ t.jsx(
|
|
1325
|
+
"span",
|
|
1381
1326
|
{
|
|
1382
|
-
className:
|
|
1383
|
-
|
|
1384
|
-
width: `${i.totalTimeElapsed / (i.totalTimeElapsed + i.totalTimeRemaining) * 100}%`
|
|
1385
|
-
}
|
|
1327
|
+
className: `iw-text-[11px] iw-font-semibold iw-tabular-nums ${n <= 0.25 ? "iw-text-red-600" : n <= 0.5 ? "iw-text-yellow-600" : "iw-text-green-600"}`,
|
|
1328
|
+
children: le(r)
|
|
1386
1329
|
}
|
|
1387
|
-
) })
|
|
1388
|
-
/* @__PURE__ */ r.jsxs("div", { className: "iw-mb-4", children: [
|
|
1389
|
-
/* @__PURE__ */ r.jsxs("div", { className: "iw-flex iw-items-center iw-justify-between iw-mb-2", children: [
|
|
1390
|
-
/* @__PURE__ */ r.jsxs("div", { className: "iw-flex iw-items-center iw-space-x-2", children: [
|
|
1391
|
-
/* @__PURE__ */ r.jsx(
|
|
1392
|
-
"div",
|
|
1393
|
-
{
|
|
1394
|
-
className: `iw-w-3 iw-h-3 iw-rounded-full ${c(
|
|
1395
|
-
i.phase
|
|
1396
|
-
)} ${g ? "iw-animate-pulse" : ""}`
|
|
1397
|
-
}
|
|
1398
|
-
),
|
|
1399
|
-
/* @__PURE__ */ r.jsx("span", { className: "iw-text-sm iw-font-medium iw-text-gray-700", children: s(i.phase) })
|
|
1400
|
-
] }),
|
|
1401
|
-
g && /* @__PURE__ */ r.jsx("span", { className: "iw-text-lg iw-font-bold iw-text-gray-900", children: a(i.currentPhaseTimeRemaining) })
|
|
1402
|
-
] }),
|
|
1403
|
-
g && /* @__PURE__ */ r.jsx("div", { className: "iw-w-full iw-h-1.5 iw-iw-bg-gray-200 iw-rounded-full iw-overflow-hidden", children: /* @__PURE__ */ r.jsx(
|
|
1404
|
-
"div",
|
|
1405
|
-
{
|
|
1406
|
-
className: `iw-h-full ${c(
|
|
1407
|
-
i.phase
|
|
1408
|
-
)} iw-transition-all iw-duration-300`,
|
|
1409
|
-
style: {
|
|
1410
|
-
width: `${i.currentPhaseTimeRemaining / m(i.phase) * 100}%`
|
|
1411
|
-
}
|
|
1412
|
-
}
|
|
1413
|
-
) })
|
|
1414
|
-
] }),
|
|
1415
|
-
/* @__PURE__ */ r.jsx("div", { className: "iw-mt-3 iw-pt-3 iw-border-t iw-border-gray-200", children: /* @__PURE__ */ r.jsx("p", { className: "iw-text-xs iw-text-gray-600", children: o(i.phase) }) })
|
|
1330
|
+
) })
|
|
1416
1331
|
]
|
|
1417
1332
|
}
|
|
1418
1333
|
);
|
|
1419
|
-
},
|
|
1334
|
+
}, Ke = ({
|
|
1420
1335
|
label: i,
|
|
1421
|
-
error:
|
|
1336
|
+
error: r,
|
|
1422
1337
|
fullWidth: e = !1,
|
|
1423
|
-
className:
|
|
1338
|
+
className: o = "",
|
|
1424
1339
|
id: s,
|
|
1425
1340
|
...c
|
|
1426
1341
|
}) => {
|
|
1427
|
-
const
|
|
1428
|
-
return /* @__PURE__ */
|
|
1342
|
+
const a = s || `textarea-${Math.random().toString(36).substring(2, 9)}`, n = "iw-block iw-rounded-md iw-border iw-border-gray-300 iw-shadow-sm iw-px-4 iw-py-2 iw-text-sm iw-transition-all", w = r ? "iw-border-red-500 iw-focus:border-red-500 iw-focus:ring-red-500" : "", m = e ? "iw-w-full" : "", d = o.includes("iw-h-full") || e ? "iw-h-full" : "";
|
|
1343
|
+
return /* @__PURE__ */ t.jsxs(
|
|
1429
1344
|
"div",
|
|
1430
1345
|
{
|
|
1431
|
-
className:
|
|
1346
|
+
className: `iw-h-full iw-flex iw-flex-col ${e ? "iw-w-full" : ""}`,
|
|
1432
1347
|
children: [
|
|
1433
|
-
i && /* @__PURE__ */
|
|
1348
|
+
i && /* @__PURE__ */ t.jsx(
|
|
1434
1349
|
"label",
|
|
1435
1350
|
{
|
|
1436
|
-
htmlFor:
|
|
1351
|
+
htmlFor: a,
|
|
1437
1352
|
className: "iw-block iw-text-sm iw-font-medium iw-text-gray-700 iw-mb-1",
|
|
1438
1353
|
children: i
|
|
1439
1354
|
}
|
|
1440
1355
|
),
|
|
1441
|
-
/* @__PURE__ */
|
|
1356
|
+
/* @__PURE__ */ t.jsx(
|
|
1442
1357
|
"textarea",
|
|
1443
1358
|
{
|
|
1444
|
-
id:
|
|
1445
|
-
className: `${
|
|
1446
|
-
"aria-invalid":
|
|
1359
|
+
id: a,
|
|
1360
|
+
className: `${n} ${w} ${m} ${d} ${o}`,
|
|
1361
|
+
"aria-invalid": r ? "true" : "false",
|
|
1447
1362
|
...c
|
|
1448
1363
|
}
|
|
1449
1364
|
),
|
|
1450
|
-
|
|
1365
|
+
r && /* @__PURE__ */ t.jsx("p", { className: "iw-mt-1 iw-text-sm iw-text-red-600", children: r })
|
|
1451
1366
|
]
|
|
1452
1367
|
}
|
|
1453
1368
|
);
|
|
1454
|
-
},
|
|
1369
|
+
}, et = ({
|
|
1455
1370
|
value: i,
|
|
1456
|
-
onChange:
|
|
1371
|
+
onChange: r,
|
|
1457
1372
|
onSubmit: e,
|
|
1458
|
-
isSubmitDisabled:
|
|
1459
|
-
|
|
1373
|
+
isSubmitDisabled: o,
|
|
1374
|
+
state: s,
|
|
1375
|
+
editingTime: c
|
|
1460
1376
|
}) => {
|
|
1461
|
-
const
|
|
1462
|
-
n.key === "Enter" && (n.ctrlKey || n.metaKey) && !
|
|
1377
|
+
const a = (n) => {
|
|
1378
|
+
n.key === "Enter" && (n.ctrlKey || n.metaKey) && !o && (n.preventDefault(), e());
|
|
1463
1379
|
};
|
|
1464
|
-
return /* @__PURE__ */
|
|
1465
|
-
/* @__PURE__ */
|
|
1466
|
-
/* @__PURE__ */
|
|
1467
|
-
|
|
1380
|
+
return /* @__PURE__ */ t.jsxs("div", { className: "iw-flex iw-flex-col iw-h-full ", children: [
|
|
1381
|
+
/* @__PURE__ */ t.jsxs("div", { className: "iw-flex iw-items-center iw-justify-between", children: [
|
|
1382
|
+
/* @__PURE__ */ t.jsx("h3", { className: "iw-text-lg iw-font-semibold iw-text-gray-900 iw-mb-1", children: "Your Answer" }),
|
|
1383
|
+
/* @__PURE__ */ t.jsxs("div", { className: "iw-flex iw-items-center iw-justify-center iw-gap-2", children: [
|
|
1384
|
+
/* @__PURE__ */ t.jsxs("div", { className: "iw-flex iw-items-center iw-gap-1", children: [
|
|
1385
|
+
/* @__PURE__ */ t.jsx(ne, { className: "iw-size-4 iw-text-orange-600" }),
|
|
1386
|
+
/* @__PURE__ */ t.jsx("p", { className: "iw-text-gray-700 iw-text-sm", children: "Time to edit: " })
|
|
1387
|
+
] }),
|
|
1388
|
+
/* @__PURE__ */ t.jsx(
|
|
1389
|
+
oe,
|
|
1390
|
+
{
|
|
1391
|
+
total: c,
|
|
1392
|
+
remaining: s.currentPhaseTimeRemaining,
|
|
1393
|
+
size: 50,
|
|
1394
|
+
strokeWidth: 4
|
|
1395
|
+
}
|
|
1396
|
+
)
|
|
1397
|
+
] })
|
|
1468
1398
|
] }),
|
|
1469
|
-
/* @__PURE__ */
|
|
1470
|
-
|
|
1399
|
+
/* @__PURE__ */ t.jsxs("div", { className: " iw-overflow-hidden iw-flex iw-flex-col iw-h-full iw-mt-2", children: [
|
|
1400
|
+
/* @__PURE__ */ t.jsx(
|
|
1401
|
+
Ke,
|
|
1402
|
+
{
|
|
1403
|
+
value: i,
|
|
1404
|
+
onChange: r,
|
|
1405
|
+
onKeyDown: a,
|
|
1406
|
+
placeholder: "Type your answer here...",
|
|
1407
|
+
className: " iw-w-full iw-h-full iw-flex-1 iw-resize-none !iw-p-4 iw-bg-transparent iw-min-h-full focus-visible:iw-outline-0",
|
|
1408
|
+
onPaste: (n) => n.preventDefault(),
|
|
1409
|
+
onCopy: (n) => n.preventDefault(),
|
|
1410
|
+
onCut: (n) => n.preventDefault(),
|
|
1411
|
+
onDrop: (n) => n.preventDefault(),
|
|
1412
|
+
onDragOver: (n) => n.preventDefault()
|
|
1413
|
+
}
|
|
1414
|
+
),
|
|
1415
|
+
/* @__PURE__ */ t.jsx("div", { className: "iw-w-full iw-grid iw-grid-cols-1 iw-mt-4", children: /* @__PURE__ */ t.jsx(Z, { onClick: e, disabled: o, children: "Submit Answer" }) })
|
|
1416
|
+
] })
|
|
1417
|
+
] });
|
|
1418
|
+
}, tt = ({
|
|
1419
|
+
className: i = "",
|
|
1420
|
+
width: r,
|
|
1421
|
+
height: e = 56,
|
|
1422
|
+
barWidth: o = 3,
|
|
1423
|
+
gap: s = 2,
|
|
1424
|
+
fftSize: c = 1024,
|
|
1425
|
+
smoothingTimeConstant: a = 0.8,
|
|
1426
|
+
mediaStream: n,
|
|
1427
|
+
startOnMount: w = !0
|
|
1428
|
+
}) => {
|
|
1429
|
+
const { baseColor: m } = W(), d = S(null), h = S(null), u = S(null), g = S(null), y = S(null), k = S(null), j = S(!1), [l, p] = T(null);
|
|
1430
|
+
P(() => {
|
|
1431
|
+
if (r || !h.current) return;
|
|
1432
|
+
const b = h.current, _ = () => {
|
|
1433
|
+
const N = d.current;
|
|
1434
|
+
if (!N) return;
|
|
1435
|
+
const C = b.clientWidth, M = e;
|
|
1436
|
+
N.width = Math.max(1, Math.floor(C * window.devicePixelRatio || 1)), N.height = Math.max(1, Math.floor(M * window.devicePixelRatio || 1));
|
|
1437
|
+
}, x = new ResizeObserver(_);
|
|
1438
|
+
return x.observe(b), _(), () => x.disconnect();
|
|
1439
|
+
}, [r, e]), P(() => {
|
|
1440
|
+
if (!r) return;
|
|
1441
|
+
const b = d.current;
|
|
1442
|
+
b && (b.width = Math.max(
|
|
1443
|
+
1,
|
|
1444
|
+
Math.floor(r * (window.devicePixelRatio || 1))
|
|
1445
|
+
), b.height = Math.max(
|
|
1446
|
+
1,
|
|
1447
|
+
Math.floor(e * (window.devicePixelRatio || 1))
|
|
1448
|
+
));
|
|
1449
|
+
}, [r, e]), P(() => {
|
|
1450
|
+
let b = !1;
|
|
1451
|
+
return (async () => {
|
|
1452
|
+
try {
|
|
1453
|
+
const x = new (window.AudioContext || window.webkitAudioContext)();
|
|
1454
|
+
u.current = x;
|
|
1455
|
+
let N = n;
|
|
1456
|
+
if (!N) {
|
|
1457
|
+
if (!w) return;
|
|
1458
|
+
N = await navigator.mediaDevices.getUserMedia({
|
|
1459
|
+
audio: !0,
|
|
1460
|
+
video: !1
|
|
1461
|
+
}), j.current = !0;
|
|
1462
|
+
}
|
|
1463
|
+
if (b) return;
|
|
1464
|
+
const C = x.createAnalyser();
|
|
1465
|
+
C.fftSize = c, C.smoothingTimeConstant = a, g.current = C;
|
|
1466
|
+
const M = x.createMediaStreamSource(N);
|
|
1467
|
+
y.current = M, M.connect(C), I();
|
|
1468
|
+
} catch (x) {
|
|
1469
|
+
p((x == null ? void 0 : x.message) || "Failed to initialize microphone");
|
|
1470
|
+
}
|
|
1471
|
+
})(), () => {
|
|
1472
|
+
var x, N, C, M;
|
|
1473
|
+
b = !0, k.current && cancelAnimationFrame(k.current);
|
|
1474
|
+
try {
|
|
1475
|
+
(x = y.current) == null || x.disconnect();
|
|
1476
|
+
} catch {
|
|
1477
|
+
}
|
|
1478
|
+
try {
|
|
1479
|
+
(N = g.current) == null || N.disconnect();
|
|
1480
|
+
} catch {
|
|
1481
|
+
}
|
|
1482
|
+
j.current && ((M = ((C = y.current) == null ? void 0 : C.mediaStream) || void 0) == null || M.getTracks().forEach((q) => q.stop())), u.current && u.current.state !== "closed" && u.current.close();
|
|
1483
|
+
};
|
|
1484
|
+
}, [n, c, a, w]);
|
|
1485
|
+
const I = () => {
|
|
1486
|
+
const b = d.current, _ = g.current;
|
|
1487
|
+
if (!b || !_) return;
|
|
1488
|
+
const x = b.getContext("2d");
|
|
1489
|
+
if (!x) return;
|
|
1490
|
+
const N = window.devicePixelRatio || 1, C = b.width, M = b.height, q = _.frequencyBinCount, U = new Uint8Array(q), L = () => {
|
|
1491
|
+
k.current = requestAnimationFrame(L), _.getByteTimeDomainData(U), x.clearRect(0, 0, C, M), x.fillStyle = "rgba(0,0,0,0)", x.fillRect(0, 0, C, M);
|
|
1492
|
+
const O = Math.max(1, Math.floor(o * N)), E = Math.max(1, Math.floor(s * N)), B = O + E, H = Math.max(8, Math.floor((C + E) / B)), K = Math.floor(U.length / H);
|
|
1493
|
+
for (let z = 0; z < H; z++) {
|
|
1494
|
+
const ee = Math.min(U.length - 1, z * K), te = U[ee] / 128 - 1, G = Math.abs(te), re = Math.pow(G, 0.6), f = Math.max(M * 0.06, re * (M * 0.9)), F = z * B, Y = (M - f) / 2, xe = 140 - Math.min(140, 140 * G), pe = 85, be = 48 + Math.floor(12 * (1 - G));
|
|
1495
|
+
x.fillStyle = `${m}`, x.shadowColor = `hsla(${xe}, ${pe}%, ${be}%, ${0.25 * G})`, x.shadowBlur = 8 * G;
|
|
1496
|
+
const ye = Math.min(O / 2, f / 2);
|
|
1497
|
+
rt(x, F, Y, O, f, ye), x.fill();
|
|
1498
|
+
}
|
|
1499
|
+
};
|
|
1500
|
+
L();
|
|
1501
|
+
};
|
|
1502
|
+
return /* @__PURE__ */ t.jsxs(
|
|
1503
|
+
"div",
|
|
1504
|
+
{
|
|
1505
|
+
ref: h,
|
|
1506
|
+
className: `iw-relative iw-w-full iw-overflow-hidden iw-rounded-md iw-bg-gray-50 ${i}`,
|
|
1507
|
+
style: { height: e },
|
|
1508
|
+
children: [
|
|
1509
|
+
/* @__PURE__ */ t.jsx("canvas", { ref: d, className: "iw-w-full iw-h-full" }),
|
|
1510
|
+
l && /* @__PURE__ */ t.jsx("div", { className: "iw-absolute iw-inset-0 iw-flex iw-items-center iw-justify-center", children: /* @__PURE__ */ t.jsx("span", { className: "iw-text-xs iw-text-red-600 iw-bg-red-50 iw-border iw-border-red-200 iw-px-2 iw-py-1 iw-rounded", children: l }) })
|
|
1511
|
+
]
|
|
1512
|
+
}
|
|
1513
|
+
);
|
|
1514
|
+
};
|
|
1515
|
+
function rt(i, r, e, o, s, c) {
|
|
1516
|
+
const a = Math.min(c, o / 2, s / 2);
|
|
1517
|
+
i.beginPath(), i.moveTo(r + a, e), i.lineTo(r + o - a, e), i.quadraticCurveTo(r + o, e, r + o, e + a), i.lineTo(r + o, e + s - a), i.quadraticCurveTo(r + o, e + s, r + o - a, e + s), i.lineTo(r + a, e + s), i.quadraticCurveTo(r, e + s, r, e + s - a), i.lineTo(r, e + a), i.quadraticCurveTo(r, e, r + a, e), i.closePath();
|
|
1518
|
+
}
|
|
1519
|
+
const it = ({
|
|
1520
|
+
state: i,
|
|
1521
|
+
answeringTime: r,
|
|
1522
|
+
nextPhase: e,
|
|
1523
|
+
sttError: o
|
|
1524
|
+
}) => /* @__PURE__ */ t.jsxs("div", { className: "iw-flex iw-flex-col iw-justify-between iw-h-full ", children: [
|
|
1525
|
+
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
1526
|
+
/* @__PURE__ */ t.jsxs("div", { className: "iw-flex iw-items-center iw-justify-between", children: [
|
|
1527
|
+
/* @__PURE__ */ t.jsx("h3", { className: "iw-text-lg iw-font-semibold iw-text-gray-900 iw-mb-1", children: "You may start speaking now. We're listening...." }),
|
|
1528
|
+
/* @__PURE__ */ t.jsxs("div", { className: "iw-flex iw-items-center iw-justify-center iw-gap-2", children: [
|
|
1529
|
+
/* @__PURE__ */ t.jsxs("div", { className: "iw-flex iw-items-center iw-gap-1", children: [
|
|
1530
|
+
/* @__PURE__ */ t.jsx(ne, { className: "iw-size-4 iw-text-orange-600" }),
|
|
1531
|
+
/* @__PURE__ */ t.jsx("p", { className: "iw-text-gray-700 iw-text-sm", children: "Time to talk: " })
|
|
1532
|
+
] }),
|
|
1533
|
+
/* @__PURE__ */ t.jsx(
|
|
1534
|
+
oe,
|
|
1535
|
+
{
|
|
1536
|
+
total: r,
|
|
1537
|
+
remaining: i.currentPhaseTimeRemaining,
|
|
1538
|
+
size: 50,
|
|
1539
|
+
strokeWidth: 4
|
|
1540
|
+
}
|
|
1541
|
+
)
|
|
1542
|
+
] })
|
|
1543
|
+
] }),
|
|
1544
|
+
/* @__PURE__ */ t.jsx("p", { className: "iw-max-w-lg iw-text-gray-500 iw-text-xs iw-leading-[21px]", children: "Done talking? Click the button to review your answer." })
|
|
1545
|
+
] }),
|
|
1546
|
+
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
1547
|
+
/* @__PURE__ */ t.jsx(tt, {}),
|
|
1548
|
+
o && /* @__PURE__ */ t.jsxs("div", { className: "iw-mt-2 iw-text-xs iw-text-red-600", children: [
|
|
1549
|
+
"Recording error: ",
|
|
1550
|
+
o.message
|
|
1551
|
+
] })
|
|
1552
|
+
] }),
|
|
1553
|
+
/* @__PURE__ */ t.jsx("div", { className: "iw-w-full iw-grid iw-grid-cols-1", children: /* @__PURE__ */ t.jsx(
|
|
1554
|
+
Z,
|
|
1555
|
+
{
|
|
1556
|
+
onClick: () => {
|
|
1557
|
+
e();
|
|
1558
|
+
},
|
|
1559
|
+
children: "Transcribe My Answer"
|
|
1560
|
+
}
|
|
1561
|
+
) })
|
|
1562
|
+
] });
|
|
1563
|
+
function st() {
|
|
1564
|
+
const [i, r] = T(!0), e = V(
|
|
1565
|
+
() => [0, 1, 2].map((o) => ({ id: o })),
|
|
1566
|
+
[]
|
|
1567
|
+
);
|
|
1568
|
+
return P(() => {
|
|
1569
|
+
const o = setInterval(() => {
|
|
1570
|
+
r((s) => !s);
|
|
1571
|
+
}, 1500);
|
|
1572
|
+
return () => clearInterval(o);
|
|
1573
|
+
}, []), /* @__PURE__ */ t.jsxs("div", { className: "iw-flex iw-flex-col iw-items-center iw-justify-center iw-gap-8 iw-h-full", children: [
|
|
1574
|
+
/* @__PURE__ */ t.jsx("div", { className: "iw-relative iw-w-80 iw-h-48 ", "aria-hidden": !0, children: e.map((o, s) => {
|
|
1575
|
+
const c = s * 50, a = i ? c : c + 12, n = i ? 1 : 0.08, w = s * 140;
|
|
1576
|
+
return /* @__PURE__ */ t.jsx(
|
|
1577
|
+
"div",
|
|
1578
|
+
{
|
|
1579
|
+
role: "presentation",
|
|
1580
|
+
className: "iw-absolute iw-w-full iw-rounded-lg iw-p-4 iw-shadow-md iw-bg-gradient-to-b iw-from-gray-50 iw-to-gray-100 iw-overflow-hidden",
|
|
1581
|
+
style: {
|
|
1582
|
+
top: 0,
|
|
1583
|
+
transform: `translateY(${a}px)`,
|
|
1584
|
+
opacity: n,
|
|
1585
|
+
transition: `transform 600ms cubic-bezier(.2,.9,.3,1) ${w}ms, opacity 400ms ease ${w}ms`
|
|
1586
|
+
},
|
|
1587
|
+
children: /* @__PURE__ */ t.jsxs("div", { className: "iw-flex iw-gap-3 iw-items-center", children: [
|
|
1588
|
+
/* @__PURE__ */ t.jsx("div", { className: "iw-w-10 iw-h-10 iw-bg-gray-300 iw-rounded iw-flex-shrink-0" }),
|
|
1589
|
+
/* @__PURE__ */ t.jsxs("div", { className: "iw-flex-1 iw-space-y-2", children: [
|
|
1590
|
+
/* @__PURE__ */ t.jsx("div", { className: "iw-h-2 iw-bg-gray-300 iw-rounded iw-w-24" }),
|
|
1591
|
+
/* @__PURE__ */ t.jsx("div", { className: "iw-h-2 iw-bg-gray-300 iw-rounded iw-w-32" })
|
|
1592
|
+
] })
|
|
1593
|
+
] })
|
|
1594
|
+
},
|
|
1595
|
+
o.id
|
|
1596
|
+
);
|
|
1597
|
+
}) }),
|
|
1598
|
+
/* @__PURE__ */ t.jsx("div", { className: "iw-text-center", children: /* @__PURE__ */ t.jsx("p", { className: "iw-text-gray-500 iw-font-medium", children: "Preparing your question..." }) })
|
|
1599
|
+
] });
|
|
1600
|
+
}
|
|
1601
|
+
const fe = ({
|
|
1602
|
+
isOpen: i,
|
|
1603
|
+
onClose: r,
|
|
1604
|
+
children: e,
|
|
1605
|
+
title: o,
|
|
1606
|
+
showCloseButton: s = !0,
|
|
1607
|
+
closeOnOverlayClick: c = !0,
|
|
1608
|
+
closeOnEscape: a = !0,
|
|
1609
|
+
className: n = ""
|
|
1610
|
+
}) => {
|
|
1611
|
+
if (P(() => {
|
|
1612
|
+
if (!i || !a) return;
|
|
1613
|
+
const d = (h) => {
|
|
1614
|
+
h.key === "Escape" && r();
|
|
1615
|
+
};
|
|
1616
|
+
return document.addEventListener("keydown", d), () => document.removeEventListener("keydown", d);
|
|
1617
|
+
}, [i, a, r]), P(() => (i ? (document.body.style.overflow = "hidden", document.body.classList.add("interview-widget-container")) : (document.body.style.overflow = "unset", document.body.classList.remove("interview-widget-container")), () => {
|
|
1618
|
+
document.body.style.overflow = "unset", document.body.classList.remove("interview-widget-container");
|
|
1619
|
+
}), [i]), !i) return null;
|
|
1620
|
+
const w = (d) => {
|
|
1621
|
+
c && d.target === d.currentTarget && r();
|
|
1622
|
+
}, m = /* @__PURE__ */ t.jsxs("div", { className: "iw-fixed iw-inset-0 iw-z-50 iw-flex iw-items-center iw-justify-center", children: [
|
|
1623
|
+
/* @__PURE__ */ t.jsx(
|
|
1624
|
+
"div",
|
|
1471
1625
|
{
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
onKeyDown: c,
|
|
1475
|
-
placeholder: "Type your answer here...",
|
|
1476
|
-
className: "iw-bg-gray-50 iw-w-full iw-resize-none iw-focus:outline-none iw-bg-transparent iw-min-h-[112px]",
|
|
1477
|
-
rows: 5,
|
|
1478
|
-
fullWidth: !0
|
|
1626
|
+
className: "iw-fixed iw-inset-0 iw-bg-black iw-bg-opacity-50 iw-transition-opacity",
|
|
1627
|
+
onClick: w
|
|
1479
1628
|
}
|
|
1480
1629
|
),
|
|
1481
|
-
/* @__PURE__ */
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1630
|
+
/* @__PURE__ */ t.jsxs(
|
|
1631
|
+
"div",
|
|
1632
|
+
{
|
|
1633
|
+
className: `iw-relative iw-bg-white iw-rounded-lg iw-shadow-xl iw-max-w-md iw-w-full iw-mx-4 iw-max-h-[90vh] iw-overflow-hidden ${n}`,
|
|
1634
|
+
role: "dialog",
|
|
1635
|
+
"aria-modal": "true",
|
|
1636
|
+
"aria-labelledby": o ? "dialog-title" : void 0,
|
|
1637
|
+
children: [
|
|
1638
|
+
(o || s) && /* @__PURE__ */ t.jsxs("div", { className: "iw-flex iw-items-center iw-justify-between iw-p-4 iw-border-b iw-border-gray-200", children: [
|
|
1639
|
+
o && /* @__PURE__ */ t.jsx(
|
|
1640
|
+
"h2",
|
|
1641
|
+
{
|
|
1642
|
+
id: "dialog-title",
|
|
1643
|
+
className: "iw-text-lg iw-font-semibold iw-text-gray-900",
|
|
1644
|
+
children: o
|
|
1645
|
+
}
|
|
1646
|
+
),
|
|
1647
|
+
s && /* @__PURE__ */ t.jsx(
|
|
1648
|
+
"button",
|
|
1649
|
+
{
|
|
1650
|
+
onClick: r,
|
|
1651
|
+
className: "iw-p-1 iw-text-gray-400 iw-hover:text-gray-600 iw-transition-colors iw-rounded iw-hover:bg-gray-100",
|
|
1652
|
+
"aria-label": "Close dialog",
|
|
1653
|
+
children: /* @__PURE__ */ t.jsx(
|
|
1654
|
+
"svg",
|
|
1655
|
+
{
|
|
1656
|
+
className: "iw-w-5 iw-h-5",
|
|
1657
|
+
fill: "none",
|
|
1658
|
+
stroke: "currentColor",
|
|
1659
|
+
viewBox: "0 0 24 24",
|
|
1660
|
+
children: /* @__PURE__ */ t.jsx(
|
|
1661
|
+
"path",
|
|
1662
|
+
{
|
|
1663
|
+
strokeLinecap: "round",
|
|
1664
|
+
strokeLinejoin: "round",
|
|
1665
|
+
strokeWidth: 2,
|
|
1666
|
+
d: "M6 18L18 6M6 6l12 12"
|
|
1667
|
+
}
|
|
1668
|
+
)
|
|
1669
|
+
}
|
|
1670
|
+
)
|
|
1671
|
+
}
|
|
1672
|
+
)
|
|
1673
|
+
] }),
|
|
1674
|
+
/* @__PURE__ */ t.jsx("div", { className: "iw-p-4 iw-overflow-y-auto", children: e })
|
|
1675
|
+
]
|
|
1676
|
+
}
|
|
1677
|
+
)
|
|
1678
|
+
] });
|
|
1679
|
+
return ke(m, document.body);
|
|
1680
|
+
}, at = ({
|
|
1681
|
+
open: i,
|
|
1682
|
+
onClose: r
|
|
1683
|
+
}) => /* @__PURE__ */ t.jsx(
|
|
1684
|
+
fe,
|
|
1685
|
+
{
|
|
1686
|
+
isOpen: i,
|
|
1687
|
+
onClose: r || (() => {
|
|
1688
|
+
}),
|
|
1689
|
+
title: "Interview Complete!",
|
|
1690
|
+
className: "",
|
|
1691
|
+
children: /* @__PURE__ */ t.jsxs("div", { className: "iw-flex iw-flex-col iw-items-center iw-justify-center iw-text-center iw-py-2", children: [
|
|
1692
|
+
/* @__PURE__ */ t.jsx(
|
|
1693
|
+
"svg",
|
|
1485
1694
|
{
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
children:
|
|
1695
|
+
className: "iw-w-16 iw-h-16 iw-mx-auto iw-mb-4 iw-text-green-500",
|
|
1696
|
+
fill: "none",
|
|
1697
|
+
stroke: "currentColor",
|
|
1698
|
+
viewBox: "0 0 24 24",
|
|
1699
|
+
children: /* @__PURE__ */ t.jsx(
|
|
1700
|
+
"path",
|
|
1701
|
+
{
|
|
1702
|
+
strokeLinecap: "round",
|
|
1703
|
+
strokeLinejoin: "round",
|
|
1704
|
+
strokeWidth: 2,
|
|
1705
|
+
d: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"
|
|
1706
|
+
}
|
|
1707
|
+
)
|
|
1491
1708
|
}
|
|
1492
|
-
)
|
|
1709
|
+
),
|
|
1710
|
+
/* @__PURE__ */ t.jsx("p", { className: "iw-text-gray-600 iw-mb-6", children: "Thank you for your time. Your answers have been recorded and submitted for review." })
|
|
1493
1711
|
] })
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1712
|
+
}
|
|
1713
|
+
), nt = ({
|
|
1714
|
+
size: i = "192px",
|
|
1715
|
+
className: r,
|
|
1716
|
+
colors: e,
|
|
1717
|
+
animationDuration: o = 20
|
|
1498
1718
|
}) => {
|
|
1499
|
-
const
|
|
1500
|
-
|
|
1719
|
+
const c = { ...{
|
|
1720
|
+
bg: "oklch(95% 0.02 264.695)",
|
|
1721
|
+
c1: "oklch(75% 0.15 350)",
|
|
1722
|
+
// Pastel pink
|
|
1723
|
+
c2: "oklch(80% 0.12 200)",
|
|
1724
|
+
// Pastel blue
|
|
1725
|
+
c3: "oklch(78% 0.14 280)"
|
|
1726
|
+
// Pastel purple/lavender
|
|
1727
|
+
}, ...e }, a = parseInt(i.replace("px", ""), 10), n = a < 50 ? Math.max(a * 8e-3, 1) : Math.max(a * 0.015, 4), w = a < 50 ? Math.max(a * 4e-3, 1.2) : Math.max(a * 8e-3, 1.5), m = a < 50 ? Math.max(a * 4e-3, 0.05) : Math.max(a * 8e-3, 0.1), d = a < 50 ? Math.max(a * 4e-3, 0.5) : Math.max(a * 8e-3, 2), h = a < 30 ? "0%" : a < 50 ? "5%" : a < 100 ? "15%" : "25%", u = a < 30 ? 1.1 : a < 50 ? Math.max(w * 1.2, 1.3) : w;
|
|
1728
|
+
return /* @__PURE__ */ t.jsx(
|
|
1501
1729
|
"div",
|
|
1502
1730
|
{
|
|
1503
|
-
className:
|
|
1731
|
+
className: `siri-orb ${r}`,
|
|
1504
1732
|
style: {
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1733
|
+
width: i,
|
|
1734
|
+
height: i,
|
|
1735
|
+
"--bg": c.bg,
|
|
1736
|
+
"--c1": c.c1,
|
|
1737
|
+
"--c2": c.c2,
|
|
1738
|
+
"--c3": c.c3,
|
|
1739
|
+
"--animation-duration": `${o}s`,
|
|
1740
|
+
"--blur-amount": `${n}px`,
|
|
1741
|
+
"--contrast-amount": u,
|
|
1742
|
+
"--dot-size": `${m}px`,
|
|
1743
|
+
"--shadow-spread": `${d}px`,
|
|
1744
|
+
"--mask-radius": h
|
|
1508
1745
|
},
|
|
1509
|
-
children:
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1746
|
+
children: /* @__PURE__ */ t.jsx("style", { children: `
|
|
1747
|
+
@property --angle {
|
|
1748
|
+
syntax: "<angle>";
|
|
1749
|
+
inherits: false;
|
|
1750
|
+
initial-value: 0deg;
|
|
1751
|
+
}
|
|
1752
|
+
|
|
1753
|
+
.siri-orb {
|
|
1754
|
+
display: grid;
|
|
1755
|
+
grid-template-areas: "stack";
|
|
1756
|
+
overflow: hidden;
|
|
1757
|
+
border-radius: 50%;
|
|
1758
|
+
position: relative;
|
|
1759
|
+
transform: scale(1.1);
|
|
1760
|
+
}
|
|
1761
|
+
|
|
1762
|
+
.siri-orb::before,
|
|
1763
|
+
.siri-orb::after {
|
|
1764
|
+
content: "";
|
|
1765
|
+
display: block;
|
|
1766
|
+
grid-area: stack;
|
|
1767
|
+
width: 100%;
|
|
1768
|
+
height: 100%;
|
|
1769
|
+
border-radius: 50%;
|
|
1770
|
+
transform: translateZ(0);
|
|
1771
|
+
}
|
|
1772
|
+
|
|
1773
|
+
.siri-orb::before {
|
|
1774
|
+
background: conic-gradient(
|
|
1775
|
+
from calc(var(--angle) * 2) at 25% 70%,
|
|
1776
|
+
var(--c3),
|
|
1777
|
+
transparent 20% 80%,
|
|
1778
|
+
var(--c3)
|
|
1779
|
+
),
|
|
1780
|
+
conic-gradient(
|
|
1781
|
+
from calc(var(--angle) * 2) at 45% 75%,
|
|
1782
|
+
var(--c2),
|
|
1783
|
+
transparent 30% 60%,
|
|
1784
|
+
var(--c2)
|
|
1785
|
+
),
|
|
1786
|
+
conic-gradient(
|
|
1787
|
+
from calc(var(--angle) * -3) at 80% 20%,
|
|
1788
|
+
var(--c1),
|
|
1789
|
+
transparent 40% 60%,
|
|
1790
|
+
var(--c1)
|
|
1791
|
+
),
|
|
1792
|
+
conic-gradient(
|
|
1793
|
+
from calc(var(--angle) * 2) at 15% 5%,
|
|
1794
|
+
var(--c2),
|
|
1795
|
+
transparent 10% 90%,
|
|
1796
|
+
var(--c2)
|
|
1797
|
+
),
|
|
1798
|
+
conic-gradient(
|
|
1799
|
+
from calc(var(--angle) * 1) at 20% 80%,
|
|
1800
|
+
var(--c1),
|
|
1801
|
+
transparent 10% 90%,
|
|
1802
|
+
var(--c1)
|
|
1803
|
+
),
|
|
1804
|
+
conic-gradient(
|
|
1805
|
+
from calc(var(--angle) * -2) at 85% 10%,
|
|
1806
|
+
var(--c3),
|
|
1807
|
+
transparent 20% 80%,
|
|
1808
|
+
var(--c3)
|
|
1809
|
+
);
|
|
1810
|
+
box-shadow: inset var(--bg) 0 0 var(--shadow-spread)
|
|
1811
|
+
calc(var(--shadow-spread) * 0.2);
|
|
1812
|
+
filter: blur(var(--blur-amount)) contrast(var(--contrast-amount));
|
|
1813
|
+
animation: rotate var(--animation-duration) linear infinite;
|
|
1814
|
+
}
|
|
1815
|
+
|
|
1816
|
+
.siri-orb::after {
|
|
1817
|
+
background-image: radial-gradient(
|
|
1818
|
+
circle at center,
|
|
1819
|
+
var(--bg) var(--dot-size),
|
|
1820
|
+
transparent var(--dot-size)
|
|
1821
|
+
);
|
|
1822
|
+
background-size: calc(var(--dot-size) * 2) calc(var(--dot-size) * 2);
|
|
1823
|
+
backdrop-filter: blur(calc(var(--blur-amount) * 2))
|
|
1824
|
+
contrast(calc(var(--contrast-amount) * 2));
|
|
1825
|
+
mix-blend-mode: overlay;
|
|
1826
|
+
}
|
|
1827
|
+
|
|
1828
|
+
/* Apply mask only when radius is greater than 0 */
|
|
1829
|
+
.siri-orb[style*="--mask-radius: 0%"]::after {
|
|
1830
|
+
mask-image: none;
|
|
1831
|
+
}
|
|
1832
|
+
|
|
1833
|
+
.siri-orb:not([style*="--mask-radius: 0%"])::after {
|
|
1834
|
+
mask-image: radial-gradient(
|
|
1835
|
+
black var(--mask-radius),
|
|
1836
|
+
transparent 75%
|
|
1837
|
+
);
|
|
1838
|
+
}
|
|
1839
|
+
|
|
1840
|
+
@keyframes rotate {
|
|
1841
|
+
to {
|
|
1842
|
+
--angle: 360deg;
|
|
1843
|
+
}
|
|
1844
|
+
}
|
|
1845
|
+
|
|
1846
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1847
|
+
.siri-orb::before {
|
|
1848
|
+
animation: none;
|
|
1849
|
+
}
|
|
1850
|
+
}
|
|
1851
|
+
` })
|
|
1852
|
+
}
|
|
1853
|
+
);
|
|
1854
|
+
};
|
|
1855
|
+
function ot({ ttsError: i }) {
|
|
1856
|
+
return /* @__PURE__ */ t.jsxs("div", { className: "iw-flex iw-flex-col iw-items-center iw-justify-center iw-gap-8 iw-w-full iw-h-full", children: [
|
|
1857
|
+
/* @__PURE__ */ t.jsx(nt, { size: "80px" }),
|
|
1858
|
+
i && /* @__PURE__ */ t.jsxs("div", { className: "iw-mt-2 iw-text-xs iw-text-red-600", children: [
|
|
1859
|
+
"Audio playback failed: ",
|
|
1860
|
+
i.message
|
|
1861
|
+
] }),
|
|
1862
|
+
/* @__PURE__ */ t.jsx("p", { className: "iw-text- iw-text-gray-700", children: "Your AI interviewer is speaking..." })
|
|
1863
|
+
] });
|
|
1864
|
+
}
|
|
1865
|
+
const ct = ({ state: i, thinkingTime: r, nextPhase: e }) => /* @__PURE__ */ t.jsxs("div", { className: "iw-flex iw-flex-col iw-gap-6 iw-items-center iw-justify-center iw-text-center iw-h-full ", children: [
|
|
1866
|
+
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
1867
|
+
/* @__PURE__ */ t.jsx("h3", { className: "iw-text-lg iw-font-semibold iw-text-gray-900 iw-mb-1", children: "Get Ready to Answer" }),
|
|
1868
|
+
/* @__PURE__ */ t.jsx("p", { className: "iw-max-w-lg iw-text-gray-500 iw-text-xs iw-leading-[21px]", children: "After 30-seconds thinking time, recording will start automatically, or you can begin recording early by clicking the button below." })
|
|
1869
|
+
] }),
|
|
1870
|
+
/* @__PURE__ */ t.jsxs("div", { className: "iw-flex iw-items-center iw-justify-center iw-gap-2", children: [
|
|
1871
|
+
/* @__PURE__ */ t.jsxs("div", { className: "iw-flex iw-items-center iw-gap-1", children: [
|
|
1872
|
+
/* @__PURE__ */ t.jsx(ne, { className: "iw-size-4 iw-text-orange-600" }),
|
|
1873
|
+
/* @__PURE__ */ t.jsx("p", { className: "iw-text-gray-700 iw-text-sm", children: "Time to think: " })
|
|
1874
|
+
] }),
|
|
1875
|
+
/* @__PURE__ */ t.jsx(
|
|
1876
|
+
oe,
|
|
1877
|
+
{
|
|
1878
|
+
total: r,
|
|
1879
|
+
remaining: i.currentPhaseTimeRemaining,
|
|
1880
|
+
size: 50,
|
|
1881
|
+
strokeWidth: 4
|
|
1882
|
+
}
|
|
1883
|
+
)
|
|
1884
|
+
] }),
|
|
1885
|
+
/* @__PURE__ */ t.jsx("div", { className: "iw-w-full iw-grid iw-grid-cols-1", children: /* @__PURE__ */ t.jsx(
|
|
1886
|
+
Z,
|
|
1887
|
+
{
|
|
1888
|
+
onClick: () => {
|
|
1889
|
+
e();
|
|
1890
|
+
},
|
|
1891
|
+
children: "Start Answering"
|
|
1529
1892
|
}
|
|
1530
|
-
)
|
|
1893
|
+
) })
|
|
1894
|
+
] }), lt = ({ sttError: i }) => /* @__PURE__ */ t.jsxs("div", { className: "iw-flex iw-flex-col iw-items-center iw-justify-center iw-h-full", children: [
|
|
1895
|
+
/* @__PURE__ */ t.jsxs("svg", { width: "48", height: "48", viewBox: "0 0 60 60", fill: "none", children: [
|
|
1896
|
+
/* @__PURE__ */ t.jsx(
|
|
1897
|
+
"rect",
|
|
1898
|
+
{
|
|
1899
|
+
width: 60,
|
|
1900
|
+
height: 60,
|
|
1901
|
+
rx: 30,
|
|
1902
|
+
fill: "url(#prefix__paint0_linear_1460_12482)"
|
|
1903
|
+
}
|
|
1904
|
+
),
|
|
1905
|
+
/* @__PURE__ */ t.jsx(
|
|
1906
|
+
"path",
|
|
1907
|
+
{
|
|
1908
|
+
d: "M28.127 14c.276 7.685 6.442 13.851 14.127 14.127-7.684.276-13.85 6.442-14.127 14.127-.275-7.685-6.442-13.851-14.126-14.127 7.684-.276 13.85-6.442 14.126-14.127zM38.937 31.873A7.331 7.331 0 0046 38.937 7.331 7.331 0 0038.937 46a7.331 7.331 0 00-7.064-7.063 7.331 7.331 0 007.064-7.064z",
|
|
1909
|
+
fill: "#fff"
|
|
1910
|
+
}
|
|
1911
|
+
),
|
|
1912
|
+
/* @__PURE__ */ t.jsx("defs", { children: /* @__PURE__ */ t.jsxs(
|
|
1913
|
+
"linearGradient",
|
|
1914
|
+
{
|
|
1915
|
+
id: "prefix__paint0_linear_1460_12482",
|
|
1916
|
+
x1: 30,
|
|
1917
|
+
y1: -6.563,
|
|
1918
|
+
x2: 77.813,
|
|
1919
|
+
y2: 54.375,
|
|
1920
|
+
gradientUnits: "userSpaceOnUse",
|
|
1921
|
+
children: [
|
|
1922
|
+
/* @__PURE__ */ t.jsx("stop", { offset: 0.211, stopColor: "#5C92FA" }),
|
|
1923
|
+
/* @__PURE__ */ t.jsx("stop", { offset: 1, stopColor: "#A75FFD" })
|
|
1924
|
+
]
|
|
1925
|
+
}
|
|
1926
|
+
) })
|
|
1927
|
+
] }),
|
|
1928
|
+
/* @__PURE__ */ t.jsx("h3", { className: "iw-text-lg iw-font-semibold iw-text-gray-900 iw-mb-1 iw-mt-3", children: "Just a moment... We're analyzing your response" }),
|
|
1929
|
+
/* @__PURE__ */ t.jsx("p", { className: "iw-max-w-lg iw-text-gray-500 iw-text-xs iw-leading-[21px]", children: "After transcription, you'll have 45 sec to review your answer." }),
|
|
1930
|
+
i && /* @__PURE__ */ t.jsxs("div", { className: "iw-mt-2 iw-text-xs iw-text-red-600", children: [
|
|
1931
|
+
"Transcription error: ",
|
|
1932
|
+
i.message,
|
|
1933
|
+
i.recoverable && " (attempting to continue)"
|
|
1934
|
+
] })
|
|
1935
|
+
] }), dt = (i) => /* @__PURE__ */ t.jsxs(
|
|
1936
|
+
"svg",
|
|
1937
|
+
{
|
|
1938
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1939
|
+
width: "24",
|
|
1940
|
+
height: "24",
|
|
1941
|
+
viewBox: "0 0 24 24",
|
|
1942
|
+
fill: "none",
|
|
1943
|
+
stroke: "currentColor",
|
|
1944
|
+
strokeWidth: "2",
|
|
1945
|
+
strokeLinecap: "round",
|
|
1946
|
+
strokeLinejoin: "round",
|
|
1947
|
+
...i,
|
|
1948
|
+
children: [
|
|
1949
|
+
/* @__PURE__ */ t.jsx("path", { d: "M12 8V4H8" }),
|
|
1950
|
+
/* @__PURE__ */ t.jsx("rect", { width: "16", height: "12", x: "4", y: "8", rx: "2" }),
|
|
1951
|
+
/* @__PURE__ */ t.jsx("path", { d: "M2 14h2" }),
|
|
1952
|
+
/* @__PURE__ */ t.jsx("path", { d: "M20 14h2" }),
|
|
1953
|
+
/* @__PURE__ */ t.jsx("path", { d: "M15 13v2" }),
|
|
1954
|
+
/* @__PURE__ */ t.jsx("path", { d: "M9 13v2" })
|
|
1955
|
+
]
|
|
1956
|
+
}
|
|
1957
|
+
), wt = ({
|
|
1958
|
+
question: i,
|
|
1959
|
+
isLoading: r = !1
|
|
1960
|
+
}) => {
|
|
1961
|
+
const { baseColor: e } = W();
|
|
1962
|
+
return /* @__PURE__ */ t.jsx(
|
|
1531
1963
|
"div",
|
|
1532
1964
|
{
|
|
1533
|
-
className: "iw-rounded-xl iw-mb-4 message-animation iw-text-gray-800 iw-
|
|
1534
|
-
style:
|
|
1535
|
-
children: [
|
|
1536
|
-
/* @__PURE__ */
|
|
1537
|
-
/* @__PURE__ */
|
|
1538
|
-
|
|
1965
|
+
className: "iw-rounded-xl iw-mb-4 message-animation iw-text-gray-800 iw-p-6 ",
|
|
1966
|
+
style: De(e, 0.85),
|
|
1967
|
+
children: /* @__PURE__ */ t.jsxs("div", { className: "iw-flex iw-items-center iw-gap-8", children: [
|
|
1968
|
+
/* @__PURE__ */ t.jsxs("div", { className: "iw-flex iw-flex-col iw-items-center iw-relative iw-h-32 iw-w-32 iw-shrink-0 iw-shadow iw-rounded-lg iw-bg-white", children: [
|
|
1969
|
+
/* @__PURE__ */ t.jsx("div", { className: "iw-mt-8", children: /* @__PURE__ */ t.jsx(
|
|
1970
|
+
dt,
|
|
1539
1971
|
{
|
|
1540
|
-
className: "iw-h-12 iw-w-12
|
|
1541
|
-
style: {
|
|
1542
|
-
children: "N"
|
|
1972
|
+
className: "iw-h-12 iw-w-12",
|
|
1973
|
+
style: { stroke: e }
|
|
1543
1974
|
}
|
|
1544
|
-
),
|
|
1545
|
-
/* @__PURE__ */
|
|
1546
|
-
/* @__PURE__ */ r.jsx("div", { className: "iw-text-sm iw-font-semibold", children: "Novara" }),
|
|
1547
|
-
/* @__PURE__ */ r.jsx("div", { className: "iw-text-xs iw-text-gray-500", children: "Assistant" })
|
|
1548
|
-
] })
|
|
1975
|
+
) }),
|
|
1976
|
+
/* @__PURE__ */ t.jsx("div", { className: "iw-absolute iw-bottom-2 iw-translate-x-1/2 iw-flex iw-mt-2", children: /* @__PURE__ */ t.jsx("div", { className: "iw-text-sm", children: "Novara" }) })
|
|
1549
1977
|
] }),
|
|
1550
|
-
/* @__PURE__ */
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
{
|
|
1556
|
-
className: "iw-rounded-xl iw-mb-4 iw-bg-gray-50 iw-text-gray-500 iw-border iw-border-gray-200 iw-p-5 iw-text-center",
|
|
1557
|
-
children: /* @__PURE__ */ r.jsx("p", { className: "iw-text-sm", children: "No question available" })
|
|
1978
|
+
r ? /* @__PURE__ */ t.jsxs("div", { className: "iw-animate-pulse iw-w-full iw-space-y-3 iw-mr-10", children: [
|
|
1979
|
+
/* @__PURE__ */ t.jsx("div", { className: "iw-h-5 iw-bg-gray-200 iw-rounded iw-w-full" }),
|
|
1980
|
+
/* @__PURE__ */ t.jsx("div", { className: "iw-h-5 iw-bg-gray-200 iw-rounded iw-w-3/4" })
|
|
1981
|
+
] }) : /* @__PURE__ */ t.jsx("p", { className: "iw-text-lg iw-leading-8", children: i == null ? void 0 : i.question })
|
|
1982
|
+
] })
|
|
1558
1983
|
}
|
|
1559
1984
|
);
|
|
1560
|
-
},
|
|
1985
|
+
}, ut = ({
|
|
1986
|
+
confirmExitInterview: i,
|
|
1987
|
+
isOpen: r,
|
|
1988
|
+
onClose: e
|
|
1989
|
+
}) => /* @__PURE__ */ t.jsx(fe, { isOpen: r, onClose: e, title: "Exit Interview", children: /* @__PURE__ */ t.jsxs("div", { className: "iw-space-y-4", children: [
|
|
1990
|
+
/* @__PURE__ */ t.jsx("p", { className: "iw-text-base iw-text-gray-700", children: "Are you sure you want to exit the interview? All progress will be lost and you will not be able to resume." }),
|
|
1991
|
+
/* @__PURE__ */ t.jsxs("div", { className: "iw-flex iw-justify-end iw-space-x-2", children: [
|
|
1992
|
+
/* @__PURE__ */ t.jsx(
|
|
1993
|
+
"button",
|
|
1994
|
+
{
|
|
1995
|
+
className: "iw-px-4 iw-py-2 iw-bg-gray-200 iw-rounded iw-text-gray-700 iw-font-medium",
|
|
1996
|
+
onClick: e,
|
|
1997
|
+
children: "Cancel"
|
|
1998
|
+
}
|
|
1999
|
+
),
|
|
2000
|
+
/* @__PURE__ */ t.jsx(
|
|
2001
|
+
"button",
|
|
2002
|
+
{
|
|
2003
|
+
className: "iw-px-4 iw-py-2 iw-bg-red-600 iw-text-white iw-rounded iw-font-medium",
|
|
2004
|
+
onClick: i,
|
|
2005
|
+
children: "Confirm Exit"
|
|
2006
|
+
}
|
|
2007
|
+
)
|
|
2008
|
+
] })
|
|
2009
|
+
] }) }), ht = ({ title: i, onExit: r }) => {
|
|
2010
|
+
const { baseColor: e } = W(), [o, s] = T(!1);
|
|
2011
|
+
return /* @__PURE__ */ t.jsxs("header", { className: "iw-w-full iw-text-gray-900", children: [
|
|
2012
|
+
/* @__PURE__ */ t.jsxs("div", { className: "iw-mx-auto iw-flex iw-items-center iw-justify-between iw-px-4 iw-py-3", children: [
|
|
2013
|
+
/* @__PURE__ */ t.jsxs("div", { className: "iw-flex iw-items-center iw-space-x-2", children: [
|
|
2014
|
+
/* @__PURE__ */ t.jsx(
|
|
2015
|
+
"div",
|
|
2016
|
+
{
|
|
2017
|
+
className: "iw-h-7 iw-w-7 iw-rounded-md iw-flex iw-items-center iw-justify-center iw-text-white iw-font-semibold",
|
|
2018
|
+
style: { backgroundColor: e },
|
|
2019
|
+
children: "N"
|
|
2020
|
+
}
|
|
2021
|
+
),
|
|
2022
|
+
/* @__PURE__ */ t.jsx("p", { className: "iw-text-sm iw-font-medium", children: "Novara" })
|
|
2023
|
+
] }),
|
|
2024
|
+
/* @__PURE__ */ t.jsx("h1", { className: "iw-text-base iw-font-bold", children: i }),
|
|
2025
|
+
/* @__PURE__ */ t.jsx(
|
|
2026
|
+
"button",
|
|
2027
|
+
{
|
|
2028
|
+
className: "iw-text-sm iw-text-gray-500 hover:iw-text-gray-700",
|
|
2029
|
+
onClick: () => s(!0),
|
|
2030
|
+
children: "Exit Interview"
|
|
2031
|
+
}
|
|
2032
|
+
)
|
|
2033
|
+
] }),
|
|
2034
|
+
/* @__PURE__ */ t.jsx("div", { className: "iw-h-px iw-bg-gray-200" }),
|
|
2035
|
+
/* @__PURE__ */ t.jsx(
|
|
2036
|
+
ut,
|
|
2037
|
+
{
|
|
2038
|
+
isOpen: o,
|
|
2039
|
+
confirmExitInterview: () => {
|
|
2040
|
+
r(), s(!1);
|
|
2041
|
+
},
|
|
2042
|
+
onClose: () => s(!1)
|
|
2043
|
+
}
|
|
2044
|
+
)
|
|
2045
|
+
] });
|
|
2046
|
+
}, mt = ({
|
|
1561
2047
|
interviewId: i,
|
|
1562
|
-
onComplete:
|
|
2048
|
+
onComplete: r,
|
|
1563
2049
|
className: e = ""
|
|
1564
2050
|
}) => {
|
|
1565
|
-
const
|
|
1566
|
-
thinkingTime: (
|
|
1567
|
-
answeringTime: (
|
|
1568
|
-
editingTime: (
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
editingTime: S,
|
|
1575
|
-
totalTime: ie,
|
|
1576
|
-
minimumBufferTime: re
|
|
1577
|
-
} = w;
|
|
1578
|
-
A(() => {
|
|
1579
|
-
j.current = u;
|
|
1580
|
-
}, [u]);
|
|
1581
|
-
const _ = D(!1), {
|
|
1582
|
-
speak: te,
|
|
1583
|
-
isPlaying: se,
|
|
1584
|
-
error: W
|
|
1585
|
-
} = Ue({
|
|
2051
|
+
const o = We(), { baseUrl: s, authToken: c } = Se(), { timers: a, stt: n, tts: w } = Ce(), [m, d] = T(null), [h, u] = T(""), g = S(""), y = S(null), k = {
|
|
2052
|
+
thinkingTime: (a == null ? void 0 : a.thinkingDuration) || 30,
|
|
2053
|
+
answeringTime: (a == null ? void 0 : a.answeringDuration) || 120,
|
|
2054
|
+
editingTime: (a == null ? void 0 : a.editingDuration) || 30
|
|
2055
|
+
}, { thinkingTime: j, answeringTime: l, editingTime: p } = k;
|
|
2056
|
+
P(() => {
|
|
2057
|
+
g.current = h;
|
|
2058
|
+
}, [h]);
|
|
2059
|
+
const I = S(!1), { speak: b, error: _ } = Je({
|
|
1586
2060
|
config: {
|
|
1587
|
-
baseUrl:
|
|
1588
|
-
provider:
|
|
2061
|
+
baseUrl: s,
|
|
2062
|
+
provider: w == null ? void 0 : w.provider,
|
|
2063
|
+
authToken: c
|
|
1589
2064
|
},
|
|
1590
2065
|
onEnd: () => {
|
|
1591
|
-
|
|
2066
|
+
I.current = !1, E();
|
|
1592
2067
|
},
|
|
1593
|
-
onError: (
|
|
1594
|
-
|
|
2068
|
+
onError: () => {
|
|
2069
|
+
I.current || (I.current = !0, E());
|
|
1595
2070
|
}
|
|
1596
|
-
}),
|
|
1597
|
-
startRecording:
|
|
1598
|
-
stopRecording:
|
|
1599
|
-
transcribe:
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
error: M
|
|
1603
|
-
} = _e({
|
|
2071
|
+
}), x = S(!1), N = S(!1), {
|
|
2072
|
+
startRecording: C,
|
|
2073
|
+
stopRecording: M,
|
|
2074
|
+
transcribe: q,
|
|
2075
|
+
error: U
|
|
2076
|
+
} = Ye({
|
|
1604
2077
|
config: {
|
|
1605
|
-
baseUrl:
|
|
1606
|
-
provider:
|
|
1607
|
-
model:
|
|
1608
|
-
language:
|
|
2078
|
+
baseUrl: s,
|
|
2079
|
+
provider: n == null ? void 0 : n.provider,
|
|
2080
|
+
model: n == null ? void 0 : n.model,
|
|
2081
|
+
language: n == null ? void 0 : n.language,
|
|
2082
|
+
authToken: c
|
|
1609
2083
|
},
|
|
1610
2084
|
onStart: () => {
|
|
1611
|
-
|
|
2085
|
+
x.current = !1, N.current = !1;
|
|
1612
2086
|
},
|
|
1613
2087
|
onStop: () => {
|
|
1614
|
-
console.log("STT recording stopped");
|
|
1615
2088
|
},
|
|
1616
2089
|
onTranscriptionComplete: (f) => {
|
|
1617
|
-
|
|
2090
|
+
u(f.transcript), N.current || (N.current = !0, E());
|
|
1618
2091
|
},
|
|
1619
2092
|
onError: (f) => {
|
|
1620
|
-
console.error("STT Error:", f),
|
|
2093
|
+
console.error("STT Error:", f), x.current || (x.current = !0, E());
|
|
1621
2094
|
}
|
|
1622
|
-
}), { state:
|
|
2095
|
+
}), { state: L, startQuestion: O, nextPhase: E, completeInterview: B } = Ge({
|
|
1623
2096
|
config: {
|
|
1624
|
-
thinkingDuration:
|
|
1625
|
-
answeringDuration:
|
|
1626
|
-
editingDuration:
|
|
1627
|
-
totalInterviewDuration: ie,
|
|
1628
|
-
minimumTimeForNextQuestion: re
|
|
2097
|
+
thinkingDuration: j,
|
|
2098
|
+
answeringDuration: l,
|
|
2099
|
+
editingDuration: p
|
|
1629
2100
|
},
|
|
1630
2101
|
callbacks: {
|
|
1631
2102
|
onPhaseChange: (f) => {
|
|
1632
|
-
switch (
|
|
1633
|
-
case
|
|
1634
|
-
|
|
2103
|
+
switch (f) {
|
|
2104
|
+
case R.FETCHING_QUESTION:
|
|
2105
|
+
H();
|
|
1635
2106
|
break;
|
|
1636
|
-
case
|
|
1637
|
-
|
|
2107
|
+
case R.READING_QUESTION:
|
|
2108
|
+
ee();
|
|
1638
2109
|
break;
|
|
1639
|
-
case
|
|
1640
|
-
|
|
2110
|
+
case R.ANSWERING:
|
|
2111
|
+
te();
|
|
1641
2112
|
break;
|
|
1642
|
-
case
|
|
1643
|
-
|
|
2113
|
+
case R.TRANSCRIBING:
|
|
2114
|
+
G();
|
|
1644
2115
|
break;
|
|
1645
|
-
case
|
|
1646
|
-
|
|
2116
|
+
case R.SUBMITTING:
|
|
2117
|
+
z();
|
|
1647
2118
|
break;
|
|
1648
2119
|
}
|
|
1649
2120
|
},
|
|
1650
2121
|
onInterviewEnd: () => {
|
|
1651
|
-
|
|
2122
|
+
r == null || r();
|
|
1652
2123
|
}
|
|
1653
2124
|
}
|
|
1654
|
-
})
|
|
2125
|
+
});
|
|
2126
|
+
P(() => {
|
|
2127
|
+
O();
|
|
2128
|
+
}, []);
|
|
2129
|
+
const { execute: H, loading: K } = qe(
|
|
1655
2130
|
async () => {
|
|
1656
|
-
var
|
|
1657
|
-
const f = await
|
|
2131
|
+
var F, Y;
|
|
2132
|
+
const f = await o.generateQuestion({
|
|
1658
2133
|
interviewId: i,
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
answer: j.current
|
|
2134
|
+
question: ((F = y.current) == null ? void 0 : F.question) || "",
|
|
2135
|
+
qnaId: ((Y = y.current) == null ? void 0 : Y.qna_id) || "",
|
|
2136
|
+
answer: g.current
|
|
1663
2137
|
});
|
|
1664
|
-
return
|
|
2138
|
+
return y.current = f.data, f;
|
|
1665
2139
|
},
|
|
1666
2140
|
{
|
|
1667
2141
|
onSuccess: async (f) => {
|
|
1668
|
-
|
|
2142
|
+
f && f.data && (u(""), d(f.data), E());
|
|
1669
2143
|
},
|
|
1670
2144
|
onError: (f) => {
|
|
1671
2145
|
console.error("Failed to fetch questions:", f);
|
|
1672
2146
|
}
|
|
1673
2147
|
}
|
|
1674
|
-
),
|
|
1675
|
-
|
|
1676
|
-
}, [
|
|
2148
|
+
), z = A(async () => {
|
|
2149
|
+
O();
|
|
2150
|
+
}, [O]), ee = A(async () => {
|
|
1677
2151
|
var f;
|
|
1678
|
-
if ((f =
|
|
2152
|
+
if ((f = y.current) != null && f.question)
|
|
1679
2153
|
try {
|
|
1680
|
-
|
|
1681
|
-
} catch (
|
|
1682
|
-
console.error("Failed to speak question:",
|
|
2154
|
+
I.current = !1, await b(y.current.question), y.current.is_interview_done && (await Pe(2e3), B());
|
|
2155
|
+
} catch (F) {
|
|
2156
|
+
console.error("Failed to speak question:", F);
|
|
1683
2157
|
}
|
|
1684
2158
|
else
|
|
1685
2159
|
E();
|
|
1686
|
-
}, []),
|
|
1687
|
-
console.log("Starting recording...");
|
|
2160
|
+
}, [b, E, B]), te = A(async () => {
|
|
1688
2161
|
try {
|
|
1689
|
-
|
|
1690
|
-
console.log("🚀 ~ maxDuration:", f), await z(f);
|
|
2162
|
+
await C(l);
|
|
1691
2163
|
} catch (f) {
|
|
1692
2164
|
console.error("Failed to start recording:", f), E();
|
|
1693
2165
|
}
|
|
1694
|
-
}, [
|
|
1695
|
-
console.log("Stopping recording and processing STT...");
|
|
2166
|
+
}, [C, E]), G = A(async () => {
|
|
1696
2167
|
try {
|
|
1697
|
-
const f = await
|
|
1698
|
-
|
|
2168
|
+
const f = await M();
|
|
2169
|
+
await q(f);
|
|
1699
2170
|
} catch (f) {
|
|
1700
|
-
console.error("STT processing failed:", f), !
|
|
2171
|
+
console.error("STT processing failed:", f), !x.current && !N.current && (x.current = !0, E());
|
|
1701
2172
|
}
|
|
1702
|
-
}, [
|
|
1703
|
-
const { phase: f } =
|
|
2173
|
+
}, [M, q, E]), re = () => {
|
|
2174
|
+
const { phase: f } = L;
|
|
1704
2175
|
switch (f) {
|
|
1705
|
-
case
|
|
1706
|
-
return /* @__PURE__ */
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
] })
|
|
1719
|
-
] }) });
|
|
1720
|
-
case l.THINKING:
|
|
1721
|
-
case l.ANSWERING:
|
|
1722
|
-
return /* @__PURE__ */ r.jsx("div", { className: "iw-space-y-4", children: f === l.ANSWERING && /* @__PURE__ */ r.jsxs("div", { className: "iw-p-4 iw-bg-red-50 iw-border iw-border-red-200 iw-rounded-lg", children: [
|
|
1723
|
-
/* @__PURE__ */ r.jsxs("div", { className: "iw-flex iw-items-center iw-space-x-2", children: [
|
|
1724
|
-
/* @__PURE__ */ r.jsx("div", { className: "iw-w-3 iw-h-3 iw-bg-red-500 iw-rounded-full iw-animate-pulse" }),
|
|
1725
|
-
/* @__PURE__ */ r.jsx("span", { className: "iw-text-sm iw-font-medium iw-text-red-700", children: ne ? "Recording in progress..." : "Preparing to record..." })
|
|
1726
|
-
] }),
|
|
1727
|
-
M && /* @__PURE__ */ r.jsxs("div", { className: "iw-mt-2 iw-text-xs iw-text-red-600", children: [
|
|
1728
|
-
"Recording error: ",
|
|
1729
|
-
M.message
|
|
1730
|
-
] })
|
|
1731
|
-
] }) });
|
|
1732
|
-
case l.TRANSCRIBING:
|
|
1733
|
-
return /* @__PURE__ */ r.jsx("div", { className: "iw-space-y-4", children: /* @__PURE__ */ r.jsxs("div", { className: "iw-p-4 iw-bg-purple-50 iw-border iw-border-purple-200 iw-rounded-lg", children: [
|
|
1734
|
-
/* @__PURE__ */ r.jsxs("div", { className: "iw-flex iw-items-center iw-space-x-2", children: [
|
|
1735
|
-
/* @__PURE__ */ r.jsx("div", { className: "iw-animate-spin iw-h-4 iw-w-4 iw-border-2 iw-border-purple-500 iw-border-t-transparent iw-rounded-full" }),
|
|
1736
|
-
/* @__PURE__ */ r.jsx("span", { className: "iw-text-sm iw-font-medium iw-text-purple-700", children: ae ? "Transcribing your speech..." : "Processing audio..." })
|
|
1737
|
-
] }),
|
|
1738
|
-
M && /* @__PURE__ */ r.jsxs("div", { className: "iw-mt-2 iw-text-xs iw-text-red-600", children: [
|
|
1739
|
-
"Transcription error: ",
|
|
1740
|
-
M.message,
|
|
1741
|
-
M.recoverable && " (attempting to continue)"
|
|
1742
|
-
] })
|
|
1743
|
-
] }) });
|
|
1744
|
-
case l.EDITING:
|
|
1745
|
-
return /* @__PURE__ */ r.jsx("div", { className: "iw-space-y-4", children: /* @__PURE__ */ r.jsx(
|
|
1746
|
-
ze,
|
|
2176
|
+
case R.IDLE:
|
|
2177
|
+
return /* @__PURE__ */ t.jsxs("div", { className: "iw-text-center iw-flex iw-flex-col iw-items-center iw-justify-center iw-gap-2 iw-h-full", children: [
|
|
2178
|
+
/* @__PURE__ */ t.jsx("h3", { className: "iw-text-lg iw-font-semibold iw-text-gray-900 iw-mb-1", children: "Ready to start the Interview?" }),
|
|
2179
|
+
/* @__PURE__ */ t.jsx("p", { className: "iw-max-w-xl iw-text-gray-500 iw-text-xs iw-leading-[21px]", children: `You will be asked a series of behavioral and technical questions. For each one you'll get a short thinking period, then a timed recording window. We'll transcribe your response so you can review and edit it before submitting. Click "Start Interview" when you're ready.` }),
|
|
2180
|
+
/* @__PURE__ */ t.jsx(Z, { onClick: O, className: "iw-mt-2 iw-w-40", children: "Start Interview" })
|
|
2181
|
+
] });
|
|
2182
|
+
case R.FETCHING_QUESTION:
|
|
2183
|
+
return /* @__PURE__ */ t.jsx(st, {});
|
|
2184
|
+
case R.READING_QUESTION:
|
|
2185
|
+
return /* @__PURE__ */ t.jsx(ot, { ttsError: _ });
|
|
2186
|
+
case R.THINKING:
|
|
2187
|
+
return /* @__PURE__ */ t.jsx(
|
|
2188
|
+
ct,
|
|
1747
2189
|
{
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
isSubmitDisabled: !u.trim(),
|
|
1752
|
-
remainingTimeText: `${R.currentPhaseTimeRemaining}s remaining`
|
|
2190
|
+
state: L,
|
|
2191
|
+
thinkingTime: j,
|
|
2192
|
+
nextPhase: E
|
|
1753
2193
|
}
|
|
1754
|
-
)
|
|
1755
|
-
case
|
|
1756
|
-
return /* @__PURE__ */
|
|
1757
|
-
|
|
1758
|
-
/* @__PURE__ */ r.jsx("span", { className: "iw-text-sm iw-font-medium iw-text-green-700", children: "Submitting your answer..." })
|
|
1759
|
-
] }) }) });
|
|
1760
|
-
case l.COMPLETED:
|
|
1761
|
-
return /* @__PURE__ */ r.jsxs("div", { className: "iw-text-center iw-py-8", children: [
|
|
1762
|
-
/* @__PURE__ */ r.jsx("div", { className: "iw-mb-4", children: /* @__PURE__ */ r.jsx(
|
|
1763
|
-
"svg",
|
|
1764
|
-
{
|
|
1765
|
-
className: "iw-w-16 iw-h-16 iw-mx-auto iw-text-green-500",
|
|
1766
|
-
fill: "none",
|
|
1767
|
-
stroke: "currentColor",
|
|
1768
|
-
viewBox: "0 0 24 24",
|
|
1769
|
-
children: /* @__PURE__ */ r.jsx(
|
|
1770
|
-
"path",
|
|
1771
|
-
{
|
|
1772
|
-
strokeLinecap: "round",
|
|
1773
|
-
strokeLinejoin: "round",
|
|
1774
|
-
strokeWidth: 2,
|
|
1775
|
-
d: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"
|
|
1776
|
-
}
|
|
1777
|
-
)
|
|
1778
|
-
}
|
|
1779
|
-
) }),
|
|
1780
|
-
/* @__PURE__ */ r.jsx("h3", { className: "iw-text-xl iw-font-bold iw-text-gray-900 iw-mb-2", children: "Interview Complete!" }),
|
|
1781
|
-
/* @__PURE__ */ r.jsx("p", { className: "iw-text-gray-600", children: "Thank you for your time. Your answers have been recorded." })
|
|
1782
|
-
] });
|
|
1783
|
-
default:
|
|
1784
|
-
return null;
|
|
1785
|
-
}
|
|
1786
|
-
};
|
|
1787
|
-
return /* @__PURE__ */ r.jsx("div", { className: "interview-widget-container", children: /* @__PURE__ */ r.jsxs(
|
|
1788
|
-
"div",
|
|
1789
|
-
{
|
|
1790
|
-
className: ` iw-max-w-3xl iw-mx-auto iw-space-y-4 iw-py-8 ${e}`,
|
|
1791
|
-
children: [
|
|
1792
|
-
R.phase !== l.IDLE && R.phase !== l.COMPLETED && /* @__PURE__ */ r.jsx(
|
|
1793
|
-
Ye,
|
|
2194
|
+
);
|
|
2195
|
+
case R.ANSWERING:
|
|
2196
|
+
return /* @__PURE__ */ t.jsx(
|
|
2197
|
+
it,
|
|
1794
2198
|
{
|
|
1795
|
-
|
|
1796
|
-
|
|
2199
|
+
state: L,
|
|
2200
|
+
answeringTime: l,
|
|
2201
|
+
nextPhase: E,
|
|
2202
|
+
sttError: U
|
|
1797
2203
|
}
|
|
1798
|
-
)
|
|
1799
|
-
|
|
1800
|
-
/* @__PURE__ */
|
|
1801
|
-
|
|
2204
|
+
);
|
|
2205
|
+
case R.TRANSCRIBING:
|
|
2206
|
+
return /* @__PURE__ */ t.jsx(lt, { sttError: U });
|
|
2207
|
+
case R.EDITING:
|
|
2208
|
+
case R.SUBMITTING:
|
|
2209
|
+
return /* @__PURE__ */ t.jsx("div", { className: "iw-space-y-4 iw-h-full", children: /* @__PURE__ */ t.jsx(
|
|
2210
|
+
et,
|
|
1802
2211
|
{
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
2212
|
+
value: h,
|
|
2213
|
+
onChange: (F) => u(F.target.value),
|
|
2214
|
+
onSubmit: () => E(),
|
|
2215
|
+
isSubmitDisabled: !h.trim() || K,
|
|
2216
|
+
state: L,
|
|
2217
|
+
editingTime: p
|
|
1809
2218
|
}
|
|
1810
|
-
)
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
2219
|
+
) });
|
|
2220
|
+
case R.COMPLETED:
|
|
2221
|
+
return /* @__PURE__ */ t.jsx("div", { className: "iw-fixed iw-inset-0 iw-bg-white", children: /* @__PURE__ */ t.jsx(
|
|
2222
|
+
at,
|
|
1814
2223
|
{
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
Q(), k(!0);
|
|
1819
|
-
},
|
|
1820
|
-
children: "Start Interview"
|
|
2224
|
+
open: !0,
|
|
2225
|
+
onClose: r || (() => {
|
|
2226
|
+
})
|
|
1821
2227
|
}
|
|
1822
|
-
) })
|
|
1823
|
-
|
|
2228
|
+
) });
|
|
2229
|
+
default:
|
|
2230
|
+
return null;
|
|
1824
2231
|
}
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
onInterviewEnd: e,
|
|
1830
|
-
className: a = ""
|
|
1831
|
-
}) => {
|
|
1832
|
-
const [s, c] = y(!1), [n, o] = y(!0), m = D(null);
|
|
1833
|
-
if (!s)
|
|
1834
|
-
return /* @__PURE__ */ r.jsx("div", { className: "interview-widget-container", children: /* @__PURE__ */ r.jsx(
|
|
1835
|
-
Se,
|
|
2232
|
+
};
|
|
2233
|
+
return /* @__PURE__ */ t.jsxs("div", { className: "interview-widget-container", children: [
|
|
2234
|
+
/* @__PURE__ */ t.jsx(
|
|
2235
|
+
ht,
|
|
1836
2236
|
{
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
console.log("Permissions granted, starting interview"), c(!0), o(!1);
|
|
1840
|
-
}
|
|
2237
|
+
title: "Interview for Python Developer",
|
|
2238
|
+
onExit: B
|
|
1841
2239
|
}
|
|
1842
|
-
)
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
2240
|
+
),
|
|
2241
|
+
/* @__PURE__ */ t.jsxs(
|
|
2242
|
+
"div",
|
|
2243
|
+
{
|
|
2244
|
+
className: `iw-p-4 iw-space-y-4 iw-pb-6 ${e} iw-min-h-[calc(100vh_-_3.8rem)] iw-flex iw-flex-col iw-justify-between`,
|
|
2245
|
+
children: [
|
|
2246
|
+
/* @__PURE__ */ t.jsx("div", { className: "iw-flex iw-items-start iw-justify-between iw-gap-3", children: /* @__PURE__ */ t.jsx("div", { className: "iw-flex-1", children: /* @__PURE__ */ t.jsx(
|
|
2247
|
+
wt,
|
|
2248
|
+
{
|
|
2249
|
+
question: m,
|
|
2250
|
+
isLoading: L.phase === R.FETCHING_QUESTION || L.phase === R.IDLE
|
|
2251
|
+
}
|
|
2252
|
+
) }) }),
|
|
2253
|
+
/* @__PURE__ */ t.jsxs("div", { className: "iw iw-bg-[#F6F6F6] iw-grid iw-grid-cols-2 iw-rounded-xl iw-p-4", children: [
|
|
2254
|
+
/* @__PURE__ */ t.jsx("div", { className: "iw-min-h-[400px] iw-max-h-[600px]", children: /* @__PURE__ */ t.jsx(Xe, {}) }),
|
|
2255
|
+
/* @__PURE__ */ t.jsx("div", { className: "iw-bg-white iw-rounded-lg iw-shadow iw-p-6", children: re() })
|
|
2256
|
+
] })
|
|
2257
|
+
]
|
|
2258
|
+
}
|
|
2259
|
+
)
|
|
2260
|
+
] });
|
|
2261
|
+
}, gt = ({
|
|
2262
|
+
interviewId: i,
|
|
2263
|
+
onInterviewEnd: r,
|
|
2264
|
+
className: e = ""
|
|
2265
|
+
}) => {
|
|
2266
|
+
const [o, s] = ce.useState(!1), [c, a] = ce.useState(!0), n = S(null);
|
|
2267
|
+
return o ? /* @__PURE__ */ t.jsx("div", { className: "interview-widget-container", children: /* @__PURE__ */ t.jsx(
|
|
1847
2268
|
"div",
|
|
1848
2269
|
{
|
|
1849
|
-
ref:
|
|
1850
|
-
className: `iw-flex iw-flex-col iw-rounded-xl iw-shadow-lg iw-overflow-hidden iw-h-[calc(100vh-1rem)] ${
|
|
1851
|
-
children: /* @__PURE__ */
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
2270
|
+
ref: n,
|
|
2271
|
+
className: `iw-flex iw-flex-col iw-rounded-xl iw-shadow-lg iw-overflow-hidden iw-h-[calc(100vh-1rem)] ${e}`,
|
|
2272
|
+
children: /* @__PURE__ */ t.jsx("div", { className: " iw-h-full iw-flex iw-flex-col", children: /* @__PURE__ */ t.jsx(
|
|
2273
|
+
mt,
|
|
2274
|
+
{
|
|
2275
|
+
interviewId: i,
|
|
2276
|
+
className: e,
|
|
2277
|
+
onComplete: r || (() => {
|
|
2278
|
+
})
|
|
2279
|
+
}
|
|
2280
|
+
) })
|
|
2281
|
+
}
|
|
2282
|
+
) }) : /* @__PURE__ */ t.jsx("div", { className: "interview-widget-container", children: /* @__PURE__ */ t.jsx(
|
|
2283
|
+
Le,
|
|
2284
|
+
{
|
|
2285
|
+
isOpen: c,
|
|
2286
|
+
onStart: () => {
|
|
2287
|
+
console.log("Permissions granted, starting interview"), s(!0), a(!1);
|
|
2288
|
+
}
|
|
1863
2289
|
}
|
|
1864
2290
|
) });
|
|
1865
2291
|
};
|
|
1866
2292
|
typeof window < "u" && (window.InterviewWidget = {
|
|
1867
|
-
InterviewWidget:
|
|
1868
|
-
InterviewWidgetProvider:
|
|
2293
|
+
InterviewWidget: gt,
|
|
2294
|
+
InterviewWidgetProvider: Re
|
|
1869
2295
|
});
|
|
1870
2296
|
export {
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
2297
|
+
gt as InterviewWidget,
|
|
2298
|
+
Re as InterviewWidgetProvider,
|
|
2299
|
+
gt as default
|
|
1874
2300
|
};
|