interview-widget 1.0.5 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/widget.es.js CHANGED
@@ -1,9 +1,9 @@
1
- var qe = Object.defineProperty;
2
- var Be = (i, r, t) => r in i ? qe(i, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[r] = t;
3
- var F = (i, r, t) => Be(i, typeof r != "symbol" ? r + "" : r, t);
4
- import ge, { createContext as Te, useContext as ne, useSyncExternalStore as Ce, useRef as E, useCallback as T, useMemo as ee, useState as k, useEffect as C, forwardRef as We, useImperativeHandle as Ge } from "react";
5
- import { createPortal as Ve } from "react-dom";
6
- var Se = { exports: {} }, ae = {};
1
+ var We = Object.defineProperty;
2
+ var Ge = (i, r, t) => r in i ? We(i, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[r] = t;
3
+ var F = (i, r, t) => Ge(i, typeof r != "symbol" ? r + "" : r, t);
4
+ import xe, { createContext as Se, useContext as ae, useSyncExternalStore as Ie, useRef as E, useCallback as T, useMemo as ee, useState as k, useEffect as C, forwardRef as Ve, useImperativeHandle as ze } from "react";
5
+ import { createPortal as He } from "react-dom";
6
+ var Re = { exports: {} }, oe = {};
7
7
  /**
8
8
  * @license React
9
9
  * react-jsx-runtime.production.js
@@ -13,8 +13,8 @@ var Se = { exports: {} }, ae = {};
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 ze = Symbol.for("react.transitional.element"), He = Symbol.for("react.fragment");
17
- function Ie(i, r, t) {
16
+ var Ye = Symbol.for("react.transitional.element"), Qe = Symbol.for("react.fragment");
17
+ function Ae(i, r, t) {
18
18
  var s = null;
19
19
  if (t !== void 0 && (s = "" + t), r.key !== void 0 && (s = "" + r.key), "key" in r) {
20
20
  t = {};
@@ -22,19 +22,19 @@ function Ie(i, r, t) {
22
22
  n !== "key" && (t[n] = r[n]);
23
23
  } else t = r;
24
24
  return r = t.ref, {
25
- $$typeof: ze,
25
+ $$typeof: Ye,
26
26
  type: i,
27
27
  key: s,
28
28
  ref: r !== void 0 ? r : null,
29
29
  props: t
30
30
  };
31
31
  }
32
- ae.Fragment = He;
33
- ae.jsx = Ie;
34
- ae.jsxs = Ie;
35
- Se.exports = ae;
36
- var e = Se.exports;
37
- const $ = {
32
+ oe.Fragment = Qe;
33
+ oe.jsx = Ae;
34
+ oe.jsxs = Ae;
35
+ Re.exports = oe;
36
+ var e = Re.exports;
37
+ const me = {}, $ = {
38
38
  api: {
39
39
  baseUrl: "/api",
40
40
  retryConfig: {
@@ -65,25 +65,26 @@ const $ = {
65
65
  enabled: !0
66
66
  }
67
67
  }
68
- }, xe = "iw-storage";
69
- function Ye() {
70
- return typeof import.meta < "u" ? "your-secure-encryption-seed-here" : typeof process < "u" && process.env.NEXT_PUBLIC_IW_SECRET ? process.env.NEXT_PUBLIC_IW_SECRET : typeof window < "u" && window.__IW_SECRET__ ? window.__IW_SECRET__ : "proctoring-data-seed";
68
+ }, be = "iw-storage";
69
+ function Ke() {
70
+ if (!(typeof import.meta < "u" && (me != null && me.VITE_IW_SECRET)))
71
+ return typeof process < "u" && process.env.NEXT_PUBLIC_IW_SECRET ? process.env.NEXT_PUBLIC_IW_SECRET : typeof window < "u" && window.__IW_SECRET__ ? window.__IW_SECRET__ : "proctoring-data-seed";
71
72
  }
72
- const Re = Ye(), pe = "AES-GCM", fe = 12;
73
- async function Ae(i) {
73
+ const Me = Ke(), ye = "AES-GCM", pe = 12;
74
+ async function De(i) {
74
75
  const t = new TextEncoder().encode(i), s = await crypto.subtle.digest("SHA-256", t);
75
- return crypto.subtle.importKey("raw", s, pe, !1, [
76
+ return crypto.subtle.importKey("raw", s, ye, !1, [
76
77
  "encrypt",
77
78
  "decrypt"
78
79
  ]);
79
80
  }
80
- function Qe() {
81
- return crypto.getRandomValues(new Uint8Array(fe));
81
+ function Je() {
82
+ return crypto.getRandomValues(new Uint8Array(pe));
82
83
  }
83
- async function Ke(i, r = "default-seed") {
84
+ async function Xe(i, r = "default-seed") {
84
85
  try {
85
- const t = typeof i == "string" ? i : JSON.stringify(i), n = new TextEncoder().encode(t), o = await Ae(r), a = Qe(), l = await crypto.subtle.encrypt(
86
- { name: pe, iv: a },
86
+ const t = typeof i == "string" ? i : JSON.stringify(i), n = new TextEncoder().encode(t), o = await De(r), a = Je(), l = await crypto.subtle.encrypt(
87
+ { name: ye, iv: a },
87
88
  o,
88
89
  n
89
90
  ), w = new Uint8Array(a.length + l.byteLength);
@@ -92,13 +93,13 @@ async function Ke(i, r = "default-seed") {
92
93
  throw console.error("Encryption failed:", t), new Error("Failed to encrypt data");
93
94
  }
94
95
  }
95
- async function Je(i, r = "default-seed") {
96
+ async function Ze(i, r = "default-seed") {
96
97
  try {
97
98
  const t = atob(i), s = new Uint8Array(t.length);
98
99
  for (let d = 0; d < t.length; d++)
99
100
  s[d] = t.charCodeAt(d);
100
- const n = s.slice(0, fe), o = s.slice(fe), a = await Ae(r), l = await crypto.subtle.decrypt(
101
- { name: pe, iv: n },
101
+ const n = s.slice(0, pe), o = s.slice(pe), a = await De(r), l = await crypto.subtle.decrypt(
102
+ { name: ye, iv: n },
102
103
  a,
103
104
  o
104
105
  );
@@ -107,23 +108,23 @@ async function Je(i, r = "default-seed") {
107
108
  throw console.error("Decryption failed:", t), new Error("Failed to decrypt data");
108
109
  }
109
110
  }
110
- async function Xe(i, r = "default-seed") {
111
- return Ke(i, r);
111
+ async function et(i, r = "default-seed") {
112
+ return Xe(i, r);
112
113
  }
113
- async function Ze(i, r = "default-seed") {
114
- const t = await Je(i, r);
114
+ async function tt(i, r = "default-seed") {
115
+ const t = await Ze(i, r);
115
116
  try {
116
117
  return JSON.parse(t);
117
118
  } catch {
118
119
  return t;
119
120
  }
120
121
  }
121
- const oe = Te(null), et = async () => {
122
+ const le = Se(null), it = async () => {
122
123
  var i, r;
123
124
  try {
124
- const t = sessionStorage.getItem(xe);
125
+ const t = sessionStorage.getItem(be);
125
126
  if (t) {
126
- const s = await Ze(t, Re);
127
+ const s = await tt(t, Me);
127
128
  return {
128
129
  logViolations: ((i = s.state) == null ? void 0 : i.logViolations) || [],
129
130
  totalViolations: ((r = s.state) == null ? void 0 : r.totalViolations) || 0
@@ -136,28 +137,28 @@ const oe = Te(null), et = async () => {
136
137
  );
137
138
  }
138
139
  return { logViolations: [], totalViolations: 0 };
139
- }, je = async (i) => {
140
+ }, ke = async (i) => {
140
141
  try {
141
- const r = await Xe(
142
+ const r = await et(
142
143
  {
143
144
  state: i,
144
145
  version: 0
145
146
  },
146
- Re
147
+ Me
147
148
  );
148
- sessionStorage.setItem(xe, r);
149
+ sessionStorage.setItem(be, r);
149
150
  } catch (r) {
150
151
  console.error("Failed to save proctoring data to session storage:", r);
151
152
  }
152
- }, tt = ({
153
+ }, rt = ({
153
154
  children: i
154
155
  }) => {
155
156
  const r = E({
156
157
  logViolations: [],
157
158
  totalViolations: 0
158
159
  }), t = E(/* @__PURE__ */ new Set());
159
- ge.useEffect(() => {
160
- et().then((d) => {
160
+ xe.useEffect(() => {
161
+ it().then((d) => {
161
162
  r.current = d, s();
162
163
  });
163
164
  }, []);
@@ -170,14 +171,14 @@ const oe = Te(null), et = async () => {
170
171
  r.current = {
171
172
  logViolations: [...r.current.logViolations, d],
172
173
  totalViolations: r.current.totalViolations + 1
173
- }, je(r.current), s();
174
+ }, ke(r.current), s();
174
175
  },
175
176
  [s]
176
177
  ), l = T(() => {
177
178
  r.current = {
178
179
  logViolations: [],
179
180
  totalViolations: 0
180
- }, je(r.current), s();
181
+ }, ke(r.current), s();
181
182
  }, [s]), w = ee(
182
183
  () => ({
183
184
  getState: o,
@@ -187,29 +188,29 @@ const oe = Te(null), et = async () => {
187
188
  }),
188
189
  [o, a, l, n]
189
190
  );
190
- return /* @__PURE__ */ e.jsx(oe.Provider, { value: w, children: i });
191
- }, it = () => {
192
- const i = ne(oe);
191
+ return /* @__PURE__ */ e.jsx(le.Provider, { value: w, children: i });
192
+ }, st = () => {
193
+ const i = ae(le);
193
194
  if (!i)
194
195
  throw new Error("useViolations must be used within a ProctoringProvider");
195
- return Ce(
196
+ return Ie(
196
197
  i.subscribe,
197
198
  () => i.getState().logViolations,
198
199
  () => i.getState().logViolations
199
200
  );
200
- }, rt = () => {
201
- const i = ne(oe);
201
+ }, nt = () => {
202
+ const i = ae(le);
202
203
  if (!i)
203
204
  throw new Error(
204
205
  "useTotalViolations must be used within a ProctoringProvider"
205
206
  );
206
- return Ce(
207
+ return Ie(
207
208
  i.subscribe,
208
209
  () => i.getState().totalViolations,
209
210
  () => i.getState().totalViolations
210
211
  );
211
- }, st = () => {
212
- const i = ne(oe);
212
+ }, at = () => {
213
+ const i = ae(le);
213
214
  if (!i)
214
215
  throw new Error(
215
216
  "useProctoringActions must be used within a ProctoringProvider"
@@ -218,10 +219,10 @@ const oe = Te(null), et = async () => {
218
219
  addViolation: i.addViolation,
219
220
  clearViolations: i.clearViolations
220
221
  };
221
- }, Me = Te(
222
+ }, _e = Se(
222
223
  null
223
224
  );
224
- function nt({
225
+ function ot({
225
226
  config: i = {},
226
227
  children: r
227
228
  }) {
@@ -256,26 +257,26 @@ function nt({
256
257
  }
257
258
  }
258
259
  };
259
- return /* @__PURE__ */ e.jsx(Me.Provider, { value: t, children: /* @__PURE__ */ e.jsx(tt, { children: r }) });
260
+ return /* @__PURE__ */ e.jsx(_e.Provider, { value: t, children: /* @__PURE__ */ e.jsx(rt, { children: r }) });
260
261
  }
261
- function le() {
262
- const i = ne(Me);
262
+ function ce() {
263
+ const i = ae(_e);
263
264
  if (!i)
264
265
  throw new Error(
265
266
  "useInterviewConfig must be used within an InterviewWidgetProvider. Wrap your component tree with <InterviewWidgetProvider config={...}>"
266
267
  );
267
268
  return i;
268
269
  }
269
- function De() {
270
- return le().api || $.api;
270
+ function Pe() {
271
+ return ce().api || $.api;
271
272
  }
272
273
  function te() {
273
- return le().ui || $.ui;
274
+ return ce().ui || $.ui;
274
275
  }
275
- function at() {
276
- return le().interview || $.interview;
276
+ function lt() {
277
+ return ce().interview || $.interview;
277
278
  }
278
- const _e = ({
279
+ const Fe = ({
279
280
  className: i,
280
281
  ...r
281
282
  }) => /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs(
@@ -304,7 +305,7 @@ const _e = ({
304
305
  /* @__PURE__ */ e.jsx("path", { d: "M7.75 7.75l-2.15 -2.15" })
305
306
  ]
306
307
  }
307
- ) }), Pe = ({
308
+ ) }), Le = ({
308
309
  children: i,
309
310
  variant: r = "primary",
310
311
  size: t = "md",
@@ -332,13 +333,13 @@ const _e = ({
332
333
  disabled: o || n,
333
334
  ...l,
334
335
  children: [
335
- n && /* @__PURE__ */ e.jsx(_e, { height: 16, width: 16, style: { marginRight: "3px" } }),
336
+ n && /* @__PURE__ */ e.jsx(Fe, { height: 16, width: 16, style: { marginRight: "3px" } }),
336
337
  i
337
338
  ]
338
339
  }
339
340
  );
340
341
  };
341
- function ot(i) {
342
+ function ct(i) {
342
343
  const r = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(i);
343
344
  return r ? {
344
345
  r: parseInt(r[1], 16),
@@ -346,32 +347,32 @@ function ot(i) {
346
347
  b: parseInt(r[3], 16)
347
348
  } : null;
348
349
  }
349
- function lt(i, r, t) {
350
+ function dt(i, r, t) {
350
351
  return "#" + [i, r, t].map((s) => {
351
352
  const n = Math.round(s).toString(16);
352
353
  return n.length === 1 ? "0" + n : n;
353
354
  }).join("");
354
355
  }
355
- function Fe(i, r) {
356
- const t = ot(i);
356
+ function $e(i, r) {
357
+ const t = ct(i);
357
358
  if (!t) return i;
358
359
  const s = t.r + (255 - t.r) * r, n = t.g + (255 - t.g) * r, o = t.b + (255 - t.b) * r;
359
- return lt(s, n, o);
360
+ return dt(s, n, o);
360
361
  }
361
- function ct(i, r = 0.8) {
362
+ function wt(i, r = 0.8) {
362
363
  return {
363
- background: `linear-gradient(to bottom, ${Fe(i, r)}, #ffffff)`,
364
+ background: `linear-gradient(to bottom, ${$e(i, r)}, #ffffff)`,
364
365
  color: "#1f2937"
365
366
  };
366
367
  }
367
- function dt(i) {
368
+ function ut(i) {
368
369
  return new Promise((r) => setTimeout(r, i));
369
370
  }
370
- function Le(i) {
371
- return `linear-gradient(to left, ${Fe(i, 0.4)}, ${i})`;
371
+ function Oe(i) {
372
+ return `linear-gradient(to left, ${$e(i, 0.4)}, ${i})`;
372
373
  }
373
- const wt = () => Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
374
- function ut(i) {
374
+ const ht = () => Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
375
+ function mt(i) {
375
376
  try {
376
377
  const r = i.split(".");
377
378
  if (r.length !== 3 || !r[1])
@@ -385,7 +386,7 @@ function ut(i) {
385
386
  return console.error("Error decoding JWT:", r), null;
386
387
  }
387
388
  }
388
- const $e = (i) => /* @__PURE__ */ e.jsxs(
389
+ const qe = (i) => /* @__PURE__ */ e.jsxs(
389
390
  "svg",
390
391
  {
391
392
  xmlns: "http://www.w3.org/2000/svg",
@@ -403,7 +404,7 @@ const $e = (i) => /* @__PURE__ */ e.jsxs(
403
404
  /* @__PURE__ */ e.jsx("path", { d: "m9 12 2 2 4-4" })
404
405
  ]
405
406
  }
406
- ), Oe = (i) => /* @__PURE__ */ e.jsxs(
407
+ ), Ue = (i) => /* @__PURE__ */ e.jsxs(
407
408
  "svg",
408
409
  {
409
410
  xmlns: "http://www.w3.org/2000/svg",
@@ -422,7 +423,7 @@ const $e = (i) => /* @__PURE__ */ e.jsxs(
422
423
  /* @__PURE__ */ e.jsx("line", { x1: "12", x2: "12", y1: "17", y2: "21" })
423
424
  ]
424
425
  }
425
- ), ht = (i) => /* @__PURE__ */ e.jsxs(
426
+ ), gt = (i) => /* @__PURE__ */ e.jsxs(
426
427
  "svg",
427
428
  {
428
429
  xmlns: "http://www.w3.org/2000/svg",
@@ -444,29 +445,29 @@ const $e = (i) => /* @__PURE__ */ e.jsxs(
444
445
  ), V = (i) => {
445
446
  const { baseColor: r, borderRadius: t } = te(), { loading: s, children: n, ...o } = i;
446
447
  return /* @__PURE__ */ e.jsx(
447
- Pe,
448
+ Le,
448
449
  {
449
450
  style: {
450
- background: Le(r),
451
+ background: Oe(r),
451
452
  borderRadius: t
452
453
  },
453
454
  ...o,
454
- children: s ? /* @__PURE__ */ e.jsx(_e, {}) : n
455
+ children: s ? /* @__PURE__ */ e.jsx(Fe, {}) : n
455
456
  }
456
457
  );
457
- }, mt = [
458
+ }, ft = [
458
459
  "Do not refresh or reload the page during your assessment",
459
460
  "Refrain from switching tabs or opening other applications while the session is in progress",
460
461
  "Ensure your face remains clearly visible on camera at all times",
461
462
  "Avoid frequent distractions or leaving your seat during the session",
462
463
  "Do not disable or interfere with audio/video monitoring"
463
- ], gt = ({
464
+ ], xt = ({
464
465
  isOpen: i,
465
466
  onStart: r,
466
467
  onClose: t
467
468
  }) => {
468
469
  var A;
469
- const s = E(null), n = E(null), { baseColor: o, borderRadius: a } = te(), [l, w] = k(!1), [d, u] = k(null), [h, m] = k(!1), c = o ?? "#2563eb", x = Le(c), b = a ?? 18, j = (f, M) => f.startsWith("#") && f.length === 7 ? `${f}${M}` : f, g = [
470
+ const s = E(null), n = E(null), { baseColor: o, borderRadius: a } = te(), [l, w] = k(!1), [d, u] = k(null), [h, m] = k(!1), c = o ?? "#2563eb", x = Oe(c), p = a ?? 18, j = (f, M) => f.startsWith("#") && f.length === 7 ? `${f}${M}` : f, g = [
470
471
  `radial-gradient(120% 85% at 50% 125%, ${j(
471
472
  c,
472
473
  "34"
@@ -486,7 +487,7 @@ const $e = (i) => /* @__PURE__ */ e.jsxs(
486
487
  c,
487
488
  "14"
488
489
  )} 16px, transparent 16px, transparent 32px)`
489
- ].join(", "), v = l ? {
490
+ ].join(", "), y = l ? {
490
491
  label: "Camera & microphone ready",
491
492
  toneClass: "iw-bg-white/15 iw-text-white",
492
493
  dotClass: "iw-bg-emerald-400"
@@ -519,18 +520,18 @@ const $e = (i) => /* @__PURE__ */ e.jsxs(
519
520
  description: S.cameraCopy,
520
521
  status: S.badge,
521
522
  toneClass: S.toneClass,
522
- Icon: Oe
523
+ Icon: Ue
523
524
  },
524
525
  {
525
526
  label: "Microphone input",
526
527
  description: S.micCopy,
527
528
  status: S.badge,
528
529
  toneClass: S.toneClass,
529
- Icon: ht
530
+ Icon: gt
530
531
  }
531
532
  ], _ = () => {
532
533
  n.current && (n.current.getTracks().forEach((f) => f.stop()), n.current = null);
533
- }, y = async () => {
534
+ }, v = async () => {
534
535
  m(!0), u(null);
535
536
  try {
536
537
  const f = await navigator.mediaDevices.getUserMedia({
@@ -551,7 +552,7 @@ const $e = (i) => /* @__PURE__ */ e.jsxs(
551
552
  _();
552
553
  return;
553
554
  }
554
- return y(), () => {
555
+ return v(), () => {
555
556
  _();
556
557
  };
557
558
  }, [i]), !i) return null;
@@ -597,7 +598,7 @@ const $e = (i) => /* @__PURE__ */ e.jsxs(
597
598
  ),
598
599
  /* @__PURE__ */ e.jsxs("div", { className: "iw-relative iw-grid md:iw-grid-cols-[minmax(0,1fr)_auto] iw-items-start iw-gap-6 iw-px-6 iw-py-7", children: [
599
600
  /* @__PURE__ */ e.jsx("div", { className: "iw-flex iw-flex-col iw-gap-4 iw-text-white", children: /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-start iw-gap-4", children: [
600
- /* @__PURE__ */ e.jsx("div", { className: "iw-flex iw-h-12 iw-w-12 iw-items-center iw-justify-center iw-rounded-2xl iw-bg-white/15 iw-shadow-inner", children: /* @__PURE__ */ e.jsx($e, { className: "iw-h-6 iw-w-6" }) }),
601
+ /* @__PURE__ */ e.jsx("div", { className: "iw-flex iw-h-12 iw-w-12 iw-items-center iw-justify-center iw-rounded-2xl iw-bg-white/15 iw-shadow-inner", children: /* @__PURE__ */ e.jsx(qe, { className: "iw-h-6 iw-w-6" }) }),
601
602
  /* @__PURE__ */ e.jsxs("div", { children: [
602
603
  /* @__PURE__ */ e.jsx("p", { className: "iw-text-[11px] iw-font-medium iw-uppercase iw-tracking-wide iw-text-white/70", children: "Pre-interview checklist" }),
603
604
  /* @__PURE__ */ e.jsx("h2", { className: "iw-mt-1 iw-text-xl iw-font-semibold iw-leading-tight", children: "Final checks before you go live" }),
@@ -607,15 +608,15 @@ const $e = (i) => /* @__PURE__ */ e.jsxs(
607
608
  /* @__PURE__ */ e.jsx("div", { className: "iw-flex iw-items-start iw-justify-end", children: /* @__PURE__ */ e.jsxs(
608
609
  "div",
609
610
  {
610
- className: `iw-inline-flex iw-items-center iw-gap-2 iw-rounded-full iw-bg-white/10 iw-px-4 iw-py-1.5 iw-text-xs iw-font-medium iw-text-white/85 iw-backdrop-blur-sm ${v.toneClass}`,
611
+ className: `iw-inline-flex iw-items-center iw-gap-2 iw-rounded-full iw-bg-white/10 iw-px-4 iw-py-1.5 iw-text-xs iw-font-medium iw-text-white/85 iw-backdrop-blur-sm ${y.toneClass}`,
611
612
  children: [
612
613
  /* @__PURE__ */ e.jsx(
613
614
  "span",
614
615
  {
615
- className: `iw-inline-flex iw-h-2 iw-w-2 iw-rounded-full ${v.dotClass}`
616
+ className: `iw-inline-flex iw-h-2 iw-w-2 iw-rounded-full ${y.dotClass}`
616
617
  }
617
618
  ),
618
- v.label
619
+ y.label
619
620
  ]
620
621
  }
621
622
  ) }),
@@ -641,7 +642,7 @@ const $e = (i) => /* @__PURE__ */ e.jsxs(
641
642
  /* @__PURE__ */ e.jsx("h3", { className: "iw-text-sm iw-font-semibold iw-text-slate-900", children: "Proctoring guidelines" }),
642
643
  /* @__PURE__ */ e.jsx("span", { className: "iw-text-[11px] iw-font-medium iw-uppercase iw-tracking-wide iw-text-slate-400", children: "Required" })
643
644
  ] }),
644
- /* @__PURE__ */ e.jsx("ul", { className: "iw-mt-5 iw-flex iw-flex-col iw-gap-4", children: mt.map((f, M) => /* @__PURE__ */ e.jsx(
645
+ /* @__PURE__ */ e.jsx("ul", { className: "iw-mt-5 iw-flex iw-flex-col iw-gap-4", children: ft.map((f, M) => /* @__PURE__ */ e.jsx(
645
646
  "li",
646
647
  {
647
648
  className: "iw-group iw-overflow-hidden iw-rounded-xl iw-border iw-border-slate-100 iw-bg-slate-50/60 iw-p-4 iw-transition-all hover:iw-border-slate-200 hover:iw-bg-white",
@@ -665,7 +666,7 @@ const $e = (i) => /* @__PURE__ */ e.jsxs(
665
666
  "div",
666
667
  {
667
668
  className: "iw-relative iw-flex iw-flex-col iw-gap-6 iw-overflow-hidden iw-rounded-3xl iw-bg-white ",
668
- style: { borderRadius: b },
669
+ style: { borderRadius: p },
669
670
  children: [
670
671
  /* @__PURE__ */ e.jsx("div", { className: "iw-relative iw-z-10 iw-rounded-2xl iw-border iw-border-slate-200 iw-bg-slate-50/80 iw-p-3", children: /* @__PURE__ */ e.jsx(
671
672
  "video",
@@ -677,22 +678,22 @@ const $e = (i) => /* @__PURE__ */ e.jsxs(
677
678
  className: "iw-h-64 iw-w-full iw-rounded-2xl iw-object-cover",
678
679
  style: {
679
680
  transform: "scaleX(-1)",
680
- borderRadius: b
681
+ borderRadius: p
681
682
  }
682
683
  }
683
684
  ) }),
684
685
  /* @__PURE__ */ e.jsxs("div", { className: "iw-relative iw-grid iw-grid-cols-2 iw-gap-4 iw-px-1", children: [
685
686
  /* @__PURE__ */ e.jsx(
686
- Pe,
687
+ Le,
687
688
  {
688
- onClick: y,
689
+ onClick: v,
689
690
  disabled: h,
690
691
  variant: "outline",
691
692
  size: "sm",
692
693
  className: "iw-font-medium",
693
694
  style: {
694
695
  borderColor: c,
695
- borderRadius: b,
696
+ borderRadius: p,
696
697
  color: c
697
698
  },
698
699
  children: l ? "Recheck permissions" : "Enable camera & mic"
@@ -715,7 +716,7 @@ const $e = (i) => /* @__PURE__ */ e.jsxs(
715
716
  }
716
717
  ),
717
718
  /* @__PURE__ */ e.jsx("ul", { className: "iw-grid sm:iw-grid-cols-1 iw-gap-3", children: N.map(
718
- ({ Icon: f, label: M, description: L, status: O, toneClass: q }) => /* @__PURE__ */ e.jsx(
719
+ ({ Icon: f, label: M, description: L, status: O, toneClass: U }) => /* @__PURE__ */ e.jsx(
719
720
  "li",
720
721
  {
721
722
  className: "iw-rounded-2xl iw-border iw-border-slate-200/65 iw-bg-white iw-p-4 iw-shadow-sm iw-transition-all hover:iw-border-slate-200",
@@ -727,7 +728,7 @@ const $e = (i) => /* @__PURE__ */ e.jsxs(
727
728
  /* @__PURE__ */ e.jsx(
728
729
  "span",
729
730
  {
730
- className: `iw-rounded-full iw-px-3 iw-py-1 iw-text-[11px] iw-font-semibold ${q}`,
731
+ className: `iw-rounded-full iw-px-3 iw-py-1 iw-text-[11px] iw-font-semibold ${U}`,
731
732
  children: O
732
733
  }
733
734
  )
@@ -765,11 +766,11 @@ const $e = (i) => /* @__PURE__ */ e.jsxs(
765
766
  ] }) });
766
767
  };
767
768
  var D = /* @__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))(D || {});
768
- const ft = {
769
+ const pt = {
769
770
  thinkingDuration: 30,
770
771
  answeringDuration: 120,
771
772
  editingDuration: 30
772
- }, xt = {
773
+ }, bt = {
773
774
  idle: {
774
775
  next: "fetching_question"
775
776
  /* FETCHING_QUESTION */
@@ -798,14 +799,14 @@ const ft = {
798
799
  /* COMPLETED */
799
800
  }
800
801
  };
801
- class pt {
802
+ class yt {
802
803
  constructor(r = {}, t = {}) {
803
804
  F(this, "config");
804
805
  F(this, "state");
805
806
  F(this, "phaseIntervalId", null);
806
807
  F(this, "globalIntervalId", null);
807
808
  F(this, "callbacks");
808
- this.config = { ...ft, ...r }, this.callbacks = t, this.state = {
809
+ this.config = { ...pt, ...r }, this.callbacks = t, this.state = {
809
810
  phase: "idle",
810
811
  currentPhaseTimeRemaining: 0,
811
812
  totalTimeElapsed: 0,
@@ -828,7 +829,7 @@ class pt {
828
829
  * Move to next phase
829
830
  */
830
831
  nextPhase() {
831
- const r = this.state.phase, t = xt[r];
832
+ const r = this.state.phase, t = bt[r];
832
833
  if (!t) return;
833
834
  this.stopPhaseTimer(), this.state.phase = t.next;
834
835
  const s = this.getDurationForPhase(t.next);
@@ -899,9 +900,9 @@ class pt {
899
900
  (t = (r = this.callbacks).onPhaseChange) == null || t.call(r, this.state.phase, this.getState());
900
901
  }
901
902
  }
902
- function bt(i = {}) {
903
+ function vt(i = {}) {
903
904
  const { config: r = {}, callbacks: t = {} } = i, s = E(null);
904
- s.current || (s.current = new pt(r, {}));
905
+ s.current || (s.current = new yt(r, {}));
905
906
  const n = s.current, [o, a] = k(n.getState()), l = T(() => {
906
907
  a(n.getState());
907
908
  }, [n]);
@@ -939,7 +940,7 @@ function bt(i = {}) {
939
940
  timerService: n
940
941
  };
941
942
  }
942
- function yt(i, r = {}) {
943
+ function jt(i, r = {}) {
943
944
  const [t, s] = k({
944
945
  data: null,
945
946
  loading: !1,
@@ -978,17 +979,17 @@ function yt(i, r = {}) {
978
979
  execute: n
979
980
  };
980
981
  }
981
- const vt = (i) => {
982
+ const Nt = (i) => {
982
983
  const [r, t] = k(null), [s, n] = k(!1), o = document, a = () => !!(o.fullscreenEnabled || o.webkitFullscreenEnabled || o.mozFullScreenEnabled || o.msFullscreenEnabled), l = () => o.fullscreenElement || o.webkitFullscreenElement || o.mozFullScreenElement || o.msFullscreenElement, w = async (c) => {
983
984
  var x;
984
985
  try {
985
986
  if (!a())
986
987
  throw new Error("Fullscreen is not supported in this environment");
987
988
  c.requestFullscreen ? await c.requestFullscreen() : c.webkitRequestFullscreen ? await c.webkitRequestFullscreen() : c.mozRequestFullScreen ? await c.mozRequestFullScreen() : c.msRequestFullscreen && await c.msRequestFullscreen();
988
- } catch (b) {
989
+ } catch (p) {
989
990
  const j = {
990
991
  name: "FullscreenError",
991
- message: b instanceof Error ? b.message : "Failed to enter fullscreen"
992
+ message: p instanceof Error ? p.message : "Failed to enter fullscreen"
992
993
  };
993
994
  t(j), (x = i == null ? void 0 : i.onError) == null || x.call(i, j);
994
995
  }
@@ -997,11 +998,11 @@ const vt = (i) => {
997
998
  try {
998
999
  o.exitFullscreen ? await o.exitFullscreen() : o.webkitExitFullscreen ? await o.webkitExitFullscreen() : o.mozCancelFullScreen ? await o.mozCancelFullScreen() : o.msExitFullscreen && await o.msExitFullscreen();
999
1000
  } catch (x) {
1000
- const b = {
1001
+ const p = {
1001
1002
  name: "FullscreenError",
1002
1003
  message: x instanceof Error ? x.message : "Failed to exit fullscreen"
1003
1004
  };
1004
- t(b), (c = i == null ? void 0 : i.onError) == null || c.call(i, b);
1005
+ t(p), (c = i == null ? void 0 : i.onError) == null || c.call(i, p);
1005
1006
  }
1006
1007
  }, u = T(() => {
1007
1008
  var x;
@@ -1038,7 +1039,7 @@ const vt = (i) => {
1038
1039
  error: r
1039
1040
  };
1040
1041
  };
1041
- function jt(i) {
1042
+ function kt(i) {
1042
1043
  var r;
1043
1044
  if (!navigator.onLine)
1044
1045
  return {
@@ -1097,7 +1098,7 @@ function jt(i) {
1097
1098
  originalError: i
1098
1099
  };
1099
1100
  }
1100
- async function be(i, r = {}, t = {
1101
+ async function ve(i, r = {}, t = {
1101
1102
  attempts: 3,
1102
1103
  backoff: "exponential",
1103
1104
  baseDelay: 1e3,
@@ -1118,10 +1119,10 @@ async function be(i, r = {}, t = {
1118
1119
  return l;
1119
1120
  } catch (o) {
1120
1121
  s = o;
1121
- const a = jt(o);
1122
+ const a = kt(o);
1122
1123
  if (!a.retryable || n === t.attempts)
1123
1124
  throw a;
1124
- const l = Nt(n, t);
1125
+ const l = Et(n, t);
1125
1126
  console.warn(
1126
1127
  `API request failed (attempt ${n}/${t.attempts}), retrying in ${l}ms:`,
1127
1128
  a.message
@@ -1129,11 +1130,11 @@ async function be(i, r = {}, t = {
1129
1130
  }
1130
1131
  throw s;
1131
1132
  }
1132
- function Nt(i, r) {
1133
+ function Et(i, r) {
1133
1134
  let t;
1134
1135
  return r.backoff === "exponential" ? t = r.baseDelay * Math.pow(2, i - 1) : t = r.baseDelay, t = Math.min(t, r.maxDelay), r.jitter && (t = t * (0.5 + Math.random() * 0.5)), Math.round(t);
1135
1136
  }
1136
- class kt {
1137
+ class Tt {
1137
1138
  constructor(r = {}) {
1138
1139
  F(this, "config");
1139
1140
  this.config = r;
@@ -1172,7 +1173,7 @@ class kt {
1172
1173
  answer: o,
1173
1174
  answerDuration: a
1174
1175
  }) {
1175
- const l = await be(
1176
+ const l = await ve(
1176
1177
  `${this.getBaseUrl()}/questions/next`,
1177
1178
  {
1178
1179
  method: "POST",
@@ -1193,14 +1194,14 @@ class kt {
1193
1194
  return await l.json();
1194
1195
  }
1195
1196
  }
1196
- function Et() {
1197
- const i = le();
1197
+ function Ct() {
1198
+ const i = ce();
1198
1199
  return ee(() => {
1199
1200
  const t = i.api || {};
1200
- return new kt(t);
1201
+ return new Tt(t);
1201
1202
  }, [i.api]);
1202
1203
  }
1203
- const Tt = (i) => {
1204
+ const St = (i) => {
1204
1205
  C(() => {
1205
1206
  const r = (s) => {
1206
1207
  (s.ctrlKey || s.metaKey) && ["c", "v", "a", "t", "n", "w", "r", "s", "p"].includes(s.key.toLowerCase()) && (s.preventDefault(), i({
@@ -1245,7 +1246,7 @@ class I extends Error {
1245
1246
  super(r), this.code = t, this.recoverable = s, this.name = "STTError";
1246
1247
  }
1247
1248
  }
1248
- class Ct {
1249
+ class It {
1249
1250
  constructor(r = {}) {
1250
1251
  F(this, "config");
1251
1252
  F(this, "mediaRecorder", null);
@@ -1392,8 +1393,8 @@ class Ct {
1392
1393
  const l = new FormData(), w = new File([t], "recording.wav", {
1393
1394
  type: t.type || "audio/wav"
1394
1395
  });
1395
- l.append("file", w), l.append("model", s || "whisper-large-v3-turbo"), l.append("language", n || "en"), l.append("include_timestamps", String(o || !1)), l.append("temperature", String(a || 0));
1396
- const d = await be(
1396
+ l.append("file", w), l.append("model", s || "whisper-large-v3-turbo"), l.append("language", n || "en"), l.append("include_timestamps", String(o || !1)), l.append("temperature", String(a || 0)), l.append("qna_id", this.config.qnaId || "");
1397
+ const d = await ve(
1397
1398
  `${this.config.baseUrl}/speech/transcribe`,
1398
1399
  {
1399
1400
  method: "POST",
@@ -1475,13 +1476,13 @@ class Ct {
1475
1476
  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);
1476
1477
  }
1477
1478
  }
1478
- const Z = new Ct(), St = (i = {}) => {
1479
+ const Z = new It(), Rt = (i = {}) => {
1479
1480
  const [r, t] = k(!1), [s, n] = k(!1), [o, a] = k(null), [l, w] = k(null), [d, u] = k(null);
1480
1481
  i.config && Z.updateConfig(i.config);
1481
- const h = T(async (b) => {
1482
+ const h = T(async (p) => {
1482
1483
  var j;
1483
1484
  try {
1484
- w(null), a(null), u(null), await Z.startRecording(b, {
1485
+ w(null), a(null), u(null), await Z.startRecording(p, {
1485
1486
  onStart: () => {
1486
1487
  var g;
1487
1488
  t(!0), (g = i.onStart) == null || g.call(i);
@@ -1492,38 +1493,38 @@ const Z = new Ct(), St = (i = {}) => {
1492
1493
  },
1493
1494
  onError: (g) => {
1494
1495
  var S;
1495
- const v = g instanceof I ? g : new I(g.message, "RECORDING_ERROR", !0);
1496
- w(v), t(!1), (S = i.onError) == null || S.call(i, v);
1496
+ const y = g instanceof I ? g : new I(g.message, "RECORDING_ERROR", !0);
1497
+ w(y), t(!1), (S = i.onError) == null || S.call(i, y);
1497
1498
  }
1498
1499
  });
1499
1500
  } catch (g) {
1500
- const v = g instanceof I ? g : new I(
1501
+ const y = g instanceof I ? g : new I(
1501
1502
  g instanceof Error ? g.message : String(g),
1502
1503
  "START_FAILED",
1503
1504
  !1
1504
1505
  );
1505
- throw w(v), t(!1), (j = i.onError) == null || j.call(i, v), v;
1506
+ throw w(y), t(!1), (j = i.onError) == null || j.call(i, y), y;
1506
1507
  }
1507
1508
  }, []), m = T(async () => {
1508
- var b, j;
1509
+ var p, j;
1509
1510
  try {
1510
1511
  const g = await Z.stopRecording();
1511
- return u(g), t(!1), (b = i.onStop) == null || b.call(i), g;
1512
+ return u(g), t(!1), (p = i.onStop) == null || p.call(i), g;
1512
1513
  } catch (g) {
1513
- const v = g instanceof I ? g : new I(
1514
+ const y = g instanceof I ? g : new I(
1514
1515
  g instanceof Error ? g.message : String(g),
1515
1516
  "STOP_FAILED",
1516
1517
  !1
1517
1518
  );
1518
- throw w(v), t(!1), (j = i.onError) == null || j.call(i, v), v;
1519
+ throw w(y), t(!1), (j = i.onError) == null || j.call(i, y), y;
1519
1520
  }
1520
1521
  }, []), c = T(
1521
- async (b, j = {}) => {
1522
- var g, v;
1522
+ async (p, j = {}) => {
1523
+ var g, y;
1523
1524
  try {
1524
1525
  w(null), n(!0);
1525
1526
  const S = {
1526
- audioBlob: b,
1527
+ audioBlob: p,
1527
1528
  ...j
1528
1529
  }, N = await Z.transcribe(S);
1529
1530
  return a(N.transcript), n(!1), (g = i.onTranscriptionComplete) == null || g.call(i, N), N;
@@ -1533,7 +1534,7 @@ const Z = new Ct(), St = (i = {}) => {
1533
1534
  "TRANSCRIPTION_FAILED",
1534
1535
  !0
1535
1536
  );
1536
- throw w(N), n(!1), (v = i.onError) == null || v.call(i, N), N;
1537
+ throw w(N), n(!1), (y = i.onError) == null || y.call(i, N), N;
1537
1538
  }
1538
1539
  },
1539
1540
  []
@@ -1551,7 +1552,7 @@ const Z = new Ct(), St = (i = {}) => {
1551
1552
  error: l,
1552
1553
  audioBlob: d
1553
1554
  };
1554
- }, It = (i) => {
1555
+ }, At = (i) => {
1555
1556
  const r = E(null), t = E(!1);
1556
1557
  C(() => {
1557
1558
  const s = () => {
@@ -1581,7 +1582,7 @@ const Z = new Ct(), St = (i = {}) => {
1581
1582
  document.removeEventListener("visibilitychange", s), window.removeEventListener("blur", n), r.current && clearTimeout(r.current);
1582
1583
  };
1583
1584
  }, [i]);
1584
- }, Rt = () => {
1585
+ }, Mt = () => {
1585
1586
  C(() => {
1586
1587
  const i = document.createElement("style");
1587
1588
  return i.textContent = `
@@ -1602,7 +1603,7 @@ const Z = new Ct(), St = (i = {}) => {
1602
1603
  };
1603
1604
  }, []);
1604
1605
  };
1605
- class At {
1606
+ class Dt {
1606
1607
  constructor(r = {}) {
1607
1608
  F(this, "config");
1608
1609
  F(this, "currentAudio", null);
@@ -1630,7 +1631,7 @@ class At {
1630
1631
  speed: n = this.config.speed
1631
1632
  } = r, o = new URLSearchParams();
1632
1633
  o.append("text", t), o.append("voice", s || "string"), o.append("speed", (n == null ? void 0 : n.toString()) || "1");
1633
- const a = await be(
1634
+ const a = await ve(
1634
1635
  `${this.config.baseUrl}/speech/synthesize`,
1635
1636
  {
1636
1637
  method: "POST",
@@ -1713,9 +1714,9 @@ class At {
1713
1714
  return this.currentAudio !== null && !this.currentAudio.paused;
1714
1715
  }
1715
1716
  }
1716
- const he = new At(), Mt = (i = {}) => {
1717
+ const ge = new Dt(), _t = (i = {}) => {
1717
1718
  const [r, t] = k(!1), [s, n] = k(!1), [o, a] = k(null);
1718
- i.config && he.updateConfig(i.config);
1719
+ i.config && ge.updateConfig(i.config);
1719
1720
  const l = T(
1720
1721
  async (d, u = {}) => {
1721
1722
  var h;
@@ -1725,7 +1726,7 @@ const he = new At(), Mt = (i = {}) => {
1725
1726
  text: d,
1726
1727
  ...u
1727
1728
  };
1728
- await he.speak(m, {
1729
+ await ge.speak(m, {
1729
1730
  onStart: () => {
1730
1731
  var c;
1731
1732
  n(!1), t(!0), (c = i.onStart) == null || c.call(i);
@@ -1746,7 +1747,7 @@ const he = new At(), Mt = (i = {}) => {
1746
1747
  },
1747
1748
  [i]
1748
1749
  ), w = T(() => {
1749
- he.stop(), t(!1), n(!1);
1750
+ ge.stop(), t(!1), n(!1);
1750
1751
  }, []);
1751
1752
  return {
1752
1753
  speak: l,
@@ -1755,12 +1756,12 @@ const he = new At(), Mt = (i = {}) => {
1755
1756
  isLoading: s,
1756
1757
  error: o
1757
1758
  };
1758
- }, Dt = ({
1759
+ }, Pt = ({
1759
1760
  onViolation: i,
1760
1761
  onEnd: r,
1761
1762
  maxViolations: t = 5
1762
1763
  }) => {
1763
- const { addViolation: s } = st(), n = it(), o = rt(), a = E(o);
1764
+ const { addViolation: s } = at(), n = st(), o = nt(), a = E(o);
1764
1765
  C(() => {
1765
1766
  a.current = o;
1766
1767
  }, [o]);
@@ -1774,7 +1775,7 @@ const he = new At(), Mt = (i = {}) => {
1774
1775
  logViolation: T(
1775
1776
  ({ type: d, severity: u, details: h }) => {
1776
1777
  const m = {
1777
- id: wt(),
1778
+ id: ht(),
1778
1779
  type: d,
1779
1780
  severity: u,
1780
1781
  details: h,
@@ -1790,7 +1791,7 @@ const he = new At(), Mt = (i = {}) => {
1790
1791
  violationCount: o,
1791
1792
  logList: n
1792
1793
  };
1793
- }, _t = () => {
1794
+ }, Ft = () => {
1794
1795
  C(() => {
1795
1796
  function i() {
1796
1797
  console.clear(), console.log(
@@ -1872,7 +1873,7 @@ const he = new At(), Mt = (i = {}) => {
1872
1873
  clearInterval(s), document.removeEventListener("keydown", n), document.removeEventListener("contextmenu", o), delete window.showStats, delete window.interviewTips;
1873
1874
  };
1874
1875
  }, []);
1875
- }, ye = (i) => /* @__PURE__ */ e.jsxs(
1876
+ }, je = (i) => /* @__PURE__ */ e.jsxs(
1876
1877
  "svg",
1877
1878
  {
1878
1879
  xmlns: "http://www.w3.org/2000/svg",
@@ -1894,10 +1895,10 @@ const he = new At(), Mt = (i = {}) => {
1894
1895
  /* @__PURE__ */ e.jsx("path", { d: "M8.644 21.42a10 10 0 0 0 7.631-.38" })
1895
1896
  ]
1896
1897
  }
1897
- ), Pt = (i, r, t) => Math.max(r, Math.min(t, i)), Ne = (i) => {
1898
+ ), Lt = (i, r, t) => Math.max(r, Math.min(t, i)), Ee = (i) => {
1898
1899
  const r = Math.max(0, Math.floor(i)), t = Math.floor(r / 60).toString().padStart(2, "0"), s = (r % 60).toString().padStart(2, "0");
1899
1900
  return `${t}:${s}`;
1900
- }, ve = ({
1901
+ }, Ne = ({
1901
1902
  total: i,
1902
1903
  remaining: r,
1903
1904
  size: t = 64,
@@ -1905,16 +1906,16 @@ const he = new At(), Mt = (i = {}) => {
1905
1906
  className: n = "",
1906
1907
  showLabel: o = !0
1907
1908
  }) => {
1908
- const a = Math.max(1, i || 1), l = Pt(r / a, 0, 1), { radius: w, circumference: d, dashOffset: u, center: h } = ee(() => {
1909
- const x = (t - s) / 2, b = 2 * Math.PI * x, j = b * (1 - l), g = Math.round(s) % 2 === 1, v = t / 2 + (g ? 0.5 : 0);
1910
- return { radius: x, circumference: b, dashOffset: j, center: v };
1909
+ const a = Math.max(1, i || 1), l = Lt(r / a, 0, 1), { radius: w, circumference: d, dashOffset: u, center: h } = ee(() => {
1910
+ const x = (t - s) / 2, p = 2 * Math.PI * x, j = p * (1 - l), g = Math.round(s) % 2 === 1, y = t / 2 + (g ? 0.5 : 0);
1911
+ return { radius: x, circumference: p, dashOffset: j, center: y };
1911
1912
  }, [t, s, l]), m = ee(() => l <= 0.25 ? "iw-stroke-red-500" : l <= 0.5 ? "iw-stroke-yellow-500" : "iw-stroke-green-500", [l]), c = l <= 0.25 ? "iw-animate-pulse" : "";
1912
1913
  return /* @__PURE__ */ e.jsxs(
1913
1914
  "div",
1914
1915
  {
1915
1916
  className: `iw-relative iw-inline-flex iw-items-center iw-justify-center iw-rounded-full iw-bg-white ${n}`,
1916
1917
  style: { width: t, height: t },
1917
- "aria-label": `Time remaining ${Ne(r)}`,
1918
+ "aria-label": `Time remaining ${Ee(r)}`,
1918
1919
  role: "timer",
1919
1920
  "aria-live": "polite",
1920
1921
  children: [
@@ -1965,13 +1966,13 @@ const he = new At(), Mt = (i = {}) => {
1965
1966
  "span",
1966
1967
  {
1967
1968
  className: `iw-text-[11px] iw-font-semibold iw-tabular-nums ${l <= 0.25 ? "iw-text-red-600" : l <= 0.5 ? "iw-text-yellow-600" : "iw-text-green-600"}`,
1968
- children: Ne(r)
1969
+ children: Ee(r)
1969
1970
  }
1970
1971
  ) })
1971
1972
  ]
1972
1973
  }
1973
1974
  );
1974
- }, Ft = ({
1975
+ }, $t = ({
1975
1976
  label: i,
1976
1977
  error: r,
1977
1978
  fullWidth: t = !1,
@@ -2006,7 +2007,7 @@ const he = new At(), Mt = (i = {}) => {
2006
2007
  ]
2007
2008
  }
2008
2009
  );
2009
- }, Lt = ({
2010
+ }, Ot = ({
2010
2011
  value: i,
2011
2012
  onChange: r,
2012
2013
  onSubmit: t,
@@ -2022,11 +2023,11 @@ const he = new At(), Mt = (i = {}) => {
2022
2023
  /* @__PURE__ */ e.jsx("h3", { className: "iw-text-lg iw-font-semibold iw-text-gray-900 iw-mb-1", children: "Your Answer" }),
2023
2024
  /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-center iw-justify-center iw-gap-2", children: [
2024
2025
  /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-center iw-gap-1", children: [
2025
- /* @__PURE__ */ e.jsx(ye, { className: "iw-size-4 iw-text-orange-600" }),
2026
+ /* @__PURE__ */ e.jsx(je, { className: "iw-size-4 iw-text-orange-600" }),
2026
2027
  /* @__PURE__ */ e.jsx("p", { className: "iw-text-gray-700 iw-text-sm", children: "Time to edit: " })
2027
2028
  ] }),
2028
2029
  /* @__PURE__ */ e.jsx(
2029
- ve,
2030
+ Ne,
2030
2031
  {
2031
2032
  total: o,
2032
2033
  remaining: n.currentPhaseTimeRemaining,
@@ -2038,7 +2039,7 @@ const he = new At(), Mt = (i = {}) => {
2038
2039
  ] }),
2039
2040
  /* @__PURE__ */ e.jsxs("div", { className: " iw-overflow-hidden iw-flex iw-flex-col iw-h-full iw-mt-2", children: [
2040
2041
  /* @__PURE__ */ e.jsx(
2041
- Ft,
2042
+ $t,
2042
2043
  {
2043
2044
  value: i,
2044
2045
  onChange: r,
@@ -2055,9 +2056,9 @@ const he = new At(), Mt = (i = {}) => {
2055
2056
  /* @__PURE__ */ e.jsx("div", { className: "iw-w-full iw-grid iw-grid-cols-1 iw-mt-4", children: /* @__PURE__ */ e.jsx(V, { onClick: t, disabled: s, children: "Submit Answer" }) })
2056
2057
  ] })
2057
2058
  ] });
2058
- }, $t = ({ className: i = "" }) => {
2059
+ }, qt = ({ className: i = "" }) => {
2059
2060
  var n;
2060
- const { authToken: r } = De(), t = r ? ut(r) : null, s = E(null);
2061
+ const { authToken: r } = Pe(), t = r ? mt(r) : null, s = E(null);
2061
2062
  return C(() => {
2062
2063
  let o = null;
2063
2064
  return (async () => {
@@ -2092,7 +2093,7 @@ const he = new At(), Mt = (i = {}) => {
2092
2093
  ] }),
2093
2094
  ((n = t == null ? void 0 : t.data) == null ? void 0 : n.user_name) && /* @__PURE__ */ e.jsx("div", { className: "iw-absolute iw-bottom-4 iw-right-4 iw-inline-flex iw-items-center iw-gap-2 iw-rounded-lg iw-border iw-border-white/10 iw-bg-black/40 iw-px-4 iw-py-2 iw-backdrop-blur-md", children: /* @__PURE__ */ e.jsx("span", { className: "iw-font-medium iw-text-white", children: t.data.user_name }) })
2094
2095
  ] });
2095
- }, Ot = ({
2096
+ }, Ut = ({
2096
2097
  question: i,
2097
2098
  isLoading: r = !1
2098
2099
  }) => {
@@ -2101,7 +2102,7 @@ const he = new At(), Mt = (i = {}) => {
2101
2102
  "div",
2102
2103
  {
2103
2104
  className: "iw-rounded-xl iw-mb-4 message-animation iw-text-gray-800 iw-p-6 ",
2104
- style: ct(t, 0.85),
2105
+ style: wt(t, 0.85),
2105
2106
  children: /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-center iw-gap-8", children: [
2106
2107
  /* @__PURE__ */ e.jsx("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: /* @__PURE__ */ e.jsx("div", { className: "iw-mt-2", children: /* @__PURE__ */ e.jsx(
2107
2108
  "img",
@@ -2118,7 +2119,7 @@ const he = new At(), Mt = (i = {}) => {
2118
2119
  ] })
2119
2120
  }
2120
2121
  );
2121
- }, ke = ({
2122
+ }, Te = ({
2122
2123
  currentQuestion: i,
2123
2124
  phase: r,
2124
2125
  className: t = "",
@@ -2129,19 +2130,19 @@ const he = new At(), Mt = (i = {}) => {
2129
2130
  className: `iw-p-4 iw-space-y-4 iw-pb-6 ${t} iw-min-h-[calc(100vh_-_3.8rem)] iw-flex iw-flex-col iw-justify-between`,
2130
2131
  children: [
2131
2132
  /* @__PURE__ */ e.jsx("div", { className: "iw-flex iw-items-start iw-justify-between iw-gap-3", children: /* @__PURE__ */ e.jsx("div", { className: "iw-flex-1", children: /* @__PURE__ */ e.jsx(
2132
- Ot,
2133
+ Ut,
2133
2134
  {
2134
2135
  question: i,
2135
2136
  isLoading: r === D.FETCHING_QUESTION || r === D.IDLE
2136
2137
  }
2137
2138
  ) }) }),
2138
2139
  /* @__PURE__ */ e.jsxs("div", { className: "iw iw-bg-[#F6F6F6] iw-grid iw-grid-cols-2 iw-rounded-[14px] iw-p-6", children: [
2139
- /* @__PURE__ */ e.jsx("div", { className: "iw-min-h-[400px] iw-max-h-[600px]", children: /* @__PURE__ */ e.jsx($t, {}) }),
2140
+ /* @__PURE__ */ e.jsx("div", { className: "iw-min-h-[400px] iw-max-h-[600px]", children: /* @__PURE__ */ e.jsx(qt, {}) }),
2140
2141
  /* @__PURE__ */ e.jsx("div", { className: "iw-bg-white iw-rounded-r-xl iw-shadow iw-p-6", children: s })
2141
2142
  ] })
2142
2143
  ]
2143
2144
  }
2144
- ), Ue = ({
2145
+ ), Be = ({
2145
2146
  isOpen: i,
2146
2147
  onClose: r,
2147
2148
  children: t,
@@ -2219,13 +2220,13 @@ const he = new At(), Mt = (i = {}) => {
2219
2220
  }
2220
2221
  )
2221
2222
  ] });
2222
- return Ve(d, document.body);
2223
- }, Ut = ({
2223
+ return He(d, document.body);
2224
+ }, Bt = ({
2224
2225
  confirmExitInterview: i,
2225
2226
  isOpen: r,
2226
2227
  onClose: t
2227
2228
  }) => /* @__PURE__ */ e.jsx(
2228
- Ue,
2229
+ Be,
2229
2230
  {
2230
2231
  isOpen: r,
2231
2232
  onClose: t,
@@ -2263,7 +2264,7 @@ const he = new At(), Mt = (i = {}) => {
2263
2264
  ] })
2264
2265
  ] })
2265
2266
  }
2266
- ), Ee = ({ title: i, onExit: r }) => {
2267
+ ), Ce = ({ title: i, onExit: r }) => {
2267
2268
  const { baseColor: t } = te(), [s, n] = k(!1);
2268
2269
  return /* @__PURE__ */ e.jsxs("header", { className: "iw-w-full iw-text-gray-900", children: [
2269
2270
  /* @__PURE__ */ e.jsxs("div", { className: "iw-mx-auto iw-flex iw-items-center iw-justify-between iw-px-4 iw-pb-4 iw-pt-2", children: [
@@ -2293,7 +2294,7 @@ const he = new At(), Mt = (i = {}) => {
2293
2294
  ] }),
2294
2295
  /* @__PURE__ */ e.jsx("div", { className: "iw-h-px iw-bg-gray-200" }),
2295
2296
  /* @__PURE__ */ e.jsx(
2296
- Ut,
2297
+ Bt,
2297
2298
  {
2298
2299
  isOpen: s,
2299
2300
  confirmExitInterview: () => {
@@ -2303,7 +2304,7 @@ const he = new At(), Mt = (i = {}) => {
2303
2304
  }
2304
2305
  )
2305
2306
  ] });
2306
- }, qt = ({
2307
+ }, Wt = ({
2307
2308
  className: i = "",
2308
2309
  width: r,
2309
2310
  height: t = 56,
@@ -2314,7 +2315,7 @@ const he = new At(), Mt = (i = {}) => {
2314
2315
  mediaStream: l,
2315
2316
  startOnMount: w = !0
2316
2317
  }) => {
2317
- const { baseColor: d } = te(), u = E(null), h = E(null), m = E(null), c = E(null), x = E(null), b = E(null), j = E(!1), [g, v] = k(null);
2318
+ const { baseColor: d } = te(), u = E(null), h = E(null), m = E(null), c = E(null), x = E(null), p = E(null), j = E(!1), [g, y] = k(null);
2318
2319
  C(() => {
2319
2320
  if (r || !h.current) return;
2320
2321
  const N = h.current, _ = () => {
@@ -2322,8 +2323,8 @@ const he = new At(), Mt = (i = {}) => {
2322
2323
  if (!R) return;
2323
2324
  const A = N.clientWidth, f = t;
2324
2325
  R.width = Math.max(1, Math.floor(A * window.devicePixelRatio || 1)), R.height = Math.max(1, Math.floor(f * window.devicePixelRatio || 1));
2325
- }, y = new ResizeObserver(_);
2326
- return y.observe(N), _(), () => y.disconnect();
2326
+ }, v = new ResizeObserver(_);
2327
+ return v.observe(N), _(), () => v.disconnect();
2327
2328
  }, [r, t]), C(() => {
2328
2329
  if (!r) return;
2329
2330
  const N = u.current;
@@ -2338,8 +2339,8 @@ const he = new At(), Mt = (i = {}) => {
2338
2339
  let N = !1;
2339
2340
  return (async () => {
2340
2341
  try {
2341
- const y = new (window.AudioContext || window.webkitAudioContext)();
2342
- m.current = y;
2342
+ const v = new (window.AudioContext || window.webkitAudioContext)();
2343
+ m.current = v;
2343
2344
  let R = l;
2344
2345
  if (!R) {
2345
2346
  if (!w) return;
@@ -2349,18 +2350,18 @@ const he = new At(), Mt = (i = {}) => {
2349
2350
  }), j.current = !0;
2350
2351
  }
2351
2352
  if (N) return;
2352
- const A = y.createAnalyser();
2353
+ const A = v.createAnalyser();
2353
2354
  A.fftSize = o, A.smoothingTimeConstant = a, c.current = A;
2354
- const f = y.createMediaStreamSource(R);
2355
+ const f = v.createMediaStreamSource(R);
2355
2356
  x.current = f, f.connect(A), S();
2356
- } catch (y) {
2357
- v((y == null ? void 0 : y.message) || "Failed to initialize microphone");
2357
+ } catch (v) {
2358
+ y((v == null ? void 0 : v.message) || "Failed to initialize microphone");
2358
2359
  }
2359
2360
  })(), () => {
2360
- var y, R, A, f;
2361
- N = !0, b.current && cancelAnimationFrame(b.current);
2361
+ var v, R, A, f;
2362
+ N = !0, p.current && cancelAnimationFrame(p.current);
2362
2363
  try {
2363
- (y = x.current) == null || y.disconnect();
2364
+ (v = x.current) == null || v.disconnect();
2364
2365
  } catch {
2365
2366
  }
2366
2367
  try {
@@ -2373,16 +2374,16 @@ const he = new At(), Mt = (i = {}) => {
2373
2374
  const S = () => {
2374
2375
  const N = u.current, _ = c.current;
2375
2376
  if (!N || !_) return;
2376
- const y = N.getContext("2d");
2377
- if (!y) return;
2377
+ const v = N.getContext("2d");
2378
+ if (!v) return;
2378
2379
  const R = window.devicePixelRatio || 1, A = N.width, f = N.height, M = _.frequencyBinCount, L = new Uint8Array(M), O = () => {
2379
- b.current = requestAnimationFrame(O), _.getByteTimeDomainData(L), y.clearRect(0, 0, A, f), y.fillStyle = "rgba(0,0,0,0)", y.fillRect(0, 0, A, f);
2380
- const q = Math.max(1, Math.floor(s * R)), z = Math.max(1, Math.floor(n * R)), H = q + z, Y = Math.max(8, Math.floor((A + z) / H)), B = Math.floor(L.length / Y);
2381
- for (let U = 0; U < Y; U++) {
2382
- const P = Math.min(L.length - 1, U * B), Q = L[P] / 128 - 1, W = Math.abs(Q), ce = Math.pow(W, 0.6), K = Math.max(f * 0.06, ce * (f * 0.9)), de = U * H, we = (f - K) / 2, ue = 140 - Math.min(140, 140 * W), J = 85, ie = 48 + Math.floor(12 * (1 - W));
2383
- y.fillStyle = `${d}`, y.shadowColor = `hsla(${ue}, ${J}%, ${ie}%, ${0.25 * W})`, y.shadowBlur = 8 * W;
2384
- const p = Math.min(q / 2, K / 2);
2385
- Bt(y, de, we, q, K, p), y.fill();
2380
+ p.current = requestAnimationFrame(O), _.getByteTimeDomainData(L), v.clearRect(0, 0, A, f), v.fillStyle = "rgba(0,0,0,0)", v.fillRect(0, 0, A, f);
2381
+ const U = Math.max(1, Math.floor(s * R)), z = Math.max(1, Math.floor(n * R)), H = U + z, Y = Math.max(8, Math.floor((A + z) / H)), B = Math.floor(L.length / Y);
2382
+ for (let q = 0; q < Y; q++) {
2383
+ const P = Math.min(L.length - 1, q * B), Q = L[P] / 128 - 1, W = Math.abs(Q), de = Math.pow(W, 0.6), K = Math.max(f * 0.06, de * (f * 0.9)), we = q * H, ue = (f - K) / 2, he = 140 - Math.min(140, 140 * W), J = 85, ie = 48 + Math.floor(12 * (1 - W));
2384
+ v.fillStyle = `${d}`, v.shadowColor = `hsla(${he}, ${J}%, ${ie}%, ${0.25 * W})`, v.shadowBlur = 8 * W;
2385
+ const re = Math.min(U / 2, K / 2);
2386
+ Gt(v, we, ue, U, K, re), v.fill();
2386
2387
  }
2387
2388
  };
2388
2389
  O();
@@ -2400,11 +2401,11 @@ const he = new At(), Mt = (i = {}) => {
2400
2401
  }
2401
2402
  );
2402
2403
  };
2403
- function Bt(i, r, t, s, n, o) {
2404
+ function Gt(i, r, t, s, n, o) {
2404
2405
  const a = Math.min(o, s / 2, n / 2);
2405
2406
  i.beginPath(), i.moveTo(r + a, t), i.lineTo(r + s - a, t), i.quadraticCurveTo(r + s, t, r + s, t + a), i.lineTo(r + s, t + n - a), i.quadraticCurveTo(r + s, t + n, r + s - a, t + n), i.lineTo(r + a, t + n), i.quadraticCurveTo(r, t + n, r, t + n - a), i.lineTo(r, t + a), i.quadraticCurveTo(r, t, r + a, t), i.closePath();
2406
2407
  }
2407
- const Wt = ({
2408
+ const Vt = ({
2408
2409
  state: i,
2409
2410
  answeringTime: r,
2410
2411
  nextPhase: t,
@@ -2415,11 +2416,11 @@ const Wt = ({
2415
2416
  /* @__PURE__ */ e.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...." }),
2416
2417
  /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-center iw-justify-center iw-gap-2", children: [
2417
2418
  /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-center iw-gap-1", children: [
2418
- /* @__PURE__ */ e.jsx(ye, { className: "iw-size-4 iw-text-orange-600" }),
2419
+ /* @__PURE__ */ e.jsx(je, { className: "iw-size-4 iw-text-orange-600" }),
2419
2420
  /* @__PURE__ */ e.jsx("p", { className: "iw-text-gray-700 iw-text-sm", children: "Time to talk: " })
2420
2421
  ] }),
2421
2422
  /* @__PURE__ */ e.jsx(
2422
- ve,
2423
+ Ne,
2423
2424
  {
2424
2425
  total: r,
2425
2426
  remaining: i.currentPhaseTimeRemaining,
@@ -2432,7 +2433,7 @@ const Wt = ({
2432
2433
  /* @__PURE__ */ e.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." })
2433
2434
  ] }),
2434
2435
  /* @__PURE__ */ e.jsxs("div", { children: [
2435
- /* @__PURE__ */ e.jsx(qt, {}),
2436
+ /* @__PURE__ */ e.jsx(Wt, {}),
2436
2437
  s && /* @__PURE__ */ e.jsxs("div", { className: "iw-mt-2 iw-text-xs iw-text-red-600", children: [
2437
2438
  "Recording error: ",
2438
2439
  s.message
@@ -2448,7 +2449,7 @@ const Wt = ({
2448
2449
  }
2449
2450
  ) })
2450
2451
  ] });
2451
- function Gt() {
2452
+ function zt() {
2452
2453
  const [i, r] = k(!0), t = ee(
2453
2454
  () => [0, 1, 2].map((s) => ({ id: s })),
2454
2455
  []
@@ -2486,7 +2487,7 @@ function Gt() {
2486
2487
  /* @__PURE__ */ e.jsx("div", { className: "iw-text-center", children: /* @__PURE__ */ e.jsx("p", { className: "iw-text-gray-500 iw-font-medium", children: "Preparing your question..." }) })
2487
2488
  ] });
2488
2489
  }
2489
- const Vt = ({
2490
+ const Ht = ({
2490
2491
  size: i = "192px",
2491
2492
  className: r,
2492
2493
  colors: t,
@@ -2628,9 +2629,9 @@ const Vt = ({
2628
2629
  }
2629
2630
  );
2630
2631
  };
2631
- function zt({ ttsError: i }) {
2632
+ function Yt({ ttsError: i }) {
2632
2633
  return /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-flex-col iw-items-center iw-justify-center iw-gap-8 iw-w-full iw-h-full", children: [
2633
- /* @__PURE__ */ e.jsx(Vt, { size: "80px" }),
2634
+ /* @__PURE__ */ e.jsx(Ht, { size: "80px" }),
2634
2635
  i && /* @__PURE__ */ e.jsxs("div", { className: "iw-mt-2 iw-text-xs iw-text-red-600", children: [
2635
2636
  "Audio playback failed: ",
2636
2637
  i.message
@@ -2638,18 +2639,18 @@ function zt({ ttsError: i }) {
2638
2639
  /* @__PURE__ */ e.jsx("p", { className: "iw-text- iw-text-gray-700", children: "Your AI interviewer is speaking..." })
2639
2640
  ] });
2640
2641
  }
2641
- const Ht = ({ state: i, thinkingTime: r, nextPhase: t }) => /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-flex-col iw-gap-6 iw-items-center iw-justify-center iw-text-center iw-h-full ", children: [
2642
+ const Qt = ({ state: i, thinkingTime: r, nextPhase: t }) => /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-flex-col iw-gap-6 iw-items-center iw-justify-center iw-text-center iw-h-full ", children: [
2642
2643
  /* @__PURE__ */ e.jsxs("div", { children: [
2643
2644
  /* @__PURE__ */ e.jsx("h3", { className: "iw-text-lg iw-font-semibold iw-text-gray-900 iw-mb-1", children: "Get Ready to Answer" }),
2644
2645
  /* @__PURE__ */ e.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." })
2645
2646
  ] }),
2646
2647
  /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-center iw-justify-center iw-gap-2", children: [
2647
2648
  /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-center iw-gap-1", children: [
2648
- /* @__PURE__ */ e.jsx(ye, { className: "iw-size-4 iw-text-orange-600" }),
2649
+ /* @__PURE__ */ e.jsx(je, { className: "iw-size-4 iw-text-orange-600" }),
2649
2650
  /* @__PURE__ */ e.jsx("p", { className: "iw-text-gray-700 iw-text-sm", children: "Time to think: " })
2650
2651
  ] }),
2651
2652
  /* @__PURE__ */ e.jsx(
2652
- ve,
2653
+ Ne,
2653
2654
  {
2654
2655
  total: r,
2655
2656
  remaining: i.currentPhaseTimeRemaining,
@@ -2667,7 +2668,7 @@ const Ht = ({ state: i, thinkingTime: r, nextPhase: t }) => /* @__PURE__ */ e.js
2667
2668
  children: "Start Answering"
2668
2669
  }
2669
2670
  ) })
2670
- ] }), Yt = ({ sttError: i }) => /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-flex-col iw-items-center iw-justify-center iw-h-full", children: [
2671
+ ] }), Kt = ({ sttError: i }) => /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-flex-col iw-items-center iw-justify-center iw-h-full", children: [
2671
2672
  /* @__PURE__ */ e.jsxs("svg", { width: "48", height: "48", viewBox: "0 0 60 60", fill: "none", children: [
2672
2673
  /* @__PURE__ */ e.jsx(
2673
2674
  "rect",
@@ -2708,7 +2709,7 @@ const Ht = ({ state: i, thinkingTime: r, nextPhase: t }) => /* @__PURE__ */ e.js
2708
2709
  i.message,
2709
2710
  i.recoverable && " (attempting to continue)"
2710
2711
  ] })
2711
- ] }), se = (i) => /* @__PURE__ */ e.jsxs(
2712
+ ] }), ne = (i) => /* @__PURE__ */ e.jsxs(
2712
2713
  "svg",
2713
2714
  {
2714
2715
  xmlns: "http://www.w3.org/2000/svg",
@@ -2727,7 +2728,7 @@ const Ht = ({ state: i, thinkingTime: r, nextPhase: t }) => /* @__PURE__ */ e.js
2727
2728
  /* @__PURE__ */ e.jsx("path", { d: "M12 17h.01" })
2728
2729
  ]
2729
2730
  }
2730
- ), Qt = (i) => /* @__PURE__ */ e.jsxs(
2731
+ ), Jt = (i) => /* @__PURE__ */ e.jsxs(
2731
2732
  "svg",
2732
2733
  {
2733
2734
  xmlns: "http://www.w3.org/2000/svg",
@@ -2745,7 +2746,7 @@ const Ht = ({ state: i, thinkingTime: r, nextPhase: t }) => /* @__PURE__ */ e.js
2745
2746
  /* @__PURE__ */ e.jsx("circle", { cx: "12", cy: "12", r: "10" })
2746
2747
  ]
2747
2748
  }
2748
- ), Kt = (i) => /* @__PURE__ */ e.jsxs(
2749
+ ), Xt = (i) => /* @__PURE__ */ e.jsxs(
2749
2750
  "svg",
2750
2751
  {
2751
2752
  xmlns: "http://www.w3.org/2000/svg",
@@ -2763,7 +2764,7 @@ const Ht = ({ state: i, thinkingTime: r, nextPhase: t }) => /* @__PURE__ */ e.js
2763
2764
  /* @__PURE__ */ e.jsx("circle", { cx: "12", cy: "12", r: "3" })
2764
2765
  ]
2765
2766
  }
2766
- ), Jt = (i) => /* @__PURE__ */ e.jsxs(
2767
+ ), Zt = (i) => /* @__PURE__ */ e.jsxs(
2767
2768
  "svg",
2768
2769
  {
2769
2770
  xmlns: "http://www.w3.org/2000/svg",
@@ -2784,7 +2785,7 @@ const Ht = ({ state: i, thinkingTime: r, nextPhase: t }) => /* @__PURE__ */ e.js
2784
2785
  /* @__PURE__ */ e.jsx("path", { d: "M7 21H5a2 2 0 0 1-2-2v-2" })
2785
2786
  ]
2786
2787
  }
2787
- ), me = (i) => /* @__PURE__ */ e.jsxs(
2788
+ ), fe = (i) => /* @__PURE__ */ e.jsxs(
2788
2789
  "svg",
2789
2790
  {
2790
2791
  xmlns: "http://www.w3.org/2000/svg",
@@ -2805,7 +2806,7 @@ const Ht = ({ state: i, thinkingTime: r, nextPhase: t }) => /* @__PURE__ */ e.js
2805
2806
  /* @__PURE__ */ e.jsx("path", { d: "M7 21H5a2 2 0 0 1-2-2v-2" })
2806
2807
  ]
2807
2808
  }
2808
- ), Xt = (i) => /* @__PURE__ */ e.jsxs(
2809
+ ), ei = (i) => /* @__PURE__ */ e.jsxs(
2809
2810
  "svg",
2810
2811
  {
2811
2812
  xmlns: "http://www.w3.org/2000/svg",
@@ -2826,8 +2827,8 @@ const Ht = ({ state: i, thinkingTime: r, nextPhase: t }) => /* @__PURE__ */ e.js
2826
2827
  /* @__PURE__ */ e.jsx("path", { d: "M7 21H5a2 2 0 0 1-2-2v-2" })
2827
2828
  ]
2828
2829
  }
2829
- ), re = 5;
2830
- function Zt({
2830
+ ), se = 5;
2831
+ function ti({
2831
2832
  isOpen: i,
2832
2833
  onClose: r,
2833
2834
  warningCount: t,
@@ -2854,63 +2855,63 @@ function Zt({
2854
2855
  return {
2855
2856
  title: "Tab Switch Detected",
2856
2857
  description: "You attempted to switch to another tab or reload application.",
2857
- icon: /* @__PURE__ */ e.jsx(Kt, { className: "iw-h-5 iw-w-5" })
2858
+ icon: /* @__PURE__ */ e.jsx(Xt, { className: "iw-h-5 iw-w-5" })
2858
2859
  };
2859
2860
  case "fullscreen_exit":
2860
2861
  return {
2861
2862
  title: "Full Screen Exit Detected",
2862
2863
  description: "You attempted to exit full screen mode.",
2863
- icon: /* @__PURE__ */ e.jsx(Oe, { className: "iw-h-5 iw-w-5" })
2864
+ icon: /* @__PURE__ */ e.jsx(Ue, { className: "iw-h-5 iw-w-5" })
2864
2865
  };
2865
2866
  case "focus_loss":
2866
2867
  return {
2867
2868
  title: "Focus Loss Detected",
2868
2869
  description: "You lost focus from the interview window.",
2869
- icon: /* @__PURE__ */ e.jsx(Jt, { className: "iw-h-5 iw-w-5" })
2870
+ icon: /* @__PURE__ */ e.jsx(Zt, { className: "iw-h-5 iw-w-5" })
2870
2871
  };
2871
2872
  case "blocked_shortcut":
2872
2873
  return {
2873
2874
  title: "Keyboard Shortcut Blocked",
2874
2875
  description: "You attempted to use a blocked keyboard shortcut.",
2875
- icon: /* @__PURE__ */ e.jsx(me, { className: "iw-h-5 iw-w-5" })
2876
+ icon: /* @__PURE__ */ e.jsx(fe, { className: "iw-h-5 iw-w-5" })
2876
2877
  };
2877
2878
  case "right_click_attempt":
2878
2879
  return {
2879
2880
  title: "Right Click Attempted",
2880
2881
  description: "You attempted to use the right click.",
2881
- icon: /* @__PURE__ */ e.jsx(Xt, { className: "iw-h-5 iw-w-5" })
2882
+ icon: /* @__PURE__ */ e.jsx(ei, { className: "iw-h-5 iw-w-5" })
2882
2883
  };
2883
2884
  case "alt_tab_attempt":
2884
2885
  return {
2885
2886
  title: "Alt + Tab Attempted",
2886
2887
  description: "You attempted to use the Alt + Tab shortcut.",
2887
- icon: /* @__PURE__ */ e.jsx(me, { className: "iw-h-5 iw-w-5" })
2888
+ icon: /* @__PURE__ */ e.jsx(fe, { className: "iw-h-5 iw-w-5" })
2888
2889
  };
2889
2890
  case "blocked_function_key":
2890
2891
  return {
2891
2892
  title: "Function Key Blocked",
2892
2893
  description: "You attempted to use a blocked function key.",
2893
- icon: /* @__PURE__ */ e.jsx(me, { className: "iw-h-5 iw-w-5" })
2894
+ icon: /* @__PURE__ */ e.jsx(fe, { className: "iw-h-5 iw-w-5" })
2894
2895
  };
2895
2896
  default:
2896
2897
  return {
2897
2898
  title: "Violation Detected",
2898
2899
  description: "You attempted to perform an action that is not allowed.",
2899
- icon: /* @__PURE__ */ e.jsx(se, { className: "iw-h-5 iw-w-5" })
2900
+ icon: /* @__PURE__ */ e.jsx(ne, { className: "iw-h-5 iw-w-5" })
2900
2901
  };
2901
2902
  }
2902
- })(), u = re - t, h = () => {
2903
- t + 1 > re ? n() : r();
2903
+ })(), u = se - t, h = () => {
2904
+ t + 1 > se ? n() : r();
2904
2905
  };
2905
2906
  return /* @__PURE__ */ e.jsx("div", { className: "iw-fixed iw-inset-0 iw-z-50 iw-flex iw-items-center iw-justify-center iw-bg-black/60 iw-p-4 iw-backdrop-blur-sm", children: /* @__PURE__ */ e.jsxs("div", { className: "iw-w-full iw-max-w-md iw-rounded-2xl iw-border iw-border-gray-100 iw-bg-white iw-shadow-xl", children: [
2906
2907
  /* @__PURE__ */ e.jsxs("div", { className: "iw-p-6 iw-pb-0", children: [
2907
2908
  /* @__PURE__ */ e.jsxs("div", { className: "iw-mb-6 iw-flex iw-items-start iw-gap-4", children: [
2908
- /* @__PURE__ */ e.jsx("div", { className: "iw-flex iw-h-12 iw-w-12 iw-flex-shrink-0 iw-items-center iw-justify-center iw-rounded-2xl iw-bg-red-50", children: /* @__PURE__ */ e.jsx(se, { className: "iw-h-6 iw-w-6 iw-text-red-500" }) }),
2909
+ /* @__PURE__ */ e.jsx("div", { className: "iw-flex iw-h-12 iw-w-12 iw-flex-shrink-0 iw-items-center iw-justify-center iw-rounded-2xl iw-bg-red-50", children: /* @__PURE__ */ e.jsx(ne, { className: "iw-h-6 iw-w-6 iw-text-red-500" }) }),
2909
2910
  /* @__PURE__ */ e.jsxs("div", { className: "iw-flex-1", children: [
2910
2911
  /* @__PURE__ */ e.jsx("h2", { className: "iw-mb-1 iw-text-xl iw-font-semibold iw-text-gray-900", children: "Security Violation" }),
2911
2912
  /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-center iw-gap-2", children: [
2912
2913
  /* @__PURE__ */ e.jsx("span", { className: "iw-text-sm iw-text-gray-500", children: "Warning" }),
2913
- /* @__PURE__ */ e.jsx("div", { className: "iw-flex iw-gap-1", children: Array.from({ length: re }).map((m, c) => /* @__PURE__ */ e.jsx(
2914
+ /* @__PURE__ */ e.jsx("div", { className: "iw-flex iw-gap-1", children: Array.from({ length: se }).map((m, c) => /* @__PURE__ */ e.jsx(
2914
2915
  "div",
2915
2916
  {
2916
2917
  className: `iw-h-2 iw-w-2 iw-rounded-full ${c <= t - 1 ? "iw-bg-red-500" : "iw-bg-gray-200"}`
@@ -2921,7 +2922,7 @@ function Zt({
2921
2922
  "(",
2922
2923
  t,
2923
2924
  "/",
2924
- re,
2925
+ se,
2925
2926
  ")"
2926
2927
  ] })
2927
2928
  ] })
@@ -2941,7 +2942,7 @@ function Zt({
2941
2942
  /* @__PURE__ */ e.jsx("h3", { className: "iw-mb-2 iw-font-semibold iw-text-gray-900", children: d.title }),
2942
2943
  /* @__PURE__ */ e.jsx("p", { className: "iw-text-sm iw-leading-relaxed iw-text-gray-700", children: d.description }),
2943
2944
  /* @__PURE__ */ e.jsxs("div", { className: "iw-mt-3 iw-flex iw-items-center iw-gap-2 iw-text-xs iw-text-red-600", children: [
2944
- /* @__PURE__ */ e.jsx($e, { className: "iw-h-3 iw-w-3" }),
2945
+ /* @__PURE__ */ e.jsx(qe, { className: "iw-h-3 iw-w-3" }),
2945
2946
  /* @__PURE__ */ e.jsx("span", { children: "This action is monitored for interview integrity" })
2946
2947
  ] })
2947
2948
  ] })
@@ -2955,7 +2956,7 @@ function Zt({
2955
2956
  ] }) }),
2956
2957
  /* @__PURE__ */ e.jsx("div", { className: "iw-border-primary-100 iw-bg-primary-50 iw-rounded-xl iw-border iw-p-4", children: /* @__PURE__ */ e.jsxs("div", { className: "iw-text-center", children: [
2957
2958
  /* @__PURE__ */ e.jsxs("div", { className: "iw-mb-1 iw-flex iw-items-center iw-justify-center iw-gap-1.5", children: [
2958
- /* @__PURE__ */ e.jsx(Qt, { className: "iw-text-primary-600 iw-h-4 iw-w-4" }),
2959
+ /* @__PURE__ */ e.jsx(Jt, { className: "iw-text-primary-600 iw-h-4 iw-w-4" }),
2959
2960
  /* @__PURE__ */ e.jsx("span", { className: "iw-text-primary-600 iw-text-2xl iw-font-bold", children: o })
2960
2961
  ] }),
2961
2962
  /* @__PURE__ */ e.jsx("div", { className: "iw-text-primary-700 iw-text-xs iw-font-medium", children: "Auto Close" })
@@ -2969,7 +2970,7 @@ function Zt({
2969
2970
  background: "linear-gradient(to right, rgba(220, 38, 38, 0.9), rgba(239, 68, 68, 0.9))"
2970
2971
  },
2971
2972
  children: /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-center iw-gap-3", children: [
2972
- /* @__PURE__ */ e.jsx("div", { className: "iw-flex iw-h-8 iw-w-8 iw-items-center iw-justify-center iw-rounded-full iw-bg-white/20", children: /* @__PURE__ */ e.jsx(se, { className: "iw-h-4 iw-w-4" }) }),
2973
+ /* @__PURE__ */ e.jsx("div", { className: "iw-flex iw-h-8 iw-w-8 iw-items-center iw-justify-center iw-rounded-full iw-bg-white/20", children: /* @__PURE__ */ e.jsx(ne, { className: "iw-h-4 iw-w-4" }) }),
2973
2974
  /* @__PURE__ */ e.jsxs("div", { children: [
2974
2975
  /* @__PURE__ */ e.jsx("div", { className: "iw-text-sm iw-font-semibold", children: "Final Warning" }),
2975
2976
  /* @__PURE__ */ e.jsx("div", { className: "iw-text-xs iw-text-red-100", children: "Next violation will disqualify you from this interview" })
@@ -2991,7 +2992,7 @@ function Zt({
2991
2992
  ] })
2992
2993
  ] }) });
2993
2994
  }
2994
- const ei = (i) => /* @__PURE__ */ e.jsxs(
2995
+ const ii = (i) => /* @__PURE__ */ e.jsxs(
2995
2996
  "svg",
2996
2997
  {
2997
2998
  xmlns: "http://www.w3.org/2000/svg",
@@ -3009,7 +3010,7 @@ const ei = (i) => /* @__PURE__ */ e.jsxs(
3009
3010
  /* @__PURE__ */ e.jsx("circle", { cx: "12", cy: "12", r: "10" })
3010
3011
  ]
3011
3012
  }
3012
- ), ti = ({
3013
+ ), ri = ({
3013
3014
  showHardReloadWarning: i,
3014
3015
  onContinue: r
3015
3016
  }) => {
@@ -3017,7 +3018,7 @@ const ei = (i) => /* @__PURE__ */ e.jsxs(
3017
3018
  r();
3018
3019
  };
3019
3020
  return /* @__PURE__ */ e.jsxs(
3020
- Ue,
3021
+ Be,
3021
3022
  {
3022
3023
  isOpen: i,
3023
3024
  onClose: t,
@@ -3028,7 +3029,7 @@ const ei = (i) => /* @__PURE__ */ e.jsxs(
3028
3029
  children: [
3029
3030
  /* @__PURE__ */ e.jsx("div", { className: "iw-absolute iw-inset-x-0 iw-top-0 iw-h-1 iw-bg-gradient-to-r iw-from-red-500 iw-to-red-600" }),
3030
3031
  /* @__PURE__ */ e.jsx("div", { className: "iw-space-y-1 iw-pb-2 iw-pt-3", children: /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-center iw-gap-2", children: [
3031
- /* @__PURE__ */ e.jsx(se, { className: "iw-w-5 iw-h-5 iw-text-red-500" }),
3032
+ /* @__PURE__ */ e.jsx(ne, { className: "iw-w-5 iw-h-5 iw-text-red-500" }),
3032
3033
  /* @__PURE__ */ e.jsx("h3", { className: "iw-text-xl iw-font-semibold iw-text-red-500", children: "Full Screen Exit Detected" })
3033
3034
  ] }) }),
3034
3035
  /* @__PURE__ */ e.jsx("div", { className: "iw-pt-4 iw-pb-6", children: /* @__PURE__ */ e.jsx("p", { className: "iw-text-center iw-text-sm iw-leading-relaxed iw-text-gray-500/90", children: "Exiting full screen mode or reloading this page during the session is strictly prohibited. Any attempt to do so will be recorded and may lead to penalties." }) }),
@@ -3038,7 +3039,7 @@ const ei = (i) => /* @__PURE__ */ e.jsxs(
3038
3039
  onClick: t,
3039
3040
  className: "iw-w-full iw-flex iw-items-center iw-justify-center iw-gap-2 iw-px-4 iw-py-3 iw-bg-gray-100 iw-text-gray-600 iw-rounded-md iw-font-medium iw-transition-colors hover:iw-bg-gray-200 focus:iw-outline-none focus:iw-ring-2 focus:iw-ring-gray-400 focus:iw-ring-offset-2",
3040
3041
  children: [
3041
- /* @__PURE__ */ e.jsx(ei, { className: "iw-size-4" }),
3042
+ /* @__PURE__ */ e.jsx(ii, { className: "iw-size-4" }),
3042
3043
  "Continue Session"
3043
3044
  ]
3044
3045
  }
@@ -3046,14 +3047,14 @@ const ei = (i) => /* @__PURE__ */ e.jsxs(
3046
3047
  ]
3047
3048
  }
3048
3049
  );
3049
- }, ii = We(
3050
+ }, si = Ve(
3050
3051
  ({ children: i, onDisqualify: r }, t) => {
3051
- const [s, n] = k(!1), [o, a] = k(!1), [l, w] = k(!1), [d, u] = k("fullscreen_exit"), { logViolation: h, violationCount: m } = Dt({
3052
+ const [s, n] = k(!1), [o, a] = k(!1), [l, w] = k(!1), [d, u] = k("fullscreen_exit"), { logViolation: h, violationCount: m } = Pt({
3052
3053
  maxViolations: 5,
3053
3054
  onViolation: (g) => {
3054
3055
  o || (n(!0), u(g.type));
3055
3056
  }
3056
- }), { enterFullScreen: c, isFullScreen: x, exitFullScreen: b } = vt({
3057
+ }), { enterFullScreen: c, isFullScreen: x, exitFullScreen: p } = Nt({
3057
3058
  onFullScreenChange(g) {
3058
3059
  !g && !o && !l && (n(!0), h({
3059
3060
  type: "fullscreen_exit",
@@ -3067,7 +3068,7 @@ const ei = (i) => /* @__PURE__ */ e.jsxs(
3067
3068
  });
3068
3069
  C(() => {
3069
3070
  c();
3070
- }, []), Ge(
3071
+ }, []), ze(
3071
3072
  t,
3072
3073
  () => ({
3073
3074
  exitFullScreenIntentionally: async () => {
@@ -3080,14 +3081,14 @@ const ei = (i) => /* @__PURE__ */ e.jsxs(
3080
3081
  }
3081
3082
  }),
3082
3083
  []
3083
- ), It(h), Tt(h), Rt(), _t();
3084
+ ), At(h), St(h), Mt(), Ft();
3084
3085
  const j = () => {
3085
- a(!0), b(), n(!1), r == null || r();
3086
+ a(!0), p(), n(!1), r == null || r();
3086
3087
  };
3087
3088
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
3088
3089
  /* @__PURE__ */ e.jsx("div", { className: "iw-relative iw-h-full iw-w-full", children: i }),
3089
3090
  /* @__PURE__ */ e.jsx(
3090
- Zt,
3091
+ ti,
3091
3092
  {
3092
3093
  warningCount: m,
3093
3094
  isOpen: s,
@@ -3098,8 +3099,8 @@ const ei = (i) => /* @__PURE__ */ e.jsxs(
3098
3099
  onDisqualify: j
3099
3100
  }
3100
3101
  ),
3101
- !s && m > 0 && !o && /* @__PURE__ */ e.jsx(
3102
- ti,
3102
+ !s && m > 0 && !o && !l && /* @__PURE__ */ e.jsx(
3103
+ ri,
3103
3104
  {
3104
3105
  showHardReloadWarning: !x,
3105
3106
  logViolation: h,
@@ -3108,26 +3109,27 @@ const ei = (i) => /* @__PURE__ */ e.jsxs(
3108
3109
  )
3109
3110
  ] });
3110
3111
  }
3111
- ), ri = ({
3112
+ ), ni = ({
3112
3113
  interviewTitle: i,
3113
3114
  interviewId: r,
3114
3115
  onComplete: t,
3115
3116
  onDisqualify: s,
3116
3117
  className: n = ""
3117
3118
  }) => {
3118
- const o = Et(), { baseUrl: a, authToken: l } = De(), { timers: w, stt: d, tts: u, proctoring: h } = at(), m = E(null), [c, x] = k(null), [b, j] = k(""), g = E(""), v = E(null), S = {
3119
+ var re;
3120
+ const o = Ct(), { baseUrl: a, authToken: l } = Pe(), { timers: w, stt: d, tts: u, proctoring: h } = lt(), m = E(null), [c, x] = k(null), [p, j] = k(""), g = E(""), y = E(null), S = {
3119
3121
  thinkingTime: (w == null ? void 0 : w.thinkingDuration) || 30,
3120
3122
  answeringTime: (w == null ? void 0 : w.answeringDuration) || 120,
3121
3123
  editingTime: (w == null ? void 0 : w.editingDuration) || 30
3122
- }, { thinkingTime: N, answeringTime: _, editingTime: y } = S;
3124
+ }, { thinkingTime: N, answeringTime: _, editingTime: v } = S;
3123
3125
  C(() => {
3124
- g.current = b;
3125
- }, [b]);
3126
+ g.current = p;
3127
+ }, [p]);
3126
3128
  const R = E(!1), {
3127
3129
  speak: A,
3128
3130
  stop: f,
3129
3131
  error: M
3130
- } = Mt({
3132
+ } = _t({
3131
3133
  config: {
3132
3134
  baseUrl: a,
3133
3135
  provider: u == null ? void 0 : u.provider,
@@ -3140,49 +3142,50 @@ const ei = (i) => /* @__PURE__ */ e.jsxs(
3140
3142
  R.current || (R.current = !0, P());
3141
3143
  }
3142
3144
  }), L = E(!1), O = E(!1), {
3143
- startRecording: q,
3145
+ startRecording: U,
3144
3146
  stopRecording: z,
3145
3147
  transcribe: H,
3146
3148
  error: Y
3147
- } = St({
3149
+ } = Rt({
3148
3150
  config: {
3149
3151
  baseUrl: a,
3150
3152
  provider: d == null ? void 0 : d.provider,
3151
3153
  model: d == null ? void 0 : d.model,
3152
3154
  language: d == null ? void 0 : d.language,
3153
- authToken: l
3155
+ authToken: l,
3156
+ qnaId: ((re = y.current) == null ? void 0 : re.qna_id) || ""
3154
3157
  },
3155
3158
  onStart: () => {
3156
3159
  L.current = !1, O.current = !1;
3157
3160
  },
3158
3161
  onStop: () => {
3159
3162
  },
3160
- onTranscriptionComplete: (p) => {
3161
- j(p.transcript), O.current || (O.current = !0, P());
3163
+ onTranscriptionComplete: (b) => {
3164
+ j(b.transcript), O.current || (O.current = !0, P());
3162
3165
  },
3163
- onError: (p) => {
3164
- console.error("STT Error:", p), L.current || (L.current = !0, P());
3166
+ onError: (b) => {
3167
+ console.error("STT Error:", b), L.current || (L.current = !0, P());
3165
3168
  }
3166
- }), { state: B, startQuestion: U, nextPhase: P, completeInterview: Q } = bt({
3169
+ }), { state: B, startQuestion: q, nextPhase: P, completeInterview: Q } = vt({
3167
3170
  config: {
3168
3171
  thinkingDuration: N,
3169
3172
  answeringDuration: _,
3170
- editingDuration: y
3173
+ editingDuration: v
3171
3174
  },
3172
3175
  callbacks: {
3173
- onPhaseChange: (p) => {
3174
- switch (p) {
3176
+ onPhaseChange: (b) => {
3177
+ switch (b) {
3175
3178
  case D.FETCHING_QUESTION:
3176
3179
  W();
3177
3180
  break;
3178
3181
  case D.READING_QUESTION:
3179
- de();
3182
+ we();
3180
3183
  break;
3181
3184
  case D.ANSWERING:
3182
- we();
3185
+ ue();
3183
3186
  break;
3184
3187
  case D.TRANSCRIBING:
3185
- ue();
3188
+ he();
3186
3189
  break;
3187
3190
  case D.SUBMITTING:
3188
3191
  K();
@@ -3195,77 +3198,77 @@ const ei = (i) => /* @__PURE__ */ e.jsxs(
3195
3198
  }
3196
3199
  });
3197
3200
  C(() => {
3198
- U();
3201
+ q();
3199
3202
  }, []);
3200
- const { execute: W, loading: ce } = yt(
3203
+ const { execute: W, loading: de } = jt(
3201
3204
  async () => {
3202
3205
  var G, X;
3203
- const p = await o.generateQuestion({
3206
+ const b = await o.generateQuestion({
3204
3207
  interviewId: r,
3205
- question: ((G = v.current) == null ? void 0 : G.question) || "",
3206
- qnaId: ((X = v.current) == null ? void 0 : X.qna_id) || "",
3208
+ question: ((G = y.current) == null ? void 0 : G.question) || "",
3209
+ qnaId: ((X = y.current) == null ? void 0 : X.qna_id) || "",
3207
3210
  answer: g.current
3208
3211
  });
3209
- return v.current = p.data, p;
3212
+ return y.current = b.data, b;
3210
3213
  },
3211
3214
  {
3212
- onSuccess: async (p) => {
3213
- p && p.data && (j(""), x(p.data), P());
3215
+ onSuccess: async (b) => {
3216
+ b && b.data && (j(""), x(b.data), P());
3214
3217
  },
3215
- onError: (p) => {
3216
- console.error("Failed to fetch questions:", p);
3218
+ onError: (b) => {
3219
+ console.error("Failed to fetch questions:", b);
3217
3220
  }
3218
3221
  }
3219
3222
  ), K = T(async () => {
3220
- U();
3221
- }, [U]), de = T(async () => {
3222
- var p;
3223
- if ((p = v.current) != null && p.question)
3223
+ q();
3224
+ }, [q]), we = T(async () => {
3225
+ var b;
3226
+ if ((b = y.current) != null && b.question)
3224
3227
  try {
3225
- R.current = !1, await A(v.current.question), v.current.is_interview_done && (await dt(2e3), Q());
3228
+ R.current = !1, await A(y.current.question), y.current.is_interview_done && (await ut(2e3), Q());
3226
3229
  } catch (G) {
3227
3230
  console.error("Failed to speak question:", G);
3228
3231
  }
3229
3232
  else
3230
3233
  P();
3231
- }, [A, P, Q]), we = T(async () => {
3234
+ }, [A, P, Q]), ue = T(async () => {
3232
3235
  try {
3233
- await q(_);
3234
- } catch (p) {
3235
- console.error("Failed to start recording:", p), P();
3236
+ await U(_);
3237
+ } catch (b) {
3238
+ console.error("Failed to start recording:", b), P();
3236
3239
  }
3237
- }, [q, P]), ue = T(async () => {
3240
+ }, [U, P]), he = T(async () => {
3238
3241
  try {
3239
- const p = await z();
3240
- await H(p);
3241
- } catch (p) {
3242
- console.error("STT processing failed:", p), !L.current && !O.current && (L.current = !0, P());
3242
+ const b = await z();
3243
+ await H(b);
3244
+ } catch (b) {
3245
+ console.error("STT processing failed:", b), !L.current && !O.current && (L.current = !0, P());
3243
3246
  }
3244
3247
  }, [z, H, P]), J = T(
3245
- async (p) => {
3248
+ async (b) => {
3246
3249
  var X;
3247
3250
  f(), await ((X = m.current) == null ? void 0 : X.exitFullScreenIntentionally()), (await o.generateQuestion({
3248
3251
  interviewId: r,
3249
3252
  isInterviewDone: !0
3250
- })).success && (p == null || p(), Q(), sessionStorage.removeItem(xe));
3253
+ })).success && (b == null || b(), Q(), sessionStorage.removeItem(be));
3251
3254
  },
3252
3255
  [r, f, o]
3253
3256
  ), ie = () => {
3254
- const { phase: p } = B;
3255
- switch (p) {
3257
+ const { phase: b } = B;
3258
+ switch (b) {
3256
3259
  case D.IDLE:
3257
3260
  return /* @__PURE__ */ e.jsxs("div", { className: "iw-text-center iw-flex iw-flex-col iw-items-center iw-justify-center iw-gap-2 iw-h-full", children: [
3258
3261
  /* @__PURE__ */ e.jsx("h3", { className: "iw-text-lg iw-font-semibold iw-text-gray-900 iw-mb-1", children: "Ready to start the Interview?" }),
3259
3262
  /* @__PURE__ */ e.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.` }),
3260
- /* @__PURE__ */ e.jsx(V, { onClick: U, className: "iw-mt-2 iw-w-40", children: "Start Interview" })
3263
+ /* @__PURE__ */ e.jsx(V, { onClick: q, className: "iw-mt-2 iw-w-40", children: "Start Interview" })
3261
3264
  ] });
3262
3265
  case D.FETCHING_QUESTION:
3263
- return /* @__PURE__ */ e.jsx(Gt, {});
3266
+ return /* @__PURE__ */ e.jsx(zt, {});
3264
3267
  case D.READING_QUESTION:
3265
- return /* @__PURE__ */ e.jsx(zt, { ttsError: M });
3268
+ return /* @__PURE__ */ e.jsx(Yt, { ttsError: M });
3266
3269
  case D.THINKING:
3267
3270
  return /* @__PURE__ */ e.jsx(
3268
- Ht,
3271
+ Qt,
3269
3272
  {
3270
3273
  state: B,
3271
3274
  thinkingTime: N,
@@ -3274,7 +3277,7 @@ const ei = (i) => /* @__PURE__ */ e.jsxs(
3274
3277
  );
3275
3278
  case D.ANSWERING:
3276
3279
  return /* @__PURE__ */ e.jsx(
3277
- Wt,
3280
+ Vt,
3278
3281
  {
3279
3282
  state: B,
3280
3283
  answeringTime: _,
@@ -3283,18 +3286,18 @@ const ei = (i) => /* @__PURE__ */ e.jsxs(
3283
3286
  }
3284
3287
  );
3285
3288
  case D.TRANSCRIBING:
3286
- return /* @__PURE__ */ e.jsx(Yt, { sttError: Y });
3289
+ return /* @__PURE__ */ e.jsx(Kt, { sttError: Y });
3287
3290
  case D.EDITING:
3288
3291
  case D.SUBMITTING:
3289
3292
  return /* @__PURE__ */ e.jsx("div", { className: "iw-space-y-4 iw-h-full", children: /* @__PURE__ */ e.jsx(
3290
- Lt,
3293
+ Ot,
3291
3294
  {
3292
- value: b,
3295
+ value: p,
3293
3296
  onChange: (G) => j(G.target.value),
3294
3297
  onSubmit: () => P(),
3295
- isSubmitDisabled: !b.trim() || ce,
3298
+ isSubmitDisabled: !p.trim() || de,
3296
3299
  state: B,
3297
- editingTime: y
3300
+ editingTime: v
3298
3301
  }
3299
3302
  ) });
3300
3303
  case D.COMPLETED:
@@ -3304,20 +3307,20 @@ const ei = (i) => /* @__PURE__ */ e.jsxs(
3304
3307
  }
3305
3308
  };
3306
3309
  return /* @__PURE__ */ e.jsx(e.Fragment, { children: h != null && h.enabled ? /* @__PURE__ */ e.jsxs(
3307
- ii,
3310
+ si,
3308
3311
  {
3309
3312
  ref: m,
3310
3313
  onDisqualify: () => J(s),
3311
3314
  children: [
3312
3315
  /* @__PURE__ */ e.jsx(
3313
- Ee,
3316
+ Ce,
3314
3317
  {
3315
3318
  title: i,
3316
3319
  onExit: () => J()
3317
3320
  }
3318
3321
  ),
3319
3322
  /* @__PURE__ */ e.jsx(
3320
- ke,
3323
+ Te,
3321
3324
  {
3322
3325
  currentQuestion: c,
3323
3326
  phase: B.phase,
@@ -3329,14 +3332,14 @@ const ei = (i) => /* @__PURE__ */ e.jsxs(
3329
3332
  }
3330
3333
  ) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
3331
3334
  /* @__PURE__ */ e.jsx(
3332
- Ee,
3335
+ Ce,
3333
3336
  {
3334
3337
  title: i,
3335
3338
  onExit: () => J()
3336
3339
  }
3337
3340
  ),
3338
3341
  /* @__PURE__ */ e.jsx(
3339
- ke,
3342
+ Te,
3340
3343
  {
3341
3344
  currentQuestion: c,
3342
3345
  phase: B.phase,
@@ -3345,21 +3348,21 @@ const ei = (i) => /* @__PURE__ */ e.jsxs(
3345
3348
  }
3346
3349
  )
3347
3350
  ] }) });
3348
- }, si = ({
3351
+ }, ai = ({
3349
3352
  title: i,
3350
3353
  interviewId: r,
3351
3354
  onInterviewEnd: t,
3352
3355
  onInterviewDisqualify: s,
3353
3356
  className: n = ""
3354
3357
  }) => {
3355
- const [o, a] = ge.useState(!1), [l, w] = ge.useState(!0), d = E(null);
3358
+ const [o, a] = xe.useState(!1), [l, w] = xe.useState(!0), d = E(null);
3356
3359
  return o ? /* @__PURE__ */ e.jsx("div", { className: "interview-widget-container", children: /* @__PURE__ */ e.jsx(
3357
3360
  "div",
3358
3361
  {
3359
3362
  ref: d,
3360
3363
  className: `iw-flex iw-flex-col iw-rounded-xl iw-shadow-lg iw-overflow-hidden iw-h-[calc(100vh-1rem)] ${n}`,
3361
3364
  children: /* @__PURE__ */ e.jsx("div", { className: " iw-h-full iw-flex iw-flex-col", children: /* @__PURE__ */ e.jsx(
3362
- ri,
3365
+ ni,
3363
3366
  {
3364
3367
  interviewTitle: i ?? "Interview",
3365
3368
  interviewId: r,
@@ -3371,7 +3374,7 @@ const ei = (i) => /* @__PURE__ */ e.jsxs(
3371
3374
  ) })
3372
3375
  }
3373
3376
  ) }) : /* @__PURE__ */ e.jsx("div", { className: "interview-widget-container", children: /* @__PURE__ */ e.jsx(
3374
- gt,
3377
+ xt,
3375
3378
  {
3376
3379
  isOpen: l,
3377
3380
  onStart: () => {
@@ -3381,11 +3384,11 @@ const ei = (i) => /* @__PURE__ */ e.jsxs(
3381
3384
  ) });
3382
3385
  };
3383
3386
  typeof window < "u" && (window.InterviewWidget = {
3384
- InterviewWidget: si,
3385
- InterviewWidgetProvider: nt
3387
+ InterviewWidget: ai,
3388
+ InterviewWidgetProvider: ot
3386
3389
  });
3387
3390
  export {
3388
- si as InterviewWidget,
3389
- nt as InterviewWidgetProvider,
3390
- si as default
3391
+ ai as InterviewWidget,
3392
+ ot as InterviewWidgetProvider,
3393
+ ai as default
3391
3394
  };