@cccsaurora/clue-ui 1.2.4-patch.275 → 1.2.5-dev.298

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 (188) hide show
  1. package/ActionForm-D6gYuFRR.js +5970 -0
  2. package/AnnotationDetails-Zx4pjBiN.js +175 -0
  3. package/AnnotationPreview-Dmz7taAU.js +188 -0
  4. package/ClueEnrichContext-CJEJxrgs.js +541 -0
  5. package/FlexOne-BSYAhhtG.js +9 -0
  6. package/_MapCache-WmuDdwuH.js +222 -0
  7. package/_Uint8Array-B7JqpgFX.js +128 -0
  8. package/_baseAssignValue-CGTuELqU.js +25 -0
  9. package/_baseClone-CkNrTyhm.js +283 -0
  10. package/_baseExtremum-kob8QXyt.js +18 -0
  11. package/_baseFlatten-jIR_sN_-.js +92 -0
  12. package/_baseGet-Bx3A4Qfp.js +108 -0
  13. package/_baseIsEqual-C5OTWzTk.js +208 -0
  14. package/_baseIteratee-avi7MX2o.js +126 -0
  15. package/_baseSlice-GAv_YFTT.js +20 -0
  16. package/_baseSum-D0WC1dN0.js +13 -0
  17. package/_baseUniq-BI9GIHMF.js +115 -0
  18. package/_commonjsHelpers-DWwsNxpa.js +8 -0
  19. package/_createAggregator-QD8MzKwe.js +63 -0
  20. package/_getPrototype-CU0j_POw.js +5 -0
  21. package/_getTag-Ckxxfr88.js +126 -0
  22. package/_isIterateeCall-Ds3sw2SF.js +17 -0
  23. package/_setToArray-CaPKQhcz.js +33 -0
  24. package/cloneDeep-DJrLSw8W.js +8 -0
  25. package/components/AnnotationBody.js +49 -35
  26. package/components/AnnotationDetailPopover.js +36 -30
  27. package/components/AnnotationDetails.js +7 -7
  28. package/components/AnnotationEntry.js +35 -35
  29. package/components/AnnotationPreview.js +5 -5
  30. package/components/ClassificationChip.js +44 -23
  31. package/components/CountBadge.js +31 -26
  32. package/components/EnrichedCard.js +110 -97
  33. package/components/EnrichedChip.js +130 -105
  34. package/components/EnrichedTypography.js +133 -107
  35. package/components/ErrorBoundary.js +28 -24
  36. package/components/RetryFailedEnrichments.js +10 -9
  37. package/components/SourcePicker.js +57 -49
  38. package/components/actions/ActionForm.js +4 -4
  39. package/components/actions/ExecutePopover.js +75 -59
  40. package/components/actions/ResultModal.js +4 -4
  41. package/components/actions/form/schemaAdapter.js +39 -23
  42. package/components/actions/formats/FileResult.js +86 -59
  43. package/components/actions/formats/index.js +21 -10
  44. package/components/display/graph/ExpandMoreButton.js +10 -10
  45. package/components/display/graph/elements/NodeCard.js +111 -91
  46. package/components/display/graph/elements/NodeTag.js +15 -13
  47. package/components/display/graph/index.js +261 -202
  48. package/components/display/graph/visualizations/Leaf.js +88 -69
  49. package/components/display/graph/visualizations/cloud/index.js +98 -81
  50. package/components/display/graph/visualizations/icons/BaseIcon.js +26 -21
  51. package/components/display/graph/visualizations/icons/BugIcon.js +12 -12
  52. package/components/display/graph/visualizations/icons/HostIcon.js +12 -12
  53. package/components/display/graph/visualizations/icons/NetworkIcon.js +12 -12
  54. package/components/display/graph/visualizations/icons/ProcessIcon.js +12 -12
  55. package/components/display/graph/visualizations/icons/TargetIcon.js +13 -13
  56. package/components/display/graph/visualizations/icons/index.js +14 -13
  57. package/components/display/graph/visualizations/panels/NodePanel.js +10 -8
  58. package/components/display/graph/visualizations/tree/BundleLine.js +108 -81
  59. package/components/display/graph/visualizations/tree/Triangle.js +13 -13
  60. package/components/display/graph/visualizations/tree/index.js +408 -306
  61. package/components/display/icons/Iconified.js +27 -12
  62. package/components/display/json/index.js +4 -4
  63. package/components/display/markdown/index.js +8678 -5770
  64. package/components/enrichment/EnrichPopover.js +54 -46
  65. package/components/fetchers/Fetcher.js +158 -119
  66. package/components/fetchers/PreviewModal.js +20 -17
  67. package/components/fetchers/StatusChip.js +21 -17
  68. package/components/group/Entry.js +13 -11
  69. package/components/group/Group.js +13 -10
  70. package/components/group/GroupControl.js +76 -65
  71. package/components/stats/QueryStatus.js +43 -33
  72. package/countBy-c6S3dvSW.js +14 -0
  73. package/data/event.js +6 -4
  74. package/database/index.js +2 -2
  75. package/debounce-bV0h5FC5.js +92 -0
  76. package/get-DSsNkRQs.js +8 -0
  77. package/groupBy-xqz-n0Vd.js +14 -0
  78. package/hooks/ClueActionContext.d.ts +10 -2
  79. package/hooks/ClueActionContext.js +6 -6
  80. package/hooks/ClueComponentContext.js +29 -23
  81. package/hooks/ClueConfigProvider.js +14 -12
  82. package/hooks/ClueDatabaseContext.js +19 -13
  83. package/hooks/ClueEnrichContext.js +8 -8
  84. package/hooks/ClueFetcherContext.js +83 -56
  85. package/hooks/ClueGroupContext.js +17 -14
  86. package/hooks/CluePopupContext.js +5 -5
  87. package/hooks/ClueProvider.js +12 -10
  88. package/hooks/selectors.js +7 -7
  89. package/hooks/useActionResult.d.ts +1 -0
  90. package/hooks/useActionResult.js +3 -3
  91. package/hooks/useAnnotations.js +47 -31
  92. package/hooks/useClue.js +6 -4
  93. package/hooks/useClueActions.js +3 -3
  94. package/hooks/useClueConfig.js +6 -4
  95. package/hooks/useClueTypeConfig.js +3 -3
  96. package/hooks/useComparator.js +722 -435
  97. package/hooks/useErrors.js +22 -18
  98. package/hooks/useFetcherResult.d.ts +1 -0
  99. package/hooks/useFetcherResult.js +33 -24
  100. package/hooks/useMyHighlights.js +66 -36
  101. package/hooks/useMyLocalStorage.js +66 -37
  102. package/iconify-CXMreGTg.js +1782 -0
  103. package/icons/Action.js +66 -49
  104. package/icons/Assessment.js +85 -69
  105. package/icons/Context.js +77 -63
  106. package/icons/Opinion.js +76 -60
  107. package/icons/iconMap.js +2 -2
  108. package/identity-CPGTqrE4.js +6 -0
  109. package/index-AMfoEg_6.js +696 -0
  110. package/index-B6C2a_Lg.js +1172 -0
  111. package/index-C12gPw2W.js +17698 -0
  112. package/index-DCKkHTvx.js +15750 -0
  113. package/index-JcKyZeoY.js +465 -0
  114. package/isNil-CIubwp4T.js +6 -0
  115. package/isObject-FTY-5JQX.js +7 -0
  116. package/isObjectLike-OAgjjZye.js +48 -0
  117. package/isSymbol-Xd2FsJyp.js +8 -0
  118. package/last-CUCl67Im.js +7 -0
  119. package/main.js +60 -60
  120. package/maxBy-IKHzFrCS.js +8 -0
  121. package/package.json +1 -1
  122. package/sortBy-DfSj8IoJ.js +96 -0
  123. package/sumBy-D-hb_NY-.js +8 -0
  124. package/text/Frequency.js +42 -23
  125. package/toFinite-Bc55msYj.js +16 -0
  126. package/toNumber-DPxy1FBy.js +39 -0
  127. package/types/RunningActionData.d.ts +1 -0
  128. package/types/WithActionData.d.ts +1 -0
  129. package/useClueTypeConfig-Z1LFp01b.js +3289 -0
  130. package/utils/chain.js +92 -65
  131. package/utils/classificationParser.js +519 -256
  132. package/utils/constants.js +35 -10
  133. package/utils/graph.js +72 -45
  134. package/utils/hashUtil.js +7 -7
  135. package/utils/line.js +131 -81
  136. package/utils/loggerUtil.js +5 -3
  137. package/utils/sessionStorage.js +41 -27
  138. package/utils/time.js +423 -423
  139. package/utils/utils.js +9 -9
  140. package/utils/window.js +21 -10
  141. package/utils-HmNPuoDB.js +199 -0
  142. package/ActionForm-CwsfB99X.js +0 -4458
  143. package/AnnotationDetails-Bw2JdtTL.js +0 -160
  144. package/AnnotationPreview-BO7rVnOP.js +0 -140
  145. package/ClueEnrichContext-KqRuuWNS.js +0 -418
  146. package/FlexOne-BXWFOd1T.js +0 -6
  147. package/_MapCache-BiTi0iqu.js +0 -180
  148. package/_Uint8Array-BQNOM9Rr.js +0 -101
  149. package/_baseAssignValue-CNMLQZco.js +0 -20
  150. package/_baseClone-BnT-6pyM.js +0 -207
  151. package/_baseExtremum-Ca2EHgy2.js +0 -16
  152. package/_baseFlatten-Bfr_Molw.js +0 -72
  153. package/_baseGet-DSZygzyq.js +0 -79
  154. package/_baseIsEqual-VgvaAFZG.js +0 -147
  155. package/_baseIteratee-Dbfsw5z8.js +0 -95
  156. package/_baseSlice-M5RKzt1A.js +0 -10
  157. package/_baseSum-wEbgNeUs.js +0 -10
  158. package/_baseUniq-BJcj69PL.js +0 -79
  159. package/_commonjsHelpers-DaMA6jEr.js +0 -8
  160. package/_createAggregator-k3TuAnxT.js +0 -53
  161. package/_getPrototype-Cr1Mk7BC.js +0 -5
  162. package/_getTag-CK2Sffaq.js +0 -90
  163. package/_isIterateeCall-DkJP7Rbx.js +0 -13
  164. package/_setToArray-C7yMOeww.js +0 -29
  165. package/cloneDeep-CF8TtLHr.js +0 -8
  166. package/countBy-CdYegFSu.js +0 -8
  167. package/debounce-DryYcbJ4.js +0 -56
  168. package/get-CH7kz5Ix.js +0 -8
  169. package/groupBy-br8xmD2R.js +0 -8
  170. package/iconify-BBckr5AQ.js +0 -1263
  171. package/identity-ByMq8VxU.js +0 -6
  172. package/index-BHAe_V9n.js +0 -12768
  173. package/index-BK-zfYhR.js +0 -358
  174. package/index-CA5CUNZO.js +0 -975
  175. package/index-Dj5C04IX.js +0 -568
  176. package/index-p5_wX7q1.js +0 -11729
  177. package/isNil-CjWwlQS3.js +0 -6
  178. package/isObject-B53jY8Qg.js +0 -7
  179. package/isObjectLike-BatpeCIi.js +0 -29
  180. package/isSymbol-C3_SC0Qp.js +0 -8
  181. package/last-7CdUxN0r.js +0 -7
  182. package/maxBy-Bc0dYHcO.js +0 -8
  183. package/sortBy-DY2JBf9n.js +0 -75
  184. package/sumBy-DuMASLPd.js +0 -8
  185. package/toFinite-BMy6GObD.js +0 -14
  186. package/toNumber-YVhnnJv4.js +0 -31
  187. package/useClueTypeConfig-Ct9Ygter.js +0 -2292
  188. package/utils-DmwSUrum.js +0 -129
@@ -1,92 +1,116 @@
1
- import { useTheme as z } from "@mui/material";
2
- import { g as w } from "../get-CH7kz5Ix.js";
3
- import { i as B } from "../isNil-CjWwlQS3.js";
4
- function x(t) {
1
+ import { useTheme } from "@mui/material";
2
+ import { g as get } from "../get-DSsNkRQs.js";
3
+ import { i as isNil } from "../isNil-CIubwp4T.js";
4
+ function _typeof(obj) {
5
5
  "@babel/helpers - typeof";
6
- return x = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(r) {
7
- return typeof r;
8
- } : function(r) {
9
- return r && typeof Symbol == "function" && r.constructor === Symbol && r !== Symbol.prototype ? "symbol" : typeof r;
10
- }, x(t);
11
- }
12
- var L = /^\s+/, G = /\s+$/;
13
- function s(t, r) {
14
- if (t = t || "", r = r || {}, t instanceof s)
15
- return t;
16
- if (!(this instanceof s))
17
- return new s(t, r);
18
- var e = O(t);
19
- this._originalInput = t, this._r = e.r, this._g = e.g, this._b = e.b, this._a = e.a, this._roundA = Math.round(100 * this._a) / 100, this._format = r.format || e.format, this._gradientType = r.gradientType, this._r < 1 && (this._r = Math.round(this._r)), this._g < 1 && (this._g = Math.round(this._g)), this._b < 1 && (this._b = Math.round(this._b)), this._ok = e.ok;
20
- }
21
- s.prototype = {
22
- isDark: function() {
6
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
7
+ return typeof obj2;
8
+ } : function(obj2) {
9
+ return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
10
+ }, _typeof(obj);
11
+ }
12
+ var trimLeft = /^\s+/;
13
+ var trimRight = /\s+$/;
14
+ function tinycolor(color, opts) {
15
+ color = color ? color : "";
16
+ opts = opts || {};
17
+ if (color instanceof tinycolor) {
18
+ return color;
19
+ }
20
+ if (!(this instanceof tinycolor)) {
21
+ return new tinycolor(color, opts);
22
+ }
23
+ var rgb = inputToRGB(color);
24
+ this._originalInput = color, this._r = rgb.r, this._g = rgb.g, this._b = rgb.b, this._a = rgb.a, this._roundA = Math.round(100 * this._a) / 100, this._format = opts.format || rgb.format;
25
+ this._gradientType = opts.gradientType;
26
+ if (this._r < 1) this._r = Math.round(this._r);
27
+ if (this._g < 1) this._g = Math.round(this._g);
28
+ if (this._b < 1) this._b = Math.round(this._b);
29
+ this._ok = rgb.ok;
30
+ }
31
+ tinycolor.prototype = {
32
+ isDark: function isDark() {
23
33
  return this.getBrightness() < 128;
24
34
  },
25
- isLight: function() {
35
+ isLight: function isLight() {
26
36
  return !this.isDark();
27
37
  },
28
- isValid: function() {
38
+ isValid: function isValid() {
29
39
  return this._ok;
30
40
  },
31
- getOriginalInput: function() {
41
+ getOriginalInput: function getOriginalInput() {
32
42
  return this._originalInput;
33
43
  },
34
- getFormat: function() {
44
+ getFormat: function getFormat() {
35
45
  return this._format;
36
46
  },
37
- getAlpha: function() {
47
+ getAlpha: function getAlpha() {
38
48
  return this._a;
39
49
  },
40
- getBrightness: function() {
41
- var r = this.toRgb();
42
- return (r.r * 299 + r.g * 587 + r.b * 114) / 1e3;
50
+ getBrightness: function getBrightness() {
51
+ var rgb = this.toRgb();
52
+ return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1e3;
43
53
  },
44
- getLuminance: function() {
45
- var r = this.toRgb(), e, n, i, a, f, u;
46
- return e = r.r / 255, n = r.g / 255, i = r.b / 255, e <= 0.03928 ? a = e / 12.92 : a = Math.pow((e + 0.055) / 1.055, 2.4), n <= 0.03928 ? f = n / 12.92 : f = Math.pow((n + 0.055) / 1.055, 2.4), i <= 0.03928 ? u = i / 12.92 : u = Math.pow((i + 0.055) / 1.055, 2.4), 0.2126 * a + 0.7152 * f + 0.0722 * u;
54
+ getLuminance: function getLuminance() {
55
+ var rgb = this.toRgb();
56
+ var RsRGB, GsRGB, BsRGB, R, G, B;
57
+ RsRGB = rgb.r / 255;
58
+ GsRGB = rgb.g / 255;
59
+ BsRGB = rgb.b / 255;
60
+ if (RsRGB <= 0.03928) R = RsRGB / 12.92;
61
+ else R = Math.pow((RsRGB + 0.055) / 1.055, 2.4);
62
+ if (GsRGB <= 0.03928) G = GsRGB / 12.92;
63
+ else G = Math.pow((GsRGB + 0.055) / 1.055, 2.4);
64
+ if (BsRGB <= 0.03928) B = BsRGB / 12.92;
65
+ else B = Math.pow((BsRGB + 0.055) / 1.055, 2.4);
66
+ return 0.2126 * R + 0.7152 * G + 0.0722 * B;
47
67
  },
48
- setAlpha: function(r) {
49
- return this._a = N(r), this._roundA = Math.round(100 * this._a) / 100, this;
68
+ setAlpha: function setAlpha(value) {
69
+ this._a = boundAlpha(value);
70
+ this._roundA = Math.round(100 * this._a) / 100;
71
+ return this;
50
72
  },
51
- toHsv: function() {
52
- var r = R(this._r, this._g, this._b);
73
+ toHsv: function toHsv() {
74
+ var hsv = rgbToHsv(this._r, this._g, this._b);
53
75
  return {
54
- h: r.h * 360,
55
- s: r.s,
56
- v: r.v,
76
+ h: hsv.h * 360,
77
+ s: hsv.s,
78
+ v: hsv.v,
57
79
  a: this._a
58
80
  };
59
81
  },
60
- toHsvString: function() {
61
- var r = R(this._r, this._g, this._b), e = Math.round(r.h * 360), n = Math.round(r.s * 100), i = Math.round(r.v * 100);
62
- return this._a == 1 ? "hsv(" + e + ", " + n + "%, " + i + "%)" : "hsva(" + e + ", " + n + "%, " + i + "%, " + this._roundA + ")";
82
+ toHsvString: function toHsvString() {
83
+ var hsv = rgbToHsv(this._r, this._g, this._b);
84
+ var h = Math.round(hsv.h * 360), s = Math.round(hsv.s * 100), v = Math.round(hsv.v * 100);
85
+ return this._a == 1 ? "hsv(" + h + ", " + s + "%, " + v + "%)" : "hsva(" + h + ", " + s + "%, " + v + "%, " + this._roundA + ")";
63
86
  },
64
- toHsl: function() {
65
- var r = H(this._r, this._g, this._b);
87
+ toHsl: function toHsl() {
88
+ var hsl = rgbToHsl(this._r, this._g, this._b);
66
89
  return {
67
- h: r.h * 360,
68
- s: r.s,
69
- l: r.l,
90
+ h: hsl.h * 360,
91
+ s: hsl.s,
92
+ l: hsl.l,
70
93
  a: this._a
71
94
  };
72
95
  },
73
- toHslString: function() {
74
- var r = H(this._r, this._g, this._b), e = Math.round(r.h * 360), n = Math.round(r.s * 100), i = Math.round(r.l * 100);
75
- return this._a == 1 ? "hsl(" + e + ", " + n + "%, " + i + "%)" : "hsla(" + e + ", " + n + "%, " + i + "%, " + this._roundA + ")";
96
+ toHslString: function toHslString() {
97
+ var hsl = rgbToHsl(this._r, this._g, this._b);
98
+ var h = Math.round(hsl.h * 360), s = Math.round(hsl.s * 100), l = Math.round(hsl.l * 100);
99
+ return this._a == 1 ? "hsl(" + h + ", " + s + "%, " + l + "%)" : "hsla(" + h + ", " + s + "%, " + l + "%, " + this._roundA + ")";
76
100
  },
77
- toHex: function(r) {
78
- return F(this._r, this._g, this._b, r);
101
+ toHex: function toHex(allow3Char) {
102
+ return rgbToHex(this._r, this._g, this._b, allow3Char);
79
103
  },
80
- toHexString: function(r) {
81
- return "#" + this.toHex(r);
104
+ toHexString: function toHexString(allow3Char) {
105
+ return "#" + this.toHex(allow3Char);
82
106
  },
83
- toHex8: function(r) {
84
- return U(this._r, this._g, this._b, this._a, r);
107
+ toHex8: function toHex8(allow4Char) {
108
+ return rgbaToHex(this._r, this._g, this._b, this._a, allow4Char);
85
109
  },
86
- toHex8String: function(r) {
87
- return "#" + this.toHex8(r);
110
+ toHex8String: function toHex8String(allow4Char) {
111
+ return "#" + this.toHex8(allow4Char);
88
112
  },
89
- toRgb: function() {
113
+ toRgb: function toRgb() {
90
114
  return {
91
115
  r: Math.round(this._r),
92
116
  g: Math.round(this._g),
@@ -94,339 +118,507 @@ s.prototype = {
94
118
  a: this._a
95
119
  };
96
120
  },
97
- toRgbString: function() {
121
+ toRgbString: function toRgbString() {
98
122
  return this._a == 1 ? "rgb(" + Math.round(this._r) + ", " + Math.round(this._g) + ", " + Math.round(this._b) + ")" : "rgba(" + Math.round(this._r) + ", " + Math.round(this._g) + ", " + Math.round(this._b) + ", " + this._roundA + ")";
99
123
  },
100
- toPercentageRgb: function() {
124
+ toPercentageRgb: function toPercentageRgb() {
101
125
  return {
102
- r: Math.round(g(this._r, 255) * 100) + "%",
103
- g: Math.round(g(this._g, 255) * 100) + "%",
104
- b: Math.round(g(this._b, 255) * 100) + "%",
126
+ r: Math.round(bound01(this._r, 255) * 100) + "%",
127
+ g: Math.round(bound01(this._g, 255) * 100) + "%",
128
+ b: Math.round(bound01(this._b, 255) * 100) + "%",
105
129
  a: this._a
106
130
  };
107
131
  },
108
- toPercentageRgbString: function() {
109
- return this._a == 1 ? "rgb(" + Math.round(g(this._r, 255) * 100) + "%, " + Math.round(g(this._g, 255) * 100) + "%, " + Math.round(g(this._b, 255) * 100) + "%)" : "rgba(" + Math.round(g(this._r, 255) * 100) + "%, " + Math.round(g(this._g, 255) * 100) + "%, " + Math.round(g(this._b, 255) * 100) + "%, " + this._roundA + ")";
132
+ toPercentageRgbString: function toPercentageRgbString() {
133
+ return this._a == 1 ? "rgb(" + Math.round(bound01(this._r, 255) * 100) + "%, " + Math.round(bound01(this._g, 255) * 100) + "%, " + Math.round(bound01(this._b, 255) * 100) + "%)" : "rgba(" + Math.round(bound01(this._r, 255) * 100) + "%, " + Math.round(bound01(this._g, 255) * 100) + "%, " + Math.round(bound01(this._b, 255) * 100) + "%, " + this._roundA + ")";
110
134
  },
111
- toName: function() {
112
- return this._a === 0 ? "transparent" : this._a < 1 ? !1 : rt[F(this._r, this._g, this._b, !0)] || !1;
135
+ toName: function toName() {
136
+ if (this._a === 0) {
137
+ return "transparent";
138
+ }
139
+ if (this._a < 1) {
140
+ return false;
141
+ }
142
+ return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false;
113
143
  },
114
- toFilter: function(r) {
115
- var e = "#" + C(this._r, this._g, this._b, this._a), n = e, i = this._gradientType ? "GradientType = 1, " : "";
116
- if (r) {
117
- var a = s(r);
118
- n = "#" + C(a._r, a._g, a._b, a._a);
144
+ toFilter: function toFilter(secondColor) {
145
+ var hex8String = "#" + rgbaToArgbHex(this._r, this._g, this._b, this._a);
146
+ var secondHex8String = hex8String;
147
+ var gradientType = this._gradientType ? "GradientType = 1, " : "";
148
+ if (secondColor) {
149
+ var s = tinycolor(secondColor);
150
+ secondHex8String = "#" + rgbaToArgbHex(s._r, s._g, s._b, s._a);
119
151
  }
120
- return "progid:DXImageTransform.Microsoft.gradient(" + i + "startColorstr=" + e + ",endColorstr=" + n + ")";
152
+ return "progid:DXImageTransform.Microsoft.gradient(" + gradientType + "startColorstr=" + hex8String + ",endColorstr=" + secondHex8String + ")";
121
153
  },
122
- toString: function(r) {
123
- var e = !!r;
124
- r = r || this._format;
125
- var n = !1, i = this._a < 1 && this._a >= 0, a = !e && i && (r === "hex" || r === "hex6" || r === "hex3" || r === "hex4" || r === "hex8" || r === "name");
126
- return a ? r === "name" && this._a === 0 ? this.toName() : this.toRgbString() : (r === "rgb" && (n = this.toRgbString()), r === "prgb" && (n = this.toPercentageRgbString()), (r === "hex" || r === "hex6") && (n = this.toHexString()), r === "hex3" && (n = this.toHexString(!0)), r === "hex4" && (n = this.toHex8String(!0)), r === "hex8" && (n = this.toHex8String()), r === "name" && (n = this.toName()), r === "hsl" && (n = this.toHslString()), r === "hsv" && (n = this.toHsvString()), n || this.toHexString());
154
+ toString: function toString(format) {
155
+ var formatSet = !!format;
156
+ format = format || this._format;
157
+ var formattedString = false;
158
+ var hasAlpha = this._a < 1 && this._a >= 0;
159
+ var needsAlphaFormat = !formatSet && hasAlpha && (format === "hex" || format === "hex6" || format === "hex3" || format === "hex4" || format === "hex8" || format === "name");
160
+ if (needsAlphaFormat) {
161
+ if (format === "name" && this._a === 0) {
162
+ return this.toName();
163
+ }
164
+ return this.toRgbString();
165
+ }
166
+ if (format === "rgb") {
167
+ formattedString = this.toRgbString();
168
+ }
169
+ if (format === "prgb") {
170
+ formattedString = this.toPercentageRgbString();
171
+ }
172
+ if (format === "hex" || format === "hex6") {
173
+ formattedString = this.toHexString();
174
+ }
175
+ if (format === "hex3") {
176
+ formattedString = this.toHexString(true);
177
+ }
178
+ if (format === "hex4") {
179
+ formattedString = this.toHex8String(true);
180
+ }
181
+ if (format === "hex8") {
182
+ formattedString = this.toHex8String();
183
+ }
184
+ if (format === "name") {
185
+ formattedString = this.toName();
186
+ }
187
+ if (format === "hsl") {
188
+ formattedString = this.toHslString();
189
+ }
190
+ if (format === "hsv") {
191
+ formattedString = this.toHsvString();
192
+ }
193
+ return formattedString || this.toHexString();
127
194
  },
128
- clone: function() {
129
- return s(this.toString());
195
+ clone: function clone() {
196
+ return tinycolor(this.toString());
130
197
  },
131
- _applyModification: function(r, e) {
132
- var n = r.apply(null, [this].concat([].slice.call(e)));
133
- return this._r = n._r, this._g = n._g, this._b = n._b, this.setAlpha(n._a), this;
198
+ _applyModification: function _applyModification(fn, args) {
199
+ var color = fn.apply(null, [this].concat([].slice.call(args)));
200
+ this._r = color._r;
201
+ this._g = color._g;
202
+ this._b = color._b;
203
+ this.setAlpha(color._a);
204
+ return this;
134
205
  },
135
- lighten: function() {
136
- return this._applyModification(X, arguments);
206
+ lighten: function lighten() {
207
+ return this._applyModification(_lighten, arguments);
137
208
  },
138
- brighten: function() {
139
- return this._applyModification(Z, arguments);
209
+ brighten: function brighten() {
210
+ return this._applyModification(_brighten, arguments);
140
211
  },
141
- darken: function() {
142
- return this._applyModification(J, arguments);
212
+ darken: function darken() {
213
+ return this._applyModification(_darken, arguments);
143
214
  },
144
- desaturate: function() {
145
- return this._applyModification($, arguments);
215
+ desaturate: function desaturate() {
216
+ return this._applyModification(_desaturate, arguments);
146
217
  },
147
- saturate: function() {
148
- return this._applyModification(j, arguments);
218
+ saturate: function saturate() {
219
+ return this._applyModification(_saturate, arguments);
149
220
  },
150
- greyscale: function() {
151
- return this._applyModification(W, arguments);
221
+ greyscale: function greyscale() {
222
+ return this._applyModification(_greyscale, arguments);
152
223
  },
153
- spin: function() {
154
- return this._applyModification(K, arguments);
224
+ spin: function spin() {
225
+ return this._applyModification(_spin, arguments);
155
226
  },
156
- _applyCombination: function(r, e) {
157
- return r.apply(null, [this].concat([].slice.call(e)));
227
+ _applyCombination: function _applyCombination(fn, args) {
228
+ return fn.apply(null, [this].concat([].slice.call(args)));
158
229
  },
159
- analogous: function() {
160
- return this._applyCombination(tt, arguments);
230
+ analogous: function analogous() {
231
+ return this._applyCombination(_analogous, arguments);
161
232
  },
162
- complement: function() {
163
- return this._applyCombination(Q, arguments);
233
+ complement: function complement() {
234
+ return this._applyCombination(_complement, arguments);
164
235
  },
165
- monochromatic: function() {
166
- return this._applyCombination(et, arguments);
236
+ monochromatic: function monochromatic() {
237
+ return this._applyCombination(_monochromatic, arguments);
167
238
  },
168
- splitcomplement: function() {
169
- return this._applyCombination(Y, arguments);
239
+ splitcomplement: function splitcomplement() {
240
+ return this._applyCombination(_splitcomplement, arguments);
170
241
  },
171
242
  // Disabled until https://github.com/bgrins/TinyColor/issues/254
172
243
  // polyad: function (number) {
173
244
  // return this._applyCombination(polyad, [number]);
174
245
  // },
175
- triad: function() {
176
- return this._applyCombination(T, [3]);
246
+ triad: function triad() {
247
+ return this._applyCombination(polyad, [3]);
177
248
  },
178
- tetrad: function() {
179
- return this._applyCombination(T, [4]);
249
+ tetrad: function tetrad() {
250
+ return this._applyCombination(polyad, [4]);
180
251
  }
181
252
  };
182
- s.fromRatio = function(t, r) {
183
- if (x(t) == "object") {
184
- var e = {};
185
- for (var n in t)
186
- t.hasOwnProperty(n) && (n === "a" ? e[n] = t[n] : e[n] = M(t[n]));
187
- t = e;
188
- }
189
- return s(t, r);
253
+ tinycolor.fromRatio = function(color, opts) {
254
+ if (_typeof(color) == "object") {
255
+ var newColor = {};
256
+ for (var i in color) {
257
+ if (color.hasOwnProperty(i)) {
258
+ if (i === "a") {
259
+ newColor[i] = color[i];
260
+ } else {
261
+ newColor[i] = convertToPercentage(color[i]);
262
+ }
263
+ }
264
+ }
265
+ color = newColor;
266
+ }
267
+ return tinycolor(color, opts);
190
268
  };
191
- function O(t) {
192
- var r = {
269
+ function inputToRGB(color) {
270
+ var rgb = {
193
271
  r: 0,
194
272
  g: 0,
195
273
  b: 0
196
- }, e = 1, n = null, i = null, a = null, f = !1, u = !1;
197
- return typeof t == "string" && (t = st(t)), x(t) == "object" && (_(t.r) && _(t.g) && _(t.b) ? (r = V(t.r, t.g, t.b), f = !0, u = String(t.r).substr(-1) === "%" ? "prgb" : "rgb") : _(t.h) && _(t.s) && _(t.v) ? (n = M(t.s), i = M(t.v), r = D(t.h, n, i), f = !0, u = "hsv") : _(t.h) && _(t.s) && _(t.l) && (n = M(t.s), a = M(t.l), r = q(t.h, n, a), f = !0, u = "hsl"), t.hasOwnProperty("a") && (e = t.a)), e = N(e), {
198
- ok: f,
199
- format: t.format || u,
200
- r: Math.min(255, Math.max(r.r, 0)),
201
- g: Math.min(255, Math.max(r.g, 0)),
202
- b: Math.min(255, Math.max(r.b, 0)),
203
- a: e
274
+ };
275
+ var a = 1;
276
+ var s = null;
277
+ var v = null;
278
+ var l = null;
279
+ var ok = false;
280
+ var format = false;
281
+ if (typeof color == "string") {
282
+ color = stringInputToObject(color);
283
+ }
284
+ if (_typeof(color) == "object") {
285
+ if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {
286
+ rgb = rgbToRgb(color.r, color.g, color.b);
287
+ ok = true;
288
+ format = String(color.r).substr(-1) === "%" ? "prgb" : "rgb";
289
+ } else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {
290
+ s = convertToPercentage(color.s);
291
+ v = convertToPercentage(color.v);
292
+ rgb = hsvToRgb(color.h, s, v);
293
+ ok = true;
294
+ format = "hsv";
295
+ } else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {
296
+ s = convertToPercentage(color.s);
297
+ l = convertToPercentage(color.l);
298
+ rgb = hslToRgb(color.h, s, l);
299
+ ok = true;
300
+ format = "hsl";
301
+ }
302
+ if (color.hasOwnProperty("a")) {
303
+ a = color.a;
304
+ }
305
+ }
306
+ a = boundAlpha(a);
307
+ return {
308
+ ok,
309
+ format: color.format || format,
310
+ r: Math.min(255, Math.max(rgb.r, 0)),
311
+ g: Math.min(255, Math.max(rgb.g, 0)),
312
+ b: Math.min(255, Math.max(rgb.b, 0)),
313
+ a
204
314
  };
205
315
  }
206
- function V(t, r, e) {
316
+ function rgbToRgb(r, g, b) {
207
317
  return {
208
- r: g(t, 255) * 255,
209
- g: g(r, 255) * 255,
210
- b: g(e, 255) * 255
318
+ r: bound01(r, 255) * 255,
319
+ g: bound01(g, 255) * 255,
320
+ b: bound01(b, 255) * 255
211
321
  };
212
322
  }
213
- function H(t, r, e) {
214
- t = g(t, 255), r = g(r, 255), e = g(e, 255);
215
- var n = Math.max(t, r, e), i = Math.min(t, r, e), a, f, u = (n + i) / 2;
216
- if (n == i)
217
- a = f = 0;
218
- else {
219
- var l = n - i;
220
- switch (f = u > 0.5 ? l / (2 - n - i) : l / (n + i), n) {
221
- case t:
222
- a = (r - e) / l + (r < e ? 6 : 0);
223
- break;
323
+ function rgbToHsl(r, g, b) {
324
+ r = bound01(r, 255);
325
+ g = bound01(g, 255);
326
+ b = bound01(b, 255);
327
+ var max = Math.max(r, g, b), min = Math.min(r, g, b);
328
+ var h, s, l = (max + min) / 2;
329
+ if (max == min) {
330
+ h = s = 0;
331
+ } else {
332
+ var d = max - min;
333
+ s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
334
+ switch (max) {
224
335
  case r:
225
- a = (e - t) / l + 2;
336
+ h = (g - b) / d + (g < b ? 6 : 0);
337
+ break;
338
+ case g:
339
+ h = (b - r) / d + 2;
226
340
  break;
227
- case e:
228
- a = (t - r) / l + 4;
341
+ case b:
342
+ h = (r - g) / d + 4;
229
343
  break;
230
344
  }
231
- a /= 6;
345
+ h /= 6;
232
346
  }
233
347
  return {
234
- h: a,
235
- s: f,
236
- l: u
348
+ h,
349
+ s,
350
+ l
237
351
  };
238
352
  }
239
- function q(t, r, e) {
240
- var n, i, a;
241
- t = g(t, 360), r = g(r, 100), e = g(e, 100);
242
- function f(h, c, o) {
243
- return o < 0 && (o += 1), o > 1 && (o -= 1), o < 1 / 6 ? h + (c - h) * 6 * o : o < 1 / 2 ? c : o < 2 / 3 ? h + (c - h) * (2 / 3 - o) * 6 : h;
353
+ function hslToRgb(h, s, l) {
354
+ var r, g, b;
355
+ h = bound01(h, 360);
356
+ s = bound01(s, 100);
357
+ l = bound01(l, 100);
358
+ function hue2rgb(p2, q2, t) {
359
+ if (t < 0) t += 1;
360
+ if (t > 1) t -= 1;
361
+ if (t < 1 / 6) return p2 + (q2 - p2) * 6 * t;
362
+ if (t < 1 / 2) return q2;
363
+ if (t < 2 / 3) return p2 + (q2 - p2) * (2 / 3 - t) * 6;
364
+ return p2;
244
365
  }
245
- if (r === 0)
246
- n = i = a = e;
247
- else {
248
- var u = e < 0.5 ? e * (1 + r) : e + r - e * r, l = 2 * e - u;
249
- n = f(l, u, t + 1 / 3), i = f(l, u, t), a = f(l, u, t - 1 / 3);
366
+ if (s === 0) {
367
+ r = g = b = l;
368
+ } else {
369
+ var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
370
+ var p = 2 * l - q;
371
+ r = hue2rgb(p, q, h + 1 / 3);
372
+ g = hue2rgb(p, q, h);
373
+ b = hue2rgb(p, q, h - 1 / 3);
250
374
  }
251
375
  return {
252
- r: n * 255,
253
- g: i * 255,
254
- b: a * 255
376
+ r: r * 255,
377
+ g: g * 255,
378
+ b: b * 255
255
379
  };
256
380
  }
257
- function R(t, r, e) {
258
- t = g(t, 255), r = g(r, 255), e = g(e, 255);
259
- var n = Math.max(t, r, e), i = Math.min(t, r, e), a, f, u = n, l = n - i;
260
- if (f = n === 0 ? 0 : l / n, n == i)
261
- a = 0;
262
- else {
263
- switch (n) {
264
- case t:
265
- a = (r - e) / l + (r < e ? 6 : 0);
266
- break;
381
+ function rgbToHsv(r, g, b) {
382
+ r = bound01(r, 255);
383
+ g = bound01(g, 255);
384
+ b = bound01(b, 255);
385
+ var max = Math.max(r, g, b), min = Math.min(r, g, b);
386
+ var h, s, v = max;
387
+ var d = max - min;
388
+ s = max === 0 ? 0 : d / max;
389
+ if (max == min) {
390
+ h = 0;
391
+ } else {
392
+ switch (max) {
267
393
  case r:
268
- a = (e - t) / l + 2;
394
+ h = (g - b) / d + (g < b ? 6 : 0);
395
+ break;
396
+ case g:
397
+ h = (b - r) / d + 2;
269
398
  break;
270
- case e:
271
- a = (t - r) / l + 4;
399
+ case b:
400
+ h = (r - g) / d + 4;
272
401
  break;
273
402
  }
274
- a /= 6;
403
+ h /= 6;
275
404
  }
276
405
  return {
277
- h: a,
278
- s: f,
279
- v: u
406
+ h,
407
+ s,
408
+ v
280
409
  };
281
410
  }
282
- function D(t, r, e) {
283
- t = g(t, 360) * 6, r = g(r, 100), e = g(e, 100);
284
- var n = Math.floor(t), i = t - n, a = e * (1 - r), f = e * (1 - i * r), u = e * (1 - (1 - i) * r), l = n % 6, h = [e, f, a, a, u, e][l], c = [u, e, e, f, a, a][l], o = [a, a, u, e, e, f][l];
411
+ function hsvToRgb(h, s, v) {
412
+ h = bound01(h, 360) * 6;
413
+ s = bound01(s, 100);
414
+ v = bound01(v, 100);
415
+ var i = Math.floor(h), f = h - i, p = v * (1 - s), q = v * (1 - f * s), t = v * (1 - (1 - f) * s), mod = i % 6, r = [v, q, p, p, t, v][mod], g = [t, v, v, q, p, p][mod], b = [p, p, t, v, v, q][mod];
285
416
  return {
286
- r: h * 255,
287
- g: c * 255,
288
- b: o * 255
417
+ r: r * 255,
418
+ g: g * 255,
419
+ b: b * 255
289
420
  };
290
421
  }
291
- function F(t, r, e, n) {
292
- var i = [m(Math.round(t).toString(16)), m(Math.round(r).toString(16)), m(Math.round(e).toString(16))];
293
- return n && i[0].charAt(0) == i[0].charAt(1) && i[1].charAt(0) == i[1].charAt(1) && i[2].charAt(0) == i[2].charAt(1) ? i[0].charAt(0) + i[1].charAt(0) + i[2].charAt(0) : i.join("");
422
+ function rgbToHex(r, g, b, allow3Char) {
423
+ var hex = [pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16))];
424
+ if (allow3Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1)) {
425
+ return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
426
+ }
427
+ return hex.join("");
294
428
  }
295
- function U(t, r, e, n, i) {
296
- var a = [m(Math.round(t).toString(16)), m(Math.round(r).toString(16)), m(Math.round(e).toString(16)), m(E(n))];
297
- return i && a[0].charAt(0) == a[0].charAt(1) && a[1].charAt(0) == a[1].charAt(1) && a[2].charAt(0) == a[2].charAt(1) && a[3].charAt(0) == a[3].charAt(1) ? a[0].charAt(0) + a[1].charAt(0) + a[2].charAt(0) + a[3].charAt(0) : a.join("");
429
+ function rgbaToHex(r, g, b, a, allow4Char) {
430
+ var hex = [pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16)), pad2(convertDecimalToHex(a))];
431
+ if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {
432
+ return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);
433
+ }
434
+ return hex.join("");
298
435
  }
299
- function C(t, r, e, n) {
300
- var i = [m(E(n)), m(Math.round(t).toString(16)), m(Math.round(r).toString(16)), m(Math.round(e).toString(16))];
301
- return i.join("");
436
+ function rgbaToArgbHex(r, g, b, a) {
437
+ var hex = [pad2(convertDecimalToHex(a)), pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16))];
438
+ return hex.join("");
302
439
  }
303
- s.equals = function(t, r) {
304
- return !t || !r ? !1 : s(t).toRgbString() == s(r).toRgbString();
440
+ tinycolor.equals = function(color1, color2) {
441
+ if (!color1 || !color2) return false;
442
+ return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString();
305
443
  };
306
- s.random = function() {
307
- return s.fromRatio({
444
+ tinycolor.random = function() {
445
+ return tinycolor.fromRatio({
308
446
  r: Math.random(),
309
447
  g: Math.random(),
310
448
  b: Math.random()
311
449
  });
312
450
  };
313
- function $(t, r) {
314
- r = r === 0 ? 0 : r || 10;
315
- var e = s(t).toHsl();
316
- return e.s -= r / 100, e.s = A(e.s), s(e);
317
- }
318
- function j(t, r) {
319
- r = r === 0 ? 0 : r || 10;
320
- var e = s(t).toHsl();
321
- return e.s += r / 100, e.s = A(e.s), s(e);
322
- }
323
- function W(t) {
324
- return s(t).desaturate(100);
325
- }
326
- function X(t, r) {
327
- r = r === 0 ? 0 : r || 10;
328
- var e = s(t).toHsl();
329
- return e.l += r / 100, e.l = A(e.l), s(e);
330
- }
331
- function Z(t, r) {
332
- r = r === 0 ? 0 : r || 10;
333
- var e = s(t).toRgb();
334
- return e.r = Math.max(0, Math.min(255, e.r - Math.round(255 * -(r / 100)))), e.g = Math.max(0, Math.min(255, e.g - Math.round(255 * -(r / 100)))), e.b = Math.max(0, Math.min(255, e.b - Math.round(255 * -(r / 100)))), s(e);
335
- }
336
- function J(t, r) {
337
- r = r === 0 ? 0 : r || 10;
338
- var e = s(t).toHsl();
339
- return e.l -= r / 100, e.l = A(e.l), s(e);
340
- }
341
- function K(t, r) {
342
- var e = s(t).toHsl(), n = (e.h + r) % 360;
343
- return e.h = n < 0 ? 360 + n : n, s(e);
344
- }
345
- function Q(t) {
346
- var r = s(t).toHsl();
347
- return r.h = (r.h + 180) % 360, s(r);
348
- }
349
- function T(t, r) {
350
- if (isNaN(r) || r <= 0)
451
+ function _desaturate(color, amount) {
452
+ amount = amount === 0 ? 0 : amount || 10;
453
+ var hsl = tinycolor(color).toHsl();
454
+ hsl.s -= amount / 100;
455
+ hsl.s = clamp01(hsl.s);
456
+ return tinycolor(hsl);
457
+ }
458
+ function _saturate(color, amount) {
459
+ amount = amount === 0 ? 0 : amount || 10;
460
+ var hsl = tinycolor(color).toHsl();
461
+ hsl.s += amount / 100;
462
+ hsl.s = clamp01(hsl.s);
463
+ return tinycolor(hsl);
464
+ }
465
+ function _greyscale(color) {
466
+ return tinycolor(color).desaturate(100);
467
+ }
468
+ function _lighten(color, amount) {
469
+ amount = amount === 0 ? 0 : amount || 10;
470
+ var hsl = tinycolor(color).toHsl();
471
+ hsl.l += amount / 100;
472
+ hsl.l = clamp01(hsl.l);
473
+ return tinycolor(hsl);
474
+ }
475
+ function _brighten(color, amount) {
476
+ amount = amount === 0 ? 0 : amount || 10;
477
+ var rgb = tinycolor(color).toRgb();
478
+ rgb.r = Math.max(0, Math.min(255, rgb.r - Math.round(255 * -(amount / 100))));
479
+ rgb.g = Math.max(0, Math.min(255, rgb.g - Math.round(255 * -(amount / 100))));
480
+ rgb.b = Math.max(0, Math.min(255, rgb.b - Math.round(255 * -(amount / 100))));
481
+ return tinycolor(rgb);
482
+ }
483
+ function _darken(color, amount) {
484
+ amount = amount === 0 ? 0 : amount || 10;
485
+ var hsl = tinycolor(color).toHsl();
486
+ hsl.l -= amount / 100;
487
+ hsl.l = clamp01(hsl.l);
488
+ return tinycolor(hsl);
489
+ }
490
+ function _spin(color, amount) {
491
+ var hsl = tinycolor(color).toHsl();
492
+ var hue = (hsl.h + amount) % 360;
493
+ hsl.h = hue < 0 ? 360 + hue : hue;
494
+ return tinycolor(hsl);
495
+ }
496
+ function _complement(color) {
497
+ var hsl = tinycolor(color).toHsl();
498
+ hsl.h = (hsl.h + 180) % 360;
499
+ return tinycolor(hsl);
500
+ }
501
+ function polyad(color, number) {
502
+ if (isNaN(number) || number <= 0) {
351
503
  throw new Error("Argument to polyad must be a positive number");
352
- for (var e = s(t).toHsl(), n = [s(t)], i = 360 / r, a = 1; a < r; a++)
353
- n.push(s({
354
- h: (e.h + a * i) % 360,
355
- s: e.s,
356
- l: e.l
504
+ }
505
+ var hsl = tinycolor(color).toHsl();
506
+ var result = [tinycolor(color)];
507
+ var step = 360 / number;
508
+ for (var i = 1; i < number; i++) {
509
+ result.push(tinycolor({
510
+ h: (hsl.h + i * step) % 360,
511
+ s: hsl.s,
512
+ l: hsl.l
357
513
  }));
358
- return n;
514
+ }
515
+ return result;
359
516
  }
360
- function Y(t) {
361
- var r = s(t).toHsl(), e = r.h;
362
- return [s(t), s({
363
- h: (e + 72) % 360,
364
- s: r.s,
365
- l: r.l
366
- }), s({
367
- h: (e + 216) % 360,
368
- s: r.s,
369
- l: r.l
517
+ function _splitcomplement(color) {
518
+ var hsl = tinycolor(color).toHsl();
519
+ var h = hsl.h;
520
+ return [tinycolor(color), tinycolor({
521
+ h: (h + 72) % 360,
522
+ s: hsl.s,
523
+ l: hsl.l
524
+ }), tinycolor({
525
+ h: (h + 216) % 360,
526
+ s: hsl.s,
527
+ l: hsl.l
370
528
  })];
371
529
  }
372
- function tt(t, r, e) {
373
- r = r || 6, e = e || 30;
374
- var n = s(t).toHsl(), i = 360 / e, a = [s(t)];
375
- for (n.h = (n.h - (i * r >> 1) + 720) % 360; --r; )
376
- n.h = (n.h + i) % 360, a.push(s(n));
377
- return a;
530
+ function _analogous(color, results, slices) {
531
+ results = results || 6;
532
+ slices = slices || 30;
533
+ var hsl = tinycolor(color).toHsl();
534
+ var part = 360 / slices;
535
+ var ret = [tinycolor(color)];
536
+ for (hsl.h = (hsl.h - (part * results >> 1) + 720) % 360; --results; ) {
537
+ hsl.h = (hsl.h + part) % 360;
538
+ ret.push(tinycolor(hsl));
539
+ }
540
+ return ret;
378
541
  }
379
- function et(t, r) {
380
- r = r || 6;
381
- for (var e = s(t).toHsv(), n = e.h, i = e.s, a = e.v, f = [], u = 1 / r; r--; )
382
- f.push(s({
383
- h: n,
384
- s: i,
385
- v: a
386
- })), a = (a + u) % 1;
387
- return f;
388
- }
389
- s.mix = function(t, r, e) {
390
- e = e === 0 ? 0 : e || 50;
391
- var n = s(t).toRgb(), i = s(r).toRgb(), a = e / 100, f = {
392
- r: (i.r - n.r) * a + n.r,
393
- g: (i.g - n.g) * a + n.g,
394
- b: (i.b - n.b) * a + n.b,
395
- a: (i.a - n.a) * a + n.a
542
+ function _monochromatic(color, results) {
543
+ results = results || 6;
544
+ var hsv = tinycolor(color).toHsv();
545
+ var h = hsv.h, s = hsv.s, v = hsv.v;
546
+ var ret = [];
547
+ var modification = 1 / results;
548
+ while (results--) {
549
+ ret.push(tinycolor({
550
+ h,
551
+ s,
552
+ v
553
+ }));
554
+ v = (v + modification) % 1;
555
+ }
556
+ return ret;
557
+ }
558
+ tinycolor.mix = function(color1, color2, amount) {
559
+ amount = amount === 0 ? 0 : amount || 50;
560
+ var rgb1 = tinycolor(color1).toRgb();
561
+ var rgb2 = tinycolor(color2).toRgb();
562
+ var p = amount / 100;
563
+ var rgba = {
564
+ r: (rgb2.r - rgb1.r) * p + rgb1.r,
565
+ g: (rgb2.g - rgb1.g) * p + rgb1.g,
566
+ b: (rgb2.b - rgb1.b) * p + rgb1.b,
567
+ a: (rgb2.a - rgb1.a) * p + rgb1.a
396
568
  };
397
- return s(f);
569
+ return tinycolor(rgba);
398
570
  };
399
- s.readability = function(t, r) {
400
- var e = s(t), n = s(r);
401
- return (Math.max(e.getLuminance(), n.getLuminance()) + 0.05) / (Math.min(e.getLuminance(), n.getLuminance()) + 0.05);
571
+ tinycolor.readability = function(color1, color2) {
572
+ var c1 = tinycolor(color1);
573
+ var c2 = tinycolor(color2);
574
+ return (Math.max(c1.getLuminance(), c2.getLuminance()) + 0.05) / (Math.min(c1.getLuminance(), c2.getLuminance()) + 0.05);
402
575
  };
403
- s.isReadable = function(t, r, e) {
404
- var n = s.readability(t, r), i, a;
405
- switch (a = !1, i = ht(e), i.level + i.size) {
576
+ tinycolor.isReadable = function(color1, color2, wcag2) {
577
+ var readability = tinycolor.readability(color1, color2);
578
+ var wcag2Parms, out;
579
+ out = false;
580
+ wcag2Parms = validateWCAG2Parms(wcag2);
581
+ switch (wcag2Parms.level + wcag2Parms.size) {
406
582
  case "AAsmall":
407
583
  case "AAAlarge":
408
- a = n >= 4.5;
584
+ out = readability >= 4.5;
409
585
  break;
410
586
  case "AAlarge":
411
- a = n >= 3;
587
+ out = readability >= 3;
412
588
  break;
413
589
  case "AAAsmall":
414
- a = n >= 7;
590
+ out = readability >= 7;
415
591
  break;
416
592
  }
417
- return a;
593
+ return out;
418
594
  };
419
- s.mostReadable = function(t, r, e) {
420
- var n = null, i = 0, a, f, u, l;
421
- e = e || {}, f = e.includeFallbackColors, u = e.level, l = e.size;
422
- for (var h = 0; h < r.length; h++)
423
- a = s.readability(t, r[h]), a > i && (i = a, n = s(r[h]));
424
- return s.isReadable(t, n, {
425
- level: u,
426
- size: l
427
- }) || !f ? n : (e.includeFallbackColors = !1, s.mostReadable(t, ["#fff", "#000"], e));
595
+ tinycolor.mostReadable = function(baseColor, colorList, args) {
596
+ var bestColor = null;
597
+ var bestScore = 0;
598
+ var readability;
599
+ var includeFallbackColors, level, size;
600
+ args = args || {};
601
+ includeFallbackColors = args.includeFallbackColors;
602
+ level = args.level;
603
+ size = args.size;
604
+ for (var i = 0; i < colorList.length; i++) {
605
+ readability = tinycolor.readability(baseColor, colorList[i]);
606
+ if (readability > bestScore) {
607
+ bestScore = readability;
608
+ bestColor = tinycolor(colorList[i]);
609
+ }
610
+ }
611
+ if (tinycolor.isReadable(baseColor, bestColor, {
612
+ level,
613
+ size
614
+ }) || !includeFallbackColors) {
615
+ return bestColor;
616
+ } else {
617
+ args.includeFallbackColors = false;
618
+ return tinycolor.mostReadable(baseColor, ["#fff", "#000"], args);
619
+ }
428
620
  };
429
- var S = s.names = {
621
+ var names = tinycolor.names = {
430
622
  aliceblue: "f0f8ff",
431
623
  antiquewhite: "faebd7",
432
624
  aqua: "0ff",
@@ -576,70 +768,93 @@ var S = s.names = {
576
768
  whitesmoke: "f5f5f5",
577
769
  yellow: "ff0",
578
770
  yellowgreen: "9acd32"
579
- }, rt = s.hexNames = nt(S);
580
- function nt(t) {
581
- var r = {};
582
- for (var e in t)
583
- t.hasOwnProperty(e) && (r[t[e]] = e);
584
- return r;
771
+ };
772
+ var hexNames = tinycolor.hexNames = flip(names);
773
+ function flip(o) {
774
+ var flipped = {};
775
+ for (var i in o) {
776
+ if (o.hasOwnProperty(i)) {
777
+ flipped[o[i]] = i;
778
+ }
779
+ }
780
+ return flipped;
585
781
  }
586
- function N(t) {
587
- return t = parseFloat(t), (isNaN(t) || t < 0 || t > 1) && (t = 1), t;
782
+ function boundAlpha(a) {
783
+ a = parseFloat(a);
784
+ if (isNaN(a) || a < 0 || a > 1) {
785
+ a = 1;
786
+ }
787
+ return a;
588
788
  }
589
- function g(t, r) {
590
- at(t) && (t = "100%");
591
- var e = it(t);
592
- return t = Math.min(r, Math.max(0, parseFloat(t))), e && (t = parseInt(t * r, 10) / 100), Math.abs(t - r) < 1e-6 ? 1 : t % r / parseFloat(r);
789
+ function bound01(n, max) {
790
+ if (isOnePointZero(n)) n = "100%";
791
+ var processPercent = isPercentage(n);
792
+ n = Math.min(max, Math.max(0, parseFloat(n)));
793
+ if (processPercent) {
794
+ n = parseInt(n * max, 10) / 100;
795
+ }
796
+ if (Math.abs(n - max) < 1e-6) {
797
+ return 1;
798
+ }
799
+ return n % max / parseFloat(max);
593
800
  }
594
- function A(t) {
595
- return Math.min(1, Math.max(0, t));
801
+ function clamp01(val) {
802
+ return Math.min(1, Math.max(0, val));
596
803
  }
597
- function b(t) {
598
- return parseInt(t, 16);
804
+ function parseIntFromHex(val) {
805
+ return parseInt(val, 16);
599
806
  }
600
- function at(t) {
601
- return typeof t == "string" && t.indexOf(".") != -1 && parseFloat(t) === 1;
807
+ function isOnePointZero(n) {
808
+ return typeof n == "string" && n.indexOf(".") != -1 && parseFloat(n) === 1;
602
809
  }
603
- function it(t) {
604
- return typeof t == "string" && t.indexOf("%") != -1;
810
+ function isPercentage(n) {
811
+ return typeof n === "string" && n.indexOf("%") != -1;
605
812
  }
606
- function m(t) {
607
- return t.length == 1 ? "0" + t : "" + t;
813
+ function pad2(c) {
814
+ return c.length == 1 ? "0" + c : "" + c;
608
815
  }
609
- function M(t) {
610
- return t <= 1 && (t = t * 100 + "%"), t;
816
+ function convertToPercentage(n) {
817
+ if (n <= 1) {
818
+ n = n * 100 + "%";
819
+ }
820
+ return n;
611
821
  }
612
- function E(t) {
613
- return Math.round(parseFloat(t) * 255).toString(16);
822
+ function convertDecimalToHex(d) {
823
+ return Math.round(parseFloat(d) * 255).toString(16);
614
824
  }
615
- function I(t) {
616
- return b(t) / 255;
825
+ function convertHexToDecimal(h) {
826
+ return parseIntFromHex(h) / 255;
617
827
  }
618
- var p = function() {
619
- var t = "[-\\+]?\\d+%?", r = "[-\\+]?\\d*\\.\\d+%?", e = "(?:" + r + ")|(?:" + t + ")", n = "[\\s|\\(]+(" + e + ")[,|\\s]+(" + e + ")[,|\\s]+(" + e + ")\\s*\\)?", i = "[\\s|\\(]+(" + e + ")[,|\\s]+(" + e + ")[,|\\s]+(" + e + ")[,|\\s]+(" + e + ")\\s*\\)?";
828
+ var matchers = function() {
829
+ var CSS_INTEGER = "[-\\+]?\\d+%?";
830
+ var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?";
831
+ var CSS_UNIT = "(?:" + CSS_NUMBER + ")|(?:" + CSS_INTEGER + ")";
832
+ var PERMISSIVE_MATCH3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
833
+ var PERMISSIVE_MATCH4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
620
834
  return {
621
- CSS_UNIT: new RegExp(e),
622
- rgb: new RegExp("rgb" + n),
623
- rgba: new RegExp("rgba" + i),
624
- hsl: new RegExp("hsl" + n),
625
- hsla: new RegExp("hsla" + i),
626
- hsv: new RegExp("hsv" + n),
627
- hsva: new RegExp("hsva" + i),
835
+ CSS_UNIT: new RegExp(CSS_UNIT),
836
+ rgb: new RegExp("rgb" + PERMISSIVE_MATCH3),
837
+ rgba: new RegExp("rgba" + PERMISSIVE_MATCH4),
838
+ hsl: new RegExp("hsl" + PERMISSIVE_MATCH3),
839
+ hsla: new RegExp("hsla" + PERMISSIVE_MATCH4),
840
+ hsv: new RegExp("hsv" + PERMISSIVE_MATCH3),
841
+ hsva: new RegExp("hsva" + PERMISSIVE_MATCH4),
628
842
  hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
629
843
  hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
630
844
  hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
631
845
  hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
632
846
  };
633
847
  }();
634
- function _(t) {
635
- return !!p.CSS_UNIT.exec(t);
636
- }
637
- function st(t) {
638
- t = t.replace(L, "").replace(G, "").toLowerCase();
639
- var r = !1;
640
- if (S[t])
641
- t = S[t], r = !0;
642
- else if (t == "transparent")
848
+ function isValidCSSUnit(color) {
849
+ return !!matchers.CSS_UNIT.exec(color);
850
+ }
851
+ function stringInputToObject(color) {
852
+ color = color.replace(trimLeft, "").replace(trimRight, "").toLowerCase();
853
+ var named = false;
854
+ if (names[color]) {
855
+ color = names[color];
856
+ named = true;
857
+ } else if (color == "transparent") {
643
858
  return {
644
859
  r: 0,
645
860
  g: 0,
@@ -647,127 +862,199 @@ function st(t) {
647
862
  a: 0,
648
863
  format: "name"
649
864
  };
650
- var e;
651
- return (e = p.rgb.exec(t)) ? {
652
- r: e[1],
653
- g: e[2],
654
- b: e[3]
655
- } : (e = p.rgba.exec(t)) ? {
656
- r: e[1],
657
- g: e[2],
658
- b: e[3],
659
- a: e[4]
660
- } : (e = p.hsl.exec(t)) ? {
661
- h: e[1],
662
- s: e[2],
663
- l: e[3]
664
- } : (e = p.hsla.exec(t)) ? {
665
- h: e[1],
666
- s: e[2],
667
- l: e[3],
668
- a: e[4]
669
- } : (e = p.hsv.exec(t)) ? {
670
- h: e[1],
671
- s: e[2],
672
- v: e[3]
673
- } : (e = p.hsva.exec(t)) ? {
674
- h: e[1],
675
- s: e[2],
676
- v: e[3],
677
- a: e[4]
678
- } : (e = p.hex8.exec(t)) ? {
679
- r: b(e[1]),
680
- g: b(e[2]),
681
- b: b(e[3]),
682
- a: I(e[4]),
683
- format: r ? "name" : "hex8"
684
- } : (e = p.hex6.exec(t)) ? {
685
- r: b(e[1]),
686
- g: b(e[2]),
687
- b: b(e[3]),
688
- format: r ? "name" : "hex"
689
- } : (e = p.hex4.exec(t)) ? {
690
- r: b(e[1] + "" + e[1]),
691
- g: b(e[2] + "" + e[2]),
692
- b: b(e[3] + "" + e[3]),
693
- a: I(e[4] + "" + e[4]),
694
- format: r ? "name" : "hex8"
695
- } : (e = p.hex3.exec(t)) ? {
696
- r: b(e[1] + "" + e[1]),
697
- g: b(e[2] + "" + e[2]),
698
- b: b(e[3] + "" + e[3]),
699
- format: r ? "name" : "hex"
700
- } : !1;
701
- }
702
- function ht(t) {
703
- var r, e;
704
- return t = t || {
865
+ }
866
+ var match;
867
+ if (match = matchers.rgb.exec(color)) {
868
+ return {
869
+ r: match[1],
870
+ g: match[2],
871
+ b: match[3]
872
+ };
873
+ }
874
+ if (match = matchers.rgba.exec(color)) {
875
+ return {
876
+ r: match[1],
877
+ g: match[2],
878
+ b: match[3],
879
+ a: match[4]
880
+ };
881
+ }
882
+ if (match = matchers.hsl.exec(color)) {
883
+ return {
884
+ h: match[1],
885
+ s: match[2],
886
+ l: match[3]
887
+ };
888
+ }
889
+ if (match = matchers.hsla.exec(color)) {
890
+ return {
891
+ h: match[1],
892
+ s: match[2],
893
+ l: match[3],
894
+ a: match[4]
895
+ };
896
+ }
897
+ if (match = matchers.hsv.exec(color)) {
898
+ return {
899
+ h: match[1],
900
+ s: match[2],
901
+ v: match[3]
902
+ };
903
+ }
904
+ if (match = matchers.hsva.exec(color)) {
905
+ return {
906
+ h: match[1],
907
+ s: match[2],
908
+ v: match[3],
909
+ a: match[4]
910
+ };
911
+ }
912
+ if (match = matchers.hex8.exec(color)) {
913
+ return {
914
+ r: parseIntFromHex(match[1]),
915
+ g: parseIntFromHex(match[2]),
916
+ b: parseIntFromHex(match[3]),
917
+ a: convertHexToDecimal(match[4]),
918
+ format: named ? "name" : "hex8"
919
+ };
920
+ }
921
+ if (match = matchers.hex6.exec(color)) {
922
+ return {
923
+ r: parseIntFromHex(match[1]),
924
+ g: parseIntFromHex(match[2]),
925
+ b: parseIntFromHex(match[3]),
926
+ format: named ? "name" : "hex"
927
+ };
928
+ }
929
+ if (match = matchers.hex4.exec(color)) {
930
+ return {
931
+ r: parseIntFromHex(match[1] + "" + match[1]),
932
+ g: parseIntFromHex(match[2] + "" + match[2]),
933
+ b: parseIntFromHex(match[3] + "" + match[3]),
934
+ a: convertHexToDecimal(match[4] + "" + match[4]),
935
+ format: named ? "name" : "hex8"
936
+ };
937
+ }
938
+ if (match = matchers.hex3.exec(color)) {
939
+ return {
940
+ r: parseIntFromHex(match[1] + "" + match[1]),
941
+ g: parseIntFromHex(match[2] + "" + match[2]),
942
+ b: parseIntFromHex(match[3] + "" + match[3]),
943
+ format: named ? "name" : "hex"
944
+ };
945
+ }
946
+ return false;
947
+ }
948
+ function validateWCAG2Parms(parms) {
949
+ var level, size;
950
+ parms = parms || {
705
951
  level: "AA",
706
952
  size: "small"
707
- }, r = (t.level || "AA").toUpperCase(), e = (t.size || "small").toLowerCase(), r !== "AA" && r !== "AAA" && (r = "AA"), e !== "small" && e !== "large" && (e = "small"), {
708
- level: r,
709
- size: e
953
+ };
954
+ level = (parms.level || "AA").toUpperCase();
955
+ size = (parms.size || "small").toLowerCase();
956
+ if (level !== "AA" && level !== "AAA") {
957
+ level = "AA";
958
+ }
959
+ if (size !== "small" && size !== "large") {
960
+ size = "small";
961
+ }
962
+ return {
963
+ level,
964
+ size
710
965
  };
711
966
  }
712
- const gt = () => {
713
- const t = z(), r = (h) => !h.type, e = (h) => h.type === "node", n = (h, c, o) => {
714
- var v, y;
715
- if (!c || !o)
716
- return !0;
717
- let d;
718
- switch (c) {
967
+ const useComparator = () => {
968
+ const theme = useTheme();
969
+ const isBaseComparator = (comparator) => {
970
+ return !comparator.type;
971
+ };
972
+ const isNodeStyler = (comparator) => {
973
+ return comparator.type === "node";
974
+ };
975
+ const runOperator = (value1, operator, value2) => {
976
+ var _a, _b;
977
+ if (!operator || !value2) {
978
+ return true;
979
+ }
980
+ let result;
981
+ switch (operator) {
719
982
  case "=": {
720
- d = (B(h) ? "" : h).toString() == (o == null ? void 0 : o.toString());
983
+ result = (isNil(value1) ? "" : value1).toString() == (value2 == null ? void 0 : value2.toString());
721
984
  break;
722
985
  }
723
986
  case "<": {
724
- d = parseFloat(h) < parseFloat(o);
987
+ result = parseFloat(value1) < parseFloat(value2);
725
988
  break;
726
989
  }
727
990
  case ">": {
728
- d = parseFloat(h) > parseFloat(o);
991
+ result = parseFloat(value1) > parseFloat(value2);
729
992
  break;
730
993
  }
731
994
  case "!=": {
732
- d = (h == null ? void 0 : h.toString()) != (o == null ? void 0 : o.toString());
995
+ result = (value1 == null ? void 0 : value1.toString()) != (value2 == null ? void 0 : value2.toString());
733
996
  break;
734
997
  }
735
998
  case "<=": {
736
- d = parseInt(h) <= parseInt(o);
999
+ result = parseInt(value1) <= parseInt(value2);
737
1000
  break;
738
1001
  }
739
1002
  case ">=": {
740
- d = parseInt(h) >= parseInt(o);
1003
+ result = parseInt(value1) >= parseInt(value2);
741
1004
  break;
742
1005
  }
743
1006
  case "~": {
744
- const k = ((v = h == null ? void 0 : h.toString) == null ? void 0 : v.call(h)) ?? "", P = ((y = o.toString) == null ? void 0 : y.call(o)) ?? "";
745
- d = !!k && k.toLowerCase().includes(P.toLowerCase());
1007
+ const strValue1 = ((_a = value1 == null ? void 0 : value1.toString) == null ? void 0 : _a.call(value1)) ?? "";
1008
+ const strValue2 = ((_b = value2.toString) == null ? void 0 : _b.call(value2)) ?? "";
1009
+ result = !!strValue1 && strValue1.toLowerCase().includes(strValue2.toLowerCase());
746
1010
  break;
747
1011
  }
748
- default:
749
- d = !1;
1012
+ default: {
1013
+ result = false;
1014
+ }
750
1015
  }
751
- return d;
752
- }, i = (h, c) => n(w(c, h.field), h.operator, h.value), a = (h, c) => {
753
- var v;
754
- const o = w(c, h.field);
755
- if (!n(o, h.operator, h.value))
1016
+ return result;
1017
+ };
1018
+ const runBaseComparator = (comparator, node) => runOperator(get(node, comparator.field), comparator.operator, comparator.value);
1019
+ const runNodeComparator = (comparator, node) => {
1020
+ var _a;
1021
+ const nodeValue = get(node, comparator.field);
1022
+ if (!runOperator(nodeValue, comparator.operator, comparator.value)) {
756
1023
  return {};
757
- const d = {};
758
- if (h.color) {
759
- const y = ((v = t.palette[h.color]) == null ? void 0 : v.main) ?? h.color;
760
- d.fill = y;
1024
+ }
1025
+ const styles = {};
1026
+ if (comparator.color) {
1027
+ const color = ((_a = theme.palette[comparator.color]) == null ? void 0 : _a.main) ?? comparator.color;
1028
+ styles.fill = color;
761
1029
  try {
762
- d.stroke = s(y).darken(10).toString();
1030
+ styles.stroke = tinycolor(color).darken(10).toString();
763
1031
  } catch {
764
- d.stroke = y;
1032
+ styles.stroke = color;
765
1033
  }
766
1034
  }
767
- return h.size && (d.strokeWidth = h.size, d.fontSize = h.size), d;
768
- }, f = (h, c, o) => ({}), u = (h, c, o) => r(h) ? i(h, c) : e(h) ? a(h, c) : f();
769
- return { runComparators: (h, c, o) => (h ?? []).map((d) => u(d, c)).reduce((d, v) => ({ ...d, ...v }), {}), runComparator: u };
1035
+ if (comparator.size) {
1036
+ styles.strokeWidth = comparator.size;
1037
+ styles.fontSize = comparator.size;
1038
+ }
1039
+ return styles;
1040
+ };
1041
+ const runEdgeComparator = (_comparator, _source, _target) => {
1042
+ return {};
1043
+ };
1044
+ const runComparator = (comparator, nodeOrSource, target) => {
1045
+ if (isBaseComparator(comparator)) {
1046
+ return runBaseComparator(comparator, nodeOrSource);
1047
+ }
1048
+ if (isNodeStyler(comparator)) {
1049
+ return runNodeComparator(comparator, nodeOrSource);
1050
+ }
1051
+ return runEdgeComparator();
1052
+ };
1053
+ const runComparators = (comparators, nodeOrSource, target) => {
1054
+ return (comparators ?? []).map((comparator) => runComparator(comparator, nodeOrSource)).reduce((acc, val) => ({ ...acc, ...val }), {});
1055
+ };
1056
+ return { runComparators, runComparator };
770
1057
  };
771
1058
  export {
772
- gt as default
1059
+ useComparator as default
773
1060
  };