@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 de, defineComponent as F, ref as R, watch as E, openBlock as p, createElementBlock as y, createElementVNode as o, createTextVNode as D, toDisplayString as b, Fragment as U, renderList as K, unref as v, normalizeClass as B, computed as k, createCommentVNode as O, createVNode as P, withDirectives as ge, vShow as he, inject as De, withModifiers as te, renderSlot as q, createBlock as ie, withCtx as re, mergeProps as Ue, normalizeStyle as Ve, shallowRef as Ee, triggerRef as ae, reactive as Pe, provide as ne, toRef as ye, onMounted as Be, normalizeProps as Oe, guardReactiveProps as Ke } from "vue";
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 de(s), { wrapped: n, cancel: s };
11
+ return fe(s), { wrapped: n, cancel: s };
12
12
  }
13
- const Ge = 20, ze = 350, He = 2e3, je = 2e4, We = 30, qe = [
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 = R(a.search);
76
- E(
75
+ const a = e, n = t, s = P(a.search);
76
+ V(
77
77
  () => a.search,
78
- (u) => {
79
- u !== s.value && (s.value = u);
78
+ (r) => {
79
+ r !== s.value && (s.value = r);
80
80
  }
81
81
  );
82
- const { wrapped: c } = Ye((u) => n("update:search", u), ze);
83
- function l(u) {
84
- const m = u.target.value;
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 i(u) {
88
- n("update:sortKey", u.target.value);
87
+ function o(r) {
88
+ n("update:sortKey", r.target.value);
89
89
  }
90
- return (u, m) => (p(), y("div", Je, [
91
- o("button", {
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] = (g) => n("toggle-filters"))
94
+ onClick: m[0] || (m[0] = (h) => n("toggle-filters"))
95
95
  }, " Filters "),
96
- o("div", Qe, [
97
- m[2] || (m[2] = D(" Showing ", -1)),
98
- o("b", null, b(e.filteredTotal.toLocaleString("en-US")), 1),
99
- m[3] || (m[3] = D(" of ", -1)),
100
- o("b", null, b(e.total.toLocaleString("en-US")), 1),
101
- m[4] || (m[4] = D(" · page ", -1)),
102
- o("b", null, b(e.page), 1),
103
- D(" / " + b(e.totalPages), 1)
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
- o("input", {
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
- o("div", tt, [
114
- m[5] || (m[5] = o("label", null, "Sort:", -1)),
115
- o("select", {
113
+ i("div", tt, [
114
+ m[5] || (m[5] = i("label", null, "Sort:", -1)),
115
+ i("select", {
116
116
  value: e.sortKey,
117
- onChange: i
117
+ onChange: o
118
118
  }, [
119
- (p(!0), y(U, null, K(v(qe), (g) => (p(), y("option", {
120
- key: g,
121
- value: g
122
- }, b(v(Xe)[g]), 9, nt))), 128))
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
- o("button", {
125
+ i("button", {
126
126
  class: "btn-flat",
127
127
  type: "button",
128
128
  title: "reload",
129
- onClick: m[1] || (m[1] = (g) => n("refresh"))
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 i = new Set(a.modelValue);
148
- i.has(l) ? i.delete(l) : i.add(l), n("update:modelValue", i);
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, i) => (p(), y("div", ot, [
151
- (p(), y(U, null, K(s, (u) => o("button", {
152
- key: u,
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-" + u.toLowerCase(), { on: e.modelValue.has(u) }]]),
155
- onClick: (m) => c(u)
156
- }, b(u), 11, it)), 64))
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 = k(() => a.anyAt ?? a.min), c = k(() => !!a.inverted), l = k(() => a.modelValue == null ? c.value ? a.max : s.value : a.modelValue), i = k(() => a.modelValue == null ? "any" : a.format ? a.format(a.modelValue) : String(a.modelValue));
174
- function u(m) {
175
- const g = parseInt(m.target.value, 10);
176
- isNaN(g) || (c.value && g >= a.max || !c.value && g <= s.value ? n("update:modelValue", null) : n("update:modelValue", g));
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, g) => (p(), y("div", ct, [
179
- o("div", dt, [
180
- o("label", mt, b(e.label), 1),
181
- o("span", ft, b(i.value), 1)
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
- o("input", {
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: u,
191
- onChange: u
190
+ onInput: r,
191
+ onChange: r
192
192
  }, null, 40, vt)
193
193
  ]));
194
194
  }
195
- }), z = /* @__PURE__ */ N(pt, [["__scopeId", "data-v-10c5fe1c"]]), gt = { class: "pelican-fgroup" }, ht = { class: "title-row" }, yt = { class: "title" }, Mt = { class: "val" }, bt = { class: "dual-track" }, xt = ["min", "max", "value"], wt = ["min", "max", "value"], $t = {
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
- }, kt = /* @__PURE__ */ F({
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 = k(() => a.rawMin ?? 0), c = k(() => a.rawMax ?? 100), l = k(() => a.modelValueMin ?? s.value), i = k(() => a.modelValueMax ?? c.value), u = k(
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 = k(
217
- () => i.value >= c.value ? a.maxLabel ?? "any" : a.formatRaw(a.rawToDomain(i.value))
218
- ), g = k(() => l.value <= s.value && i.value >= c.value ? "any" : `${u.value} – ${m.value}`);
219
- function f(r) {
220
- let w = parseInt(r.target.value, 10);
221
- isNaN(w) || (w > i.value && (w = i.value), n("update:modelValueMin", w <= s.value ? null : w));
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 d(r) {
224
- let w = parseInt(r.target.value, 10);
225
- isNaN(w) || (w < l.value && (w = l.value), n("update:modelValueMax", w >= c.value ? null : w));
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 (r, w) => {
228
- var I;
229
- return p(), y("div", gt, [
230
- o("div", ht, [
231
- o("label", yt, b(e.label), 1),
232
- o("span", Mt, b(g.value), 1)
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
- o("div", bt, [
235
- o("input", {
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
- onInput: f,
242
- onChange: f
243
- }, null, 40, xt),
244
- o("input", {
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: i.value,
250
- onInput: d,
251
- onChange: d
252
- }, null, 40, wt)
253
- ]),
254
- (I = e.scaleHints) != null && I.length ? (p(), y("div", $t, [
255
- (p(!0), y(U, null, K(e.scaleHints, (_) => (p(), y("span", { key: _ }, b(_), 1))), 128))
256
- ])) : O("", !0)
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
- }), Me = /* @__PURE__ */ N(kt, [["__scopeId", "data-v-a0c09424"]]);
261
- function be(e, t = 2) {
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 xe(e, t = "en-US") {
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 H(e, t = "en-US") {
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 we(e, t = "en-US") {
293
+ function ke(e, t = "en-US") {
281
294
  return e == null ? "—" : Number(e).toLocaleString(t);
282
295
  }
283
- function It(e) {
296
+ function kt(e) {
284
297
  return e.Fee == null ? e._meta ? "free" : "—" : `${(e.Fee * 100).toFixed(0)}%`;
285
298
  }
286
- function $e(e, t = "en-US") {
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 _t(e) {
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 ue(e) {
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 St(e) {
322
+ function _t(e) {
310
323
  return e >= 1e3 ? (e / 1e3).toFixed(1).replace(/\.0$/, "") + "K%" : Math.round(e) + "%";
311
324
  }
312
- function Rt(e) {
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 j(e) {
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 le = (e) => e <= 0 ? 0 : Math.round(Math.pow(10, 1 + (e - 1) / 99 * 6)), ke = (e) => e <= 0 ? 0 : Math.max(1, Math.min(100, Math.round(1 + (Math.log10(e) - 1) * 99 / 6))), se = (e) => e <= 0 ? 0 : Math.round(Math.pow(10, (e - 1) / 99 * 4.7)), Pt = { class: "pelican-fgroup" }, Ct = { class: "title-row" }, Tt = { class: "val" }, At = ["value"], Ft = /* @__PURE__ */ F({
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 = k(
328
- () => a.modelValue == null ? "any" : ue(a.modelValue)
340
+ const a = e, n = t, s = $(
341
+ () => a.modelValue == null ? "any" : de(a.modelValue)
329
342
  );
330
343
  function c(l) {
331
- const i = l.target.value.trim();
332
- if (!i) {
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 u = parseInt(i, 10);
337
- if (isNaN(u) || u <= 0) {
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", u), n("apply", { min: ke(50), max: ke(u) });
354
+ n("update:modelValue", r), n("apply", { min: _e(50), max: _e(r) });
342
355
  }
343
- return (l, i) => (p(), y("div", Pt, [
344
- o("div", Ct, [
345
- i[0] || (i[0] = o("label", { class: "title" }, "Your Investment Amount, $", -1)),
346
- o("span", Tt, b(s.value), 1)
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
- o("input", {
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, At)
369
+ }, null, 40, Tt)
357
370
  ]));
358
371
  }
359
- }), Nt = /* @__PURE__ */ N(Ft, [["__scopeId", "data-v-a76acc6c"]]), Lt = { class: "ftitle-row" }, Dt = /* @__PURE__ */ F({
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 = R(0), c = R(100), l = R(0), i = R(100);
369
- E(s, (f) => {
370
- n("update:filters", { retMin: f <= 0 ? null : se(f) });
371
- }), E(c, (f) => {
372
- n("update:filters", { retMax: f >= 100 ? null : se(f) });
373
- }), E(l, (f) => {
374
- n("update:filters", { balanceMin: f <= 0 ? null : le(f) });
375
- }), E(i, (f) => {
376
- n("update:filters", { balanceMax: f >= 100 ? null : le(f) });
377
- }), E(
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
- ([f, d]) => {
380
- f == null && (s.value = 0), d == null && (c.value = 100);
392
+ ([v, d]) => {
393
+ v == null && (s.value = 0), d == null && (c.value = 100);
381
394
  }
382
- ), E(
395
+ ), V(
383
396
  () => [a.filters.balanceMin, a.filters.balanceMax],
384
- ([f, d]) => {
385
- f == null && (l.value = 0), d == null && (i.value = 100);
397
+ ([v, d]) => {
398
+ v == null && (l.value = 0), d == null && (o.value = 100);
386
399
  }
387
400
  );
388
- function u(f) {
389
- n("update:filters", f);
401
+ function r(v) {
402
+ n("update:filters", v);
390
403
  }
391
- function m(f) {
392
- u({ risk: f });
404
+ function m(v) {
405
+ r({ risk: v });
393
406
  }
394
- function g(f) {
395
- f == null ? (u({ balanceMin: null, balanceMax: null }), l.value = 0, i.value = 100) : (l.value = f.min, i.value = f.max);
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 (f, d) => (p(), y("aside", {
410
+ return (v, d) => (g(), M("aside", {
398
411
  class: B(["pelican-filters", { open: e.open }])
399
412
  }, [
400
- o("div", Lt, [
401
- d[13] || (d[13] = o("label", { class: "ftitle" }, "Risk", -1)),
402
- o("button", {
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] = (r) => n("reset"))
418
+ onClick: d[0] || (d[0] = (u) => n("reset"))
406
419
  }, "reset filters")
407
420
  ]),
408
- P(ut, {
421
+ T(ut, {
409
422
  "model-value": e.filters.risk,
410
423
  "onUpdate:modelValue": m
411
424
  }, null, 8, ["model-value"]),
412
- P(Nt, {
425
+ T(Ft, {
413
426
  "model-value": e.investAmount,
414
- "onUpdate:modelValue": d[1] || (d[1] = (r) => n("update:investAmount", r)),
415
- onApply: g
427
+ "onUpdate:modelValue": d[1] || (d[1] = (u) => n("update:investAmount", u)),
428
+ onApply: h
416
429
  }, null, 8, ["model-value"]),
417
- P(Me, {
430
+ T(xe, {
418
431
  label: "Return %",
419
432
  "model-value-min": s.value,
420
433
  "model-value-max": c.value,
421
- "format-raw": (r) => v(St)(r),
422
- "raw-to-domain": (r) => v(se)(r),
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] = (r) => s.value = r ?? 0),
426
- "onUpdate:modelValueMax": d[3] || (d[3] = (r) => c.value = r ?? 100)
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
- P(z, {
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: (r) => r + "%",
437
- "onUpdate:modelValue": d[4] || (d[4] = (r) => u({ ddMax: r == null || r >= 100 ? null : r }))
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
- P(Me, {
452
+ T(xe, {
440
453
  label: "Balance",
441
454
  "model-value-min": l.value,
442
- "model-value-max": i.value,
443
- "format-raw": (r) => v(ue)(r),
444
- "raw-to-domain": (r) => v(le)(r),
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] = (r) => l.value = r ?? 0),
448
- "onUpdate:modelValueMax": d[6] || (d[6] = (r) => i.value = r ?? 100)
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
- P(z, {
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: (r) => r + "%",
459
- "onUpdate:modelValue": d[7] || (d[7] = (r) => u({ feeMax: r == null || r >= 100 ? null : r }))
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
- P(z, {
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: (r) => "≥ " + v(ue)(r),
468
- "onUpdate:modelValue": d[8] || (d[8] = (r) => u({ aumMin: r && r > 0 ? r : null }))
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
- P(z, {
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: (r) => "≥ " + r,
477
- "onUpdate:modelValue": d[9] || (d[9] = (r) => u({ copiersMin: r && r > 0 ? r : null }))
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
- P(z, {
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: (r) => "≥ " + r + "d",
486
- "onUpdate:modelValue": d[10] || (d[10] = (r) => u({ ageMin: r && r > 0 ? r : null }))
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
- P(z, {
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: (r) => "≥ " + r,
495
- "onUpdate:modelValue": d[11] || (d[11] = (r) => u({ tradesMin: r && r > 0 ? r : null }))
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
- P(z, {
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: (r) => "≥ " + r + "%",
504
- "onUpdate:modelValue": d[12] || (d[12] = (r) => u({ winrateMin: r && r > 0 ? r : null }))
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
- }), Ut = /* @__PURE__ */ N(Dt, [["__scopeId", "data-v-67cc5448"]]), Ie = [
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 Vt(e, t = 140, a = 34) {
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, i = e.map((S) => S.AccountReturn), u = Math.min(0, ...i), g = Math.max(0, ...i) - u || 1, f = (S) => (S - s) / l * (t - 2) + 1, d = (S) => a - 2 - (S - u) / g * (a - 4), r = e.map((S, x) => `${f(n[x]).toFixed(1)},${d(S.AccountReturn).toFixed(1)}`), w = i[i.length - 1], I = d(0), _ = f(s), h = f(c), C = `M ${r.join(" L ")}`, V = `M ${r[0]} ` + r.slice(1).map((S) => `L ${S}`).join(" ") + ` L ${h.toFixed(1)},${I.toFixed(1)} L ${_.toFixed(1)},${I.toFixed(1)} Z`;
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: I,
541
- areaPath: V,
542
- linePath: C,
543
- positive: w >= 0,
553
+ zeroY: k,
554
+ areaPath: A,
555
+ linePath: R,
556
+ positive: I >= 0,
544
557
  startX: _,
545
- endX: h
558
+ endX: f
546
559
  };
547
560
  }
548
- function Et(e, t = 520, a = 280) {
549
- const n = e.slice().sort((d, r) => (r.c || 0) - (d.c || 0)), s = n.reduce((d, r) => d + (r.c || 0), 0) || 1, c = t / 2, l = a / 2, i = 90, u = 52, m = i + 10;
550
- let g = -Math.PI / 2;
551
- const f = [];
552
- return n.forEach((d, r) => {
553
- const w = (d.c || 0) / s, I = w * Math.PI * 2, _ = g, h = g + I;
554
- g = h;
555
- const C = (_ + h) / 2, V = I > Math.PI ? 1 : 0, S = c + i * Math.cos(_), x = l + i * Math.sin(_), $ = c + i * Math.cos(h), M = l + i * Math.sin(h), T = c + u * Math.cos(_), Y = l + u * Math.sin(_), G = c + u * Math.cos(h), L = l + u * Math.sin(h), A = `M ${S.toFixed(2)} ${x.toFixed(2)} A ${i} ${i} 0 ${V} 1 ${$.toFixed(2)} ${M.toFixed(2)} L ${G.toFixed(2)} ${L.toFixed(2)} A ${u} ${u} 0 ${V} 0 ${T.toFixed(2)} ${Y.toFixed(2)} Z`, Ae = Ie[r % Ie.length];
556
- let me = null, fe = 0, ve = 0, pe = "start";
557
- if (w >= 0.015) {
558
- const Q = Math.cos(C) < 0, Fe = c + i * Math.cos(C), Ne = l + i * Math.sin(C), X = c + m * Math.cos(C), ee = l + m * Math.sin(C), Le = Q ? X - 4 : X + 4;
559
- me = `${Fe.toFixed(1)},${Ne.toFixed(1)} ${X.toFixed(1)},${ee.toFixed(1)} ${Le.toFixed(1)},${ee.toFixed(1)}`, fe = Q ? X - 6 : X + 6, ve = ee + 4, pe = Q ? "end" : "start";
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
- f.push({
574
+ v.push({
562
575
  marketName: d.n,
563
576
  count: d.c,
564
- fraction: w,
565
- color: Ae,
566
- arcPath: A,
567
- labelLine: me,
568
- labelX: fe,
569
- labelY: ve,
570
- labelAnchor: pe
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: i, innerR: u, slices: f };
585
+ }), { width: t, height: a, cx: c, cy: l, outerR: o, innerR: r, slices: v };
573
586
  }
574
- const Bt = ["width", "height"], Ot = ["width", "height", "viewBox"], Kt = ["x2", "y1", "y2"], Yt = ["d", "fill"], Gt = ["d", "stroke"], zt = /* @__PURE__ */ F({
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 = k(() => Vt(t.history, t.width, t.height));
583
- return (n, s) => a.value.hasData ? (p(), y("svg", {
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
- o("line", {
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, Kt),
603
- o("path", {
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, Yt),
608
- o("path", {
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, Gt)
617
- ], 8, Ot)) : (p(), y("svg", {
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
- o("text", {
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, Bt));
644
+ ])], 8, Et));
632
645
  }
633
- }), Ht = /* @__PURE__ */ N(zt, [["__scopeId", "data-v-a9b85847"]]), jt = {
646
+ }), Gt = /* @__PURE__ */ N(zt, [["__scopeId", "data-v-a9b85847"]]), Ht = {
634
647
  key: 0,
635
648
  class: "dim"
636
- }, Wt = ["viewBox"], qt = ["d", "fill"], Xt = ["points", "stroke"], Zt = ["x", "y", "text-anchor"], Jt = {
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
- }, Qt = /* @__PURE__ */ F({
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 = k(() => !t.markets || t.markets.length === 0), n = k(() => Et(t.markets, t.width, t.height));
648
- return (s, c) => a.value ? (p(), y("span", jt, "no market data")) : (p(), y("svg", {
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
- o("g", null, [
658
- (p(!0), y(U, null, K(n.value.slices, (l) => (p(), y("path", {
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, qt))), 128))
677
+ }, null, 8, Wt))), 128))
665
678
  ]),
666
- o("g", null, [
667
- (p(!0), y(U, null, K(n.value.slices, (l) => ge((p(), y("polyline", {
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, Xt)), [
674
- [he, l.labelLine]
686
+ }, null, 8, qt)), [
687
+ [Me, l.labelLine]
675
688
  ])), 128))
676
689
  ]),
677
- o("g", null, [
678
- (p(!0), y(U, null, K(n.value.slices, (l) => ge((p(), y("text", {
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
- D(b(l.marketName) + " ", 1),
688
- o("tspan", Jt, b(l.count), 1)
689
- ], 8, Zt)), [
690
- [he, l.labelLine]
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, Wt));
706
+ ], 8, jt));
694
707
  }
695
- }), ea = /* @__PURE__ */ N(Qt, [["__scopeId", "data-v-c514d53f"]]), ta = { class: "pelican-trades" }, aa = { class: "hd" }, na = {
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
- }, la = {
711
+ }, na = {
699
712
  key: 1,
700
713
  class: "dim"
701
- }, sa = {
714
+ }, la = {
702
715
  key: 2,
703
716
  class: "list"
704
- }, oa = { class: "market" }, ia = { class: "trade-time" }, ra = /* @__PURE__ */ F({
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 = k(() => t.kind === "open" ? "Open Trades" : "Trade History (30d)"), n = k(
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) => (p(), y("div", ta, [
717
- o("div", aa, b(a.value), 1),
718
- e.loading ? (p(), y("div", na, "Loading…")) : n.value ? (p(), y("div", la, "No trades.")) : (p(), y("ul", sa, [
719
- (p(!0), y(U, null, K(e.trades ?? [], (l, i) => (p(), y("li", { key: i }, [
720
- o("span", oa, b(l.MarketName ?? "—"), 1),
721
- o("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),
734
+ i("span", {
722
735
  class: B(["dir", l.Direction === "Sell" ? "red" : "green"])
723
736
  }, b(l.Direction ?? ""), 3),
724
- o("span", ia, [
725
- D(b(v($e)(l.OpenTimestamp, e.locale)) + " ", 1),
726
- l.CloseTimestamp ? (p(), y(U, { key: 0 }, [
727
- D(" → " + b(v($e)(l.CloseTimestamp, e.locale)), 1)
728
- ], 64)) : O("", !0)
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 ? (p(), y("span", {
743
+ l.Pnl != null ? (g(), M("span", {
731
744
  key: 0,
732
745
  class: B(["pnl", l.Pnl >= 0 ? "green" : "red"])
733
- }, b(v(H)(l.Pnl, e.locale)), 3)) : O("", !0)
746
+ }, b(p(j)(l.Pnl, e.locale)), 3)) : K("", !0)
734
747
  ]))), 128))
735
748
  ]))
736
749
  ]));
737
750
  }
738
- }), _e = /* @__PURE__ */ N(ra, [["__scopeId", "data-v-aa7cbcd7"]]);
739
- function W(e) {
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 ua = Symbol("pelican.apiBase"), ca = Symbol("pelican.catalogBase"), Ce = Symbol("pelican.locale"), da = ["data-id"], ma = { class: "name" }, fa = { class: "avatar" }, va = { class: "avatar-fallback" }, pa = ["src"], ga = { class: "nm" }, ha = { class: "title" }, ya = {
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
- }, Ma = { class: "by" }, ba = {
759
+ }, ya = { class: "by" }, Ma = {
747
760
  class: "c-spark",
748
761
  "data-label": "Equity curve"
749
- }, xa = {
762
+ }, ba = {
750
763
  class: "c-num",
751
764
  "data-label": "Return"
752
- }, wa = { key: 1 }, $a = {
765
+ }, xa = { key: 1 }, wa = {
753
766
  class: "c-num",
754
767
  "data-label": "Copiers"
755
- }, ka = {
768
+ }, $a = {
756
769
  class: "c-num",
757
770
  "data-label": "Copiers AUM"
758
- }, Ia = {
771
+ }, ka = {
759
772
  class: "c-num",
760
773
  "data-label": "Max DD"
761
- }, _a = { key: 1 }, Sa = {
774
+ }, Ia = { key: 1 }, _a = {
762
775
  class: "c-num",
763
776
  "data-label": "Age"
764
- }, Ra = {
777
+ }, Sa = {
765
778
  class: "c-num",
766
779
  "data-label": "Balance"
767
- }, Pa = {
780
+ }, Ra = {
768
781
  class: "c-num",
769
782
  "data-label": "Fee"
770
- }, Ca = ["href"], Ta = { class: "grid" }, Aa = { class: "col-stats" }, Fa = { class: "field" }, Na = { class: "value" }, La = { class: "field" }, Da = { class: "value" }, Ua = { class: "field" }, Va = { class: "value" }, Ea = { class: "field" }, Ba = { class: "value" }, Oa = { class: "field" }, Ka = { class: "value" }, Ya = { class: "field" }, Ga = { class: "value" }, za = { class: "field" }, Ha = { class: "value" }, ja = { class: "field" }, Wa = { class: "value" }, qa = { key: 0 }, Xa = {
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
- }, Za = { class: "col-donut" }, Ja = { class: "trade-toggles" }, Qa = /* @__PURE__ */ F({
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 = De(Ce, "en-US"), c = k(() => be(a.s.Return, 1)), l = k(() => a.s.MaxDD != null ? be(a.s.MaxDD, 2) : null), i = k(() => j(a.s.Inception)), u = k(() => W(a.s)), m = k(() => u.value >= 0 ? 100 - u.value : -1), g = k(
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 _, h;
786
- return ((_ = a.s.Profile) == null ? void 0 : _.Name) ?? ((h = a.s.Profile) != null && h.Id ? "#" + a.s.Profile.Id : "");
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
- ), f = k(() => `https://libertex.copy-trade.io/strategy/${a.s.Id}`), d = R(!1), r = R(!1);
789
- function w() {
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 I() {
793
- r.value = !r.value, r.value && !a.closedTrades && n("load-trades", "closed");
805
+ function k() {
806
+ u.value = !u.value, u.value && !a.closedTrades && n("load-trades", "closed");
794
807
  }
795
- return (_, h) => {
796
- var C, V, S, x;
797
- return p(), y(U, null, [
798
- o("div", {
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: h[3] || (h[3] = ($) => n("toggle"))
814
+ onClick: f[3] || (f[3] = (w) => n("toggle"))
802
815
  }, [
803
- o("div", ma, [
804
- o("div", fa, [
805
- o("span", va, b(v(Rt)(e.s.Name)), 1),
806
- e.s.ImageUploaded ? (p(), y("img", {
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: h[0] || (h[0] = ($) => $.target.remove())
814
- }, null, 40, pa)) : O("", !0)
826
+ onError: f[0] || (f[0] = (w) => w.target.remove())
827
+ }, null, 40, va)) : K("", !0)
815
828
  ]),
816
- o("div", ga, [
817
- o("div", ha, [
818
- D(b(e.s.Name || "#" + e.s.Id) + " ", 1),
819
- e.s._meta && e.s.Fee == null ? (p(), y("span", ya, "free")) : O("", !0)
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
- o("div", Ma, b(g.value), 1)
834
+ i("div", ya, b(h.value), 1)
822
835
  ])
823
836
  ]),
824
- o("div", ba, [
825
- P(Ht, {
837
+ i("div", Ma, [
838
+ T(Gt, {
826
839
  history: e.s.History
827
840
  }, null, 8, ["history"])
828
841
  ]),
829
- o("div", xa, [
830
- c.value ? (p(), y("span", {
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)) : (p(), y("span", wa, "—"))
846
+ }, b(c.value.text), 3)) : (g(), M("span", xa, "—"))
834
847
  ]),
835
- o("div", $a, b(v(we)(e.s.NumCopiers, v(s))), 1),
836
- o("div", ka, b(v(xe)(e.s.CopiersAUM, v(s))), 1),
837
- o("div", Ia, [
838
- l.value ? (p(), y("span", {
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)) : (p(), y("span", _a, "—"))
854
+ }, b(l.value.text), 3)) : (g(), M("span", Ia, "—"))
842
855
  ]),
843
- o("div", Sa, b(v(_t)(i.value)), 1),
844
- o("div", Ra, b(v(xe)(e.s.AccountBalance, v(s))), 1),
845
- o("div", Pa, b(v(It)(e.s)), 1),
846
- o("div", {
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: h[2] || (h[2] = te(() => {
861
+ onClick: f[2] || (f[2] = ne(() => {
849
862
  }, ["stop"]))
850
863
  }, [
851
- o("a", {
864
+ i("a", {
852
865
  class: "signal-link",
853
- href: f.value,
866
+ href: v.value,
854
867
  target: "_blank",
855
868
  rel: "noopener",
856
- onClick: h[1] || (h[1] = te(() => {
869
+ onClick: f[1] || (f[1] = ne(() => {
857
870
  }, ["stop"]))
858
- }, " Get connected ", 8, Ca),
859
- q(_.$slots, "row-actions", { strategy: e.s }, void 0, !0)
871
+ }, " Get connected ", 8, Pa),
872
+ X(_.$slots, "row-actions", { strategy: e.s }, void 0, !0)
860
873
  ])
861
- ], 10, da),
862
- e.expanded ? (p(), y("div", {
874
+ ], 10, ca),
875
+ e.expanded ? (g(), M("div", {
863
876
  key: 0,
864
877
  class: "pelican-row-expanded",
865
- onClick: h[4] || (h[4] = te(() => {
878
+ onClick: f[4] || (f[4] = ne(() => {
866
879
  }, ["stop"]))
867
880
  }, [
868
- o("div", Ta, [
869
- o("div", Aa, [
870
- o("div", Fa, [
871
- h[5] || (h[5] = o("div", { class: "label" }, "Currency", -1)),
872
- o("div", Na, b(e.s.Currency ?? "USD"), 1)
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
- o("div", La, [
875
- h[6] || (h[6] = o("div", { class: "label" }, "Monthly profit", -1)),
876
- o("div", Da, b(v(H)(e.s.MonthlyProfit, v(s))), 1)
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
- o("div", Ua, [
879
- h[7] || (h[7] = o("div", { class: "label" }, "Yearly profit", -1)),
880
- o("div", Va, b(v(H)(e.s.YearlyProfit, v(s))), 1)
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
- o("div", Ea, [
883
- h[8] || (h[8] = o("div", { class: "label" }, "Balance", -1)),
884
- o("div", Ba, b(v(H)(e.s.AccountBalance, v(s))), 1)
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
- o("div", Oa, [
887
- h[9] || (h[9] = o("div", { class: "label" }, "Realized P/L", -1)),
888
- o("div", Ka, b(v(H)(e.s.RealisedPnl, v(s))), 1)
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
- o("div", Ya, [
891
- h[10] || (h[10] = o("div", { class: "label" }, "Unrealized P/L", -1)),
892
- o("div", Ga, b(v(H)(e.s.UnrealisedPnl, v(s))), 1)
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
- o("div", za, [
895
- h[11] || (h[11] = o("div", { class: "label" }, "Trades total", -1)),
896
- o("div", Ha, b(v(we)(e.s.TradesTotal, v(s))), 1)
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
- o("div", ja, [
899
- h[12] || (h[12] = o("div", { class: "label" }, "Win rate", -1)),
900
- o("div", Wa, [
901
- u.value >= 0 ? (p(), y("span", qa, b(u.value.toFixed(1)) + "% / " + b(m.value.toFixed(1)) + "%", 1)) : (p(), y("span", Xa, "—"))
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
- o("div", Za, [
906
- h[13] || (h[13] = o("div", { class: "hd" }, "Markets", -1)),
907
- P(ea, {
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
- o("div", Ja, [
913
- o("button", {
925
+ i("div", Za, [
926
+ i("button", {
914
927
  class: B(["pill", { on: d.value }]),
915
928
  type: "button",
916
- onClick: w
929
+ onClick: I
917
930
  }, b(d.value ? "Hide" : "Open Trades"), 3),
918
- o("button", {
919
- class: B(["pill", { on: r.value }]),
931
+ i("button", {
932
+ class: B(["pill", { on: u.value }]),
920
933
  type: "button",
921
- onClick: I
922
- }, b(r.value ? "Hide" : "Trade History"), 3)
934
+ onClick: k
935
+ }, b(u.value ? "Hide" : "Trade History"), 3)
923
936
  ]),
924
- d.value ? (p(), ie(_e, {
937
+ d.value ? (g(), ue(Re, {
925
938
  key: 0,
926
939
  kind: "open",
927
- trades: ((C = e.openTrades) == null ? void 0 : C.trades) ?? null,
928
- loading: !!((V = e.openTrades) != null && V.loading),
929
- locale: v(s)
930
- }, null, 8, ["trades", "loading", "locale"])) : O("", !0),
931
- r.value ? (p(), ie(_e, {
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: v(s)
937
- }, null, 8, ["trades", "loading", "locale"])) : O("", !0)
938
- ])) : O("", !0)
949
+ locale: p(s)
950
+ }, null, 8, ["trades", "loading", "locale"])) : K("", !0)
951
+ ])) : K("", !0)
939
952
  ], 64);
940
953
  };
941
954
  }
942
- }), en = /* @__PURE__ */ N(Qa, [["__scopeId", "data-v-61c1236b"]]), tn = {
955
+ }), Qa = /* @__PURE__ */ N(Ja, [["__scopeId", "data-v-61c1236b"]]), en = {
943
956
  key: 0,
944
957
  class: "pelican-pager"
945
- }, an = ["disabled"], nn = {
958
+ }, tn = ["disabled"], an = {
946
959
  key: 0,
947
960
  class: "gap"
948
- }, ln = ["onClick"], sn = ["disabled"], on = { class: "info" }, rn = ["max", "value"], un = /* @__PURE__ */ F({
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 i = parseInt(l.target.value, 10);
963
- isNaN(i) || n("go", i);
975
+ const o = parseInt(l.target.value, 10);
976
+ isNaN(o) || n("go", o);
964
977
  }
965
- return (l, i) => a.totalPages > 1 ? (p(), y("nav", tn, [
966
- o("button", {
978
+ return (l, o) => a.totalPages > 1 ? (g(), M("nav", en, [
979
+ i("button", {
967
980
  disabled: e.page <= 1,
968
- onClick: i[0] || (i[0] = (u) => s("prev"))
969
- }, "‹ prev", 8, an),
970
- (p(!0), y(U, null, K(e.range, (u, m) => (p(), y(U, { key: m }, [
971
- u === "…" ? (p(), y("span", nn, "…")) : (p(), y("button", {
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: u === e.page }]),
974
- onClick: (g) => s(u)
975
- }, b(u), 11, ln))
986
+ class: B(["page", { cur: r === e.page }]),
987
+ onClick: (h) => s(r)
988
+ }, b(r), 11, nn))
976
989
  ], 64))), 128)),
977
- o("button", {
990
+ i("button", {
978
991
  disabled: e.page >= e.totalPages,
979
- onClick: i[1] || (i[1] = (u) => s("next"))
980
- }, "next ›", 8, sn),
981
- o("span", on, [
982
- i[2] || (i[2] = D(" go to ", -1)),
983
- o("input", {
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, rn)
1002
+ }, null, 40, on)
990
1003
  ])
991
- ])) : O("", !0);
1004
+ ])) : K("", !0);
992
1005
  }
993
- }), cn = /* @__PURE__ */ N(un, [["__scopeId", "data-v-42928155"]]), dn = { class: "pelican-table" }, mn = { class: "row head" }, fn = ["onClick"], vn = {
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
- }, pn = /* @__PURE__ */ F({
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, i) => (p(), y("section", dn, [
1023
- o("div", mn, [
1024
- i[1] || (i[1] = o("div", null, "Name", -1)),
1025
- i[2] || (i[2] = o("div", null, "Equity curve", -1)),
1026
- (p(), y(U, null, K(s, (u) => o("div", {
1027
- key: u.key,
1028
- class: B(["c-num sortable", c(u.key)]),
1029
- onClick: (m) => n("toggle-sort", u.key)
1030
- }, b(u.label), 11, fn)), 64)),
1031
- i[3] || (i[3] = o("div", null, null, -1))
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 ? (p(), y("div", vn, [
1034
- q(l.$slots, "empty", {}, () => [
1035
- i[4] || (i[4] = D("No matches.", -1))
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
- ])) : (p(!0), y(U, { key: 1 }, K(e.pageItems, (u) => (p(), ie(en, {
1038
- key: u.Id,
1039
- s: u,
1040
- expanded: e.expanded.has(u.Id),
1041
- "open-trades": e.openSignals.get(u.Id) ?? null,
1042
- "closed-trades": e.closedSignals.get(u.Id) ?? null,
1043
- onToggle: (m) => n("toggle-row", u.Id),
1044
- onLoadTrades: (m) => n("load-trades", { id: u.Id, kind: m }),
1045
- onSelect: (m) => n("select", u)
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": re((m) => [
1048
- q(l.$slots, "row-actions", Ue({ ref_for: !0 }, m), void 0, !0)
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
- P(cn, {
1065
+ T(un, {
1053
1066
  page: e.page,
1054
1067
  "total-pages": e.totalPages,
1055
1068
  range: e.pageRange,
1056
- onGo: i[0] || (i[0] = (u) => n("go", u))
1069
+ onGo: o[0] || (o[0] = (r) => n("go", r))
1057
1070
  }, null, 8, ["page", "total-pages", "range"])
1058
1071
  ]));
1059
1072
  }
1060
- }), gn = /* @__PURE__ */ N(pn, [["__scopeId", "data-v-c61b9ce8"]]), hn = {
1073
+ }), pn = /* @__PURE__ */ N(vn, [["__scopeId", "data-v-c61b9ce8"]]), gn = {
1061
1074
  key: 0,
1062
1075
  class: "pelican-progress"
1063
- }, yn = { class: "bar" }, Mn = { class: "caption" }, bn = { class: "hint" }, xn = /* @__PURE__ */ F({
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 = k(
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 ? (p(), y("div", hn, [
1075
- o("div", yn, [
1076
- o("span", {
1077
- style: Ve({ width: a.value.toFixed(1) + "%" })
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
- o("div", Mn, [
1081
- s[0] || (s[0] = D(" Building full catalog: ", -1)),
1082
- o("b", null, b(e.loaded.toLocaleString("en-US")), 1),
1083
- D(" / " + b(e.total.toLocaleString("en-US")) + " strategies (" + b(a.value.toFixed(0)) + "%) · ", 1),
1084
- s[1] || (s[1] = o("i", null, "upstream rate-limited", -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
- o("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)
1087
- ])) : O("", !0);
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
- }), wn = /* @__PURE__ */ N(xn, [["__scopeId", "data-v-8767a909"]]), Te = "pelican-theme";
1090
- function $n(e = "auto") {
1091
- const t = kn(), a = R(t ?? e), n = R("dark"), s = typeof window < "u" && window.matchMedia ? window.matchMedia("(prefers-color-scheme: dark)") : null, c = () => {
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)), E(a, (m) => {
1110
+ s && (s.addEventListener ? s.addEventListener("change", l) : s.addListener(l)), V(a, (m) => {
1098
1111
  try {
1099
- localStorage.setItem(Te, m);
1112
+ localStorage.setItem(Fe, m);
1100
1113
  } catch {
1101
1114
  }
1102
1115
  c();
1103
- }), c(), de(() => {
1116
+ }), c(), fe(() => {
1104
1117
  s && (s.removeEventListener ? s.removeEventListener("change", l) : s.removeListener(l));
1105
1118
  });
1106
- function i(m) {
1119
+ function o(m) {
1107
1120
  a.value = m;
1108
1121
  }
1109
- function u() {
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: i, cycle: u };
1125
+ return { mode: a, resolved: n, setMode: o, cycle: r };
1113
1126
  }
1114
- function kn() {
1127
+ function $n() {
1115
1128
  try {
1116
- const e = localStorage.getItem(Te);
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 Z(e, t, a) {
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 oe(e, t) {
1127
- const a = J(t, e);
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 Z("fetch_failed", s.message ?? "fetch failed");
1145
+ throw J("fetch_failed", s.message ?? "fetch failed");
1133
1146
  }
1134
1147
  if (n.status === 401 || n.status === 503)
1135
- throw Z("no_token", "Proxy has no token yet", n.status);
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 Z("http_error", `${n.status}: ${s.slice(0, 120)}`, n.status);
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 J(e, t) {
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 In({ apiBase: e, catalogBase: t, onError: a }) {
1148
- const n = Ee(/* @__PURE__ */ new Map()), s = R(!1), c = R(!1), l = R(0), i = R(0), u = R(null), m = k(() => Array.from(n.value.values()));
1149
- let g = !1;
1150
- const f = (M) => {
1151
- a ? a(M) : console.warn("[pelican-vue]", M);
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 M = t == null ? void 0 : t.value;
1154
- return !!M && M !== e.value;
1155
- }, r = () => (t == null ? void 0 : t.value) || e.value;
1156
- async function w(M) {
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 Y = await oe(M ? "/api/strategies-full?partial=1" : "/api/strategies-full", r());
1159
- i.value = Y.length;
1160
- const G = n.value;
1161
- for (const L of Y) G.set(L.Id, { ...G.get(L.Id), ...L });
1162
- ae(n);
1163
- } catch (T) {
1164
- f(T);
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 I() {
1180
+ async function k() {
1168
1181
  try {
1169
- const M = await oe("/api/strategies-full/progress", r());
1170
- return l.value = M.loaded, i.value = M.total || i.value, c.value = M.building, u.value = M.built_at, M;
1171
- } catch (M) {
1172
- return f(M), null;
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 w(!1), I(), s.value = !0;
1190
+ await I(!1), k(), s.value = !0;
1178
1191
  return;
1179
1192
  }
1180
- await w(!0);
1181
- let M = Date.now();
1182
- for (; !g; ) {
1183
- const T = await I();
1184
- if (!T) {
1185
- await Re(1500);
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 (T.ready) break;
1189
- Date.now() - M > je && (await w(!0), M = Date.now()), await Re(He);
1201
+ if (C.ready) break;
1202
+ Date.now() - y > je && (await I(!0), y = Date.now()), await Ce(He);
1190
1203
  }
1191
- g || (await w(!1), s.value = !0);
1204
+ h || (await I(!1), s.value = !0);
1192
1205
  }
1193
- const h = /* @__PURE__ */ new Set();
1194
- async function C(M) {
1195
- if (h.has(M)) return;
1196
- const T = n.value.get(M);
1197
- if (!(T != null && T._enrichAttempted && T._meta && T._stats)) {
1198
- h.add(M);
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 [Y, G] = await Promise.all([
1201
- Se(J(e.value, `/api/strategies/${M}`)),
1202
- Se(J(e.value, `/api/strategies/${M}/stats`))
1203
- ]), L = n.value, A = L.get(M) ?? { Id: M };
1204
- _n(A, Y), Sn(A, G), A._enrichAttempted = !0, A.IsEnabled === !1 ? L.delete(M) : L.set(M, A), ae(n);
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
- h.delete(M);
1220
+ f.delete(y);
1207
1221
  }
1208
1222
  }
1209
1223
  }
1210
- async function V(M) {
1211
- if (!(!M || !s.value))
1224
+ async function A(y) {
1225
+ if (!(!y || !s.value))
1212
1226
  try {
1213
- const T = await oe(
1214
- `/api/strategies?filter=${encodeURIComponent(M)}`,
1227
+ const C = await re(
1228
+ `/api/strategies?filter=${encodeURIComponent(y)}`,
1215
1229
  e.value
1216
- ), Y = n.value, G = [];
1217
- let L = 0;
1218
- for (const A of T)
1219
- Y.has(A.Id) || (Y.set(A.Id, { ...A, _stats: !1, _meta: !1 }), G.push(A.Id), L++);
1220
- L && (i.value += L, ae(n));
1221
- for (const A of G) C(A);
1222
- } catch (T) {
1223
- f(T);
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
- g = !1, _();
1241
+ h = !1, _();
1228
1242
  }
1229
1243
  function x() {
1230
- g = !0;
1244
+ h = !0;
1231
1245
  }
1232
- async function $() {
1233
- x(), n.value = /* @__PURE__ */ new Map(), s.value = !1, l.value = 0, i.value = 0, u.value = null, S();
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 de(x), {
1249
+ return fe(x), {
1236
1250
  catalog: m,
1237
1251
  ready: s,
1238
1252
  building: c,
1239
1253
  loaded: l,
1240
- total: i,
1241
- builtAt: u,
1242
- enrichOne: C,
1243
- searchExtra: V,
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 Se(e) {
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 _n(e, t) {
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 Sn(e, t) {
1261
- var i, u, m, g, f, d;
1274
+ function _n(e, t) {
1275
+ var o, r, m, h, v, d;
1262
1276
  if (!t) return;
1263
- const a = ((i = t.Profitability) == null ? void 0 : i.Inception) ?? {}, n = ((u = t.Trades) == null ? void 0 : u.Inception) ?? {}, s = a.History ?? [], c = s.length > 60 ? Math.ceil(s.length / 60) : 1, l = s.filter((r, w) => w % c === 0 || w === s.length - 1).map((r) => ({ Timestamp: r.Timestamp, AccountReturn: r.AccountReturn }));
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((r) => ({ n: r.MarketName, c: r.Count })) : [], e.AccountBalance = ((m = t.Status) == null ? void 0 : m.Balance) ?? null, e.CopiersAUM = ((g = t.CopiersBalance) == null ? void 0 : g.Balance) ?? null, e.MonthlyProfit = ((f = t.CopiersProfit) == null ? void 0 : f.Month) ?? null, e.YearlyProfit = ((d = t.CopiersProfit) == null ? void 0 : d.Year) ?? null, e._stats = !0;
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 Re(e) {
1280
+ function Ce(e) {
1267
1281
  return new Promise((t) => setTimeout(t, e));
1268
1282
  }
1269
- function ce() {
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 Rn(e, t = {}) {
1287
- const a = ce(), n = Pe({
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 = k(() => e.value.filter((l) => Pn(l, n)));
1305
+ }), s = $(() => e.value.filter((l) => Rn(l, n)));
1292
1306
  function c() {
1293
- const l = ce();
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 Pn(e, t) {
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 = W(e);
1320
+ const a = q(e);
1307
1321
  if (t.winrateMin != null && (a < 0 || a < t.winrateMin)) return !1;
1308
- const n = j(e.Inception);
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 Cn = {
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) => (j(t.Inception) ?? -1) - (j(e.Inception) ?? -1),
1323
- "age-asc": (e, t) => (j(e.Inception) ?? 1 / 0) - (j(t.Inception) ?? 1 / 0),
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) => W(t) - W(e),
1327
- "winrate-asc": (e, t) => W(e) - W(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 Tn(e, t = "return-desc") {
1334
- const a = R(t), n = k(() => {
1335
- const c = Cn[a.value] ?? (() => 0);
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, i] = Ze[c];
1340
- a.value = a.value === l ? i : 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 An(e, t) {
1352
- const a = R(1), n = k(() => Math.max(1, Math.ceil(e.value.length / t)));
1353
- E(n, (l) => {
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 = k(() => {
1370
+ const s = $(() => {
1357
1371
  const l = (a.value - 1) * t;
1358
1372
  return e.value.slice(l, l + t);
1359
- }), c = k(() => {
1360
- const l = a.value, i = n.value;
1361
- if (i <= 1) return [];
1362
- const m = [.../* @__PURE__ */ new Set([1, i, l, l - 1, l + 1, l - 2, l + 2, 2, i - 1])].filter((f) => f >= 1 && f <= i).sort((f, d) => f - d), g = [];
1363
- for (let f = 0; f < m.length; f++)
1364
- f && m[f] - m[f - 1] > 1 && g.push("…"), g.push(m[f]);
1365
- return g;
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 Fn(e) {
1384
- const t = R(/* @__PURE__ */ new Map()), a = R(/* @__PURE__ */ new Map());
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 i = l === "open" ? t : a, u = i.value.get(c);
1390
- if (u && (u.loading || u.trades !== null)) return;
1391
- const m = new Map(i.value);
1392
- m.set(c, { loading: !0, trades: null, error: null }), i.value = m;
1393
- let g = "";
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 I = /* @__PURE__ */ new Date(), _ = new Date(Date.now() - We * 864e5), h = (C) => C.toISOString().replace(/\.\d+Z$/, "Z");
1396
- g = `?startDate=${encodeURIComponent(h(_))}&endDate=${encodeURIComponent(h(I))}`;
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 f = J(e.value, `/api/strategies/${c}/signals/${l}${g}`);
1399
- let d = [], r = null;
1412
+ const v = ee(e.value, `/api/strategies/${c}/signals/${l}${h}`);
1413
+ let d = [], u = null;
1400
1414
  try {
1401
- const I = await fetch(f);
1402
- if (!I.ok) throw Z("http_error", `${I.status}`);
1403
- d = await I.json();
1404
- } catch (I) {
1405
- r = I.code ? I : Z("fetch_failed", I.message), d = [];
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 w = new Map(i.value);
1408
- w.set(c, { loading: !1, trades: d, error: r }), i.value = w;
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 Nn = ["data-theme"], Ln = { class: "brand-row" }, Dn = ["title"], Un = { "aria-hidden": "true" }, Vn = { class: "pelican-main" }, En = /* @__PURE__ */ F({
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: Ge }
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
- ne(ua, a.apiBase), ne(ca, a.catalogBase ?? a.apiBase), ne(Ce, a.locale);
1428
- const s = ye(a, "apiBase"), c = ye(a, "catalogBase"), l = $n(a.theme);
1429
- E(l.mode, (x) => n("update:theme", x)), E(
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 i = In({
1447
+ const o = kn({
1434
1448
  apiBase: s,
1435
1449
  catalogBase: c,
1436
1450
  onError: (x) => n("error", x)
1437
- }), u = Rn(i.catalog, a.defaultFilters ?? {}), m = Tn(u.filtered, a.defaultSort), g = An(m.sorted, a.pageSize), f = Fn(s), d = Pe(/* @__PURE__ */ new Set()), r = R(!1), w = R(null);
1438
- function I(x) {
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 $ = i.catalog.value.find((M) => M.Id === x);
1441
- $ && ((!$._meta || !$._stats) && !$._enrichAttempted && i.enrichOne(x), n("select-strategy", $));
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), g.setPage(1);
1465
+ m.toggleColumn(x), h.setPage(1);
1445
1466
  }
1446
- function h(x) {
1447
- Object.assign(u.filters, x), g.setPage(1);
1467
+ function f(x) {
1468
+ Object.assign(r.filters, x), h.setPage(1);
1448
1469
  }
1449
- function C() {
1450
- const x = ce();
1451
- Object.assign(u.filters, x), u.filters.risk = x.risk, w.value = null, g.setPage(1);
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 V({ id: x, kind: $ }) {
1454
- f.load(x, $);
1474
+ function A({ id: x, kind: w }) {
1475
+ v.load(x, w);
1455
1476
  }
1456
1477
  function S(x) {
1457
- x === "prev" ? g.prev() : x === "next" ? g.next() : g.setPage(x);
1478
+ x === "prev" ? h.prev() : x === "next" ? h.next() : h.setPage(x);
1458
1479
  }
1459
- return Be(() => i.start()), (x, $) => (p(), y("div", {
1480
+ return Be(() => o.start()), (x, w) => (g(), M("div", {
1460
1481
  class: "pelican-libsoc",
1461
- "data-theme": v(l).resolved.value
1482
+ "data-theme": p(l).resolved.value
1462
1483
  }, [
1463
- o("header", Ln, [
1464
- q(x.$slots, "brand", {}, () => [
1465
- $[6] || ($[6] = o("div", { class: "default-brand" }, "Libertex Social — Copy Trading", -1))
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
- o("button", {
1488
+ i("button", {
1468
1489
  class: "theme-toggle",
1469
1490
  type: "button",
1470
- title: v(l).mode.value,
1471
- onClick: $[0] || ($[0] = //@ts-ignore
1472
- (...M) => v(l).cycle && v(l).cycle(...M))
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
- o("span", Un, b(v(l).resolved.value === "dark" ? "🌙" : "☀️"), 1)
1475
- ], 8, Dn)
1495
+ i("span", Dn, b(p(l).resolved.value === "dark" ? "🌙" : "☀️"), 1)
1496
+ ], 8, Ln)
1476
1497
  ]),
1477
- P(st, {
1478
- search: v(u).filters.search,
1479
- "sort-key": v(m).sortKey.value,
1480
- total: v(i).total.value,
1481
- "filtered-total": v(u).filtered.value.length,
1482
- page: v(g).page.value,
1483
- "total-pages": v(g).totalPages.value,
1484
- "onUpdate:search": $[1] || ($[1] = (M) => h({ search: M })),
1485
- "onUpdate:sortKey": $[2] || ($[2] = (M) => v(m).setKey(M)),
1486
- onRefresh: v(i).refresh,
1487
- onToggleFilters: $[3] || ($[3] = (M) => r.value = !r.value)
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
- P(wn, {
1490
- loaded: v(i).loaded.value,
1491
- total: v(i).total.value,
1492
- active: v(i).building.value && !v(i).ready.value
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
- o("main", Vn, [
1495
- P(Ut, {
1496
- filters: v(u).filters,
1497
- "invest-amount": w.value,
1498
- open: r.value,
1499
- "onUpdate:filters": h,
1500
- "onUpdate:investAmount": $[4] || ($[4] = (M) => w.value = M),
1501
- onReset: C
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
- P(gn, {
1504
- "page-items": v(g).pageItems.value,
1524
+ T(pn, {
1525
+ "page-items": p(h).pageItems.value,
1505
1526
  expanded: d,
1506
- "sort-key": v(m).sortKey.value,
1507
- page: v(g).page.value,
1508
- "total-pages": v(g).totalPages.value,
1509
- "page-range": v(g).pageRange.value,
1510
- "open-signals": v(f).open.value,
1511
- "closed-signals": v(f).closed.value,
1512
- onToggleRow: I,
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: V,
1515
- onSelect: $[5] || ($[5] = (M) => n("select-strategy", M)),
1535
+ onLoadTrades: A,
1536
+ onSelect: w[5] || (w[5] = (y) => n("select-strategy", y)),
1516
1537
  onGo: S
1517
1538
  }, {
1518
- empty: re(() => [
1519
- q(x.$slots, "empty", {}, () => [
1520
- $[7] || ($[7] = D("No matches.", -1))
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": re((M) => [
1524
- q(x.$slots, "row-actions", Oe(Ke(M)), void 0, !0)
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, Nn));
1550
+ ], 8, Fn));
1530
1551
  }
1531
- }), On = /* @__PURE__ */ N(En, [["__scopeId", "data-v-33b03803"]]);
1552
+ }), Bn = /* @__PURE__ */ N(Vn, [["__scopeId", "data-v-e2cce41d"]]);
1532
1553
  export {
1533
- On as PelicanLibertexSocial,
1554
+ Bn as PelicanLibertexSocial,
1534
1555
  qe as SORT_KEYS,
1535
1556
  Xe as SORT_LABELS,
1536
1557
  Ze as SORT_TOGGLE,
1537
- ce as defaultFilters
1558
+ me as defaultFilters
1538
1559
  };
1539
1560
  //# sourceMappingURL=pelican-libertex-social.mjs.map