@hpcc-js/graph 2.83.1 → 2.84.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.
Files changed (56) hide show
  1. package/dist/index.es6.js +1145 -266
  2. package/dist/index.es6.js.map +1 -1
  3. package/dist/index.js +1146 -262
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.min.js +1 -1
  6. package/dist/index.min.js.map +1 -1
  7. package/package.json +9 -8
  8. package/src/__package__.ts +2 -2
  9. package/src/graph2/dataGraph.ts +27 -25
  10. package/src/graph2/edge.tsx +30 -0
  11. package/src/graph2/graph.ts +46 -1311
  12. package/src/graph2/graphReactT.ts +43 -0
  13. package/src/graph2/graphT.ts +1315 -0
  14. package/src/graph2/index.ts +5 -0
  15. package/src/graph2/layouts/dagre.ts +17 -4
  16. package/src/graph2/layouts/forceDirected.ts +2 -2
  17. package/src/graph2/layouts/graphviz.ts +1 -1
  18. package/src/graph2/layouts/graphvizWorker.ts +2 -2
  19. package/src/graph2/layouts/placeholders.ts +46 -37
  20. package/src/graph2/layouts/tree.ts +1 -1
  21. package/src/graph2/sankeyGraph.ts +8 -12
  22. package/src/graph2/subgraph.tsx +30 -0
  23. package/src/graph2/vertex.tsx +31 -0
  24. package/types/__package__.d.ts +2 -2
  25. package/types/graph2/dataGraph.d.ts +4 -4
  26. package/types/graph2/dataGraph.d.ts.map +1 -1
  27. package/types/graph2/edge.d.ts +9 -0
  28. package/types/graph2/edge.d.ts.map +1 -0
  29. package/types/graph2/graph.d.ts +25 -234
  30. package/types/graph2/graph.d.ts.map +1 -1
  31. package/types/graph2/graphReactT.d.ts +15 -0
  32. package/types/graph2/graphReactT.d.ts.map +1 -0
  33. package/types/graph2/graphT.d.ts +233 -0
  34. package/types/graph2/graphT.d.ts.map +1 -0
  35. package/types/graph2/index.d.ts +5 -0
  36. package/types/graph2/index.d.ts.map +1 -1
  37. package/types/graph2/layouts/dagre.d.ts.map +1 -1
  38. package/types/graph2/layouts/placeholders.d.ts +44 -37
  39. package/types/graph2/layouts/placeholders.d.ts.map +1 -1
  40. package/types/graph2/sankeyGraph.d.ts +5 -5
  41. package/types/graph2/sankeyGraph.d.ts.map +1 -1
  42. package/types/graph2/subgraph.d.ts +12 -0
  43. package/types/graph2/subgraph.d.ts.map +1 -0
  44. package/types/graph2/vertex.d.ts +13 -0
  45. package/types/graph2/vertex.d.ts.map +1 -0
  46. package/types-3.4/__package__.d.ts +2 -2
  47. package/types-3.4/graph2/dataGraph.d.ts +4 -4
  48. package/types-3.4/graph2/edge.d.ts +9 -0
  49. package/types-3.4/graph2/graph.d.ts +25 -234
  50. package/types-3.4/graph2/graphReactT.d.ts +15 -0
  51. package/types-3.4/graph2/graphT.d.ts +233 -0
  52. package/types-3.4/graph2/index.d.ts +5 -0
  53. package/types-3.4/graph2/layouts/placeholders.d.ts +47 -37
  54. package/types-3.4/graph2/sankeyGraph.d.ts +5 -5
  55. package/types-3.4/graph2/subgraph.d.ts +12 -0
  56. package/types-3.4/graph2/vertex.d.ts +13 -0
package/dist/index.js CHANGED
@@ -5,8 +5,8 @@
5
5
  })(this, (function (exports, common, util$b, api, react, html) { 'use strict';
6
6
 
7
7
  var PKG_NAME = "@hpcc-js/graph";
8
- var PKG_VERSION = "2.83.1";
9
- var BUILD_VERSION = "2.104.5";
8
+ var PKG_VERSION = "2.84.0";
9
+ var BUILD_VERSION = "2.104.8";
10
10
 
11
11
  /******************************************************************************
12
12
  Copyright (c) Microsoft Corporation.
@@ -1126,11 +1126,11 @@
1126
1126
  var root$8 = _root;
1127
1127
 
1128
1128
  /** Built-in value references. */
1129
- var Symbol$6 = root$8.Symbol;
1129
+ var Symbol$7 = root$8.Symbol;
1130
1130
 
1131
- var _Symbol = Symbol$6;
1131
+ var _Symbol = Symbol$7;
1132
1132
 
1133
- var Symbol$5 = _Symbol;
1133
+ var Symbol$6 = _Symbol;
1134
1134
 
1135
1135
  /** Used for built-in method references. */
1136
1136
  var objectProto$i = Object.prototype;
@@ -1146,7 +1146,7 @@
1146
1146
  var nativeObjectToString$1 = objectProto$i.toString;
1147
1147
 
1148
1148
  /** Built-in value references. */
1149
- var symToStringTag$1 = Symbol$5 ? Symbol$5.toStringTag : undefined;
1149
+ var symToStringTag$1 = Symbol$6 ? Symbol$6.toStringTag : undefined;
1150
1150
 
1151
1151
  /**
1152
1152
  * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
@@ -1201,7 +1201,7 @@
1201
1201
 
1202
1202
  var _objectToString = objectToString$1;
1203
1203
 
1204
- var Symbol$4 = _Symbol,
1204
+ var Symbol$5 = _Symbol,
1205
1205
  getRawTag = _getRawTag,
1206
1206
  objectToString = _objectToString;
1207
1207
 
@@ -1210,7 +1210,7 @@
1210
1210
  undefinedTag = '[object Undefined]';
1211
1211
 
1212
1212
  /** Built-in value references. */
1213
- var symToStringTag = Symbol$4 ? Symbol$4.toStringTag : undefined;
1213
+ var symToStringTag = Symbol$5 ? Symbol$5.toStringTag : undefined;
1214
1214
 
1215
1215
  /**
1216
1216
  * The base implementation of `getTag` without fallbacks for buggy environments.
@@ -1864,9 +1864,9 @@
1864
1864
  } catch (e) {}
1865
1865
  }());
1866
1866
 
1867
- var _defineProperty = defineProperty$2;
1867
+ var _defineProperty$1 = defineProperty$2;
1868
1868
 
1869
- var defineProperty$1 = _defineProperty;
1869
+ var defineProperty$1 = _defineProperty$1;
1870
1870
 
1871
1871
  /**
1872
1872
  * The base implementation of `assignValue` and `assignMergeValue` without
@@ -3157,10 +3157,10 @@
3157
3157
 
3158
3158
  var _cloneRegExp = cloneRegExp$1;
3159
3159
 
3160
- var Symbol$3 = _Symbol;
3160
+ var Symbol$4 = _Symbol;
3161
3161
 
3162
3162
  /** Used to convert symbols to primitives and strings. */
3163
- var symbolProto$2 = Symbol$3 ? Symbol$3.prototype : undefined,
3163
+ var symbolProto$2 = Symbol$4 ? Symbol$4.prototype : undefined,
3164
3164
  symbolValueOf$1 = symbolProto$2 ? symbolProto$2.valueOf : undefined;
3165
3165
 
3166
3166
  /**
@@ -4090,7 +4090,7 @@
4090
4090
 
4091
4091
  var _setToArray = setToArray$3;
4092
4092
 
4093
- var Symbol$2 = _Symbol,
4093
+ var Symbol$3 = _Symbol,
4094
4094
  Uint8Array = _Uint8Array,
4095
4095
  eq$3 = eq_1,
4096
4096
  equalArrays$1 = _equalArrays,
@@ -4116,7 +4116,7 @@
4116
4116
  dataViewTag = '[object DataView]';
4117
4117
 
4118
4118
  /** Used to convert symbols to primitives and strings. */
4119
- var symbolProto$1 = Symbol$2 ? Symbol$2.prototype : undefined,
4119
+ var symbolProto$1 = Symbol$3 ? Symbol$3.prototype : undefined,
4120
4120
  symbolValueOf = symbolProto$1 ? symbolProto$1.valueOf : undefined;
4121
4121
 
4122
4122
  /**
@@ -4768,7 +4768,7 @@
4768
4768
 
4769
4769
  var _arrayMap = arrayMap$4;
4770
4770
 
4771
- var Symbol$1 = _Symbol,
4771
+ var Symbol$2 = _Symbol,
4772
4772
  arrayMap$3 = _arrayMap,
4773
4773
  isArray$c = isArray_1,
4774
4774
  isSymbol$4 = isSymbol_1;
@@ -4777,7 +4777,7 @@
4777
4777
  var INFINITY$3 = 1 / 0;
4778
4778
 
4779
4779
  /** Used to convert symbols to primitives and strings. */
4780
- var symbolProto = Symbol$1 ? Symbol$1.prototype : undefined,
4780
+ var symbolProto = Symbol$2 ? Symbol$2.prototype : undefined,
4781
4781
  symbolToString = symbolProto ? symbolProto.toString : undefined;
4782
4782
 
4783
4783
  /**
@@ -5804,12 +5804,12 @@
5804
5804
 
5805
5805
  var transform_1 = transform;
5806
5806
 
5807
- var Symbol = _Symbol,
5807
+ var Symbol$1 = _Symbol,
5808
5808
  isArguments$1 = isArguments_1,
5809
5809
  isArray$2 = isArray_1;
5810
5810
 
5811
5811
  /** Built-in value references. */
5812
- var spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;
5812
+ var spreadableSymbol = Symbol$1 ? Symbol$1.isConcatSpreadable : undefined;
5813
5813
 
5814
5814
  /**
5815
5815
  * Checks if `value` is a flattenable `arguments` object or array.
@@ -5925,7 +5925,7 @@
5925
5925
  var _overRest = overRest$2;
5926
5926
 
5927
5927
  var constant$2 = constant_1,
5928
- defineProperty = _defineProperty,
5928
+ defineProperty = _defineProperty$1,
5929
5929
  identity$4 = identity_1;
5930
5930
 
5931
5931
  /**
@@ -15439,6 +15439,775 @@
15439
15439
  Sankey.prototype.publish("xAxisMovement", false, "boolean", "Enable x-axis movement");
15440
15440
  Sankey.prototype.publish("yAxisMovement", false, "boolean", "Enable y-axis movement");
15441
15441
 
15442
+ function ownKeys(object, enumerableOnly) {
15443
+ var keys = Object.keys(object);
15444
+
15445
+ if (Object.getOwnPropertySymbols) {
15446
+ var symbols = Object.getOwnPropertySymbols(object);
15447
+
15448
+ if (enumerableOnly) {
15449
+ symbols = symbols.filter(function (sym) {
15450
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
15451
+ });
15452
+ }
15453
+
15454
+ keys.push.apply(keys, symbols);
15455
+ }
15456
+
15457
+ return keys;
15458
+ }
15459
+
15460
+ function _objectSpread2(target) {
15461
+ for (var i = 1; i < arguments.length; i++) {
15462
+ var source = arguments[i] != null ? arguments[i] : {};
15463
+
15464
+ if (i % 2) {
15465
+ ownKeys(Object(source), true).forEach(function (key) {
15466
+ _defineProperty(target, key, source[key]);
15467
+ });
15468
+ } else if (Object.getOwnPropertyDescriptors) {
15469
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
15470
+ } else {
15471
+ ownKeys(Object(source)).forEach(function (key) {
15472
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
15473
+ });
15474
+ }
15475
+ }
15476
+
15477
+ return target;
15478
+ }
15479
+
15480
+ function _typeof(obj) {
15481
+ "@babel/helpers - typeof";
15482
+
15483
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
15484
+ _typeof = function (obj) {
15485
+ return typeof obj;
15486
+ };
15487
+ } else {
15488
+ _typeof = function (obj) {
15489
+ return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
15490
+ };
15491
+ }
15492
+
15493
+ return _typeof(obj);
15494
+ }
15495
+
15496
+ function _defineProperty(obj, key, value) {
15497
+ if (key in obj) {
15498
+ Object.defineProperty(obj, key, {
15499
+ value: value,
15500
+ enumerable: true,
15501
+ configurable: true,
15502
+ writable: true
15503
+ });
15504
+ } else {
15505
+ obj[key] = value;
15506
+ }
15507
+
15508
+ return obj;
15509
+ }
15510
+
15511
+ function _extends() {
15512
+ _extends = Object.assign || function (target) {
15513
+ for (var i = 1; i < arguments.length; i++) {
15514
+ var source = arguments[i];
15515
+
15516
+ for (var key in source) {
15517
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
15518
+ target[key] = source[key];
15519
+ }
15520
+ }
15521
+ }
15522
+
15523
+ return target;
15524
+ };
15525
+
15526
+ return _extends.apply(this, arguments);
15527
+ }
15528
+
15529
+ function _unsupportedIterableToArray(o, minLen) {
15530
+ if (!o) return;
15531
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
15532
+ var n = Object.prototype.toString.call(o).slice(8, -1);
15533
+ if (n === "Object" && o.constructor) n = o.constructor.name;
15534
+ if (n === "Map" || n === "Set") return Array.from(o);
15535
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
15536
+ }
15537
+
15538
+ function _arrayLikeToArray(arr, len) {
15539
+ if (len == null || len > arr.length) len = arr.length;
15540
+
15541
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
15542
+
15543
+ return arr2;
15544
+ }
15545
+
15546
+ function _createForOfIteratorHelper(o, allowArrayLike) {
15547
+ var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
15548
+
15549
+ if (!it) {
15550
+ if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
15551
+ if (it) o = it;
15552
+ var i = 0;
15553
+
15554
+ var F = function () {};
15555
+
15556
+ return {
15557
+ s: F,
15558
+ n: function () {
15559
+ if (i >= o.length) return {
15560
+ done: true
15561
+ };
15562
+ return {
15563
+ done: false,
15564
+ value: o[i++]
15565
+ };
15566
+ },
15567
+ e: function (e) {
15568
+ throw e;
15569
+ },
15570
+ f: F
15571
+ };
15572
+ }
15573
+
15574
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
15575
+ }
15576
+
15577
+ var normalCompletion = true,
15578
+ didErr = false,
15579
+ err;
15580
+ return {
15581
+ s: function () {
15582
+ it = it.call(o);
15583
+ },
15584
+ n: function () {
15585
+ var step = it.next();
15586
+ normalCompletion = step.done;
15587
+ return step;
15588
+ },
15589
+ e: function (e) {
15590
+ didErr = true;
15591
+ err = e;
15592
+ },
15593
+ f: function () {
15594
+ try {
15595
+ if (!normalCompletion && it.return != null) it.return();
15596
+ } finally {
15597
+ if (didErr) throw err;
15598
+ }
15599
+ }
15600
+ };
15601
+ }
15602
+
15603
+ /**
15604
+ * de Casteljau's algorithm for drawing and splitting bezier curves.
15605
+ * Inspired by https://pomax.github.io/bezierinfo/
15606
+ *
15607
+ * @param {Number[][]} points Array of [x,y] points: [start, control1, control2, ..., end]
15608
+ * The original segment to split.
15609
+ * @param {Number} t Where to split the curve (value between [0, 1])
15610
+ * @return {Object} An object { left, right } where left is the segment from 0..t and
15611
+ * right is the segment from t..1.
15612
+ */
15613
+ function decasteljau(points, t) {
15614
+ var left = [];
15615
+ var right = [];
15616
+
15617
+ function decasteljauRecurse(points, t) {
15618
+ if (points.length === 1) {
15619
+ left.push(points[0]);
15620
+ right.push(points[0]);
15621
+ } else {
15622
+ var newPoints = Array(points.length - 1);
15623
+
15624
+ for (var i = 0; i < newPoints.length; i++) {
15625
+ if (i === 0) {
15626
+ left.push(points[0]);
15627
+ }
15628
+
15629
+ if (i === newPoints.length - 1) {
15630
+ right.push(points[i + 1]);
15631
+ }
15632
+
15633
+ newPoints[i] = [(1 - t) * points[i][0] + t * points[i + 1][0], (1 - t) * points[i][1] + t * points[i + 1][1]];
15634
+ }
15635
+
15636
+ decasteljauRecurse(newPoints, t);
15637
+ }
15638
+ }
15639
+
15640
+ if (points.length) {
15641
+ decasteljauRecurse(points, t);
15642
+ }
15643
+
15644
+ return {
15645
+ left: left,
15646
+ right: right.reverse()
15647
+ };
15648
+ }
15649
+ /**
15650
+ * Convert segments represented as points back into a command object
15651
+ *
15652
+ * @param {Number[][]} points Array of [x,y] points: [start, control1, control2, ..., end]
15653
+ * Represents a segment
15654
+ * @return {Object} A command object representing the segment.
15655
+ */
15656
+
15657
+
15658
+ function pointsToCommand(points) {
15659
+ var command = {};
15660
+
15661
+ if (points.length === 4) {
15662
+ command.x2 = points[2][0];
15663
+ command.y2 = points[2][1];
15664
+ }
15665
+
15666
+ if (points.length >= 3) {
15667
+ command.x1 = points[1][0];
15668
+ command.y1 = points[1][1];
15669
+ }
15670
+
15671
+ command.x = points[points.length - 1][0];
15672
+ command.y = points[points.length - 1][1];
15673
+
15674
+ if (points.length === 4) {
15675
+ // start, control1, control2, end
15676
+ command.type = 'C';
15677
+ } else if (points.length === 3) {
15678
+ // start, control, end
15679
+ command.type = 'Q';
15680
+ } else {
15681
+ // start, end
15682
+ command.type = 'L';
15683
+ }
15684
+
15685
+ return command;
15686
+ }
15687
+ /**
15688
+ * Runs de Casteljau's algorithm enough times to produce the desired number of segments.
15689
+ *
15690
+ * @param {Number[][]} points Array of [x,y] points for de Casteljau (the initial segment to split)
15691
+ * @param {Number} segmentCount Number of segments to split the original into
15692
+ * @return {Number[][][]} Array of segments
15693
+ */
15694
+
15695
+
15696
+ function splitCurveAsPoints(points, segmentCount) {
15697
+ segmentCount = segmentCount || 2;
15698
+ var segments = [];
15699
+ var remainingCurve = points;
15700
+ var tIncrement = 1 / segmentCount; // x-----x-----x-----x
15701
+ // t= 0.33 0.66 1
15702
+ // x-----o-----------x
15703
+ // r= 0.33
15704
+ // x-----o-----x
15705
+ // r= 0.5 (0.33 / (1 - 0.33)) === tIncrement / (1 - (tIncrement * (i - 1))
15706
+ // x-----x-----x-----x----x
15707
+ // t= 0.25 0.5 0.75 1
15708
+ // x-----o----------------x
15709
+ // r= 0.25
15710
+ // x-----o----------x
15711
+ // r= 0.33 (0.25 / (1 - 0.25))
15712
+ // x-----o----x
15713
+ // r= 0.5 (0.25 / (1 - 0.5))
15714
+
15715
+ for (var i = 0; i < segmentCount - 1; i++) {
15716
+ var tRelative = tIncrement / (1 - tIncrement * i);
15717
+ var split = decasteljau(remainingCurve, tRelative);
15718
+ segments.push(split.left);
15719
+ remainingCurve = split.right;
15720
+ } // last segment is just to the end from the last point
15721
+
15722
+
15723
+ segments.push(remainingCurve);
15724
+ return segments;
15725
+ }
15726
+ /**
15727
+ * Convert command objects to arrays of points, run de Casteljau's algorithm on it
15728
+ * to split into to the desired number of segments.
15729
+ *
15730
+ * @param {Object} commandStart The start command object
15731
+ * @param {Object} commandEnd The end command object
15732
+ * @param {Number} segmentCount The number of segments to create
15733
+ * @return {Object[]} An array of commands representing the segments in sequence
15734
+ */
15735
+
15736
+
15737
+ function splitCurve(commandStart, commandEnd, segmentCount) {
15738
+ var points = [[commandStart.x, commandStart.y]];
15739
+
15740
+ if (commandEnd.x1 != null) {
15741
+ points.push([commandEnd.x1, commandEnd.y1]);
15742
+ }
15743
+
15744
+ if (commandEnd.x2 != null) {
15745
+ points.push([commandEnd.x2, commandEnd.y2]);
15746
+ }
15747
+
15748
+ points.push([commandEnd.x, commandEnd.y]);
15749
+ return splitCurveAsPoints(points, segmentCount).map(pointsToCommand);
15750
+ }
15751
+
15752
+ var commandTokenRegex = /[MLCSTQAHVZmlcstqahv]|-?[\d.e+-]+/g;
15753
+ /**
15754
+ * List of params for each command type in a path `d` attribute
15755
+ */
15756
+
15757
+ var typeMap = {
15758
+ M: ['x', 'y'],
15759
+ L: ['x', 'y'],
15760
+ H: ['x'],
15761
+ V: ['y'],
15762
+ C: ['x1', 'y1', 'x2', 'y2', 'x', 'y'],
15763
+ S: ['x2', 'y2', 'x', 'y'],
15764
+ Q: ['x1', 'y1', 'x', 'y'],
15765
+ T: ['x', 'y'],
15766
+ A: ['rx', 'ry', 'xAxisRotation', 'largeArcFlag', 'sweepFlag', 'x', 'y'],
15767
+ Z: []
15768
+ }; // Add lower case entries too matching uppercase (e.g. 'm' == 'M')
15769
+
15770
+ Object.keys(typeMap).forEach(function (key) {
15771
+ typeMap[key.toLowerCase()] = typeMap[key];
15772
+ });
15773
+
15774
+ function arrayOfLength(length, value) {
15775
+ var array = Array(length);
15776
+
15777
+ for (var i = 0; i < length; i++) {
15778
+ array[i] = value;
15779
+ }
15780
+
15781
+ return array;
15782
+ }
15783
+ /**
15784
+ * Converts a command object to a string to be used in a `d` attribute
15785
+ * @param {Object} command A command object
15786
+ * @return {String} The string for the `d` attribute
15787
+ */
15788
+
15789
+
15790
+ function commandToString(command) {
15791
+ return "".concat(command.type).concat(typeMap[command.type].map(function (p) {
15792
+ return command[p];
15793
+ }).join(','));
15794
+ }
15795
+ /**
15796
+ * Converts command A to have the same type as command B.
15797
+ *
15798
+ * e.g., L0,5 -> C0,5,0,5,0,5
15799
+ *
15800
+ * Uses these rules:
15801
+ * x1 <- x
15802
+ * x2 <- x
15803
+ * y1 <- y
15804
+ * y2 <- y
15805
+ * rx <- 0
15806
+ * ry <- 0
15807
+ * xAxisRotation <- read from B
15808
+ * largeArcFlag <- read from B
15809
+ * sweepflag <- read from B
15810
+ *
15811
+ * @param {Object} aCommand Command object from path `d` attribute
15812
+ * @param {Object} bCommand Command object from path `d` attribute to match against
15813
+ * @return {Object} aCommand converted to type of bCommand
15814
+ */
15815
+
15816
+
15817
+ function convertToSameType(aCommand, bCommand) {
15818
+ var conversionMap = {
15819
+ x1: 'x',
15820
+ y1: 'y',
15821
+ x2: 'x',
15822
+ y2: 'y'
15823
+ };
15824
+ var readFromBKeys = ['xAxisRotation', 'largeArcFlag', 'sweepFlag']; // convert (but ignore M types)
15825
+
15826
+ if (aCommand.type !== bCommand.type && bCommand.type.toUpperCase() !== 'M') {
15827
+ var aConverted = {};
15828
+ Object.keys(bCommand).forEach(function (bKey) {
15829
+ var bValue = bCommand[bKey]; // first read from the A command
15830
+
15831
+ var aValue = aCommand[bKey]; // if it is one of these values, read from B no matter what
15832
+
15833
+ if (aValue === undefined) {
15834
+ if (readFromBKeys.includes(bKey)) {
15835
+ aValue = bValue;
15836
+ } else {
15837
+ // if it wasn't in the A command, see if an equivalent was
15838
+ if (aValue === undefined && conversionMap[bKey]) {
15839
+ aValue = aCommand[conversionMap[bKey]];
15840
+ } // if it doesn't have a converted value, use 0
15841
+
15842
+
15843
+ if (aValue === undefined) {
15844
+ aValue = 0;
15845
+ }
15846
+ }
15847
+ }
15848
+
15849
+ aConverted[bKey] = aValue;
15850
+ }); // update the type to match B
15851
+
15852
+ aConverted.type = bCommand.type;
15853
+ aCommand = aConverted;
15854
+ }
15855
+
15856
+ return aCommand;
15857
+ }
15858
+ /**
15859
+ * Interpolate between command objects commandStart and commandEnd segmentCount times.
15860
+ * If the types are L, Q, or C then the curves are split as per de Casteljau's algorithm.
15861
+ * Otherwise we just copy commandStart segmentCount - 1 times, finally ending with commandEnd.
15862
+ *
15863
+ * @param {Object} commandStart Command object at the beginning of the segment
15864
+ * @param {Object} commandEnd Command object at the end of the segment
15865
+ * @param {Number} segmentCount The number of segments to split this into. If only 1
15866
+ * Then [commandEnd] is returned.
15867
+ * @return {Object[]} Array of ~segmentCount command objects between commandStart and
15868
+ * commandEnd. (Can be segmentCount+1 objects if commandStart is type M).
15869
+ */
15870
+
15871
+
15872
+ function splitSegment(commandStart, commandEnd, segmentCount) {
15873
+ var segments = []; // line, quadratic bezier, or cubic bezier
15874
+
15875
+ if (commandEnd.type === 'L' || commandEnd.type === 'Q' || commandEnd.type === 'C') {
15876
+ segments = segments.concat(splitCurve(commandStart, commandEnd, segmentCount)); // general case - just copy the same point
15877
+ } else {
15878
+ var copyCommand = _extends({}, commandStart); // convert M to L
15879
+
15880
+
15881
+ if (copyCommand.type === 'M') {
15882
+ copyCommand.type = 'L';
15883
+ }
15884
+
15885
+ segments = segments.concat(arrayOfLength(segmentCount - 1).map(function () {
15886
+ return copyCommand;
15887
+ }));
15888
+ segments.push(commandEnd);
15889
+ }
15890
+
15891
+ return segments;
15892
+ }
15893
+ /**
15894
+ * Extends an array of commandsToExtend to the length of the referenceCommands by
15895
+ * splitting segments until the number of commands match. Ensures all the actual
15896
+ * points of commandsToExtend are in the extended array.
15897
+ *
15898
+ * @param {Object[]} commandsToExtend The command object array to extend
15899
+ * @param {Object[]} referenceCommands The command object array to match in length
15900
+ * @param {Function} excludeSegment a function that takes a start command object and
15901
+ * end command object and returns true if the segment should be excluded from splitting.
15902
+ * @return {Object[]} The extended commandsToExtend array
15903
+ */
15904
+
15905
+
15906
+ function extend(commandsToExtend, referenceCommands, excludeSegment) {
15907
+ // compute insertion points:
15908
+ // number of segments in the path to extend
15909
+ var numSegmentsToExtend = commandsToExtend.length - 1; // number of segments in the reference path.
15910
+
15911
+ var numReferenceSegments = referenceCommands.length - 1; // this value is always between [0, 1].
15912
+
15913
+ var segmentRatio = numSegmentsToExtend / numReferenceSegments; // create a map, mapping segments in referenceCommands to how many points
15914
+ // should be added in that segment (should always be >= 1 since we need each
15915
+ // point itself).
15916
+ // 0 = segment 0-1, 1 = segment 1-2, n-1 = last vertex
15917
+
15918
+ var countPointsPerSegment = arrayOfLength(numReferenceSegments).reduce(function (accum, d, i) {
15919
+ var insertIndex = Math.floor(segmentRatio * i); // handle excluding segments
15920
+
15921
+ if (excludeSegment && insertIndex < commandsToExtend.length - 1 && excludeSegment(commandsToExtend[insertIndex], commandsToExtend[insertIndex + 1])) {
15922
+ // set the insertIndex to the segment that this point should be added to:
15923
+ // round the insertIndex essentially so we split half and half on
15924
+ // neighbouring segments. hence the segmentRatio * i < 0.5
15925
+ var addToPriorSegment = segmentRatio * i % 1 < 0.5; // only skip segment if we already have 1 point in it (can't entirely remove a segment)
15926
+
15927
+ if (accum[insertIndex]) {
15928
+ // TODO - Note this is a naive algorithm that should work for most d3-area use cases
15929
+ // but if two adjacent segments are supposed to be skipped, this will not perform as
15930
+ // expected. Could be updated to search for nearest segment to place the point in, but
15931
+ // will only do that if necessary.
15932
+ // add to the prior segment
15933
+ if (addToPriorSegment) {
15934
+ if (insertIndex > 0) {
15935
+ insertIndex -= 1; // not possible to add to previous so adding to next
15936
+ } else if (insertIndex < commandsToExtend.length - 1) {
15937
+ insertIndex += 1;
15938
+ } // add to next segment
15939
+
15940
+ } else if (insertIndex < commandsToExtend.length - 1) {
15941
+ insertIndex += 1; // not possible to add to next so adding to previous
15942
+ } else if (insertIndex > 0) {
15943
+ insertIndex -= 1;
15944
+ }
15945
+ }
15946
+ }
15947
+
15948
+ accum[insertIndex] = (accum[insertIndex] || 0) + 1;
15949
+ return accum;
15950
+ }, []); // extend each segment to have the correct number of points for a smooth interpolation
15951
+
15952
+ var extended = countPointsPerSegment.reduce(function (extended, segmentCount, i) {
15953
+ // if last command, just add `segmentCount` number of times
15954
+ if (i === commandsToExtend.length - 1) {
15955
+ var lastCommandCopies = arrayOfLength(segmentCount, _extends({}, commandsToExtend[commandsToExtend.length - 1])); // convert M to L
15956
+
15957
+ if (lastCommandCopies[0].type === 'M') {
15958
+ lastCommandCopies.forEach(function (d) {
15959
+ d.type = 'L';
15960
+ });
15961
+ }
15962
+
15963
+ return extended.concat(lastCommandCopies);
15964
+ } // otherwise, split the segment segmentCount times.
15965
+
15966
+
15967
+ return extended.concat(splitSegment(commandsToExtend[i], commandsToExtend[i + 1], segmentCount));
15968
+ }, []); // add in the very first point since splitSegment only adds in the ones after it
15969
+
15970
+ extended.unshift(commandsToExtend[0]);
15971
+ return extended;
15972
+ }
15973
+ /**
15974
+ * Takes a path `d` string and converts it into an array of command
15975
+ * objects. Drops the `Z` character.
15976
+ *
15977
+ * @param {String|null} d A path `d` string
15978
+ */
15979
+
15980
+
15981
+ function pathCommandsFromString(d) {
15982
+ // split into valid tokens
15983
+ var tokens = (d || '').match(commandTokenRegex) || [];
15984
+ var commands = [];
15985
+ var commandArgs;
15986
+ var command; // iterate over each token, checking if we are at a new command
15987
+ // by presence in the typeMap
15988
+
15989
+ for (var i = 0; i < tokens.length; ++i) {
15990
+ commandArgs = typeMap[tokens[i]]; // new command found:
15991
+
15992
+ if (commandArgs) {
15993
+ command = {
15994
+ type: tokens[i]
15995
+ }; // add each of the expected args for this command:
15996
+
15997
+ for (var a = 0; a < commandArgs.length; ++a) {
15998
+ command[commandArgs[a]] = +tokens[i + a + 1];
15999
+ } // need to increment our token index appropriately since
16000
+ // we consumed token args
16001
+
16002
+
16003
+ i += commandArgs.length;
16004
+ commands.push(command);
16005
+ }
16006
+ }
16007
+
16008
+ return commands;
16009
+ }
16010
+ /**
16011
+ * Interpolate from A to B by extending A and B during interpolation to have
16012
+ * the same number of points. This allows for a smooth transition when they
16013
+ * have a different number of points.
16014
+ *
16015
+ * Ignores the `Z` command in paths unless both A and B end with it.
16016
+ *
16017
+ * This function works directly with arrays of command objects instead of with
16018
+ * path `d` strings (see interpolatePath for working with `d` strings).
16019
+ *
16020
+ * @param {Object[]} aCommandsInput Array of path commands
16021
+ * @param {Object[]} bCommandsInput Array of path commands
16022
+ * @param {(Function|Object)} interpolateOptions
16023
+ * @param {Function} interpolateOptions.excludeSegment a function that takes a start command object and
16024
+ * end command object and returns true if the segment should be excluded from splitting.
16025
+ * @param {Boolean} interpolateOptions.snapEndsToInput a boolean indicating whether end of input should
16026
+ * be sourced from input argument or computed.
16027
+ * @returns {Function} Interpolation function that maps t ([0, 1]) to an array of path commands.
16028
+ */
16029
+
16030
+ function interpolatePathCommands(aCommandsInput, bCommandsInput, interpolateOptions) {
16031
+ // make a copy so we don't mess with the input arrays
16032
+ var aCommands = aCommandsInput == null ? [] : aCommandsInput.slice();
16033
+ var bCommands = bCommandsInput == null ? [] : bCommandsInput.slice();
16034
+
16035
+ var _ref = _typeof(interpolateOptions) === 'object' ? interpolateOptions : {
16036
+ excludeSegment: interpolateOptions,
16037
+ snapEndsToInput: true
16038
+ },
16039
+ excludeSegment = _ref.excludeSegment,
16040
+ snapEndsToInput = _ref.snapEndsToInput; // both input sets are empty, so we don't interpolate
16041
+
16042
+
16043
+ if (!aCommands.length && !bCommands.length) {
16044
+ return function nullInterpolator() {
16045
+ return [];
16046
+ };
16047
+ } // do we add Z during interpolation? yes if both have it. (we'd expect both to have it or not)
16048
+
16049
+
16050
+ var addZ = (aCommands.length === 0 || aCommands[aCommands.length - 1].type === 'Z') && (bCommands.length === 0 || bCommands[bCommands.length - 1].type === 'Z'); // we temporarily remove Z
16051
+
16052
+ if (aCommands.length > 0 && aCommands[aCommands.length - 1].type === 'Z') {
16053
+ aCommands.pop();
16054
+ }
16055
+
16056
+ if (bCommands.length > 0 && bCommands[bCommands.length - 1].type === 'Z') {
16057
+ bCommands.pop();
16058
+ } // if A is empty, treat it as if it used to contain just the first point
16059
+ // of B. This makes it so the line extends out of from that first point.
16060
+
16061
+
16062
+ if (!aCommands.length) {
16063
+ aCommands.push(bCommands[0]); // otherwise if B is empty, treat it as if it contains the first point
16064
+ // of A. This makes it so the line retracts into the first point.
16065
+ } else if (!bCommands.length) {
16066
+ bCommands.push(aCommands[0]);
16067
+ } // extend to match equal size
16068
+
16069
+
16070
+ var numPointsToExtend = Math.abs(bCommands.length - aCommands.length);
16071
+
16072
+ if (numPointsToExtend !== 0) {
16073
+ // B has more points than A, so add points to A before interpolating
16074
+ if (bCommands.length > aCommands.length) {
16075
+ aCommands = extend(aCommands, bCommands, excludeSegment); // else if A has more points than B, add more points to B
16076
+ } else if (bCommands.length < aCommands.length) {
16077
+ bCommands = extend(bCommands, aCommands, excludeSegment);
16078
+ }
16079
+ } // commands have same length now.
16080
+ // convert commands in A to the same type as those in B
16081
+
16082
+
16083
+ aCommands = aCommands.map(function (aCommand, i) {
16084
+ return convertToSameType(aCommand, bCommands[i]);
16085
+ }); // create mutable interpolated command objects
16086
+
16087
+ var interpolatedCommands = aCommands.map(function (aCommand) {
16088
+ return _objectSpread2({}, aCommand);
16089
+ });
16090
+
16091
+ if (addZ) {
16092
+ interpolatedCommands.push({
16093
+ type: 'Z'
16094
+ });
16095
+ aCommands.push({
16096
+ type: 'Z'
16097
+ }); // required for when returning at t == 0
16098
+ }
16099
+
16100
+ return function pathCommandInterpolator(t) {
16101
+ // at 1 return the final value without the extensions used during interpolation
16102
+ if (t === 1 && snapEndsToInput) {
16103
+ return bCommandsInput == null ? [] : bCommandsInput;
16104
+ } // work with aCommands directly since interpolatedCommands are mutated
16105
+
16106
+
16107
+ if (t === 0) {
16108
+ return aCommands;
16109
+ } // interpolate the commands using the mutable interpolated command objs
16110
+
16111
+
16112
+ for (var i = 0; i < interpolatedCommands.length; ++i) {
16113
+ // if (interpolatedCommands[i].type === 'Z') continue;
16114
+ var aCommand = aCommands[i];
16115
+ var bCommand = bCommands[i];
16116
+ var interpolatedCommand = interpolatedCommands[i];
16117
+
16118
+ var _iterator = _createForOfIteratorHelper(typeMap[interpolatedCommand.type]),
16119
+ _step;
16120
+
16121
+ try {
16122
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
16123
+ var arg = _step.value;
16124
+ interpolatedCommand[arg] = (1 - t) * aCommand[arg] + t * bCommand[arg]; // do not use floats for flags (#27), round to integer
16125
+
16126
+ if (arg === 'largeArcFlag' || arg === 'sweepFlag') {
16127
+ interpolatedCommand[arg] = Math.round(interpolatedCommand[arg]);
16128
+ }
16129
+ }
16130
+ } catch (err) {
16131
+ _iterator.e(err);
16132
+ } finally {
16133
+ _iterator.f();
16134
+ }
16135
+ }
16136
+
16137
+ return interpolatedCommands;
16138
+ };
16139
+ }
16140
+ /** @typedef InterpolateOptions */
16141
+
16142
+ /**
16143
+ * Interpolate from A to B by extending A and B during interpolation to have
16144
+ * the same number of points. This allows for a smooth transition when they
16145
+ * have a different number of points.
16146
+ *
16147
+ * Ignores the `Z` character in paths unless both A and B end with it.
16148
+ *
16149
+ * @param {String} a The `d` attribute for a path
16150
+ * @param {String} b The `d` attribute for a path
16151
+ * @param {((command1, command2) => boolean|{
16152
+ * excludeSegment?: (command1, command2) => boolean;
16153
+ * snapEndsToInput?: boolean
16154
+ * })} interpolateOptions The excludeSegment function or an options object
16155
+ * - interpolateOptions.excludeSegment a function that takes a start command object and
16156
+ * end command object and returns true if the segment should be excluded from splitting.
16157
+ * - interpolateOptions.snapEndsToInput a boolean indicating whether end of input should
16158
+ * be sourced from input argument or computed.
16159
+ * @returns {Function} Interpolation function that maps t ([0, 1]) to a path `d` string.
16160
+ */
16161
+
16162
+ function interpolatePath(a, b, interpolateOptions) {
16163
+ var aCommands = pathCommandsFromString(a);
16164
+ var bCommands = pathCommandsFromString(b);
16165
+
16166
+ var _ref2 = _typeof(interpolateOptions) === 'object' ? interpolateOptions : {
16167
+ excludeSegment: interpolateOptions,
16168
+ snapEndsToInput: true
16169
+ },
16170
+ excludeSegment = _ref2.excludeSegment,
16171
+ snapEndsToInput = _ref2.snapEndsToInput;
16172
+
16173
+ if (!aCommands.length && !bCommands.length) {
16174
+ return function nullInterpolator() {
16175
+ return '';
16176
+ };
16177
+ }
16178
+
16179
+ var commandInterpolator = interpolatePathCommands(aCommands, bCommands, {
16180
+ excludeSegment: excludeSegment,
16181
+ snapEndsToInput: snapEndsToInput
16182
+ });
16183
+ return function pathStringInterpolator(t) {
16184
+ // at 1 return the final value without the extensions used during interpolation
16185
+ if (t === 1 && snapEndsToInput) {
16186
+ return b == null ? '' : b;
16187
+ }
16188
+
16189
+ var interpolatedCommands = commandInterpolator(t); // convert to a string (fastest concat: https://jsperf.com/join-concat/150)
16190
+
16191
+ var interpolatedString = '';
16192
+
16193
+ var _iterator2 = _createForOfIteratorHelper(interpolatedCommands),
16194
+ _step2;
16195
+
16196
+ try {
16197
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
16198
+ var interpolatedCommand = _step2.value;
16199
+ interpolatedString += commandToString(interpolatedCommand);
16200
+ }
16201
+ } catch (err) {
16202
+ _iterator2.e(err);
16203
+ } finally {
16204
+ _iterator2.f();
16205
+ }
16206
+
16207
+ return interpolatedString;
16208
+ };
16209
+ }
16210
+
15442
16211
  var lineBasis$2 = d3Line()
15443
16212
  .x(function (d) { return d[0]; })
15444
16213
  .y(function (d) { return d[1]; })
@@ -15584,9 +16353,21 @@
15584
16353
  delete v.fx;
15585
16354
  delete v.fy;
15586
16355
  var bbox = v.element.node().getBBox();
15587
- return __assign({ width: bbox.width, height: bbox.height }, v.props);
16356
+ return __assign(__assign({ width: bbox.width, height: bbox.height }, v.props), { id: String(v.id) });
16357
+ }),
16358
+ links: data.allEdges().map(function (e) {
16359
+ return {
16360
+ id: String(e.props.id),
16361
+ source: {
16362
+ id: String(e.source.props.id),
16363
+ text: e.source.props.text,
16364
+ },
16365
+ target: {
16366
+ id: String(e.target.props.id),
16367
+ text: e.target.props.text,
16368
+ }
16369
+ };
15588
16370
  }),
15589
- links: data.allEdges().map(function (e) { return e.props; }),
15590
16371
  hierarchy: __spreadArray(__spreadArray([], data.allSubgraphs()
15591
16372
  .filter(function (s) { return !!data.subgraphParent(s.id); })
15592
16373
  .map(function (s) { return ({
@@ -15596,7 +16377,7 @@
15596
16377
  .filter(function (v) { return data.vertexParent(v.id) !== undefined; })
15597
16378
  .map(function (v) { return ({
15598
16379
  parent: clusterID(data.vertexParent(v.id).props.id),
15599
- child: v.id
16380
+ child: String(v.id)
15600
16381
  }); }), true)
15601
16382
  }, this._options).response.then(function (response) {
15602
16383
  if (_this.running()) {
@@ -15687,8 +16468,8 @@
15687
16468
  .strength(_this._options.forceStrength);
15688
16469
  _this._simulation = d3ForceSimulation(vertices.map(function (v) {
15689
16470
  var _a = v.element.node().getBBox(), width = _a.width, height = _a.height;
15690
- v.fx = (_this._options.pinCentroid && v.centroid) ? size.width / 2 : undefined;
15691
- v.fy = (_this._options.pinCentroid && v.centroid) ? size.height / 2 : undefined;
16471
+ v.fx = (_this._options.pinCentroid && v.props.centroid) ? size.width / 2 : undefined;
16472
+ v.fy = (_this._options.pinCentroid && v.props.centroid) ? size.height / 2 : undefined;
15692
16473
  v["width"] = width;
15693
16474
  v["height"] = height;
15694
16475
  return v;
@@ -15759,7 +16540,7 @@
15759
16540
 
15760
16541
  function graphviz$1(data, options) {
15761
16542
  // eslint-disable-next-line quotes
15762
- var workerCode = "!function(){\"use strict\";function r(r,e,t){if(t||2===arguments.length)for(var n,o=0,i=e.length;o<i;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return r.concat(n||Array.prototype.slice.call(e))}\"undefined\"!=typeof document&&document.currentScript&&document.currentScript.src;let e=function(){if(\"undefined\"!=typeof self)return self;if(\"undefined\"!=typeof window)return window;if(\"undefined\"!=typeof global)return global;throw new Error(\"unable to locate global object\")}().__hpcc_wasmFolder||void 0;let t=\"undefined\"!=typeof document&&document.currentScript?document.currentScript.src:\"undefined\"!=typeof __filename?__filename:\"undefined\"!=typeof document&&document.currentScript?document.currentScript.src:\"\";t=t.substr(0,t.replace(/[?#].*/,\"\").lastIndexOf(\"/\")+1);const n={};async function o(r,e,t){const n=r.default||r;return t||(t=await async function(r){return fetch(r,{credentials:\"same-origin\"}).then((e=>{if(!e.ok)throw\"failed to load wasm binary file at '\"+r+\"'\";return e.arrayBuffer()})).catch((r=>{throw r}))}(e)),await n({wasmBinary:t})}async function i(r,i,a,s){const u=`${function(r,e){for(;r.charAt(r.length-1)===e;)r=r.substring(0,r.length-1);return r}(a||function(r){if(!arguments.length)return e;const t=e;return e=r,t}()||t||\".\",\"/\")}/${function(r,e){for(;r.charAt(0)===e;)r=r.substring(1);return r}(`${i}.wasm`,\"/\")}`;return n[u]||(n[u]=o(r,u,s)),n[u]}var a=(()=>{var r=\"undefined\"!=typeof document&&document.currentScript?document.currentScript.src:void 0;return function(e){var t,n,o=void 0!==(e=e||{})?e:{};o.ready=new Promise((function(r,e){t=r,n=e}));var i,a,s=Object.assign({},o),u=\"./this.program\",c=(r,e)=>{throw e},l=\"\";\"undefined\"!=typeof document&&document.currentScript&&(l=document.currentScript.src),r&&(l=r),l=0!==l.indexOf(\"blob:\")?l.substr(0,l.replace(/[?#].*/,\"\").lastIndexOf(\"/\")+1):\"\",i=r=>{var e=new XMLHttpRequest;return e.open(\"GET\",r,!1),e.send(null),e.responseText},a=(r,e,t)=>{var n=new XMLHttpRequest;n.open(\"GET\",r,!0),n.responseType=\"arraybuffer\",n.onload=()=>{200==n.status||0==n.status&&n.response?e(n.response):t()},n.onerror=t,n.send(null)};var f,d=o.print||console.log.bind(console),p=o.printErr||console.warn.bind(console);Object.assign(o,s),s=null,o.arguments&&o.arguments,o.thisProgram&&(u=o.thisProgram),o.quit&&(c=o.quit),o.wasmBinary&&(f=o.wasmBinary);var h,m=o.noExitRuntime||!0;\"object\"!=typeof WebAssembly&&C(\"no native wasm support detected\");var v=!1;function w(r,e){r||C(e)}var y,_,g,E,b,k,S,D=\"undefined\"!=typeof TextDecoder?new TextDecoder(\"utf8\"):void 0;function A(r,e,t){for(var n=e+t,o=e;r[o]&&!(o>=n);)++o;if(o-e>16&&r.buffer&&D)return D.decode(r.subarray(e,o));for(var i=\"\";e<o;){var a=r[e++];if(128&a){var s=63&r[e++];if(192!=(224&a)){var u=63&r[e++];if((a=224==(240&a)?(15&a)<<12|s<<6|u:(7&a)<<18|s<<12|u<<6|63&r[e++])<65536)i+=String.fromCharCode(a);else{var c=a-65536;i+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i}function F(r,e){return r?A(g,r,e):\"\"}function M(r,e,t,n){if(!(n>0))return 0;for(var o=t,i=t+n-1,a=0;a<r.length;++a){var s=r.charCodeAt(a);if(s>=55296&&s<=57343)s=65536+((1023&s)<<10)|1023&r.charCodeAt(++a);if(s<=127){if(t>=i)break;e[t++]=s}else if(s<=2047){if(t+1>=i)break;e[t++]=192|s>>6,e[t++]=128|63&s}else if(s<=65535){if(t+2>=i)break;e[t++]=224|s>>12,e[t++]=128|s>>6&63,e[t++]=128|63&s}else{if(t+3>=i)break;e[t++]=240|s>>18,e[t++]=128|s>>12&63,e[t++]=128|s>>6&63,e[t++]=128|63&s}}return e[t]=0,t-o}function P(r){for(var e=0,t=0;t<r.length;++t){var n=r.charCodeAt(t);n<=127?e++:n<=2047?e+=2:n>=55296&&n<=57343?(e+=4,++t):e+=3}return e}function x(r){y=r,o.HEAP8=_=new Int8Array(r),o.HEAP16=E=new Int16Array(r),o.HEAP32=b=new Int32Array(r),o.HEAPU8=g=new Uint8Array(r),o.HEAPU16=new Uint16Array(r),o.HEAPU32=k=new Uint32Array(r),o.HEAPF32=new Float32Array(r),o.HEAPF64=S=new Float64Array(r)}o.INITIAL_MEMORY;var j=[],z=[],T=[];var R=0,B=null;function N(r){R++,o.monitorRunDependencies&&o.monitorRunDependencies(R)}function O(r){if(R--,o.monitorRunDependencies&&o.monitorRunDependencies(R),0==R&&B){var e=B;B=null,e()}}function C(r){o.onAbort&&o.onAbort(r),p(r=\"Aborted(\"+r+\")\"),v=!0,r+=\". Build with -sASSERTIONS for more info.\";var e=new WebAssembly.RuntimeError(r);throw n(e),e}var L,I,G,U;function H(r){return r.startsWith(\"data:application/octet-stream;base64,\")}function q(r){try{if(r==L&&f)return new Uint8Array(f);throw\"both async and sync fetching of the wasm failed\"}catch(r){C(r)}}H(L=\"graphvizlib.wasm\")||(I=L,L=o.locateFile?o.locateFile(I,l):l+I);var V={163520:(r,e)=>{var t=F(r),n=F(e);rr.createPath(\"/\",Y.dirname(t)),rr.writeFile(Y.join(\"/\",t),n)}};function W(r){this.name=\"ExitStatus\",this.message=\"Program terminated with exit(\"+r+\")\",this.status=r}function X(r){for(;r.length>0;)r.shift()(o)}var Y={isAbs:r=>\"/\"===r.charAt(0),splitPath:r=>/^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/.exec(r).slice(1),normalizeArray:(r,e)=>{for(var t=0,n=r.length-1;n>=0;n--){var o=r[n];\".\"===o?r.splice(n,1):\"..\"===o?(r.splice(n,1),t++):t&&(r.splice(n,1),t--)}if(e)for(;t;t--)r.unshift(\"..\");return r},normalize:r=>{var e=Y.isAbs(r),t=\"/\"===r.substr(-1);return(r=Y.normalizeArray(r.split(\"/\").filter((r=>!!r)),!e).join(\"/\"))||e||(r=\".\"),r&&t&&(r+=\"/\"),(e?\"/\":\"\")+r},dirname:r=>{var e=Y.splitPath(r),t=e[0],n=e[1];return t||n?(n&&(n=n.substr(0,n.length-1)),t+n):\".\"},basename:r=>{if(\"/\"===r)return\"/\";var e=(r=(r=Y.normalize(r)).replace(/\\/$/,\"\")).lastIndexOf(\"/\");return-1===e?r:r.substr(e+1)},join:function(){var r=Array.prototype.slice.call(arguments);return Y.normalize(r.join(\"/\"))},join2:(r,e)=>Y.normalize(r+\"/\"+e)};var $={resolve:function(){for(var r=\"\",e=!1,t=arguments.length-1;t>=-1&&!e;t--){var n=t>=0?arguments[t]:rr.cwd();if(\"string\"!=typeof n)throw new TypeError(\"Arguments to path.resolve must be strings\");if(!n)return\"\";r=n+\"/\"+r,e=Y.isAbs(n)}return(e?\"/\":\"\")+(r=Y.normalizeArray(r.split(\"/\").filter((r=>!!r)),!e).join(\"/\"))||\".\"},relative:(r,e)=>{function t(r){for(var e=0;e<r.length&&\"\"===r[e];e++);for(var t=r.length-1;t>=0&&\"\"===r[t];t--);return e>t?[]:r.slice(e,t-e+1)}r=$.resolve(r).substr(1),e=$.resolve(e).substr(1);for(var n=t(r.split(\"/\")),o=t(e.split(\"/\")),i=Math.min(n.length,o.length),a=i,s=0;s<i;s++)if(n[s]!==o[s]){a=s;break}var u=[];for(s=a;s<n.length;s++)u.push(\"..\");return(u=u.concat(o.slice(a))).join(\"/\")}};function K(r,e,t){var n=t>0?t:P(r)+1,o=new Array(n),i=M(r,o,0,o.length);return e&&(o.length=i),o}var J={ttys:[],init:function(){},shutdown:function(){},register:function(r,e){J.ttys[r]={input:[],output:[],ops:e},rr.registerDevice(r,J.stream_ops)},stream_ops:{open:function(r){var e=J.ttys[r.node.rdev];if(!e)throw new rr.ErrnoError(43);r.tty=e,r.seekable=!1},close:function(r){r.tty.ops.fsync(r.tty)},fsync:function(r){r.tty.ops.fsync(r.tty)},read:function(r,e,t,n,o){if(!r.tty||!r.tty.ops.get_char)throw new rr.ErrnoError(60);for(var i=0,a=0;a<n;a++){var s;try{s=r.tty.ops.get_char(r.tty)}catch(r){throw new rr.ErrnoError(29)}if(void 0===s&&0===i)throw new rr.ErrnoError(6);if(null==s)break;i++,e[t+a]=s}return i&&(r.node.timestamp=Date.now()),i},write:function(r,e,t,n,o){if(!r.tty||!r.tty.ops.put_char)throw new rr.ErrnoError(60);try{for(var i=0;i<n;i++)r.tty.ops.put_char(r.tty,e[t+i])}catch(r){throw new rr.ErrnoError(29)}return n&&(r.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:function(r){if(!r.input.length){var e=null;if(\"undefined\"!=typeof window&&\"function\"==typeof window.prompt?null!==(e=window.prompt(\"Input: \"))&&(e+=\"\\n\"):\"function\"==typeof readline&&null!==(e=readline())&&(e+=\"\\n\"),!e)return null;r.input=K(e,!0)}return r.input.shift()},put_char:function(r,e){null===e||10===e?(d(A(r.output,0)),r.output=[]):0!=e&&r.output.push(e)},fsync:function(r){r.output&&r.output.length>0&&(d(A(r.output,0)),r.output=[])}},default_tty1_ops:{put_char:function(r,e){null===e||10===e?(p(A(r.output,0)),r.output=[]):0!=e&&r.output.push(e)},fsync:function(r){r.output&&r.output.length>0&&(p(A(r.output,0)),r.output=[])}}};function Q(r){r=function(r,e){return Math.ceil(r/e)*e}(r,65536);var e=Er(65536,r);return e?function(r,e){return g.fill(0,r,r+e),r}(e,r):0}var Z={ops_table:null,mount:function(r){return Z.createNode(null,\"/\",16895,0)},createNode:function(r,e,t,n){if(rr.isBlkdev(t)||rr.isFIFO(t))throw new rr.ErrnoError(63);Z.ops_table||(Z.ops_table={dir:{node:{getattr:Z.node_ops.getattr,setattr:Z.node_ops.setattr,lookup:Z.node_ops.lookup,mknod:Z.node_ops.mknod,rename:Z.node_ops.rename,unlink:Z.node_ops.unlink,rmdir:Z.node_ops.rmdir,readdir:Z.node_ops.readdir,symlink:Z.node_ops.symlink},stream:{llseek:Z.stream_ops.llseek}},file:{node:{getattr:Z.node_ops.getattr,setattr:Z.node_ops.setattr},stream:{llseek:Z.stream_ops.llseek,read:Z.stream_ops.read,write:Z.stream_ops.write,allocate:Z.stream_ops.allocate,mmap:Z.stream_ops.mmap,msync:Z.stream_ops.msync}},link:{node:{getattr:Z.node_ops.getattr,setattr:Z.node_ops.setattr,readlink:Z.node_ops.readlink},stream:{}},chrdev:{node:{getattr:Z.node_ops.getattr,setattr:Z.node_ops.setattr},stream:rr.chrdev_stream_ops}});var o=rr.createNode(r,e,t,n);return rr.isDir(o.mode)?(o.node_ops=Z.ops_table.dir.node,o.stream_ops=Z.ops_table.dir.stream,o.contents={}):rr.isFile(o.mode)?(o.node_ops=Z.ops_table.file.node,o.stream_ops=Z.ops_table.file.stream,o.usedBytes=0,o.contents=null):rr.isLink(o.mode)?(o.node_ops=Z.ops_table.link.node,o.stream_ops=Z.ops_table.link.stream):rr.isChrdev(o.mode)&&(o.node_ops=Z.ops_table.chrdev.node,o.stream_ops=Z.ops_table.chrdev.stream),o.timestamp=Date.now(),r&&(r.contents[e]=o,r.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(r){return r.contents?r.contents.subarray?r.contents.subarray(0,r.usedBytes):new Uint8Array(r.contents):new Uint8Array(0)},expandFileStorage:function(r,e){var t=r.contents?r.contents.length:0;if(!(t>=e)){e=Math.max(e,t*(t<1048576?2:1.125)>>>0),0!=t&&(e=Math.max(e,256));var n=r.contents;r.contents=new Uint8Array(e),r.usedBytes>0&&r.contents.set(n.subarray(0,r.usedBytes),0)}},resizeFileStorage:function(r,e){if(r.usedBytes!=e)if(0==e)r.contents=null,r.usedBytes=0;else{var t=r.contents;r.contents=new Uint8Array(e),t&&r.contents.set(t.subarray(0,Math.min(e,r.usedBytes))),r.usedBytes=e}},node_ops:{getattr:function(r){var e={};return e.dev=rr.isChrdev(r.mode)?r.id:1,e.ino=r.id,e.mode=r.mode,e.nlink=1,e.uid=0,e.gid=0,e.rdev=r.rdev,rr.isDir(r.mode)?e.size=4096:rr.isFile(r.mode)?e.size=r.usedBytes:rr.isLink(r.mode)?e.size=r.link.length:e.size=0,e.atime=new Date(r.timestamp),e.mtime=new Date(r.timestamp),e.ctime=new Date(r.timestamp),e.blksize=4096,e.blocks=Math.ceil(e.size/e.blksize),e},setattr:function(r,e){void 0!==e.mode&&(r.mode=e.mode),void 0!==e.timestamp&&(r.timestamp=e.timestamp),void 0!==e.size&&Z.resizeFileStorage(r,e.size)},lookup:function(r,e){throw rr.genericErrors[44]},mknod:function(r,e,t,n){return Z.createNode(r,e,t,n)},rename:function(r,e,t){if(rr.isDir(r.mode)){var n;try{n=rr.lookupNode(e,t)}catch(r){}if(n)for(var o in n.contents)throw new rr.ErrnoError(55)}delete r.parent.contents[r.name],r.parent.timestamp=Date.now(),r.name=t,e.contents[t]=r,e.timestamp=r.parent.timestamp,r.parent=e},unlink:function(r,e){delete r.contents[e],r.timestamp=Date.now()},rmdir:function(r,e){var t=rr.lookupNode(r,e);for(var n in t.contents)throw new rr.ErrnoError(55);delete r.contents[e],r.timestamp=Date.now()},readdir:function(r){var e=[\".\",\"..\"];for(var t in r.contents)r.contents.hasOwnProperty(t)&&e.push(t);return e},symlink:function(r,e,t){var n=Z.createNode(r,e,41471,0);return n.link=t,n},readlink:function(r){if(!rr.isLink(r.mode))throw new rr.ErrnoError(28);return r.link}},stream_ops:{read:function(r,e,t,n,o){var i=r.node.contents;if(o>=r.node.usedBytes)return 0;var a=Math.min(r.node.usedBytes-o,n);if(a>8&&i.subarray)e.set(i.subarray(o,o+a),t);else for(var s=0;s<a;s++)e[t+s]=i[o+s];return a},write:function(r,e,t,n,o,i){if(e.buffer===_.buffer&&(i=!1),!n)return 0;var a=r.node;if(a.timestamp=Date.now(),e.subarray&&(!a.contents||a.contents.subarray)){if(i)return a.contents=e.subarray(t,t+n),a.usedBytes=n,n;if(0===a.usedBytes&&0===o)return a.contents=e.slice(t,t+n),a.usedBytes=n,n;if(o+n<=a.usedBytes)return a.contents.set(e.subarray(t,t+n),o),n}if(Z.expandFileStorage(a,o+n),a.contents.subarray&&e.subarray)a.contents.set(e.subarray(t,t+n),o);else for(var s=0;s<n;s++)a.contents[o+s]=e[t+s];return a.usedBytes=Math.max(a.usedBytes,o+n),n},llseek:function(r,e,t){var n=e;if(1===t?n+=r.position:2===t&&rr.isFile(r.node.mode)&&(n+=r.node.usedBytes),n<0)throw new rr.ErrnoError(28);return n},allocate:function(r,e,t){Z.expandFileStorage(r.node,e+t),r.node.usedBytes=Math.max(r.node.usedBytes,e+t)},mmap:function(r,e,t,n,o){if(!rr.isFile(r.node.mode))throw new rr.ErrnoError(43);var i,a,s=r.node.contents;if(2&o||s.buffer!==y){if((t>0||t+e<s.length)&&(s=s.subarray?s.subarray(t,t+e):Array.prototype.slice.call(s,t,t+e)),a=!0,!(i=Q(e)))throw new rr.ErrnoError(48);_.set(s,i)}else a=!1,i=s.byteOffset;return{ptr:i,allocated:a}},msync:function(r,e,t,n,o){if(!rr.isFile(r.node.mode))throw new rr.ErrnoError(43);return 2&o||Z.stream_ops.write(r,e,0,n,t,!1),0}}};var rr={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:\"/\",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:(r,e={})=>{if(!(r=$.resolve(rr.cwd(),r)))return{path:\"\",node:null};if((e=Object.assign({follow_mount:!0,recurse_count:0},e)).recurse_count>8)throw new rr.ErrnoError(32);for(var t=Y.normalizeArray(r.split(\"/\").filter((r=>!!r)),!1),n=rr.root,o=\"/\",i=0;i<t.length;i++){var a=i===t.length-1;if(a&&e.parent)break;if(n=rr.lookupNode(n,t[i]),o=Y.join2(o,t[i]),rr.isMountpoint(n)&&(!a||a&&e.follow_mount)&&(n=n.mounted.root),!a||e.follow)for(var s=0;rr.isLink(n.mode);){var u=rr.readlink(o);if(o=$.resolve(Y.dirname(o),u),n=rr.lookupPath(o,{recurse_count:e.recurse_count+1}).node,s++>40)throw new rr.ErrnoError(32)}}return{path:o,node:n}},getPath:r=>{for(var e;;){if(rr.isRoot(r)){var t=r.mount.mountpoint;return e?\"/\"!==t[t.length-1]?t+\"/\"+e:t+e:t}e=e?r.name+\"/\"+e:r.name,r=r.parent}},hashName:(r,e)=>{for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return(r+t>>>0)%rr.nameTable.length},hashAddNode:r=>{var e=rr.hashName(r.parent.id,r.name);r.name_next=rr.nameTable[e],rr.nameTable[e]=r},hashRemoveNode:r=>{var e=rr.hashName(r.parent.id,r.name);if(rr.nameTable[e]===r)rr.nameTable[e]=r.name_next;else for(var t=rr.nameTable[e];t;){if(t.name_next===r){t.name_next=r.name_next;break}t=t.name_next}},lookupNode:(r,e)=>{var t=rr.mayLookup(r);if(t)throw new rr.ErrnoError(t,r);for(var n=rr.hashName(r.id,e),o=rr.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===r.id&&i===e)return o}return rr.lookup(r,e)},createNode:(r,e,t,n)=>{var o=new rr.FSNode(r,e,t,n);return rr.hashAddNode(o),o},destroyNode:r=>{rr.hashRemoveNode(r)},isRoot:r=>r===r.parent,isMountpoint:r=>!!r.mounted,isFile:r=>32768==(61440&r),isDir:r=>16384==(61440&r),isLink:r=>40960==(61440&r),isChrdev:r=>8192==(61440&r),isBlkdev:r=>24576==(61440&r),isFIFO:r=>4096==(61440&r),isSocket:r=>49152==(49152&r),flagModes:{r:0,\"r+\":2,w:577,\"w+\":578,a:1089,\"a+\":1090},modeStringToFlags:r=>{var e=rr.flagModes[r];if(void 0===e)throw new Error(\"Unknown file open mode: \"+r);return e},flagsToPermissionString:r=>{var e=[\"r\",\"w\",\"rw\"][3&r];return 512&r&&(e+=\"w\"),e},nodePermissions:(r,e)=>rr.ignorePermissions||(!e.includes(\"r\")||292&r.mode)&&(!e.includes(\"w\")||146&r.mode)&&(!e.includes(\"x\")||73&r.mode)?0:2,mayLookup:r=>{var e=rr.nodePermissions(r,\"x\");return e||(r.node_ops.lookup?0:2)},mayCreate:(r,e)=>{try{rr.lookupNode(r,e);return 20}catch(r){}return rr.nodePermissions(r,\"wx\")},mayDelete:(r,e,t)=>{var n;try{n=rr.lookupNode(r,e)}catch(r){return r.errno}var o=rr.nodePermissions(r,\"wx\");if(o)return o;if(t){if(!rr.isDir(n.mode))return 54;if(rr.isRoot(n)||rr.getPath(n)===rr.cwd())return 10}else if(rr.isDir(n.mode))return 31;return 0},mayOpen:(r,e)=>r?rr.isLink(r.mode)?32:rr.isDir(r.mode)&&(\"r\"!==rr.flagsToPermissionString(e)||512&e)?31:rr.nodePermissions(r,rr.flagsToPermissionString(e)):44,MAX_OPEN_FDS:4096,nextfd:(r=0,e=rr.MAX_OPEN_FDS)=>{for(var t=r;t<=e;t++)if(!rr.streams[t])return t;throw new rr.ErrnoError(33)},getStream:r=>rr.streams[r],createStream:(r,e,t)=>{rr.FSStream||(rr.FSStream=function(){this.shared={}},rr.FSStream.prototype={},Object.defineProperties(rr.FSStream.prototype,{object:{get:function(){return this.node},set:function(r){this.node=r}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}},flags:{get:function(){return this.shared.flags},set:function(r){this.shared.flags=r}},position:{get:function(){return this.shared.position},set:function(r){this.shared.position=r}}})),r=Object.assign(new rr.FSStream,r);var n=rr.nextfd(e,t);return r.fd=n,rr.streams[n]=r,r},closeStream:r=>{rr.streams[r]=null},chrdev_stream_ops:{open:r=>{var e=rr.getDevice(r.node.rdev);r.stream_ops=e.stream_ops,r.stream_ops.open&&r.stream_ops.open(r)},llseek:()=>{throw new rr.ErrnoError(70)}},major:r=>r>>8,minor:r=>255&r,makedev:(r,e)=>r<<8|e,registerDevice:(r,e)=>{rr.devices[r]={stream_ops:e}},getDevice:r=>rr.devices[r],getMounts:r=>{for(var e=[],t=[r];t.length;){var n=t.pop();e.push(n),t.push.apply(t,n.mounts)}return e},syncfs:(r,e)=>{\"function\"==typeof r&&(e=r,r=!1),rr.syncFSRequests++,rr.syncFSRequests>1&&p(\"warning: \"+rr.syncFSRequests+\" FS.syncfs operations in flight at once, probably just doing extra work\");var t=rr.getMounts(rr.root.mount),n=0;function o(r){return rr.syncFSRequests--,e(r)}function i(r){if(r)return i.errored?void 0:(i.errored=!0,o(r));++n>=t.length&&o(null)}t.forEach((e=>{if(!e.type.syncfs)return i(null);e.type.syncfs(e,r,i)}))},mount:(r,e,t)=>{var n,o=\"/\"===t,i=!t;if(o&&rr.root)throw new rr.ErrnoError(10);if(!o&&!i){var a=rr.lookupPath(t,{follow_mount:!1});if(t=a.path,n=a.node,rr.isMountpoint(n))throw new rr.ErrnoError(10);if(!rr.isDir(n.mode))throw new rr.ErrnoError(54)}var s={type:r,opts:e,mountpoint:t,mounts:[]},u=r.mount(s);return u.mount=s,s.root=u,o?rr.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount:r=>{var e=rr.lookupPath(r,{follow_mount:!1});if(!rr.isMountpoint(e.node))throw new rr.ErrnoError(28);var t=e.node,n=t.mounted,o=rr.getMounts(n);Object.keys(rr.nameTable).forEach((r=>{for(var e=rr.nameTable[r];e;){var t=e.name_next;o.includes(e.mount)&&rr.destroyNode(e),e=t}})),t.mounted=null;var i=t.mount.mounts.indexOf(n);t.mount.mounts.splice(i,1)},lookup:(r,e)=>r.node_ops.lookup(r,e),mknod:(r,e,t)=>{var n=rr.lookupPath(r,{parent:!0}).node,o=Y.basename(r);if(!o||\".\"===o||\"..\"===o)throw new rr.ErrnoError(28);var i=rr.mayCreate(n,o);if(i)throw new rr.ErrnoError(i);if(!n.node_ops.mknod)throw new rr.ErrnoError(63);return n.node_ops.mknod(n,o,e,t)},create:(r,e)=>(e=void 0!==e?e:438,e&=4095,e|=32768,rr.mknod(r,e,0)),mkdir:(r,e)=>(e=void 0!==e?e:511,e&=1023,e|=16384,rr.mknod(r,e,0)),mkdirTree:(r,e)=>{for(var t=r.split(\"/\"),n=\"\",o=0;o<t.length;++o)if(t[o]){n+=\"/\"+t[o];try{rr.mkdir(n,e)}catch(r){if(20!=r.errno)throw r}}},mkdev:(r,e,t)=>(void 0===t&&(t=e,e=438),e|=8192,rr.mknod(r,e,t)),symlink:(r,e)=>{if(!$.resolve(r))throw new rr.ErrnoError(44);var t=rr.lookupPath(e,{parent:!0}).node;if(!t)throw new rr.ErrnoError(44);var n=Y.basename(e),o=rr.mayCreate(t,n);if(o)throw new rr.ErrnoError(o);if(!t.node_ops.symlink)throw new rr.ErrnoError(63);return t.node_ops.symlink(t,n,r)},rename:(r,e)=>{var t,n,o=Y.dirname(r),i=Y.dirname(e),a=Y.basename(r),s=Y.basename(e);if(t=rr.lookupPath(r,{parent:!0}).node,n=rr.lookupPath(e,{parent:!0}).node,!t||!n)throw new rr.ErrnoError(44);if(t.mount!==n.mount)throw new rr.ErrnoError(75);var u,c=rr.lookupNode(t,a),l=$.relative(r,i);if(\".\"!==l.charAt(0))throw new rr.ErrnoError(28);if(\".\"!==(l=$.relative(e,o)).charAt(0))throw new rr.ErrnoError(55);try{u=rr.lookupNode(n,s)}catch(r){}if(c!==u){var f=rr.isDir(c.mode),d=rr.mayDelete(t,a,f);if(d)throw new rr.ErrnoError(d);if(d=u?rr.mayDelete(n,s,f):rr.mayCreate(n,s))throw new rr.ErrnoError(d);if(!t.node_ops.rename)throw new rr.ErrnoError(63);if(rr.isMountpoint(c)||u&&rr.isMountpoint(u))throw new rr.ErrnoError(10);if(n!==t&&(d=rr.nodePermissions(t,\"w\")))throw new rr.ErrnoError(d);rr.hashRemoveNode(c);try{t.node_ops.rename(c,n,s)}catch(r){throw r}finally{rr.hashAddNode(c)}}},rmdir:r=>{var e=rr.lookupPath(r,{parent:!0}).node,t=Y.basename(r),n=rr.lookupNode(e,t),o=rr.mayDelete(e,t,!0);if(o)throw new rr.ErrnoError(o);if(!e.node_ops.rmdir)throw new rr.ErrnoError(63);if(rr.isMountpoint(n))throw new rr.ErrnoError(10);e.node_ops.rmdir(e,t),rr.destroyNode(n)},readdir:r=>{var e=rr.lookupPath(r,{follow:!0}).node;if(!e.node_ops.readdir)throw new rr.ErrnoError(54);return e.node_ops.readdir(e)},unlink:r=>{var e=rr.lookupPath(r,{parent:!0}).node;if(!e)throw new rr.ErrnoError(44);var t=Y.basename(r),n=rr.lookupNode(e,t),o=rr.mayDelete(e,t,!1);if(o)throw new rr.ErrnoError(o);if(!e.node_ops.unlink)throw new rr.ErrnoError(63);if(rr.isMountpoint(n))throw new rr.ErrnoError(10);e.node_ops.unlink(e,t),rr.destroyNode(n)},readlink:r=>{var e=rr.lookupPath(r).node;if(!e)throw new rr.ErrnoError(44);if(!e.node_ops.readlink)throw new rr.ErrnoError(28);return $.resolve(rr.getPath(e.parent),e.node_ops.readlink(e))},stat:(r,e)=>{var t=rr.lookupPath(r,{follow:!e}).node;if(!t)throw new rr.ErrnoError(44);if(!t.node_ops.getattr)throw new rr.ErrnoError(63);return t.node_ops.getattr(t)},lstat:r=>rr.stat(r,!0),chmod:(r,e,t)=>{var n;\"string\"==typeof r?n=rr.lookupPath(r,{follow:!t}).node:n=r;if(!n.node_ops.setattr)throw new rr.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&e|-4096&n.mode,timestamp:Date.now()})},lchmod:(r,e)=>{rr.chmod(r,e,!0)},fchmod:(r,e)=>{var t=rr.getStream(r);if(!t)throw new rr.ErrnoError(8);rr.chmod(t.node,e)},chown:(r,e,t,n)=>{var o;\"string\"==typeof r?o=rr.lookupPath(r,{follow:!n}).node:o=r;if(!o.node_ops.setattr)throw new rr.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:(r,e,t)=>{rr.chown(r,e,t,!0)},fchown:(r,e,t)=>{var n=rr.getStream(r);if(!n)throw new rr.ErrnoError(8);rr.chown(n.node,e,t)},truncate:(r,e)=>{if(e<0)throw new rr.ErrnoError(28);var t;\"string\"==typeof r?t=rr.lookupPath(r,{follow:!0}).node:t=r;if(!t.node_ops.setattr)throw new rr.ErrnoError(63);if(rr.isDir(t.mode))throw new rr.ErrnoError(31);if(!rr.isFile(t.mode))throw new rr.ErrnoError(28);var n=rr.nodePermissions(t,\"w\");if(n)throw new rr.ErrnoError(n);t.node_ops.setattr(t,{size:e,timestamp:Date.now()})},ftruncate:(r,e)=>{var t=rr.getStream(r);if(!t)throw new rr.ErrnoError(8);if(0==(2097155&t.flags))throw new rr.ErrnoError(28);rr.truncate(t.node,e)},utime:(r,e,t)=>{var n=rr.lookupPath(r,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(e,t)})},open:(r,e,t)=>{if(\"\"===r)throw new rr.ErrnoError(44);var n;if(t=void 0===t?438:t,t=64&(e=\"string\"==typeof e?rr.modeStringToFlags(e):e)?4095&t|32768:0,\"object\"==typeof r)n=r;else{r=Y.normalize(r);try{n=rr.lookupPath(r,{follow:!(131072&e)}).node}catch(r){}}var i=!1;if(64&e)if(n){if(128&e)throw new rr.ErrnoError(20)}else n=rr.mknod(r,t,0),i=!0;if(!n)throw new rr.ErrnoError(44);if(rr.isChrdev(n.mode)&&(e&=-513),65536&e&&!rr.isDir(n.mode))throw new rr.ErrnoError(54);if(!i){var a=rr.mayOpen(n,e);if(a)throw new rr.ErrnoError(a)}512&e&&!i&&rr.truncate(n,0),e&=-131713;var s=rr.createStream({node:n,path:rr.getPath(n),flags:e,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return s.stream_ops.open&&s.stream_ops.open(s),!o.logReadFiles||1&e||(rr.readFiles||(rr.readFiles={}),r in rr.readFiles||(rr.readFiles[r]=1)),s},close:r=>{if(rr.isClosed(r))throw new rr.ErrnoError(8);r.getdents&&(r.getdents=null);try{r.stream_ops.close&&r.stream_ops.close(r)}catch(r){throw r}finally{rr.closeStream(r.fd)}r.fd=null},isClosed:r=>null===r.fd,llseek:(r,e,t)=>{if(rr.isClosed(r))throw new rr.ErrnoError(8);if(!r.seekable||!r.stream_ops.llseek)throw new rr.ErrnoError(70);if(0!=t&&1!=t&&2!=t)throw new rr.ErrnoError(28);return r.position=r.stream_ops.llseek(r,e,t),r.ungotten=[],r.position},read:(r,e,t,n,o)=>{if(n<0||o<0)throw new rr.ErrnoError(28);if(rr.isClosed(r))throw new rr.ErrnoError(8);if(1==(2097155&r.flags))throw new rr.ErrnoError(8);if(rr.isDir(r.node.mode))throw new rr.ErrnoError(31);if(!r.stream_ops.read)throw new rr.ErrnoError(28);var i=void 0!==o;if(i){if(!r.seekable)throw new rr.ErrnoError(70)}else o=r.position;var a=r.stream_ops.read(r,e,t,n,o);return i||(r.position+=a),a},write:(r,e,t,n,o,i)=>{if(n<0||o<0)throw new rr.ErrnoError(28);if(rr.isClosed(r))throw new rr.ErrnoError(8);if(0==(2097155&r.flags))throw new rr.ErrnoError(8);if(rr.isDir(r.node.mode))throw new rr.ErrnoError(31);if(!r.stream_ops.write)throw new rr.ErrnoError(28);r.seekable&&1024&r.flags&&rr.llseek(r,0,2);var a=void 0!==o;if(a){if(!r.seekable)throw new rr.ErrnoError(70)}else o=r.position;var s=r.stream_ops.write(r,e,t,n,o,i);return a||(r.position+=s),s},allocate:(r,e,t)=>{if(rr.isClosed(r))throw new rr.ErrnoError(8);if(e<0||t<=0)throw new rr.ErrnoError(28);if(0==(2097155&r.flags))throw new rr.ErrnoError(8);if(!rr.isFile(r.node.mode)&&!rr.isDir(r.node.mode))throw new rr.ErrnoError(43);if(!r.stream_ops.allocate)throw new rr.ErrnoError(138);r.stream_ops.allocate(r,e,t)},mmap:(r,e,t,n,o)=>{if(0!=(2&n)&&0==(2&o)&&2!=(2097155&r.flags))throw new rr.ErrnoError(2);if(1==(2097155&r.flags))throw new rr.ErrnoError(2);if(!r.stream_ops.mmap)throw new rr.ErrnoError(43);return r.stream_ops.mmap(r,e,t,n,o)},msync:(r,e,t,n,o)=>r&&r.stream_ops.msync?r.stream_ops.msync(r,e,t,n,o):0,munmap:r=>0,ioctl:(r,e,t)=>{if(!r.stream_ops.ioctl)throw new rr.ErrnoError(59);return r.stream_ops.ioctl(r,e,t)},readFile:(r,e={})=>{if(e.flags=e.flags||0,e.encoding=e.encoding||\"binary\",\"utf8\"!==e.encoding&&\"binary\"!==e.encoding)throw new Error('Invalid encoding type \"'+e.encoding+'\"');var t,n=rr.open(r,e.flags),o=rr.stat(r).size,i=new Uint8Array(o);return rr.read(n,i,0,o,0),\"utf8\"===e.encoding?t=A(i,0):\"binary\"===e.encoding&&(t=i),rr.close(n),t},writeFile:(r,e,t={})=>{t.flags=t.flags||577;var n=rr.open(r,t.flags,t.mode);if(\"string\"==typeof e){var o=new Uint8Array(P(e)+1),i=M(e,o,0,o.length);rr.write(n,o,0,i,void 0,t.canOwn)}else{if(!ArrayBuffer.isView(e))throw new Error(\"Unsupported data type\");rr.write(n,e,0,e.byteLength,void 0,t.canOwn)}rr.close(n)},cwd:()=>rr.currentPath,chdir:r=>{var e=rr.lookupPath(r,{follow:!0});if(null===e.node)throw new rr.ErrnoError(44);if(!rr.isDir(e.node.mode))throw new rr.ErrnoError(54);var t=rr.nodePermissions(e.node,\"x\");if(t)throw new rr.ErrnoError(t);rr.currentPath=e.path},createDefaultDirectories:()=>{rr.mkdir(\"/tmp\"),rr.mkdir(\"/home\"),rr.mkdir(\"/home/web_user\")},createDefaultDevices:()=>{rr.mkdir(\"/dev\"),rr.registerDevice(rr.makedev(1,3),{read:()=>0,write:(r,e,t,n,o)=>n}),rr.mkdev(\"/dev/null\",rr.makedev(1,3)),J.register(rr.makedev(5,0),J.default_tty_ops),J.register(rr.makedev(6,0),J.default_tty1_ops),rr.mkdev(\"/dev/tty\",rr.makedev(5,0)),rr.mkdev(\"/dev/tty1\",rr.makedev(6,0));var r=function(){if(\"object\"==typeof crypto&&\"function\"==typeof crypto.getRandomValues){var r=new Uint8Array(1);return()=>(crypto.getRandomValues(r),r[0])}return()=>C(\"randomDevice\")}();rr.createDevice(\"/dev\",\"random\",r),rr.createDevice(\"/dev\",\"urandom\",r),rr.mkdir(\"/dev/shm\"),rr.mkdir(\"/dev/shm/tmp\")},createSpecialDirectories:()=>{rr.mkdir(\"/proc\");var r=rr.mkdir(\"/proc/self\");rr.mkdir(\"/proc/self/fd\"),rr.mount({mount:()=>{var e=rr.createNode(r,\"fd\",16895,73);return e.node_ops={lookup:(r,e)=>{var t=+e,n=rr.getStream(t);if(!n)throw new rr.ErrnoError(8);var o={parent:null,mount:{mountpoint:\"fake\"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},e}},{},\"/proc/self/fd\")},createStandardStreams:()=>{o.stdin?rr.createDevice(\"/dev\",\"stdin\",o.stdin):rr.symlink(\"/dev/tty\",\"/dev/stdin\"),o.stdout?rr.createDevice(\"/dev\",\"stdout\",null,o.stdout):rr.symlink(\"/dev/tty\",\"/dev/stdout\"),o.stderr?rr.createDevice(\"/dev\",\"stderr\",null,o.stderr):rr.symlink(\"/dev/tty1\",\"/dev/stderr\"),rr.open(\"/dev/stdin\",0),rr.open(\"/dev/stdout\",1),rr.open(\"/dev/stderr\",1)},ensureErrnoError:()=>{rr.ErrnoError||(rr.ErrnoError=function(r,e){this.node=e,this.setErrno=function(r){this.errno=r},this.setErrno(r),this.message=\"FS error\"},rr.ErrnoError.prototype=new Error,rr.ErrnoError.prototype.constructor=rr.ErrnoError,[44].forEach((r=>{rr.genericErrors[r]=new rr.ErrnoError(r),rr.genericErrors[r].stack=\"<generic error, no stack>\"})))},staticInit:()=>{rr.ensureErrnoError(),rr.nameTable=new Array(4096),rr.mount(Z,{},\"/\"),rr.createDefaultDirectories(),rr.createDefaultDevices(),rr.createSpecialDirectories(),rr.filesystems={MEMFS:Z}},init:(r,e,t)=>{rr.init.initialized=!0,rr.ensureErrnoError(),o.stdin=r||o.stdin,o.stdout=e||o.stdout,o.stderr=t||o.stderr,rr.createStandardStreams()},quit:()=>{rr.init.initialized=!1;for(var r=0;r<rr.streams.length;r++){var e=rr.streams[r];e&&rr.close(e)}},getMode:(r,e)=>{var t=0;return r&&(t|=365),e&&(t|=146),t},findObject:(r,e)=>{var t=rr.analyzePath(r,e);return t.exists?t.object:null},analyzePath:(r,e)=>{try{r=(n=rr.lookupPath(r,{follow:!e})).path}catch(r){}var t={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=rr.lookupPath(r,{parent:!0});t.parentExists=!0,t.parentPath=n.path,t.parentObject=n.node,t.name=Y.basename(r),n=rr.lookupPath(r,{follow:!e}),t.exists=!0,t.path=n.path,t.object=n.node,t.name=n.node.name,t.isRoot=\"/\"===n.path}catch(r){t.error=r.errno}return t},createPath:(r,e,t,n)=>{r=\"string\"==typeof r?r:rr.getPath(r);for(var o=e.split(\"/\").reverse();o.length;){var i=o.pop();if(i){var a=Y.join2(r,i);try{rr.mkdir(a)}catch(r){}r=a}}return a},createFile:(r,e,t,n,o)=>{var i=Y.join2(\"string\"==typeof r?r:rr.getPath(r),e),a=rr.getMode(n,o);return rr.create(i,a)},createDataFile:(r,e,t,n,o,i)=>{var a=e;r&&(r=\"string\"==typeof r?r:rr.getPath(r),a=e?Y.join2(r,e):r);var s=rr.getMode(n,o),u=rr.create(a,s);if(t){if(\"string\"==typeof t){for(var c=new Array(t.length),l=0,f=t.length;l<f;++l)c[l]=t.charCodeAt(l);t=c}rr.chmod(u,146|s);var d=rr.open(u,577);rr.write(d,t,0,t.length,0,i),rr.close(d),rr.chmod(u,s)}return u},createDevice:(r,e,t,n)=>{var o=Y.join2(\"string\"==typeof r?r:rr.getPath(r),e),i=rr.getMode(!!t,!!n);rr.createDevice.major||(rr.createDevice.major=64);var a=rr.makedev(rr.createDevice.major++,0);return rr.registerDevice(a,{open:r=>{r.seekable=!1},close:r=>{n&&n.buffer&&n.buffer.length&&n(10)},read:(r,e,n,o,i)=>{for(var a=0,s=0;s<o;s++){var u;try{u=t()}catch(r){throw new rr.ErrnoError(29)}if(void 0===u&&0===a)throw new rr.ErrnoError(6);if(null==u)break;a++,e[n+s]=u}return a&&(r.node.timestamp=Date.now()),a},write:(r,e,t,o,i)=>{for(var a=0;a<o;a++)try{n(e[t+a])}catch(r){throw new rr.ErrnoError(29)}return o&&(r.node.timestamp=Date.now()),a}}),rr.mkdev(o,i,a)},forceLoadFile:r=>{if(r.isDevice||r.isFolder||r.link||r.contents)return!0;if(\"undefined\"!=typeof XMLHttpRequest)throw new Error(\"Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.\");if(!i)throw new Error(\"Cannot load without read() or XMLHttpRequest.\");try{r.contents=K(i(r.url),!0),r.usedBytes=r.contents.length}catch(r){throw new rr.ErrnoError(29)}},createLazyFile:(r,e,t,n,o)=>{function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(r){if(!(r>this.length-1||r<0)){var e=r%this.chunkSize,t=r/this.chunkSize|0;return this.getter(t)[e]}},i.prototype.setDataGetter=function(r){this.getter=r},i.prototype.cacheLength=function(){var r=new XMLHttpRequest;if(r.open(\"HEAD\",t,!1),r.send(null),!(r.status>=200&&r.status<300||304===r.status))throw new Error(\"Couldn't load \"+t+\". Status: \"+r.status);var e,n=Number(r.getResponseHeader(\"Content-length\")),o=(e=r.getResponseHeader(\"Accept-Ranges\"))&&\"bytes\"===e,i=(e=r.getResponseHeader(\"Content-Encoding\"))&&\"gzip\"===e,a=1048576;o||(a=n);var s=this;s.setDataGetter((r=>{var e=r*a,o=(r+1)*a-1;if(o=Math.min(o,n-1),void 0===s.chunks[r]&&(s.chunks[r]=((r,e)=>{if(r>e)throw new Error(\"invalid range (\"+r+\", \"+e+\") or no bytes requested!\");if(e>n-1)throw new Error(\"only \"+n+\" bytes available! programmer error!\");var o=new XMLHttpRequest;if(o.open(\"GET\",t,!1),n!==a&&o.setRequestHeader(\"Range\",\"bytes=\"+r+\"-\"+e),o.responseType=\"arraybuffer\",o.overrideMimeType&&o.overrideMimeType(\"text/plain; charset=x-user-defined\"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error(\"Couldn't load \"+t+\". Status: \"+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):K(o.responseText||\"\",!0)})(e,o)),void 0===s.chunks[r])throw new Error(\"doXHR failed!\");return s.chunks[r]})),!i&&n||(a=n=1,n=this.getter(0).length,a=n,d(\"LazyFiles on gzip forces download of the whole file when length is accessed\")),this._length=n,this._chunkSize=a,this.lengthKnown=!0},\"undefined\"!=typeof XMLHttpRequest)throw\"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc\";var a={isDevice:!1,url:t},s=rr.createFile(r,e,a,n,o);a.contents?s.contents=a.contents:a.url&&(s.contents=null,s.url=a.url),Object.defineProperties(s,{usedBytes:{get:function(){return this.contents.length}}});var u={};function c(r,e,t,n,o){var i=r.node.contents;if(o>=i.length)return 0;var a=Math.min(i.length-o,n);if(i.slice)for(var s=0;s<a;s++)e[t+s]=i[o+s];else for(s=0;s<a;s++)e[t+s]=i.get(o+s);return a}return Object.keys(s.stream_ops).forEach((r=>{var e=s.stream_ops[r];u[r]=function(){return rr.forceLoadFile(s),e.apply(null,arguments)}})),u.read=(r,e,t,n,o)=>(rr.forceLoadFile(s),c(r,e,t,n,o)),u.mmap=(r,e,t,n,o)=>{rr.forceLoadFile(s);var i=Q(e);if(!i)throw new rr.ErrnoError(48);return c(r,_,i,e,t),{ptr:i,allocated:!0}},s.stream_ops=u,s},createPreloadedFile:(r,e,t,n,o,i,s,u,c,l)=>{var f=e?$.resolve(Y.join2(r,e)):r;function d(t){function a(t){l&&l(),u||rr.createDataFile(r,e,t,n,o,c),i&&i(),O()}Browser.handledByPreloadPlugin(t,f,a,(()=>{s&&s(),O()}))||a(t)}N(),\"string\"==typeof t?function(r,e,t,n){var o=n?\"\":\"al \"+r;a(r,(t=>{w(t,'Loading data file \"'+r+'\" failed (no arrayBuffer).'),e(new Uint8Array(t)),o&&O()}),(e=>{if(!t)throw'Loading data file \"'+r+'\" failed.';t()})),o&&N()}(t,(r=>d(r)),s):d(t)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>\"EM_FS_\"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:\"FILE_DATA\",saveFilesToDB:(r,e,t)=>{e=e||(()=>{}),t=t||(()=>{});var n=rr.indexedDB();try{var o=n.open(rr.DB_NAME(),rr.DB_VERSION)}catch(r){return t(r)}o.onupgradeneeded=()=>{d(\"creating db\"),o.result.createObjectStore(rr.DB_STORE_NAME)},o.onsuccess=()=>{var n=o.result.transaction([rr.DB_STORE_NAME],\"readwrite\"),i=n.objectStore(rr.DB_STORE_NAME),a=0,s=0,u=r.length;function c(){0==s?e():t()}r.forEach((r=>{var e=i.put(rr.analyzePath(r).object.contents,r);e.onsuccess=()=>{++a+s==u&&c()},e.onerror=()=>{s++,a+s==u&&c()}})),n.onerror=t},o.onerror=t},loadFilesFromDB:(r,e,t)=>{e=e||(()=>{}),t=t||(()=>{});var n=rr.indexedDB();try{var o=n.open(rr.DB_NAME(),rr.DB_VERSION)}catch(r){return t(r)}o.onupgradeneeded=t,o.onsuccess=()=>{var n=o.result;try{var i=n.transaction([rr.DB_STORE_NAME],\"readonly\")}catch(r){return void t(r)}var a=i.objectStore(rr.DB_STORE_NAME),s=0,u=0,c=r.length;function l(){0==u?e():t()}r.forEach((r=>{var e=a.get(r);e.onsuccess=()=>{rr.analyzePath(r).exists&&rr.unlink(r),rr.createDataFile(Y.dirname(r),Y.basename(r),e.result,!0,!0,!0),++s+u==c&&l()},e.onerror=()=>{u++,s+u==c&&l()}})),i.onerror=t},o.onerror=t}},er={DEFAULT_POLLMASK:5,calculateAt:function(r,e,t){if(Y.isAbs(e))return e;var n;-100===r?n=rr.cwd():n=er.getStreamFromFD(r).path;if(0==e.length){if(!t)throw new rr.ErrnoError(44);return n}return Y.join2(n,e)},doStat:function(r,e,t){try{var n=r(e)}catch(r){if(r&&r.node&&Y.normalize(e)!==Y.normalize(rr.getPath(r.node)))return-54;throw r}return b[t>>2]=n.dev,b[t+8>>2]=n.ino,b[t+12>>2]=n.mode,k[t+16>>2]=n.nlink,b[t+20>>2]=n.uid,b[t+24>>2]=n.gid,b[t+28>>2]=n.rdev,U=[n.size>>>0,(G=n.size,+Math.abs(G)>=1?G>0?(0|Math.min(+Math.floor(G/4294967296),4294967295))>>>0:~~+Math.ceil((G-+(~~G>>>0))/4294967296)>>>0:0)],b[t+40>>2]=U[0],b[t+44>>2]=U[1],b[t+48>>2]=4096,b[t+52>>2]=n.blocks,U=[Math.floor(n.atime.getTime()/1e3)>>>0,(G=Math.floor(n.atime.getTime()/1e3),+Math.abs(G)>=1?G>0?(0|Math.min(+Math.floor(G/4294967296),4294967295))>>>0:~~+Math.ceil((G-+(~~G>>>0))/4294967296)>>>0:0)],b[t+56>>2]=U[0],b[t+60>>2]=U[1],k[t+64>>2]=0,U=[Math.floor(n.mtime.getTime()/1e3)>>>0,(G=Math.floor(n.mtime.getTime()/1e3),+Math.abs(G)>=1?G>0?(0|Math.min(+Math.floor(G/4294967296),4294967295))>>>0:~~+Math.ceil((G-+(~~G>>>0))/4294967296)>>>0:0)],b[t+72>>2]=U[0],b[t+76>>2]=U[1],k[t+80>>2]=0,U=[Math.floor(n.ctime.getTime()/1e3)>>>0,(G=Math.floor(n.ctime.getTime()/1e3),+Math.abs(G)>=1?G>0?(0|Math.min(+Math.floor(G/4294967296),4294967295))>>>0:~~+Math.ceil((G-+(~~G>>>0))/4294967296)>>>0:0)],b[t+88>>2]=U[0],b[t+92>>2]=U[1],k[t+96>>2]=0,U=[n.ino>>>0,(G=n.ino,+Math.abs(G)>=1?G>0?(0|Math.min(+Math.floor(G/4294967296),4294967295))>>>0:~~+Math.ceil((G-+(~~G>>>0))/4294967296)>>>0:0)],b[t+104>>2]=U[0],b[t+108>>2]=U[1],0},doMsync:function(r,e,t,n,o){var i=g.slice(r,r+t);rr.msync(e,i,o,t,n)},varargs:void 0,get:function(){return er.varargs+=4,b[er.varargs-4>>2]},getStr:function(r){return F(r)},getStreamFromFD:function(r){var e=rr.getStream(r);if(!e)throw new rr.ErrnoError(8);return e}};var tr=[];function nr(r){try{return h.grow(r-y.byteLength+65535>>>16),x(h.buffer),1}catch(r){}}var or={};function ir(){if(!ir.strings){var r={USER:\"web_user\",LOGNAME:\"web_user\",PATH:\"/\",PWD:\"/\",HOME:\"/home/web_user\",LANG:(\"object\"==typeof navigator&&navigator.languages&&navigator.languages[0]||\"C\").replace(\"-\",\"_\")+\".UTF-8\",_:u||\"./this.program\"};for(var e in or)void 0===or[e]?delete r[e]:r[e]=or[e];var t=[];for(var e in r)t.push(e+\"=\"+r[e]);ir.strings=t}return ir.strings}function ar(r){m||(o.onExit&&o.onExit(r),v=!0),c(r,new W(r))}var sr=function(r,e){ar(r)};var ur=function(r,e,t,n){r||(r=this),this.parent=r,this.mount=r.mount,this.mounted=null,this.id=rr.nextInode++,this.name=e,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=n},cr=365,lr=146;Object.defineProperties(ur.prototype,{read:{get:function(){return(this.mode&cr)===cr},set:function(r){r?this.mode|=cr:this.mode&=-366}},write:{get:function(){return(this.mode&lr)===lr},set:function(r){r?this.mode|=lr:this.mode&=-147}},isFolder:{get:function(){return rr.isDir(this.mode)}},isDevice:{get:function(){return rr.isChrdev(this.mode)}}}),rr.FSNode=ur,rr.staticInit();var fr={k:function(r,e,t,n){try{if(e=er.getStr(e),e=er.calculateAt(r,e),-8&t)return-28;var o=rr.lookupPath(e,{follow:!0}).node;if(!o)return-44;var i=\"\";return 4&t&&(i+=\"r\"),2&t&&(i+=\"w\"),1&t&&(i+=\"x\"),i&&rr.nodePermissions(o,i)?-2:0}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return-r.errno}},f:function(r,e,t){er.varargs=t;try{var n=er.getStreamFromFD(r);switch(e){case 0:return(o=er.get())<0?-28:rr.createStream(n,o).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var o=er.get();return n.flags|=o,0;case 5:o=er.get();return E[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return i=28,b[gr()>>2]=i,-1}}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return-r.errno}var i},u:function(r,e){try{var t=er.getStreamFromFD(r);return er.doStat(rr.stat,t.path,e)}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return-r.errno}},v:function(r,e,t){er.varargs=t;try{var n=er.getStreamFromFD(r);switch(e){case 21509:case 21505:case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:case 21523:case 21524:return n.tty?0:-59;case 21519:if(!n.tty)return-59;var o=er.get();return b[o>>2]=0,0;case 21520:return n.tty?-28:-59;case 21531:o=er.get();return rr.ioctl(n,e,o);default:return-28}}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return-r.errno}},s:function(r,e,t,n){try{e=er.getStr(e);var o=256&n,i=4096&n;return n&=-4353,e=er.calculateAt(r,e,i),er.doStat(o?rr.lstat:rr.stat,e,t)}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return-r.errno}},c:function(r,e,t,n){er.varargs=n;try{e=er.getStr(e),e=er.calculateAt(r,e);var o=n?er.get():0;return rr.open(e,t,o).fd}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return-r.errno}},t:function(r,e){try{return r=er.getStr(r),er.doStat(rr.stat,r,e)}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return-r.errno}},n:function(r,e,t){try{return e=er.getStr(e),e=er.calculateAt(r,e),0===t?rr.unlink(e):512===t?rr.rmdir(e):C(\"Invalid flags passed to unlinkat\"),0}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return-r.errno}},d:function(){return Date.now()},i:function(){return true},o:function(r,e,t,n,o,i){try{var a=er.getStreamFromFD(n),s=rr.mmap(a,r,o,e,t),u=s.ptr;return b[i>>2]=s.allocated,u}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return-r.errno}},p:function(r,e,t,n,o,i){try{var a=er.getStreamFromFD(o);2&t&&er.doMsync(r,a,e,n,i),rr.munmap(a)}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return-r.errno}},a:function(){C(\"\")},w:function(r,e,t){var n=function(r,e){var t;for(tr.length=0,e>>=2;t=g[r++];)e+=105!=t&e,tr.push(105==t?b[e]:S[e++>>1]),++e;return tr}(e,t);return V[r].apply(null,n)},j:function(r,e,t){g.copyWithin(r,e,e+t)},m:function(r){var e,t,n=g.length,o=2147483648;if((r>>>=0)>o)return!1;for(var i=1;i<=4;i*=2){var a=n*(1+.2/i);if(a=Math.min(a,r+100663296),nr(Math.min(o,(e=Math.max(r,a))+((t=65536)-e%t)%t)))return!0}return!1},q:function(r,e){var t=0;return ir().forEach((function(n,o){var i=e+t;k[r+4*o>>2]=i,function(r,e,t){for(var n=0;n<r.length;++n)_[e++>>0]=r.charCodeAt(n);t||(_[e>>0]=0)}(n,i),t+=n.length+1})),0},r:function(r,e){var t=ir();k[r>>2]=t.length;var n=0;return t.forEach((function(r){n+=r.length+1})),k[e>>2]=n,0},e:sr,b:function(r){try{var e=er.getStreamFromFD(r);return rr.close(e),0}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return r.errno}},g:function(r,e,t,n){try{var o=function(r,e,t,n){for(var o=0,i=0;i<t;i++){var a=k[e>>2],s=k[e+4>>2];e+=8;var u=rr.read(r,_,a,s,n);if(u<0)return-1;if(o+=u,u<s)break}return o}(er.getStreamFromFD(r),e,t);return k[n>>2]=o,0}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return r.errno}},l:function(r,e,t,n,o){try{var i=(u=t)+2097152>>>0<4194305-!!(s=e)?(s>>>0)+4294967296*u:NaN;if(isNaN(i))return 61;var a=er.getStreamFromFD(r);return rr.llseek(a,i,n),U=[a.position>>>0,(G=a.position,+Math.abs(G)>=1?G>0?(0|Math.min(+Math.floor(G/4294967296),4294967295))>>>0:~~+Math.ceil((G-+(~~G>>>0))/4294967296)>>>0:0)],b[o>>2]=U[0],b[o+4>>2]=U[1],a.getdents&&0===i&&0===n&&(a.getdents=null),0}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return r.errno}var s,u},h:function(r,e,t,n){try{var o=function(r,e,t,n){for(var o=0,i=0;i<t;i++){var a=k[e>>2],s=k[e+4>>2];e+=8;var u=rr.write(r,_,a,s,n);if(u<0)return-1;o+=u}return o}(er.getStreamFromFD(r),e,t);return k[n>>2]=o,0}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return r.errno}}};!function(){var r={a:fr};function e(r,e){var t,n=r.exports;o.asm=n,x((h=o.asm.x).buffer),o.asm.G,t=o.asm.y,z.unshift(t),O()}function t(r){e(r.instance)}function i(e){return(f||\"function\"!=typeof fetch?Promise.resolve().then((function(){return q(L)})):fetch(L,{credentials:\"same-origin\"}).then((function(r){if(!r.ok)throw\"failed to load wasm binary file at '\"+L+\"'\";return r.arrayBuffer()})).catch((function(){return q(L)}))).then((function(e){return WebAssembly.instantiate(e,r)})).then((function(r){return r})).then(e,(function(r){p(\"failed to asynchronously prepare wasm: \"+r),C(r)}))}if(N(),o.instantiateWasm)try{return o.instantiateWasm(r,e)}catch(r){return p(\"Module.instantiateWasm callback failed with error: \"+r),!1}(f||\"function\"!=typeof WebAssembly.instantiateStreaming||H(L)||\"function\"!=typeof fetch?i(t):fetch(L,{credentials:\"same-origin\"}).then((function(e){return WebAssembly.instantiateStreaming(e,r).then(t,(function(r){return p(\"wasm streaming compile failed: \"+r),p(\"falling back to ArrayBuffer instantiation\"),i(t)}))}))).catch(n)}(),o.___wasm_call_ctors=function(){return(o.___wasm_call_ctors=o.asm.y).apply(null,arguments)};var dr=o._emscripten_bind_VoidPtr___destroy___0=function(){return(dr=o._emscripten_bind_VoidPtr___destroy___0=o.asm.z).apply(null,arguments)},pr=o._emscripten_bind_Graphviz_Graphviz_2=function(){return(pr=o._emscripten_bind_Graphviz_Graphviz_2=o.asm.A).apply(null,arguments)},hr=o._emscripten_bind_Graphviz_version_0=function(){return(hr=o._emscripten_bind_Graphviz_version_0=o.asm.B).apply(null,arguments)},mr=o._emscripten_bind_Graphviz_lastError_0=function(){return(mr=o._emscripten_bind_Graphviz_lastError_0=o.asm.C).apply(null,arguments)},vr=o._emscripten_bind_Graphviz_layout_3=function(){return(vr=o._emscripten_bind_Graphviz_layout_3=o.asm.D).apply(null,arguments)},wr=o._emscripten_bind_Graphviz_createFile_2=function(){return(wr=o._emscripten_bind_Graphviz_createFile_2=o.asm.E).apply(null,arguments)},yr=o._emscripten_bind_Graphviz___destroy___0=function(){return(yr=o._emscripten_bind_Graphviz___destroy___0=o.asm.F).apply(null,arguments)};o._free=function(){return(o._free=o.asm.H).apply(null,arguments)},o._malloc=function(){return(o._malloc=o.asm.I).apply(null,arguments)};var _r,gr=o.___errno_location=function(){return(gr=o.___errno_location=o.asm.J).apply(null,arguments)},Er=o._emscripten_builtin_memalign=function(){return(Er=o._emscripten_builtin_memalign=o.asm.K).apply(null,arguments)};function br(r){function e(){_r||(_r=!0,o.calledRun=!0,v||(o.noFSInit||rr.init.initialized||rr.init(),rr.ignorePermissions=!1,X(z),t(o),o.onRuntimeInitialized&&o.onRuntimeInitialized(),function(){if(o.postRun)for(\"function\"==typeof o.postRun&&(o.postRun=[o.postRun]);o.postRun.length;)r=o.postRun.shift(),T.unshift(r);var r;X(T)}()))}R>0||(!function(){if(o.preRun)for(\"function\"==typeof o.preRun&&(o.preRun=[o.preRun]);o.preRun.length;)r=o.preRun.shift(),j.unshift(r);var r;X(j)}(),R>0||(o.setStatus?(o.setStatus(\"Running...\"),setTimeout((function(){setTimeout((function(){o.setStatus(\"\")}),1),e()}),1)):e()))}if(o.___start_em_js=163664,o.___stop_em_js=163762,B=function r(){_r||br(),_r||(B=r)},o.preInit)for(\"function\"==typeof o.preInit&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();function kr(){}function Sr(r){return(r||kr).__cache__}function Dr(r,e){var t=Sr(e),n=t[r];return n||((n=Object.create((e||kr).prototype)).ptr=r,t[r]=n)}br(),kr.prototype=Object.create(kr.prototype),kr.prototype.constructor=kr,kr.prototype.__class__=kr,kr.__cache__={},o.WrapperObject=kr,o.getCache=Sr,o.wrapPointer=Dr,o.castObject=function(r,e){return Dr(r.ptr,e)},o.NULL=Dr(0),o.destroy=function(r){if(!r.__destroy__)throw\"Error: Cannot destroy object. (Did you create it yourself?)\";r.__destroy__(),delete Sr(r.__class__)[r.ptr]},o.compare=function(r,e){return r.ptr===e.ptr},o.getPointer=function(r){return r.ptr},o.getClass=function(r){return r.__class__};var Ar={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if(Ar.needed){for(var r=0;r<Ar.temps.length;r++)o._free(Ar.temps[r]);Ar.temps.length=0,o._free(Ar.buffer),Ar.buffer=0,Ar.size+=Ar.needed,Ar.needed=0}Ar.buffer||(Ar.size+=128,Ar.buffer=o._malloc(Ar.size),w(Ar.buffer)),Ar.pos=0},alloc:function(r,e){w(Ar.buffer);var t,n=e.BYTES_PER_ELEMENT,i=r.length*n;return i=i+7&-8,Ar.pos+i>=Ar.size?(w(i>0),Ar.needed+=i,t=o._malloc(i),Ar.temps.push(t)):(t=Ar.buffer+Ar.pos,Ar.pos+=i),t},copy:function(r,e,t){switch(t>>>=0,e.BYTES_PER_ELEMENT){case 2:t>>>=1;break;case 4:t>>>=2;break;case 8:t>>>=3}for(var n=0;n<r.length;n++)e[t+n]=r[n]}};function Fr(r){if(\"string\"==typeof r){var e=K(r),t=Ar.alloc(e,_);return Ar.copy(e,_,t),t}return r}function Mr(){throw\"cannot construct a VoidPtr, no constructor in IDL\"}function Pr(r,e){r&&\"object\"==typeof r&&(r=r.ptr),e&&\"object\"==typeof e&&(e=e.ptr),this.ptr=pr(r,e),Sr(Pr)[this.ptr]=this}return Mr.prototype=Object.create(kr.prototype),Mr.prototype.constructor=Mr,Mr.prototype.__class__=Mr,Mr.__cache__={},o.VoidPtr=Mr,Mr.prototype.__destroy__=Mr.prototype.__destroy__=function(){var r=this.ptr;dr(r)},Pr.prototype=Object.create(kr.prototype),Pr.prototype.constructor=Pr,Pr.prototype.__class__=Pr,Pr.__cache__={},o.Graphviz=Pr,Pr.prototype.version=Pr.prototype.version=function(){var r=this.ptr;return F(hr(r))},Pr.prototype.lastError=Pr.prototype.lastError=function(){var r=this.ptr;return F(mr(r))},Pr.prototype.layout=Pr.prototype.layout=function(r,e,t){var n=this.ptr;return Ar.prepare(),r=r&&\"object\"==typeof r?r.ptr:Fr(r),e=e&&\"object\"==typeof e?e.ptr:Fr(e),t=t&&\"object\"==typeof t?t.ptr:Fr(t),F(vr(n,r,e,t))},Pr.prototype.createFile=Pr.prototype.createFile=function(r,e){var t=this.ptr;Ar.prepare(),r=r&&\"object\"==typeof r?r.ptr:Fr(r),e=e&&\"object\"==typeof e?e.ptr:Fr(e),wr(t,r,e)},Pr.prototype.__destroy__=Pr.prototype.__destroy__=function(){var r=this.ptr;yr(r)},e.ready}})(),s=Object.freeze({__proto__:null,default:a});function u(r){return{path:r.path,data:`<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\\n<svg width=\"${r.width}\" height=\"${r.height}\"></svg>`}}const c={layout:(r,e=\"svg\",t=\"dot\",n)=>r?i(s,\"graphvizlib\",null==n?void 0:n.wasmFolder,null==n?void 0:n.wasmBinary).then((o=>{const i=new o.Graphviz((null==n?void 0:n.yInvert)?1:0,(null==n?void 0:n.nop)?null==n?void 0:n.nop:0);!function(r,e){const t={images:[],files:[],...e};var n;[...t.files,...(n=t.images,n.map(u))].forEach((e=>r.createFile(e.path,e.data)))}(i,n);const a=i.layout(r,e,t);if(o.destroy(i),!a)throw new Error(o.Graphviz.prototype.lastError());return a})):Promise.resolve(\"\"),circo(r,e=\"svg\",t){return this.layout(r,e,\"circo\",t)},dot(r,e=\"svg\",t){return this.layout(r,e,\"dot\",t)},fdp(r,e=\"svg\",t){return this.layout(r,e,\"fdp\",t)},sfdp(r,e=\"svg\",t){return this.layout(r,e,\"sfdp\",t)},neato(r,e=\"svg\",t){return this.layout(r,e,\"neato\",t)},osage(r,e=\"svg\",t){return this.layout(r,e,\"osage\",t)},patchwork(r,e=\"svg\",t){return this.layout(r,e,\"patchwork\",t)},twopi(r,e=\"svg\",t){return this.layout(r,e,\"twopi\",t)}};var l=\"undefined\"!=typeof globalThis?globalThis:\"undefined\"!=typeof window?window:\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:{};var f={exports:{}};\n/*!\n * @overview es6-promise - a tiny implementation of Promises/A+.\n * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)\n * @license Licensed under MIT license\n * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE\n * @version v4.2.8+1e68dce6\n */function d(r){return void 0!==r.children}f.exports=function(){function r(r){var e=typeof r;return null!==r&&(\"object\"===e||\"function\"===e)}function e(r){return\"function\"==typeof r}var t=Array.isArray?Array.isArray:function(r){return\"[object Array]\"===Object.prototype.toString.call(r)},n=0,o=void 0,i=void 0,a=function(r,e){g[n]=r,g[n+1]=e,2===(n+=2)&&(i?i(E):k())};function s(r){i=r}function u(r){a=r}var c=\"undefined\"!=typeof window?window:void 0,f=c||{},d=f.MutationObserver||f.WebKitMutationObserver,p=\"undefined\"==typeof self&&\"undefined\"!=typeof process&&\"[object process]\"==={}.toString.call(process),h=\"undefined\"!=typeof Uint8ClampedArray&&\"undefined\"!=typeof importScripts&&\"undefined\"!=typeof MessageChannel;function m(){return function(){return process.nextTick(E)}}function v(){return void 0!==o?function(){o(E)}:_()}function w(){var r=0,e=new d(E),t=document.createTextNode(\"\");return e.observe(t,{characterData:!0}),function(){t.data=r=++r%2}}function y(){var r=new MessageChannel;return r.port1.onmessage=E,function(){return r.port2.postMessage(0)}}function _(){var r=setTimeout;return function(){return r(E,1)}}var g=new Array(1e3);function E(){for(var r=0;r<n;r+=2)(0,g[r])(g[r+1]),g[r]=void 0,g[r+1]=void 0;n=0}function b(){try{var r=Function(\"return this\")().require(\"vertx\");return o=r.runOnLoop||r.runOnContext,v()}catch(r){return _()}}var k=void 0;function S(r,e){var t=this,n=new this.constructor(F);void 0===n[A]&&X(n);var o=t._state;if(o){var i=arguments[o-1];a((function(){return H(o,n,i,t._result)}))}else G(t,n,r,e);return n}function D(r){var e=this;if(r&&\"object\"==typeof r&&r.constructor===e)return r;var t=new e(F);return O(t,r),t}k=p?m():d?w():h?y():void 0===c?b():_();var A=Math.random().toString(36).substring(2);function F(){}var M=void 0,P=1,x=2;function j(){return new TypeError(\"You cannot resolve a promise with itself\")}function z(){return new TypeError(\"A promises callback cannot return that same promise.\")}function T(r,e,t,n){try{r.call(e,t,n)}catch(r){return r}}function R(r,e,t){a((function(r){var n=!1,o=T(t,e,(function(t){n||(n=!0,e!==t?O(r,t):L(r,t))}),(function(e){n||(n=!0,I(r,e))}),\"Settle: \"+(r._label||\" unknown promise\"));!n&&o&&(n=!0,I(r,o))}),r)}function B(r,e){e._state===P?L(r,e._result):e._state===x?I(r,e._result):G(e,void 0,(function(e){return O(r,e)}),(function(e){return I(r,e)}))}function N(r,t,n){t.constructor===r.constructor&&n===S&&t.constructor.resolve===D?B(r,t):void 0===n?L(r,t):e(n)?R(r,t,n):L(r,t)}function O(e,t){if(e===t)I(e,j());else if(r(t)){var n=void 0;try{n=t.then}catch(r){return void I(e,r)}N(e,t,n)}else L(e,t)}function C(r){r._onerror&&r._onerror(r._result),U(r)}function L(r,e){r._state===M&&(r._result=e,r._state=P,0!==r._subscribers.length&&a(U,r))}function I(r,e){r._state===M&&(r._state=x,r._result=e,a(C,r))}function G(r,e,t,n){var o=r._subscribers,i=o.length;r._onerror=null,o[i]=e,o[i+P]=t,o[i+x]=n,0===i&&r._state&&a(U,r)}function U(r){var e=r._subscribers,t=r._state;if(0!==e.length){for(var n=void 0,o=void 0,i=r._result,a=0;a<e.length;a+=3)n=e[a],o=e[a+t],n?H(t,n,o,i):o(i);r._subscribers.length=0}}function H(r,t,n,o){var i=e(n),a=void 0,s=void 0,u=!0;if(i){try{a=n(o)}catch(r){u=!1,s=r}if(t===a)return void I(t,z())}else a=o;t._state!==M||(i&&u?O(t,a):!1===u?I(t,s):r===P?L(t,a):r===x&&I(t,a))}function q(r,e){try{e((function(e){O(r,e)}),(function(e){I(r,e)}))}catch(e){I(r,e)}}var V=0;function W(){return V++}function X(r){r[A]=V++,r._state=void 0,r._result=void 0,r._subscribers=[]}function Y(){return new Error(\"Array Methods must be provided an Array\")}var $=function(){function r(r,e){this._instanceConstructor=r,this.promise=new r(F),this.promise[A]||X(this.promise),t(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?L(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&L(this.promise,this._result))):I(this.promise,Y())}return r.prototype._enumerate=function(r){for(var e=0;this._state===M&&e<r.length;e++)this._eachEntry(r[e],e)},r.prototype._eachEntry=function(r,e){var t=this._instanceConstructor,n=t.resolve;if(n===D){var o=void 0,i=void 0,a=!1;try{o=r.then}catch(r){a=!0,i=r}if(o===S&&r._state!==M)this._settledAt(r._state,e,r._result);else if(\"function\"!=typeof o)this._remaining--,this._result[e]=r;else if(t===er){var s=new t(F);a?I(s,i):N(s,r,o),this._willSettleAt(s,e)}else this._willSettleAt(new t((function(e){return e(r)})),e)}else this._willSettleAt(n(r),e)},r.prototype._settledAt=function(r,e,t){var n=this.promise;n._state===M&&(this._remaining--,r===x?I(n,t):this._result[e]=t),0===this._remaining&&L(n,this._result)},r.prototype._willSettleAt=function(r,e){var t=this;G(r,void 0,(function(r){return t._settledAt(P,e,r)}),(function(r){return t._settledAt(x,e,r)}))},r}();function K(r){return new $(this,r).promise}function J(r){var e=this;return t(r)?new e((function(t,n){for(var o=r.length,i=0;i<o;i++)e.resolve(r[i]).then(t,n)})):new e((function(r,e){return e(new TypeError(\"You must pass an array to race.\"))}))}function Q(r){var e=new this(F);return I(e,r),e}function Z(){throw new TypeError(\"You must pass a resolver function as the first argument to the promise constructor\")}function rr(){throw new TypeError(\"Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.\")}var er=function(){function r(e){this[A]=W(),this._result=this._state=void 0,this._subscribers=[],F!==e&&(\"function\"!=typeof e&&Z(),this instanceof r?q(this,e):rr())}return r.prototype.catch=function(r){return this.then(null,r)},r.prototype.finally=function(r){var t=this,n=t.constructor;return e(r)?t.then((function(e){return n.resolve(r()).then((function(){return e}))}),(function(e){return n.resolve(r()).then((function(){throw e}))})):t.then(r,r)},r}();function tr(){var r=void 0;if(void 0!==l)r=l;else if(\"undefined\"!=typeof self)r=self;else try{r=Function(\"return this\")()}catch(r){throw new Error(\"polyfill failed because global object is unavailable in this environment\")}var e=r.Promise;if(e){var t=null;try{t=Object.prototype.toString.call(e.resolve())}catch(r){}if(\"[object Promise]\"===t&&!e.cast)return}r.Promise=er}return er.prototype.then=S,er.all=K,er.race=J,er.resolve=D,er.reject=Q,er._setScheduler=s,er._setAsap=u,er._asap=a,er.polyfill=tr,er.Promise=er,er}(),f.exports.polyfill();var p=function(r){var e=[];return r.children.forEach((function(r){d(r)?e.push(p(r)):e.push(h(r))})),\"subgraph cluster_\".concat(r.id,' {\\nid=\"').concat(r.id,'\";\\nlabel=\"').concat(r.text,'\";\\nmargin=16;\\n').concat(e.join(\"\\n\"),\"\\n}\")},h=function(r){return\"\".concat(r.id,' [id=\"').concat(r.id,'\" label=\"').concat(r.text,'\" width=').concat(w(r.width),\" height=\").concat(w(r.height),\"]\")},m=function(r){return 96*r/72},v=function(r){return 96*r},w=function(r){return r/96};function y(r){var e=r?r.split(\",\").map((function(r){return m(+r)})):[0,0,0,0],t=e[0],n=e[1],o=e[2]-t,i=e[3]-n;return{x:t-o/2,y:n-i/2,width:o,height:i}}function _(r,e){var t=r.split(\",\").map((function(r){return m(+r)})),n=t[0],o=t[1];return{x:-n+e.width,y:-o+e.height}}function g(r,e,t){return void 0===t&&(t=\"json\"),c[r](e,t).then((function(r){return\"json\"===t?JSON.parse(r):r}))}function E(e,t){if(self.document=self.document||{currentScript:{src:t.wasmFolder+\"/dummy.js\"}},e.raw)return g(t.engine,e.raw,\"svg\");var n={},o=[],i=[],a={},s=[],u=[],c={},l=[],f=[];function m(r,e){d(r)?(n[r.id]=r,o.push(r),r.children.forEach((function(r){return m(r,!1)})),e&&i.push(p(r))):(a[r.id]=r,s.push(r),e&&u.push(h(r)))}return e.items.forEach((function(r){return m(r,!0)})),e.links.forEach((function(r){var e,t,n,o;c[r.id]=r,l.push(r),f.push((e=r.source.id,t=r.target.id,n=r.id,o=r.text,\"\".concat(e,\" -> \").concat(t,' [id=\"').concat(n,'\", label=\"').concat(o,'\"]')))})),g(t.engine,\"digraph G {\\n graph [fontname=Verdana,fontsize=11.0];\\n graph [rankdir=TB];\\n node [shape=rect,fontname=Verdana,fontsize=11.0,fixedsize=true];\\n edge [fontname=Verdana,fontsize=11.0];\\n\\n\".concat(i.join(\"\\n\"),\"\\n\\n\").concat(f.join(\"\\n\"),\"\\n\\n\").concat(u.join(\"\\n\"),\"\\n}\")).then((function(e){var t=y(e.bb);return e.objects&&e.objects.forEach((function(r){if(r.nodes){var e=function(r,e){var t=y(r);return{x:-t.x+e.width,y:-t.y+e.height,width:t.width,height:t.height}}(r.bb,t),o=n[r.id];o.x=e.x-t.width/2,o.y=e.y-t.height/2,o.width=e.width,o.height=e.height}else{var i=(u=r.pos,c=r.width,l=r.height,f=_(u,t),d=v(+c),p=v(+l),{x:f.x,y:f.y,width:d,height:p}),s=a[r.id];s&&(s.x=i.x-t.width/2,s.y=i.y-t.height/2)}var u,c,l,f,d,p})),e.edges&&e.edges.forEach((function(e){var n=c[e.id];n&&(n.points=function(e,t){if(e.pos){var n=e.pos.substr(2).split(\" \").map((function(r){return _(r,t)})).map((function(r){return[r.x-t.width/2,r.y-t.height/2]})),o=n.shift();return r(r([],n,!0),[o],!1)}return[]}(e,t))})),{clusters:o,nodes:s,links:l}}))}self.onmessage=function(r){E.apply(void 0,r.data).then((function(r){self.postMessage(r)}))}}();";
16543
+ var workerCode = "!function(){\"use strict\";function r(r,e,t){if(t||2===arguments.length)for(var n,o=0,i=e.length;o<i;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return r.concat(n||Array.prototype.slice.call(e))}\"undefined\"!=typeof document&&document.currentScript&&document.currentScript.src;let e=function(){if(\"undefined\"!=typeof self)return self;if(\"undefined\"!=typeof window)return window;if(\"undefined\"!=typeof global)return global;throw new Error(\"unable to locate global object\")}().__hpcc_wasmFolder||void 0;let t=\"undefined\"!=typeof document&&document.currentScript?document.currentScript.src:\"undefined\"!=typeof __filename?__filename:\"undefined\"!=typeof document&&document.currentScript?document.currentScript.src:\"\";t=t.substr(0,t.replace(/[?#].*/,\"\").lastIndexOf(\"/\")+1);const n={};async function o(r,e,t){const n=r.default||r;return t||(t=await async function(r){return fetch(r,{credentials:\"same-origin\"}).then((e=>{if(!e.ok)throw\"failed to load wasm binary file at '\"+r+\"'\";return e.arrayBuffer()})).catch((r=>{throw r}))}(e)),await n({wasmBinary:t})}async function i(r,i,a,s){const u=`${function(r,e){for(;r.charAt(r.length-1)===e;)r=r.substring(0,r.length-1);return r}(a||function(r){if(!arguments.length)return e;const t=e;return e=r,t}()||t||\".\",\"/\")}/${function(r,e){for(;r.charAt(0)===e;)r=r.substring(1);return r}(`${i}.wasm`,\"/\")}`;return n[u]||(n[u]=o(r,u,s)),n[u]}var a=(()=>{var r=\"undefined\"!=typeof document&&document.currentScript?document.currentScript.src:void 0;return function(e){var t,n,o=void 0!==(e=e||{})?e:{};o.ready=new Promise((function(r,e){t=r,n=e}));var i,a,s=Object.assign({},o),u=\"./this.program\",c=(r,e)=>{throw e},l=\"\";\"undefined\"!=typeof document&&document.currentScript&&(l=document.currentScript.src),r&&(l=r),l=0!==l.indexOf(\"blob:\")?l.substr(0,l.replace(/[?#].*/,\"\").lastIndexOf(\"/\")+1):\"\",i=r=>{var e=new XMLHttpRequest;return e.open(\"GET\",r,!1),e.send(null),e.responseText},a=(r,e,t)=>{var n=new XMLHttpRequest;n.open(\"GET\",r,!0),n.responseType=\"arraybuffer\",n.onload=()=>{200==n.status||0==n.status&&n.response?e(n.response):t()},n.onerror=t,n.send(null)};var f,d=o.print||console.log.bind(console),p=o.printErr||console.warn.bind(console);Object.assign(o,s),s=null,o.arguments&&o.arguments,o.thisProgram&&(u=o.thisProgram),o.quit&&(c=o.quit),o.wasmBinary&&(f=o.wasmBinary);var h,m=o.noExitRuntime||!0;\"object\"!=typeof WebAssembly&&C(\"no native wasm support detected\");var v=!1;function w(r,e){r||C(e)}var y,_,g,E,b,k,S,D=\"undefined\"!=typeof TextDecoder?new TextDecoder(\"utf8\"):void 0;function A(r,e,t){for(var n=e+t,o=e;r[o]&&!(o>=n);)++o;if(o-e>16&&r.buffer&&D)return D.decode(r.subarray(e,o));for(var i=\"\";e<o;){var a=r[e++];if(128&a){var s=63&r[e++];if(192!=(224&a)){var u=63&r[e++];if((a=224==(240&a)?(15&a)<<12|s<<6|u:(7&a)<<18|s<<12|u<<6|63&r[e++])<65536)i+=String.fromCharCode(a);else{var c=a-65536;i+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i}function F(r,e){return r?A(g,r,e):\"\"}function M(r,e,t,n){if(!(n>0))return 0;for(var o=t,i=t+n-1,a=0;a<r.length;++a){var s=r.charCodeAt(a);if(s>=55296&&s<=57343)s=65536+((1023&s)<<10)|1023&r.charCodeAt(++a);if(s<=127){if(t>=i)break;e[t++]=s}else if(s<=2047){if(t+1>=i)break;e[t++]=192|s>>6,e[t++]=128|63&s}else if(s<=65535){if(t+2>=i)break;e[t++]=224|s>>12,e[t++]=128|s>>6&63,e[t++]=128|63&s}else{if(t+3>=i)break;e[t++]=240|s>>18,e[t++]=128|s>>12&63,e[t++]=128|s>>6&63,e[t++]=128|63&s}}return e[t]=0,t-o}function P(r){for(var e=0,t=0;t<r.length;++t){var n=r.charCodeAt(t);n<=127?e++:n<=2047?e+=2:n>=55296&&n<=57343?(e+=4,++t):e+=3}return e}function x(r){y=r,o.HEAP8=_=new Int8Array(r),o.HEAP16=E=new Int16Array(r),o.HEAP32=b=new Int32Array(r),o.HEAPU8=g=new Uint8Array(r),o.HEAPU16=new Uint16Array(r),o.HEAPU32=k=new Uint32Array(r),o.HEAPF32=new Float32Array(r),o.HEAPF64=S=new Float64Array(r)}o.INITIAL_MEMORY;var j=[],z=[],T=[];var R=0,B=null;function N(r){R++,o.monitorRunDependencies&&o.monitorRunDependencies(R)}function O(r){if(R--,o.monitorRunDependencies&&o.monitorRunDependencies(R),0==R&&B){var e=B;B=null,e()}}function C(r){o.onAbort&&o.onAbort(r),p(r=\"Aborted(\"+r+\")\"),v=!0,r+=\". Build with -sASSERTIONS for more info.\";var e=new WebAssembly.RuntimeError(r);throw n(e),e}var L,I,G,U;function H(r){return r.startsWith(\"data:application/octet-stream;base64,\")}function q(r){try{if(r==L&&f)return new Uint8Array(f);throw\"both async and sync fetching of the wasm failed\"}catch(r){C(r)}}H(L=\"graphvizlib.wasm\")||(I=L,L=o.locateFile?o.locateFile(I,l):l+I);var V={163264:(r,e)=>{var t=F(r),n=F(e);rr.createPath(\"/\",Y.dirname(t)),rr.writeFile(Y.join(\"/\",t),n)}};function W(r){this.name=\"ExitStatus\",this.message=\"Program terminated with exit(\"+r+\")\",this.status=r}function X(r){for(;r.length>0;)r.shift()(o)}var Y={isAbs:r=>\"/\"===r.charAt(0),splitPath:r=>/^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/.exec(r).slice(1),normalizeArray:(r,e)=>{for(var t=0,n=r.length-1;n>=0;n--){var o=r[n];\".\"===o?r.splice(n,1):\"..\"===o?(r.splice(n,1),t++):t&&(r.splice(n,1),t--)}if(e)for(;t;t--)r.unshift(\"..\");return r},normalize:r=>{var e=Y.isAbs(r),t=\"/\"===r.substr(-1);return(r=Y.normalizeArray(r.split(\"/\").filter((r=>!!r)),!e).join(\"/\"))||e||(r=\".\"),r&&t&&(r+=\"/\"),(e?\"/\":\"\")+r},dirname:r=>{var e=Y.splitPath(r),t=e[0],n=e[1];return t||n?(n&&(n=n.substr(0,n.length-1)),t+n):\".\"},basename:r=>{if(\"/\"===r)return\"/\";var e=(r=(r=Y.normalize(r)).replace(/\\/$/,\"\")).lastIndexOf(\"/\");return-1===e?r:r.substr(e+1)},join:function(){var r=Array.prototype.slice.call(arguments);return Y.normalize(r.join(\"/\"))},join2:(r,e)=>Y.normalize(r+\"/\"+e)};var $={resolve:function(){for(var r=\"\",e=!1,t=arguments.length-1;t>=-1&&!e;t--){var n=t>=0?arguments[t]:rr.cwd();if(\"string\"!=typeof n)throw new TypeError(\"Arguments to path.resolve must be strings\");if(!n)return\"\";r=n+\"/\"+r,e=Y.isAbs(n)}return(e?\"/\":\"\")+(r=Y.normalizeArray(r.split(\"/\").filter((r=>!!r)),!e).join(\"/\"))||\".\"},relative:(r,e)=>{function t(r){for(var e=0;e<r.length&&\"\"===r[e];e++);for(var t=r.length-1;t>=0&&\"\"===r[t];t--);return e>t?[]:r.slice(e,t-e+1)}r=$.resolve(r).substr(1),e=$.resolve(e).substr(1);for(var n=t(r.split(\"/\")),o=t(e.split(\"/\")),i=Math.min(n.length,o.length),a=i,s=0;s<i;s++)if(n[s]!==o[s]){a=s;break}var u=[];for(s=a;s<n.length;s++)u.push(\"..\");return(u=u.concat(o.slice(a))).join(\"/\")}};function K(r,e,t){var n=t>0?t:P(r)+1,o=new Array(n),i=M(r,o,0,o.length);return e&&(o.length=i),o}var J={ttys:[],init:function(){},shutdown:function(){},register:function(r,e){J.ttys[r]={input:[],output:[],ops:e},rr.registerDevice(r,J.stream_ops)},stream_ops:{open:function(r){var e=J.ttys[r.node.rdev];if(!e)throw new rr.ErrnoError(43);r.tty=e,r.seekable=!1},close:function(r){r.tty.ops.fsync(r.tty)},fsync:function(r){r.tty.ops.fsync(r.tty)},read:function(r,e,t,n,o){if(!r.tty||!r.tty.ops.get_char)throw new rr.ErrnoError(60);for(var i=0,a=0;a<n;a++){var s;try{s=r.tty.ops.get_char(r.tty)}catch(r){throw new rr.ErrnoError(29)}if(void 0===s&&0===i)throw new rr.ErrnoError(6);if(null==s)break;i++,e[t+a]=s}return i&&(r.node.timestamp=Date.now()),i},write:function(r,e,t,n,o){if(!r.tty||!r.tty.ops.put_char)throw new rr.ErrnoError(60);try{for(var i=0;i<n;i++)r.tty.ops.put_char(r.tty,e[t+i])}catch(r){throw new rr.ErrnoError(29)}return n&&(r.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:function(r){if(!r.input.length){var e=null;if(\"undefined\"!=typeof window&&\"function\"==typeof window.prompt?null!==(e=window.prompt(\"Input: \"))&&(e+=\"\\n\"):\"function\"==typeof readline&&null!==(e=readline())&&(e+=\"\\n\"),!e)return null;r.input=K(e,!0)}return r.input.shift()},put_char:function(r,e){null===e||10===e?(d(A(r.output,0)),r.output=[]):0!=e&&r.output.push(e)},fsync:function(r){r.output&&r.output.length>0&&(d(A(r.output,0)),r.output=[])}},default_tty1_ops:{put_char:function(r,e){null===e||10===e?(p(A(r.output,0)),r.output=[]):0!=e&&r.output.push(e)},fsync:function(r){r.output&&r.output.length>0&&(p(A(r.output,0)),r.output=[])}}};function Q(r){r=function(r,e){return Math.ceil(r/e)*e}(r,65536);var e=Er(65536,r);return e?function(r,e){return g.fill(0,r,r+e),r}(e,r):0}var Z={ops_table:null,mount:function(r){return Z.createNode(null,\"/\",16895,0)},createNode:function(r,e,t,n){if(rr.isBlkdev(t)||rr.isFIFO(t))throw new rr.ErrnoError(63);Z.ops_table||(Z.ops_table={dir:{node:{getattr:Z.node_ops.getattr,setattr:Z.node_ops.setattr,lookup:Z.node_ops.lookup,mknod:Z.node_ops.mknod,rename:Z.node_ops.rename,unlink:Z.node_ops.unlink,rmdir:Z.node_ops.rmdir,readdir:Z.node_ops.readdir,symlink:Z.node_ops.symlink},stream:{llseek:Z.stream_ops.llseek}},file:{node:{getattr:Z.node_ops.getattr,setattr:Z.node_ops.setattr},stream:{llseek:Z.stream_ops.llseek,read:Z.stream_ops.read,write:Z.stream_ops.write,allocate:Z.stream_ops.allocate,mmap:Z.stream_ops.mmap,msync:Z.stream_ops.msync}},link:{node:{getattr:Z.node_ops.getattr,setattr:Z.node_ops.setattr,readlink:Z.node_ops.readlink},stream:{}},chrdev:{node:{getattr:Z.node_ops.getattr,setattr:Z.node_ops.setattr},stream:rr.chrdev_stream_ops}});var o=rr.createNode(r,e,t,n);return rr.isDir(o.mode)?(o.node_ops=Z.ops_table.dir.node,o.stream_ops=Z.ops_table.dir.stream,o.contents={}):rr.isFile(o.mode)?(o.node_ops=Z.ops_table.file.node,o.stream_ops=Z.ops_table.file.stream,o.usedBytes=0,o.contents=null):rr.isLink(o.mode)?(o.node_ops=Z.ops_table.link.node,o.stream_ops=Z.ops_table.link.stream):rr.isChrdev(o.mode)&&(o.node_ops=Z.ops_table.chrdev.node,o.stream_ops=Z.ops_table.chrdev.stream),o.timestamp=Date.now(),r&&(r.contents[e]=o,r.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(r){return r.contents?r.contents.subarray?r.contents.subarray(0,r.usedBytes):new Uint8Array(r.contents):new Uint8Array(0)},expandFileStorage:function(r,e){var t=r.contents?r.contents.length:0;if(!(t>=e)){e=Math.max(e,t*(t<1048576?2:1.125)>>>0),0!=t&&(e=Math.max(e,256));var n=r.contents;r.contents=new Uint8Array(e),r.usedBytes>0&&r.contents.set(n.subarray(0,r.usedBytes),0)}},resizeFileStorage:function(r,e){if(r.usedBytes!=e)if(0==e)r.contents=null,r.usedBytes=0;else{var t=r.contents;r.contents=new Uint8Array(e),t&&r.contents.set(t.subarray(0,Math.min(e,r.usedBytes))),r.usedBytes=e}},node_ops:{getattr:function(r){var e={};return e.dev=rr.isChrdev(r.mode)?r.id:1,e.ino=r.id,e.mode=r.mode,e.nlink=1,e.uid=0,e.gid=0,e.rdev=r.rdev,rr.isDir(r.mode)?e.size=4096:rr.isFile(r.mode)?e.size=r.usedBytes:rr.isLink(r.mode)?e.size=r.link.length:e.size=0,e.atime=new Date(r.timestamp),e.mtime=new Date(r.timestamp),e.ctime=new Date(r.timestamp),e.blksize=4096,e.blocks=Math.ceil(e.size/e.blksize),e},setattr:function(r,e){void 0!==e.mode&&(r.mode=e.mode),void 0!==e.timestamp&&(r.timestamp=e.timestamp),void 0!==e.size&&Z.resizeFileStorage(r,e.size)},lookup:function(r,e){throw rr.genericErrors[44]},mknod:function(r,e,t,n){return Z.createNode(r,e,t,n)},rename:function(r,e,t){if(rr.isDir(r.mode)){var n;try{n=rr.lookupNode(e,t)}catch(r){}if(n)for(var o in n.contents)throw new rr.ErrnoError(55)}delete r.parent.contents[r.name],r.parent.timestamp=Date.now(),r.name=t,e.contents[t]=r,e.timestamp=r.parent.timestamp,r.parent=e},unlink:function(r,e){delete r.contents[e],r.timestamp=Date.now()},rmdir:function(r,e){var t=rr.lookupNode(r,e);for(var n in t.contents)throw new rr.ErrnoError(55);delete r.contents[e],r.timestamp=Date.now()},readdir:function(r){var e=[\".\",\"..\"];for(var t in r.contents)r.contents.hasOwnProperty(t)&&e.push(t);return e},symlink:function(r,e,t){var n=Z.createNode(r,e,41471,0);return n.link=t,n},readlink:function(r){if(!rr.isLink(r.mode))throw new rr.ErrnoError(28);return r.link}},stream_ops:{read:function(r,e,t,n,o){var i=r.node.contents;if(o>=r.node.usedBytes)return 0;var a=Math.min(r.node.usedBytes-o,n);if(a>8&&i.subarray)e.set(i.subarray(o,o+a),t);else for(var s=0;s<a;s++)e[t+s]=i[o+s];return a},write:function(r,e,t,n,o,i){if(e.buffer===_.buffer&&(i=!1),!n)return 0;var a=r.node;if(a.timestamp=Date.now(),e.subarray&&(!a.contents||a.contents.subarray)){if(i)return a.contents=e.subarray(t,t+n),a.usedBytes=n,n;if(0===a.usedBytes&&0===o)return a.contents=e.slice(t,t+n),a.usedBytes=n,n;if(o+n<=a.usedBytes)return a.contents.set(e.subarray(t,t+n),o),n}if(Z.expandFileStorage(a,o+n),a.contents.subarray&&e.subarray)a.contents.set(e.subarray(t,t+n),o);else for(var s=0;s<n;s++)a.contents[o+s]=e[t+s];return a.usedBytes=Math.max(a.usedBytes,o+n),n},llseek:function(r,e,t){var n=e;if(1===t?n+=r.position:2===t&&rr.isFile(r.node.mode)&&(n+=r.node.usedBytes),n<0)throw new rr.ErrnoError(28);return n},allocate:function(r,e,t){Z.expandFileStorage(r.node,e+t),r.node.usedBytes=Math.max(r.node.usedBytes,e+t)},mmap:function(r,e,t,n,o){if(!rr.isFile(r.node.mode))throw new rr.ErrnoError(43);var i,a,s=r.node.contents;if(2&o||s.buffer!==y){if((t>0||t+e<s.length)&&(s=s.subarray?s.subarray(t,t+e):Array.prototype.slice.call(s,t,t+e)),a=!0,!(i=Q(e)))throw new rr.ErrnoError(48);_.set(s,i)}else a=!1,i=s.byteOffset;return{ptr:i,allocated:a}},msync:function(r,e,t,n,o){if(!rr.isFile(r.node.mode))throw new rr.ErrnoError(43);return 2&o||Z.stream_ops.write(r,e,0,n,t,!1),0}}};var rr={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:\"/\",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:(r,e={})=>{if(!(r=$.resolve(rr.cwd(),r)))return{path:\"\",node:null};if((e=Object.assign({follow_mount:!0,recurse_count:0},e)).recurse_count>8)throw new rr.ErrnoError(32);for(var t=Y.normalizeArray(r.split(\"/\").filter((r=>!!r)),!1),n=rr.root,o=\"/\",i=0;i<t.length;i++){var a=i===t.length-1;if(a&&e.parent)break;if(n=rr.lookupNode(n,t[i]),o=Y.join2(o,t[i]),rr.isMountpoint(n)&&(!a||a&&e.follow_mount)&&(n=n.mounted.root),!a||e.follow)for(var s=0;rr.isLink(n.mode);){var u=rr.readlink(o);if(o=$.resolve(Y.dirname(o),u),n=rr.lookupPath(o,{recurse_count:e.recurse_count+1}).node,s++>40)throw new rr.ErrnoError(32)}}return{path:o,node:n}},getPath:r=>{for(var e;;){if(rr.isRoot(r)){var t=r.mount.mountpoint;return e?\"/\"!==t[t.length-1]?t+\"/\"+e:t+e:t}e=e?r.name+\"/\"+e:r.name,r=r.parent}},hashName:(r,e)=>{for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return(r+t>>>0)%rr.nameTable.length},hashAddNode:r=>{var e=rr.hashName(r.parent.id,r.name);r.name_next=rr.nameTable[e],rr.nameTable[e]=r},hashRemoveNode:r=>{var e=rr.hashName(r.parent.id,r.name);if(rr.nameTable[e]===r)rr.nameTable[e]=r.name_next;else for(var t=rr.nameTable[e];t;){if(t.name_next===r){t.name_next=r.name_next;break}t=t.name_next}},lookupNode:(r,e)=>{var t=rr.mayLookup(r);if(t)throw new rr.ErrnoError(t,r);for(var n=rr.hashName(r.id,e),o=rr.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===r.id&&i===e)return o}return rr.lookup(r,e)},createNode:(r,e,t,n)=>{var o=new rr.FSNode(r,e,t,n);return rr.hashAddNode(o),o},destroyNode:r=>{rr.hashRemoveNode(r)},isRoot:r=>r===r.parent,isMountpoint:r=>!!r.mounted,isFile:r=>32768==(61440&r),isDir:r=>16384==(61440&r),isLink:r=>40960==(61440&r),isChrdev:r=>8192==(61440&r),isBlkdev:r=>24576==(61440&r),isFIFO:r=>4096==(61440&r),isSocket:r=>49152==(49152&r),flagModes:{r:0,\"r+\":2,w:577,\"w+\":578,a:1089,\"a+\":1090},modeStringToFlags:r=>{var e=rr.flagModes[r];if(void 0===e)throw new Error(\"Unknown file open mode: \"+r);return e},flagsToPermissionString:r=>{var e=[\"r\",\"w\",\"rw\"][3&r];return 512&r&&(e+=\"w\"),e},nodePermissions:(r,e)=>rr.ignorePermissions||(!e.includes(\"r\")||292&r.mode)&&(!e.includes(\"w\")||146&r.mode)&&(!e.includes(\"x\")||73&r.mode)?0:2,mayLookup:r=>{var e=rr.nodePermissions(r,\"x\");return e||(r.node_ops.lookup?0:2)},mayCreate:(r,e)=>{try{rr.lookupNode(r,e);return 20}catch(r){}return rr.nodePermissions(r,\"wx\")},mayDelete:(r,e,t)=>{var n;try{n=rr.lookupNode(r,e)}catch(r){return r.errno}var o=rr.nodePermissions(r,\"wx\");if(o)return o;if(t){if(!rr.isDir(n.mode))return 54;if(rr.isRoot(n)||rr.getPath(n)===rr.cwd())return 10}else if(rr.isDir(n.mode))return 31;return 0},mayOpen:(r,e)=>r?rr.isLink(r.mode)?32:rr.isDir(r.mode)&&(\"r\"!==rr.flagsToPermissionString(e)||512&e)?31:rr.nodePermissions(r,rr.flagsToPermissionString(e)):44,MAX_OPEN_FDS:4096,nextfd:(r=0,e=rr.MAX_OPEN_FDS)=>{for(var t=r;t<=e;t++)if(!rr.streams[t])return t;throw new rr.ErrnoError(33)},getStream:r=>rr.streams[r],createStream:(r,e,t)=>{rr.FSStream||(rr.FSStream=function(){this.shared={}},rr.FSStream.prototype={},Object.defineProperties(rr.FSStream.prototype,{object:{get:function(){return this.node},set:function(r){this.node=r}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}},flags:{get:function(){return this.shared.flags},set:function(r){this.shared.flags=r}},position:{get:function(){return this.shared.position},set:function(r){this.shared.position=r}}})),r=Object.assign(new rr.FSStream,r);var n=rr.nextfd(e,t);return r.fd=n,rr.streams[n]=r,r},closeStream:r=>{rr.streams[r]=null},chrdev_stream_ops:{open:r=>{var e=rr.getDevice(r.node.rdev);r.stream_ops=e.stream_ops,r.stream_ops.open&&r.stream_ops.open(r)},llseek:()=>{throw new rr.ErrnoError(70)}},major:r=>r>>8,minor:r=>255&r,makedev:(r,e)=>r<<8|e,registerDevice:(r,e)=>{rr.devices[r]={stream_ops:e}},getDevice:r=>rr.devices[r],getMounts:r=>{for(var e=[],t=[r];t.length;){var n=t.pop();e.push(n),t.push.apply(t,n.mounts)}return e},syncfs:(r,e)=>{\"function\"==typeof r&&(e=r,r=!1),rr.syncFSRequests++,rr.syncFSRequests>1&&p(\"warning: \"+rr.syncFSRequests+\" FS.syncfs operations in flight at once, probably just doing extra work\");var t=rr.getMounts(rr.root.mount),n=0;function o(r){return rr.syncFSRequests--,e(r)}function i(r){if(r)return i.errored?void 0:(i.errored=!0,o(r));++n>=t.length&&o(null)}t.forEach((e=>{if(!e.type.syncfs)return i(null);e.type.syncfs(e,r,i)}))},mount:(r,e,t)=>{var n,o=\"/\"===t,i=!t;if(o&&rr.root)throw new rr.ErrnoError(10);if(!o&&!i){var a=rr.lookupPath(t,{follow_mount:!1});if(t=a.path,n=a.node,rr.isMountpoint(n))throw new rr.ErrnoError(10);if(!rr.isDir(n.mode))throw new rr.ErrnoError(54)}var s={type:r,opts:e,mountpoint:t,mounts:[]},u=r.mount(s);return u.mount=s,s.root=u,o?rr.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount:r=>{var e=rr.lookupPath(r,{follow_mount:!1});if(!rr.isMountpoint(e.node))throw new rr.ErrnoError(28);var t=e.node,n=t.mounted,o=rr.getMounts(n);Object.keys(rr.nameTable).forEach((r=>{for(var e=rr.nameTable[r];e;){var t=e.name_next;o.includes(e.mount)&&rr.destroyNode(e),e=t}})),t.mounted=null;var i=t.mount.mounts.indexOf(n);t.mount.mounts.splice(i,1)},lookup:(r,e)=>r.node_ops.lookup(r,e),mknod:(r,e,t)=>{var n=rr.lookupPath(r,{parent:!0}).node,o=Y.basename(r);if(!o||\".\"===o||\"..\"===o)throw new rr.ErrnoError(28);var i=rr.mayCreate(n,o);if(i)throw new rr.ErrnoError(i);if(!n.node_ops.mknod)throw new rr.ErrnoError(63);return n.node_ops.mknod(n,o,e,t)},create:(r,e)=>(e=void 0!==e?e:438,e&=4095,e|=32768,rr.mknod(r,e,0)),mkdir:(r,e)=>(e=void 0!==e?e:511,e&=1023,e|=16384,rr.mknod(r,e,0)),mkdirTree:(r,e)=>{for(var t=r.split(\"/\"),n=\"\",o=0;o<t.length;++o)if(t[o]){n+=\"/\"+t[o];try{rr.mkdir(n,e)}catch(r){if(20!=r.errno)throw r}}},mkdev:(r,e,t)=>(void 0===t&&(t=e,e=438),e|=8192,rr.mknod(r,e,t)),symlink:(r,e)=>{if(!$.resolve(r))throw new rr.ErrnoError(44);var t=rr.lookupPath(e,{parent:!0}).node;if(!t)throw new rr.ErrnoError(44);var n=Y.basename(e),o=rr.mayCreate(t,n);if(o)throw new rr.ErrnoError(o);if(!t.node_ops.symlink)throw new rr.ErrnoError(63);return t.node_ops.symlink(t,n,r)},rename:(r,e)=>{var t,n,o=Y.dirname(r),i=Y.dirname(e),a=Y.basename(r),s=Y.basename(e);if(t=rr.lookupPath(r,{parent:!0}).node,n=rr.lookupPath(e,{parent:!0}).node,!t||!n)throw new rr.ErrnoError(44);if(t.mount!==n.mount)throw new rr.ErrnoError(75);var u,c=rr.lookupNode(t,a),l=$.relative(r,i);if(\".\"!==l.charAt(0))throw new rr.ErrnoError(28);if(\".\"!==(l=$.relative(e,o)).charAt(0))throw new rr.ErrnoError(55);try{u=rr.lookupNode(n,s)}catch(r){}if(c!==u){var f=rr.isDir(c.mode),d=rr.mayDelete(t,a,f);if(d)throw new rr.ErrnoError(d);if(d=u?rr.mayDelete(n,s,f):rr.mayCreate(n,s))throw new rr.ErrnoError(d);if(!t.node_ops.rename)throw new rr.ErrnoError(63);if(rr.isMountpoint(c)||u&&rr.isMountpoint(u))throw new rr.ErrnoError(10);if(n!==t&&(d=rr.nodePermissions(t,\"w\")))throw new rr.ErrnoError(d);rr.hashRemoveNode(c);try{t.node_ops.rename(c,n,s)}catch(r){throw r}finally{rr.hashAddNode(c)}}},rmdir:r=>{var e=rr.lookupPath(r,{parent:!0}).node,t=Y.basename(r),n=rr.lookupNode(e,t),o=rr.mayDelete(e,t,!0);if(o)throw new rr.ErrnoError(o);if(!e.node_ops.rmdir)throw new rr.ErrnoError(63);if(rr.isMountpoint(n))throw new rr.ErrnoError(10);e.node_ops.rmdir(e,t),rr.destroyNode(n)},readdir:r=>{var e=rr.lookupPath(r,{follow:!0}).node;if(!e.node_ops.readdir)throw new rr.ErrnoError(54);return e.node_ops.readdir(e)},unlink:r=>{var e=rr.lookupPath(r,{parent:!0}).node;if(!e)throw new rr.ErrnoError(44);var t=Y.basename(r),n=rr.lookupNode(e,t),o=rr.mayDelete(e,t,!1);if(o)throw new rr.ErrnoError(o);if(!e.node_ops.unlink)throw new rr.ErrnoError(63);if(rr.isMountpoint(n))throw new rr.ErrnoError(10);e.node_ops.unlink(e,t),rr.destroyNode(n)},readlink:r=>{var e=rr.lookupPath(r).node;if(!e)throw new rr.ErrnoError(44);if(!e.node_ops.readlink)throw new rr.ErrnoError(28);return $.resolve(rr.getPath(e.parent),e.node_ops.readlink(e))},stat:(r,e)=>{var t=rr.lookupPath(r,{follow:!e}).node;if(!t)throw new rr.ErrnoError(44);if(!t.node_ops.getattr)throw new rr.ErrnoError(63);return t.node_ops.getattr(t)},lstat:r=>rr.stat(r,!0),chmod:(r,e,t)=>{var n;\"string\"==typeof r?n=rr.lookupPath(r,{follow:!t}).node:n=r;if(!n.node_ops.setattr)throw new rr.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&e|-4096&n.mode,timestamp:Date.now()})},lchmod:(r,e)=>{rr.chmod(r,e,!0)},fchmod:(r,e)=>{var t=rr.getStream(r);if(!t)throw new rr.ErrnoError(8);rr.chmod(t.node,e)},chown:(r,e,t,n)=>{var o;\"string\"==typeof r?o=rr.lookupPath(r,{follow:!n}).node:o=r;if(!o.node_ops.setattr)throw new rr.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:(r,e,t)=>{rr.chown(r,e,t,!0)},fchown:(r,e,t)=>{var n=rr.getStream(r);if(!n)throw new rr.ErrnoError(8);rr.chown(n.node,e,t)},truncate:(r,e)=>{if(e<0)throw new rr.ErrnoError(28);var t;\"string\"==typeof r?t=rr.lookupPath(r,{follow:!0}).node:t=r;if(!t.node_ops.setattr)throw new rr.ErrnoError(63);if(rr.isDir(t.mode))throw new rr.ErrnoError(31);if(!rr.isFile(t.mode))throw new rr.ErrnoError(28);var n=rr.nodePermissions(t,\"w\");if(n)throw new rr.ErrnoError(n);t.node_ops.setattr(t,{size:e,timestamp:Date.now()})},ftruncate:(r,e)=>{var t=rr.getStream(r);if(!t)throw new rr.ErrnoError(8);if(0==(2097155&t.flags))throw new rr.ErrnoError(28);rr.truncate(t.node,e)},utime:(r,e,t)=>{var n=rr.lookupPath(r,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(e,t)})},open:(r,e,t)=>{if(\"\"===r)throw new rr.ErrnoError(44);var n;if(t=void 0===t?438:t,t=64&(e=\"string\"==typeof e?rr.modeStringToFlags(e):e)?4095&t|32768:0,\"object\"==typeof r)n=r;else{r=Y.normalize(r);try{n=rr.lookupPath(r,{follow:!(131072&e)}).node}catch(r){}}var i=!1;if(64&e)if(n){if(128&e)throw new rr.ErrnoError(20)}else n=rr.mknod(r,t,0),i=!0;if(!n)throw new rr.ErrnoError(44);if(rr.isChrdev(n.mode)&&(e&=-513),65536&e&&!rr.isDir(n.mode))throw new rr.ErrnoError(54);if(!i){var a=rr.mayOpen(n,e);if(a)throw new rr.ErrnoError(a)}512&e&&!i&&rr.truncate(n,0),e&=-131713;var s=rr.createStream({node:n,path:rr.getPath(n),flags:e,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return s.stream_ops.open&&s.stream_ops.open(s),!o.logReadFiles||1&e||(rr.readFiles||(rr.readFiles={}),r in rr.readFiles||(rr.readFiles[r]=1)),s},close:r=>{if(rr.isClosed(r))throw new rr.ErrnoError(8);r.getdents&&(r.getdents=null);try{r.stream_ops.close&&r.stream_ops.close(r)}catch(r){throw r}finally{rr.closeStream(r.fd)}r.fd=null},isClosed:r=>null===r.fd,llseek:(r,e,t)=>{if(rr.isClosed(r))throw new rr.ErrnoError(8);if(!r.seekable||!r.stream_ops.llseek)throw new rr.ErrnoError(70);if(0!=t&&1!=t&&2!=t)throw new rr.ErrnoError(28);return r.position=r.stream_ops.llseek(r,e,t),r.ungotten=[],r.position},read:(r,e,t,n,o)=>{if(n<0||o<0)throw new rr.ErrnoError(28);if(rr.isClosed(r))throw new rr.ErrnoError(8);if(1==(2097155&r.flags))throw new rr.ErrnoError(8);if(rr.isDir(r.node.mode))throw new rr.ErrnoError(31);if(!r.stream_ops.read)throw new rr.ErrnoError(28);var i=void 0!==o;if(i){if(!r.seekable)throw new rr.ErrnoError(70)}else o=r.position;var a=r.stream_ops.read(r,e,t,n,o);return i||(r.position+=a),a},write:(r,e,t,n,o,i)=>{if(n<0||o<0)throw new rr.ErrnoError(28);if(rr.isClosed(r))throw new rr.ErrnoError(8);if(0==(2097155&r.flags))throw new rr.ErrnoError(8);if(rr.isDir(r.node.mode))throw new rr.ErrnoError(31);if(!r.stream_ops.write)throw new rr.ErrnoError(28);r.seekable&&1024&r.flags&&rr.llseek(r,0,2);var a=void 0!==o;if(a){if(!r.seekable)throw new rr.ErrnoError(70)}else o=r.position;var s=r.stream_ops.write(r,e,t,n,o,i);return a||(r.position+=s),s},allocate:(r,e,t)=>{if(rr.isClosed(r))throw new rr.ErrnoError(8);if(e<0||t<=0)throw new rr.ErrnoError(28);if(0==(2097155&r.flags))throw new rr.ErrnoError(8);if(!rr.isFile(r.node.mode)&&!rr.isDir(r.node.mode))throw new rr.ErrnoError(43);if(!r.stream_ops.allocate)throw new rr.ErrnoError(138);r.stream_ops.allocate(r,e,t)},mmap:(r,e,t,n,o)=>{if(0!=(2&n)&&0==(2&o)&&2!=(2097155&r.flags))throw new rr.ErrnoError(2);if(1==(2097155&r.flags))throw new rr.ErrnoError(2);if(!r.stream_ops.mmap)throw new rr.ErrnoError(43);return r.stream_ops.mmap(r,e,t,n,o)},msync:(r,e,t,n,o)=>r&&r.stream_ops.msync?r.stream_ops.msync(r,e,t,n,o):0,munmap:r=>0,ioctl:(r,e,t)=>{if(!r.stream_ops.ioctl)throw new rr.ErrnoError(59);return r.stream_ops.ioctl(r,e,t)},readFile:(r,e={})=>{if(e.flags=e.flags||0,e.encoding=e.encoding||\"binary\",\"utf8\"!==e.encoding&&\"binary\"!==e.encoding)throw new Error('Invalid encoding type \"'+e.encoding+'\"');var t,n=rr.open(r,e.flags),o=rr.stat(r).size,i=new Uint8Array(o);return rr.read(n,i,0,o,0),\"utf8\"===e.encoding?t=A(i,0):\"binary\"===e.encoding&&(t=i),rr.close(n),t},writeFile:(r,e,t={})=>{t.flags=t.flags||577;var n=rr.open(r,t.flags,t.mode);if(\"string\"==typeof e){var o=new Uint8Array(P(e)+1),i=M(e,o,0,o.length);rr.write(n,o,0,i,void 0,t.canOwn)}else{if(!ArrayBuffer.isView(e))throw new Error(\"Unsupported data type\");rr.write(n,e,0,e.byteLength,void 0,t.canOwn)}rr.close(n)},cwd:()=>rr.currentPath,chdir:r=>{var e=rr.lookupPath(r,{follow:!0});if(null===e.node)throw new rr.ErrnoError(44);if(!rr.isDir(e.node.mode))throw new rr.ErrnoError(54);var t=rr.nodePermissions(e.node,\"x\");if(t)throw new rr.ErrnoError(t);rr.currentPath=e.path},createDefaultDirectories:()=>{rr.mkdir(\"/tmp\"),rr.mkdir(\"/home\"),rr.mkdir(\"/home/web_user\")},createDefaultDevices:()=>{rr.mkdir(\"/dev\"),rr.registerDevice(rr.makedev(1,3),{read:()=>0,write:(r,e,t,n,o)=>n}),rr.mkdev(\"/dev/null\",rr.makedev(1,3)),J.register(rr.makedev(5,0),J.default_tty_ops),J.register(rr.makedev(6,0),J.default_tty1_ops),rr.mkdev(\"/dev/tty\",rr.makedev(5,0)),rr.mkdev(\"/dev/tty1\",rr.makedev(6,0));var r=function(){if(\"object\"==typeof crypto&&\"function\"==typeof crypto.getRandomValues){var r=new Uint8Array(1);return()=>(crypto.getRandomValues(r),r[0])}return()=>C(\"randomDevice\")}();rr.createDevice(\"/dev\",\"random\",r),rr.createDevice(\"/dev\",\"urandom\",r),rr.mkdir(\"/dev/shm\"),rr.mkdir(\"/dev/shm/tmp\")},createSpecialDirectories:()=>{rr.mkdir(\"/proc\");var r=rr.mkdir(\"/proc/self\");rr.mkdir(\"/proc/self/fd\"),rr.mount({mount:()=>{var e=rr.createNode(r,\"fd\",16895,73);return e.node_ops={lookup:(r,e)=>{var t=+e,n=rr.getStream(t);if(!n)throw new rr.ErrnoError(8);var o={parent:null,mount:{mountpoint:\"fake\"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},e}},{},\"/proc/self/fd\")},createStandardStreams:()=>{o.stdin?rr.createDevice(\"/dev\",\"stdin\",o.stdin):rr.symlink(\"/dev/tty\",\"/dev/stdin\"),o.stdout?rr.createDevice(\"/dev\",\"stdout\",null,o.stdout):rr.symlink(\"/dev/tty\",\"/dev/stdout\"),o.stderr?rr.createDevice(\"/dev\",\"stderr\",null,o.stderr):rr.symlink(\"/dev/tty1\",\"/dev/stderr\"),rr.open(\"/dev/stdin\",0),rr.open(\"/dev/stdout\",1),rr.open(\"/dev/stderr\",1)},ensureErrnoError:()=>{rr.ErrnoError||(rr.ErrnoError=function(r,e){this.node=e,this.setErrno=function(r){this.errno=r},this.setErrno(r),this.message=\"FS error\"},rr.ErrnoError.prototype=new Error,rr.ErrnoError.prototype.constructor=rr.ErrnoError,[44].forEach((r=>{rr.genericErrors[r]=new rr.ErrnoError(r),rr.genericErrors[r].stack=\"<generic error, no stack>\"})))},staticInit:()=>{rr.ensureErrnoError(),rr.nameTable=new Array(4096),rr.mount(Z,{},\"/\"),rr.createDefaultDirectories(),rr.createDefaultDevices(),rr.createSpecialDirectories(),rr.filesystems={MEMFS:Z}},init:(r,e,t)=>{rr.init.initialized=!0,rr.ensureErrnoError(),o.stdin=r||o.stdin,o.stdout=e||o.stdout,o.stderr=t||o.stderr,rr.createStandardStreams()},quit:()=>{rr.init.initialized=!1;for(var r=0;r<rr.streams.length;r++){var e=rr.streams[r];e&&rr.close(e)}},getMode:(r,e)=>{var t=0;return r&&(t|=365),e&&(t|=146),t},findObject:(r,e)=>{var t=rr.analyzePath(r,e);return t.exists?t.object:null},analyzePath:(r,e)=>{try{r=(n=rr.lookupPath(r,{follow:!e})).path}catch(r){}var t={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=rr.lookupPath(r,{parent:!0});t.parentExists=!0,t.parentPath=n.path,t.parentObject=n.node,t.name=Y.basename(r),n=rr.lookupPath(r,{follow:!e}),t.exists=!0,t.path=n.path,t.object=n.node,t.name=n.node.name,t.isRoot=\"/\"===n.path}catch(r){t.error=r.errno}return t},createPath:(r,e,t,n)=>{r=\"string\"==typeof r?r:rr.getPath(r);for(var o=e.split(\"/\").reverse();o.length;){var i=o.pop();if(i){var a=Y.join2(r,i);try{rr.mkdir(a)}catch(r){}r=a}}return a},createFile:(r,e,t,n,o)=>{var i=Y.join2(\"string\"==typeof r?r:rr.getPath(r),e),a=rr.getMode(n,o);return rr.create(i,a)},createDataFile:(r,e,t,n,o,i)=>{var a=e;r&&(r=\"string\"==typeof r?r:rr.getPath(r),a=e?Y.join2(r,e):r);var s=rr.getMode(n,o),u=rr.create(a,s);if(t){if(\"string\"==typeof t){for(var c=new Array(t.length),l=0,f=t.length;l<f;++l)c[l]=t.charCodeAt(l);t=c}rr.chmod(u,146|s);var d=rr.open(u,577);rr.write(d,t,0,t.length,0,i),rr.close(d),rr.chmod(u,s)}return u},createDevice:(r,e,t,n)=>{var o=Y.join2(\"string\"==typeof r?r:rr.getPath(r),e),i=rr.getMode(!!t,!!n);rr.createDevice.major||(rr.createDevice.major=64);var a=rr.makedev(rr.createDevice.major++,0);return rr.registerDevice(a,{open:r=>{r.seekable=!1},close:r=>{n&&n.buffer&&n.buffer.length&&n(10)},read:(r,e,n,o,i)=>{for(var a=0,s=0;s<o;s++){var u;try{u=t()}catch(r){throw new rr.ErrnoError(29)}if(void 0===u&&0===a)throw new rr.ErrnoError(6);if(null==u)break;a++,e[n+s]=u}return a&&(r.node.timestamp=Date.now()),a},write:(r,e,t,o,i)=>{for(var a=0;a<o;a++)try{n(e[t+a])}catch(r){throw new rr.ErrnoError(29)}return o&&(r.node.timestamp=Date.now()),a}}),rr.mkdev(o,i,a)},forceLoadFile:r=>{if(r.isDevice||r.isFolder||r.link||r.contents)return!0;if(\"undefined\"!=typeof XMLHttpRequest)throw new Error(\"Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.\");if(!i)throw new Error(\"Cannot load without read() or XMLHttpRequest.\");try{r.contents=K(i(r.url),!0),r.usedBytes=r.contents.length}catch(r){throw new rr.ErrnoError(29)}},createLazyFile:(r,e,t,n,o)=>{function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(r){if(!(r>this.length-1||r<0)){var e=r%this.chunkSize,t=r/this.chunkSize|0;return this.getter(t)[e]}},i.prototype.setDataGetter=function(r){this.getter=r},i.prototype.cacheLength=function(){var r=new XMLHttpRequest;if(r.open(\"HEAD\",t,!1),r.send(null),!(r.status>=200&&r.status<300||304===r.status))throw new Error(\"Couldn't load \"+t+\". Status: \"+r.status);var e,n=Number(r.getResponseHeader(\"Content-length\")),o=(e=r.getResponseHeader(\"Accept-Ranges\"))&&\"bytes\"===e,i=(e=r.getResponseHeader(\"Content-Encoding\"))&&\"gzip\"===e,a=1048576;o||(a=n);var s=this;s.setDataGetter((r=>{var e=r*a,o=(r+1)*a-1;if(o=Math.min(o,n-1),void 0===s.chunks[r]&&(s.chunks[r]=((r,e)=>{if(r>e)throw new Error(\"invalid range (\"+r+\", \"+e+\") or no bytes requested!\");if(e>n-1)throw new Error(\"only \"+n+\" bytes available! programmer error!\");var o=new XMLHttpRequest;if(o.open(\"GET\",t,!1),n!==a&&o.setRequestHeader(\"Range\",\"bytes=\"+r+\"-\"+e),o.responseType=\"arraybuffer\",o.overrideMimeType&&o.overrideMimeType(\"text/plain; charset=x-user-defined\"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error(\"Couldn't load \"+t+\". Status: \"+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):K(o.responseText||\"\",!0)})(e,o)),void 0===s.chunks[r])throw new Error(\"doXHR failed!\");return s.chunks[r]})),!i&&n||(a=n=1,n=this.getter(0).length,a=n,d(\"LazyFiles on gzip forces download of the whole file when length is accessed\")),this._length=n,this._chunkSize=a,this.lengthKnown=!0},\"undefined\"!=typeof XMLHttpRequest)throw\"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc\";var a={isDevice:!1,url:t},s=rr.createFile(r,e,a,n,o);a.contents?s.contents=a.contents:a.url&&(s.contents=null,s.url=a.url),Object.defineProperties(s,{usedBytes:{get:function(){return this.contents.length}}});var u={};function c(r,e,t,n,o){var i=r.node.contents;if(o>=i.length)return 0;var a=Math.min(i.length-o,n);if(i.slice)for(var s=0;s<a;s++)e[t+s]=i[o+s];else for(s=0;s<a;s++)e[t+s]=i.get(o+s);return a}return Object.keys(s.stream_ops).forEach((r=>{var e=s.stream_ops[r];u[r]=function(){return rr.forceLoadFile(s),e.apply(null,arguments)}})),u.read=(r,e,t,n,o)=>(rr.forceLoadFile(s),c(r,e,t,n,o)),u.mmap=(r,e,t,n,o)=>{rr.forceLoadFile(s);var i=Q(e);if(!i)throw new rr.ErrnoError(48);return c(r,_,i,e,t),{ptr:i,allocated:!0}},s.stream_ops=u,s},createPreloadedFile:(r,e,t,n,o,i,s,u,c,l)=>{var f=e?$.resolve(Y.join2(r,e)):r;function d(t){function a(t){l&&l(),u||rr.createDataFile(r,e,t,n,o,c),i&&i(),O()}Browser.handledByPreloadPlugin(t,f,a,(()=>{s&&s(),O()}))||a(t)}N(),\"string\"==typeof t?function(r,e,t,n){var o=n?\"\":\"al \"+r;a(r,(t=>{w(t,'Loading data file \"'+r+'\" failed (no arrayBuffer).'),e(new Uint8Array(t)),o&&O()}),(e=>{if(!t)throw'Loading data file \"'+r+'\" failed.';t()})),o&&N()}(t,(r=>d(r)),s):d(t)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>\"EM_FS_\"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:\"FILE_DATA\",saveFilesToDB:(r,e,t)=>{e=e||(()=>{}),t=t||(()=>{});var n=rr.indexedDB();try{var o=n.open(rr.DB_NAME(),rr.DB_VERSION)}catch(r){return t(r)}o.onupgradeneeded=()=>{d(\"creating db\"),o.result.createObjectStore(rr.DB_STORE_NAME)},o.onsuccess=()=>{var n=o.result.transaction([rr.DB_STORE_NAME],\"readwrite\"),i=n.objectStore(rr.DB_STORE_NAME),a=0,s=0,u=r.length;function c(){0==s?e():t()}r.forEach((r=>{var e=i.put(rr.analyzePath(r).object.contents,r);e.onsuccess=()=>{++a+s==u&&c()},e.onerror=()=>{s++,a+s==u&&c()}})),n.onerror=t},o.onerror=t},loadFilesFromDB:(r,e,t)=>{e=e||(()=>{}),t=t||(()=>{});var n=rr.indexedDB();try{var o=n.open(rr.DB_NAME(),rr.DB_VERSION)}catch(r){return t(r)}o.onupgradeneeded=t,o.onsuccess=()=>{var n=o.result;try{var i=n.transaction([rr.DB_STORE_NAME],\"readonly\")}catch(r){return void t(r)}var a=i.objectStore(rr.DB_STORE_NAME),s=0,u=0,c=r.length;function l(){0==u?e():t()}r.forEach((r=>{var e=a.get(r);e.onsuccess=()=>{rr.analyzePath(r).exists&&rr.unlink(r),rr.createDataFile(Y.dirname(r),Y.basename(r),e.result,!0,!0,!0),++s+u==c&&l()},e.onerror=()=>{u++,s+u==c&&l()}})),i.onerror=t},o.onerror=t}},er={DEFAULT_POLLMASK:5,calculateAt:function(r,e,t){if(Y.isAbs(e))return e;var n;-100===r?n=rr.cwd():n=er.getStreamFromFD(r).path;if(0==e.length){if(!t)throw new rr.ErrnoError(44);return n}return Y.join2(n,e)},doStat:function(r,e,t){try{var n=r(e)}catch(r){if(r&&r.node&&Y.normalize(e)!==Y.normalize(rr.getPath(r.node)))return-54;throw r}return b[t>>2]=n.dev,b[t+8>>2]=n.ino,b[t+12>>2]=n.mode,k[t+16>>2]=n.nlink,b[t+20>>2]=n.uid,b[t+24>>2]=n.gid,b[t+28>>2]=n.rdev,U=[n.size>>>0,(G=n.size,+Math.abs(G)>=1?G>0?(0|Math.min(+Math.floor(G/4294967296),4294967295))>>>0:~~+Math.ceil((G-+(~~G>>>0))/4294967296)>>>0:0)],b[t+40>>2]=U[0],b[t+44>>2]=U[1],b[t+48>>2]=4096,b[t+52>>2]=n.blocks,U=[Math.floor(n.atime.getTime()/1e3)>>>0,(G=Math.floor(n.atime.getTime()/1e3),+Math.abs(G)>=1?G>0?(0|Math.min(+Math.floor(G/4294967296),4294967295))>>>0:~~+Math.ceil((G-+(~~G>>>0))/4294967296)>>>0:0)],b[t+56>>2]=U[0],b[t+60>>2]=U[1],k[t+64>>2]=0,U=[Math.floor(n.mtime.getTime()/1e3)>>>0,(G=Math.floor(n.mtime.getTime()/1e3),+Math.abs(G)>=1?G>0?(0|Math.min(+Math.floor(G/4294967296),4294967295))>>>0:~~+Math.ceil((G-+(~~G>>>0))/4294967296)>>>0:0)],b[t+72>>2]=U[0],b[t+76>>2]=U[1],k[t+80>>2]=0,U=[Math.floor(n.ctime.getTime()/1e3)>>>0,(G=Math.floor(n.ctime.getTime()/1e3),+Math.abs(G)>=1?G>0?(0|Math.min(+Math.floor(G/4294967296),4294967295))>>>0:~~+Math.ceil((G-+(~~G>>>0))/4294967296)>>>0:0)],b[t+88>>2]=U[0],b[t+92>>2]=U[1],k[t+96>>2]=0,U=[n.ino>>>0,(G=n.ino,+Math.abs(G)>=1?G>0?(0|Math.min(+Math.floor(G/4294967296),4294967295))>>>0:~~+Math.ceil((G-+(~~G>>>0))/4294967296)>>>0:0)],b[t+104>>2]=U[0],b[t+108>>2]=U[1],0},doMsync:function(r,e,t,n,o){var i=g.slice(r,r+t);rr.msync(e,i,o,t,n)},varargs:void 0,get:function(){return er.varargs+=4,b[er.varargs-4>>2]},getStr:function(r){return F(r)},getStreamFromFD:function(r){var e=rr.getStream(r);if(!e)throw new rr.ErrnoError(8);return e}};var tr=[];function nr(r){try{return h.grow(r-y.byteLength+65535>>>16),x(h.buffer),1}catch(r){}}var or={};function ir(){if(!ir.strings){var r={USER:\"web_user\",LOGNAME:\"web_user\",PATH:\"/\",PWD:\"/\",HOME:\"/home/web_user\",LANG:(\"object\"==typeof navigator&&navigator.languages&&navigator.languages[0]||\"C\").replace(\"-\",\"_\")+\".UTF-8\",_:u||\"./this.program\"};for(var e in or)void 0===or[e]?delete r[e]:r[e]=or[e];var t=[];for(var e in r)t.push(e+\"=\"+r[e]);ir.strings=t}return ir.strings}function ar(r){m||(o.onExit&&o.onExit(r),v=!0),c(r,new W(r))}var sr=function(r,e){ar(r)};var ur=function(r,e,t,n){r||(r=this),this.parent=r,this.mount=r.mount,this.mounted=null,this.id=rr.nextInode++,this.name=e,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=n},cr=365,lr=146;Object.defineProperties(ur.prototype,{read:{get:function(){return(this.mode&cr)===cr},set:function(r){r?this.mode|=cr:this.mode&=-366}},write:{get:function(){return(this.mode&lr)===lr},set:function(r){r?this.mode|=lr:this.mode&=-147}},isFolder:{get:function(){return rr.isDir(this.mode)}},isDevice:{get:function(){return rr.isChrdev(this.mode)}}}),rr.FSNode=ur,rr.staticInit();var fr={k:function(r,e,t,n){try{if(e=er.getStr(e),e=er.calculateAt(r,e),-8&t)return-28;var o=rr.lookupPath(e,{follow:!0}).node;if(!o)return-44;var i=\"\";return 4&t&&(i+=\"r\"),2&t&&(i+=\"w\"),1&t&&(i+=\"x\"),i&&rr.nodePermissions(o,i)?-2:0}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return-r.errno}},f:function(r,e,t){er.varargs=t;try{var n=er.getStreamFromFD(r);switch(e){case 0:return(o=er.get())<0?-28:rr.createStream(n,o).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var o=er.get();return n.flags|=o,0;case 5:o=er.get();return E[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return i=28,b[gr()>>2]=i,-1}}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return-r.errno}var i},u:function(r,e){try{var t=er.getStreamFromFD(r);return er.doStat(rr.stat,t.path,e)}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return-r.errno}},v:function(r,e,t){er.varargs=t;try{var n=er.getStreamFromFD(r);switch(e){case 21509:case 21505:case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:case 21523:case 21524:return n.tty?0:-59;case 21519:if(!n.tty)return-59;var o=er.get();return b[o>>2]=0,0;case 21520:return n.tty?-28:-59;case 21531:o=er.get();return rr.ioctl(n,e,o);default:return-28}}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return-r.errno}},s:function(r,e,t,n){try{e=er.getStr(e);var o=256&n,i=4096&n;return n&=-4353,e=er.calculateAt(r,e,i),er.doStat(o?rr.lstat:rr.stat,e,t)}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return-r.errno}},c:function(r,e,t,n){er.varargs=n;try{e=er.getStr(e),e=er.calculateAt(r,e);var o=n?er.get():0;return rr.open(e,t,o).fd}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return-r.errno}},t:function(r,e){try{return r=er.getStr(r),er.doStat(rr.stat,r,e)}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return-r.errno}},n:function(r,e,t){try{return e=er.getStr(e),e=er.calculateAt(r,e),0===t?rr.unlink(e):512===t?rr.rmdir(e):C(\"Invalid flags passed to unlinkat\"),0}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return-r.errno}},d:function(){return Date.now()},i:function(){return true},o:function(r,e,t,n,o,i){try{var a=er.getStreamFromFD(n),s=rr.mmap(a,r,o,e,t),u=s.ptr;return b[i>>2]=s.allocated,u}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return-r.errno}},p:function(r,e,t,n,o,i){try{var a=er.getStreamFromFD(o);2&t&&er.doMsync(r,a,e,n,i),rr.munmap(a)}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return-r.errno}},a:function(){C(\"\")},w:function(r,e,t){var n=function(r,e){var t;for(tr.length=0,e>>=2;t=g[r++];)e+=105!=t&e,tr.push(105==t?b[e]:S[e++>>1]),++e;return tr}(e,t);return V[r].apply(null,n)},j:function(r,e,t){g.copyWithin(r,e,e+t)},m:function(r){var e,t,n=g.length,o=2147483648;if((r>>>=0)>o)return!1;for(var i=1;i<=4;i*=2){var a=n*(1+.2/i);if(a=Math.min(a,r+100663296),nr(Math.min(o,(e=Math.max(r,a))+((t=65536)-e%t)%t)))return!0}return!1},q:function(r,e){var t=0;return ir().forEach((function(n,o){var i=e+t;k[r+4*o>>2]=i,function(r,e,t){for(var n=0;n<r.length;++n)_[e++>>0]=r.charCodeAt(n);t||(_[e>>0]=0)}(n,i),t+=n.length+1})),0},r:function(r,e){var t=ir();k[r>>2]=t.length;var n=0;return t.forEach((function(r){n+=r.length+1})),k[e>>2]=n,0},e:sr,b:function(r){try{var e=er.getStreamFromFD(r);return rr.close(e),0}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return r.errno}},g:function(r,e,t,n){try{var o=function(r,e,t,n){for(var o=0,i=0;i<t;i++){var a=k[e>>2],s=k[e+4>>2];e+=8;var u=rr.read(r,_,a,s,n);if(u<0)return-1;if(o+=u,u<s)break}return o}(er.getStreamFromFD(r),e,t);return k[n>>2]=o,0}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return r.errno}},l:function(r,e,t,n,o){try{var i=(u=t)+2097152>>>0<4194305-!!(s=e)?(s>>>0)+4294967296*u:NaN;if(isNaN(i))return 61;var a=er.getStreamFromFD(r);return rr.llseek(a,i,n),U=[a.position>>>0,(G=a.position,+Math.abs(G)>=1?G>0?(0|Math.min(+Math.floor(G/4294967296),4294967295))>>>0:~~+Math.ceil((G-+(~~G>>>0))/4294967296)>>>0:0)],b[o>>2]=U[0],b[o+4>>2]=U[1],a.getdents&&0===i&&0===n&&(a.getdents=null),0}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return r.errno}var s,u},h:function(r,e,t,n){try{var o=function(r,e,t,n){for(var o=0,i=0;i<t;i++){var a=k[e>>2],s=k[e+4>>2];e+=8;var u=rr.write(r,_,a,s,n);if(u<0)return-1;o+=u}return o}(er.getStreamFromFD(r),e,t);return k[n>>2]=o,0}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return r.errno}}};!function(){var r={a:fr};function e(r,e){var t,n=r.exports;o.asm=n,x((h=o.asm.x).buffer),o.asm.G,t=o.asm.y,z.unshift(t),O()}function t(r){e(r.instance)}function i(e){return(f||\"function\"!=typeof fetch?Promise.resolve().then((function(){return q(L)})):fetch(L,{credentials:\"same-origin\"}).then((function(r){if(!r.ok)throw\"failed to load wasm binary file at '\"+L+\"'\";return r.arrayBuffer()})).catch((function(){return q(L)}))).then((function(e){return WebAssembly.instantiate(e,r)})).then((function(r){return r})).then(e,(function(r){p(\"failed to asynchronously prepare wasm: \"+r),C(r)}))}if(N(),o.instantiateWasm)try{return o.instantiateWasm(r,e)}catch(r){return p(\"Module.instantiateWasm callback failed with error: \"+r),!1}(f||\"function\"!=typeof WebAssembly.instantiateStreaming||H(L)||\"function\"!=typeof fetch?i(t):fetch(L,{credentials:\"same-origin\"}).then((function(e){return WebAssembly.instantiateStreaming(e,r).then(t,(function(r){return p(\"wasm streaming compile failed: \"+r),p(\"falling back to ArrayBuffer instantiation\"),i(t)}))}))).catch(n)}(),o.___wasm_call_ctors=function(){return(o.___wasm_call_ctors=o.asm.y).apply(null,arguments)};var dr=o._emscripten_bind_VoidPtr___destroy___0=function(){return(dr=o._emscripten_bind_VoidPtr___destroy___0=o.asm.z).apply(null,arguments)},pr=o._emscripten_bind_Graphviz_Graphviz_2=function(){return(pr=o._emscripten_bind_Graphviz_Graphviz_2=o.asm.A).apply(null,arguments)},hr=o._emscripten_bind_Graphviz_version_0=function(){return(hr=o._emscripten_bind_Graphviz_version_0=o.asm.B).apply(null,arguments)},mr=o._emscripten_bind_Graphviz_lastError_0=function(){return(mr=o._emscripten_bind_Graphviz_lastError_0=o.asm.C).apply(null,arguments)},vr=o._emscripten_bind_Graphviz_layout_3=function(){return(vr=o._emscripten_bind_Graphviz_layout_3=o.asm.D).apply(null,arguments)},wr=o._emscripten_bind_Graphviz_createFile_2=function(){return(wr=o._emscripten_bind_Graphviz_createFile_2=o.asm.E).apply(null,arguments)},yr=o._emscripten_bind_Graphviz___destroy___0=function(){return(yr=o._emscripten_bind_Graphviz___destroy___0=o.asm.F).apply(null,arguments)};o._free=function(){return(o._free=o.asm.H).apply(null,arguments)},o._malloc=function(){return(o._malloc=o.asm.I).apply(null,arguments)};var _r,gr=o.___errno_location=function(){return(gr=o.___errno_location=o.asm.J).apply(null,arguments)},Er=o._emscripten_builtin_memalign=function(){return(Er=o._emscripten_builtin_memalign=o.asm.K).apply(null,arguments)};function br(r){function e(){_r||(_r=!0,o.calledRun=!0,v||(o.noFSInit||rr.init.initialized||rr.init(),rr.ignorePermissions=!1,X(z),t(o),o.onRuntimeInitialized&&o.onRuntimeInitialized(),function(){if(o.postRun)for(\"function\"==typeof o.postRun&&(o.postRun=[o.postRun]);o.postRun.length;)r=o.postRun.shift(),T.unshift(r);var r;X(T)}()))}R>0||(!function(){if(o.preRun)for(\"function\"==typeof o.preRun&&(o.preRun=[o.preRun]);o.preRun.length;)r=o.preRun.shift(),j.unshift(r);var r;X(j)}(),R>0||(o.setStatus?(o.setStatus(\"Running...\"),setTimeout((function(){setTimeout((function(){o.setStatus(\"\")}),1),e()}),1)):e()))}if(o.___start_em_js=163408,o.___stop_em_js=163506,B=function r(){_r||br(),_r||(B=r)},o.preInit)for(\"function\"==typeof o.preInit&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();function kr(){}function Sr(r){return(r||kr).__cache__}function Dr(r,e){var t=Sr(e),n=t[r];return n||((n=Object.create((e||kr).prototype)).ptr=r,t[r]=n)}br(),kr.prototype=Object.create(kr.prototype),kr.prototype.constructor=kr,kr.prototype.__class__=kr,kr.__cache__={},o.WrapperObject=kr,o.getCache=Sr,o.wrapPointer=Dr,o.castObject=function(r,e){return Dr(r.ptr,e)},o.NULL=Dr(0),o.destroy=function(r){if(!r.__destroy__)throw\"Error: Cannot destroy object. (Did you create it yourself?)\";r.__destroy__(),delete Sr(r.__class__)[r.ptr]},o.compare=function(r,e){return r.ptr===e.ptr},o.getPointer=function(r){return r.ptr},o.getClass=function(r){return r.__class__};var Ar={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if(Ar.needed){for(var r=0;r<Ar.temps.length;r++)o._free(Ar.temps[r]);Ar.temps.length=0,o._free(Ar.buffer),Ar.buffer=0,Ar.size+=Ar.needed,Ar.needed=0}Ar.buffer||(Ar.size+=128,Ar.buffer=o._malloc(Ar.size),w(Ar.buffer)),Ar.pos=0},alloc:function(r,e){w(Ar.buffer);var t,n=e.BYTES_PER_ELEMENT,i=r.length*n;return i=i+7&-8,Ar.pos+i>=Ar.size?(w(i>0),Ar.needed+=i,t=o._malloc(i),Ar.temps.push(t)):(t=Ar.buffer+Ar.pos,Ar.pos+=i),t},copy:function(r,e,t){switch(t>>>=0,e.BYTES_PER_ELEMENT){case 2:t>>>=1;break;case 4:t>>>=2;break;case 8:t>>>=3}for(var n=0;n<r.length;n++)e[t+n]=r[n]}};function Fr(r){if(\"string\"==typeof r){var e=K(r),t=Ar.alloc(e,_);return Ar.copy(e,_,t),t}return r}function Mr(){throw\"cannot construct a VoidPtr, no constructor in IDL\"}function Pr(r,e){r&&\"object\"==typeof r&&(r=r.ptr),e&&\"object\"==typeof e&&(e=e.ptr),this.ptr=pr(r,e),Sr(Pr)[this.ptr]=this}return Mr.prototype=Object.create(kr.prototype),Mr.prototype.constructor=Mr,Mr.prototype.__class__=Mr,Mr.__cache__={},o.VoidPtr=Mr,Mr.prototype.__destroy__=Mr.prototype.__destroy__=function(){var r=this.ptr;dr(r)},Pr.prototype=Object.create(kr.prototype),Pr.prototype.constructor=Pr,Pr.prototype.__class__=Pr,Pr.__cache__={},o.Graphviz=Pr,Pr.prototype.version=Pr.prototype.version=function(){var r=this.ptr;return F(hr(r))},Pr.prototype.lastError=Pr.prototype.lastError=function(){var r=this.ptr;return F(mr(r))},Pr.prototype.layout=Pr.prototype.layout=function(r,e,t){var n=this.ptr;return Ar.prepare(),r=r&&\"object\"==typeof r?r.ptr:Fr(r),e=e&&\"object\"==typeof e?e.ptr:Fr(e),t=t&&\"object\"==typeof t?t.ptr:Fr(t),F(vr(n,r,e,t))},Pr.prototype.createFile=Pr.prototype.createFile=function(r,e){var t=this.ptr;Ar.prepare(),r=r&&\"object\"==typeof r?r.ptr:Fr(r),e=e&&\"object\"==typeof e?e.ptr:Fr(e),wr(t,r,e)},Pr.prototype.__destroy__=Pr.prototype.__destroy__=function(){var r=this.ptr;yr(r)},e.ready}})(),s=Object.freeze({__proto__:null,default:a});function u(r){return{path:r.path,data:`<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\\n<svg width=\"${r.width}\" height=\"${r.height}\"></svg>`}}const c={layout:(r,e=\"svg\",t=\"dot\",n)=>r?i(s,\"graphvizlib\",null==n?void 0:n.wasmFolder,null==n?void 0:n.wasmBinary).then((o=>{const i=new o.Graphviz((null==n?void 0:n.yInvert)?1:0,(null==n?void 0:n.nop)?null==n?void 0:n.nop:0);!function(r,e){const t={images:[],files:[],...e};var n;[...t.files,...(n=t.images,n.map(u))].forEach((e=>r.createFile(e.path,e.data)))}(i,n);const a=i.layout(r,e,t);if(o.destroy(i),!a)throw new Error(o.Graphviz.prototype.lastError());return a})):Promise.resolve(\"\"),circo(r,e=\"svg\",t){return this.layout(r,e,\"circo\",t)},dot(r,e=\"svg\",t){return this.layout(r,e,\"dot\",t)},fdp(r,e=\"svg\",t){return this.layout(r,e,\"fdp\",t)},sfdp(r,e=\"svg\",t){return this.layout(r,e,\"sfdp\",t)},neato(r,e=\"svg\",t){return this.layout(r,e,\"neato\",t)},osage(r,e=\"svg\",t){return this.layout(r,e,\"osage\",t)},patchwork(r,e=\"svg\",t){return this.layout(r,e,\"patchwork\",t)},twopi(r,e=\"svg\",t){return this.layout(r,e,\"twopi\",t)}};var l=\"undefined\"!=typeof globalThis?globalThis:\"undefined\"!=typeof window?window:\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:{};var f={exports:{}};\n/*!\n * @overview es6-promise - a tiny implementation of Promises/A+.\n * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)\n * @license Licensed under MIT license\n * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE\n * @version v4.2.8+1e68dce6\n */function d(r){return void 0!==r.children}f.exports=function(){function r(r){var e=typeof r;return null!==r&&(\"object\"===e||\"function\"===e)}function e(r){return\"function\"==typeof r}var t=Array.isArray?Array.isArray:function(r){return\"[object Array]\"===Object.prototype.toString.call(r)},n=0,o=void 0,i=void 0,a=function(r,e){g[n]=r,g[n+1]=e,2===(n+=2)&&(i?i(E):k())};function s(r){i=r}function u(r){a=r}var c=\"undefined\"!=typeof window?window:void 0,f=c||{},d=f.MutationObserver||f.WebKitMutationObserver,p=\"undefined\"==typeof self&&\"undefined\"!=typeof process&&\"[object process]\"==={}.toString.call(process),h=\"undefined\"!=typeof Uint8ClampedArray&&\"undefined\"!=typeof importScripts&&\"undefined\"!=typeof MessageChannel;function m(){return function(){return process.nextTick(E)}}function v(){return void 0!==o?function(){o(E)}:_()}function w(){var r=0,e=new d(E),t=document.createTextNode(\"\");return e.observe(t,{characterData:!0}),function(){t.data=r=++r%2}}function y(){var r=new MessageChannel;return r.port1.onmessage=E,function(){return r.port2.postMessage(0)}}function _(){var r=setTimeout;return function(){return r(E,1)}}var g=new Array(1e3);function E(){for(var r=0;r<n;r+=2)(0,g[r])(g[r+1]),g[r]=void 0,g[r+1]=void 0;n=0}function b(){try{var r=Function(\"return this\")().require(\"vertx\");return o=r.runOnLoop||r.runOnContext,v()}catch(r){return _()}}var k=void 0;function S(r,e){var t=this,n=new this.constructor(F);void 0===n[A]&&X(n);var o=t._state;if(o){var i=arguments[o-1];a((function(){return H(o,n,i,t._result)}))}else G(t,n,r,e);return n}function D(r){var e=this;if(r&&\"object\"==typeof r&&r.constructor===e)return r;var t=new e(F);return O(t,r),t}k=p?m():d?w():h?y():void 0===c?b():_();var A=Math.random().toString(36).substring(2);function F(){}var M=void 0,P=1,x=2;function j(){return new TypeError(\"You cannot resolve a promise with itself\")}function z(){return new TypeError(\"A promises callback cannot return that same promise.\")}function T(r,e,t,n){try{r.call(e,t,n)}catch(r){return r}}function R(r,e,t){a((function(r){var n=!1,o=T(t,e,(function(t){n||(n=!0,e!==t?O(r,t):L(r,t))}),(function(e){n||(n=!0,I(r,e))}),\"Settle: \"+(r._label||\" unknown promise\"));!n&&o&&(n=!0,I(r,o))}),r)}function B(r,e){e._state===P?L(r,e._result):e._state===x?I(r,e._result):G(e,void 0,(function(e){return O(r,e)}),(function(e){return I(r,e)}))}function N(r,t,n){t.constructor===r.constructor&&n===S&&t.constructor.resolve===D?B(r,t):void 0===n?L(r,t):e(n)?R(r,t,n):L(r,t)}function O(e,t){if(e===t)I(e,j());else if(r(t)){var n=void 0;try{n=t.then}catch(r){return void I(e,r)}N(e,t,n)}else L(e,t)}function C(r){r._onerror&&r._onerror(r._result),U(r)}function L(r,e){r._state===M&&(r._result=e,r._state=P,0!==r._subscribers.length&&a(U,r))}function I(r,e){r._state===M&&(r._state=x,r._result=e,a(C,r))}function G(r,e,t,n){var o=r._subscribers,i=o.length;r._onerror=null,o[i]=e,o[i+P]=t,o[i+x]=n,0===i&&r._state&&a(U,r)}function U(r){var e=r._subscribers,t=r._state;if(0!==e.length){for(var n=void 0,o=void 0,i=r._result,a=0;a<e.length;a+=3)n=e[a],o=e[a+t],n?H(t,n,o,i):o(i);r._subscribers.length=0}}function H(r,t,n,o){var i=e(n),a=void 0,s=void 0,u=!0;if(i){try{a=n(o)}catch(r){u=!1,s=r}if(t===a)return void I(t,z())}else a=o;t._state!==M||(i&&u?O(t,a):!1===u?I(t,s):r===P?L(t,a):r===x&&I(t,a))}function q(r,e){try{e((function(e){O(r,e)}),(function(e){I(r,e)}))}catch(e){I(r,e)}}var V=0;function W(){return V++}function X(r){r[A]=V++,r._state=void 0,r._result=void 0,r._subscribers=[]}function Y(){return new Error(\"Array Methods must be provided an Array\")}var $=function(){function r(r,e){this._instanceConstructor=r,this.promise=new r(F),this.promise[A]||X(this.promise),t(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?L(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&L(this.promise,this._result))):I(this.promise,Y())}return r.prototype._enumerate=function(r){for(var e=0;this._state===M&&e<r.length;e++)this._eachEntry(r[e],e)},r.prototype._eachEntry=function(r,e){var t=this._instanceConstructor,n=t.resolve;if(n===D){var o=void 0,i=void 0,a=!1;try{o=r.then}catch(r){a=!0,i=r}if(o===S&&r._state!==M)this._settledAt(r._state,e,r._result);else if(\"function\"!=typeof o)this._remaining--,this._result[e]=r;else if(t===er){var s=new t(F);a?I(s,i):N(s,r,o),this._willSettleAt(s,e)}else this._willSettleAt(new t((function(e){return e(r)})),e)}else this._willSettleAt(n(r),e)},r.prototype._settledAt=function(r,e,t){var n=this.promise;n._state===M&&(this._remaining--,r===x?I(n,t):this._result[e]=t),0===this._remaining&&L(n,this._result)},r.prototype._willSettleAt=function(r,e){var t=this;G(r,void 0,(function(r){return t._settledAt(P,e,r)}),(function(r){return t._settledAt(x,e,r)}))},r}();function K(r){return new $(this,r).promise}function J(r){var e=this;return t(r)?new e((function(t,n){for(var o=r.length,i=0;i<o;i++)e.resolve(r[i]).then(t,n)})):new e((function(r,e){return e(new TypeError(\"You must pass an array to race.\"))}))}function Q(r){var e=new this(F);return I(e,r),e}function Z(){throw new TypeError(\"You must pass a resolver function as the first argument to the promise constructor\")}function rr(){throw new TypeError(\"Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.\")}var er=function(){function r(e){this[A]=W(),this._result=this._state=void 0,this._subscribers=[],F!==e&&(\"function\"!=typeof e&&Z(),this instanceof r?q(this,e):rr())}return r.prototype.catch=function(r){return this.then(null,r)},r.prototype.finally=function(r){var t=this,n=t.constructor;return e(r)?t.then((function(e){return n.resolve(r()).then((function(){return e}))}),(function(e){return n.resolve(r()).then((function(){throw e}))})):t.then(r,r)},r}();function tr(){var r=void 0;if(void 0!==l)r=l;else if(\"undefined\"!=typeof self)r=self;else try{r=Function(\"return this\")()}catch(r){throw new Error(\"polyfill failed because global object is unavailable in this environment\")}var e=r.Promise;if(e){var t=null;try{t=Object.prototype.toString.call(e.resolve())}catch(r){}if(\"[object Promise]\"===t&&!e.cast)return}r.Promise=er}return er.prototype.then=S,er.all=K,er.race=J,er.resolve=D,er.reject=Q,er._setScheduler=s,er._setAsap=u,er._asap=a,er.polyfill=tr,er.Promise=er,er}(),f.exports.polyfill();var p=function(r){var e=[];return r.children.forEach((function(r){d(r)?e.push(p(r)):e.push(h(r))})),\"subgraph cluster_\".concat(r.id,' {\\nid=\"').concat(r.id,'\";\\nlabel=\"').concat(r.text,'\";\\nmargin=16;\\n').concat(e.join(\"\\n\"),\"\\n}\")},h=function(r){return\"\".concat(r.id,' [id=\"').concat(r.id,'\" label=\"').concat(r.text,'\" width=').concat(w(r.width),\" height=\").concat(w(r.height),\"]\")},m=function(r){return 96*r/72},v=function(r){return 96*r},w=function(r){return r/96};function y(r){var e=r?r.split(\",\").map((function(r){return m(+r)})):[0,0,0,0],t=e[0],n=e[1],o=e[2]-t,i=e[3]-n;return{x:t-o/2,y:n-i/2,width:o,height:i}}function _(r,e){var t=r.split(\",\").map((function(r){return m(+r)})),n=t[0],o=t[1];return{x:-n+e.width,y:-o+e.height}}function g(r,e,t,n){return c[r]&&c[r](e,t,{wasmFolder:n.wasmFolder}).then((function(r){return\"json\"===t?JSON.parse(r):r}))}function E(e,t){if(e.raw)return g(t.engine,e.raw,\"svg\",t);var n={},o=[],i=[],a={},s=[],u=[],c={},l=[],f=[];function m(r,e){d(r)?(n[r.id]=r,o.push(r),r.children.forEach((function(r){return m(r,!1)})),e&&i.push(p(r))):(a[r.id]=r,s.push(r),e&&u.push(h(r)))}return e.items.forEach((function(r){return m(r,!0)})),e.links.forEach((function(r){var e,t,n,o;c[r.id]=r,l.push(r),f.push((e=r.source.id,t=r.target.id,n=r.id,o=r.text,\"\".concat(e,\" -> \").concat(t,' [id=\"').concat(n,'\", label=\"').concat(o,'\"]')))})),g(t.engine,\"digraph G {\\n graph [fontname=Verdana,fontsize=11.0];\\n graph [rankdir=TB];\\n node [shape=rect,fontname=Verdana,fontsize=11.0,fixedsize=true];\\n edge [fontname=Verdana,fontsize=11.0];\\n\\n\".concat(i.join(\"\\n\"),\"\\n\\n\").concat(f.join(\"\\n\"),\"\\n\\n\").concat(u.join(\"\\n\"),\"\\n}\"),\"json\",t).then((function(e){var t=y(e.bb);return e.objects&&e.objects.forEach((function(r){if(r.nodes){var e=function(r,e){var t=y(r);return{x:-t.x+e.width,y:-t.y+e.height,width:t.width,height:t.height}}(r.bb,t),o=n[r.id];o.x=e.x-t.width/2,o.y=e.y-t.height/2,o.width=e.width,o.height=e.height}else{var i=(u=r.pos,c=r.width,l=r.height,f=_(u,t),d=v(+c),p=v(+l),{x:f.x,y:f.y,width:d,height:p}),s=a[r.id];s&&(s.x=i.x-t.width/2,s.y=i.y-t.height/2)}var u,c,l,f,d,p})),e.edges&&e.edges.forEach((function(e){var n=c[e.id];n&&(n.points=function(e,t){if(e.pos){var n=e.pos.substr(2).split(\" \").map((function(r){return _(r,t)})).map((function(r){return[r.x-t.width/2,r.y-t.height/2]})),o=n.shift();return r(r([],n,!0),[o],!1)}return[]}(e,t))})),{clusters:o,nodes:s,links:l}}))}self.onmessage=function(r){E.apply(void 0,r.data).then((function(r){self.postMessage(r)}))}}();";
15763
16544
  var workerBlob = new Blob([workerCode], { type: "application/javascript" });
15764
16545
  var workerUrl = URL.createObjectURL(workerBlob);
15765
16546
  var worker = new Worker(workerUrl);
@@ -15820,7 +16601,7 @@
15820
16601
  return graphviz$1({
15821
16602
  items: hierarchy,
15822
16603
  links: data.allEdges().map(function (e) { return ({
15823
- id: e.props.id,
16604
+ id: String(e.props.id),
15824
16605
  source: nodeIdx[e.source.id],
15825
16606
  target: nodeIdx[e.target.id],
15826
16607
  text: e.props.label || ""
@@ -16616,7 +17397,7 @@
16616
17397
  if (centroid === undefined) {
16617
17398
  centroid = v;
16618
17399
  }
16619
- if (v.centroid) {
17400
+ if (v.props.centroid) {
16620
17401
  centroid = v;
16621
17402
  break;
16622
17403
  }
@@ -16768,25 +17549,27 @@
16768
17549
  var css_248z$1 = ".graph_Graph2 .allowDragging .graphVertex,.graph_Graph2 .graphVertex{cursor:pointer}.graph_Graph2 .allowDragging .graphVertex.grabbed{cursor:grabbing}.graph_Graph2 .graphEdge{stroke:#a9a9a9;fill:none}.graph_Graph2 .graphEdge>text{stroke:none;fill:#000}.graph_Graph2 .graphEdge.hide-text>text{display:none}.graph_Graph2 g.selected circle,.graph_Graph2 g.selected rect{stroke:red!important}";
16769
17550
  styleInject(css_248z$1);
16770
17551
 
16771
- var wasmFolder = "".concat(util$b.getScriptSrc("/graph/lib-umd/graph2/graph") || util$b.getScriptSrc("/graph/dist/index") || ".", "/graph/dist");
17552
+ var _a, _b, _c;
17553
+ var scriptDir = (_c = (_b = (_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) === null || _a === void 0 ? void 0 : _a.currentScript) === null || _b === void 0 ? void 0 : _b.src) !== null && _c !== void 0 ? _c : "./dummy.js";
17554
+ scriptDir = scriptDir.substring(0, scriptDir.replace(/[?#].*/, "").lastIndexOf("/") + 1);
16772
17555
  var GraphLayoutTypeSet = ["Hierarchy", "DOT", "Tree", "Dendrogram", "RadialTree", "RadialDendrogram", "ForceDirected", "ForceDirected2", "ForceDirectedHybrid", "Neato", "FDP", "Circle", "TwoPI", "Circo", "None"];
16773
- var dragStart = function (n) {
17556
+ function dragStart(n) {
16774
17557
  n.fx = n.sx = n.x;
16775
17558
  n.fy = n.sy = n.y;
16776
- };
16777
- var dragTick = function (n, d) {
17559
+ }
17560
+ function dragTick(n, d) {
16778
17561
  n.fx = n.sx + d.fx - d.sx;
16779
17562
  n.fy = n.sy + d.fy - d.sy;
16780
- };
16781
- var dragEnd = function (n) {
17563
+ }
17564
+ function dragEnd(n) {
16782
17565
  n.x = n.fx;
16783
17566
  n.y = n.fy;
16784
17567
  n.fx = n.sx = undefined;
16785
17568
  n.fy = n.sy = undefined;
16786
- };
16787
- var Graph2 = /** @class */ (function (_super) {
16788
- __extends(Graph2, _super);
16789
- function Graph2() {
17569
+ }
17570
+ var GraphT = /** @class */ (function (_super) {
17571
+ __extends(GraphT, _super);
17572
+ function GraphT(subgraphRenderer, vertexRenderer, edgeRenderer) {
16790
17573
  var _this = _super.call(this) || this;
16791
17574
  _this._toggleHierarchy = new common.ToggleButton().faChar("fa-sitemap").tooltip("Hierarchy").on("click", function () { return _this.layoutClick("Hierarchy"); });
16792
17575
  _this._toggleForceDirected = new common.ToggleButton().faChar("fa-expand").tooltip("Force Directed").on("click", function () { return _this.layoutClick("ForceDirected"); });
@@ -16828,9 +17611,10 @@
16828
17611
  opacity: 0.33,
16829
17612
  edge: "1.25px"
16830
17613
  };
16831
- _this._centroidRenderer = react.Vertex;
16832
- _this._vertexRenderer = react.Vertex;
16833
17614
  _this._transformScale = 1;
17615
+ _this._subgraphRenderer = subgraphRenderer;
17616
+ _this._vertexRenderer = vertexRenderer;
17617
+ _this._edgeRenderer = edgeRenderer;
16834
17618
  var context = _this;
16835
17619
  _this._drawStartPos = "origin";
16836
17620
  var buttons = [
@@ -16923,7 +17707,7 @@
16923
17707
  }
16924
17708
  if (doClick) {
16925
17709
  context._selection.click({
16926
- _id: d.id,
17710
+ _id: String(d.id),
16927
17711
  element: function () { return d.element; }
16928
17712
  }, common.d3Event().sourceEvent);
16929
17713
  context.selectionChanged();
@@ -16938,10 +17722,9 @@
16938
17722
  }
16939
17723
  })
16940
17724
  .filter(function () { return true; });
16941
- _this.zoomToFitLimit(1);
16942
17725
  return _this;
16943
17726
  }
16944
- Graph2.prototype.resolveEventOrigin = function () {
17727
+ GraphT.prototype.resolveEventOrigin = function () {
16945
17728
  var _a, _b;
16946
17729
  var d3evt = common.d3Event();
16947
17730
  var eventPath = (_b = (_a = d3evt === null || d3evt === void 0 ? void 0 : d3evt.sourceEvent) === null || _a === void 0 ? void 0 : _a.path) !== null && _b !== void 0 ? _b : d3evt === null || d3evt === void 0 ? void 0 : d3evt.path;
@@ -16962,22 +17745,22 @@
16962
17745
  data: data
16963
17746
  };
16964
17747
  };
16965
- Graph2.prototype.iconBarButtons = function () {
17748
+ GraphT.prototype.iconBarButtons = function () {
16966
17749
  return this._iconBar.buttons();
16967
17750
  };
16968
- Graph2.prototype.categories = function (_) {
17751
+ GraphT.prototype.categories = function (_) {
16969
17752
  if (_ === void 0)
16970
17753
  return this._categories;
16971
17754
  this._categories = _;
16972
17755
  return this;
16973
17756
  };
16974
- Graph2.prototype.annotations = function (_) {
17757
+ GraphT.prototype.annotations = function (_) {
16975
17758
  if (_ === void 0)
16976
17759
  return this._annotations;
16977
17760
  this._annotations = _;
16978
17761
  return this;
16979
17762
  };
16980
- Graph2.prototype.data = function (_, merge) {
17763
+ GraphT.prototype.data = function (_, merge) {
16981
17764
  var _this = this;
16982
17765
  if (_ === void 0)
16983
17766
  return this._origData;
@@ -17012,33 +17795,33 @@
17012
17795
  });
17013
17796
  return this;
17014
17797
  };
17015
- Graph2.prototype.selected = function (vertex, _) {
17798
+ GraphT.prototype.selected = function (vertex, _) {
17016
17799
  return (_ || this.selection()).some(function (n) { return n.id === vertex.id; });
17017
17800
  };
17018
- Graph2.prototype.selection = function (_) {
17801
+ GraphT.prototype.selection = function (_) {
17019
17802
  var _this = this;
17020
17803
  if (!arguments.length)
17021
17804
  return this._selection.get().map(function (item) { return _this._graphData.item(item._id).props; });
17022
17805
  this._selection.set(_.map(function (item) {
17023
17806
  var vp = _this._graphData.item(item.id);
17024
17807
  return {
17025
- _id: vp.id,
17808
+ _id: String(vp.id),
17026
17809
  element: function () { return vp.element; }
17027
17810
  };
17028
17811
  }));
17029
17812
  return this;
17030
17813
  };
17031
- Graph2.prototype.graphData = function () {
17814
+ GraphT.prototype.graphData = function () {
17032
17815
  return this._graphData;
17033
17816
  };
17034
- Graph2.prototype.resetLayout = function () {
17817
+ GraphT.prototype.resetLayout = function () {
17035
17818
  delete this._prevLayout;
17036
17819
  return this;
17037
17820
  };
17038
- Graph2.prototype.layoutRunning = function () {
17821
+ GraphT.prototype.layoutRunning = function () {
17039
17822
  return this._layoutAlgo && this._layoutAlgo.running();
17040
17823
  };
17041
- Graph2.prototype.layoutAlgo = function (layout) {
17824
+ GraphT.prototype.layoutAlgo = function (layout) {
17042
17825
  var _this = this;
17043
17826
  if (this._layoutAlgo) {
17044
17827
  this._layoutAlgo.stop();
@@ -17049,12 +17832,12 @@
17049
17832
  if (_this.applyScaleOnLayout()) {
17050
17833
  // Wait for any transitions to finish ---
17051
17834
  setTimeout(function () {
17052
- _this.zoomToFit();
17835
+ _this.zoomToFit(_this.transitionDuration());
17053
17836
  }, _this.transitionDuration());
17054
17837
  }
17055
17838
  });
17056
17839
  };
17057
- Graph2.prototype.layoutClick = function (layout) {
17840
+ GraphT.prototype.layoutClick = function (layout) {
17058
17841
  if (this.layoutRunning()) {
17059
17842
  this._layoutAlgo.stop();
17060
17843
  this.updateIconBar();
@@ -17066,12 +17849,12 @@
17066
17849
  .render();
17067
17850
  }
17068
17851
  };
17069
- Graph2.prototype.updateIconBarItem = function (tb, tbLayout) {
17852
+ GraphT.prototype.updateIconBarItem = function (tb, tbLayout) {
17070
17853
  var layout = this.layout();
17071
17854
  var running = this._layoutAlgo && this._layoutAlgo.running();
17072
17855
  tb.enabled(!running || layout === tbLayout).selected(running && layout === tbLayout).render();
17073
17856
  };
17074
- Graph2.prototype.updateIconBar = function () {
17857
+ GraphT.prototype.updateIconBar = function () {
17075
17858
  _super.prototype.updateIconBar.call(this);
17076
17859
  this.updateIconBarItem(this._toggleHierarchy, "Hierarchy");
17077
17860
  this.updateIconBarItem(this._toggleDot, "DOT");
@@ -17087,7 +17870,7 @@
17087
17870
  this.updateIconBarItem(this._toggleD, "Dendrogram");
17088
17871
  this.updateIconBarItem(this._toggleRD, "RadialDendrogram");
17089
17872
  };
17090
- Graph2.prototype.getNeighborMap = function (vertex) {
17873
+ GraphT.prototype.getNeighborMap = function (vertex) {
17091
17874
  var vertices = {};
17092
17875
  var edges = {};
17093
17876
  if (vertex) {
@@ -17108,7 +17891,7 @@
17108
17891
  edges: edges
17109
17892
  };
17110
17893
  };
17111
- Graph2.prototype.centerOnItem = function (id) {
17894
+ GraphT.prototype.centerOnItem = function (id) {
17112
17895
  var _a;
17113
17896
  var item = this._graphData.item(id);
17114
17897
  var x;
@@ -17142,21 +17925,21 @@
17142
17925
  this.centerOnBBox(itemBBox);
17143
17926
  }
17144
17927
  };
17145
- Graph2.prototype.hideVertex = function (id) {
17928
+ GraphT.prototype.hideVertex = function (id) {
17146
17929
  var item = this._graphData.item(id);
17147
17930
  if (this._graphData.isVertex(item)) {
17148
17931
  item.props.hidden = true;
17149
17932
  }
17150
17933
  return this;
17151
17934
  };
17152
- Graph2.prototype.showVertex = function (id) {
17935
+ GraphT.prototype.showVertex = function (id) {
17153
17936
  var item = this._graphData.item(id);
17154
17937
  if (this._graphData.isVertex(item)) {
17155
17938
  item.props.hidden = false;
17156
17939
  }
17157
17940
  return this;
17158
17941
  };
17159
- Graph2.prototype.highlightVerticies = function (vertexMap) {
17942
+ GraphT.prototype.highlightVerticies = function (vertexMap) {
17160
17943
  var _this = this;
17161
17944
  var context = this;
17162
17945
  var vertexElements = this._vertexG.selectAll(".graphVertex");
@@ -17166,8 +17949,8 @@
17166
17949
  .style("filter", function (d) { return vertexMap && vertexMap[d.id] ? "url(#" + _this.id() + "_glow)" : null; })
17167
17950
  .each(function (d) {
17168
17951
  if (forceLabelOnHighlight) {
17169
- var props = context.calcProps(d.centroid, __assign({ showLabel: !!(vertexMap && vertexMap[d.id]) }, context.vertexMapper(d.props, d.props.origData)));
17170
- react.render(d.centroid ? context._centroidRenderer : context._vertexRenderer, props, this);
17952
+ var props = context.calcProps(__assign({ showLabel: !!(vertexMap && vertexMap[d.id]) }, context.vertexMapper(d.props, d.props.origData)));
17953
+ context._vertexRenderer(props, this);
17171
17954
  }
17172
17955
  })
17173
17956
  .transition().duration(this.transitionDuration())
@@ -17188,7 +17971,7 @@
17188
17971
  });
17189
17972
  return this;
17190
17973
  };
17191
- Graph2.prototype.highlightEdges = function (edgeMap) {
17974
+ GraphT.prototype.highlightEdges = function (edgeMap) {
17192
17975
  var context = this;
17193
17976
  var edgeElements = this._edgeG.selectAll(".graphEdge");
17194
17977
  edgeElements
@@ -17209,7 +17992,7 @@
17209
17992
  });
17210
17993
  return this;
17211
17994
  };
17212
- Graph2.prototype.highlightVertex = function (_element, d) {
17995
+ GraphT.prototype.highlightVertex = function (_element, d) {
17213
17996
  if (this.highlightOnMouseOverVertex()) {
17214
17997
  if (d) {
17215
17998
  var highlight = this.getNeighborMap(d);
@@ -17218,12 +18001,12 @@
17218
18001
  this.highlightEdges(highlight.edges);
17219
18002
  }
17220
18003
  else {
17221
- this.highlightVerticies(null);
17222
- this.highlightEdges(null);
18004
+ this.highlightVerticies();
18005
+ this.highlightEdges();
17223
18006
  }
17224
18007
  }
17225
18008
  };
17226
- Graph2.prototype.highlightEdge = function (_element, d) {
18009
+ GraphT.prototype.highlightEdge = function (_element, d) {
17227
18010
  if (this.highlightOnMouseOverEdge()) {
17228
18011
  if (d) {
17229
18012
  var vertices = {};
@@ -17235,78 +18018,77 @@
17235
18018
  this.highlightEdges(edges);
17236
18019
  }
17237
18020
  else {
17238
- this.highlightVerticies(null);
17239
- this.highlightEdges(null);
18021
+ this.highlightVerticies();
18022
+ this.highlightEdges();
17240
18023
  }
17241
18024
  }
17242
18025
  };
17243
- Graph2.prototype.moveSubgraphPlaceholder = function (sp, transition) {
18026
+ GraphT.prototype.moveSubgraphPlaceholder = function (sp, transition) {
18027
+ var context = this;
17244
18028
  var x = this.project(sp.x);
17245
18029
  var y = this.project(sp.y);
17246
18030
  var width = this.project(sp.props.width, true);
17247
18031
  var height = this.project(sp.props.height, true);
17248
18032
  if (sp.element) {
17249
- // TODO: any should not be needed (tsc issue?)
17250
- (transition ? sp.element.transition() : sp.element)
18033
+ sp.element.transition().duration(transition ? this.transitionDuration() : 0)
17251
18034
  .attr("transform", "translate(".concat(x, " ").concat(y, ")"))
17252
18035
  .each(function (d) {
17253
- react.render(react.Subgraph, __assign(__assign({}, d.props), { width: width, height: height }), this);
18036
+ context._subgraphRenderer(__assign(__assign({}, d.props), { width: width, height: height }), this);
17254
18037
  });
17255
18038
  }
17256
18039
  return this;
17257
18040
  };
17258
- Graph2.prototype.moveEdgePlaceholder = function (ep, transition) {
17259
- var _a, _b;
17260
- var edgeLayout = this._layoutAlgo.edgePath(ep, this.edgeArcDepth());
17261
- if (ep.elementPath) {
17262
- // TODO: any should not be needed (tsc issue?)
17263
- (transition ? ep.elementPath.transition() : ep.elementPath)
17264
- .attr("d", edgeLayout.path)
17265
- .attr("stroke-dasharray", function (d) { return d.props.strokeDasharray; });
17266
- }
17267
- if (ep.elementText) {
17268
- var lines = (_b = (_a = ep.props.label) === null || _a === void 0 ? void 0 : _a.split("\n")) !== null && _b !== void 0 ? _b : [];
17269
- ep.elementText
17270
- .selectAll(".textLine")
17271
- .data(lines, function (d) { return d; })
17272
- .join(function (enter) { return enter.append("tspan")
17273
- .attr("class", "textLine")
17274
- .attr("x", 0); }, function (update) { return update
17275
- .attr("dy", function (d, i) { return "".concat(i, "em"); })
17276
- .text(function (d) { return d; }); }, function (exit) { return exit.remove(); });
17277
- // TODO: any should not be needed (tsc issue?)
17278
- (transition ? ep.elementText.transition() : ep.elementText)
17279
- .attr("transform", "translate(".concat(edgeLayout.labelPos[0], " ").concat(edgeLayout.labelPos[1], ")"))
17280
- .attr("font-family", function (d) { return d.props.fontFamily || null; });
18041
+ GraphT.prototype.moveEdgePlaceholder = function (ep, transition) {
18042
+ var _a;
18043
+ var edgeLayout = __assign({}, this._layoutAlgo.edgePath(ep, this.edgeArcDepth()));
18044
+ var context = this;
18045
+ if (this._edgeRenderer && ep.element) {
18046
+ var previousEdgeLayout = (_a = ep.previousEdgeLayout) !== null && _a !== void 0 ? _a : edgeLayout;
18047
+ ep.previousEdgeLayout = edgeLayout;
18048
+ var pathInterpolator_1 = interpolatePath(previousEdgeLayout.path, edgeLayout.path);
18049
+ var labelPosInterpolator_1 = common.interpolateNumberArray(previousEdgeLayout.labelPos, edgeLayout.labelPos);
18050
+ ep.element.transition().duration(transition ? this.transitionDuration() : 0)
18051
+ .tween("some.path", function () {
18052
+ return function (t) {
18053
+ var _a, _b;
18054
+ var updated = {
18055
+ path: pathInterpolator_1(t),
18056
+ labelPos: labelPosInterpolator_1(t),
18057
+ strokeWidth: (_a = ep.props.strokeWidth) !== null && _a !== void 0 ? _a : context.edgeStrokeWidth(),
18058
+ color: (_b = ep.props.color) !== null && _b !== void 0 ? _b : context.edgeColor()
18059
+ };
18060
+ context._edgeRenderer(__assign(__assign(__assign({}, edgeLayout), ep.props), updated), ep.element.node());
18061
+ };
18062
+ });
17281
18063
  }
17282
18064
  return this;
17283
18065
  };
17284
- Graph2.prototype.moveVertexPlaceholder = function (vp, transition, moveNeighbours) {
18066
+ GraphT.prototype.moveVertexPlaceholder = function (vp, transition, moveNeighbours) {
17285
18067
  var _this = this;
17286
18068
  var _a = this.projectPlacholder(vp), x = _a.x, y = _a.y;
17287
- vp.element && (transition ? vp.element.transition() : vp.element)
18069
+ vp.element && (transition ? vp.element.transition().duration(this.transitionDuration()) : vp.element)
17288
18070
  .attr("transform", "translate(".concat(x, " ").concat(y, ")"));
17289
18071
  if (moveNeighbours) {
17290
18072
  this._graphData.vertexEdges(vp.id).forEach(function (e) { return _this.moveEdgePlaceholder(e, transition); });
17291
18073
  }
17292
18074
  return this;
17293
18075
  };
17294
- Graph2.prototype.moveSubgraphs = function (transition) {
18076
+ GraphT.prototype.moveSubgraphs = function (transition) {
17295
18077
  var _this = this;
17296
18078
  this._graphData.allSubgraphs().forEach(function (s) { return _this.moveSubgraphPlaceholder(s, transition); });
17297
18079
  return this;
17298
18080
  };
17299
- Graph2.prototype.moveEdges = function (transition) {
18081
+ GraphT.prototype.moveEdges = function (transition) {
17300
18082
  var _this = this;
17301
18083
  this._graphData.allEdges().forEach(function (e) { return _this.moveEdgePlaceholder(e, transition); });
17302
18084
  return this;
17303
18085
  };
17304
- Graph2.prototype.moveVertices = function (transition) {
18086
+ GraphT.prototype.moveVertices = function (transition) {
17305
18087
  var _this = this;
17306
18088
  this._graphData.allVertices().forEach(function (v) { return _this.moveVertexPlaceholder(v, transition, false); });
17307
18089
  return this;
17308
18090
  };
17309
- Graph2.prototype.project = function (pos, clip) {
18091
+ GraphT.prototype.project = function (pos, clip) {
17310
18092
  if (clip === void 0) { clip = false; }
17311
18093
  var rf = 10;
17312
18094
  pos = pos !== undefined ? pos : 0;
@@ -17319,35 +18101,40 @@
17319
18101
  }
17320
18102
  return Math.round(pos * scale * rf) / rf;
17321
18103
  };
17322
- Graph2.prototype.rproject = function (pos) {
18104
+ GraphT.prototype.rproject = function (pos) {
17323
18105
  var rf = 10;
17324
18106
  pos = pos !== undefined ? pos : 0;
17325
18107
  return Math.round(pos / this._transformScale * rf) / rf;
17326
18108
  };
17327
- Graph2.prototype.projectPlacholder = function (vp) {
18109
+ GraphT.prototype.projectPlacholder = function (vp) {
17328
18110
  return {
17329
18111
  x: this.project(vp.fx !== undefined ? vp.fx : vp.x),
17330
18112
  y: this.project(vp.fy !== undefined ? vp.fy : vp.y)
17331
18113
  };
17332
18114
  };
17333
- Graph2.prototype.categoryID = function (id, prefix) {
18115
+ GraphT.prototype.categoryID = function (id, prefix) {
17334
18116
  if (prefix === void 0) { prefix = "cat"; }
17335
18117
  return id === undefined || id === "" ? "" : "".concat(prefix).concat(this.id(), "_").concat(id);
17336
18118
  };
17337
- Graph2.prototype.updateCategories = function () {
18119
+ GraphT.prototype.updateCategories = function () {
17338
18120
  var _this = this;
17339
18121
  react.render(react.Icons, {
17340
18122
  icons: this._categories.map(function (c) { return (__assign(__assign({}, c), { id: _this.categoryID(c.id), fill: c.fill || "transparent", imageCharFill: c.imageCharFill || _this._catPalette(c.id) })); })
17341
18123
  }, this._svgDefsCat.node());
17342
18124
  };
17343
- Graph2.prototype.updateAnnotations = function () {
18125
+ GraphT.prototype.updateAnnotations = function () {
17344
18126
  var _this = this;
17345
18127
  react.render(react.Icons, {
17346
18128
  icons: this._annotations.map(function (c) { return (__assign(__assign({}, c), { id: _this.categoryID(c.id, "ann"), shape: c.shape || "square", height: c.height || 12, fill: c.fill || _this._catPalette(c.id) })); })
17347
18129
  }, this._svgDefsAnn.node());
17348
18130
  };
17349
- Graph2.prototype.updateEdges = function () {
17350
- var _this = this;
18131
+ GraphT.prototype.edgeRenderer = function (_) {
18132
+ if (!arguments.length)
18133
+ return this._edgeRenderer;
18134
+ this._edgeRenderer = _;
18135
+ return this;
18136
+ };
18137
+ GraphT.prototype.updateEdges = function () {
17351
18138
  var context = this;
17352
18139
  this._edgeG.selectAll(".graphEdge")
17353
18140
  .data(this._graphData.allEdges(), function (d) { return d.id; })
@@ -17355,7 +18142,7 @@
17355
18142
  .attr("class", "graphEdge")
17356
18143
  .on("click.selectionBag", function (d) {
17357
18144
  context._selection.click({
17358
- _id: d.id,
18145
+ _id: String(d.id),
17359
18146
  element: function () { return d.element; }
17360
18147
  }, common.d3Event());
17361
18148
  context.selectionChanged();
@@ -17373,40 +18160,31 @@
17373
18160
  })
17374
18161
  .each(function (d) {
17375
18162
  d.element = common.select(this);
17376
- d.elementPath = d.element.append("path");
17377
- d.elementText = d.element.append("text")
17378
- .attr("text-anchor", "middle");
18163
+ if (!context._edgeRenderer) {
18164
+ d.elementPath = d.element.append("path");
18165
+ d.elementText = d.element.append("text")
18166
+ .attr("text-anchor", "middle");
18167
+ }
17379
18168
  }); }, function (update) { return update
17380
18169
  .attr("opacity", function (d) { return d.source.props.hidden || d.target.props.hidden ? 0 : 1; })
17381
18170
  .classed("hide-text", !context.showEdgeLabels()); }, function (exit) { return exit
17382
18171
  .each(function (d) {
17383
18172
  delete d.element;
17384
18173
  })
17385
- .remove(); })
17386
- .style("stroke", function (d) {
17387
- var _a, _b;
17388
- return (_b = (_a = d.props) === null || _a === void 0 ? void 0 : _a.color) !== null && _b !== void 0 ? _b : _this.edgeColor();
17389
- })
17390
- .style("stroke-width", this.edgeStrokeWidth() + "px");
18174
+ .remove(); });
17391
18175
  return this;
17392
18176
  };
17393
- Graph2.prototype.centroidRenderer = function (_) {
17394
- if (!arguments.length)
17395
- return this._centroidRenderer;
17396
- this._centroidRenderer = _;
17397
- return this;
17398
- };
17399
- Graph2.prototype.vertexRenderer = function (_) {
18177
+ GraphT.prototype.vertexRenderer = function (_) {
17400
18178
  if (!arguments.length)
17401
18179
  return this._vertexRenderer;
17402
18180
  this._vertexRenderer = _;
17403
18181
  return this;
17404
18182
  };
17405
- Graph2.prototype.vertexMapper = function (props, origRow) {
18183
+ GraphT.prototype.vertexMapper = function (props, origRow) {
17406
18184
  var _this = this;
17407
18185
  return __assign(__assign({}, props), { categoryID: this.categoryID(props.categoryID), annotationIDs: props.annotationIDs ? props.annotationIDs.map(function (a) { return _this.categoryID(a, "ann"); }) : [] });
17408
18186
  };
17409
- Graph2.prototype.updateVertices = function () {
18187
+ GraphT.prototype.updateVertices = function () {
17410
18188
  var _this = this;
17411
18189
  var context = this;
17412
18190
  this._vertexG.selectAll(".graphVertex")
@@ -17460,44 +18238,19 @@
17460
18238
  delete d.element;
17461
18239
  })
17462
18240
  .remove(); })
17463
- .classed("centroid", function (d) { return d.centroid; })
18241
+ .classed("centroid", function (d) { return d.props.centroid; })
17464
18242
  .attr("opacity", function (d) { return d.props.hidden ? 0 : 1; })
17465
- .attr("filter", function (d) { return d.centroid ? "url(#" + _this.id() + "_glow)" : null; })
18243
+ .attr("filter", function (d) { return d.props.centroid ? "url(#" + _this.id() + "_glow)" : null; })
17466
18244
  .each(function (d) {
17467
- var props = context.calcProps(d.centroid, __assign({ showLabel: context.showVertexLabels() }, context.vertexMapper(d.props, d.props.origData)));
17468
- react.render(d.centroid ? context._centroidRenderer : context._vertexRenderer, props, this);
18245
+ var props = context.calcProps(__assign({ showLabel: context.showVertexLabels() }, context.vertexMapper(d.props, d.props.origData)));
18246
+ context._vertexRenderer(props, this);
17469
18247
  });
17470
18248
  return this;
17471
18249
  };
17472
- Graph2.prototype.calcProps = function (isCentroid, props) {
17473
- if (!props.icon)
17474
- props.icon = {};
17475
- if (isCentroid) {
17476
- props.textHeight = props.textHeight ? props.textHeight : this.centroidTextHeight() * this.centroidScale();
17477
- props.textPadding = props.textPadding ? props.textPadding : this.centroidTextPadding() * this.centroidScale();
17478
- props.textFontFamily = props.textFontFamily ? props.textFontFamily : this.centroidLabelFontFamily();
17479
- props.icon.height = props.icon.height ? props.icon.height : this.centroidIconHeight() * this.centroidScale();
17480
- props.icon.padding = props.icon.padding ? props.icon.padding : this.centroidIconPadding() * this.centroidScale();
17481
- props.icon.strokeWidth = props.icon.strokeWidth ? props.icon.strokeWidth : this.centroidIconStrokeWidth();
17482
- props.icon.imageFontFamily = props.icon.imageFontFamily ? props.icon.imageFontFamily : this.centroidIconFontFamily();
17483
- }
17484
- else {
17485
- props.textHeight = props.textHeight ? props.textHeight : this.vertexTextHeight();
17486
- props.textPadding = props.textPadding ? props.textPadding : this.vertexTextPadding();
17487
- props.textFontFamily = props.textFontFamily ? props.textFontFamily : this.vertexLabelFontFamily();
17488
- props.icon.height = props.icon.height ? props.icon.height : this.vertexIconHeight();
17489
- props.icon.padding = props.icon.padding ? props.icon.padding : this.vertexIconPadding();
17490
- props.icon.strokeWidth = props.icon.strokeWidth ? props.icon.strokeWidth : this.vertexIconStrokeWidth();
17491
- props.icon.imageFontFamily = props.icon.imageFontFamily ? props.icon.imageFontFamily : this.vertexIconFontFamily();
17492
- }
17493
- var text = props.icon.imageChar;
17494
- var fontFamily = props.icon.imageFontFamily;
17495
- var fontSize = props.icon.height - props.icon.padding;
17496
- var rect = this.textRect(text, fontFamily, fontSize);
17497
- props.icon.yOffset = -(rect.top - (fontSize / 2)) - (rect.height / 2) + (props.icon.padding > 0 ? fontSize / props.icon.padding / 2 : 0);
17498
- return props;
18250
+ GraphT.prototype.calcProps = function (props) {
18251
+ return __assign({}, props);
17499
18252
  };
17500
- Graph2.prototype.hasSubgraphs = function () {
18253
+ GraphT.prototype.hasSubgraphs = function () {
17501
18254
  switch (this.layout()) {
17502
18255
  case "DOT":
17503
18256
  case "Hierarchy":
@@ -17505,7 +18258,13 @@
17505
18258
  }
17506
18259
  return false;
17507
18260
  };
17508
- Graph2.prototype.updateSubgraphs = function () {
18261
+ GraphT.prototype.subgraphRenderer = function (_) {
18262
+ if (!arguments.length)
18263
+ return this._subgraphRenderer;
18264
+ this._subgraphRenderer = _;
18265
+ return this;
18266
+ };
18267
+ GraphT.prototype.updateSubgraphs = function () {
17509
18268
  var context = this;
17510
18269
  this._subgraphG.selectAll(".subgraphPlaceholder")
17511
18270
  .data(this.hasSubgraphs() ? this._graphData.allSubgraphs() : [], function (d) { return d.id; })
@@ -17513,7 +18272,7 @@
17513
18272
  .attr("class", "subgraphPlaceholder")
17514
18273
  .on("click.selectionBag", function (d) {
17515
18274
  context._selection.click({
17516
- _id: d.id,
18275
+ _id: String(d.id),
17517
18276
  element: function () { return d.element; }
17518
18277
  }, common.d3Event());
17519
18278
  context.selectionChanged();
@@ -17539,7 +18298,7 @@
17539
18298
  });
17540
18299
  return this;
17541
18300
  };
17542
- Graph2.prototype.enter = function (domNode, element) {
18301
+ GraphT.prototype.enter = function (domNode, element) {
17543
18302
  var _this = this;
17544
18303
  _super.prototype.enter.call(this, domNode, element);
17545
18304
  var svg = this.locateSVGNode(domNode);
@@ -17559,7 +18318,7 @@
17559
18318
  _this.selectionChanged();
17560
18319
  });
17561
18320
  };
17562
- Graph2.prototype.forceDirectedOptions = function () {
18321
+ GraphT.prototype.forceDirectedOptions = function () {
17563
18322
  return {
17564
18323
  alpha: this.forceDirectedAlpha(),
17565
18324
  alphaMin: this.forceDirectedAlphaMin(),
@@ -17575,7 +18334,7 @@
17575
18334
  distanceMax: this.forceDirectedMaxDistance(),
17576
18335
  };
17577
18336
  };
17578
- Graph2.prototype.layoutOptions = function (layout) {
18337
+ GraphT.prototype.layoutOptions = function (layout) {
17579
18338
  switch (layout) {
17580
18339
  case "ForceDirected":
17581
18340
  case "ForceDirected2":
@@ -17597,7 +18356,7 @@
17597
18356
  case "FDP":
17598
18357
  case "TwoPI":
17599
18358
  case "Circo":
17600
- return this.wasmFolder() || wasmFolder;
18359
+ return new URL(this.wasmFolder() || scriptDir, document.baseURI).href;
17601
18360
  case "None":
17602
18361
  case "Circle":
17603
18362
  case "RadialTree":
@@ -17606,7 +18365,7 @@
17606
18365
  return undefined;
17607
18366
  }
17608
18367
  };
17609
- Graph2.prototype.updateLayout = function () {
18368
+ GraphT.prototype.updateLayout = function () {
17610
18369
  var _this = this;
17611
18370
  var layout = this.layout();
17612
18371
  var options = this.layoutOptions(layout);
@@ -17664,9 +18423,8 @@
17664
18423
  }
17665
18424
  }
17666
18425
  };
17667
- Graph2.prototype.update = function (domNode, element) {
18426
+ GraphT.prototype.update = function (domNode, element) {
17668
18427
  _super.prototype.update.call(this, domNode, element);
17669
- this._centroidFilter.update(this.centroidColor());
17670
18428
  this._renderElement.classed("allowDragging", this.allowDragging());
17671
18429
  this.updateCategories();
17672
18430
  this.updateAnnotations();
@@ -17676,11 +18434,11 @@
17676
18434
  this.updateLayout();
17677
18435
  this.updateIconBar();
17678
18436
  };
17679
- Graph2.prototype.exit = function (domNode, element) {
18437
+ GraphT.prototype.exit = function (domNode, element) {
17680
18438
  _super.prototype.exit.call(this, domNode, element);
17681
18439
  this._tooltip.target(null);
17682
18440
  };
17683
- Graph2.prototype.render = function (callback) {
18441
+ GraphT.prototype.render = function (callback) {
17684
18442
  var _this = this;
17685
18443
  this.progress("start");
17686
18444
  _super.prototype.render.call(this, function (w) {
@@ -17691,7 +18449,7 @@
17691
18449
  });
17692
18450
  return this;
17693
18451
  };
17694
- Graph2.prototype.zoomed = function (transform) {
18452
+ GraphT.prototype.zoomed = function (transform) {
17695
18453
  _super.prototype.zoomed.call(this, transform);
17696
18454
  var _a = this.size(), width = _a.width, height = _a.height;
17697
18455
  if (transform.k < this.minScale()) {
@@ -17725,10 +18483,10 @@
17725
18483
  }
17726
18484
  };
17727
18485
  // Events ---
17728
- Graph2.prototype.centroids = function () {
17729
- return this._graphData.allVertices().filter(function (vp) { return !!vp.centroid; });
18486
+ GraphT.prototype.centroids = function () {
18487
+ return this._graphData.allVertices().filter(function (vp) { return !!vp.props.centroid; });
17730
18488
  };
17731
- Graph2.prototype.selectionChanged = function () {
18489
+ GraphT.prototype.selectionChanged = function () {
17732
18490
  var _this = this;
17733
18491
  if (this.highlightSelectedPathToCentroid()) {
17734
18492
  var highlightedVertices_1 = {};
@@ -17745,116 +18503,222 @@
17745
18503
  this._edgeG.selectAll(".graphEdge");
17746
18504
  }
17747
18505
  };
17748
- Graph2.prototype.tooltipHTML = function (data) {
18506
+ GraphT.prototype.tooltipHTML = function (data) {
17749
18507
  return data.props.tooltip;
17750
18508
  };
17751
- Graph2.prototype.subgraph_click = function (row, _col, sel) {
18509
+ GraphT.prototype.subgraph_click = function (row, _col, sel) {
17752
18510
  };
17753
- Graph2.prototype.vertex_click = function (row, _col, sel, data) {
18511
+ GraphT.prototype.vertex_click = function (row, _col, sel, data) {
17754
18512
  };
17755
- Graph2.prototype.vertex_dblclick = function (row, _col, sel, data) {
18513
+ GraphT.prototype.vertex_dblclick = function (row, _col, sel, data) {
17756
18514
  };
17757
- Graph2.prototype.vertex_mousein = function (row, _col, sel, data) {
18515
+ GraphT.prototype.vertex_mousein = function (row, _col, sel, data) {
17758
18516
  };
17759
- Graph2.prototype.vertex_mouseover = function (row, _col, sel, data) {
18517
+ GraphT.prototype.vertex_mouseover = function (row, _col, sel, data) {
17760
18518
  };
17761
- Graph2.prototype.vertex_mouseout = function (row, _col, sel, data) {
18519
+ GraphT.prototype.vertex_mouseout = function (row, _col, sel, data) {
17762
18520
  };
17763
- Graph2.prototype.edge_click = function (row, _col, sel) {
18521
+ GraphT.prototype.edge_click = function (row, _col, sel) {
17764
18522
  };
17765
- Graph2.prototype.edge_mouseover = function (element, d) {
18523
+ GraphT.prototype.edge_mouseover = function (element, d) {
17766
18524
  this.highlightEdge(element, d);
17767
18525
  };
17768
- Graph2.prototype.edge_mouseout = function (_element, _d) {
18526
+ GraphT.prototype.edge_mouseout = function (_element, _d) {
17769
18527
  this.highlightEdge(null, null);
17770
18528
  };
17771
- Graph2.prototype.progress = function (what) {
18529
+ GraphT.prototype.progress = function (what) {
17772
18530
  };
17773
- return Graph2;
18531
+ return GraphT;
17774
18532
  }(common.SVGZoomWidget));
17775
- Graph2.prototype._class += " graph_Graph2";
17776
- Graph2.prototype.publish("allowDragging", true, "boolean", "Allow Dragging of Vertices");
17777
- Graph2.prototype.publish("dragSingleNeighbors", true, "boolean", "Dragging a Vertex also moves its singleton neighbors");
17778
- Graph2.prototype.publish("layout", "ForceDirectedHybrid", "set", "Default Layout", GraphLayoutTypeSet);
17779
- Graph2.prototype.publish("scale", "100%", "set", "Zoom Level", ["all", "width", "selection", "100%", "90%", "75%", "50%", "25%", "10%"]);
17780
- Graph2.prototype.publish("applyScaleOnLayout", false, "boolean", "Shrink to fit on Layout");
17781
- Graph2.prototype.publish("highlightOnMouseOverVertex", true, "boolean", "Highlight Vertex on Mouse Over");
17782
- Graph2.prototype.publish("highlightOnMouseOverEdge", true, "boolean", "Highlight Edge on Mouse Over");
17783
- Graph2.prototype.publish("transitionDuration", 250, "number", "Transition Duration");
17784
- Graph2.prototype.publish("showEdges", true, "boolean", "Show Edges");
17785
- Graph2.prototype.publish("showEdgeLabels", true, "boolean", "Show Edge labels");
17786
- Graph2.prototype.publish("showEdgeLabelsOnHighlight", true, "boolean", "Show Edge labels when highlighted");
17787
- Graph2.prototype.publish("showVertexLabels", true, "boolean", "Show Vertex labels");
17788
- Graph2.prototype.publish("showVertexLabelsOnHighlight", true, "boolean", "Show Vertex labels when highlighted");
17789
- Graph2.prototype.publish("snapToGrid", 0, "number", "Snap to Grid");
17790
- Graph2.prototype.publish("selectionClearOnBackgroundClick", false, "boolean", "Clear selection on background click");
17791
- Graph2.prototype.publish("edgeArcDepth", 8, "number", "Edge Arc Depth");
17792
- Graph2.prototype.publish("edgeColor", null, "html-color", "Edge line stroke color", null, { optional: true });
17793
- Graph2.prototype.publish("edgeStrokeWidth", 1, "number", "Edge line stroke width (pixels)");
17794
- Graph2.prototype.publish("minScale", 0.6, "number", "Min scale size for text");
17795
- Graph2.prototype.publish("maxScale", 1.0, "number", "Max scale size for text");
17796
- Graph2.prototype.publish("tooltipWidth", 256, "number", "Tooltip width (pixels)");
17797
- Graph2.prototype.publish("tooltipHeight", 128, "number", "Tooltip width (pixels)");
17798
- Graph2.prototype.publish("enableTooltipPointerEvents", false, "boolean", "If true, tooltip will use the style: 'pointer-events: all'");
17799
- Graph2.prototype.publish("tooltipCloseDelay", 0, "number", "Number of milliseconds to wait before closing tooltip (cancelled on tooltip mouseover event)");
17800
- Graph2.prototype.publish("doubleClickMaxDelay", 300, "number", "Number of milliseconds to wait before a subsequent click is not considered a double click");
17801
- Graph2.prototype.publish("centroidColor", "#00A000", "html-color", "Centroid Glow Color");
17802
- Graph2.prototype.publish("centroidScale", 1, "number", "Centroid Scale");
17803
- Graph2.prototype.publish("centroidTextHeight", 12, "number", "Centroid Text Height");
17804
- Graph2.prototype.publish("centroidTextPadding", 4, "number", "Centroid Text Padding");
17805
- Graph2.prototype.publish("centroidIconHeight", 50, "number", "Centroid Icon Height");
17806
- Graph2.prototype.publish("centroidIconPadding", 10, "number", "Centroid Icon Padding");
17807
- Graph2.prototype.publish("centroidIconStrokeWidth", 4, "number", "Centroid Icon Stroke Width");
17808
- Graph2.prototype.publish("centroidIconFontFamily", "FontAwesome", "string", "Centroid Icon Font Family");
17809
- Graph2.prototype.publish("centroidLabelFontFamily", "Verdana", "string", "Centroid Label Font Family");
17810
- Graph2.prototype.publish("vertexTextHeight", 10, "number", "Vertex Text Height");
17811
- Graph2.prototype.publish("vertexTextPadding", 4, "number", "Vertex Text Padding");
17812
- Graph2.prototype.publish("vertexIconHeight", 50, "number", "Vertex Icon Height");
17813
- Graph2.prototype.publish("vertexIconPadding", 10, "number", "Vertex Icon Padding");
17814
- Graph2.prototype.publish("vertexIconStrokeWidth", 0, "number", "Vertex Icon Stroke Width");
17815
- Graph2.prototype.publish("vertexIconFontFamily", "FontAwesome", "string", "Vertex Icon Font Family");
17816
- Graph2.prototype.publish("vertexLabelFontFamily", "Verdana", "string", "Vertex Label Font Family");
17817
- Graph2.prototype.publish("highlightSelectedPathToCentroid", true, "boolean", "Highlight path to Center Vertex (for selected vertices)");
17818
- Graph2.prototype.publish("hierarchyRankDirection", "TB", "set", "Direction for Rank Nodes", ["TB", "BT", "LR", "RL"], { disable: function (w) { return w.layout() !== "Hierarchy"; } });
17819
- Graph2.prototype.publish("hierarchyNodeSeparation", 50, "number", "Number of pixels that separate nodes horizontally in the layout", null, { disable: function (w) { return w.layout() !== "Hierarchy"; } });
17820
- Graph2.prototype.publish("hierarchyEdgeSeparation", 10, "number", "Number of pixels that separate edges horizontally in the layout", null, { disable: function (w) { return w.layout() !== "Hierarchy"; } });
17821
- Graph2.prototype.publish("hierarchyRankSeparation", 50, "number", "Number of pixels between each rank in the layout", null, { disable: function (w) { return w.layout() !== "Hierarchy"; } });
17822
- Graph2.prototype.publish("hierarchyDigraph", true, "boolean", "Directional Graph2", null, { disable: function (w) { return w.layout() !== "Hierarchy"; } });
17823
- Graph2.prototype.publish("forceDirectedAlpha", 1, "number", "Alpha", null, { disable: function (w) { return w.layout().indexOf("ForceDirected") !== 0; } });
17824
- Graph2.prototype.publish("forceDirectedAlphaMin", 0.001, "number", "Min Alpha", null, { disable: function (w) { return w.layout().indexOf("ForceDirected") !== 0; } });
17825
- Graph2.prototype.publish("forceDirectedAlphaDecay", 0.0228, "number", "Defaults to 1 - pow(alphaMin, 1 / 300)", null, { disable: function (w) { return w.layout().indexOf("ForceDirected") !== 0; } });
17826
- Graph2.prototype.publish("forceDirectedRepulsionStrength", -350, "number", "Charge strength ", null, { disable: function (w) { return w.layout().indexOf("ForceDirected") !== 0; } });
17827
- Graph2.prototype.publish("forceDirectedVelocityDecay", 0.4, "number", "Velocity Decay ", null, { disable: function (w) { return w.layout().indexOf("ForceDirected") !== 0; } });
17828
- Graph2.prototype.publish("forceDirectedIterations", 300, "number", "Iterations", null, { disable: function (w) { return w.layout().indexOf("ForceDirected") !== 0; } });
17829
- Graph2.prototype.publish("forceDirectedLinkDistance", 300, "number", "Target distance between linked nodes", null, { disable: function (w) { return w.layout().indexOf("ForceDirected") !== 0; } });
17830
- Graph2.prototype.publish("forceDirectedLinkStrength", 1, "number", "Strength (rigidity) of links", null, { disable: function (w) { return w.layout().indexOf("ForceDirected") !== 0; } });
17831
- Graph2.prototype.publish("forceDirectedPinCentroid", false, "boolean", "Pin centroid to center", null, { disable: function (w) { return w.layout().indexOf("ForceDirected") !== 0; } });
17832
- Graph2.prototype.publish("forceDirectedForceStrength", 0, "number", "Strength of center force", null, { disable: function (w) { return w.layout().indexOf("ForceDirected") !== 0; } });
17833
- Graph2.prototype.publish("forceDirectedMinDistance", 1, "number", "Min distance between nodes", null, { disable: function (w) { return w.layout().indexOf("ForceDirected") !== 0; } });
17834
- Graph2.prototype.publish("forceDirectedMaxDistance", Infinity, "number", "Max distance between nodes", null, { disable: function (w) { return w.layout().indexOf("ForceDirected") !== 0; } });
17835
- Graph2.prototype.publish("treeRankDirection", "LR", "set", "Direction for Rank Nodes", ["TB", "LR"], { disable: function (w) { return w.layout() !== "Tree" && w.layout() !== "Dendrogram"; } });
17836
- Graph2.prototype.publish("wasmFolder", null, "string", "WASM Folder", null, { optional: true, disable: function (w) { return ["DOT", "Neato", "FDP", "TwoPI", "Circo"].indexOf(w.layout()) < 0; } });
17837
- var _origScale = Graph2.prototype.scale;
17838
- Graph2.prototype.scale = function (_, transitionDuration) {
18533
+ GraphT.prototype._class += " graph_GraphT";
18534
+ GraphT.prototype.publish("allowDragging", true, "boolean", "Allow Dragging of Vertices");
18535
+ GraphT.prototype.publish("dragSingleNeighbors", true, "boolean", "Dragging a Vertex also moves its singleton neighbors");
18536
+ GraphT.prototype.publish("layout", "ForceDirectedHybrid", "set", "Default Layout", GraphLayoutTypeSet);
18537
+ GraphT.prototype.publish("scale", "100%", "set", "Zoom Level", ["all", "width", "selection", "100%", "90%", "75%", "50%", "25%", "10%"]);
18538
+ GraphT.prototype.publish("applyScaleOnLayout", false, "boolean", "Shrink to fit on Layout");
18539
+ GraphT.prototype.publish("highlightOnMouseOverVertex", true, "boolean", "Highlight Vertex on Mouse Over");
18540
+ GraphT.prototype.publish("highlightOnMouseOverEdge", true, "boolean", "Highlight Edge on Mouse Over");
18541
+ GraphT.prototype.publish("transitionDuration", 250, "number", "Transition Duration");
18542
+ GraphT.prototype.publish("showEdges", true, "boolean", "Show Edges");
18543
+ GraphT.prototype.publish("showEdgeLabels", true, "boolean", "Show Edge labels");
18544
+ GraphT.prototype.publish("showEdgeLabelsOnHighlight", true, "boolean", "Show Edge labels when highlighted");
18545
+ GraphT.prototype.publish("showVertexLabels", true, "boolean", "Show Vertex labels");
18546
+ GraphT.prototype.publish("showVertexLabelsOnHighlight", true, "boolean", "Show Vertex labels when highlighted");
18547
+ GraphT.prototype.publish("snapToGrid", 0, "number", "Snap to Grid");
18548
+ GraphT.prototype.publish("selectionClearOnBackgroundClick", false, "boolean", "Clear selection on background click");
18549
+ GraphT.prototype.publish("edgeArcDepth", 8, "number", "Edge Arc Depth");
18550
+ GraphT.prototype.publish("edgeColor", null, "html-color", "Edge line stroke color", null, { optional: true });
18551
+ GraphT.prototype.publish("edgeStrokeWidth", 1, "number", "Edge line stroke width (pixels)");
18552
+ GraphT.prototype.publish("minScale", 0.6, "number", "Min scale size for text");
18553
+ GraphT.prototype.publish("maxScale", 1.0, "number", "Max scale size for text");
18554
+ GraphT.prototype.publish("tooltipWidth", 256, "number", "Tooltip width (pixels)");
18555
+ GraphT.prototype.publish("tooltipHeight", 128, "number", "Tooltip width (pixels)");
18556
+ GraphT.prototype.publish("enableTooltipPointerEvents", false, "boolean", "If true, tooltip will use the style: 'pointer-events: all'");
18557
+ GraphT.prototype.publish("tooltipCloseDelay", 0, "number", "Number of milliseconds to wait before closing tooltip (cancelled on tooltip mouseover event)");
18558
+ GraphT.prototype.publish("doubleClickMaxDelay", 300, "number", "Number of milliseconds to wait before a subsequent click is not considered a double click");
18559
+ GraphT.prototype.publish("highlightSelectedPathToCentroid", true, "boolean", "Highlight path to Center Vertex (for selected vertices)");
18560
+ GraphT.prototype.publish("hierarchyRankDirection", "TB", "set", "Direction for Rank Nodes", ["TB", "BT", "LR", "RL"], { disable: function (w) { return w.layout() !== "Hierarchy"; } });
18561
+ GraphT.prototype.publish("hierarchyNodeSeparation", 50, "number", "Number of pixels that separate nodes horizontally in the layout", null, { disable: function (w) { return w.layout() !== "Hierarchy"; } });
18562
+ GraphT.prototype.publish("hierarchyEdgeSeparation", 10, "number", "Number of pixels that separate edges horizontally in the layout", null, { disable: function (w) { return w.layout() !== "Hierarchy"; } });
18563
+ GraphT.prototype.publish("hierarchyRankSeparation", 50, "number", "Number of pixels between each rank in the layout", null, { disable: function (w) { return w.layout() !== "Hierarchy"; } });
18564
+ GraphT.prototype.publish("hierarchyDigraph", true, "boolean", "Directional GraphBase", null, { disable: function (w) { return w.layout() !== "Hierarchy"; } });
18565
+ GraphT.prototype.publish("forceDirectedAlpha", 1, "number", "Alpha", null, { disable: function (w) { return w.layout().indexOf("ForceDirected") !== 0; } });
18566
+ GraphT.prototype.publish("forceDirectedAlphaMin", 0.001, "number", "Min Alpha", null, { disable: function (w) { return w.layout().indexOf("ForceDirected") !== 0; } });
18567
+ GraphT.prototype.publish("forceDirectedAlphaDecay", 0.0228, "number", "Defaults to 1 - pow(alphaMin, 1 / 300)", null, { disable: function (w) { return w.layout().indexOf("ForceDirected") !== 0; } });
18568
+ GraphT.prototype.publish("forceDirectedRepulsionStrength", -350, "number", "Charge strength ", null, { disable: function (w) { return w.layout().indexOf("ForceDirected") !== 0; } });
18569
+ GraphT.prototype.publish("forceDirectedVelocityDecay", 0.4, "number", "Velocity Decay ", null, { disable: function (w) { return w.layout().indexOf("ForceDirected") !== 0; } });
18570
+ GraphT.prototype.publish("forceDirectedIterations", 300, "number", "Iterations", null, { disable: function (w) { return w.layout().indexOf("ForceDirected") !== 0; } });
18571
+ GraphT.prototype.publish("forceDirectedLinkDistance", 300, "number", "Target distance between linked nodes", null, { disable: function (w) { return w.layout().indexOf("ForceDirected") !== 0; } });
18572
+ GraphT.prototype.publish("forceDirectedLinkStrength", 1, "number", "Strength (rigidity) of links", null, { disable: function (w) { return w.layout().indexOf("ForceDirected") !== 0; } });
18573
+ GraphT.prototype.publish("forceDirectedPinCentroid", false, "boolean", "Pin centroid to center", null, { disable: function (w) { return w.layout().indexOf("ForceDirected") !== 0; } });
18574
+ GraphT.prototype.publish("forceDirectedForceStrength", 0, "number", "Strength of center force", null, { disable: function (w) { return w.layout().indexOf("ForceDirected") !== 0; } });
18575
+ GraphT.prototype.publish("forceDirectedMinDistance", 1, "number", "Min distance between nodes", null, { disable: function (w) { return w.layout().indexOf("ForceDirected") !== 0; } });
18576
+ GraphT.prototype.publish("forceDirectedMaxDistance", Infinity, "number", "Max distance between nodes", null, { disable: function (w) { return w.layout().indexOf("ForceDirected") !== 0; } });
18577
+ GraphT.prototype.publish("treeRankDirection", "LR", "set", "Direction for Rank Nodes", ["TB", "LR"], { disable: function (w) { return w.layout() !== "Tree" && w.layout() !== "Dendrogram"; } });
18578
+ GraphT.prototype.publish("wasmFolder", null, "string", "WASM Folder", null, { optional: true, disable: function (w) { return ["DOT", "Neato", "FDP", "TwoPI", "Circo"].indexOf(w.layout()) < 0; } });
18579
+ var _origScale = GraphT.prototype.scale;
18580
+ GraphT.prototype.scale = function (_, transitionDuration) {
17839
18581
  var retVal = _origScale.apply(this, arguments);
17840
18582
  if (arguments.length) {
17841
18583
  this.zoomTo(_, transitionDuration);
17842
18584
  }
17843
18585
  return retVal;
17844
18586
  };
17845
- function graphviz(dot, engine, _wasmFolder) {
18587
+ function graphviz(dot, engine, _scriptDir) {
17846
18588
  if (engine === void 0) { engine = "dot"; }
17847
- if (_wasmFolder === void 0) { _wasmFolder = wasmFolder; }
17848
18589
  return graphviz$1({
17849
18590
  items: [],
17850
18591
  links: [],
17851
18592
  raw: dot
17852
18593
  }, {
17853
18594
  engine: engine,
17854
- wasmFolder: _wasmFolder
18595
+ wasmFolder: new URL(scriptDir, document.baseURI).href
17855
18596
  });
17856
18597
  }
17857
18598
 
18599
+ function adapter(reactRenderer) {
18600
+ return function (props, element) { return react.render(reactRenderer, props, element); };
18601
+ }
18602
+ var GraphReactT = /** @class */ (function (_super) {
18603
+ __extends(GraphReactT, _super);
18604
+ function GraphReactT(subgraphRenderer, vertexRenderer, edgeRenderer) {
18605
+ return _super.call(this, adapter(subgraphRenderer), adapter(vertexRenderer), adapter(edgeRenderer)) || this;
18606
+ }
18607
+ GraphReactT.prototype.subgraphRenderer = function (_) {
18608
+ if (!arguments.length)
18609
+ return this._reactSubgraphRenderer;
18610
+ this._reactSubgraphRenderer = _;
18611
+ _super.prototype.subgraphRenderer.call(this, adapter(this._reactSubgraphRenderer));
18612
+ return this;
18613
+ };
18614
+ GraphReactT.prototype.vertexRenderer = function (_) {
18615
+ var _this = this;
18616
+ if (!arguments.length)
18617
+ return this._reactVertexRenderer;
18618
+ this._reactVertexRenderer = _;
18619
+ _super.prototype.vertexRenderer.call(this, function (props, element) { return react.render(_this._reactVertexRenderer, props, element); });
18620
+ return this;
18621
+ };
18622
+ GraphReactT.prototype.edgeRenderer = function (_) {
18623
+ var _this = this;
18624
+ if (!arguments.length)
18625
+ return this._reactEdgeRenderer;
18626
+ this._reactEdgeRenderer = _;
18627
+ _super.prototype.edgeRenderer.call(this, function (props, element) { return react.render(_this._reactEdgeRenderer, props, element); });
18628
+ return this;
18629
+ };
18630
+ return GraphReactT;
18631
+ }(GraphT));
18632
+
18633
+ // , Shape, Text,
18634
+ var BasicEdge = function (_a) {
18635
+ var label = _a.label, labelPos = _a.labelPos, _b = _a.labelFill, labelFill = _b === void 0 ? "black" : _b, _c = _a.labelHeight, labelHeight = _c === void 0 ? 12 : _c, path = _a.path, color = _a.color, strokeWidth = _a.strokeWidth, strokeDasharray = _a.strokeDasharray;
18636
+ return react.React.createElement(react.React.Fragment, null,
18637
+ react.React.createElement("path", { d: path, stroke: color, style: { strokeWidth: strokeWidth, strokeDasharray: strokeDasharray } }),
18638
+ label && labelPos && labelPos.length === 2 ?
18639
+ react.React.createElement("g", { transform: "translate(".concat(labelPos[0], " ").concat(labelPos[1], ")") },
18640
+ react.React.createElement(react.Text, { text: label, fill: labelFill, height: labelHeight })) : undefined);
18641
+ };
18642
+
18643
+ var Graph2 = /** @class */ (function (_super) {
18644
+ __extends(Graph2, _super);
18645
+ function Graph2() {
18646
+ var _this = _super.call(this, react.Subgraph, react.Vertex, BasicEdge) || this;
18647
+ _this._reactCentroidRenderer = react.Vertex;
18648
+ _this._reactVertexRenderer2 = react.Vertex;
18649
+ _super.prototype.vertexRenderer.call(_this, function (props) {
18650
+ return props.centroid ? _this._reactCentroidRenderer(props) : _this._reactVertexRenderer2(props);
18651
+ });
18652
+ return _this;
18653
+ }
18654
+ Graph2.prototype.calcProps = function (_props) {
18655
+ var props = _super.prototype.calcProps.call(this, _props);
18656
+ if (!props.icon)
18657
+ props.icon = {};
18658
+ if (props.centroid) {
18659
+ props.textHeight = props.textHeight ? props.textHeight : this.centroidTextHeight() * this.centroidScale();
18660
+ props.textPadding = props.textPadding ? props.textPadding : this.centroidTextPadding() * this.centroidScale();
18661
+ props.textFontFamily = props.textFontFamily ? props.textFontFamily : this.centroidLabelFontFamily();
18662
+ props.icon.height = props.icon.height ? props.icon.height : this.centroidIconHeight() * this.centroidScale();
18663
+ props.icon.padding = props.icon.padding ? props.icon.padding : this.centroidIconPadding() * this.centroidScale();
18664
+ props.icon.strokeWidth = props.icon.strokeWidth ? props.icon.strokeWidth : this.centroidIconStrokeWidth();
18665
+ props.icon.imageFontFamily = props.icon.imageFontFamily ? props.icon.imageFontFamily : this.centroidIconFontFamily();
18666
+ }
18667
+ else {
18668
+ props.textHeight = props.textHeight ? props.textHeight : this.vertexTextHeight();
18669
+ props.textPadding = props.textPadding ? props.textPadding : this.vertexTextPadding();
18670
+ props.textFontFamily = props.textFontFamily ? props.textFontFamily : this.vertexLabelFontFamily();
18671
+ props.icon.height = props.icon.height ? props.icon.height : this.vertexIconHeight();
18672
+ props.icon.padding = props.icon.padding ? props.icon.padding : this.vertexIconPadding();
18673
+ props.icon.strokeWidth = props.icon.strokeWidth ? props.icon.strokeWidth : this.vertexIconStrokeWidth();
18674
+ props.icon.imageFontFamily = props.icon.imageFontFamily ? props.icon.imageFontFamily : this.vertexIconFontFamily();
18675
+ }
18676
+ var text = props.icon.imageChar;
18677
+ var fontFamily = props.icon.imageFontFamily;
18678
+ var fontSize = props.icon.height - props.icon.padding;
18679
+ var rect = this.textRect(text, fontFamily, fontSize);
18680
+ props.icon.yOffset = -(rect.top - (fontSize / 2)) - (rect.height / 2) + (props.icon.padding > 0 ? fontSize / props.icon.padding / 2 : 0);
18681
+ return props;
18682
+ };
18683
+ Graph2.prototype.vertexRenderer = function (_) {
18684
+ if (!arguments.length)
18685
+ return this._reactVertexRenderer2;
18686
+ this._reactVertexRenderer2 = _;
18687
+ return this;
18688
+ };
18689
+ Graph2.prototype.centroidRenderer = function (_) {
18690
+ if (!arguments.length)
18691
+ return this._reactCentroidRenderer;
18692
+ this._reactCentroidRenderer = _;
18693
+ return this;
18694
+ };
18695
+ Graph2.prototype.enter = function (domNode, element) {
18696
+ _super.prototype.enter.call(this, domNode, element);
18697
+ };
18698
+ Graph2.prototype.update = function (domNode, element) {
18699
+ _super.prototype.update.call(this, domNode, element);
18700
+ this._centroidFilter.update(this.centroidColor());
18701
+ };
18702
+ return Graph2;
18703
+ }(GraphReactT));
18704
+ Graph2.prototype._class += " graph_Graph2";
18705
+ Graph2.prototype.publish("vertexTextHeight", 10, "number", "Vertex Text Height");
18706
+ Graph2.prototype.publish("vertexTextPadding", 4, "number", "Vertex Text Padding");
18707
+ Graph2.prototype.publish("vertexIconHeight", 50, "number", "Vertex Icon Height");
18708
+ Graph2.prototype.publish("vertexIconPadding", 10, "number", "Vertex Icon Padding");
18709
+ Graph2.prototype.publish("vertexIconStrokeWidth", 0, "number", "Vertex Icon Stroke Width");
18710
+ Graph2.prototype.publish("vertexIconFontFamily", "FontAwesome", "string", "Vertex Icon Font Family");
18711
+ Graph2.prototype.publish("vertexLabelFontFamily", "Verdana", "string", "Vertex Label Font Family");
18712
+ Graph2.prototype.publish("centroidColor", "#00A000", "html-color", "Centroid Glow Color");
18713
+ Graph2.prototype.publish("centroidScale", 1, "number", "Centroid Scale");
18714
+ Graph2.prototype.publish("centroidTextHeight", 12, "number", "Centroid Text Height");
18715
+ Graph2.prototype.publish("centroidTextPadding", 4, "number", "Centroid Text Padding");
18716
+ Graph2.prototype.publish("centroidIconHeight", 50, "number", "Centroid Icon Height");
18717
+ Graph2.prototype.publish("centroidIconPadding", 10, "number", "Centroid Icon Padding");
18718
+ Graph2.prototype.publish("centroidIconStrokeWidth", 4, "number", "Centroid Icon Stroke Width");
18719
+ Graph2.prototype.publish("centroidIconFontFamily", "FontAwesome", "string", "Centroid Icon Font Family");
18720
+ Graph2.prototype.publish("centroidLabelFontFamily", "Verdana", "string", "Centroid Label Font Family");
18721
+
17858
18722
  function toJsonObj(row, columns) {
17859
18723
  var retVal = {};
17860
18724
  columns.forEach(function (c, i) { return retVal[c] = row[i]; });
@@ -18017,14 +18881,15 @@
18017
18881
  if (!target)
18018
18882
  console.error("Invalid edge target entity \"".concat(e[targetIdx], "\" does not exist."));
18019
18883
  return {
18020
- type: "edge",
18021
18884
  id: idIdx >= 0 ? "" + e[idIdx] : "" + e[sourceIdx] + "->" + e[targetIdx],
18022
18885
  source: source,
18023
18886
  target: target,
18024
18887
  weight: +e[weightIdx] || 1,
18025
18888
  color: e[colorIdx],
18026
18889
  label: labelIdx >= 0 ? ("" + e[labelIdx]) : "",
18027
- origData: toJsonObj(e, columns)
18890
+ origData: toJsonObj(e, columns),
18891
+ labelPos: [0, 0],
18892
+ path: ""
18028
18893
  };
18029
18894
  }).filter(function (e) { return e.source && e.target; });
18030
18895
  var diff = util$b.compare2(this._masterEdges, edges, function (d) { return d.id; });
@@ -18216,7 +19081,6 @@
18216
19081
  var idIdx = this.indexOf(columns, this.vertexIDColumn(), "id");
18217
19082
  var labelIdx = this.indexOf(columns, this.vertexLabelColumn(), "label");
18218
19083
  var centroidIdx = this.indexOf(columns, this.vertexCentroidColumn(), "centroid");
18219
- var faCharIdx = this.indexOf(columns, this.vertexFACharColumn(), "faChar");
18220
19084
  var vertexTooltipIdx = this.indexOf(columns, this.vertexTooltipColumn(), "tooltip");
18221
19085
  var annotationIdxs = annotationColumns.map(function (ac) { return _this.indexOf(columns, ac.columnID(), ""); });
18222
19086
  var vertices = this.vertices().map(function (v) {
@@ -18227,9 +19091,6 @@
18227
19091
  tooltip: "" + v[vertexTooltipIdx],
18228
19092
  origData: toJsonObj(v, columns),
18229
19093
  centroid: !!v[centroidIdx],
18230
- icon: {
18231
- imageChar: "" + (v[faCharIdx] || _this.vertexFAChar())
18232
- },
18233
19094
  annotationIDs: annotationIdxs.map(function (ai, i) { return !!v[ai] ? annotationColumns[i].annotationID() : undefined; }).filter(function (a) { return !!a; })
18234
19095
  };
18235
19096
  });
@@ -18510,14 +19371,37 @@
18510
19371
  SankeyGraph.prototype.publish("xAxisMovement", false, "boolean", "Enable x-axis movement");
18511
19372
  SankeyGraph.prototype.publish("yAxisMovement", false, "boolean", "Enable y-axis movement");
18512
19373
 
19374
+ // , Shape, Text,
19375
+ var BasicSubgraph = function (_a) {
19376
+ var _b = _a.label, label = _b === void 0 ? "" : _b, _c = _a.labelFill, labelFill = _c === void 0 ? "black" : _c, _d = _a.labelHeight, labelHeight = _d === void 0 ? 12 : _d, _e = _a.width, width = _e === void 0 ? 0 : _e, _f = _a.height, height = _f === void 0 ? 0 : _f, fill = _a.rectFill, _g = _a.rectStroke, stroke = _g === void 0 ? "#627ae7" : _g, _h = _a.rectStrokeWidth, strokeWidth = _h === void 0 ? 2 : _h;
19377
+ return react.React.createElement("g", { transform: "translate(".concat(-width / 2, " ").concat(-height / 2, ")") },
19378
+ react.React.createElement("rect", { width: width, height: height, fill: fill, stroke: stroke, style: { strokeWidth: strokeWidth } }),
19379
+ react.React.createElement("g", { transform: "translate(8 ".concat(8 + labelHeight, ")") },
19380
+ react.React.createElement(react.Text, { text: label, fill: labelFill, height: labelHeight })));
19381
+ };
19382
+
19383
+ // , Shape, Text,
19384
+ var BasicVertex = function (_a) {
19385
+ var text = _a.text, _b = _a.textFill, textFill = _b === void 0 ? "black" : _b, _c = _a.textHeight, textHeight = _c === void 0 ? 12 : _c, _d = _a.scale, scale = _d === void 0 ? 1 : _d, _e = _a.circleRadius, circleRadius = _e === void 0 ? 16 : _e, _f = _a.circleFill, circleFill = _f === void 0 ? "#a2bcf9" : _f, _g = _a.circleStroke, circleStroke = _g === void 0 ? "#627ae7" : _g, _h = _a.circleStrokeWidth, circleStrokeWidth = _h === void 0 ? 2 : _h;
19386
+ return react.React.createElement("g", { transform: "scale(".concat(scale, ")") },
19387
+ react.React.createElement("circle", { cx: "0", cy: "0", r: circleRadius, fill: circleFill, stroke: circleStroke, style: { strokeWidth: circleStrokeWidth } }),
19388
+ react.React.createElement("g", { transform: "translate(0 ".concat(circleRadius + textHeight, ")") },
19389
+ react.React.createElement(react.Text, { text: text, fill: textFill, height: textHeight })));
19390
+ };
19391
+
18513
19392
  exports.AdjacencyGraph = AdjacencyGraph;
18514
19393
  exports.Annotation = Annotation;
18515
19394
  exports.AnnotationColumn = AnnotationColumn;
18516
19395
  exports.BUILD_VERSION = BUILD_VERSION;
19396
+ exports.BasicEdge = BasicEdge;
19397
+ exports.BasicSubgraph = BasicSubgraph;
19398
+ exports.BasicVertex = BasicVertex;
18517
19399
  exports.DataGraph = DataGraph;
18518
19400
  exports.Edge = Edge;
18519
19401
  exports.Graph = Graph;
18520
19402
  exports.Graph2 = Graph2;
19403
+ exports.GraphReactT = GraphReactT;
19404
+ exports.GraphT = GraphT;
18521
19405
  exports.PKG_NAME = PKG_NAME;
18522
19406
  exports.PKG_VERSION = PKG_VERSION;
18523
19407
  exports.Sankey = Sankey;