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