@genai-fi/base 4.2.2 → 4.2.3

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.
@@ -1,6 +1,6 @@
1
1
  import { jsx as r, Fragment as W, jsxs as q } from "react/jsx-runtime";
2
2
  import { iceConfig as F, webrtcActive as L } from "../../state/webrtcState.js";
3
- import { useRef as P, useState as g, useEffect as o } from "react";
3
+ import { useRef as P, useState as _, useEffect as o } from "react";
4
4
  import { getRTConfig as z } from "./ice.js";
5
5
  import { W as E, F as R } from "../../FlashWifi-DkGhdWqj.js";
6
6
  import { useTranslation as b } from "react-i18next";
@@ -8,28 +8,28 @@ import { c as j } from "../../createSvgIcon-DQhMxTx4.js";
8
8
  import { checkP2P as x } from "./check.js";
9
9
  import { usePeerObject as A } from "../../hooks/peer.js";
10
10
  import { a as B } from "../../react-D_xU5dL6.js";
11
- import '../../assets/ConnectionStatus.css';const w = "_containerConnecting_1p4sr_15 _container_1p4sr_3", D = "_containerSuccess_1p4sr_20 _container_1p4sr_3", O = "_containerMedium_1p4sr_25 _container_1p4sr_3", U = "_containerBad_1p4sr_30 _container_1p4sr_3", $ = "_message_1p4sr_35", a = {
12
- containerConnecting: w,
13
- containerSuccess: D,
14
- containerMedium: O,
15
- containerBad: U,
11
+ import '../../assets/ConnectionStatus.css';const D = "_containerConnecting_1p4sr_15 _container_1p4sr_3", U = "_containerSuccess_1p4sr_20 _container_1p4sr_3", w = "_containerMedium_1p4sr_25 _container_1p4sr_3", O = "_containerBad_1p4sr_30 _container_1p4sr_3", $ = "_message_1p4sr_35", f = {
12
+ containerConnecting: D,
13
+ containerSuccess: U,
14
+ containerMedium: w,
15
+ containerBad: O,
16
16
  message: $
17
17
  }, k = j(/* @__PURE__ */ r("path", {
18
18
  d: "M24 8.98C20.93 5.9 16.69 4 12 4S3.07 5.9 0 8.98L12 21v-9h8.99zM19.59 14l-2.09 2.09L15.41 14 14 15.41l2.09 2.09L14 19.59 15.41 21l2.09-2.08L19.59 21 21 19.59l-2.08-2.09L21 15.41z"
19
19
  }), "SignalWifiBad"), N = 6e4;
20
- function te({ api: f, checkURL: S, appName: h, visibility: v, noCheck: y }) {
21
- const { t: p } = b(), e = A(), [u, C] = B(F), [M, l] = B(L), m = P(), [n, d] = g("connecting"), [s, _] = g(0), [, I] = g(!1), [c, T] = g(!1), i = n === "ready";
20
+ function te({ api: l, checkURL: h, appName: v, visibility: S, noCheck: y }) {
21
+ const { t: p } = b(), e = A(), [m, C] = B(F), [M, c] = B(L), i = P(), [n, d] = _("connecting"), [s, g] = _(0), [, I] = _(!1), [a, T] = _(!1), u = n === "ready";
22
22
  return o(() => {
23
23
  if (e)
24
- return e.on("status", d), e.on("quality", _), d(e.status), _(e.quality), () => {
25
- e.off("status", d), e.off("quality", _);
24
+ return e.on("status", d), e.on("quality", g), d(e.status), g(e.quality), () => {
25
+ e.off("status", d), e.off("quality", g);
26
26
  };
27
- _(0), d("connecting");
27
+ g(0), d("connecting");
28
28
  }, [e]), o(() => {
29
- u || z(f, h, (t) => {
29
+ m || z(l, v, (t) => {
30
30
  C(t);
31
31
  });
32
- }, [u, C, f, h]), o(() => {
32
+ }, [m, C, l, v]), o(() => {
33
33
  if (n !== "ready") {
34
34
  const t = setTimeout(() => {
35
35
  T(!0);
@@ -40,40 +40,44 @@ function te({ api: f, checkURL: S, appName: h, visibility: v, noCheck: y }) {
40
40
  } else
41
41
  T(!1);
42
42
  }, [n]), o(() => {
43
- u && M === "unset" && (navigator != null && navigator.mediaDevices ? navigator.mediaDevices.getUserMedia({ video: !0 }).then((t) => {
44
- m.current = t, l("full");
43
+ m && M === "unset" && (navigator != null && navigator.mediaDevices ? navigator.mediaDevices.getUserMedia({ video: !0 }).then((t) => {
44
+ i.current = t, c("full");
45
45
  }).catch(() => {
46
- l("relay");
47
- }) : l("relay"));
48
- }, [u, M, l]), o(() => {
49
- i && m.current && (m.current.getTracks().forEach(function(t) {
46
+ navigator.mediaDevices.getUserMedia({ audio: !0 }).then((t) => {
47
+ i.current = t, c("full");
48
+ }).catch(() => {
49
+ c("relay");
50
+ });
51
+ }) : c("relay"));
52
+ }, [m, M, c]), o(() => {
53
+ u && i.current && (i.current.getTracks().forEach(function(t) {
50
54
  t.stop();
51
- }), m.current = void 0);
52
- }, [i, n]), o(() => {
53
- i && e && !y && e.code && x(S || f, e.code).then((t) => {
55
+ }), i.current = void 0);
56
+ }, [u, n]), o(() => {
57
+ u && e && !y && e.code && x(h || l, e.code).then((t) => {
54
58
  I(t);
55
59
  });
56
- }, [i, e, f, S, y]), /* @__PURE__ */ r(W, { children: (v === void 0 || s <= v) && /* @__PURE__ */ q(
60
+ }, [u, e, l, h, y]), /* @__PURE__ */ r(W, { children: (S === void 0 || s <= S) && /* @__PURE__ */ q(
57
61
  "div",
58
62
  {
59
- className: n === "connecting" && !c ? a.containerConnecting : s === 3 ? a.containerSuccess : s === 2 ? a.containerMedium : a.containerBad,
63
+ className: n === "connecting" && !a ? f.containerConnecting : s === 3 ? f.containerSuccess : s === 2 ? f.containerMedium : f.containerBad,
60
64
  children: [
61
- !c && s > 0 && /* @__PURE__ */ r(
65
+ !a && s > 0 && /* @__PURE__ */ r(
62
66
  E,
63
67
  {
64
68
  fontSize: "large",
65
69
  color: "inherit"
66
70
  }
67
71
  ),
68
- !c && s <= 0 && /* @__PURE__ */ r(R, {}),
69
- c && /* @__PURE__ */ r(
72
+ !a && s <= 0 && /* @__PURE__ */ r(R, {}),
73
+ a && /* @__PURE__ */ r(
70
74
  k,
71
75
  {
72
76
  fontSize: "large",
73
77
  color: "inherit"
74
78
  }
75
79
  ),
76
- /* @__PURE__ */ r("div", { className: a.message, children: p(i ? `loader.messages.quality${s}` : c ? "loader.messages.failed" : `loader.messages.${n}`) })
80
+ /* @__PURE__ */ r("div", { className: f.message, children: p(u ? `loader.messages.quality${s}` : a ? "loader.messages.failed" : `loader.messages.${n}`) })
77
81
  ]
78
82
  }
79
83
  ) });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@genai-fi/base",
3
- "version": "4.2.2",
3
+ "version": "4.2.3",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",