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