@cadenza.io/core 3.18.2 → 3.19.0
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.d.mts +58 -52
- package/dist/index.d.ts +58 -52
- package/dist/index.js +305 -1136
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +305 -1136
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -256,975 +256,6 @@ function debounce(func, wait, options) {
|
|
|
256
256
|
}
|
|
257
257
|
var debounce_default = debounce;
|
|
258
258
|
|
|
259
|
-
// node_modules/lodash-es/isArray.js
|
|
260
|
-
var isArray = Array.isArray;
|
|
261
|
-
var isArray_default = isArray;
|
|
262
|
-
|
|
263
|
-
// node_modules/lodash-es/identity.js
|
|
264
|
-
function identity(value) {
|
|
265
|
-
return value;
|
|
266
|
-
}
|
|
267
|
-
var identity_default = identity;
|
|
268
|
-
|
|
269
|
-
// node_modules/lodash-es/isFunction.js
|
|
270
|
-
var asyncTag = "[object AsyncFunction]";
|
|
271
|
-
var funcTag = "[object Function]";
|
|
272
|
-
var genTag = "[object GeneratorFunction]";
|
|
273
|
-
var proxyTag = "[object Proxy]";
|
|
274
|
-
function isFunction(value) {
|
|
275
|
-
if (!isObject_default(value)) {
|
|
276
|
-
return false;
|
|
277
|
-
}
|
|
278
|
-
var tag = baseGetTag_default(value);
|
|
279
|
-
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
|
|
280
|
-
}
|
|
281
|
-
var isFunction_default = isFunction;
|
|
282
|
-
|
|
283
|
-
// node_modules/lodash-es/_coreJsData.js
|
|
284
|
-
var coreJsData = root_default["__core-js_shared__"];
|
|
285
|
-
var coreJsData_default = coreJsData;
|
|
286
|
-
|
|
287
|
-
// node_modules/lodash-es/_isMasked.js
|
|
288
|
-
var maskSrcKey = (function() {
|
|
289
|
-
var uid = /[^.]+$/.exec(coreJsData_default && coreJsData_default.keys && coreJsData_default.keys.IE_PROTO || "");
|
|
290
|
-
return uid ? "Symbol(src)_1." + uid : "";
|
|
291
|
-
})();
|
|
292
|
-
function isMasked(func) {
|
|
293
|
-
return !!maskSrcKey && maskSrcKey in func;
|
|
294
|
-
}
|
|
295
|
-
var isMasked_default = isMasked;
|
|
296
|
-
|
|
297
|
-
// node_modules/lodash-es/_toSource.js
|
|
298
|
-
var funcProto = Function.prototype;
|
|
299
|
-
var funcToString = funcProto.toString;
|
|
300
|
-
function toSource(func) {
|
|
301
|
-
if (func != null) {
|
|
302
|
-
try {
|
|
303
|
-
return funcToString.call(func);
|
|
304
|
-
} catch (e) {
|
|
305
|
-
}
|
|
306
|
-
try {
|
|
307
|
-
return func + "";
|
|
308
|
-
} catch (e) {
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
return "";
|
|
312
|
-
}
|
|
313
|
-
var toSource_default = toSource;
|
|
314
|
-
|
|
315
|
-
// node_modules/lodash-es/_baseIsNative.js
|
|
316
|
-
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
317
|
-
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
318
|
-
var funcProto2 = Function.prototype;
|
|
319
|
-
var objectProto3 = Object.prototype;
|
|
320
|
-
var funcToString2 = funcProto2.toString;
|
|
321
|
-
var hasOwnProperty2 = objectProto3.hasOwnProperty;
|
|
322
|
-
var reIsNative = RegExp(
|
|
323
|
-
"^" + funcToString2.call(hasOwnProperty2).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
324
|
-
);
|
|
325
|
-
function baseIsNative(value) {
|
|
326
|
-
if (!isObject_default(value) || isMasked_default(value)) {
|
|
327
|
-
return false;
|
|
328
|
-
}
|
|
329
|
-
var pattern = isFunction_default(value) ? reIsNative : reIsHostCtor;
|
|
330
|
-
return pattern.test(toSource_default(value));
|
|
331
|
-
}
|
|
332
|
-
var baseIsNative_default = baseIsNative;
|
|
333
|
-
|
|
334
|
-
// node_modules/lodash-es/_getValue.js
|
|
335
|
-
function getValue(object, key) {
|
|
336
|
-
return object == null ? void 0 : object[key];
|
|
337
|
-
}
|
|
338
|
-
var getValue_default = getValue;
|
|
339
|
-
|
|
340
|
-
// node_modules/lodash-es/_getNative.js
|
|
341
|
-
function getNative(object, key) {
|
|
342
|
-
var value = getValue_default(object, key);
|
|
343
|
-
return baseIsNative_default(value) ? value : void 0;
|
|
344
|
-
}
|
|
345
|
-
var getNative_default = getNative;
|
|
346
|
-
|
|
347
|
-
// node_modules/lodash-es/_baseCreate.js
|
|
348
|
-
var objectCreate = Object.create;
|
|
349
|
-
var baseCreate = /* @__PURE__ */ (function() {
|
|
350
|
-
function object() {
|
|
351
|
-
}
|
|
352
|
-
return function(proto) {
|
|
353
|
-
if (!isObject_default(proto)) {
|
|
354
|
-
return {};
|
|
355
|
-
}
|
|
356
|
-
if (objectCreate) {
|
|
357
|
-
return objectCreate(proto);
|
|
358
|
-
}
|
|
359
|
-
object.prototype = proto;
|
|
360
|
-
var result = new object();
|
|
361
|
-
object.prototype = void 0;
|
|
362
|
-
return result;
|
|
363
|
-
};
|
|
364
|
-
})();
|
|
365
|
-
var baseCreate_default = baseCreate;
|
|
366
|
-
|
|
367
|
-
// node_modules/lodash-es/_apply.js
|
|
368
|
-
function apply(func, thisArg, args) {
|
|
369
|
-
switch (args.length) {
|
|
370
|
-
case 0:
|
|
371
|
-
return func.call(thisArg);
|
|
372
|
-
case 1:
|
|
373
|
-
return func.call(thisArg, args[0]);
|
|
374
|
-
case 2:
|
|
375
|
-
return func.call(thisArg, args[0], args[1]);
|
|
376
|
-
case 3:
|
|
377
|
-
return func.call(thisArg, args[0], args[1], args[2]);
|
|
378
|
-
}
|
|
379
|
-
return func.apply(thisArg, args);
|
|
380
|
-
}
|
|
381
|
-
var apply_default = apply;
|
|
382
|
-
|
|
383
|
-
// node_modules/lodash-es/_copyArray.js
|
|
384
|
-
function copyArray(source, array) {
|
|
385
|
-
var index = -1, length = source.length;
|
|
386
|
-
array || (array = Array(length));
|
|
387
|
-
while (++index < length) {
|
|
388
|
-
array[index] = source[index];
|
|
389
|
-
}
|
|
390
|
-
return array;
|
|
391
|
-
}
|
|
392
|
-
var copyArray_default = copyArray;
|
|
393
|
-
|
|
394
|
-
// node_modules/lodash-es/_shortOut.js
|
|
395
|
-
var HOT_COUNT = 800;
|
|
396
|
-
var HOT_SPAN = 16;
|
|
397
|
-
var nativeNow = Date.now;
|
|
398
|
-
function shortOut(func) {
|
|
399
|
-
var count = 0, lastCalled = 0;
|
|
400
|
-
return function() {
|
|
401
|
-
var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
|
|
402
|
-
lastCalled = stamp;
|
|
403
|
-
if (remaining > 0) {
|
|
404
|
-
if (++count >= HOT_COUNT) {
|
|
405
|
-
return arguments[0];
|
|
406
|
-
}
|
|
407
|
-
} else {
|
|
408
|
-
count = 0;
|
|
409
|
-
}
|
|
410
|
-
return func.apply(void 0, arguments);
|
|
411
|
-
};
|
|
412
|
-
}
|
|
413
|
-
var shortOut_default = shortOut;
|
|
414
|
-
|
|
415
|
-
// node_modules/lodash-es/constant.js
|
|
416
|
-
function constant(value) {
|
|
417
|
-
return function() {
|
|
418
|
-
return value;
|
|
419
|
-
};
|
|
420
|
-
}
|
|
421
|
-
var constant_default = constant;
|
|
422
|
-
|
|
423
|
-
// node_modules/lodash-es/_defineProperty.js
|
|
424
|
-
var defineProperty = (function() {
|
|
425
|
-
try {
|
|
426
|
-
var func = getNative_default(Object, "defineProperty");
|
|
427
|
-
func({}, "", {});
|
|
428
|
-
return func;
|
|
429
|
-
} catch (e) {
|
|
430
|
-
}
|
|
431
|
-
})();
|
|
432
|
-
var defineProperty_default = defineProperty;
|
|
433
|
-
|
|
434
|
-
// node_modules/lodash-es/_baseSetToString.js
|
|
435
|
-
var baseSetToString = !defineProperty_default ? identity_default : function(func, string) {
|
|
436
|
-
return defineProperty_default(func, "toString", {
|
|
437
|
-
"configurable": true,
|
|
438
|
-
"enumerable": false,
|
|
439
|
-
"value": constant_default(string),
|
|
440
|
-
"writable": true
|
|
441
|
-
});
|
|
442
|
-
};
|
|
443
|
-
var baseSetToString_default = baseSetToString;
|
|
444
|
-
|
|
445
|
-
// node_modules/lodash-es/_setToString.js
|
|
446
|
-
var setToString = shortOut_default(baseSetToString_default);
|
|
447
|
-
var setToString_default = setToString;
|
|
448
|
-
|
|
449
|
-
// node_modules/lodash-es/_isIndex.js
|
|
450
|
-
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
451
|
-
var reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
452
|
-
function isIndex(value, length) {
|
|
453
|
-
var type = typeof value;
|
|
454
|
-
length = length == null ? MAX_SAFE_INTEGER : length;
|
|
455
|
-
return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
|
|
456
|
-
}
|
|
457
|
-
var isIndex_default = isIndex;
|
|
458
|
-
|
|
459
|
-
// node_modules/lodash-es/_baseAssignValue.js
|
|
460
|
-
function baseAssignValue(object, key, value) {
|
|
461
|
-
if (key == "__proto__" && defineProperty_default) {
|
|
462
|
-
defineProperty_default(object, key, {
|
|
463
|
-
"configurable": true,
|
|
464
|
-
"enumerable": true,
|
|
465
|
-
"value": value,
|
|
466
|
-
"writable": true
|
|
467
|
-
});
|
|
468
|
-
} else {
|
|
469
|
-
object[key] = value;
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
var baseAssignValue_default = baseAssignValue;
|
|
473
|
-
|
|
474
|
-
// node_modules/lodash-es/eq.js
|
|
475
|
-
function eq(value, other) {
|
|
476
|
-
return value === other || value !== value && other !== other;
|
|
477
|
-
}
|
|
478
|
-
var eq_default = eq;
|
|
479
|
-
|
|
480
|
-
// node_modules/lodash-es/_assignValue.js
|
|
481
|
-
var objectProto4 = Object.prototype;
|
|
482
|
-
var hasOwnProperty3 = objectProto4.hasOwnProperty;
|
|
483
|
-
function assignValue(object, key, value) {
|
|
484
|
-
var objValue = object[key];
|
|
485
|
-
if (!(hasOwnProperty3.call(object, key) && eq_default(objValue, value)) || value === void 0 && !(key in object)) {
|
|
486
|
-
baseAssignValue_default(object, key, value);
|
|
487
|
-
}
|
|
488
|
-
}
|
|
489
|
-
var assignValue_default = assignValue;
|
|
490
|
-
|
|
491
|
-
// node_modules/lodash-es/_copyObject.js
|
|
492
|
-
function copyObject(source, props, object, customizer) {
|
|
493
|
-
var isNew = !object;
|
|
494
|
-
object || (object = {});
|
|
495
|
-
var index = -1, length = props.length;
|
|
496
|
-
while (++index < length) {
|
|
497
|
-
var key = props[index];
|
|
498
|
-
var newValue = customizer ? customizer(object[key], source[key], key, object, source) : void 0;
|
|
499
|
-
if (newValue === void 0) {
|
|
500
|
-
newValue = source[key];
|
|
501
|
-
}
|
|
502
|
-
if (isNew) {
|
|
503
|
-
baseAssignValue_default(object, key, newValue);
|
|
504
|
-
} else {
|
|
505
|
-
assignValue_default(object, key, newValue);
|
|
506
|
-
}
|
|
507
|
-
}
|
|
508
|
-
return object;
|
|
509
|
-
}
|
|
510
|
-
var copyObject_default = copyObject;
|
|
511
|
-
|
|
512
|
-
// node_modules/lodash-es/_overRest.js
|
|
513
|
-
var nativeMax2 = Math.max;
|
|
514
|
-
function overRest(func, start, transform) {
|
|
515
|
-
start = nativeMax2(start === void 0 ? func.length - 1 : start, 0);
|
|
516
|
-
return function() {
|
|
517
|
-
var args = arguments, index = -1, length = nativeMax2(args.length - start, 0), array = Array(length);
|
|
518
|
-
while (++index < length) {
|
|
519
|
-
array[index] = args[start + index];
|
|
520
|
-
}
|
|
521
|
-
index = -1;
|
|
522
|
-
var otherArgs = Array(start + 1);
|
|
523
|
-
while (++index < start) {
|
|
524
|
-
otherArgs[index] = args[index];
|
|
525
|
-
}
|
|
526
|
-
otherArgs[start] = transform(array);
|
|
527
|
-
return apply_default(func, this, otherArgs);
|
|
528
|
-
};
|
|
529
|
-
}
|
|
530
|
-
var overRest_default = overRest;
|
|
531
|
-
|
|
532
|
-
// node_modules/lodash-es/_baseRest.js
|
|
533
|
-
function baseRest(func, start) {
|
|
534
|
-
return setToString_default(overRest_default(func, start, identity_default), func + "");
|
|
535
|
-
}
|
|
536
|
-
var baseRest_default = baseRest;
|
|
537
|
-
|
|
538
|
-
// node_modules/lodash-es/isLength.js
|
|
539
|
-
var MAX_SAFE_INTEGER2 = 9007199254740991;
|
|
540
|
-
function isLength(value) {
|
|
541
|
-
return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER2;
|
|
542
|
-
}
|
|
543
|
-
var isLength_default = isLength;
|
|
544
|
-
|
|
545
|
-
// node_modules/lodash-es/isArrayLike.js
|
|
546
|
-
function isArrayLike(value) {
|
|
547
|
-
return value != null && isLength_default(value.length) && !isFunction_default(value);
|
|
548
|
-
}
|
|
549
|
-
var isArrayLike_default = isArrayLike;
|
|
550
|
-
|
|
551
|
-
// node_modules/lodash-es/_isIterateeCall.js
|
|
552
|
-
function isIterateeCall(value, index, object) {
|
|
553
|
-
if (!isObject_default(object)) {
|
|
554
|
-
return false;
|
|
555
|
-
}
|
|
556
|
-
var type = typeof index;
|
|
557
|
-
if (type == "number" ? isArrayLike_default(object) && isIndex_default(index, object.length) : type == "string" && index in object) {
|
|
558
|
-
return eq_default(object[index], value);
|
|
559
|
-
}
|
|
560
|
-
return false;
|
|
561
|
-
}
|
|
562
|
-
var isIterateeCall_default = isIterateeCall;
|
|
563
|
-
|
|
564
|
-
// node_modules/lodash-es/_createAssigner.js
|
|
565
|
-
function createAssigner(assigner) {
|
|
566
|
-
return baseRest_default(function(object, sources) {
|
|
567
|
-
var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : void 0, guard = length > 2 ? sources[2] : void 0;
|
|
568
|
-
customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : void 0;
|
|
569
|
-
if (guard && isIterateeCall_default(sources[0], sources[1], guard)) {
|
|
570
|
-
customizer = length < 3 ? void 0 : customizer;
|
|
571
|
-
length = 1;
|
|
572
|
-
}
|
|
573
|
-
object = Object(object);
|
|
574
|
-
while (++index < length) {
|
|
575
|
-
var source = sources[index];
|
|
576
|
-
if (source) {
|
|
577
|
-
assigner(object, source, index, customizer);
|
|
578
|
-
}
|
|
579
|
-
}
|
|
580
|
-
return object;
|
|
581
|
-
});
|
|
582
|
-
}
|
|
583
|
-
var createAssigner_default = createAssigner;
|
|
584
|
-
|
|
585
|
-
// node_modules/lodash-es/_isPrototype.js
|
|
586
|
-
var objectProto5 = Object.prototype;
|
|
587
|
-
function isPrototype(value) {
|
|
588
|
-
var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto5;
|
|
589
|
-
return value === proto;
|
|
590
|
-
}
|
|
591
|
-
var isPrototype_default = isPrototype;
|
|
592
|
-
|
|
593
|
-
// node_modules/lodash-es/_baseTimes.js
|
|
594
|
-
function baseTimes(n, iteratee) {
|
|
595
|
-
var index = -1, result = Array(n);
|
|
596
|
-
while (++index < n) {
|
|
597
|
-
result[index] = iteratee(index);
|
|
598
|
-
}
|
|
599
|
-
return result;
|
|
600
|
-
}
|
|
601
|
-
var baseTimes_default = baseTimes;
|
|
602
|
-
|
|
603
|
-
// node_modules/lodash-es/_baseIsArguments.js
|
|
604
|
-
var argsTag = "[object Arguments]";
|
|
605
|
-
function baseIsArguments(value) {
|
|
606
|
-
return isObjectLike_default(value) && baseGetTag_default(value) == argsTag;
|
|
607
|
-
}
|
|
608
|
-
var baseIsArguments_default = baseIsArguments;
|
|
609
|
-
|
|
610
|
-
// node_modules/lodash-es/isArguments.js
|
|
611
|
-
var objectProto6 = Object.prototype;
|
|
612
|
-
var hasOwnProperty4 = objectProto6.hasOwnProperty;
|
|
613
|
-
var propertyIsEnumerable = objectProto6.propertyIsEnumerable;
|
|
614
|
-
var isArguments = baseIsArguments_default(/* @__PURE__ */ (function() {
|
|
615
|
-
return arguments;
|
|
616
|
-
})()) ? baseIsArguments_default : function(value) {
|
|
617
|
-
return isObjectLike_default(value) && hasOwnProperty4.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
|
|
618
|
-
};
|
|
619
|
-
var isArguments_default = isArguments;
|
|
620
|
-
|
|
621
|
-
// node_modules/lodash-es/stubFalse.js
|
|
622
|
-
function stubFalse() {
|
|
623
|
-
return false;
|
|
624
|
-
}
|
|
625
|
-
var stubFalse_default = stubFalse;
|
|
626
|
-
|
|
627
|
-
// node_modules/lodash-es/isBuffer.js
|
|
628
|
-
var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
|
|
629
|
-
var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
|
|
630
|
-
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
631
|
-
var Buffer = moduleExports ? root_default.Buffer : void 0;
|
|
632
|
-
var nativeIsBuffer = Buffer ? Buffer.isBuffer : void 0;
|
|
633
|
-
var isBuffer = nativeIsBuffer || stubFalse_default;
|
|
634
|
-
var isBuffer_default = isBuffer;
|
|
635
|
-
|
|
636
|
-
// node_modules/lodash-es/_baseIsTypedArray.js
|
|
637
|
-
var argsTag2 = "[object Arguments]";
|
|
638
|
-
var arrayTag = "[object Array]";
|
|
639
|
-
var boolTag = "[object Boolean]";
|
|
640
|
-
var dateTag = "[object Date]";
|
|
641
|
-
var errorTag = "[object Error]";
|
|
642
|
-
var funcTag2 = "[object Function]";
|
|
643
|
-
var mapTag = "[object Map]";
|
|
644
|
-
var numberTag = "[object Number]";
|
|
645
|
-
var objectTag = "[object Object]";
|
|
646
|
-
var regexpTag = "[object RegExp]";
|
|
647
|
-
var setTag = "[object Set]";
|
|
648
|
-
var stringTag = "[object String]";
|
|
649
|
-
var weakMapTag = "[object WeakMap]";
|
|
650
|
-
var arrayBufferTag = "[object ArrayBuffer]";
|
|
651
|
-
var dataViewTag = "[object DataView]";
|
|
652
|
-
var float32Tag = "[object Float32Array]";
|
|
653
|
-
var float64Tag = "[object Float64Array]";
|
|
654
|
-
var int8Tag = "[object Int8Array]";
|
|
655
|
-
var int16Tag = "[object Int16Array]";
|
|
656
|
-
var int32Tag = "[object Int32Array]";
|
|
657
|
-
var uint8Tag = "[object Uint8Array]";
|
|
658
|
-
var uint8ClampedTag = "[object Uint8ClampedArray]";
|
|
659
|
-
var uint16Tag = "[object Uint16Array]";
|
|
660
|
-
var uint32Tag = "[object Uint32Array]";
|
|
661
|
-
var typedArrayTags = {};
|
|
662
|
-
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
|
|
663
|
-
typedArrayTags[argsTag2] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag2] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
|
|
664
|
-
function baseIsTypedArray(value) {
|
|
665
|
-
return isObjectLike_default(value) && isLength_default(value.length) && !!typedArrayTags[baseGetTag_default(value)];
|
|
666
|
-
}
|
|
667
|
-
var baseIsTypedArray_default = baseIsTypedArray;
|
|
668
|
-
|
|
669
|
-
// node_modules/lodash-es/_baseUnary.js
|
|
670
|
-
function baseUnary(func) {
|
|
671
|
-
return function(value) {
|
|
672
|
-
return func(value);
|
|
673
|
-
};
|
|
674
|
-
}
|
|
675
|
-
var baseUnary_default = baseUnary;
|
|
676
|
-
|
|
677
|
-
// node_modules/lodash-es/_nodeUtil.js
|
|
678
|
-
var freeExports2 = typeof exports == "object" && exports && !exports.nodeType && exports;
|
|
679
|
-
var freeModule2 = freeExports2 && typeof module == "object" && module && !module.nodeType && module;
|
|
680
|
-
var moduleExports2 = freeModule2 && freeModule2.exports === freeExports2;
|
|
681
|
-
var freeProcess = moduleExports2 && freeGlobal_default.process;
|
|
682
|
-
var nodeUtil = (function() {
|
|
683
|
-
try {
|
|
684
|
-
var types = freeModule2 && freeModule2.require && freeModule2.require("util").types;
|
|
685
|
-
if (types) {
|
|
686
|
-
return types;
|
|
687
|
-
}
|
|
688
|
-
return freeProcess && freeProcess.binding && freeProcess.binding("util");
|
|
689
|
-
} catch (e) {
|
|
690
|
-
}
|
|
691
|
-
})();
|
|
692
|
-
var nodeUtil_default = nodeUtil;
|
|
693
|
-
|
|
694
|
-
// node_modules/lodash-es/isTypedArray.js
|
|
695
|
-
var nodeIsTypedArray = nodeUtil_default && nodeUtil_default.isTypedArray;
|
|
696
|
-
var isTypedArray = nodeIsTypedArray ? baseUnary_default(nodeIsTypedArray) : baseIsTypedArray_default;
|
|
697
|
-
var isTypedArray_default = isTypedArray;
|
|
698
|
-
|
|
699
|
-
// node_modules/lodash-es/_arrayLikeKeys.js
|
|
700
|
-
var objectProto7 = Object.prototype;
|
|
701
|
-
var hasOwnProperty5 = objectProto7.hasOwnProperty;
|
|
702
|
-
function arrayLikeKeys(value, inherited) {
|
|
703
|
-
var isArr = isArray_default(value), isArg = !isArr && isArguments_default(value), isBuff = !isArr && !isArg && isBuffer_default(value), isType = !isArr && !isArg && !isBuff && isTypedArray_default(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes_default(value.length, String) : [], length = result.length;
|
|
704
|
-
for (var key in value) {
|
|
705
|
-
if ((inherited || hasOwnProperty5.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
706
|
-
(key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
707
|
-
isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
708
|
-
isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
|
|
709
|
-
isIndex_default(key, length)))) {
|
|
710
|
-
result.push(key);
|
|
711
|
-
}
|
|
712
|
-
}
|
|
713
|
-
return result;
|
|
714
|
-
}
|
|
715
|
-
var arrayLikeKeys_default = arrayLikeKeys;
|
|
716
|
-
|
|
717
|
-
// node_modules/lodash-es/_overArg.js
|
|
718
|
-
function overArg(func, transform) {
|
|
719
|
-
return function(arg) {
|
|
720
|
-
return func(transform(arg));
|
|
721
|
-
};
|
|
722
|
-
}
|
|
723
|
-
var overArg_default = overArg;
|
|
724
|
-
|
|
725
|
-
// node_modules/lodash-es/_nativeKeysIn.js
|
|
726
|
-
function nativeKeysIn(object) {
|
|
727
|
-
var result = [];
|
|
728
|
-
if (object != null) {
|
|
729
|
-
for (var key in Object(object)) {
|
|
730
|
-
result.push(key);
|
|
731
|
-
}
|
|
732
|
-
}
|
|
733
|
-
return result;
|
|
734
|
-
}
|
|
735
|
-
var nativeKeysIn_default = nativeKeysIn;
|
|
736
|
-
|
|
737
|
-
// node_modules/lodash-es/_baseKeysIn.js
|
|
738
|
-
var objectProto8 = Object.prototype;
|
|
739
|
-
var hasOwnProperty6 = objectProto8.hasOwnProperty;
|
|
740
|
-
function baseKeysIn(object) {
|
|
741
|
-
if (!isObject_default(object)) {
|
|
742
|
-
return nativeKeysIn_default(object);
|
|
743
|
-
}
|
|
744
|
-
var isProto = isPrototype_default(object), result = [];
|
|
745
|
-
for (var key in object) {
|
|
746
|
-
if (!(key == "constructor" && (isProto || !hasOwnProperty6.call(object, key)))) {
|
|
747
|
-
result.push(key);
|
|
748
|
-
}
|
|
749
|
-
}
|
|
750
|
-
return result;
|
|
751
|
-
}
|
|
752
|
-
var baseKeysIn_default = baseKeysIn;
|
|
753
|
-
|
|
754
|
-
// node_modules/lodash-es/keysIn.js
|
|
755
|
-
function keysIn(object) {
|
|
756
|
-
return isArrayLike_default(object) ? arrayLikeKeys_default(object, true) : baseKeysIn_default(object);
|
|
757
|
-
}
|
|
758
|
-
var keysIn_default = keysIn;
|
|
759
|
-
|
|
760
|
-
// node_modules/lodash-es/_nativeCreate.js
|
|
761
|
-
var nativeCreate = getNative_default(Object, "create");
|
|
762
|
-
var nativeCreate_default = nativeCreate;
|
|
763
|
-
|
|
764
|
-
// node_modules/lodash-es/_hashClear.js
|
|
765
|
-
function hashClear() {
|
|
766
|
-
this.__data__ = nativeCreate_default ? nativeCreate_default(null) : {};
|
|
767
|
-
this.size = 0;
|
|
768
|
-
}
|
|
769
|
-
var hashClear_default = hashClear;
|
|
770
|
-
|
|
771
|
-
// node_modules/lodash-es/_hashDelete.js
|
|
772
|
-
function hashDelete(key) {
|
|
773
|
-
var result = this.has(key) && delete this.__data__[key];
|
|
774
|
-
this.size -= result ? 1 : 0;
|
|
775
|
-
return result;
|
|
776
|
-
}
|
|
777
|
-
var hashDelete_default = hashDelete;
|
|
778
|
-
|
|
779
|
-
// node_modules/lodash-es/_hashGet.js
|
|
780
|
-
var HASH_UNDEFINED = "__lodash_hash_undefined__";
|
|
781
|
-
var objectProto9 = Object.prototype;
|
|
782
|
-
var hasOwnProperty7 = objectProto9.hasOwnProperty;
|
|
783
|
-
function hashGet(key) {
|
|
784
|
-
var data = this.__data__;
|
|
785
|
-
if (nativeCreate_default) {
|
|
786
|
-
var result = data[key];
|
|
787
|
-
return result === HASH_UNDEFINED ? void 0 : result;
|
|
788
|
-
}
|
|
789
|
-
return hasOwnProperty7.call(data, key) ? data[key] : void 0;
|
|
790
|
-
}
|
|
791
|
-
var hashGet_default = hashGet;
|
|
792
|
-
|
|
793
|
-
// node_modules/lodash-es/_hashHas.js
|
|
794
|
-
var objectProto10 = Object.prototype;
|
|
795
|
-
var hasOwnProperty8 = objectProto10.hasOwnProperty;
|
|
796
|
-
function hashHas(key) {
|
|
797
|
-
var data = this.__data__;
|
|
798
|
-
return nativeCreate_default ? data[key] !== void 0 : hasOwnProperty8.call(data, key);
|
|
799
|
-
}
|
|
800
|
-
var hashHas_default = hashHas;
|
|
801
|
-
|
|
802
|
-
// node_modules/lodash-es/_hashSet.js
|
|
803
|
-
var HASH_UNDEFINED2 = "__lodash_hash_undefined__";
|
|
804
|
-
function hashSet(key, value) {
|
|
805
|
-
var data = this.__data__;
|
|
806
|
-
this.size += this.has(key) ? 0 : 1;
|
|
807
|
-
data[key] = nativeCreate_default && value === void 0 ? HASH_UNDEFINED2 : value;
|
|
808
|
-
return this;
|
|
809
|
-
}
|
|
810
|
-
var hashSet_default = hashSet;
|
|
811
|
-
|
|
812
|
-
// node_modules/lodash-es/_Hash.js
|
|
813
|
-
function Hash(entries) {
|
|
814
|
-
var index = -1, length = entries == null ? 0 : entries.length;
|
|
815
|
-
this.clear();
|
|
816
|
-
while (++index < length) {
|
|
817
|
-
var entry = entries[index];
|
|
818
|
-
this.set(entry[0], entry[1]);
|
|
819
|
-
}
|
|
820
|
-
}
|
|
821
|
-
Hash.prototype.clear = hashClear_default;
|
|
822
|
-
Hash.prototype["delete"] = hashDelete_default;
|
|
823
|
-
Hash.prototype.get = hashGet_default;
|
|
824
|
-
Hash.prototype.has = hashHas_default;
|
|
825
|
-
Hash.prototype.set = hashSet_default;
|
|
826
|
-
var Hash_default = Hash;
|
|
827
|
-
|
|
828
|
-
// node_modules/lodash-es/_listCacheClear.js
|
|
829
|
-
function listCacheClear() {
|
|
830
|
-
this.__data__ = [];
|
|
831
|
-
this.size = 0;
|
|
832
|
-
}
|
|
833
|
-
var listCacheClear_default = listCacheClear;
|
|
834
|
-
|
|
835
|
-
// node_modules/lodash-es/_assocIndexOf.js
|
|
836
|
-
function assocIndexOf(array, key) {
|
|
837
|
-
var length = array.length;
|
|
838
|
-
while (length--) {
|
|
839
|
-
if (eq_default(array[length][0], key)) {
|
|
840
|
-
return length;
|
|
841
|
-
}
|
|
842
|
-
}
|
|
843
|
-
return -1;
|
|
844
|
-
}
|
|
845
|
-
var assocIndexOf_default = assocIndexOf;
|
|
846
|
-
|
|
847
|
-
// node_modules/lodash-es/_listCacheDelete.js
|
|
848
|
-
var arrayProto = Array.prototype;
|
|
849
|
-
var splice = arrayProto.splice;
|
|
850
|
-
function listCacheDelete(key) {
|
|
851
|
-
var data = this.__data__, index = assocIndexOf_default(data, key);
|
|
852
|
-
if (index < 0) {
|
|
853
|
-
return false;
|
|
854
|
-
}
|
|
855
|
-
var lastIndex = data.length - 1;
|
|
856
|
-
if (index == lastIndex) {
|
|
857
|
-
data.pop();
|
|
858
|
-
} else {
|
|
859
|
-
splice.call(data, index, 1);
|
|
860
|
-
}
|
|
861
|
-
--this.size;
|
|
862
|
-
return true;
|
|
863
|
-
}
|
|
864
|
-
var listCacheDelete_default = listCacheDelete;
|
|
865
|
-
|
|
866
|
-
// node_modules/lodash-es/_listCacheGet.js
|
|
867
|
-
function listCacheGet(key) {
|
|
868
|
-
var data = this.__data__, index = assocIndexOf_default(data, key);
|
|
869
|
-
return index < 0 ? void 0 : data[index][1];
|
|
870
|
-
}
|
|
871
|
-
var listCacheGet_default = listCacheGet;
|
|
872
|
-
|
|
873
|
-
// node_modules/lodash-es/_listCacheHas.js
|
|
874
|
-
function listCacheHas(key) {
|
|
875
|
-
return assocIndexOf_default(this.__data__, key) > -1;
|
|
876
|
-
}
|
|
877
|
-
var listCacheHas_default = listCacheHas;
|
|
878
|
-
|
|
879
|
-
// node_modules/lodash-es/_listCacheSet.js
|
|
880
|
-
function listCacheSet(key, value) {
|
|
881
|
-
var data = this.__data__, index = assocIndexOf_default(data, key);
|
|
882
|
-
if (index < 0) {
|
|
883
|
-
++this.size;
|
|
884
|
-
data.push([key, value]);
|
|
885
|
-
} else {
|
|
886
|
-
data[index][1] = value;
|
|
887
|
-
}
|
|
888
|
-
return this;
|
|
889
|
-
}
|
|
890
|
-
var listCacheSet_default = listCacheSet;
|
|
891
|
-
|
|
892
|
-
// node_modules/lodash-es/_ListCache.js
|
|
893
|
-
function ListCache(entries) {
|
|
894
|
-
var index = -1, length = entries == null ? 0 : entries.length;
|
|
895
|
-
this.clear();
|
|
896
|
-
while (++index < length) {
|
|
897
|
-
var entry = entries[index];
|
|
898
|
-
this.set(entry[0], entry[1]);
|
|
899
|
-
}
|
|
900
|
-
}
|
|
901
|
-
ListCache.prototype.clear = listCacheClear_default;
|
|
902
|
-
ListCache.prototype["delete"] = listCacheDelete_default;
|
|
903
|
-
ListCache.prototype.get = listCacheGet_default;
|
|
904
|
-
ListCache.prototype.has = listCacheHas_default;
|
|
905
|
-
ListCache.prototype.set = listCacheSet_default;
|
|
906
|
-
var ListCache_default = ListCache;
|
|
907
|
-
|
|
908
|
-
// node_modules/lodash-es/_Map.js
|
|
909
|
-
var Map2 = getNative_default(root_default, "Map");
|
|
910
|
-
var Map_default = Map2;
|
|
911
|
-
|
|
912
|
-
// node_modules/lodash-es/_mapCacheClear.js
|
|
913
|
-
function mapCacheClear() {
|
|
914
|
-
this.size = 0;
|
|
915
|
-
this.__data__ = {
|
|
916
|
-
"hash": new Hash_default(),
|
|
917
|
-
"map": new (Map_default || ListCache_default)(),
|
|
918
|
-
"string": new Hash_default()
|
|
919
|
-
};
|
|
920
|
-
}
|
|
921
|
-
var mapCacheClear_default = mapCacheClear;
|
|
922
|
-
|
|
923
|
-
// node_modules/lodash-es/_isKeyable.js
|
|
924
|
-
function isKeyable(value) {
|
|
925
|
-
var type = typeof value;
|
|
926
|
-
return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
|
|
927
|
-
}
|
|
928
|
-
var isKeyable_default = isKeyable;
|
|
929
|
-
|
|
930
|
-
// node_modules/lodash-es/_getMapData.js
|
|
931
|
-
function getMapData(map, key) {
|
|
932
|
-
var data = map.__data__;
|
|
933
|
-
return isKeyable_default(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
|
|
934
|
-
}
|
|
935
|
-
var getMapData_default = getMapData;
|
|
936
|
-
|
|
937
|
-
// node_modules/lodash-es/_mapCacheDelete.js
|
|
938
|
-
function mapCacheDelete(key) {
|
|
939
|
-
var result = getMapData_default(this, key)["delete"](key);
|
|
940
|
-
this.size -= result ? 1 : 0;
|
|
941
|
-
return result;
|
|
942
|
-
}
|
|
943
|
-
var mapCacheDelete_default = mapCacheDelete;
|
|
944
|
-
|
|
945
|
-
// node_modules/lodash-es/_mapCacheGet.js
|
|
946
|
-
function mapCacheGet(key) {
|
|
947
|
-
return getMapData_default(this, key).get(key);
|
|
948
|
-
}
|
|
949
|
-
var mapCacheGet_default = mapCacheGet;
|
|
950
|
-
|
|
951
|
-
// node_modules/lodash-es/_mapCacheHas.js
|
|
952
|
-
function mapCacheHas(key) {
|
|
953
|
-
return getMapData_default(this, key).has(key);
|
|
954
|
-
}
|
|
955
|
-
var mapCacheHas_default = mapCacheHas;
|
|
956
|
-
|
|
957
|
-
// node_modules/lodash-es/_mapCacheSet.js
|
|
958
|
-
function mapCacheSet(key, value) {
|
|
959
|
-
var data = getMapData_default(this, key), size = data.size;
|
|
960
|
-
data.set(key, value);
|
|
961
|
-
this.size += data.size == size ? 0 : 1;
|
|
962
|
-
return this;
|
|
963
|
-
}
|
|
964
|
-
var mapCacheSet_default = mapCacheSet;
|
|
965
|
-
|
|
966
|
-
// node_modules/lodash-es/_MapCache.js
|
|
967
|
-
function MapCache(entries) {
|
|
968
|
-
var index = -1, length = entries == null ? 0 : entries.length;
|
|
969
|
-
this.clear();
|
|
970
|
-
while (++index < length) {
|
|
971
|
-
var entry = entries[index];
|
|
972
|
-
this.set(entry[0], entry[1]);
|
|
973
|
-
}
|
|
974
|
-
}
|
|
975
|
-
MapCache.prototype.clear = mapCacheClear_default;
|
|
976
|
-
MapCache.prototype["delete"] = mapCacheDelete_default;
|
|
977
|
-
MapCache.prototype.get = mapCacheGet_default;
|
|
978
|
-
MapCache.prototype.has = mapCacheHas_default;
|
|
979
|
-
MapCache.prototype.set = mapCacheSet_default;
|
|
980
|
-
var MapCache_default = MapCache;
|
|
981
|
-
|
|
982
|
-
// node_modules/lodash-es/_getPrototype.js
|
|
983
|
-
var getPrototype = overArg_default(Object.getPrototypeOf, Object);
|
|
984
|
-
var getPrototype_default = getPrototype;
|
|
985
|
-
|
|
986
|
-
// node_modules/lodash-es/isPlainObject.js
|
|
987
|
-
var objectTag2 = "[object Object]";
|
|
988
|
-
var funcProto3 = Function.prototype;
|
|
989
|
-
var objectProto11 = Object.prototype;
|
|
990
|
-
var funcToString3 = funcProto3.toString;
|
|
991
|
-
var hasOwnProperty9 = objectProto11.hasOwnProperty;
|
|
992
|
-
var objectCtorString = funcToString3.call(Object);
|
|
993
|
-
function isPlainObject(value) {
|
|
994
|
-
if (!isObjectLike_default(value) || baseGetTag_default(value) != objectTag2) {
|
|
995
|
-
return false;
|
|
996
|
-
}
|
|
997
|
-
var proto = getPrototype_default(value);
|
|
998
|
-
if (proto === null) {
|
|
999
|
-
return true;
|
|
1000
|
-
}
|
|
1001
|
-
var Ctor = hasOwnProperty9.call(proto, "constructor") && proto.constructor;
|
|
1002
|
-
return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString3.call(Ctor) == objectCtorString;
|
|
1003
|
-
}
|
|
1004
|
-
var isPlainObject_default = isPlainObject;
|
|
1005
|
-
|
|
1006
|
-
// node_modules/lodash-es/_stackClear.js
|
|
1007
|
-
function stackClear() {
|
|
1008
|
-
this.__data__ = new ListCache_default();
|
|
1009
|
-
this.size = 0;
|
|
1010
|
-
}
|
|
1011
|
-
var stackClear_default = stackClear;
|
|
1012
|
-
|
|
1013
|
-
// node_modules/lodash-es/_stackDelete.js
|
|
1014
|
-
function stackDelete(key) {
|
|
1015
|
-
var data = this.__data__, result = data["delete"](key);
|
|
1016
|
-
this.size = data.size;
|
|
1017
|
-
return result;
|
|
1018
|
-
}
|
|
1019
|
-
var stackDelete_default = stackDelete;
|
|
1020
|
-
|
|
1021
|
-
// node_modules/lodash-es/_stackGet.js
|
|
1022
|
-
function stackGet(key) {
|
|
1023
|
-
return this.__data__.get(key);
|
|
1024
|
-
}
|
|
1025
|
-
var stackGet_default = stackGet;
|
|
1026
|
-
|
|
1027
|
-
// node_modules/lodash-es/_stackHas.js
|
|
1028
|
-
function stackHas(key) {
|
|
1029
|
-
return this.__data__.has(key);
|
|
1030
|
-
}
|
|
1031
|
-
var stackHas_default = stackHas;
|
|
1032
|
-
|
|
1033
|
-
// node_modules/lodash-es/_stackSet.js
|
|
1034
|
-
var LARGE_ARRAY_SIZE = 200;
|
|
1035
|
-
function stackSet(key, value) {
|
|
1036
|
-
var data = this.__data__;
|
|
1037
|
-
if (data instanceof ListCache_default) {
|
|
1038
|
-
var pairs = data.__data__;
|
|
1039
|
-
if (!Map_default || pairs.length < LARGE_ARRAY_SIZE - 1) {
|
|
1040
|
-
pairs.push([key, value]);
|
|
1041
|
-
this.size = ++data.size;
|
|
1042
|
-
return this;
|
|
1043
|
-
}
|
|
1044
|
-
data = this.__data__ = new MapCache_default(pairs);
|
|
1045
|
-
}
|
|
1046
|
-
data.set(key, value);
|
|
1047
|
-
this.size = data.size;
|
|
1048
|
-
return this;
|
|
1049
|
-
}
|
|
1050
|
-
var stackSet_default = stackSet;
|
|
1051
|
-
|
|
1052
|
-
// node_modules/lodash-es/_Stack.js
|
|
1053
|
-
function Stack(entries) {
|
|
1054
|
-
var data = this.__data__ = new ListCache_default(entries);
|
|
1055
|
-
this.size = data.size;
|
|
1056
|
-
}
|
|
1057
|
-
Stack.prototype.clear = stackClear_default;
|
|
1058
|
-
Stack.prototype["delete"] = stackDelete_default;
|
|
1059
|
-
Stack.prototype.get = stackGet_default;
|
|
1060
|
-
Stack.prototype.has = stackHas_default;
|
|
1061
|
-
Stack.prototype.set = stackSet_default;
|
|
1062
|
-
var Stack_default = Stack;
|
|
1063
|
-
|
|
1064
|
-
// node_modules/lodash-es/_cloneBuffer.js
|
|
1065
|
-
var freeExports3 = typeof exports == "object" && exports && !exports.nodeType && exports;
|
|
1066
|
-
var freeModule3 = freeExports3 && typeof module == "object" && module && !module.nodeType && module;
|
|
1067
|
-
var moduleExports3 = freeModule3 && freeModule3.exports === freeExports3;
|
|
1068
|
-
var Buffer2 = moduleExports3 ? root_default.Buffer : void 0;
|
|
1069
|
-
var allocUnsafe = Buffer2 ? Buffer2.allocUnsafe : void 0;
|
|
1070
|
-
function cloneBuffer(buffer, isDeep) {
|
|
1071
|
-
if (isDeep) {
|
|
1072
|
-
return buffer.slice();
|
|
1073
|
-
}
|
|
1074
|
-
var length = buffer.length, result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
|
|
1075
|
-
buffer.copy(result);
|
|
1076
|
-
return result;
|
|
1077
|
-
}
|
|
1078
|
-
var cloneBuffer_default = cloneBuffer;
|
|
1079
|
-
|
|
1080
|
-
// node_modules/lodash-es/_Uint8Array.js
|
|
1081
|
-
var Uint8Array = root_default.Uint8Array;
|
|
1082
|
-
var Uint8Array_default = Uint8Array;
|
|
1083
|
-
|
|
1084
|
-
// node_modules/lodash-es/_cloneArrayBuffer.js
|
|
1085
|
-
function cloneArrayBuffer(arrayBuffer) {
|
|
1086
|
-
var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
|
|
1087
|
-
new Uint8Array_default(result).set(new Uint8Array_default(arrayBuffer));
|
|
1088
|
-
return result;
|
|
1089
|
-
}
|
|
1090
|
-
var cloneArrayBuffer_default = cloneArrayBuffer;
|
|
1091
|
-
|
|
1092
|
-
// node_modules/lodash-es/_cloneTypedArray.js
|
|
1093
|
-
function cloneTypedArray(typedArray, isDeep) {
|
|
1094
|
-
var buffer = isDeep ? cloneArrayBuffer_default(typedArray.buffer) : typedArray.buffer;
|
|
1095
|
-
return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
|
|
1096
|
-
}
|
|
1097
|
-
var cloneTypedArray_default = cloneTypedArray;
|
|
1098
|
-
|
|
1099
|
-
// node_modules/lodash-es/_initCloneObject.js
|
|
1100
|
-
function initCloneObject(object) {
|
|
1101
|
-
return typeof object.constructor == "function" && !isPrototype_default(object) ? baseCreate_default(getPrototype_default(object)) : {};
|
|
1102
|
-
}
|
|
1103
|
-
var initCloneObject_default = initCloneObject;
|
|
1104
|
-
|
|
1105
|
-
// node_modules/lodash-es/_createBaseFor.js
|
|
1106
|
-
function createBaseFor(fromRight) {
|
|
1107
|
-
return function(object, iteratee, keysFunc) {
|
|
1108
|
-
var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length;
|
|
1109
|
-
while (length--) {
|
|
1110
|
-
var key = props[fromRight ? length : ++index];
|
|
1111
|
-
if (iteratee(iterable[key], key, iterable) === false) {
|
|
1112
|
-
break;
|
|
1113
|
-
}
|
|
1114
|
-
}
|
|
1115
|
-
return object;
|
|
1116
|
-
};
|
|
1117
|
-
}
|
|
1118
|
-
var createBaseFor_default = createBaseFor;
|
|
1119
|
-
|
|
1120
|
-
// node_modules/lodash-es/_baseFor.js
|
|
1121
|
-
var baseFor = createBaseFor_default();
|
|
1122
|
-
var baseFor_default = baseFor;
|
|
1123
|
-
|
|
1124
|
-
// node_modules/lodash-es/_assignMergeValue.js
|
|
1125
|
-
function assignMergeValue(object, key, value) {
|
|
1126
|
-
if (value !== void 0 && !eq_default(object[key], value) || value === void 0 && !(key in object)) {
|
|
1127
|
-
baseAssignValue_default(object, key, value);
|
|
1128
|
-
}
|
|
1129
|
-
}
|
|
1130
|
-
var assignMergeValue_default = assignMergeValue;
|
|
1131
|
-
|
|
1132
|
-
// node_modules/lodash-es/isArrayLikeObject.js
|
|
1133
|
-
function isArrayLikeObject(value) {
|
|
1134
|
-
return isObjectLike_default(value) && isArrayLike_default(value);
|
|
1135
|
-
}
|
|
1136
|
-
var isArrayLikeObject_default = isArrayLikeObject;
|
|
1137
|
-
|
|
1138
|
-
// node_modules/lodash-es/_safeGet.js
|
|
1139
|
-
function safeGet(object, key) {
|
|
1140
|
-
if (key === "constructor" && typeof object[key] === "function") {
|
|
1141
|
-
return;
|
|
1142
|
-
}
|
|
1143
|
-
if (key == "__proto__") {
|
|
1144
|
-
return;
|
|
1145
|
-
}
|
|
1146
|
-
return object[key];
|
|
1147
|
-
}
|
|
1148
|
-
var safeGet_default = safeGet;
|
|
1149
|
-
|
|
1150
|
-
// node_modules/lodash-es/toPlainObject.js
|
|
1151
|
-
function toPlainObject(value) {
|
|
1152
|
-
return copyObject_default(value, keysIn_default(value));
|
|
1153
|
-
}
|
|
1154
|
-
var toPlainObject_default = toPlainObject;
|
|
1155
|
-
|
|
1156
|
-
// node_modules/lodash-es/_baseMergeDeep.js
|
|
1157
|
-
function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
|
|
1158
|
-
var objValue = safeGet_default(object, key), srcValue = safeGet_default(source, key), stacked = stack.get(srcValue);
|
|
1159
|
-
if (stacked) {
|
|
1160
|
-
assignMergeValue_default(object, key, stacked);
|
|
1161
|
-
return;
|
|
1162
|
-
}
|
|
1163
|
-
var newValue = customizer ? customizer(objValue, srcValue, key + "", object, source, stack) : void 0;
|
|
1164
|
-
var isCommon = newValue === void 0;
|
|
1165
|
-
if (isCommon) {
|
|
1166
|
-
var isArr = isArray_default(srcValue), isBuff = !isArr && isBuffer_default(srcValue), isTyped = !isArr && !isBuff && isTypedArray_default(srcValue);
|
|
1167
|
-
newValue = srcValue;
|
|
1168
|
-
if (isArr || isBuff || isTyped) {
|
|
1169
|
-
if (isArray_default(objValue)) {
|
|
1170
|
-
newValue = objValue;
|
|
1171
|
-
} else if (isArrayLikeObject_default(objValue)) {
|
|
1172
|
-
newValue = copyArray_default(objValue);
|
|
1173
|
-
} else if (isBuff) {
|
|
1174
|
-
isCommon = false;
|
|
1175
|
-
newValue = cloneBuffer_default(srcValue, true);
|
|
1176
|
-
} else if (isTyped) {
|
|
1177
|
-
isCommon = false;
|
|
1178
|
-
newValue = cloneTypedArray_default(srcValue, true);
|
|
1179
|
-
} else {
|
|
1180
|
-
newValue = [];
|
|
1181
|
-
}
|
|
1182
|
-
} else if (isPlainObject_default(srcValue) || isArguments_default(srcValue)) {
|
|
1183
|
-
newValue = objValue;
|
|
1184
|
-
if (isArguments_default(objValue)) {
|
|
1185
|
-
newValue = toPlainObject_default(objValue);
|
|
1186
|
-
} else if (!isObject_default(objValue) || isFunction_default(objValue)) {
|
|
1187
|
-
newValue = initCloneObject_default(srcValue);
|
|
1188
|
-
}
|
|
1189
|
-
} else {
|
|
1190
|
-
isCommon = false;
|
|
1191
|
-
}
|
|
1192
|
-
}
|
|
1193
|
-
if (isCommon) {
|
|
1194
|
-
stack.set(srcValue, newValue);
|
|
1195
|
-
mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
|
|
1196
|
-
stack["delete"](srcValue);
|
|
1197
|
-
}
|
|
1198
|
-
assignMergeValue_default(object, key, newValue);
|
|
1199
|
-
}
|
|
1200
|
-
var baseMergeDeep_default = baseMergeDeep;
|
|
1201
|
-
|
|
1202
|
-
// node_modules/lodash-es/_baseMerge.js
|
|
1203
|
-
function baseMerge(object, source, srcIndex, customizer, stack) {
|
|
1204
|
-
if (object === source) {
|
|
1205
|
-
return;
|
|
1206
|
-
}
|
|
1207
|
-
baseFor_default(source, function(srcValue, key) {
|
|
1208
|
-
stack || (stack = new Stack_default());
|
|
1209
|
-
if (isObject_default(srcValue)) {
|
|
1210
|
-
baseMergeDeep_default(object, source, key, srcIndex, baseMerge, customizer, stack);
|
|
1211
|
-
} else {
|
|
1212
|
-
var newValue = customizer ? customizer(safeGet_default(object, key), srcValue, key + "", object, source, stack) : void 0;
|
|
1213
|
-
if (newValue === void 0) {
|
|
1214
|
-
newValue = srcValue;
|
|
1215
|
-
}
|
|
1216
|
-
assignMergeValue_default(object, key, newValue);
|
|
1217
|
-
}
|
|
1218
|
-
}, keysIn_default);
|
|
1219
|
-
}
|
|
1220
|
-
var baseMerge_default = baseMerge;
|
|
1221
|
-
|
|
1222
|
-
// node_modules/lodash-es/merge.js
|
|
1223
|
-
var merge = createAssigner_default(function(object, source, srcIndex) {
|
|
1224
|
-
baseMerge_default(object, source, srcIndex);
|
|
1225
|
-
});
|
|
1226
|
-
var merge_default = merge;
|
|
1227
|
-
|
|
1228
259
|
// src/utils/promise.ts
|
|
1229
260
|
function sleep(ms) {
|
|
1230
261
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
@@ -1235,15 +266,30 @@ var SignalBroker = class _SignalBroker {
|
|
|
1235
266
|
constructor() {
|
|
1236
267
|
this.debug = false;
|
|
1237
268
|
this.verbose = false;
|
|
1238
|
-
this.debouncedEmitters = /* @__PURE__ */ new Map();
|
|
1239
|
-
this.squashedEmitters = /* @__PURE__ */ new Map();
|
|
1240
|
-
this.squashedContexts = /* @__PURE__ */ new Map();
|
|
1241
269
|
this.throttleEmitters = /* @__PURE__ */ new Map();
|
|
1242
270
|
this.throttleQueues = /* @__PURE__ */ new Map();
|
|
1243
271
|
// TODO: Signals should be a class with a the observers, registered flag and other data.
|
|
1244
272
|
this.signalObservers = /* @__PURE__ */ new Map();
|
|
1245
273
|
this.emittedSignalsRegistry = /* @__PURE__ */ new Set();
|
|
274
|
+
// ── Flush Strategy Management ───────────────────────────────────────
|
|
275
|
+
this.flushStrategies = /* @__PURE__ */ new Map();
|
|
276
|
+
this.strategyData = /* @__PURE__ */ new Map();
|
|
277
|
+
this.strategyTimers = /* @__PURE__ */ new Map();
|
|
278
|
+
this.isStrategyFlushing = /* @__PURE__ */ new Map();
|
|
279
|
+
this.defaultStrategyName = "default";
|
|
280
|
+
// ── Squash (Multi-strategy) ─────────────────────────────────────────
|
|
281
|
+
this.MAX_FLUSH_DURATION_MS = 120;
|
|
282
|
+
// ── Schedule (Bucketed) ─────────────────────────────────────────────
|
|
283
|
+
this.scheduledBuckets = /* @__PURE__ */ new Map();
|
|
284
|
+
this.scheduleTimer = null;
|
|
285
|
+
// ── Debounce (with cap) ─────────────────────────────────────────────
|
|
286
|
+
this.debouncedEmitters = /* @__PURE__ */ new Map();
|
|
287
|
+
this.MAX_DEBOUNCERS = 5e3;
|
|
1246
288
|
this.addSignal("meta.signal_broker.added");
|
|
289
|
+
this.setFlushStrategy(this.defaultStrategyName, {
|
|
290
|
+
intervalMs: 350,
|
|
291
|
+
maxBatchSize: 80
|
|
292
|
+
});
|
|
1247
293
|
}
|
|
1248
294
|
static get instance() {
|
|
1249
295
|
if (!this.instance_) {
|
|
@@ -1330,57 +376,224 @@ var SignalBroker = class _SignalBroker {
|
|
|
1330
376
|
}
|
|
1331
377
|
).doOn("meta.signal.registered");
|
|
1332
378
|
}
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
this.
|
|
379
|
+
setFlushStrategy(name, config) {
|
|
380
|
+
if (config.intervalMs < 50) {
|
|
381
|
+
throw new Error("intervalMs must be >= 50ms for performance reasons");
|
|
382
|
+
}
|
|
383
|
+
this.flushStrategies.set(name, {
|
|
384
|
+
intervalMs: config.intervalMs,
|
|
385
|
+
maxBatchSize: config.maxBatchSize ?? 80
|
|
386
|
+
});
|
|
387
|
+
if (!this.strategyData.has(name)) {
|
|
388
|
+
this.strategyData.set(name, /* @__PURE__ */ new Map());
|
|
389
|
+
this.strategyTimers.set(name, null);
|
|
390
|
+
this.isStrategyFlushing.set(name, false);
|
|
391
|
+
}
|
|
1342
392
|
}
|
|
1343
|
-
|
|
1344
|
-
this.
|
|
393
|
+
updateFlushStrategy(name, config) {
|
|
394
|
+
if (!this.flushStrategies.get(name)) {
|
|
395
|
+
return this.setFlushStrategy(name, config);
|
|
396
|
+
}
|
|
397
|
+
this.flushStrategies.set(name, config);
|
|
1345
398
|
}
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
399
|
+
removeFlushStrategy(name) {
|
|
400
|
+
if (name === this.defaultStrategyName) {
|
|
401
|
+
throw new Error("Cannot remove default strategy");
|
|
402
|
+
}
|
|
403
|
+
const timer = this.strategyTimers.get(name);
|
|
404
|
+
if (timer) clearTimeout(timer);
|
|
405
|
+
this.strategyTimers.delete(name);
|
|
406
|
+
this.strategyData.delete(name);
|
|
407
|
+
this.isStrategyFlushing.delete(name);
|
|
408
|
+
this.flushStrategies.delete(name);
|
|
409
|
+
}
|
|
410
|
+
getFlushStrategies() {
|
|
411
|
+
return Object.fromEntries(this.flushStrategies);
|
|
412
|
+
}
|
|
413
|
+
squash(signal, context, options = { squash: true }) {
|
|
414
|
+
if (!options.squash) {
|
|
415
|
+
this.emit(signal, context, options);
|
|
416
|
+
return;
|
|
417
|
+
}
|
|
418
|
+
const strategyName = options.flushStrategy ?? this.defaultStrategyName;
|
|
419
|
+
const strategy = this.flushStrategies.get(strategyName);
|
|
420
|
+
if (!strategy) {
|
|
421
|
+
console.warn(
|
|
422
|
+
`Unknown flush strategy '${strategyName}', falling back to default`
|
|
423
|
+
);
|
|
424
|
+
return this.squash(signal, context, {
|
|
425
|
+
...options,
|
|
426
|
+
flushStrategy: this.defaultStrategyName
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
const squashId = options.squashId ?? signal;
|
|
430
|
+
let groups = this.strategyData.get(strategyName);
|
|
431
|
+
let data = groups.get(squashId);
|
|
432
|
+
if (!data) {
|
|
433
|
+
data = { signal, contexts: [] };
|
|
434
|
+
groups.set(squashId, data);
|
|
435
|
+
}
|
|
436
|
+
data.contexts.push(context);
|
|
437
|
+
if (data.contexts.length >= strategy.maxBatchSize) {
|
|
438
|
+
this.flushGroup(strategyName, squashId, options);
|
|
439
|
+
return;
|
|
440
|
+
}
|
|
441
|
+
if (!this.strategyTimers.get(strategyName) && !this.isStrategyFlushing.get(strategyName)) {
|
|
442
|
+
this.strategyTimers.set(
|
|
443
|
+
strategyName,
|
|
444
|
+
setTimeout(() => this.flushStrategy(strategyName), strategy.intervalMs)
|
|
445
|
+
);
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
flushGroup(strategyName, squashId, options) {
|
|
449
|
+
const groups = this.strategyData.get(strategyName);
|
|
450
|
+
if (!groups) return;
|
|
451
|
+
const data = groups.get(squashId);
|
|
452
|
+
if (!data || data.contexts.length === 0) return;
|
|
453
|
+
const start = performance.now();
|
|
454
|
+
const merged = options.mergeFunction ? options.mergeFunction(data.contexts[0], ...data.contexts.slice(1)) : Object.assign({}, ...data.contexts);
|
|
455
|
+
groups.delete(squashId);
|
|
456
|
+
this.emit(data.signal, merged, { ...options, squash: false });
|
|
457
|
+
const duration = performance.now() - start;
|
|
458
|
+
if (duration > this.MAX_FLUSH_DURATION_MS) {
|
|
459
|
+
console.warn(
|
|
460
|
+
`Squash flush for ${data.signal} in group ${squashId} took ${duration.toFixed(1)}ms`
|
|
461
|
+
);
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
flushStrategy(strategyName) {
|
|
465
|
+
this.strategyTimers.set(strategyName, null);
|
|
466
|
+
this.isStrategyFlushing.set(strategyName, true);
|
|
467
|
+
const groups = this.strategyData.get(strategyName);
|
|
468
|
+
if (!groups || groups.size === 0) {
|
|
469
|
+
this.isStrategyFlushing.set(strategyName, false);
|
|
470
|
+
return;
|
|
471
|
+
}
|
|
472
|
+
const keys = Array.from(groups.keys());
|
|
473
|
+
for (const squashId of keys) {
|
|
474
|
+
if (groups.has(squashId)) {
|
|
475
|
+
this.flushGroup(strategyName, squashId, {});
|
|
1358
476
|
}
|
|
1359
477
|
}
|
|
478
|
+
this.isStrategyFlushing.set(strategyName, false);
|
|
479
|
+
if (groups.size > 0) {
|
|
480
|
+
const strategy = this.flushStrategies.get(strategyName);
|
|
481
|
+
this.strategyTimers.set(
|
|
482
|
+
strategyName,
|
|
483
|
+
setTimeout(() => this.flushStrategy(strategyName), strategy.intervalMs)
|
|
484
|
+
);
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
clearSquashState() {
|
|
488
|
+
for (const [name, timer] of this.strategyTimers.entries()) {
|
|
489
|
+
if (timer) clearTimeout(timer);
|
|
490
|
+
}
|
|
491
|
+
this.strategyTimers.clear();
|
|
492
|
+
this.strategyData.clear();
|
|
493
|
+
this.isStrategyFlushing.clear();
|
|
1360
494
|
}
|
|
1361
|
-
/**
|
|
1362
|
-
* Schedules a signal to be emitted after a specified delay or at an exact date and time.
|
|
1363
|
-
*
|
|
1364
|
-
* @param {string} signal - The name of the signal to be emitted.
|
|
1365
|
-
* @param {AnyObject} context - The context to be passed along with the signal.
|
|
1366
|
-
* @param options
|
|
1367
|
-
* @return {AbortController} An AbortController instance that can be used to cancel the scheduled signal emission.
|
|
1368
|
-
*/
|
|
1369
495
|
schedule(signal, context, options = { delayMs: 6e4 }) {
|
|
1370
|
-
let delay = options.delayMs;
|
|
1371
|
-
if (options.exactDateTime
|
|
496
|
+
let delay = options.delayMs ?? 0;
|
|
497
|
+
if (options.exactDateTime) {
|
|
1372
498
|
delay = options.exactDateTime.getTime() - Date.now();
|
|
1373
499
|
}
|
|
1374
|
-
delay = Math.max(0, delay
|
|
500
|
+
delay = Math.max(0, delay);
|
|
501
|
+
const bucketKey = Math.ceil(delay / 100) * 100;
|
|
502
|
+
let bucket = this.scheduledBuckets.get(bucketKey);
|
|
503
|
+
if (!bucket) {
|
|
504
|
+
bucket = [];
|
|
505
|
+
this.scheduledBuckets.set(bucketKey, bucket);
|
|
506
|
+
}
|
|
507
|
+
bucket.push({ signal, context });
|
|
1375
508
|
const controller = new AbortController();
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
if (!signalController.aborted) tick();
|
|
1380
|
-
}, delay);
|
|
1381
|
-
signalController.addEventListener("abort", () => clearTimeout(timerId));
|
|
509
|
+
if (!this.scheduleTimer) {
|
|
510
|
+
this.scheduleTimer = setTimeout(() => this.flushScheduled(), 50);
|
|
511
|
+
}
|
|
1382
512
|
return controller;
|
|
1383
513
|
}
|
|
514
|
+
flushScheduled() {
|
|
515
|
+
this.scheduleTimer = null;
|
|
516
|
+
const now2 = Date.now();
|
|
517
|
+
const toProcess = [];
|
|
518
|
+
for (const [bucketKey, items] of this.scheduledBuckets.entries()) {
|
|
519
|
+
const bucketTime = bucketKey;
|
|
520
|
+
if (now2 >= bucketTime - 150) {
|
|
521
|
+
toProcess.push([bucketKey, items]);
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
for (const [key, items] of toProcess) {
|
|
525
|
+
this.scheduledBuckets.delete(key);
|
|
526
|
+
for (const item of items) {
|
|
527
|
+
this.emit(item.signal, item.context);
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
if (this.scheduledBuckets.size > 0) {
|
|
531
|
+
this.scheduleTimer = setTimeout(() => this.flushScheduled(), 50);
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
debounce(signal, context, options = { delayMs: 500 }) {
|
|
535
|
+
if (this.debouncedEmitters.size > this.MAX_DEBOUNCERS) {
|
|
536
|
+
console.warn("Max debouncers reached - evicting oldest");
|
|
537
|
+
const oldestKey = this.debouncedEmitters.keys().next().value;
|
|
538
|
+
if (oldestKey) {
|
|
539
|
+
const entry2 = this.debouncedEmitters.get(oldestKey);
|
|
540
|
+
entry2.debouncedFn.flush();
|
|
541
|
+
this.debouncedEmitters.delete(oldestKey);
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
const delay = options.delayMs ?? 300;
|
|
545
|
+
const key = signal;
|
|
546
|
+
let entry = this.debouncedEmitters.get(key);
|
|
547
|
+
if (!entry) {
|
|
548
|
+
const debouncedFn = debounce_default(
|
|
549
|
+
(ctx) => {
|
|
550
|
+
this.emit(signal, ctx);
|
|
551
|
+
entry.idleTimeout = setTimeout(() => {
|
|
552
|
+
this.debouncedEmitters.delete(key);
|
|
553
|
+
}, delay * 4);
|
|
554
|
+
},
|
|
555
|
+
delay,
|
|
556
|
+
{ leading: false, trailing: true }
|
|
557
|
+
);
|
|
558
|
+
entry = { debouncedFn, idleTimeout: null };
|
|
559
|
+
this.debouncedEmitters.set(key, entry);
|
|
560
|
+
}
|
|
561
|
+
if (entry.idleTimeout) {
|
|
562
|
+
clearTimeout(entry.idleTimeout);
|
|
563
|
+
entry.idleTimeout = null;
|
|
564
|
+
}
|
|
565
|
+
entry.debouncedFn(context);
|
|
566
|
+
}
|
|
567
|
+
// ── Existing throttle, interval, etc. remain unchanged ──────────────
|
|
568
|
+
throttle(signal, context, options = { delayMs: 1e3 }) {
|
|
569
|
+
let { groupId, delayMs = 300 } = options;
|
|
570
|
+
if (!groupId) {
|
|
571
|
+
groupId = signal;
|
|
572
|
+
}
|
|
573
|
+
if (!this.throttleQueues.has(groupId)) {
|
|
574
|
+
this.throttleQueues.set(groupId, []);
|
|
575
|
+
}
|
|
576
|
+
const queue = this.throttleQueues.get(groupId);
|
|
577
|
+
queue.push([signal, context]);
|
|
578
|
+
if (!this.throttleEmitters.has(groupId)) {
|
|
579
|
+
this.throttleEmitters.set(groupId, async () => {
|
|
580
|
+
while (queue.length > 0) {
|
|
581
|
+
let batchSize = options.throttleBatch ?? 1;
|
|
582
|
+
if (batchSize > queue.length) {
|
|
583
|
+
batchSize = queue.length;
|
|
584
|
+
}
|
|
585
|
+
for (let i = 0; i < batchSize; i++) {
|
|
586
|
+
const [nextSignal, nextContext] = queue.shift();
|
|
587
|
+
this.emit(nextSignal, nextContext);
|
|
588
|
+
}
|
|
589
|
+
await sleep(delayMs);
|
|
590
|
+
}
|
|
591
|
+
this.throttleEmitters.delete(groupId);
|
|
592
|
+
this.throttleQueues.delete(groupId);
|
|
593
|
+
});
|
|
594
|
+
this.throttleEmitters.get(groupId)();
|
|
595
|
+
}
|
|
596
|
+
}
|
|
1384
597
|
/**
|
|
1385
598
|
* Emits `signal` repeatedly with a fixed interval.
|
|
1386
599
|
*
|
|
@@ -1427,90 +640,6 @@ var SignalBroker = class _SignalBroker {
|
|
|
1427
640
|
}
|
|
1428
641
|
};
|
|
1429
642
|
}
|
|
1430
|
-
debounce(signal, context, options = { delayMs: 500 }) {
|
|
1431
|
-
let debouncedEmitter = this.debouncedEmitters.get(signal);
|
|
1432
|
-
if (!debouncedEmitter) {
|
|
1433
|
-
this.debouncedEmitters.set(
|
|
1434
|
-
signal,
|
|
1435
|
-
debounce_default((ctx) => {
|
|
1436
|
-
this.emit(signal, ctx);
|
|
1437
|
-
}, options.delayMs ?? 300)
|
|
1438
|
-
);
|
|
1439
|
-
debouncedEmitter = this.debouncedEmitters.get(signal);
|
|
1440
|
-
}
|
|
1441
|
-
debouncedEmitter(context);
|
|
1442
|
-
}
|
|
1443
|
-
throttle(signal, context, options = { delayMs: 1e3 }) {
|
|
1444
|
-
let { groupId, delayMs = 300 } = options;
|
|
1445
|
-
if (!groupId) {
|
|
1446
|
-
groupId = signal;
|
|
1447
|
-
}
|
|
1448
|
-
if (!this.throttleQueues.has(groupId)) {
|
|
1449
|
-
this.throttleQueues.set(groupId, []);
|
|
1450
|
-
}
|
|
1451
|
-
const queue = this.throttleQueues.get(groupId);
|
|
1452
|
-
queue.push([signal, context]);
|
|
1453
|
-
if (!this.throttleEmitters.has(groupId)) {
|
|
1454
|
-
this.throttleEmitters.set(groupId, async () => {
|
|
1455
|
-
while (queue.length > 0) {
|
|
1456
|
-
let batchSize = options.throttleBatch ?? 1;
|
|
1457
|
-
if (batchSize > queue.length) {
|
|
1458
|
-
batchSize = queue.length;
|
|
1459
|
-
}
|
|
1460
|
-
for (let i = 0; i < batchSize; i++) {
|
|
1461
|
-
const [nextSignal, nextContext] = queue.shift();
|
|
1462
|
-
this.emit(nextSignal, nextContext);
|
|
1463
|
-
}
|
|
1464
|
-
await sleep(delayMs);
|
|
1465
|
-
}
|
|
1466
|
-
this.throttleEmitters.delete(groupId);
|
|
1467
|
-
this.throttleQueues.delete(groupId);
|
|
1468
|
-
});
|
|
1469
|
-
this.throttleEmitters.get(groupId)();
|
|
1470
|
-
}
|
|
1471
|
-
}
|
|
1472
|
-
/**
|
|
1473
|
-
* Aggregates and debounces multiple events with the same identifier to minimize redundant operations.
|
|
1474
|
-
*
|
|
1475
|
-
* @param {string} signal - The identifier for the event being emitted.
|
|
1476
|
-
* @param {AnyObject} context - The context data associated with the event.
|
|
1477
|
-
* @param {Object} [options] - Configuration options for handling the squashed event.
|
|
1478
|
-
* @param {boolean} [options.squash=true] - Whether the event should be squashed.
|
|
1479
|
-
* @param {string|null} [options.squashId=null] - A unique identifier for the squashed group of events. Defaults to the signal if null.
|
|
1480
|
-
* @param {function|null} [options.mergeFunction=null] - A custom merge function that combines old and new contexts. If null, a default merge is used.
|
|
1481
|
-
* @return {void} Does not return a value.
|
|
1482
|
-
*/
|
|
1483
|
-
squash(signal, context, options = { squash: true }) {
|
|
1484
|
-
let { squashId, delayMs = 300 } = options;
|
|
1485
|
-
if (!squashId) {
|
|
1486
|
-
squashId = signal;
|
|
1487
|
-
}
|
|
1488
|
-
if (!this.squashedEmitters.has(squashId)) {
|
|
1489
|
-
this.squashedEmitters.set(
|
|
1490
|
-
squashId,
|
|
1491
|
-
debounce_default(() => {
|
|
1492
|
-
options.squash = false;
|
|
1493
|
-
this.emit(
|
|
1494
|
-
signal,
|
|
1495
|
-
options.mergeFunction ? options.mergeFunction(
|
|
1496
|
-
this.squashedContexts.get(squashId)[0],
|
|
1497
|
-
...this.squashedContexts.get(squashId).slice(1)
|
|
1498
|
-
) : merge_default(
|
|
1499
|
-
this.squashedContexts.get(squashId)[0],
|
|
1500
|
-
...this.squashedContexts.get(squashId).slice(1)
|
|
1501
|
-
),
|
|
1502
|
-
options
|
|
1503
|
-
);
|
|
1504
|
-
this.squashedEmitters.delete(squashId);
|
|
1505
|
-
this.squashedContexts.delete(squashId);
|
|
1506
|
-
}, delayMs ?? 300)
|
|
1507
|
-
);
|
|
1508
|
-
this.squashedContexts.set(squashId, [context]);
|
|
1509
|
-
} else {
|
|
1510
|
-
this.squashedContexts.get(squashId)?.push(context);
|
|
1511
|
-
}
|
|
1512
|
-
this.squashedEmitters.get(squashId)();
|
|
1513
|
-
}
|
|
1514
643
|
/**
|
|
1515
644
|
* Emits a signal with the specified context, triggering any associated handlers for that signal.
|
|
1516
645
|
*
|
|
@@ -1684,6 +813,34 @@ var SignalBroker = class _SignalBroker {
|
|
|
1684
813
|
this.emit("meta.signal_broker.added", { signalName: _signal });
|
|
1685
814
|
}
|
|
1686
815
|
}
|
|
816
|
+
/**
|
|
817
|
+
* Observes a signal with a routine/task.
|
|
818
|
+
* @param signal The signal (e.g., 'domain.action', 'domain.*' for wildcards).
|
|
819
|
+
* @param routineOrTask The observer.
|
|
820
|
+
* @edge Duplicates ignored; supports wildcards for broad listening.
|
|
821
|
+
*/
|
|
822
|
+
observe(signal, routineOrTask) {
|
|
823
|
+
this.addSignal(signal);
|
|
824
|
+
this.signalObservers.get(signal).tasks.add(routineOrTask);
|
|
825
|
+
}
|
|
826
|
+
registerEmittedSignal(signal) {
|
|
827
|
+
this.emittedSignalsRegistry.add(signal);
|
|
828
|
+
}
|
|
829
|
+
/**
|
|
830
|
+
* Unsubscribes a routine/task from a signal.
|
|
831
|
+
* @param signal The signal.
|
|
832
|
+
* @param routineOrTask The observer.
|
|
833
|
+
* @edge Removes all instances if duplicate; deletes if empty.
|
|
834
|
+
*/
|
|
835
|
+
unsubscribe(signal, routineOrTask) {
|
|
836
|
+
const obs = this.signalObservers.get(signal);
|
|
837
|
+
if (obs) {
|
|
838
|
+
obs.tasks.delete(routineOrTask);
|
|
839
|
+
if (obs.tasks.size === 0) {
|
|
840
|
+
this.signalObservers.delete(signal);
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
}
|
|
1687
844
|
/**
|
|
1688
845
|
* Lists all observed signals.
|
|
1689
846
|
* @returns Array of signals.
|
|
@@ -1698,6 +855,10 @@ var SignalBroker = class _SignalBroker {
|
|
|
1698
855
|
this.signalObservers.clear();
|
|
1699
856
|
this.emittedSignalsRegistry.clear();
|
|
1700
857
|
}
|
|
858
|
+
shutdown() {
|
|
859
|
+
this.clearSquashState();
|
|
860
|
+
this.reset();
|
|
861
|
+
}
|
|
1701
862
|
};
|
|
1702
863
|
|
|
1703
864
|
// src/engine/GraphRunner.ts
|
|
@@ -5231,10 +4392,9 @@ var GraphRunStrategy = class {
|
|
|
5231
4392
|
// src/engine/ThrottleEngine.ts
|
|
5232
4393
|
var ThrottleEngine = class _ThrottleEngine {
|
|
5233
4394
|
constructor() {
|
|
5234
|
-
this.
|
|
5235
|
-
this.
|
|
5236
|
-
this.
|
|
5237
|
-
this.functionIdToPromiseResolve = {};
|
|
4395
|
+
this.tagState = /* @__PURE__ */ new Map();
|
|
4396
|
+
this.nextId = 0;
|
|
4397
|
+
this.pendingResolves = /* @__PURE__ */ new Map();
|
|
5238
4398
|
}
|
|
5239
4399
|
static get instance() {
|
|
5240
4400
|
if (!this.instance_) {
|
|
@@ -5242,11 +4402,24 @@ var ThrottleEngine = class _ThrottleEngine {
|
|
|
5242
4402
|
}
|
|
5243
4403
|
return this.instance_;
|
|
5244
4404
|
}
|
|
4405
|
+
getTagState(tag) {
|
|
4406
|
+
let state = this.tagState.get(tag);
|
|
4407
|
+
if (!state) {
|
|
4408
|
+
state = {
|
|
4409
|
+
queue: [],
|
|
4410
|
+
runningCount: 0,
|
|
4411
|
+
maxConcurrency: 1
|
|
4412
|
+
};
|
|
4413
|
+
this.tagState.set(tag, state);
|
|
4414
|
+
}
|
|
4415
|
+
return state;
|
|
4416
|
+
}
|
|
5245
4417
|
/**
|
|
5246
4418
|
* Set a custom concurrency limit for a specific tag
|
|
5247
4419
|
*/
|
|
5248
4420
|
setConcurrencyLimit(tag, limit) {
|
|
5249
|
-
this.
|
|
4421
|
+
const state = this.getTagState(tag);
|
|
4422
|
+
state.maxConcurrency = limit;
|
|
5250
4423
|
}
|
|
5251
4424
|
/**
|
|
5252
4425
|
* Manages the execution of a function `fn` applied on a specified node `node` with controlled concurrency for a given tag.
|
|
@@ -5258,13 +4431,12 @@ var ThrottleEngine = class _ThrottleEngine {
|
|
|
5258
4431
|
* @return {Promise<GraphNode[]>} A promise resolving to an array of GraphNode objects once the throttled function execution completes.
|
|
5259
4432
|
*/
|
|
5260
4433
|
throttle(fn, node, tag = "default") {
|
|
5261
|
-
|
|
4434
|
+
const state = this.getTagState(tag);
|
|
4435
|
+
const id = this.nextId++;
|
|
5262
4436
|
const functionPromise = new Promise((resolve) => {
|
|
5263
|
-
this.
|
|
4437
|
+
this.pendingResolves.set(id, resolve);
|
|
5264
4438
|
});
|
|
5265
|
-
|
|
5266
|
-
this.queues[tag].push([fn, node]);
|
|
5267
|
-
(_b = this.maxConcurrencyPerTag)[tag] ?? (_b[tag] = 1);
|
|
4439
|
+
state.queue.push([fn, node, id]);
|
|
5268
4440
|
this.processQueue(tag);
|
|
5269
4441
|
return functionPromise;
|
|
5270
4442
|
}
|
|
@@ -5275,34 +4447,44 @@ var ThrottleEngine = class _ThrottleEngine {
|
|
|
5275
4447
|
* @return {void} Does not return a value; it processes tasks asynchronously and manages state internally.
|
|
5276
4448
|
*/
|
|
5277
4449
|
processQueue(tag) {
|
|
5278
|
-
const
|
|
5279
|
-
|
|
5280
|
-
|
|
5281
|
-
|
|
5282
|
-
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
|
|
5286
|
-
|
|
5287
|
-
|
|
5288
|
-
|
|
5289
|
-
|
|
5290
|
-
|
|
4450
|
+
const tagData = this.tagState.get(tag);
|
|
4451
|
+
if (!tagData) return;
|
|
4452
|
+
const maxAllowed = tagData.maxConcurrency;
|
|
4453
|
+
const processNext = () => {
|
|
4454
|
+
while (tagData.queue.length > 0 && tagData.runningCount < maxAllowed) {
|
|
4455
|
+
tagData.runningCount++;
|
|
4456
|
+
const item = tagData.queue.shift();
|
|
4457
|
+
this.process(item).catch(() => []).finally(() => {
|
|
4458
|
+
tagData.runningCount--;
|
|
4459
|
+
processNext();
|
|
4460
|
+
});
|
|
4461
|
+
}
|
|
4462
|
+
if (tagData.queue.length === 0 && tagData.runningCount === 0) {
|
|
4463
|
+
}
|
|
4464
|
+
};
|
|
4465
|
+
processNext();
|
|
5291
4466
|
}
|
|
5292
4467
|
/**
|
|
5293
4468
|
* Processes a given item consisting of a function and a graph node.
|
|
5294
4469
|
*
|
|
5295
|
-
* @param {Array} item - An array where the first element is a processing function
|
|
4470
|
+
* @param {Array} item - An array where the first element is a processing function, the second element is a graph node, and the third is the unique ID.
|
|
5296
4471
|
* @param {Function} item[0] - The function to process the graph node.
|
|
5297
4472
|
* @param {GraphNode} item[1] - The graph node to be processed.
|
|
4473
|
+
* @param {number} item[2] - The unique ID for promise resolution.
|
|
5298
4474
|
* @return {Promise<void>} A promise that resolves when the processing and cleanup are complete.
|
|
5299
4475
|
*/
|
|
5300
4476
|
async process(item) {
|
|
5301
4477
|
const fn = item[0];
|
|
5302
4478
|
const node = item[1];
|
|
5303
|
-
const
|
|
5304
|
-
|
|
5305
|
-
|
|
4479
|
+
const id = item[2];
|
|
4480
|
+
try {
|
|
4481
|
+
const context = await fn(node);
|
|
4482
|
+
this.pendingResolves.get(id)?.(context);
|
|
4483
|
+
} catch (e) {
|
|
4484
|
+
this.pendingResolves.get(id)?.([]);
|
|
4485
|
+
} finally {
|
|
4486
|
+
this.pendingResolves.delete(id);
|
|
4487
|
+
}
|
|
5306
4488
|
}
|
|
5307
4489
|
};
|
|
5308
4490
|
|
|
@@ -6395,17 +5577,4 @@ export {
|
|
|
6395
5577
|
Task,
|
|
6396
5578
|
index_default as default
|
|
6397
5579
|
};
|
|
6398
|
-
/*! Bundled license information:
|
|
6399
|
-
|
|
6400
|
-
lodash-es/lodash.js:
|
|
6401
|
-
(**
|
|
6402
|
-
* @license
|
|
6403
|
-
* Lodash (Custom Build) <https://lodash.com/>
|
|
6404
|
-
* Build: `lodash modularize exports="es" -o ./`
|
|
6405
|
-
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
6406
|
-
* Released under MIT license <https://lodash.com/license>
|
|
6407
|
-
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
6408
|
-
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
6409
|
-
*)
|
|
6410
|
-
*/
|
|
6411
5580
|
//# sourceMappingURL=index.mjs.map
|