@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
|
@@ -0,0 +1,2298 @@
|
|
|
1
|
+
import { jsx as E, jsxs as j, Fragment as St } from "react/jsx-runtime";
|
|
2
|
+
import qe, { useRef as _t, useState as W, useMemo as he } from "react";
|
|
3
|
+
import { Y as dr, b as Dt, Z as ve, aB as hr, U as ee, a4 as H, a as Fe, u as fe, aC as Qe, aa as pr, a5 as Mt, aD as At, aE as Ot, aF as It, aG as vr, aH as je, aI as mr, ao as gr, ap as yr, ac as Lt, au as br, aJ as Er, aK as Ue, aL as Tr, aM as pe, aN as Bt, aO as kt, P as Nt, ar as wr, a2 as Cr, t as Rr, aP as xr, aQ as Pr, aR as Sr, aS as _r, aT as Xe, aU as Dr, _ as we, aV as Mr, aW as Ar, aq as Or, aX as Ir, aY as Lr, $ as Je, aZ as Br, a_ as kr, a$ as Nr, b0 as Ve, b1 as $r, b2 as jr, b3 as Ur, b4 as zr, b5 as Ce, b6 as qr, ae as Fr, b7 as Ze } from "./main-B25iFKAC.js";
|
|
4
|
+
import { S as $t, f as Qr, b as ze, D as ce, a as ye, d as Yr, e as Hr, g as et, h as tt, i as Wr, j as Kr, k as Gr, l as rt } from "./SideDrawer-A_1ECqD2.js";
|
|
5
|
+
import { h as Xr, P as Jr, a as Vr, c as Zr, D as en, d as tn, e as nt, f as ot } from "./handleCopyClick-BX1fcFGN.js";
|
|
6
|
+
var ue = {}, be = { exports: {} }, Ee = { exports: {} }, N = {};
|
|
7
|
+
var at;
|
|
8
|
+
function rn() {
|
|
9
|
+
if (at) return N;
|
|
10
|
+
at = 1;
|
|
11
|
+
var n = typeof Symbol == "function" && Symbol.for, d = n ? /* @__PURE__ */ Symbol.for("react.element") : 60103, a = n ? /* @__PURE__ */ Symbol.for("react.portal") : 60106, c = n ? /* @__PURE__ */ Symbol.for("react.fragment") : 60107, f = n ? /* @__PURE__ */ Symbol.for("react.strict_mode") : 60108, t = n ? /* @__PURE__ */ Symbol.for("react.profiler") : 60114, l = n ? /* @__PURE__ */ Symbol.for("react.provider") : 60109, r = n ? /* @__PURE__ */ Symbol.for("react.context") : 60110, o = n ? /* @__PURE__ */ Symbol.for("react.async_mode") : 60111, e = n ? /* @__PURE__ */ Symbol.for("react.concurrent_mode") : 60111, s = n ? /* @__PURE__ */ Symbol.for("react.forward_ref") : 60112, i = n ? /* @__PURE__ */ Symbol.for("react.suspense") : 60113, u = n ? /* @__PURE__ */ Symbol.for("react.suspense_list") : 60120, y = n ? /* @__PURE__ */ Symbol.for("react.memo") : 60115, v = n ? /* @__PURE__ */ Symbol.for("react.lazy") : 60116, m = n ? /* @__PURE__ */ Symbol.for("react.block") : 60121, p = n ? /* @__PURE__ */ Symbol.for("react.fundamental") : 60117, C = n ? /* @__PURE__ */ Symbol.for("react.responder") : 60118, O = n ? /* @__PURE__ */ Symbol.for("react.scope") : 60119;
|
|
12
|
+
function A(g) {
|
|
13
|
+
if (typeof g == "object" && g !== null) {
|
|
14
|
+
var Q = g.$$typeof;
|
|
15
|
+
switch (Q) {
|
|
16
|
+
case d:
|
|
17
|
+
switch (g = g.type, g) {
|
|
18
|
+
case o:
|
|
19
|
+
case e:
|
|
20
|
+
case c:
|
|
21
|
+
case t:
|
|
22
|
+
case f:
|
|
23
|
+
case i:
|
|
24
|
+
return g;
|
|
25
|
+
default:
|
|
26
|
+
switch (g = g && g.$$typeof, g) {
|
|
27
|
+
case r:
|
|
28
|
+
case s:
|
|
29
|
+
case v:
|
|
30
|
+
case y:
|
|
31
|
+
case l:
|
|
32
|
+
return g;
|
|
33
|
+
default:
|
|
34
|
+
return Q;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
case a:
|
|
38
|
+
return Q;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function k(g) {
|
|
43
|
+
return A(g) === e;
|
|
44
|
+
}
|
|
45
|
+
return N.AsyncMode = o, N.ConcurrentMode = e, N.ContextConsumer = r, N.ContextProvider = l, N.Element = d, N.ForwardRef = s, N.Fragment = c, N.Lazy = v, N.Memo = y, N.Portal = a, N.Profiler = t, N.StrictMode = f, N.Suspense = i, N.isAsyncMode = function(g) {
|
|
46
|
+
return k(g) || A(g) === o;
|
|
47
|
+
}, N.isConcurrentMode = k, N.isContextConsumer = function(g) {
|
|
48
|
+
return A(g) === r;
|
|
49
|
+
}, N.isContextProvider = function(g) {
|
|
50
|
+
return A(g) === l;
|
|
51
|
+
}, N.isElement = function(g) {
|
|
52
|
+
return typeof g == "object" && g !== null && g.$$typeof === d;
|
|
53
|
+
}, N.isForwardRef = function(g) {
|
|
54
|
+
return A(g) === s;
|
|
55
|
+
}, N.isFragment = function(g) {
|
|
56
|
+
return A(g) === c;
|
|
57
|
+
}, N.isLazy = function(g) {
|
|
58
|
+
return A(g) === v;
|
|
59
|
+
}, N.isMemo = function(g) {
|
|
60
|
+
return A(g) === y;
|
|
61
|
+
}, N.isPortal = function(g) {
|
|
62
|
+
return A(g) === a;
|
|
63
|
+
}, N.isProfiler = function(g) {
|
|
64
|
+
return A(g) === t;
|
|
65
|
+
}, N.isStrictMode = function(g) {
|
|
66
|
+
return A(g) === f;
|
|
67
|
+
}, N.isSuspense = function(g) {
|
|
68
|
+
return A(g) === i;
|
|
69
|
+
}, N.isValidElementType = function(g) {
|
|
70
|
+
return typeof g == "string" || typeof g == "function" || g === c || g === e || g === t || g === f || g === i || g === u || typeof g == "object" && g !== null && (g.$$typeof === v || g.$$typeof === y || g.$$typeof === l || g.$$typeof === r || g.$$typeof === s || g.$$typeof === p || g.$$typeof === C || g.$$typeof === O || g.$$typeof === m);
|
|
71
|
+
}, N.typeOf = A, N;
|
|
72
|
+
}
|
|
73
|
+
var $ = {};
|
|
74
|
+
var it;
|
|
75
|
+
function nn() {
|
|
76
|
+
return it || (it = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
77
|
+
var n = typeof Symbol == "function" && Symbol.for, d = n ? /* @__PURE__ */ Symbol.for("react.element") : 60103, a = n ? /* @__PURE__ */ Symbol.for("react.portal") : 60106, c = n ? /* @__PURE__ */ Symbol.for("react.fragment") : 60107, f = n ? /* @__PURE__ */ Symbol.for("react.strict_mode") : 60108, t = n ? /* @__PURE__ */ Symbol.for("react.profiler") : 60114, l = n ? /* @__PURE__ */ Symbol.for("react.provider") : 60109, r = n ? /* @__PURE__ */ Symbol.for("react.context") : 60110, o = n ? /* @__PURE__ */ Symbol.for("react.async_mode") : 60111, e = n ? /* @__PURE__ */ Symbol.for("react.concurrent_mode") : 60111, s = n ? /* @__PURE__ */ Symbol.for("react.forward_ref") : 60112, i = n ? /* @__PURE__ */ Symbol.for("react.suspense") : 60113, u = n ? /* @__PURE__ */ Symbol.for("react.suspense_list") : 60120, y = n ? /* @__PURE__ */ Symbol.for("react.memo") : 60115, v = n ? /* @__PURE__ */ Symbol.for("react.lazy") : 60116, m = n ? /* @__PURE__ */ Symbol.for("react.block") : 60121, p = n ? /* @__PURE__ */ Symbol.for("react.fundamental") : 60117, C = n ? /* @__PURE__ */ Symbol.for("react.responder") : 60118, O = n ? /* @__PURE__ */ Symbol.for("react.scope") : 60119;
|
|
78
|
+
function A(b) {
|
|
79
|
+
return typeof b == "string" || typeof b == "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
80
|
+
b === c || b === e || b === t || b === f || b === i || b === u || typeof b == "object" && b !== null && (b.$$typeof === v || b.$$typeof === y || b.$$typeof === l || b.$$typeof === r || b.$$typeof === s || b.$$typeof === p || b.$$typeof === C || b.$$typeof === O || b.$$typeof === m);
|
|
81
|
+
}
|
|
82
|
+
function k(b) {
|
|
83
|
+
if (typeof b == "object" && b !== null) {
|
|
84
|
+
var X = b.$$typeof;
|
|
85
|
+
switch (X) {
|
|
86
|
+
case d:
|
|
87
|
+
var ie = b.type;
|
|
88
|
+
switch (ie) {
|
|
89
|
+
case o:
|
|
90
|
+
case e:
|
|
91
|
+
case c:
|
|
92
|
+
case t:
|
|
93
|
+
case f:
|
|
94
|
+
case i:
|
|
95
|
+
return ie;
|
|
96
|
+
default:
|
|
97
|
+
var me = ie && ie.$$typeof;
|
|
98
|
+
switch (me) {
|
|
99
|
+
case r:
|
|
100
|
+
case s:
|
|
101
|
+
case v:
|
|
102
|
+
case y:
|
|
103
|
+
case l:
|
|
104
|
+
return me;
|
|
105
|
+
default:
|
|
106
|
+
return X;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
case a:
|
|
110
|
+
return X;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
var g = o, Q = e, K = r, q = l, re = d, ne = s, F = c, R = v, J = y, G = a, te = t, Y = f, V = i, oe = !1;
|
|
115
|
+
function de(b) {
|
|
116
|
+
return oe || (oe = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), h(b) || k(b) === o;
|
|
117
|
+
}
|
|
118
|
+
function h(b) {
|
|
119
|
+
return k(b) === e;
|
|
120
|
+
}
|
|
121
|
+
function w(b) {
|
|
122
|
+
return k(b) === r;
|
|
123
|
+
}
|
|
124
|
+
function S(b) {
|
|
125
|
+
return k(b) === l;
|
|
126
|
+
}
|
|
127
|
+
function D(b) {
|
|
128
|
+
return typeof b == "object" && b !== null && b.$$typeof === d;
|
|
129
|
+
}
|
|
130
|
+
function x(b) {
|
|
131
|
+
return k(b) === s;
|
|
132
|
+
}
|
|
133
|
+
function I(b) {
|
|
134
|
+
return k(b) === c;
|
|
135
|
+
}
|
|
136
|
+
function _(b) {
|
|
137
|
+
return k(b) === v;
|
|
138
|
+
}
|
|
139
|
+
function P(b) {
|
|
140
|
+
return k(b) === y;
|
|
141
|
+
}
|
|
142
|
+
function M(b) {
|
|
143
|
+
return k(b) === a;
|
|
144
|
+
}
|
|
145
|
+
function B(b) {
|
|
146
|
+
return k(b) === t;
|
|
147
|
+
}
|
|
148
|
+
function L(b) {
|
|
149
|
+
return k(b) === f;
|
|
150
|
+
}
|
|
151
|
+
function z(b) {
|
|
152
|
+
return k(b) === i;
|
|
153
|
+
}
|
|
154
|
+
$.AsyncMode = g, $.ConcurrentMode = Q, $.ContextConsumer = K, $.ContextProvider = q, $.Element = re, $.ForwardRef = ne, $.Fragment = F, $.Lazy = R, $.Memo = J, $.Portal = G, $.Profiler = te, $.StrictMode = Y, $.Suspense = V, $.isAsyncMode = de, $.isConcurrentMode = h, $.isContextConsumer = w, $.isContextProvider = S, $.isElement = D, $.isForwardRef = x, $.isFragment = I, $.isLazy = _, $.isMemo = P, $.isPortal = M, $.isProfiler = B, $.isStrictMode = L, $.isSuspense = z, $.isValidElementType = A, $.typeOf = k;
|
|
155
|
+
})()), $;
|
|
156
|
+
}
|
|
157
|
+
var st;
|
|
158
|
+
function jt() {
|
|
159
|
+
return st || (st = 1, process.env.NODE_ENV === "production" ? Ee.exports = rn() : Ee.exports = nn()), Ee.exports;
|
|
160
|
+
}
|
|
161
|
+
var Re, lt;
|
|
162
|
+
function on() {
|
|
163
|
+
if (lt) return Re;
|
|
164
|
+
lt = 1;
|
|
165
|
+
var n = Object.getOwnPropertySymbols, d = Object.prototype.hasOwnProperty, a = Object.prototype.propertyIsEnumerable;
|
|
166
|
+
function c(t) {
|
|
167
|
+
if (t == null)
|
|
168
|
+
throw new TypeError("Object.assign cannot be called with null or undefined");
|
|
169
|
+
return Object(t);
|
|
170
|
+
}
|
|
171
|
+
function f() {
|
|
172
|
+
try {
|
|
173
|
+
if (!Object.assign)
|
|
174
|
+
return !1;
|
|
175
|
+
var t = new String("abc");
|
|
176
|
+
if (t[5] = "de", Object.getOwnPropertyNames(t)[0] === "5")
|
|
177
|
+
return !1;
|
|
178
|
+
for (var l = {}, r = 0; r < 10; r++)
|
|
179
|
+
l["_" + String.fromCharCode(r)] = r;
|
|
180
|
+
var o = Object.getOwnPropertyNames(l).map(function(s) {
|
|
181
|
+
return l[s];
|
|
182
|
+
});
|
|
183
|
+
if (o.join("") !== "0123456789")
|
|
184
|
+
return !1;
|
|
185
|
+
var e = {};
|
|
186
|
+
return "abcdefghijklmnopqrst".split("").forEach(function(s) {
|
|
187
|
+
e[s] = s;
|
|
188
|
+
}), Object.keys(Object.assign({}, e)).join("") === "abcdefghijklmnopqrst";
|
|
189
|
+
} catch {
|
|
190
|
+
return !1;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
return Re = f() ? Object.assign : function(t, l) {
|
|
194
|
+
for (var r, o = c(t), e, s = 1; s < arguments.length; s++) {
|
|
195
|
+
r = Object(arguments[s]);
|
|
196
|
+
for (var i in r)
|
|
197
|
+
d.call(r, i) && (o[i] = r[i]);
|
|
198
|
+
if (n) {
|
|
199
|
+
e = n(r);
|
|
200
|
+
for (var u = 0; u < e.length; u++)
|
|
201
|
+
a.call(r, e[u]) && (o[e[u]] = r[e[u]]);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
return o;
|
|
205
|
+
}, Re;
|
|
206
|
+
}
|
|
207
|
+
var xe, ct;
|
|
208
|
+
function Ye() {
|
|
209
|
+
if (ct) return xe;
|
|
210
|
+
ct = 1;
|
|
211
|
+
var n = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
|
212
|
+
return xe = n, xe;
|
|
213
|
+
}
|
|
214
|
+
var Pe, ut;
|
|
215
|
+
function Ut() {
|
|
216
|
+
return ut || (ut = 1, Pe = Function.call.bind(Object.prototype.hasOwnProperty)), Pe;
|
|
217
|
+
}
|
|
218
|
+
var Se, ft;
|
|
219
|
+
function an() {
|
|
220
|
+
if (ft) return Se;
|
|
221
|
+
ft = 1;
|
|
222
|
+
var n = function() {
|
|
223
|
+
};
|
|
224
|
+
if (process.env.NODE_ENV !== "production") {
|
|
225
|
+
var d = /* @__PURE__ */ Ye(), a = {}, c = /* @__PURE__ */ Ut();
|
|
226
|
+
n = function(t) {
|
|
227
|
+
var l = "Warning: " + t;
|
|
228
|
+
typeof console < "u" && console.error(l);
|
|
229
|
+
try {
|
|
230
|
+
throw new Error(l);
|
|
231
|
+
} catch {
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
function f(t, l, r, o, e) {
|
|
236
|
+
if (process.env.NODE_ENV !== "production") {
|
|
237
|
+
for (var s in t)
|
|
238
|
+
if (c(t, s)) {
|
|
239
|
+
var i;
|
|
240
|
+
try {
|
|
241
|
+
if (typeof t[s] != "function") {
|
|
242
|
+
var u = Error(
|
|
243
|
+
(o || "React class") + ": " + r + " type `" + s + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof t[s] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
|
|
244
|
+
);
|
|
245
|
+
throw u.name = "Invariant Violation", u;
|
|
246
|
+
}
|
|
247
|
+
i = t[s](l, s, o, r, null, d);
|
|
248
|
+
} catch (v) {
|
|
249
|
+
i = v;
|
|
250
|
+
}
|
|
251
|
+
if (i && !(i instanceof Error) && n(
|
|
252
|
+
(o || "React class") + ": type specification of " + r + " `" + s + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof i + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
|
|
253
|
+
), i instanceof Error && !(i.message in a)) {
|
|
254
|
+
a[i.message] = !0;
|
|
255
|
+
var y = e ? e() : "";
|
|
256
|
+
n(
|
|
257
|
+
"Failed " + r + " type: " + i.message + (y ?? "")
|
|
258
|
+
);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
return f.resetWarningCache = function() {
|
|
264
|
+
process.env.NODE_ENV !== "production" && (a = {});
|
|
265
|
+
}, Se = f, Se;
|
|
266
|
+
}
|
|
267
|
+
var _e, dt;
|
|
268
|
+
function sn() {
|
|
269
|
+
if (dt) return _e;
|
|
270
|
+
dt = 1;
|
|
271
|
+
var n = jt(), d = on(), a = /* @__PURE__ */ Ye(), c = /* @__PURE__ */ Ut(), f = /* @__PURE__ */ an(), t = function() {
|
|
272
|
+
};
|
|
273
|
+
process.env.NODE_ENV !== "production" && (t = function(r) {
|
|
274
|
+
var o = "Warning: " + r;
|
|
275
|
+
typeof console < "u" && console.error(o);
|
|
276
|
+
try {
|
|
277
|
+
throw new Error(o);
|
|
278
|
+
} catch {
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
function l() {
|
|
282
|
+
return null;
|
|
283
|
+
}
|
|
284
|
+
return _e = function(r, o) {
|
|
285
|
+
var e = typeof Symbol == "function" && Symbol.iterator, s = "@@iterator";
|
|
286
|
+
function i(h) {
|
|
287
|
+
var w = h && (e && h[e] || h[s]);
|
|
288
|
+
if (typeof w == "function")
|
|
289
|
+
return w;
|
|
290
|
+
}
|
|
291
|
+
var u = "<<anonymous>>", y = {
|
|
292
|
+
array: C("array"),
|
|
293
|
+
bigint: C("bigint"),
|
|
294
|
+
bool: C("boolean"),
|
|
295
|
+
func: C("function"),
|
|
296
|
+
number: C("number"),
|
|
297
|
+
object: C("object"),
|
|
298
|
+
string: C("string"),
|
|
299
|
+
symbol: C("symbol"),
|
|
300
|
+
any: O(),
|
|
301
|
+
arrayOf: A,
|
|
302
|
+
element: k(),
|
|
303
|
+
elementType: g(),
|
|
304
|
+
instanceOf: Q,
|
|
305
|
+
node: ne(),
|
|
306
|
+
objectOf: q,
|
|
307
|
+
oneOf: K,
|
|
308
|
+
oneOfType: re,
|
|
309
|
+
shape: R,
|
|
310
|
+
exact: J
|
|
311
|
+
};
|
|
312
|
+
function v(h, w) {
|
|
313
|
+
return h === w ? h !== 0 || 1 / h === 1 / w : h !== h && w !== w;
|
|
314
|
+
}
|
|
315
|
+
function m(h, w) {
|
|
316
|
+
this.message = h, this.data = w && typeof w == "object" ? w : {}, this.stack = "";
|
|
317
|
+
}
|
|
318
|
+
m.prototype = Error.prototype;
|
|
319
|
+
function p(h) {
|
|
320
|
+
if (process.env.NODE_ENV !== "production")
|
|
321
|
+
var w = {}, S = 0;
|
|
322
|
+
function D(I, _, P, M, B, L, z) {
|
|
323
|
+
if (M = M || u, L = L || P, z !== a) {
|
|
324
|
+
if (o) {
|
|
325
|
+
var b = new Error(
|
|
326
|
+
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
|
|
327
|
+
);
|
|
328
|
+
throw b.name = "Invariant Violation", b;
|
|
329
|
+
} else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
|
|
330
|
+
var X = M + ":" + P;
|
|
331
|
+
!w[X] && // Avoid spamming the console because they are often not actionable except for lib authors
|
|
332
|
+
S < 3 && (t(
|
|
333
|
+
"You are manually calling a React.PropTypes validation function for the `" + L + "` prop on `" + M + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
|
|
334
|
+
), w[X] = !0, S++);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
return _[P] == null ? I ? _[P] === null ? new m("The " + B + " `" + L + "` is marked as required " + ("in `" + M + "`, but its value is `null`.")) : new m("The " + B + " `" + L + "` is marked as required in " + ("`" + M + "`, but its value is `undefined`.")) : null : h(_, P, M, B, L);
|
|
338
|
+
}
|
|
339
|
+
var x = D.bind(null, !1);
|
|
340
|
+
return x.isRequired = D.bind(null, !0), x;
|
|
341
|
+
}
|
|
342
|
+
function C(h) {
|
|
343
|
+
function w(S, D, x, I, _, P) {
|
|
344
|
+
var M = S[D], B = Y(M);
|
|
345
|
+
if (B !== h) {
|
|
346
|
+
var L = V(M);
|
|
347
|
+
return new m(
|
|
348
|
+
"Invalid " + I + " `" + _ + "` of type " + ("`" + L + "` supplied to `" + x + "`, expected ") + ("`" + h + "`."),
|
|
349
|
+
{ expectedType: h }
|
|
350
|
+
);
|
|
351
|
+
}
|
|
352
|
+
return null;
|
|
353
|
+
}
|
|
354
|
+
return p(w);
|
|
355
|
+
}
|
|
356
|
+
function O() {
|
|
357
|
+
return p(l);
|
|
358
|
+
}
|
|
359
|
+
function A(h) {
|
|
360
|
+
function w(S, D, x, I, _) {
|
|
361
|
+
if (typeof h != "function")
|
|
362
|
+
return new m("Property `" + _ + "` of component `" + x + "` has invalid PropType notation inside arrayOf.");
|
|
363
|
+
var P = S[D];
|
|
364
|
+
if (!Array.isArray(P)) {
|
|
365
|
+
var M = Y(P);
|
|
366
|
+
return new m("Invalid " + I + " `" + _ + "` of type " + ("`" + M + "` supplied to `" + x + "`, expected an array."));
|
|
367
|
+
}
|
|
368
|
+
for (var B = 0; B < P.length; B++) {
|
|
369
|
+
var L = h(P, B, x, I, _ + "[" + B + "]", a);
|
|
370
|
+
if (L instanceof Error)
|
|
371
|
+
return L;
|
|
372
|
+
}
|
|
373
|
+
return null;
|
|
374
|
+
}
|
|
375
|
+
return p(w);
|
|
376
|
+
}
|
|
377
|
+
function k() {
|
|
378
|
+
function h(w, S, D, x, I) {
|
|
379
|
+
var _ = w[S];
|
|
380
|
+
if (!r(_)) {
|
|
381
|
+
var P = Y(_);
|
|
382
|
+
return new m("Invalid " + x + " `" + I + "` of type " + ("`" + P + "` supplied to `" + D + "`, expected a single ReactElement."));
|
|
383
|
+
}
|
|
384
|
+
return null;
|
|
385
|
+
}
|
|
386
|
+
return p(h);
|
|
387
|
+
}
|
|
388
|
+
function g() {
|
|
389
|
+
function h(w, S, D, x, I) {
|
|
390
|
+
var _ = w[S];
|
|
391
|
+
if (!n.isValidElementType(_)) {
|
|
392
|
+
var P = Y(_);
|
|
393
|
+
return new m("Invalid " + x + " `" + I + "` of type " + ("`" + P + "` supplied to `" + D + "`, expected a single ReactElement type."));
|
|
394
|
+
}
|
|
395
|
+
return null;
|
|
396
|
+
}
|
|
397
|
+
return p(h);
|
|
398
|
+
}
|
|
399
|
+
function Q(h) {
|
|
400
|
+
function w(S, D, x, I, _) {
|
|
401
|
+
if (!(S[D] instanceof h)) {
|
|
402
|
+
var P = h.name || u, M = de(S[D]);
|
|
403
|
+
return new m("Invalid " + I + " `" + _ + "` of type " + ("`" + M + "` supplied to `" + x + "`, expected ") + ("instance of `" + P + "`."));
|
|
404
|
+
}
|
|
405
|
+
return null;
|
|
406
|
+
}
|
|
407
|
+
return p(w);
|
|
408
|
+
}
|
|
409
|
+
function K(h) {
|
|
410
|
+
if (!Array.isArray(h))
|
|
411
|
+
return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? t(
|
|
412
|
+
"Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
|
|
413
|
+
) : t("Invalid argument supplied to oneOf, expected an array.")), l;
|
|
414
|
+
function w(S, D, x, I, _) {
|
|
415
|
+
for (var P = S[D], M = 0; M < h.length; M++)
|
|
416
|
+
if (v(P, h[M]))
|
|
417
|
+
return null;
|
|
418
|
+
var B = JSON.stringify(h, function(z, b) {
|
|
419
|
+
var X = V(b);
|
|
420
|
+
return X === "symbol" ? String(b) : b;
|
|
421
|
+
});
|
|
422
|
+
return new m("Invalid " + I + " `" + _ + "` of value `" + String(P) + "` " + ("supplied to `" + x + "`, expected one of " + B + "."));
|
|
423
|
+
}
|
|
424
|
+
return p(w);
|
|
425
|
+
}
|
|
426
|
+
function q(h) {
|
|
427
|
+
function w(S, D, x, I, _) {
|
|
428
|
+
if (typeof h != "function")
|
|
429
|
+
return new m("Property `" + _ + "` of component `" + x + "` has invalid PropType notation inside objectOf.");
|
|
430
|
+
var P = S[D], M = Y(P);
|
|
431
|
+
if (M !== "object")
|
|
432
|
+
return new m("Invalid " + I + " `" + _ + "` of type " + ("`" + M + "` supplied to `" + x + "`, expected an object."));
|
|
433
|
+
for (var B in P)
|
|
434
|
+
if (c(P, B)) {
|
|
435
|
+
var L = h(P, B, x, I, _ + "." + B, a);
|
|
436
|
+
if (L instanceof Error)
|
|
437
|
+
return L;
|
|
438
|
+
}
|
|
439
|
+
return null;
|
|
440
|
+
}
|
|
441
|
+
return p(w);
|
|
442
|
+
}
|
|
443
|
+
function re(h) {
|
|
444
|
+
if (!Array.isArray(h))
|
|
445
|
+
return process.env.NODE_ENV !== "production" && t("Invalid argument supplied to oneOfType, expected an instance of array."), l;
|
|
446
|
+
for (var w = 0; w < h.length; w++) {
|
|
447
|
+
var S = h[w];
|
|
448
|
+
if (typeof S != "function")
|
|
449
|
+
return t(
|
|
450
|
+
"Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + oe(S) + " at index " + w + "."
|
|
451
|
+
), l;
|
|
452
|
+
}
|
|
453
|
+
function D(x, I, _, P, M) {
|
|
454
|
+
for (var B = [], L = 0; L < h.length; L++) {
|
|
455
|
+
var z = h[L], b = z(x, I, _, P, M, a);
|
|
456
|
+
if (b == null)
|
|
457
|
+
return null;
|
|
458
|
+
b.data && c(b.data, "expectedType") && B.push(b.data.expectedType);
|
|
459
|
+
}
|
|
460
|
+
var X = B.length > 0 ? ", expected one of type [" + B.join(", ") + "]" : "";
|
|
461
|
+
return new m("Invalid " + P + " `" + M + "` supplied to " + ("`" + _ + "`" + X + "."));
|
|
462
|
+
}
|
|
463
|
+
return p(D);
|
|
464
|
+
}
|
|
465
|
+
function ne() {
|
|
466
|
+
function h(w, S, D, x, I) {
|
|
467
|
+
return G(w[S]) ? null : new m("Invalid " + x + " `" + I + "` supplied to " + ("`" + D + "`, expected a ReactNode."));
|
|
468
|
+
}
|
|
469
|
+
return p(h);
|
|
470
|
+
}
|
|
471
|
+
function F(h, w, S, D, x) {
|
|
472
|
+
return new m(
|
|
473
|
+
(h || "React class") + ": " + w + " type `" + S + "." + D + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + x + "`."
|
|
474
|
+
);
|
|
475
|
+
}
|
|
476
|
+
function R(h) {
|
|
477
|
+
function w(S, D, x, I, _) {
|
|
478
|
+
var P = S[D], M = Y(P);
|
|
479
|
+
if (M !== "object")
|
|
480
|
+
return new m("Invalid " + I + " `" + _ + "` of type `" + M + "` " + ("supplied to `" + x + "`, expected `object`."));
|
|
481
|
+
for (var B in h) {
|
|
482
|
+
var L = h[B];
|
|
483
|
+
if (typeof L != "function")
|
|
484
|
+
return F(x, I, _, B, V(L));
|
|
485
|
+
var z = L(P, B, x, I, _ + "." + B, a);
|
|
486
|
+
if (z)
|
|
487
|
+
return z;
|
|
488
|
+
}
|
|
489
|
+
return null;
|
|
490
|
+
}
|
|
491
|
+
return p(w);
|
|
492
|
+
}
|
|
493
|
+
function J(h) {
|
|
494
|
+
function w(S, D, x, I, _) {
|
|
495
|
+
var P = S[D], M = Y(P);
|
|
496
|
+
if (M !== "object")
|
|
497
|
+
return new m("Invalid " + I + " `" + _ + "` of type `" + M + "` " + ("supplied to `" + x + "`, expected `object`."));
|
|
498
|
+
var B = d({}, S[D], h);
|
|
499
|
+
for (var L in B) {
|
|
500
|
+
var z = h[L];
|
|
501
|
+
if (c(h, L) && typeof z != "function")
|
|
502
|
+
return F(x, I, _, L, V(z));
|
|
503
|
+
if (!z)
|
|
504
|
+
return new m(
|
|
505
|
+
"Invalid " + I + " `" + _ + "` key `" + L + "` supplied to `" + x + "`.\nBad object: " + JSON.stringify(S[D], null, " ") + `
|
|
506
|
+
Valid keys: ` + JSON.stringify(Object.keys(h), null, " ")
|
|
507
|
+
);
|
|
508
|
+
var b = z(P, L, x, I, _ + "." + L, a);
|
|
509
|
+
if (b)
|
|
510
|
+
return b;
|
|
511
|
+
}
|
|
512
|
+
return null;
|
|
513
|
+
}
|
|
514
|
+
return p(w);
|
|
515
|
+
}
|
|
516
|
+
function G(h) {
|
|
517
|
+
switch (typeof h) {
|
|
518
|
+
case "number":
|
|
519
|
+
case "string":
|
|
520
|
+
case "undefined":
|
|
521
|
+
return !0;
|
|
522
|
+
case "boolean":
|
|
523
|
+
return !h;
|
|
524
|
+
case "object":
|
|
525
|
+
if (Array.isArray(h))
|
|
526
|
+
return h.every(G);
|
|
527
|
+
if (h === null || r(h))
|
|
528
|
+
return !0;
|
|
529
|
+
var w = i(h);
|
|
530
|
+
if (w) {
|
|
531
|
+
var S = w.call(h), D;
|
|
532
|
+
if (w !== h.entries) {
|
|
533
|
+
for (; !(D = S.next()).done; )
|
|
534
|
+
if (!G(D.value))
|
|
535
|
+
return !1;
|
|
536
|
+
} else
|
|
537
|
+
for (; !(D = S.next()).done; ) {
|
|
538
|
+
var x = D.value;
|
|
539
|
+
if (x && !G(x[1]))
|
|
540
|
+
return !1;
|
|
541
|
+
}
|
|
542
|
+
} else
|
|
543
|
+
return !1;
|
|
544
|
+
return !0;
|
|
545
|
+
default:
|
|
546
|
+
return !1;
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
function te(h, w) {
|
|
550
|
+
return h === "symbol" ? !0 : w ? w["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && w instanceof Symbol : !1;
|
|
551
|
+
}
|
|
552
|
+
function Y(h) {
|
|
553
|
+
var w = typeof h;
|
|
554
|
+
return Array.isArray(h) ? "array" : h instanceof RegExp ? "object" : te(w, h) ? "symbol" : w;
|
|
555
|
+
}
|
|
556
|
+
function V(h) {
|
|
557
|
+
if (typeof h > "u" || h === null)
|
|
558
|
+
return "" + h;
|
|
559
|
+
var w = Y(h);
|
|
560
|
+
if (w === "object") {
|
|
561
|
+
if (h instanceof Date)
|
|
562
|
+
return "date";
|
|
563
|
+
if (h instanceof RegExp)
|
|
564
|
+
return "regexp";
|
|
565
|
+
}
|
|
566
|
+
return w;
|
|
567
|
+
}
|
|
568
|
+
function oe(h) {
|
|
569
|
+
var w = V(h);
|
|
570
|
+
switch (w) {
|
|
571
|
+
case "array":
|
|
572
|
+
case "object":
|
|
573
|
+
return "an " + w;
|
|
574
|
+
case "boolean":
|
|
575
|
+
case "date":
|
|
576
|
+
case "regexp":
|
|
577
|
+
return "a " + w;
|
|
578
|
+
default:
|
|
579
|
+
return w;
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
function de(h) {
|
|
583
|
+
return !h.constructor || !h.constructor.name ? u : h.constructor.name;
|
|
584
|
+
}
|
|
585
|
+
return y.checkPropTypes = f, y.resetWarningCache = f.resetWarningCache, y.PropTypes = y, y;
|
|
586
|
+
}, _e;
|
|
587
|
+
}
|
|
588
|
+
var De, ht;
|
|
589
|
+
function ln() {
|
|
590
|
+
if (ht) return De;
|
|
591
|
+
ht = 1;
|
|
592
|
+
var n = /* @__PURE__ */ Ye();
|
|
593
|
+
function d() {
|
|
594
|
+
}
|
|
595
|
+
function a() {
|
|
596
|
+
}
|
|
597
|
+
return a.resetWarningCache = d, De = function() {
|
|
598
|
+
function c(l, r, o, e, s, i) {
|
|
599
|
+
if (i !== n) {
|
|
600
|
+
var u = new Error(
|
|
601
|
+
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
|
|
602
|
+
);
|
|
603
|
+
throw u.name = "Invariant Violation", u;
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
c.isRequired = c;
|
|
607
|
+
function f() {
|
|
608
|
+
return c;
|
|
609
|
+
}
|
|
610
|
+
var t = {
|
|
611
|
+
array: c,
|
|
612
|
+
bigint: c,
|
|
613
|
+
bool: c,
|
|
614
|
+
func: c,
|
|
615
|
+
number: c,
|
|
616
|
+
object: c,
|
|
617
|
+
string: c,
|
|
618
|
+
symbol: c,
|
|
619
|
+
any: c,
|
|
620
|
+
arrayOf: f,
|
|
621
|
+
element: c,
|
|
622
|
+
elementType: c,
|
|
623
|
+
instanceOf: f,
|
|
624
|
+
node: c,
|
|
625
|
+
objectOf: f,
|
|
626
|
+
oneOf: f,
|
|
627
|
+
oneOfType: f,
|
|
628
|
+
shape: f,
|
|
629
|
+
exact: f,
|
|
630
|
+
checkPropTypes: a,
|
|
631
|
+
resetWarningCache: d
|
|
632
|
+
};
|
|
633
|
+
return t.PropTypes = t, t;
|
|
634
|
+
}, De;
|
|
635
|
+
}
|
|
636
|
+
var pt;
|
|
637
|
+
function zt() {
|
|
638
|
+
if (pt) return be.exports;
|
|
639
|
+
if (pt = 1, process.env.NODE_ENV !== "production") {
|
|
640
|
+
var n = jt(), d = !0;
|
|
641
|
+
be.exports = /* @__PURE__ */ sn()(n.isElement, d);
|
|
642
|
+
} else
|
|
643
|
+
be.exports = /* @__PURE__ */ ln()();
|
|
644
|
+
return be.exports;
|
|
645
|
+
}
|
|
646
|
+
var Me, vt;
|
|
647
|
+
function qt() {
|
|
648
|
+
return vt || (vt = 1, Me = {
|
|
649
|
+
L: 1,
|
|
650
|
+
M: 0,
|
|
651
|
+
Q: 3,
|
|
652
|
+
H: 2
|
|
653
|
+
}), Me;
|
|
654
|
+
}
|
|
655
|
+
var Ae, mt;
|
|
656
|
+
function Ft() {
|
|
657
|
+
return mt || (mt = 1, Ae = {
|
|
658
|
+
MODE_NUMBER: 1,
|
|
659
|
+
MODE_ALPHA_NUM: 2,
|
|
660
|
+
MODE_8BIT_BYTE: 4,
|
|
661
|
+
MODE_KANJI: 8
|
|
662
|
+
}), Ae;
|
|
663
|
+
}
|
|
664
|
+
var Oe, gt;
|
|
665
|
+
function cn() {
|
|
666
|
+
if (gt) return Oe;
|
|
667
|
+
gt = 1;
|
|
668
|
+
var n = Ft();
|
|
669
|
+
function d(a) {
|
|
670
|
+
this.mode = n.MODE_8BIT_BYTE, this.data = a;
|
|
671
|
+
}
|
|
672
|
+
return d.prototype = {
|
|
673
|
+
getLength: function(a) {
|
|
674
|
+
return this.data.length;
|
|
675
|
+
},
|
|
676
|
+
write: function(a) {
|
|
677
|
+
for (var c = 0; c < this.data.length; c++)
|
|
678
|
+
a.put(this.data.charCodeAt(c), 8);
|
|
679
|
+
}
|
|
680
|
+
}, Oe = d, Oe;
|
|
681
|
+
}
|
|
682
|
+
var Ie, yt;
|
|
683
|
+
function un() {
|
|
684
|
+
if (yt) return Ie;
|
|
685
|
+
yt = 1;
|
|
686
|
+
var n = qt();
|
|
687
|
+
function d(a, c) {
|
|
688
|
+
this.totalCount = a, this.dataCount = c;
|
|
689
|
+
}
|
|
690
|
+
return d.RS_BLOCK_TABLE = [
|
|
691
|
+
// L
|
|
692
|
+
// M
|
|
693
|
+
// Q
|
|
694
|
+
// H
|
|
695
|
+
// 1
|
|
696
|
+
[1, 26, 19],
|
|
697
|
+
[1, 26, 16],
|
|
698
|
+
[1, 26, 13],
|
|
699
|
+
[1, 26, 9],
|
|
700
|
+
// 2
|
|
701
|
+
[1, 44, 34],
|
|
702
|
+
[1, 44, 28],
|
|
703
|
+
[1, 44, 22],
|
|
704
|
+
[1, 44, 16],
|
|
705
|
+
// 3
|
|
706
|
+
[1, 70, 55],
|
|
707
|
+
[1, 70, 44],
|
|
708
|
+
[2, 35, 17],
|
|
709
|
+
[2, 35, 13],
|
|
710
|
+
// 4
|
|
711
|
+
[1, 100, 80],
|
|
712
|
+
[2, 50, 32],
|
|
713
|
+
[2, 50, 24],
|
|
714
|
+
[4, 25, 9],
|
|
715
|
+
// 5
|
|
716
|
+
[1, 134, 108],
|
|
717
|
+
[2, 67, 43],
|
|
718
|
+
[2, 33, 15, 2, 34, 16],
|
|
719
|
+
[2, 33, 11, 2, 34, 12],
|
|
720
|
+
// 6
|
|
721
|
+
[2, 86, 68],
|
|
722
|
+
[4, 43, 27],
|
|
723
|
+
[4, 43, 19],
|
|
724
|
+
[4, 43, 15],
|
|
725
|
+
// 7
|
|
726
|
+
[2, 98, 78],
|
|
727
|
+
[4, 49, 31],
|
|
728
|
+
[2, 32, 14, 4, 33, 15],
|
|
729
|
+
[4, 39, 13, 1, 40, 14],
|
|
730
|
+
// 8
|
|
731
|
+
[2, 121, 97],
|
|
732
|
+
[2, 60, 38, 2, 61, 39],
|
|
733
|
+
[4, 40, 18, 2, 41, 19],
|
|
734
|
+
[4, 40, 14, 2, 41, 15],
|
|
735
|
+
// 9
|
|
736
|
+
[2, 146, 116],
|
|
737
|
+
[3, 58, 36, 2, 59, 37],
|
|
738
|
+
[4, 36, 16, 4, 37, 17],
|
|
739
|
+
[4, 36, 12, 4, 37, 13],
|
|
740
|
+
// 10
|
|
741
|
+
[2, 86, 68, 2, 87, 69],
|
|
742
|
+
[4, 69, 43, 1, 70, 44],
|
|
743
|
+
[6, 43, 19, 2, 44, 20],
|
|
744
|
+
[6, 43, 15, 2, 44, 16],
|
|
745
|
+
// 11
|
|
746
|
+
[4, 101, 81],
|
|
747
|
+
[1, 80, 50, 4, 81, 51],
|
|
748
|
+
[4, 50, 22, 4, 51, 23],
|
|
749
|
+
[3, 36, 12, 8, 37, 13],
|
|
750
|
+
// 12
|
|
751
|
+
[2, 116, 92, 2, 117, 93],
|
|
752
|
+
[6, 58, 36, 2, 59, 37],
|
|
753
|
+
[4, 46, 20, 6, 47, 21],
|
|
754
|
+
[7, 42, 14, 4, 43, 15],
|
|
755
|
+
// 13
|
|
756
|
+
[4, 133, 107],
|
|
757
|
+
[8, 59, 37, 1, 60, 38],
|
|
758
|
+
[8, 44, 20, 4, 45, 21],
|
|
759
|
+
[12, 33, 11, 4, 34, 12],
|
|
760
|
+
// 14
|
|
761
|
+
[3, 145, 115, 1, 146, 116],
|
|
762
|
+
[4, 64, 40, 5, 65, 41],
|
|
763
|
+
[11, 36, 16, 5, 37, 17],
|
|
764
|
+
[11, 36, 12, 5, 37, 13],
|
|
765
|
+
// 15
|
|
766
|
+
[5, 109, 87, 1, 110, 88],
|
|
767
|
+
[5, 65, 41, 5, 66, 42],
|
|
768
|
+
[5, 54, 24, 7, 55, 25],
|
|
769
|
+
[11, 36, 12],
|
|
770
|
+
// 16
|
|
771
|
+
[5, 122, 98, 1, 123, 99],
|
|
772
|
+
[7, 73, 45, 3, 74, 46],
|
|
773
|
+
[15, 43, 19, 2, 44, 20],
|
|
774
|
+
[3, 45, 15, 13, 46, 16],
|
|
775
|
+
// 17
|
|
776
|
+
[1, 135, 107, 5, 136, 108],
|
|
777
|
+
[10, 74, 46, 1, 75, 47],
|
|
778
|
+
[1, 50, 22, 15, 51, 23],
|
|
779
|
+
[2, 42, 14, 17, 43, 15],
|
|
780
|
+
// 18
|
|
781
|
+
[5, 150, 120, 1, 151, 121],
|
|
782
|
+
[9, 69, 43, 4, 70, 44],
|
|
783
|
+
[17, 50, 22, 1, 51, 23],
|
|
784
|
+
[2, 42, 14, 19, 43, 15],
|
|
785
|
+
// 19
|
|
786
|
+
[3, 141, 113, 4, 142, 114],
|
|
787
|
+
[3, 70, 44, 11, 71, 45],
|
|
788
|
+
[17, 47, 21, 4, 48, 22],
|
|
789
|
+
[9, 39, 13, 16, 40, 14],
|
|
790
|
+
// 20
|
|
791
|
+
[3, 135, 107, 5, 136, 108],
|
|
792
|
+
[3, 67, 41, 13, 68, 42],
|
|
793
|
+
[15, 54, 24, 5, 55, 25],
|
|
794
|
+
[15, 43, 15, 10, 44, 16],
|
|
795
|
+
// 21
|
|
796
|
+
[4, 144, 116, 4, 145, 117],
|
|
797
|
+
[17, 68, 42],
|
|
798
|
+
[17, 50, 22, 6, 51, 23],
|
|
799
|
+
[19, 46, 16, 6, 47, 17],
|
|
800
|
+
// 22
|
|
801
|
+
[2, 139, 111, 7, 140, 112],
|
|
802
|
+
[17, 74, 46],
|
|
803
|
+
[7, 54, 24, 16, 55, 25],
|
|
804
|
+
[34, 37, 13],
|
|
805
|
+
// 23
|
|
806
|
+
[4, 151, 121, 5, 152, 122],
|
|
807
|
+
[4, 75, 47, 14, 76, 48],
|
|
808
|
+
[11, 54, 24, 14, 55, 25],
|
|
809
|
+
[16, 45, 15, 14, 46, 16],
|
|
810
|
+
// 24
|
|
811
|
+
[6, 147, 117, 4, 148, 118],
|
|
812
|
+
[6, 73, 45, 14, 74, 46],
|
|
813
|
+
[11, 54, 24, 16, 55, 25],
|
|
814
|
+
[30, 46, 16, 2, 47, 17],
|
|
815
|
+
// 25
|
|
816
|
+
[8, 132, 106, 4, 133, 107],
|
|
817
|
+
[8, 75, 47, 13, 76, 48],
|
|
818
|
+
[7, 54, 24, 22, 55, 25],
|
|
819
|
+
[22, 45, 15, 13, 46, 16],
|
|
820
|
+
// 26
|
|
821
|
+
[10, 142, 114, 2, 143, 115],
|
|
822
|
+
[19, 74, 46, 4, 75, 47],
|
|
823
|
+
[28, 50, 22, 6, 51, 23],
|
|
824
|
+
[33, 46, 16, 4, 47, 17],
|
|
825
|
+
// 27
|
|
826
|
+
[8, 152, 122, 4, 153, 123],
|
|
827
|
+
[22, 73, 45, 3, 74, 46],
|
|
828
|
+
[8, 53, 23, 26, 54, 24],
|
|
829
|
+
[12, 45, 15, 28, 46, 16],
|
|
830
|
+
// 28
|
|
831
|
+
[3, 147, 117, 10, 148, 118],
|
|
832
|
+
[3, 73, 45, 23, 74, 46],
|
|
833
|
+
[4, 54, 24, 31, 55, 25],
|
|
834
|
+
[11, 45, 15, 31, 46, 16],
|
|
835
|
+
// 29
|
|
836
|
+
[7, 146, 116, 7, 147, 117],
|
|
837
|
+
[21, 73, 45, 7, 74, 46],
|
|
838
|
+
[1, 53, 23, 37, 54, 24],
|
|
839
|
+
[19, 45, 15, 26, 46, 16],
|
|
840
|
+
// 30
|
|
841
|
+
[5, 145, 115, 10, 146, 116],
|
|
842
|
+
[19, 75, 47, 10, 76, 48],
|
|
843
|
+
[15, 54, 24, 25, 55, 25],
|
|
844
|
+
[23, 45, 15, 25, 46, 16],
|
|
845
|
+
// 31
|
|
846
|
+
[13, 145, 115, 3, 146, 116],
|
|
847
|
+
[2, 74, 46, 29, 75, 47],
|
|
848
|
+
[42, 54, 24, 1, 55, 25],
|
|
849
|
+
[23, 45, 15, 28, 46, 16],
|
|
850
|
+
// 32
|
|
851
|
+
[17, 145, 115],
|
|
852
|
+
[10, 74, 46, 23, 75, 47],
|
|
853
|
+
[10, 54, 24, 35, 55, 25],
|
|
854
|
+
[19, 45, 15, 35, 46, 16],
|
|
855
|
+
// 33
|
|
856
|
+
[17, 145, 115, 1, 146, 116],
|
|
857
|
+
[14, 74, 46, 21, 75, 47],
|
|
858
|
+
[29, 54, 24, 19, 55, 25],
|
|
859
|
+
[11, 45, 15, 46, 46, 16],
|
|
860
|
+
// 34
|
|
861
|
+
[13, 145, 115, 6, 146, 116],
|
|
862
|
+
[14, 74, 46, 23, 75, 47],
|
|
863
|
+
[44, 54, 24, 7, 55, 25],
|
|
864
|
+
[59, 46, 16, 1, 47, 17],
|
|
865
|
+
// 35
|
|
866
|
+
[12, 151, 121, 7, 152, 122],
|
|
867
|
+
[12, 75, 47, 26, 76, 48],
|
|
868
|
+
[39, 54, 24, 14, 55, 25],
|
|
869
|
+
[22, 45, 15, 41, 46, 16],
|
|
870
|
+
// 36
|
|
871
|
+
[6, 151, 121, 14, 152, 122],
|
|
872
|
+
[6, 75, 47, 34, 76, 48],
|
|
873
|
+
[46, 54, 24, 10, 55, 25],
|
|
874
|
+
[2, 45, 15, 64, 46, 16],
|
|
875
|
+
// 37
|
|
876
|
+
[17, 152, 122, 4, 153, 123],
|
|
877
|
+
[29, 74, 46, 14, 75, 47],
|
|
878
|
+
[49, 54, 24, 10, 55, 25],
|
|
879
|
+
[24, 45, 15, 46, 46, 16],
|
|
880
|
+
// 38
|
|
881
|
+
[4, 152, 122, 18, 153, 123],
|
|
882
|
+
[13, 74, 46, 32, 75, 47],
|
|
883
|
+
[48, 54, 24, 14, 55, 25],
|
|
884
|
+
[42, 45, 15, 32, 46, 16],
|
|
885
|
+
// 39
|
|
886
|
+
[20, 147, 117, 4, 148, 118],
|
|
887
|
+
[40, 75, 47, 7, 76, 48],
|
|
888
|
+
[43, 54, 24, 22, 55, 25],
|
|
889
|
+
[10, 45, 15, 67, 46, 16],
|
|
890
|
+
// 40
|
|
891
|
+
[19, 148, 118, 6, 149, 119],
|
|
892
|
+
[18, 75, 47, 31, 76, 48],
|
|
893
|
+
[34, 54, 24, 34, 55, 25],
|
|
894
|
+
[20, 45, 15, 61, 46, 16]
|
|
895
|
+
], d.getRSBlocks = function(a, c) {
|
|
896
|
+
var f = d.getRsBlockTable(a, c);
|
|
897
|
+
if (f == null)
|
|
898
|
+
throw new Error("bad rs block @ typeNumber:" + a + "/errorCorrectLevel:" + c);
|
|
899
|
+
for (var t = f.length / 3, l = new Array(), r = 0; r < t; r++)
|
|
900
|
+
for (var o = f[r * 3 + 0], e = f[r * 3 + 1], s = f[r * 3 + 2], i = 0; i < o; i++)
|
|
901
|
+
l.push(new d(e, s));
|
|
902
|
+
return l;
|
|
903
|
+
}, d.getRsBlockTable = function(a, c) {
|
|
904
|
+
switch (c) {
|
|
905
|
+
case n.L:
|
|
906
|
+
return d.RS_BLOCK_TABLE[(a - 1) * 4 + 0];
|
|
907
|
+
case n.M:
|
|
908
|
+
return d.RS_BLOCK_TABLE[(a - 1) * 4 + 1];
|
|
909
|
+
case n.Q:
|
|
910
|
+
return d.RS_BLOCK_TABLE[(a - 1) * 4 + 2];
|
|
911
|
+
case n.H:
|
|
912
|
+
return d.RS_BLOCK_TABLE[(a - 1) * 4 + 3];
|
|
913
|
+
default:
|
|
914
|
+
return;
|
|
915
|
+
}
|
|
916
|
+
}, Ie = d, Ie;
|
|
917
|
+
}
|
|
918
|
+
var Le, bt;
|
|
919
|
+
function fn() {
|
|
920
|
+
if (bt) return Le;
|
|
921
|
+
bt = 1;
|
|
922
|
+
function n() {
|
|
923
|
+
this.buffer = new Array(), this.length = 0;
|
|
924
|
+
}
|
|
925
|
+
return n.prototype = {
|
|
926
|
+
get: function(d) {
|
|
927
|
+
var a = Math.floor(d / 8);
|
|
928
|
+
return (this.buffer[a] >>> 7 - d % 8 & 1) == 1;
|
|
929
|
+
},
|
|
930
|
+
put: function(d, a) {
|
|
931
|
+
for (var c = 0; c < a; c++)
|
|
932
|
+
this.putBit((d >>> a - c - 1 & 1) == 1);
|
|
933
|
+
},
|
|
934
|
+
getLengthInBits: function() {
|
|
935
|
+
return this.length;
|
|
936
|
+
},
|
|
937
|
+
putBit: function(d) {
|
|
938
|
+
var a = Math.floor(this.length / 8);
|
|
939
|
+
this.buffer.length <= a && this.buffer.push(0), d && (this.buffer[a] |= 128 >>> this.length % 8), this.length++;
|
|
940
|
+
}
|
|
941
|
+
}, Le = n, Le;
|
|
942
|
+
}
|
|
943
|
+
var Be, Et;
|
|
944
|
+
function Qt() {
|
|
945
|
+
if (Et) return Be;
|
|
946
|
+
Et = 1;
|
|
947
|
+
for (var n = {
|
|
948
|
+
glog: function(a) {
|
|
949
|
+
if (a < 1)
|
|
950
|
+
throw new Error("glog(" + a + ")");
|
|
951
|
+
return n.LOG_TABLE[a];
|
|
952
|
+
},
|
|
953
|
+
gexp: function(a) {
|
|
954
|
+
for (; a < 0; )
|
|
955
|
+
a += 255;
|
|
956
|
+
for (; a >= 256; )
|
|
957
|
+
a -= 255;
|
|
958
|
+
return n.EXP_TABLE[a];
|
|
959
|
+
},
|
|
960
|
+
EXP_TABLE: new Array(256),
|
|
961
|
+
LOG_TABLE: new Array(256)
|
|
962
|
+
}, d = 0; d < 8; d++)
|
|
963
|
+
n.EXP_TABLE[d] = 1 << d;
|
|
964
|
+
for (var d = 8; d < 256; d++)
|
|
965
|
+
n.EXP_TABLE[d] = n.EXP_TABLE[d - 4] ^ n.EXP_TABLE[d - 5] ^ n.EXP_TABLE[d - 6] ^ n.EXP_TABLE[d - 8];
|
|
966
|
+
for (var d = 0; d < 255; d++)
|
|
967
|
+
n.LOG_TABLE[n.EXP_TABLE[d]] = d;
|
|
968
|
+
return Be = n, Be;
|
|
969
|
+
}
|
|
970
|
+
var ke, Tt;
|
|
971
|
+
function Yt() {
|
|
972
|
+
if (Tt) return ke;
|
|
973
|
+
Tt = 1;
|
|
974
|
+
var n = Qt();
|
|
975
|
+
function d(a, c) {
|
|
976
|
+
if (a.length == null)
|
|
977
|
+
throw new Error(a.length + "/" + c);
|
|
978
|
+
for (var f = 0; f < a.length && a[f] == 0; )
|
|
979
|
+
f++;
|
|
980
|
+
this.num = new Array(a.length - f + c);
|
|
981
|
+
for (var t = 0; t < a.length - f; t++)
|
|
982
|
+
this.num[t] = a[t + f];
|
|
983
|
+
}
|
|
984
|
+
return d.prototype = {
|
|
985
|
+
get: function(a) {
|
|
986
|
+
return this.num[a];
|
|
987
|
+
},
|
|
988
|
+
getLength: function() {
|
|
989
|
+
return this.num.length;
|
|
990
|
+
},
|
|
991
|
+
multiply: function(a) {
|
|
992
|
+
for (var c = new Array(this.getLength() + a.getLength() - 1), f = 0; f < this.getLength(); f++)
|
|
993
|
+
for (var t = 0; t < a.getLength(); t++)
|
|
994
|
+
c[f + t] ^= n.gexp(n.glog(this.get(f)) + n.glog(a.get(t)));
|
|
995
|
+
return new d(c, 0);
|
|
996
|
+
},
|
|
997
|
+
mod: function(a) {
|
|
998
|
+
if (this.getLength() - a.getLength() < 0)
|
|
999
|
+
return this;
|
|
1000
|
+
for (var c = n.glog(this.get(0)) - n.glog(a.get(0)), f = new Array(this.getLength()), t = 0; t < this.getLength(); t++)
|
|
1001
|
+
f[t] = this.get(t);
|
|
1002
|
+
for (var t = 0; t < a.getLength(); t++)
|
|
1003
|
+
f[t] ^= n.gexp(n.glog(a.get(t)) + c);
|
|
1004
|
+
return new d(f, 0).mod(a);
|
|
1005
|
+
}
|
|
1006
|
+
}, ke = d, ke;
|
|
1007
|
+
}
|
|
1008
|
+
var Ne, wt;
|
|
1009
|
+
function dn() {
|
|
1010
|
+
if (wt) return Ne;
|
|
1011
|
+
wt = 1;
|
|
1012
|
+
var n = Ft(), d = Yt(), a = Qt(), c = {
|
|
1013
|
+
PATTERN000: 0,
|
|
1014
|
+
PATTERN001: 1,
|
|
1015
|
+
PATTERN010: 2,
|
|
1016
|
+
PATTERN011: 3,
|
|
1017
|
+
PATTERN100: 4,
|
|
1018
|
+
PATTERN101: 5,
|
|
1019
|
+
PATTERN110: 6,
|
|
1020
|
+
PATTERN111: 7
|
|
1021
|
+
}, f = {
|
|
1022
|
+
PATTERN_POSITION_TABLE: [
|
|
1023
|
+
[],
|
|
1024
|
+
[6, 18],
|
|
1025
|
+
[6, 22],
|
|
1026
|
+
[6, 26],
|
|
1027
|
+
[6, 30],
|
|
1028
|
+
[6, 34],
|
|
1029
|
+
[6, 22, 38],
|
|
1030
|
+
[6, 24, 42],
|
|
1031
|
+
[6, 26, 46],
|
|
1032
|
+
[6, 28, 50],
|
|
1033
|
+
[6, 30, 54],
|
|
1034
|
+
[6, 32, 58],
|
|
1035
|
+
[6, 34, 62],
|
|
1036
|
+
[6, 26, 46, 66],
|
|
1037
|
+
[6, 26, 48, 70],
|
|
1038
|
+
[6, 26, 50, 74],
|
|
1039
|
+
[6, 30, 54, 78],
|
|
1040
|
+
[6, 30, 56, 82],
|
|
1041
|
+
[6, 30, 58, 86],
|
|
1042
|
+
[6, 34, 62, 90],
|
|
1043
|
+
[6, 28, 50, 72, 94],
|
|
1044
|
+
[6, 26, 50, 74, 98],
|
|
1045
|
+
[6, 30, 54, 78, 102],
|
|
1046
|
+
[6, 28, 54, 80, 106],
|
|
1047
|
+
[6, 32, 58, 84, 110],
|
|
1048
|
+
[6, 30, 58, 86, 114],
|
|
1049
|
+
[6, 34, 62, 90, 118],
|
|
1050
|
+
[6, 26, 50, 74, 98, 122],
|
|
1051
|
+
[6, 30, 54, 78, 102, 126],
|
|
1052
|
+
[6, 26, 52, 78, 104, 130],
|
|
1053
|
+
[6, 30, 56, 82, 108, 134],
|
|
1054
|
+
[6, 34, 60, 86, 112, 138],
|
|
1055
|
+
[6, 30, 58, 86, 114, 142],
|
|
1056
|
+
[6, 34, 62, 90, 118, 146],
|
|
1057
|
+
[6, 30, 54, 78, 102, 126, 150],
|
|
1058
|
+
[6, 24, 50, 76, 102, 128, 154],
|
|
1059
|
+
[6, 28, 54, 80, 106, 132, 158],
|
|
1060
|
+
[6, 32, 58, 84, 110, 136, 162],
|
|
1061
|
+
[6, 26, 54, 82, 110, 138, 166],
|
|
1062
|
+
[6, 30, 58, 86, 114, 142, 170]
|
|
1063
|
+
],
|
|
1064
|
+
G15: 1335,
|
|
1065
|
+
G18: 7973,
|
|
1066
|
+
G15_MASK: 21522,
|
|
1067
|
+
getBCHTypeInfo: function(t) {
|
|
1068
|
+
for (var l = t << 10; f.getBCHDigit(l) - f.getBCHDigit(f.G15) >= 0; )
|
|
1069
|
+
l ^= f.G15 << f.getBCHDigit(l) - f.getBCHDigit(f.G15);
|
|
1070
|
+
return (t << 10 | l) ^ f.G15_MASK;
|
|
1071
|
+
},
|
|
1072
|
+
getBCHTypeNumber: function(t) {
|
|
1073
|
+
for (var l = t << 12; f.getBCHDigit(l) - f.getBCHDigit(f.G18) >= 0; )
|
|
1074
|
+
l ^= f.G18 << f.getBCHDigit(l) - f.getBCHDigit(f.G18);
|
|
1075
|
+
return t << 12 | l;
|
|
1076
|
+
},
|
|
1077
|
+
getBCHDigit: function(t) {
|
|
1078
|
+
for (var l = 0; t != 0; )
|
|
1079
|
+
l++, t >>>= 1;
|
|
1080
|
+
return l;
|
|
1081
|
+
},
|
|
1082
|
+
getPatternPosition: function(t) {
|
|
1083
|
+
return f.PATTERN_POSITION_TABLE[t - 1];
|
|
1084
|
+
},
|
|
1085
|
+
getMask: function(t, l, r) {
|
|
1086
|
+
switch (t) {
|
|
1087
|
+
case c.PATTERN000:
|
|
1088
|
+
return (l + r) % 2 == 0;
|
|
1089
|
+
case c.PATTERN001:
|
|
1090
|
+
return l % 2 == 0;
|
|
1091
|
+
case c.PATTERN010:
|
|
1092
|
+
return r % 3 == 0;
|
|
1093
|
+
case c.PATTERN011:
|
|
1094
|
+
return (l + r) % 3 == 0;
|
|
1095
|
+
case c.PATTERN100:
|
|
1096
|
+
return (Math.floor(l / 2) + Math.floor(r / 3)) % 2 == 0;
|
|
1097
|
+
case c.PATTERN101:
|
|
1098
|
+
return l * r % 2 + l * r % 3 == 0;
|
|
1099
|
+
case c.PATTERN110:
|
|
1100
|
+
return (l * r % 2 + l * r % 3) % 2 == 0;
|
|
1101
|
+
case c.PATTERN111:
|
|
1102
|
+
return (l * r % 3 + (l + r) % 2) % 2 == 0;
|
|
1103
|
+
default:
|
|
1104
|
+
throw new Error("bad maskPattern:" + t);
|
|
1105
|
+
}
|
|
1106
|
+
},
|
|
1107
|
+
getErrorCorrectPolynomial: function(t) {
|
|
1108
|
+
for (var l = new d([1], 0), r = 0; r < t; r++)
|
|
1109
|
+
l = l.multiply(new d([1, a.gexp(r)], 0));
|
|
1110
|
+
return l;
|
|
1111
|
+
},
|
|
1112
|
+
getLengthInBits: function(t, l) {
|
|
1113
|
+
if (1 <= l && l < 10)
|
|
1114
|
+
switch (t) {
|
|
1115
|
+
case n.MODE_NUMBER:
|
|
1116
|
+
return 10;
|
|
1117
|
+
case n.MODE_ALPHA_NUM:
|
|
1118
|
+
return 9;
|
|
1119
|
+
case n.MODE_8BIT_BYTE:
|
|
1120
|
+
return 8;
|
|
1121
|
+
case n.MODE_KANJI:
|
|
1122
|
+
return 8;
|
|
1123
|
+
default:
|
|
1124
|
+
throw new Error("mode:" + t);
|
|
1125
|
+
}
|
|
1126
|
+
else if (l < 27)
|
|
1127
|
+
switch (t) {
|
|
1128
|
+
case n.MODE_NUMBER:
|
|
1129
|
+
return 12;
|
|
1130
|
+
case n.MODE_ALPHA_NUM:
|
|
1131
|
+
return 11;
|
|
1132
|
+
case n.MODE_8BIT_BYTE:
|
|
1133
|
+
return 16;
|
|
1134
|
+
case n.MODE_KANJI:
|
|
1135
|
+
return 10;
|
|
1136
|
+
default:
|
|
1137
|
+
throw new Error("mode:" + t);
|
|
1138
|
+
}
|
|
1139
|
+
else if (l < 41)
|
|
1140
|
+
switch (t) {
|
|
1141
|
+
case n.MODE_NUMBER:
|
|
1142
|
+
return 14;
|
|
1143
|
+
case n.MODE_ALPHA_NUM:
|
|
1144
|
+
return 13;
|
|
1145
|
+
case n.MODE_8BIT_BYTE:
|
|
1146
|
+
return 16;
|
|
1147
|
+
case n.MODE_KANJI:
|
|
1148
|
+
return 12;
|
|
1149
|
+
default:
|
|
1150
|
+
throw new Error("mode:" + t);
|
|
1151
|
+
}
|
|
1152
|
+
else
|
|
1153
|
+
throw new Error("type:" + l);
|
|
1154
|
+
},
|
|
1155
|
+
getLostPoint: function(t) {
|
|
1156
|
+
for (var l = t.getModuleCount(), r = 0, o = 0; o < l; o++)
|
|
1157
|
+
for (var e = 0; e < l; e++) {
|
|
1158
|
+
for (var s = 0, i = t.isDark(o, e), u = -1; u <= 1; u++)
|
|
1159
|
+
if (!(o + u < 0 || l <= o + u))
|
|
1160
|
+
for (var y = -1; y <= 1; y++)
|
|
1161
|
+
e + y < 0 || l <= e + y || u == 0 && y == 0 || i == t.isDark(o + u, e + y) && s++;
|
|
1162
|
+
s > 5 && (r += 3 + s - 5);
|
|
1163
|
+
}
|
|
1164
|
+
for (var o = 0; o < l - 1; o++)
|
|
1165
|
+
for (var e = 0; e < l - 1; e++) {
|
|
1166
|
+
var v = 0;
|
|
1167
|
+
t.isDark(o, e) && v++, t.isDark(o + 1, e) && v++, t.isDark(o, e + 1) && v++, t.isDark(o + 1, e + 1) && v++, (v == 0 || v == 4) && (r += 3);
|
|
1168
|
+
}
|
|
1169
|
+
for (var o = 0; o < l; o++)
|
|
1170
|
+
for (var e = 0; e < l - 6; e++)
|
|
1171
|
+
t.isDark(o, e) && !t.isDark(o, e + 1) && t.isDark(o, e + 2) && t.isDark(o, e + 3) && t.isDark(o, e + 4) && !t.isDark(o, e + 5) && t.isDark(o, e + 6) && (r += 40);
|
|
1172
|
+
for (var e = 0; e < l; e++)
|
|
1173
|
+
for (var o = 0; o < l - 6; o++)
|
|
1174
|
+
t.isDark(o, e) && !t.isDark(o + 1, e) && t.isDark(o + 2, e) && t.isDark(o + 3, e) && t.isDark(o + 4, e) && !t.isDark(o + 5, e) && t.isDark(o + 6, e) && (r += 40);
|
|
1175
|
+
for (var m = 0, e = 0; e < l; e++)
|
|
1176
|
+
for (var o = 0; o < l; o++)
|
|
1177
|
+
t.isDark(o, e) && m++;
|
|
1178
|
+
var p = Math.abs(100 * m / l / l - 50) / 5;
|
|
1179
|
+
return r += p * 10, r;
|
|
1180
|
+
}
|
|
1181
|
+
};
|
|
1182
|
+
return Ne = f, Ne;
|
|
1183
|
+
}
|
|
1184
|
+
var $e, Ct;
|
|
1185
|
+
function hn() {
|
|
1186
|
+
if (Ct) return $e;
|
|
1187
|
+
Ct = 1;
|
|
1188
|
+
var n = cn(), d = un(), a = fn(), c = dn(), f = Yt();
|
|
1189
|
+
function t(r, o) {
|
|
1190
|
+
this.typeNumber = r, this.errorCorrectLevel = o, this.modules = null, this.moduleCount = 0, this.dataCache = null, this.dataList = [];
|
|
1191
|
+
}
|
|
1192
|
+
var l = t.prototype;
|
|
1193
|
+
return l.addData = function(r) {
|
|
1194
|
+
var o = new n(r);
|
|
1195
|
+
this.dataList.push(o), this.dataCache = null;
|
|
1196
|
+
}, l.isDark = function(r, o) {
|
|
1197
|
+
if (r < 0 || this.moduleCount <= r || o < 0 || this.moduleCount <= o)
|
|
1198
|
+
throw new Error(r + "," + o);
|
|
1199
|
+
return this.modules[r][o];
|
|
1200
|
+
}, l.getModuleCount = function() {
|
|
1201
|
+
return this.moduleCount;
|
|
1202
|
+
}, l.make = function() {
|
|
1203
|
+
if (this.typeNumber < 1) {
|
|
1204
|
+
var r = 1;
|
|
1205
|
+
for (r = 1; r < 40; r++) {
|
|
1206
|
+
for (var o = d.getRSBlocks(r, this.errorCorrectLevel), e = new a(), s = 0, i = 0; i < o.length; i++)
|
|
1207
|
+
s += o[i].dataCount;
|
|
1208
|
+
for (var i = 0; i < this.dataList.length; i++) {
|
|
1209
|
+
var u = this.dataList[i];
|
|
1210
|
+
e.put(u.mode, 4), e.put(u.getLength(), c.getLengthInBits(u.mode, r)), u.write(e);
|
|
1211
|
+
}
|
|
1212
|
+
if (e.getLengthInBits() <= s * 8)
|
|
1213
|
+
break;
|
|
1214
|
+
}
|
|
1215
|
+
this.typeNumber = r;
|
|
1216
|
+
}
|
|
1217
|
+
this.makeImpl(!1, this.getBestMaskPattern());
|
|
1218
|
+
}, l.makeImpl = function(r, o) {
|
|
1219
|
+
this.moduleCount = this.typeNumber * 4 + 17, this.modules = new Array(this.moduleCount);
|
|
1220
|
+
for (var e = 0; e < this.moduleCount; e++) {
|
|
1221
|
+
this.modules[e] = new Array(this.moduleCount);
|
|
1222
|
+
for (var s = 0; s < this.moduleCount; s++)
|
|
1223
|
+
this.modules[e][s] = null;
|
|
1224
|
+
}
|
|
1225
|
+
this.setupPositionProbePattern(0, 0), this.setupPositionProbePattern(this.moduleCount - 7, 0), this.setupPositionProbePattern(0, this.moduleCount - 7), this.setupPositionAdjustPattern(), this.setupTimingPattern(), this.setupTypeInfo(r, o), this.typeNumber >= 7 && this.setupTypeNumber(r), this.dataCache == null && (this.dataCache = t.createData(this.typeNumber, this.errorCorrectLevel, this.dataList)), this.mapData(this.dataCache, o);
|
|
1226
|
+
}, l.setupPositionProbePattern = function(r, o) {
|
|
1227
|
+
for (var e = -1; e <= 7; e++)
|
|
1228
|
+
if (!(r + e <= -1 || this.moduleCount <= r + e))
|
|
1229
|
+
for (var s = -1; s <= 7; s++)
|
|
1230
|
+
o + s <= -1 || this.moduleCount <= o + s || (0 <= e && e <= 6 && (s == 0 || s == 6) || 0 <= s && s <= 6 && (e == 0 || e == 6) || 2 <= e && e <= 4 && 2 <= s && s <= 4 ? this.modules[r + e][o + s] = !0 : this.modules[r + e][o + s] = !1);
|
|
1231
|
+
}, l.getBestMaskPattern = function() {
|
|
1232
|
+
for (var r = 0, o = 0, e = 0; e < 8; e++) {
|
|
1233
|
+
this.makeImpl(!0, e);
|
|
1234
|
+
var s = c.getLostPoint(this);
|
|
1235
|
+
(e == 0 || r > s) && (r = s, o = e);
|
|
1236
|
+
}
|
|
1237
|
+
return o;
|
|
1238
|
+
}, l.createMovieClip = function(r, o, e) {
|
|
1239
|
+
var s = r.createEmptyMovieClip(o, e), i = 1;
|
|
1240
|
+
this.make();
|
|
1241
|
+
for (var u = 0; u < this.modules.length; u++)
|
|
1242
|
+
for (var y = u * i, v = 0; v < this.modules[u].length; v++) {
|
|
1243
|
+
var m = v * i, p = this.modules[u][v];
|
|
1244
|
+
p && (s.beginFill(0, 100), s.moveTo(m, y), s.lineTo(m + i, y), s.lineTo(m + i, y + i), s.lineTo(m, y + i), s.endFill());
|
|
1245
|
+
}
|
|
1246
|
+
return s;
|
|
1247
|
+
}, l.setupTimingPattern = function() {
|
|
1248
|
+
for (var r = 8; r < this.moduleCount - 8; r++)
|
|
1249
|
+
this.modules[r][6] == null && (this.modules[r][6] = r % 2 == 0);
|
|
1250
|
+
for (var o = 8; o < this.moduleCount - 8; o++)
|
|
1251
|
+
this.modules[6][o] == null && (this.modules[6][o] = o % 2 == 0);
|
|
1252
|
+
}, l.setupPositionAdjustPattern = function() {
|
|
1253
|
+
for (var r = c.getPatternPosition(this.typeNumber), o = 0; o < r.length; o++)
|
|
1254
|
+
for (var e = 0; e < r.length; e++) {
|
|
1255
|
+
var s = r[o], i = r[e];
|
|
1256
|
+
if (this.modules[s][i] == null)
|
|
1257
|
+
for (var u = -2; u <= 2; u++)
|
|
1258
|
+
for (var y = -2; y <= 2; y++)
|
|
1259
|
+
u == -2 || u == 2 || y == -2 || y == 2 || u == 0 && y == 0 ? this.modules[s + u][i + y] = !0 : this.modules[s + u][i + y] = !1;
|
|
1260
|
+
}
|
|
1261
|
+
}, l.setupTypeNumber = function(r) {
|
|
1262
|
+
for (var o = c.getBCHTypeNumber(this.typeNumber), e = 0; e < 18; e++) {
|
|
1263
|
+
var s = !r && (o >> e & 1) == 1;
|
|
1264
|
+
this.modules[Math.floor(e / 3)][e % 3 + this.moduleCount - 8 - 3] = s;
|
|
1265
|
+
}
|
|
1266
|
+
for (var e = 0; e < 18; e++) {
|
|
1267
|
+
var s = !r && (o >> e & 1) == 1;
|
|
1268
|
+
this.modules[e % 3 + this.moduleCount - 8 - 3][Math.floor(e / 3)] = s;
|
|
1269
|
+
}
|
|
1270
|
+
}, l.setupTypeInfo = function(r, o) {
|
|
1271
|
+
for (var e = this.errorCorrectLevel << 3 | o, s = c.getBCHTypeInfo(e), i = 0; i < 15; i++) {
|
|
1272
|
+
var u = !r && (s >> i & 1) == 1;
|
|
1273
|
+
i < 6 ? this.modules[i][8] = u : i < 8 ? this.modules[i + 1][8] = u : this.modules[this.moduleCount - 15 + i][8] = u;
|
|
1274
|
+
}
|
|
1275
|
+
for (var i = 0; i < 15; i++) {
|
|
1276
|
+
var u = !r && (s >> i & 1) == 1;
|
|
1277
|
+
i < 8 ? this.modules[8][this.moduleCount - i - 1] = u : i < 9 ? this.modules[8][15 - i - 1 + 1] = u : this.modules[8][15 - i - 1] = u;
|
|
1278
|
+
}
|
|
1279
|
+
this.modules[this.moduleCount - 8][8] = !r;
|
|
1280
|
+
}, l.mapData = function(r, o) {
|
|
1281
|
+
for (var e = -1, s = this.moduleCount - 1, i = 7, u = 0, y = this.moduleCount - 1; y > 0; y -= 2)
|
|
1282
|
+
for (y == 6 && y--; ; ) {
|
|
1283
|
+
for (var v = 0; v < 2; v++)
|
|
1284
|
+
if (this.modules[s][y - v] == null) {
|
|
1285
|
+
var m = !1;
|
|
1286
|
+
u < r.length && (m = (r[u] >>> i & 1) == 1);
|
|
1287
|
+
var p = c.getMask(o, s, y - v);
|
|
1288
|
+
p && (m = !m), this.modules[s][y - v] = m, i--, i == -1 && (u++, i = 7);
|
|
1289
|
+
}
|
|
1290
|
+
if (s += e, s < 0 || this.moduleCount <= s) {
|
|
1291
|
+
s -= e, e = -e;
|
|
1292
|
+
break;
|
|
1293
|
+
}
|
|
1294
|
+
}
|
|
1295
|
+
}, t.PAD0 = 236, t.PAD1 = 17, t.createData = function(r, o, e) {
|
|
1296
|
+
for (var s = d.getRSBlocks(r, o), i = new a(), u = 0; u < e.length; u++) {
|
|
1297
|
+
var y = e[u];
|
|
1298
|
+
i.put(y.mode, 4), i.put(y.getLength(), c.getLengthInBits(y.mode, r)), y.write(i);
|
|
1299
|
+
}
|
|
1300
|
+
for (var v = 0, u = 0; u < s.length; u++)
|
|
1301
|
+
v += s[u].dataCount;
|
|
1302
|
+
if (i.getLengthInBits() > v * 8)
|
|
1303
|
+
throw new Error("code length overflow. (" + i.getLengthInBits() + ">" + v * 8 + ")");
|
|
1304
|
+
for (i.getLengthInBits() + 4 <= v * 8 && i.put(0, 4); i.getLengthInBits() % 8 != 0; )
|
|
1305
|
+
i.putBit(!1);
|
|
1306
|
+
for (; !(i.getLengthInBits() >= v * 8 || (i.put(t.PAD0, 8), i.getLengthInBits() >= v * 8)); )
|
|
1307
|
+
i.put(t.PAD1, 8);
|
|
1308
|
+
return t.createBytes(i, s);
|
|
1309
|
+
}, t.createBytes = function(r, o) {
|
|
1310
|
+
for (var e = 0, s = 0, i = 0, u = new Array(o.length), y = new Array(o.length), v = 0; v < o.length; v++) {
|
|
1311
|
+
var m = o[v].dataCount, p = o[v].totalCount - m;
|
|
1312
|
+
s = Math.max(s, m), i = Math.max(i, p), u[v] = new Array(m);
|
|
1313
|
+
for (var C = 0; C < u[v].length; C++)
|
|
1314
|
+
u[v][C] = 255 & r.buffer[C + e];
|
|
1315
|
+
e += m;
|
|
1316
|
+
var O = c.getErrorCorrectPolynomial(p), A = new f(u[v], O.getLength() - 1), k = A.mod(O);
|
|
1317
|
+
y[v] = new Array(O.getLength() - 1);
|
|
1318
|
+
for (var C = 0; C < y[v].length; C++) {
|
|
1319
|
+
var g = C + k.getLength() - y[v].length;
|
|
1320
|
+
y[v][C] = g >= 0 ? k.get(g) : 0;
|
|
1321
|
+
}
|
|
1322
|
+
}
|
|
1323
|
+
for (var Q = 0, C = 0; C < o.length; C++)
|
|
1324
|
+
Q += o[C].totalCount;
|
|
1325
|
+
for (var K = new Array(Q), q = 0, C = 0; C < s; C++)
|
|
1326
|
+
for (var v = 0; v < o.length; v++)
|
|
1327
|
+
C < u[v].length && (K[q++] = u[v][C]);
|
|
1328
|
+
for (var C = 0; C < i; C++)
|
|
1329
|
+
for (var v = 0; v < o.length; v++)
|
|
1330
|
+
C < y[v].length && (K[q++] = y[v][C]);
|
|
1331
|
+
return K;
|
|
1332
|
+
}, $e = t, $e;
|
|
1333
|
+
}
|
|
1334
|
+
var Te = {}, Rt;
|
|
1335
|
+
function pn() {
|
|
1336
|
+
if (Rt) return Te;
|
|
1337
|
+
Rt = 1, Object.defineProperty(Te, "__esModule", {
|
|
1338
|
+
value: !0
|
|
1339
|
+
});
|
|
1340
|
+
var n = Object.assign || function(e) {
|
|
1341
|
+
for (var s = 1; s < arguments.length; s++) {
|
|
1342
|
+
var i = arguments[s];
|
|
1343
|
+
for (var u in i)
|
|
1344
|
+
Object.prototype.hasOwnProperty.call(i, u) && (e[u] = i[u]);
|
|
1345
|
+
}
|
|
1346
|
+
return e;
|
|
1347
|
+
}, d = /* @__PURE__ */ zt(), a = t(d), c = qe, f = t(c);
|
|
1348
|
+
function t(e) {
|
|
1349
|
+
return e && e.__esModule ? e : { default: e };
|
|
1350
|
+
}
|
|
1351
|
+
function l(e, s) {
|
|
1352
|
+
var i = {};
|
|
1353
|
+
for (var u in e)
|
|
1354
|
+
s.indexOf(u) >= 0 || Object.prototype.hasOwnProperty.call(e, u) && (i[u] = e[u]);
|
|
1355
|
+
return i;
|
|
1356
|
+
}
|
|
1357
|
+
var r = {
|
|
1358
|
+
bgColor: a.default.oneOfType([a.default.object, a.default.string]).isRequired,
|
|
1359
|
+
bgD: a.default.string.isRequired,
|
|
1360
|
+
fgColor: a.default.oneOfType([a.default.object, a.default.string]).isRequired,
|
|
1361
|
+
fgD: a.default.string.isRequired,
|
|
1362
|
+
size: a.default.number.isRequired,
|
|
1363
|
+
title: a.default.string,
|
|
1364
|
+
viewBoxSize: a.default.number.isRequired,
|
|
1365
|
+
xmlns: a.default.string
|
|
1366
|
+
}, o = (0, c.forwardRef)(function(e, s) {
|
|
1367
|
+
var i = e.bgColor, u = e.bgD, y = e.fgD, v = e.fgColor, m = e.size, p = e.title, C = e.viewBoxSize, O = e.xmlns, A = O === void 0 ? "http://www.w3.org/2000/svg" : O, k = l(e, ["bgColor", "bgD", "fgD", "fgColor", "size", "title", "viewBoxSize", "xmlns"]);
|
|
1368
|
+
return f.default.createElement(
|
|
1369
|
+
"svg",
|
|
1370
|
+
n({}, k, { height: m, ref: s, viewBox: "0 0 " + C + " " + C, width: m, xmlns: A }),
|
|
1371
|
+
p ? f.default.createElement(
|
|
1372
|
+
"title",
|
|
1373
|
+
null,
|
|
1374
|
+
p
|
|
1375
|
+
) : null,
|
|
1376
|
+
f.default.createElement("path", { d: u, fill: i }),
|
|
1377
|
+
f.default.createElement("path", { d: y, fill: v })
|
|
1378
|
+
);
|
|
1379
|
+
});
|
|
1380
|
+
return o.displayName = "QRCodeSvg", o.propTypes = r, Te.default = o, Te;
|
|
1381
|
+
}
|
|
1382
|
+
var xt;
|
|
1383
|
+
function vn() {
|
|
1384
|
+
if (xt) return ue;
|
|
1385
|
+
xt = 1, Object.defineProperty(ue, "__esModule", {
|
|
1386
|
+
value: !0
|
|
1387
|
+
}), ue.QRCode = void 0;
|
|
1388
|
+
var n = Object.assign || function(m) {
|
|
1389
|
+
for (var p = 1; p < arguments.length; p++) {
|
|
1390
|
+
var C = arguments[p];
|
|
1391
|
+
for (var O in C)
|
|
1392
|
+
Object.prototype.hasOwnProperty.call(C, O) && (m[O] = C[O]);
|
|
1393
|
+
}
|
|
1394
|
+
return m;
|
|
1395
|
+
}, d = /* @__PURE__ */ zt(), a = i(d), c = qt(), f = i(c), t = hn(), l = i(t), r = qe, o = i(r), e = pn(), s = i(e);
|
|
1396
|
+
function i(m) {
|
|
1397
|
+
return m && m.__esModule ? m : { default: m };
|
|
1398
|
+
}
|
|
1399
|
+
function u(m, p) {
|
|
1400
|
+
var C = {};
|
|
1401
|
+
for (var O in m)
|
|
1402
|
+
p.indexOf(O) >= 0 || Object.prototype.hasOwnProperty.call(m, O) && (C[O] = m[O]);
|
|
1403
|
+
return C;
|
|
1404
|
+
}
|
|
1405
|
+
var y = {
|
|
1406
|
+
bgColor: a.default.oneOfType([a.default.object, a.default.string]),
|
|
1407
|
+
fgColor: a.default.oneOfType([a.default.object, a.default.string]),
|
|
1408
|
+
level: a.default.string,
|
|
1409
|
+
size: a.default.number,
|
|
1410
|
+
value: a.default.string.isRequired
|
|
1411
|
+
}, v = (0, r.forwardRef)(function(m, p) {
|
|
1412
|
+
var C = m.bgColor, O = C === void 0 ? "#FFFFFF" : C, A = m.fgColor, k = A === void 0 ? "#000000" : A, g = m.level, Q = g === void 0 ? "L" : g, K = m.size, q = K === void 0 ? 256 : K, re = m.value, ne = u(m, ["bgColor", "fgColor", "level", "size", "value"]), F = new l.default(-1, f.default[Q]);
|
|
1413
|
+
F.addData(re), F.make();
|
|
1414
|
+
var R = F.modules;
|
|
1415
|
+
return o.default.createElement(s.default, n({}, ne, {
|
|
1416
|
+
bgColor: O,
|
|
1417
|
+
bgD: R.map(function(J, G) {
|
|
1418
|
+
return J.map(function(te, Y) {
|
|
1419
|
+
return te ? "" : "M " + Y + " " + G + " l 1 0 0 1 -1 0 Z";
|
|
1420
|
+
}).join(" ");
|
|
1421
|
+
}).join(" "),
|
|
1422
|
+
fgColor: k,
|
|
1423
|
+
fgD: R.map(function(J, G) {
|
|
1424
|
+
return J.map(function(te, Y) {
|
|
1425
|
+
return te ? "M " + Y + " " + G + " l 1 0 0 1 -1 0 Z" : "";
|
|
1426
|
+
}).join(" ");
|
|
1427
|
+
}).join(" "),
|
|
1428
|
+
ref: p,
|
|
1429
|
+
size: q,
|
|
1430
|
+
viewBoxSize: R.length
|
|
1431
|
+
}));
|
|
1432
|
+
});
|
|
1433
|
+
return ue.QRCode = v, v.displayName = "QRCode", v.propTypes = y, ue.default = v, ue;
|
|
1434
|
+
}
|
|
1435
|
+
var mn = vn();
|
|
1436
|
+
const gn = /* @__PURE__ */ dr(mn), yn = "chatId", bn = (n, d, a) => {
|
|
1437
|
+
const c = String(n || "").split("@")[0];
|
|
1438
|
+
if (!c) return "";
|
|
1439
|
+
if (d) return `${d}${c}`;
|
|
1440
|
+
const f = typeof window < "u" ? window.location.href : "";
|
|
1441
|
+
if (!f) return "";
|
|
1442
|
+
try {
|
|
1443
|
+
const t = new URL(f);
|
|
1444
|
+
return t.hash = "", t.searchParams.set(yn, c), t.toString();
|
|
1445
|
+
} catch {
|
|
1446
|
+
return "";
|
|
1447
|
+
}
|
|
1448
|
+
}, En = H.div`
|
|
1449
|
+
position: absolute;
|
|
1450
|
+
inset: 0;
|
|
1451
|
+
z-index: 2;
|
|
1452
|
+
display: flex;
|
|
1453
|
+
`, Tn = H.div`
|
|
1454
|
+
display: flex;
|
|
1455
|
+
flex-direction: column;
|
|
1456
|
+
align-items: center;
|
|
1457
|
+
width: 100%;
|
|
1458
|
+
margin: auto 0;
|
|
1459
|
+
gap: var(--ethora-space-5, 20px);
|
|
1460
|
+
`, wn = H(ze)`
|
|
1461
|
+
width: 100%;
|
|
1462
|
+
`, Cn = H.div`
|
|
1463
|
+
display: flex;
|
|
1464
|
+
justify-content: center;
|
|
1465
|
+
padding: var(--ethora-space-6, 24px) var(--ethora-space-5, 20px);
|
|
1466
|
+
`, Rn = H.div`
|
|
1467
|
+
width: 176px;
|
|
1468
|
+
`, xn = H.div`
|
|
1469
|
+
box-sizing: border-box;
|
|
1470
|
+
display: flex;
|
|
1471
|
+
flex-direction: column;
|
|
1472
|
+
width: 100%;
|
|
1473
|
+
gap: var(--ethora-space-3, 12px);
|
|
1474
|
+
padding: var(--ethora-space-4, 16px) var(--ethora-space-5, 20px);
|
|
1475
|
+
border-top: 1px solid var(--ethora-color-border, #e6e8ec);
|
|
1476
|
+
`, Pn = ({
|
|
1477
|
+
isVisible: n,
|
|
1478
|
+
chatJid: d,
|
|
1479
|
+
setVisible: a
|
|
1480
|
+
}) => {
|
|
1481
|
+
const { config: c } = Dt(), f = ve();
|
|
1482
|
+
if (!n) return null;
|
|
1483
|
+
const t = bn(d, c?.qrUrl);
|
|
1484
|
+
return /* @__PURE__ */ E(En, { children: /* @__PURE__ */ E(
|
|
1485
|
+
$t,
|
|
1486
|
+
{
|
|
1487
|
+
title: f("modal.qr.title"),
|
|
1488
|
+
onClose: () => a(!1),
|
|
1489
|
+
backLabel: f("action.close"),
|
|
1490
|
+
children: /* @__PURE__ */ j(Tn, { children: [
|
|
1491
|
+
/* @__PURE__ */ j(wn, { children: [
|
|
1492
|
+
/* @__PURE__ */ E(Cn, { children: /* @__PURE__ */ E(Rn, { children: /* @__PURE__ */ E(
|
|
1493
|
+
gn,
|
|
1494
|
+
{
|
|
1495
|
+
size: 176,
|
|
1496
|
+
style: { width: "100%", height: "auto" },
|
|
1497
|
+
value: t,
|
|
1498
|
+
viewBox: "0 0 176 176"
|
|
1499
|
+
}
|
|
1500
|
+
) }) }),
|
|
1501
|
+
/* @__PURE__ */ j(xn, { children: [
|
|
1502
|
+
/* @__PURE__ */ E(
|
|
1503
|
+
hr,
|
|
1504
|
+
{
|
|
1505
|
+
$colorBg: c?.colors?.colorInput,
|
|
1506
|
+
value: t,
|
|
1507
|
+
readOnly: !0,
|
|
1508
|
+
"aria-label": f("modal.qr.title"),
|
|
1509
|
+
style: { width: "100%" }
|
|
1510
|
+
}
|
|
1511
|
+
),
|
|
1512
|
+
/* @__PURE__ */ E(
|
|
1513
|
+
ee,
|
|
1514
|
+
{
|
|
1515
|
+
text: f("action.copyLink"),
|
|
1516
|
+
onClick: () => Xr(t),
|
|
1517
|
+
variant: "filled",
|
|
1518
|
+
style: { width: "100%" }
|
|
1519
|
+
}
|
|
1520
|
+
)
|
|
1521
|
+
] })
|
|
1522
|
+
] }),
|
|
1523
|
+
/* @__PURE__ */ E(Qr, { style: { textAlign: "center" }, children: f("modal.qr.hint") })
|
|
1524
|
+
] })
|
|
1525
|
+
}
|
|
1526
|
+
) });
|
|
1527
|
+
}, Sn = ({
|
|
1528
|
+
isModalOpen: n,
|
|
1529
|
+
setIsModalOpen: d
|
|
1530
|
+
}) => {
|
|
1531
|
+
const a = Fe(), c = fe((e) => Qe(e)), { client: f } = pr(), t = ve(), l = () => d(!1), r = _t(null);
|
|
1532
|
+
Mt({
|
|
1533
|
+
enabled: n,
|
|
1534
|
+
onClose: l,
|
|
1535
|
+
containerRef: r
|
|
1536
|
+
});
|
|
1537
|
+
const o = async () => {
|
|
1538
|
+
try {
|
|
1539
|
+
await mr(c.jid.split("@")[0]), f?.leaveTheRoomStanza?.(c.jid), a(gr({ jid: c.jid })), a(yr({ roomJID: null })), l();
|
|
1540
|
+
} catch (e) {
|
|
1541
|
+
console.error("Failed to delete chat:", e);
|
|
1542
|
+
}
|
|
1543
|
+
};
|
|
1544
|
+
return n && /* @__PURE__ */ E(At, { children: /* @__PURE__ */ j(Ot, { ref: r, children: [
|
|
1545
|
+
/* @__PURE__ */ E(
|
|
1546
|
+
It,
|
|
1547
|
+
{
|
|
1548
|
+
onClick: l,
|
|
1549
|
+
style: { fontSize: 24 },
|
|
1550
|
+
"aria-label": t("action.close"),
|
|
1551
|
+
children: "×"
|
|
1552
|
+
}
|
|
1553
|
+
),
|
|
1554
|
+
/* @__PURE__ */ E(vr, { children: t("modal.deleteChat.title") }),
|
|
1555
|
+
/* @__PURE__ */ j(je, { children: [
|
|
1556
|
+
/* @__PURE__ */ E(
|
|
1557
|
+
ee,
|
|
1558
|
+
{
|
|
1559
|
+
onClick: l,
|
|
1560
|
+
text: t("action.cancel"),
|
|
1561
|
+
style: { width: "100%" },
|
|
1562
|
+
unstyled: !0,
|
|
1563
|
+
variant: "outlined"
|
|
1564
|
+
}
|
|
1565
|
+
),
|
|
1566
|
+
/* @__PURE__ */ E(
|
|
1567
|
+
ee,
|
|
1568
|
+
{
|
|
1569
|
+
onClick: o,
|
|
1570
|
+
text: t("action.delete"),
|
|
1571
|
+
style: { width: "100%" },
|
|
1572
|
+
unstyled: !0,
|
|
1573
|
+
variant: "filled",
|
|
1574
|
+
tone: "danger"
|
|
1575
|
+
}
|
|
1576
|
+
)
|
|
1577
|
+
] })
|
|
1578
|
+
] }) });
|
|
1579
|
+
}, _n = () => {
|
|
1580
|
+
const { showToast: n } = Lt(), d = Fe(), a = ve(), [c, f] = W(!1), [t, l] = W(!1), [r, o] = W([]), e = fe((v) => Qe(v)), s = () => l(!0), i = () => {
|
|
1581
|
+
l(!1), o([]);
|
|
1582
|
+
}, u = _t(null);
|
|
1583
|
+
Mt({
|
|
1584
|
+
enabled: t,
|
|
1585
|
+
onClose: i,
|
|
1586
|
+
containerRef: u
|
|
1587
|
+
});
|
|
1588
|
+
const y = async () => {
|
|
1589
|
+
f(!0);
|
|
1590
|
+
const v = Array.isArray(e?.members) ? e.members : [], m = v.map(
|
|
1591
|
+
(C) => C.xmppUsername
|
|
1592
|
+
), p = r.filter((C) => !m.includes(C.xmppUsername)).map((C) => C.xmppUsername);
|
|
1593
|
+
try {
|
|
1594
|
+
const C = await Tr({
|
|
1595
|
+
chatName: e.jid.split("@")[0],
|
|
1596
|
+
members: p
|
|
1597
|
+
});
|
|
1598
|
+
d(
|
|
1599
|
+
pe({
|
|
1600
|
+
jid: e.jid,
|
|
1601
|
+
updates: {
|
|
1602
|
+
members: [...C, ...v],
|
|
1603
|
+
usersCnt: Bt(e) + C.length
|
|
1604
|
+
}
|
|
1605
|
+
})
|
|
1606
|
+
), n({
|
|
1607
|
+
id: Date.now().toString(),
|
|
1608
|
+
title: a("toast.success"),
|
|
1609
|
+
// This is the "add users to an existing room" flow, not room
|
|
1610
|
+
// creation - the old copy here literally said "Room created
|
|
1611
|
+
// succusfully!" (typo and all), copy-pasted from NewChatModal.
|
|
1612
|
+
message: a("toast.usersAddedSuccess"),
|
|
1613
|
+
type: "success",
|
|
1614
|
+
duration: 3e3
|
|
1615
|
+
});
|
|
1616
|
+
} catch (C) {
|
|
1617
|
+
console.error("Error adding users:", C), f(!1);
|
|
1618
|
+
}
|
|
1619
|
+
i(), f(!1);
|
|
1620
|
+
};
|
|
1621
|
+
return /* @__PURE__ */ j(St, { children: [
|
|
1622
|
+
/* @__PURE__ */ E(br, { variant: "filled", unstyled: !0, onClick: s, children: a("action.addMoreUsers") }),
|
|
1623
|
+
t && /* @__PURE__ */ E(At, { children: /* @__PURE__ */ j(Ot, { ref: u, children: [
|
|
1624
|
+
/* @__PURE__ */ E(
|
|
1625
|
+
It,
|
|
1626
|
+
{
|
|
1627
|
+
onClick: i,
|
|
1628
|
+
style: { fontSize: 24 },
|
|
1629
|
+
"aria-label": a("action.close"),
|
|
1630
|
+
children: "×"
|
|
1631
|
+
}
|
|
1632
|
+
),
|
|
1633
|
+
/* @__PURE__ */ E(
|
|
1634
|
+
je,
|
|
1635
|
+
{
|
|
1636
|
+
style: {
|
|
1637
|
+
flexDirection: "column",
|
|
1638
|
+
position: "relative",
|
|
1639
|
+
boxSizing: "border-box",
|
|
1640
|
+
width: "100%",
|
|
1641
|
+
minHeight: "400px"
|
|
1642
|
+
},
|
|
1643
|
+
children: /* @__PURE__ */ E(
|
|
1644
|
+
Er,
|
|
1645
|
+
{
|
|
1646
|
+
selectedUsers: r,
|
|
1647
|
+
setSelectedUsers: o,
|
|
1648
|
+
style: {
|
|
1649
|
+
minWidth: "100%",
|
|
1650
|
+
width: "100%",
|
|
1651
|
+
maxHeight: "340px"
|
|
1652
|
+
},
|
|
1653
|
+
headerElement: !1
|
|
1654
|
+
}
|
|
1655
|
+
)
|
|
1656
|
+
}
|
|
1657
|
+
),
|
|
1658
|
+
/* @__PURE__ */ j(je, { children: [
|
|
1659
|
+
/* @__PURE__ */ E(
|
|
1660
|
+
ee,
|
|
1661
|
+
{
|
|
1662
|
+
onClick: i,
|
|
1663
|
+
text: a("action.cancel"),
|
|
1664
|
+
style: { width: "100%" },
|
|
1665
|
+
unstyled: !0,
|
|
1666
|
+
variant: "outlined"
|
|
1667
|
+
}
|
|
1668
|
+
),
|
|
1669
|
+
c ? /* @__PURE__ */ E(Ue, {}) : /* @__PURE__ */ E(
|
|
1670
|
+
ee,
|
|
1671
|
+
{
|
|
1672
|
+
onClick: y,
|
|
1673
|
+
text: a("action.add"),
|
|
1674
|
+
style: { width: "100%" },
|
|
1675
|
+
unstyled: !0,
|
|
1676
|
+
variant: "filled"
|
|
1677
|
+
}
|
|
1678
|
+
)
|
|
1679
|
+
] })
|
|
1680
|
+
] }) })
|
|
1681
|
+
] });
|
|
1682
|
+
}, Dn = H.div`
|
|
1683
|
+
display: flex;
|
|
1684
|
+
align-items: center;
|
|
1685
|
+
gap: var(--ethora-space-3, 12px);
|
|
1686
|
+
min-height: 60px;
|
|
1687
|
+
border-radius: var(--ethora-radius-md, 12px);
|
|
1688
|
+
padding: var(--ethora-space-2, 8px);
|
|
1689
|
+
transition: background-color var(--ethora-motion-fast, 150ms)
|
|
1690
|
+
var(--ethora-motion-ease, ease);
|
|
1691
|
+
|
|
1692
|
+
&:hover {
|
|
1693
|
+
background-color: var(--ethora-color-bg-hover, #f0f2f5);
|
|
1694
|
+
}
|
|
1695
|
+
|
|
1696
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1697
|
+
transition: none;
|
|
1698
|
+
}
|
|
1699
|
+
`, Mn = H.div`
|
|
1700
|
+
display: flex;
|
|
1701
|
+
align-items: center;
|
|
1702
|
+
gap: var(--ethora-space-3, 12px);
|
|
1703
|
+
min-width: 0;
|
|
1704
|
+
flex: 1 1 auto;
|
|
1705
|
+
cursor: ${({ $clickable: n }) => n ? "pointer" : "default"};
|
|
1706
|
+
|
|
1707
|
+
&:focus-visible {
|
|
1708
|
+
outline: 2px solid var(--ethora-color-primary, #0052cd);
|
|
1709
|
+
outline-offset: 2px;
|
|
1710
|
+
border-radius: var(--ethora-radius-sm, 8px);
|
|
1711
|
+
}
|
|
1712
|
+
`, An = H.div`
|
|
1713
|
+
display: flex;
|
|
1714
|
+
flex-direction: column;
|
|
1715
|
+
gap: 2px;
|
|
1716
|
+
min-width: 0;
|
|
1717
|
+
`, On = H.span`
|
|
1718
|
+
font-size: var(--ethora-font-size-sm, 14px);
|
|
1719
|
+
font-weight: var(--ethora-font-weight-semibold, 600);
|
|
1720
|
+
color: var(--ethora-color-text, #141414);
|
|
1721
|
+
overflow: hidden;
|
|
1722
|
+
text-overflow: ellipsis;
|
|
1723
|
+
white-space: nowrap;
|
|
1724
|
+
`, In = H.span`
|
|
1725
|
+
font-size: var(--ethora-font-size-xs, 12px);
|
|
1726
|
+
color: ${({ $online: n }) => n ? "var(--ethora-color-online, #12b76a)" : "var(--ethora-color-text-muted, #8c8c8c)"};
|
|
1727
|
+
overflow: hidden;
|
|
1728
|
+
text-overflow: ellipsis;
|
|
1729
|
+
white-space: nowrap;
|
|
1730
|
+
`, Ln = H.span`
|
|
1731
|
+
flex: 0 0 auto;
|
|
1732
|
+
background-color: ${({ $banned: n }) => n ? "rgba(217, 45, 32, 0.1)" : "var(--ethora-color-primary-soft, #e7edf9)"};
|
|
1733
|
+
color: ${({ $banned: n }) => n ? "var(--ethora-color-danger, #d92d20)" : "var(--ethora-color-primary, #0052cd)"};
|
|
1734
|
+
padding: var(--ethora-space-1, 4px) var(--ethora-space-2, 8px);
|
|
1735
|
+
border-radius: var(--ethora-radius-full, 999px);
|
|
1736
|
+
font-size: var(--ethora-font-size-xs, 12px);
|
|
1737
|
+
font-weight: var(--ethora-font-weight-medium, 500);
|
|
1738
|
+
text-transform: capitalize;
|
|
1739
|
+
[data-ethora-color-scheme='dark'] & {
|
|
1740
|
+
${({ $banned: n }) => n ? "background-color: rgba(242, 118, 107, 0.15);" : ""}
|
|
1741
|
+
}
|
|
1742
|
+
`, Bn = ({
|
|
1743
|
+
member: n,
|
|
1744
|
+
disableClick: d,
|
|
1745
|
+
online: a,
|
|
1746
|
+
showMenu: c,
|
|
1747
|
+
menuOptions: f,
|
|
1748
|
+
moreOptionsLabel: t,
|
|
1749
|
+
onAvatarClick: l
|
|
1750
|
+
}) => {
|
|
1751
|
+
const r = ve(), o = kt(), e = String(n?.xmppUsername || ""), s = e.split("@")[0], i = fe(
|
|
1752
|
+
(A) => A.rooms.usersSet?.[e] ?? A.rooms.usersSet?.[s]
|
|
1753
|
+
), u = n.firstName || i?.firstName || "", y = n.lastName || i?.lastName || "", v = n.profileImage || i?.profileImage || i?.photoURL || "", m = {
|
|
1754
|
+
...n,
|
|
1755
|
+
firstName: u,
|
|
1756
|
+
lastName: y,
|
|
1757
|
+
profileImage: v
|
|
1758
|
+
}, p = !!n.role && n.role !== "none", C = n.ban_status === "banned";
|
|
1759
|
+
let O = "";
|
|
1760
|
+
if (a)
|
|
1761
|
+
O = r("presence.online");
|
|
1762
|
+
else if (n.last_active)
|
|
1763
|
+
try {
|
|
1764
|
+
O = new Intl.DateTimeFormat(o, {
|
|
1765
|
+
dateStyle: "medium"
|
|
1766
|
+
}).format(new Date(n.last_active * 1e3));
|
|
1767
|
+
} catch {
|
|
1768
|
+
O = "";
|
|
1769
|
+
}
|
|
1770
|
+
else p && (O = n.role);
|
|
1771
|
+
return /* @__PURE__ */ j(Dn, { children: [
|
|
1772
|
+
/* @__PURE__ */ j(
|
|
1773
|
+
Mn,
|
|
1774
|
+
{
|
|
1775
|
+
$clickable: !d,
|
|
1776
|
+
role: d ? void 0 : "button",
|
|
1777
|
+
tabIndex: d ? void 0 : 0,
|
|
1778
|
+
onClick: d ? void 0 : () => l(m),
|
|
1779
|
+
onKeyDown: d ? void 0 : (A) => {
|
|
1780
|
+
(A.key === "Enter" || A.key === " ") && (A.preventDefault(), l(m));
|
|
1781
|
+
},
|
|
1782
|
+
children: [
|
|
1783
|
+
/* @__PURE__ */ E(
|
|
1784
|
+
Nt,
|
|
1785
|
+
{
|
|
1786
|
+
name: `${u} ${y}`,
|
|
1787
|
+
icon: v,
|
|
1788
|
+
size: 40,
|
|
1789
|
+
online: a
|
|
1790
|
+
}
|
|
1791
|
+
),
|
|
1792
|
+
/* @__PURE__ */ j(An, { children: [
|
|
1793
|
+
/* @__PURE__ */ j(On, { children: [
|
|
1794
|
+
u,
|
|
1795
|
+
" ",
|
|
1796
|
+
y
|
|
1797
|
+
] }),
|
|
1798
|
+
O && /* @__PURE__ */ E(In, { $online: a, children: O })
|
|
1799
|
+
] })
|
|
1800
|
+
]
|
|
1801
|
+
}
|
|
1802
|
+
),
|
|
1803
|
+
p && /* @__PURE__ */ E(Ln, { $banned: C, children: n.role }),
|
|
1804
|
+
c && /* @__PURE__ */ E(
|
|
1805
|
+
wr,
|
|
1806
|
+
{
|
|
1807
|
+
options: f,
|
|
1808
|
+
position: "left",
|
|
1809
|
+
openButton: /* @__PURE__ */ E(
|
|
1810
|
+
ee,
|
|
1811
|
+
{
|
|
1812
|
+
onClick: (A) => {
|
|
1813
|
+
A.preventDefault();
|
|
1814
|
+
},
|
|
1815
|
+
"aria-label": t,
|
|
1816
|
+
children: t
|
|
1817
|
+
}
|
|
1818
|
+
),
|
|
1819
|
+
onClose: () => Cr.log("Dropdown closed")
|
|
1820
|
+
}
|
|
1821
|
+
)
|
|
1822
|
+
] });
|
|
1823
|
+
}, kn = qe.memo(Bn), Nn = H.button`
|
|
1824
|
+
display: inline-flex;
|
|
1825
|
+
align-items: center;
|
|
1826
|
+
gap: 6px;
|
|
1827
|
+
border: 0;
|
|
1828
|
+
border-radius: var(--ethora-radius-md, 10px);
|
|
1829
|
+
padding: 6px 10px;
|
|
1830
|
+
color: var(--ethora-color-primary, #168fc4);
|
|
1831
|
+
background: transparent;
|
|
1832
|
+
font: inherit;
|
|
1833
|
+
font-size: var(--ethora-font-size-xs, 12px);
|
|
1834
|
+
cursor: pointer;
|
|
1835
|
+
&:hover { background: var(--ethora-color-bg-hover, rgba(127, 127, 127, 0.12)); }
|
|
1836
|
+
&:focus-visible { outline: 2px solid var(--ethora-color-primary, #168fc4); }
|
|
1837
|
+
svg { width: 16px; height: 16px; }
|
|
1838
|
+
`, $n = H.input`
|
|
1839
|
+
width: 100%;
|
|
1840
|
+
min-width: 0;
|
|
1841
|
+
box-sizing: border-box;
|
|
1842
|
+
border: 1px solid var(--ethora-color-border, #d0d5dd);
|
|
1843
|
+
border-radius: var(--ethora-radius-md, 10px);
|
|
1844
|
+
padding: 9px 11px;
|
|
1845
|
+
color: var(--ethora-color-text, inherit);
|
|
1846
|
+
background: var(--ethora-color-bg, transparent);
|
|
1847
|
+
font: inherit;
|
|
1848
|
+
font-size: var(--ethora-font-size-sm, 14px);
|
|
1849
|
+
`, jn = H.textarea`
|
|
1850
|
+
width: 100%;
|
|
1851
|
+
min-height: 88px;
|
|
1852
|
+
box-sizing: border-box;
|
|
1853
|
+
resize: vertical;
|
|
1854
|
+
border: 1px solid var(--ethora-color-border, #d0d5dd);
|
|
1855
|
+
border-radius: var(--ethora-radius-md, 10px);
|
|
1856
|
+
padding: 9px 11px;
|
|
1857
|
+
color: var(--ethora-color-text, inherit);
|
|
1858
|
+
background: var(--ethora-color-bg, transparent);
|
|
1859
|
+
font: inherit;
|
|
1860
|
+
font-size: var(--ethora-font-size-sm, 14px);
|
|
1861
|
+
`, Un = H.div`
|
|
1862
|
+
display: flex;
|
|
1863
|
+
justify-content: flex-end;
|
|
1864
|
+
gap: var(--ethora-space-2, 8px);
|
|
1865
|
+
margin-top: var(--ethora-space-2, 8px);
|
|
1866
|
+
button { width: auto; min-width: 76px; padding: 0 12px; }
|
|
1867
|
+
`, Pt = 150, zn = 150, Wn = ({
|
|
1868
|
+
handleCloseModal: n
|
|
1869
|
+
}) => {
|
|
1870
|
+
const [d, a] = W(!1), [c, f] = W(!1), [t, l] = W(!1), [r, o] = W(!1), [e, s] = W(""), [i, u] = W(""), [y, v] = W(!1), { showToast: m } = Lt(), p = ve(), C = kt(), [O, A] = W(!1), [k, g] = W(
|
|
1871
|
+
Pt
|
|
1872
|
+
), [Q, K] = W(""), q = Fe(), re = Rr(), { user: ne, config: F } = Dt(), R = fe((T) => Qe(T)), {
|
|
1873
|
+
muted: J,
|
|
1874
|
+
isSupported: G,
|
|
1875
|
+
setMuted: te
|
|
1876
|
+
} = xr(R?.jid), Y = G && !F?.disableRoomMute, V = Pr(R?.jid), oe = fe(
|
|
1877
|
+
(T) => T.chatSettingStore.user?.fileToken || ""
|
|
1878
|
+
), de = ne?.xmppUsername || "", h = R?.type === "private", w = h ? (R?.members || []).find(
|
|
1879
|
+
(T) => T.xmppUsername && T.xmppUsername !== de
|
|
1880
|
+
) : void 0, S = w?.xmppUsername || "", D = S.split("@")[0], x = fe(
|
|
1881
|
+
(T) => S ? T.rooms.usersSet?.[S] ?? T.rooms.usersSet?.[D] : void 0
|
|
1882
|
+
), I = w?.profileImage || x?.profileImage || "", _ = he(() => new Set(V), [V]), P = Sr(R), { members: M, state: B } = _r(
|
|
1883
|
+
R?.jid,
|
|
1884
|
+
P
|
|
1885
|
+
), L = P && B === "loading", z = he(() => {
|
|
1886
|
+
const T = Array.isArray(R?.members) ? R.members : [];
|
|
1887
|
+
return !P || M.length === 0 ? Xe(T) : Xe([...T, ...M]);
|
|
1888
|
+
}, [R?.members, P, M]), b = he(() => {
|
|
1889
|
+
const T = Q.trim().toLowerCase();
|
|
1890
|
+
if (!T) return z;
|
|
1891
|
+
const U = re.getState().rooms.usersSet;
|
|
1892
|
+
return z.filter((Z) => {
|
|
1893
|
+
const ae = String(Z?.xmppUsername || ""), cr = ae.split("@")[0], Ge = U?.[ae] || U?.[cr], ur = Z.firstName || Ge?.firstName || "", fr = Z.lastName || Ge?.lastName || "";
|
|
1894
|
+
return `${ur} ${fr}`.toLowerCase().includes(T);
|
|
1895
|
+
});
|
|
1896
|
+
}, [z, Q, re]), X = he(
|
|
1897
|
+
() => b.slice(0, k),
|
|
1898
|
+
[b, k]
|
|
1899
|
+
), ie = k < b.length, me = (T) => {
|
|
1900
|
+
K(T.target.value), g(Pt);
|
|
1901
|
+
}, Ht = R?.jid ? R.jid.split("@")[0] : void 0, {
|
|
1902
|
+
items: se,
|
|
1903
|
+
loading: Wt,
|
|
1904
|
+
error: Kt,
|
|
1905
|
+
remove: Gt
|
|
1906
|
+
} = Dr({ roomName: Ht }), Xt = O ? se : se.slice(0, 6), Jt = (T) => {
|
|
1907
|
+
const U = Ze(T.location);
|
|
1908
|
+
U && typeof window < "u" && window.open(U, "_blank", "noopener,noreferrer");
|
|
1909
|
+
}, Vt = (T) => {
|
|
1910
|
+
const U = Ze(T.location);
|
|
1911
|
+
if (!U || typeof document > "u") return;
|
|
1912
|
+
const Z = document.createElement("a");
|
|
1913
|
+
Z.href = U, Z.download = T.originalname || "file", document.body.appendChild(Z), Z.click(), Z.remove();
|
|
1914
|
+
}, Zt = (T) => {
|
|
1915
|
+
Gt(T._id).catch(() => {
|
|
1916
|
+
});
|
|
1917
|
+
}, er = async (T) => {
|
|
1918
|
+
try {
|
|
1919
|
+
let U = new FormData();
|
|
1920
|
+
U.append("files", T);
|
|
1921
|
+
const ae = (await qr(U, R.jid))?.data?.results?.[0]?.location;
|
|
1922
|
+
if (!ae) throw new Error("Image upload returned no location");
|
|
1923
|
+
await Ce(R.jid.split("@")[0], { picture: ae }), q(
|
|
1924
|
+
pe({
|
|
1925
|
+
jid: R.jid,
|
|
1926
|
+
updates: { icon: ae, picture: ae }
|
|
1927
|
+
})
|
|
1928
|
+
);
|
|
1929
|
+
} catch (U) {
|
|
1930
|
+
console.error("File upload failed or location is missing:", U), m({
|
|
1931
|
+
id: Date.now().toString(),
|
|
1932
|
+
title: p("toast.error"),
|
|
1933
|
+
message: p("toast.failedToUpdateChat"),
|
|
1934
|
+
type: "error"
|
|
1935
|
+
});
|
|
1936
|
+
}
|
|
1937
|
+
}, tr = async (T) => {
|
|
1938
|
+
try {
|
|
1939
|
+
await zr({
|
|
1940
|
+
roomId: R.jid.split("@")[0],
|
|
1941
|
+
members: [T]
|
|
1942
|
+
}), q(
|
|
1943
|
+
pe({
|
|
1944
|
+
jid: R.jid,
|
|
1945
|
+
updates: {
|
|
1946
|
+
members: (Array.isArray(R.members) ? R.members : []).filter((U) => U.xmppUsername !== T)
|
|
1947
|
+
}
|
|
1948
|
+
})
|
|
1949
|
+
), m({
|
|
1950
|
+
id: Date.now().toString(),
|
|
1951
|
+
title: p("toast.success"),
|
|
1952
|
+
message: p("toast.userRemovedFromRoom", { userId: T }),
|
|
1953
|
+
type: "success"
|
|
1954
|
+
});
|
|
1955
|
+
} catch (U) {
|
|
1956
|
+
console.error("Failed to delete user:", U), m({
|
|
1957
|
+
id: Date.now().toString(),
|
|
1958
|
+
title: p("toast.error"),
|
|
1959
|
+
message: p("toast.failedToDeleteUser"),
|
|
1960
|
+
type: "error"
|
|
1961
|
+
});
|
|
1962
|
+
}
|
|
1963
|
+
}, le = F?.disableRoomConfig === !0, rr = async () => {
|
|
1964
|
+
try {
|
|
1965
|
+
await Ce(R.jid.split("@")[0], { picture: "" });
|
|
1966
|
+
} catch (T) {
|
|
1967
|
+
console.warn("Chat picture clear failed:", T), m({
|
|
1968
|
+
id: Date.now().toString(),
|
|
1969
|
+
title: p("toast.error"),
|
|
1970
|
+
message: p("toast.failedToUpdateChat"),
|
|
1971
|
+
type: "error"
|
|
1972
|
+
});
|
|
1973
|
+
return;
|
|
1974
|
+
}
|
|
1975
|
+
q(
|
|
1976
|
+
pe({
|
|
1977
|
+
jid: R.jid,
|
|
1978
|
+
updates: { icon: null, picture: "" }
|
|
1979
|
+
})
|
|
1980
|
+
);
|
|
1981
|
+
}, ge = !F?.disableChatInfo?.disableDescription, He = !F?.disableChatInfo?.disableType, We = R.role?.toLowerCase() === "moderator", nr = We && R.type !== "private" && !le, Ke = R.type !== "private" && We && !le, or = () => {
|
|
1982
|
+
s(R.title || R.name || ""), u(R.description || ""), o(!0);
|
|
1983
|
+
}, ar = async () => {
|
|
1984
|
+
const T = e.trim();
|
|
1985
|
+
if (!(!T || y)) {
|
|
1986
|
+
v(!0);
|
|
1987
|
+
try {
|
|
1988
|
+
const U = i.trim();
|
|
1989
|
+
await Ce(R.jid.split("@")[0], {
|
|
1990
|
+
title: T,
|
|
1991
|
+
...ge ? { description: U } : {}
|
|
1992
|
+
}), q(
|
|
1993
|
+
pe({
|
|
1994
|
+
jid: R.jid,
|
|
1995
|
+
updates: {
|
|
1996
|
+
title: T,
|
|
1997
|
+
...ge ? { description: U } : {}
|
|
1998
|
+
}
|
|
1999
|
+
})
|
|
2000
|
+
), o(!1), m({
|
|
2001
|
+
id: Date.now().toString(),
|
|
2002
|
+
title: p("toast.success"),
|
|
2003
|
+
message: p("toast.chatInfoUpdated"),
|
|
2004
|
+
type: "success"
|
|
2005
|
+
});
|
|
2006
|
+
} catch {
|
|
2007
|
+
m({
|
|
2008
|
+
id: Date.now().toString(),
|
|
2009
|
+
title: p("toast.error"),
|
|
2010
|
+
message: p("toast.failedToUpdateChat"),
|
|
2011
|
+
type: "error"
|
|
2012
|
+
});
|
|
2013
|
+
} finally {
|
|
2014
|
+
v(!1);
|
|
2015
|
+
}
|
|
2016
|
+
}
|
|
2017
|
+
}, ir = (T) => {
|
|
2018
|
+
q(we(Je.PROFILE)), q(
|
|
2019
|
+
Fr({
|
|
2020
|
+
id: T._id,
|
|
2021
|
+
firstName: T.firstName,
|
|
2022
|
+
lastName: T.lastName,
|
|
2023
|
+
name: `${T.firstName} ${T.lastName}`,
|
|
2024
|
+
userJID: T?.xmppUsername,
|
|
2025
|
+
profileImage: T.profileImage || T.photoURL
|
|
2026
|
+
})
|
|
2027
|
+
);
|
|
2028
|
+
}, sr = he(
|
|
2029
|
+
() => (T) => [
|
|
2030
|
+
{
|
|
2031
|
+
label: p("action.delete"),
|
|
2032
|
+
icon: null,
|
|
2033
|
+
onClick: (U) => {
|
|
2034
|
+
U?.preventDefault(), tr(T);
|
|
2035
|
+
}
|
|
2036
|
+
}
|
|
2037
|
+
],
|
|
2038
|
+
[p]
|
|
2039
|
+
);
|
|
2040
|
+
if (!R)
|
|
2041
|
+
return q(we()), null;
|
|
2042
|
+
const lr = (() => {
|
|
2043
|
+
const T = Bt(R), U = Mr(T, C);
|
|
2044
|
+
return T === 1 ? p("modal.chatProfile.memberCountSingular", { count: U }) : p("modal.chatProfile.memberCountPlural", { count: U });
|
|
2045
|
+
})();
|
|
2046
|
+
return /* @__PURE__ */ j(
|
|
2047
|
+
$t,
|
|
2048
|
+
{
|
|
2049
|
+
title: p("modal.chatProfile.title"),
|
|
2050
|
+
onClose: n,
|
|
2051
|
+
headerActions: /* @__PURE__ */ E(St, { children: R?.type === "public" && /* @__PURE__ */ E(
|
|
2052
|
+
ee,
|
|
2053
|
+
{
|
|
2054
|
+
EndIcon: /* @__PURE__ */ E(Ur, {}),
|
|
2055
|
+
onClick: () => f(!0),
|
|
2056
|
+
"aria-label": p("action.showQr")
|
|
2057
|
+
}
|
|
2058
|
+
) }),
|
|
2059
|
+
children: [
|
|
2060
|
+
/* @__PURE__ */ j(Jr, { children: [
|
|
2061
|
+
/* @__PURE__ */ E(
|
|
2062
|
+
Nt,
|
|
2063
|
+
{
|
|
2064
|
+
name: R.name,
|
|
2065
|
+
icon: Ar(
|
|
2066
|
+
R.icon || (h ? I : ""),
|
|
2067
|
+
oe
|
|
2068
|
+
),
|
|
2069
|
+
upload: {
|
|
2070
|
+
onUpload: er,
|
|
2071
|
+
active: !le && R?.role !== "participant"
|
|
2072
|
+
},
|
|
2073
|
+
remove: le ? void 0 : { enabled: !0, onRemoveClick: rr },
|
|
2074
|
+
role: R?.role,
|
|
2075
|
+
size: 96
|
|
2076
|
+
}
|
|
2077
|
+
),
|
|
2078
|
+
/* @__PURE__ */ j("div", { children: [
|
|
2079
|
+
/* @__PURE__ */ j("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
|
|
2080
|
+
r ? /* @__PURE__ */ E(
|
|
2081
|
+
$n,
|
|
2082
|
+
{
|
|
2083
|
+
"aria-label": p("modal.chatProfile.chatName"),
|
|
2084
|
+
value: e,
|
|
2085
|
+
maxLength: 120,
|
|
2086
|
+
onChange: (T) => s(T.target.value)
|
|
2087
|
+
}
|
|
2088
|
+
) : /* @__PURE__ */ E(Vr, { children: R.title || R.name }),
|
|
2089
|
+
Ke && !r && /* @__PURE__ */ j(
|
|
2090
|
+
Nn,
|
|
2091
|
+
{
|
|
2092
|
+
type: "button",
|
|
2093
|
+
"aria-label": p("action.editProfile"),
|
|
2094
|
+
onClick: or,
|
|
2095
|
+
children: [
|
|
2096
|
+
/* @__PURE__ */ E(Or, {}),
|
|
2097
|
+
p("action.editProfile")
|
|
2098
|
+
]
|
|
2099
|
+
}
|
|
2100
|
+
)
|
|
2101
|
+
] }),
|
|
2102
|
+
/* @__PURE__ */ E(Zr, { children: lr })
|
|
2103
|
+
] })
|
|
2104
|
+
] }),
|
|
2105
|
+
!r && R.role === "moderator" && R.type === "group" && !le && /* @__PURE__ */ E(_n, {}),
|
|
2106
|
+
(ge || He) && /* @__PURE__ */ j(ce, { children: [
|
|
2107
|
+
/* @__PURE__ */ E(ye, { children: p("modal.chatProfile.aboutSection") }),
|
|
2108
|
+
ge && (r ? /* @__PURE__ */ E(
|
|
2109
|
+
jn,
|
|
2110
|
+
{
|
|
2111
|
+
"aria-label": p("modal.chatProfile.description"),
|
|
2112
|
+
value: i,
|
|
2113
|
+
maxLength: 2e3,
|
|
2114
|
+
onChange: (T) => u(T.target.value)
|
|
2115
|
+
}
|
|
2116
|
+
) : /* @__PURE__ */ E(en, { $empty: !R?.description, children: R?.description || p("modal.profile.noDescription") })),
|
|
2117
|
+
r && Ke && /* @__PURE__ */ j(Un, { children: [
|
|
2118
|
+
/* @__PURE__ */ E(
|
|
2119
|
+
ee,
|
|
2120
|
+
{
|
|
2121
|
+
variant: "outlined",
|
|
2122
|
+
text: p("action.cancel"),
|
|
2123
|
+
disabled: y,
|
|
2124
|
+
onClick: () => o(!1)
|
|
2125
|
+
}
|
|
2126
|
+
),
|
|
2127
|
+
/* @__PURE__ */ E(
|
|
2128
|
+
ee,
|
|
2129
|
+
{
|
|
2130
|
+
variant: "filled",
|
|
2131
|
+
text: p("action.save"),
|
|
2132
|
+
loading: y,
|
|
2133
|
+
disabled: !e.trim() || y,
|
|
2134
|
+
onClick: ar
|
|
2135
|
+
}
|
|
2136
|
+
)
|
|
2137
|
+
] }),
|
|
2138
|
+
He && /* @__PURE__ */ j(tn, { children: [
|
|
2139
|
+
/* @__PURE__ */ E(Ir, { color: "currentColor" }),
|
|
2140
|
+
p(
|
|
2141
|
+
R.type === "group" ? "modal.chatProfile.typeGroup" : R.type === "private" ? "modal.chatProfile.typePrivate" : "modal.chatProfile.typePublic"
|
|
2142
|
+
)
|
|
2143
|
+
] })
|
|
2144
|
+
] }),
|
|
2145
|
+
Lr(F) && /* @__PURE__ */ E(ce, { children: /* @__PURE__ */ E(ze, { children: /* @__PURE__ */ E(
|
|
2146
|
+
Yr,
|
|
2147
|
+
{
|
|
2148
|
+
label: p("search.messages.title"),
|
|
2149
|
+
onClick: () => q(we(Je.MESSAGE_SEARCH))
|
|
2150
|
+
}
|
|
2151
|
+
) }) }),
|
|
2152
|
+
Y && /* @__PURE__ */ j(ce, { children: [
|
|
2153
|
+
/* @__PURE__ */ E(ye, { children: p("modal.chatProfile.notifications") }),
|
|
2154
|
+
/* @__PURE__ */ E(ze, { children: /* @__PURE__ */ j(
|
|
2155
|
+
Hr,
|
|
2156
|
+
{
|
|
2157
|
+
style: {
|
|
2158
|
+
flexDirection: "row",
|
|
2159
|
+
justifyContent: "space-between",
|
|
2160
|
+
alignItems: "center"
|
|
2161
|
+
},
|
|
2162
|
+
children: [
|
|
2163
|
+
/* @__PURE__ */ E(et, { children: p(J ? "action.unmute" : "action.mute") }),
|
|
2164
|
+
/* @__PURE__ */ E(
|
|
2165
|
+
Br,
|
|
2166
|
+
{
|
|
2167
|
+
checked: J,
|
|
2168
|
+
onToggle: (T) => {
|
|
2169
|
+
te(T);
|
|
2170
|
+
},
|
|
2171
|
+
bgColor: F?.colors?.primary
|
|
2172
|
+
}
|
|
2173
|
+
)
|
|
2174
|
+
]
|
|
2175
|
+
}
|
|
2176
|
+
) })
|
|
2177
|
+
] }),
|
|
2178
|
+
!F?.disableChatInfo?.hideMembers && /* @__PURE__ */ j(ce, { children: [
|
|
2179
|
+
/* @__PURE__ */ E(tt, { children: /* @__PURE__ */ E(ye, { children: p("modal.chatProfile.membersSection") }) }),
|
|
2180
|
+
z.length > 0 && /* @__PURE__ */ j(Wr, { children: [
|
|
2181
|
+
/* @__PURE__ */ E(kr, { color: "currentColor", height: "18px" }),
|
|
2182
|
+
/* @__PURE__ */ E(
|
|
2183
|
+
Kr,
|
|
2184
|
+
{
|
|
2185
|
+
type: "text",
|
|
2186
|
+
value: Q,
|
|
2187
|
+
onChange: me,
|
|
2188
|
+
placeholder: p("modal.chatProfile.searchMembers"),
|
|
2189
|
+
"aria-label": p("modal.chatProfile.searchMembers")
|
|
2190
|
+
}
|
|
2191
|
+
)
|
|
2192
|
+
] }),
|
|
2193
|
+
d ? /* @__PURE__ */ E(Ue, {}) : /* @__PURE__ */ j(Gr, { children: [
|
|
2194
|
+
X.map((T) => /* @__PURE__ */ E(
|
|
2195
|
+
kn,
|
|
2196
|
+
{
|
|
2197
|
+
member: T,
|
|
2198
|
+
isLast: !0,
|
|
2199
|
+
disableClick: !!F?.disableChatInfo?.disableMembers,
|
|
2200
|
+
online: _.has(T.xmppUsername),
|
|
2201
|
+
showMenu: ne.xmppUsername !== T.xmppUsername && R.role === "moderator" && R.type !== "private" && !le,
|
|
2202
|
+
menuOptions: sr(T.xmppUsername),
|
|
2203
|
+
moreOptionsLabel: p("action.moreOptions"),
|
|
2204
|
+
onAvatarClick: ir
|
|
2205
|
+
},
|
|
2206
|
+
Nr(T) || T._id
|
|
2207
|
+
)),
|
|
2208
|
+
L && /* @__PURE__ */ E(et, { children: p("modal.chatProfile.membersLoadingAll") }),
|
|
2209
|
+
ie && /* @__PURE__ */ E(
|
|
2210
|
+
rt,
|
|
2211
|
+
{
|
|
2212
|
+
type: "button",
|
|
2213
|
+
onClick: () => g(
|
|
2214
|
+
(T) => T + zn
|
|
2215
|
+
),
|
|
2216
|
+
children: p("modal.chatProfile.membersShowMore", {
|
|
2217
|
+
count: b.length - k
|
|
2218
|
+
})
|
|
2219
|
+
}
|
|
2220
|
+
)
|
|
2221
|
+
] })
|
|
2222
|
+
] }),
|
|
2223
|
+
/* @__PURE__ */ j(ce, { children: [
|
|
2224
|
+
/* @__PURE__ */ j(tt, { children: [
|
|
2225
|
+
/* @__PURE__ */ E(ye, { children: p("modal.chatProfile.filesTitle") }),
|
|
2226
|
+
se.length > 6 && /* @__PURE__ */ E(
|
|
2227
|
+
rt,
|
|
2228
|
+
{
|
|
2229
|
+
type: "button",
|
|
2230
|
+
onClick: () => A((T) => !T),
|
|
2231
|
+
"aria-expanded": O,
|
|
2232
|
+
children: p(O ? "modal.chatProfile.filesShowLess" : "modal.chatProfile.filesShowAll")
|
|
2233
|
+
}
|
|
2234
|
+
)
|
|
2235
|
+
] }),
|
|
2236
|
+
Wt && se.length === 0 ? /* @__PURE__ */ E(Ue, {}) : Kt && se.length === 0 ? /* @__PURE__ */ j(nt, { $compact: !0, children: [
|
|
2237
|
+
/* @__PURE__ */ E(
|
|
2238
|
+
Ve,
|
|
2239
|
+
{
|
|
2240
|
+
color: "var(--ethora-color-text-muted, #8c8c8c)",
|
|
2241
|
+
fill: "var(--ethora-color-bg-subtle, #f5f7fa)"
|
|
2242
|
+
}
|
|
2243
|
+
),
|
|
2244
|
+
/* @__PURE__ */ E(ot, { children: p("files.error.title") })
|
|
2245
|
+
] }) : se.length === 0 ? /* @__PURE__ */ j(nt, { $compact: !0, children: [
|
|
2246
|
+
/* @__PURE__ */ E(
|
|
2247
|
+
Ve,
|
|
2248
|
+
{
|
|
2249
|
+
color: "var(--ethora-color-text-muted, #8c8c8c)",
|
|
2250
|
+
fill: "var(--ethora-color-bg-subtle, #f5f7fa)"
|
|
2251
|
+
}
|
|
2252
|
+
),
|
|
2253
|
+
/* @__PURE__ */ E(ot, { children: p("modal.chatProfile.filesEmpty") })
|
|
2254
|
+
] }) : /* @__PURE__ */ E(
|
|
2255
|
+
$r,
|
|
2256
|
+
{
|
|
2257
|
+
items: Xt,
|
|
2258
|
+
fileToken: oe,
|
|
2259
|
+
onPreview: Jt,
|
|
2260
|
+
onDownload: Vt,
|
|
2261
|
+
onDelete: Zt,
|
|
2262
|
+
compact: !0
|
|
2263
|
+
}
|
|
2264
|
+
)
|
|
2265
|
+
] }),
|
|
2266
|
+
nr && /* @__PURE__ */ E(ce, { children: /* @__PURE__ */ E(
|
|
2267
|
+
ee,
|
|
2268
|
+
{
|
|
2269
|
+
variant: "outlined",
|
|
2270
|
+
tone: "danger",
|
|
2271
|
+
StartIcon: /* @__PURE__ */ E(jr, {}),
|
|
2272
|
+
text: p("action.deleteChat"),
|
|
2273
|
+
style: { width: "100%" },
|
|
2274
|
+
onClick: () => l(!0)
|
|
2275
|
+
}
|
|
2276
|
+
) }),
|
|
2277
|
+
/* @__PURE__ */ E(
|
|
2278
|
+
Pn,
|
|
2279
|
+
{
|
|
2280
|
+
isVisible: c,
|
|
2281
|
+
setVisible: f,
|
|
2282
|
+
chatJid: R.jid
|
|
2283
|
+
}
|
|
2284
|
+
),
|
|
2285
|
+
/* @__PURE__ */ E(
|
|
2286
|
+
Sn,
|
|
2287
|
+
{
|
|
2288
|
+
isModalOpen: t,
|
|
2289
|
+
setIsModalOpen: l
|
|
2290
|
+
}
|
|
2291
|
+
)
|
|
2292
|
+
]
|
|
2293
|
+
}
|
|
2294
|
+
);
|
|
2295
|
+
};
|
|
2296
|
+
export {
|
|
2297
|
+
Wn as default
|
|
2298
|
+
};
|