@qwanyx/stack 0.1.1 → 0.2.0
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/LICENSE +25 -0
- package/dist/index.cjs.js +11 -11
- package/dist/index.esm.js +1184 -750
- package/package.json +4 -3
- package/dist/api/client.d.ts +0 -53
- package/dist/auth/index.d.ts +0 -34
- package/dist/client/GraphClient.d.ts +0 -79
- package/dist/components/AnimatedCardFlip.d.ts +0 -19
- package/dist/components/Card.d.ts +0 -13
- package/dist/components/Detail.d.ts +0 -15
- package/dist/components/Stack.d.ts +0 -38
- package/dist/hooks/useMutation.d.ts +0 -16
- package/dist/hooks/useQuery.d.ts +0 -18
- package/dist/index.d.ts +0 -25
- package/dist/operations/index.d.ts +0 -51
- package/dist/types/index.d.ts +0 -170
package/dist/index.esm.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import
|
|
5
|
-
class
|
|
6
|
-
constructor(
|
|
7
|
-
|
|
8
|
-
if (!
|
|
1
|
+
var _t = Object.defineProperty;
|
|
2
|
+
var jt = (f, t, r) => t in f ? _t(f, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : f[t] = r;
|
|
3
|
+
var _e = (f, t, r) => jt(f, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
+
import Ze, { useState as L, useCallback as X, useEffect as fe, useMemo as et, useRef as Xe } from "react";
|
|
5
|
+
class $t {
|
|
6
|
+
constructor(t) {
|
|
7
|
+
_e(this, "config");
|
|
8
|
+
if (!t.system_id)
|
|
9
9
|
throw new Error("GraphClient: system_id is REQUIRED. No system_id → No start.");
|
|
10
|
-
this.config =
|
|
10
|
+
this.config = t;
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
13
|
* Call the Graph coprocessor
|
|
14
14
|
*/
|
|
15
|
-
async callGraph(
|
|
16
|
-
const
|
|
15
|
+
async callGraph(t, r = {}) {
|
|
16
|
+
const n = {
|
|
17
17
|
coprocessor: "graph",
|
|
18
|
-
method:
|
|
18
|
+
method: t,
|
|
19
19
|
system_id: this.config.system_id,
|
|
20
|
-
params:
|
|
20
|
+
params: r
|
|
21
21
|
};
|
|
22
22
|
try {
|
|
23
23
|
const i = await fetch(`${this.config.baseUrl}/spu/invoke`, {
|
|
@@ -26,16 +26,16 @@ class Or {
|
|
|
26
26
|
"Content-Type": "application/json",
|
|
27
27
|
Authorization: `Bearer ${this.getToken()}`
|
|
28
28
|
},
|
|
29
|
-
body: JSON.stringify(
|
|
29
|
+
body: JSON.stringify(n)
|
|
30
30
|
});
|
|
31
31
|
if (!i.ok) {
|
|
32
|
-
const
|
|
33
|
-
throw new Error(`API error (${i.status}): ${
|
|
32
|
+
const l = await i.text();
|
|
33
|
+
throw new Error(`API error (${i.status}): ${l}`);
|
|
34
34
|
}
|
|
35
|
-
const
|
|
36
|
-
if (!
|
|
37
|
-
throw new Error(
|
|
38
|
-
return
|
|
35
|
+
const o = await i.json();
|
|
36
|
+
if (!o.success && o.error)
|
|
37
|
+
throw new Error(o.error);
|
|
38
|
+
return o;
|
|
39
39
|
} catch (i) {
|
|
40
40
|
throw console.error("Graph API call failed:", i), i;
|
|
41
41
|
}
|
|
@@ -50,43 +50,43 @@ class Or {
|
|
|
50
50
|
/**
|
|
51
51
|
* Get children nodes
|
|
52
52
|
*/
|
|
53
|
-
async getChildren(
|
|
53
|
+
async getChildren(t) {
|
|
54
54
|
return (await this.callGraph("get_children", {
|
|
55
|
-
parent_id:
|
|
55
|
+
parent_id: t
|
|
56
56
|
})).result || [];
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
59
59
|
* Get a specific node by ID
|
|
60
60
|
*/
|
|
61
|
-
async getNode(
|
|
61
|
+
async getNode(t) {
|
|
62
62
|
return (await this.callGraph("get_node", {
|
|
63
|
-
node_id:
|
|
63
|
+
node_id: t
|
|
64
64
|
})).result || null;
|
|
65
65
|
}
|
|
66
66
|
/**
|
|
67
67
|
* Add a new node
|
|
68
68
|
*/
|
|
69
|
-
async addNode(
|
|
70
|
-
const
|
|
71
|
-
...
|
|
72
|
-
created:
|
|
69
|
+
async addNode(t) {
|
|
70
|
+
const r = {
|
|
71
|
+
...t,
|
|
72
|
+
created: t.created || (/* @__PURE__ */ new Date()).toISOString(),
|
|
73
73
|
modified: (/* @__PURE__ */ new Date()).toISOString()
|
|
74
|
-
},
|
|
75
|
-
if (!
|
|
74
|
+
}, n = await this.callGraph("add_node", r);
|
|
75
|
+
if (!n.result)
|
|
76
76
|
throw new Error("Failed to add node");
|
|
77
|
-
return
|
|
77
|
+
return n.result;
|
|
78
78
|
}
|
|
79
79
|
/**
|
|
80
80
|
* Update an existing node
|
|
81
81
|
*/
|
|
82
|
-
async updateNode(
|
|
83
|
-
const
|
|
84
|
-
node_id:
|
|
82
|
+
async updateNode(t, r) {
|
|
83
|
+
const n = {
|
|
84
|
+
node_id: t,
|
|
85
85
|
updates: {
|
|
86
|
-
...
|
|
86
|
+
...r,
|
|
87
87
|
modified: (/* @__PURE__ */ new Date()).toISOString()
|
|
88
88
|
}
|
|
89
|
-
}, i = await this.callGraph("update_node",
|
|
89
|
+
}, i = await this.callGraph("update_node", n);
|
|
90
90
|
if (!i.result)
|
|
91
91
|
throw new Error("Failed to update node");
|
|
92
92
|
return i.result;
|
|
@@ -94,126 +94,250 @@ class Or {
|
|
|
94
94
|
/**
|
|
95
95
|
* Delete a node
|
|
96
96
|
*/
|
|
97
|
-
async deleteNode(
|
|
97
|
+
async deleteNode(t, r = !1) {
|
|
98
98
|
return (await this.callGraph("delete_node", {
|
|
99
|
-
node_id:
|
|
100
|
-
cascade:
|
|
99
|
+
node_id: t,
|
|
100
|
+
cascade: r
|
|
101
101
|
})).success === !0;
|
|
102
102
|
}
|
|
103
103
|
// ===== EDGE OPERATIONS =====
|
|
104
104
|
/**
|
|
105
105
|
* Get children with edges (supports different display modes)
|
|
106
106
|
*/
|
|
107
|
-
async getChildrenWithEdges(
|
|
107
|
+
async getChildrenWithEdges(t, r = "children", n, i) {
|
|
108
108
|
return (await this.callGraph("get_children_with_edges", {
|
|
109
|
-
node_id:
|
|
110
|
-
display_mode:
|
|
111
|
-
edge_type:
|
|
109
|
+
node_id: t,
|
|
110
|
+
display_mode: r,
|
|
111
|
+
edge_type: n,
|
|
112
112
|
node_type: i
|
|
113
113
|
})).result || [];
|
|
114
114
|
}
|
|
115
115
|
/**
|
|
116
116
|
* Add an edge between two nodes
|
|
117
117
|
*/
|
|
118
|
-
async addEdge(r, n
|
|
118
|
+
async addEdge(t, r, n = "link", i) {
|
|
119
119
|
return await this.callGraph("add_edge", {
|
|
120
|
-
source_id:
|
|
121
|
-
target_id:
|
|
122
|
-
edge_type:
|
|
120
|
+
source_id: t,
|
|
121
|
+
target_id: r,
|
|
122
|
+
edge_type: n,
|
|
123
123
|
data: i
|
|
124
124
|
});
|
|
125
125
|
}
|
|
126
126
|
/**
|
|
127
127
|
* Delete an edge
|
|
128
128
|
*/
|
|
129
|
-
async deleteEdge(r, n
|
|
129
|
+
async deleteEdge(t, r, n) {
|
|
130
130
|
return await this.callGraph("delete_edge", {
|
|
131
|
-
source_id:
|
|
132
|
-
target_id:
|
|
133
|
-
edge_type:
|
|
131
|
+
source_id: t,
|
|
132
|
+
target_id: r,
|
|
133
|
+
edge_type: n
|
|
134
134
|
});
|
|
135
135
|
}
|
|
136
136
|
/**
|
|
137
137
|
* Get edges from a source node
|
|
138
138
|
*/
|
|
139
|
-
async getEdges(
|
|
139
|
+
async getEdges(t, r) {
|
|
140
140
|
return (await this.callGraph("get_edges", {
|
|
141
|
-
source_id:
|
|
142
|
-
edge_type:
|
|
141
|
+
source_id: t,
|
|
142
|
+
edge_type: r
|
|
143
143
|
})).result || [];
|
|
144
144
|
}
|
|
145
145
|
// ===== HIERARCHY OPERATIONS =====
|
|
146
146
|
/**
|
|
147
147
|
* Get ancestors of a node (path from root to node)
|
|
148
148
|
*/
|
|
149
|
-
async getAncestors(
|
|
149
|
+
async getAncestors(t) {
|
|
150
150
|
return (await this.callGraph("get_ancestors", {
|
|
151
|
-
node_id:
|
|
151
|
+
node_id: t
|
|
152
152
|
})).ancestors || [];
|
|
153
153
|
}
|
|
154
154
|
/**
|
|
155
155
|
* Get tree structure starting from a root
|
|
156
156
|
*/
|
|
157
|
-
async getTree(
|
|
157
|
+
async getTree(t, r = 10) {
|
|
158
158
|
return (await this.callGraph("get_tree", {
|
|
159
|
-
root_id:
|
|
160
|
-
max_depth:
|
|
159
|
+
root_id: t,
|
|
160
|
+
max_depth: r
|
|
161
161
|
})).tree || [];
|
|
162
162
|
}
|
|
163
163
|
/**
|
|
164
164
|
* Move a node to a new parent
|
|
165
165
|
*/
|
|
166
|
-
async moveNode(
|
|
167
|
-
const
|
|
168
|
-
node_id:
|
|
169
|
-
new_parent_id:
|
|
166
|
+
async moveNode(t, r) {
|
|
167
|
+
const n = await this.callGraph("move", {
|
|
168
|
+
node_id: t,
|
|
169
|
+
new_parent_id: r
|
|
170
170
|
});
|
|
171
|
-
if (!
|
|
171
|
+
if (!n.node)
|
|
172
172
|
throw new Error("Failed to move node");
|
|
173
|
-
return
|
|
173
|
+
return n.node;
|
|
174
174
|
}
|
|
175
175
|
// ===== SEARCH =====
|
|
176
176
|
/**
|
|
177
177
|
* Search nodes by query
|
|
178
178
|
*/
|
|
179
|
-
async searchNodes(
|
|
179
|
+
async searchNodes(t, r) {
|
|
180
180
|
return (await this.callGraph("search", {
|
|
181
|
-
query:
|
|
182
|
-
type:
|
|
181
|
+
query: t,
|
|
182
|
+
type: r
|
|
183
183
|
})).nodes || [];
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
|
-
|
|
187
|
-
|
|
186
|
+
class Et {
|
|
187
|
+
constructor(t) {
|
|
188
|
+
_e(this, "config");
|
|
189
|
+
if (!t.system_id)
|
|
190
|
+
throw new Error("MailClient: system_id is REQUIRED");
|
|
191
|
+
this.config = t;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Call the Mail coprocessor
|
|
195
|
+
*/
|
|
196
|
+
async callMail(t, r = {}) {
|
|
197
|
+
const n = {
|
|
198
|
+
coprocessor: "mail",
|
|
199
|
+
method: t,
|
|
200
|
+
system_id: this.config.system_id,
|
|
201
|
+
params: {
|
|
202
|
+
user_id: this.config.system_id,
|
|
203
|
+
...r
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
try {
|
|
207
|
+
const i = await fetch(`${this.config.baseUrl}/spu/invoke`, {
|
|
208
|
+
method: "POST",
|
|
209
|
+
headers: {
|
|
210
|
+
"Content-Type": "application/json",
|
|
211
|
+
Authorization: `Bearer ${this.getToken()}`
|
|
212
|
+
},
|
|
213
|
+
body: JSON.stringify(n)
|
|
214
|
+
});
|
|
215
|
+
if (!i.ok) {
|
|
216
|
+
const l = await i.text();
|
|
217
|
+
throw new Error(`API error (${i.status}): ${l}`);
|
|
218
|
+
}
|
|
219
|
+
const o = await i.json();
|
|
220
|
+
if (!o.success && o.error)
|
|
221
|
+
throw new Error(o.error);
|
|
222
|
+
return o.result;
|
|
223
|
+
} catch (i) {
|
|
224
|
+
throw console.error("Mail API call failed:", i), i;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Get auth token from localStorage (browser) or return empty string
|
|
229
|
+
*/
|
|
230
|
+
getToken() {
|
|
231
|
+
return typeof window < "u" && window.localStorage && localStorage.getItem("qwanyx_token") || "";
|
|
232
|
+
}
|
|
233
|
+
// ===== EMAIL SETTINGS =====
|
|
234
|
+
/**
|
|
235
|
+
* Get email settings with decrypted passwords
|
|
236
|
+
*/
|
|
237
|
+
async getSettings() {
|
|
238
|
+
try {
|
|
239
|
+
return await this.callMail("get_email_settings") || { accounts: [] };
|
|
240
|
+
} catch {
|
|
241
|
+
return { accounts: [] };
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Save email settings (passwords encrypted server-side)
|
|
246
|
+
*/
|
|
247
|
+
async saveSettings(t) {
|
|
248
|
+
await this.callMail("save_email_settings", { accounts: t });
|
|
249
|
+
}
|
|
250
|
+
// ===== EMAIL OPERATIONS =====
|
|
251
|
+
/**
|
|
252
|
+
* List emails from IMAP inbox
|
|
253
|
+
*/
|
|
254
|
+
async listEmails(t, r = 20) {
|
|
255
|
+
return this.callMail("list_emails", {
|
|
256
|
+
account_id: t,
|
|
257
|
+
limit: r
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Delete emails by UID
|
|
262
|
+
*/
|
|
263
|
+
async deleteEmails(t, r, n = !0) {
|
|
264
|
+
return this.callMail("delete_emails", {
|
|
265
|
+
account_id: t,
|
|
266
|
+
uids: r,
|
|
267
|
+
expunge: n
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Execute raw IMAP commands - thin proxy for stack-side logic
|
|
272
|
+
* Commands are strings like: "SELECT INBOX", "UID STORE 123 +FLAGS (\\Deleted)", "EXPUNGE"
|
|
273
|
+
*/
|
|
274
|
+
async imapExec(t, r) {
|
|
275
|
+
return this.callMail("imap_exec", {
|
|
276
|
+
account_id: t,
|
|
277
|
+
commands: r
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
// ===== HIGH-LEVEL OPERATIONS (built on imapExec) =====
|
|
281
|
+
/**
|
|
282
|
+
* Move emails to trash (soft delete)
|
|
283
|
+
*/
|
|
284
|
+
async trashEmails(t, r) {
|
|
285
|
+
const n = [
|
|
286
|
+
"SELECT INBOX",
|
|
287
|
+
...r.map((l) => `UID MOVE ${l} [Gmail]/Trash`)
|
|
288
|
+
], o = (await this.imapExec(t, n)).responses.filter((l) => l.ok && l.command === "UID MOVE").length;
|
|
289
|
+
return { success: o > 0, moved: o };
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Archive emails (remove from inbox, keep in All Mail)
|
|
293
|
+
*/
|
|
294
|
+
async archiveEmails(t, r) {
|
|
295
|
+
const n = [
|
|
296
|
+
"SELECT INBOX",
|
|
297
|
+
...r.map((l) => `UID STORE ${l} +FLAGS (\\Deleted)`),
|
|
298
|
+
"EXPUNGE"
|
|
299
|
+
], o = (await this.imapExec(t, n)).responses.filter((l) => l.ok && l.command === "UID STORE").length;
|
|
300
|
+
return { success: o > 0, archived: o };
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* List available folders
|
|
304
|
+
*/
|
|
305
|
+
async listFolders(t) {
|
|
306
|
+
const n = (await this.imapExec(t, ['LIST "" *'])).responses.find((i) => i.command === "LIST");
|
|
307
|
+
return n != null && n.ok && n.folders ? { success: !0, folders: n.folders } : { success: !1, folders: [] };
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
const $e = "qwanyx_auth_token", De = "qwanyx_refresh_token";
|
|
311
|
+
class Rt {
|
|
188
312
|
/**
|
|
189
313
|
* Store authentication token
|
|
190
314
|
*/
|
|
191
|
-
static setToken(
|
|
192
|
-
typeof window < "u" && localStorage.setItem(
|
|
315
|
+
static setToken(t) {
|
|
316
|
+
typeof window < "u" && localStorage.setItem($e, t);
|
|
193
317
|
}
|
|
194
318
|
/**
|
|
195
319
|
* Get authentication token
|
|
196
320
|
*/
|
|
197
321
|
static getToken() {
|
|
198
|
-
return typeof window < "u" ? localStorage.getItem(
|
|
322
|
+
return typeof window < "u" ? localStorage.getItem($e) : null;
|
|
199
323
|
}
|
|
200
324
|
/**
|
|
201
325
|
* Remove authentication token
|
|
202
326
|
*/
|
|
203
327
|
static clearToken() {
|
|
204
|
-
typeof window < "u" && (localStorage.removeItem(
|
|
328
|
+
typeof window < "u" && (localStorage.removeItem($e), localStorage.removeItem(De));
|
|
205
329
|
}
|
|
206
330
|
/**
|
|
207
331
|
* Store refresh token
|
|
208
332
|
*/
|
|
209
|
-
static setRefreshToken(
|
|
210
|
-
typeof window < "u" && localStorage.setItem(
|
|
333
|
+
static setRefreshToken(t) {
|
|
334
|
+
typeof window < "u" && localStorage.setItem(De, t);
|
|
211
335
|
}
|
|
212
336
|
/**
|
|
213
337
|
* Get refresh token
|
|
214
338
|
*/
|
|
215
339
|
static getRefreshToken() {
|
|
216
|
-
return typeof window < "u" ? localStorage.getItem(
|
|
340
|
+
return typeof window < "u" ? localStorage.getItem(De) : null;
|
|
217
341
|
}
|
|
218
342
|
/**
|
|
219
343
|
* Check if user is authenticated
|
|
@@ -225,103 +349,103 @@ class Er {
|
|
|
225
349
|
* Get authorization header
|
|
226
350
|
*/
|
|
227
351
|
static getAuthHeader() {
|
|
228
|
-
const
|
|
229
|
-
return
|
|
352
|
+
const t = this.getToken();
|
|
353
|
+
return t ? { Authorization: `Bearer ${t}` } : {};
|
|
230
354
|
}
|
|
231
355
|
}
|
|
232
|
-
class
|
|
233
|
-
constructor(
|
|
234
|
-
|
|
356
|
+
class kt {
|
|
357
|
+
constructor(t) {
|
|
358
|
+
_e(this, "config");
|
|
235
359
|
this.config = {
|
|
236
360
|
timeout: 3e4,
|
|
237
361
|
headers: {
|
|
238
362
|
"Content-Type": "application/json"
|
|
239
363
|
},
|
|
240
|
-
...
|
|
364
|
+
...t
|
|
241
365
|
};
|
|
242
366
|
}
|
|
243
367
|
/**
|
|
244
368
|
* Build query string from params
|
|
245
369
|
*/
|
|
246
|
-
buildQueryString(
|
|
247
|
-
if (!
|
|
370
|
+
buildQueryString(t) {
|
|
371
|
+
if (!t || Object.keys(t).length === 0)
|
|
248
372
|
return "";
|
|
249
|
-
const
|
|
250
|
-
Object.entries(
|
|
251
|
-
|
|
373
|
+
const r = new URLSearchParams();
|
|
374
|
+
Object.entries(t).forEach(([i, o]) => {
|
|
375
|
+
o != null && r.append(i, String(o));
|
|
252
376
|
});
|
|
253
|
-
const
|
|
254
|
-
return
|
|
377
|
+
const n = r.toString();
|
|
378
|
+
return n ? `?${n}` : "";
|
|
255
379
|
}
|
|
256
380
|
/**
|
|
257
381
|
* Make HTTP request
|
|
258
382
|
*/
|
|
259
|
-
async request(
|
|
383
|
+
async request(t, r = {}) {
|
|
260
384
|
const {
|
|
261
|
-
method:
|
|
385
|
+
method: n = "GET",
|
|
262
386
|
headers: i = {},
|
|
263
|
-
body:
|
|
264
|
-
params:
|
|
265
|
-
} =
|
|
387
|
+
body: o,
|
|
388
|
+
params: l
|
|
389
|
+
} = r, v = `${this.config.baseUrl}/${t}${this.buildQueryString(l)}`, d = {
|
|
266
390
|
...this.config.headers,
|
|
267
|
-
...
|
|
391
|
+
...Rt.getAuthHeader(),
|
|
268
392
|
...i
|
|
269
|
-
},
|
|
270
|
-
method:
|
|
393
|
+
}, h = {
|
|
394
|
+
method: n,
|
|
271
395
|
headers: d
|
|
272
396
|
};
|
|
273
|
-
|
|
397
|
+
o && n !== "GET" && (h.body = JSON.stringify(o));
|
|
274
398
|
try {
|
|
275
|
-
const
|
|
276
|
-
...
|
|
277
|
-
signal:
|
|
399
|
+
const x = new AbortController(), _ = setTimeout(() => x.abort(), this.config.timeout), S = await fetch(v, {
|
|
400
|
+
...h,
|
|
401
|
+
signal: x.signal
|
|
278
402
|
});
|
|
279
|
-
if (clearTimeout(
|
|
280
|
-
const
|
|
281
|
-
message:
|
|
403
|
+
if (clearTimeout(_), !S.ok) {
|
|
404
|
+
const $ = await S.json().catch(() => ({
|
|
405
|
+
message: S.statusText
|
|
282
406
|
}));
|
|
283
|
-
throw new Error(
|
|
407
|
+
throw new Error($.message || `HTTP ${S.status}`);
|
|
284
408
|
}
|
|
285
|
-
return await
|
|
286
|
-
} catch (
|
|
287
|
-
throw
|
|
409
|
+
return await S.json();
|
|
410
|
+
} catch (x) {
|
|
411
|
+
throw x instanceof Error ? x : new Error("An unexpected error occurred");
|
|
288
412
|
}
|
|
289
413
|
}
|
|
290
414
|
/**
|
|
291
415
|
* GET request
|
|
292
416
|
*/
|
|
293
|
-
async get(
|
|
294
|
-
return this.request(
|
|
417
|
+
async get(t, r) {
|
|
418
|
+
return this.request(t, { method: "GET", params: r });
|
|
295
419
|
}
|
|
296
420
|
/**
|
|
297
421
|
* POST request
|
|
298
422
|
*/
|
|
299
|
-
async post(r, n
|
|
300
|
-
return this.request(
|
|
423
|
+
async post(t, r, n) {
|
|
424
|
+
return this.request(t, { method: "POST", body: r, params: n });
|
|
301
425
|
}
|
|
302
426
|
/**
|
|
303
427
|
* PUT request
|
|
304
428
|
*/
|
|
305
|
-
async put(r, n
|
|
306
|
-
return this.request(
|
|
429
|
+
async put(t, r, n) {
|
|
430
|
+
return this.request(t, { method: "PUT", body: r, params: n });
|
|
307
431
|
}
|
|
308
432
|
/**
|
|
309
433
|
* PATCH request
|
|
310
434
|
*/
|
|
311
|
-
async patch(r, n
|
|
312
|
-
return this.request(
|
|
435
|
+
async patch(t, r, n) {
|
|
436
|
+
return this.request(t, { method: "PATCH", body: r, params: n });
|
|
313
437
|
}
|
|
314
438
|
/**
|
|
315
439
|
* DELETE request
|
|
316
440
|
*/
|
|
317
|
-
async delete(
|
|
318
|
-
return this.request(
|
|
441
|
+
async delete(t, r) {
|
|
442
|
+
return this.request(t, { method: "DELETE", params: r });
|
|
319
443
|
}
|
|
320
444
|
/**
|
|
321
445
|
* Update base URL
|
|
322
446
|
*/
|
|
323
|
-
setBaseUrl(
|
|
324
|
-
this.config.baseUrl =
|
|
447
|
+
setBaseUrl(t) {
|
|
448
|
+
this.config.baseUrl = t;
|
|
325
449
|
}
|
|
326
450
|
/**
|
|
327
451
|
* Get current base URL
|
|
@@ -330,88 +454,88 @@ class jr {
|
|
|
330
454
|
return this.config.baseUrl;
|
|
331
455
|
}
|
|
332
456
|
}
|
|
333
|
-
let
|
|
334
|
-
function
|
|
335
|
-
return
|
|
457
|
+
let Ee = null;
|
|
458
|
+
function Dt(f) {
|
|
459
|
+
return Ee = new kt(f), Ee;
|
|
336
460
|
}
|
|
337
|
-
function
|
|
338
|
-
if (!
|
|
461
|
+
function tt() {
|
|
462
|
+
if (!Ee)
|
|
339
463
|
throw new Error("API client not initialized. Call initializeApiClient() first.");
|
|
340
|
-
return
|
|
464
|
+
return Ee;
|
|
341
465
|
}
|
|
342
|
-
function
|
|
466
|
+
function Tt(f, t, r = {}) {
|
|
343
467
|
const {
|
|
344
|
-
enabled:
|
|
468
|
+
enabled: n = !0,
|
|
345
469
|
refetchOnMount: i = !0,
|
|
346
|
-
onSuccess:
|
|
347
|
-
onError:
|
|
348
|
-
} =
|
|
349
|
-
if (
|
|
350
|
-
|
|
470
|
+
onSuccess: o,
|
|
471
|
+
onError: l
|
|
472
|
+
} = r, [v, d] = L(null), [h, x] = L(n), [_, S] = L(null), $ = X(async () => {
|
|
473
|
+
if (n) {
|
|
474
|
+
x(!0), S(null);
|
|
351
475
|
try {
|
|
352
|
-
const
|
|
353
|
-
d(
|
|
354
|
-
} catch (
|
|
355
|
-
const
|
|
356
|
-
|
|
476
|
+
const N = await tt().get(f, t);
|
|
477
|
+
d(N), o == null || o(N);
|
|
478
|
+
} catch (P) {
|
|
479
|
+
const N = P instanceof Error ? P : new Error("Unknown error");
|
|
480
|
+
S(N), l == null || l(N);
|
|
357
481
|
} finally {
|
|
358
|
-
|
|
482
|
+
x(!1);
|
|
359
483
|
}
|
|
360
484
|
}
|
|
361
|
-
}, [
|
|
362
|
-
return
|
|
363
|
-
i &&
|
|
364
|
-
}, [
|
|
365
|
-
data:
|
|
366
|
-
loading:
|
|
367
|
-
error:
|
|
368
|
-
refetch:
|
|
485
|
+
}, [f, JSON.stringify(t), n, o, l]);
|
|
486
|
+
return fe(() => {
|
|
487
|
+
i && $();
|
|
488
|
+
}, [$, i]), {
|
|
489
|
+
data: v,
|
|
490
|
+
loading: h,
|
|
491
|
+
error: _,
|
|
492
|
+
refetch: $
|
|
369
493
|
};
|
|
370
494
|
}
|
|
371
|
-
function
|
|
372
|
-
const { onSuccess:
|
|
373
|
-
async (
|
|
374
|
-
d(!0),
|
|
495
|
+
function Ft(f, t = "POST", r = {}) {
|
|
496
|
+
const { onSuccess: n, onError: i } = r, [o, l] = L(null), [v, d] = L(!1), [h, x] = L(null), _ = X(
|
|
497
|
+
async ($) => {
|
|
498
|
+
d(!0), x(null);
|
|
375
499
|
try {
|
|
376
|
-
const
|
|
377
|
-
let
|
|
378
|
-
switch (
|
|
500
|
+
const P = tt();
|
|
501
|
+
let N;
|
|
502
|
+
switch (t) {
|
|
379
503
|
case "POST":
|
|
380
|
-
|
|
504
|
+
N = await P.post(f, $);
|
|
381
505
|
break;
|
|
382
506
|
case "PUT":
|
|
383
|
-
|
|
507
|
+
N = await P.put(f, $);
|
|
384
508
|
break;
|
|
385
509
|
case "PATCH":
|
|
386
|
-
|
|
510
|
+
N = await P.patch(f, $);
|
|
387
511
|
break;
|
|
388
512
|
case "DELETE":
|
|
389
|
-
|
|
513
|
+
N = await P.delete(f);
|
|
390
514
|
break;
|
|
391
515
|
default:
|
|
392
|
-
throw new Error(`Unsupported method: ${
|
|
516
|
+
throw new Error(`Unsupported method: ${t}`);
|
|
393
517
|
}
|
|
394
|
-
return
|
|
395
|
-
} catch (
|
|
396
|
-
const
|
|
397
|
-
return
|
|
518
|
+
return l(N), n == null || n(N, $), N;
|
|
519
|
+
} catch (P) {
|
|
520
|
+
const N = P instanceof Error ? P : new Error("Unknown error");
|
|
521
|
+
return x(N), i == null || i(N, $), null;
|
|
398
522
|
} finally {
|
|
399
523
|
d(!1);
|
|
400
524
|
}
|
|
401
525
|
},
|
|
402
|
-
[
|
|
403
|
-
),
|
|
404
|
-
|
|
526
|
+
[f, t, n, i]
|
|
527
|
+
), S = X(() => {
|
|
528
|
+
l(null), x(null), d(!1);
|
|
405
529
|
}, []);
|
|
406
530
|
return {
|
|
407
|
-
data:
|
|
408
|
-
loading:
|
|
409
|
-
error:
|
|
410
|
-
mutate:
|
|
411
|
-
reset:
|
|
531
|
+
data: o,
|
|
532
|
+
loading: v,
|
|
533
|
+
error: h,
|
|
534
|
+
mutate: _,
|
|
535
|
+
reset: S
|
|
412
536
|
};
|
|
413
537
|
}
|
|
414
|
-
var
|
|
538
|
+
var Ie = { exports: {} }, de = {};
|
|
415
539
|
/**
|
|
416
540
|
* @license React
|
|
417
541
|
* react-jsx-runtime.production.min.js
|
|
@@ -421,21 +545,21 @@ var me = { exports: {} }, Z = {};
|
|
|
421
545
|
* This source code is licensed under the MIT license found in the
|
|
422
546
|
* LICENSE file in the root directory of this source tree.
|
|
423
547
|
*/
|
|
424
|
-
var
|
|
425
|
-
function
|
|
426
|
-
if (
|
|
427
|
-
|
|
428
|
-
var
|
|
429
|
-
function
|
|
430
|
-
var
|
|
431
|
-
|
|
432
|
-
for (
|
|
433
|
-
if (
|
|
434
|
-
return { $$typeof:
|
|
548
|
+
var He;
|
|
549
|
+
function St() {
|
|
550
|
+
if (He) return de;
|
|
551
|
+
He = 1;
|
|
552
|
+
var f = Ze, t = Symbol.for("react.element"), r = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, i = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, o = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
553
|
+
function l(v, d, h) {
|
|
554
|
+
var x, _ = {}, S = null, $ = null;
|
|
555
|
+
h !== void 0 && (S = "" + h), d.key !== void 0 && (S = "" + d.key), d.ref !== void 0 && ($ = d.ref);
|
|
556
|
+
for (x in d) n.call(d, x) && !o.hasOwnProperty(x) && (_[x] = d[x]);
|
|
557
|
+
if (v && v.defaultProps) for (x in d = v.defaultProps, d) _[x] === void 0 && (_[x] = d[x]);
|
|
558
|
+
return { $$typeof: t, type: v, key: S, ref: $, props: _, _owner: i.current };
|
|
435
559
|
}
|
|
436
|
-
return
|
|
560
|
+
return de.Fragment = r, de.jsx = l, de.jsxs = l, de;
|
|
437
561
|
}
|
|
438
|
-
var
|
|
562
|
+
var ue = {};
|
|
439
563
|
/**
|
|
440
564
|
* @license React
|
|
441
565
|
* react-jsx-runtime.development.js
|
|
@@ -445,91 +569,91 @@ var ee = {};
|
|
|
445
569
|
* This source code is licensed under the MIT license found in the
|
|
446
570
|
* LICENSE file in the root directory of this source tree.
|
|
447
571
|
*/
|
|
448
|
-
var
|
|
449
|
-
function
|
|
450
|
-
return
|
|
451
|
-
var
|
|
452
|
-
function
|
|
572
|
+
var Qe;
|
|
573
|
+
function Nt() {
|
|
574
|
+
return Qe || (Qe = 1, process.env.NODE_ENV !== "production" && function() {
|
|
575
|
+
var f = Ze, t = Symbol.for("react.element"), r = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), l = Symbol.for("react.provider"), v = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), h = Symbol.for("react.suspense"), x = Symbol.for("react.suspense_list"), _ = Symbol.for("react.memo"), S = Symbol.for("react.lazy"), $ = Symbol.for("react.offscreen"), P = Symbol.iterator, N = "@@iterator";
|
|
576
|
+
function H(e) {
|
|
453
577
|
if (e === null || typeof e != "object")
|
|
454
578
|
return null;
|
|
455
|
-
var
|
|
456
|
-
return typeof
|
|
579
|
+
var a = P && e[P] || e[N];
|
|
580
|
+
return typeof a == "function" ? a : null;
|
|
457
581
|
}
|
|
458
|
-
var
|
|
459
|
-
function
|
|
582
|
+
var z = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
583
|
+
function g(e) {
|
|
460
584
|
{
|
|
461
|
-
for (var
|
|
462
|
-
|
|
463
|
-
|
|
585
|
+
for (var a = arguments.length, c = new Array(a > 1 ? a - 1 : 0), y = 1; y < a; y++)
|
|
586
|
+
c[y - 1] = arguments[y];
|
|
587
|
+
I("error", e, c);
|
|
464
588
|
}
|
|
465
589
|
}
|
|
466
|
-
function
|
|
590
|
+
function I(e, a, c) {
|
|
467
591
|
{
|
|
468
|
-
var
|
|
469
|
-
|
|
470
|
-
var
|
|
471
|
-
return String(
|
|
592
|
+
var y = z.ReactDebugCurrentFrame, O = y.getStackAddendum();
|
|
593
|
+
O !== "" && (a += "%s", c = c.concat([O]));
|
|
594
|
+
var A = c.map(function(R) {
|
|
595
|
+
return String(R);
|
|
472
596
|
});
|
|
473
|
-
|
|
597
|
+
A.unshift("Warning: " + a), Function.prototype.apply.call(console[e], console, A);
|
|
474
598
|
}
|
|
475
599
|
}
|
|
476
|
-
var
|
|
477
|
-
|
|
600
|
+
var V = !1, Q = !1, m = !1, T = !1, C = !1, p;
|
|
601
|
+
p = Symbol.for("react.module.reference");
|
|
478
602
|
function k(e) {
|
|
479
|
-
return !!(typeof e == "string" || typeof e == "function" || e ===
|
|
603
|
+
return !!(typeof e == "string" || typeof e == "function" || e === n || e === o || C || e === i || e === h || e === x || T || e === $ || V || Q || m || typeof e == "object" && e !== null && (e.$$typeof === S || e.$$typeof === _ || e.$$typeof === l || e.$$typeof === v || e.$$typeof === d || // This needs to include all possible module reference object
|
|
480
604
|
// types supported by any Flight configuration anywhere since
|
|
481
605
|
// we don't know which Flight build this will end up being used
|
|
482
606
|
// with.
|
|
483
|
-
e.$$typeof ===
|
|
607
|
+
e.$$typeof === p || e.getModuleId !== void 0));
|
|
484
608
|
}
|
|
485
|
-
function
|
|
486
|
-
var
|
|
487
|
-
if (
|
|
488
|
-
return
|
|
489
|
-
var
|
|
490
|
-
return
|
|
609
|
+
function j(e, a, c) {
|
|
610
|
+
var y = e.displayName;
|
|
611
|
+
if (y)
|
|
612
|
+
return y;
|
|
613
|
+
var O = a.displayName || a.name || "";
|
|
614
|
+
return O !== "" ? c + "(" + O + ")" : c;
|
|
491
615
|
}
|
|
492
|
-
function
|
|
616
|
+
function Z(e) {
|
|
493
617
|
return e.displayName || "Context";
|
|
494
618
|
}
|
|
495
|
-
function
|
|
619
|
+
function U(e) {
|
|
496
620
|
if (e == null)
|
|
497
621
|
return null;
|
|
498
|
-
if (typeof e.tag == "number" &&
|
|
622
|
+
if (typeof e.tag == "number" && g("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
499
623
|
return e.displayName || e.name || null;
|
|
500
624
|
if (typeof e == "string")
|
|
501
625
|
return e;
|
|
502
626
|
switch (e) {
|
|
503
|
-
case a:
|
|
504
|
-
return "Fragment";
|
|
505
627
|
case n:
|
|
628
|
+
return "Fragment";
|
|
629
|
+
case r:
|
|
506
630
|
return "Portal";
|
|
507
|
-
case
|
|
631
|
+
case o:
|
|
508
632
|
return "Profiler";
|
|
509
633
|
case i:
|
|
510
634
|
return "StrictMode";
|
|
511
|
-
case
|
|
635
|
+
case h:
|
|
512
636
|
return "Suspense";
|
|
513
|
-
case
|
|
637
|
+
case x:
|
|
514
638
|
return "SuspenseList";
|
|
515
639
|
}
|
|
516
640
|
if (typeof e == "object")
|
|
517
641
|
switch (e.$$typeof) {
|
|
518
|
-
case
|
|
519
|
-
var
|
|
520
|
-
return
|
|
521
|
-
case
|
|
522
|
-
var
|
|
523
|
-
return
|
|
642
|
+
case v:
|
|
643
|
+
var a = e;
|
|
644
|
+
return Z(a) + ".Consumer";
|
|
645
|
+
case l:
|
|
646
|
+
var c = e;
|
|
647
|
+
return Z(c._context) + ".Provider";
|
|
524
648
|
case d:
|
|
525
|
-
return
|
|
526
|
-
case
|
|
527
|
-
var
|
|
528
|
-
return
|
|
529
|
-
case
|
|
530
|
-
var
|
|
649
|
+
return j(e, e.render, "ForwardRef");
|
|
650
|
+
case _:
|
|
651
|
+
var y = e.displayName || null;
|
|
652
|
+
return y !== null ? y : U(e.type) || "Memo";
|
|
653
|
+
case S: {
|
|
654
|
+
var O = e, A = O._payload, R = O._init;
|
|
531
655
|
try {
|
|
532
|
-
return
|
|
656
|
+
return U(R(A));
|
|
533
657
|
} catch {
|
|
534
658
|
return null;
|
|
535
659
|
}
|
|
@@ -537,18 +661,18 @@ function Tr() {
|
|
|
537
661
|
}
|
|
538
662
|
return null;
|
|
539
663
|
}
|
|
540
|
-
var
|
|
541
|
-
function
|
|
664
|
+
var E = Object.assign, D = 0, Y, pe, he, ge, ye, xe, me;
|
|
665
|
+
function ve() {
|
|
542
666
|
}
|
|
543
|
-
|
|
544
|
-
function
|
|
667
|
+
ve.__reactDisabledLog = !0;
|
|
668
|
+
function Re() {
|
|
545
669
|
{
|
|
546
|
-
if (
|
|
547
|
-
|
|
670
|
+
if (D === 0) {
|
|
671
|
+
Y = console.log, pe = console.info, he = console.warn, ge = console.error, ye = console.group, xe = console.groupCollapsed, me = console.groupEnd;
|
|
548
672
|
var e = {
|
|
549
673
|
configurable: !0,
|
|
550
674
|
enumerable: !0,
|
|
551
|
-
value:
|
|
675
|
+
value: ve,
|
|
552
676
|
writable: !0
|
|
553
677
|
};
|
|
554
678
|
Object.defineProperties(console, {
|
|
@@ -561,332 +685,332 @@ function Tr() {
|
|
|
561
685
|
groupEnd: e
|
|
562
686
|
});
|
|
563
687
|
}
|
|
564
|
-
|
|
688
|
+
D++;
|
|
565
689
|
}
|
|
566
690
|
}
|
|
567
|
-
function
|
|
691
|
+
function ke() {
|
|
568
692
|
{
|
|
569
|
-
if (
|
|
693
|
+
if (D--, D === 0) {
|
|
570
694
|
var e = {
|
|
571
695
|
configurable: !0,
|
|
572
696
|
enumerable: !0,
|
|
573
697
|
writable: !0
|
|
574
698
|
};
|
|
575
699
|
Object.defineProperties(console, {
|
|
576
|
-
log:
|
|
577
|
-
value:
|
|
700
|
+
log: E({}, e, {
|
|
701
|
+
value: Y
|
|
578
702
|
}),
|
|
579
|
-
info:
|
|
580
|
-
value:
|
|
703
|
+
info: E({}, e, {
|
|
704
|
+
value: pe
|
|
581
705
|
}),
|
|
582
|
-
warn:
|
|
583
|
-
value:
|
|
706
|
+
warn: E({}, e, {
|
|
707
|
+
value: he
|
|
584
708
|
}),
|
|
585
|
-
error:
|
|
586
|
-
value:
|
|
709
|
+
error: E({}, e, {
|
|
710
|
+
value: ge
|
|
587
711
|
}),
|
|
588
|
-
group:
|
|
589
|
-
value:
|
|
712
|
+
group: E({}, e, {
|
|
713
|
+
value: ye
|
|
590
714
|
}),
|
|
591
|
-
groupCollapsed:
|
|
592
|
-
value:
|
|
715
|
+
groupCollapsed: E({}, e, {
|
|
716
|
+
value: xe
|
|
593
717
|
}),
|
|
594
|
-
groupEnd:
|
|
595
|
-
value:
|
|
718
|
+
groupEnd: E({}, e, {
|
|
719
|
+
value: me
|
|
596
720
|
})
|
|
597
721
|
});
|
|
598
722
|
}
|
|
599
|
-
|
|
723
|
+
D < 0 && g("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
600
724
|
}
|
|
601
725
|
}
|
|
602
|
-
var ie =
|
|
603
|
-
function re(e,
|
|
726
|
+
var ie = z.ReactCurrentDispatcher, oe;
|
|
727
|
+
function re(e, a, c) {
|
|
604
728
|
{
|
|
605
|
-
if (
|
|
729
|
+
if (oe === void 0)
|
|
606
730
|
try {
|
|
607
731
|
throw Error();
|
|
608
|
-
} catch (
|
|
609
|
-
var
|
|
610
|
-
|
|
732
|
+
} catch (O) {
|
|
733
|
+
var y = O.stack.trim().match(/\n( *(at )?)/);
|
|
734
|
+
oe = y && y[1] || "";
|
|
611
735
|
}
|
|
612
736
|
return `
|
|
613
|
-
` +
|
|
737
|
+
` + oe + e;
|
|
614
738
|
}
|
|
615
739
|
}
|
|
616
|
-
var
|
|
740
|
+
var le = !1, ne;
|
|
617
741
|
{
|
|
618
|
-
var
|
|
619
|
-
|
|
742
|
+
var Te = typeof WeakMap == "function" ? WeakMap : Map;
|
|
743
|
+
ne = new Te();
|
|
620
744
|
}
|
|
621
|
-
function
|
|
622
|
-
if (!e ||
|
|
745
|
+
function be(e, a) {
|
|
746
|
+
if (!e || le)
|
|
623
747
|
return "";
|
|
624
748
|
{
|
|
625
|
-
var
|
|
626
|
-
if (
|
|
627
|
-
return
|
|
749
|
+
var c = ne.get(e);
|
|
750
|
+
if (c !== void 0)
|
|
751
|
+
return c;
|
|
628
752
|
}
|
|
629
|
-
var
|
|
630
|
-
|
|
631
|
-
var
|
|
753
|
+
var y;
|
|
754
|
+
le = !0;
|
|
755
|
+
var O = Error.prepareStackTrace;
|
|
632
756
|
Error.prepareStackTrace = void 0;
|
|
633
|
-
var
|
|
634
|
-
|
|
757
|
+
var A;
|
|
758
|
+
A = ie.current, ie.current = null, Re();
|
|
635
759
|
try {
|
|
636
|
-
if (
|
|
637
|
-
var
|
|
760
|
+
if (a) {
|
|
761
|
+
var R = function() {
|
|
638
762
|
throw Error();
|
|
639
763
|
};
|
|
640
|
-
if (Object.defineProperty(
|
|
764
|
+
if (Object.defineProperty(R.prototype, "props", {
|
|
641
765
|
set: function() {
|
|
642
766
|
throw Error();
|
|
643
767
|
}
|
|
644
768
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
645
769
|
try {
|
|
646
|
-
Reflect.construct(
|
|
647
|
-
} catch (
|
|
648
|
-
|
|
770
|
+
Reflect.construct(R, []);
|
|
771
|
+
} catch (q) {
|
|
772
|
+
y = q;
|
|
649
773
|
}
|
|
650
|
-
Reflect.construct(e, [],
|
|
774
|
+
Reflect.construct(e, [], R);
|
|
651
775
|
} else {
|
|
652
776
|
try {
|
|
653
|
-
|
|
654
|
-
} catch (
|
|
655
|
-
|
|
777
|
+
R.call();
|
|
778
|
+
} catch (q) {
|
|
779
|
+
y = q;
|
|
656
780
|
}
|
|
657
|
-
e.call(
|
|
781
|
+
e.call(R.prototype);
|
|
658
782
|
}
|
|
659
783
|
} else {
|
|
660
784
|
try {
|
|
661
785
|
throw Error();
|
|
662
|
-
} catch (
|
|
663
|
-
|
|
786
|
+
} catch (q) {
|
|
787
|
+
y = q;
|
|
664
788
|
}
|
|
665
789
|
e();
|
|
666
790
|
}
|
|
667
|
-
} catch (
|
|
668
|
-
if (
|
|
669
|
-
for (var
|
|
670
|
-
`),
|
|
671
|
-
`),
|
|
672
|
-
|
|
673
|
-
for (;
|
|
674
|
-
if (
|
|
675
|
-
if (
|
|
791
|
+
} catch (q) {
|
|
792
|
+
if (q && y && typeof q.stack == "string") {
|
|
793
|
+
for (var w = q.stack.split(`
|
|
794
|
+
`), G = y.stack.split(`
|
|
795
|
+
`), F = w.length - 1, M = G.length - 1; F >= 1 && M >= 0 && w[F] !== G[M]; )
|
|
796
|
+
M--;
|
|
797
|
+
for (; F >= 1 && M >= 0; F--, M--)
|
|
798
|
+
if (w[F] !== G[M]) {
|
|
799
|
+
if (F !== 1 || M !== 1)
|
|
676
800
|
do
|
|
677
|
-
if (
|
|
678
|
-
var
|
|
679
|
-
` +
|
|
680
|
-
return e.displayName &&
|
|
801
|
+
if (F--, M--, M < 0 || w[F] !== G[M]) {
|
|
802
|
+
var K = `
|
|
803
|
+
` + w[F].replace(" at new ", " at ");
|
|
804
|
+
return e.displayName && K.includes("<anonymous>") && (K = K.replace("<anonymous>", e.displayName)), typeof e == "function" && ne.set(e, K), K;
|
|
681
805
|
}
|
|
682
|
-
while (
|
|
806
|
+
while (F >= 1 && M >= 0);
|
|
683
807
|
break;
|
|
684
808
|
}
|
|
685
809
|
}
|
|
686
810
|
} finally {
|
|
687
|
-
|
|
811
|
+
le = !1, ie.current = A, ke(), Error.prepareStackTrace = O;
|
|
688
812
|
}
|
|
689
|
-
var
|
|
690
|
-
return typeof e == "function" &&
|
|
813
|
+
var ae = e ? e.displayName || e.name : "", te = ae ? re(ae) : "";
|
|
814
|
+
return typeof e == "function" && ne.set(e, te), te;
|
|
691
815
|
}
|
|
692
|
-
function
|
|
693
|
-
return
|
|
816
|
+
function Se(e, a, c) {
|
|
817
|
+
return be(e, !1);
|
|
694
818
|
}
|
|
695
|
-
function
|
|
696
|
-
var
|
|
697
|
-
return !!(
|
|
819
|
+
function u(e) {
|
|
820
|
+
var a = e.prototype;
|
|
821
|
+
return !!(a && a.isReactComponent);
|
|
698
822
|
}
|
|
699
|
-
function
|
|
823
|
+
function b(e, a, c) {
|
|
700
824
|
if (e == null)
|
|
701
825
|
return "";
|
|
702
826
|
if (typeof e == "function")
|
|
703
|
-
return
|
|
827
|
+
return be(e, u(e));
|
|
704
828
|
if (typeof e == "string")
|
|
705
829
|
return re(e);
|
|
706
830
|
switch (e) {
|
|
707
|
-
case
|
|
831
|
+
case h:
|
|
708
832
|
return re("Suspense");
|
|
709
|
-
case
|
|
833
|
+
case x:
|
|
710
834
|
return re("SuspenseList");
|
|
711
835
|
}
|
|
712
836
|
if (typeof e == "object")
|
|
713
837
|
switch (e.$$typeof) {
|
|
714
838
|
case d:
|
|
715
|
-
return
|
|
716
|
-
case
|
|
717
|
-
return
|
|
718
|
-
case
|
|
719
|
-
var
|
|
839
|
+
return Se(e.render);
|
|
840
|
+
case _:
|
|
841
|
+
return b(e.type, a, c);
|
|
842
|
+
case S: {
|
|
843
|
+
var y = e, O = y._payload, A = y._init;
|
|
720
844
|
try {
|
|
721
|
-
return
|
|
845
|
+
return b(A(O), a, c);
|
|
722
846
|
} catch {
|
|
723
847
|
}
|
|
724
848
|
}
|
|
725
849
|
}
|
|
726
850
|
return "";
|
|
727
851
|
}
|
|
728
|
-
var
|
|
729
|
-
function
|
|
852
|
+
var B = Object.prototype.hasOwnProperty, W = {}, ee = z.ReactDebugCurrentFrame;
|
|
853
|
+
function J(e) {
|
|
730
854
|
if (e) {
|
|
731
|
-
var
|
|
732
|
-
|
|
855
|
+
var a = e._owner, c = b(e.type, e._source, a ? a.type : null);
|
|
856
|
+
ee.setExtraStackFrame(c);
|
|
733
857
|
} else
|
|
734
|
-
|
|
858
|
+
ee.setExtraStackFrame(null);
|
|
735
859
|
}
|
|
736
|
-
function
|
|
860
|
+
function Ne(e, a, c, y, O) {
|
|
737
861
|
{
|
|
738
|
-
var
|
|
739
|
-
for (var
|
|
740
|
-
if (
|
|
741
|
-
var
|
|
862
|
+
var A = Function.call.bind(B);
|
|
863
|
+
for (var R in e)
|
|
864
|
+
if (A(e, R)) {
|
|
865
|
+
var w = void 0;
|
|
742
866
|
try {
|
|
743
|
-
if (typeof e[
|
|
744
|
-
var
|
|
745
|
-
throw
|
|
867
|
+
if (typeof e[R] != "function") {
|
|
868
|
+
var G = Error((y || "React class") + ": " + c + " type `" + R + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[R] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
869
|
+
throw G.name = "Invariant Violation", G;
|
|
746
870
|
}
|
|
747
|
-
|
|
748
|
-
} catch (
|
|
749
|
-
|
|
871
|
+
w = e[R](a, R, y, c, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
872
|
+
} catch (F) {
|
|
873
|
+
w = F;
|
|
750
874
|
}
|
|
751
|
-
|
|
875
|
+
w && !(w instanceof Error) && (J(O), g("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", y || "React class", c, R, typeof w), J(null)), w instanceof Error && !(w.message in W) && (W[w.message] = !0, J(O), g("Failed %s type: %s", c, w.message), J(null));
|
|
752
876
|
}
|
|
753
877
|
}
|
|
754
878
|
}
|
|
755
|
-
var
|
|
756
|
-
function
|
|
757
|
-
return
|
|
879
|
+
var we = Array.isArray;
|
|
880
|
+
function ce(e) {
|
|
881
|
+
return we(e);
|
|
758
882
|
}
|
|
759
|
-
function
|
|
883
|
+
function rt(e) {
|
|
760
884
|
{
|
|
761
|
-
var
|
|
762
|
-
return
|
|
885
|
+
var a = typeof Symbol == "function" && Symbol.toStringTag, c = a && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
886
|
+
return c;
|
|
763
887
|
}
|
|
764
888
|
}
|
|
765
|
-
function
|
|
889
|
+
function nt(e) {
|
|
766
890
|
try {
|
|
767
|
-
return
|
|
891
|
+
return Me(e), !1;
|
|
768
892
|
} catch {
|
|
769
893
|
return !0;
|
|
770
894
|
}
|
|
771
895
|
}
|
|
772
|
-
function
|
|
896
|
+
function Me(e) {
|
|
773
897
|
return "" + e;
|
|
774
898
|
}
|
|
775
|
-
function
|
|
776
|
-
if (
|
|
777
|
-
return
|
|
899
|
+
function Ue(e) {
|
|
900
|
+
if (nt(e))
|
|
901
|
+
return g("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", rt(e)), Me(e);
|
|
778
902
|
}
|
|
779
|
-
var
|
|
903
|
+
var Be = z.ReactCurrentOwner, st = {
|
|
780
904
|
key: !0,
|
|
781
905
|
ref: !0,
|
|
782
906
|
__self: !0,
|
|
783
907
|
__source: !0
|
|
784
|
-
},
|
|
785
|
-
function
|
|
786
|
-
if (
|
|
787
|
-
var
|
|
788
|
-
if (
|
|
908
|
+
}, Le, ze;
|
|
909
|
+
function at(e) {
|
|
910
|
+
if (B.call(e, "ref")) {
|
|
911
|
+
var a = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
912
|
+
if (a && a.isReactWarning)
|
|
789
913
|
return !1;
|
|
790
914
|
}
|
|
791
915
|
return e.ref !== void 0;
|
|
792
916
|
}
|
|
793
|
-
function
|
|
794
|
-
if (
|
|
795
|
-
var
|
|
796
|
-
if (
|
|
917
|
+
function it(e) {
|
|
918
|
+
if (B.call(e, "key")) {
|
|
919
|
+
var a = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
920
|
+
if (a && a.isReactWarning)
|
|
797
921
|
return !1;
|
|
798
922
|
}
|
|
799
923
|
return e.key !== void 0;
|
|
800
924
|
}
|
|
801
|
-
function
|
|
802
|
-
typeof e.ref == "string" &&
|
|
925
|
+
function ot(e, a) {
|
|
926
|
+
typeof e.ref == "string" && Be.current;
|
|
803
927
|
}
|
|
804
|
-
function
|
|
928
|
+
function lt(e, a) {
|
|
805
929
|
{
|
|
806
|
-
var
|
|
807
|
-
|
|
930
|
+
var c = function() {
|
|
931
|
+
Le || (Le = !0, g("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", a));
|
|
808
932
|
};
|
|
809
|
-
|
|
810
|
-
get:
|
|
933
|
+
c.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
934
|
+
get: c,
|
|
811
935
|
configurable: !0
|
|
812
936
|
});
|
|
813
937
|
}
|
|
814
938
|
}
|
|
815
|
-
function
|
|
939
|
+
function ct(e, a) {
|
|
816
940
|
{
|
|
817
|
-
var
|
|
818
|
-
|
|
941
|
+
var c = function() {
|
|
942
|
+
ze || (ze = !0, g("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", a));
|
|
819
943
|
};
|
|
820
|
-
|
|
821
|
-
get:
|
|
944
|
+
c.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
945
|
+
get: c,
|
|
822
946
|
configurable: !0
|
|
823
947
|
});
|
|
824
948
|
}
|
|
825
949
|
}
|
|
826
|
-
var
|
|
827
|
-
var
|
|
950
|
+
var dt = function(e, a, c, y, O, A, R) {
|
|
951
|
+
var w = {
|
|
828
952
|
// This tag allows us to uniquely identify this as a React Element
|
|
829
|
-
$$typeof:
|
|
953
|
+
$$typeof: t,
|
|
830
954
|
// Built-in properties that belong on the element
|
|
831
955
|
type: e,
|
|
832
|
-
key:
|
|
833
|
-
ref:
|
|
834
|
-
props:
|
|
956
|
+
key: a,
|
|
957
|
+
ref: c,
|
|
958
|
+
props: R,
|
|
835
959
|
// Record the component responsible for creating this element.
|
|
836
|
-
_owner:
|
|
960
|
+
_owner: A
|
|
837
961
|
};
|
|
838
|
-
return
|
|
962
|
+
return w._store = {}, Object.defineProperty(w._store, "validated", {
|
|
839
963
|
configurable: !1,
|
|
840
964
|
enumerable: !1,
|
|
841
965
|
writable: !0,
|
|
842
966
|
value: !1
|
|
843
|
-
}), Object.defineProperty(
|
|
967
|
+
}), Object.defineProperty(w, "_self", {
|
|
844
968
|
configurable: !1,
|
|
845
969
|
enumerable: !1,
|
|
846
970
|
writable: !1,
|
|
847
|
-
value:
|
|
848
|
-
}), Object.defineProperty(
|
|
971
|
+
value: y
|
|
972
|
+
}), Object.defineProperty(w, "_source", {
|
|
849
973
|
configurable: !1,
|
|
850
974
|
enumerable: !1,
|
|
851
975
|
writable: !1,
|
|
852
|
-
value:
|
|
853
|
-
}), Object.freeze && (Object.freeze(
|
|
976
|
+
value: O
|
|
977
|
+
}), Object.freeze && (Object.freeze(w.props), Object.freeze(w)), w;
|
|
854
978
|
};
|
|
855
|
-
function
|
|
979
|
+
function ut(e, a, c, y, O) {
|
|
856
980
|
{
|
|
857
|
-
var
|
|
858
|
-
|
|
859
|
-
for (
|
|
860
|
-
|
|
981
|
+
var A, R = {}, w = null, G = null;
|
|
982
|
+
c !== void 0 && (Ue(c), w = "" + c), it(a) && (Ue(a.key), w = "" + a.key), at(a) && (G = a.ref, ot(a, O));
|
|
983
|
+
for (A in a)
|
|
984
|
+
B.call(a, A) && !st.hasOwnProperty(A) && (R[A] = a[A]);
|
|
861
985
|
if (e && e.defaultProps) {
|
|
862
|
-
var
|
|
863
|
-
for (
|
|
864
|
-
|
|
986
|
+
var F = e.defaultProps;
|
|
987
|
+
for (A in F)
|
|
988
|
+
R[A] === void 0 && (R[A] = F[A]);
|
|
865
989
|
}
|
|
866
|
-
if (
|
|
867
|
-
var
|
|
868
|
-
|
|
990
|
+
if (w || G) {
|
|
991
|
+
var M = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
992
|
+
w && lt(R, M), G && ct(R, M);
|
|
869
993
|
}
|
|
870
|
-
return
|
|
994
|
+
return dt(e, w, G, O, y, Be.current, R);
|
|
871
995
|
}
|
|
872
996
|
}
|
|
873
|
-
var
|
|
874
|
-
function
|
|
997
|
+
var Oe = z.ReactCurrentOwner, We = z.ReactDebugCurrentFrame;
|
|
998
|
+
function se(e) {
|
|
875
999
|
if (e) {
|
|
876
|
-
var
|
|
877
|
-
|
|
1000
|
+
var a = e._owner, c = b(e.type, e._source, a ? a.type : null);
|
|
1001
|
+
We.setExtraStackFrame(c);
|
|
878
1002
|
} else
|
|
879
|
-
|
|
1003
|
+
We.setExtraStackFrame(null);
|
|
880
1004
|
}
|
|
881
|
-
var
|
|
882
|
-
|
|
883
|
-
function
|
|
884
|
-
return typeof e == "object" && e !== null && e.$$typeof ===
|
|
1005
|
+
var Pe;
|
|
1006
|
+
Pe = !1;
|
|
1007
|
+
function Ae(e) {
|
|
1008
|
+
return typeof e == "object" && e !== null && e.$$typeof === t;
|
|
885
1009
|
}
|
|
886
|
-
function
|
|
1010
|
+
function Ge() {
|
|
887
1011
|
{
|
|
888
|
-
if (
|
|
889
|
-
var e =
|
|
1012
|
+
if (Oe.current) {
|
|
1013
|
+
var e = U(Oe.current.type);
|
|
890
1014
|
if (e)
|
|
891
1015
|
return `
|
|
892
1016
|
|
|
@@ -895,287 +1019,287 @@ Check the render method of \`` + e + "`.";
|
|
|
895
1019
|
return "";
|
|
896
1020
|
}
|
|
897
1021
|
}
|
|
898
|
-
function
|
|
1022
|
+
function ft(e) {
|
|
899
1023
|
return "";
|
|
900
1024
|
}
|
|
901
|
-
var
|
|
902
|
-
function
|
|
1025
|
+
var Ye = {};
|
|
1026
|
+
function pt(e) {
|
|
903
1027
|
{
|
|
904
|
-
var
|
|
905
|
-
if (!
|
|
906
|
-
var
|
|
907
|
-
|
|
1028
|
+
var a = Ge();
|
|
1029
|
+
if (!a) {
|
|
1030
|
+
var c = typeof e == "string" ? e : e.displayName || e.name;
|
|
1031
|
+
c && (a = `
|
|
908
1032
|
|
|
909
|
-
Check the top-level render call using <` +
|
|
1033
|
+
Check the top-level render call using <` + c + ">.");
|
|
910
1034
|
}
|
|
911
|
-
return
|
|
1035
|
+
return a;
|
|
912
1036
|
}
|
|
913
1037
|
}
|
|
914
|
-
function
|
|
1038
|
+
function qe(e, a) {
|
|
915
1039
|
{
|
|
916
1040
|
if (!e._store || e._store.validated || e.key != null)
|
|
917
1041
|
return;
|
|
918
1042
|
e._store.validated = !0;
|
|
919
|
-
var
|
|
920
|
-
if (
|
|
1043
|
+
var c = pt(a);
|
|
1044
|
+
if (Ye[c])
|
|
921
1045
|
return;
|
|
922
|
-
|
|
923
|
-
var
|
|
924
|
-
e && e._owner && e._owner !==
|
|
1046
|
+
Ye[c] = !0;
|
|
1047
|
+
var y = "";
|
|
1048
|
+
e && e._owner && e._owner !== Oe.current && (y = " It was passed a child from " + U(e._owner.type) + "."), se(e), g('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', c, y), se(null);
|
|
925
1049
|
}
|
|
926
1050
|
}
|
|
927
|
-
function
|
|
1051
|
+
function Ve(e, a) {
|
|
928
1052
|
{
|
|
929
1053
|
if (typeof e != "object")
|
|
930
1054
|
return;
|
|
931
|
-
if (
|
|
932
|
-
for (var
|
|
933
|
-
var
|
|
934
|
-
|
|
1055
|
+
if (ce(e))
|
|
1056
|
+
for (var c = 0; c < e.length; c++) {
|
|
1057
|
+
var y = e[c];
|
|
1058
|
+
Ae(y) && qe(y, a);
|
|
935
1059
|
}
|
|
936
|
-
else if (
|
|
1060
|
+
else if (Ae(e))
|
|
937
1061
|
e._store && (e._store.validated = !0);
|
|
938
1062
|
else if (e) {
|
|
939
|
-
var
|
|
940
|
-
if (typeof
|
|
941
|
-
for (var
|
|
942
|
-
|
|
1063
|
+
var O = H(e);
|
|
1064
|
+
if (typeof O == "function" && O !== e.entries)
|
|
1065
|
+
for (var A = O.call(e), R; !(R = A.next()).done; )
|
|
1066
|
+
Ae(R.value) && qe(R.value, a);
|
|
943
1067
|
}
|
|
944
1068
|
}
|
|
945
1069
|
}
|
|
946
|
-
function
|
|
1070
|
+
function ht(e) {
|
|
947
1071
|
{
|
|
948
|
-
var
|
|
949
|
-
if (
|
|
1072
|
+
var a = e.type;
|
|
1073
|
+
if (a == null || typeof a == "string")
|
|
950
1074
|
return;
|
|
951
|
-
var
|
|
952
|
-
if (typeof
|
|
953
|
-
|
|
954
|
-
else if (typeof
|
|
1075
|
+
var c;
|
|
1076
|
+
if (typeof a == "function")
|
|
1077
|
+
c = a.propTypes;
|
|
1078
|
+
else if (typeof a == "object" && (a.$$typeof === d || // Note: Memo only checks outer props here.
|
|
955
1079
|
// Inner props are checked in the reconciler.
|
|
956
|
-
|
|
957
|
-
|
|
1080
|
+
a.$$typeof === _))
|
|
1081
|
+
c = a.propTypes;
|
|
958
1082
|
else
|
|
959
1083
|
return;
|
|
960
|
-
if (
|
|
961
|
-
var
|
|
962
|
-
|
|
963
|
-
} else if (
|
|
964
|
-
|
|
965
|
-
var
|
|
966
|
-
|
|
1084
|
+
if (c) {
|
|
1085
|
+
var y = U(a);
|
|
1086
|
+
Ne(c, e.props, "prop", y, e);
|
|
1087
|
+
} else if (a.PropTypes !== void 0 && !Pe) {
|
|
1088
|
+
Pe = !0;
|
|
1089
|
+
var O = U(a);
|
|
1090
|
+
g("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", O || "Unknown");
|
|
967
1091
|
}
|
|
968
|
-
typeof
|
|
1092
|
+
typeof a.getDefaultProps == "function" && !a.getDefaultProps.isReactClassApproved && g("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
969
1093
|
}
|
|
970
1094
|
}
|
|
971
|
-
function
|
|
1095
|
+
function gt(e) {
|
|
972
1096
|
{
|
|
973
|
-
for (var
|
|
974
|
-
var
|
|
975
|
-
if (
|
|
976
|
-
|
|
1097
|
+
for (var a = Object.keys(e.props), c = 0; c < a.length; c++) {
|
|
1098
|
+
var y = a[c];
|
|
1099
|
+
if (y !== "children" && y !== "key") {
|
|
1100
|
+
se(e), g("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", y), se(null);
|
|
977
1101
|
break;
|
|
978
1102
|
}
|
|
979
1103
|
}
|
|
980
|
-
e.ref !== null && (
|
|
1104
|
+
e.ref !== null && (se(e), g("Invalid attribute `ref` supplied to `React.Fragment`."), se(null));
|
|
981
1105
|
}
|
|
982
1106
|
}
|
|
983
|
-
var
|
|
984
|
-
function
|
|
1107
|
+
var Je = {};
|
|
1108
|
+
function Ke(e, a, c, y, O, A) {
|
|
985
1109
|
{
|
|
986
|
-
var
|
|
987
|
-
if (!
|
|
988
|
-
var
|
|
989
|
-
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (
|
|
990
|
-
var
|
|
991
|
-
|
|
992
|
-
var
|
|
993
|
-
e === null ?
|
|
1110
|
+
var R = k(e);
|
|
1111
|
+
if (!R) {
|
|
1112
|
+
var w = "";
|
|
1113
|
+
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (w += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
1114
|
+
var G = ft();
|
|
1115
|
+
G ? w += G : w += Ge();
|
|
1116
|
+
var F;
|
|
1117
|
+
e === null ? F = "null" : ce(e) ? F = "array" : e !== void 0 && e.$$typeof === t ? (F = "<" + (U(e.type) || "Unknown") + " />", w = " Did you accidentally export a JSX literal instead of a component?") : F = typeof e, g("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", F, w);
|
|
994
1118
|
}
|
|
995
|
-
var
|
|
996
|
-
if (
|
|
997
|
-
return
|
|
998
|
-
if (
|
|
999
|
-
var
|
|
1000
|
-
if (
|
|
1001
|
-
if (
|
|
1002
|
-
if (
|
|
1003
|
-
for (var
|
|
1004
|
-
|
|
1005
|
-
Object.freeze && Object.freeze(
|
|
1119
|
+
var M = ut(e, a, c, O, A);
|
|
1120
|
+
if (M == null)
|
|
1121
|
+
return M;
|
|
1122
|
+
if (R) {
|
|
1123
|
+
var K = a.children;
|
|
1124
|
+
if (K !== void 0)
|
|
1125
|
+
if (y)
|
|
1126
|
+
if (ce(K)) {
|
|
1127
|
+
for (var ae = 0; ae < K.length; ae++)
|
|
1128
|
+
Ve(K[ae], e);
|
|
1129
|
+
Object.freeze && Object.freeze(K);
|
|
1006
1130
|
} else
|
|
1007
|
-
|
|
1131
|
+
g("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
1008
1132
|
else
|
|
1009
|
-
|
|
1133
|
+
Ve(K, e);
|
|
1010
1134
|
}
|
|
1011
|
-
if (
|
|
1012
|
-
var
|
|
1013
|
-
return
|
|
1014
|
-
}),
|
|
1015
|
-
if (!
|
|
1016
|
-
var
|
|
1017
|
-
|
|
1135
|
+
if (B.call(a, "key")) {
|
|
1136
|
+
var te = U(e), q = Object.keys(a).filter(function(wt) {
|
|
1137
|
+
return wt !== "key";
|
|
1138
|
+
}), Ce = q.length > 0 ? "{key: someKey, " + q.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
1139
|
+
if (!Je[te + Ce]) {
|
|
1140
|
+
var bt = q.length > 0 ? "{" + q.join(": ..., ") + ": ...}" : "{}";
|
|
1141
|
+
g(`A props object containing a "key" prop is being spread into JSX:
|
|
1018
1142
|
let props = %s;
|
|
1019
1143
|
<%s {...props} />
|
|
1020
1144
|
React keys must be passed directly to JSX without using spread:
|
|
1021
1145
|
let props = %s;
|
|
1022
|
-
<%s key={someKey} {...props} />`,
|
|
1146
|
+
<%s key={someKey} {...props} />`, Ce, te, bt, te), Je[te + Ce] = !0;
|
|
1023
1147
|
}
|
|
1024
1148
|
}
|
|
1025
|
-
return e ===
|
|
1149
|
+
return e === n ? gt(M) : ht(M), M;
|
|
1026
1150
|
}
|
|
1027
1151
|
}
|
|
1028
|
-
function
|
|
1029
|
-
return
|
|
1152
|
+
function yt(e, a, c) {
|
|
1153
|
+
return Ke(e, a, c, !0);
|
|
1030
1154
|
}
|
|
1031
|
-
function
|
|
1032
|
-
return
|
|
1155
|
+
function xt(e, a, c) {
|
|
1156
|
+
return Ke(e, a, c, !1);
|
|
1033
1157
|
}
|
|
1034
|
-
var
|
|
1035
|
-
|
|
1036
|
-
}()),
|
|
1158
|
+
var mt = xt, vt = yt;
|
|
1159
|
+
ue.Fragment = n, ue.jsx = mt, ue.jsxs = vt;
|
|
1160
|
+
}()), ue;
|
|
1037
1161
|
}
|
|
1038
|
-
process.env.NODE_ENV === "production" ?
|
|
1039
|
-
var s =
|
|
1040
|
-
class
|
|
1162
|
+
process.env.NODE_ENV === "production" ? Ie.exports = St() : Ie.exports = Nt();
|
|
1163
|
+
var s = Ie.exports;
|
|
1164
|
+
class Fe {
|
|
1041
1165
|
/**
|
|
1042
1166
|
* Filter array by predicate function
|
|
1043
1167
|
*/
|
|
1044
|
-
static filter(
|
|
1045
|
-
return
|
|
1168
|
+
static filter(t, r) {
|
|
1169
|
+
return t.filter(r);
|
|
1046
1170
|
}
|
|
1047
1171
|
/**
|
|
1048
1172
|
* Filter by field value
|
|
1049
1173
|
*/
|
|
1050
|
-
static filterBy(r, n
|
|
1051
|
-
return
|
|
1174
|
+
static filterBy(t, r, n) {
|
|
1175
|
+
return t.filter((i) => i[r] === n);
|
|
1052
1176
|
}
|
|
1053
1177
|
/**
|
|
1054
1178
|
* Filter by multiple fields
|
|
1055
1179
|
*/
|
|
1056
|
-
static filterByFields(
|
|
1057
|
-
return
|
|
1180
|
+
static filterByFields(t, r) {
|
|
1181
|
+
return t.filter((n) => Object.entries(r).every(([i, o]) => n[i] === o));
|
|
1058
1182
|
}
|
|
1059
1183
|
/**
|
|
1060
1184
|
* Sort array by field
|
|
1061
1185
|
*/
|
|
1062
|
-
static sort(r, n
|
|
1063
|
-
return [...
|
|
1064
|
-
const
|
|
1065
|
-
if (
|
|
1186
|
+
static sort(t, r, n = "asc") {
|
|
1187
|
+
return [...t].sort((i, o) => {
|
|
1188
|
+
const l = i[r], v = o[r];
|
|
1189
|
+
if (l === v) return 0;
|
|
1066
1190
|
let d = 0;
|
|
1067
|
-
return
|
|
1191
|
+
return l > v && (d = 1), l < v && (d = -1), n === "asc" ? d : -d;
|
|
1068
1192
|
});
|
|
1069
1193
|
}
|
|
1070
1194
|
/**
|
|
1071
1195
|
* Search items by query string in specified fields
|
|
1072
1196
|
*/
|
|
1073
|
-
static search(r, n
|
|
1074
|
-
if (!
|
|
1075
|
-
const i =
|
|
1076
|
-
return
|
|
1077
|
-
const
|
|
1078
|
-
return
|
|
1197
|
+
static search(t, r, n) {
|
|
1198
|
+
if (!r.trim()) return t;
|
|
1199
|
+
const i = r.toLowerCase();
|
|
1200
|
+
return t.filter((o) => n.some((l) => {
|
|
1201
|
+
const v = o[l];
|
|
1202
|
+
return v == null ? !1 : String(v).toLowerCase().includes(i);
|
|
1079
1203
|
}));
|
|
1080
1204
|
}
|
|
1081
1205
|
/**
|
|
1082
1206
|
* Paginate array
|
|
1083
1207
|
*/
|
|
1084
|
-
static paginate(r, n
|
|
1085
|
-
const i = (
|
|
1208
|
+
static paginate(t, r, n) {
|
|
1209
|
+
const i = (r - 1) * n, o = i + n;
|
|
1086
1210
|
return {
|
|
1087
|
-
data:
|
|
1088
|
-
total:
|
|
1089
|
-
page:
|
|
1090
|
-
totalPages: Math.ceil(
|
|
1211
|
+
data: t.slice(i, o),
|
|
1212
|
+
total: t.length,
|
|
1213
|
+
page: r,
|
|
1214
|
+
totalPages: Math.ceil(t.length / n)
|
|
1091
1215
|
};
|
|
1092
1216
|
}
|
|
1093
1217
|
/**
|
|
1094
1218
|
* Group items by field value
|
|
1095
1219
|
*/
|
|
1096
|
-
static groupBy(
|
|
1097
|
-
return
|
|
1098
|
-
const
|
|
1099
|
-
return
|
|
1220
|
+
static groupBy(t, r) {
|
|
1221
|
+
return t.reduce((n, i) => {
|
|
1222
|
+
const o = String(i[r]);
|
|
1223
|
+
return n[o] || (n[o] = []), n[o].push(i), n;
|
|
1100
1224
|
}, {});
|
|
1101
1225
|
}
|
|
1102
1226
|
/**
|
|
1103
1227
|
* Get unique values for a field
|
|
1104
1228
|
*/
|
|
1105
|
-
static unique(
|
|
1106
|
-
const
|
|
1107
|
-
return [...new Set(
|
|
1229
|
+
static unique(t, r) {
|
|
1230
|
+
const n = t.map((i) => i[r]);
|
|
1231
|
+
return [...new Set(n)];
|
|
1108
1232
|
}
|
|
1109
1233
|
/**
|
|
1110
1234
|
* Count items by field value
|
|
1111
1235
|
*/
|
|
1112
|
-
static countBy(
|
|
1113
|
-
return
|
|
1114
|
-
const
|
|
1115
|
-
return
|
|
1236
|
+
static countBy(t, r) {
|
|
1237
|
+
return t.reduce((n, i) => {
|
|
1238
|
+
const o = String(i[r]);
|
|
1239
|
+
return n[o] = (n[o] || 0) + 1, n;
|
|
1116
1240
|
}, {});
|
|
1117
1241
|
}
|
|
1118
1242
|
/**
|
|
1119
1243
|
* Apply multiple operations in sequence
|
|
1120
1244
|
*/
|
|
1121
|
-
static pipe(
|
|
1122
|
-
return
|
|
1245
|
+
static pipe(t, r) {
|
|
1246
|
+
return r.reduce((n, i) => i(n), t);
|
|
1123
1247
|
}
|
|
1124
1248
|
}
|
|
1125
|
-
function
|
|
1126
|
-
endpoint:
|
|
1127
|
-
params:
|
|
1128
|
-
layout:
|
|
1129
|
-
title:
|
|
1249
|
+
function It({
|
|
1250
|
+
endpoint: f,
|
|
1251
|
+
params: t,
|
|
1252
|
+
layout: r = "list",
|
|
1253
|
+
title: n,
|
|
1130
1254
|
emptyMessage: i = "No items found",
|
|
1131
|
-
renderItem:
|
|
1132
|
-
keyExtractor:
|
|
1133
|
-
searchable:
|
|
1255
|
+
renderItem: o,
|
|
1256
|
+
keyExtractor: l = (N, H) => N.id || N._id || String(H),
|
|
1257
|
+
searchable: v = !1,
|
|
1134
1258
|
searchFields: d = [],
|
|
1135
|
-
searchPlaceholder:
|
|
1136
|
-
filters:
|
|
1137
|
-
pageSize:
|
|
1138
|
-
onItemClick:
|
|
1139
|
-
onRefresh:
|
|
1140
|
-
theme:
|
|
1259
|
+
searchPlaceholder: h = "Search...",
|
|
1260
|
+
filters: x = [],
|
|
1261
|
+
pageSize: _ = 20,
|
|
1262
|
+
onItemClick: S,
|
|
1263
|
+
onRefresh: $,
|
|
1264
|
+
theme: P = {}
|
|
1141
1265
|
}) {
|
|
1142
|
-
const { data:
|
|
1143
|
-
if (!
|
|
1144
|
-
let
|
|
1145
|
-
return
|
|
1146
|
-
}, [
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
}, [
|
|
1266
|
+
const { data: N, loading: H, error: z, refetch: g } = Tt(f, t), [I, V] = L(""), [Q, m] = L({}), [T, C] = L(1), p = et(() => {
|
|
1267
|
+
if (!N) return { data: [], total: 0, totalPages: 0 };
|
|
1268
|
+
let E = N;
|
|
1269
|
+
return v && I && d.length > 0 && (E = Fe.search(E, I, d)), Object.keys(Q).length > 0 && (E = Fe.filterByFields(E, Q)), Fe.paginate(E, T, _);
|
|
1270
|
+
}, [N, I, Q, T, _, v, d]);
|
|
1271
|
+
fe(() => {
|
|
1272
|
+
C(1);
|
|
1273
|
+
}, [I, Q]);
|
|
1150
1274
|
const k = () => {
|
|
1151
|
-
|
|
1152
|
-
},
|
|
1153
|
-
background:
|
|
1154
|
-
cardBackground:
|
|
1155
|
-
text:
|
|
1156
|
-
textSecondary:
|
|
1157
|
-
border:
|
|
1158
|
-
primary:
|
|
1159
|
-
},
|
|
1275
|
+
V(""), m({}), C(1), g(), $ == null || $();
|
|
1276
|
+
}, j = {
|
|
1277
|
+
background: P.background || "#ffffff",
|
|
1278
|
+
cardBackground: P.cardBackground || "#f9fafb",
|
|
1279
|
+
text: P.text || "#111827",
|
|
1280
|
+
textSecondary: P.textSecondary || "#6b7280",
|
|
1281
|
+
border: P.border || "#e5e7eb",
|
|
1282
|
+
primary: P.primary || "#3b82f6"
|
|
1283
|
+
}, U = o || ((E) => /* @__PURE__ */ s.jsxs("div", { style: {
|
|
1160
1284
|
padding: "16px",
|
|
1161
|
-
cursor:
|
|
1285
|
+
cursor: S ? "pointer" : "default"
|
|
1162
1286
|
}, children: [
|
|
1163
|
-
/* @__PURE__ */ s.jsx("div", { style: { fontSize: "14px", fontWeight: 500, color:
|
|
1164
|
-
|
|
1287
|
+
/* @__PURE__ */ s.jsx("div", { style: { fontSize: "14px", fontWeight: 500, color: j.text }, children: E.title || E.name || E.label || "Untitled" }),
|
|
1288
|
+
E.description && /* @__PURE__ */ s.jsx("div", { style: { fontSize: "13px", color: j.textSecondary, marginTop: "4px" }, children: E.description })
|
|
1165
1289
|
] }));
|
|
1166
|
-
return
|
|
1290
|
+
return H && !N ? /* @__PURE__ */ s.jsx("div", { style: {
|
|
1167
1291
|
display: "flex",
|
|
1168
1292
|
alignItems: "center",
|
|
1169
1293
|
justifyContent: "center",
|
|
1170
1294
|
padding: "48px",
|
|
1171
|
-
color:
|
|
1172
|
-
}, children: "Loading..." }) :
|
|
1295
|
+
color: j.textSecondary
|
|
1296
|
+
}, children: "Loading..." }) : z ? /* @__PURE__ */ s.jsxs("div", { style: {
|
|
1173
1297
|
padding: "24px",
|
|
1174
1298
|
textAlign: "center",
|
|
1175
1299
|
color: "#ef4444"
|
|
1176
1300
|
}, children: [
|
|
1177
1301
|
/* @__PURE__ */ s.jsx("div", { style: { fontWeight: 500, marginBottom: "8px" }, children: "Error" }),
|
|
1178
|
-
/* @__PURE__ */ s.jsx("div", { style: { fontSize: "14px" }, children:
|
|
1302
|
+
/* @__PURE__ */ s.jsx("div", { style: { fontSize: "14px" }, children: z.message }),
|
|
1179
1303
|
/* @__PURE__ */ s.jsx(
|
|
1180
1304
|
"button",
|
|
1181
1305
|
{
|
|
@@ -1183,7 +1307,7 @@ function Dr({
|
|
|
1183
1307
|
style: {
|
|
1184
1308
|
marginTop: "16px",
|
|
1185
1309
|
padding: "8px 16px",
|
|
1186
|
-
background:
|
|
1310
|
+
background: j.primary,
|
|
1187
1311
|
color: "white",
|
|
1188
1312
|
border: "none",
|
|
1189
1313
|
borderRadius: "6px",
|
|
@@ -1193,26 +1317,26 @@ function Dr({
|
|
|
1193
1317
|
}
|
|
1194
1318
|
)
|
|
1195
1319
|
] }) : /* @__PURE__ */ s.jsxs("div", { style: {
|
|
1196
|
-
background:
|
|
1320
|
+
background: j.background,
|
|
1197
1321
|
borderRadius: "12px",
|
|
1198
1322
|
overflow: "hidden"
|
|
1199
1323
|
}, children: [
|
|
1200
|
-
(
|
|
1324
|
+
(n || v || x.length > 0) && /* @__PURE__ */ s.jsxs("div", { style: {
|
|
1201
1325
|
padding: "16px",
|
|
1202
|
-
borderBottom: `1px solid ${
|
|
1326
|
+
borderBottom: `1px solid ${j.border}`
|
|
1203
1327
|
}, children: [
|
|
1204
1328
|
/* @__PURE__ */ s.jsxs("div", { style: {
|
|
1205
1329
|
display: "flex",
|
|
1206
1330
|
alignItems: "center",
|
|
1207
1331
|
justifyContent: "space-between",
|
|
1208
|
-
marginBottom:
|
|
1332
|
+
marginBottom: v || x.length > 0 ? "12px" : "0"
|
|
1209
1333
|
}, children: [
|
|
1210
|
-
|
|
1334
|
+
n && /* @__PURE__ */ s.jsx("h2", { style: {
|
|
1211
1335
|
margin: 0,
|
|
1212
1336
|
fontSize: "18px",
|
|
1213
1337
|
fontWeight: 600,
|
|
1214
|
-
color:
|
|
1215
|
-
}, children:
|
|
1338
|
+
color: j.text
|
|
1339
|
+
}, children: n }),
|
|
1216
1340
|
/* @__PURE__ */ s.jsx(
|
|
1217
1341
|
"button",
|
|
1218
1342
|
{
|
|
@@ -1220,9 +1344,9 @@ function Dr({
|
|
|
1220
1344
|
style: {
|
|
1221
1345
|
padding: "6px 12px",
|
|
1222
1346
|
background: "transparent",
|
|
1223
|
-
border: `1px solid ${
|
|
1347
|
+
border: `1px solid ${j.border}`,
|
|
1224
1348
|
borderRadius: "6px",
|
|
1225
|
-
color:
|
|
1349
|
+
color: j.textSecondary,
|
|
1226
1350
|
cursor: "pointer",
|
|
1227
1351
|
fontSize: "13px"
|
|
1228
1352
|
},
|
|
@@ -1230,17 +1354,17 @@ function Dr({
|
|
|
1230
1354
|
}
|
|
1231
1355
|
)
|
|
1232
1356
|
] }),
|
|
1233
|
-
|
|
1357
|
+
v && /* @__PURE__ */ s.jsx(
|
|
1234
1358
|
"input",
|
|
1235
1359
|
{
|
|
1236
1360
|
type: "text",
|
|
1237
|
-
placeholder:
|
|
1238
|
-
value:
|
|
1239
|
-
onChange: (
|
|
1361
|
+
placeholder: h,
|
|
1362
|
+
value: I,
|
|
1363
|
+
onChange: (E) => V(E.target.value),
|
|
1240
1364
|
style: {
|
|
1241
1365
|
width: "100%",
|
|
1242
1366
|
padding: "8px 12px",
|
|
1243
|
-
border: `1px solid ${
|
|
1367
|
+
border: `1px solid ${j.border}`,
|
|
1244
1368
|
borderRadius: "8px",
|
|
1245
1369
|
fontSize: "14px",
|
|
1246
1370
|
outline: "none"
|
|
@@ -1249,61 +1373,61 @@ function Dr({
|
|
|
1249
1373
|
)
|
|
1250
1374
|
] }),
|
|
1251
1375
|
/* @__PURE__ */ s.jsx("div", { style: {
|
|
1252
|
-
display:
|
|
1253
|
-
flexDirection:
|
|
1254
|
-
gridTemplateColumns:
|
|
1255
|
-
gap:
|
|
1256
|
-
padding:
|
|
1257
|
-
}, children:
|
|
1376
|
+
display: r === "grid" ? "grid" : "flex",
|
|
1377
|
+
flexDirection: r === "list" ? "column" : void 0,
|
|
1378
|
+
gridTemplateColumns: r === "grid" ? "repeat(auto-fill, minmax(250px, 1fr))" : void 0,
|
|
1379
|
+
gap: r === "list" ? "0" : "16px",
|
|
1380
|
+
padding: r === "list" ? "0" : "16px"
|
|
1381
|
+
}, children: p.data.length === 0 ? /* @__PURE__ */ s.jsx("div", { style: {
|
|
1258
1382
|
padding: "48px",
|
|
1259
1383
|
textAlign: "center",
|
|
1260
|
-
color:
|
|
1261
|
-
}, children: i }) :
|
|
1384
|
+
color: j.textSecondary
|
|
1385
|
+
}, children: i }) : p.data.map((E, D) => /* @__PURE__ */ s.jsx(
|
|
1262
1386
|
"div",
|
|
1263
1387
|
{
|
|
1264
|
-
onClick: () =>
|
|
1388
|
+
onClick: () => S == null ? void 0 : S(E),
|
|
1265
1389
|
style: {
|
|
1266
|
-
background:
|
|
1267
|
-
borderRadius:
|
|
1268
|
-
borderBottom:
|
|
1390
|
+
background: j.cardBackground,
|
|
1391
|
+
borderRadius: r === "list" ? "0" : "8px",
|
|
1392
|
+
borderBottom: r === "list" ? `1px solid ${j.border}` : "none",
|
|
1269
1393
|
transition: "all 0.15s ease"
|
|
1270
1394
|
},
|
|
1271
|
-
onMouseEnter: (
|
|
1272
|
-
|
|
1395
|
+
onMouseEnter: (Y) => {
|
|
1396
|
+
S && (Y.currentTarget.style.background = j.border);
|
|
1273
1397
|
},
|
|
1274
|
-
onMouseLeave: (
|
|
1275
|
-
|
|
1398
|
+
onMouseLeave: (Y) => {
|
|
1399
|
+
Y.currentTarget.style.background = j.cardBackground;
|
|
1276
1400
|
},
|
|
1277
|
-
children:
|
|
1401
|
+
children: U(E, D)
|
|
1278
1402
|
},
|
|
1279
|
-
|
|
1403
|
+
l(E, D)
|
|
1280
1404
|
)) }),
|
|
1281
|
-
|
|
1405
|
+
p.totalPages > 1 && /* @__PURE__ */ s.jsxs("div", { style: {
|
|
1282
1406
|
padding: "16px",
|
|
1283
|
-
borderTop: `1px solid ${
|
|
1407
|
+
borderTop: `1px solid ${j.border}`,
|
|
1284
1408
|
display: "flex",
|
|
1285
1409
|
alignItems: "center",
|
|
1286
1410
|
justifyContent: "space-between"
|
|
1287
1411
|
}, children: [
|
|
1288
|
-
/* @__PURE__ */ s.jsxs("div", { style: { fontSize: "13px", color:
|
|
1412
|
+
/* @__PURE__ */ s.jsxs("div", { style: { fontSize: "13px", color: j.textSecondary }, children: [
|
|
1289
1413
|
"Page ",
|
|
1290
|
-
|
|
1414
|
+
T,
|
|
1291
1415
|
" of ",
|
|
1292
|
-
|
|
1416
|
+
p.totalPages
|
|
1293
1417
|
] }),
|
|
1294
1418
|
/* @__PURE__ */ s.jsxs("div", { style: { display: "flex", gap: "8px" }, children: [
|
|
1295
1419
|
/* @__PURE__ */ s.jsx(
|
|
1296
1420
|
"button",
|
|
1297
1421
|
{
|
|
1298
|
-
onClick: () =>
|
|
1299
|
-
disabled:
|
|
1422
|
+
onClick: () => C((E) => Math.max(1, E - 1)),
|
|
1423
|
+
disabled: T === 1,
|
|
1300
1424
|
style: {
|
|
1301
1425
|
padding: "6px 12px",
|
|
1302
|
-
border: `1px solid ${
|
|
1426
|
+
border: `1px solid ${j.border}`,
|
|
1303
1427
|
borderRadius: "6px",
|
|
1304
1428
|
background: "white",
|
|
1305
|
-
cursor:
|
|
1306
|
-
opacity:
|
|
1429
|
+
cursor: T === 1 ? "not-allowed" : "pointer",
|
|
1430
|
+
opacity: T === 1 ? 0.5 : 1
|
|
1307
1431
|
},
|
|
1308
1432
|
children: "Previous"
|
|
1309
1433
|
}
|
|
@@ -1311,15 +1435,15 @@ function Dr({
|
|
|
1311
1435
|
/* @__PURE__ */ s.jsx(
|
|
1312
1436
|
"button",
|
|
1313
1437
|
{
|
|
1314
|
-
onClick: () =>
|
|
1315
|
-
disabled:
|
|
1438
|
+
onClick: () => C((E) => Math.min(p.totalPages, E + 1)),
|
|
1439
|
+
disabled: T === p.totalPages,
|
|
1316
1440
|
style: {
|
|
1317
1441
|
padding: "6px 12px",
|
|
1318
|
-
border: `1px solid ${
|
|
1442
|
+
border: `1px solid ${j.border}`,
|
|
1319
1443
|
borderRadius: "6px",
|
|
1320
1444
|
background: "white",
|
|
1321
|
-
cursor:
|
|
1322
|
-
opacity:
|
|
1445
|
+
cursor: T === p.totalPages ? "not-allowed" : "pointer",
|
|
1446
|
+
opacity: T === p.totalPages ? 0.5 : 1
|
|
1323
1447
|
},
|
|
1324
1448
|
children: "Next"
|
|
1325
1449
|
}
|
|
@@ -1328,189 +1452,189 @@ function Dr({
|
|
|
1328
1452
|
] })
|
|
1329
1453
|
] });
|
|
1330
1454
|
}
|
|
1331
|
-
function
|
|
1332
|
-
item:
|
|
1333
|
-
onClick:
|
|
1334
|
-
title:
|
|
1335
|
-
subtitle:
|
|
1336
|
-
image: i = (
|
|
1337
|
-
badge:
|
|
1455
|
+
function Mt({
|
|
1456
|
+
item: f,
|
|
1457
|
+
onClick: t,
|
|
1458
|
+
title: r = (l) => l.title || l.name || l.label || "Untitled",
|
|
1459
|
+
subtitle: n = (l) => l.description || l.subtitle || "",
|
|
1460
|
+
image: i = (l) => l.image || l.thumbnail || l.photo,
|
|
1461
|
+
badge: o = (l) => l.badge || l.tag || l.type
|
|
1338
1462
|
}) {
|
|
1339
|
-
const
|
|
1463
|
+
const l = r(f), v = n(f), d = i(f), h = o(f);
|
|
1340
1464
|
return /* @__PURE__ */ s.jsxs(
|
|
1341
1465
|
"div",
|
|
1342
1466
|
{
|
|
1343
|
-
onClick:
|
|
1467
|
+
onClick: t,
|
|
1344
1468
|
className: `
|
|
1345
1469
|
flex items-center gap-4 p-4 border-b border-gray-200
|
|
1346
1470
|
hover:bg-gray-50 transition-colors
|
|
1347
|
-
${
|
|
1471
|
+
${t ? "cursor-pointer" : ""}
|
|
1348
1472
|
`,
|
|
1349
1473
|
children: [
|
|
1350
1474
|
d && /* @__PURE__ */ s.jsx("div", { className: "flex-shrink-0", children: /* @__PURE__ */ s.jsx(
|
|
1351
1475
|
"img",
|
|
1352
1476
|
{
|
|
1353
1477
|
src: d,
|
|
1354
|
-
alt:
|
|
1478
|
+
alt: l,
|
|
1355
1479
|
className: "w-16 h-16 object-cover rounded-lg"
|
|
1356
1480
|
}
|
|
1357
1481
|
) }),
|
|
1358
1482
|
/* @__PURE__ */ s.jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
1359
1483
|
/* @__PURE__ */ s.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1360
|
-
/* @__PURE__ */ s.jsx("h3", { className: "font-medium text-gray-900 truncate", children:
|
|
1361
|
-
|
|
1484
|
+
/* @__PURE__ */ s.jsx("h3", { className: "font-medium text-gray-900 truncate", children: l }),
|
|
1485
|
+
h && /* @__PURE__ */ s.jsx("span", { className: "px-2 py-0.5 text-xs font-medium bg-blue-100 text-blue-800 rounded-full", children: h })
|
|
1362
1486
|
] }),
|
|
1363
|
-
|
|
1487
|
+
v && /* @__PURE__ */ s.jsx("p", { className: "text-sm text-gray-600 truncate mt-0.5", children: v })
|
|
1364
1488
|
] }),
|
|
1365
|
-
|
|
1489
|
+
t && /* @__PURE__ */ s.jsx("div", { className: "flex-shrink-0 text-gray-400", children: /* @__PURE__ */ s.jsx("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ s.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5l7 7-7 7" }) }) })
|
|
1366
1490
|
]
|
|
1367
1491
|
}
|
|
1368
1492
|
);
|
|
1369
1493
|
}
|
|
1370
|
-
function
|
|
1371
|
-
item:
|
|
1372
|
-
onClose:
|
|
1373
|
-
title:
|
|
1374
|
-
image:
|
|
1494
|
+
function Ut({
|
|
1495
|
+
item: f,
|
|
1496
|
+
onClose: t,
|
|
1497
|
+
title: r = (o) => o.title || o.name || o.label || "Detail",
|
|
1498
|
+
image: n = (o) => o.image || o.thumbnail || o.photo,
|
|
1375
1499
|
fields: i = []
|
|
1376
1500
|
}) {
|
|
1377
|
-
if (!
|
|
1378
|
-
const
|
|
1501
|
+
if (!f) return null;
|
|
1502
|
+
const o = r(f), l = n(f);
|
|
1379
1503
|
return /* @__PURE__ */ s.jsx("div", { className: "fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4", children: /* @__PURE__ */ s.jsxs("div", { className: "bg-white rounded-xl max-w-2xl w-full max-h-[90vh] overflow-y-auto shadow-2xl", children: [
|
|
1380
1504
|
/* @__PURE__ */ s.jsxs("div", { className: "sticky top-0 bg-white border-b border-gray-200 px-6 py-4 flex items-center justify-between", children: [
|
|
1381
|
-
/* @__PURE__ */ s.jsx("h2", { className: "text-xl font-semibold text-gray-900", children:
|
|
1382
|
-
|
|
1505
|
+
/* @__PURE__ */ s.jsx("h2", { className: "text-xl font-semibold text-gray-900", children: o }),
|
|
1506
|
+
t && /* @__PURE__ */ s.jsx(
|
|
1383
1507
|
"button",
|
|
1384
1508
|
{
|
|
1385
|
-
onClick:
|
|
1509
|
+
onClick: t,
|
|
1386
1510
|
className: "p-2 hover:bg-gray-100 rounded-lg transition-colors",
|
|
1387
1511
|
children: /* @__PURE__ */ s.jsx("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ s.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) })
|
|
1388
1512
|
}
|
|
1389
1513
|
)
|
|
1390
1514
|
] }),
|
|
1391
1515
|
/* @__PURE__ */ s.jsxs("div", { className: "p-6", children: [
|
|
1392
|
-
|
|
1516
|
+
l && /* @__PURE__ */ s.jsx("div", { className: "mb-6", children: /* @__PURE__ */ s.jsx(
|
|
1393
1517
|
"img",
|
|
1394
1518
|
{
|
|
1395
|
-
src:
|
|
1396
|
-
alt:
|
|
1519
|
+
src: l,
|
|
1520
|
+
alt: o,
|
|
1397
1521
|
className: "w-full h-64 object-cover rounded-lg"
|
|
1398
1522
|
}
|
|
1399
1523
|
) }),
|
|
1400
|
-
i.length > 0 && /* @__PURE__ */ s.jsx("div", { className: "space-y-4", children: i.map((
|
|
1401
|
-
const
|
|
1402
|
-
return
|
|
1403
|
-
/* @__PURE__ */ s.jsx("div", { className: "text-sm font-medium text-gray-500 mb-1", children:
|
|
1404
|
-
/* @__PURE__ */ s.jsx("div", { className: "text-base text-gray-900", children: typeof
|
|
1524
|
+
i.length > 0 && /* @__PURE__ */ s.jsx("div", { className: "space-y-4", children: i.map((v, d) => {
|
|
1525
|
+
const h = v.value(f);
|
|
1526
|
+
return h == null || h === "" ? null : /* @__PURE__ */ s.jsxs("div", { children: [
|
|
1527
|
+
/* @__PURE__ */ s.jsx("div", { className: "text-sm font-medium text-gray-500 mb-1", children: v.label }),
|
|
1528
|
+
/* @__PURE__ */ s.jsx("div", { className: "text-base text-gray-900", children: typeof h == "object" ? JSON.stringify(h, null, 2) : String(h) })
|
|
1405
1529
|
] }, d);
|
|
1406
1530
|
}) }),
|
|
1407
|
-
i.length === 0 && /* @__PURE__ */ s.jsx("pre", { className: "bg-gray-50 p-4 rounded-lg text-sm overflow-x-auto", children: JSON.stringify(
|
|
1531
|
+
i.length === 0 && /* @__PURE__ */ s.jsx("pre", { className: "bg-gray-50 p-4 rounded-lg text-sm overflow-x-auto", children: JSON.stringify(f, null, 2) })
|
|
1408
1532
|
] }),
|
|
1409
|
-
|
|
1533
|
+
t && /* @__PURE__ */ s.jsx("div", { className: "sticky bottom-0 bg-gray-50 border-t border-gray-200 px-6 py-4", children: /* @__PURE__ */ s.jsx(
|
|
1410
1534
|
"button",
|
|
1411
1535
|
{
|
|
1412
|
-
onClick:
|
|
1536
|
+
onClick: t,
|
|
1413
1537
|
className: "w-full px-4 py-2 bg-gray-900 text-white rounded-lg hover:bg-gray-800 transition-colors font-medium",
|
|
1414
1538
|
children: "Close"
|
|
1415
1539
|
}
|
|
1416
1540
|
) })
|
|
1417
1541
|
] }) });
|
|
1418
1542
|
}
|
|
1419
|
-
const
|
|
1543
|
+
const Ot = {
|
|
1420
1544
|
small: "w-32 h-32",
|
|
1421
1545
|
medium: "w-48 h-48",
|
|
1422
1546
|
large: "w-64 h-64"
|
|
1423
1547
|
};
|
|
1424
|
-
function
|
|
1425
|
-
nodes:
|
|
1426
|
-
cardCount:
|
|
1427
|
-
minInterval:
|
|
1428
|
-
maxInterval:
|
|
1548
|
+
function Bt({
|
|
1549
|
+
nodes: f,
|
|
1550
|
+
cardCount: t = 2,
|
|
1551
|
+
minInterval: r = 1e3,
|
|
1552
|
+
maxInterval: n = 3e3,
|
|
1429
1553
|
onCardClick: i,
|
|
1430
|
-
cardSize:
|
|
1431
|
-
className:
|
|
1554
|
+
cardSize: o = "medium",
|
|
1555
|
+
className: l = ""
|
|
1432
1556
|
}) {
|
|
1433
|
-
const
|
|
1434
|
-
const
|
|
1435
|
-
if (
|
|
1436
|
-
const
|
|
1437
|
-
return
|
|
1438
|
-
}, [
|
|
1439
|
-
|
|
1440
|
-
if (
|
|
1441
|
-
|
|
1557
|
+
const v = Math.min(Math.max(t, 1), 5), [d, h] = L([]), [x, _] = L([]), [S, $] = L(Array(v).fill(!1)), [P, N] = L(Array(v).fill(!1)), H = Xe([]), z = X((m) => {
|
|
1558
|
+
const T = f.filter((p) => !m.includes(p._id));
|
|
1559
|
+
if (T.length === 0) return null;
|
|
1560
|
+
const C = Math.floor(Math.random() * T.length);
|
|
1561
|
+
return T[C];
|
|
1562
|
+
}, [f]), g = X(() => Math.random() * (n - r) + r, [r, n]);
|
|
1563
|
+
fe(() => {
|
|
1564
|
+
if (f.length === 0) {
|
|
1565
|
+
h([]), _([]);
|
|
1442
1566
|
return;
|
|
1443
1567
|
}
|
|
1444
|
-
const
|
|
1445
|
-
for (let
|
|
1446
|
-
const k =
|
|
1447
|
-
k && (
|
|
1568
|
+
const m = [], T = [], C = [];
|
|
1569
|
+
for (let p = 0; p < v && p < f.length; p++) {
|
|
1570
|
+
const k = z(C);
|
|
1571
|
+
k && (m.push(k), C.push(k._id));
|
|
1448
1572
|
}
|
|
1449
|
-
for (let
|
|
1573
|
+
for (let p = 0; p < m.length; p++) {
|
|
1450
1574
|
const k = [
|
|
1451
|
-
|
|
1452
|
-
...
|
|
1453
|
-
],
|
|
1454
|
-
|
|
1575
|
+
m[p]._id,
|
|
1576
|
+
...m.filter((Z, U) => U !== p).map((Z) => Z._id)
|
|
1577
|
+
], j = z(k);
|
|
1578
|
+
j ? T.push(j) : T.push(m[p]);
|
|
1455
1579
|
}
|
|
1456
|
-
|
|
1457
|
-
}, [
|
|
1458
|
-
const
|
|
1459
|
-
const
|
|
1460
|
-
|
|
1461
|
-
const k = [...
|
|
1462
|
-
return k[
|
|
1580
|
+
h(m), _(T);
|
|
1581
|
+
}, [f, v, z]);
|
|
1582
|
+
const I = X((m) => {
|
|
1583
|
+
const T = g(), C = setTimeout(() => {
|
|
1584
|
+
$((p) => {
|
|
1585
|
+
const k = [...p];
|
|
1586
|
+
return k[m] = !k[m], k;
|
|
1463
1587
|
}), setTimeout(() => {
|
|
1464
|
-
|
|
1465
|
-
const k = [...
|
|
1466
|
-
return k[
|
|
1588
|
+
N((p) => {
|
|
1589
|
+
const k = [...p];
|
|
1590
|
+
return k[m] = !k[m], k;
|
|
1467
1591
|
}), setTimeout(() => {
|
|
1468
|
-
const
|
|
1469
|
-
|
|
1470
|
-
const
|
|
1471
|
-
return
|
|
1472
|
-
}),
|
|
1473
|
-
const
|
|
1474
|
-
(
|
|
1475
|
-
...d.filter((
|
|
1476
|
-
...k.filter((
|
|
1477
|
-
],
|
|
1478
|
-
return
|
|
1592
|
+
const p = !P[m];
|
|
1593
|
+
p && h((k) => {
|
|
1594
|
+
const j = [...k];
|
|
1595
|
+
return j[m] = x[m], j;
|
|
1596
|
+
}), _((k) => {
|
|
1597
|
+
const j = [...k], U = [
|
|
1598
|
+
(p ? x[m] : d[m])._id,
|
|
1599
|
+
...d.filter((D, Y) => Y !== m).map((D) => D._id),
|
|
1600
|
+
...k.filter((D, Y) => Y !== m).map((D) => D._id)
|
|
1601
|
+
], E = z(U);
|
|
1602
|
+
return E && (j[m] = E), j;
|
|
1479
1603
|
}), setTimeout(() => {
|
|
1480
|
-
|
|
1604
|
+
I(m);
|
|
1481
1605
|
}, 150);
|
|
1482
1606
|
}, 200);
|
|
1483
1607
|
}, 150);
|
|
1484
|
-
},
|
|
1485
|
-
|
|
1486
|
-
}, [
|
|
1487
|
-
|
|
1488
|
-
if (!(d.length === 0 ||
|
|
1489
|
-
|
|
1490
|
-
for (let
|
|
1491
|
-
|
|
1608
|
+
}, T);
|
|
1609
|
+
H.current[m] = C;
|
|
1610
|
+
}, [g, z, d, x, P]), V = Xe(!1);
|
|
1611
|
+
fe(() => {
|
|
1612
|
+
if (!(d.length === 0 || f.length <= 1) && !V.current) {
|
|
1613
|
+
V.current = !0;
|
|
1614
|
+
for (let m = 0; m < d.length; m++)
|
|
1615
|
+
I(m);
|
|
1492
1616
|
return () => {
|
|
1493
|
-
|
|
1617
|
+
H.current.forEach((m) => clearTimeout(m)), H.current = [], V.current = !1;
|
|
1494
1618
|
};
|
|
1495
1619
|
}
|
|
1496
|
-
}, [d.length,
|
|
1497
|
-
const
|
|
1498
|
-
i && i(
|
|
1620
|
+
}, [d.length, f.length]);
|
|
1621
|
+
const Q = (m) => {
|
|
1622
|
+
i && i(m);
|
|
1499
1623
|
};
|
|
1500
|
-
return
|
|
1501
|
-
const
|
|
1624
|
+
return f.length === 0 ? /* @__PURE__ */ s.jsx("div", { className: `flex items-center justify-center p-8 ${l}`, children: /* @__PURE__ */ s.jsx("p", { className: "text-gray-500", children: "No nodes available" }) }) : d.length === 0 ? /* @__PURE__ */ s.jsx("div", { className: `flex items-center justify-center p-8 ${l}`, children: /* @__PURE__ */ s.jsx("p", { className: "text-gray-500", children: "Loading..." }) }) : /* @__PURE__ */ s.jsx("div", { className: `flex gap-4 justify-center items-center flex-wrap ${l}`, children: d.map((m, T) => {
|
|
1625
|
+
const C = x[T], p = P[T];
|
|
1502
1626
|
return /* @__PURE__ */ s.jsx(
|
|
1503
1627
|
"div",
|
|
1504
1628
|
{
|
|
1505
|
-
className: `relative ${
|
|
1629
|
+
className: `relative ${Ot[o]}`,
|
|
1506
1630
|
style: { perspective: "1000px" },
|
|
1507
|
-
onClick: () =>
|
|
1631
|
+
onClick: () => Q(p ? C : m),
|
|
1508
1632
|
children: /* @__PURE__ */ s.jsxs(
|
|
1509
1633
|
"div",
|
|
1510
1634
|
{
|
|
1511
1635
|
className: "w-full h-full rounded-lg shadow-lg overflow-hidden cursor-pointer hover:shadow-xl",
|
|
1512
1636
|
style: {
|
|
1513
|
-
transform: `rotateY(${
|
|
1637
|
+
transform: `rotateY(${S[T] ? 180 : 0}deg)`,
|
|
1514
1638
|
transition: "transform 0.5s",
|
|
1515
1639
|
transformStyle: "preserve-3d"
|
|
1516
1640
|
},
|
|
@@ -1520,13 +1644,13 @@ function Mr({
|
|
|
1520
1644
|
{
|
|
1521
1645
|
className: "absolute inset-0 transition-opacity duration-200",
|
|
1522
1646
|
style: {
|
|
1523
|
-
opacity:
|
|
1647
|
+
opacity: p ? 0 : 1
|
|
1524
1648
|
},
|
|
1525
1649
|
children: /* @__PURE__ */ s.jsxs(
|
|
1526
1650
|
"div",
|
|
1527
1651
|
{
|
|
1528
1652
|
style: {
|
|
1529
|
-
transform:
|
|
1653
|
+
transform: S[T] ? "scaleX(-1)" : "scaleX(1)",
|
|
1530
1654
|
width: "100%",
|
|
1531
1655
|
height: "100%"
|
|
1532
1656
|
},
|
|
@@ -1534,29 +1658,29 @@ function Mr({
|
|
|
1534
1658
|
/* @__PURE__ */ s.jsx(
|
|
1535
1659
|
"img",
|
|
1536
1660
|
{
|
|
1537
|
-
src:
|
|
1538
|
-
alt:
|
|
1661
|
+
src: m.data.image,
|
|
1662
|
+
alt: m.title,
|
|
1539
1663
|
className: "w-full h-full object-cover"
|
|
1540
1664
|
}
|
|
1541
1665
|
),
|
|
1542
|
-
/* @__PURE__ */ s.jsx("div", { className: "absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-2", children: /* @__PURE__ */ s.jsx("p", { className: "text-white text-sm font-medium truncate", children:
|
|
1666
|
+
/* @__PURE__ */ s.jsx("div", { className: "absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-2", children: /* @__PURE__ */ s.jsx("p", { className: "text-white text-sm font-medium truncate", children: m.title }) })
|
|
1543
1667
|
]
|
|
1544
1668
|
}
|
|
1545
1669
|
)
|
|
1546
1670
|
}
|
|
1547
1671
|
),
|
|
1548
|
-
|
|
1672
|
+
C && /* @__PURE__ */ s.jsx(
|
|
1549
1673
|
"div",
|
|
1550
1674
|
{
|
|
1551
1675
|
className: "absolute inset-0 transition-opacity duration-200",
|
|
1552
1676
|
style: {
|
|
1553
|
-
opacity:
|
|
1677
|
+
opacity: p ? 1 : 0
|
|
1554
1678
|
},
|
|
1555
1679
|
children: /* @__PURE__ */ s.jsxs(
|
|
1556
1680
|
"div",
|
|
1557
1681
|
{
|
|
1558
1682
|
style: {
|
|
1559
|
-
transform:
|
|
1683
|
+
transform: S[T] ? "scaleX(-1)" : "scaleX(1)",
|
|
1560
1684
|
width: "100%",
|
|
1561
1685
|
height: "100%"
|
|
1562
1686
|
},
|
|
@@ -1564,12 +1688,12 @@ function Mr({
|
|
|
1564
1688
|
/* @__PURE__ */ s.jsx(
|
|
1565
1689
|
"img",
|
|
1566
1690
|
{
|
|
1567
|
-
src:
|
|
1568
|
-
alt:
|
|
1691
|
+
src: C.data.image,
|
|
1692
|
+
alt: C.title,
|
|
1569
1693
|
className: "w-full h-full object-cover"
|
|
1570
1694
|
}
|
|
1571
1695
|
),
|
|
1572
|
-
/* @__PURE__ */ s.jsx("div", { className: "absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-2", children: /* @__PURE__ */ s.jsx("p", { className: "text-white text-sm font-medium truncate", children:
|
|
1696
|
+
/* @__PURE__ */ s.jsx("div", { className: "absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-2", children: /* @__PURE__ */ s.jsx("p", { className: "text-white text-sm font-medium truncate", children: C.title }) })
|
|
1573
1697
|
]
|
|
1574
1698
|
}
|
|
1575
1699
|
)
|
|
@@ -1579,21 +1703,331 @@ function Mr({
|
|
|
1579
1703
|
}
|
|
1580
1704
|
)
|
|
1581
1705
|
},
|
|
1582
|
-
`slot-${
|
|
1706
|
+
`slot-${T}`
|
|
1583
1707
|
);
|
|
1584
1708
|
}) });
|
|
1585
1709
|
}
|
|
1710
|
+
function je(f) {
|
|
1711
|
+
if (!f) return "";
|
|
1712
|
+
const t = /=\?([^?]+)\?([BQbq])\?([^?]*)\?=/g;
|
|
1713
|
+
return f.replace(t, (r, n, i, o) => {
|
|
1714
|
+
try {
|
|
1715
|
+
if (i.toUpperCase() === "B") {
|
|
1716
|
+
const l = atob(o);
|
|
1717
|
+
return decodeURIComponent(escape(l));
|
|
1718
|
+
} else if (i.toUpperCase() === "Q") {
|
|
1719
|
+
const l = o.replace(/_/g, " ").replace(
|
|
1720
|
+
/=([0-9A-Fa-f]{2})/g,
|
|
1721
|
+
(v, d) => String.fromCharCode(parseInt(d, 16))
|
|
1722
|
+
);
|
|
1723
|
+
return decodeURIComponent(escape(l));
|
|
1724
|
+
}
|
|
1725
|
+
} catch (l) {
|
|
1726
|
+
console.warn("MIME decode error:", l);
|
|
1727
|
+
}
|
|
1728
|
+
return r;
|
|
1729
|
+
}).replace(/\s+/g, " ").trim();
|
|
1730
|
+
}
|
|
1731
|
+
const Pt = {
|
|
1732
|
+
background: "#ffffff",
|
|
1733
|
+
cardBackground: "#ffffff",
|
|
1734
|
+
selectedBackground: "#f5f5f5",
|
|
1735
|
+
unreadBackground: "#ffffff",
|
|
1736
|
+
text: "#111827",
|
|
1737
|
+
textSecondary: "#6b7280",
|
|
1738
|
+
border: "#e5e7eb",
|
|
1739
|
+
primary: "#3b82f6",
|
|
1740
|
+
danger: "#ef4444"
|
|
1741
|
+
};
|
|
1742
|
+
function Lt({
|
|
1743
|
+
baseUrl: f,
|
|
1744
|
+
systemId: t,
|
|
1745
|
+
accountId: r,
|
|
1746
|
+
limit: n = 30,
|
|
1747
|
+
selectable: i = !0,
|
|
1748
|
+
showDetail: o = !1,
|
|
1749
|
+
emptyMessage: l = "No emails",
|
|
1750
|
+
autoLoad: v = !0,
|
|
1751
|
+
onSelect: d,
|
|
1752
|
+
onSelectionChange: h,
|
|
1753
|
+
onDelete: x,
|
|
1754
|
+
onError: _,
|
|
1755
|
+
renderItem: S,
|
|
1756
|
+
renderDetail: $,
|
|
1757
|
+
renderActions: P,
|
|
1758
|
+
renderEmpty: N,
|
|
1759
|
+
renderLoading: H,
|
|
1760
|
+
theme: z = {}
|
|
1761
|
+
}) {
|
|
1762
|
+
const g = { ...Pt, ...z }, [I, V] = L([]), [Q, m] = L(!1), [T, C] = L(null), [p, k] = L(/* @__PURE__ */ new Set()), [j, Z] = L(null), [U, E] = L(null), D = et(() => t ? new Et({ baseUrl: f, system_id: t }) : null, [f, t]), Y = X(async () => {
|
|
1763
|
+
if (D) {
|
|
1764
|
+
m(!0), C(null);
|
|
1765
|
+
try {
|
|
1766
|
+
const u = await D.listEmails(r, n);
|
|
1767
|
+
if (u != null && u.messages) {
|
|
1768
|
+
const b = [...u.messages].sort(
|
|
1769
|
+
(B, W) => new Date(W.date).getTime() - new Date(B.date).getTime()
|
|
1770
|
+
);
|
|
1771
|
+
V(b);
|
|
1772
|
+
}
|
|
1773
|
+
} catch (u) {
|
|
1774
|
+
const b = u instanceof Error ? u : new Error("Failed to fetch emails");
|
|
1775
|
+
C(b.message), _ == null || _(b);
|
|
1776
|
+
}
|
|
1777
|
+
m(!1);
|
|
1778
|
+
}
|
|
1779
|
+
}, [D, r, n, _]);
|
|
1780
|
+
fe(() => {
|
|
1781
|
+
v && Y();
|
|
1782
|
+
}, [v, Y]);
|
|
1783
|
+
const pe = X((u, b, B) => {
|
|
1784
|
+
if (!i) {
|
|
1785
|
+
d == null || d(u), o && E(u);
|
|
1786
|
+
return;
|
|
1787
|
+
}
|
|
1788
|
+
const W = u.uid;
|
|
1789
|
+
if (B.shiftKey && j !== null) {
|
|
1790
|
+
const ee = Math.min(j, b), J = Math.max(j, b), Ne = I.slice(ee, J + 1).map((ce) => ce.uid), we = new Set(Ne);
|
|
1791
|
+
k(we), h == null || h(Array.from(we));
|
|
1792
|
+
} else if (B.ctrlKey || B.metaKey)
|
|
1793
|
+
k((ee) => {
|
|
1794
|
+
const J = new Set(ee);
|
|
1795
|
+
return J.has(W) ? J.delete(W) : J.add(W), h == null || h(Array.from(J)), J;
|
|
1796
|
+
}), Z(b);
|
|
1797
|
+
else if (p.size === 1 && p.has(W))
|
|
1798
|
+
d == null || d(u), o && E(u);
|
|
1799
|
+
else {
|
|
1800
|
+
const ee = /* @__PURE__ */ new Set([W]);
|
|
1801
|
+
k(ee), Z(b), h == null || h(Array.from(ee));
|
|
1802
|
+
}
|
|
1803
|
+
}, [i, j, I, p, d, h, o]), he = X(async () => {
|
|
1804
|
+
if (!(!D || p.size === 0))
|
|
1805
|
+
try {
|
|
1806
|
+
const u = await D.trashEmails(r, Array.from(p));
|
|
1807
|
+
if (console.log("Trash result:", u), u.success && u.moved > 0) {
|
|
1808
|
+
V((B) => B.filter((W) => !p.has(W.uid)));
|
|
1809
|
+
const b = Array.from(p);
|
|
1810
|
+
k(/* @__PURE__ */ new Set()), x == null || x(b);
|
|
1811
|
+
} else
|
|
1812
|
+
C("Failed to move emails to trash");
|
|
1813
|
+
} catch (u) {
|
|
1814
|
+
const b = u instanceof Error ? u : new Error("Trash failed");
|
|
1815
|
+
console.error("Trash error:", b), C(b.message), _ == null || _(b);
|
|
1816
|
+
}
|
|
1817
|
+
}, [D, r, p, x, _]), ge = X(async () => {
|
|
1818
|
+
if (!(!D || p.size === 0))
|
|
1819
|
+
try {
|
|
1820
|
+
const u = await D.archiveEmails(r, Array.from(p));
|
|
1821
|
+
if (console.log("Archive result:", u), u.success && u.archived > 0) {
|
|
1822
|
+
V((B) => B.filter((W) => !p.has(W.uid)));
|
|
1823
|
+
const b = Array.from(p);
|
|
1824
|
+
k(/* @__PURE__ */ new Set()), x == null || x(b);
|
|
1825
|
+
} else
|
|
1826
|
+
C("Failed to archive emails");
|
|
1827
|
+
} catch (u) {
|
|
1828
|
+
const b = u instanceof Error ? u : new Error("Archive failed");
|
|
1829
|
+
console.error("Archive error:", b), C(b.message), _ == null || _(b);
|
|
1830
|
+
}
|
|
1831
|
+
}, [D, r, p, x, _]), ye = X(() => {
|
|
1832
|
+
if (p.size === I.length)
|
|
1833
|
+
k(/* @__PURE__ */ new Set()), h == null || h([]);
|
|
1834
|
+
else {
|
|
1835
|
+
const u = new Set(I.map((b) => b.uid));
|
|
1836
|
+
k(u), h == null || h(Array.from(u));
|
|
1837
|
+
}
|
|
1838
|
+
}, [I, p.size, h]), xe = X(() => {
|
|
1839
|
+
k(/* @__PURE__ */ new Set()), h == null || h([]);
|
|
1840
|
+
}, [h]), me = {
|
|
1841
|
+
delete: he,
|
|
1842
|
+
archive: ge,
|
|
1843
|
+
refresh: Y,
|
|
1844
|
+
selectAll: ye,
|
|
1845
|
+
clearSelection: xe
|
|
1846
|
+
}, ve = (u) => {
|
|
1847
|
+
if (!u) return "";
|
|
1848
|
+
const b = new Date(u), B = /* @__PURE__ */ new Date();
|
|
1849
|
+
return b.toDateString() === B.toDateString() ? b.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) : b.toLocaleDateString([], { month: "short", day: "numeric" });
|
|
1850
|
+
}, Re = (u, b) => /* @__PURE__ */ s.jsx("div", { style: {
|
|
1851
|
+
padding: "12px 16px",
|
|
1852
|
+
background: b ? g.selectedBackground : u.seen ? g.cardBackground : g.unreadBackground,
|
|
1853
|
+
borderBottom: `1px solid ${g.border}`,
|
|
1854
|
+
cursor: "pointer",
|
|
1855
|
+
transition: "background 0.15s ease"
|
|
1856
|
+
}, children: /* @__PURE__ */ s.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "flex-start", gap: "12px" }, children: [
|
|
1857
|
+
/* @__PURE__ */ s.jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
1858
|
+
/* @__PURE__ */ s.jsx("div", { style: {
|
|
1859
|
+
fontSize: "14px",
|
|
1860
|
+
fontWeight: u.seen ? 400 : 600,
|
|
1861
|
+
color: g.text,
|
|
1862
|
+
whiteSpace: "nowrap",
|
|
1863
|
+
overflow: "hidden",
|
|
1864
|
+
textOverflow: "ellipsis"
|
|
1865
|
+
}, children: je(u.from).split("@")[0] }),
|
|
1866
|
+
/* @__PURE__ */ s.jsx("div", { style: {
|
|
1867
|
+
fontSize: "14px",
|
|
1868
|
+
fontWeight: u.seen ? 400 : 500,
|
|
1869
|
+
color: u.seen ? g.textSecondary : g.text,
|
|
1870
|
+
marginTop: "2px",
|
|
1871
|
+
whiteSpace: "nowrap",
|
|
1872
|
+
overflow: "hidden",
|
|
1873
|
+
textOverflow: "ellipsis"
|
|
1874
|
+
}, children: je(u.subject) || "(No subject)" })
|
|
1875
|
+
] }),
|
|
1876
|
+
/* @__PURE__ */ s.jsx("div", { style: {
|
|
1877
|
+
fontSize: "12px",
|
|
1878
|
+
color: g.textSecondary,
|
|
1879
|
+
flexShrink: 0
|
|
1880
|
+
}, children: ve(u.date) })
|
|
1881
|
+
] }) }), ke = (u) => /* @__PURE__ */ s.jsxs("div", { style: { padding: "24px" }, children: [
|
|
1882
|
+
/* @__PURE__ */ s.jsx("h2", { style: { margin: "0 0 8px", fontSize: "20px", color: g.text }, children: je(u.subject) || "(No subject)" }),
|
|
1883
|
+
/* @__PURE__ */ s.jsxs("div", { style: { fontSize: "14px", color: g.textSecondary, marginBottom: "16px" }, children: [
|
|
1884
|
+
"From: ",
|
|
1885
|
+
je(u.from),
|
|
1886
|
+
" • ",
|
|
1887
|
+
new Date(u.date).toLocaleString()
|
|
1888
|
+
] }),
|
|
1889
|
+
/* @__PURE__ */ s.jsx("div", { style: { fontSize: "14px", color: g.text }, children: "Email body not loaded. Implement getEmail(uid) to fetch full content." })
|
|
1890
|
+
] }), ie = (u, b) => /* @__PURE__ */ s.jsxs("div", { style: {
|
|
1891
|
+
display: "flex",
|
|
1892
|
+
alignItems: "center",
|
|
1893
|
+
gap: "8px",
|
|
1894
|
+
padding: "8px 16px",
|
|
1895
|
+
background: g.cardBackground,
|
|
1896
|
+
borderBottom: `1px solid ${g.border}`
|
|
1897
|
+
}, children: [
|
|
1898
|
+
/* @__PURE__ */ s.jsx(
|
|
1899
|
+
"button",
|
|
1900
|
+
{
|
|
1901
|
+
onClick: b.selectAll,
|
|
1902
|
+
style: {
|
|
1903
|
+
padding: "6px 12px",
|
|
1904
|
+
background: "transparent",
|
|
1905
|
+
border: `1px solid ${g.border}`,
|
|
1906
|
+
borderRadius: "6px",
|
|
1907
|
+
fontSize: "13px",
|
|
1908
|
+
cursor: "pointer",
|
|
1909
|
+
color: g.text
|
|
1910
|
+
},
|
|
1911
|
+
children: u.length === I.length ? "Deselect All" : "Select All"
|
|
1912
|
+
}
|
|
1913
|
+
),
|
|
1914
|
+
u.length > 0 && /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
1915
|
+
/* @__PURE__ */ s.jsxs("span", { style: { fontSize: "13px", color: g.textSecondary }, children: [
|
|
1916
|
+
u.length,
|
|
1917
|
+
" selected"
|
|
1918
|
+
] }),
|
|
1919
|
+
/* @__PURE__ */ s.jsx(
|
|
1920
|
+
"button",
|
|
1921
|
+
{
|
|
1922
|
+
onClick: b.archive,
|
|
1923
|
+
title: "Archive",
|
|
1924
|
+
style: {
|
|
1925
|
+
display: "flex",
|
|
1926
|
+
alignItems: "center",
|
|
1927
|
+
justifyContent: "center",
|
|
1928
|
+
width: "32px",
|
|
1929
|
+
height: "32px",
|
|
1930
|
+
background: "transparent",
|
|
1931
|
+
border: `1px solid ${g.border}`,
|
|
1932
|
+
borderRadius: "6px",
|
|
1933
|
+
cursor: "pointer",
|
|
1934
|
+
color: g.textSecondary
|
|
1935
|
+
},
|
|
1936
|
+
children: /* @__PURE__ */ s.jsx("span", { className: "material-icons", style: { fontSize: "18px" }, children: "archive" })
|
|
1937
|
+
}
|
|
1938
|
+
),
|
|
1939
|
+
/* @__PURE__ */ s.jsx(
|
|
1940
|
+
"button",
|
|
1941
|
+
{
|
|
1942
|
+
onClick: b.delete,
|
|
1943
|
+
title: "Delete",
|
|
1944
|
+
style: {
|
|
1945
|
+
display: "flex",
|
|
1946
|
+
alignItems: "center",
|
|
1947
|
+
justifyContent: "center",
|
|
1948
|
+
width: "32px",
|
|
1949
|
+
height: "32px",
|
|
1950
|
+
background: "transparent",
|
|
1951
|
+
border: `1px solid ${g.border}`,
|
|
1952
|
+
borderRadius: "6px",
|
|
1953
|
+
cursor: "pointer",
|
|
1954
|
+
color: g.textSecondary
|
|
1955
|
+
},
|
|
1956
|
+
children: /* @__PURE__ */ s.jsx("span", { className: "material-icons", style: { fontSize: "18px" }, children: "delete" })
|
|
1957
|
+
}
|
|
1958
|
+
)
|
|
1959
|
+
] }),
|
|
1960
|
+
/* @__PURE__ */ s.jsx("div", { style: { flex: 1 } }),
|
|
1961
|
+
/* @__PURE__ */ s.jsx(
|
|
1962
|
+
"button",
|
|
1963
|
+
{
|
|
1964
|
+
onClick: b.refresh,
|
|
1965
|
+
title: "Refresh",
|
|
1966
|
+
style: {
|
|
1967
|
+
display: "flex",
|
|
1968
|
+
alignItems: "center",
|
|
1969
|
+
justifyContent: "center",
|
|
1970
|
+
width: "32px",
|
|
1971
|
+
height: "32px",
|
|
1972
|
+
background: "transparent",
|
|
1973
|
+
border: `1px solid ${g.border}`,
|
|
1974
|
+
borderRadius: "6px",
|
|
1975
|
+
cursor: "pointer",
|
|
1976
|
+
color: g.textSecondary
|
|
1977
|
+
},
|
|
1978
|
+
children: /* @__PURE__ */ s.jsx("span", { className: "material-icons", style: { fontSize: "18px" }, children: "refresh" })
|
|
1979
|
+
}
|
|
1980
|
+
)
|
|
1981
|
+
] }), oe = () => /* @__PURE__ */ s.jsx("div", { style: {
|
|
1982
|
+
padding: "48px",
|
|
1983
|
+
textAlign: "center",
|
|
1984
|
+
color: g.textSecondary
|
|
1985
|
+
}, children: l }), re = () => /* @__PURE__ */ s.jsx("div", { style: {
|
|
1986
|
+
padding: "48px",
|
|
1987
|
+
textAlign: "center",
|
|
1988
|
+
color: g.textSecondary
|
|
1989
|
+
}, children: "Loading..." }), le = S || Re, ne = $ || ke, Te = P || ie, be = N || oe, Se = H || re;
|
|
1990
|
+
return Q && I.length === 0 ? /* @__PURE__ */ s.jsx("div", { style: { background: g.background, width: "100%", height: "100%" }, children: Se() }) : /* @__PURE__ */ s.jsxs("div", { style: { display: "flex", background: g.background, width: "100%", height: "100%" }, children: [
|
|
1991
|
+
/* @__PURE__ */ s.jsxs("div", { style: {
|
|
1992
|
+
flex: o && U ? "0 0 50%" : "1",
|
|
1993
|
+
display: "flex",
|
|
1994
|
+
flexDirection: "column",
|
|
1995
|
+
borderRight: o && U ? `1px solid ${g.border}` : "none",
|
|
1996
|
+
overflow: "hidden"
|
|
1997
|
+
}, children: [
|
|
1998
|
+
i && Te(Array.from(p), me),
|
|
1999
|
+
T && /* @__PURE__ */ s.jsx("div", { style: {
|
|
2000
|
+
padding: "12px 16px",
|
|
2001
|
+
background: "#fef2f2",
|
|
2002
|
+
color: g.danger,
|
|
2003
|
+
fontSize: "14px",
|
|
2004
|
+
borderBottom: `1px solid ${g.border}`
|
|
2005
|
+
}, children: T }),
|
|
2006
|
+
/* @__PURE__ */ s.jsx("div", { style: { flex: 1, overflowY: "auto" }, children: I.length === 0 ? be() : I.map((u, b) => /* @__PURE__ */ s.jsx(
|
|
2007
|
+
"div",
|
|
2008
|
+
{
|
|
2009
|
+
onClick: (B) => pe(u, b, B),
|
|
2010
|
+
children: le(u, p.has(u.uid))
|
|
2011
|
+
},
|
|
2012
|
+
u.uid
|
|
2013
|
+
)) })
|
|
2014
|
+
] }),
|
|
2015
|
+
o && U && /* @__PURE__ */ s.jsx("div", { style: { flex: 1, overflowY: "auto" }, children: ne(U) })
|
|
2016
|
+
] });
|
|
2017
|
+
}
|
|
1586
2018
|
export {
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
2019
|
+
Bt as AnimatedCardFlip,
|
|
2020
|
+
kt as ApiClient,
|
|
2021
|
+
Rt as AuthManager,
|
|
2022
|
+
Mt as Card,
|
|
2023
|
+
Fe as DataOperations,
|
|
2024
|
+
Ut as Detail,
|
|
2025
|
+
$t as GraphClient,
|
|
2026
|
+
Lt as Mail,
|
|
2027
|
+
Et as MailClient,
|
|
2028
|
+
It as Stack,
|
|
2029
|
+
tt as getApiClient,
|
|
2030
|
+
Dt as initializeApiClient,
|
|
2031
|
+
Ft as useMutation,
|
|
2032
|
+
Tt as useQuery
|
|
1599
2033
|
};
|