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