@uwrl/qc-utils 0.0.18 → 0.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +870 -869
- package/dist/index.umd.cjs +14 -14
- package/dist/utils/observations.d.ts +2 -2
- package/dist/utils/plotting/observation-record.d.ts +4 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var
|
|
2
|
-
class
|
|
1
|
+
var F = /* @__PURE__ */ ((e) => (e.SECOND = "s", e.MINUTE = "m", e.HOUR = "h", e.DAY = "D", e.WEEK = "W", e.MONTH = "M", e.YEAR = "Y", e))(F || {}), 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 || {}), J = /* @__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))(J || {}), Bt = /* @__PURE__ */ ((e) => (e.ADD = "ADD", e.SUB = "SUB", e.MULT = "MULT", e.DIV = "DIV", e.ASSIGN = "ASSIGN", e))(Bt || {}), jt = /* @__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))(jt || {});
|
|
2
|
+
class Wt {
|
|
3
3
|
id;
|
|
4
4
|
thingId;
|
|
5
5
|
link;
|
|
@@ -11,7 +11,7 @@ class Nt {
|
|
|
11
11
|
this.id = "", this.thingId = "", this.link = "", this.frequency = null, this.path = "HydroShare", this.datastreamIds = [], this.publicResource = !1;
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
class
|
|
14
|
+
class Vr extends Wt {
|
|
15
15
|
resourceTitle;
|
|
16
16
|
resourceAbstract;
|
|
17
17
|
resourceKeywords;
|
|
@@ -19,7 +19,7 @@ class Hr extends Nt {
|
|
|
19
19
|
super(), this.resourceTitle = void 0, this.resourceAbstract = void 0, this.resourceKeywords = void 0;
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
class
|
|
22
|
+
class Gt {
|
|
23
23
|
latitude;
|
|
24
24
|
longitude;
|
|
25
25
|
elevation_m;
|
|
@@ -31,11 +31,11 @@ class jt {
|
|
|
31
31
|
this.elevationDatum = "WGS84", this.state = "", this.county = "", this.country = "";
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
class
|
|
34
|
+
class qr {
|
|
35
35
|
id;
|
|
36
36
|
workspaceId;
|
|
37
37
|
name;
|
|
38
|
-
location = new
|
|
38
|
+
location = new Gt();
|
|
39
39
|
tags;
|
|
40
40
|
hydroShareArchive;
|
|
41
41
|
siteType;
|
|
@@ -48,7 +48,7 @@ class zr {
|
|
|
48
48
|
this.id = "", this.workspaceId = "", this.name = "", this.tags = [], this.siteType = "", this.samplingFeatureCode = "", this.isPrivate = !1, this.description = "", this.samplingFeatureType = "Site", this.dataDisclaimer = "";
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
class
|
|
51
|
+
class Jr {
|
|
52
52
|
id;
|
|
53
53
|
workspaceId;
|
|
54
54
|
name;
|
|
@@ -78,7 +78,7 @@ class Xr {
|
|
|
78
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;
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
class
|
|
81
|
+
class Kr {
|
|
82
82
|
id;
|
|
83
83
|
workspaceId;
|
|
84
84
|
name;
|
|
@@ -89,7 +89,7 @@ class Vr {
|
|
|
89
89
|
this.id = "", this.workspaceId = "", this.name = "", this.symbol = "", this.definition = "", this.type = "";
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
-
class
|
|
92
|
+
class Qr {
|
|
93
93
|
id;
|
|
94
94
|
workspaceId;
|
|
95
95
|
name;
|
|
@@ -105,7 +105,7 @@ class qr {
|
|
|
105
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 = "";
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
|
-
class
|
|
108
|
+
class Zr {
|
|
109
109
|
id;
|
|
110
110
|
workspaceId;
|
|
111
111
|
name;
|
|
@@ -117,7 +117,7 @@ class Jr {
|
|
|
117
117
|
this.id = "", this.workspaceId = "", this.name = "", this.definition = "", this.description = "", this.type = "Hydrology", this.code = "";
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
|
-
class
|
|
120
|
+
class es {
|
|
121
121
|
id;
|
|
122
122
|
workspaceId;
|
|
123
123
|
code;
|
|
@@ -127,7 +127,7 @@ class Kr {
|
|
|
127
127
|
this.id = "", this.workspaceId = "", this.code = "", this.definition = "", this.explanation = "";
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
class
|
|
130
|
+
class ts {
|
|
131
131
|
id;
|
|
132
132
|
workspaceId;
|
|
133
133
|
code;
|
|
@@ -136,7 +136,7 @@ class Qr {
|
|
|
136
136
|
this.id = "", this.workspaceId = "", this.code = "", this.description = "";
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
|
-
class
|
|
139
|
+
class rs {
|
|
140
140
|
name;
|
|
141
141
|
code;
|
|
142
142
|
type;
|
|
@@ -145,7 +145,7 @@ class Zr {
|
|
|
145
145
|
constructor() {
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
|
-
class
|
|
148
|
+
class ss {
|
|
149
149
|
id;
|
|
150
150
|
email;
|
|
151
151
|
password;
|
|
@@ -163,7 +163,7 @@ class en {
|
|
|
163
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;
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
|
-
class
|
|
166
|
+
class ns {
|
|
167
167
|
id;
|
|
168
168
|
name;
|
|
169
169
|
iconLink;
|
|
@@ -173,8 +173,8 @@ class tn {
|
|
|
173
173
|
this.id = "", this.name = "", this.iconLink = "", this.signupEnabled = !0, this.connectEnabled = !0;
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
|
-
var
|
|
177
|
-
class
|
|
176
|
+
var Yt = /* @__PURE__ */ ((e) => (e.Global = "*", e.View = "view", e.Create = "create", e.Edit = "edit", e.Delete = "delete", e))(Yt || {}), Ht = /* @__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))(Ht || {});
|
|
177
|
+
class os {
|
|
178
178
|
id = "";
|
|
179
179
|
key = "";
|
|
180
180
|
name = "";
|
|
@@ -189,7 +189,7 @@ class rn {
|
|
|
189
189
|
Object.assign(this, t);
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
|
-
class
|
|
192
|
+
class as {
|
|
193
193
|
id;
|
|
194
194
|
name;
|
|
195
195
|
isPrivate;
|
|
@@ -200,7 +200,7 @@ class nn {
|
|
|
200
200
|
this.id = "", this.name = "", this.isPrivate = !1, this.owner = null, this.collaboratorRole = null, this.pendingTransferTo = null;
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
|
-
class
|
|
203
|
+
class is {
|
|
204
204
|
user;
|
|
205
205
|
role;
|
|
206
206
|
constructor() {
|
|
@@ -223,25 +223,25 @@ class sn {
|
|
|
223
223
|
};
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
|
-
function
|
|
226
|
+
function ht() {
|
|
227
227
|
const e = "csrftoken=", r = decodeURIComponent(document.cookie).split(";");
|
|
228
|
-
for (const
|
|
229
|
-
const
|
|
230
|
-
if (
|
|
231
|
-
return
|
|
228
|
+
for (const s of r) {
|
|
229
|
+
const n = s.trim();
|
|
230
|
+
if (n.startsWith(e))
|
|
231
|
+
return n.substring(e.length);
|
|
232
232
|
}
|
|
233
233
|
return null;
|
|
234
234
|
}
|
|
235
|
-
function
|
|
235
|
+
function ft(e) {
|
|
236
236
|
let t = e.headers ? { ...e.headers } : {}, r;
|
|
237
|
-
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"] = ht() || "", {
|
|
238
238
|
...e,
|
|
239
239
|
headers: t,
|
|
240
240
|
body: r,
|
|
241
241
|
credentials: "omit"
|
|
242
242
|
};
|
|
243
243
|
}
|
|
244
|
-
function
|
|
244
|
+
function zt(e) {
|
|
245
245
|
if (Array.isArray(e?.errors) && e.errors.length && (e = e.errors[0]), typeof e != "object" || e === null)
|
|
246
246
|
return "An unknown error occurred.";
|
|
247
247
|
const t = ["message", "detail", "error"];
|
|
@@ -249,7 +249,7 @@ function Yt(e) {
|
|
|
249
249
|
if (e[r]) return e[r];
|
|
250
250
|
return "An unknown error occurred.";
|
|
251
251
|
}
|
|
252
|
-
async function
|
|
252
|
+
async function dt(e) {
|
|
253
253
|
if (e.headers.get("Content-Length") === "0" || e.statusText === "No Content")
|
|
254
254
|
return null;
|
|
255
255
|
const t = e.headers.get("content-type") || "";
|
|
@@ -257,84 +257,84 @@ async function ht(e) {
|
|
|
257
257
|
if (t.includes("application/json"))
|
|
258
258
|
try {
|
|
259
259
|
r = await e.json();
|
|
260
|
-
} catch (
|
|
261
|
-
console.error("Failed to parse error JSON:",
|
|
260
|
+
} catch (n) {
|
|
261
|
+
console.error("Failed to parse error JSON:", n);
|
|
262
262
|
}
|
|
263
263
|
else if (t.includes("text/csv"))
|
|
264
264
|
try {
|
|
265
265
|
r = await e.blob();
|
|
266
|
-
} catch (
|
|
267
|
-
console.error("Failed to parse error JSON:",
|
|
266
|
+
} catch (n) {
|
|
267
|
+
console.error("Failed to parse error JSON:", n);
|
|
268
268
|
}
|
|
269
269
|
if (e.ok || e.status === 401) return r;
|
|
270
|
-
const
|
|
270
|
+
const s = {
|
|
271
271
|
status: e.status,
|
|
272
|
-
message:
|
|
272
|
+
message: zt(r)
|
|
273
273
|
};
|
|
274
|
-
throw console.error("API response not OK:",
|
|
275
|
-
}
|
|
276
|
-
var
|
|
277
|
-
return
|
|
278
|
-
r.__proto__ =
|
|
279
|
-
} || function(r,
|
|
280
|
-
for (var
|
|
281
|
-
},
|
|
274
|
+
throw console.error("API response not OK:", s.message), s;
|
|
275
|
+
}
|
|
276
|
+
var ve = function(e, t) {
|
|
277
|
+
return ve = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(r, s) {
|
|
278
|
+
r.__proto__ = s;
|
|
279
|
+
} || function(r, s) {
|
|
280
|
+
for (var n in s) Object.prototype.hasOwnProperty.call(s, n) && (r[n] = s[n]);
|
|
281
|
+
}, ve(e, t);
|
|
282
282
|
};
|
|
283
|
-
function
|
|
283
|
+
function ue(e, t) {
|
|
284
284
|
if (typeof t != "function" && t !== null)
|
|
285
285
|
throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
|
|
286
|
-
|
|
286
|
+
ve(e, t);
|
|
287
287
|
function r() {
|
|
288
288
|
this.constructor = e;
|
|
289
289
|
}
|
|
290
290
|
e.prototype = t === null ? Object.create(t) : (r.prototype = t.prototype, new r());
|
|
291
291
|
}
|
|
292
|
-
function
|
|
293
|
-
var t = typeof Symbol == "function" && Symbol.iterator, r = t && e[t],
|
|
292
|
+
function _e(e) {
|
|
293
|
+
var t = typeof Symbol == "function" && Symbol.iterator, r = t && e[t], s = 0;
|
|
294
294
|
if (r) return r.call(e);
|
|
295
295
|
if (e && typeof e.length == "number") return {
|
|
296
296
|
next: function() {
|
|
297
|
-
return e &&
|
|
297
|
+
return e && s >= e.length && (e = void 0), { value: e && e[s++], done: !e };
|
|
298
298
|
}
|
|
299
299
|
};
|
|
300
300
|
throw new TypeError(t ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
301
301
|
}
|
|
302
|
-
function
|
|
302
|
+
function Ae(e, t) {
|
|
303
303
|
var r = typeof Symbol == "function" && e[Symbol.iterator];
|
|
304
304
|
if (!r) return e;
|
|
305
|
-
var
|
|
305
|
+
var s = r.call(e), n, a = [], o;
|
|
306
306
|
try {
|
|
307
|
-
for (; (t === void 0 || t-- > 0) && !(
|
|
307
|
+
for (; (t === void 0 || t-- > 0) && !(n = s.next()).done; ) a.push(n.value);
|
|
308
308
|
} catch (i) {
|
|
309
309
|
o = { error: i };
|
|
310
310
|
} finally {
|
|
311
311
|
try {
|
|
312
|
-
|
|
312
|
+
n && !n.done && (r = s.return) && r.call(s);
|
|
313
313
|
} finally {
|
|
314
314
|
if (o) throw o.error;
|
|
315
315
|
}
|
|
316
316
|
}
|
|
317
317
|
return a;
|
|
318
318
|
}
|
|
319
|
-
function
|
|
320
|
-
if (r || arguments.length === 2) for (var
|
|
321
|
-
(a || !(
|
|
319
|
+
function Te(e, t, r) {
|
|
320
|
+
if (r || arguments.length === 2) for (var s = 0, n = t.length, a; s < n; s++)
|
|
321
|
+
(a || !(s in t)) && (a || (a = Array.prototype.slice.call(t, 0, s)), a[s] = t[s]);
|
|
322
322
|
return e.concat(a || Array.prototype.slice.call(t));
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function N(e) {
|
|
325
325
|
return typeof e == "function";
|
|
326
326
|
}
|
|
327
|
-
function
|
|
328
|
-
var t = function(
|
|
329
|
-
Error.call(
|
|
327
|
+
function pt(e) {
|
|
328
|
+
var t = function(s) {
|
|
329
|
+
Error.call(s), s.stack = new Error().stack;
|
|
330
330
|
}, r = e(t);
|
|
331
331
|
return r.prototype = Object.create(Error.prototype), r.prototype.constructor = r, r;
|
|
332
332
|
}
|
|
333
|
-
var
|
|
333
|
+
var pe = pt(function(e) {
|
|
334
334
|
return function(r) {
|
|
335
335
|
e(this), this.message = r ? r.length + ` errors occurred during unsubscription:
|
|
336
|
-
` + r.map(function(
|
|
337
|
-
return
|
|
336
|
+
` + r.map(function(s, n) {
|
|
337
|
+
return n + 1 + ") " + s.toString();
|
|
338
338
|
}).join(`
|
|
339
339
|
`) : "", this.name = "UnsubscriptionError", this.errors = r;
|
|
340
340
|
};
|
|
@@ -345,19 +345,19 @@ function Le(e, t) {
|
|
|
345
345
|
0 <= r && e.splice(r, 1);
|
|
346
346
|
}
|
|
347
347
|
}
|
|
348
|
-
var
|
|
348
|
+
var he = (function() {
|
|
349
349
|
function e(t) {
|
|
350
350
|
this.initialTeardown = t, this.closed = !1, this._parentage = null, this._finalizers = null;
|
|
351
351
|
}
|
|
352
352
|
return e.prototype.unsubscribe = function() {
|
|
353
|
-
var t, r,
|
|
353
|
+
var t, r, s, n, a;
|
|
354
354
|
if (!this.closed) {
|
|
355
355
|
this.closed = !0;
|
|
356
356
|
var o = this._parentage;
|
|
357
357
|
if (o)
|
|
358
358
|
if (this._parentage = null, Array.isArray(o))
|
|
359
359
|
try {
|
|
360
|
-
for (var i =
|
|
360
|
+
for (var i = _e(o), l = i.next(); !l.done; l = i.next()) {
|
|
361
361
|
var f = l.value;
|
|
362
362
|
f.remove(this);
|
|
363
363
|
}
|
|
@@ -373,42 +373,42 @@ var ue = (function() {
|
|
|
373
373
|
else
|
|
374
374
|
o.remove(this);
|
|
375
375
|
var u = this.initialTeardown;
|
|
376
|
-
if (
|
|
376
|
+
if (N(u))
|
|
377
377
|
try {
|
|
378
378
|
u();
|
|
379
379
|
} catch (h) {
|
|
380
|
-
a = h instanceof
|
|
380
|
+
a = h instanceof pe ? h.errors : [h];
|
|
381
381
|
}
|
|
382
382
|
var p = this._finalizers;
|
|
383
383
|
if (p) {
|
|
384
384
|
this._finalizers = null;
|
|
385
385
|
try {
|
|
386
|
-
for (var g =
|
|
386
|
+
for (var g = _e(p), y = g.next(); !y.done; y = g.next()) {
|
|
387
387
|
var d = y.value;
|
|
388
388
|
try {
|
|
389
|
-
|
|
389
|
+
Ne(d);
|
|
390
390
|
} catch (h) {
|
|
391
|
-
a = a ?? [], h instanceof
|
|
391
|
+
a = a ?? [], h instanceof pe ? a = Te(Te([], Ae(a)), Ae(h.errors)) : a.push(h);
|
|
392
392
|
}
|
|
393
393
|
}
|
|
394
394
|
} catch (h) {
|
|
395
|
-
|
|
395
|
+
s = { error: h };
|
|
396
396
|
} finally {
|
|
397
397
|
try {
|
|
398
|
-
y && !y.done && (
|
|
398
|
+
y && !y.done && (n = g.return) && n.call(g);
|
|
399
399
|
} finally {
|
|
400
|
-
if (
|
|
400
|
+
if (s) throw s.error;
|
|
401
401
|
}
|
|
402
402
|
}
|
|
403
403
|
}
|
|
404
404
|
if (a)
|
|
405
|
-
throw new
|
|
405
|
+
throw new pe(a);
|
|
406
406
|
}
|
|
407
407
|
}, e.prototype.add = function(t) {
|
|
408
408
|
var r;
|
|
409
409
|
if (t && t !== this)
|
|
410
410
|
if (this.closed)
|
|
411
|
-
|
|
411
|
+
Ne(t);
|
|
412
412
|
else {
|
|
413
413
|
if (t instanceof e) {
|
|
414
414
|
if (t.closed || t._hasParent(this))
|
|
@@ -433,44 +433,44 @@ var ue = (function() {
|
|
|
433
433
|
var t = new e();
|
|
434
434
|
return t.closed = !0, t;
|
|
435
435
|
})(), e;
|
|
436
|
-
})(),
|
|
437
|
-
function
|
|
438
|
-
return e instanceof
|
|
436
|
+
})(), yt = he.EMPTY;
|
|
437
|
+
function gt(e) {
|
|
438
|
+
return e instanceof he || e && "closed" in e && N(e.remove) && N(e.add) && N(e.unsubscribe);
|
|
439
439
|
}
|
|
440
|
-
function
|
|
441
|
-
|
|
440
|
+
function Ne(e) {
|
|
441
|
+
N(e) ? e() : e.unsubscribe();
|
|
442
442
|
}
|
|
443
|
-
var
|
|
443
|
+
var Xt = {
|
|
444
444
|
Promise: void 0
|
|
445
|
-
},
|
|
445
|
+
}, Vt = {
|
|
446
446
|
setTimeout: function(e, t) {
|
|
447
|
-
for (var r = [],
|
|
448
|
-
r[
|
|
449
|
-
return setTimeout.apply(void 0,
|
|
447
|
+
for (var r = [], s = 2; s < arguments.length; s++)
|
|
448
|
+
r[s - 2] = arguments[s];
|
|
449
|
+
return setTimeout.apply(void 0, Te([e, t], Ae(r)));
|
|
450
450
|
},
|
|
451
451
|
clearTimeout: function(e) {
|
|
452
452
|
return clearTimeout(e);
|
|
453
453
|
},
|
|
454
454
|
delegate: void 0
|
|
455
455
|
};
|
|
456
|
-
function
|
|
457
|
-
|
|
456
|
+
function qt(e) {
|
|
457
|
+
Vt.setTimeout(function() {
|
|
458
458
|
throw e;
|
|
459
459
|
});
|
|
460
460
|
}
|
|
461
461
|
function Be() {
|
|
462
462
|
}
|
|
463
|
-
function
|
|
463
|
+
function ae(e) {
|
|
464
464
|
e();
|
|
465
465
|
}
|
|
466
|
-
var
|
|
467
|
-
|
|
466
|
+
var mt = (function(e) {
|
|
467
|
+
ue(t, e);
|
|
468
468
|
function t(r) {
|
|
469
|
-
var
|
|
470
|
-
return
|
|
469
|
+
var s = e.call(this) || this;
|
|
470
|
+
return s.isStopped = !1, r ? (s.destination = r, gt(r) && r.add(s)) : s.destination = Qt, s;
|
|
471
471
|
}
|
|
472
|
-
return t.create = function(r,
|
|
473
|
-
return new
|
|
472
|
+
return t.create = function(r, s, n) {
|
|
473
|
+
return new $e(r, s, n);
|
|
474
474
|
}, t.prototype.next = function(r) {
|
|
475
475
|
this.isStopped || this._next(r);
|
|
476
476
|
}, t.prototype.error = function(r) {
|
|
@@ -494,7 +494,7 @@ var yt = (function(e) {
|
|
|
494
494
|
this.unsubscribe();
|
|
495
495
|
}
|
|
496
496
|
}, t;
|
|
497
|
-
})(
|
|
497
|
+
})(he), Jt = (function() {
|
|
498
498
|
function e(t) {
|
|
499
499
|
this.partialObserver = t;
|
|
500
500
|
}
|
|
@@ -503,76 +503,76 @@ var yt = (function(e) {
|
|
|
503
503
|
if (r.next)
|
|
504
504
|
try {
|
|
505
505
|
r.next(t);
|
|
506
|
-
} catch (
|
|
507
|
-
|
|
506
|
+
} catch (s) {
|
|
507
|
+
te(s);
|
|
508
508
|
}
|
|
509
509
|
}, e.prototype.error = function(t) {
|
|
510
510
|
var r = this.partialObserver;
|
|
511
511
|
if (r.error)
|
|
512
512
|
try {
|
|
513
513
|
r.error(t);
|
|
514
|
-
} catch (
|
|
515
|
-
|
|
514
|
+
} catch (s) {
|
|
515
|
+
te(s);
|
|
516
516
|
}
|
|
517
517
|
else
|
|
518
|
-
|
|
518
|
+
te(t);
|
|
519
519
|
}, e.prototype.complete = function() {
|
|
520
520
|
var t = this.partialObserver;
|
|
521
521
|
if (t.complete)
|
|
522
522
|
try {
|
|
523
523
|
t.complete();
|
|
524
524
|
} catch (r) {
|
|
525
|
-
|
|
525
|
+
te(r);
|
|
526
526
|
}
|
|
527
527
|
}, e;
|
|
528
|
-
})(),
|
|
529
|
-
|
|
530
|
-
function t(r,
|
|
528
|
+
})(), $e = (function(e) {
|
|
529
|
+
ue(t, e);
|
|
530
|
+
function t(r, s, n) {
|
|
531
531
|
var a = e.call(this) || this, o;
|
|
532
|
-
return
|
|
532
|
+
return N(r) || !r ? o = {
|
|
533
533
|
next: r ?? void 0,
|
|
534
|
-
error:
|
|
535
|
-
complete:
|
|
536
|
-
} : o = r, a.destination = new
|
|
534
|
+
error: s ?? void 0,
|
|
535
|
+
complete: n ?? void 0
|
|
536
|
+
} : o = r, a.destination = new Jt(o), a;
|
|
537
537
|
}
|
|
538
538
|
return t;
|
|
539
|
-
})(
|
|
540
|
-
function
|
|
541
|
-
|
|
539
|
+
})(mt);
|
|
540
|
+
function te(e) {
|
|
541
|
+
qt(e);
|
|
542
542
|
}
|
|
543
|
-
function
|
|
543
|
+
function Kt(e) {
|
|
544
544
|
throw e;
|
|
545
545
|
}
|
|
546
|
-
var
|
|
546
|
+
var Qt = {
|
|
547
547
|
closed: !0,
|
|
548
548
|
next: Be,
|
|
549
|
-
error:
|
|
549
|
+
error: Kt,
|
|
550
550
|
complete: Be
|
|
551
|
-
},
|
|
551
|
+
}, Zt = (function() {
|
|
552
552
|
return typeof Symbol == "function" && Symbol.observable || "@@observable";
|
|
553
553
|
})();
|
|
554
|
-
function
|
|
554
|
+
function er(e) {
|
|
555
555
|
return e;
|
|
556
556
|
}
|
|
557
|
-
function
|
|
558
|
-
return e.length === 0 ?
|
|
559
|
-
return e.reduce(function(
|
|
560
|
-
return s
|
|
557
|
+
function tr(e) {
|
|
558
|
+
return e.length === 0 ? er : e.length === 1 ? e[0] : function(r) {
|
|
559
|
+
return e.reduce(function(s, n) {
|
|
560
|
+
return n(s);
|
|
561
561
|
}, r);
|
|
562
562
|
};
|
|
563
563
|
}
|
|
564
|
-
var
|
|
564
|
+
var je = (function() {
|
|
565
565
|
function e(t) {
|
|
566
566
|
t && (this._subscribe = t);
|
|
567
567
|
}
|
|
568
568
|
return e.prototype.lift = function(t) {
|
|
569
569
|
var r = new e();
|
|
570
570
|
return r.source = this, r.operator = t, r;
|
|
571
|
-
}, e.prototype.subscribe = function(t, r,
|
|
572
|
-
var
|
|
573
|
-
return
|
|
574
|
-
var o =
|
|
575
|
-
a.add(i ? i.call(a, l) : l ?
|
|
571
|
+
}, e.prototype.subscribe = function(t, r, s) {
|
|
572
|
+
var n = this, a = sr(t) ? t : new $e(t, r, s);
|
|
573
|
+
return ae(function() {
|
|
574
|
+
var o = n, i = o.operator, l = o.source;
|
|
575
|
+
a.add(i ? i.call(a, l) : l ? n._subscribe(a) : n._trySubscribe(a));
|
|
576
576
|
}), a;
|
|
577
577
|
}, e.prototype._trySubscribe = function(t) {
|
|
578
578
|
try {
|
|
@@ -581,9 +581,9 @@ var Ne = (function() {
|
|
|
581
581
|
t.error(r);
|
|
582
582
|
}
|
|
583
583
|
}, e.prototype.forEach = function(t, r) {
|
|
584
|
-
var
|
|
585
|
-
return r =
|
|
586
|
-
var o = new
|
|
584
|
+
var s = this;
|
|
585
|
+
return r = We(r), new r(function(n, a) {
|
|
586
|
+
var o = new $e({
|
|
587
587
|
next: function(i) {
|
|
588
588
|
try {
|
|
589
589
|
t(i);
|
|
@@ -592,99 +592,99 @@ var Ne = (function() {
|
|
|
592
592
|
}
|
|
593
593
|
},
|
|
594
594
|
error: a,
|
|
595
|
-
complete:
|
|
595
|
+
complete: n
|
|
596
596
|
});
|
|
597
|
-
|
|
597
|
+
s.subscribe(o);
|
|
598
598
|
});
|
|
599
599
|
}, e.prototype._subscribe = function(t) {
|
|
600
600
|
var r;
|
|
601
601
|
return (r = this.source) === null || r === void 0 ? void 0 : r.subscribe(t);
|
|
602
|
-
}, e.prototype[
|
|
602
|
+
}, e.prototype[Zt] = function() {
|
|
603
603
|
return this;
|
|
604
604
|
}, e.prototype.pipe = function() {
|
|
605
605
|
for (var t = [], r = 0; r < arguments.length; r++)
|
|
606
606
|
t[r] = arguments[r];
|
|
607
|
-
return
|
|
607
|
+
return tr(t)(this);
|
|
608
608
|
}, e.prototype.toPromise = function(t) {
|
|
609
609
|
var r = this;
|
|
610
|
-
return t =
|
|
610
|
+
return t = We(t), new t(function(s, n) {
|
|
611
611
|
var a;
|
|
612
612
|
r.subscribe(function(o) {
|
|
613
613
|
return a = o;
|
|
614
614
|
}, function(o) {
|
|
615
|
-
return
|
|
615
|
+
return n(o);
|
|
616
616
|
}, function() {
|
|
617
|
-
return
|
|
617
|
+
return s(a);
|
|
618
618
|
});
|
|
619
619
|
});
|
|
620
620
|
}, e.create = function(t) {
|
|
621
621
|
return new e(t);
|
|
622
622
|
}, e;
|
|
623
623
|
})();
|
|
624
|
-
function
|
|
624
|
+
function We(e) {
|
|
625
625
|
var t;
|
|
626
|
-
return (t = e ??
|
|
626
|
+
return (t = e ?? Xt.Promise) !== null && t !== void 0 ? t : Promise;
|
|
627
627
|
}
|
|
628
|
-
function
|
|
629
|
-
return e &&
|
|
628
|
+
function rr(e) {
|
|
629
|
+
return e && N(e.next) && N(e.error) && N(e.complete);
|
|
630
630
|
}
|
|
631
|
-
function
|
|
632
|
-
return e && e instanceof
|
|
631
|
+
function sr(e) {
|
|
632
|
+
return e && e instanceof mt || rr(e) && gt(e);
|
|
633
633
|
}
|
|
634
|
-
var
|
|
634
|
+
var nr = pt(function(e) {
|
|
635
635
|
return function() {
|
|
636
636
|
e(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed";
|
|
637
637
|
};
|
|
638
|
-
}),
|
|
639
|
-
|
|
638
|
+
}), wt = (function(e) {
|
|
639
|
+
ue(t, e);
|
|
640
640
|
function t() {
|
|
641
641
|
var r = e.call(this) || this;
|
|
642
642
|
return r.closed = !1, r.currentObservers = null, r.observers = [], r.isStopped = !1, r.hasError = !1, r.thrownError = null, r;
|
|
643
643
|
}
|
|
644
644
|
return t.prototype.lift = function(r) {
|
|
645
|
-
var
|
|
646
|
-
return
|
|
645
|
+
var s = new Ge(this, this);
|
|
646
|
+
return s.operator = r, s;
|
|
647
647
|
}, t.prototype._throwIfClosed = function() {
|
|
648
648
|
if (this.closed)
|
|
649
|
-
throw new
|
|
649
|
+
throw new nr();
|
|
650
650
|
}, t.prototype.next = function(r) {
|
|
651
|
-
var
|
|
652
|
-
|
|
653
|
-
var
|
|
654
|
-
if (
|
|
655
|
-
|
|
651
|
+
var s = this;
|
|
652
|
+
ae(function() {
|
|
653
|
+
var n, a;
|
|
654
|
+
if (s._throwIfClosed(), !s.isStopped) {
|
|
655
|
+
s.currentObservers || (s.currentObservers = Array.from(s.observers));
|
|
656
656
|
try {
|
|
657
|
-
for (var o =
|
|
657
|
+
for (var o = _e(s.currentObservers), i = o.next(); !i.done; i = o.next()) {
|
|
658
658
|
var l = i.value;
|
|
659
659
|
l.next(r);
|
|
660
660
|
}
|
|
661
661
|
} catch (f) {
|
|
662
|
-
|
|
662
|
+
n = { error: f };
|
|
663
663
|
} finally {
|
|
664
664
|
try {
|
|
665
665
|
i && !i.done && (a = o.return) && a.call(o);
|
|
666
666
|
} finally {
|
|
667
|
-
if (
|
|
667
|
+
if (n) throw n.error;
|
|
668
668
|
}
|
|
669
669
|
}
|
|
670
670
|
}
|
|
671
671
|
});
|
|
672
672
|
}, t.prototype.error = function(r) {
|
|
673
|
-
var
|
|
674
|
-
|
|
675
|
-
if (
|
|
676
|
-
|
|
677
|
-
for (var
|
|
678
|
-
|
|
673
|
+
var s = this;
|
|
674
|
+
ae(function() {
|
|
675
|
+
if (s._throwIfClosed(), !s.isStopped) {
|
|
676
|
+
s.hasError = s.isStopped = !0, s.thrownError = r;
|
|
677
|
+
for (var n = s.observers; n.length; )
|
|
678
|
+
n.shift().error(r);
|
|
679
679
|
}
|
|
680
680
|
});
|
|
681
681
|
}, t.prototype.complete = function() {
|
|
682
682
|
var r = this;
|
|
683
|
-
|
|
683
|
+
ae(function() {
|
|
684
684
|
if (r._throwIfClosed(), !r.isStopped) {
|
|
685
685
|
r.isStopped = !0;
|
|
686
|
-
for (var
|
|
687
|
-
|
|
686
|
+
for (var s = r.observers; s.length; )
|
|
687
|
+
s.shift().complete();
|
|
688
688
|
}
|
|
689
689
|
});
|
|
690
690
|
}, t.prototype.unsubscribe = function() {
|
|
@@ -701,59 +701,59 @@ var rr = ft(function(e) {
|
|
|
701
701
|
}, t.prototype._subscribe = function(r) {
|
|
702
702
|
return this._throwIfClosed(), this._checkFinalizedStatuses(r), this._innerSubscribe(r);
|
|
703
703
|
}, t.prototype._innerSubscribe = function(r) {
|
|
704
|
-
var
|
|
705
|
-
return a || o ?
|
|
706
|
-
|
|
704
|
+
var s = this, n = this, a = n.hasError, o = n.isStopped, i = n.observers;
|
|
705
|
+
return a || o ? yt : (this.currentObservers = null, i.push(r), new he(function() {
|
|
706
|
+
s.currentObservers = null, Le(i, r);
|
|
707
707
|
}));
|
|
708
708
|
}, t.prototype._checkFinalizedStatuses = function(r) {
|
|
709
|
-
var
|
|
710
|
-
|
|
709
|
+
var s = this, n = s.hasError, a = s.thrownError, o = s.isStopped;
|
|
710
|
+
n ? r.error(a) : o && r.complete();
|
|
711
711
|
}, t.prototype.asObservable = function() {
|
|
712
|
-
var r = new
|
|
712
|
+
var r = new je();
|
|
713
713
|
return r.source = this, r;
|
|
714
|
-
}, t.create = function(r,
|
|
715
|
-
return new
|
|
714
|
+
}, t.create = function(r, s) {
|
|
715
|
+
return new Ge(r, s);
|
|
716
716
|
}, t;
|
|
717
|
-
})(
|
|
718
|
-
|
|
719
|
-
function t(r,
|
|
720
|
-
var
|
|
721
|
-
return
|
|
717
|
+
})(je), Ge = (function(e) {
|
|
718
|
+
ue(t, e);
|
|
719
|
+
function t(r, s) {
|
|
720
|
+
var n = e.call(this) || this;
|
|
721
|
+
return n.destination = r, n.source = s, n;
|
|
722
722
|
}
|
|
723
723
|
return t.prototype.next = function(r) {
|
|
724
|
-
var
|
|
725
|
-
(
|
|
724
|
+
var s, n;
|
|
725
|
+
(n = (s = this.destination) === null || s === void 0 ? void 0 : s.next) === null || n === void 0 || n.call(s, r);
|
|
726
726
|
}, t.prototype.error = function(r) {
|
|
727
|
-
var
|
|
728
|
-
(
|
|
727
|
+
var s, n;
|
|
728
|
+
(n = (s = this.destination) === null || s === void 0 ? void 0 : s.error) === null || n === void 0 || n.call(s, r);
|
|
729
729
|
}, t.prototype.complete = function() {
|
|
730
|
-
var r,
|
|
731
|
-
(
|
|
730
|
+
var r, s;
|
|
731
|
+
(s = (r = this.destination) === null || r === void 0 ? void 0 : r.complete) === null || s === void 0 || s.call(r);
|
|
732
732
|
}, t.prototype._subscribe = function(r) {
|
|
733
|
-
var
|
|
734
|
-
return (
|
|
733
|
+
var s, n;
|
|
734
|
+
return (n = (s = this.source) === null || s === void 0 ? void 0 : s.subscribe(r)) !== null && n !== void 0 ? n : yt;
|
|
735
735
|
}, t;
|
|
736
|
-
})(
|
|
737
|
-
const
|
|
738
|
-
var
|
|
739
|
-
class
|
|
740
|
-
constructor(t = "", r = "info",
|
|
741
|
-
this.message = t, this.color = r, this.icon =
|
|
736
|
+
})(wt);
|
|
737
|
+
const bt = 3e3;
|
|
738
|
+
var St = /* @__PURE__ */ ((e) => (e.Warning = "warning", e.Success = "success", e.Error = "error", e.Info = "info", e))(St || {}), Et = /* @__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))(Et || {}), kt = /* @__PURE__ */ ((e) => (e.Warning = "Warning", e.Success = "Success", e.Error = "Error", e.Info = "Info", e))(kt || {}), or = /* @__PURE__ */ ((e) => (e.Center = "center", e.Left = "left", e.Right = "right", e.Bottom = "bottom", e.Top = "top", e))(or || {});
|
|
739
|
+
class ar {
|
|
740
|
+
constructor(t = "", r = "info", s = "none", n = "Info", a = bt, o = "center", i = !1) {
|
|
741
|
+
this.message = t, this.color = r, this.icon = s, this.title = n, this.timeout = a, this.position = o, this.visible = i;
|
|
742
742
|
}
|
|
743
743
|
}
|
|
744
|
-
class
|
|
745
|
-
static subject = new
|
|
744
|
+
class ir {
|
|
745
|
+
static subject = new wt();
|
|
746
746
|
static get snack$() {
|
|
747
747
|
return this.subject.asObservable();
|
|
748
748
|
}
|
|
749
749
|
static createSnackbar(t, r) {
|
|
750
750
|
this.subject.next(
|
|
751
|
-
new
|
|
751
|
+
new ar(
|
|
752
752
|
t,
|
|
753
|
-
wt[r],
|
|
754
|
-
bt[r],
|
|
755
753
|
St[r],
|
|
756
|
-
|
|
754
|
+
Et[r],
|
|
755
|
+
kt[r],
|
|
756
|
+
bt,
|
|
757
757
|
"bottom",
|
|
758
758
|
!0
|
|
759
759
|
)
|
|
@@ -788,29 +788,29 @@ class or {
|
|
|
788
788
|
);
|
|
789
789
|
}
|
|
790
790
|
}
|
|
791
|
-
function
|
|
791
|
+
function vt(e, t) {
|
|
792
792
|
const r = {};
|
|
793
|
-
for (let
|
|
794
|
-
if (Array.isArray(t[
|
|
795
|
-
JSON.stringify(e[
|
|
796
|
-
else if (e[
|
|
797
|
-
const
|
|
798
|
-
Object.keys(
|
|
799
|
-
} else JSON.stringify(e[
|
|
793
|
+
for (let s in t)
|
|
794
|
+
if (Array.isArray(t[s]))
|
|
795
|
+
JSON.stringify(e[s]) !== JSON.stringify(t[s]) && (r[s] = t[s]);
|
|
796
|
+
else if (e[s] && typeof e[s] == "object" && t[s] && typeof t[s] == "object") {
|
|
797
|
+
const n = vt(e[s], t[s]);
|
|
798
|
+
Object.keys(n).length > 0 && (r[s] = n);
|
|
799
|
+
} else JSON.stringify(e[s]) !== JSON.stringify(t[s]) && (r[s] = t[s]);
|
|
800
800
|
return r;
|
|
801
801
|
}
|
|
802
|
-
function
|
|
802
|
+
function cr(e) {
|
|
803
803
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
804
804
|
}
|
|
805
|
-
var
|
|
806
|
-
function
|
|
807
|
-
if (
|
|
808
|
-
|
|
805
|
+
var ye, Ye;
|
|
806
|
+
function lr() {
|
|
807
|
+
if (Ye) return ye;
|
|
808
|
+
Ye = 1;
|
|
809
809
|
class e {
|
|
810
810
|
/// value;
|
|
811
811
|
/// next;
|
|
812
|
-
constructor(
|
|
813
|
-
this.value =
|
|
812
|
+
constructor(s) {
|
|
813
|
+
this.value = s, this.next = void 0;
|
|
814
814
|
}
|
|
815
815
|
}
|
|
816
816
|
class t {
|
|
@@ -821,14 +821,14 @@ function ir() {
|
|
|
821
821
|
constructor() {
|
|
822
822
|
this.clear();
|
|
823
823
|
}
|
|
824
|
-
enqueue(
|
|
825
|
-
const
|
|
826
|
-
this._head ? (this._tail.next =
|
|
824
|
+
enqueue(s) {
|
|
825
|
+
const n = new e(s);
|
|
826
|
+
this._head ? (this._tail.next = n, this._tail = n) : (this._head = n, this._tail = n), this._size++;
|
|
827
827
|
}
|
|
828
828
|
dequeue() {
|
|
829
|
-
const
|
|
830
|
-
if (
|
|
831
|
-
return this._head = this._head.next, this._size--,
|
|
829
|
+
const s = this._head;
|
|
830
|
+
if (s)
|
|
831
|
+
return this._head = this._head.next, this._size--, s.value;
|
|
832
832
|
}
|
|
833
833
|
clear() {
|
|
834
834
|
this._head = void 0, this._tail = void 0, this._size = 0;
|
|
@@ -837,27 +837,27 @@ function ir() {
|
|
|
837
837
|
return this._size;
|
|
838
838
|
}
|
|
839
839
|
*[Symbol.iterator]() {
|
|
840
|
-
let
|
|
841
|
-
for (;
|
|
842
|
-
yield
|
|
840
|
+
let s = this._head;
|
|
841
|
+
for (; s; )
|
|
842
|
+
yield s.value, s = s.next;
|
|
843
843
|
}
|
|
844
844
|
}
|
|
845
|
-
return
|
|
845
|
+
return ye = t, ye;
|
|
846
846
|
}
|
|
847
|
-
var
|
|
848
|
-
function
|
|
849
|
-
if (
|
|
850
|
-
|
|
851
|
-
const e =
|
|
852
|
-
return
|
|
847
|
+
var ge, He;
|
|
848
|
+
function ur() {
|
|
849
|
+
if (He) return ge;
|
|
850
|
+
He = 1;
|
|
851
|
+
const e = lr();
|
|
852
|
+
return ge = (r) => {
|
|
853
853
|
if (!((Number.isInteger(r) || r === 1 / 0) && r > 0))
|
|
854
854
|
throw new TypeError("Expected `concurrency` to be a number from 1 and up");
|
|
855
|
-
const
|
|
856
|
-
let
|
|
855
|
+
const s = new e();
|
|
856
|
+
let n = 0;
|
|
857
857
|
const a = () => {
|
|
858
|
-
|
|
858
|
+
n--, s.size > 0 && s.dequeue()();
|
|
859
859
|
}, o = async (f, u, ...p) => {
|
|
860
|
-
|
|
860
|
+
n++;
|
|
861
861
|
const g = (async () => f(...p))();
|
|
862
862
|
u(g);
|
|
863
863
|
try {
|
|
@@ -866,62 +866,62 @@ function cr() {
|
|
|
866
866
|
}
|
|
867
867
|
a();
|
|
868
868
|
}, i = (f, u, ...p) => {
|
|
869
|
-
|
|
869
|
+
s.enqueue(o.bind(null, f, u, ...p)), (async () => (await Promise.resolve(), n < r && s.size > 0 && s.dequeue()()))();
|
|
870
870
|
}, l = (f, ...u) => new Promise((p) => {
|
|
871
871
|
i(f, p, ...u);
|
|
872
872
|
});
|
|
873
873
|
return Object.defineProperties(l, {
|
|
874
874
|
activeCount: {
|
|
875
|
-
get: () =>
|
|
875
|
+
get: () => n
|
|
876
876
|
},
|
|
877
877
|
pendingCount: {
|
|
878
|
-
get: () =>
|
|
878
|
+
get: () => s.size
|
|
879
879
|
},
|
|
880
880
|
clearQueue: {
|
|
881
881
|
value: () => {
|
|
882
|
-
|
|
882
|
+
s.clear();
|
|
883
883
|
}
|
|
884
884
|
}
|
|
885
885
|
}), l;
|
|
886
|
-
},
|
|
886
|
+
}, ge;
|
|
887
887
|
}
|
|
888
|
-
var
|
|
889
|
-
const
|
|
890
|
-
async function
|
|
891
|
-
const r =
|
|
888
|
+
var hr = ur();
|
|
889
|
+
const fr = /* @__PURE__ */ cr(hr), Y = fr(10), dr = 1e3;
|
|
890
|
+
async function X(e, t) {
|
|
891
|
+
const r = ft(t);
|
|
892
892
|
try {
|
|
893
|
-
const
|
|
894
|
-
return await
|
|
895
|
-
} catch (
|
|
896
|
-
throw
|
|
893
|
+
const s = await fetch(e, r);
|
|
894
|
+
return await dt(s);
|
|
895
|
+
} catch (s) {
|
|
896
|
+
throw s instanceof TypeError && ir.error("Network error. Please check your connection."), s;
|
|
897
897
|
}
|
|
898
898
|
}
|
|
899
899
|
const c = {
|
|
900
900
|
async fetch(e, t = {}) {
|
|
901
|
-
return t.method = "GET", await
|
|
901
|
+
return t.method = "GET", await Y(() => X(e, t));
|
|
902
902
|
},
|
|
903
|
-
async patch(e, t, r = null,
|
|
904
|
-
if (
|
|
905
|
-
return await
|
|
903
|
+
async patch(e, t, r = null, s = {}) {
|
|
904
|
+
if (s.method = "PATCH", s.body = r ? vt(r, t) : t, Object.keys(s.body).length !== 0)
|
|
905
|
+
return await Y(() => X(e, s));
|
|
906
906
|
},
|
|
907
907
|
async post(e, t = void 0, r = {}) {
|
|
908
|
-
return r.method = "POST", r.body = t, await
|
|
908
|
+
return r.method = "POST", r.body = t, await Y(() => X(e, r));
|
|
909
909
|
},
|
|
910
910
|
async put(e, t = void 0, r = {}) {
|
|
911
|
-
return r.method = "PUT", r.body = t, await
|
|
911
|
+
return r.method = "PUT", r.body = t, await Y(() => X(e, r));
|
|
912
912
|
},
|
|
913
913
|
async delete(e, t = void 0, r = {}) {
|
|
914
|
-
return r.method = "DELETE", r.body = t, await
|
|
914
|
+
return r.method = "DELETE", r.body = t, await Y(() => X(e, r));
|
|
915
915
|
},
|
|
916
916
|
async paginatedFetch(e, t) {
|
|
917
|
-
const r = t ??
|
|
917
|
+
const r = t ?? dr, s = e.includes("?") ? "&" : "?", n = `${e}${s}page_size=${r}&page=1`, a = ft({ method: "GET" }), o = await Y(() => fetch(n, a)), i = Number(o.headers.get("x-total-pages")) || 1, f = [...await dt(o)];
|
|
918
918
|
for (let u = 2; u <= i; u++) {
|
|
919
|
-
const p = `${e}${
|
|
919
|
+
const p = `${e}${s}page_size=${r}&page=${u}`, g = await Y(() => X(p, { method: "GET" }));
|
|
920
920
|
f.push(...g);
|
|
921
921
|
}
|
|
922
922
|
return f;
|
|
923
923
|
}
|
|
924
|
-
},
|
|
924
|
+
}, ze = {
|
|
925
925
|
HTTP: {
|
|
926
926
|
type: "HTTP",
|
|
927
927
|
sourceUri: "",
|
|
@@ -932,7 +932,7 @@ const c = {
|
|
|
932
932
|
sourceUri: "",
|
|
933
933
|
placeholderVariables: []
|
|
934
934
|
}
|
|
935
|
-
},
|
|
935
|
+
}, Xe = {
|
|
936
936
|
JSON: {
|
|
937
937
|
type: "JSON",
|
|
938
938
|
timestamp: {
|
|
@@ -955,18 +955,18 @@ const c = {
|
|
|
955
955
|
identifierType: "name"
|
|
956
956
|
/* Name */
|
|
957
957
|
}
|
|
958
|
-
},
|
|
958
|
+
}, Ve = {
|
|
959
959
|
HydroServer: {
|
|
960
960
|
type: "HydroServer"
|
|
961
961
|
}
|
|
962
962
|
};
|
|
963
|
-
class
|
|
963
|
+
class cs {
|
|
964
964
|
name = "";
|
|
965
965
|
settings = {
|
|
966
966
|
type: "SDL",
|
|
967
|
-
extractor: JSON.parse(JSON.stringify(
|
|
968
|
-
transformer: JSON.parse(JSON.stringify(
|
|
969
|
-
loader: JSON.parse(JSON.stringify(
|
|
967
|
+
extractor: JSON.parse(JSON.stringify(ze.local)),
|
|
968
|
+
transformer: JSON.parse(JSON.stringify(Xe.CSV)),
|
|
969
|
+
loader: JSON.parse(JSON.stringify(Ve.HydroServer)),
|
|
970
970
|
payloads: []
|
|
971
971
|
};
|
|
972
972
|
id = "";
|
|
@@ -988,19 +988,19 @@ class on {
|
|
|
988
988
|
}
|
|
989
989
|
switchExtractor(t) {
|
|
990
990
|
this.settings.extractor = JSON.parse(
|
|
991
|
-
JSON.stringify(
|
|
991
|
+
JSON.stringify(ze[t])
|
|
992
992
|
);
|
|
993
993
|
}
|
|
994
994
|
switchTransformer(t) {
|
|
995
995
|
this.settings.transformer = JSON.parse(
|
|
996
|
-
JSON.stringify(
|
|
996
|
+
JSON.stringify(Xe[t])
|
|
997
997
|
);
|
|
998
998
|
}
|
|
999
999
|
switchLoader(t) {
|
|
1000
|
-
this.settings.loader = JSON.parse(JSON.stringify(
|
|
1000
|
+
this.settings.loader = JSON.parse(JSON.stringify(Ve[t]));
|
|
1001
1001
|
}
|
|
1002
1002
|
}
|
|
1003
|
-
function
|
|
1003
|
+
function qe(e) {
|
|
1004
1004
|
return {
|
|
1005
1005
|
name: e.name,
|
|
1006
1006
|
settings: e.settings,
|
|
@@ -1010,40 +1010,40 @@ function Ve(e) {
|
|
|
1010
1010
|
status: e.status
|
|
1011
1011
|
};
|
|
1012
1012
|
}
|
|
1013
|
-
const
|
|
1013
|
+
const D = "https://lro.hydroserver.org/api", Ue = `${D}/auth`, C = `${Ue}/browser/account`, me = `${Ue}/browser/session`, ie = `${Ue}/browser/provider`, $ = `${D}/data/workspaces`, we = `${D}/data/roles`, R = `${D}/data/datastreams`, j = `${D}/data/sensors`, _ = `${D}/data/things`, Je = `${_}/tags`, V = `${D}/data/orchestration-systems`, x = `${D}/data/data-sources`, H = `${D}/data/observed-properties`, q = `${D}/data/processing-levels`, K = `${D}/data/result-qualifiers`, z = `${D}/data/units`, ls = (e, t, r, s, n) => {
|
|
1014
1014
|
let a = `${R}/${e}/observations?format=column`;
|
|
1015
|
-
return a += `&order_by=phenomenonTime&page_size=${t}`, a += `&phenomenon_time_min=${encodeURIComponent(r)}`,
|
|
1016
|
-
},
|
|
1017
|
-
const
|
|
1015
|
+
return a += `&order_by=phenomenonTime&page_size=${t}`, a += `&phenomenon_time_min=${encodeURIComponent(r)}`, s && (a += `&phenomenon_time_max=${encodeURIComponent(s)}`), n && (a += `&page=${n}`), a;
|
|
1016
|
+
}, pr = (e, t, r) => {
|
|
1017
|
+
const s = {
|
|
1018
1018
|
provider: e,
|
|
1019
1019
|
callback_url: t,
|
|
1020
1020
|
process: r
|
|
1021
|
-
},
|
|
1022
|
-
if (a.method = "POST", a.action = `${
|
|
1021
|
+
}, n = ht(), a = document.createElement("form");
|
|
1022
|
+
if (a.method = "POST", a.action = `${ie}/redirect`, n) {
|
|
1023
1023
|
const o = document.createElement("input");
|
|
1024
|
-
o.type = "hidden", o.name = "csrfmiddlewaretoken", o.value =
|
|
1024
|
+
o.type = "hidden", o.name = "csrfmiddlewaretoken", o.value = n, a.appendChild(o);
|
|
1025
1025
|
}
|
|
1026
|
-
for (const o in
|
|
1026
|
+
for (const o in s) {
|
|
1027
1027
|
const i = document.createElement("input");
|
|
1028
|
-
i.type = "hidden", i.name = o, i.value =
|
|
1028
|
+
i.type = "hidden", i.name = o, i.value = s[o] || "", a.appendChild(i);
|
|
1029
1029
|
}
|
|
1030
1030
|
document.body.appendChild(a), a.submit();
|
|
1031
|
-
},
|
|
1032
|
-
fetchSession: async () => c.fetch(`${
|
|
1033
|
-
login: async (e, t) => c.post(`${
|
|
1034
|
-
logout: async () => c.delete(`${
|
|
1035
|
-
fetchUser: async () => c.fetch(`${
|
|
1036
|
-
signup: async (e) => c.post(`${
|
|
1037
|
-
updateUser: async (e, t) => c.patch(`${
|
|
1038
|
-
deleteUser: async () => c.delete(`${
|
|
1039
|
-
sendVerificationEmail: async (e) => c.put(`${
|
|
1031
|
+
}, us = {
|
|
1032
|
+
fetchSession: async () => c.fetch(`${me}`),
|
|
1033
|
+
login: async (e, t) => c.post(`${me}`, { email: e, password: t }),
|
|
1034
|
+
logout: async () => c.delete(`${me}`),
|
|
1035
|
+
fetchUser: async () => c.fetch(`${C}`),
|
|
1036
|
+
signup: async (e) => c.post(`${C}`, e),
|
|
1037
|
+
updateUser: async (e, t) => c.patch(`${C}`, e, t),
|
|
1038
|
+
deleteUser: async () => c.delete(`${C}`),
|
|
1039
|
+
sendVerificationEmail: async (e) => c.put(`${C}/email/verify`, {
|
|
1040
1040
|
email: e
|
|
1041
1041
|
}),
|
|
1042
|
-
verifyEmailWithCode: async (e) => c.post(`${
|
|
1043
|
-
requestPasswordReset: async (e) => c.post(`${
|
|
1042
|
+
verifyEmailWithCode: async (e) => c.post(`${C}/email/verify`, { key: e }),
|
|
1043
|
+
requestPasswordReset: async (e) => c.post(`${C}/password/request`, {
|
|
1044
1044
|
email: e
|
|
1045
1045
|
}),
|
|
1046
|
-
resetPassword: async (e, t) => c.post(`${
|
|
1046
|
+
resetPassword: async (e, t) => c.post(`${C}/password/reset`, {
|
|
1047
1047
|
key: e,
|
|
1048
1048
|
password: t
|
|
1049
1049
|
}),
|
|
@@ -1060,9 +1060,9 @@ const O = "https://lro.hydroserver.org/api", Me = `${O}/auth`, x = `${Me}/browse
|
|
|
1060
1060
|
transferWorkspace: async (e, t) => c.post(`${$}/${e}/transfer`, { newOwner: t }),
|
|
1061
1061
|
acceptWorkspaceTransfer: async (e) => c.put(`${$}/${e}/transfer`),
|
|
1062
1062
|
rejectWorkspaceTransfer: async (e) => c.delete(`${$}/${e}/transfer`),
|
|
1063
|
-
getCollaboratorRoles: async (e) => c.paginatedFetch(`${
|
|
1064
|
-
getAPIKeyRoles: async (e) => c.paginatedFetch(`${
|
|
1065
|
-
getRole: async (e) => c.fetch(`${
|
|
1063
|
+
getCollaboratorRoles: async (e) => c.paginatedFetch(`${we}?is_user_role=true`),
|
|
1064
|
+
getAPIKeyRoles: async (e) => c.paginatedFetch(`${we}?is_apikey_role=true`),
|
|
1065
|
+
getRole: async (e) => c.fetch(`${we}/${e}`),
|
|
1066
1066
|
getCollaborators: async (e) => c.paginatedFetch(`${$}/${e}/collaborators`),
|
|
1067
1067
|
addCollaborator: async (e, t, r) => c.post(`${$}/${e}/collaborators`, {
|
|
1068
1068
|
email: t,
|
|
@@ -1107,19 +1107,19 @@ const O = "https://lro.hydroserver.org/api", Me = `${O}/auth`, x = `${Me}/browse
|
|
|
1107
1107
|
`${$}/${e}/api-keys/${t}/regenerate?expand_related=true`
|
|
1108
1108
|
),
|
|
1109
1109
|
deleteApiKey: async (e, t) => c.delete(`${$}/${e}/api-keys/${t}`),
|
|
1110
|
-
fetchConnectedProviders: async () => c.fetch(`${
|
|
1111
|
-
providerRedirect:
|
|
1112
|
-
providerSignup: async (e) => c.post(`${
|
|
1113
|
-
deleteProvider: async (e, t) => c.delete(`${
|
|
1110
|
+
fetchConnectedProviders: async () => c.fetch(`${ie}/connections`),
|
|
1111
|
+
providerRedirect: pr,
|
|
1112
|
+
providerSignup: async (e) => c.post(`${ie}/signup`, e),
|
|
1113
|
+
deleteProvider: async (e, t) => c.delete(`${ie}/connections`, {
|
|
1114
1114
|
provider: e,
|
|
1115
1115
|
account: t
|
|
1116
1116
|
}),
|
|
1117
|
-
createUnit: async (e) => c.post(
|
|
1118
|
-
fetchUnits: async () => c.paginatedFetch(`${
|
|
1119
|
-
fetchWorkspaceUnits: async (e) => c.paginatedFetch(`${
|
|
1120
|
-
updateUnit: async (e, t = null) => c.patch(`${
|
|
1121
|
-
deleteUnit: async (e) => c.delete(`${
|
|
1122
|
-
getUnit: async (e) => c.fetch(`${
|
|
1117
|
+
createUnit: async (e) => c.post(z, e),
|
|
1118
|
+
fetchUnits: async () => c.paginatedFetch(`${z}`),
|
|
1119
|
+
fetchWorkspaceUnits: async (e) => c.paginatedFetch(`${z}?workspace_id=${e}`),
|
|
1120
|
+
updateUnit: async (e, t = null) => c.patch(`${z}/${e.id}`, e, t),
|
|
1121
|
+
deleteUnit: async (e) => c.delete(`${z}/${e}`),
|
|
1122
|
+
getUnit: async (e) => c.fetch(`${z}/${e}`),
|
|
1123
1123
|
removeThingOwner: async (e, t) => c.patch(`${_}/${e}/ownership`, {
|
|
1124
1124
|
email: t,
|
|
1125
1125
|
removeOwner: !0
|
|
@@ -1150,9 +1150,9 @@ const O = "https://lro.hydroserver.org/api", Me = `${O}/auth`, x = `${Me}/browse
|
|
|
1150
1150
|
createSiteTag: async (e, t) => c.post(`${_}/${e}/tags`, t),
|
|
1151
1151
|
editSiteTag: async (e, t) => c.put(`${_}/${e}/tags`, t),
|
|
1152
1152
|
fetchSiteTags: async (e) => c.fetch(`${_}/${e}/tags`),
|
|
1153
|
-
fetchUsersSiteTags: async () => c.fetch(`${
|
|
1153
|
+
fetchUsersSiteTags: async () => c.fetch(`${Je}`),
|
|
1154
1154
|
deleteSiteTag: async (e, t) => c.delete(`${_}/${e}/tags`, t),
|
|
1155
|
-
fetchWorkspaceTags: async (e) => c.fetch(`${
|
|
1155
|
+
fetchWorkspaceTags: async (e) => c.fetch(`${Je}/keys?workspace_id=${e}`),
|
|
1156
1156
|
createHydroShareArchive: async (e) => c.post(`${_}/${e.thingId}/archive`, e),
|
|
1157
1157
|
updateHydroShareArchive: async (e, t) => c.patch(
|
|
1158
1158
|
`${_}/${e.thingId}/archive`,
|
|
@@ -1166,8 +1166,8 @@ const O = "https://lro.hydroserver.org/api", Me = `${O}/auth`, x = `${Me}/browse
|
|
|
1166
1166
|
fetchDatastreams: async (e) => {
|
|
1167
1167
|
const t = [];
|
|
1168
1168
|
if (e)
|
|
1169
|
-
for (const [
|
|
1170
|
-
t.push(`${encodeURIComponent(
|
|
1169
|
+
for (const [s, n] of Object.entries(e))
|
|
1170
|
+
t.push(`${encodeURIComponent(s)}=${encodeURIComponent(n)}`);
|
|
1171
1171
|
const r = t.length ? `?${t.join("&")}` : "";
|
|
1172
1172
|
return c.paginatedFetch(`${R}${r}`);
|
|
1173
1173
|
},
|
|
@@ -1182,81 +1182,81 @@ const O = "https://lro.hydroserver.org/api", Me = `${O}/auth`, x = `${Me}/browse
|
|
|
1182
1182
|
updateDatastream: async (e, t = null) => c.patch(`${R}/${e.id}`, e, t),
|
|
1183
1183
|
deleteDatastream: async (e) => c.delete(`${R}/${e}`),
|
|
1184
1184
|
downloadDatastreamCSV: async (e) => c.fetch(`${R}/${e}/csv`),
|
|
1185
|
-
createObservedProperty: async (e) => c.post(
|
|
1186
|
-
fetchObservedProperty: async (e) => c.fetch(`${
|
|
1187
|
-
fetchObservedProperties: async () => c.paginatedFetch(`${
|
|
1188
|
-
fetchWorkspaceObservedProperties: async (e) => c.paginatedFetch(`${
|
|
1189
|
-
updateObservedProperty: async (e, t = null) => c.patch(`${
|
|
1190
|
-
deleteObservedProperty: async (e) => c.delete(`${
|
|
1191
|
-
createProcessingLevel: async (e) => c.post(
|
|
1192
|
-
fetchProcessingLevels: async () => c.paginatedFetch(`${
|
|
1193
|
-
fetchProcessingLevel: async (e) => c.fetch(`${
|
|
1194
|
-
fetchWorkspaceProcessingLevels: async (e) => c.paginatedFetch(`${
|
|
1195
|
-
updateProcessingLevel: async (e, t = null) => c.patch(`${
|
|
1196
|
-
deleteProcessingLevel: async (e) => c.delete(`${
|
|
1197
|
-
createSensor: async (e) => c.post(
|
|
1198
|
-
fetchSensors: async () => c.paginatedFetch(`${
|
|
1199
|
-
fetchSensor: async (e) => c.fetch(`${
|
|
1200
|
-
fetchWorkspaceSensors: async (e) => c.paginatedFetch(`${
|
|
1201
|
-
updateSensor: async (e, t = null) => c.patch(`${
|
|
1202
|
-
deleteSensor: async (e) => c.delete(`${
|
|
1203
|
-
createResultQualifier: async (e) => c.post(
|
|
1204
|
-
fetchResultQualifiers: async () => c.paginatedFetch(`${
|
|
1205
|
-
fetchWorkspaceResultQualifiers: async (e) => c.paginatedFetch(`${
|
|
1185
|
+
createObservedProperty: async (e) => c.post(H, e),
|
|
1186
|
+
fetchObservedProperty: async (e) => c.fetch(`${H}/${e}`),
|
|
1187
|
+
fetchObservedProperties: async () => c.paginatedFetch(`${H}`),
|
|
1188
|
+
fetchWorkspaceObservedProperties: async (e) => c.paginatedFetch(`${H}?workspace_id=${e}`),
|
|
1189
|
+
updateObservedProperty: async (e, t = null) => c.patch(`${H}/${e.id}`, e, t),
|
|
1190
|
+
deleteObservedProperty: async (e) => c.delete(`${H}/${e}`),
|
|
1191
|
+
createProcessingLevel: async (e) => c.post(q, e),
|
|
1192
|
+
fetchProcessingLevels: async () => c.paginatedFetch(`${q}`),
|
|
1193
|
+
fetchProcessingLevel: async (e) => c.fetch(`${q}/${e}`),
|
|
1194
|
+
fetchWorkspaceProcessingLevels: async (e) => c.paginatedFetch(`${q}?workspace_id=${e}`),
|
|
1195
|
+
updateProcessingLevel: async (e, t = null) => c.patch(`${q}/${e.id}`, e, t),
|
|
1196
|
+
deleteProcessingLevel: async (e) => c.delete(`${q}/${e}`),
|
|
1197
|
+
createSensor: async (e) => c.post(j, e),
|
|
1198
|
+
fetchSensors: async () => c.paginatedFetch(`${j}`),
|
|
1199
|
+
fetchSensor: async (e) => c.fetch(`${j}/${e}`),
|
|
1200
|
+
fetchWorkspaceSensors: async (e) => c.paginatedFetch(`${j}?workspace_id=${e}`),
|
|
1201
|
+
updateSensor: async (e, t = null) => c.patch(`${j}/${e.id}`, e, t),
|
|
1202
|
+
deleteSensor: async (e) => c.delete(`${j}/${e}`),
|
|
1203
|
+
createResultQualifier: async (e) => c.post(K, e),
|
|
1204
|
+
fetchResultQualifiers: async () => c.paginatedFetch(`${K}`),
|
|
1205
|
+
fetchWorkspaceResultQualifiers: async (e) => c.paginatedFetch(`${K}?workspace_id=${e}`),
|
|
1206
1206
|
updateResultQualifier: async (e, t = null) => c.patch(
|
|
1207
|
-
`${
|
|
1207
|
+
`${K}/${e.id}`,
|
|
1208
1208
|
e,
|
|
1209
1209
|
t
|
|
1210
1210
|
),
|
|
1211
|
-
deleteResultQualifier: async (e) => c.delete(`${
|
|
1212
|
-
createOrchestrationSystem: async (e) => c.post(
|
|
1213
|
-
fetchOrchestrationSystems: async () => c.paginatedFetch(
|
|
1214
|
-
fetchWorkspaceOrchestrationSystems: async (e) => c.paginatedFetch(`${
|
|
1215
|
-
fetchOrchestrationSystem: async (e) => c.fetch(`${
|
|
1216
|
-
updateOrchestrationSystem: async (e, t) => c.patch(`${
|
|
1217
|
-
deleteOrchestrationSystem: async (e) => c.delete(`${
|
|
1211
|
+
deleteResultQualifier: async (e) => c.delete(`${K}/${e}`),
|
|
1212
|
+
createOrchestrationSystem: async (e) => c.post(V, e),
|
|
1213
|
+
fetchOrchestrationSystems: async () => c.paginatedFetch(V),
|
|
1214
|
+
fetchWorkspaceOrchestrationSystems: async (e) => c.paginatedFetch(`${V}?workspace_id=${e}`),
|
|
1215
|
+
fetchOrchestrationSystem: async (e) => c.fetch(`${V}/${e}`),
|
|
1216
|
+
updateOrchestrationSystem: async (e, t) => c.patch(`${V}/${e}`, t),
|
|
1217
|
+
deleteOrchestrationSystem: async (e) => c.delete(`${V}/${e}`),
|
|
1218
1218
|
createDataSource: async (e) => c.post(
|
|
1219
|
-
`${
|
|
1220
|
-
|
|
1219
|
+
`${x}?expand_related=true`,
|
|
1220
|
+
qe(e)
|
|
1221
1221
|
),
|
|
1222
|
-
fetchDataSources: async () => c.paginatedFetch(`${
|
|
1222
|
+
fetchDataSources: async () => c.paginatedFetch(`${x}?expand_related=true`),
|
|
1223
1223
|
fetchWorkspaceDataSources: async (e) => c.paginatedFetch(
|
|
1224
|
-
`${
|
|
1224
|
+
`${x}?workspace_id=${e}&expand_related=true`
|
|
1225
1225
|
),
|
|
1226
|
-
fetchDataSource: async (e) => c.fetch(`${
|
|
1226
|
+
fetchDataSource: async (e) => c.fetch(`${x}/${e}?expand_related=true`),
|
|
1227
1227
|
updateDataSource: async (e) => c.patch(
|
|
1228
|
-
`${
|
|
1229
|
-
|
|
1228
|
+
`${x}/${e.id}?expand_related=true`,
|
|
1229
|
+
qe(e)
|
|
1230
1230
|
),
|
|
1231
1231
|
updateDataSourcePartial: async (e) => c.patch(
|
|
1232
|
-
`${
|
|
1232
|
+
`${x}/${e.id}?expand_related=true`,
|
|
1233
1233
|
e
|
|
1234
1234
|
),
|
|
1235
|
-
deleteDataSource: async (e) => c.delete(`${
|
|
1235
|
+
deleteDataSource: async (e) => c.delete(`${x}/${e}`),
|
|
1236
1236
|
linkDatastreamToDataSource: async (e, t) => c.post(
|
|
1237
|
-
`${
|
|
1237
|
+
`${x}/${e}/datastreams/${t}`
|
|
1238
1238
|
),
|
|
1239
1239
|
unlinkDatastreamFromDataSource: async (e, t) => c.delete(
|
|
1240
|
-
`${
|
|
1240
|
+
`${x}/${e}/datastreams/${t}`
|
|
1241
1241
|
),
|
|
1242
1242
|
fetchObservations: async (e) => c.fetch(e),
|
|
1243
1243
|
deleteObservationsForDatastream: async (e) => c.post(`${R}/${e}/observations/bulk-delete`, {
|
|
1244
1244
|
phenomenonTimeStart: null,
|
|
1245
1245
|
phenomenonTimeEnd: null
|
|
1246
1246
|
}),
|
|
1247
|
-
fetchUserTypes: async () => c.fetch(`${
|
|
1248
|
-
fetchOrganizationTypes: async () => c.fetch(`${
|
|
1247
|
+
fetchUserTypes: async () => c.fetch(`${C}/user-types`),
|
|
1248
|
+
fetchOrganizationTypes: async () => c.fetch(`${C}/organization-types`),
|
|
1249
1249
|
fetchSiteTypes: async () => c.fetch(`${_}/site-types`),
|
|
1250
1250
|
fetchSamplingFeatureTypes: async () => c.paginatedFetch(`${_}/sampling-feature-types`),
|
|
1251
|
-
fetchSensorEncodingTypes: async () => c.paginatedFetch(`${
|
|
1252
|
-
fetchMethodTypes: async () => c.paginatedFetch(`${
|
|
1253
|
-
fetchVariableTypes: async () => c.paginatedFetch(`${
|
|
1254
|
-
fetchUnitTypes: async () => c.paginatedFetch(`${
|
|
1251
|
+
fetchSensorEncodingTypes: async () => c.paginatedFetch(`${j}/encoding-types`),
|
|
1252
|
+
fetchMethodTypes: async () => c.paginatedFetch(`${j}/method-types`),
|
|
1253
|
+
fetchVariableTypes: async () => c.paginatedFetch(`${H}/variable-types`),
|
|
1254
|
+
fetchUnitTypes: async () => c.paginatedFetch(`${z}/types`),
|
|
1255
1255
|
fetchDatastreamStatuses: async () => c.paginatedFetch(`${R}/statuses`),
|
|
1256
1256
|
fetchDatastreamAggregations: async () => c.paginatedFetch(`${R}/aggregation-statistics`),
|
|
1257
1257
|
fetchSampledMediums: async () => c.paginatedFetch(`${R}/sampled-mediums`)
|
|
1258
1258
|
};
|
|
1259
|
-
class
|
|
1259
|
+
class hs {
|
|
1260
1260
|
name = "";
|
|
1261
1261
|
mappings = [];
|
|
1262
1262
|
extractorVariables = {};
|
|
@@ -1264,15 +1264,15 @@ class ln {
|
|
|
1264
1264
|
Object.assign(this, t);
|
|
1265
1265
|
}
|
|
1266
1266
|
}
|
|
1267
|
-
const
|
|
1268
|
-
[
|
|
1269
|
-
[
|
|
1270
|
-
[
|
|
1271
|
-
[
|
|
1272
|
-
[
|
|
1273
|
-
[
|
|
1274
|
-
[
|
|
1275
|
-
},
|
|
1267
|
+
const _t = 1, ce = _t * 60, Oe = ce * 60, De = Oe * 24, yr = De * 7, gr = Oe * 30, mr = De * 365, re = {
|
|
1268
|
+
[F.SECOND]: _t,
|
|
1269
|
+
[F.MINUTE]: ce,
|
|
1270
|
+
[F.HOUR]: Oe,
|
|
1271
|
+
[F.DAY]: De,
|
|
1272
|
+
[F.WEEK]: yr,
|
|
1273
|
+
[F.MONTH]: gr,
|
|
1274
|
+
[F.YEAR]: mr
|
|
1275
|
+
}, fs = (e) => e.toLocaleString(void 0, {
|
|
1276
1276
|
year: "numeric",
|
|
1277
1277
|
month: "short",
|
|
1278
1278
|
day: "2-digit",
|
|
@@ -1280,42 +1280,42 @@ const kt = 1, ie = kt * 60, Ue = ie * 60, Oe = Ue * 24, dr = Oe * 7, pr = Ue * 3
|
|
|
1280
1280
|
hour12: !1,
|
|
1281
1281
|
minute: "2-digit",
|
|
1282
1282
|
second: "2-digit"
|
|
1283
|
-
}),
|
|
1283
|
+
}), ds = (e) => {
|
|
1284
1284
|
let t, r;
|
|
1285
|
-
e >=
|
|
1286
|
-
let
|
|
1287
|
-
return r === "ms" ?
|
|
1288
|
-
},
|
|
1285
|
+
e >= ce * 1e3 ? (t = e / (ce * 1e3), r = "m") : e >= 1e3 ? (t = e / 1e3, r = "s") : (t = e, r = "ms");
|
|
1286
|
+
let s;
|
|
1287
|
+
return r === "ms" ? s = Math.round(t).toString() : s = t.toFixed(2), `${s} ${r}`;
|
|
1288
|
+
}, be = async (e, t) => {
|
|
1289
1289
|
t && console.info(t);
|
|
1290
|
-
const r = performance.now(),
|
|
1291
|
-
console.info(` Done in ${(
|
|
1292
|
-
const a = +(
|
|
1293
|
-
return { response:
|
|
1290
|
+
const r = performance.now(), s = await e(), n = performance.now();
|
|
1291
|
+
console.info(` Done in ${(n - r).toFixed(2)} ms`);
|
|
1292
|
+
const a = +(n - r);
|
|
1293
|
+
return { response: s, duration: a };
|
|
1294
1294
|
};
|
|
1295
|
-
function
|
|
1295
|
+
function ps(e, t) {
|
|
1296
1296
|
const r = new Date(e);
|
|
1297
1297
|
return r.setHours(r.getHours() - t), r.toISOString();
|
|
1298
1298
|
}
|
|
1299
|
-
const
|
|
1300
|
-
let r = 0,
|
|
1301
|
-
for (; r <
|
|
1302
|
-
const
|
|
1303
|
-
e[
|
|
1299
|
+
const se = (e, t) => {
|
|
1300
|
+
let r = 0, s = e.length;
|
|
1301
|
+
for (; r < s; ) {
|
|
1302
|
+
const n = r + s >> 1;
|
|
1303
|
+
e[n] < t ? r = n + 1 : s = n;
|
|
1304
1304
|
}
|
|
1305
1305
|
return r;
|
|
1306
|
-
},
|
|
1307
|
-
let r = 0,
|
|
1308
|
-
for (; r <
|
|
1309
|
-
const
|
|
1310
|
-
e[
|
|
1306
|
+
}, Se = (e, t) => {
|
|
1307
|
+
let r = 0, s = e.length;
|
|
1308
|
+
for (; r < s; ) {
|
|
1309
|
+
const n = r + s >> 1;
|
|
1310
|
+
e[n] > t ? s = n : r = n + 1;
|
|
1311
1311
|
}
|
|
1312
1312
|
return r - 1;
|
|
1313
|
-
},
|
|
1314
|
-
`,
|
|
1315
|
-
function
|
|
1313
|
+
}, At = `(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
|
+
`, Ke = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", At], { type: "text/javascript;charset=utf-8" });
|
|
1315
|
+
function wr(e) {
|
|
1316
1316
|
let t;
|
|
1317
1317
|
try {
|
|
1318
|
-
if (t =
|
|
1318
|
+
if (t = Ke && (self.URL || self.webkitURL).createObjectURL(Ke), !t) throw "";
|
|
1319
1319
|
const r = new Worker(t, {
|
|
1320
1320
|
name: e?.name
|
|
1321
1321
|
});
|
|
@@ -1324,19 +1324,19 @@ function gr(e) {
|
|
|
1324
1324
|
}), r;
|
|
1325
1325
|
} catch {
|
|
1326
1326
|
return new Worker(
|
|
1327
|
-
"data:text/javascript;charset=utf-8," + encodeURIComponent(
|
|
1327
|
+
"data:text/javascript;charset=utf-8," + encodeURIComponent(At),
|
|
1328
1328
|
{
|
|
1329
1329
|
name: e?.name
|
|
1330
1330
|
}
|
|
1331
1331
|
);
|
|
1332
1332
|
}
|
|
1333
1333
|
}
|
|
1334
|
-
const
|
|
1335
|
-
`,
|
|
1336
|
-
function
|
|
1334
|
+
const Tt = `(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
|
+
`, Qe = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", Tt], { type: "text/javascript;charset=utf-8" });
|
|
1336
|
+
function br(e) {
|
|
1337
1337
|
let t;
|
|
1338
1338
|
try {
|
|
1339
|
-
if (t =
|
|
1339
|
+
if (t = Qe && (self.URL || self.webkitURL).createObjectURL(Qe), !t) throw "";
|
|
1340
1340
|
const r = new Worker(t, {
|
|
1341
1341
|
name: e?.name
|
|
1342
1342
|
});
|
|
@@ -1345,19 +1345,19 @@ function mr(e) {
|
|
|
1345
1345
|
}), r;
|
|
1346
1346
|
} catch {
|
|
1347
1347
|
return new Worker(
|
|
1348
|
-
"data:text/javascript;charset=utf-8," + encodeURIComponent(
|
|
1348
|
+
"data:text/javascript;charset=utf-8," + encodeURIComponent(Tt),
|
|
1349
1349
|
{
|
|
1350
1350
|
name: e?.name
|
|
1351
1351
|
}
|
|
1352
1352
|
);
|
|
1353
1353
|
}
|
|
1354
1354
|
}
|
|
1355
|
-
const
|
|
1356
|
-
`,
|
|
1357
|
-
function
|
|
1355
|
+
const Lt = `(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
|
+
`, Ze = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", Lt], { type: "text/javascript;charset=utf-8" });
|
|
1357
|
+
function Sr(e) {
|
|
1358
1358
|
let t;
|
|
1359
1359
|
try {
|
|
1360
|
-
if (t =
|
|
1360
|
+
if (t = Ze && (self.URL || self.webkitURL).createObjectURL(Ze), !t) throw "";
|
|
1361
1361
|
const r = new Worker(t, {
|
|
1362
1362
|
name: e?.name
|
|
1363
1363
|
});
|
|
@@ -1366,19 +1366,19 @@ function wr(e) {
|
|
|
1366
1366
|
}), r;
|
|
1367
1367
|
} catch {
|
|
1368
1368
|
return new Worker(
|
|
1369
|
-
"data:text/javascript;charset=utf-8," + encodeURIComponent(
|
|
1369
|
+
"data:text/javascript;charset=utf-8," + encodeURIComponent(Lt),
|
|
1370
1370
|
{
|
|
1371
1371
|
name: e?.name
|
|
1372
1372
|
}
|
|
1373
1373
|
);
|
|
1374
1374
|
}
|
|
1375
1375
|
}
|
|
1376
|
-
const
|
|
1377
|
-
`,
|
|
1378
|
-
function
|
|
1376
|
+
const $t = `(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
|
+
`, et = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", $t], { type: "text/javascript;charset=utf-8" });
|
|
1378
|
+
function Er(e) {
|
|
1379
1379
|
let t;
|
|
1380
1380
|
try {
|
|
1381
|
-
if (t =
|
|
1381
|
+
if (t = et && (self.URL || self.webkitURL).createObjectURL(et), !t) throw "";
|
|
1382
1382
|
const r = new Worker(t, {
|
|
1383
1383
|
name: e?.name
|
|
1384
1384
|
});
|
|
@@ -1387,19 +1387,19 @@ function br(e) {
|
|
|
1387
1387
|
}), r;
|
|
1388
1388
|
} catch {
|
|
1389
1389
|
return new Worker(
|
|
1390
|
-
"data:text/javascript;charset=utf-8," + encodeURIComponent(
|
|
1390
|
+
"data:text/javascript;charset=utf-8," + encodeURIComponent($t),
|
|
1391
1391
|
{
|
|
1392
1392
|
name: e?.name
|
|
1393
1393
|
}
|
|
1394
1394
|
);
|
|
1395
1395
|
}
|
|
1396
1396
|
}
|
|
1397
|
-
const
|
|
1398
|
-
`,
|
|
1399
|
-
function
|
|
1397
|
+
const Rt = `(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
|
+
`, tt = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", Rt], { type: "text/javascript;charset=utf-8" });
|
|
1399
|
+
function kr(e) {
|
|
1400
1400
|
let t;
|
|
1401
1401
|
try {
|
|
1402
|
-
if (t =
|
|
1402
|
+
if (t = tt && (self.URL || self.webkitURL).createObjectURL(tt), !t) throw "";
|
|
1403
1403
|
const r = new Worker(t, {
|
|
1404
1404
|
name: e?.name
|
|
1405
1405
|
});
|
|
@@ -1408,19 +1408,19 @@ function Sr(e) {
|
|
|
1408
1408
|
}), r;
|
|
1409
1409
|
} catch {
|
|
1410
1410
|
return new Worker(
|
|
1411
|
-
"data:text/javascript;charset=utf-8," + encodeURIComponent(
|
|
1411
|
+
"data:text/javascript;charset=utf-8," + encodeURIComponent(Rt),
|
|
1412
1412
|
{
|
|
1413
1413
|
name: e?.name
|
|
1414
1414
|
}
|
|
1415
1415
|
);
|
|
1416
1416
|
}
|
|
1417
1417
|
}
|
|
1418
|
-
const
|
|
1419
|
-
`,
|
|
1420
|
-
function
|
|
1418
|
+
const It = `(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
|
+
`, rt = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", It], { type: "text/javascript;charset=utf-8" });
|
|
1420
|
+
function vr(e) {
|
|
1421
1421
|
let t;
|
|
1422
1422
|
try {
|
|
1423
|
-
if (t =
|
|
1423
|
+
if (t = rt && (self.URL || self.webkitURL).createObjectURL(rt), !t) throw "";
|
|
1424
1424
|
const r = new Worker(t, {
|
|
1425
1425
|
name: e?.name
|
|
1426
1426
|
});
|
|
@@ -1429,19 +1429,19 @@ function Er(e) {
|
|
|
1429
1429
|
}), r;
|
|
1430
1430
|
} catch {
|
|
1431
1431
|
return new Worker(
|
|
1432
|
-
"data:text/javascript;charset=utf-8," + encodeURIComponent(
|
|
1432
|
+
"data:text/javascript;charset=utf-8," + encodeURIComponent(It),
|
|
1433
1433
|
{
|
|
1434
1434
|
name: e?.name
|
|
1435
1435
|
}
|
|
1436
1436
|
);
|
|
1437
1437
|
}
|
|
1438
1438
|
}
|
|
1439
|
-
const
|
|
1440
|
-
`,
|
|
1441
|
-
function
|
|
1439
|
+
const Mt = `(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
|
+
`, st = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", Mt], { type: "text/javascript;charset=utf-8" });
|
|
1441
|
+
function _r(e) {
|
|
1442
1442
|
let t;
|
|
1443
1443
|
try {
|
|
1444
|
-
if (t =
|
|
1444
|
+
if (t = st && (self.URL || self.webkitURL).createObjectURL(st), !t) throw "";
|
|
1445
1445
|
const r = new Worker(t, {
|
|
1446
1446
|
name: e?.name
|
|
1447
1447
|
});
|
|
@@ -1450,16 +1450,16 @@ function kr(e) {
|
|
|
1450
1450
|
}), r;
|
|
1451
1451
|
} catch {
|
|
1452
1452
|
return new Worker(
|
|
1453
|
-
"data:text/javascript;charset=utf-8," + encodeURIComponent(
|
|
1453
|
+
"data:text/javascript;charset=utf-8," + encodeURIComponent(Mt),
|
|
1454
1454
|
{
|
|
1455
1455
|
name: e?.name
|
|
1456
1456
|
}
|
|
1457
1457
|
);
|
|
1458
1458
|
}
|
|
1459
1459
|
}
|
|
1460
|
-
const
|
|
1461
|
-
`, nt = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",
|
|
1462
|
-
function
|
|
1460
|
+
const Ut = `(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);", Ut], { type: "text/javascript;charset=utf-8" });
|
|
1462
|
+
function Ar(e) {
|
|
1463
1463
|
let t;
|
|
1464
1464
|
try {
|
|
1465
1465
|
if (t = nt && (self.URL || self.webkitURL).createObjectURL(nt), !t) throw "";
|
|
@@ -1471,19 +1471,19 @@ function vr(e) {
|
|
|
1471
1471
|
}), r;
|
|
1472
1472
|
} catch {
|
|
1473
1473
|
return new Worker(
|
|
1474
|
-
"data:text/javascript;charset=utf-8," + encodeURIComponent(
|
|
1474
|
+
"data:text/javascript;charset=utf-8," + encodeURIComponent(Ut),
|
|
1475
1475
|
{
|
|
1476
1476
|
name: e?.name
|
|
1477
1477
|
}
|
|
1478
1478
|
);
|
|
1479
1479
|
}
|
|
1480
1480
|
}
|
|
1481
|
-
const
|
|
1482
|
-
`,
|
|
1483
|
-
function
|
|
1481
|
+
const Ot = `(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
|
+
`, ot = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", Ot], { type: "text/javascript;charset=utf-8" });
|
|
1483
|
+
function Tr(e) {
|
|
1484
1484
|
let t;
|
|
1485
1485
|
try {
|
|
1486
|
-
if (t =
|
|
1486
|
+
if (t = ot && (self.URL || self.webkitURL).createObjectURL(ot), !t) throw "";
|
|
1487
1487
|
const r = new Worker(t, {
|
|
1488
1488
|
name: e?.name
|
|
1489
1489
|
});
|
|
@@ -1492,19 +1492,19 @@ function _r(e) {
|
|
|
1492
1492
|
}), r;
|
|
1493
1493
|
} catch {
|
|
1494
1494
|
return new Worker(
|
|
1495
|
-
"data:text/javascript;charset=utf-8," + encodeURIComponent(
|
|
1495
|
+
"data:text/javascript;charset=utf-8," + encodeURIComponent(Ot),
|
|
1496
1496
|
{
|
|
1497
1497
|
name: e?.name
|
|
1498
1498
|
}
|
|
1499
1499
|
);
|
|
1500
1500
|
}
|
|
1501
1501
|
}
|
|
1502
|
-
const
|
|
1503
|
-
`,
|
|
1504
|
-
function
|
|
1502
|
+
const Dt = `(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
|
+
`, at = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", Dt], { type: "text/javascript;charset=utf-8" });
|
|
1504
|
+
function Lr(e) {
|
|
1505
1505
|
let t;
|
|
1506
1506
|
try {
|
|
1507
|
-
if (t =
|
|
1507
|
+
if (t = at && (self.URL || self.webkitURL).createObjectURL(at), !t) throw "";
|
|
1508
1508
|
const r = new Worker(t, {
|
|
1509
1509
|
name: e?.name
|
|
1510
1510
|
});
|
|
@@ -1513,19 +1513,19 @@ function Ar(e) {
|
|
|
1513
1513
|
}), r;
|
|
1514
1514
|
} catch {
|
|
1515
1515
|
return new Worker(
|
|
1516
|
-
"data:text/javascript;charset=utf-8," + encodeURIComponent(
|
|
1516
|
+
"data:text/javascript;charset=utf-8," + encodeURIComponent(Dt),
|
|
1517
1517
|
{
|
|
1518
1518
|
name: e?.name
|
|
1519
1519
|
}
|
|
1520
1520
|
);
|
|
1521
1521
|
}
|
|
1522
1522
|
}
|
|
1523
|
-
const
|
|
1524
|
-
`,
|
|
1525
|
-
function
|
|
1523
|
+
const Ct = `(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
|
+
`, it = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", Ct], { type: "text/javascript;charset=utf-8" });
|
|
1525
|
+
function Re(e) {
|
|
1526
1526
|
let t;
|
|
1527
1527
|
try {
|
|
1528
|
-
if (t =
|
|
1528
|
+
if (t = it && (self.URL || self.webkitURL).createObjectURL(it), !t) throw "";
|
|
1529
1529
|
const r = new Worker(t, {
|
|
1530
1530
|
name: e?.name
|
|
1531
1531
|
});
|
|
@@ -1534,19 +1534,19 @@ function $e(e) {
|
|
|
1534
1534
|
}), r;
|
|
1535
1535
|
} catch {
|
|
1536
1536
|
return new Worker(
|
|
1537
|
-
"data:text/javascript;charset=utf-8," + encodeURIComponent(
|
|
1537
|
+
"data:text/javascript;charset=utf-8," + encodeURIComponent(Ct),
|
|
1538
1538
|
{
|
|
1539
1539
|
name: e?.name
|
|
1540
1540
|
}
|
|
1541
1541
|
);
|
|
1542
1542
|
}
|
|
1543
1543
|
}
|
|
1544
|
-
const
|
|
1545
|
-
`,
|
|
1546
|
-
function
|
|
1544
|
+
const Ft = `(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
|
+
`, ct = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", Ft], { type: "text/javascript;charset=utf-8" });
|
|
1546
|
+
function $r(e) {
|
|
1547
1547
|
let t;
|
|
1548
1548
|
try {
|
|
1549
|
-
if (t =
|
|
1549
|
+
if (t = ct && (self.URL || self.webkitURL).createObjectURL(ct), !t) throw "";
|
|
1550
1550
|
const r = new Worker(t, {
|
|
1551
1551
|
name: e?.name
|
|
1552
1552
|
});
|
|
@@ -1555,20 +1555,20 @@ function Lr(e) {
|
|
|
1555
1555
|
}), r;
|
|
1556
1556
|
} catch {
|
|
1557
1557
|
return new Worker(
|
|
1558
|
-
"data:text/javascript;charset=utf-8," + encodeURIComponent(
|
|
1558
|
+
"data:text/javascript;charset=utf-8," + encodeURIComponent(Ft),
|
|
1559
1559
|
{
|
|
1560
1560
|
name: e?.name
|
|
1561
1561
|
}
|
|
1562
1562
|
);
|
|
1563
1563
|
}
|
|
1564
1564
|
}
|
|
1565
|
-
function
|
|
1566
|
-
const a = [], o =
|
|
1565
|
+
function Pt(e, t, r, s, n) {
|
|
1566
|
+
const a = [], o = s.length;
|
|
1567
1567
|
for (let i = t; i < r; i++) {
|
|
1568
1568
|
const l = e[i];
|
|
1569
1569
|
let f = !1;
|
|
1570
1570
|
for (let u = 0; u < o; u++) {
|
|
1571
|
-
const p =
|
|
1571
|
+
const p = s[u], g = n[u];
|
|
1572
1572
|
if (p === 0) {
|
|
1573
1573
|
if (l < g) {
|
|
1574
1574
|
f = !0;
|
|
@@ -1598,160 +1598,160 @@ function Dt(e, t, r, n, s) {
|
|
|
1598
1598
|
}
|
|
1599
1599
|
return a;
|
|
1600
1600
|
}
|
|
1601
|
-
function
|
|
1601
|
+
function Rr(e, t, r, s, n) {
|
|
1602
1602
|
const a = [];
|
|
1603
|
-
if (
|
|
1603
|
+
if (s === "Less than")
|
|
1604
1604
|
for (let o = t; o < r; o++)
|
|
1605
|
-
e[o] - e[o - 1] <
|
|
1606
|
-
else if (
|
|
1605
|
+
e[o] - e[o - 1] < n && a.push(o);
|
|
1606
|
+
else if (s === "Less than or equal to")
|
|
1607
1607
|
for (let o = t; o < r; o++)
|
|
1608
|
-
e[o] - e[o - 1] <=
|
|
1609
|
-
else if (
|
|
1608
|
+
e[o] - e[o - 1] <= n && a.push(o);
|
|
1609
|
+
else if (s === "Greater than")
|
|
1610
1610
|
for (let o = t; o < r; o++)
|
|
1611
|
-
e[o] - e[o - 1] >
|
|
1612
|
-
else if (
|
|
1611
|
+
e[o] - e[o - 1] > n && a.push(o);
|
|
1612
|
+
else if (s === "Greater than or equal to")
|
|
1613
1613
|
for (let o = t; o < r; o++)
|
|
1614
|
-
e[o] - e[o - 1] >=
|
|
1615
|
-
else if (
|
|
1614
|
+
e[o] - e[o - 1] >= n && a.push(o);
|
|
1615
|
+
else if (s === "Equal")
|
|
1616
1616
|
for (let o = t; o < r; o++)
|
|
1617
|
-
e[o] - e[o - 1] ==
|
|
1617
|
+
e[o] - e[o - 1] == n && a.push(o);
|
|
1618
1618
|
return a;
|
|
1619
1619
|
}
|
|
1620
|
-
function
|
|
1620
|
+
function Ir(e, t, r, s, n) {
|
|
1621
1621
|
const a = [];
|
|
1622
|
-
if (
|
|
1622
|
+
if (s === "Less than")
|
|
1623
1623
|
for (let o = t; o < r; o++) {
|
|
1624
1624
|
const i = e[o - 1];
|
|
1625
|
-
(e[o] - i) / Math.abs(i) <
|
|
1625
|
+
(e[o] - i) / Math.abs(i) < n && a.push(o);
|
|
1626
1626
|
}
|
|
1627
|
-
else if (
|
|
1627
|
+
else if (s === "Less than or equal to")
|
|
1628
1628
|
for (let o = t; o < r; o++) {
|
|
1629
1629
|
const i = e[o - 1];
|
|
1630
|
-
(e[o] - i) / Math.abs(i) <=
|
|
1630
|
+
(e[o] - i) / Math.abs(i) <= n && a.push(o);
|
|
1631
1631
|
}
|
|
1632
|
-
else if (
|
|
1632
|
+
else if (s === "Greater than")
|
|
1633
1633
|
for (let o = t; o < r; o++) {
|
|
1634
1634
|
const i = e[o - 1];
|
|
1635
|
-
(e[o] - i) / Math.abs(i) >
|
|
1635
|
+
(e[o] - i) / Math.abs(i) > n && a.push(o);
|
|
1636
1636
|
}
|
|
1637
|
-
else if (
|
|
1637
|
+
else if (s === "Greater than or equal to")
|
|
1638
1638
|
for (let o = t; o < r; o++) {
|
|
1639
1639
|
const i = e[o - 1];
|
|
1640
|
-
(e[o] - i) / Math.abs(i) >=
|
|
1640
|
+
(e[o] - i) / Math.abs(i) >= n && a.push(o);
|
|
1641
1641
|
}
|
|
1642
|
-
else if (
|
|
1642
|
+
else if (s === "Equal")
|
|
1643
1643
|
for (let o = t; o < r; o++) {
|
|
1644
1644
|
const i = e[o - 1];
|
|
1645
|
-
(e[o] - i) / Math.abs(i) ==
|
|
1645
|
+
(e[o] - i) / Math.abs(i) == n && a.push(o);
|
|
1646
1646
|
}
|
|
1647
1647
|
return a;
|
|
1648
1648
|
}
|
|
1649
|
-
function
|
|
1650
|
-
const
|
|
1649
|
+
function Mr(e, t, r, s) {
|
|
1650
|
+
const n = [];
|
|
1651
1651
|
let a = e[t];
|
|
1652
1652
|
for (let o = t + 1; o <= r; o++) {
|
|
1653
1653
|
const i = e[o];
|
|
1654
|
-
i - a >
|
|
1654
|
+
i - a > s && n.push(o - 1, o), a = i;
|
|
1655
1655
|
}
|
|
1656
|
-
return
|
|
1656
|
+
return n;
|
|
1657
1657
|
}
|
|
1658
|
-
function
|
|
1659
|
-
const
|
|
1660
|
-
if (t >= r) return
|
|
1661
|
-
let
|
|
1658
|
+
function Ur(e, t, r) {
|
|
1659
|
+
const s = [];
|
|
1660
|
+
if (t >= r) return s;
|
|
1661
|
+
let n = t, a = e[t];
|
|
1662
1662
|
for (let o = t + 1; o < r; o++) {
|
|
1663
1663
|
const i = e[o];
|
|
1664
|
-
i !== a && (
|
|
1664
|
+
i !== a && (s.push(n, o - n, a), n = o, a = i);
|
|
1665
1665
|
}
|
|
1666
|
-
return
|
|
1666
|
+
return s.push(n, r - n, a), s;
|
|
1667
1667
|
}
|
|
1668
|
-
function
|
|
1668
|
+
function Or(e, t, r, s, n, a, o, i, l, f, u) {
|
|
1669
1669
|
let p = 0, g = i;
|
|
1670
1670
|
for (let y = a; y <= o; y++)
|
|
1671
|
-
if (
|
|
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,
|
|
1673
|
-
let
|
|
1674
|
-
for (;
|
|
1675
|
-
|
|
1671
|
+
if (s[g] = e[y], n[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, T = S - m;
|
|
1673
|
+
let L = b + l;
|
|
1674
|
+
for (; L < w; )
|
|
1675
|
+
s[g] = L, n[g] = f ? m + (L - b) * T / A : u, g++, L += l;
|
|
1676
1676
|
p++;
|
|
1677
1677
|
}
|
|
1678
1678
|
return g - i;
|
|
1679
1679
|
}
|
|
1680
|
-
function
|
|
1680
|
+
function Dr(e, t, r, s, n, a, o, i) {
|
|
1681
1681
|
let l = a, f = 0, u = i;
|
|
1682
1682
|
const p = r.length;
|
|
1683
1683
|
for (; l < o && f < p; ) {
|
|
1684
1684
|
const g = r[f][0];
|
|
1685
|
-
e[l] <= g ? (
|
|
1685
|
+
e[l] <= g ? (s[u] = e[l], n[u] = t[l], l++) : (s[u] = g, n[u] = r[f][1], f++), u++;
|
|
1686
1686
|
}
|
|
1687
1687
|
for (; l < o; )
|
|
1688
|
-
|
|
1688
|
+
s[u] = e[l], n[u] = t[l], l++, u++;
|
|
1689
1689
|
for (; f < p; )
|
|
1690
|
-
|
|
1690
|
+
s[u] = r[f][0], n[u] = r[f][1], f++, u++;
|
|
1691
1691
|
return u - i;
|
|
1692
1692
|
}
|
|
1693
|
-
function
|
|
1693
|
+
function Cr(e, t, r, s, n, a, o, i) {
|
|
1694
1694
|
let l = 0, f = i;
|
|
1695
1695
|
for (let u = a; u <= o; u++)
|
|
1696
|
-
l < r.length && u === r[l] ? l++ : (
|
|
1696
|
+
l < r.length && u === r[l] ? l++ : (s[f] = e[u], n[f] = t[u], f++);
|
|
1697
1697
|
return f - i;
|
|
1698
1698
|
}
|
|
1699
|
-
function
|
|
1700
|
-
const
|
|
1701
|
-
if (
|
|
1702
|
-
for (let o = 0; o <
|
|
1699
|
+
function Fr(e, t, r, s) {
|
|
1700
|
+
const n = r.length, a = new Array(n);
|
|
1701
|
+
if (s.isMonth)
|
|
1702
|
+
for (let o = 0; o < n; o++) {
|
|
1703
1703
|
const i = r[o], l = new Date(e[i]);
|
|
1704
|
-
l.setMonth(l.getMonth() +
|
|
1704
|
+
l.setMonth(l.getMonth() + s.amount), a[o] = [l.getTime(), t[i]];
|
|
1705
1705
|
}
|
|
1706
|
-
else if (
|
|
1707
|
-
for (let o = 0; o <
|
|
1706
|
+
else if (s.isYear)
|
|
1707
|
+
for (let o = 0; o < n; o++) {
|
|
1708
1708
|
const i = r[o], l = new Date(e[i]);
|
|
1709
|
-
l.setFullYear(l.getFullYear() +
|
|
1709
|
+
l.setFullYear(l.getFullYear() + s.amount), a[o] = [l.getTime(), t[i]];
|
|
1710
1710
|
}
|
|
1711
1711
|
else
|
|
1712
|
-
for (let o = 0; o <
|
|
1712
|
+
for (let o = 0; o < n; o++) {
|
|
1713
1713
|
const i = r[o];
|
|
1714
|
-
a[o] = [e[i] +
|
|
1714
|
+
a[o] = [e[i] + s.deltaMs, t[i]];
|
|
1715
1715
|
}
|
|
1716
1716
|
return a;
|
|
1717
1717
|
}
|
|
1718
|
-
function
|
|
1719
|
-
for (let
|
|
1720
|
-
const { indexes:
|
|
1718
|
+
function Pr(e, t, r) {
|
|
1719
|
+
for (let s = 0; s < r.length; s++) {
|
|
1720
|
+
const { indexes: n, lowerIdx: a, upperIdx: o } = r[s], i = e[a], l = t[a], f = e[o], u = t[o], p = f - i, g = u - l;
|
|
1721
1721
|
if (p === 0) {
|
|
1722
|
-
for (let y = 0; y <
|
|
1722
|
+
for (let y = 0; y < n.length; y++) t[n[y]] = l;
|
|
1723
1723
|
continue;
|
|
1724
1724
|
}
|
|
1725
|
-
for (let y = 0; y <
|
|
1726
|
-
const d =
|
|
1725
|
+
for (let y = 0; y < n.length; y++) {
|
|
1726
|
+
const d = n[y];
|
|
1727
1727
|
t[d] = l + (e[d] - i) * g / p;
|
|
1728
1728
|
}
|
|
1729
1729
|
}
|
|
1730
1730
|
}
|
|
1731
|
-
function
|
|
1732
|
-
for (let
|
|
1733
|
-
const
|
|
1734
|
-
if (a <=
|
|
1735
|
-
const i = e[
|
|
1731
|
+
function xr(e, t, r) {
|
|
1732
|
+
for (let s = 0; s < r.length; s++) {
|
|
1733
|
+
const n = r[s][0], a = r[s][1], o = r[s][2];
|
|
1734
|
+
if (a <= n) continue;
|
|
1735
|
+
const i = e[n], l = e[a] - i;
|
|
1736
1736
|
if (l !== 0)
|
|
1737
|
-
for (let f =
|
|
1737
|
+
for (let f = n; f < a; f++)
|
|
1738
1738
|
t[f] = t[f] + o * ((e[f] - i) / l);
|
|
1739
1739
|
}
|
|
1740
1740
|
}
|
|
1741
|
-
function
|
|
1742
|
-
const
|
|
1741
|
+
function lt(e, t, r, s) {
|
|
1742
|
+
const n = t.length;
|
|
1743
1743
|
if (r === "ADD")
|
|
1744
|
-
for (let a = 0; a <
|
|
1744
|
+
for (let a = 0; a < n; a++) e[t[a]] = e[t[a]] + s;
|
|
1745
1745
|
else if (r === "SUB")
|
|
1746
|
-
for (let a = 0; a <
|
|
1746
|
+
for (let a = 0; a < n; a++) e[t[a]] = e[t[a]] - s;
|
|
1747
1747
|
else if (r === "MULT")
|
|
1748
|
-
for (let a = 0; a <
|
|
1748
|
+
for (let a = 0; a < n; a++) e[t[a]] = e[t[a]] * s;
|
|
1749
1749
|
else if (r === "DIV")
|
|
1750
|
-
for (let a = 0; a <
|
|
1750
|
+
for (let a = 0; a < n; a++) e[t[a]] = e[t[a]] / s;
|
|
1751
1751
|
else if (r === "ASSIGN")
|
|
1752
|
-
for (let a = 0; a <
|
|
1752
|
+
for (let a = 0; a < n; a++) e[t[a]] = s;
|
|
1753
1753
|
}
|
|
1754
|
-
const
|
|
1754
|
+
const Nr = 1, Ce = `qc-utils:calibration:v${Nr}`, Br = 720 * 60 * 60 * 1e3, ne = 5e4, oe = 2e5, le = {
|
|
1755
1755
|
spawnOverheadMs: 50,
|
|
1756
1756
|
// worst-case Windows
|
|
1757
1757
|
inlineThroughput: 5e4,
|
|
@@ -1762,8 +1762,8 @@ const Fr = 1, xe = `qc-utils:calibration:v${Fr}`, Pr = 720 * 60 * 60 * 1e3, ne =
|
|
|
1762
1762
|
measuredAt: 0,
|
|
1763
1763
|
userAgent: "default"
|
|
1764
1764
|
};
|
|
1765
|
-
let M =
|
|
1766
|
-
const
|
|
1765
|
+
let M = Gr() ?? le, Fe = null, Q = null;
|
|
1766
|
+
const Ie = /* @__PURE__ */ new Set(), Me = {
|
|
1767
1767
|
// Filter ops — read-only scans, cheap kernels
|
|
1768
1768
|
[v.VALUE_THRESHOLD]: {
|
|
1769
1769
|
mode: "calibrated",
|
|
@@ -1847,8 +1847,8 @@ const Re = /* @__PURE__ */ new Set(), Ie = {
|
|
|
1847
1847
|
rationale: "Single copy-with-fills pass; fresh SAB sized to newLength"
|
|
1848
1848
|
}
|
|
1849
1849
|
};
|
|
1850
|
-
function
|
|
1851
|
-
const r =
|
|
1850
|
+
function O(e, t) {
|
|
1851
|
+
const r = Me[e];
|
|
1852
1852
|
if (!r)
|
|
1853
1853
|
return {
|
|
1854
1854
|
useWorker: !0,
|
|
@@ -1877,21 +1877,21 @@ function U(e, t) {
|
|
|
1877
1877
|
predictedWorkerMs: 0,
|
|
1878
1878
|
reason: r.rationale
|
|
1879
1879
|
};
|
|
1880
|
-
const
|
|
1881
|
-
if (
|
|
1880
|
+
const s = jr(e, t);
|
|
1881
|
+
if (s <= 0)
|
|
1882
1882
|
return {
|
|
1883
1883
|
useWorker: !1,
|
|
1884
1884
|
predictedInlineMs: 0,
|
|
1885
1885
|
predictedWorkerMs: M.spawnOverheadMs,
|
|
1886
1886
|
reason: "zero work units"
|
|
1887
1887
|
};
|
|
1888
|
-
const
|
|
1888
|
+
const n = Math.max(
|
|
1889
1889
|
1,
|
|
1890
1890
|
Math.min(
|
|
1891
1891
|
t.parallelism ?? M.hwConcurrency,
|
|
1892
1892
|
M.hwConcurrency
|
|
1893
1893
|
)
|
|
1894
|
-
), a = r.weight *
|
|
1894
|
+
), a = r.weight * s / M.inlineThroughput, o = M.spawnOverheadMs + r.weight * s / (M.workerThroughput * n), i = a > o;
|
|
1895
1895
|
return {
|
|
1896
1896
|
useWorker: i,
|
|
1897
1897
|
predictedInlineMs: a,
|
|
@@ -1899,7 +1899,7 @@ function U(e, t) {
|
|
|
1899
1899
|
reason: i ? `worker faster (${o.toFixed(1)} vs ${a.toFixed(1)} ms)` : `inline faster (${a.toFixed(1)} vs ${o.toFixed(1)} ms)`
|
|
1900
1900
|
};
|
|
1901
1901
|
}
|
|
1902
|
-
function
|
|
1902
|
+
function jr(e, t) {
|
|
1903
1903
|
switch (e) {
|
|
1904
1904
|
case E.CHANGE_VALUES:
|
|
1905
1905
|
case E.INTERPOLATE:
|
|
@@ -1916,57 +1916,57 @@ function Br(e, t) {
|
|
|
1916
1916
|
return t.datasetSize;
|
|
1917
1917
|
}
|
|
1918
1918
|
}
|
|
1919
|
-
function
|
|
1920
|
-
return
|
|
1919
|
+
function ys(e) {
|
|
1920
|
+
return Ie.add(e), () => Ie.delete(e);
|
|
1921
1921
|
}
|
|
1922
|
-
function
|
|
1922
|
+
function gs() {
|
|
1923
1923
|
return M;
|
|
1924
1924
|
}
|
|
1925
|
-
function
|
|
1926
|
-
return
|
|
1925
|
+
function ms() {
|
|
1926
|
+
return Fe;
|
|
1927
1927
|
}
|
|
1928
|
-
function
|
|
1929
|
-
return Object.keys(
|
|
1928
|
+
function ws() {
|
|
1929
|
+
return Object.keys(Me).map((e) => ({ op: e, ...Me[e] }));
|
|
1930
1930
|
}
|
|
1931
|
-
function
|
|
1932
|
-
M =
|
|
1931
|
+
function bs() {
|
|
1932
|
+
M = le, Fe = null;
|
|
1933
1933
|
try {
|
|
1934
|
-
localStorage.removeItem(
|
|
1934
|
+
localStorage.removeItem(Ce);
|
|
1935
1935
|
} catch {
|
|
1936
1936
|
}
|
|
1937
1937
|
}
|
|
1938
|
-
async function
|
|
1939
|
-
if (typeof window > "u" || !(e.force || M.measuredAt === 0 || Date.now() - M.measuredAt >
|
|
1940
|
-
if (
|
|
1938
|
+
async function Ss(e = {}) {
|
|
1939
|
+
if (typeof window > "u" || !(e.force || M.measuredAt === 0 || Date.now() - M.measuredAt > Br)) return M;
|
|
1940
|
+
if (Q) await Q;
|
|
1941
1941
|
else {
|
|
1942
|
-
|
|
1943
|
-
|
|
1942
|
+
Q = Wr().finally(() => {
|
|
1943
|
+
Q = null;
|
|
1944
1944
|
});
|
|
1945
|
-
const r = await
|
|
1946
|
-
M = r,
|
|
1947
|
-
for (const
|
|
1945
|
+
const r = await Q;
|
|
1946
|
+
M = r, Yr(r), Fe = r;
|
|
1947
|
+
for (const s of Ie) s(M);
|
|
1948
1948
|
}
|
|
1949
1949
|
return M;
|
|
1950
1950
|
}
|
|
1951
|
-
async function
|
|
1951
|
+
async function Wr() {
|
|
1952
1952
|
if (!(typeof SharedArrayBuffer < "u"))
|
|
1953
1953
|
return {
|
|
1954
|
-
...
|
|
1954
|
+
...le,
|
|
1955
1955
|
measuredAt: Date.now(),
|
|
1956
1956
|
userAgent: navigator.userAgent,
|
|
1957
|
-
hwConcurrency: navigator.hardwareConcurrency ||
|
|
1957
|
+
hwConcurrency: navigator.hardwareConcurrency || le.hwConcurrency,
|
|
1958
1958
|
sharedArrayBufferAvailable: !1,
|
|
1959
1959
|
samples: { spawnRoundtripMs: [], inlineScanMs: [], workerScanMs: [] }
|
|
1960
1960
|
};
|
|
1961
1961
|
const t = navigator.hardwareConcurrency || 4, r = new Float32Array(ne);
|
|
1962
1962
|
for (let h = 0; h < ne; h++) r[h] = Math.sin(h);
|
|
1963
|
-
const
|
|
1963
|
+
const s = await Ee(3, () => {
|
|
1964
1964
|
const h = performance.now();
|
|
1965
|
-
return
|
|
1966
|
-
}),
|
|
1965
|
+
return Pt(r, 0, ne, [2], [0.5]), performance.now() - h;
|
|
1966
|
+
}), n = ke(s), a = ne / Math.max(n, 1e-3), o = new SharedArrayBuffer(256 * Float32Array.BYTES_PER_ELEMENT), i = await Ee(3, async () => {
|
|
1967
1967
|
const h = performance.now();
|
|
1968
1968
|
return await new Promise((b) => {
|
|
1969
|
-
const w = new
|
|
1969
|
+
const w = new Re();
|
|
1970
1970
|
w.onmessage = () => {
|
|
1971
1971
|
w.terminate(), b();
|
|
1972
1972
|
}, w.postMessage({
|
|
@@ -1977,25 +1977,25 @@ async function Nr() {
|
|
|
1977
1977
|
values: [0.5]
|
|
1978
1978
|
});
|
|
1979
1979
|
}), performance.now() - h;
|
|
1980
|
-
}), l =
|
|
1981
|
-
|
|
1980
|
+
}), l = ke(i), f = new SharedArrayBuffer(
|
|
1981
|
+
oe * Float32Array.BYTES_PER_ELEMENT
|
|
1982
1982
|
), u = new Float32Array(f);
|
|
1983
|
-
for (let h = 0; h <
|
|
1984
|
-
const p = await
|
|
1983
|
+
for (let h = 0; h < oe; h++) u[h] = Math.sin(h);
|
|
1984
|
+
const p = await Ee(3, async () => {
|
|
1985
1985
|
const h = performance.now();
|
|
1986
1986
|
return await new Promise((b) => {
|
|
1987
|
-
const w = new
|
|
1987
|
+
const w = new Re();
|
|
1988
1988
|
w.onmessage = () => {
|
|
1989
1989
|
w.terminate(), b();
|
|
1990
1990
|
}, w.postMessage({
|
|
1991
1991
|
bufferY: f,
|
|
1992
1992
|
start: 0,
|
|
1993
|
-
end:
|
|
1993
|
+
end: oe,
|
|
1994
1994
|
ops: [2],
|
|
1995
1995
|
values: [0.5]
|
|
1996
1996
|
});
|
|
1997
1997
|
}), performance.now() - h;
|
|
1998
|
-
}), g = Math.max(
|
|
1998
|
+
}), g = Math.max(ke(p) - l, 0.1), y = oe / g;
|
|
1999
1999
|
return {
|
|
2000
2000
|
spawnOverheadMs: l,
|
|
2001
2001
|
inlineThroughput: a,
|
|
@@ -2006,26 +2006,26 @@ async function Nr() {
|
|
|
2006
2006
|
sharedArrayBufferAvailable: !0,
|
|
2007
2007
|
samples: {
|
|
2008
2008
|
spawnRoundtripMs: i,
|
|
2009
|
-
inlineScanMs:
|
|
2009
|
+
inlineScanMs: s,
|
|
2010
2010
|
workerScanMs: p
|
|
2011
2011
|
}
|
|
2012
2012
|
};
|
|
2013
2013
|
}
|
|
2014
|
-
async function
|
|
2014
|
+
async function Ee(e, t) {
|
|
2015
2015
|
const r = [];
|
|
2016
|
-
for (let
|
|
2017
|
-
await new Promise((
|
|
2016
|
+
for (let s = 0; s < e; s++)
|
|
2017
|
+
await new Promise((n) => setTimeout(n, 0)), r.push(await t());
|
|
2018
2018
|
return r;
|
|
2019
2019
|
}
|
|
2020
|
-
function
|
|
2020
|
+
function ke(e) {
|
|
2021
2021
|
if (!e.length) return 0;
|
|
2022
|
-
const t = [...e].sort((
|
|
2022
|
+
const t = [...e].sort((s, n) => s - n), r = Math.floor(t.length / 2);
|
|
2023
2023
|
return t.length % 2 ? t[r] : (t[r - 1] + t[r]) / 2;
|
|
2024
2024
|
}
|
|
2025
|
-
function
|
|
2025
|
+
function Gr() {
|
|
2026
2026
|
if (typeof localStorage > "u") return null;
|
|
2027
2027
|
try {
|
|
2028
|
-
const e = localStorage.getItem(
|
|
2028
|
+
const e = localStorage.getItem(Ce);
|
|
2029
2029
|
if (!e) return null;
|
|
2030
2030
|
const t = JSON.parse(e);
|
|
2031
2031
|
return !t || typeof t.spawnOverheadMs != "number" ? null : t;
|
|
@@ -2033,7 +2033,7 @@ function jr() {
|
|
|
2033
2033
|
return null;
|
|
2034
2034
|
}
|
|
2035
2035
|
}
|
|
2036
|
-
function
|
|
2036
|
+
function Yr(e) {
|
|
2037
2037
|
if (!(typeof localStorage > "u"))
|
|
2038
2038
|
try {
|
|
2039
2039
|
const t = {
|
|
@@ -2044,32 +2044,33 @@ function Wr(e) {
|
|
|
2044
2044
|
measuredAt: e.measuredAt,
|
|
2045
2045
|
userAgent: e.userAgent
|
|
2046
2046
|
};
|
|
2047
|
-
localStorage.setItem(
|
|
2047
|
+
localStorage.setItem(Ce, JSON.stringify(t));
|
|
2048
2048
|
} catch {
|
|
2049
2049
|
}
|
|
2050
2050
|
}
|
|
2051
|
-
const
|
|
2052
|
-
|
|
2051
|
+
const Z = 20 * 1e3, Hr = 1024, zr = ["date", "value", "qualifier"], Xr = typeof SharedArrayBuffer < "u";
|
|
2052
|
+
function U(e, t) {
|
|
2053
|
+
return Xr ? t !== void 0 ? new SharedArrayBuffer(e, { maxByteLength: t }) : new SharedArrayBuffer(e) : t !== void 0 ? new ArrayBuffer(e, { maxByteLength: t }) : new ArrayBuffer(e);
|
|
2054
|
+
}
|
|
2055
|
+
function ut(e, t) {
|
|
2056
|
+
const r = e;
|
|
2057
|
+
typeof r.grow == "function" ? r.grow(t) : typeof r.resize == "function" && r.resize(t);
|
|
2058
|
+
}
|
|
2059
|
+
class Es {
|
|
2053
2060
|
/** The generated dataset to be used for plotting */
|
|
2054
2061
|
dataset = {
|
|
2055
|
-
dimensions:
|
|
2062
|
+
dimensions: zr,
|
|
2056
2063
|
source: {
|
|
2057
2064
|
x: new Float64Array(
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
maxByteLength: Q * Float64Array.BYTES_PER_ELEMENT
|
|
2062
|
-
// Max size the array can reach
|
|
2063
|
-
}
|
|
2065
|
+
U(
|
|
2066
|
+
Z * Float64Array.BYTES_PER_ELEMENT,
|
|
2067
|
+
Z * Float64Array.BYTES_PER_ELEMENT
|
|
2064
2068
|
)
|
|
2065
2069
|
),
|
|
2066
2070
|
y: new Float32Array(
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
maxByteLength: Q * Float32Array.BYTES_PER_ELEMENT
|
|
2071
|
-
// Max size the array can reach
|
|
2072
|
-
}
|
|
2071
|
+
U(
|
|
2072
|
+
Z * Float32Array.BYTES_PER_ELEMENT,
|
|
2073
|
+
Z * Float32Array.BYTES_PER_ELEMENT
|
|
2073
2074
|
)
|
|
2074
2075
|
)
|
|
2075
2076
|
}
|
|
@@ -2109,7 +2110,7 @@ class bn {
|
|
|
2109
2110
|
if (!t)
|
|
2110
2111
|
return;
|
|
2111
2112
|
this.isLoading = !0;
|
|
2112
|
-
const r = await
|
|
2113
|
+
const r = await be(() => {
|
|
2113
2114
|
this._growBuffer(t.datetimes.length), this._resizeTo(t.datetimes.length), this.dataX.set(t.datetimes), this.dataY.set(t.dataValues);
|
|
2114
2115
|
});
|
|
2115
2116
|
this.loadingTime = r.duration, this.history.length = 0, this.isLoading = !1;
|
|
@@ -2138,24 +2139,20 @@ class bn {
|
|
|
2138
2139
|
*/
|
|
2139
2140
|
_growBuffer(t) {
|
|
2140
2141
|
const r = t * Float64Array.BYTES_PER_ELEMENT;
|
|
2141
|
-
let
|
|
2142
|
-
for (; r >
|
|
2143
|
-
|
|
2144
|
-
if (
|
|
2145
|
-
const
|
|
2142
|
+
let s = this.dataX.buffer.byteLength;
|
|
2143
|
+
for (; r > s; )
|
|
2144
|
+
s += Z * Float64Array.BYTES_PER_ELEMENT;
|
|
2145
|
+
if (s * Float64Array.BYTES_PER_ELEMENT > this.dataX.buffer.maxByteLength) {
|
|
2146
|
+
const n = U(
|
|
2146
2147
|
this.dataX.buffer.byteLength,
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
}
|
|
2150
|
-
), a = new SharedArrayBuffer(
|
|
2148
|
+
s * Float64Array.BYTES_PER_ELEMENT
|
|
2149
|
+
), a = U(
|
|
2151
2150
|
this.dataY.buffer.byteLength,
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
}
|
|
2155
|
-
), o = new Float64Array(s), i = new Float32Array(a);
|
|
2151
|
+
s * Float32Array.BYTES_PER_ELEMENT
|
|
2152
|
+
), o = new Float64Array(n), i = new Float32Array(a);
|
|
2156
2153
|
o.set(this.dataX), i.set(this.dataY), this.dataset.source.x = o, this.dataset.source.y = i;
|
|
2157
2154
|
}
|
|
2158
|
-
this.dataX.buffer.byteLength < t * Float64Array.BYTES_PER_ELEMENT && (this.dataX.buffer
|
|
2155
|
+
this.dataX.buffer.byteLength < t * Float64Array.BYTES_PER_ELEMENT && (ut(this.dataX.buffer, t * Float64Array.BYTES_PER_ELEMENT), ut(this.dataY.buffer, t * Float32Array.BYTES_PER_ELEMENT));
|
|
2159
2156
|
}
|
|
2160
2157
|
/**
|
|
2161
2158
|
* Reloads the dataset with the raw data
|
|
@@ -2169,7 +2166,7 @@ class bn {
|
|
|
2169
2166
|
*/
|
|
2170
2167
|
async reloadHistory(t) {
|
|
2171
2168
|
const r = this.history.slice(0, t + 1);
|
|
2172
|
-
return this.redoStack.length = 0, await this.reload(), await this.dispatch(r.map((
|
|
2169
|
+
return this.redoStack.length = 0, await this.reload(), await this.dispatch(r.map((s) => [s.method, ...s.args || []]));
|
|
2173
2170
|
}
|
|
2174
2171
|
/**
|
|
2175
2172
|
* Remove a history item
|
|
@@ -2177,7 +2174,7 @@ class bn {
|
|
|
2177
2174
|
*/
|
|
2178
2175
|
async removeHistoryItem(t) {
|
|
2179
2176
|
const r = [...this.history];
|
|
2180
|
-
return r.splice(t, 1), this.redoStack.length = 0, await this.reload(), await this.dispatch(r.map((
|
|
2177
|
+
return r.splice(t, 1), this.redoStack.length = 0, await this.reload(), await this.dispatch(r.map((s) => [s.method, ...s.args || []]));
|
|
2181
2178
|
}
|
|
2182
2179
|
/**
|
|
2183
2180
|
* Undo the most recent history entry. Pushes it onto `redoStack` so a
|
|
@@ -2189,7 +2186,7 @@ class bn {
|
|
|
2189
2186
|
const t = this.history[this.history.length - 1], r = this.history.slice(0, -1);
|
|
2190
2187
|
await this.reload(), this.redoStack.push(t), this._isReplaying = !0;
|
|
2191
2188
|
try {
|
|
2192
|
-
return await this.dispatch(r.map((
|
|
2189
|
+
return await this.dispatch(r.map((s) => [s.method, ...s.args || []]));
|
|
2193
2190
|
} finally {
|
|
2194
2191
|
this._isReplaying = !1;
|
|
2195
2192
|
}
|
|
@@ -2218,7 +2215,7 @@ class bn {
|
|
|
2218
2215
|
}
|
|
2219
2216
|
/** Dispatch an operation and log its signature in hisotry */
|
|
2220
2217
|
async dispatchAction(t, ...r) {
|
|
2221
|
-
const
|
|
2218
|
+
const s = {
|
|
2222
2219
|
[E.ADD_POINTS]: this._addDataPoints,
|
|
2223
2220
|
[E.CHANGE_VALUES]: this._changeValues,
|
|
2224
2221
|
[E.ASSIGN_VALUES_BULK]: this._assignValuesBulk,
|
|
@@ -2228,7 +2225,7 @@ class bn {
|
|
|
2228
2225
|
[E.SHIFT_DATETIMES]: this._shift,
|
|
2229
2226
|
[E.ASSIGN_DATETIMES_BULK]: this._assignDatetimesBulk,
|
|
2230
2227
|
[E.FILL_GAPS]: this._fillGaps
|
|
2231
|
-
},
|
|
2228
|
+
}, n = {
|
|
2232
2229
|
[E.ADD_POINTS]: "mdi-plus",
|
|
2233
2230
|
[E.CHANGE_VALUES]: "mdi-pencil",
|
|
2234
2231
|
[E.ASSIGN_VALUES_BULK]: "mdi-pencil",
|
|
@@ -2245,13 +2242,13 @@ class bn {
|
|
|
2245
2242
|
const o = {
|
|
2246
2243
|
method: t,
|
|
2247
2244
|
args: r,
|
|
2248
|
-
icon:
|
|
2245
|
+
icon: n[t],
|
|
2249
2246
|
isLoading: !0
|
|
2250
2247
|
};
|
|
2251
2248
|
this.history.push(o);
|
|
2252
2249
|
const i = this.history.length - 1;
|
|
2253
2250
|
this._pendingExecutionMode = "inline";
|
|
2254
|
-
const l = await
|
|
2251
|
+
const l = await be(async () => await s[t].apply(this, r));
|
|
2255
2252
|
a = l.response;
|
|
2256
2253
|
const f = this.history[i];
|
|
2257
2254
|
f && (f.duration = l.duration, f.executionMode = this._pendingExecutionMode, f.isLoading = !1);
|
|
@@ -2264,20 +2261,20 @@ class bn {
|
|
|
2264
2261
|
return a;
|
|
2265
2262
|
}
|
|
2266
2263
|
async dispatch(t, ...r) {
|
|
2267
|
-
const
|
|
2264
|
+
const s = async (n, a) => v[n] ? await this.dispatchFilter(n, ...a) : await this.dispatchAction(n, ...a);
|
|
2268
2265
|
if (Array.isArray(t)) {
|
|
2269
|
-
let
|
|
2266
|
+
let n = [];
|
|
2270
2267
|
for (let a = 0; a < t.length; a++) {
|
|
2271
2268
|
const o = t[a][0], i = t[a].slice(1, t[a].length);
|
|
2272
|
-
|
|
2269
|
+
n = await s(o, i);
|
|
2273
2270
|
}
|
|
2274
|
-
return
|
|
2271
|
+
return n;
|
|
2275
2272
|
} else
|
|
2276
|
-
return await
|
|
2273
|
+
return await s(t, r);
|
|
2277
2274
|
}
|
|
2278
2275
|
/** Filter operations do not transform the data and return a selection */
|
|
2279
2276
|
async dispatchFilter(t, ...r) {
|
|
2280
|
-
const
|
|
2277
|
+
const s = {
|
|
2281
2278
|
[v.FIND_GAPS]: this._findGaps,
|
|
2282
2279
|
[v.VALUE_THRESHOLD]: this._valueThreshold,
|
|
2283
2280
|
[v.DATETIME_RANGE]: this._datetimeRange,
|
|
@@ -2285,7 +2282,7 @@ class bn {
|
|
|
2285
2282
|
[v.CHANGE]: this._change,
|
|
2286
2283
|
[v.RATE_OF_CHANGE]: this._rateOfChange,
|
|
2287
2284
|
[v.SELECTION]: this._selection
|
|
2288
|
-
},
|
|
2285
|
+
}, n = {
|
|
2289
2286
|
[v.FIND_GAPS]: "mdi-plus",
|
|
2290
2287
|
[v.PERSISTENCE]: "mdi-plus",
|
|
2291
2288
|
[v.CHANGE]: "mdi-plus",
|
|
@@ -2300,12 +2297,12 @@ class bn {
|
|
|
2300
2297
|
const o = {
|
|
2301
2298
|
method: t,
|
|
2302
2299
|
args: r,
|
|
2303
|
-
icon:
|
|
2300
|
+
icon: n[t],
|
|
2304
2301
|
isLoading: !0
|
|
2305
2302
|
}, i = this.history[this.history.length - 1];
|
|
2306
2303
|
let l;
|
|
2307
2304
|
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
|
|
2305
|
+
const f = await be(async () => await s[t].apply(this, r));
|
|
2309
2306
|
a = f.response;
|
|
2310
2307
|
const u = this.history[l];
|
|
2311
2308
|
u && (u.duration = f.duration, u.executionMode = this._pendingExecutionMode, u.selected = f.response, u.isLoading = !1);
|
|
@@ -2330,23 +2327,23 @@ class bn {
|
|
|
2330
2327
|
* 3. Writes are conflict-free because the selection carries distinct indexes.
|
|
2331
2328
|
*/
|
|
2332
2329
|
async _changeValues(t, r) {
|
|
2333
|
-
const
|
|
2334
|
-
if (!
|
|
2335
|
-
const
|
|
2336
|
-
if (!
|
|
2330
|
+
const s = this.history[this.history.length - 2]?.selected;
|
|
2331
|
+
if (!s || s.length === 0) return [];
|
|
2332
|
+
const n = s.length;
|
|
2333
|
+
if (!O(E.CHANGE_VALUES, {
|
|
2337
2334
|
datasetSize: this.dataset.source.y.length,
|
|
2338
|
-
selectionSize:
|
|
2339
|
-
}).useWorker ||
|
|
2340
|
-
return
|
|
2335
|
+
selectionSize: n
|
|
2336
|
+
}).useWorker || n < Hr)
|
|
2337
|
+
return lt(this.dataY, s, t, r), [];
|
|
2341
2338
|
this._pendingExecutionMode = "worker";
|
|
2342
|
-
const o = Math.min(navigator.hardwareConcurrency || 1,
|
|
2339
|
+
const o = Math.min(navigator.hardwareConcurrency || 1, n), i = Math.ceil(n / o), l = [], f = [];
|
|
2343
2340
|
for (let u = 0; u < o; u++) {
|
|
2344
|
-
const p = u * i, g = Math.min((u + 1) * i,
|
|
2341
|
+
const p = u * i, g = Math.min((u + 1) * i, n);
|
|
2345
2342
|
if (p >= g) break;
|
|
2346
|
-
const y =
|
|
2343
|
+
const y = s.slice(p, g);
|
|
2347
2344
|
f.push(
|
|
2348
2345
|
new Promise((d) => {
|
|
2349
|
-
const h = new
|
|
2346
|
+
const h = new $r();
|
|
2350
2347
|
l.push(h), h.postMessage({
|
|
2351
2348
|
bufferY: this.dataY.buffer,
|
|
2352
2349
|
indexes: y,
|
|
@@ -2366,8 +2363,8 @@ class bn {
|
|
|
2366
2363
|
* and callers outside this module can use the same routine the
|
|
2367
2364
|
* CHANGE_VALUES fast path does.
|
|
2368
2365
|
*/
|
|
2369
|
-
_applyOperatorInPlace(t, r,
|
|
2370
|
-
|
|
2366
|
+
_applyOperatorInPlace(t, r, s) {
|
|
2367
|
+
lt(this.dataY, t, r, s);
|
|
2371
2368
|
}
|
|
2372
2369
|
/**
|
|
2373
2370
|
* One-shot assignment of distinct Y-values at the indices logged by the
|
|
@@ -2384,8 +2381,8 @@ class bn {
|
|
|
2384
2381
|
async _assignValuesBulk(t) {
|
|
2385
2382
|
const r = this.history[this.history.length - 2]?.selected;
|
|
2386
2383
|
if (!r || !r.length || !t?.length) return [];
|
|
2387
|
-
const
|
|
2388
|
-
for (let a = 0; a <
|
|
2384
|
+
const s = Math.min(r.length, t.length), n = this.dataY;
|
|
2385
|
+
for (let a = 0; a < s; a++) n[r[a]] = t[a];
|
|
2389
2386
|
return [];
|
|
2390
2387
|
}
|
|
2391
2388
|
/**
|
|
@@ -2400,10 +2397,10 @@ class bn {
|
|
|
2400
2397
|
async _assignDatetimesBulk(t) {
|
|
2401
2398
|
const r = this.history[this.history.length - 2]?.selected;
|
|
2402
2399
|
if (!r || !r.length || !t?.length) return [];
|
|
2403
|
-
const
|
|
2404
|
-
for (let o = 0; o <
|
|
2405
|
-
|
|
2406
|
-
return a.sort((o, i) => o - i), await this._deleteDataPoints(a), await this._addDataPoints(
|
|
2400
|
+
const s = Math.min(r.length, t.length), n = new Array(s), a = new Array(s);
|
|
2401
|
+
for (let o = 0; o < s; o++)
|
|
2402
|
+
n[o] = [t[o], this.dataY[r[o]]], a[o] = r[o];
|
|
2403
|
+
return a.sort((o, i) => o - i), await this._deleteDataPoints(a), await this._addDataPoints(n), [];
|
|
2407
2404
|
}
|
|
2408
2405
|
/**
|
|
2409
2406
|
* Multi-threaded linear interpolation over the selected indexes.
|
|
@@ -2414,32 +2411,32 @@ class bn {
|
|
|
2414
2411
|
async _interpolate(t) {
|
|
2415
2412
|
const r = this._getConsecutiveGroups(t);
|
|
2416
2413
|
if (r.length === 0 || r[0].length === 0) return;
|
|
2417
|
-
const
|
|
2414
|
+
const s = this.dataset.source.y.length, n = r.map((u) => ({
|
|
2418
2415
|
indexes: u,
|
|
2419
2416
|
lowerIdx: Math.max(0, u[0] - 1),
|
|
2420
|
-
upperIdx: Math.min(
|
|
2417
|
+
upperIdx: Math.min(s - 1, u[u.length - 1] + 1)
|
|
2421
2418
|
}));
|
|
2422
|
-
if (!
|
|
2423
|
-
datasetSize:
|
|
2419
|
+
if (!O(E.INTERPOLATE, {
|
|
2420
|
+
datasetSize: s,
|
|
2424
2421
|
selectionSize: t.length
|
|
2425
2422
|
}).useWorker) {
|
|
2426
|
-
|
|
2423
|
+
Pr(this.dataX, this.dataY, n);
|
|
2427
2424
|
return;
|
|
2428
2425
|
}
|
|
2429
2426
|
this._pendingExecutionMode = "worker";
|
|
2430
2427
|
const o = Math.min(
|
|
2431
2428
|
navigator.hardwareConcurrency || 1,
|
|
2432
|
-
|
|
2433
|
-
), i = Math.ceil(
|
|
2429
|
+
n.length
|
|
2430
|
+
), i = Math.ceil(n.length / o), l = [], f = [];
|
|
2434
2431
|
for (let u = 0; u < o; u++) {
|
|
2435
|
-
const p =
|
|
2432
|
+
const p = n.slice(
|
|
2436
2433
|
u * i,
|
|
2437
2434
|
(u + 1) * i
|
|
2438
2435
|
);
|
|
2439
2436
|
if (p.length === 0) break;
|
|
2440
2437
|
f.push(
|
|
2441
2438
|
new Promise((g) => {
|
|
2442
|
-
const y = new
|
|
2439
|
+
const y = new Sr();
|
|
2443
2440
|
l.push(y), y.postMessage({
|
|
2444
2441
|
bufferX: this.dataX.buffer,
|
|
2445
2442
|
bufferY: this.dataY.buffer,
|
|
@@ -2473,48 +2470,44 @@ class bn {
|
|
|
2473
2470
|
* @param unit {@link TimeUnit}
|
|
2474
2471
|
* @returns
|
|
2475
2472
|
*/
|
|
2476
|
-
async _shift(t, r,
|
|
2473
|
+
async _shift(t, r, s) {
|
|
2477
2474
|
if (t.length === 0) return;
|
|
2478
|
-
const
|
|
2479
|
-
if (!
|
|
2475
|
+
const n = s === F.MONTH, a = s === F.YEAR, o = !n && !a ? r * re[s] * 1e3 : 0, i = t.length;
|
|
2476
|
+
if (!O(E.SHIFT_DATETIMES, {
|
|
2480
2477
|
datasetSize: this.dataset.source.x.length,
|
|
2481
2478
|
selectionSize: i
|
|
2482
2479
|
}).useWorker) {
|
|
2483
|
-
const m =
|
|
2480
|
+
const m = Fr(
|
|
2484
2481
|
this.dataX,
|
|
2485
2482
|
this.dataY,
|
|
2486
2483
|
t,
|
|
2487
|
-
{ amount: r, isMonth:
|
|
2484
|
+
{ amount: r, isMonth: n, isYear: a, deltaMs: o }
|
|
2488
2485
|
);
|
|
2489
2486
|
await this._deleteDataPoints(t), await this._addDataPoints(m);
|
|
2490
2487
|
return;
|
|
2491
2488
|
}
|
|
2492
2489
|
this._pendingExecutionMode = "worker";
|
|
2493
|
-
const f =
|
|
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 = [];
|
|
2490
|
+
const f = U(i * Float64Array.BYTES_PER_ELEMENT), u = U(i * Float32Array.BYTES_PER_ELEMENT), p = Math.min(navigator.hardwareConcurrency || 1, i), g = Math.ceil(i / p), y = [], d = [];
|
|
2498
2491
|
for (let m = 0; m < p; m++) {
|
|
2499
2492
|
const S = m * g, A = Math.min((m + 1) * g, i);
|
|
2500
2493
|
if (S >= A) break;
|
|
2501
|
-
const
|
|
2494
|
+
const T = t.slice(S, A);
|
|
2502
2495
|
d.push(
|
|
2503
|
-
new Promise((
|
|
2504
|
-
const I = new
|
|
2496
|
+
new Promise((L) => {
|
|
2497
|
+
const I = new vr();
|
|
2505
2498
|
y.push(I), I.postMessage({
|
|
2506
2499
|
bufferX: this.dataX.buffer,
|
|
2507
2500
|
bufferY: this.dataY.buffer,
|
|
2508
2501
|
outputBufferX: f,
|
|
2509
2502
|
outputBufferY: u,
|
|
2510
|
-
indexes:
|
|
2503
|
+
indexes: T,
|
|
2511
2504
|
outStart: S,
|
|
2512
2505
|
amount: r,
|
|
2513
|
-
isMonth:
|
|
2506
|
+
isMonth: n,
|
|
2514
2507
|
isYear: a,
|
|
2515
2508
|
deltaMs: o
|
|
2516
|
-
}), I.onmessage = (
|
|
2517
|
-
|
|
2509
|
+
}), I.onmessage = (W) => {
|
|
2510
|
+
L(W.data);
|
|
2518
2511
|
};
|
|
2519
2512
|
})
|
|
2520
2513
|
);
|
|
@@ -2532,82 +2525,84 @@ class bn {
|
|
|
2532
2525
|
* 3. Cumulative fill counts before each segment give each worker's output startTarget, ensuring no overlap.
|
|
2533
2526
|
* 4. Each worker copies its segment to the output buffer and inserts its gap fills inline.
|
|
2534
2527
|
*/
|
|
2535
|
-
async _fillGaps(t, r, n,
|
|
2536
|
-
const
|
|
2537
|
-
if (
|
|
2538
|
-
const
|
|
2528
|
+
async _fillGaps(t, r, s, n, a) {
|
|
2529
|
+
const o = this.dataX.length;
|
|
2530
|
+
if (o === 0) return;
|
|
2531
|
+
const i = t[0] * re[t[1]] * 1e3, l = r[0] * re[r[1]] * 1e3, f = a?.[0] ?? 0, u = a?.[1] ?? o - 1, p = this.dataX, g = [], y = [];
|
|
2539
2532
|
let d = 0;
|
|
2540
2533
|
for (let k = f + 1; k <= u; k++)
|
|
2541
|
-
if (p[k] - p[k - 1] >
|
|
2542
|
-
let
|
|
2543
|
-
for (;
|
|
2544
|
-
|
|
2545
|
-
|
|
2534
|
+
if (p[k] - p[k - 1] > i) {
|
|
2535
|
+
let P = 0, G = p[k - 1] + l;
|
|
2536
|
+
for (; G < p[k]; )
|
|
2537
|
+
P++, G += l;
|
|
2538
|
+
P > 0 && (g.push([k - 1, k]), y.push(P), d += P);
|
|
2546
2539
|
}
|
|
2547
2540
|
if (d === 0) return;
|
|
2548
|
-
const h =
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2541
|
+
const h = o + d, b = h * Float64Array.BYTES_PER_ELEMENT, w = h * Float32Array.BYTES_PER_ELEMENT, m = U(
|
|
2542
|
+
b,
|
|
2543
|
+
Math.max(this.dataX.buffer.maxByteLength, b)
|
|
2544
|
+
), S = U(
|
|
2545
|
+
w,
|
|
2546
|
+
Math.max(this.dataY.buffer.maxByteLength, w)
|
|
2547
|
+
);
|
|
2548
|
+
if (!O(E.FILL_GAPS, {
|
|
2549
|
+
datasetSize: o,
|
|
2555
2550
|
selectionSize: d
|
|
2556
2551
|
}).useWorker) {
|
|
2557
2552
|
const k = new Float64Array(m), B = new Float32Array(S);
|
|
2558
|
-
|
|
2553
|
+
Or(
|
|
2559
2554
|
this.dataX,
|
|
2560
2555
|
this.dataY,
|
|
2561
2556
|
g,
|
|
2562
2557
|
k,
|
|
2563
2558
|
B,
|
|
2564
2559
|
0,
|
|
2565
|
-
|
|
2560
|
+
o - 1,
|
|
2566
2561
|
0,
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2562
|
+
l,
|
|
2563
|
+
s,
|
|
2564
|
+
n
|
|
2570
2565
|
), this.dataset.source.x = k, this.dataset.source.y = B, this._resizeTo(h);
|
|
2571
2566
|
return;
|
|
2572
2567
|
}
|
|
2573
2568
|
this._pendingExecutionMode = "worker";
|
|
2574
|
-
const
|
|
2575
|
-
let
|
|
2576
|
-
for (let k = 0; k <
|
|
2577
|
-
const B = k *
|
|
2578
|
-
let
|
|
2579
|
-
for (;
|
|
2580
|
-
|
|
2581
|
-
I.push({ start: B, end:
|
|
2582
|
-
}
|
|
2583
|
-
const
|
|
2584
|
-
for (let k = 1; k <
|
|
2585
|
-
|
|
2586
|
-
const
|
|
2587
|
-
for (let k = 0; k <
|
|
2588
|
-
const { start: B, end:
|
|
2589
|
-
|
|
2590
|
-
new Promise((
|
|
2591
|
-
const
|
|
2592
|
-
|
|
2569
|
+
const T = navigator.hardwareConcurrency || 1, L = Math.ceil(o / T), I = [];
|
|
2570
|
+
let W = 0;
|
|
2571
|
+
for (let k = 0; k < T; k++) {
|
|
2572
|
+
const B = k * L, P = Math.min((k + 1) * L - 1, o - 1), G = [];
|
|
2573
|
+
let ee = 0;
|
|
2574
|
+
for (; W < g.length && g[W][0] <= P; )
|
|
2575
|
+
G.push(g[W]), ee += y[W], W++;
|
|
2576
|
+
I.push({ start: B, end: P, gapsSegment: G, fillsInSegment: ee });
|
|
2577
|
+
}
|
|
2578
|
+
const fe = new Array(T).fill(0);
|
|
2579
|
+
for (let k = 1; k < T; k++)
|
|
2580
|
+
fe[k] = fe[k - 1] + I[k - 1].fillsInSegment;
|
|
2581
|
+
const Pe = [], xe = [];
|
|
2582
|
+
for (let k = 0; k < T; k++) {
|
|
2583
|
+
const { start: B, end: P, gapsSegment: G } = I[k], ee = B + fe[k];
|
|
2584
|
+
xe.push(
|
|
2585
|
+
new Promise((xt) => {
|
|
2586
|
+
const de = new br();
|
|
2587
|
+
Pe.push(de), de.postMessage({
|
|
2593
2588
|
bufferX: this.dataX.buffer,
|
|
2594
2589
|
bufferY: this.dataY.buffer,
|
|
2595
2590
|
outputBufferX: m,
|
|
2596
2591
|
outputBufferY: S,
|
|
2597
2592
|
start: B,
|
|
2598
|
-
end:
|
|
2599
|
-
gapsSegment:
|
|
2600
|
-
startTarget:
|
|
2601
|
-
fillDelta:
|
|
2602
|
-
interpolate:
|
|
2603
|
-
fillValue:
|
|
2604
|
-
}),
|
|
2605
|
-
|
|
2593
|
+
end: P,
|
|
2594
|
+
gapsSegment: G,
|
|
2595
|
+
startTarget: ee,
|
|
2596
|
+
fillDelta: l,
|
|
2597
|
+
interpolate: s,
|
|
2598
|
+
fillValue: n
|
|
2599
|
+
}), de.onmessage = (Nt) => {
|
|
2600
|
+
xt(Nt.data);
|
|
2606
2601
|
};
|
|
2607
2602
|
})
|
|
2608
2603
|
);
|
|
2609
2604
|
}
|
|
2610
|
-
await Promise.all(
|
|
2605
|
+
await Promise.all(xe), Pe.forEach((k) => k.terminate()), this.dataset.source.x = new Float64Array(m), this.dataset.source.y = new Float32Array(S), this._resizeTo(h);
|
|
2611
2606
|
}
|
|
2612
2607
|
/**
|
|
2613
2608
|
Deletes data points from a large array using worker threads.
|
|
@@ -2618,17 +2613,19 @@ class bn {
|
|
|
2618
2613
|
* @param deleteIndices
|
|
2619
2614
|
*/
|
|
2620
2615
|
async _deleteDataPoints(t) {
|
|
2621
|
-
const r = this.dataX.length,
|
|
2622
|
-
if (!
|
|
2616
|
+
const r = this.dataX.length, s = r - t.length;
|
|
2617
|
+
if (!O(E.DELETE_POINTS, {
|
|
2623
2618
|
datasetSize: r,
|
|
2624
2619
|
selectionSize: t.length
|
|
2625
2620
|
}).useWorker) {
|
|
2626
|
-
const y =
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2621
|
+
const y = U(
|
|
2622
|
+
this.dataX.buffer.byteLength,
|
|
2623
|
+
this.dataX.buffer.maxByteLength
|
|
2624
|
+
), d = U(
|
|
2625
|
+
this.dataY.buffer.byteLength,
|
|
2626
|
+
this.dataY.buffer.maxByteLength
|
|
2627
|
+
), h = new Float64Array(y), b = new Float32Array(d);
|
|
2628
|
+
Cr(
|
|
2632
2629
|
this.dataX,
|
|
2633
2630
|
this.dataY,
|
|
2634
2631
|
t,
|
|
@@ -2637,28 +2634,30 @@ class bn {
|
|
|
2637
2634
|
0,
|
|
2638
2635
|
r - 1,
|
|
2639
2636
|
0
|
|
2640
|
-
), this.dataset.source.x = h, this.dataset.source.y = b, this._resizeTo(
|
|
2637
|
+
), this.dataset.source.x = h, this.dataset.source.y = b, this._resizeTo(s);
|
|
2641
2638
|
return;
|
|
2642
2639
|
}
|
|
2643
2640
|
this._pendingExecutionMode = "worker";
|
|
2644
2641
|
const a = navigator.hardwareConcurrency || 1, o = Math.ceil(this.dataX.length / a), i = [], l = [];
|
|
2645
2642
|
for (let y = 0; y < a; y++) {
|
|
2646
|
-
const d = y * o, h = Math.min((y + 1) * o - 1, this.dataX.length - 1), b =
|
|
2643
|
+
const d = y * o, h = Math.min((y + 1) * o - 1, this.dataX.length - 1), b = se(t, d), w = Se(t, h), m = t.slice(b, w + 1);
|
|
2647
2644
|
l.push({ start: d, end: h, deleteSegment: m });
|
|
2648
2645
|
}
|
|
2649
2646
|
const f = new Array(a).fill(0);
|
|
2650
2647
|
for (let y = 1; y < a; y++)
|
|
2651
2648
|
f[y] = f[y - 1] + l[y - 1].deleteSegment.length;
|
|
2652
|
-
const u = [], p =
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2649
|
+
const u = [], p = U(
|
|
2650
|
+
this.dataX.buffer.byteLength,
|
|
2651
|
+
this.dataX.buffer.maxByteLength
|
|
2652
|
+
), g = U(
|
|
2653
|
+
this.dataY.buffer.byteLength,
|
|
2654
|
+
this.dataY.buffer.maxByteLength
|
|
2655
|
+
);
|
|
2657
2656
|
for (let y = 0; y < a; y++) {
|
|
2658
2657
|
const { start: d, end: h, deleteSegment: b } = l[y], w = d - f[y];
|
|
2659
2658
|
u.push(
|
|
2660
2659
|
new Promise((m) => {
|
|
2661
|
-
const S = new
|
|
2660
|
+
const S = new wr();
|
|
2662
2661
|
i.push(S), S.postMessage({
|
|
2663
2662
|
bufferX: this.dataX.buffer,
|
|
2664
2663
|
bufferY: this.dataY.buffer,
|
|
@@ -2674,7 +2673,7 @@ class bn {
|
|
|
2674
2673
|
})
|
|
2675
2674
|
);
|
|
2676
2675
|
}
|
|
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(
|
|
2676
|
+
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(s);
|
|
2678
2677
|
}
|
|
2679
2678
|
/**
|
|
2680
2679
|
*
|
|
@@ -2691,15 +2690,15 @@ class bn {
|
|
|
2691
2690
|
*/
|
|
2692
2691
|
async _driftCorrection(t) {
|
|
2693
2692
|
if (!t || t.length === 0) return;
|
|
2694
|
-
const r = this.dataset.source.x,
|
|
2695
|
-
let
|
|
2693
|
+
const r = this.dataset.source.x, s = navigator.hardwareConcurrency || 1;
|
|
2694
|
+
let n = 0;
|
|
2696
2695
|
for (const [p, g] of t)
|
|
2697
|
-
g > p && (
|
|
2698
|
-
if (!
|
|
2696
|
+
g > p && (n += g - p);
|
|
2697
|
+
if (!O(E.DRIFT_CORRECTION, {
|
|
2699
2698
|
datasetSize: r.length,
|
|
2700
|
-
selectionSize:
|
|
2699
|
+
selectionSize: n
|
|
2701
2700
|
}).useWorker) {
|
|
2702
|
-
|
|
2701
|
+
xr(r, this.dataY, t);
|
|
2703
2702
|
return;
|
|
2704
2703
|
}
|
|
2705
2704
|
this._pendingExecutionMode = "worker";
|
|
@@ -2708,7 +2707,7 @@ class bn {
|
|
|
2708
2707
|
if (g <= p) continue;
|
|
2709
2708
|
const d = r[p], h = r[g] - d;
|
|
2710
2709
|
if (h === 0) continue;
|
|
2711
|
-
const b = g - p, w = Math.max(1, Math.ceil(b /
|
|
2710
|
+
const b = g - p, w = Math.max(1, Math.ceil(b / s));
|
|
2712
2711
|
for (let m = p; m < g; m += w)
|
|
2713
2712
|
o.push({
|
|
2714
2713
|
chunkStart: m,
|
|
@@ -2719,7 +2718,7 @@ class bn {
|
|
|
2719
2718
|
});
|
|
2720
2719
|
}
|
|
2721
2720
|
if (o.length === 0) return;
|
|
2722
|
-
const i = Math.min(
|
|
2721
|
+
const i = Math.min(s, o.length), l = Array.from(
|
|
2723
2722
|
{ length: i },
|
|
2724
2723
|
() => []
|
|
2725
2724
|
);
|
|
@@ -2728,7 +2727,7 @@ class bn {
|
|
|
2728
2727
|
for (const p of l)
|
|
2729
2728
|
p.length !== 0 && u.push(
|
|
2730
2729
|
new Promise((g) => {
|
|
2731
|
-
const y = new
|
|
2730
|
+
const y = new Er();
|
|
2732
2731
|
f.push(y), y.postMessage({
|
|
2733
2732
|
bufferX: this.dataX.buffer,
|
|
2734
2733
|
bufferY: this.dataY.buffer,
|
|
@@ -2747,9 +2746,9 @@ class bn {
|
|
|
2747
2746
|
*/
|
|
2748
2747
|
_getConsecutiveGroups(t) {
|
|
2749
2748
|
const r = [[]];
|
|
2750
|
-
return t.reduce((
|
|
2751
|
-
const a =
|
|
2752
|
-
return !a.length ||
|
|
2749
|
+
return t.reduce((s, n) => {
|
|
2750
|
+
const a = s[s.length - 1];
|
|
2751
|
+
return !a.length || n == a[a.length - 1] + 1 ? a.push(n) : s.push([n]), s;
|
|
2753
2752
|
}, r), r;
|
|
2754
2753
|
}
|
|
2755
2754
|
/**
|
|
@@ -2761,19 +2760,21 @@ class bn {
|
|
|
2761
2760
|
*/
|
|
2762
2761
|
async _addDataPoints(t) {
|
|
2763
2762
|
if (t.length === 0) return;
|
|
2764
|
-
const r = this.dataX.length,
|
|
2763
|
+
const r = this.dataX.length, s = r + t.length;
|
|
2765
2764
|
t.sort((d, h) => d[0] - h[0]);
|
|
2766
|
-
const
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2765
|
+
const n = s * Float64Array.BYTES_PER_ELEMENT, a = s * Float32Array.BYTES_PER_ELEMENT, o = U(
|
|
2766
|
+
n,
|
|
2767
|
+
Math.max(this.dataX.buffer.maxByteLength, n)
|
|
2768
|
+
), i = U(
|
|
2769
|
+
a,
|
|
2770
|
+
Math.max(this.dataY.buffer.maxByteLength, a)
|
|
2771
|
+
);
|
|
2772
|
+
if (!O(E.ADD_POINTS, {
|
|
2772
2773
|
datasetSize: r,
|
|
2773
2774
|
selectionSize: t.length
|
|
2774
2775
|
}).useWorker) {
|
|
2775
2776
|
const d = new Float64Array(o), h = new Float32Array(i);
|
|
2776
|
-
|
|
2777
|
+
Dr(
|
|
2777
2778
|
this.dataX,
|
|
2778
2779
|
this.dataY,
|
|
2779
2780
|
t,
|
|
@@ -2782,22 +2783,22 @@ class bn {
|
|
|
2782
2783
|
0,
|
|
2783
2784
|
r,
|
|
2784
2785
|
0
|
|
2785
|
-
), this.dataset.source.x = d, this.dataset.source.y = h, this._resizeTo(
|
|
2786
|
+
), this.dataset.source.x = d, this.dataset.source.y = h, this._resizeTo(s);
|
|
2786
2787
|
return;
|
|
2787
2788
|
}
|
|
2788
2789
|
this._pendingExecutionMode = "worker";
|
|
2789
2790
|
const f = t.map(
|
|
2790
|
-
(d) =>
|
|
2791
|
+
(d) => Se(this.dataX, d[0]) + 1
|
|
2791
2792
|
), u = Math.max(
|
|
2792
2793
|
1,
|
|
2793
2794
|
Math.min(navigator.hardwareConcurrency || 1, Math.max(r, 1))
|
|
2794
2795
|
), p = Math.ceil(Math.max(r, 1) / u), g = [], y = [];
|
|
2795
2796
|
for (let d = 0; d < u; d++) {
|
|
2796
|
-
const h = d * p, b = Math.min((d + 1) * p, r), w =
|
|
2797
|
+
const h = d * p, b = Math.min((d + 1) * p, r), w = se(f, h), m = d === u - 1 ? t.length : se(f, b), S = t.slice(w, m), A = h + w;
|
|
2797
2798
|
h >= b && S.length === 0 || y.push(
|
|
2798
|
-
new Promise((
|
|
2799
|
-
const
|
|
2800
|
-
g.push(
|
|
2799
|
+
new Promise((T) => {
|
|
2800
|
+
const L = new kr();
|
|
2801
|
+
g.push(L), L.postMessage({
|
|
2801
2802
|
bufferX: this.dataX.buffer,
|
|
2802
2803
|
bufferY: this.dataY.buffer,
|
|
2803
2804
|
outputBufferX: o,
|
|
@@ -2806,13 +2807,13 @@ class bn {
|
|
|
2806
2807
|
origEnd: b,
|
|
2807
2808
|
insertions: S,
|
|
2808
2809
|
outStart: A
|
|
2809
|
-
}),
|
|
2810
|
-
|
|
2810
|
+
}), L.onmessage = (I) => {
|
|
2811
|
+
T(I.data);
|
|
2811
2812
|
};
|
|
2812
2813
|
})
|
|
2813
2814
|
);
|
|
2814
2815
|
}
|
|
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(
|
|
2816
|
+
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(s);
|
|
2816
2817
|
}
|
|
2817
2818
|
// =======================
|
|
2818
2819
|
// FILTER OPERATIONS
|
|
@@ -2833,18 +2834,18 @@ class bn {
|
|
|
2833
2834
|
async _valueThreshold(t) {
|
|
2834
2835
|
const r = Object.keys(t);
|
|
2835
2836
|
if (r.length === 0) return [];
|
|
2836
|
-
const
|
|
2837
|
-
[
|
|
2838
|
-
[
|
|
2839
|
-
[
|
|
2840
|
-
[
|
|
2841
|
-
[
|
|
2842
|
-
},
|
|
2837
|
+
const s = {
|
|
2838
|
+
[J.LT]: 0,
|
|
2839
|
+
[J.LTE]: 1,
|
|
2840
|
+
[J.GT]: 2,
|
|
2841
|
+
[J.GTE]: 3,
|
|
2842
|
+
[J.E]: 4
|
|
2843
|
+
}, n = r.map((h) => s[h] ?? 4), a = r.map((h) => t[h]), o = this.dataset.source.y, i = o.length;
|
|
2843
2844
|
if (i === 0) return [];
|
|
2844
|
-
if (!
|
|
2845
|
+
if (!O(v.VALUE_THRESHOLD, {
|
|
2845
2846
|
datasetSize: i
|
|
2846
2847
|
}).useWorker)
|
|
2847
|
-
return
|
|
2848
|
+
return Pt(o, 0, i, n, a);
|
|
2848
2849
|
this._pendingExecutionMode = "worker";
|
|
2849
2850
|
const f = Math.min(navigator.hardwareConcurrency || 1, i), u = Math.ceil(i / f), p = [], g = [];
|
|
2850
2851
|
for (let h = 0; h < f; h++) {
|
|
@@ -2852,12 +2853,12 @@ class bn {
|
|
|
2852
2853
|
if (b >= w) break;
|
|
2853
2854
|
g.push(
|
|
2854
2855
|
new Promise((m) => {
|
|
2855
|
-
const S = new
|
|
2856
|
+
const S = new Re();
|
|
2856
2857
|
p.push(S), S.postMessage({
|
|
2857
2858
|
bufferY: this.dataY.buffer,
|
|
2858
2859
|
start: b,
|
|
2859
2860
|
end: w,
|
|
2860
|
-
ops:
|
|
2861
|
+
ops: n,
|
|
2861
2862
|
values: a
|
|
2862
2863
|
}), S.onmessage = (A) => {
|
|
2863
2864
|
m(A.data);
|
|
@@ -2887,21 +2888,21 @@ class bn {
|
|
|
2887
2888
|
* 3. Main thread concatenates results in chunk order, preserving ascending order.
|
|
2888
2889
|
*/
|
|
2889
2890
|
async _rateOfChange(t, r) {
|
|
2890
|
-
const
|
|
2891
|
-
if (
|
|
2892
|
-
const
|
|
2893
|
-
if (!
|
|
2894
|
-
datasetSize:
|
|
2891
|
+
const s = this.dataset.source.y;
|
|
2892
|
+
if (s.length < 2) return [];
|
|
2893
|
+
const n = 1, a = s.length, o = a - n;
|
|
2894
|
+
if (!O(v.RATE_OF_CHANGE, {
|
|
2895
|
+
datasetSize: s.length
|
|
2895
2896
|
}).useWorker)
|
|
2896
|
-
return
|
|
2897
|
+
return Ir(s, n, a, t, r);
|
|
2897
2898
|
this._pendingExecutionMode = "worker";
|
|
2898
2899
|
const l = Math.min(navigator.hardwareConcurrency || 1, o), f = Math.ceil(o / l), u = [], p = [];
|
|
2899
2900
|
for (let d = 0; d < l; d++) {
|
|
2900
|
-
const h =
|
|
2901
|
+
const h = n + d * f, b = Math.min(n + (d + 1) * f, a);
|
|
2901
2902
|
if (h >= b) break;
|
|
2902
2903
|
p.push(
|
|
2903
2904
|
new Promise((w) => {
|
|
2904
|
-
const m = new
|
|
2905
|
+
const m = new Lr();
|
|
2905
2906
|
u.push(m), m.postMessage({
|
|
2906
2907
|
bufferY: this.dataY.buffer,
|
|
2907
2908
|
start: h,
|
|
@@ -2930,9 +2931,9 @@ class bn {
|
|
|
2930
2931
|
* leave that side unconstrained; omitting both selects the full series.
|
|
2931
2932
|
*/
|
|
2932
2933
|
async _datetimeRange(t, r) {
|
|
2933
|
-
const
|
|
2934
|
-
if (
|
|
2935
|
-
const a = t == null ? 0 :
|
|
2934
|
+
const s = this.dataset.source.x, n = s.length;
|
|
2935
|
+
if (n === 0) return [];
|
|
2936
|
+
const a = t == null ? 0 : se(s, t), o = r == null ? n - 1 : Se(s, r);
|
|
2936
2937
|
if (a > o) return [];
|
|
2937
2938
|
const i = new Array(o - a + 1);
|
|
2938
2939
|
for (let l = a; l <= o; l++) i[l - a] = l;
|
|
@@ -2958,21 +2959,21 @@ class bn {
|
|
|
2958
2959
|
* 3. Main thread concatenates results in chunk order, preserving ascending order.
|
|
2959
2960
|
*/
|
|
2960
2961
|
async _change(t, r) {
|
|
2961
|
-
const
|
|
2962
|
-
if (
|
|
2963
|
-
const
|
|
2964
|
-
if (!
|
|
2965
|
-
datasetSize:
|
|
2962
|
+
const s = this.dataset.source.y;
|
|
2963
|
+
if (s.length < 2) return [];
|
|
2964
|
+
const n = 1, a = s.length, o = a - n;
|
|
2965
|
+
if (!O(v.CHANGE, {
|
|
2966
|
+
datasetSize: s.length
|
|
2966
2967
|
}).useWorker)
|
|
2967
|
-
return
|
|
2968
|
+
return Rr(s, n, a, t, r);
|
|
2968
2969
|
this._pendingExecutionMode = "worker";
|
|
2969
2970
|
const l = Math.min(navigator.hardwareConcurrency || 1, o), f = Math.ceil(o / l), u = [], p = [];
|
|
2970
2971
|
for (let d = 0; d < l; d++) {
|
|
2971
|
-
const h =
|
|
2972
|
+
const h = n + d * f, b = Math.min(n + (d + 1) * f, a);
|
|
2972
2973
|
if (h >= b) break;
|
|
2973
2974
|
p.push(
|
|
2974
2975
|
new Promise((w) => {
|
|
2975
|
-
const m = new
|
|
2976
|
+
const m = new Tr();
|
|
2976
2977
|
u.push(m), m.postMessage({
|
|
2977
2978
|
bufferY: this.dataY.buffer,
|
|
2978
2979
|
start: h,
|
|
@@ -3003,15 +3004,15 @@ class bn {
|
|
|
3003
3004
|
* @param unit The time unit (TimeUnit)
|
|
3004
3005
|
* @param range If specified, the gaps will be found only within the range
|
|
3005
3006
|
*/
|
|
3006
|
-
async _findGaps(t, r,
|
|
3007
|
-
const
|
|
3008
|
-
let a = 0, o =
|
|
3009
|
-
if (
|
|
3010
|
-
const i = t *
|
|
3011
|
-
if (!
|
|
3007
|
+
async _findGaps(t, r, s) {
|
|
3008
|
+
const n = this.dataset.source.x;
|
|
3009
|
+
let a = 0, o = n.length;
|
|
3010
|
+
if (s?.[0] && s?.[1] && (a = s[0], o = s[1]), o <= a) return [];
|
|
3011
|
+
const i = t * re[r] * 1e3;
|
|
3012
|
+
if (!O(v.FIND_GAPS, {
|
|
3012
3013
|
datasetSize: o - a
|
|
3013
3014
|
}).useWorker) {
|
|
3014
|
-
const b =
|
|
3015
|
+
const b = Mr(n, a, o - 1, i), w = /* @__PURE__ */ new Set();
|
|
3015
3016
|
for (let m = 0; m < b.length; m++) w.add(b[m]);
|
|
3016
3017
|
return [...w];
|
|
3017
3018
|
}
|
|
@@ -3022,14 +3023,14 @@ class bn {
|
|
|
3022
3023
|
if (w >= m) break;
|
|
3023
3024
|
y.push(
|
|
3024
3025
|
new Promise((S) => {
|
|
3025
|
-
const A = new
|
|
3026
|
+
const A = new _r();
|
|
3026
3027
|
g.push(A), A.postMessage({
|
|
3027
3028
|
bufferX: this.dataX.buffer,
|
|
3028
3029
|
start: w,
|
|
3029
3030
|
endInclusive: m,
|
|
3030
3031
|
threshold: i
|
|
3031
|
-
}), A.onmessage = (
|
|
3032
|
-
S(
|
|
3032
|
+
}), A.onmessage = (T) => {
|
|
3033
|
+
S(T.data);
|
|
3033
3034
|
};
|
|
3034
3035
|
})
|
|
3035
3036
|
);
|
|
@@ -3054,35 +3055,35 @@ class bn {
|
|
|
3054
3055
|
* @param range If specified, the points will be found only within the range
|
|
3055
3056
|
*/
|
|
3056
3057
|
async _persistence(t, r) {
|
|
3057
|
-
const
|
|
3058
|
-
let
|
|
3059
|
-
if (r?.[0] && r?.[1] && (
|
|
3060
|
-
const o = a -
|
|
3061
|
-
if (!
|
|
3058
|
+
const s = this.dataset.source.y;
|
|
3059
|
+
let n = 0, a = s.length;
|
|
3060
|
+
if (r?.[0] && r?.[1] && (n = r[0], a = r[1]), a <= n) return [];
|
|
3061
|
+
const o = a - n;
|
|
3062
|
+
if (!O(v.PERSISTENCE, {
|
|
3062
3063
|
datasetSize: o
|
|
3063
3064
|
}).useWorker) {
|
|
3064
|
-
const w =
|
|
3065
|
+
const w = Ur(s, n, a), m = [];
|
|
3065
3066
|
for (let S = 0; S < w.length; S += 3) {
|
|
3066
|
-
const A = w[S],
|
|
3067
|
-
if (
|
|
3068
|
-
for (let
|
|
3067
|
+
const A = w[S], T = w[S + 1];
|
|
3068
|
+
if (T >= t)
|
|
3069
|
+
for (let L = 0; L < T; L++) m.push(A + L);
|
|
3069
3070
|
}
|
|
3070
3071
|
return m;
|
|
3071
3072
|
}
|
|
3072
3073
|
this._pendingExecutionMode = "worker";
|
|
3073
3074
|
const l = Math.min(navigator.hardwareConcurrency || 1, o), f = Math.ceil(o / l), u = [], p = [];
|
|
3074
3075
|
for (let w = 0; w < l; w++) {
|
|
3075
|
-
const m =
|
|
3076
|
+
const m = n + w * f, S = Math.min(n + (w + 1) * f, a);
|
|
3076
3077
|
if (m >= S) break;
|
|
3077
3078
|
p.push(
|
|
3078
3079
|
new Promise((A) => {
|
|
3079
|
-
const
|
|
3080
|
-
u.push(
|
|
3080
|
+
const T = new Ar();
|
|
3081
|
+
u.push(T), T.postMessage({
|
|
3081
3082
|
bufferY: this.dataY.buffer,
|
|
3082
3083
|
start: m,
|
|
3083
3084
|
end: S
|
|
3084
|
-
}),
|
|
3085
|
-
A(
|
|
3085
|
+
}), T.onmessage = (L) => {
|
|
3086
|
+
A(L.data);
|
|
3086
3087
|
};
|
|
3087
3088
|
})
|
|
3088
3089
|
);
|
|
@@ -3093,8 +3094,8 @@ class bn {
|
|
|
3093
3094
|
for (let w = 0; w < g.length; w++) {
|
|
3094
3095
|
const m = g[w];
|
|
3095
3096
|
for (let S = 0; S < m.length; S += 3) {
|
|
3096
|
-
const A = m[S],
|
|
3097
|
-
I >= 0 && h[I] ===
|
|
3097
|
+
const A = m[S], T = m[S + 1], L = m[S + 2], I = y.length - 1;
|
|
3098
|
+
I >= 0 && h[I] === L && y[I] + d[I] === A ? d[I] += T : (y.push(A), d.push(T), h.push(L));
|
|
3098
3099
|
}
|
|
3099
3100
|
}
|
|
3100
3101
|
const b = [];
|
|
@@ -3109,69 +3110,69 @@ class bn {
|
|
|
3109
3110
|
}
|
|
3110
3111
|
}
|
|
3111
3112
|
export {
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3113
|
+
C as ACCOUNT_BASE,
|
|
3114
|
+
Ue as AUTH_BASE,
|
|
3115
|
+
os as ApiKey,
|
|
3116
|
+
D as BASE_URL,
|
|
3117
|
+
is as Collaborator,
|
|
3118
|
+
bt as DEFAULT_SNACK_DURATION,
|
|
3119
|
+
cs as DataSource,
|
|
3120
|
+
Jr as Datastream,
|
|
3120
3121
|
E as EnumEditOperations,
|
|
3121
3122
|
v as EnumFilterOperations,
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3123
|
+
J as FilterOperation,
|
|
3124
|
+
Wt as HydroShareArchive,
|
|
3125
|
+
Z as INCREASE_AMOUNT,
|
|
3126
|
+
Gt as Location,
|
|
3127
|
+
jt as LogicalOperation,
|
|
3128
|
+
ns as OAuthProvider,
|
|
3129
|
+
Es as ObservationRecord,
|
|
3130
|
+
Zr as ObservedProperty,
|
|
3131
|
+
Bt as Operator,
|
|
3132
|
+
rs as Organization,
|
|
3133
|
+
ie as PROVIDER_BASE,
|
|
3134
|
+
hs as Payload,
|
|
3135
|
+
Yt as PermissionAction,
|
|
3136
|
+
Ht as PermissionResource,
|
|
3137
|
+
or as Position,
|
|
3138
|
+
Vr as PostHydroShareArchive,
|
|
3139
|
+
es as ProcessingLevel,
|
|
3140
|
+
ts as ResultQualifier,
|
|
3141
|
+
me as SESSION_BASE,
|
|
3142
|
+
Qr as Sensor,
|
|
3143
|
+
ar as Snack,
|
|
3144
|
+
St as SnackColor,
|
|
3145
|
+
Et as SnackIcon,
|
|
3146
|
+
kt as SnackTitle,
|
|
3147
|
+
ir as Snackbar,
|
|
3148
|
+
Je as TAG_BASE,
|
|
3148
3149
|
_ as THINGS_BASE,
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3150
|
+
qr as Thing,
|
|
3151
|
+
F as TimeUnit,
|
|
3152
|
+
Kr as Unit,
|
|
3153
|
+
ss as User,
|
|
3154
|
+
as as Workspace,
|
|
3155
|
+
us as api,
|
|
3155
3156
|
c as apiMethods,
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3157
|
+
bs as clearCalibration,
|
|
3158
|
+
vt as createPatchObject,
|
|
3159
|
+
Ss as ensureCalibration,
|
|
3160
|
+
zt as extractErrorMessage,
|
|
3161
|
+
se as findFirstGreaterOrEqual,
|
|
3162
|
+
Se as findLastLessOrEqual,
|
|
3163
|
+
fs as formatDate,
|
|
3164
|
+
ds as formatDuration,
|
|
3165
|
+
ht as getCSRFToken,
|
|
3166
|
+
gs as getCalibration,
|
|
3167
|
+
ms as getLastBenchmarkDetail,
|
|
3168
|
+
ls as getObservationsEndpoint,
|
|
3169
|
+
ws as getOperationTable,
|
|
3170
|
+
be as measureEllapsedTime,
|
|
3171
|
+
ys as onCalibrationChange,
|
|
3172
|
+
ft as requestInterceptor,
|
|
3173
|
+
dt as responseInterceptor,
|
|
3174
|
+
Wr as runBenchmarks,
|
|
3175
|
+
O as shouldUseWorker,
|
|
3176
|
+
ps as subtractHours,
|
|
3177
|
+
re as timeUnitMultipliers
|
|
3177
3178
|
};
|