@ethora/chat-component 26.10.6 → 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 +102 -3
- package/dist/ChatProfileModal-83t5BRkI.js +2298 -0
- package/dist/{FilePreviewModal-DwNUEHei.js → FilePreviewModal-DxUGjSHe.js} +135 -135
- package/dist/{ManageDataModal-CaQ2VBPn.js → ManageDataModal-DFE_Wegj.js} +24 -24
- package/dist/{MarkdownBody-BeoG2cpo.js → MarkdownBody-uFITrPjT.js} +1 -1
- package/dist/{MessageSearchModal-DMw9o49-.js → MessageSearchModal-CsbTWgNm.js} +46 -46
- package/dist/{PublicChatsModal-CWdYILv_.js → PublicChatsModal-bDOp3IL9.js} +18 -18
- package/dist/{SideDrawer-Cl-vbuIG.js → SideDrawer-A_1ECqD2.js} +29 -29
- package/dist/UserProfileModal-Ca5wHYvr.js +639 -0
- package/dist/{UserSettingsModal-DgCAHmNh.js → UserSettingsModal-CAyyQGV6.js} +4 -4
- package/dist/{VideoCallOverlay-Cq2cECWj.js → VideoCallOverlay-BMiQh8kI.js} +6605 -4726
- package/dist/{VisibilityModal-D7vqGbrA.js → VisibilityModal-BXyIy7_J.js} +12 -12
- 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 +25 -4
- 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 +39 -0
- package/dist/firebase-messaging-sw.js +918 -96
- package/dist/{handleCopyClick-Crn2jEEu.js → handleCopyClick-BX1fcFGN.js} +1 -1
- package/dist/helpers/callClaim.d.ts +17 -0
- package/dist/helpers/callOutcomeSync.d.ts +23 -0
- package/dist/helpers/callPush.d.ts +25 -0
- package/dist/helpers/canLeaveRoom.d.ts +3 -0
- package/dist/helpers/chatComponentConfigEvents.d.ts +16 -0
- package/dist/helpers/incomingCallPush.d.ts +89 -0
- package/dist/helpers/liveConfig.d.ts +46 -0
- package/dist/helpers/pushRoomHandoff.d.ts +13 -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/useChatSettingState.d.ts +1 -0
- package/dist/hooks/useNow.d.ts +6 -0
- package/dist/hooks/usePushNotifications.d.ts +2 -0
- package/dist/hooks/useRemoteAppearance.d.ts +21 -0
- package/dist/hooks/useTypography.d.ts +4 -0
- package/dist/{main-36gqdbJ8.js → main-B25iFKAC.js} +16623 -13399
- package/dist/main.d.ts +3 -1
- package/dist/main.js +25 -23
- 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 +11 -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/networking/xmpp/sendMessageReaction.xmpp.d.ts +13 -1
- package/dist/networking/xmppClient.d.ts +2 -1
- package/dist/roomStore/Middleware/blockedHydrationMiddleware.d.ts +2 -0
- package/dist/roomStore/callSlice.d.ts +23 -1
- package/dist/roomStore/chatSettingsSlice.d.ts +11 -2
- package/dist/roomStore/index.d.ts +4 -0
- package/dist/roomStore/scheduledCallSlice.d.ts +47 -0
- package/dist/types/models/config.model.d.ts +78 -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/dist/types/models/xmpp.model.d.ts +2 -1
- package/dist/utils/callAuthMirror.d.ts +1 -0
- package/dist/utils/callBroadcast.d.ts +12 -0
- package/dist/utils/callNotifications.d.ts +67 -0
- package/dist/utils/firebasePushNotifications.d.ts +14 -0
- package/dist/utils/handledCalls.d.ts +5 -0
- package/dist/utils/pushServiceWorkerBridge.d.ts +19 -0
- package/dist/utils/webLock.d.ts +13 -0
- package/package.json +1 -1
- package/public/firebase-messaging-sw.js +918 -96
- package/dist/ChatProfileModal-OJCKwdNp.js +0 -2168
- package/dist/UserProfileModal-B8KtGnwZ.js +0 -594
|
@@ -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");
|
|
@@ -36,15 +36,15 @@ function Xt({ 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: W, top: V, width: I, height:
|
|
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
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 Xt({ 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]), Xe = 0.5, Fe = 3, xe = 1.25, Vt = 2e-3, Ye = 12, He = 16, je = 16, Gt = 72, Ve = 320,
|
|
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;
|
|
@@ -201,7 +201,7 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
|
|
|
201
201
|
`, un = (t, o, i) => Math.min(i, Math.max(o, t)), fn = (t) => {
|
|
202
202
|
const o = t;
|
|
203
203
|
return !o || !o.tagName ? !1 : o.isContentEditable ? !0 : ["INPUT", "TEXTAREA", "SELECT"].includes(o.tagName);
|
|
204
|
-
},
|
|
204
|
+
}, Ke = (t, o, i, g) => {
|
|
205
205
|
const E = t + o;
|
|
206
206
|
let l = 0, w = -1;
|
|
207
207
|
for (let c = 0; c < i.length; c += 1) {
|
|
@@ -213,7 +213,7 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
|
|
|
213
213
|
}
|
|
214
214
|
return l + 1;
|
|
215
215
|
}, qe = (t, o) => new Set(
|
|
216
|
-
[...t].sort((i, g) => Math.abs(i - o) - Math.abs(g - o) || i - g).slice(0,
|
|
216
|
+
[...t].sort((i, g) => Math.abs(i - o) - Math.abs(g - o) || i - g).slice(0, Kt)
|
|
217
217
|
), hn = Me.memo(function({
|
|
218
218
|
pdfDocument: o,
|
|
219
219
|
pageNumber: i,
|
|
@@ -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
|
-
}), W =
|
|
244
|
+
}), W = R.getContext("2d");
|
|
245
245
|
if (!W) return;
|
|
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:",
|
|
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;
|
|
@@ -267,10 +267,10 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
|
|
|
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,7 +307,7 @@ 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
313
|
Array.from({ length: y - u + 1 }, async (X, J) => {
|
|
@@ -319,7 +319,7 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
|
|
|
319
319
|
})
|
|
320
320
|
);
|
|
321
321
|
if (d) return;
|
|
322
|
-
|
|
322
|
+
R((X) => {
|
|
323
323
|
if (X.length !== n) return X;
|
|
324
324
|
const J = X.slice();
|
|
325
325
|
return z.forEach(({ pageNumber: Q, size: se }) => {
|
|
@@ -335,7 +335,7 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
|
|
|
335
335
|
};
|
|
336
336
|
}, [m]);
|
|
337
337
|
const L = te(() => {
|
|
338
|
-
const d = N.length > 0 ? N : [
|
|
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
341
|
const X = n * z.height / (z.width || 1);
|
|
@@ -354,9 +354,9 @@ 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 && (
|
|
359
|
-
const e =
|
|
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
|
+
const e = Ke(
|
|
360
360
|
d.scrollTop,
|
|
361
361
|
d.clientHeight,
|
|
362
362
|
L.tops,
|
|
@@ -364,15 +364,15 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
|
|
|
364
364
|
);
|
|
365
365
|
e !== I.current && (I.current = e, V(e));
|
|
366
366
|
}, [L]);
|
|
367
|
-
const
|
|
367
|
+
const K = B((d, n) => {
|
|
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,
|
|
@@ -381,9 +381,9 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
|
|
|
381
381
|
}, []), _ = B(
|
|
382
382
|
(d, n, e) => {
|
|
383
383
|
const a = un(d, Xe, Fe);
|
|
384
|
-
a !== A.current && (
|
|
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));
|
|
388
388
|
M(() => {
|
|
389
389
|
if (H === 0) {
|
|
@@ -392,10 +392,10 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
|
|
|
392
392
|
}
|
|
393
393
|
if (ee === H) return;
|
|
394
394
|
const d = window.setTimeout(() => {
|
|
395
|
-
|
|
396
|
-
},
|
|
395
|
+
K(), k(ee);
|
|
396
|
+
}, Zt);
|
|
397
397
|
return () => window.clearTimeout(d);
|
|
398
|
-
}, [ee, H,
|
|
398
|
+
}, [ee, H, K]);
|
|
399
399
|
const ne = typeof IntersectionObserver < "u";
|
|
400
400
|
M(() => {
|
|
401
401
|
!m || ne || j(
|
|
@@ -422,7 +422,7 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
|
|
|
422
422
|
const de = B(() => {
|
|
423
423
|
const d = l.current, n = P.current;
|
|
424
424
|
if (!d || !n) return;
|
|
425
|
-
const e =
|
|
425
|
+
const e = Ke(
|
|
426
426
|
d.scrollTop,
|
|
427
427
|
d.clientHeight,
|
|
428
428
|
n.tops,
|
|
@@ -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
|
);
|
|
@@ -550,7 +550,7 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
|
|
|
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),
|
|
@@ -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,9 +671,9 @@ 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;
|
|
@@ -691,7 +691,7 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
|
|
|
691
691
|
}, []), $ = B(
|
|
692
692
|
(n, e, a) => {
|
|
693
693
|
const s = ve(n, G, Ie), u = C(s);
|
|
694
|
-
W(a),
|
|
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
|
{
|
|
@@ -712,25 +712,25 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
|
|
|
712
712
|
[$]
|
|
713
713
|
), L = B(() => {
|
|
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
|
);
|
|
721
721
|
Me.useImperativeHandle(
|
|
722
722
|
T,
|
|
723
723
|
() => ({
|
|
724
|
-
zoomIn: () =>
|
|
725
|
-
zoomOut: () =>
|
|
724
|
+
zoomIn: () => K(1.5),
|
|
725
|
+
zoomOut: () => K(1 / 1.5),
|
|
726
726
|
reset: L
|
|
727
727
|
}),
|
|
728
|
-
[
|
|
728
|
+
[K, L]
|
|
729
729
|
), M(() => {
|
|
730
|
-
W(!1),
|
|
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(
|
|
@@ -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
|
-
},
|
|
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`
|
|
@@ -996,11 +996,11 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
|
|
|
996
996
|
display: flex;
|
|
997
997
|
flex-direction: column;
|
|
998
998
|
box-sizing: border-box;
|
|
999
|
-
color: ${
|
|
999
|
+
color: ${Z};
|
|
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
|
|
@@ -1030,7 +1030,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
|
|
|
1030
1030
|
`, In = f.span`
|
|
1031
1031
|
font-size: 15px;
|
|
1032
1032
|
font-weight: 600;
|
|
1033
|
-
color: ${
|
|
1033
|
+
color: ${Z};
|
|
1034
1034
|
overflow: hidden;
|
|
1035
1035
|
text-overflow: ellipsis;
|
|
1036
1036
|
white-space: nowrap;
|
|
@@ -1057,7 +1057,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
|
|
|
1057
1057
|
border: 0;
|
|
1058
1058
|
border-radius: 50%;
|
|
1059
1059
|
background-color: ${fe};
|
|
1060
|
-
color: ${
|
|
1060
|
+
color: ${Z};
|
|
1061
1061
|
cursor: pointer;
|
|
1062
1062
|
transition: background-color 150ms ease;
|
|
1063
1063
|
|
|
@@ -1066,7 +1066,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
|
|
|
1066
1066
|
}
|
|
1067
1067
|
|
|
1068
1068
|
&:focus-visible {
|
|
1069
|
-
outline: 2px solid ${
|
|
1069
|
+
outline: 2px solid ${Z};
|
|
1070
1070
|
outline-offset: 2px;
|
|
1071
1071
|
}
|
|
1072
1072
|
|
|
@@ -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;
|
|
@@ -1114,7 +1114,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
|
|
|
1114
1114
|
border: 0;
|
|
1115
1115
|
border-radius: 50%;
|
|
1116
1116
|
background-color: rgba(10, 12, 18, 0.55);
|
|
1117
|
-
color: ${
|
|
1117
|
+
color: ${Z};
|
|
1118
1118
|
cursor: pointer;
|
|
1119
1119
|
transition: background-color 150ms ease, opacity 150ms ease;
|
|
1120
1120
|
|
|
@@ -1123,7 +1123,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
|
|
|
1123
1123
|
}
|
|
1124
1124
|
|
|
1125
1125
|
&:focus-visible {
|
|
1126
|
-
outline: 2px solid ${
|
|
1126
|
+
outline: 2px solid ${Z};
|
|
1127
1127
|
outline-offset: 2px;
|
|
1128
1128
|
}
|
|
1129
1129
|
|
|
@@ -1176,7 +1176,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
|
|
|
1176
1176
|
}
|
|
1177
1177
|
|
|
1178
1178
|
&:focus-visible {
|
|
1179
|
-
outline: 2px solid ${
|
|
1179
|
+
outline: 2px solid ${Z};
|
|
1180
1180
|
outline-offset: 2px;
|
|
1181
1181
|
}
|
|
1182
1182
|
`, Bn = f.img`
|
|
@@ -1222,7 +1222,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
|
|
|
1222
1222
|
padding: 6px 14px;
|
|
1223
1223
|
border-radius: 999px;
|
|
1224
1224
|
background-color: ${fe};
|
|
1225
|
-
color: ${
|
|
1225
|
+
color: ${Z};
|
|
1226
1226
|
font-size: 13px;
|
|
1227
1227
|
font-variant-numeric: tabular-nums;
|
|
1228
1228
|
white-space: nowrap;
|
|
@@ -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;
|
|
@@ -1243,13 +1243,13 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
|
|
|
1243
1243
|
text-align: center;
|
|
1244
1244
|
border-radius: 16px;
|
|
1245
1245
|
background-color: rgba(255, 255, 255, 0.05);
|
|
1246
|
-
color: ${
|
|
1247
|
-
`,
|
|
1246
|
+
color: ${Z};
|
|
1247
|
+
`, De = f.h2`
|
|
1248
1248
|
margin: 0;
|
|
1249
1249
|
font-size: 18px;
|
|
1250
1250
|
font-weight: 600;
|
|
1251
1251
|
line-height: 1.3;
|
|
1252
|
-
color: ${
|
|
1252
|
+
color: ${Z};
|
|
1253
1253
|
`, Hn = f.p`
|
|
1254
1254
|
margin: 0;
|
|
1255
1255
|
font-size: 14px;
|
|
@@ -1277,7 +1277,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
|
|
|
1277
1277
|
transition: background-color 150ms ease;
|
|
1278
1278
|
|
|
1279
1279
|
&:focus-visible {
|
|
1280
|
-
outline: 2px solid ${
|
|
1280
|
+
outline: 2px solid ${Z};
|
|
1281
1281
|
outline-offset: 2px;
|
|
1282
1282
|
}
|
|
1283
1283
|
`, gt = f(pt)`
|
|
@@ -1291,7 +1291,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
|
|
|
1291
1291
|
`, Vn = f(pt)`
|
|
1292
1292
|
border: 1px solid rgba(255, 255, 255, 0.28);
|
|
1293
1293
|
background-color: transparent;
|
|
1294
|
-
color: ${
|
|
1294
|
+
color: ${Z};
|
|
1295
1295
|
|
|
1296
1296
|
&:hover {
|
|
1297
1297
|
background-color: ${fe};
|
|
@@ -1304,14 +1304,14 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
|
|
|
1304
1304
|
> span {
|
|
1305
1305
|
color: #9cc0ff;
|
|
1306
1306
|
}
|
|
1307
|
-
`,
|
|
1307
|
+
`, Zn = ({
|
|
1308
1308
|
onRetry: t,
|
|
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, {}),
|
|
@@ -1323,27 +1323,27 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
|
|
|
1323
1323
|
] })
|
|
1324
1324
|
] })
|
|
1325
1325
|
] });
|
|
1326
|
-
},
|
|
1326
|
+
}, Kn = ({
|
|
1327
1327
|
fileName: t,
|
|
1328
1328
|
unsupportedText: o,
|
|
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
|
{
|
|
@@ -1362,7 +1362,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
|
|
|
1362
1362
|
height: 116px;
|
|
1363
1363
|
border-radius: 12px;
|
|
1364
1364
|
background-color: ${fe};
|
|
1365
|
-
color: ${
|
|
1365
|
+
color: ${Z};
|
|
1366
1366
|
`, Jn = f.span`
|
|
1367
1367
|
position: absolute;
|
|
1368
1368
|
bottom: 14px;
|
|
@@ -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,
|
|
@@ -1457,7 +1457,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
|
|
|
1457
1457
|
return W?.url === l.fileURL ? or(h, W.count) : h;
|
|
1458
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,7 +1505,7 @@ 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);
|
|
@@ -1543,14 +1543,14 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
|
|
|
1543
1543
|
}, pe = l.fileName || i("modal.filePreview.imageAlt"), wt = i("modal.filePreview.unsupported"), ge = ue(l.fileURL, w);
|
|
1544
1544
|
let ae, me = "media";
|
|
1545
1545
|
if (oe)
|
|
1546
|
-
me = "content", ae = /* @__PURE__ */ r(
|
|
1546
|
+
me = "content", ae = /* @__PURE__ */ r(Zn, { onRetry: Q, onDownload: u });
|
|
1547
1547
|
else
|
|
1548
1548
|
switch (I) {
|
|
1549
1549
|
case "image":
|
|
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,
|
|
@@ -1574,16 +1574,16 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
|
|
|
1574
1574
|
);
|
|
1575
1575
|
break;
|
|
1576
1576
|
case "audio":
|
|
1577
|
-
me = "content", ae = /* @__PURE__ */ r(qn, { fileName:
|
|
1577
|
+
me = "content", ae = /* @__PURE__ */ r(qn, { fileName: K, src: ge });
|
|
1578
1578
|
break;
|
|
1579
1579
|
case "pdf":
|
|
1580
1580
|
ae = /* @__PURE__ */ r(pn, { pdfUrl: ge });
|
|
1581
1581
|
break;
|
|
1582
1582
|
default:
|
|
1583
1583
|
me = "content", ae = /* @__PURE__ */ r(
|
|
1584
|
-
|
|
1584
|
+
Kn,
|
|
1585
1585
|
{
|
|
1586
|
-
fileName:
|
|
1586
|
+
fileName: K,
|
|
1587
1587
|
unsupportedText: wt,
|
|
1588
1588
|
onDownload: u
|
|
1589
1589
|
}
|
|
@@ -1612,7 +1612,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
|
|
|
1612
1612
|
),
|
|
1613
1613
|
/* @__PURE__ */ b(Mn, { children: [
|
|
1614
1614
|
ne && /* @__PURE__ */ r(In, { children: ne }),
|
|
1615
|
-
/* @__PURE__ */ r($n, { children: [de,
|
|
1615
|
+
/* @__PURE__ */ r($n, { children: [de, K].filter(Boolean).join(" · ") || i("modal.filePreview.title") })
|
|
1616
1616
|
] })
|
|
1617
1617
|
] }),
|
|
1618
1618
|
/* @__PURE__ */ b(An, { children: [
|
|
@@ -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,7 +1691,7 @@ 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),
|
|
@@ -1718,15 +1718,15 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
|
|
|
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
|
}
|