@alexsun-top/opencode-chat-room 0.8.1 → 0.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -0
- package/README.md +18 -62
- package/README.zh-CN.md +25 -69
- package/dist/cli.js +1008 -274
- package/package.json +10 -7
- package/packages/chat-room-channeld/README.md +42 -15
- package/packages/chat-room-channeld/dist/mock-adapter.js +5 -5
- package/packages/chat-room-channeld/src/adapter.ts +150 -7
- package/packages/chat-room-channeld/src/cli.ts +72 -5
- package/packages/chat-room-channeld/src/host.ts +41 -11
- package/packages/chat-room-channeld/src/inbound.ts +13 -4
- package/packages/chat-room-channeld/src/pg/database.ts +187 -0
- package/packages/chat-room-channeld/src/pg/migrate.ts +150 -0
- package/packages/chat-room-channeld/src/pg/schema.ts +60 -0
- package/packages/chat-room-channeld/src/pg/sql.mjs +175 -0
- package/packages/chat-room-channeld/src/pg/sqlite.ts +100 -0
- package/packages/chat-room-channeld/src/pg/worker.mjs +133 -0
- package/packages/chat-room-channeld/src/protocol.ts +53 -1
- package/packages/chat-room-channeld/src/rules.ts +7 -2
- package/packages/chat-room-channeld/src/state.ts +73 -97
- package/packages/chat-room-channeld/src/stats.ts +140 -109
- package/plugin.ts +1 -1
- package/server/assets/base.css +11 -3
- package/server/assets/chat/admin-badge.js +32 -30
- package/server/assets/chat/admin.js +198 -163
- package/server/assets/chat/announcements.js +295 -210
- package/server/assets/chat/attachment-store.js +106 -75
- package/server/assets/chat/attachments.js +686 -441
- package/server/assets/chat/chat-background.js +206 -0
- package/server/assets/chat/clipboard.js +44 -25
- package/server/assets/chat/confirm-dialog.js +36 -34
- package/server/assets/chat/copy-action.js +40 -40
- package/server/assets/chat/create-room-dialog.js +50 -48
- package/server/assets/chat/diagram-viewer.js +293 -228
- package/server/assets/chat/doc-preview.js +510 -388
- package/server/assets/chat/editor.js +423 -335
- package/server/assets/chat/events.js +637 -502
- package/server/assets/chat/files.js +476 -426
- package/server/assets/chat/history-loader.js +79 -73
- package/server/assets/chat/icons.js +9 -11
- package/server/assets/chat/image-zoom.js +239 -169
- package/server/assets/chat/index.js +6 -5
- package/server/assets/chat/install-prompt.js +86 -66
- package/server/assets/chat/integration-account-schema.js +101 -0
- package/server/assets/chat/integration-editor.js +162 -153
- package/server/assets/chat/integration-values.js +109 -100
- package/server/assets/chat/integrations.js +696 -479
- package/server/assets/chat/join-requests.js +408 -358
- package/server/assets/chat/locales/de.js +193 -194
- package/server/assets/chat/locales/es.js +193 -194
- package/server/assets/chat/locales/fr.js +193 -194
- package/server/assets/chat/locales/index.js +1 -2
- package/server/assets/chat/locales/it.js +193 -194
- package/server/assets/chat/locales/ja.js +193 -193
- package/server/assets/chat/locales/ko.js +193 -193
- package/server/assets/chat/markdown-footnotes.js +134 -102
- package/server/assets/chat/markdown.js +553 -386
- package/server/assets/chat/members.js +236 -197
- package/server/assets/chat/mentions.js +157 -133
- package/server/assets/chat/message-cache.js +40 -33
- package/server/assets/chat/message-polling.js +280 -227
- package/server/assets/chat/message-window.js +74 -55
- package/server/assets/chat/messages.js +552 -479
- package/server/assets/chat/office-preview.js +46 -45
- package/server/assets/chat/palette.js +450 -412
- package/server/assets/chat/panels.js +94 -58
- package/server/assets/chat/pwa.js +144 -73
- package/server/assets/chat/questions.js +372 -302
- package/server/assets/chat/recall.js +320 -273
- package/server/assets/chat/receipts.js +149 -122
- package/server/assets/chat/reminders.js +331 -216
- package/server/assets/chat/replies.js +165 -136
- package/server/assets/chat/resource-format.js +59 -62
- package/server/assets/chat/room-list.js +58 -55
- package/server/assets/chat/room-watcher.js +72 -50
- package/server/assets/chat/rooms.js +623 -505
- package/server/assets/chat/search.js +136 -114
- package/server/assets/chat/settings.js +229 -140
- package/server/assets/chat/shiki.js +61 -62
- package/server/assets/chat/shortcuts.js +212 -190
- package/server/assets/chat/side-pane.js +166 -131
- package/server/assets/chat/state.js +851 -707
- package/server/assets/chat/system-events.js +55 -27
- package/server/assets/chat/system-messages.js +59 -49
- package/server/assets/chat/task-form.js +178 -182
- package/server/assets/chat/task-row.js +158 -155
- package/server/assets/chat/tasks.js +653 -593
- package/server/assets/chat/viewport.js +32 -29
- package/server/assets/chat/window-controls.js +37 -0
- package/server/assets/code-highlight.css +22 -6
- package/server/assets/conversation.css +65 -16
- package/server/assets/doc-preview.css +6 -1
- package/server/assets/files.css +3 -0
- package/server/assets/monaco/integration-rules.css +1 -1
- package/server/assets/monaco/integration-rules.js +841 -533
- package/server/assets/responsive.css +32 -2
- package/server/assets/settings.css +117 -13
- package/server/assets/window-controls.css +36 -0
- package/server/channel-attachments.ts +133 -0
- package/server/channel-integration.ts +79 -26
- package/server/channels.ts +15 -5
- package/server/chat-server.ts +9 -1
- package/server/chat.html +73 -38
- package/server/manifest.webmanifest +1 -0
- package/server/routes/pages.ts +7 -5
- package/server/sw.js +346 -267
- package/src/center/center-client.ts +1 -1
- package/src/state/pg-database.ts +5 -5
- package/src/state/pg-migrate.ts +7 -7
- package/src/state/pg-worker.mjs +2 -17
- package/src/state/sqlite-database.ts +14 -5
- package/src/state/sqlite-rooms.ts +130 -23
- package/src/state/sqlite-state-store.ts +6 -5
- package/src/state/sqlite.ts +3 -3
- package/src/web/integration-rules-editor.ts +141 -5
- package/src/web/integration-rules.ts +6 -2
- package/src/web/integration-schema.ts +7 -6
- package/packages/chat-room-channeld/dist/feishu-adapter.js +0 -1262
- package/packages/chat-room-channeld/src/feishu-adapter.ts +0 -303
- package/packages/chat-room-channeld/src/feishu-card.ts +0 -27
- package/packages/chat-room-channeld/src/feishu-inbound.ts +0 -158
- package/packages/chat-room-channeld/src/feishu-live.ts +0 -355
- package/packages/chat-room-channeld/src/feishu-send.ts +0 -342
- package/packages/chat-room-channeld/src/feishu-ws-frames.ts +0 -173
- package/server/assets/chat/forward.js +0 -69
|
@@ -1,378 +1,428 @@
|
|
|
1
1
|
import { LS } from "./state.js";
|
|
2
2
|
import { isRoomAdmin } from "./admin-badge.js";
|
|
3
|
-
|
|
4
3
|
// Pending join state is browser-local; the server remains authoritative.
|
|
5
4
|
export function initJoinRequests(app) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
app.setText(title, "joinPendingTitle");
|
|
26
|
-
app.setText(body, "joinPendingBody", { name: roomName });
|
|
27
|
-
app.setText(hint, "joinPendingHint");
|
|
28
|
-
app.setText(noticeText, "joinPendingNotice", { name: roomName });
|
|
29
|
-
notice.hidden = $("#chatView").hidden;
|
|
30
|
-
hint.hidden = false;
|
|
31
|
-
card.hidden = false;
|
|
32
|
-
$("#joinError").hidden = true;
|
|
33
|
-
renderPendingActions();
|
|
34
|
-
app.renderRoomOptions($("#roomList"), app.state.availableRooms || []);
|
|
35
|
-
app.renderRoomOptions($("#roomListChat"), app.state.availableRooms || []);
|
|
36
|
-
scheduleCheck();
|
|
37
|
-
if ($("#joinView").hidden) return;
|
|
38
|
-
title.focus({ preventScroll: true });
|
|
39
|
-
card.scrollIntoView({ block: "nearest" });
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
function renderPendingActions() {
|
|
43
|
-
const waiting = pending.status === "pending";
|
|
44
|
-
const gone = pending.status === "gone";
|
|
45
|
-
$("#btnJoinPendingStop").hidden = !waiting;
|
|
46
|
-
$("#btnJoinPendingAgain").hidden = waiting || gone;
|
|
47
|
-
$("#btnJoinNoticeStop").hidden = !waiting;
|
|
48
|
-
$("#btnJoinNoticeAgain").hidden = waiting || gone;
|
|
49
|
-
$("#btnJoinPendingStop").disabled = Boolean(pending.cancelling);
|
|
50
|
-
$("#btnJoinNoticeStop").disabled = Boolean(pending.cancelling);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function closePending(keepWaiting = false) {
|
|
54
|
-
clearTimeout(pending.timer);
|
|
55
|
-
pending.timer = 0;
|
|
56
|
-
pending.cancelling = false;
|
|
57
|
-
pending.generation++;
|
|
58
|
-
card.hidden = true;
|
|
59
|
-
notice.hidden = true;
|
|
60
|
-
if (!keepWaiting) {
|
|
61
|
-
pending.roomId = "";
|
|
62
|
-
pending.name = "";
|
|
63
|
-
pending.status = "";
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
function scheduleCheck(delay = 4000) {
|
|
68
|
-
clearTimeout(pending.timer);
|
|
69
|
-
if (!pending.roomId || pending.status !== "pending") return;
|
|
70
|
-
pending.timer = setTimeout(() => void checkPending(), delay);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
async function checkPending() {
|
|
74
|
-
if (pending.checking || !pending.roomId || pending.status !== "pending") return;
|
|
75
|
-
if (document.hidden) { scheduleCheck(); return; }
|
|
76
|
-
const generation = pending.generation, roomId = pending.roomId;
|
|
77
|
-
pending.checking = true;
|
|
78
|
-
try {
|
|
79
|
-
const result = await app.api(`/rooms/${encodeURIComponent(roomId)}/join-requests/status?sessionID=${encodeURIComponent(LS.sessionID)}`);
|
|
80
|
-
if (generation !== pending.generation) return;
|
|
81
|
-
if (result.status === "joined") {
|
|
82
|
-
const name = pending.name || LS.name;
|
|
83
|
-
pendingIds.delete(roomId);
|
|
84
|
-
closePending();
|
|
85
|
-
void app.joinRoom(roomId, name);
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
if (result.status === "pending") {
|
|
5
|
+
const $ = app.$;
|
|
6
|
+
const pendingIds = (app.state.pendingJoinIds ??= new Set());
|
|
7
|
+
let pending = { roomId: "", name: "", status: "", timer: 0, generation: 0, checking: false, cancelling: false };
|
|
8
|
+
let requests = [], requestsRoomId = "", requestsGeneration = 0, requestsLoading = false, loadingRoomId = "", deniedRoomId = "";
|
|
9
|
+
let requestSignature = "";
|
|
10
|
+
const panel = $("#memberPanel"), section = $("#joinRequests"), list = $("#joinRequestList");
|
|
11
|
+
const card = $("#joinPending"), title = $("#joinPendingTitle"), body = $("#joinPendingBody"), hint = $("#joinPendingHint");
|
|
12
|
+
const notice = $("#joinNotice"), noticeText = $("#joinNoticeText");
|
|
13
|
+
const roomNameFor = (roomId) => app.state.availableRooms?.find((item) => item.id === roomId)?.name
|
|
14
|
+
|| app.state.rooms.get(roomId)?.room.name || roomId;
|
|
15
|
+
const approveText = (request) => app.t("joinRequestApproveLabel", { name: request.name });
|
|
16
|
+
const denyText = (request) => app.t("joinRequestDenyLabel", { name: request.name });
|
|
17
|
+
app.showJoinPending = (roomId, name) => {
|
|
18
|
+
clearTimeout(pending.timer);
|
|
19
|
+
pending = { roomId, name, status: "pending", timer: 0, generation: pending.generation + 1, checking: false, cancelling: false };
|
|
20
|
+
pendingIds.add(roomId);
|
|
21
|
+
const roomName = roomNameFor(roomId);
|
|
22
|
+
app.setText(title, "joinPendingTitle");
|
|
23
|
+
app.setText(body, "joinPendingBody", { name: roomName });
|
|
89
24
|
app.setText(hint, "joinPendingHint");
|
|
90
|
-
|
|
91
|
-
scheduleCheck();
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
pendingIds.delete(roomId);
|
|
95
|
-
pending.status = "none";
|
|
96
|
-
app.setText(title, "joinPendingGoneTitle");
|
|
97
|
-
app.setText(body, "joinPendingGoneBody");
|
|
98
|
-
app.setText(noticeText, "joinPendingGoneBody");
|
|
99
|
-
notice.hidden = $("#chatView").hidden;
|
|
100
|
-
hint.hidden = true;
|
|
101
|
-
renderPendingActions();
|
|
102
|
-
renderRoomLists();
|
|
103
|
-
rethrowFocus($("#joinView").hidden ? $("#btnJoinNoticeAgain") : $("#btnJoinPendingAgain"));
|
|
104
|
-
} catch (error) {
|
|
105
|
-
if (generation !== pending.generation) return;
|
|
106
|
-
if (error.status === 404) {
|
|
107
|
-
pendingIds.delete(roomId);
|
|
108
|
-
pending.status = "gone";
|
|
109
|
-
app.setText(title, "joinPendingGoneTitle");
|
|
110
|
-
app.setText(body, "joinPendingRoomGone");
|
|
111
|
-
app.setText(noticeText, "joinPendingRoomGone");
|
|
25
|
+
app.setText(noticeText, "joinPendingNotice", { name: roomName });
|
|
112
26
|
notice.hidden = $("#chatView").hidden;
|
|
113
|
-
hint.hidden = true;
|
|
114
|
-
renderPendingActions();
|
|
115
|
-
renderRoomLists();
|
|
116
|
-
} else {
|
|
117
|
-
app.setText(hint, "joinPendingError");
|
|
118
27
|
hint.hidden = false;
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
notice.hidden = $("#chatView").hidden;
|
|
140
|
-
hint.hidden = false;
|
|
141
|
-
} else if (pending.status === "none") {
|
|
142
|
-
app.setText(title, "joinPendingGoneTitle");
|
|
143
|
-
app.setText(body, "joinPendingGoneBody");
|
|
144
|
-
app.setText(noticeText, "joinPendingGoneBody");
|
|
145
|
-
notice.hidden = $("#chatView").hidden;
|
|
146
|
-
hint.hidden = true;
|
|
147
|
-
} else if (pending.status === "gone") {
|
|
148
|
-
app.setText(title, "joinPendingGoneTitle");
|
|
149
|
-
app.setText(body, "joinPendingRoomGone");
|
|
150
|
-
app.setText(noticeText, "joinPendingRoomGone");
|
|
151
|
-
notice.hidden = $("#chatView").hidden;
|
|
152
|
-
hint.hidden = true;
|
|
28
|
+
card.hidden = false;
|
|
29
|
+
$("#joinError").hidden = true;
|
|
30
|
+
renderPendingActions();
|
|
31
|
+
app.renderRoomOptions($("#roomList"), app.state.availableRooms || []);
|
|
32
|
+
app.renderRoomOptions($("#roomListChat"), app.state.availableRooms || []);
|
|
33
|
+
scheduleCheck();
|
|
34
|
+
if ($("#joinView").hidden)
|
|
35
|
+
return;
|
|
36
|
+
title.focus({ preventScroll: true });
|
|
37
|
+
card.scrollIntoView({ block: "nearest" });
|
|
38
|
+
};
|
|
39
|
+
function renderPendingActions() {
|
|
40
|
+
const waiting = pending.status === "pending";
|
|
41
|
+
const gone = pending.status === "gone";
|
|
42
|
+
$("#btnJoinPendingStop").hidden = !waiting;
|
|
43
|
+
$("#btnJoinPendingAgain").hidden = waiting || gone;
|
|
44
|
+
$("#btnJoinNoticeStop").hidden = !waiting;
|
|
45
|
+
$("#btnJoinNoticeAgain").hidden = waiting || gone;
|
|
46
|
+
$("#btnJoinPendingStop").disabled = Boolean(pending.cancelling);
|
|
47
|
+
$("#btnJoinNoticeStop").disabled = Boolean(pending.cancelling);
|
|
153
48
|
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
if (!room || room.kind === "direct" || room.joinPolicy !== "approval" || !isRoomAdmin(app) || deniedRoomId === room.id) {
|
|
167
|
-
requestsGeneration++;
|
|
168
|
-
requests = []; requestsRoomId = ""; requestSignature = "";
|
|
169
|
-
renderRequests();
|
|
170
|
-
return;
|
|
49
|
+
function closePending(keepWaiting = false) {
|
|
50
|
+
clearTimeout(pending.timer);
|
|
51
|
+
pending.timer = 0;
|
|
52
|
+
pending.cancelling = false;
|
|
53
|
+
pending.generation++;
|
|
54
|
+
card.hidden = true;
|
|
55
|
+
notice.hidden = true;
|
|
56
|
+
if (!keepWaiting) {
|
|
57
|
+
pending.roomId = "";
|
|
58
|
+
pending.name = "";
|
|
59
|
+
pending.status = "";
|
|
60
|
+
}
|
|
171
61
|
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
loadingRoomId = roomId;
|
|
178
|
-
try {
|
|
179
|
-
const data = await app.api(`/rooms/${encodeURIComponent(roomId)}/join-requests?sessionID=${encodeURIComponent(LS.sessionID)}`);
|
|
180
|
-
if (generation !== requestsGeneration || app.state.room?.id !== roomId) return;
|
|
181
|
-
requestsRoomId = roomId;
|
|
182
|
-
requests = Array.isArray(data.requests)
|
|
183
|
-
? data.requests.filter((request) => request && typeof request.sessionID === "string" && request.sessionID && typeof request.name === "string")
|
|
184
|
-
: [];
|
|
185
|
-
renderRequests();
|
|
186
|
-
} catch (error) {
|
|
187
|
-
if (generation !== requestsGeneration || app.state.room?.id !== roomId) return;
|
|
188
|
-
if (error.status === 403) { deniedRoomId = roomId; requests = []; renderRequests(); }
|
|
189
|
-
else $("#joinRequestsStatus").textContent = app.t("joinRequestsLoadFailed");
|
|
190
|
-
} finally {
|
|
191
|
-
if (loadingRoomId === roomId) { requestsLoading = false; loadingRoomId = ""; }
|
|
62
|
+
function scheduleCheck(delay = 4000) {
|
|
63
|
+
clearTimeout(pending.timer);
|
|
64
|
+
if (!pending.roomId || pending.status !== "pending")
|
|
65
|
+
return;
|
|
66
|
+
pending.timer = setTimeout(() => void checkPending(), delay);
|
|
192
67
|
}
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
68
|
+
async function checkPending() {
|
|
69
|
+
if (pending.checking || !pending.roomId || pending.status !== "pending")
|
|
70
|
+
return;
|
|
71
|
+
if (document.hidden) {
|
|
72
|
+
scheduleCheck();
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const generation = pending.generation, roomId = pending.roomId;
|
|
76
|
+
pending.checking = true;
|
|
77
|
+
try {
|
|
78
|
+
const result = await app.api(`/rooms/${encodeURIComponent(roomId)}/join-requests/status?sessionID=${encodeURIComponent(LS.sessionID)}`);
|
|
79
|
+
if (generation !== pending.generation)
|
|
80
|
+
return;
|
|
81
|
+
if (result.status === "joined") {
|
|
82
|
+
const name = pending.name || LS.name;
|
|
83
|
+
pendingIds.delete(roomId);
|
|
84
|
+
closePending();
|
|
85
|
+
void app.joinRoom(roomId, name);
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
if (result.status === "pending") {
|
|
89
|
+
app.setText(hint, "joinPendingHint");
|
|
90
|
+
hint.hidden = false;
|
|
91
|
+
scheduleCheck();
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
pendingIds.delete(roomId);
|
|
95
|
+
pending.status = "none";
|
|
96
|
+
app.setText(title, "joinPendingGoneTitle");
|
|
97
|
+
app.setText(body, "joinPendingGoneBody");
|
|
98
|
+
app.setText(noticeText, "joinPendingGoneBody");
|
|
99
|
+
notice.hidden = $("#chatView").hidden;
|
|
100
|
+
hint.hidden = true;
|
|
101
|
+
renderPendingActions();
|
|
102
|
+
renderRoomLists();
|
|
103
|
+
rethrowFocus($("#joinView").hidden ? $("#btnJoinNoticeAgain") : $("#btnJoinPendingAgain"));
|
|
104
|
+
}
|
|
105
|
+
catch (error) {
|
|
106
|
+
if (generation !== pending.generation)
|
|
107
|
+
return;
|
|
108
|
+
if (error.status === 404) {
|
|
109
|
+
pendingIds.delete(roomId);
|
|
110
|
+
pending.status = "gone";
|
|
111
|
+
app.setText(title, "joinPendingGoneTitle");
|
|
112
|
+
app.setText(body, "joinPendingRoomGone");
|
|
113
|
+
app.setText(noticeText, "joinPendingRoomGone");
|
|
114
|
+
notice.hidden = $("#chatView").hidden;
|
|
115
|
+
hint.hidden = true;
|
|
116
|
+
renderPendingActions();
|
|
117
|
+
renderRoomLists();
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
app.setText(hint, "joinPendingError");
|
|
121
|
+
hint.hidden = false;
|
|
122
|
+
scheduleCheck(8000);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
finally {
|
|
126
|
+
pending.checking = false;
|
|
127
|
+
}
|
|
203
128
|
}
|
|
204
|
-
|
|
205
|
-
|
|
129
|
+
function rethrowFocus(element) {
|
|
130
|
+
if (!element || element.hidden)
|
|
131
|
+
return;
|
|
132
|
+
element.focus({ preventScroll: true });
|
|
206
133
|
}
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
134
|
+
function renderPendingCopy() {
|
|
135
|
+
if (!pending.roomId)
|
|
136
|
+
return;
|
|
137
|
+
const roomName = roomNameFor(pending.roomId);
|
|
138
|
+
if (pending.status === "pending") {
|
|
139
|
+
app.setText(title, "joinPendingTitle");
|
|
140
|
+
app.setText(body, "joinPendingBody", { name: roomName });
|
|
141
|
+
app.setText(hint, "joinPendingHint");
|
|
142
|
+
app.setText(noticeText, "joinPendingNotice", { name: roomName });
|
|
143
|
+
notice.hidden = $("#chatView").hidden;
|
|
144
|
+
hint.hidden = false;
|
|
145
|
+
}
|
|
146
|
+
else if (pending.status === "none") {
|
|
147
|
+
app.setText(title, "joinPendingGoneTitle");
|
|
148
|
+
app.setText(body, "joinPendingGoneBody");
|
|
149
|
+
app.setText(noticeText, "joinPendingGoneBody");
|
|
150
|
+
notice.hidden = $("#chatView").hidden;
|
|
151
|
+
hint.hidden = true;
|
|
152
|
+
}
|
|
153
|
+
else if (pending.status === "gone") {
|
|
154
|
+
app.setText(title, "joinPendingGoneTitle");
|
|
155
|
+
app.setText(body, "joinPendingRoomGone");
|
|
156
|
+
app.setText(noticeText, "joinPendingRoomGone");
|
|
157
|
+
notice.hidden = $("#chatView").hidden;
|
|
158
|
+
hint.hidden = true;
|
|
159
|
+
}
|
|
160
|
+
renderPendingActions();
|
|
225
161
|
}
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
item.className = "join-request-item"; item.dataset.requestSession = request.sessionID;
|
|
233
|
-
info.className = "join-request-info";
|
|
234
|
-
name.className = "join-request-name"; name.textContent = request.name;
|
|
235
|
-
meta.className = "join-request-meta";
|
|
236
|
-
const time = Number(request.createdAt);
|
|
237
|
-
meta.textContent = app.t("joinRequestTime", { time: app.fmtTime(Number.isFinite(time) && time > 0 ? time : Date.now()) });
|
|
238
|
-
kind.className = `join-request-kind${request.isAgent ? " agent" : ""}`;
|
|
239
|
-
kind.textContent = request.isAgent ? app.t("joinRequestAgent") : app.t("joinRequestHuman");
|
|
240
|
-
info.append(name, kind, meta);
|
|
241
|
-
actions.className = "join-request-actions";
|
|
242
|
-
const approve = actionButton("approve", app.t("joinRequestApprove"), approveText(request));
|
|
243
|
-
const deny = actionButton("deny", app.t("joinRequestDeny"), denyText(request));
|
|
244
|
-
approve.className = "btn primary small"; deny.className = "btn ghost small danger-text";
|
|
245
|
-
approve.addEventListener("click", () => void decide(request, "approve", item, approve, deny));
|
|
246
|
-
deny.addEventListener("click", () => void decide(request, "deny", item, approve, deny));
|
|
247
|
-
actions.append(approve, deny); item.append(info, actions);
|
|
248
|
-
return item;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
function actionButton(action, label, ariaLabel) {
|
|
252
|
-
const button = document.createElement("button");
|
|
253
|
-
button.type = "button"; button.dataset.requestAction = action;
|
|
254
|
-
button.textContent = label; button.setAttribute("aria-label", ariaLabel);
|
|
255
|
-
return button;
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
async function decide(request, action, item, approve, deny) {
|
|
259
|
-
const room = app.state.room;
|
|
260
|
-
if (!room) return;
|
|
261
|
-
const index = requests.findIndex((entry) => entry.sessionID === request.sessionID);
|
|
262
|
-
item.setAttribute("aria-busy", "true"); approve.disabled = true; deny.disabled = true;
|
|
263
|
-
try {
|
|
264
|
-
await app.api(`/rooms/${encodeURIComponent(room.id)}/join-requests/${encodeURIComponent(request.sessionID)}/${action}`, {
|
|
265
|
-
method: "POST", body: JSON.stringify({ sessionID: LS.sessionID }),
|
|
266
|
-
});
|
|
267
|
-
requests = requests.filter((entry) => entry.sessionID !== request.sessionID);
|
|
268
|
-
requestSignature = "";
|
|
269
|
-
app.setText($("#joinRequestsStatus"), action === "approve" ? "joinRequestApproved" : "joinRequestDenied", { name: request.name });
|
|
270
|
-
renderRequests();
|
|
271
|
-
focusAfterRequest(index);
|
|
272
|
-
if (action === "approve") void app.refreshRoomMeta?.();
|
|
273
|
-
} catch (error) {
|
|
274
|
-
if (error.status === 404) {
|
|
275
|
-
requests = requests.filter((entry) => entry.sessionID !== request.sessionID);
|
|
162
|
+
app.refreshJoinRequests = () => void refreshRequests();
|
|
163
|
+
app.clearJoinRequests = () => {
|
|
164
|
+
deniedRoomId = "";
|
|
165
|
+
requestsGeneration++;
|
|
166
|
+
requests = [];
|
|
167
|
+
requestsRoomId = "";
|
|
276
168
|
requestSignature = "";
|
|
277
|
-
app.setText($("#joinRequestsStatus"), "joinRequestAlreadyHandled");
|
|
278
169
|
renderRequests();
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
170
|
+
};
|
|
171
|
+
async function refreshRequests() {
|
|
172
|
+
const room = app.state.room;
|
|
173
|
+
if (deniedRoomId && deniedRoomId !== room?.id)
|
|
174
|
+
deniedRoomId = "";
|
|
175
|
+
if (!room || room.kind === "direct" || room.joinPolicy !== "approval" || !isRoomAdmin(app) || deniedRoomId === room.id) {
|
|
176
|
+
requestsGeneration++;
|
|
177
|
+
requests = [];
|
|
178
|
+
requestsRoomId = "";
|
|
179
|
+
requestSignature = "";
|
|
180
|
+
renderRequests();
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
// A refresh for another room must not be skipped by the previous room's
|
|
184
|
+
// in-flight request, or the list stays empty until the next poll.
|
|
185
|
+
if (requestsLoading && loadingRoomId === room.id)
|
|
186
|
+
return;
|
|
187
|
+
const generation = ++requestsGeneration, roomId = room.id;
|
|
188
|
+
requestsLoading = true;
|
|
189
|
+
loadingRoomId = roomId;
|
|
190
|
+
try {
|
|
191
|
+
const data = await app.api(`/rooms/${encodeURIComponent(roomId)}/join-requests?sessionID=${encodeURIComponent(LS.sessionID)}`);
|
|
192
|
+
if (generation !== requestsGeneration || app.state.room?.id !== roomId)
|
|
193
|
+
return;
|
|
194
|
+
requestsRoomId = roomId;
|
|
195
|
+
requests = Array.isArray(data.requests)
|
|
196
|
+
? data.requests.filter((request) => request && typeof request.sessionID === "string" && request.sessionID && typeof request.name === "string")
|
|
197
|
+
: [];
|
|
198
|
+
renderRequests();
|
|
199
|
+
}
|
|
200
|
+
catch (error) {
|
|
201
|
+
if (generation !== requestsGeneration || app.state.room?.id !== roomId)
|
|
202
|
+
return;
|
|
203
|
+
if (error.status === 403) {
|
|
204
|
+
deniedRoomId = roomId;
|
|
205
|
+
requests = [];
|
|
206
|
+
renderRequests();
|
|
207
|
+
}
|
|
208
|
+
else
|
|
209
|
+
$("#joinRequestsStatus").textContent = app.t("joinRequestsLoadFailed");
|
|
210
|
+
}
|
|
211
|
+
finally {
|
|
212
|
+
if (loadingRoomId === roomId) {
|
|
213
|
+
requestsLoading = false;
|
|
214
|
+
loadingRoomId = "";
|
|
215
|
+
}
|
|
216
|
+
}
|
|
287
217
|
}
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
(
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
218
|
+
function renderRequests() {
|
|
219
|
+
const room = app.state.room;
|
|
220
|
+
const visible = Boolean(room && room.kind !== "direct" && room.joinPolicy === "approval" && isRoomAdmin(app) && deniedRoomId !== room.id);
|
|
221
|
+
section.hidden = !visible;
|
|
222
|
+
if (!visible) {
|
|
223
|
+
list.textContent = "";
|
|
224
|
+
requestSignature = "";
|
|
225
|
+
updateBadge(0);
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
if (requestsRoomId && requestsRoomId !== room.id) {
|
|
229
|
+
requests = [];
|
|
230
|
+
requestsRoomId = room.id;
|
|
231
|
+
requestSignature = "";
|
|
232
|
+
}
|
|
233
|
+
const count = requests.length;
|
|
234
|
+
$("#joinRequestsHint").hidden = !room.adminSessionID;
|
|
235
|
+
$("#joinRequestsEmpty").hidden = count > 0;
|
|
236
|
+
const countNode = $("#joinRequestsCount");
|
|
237
|
+
countNode.textContent = count > 99 ? "99+" : String(count);
|
|
238
|
+
countNode.hidden = !count;
|
|
239
|
+
const signature = `${room.id}\0${app.locale}\0${requests.map((item) => `${item.sessionID}\0${item.name}\0${item.isAgent}\0${item.createdAt}`).join("\u0001")}`;
|
|
240
|
+
if (signature === requestSignature) {
|
|
241
|
+
updateBadge(count);
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
const active = list.contains(document.activeElement)
|
|
245
|
+
? { id: document.activeElement.closest("[data-request-session]")?.dataset.requestSession, action: document.activeElement.dataset.requestAction }
|
|
246
|
+
: undefined;
|
|
247
|
+
requestSignature = signature;
|
|
248
|
+
list.textContent = "";
|
|
249
|
+
for (const request of requests)
|
|
250
|
+
list.append(requestRow(request));
|
|
251
|
+
if (active) {
|
|
252
|
+
const row = list.querySelector(`[data-request-session="${CSS.escape(active.id || "")}"]`);
|
|
253
|
+
const target = row?.querySelector(`[data-request-action="${active.action || ""}"]`);
|
|
254
|
+
target?.focus({ preventScroll: true });
|
|
255
|
+
}
|
|
256
|
+
updateBadge(count);
|
|
257
|
+
}
|
|
258
|
+
function requestRow(request) {
|
|
259
|
+
const item = document.createElement("li"), info = document.createElement("div"), name = document.createElement("span");
|
|
260
|
+
const meta = document.createElement("span"), kind = document.createElement("span"), actions = document.createElement("div");
|
|
261
|
+
item.className = "join-request-item";
|
|
262
|
+
item.dataset.requestSession = request.sessionID;
|
|
263
|
+
info.className = "join-request-info";
|
|
264
|
+
name.className = "join-request-name";
|
|
265
|
+
name.textContent = request.name;
|
|
266
|
+
meta.className = "join-request-meta";
|
|
267
|
+
const time = Number(request.createdAt);
|
|
268
|
+
meta.textContent = app.t("joinRequestTime", { time: app.fmtTime(Number.isFinite(time) && time > 0 ? time : Date.now()) });
|
|
269
|
+
kind.className = `join-request-kind${request.isAgent ? " agent" : ""}`;
|
|
270
|
+
kind.textContent = request.isAgent ? app.t("joinRequestAgent") : app.t("joinRequestHuman");
|
|
271
|
+
info.append(name, kind, meta);
|
|
272
|
+
actions.className = "join-request-actions";
|
|
273
|
+
const approve = actionButton("approve", app.t("joinRequestApprove"), approveText(request));
|
|
274
|
+
const deny = actionButton("deny", app.t("joinRequestDeny"), denyText(request));
|
|
275
|
+
approve.className = "btn primary small";
|
|
276
|
+
deny.className = "btn ghost small danger-text";
|
|
277
|
+
approve.addEventListener("click", () => void decide(request, "approve", item, approve, deny));
|
|
278
|
+
deny.addEventListener("click", () => void decide(request, "deny", item, approve, deny));
|
|
279
|
+
actions.append(approve, deny);
|
|
280
|
+
item.append(info, actions);
|
|
281
|
+
return item;
|
|
282
|
+
}
|
|
283
|
+
function actionButton(action, label, ariaLabel) {
|
|
284
|
+
const button = document.createElement("button");
|
|
285
|
+
button.type = "button";
|
|
286
|
+
button.dataset.requestAction = action;
|
|
287
|
+
button.textContent = label;
|
|
288
|
+
button.setAttribute("aria-label", ariaLabel);
|
|
289
|
+
return button;
|
|
290
|
+
}
|
|
291
|
+
async function decide(request, action, item, approve, deny) {
|
|
292
|
+
const room = app.state.room;
|
|
293
|
+
if (!room)
|
|
294
|
+
return;
|
|
295
|
+
const index = requests.findIndex((entry) => entry.sessionID === request.sessionID);
|
|
296
|
+
item.setAttribute("aria-busy", "true");
|
|
297
|
+
approve.disabled = true;
|
|
298
|
+
deny.disabled = true;
|
|
299
|
+
try {
|
|
300
|
+
await app.api(`/rooms/${encodeURIComponent(room.id)}/join-requests/${encodeURIComponent(request.sessionID)}/${action}`, {
|
|
301
|
+
method: "POST", body: JSON.stringify({ sessionID: LS.sessionID }),
|
|
302
|
+
});
|
|
303
|
+
requests = requests.filter((entry) => entry.sessionID !== request.sessionID);
|
|
304
|
+
requestSignature = "";
|
|
305
|
+
app.setText($("#joinRequestsStatus"), action === "approve" ? "joinRequestApproved" : "joinRequestDenied", { name: request.name });
|
|
306
|
+
renderRequests();
|
|
307
|
+
focusAfterRequest(index);
|
|
308
|
+
if (action === "approve")
|
|
309
|
+
void app.refreshRoomMeta?.();
|
|
310
|
+
}
|
|
311
|
+
catch (error) {
|
|
312
|
+
if (error.status === 404) {
|
|
313
|
+
requests = requests.filter((entry) => entry.sessionID !== request.sessionID);
|
|
314
|
+
requestSignature = "";
|
|
315
|
+
app.setText($("#joinRequestsStatus"), "joinRequestAlreadyHandled");
|
|
316
|
+
renderRequests();
|
|
317
|
+
focusAfterRequest(index);
|
|
318
|
+
}
|
|
319
|
+
else if (error.status === 403) {
|
|
320
|
+
deniedRoomId = room.id;
|
|
321
|
+
requests = [];
|
|
322
|
+
renderRequests();
|
|
323
|
+
}
|
|
324
|
+
else {
|
|
325
|
+
item.removeAttribute("aria-busy");
|
|
326
|
+
approve.disabled = false;
|
|
327
|
+
deny.disabled = false;
|
|
328
|
+
app.setText($("#joinRequestsStatus"), "joinRequestActionFailed", { message: error.message });
|
|
329
|
+
if (error.status === 409)
|
|
330
|
+
void refreshRequests();
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
function focusAfterRequest(index) {
|
|
335
|
+
const rows = [...list.querySelectorAll(".join-request-item")];
|
|
336
|
+
const row = rows[Math.min(index, rows.length - 1)];
|
|
337
|
+
const target = row?.querySelector('[data-request-action="approve"]') || $("#joinRequestsTitle");
|
|
338
|
+
target?.focus({ preventScroll: true });
|
|
339
|
+
}
|
|
340
|
+
function updateBadge(count) {
|
|
341
|
+
const badge = $("#joinRequestBadge"), button = $("#btnMembers");
|
|
342
|
+
$("#joinRequestBadgeCount").textContent = count > 99 ? "99+" : String(count);
|
|
343
|
+
badge.title = count ? app.t("membersWithRequests", { count }) : "";
|
|
344
|
+
badge.hidden = !count;
|
|
345
|
+
button.setAttribute("aria-label", count ? app.t("membersWithRequests", { count }) : app.t("members"));
|
|
346
|
+
}
|
|
347
|
+
function renderRoomLists() {
|
|
348
|
+
app.renderRoomOptions($("#roomList"), app.state.availableRooms || []);
|
|
349
|
+
app.renderRoomOptions($("#roomListChat"), app.state.availableRooms || []);
|
|
350
|
+
}
|
|
351
|
+
async function cancelPending() {
|
|
352
|
+
if (!pending.roomId || pending.status !== "pending" || pending.cancelling)
|
|
353
|
+
return;
|
|
354
|
+
const generation = pending.generation, roomId = pending.roomId;
|
|
355
|
+
pending.cancelling = true;
|
|
336
356
|
renderPendingActions();
|
|
337
|
-
|
|
357
|
+
try {
|
|
358
|
+
await app.api(`/rooms/${encodeURIComponent(roomId)}/join-requests?sessionID=${encodeURIComponent(LS.sessionID)}`, { method: "DELETE", body: "{}" });
|
|
359
|
+
if (generation !== pending.generation)
|
|
360
|
+
return;
|
|
361
|
+
pendingIds.delete(roomId);
|
|
362
|
+
closePending();
|
|
363
|
+
($("#joinView").hidden ? $("#msgInput") : $("#inRoomId"))?.focus({ preventScroll: true });
|
|
364
|
+
}
|
|
365
|
+
catch (error) {
|
|
366
|
+
if (generation !== pending.generation)
|
|
367
|
+
return;
|
|
368
|
+
if (error.status === 404) {
|
|
369
|
+
pendingIds.delete(roomId);
|
|
370
|
+
closePending();
|
|
371
|
+
($("#joinView").hidden ? $("#msgInput") : $("#inRoomId"))?.focus({ preventScroll: true });
|
|
372
|
+
return;
|
|
373
|
+
}
|
|
374
|
+
app.setText(hint, "joinPendingCancelError");
|
|
375
|
+
hint.hidden = false;
|
|
376
|
+
app.setText(noticeText, "joinPendingCancelError");
|
|
377
|
+
notice.hidden = $("#chatView").hidden;
|
|
378
|
+
}
|
|
379
|
+
finally {
|
|
380
|
+
if (generation === pending.generation) {
|
|
381
|
+
pending.cancelling = false;
|
|
382
|
+
renderPendingActions();
|
|
383
|
+
}
|
|
384
|
+
}
|
|
338
385
|
}
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
if (pending.roomId) void app.joinRoom(pending.roomId, pending.name || LS.name);
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
$("#btnJoinPendingStop").addEventListener("click", () => void cancelPending());
|
|
346
|
-
$("#btnJoinNoticeStop").addEventListener("click", () => void cancelPending());
|
|
347
|
-
$("#btnJoinPendingAgain").addEventListener("click", requestAgain);
|
|
348
|
-
$("#btnJoinNoticeAgain").addEventListener("click", requestAgain);
|
|
349
|
-
$("#btnMembers").addEventListener("click", () => {
|
|
350
|
-
setTimeout(() => { if (!$("#memberPanel").hidden) void refreshRequests(); }, 0);
|
|
351
|
-
});
|
|
352
|
-
document.addEventListener("chat-room-activated", (event) => {
|
|
353
|
-
const roomId = event.detail;
|
|
354
|
-
if (pending.roomId === roomId) {
|
|
355
|
-
pendingIds.delete(roomId);
|
|
356
|
-
closePending();
|
|
386
|
+
function requestAgain() {
|
|
387
|
+
if (pending.roomId)
|
|
388
|
+
void app.joinRoom(pending.roomId, pending.name || LS.name);
|
|
357
389
|
}
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
390
|
+
$("#btnJoinPendingStop").addEventListener("click", () => void cancelPending());
|
|
391
|
+
$("#btnJoinNoticeStop").addEventListener("click", () => void cancelPending());
|
|
392
|
+
$("#btnJoinPendingAgain").addEventListener("click", requestAgain);
|
|
393
|
+
$("#btnJoinNoticeAgain").addEventListener("click", requestAgain);
|
|
394
|
+
$("#btnMembers").addEventListener("click", () => {
|
|
395
|
+
setTimeout(() => { if (!$("#memberPanel").hidden)
|
|
396
|
+
void refreshRequests(); }, 0);
|
|
397
|
+
});
|
|
398
|
+
document.addEventListener("chat-room-activated", (event) => {
|
|
399
|
+
const roomId = event.detail;
|
|
400
|
+
if (pending.roomId === roomId) {
|
|
401
|
+
pendingIds.delete(roomId);
|
|
402
|
+
closePending();
|
|
403
|
+
}
|
|
404
|
+
deniedRoomId = "";
|
|
405
|
+
requests = [];
|
|
406
|
+
requestsRoomId = roomId || "";
|
|
407
|
+
requestSignature = "";
|
|
408
|
+
renderRequests();
|
|
409
|
+
void refreshRequests();
|
|
410
|
+
renderRoomLists();
|
|
411
|
+
});
|
|
412
|
+
document.addEventListener("visibilitychange", () => {
|
|
413
|
+
if (document.hidden)
|
|
414
|
+
return;
|
|
415
|
+
if (pending.roomId && pending.status === "pending" && !pending.timer)
|
|
416
|
+
scheduleCheck(0);
|
|
417
|
+
if (!panel.hidden)
|
|
418
|
+
void refreshRequests();
|
|
419
|
+
});
|
|
420
|
+
// Locale changes must relabel rows and the open request card without another round trip.
|
|
421
|
+
const applyLocale = app.applyLocale;
|
|
422
|
+
app.applyLocale = () => {
|
|
423
|
+
applyLocale();
|
|
424
|
+
renderPendingCopy();
|
|
425
|
+
renderRequests();
|
|
426
|
+
};
|
|
374
427
|
renderRequests();
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
renderRequests();
|
|
378
|
-
}
|
|
428
|
+
}
|