@eka-care/ekascribe-ts-sdk 3.0.0 → 3.0.1

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/index.mjs CHANGED
@@ -30,9 +30,9 @@ class Nr {
30
30
  credentials: "include"
31
31
  });
32
32
  if (a.status === 401)
33
- throw new L("Unauthorized", 401);
33
+ throw new $("Unauthorized", 401);
34
34
  if (a.status === 403)
35
- throw new L("Forbidden", 403);
35
+ throw new $("Forbidden", 403);
36
36
  let c;
37
37
  return a.headers.get("content-type")?.includes("application/json") ? c = await a.json() : c = await a.text(), {
38
38
  status: a.status,
@@ -53,7 +53,7 @@ class Nr {
53
53
  }), this.tokenRefreshPromise);
54
54
  }
55
55
  isUnauthorizedError(t) {
56
- return t instanceof L && t.status === 401;
56
+ return t instanceof $ && t.status === 401;
57
57
  }
58
58
  extractHeaders(t) {
59
59
  const n = {};
@@ -62,7 +62,7 @@ class Nr {
62
62
  }), n;
63
63
  }
64
64
  }
65
- class L extends Error {
65
+ class $ extends Error {
66
66
  constructor(t, n) {
67
67
  super(t), this.status = n, this.name = "TransportError";
68
68
  }
@@ -84,6 +84,11 @@ class Or {
84
84
  setAuthToken(t) {
85
85
  this.accessToken = t;
86
86
  }
87
+ destroy() {
88
+ for (const [, t] of this.pendingRequests)
89
+ t.reject(new $("Transport destroyed", 0));
90
+ this.pendingRequests.clear();
91
+ }
87
92
  async request(t) {
88
93
  try {
89
94
  return await this.executeRequest(t);
@@ -108,16 +113,16 @@ class Or {
108
113
  };
109
114
  return new Promise((a, c) => {
110
115
  const u = setTimeout(() => {
111
- this.pendingRequests.delete(n), c(new L("IPC request timed out", 408));
116
+ this.pendingRequests.delete(n), c(new $("IPC request timed out", 408));
112
117
  }, r);
113
118
  this.pendingRequests.set(n, {
114
119
  resolve: (d) => {
115
120
  if (clearTimeout(u), d.status === 401) {
116
- c(new L("Unauthorized", 401));
121
+ c(new $("Unauthorized", 401));
117
122
  return;
118
123
  }
119
124
  if (d.status === 403) {
120
- c(new L("Forbidden", 403));
125
+ c(new $("Forbidden", 403));
121
126
  return;
122
127
  }
123
128
  a(d);
@@ -138,20 +143,20 @@ class Or {
138
143
  }), this.tokenRefreshPromise);
139
144
  }
140
145
  isUnauthorizedError(t) {
141
- return t instanceof L && t.status === 401;
146
+ return t instanceof $ && t.status === 401;
142
147
  }
143
148
  generateCorrelationId() {
144
149
  return `${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;
145
150
  }
146
151
  }
147
- const Dr = {
152
+ const Ar = {
148
153
  voiceV1: "https://api.dev.eka.care/voice/api/v1",
149
154
  voiceV2: "https://api.dev.eka.care/voice/api/v2",
150
155
  voiceV3: "https://api.dev.eka.care/voice/api/v3",
151
156
  cookV1: "https://deepthought-genai.dev.eka.care/api/v1",
152
157
  ekaHost: "https://api.dev.eka.care",
153
158
  parchiHost: "https://parchi.dev.eka.care"
154
- }, Ar = {
159
+ }, Dr = {
155
160
  voiceV1: "https://api.eka.care/voice/api/v1",
156
161
  voiceV2: "https://api.eka.care/voice/api/v2",
157
162
  voiceV3: "https://api.eka.care/voice/api/v3",
@@ -160,7 +165,7 @@ const Dr = {
160
165
  parchiHost: "https://parchi.eka.care"
161
166
  };
162
167
  function xr(e) {
163
- return e === "PROD" ? Ar : Dr;
168
+ return e === "PROD" ? Dr : Ar;
164
169
  }
165
170
  class Fr {
166
171
  constructor() {
@@ -181,7 +186,8 @@ class Fr {
181
186
  let s;
182
187
  for (const o of r)
183
188
  try {
184
- s = await o(...n);
189
+ const i = await o(...n);
190
+ s === void 0 && (s = i);
185
191
  } catch (i) {
186
192
  console.error(`[EkaScribe] Callback error in '${t}':`, i);
187
193
  }
@@ -192,15 +198,15 @@ class Fr {
192
198
  return !!n && n.size > 0;
193
199
  }
194
200
  }
195
- const _ = typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__, g = globalThis, q = "10.43.0";
201
+ const _ = typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__, E = globalThis, q = "10.43.0";
196
202
  function Ct() {
197
- return Ot(g), g;
203
+ return Ot(E), E;
198
204
  }
199
205
  function Ot(e) {
200
206
  const t = e.__SENTRY__ = e.__SENTRY__ || {};
201
207
  return t.version = t.version || q, t[q] = t[q] || {};
202
208
  }
203
- function nt(e, t, n = g) {
209
+ function nt(e, t, n = E) {
204
210
  const r = n.__SENTRY__ = n.__SENTRY__ || {}, s = r[q] = r[q] || {};
205
211
  return s[e] || (s[e] = t());
206
212
  }
@@ -212,11 +218,11 @@ const $r = [
212
218
  "log",
213
219
  "assert",
214
220
  "trace"
215
- ], Mr = "Sentry Logger ", wt = {};
221
+ ], Pr = "Sentry Logger ", wt = {};
216
222
  function rt(e) {
217
- if (!("console" in g))
223
+ if (!("console" in E))
218
224
  return e();
219
- const t = g.console, n = {}, r = Object.keys(wt);
225
+ const t = E.console, n = {}, r = Object.keys(wt);
220
226
  r.forEach((s) => {
221
227
  const o = wt[s];
222
228
  n[s] = t[s], t[s] = o;
@@ -229,7 +235,7 @@ function rt(e) {
229
235
  });
230
236
  }
231
237
  }
232
- function Pr() {
238
+ function Mr() {
233
239
  he().enabled = !0;
234
240
  }
235
241
  function Ur() {
@@ -249,7 +255,7 @@ function Br(...e) {
249
255
  }
250
256
  function pe(e, ...t) {
251
257
  _ && On() && rt(() => {
252
- g.console[e](`${Mr}[${e}]:`, ...t);
258
+ E.console[e](`${Pr}[${e}]:`, ...t);
253
259
  });
254
260
  }
255
261
  function he() {
@@ -257,7 +263,7 @@ function he() {
257
263
  }
258
264
  const h = {
259
265
  /** Enable logging. */
260
- enable: Pr,
266
+ enable: Mr,
261
267
  /** Disable logging. */
262
268
  disable: Ur,
263
269
  /** Check if logging is enabled. */
@@ -268,8 +274,8 @@ const h = {
268
274
  warn: Hr,
269
275
  /** Log an error. */
270
276
  error: Br
271
- }, Dn = 50, X = "?", De = /\(error: (.*)\)/, Ae = /captureMessage|captureException/;
272
- function An(...e) {
277
+ }, An = 50, X = "?", Ae = /\(error: (.*)\)/, De = /captureMessage|captureException/;
278
+ function Dn(...e) {
273
279
  const t = e.sort((n, r) => n[0] - r[0]).map((n) => n[1]);
274
280
  return (n, r = 0, s = 0) => {
275
281
  const o = [], i = n.split(`
@@ -277,7 +283,7 @@ function An(...e) {
277
283
  for (let a = r; a < i.length; a++) {
278
284
  let c = i[a];
279
285
  c.length > 1024 && (c = c.slice(0, 1024));
280
- const u = De.test(c) ? c.replace(De, "$1") : c;
286
+ const u = Ae.test(c) ? c.replace(Ae, "$1") : c;
281
287
  if (!u.match(/\S*Error: /)) {
282
288
  for (const d of t) {
283
289
  const l = d(u);
@@ -286,7 +292,7 @@ function An(...e) {
286
292
  break;
287
293
  }
288
294
  }
289
- if (o.length >= Dn + s)
295
+ if (o.length >= An + s)
290
296
  break;
291
297
  }
292
298
  }
@@ -294,13 +300,13 @@ function An(...e) {
294
300
  };
295
301
  }
296
302
  function jr(e) {
297
- return Array.isArray(e) ? An(...e) : e;
303
+ return Array.isArray(e) ? Dn(...e) : e;
298
304
  }
299
305
  function Wr(e) {
300
306
  if (!e.length)
301
307
  return [];
302
308
  const t = Array.from(e);
303
- return /sentryWrapped/.test(mt(t).function || "") && t.pop(), t.reverse(), Ae.test(mt(t).function || "") && (t.pop(), Ae.test(mt(t).function || "") && t.pop()), t.slice(0, Dn).map((n) => ({
309
+ return /sentryWrapped/.test(mt(t).function || "") && t.pop(), t.reverse(), De.test(mt(t).function || "") && (t.pop(), De.test(mt(t).function || "") && t.pop()), t.slice(0, An).map((n) => ({
304
310
  ...n,
305
311
  filename: n.filename || mt(t).filename,
306
312
  function: n.function || X
@@ -347,7 +353,7 @@ function Y(e, t) {
347
353
  }
348
354
  }
349
355
  }
350
- function D(e, t) {
356
+ function A(e, t) {
351
357
  const n = e && St[e];
352
358
  if (n)
353
359
  for (const r of n)
@@ -369,15 +375,15 @@ function Vr(e) {
369
375
  K(t, e), Y(t, Gr);
370
376
  }
371
377
  function Gr() {
372
- Lt = g.onerror, g.onerror = function(e, t, n, r, s) {
373
- return D("error", {
378
+ Lt = E.onerror, E.onerror = function(e, t, n, r, s) {
379
+ return A("error", {
374
380
  column: r,
375
381
  error: s,
376
382
  line: n,
377
383
  msg: e,
378
384
  url: t
379
385
  }), Lt ? Lt.apply(this, arguments) : !1;
380
- }, g.onerror.__SENTRY_INSTRUMENTED__ = !0;
386
+ }, E.onerror.__SENTRY_INSTRUMENTED__ = !0;
381
387
  }
382
388
  let Ht = null;
383
389
  function zr(e) {
@@ -385,12 +391,12 @@ function zr(e) {
385
391
  K(t, e), Y(t, qr);
386
392
  }
387
393
  function qr() {
388
- Ht = g.onunhandledrejection, g.onunhandledrejection = function(e) {
389
- return D("unhandledrejection", e), Ht ? Ht.apply(this, arguments) : !0;
390
- }, g.onunhandledrejection.__SENTRY_INSTRUMENTED__ = !0;
394
+ Ht = E.onunhandledrejection, E.onunhandledrejection = function(e) {
395
+ return A("unhandledrejection", e), Ht ? Ht.apply(this, arguments) : !0;
396
+ }, E.onunhandledrejection.__SENTRY_INSTRUMENTED__ = !0;
391
397
  }
392
398
  const Fn = Object.prototype.toString;
393
- function Dt(e) {
399
+ function At(e) {
394
400
  switch (Fn.call(e)) {
395
401
  case "[object Error]":
396
402
  case "[object Exception]":
@@ -413,13 +419,13 @@ function $e(e) {
413
419
  function Xr(e) {
414
420
  return st(e, "DOMException");
415
421
  }
416
- function $(e) {
422
+ function P(e) {
417
423
  return st(e, "String");
418
424
  }
419
425
  function _e(e) {
420
426
  return typeof e == "object" && e !== null && "__sentry_template_string__" in e && "__sentry_template_values__" in e;
421
427
  }
422
- function At(e) {
428
+ function Dt(e) {
423
429
  return e === null || _e(e) || typeof e != "object" && typeof e != "function";
424
430
  }
425
431
  function ct(e) {
@@ -447,13 +453,13 @@ function B(e, t) {
447
453
  return !1;
448
454
  }
449
455
  }
450
- function Mn(e) {
456
+ function Pn(e) {
451
457
  return !!(typeof e == "object" && e !== null && (e.__isVue || e._isVue || e.__v_isVNode));
452
458
  }
453
- function Pn(e) {
459
+ function Mn(e) {
454
460
  return typeof Request < "u" && B(e, Request);
455
461
  }
456
- const me = g, Zr = 80;
462
+ const me = E, Zr = 80;
457
463
  function Un(e, t = {}) {
458
464
  if (!e)
459
465
  return "<unknown>";
@@ -490,7 +496,7 @@ function Qr(e, t) {
490
496
  else {
491
497
  n.id && r.push(`#${n.id}`);
492
498
  const i = n.className;
493
- if (i && $(i)) {
499
+ if (i && P(i)) {
494
500
  const a = i.split(/\s+/);
495
501
  for (const c of a)
496
502
  r.push(`.${c}`);
@@ -565,32 +571,32 @@ function ye(e) {
565
571
  return e.__sentry_original__;
566
572
  }
567
573
  function Hn(e) {
568
- if (Dt(e))
574
+ if (At(e))
569
575
  return {
570
576
  message: e.message,
571
577
  name: e.name,
572
578
  stack: e.stack,
573
- ...Pe(e)
579
+ ...Me(e)
574
580
  };
575
581
  if (xt(e)) {
576
582
  const t = {
577
583
  type: e.type,
578
- target: Me(e.target),
579
- currentTarget: Me(e.currentTarget),
580
- ...Pe(e)
584
+ target: Pe(e.target),
585
+ currentTarget: Pe(e.currentTarget),
586
+ ...Me(e)
581
587
  };
582
588
  return typeof CustomEvent < "u" && B(e, CustomEvent) && (t.detail = e.detail), t;
583
589
  } else
584
590
  return e;
585
591
  }
586
- function Me(e) {
592
+ function Pe(e) {
587
593
  try {
588
594
  return Kr(e) ? Un(e) : Object.prototype.toString.call(e);
589
595
  } catch {
590
596
  return "<unknown>";
591
597
  }
592
598
  }
593
- function Pe(e) {
599
+ function Me(e) {
594
600
  if (typeof e == "object" && e !== null) {
595
601
  const t = {};
596
602
  for (const n in e)
@@ -607,7 +613,7 @@ let J;
607
613
  function Ft(e) {
608
614
  if (J !== void 0)
609
615
  return J ? J(e) : e();
610
- const t = Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"), n = g;
616
+ const t = Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"), n = E;
611
617
  return t in n && typeof n[t] == "function" ? (J = n[t], J(e)) : (J = null, e());
612
618
  }
613
619
  function kt() {
@@ -626,7 +632,7 @@ function Ue(e, t) {
626
632
  for (let r = 0; r < e.length; r++) {
627
633
  const s = e[r];
628
634
  try {
629
- Mn(s) ? n.push(xn(s)) : n.push(String(s));
635
+ Pn(s) ? n.push(xn(s)) : n.push(String(s));
630
636
  } catch {
631
637
  n.push("[value cannot be serialized]");
632
638
  }
@@ -634,13 +640,13 @@ function Ue(e, t) {
634
640
  return n.join(t);
635
641
  }
636
642
  function Tt(e, t, n = !1) {
637
- return $(e) ? Yr(t) ? t.test(e) : $(t) ? n ? e === t : e.includes(t) : !1 : !1;
643
+ return P(e) ? Yr(t) ? t.test(e) : P(t) ? n ? e === t : e.includes(t) : !1 : !1;
638
644
  }
639
- function Mt(e, t = [], n = !1) {
645
+ function Pt(e, t = [], n = !1) {
640
646
  return t.some((r) => Tt(e, r, n));
641
647
  }
642
648
  function ns() {
643
- const e = g;
649
+ const e = E;
644
650
  return e.crypto || e.msCrypto;
645
651
  }
646
652
  let Bt;
@@ -705,7 +711,7 @@ function ft() {
705
711
  return $t() / jn;
706
712
  }
707
713
  function os() {
708
- const { performance: e } = g;
714
+ const { performance: e } = E;
709
715
  if (!e?.now || !e.timeOrigin)
710
716
  return ft;
711
717
  const t = e.timeOrigin;
@@ -788,7 +794,7 @@ function We(e) {
788
794
  return e[Jt];
789
795
  }
790
796
  const us = 100;
791
- class A {
797
+ class D {
792
798
  /** Flag if notifying is happening. */
793
799
  /** Callback for client to receive scope changes. */
794
800
  /** Callback list that will be called during event processing. */
@@ -827,7 +833,7 @@ class A {
827
833
  * Clone all data from this scope into a new scope.
828
834
  */
829
835
  clone() {
830
- const t = new A();
836
+ const t = new D();
831
837
  return t._breadcrumbs = [...this._breadcrumbs], t._tags = { ...this._tags }, t._attributes = { ...this._attributes }, t._extra = { ...this._extra }, t._contexts = { ...this._contexts }, this._contexts.flags && (t._contexts.flags = {
832
838
  values: [...this._contexts.flags.values]
833
839
  }), t._user = this._user, t._level = this._level, t._session = this._session, t._transactionName = this._transactionName, t._fingerprint = this._fingerprint, t._eventProcessors = [...this._eventProcessors], t._attachments = [...this._attachments], t._sdkProcessingMetadata = { ...this._sdkProcessingMetadata }, t._propagationContext = { ...this._propagationContext }, t._client = this._client, t._lastEventId = this._lastEventId, t._conversationId = this._conversationId, je(t, We(this)), t;
@@ -1050,7 +1056,7 @@ class A {
1050
1056
  update(t) {
1051
1057
  if (!t)
1052
1058
  return this;
1053
- const n = typeof t == "function" ? t(this) : t, r = n instanceof A ? n.getScopeData() : ct(n) ? t : void 0, {
1059
+ const n = typeof t == "function" ? t(this) : t, r = n instanceof D ? n.getScopeData() : ct(n) ? t : void 0, {
1054
1060
  tags: s,
1055
1061
  attributes: o,
1056
1062
  extra: i,
@@ -1215,17 +1221,17 @@ class A {
1215
1221
  }
1216
1222
  }
1217
1223
  function ds() {
1218
- return nt("defaultCurrentScope", () => new A());
1224
+ return nt("defaultCurrentScope", () => new D());
1219
1225
  }
1220
1226
  function ls() {
1221
- return nt("defaultIsolationScope", () => new A());
1227
+ return nt("defaultIsolationScope", () => new D());
1222
1228
  }
1223
1229
  class fs {
1224
1230
  constructor(t, n) {
1225
1231
  let r;
1226
- t ? r = t : r = new A();
1232
+ t ? r = t : r = new D();
1227
1233
  let s;
1228
- n ? s = n : s = new A(), this._stack = [{ scope: r }], this._isolationScope = s;
1234
+ n ? s = n : s = new D(), this._stack = [{ scope: r }], this._isolationScope = s;
1229
1235
  }
1230
1236
  /**
1231
1237
  * Fork a scope for the stack.
@@ -1323,7 +1329,7 @@ function V() {
1323
1329
  return Ee(e).getIsolationScope();
1324
1330
  }
1325
1331
  function ms() {
1326
- return nt("globalScope", () => new A());
1332
+ return nt("globalScope", () => new D());
1327
1333
  }
1328
1334
  function gs(...e) {
1329
1335
  const t = Ct(), n = Ee(t);
@@ -1362,13 +1368,13 @@ function zn(e) {
1362
1368
  isolationScope: Cs(t[Ns])
1363
1369
  };
1364
1370
  }
1365
- const Os = "sentry-", Ds = /^sentry-/;
1366
- function As(e) {
1371
+ const Os = "sentry-", As = /^sentry-/;
1372
+ function Ds(e) {
1367
1373
  const t = xs(e);
1368
1374
  if (!t)
1369
1375
  return;
1370
1376
  const n = Object.entries(t).reduce((r, [s, o]) => {
1371
- if (s.match(Ds)) {
1377
+ if (s.match(As)) {
1372
1378
  const i = s.slice(Os.length);
1373
1379
  r[i] = o;
1374
1380
  }
@@ -1378,7 +1384,7 @@ function As(e) {
1378
1384
  return n;
1379
1385
  }
1380
1386
  function xs(e) {
1381
- if (!(!e || !$(e) && !Array.isArray(e)))
1387
+ if (!(!e || !P(e) && !Array.isArray(e)))
1382
1388
  return Array.isArray(e) ? e.reduce((t, n) => {
1383
1389
  const r = Ge(n);
1384
1390
  return Object.entries(r).forEach(([s, o]) => {
@@ -1402,14 +1408,14 @@ function Ge(e) {
1402
1408
  }).reduce((t, [n, r]) => (n && r && (t[n] = r), t), {});
1403
1409
  }
1404
1410
  const Fs = /^o(\d+)\./, $s = /^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;
1405
- function Ms(e) {
1411
+ function Ps(e) {
1406
1412
  return e === "http" || e === "https";
1407
1413
  }
1408
1414
  function ht(e, t = !1) {
1409
1415
  const { host: n, path: r, pass: s, port: o, projectId: i, protocol: a, publicKey: c } = e;
1410
1416
  return `${a}://${c}${t && s ? `:${s}` : ""}@${n}${o ? `:${o}` : ""}/${r && `${r}/`}${i}`;
1411
1417
  }
1412
- function Ps(e) {
1418
+ function Ms(e) {
1413
1419
  const t = $s.exec(e);
1414
1420
  if (!t) {
1415
1421
  rt(() => {
@@ -1441,7 +1447,7 @@ function Us(e) {
1441
1447
  if (!_)
1442
1448
  return !0;
1443
1449
  const { port: t, projectId: n, protocol: r } = e;
1444
- return ["protocol", "publicKey", "host", "projectId"].find((i) => e[i] ? !1 : (h.error(`Invalid Sentry Dsn: ${i} missing`), !0)) ? !1 : n.match(/^\d+$/) ? Ms(r) ? t && isNaN(parseInt(t, 10)) ? (h.error(`Invalid Sentry Dsn: Invalid port ${t}`), !1) : !0 : (h.error(`Invalid Sentry Dsn: Invalid protocol ${r}`), !1) : (h.error(`Invalid Sentry Dsn: Invalid projectId ${n}`), !1);
1450
+ return ["protocol", "publicKey", "host", "projectId"].find((i) => e[i] ? !1 : (h.error(`Invalid Sentry Dsn: ${i} missing`), !0)) ? !1 : n.match(/^\d+$/) ? Ps(r) ? t && isNaN(parseInt(t, 10)) ? (h.error(`Invalid Sentry Dsn: Invalid port ${t}`), !1) : !0 : (h.error(`Invalid Sentry Dsn: Invalid protocol ${r}`), !1) : (h.error(`Invalid Sentry Dsn: Invalid projectId ${n}`), !1);
1445
1451
  }
1446
1452
  function Ls(e) {
1447
1453
  return e.match(Fs)?.[1];
@@ -1452,7 +1458,7 @@ function Hs(e) {
1452
1458
  return t.orgId ? r = String(t.orgId) : n && (r = Ls(n)), r;
1453
1459
  }
1454
1460
  function Bs(e) {
1455
- const t = typeof e == "string" ? Ps(e) : qn(e);
1461
+ const t = typeof e == "string" ? Ms(e) : qn(e);
1456
1462
  if (!(!t || !Us(t)))
1457
1463
  return t;
1458
1464
  }
@@ -1599,13 +1605,13 @@ function eo(e) {
1599
1605
  if (!t)
1600
1606
  return {};
1601
1607
  const n = Kn(e), r = Se(n), s = r.data, o = n.spanContext().traceState, i = o?.get("sentry.sample_rate") ?? s[Ss] ?? s[Ts];
1602
- function a(E) {
1603
- return (typeof i == "number" || typeof i == "string") && (E.sample_rate = `${i}`), E;
1608
+ function a(S) {
1609
+ return (typeof i == "number" || typeof i == "string") && (S.sample_rate = `${i}`), S;
1604
1610
  }
1605
1611
  const c = n[Qs];
1606
1612
  if (c)
1607
1613
  return a(c);
1608
- const u = o?.get("sentry.dsc"), d = u && As(u);
1614
+ const u = o?.get("sentry.dsc"), d = u && Ds(u);
1609
1615
  if (d)
1610
1616
  return a(d);
1611
1617
  const l = Yn(e.spanContext().traceId, t), p = s[Es], f = r.description;
@@ -1657,8 +1663,8 @@ function Zt(e, t, n = 1 / 0, r = 1 / 0, s = io()) {
1657
1663
  d[f] = "[MaxProperties ~]";
1658
1664
  break;
1659
1665
  }
1660
- const E = p[f];
1661
- d[f] = Zt(f, E, c - 1, r, s), l++;
1666
+ const S = p[f];
1667
+ d[f] = Zt(f, S, c - 1, r, s), l++;
1662
1668
  }
1663
1669
  return i(t), d;
1664
1670
  }
@@ -1674,7 +1680,7 @@ function no(e, t) {
1674
1680
  return "[Window]";
1675
1681
  if (typeof document < "u" && t === document)
1676
1682
  return "[Document]";
1677
- if (Mn(t))
1683
+ if (Pn(t))
1678
1684
  return xn(t);
1679
1685
  if (Jr(t))
1680
1686
  return "[SyntheticEvent]";
@@ -1732,7 +1738,7 @@ function co(e, t) {
1732
1738
  return Qt(e, (n, r) => t.includes(r));
1733
1739
  }
1734
1740
  function te(e) {
1735
- const t = Ot(g);
1741
+ const t = Ot(E);
1736
1742
  return t.encodePolyfill ? t.encodePolyfill(e) : new TextEncoder().encode(e);
1737
1743
  }
1738
1744
  function uo(e) {
@@ -1963,33 +1969,33 @@ function ee(e, t, n, r) {
1963
1969
  const o = s({ ...e }, t);
1964
1970
  return _ && o === null && h.log(`Event processor "${s.id || "?"}" dropped event`), lt(o) ? o.then((i) => ee(i, t, n, r + 1)) : ee(o, t, n, r + 1);
1965
1971
  }
1966
- let G, en, nn, P;
1972
+ let G, en, nn, U;
1967
1973
  function Eo(e) {
1968
- const t = g._sentryDebugIds, n = g._debugIds;
1974
+ const t = E._sentryDebugIds, n = E._debugIds;
1969
1975
  if (!t && !n)
1970
1976
  return {};
1971
1977
  const r = t ? Object.keys(t) : [], s = n ? Object.keys(n) : [];
1972
- if (P && r.length === en && s.length === nn)
1973
- return P;
1974
- en = r.length, nn = s.length, P = {}, G || (G = {});
1978
+ if (U && r.length === en && s.length === nn)
1979
+ return U;
1980
+ en = r.length, nn = s.length, U = {}, G || (G = {});
1975
1981
  const o = (i, a) => {
1976
1982
  for (const c of i) {
1977
1983
  const u = a[c], d = G?.[c];
1978
- if (d && P && u)
1979
- P[d[0]] = u, G && (G[c] = [d[0], u]);
1984
+ if (d && U && u)
1985
+ U[d[0]] = u, G && (G[c] = [d[0], u]);
1980
1986
  else if (u) {
1981
1987
  const l = e(c);
1982
1988
  for (let p = l.length - 1; p >= 0; p--) {
1983
- const E = l[p]?.filename;
1984
- if (E && P && G) {
1985
- P[E] = u, G[c] = [E, u];
1989
+ const S = l[p]?.filename;
1990
+ if (S && U && G) {
1991
+ U[S] = u, G[c] = [S, u];
1986
1992
  break;
1987
1993
  }
1988
1994
  }
1989
1995
  }
1990
1996
  }
1991
1997
  };
1992
- return t && o(r, t), n && o(s, n), P;
1998
+ return t && o(r, t), n && o(s, n), U;
1993
1999
  }
1994
2000
  function So(e, t) {
1995
2001
  const { fingerprint: n, span: r, breadcrumbs: s, sdkProcessingMetadata: o } = t;
@@ -2009,10 +2015,10 @@ function rn(e, t) {
2009
2015
  eventProcessors: l,
2010
2016
  attachments: p,
2011
2017
  propagationContext: f,
2012
- transactionName: E,
2018
+ transactionName: S,
2013
2019
  span: R
2014
2020
  } = t;
2015
- it(e, "extra", n), it(e, "tags", r), it(e, "attributes", s), it(e, "user", o), it(e, "contexts", i), e.sdkProcessingMetadata = pt(e.sdkProcessingMetadata, c, 2), a && (e.level = a), E && (e.transactionName = E), R && (e.span = R), u.length && (e.breadcrumbs = [...e.breadcrumbs, ...u]), d.length && (e.fingerprint = [...e.fingerprint, ...d]), l.length && (e.eventProcessors = [...e.eventProcessors, ...l]), p.length && (e.attachments = [...e.attachments, ...p]), e.propagationContext = { ...e.propagationContext, ...f };
2021
+ it(e, "extra", n), it(e, "tags", r), it(e, "attributes", s), it(e, "user", o), it(e, "contexts", i), e.sdkProcessingMetadata = pt(e.sdkProcessingMetadata, c, 2), a && (e.level = a), S && (e.transactionName = S), R && (e.span = R), u.length && (e.breadcrumbs = [...e.breadcrumbs, ...u]), d.length && (e.fingerprint = [...e.fingerprint, ...d]), l.length && (e.eventProcessors = [...e.eventProcessors, ...l]), p.length && (e.attachments = [...e.attachments, ...p]), e.propagationContext = { ...e.propagationContext, ...f };
2016
2022
  }
2017
2023
  function it(e, t, n) {
2018
2024
  e[t] = pt(e[t], n, 1);
@@ -2056,16 +2062,16 @@ function wo(e, t, n, r, s, o) {
2056
2062
  timestamp: t.timestamp || ft()
2057
2063
  }, u = n.integrations || e.integrations.map((N) => N.name);
2058
2064
  ko(c, e), Oo(c, u), s && s.emit("applyFrameMetadata", t), t.type === void 0 && No(c, e.stackParser);
2059
- const d = Ao(r, n.captureContext);
2065
+ const d = Do(r, n.captureContext);
2060
2066
  n.mechanism && Z(c, n.mechanism);
2061
2067
  const l = s ? s.getEventProcessors() : [], p = Qn(o, d), f = [...n.attachments || [], ...p.attachments];
2062
2068
  f.length && (n.attachments = f), So(c, p);
2063
- const E = [
2069
+ const S = [
2064
2070
  ...l,
2065
2071
  // Run scope event processors _after_ all other processors
2066
2072
  ...p.eventProcessors
2067
2073
  ];
2068
- return (n.data && n.data.__sentry__ === !0 ? _t(c) : yo(E, c, n)).then((N) => (N && Co(N), typeof i == "number" && i > 0 ? Do(N, i, a) : N));
2074
+ return (n.data && n.data.__sentry__ === !0 ? _t(c) : yo(S, c, n)).then((N) => (N && Co(N), typeof i == "number" && i > 0 ? Ao(N, i, a) : N));
2069
2075
  }
2070
2076
  function ko(e, t) {
2071
2077
  const { environment: n, release: r, dist: s, maxValueLength: o } = t;
@@ -2104,7 +2110,7 @@ function Co(e) {
2104
2110
  function Oo(e, t) {
2105
2111
  t.length > 0 && (e.sdk = e.sdk || {}, e.sdk.integrations = [...e.sdk.integrations || [], ...t]);
2106
2112
  }
2107
- function Do(e, t, n) {
2113
+ function Ao(e, t, n) {
2108
2114
  if (!e)
2109
2115
  return null;
2110
2116
  const r = {
@@ -2134,20 +2140,20 @@ function Do(e, t, n) {
2134
2140
  }
2135
2141
  }))), e.contexts?.flags && r.contexts && (r.contexts.flags = F(e.contexts.flags, 3, n)), r;
2136
2142
  }
2137
- function Ao(e, t) {
2143
+ function Do(e, t) {
2138
2144
  if (!t)
2139
2145
  return e;
2140
- const n = e ? e.clone() : new A();
2146
+ const n = e ? e.clone() : new D();
2141
2147
  return n.update(t), n;
2142
2148
  }
2143
2149
  function xo(e) {
2144
2150
  if (e)
2145
- return Fo(e) ? { captureContext: e } : Mo(e) ? {
2151
+ return Fo(e) ? { captureContext: e } : Po(e) ? {
2146
2152
  captureContext: e
2147
2153
  } : e;
2148
2154
  }
2149
2155
  function Fo(e) {
2150
- return e instanceof A || typeof e == "function";
2156
+ return e instanceof D || typeof e == "function";
2151
2157
  }
2152
2158
  const $o = [
2153
2159
  "user",
@@ -2158,13 +2164,13 @@ const $o = [
2158
2164
  "fingerprint",
2159
2165
  "propagationContext"
2160
2166
  ];
2161
- function Mo(e) {
2167
+ function Po(e) {
2162
2168
  return Object.keys(e).some((t) => $o.includes(t));
2163
2169
  }
2164
2170
  function tr(e, t) {
2165
2171
  return x().captureException(e, xo(t));
2166
2172
  }
2167
- function Po(e, t) {
2173
+ function Mo(e, t) {
2168
2174
  const n = typeof t == "string" ? t : void 0, r = typeof t != "string" ? { captureContext: t } : void 0;
2169
2175
  return x().captureMessage(e, n, r);
2170
2176
  }
@@ -2175,7 +2181,7 @@ function Uo(e) {
2175
2181
  V().setUser(e);
2176
2182
  }
2177
2183
  function sn(e) {
2178
- const t = V(), { user: n } = Qn(t, x()), { userAgent: r } = g.navigator || {}, s = is({
2184
+ const t = V(), { user: n } = Qn(t, x()), { userAgent: r } = E.navigator || {}, s = is({
2179
2185
  user: n,
2180
2186
  ...r && { userAgent: r },
2181
2187
  ...e
@@ -2599,7 +2605,7 @@ class ui {
2599
2605
  const o = {
2600
2606
  event_id: C(),
2601
2607
  ...r
2602
- }, i = _e(t) ? t : String(t), a = At(t), c = a ? this.eventFromMessage(i, n, o) : this.eventFromException(t, o);
2608
+ }, i = _e(t) ? t : String(t), a = Dt(t), c = a ? this.eventFromMessage(i, n, o) : this.eventFromException(t, o);
2603
2609
  return this._process(
2604
2610
  () => c.then((u) => this._captureEvent(u, o, s)),
2605
2611
  a ? "unknown" : "error"
@@ -2952,8 +2958,8 @@ class ui {
2952
2958
  }
2953
2959
  throw Vt(`${d} returned \`null\`, will not send event.`);
2954
2960
  }
2955
- const E = r.getSession() || s.getSession();
2956
- if (c && E && this._updateSessionFromEvent(E, f), a) {
2961
+ const S = r.getSession() || s.getSession();
2962
+ if (c && S && this._updateSessionFromEvent(S, f), a) {
2957
2963
  const O = f.sdkProcessingMetadata?.spanCountBeforeProcessing || 0, N = f.spans ? f.spans.length : 0, Ne = O - N;
2958
2964
  Ne > 0 && this.recordDroppedEvent("before_send", "span", Ne);
2959
2965
  }
@@ -3069,8 +3075,8 @@ function li(e, t, n, r) {
3069
3075
  continue;
3070
3076
  }
3071
3077
  if (i) {
3072
- const E = i(f);
3073
- E ? d.push(E) : (Ke(), d.push(f));
3078
+ const S = i(f);
3079
+ S ? d.push(S) : (Ke(), d.push(f));
3074
3080
  } else
3075
3081
  d.push(f);
3076
3082
  }
@@ -3110,14 +3116,14 @@ function hr(e) {
3110
3116
  return 0;
3111
3117
  let t = 0;
3112
3118
  return Object.values(e).forEach((n) => {
3113
- Array.isArray(n) ? t += n.length * hn(n[0]) : At(n) ? t += hn(n) : t += 100;
3119
+ Array.isArray(n) ? t += n.length * hn(n[0]) : Dt(n) ? t += hn(n) : t += 100;
3114
3120
  }), t;
3115
3121
  }
3116
3122
  function hn(e) {
3117
3123
  return typeof e == "string" ? e.length * 2 : typeof e == "number" ? 8 : typeof e == "boolean" ? 4 : 0;
3118
3124
  }
3119
3125
  function hi(e) {
3120
- return Dt(e) && "__sentry_fetch_url_host__" in e && typeof e.__sentry_fetch_url_host__ == "string";
3126
+ return At(e) && "__sentry_fetch_url_host__" in e && typeof e.__sentry_fetch_url_host__ == "string";
3121
3127
  }
3122
3128
  function _n(e) {
3123
3129
  return hi(e) ? `${e.message} (${e.__sentry_fetch_url_host__})` : e.message;
@@ -3272,7 +3278,7 @@ Event: ${z(
3272
3278
  e
3273
3279
  )}`
3274
3280
  ), !0;
3275
- if (Di(e, t.denyUrls))
3281
+ if (Ai(e, t.denyUrls))
3276
3282
  return _ && h.warn(
3277
3283
  `Event dropped due to being matched by \`denyUrls\` option.
3278
3284
  Event: ${z(
@@ -3280,7 +3286,7 @@ Event: ${z(
3280
3286
  )}.
3281
3287
  Url: ${Nt(e)}`
3282
3288
  ), !0;
3283
- if (!Ai(e, t.allowUrls))
3289
+ if (!Di(e, t.allowUrls))
3284
3290
  return _ && h.warn(
3285
3291
  `Event dropped due to not being matched by \`allowUrls\` option.
3286
3292
  Event: ${z(
@@ -3292,25 +3298,25 @@ Url: ${Nt(e)}`
3292
3298
  return !1;
3293
3299
  }
3294
3300
  function Ci(e, t) {
3295
- return t?.length ? dr(e).some((n) => Mt(n, t)) : !1;
3301
+ return t?.length ? dr(e).some((n) => Pt(n, t)) : !1;
3296
3302
  }
3297
3303
  function Oi(e, t) {
3298
3304
  if (!t?.length)
3299
3305
  return !1;
3300
3306
  const n = e.transaction;
3301
- return n ? Mt(n, t) : !1;
3307
+ return n ? Pt(n, t) : !1;
3302
3308
  }
3303
- function Di(e, t) {
3309
+ function Ai(e, t) {
3304
3310
  if (!t?.length)
3305
3311
  return !1;
3306
3312
  const n = Nt(e);
3307
- return n ? Mt(n, t) : !1;
3313
+ return n ? Pt(n, t) : !1;
3308
3314
  }
3309
- function Ai(e, t) {
3315
+ function Di(e, t) {
3310
3316
  if (!t?.length)
3311
3317
  return !0;
3312
3318
  const n = Nt(e);
3313
- return n ? Mt(n, t) : !0;
3319
+ return n ? Pt(n, t) : !0;
3314
3320
  }
3315
3321
  function xi(e = []) {
3316
3322
  for (let t = e.length - 1; t >= 0; t--) {
@@ -3407,15 +3413,15 @@ function Sn(e, t, n, r) {
3407
3413
  parent_id: r
3408
3414
  };
3409
3415
  }
3410
- function Mi(e) {
3416
+ function Pi(e) {
3411
3417
  const t = "console";
3412
- K(t, e), Y(t, Pi);
3418
+ K(t, e), Y(t, Mi);
3413
3419
  }
3414
- function Pi() {
3415
- "console" in g && $r.forEach(function(e) {
3416
- e in g.console && k(g.console, e, function(t) {
3420
+ function Mi() {
3421
+ "console" in E && $r.forEach(function(e) {
3422
+ e in E.console && k(E.console, e, function(t) {
3417
3423
  return wt[e] = t, function(...n) {
3418
- D("console", { args: n, level: e }), wt[e]?.apply(g.console, n);
3424
+ A("console", { args: n, level: e }), wt[e]?.apply(E.console, n);
3419
3425
  };
3420
3426
  });
3421
3427
  });
@@ -3492,7 +3498,7 @@ function yr(e) {
3492
3498
  if (e !== void 0)
3493
3499
  return e >= 400 && e < 500 ? "warning" : e >= 500 ? "error" : void 0;
3494
3500
  }
3495
- const dt = g;
3501
+ const dt = E;
3496
3502
  function Xi() {
3497
3503
  return "history" in dt && !!dt.history;
3498
3504
  }
@@ -3531,7 +3537,7 @@ function Ji(e, t) {
3531
3537
  K(n, e), Y(n, () => Zi(void 0, t));
3532
3538
  }
3533
3539
  function Zi(e, t = !1) {
3534
- t && !Yi() || k(g, "fetch", function(n) {
3540
+ t && !Yi() || k(E, "fetch", function(n) {
3535
3541
  return function(...r) {
3536
3542
  const s = new Error(), { method: o, url: i } = Qi(r), a = {
3537
3543
  args: r,
@@ -3544,20 +3550,20 @@ function Zi(e, t = !1) {
3544
3550
  virtualError: s,
3545
3551
  headers: ta(r)
3546
3552
  };
3547
- return D("fetch", {
3553
+ return A("fetch", {
3548
3554
  ...a
3549
- }), n.apply(g, r).then(
3550
- async (c) => (D("fetch", {
3555
+ }), n.apply(E, r).then(
3556
+ async (c) => (A("fetch", {
3551
3557
  ...a,
3552
3558
  endTimestamp: M() * 1e3,
3553
3559
  response: c
3554
3560
  }), c),
3555
3561
  (c) => {
3556
- D("fetch", {
3562
+ A("fetch", {
3557
3563
  ...a,
3558
3564
  endTimestamp: M() * 1e3,
3559
3565
  error: c
3560
- }), Dt(c) && c.stack === void 0 && (c.stack = s.stack, j(c, "framesToPop", 1));
3566
+ }), At(c) && c.stack === void 0 && (c.stack = s.stack, j(c, "framesToPop", 1));
3561
3567
  const d = I()?.getOptions().enhanceFetchErrorMessages ?? "always";
3562
3568
  if (d !== !1 && c instanceof TypeError && (c.message === "Failed to fetch" || c.message === "Load failed" || c.message === "NetworkError when attempting to fetch resource."))
3563
3569
  try {
@@ -3586,7 +3592,7 @@ function Qi(e) {
3586
3592
  url: bn(n),
3587
3593
  method: Rt(r, "method") ? String(r.method).toUpperCase() : (
3588
3594
  // Request object as first argument
3589
- Pn(n) && Rt(n, "method") ? String(n.method).toUpperCase() : "GET"
3595
+ Mn(n) && Rt(n, "method") ? String(n.method).toUpperCase() : "GET"
3590
3596
  )
3591
3597
  };
3592
3598
  }
@@ -3601,7 +3607,7 @@ function ta(e) {
3601
3607
  try {
3602
3608
  if (typeof n == "object" && n !== null && "headers" in n && n.headers)
3603
3609
  return new Headers(n.headers);
3604
- if (Pn(t))
3610
+ if (Mn(t))
3605
3611
  return new Headers(t.headers);
3606
3612
  } catch {
3607
3613
  }
@@ -3609,7 +3615,7 @@ function ta(e) {
3609
3615
  function ea() {
3610
3616
  return "npm";
3611
3617
  }
3612
- const b = g;
3618
+ const b = E;
3613
3619
  let ie = 0;
3614
3620
  function Er() {
3615
3621
  return ie > 0;
@@ -3763,7 +3769,7 @@ function ke(e, t, n, r, s) {
3763
3769
  }
3764
3770
  return "code" in i && (o.tags = { ...o.tags, "DOMException.code": `${i.code}` }), o;
3765
3771
  }
3766
- return Dt(t) ? zt(e, t) : ct(t) || xt(t) ? (o = sa(e, t, n, s), Z(o, {
3772
+ return At(t) ? zt(e, t) : ct(t) || xt(t) ? (o = sa(e, t, n, s), Z(o, {
3767
3773
  synthetic: !0
3768
3774
  }), o) : (o = ae(e, t, n, r), Yt(o, `${t}`), Z(o, {
3769
3775
  synthetic: !0
@@ -3858,7 +3864,7 @@ function ma(e) {
3858
3864
  ...e
3859
3865
  };
3860
3866
  }
3861
- const ga = typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__, v = g, ya = 1e3;
3867
+ const ga = typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__, v = E, ya = 1e3;
3862
3868
  let Rn, ce, ue;
3863
3869
  function Ea(e) {
3864
3870
  K("dom", e), Y("dom", Sa);
@@ -3866,7 +3872,7 @@ function Ea(e) {
3866
3872
  function Sa() {
3867
3873
  if (!v.document)
3868
3874
  return;
3869
- const e = D.bind(null, "dom"), t = In(e, !0);
3875
+ const e = A.bind(null, "dom"), t = In(e, !0);
3870
3876
  v.document.addEventListener("click", t, !1), v.document.addEventListener("keypress", t, !1), ["EventTarget", "Node"].forEach((n) => {
3871
3877
  const s = v[n]?.prototype;
3872
3878
  s?.hasOwnProperty?.("addEventListener") && (k(s, "addEventListener", function(o) {
@@ -3944,7 +3950,7 @@ function Ia() {
3944
3950
  const t = v.location.href, n = gt;
3945
3951
  if (gt = t, n === t)
3946
3952
  return;
3947
- D("history", { from: n, to: t });
3953
+ A("history", { from: n, to: t });
3948
3954
  }), !Xi())
3949
3955
  return;
3950
3956
  function e(t) {
@@ -3954,7 +3960,7 @@ function Ia() {
3954
3960
  const s = gt, o = va(String(r));
3955
3961
  if (gt = o, s === o)
3956
3962
  return t.apply(this, n);
3957
- D("history", { from: s, to: o });
3963
+ A("history", { from: s, to: o });
3958
3964
  }
3959
3965
  return t.apply(this, n);
3960
3966
  };
@@ -4001,7 +4007,7 @@ function Ca() {
4001
4007
  const e = XMLHttpRequest.prototype;
4002
4008
  e.open = new Proxy(e.open, {
4003
4009
  apply(t, n, r) {
4004
- const s = new Error(), o = M() * 1e3, i = $(r[0]) ? r[0].toUpperCase() : void 0, a = Oa(r[1]);
4010
+ const s = new Error(), o = M() * 1e3, i = P(r[0]) ? r[0].toUpperCase() : void 0, a = Oa(r[1]);
4005
4011
  if (!i || !a)
4006
4012
  return t.apply(n, r);
4007
4013
  n[at] = {
@@ -4022,7 +4028,7 @@ function Ca() {
4022
4028
  xhr: n,
4023
4029
  virtualError: s
4024
4030
  };
4025
- D("xhr", d);
4031
+ A("xhr", d);
4026
4032
  }
4027
4033
  };
4028
4034
  return "onreadystatechange" in n && typeof n.onreadystatechange == "function" ? n.onreadystatechange = new Proxy(n.onreadystatechange, {
@@ -4031,8 +4037,8 @@ function Ca() {
4031
4037
  }
4032
4038
  }) : n.addEventListener("readystatechange", c), n.setRequestHeader = new Proxy(n.setRequestHeader, {
4033
4039
  apply(u, d, l) {
4034
- const [p, f] = l, E = d[at];
4035
- return E && $(p) && $(f) && (E.request_headers[p.toLowerCase()] = f), u.apply(d, l);
4040
+ const [p, f] = l, S = d[at];
4041
+ return S && P(p) && P(f) && (S.request_headers[p.toLowerCase()] = f), u.apply(d, l);
4036
4042
  }
4037
4043
  }), t.apply(n, r);
4038
4044
  }
@@ -4046,20 +4052,20 @@ function Ca() {
4046
4052
  startTimestamp: M() * 1e3,
4047
4053
  xhr: n
4048
4054
  };
4049
- return D("xhr", o), t.apply(n, r);
4055
+ return A("xhr", o), t.apply(n, r);
4050
4056
  }
4051
4057
  });
4052
4058
  }
4053
4059
  function Oa(e) {
4054
- if ($(e))
4060
+ if (P(e))
4055
4061
  return e;
4056
4062
  try {
4057
4063
  return e.toString();
4058
4064
  } catch {
4059
4065
  }
4060
4066
  }
4061
- const Da = 40;
4062
- function Aa(e, t = wa("fetch")) {
4067
+ const Aa = 40;
4068
+ function Da(e, t = wa("fetch")) {
4063
4069
  let n = 0, r = 0;
4064
4070
  async function s(o) {
4065
4071
  const i = o.body.length;
@@ -4101,10 +4107,10 @@ function Aa(e, t = wa("fetch")) {
4101
4107
  return si(
4102
4108
  e,
4103
4109
  s,
4104
- Ie(e.bufferSize || Da)
4110
+ Ie(e.bufferSize || Aa)
4105
4111
  );
4106
4112
  }
4107
- const Pt = typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__, xa = 30, Fa = 50;
4113
+ const Mt = typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__, xa = 30, Fa = 50;
4108
4114
  function de(e, t, n, r) {
4109
4115
  const s = {
4110
4116
  filename: e,
@@ -4114,7 +4120,7 @@ function de(e, t, n, r) {
4114
4120
  };
4115
4121
  return n !== void 0 && (s.lineno = n), r !== void 0 && (s.colno = r), s;
4116
4122
  }
4117
- const $a = /^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i, Ma = /^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i, Pa = /\((\S*)(?::(\d+))(?::(\d+))\)/, Ua = /at (.+?) ?\(data:(.+?),/, La = (e) => {
4123
+ const $a = /^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i, Pa = /^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i, Ma = /\((\S*)(?::(\d+))(?::(\d+))\)/, Ua = /at (.+?) ?\(data:(.+?),/, La = (e) => {
4118
4124
  const t = e.match(Ua);
4119
4125
  if (t)
4120
4126
  return {
@@ -4126,10 +4132,10 @@ const $a = /^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i, Ma = /^\s*at (?:(.+?\)(?: \
4126
4132
  const [, s, o, i] = n;
4127
4133
  return de(s, X, +o, +i);
4128
4134
  }
4129
- const r = Ma.exec(e);
4135
+ const r = Pa.exec(e);
4130
4136
  if (r) {
4131
4137
  if (r[2] && r[2].indexOf("eval") === 0) {
4132
- const a = Pa.exec(r[2]);
4138
+ const a = Ma.exec(r[2]);
4133
4139
  a && (r[2] = a[1], r[3] = a[2], r[4] = a[3]);
4134
4140
  }
4135
4141
  const [o, i] = br(r[1] || X, r[2]);
@@ -4145,7 +4151,7 @@ const $a = /^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i, Ma = /^\s*at (?:(.+?\)(?: \
4145
4151
  let r = t[3], s = t[1] || X;
4146
4152
  return [s, r] = br(s, r), de(r, s, t[4] ? +t[4] : void 0, t[5] ? +t[5] : void 0);
4147
4153
  }
4148
- }, Va = [Fa, Wa], Ga = [Ha, Va], za = An(...Ga), br = (e, t) => {
4154
+ }, Va = [Fa, Wa], Ga = [Ha, Va], za = Dn(...Ga), br = (e, t) => {
4149
4155
  const n = e.indexOf("safari-extension") !== -1, r = e.indexOf("safari-web-extension") !== -1;
4150
4156
  return n || r ? [
4151
4157
  e.indexOf("@") !== -1 ? e.split("@")[0] : X,
@@ -4164,7 +4170,7 @@ const $a = /^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i, Ma = /^\s*at (?:(.+?\)(?: \
4164
4170
  return {
4165
4171
  name: qa,
4166
4172
  setup(n) {
4167
- t.console && Mi(Za(n)), t.dom && Ea(Ja(n, t.dom)), t.xhr && Na(Qa(n)), t.fetch && Ji(tc(n)), t.history && Tr(ec(n)), t.sentry && n.on("beforeSendEvent", Ya(n));
4173
+ t.console && Pi(Za(n)), t.dom && Ea(Ja(n, t.dom)), t.xhr && Na(Qa(n)), t.fetch && Ji(tc(n)), t.history && Tr(ec(n)), t.sentry && n.on("beforeSendEvent", Ya(n));
4168
4174
  }
4169
4175
  };
4170
4176
  }), Ka = Xa;
@@ -4188,7 +4194,7 @@ function Ja(e, t) {
4188
4194
  if (I() !== e)
4189
4195
  return;
4190
4196
  let s, o, i = typeof t == "object" ? t.serializeAttribute : void 0, a = typeof t == "object" && typeof t.maxStringLength == "number" ? t.maxStringLength : void 0;
4191
- a && a > yt && (Pt && h.warn(
4197
+ a && a > yt && (Mt && h.warn(
4192
4198
  `\`dom.maxStringLength\` cannot exceed ${yt}, but a value of ${a} was configured. Sentry will use ${yt} instead.`
4193
4199
  ), a = yt), typeof i == "string" && (i = [i]);
4194
4200
  try {
@@ -4472,7 +4478,7 @@ const fc = (e = {}) => {
4472
4478
  name: "BrowserSession",
4473
4479
  setupOnce() {
4474
4480
  if (typeof b.document > "u") {
4475
- Pt && h.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");
4481
+ Mt && h.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");
4476
4482
  return;
4477
4483
  }
4478
4484
  sn({ ignoreDuration: !0 }), Wt();
@@ -4552,7 +4558,7 @@ function Tc(e) {
4552
4558
  const { stackParser: n, attachStacktrace: r } = Rr();
4553
4559
  if (I() !== e || Er())
4554
4560
  return;
4555
- const s = bc(t), o = At(s) ? Rc(s) : ke(n, s, void 0, r, !0);
4561
+ const s = bc(t), o = Dt(s) ? Rc(s) : ke(n, s, void 0, r, !0);
4556
4562
  o.level = "error", er(o, {
4557
4563
  originalException: s,
4558
4564
  mechanism: {
@@ -4563,7 +4569,7 @@ function Tc(e) {
4563
4569
  });
4564
4570
  }
4565
4571
  function bc(e) {
4566
- if (At(e))
4572
+ if (Dt(e))
4567
4573
  return e;
4568
4574
  try {
4569
4575
  if ("reason" in e)
@@ -4598,7 +4604,7 @@ function Ic(e, t, n, r) {
4598
4604
  }), e;
4599
4605
  }
4600
4606
  function wn(e) {
4601
- Pt && h.log(`Global Handler attached: ${e}`);
4607
+ Mt && h.log(`Global Handler attached: ${e}`);
4602
4608
  }
4603
4609
  function Rr() {
4604
4610
  return I()?.getOptions() || {
@@ -4607,7 +4613,7 @@ function Rr() {
4607
4613
  };
4608
4614
  }
4609
4615
  function vc(e) {
4610
- if (!(!$(e) || e.length === 0))
4616
+ if (!(!P(e) || e.length === 0))
4611
4617
  return e.startsWith("data:") ? `<${gi(e, !1)}>` : e;
4612
4618
  }
4613
4619
  const wc = () => ({
@@ -4642,9 +4648,9 @@ const wc = () => ({
4642
4648
  );
4643
4649
  }
4644
4650
  };
4645
- }), Dc = Oc;
4646
- function Ac() {
4647
- return xc() ? (Pt && rt(() => {
4651
+ }), Ac = Oc;
4652
+ function Dc() {
4653
+ return xc() ? (Mt && rt(() => {
4648
4654
  console.error(
4649
4655
  "[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/"
4650
4656
  );
@@ -4669,7 +4675,7 @@ function Fc(e) {
4669
4675
  ic(),
4670
4676
  Ka(),
4671
4677
  Ec(),
4672
- Dc(),
4678
+ Ac(),
4673
4679
  Bi(),
4674
4680
  wc(),
4675
4681
  _c(),
@@ -4677,7 +4683,7 @@ function Fc(e) {
4677
4683
  ];
4678
4684
  }
4679
4685
  function $c(e = {}) {
4680
- const t = !e.skipBrowserExtensionCheck && Ac();
4686
+ const t = !e.skipBrowserExtensionCheck && Dc();
4681
4687
  let n = e.defaultIntegrations == null ? Fc() : e.defaultIntegrations;
4682
4688
  const r = {
4683
4689
  ...e,
@@ -4687,18 +4693,18 @@ function $c(e = {}) {
4687
4693
  integrations: e.integrations,
4688
4694
  defaultIntegrations: n
4689
4695
  }),
4690
- transport: e.transport || Aa
4696
+ transport: e.transport || Da
4691
4697
  };
4692
4698
  return _i(_a, r);
4693
4699
  }
4694
- const Mc = "https://06451c8d861702902d2e6b2088fa9b62@o1128948.ingest.us.sentry.io/4509207135387648";
4695
- class Pc {
4700
+ const Pc = "https://06451c8d861702902d2e6b2088fa9b62@o1128948.ingest.us.sentry.io/4509207135387648";
4701
+ class Mc {
4696
4702
  constructor(t) {
4697
4703
  this.enabled = t;
4698
4704
  }
4699
4705
  init(t) {
4700
4706
  this.enabled && $c({
4701
- dsn: Mc,
4707
+ dsn: Pc,
4702
4708
  environment: t,
4703
4709
  defaultIntegrations: !1,
4704
4710
  tracesSampleRate: 0
@@ -4714,7 +4720,7 @@ class Pc {
4714
4720
  this.enabled && W({ category: t, message: n, data: r, level: "info", timestamp: Date.now() / 1e3 });
4715
4721
  }
4716
4722
  captureEvent(t, n) {
4717
- this.enabled && Po(t, {
4723
+ this.enabled && Mo(t, {
4718
4724
  level: "info",
4719
4725
  tags: { txn_id: this.txnId, flavour: this.flavour },
4720
4726
  extra: n,
@@ -4728,7 +4734,7 @@ class Pc {
4728
4734
  });
4729
4735
  }
4730
4736
  }
4731
- const y = {
4737
+ const g = {
4732
4738
  AUDIO_ERROR: 1001,
4733
4739
  SUCCESS: 200,
4734
4740
  TXN_ERROR: 1003,
@@ -4737,25 +4743,35 @@ const y = {
4737
4743
  UNAUTHORIZED: 401,
4738
4744
  FORBIDDEN: 403
4739
4745
  };
4740
- var Uc = /* @__PURE__ */ ((e) => (e.NOT_INITIALIZED = "na", e.INIT = "init", e.STOP = "stop", e.COMMIT = "commit", e))(Uc || {}), Lc = /* @__PURE__ */ ((e) => (e.START = "start", e.PAUSE = "pause", e.RESUME = "resume", e.STOP = "stop", e))(Lc || {}), Hc = /* @__PURE__ */ ((e) => (e.EKA_EMR_TEMPLATE = "eka_emr_template", e.CLINICAL_NOTE_TEMPLATE = "clinical_notes_template", e.TRANSCRIPT_TEMPLATE = "transcript_template", e.EKA_EMR_TO_FHIR_TEMPLATE = "eka_emr_to_fhir_template", e.NIC_TEMPLATE = "nic_template", e))(Hc || {}), Bc = /* @__PURE__ */ ((e) => (e.SUCCESS = "success", e.FAILURE = "failure", e.PARTIAL_COMPLETE = "partial_complete", e.IN_PROGRESS = "in-progress", e))(Bc || {}), S = /* @__PURE__ */ ((e) => (e.MICROPHONE = "microphone", e.TXN_INIT_FAILED = "txn_init_failed", e.TXN_LIMIT_EXCEEDED = "txn_limit_exceeded", e.INTERNAL_SERVER_ERROR = "internal_server_error", e.TXN_STOP_FAILED = "txn_stop_failed", e.AUDIO_UPLOAD_FAILED = "audio_upload_failed", e.TXN_COMMIT_FAILED = "txn_commit_failed", e.INVALID_REQUEST = "invalid_request", e.VAD_NOT_INITIALIZED = "vad_not_initialized", e.NO_AUDIO_CAPTURE = "no_audio_capture", e.SPEECH_DETECTED = "speech_detected", e.TXN_STATUS_MISMATCH = "txn_status_mismatch", e.LONG_SILENCE = "long_silence", e.GET_PRESIGNED_URL_FAILED = "get_presigned_url_failed", e.UPLOAD_FULL_AUDIO = "upload_full_audio", e.FETCH_WRAPPER_RESPONSE = "fetch_wrapper_response", e.FETCH_WRAPPER_ERROR = "fetch_wrapper_error", e.NETWORK_ERROR = "network_error", e.UNKNOWN_ERROR = "unknown_error", e.UNAUTHORIZED = "unauthorized", e.FORBIDDEN = "forbidden", e))(S || {}), jc = /* @__PURE__ */ ((e) => (e.SUCCESS = "success", e.IN_PROGRESS = "in-progress", e.FAILED = "failed", e.CANCELLED = "cancelled", e))(jc || {}), le = /* @__PURE__ */ ((e) => (e.UPLOAD_FILE_WITH_WORKER = "upload_file_with_worker", e.UPLOAD_FILE_WITH_WORKER_SUCCESS = "upload_file_with_worker_success", e.UPLOAD_FILE_WITH_WORKER_ERROR = "upload_file_with_worker_error", e.TEST_WORKER = "test_worker", e.CONFIGURE_AWS = "configure_aws", e.CONFIGURE_AWS_SUCCESS = "configure_aws_success", e.CONFIGURE_AWS_ERROR = "configure_aws_error", e.WAIT_FOR_ALL_UPLOADS = "wait_for_all_uploads", e.WAIT_FOR_ALL_UPLOADS_SUCCESS = "wait_for_all_uploads_success", e.WAIT_FOR_ALL_UPLOADS_ERROR = "wait_for_all_uploads_error", e.REQUEST_TOKEN_REFRESH = "request_token_refresh", e.TOKEN_REFRESH_SUCCESS = "token_refresh_success", e.TOKEN_REFRESH_ERROR = "token_refresh_error", e.RESET_UPLOAD_COUNTERS = "reset_upload_counters", e.TERMINATE_WORKER = "terminate_worker", e))(le || {}), Ir = /* @__PURE__ */ ((e) => (e.AWS_CONFIGURE_STATUS = "aws_configure_status", e.FILE_UPLOAD_STATUS = "file_upload_status", e.TRANSACTION_STATUS = "transaction_status", e.TEMPLATE_OPERATION_STATUS = "template_operation_status", e.AUTHENTICATION_STATUS = "authentication_status", e.NETWORK_STATUS = "network_status", e.STORAGE_STATUS = "storage_status", e))(Ir || {}), vt = /* @__PURE__ */ ((e) => (e.JSON = "json", e.TRANSCRIPT = "transcript", e.MARKDOWN = "markdown", e))(vt || {}), U = /* @__PURE__ */ ((e) => (e.INTERNET_CONNECTIVITY = "INTERNET_CONNECTIVITY", e.SYSTEM_INFO = "SYSTEM_INFO", e.MICROPHONE = "MICROPHONE", e.SHARED_WORKER = "SHARED_WORKER", e.NETWORK_API = "NETWORK_API", e))(U || {}), T = /* @__PURE__ */ ((e) => (e.SUCCESS = "success", e.ERROR = "error", e.WARNING = "warning", e))(T || {});
4746
+ var Uc = /* @__PURE__ */ ((e) => (e.NOT_INITIALIZED = "na", e.INIT = "init", e.STOP = "stop", e.COMMIT = "commit", e))(Uc || {}), Lc = /* @__PURE__ */ ((e) => (e.START = "start", e.PAUSE = "pause", e.RESUME = "resume", e.STOP = "stop", e))(Lc || {}), Hc = /* @__PURE__ */ ((e) => (e.EKA_EMR_TEMPLATE = "eka_emr_template", e.CLINICAL_NOTE_TEMPLATE = "clinical_notes_template", e.TRANSCRIPT_TEMPLATE = "transcript_template", e.EKA_EMR_TO_FHIR_TEMPLATE = "eka_emr_to_fhir_template", e.NIC_TEMPLATE = "nic_template", e))(Hc || {}), Bc = /* @__PURE__ */ ((e) => (e.SUCCESS = "success", e.FAILURE = "failure", e.PARTIAL_COMPLETE = "partial_complete", e.IN_PROGRESS = "in-progress", e))(Bc || {}), y = /* @__PURE__ */ ((e) => (e.MICROPHONE = "microphone", e.TXN_INIT_FAILED = "txn_init_failed", e.TXN_LIMIT_EXCEEDED = "txn_limit_exceeded", e.INTERNAL_SERVER_ERROR = "internal_server_error", e.TXN_STOP_FAILED = "txn_stop_failed", e.AUDIO_UPLOAD_FAILED = "audio_upload_failed", e.TXN_COMMIT_FAILED = "txn_commit_failed", e.INVALID_REQUEST = "invalid_request", e.VAD_NOT_INITIALIZED = "vad_not_initialized", e.NO_AUDIO_CAPTURE = "no_audio_capture", e.SPEECH_DETECTED = "speech_detected", e.TXN_STATUS_MISMATCH = "txn_status_mismatch", e.LONG_SILENCE = "long_silence", e.GET_PRESIGNED_URL_FAILED = "get_presigned_url_failed", e.UPLOAD_FULL_AUDIO = "upload_full_audio", e.FETCH_WRAPPER_RESPONSE = "fetch_wrapper_response", e.FETCH_WRAPPER_ERROR = "fetch_wrapper_error", e.NETWORK_ERROR = "network_error", e.UNKNOWN_ERROR = "unknown_error", e.UNAUTHORIZED = "unauthorized", e.FORBIDDEN = "forbidden", e))(y || {}), jc = /* @__PURE__ */ ((e) => (e.SUCCESS = "success", e.IN_PROGRESS = "in-progress", e.FAILED = "failed", e.CANCELLED = "cancelled", e))(jc || {}), le = /* @__PURE__ */ ((e) => (e.UPLOAD_FILE_WITH_WORKER = "upload_file_with_worker", e.UPLOAD_FILE_WITH_WORKER_SUCCESS = "upload_file_with_worker_success", e.UPLOAD_FILE_WITH_WORKER_ERROR = "upload_file_with_worker_error", e.TEST_WORKER = "test_worker", e.CONFIGURE_AWS = "configure_aws", e.CONFIGURE_AWS_SUCCESS = "configure_aws_success", e.CONFIGURE_AWS_ERROR = "configure_aws_error", e.WAIT_FOR_ALL_UPLOADS = "wait_for_all_uploads", e.WAIT_FOR_ALL_UPLOADS_SUCCESS = "wait_for_all_uploads_success", e.WAIT_FOR_ALL_UPLOADS_ERROR = "wait_for_all_uploads_error", e.REQUEST_TOKEN_REFRESH = "request_token_refresh", e.TOKEN_REFRESH_SUCCESS = "token_refresh_success", e.TOKEN_REFRESH_ERROR = "token_refresh_error", e.RESET_UPLOAD_COUNTERS = "reset_upload_counters", e.TERMINATE_WORKER = "terminate_worker", e))(le || {}), Ir = /* @__PURE__ */ ((e) => (e.AWS_CONFIGURE_STATUS = "aws_configure_status", e.FILE_UPLOAD_STATUS = "file_upload_status", e.TRANSACTION_STATUS = "transaction_status", e.TEMPLATE_OPERATION_STATUS = "template_operation_status", e.AUTHENTICATION_STATUS = "authentication_status", e.NETWORK_STATUS = "network_status", e.STORAGE_STATUS = "storage_status", e))(Ir || {}), vt = /* @__PURE__ */ ((e) => (e.JSON = "json", e.TRANSCRIPT = "transcript", e.MARKDOWN = "markdown", e))(vt || {}), L = /* @__PURE__ */ ((e) => (e.INTERNET_CONNECTIVITY = "INTERNET_CONNECTIVITY", e.SYSTEM_INFO = "SYSTEM_INFO", e.MICROPHONE = "MICROPHONE", e.SHARED_WORKER = "SHARED_WORKER", e.NETWORK_API = "NETWORK_API", e))(L || {}), T = /* @__PURE__ */ ((e) => (e.SUCCESS = "success", e.ERROR = "error", e.WARNING = "warning", e))(T || {});
4741
4747
  function m(e, t) {
4742
- if (e instanceof L) {
4743
- if (e.status === 401)
4744
- return {
4745
- error_code: S.UNAUTHORIZED,
4746
- status_code: y.UNAUTHORIZED,
4747
- message: "Authentication failed. Token may be expired."
4748
- };
4749
- if (e.status === 403)
4750
- return {
4751
- error_code: S.FORBIDDEN,
4752
- status_code: y.FORBIDDEN,
4753
- message: "Access forbidden."
4754
- };
4755
- }
4756
- return {
4757
- error_code: S.INTERNAL_SERVER_ERROR,
4758
- status_code: y.INTERNAL_SERVER_ERROR,
4748
+ return e instanceof $ ? e.status === 401 ? {
4749
+ error_code: y.UNAUTHORIZED,
4750
+ status_code: g.UNAUTHORIZED,
4751
+ message: "Authentication failed. Token may be expired."
4752
+ } : e.status === 403 ? {
4753
+ error_code: y.FORBIDDEN,
4754
+ status_code: g.FORBIDDEN,
4755
+ message: "Access forbidden."
4756
+ } : e.status === 408 ? {
4757
+ error_code: y.NETWORK_ERROR,
4758
+ status_code: e.status,
4759
+ message: `${t} Request timed out.`
4760
+ } : {
4761
+ error_code: y.INTERNAL_SERVER_ERROR,
4762
+ status_code: e.status,
4763
+ message: `${t} ${e.message}`
4764
+ } : e instanceof DOMException && e.name === "AbortError" ? {
4765
+ error_code: y.NETWORK_ERROR,
4766
+ status_code: g.INTERNAL_SERVER_ERROR,
4767
+ message: `${t} Request aborted (timeout).`
4768
+ } : e instanceof TypeError && (e.message.includes("fetch") || e.message.includes("network")) ? {
4769
+ error_code: y.NETWORK_ERROR,
4770
+ status_code: g.INTERNAL_SERVER_ERROR,
4771
+ message: `${t} Network error.`
4772
+ } : {
4773
+ error_code: y.INTERNAL_SERVER_ERROR,
4774
+ status_code: g.INTERNAL_SERVER_ERROR,
4759
4775
  message: `${t} ${e}`
4760
4776
  };
4761
4777
  }
@@ -4789,7 +4805,10 @@ class Wc {
4789
4805
  return { ...s.data, status_code: s.status };
4790
4806
  } catch (s) {
4791
4807
  const o = m(s, "Failed to create template,");
4792
- return { status_code: o.status_code, message: o.message };
4808
+ return {
4809
+ status_code: o.status_code,
4810
+ message: o.message
4811
+ };
4793
4812
  }
4794
4813
  }
4795
4814
  async updateTemplate({
@@ -4834,7 +4853,10 @@ class Wc {
4834
4853
  return { ...n.data, status_code: n.status };
4835
4854
  } catch (n) {
4836
4855
  const r = m(n, "Failed to AI generate template,");
4837
- return { status_code: r.status_code, message: r.message };
4856
+ return {
4857
+ status_code: r.status_code,
4858
+ message: r.message
4859
+ };
4838
4860
  }
4839
4861
  }
4840
4862
  async convertToTemplate({
@@ -4863,7 +4885,10 @@ class Wc {
4863
4885
  return { ...o.data, status_code: o.status };
4864
4886
  } catch (o) {
4865
4887
  const i = m(o, "Failed to convert transcription to template,");
4866
- return { status_code: i.status_code, message: i.message };
4888
+ return {
4889
+ status_code: i.status_code,
4890
+ message: i.message
4891
+ };
4867
4892
  }
4868
4893
  }
4869
4894
  // --- Template Sections ---
@@ -4893,7 +4918,11 @@ class Wc {
4893
4918
  return { ...o.data, status_code: o.status };
4894
4919
  } catch (o) {
4895
4920
  const i = m(o, "Failed to create template section,");
4896
- return { status_code: i.status_code, msg: i.message, section_id: "" };
4921
+ return {
4922
+ status_code: i.status_code,
4923
+ msg: i.message,
4924
+ section_id: ""
4925
+ };
4897
4926
  }
4898
4927
  }
4899
4928
  async updateTemplateSection({
@@ -4912,7 +4941,12 @@ class Wc {
4912
4941
  return { ...i.data, status_code: i.status };
4913
4942
  } catch (i) {
4914
4943
  const a = m(i, "Failed to update template section,");
4915
- return { status_code: a.status_code, msg: a.message, section_id: "", action: "updated" };
4944
+ return {
4945
+ status_code: a.status_code,
4946
+ msg: a.message,
4947
+ section_id: "",
4948
+ action: "updated"
4949
+ };
4916
4950
  }
4917
4951
  }
4918
4952
  async deleteTemplateSection(t) {
@@ -4924,7 +4958,10 @@ class Wc {
4924
4958
  return { ...n.data, status_code: n.status };
4925
4959
  } catch (n) {
4926
4960
  const r = m(n, "Failed to delete template section,");
4927
- return { status_code: r.status_code, msg: r.message };
4961
+ return {
4962
+ status_code: r.status_code,
4963
+ msg: r.message
4964
+ };
4928
4965
  }
4929
4966
  }
4930
4967
  // --- Documents ---
@@ -4961,7 +4998,10 @@ class Wc {
4961
4998
  return { ...i.data, status_code: i.status };
4962
4999
  } catch (i) {
4963
5000
  const a = m(i, "Failed to create document,");
4964
- return { status_code: a.status_code, message: a.message };
5001
+ return {
5002
+ status_code: a.status_code,
5003
+ message: a.message
5004
+ };
4965
5005
  }
4966
5006
  }
4967
5007
  async updateDocument({
@@ -4986,7 +5026,10 @@ class Wc {
4986
5026
  return { ...i.data, status_code: i.status };
4987
5027
  } catch (i) {
4988
5028
  const a = m(i, "Failed to update document,");
4989
- return { status_code: a.status_code, message: a.message };
5029
+ return {
5030
+ status_code: a.status_code,
5031
+ message: a.message
5032
+ };
4990
5033
  }
4991
5034
  }
4992
5035
  async deleteDocument(t) {
@@ -4998,7 +5041,10 @@ class Wc {
4998
5041
  return { ...n.data, status_code: n.status };
4999
5042
  } catch (n) {
5000
5043
  const r = m(n, "Failed to delete document,");
5001
- return { status_code: r.status_code, message: r.message };
5044
+ return {
5045
+ status_code: r.status_code,
5046
+ message: r.message
5047
+ };
5002
5048
  }
5003
5049
  }
5004
5050
  async publishDocument({
@@ -5014,7 +5060,10 @@ class Wc {
5014
5060
  return { ...r.data, status_code: r.status };
5015
5061
  } catch (r) {
5016
5062
  const s = m(r, "Failed to publish document,");
5017
- return { status_code: s.status_code, message: s.message };
5063
+ return {
5064
+ status_code: s.status_code,
5065
+ message: s.message
5066
+ };
5018
5067
  }
5019
5068
  }
5020
5069
  }
@@ -5380,18 +5429,18 @@ class Gc {
5380
5429
  txn_id: this.txnID,
5381
5430
  status_code: 200
5382
5431
  }), {
5383
- status_code: y.SUCCESS,
5432
+ status_code: g.SUCCESS,
5384
5433
  message: "Transaction initialized successfully.",
5385
5434
  txn_id: r.data.session_id
5386
5435
  }) : {
5387
- error_code: r.error.code === "rate_limit_exceeded" ? S.TXN_LIMIT_EXCEEDED : S.TXN_INIT_FAILED,
5388
- status_code: r.error.httpStatus ?? y.INTERNAL_SERVER_ERROR,
5436
+ error_code: r.error.code === "rate_limit_exceeded" ? y.TXN_LIMIT_EXCEEDED : y.TXN_INIT_FAILED,
5437
+ status_code: r.error.httpStatus ?? g.INTERNAL_SERVER_ERROR,
5389
5438
  message: r.error.message || "Transaction initialization failed."
5390
5439
  };
5391
5440
  } catch (n) {
5392
5441
  return {
5393
- error_code: S.TXN_INIT_FAILED,
5394
- status_code: y.INTERNAL_SERVER_ERROR,
5442
+ error_code: y.TXN_INIT_FAILED,
5443
+ status_code: g.INTERNAL_SERVER_ERROR,
5395
5444
  message: `Failed to initialize transaction. ${n}`
5396
5445
  };
5397
5446
  }
@@ -5401,8 +5450,8 @@ class Gc {
5401
5450
  try {
5402
5451
  if (!this.storedSession)
5403
5452
  return {
5404
- error_code: S.TXN_STATUS_MISMATCH,
5405
- status_code: y.TXN_ERROR,
5453
+ error_code: y.TXN_STATUS_MISMATCH,
5454
+ status_code: g.TXN_ERROR,
5406
5455
  message: "Transaction not initialized. Call initTransaction() first."
5407
5456
  };
5408
5457
  const n = await this.allianceClient.startRecordingWithSession(
@@ -5413,18 +5462,18 @@ class Gc {
5413
5462
  }
5414
5463
  );
5415
5464
  return n.success ? {
5416
- status_code: y.SUCCESS,
5465
+ status_code: g.SUCCESS,
5417
5466
  message: "Recording started successfully.",
5418
5467
  txn_id: this.txnID
5419
5468
  } : {
5420
- error_code: S.MICROPHONE,
5421
- status_code: n.error.httpStatus ?? y.INTERNAL_SERVER_ERROR,
5469
+ error_code: y.MICROPHONE,
5470
+ status_code: n.error.httpStatus ?? g.INTERNAL_SERVER_ERROR,
5422
5471
  message: n.error.message || "Failed to start recording."
5423
5472
  };
5424
5473
  } catch (n) {
5425
5474
  return {
5426
- error_code: S.INTERNAL_SERVER_ERROR,
5427
- status_code: y.INTERNAL_SERVER_ERROR,
5475
+ error_code: y.INTERNAL_SERVER_ERROR,
5476
+ status_code: g.INTERNAL_SERVER_ERROR,
5428
5477
  message: `Failed to start recording. ${n}`
5429
5478
  };
5430
5479
  }
@@ -5446,19 +5495,19 @@ class Gc {
5446
5495
  }
5447
5496
  );
5448
5497
  return r.success ? (this.storedSession = n, this.txnID = t.txn_id, this.tracker.setTransactionId(this.txnID), {
5449
- status_code: y.SUCCESS,
5498
+ status_code: g.SUCCESS,
5450
5499
  message: "Recording started for existing session.",
5451
5500
  txn_id: this.txnID,
5452
5501
  business_id: t.business_id
5453
5502
  }) : {
5454
- error_code: S.MICROPHONE,
5455
- status_code: r.error.httpStatus ?? y.INTERNAL_SERVER_ERROR,
5503
+ error_code: y.MICROPHONE,
5504
+ status_code: r.error.httpStatus ?? g.INTERNAL_SERVER_ERROR,
5456
5505
  message: r.error.message || "Failed to start recording for existing session."
5457
5506
  };
5458
5507
  } catch (n) {
5459
5508
  return {
5460
- error_code: S.INTERNAL_SERVER_ERROR,
5461
- status_code: y.INTERNAL_SERVER_ERROR,
5509
+ error_code: y.INTERNAL_SERVER_ERROR,
5510
+ status_code: g.INTERNAL_SERVER_ERROR,
5462
5511
  message: `Failed to start recording for existing session. ${n}`
5463
5512
  };
5464
5513
  }
@@ -5466,14 +5515,14 @@ class Gc {
5466
5515
  pauseRecording() {
5467
5516
  try {
5468
5517
  return this.allianceClient.pauseRecording(), {
5469
- status_code: y.SUCCESS,
5518
+ status_code: g.SUCCESS,
5470
5519
  message: "Recording paused.",
5471
5520
  is_paused: !0
5472
5521
  };
5473
5522
  } catch (t) {
5474
5523
  return {
5475
- error_code: S.INTERNAL_SERVER_ERROR,
5476
- status_code: y.INTERNAL_SERVER_ERROR,
5524
+ error_code: y.INTERNAL_SERVER_ERROR,
5525
+ status_code: g.INTERNAL_SERVER_ERROR,
5477
5526
  message: `Failed to pause recording. ${t}`
5478
5527
  };
5479
5528
  }
@@ -5481,14 +5530,14 @@ class Gc {
5481
5530
  resumeRecording() {
5482
5531
  try {
5483
5532
  return this.allianceClient.resumeRecording(), {
5484
- status_code: y.SUCCESS,
5533
+ status_code: g.SUCCESS,
5485
5534
  message: "Recording resumed.",
5486
5535
  is_paused: !1
5487
5536
  };
5488
5537
  } catch (t) {
5489
5538
  return {
5490
- error_code: S.INTERNAL_SERVER_ERROR,
5491
- status_code: y.INTERNAL_SERVER_ERROR,
5539
+ error_code: y.INTERNAL_SERVER_ERROR,
5540
+ status_code: g.INTERNAL_SERVER_ERROR,
5492
5541
  message: `Failed to resume recording. ${t}`
5493
5542
  };
5494
5543
  }
@@ -5501,8 +5550,8 @@ class Gc {
5501
5550
  txn_id: this.txnID,
5502
5551
  total_files: t.data.totalFiles,
5503
5552
  failed_files: t.data.failedUploads.length
5504
- }), {
5505
- status_code: y.SUCCESS,
5553
+ }), this.storedSession = null, {
5554
+ status_code: g.SUCCESS,
5506
5555
  message: "Recording ended successfully.",
5507
5556
  failed_files: t.data.failedUploads,
5508
5557
  total_audio_files: t.data.endSessionResponse?.audio_files
@@ -5510,14 +5559,14 @@ class Gc {
5510
5559
  txn_id: this.txnID,
5511
5560
  error: t.error.message
5512
5561
  }), {
5513
- error_code: S.TXN_STOP_FAILED,
5514
- status_code: t.error.httpStatus ?? y.INTERNAL_SERVER_ERROR,
5562
+ error_code: y.TXN_STOP_FAILED,
5563
+ status_code: t.error.httpStatus ?? g.INTERNAL_SERVER_ERROR,
5515
5564
  message: t.error.message || "Failed to end recording."
5516
5565
  });
5517
5566
  } catch (t) {
5518
5567
  return {
5519
- error_code: S.INTERNAL_SERVER_ERROR,
5520
- status_code: y.INTERNAL_SERVER_ERROR,
5568
+ error_code: y.INTERNAL_SERVER_ERROR,
5569
+ status_code: g.INTERNAL_SERVER_ERROR,
5521
5570
  message: `Failed to end recording. ${t}`
5522
5571
  };
5523
5572
  }
@@ -5528,7 +5577,7 @@ class Gc {
5528
5577
  success: !1,
5529
5578
  error: new Ce(
5530
5579
  "No session ID available. Call initTransaction() first or pass a sessionId.",
5531
- S.TXN_STATUS_MISMATCH
5580
+ y.TXN_STATUS_MISMATCH
5532
5581
  )
5533
5582
  };
5534
5583
  }
@@ -5536,18 +5585,18 @@ class Gc {
5536
5585
  try {
5537
5586
  const t = await this.allianceClient.retryFailedUploads();
5538
5587
  return t.success ? {
5539
- status_code: y.SUCCESS,
5588
+ status_code: g.SUCCESS,
5540
5589
  message: `Retried ${t.data.retried} files. ${t.data.succeeded} succeeded.`,
5541
5590
  failed_files: t.data.stillFailed
5542
5591
  } : {
5543
- error_code: S.AUDIO_UPLOAD_FAILED,
5544
- status_code: t.error.httpStatus ?? y.INTERNAL_SERVER_ERROR,
5592
+ error_code: y.AUDIO_UPLOAD_FAILED,
5593
+ status_code: t.error.httpStatus ?? g.INTERNAL_SERVER_ERROR,
5545
5594
  message: t.error.message || "Retry upload failed."
5546
5595
  };
5547
5596
  } catch (t) {
5548
5597
  return {
5549
- error_code: S.INTERNAL_SERVER_ERROR,
5550
- status_code: y.INTERNAL_SERVER_ERROR,
5598
+ error_code: y.INTERNAL_SERVER_ERROR,
5599
+ status_code: g.INTERNAL_SERVER_ERROR,
5551
5600
  message: `Failed to retry upload. ${t}`
5552
5601
  };
5553
5602
  }
@@ -5559,7 +5608,7 @@ class Gc {
5559
5608
  success: !1,
5560
5609
  error: new Ce(
5561
5610
  "No session ID available. Call initTransaction() first or pass a sessionId.",
5562
- S.TXN_STATUS_MISMATCH
5611
+ y.TXN_STATUS_MISMATCH
5563
5612
  )
5564
5613
  };
5565
5614
  const r = await this.allianceClient.cancelSession(n);
@@ -5582,11 +5631,11 @@ class Gc {
5582
5631
  headers: { "Content-Type": "audio/mp3" }
5583
5632
  });
5584
5633
  return s.status < 200 || s.status >= 300 ? {
5585
- error_code: S.AUDIO_UPLOAD_FAILED,
5634
+ error_code: y.AUDIO_UPLOAD_FAILED,
5586
5635
  status_code: s.status,
5587
5636
  message: `Audio upload failed with status: ${s.status}`
5588
5637
  } : {
5589
- status_code: y.SUCCESS,
5638
+ status_code: g.SUCCESS,
5590
5639
  message: "Audio file uploaded successfully."
5591
5640
  };
5592
5641
  } catch (r) {
@@ -5603,8 +5652,8 @@ class Gc {
5603
5652
  try {
5604
5653
  if (!this.txnID)
5605
5654
  return {
5606
- error_code: S.TXN_STATUS_MISMATCH,
5607
- status_code: y.TXN_ERROR,
5655
+ error_code: y.TXN_STATUS_MISMATCH,
5656
+ status_code: g.TXN_ERROR,
5608
5657
  message: "Transaction not initialized."
5609
5658
  };
5610
5659
  const t = await this.transport.request({
@@ -5613,11 +5662,11 @@ class Gc {
5613
5662
  body: { audio_files: [] }
5614
5663
  });
5615
5664
  return t.status !== 200 ? {
5616
- error_code: S.TXN_COMMIT_FAILED,
5665
+ error_code: y.TXN_COMMIT_FAILED,
5617
5666
  status_code: t.status,
5618
5667
  message: t.data.message || "Transaction commit failed."
5619
5668
  } : {
5620
- status_code: y.SUCCESS,
5669
+ status_code: g.SUCCESS,
5621
5670
  message: t.data.message || "Transaction committed successfully."
5622
5671
  };
5623
5672
  } catch (t) {
@@ -5634,8 +5683,8 @@ class Gc {
5634
5683
  try {
5635
5684
  if (!this.txnID)
5636
5685
  return {
5637
- error_code: S.TXN_STATUS_MISMATCH,
5638
- status_code: y.TXN_ERROR,
5686
+ error_code: y.TXN_STATUS_MISMATCH,
5687
+ status_code: g.TXN_ERROR,
5639
5688
  message: "Transaction not initialized."
5640
5689
  };
5641
5690
  const t = await this.transport.request({
@@ -5721,7 +5770,7 @@ class Xc {
5721
5770
  url: `${this.hosts.voiceV3}/transcript/${t}/${n}`,
5722
5771
  timeout: 1e4
5723
5772
  });
5724
- return r.status >= 400 ? { success: !1, error: r.data?.error?.code ?? S.UNKNOWN_ERROR } : { success: !0, data: r.data };
5773
+ return r.status >= 400 ? { success: !1, error: r.data?.error?.code ?? y.UNKNOWN_ERROR } : { success: !0, data: r.data };
5725
5774
  } catch (r) {
5726
5775
  return { success: !1, error: m(r, "Failed to fetch chunk transcript,").error_code };
5727
5776
  }
@@ -5760,7 +5809,7 @@ class Xc {
5760
5809
  return s && f.push(`template_id=${s}`), o && f.push(`document_id=${o}`), i && f.push("dlp=true"), f.join("&");
5761
5810
  }, p = async () => {
5762
5811
  try {
5763
- const f = l(), E = await this.fetchV3Status(n, f, 2e4), { status_code: R, response: O } = E;
5812
+ const f = l(), S = await this.fetchV3Status(n, f, 2e4), { status_code: R, response: O } = S;
5764
5813
  if (Date.now() >= u)
5765
5814
  return c(500, null, "Timeout while fetching analysis results.", "timeout");
5766
5815
  if (R === 401 || R === 403)
@@ -5829,7 +5878,7 @@ class Xc {
5829
5878
  ...n,
5830
5879
  output: Et(n.output),
5831
5880
  template_results: {
5832
- ...n.template_results,
5881
+ ...n.template_results ?? {},
5833
5882
  integration: Et(n.template_results?.integration),
5834
5883
  custom: Et(n.template_results?.custom),
5835
5884
  transcript: Et(n.template_results?.transcript)
@@ -5875,7 +5924,7 @@ class Jc {
5875
5924
  }
5876
5925
  // --- Test 1: Internet Connectivity ---
5877
5926
  async checkInternetConnectivity() {
5878
- const t = Date.now(), n = U.INTERNET_CONNECTIVITY;
5927
+ const t = Date.now(), n = L.INTERNET_CONNECTIVITY;
5879
5928
  try {
5880
5929
  if (!navigator.onLine)
5881
5930
  return this.createTestResult(
@@ -5919,7 +5968,7 @@ class Jc {
5919
5968
  }
5920
5969
  // --- Test 2: System Info ---
5921
5970
  async checkSystemInfo() {
5922
- const t = U.SYSTEM_INFO;
5971
+ const t = L.SYSTEM_INFO;
5923
5972
  try {
5924
5973
  const { browser: n, version: r } = this.detectBrowser(), s = navigator.deviceMemory, o = Intl.DateTimeFormat().resolvedOptions().timeZone, a = (/* @__PURE__ */ new Date()).toISOString(), c = await this.validateTimezone();
5925
5974
  return c ? this.createTestResult(t, T.ERROR, c, {
@@ -5983,7 +6032,7 @@ class Jc {
5983
6032
  }
5984
6033
  // --- Test 3: Microphone Permission ---
5985
6034
  async checkMicrophonePermission() {
5986
- const t = U.MICROPHONE;
6035
+ const t = L.MICROPHONE;
5987
6036
  try {
5988
6037
  if (!navigator.mediaDevices?.getUserMedia)
5989
6038
  return this.createTestResult(
@@ -6014,7 +6063,7 @@ class Jc {
6014
6063
  }
6015
6064
  }
6016
6065
  handleMicrophoneError(t) {
6017
- const n = U.MICROPHONE, r = {
6066
+ const n = L.MICROPHONE, r = {
6018
6067
  NotAllowedError: { message: "Microphone permission denied", permission: "denied" },
6019
6068
  PermissionDeniedError: { message: "Microphone permission denied", permission: "denied" },
6020
6069
  NotFoundError: { message: "No microphone found", permission: "denied" }
@@ -6032,7 +6081,7 @@ class Jc {
6032
6081
  }
6033
6082
  // --- Test 4: Shared Worker Support ---
6034
6083
  async checkSharedWorkerSupport() {
6035
- const t = U.SHARED_WORKER;
6084
+ const t = L.SHARED_WORKER;
6036
6085
  try {
6037
6086
  if (typeof SharedWorker > "u")
6038
6087
  return this.createTestResult(
@@ -6068,7 +6117,7 @@ class Jc {
6068
6117
  }
6069
6118
  }
6070
6119
  testWorkerCommunication(t) {
6071
- const n = U.SHARED_WORKER;
6120
+ const n = L.SHARED_WORKER;
6072
6121
  return new Promise((r) => {
6073
6122
  const s = setTimeout(() => {
6074
6123
  r(
@@ -6095,7 +6144,7 @@ class Jc {
6095
6144
  }
6096
6145
  // --- Test 5: Network & API Access (ping-only) ---
6097
6146
  async checkNetworkAndApiAccess() {
6098
- const t = Date.now(), n = U.NETWORK_API;
6147
+ const t = Date.now(), n = L.NETWORK_API;
6099
6148
  try {
6100
6149
  const r = await this.pingApi(), s = Date.now() - t;
6101
6150
  return r ? this.createTestResult(
@@ -6157,7 +6206,7 @@ class Jc {
6157
6206
  }
6158
6207
  const w = class w {
6159
6208
  constructor(t) {
6160
- this.config = t, this.hosts = xr(t.env), this.callbackRegistry = new Fr(), this.tracker = new Pc(t.enableTracking ?? !1);
6209
+ this.config = t, this.hosts = xr(t.env), this.callbackRegistry = new Fr(), this.tracker = new Mc(t.enableTracking ?? !1);
6161
6210
  const n = {
6162
6211
  access_token: t.access_token,
6163
6212
  clientId: t.clientId,
@@ -6175,7 +6224,9 @@ const w = class w {
6175
6224
  workerScriptUrl: t.sharedWorkerUrl,
6176
6225
  debug: t.allianceConfig?.debug ?? !1,
6177
6226
  autoDiscovery: !0
6178
- }), this.allianceClient.init(), this.documents = new Wc(this.transport, this.hosts, this.allianceClient), this.sessions = new Vc(this.transport, this.hosts, this.allianceClient), this.output = new Xc(this.transport, this.hosts), this.recording = new Gc(
6227
+ }), this.allianceClient.init().catch((r) => {
6228
+ console.error("[EkaScribe] Alliance SDK init failed:", r);
6229
+ }), this.documents = new Wc(this.transport, this.hosts, this.allianceClient), this.sessions = new Vc(this.transport, this.hosts, this.allianceClient), this.output = new Xc(this.transport, this.hosts), this.recording = new Gc(
6179
6230
  this.allianceClient,
6180
6231
  this.transport,
6181
6232
  this.hosts,
@@ -6183,7 +6234,9 @@ const w = class w {
6183
6234
  this.callbackRegistry
6184
6235
  ), this.allianceClient.registerCallback("onTokenRequired", (r) => {
6185
6236
  this.handleUnauthorized().then((s) => {
6186
- s && r.resolve(s);
6237
+ s ? r.resolve(s) : (console.error("[EkaScribe] Token refresh returned empty token."), r.resolve(""));
6238
+ }).catch((s) => {
6239
+ console.error("[EkaScribe] Token refresh failed:", s), r.resolve("");
6187
6240
  });
6188
6241
  });
6189
6242
  }
@@ -6193,7 +6246,9 @@ const w = class w {
6193
6246
  if (r || s)
6194
6247
  console.warn(
6195
6248
  `[EkaScribe] Configuration changed${r ? ` (env: ${n.env} → ${t.env})` : ""}${s ? ` (clientId: ${n.clientId} → ${t.clientId})` : ""}. Resetting instance.`
6196
- ), w.instance.resetInstance();
6249
+ ), w.instance.resetInstance().catch((o) => {
6250
+ console.error("[EkaScribe] Error during instance reset:", o);
6251
+ });
6197
6252
  else
6198
6253
  return t.access_token && w.instance.updateAuthTokens({ access_token: t.access_token }), t.flavour && t.flavour !== n.flavour && (n.flavour = t.flavour, t.enableTracking && w.instance.tracker.setUser(t.flavour)), w.instance;
6199
6254
  }
@@ -6288,8 +6343,13 @@ const w = class w {
6288
6343
  }
6289
6344
  // ─── Private ───────────────────────────────────────────────────────────────
6290
6345
  async handleUnauthorized() {
6291
- const t = await this.callbackRegistry.dispatch("onTokenRequired");
6292
- return t && this.updateAuthTokens({ access_token: t }), t;
6346
+ const n = this.callbackRegistry.dispatch("onTokenRequired"), r = new Promise(
6347
+ (o, i) => setTimeout(
6348
+ () => i(new Error("[EkaScribe] Token refresh timed out after 10s.")),
6349
+ 1e4
6350
+ )
6351
+ ), s = await Promise.race([n, r]);
6352
+ return s && this.updateAuthTokens({ access_token: s }), s;
6293
6353
  }
6294
6354
  };
6295
6355
  w.instance = null;
@@ -6299,8 +6359,8 @@ export {
6299
6359
  Uc as API_STATUS,
6300
6360
  Ir as CALLBACK_TYPE,
6301
6361
  T as COMPATIBILITY_TEST_STATUS,
6302
- U as COMPATIBILITY_TEST_TYPE,
6303
- S as ERROR_CODE,
6362
+ L as COMPATIBILITY_TEST_TYPE,
6363
+ y as ERROR_CODE,
6304
6364
  jc as PROCESSING_STATUS,
6305
6365
  Bc as RESULT_STATUS,
6306
6366
  Hc as TEMPLATE_ID,