@mashkovd/pelican-vue 0.3.1 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { onScopeDispose as
|
|
1
|
+
import { onScopeDispose as fe, defineComponent as F, ref as P, watch as U, openBlock as g, createElementBlock as M, createElementVNode as i, createTextVNode as B, toDisplayString as b, Fragment as D, renderList as Y, unref as p, normalizeClass as E, computed as $, normalizeStyle as Q, createCommentVNode as K, createVNode as T, withDirectives as ye, vShow as Me, inject as Ue, withModifiers as ne, renderSlot as X, createBlock as ue, withCtx as ce, mergeProps as Ve, shallowRef as Ee, triggerRef as le, reactive as Te, provide as se, toRef as be, onMounted as Be, normalizeProps as Oe, guardReactiveProps as Ke } from "vue";
|
|
2
2
|
function Ye(e, t) {
|
|
3
3
|
let a = null;
|
|
4
4
|
const n = (...c) => {
|
|
@@ -8,7 +8,7 @@ function Ye(e, t) {
|
|
|
8
8
|
}, s = () => {
|
|
9
9
|
a && (clearTimeout(a), a = null);
|
|
10
10
|
};
|
|
11
|
-
return
|
|
11
|
+
return fe(s), { wrapped: n, cancel: s };
|
|
12
12
|
}
|
|
13
13
|
const ze = 20, Ge = 350, He = 2e3, je = 2e4, We = 30, qe = [
|
|
14
14
|
"return-desc",
|
|
@@ -72,35 +72,35 @@ const ze = 20, Ge = 350, He = 2e3, je = 2e4, We = 30, qe = [
|
|
|
72
72
|
},
|
|
73
73
|
emits: ["update:search", "update:sortKey", "refresh", "toggle-filters"],
|
|
74
74
|
setup(e, { emit: t }) {
|
|
75
|
-
const a = e, n = t, s =
|
|
76
|
-
|
|
75
|
+
const a = e, n = t, s = P(a.search);
|
|
76
|
+
U(
|
|
77
77
|
() => a.search,
|
|
78
|
-
(
|
|
79
|
-
|
|
78
|
+
(r) => {
|
|
79
|
+
r !== s.value && (s.value = r);
|
|
80
80
|
}
|
|
81
81
|
);
|
|
82
|
-
const { wrapped: c } = Ye((
|
|
83
|
-
function l(
|
|
84
|
-
const m =
|
|
82
|
+
const { wrapped: c } = Ye((r) => n("update:search", r), Ge);
|
|
83
|
+
function l(r) {
|
|
84
|
+
const m = r.target.value;
|
|
85
85
|
s.value = m, c(m);
|
|
86
86
|
}
|
|
87
|
-
function o(
|
|
88
|
-
n("update:sortKey",
|
|
87
|
+
function o(r) {
|
|
88
|
+
n("update:sortKey", r.target.value);
|
|
89
89
|
}
|
|
90
|
-
return (
|
|
90
|
+
return (r, m) => (g(), M("div", Je, [
|
|
91
91
|
i("button", {
|
|
92
92
|
class: "btn-flat filters-toggle",
|
|
93
93
|
type: "button",
|
|
94
|
-
onClick: m[0] || (m[0] = (
|
|
94
|
+
onClick: m[0] || (m[0] = (h) => n("toggle-filters"))
|
|
95
95
|
}, " Filters "),
|
|
96
96
|
i("div", Qe, [
|
|
97
|
-
m[2] || (m[2] =
|
|
97
|
+
m[2] || (m[2] = B(" Showing ", -1)),
|
|
98
98
|
i("b", null, b(e.filteredTotal.toLocaleString("en-US")), 1),
|
|
99
|
-
m[3] || (m[3] =
|
|
99
|
+
m[3] || (m[3] = B(" of ", -1)),
|
|
100
100
|
i("b", null, b(e.total.toLocaleString("en-US")), 1),
|
|
101
|
-
m[4] || (m[4] =
|
|
101
|
+
m[4] || (m[4] = B(" · page ", -1)),
|
|
102
102
|
i("b", null, b(e.page), 1),
|
|
103
|
-
|
|
103
|
+
B(" / " + b(e.totalPages), 1)
|
|
104
104
|
]),
|
|
105
105
|
i("input", {
|
|
106
106
|
class: "search",
|
|
@@ -116,17 +116,17 @@ const ze = 20, Ge = 350, He = 2e3, je = 2e4, We = 30, qe = [
|
|
|
116
116
|
value: e.sortKey,
|
|
117
117
|
onChange: o
|
|
118
118
|
}, [
|
|
119
|
-
(
|
|
120
|
-
key:
|
|
121
|
-
value:
|
|
122
|
-
}, b(
|
|
119
|
+
(g(!0), M(D, null, Y(p(qe), (h) => (g(), M("option", {
|
|
120
|
+
key: h,
|
|
121
|
+
value: h
|
|
122
|
+
}, b(p(Xe)[h]), 9, nt))), 128))
|
|
123
123
|
], 40, at)
|
|
124
124
|
]),
|
|
125
125
|
i("button", {
|
|
126
126
|
class: "btn-flat",
|
|
127
127
|
type: "button",
|
|
128
128
|
title: "reload",
|
|
129
|
-
onClick: m[1] || (m[1] = (
|
|
129
|
+
onClick: m[1] || (m[1] = (h) => n("refresh"))
|
|
130
130
|
}, " ↻ reload ")
|
|
131
131
|
]));
|
|
132
132
|
}
|
|
@@ -147,13 +147,13 @@ const ze = 20, Ge = 350, He = 2e3, je = 2e4, We = 30, qe = [
|
|
|
147
147
|
const o = new Set(a.modelValue);
|
|
148
148
|
o.has(l) ? o.delete(l) : o.add(l), n("update:modelValue", o);
|
|
149
149
|
}
|
|
150
|
-
return (l, o) => (
|
|
151
|
-
(
|
|
152
|
-
key:
|
|
150
|
+
return (l, o) => (g(), M("div", ot, [
|
|
151
|
+
(g(), M(D, null, Y(s, (r) => i("button", {
|
|
152
|
+
key: r,
|
|
153
153
|
type: "button",
|
|
154
|
-
class:
|
|
155
|
-
onClick: (m) => c(
|
|
156
|
-
}, b(
|
|
154
|
+
class: E(["chip", ["risk-" + r.toLowerCase(), { on: e.modelValue.has(r) }]]),
|
|
155
|
+
onClick: (m) => c(r)
|
|
156
|
+
}, b(r), 11, it)), 64))
|
|
157
157
|
]));
|
|
158
158
|
}
|
|
159
159
|
}), ut = /* @__PURE__ */ N(rt, [["__scopeId", "data-v-742a6c3b"]]), ct = { class: "pelican-fgroup" }, dt = { class: "title-row" }, mt = { class: "title" }, ft = { class: "val" }, vt = ["min", "max", "step", "value"], pt = /* @__PURE__ */ F({
|
|
@@ -170,12 +170,12 @@ const ze = 20, Ge = 350, He = 2e3, je = 2e4, We = 30, qe = [
|
|
|
170
170
|
},
|
|
171
171
|
emits: ["update:modelValue"],
|
|
172
172
|
setup(e, { emit: t }) {
|
|
173
|
-
const a = e, n = t, s =
|
|
174
|
-
function
|
|
175
|
-
const
|
|
176
|
-
isNaN(
|
|
173
|
+
const a = e, n = t, s = $(() => a.anyAt ?? a.min), c = $(() => !!a.inverted), l = $(() => a.modelValue == null ? c.value ? a.max : s.value : a.modelValue), o = $(() => a.modelValue == null ? "any" : a.format ? a.format(a.modelValue) : String(a.modelValue));
|
|
174
|
+
function r(m) {
|
|
175
|
+
const h = parseInt(m.target.value, 10);
|
|
176
|
+
isNaN(h) || (c.value && h >= a.max || !c.value && h <= s.value ? n("update:modelValue", null) : n("update:modelValue", h));
|
|
177
177
|
}
|
|
178
|
-
return (m,
|
|
178
|
+
return (m, h) => (g(), M("div", ct, [
|
|
179
179
|
i("div", dt, [
|
|
180
180
|
i("label", mt, b(e.label), 1),
|
|
181
181
|
i("span", ft, b(o.value), 1)
|
|
@@ -187,15 +187,15 @@ const ze = 20, Ge = 350, He = 2e3, je = 2e4, We = 30, qe = [
|
|
|
187
187
|
max: e.max,
|
|
188
188
|
step: e.step,
|
|
189
189
|
value: l.value,
|
|
190
|
-
onInput:
|
|
191
|
-
onChange:
|
|
190
|
+
onInput: r,
|
|
191
|
+
onChange: r
|
|
192
192
|
}, null, 40, vt)
|
|
193
193
|
]));
|
|
194
194
|
}
|
|
195
|
-
}),
|
|
195
|
+
}), H = /* @__PURE__ */ N(pt, [["__scopeId", "data-v-10c5fe1c"]]), gt = { class: "pelican-fgroup" }, ht = { class: "title-row" }, yt = { class: "title" }, Mt = { class: "val" }, bt = ["min", "max", "value"], xt = ["min", "max", "value"], wt = {
|
|
196
196
|
key: 0,
|
|
197
197
|
class: "scale"
|
|
198
|
-
},
|
|
198
|
+
}, $t = /* @__PURE__ */ F({
|
|
199
199
|
__name: "RangeDual",
|
|
200
200
|
props: {
|
|
201
201
|
label: {},
|
|
@@ -211,67 +211,78 @@ const ze = 20, Ge = 350, He = 2e3, je = 2e4, We = 30, qe = [
|
|
|
211
211
|
},
|
|
212
212
|
emits: ["update:modelValueMin", "update:modelValueMax"],
|
|
213
213
|
setup(e, { emit: t }) {
|
|
214
|
-
const a = e, n = t, s =
|
|
214
|
+
const a = e, n = t, s = $(() => a.rawMin ?? 0), c = $(() => a.rawMax ?? 100), l = $(() => a.modelValueMin ?? s.value), o = $(() => a.modelValueMax ?? c.value), r = $(
|
|
215
215
|
() => l.value <= s.value ? a.minLabel ?? "any" : a.formatRaw(a.rawToDomain(l.value))
|
|
216
|
-
), m =
|
|
216
|
+
), m = $(
|
|
217
217
|
() => o.value >= c.value ? a.maxLabel ?? "any" : a.formatRaw(a.rawToDomain(o.value))
|
|
218
|
-
),
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
218
|
+
), h = $(() => l.value <= s.value && o.value >= c.value ? "any" : `${r.value} – ${m.value}`), v = $(() => (l.value - s.value) / (c.value - s.value) * 100), d = $(() => (o.value - s.value) / (c.value - s.value) * 100), u = $(() => ({
|
|
219
|
+
background: `linear-gradient(to right,
|
|
220
|
+
var(--track-bg, #e2e8f0) 0%,
|
|
221
|
+
var(--track-bg, #e2e8f0) ${v.value}%,
|
|
222
|
+
var(--accent, #3b82f6) ${v.value}%,
|
|
223
|
+
var(--accent, #3b82f6) ${d.value}%,
|
|
224
|
+
var(--track-bg, #e2e8f0) ${d.value}%,
|
|
225
|
+
var(--track-bg, #e2e8f0) 100%)`
|
|
226
|
+
}));
|
|
227
|
+
function _(I) {
|
|
228
|
+
let f = parseInt(I.target.value, 10);
|
|
229
|
+
isNaN(f) || (f > o.value && (f = o.value), n("update:modelValueMin", f <= s.value ? null : f));
|
|
222
230
|
}
|
|
223
|
-
function
|
|
224
|
-
let
|
|
225
|
-
isNaN(
|
|
231
|
+
function k(I) {
|
|
232
|
+
let f = parseInt(I.target.value, 10);
|
|
233
|
+
isNaN(f) || (f < l.value && (f = l.value), n("update:modelValueMax", f >= c.value ? null : f));
|
|
226
234
|
}
|
|
227
|
-
return (
|
|
228
|
-
var
|
|
229
|
-
return
|
|
235
|
+
return (I, f) => {
|
|
236
|
+
var S;
|
|
237
|
+
return g(), M("div", gt, [
|
|
230
238
|
i("div", ht, [
|
|
231
239
|
i("label", yt, b(e.label), 1),
|
|
232
|
-
i("span", Mt, b(
|
|
240
|
+
i("span", Mt, b(h.value), 1)
|
|
233
241
|
]),
|
|
234
|
-
i("div",
|
|
242
|
+
i("div", {
|
|
243
|
+
class: "dual-track",
|
|
244
|
+
style: Q(u.value)
|
|
245
|
+
}, [
|
|
235
246
|
i("input", {
|
|
236
247
|
type: "range",
|
|
237
248
|
class: "range-dual",
|
|
238
249
|
min: s.value,
|
|
239
250
|
max: c.value,
|
|
240
251
|
value: l.value,
|
|
241
|
-
style:
|
|
242
|
-
onInput:
|
|
243
|
-
onChange:
|
|
244
|
-
}, null, 44,
|
|
252
|
+
style: Q({ zIndex: l.value <= s.value || l.value >= o.value ? 5 : 4 }),
|
|
253
|
+
onInput: _,
|
|
254
|
+
onChange: _
|
|
255
|
+
}, null, 44, bt),
|
|
245
256
|
i("input", {
|
|
246
257
|
type: "range",
|
|
247
258
|
class: "range-dual",
|
|
248
259
|
min: s.value,
|
|
249
260
|
max: c.value,
|
|
250
261
|
value: o.value,
|
|
251
|
-
style:
|
|
252
|
-
onInput:
|
|
253
|
-
onChange:
|
|
254
|
-
}, null, 44,
|
|
255
|
-
]),
|
|
256
|
-
(
|
|
257
|
-
(
|
|
258
|
-
])) :
|
|
262
|
+
style: Q({ zIndex: l.value <= s.value || l.value >= o.value ? 4 : 5 }),
|
|
263
|
+
onInput: k,
|
|
264
|
+
onChange: k
|
|
265
|
+
}, null, 44, xt)
|
|
266
|
+
], 4),
|
|
267
|
+
(S = e.scaleHints) != null && S.length ? (g(), M("div", wt, [
|
|
268
|
+
(g(!0), M(D, null, Y(e.scaleHints, (A) => (g(), M("span", { key: A }, b(A), 1))), 128))
|
|
269
|
+
])) : K("", !0)
|
|
259
270
|
]);
|
|
260
271
|
};
|
|
261
272
|
}
|
|
262
|
-
}),
|
|
263
|
-
function
|
|
273
|
+
}), xe = /* @__PURE__ */ N($t, [["__scopeId", "data-v-dde22e60"]]);
|
|
274
|
+
function we(e, t = 2) {
|
|
264
275
|
if (e == null || isNaN(Number(e))) return null;
|
|
265
276
|
const a = Number(e);
|
|
266
277
|
return { text: `${a.toFixed(t)}%`, positive: a >= 0 };
|
|
267
278
|
}
|
|
268
|
-
function
|
|
279
|
+
function $e(e, t = "en-US") {
|
|
269
280
|
if (e == null || isNaN(Number(e))) return "—";
|
|
270
281
|
const a = Number(e), n = a < 0 ? "-" : "", s = Math.abs(a);
|
|
271
282
|
let c;
|
|
272
283
|
return s >= 1e6 ? c = (s / 1e6).toFixed(2) + "M" : s >= 1e3 ? c = Math.round(s).toLocaleString(t) : c = s.toFixed(2), `${n}$${c}`;
|
|
273
284
|
}
|
|
274
|
-
function
|
|
285
|
+
function j(e, t = "en-US") {
|
|
275
286
|
if (e == null || isNaN(Number(e))) return "—";
|
|
276
287
|
const a = Number(e);
|
|
277
288
|
return `${a < 0 ? "-" : ""}$${Math.abs(a).toLocaleString(t, {
|
|
@@ -279,13 +290,13 @@ function H(e, t = "en-US") {
|
|
|
279
290
|
maximumFractionDigits: 2
|
|
280
291
|
})}`;
|
|
281
292
|
}
|
|
282
|
-
function
|
|
293
|
+
function ke(e, t = "en-US") {
|
|
283
294
|
return e == null ? "—" : Number(e).toLocaleString(t);
|
|
284
295
|
}
|
|
285
|
-
function
|
|
296
|
+
function kt(e) {
|
|
286
297
|
return e.Fee == null ? e._meta ? "free" : "—" : `${(e.Fee * 100).toFixed(0)}%`;
|
|
287
298
|
}
|
|
288
|
-
function
|
|
299
|
+
function _e(e, t = "en-US") {
|
|
289
300
|
if (!e) return "—";
|
|
290
301
|
const a = new Date(e);
|
|
291
302
|
return isNaN(a.getTime()) ? "—" : a.toLocaleString(t, {
|
|
@@ -305,29 +316,29 @@ function _t(e) {
|
|
|
305
316
|
const a = Math.floor(e / 365), n = Math.floor((e - a * 365) / 30);
|
|
306
317
|
return n ? `${a}y ${n}mo` : `${a}y`;
|
|
307
318
|
}
|
|
308
|
-
function
|
|
319
|
+
function de(e) {
|
|
309
320
|
return e >= 1e6 ? "$" + (e / 1e6).toFixed(2) + "M" : e >= 1e3 ? "$" + Math.round(e / 1e3) + "K" : "$" + Math.round(e);
|
|
310
321
|
}
|
|
311
|
-
function
|
|
322
|
+
function It(e) {
|
|
312
323
|
return e >= 1e3 ? (e / 1e3).toFixed(1).replace(/\.0$/, "") + "K%" : Math.round(e) + "%";
|
|
313
324
|
}
|
|
314
325
|
function Rt(e) {
|
|
315
326
|
return e && e.trim().split(/\s+/).slice(0, 2).map((a) => a.charAt(0).toUpperCase()).join("") || "?";
|
|
316
327
|
}
|
|
317
|
-
function
|
|
328
|
+
function W(e) {
|
|
318
329
|
if (!e) return null;
|
|
319
330
|
const t = new Date(e);
|
|
320
331
|
return isNaN(t.getTime()) ? null : Math.floor((Date.now() - t.getTime()) / 864e5);
|
|
321
332
|
}
|
|
322
|
-
const
|
|
333
|
+
const oe = (e) => e <= 0 ? 0 : Math.round(Math.pow(10, 1 + (e - 1) / 99 * 6)), Ie = (e) => e <= 0 ? 0 : Math.max(1, Math.min(100, Math.round(1 + (Math.log10(e) - 1) * 99 / 6))), ie = (e) => e <= 0 ? 0 : Math.round(Math.pow(10, (e - 1) / 99 * 4.7)), St = { class: "pelican-fgroup" }, Pt = { class: "title-row" }, Ct = { class: "val" }, Tt = ["value"], At = /* @__PURE__ */ F({
|
|
323
334
|
__name: "InvestAmount",
|
|
324
335
|
props: {
|
|
325
336
|
modelValue: {}
|
|
326
337
|
},
|
|
327
338
|
emits: ["update:modelValue", "apply"],
|
|
328
339
|
setup(e, { emit: t }) {
|
|
329
|
-
const a = e, n = t, s =
|
|
330
|
-
() => a.modelValue == null ? "any" :
|
|
340
|
+
const a = e, n = t, s = $(
|
|
341
|
+
() => a.modelValue == null ? "any" : de(a.modelValue)
|
|
331
342
|
);
|
|
332
343
|
function c(l) {
|
|
333
344
|
const o = l.target.value.trim();
|
|
@@ -335,17 +346,17 @@ const le = (e) => e <= 0 ? 0 : Math.round(Math.pow(10, 1 + (e - 1) / 99 * 6)), I
|
|
|
335
346
|
n("update:modelValue", null), n("apply", null);
|
|
336
347
|
return;
|
|
337
348
|
}
|
|
338
|
-
const
|
|
339
|
-
if (isNaN(
|
|
349
|
+
const r = parseInt(o, 10);
|
|
350
|
+
if (isNaN(r) || r <= 0) {
|
|
340
351
|
n("update:modelValue", null), n("apply", null);
|
|
341
352
|
return;
|
|
342
353
|
}
|
|
343
|
-
n("update:modelValue",
|
|
354
|
+
n("update:modelValue", r), n("apply", { min: Ie(50), max: Ie(r) });
|
|
344
355
|
}
|
|
345
|
-
return (l, o) => (
|
|
346
|
-
i("div",
|
|
356
|
+
return (l, o) => (g(), M("div", St, [
|
|
357
|
+
i("div", Pt, [
|
|
347
358
|
o[0] || (o[0] = i("label", { class: "title" }, "Your Investment Amount, $", -1)),
|
|
348
|
-
i("span",
|
|
359
|
+
i("span", Ct, b(s.value), 1)
|
|
349
360
|
]),
|
|
350
361
|
i("input", {
|
|
351
362
|
type: "number",
|
|
@@ -355,10 +366,10 @@ const le = (e) => e <= 0 ? 0 : Math.round(Math.pow(10, 1 + (e - 1) / 99 * 6)), I
|
|
|
355
366
|
autocomplete: "off",
|
|
356
367
|
value: e.modelValue ?? "",
|
|
357
368
|
onChange: c
|
|
358
|
-
}, null, 40,
|
|
369
|
+
}, null, 40, Tt)
|
|
359
370
|
]));
|
|
360
371
|
}
|
|
361
|
-
}),
|
|
372
|
+
}), Ft = /* @__PURE__ */ N(At, [["__scopeId", "data-v-a76acc6c"]]), Nt = { class: "ftitle-row" }, Dt = /* @__PURE__ */ F({
|
|
362
373
|
__name: "FiltersPanel",
|
|
363
374
|
props: {
|
|
364
375
|
filters: {},
|
|
@@ -367,67 +378,67 @@ const le = (e) => e <= 0 ? 0 : Math.round(Math.pow(10, 1 + (e - 1) / 99 * 6)), I
|
|
|
367
378
|
},
|
|
368
379
|
emits: ["update:filters", "update:investAmount", "reset"],
|
|
369
380
|
setup(e, { emit: t }) {
|
|
370
|
-
const a = e, n = t, s =
|
|
371
|
-
|
|
372
|
-
n("update:filters", { retMin:
|
|
373
|
-
}),
|
|
374
|
-
n("update:filters", { retMax:
|
|
375
|
-
}),
|
|
376
|
-
n("update:filters", { balanceMin:
|
|
377
|
-
}),
|
|
378
|
-
n("update:filters", { balanceMax:
|
|
379
|
-
}),
|
|
381
|
+
const a = e, n = t, s = P(0), c = P(100), l = P(0), o = P(100);
|
|
382
|
+
U(s, (v) => {
|
|
383
|
+
n("update:filters", { retMin: v <= 0 ? null : ie(v) });
|
|
384
|
+
}), U(c, (v) => {
|
|
385
|
+
n("update:filters", { retMax: v >= 100 ? null : ie(v) });
|
|
386
|
+
}), U(l, (v) => {
|
|
387
|
+
n("update:filters", { balanceMin: v <= 0 ? null : oe(v) });
|
|
388
|
+
}), U(o, (v) => {
|
|
389
|
+
n("update:filters", { balanceMax: v >= 100 ? null : oe(v) });
|
|
390
|
+
}), U(
|
|
380
391
|
() => [a.filters.retMin, a.filters.retMax],
|
|
381
|
-
([
|
|
382
|
-
|
|
392
|
+
([v, d]) => {
|
|
393
|
+
v == null && (s.value = 0), d == null && (c.value = 100);
|
|
383
394
|
}
|
|
384
|
-
),
|
|
395
|
+
), U(
|
|
385
396
|
() => [a.filters.balanceMin, a.filters.balanceMax],
|
|
386
|
-
([
|
|
387
|
-
|
|
397
|
+
([v, d]) => {
|
|
398
|
+
v == null && (l.value = 0), d == null && (o.value = 100);
|
|
388
399
|
}
|
|
389
400
|
);
|
|
390
|
-
function
|
|
391
|
-
n("update:filters",
|
|
401
|
+
function r(v) {
|
|
402
|
+
n("update:filters", v);
|
|
392
403
|
}
|
|
393
|
-
function m(
|
|
394
|
-
|
|
404
|
+
function m(v) {
|
|
405
|
+
r({ risk: v });
|
|
395
406
|
}
|
|
396
|
-
function
|
|
397
|
-
|
|
407
|
+
function h(v) {
|
|
408
|
+
v == null ? (r({ balanceMin: null, balanceMax: null }), l.value = 0, o.value = 100) : (l.value = v.min, o.value = v.max);
|
|
398
409
|
}
|
|
399
|
-
return (
|
|
400
|
-
class:
|
|
410
|
+
return (v, d) => (g(), M("aside", {
|
|
411
|
+
class: E(["pelican-filters", { open: e.open }])
|
|
401
412
|
}, [
|
|
402
|
-
i("div",
|
|
413
|
+
i("div", Nt, [
|
|
403
414
|
d[13] || (d[13] = i("label", { class: "ftitle" }, "Risk", -1)),
|
|
404
415
|
i("button", {
|
|
405
416
|
class: "btn-reset",
|
|
406
417
|
type: "button",
|
|
407
|
-
onClick: d[0] || (d[0] = (
|
|
418
|
+
onClick: d[0] || (d[0] = (u) => n("reset"))
|
|
408
419
|
}, "reset filters")
|
|
409
420
|
]),
|
|
410
|
-
|
|
421
|
+
T(ut, {
|
|
411
422
|
"model-value": e.filters.risk,
|
|
412
423
|
"onUpdate:modelValue": m
|
|
413
424
|
}, null, 8, ["model-value"]),
|
|
414
|
-
|
|
425
|
+
T(Ft, {
|
|
415
426
|
"model-value": e.investAmount,
|
|
416
|
-
"onUpdate:modelValue": d[1] || (d[1] = (
|
|
417
|
-
onApply:
|
|
427
|
+
"onUpdate:modelValue": d[1] || (d[1] = (u) => n("update:investAmount", u)),
|
|
428
|
+
onApply: h
|
|
418
429
|
}, null, 8, ["model-value"]),
|
|
419
|
-
|
|
430
|
+
T(xe, {
|
|
420
431
|
label: "Return %",
|
|
421
432
|
"model-value-min": s.value,
|
|
422
433
|
"model-value-max": c.value,
|
|
423
|
-
"format-raw": (
|
|
424
|
-
"raw-to-domain": (
|
|
434
|
+
"format-raw": (u) => p(It)(u),
|
|
435
|
+
"raw-to-domain": (u) => p(ie)(u),
|
|
425
436
|
"scale-hints": ["0%", "200%", "50K%+"],
|
|
426
437
|
"max-label": "50K%+",
|
|
427
|
-
"onUpdate:modelValueMin": d[2] || (d[2] = (
|
|
428
|
-
"onUpdate:modelValueMax": d[3] || (d[3] = (
|
|
438
|
+
"onUpdate:modelValueMin": d[2] || (d[2] = (u) => s.value = u ?? 0),
|
|
439
|
+
"onUpdate:modelValueMax": d[3] || (d[3] = (u) => c.value = u ?? 100)
|
|
429
440
|
}, null, 8, ["model-value-min", "model-value-max", "format-raw", "raw-to-domain"]),
|
|
430
|
-
|
|
441
|
+
T(H, {
|
|
431
442
|
label: "Max Drawdown ≤",
|
|
432
443
|
"model-value": e.filters.ddMax,
|
|
433
444
|
min: 0,
|
|
@@ -435,21 +446,21 @@ const le = (e) => e <= 0 ? 0 : Math.round(Math.pow(10, 1 + (e - 1) / 99 * 6)), I
|
|
|
435
446
|
step: 5,
|
|
436
447
|
"any-at": 100,
|
|
437
448
|
inverted: !0,
|
|
438
|
-
format: (
|
|
439
|
-
"onUpdate:modelValue": d[4] || (d[4] = (
|
|
449
|
+
format: (u) => u + "%",
|
|
450
|
+
"onUpdate:modelValue": d[4] || (d[4] = (u) => r({ ddMax: u == null || u >= 100 ? null : u }))
|
|
440
451
|
}, null, 8, ["model-value", "format"]),
|
|
441
|
-
|
|
452
|
+
T(xe, {
|
|
442
453
|
label: "Balance",
|
|
443
454
|
"model-value-min": l.value,
|
|
444
455
|
"model-value-max": o.value,
|
|
445
|
-
"format-raw": (
|
|
446
|
-
"raw-to-domain": (
|
|
456
|
+
"format-raw": (u) => p(de)(u),
|
|
457
|
+
"raw-to-domain": (u) => p(oe)(u),
|
|
447
458
|
"scale-hints": ["$0", "$10K", "$10M"],
|
|
448
459
|
"max-label": "$10M+",
|
|
449
|
-
"onUpdate:modelValueMin": d[5] || (d[5] = (
|
|
450
|
-
"onUpdate:modelValueMax": d[6] || (d[6] = (
|
|
460
|
+
"onUpdate:modelValueMin": d[5] || (d[5] = (u) => l.value = u ?? 0),
|
|
461
|
+
"onUpdate:modelValueMax": d[6] || (d[6] = (u) => o.value = u ?? 100)
|
|
451
462
|
}, null, 8, ["model-value-min", "model-value-max", "format-raw", "raw-to-domain"]),
|
|
452
|
-
|
|
463
|
+
T(H, {
|
|
453
464
|
label: "Mgmt Fee ≤",
|
|
454
465
|
"model-value": e.filters.feeMax,
|
|
455
466
|
min: 0,
|
|
@@ -457,57 +468,57 @@ const le = (e) => e <= 0 ? 0 : Math.round(Math.pow(10, 1 + (e - 1) / 99 * 6)), I
|
|
|
457
468
|
step: 5,
|
|
458
469
|
"any-at": 100,
|
|
459
470
|
inverted: !0,
|
|
460
|
-
format: (
|
|
461
|
-
"onUpdate:modelValue": d[7] || (d[7] = (
|
|
471
|
+
format: (u) => u + "%",
|
|
472
|
+
"onUpdate:modelValue": d[7] || (d[7] = (u) => r({ feeMax: u == null || u >= 100 ? null : u }))
|
|
462
473
|
}, null, 8, ["model-value", "format"]),
|
|
463
|
-
|
|
474
|
+
T(H, {
|
|
464
475
|
label: "Copiers AUM ≥",
|
|
465
476
|
"model-value": e.filters.aumMin,
|
|
466
477
|
min: 0,
|
|
467
478
|
max: 5e6,
|
|
468
479
|
step: 5e4,
|
|
469
|
-
format: (
|
|
470
|
-
"onUpdate:modelValue": d[8] || (d[8] = (
|
|
480
|
+
format: (u) => "≥ " + p(de)(u),
|
|
481
|
+
"onUpdate:modelValue": d[8] || (d[8] = (u) => r({ aumMin: u && u > 0 ? u : null }))
|
|
471
482
|
}, null, 8, ["model-value", "format"]),
|
|
472
|
-
|
|
483
|
+
T(H, {
|
|
473
484
|
label: "Copiers ≥",
|
|
474
485
|
"model-value": e.filters.copiersMin,
|
|
475
486
|
min: 0,
|
|
476
487
|
max: 3e3,
|
|
477
488
|
step: 10,
|
|
478
|
-
format: (
|
|
479
|
-
"onUpdate:modelValue": d[9] || (d[9] = (
|
|
489
|
+
format: (u) => "≥ " + u,
|
|
490
|
+
"onUpdate:modelValue": d[9] || (d[9] = (u) => r({ copiersMin: u && u > 0 ? u : null }))
|
|
480
491
|
}, null, 8, ["model-value", "format"]),
|
|
481
|
-
|
|
492
|
+
T(H, {
|
|
482
493
|
label: "Age ≥ (days)",
|
|
483
494
|
"model-value": e.filters.ageMin,
|
|
484
495
|
min: 0,
|
|
485
496
|
max: 3e3,
|
|
486
497
|
step: 10,
|
|
487
|
-
format: (
|
|
488
|
-
"onUpdate:modelValue": d[10] || (d[10] = (
|
|
498
|
+
format: (u) => "≥ " + u + "d",
|
|
499
|
+
"onUpdate:modelValue": d[10] || (d[10] = (u) => r({ ageMin: u && u > 0 ? u : null }))
|
|
489
500
|
}, null, 8, ["model-value", "format"]),
|
|
490
|
-
|
|
501
|
+
T(H, {
|
|
491
502
|
label: "Trades ≥",
|
|
492
503
|
"model-value": e.filters.tradesMin,
|
|
493
504
|
min: 0,
|
|
494
505
|
max: 1e4,
|
|
495
506
|
step: 50,
|
|
496
|
-
format: (
|
|
497
|
-
"onUpdate:modelValue": d[11] || (d[11] = (
|
|
507
|
+
format: (u) => "≥ " + u,
|
|
508
|
+
"onUpdate:modelValue": d[11] || (d[11] = (u) => r({ tradesMin: u && u > 0 ? u : null }))
|
|
498
509
|
}, null, 8, ["model-value", "format"]),
|
|
499
|
-
|
|
510
|
+
T(H, {
|
|
500
511
|
label: "Win Rate ≥",
|
|
501
512
|
"model-value": e.filters.winrateMin,
|
|
502
513
|
min: 0,
|
|
503
514
|
max: 100,
|
|
504
515
|
step: 5,
|
|
505
|
-
format: (
|
|
506
|
-
"onUpdate:modelValue": d[12] || (d[12] = (
|
|
516
|
+
format: (u) => "≥ " + u + "%",
|
|
517
|
+
"onUpdate:modelValue": d[12] || (d[12] = (u) => r({ winrateMin: u && u > 0 ? u : null }))
|
|
507
518
|
}, null, 8, ["model-value", "format"])
|
|
508
519
|
], 2));
|
|
509
520
|
}
|
|
510
|
-
}),
|
|
521
|
+
}), Lt = /* @__PURE__ */ N(Dt, [["__scopeId", "data-v-67cc5448"]]), Re = [
|
|
511
522
|
"#f97316",
|
|
512
523
|
"#3b82f6",
|
|
513
524
|
"#10b981",
|
|
@@ -521,7 +532,7 @@ const le = (e) => e <= 0 ? 0 : Math.round(Math.pow(10, 1 + (e - 1) / 99 * 6)), I
|
|
|
521
532
|
"#f59e0b",
|
|
522
533
|
"#22c55e"
|
|
523
534
|
];
|
|
524
|
-
function
|
|
535
|
+
function Ut(e, t = 140, a = 34) {
|
|
525
536
|
if (!e || e.length < 2)
|
|
526
537
|
return {
|
|
527
538
|
hasData: !1,
|
|
@@ -534,46 +545,46 @@ function Vt(e, t = 140, a = 34) {
|
|
|
534
545
|
startX: 1,
|
|
535
546
|
endX: t - 1
|
|
536
547
|
};
|
|
537
|
-
const n = e.map((
|
|
548
|
+
const n = e.map((R) => Date.parse(R.Timestamp)), s = n[0], c = n[n.length - 1], l = c - s || 1, o = e.map((R) => R.AccountReturn), r = Math.min(0, ...o), h = Math.max(0, ...o) - r || 1, v = (R) => (R - s) / l * (t - 2) + 1, d = (R) => a - 2 - (R - r) / h * (a - 4), u = e.map((R, x) => `${v(n[x]).toFixed(1)},${d(R.AccountReturn).toFixed(1)}`), _ = o[o.length - 1], k = d(0), I = v(s), f = v(c), S = `M ${u.join(" L ")}`, A = `M ${u[0]} ` + u.slice(1).map((R) => `L ${R}`).join(" ") + ` L ${f.toFixed(1)},${k.toFixed(1)} L ${I.toFixed(1)},${k.toFixed(1)} Z`;
|
|
538
549
|
return {
|
|
539
550
|
hasData: !0,
|
|
540
551
|
width: t,
|
|
541
552
|
height: a,
|
|
542
|
-
zeroY:
|
|
543
|
-
areaPath:
|
|
544
|
-
linePath:
|
|
545
|
-
positive:
|
|
546
|
-
startX:
|
|
547
|
-
endX:
|
|
553
|
+
zeroY: k,
|
|
554
|
+
areaPath: A,
|
|
555
|
+
linePath: S,
|
|
556
|
+
positive: _ >= 0,
|
|
557
|
+
startX: I,
|
|
558
|
+
endX: f
|
|
548
559
|
};
|
|
549
560
|
}
|
|
550
|
-
function
|
|
551
|
-
const n = e.slice().sort((d,
|
|
552
|
-
let
|
|
553
|
-
const
|
|
554
|
-
return n.forEach((d,
|
|
555
|
-
const
|
|
556
|
-
|
|
557
|
-
const
|
|
558
|
-
let
|
|
559
|
-
if (
|
|
560
|
-
const
|
|
561
|
-
|
|
561
|
+
function Vt(e, t = 520, a = 280) {
|
|
562
|
+
const n = e.slice().sort((d, u) => (u.c || 0) - (d.c || 0)), s = n.reduce((d, u) => d + (u.c || 0), 0) || 1, c = t / 2, l = a / 2, o = 90, r = 52, m = o + 10;
|
|
563
|
+
let h = -Math.PI / 2;
|
|
564
|
+
const v = [];
|
|
565
|
+
return n.forEach((d, u) => {
|
|
566
|
+
const _ = (d.c || 0) / s, k = _ * Math.PI * 2, I = h, f = h + k;
|
|
567
|
+
h = f;
|
|
568
|
+
const S = (I + f) / 2, A = k > Math.PI ? 1 : 0, R = c + o * Math.cos(I), x = l + o * Math.sin(I), w = c + o * Math.cos(f), y = l + o * Math.sin(f), C = c + r * Math.cos(I), O = l + r * Math.sin(I), z = c + r * Math.cos(f), V = l + r * Math.sin(f), L = `M ${R.toFixed(2)} ${x.toFixed(2)} A ${o} ${o} 0 ${A} 1 ${w.toFixed(2)} ${y.toFixed(2)} L ${z.toFixed(2)} ${V.toFixed(2)} A ${r} ${r} 0 ${A} 0 ${C.toFixed(2)} ${O.toFixed(2)} Z`, G = Re[u % Re.length];
|
|
569
|
+
let ve = null, pe = 0, ge = 0, he = "start";
|
|
570
|
+
if (_ >= 0.015) {
|
|
571
|
+
const te = Math.cos(S) < 0, Ne = c + o * Math.cos(S), De = l + o * Math.sin(S), Z = c + m * Math.cos(S), ae = l + m * Math.sin(S), Le = te ? Z - 4 : Z + 4;
|
|
572
|
+
ve = `${Ne.toFixed(1)},${De.toFixed(1)} ${Z.toFixed(1)},${ae.toFixed(1)} ${Le.toFixed(1)},${ae.toFixed(1)}`, pe = te ? Z - 6 : Z + 6, ge = ae + 4, he = te ? "end" : "start";
|
|
562
573
|
}
|
|
563
|
-
|
|
574
|
+
v.push({
|
|
564
575
|
marketName: d.n,
|
|
565
576
|
count: d.c,
|
|
566
|
-
fraction:
|
|
567
|
-
color:
|
|
568
|
-
arcPath:
|
|
569
|
-
labelLine:
|
|
570
|
-
labelX:
|
|
571
|
-
labelY:
|
|
572
|
-
labelAnchor:
|
|
577
|
+
fraction: _,
|
|
578
|
+
color: G,
|
|
579
|
+
arcPath: L,
|
|
580
|
+
labelLine: ve,
|
|
581
|
+
labelX: pe,
|
|
582
|
+
labelY: ge,
|
|
583
|
+
labelAnchor: he
|
|
573
584
|
});
|
|
574
|
-
}), { width: t, height: a, cx: c, cy: l, outerR: o, innerR:
|
|
585
|
+
}), { width: t, height: a, cx: c, cy: l, outerR: o, innerR: r, slices: v };
|
|
575
586
|
}
|
|
576
|
-
const
|
|
587
|
+
const Et = ["width", "height"], Bt = ["width", "height", "viewBox"], Ot = ["x2", "y1", "y2"], Kt = ["d", "fill"], Yt = ["d", "stroke"], zt = /* @__PURE__ */ F({
|
|
577
588
|
__name: "Sparkline",
|
|
578
589
|
props: {
|
|
579
590
|
history: {},
|
|
@@ -581,8 +592,8 @@ const Bt = ["width", "height"], Ot = ["width", "height", "viewBox"], Kt = ["x2",
|
|
|
581
592
|
height: { default: 34 }
|
|
582
593
|
},
|
|
583
594
|
setup(e) {
|
|
584
|
-
const t = e, a =
|
|
585
|
-
return (n, s) => a.value.hasData ? (
|
|
595
|
+
const t = e, a = $(() => Ut(t.history, t.width, t.height));
|
|
596
|
+
return (n, s) => a.value.hasData ? (g(), M("svg", {
|
|
586
597
|
key: 1,
|
|
587
598
|
class: "pelican-spark",
|
|
588
599
|
width: a.value.width,
|
|
@@ -601,12 +612,12 @@ const Bt = ["width", "height"], Ot = ["width", "height", "viewBox"], Kt = ["x2",
|
|
|
601
612
|
"stroke-dasharray": "2 3",
|
|
602
613
|
"stroke-width": "1",
|
|
603
614
|
"vector-effect": "non-scaling-stroke"
|
|
604
|
-
}, null, 8,
|
|
615
|
+
}, null, 8, Ot),
|
|
605
616
|
i("path", {
|
|
606
617
|
d: a.value.areaPath,
|
|
607
618
|
fill: a.value.positive ? "var(--area-green)" : "var(--area-red)",
|
|
608
619
|
stroke: "none"
|
|
609
|
-
}, null, 8,
|
|
620
|
+
}, null, 8, Kt),
|
|
610
621
|
i("path", {
|
|
611
622
|
d: a.value.linePath,
|
|
612
623
|
fill: "none",
|
|
@@ -615,8 +626,8 @@ const Bt = ["width", "height"], Ot = ["width", "height", "viewBox"], Kt = ["x2",
|
|
|
615
626
|
"stroke-linejoin": "round",
|
|
616
627
|
"stroke-linecap": "round",
|
|
617
628
|
"vector-effect": "non-scaling-stroke"
|
|
618
|
-
}, null, 8,
|
|
619
|
-
], 8,
|
|
629
|
+
}, null, 8, Yt)
|
|
630
|
+
], 8, Bt)) : (g(), M("svg", {
|
|
620
631
|
key: 0,
|
|
621
632
|
class: "pelican-spark",
|
|
622
633
|
width: a.value.width,
|
|
@@ -630,15 +641,15 @@ const Bt = ["width", "height"], Ot = ["width", "height", "viewBox"], Kt = ["x2",
|
|
|
630
641
|
"font-size": "11",
|
|
631
642
|
fill: "var(--spark-no-data)"
|
|
632
643
|
}, "no data", -1)
|
|
633
|
-
])], 8,
|
|
644
|
+
])], 8, Et));
|
|
634
645
|
}
|
|
635
|
-
}),
|
|
646
|
+
}), Gt = /* @__PURE__ */ N(zt, [["__scopeId", "data-v-a9b85847"]]), Ht = {
|
|
636
647
|
key: 0,
|
|
637
648
|
class: "dim"
|
|
638
|
-
},
|
|
649
|
+
}, jt = ["viewBox"], Wt = ["d", "fill"], qt = ["points", "stroke"], Xt = ["x", "y", "text-anchor"], Zt = {
|
|
639
650
|
fill: "var(--muted)",
|
|
640
651
|
"font-weight": "400"
|
|
641
|
-
},
|
|
652
|
+
}, Jt = /* @__PURE__ */ F({
|
|
642
653
|
__name: "MarketsDonut",
|
|
643
654
|
props: {
|
|
644
655
|
markets: {},
|
|
@@ -646,8 +657,8 @@ const Bt = ["width", "height"], Ot = ["width", "height", "viewBox"], Kt = ["x2",
|
|
|
646
657
|
height: { default: 280 }
|
|
647
658
|
},
|
|
648
659
|
setup(e) {
|
|
649
|
-
const t = e, a =
|
|
650
|
-
return (s, c) => a.value ? (
|
|
660
|
+
const t = e, a = $(() => !t.markets || t.markets.length === 0), n = $(() => Vt(t.markets, t.width, t.height));
|
|
661
|
+
return (s, c) => a.value ? (g(), M("span", Ht, "no market data")) : (g(), M("svg", {
|
|
651
662
|
key: 1,
|
|
652
663
|
class: "pelican-donut",
|
|
653
664
|
viewBox: `0 0 ${n.value.width} ${n.value.height}`,
|
|
@@ -657,27 +668,27 @@ const Bt = ["width", "height"], Ot = ["width", "height", "viewBox"], Kt = ["x2",
|
|
|
657
668
|
"aria-label": "Markets donut chart"
|
|
658
669
|
}, [
|
|
659
670
|
i("g", null, [
|
|
660
|
-
(
|
|
671
|
+
(g(!0), M(D, null, Y(n.value.slices, (l) => (g(), M("path", {
|
|
661
672
|
key: l.marketName + l.fraction,
|
|
662
673
|
d: l.arcPath,
|
|
663
674
|
fill: l.color,
|
|
664
675
|
stroke: "var(--card)",
|
|
665
676
|
"stroke-width": "1.5"
|
|
666
|
-
}, null, 8,
|
|
677
|
+
}, null, 8, Wt))), 128))
|
|
667
678
|
]),
|
|
668
679
|
i("g", null, [
|
|
669
|
-
(
|
|
680
|
+
(g(!0), M(D, null, Y(n.value.slices, (l) => ye((g(), M("polyline", {
|
|
670
681
|
key: `l-${l.marketName}`,
|
|
671
682
|
points: l.labelLine ?? "",
|
|
672
683
|
stroke: l.color,
|
|
673
684
|
"stroke-width": "1",
|
|
674
685
|
fill: "none"
|
|
675
|
-
}, null, 8,
|
|
676
|
-
[
|
|
686
|
+
}, null, 8, qt)), [
|
|
687
|
+
[Me, l.labelLine]
|
|
677
688
|
])), 128))
|
|
678
689
|
]),
|
|
679
690
|
i("g", null, [
|
|
680
|
-
(
|
|
691
|
+
(g(!0), M(D, null, Y(n.value.slices, (l) => ye((g(), M("text", {
|
|
681
692
|
key: `t-${l.marketName}`,
|
|
682
693
|
x: l.labelX,
|
|
683
694
|
y: l.labelY,
|
|
@@ -686,24 +697,24 @@ const Bt = ["width", "height"], Ot = ["width", "height", "viewBox"], Kt = ["x2",
|
|
|
686
697
|
fill: "var(--text)",
|
|
687
698
|
"font-weight": "500"
|
|
688
699
|
}, [
|
|
689
|
-
|
|
690
|
-
i("tspan",
|
|
691
|
-
], 8,
|
|
692
|
-
[
|
|
700
|
+
B(b(l.marketName) + " ", 1),
|
|
701
|
+
i("tspan", Zt, b(l.count), 1)
|
|
702
|
+
], 8, Xt)), [
|
|
703
|
+
[Me, l.labelLine]
|
|
693
704
|
])), 128))
|
|
694
705
|
])
|
|
695
|
-
], 8,
|
|
706
|
+
], 8, jt));
|
|
696
707
|
}
|
|
697
|
-
}),
|
|
708
|
+
}), Qt = /* @__PURE__ */ N(Jt, [["__scopeId", "data-v-c514d53f"]]), ea = { class: "pelican-trades" }, ta = { class: "hd" }, aa = {
|
|
698
709
|
key: 0,
|
|
699
710
|
class: "dim"
|
|
700
|
-
},
|
|
711
|
+
}, na = {
|
|
701
712
|
key: 1,
|
|
702
713
|
class: "dim"
|
|
703
|
-
},
|
|
714
|
+
}, la = {
|
|
704
715
|
key: 2,
|
|
705
716
|
class: "list"
|
|
706
|
-
},
|
|
717
|
+
}, sa = { class: "market" }, oa = { class: "trade-time" }, ia = /* @__PURE__ */ F({
|
|
707
718
|
__name: "TradesPanel",
|
|
708
719
|
props: {
|
|
709
720
|
kind: {},
|
|
@@ -712,67 +723,67 @@ const Bt = ["width", "height"], Ot = ["width", "height", "viewBox"], Kt = ["x2",
|
|
|
712
723
|
locale: {}
|
|
713
724
|
},
|
|
714
725
|
setup(e) {
|
|
715
|
-
const t = e, a =
|
|
726
|
+
const t = e, a = $(() => t.kind === "open" ? "Open Trades" : "Trade History (30d)"), n = $(
|
|
716
727
|
() => !t.loading && (t.trades == null || t.trades.length === 0)
|
|
717
728
|
);
|
|
718
|
-
return (s, c) => (
|
|
719
|
-
i("div",
|
|
720
|
-
e.loading ? (
|
|
721
|
-
(
|
|
722
|
-
i("span",
|
|
729
|
+
return (s, c) => (g(), M("div", ea, [
|
|
730
|
+
i("div", ta, b(a.value), 1),
|
|
731
|
+
e.loading ? (g(), M("div", aa, "Loading…")) : n.value ? (g(), M("div", na, "No trades.")) : (g(), M("ul", la, [
|
|
732
|
+
(g(!0), M(D, null, Y(e.trades ?? [], (l, o) => (g(), M("li", { key: o }, [
|
|
733
|
+
i("span", sa, b(l.MarketName ?? "—"), 1),
|
|
723
734
|
i("span", {
|
|
724
|
-
class:
|
|
735
|
+
class: E(["dir", l.Direction === "Sell" ? "red" : "green"])
|
|
725
736
|
}, b(l.Direction ?? ""), 3),
|
|
726
|
-
i("span",
|
|
727
|
-
|
|
728
|
-
l.CloseTimestamp ? (
|
|
729
|
-
|
|
730
|
-
], 64)) :
|
|
737
|
+
i("span", oa, [
|
|
738
|
+
B(b(p(_e)(l.OpenTimestamp, e.locale)) + " ", 1),
|
|
739
|
+
l.CloseTimestamp ? (g(), M(D, { key: 0 }, [
|
|
740
|
+
B(" → " + b(p(_e)(l.CloseTimestamp, e.locale)), 1)
|
|
741
|
+
], 64)) : K("", !0)
|
|
731
742
|
]),
|
|
732
|
-
l.Pnl != null ? (
|
|
743
|
+
l.Pnl != null ? (g(), M("span", {
|
|
733
744
|
key: 0,
|
|
734
|
-
class:
|
|
735
|
-
}, b(
|
|
745
|
+
class: E(["pnl", l.Pnl >= 0 ? "green" : "red"])
|
|
746
|
+
}, b(p(j)(l.Pnl, e.locale)), 3)) : K("", !0)
|
|
736
747
|
]))), 128))
|
|
737
748
|
]))
|
|
738
749
|
]));
|
|
739
750
|
}
|
|
740
|
-
}), Se = /* @__PURE__ */ N(
|
|
741
|
-
function
|
|
751
|
+
}), Se = /* @__PURE__ */ N(ia, [["__scopeId", "data-v-aa7cbcd7"]]);
|
|
752
|
+
function q(e) {
|
|
742
753
|
const t = e.Wins ?? 0, a = e.Losses ?? 0, n = t + a;
|
|
743
754
|
return n ? t / n * 100 : -1;
|
|
744
755
|
}
|
|
745
|
-
const
|
|
756
|
+
const ra = Symbol("pelican.apiBase"), ua = Symbol("pelican.catalogBase"), Ae = Symbol("pelican.locale"), ca = ["data-id"], da = { class: "name" }, ma = { class: "avatar" }, fa = { class: "avatar-fallback" }, va = ["src"], pa = { class: "nm" }, ga = { class: "title" }, ha = {
|
|
746
757
|
key: 0,
|
|
747
758
|
class: "free-badge"
|
|
748
|
-
},
|
|
759
|
+
}, ya = { class: "by" }, Ma = {
|
|
749
760
|
class: "c-spark",
|
|
750
761
|
"data-label": "Equity curve"
|
|
751
|
-
},
|
|
762
|
+
}, ba = {
|
|
752
763
|
class: "c-num",
|
|
753
764
|
"data-label": "Return"
|
|
754
|
-
},
|
|
765
|
+
}, xa = { key: 1 }, wa = {
|
|
755
766
|
class: "c-num",
|
|
756
767
|
"data-label": "Copiers"
|
|
757
|
-
},
|
|
768
|
+
}, $a = {
|
|
758
769
|
class: "c-num",
|
|
759
770
|
"data-label": "Copiers AUM"
|
|
760
|
-
},
|
|
771
|
+
}, ka = {
|
|
761
772
|
class: "c-num",
|
|
762
773
|
"data-label": "Max DD"
|
|
763
|
-
}, _a = { key: 1 },
|
|
774
|
+
}, _a = { key: 1 }, Ia = {
|
|
764
775
|
class: "c-num",
|
|
765
776
|
"data-label": "Age"
|
|
766
777
|
}, Ra = {
|
|
767
778
|
class: "c-num",
|
|
768
779
|
"data-label": "Balance"
|
|
769
|
-
},
|
|
780
|
+
}, Sa = {
|
|
770
781
|
class: "c-num",
|
|
771
782
|
"data-label": "Fee"
|
|
772
|
-
},
|
|
783
|
+
}, Pa = ["href"], Ca = { class: "grid" }, Ta = { class: "col-stats" }, Aa = { class: "field" }, Fa = { class: "value" }, Na = { class: "field" }, Da = { class: "value" }, La = { class: "field" }, Ua = { class: "value" }, Va = { class: "field" }, Ea = { class: "value" }, Ba = { class: "field" }, Oa = { class: "value" }, Ka = { class: "field" }, Ya = { class: "value" }, za = { class: "field" }, Ga = { class: "value" }, Ha = { class: "field" }, ja = { class: "value" }, Wa = { key: 0 }, qa = {
|
|
773
784
|
key: 1,
|
|
774
785
|
class: "dim"
|
|
775
|
-
},
|
|
786
|
+
}, Xa = { class: "col-donut" }, Za = { class: "trade-toggles" }, Ja = /* @__PURE__ */ F({
|
|
776
787
|
__name: "StrategyRow",
|
|
777
788
|
props: {
|
|
778
789
|
s: {},
|
|
@@ -782,172 +793,172 @@ const ua = Symbol("pelican.apiBase"), ca = Symbol("pelican.catalogBase"), Te = S
|
|
|
782
793
|
},
|
|
783
794
|
emits: ["toggle", "load-trades", "select"],
|
|
784
795
|
setup(e, { emit: t }) {
|
|
785
|
-
const a = e, n = t, s = Ue(
|
|
796
|
+
const a = e, n = t, s = Ue(Ae, "en-US"), c = $(() => we(a.s.Return, 1)), l = $(() => a.s.MaxDD != null ? we(a.s.MaxDD, 2) : null), o = $(() => W(a.s.Inception)), r = $(() => q(a.s)), m = $(() => r.value >= 0 ? 100 - r.value : -1), h = $(
|
|
786
797
|
() => {
|
|
787
|
-
var
|
|
788
|
-
return ((
|
|
798
|
+
var I, f;
|
|
799
|
+
return ((I = a.s.Profile) == null ? void 0 : I.Name) ?? ((f = a.s.Profile) != null && f.Id ? "#" + a.s.Profile.Id : "");
|
|
789
800
|
}
|
|
790
|
-
),
|
|
791
|
-
function
|
|
801
|
+
), v = $(() => `https://libertex.copy-trade.io/strategy/${a.s.Id}`), d = P(!1), u = P(!1);
|
|
802
|
+
function _() {
|
|
792
803
|
d.value = !d.value, d.value && !a.openTrades && n("load-trades", "open");
|
|
793
804
|
}
|
|
794
|
-
function
|
|
795
|
-
|
|
805
|
+
function k() {
|
|
806
|
+
u.value = !u.value, u.value && !a.closedTrades && n("load-trades", "closed");
|
|
796
807
|
}
|
|
797
|
-
return (
|
|
798
|
-
var
|
|
799
|
-
return
|
|
808
|
+
return (I, f) => {
|
|
809
|
+
var S, A, R, x;
|
|
810
|
+
return g(), M(D, null, [
|
|
800
811
|
i("div", {
|
|
801
|
-
class:
|
|
812
|
+
class: E(["pelican-row", { open: e.expanded }]),
|
|
802
813
|
"data-id": e.s.Id,
|
|
803
|
-
onClick:
|
|
814
|
+
onClick: f[3] || (f[3] = (w) => n("toggle"))
|
|
804
815
|
}, [
|
|
805
|
-
i("div",
|
|
806
|
-
i("div",
|
|
807
|
-
i("span",
|
|
808
|
-
e.s.ImageUploaded ? (
|
|
816
|
+
i("div", da, [
|
|
817
|
+
i("div", ma, [
|
|
818
|
+
i("span", fa, b(p(Rt)(e.s.Name)), 1),
|
|
819
|
+
e.s.ImageUploaded ? (g(), M("img", {
|
|
809
820
|
key: 0,
|
|
810
821
|
class: "avatar-img",
|
|
811
822
|
src: `https://assets.copy-trade.io/images/strategies/thumbnails/${e.s.Id}`,
|
|
812
823
|
alt: "",
|
|
813
824
|
loading: "lazy",
|
|
814
825
|
decoding: "async",
|
|
815
|
-
onError:
|
|
816
|
-
}, null, 40,
|
|
826
|
+
onError: f[0] || (f[0] = (w) => w.target.remove())
|
|
827
|
+
}, null, 40, va)) : K("", !0)
|
|
817
828
|
]),
|
|
818
|
-
i("div",
|
|
819
|
-
i("div",
|
|
820
|
-
|
|
821
|
-
e.s._meta && e.s.Fee == null ? (
|
|
829
|
+
i("div", pa, [
|
|
830
|
+
i("div", ga, [
|
|
831
|
+
B(b(e.s.Name || "#" + e.s.Id) + " ", 1),
|
|
832
|
+
e.s._meta && e.s.Fee == null ? (g(), M("span", ha, "free")) : K("", !0)
|
|
822
833
|
]),
|
|
823
|
-
i("div",
|
|
834
|
+
i("div", ya, b(h.value), 1)
|
|
824
835
|
])
|
|
825
836
|
]),
|
|
826
|
-
i("div",
|
|
827
|
-
|
|
837
|
+
i("div", Ma, [
|
|
838
|
+
T(Gt, {
|
|
828
839
|
history: e.s.History
|
|
829
840
|
}, null, 8, ["history"])
|
|
830
841
|
]),
|
|
831
|
-
i("div",
|
|
832
|
-
c.value ? (
|
|
842
|
+
i("div", ba, [
|
|
843
|
+
c.value ? (g(), M("span", {
|
|
833
844
|
key: 0,
|
|
834
|
-
class:
|
|
835
|
-
}, b(c.value.text), 3)) : (
|
|
845
|
+
class: E(c.value.positive ? "green" : "red")
|
|
846
|
+
}, b(c.value.text), 3)) : (g(), M("span", xa, "—"))
|
|
836
847
|
]),
|
|
837
|
-
i("div",
|
|
838
|
-
i("div",
|
|
839
|
-
i("div",
|
|
840
|
-
l.value ? (
|
|
848
|
+
i("div", wa, b(p(ke)(e.s.NumCopiers, p(s))), 1),
|
|
849
|
+
i("div", $a, b(p($e)(e.s.CopiersAUM, p(s))), 1),
|
|
850
|
+
i("div", ka, [
|
|
851
|
+
l.value ? (g(), M("span", {
|
|
841
852
|
key: 0,
|
|
842
|
-
class:
|
|
843
|
-
}, b(l.value.text), 3)) : (
|
|
853
|
+
class: E(l.value.positive ? "green" : "red")
|
|
854
|
+
}, b(l.value.text), 3)) : (g(), M("span", _a, "—"))
|
|
844
855
|
]),
|
|
845
|
-
i("div",
|
|
846
|
-
i("div", Ra, b(
|
|
847
|
-
i("div",
|
|
856
|
+
i("div", Ia, b(p(_t)(o.value)), 1),
|
|
857
|
+
i("div", Ra, b(p($e)(e.s.AccountBalance, p(s))), 1),
|
|
858
|
+
i("div", Sa, b(p(kt)(e.s)), 1),
|
|
848
859
|
i("div", {
|
|
849
860
|
class: "c-link",
|
|
850
|
-
onClick:
|
|
861
|
+
onClick: f[2] || (f[2] = ne(() => {
|
|
851
862
|
}, ["stop"]))
|
|
852
863
|
}, [
|
|
853
864
|
i("a", {
|
|
854
865
|
class: "signal-link",
|
|
855
|
-
href:
|
|
866
|
+
href: v.value,
|
|
856
867
|
target: "_blank",
|
|
857
868
|
rel: "noopener",
|
|
858
|
-
onClick:
|
|
869
|
+
onClick: f[1] || (f[1] = ne(() => {
|
|
859
870
|
}, ["stop"]))
|
|
860
|
-
}, " Get connected ", 8,
|
|
861
|
-
|
|
871
|
+
}, " Get connected ", 8, Pa),
|
|
872
|
+
X(I.$slots, "row-actions", { strategy: e.s }, void 0, !0)
|
|
862
873
|
])
|
|
863
|
-
], 10,
|
|
864
|
-
e.expanded ? (
|
|
874
|
+
], 10, ca),
|
|
875
|
+
e.expanded ? (g(), M("div", {
|
|
865
876
|
key: 0,
|
|
866
877
|
class: "pelican-row-expanded",
|
|
867
|
-
onClick:
|
|
878
|
+
onClick: f[4] || (f[4] = ne(() => {
|
|
868
879
|
}, ["stop"]))
|
|
869
880
|
}, [
|
|
870
|
-
i("div",
|
|
871
|
-
i("div",
|
|
872
|
-
i("div",
|
|
873
|
-
|
|
874
|
-
i("div",
|
|
881
|
+
i("div", Ca, [
|
|
882
|
+
i("div", Ta, [
|
|
883
|
+
i("div", Aa, [
|
|
884
|
+
f[5] || (f[5] = i("div", { class: "label" }, "Currency", -1)),
|
|
885
|
+
i("div", Fa, b(e.s.Currency ?? "USD"), 1)
|
|
875
886
|
]),
|
|
876
|
-
i("div",
|
|
877
|
-
|
|
878
|
-
i("div", Da, b(
|
|
887
|
+
i("div", Na, [
|
|
888
|
+
f[6] || (f[6] = i("div", { class: "label" }, "Monthly profit", -1)),
|
|
889
|
+
i("div", Da, b(p(j)(e.s.MonthlyProfit, p(s))), 1)
|
|
879
890
|
]),
|
|
880
|
-
i("div",
|
|
881
|
-
|
|
882
|
-
i("div",
|
|
891
|
+
i("div", La, [
|
|
892
|
+
f[7] || (f[7] = i("div", { class: "label" }, "Yearly profit", -1)),
|
|
893
|
+
i("div", Ua, b(p(j)(e.s.YearlyProfit, p(s))), 1)
|
|
883
894
|
]),
|
|
884
|
-
i("div",
|
|
885
|
-
|
|
886
|
-
i("div",
|
|
895
|
+
i("div", Va, [
|
|
896
|
+
f[8] || (f[8] = i("div", { class: "label" }, "Balance", -1)),
|
|
897
|
+
i("div", Ea, b(p(j)(e.s.AccountBalance, p(s))), 1)
|
|
887
898
|
]),
|
|
888
|
-
i("div",
|
|
889
|
-
|
|
890
|
-
i("div",
|
|
899
|
+
i("div", Ba, [
|
|
900
|
+
f[9] || (f[9] = i("div", { class: "label" }, "Realized P/L", -1)),
|
|
901
|
+
i("div", Oa, b(p(j)(e.s.RealisedPnl, p(s))), 1)
|
|
891
902
|
]),
|
|
892
|
-
i("div",
|
|
893
|
-
|
|
894
|
-
i("div",
|
|
903
|
+
i("div", Ka, [
|
|
904
|
+
f[10] || (f[10] = i("div", { class: "label" }, "Unrealized P/L", -1)),
|
|
905
|
+
i("div", Ya, b(p(j)(e.s.UnrealisedPnl, p(s))), 1)
|
|
895
906
|
]),
|
|
896
|
-
i("div",
|
|
897
|
-
|
|
898
|
-
i("div",
|
|
907
|
+
i("div", za, [
|
|
908
|
+
f[11] || (f[11] = i("div", { class: "label" }, "Trades total", -1)),
|
|
909
|
+
i("div", Ga, b(p(ke)(e.s.TradesTotal, p(s))), 1)
|
|
899
910
|
]),
|
|
900
|
-
i("div",
|
|
901
|
-
|
|
902
|
-
i("div",
|
|
903
|
-
|
|
911
|
+
i("div", Ha, [
|
|
912
|
+
f[12] || (f[12] = i("div", { class: "label" }, "Win rate", -1)),
|
|
913
|
+
i("div", ja, [
|
|
914
|
+
r.value >= 0 ? (g(), M("span", Wa, b(r.value.toFixed(1)) + "% / " + b(m.value.toFixed(1)) + "%", 1)) : (g(), M("span", qa, "—"))
|
|
904
915
|
])
|
|
905
916
|
])
|
|
906
917
|
]),
|
|
907
|
-
i("div",
|
|
908
|
-
|
|
909
|
-
|
|
918
|
+
i("div", Xa, [
|
|
919
|
+
f[13] || (f[13] = i("div", { class: "hd" }, "Markets", -1)),
|
|
920
|
+
T(Qt, {
|
|
910
921
|
markets: e.s.Markets
|
|
911
922
|
}, null, 8, ["markets"])
|
|
912
923
|
])
|
|
913
924
|
]),
|
|
914
|
-
i("div",
|
|
925
|
+
i("div", Za, [
|
|
915
926
|
i("button", {
|
|
916
|
-
class:
|
|
927
|
+
class: E(["pill", { on: d.value }]),
|
|
917
928
|
type: "button",
|
|
918
|
-
onClick:
|
|
929
|
+
onClick: _
|
|
919
930
|
}, b(d.value ? "Hide" : "Open Trades"), 3),
|
|
920
931
|
i("button", {
|
|
921
|
-
class:
|
|
932
|
+
class: E(["pill", { on: u.value }]),
|
|
922
933
|
type: "button",
|
|
923
|
-
onClick:
|
|
924
|
-
}, b(
|
|
934
|
+
onClick: k
|
|
935
|
+
}, b(u.value ? "Hide" : "Trade History"), 3)
|
|
925
936
|
]),
|
|
926
|
-
d.value ? (
|
|
937
|
+
d.value ? (g(), ue(Se, {
|
|
927
938
|
key: 0,
|
|
928
939
|
kind: "open",
|
|
929
|
-
trades: ((
|
|
930
|
-
loading: !!((
|
|
931
|
-
locale:
|
|
932
|
-
}, null, 8, ["trades", "loading", "locale"])) :
|
|
933
|
-
|
|
940
|
+
trades: ((S = e.openTrades) == null ? void 0 : S.trades) ?? null,
|
|
941
|
+
loading: !!((A = e.openTrades) != null && A.loading),
|
|
942
|
+
locale: p(s)
|
|
943
|
+
}, null, 8, ["trades", "loading", "locale"])) : K("", !0),
|
|
944
|
+
u.value ? (g(), ue(Se, {
|
|
934
945
|
key: 1,
|
|
935
946
|
kind: "closed",
|
|
936
|
-
trades: ((
|
|
947
|
+
trades: ((R = e.closedTrades) == null ? void 0 : R.trades) ?? null,
|
|
937
948
|
loading: !!((x = e.closedTrades) != null && x.loading),
|
|
938
|
-
locale:
|
|
939
|
-
}, null, 8, ["trades", "loading", "locale"])) :
|
|
940
|
-
])) :
|
|
949
|
+
locale: p(s)
|
|
950
|
+
}, null, 8, ["trades", "loading", "locale"])) : K("", !0)
|
|
951
|
+
])) : K("", !0)
|
|
941
952
|
], 64);
|
|
942
953
|
};
|
|
943
954
|
}
|
|
944
|
-
}),
|
|
955
|
+
}), Qa = /* @__PURE__ */ N(Ja, [["__scopeId", "data-v-61c1236b"]]), en = {
|
|
945
956
|
key: 0,
|
|
946
957
|
class: "pelican-pager"
|
|
947
|
-
},
|
|
958
|
+
}, tn = ["disabled"], an = {
|
|
948
959
|
key: 0,
|
|
949
960
|
class: "gap"
|
|
950
|
-
},
|
|
961
|
+
}, nn = ["onClick"], ln = ["disabled"], sn = { class: "info" }, on = ["max", "value"], rn = /* @__PURE__ */ F({
|
|
951
962
|
__name: "Pager",
|
|
952
963
|
props: {
|
|
953
964
|
page: {},
|
|
@@ -964,38 +975,38 @@ const ua = Symbol("pelican.apiBase"), ca = Symbol("pelican.catalogBase"), Te = S
|
|
|
964
975
|
const o = parseInt(l.target.value, 10);
|
|
965
976
|
isNaN(o) || n("go", o);
|
|
966
977
|
}
|
|
967
|
-
return (l, o) => a.totalPages > 1 ? (
|
|
978
|
+
return (l, o) => a.totalPages > 1 ? (g(), M("nav", en, [
|
|
968
979
|
i("button", {
|
|
969
980
|
disabled: e.page <= 1,
|
|
970
|
-
onClick: o[0] || (o[0] = (
|
|
971
|
-
}, "‹ prev", 8,
|
|
972
|
-
(
|
|
973
|
-
|
|
981
|
+
onClick: o[0] || (o[0] = (r) => s("prev"))
|
|
982
|
+
}, "‹ prev", 8, tn),
|
|
983
|
+
(g(!0), M(D, null, Y(e.range, (r, m) => (g(), M(D, { key: m }, [
|
|
984
|
+
r === "…" ? (g(), M("span", an, "…")) : (g(), M("button", {
|
|
974
985
|
key: 1,
|
|
975
|
-
class:
|
|
976
|
-
onClick: (
|
|
977
|
-
}, b(
|
|
986
|
+
class: E(["page", { cur: r === e.page }]),
|
|
987
|
+
onClick: (h) => s(r)
|
|
988
|
+
}, b(r), 11, nn))
|
|
978
989
|
], 64))), 128)),
|
|
979
990
|
i("button", {
|
|
980
991
|
disabled: e.page >= e.totalPages,
|
|
981
|
-
onClick: o[1] || (o[1] = (
|
|
982
|
-
}, "next ›", 8,
|
|
983
|
-
i("span",
|
|
984
|
-
o[2] || (o[2] =
|
|
992
|
+
onClick: o[1] || (o[1] = (r) => s("next"))
|
|
993
|
+
}, "next ›", 8, ln),
|
|
994
|
+
i("span", sn, [
|
|
995
|
+
o[2] || (o[2] = B(" go to ", -1)),
|
|
985
996
|
i("input", {
|
|
986
997
|
type: "number",
|
|
987
998
|
min: 1,
|
|
988
999
|
max: e.totalPages,
|
|
989
1000
|
value: e.page,
|
|
990
1001
|
onChange: c
|
|
991
|
-
}, null, 40,
|
|
1002
|
+
}, null, 40, on)
|
|
992
1003
|
])
|
|
993
|
-
])) :
|
|
1004
|
+
])) : K("", !0);
|
|
994
1005
|
}
|
|
995
|
-
}),
|
|
1006
|
+
}), un = /* @__PURE__ */ N(rn, [["__scopeId", "data-v-42928155"]]), cn = { class: "pelican-table" }, dn = { class: "row head" }, mn = ["onClick"], fn = {
|
|
996
1007
|
key: 0,
|
|
997
1008
|
class: "empty"
|
|
998
|
-
},
|
|
1009
|
+
}, vn = /* @__PURE__ */ F({
|
|
999
1010
|
__name: "StrategyTable",
|
|
1000
1011
|
props: {
|
|
1001
1012
|
pageItems: {},
|
|
@@ -1021,48 +1032,48 @@ const ua = Symbol("pelican.apiBase"), ca = Symbol("pelican.catalogBase"), Te = S
|
|
|
1021
1032
|
function c(l) {
|
|
1022
1033
|
return a.sortKey === `${l}-asc` ? "active-asc" : a.sortKey === `${l}-desc` ? "active-desc" : "";
|
|
1023
1034
|
}
|
|
1024
|
-
return (l, o) => (
|
|
1025
|
-
i("div",
|
|
1035
|
+
return (l, o) => (g(), M("section", cn, [
|
|
1036
|
+
i("div", dn, [
|
|
1026
1037
|
o[1] || (o[1] = i("div", null, "Name", -1)),
|
|
1027
1038
|
o[2] || (o[2] = i("div", null, "Equity curve", -1)),
|
|
1028
|
-
(
|
|
1029
|
-
key:
|
|
1030
|
-
class:
|
|
1031
|
-
onClick: (m) => n("toggle-sort",
|
|
1032
|
-
}, b(
|
|
1039
|
+
(g(), M(D, null, Y(s, (r) => i("div", {
|
|
1040
|
+
key: r.key,
|
|
1041
|
+
class: E(["c-num sortable", c(r.key)]),
|
|
1042
|
+
onClick: (m) => n("toggle-sort", r.key)
|
|
1043
|
+
}, b(r.label), 11, mn)), 64)),
|
|
1033
1044
|
o[3] || (o[3] = i("div", null, null, -1))
|
|
1034
1045
|
]),
|
|
1035
|
-
e.pageItems.length === 0 ? (
|
|
1036
|
-
|
|
1037
|
-
o[4] || (o[4] =
|
|
1046
|
+
e.pageItems.length === 0 ? (g(), M("div", fn, [
|
|
1047
|
+
X(l.$slots, "empty", {}, () => [
|
|
1048
|
+
o[4] || (o[4] = B("No matches.", -1))
|
|
1038
1049
|
], !0)
|
|
1039
|
-
])) : (
|
|
1040
|
-
key:
|
|
1041
|
-
s:
|
|
1042
|
-
expanded: e.expanded.has(
|
|
1043
|
-
"open-trades": e.openSignals.get(
|
|
1044
|
-
"closed-trades": e.closedSignals.get(
|
|
1045
|
-
onToggle: (m) => n("toggle-row",
|
|
1046
|
-
onLoadTrades: (m) => n("load-trades", { id:
|
|
1047
|
-
onSelect: (m) => n("select",
|
|
1050
|
+
])) : (g(!0), M(D, { key: 1 }, Y(e.pageItems, (r) => (g(), ue(Qa, {
|
|
1051
|
+
key: r.Id,
|
|
1052
|
+
s: r,
|
|
1053
|
+
expanded: e.expanded.has(r.Id),
|
|
1054
|
+
"open-trades": e.openSignals.get(r.Id) ?? null,
|
|
1055
|
+
"closed-trades": e.closedSignals.get(r.Id) ?? null,
|
|
1056
|
+
onToggle: (m) => n("toggle-row", r.Id),
|
|
1057
|
+
onLoadTrades: (m) => n("load-trades", { id: r.Id, kind: m }),
|
|
1058
|
+
onSelect: (m) => n("select", r)
|
|
1048
1059
|
}, {
|
|
1049
|
-
"row-actions":
|
|
1050
|
-
|
|
1060
|
+
"row-actions": ce((m) => [
|
|
1061
|
+
X(l.$slots, "row-actions", Ve({ ref_for: !0 }, m), void 0, !0)
|
|
1051
1062
|
]),
|
|
1052
1063
|
_: 3
|
|
1053
1064
|
}, 8, ["s", "expanded", "open-trades", "closed-trades", "onToggle", "onLoadTrades", "onSelect"]))), 128)),
|
|
1054
|
-
|
|
1065
|
+
T(un, {
|
|
1055
1066
|
page: e.page,
|
|
1056
1067
|
"total-pages": e.totalPages,
|
|
1057
1068
|
range: e.pageRange,
|
|
1058
|
-
onGo: o[0] || (o[0] = (
|
|
1069
|
+
onGo: o[0] || (o[0] = (r) => n("go", r))
|
|
1059
1070
|
}, null, 8, ["page", "total-pages", "range"])
|
|
1060
1071
|
]));
|
|
1061
1072
|
}
|
|
1062
|
-
}),
|
|
1073
|
+
}), pn = /* @__PURE__ */ N(vn, [["__scopeId", "data-v-c61b9ce8"]]), gn = {
|
|
1063
1074
|
key: 0,
|
|
1064
1075
|
class: "pelican-progress"
|
|
1065
|
-
},
|
|
1076
|
+
}, hn = { class: "bar" }, yn = { class: "caption" }, Mn = /* @__PURE__ */ F({
|
|
1066
1077
|
__name: "ProgressBar",
|
|
1067
1078
|
props: {
|
|
1068
1079
|
loaded: {},
|
|
@@ -1070,185 +1081,180 @@ const ua = Symbol("pelican.apiBase"), ca = Symbol("pelican.catalogBase"), Te = S
|
|
|
1070
1081
|
active: { type: Boolean }
|
|
1071
1082
|
},
|
|
1072
1083
|
setup(e) {
|
|
1073
|
-
const t = e, a =
|
|
1084
|
+
const t = e, a = $(
|
|
1074
1085
|
() => t.total > 0 ? Math.min(100, t.loaded / t.total * 100) : 0
|
|
1075
1086
|
);
|
|
1076
|
-
return (n, s) => e.active ? (
|
|
1077
|
-
i("div",
|
|
1087
|
+
return (n, s) => e.active ? (g(), M("div", gn, [
|
|
1088
|
+
i("div", hn, [
|
|
1078
1089
|
i("span", {
|
|
1079
|
-
style:
|
|
1090
|
+
style: Q({ width: a.value.toFixed(1) + "%" })
|
|
1080
1091
|
}, null, 4)
|
|
1081
1092
|
]),
|
|
1082
|
-
i("div",
|
|
1083
|
-
|
|
1084
|
-
i("b", null, b(e.loaded.toLocaleString("en-US")), 1),
|
|
1085
|
-
D(" / " + b(e.total.toLocaleString("en-US")) + " strategies (" + b(a.value.toFixed(0)) + "%) · ", 1),
|
|
1086
|
-
s[1] || (s[1] = i("i", null, "upstream rate-limited", -1))
|
|
1087
|
-
]),
|
|
1088
|
-
i("div", bn, " All " + b(e.total.toLocaleString("en-US")) + " strategies are visible. Stats fill in as the build progresses; refresh of data every 20 sec. ", 1)
|
|
1089
|
-
])) : O("", !0);
|
|
1093
|
+
i("div", yn, "Refreshing strategy data · " + b(a.value.toFixed(0)) + "%", 1)
|
|
1094
|
+
])) : K("", !0);
|
|
1090
1095
|
}
|
|
1091
|
-
}),
|
|
1092
|
-
function
|
|
1093
|
-
const t =
|
|
1096
|
+
}), bn = /* @__PURE__ */ N(Mn, [["__scopeId", "data-v-032fb4e2"]]), Fe = "pelican-theme";
|
|
1097
|
+
function xn(e = "auto") {
|
|
1098
|
+
const t = wn(), a = P(t ?? e), n = P("dark"), s = typeof window < "u" && window.matchMedia ? window.matchMedia("(prefers-color-scheme: dark)") : null, c = () => {
|
|
1094
1099
|
const m = a.value;
|
|
1095
1100
|
n.value = m === "dark" ? "dark" : m === "light" ? "light" : s != null && s.matches ? "dark" : "light";
|
|
1096
1101
|
}, l = () => {
|
|
1097
1102
|
a.value === "auto" && c();
|
|
1098
1103
|
};
|
|
1099
|
-
s && (s.addEventListener ? s.addEventListener("change", l) : s.addListener(l)),
|
|
1104
|
+
s && (s.addEventListener ? s.addEventListener("change", l) : s.addListener(l)), U(a, (m) => {
|
|
1100
1105
|
try {
|
|
1101
|
-
localStorage.setItem(
|
|
1106
|
+
localStorage.setItem(Fe, m);
|
|
1102
1107
|
} catch {
|
|
1103
1108
|
}
|
|
1104
1109
|
c();
|
|
1105
|
-
}), c(),
|
|
1110
|
+
}), c(), fe(() => {
|
|
1106
1111
|
s && (s.removeEventListener ? s.removeEventListener("change", l) : s.removeListener(l));
|
|
1107
1112
|
});
|
|
1108
1113
|
function o(m) {
|
|
1109
1114
|
a.value = m;
|
|
1110
1115
|
}
|
|
1111
|
-
function
|
|
1116
|
+
function r() {
|
|
1112
1117
|
a.value = a.value === "dark" ? "light" : a.value === "light" ? "auto" : "dark";
|
|
1113
1118
|
}
|
|
1114
|
-
return { mode: a, resolved: n, setMode: o, cycle:
|
|
1119
|
+
return { mode: a, resolved: n, setMode: o, cycle: r };
|
|
1115
1120
|
}
|
|
1116
|
-
function
|
|
1121
|
+
function wn() {
|
|
1117
1122
|
try {
|
|
1118
|
-
const e = localStorage.getItem(
|
|
1123
|
+
const e = localStorage.getItem(Fe);
|
|
1119
1124
|
return e === "dark" || e === "light" || e === "auto" ? e : null;
|
|
1120
1125
|
} catch {
|
|
1121
1126
|
return null;
|
|
1122
1127
|
}
|
|
1123
1128
|
}
|
|
1124
|
-
function
|
|
1129
|
+
function J(e, t, a) {
|
|
1125
1130
|
const n = new Error(t);
|
|
1126
1131
|
return n.code = e, a !== void 0 && (n.status = a), n;
|
|
1127
1132
|
}
|
|
1128
|
-
async function
|
|
1129
|
-
const a =
|
|
1133
|
+
async function re(e, t) {
|
|
1134
|
+
const a = ee(t, e);
|
|
1130
1135
|
let n;
|
|
1131
1136
|
try {
|
|
1132
1137
|
n = await fetch(a);
|
|
1133
1138
|
} catch (s) {
|
|
1134
|
-
throw
|
|
1139
|
+
throw J("fetch_failed", s.message ?? "fetch failed");
|
|
1135
1140
|
}
|
|
1136
1141
|
if (n.status === 401 || n.status === 503)
|
|
1137
|
-
throw
|
|
1142
|
+
throw J("no_token", "Proxy has no token yet", n.status);
|
|
1138
1143
|
if (!n.ok) {
|
|
1139
1144
|
const s = await n.text().catch(() => "");
|
|
1140
|
-
throw
|
|
1145
|
+
throw J("http_error", `${n.status}: ${s.slice(0, 120)}`, n.status);
|
|
1141
1146
|
}
|
|
1142
1147
|
return await n.json();
|
|
1143
1148
|
}
|
|
1144
|
-
function
|
|
1149
|
+
function ee(e, t) {
|
|
1145
1150
|
if (!e) return t;
|
|
1146
1151
|
const a = e.endsWith("/") ? e.slice(0, -1) : e, n = t.startsWith("/") ? t : "/" + t;
|
|
1147
1152
|
return a + n;
|
|
1148
1153
|
}
|
|
1149
|
-
function
|
|
1150
|
-
const n = Ee(/* @__PURE__ */ new Map()), s =
|
|
1151
|
-
let
|
|
1152
|
-
const
|
|
1153
|
-
a ? a(
|
|
1154
|
+
function $n({ apiBase: e, catalogBase: t, onError: a }) {
|
|
1155
|
+
const n = Ee(/* @__PURE__ */ new Map()), s = P(!1), c = P(!1), l = P(0), o = P(0), r = P(null), m = $(() => Array.from(n.value.values()));
|
|
1156
|
+
let h = !1;
|
|
1157
|
+
const v = (y) => {
|
|
1158
|
+
a ? a(y) : console.warn("[pelican-vue]", y);
|
|
1154
1159
|
}, d = () => {
|
|
1155
|
-
const
|
|
1156
|
-
return !!
|
|
1157
|
-
},
|
|
1158
|
-
async function
|
|
1160
|
+
const y = t == null ? void 0 : t.value;
|
|
1161
|
+
return !!y && y !== e.value;
|
|
1162
|
+
}, u = () => (t == null ? void 0 : t.value) || e.value;
|
|
1163
|
+
async function _(y) {
|
|
1159
1164
|
try {
|
|
1160
|
-
const
|
|
1161
|
-
o.value =
|
|
1165
|
+
const O = await re(y ? "/api/strategies-full?partial=1" : "/api/strategies-full", u());
|
|
1166
|
+
o.value = O.length;
|
|
1162
1167
|
const z = n.value;
|
|
1163
|
-
for (const
|
|
1164
|
-
|
|
1165
|
-
} catch (
|
|
1166
|
-
|
|
1168
|
+
for (const V of O) z.set(V.Id, { ...z.get(V.Id), ...V });
|
|
1169
|
+
le(n);
|
|
1170
|
+
} catch (C) {
|
|
1171
|
+
v(C);
|
|
1167
1172
|
}
|
|
1168
1173
|
}
|
|
1169
|
-
async function
|
|
1174
|
+
async function k() {
|
|
1170
1175
|
try {
|
|
1171
|
-
const
|
|
1172
|
-
return l.value =
|
|
1173
|
-
} catch (
|
|
1174
|
-
return
|
|
1176
|
+
const y = await re("/api/strategies-full/progress", u());
|
|
1177
|
+
return l.value = y.loaded, o.value = y.total || o.value, c.value = y.building, r.value = y.built_at, y;
|
|
1178
|
+
} catch (y) {
|
|
1179
|
+
return v(y), null;
|
|
1175
1180
|
}
|
|
1176
1181
|
}
|
|
1177
|
-
async function
|
|
1182
|
+
async function I() {
|
|
1178
1183
|
if (d()) {
|
|
1179
|
-
await
|
|
1184
|
+
await _(!1), k(), s.value = !0;
|
|
1180
1185
|
return;
|
|
1181
1186
|
}
|
|
1182
|
-
await
|
|
1183
|
-
let
|
|
1184
|
-
for (; !
|
|
1185
|
-
const
|
|
1186
|
-
if (!
|
|
1187
|
-
await
|
|
1187
|
+
await _(!0);
|
|
1188
|
+
let y = Date.now();
|
|
1189
|
+
for (; !h; ) {
|
|
1190
|
+
const C = await k();
|
|
1191
|
+
if (!C) {
|
|
1192
|
+
await Ce(1500);
|
|
1188
1193
|
continue;
|
|
1189
1194
|
}
|
|
1190
|
-
if (
|
|
1191
|
-
Date.now() -
|
|
1195
|
+
if (C.ready) break;
|
|
1196
|
+
Date.now() - y > je && (await _(!0), y = Date.now()), await Ce(He);
|
|
1192
1197
|
}
|
|
1193
|
-
|
|
1198
|
+
h || (await _(!1), s.value = !0);
|
|
1194
1199
|
}
|
|
1195
|
-
const
|
|
1196
|
-
async function
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1200
|
+
const f = /* @__PURE__ */ new Set();
|
|
1201
|
+
async function S(y) {
|
|
1202
|
+
var O;
|
|
1203
|
+
if (f.has(y)) return;
|
|
1204
|
+
const C = n.value.get(y);
|
|
1205
|
+
if (!(C != null && C._enrichAttempted && C._meta && C._stats && ((O = C.History) != null && O.length))) {
|
|
1206
|
+
f.add(y);
|
|
1201
1207
|
try {
|
|
1202
|
-
const [
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
]), L = n.value,
|
|
1206
|
-
|
|
1208
|
+
const [z, V] = await Promise.all([
|
|
1209
|
+
Pe(ee(e.value, `/api/strategies/${y}`)),
|
|
1210
|
+
Pe(ee(e.value, `/api/strategies/${y}/stats`))
|
|
1211
|
+
]), L = n.value, G = L.get(y) ?? { Id: y };
|
|
1212
|
+
kn(G, z), _n(G, V), G._enrichAttempted = !0, G.IsEnabled === !1 ? L.delete(y) : L.set(y, G), le(n);
|
|
1207
1213
|
} finally {
|
|
1208
|
-
|
|
1214
|
+
f.delete(y);
|
|
1209
1215
|
}
|
|
1210
1216
|
}
|
|
1211
1217
|
}
|
|
1212
|
-
async function
|
|
1213
|
-
if (!(!
|
|
1218
|
+
async function A(y) {
|
|
1219
|
+
if (!(!y || !s.value))
|
|
1214
1220
|
try {
|
|
1215
|
-
const
|
|
1216
|
-
`/api/strategies?filter=${encodeURIComponent(
|
|
1221
|
+
const C = await re(
|
|
1222
|
+
`/api/strategies?filter=${encodeURIComponent(y)}`,
|
|
1217
1223
|
e.value
|
|
1218
|
-
),
|
|
1219
|
-
let
|
|
1220
|
-
for (const
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
for (const
|
|
1224
|
-
} catch (
|
|
1225
|
-
|
|
1224
|
+
), O = n.value, z = [];
|
|
1225
|
+
let V = 0;
|
|
1226
|
+
for (const L of C)
|
|
1227
|
+
O.has(L.Id) || (O.set(L.Id, { ...L, _stats: !1, _meta: !1 }), z.push(L.Id), V++);
|
|
1228
|
+
V && (o.value += V, le(n));
|
|
1229
|
+
for (const L of z) S(L);
|
|
1230
|
+
} catch (C) {
|
|
1231
|
+
v(C);
|
|
1226
1232
|
}
|
|
1227
1233
|
}
|
|
1228
|
-
function
|
|
1229
|
-
|
|
1234
|
+
function R() {
|
|
1235
|
+
h = !1, I();
|
|
1230
1236
|
}
|
|
1231
1237
|
function x() {
|
|
1232
|
-
|
|
1238
|
+
h = !0;
|
|
1233
1239
|
}
|
|
1234
|
-
async function
|
|
1235
|
-
x(), n.value = /* @__PURE__ */ new Map(), s.value = !1, l.value = 0, o.value = 0,
|
|
1240
|
+
async function w() {
|
|
1241
|
+
x(), n.value = /* @__PURE__ */ new Map(), s.value = !1, l.value = 0, o.value = 0, r.value = null, R();
|
|
1236
1242
|
}
|
|
1237
|
-
return
|
|
1243
|
+
return fe(x), {
|
|
1238
1244
|
catalog: m,
|
|
1239
1245
|
ready: s,
|
|
1240
1246
|
building: c,
|
|
1241
1247
|
loaded: l,
|
|
1242
1248
|
total: o,
|
|
1243
|
-
builtAt:
|
|
1244
|
-
enrichOne:
|
|
1245
|
-
searchExtra:
|
|
1246
|
-
refresh:
|
|
1247
|
-
start:
|
|
1249
|
+
builtAt: r,
|
|
1250
|
+
enrichOne: S,
|
|
1251
|
+
searchExtra: A,
|
|
1252
|
+
refresh: w,
|
|
1253
|
+
start: R,
|
|
1248
1254
|
stop: x
|
|
1249
1255
|
};
|
|
1250
1256
|
}
|
|
1251
|
-
async function
|
|
1257
|
+
async function Pe(e) {
|
|
1252
1258
|
try {
|
|
1253
1259
|
const t = await fetch(e);
|
|
1254
1260
|
return t.ok ? await t.json() : null;
|
|
@@ -1256,19 +1262,19 @@ async function Re(e) {
|
|
|
1256
1262
|
return null;
|
|
1257
1263
|
}
|
|
1258
1264
|
}
|
|
1259
|
-
function
|
|
1265
|
+
function kn(e, t) {
|
|
1260
1266
|
t && (e.Name = t.Name ?? e.Name, e.NumCopiers = t.NumCopiers ?? null, e.Fee = t.Fee ?? null, e.RiskProfile = t.RiskProfile ?? null, e.IsSimulated = t.IsSimulated ?? !1, t.IsEnabled !== void 0 && (e.IsEnabled = t.IsEnabled), t.ImageUploaded !== void 0 && (e.ImageUploaded = t.ImageUploaded), e.Profile = t.Profile ?? e.Profile, e._meta = !0);
|
|
1261
1267
|
}
|
|
1262
|
-
function
|
|
1263
|
-
var o,
|
|
1268
|
+
function _n(e, t) {
|
|
1269
|
+
var o, r, m, h, v, d;
|
|
1264
1270
|
if (!t) return;
|
|
1265
|
-
const a = ((o = t.Profitability) == null ? void 0 : o.Inception) ?? {}, n = ((
|
|
1266
|
-
e.Inception = t.Inception ?? e.Inception, e.Currency = t.CurrencyCode || "USD", e.Return = a.UnrealisedReturn != null ? a.UnrealisedReturn * 100 : a.RealisedReturn != null ? a.RealisedReturn * 100 : null, e.MaxDD = a.MaxDrawdown != null ? a.MaxDrawdown * 100 : null, e.RealisedPnl = a.RealisedPnl ?? null, e.UnrealisedPnl = a.UnrealisedPnl ?? null, e.History = l, e.TradesTotal = n.Total ?? 0, e.Wins = n.Wins ?? 0, e.Losses = n.Losses ?? 0, e.Markets = Array.isArray(n.Markets) ? n.Markets.slice(0, 12).map((
|
|
1271
|
+
const a = ((o = t.Profitability) == null ? void 0 : o.Inception) ?? {}, n = ((r = t.Trades) == null ? void 0 : r.Inception) ?? {}, s = a.History ?? [], c = s.length > 60 ? Math.ceil(s.length / 60) : 1, l = s.filter((u, _) => _ % c === 0 || _ === s.length - 1).map((u) => ({ Timestamp: u.Timestamp, AccountReturn: u.AccountReturn }));
|
|
1272
|
+
e.Inception = t.Inception ?? e.Inception, e.Currency = t.CurrencyCode || "USD", e.Return = a.UnrealisedReturn != null ? a.UnrealisedReturn * 100 : a.RealisedReturn != null ? a.RealisedReturn * 100 : null, e.MaxDD = a.MaxDrawdown != null ? a.MaxDrawdown * 100 : null, e.RealisedPnl = a.RealisedPnl ?? null, e.UnrealisedPnl = a.UnrealisedPnl ?? null, e.History = l, e.TradesTotal = n.Total ?? 0, e.Wins = n.Wins ?? 0, e.Losses = n.Losses ?? 0, e.Markets = Array.isArray(n.Markets) ? n.Markets.slice(0, 12).map((u) => ({ n: u.MarketName, c: u.Count })) : [], e.AccountBalance = ((m = t.Status) == null ? void 0 : m.Balance) ?? null, e.CopiersAUM = ((h = t.CopiersBalance) == null ? void 0 : h.Balance) ?? null, e.MonthlyProfit = ((v = t.CopiersProfit) == null ? void 0 : v.Month) ?? null, e.YearlyProfit = ((d = t.CopiersProfit) == null ? void 0 : d.Year) ?? null, e._stats = !0;
|
|
1267
1273
|
}
|
|
1268
|
-
function
|
|
1274
|
+
function Ce(e) {
|
|
1269
1275
|
return new Promise((t) => setTimeout(t, e));
|
|
1270
1276
|
}
|
|
1271
|
-
function
|
|
1277
|
+
function me() {
|
|
1272
1278
|
return {
|
|
1273
1279
|
risk: /* @__PURE__ */ new Set(),
|
|
1274
1280
|
retMin: null,
|
|
@@ -1285,19 +1291,19 @@ function de() {
|
|
|
1285
1291
|
search: ""
|
|
1286
1292
|
};
|
|
1287
1293
|
}
|
|
1288
|
-
function
|
|
1289
|
-
const a =
|
|
1294
|
+
function In(e, t = {}) {
|
|
1295
|
+
const a = me(), n = Te({
|
|
1290
1296
|
...a,
|
|
1291
1297
|
...t,
|
|
1292
1298
|
risk: new Set(t.risk ?? a.risk)
|
|
1293
|
-
}), s =
|
|
1299
|
+
}), s = $(() => e.value.filter((l) => Rn(l, n)));
|
|
1294
1300
|
function c() {
|
|
1295
|
-
const l =
|
|
1301
|
+
const l = me();
|
|
1296
1302
|
n.risk = l.risk, n.retMin = null, n.retMax = null, n.ddMax = null, n.aumMin = null, n.copiersMin = null, n.ageMin = null, n.tradesMin = null, n.winrateMin = null, n.feeMax = null, n.balanceMin = null, n.balanceMax = null, n.search = "";
|
|
1297
1303
|
}
|
|
1298
1304
|
return { filters: n, filtered: s, reset: c };
|
|
1299
1305
|
}
|
|
1300
|
-
function
|
|
1306
|
+
function Rn(e, t) {
|
|
1301
1307
|
var s;
|
|
1302
1308
|
if (t.search) {
|
|
1303
1309
|
const c = t.search.toLowerCase();
|
|
@@ -1305,12 +1311,12 @@ function Pn(e, t) {
|
|
|
1305
1311
|
return !1;
|
|
1306
1312
|
}
|
|
1307
1313
|
if (t.risk.size && e.RiskProfile && !t.risk.has(e.RiskProfile) || e.IsSimulated || e._stats && !e.TradesTotal || t.copiersMin != null && (e.NumCopiers ?? 0) < t.copiersMin || t.aumMin != null && (e.CopiersAUM ?? 0) < t.aumMin || t.balanceMin != null && (e.AccountBalance ?? 0) < t.balanceMin || t.balanceMax != null && (e.AccountBalance ?? 1 / 0) > t.balanceMax || t.feeMax != null && e.Fee != null && e.Fee * 100 > t.feeMax || t.tradesMin != null && (e.TradesTotal ?? 0) < t.tradesMin) return !1;
|
|
1308
|
-
const a =
|
|
1314
|
+
const a = q(e);
|
|
1309
1315
|
if (t.winrateMin != null && (a < 0 || a < t.winrateMin)) return !1;
|
|
1310
|
-
const n =
|
|
1316
|
+
const n = W(e.Inception);
|
|
1311
1317
|
return !(t.ageMin != null && (n == null || n < t.ageMin) || t.retMin != null && (e.Return == null || e.Return < t.retMin) || t.retMax != null && (e.Return == null || e.Return > t.retMax) || t.ddMax != null && e.MaxDD != null && Math.abs(e.MaxDD) > t.ddMax);
|
|
1312
1318
|
}
|
|
1313
|
-
const
|
|
1319
|
+
const Sn = {
|
|
1314
1320
|
"return-desc": (e, t) => (t.Return ?? -1e18) - (e.Return ?? -1e18),
|
|
1315
1321
|
"return-asc": (e, t) => (e.Return ?? 1e18) - (t.Return ?? 1e18),
|
|
1316
1322
|
"dd-asc": (e, t) => Math.abs(e.MaxDD ?? 1e9) - Math.abs(t.MaxDD ?? 1e9),
|
|
@@ -1321,20 +1327,20 @@ const Cn = {
|
|
|
1321
1327
|
"copiers-asc": (e, t) => (e.NumCopiers ?? 1 / 0) - (t.NumCopiers ?? 1 / 0),
|
|
1322
1328
|
"fee-asc": (e, t) => (e.Fee ?? 1 / 0) - (t.Fee ?? 1 / 0),
|
|
1323
1329
|
"fee-desc": (e, t) => (t.Fee ?? -1) - (e.Fee ?? -1),
|
|
1324
|
-
"age-desc": (e, t) => (
|
|
1325
|
-
"age-asc": (e, t) => (
|
|
1330
|
+
"age-desc": (e, t) => (W(t.Inception) ?? -1) - (W(e.Inception) ?? -1),
|
|
1331
|
+
"age-asc": (e, t) => (W(e.Inception) ?? 1 / 0) - (W(t.Inception) ?? 1 / 0),
|
|
1326
1332
|
"balance-desc": (e, t) => (t.AccountBalance ?? -1) - (e.AccountBalance ?? -1),
|
|
1327
1333
|
"balance-asc": (e, t) => (e.AccountBalance ?? 1 / 0) - (t.AccountBalance ?? 1 / 0),
|
|
1328
|
-
"winrate-desc": (e, t) =>
|
|
1329
|
-
"winrate-asc": (e, t) =>
|
|
1334
|
+
"winrate-desc": (e, t) => q(t) - q(e),
|
|
1335
|
+
"winrate-asc": (e, t) => q(e) - q(t),
|
|
1330
1336
|
"trades-desc": (e, t) => (t.TradesTotal ?? -1) - (e.TradesTotal ?? -1),
|
|
1331
1337
|
"trades-asc": (e, t) => (e.TradesTotal ?? 1 / 0) - (t.TradesTotal ?? 1 / 0),
|
|
1332
1338
|
"monthly-desc": (e, t) => (t.MonthlyProfit ?? -1e18) - (e.MonthlyProfit ?? -1e18),
|
|
1333
1339
|
"monthly-asc": (e, t) => (e.MonthlyProfit ?? 1e18) - (t.MonthlyProfit ?? 1e18)
|
|
1334
1340
|
};
|
|
1335
|
-
function
|
|
1336
|
-
const a =
|
|
1337
|
-
const c =
|
|
1341
|
+
function Pn(e, t = "return-desc") {
|
|
1342
|
+
const a = P(t), n = $(() => {
|
|
1343
|
+
const c = Sn[a.value] ?? (() => 0);
|
|
1338
1344
|
return e.value.slice().sort(c);
|
|
1339
1345
|
});
|
|
1340
1346
|
function s(c) {
|
|
@@ -1350,21 +1356,21 @@ function Tn(e, t = "return-desc") {
|
|
|
1350
1356
|
}
|
|
1351
1357
|
};
|
|
1352
1358
|
}
|
|
1353
|
-
function
|
|
1354
|
-
const a =
|
|
1355
|
-
|
|
1359
|
+
function Cn(e, t) {
|
|
1360
|
+
const a = P(1), n = $(() => Math.max(1, Math.ceil(e.value.length / t)));
|
|
1361
|
+
U(n, (l) => {
|
|
1356
1362
|
a.value > l && (a.value = l), a.value < 1 && (a.value = 1);
|
|
1357
1363
|
});
|
|
1358
|
-
const s =
|
|
1364
|
+
const s = $(() => {
|
|
1359
1365
|
const l = (a.value - 1) * t;
|
|
1360
1366
|
return e.value.slice(l, l + t);
|
|
1361
|
-
}), c =
|
|
1367
|
+
}), c = $(() => {
|
|
1362
1368
|
const l = a.value, o = n.value;
|
|
1363
1369
|
if (o <= 1) return [];
|
|
1364
|
-
const m = [.../* @__PURE__ */ new Set([1, o, l, l - 1, l + 1, l - 2, l + 2, 2, o - 1])].filter((
|
|
1365
|
-
for (let
|
|
1366
|
-
|
|
1367
|
-
return
|
|
1370
|
+
const m = [.../* @__PURE__ */ new Set([1, o, l, l - 1, l + 1, l - 2, l + 2, 2, o - 1])].filter((v) => v >= 1 && v <= o).sort((v, d) => v - d), h = [];
|
|
1371
|
+
for (let v = 0; v < m.length; v++)
|
|
1372
|
+
v && m[v] - m[v - 1] > 1 && h.push("…"), h.push(m[v]);
|
|
1373
|
+
return h;
|
|
1368
1374
|
});
|
|
1369
1375
|
return {
|
|
1370
1376
|
page: a,
|
|
@@ -1382,36 +1388,36 @@ function An(e, t) {
|
|
|
1382
1388
|
}
|
|
1383
1389
|
};
|
|
1384
1390
|
}
|
|
1385
|
-
function
|
|
1386
|
-
const t =
|
|
1391
|
+
function Tn(e) {
|
|
1392
|
+
const t = P(/* @__PURE__ */ new Map()), a = P(/* @__PURE__ */ new Map());
|
|
1387
1393
|
function n(c, l) {
|
|
1388
1394
|
return (l === "open" ? t.value : a.value).get(c) ?? null;
|
|
1389
1395
|
}
|
|
1390
1396
|
async function s(c, l) {
|
|
1391
|
-
const o = l === "open" ? t : a,
|
|
1392
|
-
if (
|
|
1397
|
+
const o = l === "open" ? t : a, r = o.value.get(c);
|
|
1398
|
+
if (r && (r.loading || r.trades !== null)) return;
|
|
1393
1399
|
const m = new Map(o.value);
|
|
1394
1400
|
m.set(c, { loading: !0, trades: null, error: null }), o.value = m;
|
|
1395
|
-
let
|
|
1401
|
+
let h = "";
|
|
1396
1402
|
if (l === "closed") {
|
|
1397
|
-
const
|
|
1398
|
-
|
|
1403
|
+
const k = /* @__PURE__ */ new Date(), I = new Date(Date.now() - We * 864e5), f = (S) => S.toISOString().replace(/\.\d+Z$/, "Z");
|
|
1404
|
+
h = `?startDate=${encodeURIComponent(f(I))}&endDate=${encodeURIComponent(f(k))}`;
|
|
1399
1405
|
}
|
|
1400
|
-
const
|
|
1401
|
-
let d = [],
|
|
1406
|
+
const v = ee(e.value, `/api/strategies/${c}/signals/${l}${h}`);
|
|
1407
|
+
let d = [], u = null;
|
|
1402
1408
|
try {
|
|
1403
|
-
const
|
|
1404
|
-
if (!
|
|
1405
|
-
d = await
|
|
1406
|
-
} catch (
|
|
1407
|
-
|
|
1409
|
+
const k = await fetch(v);
|
|
1410
|
+
if (!k.ok) throw J("http_error", `${k.status}`);
|
|
1411
|
+
d = await k.json();
|
|
1412
|
+
} catch (k) {
|
|
1413
|
+
u = k.code ? k : J("fetch_failed", k.message), d = [];
|
|
1408
1414
|
}
|
|
1409
|
-
const
|
|
1410
|
-
|
|
1415
|
+
const _ = new Map(o.value);
|
|
1416
|
+
_.set(c, { loading: !1, trades: d, error: u }), o.value = _;
|
|
1411
1417
|
}
|
|
1412
1418
|
return { open: t, closed: a, load: s, get: n };
|
|
1413
1419
|
}
|
|
1414
|
-
const
|
|
1420
|
+
const An = ["data-theme"], Fn = { class: "brand-row" }, Nn = ["title"], Dn = { "aria-hidden": "true" }, Ln = { class: "pelican-main" }, Un = /* @__PURE__ */ F({
|
|
1415
1421
|
__name: "PelicanLibertexSocial",
|
|
1416
1422
|
props: {
|
|
1417
1423
|
apiBase: {},
|
|
@@ -1426,116 +1432,123 @@ const Nn = ["data-theme"], Ln = { class: "brand-row" }, Dn = ["title"], Un = { "
|
|
|
1426
1432
|
emits: ["update:theme", "select-strategy", "error"],
|
|
1427
1433
|
setup(e, { emit: t }) {
|
|
1428
1434
|
const a = e, n = t;
|
|
1429
|
-
|
|
1430
|
-
const s =
|
|
1431
|
-
|
|
1435
|
+
se(ra, a.apiBase), se(ua, a.catalogBase ?? a.apiBase), se(Ae, a.locale);
|
|
1436
|
+
const s = be(a, "apiBase"), c = be(a, "catalogBase"), l = xn(a.theme);
|
|
1437
|
+
U(l.mode, (x) => n("update:theme", x)), U(
|
|
1432
1438
|
() => a.theme,
|
|
1433
1439
|
(x) => l.setMode(x)
|
|
1434
1440
|
);
|
|
1435
|
-
const o =
|
|
1441
|
+
const o = $n({
|
|
1436
1442
|
apiBase: s,
|
|
1437
1443
|
catalogBase: c,
|
|
1438
1444
|
onError: (x) => n("error", x)
|
|
1439
|
-
}),
|
|
1440
|
-
|
|
1445
|
+
}), r = In(o.catalog, a.defaultFilters ?? {}), m = Pn(r.filtered, a.defaultSort), h = Cn(m.sorted, a.pageSize), v = Tn(s);
|
|
1446
|
+
U(h.pageItems, (x) => {
|
|
1447
|
+
x.forEach((w) => {
|
|
1448
|
+
var y;
|
|
1449
|
+
(y = w.History) != null && y.length || o.enrichOne(w.Id);
|
|
1450
|
+
});
|
|
1451
|
+
}, { immediate: !0 });
|
|
1452
|
+
const d = Te(/* @__PURE__ */ new Set()), u = P(!1), _ = P(null);
|
|
1453
|
+
function k(x) {
|
|
1441
1454
|
d.has(x) ? d.delete(x) : d.add(x);
|
|
1442
|
-
const
|
|
1443
|
-
|
|
1455
|
+
const w = o.catalog.value.find((y) => y.Id === x);
|
|
1456
|
+
w && ((!w._meta || !w._stats) && !w._enrichAttempted && o.enrichOne(x), n("select-strategy", w));
|
|
1444
1457
|
}
|
|
1445
|
-
function
|
|
1446
|
-
m.toggleColumn(x),
|
|
1458
|
+
function I(x) {
|
|
1459
|
+
m.toggleColumn(x), h.setPage(1);
|
|
1447
1460
|
}
|
|
1448
|
-
function
|
|
1449
|
-
Object.assign(
|
|
1461
|
+
function f(x) {
|
|
1462
|
+
Object.assign(r.filters, x), h.setPage(1);
|
|
1450
1463
|
}
|
|
1451
|
-
function
|
|
1452
|
-
const x =
|
|
1453
|
-
Object.assign(
|
|
1464
|
+
function S() {
|
|
1465
|
+
const x = me();
|
|
1466
|
+
Object.assign(r.filters, x), r.filters.risk = x.risk, _.value = null, h.setPage(1);
|
|
1454
1467
|
}
|
|
1455
|
-
function
|
|
1456
|
-
|
|
1468
|
+
function A({ id: x, kind: w }) {
|
|
1469
|
+
v.load(x, w);
|
|
1457
1470
|
}
|
|
1458
|
-
function
|
|
1459
|
-
x === "prev" ?
|
|
1471
|
+
function R(x) {
|
|
1472
|
+
x === "prev" ? h.prev() : x === "next" ? h.next() : h.setPage(x);
|
|
1460
1473
|
}
|
|
1461
|
-
return Be(() => o.start()), (x,
|
|
1474
|
+
return Be(() => o.start()), (x, w) => (g(), M("div", {
|
|
1462
1475
|
class: "pelican-libsoc",
|
|
1463
|
-
"data-theme":
|
|
1476
|
+
"data-theme": p(l).resolved.value
|
|
1464
1477
|
}, [
|
|
1465
|
-
i("header",
|
|
1466
|
-
|
|
1467
|
-
|
|
1478
|
+
i("header", Fn, [
|
|
1479
|
+
X(x.$slots, "brand", {}, () => [
|
|
1480
|
+
w[6] || (w[6] = i("div", { class: "default-brand" }, "Libertex Social — Copy Trading", -1))
|
|
1468
1481
|
], !0),
|
|
1469
1482
|
i("button", {
|
|
1470
1483
|
class: "theme-toggle",
|
|
1471
1484
|
type: "button",
|
|
1472
|
-
title:
|
|
1473
|
-
onClick:
|
|
1474
|
-
(...
|
|
1485
|
+
title: p(l).mode.value,
|
|
1486
|
+
onClick: w[0] || (w[0] = //@ts-ignore
|
|
1487
|
+
(...y) => p(l).cycle && p(l).cycle(...y))
|
|
1475
1488
|
}, [
|
|
1476
|
-
i("span",
|
|
1477
|
-
], 8,
|
|
1489
|
+
i("span", Dn, b(p(l).resolved.value === "dark" ? "🌙" : "☀️"), 1)
|
|
1490
|
+
], 8, Nn)
|
|
1478
1491
|
]),
|
|
1479
|
-
|
|
1480
|
-
search:
|
|
1481
|
-
"sort-key":
|
|
1482
|
-
total:
|
|
1483
|
-
"filtered-total":
|
|
1484
|
-
page:
|
|
1485
|
-
"total-pages":
|
|
1486
|
-
"onUpdate:search":
|
|
1487
|
-
"onUpdate:sortKey":
|
|
1488
|
-
onRefresh:
|
|
1489
|
-
onToggleFilters:
|
|
1492
|
+
T(st, {
|
|
1493
|
+
search: p(r).filters.search,
|
|
1494
|
+
"sort-key": p(m).sortKey.value,
|
|
1495
|
+
total: p(o).total.value,
|
|
1496
|
+
"filtered-total": p(r).filtered.value.length,
|
|
1497
|
+
page: p(h).page.value,
|
|
1498
|
+
"total-pages": p(h).totalPages.value,
|
|
1499
|
+
"onUpdate:search": w[1] || (w[1] = (y) => f({ search: y })),
|
|
1500
|
+
"onUpdate:sortKey": w[2] || (w[2] = (y) => p(m).setKey(y)),
|
|
1501
|
+
onRefresh: p(o).refresh,
|
|
1502
|
+
onToggleFilters: w[3] || (w[3] = (y) => u.value = !u.value)
|
|
1490
1503
|
}, null, 8, ["search", "sort-key", "total", "filtered-total", "page", "total-pages", "onRefresh"]),
|
|
1491
|
-
|
|
1492
|
-
loaded:
|
|
1493
|
-
total:
|
|
1494
|
-
active:
|
|
1504
|
+
T(bn, {
|
|
1505
|
+
loaded: p(o).loaded.value,
|
|
1506
|
+
total: p(o).total.value,
|
|
1507
|
+
active: p(o).building.value && !p(o).ready.value
|
|
1495
1508
|
}, null, 8, ["loaded", "total", "active"]),
|
|
1496
|
-
i("main",
|
|
1497
|
-
|
|
1498
|
-
filters:
|
|
1499
|
-
"invest-amount":
|
|
1500
|
-
open:
|
|
1501
|
-
"onUpdate:filters":
|
|
1502
|
-
"onUpdate:investAmount":
|
|
1503
|
-
onReset:
|
|
1509
|
+
i("main", Ln, [
|
|
1510
|
+
T(Lt, {
|
|
1511
|
+
filters: p(r).filters,
|
|
1512
|
+
"invest-amount": _.value,
|
|
1513
|
+
open: u.value,
|
|
1514
|
+
"onUpdate:filters": f,
|
|
1515
|
+
"onUpdate:investAmount": w[4] || (w[4] = (y) => _.value = y),
|
|
1516
|
+
onReset: S
|
|
1504
1517
|
}, null, 8, ["filters", "invest-amount", "open"]),
|
|
1505
|
-
|
|
1506
|
-
"page-items":
|
|
1518
|
+
T(pn, {
|
|
1519
|
+
"page-items": p(h).pageItems.value,
|
|
1507
1520
|
expanded: d,
|
|
1508
|
-
"sort-key":
|
|
1509
|
-
page:
|
|
1510
|
-
"total-pages":
|
|
1511
|
-
"page-range":
|
|
1512
|
-
"open-signals": v
|
|
1513
|
-
"closed-signals": v
|
|
1514
|
-
onToggleRow:
|
|
1515
|
-
onToggleSort:
|
|
1516
|
-
onLoadTrades:
|
|
1517
|
-
onSelect:
|
|
1518
|
-
onGo:
|
|
1521
|
+
"sort-key": p(m).sortKey.value,
|
|
1522
|
+
page: p(h).page.value,
|
|
1523
|
+
"total-pages": p(h).totalPages.value,
|
|
1524
|
+
"page-range": p(h).pageRange.value,
|
|
1525
|
+
"open-signals": p(v).open.value,
|
|
1526
|
+
"closed-signals": p(v).closed.value,
|
|
1527
|
+
onToggleRow: k,
|
|
1528
|
+
onToggleSort: I,
|
|
1529
|
+
onLoadTrades: A,
|
|
1530
|
+
onSelect: w[5] || (w[5] = (y) => n("select-strategy", y)),
|
|
1531
|
+
onGo: R
|
|
1519
1532
|
}, {
|
|
1520
|
-
empty:
|
|
1521
|
-
|
|
1522
|
-
|
|
1533
|
+
empty: ce(() => [
|
|
1534
|
+
X(x.$slots, "empty", {}, () => [
|
|
1535
|
+
w[7] || (w[7] = B("No matches.", -1))
|
|
1523
1536
|
], !0)
|
|
1524
1537
|
]),
|
|
1525
|
-
"row-actions":
|
|
1526
|
-
|
|
1538
|
+
"row-actions": ce((y) => [
|
|
1539
|
+
X(x.$slots, "row-actions", Oe(Ke(y)), void 0, !0)
|
|
1527
1540
|
]),
|
|
1528
1541
|
_: 3
|
|
1529
1542
|
}, 8, ["page-items", "expanded", "sort-key", "page", "total-pages", "page-range", "open-signals", "closed-signals"])
|
|
1530
1543
|
])
|
|
1531
|
-
], 8,
|
|
1544
|
+
], 8, An));
|
|
1532
1545
|
}
|
|
1533
|
-
}),
|
|
1546
|
+
}), En = /* @__PURE__ */ N(Un, [["__scopeId", "data-v-e2cce41d"]]);
|
|
1534
1547
|
export {
|
|
1535
|
-
|
|
1548
|
+
En as PelicanLibertexSocial,
|
|
1536
1549
|
qe as SORT_KEYS,
|
|
1537
1550
|
Xe as SORT_LABELS,
|
|
1538
1551
|
Ze as SORT_TOGGLE,
|
|
1539
|
-
|
|
1552
|
+
me as defaultFilters
|
|
1540
1553
|
};
|
|
1541
1554
|
//# sourceMappingURL=pelican-libertex-social.mjs.map
|