szdl-utils-kit 0.2.7 → 0.2.8
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 +747 -804
- package/dist/index.umd.cjs +2 -8
- package/package.json +1 -2
package/dist/index.js
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
if (!
|
|
5
|
-
throw TypeError("Cannot " +
|
|
1
|
+
var ue = Object.defineProperty;
|
|
2
|
+
var me = (A, s, e) => s in A ? ue(A, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : A[s] = e;
|
|
3
|
+
var C = (A, s, e) => (me(A, typeof s != "symbol" ? s + "" : s, e), e), Jt = (A, s, e) => {
|
|
4
|
+
if (!s.has(A))
|
|
5
|
+
throw TypeError("Cannot " + e);
|
|
6
6
|
};
|
|
7
|
-
var
|
|
8
|
-
if (
|
|
7
|
+
var a = (A, s, e) => (Jt(A, s, "read from private field"), e ? e.call(A) : s.get(A)), _ = (A, s, e) => {
|
|
8
|
+
if (s.has(A))
|
|
9
9
|
throw TypeError("Cannot add the same private member more than once");
|
|
10
|
-
|
|
11
|
-
},
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
function
|
|
15
|
-
return
|
|
10
|
+
s instanceof WeakSet ? s.add(A) : s.set(A, e);
|
|
11
|
+
}, E = (A, s, e, o) => (Jt(A, s, "write to private field"), o ? o.call(A, e) : s.set(A, e), e);
|
|
12
|
+
var O = (A, s, e) => (Jt(A, s, "access private method"), e);
|
|
13
|
+
var fe = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
14
|
+
function Ne(A) {
|
|
15
|
+
return A && A.__esModule && Object.prototype.hasOwnProperty.call(A, "default") ? A.default : A;
|
|
16
16
|
}
|
|
17
|
-
var
|
|
18
|
-
(function(
|
|
19
|
-
(function(
|
|
20
|
-
Array.prototype.indexOf || (Array.prototype.indexOf = function(
|
|
21
|
-
var
|
|
22
|
-
for (
|
|
23
|
-
if (this[
|
|
24
|
-
return
|
|
17
|
+
var Xt = { exports: {} };
|
|
18
|
+
(function(A, s) {
|
|
19
|
+
(function(e) {
|
|
20
|
+
Array.prototype.indexOf || (Array.prototype.indexOf = function(t, r) {
|
|
21
|
+
var h, c;
|
|
22
|
+
for (h = r || 0, c = this.length; h < c; h += 1)
|
|
23
|
+
if (this[h] === t)
|
|
24
|
+
return h;
|
|
25
25
|
return -1;
|
|
26
26
|
});
|
|
27
|
-
var
|
|
28
|
-
for (var
|
|
29
|
-
|
|
30
|
-
return
|
|
31
|
-
},
|
|
32
|
-
return
|
|
33
|
-
},
|
|
34
|
-
var
|
|
35
|
-
return
|
|
36
|
-
},
|
|
37
|
-
var
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
],
|
|
44
|
-
return !isNaN(Number(
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
], !isNaN(Number(
|
|
51
|
-
},
|
|
27
|
+
var o = this, n = function(t, r) {
|
|
28
|
+
for (var h = t.toString(); h.length < r; )
|
|
29
|
+
h = "0" + h;
|
|
30
|
+
return h;
|
|
31
|
+
}, l = function(t, r) {
|
|
32
|
+
return r !== e ? (t.year(r.year() || r.year), t.month(r.month() || r.month), t.day(r.day() || r.day), t.hours(r.hours() || r.hours), t.minutes(r.minutes() || r.minutes), t.seconds(r.seconds() || r.seconds), t.milliseconds(r.milliseconds() || r.milliseconds), t) : e;
|
|
33
|
+
}, u = function(t, r) {
|
|
34
|
+
var h, c = "";
|
|
35
|
+
return h = t.slice(r, r + 1), h !== "" && !isNaN(Number(h)) && (c += "%H"), h = t.charAt(r + 2), h !== "" && h === ":" && (c += h), h = t.slice(r + 3, r + 4), h !== "" && !isNaN(Number(h)) && (c += "%M"), h = t.charAt(r + 5), h !== "" && h === ":" && (c += h), h = t.slice(r + 6, r + 7), h !== "" && !isNaN(Number(h)) && (c += "%S"), c;
|
|
36
|
+
}, y = function(t, r) {
|
|
37
|
+
var h, c = [
|
|
38
|
+
t.slice(r, r + 1),
|
|
39
|
+
t.charAt(r + 2),
|
|
40
|
+
t.slice(r + 3, r + 4),
|
|
41
|
+
t.charAt(r + 5),
|
|
42
|
+
t.slice(r + 6, r + 9)
|
|
43
|
+
], M;
|
|
44
|
+
return !isNaN(Number(c[0])) && !isNaN(Number(c[2])) && !isNaN(Number(c[4])) ? (c[1] === "." && c[3] === "." ? h = "%d.%m.%Y" : c[1] === "-" && c[3] === "-" ? h = "%m-%d-%Y" : c[1] === "/" && c[3] === "/" && (h = "%m/%d/%Y"), h) : (M = [
|
|
45
|
+
t.slice(r, r + 3),
|
|
46
|
+
t.charAt(r + 4),
|
|
47
|
+
t.slice(r + 5, r + 6),
|
|
48
|
+
t.charAt(r + 7),
|
|
49
|
+
t.slice(r + 8, r + 9)
|
|
50
|
+
], !isNaN(Number(M[0])) && !isNaN(Number(M[2])) && !isNaN(Number(M[4])) ? (M[1] === "-" && M[3] === "-" && (h = "%Y-%m-%d"), h) : "");
|
|
51
|
+
}, f = o.tempus, i, S, d = o.navigator || {}, m = "en", N = {
|
|
52
52
|
en: {
|
|
53
53
|
JANUARY_SHORT: "Jan",
|
|
54
54
|
FEBRUARY_SHORT: "Feb",
|
|
@@ -209,102 +209,102 @@ var VA = { exports: {} };
|
|
|
209
209
|
FRIDAY_LONG: "Freitag",
|
|
210
210
|
SATURDAY_LONG: "Samstag"
|
|
211
211
|
}
|
|
212
|
-
},
|
|
212
|
+
}, B = function() {
|
|
213
213
|
return [
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
214
|
+
N[m].JANUARY_LONG,
|
|
215
|
+
N[m].FEBRUARY_LONG,
|
|
216
|
+
N[m].MARCH_LONG,
|
|
217
|
+
N[m].APRIL_LONG,
|
|
218
|
+
N[m].MAY_LONG,
|
|
219
|
+
N[m].JUNE_LONG,
|
|
220
|
+
N[m].JULY_LONG,
|
|
221
|
+
N[m].AUGUST_LONG,
|
|
222
|
+
N[m].SEPTEMBER_LONG,
|
|
223
|
+
N[m].OCTOBER_LONG,
|
|
224
|
+
N[m].NOVEMBER_LONG,
|
|
225
|
+
N[m].DECEMBER_LONG
|
|
226
226
|
];
|
|
227
|
-
},
|
|
227
|
+
}, ht = function() {
|
|
228
228
|
return [
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
229
|
+
N[m].JANUARY_SHORT,
|
|
230
|
+
N[m].FEBRUARY_SHORT,
|
|
231
|
+
N[m].MARCH_SHORT,
|
|
232
|
+
N[m].APRIL_SHORT,
|
|
233
|
+
N[m].MAY_SHORT,
|
|
234
|
+
N[m].JUNE_SHORT,
|
|
235
|
+
N[m].JULY_SHORT,
|
|
236
|
+
N[m].AUGUST_SHORT,
|
|
237
|
+
N[m].SEPTEMBER_SHORT,
|
|
238
|
+
N[m].OCTOBER_SHORT,
|
|
239
|
+
N[m].NOVEMBER_SHORT,
|
|
240
|
+
N[m].DECEMBER_SHORT
|
|
241
241
|
];
|
|
242
|
-
},
|
|
242
|
+
}, Z = function() {
|
|
243
243
|
return [
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
244
|
+
N[m].SUNDAY_LONG,
|
|
245
|
+
N[m].MONDAY_LONG,
|
|
246
|
+
N[m].TUESDAY_LONG,
|
|
247
|
+
N[m].WEDNESDAY_LONG,
|
|
248
|
+
N[m].THURSDAY_LONG,
|
|
249
|
+
N[m].FRIDAY_LONG,
|
|
250
|
+
N[m].SATURDAY_LONG
|
|
251
251
|
];
|
|
252
|
-
},
|
|
252
|
+
}, W = function() {
|
|
253
253
|
return [
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
254
|
+
N[m].SUNDAY_SHORT,
|
|
255
|
+
N[m].MONDAY_SHORT,
|
|
256
|
+
N[m].TUESDAY_SHORT,
|
|
257
|
+
N[m].WEDNESDAY_SHORT,
|
|
258
|
+
N[m].THURSDAY_SHORT,
|
|
259
|
+
N[m].FRIDAY_SHORT,
|
|
260
|
+
N[m].SATURDAY_SHORT
|
|
261
261
|
];
|
|
262
|
-
},
|
|
263
|
-
var
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) :
|
|
267
|
-
},
|
|
268
|
-
},
|
|
262
|
+
}, F, dt, at, ct, le = function(t, r, h) {
|
|
263
|
+
var c;
|
|
264
|
+
o.XMLHttpRequest ? c = new XMLHttpRequest() : c = new ActiveXObject("Microsoft.XMLHTTP"), c.onreadystatechange = function() {
|
|
265
|
+
c.readyState === 4 && (c.status === 200 ? r && (o.JSON === e ? alert(`Please, include json2 into your project if you want use old browsers!
|
|
266
|
+
https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : r(JSON.parse(c.responseText))) : h && h(c));
|
|
267
|
+
}, c.open("GET", t, !1), c.send();
|
|
268
|
+
}, U = {
|
|
269
269
|
"%d": {
|
|
270
|
-
format: function(
|
|
271
|
-
return
|
|
270
|
+
format: function(t) {
|
|
271
|
+
return n(t.day() || i.MIN_DAY, 2);
|
|
272
272
|
},
|
|
273
|
-
parse: function(
|
|
274
|
-
var
|
|
275
|
-
return { day: isNaN(
|
|
273
|
+
parse: function(t) {
|
|
274
|
+
var r = Number(t);
|
|
275
|
+
return { day: isNaN(r) ? e : r };
|
|
276
276
|
},
|
|
277
277
|
minLength: 2,
|
|
278
278
|
maxLength: 2,
|
|
279
279
|
type: "number"
|
|
280
280
|
},
|
|
281
281
|
"%m": {
|
|
282
|
-
format: function(
|
|
283
|
-
return
|
|
282
|
+
format: function(t) {
|
|
283
|
+
return n(t.month() || i.MIN_MONTH, 2);
|
|
284
284
|
},
|
|
285
|
-
parse: function(
|
|
286
|
-
var
|
|
287
|
-
return { month: isNaN(
|
|
285
|
+
parse: function(t) {
|
|
286
|
+
var r = Number(t);
|
|
287
|
+
return { month: isNaN(r) ? e : r };
|
|
288
288
|
},
|
|
289
289
|
minLength: 2,
|
|
290
290
|
maxLength: 2,
|
|
291
291
|
type: "number"
|
|
292
292
|
},
|
|
293
293
|
"%Y": {
|
|
294
|
-
format: function(
|
|
295
|
-
return
|
|
294
|
+
format: function(t) {
|
|
295
|
+
return n(t.year() || i.MIN_YEAR, 4);
|
|
296
296
|
},
|
|
297
|
-
parse: function(
|
|
298
|
-
var
|
|
299
|
-
return { year: isNaN(
|
|
297
|
+
parse: function(t) {
|
|
298
|
+
var r = Number(t);
|
|
299
|
+
return { year: isNaN(r) ? e : r };
|
|
300
300
|
},
|
|
301
301
|
minLength: 4,
|
|
302
302
|
maxLength: 4,
|
|
303
303
|
type: "number"
|
|
304
304
|
},
|
|
305
305
|
"%w": {
|
|
306
|
-
format: function(
|
|
307
|
-
return
|
|
306
|
+
format: function(t) {
|
|
307
|
+
return t.dayOfWeek() || i.MIN_DAY_OF_WEEK;
|
|
308
308
|
},
|
|
309
309
|
parse: function() {
|
|
310
310
|
return {};
|
|
@@ -314,9 +314,9 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
314
314
|
type: "number"
|
|
315
315
|
},
|
|
316
316
|
"%a": {
|
|
317
|
-
format: function(
|
|
318
|
-
var
|
|
319
|
-
return
|
|
317
|
+
format: function(t) {
|
|
318
|
+
var r = t.dayOfWeek();
|
|
319
|
+
return ct[r !== e ? r : i.MIN_DAY_OF_WEEK];
|
|
320
320
|
},
|
|
321
321
|
parse: function() {
|
|
322
322
|
return {};
|
|
@@ -326,9 +326,9 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
326
326
|
type: "word"
|
|
327
327
|
},
|
|
328
328
|
"%A": {
|
|
329
|
-
format: function(
|
|
330
|
-
var
|
|
331
|
-
return
|
|
329
|
+
format: function(t) {
|
|
330
|
+
var r = t.dayOfWeek();
|
|
331
|
+
return at[r !== e ? r : i.MIN_DAY_OF_WEEK];
|
|
332
332
|
},
|
|
333
333
|
parse: function() {
|
|
334
334
|
return {};
|
|
@@ -338,88 +338,88 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
338
338
|
type: "word"
|
|
339
339
|
},
|
|
340
340
|
"%b": {
|
|
341
|
-
format: function(
|
|
342
|
-
var
|
|
343
|
-
return
|
|
341
|
+
format: function(t) {
|
|
342
|
+
var r = i.options("monthFromZero") ? t.month() : t.month() - 1;
|
|
343
|
+
return dt[r !== e ? r : i.MIN_MONTH];
|
|
344
344
|
},
|
|
345
|
-
parse: function(
|
|
346
|
-
var
|
|
347
|
-
return { month:
|
|
345
|
+
parse: function(t) {
|
|
346
|
+
var r = i.monthNames().indexOf(t) + (i.options("monthFromZero") ? 0 : 1);
|
|
347
|
+
return { month: r !== -1 ? r : e };
|
|
348
348
|
},
|
|
349
349
|
minLength: 1,
|
|
350
350
|
maxLength: 999,
|
|
351
351
|
type: "word"
|
|
352
352
|
},
|
|
353
353
|
"%B": {
|
|
354
|
-
format: function(
|
|
355
|
-
var
|
|
356
|
-
return
|
|
354
|
+
format: function(t) {
|
|
355
|
+
var r = i.options("monthFromZero") ? t.month() : t.month() - 1;
|
|
356
|
+
return F[r !== e ? r : i.MIN_MONTH];
|
|
357
357
|
},
|
|
358
|
-
parse: function(
|
|
359
|
-
var
|
|
360
|
-
return { month:
|
|
358
|
+
parse: function(t) {
|
|
359
|
+
var r = i.monthNames(!0).indexOf(t) + (i.options("monthFromZero") ? 0 : 1);
|
|
360
|
+
return { month: r !== -1 ? r : e };
|
|
361
361
|
},
|
|
362
362
|
minLength: 1,
|
|
363
363
|
maxLength: 999,
|
|
364
364
|
type: "word"
|
|
365
365
|
},
|
|
366
366
|
"%H": {
|
|
367
|
-
format: function(
|
|
368
|
-
return
|
|
367
|
+
format: function(t) {
|
|
368
|
+
return n(t.hours() || i.MIN_HOURS, 2);
|
|
369
369
|
},
|
|
370
|
-
parse: function(
|
|
371
|
-
var
|
|
372
|
-
return { hours: isNaN(
|
|
370
|
+
parse: function(t) {
|
|
371
|
+
var r = Number(t);
|
|
372
|
+
return { hours: isNaN(r) ? e : r };
|
|
373
373
|
},
|
|
374
374
|
minLength: 2,
|
|
375
375
|
maxLength: 2,
|
|
376
376
|
type: "number"
|
|
377
377
|
},
|
|
378
378
|
"%M": {
|
|
379
|
-
format: function(
|
|
380
|
-
return
|
|
379
|
+
format: function(t) {
|
|
380
|
+
return n(t.minutes() || i.MIN_MINUTES, 2);
|
|
381
381
|
},
|
|
382
|
-
parse: function(
|
|
383
|
-
var
|
|
384
|
-
return { minutes: isNaN(
|
|
382
|
+
parse: function(t) {
|
|
383
|
+
var r = Number(t);
|
|
384
|
+
return { minutes: isNaN(r) ? e : r };
|
|
385
385
|
},
|
|
386
386
|
minLength: 2,
|
|
387
387
|
maxLength: 2,
|
|
388
388
|
type: "number"
|
|
389
389
|
},
|
|
390
390
|
"%S": {
|
|
391
|
-
format: function(
|
|
392
|
-
return
|
|
391
|
+
format: function(t) {
|
|
392
|
+
return n(t.seconds() || i.MIN_SECONDS, 2);
|
|
393
393
|
},
|
|
394
|
-
parse: function(
|
|
395
|
-
var
|
|
396
|
-
return { seconds: isNaN(
|
|
394
|
+
parse: function(t) {
|
|
395
|
+
var r = Number(t);
|
|
396
|
+
return { seconds: isNaN(r) ? e : r };
|
|
397
397
|
},
|
|
398
398
|
minLength: 2,
|
|
399
399
|
maxLength: 2,
|
|
400
400
|
type: "number"
|
|
401
401
|
},
|
|
402
402
|
"%s": {
|
|
403
|
-
format: function(
|
|
404
|
-
return
|
|
403
|
+
format: function(t) {
|
|
404
|
+
return t.timestamp();
|
|
405
405
|
},
|
|
406
|
-
parse: function(
|
|
407
|
-
return isNaN(Number(
|
|
406
|
+
parse: function(t) {
|
|
407
|
+
return isNaN(Number(t)) ? {} : i(Number(t)).get();
|
|
408
408
|
},
|
|
409
409
|
minLength: 1,
|
|
410
410
|
maxLength: 20,
|
|
411
411
|
type: "number"
|
|
412
412
|
},
|
|
413
413
|
"%F": {
|
|
414
|
-
format: function(
|
|
415
|
-
return
|
|
414
|
+
format: function(t) {
|
|
415
|
+
return n(t.year() || i.MIN_YEAR, 4) + "-" + n(t.month() || i.MIN_MONTH, 2) + "-" + n(t.day() || i.MIN_DAY, 2);
|
|
416
416
|
},
|
|
417
|
-
parse: function(
|
|
418
|
-
var
|
|
417
|
+
parse: function(t) {
|
|
418
|
+
var r = Number(t.slice(0, 4)), h = Number(t.slice(5, 7)), c = Number(t.slice(8, 10));
|
|
419
419
|
return {
|
|
420
|
-
year:
|
|
421
|
-
month:
|
|
422
|
-
day:
|
|
420
|
+
year: r,
|
|
421
|
+
month: h,
|
|
422
|
+
day: c
|
|
423
423
|
};
|
|
424
424
|
},
|
|
425
425
|
minLength: 10,
|
|
@@ -427,26 +427,26 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
427
427
|
type: "string"
|
|
428
428
|
},
|
|
429
429
|
"%D": {
|
|
430
|
-
format: function(
|
|
431
|
-
return
|
|
430
|
+
format: function(t) {
|
|
431
|
+
return n(t.month() || i.MIN_MONTH, 2) + "/" + n(t.day() || i.MIN_DAY, 2) + "/" + n(t.year() || i.MIN_YEAR, 4);
|
|
432
432
|
},
|
|
433
|
-
parse: function(
|
|
434
|
-
var
|
|
433
|
+
parse: function(t) {
|
|
434
|
+
var r = Number(t.slice(0, 2)), h = Number(t.slice(3, 5)), c = Number(t.slice(6, 10));
|
|
435
435
|
return {
|
|
436
|
-
year:
|
|
437
|
-
month:
|
|
438
|
-
day:
|
|
436
|
+
year: c,
|
|
437
|
+
month: r,
|
|
438
|
+
day: h
|
|
439
439
|
};
|
|
440
440
|
},
|
|
441
441
|
minLength: 10,
|
|
442
442
|
maxLength: 10,
|
|
443
443
|
type: "string"
|
|
444
444
|
}
|
|
445
|
-
},
|
|
445
|
+
}, Mt = {
|
|
446
446
|
useMilliseconds: !1,
|
|
447
447
|
monthFromZero: !1
|
|
448
|
-
},
|
|
449
|
-
|
|
448
|
+
}, g;
|
|
449
|
+
g = function(t, r, h) {
|
|
450
450
|
return this._d = /* @__PURE__ */ new Date(), this._i = {
|
|
451
451
|
year: !1,
|
|
452
452
|
month: !1,
|
|
@@ -455,56 +455,56 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
455
455
|
minutes: !1,
|
|
456
456
|
seconds: !1,
|
|
457
457
|
milliseconds: !1
|
|
458
|
-
},
|
|
459
|
-
},
|
|
460
|
-
var
|
|
461
|
-
return this.leapYear() &&
|
|
462
|
-
},
|
|
458
|
+
}, t !== e && this.set(t, r, h), this;
|
|
459
|
+
}, g.fn = g.prototype, g.fn.dayCount = function() {
|
|
460
|
+
var t = this.month(), r = i.MAX_DAY_IN_MONTHS[t - (i.options("monthFromZero") ? 0 : 1)];
|
|
461
|
+
return this.leapYear() && t === (i.options("monthFromZero") ? 1 : 2) && (r += 1), r;
|
|
462
|
+
}, g.fn.year = function(t) {
|
|
463
463
|
if (arguments.length !== 0)
|
|
464
|
-
(typeof
|
|
464
|
+
(typeof t == "number" || typeof t == "string") && !isNaN(Number(t)) ? Number(t) >= i.MIN_YEAR && Number(t) <= i.MAX_YEAR ? (this._d.setFullYear(Number(t)), this._i.year = !1) : this._i.year = Number(t) : (this._d.setFullYear(i.MIN_YEAR), this._i.year = !1);
|
|
465
465
|
else
|
|
466
466
|
return this._i.year === !1 ? this._d.getFullYear() : this._i.year;
|
|
467
467
|
return this;
|
|
468
|
-
},
|
|
468
|
+
}, g.fn.month = function(t) {
|
|
469
469
|
if (arguments.length !== 0)
|
|
470
|
-
(typeof
|
|
470
|
+
(typeof t == "number" || typeof t == "string") && !isNaN(Number(t)) ? Number(t) >= i.MIN_MONTH && Number(t) <= i.MAX_MONTH ? (this._d.setMonth(i.options("monthFromZero") ? Number(t) : Number(t) - 1), this._i.month = !1) : this._i.month = Number(t) : (this._d.setMonth(i.options("monthFromZero") ? i.MIN_MONTH : i.MIN_MONTH - 1), this._i.month = !1);
|
|
471
471
|
else
|
|
472
472
|
return this._i.month === !1 ? i.options("monthFromZero") ? this._d.getMonth() : this._d.getMonth() + 1 : this._i.month;
|
|
473
473
|
return this;
|
|
474
|
-
},
|
|
474
|
+
}, g.fn.day = function(t) {
|
|
475
475
|
if (arguments.length !== 0)
|
|
476
|
-
(typeof
|
|
476
|
+
(typeof t == "number" || typeof t == "string") && !isNaN(Number(t)) ? Number(t) >= i.MIN_DAY && Number(t) <= this.dayCount() ? (this._d.setDate(Number(t)), this._i.day = !1) : this._i.day = Number(t) : (this._d.setDate(i.MIN_DAY), this._i.day = !1);
|
|
477
477
|
else
|
|
478
478
|
return this._i.day === !1 ? this._d.getDate() : this._i.day;
|
|
479
479
|
return this;
|
|
480
|
-
},
|
|
480
|
+
}, g.fn.hours = function(t) {
|
|
481
481
|
if (arguments.length !== 0)
|
|
482
|
-
(typeof
|
|
482
|
+
(typeof t == "number" || typeof t == "string") && !isNaN(Number(t)) ? Number(t) >= i.MIN_HOURS && Number(t) <= i.MAX_HOURS ? (this._d.setHours(Number(t)), this._i.hours = !1) : this._i.hours = Number(t) : (this._d.setHours(i.MIN_HOURS), this._i.hours = !1);
|
|
483
483
|
else
|
|
484
484
|
return this._i.hours === !1 ? this._d.getHours() : this._i.hours;
|
|
485
485
|
return this;
|
|
486
|
-
},
|
|
486
|
+
}, g.fn.minutes = function(t) {
|
|
487
487
|
if (arguments.length !== 0)
|
|
488
|
-
(typeof
|
|
488
|
+
(typeof t == "number" || typeof t == "string") && !isNaN(Number(t)) ? Number(t) >= i.MIN_MINUTES && Number(t) <= i.MAX_MINUTES ? (this._d.setMinutes(Number(t)), this._i.minutes = !1) : this._i.minutes = Number(t) : (this._d.setMinutes(i.MIN_MINUTES), this._i.minutes = !1);
|
|
489
489
|
else
|
|
490
490
|
return this._i.minutes === !1 ? this._d.getMinutes() : this._i.minutes;
|
|
491
491
|
return this;
|
|
492
|
-
},
|
|
492
|
+
}, g.fn.seconds = function(t) {
|
|
493
493
|
if (arguments.length !== 0)
|
|
494
|
-
(typeof
|
|
494
|
+
(typeof t == "number" || typeof t == "string") && !isNaN(Number(t)) ? Number(t) >= i.MIN_SECONDS && Number(t) <= i.MAX_SECONDS ? (this._d.setSeconds(Number(t)), this._i.seconds = !1) : this._i.seconds = Number(t) : (this._d.setSeconds(i.MIN_SECONDS), this._i.seconds = !1);
|
|
495
495
|
else
|
|
496
496
|
return this._i.seconds === !1 ? this._d.getSeconds() : this._i.seconds;
|
|
497
497
|
return this;
|
|
498
|
-
},
|
|
498
|
+
}, g.fn.milliseconds = function(t) {
|
|
499
499
|
if (arguments.length !== 0)
|
|
500
|
-
(typeof
|
|
500
|
+
(typeof t == "number" || typeof t == "string") && !isNaN(Number(t)) ? Number(t) >= i.MIN_MILLISECONDS && Number(t) <= i.MAX_MILLISECONDS ? (this._d.setMilliseconds(Number(t)), this._i.milliseconds = !1) : this._i.milliseconds = Number(t) : (this._d.setMilliseconds(i.MIN_MILLISECONDS), this._i.milliseconds = !1);
|
|
501
501
|
else
|
|
502
502
|
return this._i.milliseconds === !1 ? this._d.getMilliseconds() : this._i.milliseconds;
|
|
503
503
|
return this;
|
|
504
|
-
},
|
|
505
|
-
var
|
|
506
|
-
return Math.ceil(((
|
|
507
|
-
},
|
|
504
|
+
}, g.fn.week = function() {
|
|
505
|
+
var t = new Date(this.year(), 0, 1), r = i(this.utc()).hours(0).minutes(0).seconds(0).milliseconds(0).utc() * 1e3;
|
|
506
|
+
return Math.ceil(((r - t.getTime()) / 864e5 + t.getDay() + 1) / 7);
|
|
507
|
+
}, g.fn.set = function(t, r, h) {
|
|
508
508
|
if (this._i = {
|
|
509
509
|
year: !1,
|
|
510
510
|
month: !1,
|
|
@@ -513,16 +513,16 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
513
513
|
minutes: !1,
|
|
514
514
|
seconds: !1,
|
|
515
515
|
milliseconds: !1
|
|
516
|
-
},
|
|
516
|
+
}, t === e)
|
|
517
517
|
return this._d = /* @__PURE__ */ new Date(), this;
|
|
518
|
-
if (
|
|
519
|
-
return this._d =
|
|
520
|
-
if (typeof
|
|
521
|
-
return this._d = new Date(
|
|
522
|
-
if (typeof
|
|
523
|
-
var
|
|
524
|
-
if (
|
|
525
|
-
return
|
|
518
|
+
if (t instanceof Date)
|
|
519
|
+
return this._d = t, this;
|
|
520
|
+
if (typeof t == "number")
|
|
521
|
+
return this._d = new Date(t * (i.options("useMilliseconds") ? 1 : 1e3)), this;
|
|
522
|
+
if (typeof t == "object" && (t instanceof Array ? (this.day(i.MIN_DAY), this.year(t[0]), this.month(t[1]), this.day(t[2]), this.hours(t[3]), this.minutes(t[4]), this.seconds(t[5]), this.milliseconds(t[6])) : (this.day(i.MIN_DAY), this.year(t.year), this.month(t.month), this.day(t.day), this.hours(t.hours), this.minutes(t.minutes), this.seconds(t.seconds), this.milliseconds(t.milliseconds))), typeof t == "string") {
|
|
523
|
+
var c, M = [], T, R, j = [], D = 0, H = 0, L, w, p = {}, b;
|
|
524
|
+
if (t === e)
|
|
525
|
+
return T = l(this, h), T === e && (this._i = {
|
|
526
526
|
year: -1,
|
|
527
527
|
month: -1,
|
|
528
528
|
day: -1,
|
|
@@ -530,26 +530,26 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
530
530
|
minutes: -1,
|
|
531
531
|
seconds: -1,
|
|
532
532
|
milliseconds: -1
|
|
533
|
-
}),
|
|
534
|
-
for (
|
|
535
|
-
if (
|
|
536
|
-
if (
|
|
537
|
-
switch (
|
|
533
|
+
}), T;
|
|
534
|
+
for (r === e && (r = i.detectFormat(t)); D < r.length; ) {
|
|
535
|
+
if (r.charAt(D) === "%") {
|
|
536
|
+
if (R = r.charAt(D) + r.charAt(D + 1), U[R] !== e) {
|
|
537
|
+
switch (L = 0, w = "", U[R].type) {
|
|
538
538
|
case "number":
|
|
539
|
-
for (;
|
|
540
|
-
w +=
|
|
539
|
+
for (; L < U[R].maxLength && H + L < t.length && !isNaN(Number(t.charAt(H + L))); )
|
|
540
|
+
w += t.charAt(H + L), L += 1;
|
|
541
541
|
break;
|
|
542
542
|
case "word":
|
|
543
|
-
for (;
|
|
544
|
-
w +=
|
|
543
|
+
for (; L < U[R].maxLength && H + L < t.length && /^[\u00BF-\u1FFF\u2C00-\uD7FF\w]+$/.test(t.charAt(H + L)); )
|
|
544
|
+
w += t.charAt(H + L), L += 1;
|
|
545
545
|
break;
|
|
546
546
|
case "string":
|
|
547
|
-
for (;
|
|
548
|
-
w +=
|
|
547
|
+
for (; L < U[R].maxLength && H + L < t.length; )
|
|
548
|
+
w += t.charAt(H + L), L += 1;
|
|
549
549
|
break;
|
|
550
550
|
}
|
|
551
|
-
if (
|
|
552
|
-
return
|
|
551
|
+
if (L < U[R].minLength)
|
|
552
|
+
return T = l(this, h), T === e && (this._i = {
|
|
553
553
|
year: -1,
|
|
554
554
|
month: -1,
|
|
555
555
|
day: -1,
|
|
@@ -557,11 +557,11 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
557
557
|
minutes: -1,
|
|
558
558
|
seconds: -1,
|
|
559
559
|
milliseconds: -1
|
|
560
|
-
}),
|
|
561
|
-
|
|
560
|
+
}), T;
|
|
561
|
+
M.push(R), j.push(w), L -= 1, H += L, D += 1;
|
|
562
562
|
}
|
|
563
|
-
} else if (
|
|
564
|
-
return
|
|
563
|
+
} else if (t.charAt(H) !== r.charAt(D))
|
|
564
|
+
return T = l(this, h), T === e && (this._i = {
|
|
565
565
|
year: -1,
|
|
566
566
|
month: -1,
|
|
567
567
|
day: -1,
|
|
@@ -569,51 +569,51 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
569
569
|
minutes: -1,
|
|
570
570
|
seconds: -1,
|
|
571
571
|
milliseconds: -1
|
|
572
|
-
}),
|
|
573
|
-
|
|
572
|
+
}), T;
|
|
573
|
+
D += 1, H += 1;
|
|
574
574
|
}
|
|
575
|
-
for (
|
|
576
|
-
|
|
577
|
-
year:
|
|
578
|
-
month:
|
|
579
|
-
day:
|
|
580
|
-
hours:
|
|
581
|
-
minutes:
|
|
582
|
-
seconds:
|
|
575
|
+
for (c in M)
|
|
576
|
+
M.hasOwnProperty(c) && U.hasOwnProperty(M[c]) && (b = U[M[c]].parse(j[c]), p = {
|
|
577
|
+
year: b.year !== e ? b.year : p.year,
|
|
578
|
+
month: b.month !== e ? b.month : p.month,
|
|
579
|
+
day: b.day !== e ? b.day : p.day,
|
|
580
|
+
hours: b.hours !== e ? b.hours : p.hours,
|
|
581
|
+
minutes: b.minutes !== e ? b.minutes : p.minutes,
|
|
582
|
+
seconds: b.seconds !== e ? b.seconds : p.seconds
|
|
583
583
|
});
|
|
584
|
-
this.day(i.MIN_DAY), this.year(
|
|
584
|
+
this.day(i.MIN_DAY), this.year(p.year), this.month(p.month), this.day(p.day), this.hours(p.hours), this.minutes(p.minutes), this.seconds(p.seconds), this.milliseconds(p.milliseconds);
|
|
585
585
|
}
|
|
586
586
|
return this;
|
|
587
|
-
},
|
|
588
|
-
var
|
|
589
|
-
return
|
|
590
|
-
},
|
|
591
|
-
return arguments.length !== 0 ? (this._d = new Date(Number(
|
|
592
|
-
},
|
|
593
|
-
return arguments.length !== 0 ? (this._d = new Date(Number(
|
|
594
|
-
},
|
|
595
|
-
if (
|
|
596
|
-
return
|
|
597
|
-
if (
|
|
598
|
-
return
|
|
599
|
-
if (
|
|
587
|
+
}, g.fn.leapYear = function() {
|
|
588
|
+
var t = this.year();
|
|
589
|
+
return t % 4 === 0 ? t % 100 === 0 ? t % 400 === 0 : !0 : !1;
|
|
590
|
+
}, g.fn.timestamp = function(t) {
|
|
591
|
+
return arguments.length !== 0 ? (this._d = new Date(Number(t) * (i.options("useMilliseconds") ? 1 : 1e3) + this._d.getTimezoneOffset() * 6e4), this) : i.options("useMilliseconds") ? this._d.getTime() - this._d.getTimezoneOffset() * 6e4 : Math.floor(this._d.getTime() / 1e3) - this._d.getTimezoneOffset() * 60;
|
|
592
|
+
}, g.fn.utc = function(t) {
|
|
593
|
+
return arguments.length !== 0 ? (this._d = new Date(Number(t) * (i.options("useMilliseconds") ? 1 : 1e3)), this) : i.options("useMilliseconds") ? this._d.getTime() : Math.floor(this._d.getTime() / 1e3);
|
|
594
|
+
}, g.fn.dayOfWeek = function(t) {
|
|
595
|
+
if (t === "long")
|
|
596
|
+
return at[this._d.getDay()];
|
|
597
|
+
if (t === "short")
|
|
598
|
+
return ct[this._d.getDay()];
|
|
599
|
+
if (t === e)
|
|
600
600
|
return this._d.getDay();
|
|
601
|
-
if (
|
|
601
|
+
if (t === 0 || t === "Sunday")
|
|
602
602
|
return this.calc({ day: -this.dayOfWeek() });
|
|
603
|
-
if (
|
|
603
|
+
if (t === 1 || t === "Monday")
|
|
604
604
|
return this.calc({ day: (this.dayOfWeek() === 0 ? -6 : 1) - this.dayOfWeek() });
|
|
605
|
-
if (
|
|
605
|
+
if (t === 2 || t === "Tuesday")
|
|
606
606
|
return this.calc({ day: (this.dayOfWeek() === 0 ? -5 : 2) - this.dayOfWeek() });
|
|
607
|
-
if (
|
|
607
|
+
if (t === 3 || t === "Wednesday")
|
|
608
608
|
return this.calc({ day: (this.dayOfWeek() === 0 ? -4 : 3) - this.dayOfWeek() });
|
|
609
|
-
if (
|
|
609
|
+
if (t === 4 || t === "Thursday")
|
|
610
610
|
return this.calc({ day: (this.dayOfWeek() === 0 ? -3 : 4) - this.dayOfWeek() });
|
|
611
|
-
if (
|
|
611
|
+
if (t === 5 || t === "Friday")
|
|
612
612
|
return this.calc({ day: (this.dayOfWeek() === 0 ? -2 : 5) - this.dayOfWeek() });
|
|
613
|
-
if (
|
|
613
|
+
if (t === 6 || t === "Saturday")
|
|
614
614
|
return this.calc({ day: (this.dayOfWeek() === 0 ? -1 : 6) - this.dayOfWeek() });
|
|
615
|
-
},
|
|
616
|
-
switch (
|
|
615
|
+
}, g.fn.timezone = function(t) {
|
|
616
|
+
switch (t) {
|
|
617
617
|
case "hours":
|
|
618
618
|
return Math.floor(this._d.getTimezoneOffset() / 60);
|
|
619
619
|
case "minutes":
|
|
@@ -621,8 +621,8 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
621
621
|
default:
|
|
622
622
|
return this._d.getTimezoneOffset() * 60;
|
|
623
623
|
}
|
|
624
|
-
},
|
|
625
|
-
switch (
|
|
624
|
+
}, g.fn.get = function(t) {
|
|
625
|
+
switch (t) {
|
|
626
626
|
case "Date":
|
|
627
627
|
return new Date(
|
|
628
628
|
this.year(),
|
|
@@ -670,500 +670,444 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
670
670
|
timestamp: this.timestamp()
|
|
671
671
|
};
|
|
672
672
|
}
|
|
673
|
-
},
|
|
674
|
-
for (var
|
|
675
|
-
|
|
676
|
-
return
|
|
677
|
-
},
|
|
673
|
+
}, g.fn.format = function(t) {
|
|
674
|
+
for (var r = 0, h = "", c; r < t.length; )
|
|
675
|
+
t.charAt(r) === "%" ? (c = t.charAt(r) + t.charAt(r + 1), U[c] !== e ? (h += U[c].format(this), r += 1) : h += "%") : h += t.charAt(r), r += 1;
|
|
676
|
+
return h;
|
|
677
|
+
}, g.fn.valid = function() {
|
|
678
678
|
return this._i.year === !1 && this._i.month === !1 && this._i.day === !1 && this._i.hours === !1 && this._i.minutes === !1 && this._i.seconds === !1 && this._i.milliseconds === !1;
|
|
679
|
-
},
|
|
679
|
+
}, g.fn.errors = function() {
|
|
680
680
|
return this._i;
|
|
681
|
-
},
|
|
682
|
-
var
|
|
683
|
-
switch (
|
|
681
|
+
}, g.fn.between = function(t, r) {
|
|
682
|
+
var h = this.timestamp(), c = t.timestamp();
|
|
683
|
+
switch (r) {
|
|
684
684
|
case "year":
|
|
685
|
-
return Math.floor((
|
|
685
|
+
return Math.floor((c - h) / 31556952);
|
|
686
686
|
case "month":
|
|
687
|
-
return Math.floor((
|
|
687
|
+
return Math.floor((c - h) / 2629746);
|
|
688
688
|
case "day":
|
|
689
|
-
return Math.floor((
|
|
689
|
+
return Math.floor((c - h) / 86400);
|
|
690
690
|
case "hours":
|
|
691
|
-
return Math.floor((
|
|
691
|
+
return Math.floor((c - h) / 3600);
|
|
692
692
|
case "minutes":
|
|
693
|
-
return Math.floor((
|
|
693
|
+
return Math.floor((c - h) / 60);
|
|
694
694
|
case "seconds":
|
|
695
|
-
return
|
|
695
|
+
return c - h;
|
|
696
696
|
default:
|
|
697
|
-
return
|
|
697
|
+
return e;
|
|
698
698
|
}
|
|
699
|
-
},
|
|
700
|
-
return
|
|
701
|
-
}, i = function(
|
|
702
|
-
return new
|
|
703
|
-
}, i.MIN_YEAR = 1e3, i.MAX_YEAR = 3e3, i.MIN_MONTH = 1, i.MAX_MONTH = 12, i.MIN_DAY = 1, i.MAX_DAY_IN_MONTHS = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], i.MIN_DAY_OF_WEEK = 0, i.MAX_DAY_OF_WEEK = 6, i.MIN_HOURS = 0, i.MAX_HOURS = 23, i.MIN_MINUTES = 0, i.MAX_MINUTES = 59, i.MIN_SECONDS = 0, i.MAX_SECONDS = 59, i.MIN_MILLISECONDS = 0, i.MAX_MILLISECONDS = 999, i.VERSION = "0.2.18", i.options = function(
|
|
704
|
-
if (
|
|
705
|
-
return
|
|
706
|
-
if (
|
|
707
|
-
if (
|
|
708
|
-
return
|
|
709
|
-
|
|
699
|
+
}, g.fn.calc = function(t) {
|
|
700
|
+
return t.year !== e && this._d.setFullYear(this._d.getFullYear() + t.year), t.month !== e && this._d.setMonth(this._d.getMonth() + t.month), t.day !== e && this._d.setDate(this._d.getDate() + t.day), t.hours !== e && this._d.setHours(this._d.getHours() + t.hours), t.minutes !== e && this._d.setMinutes(this._d.getMinutes() + t.minutes), t.seconds !== e && this._d.setSeconds(this._d.getSeconds() + t.seconds), t.milliseconds !== e && this._d.setMilliseconds(this._d.getMilliseconds() + t.milliseconds), this;
|
|
701
|
+
}, i = function(t, r, h) {
|
|
702
|
+
return new g(t, r, h);
|
|
703
|
+
}, i.MIN_YEAR = 1e3, i.MAX_YEAR = 3e3, i.MIN_MONTH = 1, i.MAX_MONTH = 12, i.MIN_DAY = 1, i.MAX_DAY_IN_MONTHS = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], i.MIN_DAY_OF_WEEK = 0, i.MAX_DAY_OF_WEEK = 6, i.MIN_HOURS = 0, i.MAX_HOURS = 23, i.MIN_MINUTES = 0, i.MAX_MINUTES = 59, i.MIN_SECONDS = 0, i.MAX_SECONDS = 59, i.MIN_MILLISECONDS = 0, i.MAX_MILLISECONDS = 999, i.VERSION = "0.2.18", i.options = function(t, r) {
|
|
704
|
+
if (t === e)
|
|
705
|
+
return Mt;
|
|
706
|
+
if (Mt.hasOwnProperty(t)) {
|
|
707
|
+
if (r === e)
|
|
708
|
+
return Mt[t];
|
|
709
|
+
Mt[t] = r, t === "monthFromZero" && (i.MIN_MONTH = r ? 0 : 1, i.MAX_MONTH = r ? 11 : 12);
|
|
710
710
|
}
|
|
711
|
-
return
|
|
711
|
+
return e;
|
|
712
712
|
}, i.noConflict = function() {
|
|
713
|
-
return
|
|
714
|
-
}, i.generate = function(
|
|
715
|
-
var
|
|
716
|
-
if (typeof
|
|
713
|
+
return o.tempus = f, i;
|
|
714
|
+
}, i.generate = function(t) {
|
|
715
|
+
var r, h, c, M, T, R, j, D;
|
|
716
|
+
if (typeof t.dateFrom != "number" && (t.dateFrom instanceof g ? r = t.dateFrom.utc() : r = i(t.dateFrom, t.formatFrom).utc()), typeof t.dateTo != "number" && (t.dateTo instanceof g ? h = t.dateTo.utc() : h = i(t.dateTo, t.formatTo !== e ? t.formatTo : t.formatFrom).utc()), typeof t.period == "number" ? T = {
|
|
717
717
|
year: 0,
|
|
718
718
|
month: 0,
|
|
719
719
|
day: 0,
|
|
720
720
|
hours: 0,
|
|
721
721
|
minutes: 0,
|
|
722
|
-
seconds:
|
|
723
|
-
} : typeof
|
|
724
|
-
year:
|
|
725
|
-
month:
|
|
726
|
-
day:
|
|
727
|
-
hours:
|
|
728
|
-
minutes:
|
|
729
|
-
seconds:
|
|
730
|
-
} : typeof
|
|
731
|
-
year:
|
|
732
|
-
month:
|
|
733
|
-
day:
|
|
734
|
-
hours:
|
|
735
|
-
minutes:
|
|
736
|
-
seconds:
|
|
737
|
-
}),
|
|
738
|
-
return
|
|
739
|
-
},
|
|
740
|
-
var
|
|
741
|
-
year:
|
|
742
|
-
month:
|
|
743
|
-
day:
|
|
744
|
-
hours:
|
|
745
|
-
minutes:
|
|
746
|
-
seconds:
|
|
747
|
-
milliseconds:
|
|
722
|
+
seconds: t.period
|
|
723
|
+
} : typeof t.period == "string" ? T = {
|
|
724
|
+
year: t.period === "year" ? 1 : 0,
|
|
725
|
+
month: t.period === "month" ? 1 : 0,
|
|
726
|
+
day: t.period === "day" ? 1 : 0,
|
|
727
|
+
hours: t.period === "hours" ? 1 : 0,
|
|
728
|
+
minutes: t.period === "minutes" ? 1 : 0,
|
|
729
|
+
seconds: t.period === "seconds" ? 1 : 0
|
|
730
|
+
} : typeof t.period == "object" && (T = {
|
|
731
|
+
year: t.period.year !== e ? t.period.year : 0,
|
|
732
|
+
month: t.period.month !== e ? t.period.month : 0,
|
|
733
|
+
day: t.period.day !== e ? t.period.day : 0,
|
|
734
|
+
hours: t.period.hours !== e ? t.period.hours : 0,
|
|
735
|
+
minutes: t.period.minutes !== e ? t.period.minutes : 0,
|
|
736
|
+
seconds: t.period.seconds !== e ? t.period.seconds : 0
|
|
737
|
+
}), t.groupBy === e ? R = t.asObject === !0 ? {} : [] : (R = [], R.push([]), j = i(r).get()[t.groupBy]), D = function(w, p, b) {
|
|
738
|
+
return t.asObject === !0 ? t.format !== e ? w[i(p).format(t.format)] = {} : w[i(p).format("%F %H:%M:%S")] = {} : t.format !== e ? w.push(b ? null : i(p).format(t.format)) : w.push(b ? null : i(p)), w;
|
|
739
|
+
}, t.groupBy !== e && t.fillNulls) {
|
|
740
|
+
var H = {
|
|
741
|
+
year: T.year ? -T.year : e,
|
|
742
|
+
month: T.month ? -T.month : e,
|
|
743
|
+
day: T.day ? -T.day : e,
|
|
744
|
+
hours: T.hours ? -T.hours : e,
|
|
745
|
+
minutes: T.minutes ? -T.minutes : e,
|
|
746
|
+
seconds: T.seconds ? -T.seconds : e,
|
|
747
|
+
milliseconds: T.milliseconds ? -T.milliseconds : e
|
|
748
748
|
};
|
|
749
|
-
for (
|
|
750
|
-
|
|
751
|
-
if (
|
|
752
|
-
var
|
|
753
|
-
for (
|
|
754
|
-
|
|
749
|
+
for (c = i(r).calc(H).utc(); i(c).get()[t.groupBy] === j; )
|
|
750
|
+
D(R[R.length - 1], c, !0), c = i(c).calc(H).utc();
|
|
751
|
+
if (t.groupBy === "week") {
|
|
752
|
+
var L = i(r).dayOfWeek();
|
|
753
|
+
for (c = i(r).dayOfWeek(0).utc(); R[0].length < L && c < r; )
|
|
754
|
+
D(R[R.length - 1], c, !0), c = i(c).calc(T).utc();
|
|
755
755
|
}
|
|
756
756
|
}
|
|
757
|
-
for (;
|
|
758
|
-
|
|
759
|
-
if (
|
|
760
|
-
for (
|
|
761
|
-
|
|
762
|
-
return
|
|
763
|
-
}, i.monthNames = function(
|
|
764
|
-
switch (
|
|
757
|
+
for (; r <= h; )
|
|
758
|
+
t.groupBy === e ? D(R, r) : i(r).get()[t.groupBy] === j ? D(R[R.length - 1], r) : (R.push([]), D(R[R.length - 1], r), j = i(r).get()[t.groupBy]), r = i(r).calc(T).utc();
|
|
759
|
+
if (t.groupBy !== e && t.fillNulls)
|
|
760
|
+
for (M = i(h).calc(T).utc(); i(M).get()[t.groupBy] === j; )
|
|
761
|
+
D(R[R.length - 1], M, !0), M = i(M).calc(T).utc();
|
|
762
|
+
return R;
|
|
763
|
+
}, i.monthNames = function(t) {
|
|
764
|
+
switch (t) {
|
|
765
765
|
case "long":
|
|
766
|
-
return
|
|
766
|
+
return F;
|
|
767
767
|
default:
|
|
768
|
-
return
|
|
768
|
+
return dt;
|
|
769
769
|
}
|
|
770
|
-
}, i.dayNames = function(
|
|
771
|
-
switch (
|
|
770
|
+
}, i.dayNames = function(t) {
|
|
771
|
+
switch (t) {
|
|
772
772
|
case "long":
|
|
773
|
-
return
|
|
773
|
+
return at;
|
|
774
774
|
default:
|
|
775
|
-
return
|
|
775
|
+
return ct;
|
|
776
776
|
}
|
|
777
|
-
}, i.lang = function(
|
|
778
|
-
if (
|
|
779
|
-
m =
|
|
777
|
+
}, i.lang = function(t) {
|
|
778
|
+
if (t !== e)
|
|
779
|
+
m = t, N[m] === e && (m = "en"), F = B(), dt = ht(), at = Z(), ct = W();
|
|
780
780
|
else
|
|
781
781
|
return m;
|
|
782
|
-
return
|
|
782
|
+
return e;
|
|
783
783
|
}, i.availableLangs = function() {
|
|
784
|
-
return Object.keys(
|
|
785
|
-
}, i.registerFormat = function(
|
|
786
|
-
|
|
787
|
-
format:
|
|
788
|
-
parse:
|
|
789
|
-
minLength:
|
|
790
|
-
maxLength:
|
|
791
|
-
type:
|
|
784
|
+
return Object.keys(N);
|
|
785
|
+
}, i.registerFormat = function(t, r, h, c, M, T) {
|
|
786
|
+
U[t] = {
|
|
787
|
+
format: r,
|
|
788
|
+
parse: h,
|
|
789
|
+
minLength: c,
|
|
790
|
+
maxLength: M,
|
|
791
|
+
type: T
|
|
792
792
|
};
|
|
793
|
-
}, i.unregisterFormat = function(
|
|
794
|
-
delete
|
|
795
|
-
}, i.detectFormat = function(
|
|
796
|
-
var
|
|
797
|
-
return
|
|
793
|
+
}, i.unregisterFormat = function(t) {
|
|
794
|
+
delete U[t];
|
|
795
|
+
}, i.detectFormat = function(t) {
|
|
796
|
+
var r, h, c;
|
|
797
|
+
return r = y(t, 0), r !== "" && (c = 10), h = t.charAt(c), (h === "T" || h === " ") && (r += h, c += 1), r += u(t, c), r;
|
|
798
798
|
}, S = {
|
|
799
|
-
TempusDate:
|
|
800
|
-
}, i.classes = function(
|
|
801
|
-
if (
|
|
802
|
-
return S[
|
|
803
|
-
S[
|
|
804
|
-
}, i.loadTranslations = function(
|
|
805
|
-
typeof
|
|
806
|
-
|
|
807
|
-
}, function(
|
|
799
|
+
TempusDate: g
|
|
800
|
+
}, i.classes = function(t, r) {
|
|
801
|
+
if (r === e)
|
|
802
|
+
return S[t];
|
|
803
|
+
S[t] = r;
|
|
804
|
+
}, i.loadTranslations = function(t) {
|
|
805
|
+
typeof t == "object" ? N = t : typeof t == "string" && le(t, function(r) {
|
|
806
|
+
N = r;
|
|
807
|
+
}, function(r) {
|
|
808
808
|
});
|
|
809
|
-
}, m = (
|
|
810
|
-
}).call(
|
|
811
|
-
})(
|
|
812
|
-
var
|
|
813
|
-
const
|
|
814
|
-
var
|
|
815
|
-
class
|
|
816
|
-
constructor(
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
809
|
+
}, m = (d.language || d.systemLanguage || d.userLanguage || "en").substr(0, 2).toLowerCase(), N[m] === e && (m = "en"), F = B(), dt = ht(), at = Z(), ct = W(), A.exports && (s = A.exports = i), s.tempus = i;
|
|
810
|
+
}).call(fe);
|
|
811
|
+
})(Xt, Xt.exports);
|
|
812
|
+
var _e = Xt.exports;
|
|
813
|
+
const jt = /* @__PURE__ */ Ne(_e);
|
|
814
|
+
var z, ut, K, Y, X, q, Q, I, x, Dt, v, P, $, tt, it, Lt, mt, kt, ft, xt, Nt, Vt, _t, Zt, Ot, zt, Ht, ee, Yt, se, yt, Kt, At, qt, Tt, Qt, nt, pt, St, vt, It, re, et, lt, ot, bt, gt, $t;
|
|
815
|
+
class k {
|
|
816
|
+
constructor(s, e = {}) {
|
|
817
|
+
_(this, it);
|
|
818
|
+
_(this, mt);
|
|
819
|
+
_(this, ft);
|
|
820
|
+
_(this, Nt);
|
|
821
|
+
_(this, _t);
|
|
822
|
+
_(this, Ot);
|
|
823
|
+
_(this, Ht);
|
|
824
|
+
_(this, Yt);
|
|
825
|
+
_(this, yt);
|
|
826
|
+
_(this, At);
|
|
827
|
+
_(this, Tt);
|
|
828
|
+
_(this, nt);
|
|
829
|
+
_(this, St);
|
|
830
|
+
_(this, It);
|
|
831
|
+
_(this, et);
|
|
832
|
+
_(this, ot);
|
|
833
|
+
_(this, gt);
|
|
834
|
+
_(this, z, null);
|
|
835
|
+
_(this, ut, null);
|
|
836
|
+
_(this, K, []);
|
|
837
|
+
_(this, Y, {});
|
|
838
|
+
_(this, X, 50);
|
|
839
|
+
_(this, q, !0);
|
|
840
|
+
_(this, Q, null);
|
|
841
|
+
_(this, I, null);
|
|
842
|
+
_(this, x, null);
|
|
843
|
+
_(this, Dt, 100);
|
|
844
|
+
_(this, v, "no");
|
|
845
|
+
_(this, P, !1);
|
|
846
|
+
_(this, $, !1);
|
|
847
|
+
_(this, tt, !1);
|
|
848
|
+
C(this, "errors", {});
|
|
849
|
+
C(this, "answerData", {});
|
|
850
|
+
E(this, z, s), E(this, ut, e);
|
|
851
851
|
}
|
|
852
852
|
get serial() {
|
|
853
|
-
return
|
|
853
|
+
return a(this, P);
|
|
854
854
|
}
|
|
855
855
|
setSerial() {
|
|
856
|
-
|
|
856
|
+
E(this, P, !0), E(this, $, !0), E(this, tt, !1);
|
|
857
857
|
}
|
|
858
858
|
setParallel() {
|
|
859
|
-
|
|
859
|
+
E(this, P, !1), E(this, $, !1), E(this, tt, !0);
|
|
860
860
|
}
|
|
861
861
|
stop() {
|
|
862
|
-
|
|
862
|
+
E(this, q, !1);
|
|
863
863
|
}
|
|
864
|
-
async batch(
|
|
865
|
-
|
|
866
|
-
const
|
|
867
|
-
if (Object.keys(
|
|
868
|
-
const
|
|
869
|
-
return Promise.allSettled(
|
|
870
|
-
let
|
|
871
|
-
for (let
|
|
872
|
-
|
|
873
|
-
return
|
|
864
|
+
async batch(s, e) {
|
|
865
|
+
a(this, x) && O(this, mt, kt).call(this), e && E(this, Q, e), a(this, $) === !1 && E(this, P, !1), Object.keys(s).length > 500 && E(this, P, !0), E(this, q, !0), E(this, K, []), E(this, Y, {}), this.errors = {}, this.answerData = {};
|
|
866
|
+
const o = O(this, Nt, Vt).call(this, s);
|
|
867
|
+
if (Object.keys(s).length < 500) {
|
|
868
|
+
const n = o.map((l, u) => O(this, _t, Zt).call(this, l, o[u]));
|
|
869
|
+
return Promise.allSettled(n).then((l) => {
|
|
870
|
+
let u = {};
|
|
871
|
+
for (let y of l)
|
|
872
|
+
y.status === "fulfilled" && (u = { ...u, ...y.value });
|
|
873
|
+
return u;
|
|
874
874
|
});
|
|
875
875
|
} else {
|
|
876
|
-
let
|
|
877
|
-
|
|
876
|
+
let n = {}, l = 0, u = 1, y = Object.keys(s).length || 1, f = (i) => {
|
|
877
|
+
l += Object.keys(i).length, u = Math.round(l / y * 100);
|
|
878
878
|
};
|
|
879
|
-
for (let [i, S] of Object.entries(
|
|
880
|
-
let
|
|
881
|
-
|
|
879
|
+
for (let [i, S] of Object.entries(o)) {
|
|
880
|
+
let d = await O(this, _t, Zt).call(this, S, o[i], !0);
|
|
881
|
+
f(S), e && e({ percent: u }), n = { ...n, ...d };
|
|
882
882
|
}
|
|
883
|
-
return
|
|
883
|
+
return n;
|
|
884
884
|
}
|
|
885
885
|
}
|
|
886
|
-
async batchTotalCount(
|
|
887
|
-
|
|
888
|
-
let
|
|
889
|
-
|
|
886
|
+
async batchTotalCount(s, e) {
|
|
887
|
+
E(this, Y, {}), this.errors = {};
|
|
888
|
+
let o = 1, n = 0, l = Object.keys(s).length || 1, u = (f) => {
|
|
889
|
+
n += Object.keys(f).length, o = Math.round(n / l * 100);
|
|
890
890
|
};
|
|
891
|
-
|
|
892
|
-
const
|
|
893
|
-
if (
|
|
894
|
-
const
|
|
895
|
-
return Promise.allSettled(
|
|
891
|
+
e && e({ percent: o });
|
|
892
|
+
const y = O(this, Nt, Vt).call(this, s);
|
|
893
|
+
if (a(this, tt)) {
|
|
894
|
+
const f = y.map((i) => O(this, Ot, zt).call(this, i).then((S) => (u(i), e && e({ percent: o }), S)));
|
|
895
|
+
return Promise.allSettled(f).then((i) => {
|
|
896
896
|
let S = {};
|
|
897
|
-
for (let
|
|
898
|
-
|
|
897
|
+
for (let d of i)
|
|
898
|
+
d.status === "fulfilled" && (S = { ...S, ...d.value });
|
|
899
899
|
return S;
|
|
900
900
|
});
|
|
901
901
|
} else {
|
|
902
|
-
let
|
|
903
|
-
for (let i of
|
|
904
|
-
let S = await
|
|
905
|
-
|
|
902
|
+
let f = {};
|
|
903
|
+
for (let i of y) {
|
|
904
|
+
let S = await O(this, Ot, zt).call(this, i);
|
|
905
|
+
u(i), e && e({ percent: o }), f = { ...f, ...S };
|
|
906
906
|
}
|
|
907
|
-
return
|
|
907
|
+
return f;
|
|
908
908
|
}
|
|
909
909
|
}
|
|
910
910
|
}
|
|
911
|
-
|
|
912
|
-
let
|
|
913
|
-
if (!
|
|
914
|
-
return Math.round(
|
|
915
|
-
let
|
|
916
|
-
return Object.values(
|
|
917
|
-
const { total:
|
|
918
|
-
|
|
919
|
-
}),
|
|
920
|
-
},
|
|
921
|
-
clearInterval(
|
|
922
|
-
},
|
|
923
|
-
const
|
|
924
|
-
let
|
|
925
|
-
|
|
926
|
-
const { percent:
|
|
927
|
-
(
|
|
928
|
-
data:
|
|
929
|
-
percent:
|
|
930
|
-
allCount:
|
|
911
|
+
z = new WeakMap(), ut = new WeakMap(), K = new WeakMap(), Y = new WeakMap(), X = new WeakMap(), q = new WeakMap(), Q = new WeakMap(), I = new WeakMap(), x = new WeakMap(), Dt = new WeakMap(), v = new WeakMap(), P = new WeakMap(), $ = new WeakMap(), tt = new WeakMap(), it = new WeakSet(), Lt = function() {
|
|
912
|
+
let s = 0;
|
|
913
|
+
if (!a(this, I))
|
|
914
|
+
return Math.round(s);
|
|
915
|
+
let e = 0, o = 0;
|
|
916
|
+
return Object.values(a(this, I)).forEach((n) => {
|
|
917
|
+
const { total: l, count: u } = n;
|
|
918
|
+
e += l ?? 0, o += u ?? 0;
|
|
919
|
+
}), e ? s = o / e * 100 : s = 100, { percent: Math.round(s), allCount: o, allTotal: e };
|
|
920
|
+
}, mt = new WeakSet(), kt = function() {
|
|
921
|
+
clearInterval(a(this, x)), E(this, x, ""), E(this, I, ""), E(this, Q, ""), E(this, v, "no");
|
|
922
|
+
}, ft = new WeakSet(), xt = function({ key: s, value: e }) {
|
|
923
|
+
const o = O(this, et, lt).call(this, e.data()), n = Array.isArray(o) ? o.length : 0, l = O(this, ot, bt).call(this, e.total(), n);
|
|
924
|
+
let u = 1;
|
|
925
|
+
o && (u = n), a(this, Q) && (a(this, I) || E(this, I, {}), a(this, I)[s] && a(this, I)[s].count && (u += a(this, I)[s].count), a(this, I)[s] = { total: l, count: u }, a(this, x) || E(this, x, setInterval(() => {
|
|
926
|
+
const { percent: y, allCount: f, allTotal: i } = a(this, it, Lt);
|
|
927
|
+
(a(this, v) === "no" || a(this, v) < a(this, it, Lt).percent) && (a(this, Q).call(this, {
|
|
928
|
+
data: a(this, I),
|
|
929
|
+
percent: y,
|
|
930
|
+
allCount: f,
|
|
931
931
|
allTotal: i
|
|
932
|
-
}),
|
|
933
|
-
},
|
|
934
|
-
},
|
|
935
|
-
const
|
|
936
|
-
for (let
|
|
937
|
-
const
|
|
938
|
-
|
|
932
|
+
}), E(this, v, a(this, it, Lt).percent)), y === 100 && O(this, mt, kt).call(this);
|
|
933
|
+
}, a(this, Dt))));
|
|
934
|
+
}, Nt = new WeakSet(), Vt = function(s) {
|
|
935
|
+
const e = [], o = Object.entries(s);
|
|
936
|
+
for (let n = 0; n < o.length; n += a(this, X)) {
|
|
937
|
+
const l = o.slice(n, n + a(this, X));
|
|
938
|
+
e.push(Object.fromEntries(l));
|
|
939
939
|
}
|
|
940
|
-
return
|
|
941
|
-
},
|
|
942
|
-
return new Promise((
|
|
943
|
-
const
|
|
944
|
-
let
|
|
945
|
-
|
|
946
|
-
Object.entries(i).forEach(([S,
|
|
940
|
+
return e;
|
|
941
|
+
}, _t = new WeakSet(), Zt = function(s, e, o) {
|
|
942
|
+
return new Promise((n) => {
|
|
943
|
+
const l = O(this, St, vt).call(this, e), u = [];
|
|
944
|
+
let y = 0, f = 0;
|
|
945
|
+
a(this, z).call(this, s, (i) => {
|
|
946
|
+
Object.entries(i).forEach(([S, d]) => {
|
|
947
947
|
let m = {};
|
|
948
|
-
const
|
|
949
|
-
if (
|
|
950
|
-
let { query: { method:
|
|
951
|
-
this.errors[S] = { error:
|
|
948
|
+
const N = d.error();
|
|
949
|
+
if (N) {
|
|
950
|
+
let { query: { method: W }, answer: F } = d;
|
|
951
|
+
this.errors[S] = { error: N, method: W }, y += 1;
|
|
952
952
|
}
|
|
953
|
-
if (
|
|
954
|
-
for (let [
|
|
955
|
-
|
|
953
|
+
if (d != null && d.answer && Object.keys(d.answer).length) {
|
|
954
|
+
for (let [W, F] of Object.entries(d.answer))
|
|
955
|
+
W != "result" && F && (m[W] = F);
|
|
956
956
|
Object.keys(m).length && (this.answerData[S] = m);
|
|
957
957
|
}
|
|
958
|
-
const
|
|
959
|
-
if (Array.isArray(
|
|
960
|
-
const
|
|
961
|
-
|
|
958
|
+
const B = O(this, et, lt).call(this, d.data()), ht = Array.isArray(B) ? B.length : 0, Z = O(this, ot, bt).call(this, d.total(), ht);
|
|
959
|
+
if (Array.isArray(B) ? a(this, Y)[S] = B : typeof B == "object" && B !== null && Object.keys(B).length === 0 ? a(this, Y)[S] = [] : a(this, Y)[S] = B, f += Z, o || O(this, ft, xt).call(this, { key: S, value: d }), Z > a(this, X) && Z > ht) {
|
|
960
|
+
const W = Math.ceil(Z / a(this, X)) - 1, F = Array.from({ length: W });
|
|
961
|
+
u.push([S, l[S], F]);
|
|
962
962
|
}
|
|
963
|
-
}),
|
|
963
|
+
}), f > 5e3 && a(this, $) === !1 && a(this, tt) === !1 && E(this, P, !0), y > 0 && O(this, gt, $t).call(this), u.length ? (O(this, Ht, ee).call(this, u), O(this, Yt, se).call(this).then(() => n(O(this, nt, pt).call(this)))) : n(O(this, nt, pt).call(this));
|
|
964
964
|
});
|
|
965
965
|
});
|
|
966
|
-
},
|
|
967
|
-
return new Promise((
|
|
968
|
-
const
|
|
969
|
-
let
|
|
970
|
-
|
|
971
|
-
Object.entries(
|
|
972
|
-
const
|
|
973
|
-
|
|
974
|
-
const i =
|
|
975
|
-
|
|
976
|
-
}),
|
|
966
|
+
}, Ot = new WeakSet(), zt = function(s) {
|
|
967
|
+
return new Promise((e) => {
|
|
968
|
+
const o = O(this, St, vt).call(this, s);
|
|
969
|
+
let n = 0;
|
|
970
|
+
a(this, z).call(this, o, (l) => {
|
|
971
|
+
Object.entries(l).forEach(([u, y]) => {
|
|
972
|
+
const f = y.error();
|
|
973
|
+
f && (this.errors[u] = f, n += 1);
|
|
974
|
+
const i = O(this, et, lt).call(this, y.data()), S = Array.isArray(i) ? i.length : 0, d = O(this, ot, bt).call(this, y.total(), S);
|
|
975
|
+
a(this, Y)[u] = d;
|
|
976
|
+
}), n > 0 && O(this, gt, $t).call(this), e(O(this, nt, pt).call(this));
|
|
977
977
|
});
|
|
978
978
|
});
|
|
979
|
-
},
|
|
980
|
-
let
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
const
|
|
984
|
-
|
|
979
|
+
}, Ht = new WeakSet(), ee = function(s) {
|
|
980
|
+
let e = [];
|
|
981
|
+
s.forEach(([o, n, l]) => {
|
|
982
|
+
l.forEach((u, y) => {
|
|
983
|
+
const f = y + 1, i = a(this, X) * f, d = [[o, f].join("_"), O(this, It, re).call(this, n, i)];
|
|
984
|
+
e.length === a(this, X) ? (a(this, K).push(e), e = [d]) : e.push(d);
|
|
985
985
|
});
|
|
986
|
-
}),
|
|
987
|
-
},
|
|
988
|
-
const
|
|
989
|
-
Object.entries(
|
|
990
|
-
const [
|
|
991
|
-
Array.isArray(
|
|
986
|
+
}), e.length && a(this, K).push(e);
|
|
987
|
+
}, Yt = new WeakSet(), se = function() {
|
|
988
|
+
const s = [], e = [], o = (n) => {
|
|
989
|
+
Object.entries(n).forEach(([l, u]) => {
|
|
990
|
+
const [y] = l.split("_"), f = O(this, et, lt).call(this, u.data());
|
|
991
|
+
Array.isArray(f) && a(this, Y)[y].push(...f), O(this, ft, xt).call(this, { key: y, value: u });
|
|
992
992
|
});
|
|
993
993
|
};
|
|
994
|
-
return
|
|
995
|
-
const
|
|
996
|
-
|
|
994
|
+
return a(this, K).forEach((n, l) => {
|
|
995
|
+
const u = Object.fromEntries(n), y = () => new Promise((f) => a(this, z).call(this, u, (i) => {
|
|
996
|
+
a(this, P) ? o(i) : e[l] = i, f();
|
|
997
997
|
}));
|
|
998
|
-
|
|
999
|
-
}),
|
|
1000
|
-
|
|
998
|
+
s.push(y);
|
|
999
|
+
}), a(this, P) ? O(this, At, qt).call(this, s) : O(this, Tt, Qt).call(this, s).then(() => {
|
|
1000
|
+
e.forEach(o);
|
|
1001
1001
|
});
|
|
1002
|
-
},
|
|
1003
|
-
return new Promise((
|
|
1004
|
-
},
|
|
1005
|
-
if (!
|
|
1002
|
+
}, yt = new WeakSet(), Kt = function() {
|
|
1003
|
+
return new Promise((s) => setTimeout(s, 500));
|
|
1004
|
+
}, At = new WeakSet(), qt = function(s) {
|
|
1005
|
+
if (!s.length)
|
|
1006
1006
|
return Promise.resolve();
|
|
1007
|
-
const
|
|
1007
|
+
const e = s.shift();
|
|
1008
1008
|
return Promise.allSettled([
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
]).then(() =>
|
|
1012
|
-
},
|
|
1013
|
-
if (!
|
|
1009
|
+
e(),
|
|
1010
|
+
O(this, yt, Kt).call(this)
|
|
1011
|
+
]).then(() => a(this, q) ? O(this, At, qt).call(this, s) : Promise.resolve());
|
|
1012
|
+
}, Tt = new WeakSet(), Qt = function(s) {
|
|
1013
|
+
if (!s.length)
|
|
1014
1014
|
return Promise.resolve();
|
|
1015
|
-
const
|
|
1016
|
-
return
|
|
1017
|
-
},
|
|
1018
|
-
return Object.entries(
|
|
1019
|
-
|
|
1020
|
-
}),
|
|
1021
|
-
},
|
|
1022
|
-
return Object.entries(
|
|
1023
|
-
if (Array.isArray(
|
|
1024
|
-
const [
|
|
1025
|
-
|
|
1015
|
+
const e = s.shift();
|
|
1016
|
+
return O(this, yt, Kt).call(this).then(() => e()).then(() => a(this, q) ? O(this, Tt, Qt).call(this, s) : Promise.resolve());
|
|
1017
|
+
}, nt = new WeakSet(), pt = function() {
|
|
1018
|
+
return Object.entries(a(this, ut)).forEach(([s, e]) => {
|
|
1019
|
+
a(this, Y)[s] && (a(this, Y)[s] = e(a(this, Y)[s]));
|
|
1020
|
+
}), a(this, Y);
|
|
1021
|
+
}, St = new WeakSet(), vt = function(s) {
|
|
1022
|
+
return Object.entries(s).reduce((e, [o, n]) => {
|
|
1023
|
+
if (Array.isArray(n)) {
|
|
1024
|
+
const [l, u = {}] = n;
|
|
1025
|
+
e[o] = [l, u];
|
|
1026
1026
|
} else {
|
|
1027
|
-
const { method:
|
|
1028
|
-
|
|
1027
|
+
const { method: l, params: u = {} } = n;
|
|
1028
|
+
e[o] = [l, u];
|
|
1029
1029
|
}
|
|
1030
|
-
return
|
|
1030
|
+
return e;
|
|
1031
1031
|
}, {});
|
|
1032
|
-
},
|
|
1033
|
-
const [
|
|
1034
|
-
return [
|
|
1035
|
-
},
|
|
1036
|
-
return ((
|
|
1037
|
-
},
|
|
1038
|
-
return
|
|
1039
|
-
},
|
|
1040
|
-
console.group(`${this.constructor.name}: Ошибки в методах!`), Object.entries(this.errors).forEach(([
|
|
1041
|
-
console.info(`[${
|
|
1032
|
+
}, It = new WeakSet(), re = function(s, e) {
|
|
1033
|
+
const [o, n] = s;
|
|
1034
|
+
return [o, { start: e, ...n }];
|
|
1035
|
+
}, et = new WeakSet(), lt = function(s) {
|
|
1036
|
+
return ((s == null ? void 0 : s.items) || (s == null ? void 0 : s.documents)) ?? s;
|
|
1037
|
+
}, ot = new WeakSet(), bt = function(s, e) {
|
|
1038
|
+
return s !== s && (s = 0), s === 0 && e === 0 ? 0 : s || e;
|
|
1039
|
+
}, gt = new WeakSet(), $t = function() {
|
|
1040
|
+
console.group(`${this.constructor.name}: Ошибки в методах!`), Object.entries(this.errors).forEach(([s, e]) => {
|
|
1041
|
+
console.info(`[${s}]`, e.toString());
|
|
1042
1042
|
}), console.groupEnd();
|
|
1043
1043
|
};
|
|
1044
|
-
var
|
|
1045
|
-
|
|
1046
|
-
mp4: "data:video/mp4;base64,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"
|
|
1047
|
-
};
|
|
1048
|
-
const { webm: Bt, mp4: St } = Nt, JA = () => typeof navigator < "u" && parseFloat(
|
|
1049
|
-
("" + (/CPU.*OS ([0-9_]{3,4})[0-9_]{0,1}|(CPU like).*AppleWebKit.*Mobile/i.exec(
|
|
1050
|
-
navigator.userAgent
|
|
1051
|
-
) || [0, ""])[1]).replace("undefined", "3_2").replace("_", ".").replace("_", "")
|
|
1052
|
-
) < 10 && !window.MSStream, FA = () => "wakeLock" in navigator;
|
|
1053
|
-
class dt {
|
|
1054
|
-
constructor() {
|
|
1055
|
-
if (this.enabled = !1, FA()) {
|
|
1056
|
-
this._wakeLock = null;
|
|
1057
|
-
const e = () => {
|
|
1058
|
-
this._wakeLock !== null && document.visibilityState === "visible" && this.enable();
|
|
1059
|
-
};
|
|
1060
|
-
document.addEventListener("visibilitychange", e), document.addEventListener("fullscreenchange", e);
|
|
1061
|
-
} else
|
|
1062
|
-
JA() ? this.noSleepTimer = null : (this.noSleepVideo = document.createElement("video"), this.noSleepVideo.setAttribute("title", "No Sleep"), this.noSleepVideo.setAttribute("playsinline", ""), this._addSourceToVideo(this.noSleepVideo, "webm", Bt), this._addSourceToVideo(this.noSleepVideo, "mp4", St), this.noSleepVideo.addEventListener("loadedmetadata", () => {
|
|
1063
|
-
this.noSleepVideo.duration <= 1 ? this.noSleepVideo.setAttribute("loop", "") : this.noSleepVideo.addEventListener("timeupdate", () => {
|
|
1064
|
-
this.noSleepVideo.currentTime > 0.5 && (this.noSleepVideo.currentTime = Math.random());
|
|
1065
|
-
});
|
|
1066
|
-
}));
|
|
1067
|
-
}
|
|
1068
|
-
_addSourceToVideo(e, t, n) {
|
|
1069
|
-
var r = document.createElement("source");
|
|
1070
|
-
r.src = n, r.type = `video/${t}`, e.appendChild(r);
|
|
1071
|
-
}
|
|
1072
|
-
get isEnabled() {
|
|
1073
|
-
return this.enabled;
|
|
1074
|
-
}
|
|
1075
|
-
enable() {
|
|
1076
|
-
return FA() ? navigator.wakeLock.request("screen").then((e) => {
|
|
1077
|
-
this._wakeLock = e, this.enabled = !0, console.log("Wake Lock active."), this._wakeLock.addEventListener("release", () => {
|
|
1078
|
-
console.log("Wake Lock released.");
|
|
1079
|
-
});
|
|
1080
|
-
}).catch((e) => {
|
|
1081
|
-
throw this.enabled = !1, console.error(`${e.name}, ${e.message}`), e;
|
|
1082
|
-
}) : JA() ? (this.disable(), console.warn(`
|
|
1083
|
-
NoSleep enabled for older iOS devices. This can interrupt
|
|
1084
|
-
active or long-running network requests from completing successfully.
|
|
1085
|
-
See https://github.com/richtr/NoSleep.js/issues/15 for more details.
|
|
1086
|
-
`), this.noSleepTimer = window.setInterval(() => {
|
|
1087
|
-
document.hidden || (window.location.href = window.location.href.split("#")[0], window.setTimeout(window.stop, 0));
|
|
1088
|
-
}, 15e3), this.enabled = !0, Promise.resolve()) : this.noSleepVideo.play().then((t) => (this.enabled = !0, t)).catch((t) => {
|
|
1089
|
-
throw this.enabled = !1, t;
|
|
1090
|
-
});
|
|
1091
|
-
}
|
|
1092
|
-
disable() {
|
|
1093
|
-
FA() ? (this._wakeLock && this._wakeLock.release(), this._wakeLock = null) : JA() ? this.noSleepTimer && (console.warn(`
|
|
1094
|
-
NoSleep now disabled for older iOS devices.
|
|
1095
|
-
`), window.clearInterval(this.noSleepTimer), this.noSleepTimer = null) : this.noSleepVideo.pause(), this.enabled = !1;
|
|
1096
|
-
}
|
|
1097
|
-
}
|
|
1098
|
-
var It = dt;
|
|
1099
|
-
const _t = /* @__PURE__ */ st(It);
|
|
1100
|
-
var eA;
|
|
1101
|
-
class yt {
|
|
1044
|
+
var st;
|
|
1045
|
+
class Oe {
|
|
1102
1046
|
constructor() {
|
|
1103
|
-
|
|
1047
|
+
_(this, st, {});
|
|
1104
1048
|
}
|
|
1105
1049
|
get hash() {
|
|
1106
1050
|
return this.createHash(8);
|
|
1107
1051
|
}
|
|
1108
1052
|
/** Генератор хеш-кода */
|
|
1109
|
-
createHash(
|
|
1110
|
-
let
|
|
1111
|
-
|
|
1112
|
-
for (let
|
|
1113
|
-
|
|
1114
|
-
return
|
|
1053
|
+
createHash(s) {
|
|
1054
|
+
let e = "abcdefghijklmnopqrstuvwxyz0123456789", o = "";
|
|
1055
|
+
s = s || 6;
|
|
1056
|
+
for (let n = 0; n < s; n++)
|
|
1057
|
+
o += e.charAt(Math.floor(Math.random() * e.length));
|
|
1058
|
+
return o;
|
|
1115
1059
|
}
|
|
1116
1060
|
/** Фильтр часто запускаемых действий */
|
|
1117
|
-
actionFilter({ keyTimer:
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
},
|
|
1061
|
+
actionFilter({ keyTimer: s, duration: e = 10, action: o }) {
|
|
1062
|
+
a(this, st)[s] && (clearTimeout(a(this, st)[s]), a(this, st)[s] = null), o && (a(this, st)[s] = setTimeout(() => {
|
|
1063
|
+
o();
|
|
1064
|
+
}, e));
|
|
1121
1065
|
}
|
|
1122
1066
|
}
|
|
1123
|
-
|
|
1124
|
-
const
|
|
1125
|
-
var
|
|
1126
|
-
class
|
|
1067
|
+
st = new WeakMap();
|
|
1068
|
+
const Wt = new Oe();
|
|
1069
|
+
var J, V, Ut, rt, Et, Gt, ie, Rt, te, Bt, ne, wt, oe, Ct, he;
|
|
1070
|
+
class ye {
|
|
1127
1071
|
constructor() {
|
|
1128
|
-
|
|
1072
|
+
_(this, Gt);
|
|
1129
1073
|
/** Вывод ошибок логера
|
|
1130
1074
|
* @param {'entity'} type - тип ошибки
|
|
1131
1075
|
*/
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1076
|
+
_(this, Rt);
|
|
1077
|
+
_(this, Bt);
|
|
1078
|
+
_(this, wt);
|
|
1079
|
+
_(this, Ct);
|
|
1080
|
+
_(this, J, "logger");
|
|
1081
|
+
_(this, V, !1);
|
|
1082
|
+
_(this, Ut, 2e3);
|
|
1083
|
+
_(this, rt, /* @__PURE__ */ new Map());
|
|
1084
|
+
_(this, Et, {});
|
|
1141
1085
|
/** Очистка хранилища элементов старше 'N' месяцев */
|
|
1142
|
-
|
|
1143
|
-
|
|
1086
|
+
C(this, "periodClear", 3);
|
|
1087
|
+
O(this, Gt, ie).call(this);
|
|
1144
1088
|
}
|
|
1145
1089
|
/** Инициализация логера */
|
|
1146
1090
|
async init() {
|
|
1147
|
-
let
|
|
1091
|
+
let s = new k(BX24.callBatch), { entityList: e } = await s.batch({
|
|
1148
1092
|
entityList: { method: "entity.get" }
|
|
1149
1093
|
});
|
|
1150
|
-
if (
|
|
1151
|
-
if (
|
|
1152
|
-
|
|
1094
|
+
if (e != null && e.length)
|
|
1095
|
+
if (e.find((n) => n.ENTITY == a(this, J)))
|
|
1096
|
+
E(this, V, !0);
|
|
1153
1097
|
else {
|
|
1154
|
-
let { entityAdd:
|
|
1098
|
+
let { entityAdd: n } = await s.batch({
|
|
1155
1099
|
entityAdd: {
|
|
1156
1100
|
method: "entity.add",
|
|
1157
1101
|
params: {
|
|
1158
|
-
ENTITY:
|
|
1159
|
-
NAME:
|
|
1102
|
+
ENTITY: a(this, J),
|
|
1103
|
+
NAME: a(this, J),
|
|
1160
1104
|
ACCESS: { AU: "X" }
|
|
1161
1105
|
}
|
|
1162
1106
|
}
|
|
1163
1107
|
});
|
|
1164
|
-
|
|
1108
|
+
n && E(this, V, !0);
|
|
1165
1109
|
}
|
|
1166
|
-
return
|
|
1110
|
+
return O(this, wt, oe).call(this), a(this, V);
|
|
1167
1111
|
}
|
|
1168
1112
|
/**
|
|
1169
1113
|
* @param {{ type: 'call'|'batch'|'batch-total-count';
|
|
@@ -1174,21 +1118,21 @@ class Rt {
|
|
|
1174
1118
|
* }; }}
|
|
1175
1119
|
* @returns {string}
|
|
1176
1120
|
*/
|
|
1177
|
-
start({ type:
|
|
1178
|
-
if (!
|
|
1179
|
-
|
|
1121
|
+
start({ type: s, data: e }) {
|
|
1122
|
+
if (!a(this, V)) {
|
|
1123
|
+
O(this, Rt, te).call(this, "entity");
|
|
1180
1124
|
return;
|
|
1181
1125
|
}
|
|
1182
|
-
const
|
|
1183
|
-
return
|
|
1184
|
-
type:
|
|
1185
|
-
data:
|
|
1186
|
-
userInfo:
|
|
1126
|
+
const o = Wt.hash;
|
|
1127
|
+
return a(this, rt).set(o, {
|
|
1128
|
+
type: s,
|
|
1129
|
+
data: e,
|
|
1130
|
+
userInfo: a(this, Et),
|
|
1187
1131
|
errorList: [],
|
|
1188
1132
|
status: "",
|
|
1189
1133
|
answer: null,
|
|
1190
1134
|
date: (/* @__PURE__ */ new Date()).getTime()
|
|
1191
|
-
}),
|
|
1135
|
+
}), o;
|
|
1192
1136
|
}
|
|
1193
1137
|
/**
|
|
1194
1138
|
* @param {{
|
|
@@ -1197,124 +1141,123 @@ class Rt {
|
|
|
1197
1141
|
* status: 'success'|'fail'|'fail-runtime',
|
|
1198
1142
|
* answer: { [key]: unknown } }}
|
|
1199
1143
|
*/
|
|
1200
|
-
stop({ key:
|
|
1201
|
-
if (!
|
|
1202
|
-
|
|
1144
|
+
stop({ key: s, errorList: e, status: o, answer: n }) {
|
|
1145
|
+
if (!a(this, V)) {
|
|
1146
|
+
O(this, Rt, te).call(this, "entity");
|
|
1203
1147
|
return;
|
|
1204
1148
|
}
|
|
1205
|
-
let
|
|
1206
|
-
|
|
1149
|
+
let l = a(this, rt).get(s);
|
|
1150
|
+
e && (l.errorList = e), o && (l.status = o), n && (l.answer = n), Wt.actionFilter({
|
|
1207
1151
|
keyTimer: "add.entity.items",
|
|
1208
|
-
duration:
|
|
1152
|
+
duration: a(this, Ut),
|
|
1209
1153
|
action: () => {
|
|
1210
|
-
|
|
1154
|
+
O(this, Bt, ne).call(this);
|
|
1211
1155
|
}
|
|
1212
1156
|
});
|
|
1213
1157
|
}
|
|
1214
1158
|
async getEntityList() {
|
|
1215
|
-
let
|
|
1159
|
+
let s = new k(BX24.callBatch), { entityList: e } = await s.batch({
|
|
1216
1160
|
entityList: {
|
|
1217
1161
|
method: "entity.item.get",
|
|
1218
1162
|
params: {
|
|
1219
|
-
ENTITY:
|
|
1163
|
+
ENTITY: a(this, J),
|
|
1220
1164
|
SORT: { ID: "DESC" }
|
|
1221
1165
|
}
|
|
1222
1166
|
}
|
|
1223
1167
|
});
|
|
1224
|
-
return
|
|
1225
|
-
const { ID:
|
|
1168
|
+
return e = e.map((o) => {
|
|
1169
|
+
const { ID: n, DATE_CREATE: l, DETAIL_TEXT: u } = o;
|
|
1226
1170
|
return {
|
|
1227
|
-
...JSON.parse(
|
|
1228
|
-
id:
|
|
1229
|
-
dateCreate:
|
|
1171
|
+
...JSON.parse(u),
|
|
1172
|
+
id: n,
|
|
1173
|
+
dateCreate: l
|
|
1230
1174
|
};
|
|
1231
|
-
}),
|
|
1175
|
+
}), e;
|
|
1232
1176
|
}
|
|
1233
1177
|
}
|
|
1234
|
-
|
|
1235
|
-
const
|
|
1178
|
+
J = new WeakMap(), V = new WeakMap(), Ut = new WeakMap(), rt = new WeakMap(), Et = new WeakMap(), Gt = new WeakSet(), ie = async function() {
|
|
1179
|
+
const s = new k(BX24.callBatch), e = BX24.isAdmin(), { curUser: o } = await s.batch({
|
|
1236
1180
|
curUser: { method: "user.current" }
|
|
1237
1181
|
});
|
|
1238
|
-
|
|
1239
|
-
},
|
|
1240
|
-
|
|
1182
|
+
E(this, Et, { isAdmin: e, curUser: o });
|
|
1183
|
+
}, Rt = new WeakSet(), te = function(s) {
|
|
1184
|
+
s == "entity" && Wt.actionFilter({
|
|
1241
1185
|
keyTimer: "error.logger.entity",
|
|
1242
1186
|
duration: 500,
|
|
1243
1187
|
action: () => {
|
|
1244
1188
|
console.error("Хранилище для логгера не инициализировано");
|
|
1245
1189
|
}
|
|
1246
1190
|
});
|
|
1247
|
-
},
|
|
1248
|
-
let
|
|
1249
|
-
for (let [
|
|
1250
|
-
|
|
1191
|
+
}, Bt = new WeakSet(), ne = async function() {
|
|
1192
|
+
let s = {}, e = new k(BX24.callBatch);
|
|
1193
|
+
for (let [o, n] of a(this, rt).entries())
|
|
1194
|
+
n.status && (s[o] = {
|
|
1251
1195
|
method: "entity.item.add",
|
|
1252
1196
|
params: {
|
|
1253
|
-
ENTITY:
|
|
1254
|
-
NAME:
|
|
1255
|
-
DETAIL_TEXT: JSON.stringify(
|
|
1197
|
+
ENTITY: a(this, J),
|
|
1198
|
+
NAME: a(this, J),
|
|
1199
|
+
DETAIL_TEXT: JSON.stringify(n)
|
|
1256
1200
|
}
|
|
1257
1201
|
});
|
|
1258
|
-
if (Object.keys(
|
|
1259
|
-
let
|
|
1260
|
-
for (let [
|
|
1261
|
-
|
|
1202
|
+
if (Object.keys(s).length) {
|
|
1203
|
+
let o = await e.batch(s), { errors: n } = e;
|
|
1204
|
+
for (let [l, u] of Object.entries({ ...o, ...n }))
|
|
1205
|
+
a(this, rt).delete(l);
|
|
1262
1206
|
}
|
|
1263
|
-
},
|
|
1264
|
-
let
|
|
1207
|
+
}, wt = new WeakSet(), oe = async function() {
|
|
1208
|
+
let s = new k(BX24.callBatch), e = await this.getEntityList(), { serverTime: o } = await s.batch({
|
|
1265
1209
|
serverTime: { method: "server.time" }
|
|
1266
|
-
}),
|
|
1267
|
-
let { dateCreate:
|
|
1268
|
-
return
|
|
1210
|
+
}), n = e.filter((l) => {
|
|
1211
|
+
let { dateCreate: u } = l;
|
|
1212
|
+
return jt(new Date(u)).between(jt(new Date(o)), "month") >= this.periodClear;
|
|
1269
1213
|
});
|
|
1270
|
-
|
|
1271
|
-
},
|
|
1272
|
-
let
|
|
1273
|
-
let { id:
|
|
1214
|
+
O(this, Ct, he).call(this, n);
|
|
1215
|
+
}, Ct = new WeakSet(), he = async function(s) {
|
|
1216
|
+
let e = new k(BX24.callBatch), o = s.map((n) => {
|
|
1217
|
+
let { id: l } = n;
|
|
1274
1218
|
return {
|
|
1275
1219
|
method: "entity.item.delete",
|
|
1276
1220
|
params: {
|
|
1277
|
-
ENTITY:
|
|
1278
|
-
ID:
|
|
1221
|
+
ENTITY: a(this, J),
|
|
1222
|
+
ID: l
|
|
1279
1223
|
}
|
|
1280
1224
|
};
|
|
1281
1225
|
});
|
|
1282
|
-
return await
|
|
1226
|
+
return await e.batch(o);
|
|
1283
1227
|
};
|
|
1284
|
-
const G = new
|
|
1285
|
-
var
|
|
1286
|
-
class
|
|
1287
|
-
constructor(
|
|
1228
|
+
const G = new ye();
|
|
1229
|
+
var Pt, ae, Ft, ce;
|
|
1230
|
+
class Te {
|
|
1231
|
+
constructor(s) {
|
|
1288
1232
|
/** Запрос данных о приложении */
|
|
1289
|
-
|
|
1233
|
+
_(this, Pt);
|
|
1290
1234
|
/** Запрос данных о текущем пользователе */
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
this.appConst = e;
|
|
1235
|
+
_(this, Ft);
|
|
1236
|
+
C(this, "domain", "");
|
|
1237
|
+
C(this, "isAdmin", !1);
|
|
1238
|
+
C(this, "appInfo", null);
|
|
1239
|
+
C(this, "appConst", null);
|
|
1240
|
+
C(this, "userInfo", null);
|
|
1241
|
+
C(this, "placeData", null);
|
|
1242
|
+
C(this, "placeInfo", null);
|
|
1243
|
+
this.appConst = s;
|
|
1301
1244
|
}
|
|
1302
1245
|
init() {
|
|
1303
|
-
return new Promise((
|
|
1304
|
-
let
|
|
1246
|
+
return new Promise((s) => {
|
|
1247
|
+
let e = setInterval(() => {
|
|
1305
1248
|
window.BX24 && BX24.init(async () => {
|
|
1306
|
-
console.info("init BX24"), clearInterval(
|
|
1307
|
-
const [
|
|
1308
|
-
|
|
1309
|
-
|
|
1249
|
+
console.info("init BX24"), clearInterval(e), this.domain = BX24.getDomain(), this.isAdmin = BX24.isAdmin(), this.placeInfo = BX24.placement.info(), await G.init();
|
|
1250
|
+
const [o, n] = await Promise.all([
|
|
1251
|
+
O(this, Pt, ae).call(this),
|
|
1252
|
+
O(this, Ft, ce).call(this)
|
|
1310
1253
|
]);
|
|
1311
|
-
this.appInfo =
|
|
1254
|
+
this.appInfo = o, this.userInfo = n, s(!0);
|
|
1312
1255
|
});
|
|
1313
1256
|
}, 100);
|
|
1314
1257
|
});
|
|
1315
1258
|
}
|
|
1316
|
-
userOption(
|
|
1317
|
-
return
|
|
1259
|
+
userOption(s, e) {
|
|
1260
|
+
return e ? BX24.userOption.set(s, e) : BX24.userOption.get(s);
|
|
1318
1261
|
}
|
|
1319
1262
|
/**
|
|
1320
1263
|
* @param {{
|
|
@@ -1328,32 +1271,32 @@ class Mt {
|
|
|
1328
1271
|
* }[]
|
|
1329
1272
|
* }[]
|
|
1330
1273
|
*/
|
|
1331
|
-
call({ method:
|
|
1332
|
-
let
|
|
1274
|
+
call({ method: s, params: e, updateList: o }) {
|
|
1275
|
+
let n = G.start({
|
|
1333
1276
|
type: "call",
|
|
1334
|
-
data: { method:
|
|
1277
|
+
data: { method: s, params: e, updateList: o }
|
|
1335
1278
|
});
|
|
1336
|
-
return new Promise((
|
|
1337
|
-
|
|
1338
|
-
let
|
|
1339
|
-
if (
|
|
1340
|
-
for (let [
|
|
1341
|
-
|
|
1342
|
-
if (
|
|
1343
|
-
let
|
|
1344
|
-
console.error(
|
|
1345
|
-
answer:
|
|
1346
|
-
key:
|
|
1279
|
+
return new Promise((l) => {
|
|
1280
|
+
e || (e = {}), BX24.callMethod(s, e, function(u) {
|
|
1281
|
+
let y = {};
|
|
1282
|
+
if (u != null && u.answer)
|
|
1283
|
+
for (let [f, i] of Object.entries(u.answer))
|
|
1284
|
+
f != "result" && i && (y[f] = i);
|
|
1285
|
+
if (u.error()) {
|
|
1286
|
+
let f = u.error();
|
|
1287
|
+
console.error(f), G.stop({
|
|
1288
|
+
answer: y,
|
|
1289
|
+
key: n,
|
|
1347
1290
|
status: "fail",
|
|
1348
|
-
errorList: [
|
|
1349
|
-
}),
|
|
1291
|
+
errorList: [f.toSting()]
|
|
1292
|
+
}), l(!1);
|
|
1350
1293
|
} else {
|
|
1351
|
-
let
|
|
1352
|
-
|
|
1353
|
-
answer:
|
|
1354
|
-
key:
|
|
1294
|
+
let f = u.data();
|
|
1295
|
+
f != null && f.items && (f = f.items), G.stop({
|
|
1296
|
+
answer: y,
|
|
1297
|
+
key: n,
|
|
1355
1298
|
status: "success"
|
|
1356
|
-
}),
|
|
1299
|
+
}), l(f);
|
|
1357
1300
|
}
|
|
1358
1301
|
});
|
|
1359
1302
|
});
|
|
@@ -1369,116 +1312,116 @@ class Mt {
|
|
|
1369
1312
|
* }[]
|
|
1370
1313
|
* }[] }}
|
|
1371
1314
|
*/
|
|
1372
|
-
async batch(
|
|
1373
|
-
let
|
|
1315
|
+
async batch(s, e, { updateList: o, errorCall: n } = {}) {
|
|
1316
|
+
let l = new k(BX24.callBatch), u = G.start({
|
|
1374
1317
|
type: "batch",
|
|
1375
|
-
data: { commandList:
|
|
1318
|
+
data: { commandList: s, updateList: o }
|
|
1376
1319
|
});
|
|
1377
1320
|
try {
|
|
1378
|
-
let
|
|
1379
|
-
if (Object.keys(
|
|
1380
|
-
let
|
|
1321
|
+
let y = await l.batch(s, e);
|
|
1322
|
+
if (Object.keys(l.errors).length) {
|
|
1323
|
+
let f = Object.entries(l.errors).map(([i, S]) => ({
|
|
1381
1324
|
key: i,
|
|
1382
1325
|
error: S.toSting()
|
|
1383
1326
|
}));
|
|
1384
|
-
|
|
1385
|
-
key:
|
|
1327
|
+
n && n(l.errors), G.stop({
|
|
1328
|
+
key: u,
|
|
1386
1329
|
status: "fail",
|
|
1387
|
-
errorList:
|
|
1388
|
-
answer:
|
|
1330
|
+
errorList: f,
|
|
1331
|
+
answer: l.answerData
|
|
1389
1332
|
});
|
|
1390
1333
|
} else
|
|
1391
1334
|
G.stop({
|
|
1392
|
-
key:
|
|
1335
|
+
key: u,
|
|
1393
1336
|
status: "success",
|
|
1394
|
-
answer:
|
|
1337
|
+
answer: l.answerData
|
|
1395
1338
|
});
|
|
1396
|
-
return
|
|
1397
|
-
} catch (
|
|
1339
|
+
return y;
|
|
1340
|
+
} catch (y) {
|
|
1398
1341
|
return G.stop({
|
|
1399
|
-
key:
|
|
1342
|
+
key: u,
|
|
1400
1343
|
status: "fail-runtime",
|
|
1401
|
-
errorList: [
|
|
1402
|
-
answer:
|
|
1403
|
-
}), console.error(
|
|
1344
|
+
errorList: [y.toSting()],
|
|
1345
|
+
answer: l.answerData
|
|
1346
|
+
}), console.error(y), !1;
|
|
1404
1347
|
}
|
|
1405
1348
|
}
|
|
1406
1349
|
/**
|
|
1407
1350
|
* @param commandList - объект/массив команд
|
|
1408
1351
|
* @param progressCall - callback(data), в data приходят данные о загрузке данных
|
|
1409
1352
|
*/
|
|
1410
|
-
async batchTotalCount(
|
|
1411
|
-
let
|
|
1353
|
+
async batchTotalCount(s, e) {
|
|
1354
|
+
let o = new k(BX24.callBatch), n = G.start({
|
|
1412
1355
|
type: "batch",
|
|
1413
|
-
data: { commandList:
|
|
1356
|
+
data: { commandList: s }
|
|
1414
1357
|
});
|
|
1415
1358
|
try {
|
|
1416
|
-
let
|
|
1417
|
-
if (Object.keys(
|
|
1418
|
-
let
|
|
1419
|
-
key:
|
|
1420
|
-
error:
|
|
1359
|
+
let l = await o.batchTotalCount(s, e);
|
|
1360
|
+
if (Object.keys(o.errors).length) {
|
|
1361
|
+
let u = Object.entries(o.errors).map(([y, f]) => ({
|
|
1362
|
+
key: y,
|
|
1363
|
+
error: f.toSting()
|
|
1421
1364
|
}));
|
|
1422
1365
|
G.stop({
|
|
1423
|
-
key:
|
|
1366
|
+
key: n,
|
|
1424
1367
|
status: "fail",
|
|
1425
|
-
errorList:
|
|
1368
|
+
errorList: u
|
|
1426
1369
|
});
|
|
1427
1370
|
} else
|
|
1428
1371
|
G.stop({
|
|
1429
|
-
key:
|
|
1372
|
+
key: n,
|
|
1430
1373
|
status: "success"
|
|
1431
1374
|
});
|
|
1432
|
-
return
|
|
1433
|
-
} catch (
|
|
1375
|
+
return l;
|
|
1376
|
+
} catch (l) {
|
|
1434
1377
|
return G.stop({
|
|
1435
|
-
key:
|
|
1378
|
+
key: n,
|
|
1436
1379
|
status: "fail",
|
|
1437
|
-
errorList: [
|
|
1438
|
-
}), console.error(
|
|
1380
|
+
errorList: [l.toSting()]
|
|
1381
|
+
}), console.error(l), !1;
|
|
1439
1382
|
}
|
|
1440
1383
|
}
|
|
1441
1384
|
/** Запрос данных о местах встройки приложения */
|
|
1442
1385
|
getPlacement() {
|
|
1443
|
-
return this.call({ method: "placement.get" }).then((
|
|
1386
|
+
return this.call({ method: "placement.get" }).then((s) => (this.placeData || (this.placeData = s), s));
|
|
1444
1387
|
}
|
|
1445
1388
|
/** Встройка приложения в place */
|
|
1446
|
-
async placementBind(
|
|
1389
|
+
async placementBind(s) {
|
|
1447
1390
|
this.placeData || (this.placeData = await this.getPlacement());
|
|
1448
|
-
const { appName:
|
|
1449
|
-
let
|
|
1450
|
-
|
|
1451
|
-
window.placementUnBind[
|
|
1391
|
+
const { appName: e, pathApp: o } = this.appConst, n = this.placeData.map((u) => u.placement);
|
|
1392
|
+
let l = this.placeData.find((u) => u.placement == s);
|
|
1393
|
+
n.includes(s) ? l.handler != o && (window.placementUnBind || (window.placementUnBind = {}), window.placementUnBind[s] || this.placementUnBind(l).then(() => {
|
|
1394
|
+
window.placementUnBind[s] || (window.placementUnBind[s] = !0, this.placementBind(s));
|
|
1452
1395
|
})) : this.call({
|
|
1453
1396
|
method: "placement.bind",
|
|
1454
1397
|
params: {
|
|
1455
|
-
PLACEMENT:
|
|
1456
|
-
HANDLER:
|
|
1398
|
+
PLACEMENT: s,
|
|
1399
|
+
HANDLER: o,
|
|
1457
1400
|
LANG_ALL: {
|
|
1458
1401
|
ru: {
|
|
1459
|
-
TITLE:
|
|
1402
|
+
TITLE: e
|
|
1460
1403
|
}
|
|
1461
1404
|
}
|
|
1462
1405
|
}
|
|
1463
|
-
}).then((
|
|
1464
|
-
|
|
1406
|
+
}).then((u) => {
|
|
1407
|
+
u ? console.info("Приложение успешно встроено в", s) : console.warn("Приложение не может быть встроено в", s);
|
|
1465
1408
|
});
|
|
1466
1409
|
}
|
|
1467
1410
|
/** Отвязка встройки из place */
|
|
1468
|
-
placementUnBind(
|
|
1469
|
-
const { pathApp:
|
|
1411
|
+
placementUnBind(s) {
|
|
1412
|
+
const { pathApp: e, appName: o } = this.appConst;
|
|
1470
1413
|
return this.call({
|
|
1471
1414
|
method: "placement.unbind",
|
|
1472
1415
|
params: {
|
|
1473
|
-
PLACEMENT:
|
|
1474
|
-
HANDLER:
|
|
1416
|
+
PLACEMENT: s,
|
|
1417
|
+
HANDLER: e,
|
|
1475
1418
|
LANG_ALL: {
|
|
1476
1419
|
ru: {
|
|
1477
|
-
TITLE:
|
|
1420
|
+
TITLE: o
|
|
1478
1421
|
}
|
|
1479
1422
|
}
|
|
1480
1423
|
}
|
|
1481
|
-
}).then((
|
|
1424
|
+
}).then((n) => (console.log("Встройка отвязана", s), n));
|
|
1482
1425
|
}
|
|
1483
1426
|
/** Чат-бот */
|
|
1484
1427
|
/* получение списка ботов */
|
|
@@ -1486,22 +1429,22 @@ class Mt {
|
|
|
1486
1429
|
return this.call({
|
|
1487
1430
|
method: "imbot.bot.list",
|
|
1488
1431
|
params: {}
|
|
1489
|
-
}).then((
|
|
1490
|
-
let
|
|
1491
|
-
return console.log("chat-bot list:",
|
|
1432
|
+
}).then((s) => {
|
|
1433
|
+
let e = Object.values(s);
|
|
1434
|
+
return console.log("chat-bot list:", e), e;
|
|
1492
1435
|
});
|
|
1493
1436
|
}
|
|
1494
1437
|
/* регистрация бота */
|
|
1495
|
-
regBot({ code:
|
|
1496
|
-
const { appName:
|
|
1438
|
+
regBot({ code: s, type: e, name: o }) {
|
|
1439
|
+
const { appName: n, pathApp: l, chatBotLogo: u } = this.appConst, y = this.appInfo.ID;
|
|
1497
1440
|
return this.call({
|
|
1498
1441
|
method: "imbot.register",
|
|
1499
1442
|
params: {
|
|
1500
|
-
CODE:
|
|
1443
|
+
CODE: s ?? this.appInfo.CODE,
|
|
1501
1444
|
// Строковой идентификатор бота, уникальный в рамках вашего приложения (обяз.)
|
|
1502
|
-
TYPE:
|
|
1445
|
+
TYPE: e ?? "O",
|
|
1503
1446
|
// Тип бота, B - чат-бот, ответы поступают сразу, H - человек, ответы поступают с задержкой от 2-х до 10 секунд, O - чат-бот для Открытых линий, S - чат-бот с повышенными привилегиями (supervisor)
|
|
1504
|
-
EVENT_HANDLER:
|
|
1447
|
+
EVENT_HANDLER: l,
|
|
1505
1448
|
// Ссылка на обработчик событий, поступивших от сервера - см. Обработчики событий ниже (обяз).
|
|
1506
1449
|
OPENLINE: "Y",
|
|
1507
1450
|
// Включение режима поддержки Открытых линий, можно не указывать, если TYPE = 'O'
|
|
@@ -1509,7 +1452,7 @@ class Mt {
|
|
|
1509
1452
|
// строковый идентификатор чат-бота, используется только в режиме Вебхуков
|
|
1510
1453
|
PROPERTIES: {
|
|
1511
1454
|
// Личные данные чат-бота (обяз.)
|
|
1512
|
-
NAME: `${
|
|
1455
|
+
NAME: `${o ?? n} - бот #${y}`,
|
|
1513
1456
|
// Имя чат-бота (обязательное одно из полей NAME или LAST_NAME)
|
|
1514
1457
|
LAST_NAME: "",
|
|
1515
1458
|
// Фамилия чат-бота (обязательное одно из полей NAME или LAST_NAME)
|
|
@@ -1517,7 +1460,7 @@ class Mt {
|
|
|
1517
1460
|
// Цвет чат-бота для мобильного приложения RED, GREEN, MINT, LIGHT_BLUE, DARK_BLUE, PURPLE, AQUA, PINK, LIME, BROWN, AZURE, KHAKI, SAND, MARENGO, GRAY, GRAPHITE
|
|
1518
1461
|
EMAIL: "",
|
|
1519
1462
|
// E-mail для связи. НЕЛЬЗЯ использовать e-mail, дублирующий e-mail реальных пользователей
|
|
1520
|
-
PERSONAL_BIRTHDAY:
|
|
1463
|
+
PERSONAL_BIRTHDAY: jt().format("%Y-%m-%d"),
|
|
1521
1464
|
// День рождения в формате YYYY-mm-dd
|
|
1522
1465
|
WORK_POSITION: "Почтальон",
|
|
1523
1466
|
// Занимаемая должность, используется как описание чат-бота
|
|
@@ -1525,31 +1468,31 @@ class Mt {
|
|
|
1525
1468
|
// Ссылка на сайт
|
|
1526
1469
|
PERSONAL_GENDER: "M",
|
|
1527
1470
|
// Пол чат-бота, допустимые значения M - мужской, F - женский, пусто, если не требуется указывать
|
|
1528
|
-
PERSONAL_PHOTO:
|
|
1471
|
+
PERSONAL_PHOTO: u ?? ""
|
|
1529
1472
|
// Аватар чат-бота - base64
|
|
1530
1473
|
}
|
|
1531
1474
|
}
|
|
1532
|
-
}).then((
|
|
1475
|
+
}).then((f) => (console.log("Чат-бот добавлен", f), f));
|
|
1533
1476
|
}
|
|
1534
1477
|
/* Убрать регистрацию бота */
|
|
1535
|
-
unRegBot(
|
|
1478
|
+
unRegBot(s) {
|
|
1536
1479
|
return this.call({
|
|
1537
1480
|
method: "imbot.unregister",
|
|
1538
1481
|
params: {
|
|
1539
|
-
BOT_ID:
|
|
1482
|
+
BOT_ID: s
|
|
1540
1483
|
}
|
|
1541
|
-
}).then((
|
|
1484
|
+
}).then((e) => (console.log("чат-бот удален", e), e));
|
|
1542
1485
|
}
|
|
1543
1486
|
}
|
|
1544
|
-
|
|
1487
|
+
Pt = new WeakSet(), ae = function() {
|
|
1545
1488
|
return this.call({ method: "app.info" });
|
|
1546
|
-
},
|
|
1489
|
+
}, Ft = new WeakSet(), ce = function() {
|
|
1547
1490
|
return this.call({ method: "user.current" });
|
|
1548
1491
|
};
|
|
1549
1492
|
export {
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1493
|
+
k as Batch,
|
|
1494
|
+
Te as BxBoot,
|
|
1495
|
+
Oe as BxHelper,
|
|
1496
|
+
ye as BxLogger,
|
|
1497
|
+
jt as tempus
|
|
1555
1498
|
};
|