@ethora/chat-component 26.10.7 → 26.10.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/README.md +88 -3
- package/dist/ChatProfileModal-83t5BRkI.js +2298 -0
- package/dist/{FilePreviewModal-DlOjnYzv.js → FilePreviewModal-DxUGjSHe.js} +130 -130
- package/dist/{ManageDataModal-BZLGJZze.js → ManageDataModal-DFE_Wegj.js} +14 -14
- package/dist/{MarkdownBody-CtArwCDa.js → MarkdownBody-uFITrPjT.js} +1 -1
- package/dist/{MessageSearchModal-CcUnfZlU.js → MessageSearchModal-CsbTWgNm.js} +32 -32
- package/dist/{PublicChatsModal-BWn0NXVo.js → PublicChatsModal-bDOp3IL9.js} +19 -19
- package/dist/{SideDrawer-CqZl9sxK.js → SideDrawer-A_1ECqD2.js} +28 -28
- package/dist/{UserProfileModal-D0JZ3-uy.js → UserProfileModal-Ca5wHYvr.js} +124 -120
- package/dist/{UserSettingsModal-OvykYDsT.js → UserSettingsModal-CAyyQGV6.js} +2 -2
- package/dist/{VideoCallOverlay-DrvO2v_g.js → VideoCallOverlay-BMiQh8kI.js} +5908 -4168
- package/dist/{VisibilityModal-pOF9-UXR.js → VisibilityModal-BXyIy7_J.js} +7 -7
- package/dist/assets/icons.d.ts +4 -0
- package/dist/calls/callDisplay.d.ts +22 -0
- package/dist/calls/callMode.d.ts +105 -0
- package/dist/calls/openScheduledCall.d.ts +20 -0
- package/dist/calls/p2p/P2PCallController.d.ts +160 -0
- package/dist/calls/p2p/icePolicy.d.ts +36 -0
- package/dist/calls/p2p/negotiator.d.ts +56 -0
- package/dist/calls/p2p/p2pRuntime.d.ts +35 -0
- package/dist/calls/p2p/signalInbox.d.ts +34 -0
- package/dist/calls/p2p/signalStanza.d.ts +51 -0
- package/dist/calls/placeCall.d.ts +20 -0
- package/dist/calls/scheduledCall.d.ts +101 -0
- package/dist/calls/scheduledCallActions.d.ts +12 -0
- package/dist/calls/scheduledCallFormat.d.ts +13 -0
- package/dist/calls/scheduledCallsConfig.d.ts +27 -0
- package/dist/calls/senderTrust.d.ts +7 -0
- package/dist/calls/startCall.d.ts +16 -0
- package/dist/components/MainComponents/ChatWrapper.d.ts +1 -0
- package/dist/components/MainComponents/LoginWrapper.d.ts +1 -0
- package/dist/components/MainComponents/ProfileImagePlaceholder.d.ts +1 -0
- package/dist/components/MainComponents/ReduxWrapper.d.ts +6 -0
- package/dist/components/MenuRoom/MenuRoom.d.ts +1 -0
- package/dist/components/Modals/NewChatModal/styledNewChatComponents.d.ts +27 -0
- package/dist/components/Modals/styledModalComponents.d.ts +21 -0
- package/dist/components/ScheduledCalls/ScheduleCallModal.d.ts +3 -0
- package/dist/components/ScheduledCalls/ScheduledCallCancelConfirm.d.ts +8 -0
- package/dist/components/ScheduledCalls/ScheduledCallCard.d.ts +7 -0
- package/dist/components/ScheduledCalls/ScheduledCallLayer.d.ts +15 -0
- package/dist/components/ScheduledCalls/ScheduledCallPreJoin.d.ts +3 -0
- package/dist/components/VideoCalls/P2PCallRunner.d.ts +1 -0
- package/dist/components/VideoCalls/P2PCallSession.d.ts +14 -0
- package/dist/components/VideoCalls/VideoCallSession.d.ts +37 -0
- package/dist/{handleCopyClick-BUbVvd2G.js → handleCopyClick-BX1fcFGN.js} +1 -1
- package/dist/helpers/callPush.d.ts +2 -0
- package/dist/helpers/canLeaveRoom.d.ts +3 -0
- package/dist/helpers/chatComponentConfigEvents.d.ts +16 -0
- package/dist/helpers/liveConfig.d.ts +46 -0
- package/dist/helpers/reportRoom.d.ts +18 -0
- package/dist/helpers/scheduledCallMessage.d.ts +23 -0
- package/dist/helpers/storeConsole.d.ts +1 -0
- package/dist/hooks/useNow.d.ts +6 -0
- package/dist/hooks/useRemoteAppearance.d.ts +21 -0
- package/dist/hooks/useTypography.d.ts +4 -0
- package/dist/{main-CpHMnydn.js → main-B25iFKAC.js} +15794 -13324
- package/dist/main.d.ts +3 -1
- package/dist/main.js +28 -26
- package/dist/networking/api-requests/callState.api.d.ts +24 -0
- package/dist/networking/api-requests/remoteAppearance.api.d.ts +20 -0
- package/dist/networking/api-requests/rooms.api.d.ts +2 -1
- package/dist/networking/api-requests/scheduledCalls.api.d.ts +19 -0
- package/dist/networking/ethoraEvents.d.ts +14 -1
- package/dist/networking/xmpp/notifyXmppEvent.d.ts +6 -0
- package/dist/roomStore/callSlice.d.ts +23 -1
- package/dist/roomStore/chatSettingsSlice.d.ts +9 -1
- package/dist/roomStore/index.d.ts +4 -0
- package/dist/roomStore/scheduledCallSlice.d.ts +47 -0
- package/dist/types/models/config.model.d.ts +71 -1
- package/dist/types/models/message.model.d.ts +2 -0
- package/dist/types/models/room.model.d.ts +2 -0
- package/dist/types/models/scheduledCall.model.d.ts +116 -0
- package/package.json +1 -1
- package/dist/ChatProfileModal-BDZvd0rm.js +0 -2168
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as r, jsxs as b } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { bt as et, bu as tt, a4 as f, bv as yt, Z as Pe, b as Et, bw as kt, bx as nt, by as rt, bz as ot, bA as Le, bB as Te, bC as Ce, b8 as $e, a8 as Ae, bD as Ue, bE as Pt, a6 as ke, bF as Rt, bG as it, a as St, bp as Lt, u as le, aC as _e, bH as Tt, bI as Ct, bJ as Re, bK as Mt, aW as ue, bL as Be, bM as It, bN as $t, bO as At, bP as Ot, bQ as Dt, b7 as Ne, a2 as zt, bR as Ut } from "./main-B25iFKAC.js";
|
|
3
3
|
import Me, { useState as F, useRef as U, useEffect as M, useMemo as te, useCallback as B, useLayoutEffect as _t } from "react";
|
|
4
4
|
const at = (t, o, i) => {
|
|
5
5
|
const g = document.createElement("a");
|
|
@@ -12,7 +12,7 @@ const at = (t, o, i) => {
|
|
|
12
12
|
URL.revokeObjectURL(i);
|
|
13
13
|
}
|
|
14
14
|
}, Nt = (t, o) => at(t, o, !0);
|
|
15
|
-
async function
|
|
15
|
+
async function Wt(t, o, i = {}) {
|
|
16
16
|
const g = i.fetchImpl ?? fetch, E = i.saveBlob ?? Bt, l = i.saveUrl ?? Nt;
|
|
17
17
|
let w;
|
|
18
18
|
try {
|
|
@@ -22,13 +22,13 @@ async function Xt(t, o, i = {}) {
|
|
|
22
22
|
}
|
|
23
23
|
return w.ok ? (E(new Blob([await w.arrayBuffer()]), o), "blob") : (et(t) && (w.status === 401 || w.status === 403) && tt(), "http-error");
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function We(t, o) {
|
|
26
26
|
let i;
|
|
27
27
|
return (...g) => {
|
|
28
28
|
window.clearTimeout(i), i = window.setTimeout(() => t(...g), o);
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function Xt({ debounce: t, scroll: o, polyfill: i, offsetSize: g } = { debounce: 0, scroll: !1, offsetSize: !1 }) {
|
|
32
32
|
const E = i || (typeof window > "u" ? class {
|
|
33
33
|
} : window.ResizeObserver);
|
|
34
34
|
if (!E) throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");
|
|
@@ -36,15 +36,15 @@ function Wt({ debounce: t, scroll: o, polyfill: i, offsetSize: g } = { debounce:
|
|
|
36
36
|
M(() => (v.current = !0, () => {
|
|
37
37
|
v.current = !1;
|
|
38
38
|
}));
|
|
39
|
-
const [N,
|
|
39
|
+
const [N, R, x] = te(() => {
|
|
40
40
|
const k = () => {
|
|
41
41
|
if (!c.current.element) return;
|
|
42
|
-
const { left:
|
|
42
|
+
const { left: W, top: V, width: I, height: O, bottom: j, right: S, x: P, y: C } = c.current.element.getBoundingClientRect(), $ = { left: W, top: V, width: I, height: O, bottom: j, right: S, x: P, y: C };
|
|
43
43
|
c.current.element instanceof HTMLElement && g && ($.height = c.current.element.offsetHeight, $.width = c.current.element.offsetWidth), Object.freeze($), v.current && !jt(c.current.lastBounds, $) && w(c.current.lastBounds = $);
|
|
44
44
|
};
|
|
45
|
-
return [k, m ?
|
|
45
|
+
return [k, m ? We(k, m) : k, T ? We(k, T) : k];
|
|
46
46
|
}, [w, g, T, m]);
|
|
47
|
-
function
|
|
47
|
+
function D() {
|
|
48
48
|
c.current.scrollContainers && (c.current.scrollContainers.forEach((k) => k.removeEventListener("scroll", x, !0)), c.current.scrollContainers = null), c.current.resizeObserver && (c.current.resizeObserver.disconnect(), c.current.resizeObserver = null), c.current.orientationHandler && ("orientation" in screen && "removeEventListener" in screen.orientation ? screen.orientation.removeEventListener("change", c.current.orientationHandler) : "onorientationchange" in window && window.removeEventListener("orientationchange", c.current.orientationHandler));
|
|
49
49
|
}
|
|
50
50
|
function A() {
|
|
@@ -53,11 +53,11 @@ function Wt({ debounce: t, scroll: o, polyfill: i, offsetSize: g } = { debounce:
|
|
|
53
53
|
}, "orientation" in screen && "addEventListener" in screen.orientation ? screen.orientation.addEventListener("change", c.current.orientationHandler) : "onorientationchange" in window && window.addEventListener("orientationchange", c.current.orientationHandler));
|
|
54
54
|
}
|
|
55
55
|
const H = (k) => {
|
|
56
|
-
!k || k === c.current.element || (
|
|
56
|
+
!k || k === c.current.element || (D(), c.current.element = k, c.current.scrollContainers = st(k), A());
|
|
57
57
|
};
|
|
58
|
-
return Yt(x, !!o), Ft(
|
|
59
|
-
|
|
60
|
-
}, [o, x,
|
|
58
|
+
return Yt(x, !!o), Ft(R), M(() => {
|
|
59
|
+
D(), A();
|
|
60
|
+
}, [o, x, R]), M(() => D, []), [H, l, N];
|
|
61
61
|
}
|
|
62
62
|
function Ft(t) {
|
|
63
63
|
M(() => {
|
|
@@ -83,7 +83,7 @@ function st(t) {
|
|
|
83
83
|
const { overflow: i, overflowX: g, overflowY: E } = window.getComputedStyle(t);
|
|
84
84
|
return [i, g, E].some((l) => l === "auto" || l === "scroll") && o.push(t), [...o, ...st(t.parentElement)];
|
|
85
85
|
}
|
|
86
|
-
const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt = (t, o) => Ht.every((i) => t[i] === o[i]),
|
|
86
|
+
const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt = (t, o) => Ht.every((i) => t[i] === o[i]), Xe = 0.5, Fe = 3, xe = 1.25, Vt = 2e-3, Ye = 12, He = 16, je = 16, Gt = 72, Ve = 320, Zt = 150, Ge = 4, Kt = 7, qt = "800px 0px", Jt = 2, Qt = 0.9, Ze = { width: 612, height: 792 }, en = f.div`
|
|
87
87
|
display: flex;
|
|
88
88
|
flex-direction: column;
|
|
89
89
|
align-items: center;
|
|
@@ -158,7 +158,7 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
|
|
|
158
158
|
min-width: 44px;
|
|
159
159
|
text-align: center;
|
|
160
160
|
font-size: 12px;
|
|
161
|
-
`,
|
|
161
|
+
`, Se = f.button`
|
|
162
162
|
display: inline-flex;
|
|
163
163
|
align-items: center;
|
|
164
164
|
justify-content: center;
|
|
@@ -225,29 +225,29 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
|
|
|
225
225
|
}) {
|
|
226
226
|
const T = U(null), m = U(null), [v, N] = F(!1);
|
|
227
227
|
return M(() => {
|
|
228
|
-
const
|
|
229
|
-
if (!
|
|
228
|
+
const R = T.current;
|
|
229
|
+
if (!R) return;
|
|
230
230
|
if (!c || g <= 0) {
|
|
231
|
-
m.current?.cancel(), m.current = null,
|
|
231
|
+
m.current?.cancel(), m.current = null, R.width = 0, R.height = 0, N(!1);
|
|
232
232
|
return;
|
|
233
233
|
}
|
|
234
234
|
let x = !1;
|
|
235
235
|
return (async () => {
|
|
236
236
|
try {
|
|
237
|
-
const
|
|
237
|
+
const D = await o.getPage(i);
|
|
238
238
|
if (x) {
|
|
239
|
-
|
|
239
|
+
D.cleanup();
|
|
240
240
|
return;
|
|
241
241
|
}
|
|
242
|
-
const A =
|
|
242
|
+
const A = D.getViewport({ scale: 1 }), H = Math.min(window.devicePixelRatio || 1, Jt), k = D.getViewport({
|
|
243
243
|
scale: A.width ? g / A.width * H : H
|
|
244
|
-
}),
|
|
245
|
-
if (!
|
|
246
|
-
|
|
247
|
-
const V =
|
|
248
|
-
m.current = V, await V.promise, x || N(!0),
|
|
249
|
-
} catch (
|
|
250
|
-
x || console.warn("[Ethora] PDF page render failed:",
|
|
244
|
+
}), W = R.getContext("2d");
|
|
245
|
+
if (!W) return;
|
|
246
|
+
R.width = Math.max(1, Math.floor(k.width)), R.height = Math.max(1, Math.floor(k.height)), m.current?.cancel();
|
|
247
|
+
const V = D.render({ canvasContext: W, viewport: k });
|
|
248
|
+
m.current = V, await V.promise, x || N(!0), D.cleanup();
|
|
249
|
+
} catch (D) {
|
|
250
|
+
x || console.warn("[Ethora] PDF page render failed:", D);
|
|
251
251
|
}
|
|
252
252
|
})(), () => {
|
|
253
253
|
x = !0, m.current?.cancel(), m.current = null;
|
|
@@ -262,15 +262,15 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
|
|
|
262
262
|
}
|
|
263
263
|
);
|
|
264
264
|
}), pn = ({ pdfUrl: t }) => {
|
|
265
|
-
const o = Pe(), { config: i } = Et(), [g, E] =
|
|
265
|
+
const o = Pe(), { config: i } = Et(), [g, E] = Xt(), l = U(null), w = B(
|
|
266
266
|
(d) => {
|
|
267
267
|
l.current = d, g(d);
|
|
268
268
|
},
|
|
269
269
|
[g]
|
|
270
|
-
), [c, T] = F("loading"), [m, v] = F(null), [N,
|
|
270
|
+
), [c, T] = F("loading"), [m, v] = F(null), [N, R] = F([]), [x, D] = F(1), A = U(1), [H, k] = F(0), [W, V] = F(1), I = U(1), [O, j] = F(() => /* @__PURE__ */ new Set()), S = U(null), P = U(null), C = U(null), $ = H > 0 ? H : Ve, Y = m?.numPages ?? 0;
|
|
271
271
|
M(() => {
|
|
272
272
|
let d = !1, n = null, e;
|
|
273
|
-
return T("loading"), v(null),
|
|
273
|
+
return T("loading"), v(null), R([]), j(/* @__PURE__ */ new Set()), I.current = 1, V(1), (async () => {
|
|
274
274
|
const a = await kt(i?.pdfPreview?.workerSrc, i?.pdfPreview?.libUrl);
|
|
275
275
|
if (!d) {
|
|
276
276
|
if (!a || !t) {
|
|
@@ -289,7 +289,7 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
|
|
|
289
289
|
T("error");
|
|
290
290
|
return;
|
|
291
291
|
}
|
|
292
|
-
|
|
292
|
+
R(Array.from({ length: s.numPages }, () => Ze)), v(s), T("ready");
|
|
293
293
|
} catch (s) {
|
|
294
294
|
d || (console.warn("[Ethora] PDF open failed:", s), T("error"));
|
|
295
295
|
}
|
|
@@ -307,10 +307,10 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
|
|
|
307
307
|
const n = m.numPages, e = await m.getPage(1), a = e.getViewport({ scale: 1 });
|
|
308
308
|
if (e.cleanup(), d || !a.width) return;
|
|
309
309
|
const s = { width: a.width, height: a.height };
|
|
310
|
-
|
|
310
|
+
R(Array.from({ length: n }, () => s));
|
|
311
311
|
for (let u = 2; u <= n; u += Ge) {
|
|
312
312
|
const y = Math.min(n, u + Ge - 1), z = await Promise.all(
|
|
313
|
-
Array.from({ length: y - u + 1 }, async (
|
|
313
|
+
Array.from({ length: y - u + 1 }, async (X, J) => {
|
|
314
314
|
const Q = u + J, se = await m.getPage(Q), pe = se.getViewport({ scale: 1 });
|
|
315
315
|
return se.cleanup(), {
|
|
316
316
|
pageNumber: Q,
|
|
@@ -319,9 +319,9 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
|
|
|
319
319
|
})
|
|
320
320
|
);
|
|
321
321
|
if (d) return;
|
|
322
|
-
|
|
323
|
-
if (
|
|
324
|
-
const J =
|
|
322
|
+
R((X) => {
|
|
323
|
+
if (X.length !== n) return X;
|
|
324
|
+
const J = X.slice();
|
|
325
325
|
return z.forEach(({ pageNumber: Q, size: se }) => {
|
|
326
326
|
J[Q - 1] = se;
|
|
327
327
|
}), J;
|
|
@@ -338,8 +338,8 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
|
|
|
338
338
|
const d = N.length > 0 ? N : [Ze], n = Math.max(1, $ - He * 2) * x, e = Math.max($, n + He * 2), a = [], s = [];
|
|
339
339
|
let u = je;
|
|
340
340
|
d.forEach((z) => {
|
|
341
|
-
const
|
|
342
|
-
a.push(u), s.push(
|
|
341
|
+
const X = n * z.height / (z.width || 1);
|
|
342
|
+
a.push(u), s.push(X), u += X + Ye;
|
|
343
343
|
});
|
|
344
344
|
const y = u - Ye;
|
|
345
345
|
return {
|
|
@@ -354,8 +354,8 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
|
|
|
354
354
|
P.current = L, _t(() => {
|
|
355
355
|
const d = l.current;
|
|
356
356
|
if (!d) return;
|
|
357
|
-
const n =
|
|
358
|
-
n && (
|
|
357
|
+
const n = S.current;
|
|
358
|
+
n && (S.current = null, d.scrollLeft = n.fx * d.scrollWidth - n.cx, d.scrollTop = n.fy * d.scrollHeight - n.cy);
|
|
359
359
|
const e = Ke(
|
|
360
360
|
d.scrollTop,
|
|
361
361
|
d.clientHeight,
|
|
@@ -368,11 +368,11 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
|
|
|
368
368
|
const e = l.current;
|
|
369
369
|
if (!e || !e.scrollHeight || !e.scrollWidth) return;
|
|
370
370
|
if (e.scrollTop <= 0 && e.scrollLeft <= 0) {
|
|
371
|
-
|
|
371
|
+
S.current = null;
|
|
372
372
|
return;
|
|
373
373
|
}
|
|
374
374
|
const a = d ?? e.clientWidth / 2, s = n ?? e.clientHeight / 2;
|
|
375
|
-
|
|
375
|
+
S.current = {
|
|
376
376
|
fx: (e.scrollLeft + a) / e.scrollWidth,
|
|
377
377
|
fy: (e.scrollTop + s) / e.scrollHeight,
|
|
378
378
|
cx: a,
|
|
@@ -380,8 +380,8 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
|
|
|
380
380
|
};
|
|
381
381
|
}, []), _ = B(
|
|
382
382
|
(d, n, e) => {
|
|
383
|
-
const a = un(d,
|
|
384
|
-
a !== A.current && (K(n, e), A.current = a,
|
|
383
|
+
const a = un(d, Xe, Fe);
|
|
384
|
+
a !== A.current && (K(n, e), A.current = a, D(a));
|
|
385
385
|
},
|
|
386
386
|
[K]
|
|
387
387
|
), ee = Math.max(Ve, Math.floor(E.width || 0));
|
|
@@ -401,10 +401,10 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
|
|
|
401
401
|
!m || ne || j(
|
|
402
402
|
qe(
|
|
403
403
|
Array.from({ length: m.numPages }, (d, n) => n + 1),
|
|
404
|
-
|
|
404
|
+
W
|
|
405
405
|
)
|
|
406
406
|
);
|
|
407
|
-
}, [m,
|
|
407
|
+
}, [m, W, ne]), M(() => {
|
|
408
408
|
const d = l.current;
|
|
409
409
|
if (!m || !d || typeof IntersectionObserver > "u")
|
|
410
410
|
return;
|
|
@@ -523,7 +523,7 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
|
|
|
523
523
|
height: L.heights[n],
|
|
524
524
|
top: L.tops[n],
|
|
525
525
|
left: L.left,
|
|
526
|
-
active:
|
|
526
|
+
active: O.has(e)
|
|
527
527
|
},
|
|
528
528
|
e
|
|
529
529
|
);
|
|
@@ -544,17 +544,17 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
|
|
|
544
544
|
),
|
|
545
545
|
c === "ready" && /* @__PURE__ */ b(an, { children: [
|
|
546
546
|
/* @__PURE__ */ b(sn, { children: [
|
|
547
|
-
|
|
547
|
+
W,
|
|
548
548
|
" / ",
|
|
549
549
|
Y
|
|
550
550
|
] }),
|
|
551
551
|
/* @__PURE__ */ b(ln, { children: [
|
|
552
552
|
/* @__PURE__ */ r(
|
|
553
|
-
|
|
553
|
+
Se,
|
|
554
554
|
{
|
|
555
555
|
type: "button",
|
|
556
556
|
onClick: () => _(A.current / xe),
|
|
557
|
-
disabled: x <=
|
|
557
|
+
disabled: x <= Xe,
|
|
558
558
|
"aria-label": o("modal.filePreview.zoomOut"),
|
|
559
559
|
children: /* @__PURE__ */ r(nt, { color: "currentColor" })
|
|
560
560
|
}
|
|
@@ -564,7 +564,7 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
|
|
|
564
564
|
"%"
|
|
565
565
|
] }),
|
|
566
566
|
/* @__PURE__ */ r(
|
|
567
|
-
|
|
567
|
+
Se,
|
|
568
568
|
{
|
|
569
569
|
type: "button",
|
|
570
570
|
onClick: () => _(A.current * xe),
|
|
@@ -574,7 +574,7 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
|
|
|
574
574
|
}
|
|
575
575
|
),
|
|
576
576
|
/* @__PURE__ */ r(
|
|
577
|
-
|
|
577
|
+
Se,
|
|
578
578
|
{
|
|
579
579
|
type: "button",
|
|
580
580
|
onClick: () => _(1),
|
|
@@ -671,27 +671,27 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
|
|
|
671
671
|
onError: w,
|
|
672
672
|
onScaleChange: c
|
|
673
673
|
}, T) => {
|
|
674
|
-
const m = U(null), v = U(null), [N,
|
|
675
|
-
|
|
676
|
-
const j = U(null),
|
|
674
|
+
const m = U(null), v = U(null), [N, R] = F(!1), [x, D] = F(G), [A, H] = F({ x: 0, y: 0 }), [k, W] = F(!1), [V, I] = F(!1), O = U({ scale: G, offset: { x: 0, y: 0 } });
|
|
675
|
+
O.current = { scale: x, offset: A };
|
|
676
|
+
const j = U(null), S = U(null), P = U(
|
|
677
677
|
null
|
|
678
678
|
), C = B((n) => {
|
|
679
679
|
const e = m.current, a = v.current;
|
|
680
680
|
if (!e) return { x: 0, y: 0 };
|
|
681
681
|
const s = e.clientWidth, u = e.clientHeight, y = a?.naturalWidth || 0, z = a?.naturalHeight || 0;
|
|
682
|
-
let
|
|
682
|
+
let X = s, J = u;
|
|
683
683
|
if (y > 0 && z > 0 && s > 0 && u > 0) {
|
|
684
684
|
const Q = Math.min(s / y, u / z);
|
|
685
|
-
|
|
685
|
+
X = y * Q, J = z * Q;
|
|
686
686
|
}
|
|
687
687
|
return {
|
|
688
|
-
x: Math.max(0, (
|
|
688
|
+
x: Math.max(0, (X * n - s) / 2),
|
|
689
689
|
y: Math.max(0, (J * n - u) / 2)
|
|
690
690
|
};
|
|
691
691
|
}, []), $ = B(
|
|
692
692
|
(n, e, a) => {
|
|
693
693
|
const s = ve(n, G, Ie), u = C(s);
|
|
694
|
-
|
|
694
|
+
W(a), D(s), H({
|
|
695
695
|
x: ve(e.x, -u.x, u.x),
|
|
696
696
|
y: ve(e.y, -u.y, u.y)
|
|
697
697
|
});
|
|
@@ -699,7 +699,7 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
|
|
|
699
699
|
[C]
|
|
700
700
|
), Y = B(
|
|
701
701
|
(n, e, a, s) => {
|
|
702
|
-
const u =
|
|
702
|
+
const u = O.current, y = ve(n, G, Ie), z = y / u.scale;
|
|
703
703
|
$(
|
|
704
704
|
y,
|
|
705
705
|
{
|
|
@@ -714,7 +714,7 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
|
|
|
714
714
|
$(G, { x: 0, y: 0 }, !0);
|
|
715
715
|
}, [$]), K = B(
|
|
716
716
|
(n) => {
|
|
717
|
-
Y(
|
|
717
|
+
Y(O.current.scale * n, 0, 0, !0);
|
|
718
718
|
},
|
|
719
719
|
[Y]
|
|
720
720
|
);
|
|
@@ -727,10 +727,10 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
|
|
|
727
727
|
}),
|
|
728
728
|
[K, L]
|
|
729
729
|
), M(() => {
|
|
730
|
-
|
|
730
|
+
W(!1), D(G), H({ x: 0, y: 0 });
|
|
731
731
|
}, [t]), M(() => {
|
|
732
732
|
const n = v.current;
|
|
733
|
-
|
|
733
|
+
R(!!(n?.complete && n.naturalWidth > 0));
|
|
734
734
|
}, [t]), M(() => {
|
|
735
735
|
c?.(x);
|
|
736
736
|
}, [x, c]), M(() => {
|
|
@@ -739,7 +739,7 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
|
|
|
739
739
|
const e = (a) => {
|
|
740
740
|
a.preventDefault();
|
|
741
741
|
const s = n.getBoundingClientRect(), u = a.clientX - s.left - s.width / 2, y = a.clientY - s.top - s.height / 2, z = Math.exp(-a.deltaY * wn);
|
|
742
|
-
Y(
|
|
742
|
+
Y(O.current.scale * z, u, y, !1);
|
|
743
743
|
};
|
|
744
744
|
return n.addEventListener("wheel", e, { passive: !1 }), () => n.removeEventListener("wheel", e);
|
|
745
745
|
}, [Y]);
|
|
@@ -747,7 +747,7 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
|
|
|
747
747
|
(n, e) => {
|
|
748
748
|
const a = m.current;
|
|
749
749
|
if (!a) return;
|
|
750
|
-
if (
|
|
750
|
+
if (O.current.scale > G) {
|
|
751
751
|
L();
|
|
752
752
|
return;
|
|
753
753
|
}
|
|
@@ -761,14 +761,14 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
|
|
|
761
761
|
},
|
|
762
762
|
[L, Y]
|
|
763
763
|
), ee = B((n) => {
|
|
764
|
-
n.button === 0 && (
|
|
764
|
+
n.button === 0 && (O.current.scale <= G || (n.preventDefault(), j.current = { x: n.clientX, y: n.clientY }, I(!0)));
|
|
765
765
|
}, []);
|
|
766
766
|
M(() => {
|
|
767
767
|
if (!V || typeof window > "u") return;
|
|
768
768
|
const n = (a) => {
|
|
769
769
|
const s = j.current;
|
|
770
770
|
if (!s) return;
|
|
771
|
-
const u =
|
|
771
|
+
const u = O.current;
|
|
772
772
|
$(
|
|
773
773
|
u.scale,
|
|
774
774
|
{
|
|
@@ -787,7 +787,7 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
|
|
|
787
787
|
const ne = B((n) => {
|
|
788
788
|
if (n.touches.length === 2) {
|
|
789
789
|
const [a, s] = [n.touches[0], n.touches[1]];
|
|
790
|
-
|
|
790
|
+
S.current = {
|
|
791
791
|
startX: 0,
|
|
792
792
|
startY: 0,
|
|
793
793
|
lastX: 0,
|
|
@@ -796,26 +796,26 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
|
|
|
796
796
|
a.clientX - s.clientX,
|
|
797
797
|
a.clientY - s.clientY
|
|
798
798
|
),
|
|
799
|
-
pinchScale:
|
|
799
|
+
pinchScale: O.current.scale,
|
|
800
800
|
panning: !1,
|
|
801
801
|
moved: !1
|
|
802
802
|
};
|
|
803
803
|
return;
|
|
804
804
|
}
|
|
805
805
|
const e = n.touches[0];
|
|
806
|
-
e && (
|
|
806
|
+
e && (S.current = {
|
|
807
807
|
startX: e.clientX,
|
|
808
808
|
startY: e.clientY,
|
|
809
809
|
lastX: e.clientX,
|
|
810
810
|
lastY: e.clientY,
|
|
811
811
|
pinchDistance: 0,
|
|
812
|
-
pinchScale:
|
|
813
|
-
panning:
|
|
812
|
+
pinchScale: O.current.scale,
|
|
813
|
+
panning: O.current.scale > G,
|
|
814
814
|
moved: !1
|
|
815
815
|
});
|
|
816
816
|
}, []), de = B(
|
|
817
817
|
(n) => {
|
|
818
|
-
const e =
|
|
818
|
+
const e = S.current;
|
|
819
819
|
if (!e) return;
|
|
820
820
|
if (n.touches.length === 2 && e.pinchDistance > 0) {
|
|
821
821
|
const [s, u] = [n.touches[0], n.touches[1]], y = Math.hypot(
|
|
@@ -823,7 +823,7 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
|
|
|
823
823
|
s.clientY - u.clientY
|
|
824
824
|
), z = m.current;
|
|
825
825
|
if (!z || y <= 0) return;
|
|
826
|
-
const
|
|
826
|
+
const X = z.getBoundingClientRect(), J = (s.clientX + u.clientX) / 2 - X.left - X.width / 2, Q = (s.clientY + u.clientY) / 2 - X.top - X.height / 2;
|
|
827
827
|
e.moved = !0, Y(
|
|
828
828
|
e.pinchScale * y / e.pinchDistance,
|
|
829
829
|
J,
|
|
@@ -835,7 +835,7 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
|
|
|
835
835
|
const a = n.touches[0];
|
|
836
836
|
if (a) {
|
|
837
837
|
if ((Math.abs(a.clientX - e.startX) > 6 || Math.abs(a.clientY - e.startY) > 6) && (e.moved = !0), e.panning) {
|
|
838
|
-
const s =
|
|
838
|
+
const s = O.current;
|
|
839
839
|
$(
|
|
840
840
|
s.scale,
|
|
841
841
|
{
|
|
@@ -851,9 +851,9 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
|
|
|
851
851
|
[$, Y]
|
|
852
852
|
), re = B(
|
|
853
853
|
(n) => {
|
|
854
|
-
const e =
|
|
854
|
+
const e = S.current;
|
|
855
855
|
if (!e || n.touches.length > 0) return;
|
|
856
|
-
if (
|
|
856
|
+
if (S.current = null, !e.moved && e.pinchDistance === 0) {
|
|
857
857
|
const u = Date.now(), y = P.current;
|
|
858
858
|
if (y && u - y.time < bn && Math.abs(y.x - e.startX) < Je && Math.abs(y.y - e.startY) < Je) {
|
|
859
859
|
P.current = null, _(e.startX, e.startY);
|
|
@@ -866,7 +866,7 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
|
|
|
866
866
|
};
|
|
867
867
|
return;
|
|
868
868
|
}
|
|
869
|
-
if (e.panning || e.pinchDistance > 0 ||
|
|
869
|
+
if (e.panning || e.pinchDistance > 0 || O.current.scale > G) return;
|
|
870
870
|
const a = e.lastX - e.startX, s = e.lastY - e.startY;
|
|
871
871
|
Math.abs(a) < mn || Math.abs(a) <= Math.abs(s) || (a < 0 ? E?.() : l?.());
|
|
872
872
|
},
|
|
@@ -953,7 +953,7 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
|
|
|
953
953
|
src: Le(t),
|
|
954
954
|
alt: o,
|
|
955
955
|
draggable: !1,
|
|
956
|
-
onLoad: () =>
|
|
956
|
+
onLoad: () => R(!0),
|
|
957
957
|
onError: w,
|
|
958
958
|
$grabbing: V,
|
|
959
959
|
$pannable: x > G,
|
|
@@ -980,10 +980,10 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
|
|
|
980
980
|
if (!t) return { name: "" };
|
|
981
981
|
const E = [t.username, t.id].map((v) => Ue(ie(v))).filter(Boolean), l = E.map((v) => o?.[v]).find((v) => v && (ye(v) || v.profileImage)), w = Ue(ie(i?.xmppUsername)), c = !!w && E.includes(w), T = ye(t) || Ee(t.name) || ye(l) || (c ? ye(i) || Ee(i?.name) : "") || E.map(Ee).find(Boolean) || Ee(g) || "", m = ie(t.photo) || ie(l?.profileImage) || (c ? ie(i?.profileImage) : "") || void 0;
|
|
982
982
|
return { name: T, photo: m };
|
|
983
|
-
}, Z = "#f5f7fa", ut = "rgba(245, 247, 250, 0.68)", fe = "rgba(255, 255, 255, 0.08)", ft = "rgba(255, 255, 255, 0.18)", ht = "var(--ethora-color-primary, #0052cd)",
|
|
983
|
+
}, Z = "#f5f7fa", ut = "rgba(245, 247, 250, 0.68)", fe = "rgba(255, 255, 255, 0.08)", ft = "rgba(255, 255, 255, 0.18)", ht = "var(--ethora-color-primary, #0052cd)", Rn = Ae`
|
|
984
984
|
from { opacity: 0; transform: scale(0.98); }
|
|
985
985
|
to { opacity: 1; transform: scale(1); }
|
|
986
|
-
`,
|
|
986
|
+
`, Sn = Ae`
|
|
987
987
|
from { opacity: 1; transform: scale(1); }
|
|
988
988
|
to { opacity: 0; transform: scale(0.98); }
|
|
989
989
|
`, Ln = f.div`
|
|
@@ -1000,7 +1000,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
|
|
|
1000
1000
|
background-color: rgba(10, 12, 18, 0.92);
|
|
1001
1001
|
-webkit-backdrop-filter: blur(8px);
|
|
1002
1002
|
backdrop-filter: blur(8px);
|
|
1003
|
-
animation: ${({ $closing: t }) => t ? ke`${
|
|
1003
|
+
animation: ${({ $closing: t }) => t ? ke`${Sn} 160ms ease-in forwards` : ke`${Rn} 160ms ease-out both`};
|
|
1004
1004
|
${$e}
|
|
1005
1005
|
|
|
1006
1006
|
/* Without backdrop-filter the translucent colour would sit over the chat
|
|
@@ -1074,7 +1074,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
|
|
|
1074
1074
|
opacity: 0.35;
|
|
1075
1075
|
cursor: default;
|
|
1076
1076
|
}
|
|
1077
|
-
`,
|
|
1077
|
+
`, On = f.div`
|
|
1078
1078
|
position: relative;
|
|
1079
1079
|
display: flex;
|
|
1080
1080
|
flex: 1 1 0;
|
|
@@ -1083,7 +1083,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
|
|
|
1083
1083
|
min-height: 0;
|
|
1084
1084
|
min-width: 0;
|
|
1085
1085
|
overflow: hidden;
|
|
1086
|
-
`,
|
|
1086
|
+
`, Dn = f.div`
|
|
1087
1087
|
position: relative;
|
|
1088
1088
|
display: flex;
|
|
1089
1089
|
align-items: center;
|
|
@@ -1201,7 +1201,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
|
|
|
1201
1201
|
},
|
|
1202
1202
|
children: /* @__PURE__ */ r("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ r("path", { d: "M8 5.5v13a1 1 0 0 0 1.5.86l10.5-6.5a1 1 0 0 0 0-1.72L9.5 4.64A1 1 0 0 0 8 5.5z" }) })
|
|
1203
1203
|
}
|
|
1204
|
-
),
|
|
1204
|
+
), Wn = () => /* @__PURE__ */ r(
|
|
1205
1205
|
"span",
|
|
1206
1206
|
{
|
|
1207
1207
|
"aria-hidden": "true",
|
|
@@ -1212,7 +1212,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
|
|
|
1212
1212
|
background: "linear-gradient(135deg, #2a3350, #151a2b)"
|
|
1213
1213
|
}
|
|
1214
1214
|
}
|
|
1215
|
-
),
|
|
1215
|
+
), Xn = f.div`
|
|
1216
1216
|
display: grid;
|
|
1217
1217
|
grid-template-columns: 1fr auto 1fr;
|
|
1218
1218
|
align-items: center;
|
|
@@ -1231,7 +1231,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
|
|
|
1231
1231
|
display: flex;
|
|
1232
1232
|
align-items: center;
|
|
1233
1233
|
gap: 6px;
|
|
1234
|
-
`,
|
|
1234
|
+
`, Oe = f.div`
|
|
1235
1235
|
display: flex;
|
|
1236
1236
|
flex-direction: column;
|
|
1237
1237
|
align-items: center;
|
|
@@ -1244,7 +1244,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
|
|
|
1244
1244
|
border-radius: 16px;
|
|
1245
1245
|
background-color: rgba(255, 255, 255, 0.05);
|
|
1246
1246
|
color: ${Z};
|
|
1247
|
-
`,
|
|
1247
|
+
`, De = f.h2`
|
|
1248
1248
|
margin: 0;
|
|
1249
1249
|
font-size: 18px;
|
|
1250
1250
|
font-weight: 600;
|
|
@@ -1309,9 +1309,9 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
|
|
|
1309
1309
|
onDownload: o
|
|
1310
1310
|
}) => {
|
|
1311
1311
|
const i = Pe();
|
|
1312
|
-
return /* @__PURE__ */ b(
|
|
1313
|
-
/* @__PURE__ */ r(Gn, { children: /* @__PURE__ */ r(
|
|
1314
|
-
/* @__PURE__ */ r(
|
|
1312
|
+
return /* @__PURE__ */ b(Oe, { role: "alert", "data-testid": "file-viewer-error", children: [
|
|
1313
|
+
/* @__PURE__ */ r(Gn, { children: /* @__PURE__ */ r(Rt, { size: 88 }) }),
|
|
1314
|
+
/* @__PURE__ */ r(De, { children: i("modal.filePreview.unavailable") }),
|
|
1315
1315
|
/* @__PURE__ */ b(jn, { children: [
|
|
1316
1316
|
/* @__PURE__ */ b(Vn, { type: "button", onClick: t, children: [
|
|
1317
1317
|
/* @__PURE__ */ r(er, {}),
|
|
@@ -1329,21 +1329,21 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
|
|
|
1329
1329
|
onDownload: i
|
|
1330
1330
|
}) => {
|
|
1331
1331
|
const g = Pe(), E = it(t).toUpperCase();
|
|
1332
|
-
return /* @__PURE__ */ b(
|
|
1332
|
+
return /* @__PURE__ */ b(Oe, { "data-testid": "file-viewer-file-card", children: [
|
|
1333
1333
|
/* @__PURE__ */ b(mt, { "aria-hidden": "true", children: [
|
|
1334
1334
|
/* @__PURE__ */ r(tr, {}),
|
|
1335
1335
|
E && /* @__PURE__ */ r(Jn, { children: E })
|
|
1336
1336
|
] }),
|
|
1337
|
-
/* @__PURE__ */ r(
|
|
1337
|
+
/* @__PURE__ */ r(De, { style: { overflowWrap: "anywhere" }, children: t || g("modal.filePreview.fileLabel") }),
|
|
1338
1338
|
/* @__PURE__ */ r(Hn, { children: o }),
|
|
1339
1339
|
/* @__PURE__ */ b(gt, { type: "button", onClick: i, children: [
|
|
1340
1340
|
/* @__PURE__ */ r(bt, {}),
|
|
1341
1341
|
g("modal.filePreview.download")
|
|
1342
1342
|
] })
|
|
1343
1343
|
] });
|
|
1344
|
-
}, qn = ({ fileName: t, src: o }) => /* @__PURE__ */ b(
|
|
1344
|
+
}, qn = ({ fileName: t, src: o }) => /* @__PURE__ */ b(Oe, { "data-testid": "file-viewer-audio-card", children: [
|
|
1345
1345
|
/* @__PURE__ */ r(mt, { "aria-hidden": "true", children: /* @__PURE__ */ r(nr, {}) }),
|
|
1346
|
-
/* @__PURE__ */ r(
|
|
1346
|
+
/* @__PURE__ */ r(De, { style: { overflowWrap: "anywhere" }, children: t }),
|
|
1347
1347
|
/* @__PURE__ */ r(
|
|
1348
1348
|
"audio",
|
|
1349
1349
|
{
|
|
@@ -1423,7 +1423,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
|
|
|
1423
1423
|
}, ar = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches, sr = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), audio[controls], video[controls], [tabindex]:not([tabindex="-1"])', ur = ({
|
|
1424
1424
|
handleCloseModal: t
|
|
1425
1425
|
}) => {
|
|
1426
|
-
const o =
|
|
1426
|
+
const o = St(), i = Pe(), g = Lt(), { activeFile: E } = le(
|
|
1427
1427
|
(h) => h.chatSettingStore
|
|
1428
1428
|
), l = te(
|
|
1429
1429
|
() => E ?? { fileName: "", fileURL: "", mimetype: "" },
|
|
@@ -1435,16 +1435,16 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
|
|
|
1435
1435
|
), T = le((h) => h.rooms.usersSet), m = le((h) => h.chatSettingStore.user), v = le((h) => {
|
|
1436
1436
|
const p = _e(h);
|
|
1437
1437
|
return p?.type === "private" ? String(p?.title || p?.name || "") : "";
|
|
1438
|
-
}), N = U(null),
|
|
1438
|
+
}), N = U(null), R = U(null), x = U([]), [D, A] = F(G), [H, k] = F(null), [W, V] = F(
|
|
1439
1439
|
null
|
|
1440
|
-
), I = Tt(l?.mimetype, l?.fileName),
|
|
1441
|
-
if (
|
|
1440
|
+
), I = Tt(l?.mimetype, l?.fileName), O = te(() => Ct(c), [c]), j = l.siblings, S = te(() => {
|
|
1441
|
+
if (Re(O, l) >= 0) return O;
|
|
1442
1442
|
const h = Mt(j);
|
|
1443
|
-
return
|
|
1444
|
-
}, [
|
|
1445
|
-
() => I === "image" || I === "video" ?
|
|
1446
|
-
[
|
|
1447
|
-
), C = P >= 0 &&
|
|
1443
|
+
return Re(h, l) >= 0 ? h : O;
|
|
1444
|
+
}, [O, j, l]), P = te(
|
|
1445
|
+
() => I === "image" || I === "video" ? Re(S, l) : -1,
|
|
1446
|
+
[S, l, I]
|
|
1447
|
+
), C = P >= 0 && S.length > 1, $ = C && P > 0, Y = C && P < S.length - 1, L = P >= 0 ? S[P] : void 0, K = L?.fileName || l.fileName, _ = L?.sender ?? l.sender, ee = te(
|
|
1448
1448
|
() => Pn({
|
|
1449
1449
|
sender: _,
|
|
1450
1450
|
usersSet: T,
|
|
@@ -1454,10 +1454,10 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
|
|
|
1454
1454
|
[_, T, m, v]
|
|
1455
1455
|
), ne = ee.name, de = rr(L?.date ?? l.date), re = !!l.fileURL, oe = I === "image" && (!re || H === l.fileURL), d = te(() => {
|
|
1456
1456
|
const h = ue(l.fileURL, w);
|
|
1457
|
-
return
|
|
1458
|
-
}, [l.fileURL, w,
|
|
1457
|
+
return W?.url === l.fileURL ? or(h, W.count) : h;
|
|
1458
|
+
}, [l.fileURL, w, W]), n = L?.previewURL ? ue(L.previewURL, w) : void 0, e = B(
|
|
1459
1459
|
(h) => {
|
|
1460
|
-
const p =
|
|
1460
|
+
const p = S[h];
|
|
1461
1461
|
p && o(
|
|
1462
1462
|
Be({
|
|
1463
1463
|
fileName: p.fileName,
|
|
@@ -1468,7 +1468,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
|
|
|
1468
1468
|
})
|
|
1469
1469
|
);
|
|
1470
1470
|
},
|
|
1471
|
-
[o,
|
|
1471
|
+
[o, S, j]
|
|
1472
1472
|
), a = B(() => {
|
|
1473
1473
|
$ && e(P - 1);
|
|
1474
1474
|
}, [e, $, P]), s = B(() => {
|
|
@@ -1476,12 +1476,12 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
|
|
|
1476
1476
|
}, [e, Y, P]);
|
|
1477
1477
|
M(() => {
|
|
1478
1478
|
!C || typeof Image > "u" || [P - 1, P + 1].forEach((h) => {
|
|
1479
|
-
const p =
|
|
1479
|
+
const p = S[h];
|
|
1480
1480
|
if (!p || p.kind !== "image") return;
|
|
1481
1481
|
const q = ue(p.fileURL, w);
|
|
1482
1482
|
q && (new Image().src = q);
|
|
1483
1483
|
});
|
|
1484
|
-
}, [C, P,
|
|
1484
|
+
}, [C, P, S, w]), M(() => {
|
|
1485
1485
|
if (!C) return;
|
|
1486
1486
|
x.current[P]?.scrollIntoView?.({
|
|
1487
1487
|
block: "nearest",
|
|
@@ -1505,14 +1505,14 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
|
|
|
1505
1505
|
p.preventDefault(), p.key === "ArrowLeft" ? a() : s();
|
|
1506
1506
|
return;
|
|
1507
1507
|
}
|
|
1508
|
-
I !== "image" || oe || (p.key === "+" || p.key === "=" ? (p.preventDefault(),
|
|
1508
|
+
I !== "image" || oe || (p.key === "+" || p.key === "=" ? (p.preventDefault(), R.current?.zoomIn()) : p.key === "-" || p.key === "_" ? (p.preventDefault(), R.current?.zoomOut()) : p.key === "0" && (p.preventDefault(), R.current?.reset()));
|
|
1509
1509
|
}
|
|
1510
1510
|
};
|
|
1511
1511
|
return document.addEventListener("keydown", h), () => document.removeEventListener("keydown", h);
|
|
1512
1512
|
}, [C, a, s, I, oe]);
|
|
1513
1513
|
const u = () => {
|
|
1514
1514
|
const q = !!it(l.fileName) ? l.fileName : `MEDIA-ETHORA.${I === "image" ? "png" : I === "video" ? "mp4" : "bin"}`;
|
|
1515
|
-
|
|
1515
|
+
Wt(Ne(l.fileURL), q).catch((be) => {
|
|
1516
1516
|
zt.log(be);
|
|
1517
1517
|
});
|
|
1518
1518
|
}, y = () => {
|
|
@@ -1523,14 +1523,14 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
|
|
|
1523
1523
|
);
|
|
1524
1524
|
}, z = () => {
|
|
1525
1525
|
o(Be(void 0)), t?.();
|
|
1526
|
-
},
|
|
1526
|
+
}, X = (h) => {
|
|
1527
1527
|
h.target === h.currentTarget && z();
|
|
1528
1528
|
}, J = () => {
|
|
1529
1529
|
et(l.fileURL) && tt(), k(l.fileURL);
|
|
1530
1530
|
}, Q = () => {
|
|
1531
1531
|
V({
|
|
1532
1532
|
url: l.fileURL,
|
|
1533
|
-
count: (
|
|
1533
|
+
count: (W?.url === l.fileURL ? W.count : 0) + 1
|
|
1534
1534
|
}), k(null);
|
|
1535
1535
|
}, se = (h) => {
|
|
1536
1536
|
if (h.key !== "Tab" || !N.current) return;
|
|
@@ -1550,7 +1550,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
|
|
|
1550
1550
|
ae = /* @__PURE__ */ r(
|
|
1551
1551
|
dt,
|
|
1552
1552
|
{
|
|
1553
|
-
ref:
|
|
1553
|
+
ref: R,
|
|
1554
1554
|
src: d,
|
|
1555
1555
|
previewSrc: n,
|
|
1556
1556
|
alt: pe,
|
|
@@ -1649,7 +1649,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
|
|
|
1649
1649
|
)
|
|
1650
1650
|
] })
|
|
1651
1651
|
] }),
|
|
1652
|
-
/* @__PURE__ */ b(
|
|
1652
|
+
/* @__PURE__ */ b(On, { onClick: X, "data-testid": "file-viewer-stage", children: [
|
|
1653
1653
|
C && /* @__PURE__ */ r(
|
|
1654
1654
|
Qe,
|
|
1655
1655
|
{
|
|
@@ -1658,10 +1658,10 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
|
|
|
1658
1658
|
onClick: a,
|
|
1659
1659
|
disabled: !$,
|
|
1660
1660
|
"aria-label": i("modal.filePreview.previousItem"),
|
|
1661
|
-
children: /* @__PURE__ */ r(
|
|
1661
|
+
children: /* @__PURE__ */ r(Ot, { color: "currentColor" })
|
|
1662
1662
|
}
|
|
1663
1663
|
),
|
|
1664
|
-
/* @__PURE__ */ r(
|
|
1664
|
+
/* @__PURE__ */ r(Dn, { $fit: me, children: ae }),
|
|
1665
1665
|
C && /* @__PURE__ */ r(
|
|
1666
1666
|
Qe,
|
|
1667
1667
|
{
|
|
@@ -1670,7 +1670,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
|
|
|
1670
1670
|
onClick: s,
|
|
1671
1671
|
disabled: !Y,
|
|
1672
1672
|
"aria-label": i("modal.filePreview.nextItem"),
|
|
1673
|
-
children: /* @__PURE__ */ r(
|
|
1673
|
+
children: /* @__PURE__ */ r(Dt, { color: "currentColor" })
|
|
1674
1674
|
}
|
|
1675
1675
|
)
|
|
1676
1676
|
] }),
|
|
@@ -1681,7 +1681,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
|
|
|
1681
1681
|
role: "group",
|
|
1682
1682
|
"aria-label": i("modal.filePreview.thumbnails"),
|
|
1683
1683
|
"data-testid": "file-viewer-thumbnails",
|
|
1684
|
-
children:
|
|
1684
|
+
children: S.map((h, p) => /* @__PURE__ */ b(
|
|
1685
1685
|
_n,
|
|
1686
1686
|
{
|
|
1687
1687
|
ref: (q) => {
|
|
@@ -1691,12 +1691,12 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
|
|
|
1691
1691
|
$active: p === P,
|
|
1692
1692
|
"aria-label": i("modal.filePreview.showItem", {
|
|
1693
1693
|
current: p + 1,
|
|
1694
|
-
total:
|
|
1694
|
+
total: S.length
|
|
1695
1695
|
}),
|
|
1696
1696
|
"aria-current": p === P ? "true" : void 0,
|
|
1697
1697
|
onClick: () => e(p),
|
|
1698
1698
|
children: [
|
|
1699
|
-
h.kind === "video" && !h.previewURL ? /* @__PURE__ */ r(
|
|
1699
|
+
h.kind === "video" && !h.previewURL ? /* @__PURE__ */ r(Wn, {}) : /* @__PURE__ */ r(
|
|
1700
1700
|
Bn,
|
|
1701
1701
|
{
|
|
1702
1702
|
src: Le(
|
|
@@ -1714,19 +1714,19 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
|
|
|
1714
1714
|
))
|
|
1715
1715
|
}
|
|
1716
1716
|
),
|
|
1717
|
-
/* @__PURE__ */ b(
|
|
1717
|
+
/* @__PURE__ */ b(Xn, { children: [
|
|
1718
1718
|
/* @__PURE__ */ r("span", {}),
|
|
1719
1719
|
C ? /* @__PURE__ */ r(Fn, { "data-testid": "lightbox-position", "aria-live": "polite", children: i("modal.filePreview.position", {
|
|
1720
1720
|
current: P + 1,
|
|
1721
|
-
total:
|
|
1721
|
+
total: S.length
|
|
1722
1722
|
}) }) : /* @__PURE__ */ r("span", {}),
|
|
1723
1723
|
xt ? /* @__PURE__ */ b(Yn, { children: [
|
|
1724
1724
|
/* @__PURE__ */ r(
|
|
1725
1725
|
ce,
|
|
1726
1726
|
{
|
|
1727
1727
|
type: "button",
|
|
1728
|
-
onClick: () =>
|
|
1729
|
-
disabled:
|
|
1728
|
+
onClick: () => R.current?.zoomOut(),
|
|
1729
|
+
disabled: D <= G,
|
|
1730
1730
|
"aria-label": i("modal.filePreview.zoomOut"),
|
|
1731
1731
|
children: /* @__PURE__ */ r(nt, { color: "currentColor" })
|
|
1732
1732
|
}
|
|
@@ -1735,8 +1735,8 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
|
|
|
1735
1735
|
ce,
|
|
1736
1736
|
{
|
|
1737
1737
|
type: "button",
|
|
1738
|
-
onClick: () =>
|
|
1739
|
-
disabled:
|
|
1738
|
+
onClick: () => R.current?.zoomIn(),
|
|
1739
|
+
disabled: D >= Ie,
|
|
1740
1740
|
"aria-label": i("modal.filePreview.zoomIn"),
|
|
1741
1741
|
children: /* @__PURE__ */ r(rt, { color: "currentColor" })
|
|
1742
1742
|
}
|
|
@@ -1745,8 +1745,8 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
|
|
|
1745
1745
|
ce,
|
|
1746
1746
|
{
|
|
1747
1747
|
type: "button",
|
|
1748
|
-
onClick: () =>
|
|
1749
|
-
disabled:
|
|
1748
|
+
onClick: () => R.current?.reset(),
|
|
1749
|
+
disabled: D <= G,
|
|
1750
1750
|
"aria-label": i("modal.filePreview.resetZoom"),
|
|
1751
1751
|
children: /* @__PURE__ */ r(ot, { color: "currentColor" })
|
|
1752
1752
|
}
|