@uwrl/qc-utils 0.0.17 → 0.0.19
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/README.md +56 -0
- package/dist/index.js +2149 -893
- package/dist/index.umd.cjs +15 -5
- package/package.json +61 -56
- package/dist/index.d.ts +0 -4
- package/dist/models/dataSource.d.ts +0 -173
- package/dist/models/index.d.ts +0 -2
- package/dist/models/payload.d.ts +0 -24
- package/dist/models/settings.d.ts +0 -65
- package/dist/models/timestamp.d.ts +0 -150
- package/dist/services/__tests__/createPatchObject.spec.d.ts +0 -1
- package/dist/services/__tests__/requestInterceptor.spec.d.ts +0 -1
- package/dist/services/__tests__/responseInterceptor.spec.d.ts +0 -1
- package/dist/services/api.d.ts +0 -147
- package/dist/services/apiMethods.d.ts +0 -8
- package/dist/services/createPatchObject.d.ts +0 -17
- package/dist/services/getCSRFToken.d.ts +0 -1
- package/dist/services/index.d.ts +0 -6
- package/dist/services/requestInterceptor.d.ts +0 -12
- package/dist/services/responseInterceptor.d.ts +0 -2
- package/dist/types/index.d.ts +0 -350
- package/dist/utils/__tests__/ellapsed-time.spec.d.ts +0 -1
- package/dist/utils/__tests__/format.spec.d.ts +0 -1
- package/dist/utils/__tests__/notifications.spec.d.ts +0 -1
- package/dist/utils/__tests__/observations.spec.d.ts +0 -1
- package/dist/utils/ellapsed-time.d.ts +0 -4
- package/dist/utils/format.d.ts +0 -5
- package/dist/utils/index.d.ts +0 -5
- package/dist/utils/notifications.d.ts +0 -46
- package/dist/utils/observations.d.ts +0 -5
- package/dist/utils/plotting/__tests__/delete-data.worker.spec.d.ts +0 -1
- package/dist/utils/plotting/__tests__/mock.d.ts +0 -4
- package/dist/utils/plotting/__tests__/observation-record.spec.d.ts +0 -1
- package/dist/utils/plotting/add-data.worker.d.ts +0 -0
- package/dist/utils/plotting/delete-data.worker.d.ts +0 -0
- package/dist/utils/plotting/drift-correction.worker.d.ts +0 -0
- package/dist/utils/plotting/fill-gaps.worker.d.ts +0 -0
- package/dist/utils/plotting/interpolate.worker.d.ts +0 -0
- package/dist/utils/plotting/observation-record.d.ts +0 -155
- package/dist/utils/plotting/shift-datetimes.worker.d.ts +0 -0
package/dist/index.js
CHANGED
|
@@ -1,22 +1,5 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
3
|
-
"Less than": (e, t) => e < t,
|
|
4
|
-
"Less than or equal to": (e, t) => e <= t,
|
|
5
|
-
"Greater than": (e, t) => e > t,
|
|
6
|
-
"Greater than or equal to": (e, t) => e >= t,
|
|
7
|
-
Equal: (e, t) => e == t,
|
|
8
|
-
"Start datetime": (e, t) => e == t,
|
|
9
|
-
"End datetime": (e, t) => e == t
|
|
10
|
-
};
|
|
11
|
-
var R = /* @__PURE__ */ ((e) => (e.ADD = "ADD", e.SUB = "SUB", e.MULT = "MULT", e.DIV = "DIV", e.ASSIGN = "ASSIGN", e))(R || {}), je = /* @__PURE__ */ ((e) => (e.LT = "Less than", e.LTE = "Less than or equal to", e.GT = "Greater than", e.GTE = "Greater than or equal to", e.E = "Equal", e))(je || {});
|
|
12
|
-
const ie = {
|
|
13
|
-
"Less than": (e, t) => e < t,
|
|
14
|
-
"Less than or equal to": (e, t) => e <= t,
|
|
15
|
-
"Greater than": (e, t) => e > t,
|
|
16
|
-
"Greater than or equal to": (e, t) => e >= t,
|
|
17
|
-
Equal: (e, t) => e == t
|
|
18
|
-
};
|
|
19
|
-
class He {
|
|
1
|
+
var D = /* @__PURE__ */ ((e) => (e.SECOND = "s", e.MINUTE = "m", e.HOUR = "h", e.DAY = "D", e.WEEK = "W", e.MONTH = "M", e.YEAR = "Y", e))(D || {}), E = /* @__PURE__ */ ((e) => (e.ADD_POINTS = "ADD_POINTS", e.CHANGE_VALUES = "CHANGE_VALUES", e.ASSIGN_VALUES_BULK = "ASSIGN_VALUES_BULK", e.DELETE_POINTS = "DELETE_POINTS", e.DRIFT_CORRECTION = "DRIFT_CORRECTION", e.INTERPOLATE = "INTERPOLATE", e.SHIFT_DATETIMES = "SHIFT_DATETIMES", e.ASSIGN_DATETIMES_BULK = "ASSIGN_DATETIMES_BULK", e.FILL_GAPS = "FILL_GAPS", e))(E || {}), v = /* @__PURE__ */ ((e) => (e.FIND_GAPS = "FIND_GAPS", e.PERSISTENCE = "PERSISTENCE", e.CHANGE = "CHANGE", e.RATE_OF_CHANGE = "RATE_OF_CHANGE", e.VALUE_THRESHOLD = "VALUE_THRESHOLD", e.DATETIME_RANGE = "DATETIME_RANGE", e.SELECTION = "SELECTION", e))(v || {}), q = /* @__PURE__ */ ((e) => (e.LT = "Less than", e.LTE = "Less than or equal to", e.GT = "Greater than", e.GTE = "Greater than or equal to", e.E = "Equal", e))(q || {}), Pt = /* @__PURE__ */ ((e) => (e.ADD = "ADD", e.SUB = "SUB", e.MULT = "MULT", e.DIV = "DIV", e.ASSIGN = "ASSIGN", e))(Pt || {}), Bt = /* @__PURE__ */ ((e) => (e.LT = "Less than", e.LTE = "Less than or equal to", e.GT = "Greater than", e.GTE = "Greater than or equal to", e.E = "Equal", e))(Bt || {});
|
|
2
|
+
class Nt {
|
|
20
3
|
id;
|
|
21
4
|
thingId;
|
|
22
5
|
link;
|
|
@@ -28,7 +11,7 @@ class He {
|
|
|
28
11
|
this.id = "", this.thingId = "", this.link = "", this.frequency = null, this.path = "HydroShare", this.datastreamIds = [], this.publicResource = !1;
|
|
29
12
|
}
|
|
30
13
|
}
|
|
31
|
-
class
|
|
14
|
+
class Hr extends Nt {
|
|
32
15
|
resourceTitle;
|
|
33
16
|
resourceAbstract;
|
|
34
17
|
resourceKeywords;
|
|
@@ -36,7 +19,7 @@ class wt extends He {
|
|
|
36
19
|
super(), this.resourceTitle = void 0, this.resourceAbstract = void 0, this.resourceKeywords = void 0;
|
|
37
20
|
}
|
|
38
21
|
}
|
|
39
|
-
class
|
|
22
|
+
class jt {
|
|
40
23
|
latitude;
|
|
41
24
|
longitude;
|
|
42
25
|
elevation_m;
|
|
@@ -48,11 +31,11 @@ class Ge {
|
|
|
48
31
|
this.elevationDatum = "WGS84", this.state = "", this.county = "", this.country = "";
|
|
49
32
|
}
|
|
50
33
|
}
|
|
51
|
-
class
|
|
34
|
+
class zr {
|
|
52
35
|
id;
|
|
53
36
|
workspaceId;
|
|
54
37
|
name;
|
|
55
|
-
location = new
|
|
38
|
+
location = new jt();
|
|
56
39
|
tags;
|
|
57
40
|
hydroShareArchive;
|
|
58
41
|
siteType;
|
|
@@ -65,7 +48,7 @@ class Tt {
|
|
|
65
48
|
this.id = "", this.workspaceId = "", this.name = "", this.tags = [], this.siteType = "", this.samplingFeatureCode = "", this.isPrivate = !1, this.description = "", this.samplingFeatureType = "Site", this.dataDisclaimer = "";
|
|
66
49
|
}
|
|
67
50
|
}
|
|
68
|
-
class
|
|
51
|
+
class Xr {
|
|
69
52
|
id;
|
|
70
53
|
workspaceId;
|
|
71
54
|
name;
|
|
@@ -95,7 +78,7 @@ class At {
|
|
|
95
78
|
this.id = "", this.workspaceId = "", this.name = "", this.description = "", this.thingId = t || "", this.observationType = "OM_Measurement", this.resultType = "Time Series Coverage", this.sampledMedium = "", this.noDataValue = -9999, this.aggregationStatistic = "", this.unitId = "", this.observedPropertyId = "", this.sensorId = "", this.processingLevelId = "", this.timeAggregationInterval = null, this.timeAggregationIntervalUnit = "seconds", this.isPrivate = !0, this.isVisible = !0, this.valueCount = 0;
|
|
96
79
|
}
|
|
97
80
|
}
|
|
98
|
-
class
|
|
81
|
+
class Vr {
|
|
99
82
|
id;
|
|
100
83
|
workspaceId;
|
|
101
84
|
name;
|
|
@@ -106,7 +89,7 @@ class Lt {
|
|
|
106
89
|
this.id = "", this.workspaceId = "", this.name = "", this.symbol = "", this.definition = "", this.type = "";
|
|
107
90
|
}
|
|
108
91
|
}
|
|
109
|
-
class
|
|
92
|
+
class qr {
|
|
110
93
|
id;
|
|
111
94
|
workspaceId;
|
|
112
95
|
name;
|
|
@@ -122,7 +105,7 @@ class It {
|
|
|
122
105
|
this.id = "", this.workspaceId = "", this.name = "", this.description = "", this.manufacturer = "", this.model = "", this.methodType = "Instrument Deployment", this.methodCode = "", this.methodLink = "", this.encodingType = "application/json", this.modelLink = "";
|
|
123
106
|
}
|
|
124
107
|
}
|
|
125
|
-
class
|
|
108
|
+
class Jr {
|
|
126
109
|
id;
|
|
127
110
|
workspaceId;
|
|
128
111
|
name;
|
|
@@ -134,7 +117,7 @@ class Dt {
|
|
|
134
117
|
this.id = "", this.workspaceId = "", this.name = "", this.definition = "", this.description = "", this.type = "Hydrology", this.code = "";
|
|
135
118
|
}
|
|
136
119
|
}
|
|
137
|
-
class
|
|
120
|
+
class Kr {
|
|
138
121
|
id;
|
|
139
122
|
workspaceId;
|
|
140
123
|
code;
|
|
@@ -144,7 +127,7 @@ class Ot {
|
|
|
144
127
|
this.id = "", this.workspaceId = "", this.code = "", this.definition = "", this.explanation = "";
|
|
145
128
|
}
|
|
146
129
|
}
|
|
147
|
-
class
|
|
130
|
+
class Qr {
|
|
148
131
|
id;
|
|
149
132
|
workspaceId;
|
|
150
133
|
code;
|
|
@@ -153,7 +136,7 @@ class kt {
|
|
|
153
136
|
this.id = "", this.workspaceId = "", this.code = "", this.description = "";
|
|
154
137
|
}
|
|
155
138
|
}
|
|
156
|
-
class
|
|
139
|
+
class Zr {
|
|
157
140
|
name;
|
|
158
141
|
code;
|
|
159
142
|
type;
|
|
@@ -162,7 +145,7 @@ class Ft {
|
|
|
162
145
|
constructor() {
|
|
163
146
|
}
|
|
164
147
|
}
|
|
165
|
-
class
|
|
148
|
+
class en {
|
|
166
149
|
id;
|
|
167
150
|
email;
|
|
168
151
|
password;
|
|
@@ -180,7 +163,7 @@ class Pt {
|
|
|
180
163
|
this.id = "", this.email = "", this.password = "", this.firstName = "", this.middleName = "", this.lastName = "", this.phone = "", this.address = "", this.type = "", this.link = "", this.accountType = "standard", this.hydroShareConnected = !1;
|
|
181
164
|
}
|
|
182
165
|
}
|
|
183
|
-
class
|
|
166
|
+
class tn {
|
|
184
167
|
id;
|
|
185
168
|
name;
|
|
186
169
|
iconLink;
|
|
@@ -190,8 +173,8 @@ class Rt {
|
|
|
190
173
|
this.id = "", this.name = "", this.iconLink = "", this.signupEnabled = !0, this.connectEnabled = !0;
|
|
191
174
|
}
|
|
192
175
|
}
|
|
193
|
-
var
|
|
194
|
-
class
|
|
176
|
+
var Wt = /* @__PURE__ */ ((e) => (e.Global = "*", e.View = "view", e.Create = "create", e.Edit = "edit", e.Delete = "delete", e))(Wt || {}), Gt = /* @__PURE__ */ ((e) => (e.Global = "*", e.Workspace = "Workspace", e.Collaborator = "Collaborator", e.Thing = "Thing", e.Datastream = "Datastream", e.Sensor = "Sensor", e.Unit = "Unit", e.ObservedProperty = "ObservedProperty", e.ProcessingLevel = "ProcessingLevel", e.Observation = "Observation", e))(Gt || {});
|
|
177
|
+
class rn {
|
|
195
178
|
id = "";
|
|
196
179
|
key = "";
|
|
197
180
|
name = "";
|
|
@@ -206,7 +189,7 @@ class xt {
|
|
|
206
189
|
Object.assign(this, t);
|
|
207
190
|
}
|
|
208
191
|
}
|
|
209
|
-
class
|
|
192
|
+
class nn {
|
|
210
193
|
id;
|
|
211
194
|
name;
|
|
212
195
|
isPrivate;
|
|
@@ -217,7 +200,7 @@ class Nt {
|
|
|
217
200
|
this.id = "", this.name = "", this.isPrivate = !1, this.owner = null, this.collaboratorRole = null, this.pendingTransferTo = null;
|
|
218
201
|
}
|
|
219
202
|
}
|
|
220
|
-
class
|
|
203
|
+
class sn {
|
|
221
204
|
user;
|
|
222
205
|
role;
|
|
223
206
|
constructor() {
|
|
@@ -240,25 +223,25 @@ class Ct {
|
|
|
240
223
|
};
|
|
241
224
|
}
|
|
242
225
|
}
|
|
243
|
-
function
|
|
226
|
+
function lt() {
|
|
244
227
|
const e = "csrftoken=", r = decodeURIComponent(document.cookie).split(";");
|
|
245
|
-
for (const
|
|
246
|
-
const
|
|
247
|
-
if (
|
|
248
|
-
return
|
|
228
|
+
for (const n of r) {
|
|
229
|
+
const s = n.trim();
|
|
230
|
+
if (s.startsWith(e))
|
|
231
|
+
return s.substring(e.length);
|
|
249
232
|
}
|
|
250
233
|
return null;
|
|
251
234
|
}
|
|
252
|
-
function
|
|
235
|
+
function ut(e) {
|
|
253
236
|
let t = e.headers ? { ...e.headers } : {}, r;
|
|
254
|
-
return e.body !== void 0 && (r = typeof e.body == "string" || e.body instanceof FormData ? e.body : JSON.stringify(e.body)), t["X-CSRFToken"] =
|
|
237
|
+
return e.body !== void 0 && (r = typeof e.body == "string" || e.body instanceof FormData ? e.body : JSON.stringify(e.body)), t["X-CSRFToken"] = lt() || "", {
|
|
255
238
|
...e,
|
|
256
239
|
headers: t,
|
|
257
240
|
body: r,
|
|
258
241
|
credentials: "omit"
|
|
259
242
|
};
|
|
260
243
|
}
|
|
261
|
-
function
|
|
244
|
+
function Yt(e) {
|
|
262
245
|
if (Array.isArray(e?.errors) && e.errors.length && (e = e.errors[0]), typeof e != "object" || e === null)
|
|
263
246
|
return "An unknown error occurred.";
|
|
264
247
|
const t = ["message", "detail", "error"];
|
|
@@ -266,7 +249,7 @@ function qe(e) {
|
|
|
266
249
|
if (e[r]) return e[r];
|
|
267
250
|
return "An unknown error occurred.";
|
|
268
251
|
}
|
|
269
|
-
async function
|
|
252
|
+
async function ht(e) {
|
|
270
253
|
if (e.headers.get("Content-Length") === "0" || e.statusText === "No Content")
|
|
271
254
|
return null;
|
|
272
255
|
const t = e.headers.get("content-type") || "";
|
|
@@ -274,158 +257,158 @@ async function Te(e) {
|
|
|
274
257
|
if (t.includes("application/json"))
|
|
275
258
|
try {
|
|
276
259
|
r = await e.json();
|
|
277
|
-
} catch (
|
|
278
|
-
console.error("Failed to parse error JSON:",
|
|
260
|
+
} catch (s) {
|
|
261
|
+
console.error("Failed to parse error JSON:", s);
|
|
279
262
|
}
|
|
280
263
|
else if (t.includes("text/csv"))
|
|
281
264
|
try {
|
|
282
265
|
r = await e.blob();
|
|
283
|
-
} catch (
|
|
284
|
-
console.error("Failed to parse error JSON:",
|
|
266
|
+
} catch (s) {
|
|
267
|
+
console.error("Failed to parse error JSON:", s);
|
|
285
268
|
}
|
|
286
269
|
if (e.ok || e.status === 401) return r;
|
|
287
|
-
const
|
|
270
|
+
const n = {
|
|
288
271
|
status: e.status,
|
|
289
|
-
message:
|
|
272
|
+
message: Yt(r)
|
|
290
273
|
};
|
|
291
|
-
throw console.error("API response not OK:",
|
|
292
|
-
}
|
|
293
|
-
var
|
|
294
|
-
return
|
|
295
|
-
r.__proto__ =
|
|
296
|
-
} || function(r,
|
|
297
|
-
for (var
|
|
298
|
-
},
|
|
274
|
+
throw console.error("API response not OK:", n.message), n;
|
|
275
|
+
}
|
|
276
|
+
var ke = function(e, t) {
|
|
277
|
+
return ke = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(r, n) {
|
|
278
|
+
r.__proto__ = n;
|
|
279
|
+
} || function(r, n) {
|
|
280
|
+
for (var s in n) Object.prototype.hasOwnProperty.call(n, s) && (r[s] = n[s]);
|
|
281
|
+
}, ke(e, t);
|
|
299
282
|
};
|
|
300
|
-
function
|
|
283
|
+
function le(e, t) {
|
|
301
284
|
if (typeof t != "function" && t !== null)
|
|
302
285
|
throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
|
|
303
|
-
|
|
286
|
+
ke(e, t);
|
|
304
287
|
function r() {
|
|
305
288
|
this.constructor = e;
|
|
306
289
|
}
|
|
307
290
|
e.prototype = t === null ? Object.create(t) : (r.prototype = t.prototype, new r());
|
|
308
291
|
}
|
|
309
|
-
function
|
|
310
|
-
var t = typeof Symbol == "function" && Symbol.iterator, r = t && e[t],
|
|
292
|
+
function ve(e) {
|
|
293
|
+
var t = typeof Symbol == "function" && Symbol.iterator, r = t && e[t], n = 0;
|
|
311
294
|
if (r) return r.call(e);
|
|
312
295
|
if (e && typeof e.length == "number") return {
|
|
313
296
|
next: function() {
|
|
314
|
-
return e &&
|
|
297
|
+
return e && n >= e.length && (e = void 0), { value: e && e[n++], done: !e };
|
|
315
298
|
}
|
|
316
299
|
};
|
|
317
300
|
throw new TypeError(t ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
318
301
|
}
|
|
319
|
-
function
|
|
302
|
+
function _e(e, t) {
|
|
320
303
|
var r = typeof Symbol == "function" && e[Symbol.iterator];
|
|
321
304
|
if (!r) return e;
|
|
322
|
-
var
|
|
305
|
+
var n = r.call(e), s, a = [], o;
|
|
323
306
|
try {
|
|
324
|
-
for (; (t === void 0 || t-- > 0) && !(
|
|
325
|
-
} catch (
|
|
326
|
-
|
|
307
|
+
for (; (t === void 0 || t-- > 0) && !(s = n.next()).done; ) a.push(s.value);
|
|
308
|
+
} catch (i) {
|
|
309
|
+
o = { error: i };
|
|
327
310
|
} finally {
|
|
328
311
|
try {
|
|
329
|
-
|
|
312
|
+
s && !s.done && (r = n.return) && r.call(n);
|
|
330
313
|
} finally {
|
|
331
|
-
if (
|
|
314
|
+
if (o) throw o.error;
|
|
332
315
|
}
|
|
333
316
|
}
|
|
334
|
-
return
|
|
317
|
+
return a;
|
|
335
318
|
}
|
|
336
|
-
function
|
|
337
|
-
if (r || arguments.length === 2) for (var
|
|
338
|
-
(
|
|
339
|
-
return e.concat(
|
|
319
|
+
function Ae(e, t, r) {
|
|
320
|
+
if (r || arguments.length === 2) for (var n = 0, s = t.length, a; n < s; n++)
|
|
321
|
+
(a || !(n in t)) && (a || (a = Array.prototype.slice.call(t, 0, n)), a[n] = t[n]);
|
|
322
|
+
return e.concat(a || Array.prototype.slice.call(t));
|
|
340
323
|
}
|
|
341
|
-
function
|
|
324
|
+
function P(e) {
|
|
342
325
|
return typeof e == "function";
|
|
343
326
|
}
|
|
344
|
-
function
|
|
345
|
-
var t = function(
|
|
346
|
-
Error.call(
|
|
327
|
+
function ft(e) {
|
|
328
|
+
var t = function(n) {
|
|
329
|
+
Error.call(n), n.stack = new Error().stack;
|
|
347
330
|
}, r = e(t);
|
|
348
331
|
return r.prototype = Object.create(Error.prototype), r.prototype.constructor = r, r;
|
|
349
332
|
}
|
|
350
|
-
var
|
|
333
|
+
var de = ft(function(e) {
|
|
351
334
|
return function(r) {
|
|
352
335
|
e(this), this.message = r ? r.length + ` errors occurred during unsubscription:
|
|
353
|
-
` + r.map(function(
|
|
354
|
-
return
|
|
336
|
+
` + r.map(function(n, s) {
|
|
337
|
+
return s + 1 + ") " + n.toString();
|
|
355
338
|
}).join(`
|
|
356
339
|
`) : "", this.name = "UnsubscriptionError", this.errors = r;
|
|
357
340
|
};
|
|
358
341
|
});
|
|
359
|
-
function
|
|
342
|
+
function Le(e, t) {
|
|
360
343
|
if (e) {
|
|
361
344
|
var r = e.indexOf(t);
|
|
362
345
|
0 <= r && e.splice(r, 1);
|
|
363
346
|
}
|
|
364
347
|
}
|
|
365
|
-
var
|
|
348
|
+
var ue = (function() {
|
|
366
349
|
function e(t) {
|
|
367
350
|
this.initialTeardown = t, this.closed = !1, this._parentage = null, this._finalizers = null;
|
|
368
351
|
}
|
|
369
352
|
return e.prototype.unsubscribe = function() {
|
|
370
|
-
var t, r, s, a
|
|
353
|
+
var t, r, n, s, a;
|
|
371
354
|
if (!this.closed) {
|
|
372
355
|
this.closed = !0;
|
|
373
|
-
var
|
|
374
|
-
if (
|
|
375
|
-
if (this._parentage = null, Array.isArray(
|
|
356
|
+
var o = this._parentage;
|
|
357
|
+
if (o)
|
|
358
|
+
if (this._parentage = null, Array.isArray(o))
|
|
376
359
|
try {
|
|
377
|
-
for (var
|
|
378
|
-
var
|
|
379
|
-
|
|
360
|
+
for (var i = ve(o), l = i.next(); !l.done; l = i.next()) {
|
|
361
|
+
var f = l.value;
|
|
362
|
+
f.remove(this);
|
|
380
363
|
}
|
|
381
|
-
} catch (
|
|
382
|
-
t = { error:
|
|
364
|
+
} catch (h) {
|
|
365
|
+
t = { error: h };
|
|
383
366
|
} finally {
|
|
384
367
|
try {
|
|
385
|
-
|
|
368
|
+
l && !l.done && (r = i.return) && r.call(i);
|
|
386
369
|
} finally {
|
|
387
370
|
if (t) throw t.error;
|
|
388
371
|
}
|
|
389
372
|
}
|
|
390
373
|
else
|
|
391
|
-
|
|
392
|
-
var
|
|
393
|
-
if (
|
|
374
|
+
o.remove(this);
|
|
375
|
+
var u = this.initialTeardown;
|
|
376
|
+
if (P(u))
|
|
394
377
|
try {
|
|
395
|
-
|
|
396
|
-
} catch (
|
|
397
|
-
|
|
378
|
+
u();
|
|
379
|
+
} catch (h) {
|
|
380
|
+
a = h instanceof de ? h.errors : [h];
|
|
398
381
|
}
|
|
399
|
-
var
|
|
400
|
-
if (
|
|
382
|
+
var p = this._finalizers;
|
|
383
|
+
if (p) {
|
|
401
384
|
this._finalizers = null;
|
|
402
385
|
try {
|
|
403
|
-
for (var
|
|
404
|
-
var
|
|
386
|
+
for (var g = ve(p), y = g.next(); !y.done; y = g.next()) {
|
|
387
|
+
var d = y.value;
|
|
405
388
|
try {
|
|
406
|
-
|
|
407
|
-
} catch (
|
|
408
|
-
|
|
389
|
+
Pe(d);
|
|
390
|
+
} catch (h) {
|
|
391
|
+
a = a ?? [], h instanceof de ? a = Ae(Ae([], _e(a)), _e(h.errors)) : a.push(h);
|
|
409
392
|
}
|
|
410
393
|
}
|
|
411
|
-
} catch (
|
|
412
|
-
|
|
394
|
+
} catch (h) {
|
|
395
|
+
n = { error: h };
|
|
413
396
|
} finally {
|
|
414
397
|
try {
|
|
415
|
-
|
|
398
|
+
y && !y.done && (s = g.return) && s.call(g);
|
|
416
399
|
} finally {
|
|
417
|
-
if (
|
|
400
|
+
if (n) throw n.error;
|
|
418
401
|
}
|
|
419
402
|
}
|
|
420
403
|
}
|
|
421
|
-
if (
|
|
422
|
-
throw new
|
|
404
|
+
if (a)
|
|
405
|
+
throw new de(a);
|
|
423
406
|
}
|
|
424
407
|
}, e.prototype.add = function(t) {
|
|
425
408
|
var r;
|
|
426
409
|
if (t && t !== this)
|
|
427
410
|
if (this.closed)
|
|
428
|
-
|
|
411
|
+
Pe(t);
|
|
429
412
|
else {
|
|
430
413
|
if (t instanceof e) {
|
|
431
414
|
if (t.closed || t._hasParent(this))
|
|
@@ -442,52 +425,52 @@ var j = function() {
|
|
|
442
425
|
this._parentage = Array.isArray(r) ? (r.push(t), r) : r ? [r, t] : t;
|
|
443
426
|
}, e.prototype._removeParent = function(t) {
|
|
444
427
|
var r = this._parentage;
|
|
445
|
-
r === t ? this._parentage = null : Array.isArray(r) &&
|
|
428
|
+
r === t ? this._parentage = null : Array.isArray(r) && Le(r, t);
|
|
446
429
|
}, e.prototype.remove = function(t) {
|
|
447
430
|
var r = this._finalizers;
|
|
448
|
-
r &&
|
|
449
|
-
}, e.EMPTY = function() {
|
|
431
|
+
r && Le(r, t), t instanceof e && t._removeParent(this);
|
|
432
|
+
}, e.EMPTY = (function() {
|
|
450
433
|
var t = new e();
|
|
451
434
|
return t.closed = !0, t;
|
|
452
|
-
}(), e;
|
|
453
|
-
}(),
|
|
454
|
-
function
|
|
455
|
-
return e instanceof
|
|
435
|
+
})(), e;
|
|
436
|
+
})(), dt = ue.EMPTY;
|
|
437
|
+
function pt(e) {
|
|
438
|
+
return e instanceof ue || e && "closed" in e && P(e.remove) && P(e.add) && P(e.unsubscribe);
|
|
456
439
|
}
|
|
457
|
-
function
|
|
458
|
-
|
|
440
|
+
function Pe(e) {
|
|
441
|
+
P(e) ? e() : e.unsubscribe();
|
|
459
442
|
}
|
|
460
|
-
var
|
|
443
|
+
var Ht = {
|
|
461
444
|
Promise: void 0
|
|
462
|
-
},
|
|
445
|
+
}, zt = {
|
|
463
446
|
setTimeout: function(e, t) {
|
|
464
|
-
for (var r = [],
|
|
465
|
-
r[
|
|
466
|
-
return setTimeout.apply(void 0,
|
|
447
|
+
for (var r = [], n = 2; n < arguments.length; n++)
|
|
448
|
+
r[n - 2] = arguments[n];
|
|
449
|
+
return setTimeout.apply(void 0, Ae([e, t], _e(r)));
|
|
467
450
|
},
|
|
468
451
|
clearTimeout: function(e) {
|
|
469
452
|
return clearTimeout(e);
|
|
470
453
|
},
|
|
471
454
|
delegate: void 0
|
|
472
455
|
};
|
|
473
|
-
function
|
|
474
|
-
|
|
456
|
+
function Xt(e) {
|
|
457
|
+
zt.setTimeout(function() {
|
|
475
458
|
throw e;
|
|
476
459
|
});
|
|
477
460
|
}
|
|
478
|
-
function
|
|
461
|
+
function Be() {
|
|
479
462
|
}
|
|
480
|
-
function
|
|
463
|
+
function oe(e) {
|
|
481
464
|
e();
|
|
482
465
|
}
|
|
483
|
-
var
|
|
484
|
-
|
|
466
|
+
var yt = (function(e) {
|
|
467
|
+
le(t, e);
|
|
485
468
|
function t(r) {
|
|
486
|
-
var
|
|
487
|
-
return
|
|
469
|
+
var n = e.call(this) || this;
|
|
470
|
+
return n.isStopped = !1, r ? (n.destination = r, pt(r) && r.add(n)) : n.destination = Jt, n;
|
|
488
471
|
}
|
|
489
|
-
return t.create = function(r,
|
|
490
|
-
return new
|
|
472
|
+
return t.create = function(r, n, s) {
|
|
473
|
+
return new Te(r, n, s);
|
|
491
474
|
}, t.prototype.next = function(r) {
|
|
492
475
|
this.isStopped || this._next(r);
|
|
493
476
|
}, t.prototype.error = function(r) {
|
|
@@ -511,7 +494,7 @@ var De = function(e) {
|
|
|
511
494
|
this.unsubscribe();
|
|
512
495
|
}
|
|
513
496
|
}, t;
|
|
514
|
-
}(
|
|
497
|
+
})(ue), Vt = (function() {
|
|
515
498
|
function e(t) {
|
|
516
499
|
this.partialObserver = t;
|
|
517
500
|
}
|
|
@@ -520,77 +503,77 @@ var De = function(e) {
|
|
|
520
503
|
if (r.next)
|
|
521
504
|
try {
|
|
522
505
|
r.next(t);
|
|
523
|
-
} catch (
|
|
524
|
-
|
|
506
|
+
} catch (n) {
|
|
507
|
+
ee(n);
|
|
525
508
|
}
|
|
526
509
|
}, e.prototype.error = function(t) {
|
|
527
510
|
var r = this.partialObserver;
|
|
528
511
|
if (r.error)
|
|
529
512
|
try {
|
|
530
513
|
r.error(t);
|
|
531
|
-
} catch (
|
|
532
|
-
|
|
514
|
+
} catch (n) {
|
|
515
|
+
ee(n);
|
|
533
516
|
}
|
|
534
517
|
else
|
|
535
|
-
|
|
518
|
+
ee(t);
|
|
536
519
|
}, e.prototype.complete = function() {
|
|
537
520
|
var t = this.partialObserver;
|
|
538
521
|
if (t.complete)
|
|
539
522
|
try {
|
|
540
523
|
t.complete();
|
|
541
524
|
} catch (r) {
|
|
542
|
-
|
|
525
|
+
ee(r);
|
|
543
526
|
}
|
|
544
527
|
}, e;
|
|
545
|
-
}(),
|
|
546
|
-
|
|
547
|
-
function t(r,
|
|
548
|
-
var
|
|
549
|
-
return
|
|
528
|
+
})(), Te = (function(e) {
|
|
529
|
+
le(t, e);
|
|
530
|
+
function t(r, n, s) {
|
|
531
|
+
var a = e.call(this) || this, o;
|
|
532
|
+
return P(r) || !r ? o = {
|
|
550
533
|
next: r ?? void 0,
|
|
551
|
-
error:
|
|
552
|
-
complete:
|
|
553
|
-
} :
|
|
534
|
+
error: n ?? void 0,
|
|
535
|
+
complete: s ?? void 0
|
|
536
|
+
} : o = r, a.destination = new Vt(o), a;
|
|
554
537
|
}
|
|
555
538
|
return t;
|
|
556
|
-
}(
|
|
557
|
-
function
|
|
558
|
-
|
|
539
|
+
})(yt);
|
|
540
|
+
function ee(e) {
|
|
541
|
+
Xt(e);
|
|
559
542
|
}
|
|
560
|
-
function
|
|
543
|
+
function qt(e) {
|
|
561
544
|
throw e;
|
|
562
545
|
}
|
|
563
|
-
var
|
|
546
|
+
var Jt = {
|
|
564
547
|
closed: !0,
|
|
565
|
-
next:
|
|
566
|
-
error:
|
|
567
|
-
complete:
|
|
568
|
-
},
|
|
548
|
+
next: Be,
|
|
549
|
+
error: qt,
|
|
550
|
+
complete: Be
|
|
551
|
+
}, Kt = (function() {
|
|
569
552
|
return typeof Symbol == "function" && Symbol.observable || "@@observable";
|
|
570
|
-
}();
|
|
571
|
-
function
|
|
553
|
+
})();
|
|
554
|
+
function Qt(e) {
|
|
572
555
|
return e;
|
|
573
556
|
}
|
|
574
|
-
function
|
|
575
|
-
return e.length === 0 ?
|
|
576
|
-
return e.reduce(function(
|
|
577
|
-
return
|
|
557
|
+
function Zt(e) {
|
|
558
|
+
return e.length === 0 ? Qt : e.length === 1 ? e[0] : function(r) {
|
|
559
|
+
return e.reduce(function(n, s) {
|
|
560
|
+
return s(n);
|
|
578
561
|
}, r);
|
|
579
562
|
};
|
|
580
563
|
}
|
|
581
|
-
var
|
|
564
|
+
var Ne = (function() {
|
|
582
565
|
function e(t) {
|
|
583
566
|
t && (this._subscribe = t);
|
|
584
567
|
}
|
|
585
568
|
return e.prototype.lift = function(t) {
|
|
586
569
|
var r = new e();
|
|
587
570
|
return r.source = this, r.operator = t, r;
|
|
588
|
-
}, e.prototype.subscribe = function(t, r,
|
|
589
|
-
var
|
|
590
|
-
return
|
|
591
|
-
var
|
|
592
|
-
|
|
593
|
-
}),
|
|
571
|
+
}, e.prototype.subscribe = function(t, r, n) {
|
|
572
|
+
var s = this, a = tr(t) ? t : new Te(t, r, n);
|
|
573
|
+
return oe(function() {
|
|
574
|
+
var o = s, i = o.operator, l = o.source;
|
|
575
|
+
a.add(i ? i.call(a, l) : l ? s._subscribe(a) : s._trySubscribe(a));
|
|
576
|
+
}), a;
|
|
594
577
|
}, e.prototype._trySubscribe = function(t) {
|
|
595
578
|
try {
|
|
596
579
|
return this._subscribe(t);
|
|
@@ -598,110 +581,110 @@ var ue = function() {
|
|
|
598
581
|
t.error(r);
|
|
599
582
|
}
|
|
600
583
|
}, e.prototype.forEach = function(t, r) {
|
|
601
|
-
var
|
|
602
|
-
return r =
|
|
603
|
-
var
|
|
604
|
-
next: function(
|
|
584
|
+
var n = this;
|
|
585
|
+
return r = je(r), new r(function(s, a) {
|
|
586
|
+
var o = new Te({
|
|
587
|
+
next: function(i) {
|
|
605
588
|
try {
|
|
606
|
-
t(
|
|
607
|
-
} catch (
|
|
608
|
-
|
|
589
|
+
t(i);
|
|
590
|
+
} catch (l) {
|
|
591
|
+
a(l), o.unsubscribe();
|
|
609
592
|
}
|
|
610
593
|
},
|
|
611
|
-
error:
|
|
612
|
-
complete:
|
|
594
|
+
error: a,
|
|
595
|
+
complete: s
|
|
613
596
|
});
|
|
614
|
-
|
|
597
|
+
n.subscribe(o);
|
|
615
598
|
});
|
|
616
599
|
}, e.prototype._subscribe = function(t) {
|
|
617
600
|
var r;
|
|
618
601
|
return (r = this.source) === null || r === void 0 ? void 0 : r.subscribe(t);
|
|
619
|
-
}, e.prototype[
|
|
602
|
+
}, e.prototype[Kt] = function() {
|
|
620
603
|
return this;
|
|
621
604
|
}, e.prototype.pipe = function() {
|
|
622
605
|
for (var t = [], r = 0; r < arguments.length; r++)
|
|
623
606
|
t[r] = arguments[r];
|
|
624
|
-
return
|
|
607
|
+
return Zt(t)(this);
|
|
625
608
|
}, e.prototype.toPromise = function(t) {
|
|
626
609
|
var r = this;
|
|
627
|
-
return t =
|
|
628
|
-
var
|
|
629
|
-
r.subscribe(function(
|
|
630
|
-
return
|
|
631
|
-
}, function(
|
|
632
|
-
return
|
|
610
|
+
return t = je(t), new t(function(n, s) {
|
|
611
|
+
var a;
|
|
612
|
+
r.subscribe(function(o) {
|
|
613
|
+
return a = o;
|
|
614
|
+
}, function(o) {
|
|
615
|
+
return s(o);
|
|
633
616
|
}, function() {
|
|
634
|
-
return
|
|
617
|
+
return n(a);
|
|
635
618
|
});
|
|
636
619
|
});
|
|
637
620
|
}, e.create = function(t) {
|
|
638
621
|
return new e(t);
|
|
639
622
|
}, e;
|
|
640
|
-
}();
|
|
641
|
-
function
|
|
623
|
+
})();
|
|
624
|
+
function je(e) {
|
|
642
625
|
var t;
|
|
643
|
-
return (t = e ??
|
|
626
|
+
return (t = e ?? Ht.Promise) !== null && t !== void 0 ? t : Promise;
|
|
644
627
|
}
|
|
645
|
-
function
|
|
646
|
-
return e &&
|
|
628
|
+
function er(e) {
|
|
629
|
+
return e && P(e.next) && P(e.error) && P(e.complete);
|
|
647
630
|
}
|
|
648
|
-
function
|
|
649
|
-
return e && e instanceof
|
|
631
|
+
function tr(e) {
|
|
632
|
+
return e && e instanceof yt || er(e) && pt(e);
|
|
650
633
|
}
|
|
651
|
-
var
|
|
634
|
+
var rr = ft(function(e) {
|
|
652
635
|
return function() {
|
|
653
636
|
e(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed";
|
|
654
637
|
};
|
|
655
|
-
}),
|
|
656
|
-
|
|
638
|
+
}), gt = (function(e) {
|
|
639
|
+
le(t, e);
|
|
657
640
|
function t() {
|
|
658
641
|
var r = e.call(this) || this;
|
|
659
642
|
return r.closed = !1, r.currentObservers = null, r.observers = [], r.isStopped = !1, r.hasError = !1, r.thrownError = null, r;
|
|
660
643
|
}
|
|
661
644
|
return t.prototype.lift = function(r) {
|
|
662
|
-
var
|
|
663
|
-
return
|
|
645
|
+
var n = new We(this, this);
|
|
646
|
+
return n.operator = r, n;
|
|
664
647
|
}, t.prototype._throwIfClosed = function() {
|
|
665
648
|
if (this.closed)
|
|
666
|
-
throw new
|
|
649
|
+
throw new rr();
|
|
667
650
|
}, t.prototype.next = function(r) {
|
|
668
|
-
var
|
|
669
|
-
|
|
670
|
-
var
|
|
671
|
-
if (
|
|
672
|
-
|
|
651
|
+
var n = this;
|
|
652
|
+
oe(function() {
|
|
653
|
+
var s, a;
|
|
654
|
+
if (n._throwIfClosed(), !n.isStopped) {
|
|
655
|
+
n.currentObservers || (n.currentObservers = Array.from(n.observers));
|
|
673
656
|
try {
|
|
674
|
-
for (var
|
|
675
|
-
var
|
|
676
|
-
|
|
657
|
+
for (var o = ve(n.currentObservers), i = o.next(); !i.done; i = o.next()) {
|
|
658
|
+
var l = i.value;
|
|
659
|
+
l.next(r);
|
|
677
660
|
}
|
|
678
|
-
} catch (
|
|
679
|
-
|
|
661
|
+
} catch (f) {
|
|
662
|
+
s = { error: f };
|
|
680
663
|
} finally {
|
|
681
664
|
try {
|
|
682
|
-
|
|
665
|
+
i && !i.done && (a = o.return) && a.call(o);
|
|
683
666
|
} finally {
|
|
684
|
-
if (
|
|
667
|
+
if (s) throw s.error;
|
|
685
668
|
}
|
|
686
669
|
}
|
|
687
670
|
}
|
|
688
671
|
});
|
|
689
672
|
}, t.prototype.error = function(r) {
|
|
690
|
-
var
|
|
691
|
-
|
|
692
|
-
if (
|
|
693
|
-
|
|
694
|
-
for (var
|
|
695
|
-
|
|
673
|
+
var n = this;
|
|
674
|
+
oe(function() {
|
|
675
|
+
if (n._throwIfClosed(), !n.isStopped) {
|
|
676
|
+
n.hasError = n.isStopped = !0, n.thrownError = r;
|
|
677
|
+
for (var s = n.observers; s.length; )
|
|
678
|
+
s.shift().error(r);
|
|
696
679
|
}
|
|
697
680
|
});
|
|
698
681
|
}, t.prototype.complete = function() {
|
|
699
682
|
var r = this;
|
|
700
|
-
|
|
683
|
+
oe(function() {
|
|
701
684
|
if (r._throwIfClosed(), !r.isStopped) {
|
|
702
685
|
r.isStopped = !0;
|
|
703
|
-
for (var
|
|
704
|
-
|
|
686
|
+
for (var n = r.observers; n.length; )
|
|
687
|
+
n.shift().complete();
|
|
705
688
|
}
|
|
706
689
|
});
|
|
707
690
|
}, t.prototype.unsubscribe = function() {
|
|
@@ -718,59 +701,59 @@ var nt = Ae(function(e) {
|
|
|
718
701
|
}, t.prototype._subscribe = function(r) {
|
|
719
702
|
return this._throwIfClosed(), this._checkFinalizedStatuses(r), this._innerSubscribe(r);
|
|
720
703
|
}, t.prototype._innerSubscribe = function(r) {
|
|
721
|
-
var
|
|
722
|
-
return
|
|
723
|
-
|
|
704
|
+
var n = this, s = this, a = s.hasError, o = s.isStopped, i = s.observers;
|
|
705
|
+
return a || o ? dt : (this.currentObservers = null, i.push(r), new ue(function() {
|
|
706
|
+
n.currentObservers = null, Le(i, r);
|
|
724
707
|
}));
|
|
725
708
|
}, t.prototype._checkFinalizedStatuses = function(r) {
|
|
726
|
-
var
|
|
727
|
-
|
|
709
|
+
var n = this, s = n.hasError, a = n.thrownError, o = n.isStopped;
|
|
710
|
+
s ? r.error(a) : o && r.complete();
|
|
728
711
|
}, t.prototype.asObservable = function() {
|
|
729
|
-
var r = new
|
|
712
|
+
var r = new Ne();
|
|
730
713
|
return r.source = this, r;
|
|
731
|
-
}, t.create = function(r,
|
|
732
|
-
return new
|
|
714
|
+
}, t.create = function(r, n) {
|
|
715
|
+
return new We(r, n);
|
|
733
716
|
}, t;
|
|
734
|
-
}(
|
|
735
|
-
|
|
736
|
-
function t(r,
|
|
737
|
-
var
|
|
738
|
-
return
|
|
717
|
+
})(Ne), We = (function(e) {
|
|
718
|
+
le(t, e);
|
|
719
|
+
function t(r, n) {
|
|
720
|
+
var s = e.call(this) || this;
|
|
721
|
+
return s.destination = r, s.source = n, s;
|
|
739
722
|
}
|
|
740
723
|
return t.prototype.next = function(r) {
|
|
741
|
-
var
|
|
742
|
-
(
|
|
724
|
+
var n, s;
|
|
725
|
+
(s = (n = this.destination) === null || n === void 0 ? void 0 : n.next) === null || s === void 0 || s.call(n, r);
|
|
743
726
|
}, t.prototype.error = function(r) {
|
|
744
|
-
var
|
|
745
|
-
(
|
|
727
|
+
var n, s;
|
|
728
|
+
(s = (n = this.destination) === null || n === void 0 ? void 0 : n.error) === null || s === void 0 || s.call(n, r);
|
|
746
729
|
}, t.prototype.complete = function() {
|
|
747
|
-
var r,
|
|
748
|
-
(
|
|
730
|
+
var r, n;
|
|
731
|
+
(n = (r = this.destination) === null || r === void 0 ? void 0 : r.complete) === null || n === void 0 || n.call(r);
|
|
749
732
|
}, t.prototype._subscribe = function(r) {
|
|
750
|
-
var
|
|
751
|
-
return (
|
|
733
|
+
var n, s;
|
|
734
|
+
return (s = (n = this.source) === null || n === void 0 ? void 0 : n.subscribe(r)) !== null && s !== void 0 ? s : dt;
|
|
752
735
|
}, t;
|
|
753
|
-
}(
|
|
754
|
-
const
|
|
755
|
-
var
|
|
756
|
-
class
|
|
757
|
-
constructor(t = "", r = "info",
|
|
758
|
-
this.message = t, this.color = r, this.icon =
|
|
736
|
+
})(gt);
|
|
737
|
+
const mt = 3e3;
|
|
738
|
+
var wt = /* @__PURE__ */ ((e) => (e.Warning = "warning", e.Success = "success", e.Error = "error", e.Info = "info", e))(wt || {}), bt = /* @__PURE__ */ ((e) => (e.Success = "mdi-checkbox-marked-circle", e.Warning = "mdi-alert", e.Error = "mdi-alert-circle", e.Info = "mdi-information", e.None = "none", e))(bt || {}), St = /* @__PURE__ */ ((e) => (e.Warning = "Warning", e.Success = "Success", e.Error = "Error", e.Info = "Info", e))(St || {}), nr = /* @__PURE__ */ ((e) => (e.Center = "center", e.Left = "left", e.Right = "right", e.Bottom = "bottom", e.Top = "top", e))(nr || {});
|
|
739
|
+
class sr {
|
|
740
|
+
constructor(t = "", r = "info", n = "none", s = "Info", a = mt, o = "center", i = !1) {
|
|
741
|
+
this.message = t, this.color = r, this.icon = n, this.title = s, this.timeout = a, this.position = o, this.visible = i;
|
|
759
742
|
}
|
|
760
743
|
}
|
|
761
|
-
class
|
|
762
|
-
static subject = new
|
|
744
|
+
class or {
|
|
745
|
+
static subject = new gt();
|
|
763
746
|
static get snack$() {
|
|
764
747
|
return this.subject.asObservable();
|
|
765
748
|
}
|
|
766
749
|
static createSnackbar(t, r) {
|
|
767
750
|
this.subject.next(
|
|
768
|
-
new
|
|
751
|
+
new sr(
|
|
769
752
|
t,
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
753
|
+
wt[r],
|
|
754
|
+
bt[r],
|
|
755
|
+
St[r],
|
|
756
|
+
mt,
|
|
774
757
|
"bottom",
|
|
775
758
|
!0
|
|
776
759
|
)
|
|
@@ -805,29 +788,29 @@ class ct {
|
|
|
805
788
|
);
|
|
806
789
|
}
|
|
807
790
|
}
|
|
808
|
-
function
|
|
791
|
+
function Et(e, t) {
|
|
809
792
|
const r = {};
|
|
810
|
-
for (let
|
|
811
|
-
if (Array.isArray(t[
|
|
812
|
-
JSON.stringify(e[
|
|
813
|
-
else if (e[
|
|
814
|
-
const
|
|
815
|
-
Object.keys(
|
|
816
|
-
} else JSON.stringify(e[
|
|
793
|
+
for (let n in t)
|
|
794
|
+
if (Array.isArray(t[n]))
|
|
795
|
+
JSON.stringify(e[n]) !== JSON.stringify(t[n]) && (r[n] = t[n]);
|
|
796
|
+
else if (e[n] && typeof e[n] == "object" && t[n] && typeof t[n] == "object") {
|
|
797
|
+
const s = Et(e[n], t[n]);
|
|
798
|
+
Object.keys(s).length > 0 && (r[n] = s);
|
|
799
|
+
} else JSON.stringify(e[n]) !== JSON.stringify(t[n]) && (r[n] = t[n]);
|
|
817
800
|
return r;
|
|
818
801
|
}
|
|
819
|
-
function
|
|
802
|
+
function ar(e) {
|
|
820
803
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
821
804
|
}
|
|
822
|
-
var
|
|
823
|
-
function
|
|
824
|
-
if (
|
|
825
|
-
|
|
805
|
+
var pe, Ge;
|
|
806
|
+
function ir() {
|
|
807
|
+
if (Ge) return pe;
|
|
808
|
+
Ge = 1;
|
|
826
809
|
class e {
|
|
827
810
|
/// value;
|
|
828
811
|
/// next;
|
|
829
|
-
constructor(
|
|
830
|
-
this.value =
|
|
812
|
+
constructor(n) {
|
|
813
|
+
this.value = n, this.next = void 0;
|
|
831
814
|
}
|
|
832
815
|
}
|
|
833
816
|
class t {
|
|
@@ -838,14 +821,14 @@ function ut() {
|
|
|
838
821
|
constructor() {
|
|
839
822
|
this.clear();
|
|
840
823
|
}
|
|
841
|
-
enqueue(
|
|
842
|
-
const
|
|
843
|
-
this._head ? (this._tail.next =
|
|
824
|
+
enqueue(n) {
|
|
825
|
+
const s = new e(n);
|
|
826
|
+
this._head ? (this._tail.next = s, this._tail = s) : (this._head = s, this._tail = s), this._size++;
|
|
844
827
|
}
|
|
845
828
|
dequeue() {
|
|
846
|
-
const
|
|
847
|
-
if (
|
|
848
|
-
return this._head = this._head.next, this._size--,
|
|
829
|
+
const n = this._head;
|
|
830
|
+
if (n)
|
|
831
|
+
return this._head = this._head.next, this._size--, n.value;
|
|
849
832
|
}
|
|
850
833
|
clear() {
|
|
851
834
|
this._head = void 0, this._tail = void 0, this._size = 0;
|
|
@@ -854,91 +837,91 @@ function ut() {
|
|
|
854
837
|
return this._size;
|
|
855
838
|
}
|
|
856
839
|
*[Symbol.iterator]() {
|
|
857
|
-
let
|
|
858
|
-
for (;
|
|
859
|
-
yield
|
|
840
|
+
let n = this._head;
|
|
841
|
+
for (; n; )
|
|
842
|
+
yield n.value, n = n.next;
|
|
860
843
|
}
|
|
861
844
|
}
|
|
862
|
-
return
|
|
845
|
+
return pe = t, pe;
|
|
863
846
|
}
|
|
864
|
-
var
|
|
865
|
-
function
|
|
866
|
-
if (
|
|
867
|
-
|
|
868
|
-
const e =
|
|
869
|
-
return
|
|
847
|
+
var ye, Ye;
|
|
848
|
+
function cr() {
|
|
849
|
+
if (Ye) return ye;
|
|
850
|
+
Ye = 1;
|
|
851
|
+
const e = ir();
|
|
852
|
+
return ye = (r) => {
|
|
870
853
|
if (!((Number.isInteger(r) || r === 1 / 0) && r > 0))
|
|
871
854
|
throw new TypeError("Expected `concurrency` to be a number from 1 and up");
|
|
872
|
-
const
|
|
873
|
-
let
|
|
874
|
-
const
|
|
875
|
-
|
|
876
|
-
},
|
|
877
|
-
|
|
878
|
-
const
|
|
879
|
-
|
|
855
|
+
const n = new e();
|
|
856
|
+
let s = 0;
|
|
857
|
+
const a = () => {
|
|
858
|
+
s--, n.size > 0 && n.dequeue()();
|
|
859
|
+
}, o = async (f, u, ...p) => {
|
|
860
|
+
s++;
|
|
861
|
+
const g = (async () => f(...p))();
|
|
862
|
+
u(g);
|
|
880
863
|
try {
|
|
881
|
-
await
|
|
864
|
+
await g;
|
|
882
865
|
} catch {
|
|
883
866
|
}
|
|
884
|
-
|
|
885
|
-
},
|
|
886
|
-
|
|
887
|
-
},
|
|
888
|
-
|
|
867
|
+
a();
|
|
868
|
+
}, i = (f, u, ...p) => {
|
|
869
|
+
n.enqueue(o.bind(null, f, u, ...p)), (async () => (await Promise.resolve(), s < r && n.size > 0 && n.dequeue()()))();
|
|
870
|
+
}, l = (f, ...u) => new Promise((p) => {
|
|
871
|
+
i(f, p, ...u);
|
|
889
872
|
});
|
|
890
|
-
return Object.defineProperties(
|
|
873
|
+
return Object.defineProperties(l, {
|
|
891
874
|
activeCount: {
|
|
892
|
-
get: () =>
|
|
875
|
+
get: () => s
|
|
893
876
|
},
|
|
894
877
|
pendingCount: {
|
|
895
|
-
get: () =>
|
|
878
|
+
get: () => n.size
|
|
896
879
|
},
|
|
897
880
|
clearQueue: {
|
|
898
881
|
value: () => {
|
|
899
|
-
|
|
882
|
+
n.clear();
|
|
900
883
|
}
|
|
901
884
|
}
|
|
902
|
-
}),
|
|
903
|
-
},
|
|
885
|
+
}), l;
|
|
886
|
+
}, ye;
|
|
904
887
|
}
|
|
905
|
-
var
|
|
906
|
-
const
|
|
907
|
-
async function
|
|
908
|
-
const r =
|
|
888
|
+
var lr = cr();
|
|
889
|
+
const ur = /* @__PURE__ */ ar(lr), G = ur(10), hr = 1e3;
|
|
890
|
+
async function z(e, t) {
|
|
891
|
+
const r = ut(t);
|
|
909
892
|
try {
|
|
910
|
-
const
|
|
911
|
-
return await
|
|
912
|
-
} catch (
|
|
913
|
-
throw
|
|
893
|
+
const n = await fetch(e, r);
|
|
894
|
+
return await ht(n);
|
|
895
|
+
} catch (n) {
|
|
896
|
+
throw n instanceof TypeError && or.error("Network error. Please check your connection."), n;
|
|
914
897
|
}
|
|
915
898
|
}
|
|
916
|
-
const
|
|
899
|
+
const c = {
|
|
917
900
|
async fetch(e, t = {}) {
|
|
918
|
-
return t.method = "GET", await
|
|
901
|
+
return t.method = "GET", await G(() => z(e, t));
|
|
919
902
|
},
|
|
920
|
-
async patch(e, t, r = null,
|
|
921
|
-
if (
|
|
922
|
-
return await
|
|
903
|
+
async patch(e, t, r = null, n = {}) {
|
|
904
|
+
if (n.method = "PATCH", n.body = r ? Et(r, t) : t, Object.keys(n.body).length !== 0)
|
|
905
|
+
return await G(() => z(e, n));
|
|
923
906
|
},
|
|
924
907
|
async post(e, t = void 0, r = {}) {
|
|
925
|
-
return r.method = "POST", r.body = t, await
|
|
908
|
+
return r.method = "POST", r.body = t, await G(() => z(e, r));
|
|
926
909
|
},
|
|
927
910
|
async put(e, t = void 0, r = {}) {
|
|
928
|
-
return r.method = "PUT", r.body = t, await
|
|
911
|
+
return r.method = "PUT", r.body = t, await G(() => z(e, r));
|
|
929
912
|
},
|
|
930
913
|
async delete(e, t = void 0, r = {}) {
|
|
931
|
-
return r.method = "DELETE", r.body = t, await
|
|
914
|
+
return r.method = "DELETE", r.body = t, await G(() => z(e, r));
|
|
932
915
|
},
|
|
933
916
|
async paginatedFetch(e, t) {
|
|
934
|
-
const r = t ??
|
|
935
|
-
for (let
|
|
936
|
-
const
|
|
937
|
-
|
|
917
|
+
const r = t ?? hr, n = e.includes("?") ? "&" : "?", s = `${e}${n}page_size=${r}&page=1`, a = ut({ method: "GET" }), o = await G(() => fetch(s, a)), i = Number(o.headers.get("x-total-pages")) || 1, f = [...await ht(o)];
|
|
918
|
+
for (let u = 2; u <= i; u++) {
|
|
919
|
+
const p = `${e}${n}page_size=${r}&page=${u}`, g = await G(() => z(p, { method: "GET" }));
|
|
920
|
+
f.push(...g);
|
|
938
921
|
}
|
|
939
|
-
return
|
|
922
|
+
return f;
|
|
940
923
|
}
|
|
941
|
-
},
|
|
924
|
+
}, He = {
|
|
942
925
|
HTTP: {
|
|
943
926
|
type: "HTTP",
|
|
944
927
|
sourceUri: "",
|
|
@@ -949,7 +932,7 @@ const o = {
|
|
|
949
932
|
sourceUri: "",
|
|
950
933
|
placeholderVariables: []
|
|
951
934
|
}
|
|
952
|
-
},
|
|
935
|
+
}, ze = {
|
|
953
936
|
JSON: {
|
|
954
937
|
type: "JSON",
|
|
955
938
|
timestamp: {
|
|
@@ -972,18 +955,18 @@ const o = {
|
|
|
972
955
|
identifierType: "name"
|
|
973
956
|
/* Name */
|
|
974
957
|
}
|
|
975
|
-
},
|
|
958
|
+
}, Xe = {
|
|
976
959
|
HydroServer: {
|
|
977
960
|
type: "HydroServer"
|
|
978
961
|
}
|
|
979
962
|
};
|
|
980
|
-
class
|
|
963
|
+
class on {
|
|
981
964
|
name = "";
|
|
982
965
|
settings = {
|
|
983
966
|
type: "SDL",
|
|
984
|
-
extractor: JSON.parse(JSON.stringify(
|
|
985
|
-
transformer: JSON.parse(JSON.stringify(
|
|
986
|
-
loader: JSON.parse(JSON.stringify(
|
|
967
|
+
extractor: JSON.parse(JSON.stringify(He.local)),
|
|
968
|
+
transformer: JSON.parse(JSON.stringify(ze.CSV)),
|
|
969
|
+
loader: JSON.parse(JSON.stringify(Xe.HydroServer)),
|
|
987
970
|
payloads: []
|
|
988
971
|
};
|
|
989
972
|
id = "";
|
|
@@ -1005,19 +988,19 @@ class Ut {
|
|
|
1005
988
|
}
|
|
1006
989
|
switchExtractor(t) {
|
|
1007
990
|
this.settings.extractor = JSON.parse(
|
|
1008
|
-
JSON.stringify(
|
|
991
|
+
JSON.stringify(He[t])
|
|
1009
992
|
);
|
|
1010
993
|
}
|
|
1011
994
|
switchTransformer(t) {
|
|
1012
995
|
this.settings.transformer = JSON.parse(
|
|
1013
|
-
JSON.stringify(
|
|
996
|
+
JSON.stringify(ze[t])
|
|
1014
997
|
);
|
|
1015
998
|
}
|
|
1016
999
|
switchLoader(t) {
|
|
1017
|
-
this.settings.loader = JSON.parse(JSON.stringify(
|
|
1000
|
+
this.settings.loader = JSON.parse(JSON.stringify(Xe[t]));
|
|
1018
1001
|
}
|
|
1019
1002
|
}
|
|
1020
|
-
function
|
|
1003
|
+
function Ve(e) {
|
|
1021
1004
|
return {
|
|
1022
1005
|
name: e.name,
|
|
1023
1006
|
settings: e.settings,
|
|
@@ -1027,77 +1010,77 @@ function be(e) {
|
|
|
1027
1010
|
status: e.status
|
|
1028
1011
|
};
|
|
1029
1012
|
}
|
|
1030
|
-
const
|
|
1031
|
-
let
|
|
1032
|
-
return
|
|
1033
|
-
},
|
|
1034
|
-
const
|
|
1013
|
+
const O = "https://lro.hydroserver.org/api", Me = `${O}/auth`, x = `${Me}/browser/account`, ge = `${Me}/browser/session`, ae = `${Me}/browser/provider`, $ = `${O}/data/workspaces`, me = `${O}/data/roles`, R = `${O}/data/datastreams`, N = `${O}/data/sensors`, _ = `${O}/data/things`, qe = `${_}/tags`, X = `${O}/data/orchestration-systems`, F = `${O}/data/data-sources`, Y = `${O}/data/observed-properties`, V = `${O}/data/processing-levels`, J = `${O}/data/result-qualifiers`, H = `${O}/data/units`, an = (e, t, r, n, s) => {
|
|
1014
|
+
let a = `${R}/${e}/observations?format=column`;
|
|
1015
|
+
return a += `&order_by=phenomenonTime&page_size=${t}`, a += `&phenomenon_time_min=${encodeURIComponent(r)}`, n && (a += `&phenomenon_time_max=${encodeURIComponent(n)}`), s && (a += `&page=${s}`), a;
|
|
1016
|
+
}, fr = (e, t, r) => {
|
|
1017
|
+
const n = {
|
|
1035
1018
|
provider: e,
|
|
1036
1019
|
callback_url: t,
|
|
1037
1020
|
process: r
|
|
1038
|
-
},
|
|
1039
|
-
if (
|
|
1021
|
+
}, s = lt(), a = document.createElement("form");
|
|
1022
|
+
if (a.method = "POST", a.action = `${ae}/redirect`, s) {
|
|
1023
|
+
const o = document.createElement("input");
|
|
1024
|
+
o.type = "hidden", o.name = "csrfmiddlewaretoken", o.value = s, a.appendChild(o);
|
|
1025
|
+
}
|
|
1026
|
+
for (const o in n) {
|
|
1040
1027
|
const i = document.createElement("input");
|
|
1041
|
-
i.type = "hidden", i.name =
|
|
1042
|
-
}
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
}
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
signup: async (e) => o.post(`${E}`, e),
|
|
1054
|
-
updateUser: async (e, t) => o.patch(`${E}`, e, t),
|
|
1055
|
-
deleteUser: async () => o.delete(`${E}`),
|
|
1056
|
-
sendVerificationEmail: async (e) => o.put(`${E}/email/verify`, {
|
|
1028
|
+
i.type = "hidden", i.name = o, i.value = n[o] || "", a.appendChild(i);
|
|
1029
|
+
}
|
|
1030
|
+
document.body.appendChild(a), a.submit();
|
|
1031
|
+
}, cn = {
|
|
1032
|
+
fetchSession: async () => c.fetch(`${ge}`),
|
|
1033
|
+
login: async (e, t) => c.post(`${ge}`, { email: e, password: t }),
|
|
1034
|
+
logout: async () => c.delete(`${ge}`),
|
|
1035
|
+
fetchUser: async () => c.fetch(`${x}`),
|
|
1036
|
+
signup: async (e) => c.post(`${x}`, e),
|
|
1037
|
+
updateUser: async (e, t) => c.patch(`${x}`, e, t),
|
|
1038
|
+
deleteUser: async () => c.delete(`${x}`),
|
|
1039
|
+
sendVerificationEmail: async (e) => c.put(`${x}/email/verify`, {
|
|
1057
1040
|
email: e
|
|
1058
1041
|
}),
|
|
1059
|
-
verifyEmailWithCode: async (e) =>
|
|
1060
|
-
requestPasswordReset: async (e) =>
|
|
1042
|
+
verifyEmailWithCode: async (e) => c.post(`${x}/email/verify`, { key: e }),
|
|
1043
|
+
requestPasswordReset: async (e) => c.post(`${x}/password/request`, {
|
|
1061
1044
|
email: e
|
|
1062
1045
|
}),
|
|
1063
|
-
resetPassword: async (e, t) =>
|
|
1046
|
+
resetPassword: async (e, t) => c.post(`${x}/password/reset`, {
|
|
1064
1047
|
key: e,
|
|
1065
1048
|
password: t
|
|
1066
1049
|
}),
|
|
1067
|
-
fetchWorkspaces: async () =>
|
|
1068
|
-
fetchAssociatedWorkspaces: async () =>
|
|
1069
|
-
fetchWorkspace: async (e) =>
|
|
1070
|
-
createWorkspace: async (e) =>
|
|
1071
|
-
updateWorkspace: async (e, t = null) =>
|
|
1072
|
-
`${
|
|
1050
|
+
fetchWorkspaces: async () => c.paginatedFetch(`${$}`),
|
|
1051
|
+
fetchAssociatedWorkspaces: async () => c.paginatedFetch(`${$}?is_associated=true`),
|
|
1052
|
+
fetchWorkspace: async (e) => c.fetch(`${$}/${e}`),
|
|
1053
|
+
createWorkspace: async (e) => c.post($, e),
|
|
1054
|
+
updateWorkspace: async (e, t = null) => c.patch(
|
|
1055
|
+
`${$}/${e.id}`,
|
|
1073
1056
|
e,
|
|
1074
1057
|
t
|
|
1075
1058
|
),
|
|
1076
|
-
deleteWorkspace: async (e) =>
|
|
1077
|
-
transferWorkspace: async (e, t) =>
|
|
1078
|
-
acceptWorkspaceTransfer: async (e) =>
|
|
1079
|
-
rejectWorkspaceTransfer: async (e) =>
|
|
1080
|
-
getCollaboratorRoles: async (e) =>
|
|
1081
|
-
getAPIKeyRoles: async (e) =>
|
|
1082
|
-
getRole: async (e) =>
|
|
1083
|
-
getCollaborators: async (e) =>
|
|
1084
|
-
addCollaborator: async (e, t, r) =>
|
|
1059
|
+
deleteWorkspace: async (e) => c.delete(`${$}/${e}`),
|
|
1060
|
+
transferWorkspace: async (e, t) => c.post(`${$}/${e}/transfer`, { newOwner: t }),
|
|
1061
|
+
acceptWorkspaceTransfer: async (e) => c.put(`${$}/${e}/transfer`),
|
|
1062
|
+
rejectWorkspaceTransfer: async (e) => c.delete(`${$}/${e}/transfer`),
|
|
1063
|
+
getCollaboratorRoles: async (e) => c.paginatedFetch(`${me}?is_user_role=true`),
|
|
1064
|
+
getAPIKeyRoles: async (e) => c.paginatedFetch(`${me}?is_apikey_role=true`),
|
|
1065
|
+
getRole: async (e) => c.fetch(`${me}/${e}`),
|
|
1066
|
+
getCollaborators: async (e) => c.paginatedFetch(`${$}/${e}/collaborators`),
|
|
1067
|
+
addCollaborator: async (e, t, r) => c.post(`${$}/${e}/collaborators`, {
|
|
1085
1068
|
email: t,
|
|
1086
1069
|
roleId: r
|
|
1087
1070
|
}),
|
|
1088
|
-
updateCollaboratorRole: async (e, t, r) =>
|
|
1071
|
+
updateCollaboratorRole: async (e, t, r) => c.put(`${$}/${e}/collaborators`, {
|
|
1089
1072
|
email: t,
|
|
1090
1073
|
roleId: r
|
|
1091
1074
|
}),
|
|
1092
|
-
removeCollaborator: async (e, t) =>
|
|
1093
|
-
fetchApiKeys: async (e) =>
|
|
1094
|
-
`${
|
|
1075
|
+
removeCollaborator: async (e, t) => c.delete(`${$}/${e}/collaborators`, { email: t }),
|
|
1076
|
+
fetchApiKeys: async (e) => c.paginatedFetch(
|
|
1077
|
+
`${$}/${e}/api-keys?expand_related=true`
|
|
1095
1078
|
),
|
|
1096
|
-
fetchApiKey: async (e, t) =>
|
|
1097
|
-
`${
|
|
1079
|
+
fetchApiKey: async (e, t) => c.fetch(
|
|
1080
|
+
`${$}/${e}/api-keys/${t}?expand_related=true`
|
|
1098
1081
|
),
|
|
1099
|
-
createApiKey: async (e) =>
|
|
1100
|
-
`${
|
|
1082
|
+
createApiKey: async (e) => c.post(
|
|
1083
|
+
`${$}/${e.workspaceId}/api-keys?expand_related=true`,
|
|
1101
1084
|
{
|
|
1102
1085
|
name: e.name,
|
|
1103
1086
|
description: e.description,
|
|
@@ -1105,8 +1088,8 @@ const S = "https://lro.hydroserver.org/api", ae = `${S}/auth`, E = `${ae}/browse
|
|
|
1105
1088
|
roleId: e.role.id
|
|
1106
1089
|
}
|
|
1107
1090
|
),
|
|
1108
|
-
updateApiKey: async (e, t) =>
|
|
1109
|
-
`${
|
|
1091
|
+
updateApiKey: async (e, t) => c.patch(
|
|
1092
|
+
`${$}/${e.workspaceId}/api-keys/${e.id}?expand_related=true`,
|
|
1110
1093
|
{
|
|
1111
1094
|
name: e.name,
|
|
1112
1095
|
description: e.description,
|
|
@@ -1120,160 +1103,160 @@ const S = "https://lro.hydroserver.org/api", ae = `${S}/auth`, E = `${ae}/browse
|
|
|
1120
1103
|
roleId: t.role.id
|
|
1121
1104
|
}
|
|
1122
1105
|
),
|
|
1123
|
-
regenerateApiKey: async (e, t) =>
|
|
1124
|
-
`${
|
|
1106
|
+
regenerateApiKey: async (e, t) => c.put(
|
|
1107
|
+
`${$}/${e}/api-keys/${t}/regenerate?expand_related=true`
|
|
1125
1108
|
),
|
|
1126
|
-
deleteApiKey: async (e, t) =>
|
|
1127
|
-
fetchConnectedProviders: async () =>
|
|
1128
|
-
providerRedirect:
|
|
1129
|
-
providerSignup: async (e) =>
|
|
1130
|
-
deleteProvider: async (e, t) =>
|
|
1109
|
+
deleteApiKey: async (e, t) => c.delete(`${$}/${e}/api-keys/${t}`),
|
|
1110
|
+
fetchConnectedProviders: async () => c.fetch(`${ae}/connections`),
|
|
1111
|
+
providerRedirect: fr,
|
|
1112
|
+
providerSignup: async (e) => c.post(`${ae}/signup`, e),
|
|
1113
|
+
deleteProvider: async (e, t) => c.delete(`${ae}/connections`, {
|
|
1131
1114
|
provider: e,
|
|
1132
1115
|
account: t
|
|
1133
1116
|
}),
|
|
1134
|
-
createUnit: async (e) =>
|
|
1135
|
-
fetchUnits: async () =>
|
|
1136
|
-
fetchWorkspaceUnits: async (e) =>
|
|
1137
|
-
updateUnit: async (e, t = null) =>
|
|
1138
|
-
deleteUnit: async (e) =>
|
|
1139
|
-
getUnit: async (e) =>
|
|
1140
|
-
removeThingOwner: async (e, t) =>
|
|
1117
|
+
createUnit: async (e) => c.post(H, e),
|
|
1118
|
+
fetchUnits: async () => c.paginatedFetch(`${H}`),
|
|
1119
|
+
fetchWorkspaceUnits: async (e) => c.paginatedFetch(`${H}?workspace_id=${e}`),
|
|
1120
|
+
updateUnit: async (e, t = null) => c.patch(`${H}/${e.id}`, e, t),
|
|
1121
|
+
deleteUnit: async (e) => c.delete(`${H}/${e}`),
|
|
1122
|
+
getUnit: async (e) => c.fetch(`${H}/${e}`),
|
|
1123
|
+
removeThingOwner: async (e, t) => c.patch(`${_}/${e}/ownership`, {
|
|
1141
1124
|
email: t,
|
|
1142
1125
|
removeOwner: !0
|
|
1143
1126
|
}),
|
|
1144
|
-
addSecondaryOwner: async (e, t) =>
|
|
1127
|
+
addSecondaryOwner: async (e, t) => c.patch(`${_}/${e}/ownership`, {
|
|
1145
1128
|
email: t,
|
|
1146
1129
|
makeOwner: !0
|
|
1147
1130
|
}),
|
|
1148
|
-
transferPrimaryOwnership: async (e, t) =>
|
|
1131
|
+
transferPrimaryOwnership: async (e, t) => c.patch(`${_}/${e}/ownership`, {
|
|
1149
1132
|
email: t,
|
|
1150
1133
|
transferPrimary: !0
|
|
1151
1134
|
}),
|
|
1152
|
-
createThing: async (e) =>
|
|
1153
|
-
fetchThings: async () =>
|
|
1154
|
-
fetchThingsForWorkspace: async (e) =>
|
|
1155
|
-
fetchOwnedThings: async () =>
|
|
1156
|
-
fetchThing: async (e) =>
|
|
1157
|
-
updateThing: async (e) =>
|
|
1158
|
-
updateThingPrivacy: async (e, t) =>
|
|
1159
|
-
deleteThing: async (e) =>
|
|
1160
|
-
fetchMetadataForThingOwner: async (e) =>
|
|
1161
|
-
`${
|
|
1135
|
+
createThing: async (e) => c.post(_, e),
|
|
1136
|
+
fetchThings: async () => c.paginatedFetch(`${_}`),
|
|
1137
|
+
fetchThingsForWorkspace: async (e) => c.paginatedFetch(`${_}?workspace_id=${e}`),
|
|
1138
|
+
fetchOwnedThings: async () => c.paginatedFetch(`${_}?owned_only=true`),
|
|
1139
|
+
fetchThing: async (e) => c.fetch(`${_}/${e}`),
|
|
1140
|
+
updateThing: async (e) => c.patch(`${_}/${e.id}`, e),
|
|
1141
|
+
updateThingPrivacy: async (e, t) => c.patch(`${_}/${e}`, { isPrivate: t }),
|
|
1142
|
+
deleteThing: async (e) => c.delete(`${_}/${e}`),
|
|
1143
|
+
fetchMetadataForThingOwner: async (e) => c.paginatedFetch(
|
|
1144
|
+
`${_}/${e}/metadata?include_assignable_metadata=true`
|
|
1162
1145
|
),
|
|
1163
|
-
fetchMetadataForThing: async (e) =>
|
|
1164
|
-
uploadSitePhotos: async (e, t) =>
|
|
1165
|
-
fetchSitePhotos: async (e) =>
|
|
1166
|
-
deleteSitePhoto: async (e, t) =>
|
|
1167
|
-
createSiteTag: async (e, t) =>
|
|
1168
|
-
editSiteTag: async (e, t) =>
|
|
1169
|
-
fetchSiteTags: async (e) =>
|
|
1170
|
-
fetchUsersSiteTags: async () =>
|
|
1171
|
-
deleteSiteTag: async (e, t) =>
|
|
1172
|
-
fetchWorkspaceTags: async (e) =>
|
|
1173
|
-
createHydroShareArchive: async (e) =>
|
|
1174
|
-
updateHydroShareArchive: async (e, t) =>
|
|
1175
|
-
`${
|
|
1146
|
+
fetchMetadataForThing: async (e) => c.fetch(`${_}/${e}/metadata`),
|
|
1147
|
+
uploadSitePhotos: async (e, t) => c.post(`${_}/${e}/photos`, t),
|
|
1148
|
+
fetchSitePhotos: async (e) => c.paginatedFetch(`${_}/${e}/photos`),
|
|
1149
|
+
deleteSitePhoto: async (e, t) => c.delete(`${_}/${e}/photos`, { name: t }),
|
|
1150
|
+
createSiteTag: async (e, t) => c.post(`${_}/${e}/tags`, t),
|
|
1151
|
+
editSiteTag: async (e, t) => c.put(`${_}/${e}/tags`, t),
|
|
1152
|
+
fetchSiteTags: async (e) => c.fetch(`${_}/${e}/tags`),
|
|
1153
|
+
fetchUsersSiteTags: async () => c.fetch(`${qe}`),
|
|
1154
|
+
deleteSiteTag: async (e, t) => c.delete(`${_}/${e}/tags`, t),
|
|
1155
|
+
fetchWorkspaceTags: async (e) => c.fetch(`${qe}/keys?workspace_id=${e}`),
|
|
1156
|
+
createHydroShareArchive: async (e) => c.post(`${_}/${e.thingId}/archive`, e),
|
|
1157
|
+
updateHydroShareArchive: async (e, t) => c.patch(
|
|
1158
|
+
`${_}/${e.thingId}/archive`,
|
|
1176
1159
|
e,
|
|
1177
1160
|
t
|
|
1178
1161
|
),
|
|
1179
|
-
fetchHydroShareArchive: async (e) =>
|
|
1180
|
-
deleteHydroShareArchive: async (e) =>
|
|
1181
|
-
archiveToHydroShare: async (e) =>
|
|
1182
|
-
createDatastream: async (e) =>
|
|
1162
|
+
fetchHydroShareArchive: async (e) => c.fetch(`${_}/${e}/archive`),
|
|
1163
|
+
deleteHydroShareArchive: async (e) => c.delete(`${_}/${e}/archive`),
|
|
1164
|
+
archiveToHydroShare: async (e) => c.post(`${_}/${e}/archive/trigger`),
|
|
1165
|
+
createDatastream: async (e) => c.post(R, e),
|
|
1183
1166
|
fetchDatastreams: async (e) => {
|
|
1184
1167
|
const t = [];
|
|
1185
1168
|
if (e)
|
|
1186
|
-
for (const [
|
|
1187
|
-
t.push(`${encodeURIComponent(
|
|
1169
|
+
for (const [n, s] of Object.entries(e))
|
|
1170
|
+
t.push(`${encodeURIComponent(n)}=${encodeURIComponent(s)}`);
|
|
1188
1171
|
const r = t.length ? `?${t.join("&")}` : "";
|
|
1189
|
-
return
|
|
1172
|
+
return c.paginatedFetch(`${R}${r}`);
|
|
1190
1173
|
},
|
|
1191
|
-
fetchDatastreamsForThing: async (e) =>
|
|
1192
|
-
fetchExpandedDatastreamsForThing: async (e) =>
|
|
1193
|
-
`${
|
|
1174
|
+
fetchDatastreamsForThing: async (e) => c.paginatedFetch(`${R}?thing_id=${e}`),
|
|
1175
|
+
fetchExpandedDatastreamsForThing: async (e) => c.paginatedFetch(
|
|
1176
|
+
`${R}?thing_id=${e}&expand_related=true`
|
|
1194
1177
|
),
|
|
1195
|
-
fetchDatastreamsForDataSource: async (e) =>
|
|
1196
|
-
fetchDatastream: async (e) =>
|
|
1197
|
-
fetchDatastreamExpanded: async (e) =>
|
|
1198
|
-
fetchUsersDatastreams: async () =>
|
|
1199
|
-
updateDatastream: async (e, t = null) =>
|
|
1200
|
-
deleteDatastream: async (e) =>
|
|
1201
|
-
downloadDatastreamCSV: async (e) =>
|
|
1202
|
-
createObservedProperty: async (e) =>
|
|
1203
|
-
fetchObservedProperty: async (e) =>
|
|
1204
|
-
fetchObservedProperties: async () =>
|
|
1205
|
-
fetchWorkspaceObservedProperties: async (e) =>
|
|
1206
|
-
updateObservedProperty: async (e, t = null) =>
|
|
1207
|
-
deleteObservedProperty: async (e) =>
|
|
1208
|
-
createProcessingLevel: async (e) =>
|
|
1209
|
-
fetchProcessingLevels: async () =>
|
|
1210
|
-
fetchProcessingLevel: async (e) =>
|
|
1211
|
-
fetchWorkspaceProcessingLevels: async (e) =>
|
|
1212
|
-
updateProcessingLevel: async (e, t = null) =>
|
|
1213
|
-
deleteProcessingLevel: async (e) =>
|
|
1214
|
-
createSensor: async (e) =>
|
|
1215
|
-
fetchSensors: async () =>
|
|
1216
|
-
fetchSensor: async (e) =>
|
|
1217
|
-
fetchWorkspaceSensors: async (e) =>
|
|
1218
|
-
updateSensor: async (e, t = null) =>
|
|
1219
|
-
deleteSensor: async (e) =>
|
|
1220
|
-
createResultQualifier: async (e) =>
|
|
1221
|
-
fetchResultQualifiers: async () =>
|
|
1222
|
-
fetchWorkspaceResultQualifiers: async (e) =>
|
|
1223
|
-
updateResultQualifier: async (e, t = null) =>
|
|
1224
|
-
`${
|
|
1178
|
+
fetchDatastreamsForDataSource: async (e) => c.paginatedFetch(`${R}?data_source_id=${e}`),
|
|
1179
|
+
fetchDatastream: async (e) => c.fetch(`${R}/${e}`),
|
|
1180
|
+
fetchDatastreamExpanded: async (e) => c.fetch(`${R}/${e}?expand_related=true`),
|
|
1181
|
+
fetchUsersDatastreams: async () => c.paginatedFetch(`${R}?exclude_unowned=true`),
|
|
1182
|
+
updateDatastream: async (e, t = null) => c.patch(`${R}/${e.id}`, e, t),
|
|
1183
|
+
deleteDatastream: async (e) => c.delete(`${R}/${e}`),
|
|
1184
|
+
downloadDatastreamCSV: async (e) => c.fetch(`${R}/${e}/csv`),
|
|
1185
|
+
createObservedProperty: async (e) => c.post(Y, e),
|
|
1186
|
+
fetchObservedProperty: async (e) => c.fetch(`${Y}/${e}`),
|
|
1187
|
+
fetchObservedProperties: async () => c.paginatedFetch(`${Y}`),
|
|
1188
|
+
fetchWorkspaceObservedProperties: async (e) => c.paginatedFetch(`${Y}?workspace_id=${e}`),
|
|
1189
|
+
updateObservedProperty: async (e, t = null) => c.patch(`${Y}/${e.id}`, e, t),
|
|
1190
|
+
deleteObservedProperty: async (e) => c.delete(`${Y}/${e}`),
|
|
1191
|
+
createProcessingLevel: async (e) => c.post(V, e),
|
|
1192
|
+
fetchProcessingLevels: async () => c.paginatedFetch(`${V}`),
|
|
1193
|
+
fetchProcessingLevel: async (e) => c.fetch(`${V}/${e}`),
|
|
1194
|
+
fetchWorkspaceProcessingLevels: async (e) => c.paginatedFetch(`${V}?workspace_id=${e}`),
|
|
1195
|
+
updateProcessingLevel: async (e, t = null) => c.patch(`${V}/${e.id}`, e, t),
|
|
1196
|
+
deleteProcessingLevel: async (e) => c.delete(`${V}/${e}`),
|
|
1197
|
+
createSensor: async (e) => c.post(N, e),
|
|
1198
|
+
fetchSensors: async () => c.paginatedFetch(`${N}`),
|
|
1199
|
+
fetchSensor: async (e) => c.fetch(`${N}/${e}`),
|
|
1200
|
+
fetchWorkspaceSensors: async (e) => c.paginatedFetch(`${N}?workspace_id=${e}`),
|
|
1201
|
+
updateSensor: async (e, t = null) => c.patch(`${N}/${e.id}`, e, t),
|
|
1202
|
+
deleteSensor: async (e) => c.delete(`${N}/${e}`),
|
|
1203
|
+
createResultQualifier: async (e) => c.post(J, e),
|
|
1204
|
+
fetchResultQualifiers: async () => c.paginatedFetch(`${J}`),
|
|
1205
|
+
fetchWorkspaceResultQualifiers: async (e) => c.paginatedFetch(`${J}?workspace_id=${e}`),
|
|
1206
|
+
updateResultQualifier: async (e, t = null) => c.patch(
|
|
1207
|
+
`${J}/${e.id}`,
|
|
1225
1208
|
e,
|
|
1226
1209
|
t
|
|
1227
1210
|
),
|
|
1228
|
-
deleteResultQualifier: async (e) =>
|
|
1229
|
-
createOrchestrationSystem: async (e) =>
|
|
1230
|
-
fetchOrchestrationSystems: async () =>
|
|
1231
|
-
fetchWorkspaceOrchestrationSystems: async (e) =>
|
|
1232
|
-
fetchOrchestrationSystem: async (e) =>
|
|
1233
|
-
updateOrchestrationSystem: async (e, t) =>
|
|
1234
|
-
deleteOrchestrationSystem: async (e) =>
|
|
1235
|
-
createDataSource: async (e) =>
|
|
1236
|
-
`${
|
|
1237
|
-
|
|
1211
|
+
deleteResultQualifier: async (e) => c.delete(`${J}/${e}`),
|
|
1212
|
+
createOrchestrationSystem: async (e) => c.post(X, e),
|
|
1213
|
+
fetchOrchestrationSystems: async () => c.paginatedFetch(X),
|
|
1214
|
+
fetchWorkspaceOrchestrationSystems: async (e) => c.paginatedFetch(`${X}?workspace_id=${e}`),
|
|
1215
|
+
fetchOrchestrationSystem: async (e) => c.fetch(`${X}/${e}`),
|
|
1216
|
+
updateOrchestrationSystem: async (e, t) => c.patch(`${X}/${e}`, t),
|
|
1217
|
+
deleteOrchestrationSystem: async (e) => c.delete(`${X}/${e}`),
|
|
1218
|
+
createDataSource: async (e) => c.post(
|
|
1219
|
+
`${F}?expand_related=true`,
|
|
1220
|
+
Ve(e)
|
|
1238
1221
|
),
|
|
1239
|
-
fetchDataSources: async () =>
|
|
1240
|
-
fetchWorkspaceDataSources: async (e) =>
|
|
1241
|
-
`${
|
|
1222
|
+
fetchDataSources: async () => c.paginatedFetch(`${F}?expand_related=true`),
|
|
1223
|
+
fetchWorkspaceDataSources: async (e) => c.paginatedFetch(
|
|
1224
|
+
`${F}?workspace_id=${e}&expand_related=true`
|
|
1242
1225
|
),
|
|
1243
|
-
fetchDataSource: async (e) =>
|
|
1244
|
-
updateDataSource: async (e) =>
|
|
1245
|
-
`${
|
|
1246
|
-
|
|
1226
|
+
fetchDataSource: async (e) => c.fetch(`${F}/${e}?expand_related=true`),
|
|
1227
|
+
updateDataSource: async (e) => c.patch(
|
|
1228
|
+
`${F}/${e.id}?expand_related=true`,
|
|
1229
|
+
Ve(e)
|
|
1247
1230
|
),
|
|
1248
|
-
updateDataSourcePartial: async (e) =>
|
|
1249
|
-
`${
|
|
1231
|
+
updateDataSourcePartial: async (e) => c.patch(
|
|
1232
|
+
`${F}/${e.id}?expand_related=true`,
|
|
1250
1233
|
e
|
|
1251
1234
|
),
|
|
1252
|
-
deleteDataSource: async (e) =>
|
|
1253
|
-
linkDatastreamToDataSource: async (e, t) =>
|
|
1254
|
-
`${
|
|
1235
|
+
deleteDataSource: async (e) => c.delete(`${F}/${e}`),
|
|
1236
|
+
linkDatastreamToDataSource: async (e, t) => c.post(
|
|
1237
|
+
`${F}/${e}/datastreams/${t}`
|
|
1255
1238
|
),
|
|
1256
|
-
unlinkDatastreamFromDataSource: async (e, t) =>
|
|
1257
|
-
`${
|
|
1239
|
+
unlinkDatastreamFromDataSource: async (e, t) => c.delete(
|
|
1240
|
+
`${F}/${e}/datastreams/${t}`
|
|
1258
1241
|
),
|
|
1259
|
-
fetchObservations: async (e) =>
|
|
1260
|
-
deleteObservationsForDatastream: async (e) =>
|
|
1242
|
+
fetchObservations: async (e) => c.fetch(e),
|
|
1243
|
+
deleteObservationsForDatastream: async (e) => c.post(`${R}/${e}/observations/bulk-delete`, {
|
|
1261
1244
|
phenomenonTimeStart: null,
|
|
1262
1245
|
phenomenonTimeEnd: null
|
|
1263
1246
|
}),
|
|
1264
|
-
fetchUserTypes: async () =>
|
|
1265
|
-
fetchOrganizationTypes: async () =>
|
|
1266
|
-
fetchSiteTypes: async () =>
|
|
1267
|
-
fetchSamplingFeatureTypes: async () =>
|
|
1268
|
-
fetchSensorEncodingTypes: async () =>
|
|
1269
|
-
fetchMethodTypes: async () =>
|
|
1270
|
-
fetchVariableTypes: async () =>
|
|
1271
|
-
fetchUnitTypes: async () =>
|
|
1272
|
-
fetchDatastreamStatuses: async () =>
|
|
1273
|
-
fetchDatastreamAggregations: async () =>
|
|
1274
|
-
fetchSampledMediums: async () =>
|
|
1247
|
+
fetchUserTypes: async () => c.fetch(`${x}/user-types`),
|
|
1248
|
+
fetchOrganizationTypes: async () => c.fetch(`${x}/organization-types`),
|
|
1249
|
+
fetchSiteTypes: async () => c.fetch(`${_}/site-types`),
|
|
1250
|
+
fetchSamplingFeatureTypes: async () => c.paginatedFetch(`${_}/sampling-feature-types`),
|
|
1251
|
+
fetchSensorEncodingTypes: async () => c.paginatedFetch(`${N}/encoding-types`),
|
|
1252
|
+
fetchMethodTypes: async () => c.paginatedFetch(`${N}/method-types`),
|
|
1253
|
+
fetchVariableTypes: async () => c.paginatedFetch(`${Y}/variable-types`),
|
|
1254
|
+
fetchUnitTypes: async () => c.paginatedFetch(`${H}/types`),
|
|
1255
|
+
fetchDatastreamStatuses: async () => c.paginatedFetch(`${R}/statuses`),
|
|
1256
|
+
fetchDatastreamAggregations: async () => c.paginatedFetch(`${R}/aggregation-statistics`),
|
|
1257
|
+
fetchSampledMediums: async () => c.paginatedFetch(`${R}/sampled-mediums`)
|
|
1275
1258
|
};
|
|
1276
|
-
class
|
|
1259
|
+
class ln {
|
|
1277
1260
|
name = "";
|
|
1278
1261
|
mappings = [];
|
|
1279
1262
|
extractorVariables = {};
|
|
@@ -1281,15 +1264,15 @@ class Yt {
|
|
|
1281
1264
|
Object.assign(this, t);
|
|
1282
1265
|
}
|
|
1283
1266
|
}
|
|
1284
|
-
const
|
|
1285
|
-
[
|
|
1286
|
-
[
|
|
1287
|
-
[
|
|
1288
|
-
[
|
|
1289
|
-
[
|
|
1290
|
-
[
|
|
1291
|
-
[
|
|
1292
|
-
},
|
|
1267
|
+
const kt = 1, ie = kt * 60, Ue = ie * 60, Oe = Ue * 24, dr = Oe * 7, pr = Ue * 30, yr = Oe * 365, te = {
|
|
1268
|
+
[D.SECOND]: kt,
|
|
1269
|
+
[D.MINUTE]: ie,
|
|
1270
|
+
[D.HOUR]: Ue,
|
|
1271
|
+
[D.DAY]: Oe,
|
|
1272
|
+
[D.WEEK]: dr,
|
|
1273
|
+
[D.MONTH]: pr,
|
|
1274
|
+
[D.YEAR]: yr
|
|
1275
|
+
}, un = (e) => e.toLocaleString(void 0, {
|
|
1293
1276
|
year: "numeric",
|
|
1294
1277
|
month: "short",
|
|
1295
1278
|
day: "2-digit",
|
|
@@ -1297,51 +1280,42 @@ const Ne = 1, M = Ne * 60, ne = M * 60, oe = ne * 24, mt = oe * 7, gt = ne * 30,
|
|
|
1297
1280
|
hour12: !1,
|
|
1298
1281
|
minute: "2-digit",
|
|
1299
1282
|
second: "2-digit"
|
|
1300
|
-
}),
|
|
1283
|
+
}), hn = (e) => {
|
|
1301
1284
|
let t, r;
|
|
1302
|
-
e >=
|
|
1303
|
-
let
|
|
1304
|
-
return r === "ms" ?
|
|
1305
|
-
},
|
|
1306
|
-
if (r === $.MONTH) {
|
|
1307
|
-
const s = new Date(e);
|
|
1308
|
-
return s.setMonth(s.getMonth() + t), s.getTime();
|
|
1309
|
-
} else if (r === $.YEAR) {
|
|
1310
|
-
const s = new Date(e);
|
|
1311
|
-
return s.setFullYear(s.getFullYear() + t), s.getTime();
|
|
1312
|
-
} else
|
|
1313
|
-
return e + t * se[r] * 1e3;
|
|
1314
|
-
}, J = async (e, t) => {
|
|
1285
|
+
e >= ie * 1e3 ? (t = e / (ie * 1e3), r = "m") : e >= 1e3 ? (t = e / 1e3, r = "s") : (t = e, r = "ms");
|
|
1286
|
+
let n;
|
|
1287
|
+
return r === "ms" ? n = Math.round(t).toString() : n = t.toFixed(2), `${n} ${r}`;
|
|
1288
|
+
}, we = async (e, t) => {
|
|
1315
1289
|
t && console.info(t);
|
|
1316
|
-
const r = performance.now(),
|
|
1317
|
-
console.info(` Done in ${(
|
|
1318
|
-
const
|
|
1319
|
-
return { response:
|
|
1290
|
+
const r = performance.now(), n = await e(), s = performance.now();
|
|
1291
|
+
console.info(` Done in ${(s - r).toFixed(2)} ms`);
|
|
1292
|
+
const a = +(s - r);
|
|
1293
|
+
return { response: n, duration: a };
|
|
1320
1294
|
};
|
|
1321
|
-
function
|
|
1295
|
+
function fn(e, t) {
|
|
1322
1296
|
const r = new Date(e);
|
|
1323
1297
|
return r.setHours(r.getHours() - t), r.toISOString();
|
|
1324
1298
|
}
|
|
1325
|
-
const
|
|
1326
|
-
let r = 0,
|
|
1327
|
-
for (; r <
|
|
1328
|
-
const
|
|
1329
|
-
e[
|
|
1299
|
+
const re = (e, t) => {
|
|
1300
|
+
let r = 0, n = e.length;
|
|
1301
|
+
for (; r < n; ) {
|
|
1302
|
+
const s = r + n >> 1;
|
|
1303
|
+
e[s] < t ? r = s + 1 : n = s;
|
|
1330
1304
|
}
|
|
1331
1305
|
return r;
|
|
1332
|
-
},
|
|
1333
|
-
let r = 0,
|
|
1334
|
-
for (; r <
|
|
1335
|
-
const
|
|
1336
|
-
e[
|
|
1306
|
+
}, be = (e, t) => {
|
|
1307
|
+
let r = 0, n = e.length;
|
|
1308
|
+
for (; r < n; ) {
|
|
1309
|
+
const s = r + n >> 1;
|
|
1310
|
+
e[s] > t ? n = s : r = s + 1;
|
|
1337
1311
|
}
|
|
1338
1312
|
return r - 1;
|
|
1339
|
-
},
|
|
1340
|
-
`,
|
|
1341
|
-
function
|
|
1313
|
+
}, vt = `(function(){"use strict";function c(n,s,a,u,f,l,y,o){let r=0,e=o;for(let t=l;t<=y;t++)r<a.length&&t===a[r]?r++:(u[e]=n[t],f[e]=s[t],e++);return e-o}self.onmessage=n=>{const{bufferX:s,bufferY:a,outputBufferX:u,outputBufferY:f,start:l,end:y,deleteSegment:o,startTarget:r}=n.data,e=new Float64Array(s),t=new Float32Array(a),A=new Float64Array(u),g=new Float32Array(f);c(e,t,o,A,g,l,y,r),self.postMessage("Done")}})();
|
|
1314
|
+
`, Je = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", vt], { type: "text/javascript;charset=utf-8" });
|
|
1315
|
+
function gr(e) {
|
|
1342
1316
|
let t;
|
|
1343
1317
|
try {
|
|
1344
|
-
if (t =
|
|
1318
|
+
if (t = Je && (self.URL || self.webkitURL).createObjectURL(Je), !t) throw "";
|
|
1345
1319
|
const r = new Worker(t, {
|
|
1346
1320
|
name: e?.name
|
|
1347
1321
|
});
|
|
@@ -1350,21 +1324,19 @@ function Et(e) {
|
|
|
1350
1324
|
}), r;
|
|
1351
1325
|
} catch {
|
|
1352
1326
|
return new Worker(
|
|
1353
|
-
"data:text/javascript;charset=utf-8," + encodeURIComponent(
|
|
1327
|
+
"data:text/javascript;charset=utf-8," + encodeURIComponent(vt),
|
|
1354
1328
|
{
|
|
1355
1329
|
name: e?.name
|
|
1356
1330
|
}
|
|
1357
1331
|
);
|
|
1358
|
-
} finally {
|
|
1359
|
-
t && (self.URL || self.webkitURL).revokeObjectURL(t);
|
|
1360
1332
|
}
|
|
1361
1333
|
}
|
|
1362
|
-
const
|
|
1363
|
-
`,
|
|
1364
|
-
function
|
|
1334
|
+
const _t = `(function(){"use strict";function F(n,l,a,o,s,y,g,f,i,w,A){let e=0,t=f;for(let r=y;r<=g;r++)if(o[t]=n[r],s[t]=l[r],t++,e<a.length&&r===a[e][0]){const u=a[e][0],c=a[e][1],d=n[u],h=n[c],m=l[u],D=l[c],x=h-d,P=D-m;let p=d+i;for(;p<h;)o[t]=p,s[t]=w?m+(p-d)*P/x:A,t++,p+=i;e++}return t-f}self.onmessage=n=>{const{bufferX:l,bufferY:a,outputBufferX:o,outputBufferY:s,start:y,end:g,gapsSegment:f,startTarget:i,fillDelta:w,interpolate:A,fillValue:e}=n.data,t=new Float64Array(l),r=new Float32Array(a),u=new Float64Array(o),c=new Float32Array(s);F(t,r,f,u,c,y,g,i,w,A,e),self.postMessage("Done")}})();
|
|
1335
|
+
`, Ke = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", _t], { type: "text/javascript;charset=utf-8" });
|
|
1336
|
+
function mr(e) {
|
|
1365
1337
|
let t;
|
|
1366
1338
|
try {
|
|
1367
|
-
if (t =
|
|
1339
|
+
if (t = Ke && (self.URL || self.webkitURL).createObjectURL(Ke), !t) throw "";
|
|
1368
1340
|
const r = new Worker(t, {
|
|
1369
1341
|
name: e?.name
|
|
1370
1342
|
});
|
|
@@ -1373,35 +1345,729 @@ function $t(e) {
|
|
|
1373
1345
|
}), r;
|
|
1374
1346
|
} catch {
|
|
1375
1347
|
return new Worker(
|
|
1376
|
-
"data:text/javascript;charset=utf-8," + encodeURIComponent(
|
|
1348
|
+
"data:text/javascript;charset=utf-8," + encodeURIComponent(_t),
|
|
1349
|
+
{
|
|
1350
|
+
name: e?.name
|
|
1351
|
+
}
|
|
1352
|
+
);
|
|
1353
|
+
}
|
|
1354
|
+
}
|
|
1355
|
+
const At = `(function(){"use strict";function g(o,n,c){for(let s=0;s<c.length;s++){const{indexes:t,lowerIdx:l,upperIdx:r}=c[s],i=o[l],f=n[l],a=o[r],d=n[r],p=a-i,w=d-f;if(p===0){for(let e=0;e<t.length;e++)n[t[e]]=f;continue}for(let e=0;e<t.length;e++){const u=t[e];n[u]=f+(o[u]-i)*w/p}}}self.onmessage=o=>{const{bufferX:n,bufferY:c,groups:s}=o.data,t=new Float64Array(n),l=new Float32Array(c);g(t,l,s),self.postMessage("Done")}})();
|
|
1356
|
+
`, Qe = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", At], { type: "text/javascript;charset=utf-8" });
|
|
1357
|
+
function wr(e) {
|
|
1358
|
+
let t;
|
|
1359
|
+
try {
|
|
1360
|
+
if (t = Qe && (self.URL || self.webkitURL).createObjectURL(Qe), !t) throw "";
|
|
1361
|
+
const r = new Worker(t, {
|
|
1362
|
+
name: e?.name
|
|
1363
|
+
});
|
|
1364
|
+
return r.addEventListener("error", () => {
|
|
1365
|
+
(self.URL || self.webkitURL).revokeObjectURL(t);
|
|
1366
|
+
}), r;
|
|
1367
|
+
} catch {
|
|
1368
|
+
return new Worker(
|
|
1369
|
+
"data:text/javascript;charset=utf-8," + encodeURIComponent(At),
|
|
1370
|
+
{
|
|
1371
|
+
name: e?.name
|
|
1372
|
+
}
|
|
1373
|
+
);
|
|
1374
|
+
}
|
|
1375
|
+
}
|
|
1376
|
+
const Lt = `(function(){"use strict";self.onmessage=r=>{const{bufferX:s,bufferY:o,jobs:a}=r.data,f=new Float64Array(s),n=new Float32Array(o);for(let e=0;e<a.length;e++){const{chunkStart:c,chunkEnd:l,startDatetime:u,value:i,extent:y}=a[e];for(let t=c;t<l;t++)n[t]=n[t]+i*((f[t]-u)/y)}self.postMessage("Done")}})();
|
|
1377
|
+
`, Ze = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", Lt], { type: "text/javascript;charset=utf-8" });
|
|
1378
|
+
function br(e) {
|
|
1379
|
+
let t;
|
|
1380
|
+
try {
|
|
1381
|
+
if (t = Ze && (self.URL || self.webkitURL).createObjectURL(Ze), !t) throw "";
|
|
1382
|
+
const r = new Worker(t, {
|
|
1383
|
+
name: e?.name
|
|
1384
|
+
});
|
|
1385
|
+
return r.addEventListener("error", () => {
|
|
1386
|
+
(self.URL || self.webkitURL).revokeObjectURL(t);
|
|
1387
|
+
}), r;
|
|
1388
|
+
} catch {
|
|
1389
|
+
return new Worker(
|
|
1390
|
+
"data:text/javascript;charset=utf-8," + encodeURIComponent(Lt),
|
|
1377
1391
|
{
|
|
1378
1392
|
name: e?.name
|
|
1379
1393
|
}
|
|
1380
1394
|
);
|
|
1381
|
-
} finally {
|
|
1382
|
-
t && (self.URL || self.webkitURL).revokeObjectURL(t);
|
|
1383
1395
|
}
|
|
1384
1396
|
}
|
|
1385
|
-
const
|
|
1386
|
-
|
|
1397
|
+
const Tt = `(function(){"use strict";function u(f,o,a,n,l,c,s,i){let r=c,e=0,t=i;const w=a.length;for(;r<s&&e<w;){const y=a[e][0];f[r]<=y?(n[t]=f[r],l[t]=o[r],r++):(n[t]=y,l[t]=a[e][1],e++),t++}for(;r<s;)n[t]=f[r],l[t]=o[r],r++,t++;for(;e<w;)n[t]=a[e][0],l[t]=a[e][1],e++,t++;return t-i}self.onmessage=f=>{const{bufferX:o,bufferY:a,outputBufferX:n,outputBufferY:l,origStart:c,origEnd:s,insertions:i,outStart:r}=f.data,e=new Float64Array(o),t=new Float32Array(a),w=new Float64Array(n),y=new Float32Array(l);u(e,t,i,w,y,c,s,r),self.postMessage("Done")}})();
|
|
1398
|
+
`, et = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", Tt], { type: "text/javascript;charset=utf-8" });
|
|
1399
|
+
function Sr(e) {
|
|
1400
|
+
let t;
|
|
1401
|
+
try {
|
|
1402
|
+
if (t = et && (self.URL || self.webkitURL).createObjectURL(et), !t) throw "";
|
|
1403
|
+
const r = new Worker(t, {
|
|
1404
|
+
name: e?.name
|
|
1405
|
+
});
|
|
1406
|
+
return r.addEventListener("error", () => {
|
|
1407
|
+
(self.URL || self.webkitURL).revokeObjectURL(t);
|
|
1408
|
+
}), r;
|
|
1409
|
+
} catch {
|
|
1410
|
+
return new Worker(
|
|
1411
|
+
"data:text/javascript;charset=utf-8," + encodeURIComponent(Tt),
|
|
1412
|
+
{
|
|
1413
|
+
name: e?.name
|
|
1414
|
+
}
|
|
1415
|
+
);
|
|
1416
|
+
}
|
|
1417
|
+
}
|
|
1418
|
+
const $t = `(function(){"use strict";self.onmessage=i=>{const{bufferX:c,bufferY:g,outputBufferX:d,outputBufferY:y,indexes:n,outStart:r,amount:f,isMonth:Y,isYear:h,deltaMs:w}=i.data,s=new Float64Array(c),a=new Float32Array(g),l=new Float64Array(d),u=new Float32Array(y);if(Y)for(let t=0;t<n.length;t++){const e=n[t],o=new Date(s[e]);o.setMonth(o.getMonth()+f),l[r+t]=o.getTime(),u[r+t]=a[e]}else if(h)for(let t=0;t<n.length;t++){const e=n[t],o=new Date(s[e]);o.setFullYear(o.getFullYear()+f),l[r+t]=o.getTime(),u[r+t]=a[e]}else for(let t=0;t<n.length;t++){const e=n[t];l[r+t]=s[e]+w,u[r+t]=a[e]}self.postMessage("Done")}})();
|
|
1419
|
+
`, tt = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", $t], { type: "text/javascript;charset=utf-8" });
|
|
1420
|
+
function Er(e) {
|
|
1421
|
+
let t;
|
|
1422
|
+
try {
|
|
1423
|
+
if (t = tt && (self.URL || self.webkitURL).createObjectURL(tt), !t) throw "";
|
|
1424
|
+
const r = new Worker(t, {
|
|
1425
|
+
name: e?.name
|
|
1426
|
+
});
|
|
1427
|
+
return r.addEventListener("error", () => {
|
|
1428
|
+
(self.URL || self.webkitURL).revokeObjectURL(t);
|
|
1429
|
+
}), r;
|
|
1430
|
+
} catch {
|
|
1431
|
+
return new Worker(
|
|
1432
|
+
"data:text/javascript;charset=utf-8," + encodeURIComponent($t),
|
|
1433
|
+
{
|
|
1434
|
+
name: e?.name
|
|
1435
|
+
}
|
|
1436
|
+
);
|
|
1437
|
+
}
|
|
1438
|
+
}
|
|
1439
|
+
const Rt = `(function(){"use strict";function a(e,t,o,c){const n=[];let r=e[t];for(let s=t+1;s<=o;s++){const f=e[s];f-r>c&&n.push(s-1,s),r=f}return n}self.onmessage=e=>{const{bufferX:t,start:o,endInclusive:c,threshold:n}=e.data,r=new Float64Array(t);self.postMessage(a(r,o,c,n))}})();
|
|
1440
|
+
`, rt = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", Rt], { type: "text/javascript;charset=utf-8" });
|
|
1441
|
+
function kr(e) {
|
|
1442
|
+
let t;
|
|
1443
|
+
try {
|
|
1444
|
+
if (t = rt && (self.URL || self.webkitURL).createObjectURL(rt), !t) throw "";
|
|
1445
|
+
const r = new Worker(t, {
|
|
1446
|
+
name: e?.name
|
|
1447
|
+
});
|
|
1448
|
+
return r.addEventListener("error", () => {
|
|
1449
|
+
(self.URL || self.webkitURL).revokeObjectURL(t);
|
|
1450
|
+
}), r;
|
|
1451
|
+
} catch {
|
|
1452
|
+
return new Worker(
|
|
1453
|
+
"data:text/javascript;charset=utf-8," + encodeURIComponent(Rt),
|
|
1454
|
+
{
|
|
1455
|
+
name: e?.name
|
|
1456
|
+
}
|
|
1457
|
+
);
|
|
1458
|
+
}
|
|
1459
|
+
}
|
|
1460
|
+
const It = `(function(){"use strict";function c(u,s,t){const n=[];if(s>=t)return n;let e=s,o=u[s];for(let r=s+1;r<t;r++){const f=u[r];f!==o&&(n.push(e,r-e,o),e=r,o=f)}return n.push(e,t-e,o),n}self.onmessage=u=>{const{bufferY:s,start:t,end:n}=u.data,e=new Float32Array(s);self.postMessage(c(e,t,n))}})();
|
|
1461
|
+
`, nt = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", It], { type: "text/javascript;charset=utf-8" });
|
|
1462
|
+
function vr(e) {
|
|
1463
|
+
let t;
|
|
1464
|
+
try {
|
|
1465
|
+
if (t = nt && (self.URL || self.webkitURL).createObjectURL(nt), !t) throw "";
|
|
1466
|
+
const r = new Worker(t, {
|
|
1467
|
+
name: e?.name
|
|
1468
|
+
});
|
|
1469
|
+
return r.addEventListener("error", () => {
|
|
1470
|
+
(self.URL || self.webkitURL).revokeObjectURL(t);
|
|
1471
|
+
}), r;
|
|
1472
|
+
} catch {
|
|
1473
|
+
return new Worker(
|
|
1474
|
+
"data:text/javascript;charset=utf-8," + encodeURIComponent(It),
|
|
1475
|
+
{
|
|
1476
|
+
name: e?.name
|
|
1477
|
+
}
|
|
1478
|
+
);
|
|
1479
|
+
}
|
|
1480
|
+
}
|
|
1481
|
+
const Mt = `(function(){"use strict";function o(s,i,t,n,l){const f=[];if(n==="Less than")for(let e=i;e<t;e++)s[e]-s[e-1]<l&&f.push(e);else if(n==="Less than or equal to")for(let e=i;e<t;e++)s[e]-s[e-1]<=l&&f.push(e);else if(n==="Greater than")for(let e=i;e<t;e++)s[e]-s[e-1]>l&&f.push(e);else if(n==="Greater than or equal to")for(let e=i;e<t;e++)s[e]-s[e-1]>=l&&f.push(e);else if(n==="Equal")for(let e=i;e<t;e++)s[e]-s[e-1]==l&&f.push(e);return f}self.onmessage=s=>{const{bufferY:i,start:t,end:n,comparator:l,value:f}=s.data,e=new Float32Array(i);self.postMessage(o(e,t,n,l,f))}})();
|
|
1482
|
+
`, st = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", Mt], { type: "text/javascript;charset=utf-8" });
|
|
1483
|
+
function _r(e) {
|
|
1484
|
+
let t;
|
|
1485
|
+
try {
|
|
1486
|
+
if (t = st && (self.URL || self.webkitURL).createObjectURL(st), !t) throw "";
|
|
1487
|
+
const r = new Worker(t, {
|
|
1488
|
+
name: e?.name
|
|
1489
|
+
});
|
|
1490
|
+
return r.addEventListener("error", () => {
|
|
1491
|
+
(self.URL || self.webkitURL).revokeObjectURL(t);
|
|
1492
|
+
}), r;
|
|
1493
|
+
} catch {
|
|
1494
|
+
return new Worker(
|
|
1495
|
+
"data:text/javascript;charset=utf-8," + encodeURIComponent(Mt),
|
|
1496
|
+
{
|
|
1497
|
+
name: e?.name
|
|
1498
|
+
}
|
|
1499
|
+
);
|
|
1500
|
+
}
|
|
1501
|
+
}
|
|
1502
|
+
const Ut = `(function(){"use strict";function l(t,i,n,o,h){const f=[];if(o==="Less than")for(let e=i;e<n;e++){const s=t[e-1];(t[e]-s)/Math.abs(s)<h&&f.push(e)}else if(o==="Less than or equal to")for(let e=i;e<n;e++){const s=t[e-1];(t[e]-s)/Math.abs(s)<=h&&f.push(e)}else if(o==="Greater than")for(let e=i;e<n;e++){const s=t[e-1];(t[e]-s)/Math.abs(s)>h&&f.push(e)}else if(o==="Greater than or equal to")for(let e=i;e<n;e++){const s=t[e-1];(t[e]-s)/Math.abs(s)>=h&&f.push(e)}else if(o==="Equal")for(let e=i;e<n;e++){const s=t[e-1];(t[e]-s)/Math.abs(s)==h&&f.push(e)}return f}self.onmessage=t=>{const{bufferY:i,start:n,end:o,comparator:h,value:f}=t.data,e=new Float32Array(i);self.postMessage(l(e,n,o,h,f))}})();
|
|
1503
|
+
`, ot = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", Ut], { type: "text/javascript;charset=utf-8" });
|
|
1504
|
+
function Ar(e) {
|
|
1505
|
+
let t;
|
|
1506
|
+
try {
|
|
1507
|
+
if (t = ot && (self.URL || self.webkitURL).createObjectURL(ot), !t) throw "";
|
|
1508
|
+
const r = new Worker(t, {
|
|
1509
|
+
name: e?.name
|
|
1510
|
+
});
|
|
1511
|
+
return r.addEventListener("error", () => {
|
|
1512
|
+
(self.URL || self.webkitURL).revokeObjectURL(t);
|
|
1513
|
+
}), r;
|
|
1514
|
+
} catch {
|
|
1515
|
+
return new Worker(
|
|
1516
|
+
"data:text/javascript;charset=utf-8," + encodeURIComponent(Ut),
|
|
1517
|
+
{
|
|
1518
|
+
name: e?.name
|
|
1519
|
+
}
|
|
1520
|
+
);
|
|
1521
|
+
}
|
|
1522
|
+
}
|
|
1523
|
+
const Ot = `(function(){"use strict";function k(i,l,u,r,c){const f=[],b=r.length;for(let a=l;a<u;a++){const t=i[a];let e=!1;for(let n=0;n<b;n++){const o=r[n],s=c[n];if(o===0){if(t<s){e=!0;break}}else if(o===1){if(t<=s){e=!0;break}}else if(o===2){if(t>s){e=!0;break}}else if(o===3){if(t>=s){e=!0;break}}else if(t==s){e=!0;break}}e&&f.push(a)}return f}self.onmessage=i=>{const{bufferY:l,start:u,end:r,ops:c,values:f}=i.data,b=new Float32Array(l);self.postMessage(k(b,u,r,c,f))}})();
|
|
1524
|
+
`, at = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", Ot], { type: "text/javascript;charset=utf-8" });
|
|
1525
|
+
function $e(e) {
|
|
1526
|
+
let t;
|
|
1527
|
+
try {
|
|
1528
|
+
if (t = at && (self.URL || self.webkitURL).createObjectURL(at), !t) throw "";
|
|
1529
|
+
const r = new Worker(t, {
|
|
1530
|
+
name: e?.name
|
|
1531
|
+
});
|
|
1532
|
+
return r.addEventListener("error", () => {
|
|
1533
|
+
(self.URL || self.webkitURL).revokeObjectURL(t);
|
|
1534
|
+
}), r;
|
|
1535
|
+
} catch {
|
|
1536
|
+
return new Worker(
|
|
1537
|
+
"data:text/javascript;charset=utf-8," + encodeURIComponent(Ot),
|
|
1538
|
+
{
|
|
1539
|
+
name: e?.name
|
|
1540
|
+
}
|
|
1541
|
+
);
|
|
1542
|
+
}
|
|
1543
|
+
}
|
|
1544
|
+
const xt = `(function(){"use strict";function e(l,t,o,s){const c=t.length;if(o==="ADD")for(let f=0;f<c;f++)l[t[f]]=l[t[f]]+s;else if(o==="SUB")for(let f=0;f<c;f++)l[t[f]]=l[t[f]]-s;else if(o==="MULT")for(let f=0;f<c;f++)l[t[f]]=l[t[f]]*s;else if(o==="DIV")for(let f=0;f<c;f++)l[t[f]]=l[t[f]]/s;else if(o==="ASSIGN")for(let f=0;f<c;f++)l[t[f]]=s}self.onmessage=l=>{const{bufferY:t,indexes:o,operator:s,value:c}=l.data,f=new Float32Array(t);e(f,o,s,c),self.postMessage("Done")}})();
|
|
1545
|
+
`, it = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", xt], { type: "text/javascript;charset=utf-8" });
|
|
1546
|
+
function Lr(e) {
|
|
1547
|
+
let t;
|
|
1548
|
+
try {
|
|
1549
|
+
if (t = it && (self.URL || self.webkitURL).createObjectURL(it), !t) throw "";
|
|
1550
|
+
const r = new Worker(t, {
|
|
1551
|
+
name: e?.name
|
|
1552
|
+
});
|
|
1553
|
+
return r.addEventListener("error", () => {
|
|
1554
|
+
(self.URL || self.webkitURL).revokeObjectURL(t);
|
|
1555
|
+
}), r;
|
|
1556
|
+
} catch {
|
|
1557
|
+
return new Worker(
|
|
1558
|
+
"data:text/javascript;charset=utf-8," + encodeURIComponent(xt),
|
|
1559
|
+
{
|
|
1560
|
+
name: e?.name
|
|
1561
|
+
}
|
|
1562
|
+
);
|
|
1563
|
+
}
|
|
1564
|
+
}
|
|
1565
|
+
function Dt(e, t, r, n, s) {
|
|
1566
|
+
const a = [], o = n.length;
|
|
1567
|
+
for (let i = t; i < r; i++) {
|
|
1568
|
+
const l = e[i];
|
|
1569
|
+
let f = !1;
|
|
1570
|
+
for (let u = 0; u < o; u++) {
|
|
1571
|
+
const p = n[u], g = s[u];
|
|
1572
|
+
if (p === 0) {
|
|
1573
|
+
if (l < g) {
|
|
1574
|
+
f = !0;
|
|
1575
|
+
break;
|
|
1576
|
+
}
|
|
1577
|
+
} else if (p === 1) {
|
|
1578
|
+
if (l <= g) {
|
|
1579
|
+
f = !0;
|
|
1580
|
+
break;
|
|
1581
|
+
}
|
|
1582
|
+
} else if (p === 2) {
|
|
1583
|
+
if (l > g) {
|
|
1584
|
+
f = !0;
|
|
1585
|
+
break;
|
|
1586
|
+
}
|
|
1587
|
+
} else if (p === 3) {
|
|
1588
|
+
if (l >= g) {
|
|
1589
|
+
f = !0;
|
|
1590
|
+
break;
|
|
1591
|
+
}
|
|
1592
|
+
} else if (l == g) {
|
|
1593
|
+
f = !0;
|
|
1594
|
+
break;
|
|
1595
|
+
}
|
|
1596
|
+
}
|
|
1597
|
+
f && a.push(i);
|
|
1598
|
+
}
|
|
1599
|
+
return a;
|
|
1600
|
+
}
|
|
1601
|
+
function Tr(e, t, r, n, s) {
|
|
1602
|
+
const a = [];
|
|
1603
|
+
if (n === "Less than")
|
|
1604
|
+
for (let o = t; o < r; o++)
|
|
1605
|
+
e[o] - e[o - 1] < s && a.push(o);
|
|
1606
|
+
else if (n === "Less than or equal to")
|
|
1607
|
+
for (let o = t; o < r; o++)
|
|
1608
|
+
e[o] - e[o - 1] <= s && a.push(o);
|
|
1609
|
+
else if (n === "Greater than")
|
|
1610
|
+
for (let o = t; o < r; o++)
|
|
1611
|
+
e[o] - e[o - 1] > s && a.push(o);
|
|
1612
|
+
else if (n === "Greater than or equal to")
|
|
1613
|
+
for (let o = t; o < r; o++)
|
|
1614
|
+
e[o] - e[o - 1] >= s && a.push(o);
|
|
1615
|
+
else if (n === "Equal")
|
|
1616
|
+
for (let o = t; o < r; o++)
|
|
1617
|
+
e[o] - e[o - 1] == s && a.push(o);
|
|
1618
|
+
return a;
|
|
1619
|
+
}
|
|
1620
|
+
function $r(e, t, r, n, s) {
|
|
1621
|
+
const a = [];
|
|
1622
|
+
if (n === "Less than")
|
|
1623
|
+
for (let o = t; o < r; o++) {
|
|
1624
|
+
const i = e[o - 1];
|
|
1625
|
+
(e[o] - i) / Math.abs(i) < s && a.push(o);
|
|
1626
|
+
}
|
|
1627
|
+
else if (n === "Less than or equal to")
|
|
1628
|
+
for (let o = t; o < r; o++) {
|
|
1629
|
+
const i = e[o - 1];
|
|
1630
|
+
(e[o] - i) / Math.abs(i) <= s && a.push(o);
|
|
1631
|
+
}
|
|
1632
|
+
else if (n === "Greater than")
|
|
1633
|
+
for (let o = t; o < r; o++) {
|
|
1634
|
+
const i = e[o - 1];
|
|
1635
|
+
(e[o] - i) / Math.abs(i) > s && a.push(o);
|
|
1636
|
+
}
|
|
1637
|
+
else if (n === "Greater than or equal to")
|
|
1638
|
+
for (let o = t; o < r; o++) {
|
|
1639
|
+
const i = e[o - 1];
|
|
1640
|
+
(e[o] - i) / Math.abs(i) >= s && a.push(o);
|
|
1641
|
+
}
|
|
1642
|
+
else if (n === "Equal")
|
|
1643
|
+
for (let o = t; o < r; o++) {
|
|
1644
|
+
const i = e[o - 1];
|
|
1645
|
+
(e[o] - i) / Math.abs(i) == s && a.push(o);
|
|
1646
|
+
}
|
|
1647
|
+
return a;
|
|
1648
|
+
}
|
|
1649
|
+
function Rr(e, t, r, n) {
|
|
1650
|
+
const s = [];
|
|
1651
|
+
let a = e[t];
|
|
1652
|
+
for (let o = t + 1; o <= r; o++) {
|
|
1653
|
+
const i = e[o];
|
|
1654
|
+
i - a > n && s.push(o - 1, o), a = i;
|
|
1655
|
+
}
|
|
1656
|
+
return s;
|
|
1657
|
+
}
|
|
1658
|
+
function Ir(e, t, r) {
|
|
1659
|
+
const n = [];
|
|
1660
|
+
if (t >= r) return n;
|
|
1661
|
+
let s = t, a = e[t];
|
|
1662
|
+
for (let o = t + 1; o < r; o++) {
|
|
1663
|
+
const i = e[o];
|
|
1664
|
+
i !== a && (n.push(s, o - s, a), s = o, a = i);
|
|
1665
|
+
}
|
|
1666
|
+
return n.push(s, r - s, a), n;
|
|
1667
|
+
}
|
|
1668
|
+
function Mr(e, t, r, n, s, a, o, i, l, f, u) {
|
|
1669
|
+
let p = 0, g = i;
|
|
1670
|
+
for (let y = a; y <= o; y++)
|
|
1671
|
+
if (n[g] = e[y], s[g] = t[y], g++, p < r.length && y === r[p][0]) {
|
|
1672
|
+
const d = r[p][0], h = r[p][1], b = e[d], w = e[h], m = t[d], S = t[h], A = w - b, L = S - m;
|
|
1673
|
+
let T = b + l;
|
|
1674
|
+
for (; T < w; )
|
|
1675
|
+
n[g] = T, s[g] = f ? m + (T - b) * L / A : u, g++, T += l;
|
|
1676
|
+
p++;
|
|
1677
|
+
}
|
|
1678
|
+
return g - i;
|
|
1679
|
+
}
|
|
1680
|
+
function Ur(e, t, r, n, s, a, o, i) {
|
|
1681
|
+
let l = a, f = 0, u = i;
|
|
1682
|
+
const p = r.length;
|
|
1683
|
+
for (; l < o && f < p; ) {
|
|
1684
|
+
const g = r[f][0];
|
|
1685
|
+
e[l] <= g ? (n[u] = e[l], s[u] = t[l], l++) : (n[u] = g, s[u] = r[f][1], f++), u++;
|
|
1686
|
+
}
|
|
1687
|
+
for (; l < o; )
|
|
1688
|
+
n[u] = e[l], s[u] = t[l], l++, u++;
|
|
1689
|
+
for (; f < p; )
|
|
1690
|
+
n[u] = r[f][0], s[u] = r[f][1], f++, u++;
|
|
1691
|
+
return u - i;
|
|
1692
|
+
}
|
|
1693
|
+
function Or(e, t, r, n, s, a, o, i) {
|
|
1694
|
+
let l = 0, f = i;
|
|
1695
|
+
for (let u = a; u <= o; u++)
|
|
1696
|
+
l < r.length && u === r[l] ? l++ : (n[f] = e[u], s[f] = t[u], f++);
|
|
1697
|
+
return f - i;
|
|
1698
|
+
}
|
|
1699
|
+
function xr(e, t, r, n) {
|
|
1700
|
+
const s = r.length, a = new Array(s);
|
|
1701
|
+
if (n.isMonth)
|
|
1702
|
+
for (let o = 0; o < s; o++) {
|
|
1703
|
+
const i = r[o], l = new Date(e[i]);
|
|
1704
|
+
l.setMonth(l.getMonth() + n.amount), a[o] = [l.getTime(), t[i]];
|
|
1705
|
+
}
|
|
1706
|
+
else if (n.isYear)
|
|
1707
|
+
for (let o = 0; o < s; o++) {
|
|
1708
|
+
const i = r[o], l = new Date(e[i]);
|
|
1709
|
+
l.setFullYear(l.getFullYear() + n.amount), a[o] = [l.getTime(), t[i]];
|
|
1710
|
+
}
|
|
1711
|
+
else
|
|
1712
|
+
for (let o = 0; o < s; o++) {
|
|
1713
|
+
const i = r[o];
|
|
1714
|
+
a[o] = [e[i] + n.deltaMs, t[i]];
|
|
1715
|
+
}
|
|
1716
|
+
return a;
|
|
1717
|
+
}
|
|
1718
|
+
function Dr(e, t, r) {
|
|
1719
|
+
for (let n = 0; n < r.length; n++) {
|
|
1720
|
+
const { indexes: s, lowerIdx: a, upperIdx: o } = r[n], i = e[a], l = t[a], f = e[o], u = t[o], p = f - i, g = u - l;
|
|
1721
|
+
if (p === 0) {
|
|
1722
|
+
for (let y = 0; y < s.length; y++) t[s[y]] = l;
|
|
1723
|
+
continue;
|
|
1724
|
+
}
|
|
1725
|
+
for (let y = 0; y < s.length; y++) {
|
|
1726
|
+
const d = s[y];
|
|
1727
|
+
t[d] = l + (e[d] - i) * g / p;
|
|
1728
|
+
}
|
|
1729
|
+
}
|
|
1730
|
+
}
|
|
1731
|
+
function Cr(e, t, r) {
|
|
1732
|
+
for (let n = 0; n < r.length; n++) {
|
|
1733
|
+
const s = r[n][0], a = r[n][1], o = r[n][2];
|
|
1734
|
+
if (a <= s) continue;
|
|
1735
|
+
const i = e[s], l = e[a] - i;
|
|
1736
|
+
if (l !== 0)
|
|
1737
|
+
for (let f = s; f < a; f++)
|
|
1738
|
+
t[f] = t[f] + o * ((e[f] - i) / l);
|
|
1739
|
+
}
|
|
1740
|
+
}
|
|
1741
|
+
function ct(e, t, r, n) {
|
|
1742
|
+
const s = t.length;
|
|
1743
|
+
if (r === "ADD")
|
|
1744
|
+
for (let a = 0; a < s; a++) e[t[a]] = e[t[a]] + n;
|
|
1745
|
+
else if (r === "SUB")
|
|
1746
|
+
for (let a = 0; a < s; a++) e[t[a]] = e[t[a]] - n;
|
|
1747
|
+
else if (r === "MULT")
|
|
1748
|
+
for (let a = 0; a < s; a++) e[t[a]] = e[t[a]] * n;
|
|
1749
|
+
else if (r === "DIV")
|
|
1750
|
+
for (let a = 0; a < s; a++) e[t[a]] = e[t[a]] / n;
|
|
1751
|
+
else if (r === "ASSIGN")
|
|
1752
|
+
for (let a = 0; a < s; a++) e[t[a]] = n;
|
|
1753
|
+
}
|
|
1754
|
+
const Fr = 1, xe = `qc-utils:calibration:v${Fr}`, Pr = 720 * 60 * 60 * 1e3, ne = 5e4, se = 2e5, ce = {
|
|
1755
|
+
spawnOverheadMs: 50,
|
|
1756
|
+
// worst-case Windows
|
|
1757
|
+
inlineThroughput: 5e4,
|
|
1758
|
+
// 50M elements/sec, conservative
|
|
1759
|
+
workerThroughput: 8e4,
|
|
1760
|
+
// workers slightly faster in-loop once spawned
|
|
1761
|
+
hwConcurrency: 4,
|
|
1762
|
+
measuredAt: 0,
|
|
1763
|
+
userAgent: "default"
|
|
1764
|
+
};
|
|
1765
|
+
let M = jr() ?? ce, De = null, K = null;
|
|
1766
|
+
const Re = /* @__PURE__ */ new Set(), Ie = {
|
|
1767
|
+
// Filter ops — read-only scans, cheap kernels
|
|
1768
|
+
[v.VALUE_THRESHOLD]: {
|
|
1769
|
+
mode: "calibrated",
|
|
1770
|
+
weight: 1,
|
|
1771
|
+
rationale: "O(n) single-pass scan; baseline reference"
|
|
1772
|
+
},
|
|
1773
|
+
[v.CHANGE]: {
|
|
1774
|
+
mode: "calibrated",
|
|
1775
|
+
weight: 1.1,
|
|
1776
|
+
rationale: "O(n) with one subtraction per step"
|
|
1777
|
+
},
|
|
1778
|
+
[v.RATE_OF_CHANGE]: {
|
|
1779
|
+
mode: "calibrated",
|
|
1780
|
+
weight: 1.4,
|
|
1781
|
+
rationale: "O(n) with division + abs per step"
|
|
1782
|
+
},
|
|
1783
|
+
[v.FIND_GAPS]: {
|
|
1784
|
+
mode: "calibrated",
|
|
1785
|
+
weight: 0.9,
|
|
1786
|
+
rationale: "O(n) on X only, mostly empty output"
|
|
1787
|
+
},
|
|
1788
|
+
[v.PERSISTENCE]: {
|
|
1789
|
+
mode: "calibrated",
|
|
1790
|
+
weight: 1.3,
|
|
1791
|
+
rationale: "O(n) + chunk-boundary stitch"
|
|
1792
|
+
},
|
|
1793
|
+
[v.DATETIME_RANGE]: {
|
|
1794
|
+
mode: "always-inline",
|
|
1795
|
+
weight: 0,
|
|
1796
|
+
rationale: "O(log n) binary search; never worth the worker hop"
|
|
1797
|
+
},
|
|
1798
|
+
[v.SELECTION]: {
|
|
1799
|
+
mode: "always-inline",
|
|
1800
|
+
weight: 0,
|
|
1801
|
+
rationale: "Pure history bookkeeping"
|
|
1802
|
+
},
|
|
1803
|
+
// Edit ops — mutate Y in place or rebuild arrays
|
|
1804
|
+
[E.CHANGE_VALUES]: {
|
|
1805
|
+
mode: "calibrated",
|
|
1806
|
+
weight: 0.7,
|
|
1807
|
+
rationale: "O(k) in-place arithmetic on selection"
|
|
1808
|
+
},
|
|
1809
|
+
[E.ASSIGN_VALUES_BULK]: {
|
|
1810
|
+
mode: "always-inline",
|
|
1811
|
+
weight: 0,
|
|
1812
|
+
rationale: "Single tight loop, already inline"
|
|
1813
|
+
},
|
|
1814
|
+
[E.ASSIGN_DATETIMES_BULK]: {
|
|
1815
|
+
mode: "always-inline",
|
|
1816
|
+
weight: 0,
|
|
1817
|
+
rationale: "Composes delete+add which handle their own dispatch"
|
|
1818
|
+
},
|
|
1819
|
+
[E.INTERPOLATE]: {
|
|
1820
|
+
mode: "calibrated",
|
|
1821
|
+
weight: 1.5,
|
|
1822
|
+
rationale: "Linear interp per consecutive group; in-place writes"
|
|
1823
|
+
},
|
|
1824
|
+
[E.DRIFT_CORRECTION]: {
|
|
1825
|
+
mode: "calibrated",
|
|
1826
|
+
weight: 1.2,
|
|
1827
|
+
rationale: "O(range total) in-place math; one pass per range"
|
|
1828
|
+
},
|
|
1829
|
+
[E.SHIFT_DATETIMES]: {
|
|
1830
|
+
mode: "calibrated",
|
|
1831
|
+
weight: 1.1,
|
|
1832
|
+
rationale: "O(k) per-point shift math; inline skips SAB allocation"
|
|
1833
|
+
},
|
|
1834
|
+
[E.ADD_POINTS]: {
|
|
1835
|
+
mode: "calibrated",
|
|
1836
|
+
weight: 1.8,
|
|
1837
|
+
rationale: "Single merge pass over Y/X + insertions; fresh SAB per call"
|
|
1838
|
+
},
|
|
1839
|
+
[E.DELETE_POINTS]: {
|
|
1840
|
+
mode: "calibrated",
|
|
1841
|
+
weight: 1.4,
|
|
1842
|
+
rationale: "Single skip-on-delete pass over Y/X; fresh SAB per call"
|
|
1843
|
+
},
|
|
1844
|
+
[E.FILL_GAPS]: {
|
|
1845
|
+
mode: "calibrated",
|
|
1846
|
+
weight: 1.3,
|
|
1847
|
+
rationale: "Single copy-with-fills pass; fresh SAB sized to newLength"
|
|
1848
|
+
}
|
|
1849
|
+
};
|
|
1850
|
+
function U(e, t) {
|
|
1851
|
+
const r = Ie[e];
|
|
1852
|
+
if (!r)
|
|
1853
|
+
return {
|
|
1854
|
+
useWorker: !0,
|
|
1855
|
+
predictedInlineMs: 1 / 0,
|
|
1856
|
+
predictedWorkerMs: 0,
|
|
1857
|
+
reason: "unknown op; keeping default worker path"
|
|
1858
|
+
};
|
|
1859
|
+
if (r.mode === "always-inline")
|
|
1860
|
+
return {
|
|
1861
|
+
useWorker: !1,
|
|
1862
|
+
predictedInlineMs: 0,
|
|
1863
|
+
predictedWorkerMs: 0,
|
|
1864
|
+
reason: r.rationale
|
|
1865
|
+
};
|
|
1866
|
+
if (typeof SharedArrayBuffer > "u")
|
|
1867
|
+
return {
|
|
1868
|
+
useWorker: !1,
|
|
1869
|
+
predictedInlineMs: 0,
|
|
1870
|
+
predictedWorkerMs: 1 / 0,
|
|
1871
|
+
reason: "SharedArrayBuffer unavailable; forced inline"
|
|
1872
|
+
};
|
|
1873
|
+
if (r.mode === "always-worker")
|
|
1874
|
+
return {
|
|
1875
|
+
useWorker: !0,
|
|
1876
|
+
predictedInlineMs: 1 / 0,
|
|
1877
|
+
predictedWorkerMs: 0,
|
|
1878
|
+
reason: r.rationale
|
|
1879
|
+
};
|
|
1880
|
+
const n = Br(e, t);
|
|
1881
|
+
if (n <= 0)
|
|
1882
|
+
return {
|
|
1883
|
+
useWorker: !1,
|
|
1884
|
+
predictedInlineMs: 0,
|
|
1885
|
+
predictedWorkerMs: M.spawnOverheadMs,
|
|
1886
|
+
reason: "zero work units"
|
|
1887
|
+
};
|
|
1888
|
+
const s = Math.max(
|
|
1889
|
+
1,
|
|
1890
|
+
Math.min(
|
|
1891
|
+
t.parallelism ?? M.hwConcurrency,
|
|
1892
|
+
M.hwConcurrency
|
|
1893
|
+
)
|
|
1894
|
+
), a = r.weight * n / M.inlineThroughput, o = M.spawnOverheadMs + r.weight * n / (M.workerThroughput * s), i = a > o;
|
|
1895
|
+
return {
|
|
1896
|
+
useWorker: i,
|
|
1897
|
+
predictedInlineMs: a,
|
|
1898
|
+
predictedWorkerMs: o,
|
|
1899
|
+
reason: i ? `worker faster (${o.toFixed(1)} vs ${a.toFixed(1)} ms)` : `inline faster (${a.toFixed(1)} vs ${o.toFixed(1)} ms)`
|
|
1900
|
+
};
|
|
1901
|
+
}
|
|
1902
|
+
function Br(e, t) {
|
|
1903
|
+
switch (e) {
|
|
1904
|
+
case E.CHANGE_VALUES:
|
|
1905
|
+
case E.INTERPOLATE:
|
|
1906
|
+
case E.SHIFT_DATETIMES:
|
|
1907
|
+
case E.DRIFT_CORRECTION:
|
|
1908
|
+
return t.selectionSize ?? 0;
|
|
1909
|
+
case E.DELETE_POINTS:
|
|
1910
|
+
return (t.selectionSize ?? 0) + t.datasetSize * 0.25;
|
|
1911
|
+
case E.ADD_POINTS: {
|
|
1912
|
+
const r = Math.max(1, Math.log2(Math.max(t.datasetSize, 2)));
|
|
1913
|
+
return t.datasetSize + (t.selectionSize ?? 0) * r;
|
|
1914
|
+
}
|
|
1915
|
+
default:
|
|
1916
|
+
return t.datasetSize;
|
|
1917
|
+
}
|
|
1918
|
+
}
|
|
1919
|
+
function dn(e) {
|
|
1920
|
+
return Re.add(e), () => Re.delete(e);
|
|
1921
|
+
}
|
|
1922
|
+
function pn() {
|
|
1923
|
+
return M;
|
|
1924
|
+
}
|
|
1925
|
+
function yn() {
|
|
1926
|
+
return De;
|
|
1927
|
+
}
|
|
1928
|
+
function gn() {
|
|
1929
|
+
return Object.keys(Ie).map((e) => ({ op: e, ...Ie[e] }));
|
|
1930
|
+
}
|
|
1931
|
+
function mn() {
|
|
1932
|
+
M = ce, De = null;
|
|
1933
|
+
try {
|
|
1934
|
+
localStorage.removeItem(xe);
|
|
1935
|
+
} catch {
|
|
1936
|
+
}
|
|
1937
|
+
}
|
|
1938
|
+
async function wn(e = {}) {
|
|
1939
|
+
if (typeof window > "u" || !(e.force || M.measuredAt === 0 || Date.now() - M.measuredAt > Pr)) return M;
|
|
1940
|
+
if (K) await K;
|
|
1941
|
+
else {
|
|
1942
|
+
K = Nr().finally(() => {
|
|
1943
|
+
K = null;
|
|
1944
|
+
});
|
|
1945
|
+
const r = await K;
|
|
1946
|
+
M = r, Wr(r), De = r;
|
|
1947
|
+
for (const n of Re) n(M);
|
|
1948
|
+
}
|
|
1949
|
+
return M;
|
|
1950
|
+
}
|
|
1951
|
+
async function Nr() {
|
|
1952
|
+
if (!(typeof SharedArrayBuffer < "u"))
|
|
1953
|
+
return {
|
|
1954
|
+
...ce,
|
|
1955
|
+
measuredAt: Date.now(),
|
|
1956
|
+
userAgent: navigator.userAgent,
|
|
1957
|
+
hwConcurrency: navigator.hardwareConcurrency || ce.hwConcurrency,
|
|
1958
|
+
sharedArrayBufferAvailable: !1,
|
|
1959
|
+
samples: { spawnRoundtripMs: [], inlineScanMs: [], workerScanMs: [] }
|
|
1960
|
+
};
|
|
1961
|
+
const t = navigator.hardwareConcurrency || 4, r = new Float32Array(ne);
|
|
1962
|
+
for (let h = 0; h < ne; h++) r[h] = Math.sin(h);
|
|
1963
|
+
const n = await Se(3, () => {
|
|
1964
|
+
const h = performance.now();
|
|
1965
|
+
return Dt(r, 0, ne, [2], [0.5]), performance.now() - h;
|
|
1966
|
+
}), s = Ee(n), a = ne / Math.max(s, 1e-3), o = new SharedArrayBuffer(256 * Float32Array.BYTES_PER_ELEMENT), i = await Se(3, async () => {
|
|
1967
|
+
const h = performance.now();
|
|
1968
|
+
return await new Promise((b) => {
|
|
1969
|
+
const w = new $e();
|
|
1970
|
+
w.onmessage = () => {
|
|
1971
|
+
w.terminate(), b();
|
|
1972
|
+
}, w.postMessage({
|
|
1973
|
+
bufferY: o,
|
|
1974
|
+
start: 0,
|
|
1975
|
+
end: 256,
|
|
1976
|
+
ops: [2],
|
|
1977
|
+
values: [0.5]
|
|
1978
|
+
});
|
|
1979
|
+
}), performance.now() - h;
|
|
1980
|
+
}), l = Ee(i), f = new SharedArrayBuffer(
|
|
1981
|
+
se * Float32Array.BYTES_PER_ELEMENT
|
|
1982
|
+
), u = new Float32Array(f);
|
|
1983
|
+
for (let h = 0; h < se; h++) u[h] = Math.sin(h);
|
|
1984
|
+
const p = await Se(3, async () => {
|
|
1985
|
+
const h = performance.now();
|
|
1986
|
+
return await new Promise((b) => {
|
|
1987
|
+
const w = new $e();
|
|
1988
|
+
w.onmessage = () => {
|
|
1989
|
+
w.terminate(), b();
|
|
1990
|
+
}, w.postMessage({
|
|
1991
|
+
bufferY: f,
|
|
1992
|
+
start: 0,
|
|
1993
|
+
end: se,
|
|
1994
|
+
ops: [2],
|
|
1995
|
+
values: [0.5]
|
|
1996
|
+
});
|
|
1997
|
+
}), performance.now() - h;
|
|
1998
|
+
}), g = Math.max(Ee(p) - l, 0.1), y = se / g;
|
|
1999
|
+
return {
|
|
2000
|
+
spawnOverheadMs: l,
|
|
2001
|
+
inlineThroughput: a,
|
|
2002
|
+
workerThroughput: y,
|
|
2003
|
+
hwConcurrency: t,
|
|
2004
|
+
measuredAt: Date.now(),
|
|
2005
|
+
userAgent: navigator.userAgent,
|
|
2006
|
+
sharedArrayBufferAvailable: !0,
|
|
2007
|
+
samples: {
|
|
2008
|
+
spawnRoundtripMs: i,
|
|
2009
|
+
inlineScanMs: n,
|
|
2010
|
+
workerScanMs: p
|
|
2011
|
+
}
|
|
2012
|
+
};
|
|
2013
|
+
}
|
|
2014
|
+
async function Se(e, t) {
|
|
2015
|
+
const r = [];
|
|
2016
|
+
for (let n = 0; n < e; n++)
|
|
2017
|
+
await new Promise((s) => setTimeout(s, 0)), r.push(await t());
|
|
2018
|
+
return r;
|
|
2019
|
+
}
|
|
2020
|
+
function Ee(e) {
|
|
2021
|
+
if (!e.length) return 0;
|
|
2022
|
+
const t = [...e].sort((n, s) => n - s), r = Math.floor(t.length / 2);
|
|
2023
|
+
return t.length % 2 ? t[r] : (t[r - 1] + t[r]) / 2;
|
|
2024
|
+
}
|
|
2025
|
+
function jr() {
|
|
2026
|
+
if (typeof localStorage > "u") return null;
|
|
2027
|
+
try {
|
|
2028
|
+
const e = localStorage.getItem(xe);
|
|
2029
|
+
if (!e) return null;
|
|
2030
|
+
const t = JSON.parse(e);
|
|
2031
|
+
return !t || typeof t.spawnOverheadMs != "number" ? null : t;
|
|
2032
|
+
} catch {
|
|
2033
|
+
return null;
|
|
2034
|
+
}
|
|
2035
|
+
}
|
|
2036
|
+
function Wr(e) {
|
|
2037
|
+
if (!(typeof localStorage > "u"))
|
|
2038
|
+
try {
|
|
2039
|
+
const t = {
|
|
2040
|
+
spawnOverheadMs: e.spawnOverheadMs,
|
|
2041
|
+
inlineThroughput: e.inlineThroughput,
|
|
2042
|
+
workerThroughput: e.workerThroughput,
|
|
2043
|
+
hwConcurrency: e.hwConcurrency,
|
|
2044
|
+
measuredAt: e.measuredAt,
|
|
2045
|
+
userAgent: e.userAgent
|
|
2046
|
+
};
|
|
2047
|
+
localStorage.setItem(xe, JSON.stringify(t));
|
|
2048
|
+
} catch {
|
|
2049
|
+
}
|
|
2050
|
+
}
|
|
2051
|
+
const Q = 20 * 1e3, Gr = 1024, Yr = ["date", "value", "qualifier"];
|
|
2052
|
+
class bn {
|
|
1387
2053
|
/** The generated dataset to be used for plotting */
|
|
1388
2054
|
dataset = {
|
|
1389
|
-
dimensions:
|
|
2055
|
+
dimensions: Yr,
|
|
1390
2056
|
source: {
|
|
1391
2057
|
x: new Float64Array(
|
|
1392
2058
|
new SharedArrayBuffer(
|
|
1393
|
-
|
|
2059
|
+
Q * Float64Array.BYTES_PER_ELEMENT,
|
|
1394
2060
|
{
|
|
1395
|
-
maxByteLength:
|
|
2061
|
+
maxByteLength: Q * Float64Array.BYTES_PER_ELEMENT
|
|
1396
2062
|
// Max size the array can reach
|
|
1397
2063
|
}
|
|
1398
2064
|
)
|
|
1399
2065
|
),
|
|
1400
2066
|
y: new Float32Array(
|
|
1401
2067
|
new SharedArrayBuffer(
|
|
1402
|
-
|
|
2068
|
+
Q * Float32Array.BYTES_PER_ELEMENT,
|
|
1403
2069
|
{
|
|
1404
|
-
maxByteLength:
|
|
2070
|
+
maxByteLength: Q * Float32Array.BYTES_PER_ELEMENT
|
|
1405
2071
|
// Max size the array can reach
|
|
1406
2072
|
}
|
|
1407
2073
|
)
|
|
@@ -1409,6 +2075,30 @@ class Wt {
|
|
|
1409
2075
|
}
|
|
1410
2076
|
};
|
|
1411
2077
|
history = [];
|
|
2078
|
+
/**
|
|
2079
|
+
* Items popped off `history` by `undo()`, in undo order (top of stack
|
|
2080
|
+
* at the end). `redo()` re-dispatches the top. A fresh `dispatchAction`
|
|
2081
|
+
* / `dispatchFilter` call clears the stack — Word-style behavior where
|
|
2082
|
+
* a new edit invalidates the redo chain.
|
|
2083
|
+
*/
|
|
2084
|
+
redoStack = [];
|
|
2085
|
+
/**
|
|
2086
|
+
* True while `undo()` / `redo()` is replaying a captured history entry.
|
|
2087
|
+
* Suppresses the redo-stack clearing that otherwise fires on every new
|
|
2088
|
+
* dispatch, so the stack survives the internal replay.
|
|
2089
|
+
*/
|
|
2090
|
+
_isReplaying = !1;
|
|
2091
|
+
/**
|
|
2092
|
+
* Set by each operation handler (or any of its subroutines) to record
|
|
2093
|
+
* whether a worker was actually spawned during this dispatch. Sticky-
|
|
2094
|
+
* upgrade semantics: the wrapper resets it to `"inline"` before the
|
|
2095
|
+
* handler runs, and any code that spawns a worker flips it to
|
|
2096
|
+
* `"worker"`. Once flipped it stays flipped for the rest of the
|
|
2097
|
+
* dispatch — so an op whose top-level decision is "inline" but whose
|
|
2098
|
+
* sub-op (e.g. `_shift` → `_deleteDataPoints`) still spawns workers
|
|
2099
|
+
* will honestly show `"worker"` on its history entry.
|
|
2100
|
+
*/
|
|
2101
|
+
_pendingExecutionMode = "inline";
|
|
1412
2102
|
loadingTime = null;
|
|
1413
2103
|
isLoading = !0;
|
|
1414
2104
|
rawData;
|
|
@@ -1419,7 +2109,7 @@ class Wt {
|
|
|
1419
2109
|
if (!t)
|
|
1420
2110
|
return;
|
|
1421
2111
|
this.isLoading = !0;
|
|
1422
|
-
const r = await
|
|
2112
|
+
const r = await we(() => {
|
|
1423
2113
|
this._growBuffer(t.datetimes.length), this._resizeTo(t.datetimes.length), this.dataX.set(t.datetimes), this.dataY.set(t.dataValues);
|
|
1424
2114
|
});
|
|
1425
2115
|
this.loadingTime = r.duration, this.history.length = 0, this.isLoading = !1;
|
|
@@ -1448,22 +2138,22 @@ class Wt {
|
|
|
1448
2138
|
*/
|
|
1449
2139
|
_growBuffer(t) {
|
|
1450
2140
|
const r = t * Float64Array.BYTES_PER_ELEMENT;
|
|
1451
|
-
let
|
|
1452
|
-
for (; r >
|
|
1453
|
-
|
|
1454
|
-
if (
|
|
1455
|
-
const
|
|
2141
|
+
let n = this.dataX.buffer.byteLength;
|
|
2142
|
+
for (; r > n; )
|
|
2143
|
+
n += Q * Float64Array.BYTES_PER_ELEMENT;
|
|
2144
|
+
if (n * Float64Array.BYTES_PER_ELEMENT > this.dataX.buffer.maxByteLength) {
|
|
2145
|
+
const s = new SharedArrayBuffer(
|
|
1456
2146
|
this.dataX.buffer.byteLength,
|
|
1457
2147
|
{
|
|
1458
|
-
maxByteLength:
|
|
2148
|
+
maxByteLength: n * Float64Array.BYTES_PER_ELEMENT
|
|
1459
2149
|
}
|
|
1460
|
-
),
|
|
2150
|
+
), a = new SharedArrayBuffer(
|
|
1461
2151
|
this.dataY.buffer.byteLength,
|
|
1462
2152
|
{
|
|
1463
|
-
maxByteLength:
|
|
2153
|
+
maxByteLength: n * Float32Array.BYTES_PER_ELEMENT
|
|
1464
2154
|
}
|
|
1465
|
-
),
|
|
1466
|
-
|
|
2155
|
+
), o = new Float64Array(s), i = new Float32Array(a);
|
|
2156
|
+
o.set(this.dataX), i.set(this.dataY), this.dataset.source.x = o, this.dataset.source.y = i;
|
|
1467
2157
|
}
|
|
1468
2158
|
this.dataX.buffer.byteLength < t * Float64Array.BYTES_PER_ELEMENT && (this.dataX.buffer.grow(t * Float64Array.BYTES_PER_ELEMENT), this.dataY.buffer.grow(t * Float32Array.BYTES_PER_ELEMENT));
|
|
1469
2159
|
}
|
|
@@ -1479,7 +2169,7 @@ class Wt {
|
|
|
1479
2169
|
*/
|
|
1480
2170
|
async reloadHistory(t) {
|
|
1481
2171
|
const r = this.history.slice(0, t + 1);
|
|
1482
|
-
await this.reload(), await this.dispatch(r.map((
|
|
2172
|
+
return this.redoStack.length = 0, await this.reload(), await this.dispatch(r.map((n) => [n.method, ...n.args || []]));
|
|
1483
2173
|
}
|
|
1484
2174
|
/**
|
|
1485
2175
|
* Remove a history item
|
|
@@ -1487,7 +2177,38 @@ class Wt {
|
|
|
1487
2177
|
*/
|
|
1488
2178
|
async removeHistoryItem(t) {
|
|
1489
2179
|
const r = [...this.history];
|
|
1490
|
-
r.splice(t, 1), await this.reload(), await this.dispatch(r.map((
|
|
2180
|
+
return r.splice(t, 1), this.redoStack.length = 0, await this.reload(), await this.dispatch(r.map((n) => [n.method, ...n.args || []]));
|
|
2181
|
+
}
|
|
2182
|
+
/**
|
|
2183
|
+
* Undo the most recent history entry. Pushes it onto `redoStack` so a
|
|
2184
|
+
* subsequent `redo()` can re-apply it, then reloads from the raw
|
|
2185
|
+
* dataset and replays the remaining history in order.
|
|
2186
|
+
*/
|
|
2187
|
+
async undo() {
|
|
2188
|
+
if (!this.history.length) return [];
|
|
2189
|
+
const t = this.history[this.history.length - 1], r = this.history.slice(0, -1);
|
|
2190
|
+
await this.reload(), this.redoStack.push(t), this._isReplaying = !0;
|
|
2191
|
+
try {
|
|
2192
|
+
return await this.dispatch(r.map((n) => [n.method, ...n.args || []]));
|
|
2193
|
+
} finally {
|
|
2194
|
+
this._isReplaying = !1;
|
|
2195
|
+
}
|
|
2196
|
+
}
|
|
2197
|
+
/**
|
|
2198
|
+
* Re-apply the most recently undone entry from `redoStack`. The replay
|
|
2199
|
+
* runs through `dispatch`, which pushes a fresh history entry for it;
|
|
2200
|
+
* `_isReplaying` guards the redo stack from being wiped during the
|
|
2201
|
+
* dispatch.
|
|
2202
|
+
*/
|
|
2203
|
+
async redo() {
|
|
2204
|
+
if (!this.redoStack.length) return [];
|
|
2205
|
+
const t = this.redoStack.pop();
|
|
2206
|
+
this._isReplaying = !0;
|
|
2207
|
+
try {
|
|
2208
|
+
return await this.dispatch([[t.method, ...t.args || []]]);
|
|
2209
|
+
} finally {
|
|
2210
|
+
this._isReplaying = !1;
|
|
2211
|
+
}
|
|
1491
2212
|
}
|
|
1492
2213
|
get beginTime() {
|
|
1493
2214
|
return this.dataset.source.x.length ? new Date(this.dataset.source.x[0]) : null;
|
|
@@ -1496,87 +2217,103 @@ class Wt {
|
|
|
1496
2217
|
return this.dataset.source.x.length ? new Date(this.dataset.source.x[this.dataset.source.x.length - 1]) : null;
|
|
1497
2218
|
}
|
|
1498
2219
|
/** Dispatch an operation and log its signature in hisotry */
|
|
1499
|
-
async
|
|
1500
|
-
const
|
|
1501
|
-
[
|
|
1502
|
-
[
|
|
1503
|
-
[
|
|
1504
|
-
[
|
|
1505
|
-
[
|
|
1506
|
-
[
|
|
1507
|
-
[
|
|
1508
|
-
|
|
1509
|
-
[
|
|
1510
|
-
|
|
1511
|
-
[
|
|
1512
|
-
[
|
|
1513
|
-
[
|
|
1514
|
-
[
|
|
1515
|
-
[
|
|
2220
|
+
async dispatchAction(t, ...r) {
|
|
2221
|
+
const n = {
|
|
2222
|
+
[E.ADD_POINTS]: this._addDataPoints,
|
|
2223
|
+
[E.CHANGE_VALUES]: this._changeValues,
|
|
2224
|
+
[E.ASSIGN_VALUES_BULK]: this._assignValuesBulk,
|
|
2225
|
+
[E.DELETE_POINTS]: this._deleteDataPoints,
|
|
2226
|
+
[E.DRIFT_CORRECTION]: this._driftCorrection,
|
|
2227
|
+
[E.INTERPOLATE]: this._interpolate,
|
|
2228
|
+
[E.SHIFT_DATETIMES]: this._shift,
|
|
2229
|
+
[E.ASSIGN_DATETIMES_BULK]: this._assignDatetimesBulk,
|
|
2230
|
+
[E.FILL_GAPS]: this._fillGaps
|
|
2231
|
+
}, s = {
|
|
2232
|
+
[E.ADD_POINTS]: "mdi-plus",
|
|
2233
|
+
[E.CHANGE_VALUES]: "mdi-pencil",
|
|
2234
|
+
[E.ASSIGN_VALUES_BULK]: "mdi-pencil",
|
|
2235
|
+
[E.DELETE_POINTS]: "mdi-trash-can",
|
|
2236
|
+
[E.DRIFT_CORRECTION]: "mdi-chart-sankey",
|
|
2237
|
+
[E.INTERPOLATE]: "mdi-transit-connection-horizontal",
|
|
2238
|
+
[E.SHIFT_DATETIMES]: "mdi-calendar",
|
|
2239
|
+
[E.ASSIGN_DATETIMES_BULK]: "mdi-calendar",
|
|
2240
|
+
[E.FILL_GAPS]: "mdi-keyboard-space"
|
|
1516
2241
|
};
|
|
1517
|
-
let
|
|
2242
|
+
let a = [];
|
|
1518
2243
|
try {
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
c.args
|
|
1535
|
-
));
|
|
1536
|
-
c.duration = h.duration, c.isLoading = !1, n.push(h.response);
|
|
1537
|
-
}
|
|
1538
|
-
} else {
|
|
1539
|
-
const i = {
|
|
1540
|
-
method: t,
|
|
1541
|
-
args: r,
|
|
1542
|
-
icon: a[t],
|
|
1543
|
-
isLoading: !0
|
|
1544
|
-
};
|
|
1545
|
-
this.history.push(i);
|
|
1546
|
-
const c = await J(async () => await s[t].apply(this, r));
|
|
1547
|
-
n = c.response, i.duration = c.duration, i.isLoading = !1;
|
|
1548
|
-
}
|
|
1549
|
-
} catch (i) {
|
|
2244
|
+
this._isReplaying || (this.redoStack.length = 0);
|
|
2245
|
+
const o = {
|
|
2246
|
+
method: t,
|
|
2247
|
+
args: r,
|
|
2248
|
+
icon: s[t],
|
|
2249
|
+
isLoading: !0
|
|
2250
|
+
};
|
|
2251
|
+
this.history.push(o);
|
|
2252
|
+
const i = this.history.length - 1;
|
|
2253
|
+
this._pendingExecutionMode = "inline";
|
|
2254
|
+
const l = await we(async () => await n[t].apply(this, r));
|
|
2255
|
+
a = l.response;
|
|
2256
|
+
const f = this.history[i];
|
|
2257
|
+
f && (f.duration = l.duration, f.executionMode = this._pendingExecutionMode, f.isLoading = !1);
|
|
2258
|
+
} catch (o) {
|
|
1550
2259
|
console.log(
|
|
1551
2260
|
`Failed to execute operation: ${t} with arguments: `,
|
|
1552
2261
|
r
|
|
1553
|
-
), console.log(
|
|
2262
|
+
), console.log(o);
|
|
1554
2263
|
}
|
|
1555
|
-
return
|
|
2264
|
+
return a;
|
|
2265
|
+
}
|
|
2266
|
+
async dispatch(t, ...r) {
|
|
2267
|
+
const n = async (s, a) => v[s] ? await this.dispatchFilter(s, ...a) : await this.dispatchAction(s, ...a);
|
|
2268
|
+
if (Array.isArray(t)) {
|
|
2269
|
+
let s = [];
|
|
2270
|
+
for (let a = 0; a < t.length; a++) {
|
|
2271
|
+
const o = t[a][0], i = t[a].slice(1, t[a].length);
|
|
2272
|
+
s = await n(o, i);
|
|
2273
|
+
}
|
|
2274
|
+
return s;
|
|
2275
|
+
} else
|
|
2276
|
+
return await n(t, r);
|
|
1556
2277
|
}
|
|
1557
|
-
/** Filter operations do not transform the data and
|
|
2278
|
+
/** Filter operations do not transform the data and return a selection */
|
|
1558
2279
|
async dispatchFilter(t, ...r) {
|
|
1559
|
-
const
|
|
1560
|
-
[
|
|
1561
|
-
[
|
|
1562
|
-
[
|
|
1563
|
-
[
|
|
1564
|
-
[
|
|
2280
|
+
const n = {
|
|
2281
|
+
[v.FIND_GAPS]: this._findGaps,
|
|
2282
|
+
[v.VALUE_THRESHOLD]: this._valueThreshold,
|
|
2283
|
+
[v.DATETIME_RANGE]: this._datetimeRange,
|
|
2284
|
+
[v.PERSISTENCE]: this._persistence,
|
|
2285
|
+
[v.CHANGE]: this._change,
|
|
2286
|
+
[v.RATE_OF_CHANGE]: this._rateOfChange,
|
|
2287
|
+
[v.SELECTION]: this._selection
|
|
2288
|
+
}, s = {
|
|
2289
|
+
[v.FIND_GAPS]: "mdi-plus",
|
|
2290
|
+
[v.PERSISTENCE]: "mdi-plus",
|
|
2291
|
+
[v.CHANGE]: "mdi-plus",
|
|
2292
|
+
[v.RATE_OF_CHANGE]: "mdi-plus",
|
|
2293
|
+
[v.VALUE_THRESHOLD]: "mdi-plus",
|
|
2294
|
+
[v.DATETIME_RANGE]: "mdi-plus",
|
|
2295
|
+
[v.SELECTION]: "mdi-plus"
|
|
1565
2296
|
};
|
|
1566
2297
|
let a = [];
|
|
1567
2298
|
try {
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
2299
|
+
this._isReplaying || (this.redoStack.length = 0);
|
|
2300
|
+
const o = {
|
|
2301
|
+
method: t,
|
|
2302
|
+
args: r,
|
|
2303
|
+
icon: s[t],
|
|
2304
|
+
isLoading: !0
|
|
2305
|
+
}, i = this.history[this.history.length - 1];
|
|
2306
|
+
let l;
|
|
2307
|
+
v[i?.method] ? (l = this.history.length - 1, this.history[l] = o) : (this.history.push(o), l = this.history.length - 1), this._pendingExecutionMode = "inline";
|
|
2308
|
+
const f = await we(async () => await n[t].apply(this, r));
|
|
2309
|
+
a = f.response;
|
|
2310
|
+
const u = this.history[l];
|
|
2311
|
+
u && (u.duration = f.duration, u.executionMode = this._pendingExecutionMode, u.selected = f.response, u.isLoading = !1);
|
|
2312
|
+
} catch (o) {
|
|
1576
2313
|
console.log(
|
|
1577
2314
|
`Failed to execute filter operation: ${t} with arguments: `,
|
|
1578
2315
|
r
|
|
1579
|
-
), console.log(
|
|
2316
|
+
), console.log(o);
|
|
1580
2317
|
}
|
|
1581
2318
|
return a;
|
|
1582
2319
|
}
|
|
@@ -1584,48 +2321,151 @@ class Wt {
|
|
|
1584
2321
|
* @param index An array containing the list of index of values to perform the operations on.
|
|
1585
2322
|
* @param operator The operator that will be applied
|
|
1586
2323
|
* @param value The value to use in the operation
|
|
1587
|
-
* @returns
|
|
2324
|
+
* @returns an array of index values to keep selected in the plot
|
|
1588
2325
|
*/
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
2326
|
+
/**
|
|
2327
|
+
* Multi-threaded apply of an arithmetic operator to Y at the previously-filtered selection.
|
|
2328
|
+
* 1. Selection is read from the previous history entry (the last entry is this operation itself).
|
|
2329
|
+
* 2. Selection indexes are sharded into disjoint chunks; workers write in place to shared Y.
|
|
2330
|
+
* 3. Writes are conflict-free because the selection carries distinct indexes.
|
|
2331
|
+
*/
|
|
2332
|
+
async _changeValues(t, r) {
|
|
2333
|
+
const n = this.history[this.history.length - 2]?.selected;
|
|
2334
|
+
if (!n || n.length === 0) return [];
|
|
2335
|
+
const s = n.length;
|
|
2336
|
+
if (!U(E.CHANGE_VALUES, {
|
|
2337
|
+
datasetSize: this.dataset.source.y.length,
|
|
2338
|
+
selectionSize: s
|
|
2339
|
+
}).useWorker || s < Gr)
|
|
2340
|
+
return ct(this.dataY, n, t, r), [];
|
|
2341
|
+
this._pendingExecutionMode = "worker";
|
|
2342
|
+
const o = Math.min(navigator.hardwareConcurrency || 1, s), i = Math.ceil(s / o), l = [], f = [];
|
|
2343
|
+
for (let u = 0; u < o; u++) {
|
|
2344
|
+
const p = u * i, g = Math.min((u + 1) * i, s);
|
|
2345
|
+
if (p >= g) break;
|
|
2346
|
+
const y = n.slice(p, g);
|
|
2347
|
+
f.push(
|
|
2348
|
+
new Promise((d) => {
|
|
2349
|
+
const h = new Lr();
|
|
2350
|
+
l.push(h), h.postMessage({
|
|
2351
|
+
bufferY: this.dataY.buffer,
|
|
2352
|
+
indexes: y,
|
|
2353
|
+
operator: t,
|
|
2354
|
+
value: r
|
|
2355
|
+
}), h.onmessage = (b) => {
|
|
2356
|
+
d(b.data);
|
|
2357
|
+
};
|
|
2358
|
+
})
|
|
2359
|
+
);
|
|
2360
|
+
}
|
|
2361
|
+
return await Promise.all(f), l.forEach((u) => u.terminate()), [];
|
|
1609
2362
|
}
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
h[i],
|
|
1619
|
-
u[i],
|
|
1620
|
-
h[c],
|
|
1621
|
-
u[c]
|
|
1622
|
-
);
|
|
1623
|
-
});
|
|
2363
|
+
/**
|
|
2364
|
+
* Apply an arithmetic operator to Y in-place on the main thread. Thin
|
|
2365
|
+
* wrapper around {@link changeValuesCore} kept so `_assignValuesBulk`
|
|
2366
|
+
* and callers outside this module can use the same routine the
|
|
2367
|
+
* CHANGE_VALUES fast path does.
|
|
2368
|
+
*/
|
|
2369
|
+
_applyOperatorInPlace(t, r, n) {
|
|
2370
|
+
ct(this.dataY, t, r, n);
|
|
1624
2371
|
}
|
|
1625
|
-
/**
|
|
1626
|
-
|
|
1627
|
-
|
|
2372
|
+
/**
|
|
2373
|
+
* One-shot assignment of distinct Y-values at the indices logged by the
|
|
2374
|
+
* previous SELECTION filter entry. Args: `(values: number[])`, where
|
|
2375
|
+
* `values[i]` is written to `dataY[selection[i]]`. Runs as a single
|
|
2376
|
+
* tight loop on the main thread — no workers, no per-row dispatch
|
|
2377
|
+
* ceremony. Intended for table-driven edits.
|
|
2378
|
+
*
|
|
2379
|
+
* Expected dispatch order (matches CHANGE_VALUES):
|
|
2380
|
+
* [[SELECTION, indices], [ASSIGN_VALUES_BULK, values]]
|
|
2381
|
+
* The SELECTION entry carries the indices for history, so this op does
|
|
2382
|
+
* not log them again.
|
|
2383
|
+
*/
|
|
2384
|
+
async _assignValuesBulk(t) {
|
|
2385
|
+
const r = this.history[this.history.length - 2]?.selected;
|
|
2386
|
+
if (!r || !r.length || !t?.length) return [];
|
|
2387
|
+
const n = Math.min(r.length, t.length), s = this.dataY;
|
|
2388
|
+
for (let a = 0; a < n; a++) s[r[a]] = t[a];
|
|
2389
|
+
return [];
|
|
2390
|
+
}
|
|
2391
|
+
/**
|
|
2392
|
+
* One-shot assignment of distinct datetimes (epoch-ms) at the indices
|
|
2393
|
+
* logged by the previous SELECTION filter entry. Internally: compute
|
|
2394
|
+
* the replacement (x, y) pairs, do a single delete + single add — so
|
|
2395
|
+
* the reindex-and-sort step runs once regardless of how many rows changed.
|
|
2396
|
+
*
|
|
2397
|
+
* Expected dispatch order (matches SHIFT_DATETIMES pattern):
|
|
2398
|
+
* [[SELECTION, indices], [ASSIGN_DATETIMES_BULK, datetimes]]
|
|
2399
|
+
*/
|
|
2400
|
+
async _assignDatetimesBulk(t) {
|
|
2401
|
+
const r = this.history[this.history.length - 2]?.selected;
|
|
2402
|
+
if (!r || !r.length || !t?.length) return [];
|
|
2403
|
+
const n = Math.min(r.length, t.length), s = new Array(n), a = new Array(n);
|
|
2404
|
+
for (let o = 0; o < n; o++)
|
|
2405
|
+
s[o] = [t[o], this.dataY[r[o]]], a[o] = r[o];
|
|
2406
|
+
return a.sort((o, i) => o - i), await this._deleteDataPoints(a), await this._addDataPoints(s), [];
|
|
2407
|
+
}
|
|
2408
|
+
/**
|
|
2409
|
+
* Multi-threaded linear interpolation over the selected indexes.
|
|
2410
|
+
* 1. Main thread partitions the selected indexes into consecutive groups and computes each group's lower/upper anchors.
|
|
2411
|
+
* 2. Groups are sharded across workers (disjoint by construction, so in-place writes are safe).
|
|
2412
|
+
* 3. Each worker writes interpolated Y values directly into the shared Y buffer — no output copy needed since only a subset of Y changes.
|
|
2413
|
+
*/
|
|
2414
|
+
async _interpolate(t) {
|
|
2415
|
+
const r = this._getConsecutiveGroups(t);
|
|
2416
|
+
if (r.length === 0 || r[0].length === 0) return;
|
|
2417
|
+
const n = this.dataset.source.y.length, s = r.map((u) => ({
|
|
2418
|
+
indexes: u,
|
|
2419
|
+
lowerIdx: Math.max(0, u[0] - 1),
|
|
2420
|
+
upperIdx: Math.min(n - 1, u[u.length - 1] + 1)
|
|
2421
|
+
}));
|
|
2422
|
+
if (!U(E.INTERPOLATE, {
|
|
2423
|
+
datasetSize: n,
|
|
2424
|
+
selectionSize: t.length
|
|
2425
|
+
}).useWorker) {
|
|
2426
|
+
Dr(this.dataX, this.dataY, s);
|
|
2427
|
+
return;
|
|
2428
|
+
}
|
|
2429
|
+
this._pendingExecutionMode = "worker";
|
|
2430
|
+
const o = Math.min(
|
|
2431
|
+
navigator.hardwareConcurrency || 1,
|
|
2432
|
+
s.length
|
|
2433
|
+
), i = Math.ceil(s.length / o), l = [], f = [];
|
|
2434
|
+
for (let u = 0; u < o; u++) {
|
|
2435
|
+
const p = s.slice(
|
|
2436
|
+
u * i,
|
|
2437
|
+
(u + 1) * i
|
|
2438
|
+
);
|
|
2439
|
+
if (p.length === 0) break;
|
|
2440
|
+
f.push(
|
|
2441
|
+
new Promise((g) => {
|
|
2442
|
+
const y = new wr();
|
|
2443
|
+
l.push(y), y.postMessage({
|
|
2444
|
+
bufferX: this.dataX.buffer,
|
|
2445
|
+
bufferY: this.dataY.buffer,
|
|
2446
|
+
groups: p
|
|
2447
|
+
}), y.onmessage = (d) => {
|
|
2448
|
+
g(d.data);
|
|
2449
|
+
};
|
|
2450
|
+
})
|
|
2451
|
+
);
|
|
2452
|
+
}
|
|
2453
|
+
await Promise.all(f), l.forEach((u) => u.terminate());
|
|
1628
2454
|
}
|
|
2455
|
+
/** Interpolate existing values in the data source */
|
|
2456
|
+
// private _interpolateLinear(
|
|
2457
|
+
// datetime: number,
|
|
2458
|
+
// lowerDatetime: number,
|
|
2459
|
+
// lowerValue: number,
|
|
2460
|
+
// upperDatetime: number,
|
|
2461
|
+
// upperValue: number,
|
|
2462
|
+
// ) {
|
|
2463
|
+
// const interpolatedValue =
|
|
2464
|
+
// lowerValue +
|
|
2465
|
+
// ((datetime - lowerDatetime) * (upperValue - lowerValue)) /
|
|
2466
|
+
// (upperDatetime - lowerDatetime);
|
|
2467
|
+
// return interpolatedValue;
|
|
2468
|
+
// }
|
|
1629
2469
|
/**
|
|
1630
2470
|
* Shifts the selected indexes by specified amount of units. Elements are reinserted according to their datetime.
|
|
1631
2471
|
* @param index The index of the elements to shift
|
|
@@ -1633,60 +2473,141 @@ class Wt {
|
|
|
1633
2473
|
* @param unit {@link TimeUnit}
|
|
1634
2474
|
* @returns
|
|
1635
2475
|
*/
|
|
1636
|
-
async _shift(t, r,
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
2476
|
+
async _shift(t, r, n) {
|
|
2477
|
+
if (t.length === 0) return;
|
|
2478
|
+
const s = n === D.MONTH, a = n === D.YEAR, o = !s && !a ? r * te[n] * 1e3 : 0, i = t.length;
|
|
2479
|
+
if (!U(E.SHIFT_DATETIMES, {
|
|
2480
|
+
datasetSize: this.dataset.source.x.length,
|
|
2481
|
+
selectionSize: i
|
|
2482
|
+
}).useWorker) {
|
|
2483
|
+
const m = xr(
|
|
2484
|
+
this.dataX,
|
|
2485
|
+
this.dataY,
|
|
2486
|
+
t,
|
|
2487
|
+
{ amount: r, isMonth: s, isYear: a, deltaMs: o }
|
|
2488
|
+
);
|
|
2489
|
+
await this._deleteDataPoints(t), await this._addDataPoints(m);
|
|
2490
|
+
return;
|
|
2491
|
+
}
|
|
2492
|
+
this._pendingExecutionMode = "worker";
|
|
2493
|
+
const f = new SharedArrayBuffer(
|
|
2494
|
+
i * Float64Array.BYTES_PER_ELEMENT
|
|
2495
|
+
), u = new SharedArrayBuffer(
|
|
2496
|
+
i * Float32Array.BYTES_PER_ELEMENT
|
|
2497
|
+
), p = Math.min(navigator.hardwareConcurrency || 1, i), g = Math.ceil(i / p), y = [], d = [];
|
|
2498
|
+
for (let m = 0; m < p; m++) {
|
|
2499
|
+
const S = m * g, A = Math.min((m + 1) * g, i);
|
|
2500
|
+
if (S >= A) break;
|
|
2501
|
+
const L = t.slice(S, A);
|
|
2502
|
+
d.push(
|
|
2503
|
+
new Promise((T) => {
|
|
2504
|
+
const I = new Er();
|
|
2505
|
+
y.push(I), I.postMessage({
|
|
1654
2506
|
bufferX: this.dataX.buffer,
|
|
1655
2507
|
bufferY: this.dataY.buffer,
|
|
1656
|
-
outputBufferX:
|
|
1657
|
-
outputBufferY:
|
|
1658
|
-
|
|
1659
|
-
|
|
2508
|
+
outputBufferX: f,
|
|
2509
|
+
outputBufferY: u,
|
|
2510
|
+
indexes: L,
|
|
2511
|
+
outStart: S,
|
|
2512
|
+
amount: r,
|
|
2513
|
+
isMonth: s,
|
|
2514
|
+
isYear: a,
|
|
2515
|
+
deltaMs: o
|
|
2516
|
+
}), I.onmessage = (j) => {
|
|
2517
|
+
T(j.data);
|
|
1660
2518
|
};
|
|
1661
2519
|
})
|
|
1662
2520
|
);
|
|
1663
|
-
|
|
2521
|
+
}
|
|
2522
|
+
await Promise.all(d), y.forEach((m) => m.terminate());
|
|
2523
|
+
const h = new Float64Array(f), b = new Float32Array(u), w = new Array(i);
|
|
2524
|
+
for (let m = 0; m < i; m++)
|
|
2525
|
+
w[m] = [h[m], b[m]];
|
|
2526
|
+
await this._deleteDataPoints(t), await this._addDataPoints(w);
|
|
1664
2527
|
}
|
|
1665
2528
|
/**
|
|
1666
|
-
*
|
|
1667
|
-
*
|
|
1668
|
-
*
|
|
1669
|
-
*
|
|
1670
|
-
*
|
|
2529
|
+
* Multi-threaded version of {@link _fillGaps}.
|
|
2530
|
+
* 1. The main thread scans once for gaps and computes the number of fill points per gap.
|
|
2531
|
+
* 2. The original array is split into equal segments; each gap is assigned to the segment containing its left index.
|
|
2532
|
+
* 3. Cumulative fill counts before each segment give each worker's output startTarget, ensuring no overlap.
|
|
2533
|
+
* 4. Each worker copies its segment to the output buffer and inserts its gap fills inline.
|
|
1671
2534
|
*/
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
this.dataX[c[1]],
|
|
1684
|
-
this.dataY[c[1]]
|
|
1685
|
-
) : -9999;
|
|
1686
|
-
d.push([p, m]), p += l;
|
|
2535
|
+
async _fillGaps(t, r, n, s, a) {
|
|
2536
|
+
const o = this.dataX.length;
|
|
2537
|
+
if (o === 0) return;
|
|
2538
|
+
const i = t[0] * te[t[1]] * 1e3, l = r[0] * te[r[1]] * 1e3, f = a?.[0] ?? 0, u = a?.[1] ?? o - 1, p = this.dataX, g = [], y = [];
|
|
2539
|
+
let d = 0;
|
|
2540
|
+
for (let k = f + 1; k <= u; k++)
|
|
2541
|
+
if (p[k] - p[k - 1] > i) {
|
|
2542
|
+
let C = 0, W = p[k - 1] + l;
|
|
2543
|
+
for (; W < p[k]; )
|
|
2544
|
+
C++, W += l;
|
|
2545
|
+
C > 0 && (g.push([k - 1, k]), y.push(C), d += C);
|
|
1687
2546
|
}
|
|
1688
|
-
|
|
2547
|
+
if (d === 0) return;
|
|
2548
|
+
const h = o + d, b = h * Float64Array.BYTES_PER_ELEMENT, w = h * Float32Array.BYTES_PER_ELEMENT, m = new SharedArrayBuffer(b, {
|
|
2549
|
+
maxByteLength: Math.max(this.dataX.buffer.maxByteLength, b)
|
|
2550
|
+
}), S = new SharedArrayBuffer(w, {
|
|
2551
|
+
maxByteLength: Math.max(this.dataY.buffer.maxByteLength, w)
|
|
2552
|
+
});
|
|
2553
|
+
if (!U(E.FILL_GAPS, {
|
|
2554
|
+
datasetSize: o,
|
|
2555
|
+
selectionSize: d
|
|
2556
|
+
}).useWorker) {
|
|
2557
|
+
const k = new Float64Array(m), B = new Float32Array(S);
|
|
2558
|
+
Mr(
|
|
2559
|
+
this.dataX,
|
|
2560
|
+
this.dataY,
|
|
2561
|
+
g,
|
|
2562
|
+
k,
|
|
2563
|
+
B,
|
|
2564
|
+
0,
|
|
2565
|
+
o - 1,
|
|
2566
|
+
0,
|
|
2567
|
+
l,
|
|
2568
|
+
n,
|
|
2569
|
+
s
|
|
2570
|
+
), this.dataset.source.x = k, this.dataset.source.y = B, this._resizeTo(h);
|
|
2571
|
+
return;
|
|
1689
2572
|
}
|
|
2573
|
+
this._pendingExecutionMode = "worker";
|
|
2574
|
+
const L = navigator.hardwareConcurrency || 1, T = Math.ceil(o / L), I = [];
|
|
2575
|
+
let j = 0;
|
|
2576
|
+
for (let k = 0; k < L; k++) {
|
|
2577
|
+
const B = k * T, C = Math.min((k + 1) * T - 1, o - 1), W = [];
|
|
2578
|
+
let Z = 0;
|
|
2579
|
+
for (; j < g.length && g[j][0] <= C; )
|
|
2580
|
+
W.push(g[j]), Z += y[j], j++;
|
|
2581
|
+
I.push({ start: B, end: C, gapsSegment: W, fillsInSegment: Z });
|
|
2582
|
+
}
|
|
2583
|
+
const he = new Array(L).fill(0);
|
|
2584
|
+
for (let k = 1; k < L; k++)
|
|
2585
|
+
he[k] = he[k - 1] + I[k - 1].fillsInSegment;
|
|
2586
|
+
const Ce = [], Fe = [];
|
|
2587
|
+
for (let k = 0; k < L; k++) {
|
|
2588
|
+
const { start: B, end: C, gapsSegment: W } = I[k], Z = B + he[k];
|
|
2589
|
+
Fe.push(
|
|
2590
|
+
new Promise((Ct) => {
|
|
2591
|
+
const fe = new mr();
|
|
2592
|
+
Ce.push(fe), fe.postMessage({
|
|
2593
|
+
bufferX: this.dataX.buffer,
|
|
2594
|
+
bufferY: this.dataY.buffer,
|
|
2595
|
+
outputBufferX: m,
|
|
2596
|
+
outputBufferY: S,
|
|
2597
|
+
start: B,
|
|
2598
|
+
end: C,
|
|
2599
|
+
gapsSegment: W,
|
|
2600
|
+
startTarget: Z,
|
|
2601
|
+
fillDelta: l,
|
|
2602
|
+
interpolate: n,
|
|
2603
|
+
fillValue: s
|
|
2604
|
+
}), fe.onmessage = (Ft) => {
|
|
2605
|
+
Ct(Ft.data);
|
|
2606
|
+
};
|
|
2607
|
+
})
|
|
2608
|
+
);
|
|
2609
|
+
}
|
|
2610
|
+
await Promise.all(Fe), Ce.forEach((k) => k.terminate()), this.dataset.source.x = new Float64Array(m), this.dataset.source.y = new Float32Array(S), this._resizeTo(h);
|
|
1690
2611
|
}
|
|
1691
2612
|
/**
|
|
1692
2613
|
Deletes data points from a large array using worker threads.
|
|
@@ -1696,42 +2617,64 @@ class Wt {
|
|
|
1696
2617
|
4. Each worker processes its segment linearly, skipping deletions and copying kept elements to their computed positions.
|
|
1697
2618
|
* @param deleteIndices
|
|
1698
2619
|
*/
|
|
1699
|
-
// TODO: implement similar multithread solutions for other operations
|
|
1700
2620
|
async _deleteDataPoints(t) {
|
|
1701
|
-
const r =
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
}
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
2621
|
+
const r = this.dataX.length, n = r - t.length;
|
|
2622
|
+
if (!U(E.DELETE_POINTS, {
|
|
2623
|
+
datasetSize: r,
|
|
2624
|
+
selectionSize: t.length
|
|
2625
|
+
}).useWorker) {
|
|
2626
|
+
const y = new SharedArrayBuffer(this.dataX.buffer.byteLength, {
|
|
2627
|
+
maxByteLength: this.dataX.buffer.maxByteLength
|
|
2628
|
+
}), d = new SharedArrayBuffer(this.dataY.buffer.byteLength, {
|
|
2629
|
+
maxByteLength: this.dataY.buffer.maxByteLength
|
|
2630
|
+
}), h = new Float64Array(y), b = new Float32Array(d);
|
|
2631
|
+
Or(
|
|
2632
|
+
this.dataX,
|
|
2633
|
+
this.dataY,
|
|
2634
|
+
t,
|
|
2635
|
+
h,
|
|
2636
|
+
b,
|
|
2637
|
+
0,
|
|
2638
|
+
r - 1,
|
|
2639
|
+
0
|
|
2640
|
+
), this.dataset.source.x = h, this.dataset.source.y = b, this._resizeTo(n);
|
|
2641
|
+
return;
|
|
2642
|
+
}
|
|
2643
|
+
this._pendingExecutionMode = "worker";
|
|
2644
|
+
const a = navigator.hardwareConcurrency || 1, o = Math.ceil(this.dataX.length / a), i = [], l = [];
|
|
2645
|
+
for (let y = 0; y < a; y++) {
|
|
2646
|
+
const d = y * o, h = Math.min((y + 1) * o - 1, this.dataX.length - 1), b = re(t, d), w = be(t, h), m = t.slice(b, w + 1);
|
|
2647
|
+
l.push({ start: d, end: h, deleteSegment: m });
|
|
2648
|
+
}
|
|
2649
|
+
const f = new Array(a).fill(0);
|
|
2650
|
+
for (let y = 1; y < a; y++)
|
|
2651
|
+
f[y] = f[y - 1] + l[y - 1].deleteSegment.length;
|
|
2652
|
+
const u = [], p = new SharedArrayBuffer(this.dataX.buffer.byteLength, {
|
|
1710
2653
|
maxByteLength: this.dataX.buffer.maxByteLength
|
|
1711
|
-
}),
|
|
2654
|
+
}), g = new SharedArrayBuffer(this.dataY.buffer.byteLength, {
|
|
1712
2655
|
maxByteLength: this.dataY.buffer.maxByteLength
|
|
1713
2656
|
});
|
|
1714
|
-
for (let
|
|
1715
|
-
const { start:
|
|
1716
|
-
|
|
1717
|
-
new Promise((
|
|
1718
|
-
const
|
|
1719
|
-
|
|
2657
|
+
for (let y = 0; y < a; y++) {
|
|
2658
|
+
const { start: d, end: h, deleteSegment: b } = l[y], w = d - f[y];
|
|
2659
|
+
u.push(
|
|
2660
|
+
new Promise((m) => {
|
|
2661
|
+
const S = new gr();
|
|
2662
|
+
i.push(S), S.postMessage({
|
|
1720
2663
|
bufferX: this.dataX.buffer,
|
|
1721
2664
|
bufferY: this.dataY.buffer,
|
|
1722
|
-
outputBufferX:
|
|
1723
|
-
outputBufferY:
|
|
1724
|
-
start:
|
|
1725
|
-
end:
|
|
1726
|
-
deleteSegment:
|
|
1727
|
-
startTarget:
|
|
1728
|
-
}),
|
|
1729
|
-
|
|
2665
|
+
outputBufferX: p,
|
|
2666
|
+
outputBufferY: g,
|
|
2667
|
+
start: d,
|
|
2668
|
+
end: h,
|
|
2669
|
+
deleteSegment: b,
|
|
2670
|
+
startTarget: w
|
|
2671
|
+
}), S.onmessage = (A) => {
|
|
2672
|
+
m(A.data);
|
|
1730
2673
|
};
|
|
1731
2674
|
})
|
|
1732
2675
|
);
|
|
1733
2676
|
}
|
|
1734
|
-
await Promise.all(
|
|
2677
|
+
await Promise.all(u), i.forEach((y) => y.terminate()), this.dataset.source.x = new Float64Array(p), this.dataset.source.y = new Float32Array(g), this._resizeTo(n);
|
|
1735
2678
|
}
|
|
1736
2679
|
/**
|
|
1737
2680
|
*
|
|
@@ -1739,10 +2682,63 @@ class Wt {
|
|
|
1739
2682
|
* @param end The end index
|
|
1740
2683
|
* @param value The drift amount
|
|
1741
2684
|
*/
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
2685
|
+
/**
|
|
2686
|
+
* Multi-threaded drift correction over one or more [start, end, value] ranges.
|
|
2687
|
+
* 1. Main thread reads each range's anchors (startDatetime, extent) once and chunks the range.
|
|
2688
|
+
* 2. All chunks across all ranges are flattened into jobs and distributed round-robin across a fixed pool of workers.
|
|
2689
|
+
* 3. Each worker applies y_n = y_0 + value * ((x_i - startDatetime) / extent) in place on its jobs.
|
|
2690
|
+
* 4. Batching all ranges into a single call yields a single history entry.
|
|
2691
|
+
*/
|
|
2692
|
+
async _driftCorrection(t) {
|
|
2693
|
+
if (!t || t.length === 0) return;
|
|
2694
|
+
const r = this.dataset.source.x, n = navigator.hardwareConcurrency || 1;
|
|
2695
|
+
let s = 0;
|
|
2696
|
+
for (const [p, g] of t)
|
|
2697
|
+
g > p && (s += g - p);
|
|
2698
|
+
if (!U(E.DRIFT_CORRECTION, {
|
|
2699
|
+
datasetSize: r.length,
|
|
2700
|
+
selectionSize: s
|
|
2701
|
+
}).useWorker) {
|
|
2702
|
+
Cr(r, this.dataY, t);
|
|
2703
|
+
return;
|
|
2704
|
+
}
|
|
2705
|
+
this._pendingExecutionMode = "worker";
|
|
2706
|
+
const o = [];
|
|
2707
|
+
for (const [p, g, y] of t) {
|
|
2708
|
+
if (g <= p) continue;
|
|
2709
|
+
const d = r[p], h = r[g] - d;
|
|
2710
|
+
if (h === 0) continue;
|
|
2711
|
+
const b = g - p, w = Math.max(1, Math.ceil(b / n));
|
|
2712
|
+
for (let m = p; m < g; m += w)
|
|
2713
|
+
o.push({
|
|
2714
|
+
chunkStart: m,
|
|
2715
|
+
chunkEnd: Math.min(m + w, g),
|
|
2716
|
+
startDatetime: d,
|
|
2717
|
+
value: y,
|
|
2718
|
+
extent: h
|
|
2719
|
+
});
|
|
2720
|
+
}
|
|
2721
|
+
if (o.length === 0) return;
|
|
2722
|
+
const i = Math.min(n, o.length), l = Array.from(
|
|
2723
|
+
{ length: i },
|
|
2724
|
+
() => []
|
|
2725
|
+
);
|
|
2726
|
+
o.forEach((p, g) => l[g % i].push(p));
|
|
2727
|
+
const f = [], u = [];
|
|
2728
|
+
for (const p of l)
|
|
2729
|
+
p.length !== 0 && u.push(
|
|
2730
|
+
new Promise((g) => {
|
|
2731
|
+
const y = new br();
|
|
2732
|
+
f.push(y), y.postMessage({
|
|
2733
|
+
bufferX: this.dataX.buffer,
|
|
2734
|
+
bufferY: this.dataY.buffer,
|
|
2735
|
+
jobs: p
|
|
2736
|
+
}), y.onmessage = (d) => {
|
|
2737
|
+
g(d.data);
|
|
2738
|
+
};
|
|
2739
|
+
})
|
|
2740
|
+
);
|
|
2741
|
+
await Promise.all(u), f.forEach((p) => p.terminate());
|
|
1746
2742
|
}
|
|
1747
2743
|
/** Traverses the index array and returns groups of consecutive values.
|
|
1748
2744
|
* i.e.: `[0, 1, 3, 4, 6] => [[0, 1], [3, 4], [6]]`
|
|
@@ -1751,27 +2747,72 @@ class Wt {
|
|
|
1751
2747
|
*/
|
|
1752
2748
|
_getConsecutiveGroups(t) {
|
|
1753
2749
|
const r = [[]];
|
|
1754
|
-
return t.reduce((
|
|
1755
|
-
const
|
|
1756
|
-
return !
|
|
2750
|
+
return t.reduce((n, s) => {
|
|
2751
|
+
const a = n[n.length - 1];
|
|
2752
|
+
return !a.length || s == a[a.length - 1] + 1 ? a.push(s) : n.push([s]), n;
|
|
1757
2753
|
}, r), r;
|
|
1758
2754
|
}
|
|
1759
2755
|
/**
|
|
1760
|
-
* Adds data points
|
|
1761
|
-
*
|
|
2756
|
+
* Adds data points using worker threads.
|
|
2757
|
+
* 1. Main thread sorts insertions by datetime and computes each insertion's target index via binary search on the original X.
|
|
2758
|
+
* 2. The original array is split into equal chunks; each insertion is assigned to the chunk containing its target index.
|
|
2759
|
+
* 3. `firstIns` per chunk doubles as the prefix sum of insertions placed before the chunk, giving each worker its outStart in the output buffer without overlap.
|
|
2760
|
+
* 4. Each worker linearly merges its original slice with its insertion slice (both already sorted by datetime) into the output buffer. Originals win on datetime ties, matching the original `findLastLessOrEqual` semantics.
|
|
1762
2761
|
*/
|
|
1763
2762
|
async _addDataPoints(t) {
|
|
1764
|
-
|
|
1765
|
-
this.
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
2763
|
+
if (t.length === 0) return;
|
|
2764
|
+
const r = this.dataX.length, n = r + t.length;
|
|
2765
|
+
t.sort((d, h) => d[0] - h[0]);
|
|
2766
|
+
const s = n * Float64Array.BYTES_PER_ELEMENT, a = n * Float32Array.BYTES_PER_ELEMENT, o = new SharedArrayBuffer(s, {
|
|
2767
|
+
maxByteLength: Math.max(this.dataX.buffer.maxByteLength, s)
|
|
2768
|
+
}), i = new SharedArrayBuffer(a, {
|
|
2769
|
+
maxByteLength: Math.max(this.dataY.buffer.maxByteLength, a)
|
|
2770
|
+
});
|
|
2771
|
+
if (!U(E.ADD_POINTS, {
|
|
2772
|
+
datasetSize: r,
|
|
2773
|
+
selectionSize: t.length
|
|
2774
|
+
}).useWorker) {
|
|
2775
|
+
const d = new Float64Array(o), h = new Float32Array(i);
|
|
2776
|
+
Ur(
|
|
2777
|
+
this.dataX,
|
|
2778
|
+
this.dataY,
|
|
2779
|
+
t,
|
|
2780
|
+
d,
|
|
2781
|
+
h,
|
|
2782
|
+
0,
|
|
2783
|
+
r,
|
|
2784
|
+
0
|
|
2785
|
+
), this.dataset.source.x = d, this.dataset.source.y = h, this._resizeTo(n);
|
|
2786
|
+
return;
|
|
1774
2787
|
}
|
|
2788
|
+
this._pendingExecutionMode = "worker";
|
|
2789
|
+
const f = t.map(
|
|
2790
|
+
(d) => be(this.dataX, d[0]) + 1
|
|
2791
|
+
), u = Math.max(
|
|
2792
|
+
1,
|
|
2793
|
+
Math.min(navigator.hardwareConcurrency || 1, Math.max(r, 1))
|
|
2794
|
+
), p = Math.ceil(Math.max(r, 1) / u), g = [], y = [];
|
|
2795
|
+
for (let d = 0; d < u; d++) {
|
|
2796
|
+
const h = d * p, b = Math.min((d + 1) * p, r), w = re(f, h), m = d === u - 1 ? t.length : re(f, b), S = t.slice(w, m), A = h + w;
|
|
2797
|
+
h >= b && S.length === 0 || y.push(
|
|
2798
|
+
new Promise((L) => {
|
|
2799
|
+
const T = new Sr();
|
|
2800
|
+
g.push(T), T.postMessage({
|
|
2801
|
+
bufferX: this.dataX.buffer,
|
|
2802
|
+
bufferY: this.dataY.buffer,
|
|
2803
|
+
outputBufferX: o,
|
|
2804
|
+
outputBufferY: i,
|
|
2805
|
+
origStart: h,
|
|
2806
|
+
origEnd: b,
|
|
2807
|
+
insertions: S,
|
|
2808
|
+
outStart: A
|
|
2809
|
+
}), T.onmessage = (I) => {
|
|
2810
|
+
L(I.data);
|
|
2811
|
+
};
|
|
2812
|
+
})
|
|
2813
|
+
);
|
|
2814
|
+
}
|
|
2815
|
+
await Promise.all(y), g.forEach((d) => d.terminate()), this.dataset.source.x = new Float64Array(o), this.dataset.source.y = new Float32Array(i), this._resizeTo(n);
|
|
1775
2816
|
}
|
|
1776
2817
|
// =======================
|
|
1777
2818
|
// FILTER OPERATIONS
|
|
@@ -1779,16 +2820,59 @@ class Wt {
|
|
|
1779
2820
|
/**
|
|
1780
2821
|
* Filter by applying a set of logical operations
|
|
1781
2822
|
* @param appliedFilters
|
|
1782
|
-
* @returns
|
|
2823
|
+
* @returns an array of index values to select in the plot
|
|
1783
2824
|
*/
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
2825
|
+
/**
|
|
2826
|
+
* Filter by applying a set of logical operations, using worker threads.
|
|
2827
|
+
* 1. Main thread encodes filters as numeric opcodes + thresholds (cheaper than string compares in the hot loop).
|
|
2828
|
+
* 2. Workers scan disjoint chunks of Y; an index is selected if ANY filter matches (short-circuit).
|
|
2829
|
+
* 3. Results from each chunk are concatenated in order to preserve ascending indexes.
|
|
2830
|
+
*
|
|
2831
|
+
* Opcodes: 0=LT, 1=LTE, 2=GT, 3=GTE, 4=E.
|
|
2832
|
+
*/
|
|
2833
|
+
async _valueThreshold(t) {
|
|
2834
|
+
const r = Object.keys(t);
|
|
2835
|
+
if (r.length === 0) return [];
|
|
2836
|
+
const n = {
|
|
2837
|
+
[q.LT]: 0,
|
|
2838
|
+
[q.LTE]: 1,
|
|
2839
|
+
[q.GT]: 2,
|
|
2840
|
+
[q.GTE]: 3,
|
|
2841
|
+
[q.E]: 4
|
|
2842
|
+
}, s = r.map((h) => n[h] ?? 4), a = r.map((h) => t[h]), o = this.dataset.source.y, i = o.length;
|
|
2843
|
+
if (i === 0) return [];
|
|
2844
|
+
if (!U(v.VALUE_THRESHOLD, {
|
|
2845
|
+
datasetSize: i
|
|
2846
|
+
}).useWorker)
|
|
2847
|
+
return Dt(o, 0, i, s, a);
|
|
2848
|
+
this._pendingExecutionMode = "worker";
|
|
2849
|
+
const f = Math.min(navigator.hardwareConcurrency || 1, i), u = Math.ceil(i / f), p = [], g = [];
|
|
2850
|
+
for (let h = 0; h < f; h++) {
|
|
2851
|
+
const b = h * u, w = Math.min((h + 1) * u, i);
|
|
2852
|
+
if (b >= w) break;
|
|
2853
|
+
g.push(
|
|
2854
|
+
new Promise((m) => {
|
|
2855
|
+
const S = new $e();
|
|
2856
|
+
p.push(S), S.postMessage({
|
|
2857
|
+
bufferY: this.dataY.buffer,
|
|
2858
|
+
start: b,
|
|
2859
|
+
end: w,
|
|
2860
|
+
ops: s,
|
|
2861
|
+
values: a
|
|
2862
|
+
}), S.onmessage = (A) => {
|
|
2863
|
+
m(A.data);
|
|
2864
|
+
};
|
|
2865
|
+
})
|
|
2866
|
+
);
|
|
2867
|
+
}
|
|
2868
|
+
const y = await Promise.all(g);
|
|
2869
|
+
p.forEach((h) => h.terminate());
|
|
2870
|
+
const d = [];
|
|
2871
|
+
for (let h = 0; h < y.length; h++) {
|
|
2872
|
+
const b = y[h];
|
|
2873
|
+
for (let w = 0; w < b.length; w++) d.push(b[w]);
|
|
2874
|
+
}
|
|
2875
|
+
return d;
|
|
1792
2876
|
}
|
|
1793
2877
|
/**
|
|
1794
2878
|
*
|
|
@@ -1796,126 +2880,298 @@ class Wt {
|
|
|
1796
2880
|
* @param value
|
|
1797
2881
|
* @returns
|
|
1798
2882
|
*/
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
2883
|
+
/**
|
|
2884
|
+
* Find points where the relative rate `(curr - prev) / |prev|` satisfies the comparator, using worker threads.
|
|
2885
|
+
* 1. Main thread partitions scan range [1, dataY.length) into chunks; `Y[i-1]` is safely read from the shared buffer across chunk boundaries.
|
|
2886
|
+
* 2. Each worker runs a hoisted branch matching the comparator and returns matching indexes in ascending order.
|
|
2887
|
+
* 3. Main thread concatenates results in chunk order, preserving ascending order.
|
|
2888
|
+
*/
|
|
2889
|
+
async _rateOfChange(t, r) {
|
|
2890
|
+
const n = this.dataset.source.y;
|
|
2891
|
+
if (n.length < 2) return [];
|
|
2892
|
+
const s = 1, a = n.length, o = a - s;
|
|
2893
|
+
if (!U(v.RATE_OF_CHANGE, {
|
|
2894
|
+
datasetSize: n.length
|
|
2895
|
+
}).useWorker)
|
|
2896
|
+
return $r(n, s, a, t, r);
|
|
2897
|
+
this._pendingExecutionMode = "worker";
|
|
2898
|
+
const l = Math.min(navigator.hardwareConcurrency || 1, o), f = Math.ceil(o / l), u = [], p = [];
|
|
2899
|
+
for (let d = 0; d < l; d++) {
|
|
2900
|
+
const h = s + d * f, b = Math.min(s + (d + 1) * f, a);
|
|
2901
|
+
if (h >= b) break;
|
|
2902
|
+
p.push(
|
|
2903
|
+
new Promise((w) => {
|
|
2904
|
+
const m = new Ar();
|
|
2905
|
+
u.push(m), m.postMessage({
|
|
2906
|
+
bufferY: this.dataY.buffer,
|
|
2907
|
+
start: h,
|
|
2908
|
+
end: b,
|
|
2909
|
+
comparator: t,
|
|
2910
|
+
value: r
|
|
2911
|
+
}), m.onmessage = (S) => {
|
|
2912
|
+
w(S.data);
|
|
2913
|
+
};
|
|
2914
|
+
})
|
|
2915
|
+
);
|
|
1807
2916
|
}
|
|
1808
|
-
|
|
2917
|
+
const g = await Promise.all(p);
|
|
2918
|
+
u.forEach((d) => d.terminate());
|
|
2919
|
+
const y = [];
|
|
2920
|
+
for (let d = 0; d < g.length; d++) {
|
|
2921
|
+
const h = g[d];
|
|
2922
|
+
for (let b = 0; b < h.length; b++) y.push(h[b]);
|
|
2923
|
+
}
|
|
2924
|
+
return y;
|
|
1809
2925
|
}
|
|
1810
2926
|
/**
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
const
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
2927
|
+
* Select all points whose datetime falls inside `[from, to]` (inclusive).
|
|
2928
|
+
* `dataX` is sorted ascending, so binary search bounds the range in
|
|
2929
|
+
* O(log n) — no workers required. Pass `undefined` for either bound to
|
|
2930
|
+
* leave that side unconstrained; omitting both selects the full series.
|
|
2931
|
+
*/
|
|
2932
|
+
async _datetimeRange(t, r) {
|
|
2933
|
+
const n = this.dataset.source.x, s = n.length;
|
|
2934
|
+
if (s === 0) return [];
|
|
2935
|
+
const a = t == null ? 0 : re(n, t), o = r == null ? s - 1 : be(n, r);
|
|
2936
|
+
if (a > o) return [];
|
|
2937
|
+
const i = new Array(o - a + 1);
|
|
2938
|
+
for (let l = a; l <= o; l++) i[l - a] = l;
|
|
2939
|
+
return i;
|
|
2940
|
+
}
|
|
2941
|
+
/**
|
|
2942
|
+
* @param index
|
|
2943
|
+
* @returns
|
|
2944
|
+
*/
|
|
2945
|
+
async _selection(t) {
|
|
2946
|
+
return (!t || !t.length) && this.history.pop(), t;
|
|
2947
|
+
}
|
|
2948
|
+
/**
|
|
2949
|
+
*
|
|
2950
|
+
* @param comparator
|
|
2951
|
+
* @param value
|
|
2952
|
+
* @returns
|
|
2953
|
+
*/
|
|
2954
|
+
/**
|
|
2955
|
+
* Find points where the change from the previous value satisfies the comparator, using worker threads.
|
|
2956
|
+
* 1. Main thread partitions scan range [1, dataY.length) into chunks (each chunk's first index safely reads Y[i-1] from the shared buffer).
|
|
2957
|
+
* 2. Each worker runs a hoisted branch matching the comparator and returns matching indexes in ascending order.
|
|
2958
|
+
* 3. Main thread concatenates results in chunk order, preserving ascending order.
|
|
2959
|
+
*/
|
|
2960
|
+
async _change(t, r) {
|
|
2961
|
+
const n = this.dataset.source.y;
|
|
2962
|
+
if (n.length < 2) return [];
|
|
2963
|
+
const s = 1, a = n.length, o = a - s;
|
|
2964
|
+
if (!U(v.CHANGE, {
|
|
2965
|
+
datasetSize: n.length
|
|
2966
|
+
}).useWorker)
|
|
2967
|
+
return Tr(n, s, a, t, r);
|
|
2968
|
+
this._pendingExecutionMode = "worker";
|
|
2969
|
+
const l = Math.min(navigator.hardwareConcurrency || 1, o), f = Math.ceil(o / l), u = [], p = [];
|
|
2970
|
+
for (let d = 0; d < l; d++) {
|
|
2971
|
+
const h = s + d * f, b = Math.min(s + (d + 1) * f, a);
|
|
2972
|
+
if (h >= b) break;
|
|
2973
|
+
p.push(
|
|
2974
|
+
new Promise((w) => {
|
|
2975
|
+
const m = new _r();
|
|
2976
|
+
u.push(m), m.postMessage({
|
|
2977
|
+
bufferY: this.dataY.buffer,
|
|
2978
|
+
start: h,
|
|
2979
|
+
end: b,
|
|
2980
|
+
comparator: t,
|
|
2981
|
+
value: r
|
|
2982
|
+
}), m.onmessage = (S) => {
|
|
2983
|
+
w(S.data);
|
|
2984
|
+
};
|
|
2985
|
+
})
|
|
2986
|
+
);
|
|
2987
|
+
}
|
|
2988
|
+
const g = await Promise.all(p);
|
|
2989
|
+
u.forEach((d) => d.terminate());
|
|
2990
|
+
const y = [];
|
|
2991
|
+
for (let d = 0; d < g.length; d++) {
|
|
2992
|
+
const h = g[d];
|
|
2993
|
+
for (let b = 0; b < h.length; b++) y.push(h[b]);
|
|
1824
2994
|
}
|
|
1825
|
-
return
|
|
2995
|
+
return y;
|
|
1826
2996
|
}
|
|
1827
2997
|
/**
|
|
1828
|
-
* Find gaps in the data
|
|
2998
|
+
* Find gaps in the data using worker threads.
|
|
2999
|
+
* 1. Main thread slices the scan range [start, end] into equal chunks with a 1-index overlap so adjacent workers observe the boundary delta correctly.
|
|
3000
|
+
* 2. Each worker scans its chunk and returns a flat list of [leftIdx, rightIdx] pairs for gaps whose delta exceeds the threshold.
|
|
3001
|
+
* 3. Main thread collects all pairs and dedups via Set — identical return shape to the original implementation.
|
|
1829
3002
|
* @param value The time value
|
|
1830
3003
|
* @param unit The time unit (TimeUnit)
|
|
1831
3004
|
* @param range If specified, the gaps will be found only within the range
|
|
1832
|
-
* @returns
|
|
1833
3005
|
*/
|
|
1834
|
-
_findGaps(t, r,
|
|
1835
|
-
const
|
|
1836
|
-
let
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
3006
|
+
async _findGaps(t, r, n) {
|
|
3007
|
+
const s = this.dataset.source.x;
|
|
3008
|
+
let a = 0, o = s.length;
|
|
3009
|
+
if (n?.[0] && n?.[1] && (a = n[0], o = n[1]), o <= a) return [];
|
|
3010
|
+
const i = t * te[r] * 1e3;
|
|
3011
|
+
if (!U(v.FIND_GAPS, {
|
|
3012
|
+
datasetSize: o - a
|
|
3013
|
+
}).useWorker) {
|
|
3014
|
+
const b = Rr(s, a, o - 1, i), w = /* @__PURE__ */ new Set();
|
|
3015
|
+
for (let m = 0; m < b.length; m++) w.add(b[m]);
|
|
3016
|
+
return [...w];
|
|
1842
3017
|
}
|
|
1843
|
-
|
|
3018
|
+
this._pendingExecutionMode = "worker";
|
|
3019
|
+
const f = o - a, u = Math.min(navigator.hardwareConcurrency || 1, f), p = Math.ceil(f / u), g = [], y = [];
|
|
3020
|
+
for (let b = 0; b < u; b++) {
|
|
3021
|
+
const w = a + b * p, m = Math.min(a + (b + 1) * p, o);
|
|
3022
|
+
if (w >= m) break;
|
|
3023
|
+
y.push(
|
|
3024
|
+
new Promise((S) => {
|
|
3025
|
+
const A = new kr();
|
|
3026
|
+
g.push(A), A.postMessage({
|
|
3027
|
+
bufferX: this.dataX.buffer,
|
|
3028
|
+
start: w,
|
|
3029
|
+
endInclusive: m,
|
|
3030
|
+
threshold: i
|
|
3031
|
+
}), A.onmessage = (L) => {
|
|
3032
|
+
S(L.data);
|
|
3033
|
+
};
|
|
3034
|
+
})
|
|
3035
|
+
);
|
|
3036
|
+
}
|
|
3037
|
+
const d = await Promise.all(y);
|
|
3038
|
+
g.forEach((b) => b.terminate());
|
|
3039
|
+
const h = /* @__PURE__ */ new Set();
|
|
3040
|
+
for (let b = 0; b < d.length; b++) {
|
|
3041
|
+
const w = d[b];
|
|
3042
|
+
for (let m = 0; m < w.length; m++) h.add(w[m]);
|
|
3043
|
+
}
|
|
3044
|
+
return [...h];
|
|
1844
3045
|
}
|
|
1845
3046
|
/**
|
|
1846
|
-
* Find points where the values are the same at least
|
|
1847
|
-
*
|
|
3047
|
+
* Find points where the values are the same at least `times` in a row, using worker threads.
|
|
3048
|
+
* 1. Main thread splits [start, end) into chunks and each worker emits its maximal runs of equal Y values as flat (startIndex, length, value) triplets.
|
|
3049
|
+
* 2. Main thread stitches runs that cross chunk boundaries (same value, adjacent indexes).
|
|
3050
|
+
* 3. Every run whose stitched length is >= `times` contributes all of its indexes to the selection.
|
|
3051
|
+
*
|
|
3052
|
+
* Matches the Python reference implementation in `edit_service.py::persistence` — every member of a qualifying run is selected (including the run's first index).
|
|
3053
|
+
* @param times The minimum run length to qualify
|
|
1848
3054
|
* @param range If specified, the points will be found only within the range
|
|
1849
|
-
* @returns
|
|
1850
3055
|
*/
|
|
1851
|
-
_persistence(t, r) {
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
3056
|
+
async _persistence(t, r) {
|
|
3057
|
+
const n = this.dataset.source.y;
|
|
3058
|
+
let s = 0, a = n.length;
|
|
3059
|
+
if (r?.[0] && r?.[1] && (s = r[0], a = r[1]), a <= s) return [];
|
|
3060
|
+
const o = a - s;
|
|
3061
|
+
if (!U(v.PERSISTENCE, {
|
|
3062
|
+
datasetSize: o
|
|
3063
|
+
}).useWorker) {
|
|
3064
|
+
const w = Ir(n, s, a), m = [];
|
|
3065
|
+
for (let S = 0; S < w.length; S += 3) {
|
|
3066
|
+
const A = w[S], L = w[S + 1];
|
|
3067
|
+
if (L >= t)
|
|
3068
|
+
for (let T = 0; T < L; T++) m.push(A + T);
|
|
3069
|
+
}
|
|
3070
|
+
return m;
|
|
3071
|
+
}
|
|
3072
|
+
this._pendingExecutionMode = "worker";
|
|
3073
|
+
const l = Math.min(navigator.hardwareConcurrency || 1, o), f = Math.ceil(o / l), u = [], p = [];
|
|
3074
|
+
for (let w = 0; w < l; w++) {
|
|
3075
|
+
const m = s + w * f, S = Math.min(s + (w + 1) * f, a);
|
|
3076
|
+
if (m >= S) break;
|
|
3077
|
+
p.push(
|
|
3078
|
+
new Promise((A) => {
|
|
3079
|
+
const L = new vr();
|
|
3080
|
+
u.push(L), L.postMessage({
|
|
3081
|
+
bufferY: this.dataY.buffer,
|
|
3082
|
+
start: m,
|
|
3083
|
+
end: S
|
|
3084
|
+
}), L.onmessage = (T) => {
|
|
3085
|
+
A(T.data);
|
|
3086
|
+
};
|
|
3087
|
+
})
|
|
3088
|
+
);
|
|
3089
|
+
}
|
|
3090
|
+
const g = await Promise.all(p);
|
|
3091
|
+
u.forEach((w) => w.terminate());
|
|
3092
|
+
const y = [], d = [], h = [];
|
|
3093
|
+
for (let w = 0; w < g.length; w++) {
|
|
3094
|
+
const m = g[w];
|
|
3095
|
+
for (let S = 0; S < m.length; S += 3) {
|
|
3096
|
+
const A = m[S], L = m[S + 1], T = m[S + 2], I = y.length - 1;
|
|
3097
|
+
I >= 0 && h[I] === T && y[I] + d[I] === A ? d[I] += L : (y.push(A), d.push(L), h.push(T));
|
|
3098
|
+
}
|
|
3099
|
+
}
|
|
3100
|
+
const b = [];
|
|
3101
|
+
for (let w = 0; w < y.length; w++) {
|
|
3102
|
+
const m = d[w];
|
|
3103
|
+
if (m >= t) {
|
|
3104
|
+
const S = y[w];
|
|
3105
|
+
for (let A = 0; A < m; A++) b.push(S + A);
|
|
3106
|
+
}
|
|
3107
|
+
}
|
|
3108
|
+
return b;
|
|
1858
3109
|
}
|
|
1859
3110
|
}
|
|
1860
3111
|
export {
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
3112
|
+
x as ACCOUNT_BASE,
|
|
3113
|
+
Me as AUTH_BASE,
|
|
3114
|
+
rn as ApiKey,
|
|
3115
|
+
O as BASE_URL,
|
|
3116
|
+
sn as Collaborator,
|
|
3117
|
+
mt as DEFAULT_SNACK_DURATION,
|
|
3118
|
+
on as DataSource,
|
|
3119
|
+
Xr as Datastream,
|
|
3120
|
+
E as EnumEditOperations,
|
|
3121
|
+
v as EnumFilterOperations,
|
|
3122
|
+
q as FilterOperation,
|
|
3123
|
+
Nt as HydroShareArchive,
|
|
3124
|
+
Q as INCREASE_AMOUNT,
|
|
3125
|
+
jt as Location,
|
|
3126
|
+
Bt as LogicalOperation,
|
|
3127
|
+
tn as OAuthProvider,
|
|
3128
|
+
bn as ObservationRecord,
|
|
3129
|
+
Jr as ObservedProperty,
|
|
3130
|
+
Pt as Operator,
|
|
3131
|
+
Zr as Organization,
|
|
3132
|
+
ae as PROVIDER_BASE,
|
|
3133
|
+
ln as Payload,
|
|
3134
|
+
Wt as PermissionAction,
|
|
3135
|
+
Gt as PermissionResource,
|
|
3136
|
+
nr as Position,
|
|
3137
|
+
Hr as PostHydroShareArchive,
|
|
3138
|
+
Kr as ProcessingLevel,
|
|
3139
|
+
Qr as ResultQualifier,
|
|
3140
|
+
ge as SESSION_BASE,
|
|
3141
|
+
qr as Sensor,
|
|
3142
|
+
sr as Snack,
|
|
3143
|
+
wt as SnackColor,
|
|
3144
|
+
bt as SnackIcon,
|
|
3145
|
+
St as SnackTitle,
|
|
3146
|
+
or as Snackbar,
|
|
3147
|
+
qe as TAG_BASE,
|
|
3148
|
+
_ as THINGS_BASE,
|
|
3149
|
+
zr as Thing,
|
|
3150
|
+
D as TimeUnit,
|
|
3151
|
+
Vr as Unit,
|
|
3152
|
+
en as User,
|
|
3153
|
+
nn as Workspace,
|
|
3154
|
+
cn as api,
|
|
3155
|
+
c as apiMethods,
|
|
3156
|
+
mn as clearCalibration,
|
|
3157
|
+
Et as createPatchObject,
|
|
3158
|
+
wn as ensureCalibration,
|
|
3159
|
+
Yt as extractErrorMessage,
|
|
3160
|
+
re as findFirstGreaterOrEqual,
|
|
3161
|
+
be as findLastLessOrEqual,
|
|
3162
|
+
un as formatDate,
|
|
3163
|
+
hn as formatDuration,
|
|
3164
|
+
lt as getCSRFToken,
|
|
3165
|
+
pn as getCalibration,
|
|
3166
|
+
yn as getLastBenchmarkDetail,
|
|
3167
|
+
an as getObservationsEndpoint,
|
|
3168
|
+
gn as getOperationTable,
|
|
3169
|
+
we as measureEllapsedTime,
|
|
3170
|
+
dn as onCalibrationChange,
|
|
3171
|
+
ut as requestInterceptor,
|
|
3172
|
+
ht as responseInterceptor,
|
|
3173
|
+
Nr as runBenchmarks,
|
|
3174
|
+
U as shouldUseWorker,
|
|
3175
|
+
fn as subtractHours,
|
|
3176
|
+
te as timeUnitMultipliers
|
|
1921
3177
|
};
|