@pennsieve-viz/tsviewer 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{BFLibraryButton-zWDUe3E8.cjs → BFLibraryButton-ClRfrYOf.cjs} +1 -1
- package/dist/{BFLibraryButton-DEY9t1Is.js → BFLibraryButton-DzzWe3Ya.js} +1 -1
- package/dist/{IconSelection-IJR6hdts.js → IconSelection-Bnm4c-Az.js} +1 -1
- package/dist/{IconSelection-DsOecTVD.cjs → IconSelection-CYX2jlGW.cjs} +1 -1
- package/dist/TSAnnotationCanvas-BCu7PmSh.cjs +1 -0
- package/dist/TSAnnotationCanvas-Cua-lW6X.js +704 -0
- package/dist/{TSAnnotationModal-DpLHrHfV.js → TSAnnotationModal-7GxnJomu.js} +3 -3
- package/dist/{TSAnnotationModal-DkLaOB7u.cjs → TSAnnotationModal-BVDkiUQ1.cjs} +1 -1
- package/dist/{TSFilterModal-C1-o1zyF.js → TSFilterModal-1E2UWL8T.js} +3 -3
- package/dist/{TSFilterModal-DsVcUoIk.cjs → TSFilterModal-BVfwi0tb.cjs} +1 -1
- package/dist/TSScrubber-CBKcwuMb.js +374 -0
- package/dist/TSScrubber-DBWjIhSE.cjs +1 -0
- package/dist/{TSViewerCanvas-A6HgBZ4E.js → TSViewerCanvas-D_RaJ4Mj.js} +1865 -1931
- package/dist/TSViewerCanvas-gjfcQXDY.cjs +11 -0
- package/dist/{TSViewerLayerWindow-Dnij6c3F.js → TSViewerLayerWindow-COWXfHNB.js} +2 -2
- package/dist/{TSViewerLayerWindow-Cu8yQKRU.cjs → TSViewerLayerWindow-D5j3_B1E.cjs} +1 -1
- package/dist/{TSViewerToolbar-CO68rvXF.js → TSViewerToolbar-Cb2W7W6J.js} +1 -1
- package/dist/{TSViewerToolbar-_NqUlS08.cjs → TSViewerToolbar-ep_lZr6h.cjs} +1 -1
- package/dist/{TsAnnotationDeleteDialog-D9eQGzqE.js → TsAnnotationDeleteDialog-B9pQMYZo.js} +3 -3
- package/dist/{TsAnnotationDeleteDialog-fM5Y7SRB.cjs → TsAnnotationDeleteDialog-BRIgCXxU.cjs} +1 -1
- package/dist/index-BU6e_1Ww.js +1414 -0
- package/dist/index-C-i9Taq7.cjs +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{pathOr-DKv8SMY9.cjs → pathOr-BQgOyNsu.cjs} +1 -1
- package/dist/{pathOr-kR7j_Y-C.js → pathOr-Dr8GvKXg.js} +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/TSAnnotationCanvas-B0b_EheO.js +0 -730
- package/dist/TSAnnotationCanvas-Bfxc75PD.cjs +0 -1
- package/dist/TSScrubber-9ABMW6b2.js +0 -377
- package/dist/TSScrubber-BlHHGh3F.cjs +0 -1
- package/dist/TSViewerCanvas-DBpG0Erk.cjs +0 -11
- package/dist/index-CMJlEiLT.cjs +0 -1
- package/dist/index-CgKUmS0K.js +0 -1459
package/dist/index-CgKUmS0K.js
DELETED
|
@@ -1,1459 +0,0 @@
|
|
|
1
|
-
import { reactive as Nt, ref as w, computed as H, inject as jt, defineAsyncComponent as re, provide as qe, watch as Ve, nextTick as de, onMounted as Ut, onBeforeUnmount as Mt, createElementBlock as Oe, openBlock as ye, normalizeClass as Le, createVNode as fe, createElementVNode as ge, createBlock as Wt, createCommentVNode as $t, unref as oe, Fragment as Ft, renderList as xt, toDisplayString as Be, readonly as ae } from "vue";
|
|
2
|
-
import { defineStore as qt, storeToRefs as De } from "pinia";
|
|
3
|
-
import { fetchAuthSession as Bt } from "aws-amplify/auth";
|
|
4
|
-
function C(t) {
|
|
5
|
-
return t != null && typeof t == "object" && t["@@functional/placeholder"] === !0;
|
|
6
|
-
}
|
|
7
|
-
function N(t) {
|
|
8
|
-
return function e(n) {
|
|
9
|
-
return arguments.length === 0 || C(n) ? e : t.apply(this, arguments);
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
function M(t) {
|
|
13
|
-
return function e(n, r) {
|
|
14
|
-
switch (arguments.length) {
|
|
15
|
-
case 0:
|
|
16
|
-
return e;
|
|
17
|
-
case 1:
|
|
18
|
-
return C(n) ? e : N(function(s) {
|
|
19
|
-
return t(n, s);
|
|
20
|
-
});
|
|
21
|
-
default:
|
|
22
|
-
return C(n) && C(r) ? e : C(n) ? N(function(s) {
|
|
23
|
-
return t(s, r);
|
|
24
|
-
}) : C(r) ? N(function(s) {
|
|
25
|
-
return t(n, s);
|
|
26
|
-
}) : t(n, r);
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
function zt(t, e) {
|
|
31
|
-
t = t || [], e = e || [];
|
|
32
|
-
var n, r = t.length, s = e.length, l = [];
|
|
33
|
-
for (n = 0; n < r; )
|
|
34
|
-
l[l.length] = t[n], n += 1;
|
|
35
|
-
for (n = 0; n < s; )
|
|
36
|
-
l[l.length] = e[n], n += 1;
|
|
37
|
-
return l;
|
|
38
|
-
}
|
|
39
|
-
function Re(t, e) {
|
|
40
|
-
switch (t) {
|
|
41
|
-
case 0:
|
|
42
|
-
return function() {
|
|
43
|
-
return e.apply(this, arguments);
|
|
44
|
-
};
|
|
45
|
-
case 1:
|
|
46
|
-
return function(n) {
|
|
47
|
-
return e.apply(this, arguments);
|
|
48
|
-
};
|
|
49
|
-
case 2:
|
|
50
|
-
return function(n, r) {
|
|
51
|
-
return e.apply(this, arguments);
|
|
52
|
-
};
|
|
53
|
-
case 3:
|
|
54
|
-
return function(n, r, s) {
|
|
55
|
-
return e.apply(this, arguments);
|
|
56
|
-
};
|
|
57
|
-
case 4:
|
|
58
|
-
return function(n, r, s, l) {
|
|
59
|
-
return e.apply(this, arguments);
|
|
60
|
-
};
|
|
61
|
-
case 5:
|
|
62
|
-
return function(n, r, s, l, g) {
|
|
63
|
-
return e.apply(this, arguments);
|
|
64
|
-
};
|
|
65
|
-
case 6:
|
|
66
|
-
return function(n, r, s, l, g, m) {
|
|
67
|
-
return e.apply(this, arguments);
|
|
68
|
-
};
|
|
69
|
-
case 7:
|
|
70
|
-
return function(n, r, s, l, g, m, I) {
|
|
71
|
-
return e.apply(this, arguments);
|
|
72
|
-
};
|
|
73
|
-
case 8:
|
|
74
|
-
return function(n, r, s, l, g, m, I, v) {
|
|
75
|
-
return e.apply(this, arguments);
|
|
76
|
-
};
|
|
77
|
-
case 9:
|
|
78
|
-
return function(n, r, s, l, g, m, I, v, i) {
|
|
79
|
-
return e.apply(this, arguments);
|
|
80
|
-
};
|
|
81
|
-
case 10:
|
|
82
|
-
return function(n, r, s, l, g, m, I, v, i, h) {
|
|
83
|
-
return e.apply(this, arguments);
|
|
84
|
-
};
|
|
85
|
-
default:
|
|
86
|
-
throw new Error("First argument to _arity must be a non-negative integer no greater than ten");
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
function Te(t) {
|
|
90
|
-
return function e(n, r, s) {
|
|
91
|
-
switch (arguments.length) {
|
|
92
|
-
case 0:
|
|
93
|
-
return e;
|
|
94
|
-
case 1:
|
|
95
|
-
return C(n) ? e : M(function(l, g) {
|
|
96
|
-
return t(n, l, g);
|
|
97
|
-
});
|
|
98
|
-
case 2:
|
|
99
|
-
return C(n) && C(r) ? e : C(n) ? M(function(l, g) {
|
|
100
|
-
return t(l, r, g);
|
|
101
|
-
}) : C(r) ? M(function(l, g) {
|
|
102
|
-
return t(n, l, g);
|
|
103
|
-
}) : N(function(l) {
|
|
104
|
-
return t(n, r, l);
|
|
105
|
-
});
|
|
106
|
-
default:
|
|
107
|
-
return C(n) && C(r) && C(s) ? e : C(n) && C(r) ? M(function(l, g) {
|
|
108
|
-
return t(l, g, s);
|
|
109
|
-
}) : C(n) && C(s) ? M(function(l, g) {
|
|
110
|
-
return t(l, r, g);
|
|
111
|
-
}) : C(r) && C(s) ? M(function(l, g) {
|
|
112
|
-
return t(n, l, g);
|
|
113
|
-
}) : C(n) ? N(function(l) {
|
|
114
|
-
return t(l, r, s);
|
|
115
|
-
}) : C(r) ? N(function(l) {
|
|
116
|
-
return t(n, l, s);
|
|
117
|
-
}) : C(s) ? N(function(l) {
|
|
118
|
-
return t(n, r, l);
|
|
119
|
-
}) : t(n, r, s);
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
const Ce = Array.isArray || function(e) {
|
|
124
|
-
return e != null && e.length >= 0 && Object.prototype.toString.call(e) === "[object Array]";
|
|
125
|
-
};
|
|
126
|
-
function Xt(t) {
|
|
127
|
-
return t != null && typeof t["@@transducer/step"] == "function";
|
|
128
|
-
}
|
|
129
|
-
function Gt(t, e, n) {
|
|
130
|
-
return function() {
|
|
131
|
-
if (arguments.length === 0)
|
|
132
|
-
return n();
|
|
133
|
-
var r = arguments[arguments.length - 1];
|
|
134
|
-
if (!Ce(r)) {
|
|
135
|
-
for (var s = 0; s < t.length; ) {
|
|
136
|
-
if (typeof r[t[s]] == "function")
|
|
137
|
-
return r[t[s]].apply(r, Array.prototype.slice.call(arguments, 0, -1));
|
|
138
|
-
s += 1;
|
|
139
|
-
}
|
|
140
|
-
if (Xt(r)) {
|
|
141
|
-
var l = e.apply(null, Array.prototype.slice.call(arguments, 0, -1));
|
|
142
|
-
return l(r);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
return n.apply(this, arguments);
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
function Ht(t) {
|
|
149
|
-
return t && t["@@transducer/reduced"] ? t : {
|
|
150
|
-
"@@transducer/value": t,
|
|
151
|
-
"@@transducer/reduced": !0
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
const Zt = {
|
|
155
|
-
init: function() {
|
|
156
|
-
return this.xf["@@transducer/init"]();
|
|
157
|
-
},
|
|
158
|
-
result: function(t) {
|
|
159
|
-
return this.xf["@@transducer/result"](t);
|
|
160
|
-
}
|
|
161
|
-
};
|
|
162
|
-
function Ie(t) {
|
|
163
|
-
return Object.prototype.toString.call(t) === "[object String]";
|
|
164
|
-
}
|
|
165
|
-
var Jt = /* @__PURE__ */ N(function(e) {
|
|
166
|
-
return Ce(e) ? !0 : !e || typeof e != "object" || Ie(e) ? !1 : e.length === 0 ? !0 : e.length > 0 ? e.hasOwnProperty(0) && e.hasOwnProperty(e.length - 1) : !1;
|
|
167
|
-
}), Yt = /* @__PURE__ */ (function() {
|
|
168
|
-
function t(e) {
|
|
169
|
-
this.f = e;
|
|
170
|
-
}
|
|
171
|
-
return t.prototype["@@transducer/init"] = function() {
|
|
172
|
-
throw new Error("init not implemented on XWrap");
|
|
173
|
-
}, t.prototype["@@transducer/result"] = function(e) {
|
|
174
|
-
return e;
|
|
175
|
-
}, t.prototype["@@transducer/step"] = function(e, n) {
|
|
176
|
-
return this.f(e, n);
|
|
177
|
-
}, t;
|
|
178
|
-
})();
|
|
179
|
-
function Kt(t) {
|
|
180
|
-
return new Yt(t);
|
|
181
|
-
}
|
|
182
|
-
var Qt = /* @__PURE__ */ M(function(e, n) {
|
|
183
|
-
return Re(e.length, function() {
|
|
184
|
-
return e.apply(n, arguments);
|
|
185
|
-
});
|
|
186
|
-
});
|
|
187
|
-
function en(t, e, n) {
|
|
188
|
-
for (var r = 0, s = n.length; r < s; ) {
|
|
189
|
-
if (e = t["@@transducer/step"](e, n[r]), e && e["@@transducer/reduced"]) {
|
|
190
|
-
e = e["@@transducer/value"];
|
|
191
|
-
break;
|
|
192
|
-
}
|
|
193
|
-
r += 1;
|
|
194
|
-
}
|
|
195
|
-
return t["@@transducer/result"](e);
|
|
196
|
-
}
|
|
197
|
-
function ze(t, e, n) {
|
|
198
|
-
for (var r = n.next(); !r.done; ) {
|
|
199
|
-
if (e = t["@@transducer/step"](e, r.value), e && e["@@transducer/reduced"]) {
|
|
200
|
-
e = e["@@transducer/value"];
|
|
201
|
-
break;
|
|
202
|
-
}
|
|
203
|
-
r = n.next();
|
|
204
|
-
}
|
|
205
|
-
return t["@@transducer/result"](e);
|
|
206
|
-
}
|
|
207
|
-
function Xe(t, e, n, r) {
|
|
208
|
-
return t["@@transducer/result"](n[r](Qt(t["@@transducer/step"], t), e));
|
|
209
|
-
}
|
|
210
|
-
var Ge = typeof Symbol < "u" ? Symbol.iterator : "@@iterator";
|
|
211
|
-
function tn(t, e, n) {
|
|
212
|
-
if (typeof t == "function" && (t = Kt(t)), Jt(n))
|
|
213
|
-
return en(t, e, n);
|
|
214
|
-
if (typeof n["fantasy-land/reduce"] == "function")
|
|
215
|
-
return Xe(t, e, n, "fantasy-land/reduce");
|
|
216
|
-
if (n[Ge] != null)
|
|
217
|
-
return ze(t, e, n[Ge]());
|
|
218
|
-
if (typeof n.next == "function")
|
|
219
|
-
return ze(t, e, n);
|
|
220
|
-
if (typeof n.reduce == "function")
|
|
221
|
-
return Xe(t, e, n, "reduce");
|
|
222
|
-
throw new TypeError("reduce: list must be array or iterable");
|
|
223
|
-
}
|
|
224
|
-
function Ae(t, e) {
|
|
225
|
-
return Object.prototype.hasOwnProperty.call(e, t);
|
|
226
|
-
}
|
|
227
|
-
var He = Object.prototype.toString, at = /* @__PURE__ */ (function() {
|
|
228
|
-
return He.call(arguments) === "[object Arguments]" ? function(e) {
|
|
229
|
-
return He.call(e) === "[object Arguments]";
|
|
230
|
-
} : function(e) {
|
|
231
|
-
return Ae("callee", e);
|
|
232
|
-
};
|
|
233
|
-
})(), nn = !/* @__PURE__ */ {
|
|
234
|
-
toString: null
|
|
235
|
-
}.propertyIsEnumerable("toString"), Ze = ["constructor", "valueOf", "isPrototypeOf", "toString", "propertyIsEnumerable", "hasOwnProperty", "toLocaleString"], Je = /* @__PURE__ */ (function() {
|
|
236
|
-
return arguments.propertyIsEnumerable("length");
|
|
237
|
-
})(), rn = function(e, n) {
|
|
238
|
-
for (var r = 0; r < e.length; ) {
|
|
239
|
-
if (e[r] === n)
|
|
240
|
-
return !0;
|
|
241
|
-
r += 1;
|
|
242
|
-
}
|
|
243
|
-
return !1;
|
|
244
|
-
}, Ye = /* @__PURE__ */ N(typeof Object.keys == "function" && !Je ? function(e) {
|
|
245
|
-
return Object(e) !== e ? [] : Object.keys(e);
|
|
246
|
-
} : function(e) {
|
|
247
|
-
if (Object(e) !== e)
|
|
248
|
-
return [];
|
|
249
|
-
var n, r, s = [], l = Je && at(e);
|
|
250
|
-
for (n in e)
|
|
251
|
-
Ae(n, e) && (!l || n !== "length") && (s[s.length] = n);
|
|
252
|
-
if (nn)
|
|
253
|
-
for (r = Ze.length - 1; r >= 0; )
|
|
254
|
-
n = Ze[r], Ae(n, e) && !rn(s, n) && (s[s.length] = n), r -= 1;
|
|
255
|
-
return s;
|
|
256
|
-
});
|
|
257
|
-
const on = Number.isInteger || function(e) {
|
|
258
|
-
return e << 0 === e;
|
|
259
|
-
};
|
|
260
|
-
var an = /* @__PURE__ */ M(function(e, n) {
|
|
261
|
-
var r = e < 0 ? n.length + e : e;
|
|
262
|
-
return Ie(n) ? n.charAt(r) : n[r];
|
|
263
|
-
}), ie = /* @__PURE__ */ M(function(e, n) {
|
|
264
|
-
if (n != null)
|
|
265
|
-
return on(e) ? an(e, n) : n[e];
|
|
266
|
-
}), sn = /* @__PURE__ */ Te(tn), Ke = /* @__PURE__ */ N(function(e) {
|
|
267
|
-
return e === null ? "Null" : e === void 0 ? "Undefined" : Object.prototype.toString.call(e).slice(8, -1);
|
|
268
|
-
});
|
|
269
|
-
function ln(t, e) {
|
|
270
|
-
return function() {
|
|
271
|
-
return e.call(this, t.apply(this, arguments));
|
|
272
|
-
};
|
|
273
|
-
}
|
|
274
|
-
function it(t, e) {
|
|
275
|
-
return function() {
|
|
276
|
-
var n = arguments.length;
|
|
277
|
-
if (n === 0)
|
|
278
|
-
return e();
|
|
279
|
-
var r = arguments[n - 1];
|
|
280
|
-
return Ce(r) || typeof r[t] != "function" ? e.apply(this, arguments) : r[t].apply(r, Array.prototype.slice.call(arguments, 0, n - 1));
|
|
281
|
-
};
|
|
282
|
-
}
|
|
283
|
-
var cn = /* @__PURE__ */ Te(
|
|
284
|
-
/* @__PURE__ */ it("slice", function(e, n, r) {
|
|
285
|
-
return Array.prototype.slice.call(r, e, n);
|
|
286
|
-
})
|
|
287
|
-
), un = /* @__PURE__ */ N(
|
|
288
|
-
/* @__PURE__ */ it(
|
|
289
|
-
"tail",
|
|
290
|
-
/* @__PURE__ */ cn(1, 1 / 0)
|
|
291
|
-
)
|
|
292
|
-
);
|
|
293
|
-
function dn() {
|
|
294
|
-
if (arguments.length === 0)
|
|
295
|
-
throw new Error("pipe requires at least one argument");
|
|
296
|
-
return Re(arguments[0].length, sn(ln, arguments[0], un(arguments)));
|
|
297
|
-
}
|
|
298
|
-
var fn = /* @__PURE__ */ N(function(e) {
|
|
299
|
-
return Ie(e) ? e.split("").reverse().join("") : Array.prototype.slice.call(e, 0).reverse();
|
|
300
|
-
});
|
|
301
|
-
function Qe() {
|
|
302
|
-
if (arguments.length === 0)
|
|
303
|
-
throw new Error("compose requires at least one argument");
|
|
304
|
-
return dn.apply(this, fn(arguments));
|
|
305
|
-
}
|
|
306
|
-
function et(t) {
|
|
307
|
-
for (var e = [], n; !(n = t.next()).done; )
|
|
308
|
-
e.push(n.value);
|
|
309
|
-
return e;
|
|
310
|
-
}
|
|
311
|
-
function tt(t, e, n) {
|
|
312
|
-
for (var r = 0, s = n.length; r < s; ) {
|
|
313
|
-
if (t(e, n[r]))
|
|
314
|
-
return !0;
|
|
315
|
-
r += 1;
|
|
316
|
-
}
|
|
317
|
-
return !1;
|
|
318
|
-
}
|
|
319
|
-
function vn(t) {
|
|
320
|
-
var e = String(t).match(/^function (\w*)/);
|
|
321
|
-
return e == null ? "" : e[1];
|
|
322
|
-
}
|
|
323
|
-
function hn(t, e) {
|
|
324
|
-
return t === e ? t !== 0 || 1 / t === 1 / e : t !== t && e !== e;
|
|
325
|
-
}
|
|
326
|
-
const Pe = typeof Object.is == "function" ? Object.is : hn;
|
|
327
|
-
function nt(t, e, n, r) {
|
|
328
|
-
var s = et(t), l = et(e);
|
|
329
|
-
function g(m, I) {
|
|
330
|
-
return Ne(m, I, n.slice(), r.slice());
|
|
331
|
-
}
|
|
332
|
-
return !tt(function(m, I) {
|
|
333
|
-
return !tt(g, I, m);
|
|
334
|
-
}, l, s);
|
|
335
|
-
}
|
|
336
|
-
function Ne(t, e, n, r) {
|
|
337
|
-
if (Pe(t, e))
|
|
338
|
-
return !0;
|
|
339
|
-
var s = Ke(t);
|
|
340
|
-
if (s !== Ke(e))
|
|
341
|
-
return !1;
|
|
342
|
-
if (typeof t["fantasy-land/equals"] == "function" || typeof e["fantasy-land/equals"] == "function")
|
|
343
|
-
return typeof t["fantasy-land/equals"] == "function" && t["fantasy-land/equals"](e) && typeof e["fantasy-land/equals"] == "function" && e["fantasy-land/equals"](t);
|
|
344
|
-
if (typeof t.equals == "function" || typeof e.equals == "function")
|
|
345
|
-
return typeof t.equals == "function" && t.equals(e) && typeof e.equals == "function" && e.equals(t);
|
|
346
|
-
switch (s) {
|
|
347
|
-
case "Arguments":
|
|
348
|
-
case "Array":
|
|
349
|
-
case "Object":
|
|
350
|
-
if (typeof t.constructor == "function" && vn(t.constructor) === "Promise")
|
|
351
|
-
return t === e;
|
|
352
|
-
break;
|
|
353
|
-
case "Boolean":
|
|
354
|
-
case "Number":
|
|
355
|
-
case "String":
|
|
356
|
-
if (!(typeof t == typeof e && Pe(t.valueOf(), e.valueOf())))
|
|
357
|
-
return !1;
|
|
358
|
-
break;
|
|
359
|
-
case "Date":
|
|
360
|
-
if (!Pe(t.valueOf(), e.valueOf()))
|
|
361
|
-
return !1;
|
|
362
|
-
break;
|
|
363
|
-
case "Error":
|
|
364
|
-
return t.name === e.name && t.message === e.message;
|
|
365
|
-
case "RegExp":
|
|
366
|
-
if (!(t.source === e.source && t.global === e.global && t.ignoreCase === e.ignoreCase && t.multiline === e.multiline && t.sticky === e.sticky && t.unicode === e.unicode))
|
|
367
|
-
return !1;
|
|
368
|
-
break;
|
|
369
|
-
}
|
|
370
|
-
for (var l = n.length - 1; l >= 0; ) {
|
|
371
|
-
if (n[l] === t)
|
|
372
|
-
return r[l] === e;
|
|
373
|
-
l -= 1;
|
|
374
|
-
}
|
|
375
|
-
switch (s) {
|
|
376
|
-
case "Map":
|
|
377
|
-
return t.size !== e.size ? !1 : nt(t.entries(), e.entries(), n.concat([t]), r.concat([e]));
|
|
378
|
-
case "Set":
|
|
379
|
-
return t.size !== e.size ? !1 : nt(t.values(), e.values(), n.concat([t]), r.concat([e]));
|
|
380
|
-
case "Arguments":
|
|
381
|
-
case "Array":
|
|
382
|
-
case "Object":
|
|
383
|
-
case "Boolean":
|
|
384
|
-
case "Number":
|
|
385
|
-
case "String":
|
|
386
|
-
case "Date":
|
|
387
|
-
case "Error":
|
|
388
|
-
case "RegExp":
|
|
389
|
-
case "Int8Array":
|
|
390
|
-
case "Uint8Array":
|
|
391
|
-
case "Uint8ClampedArray":
|
|
392
|
-
case "Int16Array":
|
|
393
|
-
case "Uint16Array":
|
|
394
|
-
case "Int32Array":
|
|
395
|
-
case "Uint32Array":
|
|
396
|
-
case "Float32Array":
|
|
397
|
-
case "Float64Array":
|
|
398
|
-
case "ArrayBuffer":
|
|
399
|
-
break;
|
|
400
|
-
default:
|
|
401
|
-
return !1;
|
|
402
|
-
}
|
|
403
|
-
var g = Ye(t);
|
|
404
|
-
if (g.length !== Ye(e).length)
|
|
405
|
-
return !1;
|
|
406
|
-
var m = n.concat([t]), I = r.concat([e]);
|
|
407
|
-
for (l = g.length - 1; l >= 0; ) {
|
|
408
|
-
var v = g[l];
|
|
409
|
-
if (!(Ae(v, e) && Ne(e[v], t[v], m, I)))
|
|
410
|
-
return !1;
|
|
411
|
-
l -= 1;
|
|
412
|
-
}
|
|
413
|
-
return !0;
|
|
414
|
-
}
|
|
415
|
-
var st = /* @__PURE__ */ M(function(e, n) {
|
|
416
|
-
return Ne(e, n, [], []);
|
|
417
|
-
});
|
|
418
|
-
function pn(t) {
|
|
419
|
-
return Object.prototype.toString.call(t) === "[object Object]";
|
|
420
|
-
}
|
|
421
|
-
var me = /* @__PURE__ */ M(function(e, n) {
|
|
422
|
-
return n == null || n !== n ? e : n;
|
|
423
|
-
});
|
|
424
|
-
function gn(t) {
|
|
425
|
-
var e = Object.prototype.toString.call(t);
|
|
426
|
-
return e === "[object Uint8ClampedArray]" || e === "[object Int8Array]" || e === "[object Uint8Array]" || e === "[object Int16Array]" || e === "[object Uint16Array]" || e === "[object Int32Array]" || e === "[object Uint32Array]" || e === "[object Float32Array]" || e === "[object Float64Array]" || e === "[object BigInt64Array]" || e === "[object BigUint64Array]";
|
|
427
|
-
}
|
|
428
|
-
var yn = /* @__PURE__ */ N(function(e) {
|
|
429
|
-
return e != null && typeof e["fantasy-land/empty"] == "function" ? e["fantasy-land/empty"]() : e != null && e.constructor != null && typeof e.constructor["fantasy-land/empty"] == "function" ? e.constructor["fantasy-land/empty"]() : e != null && typeof e.empty == "function" ? e.empty() : e != null && e.constructor != null && typeof e.constructor.empty == "function" ? e.constructor.empty() : Ce(e) ? [] : Ie(e) ? "" : pn(e) ? {} : at(e) ? /* @__PURE__ */ (function() {
|
|
430
|
-
return arguments;
|
|
431
|
-
})() : gn(e) ? e.constructor.from("") : void 0;
|
|
432
|
-
}), wn = /* @__PURE__ */ (function() {
|
|
433
|
-
function t(e, n) {
|
|
434
|
-
this.xf = n, this.f = e, this.idx = -1, this.found = !1;
|
|
435
|
-
}
|
|
436
|
-
return t.prototype["@@transducer/init"] = Zt.init, t.prototype["@@transducer/result"] = function(e) {
|
|
437
|
-
return this.found || (e = this.xf["@@transducer/step"](e, -1)), this.xf["@@transducer/result"](e);
|
|
438
|
-
}, t.prototype["@@transducer/step"] = function(e, n) {
|
|
439
|
-
return this.idx += 1, this.f(n) && (this.found = !0, e = Ht(this.xf["@@transducer/step"](e, this.idx))), e;
|
|
440
|
-
}, t;
|
|
441
|
-
})(), An = /* @__PURE__ */ M(function(e, n) {
|
|
442
|
-
return new wn(e, n);
|
|
443
|
-
}), X = /* @__PURE__ */ M(
|
|
444
|
-
/* @__PURE__ */ Gt([], An, function(e, n) {
|
|
445
|
-
for (var r = 0, s = n.length; r < s; ) {
|
|
446
|
-
if (e(n[r]))
|
|
447
|
-
return r;
|
|
448
|
-
r += 1;
|
|
449
|
-
}
|
|
450
|
-
return -1;
|
|
451
|
-
})
|
|
452
|
-
), mn = /* @__PURE__ */ N(function(e) {
|
|
453
|
-
return e != null && st(e, yn(e));
|
|
454
|
-
}), G = /* @__PURE__ */ Te(function(e, n, r) {
|
|
455
|
-
return st(n, ie(e, r));
|
|
456
|
-
}), Se = /* @__PURE__ */ Te(function(e, n, r) {
|
|
457
|
-
return me(e, ie(n, r));
|
|
458
|
-
}), Sn = /* @__PURE__ */ M(function(e, n) {
|
|
459
|
-
return Re(e.length, function() {
|
|
460
|
-
try {
|
|
461
|
-
return e.apply(this, arguments);
|
|
462
|
-
} catch (r) {
|
|
463
|
-
return n.apply(this, zt([r], arguments));
|
|
464
|
-
}
|
|
465
|
-
});
|
|
466
|
-
});
|
|
467
|
-
async function we() {
|
|
468
|
-
try {
|
|
469
|
-
return Bt().then(
|
|
470
|
-
(t) => {
|
|
471
|
-
var e;
|
|
472
|
-
return (e = t == null ? void 0 : t.tokens) == null ? void 0 : e.accessToken.toString();
|
|
473
|
-
}
|
|
474
|
-
);
|
|
475
|
-
} catch (t) {
|
|
476
|
-
console.error(t);
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
const Tn = () => ({
|
|
480
|
-
openConnection: async (e, n, r) => await new Promise((g, m) => {
|
|
481
|
-
const I = e + "?session=" + r + "&package=" + n;
|
|
482
|
-
console.log("Opening WebSocket connection to:", I);
|
|
483
|
-
let v = null;
|
|
484
|
-
const i = new WebSocket(I);
|
|
485
|
-
i.onopen = () => {
|
|
486
|
-
console.log("🔗 WebSocket opened for package:", n);
|
|
487
|
-
const h = { montage: "NOT_MONTAGED", packageId: n };
|
|
488
|
-
console.log("🎛️ Sending message payload"), i.send(JSON.stringify(h));
|
|
489
|
-
}, i.onclose = () => {
|
|
490
|
-
console.log("🔌 WebSocket closed for package:", n), v && v.channelDetails ? g({ res: v.channelDetails, status: "websocket closed" }) : (console.warn("No channel details received"), g({ res: null, status: "websocket closed without data" }));
|
|
491
|
-
}, i.onmessage = (h) => {
|
|
492
|
-
console.log("WebSocket message received:", h.data), v = JSON.parse(h.data), i.close();
|
|
493
|
-
}, i.onerror = (h) => {
|
|
494
|
-
console.error("WebSocket error:", h), m(h);
|
|
495
|
-
};
|
|
496
|
-
})
|
|
497
|
-
}), K = /* @__PURE__ */ new Map();
|
|
498
|
-
let rt = !1, ot = !1;
|
|
499
|
-
function be(t = "default") {
|
|
500
|
-
if (t === "default" && !rt && (rt = !0, console.warn(
|
|
501
|
-
'[TSViewer] Using default store instance. For multi-instance support, pass a unique instanceId prop to TSViewer. Example: <TSViewer instance-id="viewer-1" />'
|
|
502
|
-
)), K.has(t))
|
|
503
|
-
return K.get(t)();
|
|
504
|
-
const e = qt(`tsviewer-${t}`, () => {
|
|
505
|
-
const n = Nt({}), r = w([]), s = w("NOT_MONTAGED"), l = w({}), g = w([]), m = w(null), I = w(null), v = w({}), i = w([]), h = w({}), S = w({}), E = w("POINTER"), { openConnection: W } = Tn(), j = H(() => (a) => g.value.find((c) => c.name === a)), b = H(() => r.value.filter((a) => a.selected)), P = H(() => () => {
|
|
506
|
-
const a = i.value.find((c) => c.selected);
|
|
507
|
-
return a || (console.warn("No active layer found, available layers:", i.value), i.value.length > 0 ? i.value[0] : null);
|
|
508
|
-
}), V = () => {
|
|
509
|
-
let a = !1;
|
|
510
|
-
return i.value.forEach((c, p) => {
|
|
511
|
-
!c.id && c.id !== 0 && (console.error(`Layer at index ${p} missing ID:`, c), a = !0), c.annotations || (console.warn(`Layer at index ${p} missing annotations array:`, c), c.annotations = []);
|
|
512
|
-
}), a && console.error("Annotation layer validation failed. Layers:", i.value), !a;
|
|
513
|
-
}, x = H(() => (a) => i.value.flatMap((p) => p.annotations || []).find((p) => p.id === a)), f = (a) => {
|
|
514
|
-
v.value = a;
|
|
515
|
-
}, L = (a) => {
|
|
516
|
-
r.value = a;
|
|
517
|
-
}, _ = (a) => {
|
|
518
|
-
s.value = a;
|
|
519
|
-
}, O = (a) => {
|
|
520
|
-
l.value = a;
|
|
521
|
-
}, k = (a) => {
|
|
522
|
-
g.value = a;
|
|
523
|
-
}, D = (a) => {
|
|
524
|
-
m.value = a;
|
|
525
|
-
}, J = (a) => {
|
|
526
|
-
I.value = a;
|
|
527
|
-
}, R = (a) => {
|
|
528
|
-
Object.assign(n, a);
|
|
529
|
-
}, $ = async (a) => {
|
|
530
|
-
const c = a.packageId, p = await we();
|
|
531
|
-
let U = n.timeseriesDiscoverApi, ce = null;
|
|
532
|
-
ce = await W(U, c, p), f({ channels: ce.res, content: { id: c } });
|
|
533
|
-
}, Y = () => (a) => {
|
|
534
|
-
var p;
|
|
535
|
-
return ((p = a == null ? void 0 : a.content) == null ? void 0 : p.state) === "READY";
|
|
536
|
-
}, Q = (a) => {
|
|
537
|
-
const c = a.map((p) => (!p.id && p.id !== 0 && (console.warn("Annotation layer missing ID:", p), p.id = Math.random().toString(36).substr(2, 9)), p.annotations || (p.annotations = []), p.name || (p.name = `Layer ${p.id}`), p));
|
|
538
|
-
i.value = c, console.log("Set annotations with validated structure:", c);
|
|
539
|
-
}, se = (a) => {
|
|
540
|
-
if (!a && a !== 0) {
|
|
541
|
-
console.error("setActiveAnnotationLayer called with invalid layerId:", a);
|
|
542
|
-
return;
|
|
543
|
-
}
|
|
544
|
-
h.value = a, i.value.forEach((p) => p.selected = !1);
|
|
545
|
-
const c = X(G("id", a), i.value);
|
|
546
|
-
c >= 0 ? (i.value[c].selected = !0, console.log("Successfully set active layer:", i.value[c])) : console.error("Layer with ID not found:", a, "Available layers:", i.value);
|
|
547
|
-
}, q = (a) => {
|
|
548
|
-
if (i.value.forEach(
|
|
549
|
-
(c) => {
|
|
550
|
-
var p;
|
|
551
|
-
return (p = c.annotations) == null ? void 0 : p.forEach((U) => U.selected = !1);
|
|
552
|
-
}
|
|
553
|
-
), a.id) {
|
|
554
|
-
const c = X(G("id", a.layer_id), i.value);
|
|
555
|
-
if (c >= 0) {
|
|
556
|
-
const p = X(G("id", a.id), i.value[c].annotations);
|
|
557
|
-
p >= 0 && (i.value[c].annotations[p].selected = !0);
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
|
-
S.value = a;
|
|
561
|
-
}, ee = (a) => {
|
|
562
|
-
E.value = a;
|
|
563
|
-
}, B = (a) => {
|
|
564
|
-
if (!a.id && a.id !== 0) {
|
|
565
|
-
console.error("Cannot create layer without ID:", a);
|
|
566
|
-
return;
|
|
567
|
-
}
|
|
568
|
-
const c = {
|
|
569
|
-
id: a.id,
|
|
570
|
-
name: a.name || `Layer ${a.id}`,
|
|
571
|
-
description: a.description || "",
|
|
572
|
-
visible: a.visible !== void 0 ? a.visible : !0,
|
|
573
|
-
selected: a.selected || !1,
|
|
574
|
-
annotations: a.annotations || [],
|
|
575
|
-
color: a.color,
|
|
576
|
-
hexColor: a.hexColor,
|
|
577
|
-
bkColor: a.bkColor,
|
|
578
|
-
selColor: a.selColor,
|
|
579
|
-
userId: a.userId,
|
|
580
|
-
...a
|
|
581
|
-
// Spread any additional properties
|
|
582
|
-
};
|
|
583
|
-
i.value.push(c), console.log("Created layer with validated structure:", c);
|
|
584
|
-
}, le = (a) => {
|
|
585
|
-
const c = X(G("id", a.id), i.value);
|
|
586
|
-
if (c >= 0) {
|
|
587
|
-
const p = Object.assign(i.value[c], a);
|
|
588
|
-
i.value[c] = p;
|
|
589
|
-
}
|
|
590
|
-
}, ve = (a) => {
|
|
591
|
-
const c = X(G("id", a.id), i.value);
|
|
592
|
-
c >= 0 && i.value.splice(c, 1);
|
|
593
|
-
}, te = (a) => {
|
|
594
|
-
const c = X(G("id", a.layer_id), i.value);
|
|
595
|
-
c >= 0 && (i.value[c].annotations || (i.value[c].annotations = []), i.value[c].annotations.push(a), q(a));
|
|
596
|
-
}, ne = (a) => {
|
|
597
|
-
const c = X(G("id", a.layer_id), i.value);
|
|
598
|
-
if (c >= 0) {
|
|
599
|
-
const p = i.value[c].annotations, U = X(G("id", a.id), p);
|
|
600
|
-
U >= 0 && (p[U] = a);
|
|
601
|
-
}
|
|
602
|
-
}, y = (a) => {
|
|
603
|
-
const c = X(G("id", a.layer_id), i.value);
|
|
604
|
-
if (c >= 0) {
|
|
605
|
-
const p = i.value[c].annotations, U = X(G("id", a.id), p);
|
|
606
|
-
U >= 0 && p.splice(U, 1);
|
|
607
|
-
}
|
|
608
|
-
}, T = (a, c, p) => {
|
|
609
|
-
const U = r.value.find((ce) => ce.id === a);
|
|
610
|
-
U && (U[c] = p);
|
|
611
|
-
};
|
|
612
|
-
return {
|
|
613
|
-
// State
|
|
614
|
-
viewerChannels: r,
|
|
615
|
-
viewerMontageScheme: s,
|
|
616
|
-
customMontageMap: l,
|
|
617
|
-
workspaceMontages: g,
|
|
618
|
-
viewerErrors: m,
|
|
619
|
-
needsRerender: I,
|
|
620
|
-
viewerAnnotations: i,
|
|
621
|
-
activeAnnotationLayer: h,
|
|
622
|
-
activeAnnotation: S,
|
|
623
|
-
activeViewer: v,
|
|
624
|
-
viewerActiveTool: E,
|
|
625
|
-
config: n,
|
|
626
|
-
// Getters
|
|
627
|
-
getMontageMessageByName: j,
|
|
628
|
-
viewerSelectedChannels: b,
|
|
629
|
-
getViewerActiveLayer: P,
|
|
630
|
-
getAnnotationById: x,
|
|
631
|
-
// Actions
|
|
632
|
-
setChannels: L,
|
|
633
|
-
setViewerMontageScheme: _,
|
|
634
|
-
setCustomMontageMap: O,
|
|
635
|
-
setWorkspaceMontages: k,
|
|
636
|
-
setViewerErrors: D,
|
|
637
|
-
setAnnotations: Q,
|
|
638
|
-
setActiveAnnotationLayer: se,
|
|
639
|
-
setActiveAnnotation: q,
|
|
640
|
-
setActiveTool: ee,
|
|
641
|
-
createLayer: B,
|
|
642
|
-
updateLayer: le,
|
|
643
|
-
deleteLayer: ve,
|
|
644
|
-
createAnnotation: te,
|
|
645
|
-
updateAnnotation: ne,
|
|
646
|
-
deleteAnnotation: y,
|
|
647
|
-
updateChannelProperty: T,
|
|
648
|
-
updateChannelVisibility: (a, c) => {
|
|
649
|
-
T(a, "visible", c);
|
|
650
|
-
},
|
|
651
|
-
updateChannelSelection: (a, c) => {
|
|
652
|
-
T(a, "selected", c);
|
|
653
|
-
},
|
|
654
|
-
updateChannelFilter: (a, c) => {
|
|
655
|
-
T(a, "filter", c);
|
|
656
|
-
},
|
|
657
|
-
validateAnnotationLayers: V,
|
|
658
|
-
resetViewer: () => {
|
|
659
|
-
r.value = [], s.value = "NOT_MONTAGED", l.value = {}, g.value = [], m.value = null, i.value = [], h.value = {}, S.value = {}, E.value = "POINTER", v.value = {}, Object.keys(n).forEach((a) => {
|
|
660
|
-
delete n[a];
|
|
661
|
-
});
|
|
662
|
-
},
|
|
663
|
-
triggerRerender: (a) => {
|
|
664
|
-
J({
|
|
665
|
-
timestamp: Date.now(),
|
|
666
|
-
cause: a
|
|
667
|
-
});
|
|
668
|
-
},
|
|
669
|
-
resetRerenderTrigger: () => {
|
|
670
|
-
I.value = null;
|
|
671
|
-
},
|
|
672
|
-
isTSFileProcessed: Y,
|
|
673
|
-
fetchAndSetActiveViewer: $,
|
|
674
|
-
setActiveViewer: f,
|
|
675
|
-
setViewerConfig: R
|
|
676
|
-
};
|
|
677
|
-
});
|
|
678
|
-
return K.set(t, e), e();
|
|
679
|
-
}
|
|
680
|
-
function Cn(t) {
|
|
681
|
-
K.has(t) && (K.get(t)().resetViewer(), K.delete(t));
|
|
682
|
-
}
|
|
683
|
-
function Mn() {
|
|
684
|
-
K.forEach((t, e) => {
|
|
685
|
-
t().resetViewer();
|
|
686
|
-
}), K.clear();
|
|
687
|
-
}
|
|
688
|
-
function Wn() {
|
|
689
|
-
return ot || (ot = !0, console.warn(
|
|
690
|
-
"[TSViewer] useViewerStore() is deprecated. Use createViewerStore(instanceId) for multi-instance support."
|
|
691
|
-
)), be("default");
|
|
692
|
-
}
|
|
693
|
-
function In(t) {
|
|
694
|
-
if (useRoute().name === "docs-login")
|
|
695
|
-
return;
|
|
696
|
-
me(!1, ie("shouldShowToast", t));
|
|
697
|
-
const n = me(!1, ie("shouldRedirect", t));
|
|
698
|
-
this.clearState(), n && this.$route.fullPath;
|
|
699
|
-
}
|
|
700
|
-
const bn = (t) => Object.prototype.toString.call(t) === "[object String]", _n = (t) => {
|
|
701
|
-
Object.keys(t).forEach((e) => {
|
|
702
|
-
bn(t[e]) && (t[e] = t[e].trim());
|
|
703
|
-
});
|
|
704
|
-
};
|
|
705
|
-
function $n(t, e) {
|
|
706
|
-
if (!t)
|
|
707
|
-
return Promise.reject({ status: 400, message: "Url is missing!" });
|
|
708
|
-
const n = Se("GET", "method", e), r = Se({}, "header", e), s = Object.assign({}, { "Content-type": "application/json" }, r), l = ie("body", e);
|
|
709
|
-
let g = { headers: s, method: n };
|
|
710
|
-
if (l) {
|
|
711
|
-
typeof l == "object" && _n(l);
|
|
712
|
-
const m = JSON.stringify(l);
|
|
713
|
-
g = Object.assign({}, g, { body: m });
|
|
714
|
-
}
|
|
715
|
-
return fetch(t, g).then((m) => m.status >= 400 ? Promise.reject(m) : m.json().catch(() => m));
|
|
716
|
-
}
|
|
717
|
-
function ke(t) {
|
|
718
|
-
const e = ie("status", t);
|
|
719
|
-
let n;
|
|
720
|
-
if (e === void 0) {
|
|
721
|
-
console.log(t);
|
|
722
|
-
return;
|
|
723
|
-
} else
|
|
724
|
-
n = t.status;
|
|
725
|
-
if (n === 400 && t.body)
|
|
726
|
-
t.body.getReader().read().then(({ done: r, value: s }) => {
|
|
727
|
-
const l = s instanceof Uint8Array ? String.fromCharCode.apply(null, s) : s;
|
|
728
|
-
Qe(me(l), Sn(Qe(ie("message"), JSON.parse), (g, m) => m))(l);
|
|
729
|
-
});
|
|
730
|
-
else if (n === 401)
|
|
731
|
-
return In();
|
|
732
|
-
}
|
|
733
|
-
function En(t = null) {
|
|
734
|
-
const e = t || jt("viewerStore", null) || be("default"), { viewerChannels: n, viewerAnnotations: r } = De(e), s = (v) => v.id || "", l = (v) => {
|
|
735
|
-
v.sort(function(h, S) {
|
|
736
|
-
return h.start < S.start ? -1 : h.start > S.start ? 1 : 0;
|
|
737
|
-
});
|
|
738
|
-
};
|
|
739
|
-
return {
|
|
740
|
-
// Computed properties
|
|
741
|
-
viewerChannels: n,
|
|
742
|
-
// Now from Pinia
|
|
743
|
-
viewerAnnotations: r,
|
|
744
|
-
// Now from Pinia
|
|
745
|
-
// Methods
|
|
746
|
-
addAnnotation: async (v = null) => {
|
|
747
|
-
const i = v || activeAnnotation.value;
|
|
748
|
-
if (console.log("🔧 useTsAnnotation: addAnnotation called with:", i), !i || !i.layer_id)
|
|
749
|
-
throw new TypeError("Missing annotation data or layer_id", i);
|
|
750
|
-
if (i.id)
|
|
751
|
-
throw new TypeError("Trying to create an annotation that already exists", i.id);
|
|
752
|
-
let h = i.start, S = i.duration || i.end - i.start;
|
|
753
|
-
const E = i.label, W = i.description, j = i.layer_id;
|
|
754
|
-
if (!E)
|
|
755
|
-
throw new Error("Annotation label is required");
|
|
756
|
-
if (h == null)
|
|
757
|
-
throw new Error("Annotation start time is required");
|
|
758
|
-
S < 0 && (S = -S, h = h - S);
|
|
759
|
-
let b = [];
|
|
760
|
-
if (console.log("🔧 useTsAnnotation: Processing channelIds...", {
|
|
761
|
-
hasChannelIds: i.channelIds && Array.isArray(i.channelIds),
|
|
762
|
-
allChannels: i.allChannels,
|
|
763
|
-
providedChannelIds: i.channelIds,
|
|
764
|
-
availableChannels: n.value.length
|
|
765
|
-
// Now from Pinia
|
|
766
|
-
}), i.allChannels) {
|
|
767
|
-
console.log("🔧 useTsAnnotation: allChannels=true, adding all visible channels");
|
|
768
|
-
const f = e.activeViewer.value.channels;
|
|
769
|
-
for (let L = 0; L < f.length; L++) {
|
|
770
|
-
const O = f[L].content.id;
|
|
771
|
-
b.push(O), console.log("🔧 useTsAnnotation: Added channel ID:", O);
|
|
772
|
-
}
|
|
773
|
-
} else if (i.channelIds && Array.isArray(i.channelIds) && i.channelIds.length > 0)
|
|
774
|
-
b = i.channelIds, console.log("🔧 useTsAnnotation: Using provided channelIds:", b);
|
|
775
|
-
else {
|
|
776
|
-
console.log("🔧 useTsAnnotation: Computing from selected channels");
|
|
777
|
-
for (let f = 0; f < n.value.length; f++) {
|
|
778
|
-
const L = n.value[f];
|
|
779
|
-
if (L.selected && L.visible) {
|
|
780
|
-
const _ = s(L);
|
|
781
|
-
b.push(_), console.log("🔧 useTsAnnotation: Added selected channel ID:", _);
|
|
782
|
-
}
|
|
783
|
-
}
|
|
784
|
-
}
|
|
785
|
-
console.log("🔧 useTsAnnotation: Final channelIds:", b);
|
|
786
|
-
const P = {
|
|
787
|
-
label: E,
|
|
788
|
-
name: E,
|
|
789
|
-
description: W || "",
|
|
790
|
-
start: Math.floor(h),
|
|
791
|
-
end: Math.floor(h + S),
|
|
792
|
-
channelIds: b
|
|
793
|
-
};
|
|
794
|
-
console.log("🔧 useTsAnnotation: API payload:", P);
|
|
795
|
-
const V = e.activeViewer.value.content.id, x = `${e.config.apiUrl}/timeseries/${V}/layers/${j}/annotations`;
|
|
796
|
-
console.log("🔧 useTsAnnotation: API URL:", x);
|
|
797
|
-
try {
|
|
798
|
-
const f = await we(), L = await fetch(`${x}?api_key=${f}`, {
|
|
799
|
-
method: "POST",
|
|
800
|
-
headers: {
|
|
801
|
-
"Content-Type": "application/json",
|
|
802
|
-
Accept: "application/json"
|
|
803
|
-
},
|
|
804
|
-
body: JSON.stringify(P)
|
|
805
|
-
});
|
|
806
|
-
if (!L.ok) {
|
|
807
|
-
const D = await L.text();
|
|
808
|
-
throw new Error(`HTTP ${L.status}: ${D}`);
|
|
809
|
-
}
|
|
810
|
-
const _ = await L.json();
|
|
811
|
-
console.log("🔧 useTsAnnotation: API success:", _);
|
|
812
|
-
const O = {
|
|
813
|
-
name: "",
|
|
814
|
-
id: _.id,
|
|
815
|
-
label: _.label,
|
|
816
|
-
description: _.description,
|
|
817
|
-
start: _.start,
|
|
818
|
-
duration: _.end - _.start,
|
|
819
|
-
end: _.end,
|
|
820
|
-
cStart: null,
|
|
821
|
-
cEnd: null,
|
|
822
|
-
selected: !0,
|
|
823
|
-
channelIds: _.channelIds || b,
|
|
824
|
-
allChannels: b.length === 0 || b.length >= n.value.length,
|
|
825
|
-
// Use Pinia
|
|
826
|
-
layer_id: j,
|
|
827
|
-
userId: _.userId
|
|
828
|
-
};
|
|
829
|
-
_.linkedPackage && (O.linkedPackage = _.linkedPackage);
|
|
830
|
-
let k = 0;
|
|
831
|
-
for (let D = 0; D < r.value.length; D++)
|
|
832
|
-
if (r.value[D].id === j) {
|
|
833
|
-
k = D;
|
|
834
|
-
break;
|
|
835
|
-
}
|
|
836
|
-
return e.createAnnotation(O), r.value[k] && r.value[k].annotations && l(r.value[k].annotations), O;
|
|
837
|
-
} catch (f) {
|
|
838
|
-
throw console.error("🔧 useTsAnnotation: Error creating annotation:", f), ke(f), f;
|
|
839
|
-
}
|
|
840
|
-
},
|
|
841
|
-
updateAnnotation: async (v = null) => {
|
|
842
|
-
const i = v || activeAnnotation.value;
|
|
843
|
-
if (console.log("🔧 useTsAnnotation: updateAnnotation called with:", i), !i.id)
|
|
844
|
-
throw new TypeError("Trying to update an annotation that doesn't exist on server", i.id);
|
|
845
|
-
if (!i.layer_id)
|
|
846
|
-
throw new TypeError("Missing layer_id for annotation update", i);
|
|
847
|
-
let h = i.start, S = i.duration || i.end - i.start;
|
|
848
|
-
S < 0 && (S = -S, h = h - S);
|
|
849
|
-
const E = {
|
|
850
|
-
label: i.label,
|
|
851
|
-
description: i.description || "",
|
|
852
|
-
start: Math.floor(h),
|
|
853
|
-
end: Math.floor(h + S),
|
|
854
|
-
channelIds: i.channelIds || []
|
|
855
|
-
};
|
|
856
|
-
console.log("🔧 useTsAnnotation: Update API payload:", E);
|
|
857
|
-
const W = e.activeViewer.value.content.id, j = `${e.config.apiUrl}/timeseries/${W}/layers/${i.layer_id}/annotations/${i.id}`;
|
|
858
|
-
console.log("🔧 useTsAnnotation: Update API URL:", j);
|
|
859
|
-
try {
|
|
860
|
-
const b = await we(), P = await fetch(`${j}?api_key=${b}`, {
|
|
861
|
-
method: "PUT",
|
|
862
|
-
headers: {
|
|
863
|
-
"Content-Type": "application/json",
|
|
864
|
-
Accept: "application/json"
|
|
865
|
-
},
|
|
866
|
-
body: JSON.stringify(E)
|
|
867
|
-
});
|
|
868
|
-
if (!P.ok) {
|
|
869
|
-
const f = await P.text();
|
|
870
|
-
throw new Error(`HTTP ${P.status}: ${f}`);
|
|
871
|
-
}
|
|
872
|
-
const V = await P.json();
|
|
873
|
-
console.log("🔧 useTsAnnotation: Update API success:", V);
|
|
874
|
-
const x = {
|
|
875
|
-
...i,
|
|
876
|
-
...V,
|
|
877
|
-
duration: V.end - V.start
|
|
878
|
-
};
|
|
879
|
-
return e.updateAnnotation(x), V;
|
|
880
|
-
} catch (b) {
|
|
881
|
-
throw console.error("🔧 useTsAnnotation: Error updating annotation:", b), ke(b), b;
|
|
882
|
-
}
|
|
883
|
-
},
|
|
884
|
-
removeAnnotation: async (v) => {
|
|
885
|
-
if (!v || !v.id)
|
|
886
|
-
throw new TypeError("Invalid annotation for deletion", v);
|
|
887
|
-
let i = "";
|
|
888
|
-
if (v.layer ? i = v.layer.id : i = v.layer_id, !i)
|
|
889
|
-
throw new TypeError("Missing layer_id for annotation deletion", v);
|
|
890
|
-
const h = e.activeViewer.value.content.id, S = `${e.config.apiUrl}/timeseries/${h}/layers/${i}/annotations/${v.id}`;
|
|
891
|
-
console.log("🔧 useTsAnnotation: Delete API URL:", S);
|
|
892
|
-
try {
|
|
893
|
-
const E = await we(), W = await fetch(`${S}?api_key=${E}`, {
|
|
894
|
-
method: "DELETE",
|
|
895
|
-
headers: {
|
|
896
|
-
Accept: "application/json"
|
|
897
|
-
}
|
|
898
|
-
});
|
|
899
|
-
if (!W.ok) {
|
|
900
|
-
const j = await W.text();
|
|
901
|
-
throw new Error(`HTTP ${W.status}: ${j}`);
|
|
902
|
-
}
|
|
903
|
-
return console.log("🔧 useTsAnnotation: Delete API success"), e.deleteAnnotation(v), !0;
|
|
904
|
-
} catch (E) {
|
|
905
|
-
throw console.error("🔧 useTsAnnotation: Error deleting annotation:", E), ke(E), E;
|
|
906
|
-
}
|
|
907
|
-
},
|
|
908
|
-
sortAnns: l,
|
|
909
|
-
getChannelId: s
|
|
910
|
-
};
|
|
911
|
-
}
|
|
912
|
-
const Vn = (t, e) => {
|
|
913
|
-
const n = t.__vccOpts || t;
|
|
914
|
-
for (const [r, s] of e)
|
|
915
|
-
n[r] = s;
|
|
916
|
-
return n;
|
|
917
|
-
}, On = { id: "channelCanvas" }, Ln = ["data-id"], Pn = ["hidden"], kn = ["hidden"], Dn = {
|
|
918
|
-
__name: "TSViewer",
|
|
919
|
-
props: {
|
|
920
|
-
pkg: {
|
|
921
|
-
type: Object,
|
|
922
|
-
default: () => {
|
|
923
|
-
}
|
|
924
|
-
},
|
|
925
|
-
isPreview: {
|
|
926
|
-
type: Boolean,
|
|
927
|
-
default: !1
|
|
928
|
-
},
|
|
929
|
-
sidePanelOpen: {
|
|
930
|
-
type: Boolean,
|
|
931
|
-
default: !1
|
|
932
|
-
},
|
|
933
|
-
/**
|
|
934
|
-
* Unique identifier for this viewer instance.
|
|
935
|
-
* Required when running multiple TSViewer components on the same page.
|
|
936
|
-
* Each instance should have a unique ID to ensure isolated state.
|
|
937
|
-
*/
|
|
938
|
-
instanceId: {
|
|
939
|
-
type: String,
|
|
940
|
-
default: "default"
|
|
941
|
-
}
|
|
942
|
-
},
|
|
943
|
-
setup(t, { expose: e }) {
|
|
944
|
-
const n = re(() => import("./TSScrubber-9ABMW6b2.js")), r = re(() => import("./TSViewerCanvas-A6HgBZ4E.js").then((o) => o.T)), s = re(() => import("./TSViewerToolbar-CO68rvXF.js")), l = re(() => import("./TSFilterModal-C1-o1zyF.js")), g = re(() => import("./TSAnnotationModal-DpLHrHfV.js")), m = re(() => import("./TsAnnotationDeleteDialog-D9eQGzqE.js")), I = re(() => import("./TSViewerLayerWindow-Dnij6c3F.js")), v = {
|
|
945
|
-
TIMEUNIT: "microSeconds",
|
|
946
|
-
// Basis for time
|
|
947
|
-
XOFFSET: 0,
|
|
948
|
-
// X-offset of graph in canvas
|
|
949
|
-
XGRIDSPACING: 1e6,
|
|
950
|
-
// Time in microseconds between vertical lines
|
|
951
|
-
NRPXPERLABEL: 150,
|
|
952
|
-
// Number of pixels per label on x-axis
|
|
953
|
-
USEREALTIME: !0,
|
|
954
|
-
// If true than interpret timepoints as UTC microseconds.
|
|
955
|
-
DEFAULTDPI: 96,
|
|
956
|
-
// Default pixels per inch
|
|
957
|
-
ANNOTATIONLABELHEIGHT: 20,
|
|
958
|
-
// Height of annotation label
|
|
959
|
-
ROUNDDATAPIXELS: !1,
|
|
960
|
-
// If true, canvas point will be rounded to integer pixels for faster render (faster)
|
|
961
|
-
MINMAXPOLYGON: !0,
|
|
962
|
-
// If true, then polygon is rendered thru minMax values, otherwise vertical lines (faster)
|
|
963
|
-
PAGESIZEDIVIDER: 0.5,
|
|
964
|
-
// Number of pages that span the current canvas.
|
|
965
|
-
PREFETCHPAGES: 5,
|
|
966
|
-
// Number of pages to read ahead of view.
|
|
967
|
-
LIMITANNFETCH: 500,
|
|
968
|
-
// Maximum number of annotations that are fetched per request
|
|
969
|
-
USEMEDIAN: !1,
|
|
970
|
-
// Use Median instead of mean for centering channels
|
|
971
|
-
CURSOROFFSET: 5,
|
|
972
|
-
// Offset of cursor canvas
|
|
973
|
-
SEGMENTSPAN: 12096e8,
|
|
974
|
-
// One week of gap-data is returned per request.
|
|
975
|
-
MAXRECURSION: 20,
|
|
976
|
-
// Maximum recursion depth of gap-data requests (max 2 years)
|
|
977
|
-
MAXDURATION: 6e8,
|
|
978
|
-
// Maximum duration window (5min)
|
|
979
|
-
INITDURATION: 15e6
|
|
980
|
-
// Initial duration window (15sec)
|
|
981
|
-
}, i = t, h = be(i.instanceId), { viewerChannels: S, needsRerender: E } = De(h);
|
|
982
|
-
qe("viewerStore", h), qe("viewerInstanceId", i.instanceId);
|
|
983
|
-
const {
|
|
984
|
-
addAnnotation: W,
|
|
985
|
-
updateAnnotation: j,
|
|
986
|
-
removeAnnotation: b
|
|
987
|
-
} = En(h), P = w(null), V = w(null), x = w(null), f = w(null), L = w(null), _ = w(null), O = w(null), k = w(null), D = w(0), J = w(0), R = w(0), $ = w(0), Y = w(0), Q = w(0), se = w(0), q = w(1), ee = w(1 / 10), B = w(!1), le = w(!1), ve = w(null), te = w(!1), ne = w(!1), y = H(() => h.activeViewer), T = H(() => S.value.map((o) => ({
|
|
988
|
-
...o,
|
|
989
|
-
selected: !!o.selected
|
|
990
|
-
}))), z = H(() => T.value.filter((o) => o.visible)), Z = H(() => {
|
|
991
|
-
let o = !1;
|
|
992
|
-
return Q.value / _e.value < 30 && (o = !0), o;
|
|
993
|
-
}), _e = H(() => z.value.length), he = async () => {
|
|
994
|
-
if (console.log("onresize..."), !P.value)
|
|
995
|
-
return;
|
|
996
|
-
const o = document.getElementById("ts_viewer");
|
|
997
|
-
if (!o)
|
|
998
|
-
return;
|
|
999
|
-
const d = window.getComputedStyle(o, null), u = parseInt(d.getPropertyValue("height")), A = i.isPreview ? 0 : 100;
|
|
1000
|
-
D.value = u - A, await de(), J.value = P.value.offsetWidth;
|
|
1001
|
-
const F = x.value;
|
|
1002
|
-
F && (se.value = F.clientWidth, Y.value = J.value - F.clientWidth - 16, Q.value = D.value - 40);
|
|
1003
|
-
};
|
|
1004
|
-
Ve(() => y.value, async (o, d) => {
|
|
1005
|
-
var u, A, F;
|
|
1006
|
-
(u = V.value) != null && u.resetComponentState && V.value.resetComponentState(), o && o.channels && o.channels.length > 0 && $e(), Fe(), await de(), (A = V.value) != null && A.initSegmentSpans && V.value.initSegmentSpans(), (F = V.value) != null && F.getAnnotations && V.value.getAnnotations();
|
|
1007
|
-
}, { immediate: !1, deep: !0 }), Ve(_e, (o, d) => {
|
|
1008
|
-
d !== void 0 && o !== d && (console.log(`Number of visible channels changed from ${d} to ${o}`), setTimeout(() => {
|
|
1009
|
-
var u;
|
|
1010
|
-
he(), (u = f.value) != null && u.renderAll && f.value.renderAll();
|
|
1011
|
-
}, 20));
|
|
1012
|
-
});
|
|
1013
|
-
const Ee = (o) => {
|
|
1014
|
-
store.dispatch("viewerModule/setActiveAnnotation", o).then(() => {
|
|
1015
|
-
f.value.renderAnnotationCanvas(), B.value = !0;
|
|
1016
|
-
});
|
|
1017
|
-
};
|
|
1018
|
-
Ve(E, (o) => {
|
|
1019
|
-
o && (console.log(`TSViewer: Re-rendering due to: ${o.cause} (${o.timestamp})`), de(() => {
|
|
1020
|
-
var d;
|
|
1021
|
-
o.cause === "channel-visibility" ? setTimeout(() => {
|
|
1022
|
-
var u;
|
|
1023
|
-
he(), (u = f.value) != null && u.renderAll && f.value.renderAll();
|
|
1024
|
-
}, 10) : (d = f.value) != null && d.renderAll && f.value.renderAll();
|
|
1025
|
-
}), h.resetRerenderTrigger(null));
|
|
1026
|
-
}, { deep: !0 });
|
|
1027
|
-
const je = (o) => {
|
|
1028
|
-
Ee(o);
|
|
1029
|
-
}, a = async (o) => {
|
|
1030
|
-
if (console.log("📍 TSViewer: onCreateUpdateAnnotation received:", o), !o || Object.keys(o).length === 0) {
|
|
1031
|
-
console.error("🚨 TSViewer: Received empty annotation!");
|
|
1032
|
-
return;
|
|
1033
|
-
}
|
|
1034
|
-
if (!o.layer_id) {
|
|
1035
|
-
console.error("🚨 TSViewer: annotation.layer_id is missing!", o);
|
|
1036
|
-
return;
|
|
1037
|
-
}
|
|
1038
|
-
B.value = !1;
|
|
1039
|
-
try {
|
|
1040
|
-
o.id ? (console.log("📍 TSViewer: Updating annotation via composable"), await j(o), c()) : (console.log("📍 TSViewer: Creating annotation via composable"), await W(o), ct()), console.log("📍 TSViewer: Annotation operation completed successfully");
|
|
1041
|
-
} catch (d) {
|
|
1042
|
-
console.error("📍 TSViewer: Error creating/updating annotation:", d), B.value = !0;
|
|
1043
|
-
}
|
|
1044
|
-
}, c = () => {
|
|
1045
|
-
f.value.renderAnnotationCanvas();
|
|
1046
|
-
}, p = (o) => {
|
|
1047
|
-
ve.value = o, te.value = !0;
|
|
1048
|
-
}, U = async (o) => {
|
|
1049
|
-
te.value = !1;
|
|
1050
|
-
try {
|
|
1051
|
-
await b(o), ce(), console.log("📍 TSViewer: Annotation deleted successfully");
|
|
1052
|
-
} catch (d) {
|
|
1053
|
-
console.error("📍 TSViewer: Error deleting annotation:", d);
|
|
1054
|
-
}
|
|
1055
|
-
}, ce = () => {
|
|
1056
|
-
f.value.renderAnnotationCanvas();
|
|
1057
|
-
}, lt = (o, d, u, A, F, pe) => {
|
|
1058
|
-
if (console.log("📍 TSViewer: onAddAnnotation called with:", {
|
|
1059
|
-
startTime: o,
|
|
1060
|
-
duration: d,
|
|
1061
|
-
allChannels: u,
|
|
1062
|
-
label: A,
|
|
1063
|
-
description: F,
|
|
1064
|
-
layer: pe
|
|
1065
|
-
}), !pe || !pe.id) {
|
|
1066
|
-
console.error("Invalid layer provided to onAddAnnotation:", pe);
|
|
1067
|
-
return;
|
|
1068
|
-
}
|
|
1069
|
-
const kt = h.viewerSelectedChannels || [], Dt = u ? [] : kt.map((Rt) => Rt.id), xe = {
|
|
1070
|
-
id: null,
|
|
1071
|
-
label: A || "Event",
|
|
1072
|
-
description: F || "",
|
|
1073
|
-
start: Math.floor(o),
|
|
1074
|
-
end: Math.floor(o + d),
|
|
1075
|
-
duration: Math.floor(d),
|
|
1076
|
-
channelIds: Dt,
|
|
1077
|
-
allChannels: u,
|
|
1078
|
-
layer_id: pe.id,
|
|
1079
|
-
selected: !0,
|
|
1080
|
-
userId: null
|
|
1081
|
-
};
|
|
1082
|
-
console.log("📍 TSViewer: Created annotation object:", xe), h.setActiveAnnotation(xe), console.log("📍 TSViewer: Store now contains:", h.activeAnnotation), B.value = !0, console.log("📍 TSViewer: Modal opened with annotation data");
|
|
1083
|
-
}, ct = () => {
|
|
1084
|
-
f.value.renderAnnotationCanvas();
|
|
1085
|
-
}, ut = (o) => {
|
|
1086
|
-
f.value.createAnnotationLayer(o);
|
|
1087
|
-
}, Ue = () => {
|
|
1088
|
-
le.value = !1;
|
|
1089
|
-
}, dt = () => {
|
|
1090
|
-
f.value.resetFocusedAnnotation(), f.value.renderAnnotationCanvas(), B.value = !1;
|
|
1091
|
-
}, ft = () => {
|
|
1092
|
-
ne.value = !1;
|
|
1093
|
-
}, vt = (o) => {
|
|
1094
|
-
o.stopPropagation(), o.preventDefault();
|
|
1095
|
-
const d = o.detail.sourceEvent.metaKey;
|
|
1096
|
-
Me({ channelId: o.currentTarget.dataset.id, append: d }), f.value.renderAll();
|
|
1097
|
-
}, ht = () => {
|
|
1098
|
-
R.value = f.value.getNextAnnotation();
|
|
1099
|
-
}, pt = () => {
|
|
1100
|
-
R.value = f.value.getPreviousAnnotation();
|
|
1101
|
-
}, gt = (o) => {
|
|
1102
|
-
We(o * 1e6);
|
|
1103
|
-
}, yt = () => {
|
|
1104
|
-
q.value = q.value * 1.25;
|
|
1105
|
-
}, wt = () => {
|
|
1106
|
-
q.value = q.value * 0.8;
|
|
1107
|
-
}, At = () => {
|
|
1108
|
-
V.value.getAnnotations();
|
|
1109
|
-
}, mt = () => {
|
|
1110
|
-
}, St = () => {
|
|
1111
|
-
console.log("Page forward triggered from toolbar");
|
|
1112
|
-
const o = Math.max(
|
|
1113
|
-
R.value - 3 / 4 * $.value,
|
|
1114
|
-
O.value
|
|
1115
|
-
);
|
|
1116
|
-
ue(o), de(() => {
|
|
1117
|
-
var d;
|
|
1118
|
-
(d = f.value) == null || d.renderAll();
|
|
1119
|
-
});
|
|
1120
|
-
}, Tt = () => {
|
|
1121
|
-
console.log("Page forward triggered from toolbar");
|
|
1122
|
-
const o = Math.min(
|
|
1123
|
-
R.value + 3 / 4 * $.value,
|
|
1124
|
-
k.value - $.value
|
|
1125
|
-
);
|
|
1126
|
-
console.log(`Moving from ${R.value} to ${o}`), ue(o), de(() => {
|
|
1127
|
-
var d, u;
|
|
1128
|
-
(d = f.value) != null && d.invalidate && f.value.invalidate(), (u = f.value) != null && u.renderAll && f.value.renderAll();
|
|
1129
|
-
});
|
|
1130
|
-
}, Ct = (o) => {
|
|
1131
|
-
let d = f.value.rsPeriod;
|
|
1132
|
-
ue(o.annotation.start - (ee.value * Y.value - v.CURSOROFFSET) * d), de(() => {
|
|
1133
|
-
var u;
|
|
1134
|
-
(u = f.value) == null || u.renderAll();
|
|
1135
|
-
});
|
|
1136
|
-
}, Me = (o) => {
|
|
1137
|
-
const d = S.value.map((u) => {
|
|
1138
|
-
const A = u.selected;
|
|
1139
|
-
return o.append === !1 && (u.selected = !1), o.channelId === u.id && (u.selected = !A), u;
|
|
1140
|
-
});
|
|
1141
|
-
h.setChannels(d);
|
|
1142
|
-
}, It = (o, d) => {
|
|
1143
|
-
const u = S.value.map((A) => (d === !1 && (A.selected = !1), A.id in o && (A.selected = !0), A));
|
|
1144
|
-
h.setChannels(u);
|
|
1145
|
-
}, ue = (o) => {
|
|
1146
|
-
R.value = o;
|
|
1147
|
-
}, bt = (o) => {
|
|
1148
|
-
ee.value = o;
|
|
1149
|
-
}, _t = (o) => {
|
|
1150
|
-
q.value = o;
|
|
1151
|
-
}, We = (o) => {
|
|
1152
|
-
o > v.MAXDURATION ? $.value = v.MAXDURATION : $.value = o;
|
|
1153
|
-
}, Et = (o, d, u) => (v.DEFAULTDPI * window.devicePixelRatio / (d * u) / 25.4).toFixed(1) + " " + o.unit + "/mm", $e = () => {
|
|
1154
|
-
var d;
|
|
1155
|
-
const o = (d = y.value) == null ? void 0 : d.channels;
|
|
1156
|
-
if (console.log("🔄 initTimeRange called with channels:", (o == null ? void 0 : o.length) || 0), o && o.length > 0) {
|
|
1157
|
-
O.value = o[0].start, k.value = o[0].end;
|
|
1158
|
-
for (let A = 1; A < o.length; A++)
|
|
1159
|
-
o[A].start < O.value && (O.value = o[A].start), o[A].end > k.value && (k.value = o[A].end);
|
|
1160
|
-
const u = R.value;
|
|
1161
|
-
R.value = O.value, console.log("📅 Time range initialized:", {
|
|
1162
|
-
ts_start: O.value,
|
|
1163
|
-
ts_end: k.value,
|
|
1164
|
-
oldStart: u,
|
|
1165
|
-
newStart: R.value,
|
|
1166
|
-
duration: $.value,
|
|
1167
|
-
startDate: new Date(O.value / 1e3).toISOString(),
|
|
1168
|
-
endDate: new Date(k.value / 1e3).toISOString()
|
|
1169
|
-
});
|
|
1170
|
-
} else
|
|
1171
|
-
console.warn("⚠️ initTimeRange: No channels found in activeViewer");
|
|
1172
|
-
}, Vt = () => {
|
|
1173
|
-
$e();
|
|
1174
|
-
}, Ot = (o) => {
|
|
1175
|
-
le.value = !0;
|
|
1176
|
-
}, Lt = (o) => {
|
|
1177
|
-
const d = Se([], "channels", o), u = Se("", "filter", o), A = L.value;
|
|
1178
|
-
A.onChannels = d, mn(u) ? (A.input0 = NaN, A.input1 = NaN, A.selectedFilter = null, A.selectedNotch = null) : (A.input0 = u.input0, A.input1 = u.input1), ne.value = !0;
|
|
1179
|
-
}, Pt = (o) => {
|
|
1180
|
-
f.value.setFilters(o);
|
|
1181
|
-
}, Fe = () => {
|
|
1182
|
-
var o, d;
|
|
1183
|
-
(o = f.value) == null || o.initViewerCanvas(), (d = f.value) == null || d.renderAll();
|
|
1184
|
-
};
|
|
1185
|
-
return Ut(() => {
|
|
1186
|
-
Vt();
|
|
1187
|
-
const o = document.getElementById("ts_viewer");
|
|
1188
|
-
if (!o) {
|
|
1189
|
-
console.warn("ts_viewer element not found");
|
|
1190
|
-
return;
|
|
1191
|
-
}
|
|
1192
|
-
var d = window.getComputedStyle(o, null);
|
|
1193
|
-
const u = parseInt(d.getPropertyValue("height")), A = i.isPreview ? 0 : 100;
|
|
1194
|
-
D.value = u - A, P.value && (J.value = P.value.offsetWidth), window.addEventListener("resize", he);
|
|
1195
|
-
const F = x.value;
|
|
1196
|
-
F && (se.value = F.clientWidth, Y.value = J.value - F.clientWidth - 5 - 10, Q.value = D.value - 88), $.value = v.INITDURATION, Fe();
|
|
1197
|
-
}), Mt(() => {
|
|
1198
|
-
window.removeEventListener("resize", he), Cn(i.instanceId);
|
|
1199
|
-
}), e({
|
|
1200
|
-
openEditAnnotationDialog: Ee,
|
|
1201
|
-
confirmDeleteAnnotation: p,
|
|
1202
|
-
selectAnnotation: Ct,
|
|
1203
|
-
selectChannel: Me,
|
|
1204
|
-
selectChannels: It,
|
|
1205
|
-
openLayerWindow: Ot,
|
|
1206
|
-
openFilterWindow: Lt,
|
|
1207
|
-
setTimeseriesFilters: Pt
|
|
1208
|
-
}), (o, d) => (ye(), Oe("div", {
|
|
1209
|
-
id: "ts_viewer",
|
|
1210
|
-
ref_key: "ts_viewer",
|
|
1211
|
-
ref: P,
|
|
1212
|
-
class: Le([t.isPreview ? "timeseries-viewer preview" : "timeseries-viewer"])
|
|
1213
|
-
}, [
|
|
1214
|
-
fe(oe(n), {
|
|
1215
|
-
ref_key: "scrubber",
|
|
1216
|
-
ref: V,
|
|
1217
|
-
ts_start: O.value,
|
|
1218
|
-
ts_end: k.value,
|
|
1219
|
-
"c-width": Y.value,
|
|
1220
|
-
"label-width": se.value,
|
|
1221
|
-
"cursor-loc": ee.value,
|
|
1222
|
-
start: R.value,
|
|
1223
|
-
duration: $.value,
|
|
1224
|
-
constants: v,
|
|
1225
|
-
"active-viewer": y.value,
|
|
1226
|
-
onSetStart: ue
|
|
1227
|
-
}, null, 8, ["ts_start", "ts_end", "c-width", "label-width", "cursor-loc", "start", "duration", "active-viewer"]),
|
|
1228
|
-
ge("div", On, [
|
|
1229
|
-
ge("div", {
|
|
1230
|
-
id: "channelLabels",
|
|
1231
|
-
ref_key: "channelLabels",
|
|
1232
|
-
ref: x
|
|
1233
|
-
}, [
|
|
1234
|
-
(ye(!0), Oe(Ft, null, xt(z.value, (u) => (ye(), Oe("div", {
|
|
1235
|
-
key: u.displayName,
|
|
1236
|
-
class: "chLabelWrap",
|
|
1237
|
-
"data-id": u.id,
|
|
1238
|
-
onTap: vt
|
|
1239
|
-
}, [
|
|
1240
|
-
ge("div", {
|
|
1241
|
-
class: Le([u.selected ? "labelDiv selected" : "labelDiv"])
|
|
1242
|
-
}, Be(u.displayName), 3),
|
|
1243
|
-
ge("div", {
|
|
1244
|
-
class: Le(["chLabelIndWrap", [u.selected ? "selected" : ""]]),
|
|
1245
|
-
hidden: Z.value
|
|
1246
|
-
}, [
|
|
1247
|
-
ge("div", {
|
|
1248
|
-
class: "chLabelInd",
|
|
1249
|
-
hidden: Z.value
|
|
1250
|
-
}, Be(Et(u, q.value, u.rowScale)), 9, kn)
|
|
1251
|
-
], 10, Pn)
|
|
1252
|
-
], 40, Ln))), 128))
|
|
1253
|
-
], 512),
|
|
1254
|
-
fe(oe(r), {
|
|
1255
|
-
ref_key: "viewerCanvas",
|
|
1256
|
-
ref: f,
|
|
1257
|
-
window_height: D.value,
|
|
1258
|
-
window_width: J.value,
|
|
1259
|
-
duration: $.value,
|
|
1260
|
-
start: R.value,
|
|
1261
|
-
"c-width": Y.value,
|
|
1262
|
-
"c-height": Q.value,
|
|
1263
|
-
constants: v,
|
|
1264
|
-
"ts-start": O.value,
|
|
1265
|
-
"ts-end": k.value,
|
|
1266
|
-
"cursor-loc": ee.value,
|
|
1267
|
-
"global-zoom-mult": q.value,
|
|
1268
|
-
"active-viewer": y.value,
|
|
1269
|
-
onSetStart: ue,
|
|
1270
|
-
onSetCursor: bt,
|
|
1271
|
-
onSetGlobalZoom: _t,
|
|
1272
|
-
onSetDuration: We,
|
|
1273
|
-
onChannelsInitialized: mt,
|
|
1274
|
-
onAnnLayersInitialized: At,
|
|
1275
|
-
onCloseAnnotationLayerWindow: Ue,
|
|
1276
|
-
onAddAnnotation: lt,
|
|
1277
|
-
onUpdateAnnotation: je
|
|
1278
|
-
}, null, 8, ["window_height", "window_width", "duration", "start", "c-width", "c-height", "ts-start", "ts-end", "cursor-loc", "global-zoom-mult", "active-viewer"])
|
|
1279
|
-
]),
|
|
1280
|
-
t.isPreview ? $t("", !0) : (ye(), Wt(oe(s), {
|
|
1281
|
-
key: 0,
|
|
1282
|
-
constants: v,
|
|
1283
|
-
duration: $.value,
|
|
1284
|
-
start: R.value,
|
|
1285
|
-
onPageBack: St,
|
|
1286
|
-
onPageForward: Tt,
|
|
1287
|
-
onIncrementZoom: yt,
|
|
1288
|
-
onDecrementZoom: wt,
|
|
1289
|
-
onUpdateDuration: gt,
|
|
1290
|
-
onNextAnnotation: ht,
|
|
1291
|
-
onPreviousAnnotation: pt,
|
|
1292
|
-
onSetStart: ue
|
|
1293
|
-
}, null, 8, ["duration", "start"])),
|
|
1294
|
-
fe(oe(l), {
|
|
1295
|
-
ref_key: "filterWindow",
|
|
1296
|
-
ref: L,
|
|
1297
|
-
visible: ne.value,
|
|
1298
|
-
"onUpdate:visible": d[0] || (d[0] = (u) => ne.value = u),
|
|
1299
|
-
onCloseWindow: ft
|
|
1300
|
-
}, null, 8, ["visible"]),
|
|
1301
|
-
fe(oe(g), {
|
|
1302
|
-
ref_key: "annotationModal",
|
|
1303
|
-
ref: _,
|
|
1304
|
-
visible: B.value,
|
|
1305
|
-
"onUpdate:visible": d[1] || (d[1] = (u) => B.value = u),
|
|
1306
|
-
onCloseWindow: dt,
|
|
1307
|
-
onCreateUpdateAnnotation: a
|
|
1308
|
-
}, null, 8, ["visible"]),
|
|
1309
|
-
fe(oe(m), {
|
|
1310
|
-
visible: te.value,
|
|
1311
|
-
"delete-annotation": ve.value,
|
|
1312
|
-
"onUpdate:visible": d[2] || (d[2] = (u) => te.value = u),
|
|
1313
|
-
onDelete: U
|
|
1314
|
-
}, null, 8, ["visible", "delete-annotation"]),
|
|
1315
|
-
fe(oe(I), {
|
|
1316
|
-
visible: le.value,
|
|
1317
|
-
onCloseWindow: Ue,
|
|
1318
|
-
onCreateLayer: ut
|
|
1319
|
-
}, null, 8, ["visible"])
|
|
1320
|
-
], 2));
|
|
1321
|
-
}
|
|
1322
|
-
}, Rn = /* @__PURE__ */ Vn(Dn, [["__scopeId", "data-v-7aeaeec1"]]);
|
|
1323
|
-
function Fn(t = "default") {
|
|
1324
|
-
const e = be(t), {
|
|
1325
|
-
viewerChannels: n,
|
|
1326
|
-
viewerAnnotations: r,
|
|
1327
|
-
viewerActiveTool: s,
|
|
1328
|
-
viewerSelectedChannels: l,
|
|
1329
|
-
activeAnnotation: g,
|
|
1330
|
-
activeAnnotationLayer: m,
|
|
1331
|
-
viewerMontageScheme: I,
|
|
1332
|
-
viewerErrors: v,
|
|
1333
|
-
config: i,
|
|
1334
|
-
activeViewer: h
|
|
1335
|
-
} = De(e), S = ae(n), E = H(() => l.value), W = ae(r), j = ae(s), b = ae(I), P = ae(v), V = ae(i), x = ae(h);
|
|
1336
|
-
return {
|
|
1337
|
-
// Readonly state
|
|
1338
|
-
channels: S,
|
|
1339
|
-
selectedChannels: E,
|
|
1340
|
-
annotations: W,
|
|
1341
|
-
activeTool: j,
|
|
1342
|
-
montageScheme: b,
|
|
1343
|
-
errors: P,
|
|
1344
|
-
viewerConfig: V,
|
|
1345
|
-
viewer: x,
|
|
1346
|
-
// State queries
|
|
1347
|
-
getChannel: (y) => n.value.find((T) => T.id === y),
|
|
1348
|
-
getAnnotation: (y) => e.getAnnotationById(y),
|
|
1349
|
-
getActiveLayer: () => e.getViewerActiveLayer(),
|
|
1350
|
-
getVisibleChannels: () => n.value.filter((y) => y.visible),
|
|
1351
|
-
getState: () => ({
|
|
1352
|
-
channels: n.value,
|
|
1353
|
-
selectedChannels: l.value,
|
|
1354
|
-
annotations: r.value,
|
|
1355
|
-
activeLayer: e.getViewerActiveLayer(),
|
|
1356
|
-
activeTool: s.value,
|
|
1357
|
-
montageScheme: I.value,
|
|
1358
|
-
errors: v.value
|
|
1359
|
-
}),
|
|
1360
|
-
// Channel controls
|
|
1361
|
-
selectChannels: (y, T = !1) => {
|
|
1362
|
-
const z = n.value.map((Z) => ({
|
|
1363
|
-
...Z,
|
|
1364
|
-
selected: T ? Z.selected : !1
|
|
1365
|
-
}));
|
|
1366
|
-
z.forEach((Z) => {
|
|
1367
|
-
y.includes(Z.id) && (Z.selected = !0);
|
|
1368
|
-
}), e.setChannels(z);
|
|
1369
|
-
},
|
|
1370
|
-
clearChannelSelection: () => {
|
|
1371
|
-
const y = n.value.map((T) => ({
|
|
1372
|
-
...T,
|
|
1373
|
-
selected: !1
|
|
1374
|
-
}));
|
|
1375
|
-
e.setChannels(y);
|
|
1376
|
-
},
|
|
1377
|
-
toggleChannelVisibility: (y) => {
|
|
1378
|
-
const T = n.value.find((z) => z.id === y);
|
|
1379
|
-
T && (e.updateChannelVisibility(y, !T.visible), e.triggerRerender("channel-visibility"));
|
|
1380
|
-
},
|
|
1381
|
-
setChannelVisibility: (y, T) => {
|
|
1382
|
-
e.updateChannelVisibility(y, T), e.triggerRerender("channel-visibility");
|
|
1383
|
-
},
|
|
1384
|
-
showAllChannels: () => {
|
|
1385
|
-
n.value.forEach((y) => {
|
|
1386
|
-
e.updateChannelVisibility(y.id, !0);
|
|
1387
|
-
}), e.triggerRerender("channel-visibility");
|
|
1388
|
-
},
|
|
1389
|
-
hideAllChannels: () => {
|
|
1390
|
-
n.value.forEach((y) => {
|
|
1391
|
-
e.updateChannelVisibility(y.id, !1);
|
|
1392
|
-
}), e.triggerRerender("channel-visibility");
|
|
1393
|
-
},
|
|
1394
|
-
// Annotation controls
|
|
1395
|
-
selectAnnotation: (y) => {
|
|
1396
|
-
const T = e.getAnnotationById(y);
|
|
1397
|
-
T && e.setActiveAnnotation(T);
|
|
1398
|
-
},
|
|
1399
|
-
setActiveLayer: (y) => {
|
|
1400
|
-
e.setActiveAnnotationLayer(y);
|
|
1401
|
-
},
|
|
1402
|
-
toggleLayerVisibility: (y) => {
|
|
1403
|
-
const T = r.value.find((z) => z.id === y);
|
|
1404
|
-
T && (T.visible = !T.visible, e.updateLayer(T), e.triggerRerender("layer-visibility"));
|
|
1405
|
-
},
|
|
1406
|
-
// Tool controls
|
|
1407
|
-
setActiveTool: (y) => {
|
|
1408
|
-
e.setActiveTool(y);
|
|
1409
|
-
},
|
|
1410
|
-
// Viewer controls
|
|
1411
|
-
setConfig: (y) => {
|
|
1412
|
-
e.setViewerConfig(y);
|
|
1413
|
-
},
|
|
1414
|
-
setActiveViewer: (y) => {
|
|
1415
|
-
e.setActiveViewer(y);
|
|
1416
|
-
},
|
|
1417
|
-
triggerRerender: (y = "external") => {
|
|
1418
|
-
e.triggerRerender(y);
|
|
1419
|
-
},
|
|
1420
|
-
reset: () => {
|
|
1421
|
-
e.resetViewer();
|
|
1422
|
-
},
|
|
1423
|
-
// Direct store access (for advanced use cases)
|
|
1424
|
-
store: e
|
|
1425
|
-
};
|
|
1426
|
-
}
|
|
1427
|
-
const xn = {
|
|
1428
|
-
install(t) {
|
|
1429
|
-
t.component("TSViewer", Rn);
|
|
1430
|
-
}
|
|
1431
|
-
};
|
|
1432
|
-
export {
|
|
1433
|
-
Rn as T,
|
|
1434
|
-
C as _,
|
|
1435
|
-
Re as a,
|
|
1436
|
-
M as b,
|
|
1437
|
-
N as c,
|
|
1438
|
-
Zt as d,
|
|
1439
|
-
Gt as e,
|
|
1440
|
-
tn as f,
|
|
1441
|
-
Vn as g,
|
|
1442
|
-
be as h,
|
|
1443
|
-
$n as i,
|
|
1444
|
-
ke as j,
|
|
1445
|
-
Ye as k,
|
|
1446
|
-
Ht as l,
|
|
1447
|
-
G as m,
|
|
1448
|
-
an as n,
|
|
1449
|
-
me as o,
|
|
1450
|
-
Se as p,
|
|
1451
|
-
on as q,
|
|
1452
|
-
Te as r,
|
|
1453
|
-
Cn as s,
|
|
1454
|
-
Mn as t,
|
|
1455
|
-
we as u,
|
|
1456
|
-
Fn as v,
|
|
1457
|
-
Wn as w,
|
|
1458
|
-
xn as x
|
|
1459
|
-
};
|