@teselagen/ove 0.7.30-beta.1 → 0.7.30-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs.js +1739 -2203
- package/index.es.js +1739 -2203
- package/index.umd.js +1809 -2273
- package/package.json +15 -12
- package/selectors/orfsSelector.d.ts +2 -2
- package/selectors/translationsSelector.d.ts +1 -1
- package/src/AutoAnnotate.js +3 -3
- package/src/GlobalDialogUtils.js +2 -2
- package/src/ToolBar/alignmentTool.js +2 -2
- package/src/helperComponents/MergeFeaturesDialog/index.js +2 -2
- package/src/redux/alignments.js +2 -2
- package/src/redux/sequenceData/index.js +2 -2
- package/src/redux/sequenceData/upsertDeleteActionGenerator.js +2 -2
- package/src/selectors/cutsitesSelector.js +2 -2
- package/src/selectors/translationsSelector.js +3 -3
- package/src/utils/cleanSequenceData_DEPRECATED/arrayToObjWithIds.js +2 -2
- package/src/withEditorProps/index.js +2 -2
package/index.es.js
CHANGED
|
@@ -1516,10 +1516,10 @@ function debounce$2(fn5, ms) {
|
|
|
1516
1516
|
if (ms === 0) {
|
|
1517
1517
|
return fn5;
|
|
1518
1518
|
}
|
|
1519
|
-
var
|
|
1519
|
+
var timeout2;
|
|
1520
1520
|
return function(arg) {
|
|
1521
|
-
clearTimeout(
|
|
1522
|
-
|
|
1521
|
+
clearTimeout(timeout2);
|
|
1522
|
+
timeout2 = setTimeout(function() {
|
|
1523
1523
|
fn5(arg);
|
|
1524
1524
|
}, ms);
|
|
1525
1525
|
};
|
|
@@ -4637,19 +4637,15 @@ function requireClassnames() {
|
|
|
4637
4637
|
__name(requireClassnames, "requireClassnames");
|
|
4638
4638
|
var classnamesExports = requireClassnames();
|
|
4639
4639
|
const classNames = /* @__PURE__ */ getDefaultExportFromCjs(classnamesExports);
|
|
4640
|
-
|
|
4641
|
-
|
|
4642
|
-
|
|
4643
|
-
|
|
4644
|
-
|
|
4645
|
-
id2 +=
|
|
4646
|
-
} else if (byte > 62) {
|
|
4647
|
-
id2 += "-";
|
|
4648
|
-
} else {
|
|
4649
|
-
id2 += "_";
|
|
4640
|
+
const urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
4641
|
+
let nanoid = /* @__PURE__ */ __name((size = 21) => {
|
|
4642
|
+
let id2 = "";
|
|
4643
|
+
let bytes = crypto.getRandomValues(new Uint8Array(size |= 0));
|
|
4644
|
+
while (size--) {
|
|
4645
|
+
id2 += urlAlphabet[bytes[size] & 63];
|
|
4650
4646
|
}
|
|
4651
4647
|
return id2;
|
|
4652
|
-
}, "
|
|
4648
|
+
}, "nanoid");
|
|
4653
4649
|
var papaparse_min$1 = { exports: {} };
|
|
4654
4650
|
/* @license
|
|
4655
4651
|
Papa Parse
|
|
@@ -7051,7 +7047,7 @@ function baseClamp(number2, lower, upper) {
|
|
|
7051
7047
|
return number2;
|
|
7052
7048
|
}
|
|
7053
7049
|
__name(baseClamp, "baseClamp");
|
|
7054
|
-
function clamp$
|
|
7050
|
+
function clamp$4(number2, lower, upper) {
|
|
7055
7051
|
if (upper === void 0) {
|
|
7056
7052
|
upper = lower;
|
|
7057
7053
|
lower = void 0;
|
|
@@ -7066,7 +7062,7 @@ function clamp$3(number2, lower, upper) {
|
|
|
7066
7062
|
}
|
|
7067
7063
|
return baseClamp(toNumber(number2), lower, upper);
|
|
7068
7064
|
}
|
|
7069
|
-
__name(clamp$
|
|
7065
|
+
__name(clamp$4, "clamp$4");
|
|
7070
7066
|
function stackClear() {
|
|
7071
7067
|
this.__data__ = new ListCache();
|
|
7072
7068
|
this.size = 0;
|
|
@@ -8883,15 +8879,15 @@ function _objectWithoutPropertiesLoose$4(source, excluded) {
|
|
|
8883
8879
|
return target;
|
|
8884
8880
|
}
|
|
8885
8881
|
__name(_objectWithoutPropertiesLoose$4, "_objectWithoutPropertiesLoose$4");
|
|
8886
|
-
var lib$
|
|
8887
|
-
var hasRequiredLib$
|
|
8888
|
-
function requireLib$
|
|
8889
|
-
if (hasRequiredLib$
|
|
8890
|
-
hasRequiredLib$
|
|
8891
|
-
Object.defineProperty(lib$
|
|
8882
|
+
var lib$8 = {};
|
|
8883
|
+
var hasRequiredLib$8;
|
|
8884
|
+
function requireLib$8() {
|
|
8885
|
+
if (hasRequiredLib$8) return lib$8;
|
|
8886
|
+
hasRequiredLib$8 = 1;
|
|
8887
|
+
Object.defineProperty(lib$8, "__esModule", {
|
|
8892
8888
|
value: true
|
|
8893
8889
|
});
|
|
8894
|
-
lib$
|
|
8890
|
+
lib$8.createChangeEmitter = /* @__PURE__ */ __name(function createChangeEmitter() {
|
|
8895
8891
|
var currentListeners = [];
|
|
8896
8892
|
var nextListeners = currentListeners;
|
|
8897
8893
|
function ensureCanMutateNextListeners() {
|
|
@@ -8931,10 +8927,10 @@ function requireLib$9() {
|
|
|
8931
8927
|
emit
|
|
8932
8928
|
};
|
|
8933
8929
|
}, "createChangeEmitter");
|
|
8934
|
-
return lib$
|
|
8930
|
+
return lib$8;
|
|
8935
8931
|
}
|
|
8936
|
-
__name(requireLib$
|
|
8937
|
-
requireLib$
|
|
8932
|
+
__name(requireLib$8, "requireLib$8");
|
|
8933
|
+
requireLib$8();
|
|
8938
8934
|
function symbolObservablePonyfill(root2) {
|
|
8939
8935
|
var result;
|
|
8940
8936
|
var Symbol2 = root2.Symbol;
|
|
@@ -16671,11 +16667,14 @@ function isEntityClean(e) {
|
|
|
16671
16667
|
}
|
|
16672
16668
|
__name(isEntityClean, "isEntityClean");
|
|
16673
16669
|
const getIdOrCodeOrIndex = /* @__PURE__ */ __name((record, rowIndex) => {
|
|
16674
|
-
if (record.id || record.id === 0) {
|
|
16670
|
+
if ("id" in record && (record.id || record.id === 0)) {
|
|
16675
16671
|
return record.id;
|
|
16676
|
-
} else if (record.code) {
|
|
16672
|
+
} else if ("code" in record && record.code) {
|
|
16677
16673
|
return record.code;
|
|
16678
16674
|
} else {
|
|
16675
|
+
if (rowIndex === void 0 || rowIndex === null) {
|
|
16676
|
+
throw new Error("id, code, or rowIndex must be provided");
|
|
16677
|
+
}
|
|
16679
16678
|
return rowIndex;
|
|
16680
16679
|
}
|
|
16681
16680
|
}, "getIdOrCodeOrIndex");
|
|
@@ -16757,17 +16756,22 @@ const getFieldPathToField = /* @__PURE__ */ __name((schema2) => {
|
|
|
16757
16756
|
});
|
|
16758
16757
|
return fieldPathToField;
|
|
16759
16758
|
}, "getFieldPathToField");
|
|
16760
|
-
const formatPasteData = /* @__PURE__ */ __name(({
|
|
16759
|
+
const formatPasteData = /* @__PURE__ */ __name(({
|
|
16760
|
+
schema: schema2,
|
|
16761
|
+
newVal: newVal2,
|
|
16762
|
+
path: path2
|
|
16763
|
+
}) => {
|
|
16761
16764
|
const pathToField = getFieldPathToField(schema2);
|
|
16762
16765
|
const column = pathToField[path2];
|
|
16763
16766
|
if (column.type === "genericSelect") {
|
|
16764
|
-
|
|
16765
|
-
|
|
16767
|
+
const value = newVal2;
|
|
16768
|
+
if (value.__genSelCol === path2) {
|
|
16769
|
+
newVal2 = value.__strVal;
|
|
16766
16770
|
} else {
|
|
16767
16771
|
newVal2 = void 0;
|
|
16768
16772
|
}
|
|
16769
16773
|
} else {
|
|
16770
|
-
newVal2 =
|
|
16774
|
+
newVal2 = typeof newVal2 === "object" && newVal2 !== null && "__strVal" in newVal2 ? newVal2.__strVal : newVal2;
|
|
16771
16775
|
}
|
|
16772
16776
|
return newVal2;
|
|
16773
16777
|
}, "formatPasteData");
|
|
@@ -16792,14 +16796,15 @@ const endsWithNumber = /* @__PURE__ */ __name((str) => {
|
|
|
16792
16796
|
return /[0-9]+$/.test(str);
|
|
16793
16797
|
}, "endsWithNumber");
|
|
16794
16798
|
const getNumberStrAtEnd = /* @__PURE__ */ __name((str) => {
|
|
16799
|
+
var _a2;
|
|
16795
16800
|
if (endsWithNumber(str)) {
|
|
16796
|
-
return str.match(/[0-9]+$/)[0];
|
|
16801
|
+
return (_a2 = str.match(/[0-9]+$/)) == null ? void 0 : _a2[0];
|
|
16797
16802
|
}
|
|
16798
16803
|
return null;
|
|
16799
16804
|
}, "getNumberStrAtEnd");
|
|
16800
16805
|
const stripNumberAtEnd = /* @__PURE__ */ __name((str) => {
|
|
16801
16806
|
var _a2;
|
|
16802
|
-
return (_a2 = str == null ? void 0 : str.replace) == null ? void 0 : _a2.call(str, getNumberStrAtEnd(str), "");
|
|
16807
|
+
return (_a2 = str == null ? void 0 : str.replace) == null ? void 0 : _a2.call(str, getNumberStrAtEnd(str) || "", "");
|
|
16803
16808
|
}, "stripNumberAtEnd");
|
|
16804
16809
|
const getAllRows = /* @__PURE__ */ __name((tableRef) => {
|
|
16805
16810
|
var _a2, _b2;
|
|
@@ -16836,7 +16841,7 @@ const getNewEntToSelect = /* @__PURE__ */ __name(({
|
|
|
16836
16841
|
}, "getNewEntToSelect");
|
|
16837
16842
|
const getLastSelectedEntity = /* @__PURE__ */ __name((idMap) => {
|
|
16838
16843
|
let lastSelectedEnt;
|
|
16839
|
-
let latestTime;
|
|
16844
|
+
let latestTime = null;
|
|
16840
16845
|
Object.values(idMap).forEach(({ time, entity }) => {
|
|
16841
16846
|
if (!latestTime || time > latestTime) {
|
|
16842
16847
|
lastSelectedEnt = entity;
|
|
@@ -16876,9 +16881,9 @@ const getCellInfo = /* @__PURE__ */ __name(({
|
|
|
16876
16881
|
};
|
|
16877
16882
|
}, "getCellInfo");
|
|
16878
16883
|
const getCellCopyText = /* @__PURE__ */ __name((cellWrapper) => {
|
|
16879
|
-
const text2 = cellWrapper
|
|
16880
|
-
const jsonText = cellWrapper
|
|
16881
|
-
const textContent = text2 || cellWrapper.textContent || "";
|
|
16884
|
+
const text2 = cellWrapper == null ? void 0 : cellWrapper.getAttribute("data-copy-text");
|
|
16885
|
+
const jsonText = cellWrapper == null ? void 0 : cellWrapper.getAttribute("data-copy-json");
|
|
16886
|
+
const textContent = text2 || (cellWrapper == null ? void 0 : cellWrapper.textContent) || "";
|
|
16882
16887
|
return [textContent, jsonText];
|
|
16883
16888
|
}, "getCellCopyText");
|
|
16884
16889
|
const getRowCopyText = /* @__PURE__ */ __name((rowEl, { specificColumn } = {}) => {
|
|
@@ -17186,7 +17191,7 @@ function rowClick(e, rowInfo, entities, {
|
|
|
17186
17191
|
if (noSelect || isEntityDisabled(entity)) return;
|
|
17187
17192
|
const rowId = getIdOrCodeOrIndex(entity, rowInfo.index);
|
|
17188
17193
|
if (rowId === void 0) return;
|
|
17189
|
-
const
|
|
17194
|
+
const ctrl2 = e.metaKey || e.ctrlKey || withCheckboxes && !e.shiftKey;
|
|
17190
17195
|
const oldIdMap = reduxFormSelectedEntityIdMap || {};
|
|
17191
17196
|
const rowSelected = oldIdMap[rowId];
|
|
17192
17197
|
let newIdMap = {
|
|
@@ -17198,12 +17203,12 @@ function rowClick(e, rowInfo, entities, {
|
|
|
17198
17203
|
if (isSingleSelect) {
|
|
17199
17204
|
if (rowSelected) newIdMap = {};
|
|
17200
17205
|
} else if (rowSelected && e.shiftKey) return;
|
|
17201
|
-
else if (rowSelected &&
|
|
17206
|
+
else if (rowSelected && ctrl2) {
|
|
17202
17207
|
newIdMap = __spreadValues({}, oldIdMap);
|
|
17203
17208
|
delete newIdMap[rowId];
|
|
17204
17209
|
} else if (rowSelected) {
|
|
17205
17210
|
newIdMap = {};
|
|
17206
|
-
} else if (
|
|
17211
|
+
} else if (ctrl2) {
|
|
17207
17212
|
newIdMap = __spreadValues(__spreadValues({}, oldIdMap), newIdMap);
|
|
17208
17213
|
} else if (e.shiftKey && !isEmpty$1(oldIdMap)) {
|
|
17209
17214
|
newIdMap = {
|
|
@@ -19513,23 +19518,23 @@ function requireParse() {
|
|
|
19513
19518
|
return parse$4;
|
|
19514
19519
|
}
|
|
19515
19520
|
__name(requireParse, "requireParse");
|
|
19516
|
-
var lib$
|
|
19517
|
-
var hasRequiredLib$
|
|
19518
|
-
function requireLib$
|
|
19519
|
-
if (hasRequiredLib$
|
|
19520
|
-
hasRequiredLib$
|
|
19521
|
+
var lib$7;
|
|
19522
|
+
var hasRequiredLib$7;
|
|
19523
|
+
function requireLib$7() {
|
|
19524
|
+
if (hasRequiredLib$7) return lib$7;
|
|
19525
|
+
hasRequiredLib$7 = 1;
|
|
19521
19526
|
var stringify2 = /* @__PURE__ */ requireStringify();
|
|
19522
19527
|
var parse3 = /* @__PURE__ */ requireParse();
|
|
19523
19528
|
var formats2 = /* @__PURE__ */ requireFormats();
|
|
19524
|
-
lib$
|
|
19529
|
+
lib$7 = {
|
|
19525
19530
|
formats: formats2,
|
|
19526
19531
|
parse: parse3,
|
|
19527
19532
|
stringify: stringify2
|
|
19528
19533
|
};
|
|
19529
|
-
return lib$
|
|
19534
|
+
return lib$7;
|
|
19530
19535
|
}
|
|
19531
|
-
__name(requireLib$
|
|
19532
|
-
var libExports$3 = /* @__PURE__ */ requireLib$
|
|
19536
|
+
__name(requireLib$7, "requireLib$7");
|
|
19537
|
+
var libExports$3 = /* @__PURE__ */ requireLib$7();
|
|
19533
19538
|
const queryString = /* @__PURE__ */ getDefaultExportFromCjs(libExports$3);
|
|
19534
19539
|
function tableQueryParamsToHasuraClauses({
|
|
19535
19540
|
page,
|
|
@@ -20022,8 +20027,9 @@ function initializeHasuraWhereAndFilter(additionalFilter, where = {}, currentPar
|
|
|
20022
20027
|
if (newWhere) {
|
|
20023
20028
|
Object.assign(where, newWhere);
|
|
20024
20029
|
}
|
|
20025
|
-
} else if (typeof additionalFilter === "object")
|
|
20030
|
+
} else if (typeof additionalFilter === "object" && additionalFilter !== null) {
|
|
20026
20031
|
where._and.push(additionalFilter);
|
|
20032
|
+
}
|
|
20027
20033
|
}
|
|
20028
20034
|
__name(initializeHasuraWhereAndFilter, "initializeHasuraWhereAndFilter");
|
|
20029
20035
|
const defaultPageSizes = [5, 10, 15, 25, 50, 100, 200, 400];
|
|
@@ -20531,7 +20537,7 @@ const PagingTool = /* @__PURE__ */ __name(({
|
|
|
20531
20537
|
}
|
|
20532
20538
|
));
|
|
20533
20539
|
}, "PagingTool");
|
|
20534
|
-
var lib$
|
|
20540
|
+
var lib$6 = {};
|
|
20535
20541
|
var flattenNames = {};
|
|
20536
20542
|
var _freeGlobal;
|
|
20537
20543
|
var hasRequired_freeGlobal;
|
|
@@ -23903,14 +23909,14 @@ function requireLoop() {
|
|
|
23903
23909
|
return loop;
|
|
23904
23910
|
}
|
|
23905
23911
|
__name(requireLoop, "requireLoop");
|
|
23906
|
-
var hasRequiredLib$
|
|
23907
|
-
function requireLib$
|
|
23908
|
-
if (hasRequiredLib$
|
|
23909
|
-
hasRequiredLib$
|
|
23910
|
-
Object.defineProperty(lib$
|
|
23912
|
+
var hasRequiredLib$6;
|
|
23913
|
+
function requireLib$6() {
|
|
23914
|
+
if (hasRequiredLib$6) return lib$6;
|
|
23915
|
+
hasRequiredLib$6 = 1;
|
|
23916
|
+
Object.defineProperty(lib$6, "__esModule", {
|
|
23911
23917
|
value: true
|
|
23912
23918
|
});
|
|
23913
|
-
lib$
|
|
23919
|
+
lib$6.ReactCSS = lib$6.loop = lib$6.handleActive = lib$6.handleHover = lib$6.hover = void 0;
|
|
23914
23920
|
var _flattenNames = requireFlattenNames();
|
|
23915
23921
|
var _flattenNames2 = _interopRequireDefault(_flattenNames);
|
|
23916
23922
|
var _mergeClasses = requireMergeClasses();
|
|
@@ -23927,11 +23933,11 @@ function requireLib$7() {
|
|
|
23927
23933
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
23928
23934
|
}
|
|
23929
23935
|
__name(_interopRequireDefault, "_interopRequireDefault");
|
|
23930
|
-
lib$
|
|
23931
|
-
lib$
|
|
23932
|
-
lib$
|
|
23933
|
-
lib$
|
|
23934
|
-
var ReactCSS = lib$
|
|
23936
|
+
lib$6.hover = _hover3.default;
|
|
23937
|
+
lib$6.handleHover = _hover3.default;
|
|
23938
|
+
lib$6.handleActive = _active2.default;
|
|
23939
|
+
lib$6.loop = _loop3.default;
|
|
23940
|
+
var ReactCSS = lib$6.ReactCSS = /* @__PURE__ */ __name(function ReactCSS2(classes) {
|
|
23935
23941
|
for (var _len = arguments.length, activations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
23936
23942
|
activations[_key - 1] = arguments[_key];
|
|
23937
23943
|
}
|
|
@@ -23939,11 +23945,11 @@ function requireLib$7() {
|
|
|
23939
23945
|
var merged = (0, _mergeClasses2.default)(classes, activeNames);
|
|
23940
23946
|
return (0, _autoprefix2.default)(merged);
|
|
23941
23947
|
}, "ReactCSS");
|
|
23942
|
-
lib$
|
|
23943
|
-
return lib$
|
|
23948
|
+
lib$6.default = ReactCSS;
|
|
23949
|
+
return lib$6;
|
|
23944
23950
|
}
|
|
23945
|
-
__name(requireLib$
|
|
23946
|
-
var libExports$2 = requireLib$
|
|
23951
|
+
__name(requireLib$6, "requireLib$6");
|
|
23952
|
+
var libExports$2 = requireLib$6();
|
|
23947
23953
|
const reactCSS = /* @__PURE__ */ getDefaultExportFromCjs(libExports$2);
|
|
23948
23954
|
var calculateChange$2 = /* @__PURE__ */ __name(function calculateChange(e, hsl, direction, initialA, container) {
|
|
23949
23955
|
var containerWidth = container.clientWidth;
|
|
@@ -30352,11 +30358,20 @@ function requireFuzzysearch() {
|
|
|
30352
30358
|
__name(requireFuzzysearch, "requireFuzzysearch");
|
|
30353
30359
|
var fuzzysearchExports = requireFuzzysearch();
|
|
30354
30360
|
const fuzzysearch = /* @__PURE__ */ getDefaultExportFromCjs(fuzzysearchExports);
|
|
30361
|
+
const isReactElement = /* @__PURE__ */ __name((el) => {
|
|
30362
|
+
if (el) {
|
|
30363
|
+
const newEl = el;
|
|
30364
|
+
if (newEl.props && newEl.props.children) {
|
|
30365
|
+
return true;
|
|
30366
|
+
}
|
|
30367
|
+
}
|
|
30368
|
+
return false;
|
|
30369
|
+
}, "isReactElement");
|
|
30355
30370
|
function getTextFromEl(el, options = {}) {
|
|
30356
30371
|
const { lowerCase: lowerCase2 } = options;
|
|
30357
30372
|
if (React__default.isValidElement(el)) {
|
|
30358
|
-
return el && el.props && el.props.children ? (el.props.children
|
|
30359
|
-
if (child
|
|
30373
|
+
return el && el.props && el.props.children ? (Array.isArray(el.props.children) ? el.props.children : [el.props.children]).reduce((acc, child) => {
|
|
30374
|
+
if (isReactElement(child)) {
|
|
30360
30375
|
acc += getTextFromEl(child);
|
|
30361
30376
|
} else if (typeof child === "string") {
|
|
30362
30377
|
if (lowerCase2) {
|
|
@@ -30374,1795 +30389,1578 @@ function getTextFromEl(el, options = {}) {
|
|
|
30374
30389
|
}
|
|
30375
30390
|
}
|
|
30376
30391
|
__name(getTextFromEl, "getTextFromEl");
|
|
30377
|
-
|
|
30378
|
-
|
|
30379
|
-
|
|
30380
|
-
|
|
30381
|
-
|
|
30382
|
-
|
|
30383
|
-
|
|
30384
|
-
|
|
30385
|
-
|
|
30386
|
-
|
|
30387
|
-
|
|
30388
|
-
|
|
30389
|
-
|
|
30390
|
-
|
|
30391
|
-
|
|
30392
|
-
|
|
30393
|
-
|
|
30394
|
-
|
|
30395
|
-
|
|
30396
|
-
|
|
30397
|
-
|
|
30398
|
-
|
|
30399
|
-
|
|
30400
|
-
|
|
30401
|
-
|
|
30402
|
-
|
|
30403
|
-
|
|
30404
|
-
|
|
30405
|
-
|
|
30406
|
-
|
|
30407
|
-
|
|
30408
|
-
|
|
30409
|
-
|
|
30410
|
-
|
|
30411
|
-
|
|
30412
|
-
|
|
30413
|
-
|
|
30414
|
-
|
|
30415
|
-
|
|
30416
|
-
|
|
30417
|
-
|
|
30418
|
-
|
|
30419
|
-
|
|
30420
|
-
|
|
30421
|
-
|
|
30422
|
-
|
|
30423
|
-
|
|
30424
|
-
|
|
30425
|
-
|
|
30426
|
-
|
|
30427
|
-
|
|
30428
|
-
|
|
30429
|
-
|
|
30430
|
-
|
|
30431
|
-
|
|
30432
|
-
|
|
30433
|
-
|
|
30434
|
-
|
|
30435
|
-
|
|
30436
|
-
|
|
30437
|
-
|
|
30438
|
-
|
|
30439
|
-
|
|
30440
|
-
|
|
30441
|
-
|
|
30442
|
-
|
|
30443
|
-
|
|
30444
|
-
|
|
30445
|
-
|
|
30446
|
-
|
|
30447
|
-
|
|
30448
|
-
|
|
30449
|
-
|
|
30450
|
-
|
|
30451
|
-
|
|
30452
|
-
|
|
30453
|
-
|
|
30454
|
-
|
|
30455
|
-
|
|
30456
|
-
|
|
30457
|
-
|
|
30458
|
-
|
|
30459
|
-
|
|
30460
|
-
|
|
30461
|
-
|
|
30462
|
-
|
|
30463
|
-
|
|
30464
|
-
|
|
30465
|
-
|
|
30466
|
-
|
|
30467
|
-
|
|
30468
|
-
|
|
30469
|
-
|
|
30470
|
-
|
|
30471
|
-
|
|
30472
|
-
|
|
30473
|
-
|
|
30474
|
-
|
|
30475
|
-
|
|
30476
|
-
|
|
30477
|
-
|
|
30478
|
-
|
|
30479
|
-
|
|
30480
|
-
|
|
30481
|
-
|
|
30482
|
-
|
|
30483
|
-
|
|
30484
|
-
|
|
30485
|
-
|
|
30486
|
-
|
|
30487
|
-
|
|
30488
|
-
|
|
30489
|
-
|
|
30490
|
-
|
|
30491
|
-
|
|
30492
|
-
|
|
30493
|
-
|
|
30494
|
-
|
|
30495
|
-
|
|
30496
|
-
|
|
30497
|
-
|
|
30498
|
-
|
|
30499
|
-
|
|
30500
|
-
|
|
30501
|
-
|
|
30502
|
-
|
|
30503
|
-
|
|
30504
|
-
|
|
30505
|
-
|
|
30506
|
-
|
|
30507
|
-
|
|
30508
|
-
|
|
30509
|
-
|
|
30510
|
-
|
|
30511
|
-
|
|
30512
|
-
|
|
30513
|
-
|
|
30514
|
-
|
|
30515
|
-
|
|
30516
|
-
|
|
30517
|
-
|
|
30518
|
-
|
|
30519
|
-
|
|
30520
|
-
|
|
30521
|
-
|
|
30522
|
-
|
|
30523
|
-
|
|
30524
|
-
|
|
30525
|
-
|
|
30526
|
-
|
|
30527
|
-
|
|
30528
|
-
|
|
30529
|
-
|
|
30530
|
-
|
|
30531
|
-
|
|
30532
|
-
};
|
|
30533
|
-
return colorName$1;
|
|
30534
|
-
}
|
|
30535
|
-
__name(requireColorName$1, "requireColorName$1");
|
|
30536
|
-
var simpleSwizzle = { exports: {} };
|
|
30537
|
-
var isArrayish;
|
|
30538
|
-
var hasRequiredIsArrayish;
|
|
30539
|
-
function requireIsArrayish() {
|
|
30540
|
-
if (hasRequiredIsArrayish) return isArrayish;
|
|
30541
|
-
hasRequiredIsArrayish = 1;
|
|
30542
|
-
isArrayish = /* @__PURE__ */ __name(function isArrayish2(obj) {
|
|
30543
|
-
if (!obj || typeof obj === "string") {
|
|
30544
|
-
return false;
|
|
30545
|
-
}
|
|
30546
|
-
return obj instanceof Array || Array.isArray(obj) || obj.length >= 0 && (obj.splice instanceof Function || Object.getOwnPropertyDescriptor(obj, obj.length - 1) && obj.constructor.name !== "String");
|
|
30547
|
-
}, "isArrayish");
|
|
30548
|
-
return isArrayish;
|
|
30392
|
+
const cssKeywords = {
|
|
30393
|
+
aliceblue: [240, 248, 255],
|
|
30394
|
+
antiquewhite: [250, 235, 215],
|
|
30395
|
+
aqua: [0, 255, 255],
|
|
30396
|
+
aquamarine: [127, 255, 212],
|
|
30397
|
+
azure: [240, 255, 255],
|
|
30398
|
+
beige: [245, 245, 220],
|
|
30399
|
+
bisque: [255, 228, 196],
|
|
30400
|
+
black: [0, 0, 0],
|
|
30401
|
+
blanchedalmond: [255, 235, 205],
|
|
30402
|
+
blue: [0, 0, 255],
|
|
30403
|
+
blueviolet: [138, 43, 226],
|
|
30404
|
+
brown: [165, 42, 42],
|
|
30405
|
+
burlywood: [222, 184, 135],
|
|
30406
|
+
cadetblue: [95, 158, 160],
|
|
30407
|
+
chartreuse: [127, 255, 0],
|
|
30408
|
+
chocolate: [210, 105, 30],
|
|
30409
|
+
coral: [255, 127, 80],
|
|
30410
|
+
cornflowerblue: [100, 149, 237],
|
|
30411
|
+
cornsilk: [255, 248, 220],
|
|
30412
|
+
crimson: [220, 20, 60],
|
|
30413
|
+
cyan: [0, 255, 255],
|
|
30414
|
+
darkblue: [0, 0, 139],
|
|
30415
|
+
darkcyan: [0, 139, 139],
|
|
30416
|
+
darkgoldenrod: [184, 134, 11],
|
|
30417
|
+
darkgray: [169, 169, 169],
|
|
30418
|
+
darkgreen: [0, 100, 0],
|
|
30419
|
+
darkgrey: [169, 169, 169],
|
|
30420
|
+
darkkhaki: [189, 183, 107],
|
|
30421
|
+
darkmagenta: [139, 0, 139],
|
|
30422
|
+
darkolivegreen: [85, 107, 47],
|
|
30423
|
+
darkorange: [255, 140, 0],
|
|
30424
|
+
darkorchid: [153, 50, 204],
|
|
30425
|
+
darkred: [139, 0, 0],
|
|
30426
|
+
darksalmon: [233, 150, 122],
|
|
30427
|
+
darkseagreen: [143, 188, 143],
|
|
30428
|
+
darkslateblue: [72, 61, 139],
|
|
30429
|
+
darkslategray: [47, 79, 79],
|
|
30430
|
+
darkslategrey: [47, 79, 79],
|
|
30431
|
+
darkturquoise: [0, 206, 209],
|
|
30432
|
+
darkviolet: [148, 0, 211],
|
|
30433
|
+
deeppink: [255, 20, 147],
|
|
30434
|
+
deepskyblue: [0, 191, 255],
|
|
30435
|
+
dimgray: [105, 105, 105],
|
|
30436
|
+
dimgrey: [105, 105, 105],
|
|
30437
|
+
dodgerblue: [30, 144, 255],
|
|
30438
|
+
firebrick: [178, 34, 34],
|
|
30439
|
+
floralwhite: [255, 250, 240],
|
|
30440
|
+
forestgreen: [34, 139, 34],
|
|
30441
|
+
fuchsia: [255, 0, 255],
|
|
30442
|
+
gainsboro: [220, 220, 220],
|
|
30443
|
+
ghostwhite: [248, 248, 255],
|
|
30444
|
+
gold: [255, 215, 0],
|
|
30445
|
+
goldenrod: [218, 165, 32],
|
|
30446
|
+
gray: [128, 128, 128],
|
|
30447
|
+
green: [0, 128, 0],
|
|
30448
|
+
greenyellow: [173, 255, 47],
|
|
30449
|
+
grey: [128, 128, 128],
|
|
30450
|
+
honeydew: [240, 255, 240],
|
|
30451
|
+
hotpink: [255, 105, 180],
|
|
30452
|
+
indianred: [205, 92, 92],
|
|
30453
|
+
indigo: [75, 0, 130],
|
|
30454
|
+
ivory: [255, 255, 240],
|
|
30455
|
+
khaki: [240, 230, 140],
|
|
30456
|
+
lavender: [230, 230, 250],
|
|
30457
|
+
lavenderblush: [255, 240, 245],
|
|
30458
|
+
lawngreen: [124, 252, 0],
|
|
30459
|
+
lemonchiffon: [255, 250, 205],
|
|
30460
|
+
lightblue: [173, 216, 230],
|
|
30461
|
+
lightcoral: [240, 128, 128],
|
|
30462
|
+
lightcyan: [224, 255, 255],
|
|
30463
|
+
lightgoldenrodyellow: [250, 250, 210],
|
|
30464
|
+
lightgray: [211, 211, 211],
|
|
30465
|
+
lightgreen: [144, 238, 144],
|
|
30466
|
+
lightgrey: [211, 211, 211],
|
|
30467
|
+
lightpink: [255, 182, 193],
|
|
30468
|
+
lightsalmon: [255, 160, 122],
|
|
30469
|
+
lightseagreen: [32, 178, 170],
|
|
30470
|
+
lightskyblue: [135, 206, 250],
|
|
30471
|
+
lightslategray: [119, 136, 153],
|
|
30472
|
+
lightslategrey: [119, 136, 153],
|
|
30473
|
+
lightsteelblue: [176, 196, 222],
|
|
30474
|
+
lightyellow: [255, 255, 224],
|
|
30475
|
+
lime: [0, 255, 0],
|
|
30476
|
+
limegreen: [50, 205, 50],
|
|
30477
|
+
linen: [250, 240, 230],
|
|
30478
|
+
magenta: [255, 0, 255],
|
|
30479
|
+
maroon: [128, 0, 0],
|
|
30480
|
+
mediumaquamarine: [102, 205, 170],
|
|
30481
|
+
mediumblue: [0, 0, 205],
|
|
30482
|
+
mediumorchid: [186, 85, 211],
|
|
30483
|
+
mediumpurple: [147, 112, 219],
|
|
30484
|
+
mediumseagreen: [60, 179, 113],
|
|
30485
|
+
mediumslateblue: [123, 104, 238],
|
|
30486
|
+
mediumspringgreen: [0, 250, 154],
|
|
30487
|
+
mediumturquoise: [72, 209, 204],
|
|
30488
|
+
mediumvioletred: [199, 21, 133],
|
|
30489
|
+
midnightblue: [25, 25, 112],
|
|
30490
|
+
mintcream: [245, 255, 250],
|
|
30491
|
+
mistyrose: [255, 228, 225],
|
|
30492
|
+
moccasin: [255, 228, 181],
|
|
30493
|
+
navajowhite: [255, 222, 173],
|
|
30494
|
+
navy: [0, 0, 128],
|
|
30495
|
+
oldlace: [253, 245, 230],
|
|
30496
|
+
olive: [128, 128, 0],
|
|
30497
|
+
olivedrab: [107, 142, 35],
|
|
30498
|
+
orange: [255, 165, 0],
|
|
30499
|
+
orangered: [255, 69, 0],
|
|
30500
|
+
orchid: [218, 112, 214],
|
|
30501
|
+
palegoldenrod: [238, 232, 170],
|
|
30502
|
+
palegreen: [152, 251, 152],
|
|
30503
|
+
paleturquoise: [175, 238, 238],
|
|
30504
|
+
palevioletred: [219, 112, 147],
|
|
30505
|
+
papayawhip: [255, 239, 213],
|
|
30506
|
+
peachpuff: [255, 218, 185],
|
|
30507
|
+
peru: [205, 133, 63],
|
|
30508
|
+
pink: [255, 192, 203],
|
|
30509
|
+
plum: [221, 160, 221],
|
|
30510
|
+
powderblue: [176, 224, 230],
|
|
30511
|
+
purple: [128, 0, 128],
|
|
30512
|
+
rebeccapurple: [102, 51, 153],
|
|
30513
|
+
red: [255, 0, 0],
|
|
30514
|
+
rosybrown: [188, 143, 143],
|
|
30515
|
+
royalblue: [65, 105, 225],
|
|
30516
|
+
saddlebrown: [139, 69, 19],
|
|
30517
|
+
salmon: [250, 128, 114],
|
|
30518
|
+
sandybrown: [244, 164, 96],
|
|
30519
|
+
seagreen: [46, 139, 87],
|
|
30520
|
+
seashell: [255, 245, 238],
|
|
30521
|
+
sienna: [160, 82, 45],
|
|
30522
|
+
silver: [192, 192, 192],
|
|
30523
|
+
skyblue: [135, 206, 235],
|
|
30524
|
+
slateblue: [106, 90, 205],
|
|
30525
|
+
slategray: [112, 128, 144],
|
|
30526
|
+
slategrey: [112, 128, 144],
|
|
30527
|
+
snow: [255, 250, 250],
|
|
30528
|
+
springgreen: [0, 255, 127],
|
|
30529
|
+
steelblue: [70, 130, 180],
|
|
30530
|
+
tan: [210, 180, 140],
|
|
30531
|
+
teal: [0, 128, 128],
|
|
30532
|
+
thistle: [216, 191, 216],
|
|
30533
|
+
tomato: [255, 99, 71],
|
|
30534
|
+
turquoise: [64, 224, 208],
|
|
30535
|
+
violet: [238, 130, 238],
|
|
30536
|
+
wheat: [245, 222, 179],
|
|
30537
|
+
white: [255, 255, 255],
|
|
30538
|
+
whitesmoke: [245, 245, 245],
|
|
30539
|
+
yellow: [255, 255, 0],
|
|
30540
|
+
yellowgreen: [154, 205, 50]
|
|
30541
|
+
};
|
|
30542
|
+
const reverseNames = /* @__PURE__ */ Object.create(null);
|
|
30543
|
+
for (const name2 in cssKeywords) {
|
|
30544
|
+
if (Object.hasOwn(cssKeywords, name2)) {
|
|
30545
|
+
reverseNames[cssKeywords[name2]] = name2;
|
|
30546
|
+
}
|
|
30549
30547
|
}
|
|
30550
|
-
|
|
30551
|
-
|
|
30552
|
-
|
|
30553
|
-
|
|
30554
|
-
|
|
30555
|
-
|
|
30556
|
-
|
|
30557
|
-
|
|
30558
|
-
|
|
30559
|
-
|
|
30560
|
-
|
|
30561
|
-
|
|
30562
|
-
|
|
30563
|
-
results = concat.call(results, slice.call(arg));
|
|
30564
|
-
} else {
|
|
30565
|
-
results.push(arg);
|
|
30566
|
-
}
|
|
30548
|
+
const cs = {
|
|
30549
|
+
to: {},
|
|
30550
|
+
get: {}
|
|
30551
|
+
};
|
|
30552
|
+
cs.get = function(string2) {
|
|
30553
|
+
const prefix2 = string2.slice(0, 3).toLowerCase();
|
|
30554
|
+
let value;
|
|
30555
|
+
let model;
|
|
30556
|
+
switch (prefix2) {
|
|
30557
|
+
case "hsl": {
|
|
30558
|
+
value = cs.get.hsl(string2);
|
|
30559
|
+
model = "hsl";
|
|
30560
|
+
break;
|
|
30567
30561
|
}
|
|
30568
|
-
|
|
30569
|
-
|
|
30570
|
-
|
|
30571
|
-
|
|
30572
|
-
return fn4(swizzle(arguments));
|
|
30573
|
-
};
|
|
30574
|
-
};
|
|
30575
|
-
return simpleSwizzle.exports;
|
|
30576
|
-
}
|
|
30577
|
-
__name(requireSimpleSwizzle, "requireSimpleSwizzle");
|
|
30578
|
-
var hasRequiredColorString;
|
|
30579
|
-
function requireColorString() {
|
|
30580
|
-
if (hasRequiredColorString) return colorString.exports;
|
|
30581
|
-
hasRequiredColorString = 1;
|
|
30582
|
-
var colorNames = requireColorName$1();
|
|
30583
|
-
var swizzle = requireSimpleSwizzle();
|
|
30584
|
-
var hasOwnProperty2 = Object.hasOwnProperty;
|
|
30585
|
-
var reverseNames = /* @__PURE__ */ Object.create(null);
|
|
30586
|
-
for (var name2 in colorNames) {
|
|
30587
|
-
if (hasOwnProperty2.call(colorNames, name2)) {
|
|
30588
|
-
reverseNames[colorNames[name2]] = name2;
|
|
30589
|
-
}
|
|
30590
|
-
}
|
|
30591
|
-
var cs = colorString.exports = {
|
|
30592
|
-
to: {},
|
|
30593
|
-
get: {}
|
|
30594
|
-
};
|
|
30595
|
-
cs.get = function(string2) {
|
|
30596
|
-
var prefix2 = string2.substring(0, 3).toLowerCase();
|
|
30597
|
-
var val2;
|
|
30598
|
-
var model;
|
|
30599
|
-
switch (prefix2) {
|
|
30600
|
-
case "hsl":
|
|
30601
|
-
val2 = cs.get.hsl(string2);
|
|
30602
|
-
model = "hsl";
|
|
30603
|
-
break;
|
|
30604
|
-
case "hwb":
|
|
30605
|
-
val2 = cs.get.hwb(string2);
|
|
30606
|
-
model = "hwb";
|
|
30607
|
-
break;
|
|
30608
|
-
default:
|
|
30609
|
-
val2 = cs.get.rgb(string2);
|
|
30610
|
-
model = "rgb";
|
|
30611
|
-
break;
|
|
30562
|
+
case "hwb": {
|
|
30563
|
+
value = cs.get.hwb(string2);
|
|
30564
|
+
model = "hwb";
|
|
30565
|
+
break;
|
|
30612
30566
|
}
|
|
30613
|
-
|
|
30614
|
-
|
|
30567
|
+
default: {
|
|
30568
|
+
value = cs.get.rgb(string2);
|
|
30569
|
+
model = "rgb";
|
|
30570
|
+
break;
|
|
30615
30571
|
}
|
|
30616
|
-
|
|
30617
|
-
|
|
30618
|
-
|
|
30619
|
-
|
|
30620
|
-
|
|
30572
|
+
}
|
|
30573
|
+
if (!value) {
|
|
30574
|
+
return null;
|
|
30575
|
+
}
|
|
30576
|
+
return { model, value };
|
|
30577
|
+
};
|
|
30578
|
+
cs.get.rgb = function(string2) {
|
|
30579
|
+
if (!string2) {
|
|
30580
|
+
return null;
|
|
30581
|
+
}
|
|
30582
|
+
const abbr = /^#([a-f\d]{3,4})$/i;
|
|
30583
|
+
const hex = /^#([a-f\d]{6})([a-f\d]{2})?$/i;
|
|
30584
|
+
const rgba = /^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/;
|
|
30585
|
+
const per = /^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/;
|
|
30586
|
+
const keyword = /^(\w+)$/;
|
|
30587
|
+
let rgb = [0, 0, 0, 1];
|
|
30588
|
+
let match;
|
|
30589
|
+
let i;
|
|
30590
|
+
let hexAlpha;
|
|
30591
|
+
if (match = string2.match(hex)) {
|
|
30592
|
+
hexAlpha = match[2];
|
|
30593
|
+
match = match[1];
|
|
30594
|
+
for (i = 0; i < 3; i++) {
|
|
30595
|
+
const i2 = i * 2;
|
|
30596
|
+
rgb[i] = Number.parseInt(match.slice(i2, i2 + 2), 16);
|
|
30621
30597
|
}
|
|
30622
|
-
|
|
30623
|
-
|
|
30624
|
-
var rgba = /^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/;
|
|
30625
|
-
var per = /^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/;
|
|
30626
|
-
var keyword = /^(\w+)$/;
|
|
30627
|
-
var rgb = [0, 0, 0, 1];
|
|
30628
|
-
var match;
|
|
30629
|
-
var i;
|
|
30630
|
-
var hexAlpha;
|
|
30631
|
-
if (match = string2.match(hex)) {
|
|
30632
|
-
hexAlpha = match[2];
|
|
30633
|
-
match = match[1];
|
|
30634
|
-
for (i = 0; i < 3; i++) {
|
|
30635
|
-
var i2 = i * 2;
|
|
30636
|
-
rgb[i] = parseInt(match.slice(i2, i2 + 2), 16);
|
|
30637
|
-
}
|
|
30638
|
-
if (hexAlpha) {
|
|
30639
|
-
rgb[3] = parseInt(hexAlpha, 16) / 255;
|
|
30640
|
-
}
|
|
30641
|
-
} else if (match = string2.match(abbr)) {
|
|
30642
|
-
match = match[1];
|
|
30643
|
-
hexAlpha = match[3];
|
|
30644
|
-
for (i = 0; i < 3; i++) {
|
|
30645
|
-
rgb[i] = parseInt(match[i] + match[i], 16);
|
|
30646
|
-
}
|
|
30647
|
-
if (hexAlpha) {
|
|
30648
|
-
rgb[3] = parseInt(hexAlpha + hexAlpha, 16) / 255;
|
|
30649
|
-
}
|
|
30650
|
-
} else if (match = string2.match(rgba)) {
|
|
30651
|
-
for (i = 0; i < 3; i++) {
|
|
30652
|
-
rgb[i] = parseInt(match[i + 1], 0);
|
|
30653
|
-
}
|
|
30654
|
-
if (match[4]) {
|
|
30655
|
-
if (match[5]) {
|
|
30656
|
-
rgb[3] = parseFloat(match[4]) * 0.01;
|
|
30657
|
-
} else {
|
|
30658
|
-
rgb[3] = parseFloat(match[4]);
|
|
30659
|
-
}
|
|
30660
|
-
}
|
|
30661
|
-
} else if (match = string2.match(per)) {
|
|
30662
|
-
for (i = 0; i < 3; i++) {
|
|
30663
|
-
rgb[i] = Math.round(parseFloat(match[i + 1]) * 2.55);
|
|
30664
|
-
}
|
|
30665
|
-
if (match[4]) {
|
|
30666
|
-
if (match[5]) {
|
|
30667
|
-
rgb[3] = parseFloat(match[4]) * 0.01;
|
|
30668
|
-
} else {
|
|
30669
|
-
rgb[3] = parseFloat(match[4]);
|
|
30670
|
-
}
|
|
30671
|
-
}
|
|
30672
|
-
} else if (match = string2.match(keyword)) {
|
|
30673
|
-
if (match[1] === "transparent") {
|
|
30674
|
-
return [0, 0, 0, 0];
|
|
30675
|
-
}
|
|
30676
|
-
if (!hasOwnProperty2.call(colorNames, match[1])) {
|
|
30677
|
-
return null;
|
|
30678
|
-
}
|
|
30679
|
-
rgb = colorNames[match[1]];
|
|
30680
|
-
rgb[3] = 1;
|
|
30681
|
-
return rgb;
|
|
30682
|
-
} else {
|
|
30683
|
-
return null;
|
|
30598
|
+
if (hexAlpha) {
|
|
30599
|
+
rgb[3] = Number.parseInt(hexAlpha, 16) / 255;
|
|
30684
30600
|
}
|
|
30601
|
+
} else if (match = string2.match(abbr)) {
|
|
30602
|
+
match = match[1];
|
|
30603
|
+
hexAlpha = match[3];
|
|
30685
30604
|
for (i = 0; i < 3; i++) {
|
|
30686
|
-
rgb[i] =
|
|
30605
|
+
rgb[i] = Number.parseInt(match[i] + match[i], 16);
|
|
30687
30606
|
}
|
|
30688
|
-
|
|
30689
|
-
|
|
30690
|
-
};
|
|
30691
|
-
cs.get.hsl = function(string2) {
|
|
30692
|
-
if (!string2) {
|
|
30693
|
-
return null;
|
|
30607
|
+
if (hexAlpha) {
|
|
30608
|
+
rgb[3] = Number.parseInt(hexAlpha + hexAlpha, 16) / 255;
|
|
30694
30609
|
}
|
|
30695
|
-
|
|
30696
|
-
|
|
30697
|
-
|
|
30698
|
-
var alpha = parseFloat(match[4]);
|
|
30699
|
-
var h2 = (parseFloat(match[1]) % 360 + 360) % 360;
|
|
30700
|
-
var s2 = clamp2(parseFloat(match[2]), 0, 100);
|
|
30701
|
-
var l2 = clamp2(parseFloat(match[3]), 0, 100);
|
|
30702
|
-
var a2 = clamp2(isNaN(alpha) ? 1 : alpha, 0, 1);
|
|
30703
|
-
return [h2, s2, l2, a2];
|
|
30610
|
+
} else if (match = string2.match(rgba)) {
|
|
30611
|
+
for (i = 0; i < 3; i++) {
|
|
30612
|
+
rgb[i] = Number.parseInt(match[i + 1], 10);
|
|
30704
30613
|
}
|
|
30705
|
-
|
|
30706
|
-
|
|
30707
|
-
cs.get.hwb = function(string2) {
|
|
30708
|
-
if (!string2) {
|
|
30709
|
-
return null;
|
|
30614
|
+
if (match[4]) {
|
|
30615
|
+
rgb[3] = match[5] ? Number.parseFloat(match[4]) * 0.01 : Number.parseFloat(match[4]);
|
|
30710
30616
|
}
|
|
30711
|
-
|
|
30712
|
-
|
|
30713
|
-
|
|
30714
|
-
|
|
30715
|
-
|
|
30716
|
-
|
|
30717
|
-
var b3 = clamp2(parseFloat(match[3]), 0, 100);
|
|
30718
|
-
var a2 = clamp2(isNaN(alpha) ? 1 : alpha, 0, 1);
|
|
30719
|
-
return [h2, w2, b3, a2];
|
|
30617
|
+
} else if (match = string2.match(per)) {
|
|
30618
|
+
for (i = 0; i < 3; i++) {
|
|
30619
|
+
rgb[i] = Math.round(Number.parseFloat(match[i + 1]) * 2.55);
|
|
30620
|
+
}
|
|
30621
|
+
if (match[4]) {
|
|
30622
|
+
rgb[3] = match[5] ? Number.parseFloat(match[4]) * 0.01 : Number.parseFloat(match[4]);
|
|
30720
30623
|
}
|
|
30624
|
+
} else if (match = string2.match(keyword)) {
|
|
30625
|
+
if (match[1] === "transparent") {
|
|
30626
|
+
return [0, 0, 0, 0];
|
|
30627
|
+
}
|
|
30628
|
+
if (!Object.hasOwn(cssKeywords, match[1])) {
|
|
30629
|
+
return null;
|
|
30630
|
+
}
|
|
30631
|
+
rgb = cssKeywords[match[1]];
|
|
30632
|
+
rgb[3] = 1;
|
|
30633
|
+
return rgb;
|
|
30634
|
+
} else {
|
|
30721
30635
|
return null;
|
|
30722
|
-
}
|
|
30723
|
-
|
|
30724
|
-
|
|
30725
|
-
|
|
30726
|
-
|
|
30727
|
-
|
|
30728
|
-
|
|
30729
|
-
|
|
30730
|
-
|
|
30731
|
-
|
|
30732
|
-
|
|
30733
|
-
|
|
30734
|
-
|
|
30735
|
-
|
|
30736
|
-
|
|
30737
|
-
|
|
30738
|
-
|
|
30739
|
-
|
|
30740
|
-
|
|
30741
|
-
|
|
30742
|
-
|
|
30743
|
-
|
|
30744
|
-
|
|
30745
|
-
|
|
30746
|
-
|
|
30747
|
-
|
|
30748
|
-
|
|
30749
|
-
}
|
|
30750
|
-
|
|
30751
|
-
|
|
30752
|
-
|
|
30753
|
-
|
|
30754
|
-
|
|
30755
|
-
|
|
30756
|
-
|
|
30757
|
-
|
|
30758
|
-
|
|
30759
|
-
|
|
30760
|
-
|
|
30761
|
-
|
|
30762
|
-
return
|
|
30763
|
-
}
|
|
30764
|
-
|
|
30765
|
-
|
|
30766
|
-
|
|
30767
|
-
|
|
30768
|
-
|
|
30769
|
-
|
|
30770
|
-
|
|
30771
|
-
|
|
30772
|
-
|
|
30773
|
-
|
|
30774
|
-
|
|
30775
|
-
|
|
30776
|
-
|
|
30777
|
-
|
|
30778
|
-
|
|
30779
|
-
"
|
|
30780
|
-
|
|
30781
|
-
|
|
30782
|
-
|
|
30783
|
-
|
|
30784
|
-
|
|
30785
|
-
|
|
30786
|
-
|
|
30787
|
-
|
|
30788
|
-
|
|
30789
|
-
|
|
30790
|
-
|
|
30791
|
-
|
|
30792
|
-
|
|
30793
|
-
|
|
30794
|
-
|
|
30795
|
-
|
|
30796
|
-
|
|
30797
|
-
|
|
30798
|
-
|
|
30799
|
-
|
|
30800
|
-
|
|
30801
|
-
|
|
30802
|
-
|
|
30803
|
-
|
|
30804
|
-
|
|
30805
|
-
|
|
30806
|
-
|
|
30807
|
-
|
|
30808
|
-
|
|
30809
|
-
|
|
30810
|
-
|
|
30811
|
-
|
|
30812
|
-
|
|
30813
|
-
|
|
30814
|
-
|
|
30815
|
-
|
|
30816
|
-
|
|
30817
|
-
|
|
30818
|
-
|
|
30819
|
-
|
|
30820
|
-
|
|
30821
|
-
|
|
30822
|
-
|
|
30823
|
-
|
|
30824
|
-
|
|
30825
|
-
|
|
30826
|
-
|
|
30827
|
-
|
|
30828
|
-
|
|
30829
|
-
|
|
30830
|
-
"
|
|
30831
|
-
|
|
30832
|
-
|
|
30833
|
-
"
|
|
30834
|
-
|
|
30835
|
-
|
|
30836
|
-
"
|
|
30837
|
-
|
|
30838
|
-
|
|
30839
|
-
|
|
30840
|
-
|
|
30841
|
-
|
|
30842
|
-
|
|
30843
|
-
|
|
30844
|
-
|
|
30845
|
-
|
|
30846
|
-
|
|
30847
|
-
|
|
30848
|
-
|
|
30849
|
-
|
|
30850
|
-
|
|
30851
|
-
|
|
30852
|
-
|
|
30853
|
-
|
|
30854
|
-
|
|
30855
|
-
"limegreen": [50, 205, 50],
|
|
30856
|
-
"linen": [250, 240, 230],
|
|
30857
|
-
"magenta": [255, 0, 255],
|
|
30858
|
-
"maroon": [128, 0, 0],
|
|
30859
|
-
"mediumaquamarine": [102, 205, 170],
|
|
30860
|
-
"mediumblue": [0, 0, 205],
|
|
30861
|
-
"mediumorchid": [186, 85, 211],
|
|
30862
|
-
"mediumpurple": [147, 112, 219],
|
|
30863
|
-
"mediumseagreen": [60, 179, 113],
|
|
30864
|
-
"mediumslateblue": [123, 104, 238],
|
|
30865
|
-
"mediumspringgreen": [0, 250, 154],
|
|
30866
|
-
"mediumturquoise": [72, 209, 204],
|
|
30867
|
-
"mediumvioletred": [199, 21, 133],
|
|
30868
|
-
"midnightblue": [25, 25, 112],
|
|
30869
|
-
"mintcream": [245, 255, 250],
|
|
30870
|
-
"mistyrose": [255, 228, 225],
|
|
30871
|
-
"moccasin": [255, 228, 181],
|
|
30872
|
-
"navajowhite": [255, 222, 173],
|
|
30873
|
-
"navy": [0, 0, 128],
|
|
30874
|
-
"oldlace": [253, 245, 230],
|
|
30875
|
-
"olive": [128, 128, 0],
|
|
30876
|
-
"olivedrab": [107, 142, 35],
|
|
30877
|
-
"orange": [255, 165, 0],
|
|
30878
|
-
"orangered": [255, 69, 0],
|
|
30879
|
-
"orchid": [218, 112, 214],
|
|
30880
|
-
"palegoldenrod": [238, 232, 170],
|
|
30881
|
-
"palegreen": [152, 251, 152],
|
|
30882
|
-
"paleturquoise": [175, 238, 238],
|
|
30883
|
-
"palevioletred": [219, 112, 147],
|
|
30884
|
-
"papayawhip": [255, 239, 213],
|
|
30885
|
-
"peachpuff": [255, 218, 185],
|
|
30886
|
-
"peru": [205, 133, 63],
|
|
30887
|
-
"pink": [255, 192, 203],
|
|
30888
|
-
"plum": [221, 160, 221],
|
|
30889
|
-
"powderblue": [176, 224, 230],
|
|
30890
|
-
"purple": [128, 0, 128],
|
|
30891
|
-
"rebeccapurple": [102, 51, 153],
|
|
30892
|
-
"red": [255, 0, 0],
|
|
30893
|
-
"rosybrown": [188, 143, 143],
|
|
30894
|
-
"royalblue": [65, 105, 225],
|
|
30895
|
-
"saddlebrown": [139, 69, 19],
|
|
30896
|
-
"salmon": [250, 128, 114],
|
|
30897
|
-
"sandybrown": [244, 164, 96],
|
|
30898
|
-
"seagreen": [46, 139, 87],
|
|
30899
|
-
"seashell": [255, 245, 238],
|
|
30900
|
-
"sienna": [160, 82, 45],
|
|
30901
|
-
"silver": [192, 192, 192],
|
|
30902
|
-
"skyblue": [135, 206, 235],
|
|
30903
|
-
"slateblue": [106, 90, 205],
|
|
30904
|
-
"slategray": [112, 128, 144],
|
|
30905
|
-
"slategrey": [112, 128, 144],
|
|
30906
|
-
"snow": [255, 250, 250],
|
|
30907
|
-
"springgreen": [0, 255, 127],
|
|
30908
|
-
"steelblue": [70, 130, 180],
|
|
30909
|
-
"tan": [210, 180, 140],
|
|
30910
|
-
"teal": [0, 128, 128],
|
|
30911
|
-
"thistle": [216, 191, 216],
|
|
30912
|
-
"tomato": [255, 99, 71],
|
|
30913
|
-
"turquoise": [64, 224, 208],
|
|
30914
|
-
"violet": [238, 130, 238],
|
|
30915
|
-
"wheat": [245, 222, 179],
|
|
30916
|
-
"white": [255, 255, 255],
|
|
30917
|
-
"whitesmoke": [245, 245, 245],
|
|
30918
|
-
"yellow": [255, 255, 0],
|
|
30919
|
-
"yellowgreen": [154, 205, 50]
|
|
30920
|
-
};
|
|
30921
|
-
return colorName;
|
|
30922
|
-
}
|
|
30923
|
-
__name(requireColorName, "requireColorName");
|
|
30924
|
-
var hasRequiredConversions;
|
|
30925
|
-
function requireConversions() {
|
|
30926
|
-
if (hasRequiredConversions) return conversions.exports;
|
|
30927
|
-
hasRequiredConversions = 1;
|
|
30928
|
-
var cssKeywords = requireColorName();
|
|
30929
|
-
var reverseKeywords = {};
|
|
30930
|
-
for (var key in cssKeywords) {
|
|
30931
|
-
if (cssKeywords.hasOwnProperty(key)) {
|
|
30932
|
-
reverseKeywords[cssKeywords[key]] = key;
|
|
30933
|
-
}
|
|
30934
|
-
}
|
|
30935
|
-
var convert2 = conversions.exports = {
|
|
30936
|
-
rgb: { channels: 3, labels: "rgb" },
|
|
30937
|
-
hsl: { channels: 3, labels: "hsl" },
|
|
30938
|
-
hsv: { channels: 3, labels: "hsv" },
|
|
30939
|
-
hwb: { channels: 3, labels: "hwb" },
|
|
30940
|
-
cmyk: { channels: 4, labels: "cmyk" },
|
|
30941
|
-
xyz: { channels: 3, labels: "xyz" },
|
|
30942
|
-
lab: { channels: 3, labels: "lab" },
|
|
30943
|
-
lch: { channels: 3, labels: "lch" },
|
|
30944
|
-
hex: { channels: 1, labels: ["hex"] },
|
|
30945
|
-
keyword: { channels: 1, labels: ["keyword"] },
|
|
30946
|
-
ansi16: { channels: 1, labels: ["ansi16"] },
|
|
30947
|
-
ansi256: { channels: 1, labels: ["ansi256"] },
|
|
30948
|
-
hcg: { channels: 3, labels: ["h", "c", "g"] },
|
|
30949
|
-
apple: { channels: 3, labels: ["r16", "g16", "b16"] },
|
|
30950
|
-
gray: { channels: 1, labels: ["gray"] }
|
|
30951
|
-
};
|
|
30952
|
-
for (var model in convert2) {
|
|
30953
|
-
if (convert2.hasOwnProperty(model)) {
|
|
30954
|
-
if (!("channels" in convert2[model])) {
|
|
30955
|
-
throw new Error("missing channels property: " + model);
|
|
30956
|
-
}
|
|
30957
|
-
if (!("labels" in convert2[model])) {
|
|
30958
|
-
throw new Error("missing channel labels property: " + model);
|
|
30959
|
-
}
|
|
30960
|
-
if (convert2[model].labels.length !== convert2[model].channels) {
|
|
30961
|
-
throw new Error("channel and label counts mismatch: " + model);
|
|
30962
|
-
}
|
|
30963
|
-
var channels = convert2[model].channels;
|
|
30964
|
-
var labels = convert2[model].labels;
|
|
30965
|
-
delete convert2[model].channels;
|
|
30966
|
-
delete convert2[model].labels;
|
|
30967
|
-
Object.defineProperty(convert2[model], "channels", { value: channels });
|
|
30968
|
-
Object.defineProperty(convert2[model], "labels", { value: labels });
|
|
30969
|
-
}
|
|
30970
|
-
}
|
|
30971
|
-
convert2.rgb.hsl = function(rgb) {
|
|
30972
|
-
var r2 = rgb[0] / 255;
|
|
30973
|
-
var g2 = rgb[1] / 255;
|
|
30974
|
-
var b3 = rgb[2] / 255;
|
|
30975
|
-
var min2 = Math.min(r2, g2, b3);
|
|
30976
|
-
var max2 = Math.max(r2, g2, b3);
|
|
30977
|
-
var delta = max2 - min2;
|
|
30978
|
-
var h2;
|
|
30979
|
-
var s2;
|
|
30980
|
-
var l2;
|
|
30981
|
-
if (max2 === min2) {
|
|
30636
|
+
}
|
|
30637
|
+
for (i = 0; i < 3; i++) {
|
|
30638
|
+
rgb[i] = clamp$3(rgb[i], 0, 255);
|
|
30639
|
+
}
|
|
30640
|
+
rgb[3] = clamp$3(rgb[3], 0, 1);
|
|
30641
|
+
return rgb;
|
|
30642
|
+
};
|
|
30643
|
+
cs.get.hsl = function(string2) {
|
|
30644
|
+
if (!string2) {
|
|
30645
|
+
return null;
|
|
30646
|
+
}
|
|
30647
|
+
const hsl = /^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/;
|
|
30648
|
+
const match = string2.match(hsl);
|
|
30649
|
+
if (match) {
|
|
30650
|
+
const alpha = Number.parseFloat(match[4]);
|
|
30651
|
+
const h2 = (Number.parseFloat(match[1]) % 360 + 360) % 360;
|
|
30652
|
+
const s2 = clamp$3(Number.parseFloat(match[2]), 0, 100);
|
|
30653
|
+
const l2 = clamp$3(Number.parseFloat(match[3]), 0, 100);
|
|
30654
|
+
const a2 = clamp$3(Number.isNaN(alpha) ? 1 : alpha, 0, 1);
|
|
30655
|
+
return [h2, s2, l2, a2];
|
|
30656
|
+
}
|
|
30657
|
+
return null;
|
|
30658
|
+
};
|
|
30659
|
+
cs.get.hwb = function(string2) {
|
|
30660
|
+
if (!string2) {
|
|
30661
|
+
return null;
|
|
30662
|
+
}
|
|
30663
|
+
const hwb = /^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/;
|
|
30664
|
+
const match = string2.match(hwb);
|
|
30665
|
+
if (match) {
|
|
30666
|
+
const alpha = Number.parseFloat(match[4]);
|
|
30667
|
+
const h2 = (Number.parseFloat(match[1]) % 360 + 360) % 360;
|
|
30668
|
+
const w2 = clamp$3(Number.parseFloat(match[2]), 0, 100);
|
|
30669
|
+
const b3 = clamp$3(Number.parseFloat(match[3]), 0, 100);
|
|
30670
|
+
const a2 = clamp$3(Number.isNaN(alpha) ? 1 : alpha, 0, 1);
|
|
30671
|
+
return [h2, w2, b3, a2];
|
|
30672
|
+
}
|
|
30673
|
+
return null;
|
|
30674
|
+
};
|
|
30675
|
+
cs.to.hex = function(...rgba) {
|
|
30676
|
+
return "#" + hexDouble(rgba[0]) + hexDouble(rgba[1]) + hexDouble(rgba[2]) + (rgba[3] < 1 ? hexDouble(Math.round(rgba[3] * 255)) : "");
|
|
30677
|
+
};
|
|
30678
|
+
cs.to.rgb = function(...rgba) {
|
|
30679
|
+
return rgba.length < 4 || rgba[3] === 1 ? "rgb(" + Math.round(rgba[0]) + ", " + Math.round(rgba[1]) + ", " + Math.round(rgba[2]) + ")" : "rgba(" + Math.round(rgba[0]) + ", " + Math.round(rgba[1]) + ", " + Math.round(rgba[2]) + ", " + rgba[3] + ")";
|
|
30680
|
+
};
|
|
30681
|
+
cs.to.rgb.percent = function(...rgba) {
|
|
30682
|
+
const r2 = Math.round(rgba[0] / 255 * 100);
|
|
30683
|
+
const g2 = Math.round(rgba[1] / 255 * 100);
|
|
30684
|
+
const b3 = Math.round(rgba[2] / 255 * 100);
|
|
30685
|
+
return rgba.length < 4 || rgba[3] === 1 ? "rgb(" + r2 + "%, " + g2 + "%, " + b3 + "%)" : "rgba(" + r2 + "%, " + g2 + "%, " + b3 + "%, " + rgba[3] + ")";
|
|
30686
|
+
};
|
|
30687
|
+
cs.to.hsl = function(...hsla) {
|
|
30688
|
+
return hsla.length < 4 || hsla[3] === 1 ? "hsl(" + hsla[0] + ", " + hsla[1] + "%, " + hsla[2] + "%)" : "hsla(" + hsla[0] + ", " + hsla[1] + "%, " + hsla[2] + "%, " + hsla[3] + ")";
|
|
30689
|
+
};
|
|
30690
|
+
cs.to.hwb = function(...hwba) {
|
|
30691
|
+
let a2 = "";
|
|
30692
|
+
if (hwba.length >= 4 && hwba[3] !== 1) {
|
|
30693
|
+
a2 = ", " + hwba[3];
|
|
30694
|
+
}
|
|
30695
|
+
return "hwb(" + hwba[0] + ", " + hwba[1] + "%, " + hwba[2] + "%" + a2 + ")";
|
|
30696
|
+
};
|
|
30697
|
+
cs.to.keyword = function(...rgb) {
|
|
30698
|
+
return reverseNames[rgb.slice(0, 3)];
|
|
30699
|
+
};
|
|
30700
|
+
function clamp$3(number_, min2, max2) {
|
|
30701
|
+
return Math.min(Math.max(min2, number_), max2);
|
|
30702
|
+
}
|
|
30703
|
+
__name(clamp$3, "clamp$3");
|
|
30704
|
+
function hexDouble(number_) {
|
|
30705
|
+
const string_ = Math.round(number_).toString(16).toUpperCase();
|
|
30706
|
+
return string_.length < 2 ? "0" + string_ : string_;
|
|
30707
|
+
}
|
|
30708
|
+
__name(hexDouble, "hexDouble");
|
|
30709
|
+
const reverseKeywords = {};
|
|
30710
|
+
for (const key of Object.keys(cssKeywords)) {
|
|
30711
|
+
reverseKeywords[cssKeywords[key]] = key;
|
|
30712
|
+
}
|
|
30713
|
+
const convert$2 = {
|
|
30714
|
+
rgb: { channels: 3, labels: "rgb" },
|
|
30715
|
+
hsl: { channels: 3, labels: "hsl" },
|
|
30716
|
+
hsv: { channels: 3, labels: "hsv" },
|
|
30717
|
+
hwb: { channels: 3, labels: "hwb" },
|
|
30718
|
+
cmyk: { channels: 4, labels: "cmyk" },
|
|
30719
|
+
xyz: { channels: 3, labels: "xyz" },
|
|
30720
|
+
lab: { channels: 3, labels: "lab" },
|
|
30721
|
+
oklab: { channels: 3, labels: ["okl", "oka", "okb"] },
|
|
30722
|
+
lch: { channels: 3, labels: "lch" },
|
|
30723
|
+
oklch: { channels: 3, labels: ["okl", "okc", "okh"] },
|
|
30724
|
+
hex: { channels: 1, labels: ["hex"] },
|
|
30725
|
+
keyword: { channels: 1, labels: ["keyword"] },
|
|
30726
|
+
ansi16: { channels: 1, labels: ["ansi16"] },
|
|
30727
|
+
ansi256: { channels: 1, labels: ["ansi256"] },
|
|
30728
|
+
hcg: { channels: 3, labels: ["h", "c", "g"] },
|
|
30729
|
+
apple: { channels: 3, labels: ["r16", "g16", "b16"] },
|
|
30730
|
+
gray: { channels: 1, labels: ["gray"] }
|
|
30731
|
+
};
|
|
30732
|
+
const LAB_FT = __pow(6 / 29, 3);
|
|
30733
|
+
function srgbNonlinearTransform(c2) {
|
|
30734
|
+
const cc = c2 > 31308e-7 ? 1.055 * __pow(c2, 1 / 2.4) - 0.055 : c2 * 12.92;
|
|
30735
|
+
return Math.min(Math.max(0, cc), 1);
|
|
30736
|
+
}
|
|
30737
|
+
__name(srgbNonlinearTransform, "srgbNonlinearTransform");
|
|
30738
|
+
function srgbNonlinearTransformInv(c2) {
|
|
30739
|
+
return c2 > 0.04045 ? __pow((c2 + 0.055) / 1.055, 2.4) : c2 / 12.92;
|
|
30740
|
+
}
|
|
30741
|
+
__name(srgbNonlinearTransformInv, "srgbNonlinearTransformInv");
|
|
30742
|
+
for (const model of Object.keys(convert$2)) {
|
|
30743
|
+
if (!("channels" in convert$2[model])) {
|
|
30744
|
+
throw new Error("missing channels property: " + model);
|
|
30745
|
+
}
|
|
30746
|
+
if (!("labels" in convert$2[model])) {
|
|
30747
|
+
throw new Error("missing channel labels property: " + model);
|
|
30748
|
+
}
|
|
30749
|
+
if (convert$2[model].labels.length !== convert$2[model].channels) {
|
|
30750
|
+
throw new Error("channel and label counts mismatch: " + model);
|
|
30751
|
+
}
|
|
30752
|
+
const { channels, labels } = convert$2[model];
|
|
30753
|
+
delete convert$2[model].channels;
|
|
30754
|
+
delete convert$2[model].labels;
|
|
30755
|
+
Object.defineProperty(convert$2[model], "channels", { value: channels });
|
|
30756
|
+
Object.defineProperty(convert$2[model], "labels", { value: labels });
|
|
30757
|
+
}
|
|
30758
|
+
convert$2.rgb.hsl = function(rgb) {
|
|
30759
|
+
const r2 = rgb[0] / 255;
|
|
30760
|
+
const g2 = rgb[1] / 255;
|
|
30761
|
+
const b3 = rgb[2] / 255;
|
|
30762
|
+
const min2 = Math.min(r2, g2, b3);
|
|
30763
|
+
const max2 = Math.max(r2, g2, b3);
|
|
30764
|
+
const delta = max2 - min2;
|
|
30765
|
+
let h2;
|
|
30766
|
+
let s2;
|
|
30767
|
+
switch (max2) {
|
|
30768
|
+
case min2: {
|
|
30982
30769
|
h2 = 0;
|
|
30983
|
-
|
|
30770
|
+
break;
|
|
30771
|
+
}
|
|
30772
|
+
case r2: {
|
|
30984
30773
|
h2 = (g2 - b3) / delta;
|
|
30985
|
-
|
|
30774
|
+
break;
|
|
30775
|
+
}
|
|
30776
|
+
case g2: {
|
|
30986
30777
|
h2 = 2 + (b3 - r2) / delta;
|
|
30987
|
-
|
|
30988
|
-
h2 = 4 + (r2 - g2) / delta;
|
|
30778
|
+
break;
|
|
30989
30779
|
}
|
|
30990
|
-
|
|
30991
|
-
|
|
30992
|
-
|
|
30780
|
+
case b3: {
|
|
30781
|
+
h2 = 4 + (r2 - g2) / delta;
|
|
30782
|
+
break;
|
|
30993
30783
|
}
|
|
30994
|
-
|
|
30995
|
-
|
|
30996
|
-
|
|
30997
|
-
|
|
30998
|
-
|
|
30999
|
-
|
|
31000
|
-
|
|
31001
|
-
|
|
31002
|
-
|
|
31003
|
-
|
|
31004
|
-
|
|
31005
|
-
|
|
31006
|
-
|
|
31007
|
-
|
|
31008
|
-
|
|
31009
|
-
|
|
31010
|
-
|
|
31011
|
-
|
|
31012
|
-
|
|
31013
|
-
|
|
31014
|
-
|
|
31015
|
-
|
|
31016
|
-
|
|
31017
|
-
|
|
31018
|
-
|
|
31019
|
-
|
|
31020
|
-
|
|
31021
|
-
|
|
31022
|
-
|
|
31023
|
-
|
|
31024
|
-
|
|
31025
|
-
|
|
30784
|
+
}
|
|
30785
|
+
h2 = Math.min(h2 * 60, 360);
|
|
30786
|
+
if (h2 < 0) {
|
|
30787
|
+
h2 += 360;
|
|
30788
|
+
}
|
|
30789
|
+
const l2 = (min2 + max2) / 2;
|
|
30790
|
+
if (max2 === min2) {
|
|
30791
|
+
s2 = 0;
|
|
30792
|
+
} else if (l2 <= 0.5) {
|
|
30793
|
+
s2 = delta / (max2 + min2);
|
|
30794
|
+
} else {
|
|
30795
|
+
s2 = delta / (2 - max2 - min2);
|
|
30796
|
+
}
|
|
30797
|
+
return [h2, s2 * 100, l2 * 100];
|
|
30798
|
+
};
|
|
30799
|
+
convert$2.rgb.hsv = function(rgb) {
|
|
30800
|
+
let rdif;
|
|
30801
|
+
let gdif;
|
|
30802
|
+
let bdif;
|
|
30803
|
+
let h2;
|
|
30804
|
+
let s2;
|
|
30805
|
+
const r2 = rgb[0] / 255;
|
|
30806
|
+
const g2 = rgb[1] / 255;
|
|
30807
|
+
const b3 = rgb[2] / 255;
|
|
30808
|
+
const v2 = Math.max(r2, g2, b3);
|
|
30809
|
+
const diff = v2 - Math.min(r2, g2, b3);
|
|
30810
|
+
const diffc = /* @__PURE__ */ __name(function(c2) {
|
|
30811
|
+
return (v2 - c2) / 6 / diff + 1 / 2;
|
|
30812
|
+
}, "diffc");
|
|
30813
|
+
if (diff === 0) {
|
|
30814
|
+
h2 = 0;
|
|
30815
|
+
s2 = 0;
|
|
30816
|
+
} else {
|
|
30817
|
+
s2 = diff / v2;
|
|
30818
|
+
rdif = diffc(r2);
|
|
30819
|
+
gdif = diffc(g2);
|
|
30820
|
+
bdif = diffc(b3);
|
|
30821
|
+
switch (v2) {
|
|
30822
|
+
case r2: {
|
|
31026
30823
|
h2 = bdif - gdif;
|
|
31027
|
-
|
|
30824
|
+
break;
|
|
30825
|
+
}
|
|
30826
|
+
case g2: {
|
|
31028
30827
|
h2 = 1 / 3 + rdif - bdif;
|
|
31029
|
-
|
|
31030
|
-
h2 = 2 / 3 + gdif - rdif;
|
|
30828
|
+
break;
|
|
31031
30829
|
}
|
|
31032
|
-
|
|
31033
|
-
h2
|
|
31034
|
-
|
|
31035
|
-
h2 -= 1;
|
|
30830
|
+
case b3: {
|
|
30831
|
+
h2 = 2 / 3 + gdif - rdif;
|
|
30832
|
+
break;
|
|
31036
30833
|
}
|
|
31037
30834
|
}
|
|
31038
|
-
|
|
31039
|
-
h2
|
|
31040
|
-
|
|
31041
|
-
|
|
31042
|
-
|
|
31043
|
-
}
|
|
31044
|
-
|
|
31045
|
-
|
|
31046
|
-
|
|
31047
|
-
|
|
31048
|
-
|
|
31049
|
-
|
|
31050
|
-
|
|
31051
|
-
|
|
31052
|
-
|
|
31053
|
-
|
|
31054
|
-
|
|
31055
|
-
|
|
31056
|
-
|
|
31057
|
-
|
|
31058
|
-
|
|
31059
|
-
|
|
31060
|
-
|
|
31061
|
-
|
|
31062
|
-
|
|
31063
|
-
|
|
31064
|
-
|
|
31065
|
-
|
|
31066
|
-
|
|
31067
|
-
|
|
31068
|
-
|
|
31069
|
-
|
|
31070
|
-
|
|
31071
|
-
|
|
31072
|
-
|
|
31073
|
-
|
|
31074
|
-
|
|
31075
|
-
|
|
31076
|
-
|
|
31077
|
-
|
|
31078
|
-
|
|
31079
|
-
|
|
31080
|
-
|
|
31081
|
-
|
|
31082
|
-
|
|
31083
|
-
|
|
31084
|
-
|
|
31085
|
-
|
|
31086
|
-
|
|
31087
|
-
|
|
31088
|
-
return
|
|
31089
|
-
}
|
|
31090
|
-
|
|
31091
|
-
|
|
31092
|
-
|
|
31093
|
-
|
|
31094
|
-
|
|
31095
|
-
|
|
31096
|
-
|
|
31097
|
-
|
|
31098
|
-
|
|
31099
|
-
|
|
31100
|
-
|
|
31101
|
-
|
|
31102
|
-
|
|
31103
|
-
|
|
31104
|
-
|
|
31105
|
-
|
|
31106
|
-
|
|
31107
|
-
|
|
31108
|
-
|
|
31109
|
-
|
|
31110
|
-
|
|
31111
|
-
|
|
31112
|
-
|
|
31113
|
-
|
|
31114
|
-
|
|
31115
|
-
|
|
31116
|
-
|
|
31117
|
-
|
|
31118
|
-
|
|
31119
|
-
|
|
31120
|
-
|
|
31121
|
-
|
|
31122
|
-
|
|
31123
|
-
|
|
31124
|
-
|
|
31125
|
-
|
|
31126
|
-
|
|
31127
|
-
|
|
31128
|
-
|
|
31129
|
-
|
|
31130
|
-
|
|
31131
|
-
|
|
31132
|
-
|
|
31133
|
-
|
|
31134
|
-
|
|
31135
|
-
|
|
31136
|
-
|
|
31137
|
-
|
|
31138
|
-
|
|
30835
|
+
if (h2 < 0) {
|
|
30836
|
+
h2 += 1;
|
|
30837
|
+
} else if (h2 > 1) {
|
|
30838
|
+
h2 -= 1;
|
|
30839
|
+
}
|
|
30840
|
+
}
|
|
30841
|
+
return [
|
|
30842
|
+
h2 * 360,
|
|
30843
|
+
s2 * 100,
|
|
30844
|
+
v2 * 100
|
|
30845
|
+
];
|
|
30846
|
+
};
|
|
30847
|
+
convert$2.rgb.hwb = function(rgb) {
|
|
30848
|
+
const r2 = rgb[0];
|
|
30849
|
+
const g2 = rgb[1];
|
|
30850
|
+
let b3 = rgb[2];
|
|
30851
|
+
const h2 = convert$2.rgb.hsl(rgb)[0];
|
|
30852
|
+
const w2 = 1 / 255 * Math.min(r2, Math.min(g2, b3));
|
|
30853
|
+
b3 = 1 - 1 / 255 * Math.max(r2, Math.max(g2, b3));
|
|
30854
|
+
return [h2, w2 * 100, b3 * 100];
|
|
30855
|
+
};
|
|
30856
|
+
convert$2.rgb.oklab = function(rgb) {
|
|
30857
|
+
const r2 = srgbNonlinearTransformInv(rgb[0] / 255);
|
|
30858
|
+
const g2 = srgbNonlinearTransformInv(rgb[1] / 255);
|
|
30859
|
+
const b3 = srgbNonlinearTransformInv(rgb[2] / 255);
|
|
30860
|
+
const lp = Math.cbrt(0.4122214708 * r2 + 0.5363325363 * g2 + 0.0514459929 * b3);
|
|
30861
|
+
const mp = Math.cbrt(0.2119034982 * r2 + 0.6806995451 * g2 + 0.1073969566 * b3);
|
|
30862
|
+
const sp = Math.cbrt(0.0883024619 * r2 + 0.2817188376 * g2 + 0.6299787005 * b3);
|
|
30863
|
+
const l2 = 0.2104542553 * lp + 0.793617785 * mp - 0.0040720468 * sp;
|
|
30864
|
+
const aa = 1.9779984951 * lp - 2.428592205 * mp + 0.4505937099 * sp;
|
|
30865
|
+
const bb = 0.0259040371 * lp + 0.7827717662 * mp - 0.808675766 * sp;
|
|
30866
|
+
return [l2 * 100, aa * 100, bb * 100];
|
|
30867
|
+
};
|
|
30868
|
+
convert$2.rgb.cmyk = function(rgb) {
|
|
30869
|
+
const r2 = rgb[0] / 255;
|
|
30870
|
+
const g2 = rgb[1] / 255;
|
|
30871
|
+
const b3 = rgb[2] / 255;
|
|
30872
|
+
const k2 = Math.min(1 - r2, 1 - g2, 1 - b3);
|
|
30873
|
+
const c2 = (1 - r2 - k2) / (1 - k2) || 0;
|
|
30874
|
+
const m2 = (1 - g2 - k2) / (1 - k2) || 0;
|
|
30875
|
+
const y2 = (1 - b3 - k2) / (1 - k2) || 0;
|
|
30876
|
+
return [c2 * 100, m2 * 100, y2 * 100, k2 * 100];
|
|
30877
|
+
};
|
|
30878
|
+
function comparativeDistance(x, y2) {
|
|
30879
|
+
return __pow(x[0] - y2[0], 2) + __pow(x[1] - y2[1], 2) + __pow(x[2] - y2[2], 2);
|
|
30880
|
+
}
|
|
30881
|
+
__name(comparativeDistance, "comparativeDistance");
|
|
30882
|
+
convert$2.rgb.keyword = function(rgb) {
|
|
30883
|
+
const reversed = reverseKeywords[rgb];
|
|
30884
|
+
if (reversed) {
|
|
30885
|
+
return reversed;
|
|
30886
|
+
}
|
|
30887
|
+
let currentClosestDistance = Number.POSITIVE_INFINITY;
|
|
30888
|
+
let currentClosestKeyword;
|
|
30889
|
+
for (const keyword of Object.keys(cssKeywords)) {
|
|
30890
|
+
const value = cssKeywords[keyword];
|
|
30891
|
+
const distance2 = comparativeDistance(rgb, value);
|
|
30892
|
+
if (distance2 < currentClosestDistance) {
|
|
30893
|
+
currentClosestDistance = distance2;
|
|
30894
|
+
currentClosestKeyword = keyword;
|
|
30895
|
+
}
|
|
30896
|
+
}
|
|
30897
|
+
return currentClosestKeyword;
|
|
30898
|
+
};
|
|
30899
|
+
convert$2.keyword.rgb = function(keyword) {
|
|
30900
|
+
return cssKeywords[keyword];
|
|
30901
|
+
};
|
|
30902
|
+
convert$2.rgb.xyz = function(rgb) {
|
|
30903
|
+
const r2 = srgbNonlinearTransformInv(rgb[0] / 255);
|
|
30904
|
+
const g2 = srgbNonlinearTransformInv(rgb[1] / 255);
|
|
30905
|
+
const b3 = srgbNonlinearTransformInv(rgb[2] / 255);
|
|
30906
|
+
const x = r2 * 0.4124564 + g2 * 0.3575761 + b3 * 0.1804375;
|
|
30907
|
+
const y2 = r2 * 0.2126729 + g2 * 0.7151522 + b3 * 0.072175;
|
|
30908
|
+
const z2 = r2 * 0.0193339 + g2 * 0.119192 + b3 * 0.9503041;
|
|
30909
|
+
return [x * 100, y2 * 100, z2 * 100];
|
|
30910
|
+
};
|
|
30911
|
+
convert$2.rgb.lab = function(rgb) {
|
|
30912
|
+
const xyz = convert$2.rgb.xyz(rgb);
|
|
30913
|
+
let x = xyz[0];
|
|
30914
|
+
let y2 = xyz[1];
|
|
30915
|
+
let z2 = xyz[2];
|
|
30916
|
+
x /= 95.047;
|
|
30917
|
+
y2 /= 100;
|
|
30918
|
+
z2 /= 108.883;
|
|
30919
|
+
x = x > LAB_FT ? __pow(x, 1 / 3) : 7.787 * x + 16 / 116;
|
|
30920
|
+
y2 = y2 > LAB_FT ? __pow(y2, 1 / 3) : 7.787 * y2 + 16 / 116;
|
|
30921
|
+
z2 = z2 > LAB_FT ? __pow(z2, 1 / 3) : 7.787 * z2 + 16 / 116;
|
|
30922
|
+
const l2 = 116 * y2 - 16;
|
|
30923
|
+
const a2 = 500 * (x - y2);
|
|
30924
|
+
const b3 = 200 * (y2 - z2);
|
|
30925
|
+
return [l2, a2, b3];
|
|
30926
|
+
};
|
|
30927
|
+
convert$2.hsl.rgb = function(hsl) {
|
|
30928
|
+
const h2 = hsl[0] / 360;
|
|
30929
|
+
const s2 = hsl[1] / 100;
|
|
30930
|
+
const l2 = hsl[2] / 100;
|
|
30931
|
+
let t3;
|
|
30932
|
+
let value;
|
|
30933
|
+
if (s2 === 0) {
|
|
30934
|
+
value = l2 * 255;
|
|
30935
|
+
return [value, value, value];
|
|
30936
|
+
}
|
|
30937
|
+
const t2 = l2 < 0.5 ? l2 * (1 + s2) : l2 + s2 - l2 * s2;
|
|
30938
|
+
const t1 = 2 * l2 - t2;
|
|
30939
|
+
const rgb = [0, 0, 0];
|
|
30940
|
+
for (let i = 0; i < 3; i++) {
|
|
30941
|
+
t3 = h2 + 1 / 3 * -(i - 1);
|
|
30942
|
+
if (t3 < 0) {
|
|
30943
|
+
t3++;
|
|
30944
|
+
}
|
|
30945
|
+
if (t3 > 1) {
|
|
30946
|
+
t3--;
|
|
30947
|
+
}
|
|
30948
|
+
if (6 * t3 < 1) {
|
|
30949
|
+
value = t1 + (t2 - t1) * 6 * t3;
|
|
30950
|
+
} else if (2 * t3 < 1) {
|
|
30951
|
+
value = t2;
|
|
30952
|
+
} else if (3 * t3 < 2) {
|
|
30953
|
+
value = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
|
|
31139
30954
|
} else {
|
|
31140
|
-
|
|
31141
|
-
}
|
|
31142
|
-
t1 = 2 * l2 - t2;
|
|
31143
|
-
rgb = [0, 0, 0];
|
|
31144
|
-
for (var i = 0; i < 3; i++) {
|
|
31145
|
-
t3 = h2 + 1 / 3 * -(i - 1);
|
|
31146
|
-
if (t3 < 0) {
|
|
31147
|
-
t3++;
|
|
31148
|
-
}
|
|
31149
|
-
if (t3 > 1) {
|
|
31150
|
-
t3--;
|
|
31151
|
-
}
|
|
31152
|
-
if (6 * t3 < 1) {
|
|
31153
|
-
val2 = t1 + (t2 - t1) * 6 * t3;
|
|
31154
|
-
} else if (2 * t3 < 1) {
|
|
31155
|
-
val2 = t2;
|
|
31156
|
-
} else if (3 * t3 < 2) {
|
|
31157
|
-
val2 = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
|
|
31158
|
-
} else {
|
|
31159
|
-
val2 = t1;
|
|
31160
|
-
}
|
|
31161
|
-
rgb[i] = val2 * 255;
|
|
30955
|
+
value = t1;
|
|
31162
30956
|
}
|
|
31163
|
-
|
|
31164
|
-
}
|
|
31165
|
-
|
|
31166
|
-
|
|
31167
|
-
|
|
31168
|
-
|
|
31169
|
-
|
|
31170
|
-
|
|
31171
|
-
|
|
31172
|
-
|
|
31173
|
-
|
|
31174
|
-
|
|
31175
|
-
|
|
31176
|
-
|
|
31177
|
-
|
|
31178
|
-
|
|
31179
|
-
|
|
31180
|
-
|
|
31181
|
-
|
|
31182
|
-
|
|
31183
|
-
|
|
31184
|
-
|
|
31185
|
-
|
|
31186
|
-
|
|
31187
|
-
|
|
31188
|
-
|
|
31189
|
-
|
|
31190
|
-
|
|
31191
|
-
|
|
31192
|
-
|
|
31193
|
-
case 1:
|
|
31194
|
-
return [q2, v2, p2];
|
|
31195
|
-
case 2:
|
|
31196
|
-
return [p2, v2, t2];
|
|
31197
|
-
case 3:
|
|
31198
|
-
return [p2, q2, v2];
|
|
31199
|
-
case 4:
|
|
31200
|
-
return [t2, p2, v2];
|
|
31201
|
-
case 5:
|
|
31202
|
-
return [v2, p2, q2];
|
|
31203
|
-
}
|
|
31204
|
-
};
|
|
31205
|
-
convert2.hsv.hsl = function(hsv) {
|
|
31206
|
-
var h2 = hsv[0];
|
|
31207
|
-
var s2 = hsv[1] / 100;
|
|
31208
|
-
var v2 = hsv[2] / 100;
|
|
31209
|
-
var vmin = Math.max(v2, 0.01);
|
|
31210
|
-
var lmin;
|
|
31211
|
-
var sl;
|
|
31212
|
-
var l2;
|
|
31213
|
-
l2 = (2 - s2) * v2;
|
|
31214
|
-
lmin = (2 - s2) * vmin;
|
|
31215
|
-
sl = s2 * vmin;
|
|
31216
|
-
sl /= lmin <= 1 ? lmin : 2 - lmin;
|
|
31217
|
-
sl = sl || 0;
|
|
31218
|
-
l2 /= 2;
|
|
31219
|
-
return [h2, sl * 100, l2 * 100];
|
|
31220
|
-
};
|
|
31221
|
-
convert2.hwb.rgb = function(hwb) {
|
|
31222
|
-
var h2 = hwb[0] / 360;
|
|
31223
|
-
var wh = hwb[1] / 100;
|
|
31224
|
-
var bl = hwb[2] / 100;
|
|
31225
|
-
var ratio = wh + bl;
|
|
31226
|
-
var i;
|
|
31227
|
-
var v2;
|
|
31228
|
-
var f2;
|
|
31229
|
-
var n2;
|
|
31230
|
-
if (ratio > 1) {
|
|
31231
|
-
wh /= ratio;
|
|
31232
|
-
bl /= ratio;
|
|
31233
|
-
}
|
|
31234
|
-
i = Math.floor(6 * h2);
|
|
31235
|
-
v2 = 1 - bl;
|
|
31236
|
-
f2 = 6 * h2 - i;
|
|
31237
|
-
if ((i & 1) !== 0) {
|
|
31238
|
-
f2 = 1 - f2;
|
|
31239
|
-
}
|
|
31240
|
-
n2 = wh + f2 * (v2 - wh);
|
|
31241
|
-
var r2;
|
|
31242
|
-
var g2;
|
|
31243
|
-
var b3;
|
|
31244
|
-
switch (i) {
|
|
31245
|
-
default:
|
|
31246
|
-
case 6:
|
|
31247
|
-
case 0:
|
|
31248
|
-
r2 = v2;
|
|
31249
|
-
g2 = n2;
|
|
31250
|
-
b3 = wh;
|
|
31251
|
-
break;
|
|
31252
|
-
case 1:
|
|
31253
|
-
r2 = n2;
|
|
31254
|
-
g2 = v2;
|
|
31255
|
-
b3 = wh;
|
|
31256
|
-
break;
|
|
31257
|
-
case 2:
|
|
31258
|
-
r2 = wh;
|
|
31259
|
-
g2 = v2;
|
|
31260
|
-
b3 = n2;
|
|
31261
|
-
break;
|
|
31262
|
-
case 3:
|
|
31263
|
-
r2 = wh;
|
|
31264
|
-
g2 = n2;
|
|
31265
|
-
b3 = v2;
|
|
31266
|
-
break;
|
|
31267
|
-
case 4:
|
|
31268
|
-
r2 = n2;
|
|
31269
|
-
g2 = wh;
|
|
31270
|
-
b3 = v2;
|
|
31271
|
-
break;
|
|
31272
|
-
case 5:
|
|
31273
|
-
r2 = v2;
|
|
31274
|
-
g2 = wh;
|
|
31275
|
-
b3 = n2;
|
|
31276
|
-
break;
|
|
30957
|
+
rgb[i] = value * 255;
|
|
30958
|
+
}
|
|
30959
|
+
return rgb;
|
|
30960
|
+
};
|
|
30961
|
+
convert$2.hsl.hsv = function(hsl) {
|
|
30962
|
+
const h2 = hsl[0];
|
|
30963
|
+
let s2 = hsl[1] / 100;
|
|
30964
|
+
let l2 = hsl[2] / 100;
|
|
30965
|
+
let smin = s2;
|
|
30966
|
+
const lmin = Math.max(l2, 0.01);
|
|
30967
|
+
l2 *= 2;
|
|
30968
|
+
s2 *= l2 <= 1 ? l2 : 2 - l2;
|
|
30969
|
+
smin *= lmin <= 1 ? lmin : 2 - lmin;
|
|
30970
|
+
const v2 = (l2 + s2) / 2;
|
|
30971
|
+
const sv = l2 === 0 ? 2 * smin / (lmin + smin) : 2 * s2 / (l2 + s2);
|
|
30972
|
+
return [h2, sv * 100, v2 * 100];
|
|
30973
|
+
};
|
|
30974
|
+
convert$2.hsv.rgb = function(hsv) {
|
|
30975
|
+
const h2 = hsv[0] / 60;
|
|
30976
|
+
const s2 = hsv[1] / 100;
|
|
30977
|
+
let v2 = hsv[2] / 100;
|
|
30978
|
+
const hi = Math.floor(h2) % 6;
|
|
30979
|
+
const f2 = h2 - Math.floor(h2);
|
|
30980
|
+
const p2 = 255 * v2 * (1 - s2);
|
|
30981
|
+
const q2 = 255 * v2 * (1 - s2 * f2);
|
|
30982
|
+
const t2 = 255 * v2 * (1 - s2 * (1 - f2));
|
|
30983
|
+
v2 *= 255;
|
|
30984
|
+
switch (hi) {
|
|
30985
|
+
case 0: {
|
|
30986
|
+
return [v2, t2, p2];
|
|
31277
30987
|
}
|
|
31278
|
-
|
|
31279
|
-
|
|
31280
|
-
convert2.cmyk.rgb = function(cmyk) {
|
|
31281
|
-
var c2 = cmyk[0] / 100;
|
|
31282
|
-
var m2 = cmyk[1] / 100;
|
|
31283
|
-
var y2 = cmyk[2] / 100;
|
|
31284
|
-
var k2 = cmyk[3] / 100;
|
|
31285
|
-
var r2;
|
|
31286
|
-
var g2;
|
|
31287
|
-
var b3;
|
|
31288
|
-
r2 = 1 - Math.min(1, c2 * (1 - k2) + k2);
|
|
31289
|
-
g2 = 1 - Math.min(1, m2 * (1 - k2) + k2);
|
|
31290
|
-
b3 = 1 - Math.min(1, y2 * (1 - k2) + k2);
|
|
31291
|
-
return [r2 * 255, g2 * 255, b3 * 255];
|
|
31292
|
-
};
|
|
31293
|
-
convert2.xyz.rgb = function(xyz) {
|
|
31294
|
-
var x = xyz[0] / 100;
|
|
31295
|
-
var y2 = xyz[1] / 100;
|
|
31296
|
-
var z2 = xyz[2] / 100;
|
|
31297
|
-
var r2;
|
|
31298
|
-
var g2;
|
|
31299
|
-
var b3;
|
|
31300
|
-
r2 = x * 3.2406 + y2 * -1.5372 + z2 * -0.4986;
|
|
31301
|
-
g2 = x * -0.9689 + y2 * 1.8758 + z2 * 0.0415;
|
|
31302
|
-
b3 = x * 0.0557 + y2 * -0.204 + z2 * 1.057;
|
|
31303
|
-
r2 = r2 > 31308e-7 ? 1.055 * Math.pow(r2, 1 / 2.4) - 0.055 : r2 * 12.92;
|
|
31304
|
-
g2 = g2 > 31308e-7 ? 1.055 * Math.pow(g2, 1 / 2.4) - 0.055 : g2 * 12.92;
|
|
31305
|
-
b3 = b3 > 31308e-7 ? 1.055 * Math.pow(b3, 1 / 2.4) - 0.055 : b3 * 12.92;
|
|
31306
|
-
r2 = Math.min(Math.max(0, r2), 1);
|
|
31307
|
-
g2 = Math.min(Math.max(0, g2), 1);
|
|
31308
|
-
b3 = Math.min(Math.max(0, b3), 1);
|
|
31309
|
-
return [r2 * 255, g2 * 255, b3 * 255];
|
|
31310
|
-
};
|
|
31311
|
-
convert2.xyz.lab = function(xyz) {
|
|
31312
|
-
var x = xyz[0];
|
|
31313
|
-
var y2 = xyz[1];
|
|
31314
|
-
var z2 = xyz[2];
|
|
31315
|
-
var l2;
|
|
31316
|
-
var a2;
|
|
31317
|
-
var b3;
|
|
31318
|
-
x /= 95.047;
|
|
31319
|
-
y2 /= 100;
|
|
31320
|
-
z2 /= 108.883;
|
|
31321
|
-
x = x > 8856e-6 ? Math.pow(x, 1 / 3) : 7.787 * x + 16 / 116;
|
|
31322
|
-
y2 = y2 > 8856e-6 ? Math.pow(y2, 1 / 3) : 7.787 * y2 + 16 / 116;
|
|
31323
|
-
z2 = z2 > 8856e-6 ? Math.pow(z2, 1 / 3) : 7.787 * z2 + 16 / 116;
|
|
31324
|
-
l2 = 116 * y2 - 16;
|
|
31325
|
-
a2 = 500 * (x - y2);
|
|
31326
|
-
b3 = 200 * (y2 - z2);
|
|
31327
|
-
return [l2, a2, b3];
|
|
31328
|
-
};
|
|
31329
|
-
convert2.lab.xyz = function(lab) {
|
|
31330
|
-
var l2 = lab[0];
|
|
31331
|
-
var a2 = lab[1];
|
|
31332
|
-
var b3 = lab[2];
|
|
31333
|
-
var x;
|
|
31334
|
-
var y2;
|
|
31335
|
-
var z2;
|
|
31336
|
-
y2 = (l2 + 16) / 116;
|
|
31337
|
-
x = a2 / 500 + y2;
|
|
31338
|
-
z2 = y2 - b3 / 200;
|
|
31339
|
-
var y22 = Math.pow(y2, 3);
|
|
31340
|
-
var x2 = Math.pow(x, 3);
|
|
31341
|
-
var z22 = Math.pow(z2, 3);
|
|
31342
|
-
y2 = y22 > 8856e-6 ? y22 : (y2 - 16 / 116) / 7.787;
|
|
31343
|
-
x = x2 > 8856e-6 ? x2 : (x - 16 / 116) / 7.787;
|
|
31344
|
-
z2 = z22 > 8856e-6 ? z22 : (z2 - 16 / 116) / 7.787;
|
|
31345
|
-
x *= 95.047;
|
|
31346
|
-
y2 *= 100;
|
|
31347
|
-
z2 *= 108.883;
|
|
31348
|
-
return [x, y2, z2];
|
|
31349
|
-
};
|
|
31350
|
-
convert2.lab.lch = function(lab) {
|
|
31351
|
-
var l2 = lab[0];
|
|
31352
|
-
var a2 = lab[1];
|
|
31353
|
-
var b3 = lab[2];
|
|
31354
|
-
var hr;
|
|
31355
|
-
var h2;
|
|
31356
|
-
var c2;
|
|
31357
|
-
hr = Math.atan2(b3, a2);
|
|
31358
|
-
h2 = hr * 360 / 2 / Math.PI;
|
|
31359
|
-
if (h2 < 0) {
|
|
31360
|
-
h2 += 360;
|
|
31361
|
-
}
|
|
31362
|
-
c2 = Math.sqrt(a2 * a2 + b3 * b3);
|
|
31363
|
-
return [l2, c2, h2];
|
|
31364
|
-
};
|
|
31365
|
-
convert2.lch.lab = function(lch) {
|
|
31366
|
-
var l2 = lch[0];
|
|
31367
|
-
var c2 = lch[1];
|
|
31368
|
-
var h2 = lch[2];
|
|
31369
|
-
var a2;
|
|
31370
|
-
var b3;
|
|
31371
|
-
var hr;
|
|
31372
|
-
hr = h2 / 360 * 2 * Math.PI;
|
|
31373
|
-
a2 = c2 * Math.cos(hr);
|
|
31374
|
-
b3 = c2 * Math.sin(hr);
|
|
31375
|
-
return [l2, a2, b3];
|
|
31376
|
-
};
|
|
31377
|
-
convert2.rgb.ansi16 = function(args) {
|
|
31378
|
-
var r2 = args[0];
|
|
31379
|
-
var g2 = args[1];
|
|
31380
|
-
var b3 = args[2];
|
|
31381
|
-
var value = 1 in arguments ? arguments[1] : convert2.rgb.hsv(args)[2];
|
|
31382
|
-
value = Math.round(value / 50);
|
|
31383
|
-
if (value === 0) {
|
|
31384
|
-
return 30;
|
|
31385
|
-
}
|
|
31386
|
-
var ansi = 30 + (Math.round(b3 / 255) << 2 | Math.round(g2 / 255) << 1 | Math.round(r2 / 255));
|
|
31387
|
-
if (value === 2) {
|
|
31388
|
-
ansi += 60;
|
|
31389
|
-
}
|
|
31390
|
-
return ansi;
|
|
31391
|
-
};
|
|
31392
|
-
convert2.hsv.ansi16 = function(args) {
|
|
31393
|
-
return convert2.rgb.ansi16(convert2.hsv.rgb(args), args[2]);
|
|
31394
|
-
};
|
|
31395
|
-
convert2.rgb.ansi256 = function(args) {
|
|
31396
|
-
var r2 = args[0];
|
|
31397
|
-
var g2 = args[1];
|
|
31398
|
-
var b3 = args[2];
|
|
31399
|
-
if (r2 === g2 && g2 === b3) {
|
|
31400
|
-
if (r2 < 8) {
|
|
31401
|
-
return 16;
|
|
31402
|
-
}
|
|
31403
|
-
if (r2 > 248) {
|
|
31404
|
-
return 231;
|
|
31405
|
-
}
|
|
31406
|
-
return Math.round((r2 - 8) / 247 * 24) + 232;
|
|
31407
|
-
}
|
|
31408
|
-
var ansi = 16 + 36 * Math.round(r2 / 255 * 5) + 6 * Math.round(g2 / 255 * 5) + Math.round(b3 / 255 * 5);
|
|
31409
|
-
return ansi;
|
|
31410
|
-
};
|
|
31411
|
-
convert2.ansi16.rgb = function(args) {
|
|
31412
|
-
var color2 = args % 10;
|
|
31413
|
-
if (color2 === 0 || color2 === 7) {
|
|
31414
|
-
if (args > 50) {
|
|
31415
|
-
color2 += 3.5;
|
|
31416
|
-
}
|
|
31417
|
-
color2 = color2 / 10.5 * 255;
|
|
31418
|
-
return [color2, color2, color2];
|
|
31419
|
-
}
|
|
31420
|
-
var mult = (~~(args > 50) + 1) * 0.5;
|
|
31421
|
-
var r2 = (color2 & 1) * mult * 255;
|
|
31422
|
-
var g2 = (color2 >> 1 & 1) * mult * 255;
|
|
31423
|
-
var b3 = (color2 >> 2 & 1) * mult * 255;
|
|
31424
|
-
return [r2, g2, b3];
|
|
31425
|
-
};
|
|
31426
|
-
convert2.ansi256.rgb = function(args) {
|
|
31427
|
-
if (args >= 232) {
|
|
31428
|
-
var c2 = (args - 232) * 10 + 8;
|
|
31429
|
-
return [c2, c2, c2];
|
|
31430
|
-
}
|
|
31431
|
-
args -= 16;
|
|
31432
|
-
var rem;
|
|
31433
|
-
var r2 = Math.floor(args / 36) / 5 * 255;
|
|
31434
|
-
var g2 = Math.floor((rem = args % 36) / 6) / 5 * 255;
|
|
31435
|
-
var b3 = rem % 6 / 5 * 255;
|
|
31436
|
-
return [r2, g2, b3];
|
|
31437
|
-
};
|
|
31438
|
-
convert2.rgb.hex = function(args) {
|
|
31439
|
-
var integer = ((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255);
|
|
31440
|
-
var string2 = integer.toString(16).toUpperCase();
|
|
31441
|
-
return "000000".substring(string2.length) + string2;
|
|
31442
|
-
};
|
|
31443
|
-
convert2.hex.rgb = function(args) {
|
|
31444
|
-
var match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
|
|
31445
|
-
if (!match) {
|
|
31446
|
-
return [0, 0, 0];
|
|
31447
|
-
}
|
|
31448
|
-
var colorString2 = match[0];
|
|
31449
|
-
if (match[0].length === 3) {
|
|
31450
|
-
colorString2 = colorString2.split("").map(function(char) {
|
|
31451
|
-
return char + char;
|
|
31452
|
-
}).join("");
|
|
31453
|
-
}
|
|
31454
|
-
var integer = parseInt(colorString2, 16);
|
|
31455
|
-
var r2 = integer >> 16 & 255;
|
|
31456
|
-
var g2 = integer >> 8 & 255;
|
|
31457
|
-
var b3 = integer & 255;
|
|
31458
|
-
return [r2, g2, b3];
|
|
31459
|
-
};
|
|
31460
|
-
convert2.rgb.hcg = function(rgb) {
|
|
31461
|
-
var r2 = rgb[0] / 255;
|
|
31462
|
-
var g2 = rgb[1] / 255;
|
|
31463
|
-
var b3 = rgb[2] / 255;
|
|
31464
|
-
var max2 = Math.max(Math.max(r2, g2), b3);
|
|
31465
|
-
var min2 = Math.min(Math.min(r2, g2), b3);
|
|
31466
|
-
var chroma = max2 - min2;
|
|
31467
|
-
var grayscale;
|
|
31468
|
-
var hue;
|
|
31469
|
-
if (chroma < 1) {
|
|
31470
|
-
grayscale = min2 / (1 - chroma);
|
|
31471
|
-
} else {
|
|
31472
|
-
grayscale = 0;
|
|
31473
|
-
}
|
|
31474
|
-
if (chroma <= 0) {
|
|
31475
|
-
hue = 0;
|
|
31476
|
-
} else if (max2 === r2) {
|
|
31477
|
-
hue = (g2 - b3) / chroma % 6;
|
|
31478
|
-
} else if (max2 === g2) {
|
|
31479
|
-
hue = 2 + (b3 - r2) / chroma;
|
|
31480
|
-
} else {
|
|
31481
|
-
hue = 4 + (r2 - g2) / chroma + 4;
|
|
31482
|
-
}
|
|
31483
|
-
hue /= 6;
|
|
31484
|
-
hue %= 1;
|
|
31485
|
-
return [hue * 360, chroma * 100, grayscale * 100];
|
|
31486
|
-
};
|
|
31487
|
-
convert2.hsl.hcg = function(hsl) {
|
|
31488
|
-
var s2 = hsl[1] / 100;
|
|
31489
|
-
var l2 = hsl[2] / 100;
|
|
31490
|
-
var c2 = 1;
|
|
31491
|
-
var f2 = 0;
|
|
31492
|
-
if (l2 < 0.5) {
|
|
31493
|
-
c2 = 2 * s2 * l2;
|
|
31494
|
-
} else {
|
|
31495
|
-
c2 = 2 * s2 * (1 - l2);
|
|
31496
|
-
}
|
|
31497
|
-
if (c2 < 1) {
|
|
31498
|
-
f2 = (l2 - 0.5 * c2) / (1 - c2);
|
|
31499
|
-
}
|
|
31500
|
-
return [hsl[0], c2 * 100, f2 * 100];
|
|
31501
|
-
};
|
|
31502
|
-
convert2.hsv.hcg = function(hsv) {
|
|
31503
|
-
var s2 = hsv[1] / 100;
|
|
31504
|
-
var v2 = hsv[2] / 100;
|
|
31505
|
-
var c2 = s2 * v2;
|
|
31506
|
-
var f2 = 0;
|
|
31507
|
-
if (c2 < 1) {
|
|
31508
|
-
f2 = (v2 - c2) / (1 - c2);
|
|
31509
|
-
}
|
|
31510
|
-
return [hsv[0], c2 * 100, f2 * 100];
|
|
31511
|
-
};
|
|
31512
|
-
convert2.hcg.rgb = function(hcg) {
|
|
31513
|
-
var h2 = hcg[0] / 360;
|
|
31514
|
-
var c2 = hcg[1] / 100;
|
|
31515
|
-
var g2 = hcg[2] / 100;
|
|
31516
|
-
if (c2 === 0) {
|
|
31517
|
-
return [g2 * 255, g2 * 255, g2 * 255];
|
|
31518
|
-
}
|
|
31519
|
-
var pure2 = [0, 0, 0];
|
|
31520
|
-
var hi = h2 % 1 * 6;
|
|
31521
|
-
var v2 = hi % 1;
|
|
31522
|
-
var w2 = 1 - v2;
|
|
31523
|
-
var mg = 0;
|
|
31524
|
-
switch (Math.floor(hi)) {
|
|
31525
|
-
case 0:
|
|
31526
|
-
pure2[0] = 1;
|
|
31527
|
-
pure2[1] = v2;
|
|
31528
|
-
pure2[2] = 0;
|
|
31529
|
-
break;
|
|
31530
|
-
case 1:
|
|
31531
|
-
pure2[0] = w2;
|
|
31532
|
-
pure2[1] = 1;
|
|
31533
|
-
pure2[2] = 0;
|
|
31534
|
-
break;
|
|
31535
|
-
case 2:
|
|
31536
|
-
pure2[0] = 0;
|
|
31537
|
-
pure2[1] = 1;
|
|
31538
|
-
pure2[2] = v2;
|
|
31539
|
-
break;
|
|
31540
|
-
case 3:
|
|
31541
|
-
pure2[0] = 0;
|
|
31542
|
-
pure2[1] = w2;
|
|
31543
|
-
pure2[2] = 1;
|
|
31544
|
-
break;
|
|
31545
|
-
case 4:
|
|
31546
|
-
pure2[0] = v2;
|
|
31547
|
-
pure2[1] = 0;
|
|
31548
|
-
pure2[2] = 1;
|
|
31549
|
-
break;
|
|
31550
|
-
default:
|
|
31551
|
-
pure2[0] = 1;
|
|
31552
|
-
pure2[1] = 0;
|
|
31553
|
-
pure2[2] = w2;
|
|
30988
|
+
case 1: {
|
|
30989
|
+
return [q2, v2, p2];
|
|
31554
30990
|
}
|
|
31555
|
-
|
|
31556
|
-
|
|
31557
|
-
|
|
31558
|
-
|
|
31559
|
-
|
|
31560
|
-
|
|
31561
|
-
|
|
31562
|
-
|
|
31563
|
-
|
|
31564
|
-
|
|
31565
|
-
|
|
31566
|
-
var f2 = 0;
|
|
31567
|
-
if (v2 > 0) {
|
|
31568
|
-
f2 = c2 / v2;
|
|
31569
|
-
}
|
|
31570
|
-
return [hcg[0], f2 * 100, v2 * 100];
|
|
31571
|
-
};
|
|
31572
|
-
convert2.hcg.hsl = function(hcg) {
|
|
31573
|
-
var c2 = hcg[1] / 100;
|
|
31574
|
-
var g2 = hcg[2] / 100;
|
|
31575
|
-
var l2 = g2 * (1 - c2) + 0.5 * c2;
|
|
31576
|
-
var s2 = 0;
|
|
31577
|
-
if (l2 > 0 && l2 < 0.5) {
|
|
31578
|
-
s2 = c2 / (2 * l2);
|
|
31579
|
-
} else if (l2 >= 0.5 && l2 < 1) {
|
|
31580
|
-
s2 = c2 / (2 * (1 - l2));
|
|
31581
|
-
}
|
|
31582
|
-
return [hcg[0], s2 * 100, l2 * 100];
|
|
31583
|
-
};
|
|
31584
|
-
convert2.hcg.hwb = function(hcg) {
|
|
31585
|
-
var c2 = hcg[1] / 100;
|
|
31586
|
-
var g2 = hcg[2] / 100;
|
|
31587
|
-
var v2 = c2 + g2 * (1 - c2);
|
|
31588
|
-
return [hcg[0], (v2 - c2) * 100, (1 - v2) * 100];
|
|
31589
|
-
};
|
|
31590
|
-
convert2.hwb.hcg = function(hwb) {
|
|
31591
|
-
var w2 = hwb[1] / 100;
|
|
31592
|
-
var b3 = hwb[2] / 100;
|
|
31593
|
-
var v2 = 1 - b3;
|
|
31594
|
-
var c2 = v2 - w2;
|
|
31595
|
-
var g2 = 0;
|
|
31596
|
-
if (c2 < 1) {
|
|
31597
|
-
g2 = (v2 - c2) / (1 - c2);
|
|
31598
|
-
}
|
|
31599
|
-
return [hwb[0], c2 * 100, g2 * 100];
|
|
31600
|
-
};
|
|
31601
|
-
convert2.apple.rgb = function(apple) {
|
|
31602
|
-
return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
|
|
31603
|
-
};
|
|
31604
|
-
convert2.rgb.apple = function(rgb) {
|
|
31605
|
-
return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];
|
|
31606
|
-
};
|
|
31607
|
-
convert2.gray.rgb = function(args) {
|
|
31608
|
-
return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
|
|
31609
|
-
};
|
|
31610
|
-
convert2.gray.hsl = convert2.gray.hsv = function(args) {
|
|
31611
|
-
return [0, 0, args[0]];
|
|
31612
|
-
};
|
|
31613
|
-
convert2.gray.hwb = function(gray) {
|
|
31614
|
-
return [0, 100, gray[0]];
|
|
31615
|
-
};
|
|
31616
|
-
convert2.gray.cmyk = function(gray) {
|
|
31617
|
-
return [0, 0, 0, gray[0]];
|
|
31618
|
-
};
|
|
31619
|
-
convert2.gray.lab = function(gray) {
|
|
31620
|
-
return [gray[0], 0, 0];
|
|
31621
|
-
};
|
|
31622
|
-
convert2.gray.hex = function(gray) {
|
|
31623
|
-
var val2 = Math.round(gray[0] / 100 * 255) & 255;
|
|
31624
|
-
var integer = (val2 << 16) + (val2 << 8) + val2;
|
|
31625
|
-
var string2 = integer.toString(16).toUpperCase();
|
|
31626
|
-
return "000000".substring(string2.length) + string2;
|
|
31627
|
-
};
|
|
31628
|
-
convert2.rgb.gray = function(rgb) {
|
|
31629
|
-
var val2 = (rgb[0] + rgb[1] + rgb[2]) / 3;
|
|
31630
|
-
return [val2 / 255 * 100];
|
|
31631
|
-
};
|
|
31632
|
-
return conversions.exports;
|
|
31633
|
-
}
|
|
31634
|
-
__name(requireConversions, "requireConversions");
|
|
31635
|
-
var route;
|
|
31636
|
-
var hasRequiredRoute;
|
|
31637
|
-
function requireRoute() {
|
|
31638
|
-
if (hasRequiredRoute) return route;
|
|
31639
|
-
hasRequiredRoute = 1;
|
|
31640
|
-
var conversions2 = requireConversions();
|
|
31641
|
-
function buildGraph() {
|
|
31642
|
-
var graph = {};
|
|
31643
|
-
var models = Object.keys(conversions2);
|
|
31644
|
-
for (var len = models.length, i = 0; i < len; i++) {
|
|
31645
|
-
graph[models[i]] = {
|
|
31646
|
-
// http://jsperf.com/1-vs-infinity
|
|
31647
|
-
// micro-opt, but this is simple.
|
|
31648
|
-
distance: -1,
|
|
31649
|
-
parent: null
|
|
31650
|
-
};
|
|
30991
|
+
case 2: {
|
|
30992
|
+
return [p2, v2, t2];
|
|
30993
|
+
}
|
|
30994
|
+
case 3: {
|
|
30995
|
+
return [p2, q2, v2];
|
|
30996
|
+
}
|
|
30997
|
+
case 4: {
|
|
30998
|
+
return [t2, p2, v2];
|
|
30999
|
+
}
|
|
31000
|
+
case 5: {
|
|
31001
|
+
return [v2, p2, q2];
|
|
31651
31002
|
}
|
|
31652
|
-
return graph;
|
|
31653
31003
|
}
|
|
31654
|
-
|
|
31655
|
-
|
|
31656
|
-
|
|
31657
|
-
|
|
31658
|
-
|
|
31659
|
-
|
|
31660
|
-
|
|
31661
|
-
|
|
31662
|
-
|
|
31663
|
-
|
|
31664
|
-
|
|
31665
|
-
|
|
31666
|
-
|
|
31667
|
-
|
|
31668
|
-
|
|
31669
|
-
|
|
31670
|
-
|
|
31004
|
+
};
|
|
31005
|
+
convert$2.hsv.hsl = function(hsv) {
|
|
31006
|
+
const h2 = hsv[0];
|
|
31007
|
+
const s2 = hsv[1] / 100;
|
|
31008
|
+
const v2 = hsv[2] / 100;
|
|
31009
|
+
const vmin = Math.max(v2, 0.01);
|
|
31010
|
+
let sl;
|
|
31011
|
+
let l2;
|
|
31012
|
+
l2 = (2 - s2) * v2;
|
|
31013
|
+
const lmin = (2 - s2) * vmin;
|
|
31014
|
+
sl = s2 * vmin;
|
|
31015
|
+
sl /= lmin <= 1 ? lmin : 2 - lmin;
|
|
31016
|
+
sl = sl || 0;
|
|
31017
|
+
l2 /= 2;
|
|
31018
|
+
return [h2, sl * 100, l2 * 100];
|
|
31019
|
+
};
|
|
31020
|
+
convert$2.hwb.rgb = function(hwb) {
|
|
31021
|
+
const h2 = hwb[0] / 360;
|
|
31022
|
+
let wh = hwb[1] / 100;
|
|
31023
|
+
let bl = hwb[2] / 100;
|
|
31024
|
+
const ratio = wh + bl;
|
|
31025
|
+
let f2;
|
|
31026
|
+
if (ratio > 1) {
|
|
31027
|
+
wh /= ratio;
|
|
31028
|
+
bl /= ratio;
|
|
31029
|
+
}
|
|
31030
|
+
const i = Math.floor(6 * h2);
|
|
31031
|
+
const v2 = 1 - bl;
|
|
31032
|
+
f2 = 6 * h2 - i;
|
|
31033
|
+
if ((i & 1) !== 0) {
|
|
31034
|
+
f2 = 1 - f2;
|
|
31035
|
+
}
|
|
31036
|
+
const n2 = wh + f2 * (v2 - wh);
|
|
31037
|
+
let r2;
|
|
31038
|
+
let g2;
|
|
31039
|
+
let b3;
|
|
31040
|
+
switch (i) {
|
|
31041
|
+
default:
|
|
31042
|
+
case 6:
|
|
31043
|
+
case 0: {
|
|
31044
|
+
r2 = v2;
|
|
31045
|
+
g2 = n2;
|
|
31046
|
+
b3 = wh;
|
|
31047
|
+
break;
|
|
31048
|
+
}
|
|
31049
|
+
case 1: {
|
|
31050
|
+
r2 = n2;
|
|
31051
|
+
g2 = v2;
|
|
31052
|
+
b3 = wh;
|
|
31053
|
+
break;
|
|
31054
|
+
}
|
|
31055
|
+
case 2: {
|
|
31056
|
+
r2 = wh;
|
|
31057
|
+
g2 = v2;
|
|
31058
|
+
b3 = n2;
|
|
31059
|
+
break;
|
|
31060
|
+
}
|
|
31061
|
+
case 3: {
|
|
31062
|
+
r2 = wh;
|
|
31063
|
+
g2 = n2;
|
|
31064
|
+
b3 = v2;
|
|
31065
|
+
break;
|
|
31066
|
+
}
|
|
31067
|
+
case 4: {
|
|
31068
|
+
r2 = n2;
|
|
31069
|
+
g2 = wh;
|
|
31070
|
+
b3 = v2;
|
|
31071
|
+
break;
|
|
31072
|
+
}
|
|
31073
|
+
case 5: {
|
|
31074
|
+
r2 = v2;
|
|
31075
|
+
g2 = wh;
|
|
31076
|
+
b3 = n2;
|
|
31077
|
+
break;
|
|
31078
|
+
}
|
|
31079
|
+
}
|
|
31080
|
+
return [r2 * 255, g2 * 255, b3 * 255];
|
|
31081
|
+
};
|
|
31082
|
+
convert$2.cmyk.rgb = function(cmyk) {
|
|
31083
|
+
const c2 = cmyk[0] / 100;
|
|
31084
|
+
const m2 = cmyk[1] / 100;
|
|
31085
|
+
const y2 = cmyk[2] / 100;
|
|
31086
|
+
const k2 = cmyk[3] / 100;
|
|
31087
|
+
const r2 = 1 - Math.min(1, c2 * (1 - k2) + k2);
|
|
31088
|
+
const g2 = 1 - Math.min(1, m2 * (1 - k2) + k2);
|
|
31089
|
+
const b3 = 1 - Math.min(1, y2 * (1 - k2) + k2);
|
|
31090
|
+
return [r2 * 255, g2 * 255, b3 * 255];
|
|
31091
|
+
};
|
|
31092
|
+
convert$2.xyz.rgb = function(xyz) {
|
|
31093
|
+
const x = xyz[0] / 100;
|
|
31094
|
+
const y2 = xyz[1] / 100;
|
|
31095
|
+
const z2 = xyz[2] / 100;
|
|
31096
|
+
let r2;
|
|
31097
|
+
let g2;
|
|
31098
|
+
let b3;
|
|
31099
|
+
r2 = x * 3.2404542 + y2 * -1.5371385 + z2 * -0.4985314;
|
|
31100
|
+
g2 = x * -0.969266 + y2 * 1.8760108 + z2 * 0.041556;
|
|
31101
|
+
b3 = x * 0.0556434 + y2 * -0.2040259 + z2 * 1.0572252;
|
|
31102
|
+
r2 = srgbNonlinearTransform(r2);
|
|
31103
|
+
g2 = srgbNonlinearTransform(g2);
|
|
31104
|
+
b3 = srgbNonlinearTransform(b3);
|
|
31105
|
+
return [r2 * 255, g2 * 255, b3 * 255];
|
|
31106
|
+
};
|
|
31107
|
+
convert$2.xyz.lab = function(xyz) {
|
|
31108
|
+
let x = xyz[0];
|
|
31109
|
+
let y2 = xyz[1];
|
|
31110
|
+
let z2 = xyz[2];
|
|
31111
|
+
x /= 95.047;
|
|
31112
|
+
y2 /= 100;
|
|
31113
|
+
z2 /= 108.883;
|
|
31114
|
+
x = x > LAB_FT ? __pow(x, 1 / 3) : 7.787 * x + 16 / 116;
|
|
31115
|
+
y2 = y2 > LAB_FT ? __pow(y2, 1 / 3) : 7.787 * y2 + 16 / 116;
|
|
31116
|
+
z2 = z2 > LAB_FT ? __pow(z2, 1 / 3) : 7.787 * z2 + 16 / 116;
|
|
31117
|
+
const l2 = 116 * y2 - 16;
|
|
31118
|
+
const a2 = 500 * (x - y2);
|
|
31119
|
+
const b3 = 200 * (y2 - z2);
|
|
31120
|
+
return [l2, a2, b3];
|
|
31121
|
+
};
|
|
31122
|
+
convert$2.xyz.oklab = function(xyz) {
|
|
31123
|
+
const x = xyz[0] / 100;
|
|
31124
|
+
const y2 = xyz[1] / 100;
|
|
31125
|
+
const z2 = xyz[2] / 100;
|
|
31126
|
+
const lp = Math.cbrt(0.8189330101 * x + 0.3618667424 * y2 - 0.1288597137 * z2);
|
|
31127
|
+
const mp = Math.cbrt(0.0329845436 * x + 0.9293118715 * y2 + 0.0361456387 * z2);
|
|
31128
|
+
const sp = Math.cbrt(0.0482003018 * x + 0.2643662691 * y2 + 0.633851707 * z2);
|
|
31129
|
+
const l2 = 0.2104542553 * lp + 0.793617785 * mp - 0.0040720468 * sp;
|
|
31130
|
+
const a2 = 1.9779984951 * lp - 2.428592205 * mp + 0.4505937099 * sp;
|
|
31131
|
+
const b3 = 0.0259040371 * lp + 0.7827717662 * mp - 0.808675766 * sp;
|
|
31132
|
+
return [l2 * 100, a2 * 100, b3 * 100];
|
|
31133
|
+
};
|
|
31134
|
+
convert$2.oklab.oklch = function(oklab) {
|
|
31135
|
+
return convert$2.lab.lch(oklab);
|
|
31136
|
+
};
|
|
31137
|
+
convert$2.oklab.xyz = function(oklab) {
|
|
31138
|
+
const ll = oklab[0] / 100;
|
|
31139
|
+
const a2 = oklab[1] / 100;
|
|
31140
|
+
const b3 = oklab[2] / 100;
|
|
31141
|
+
const l2 = __pow(0.999999998 * ll + 0.396337792 * a2 + 0.215803758 * b3, 3);
|
|
31142
|
+
const m2 = __pow(1.000000008 * ll - 0.105561342 * a2 - 0.063854175 * b3, 3);
|
|
31143
|
+
const s2 = __pow(1.000000055 * ll - 0.089484182 * a2 - 1.291485538 * b3, 3);
|
|
31144
|
+
const x = 1.227013851 * l2 - 0.55779998 * m2 + 0.281256149 * s2;
|
|
31145
|
+
const y2 = -0.040580178 * l2 + 1.11225687 * m2 - 0.071676679 * s2;
|
|
31146
|
+
const z2 = -0.076381285 * l2 - 0.421481978 * m2 + 1.58616322 * s2;
|
|
31147
|
+
return [x * 100, y2 * 100, z2 * 100];
|
|
31148
|
+
};
|
|
31149
|
+
convert$2.oklab.rgb = function(oklab) {
|
|
31150
|
+
const ll = oklab[0] / 100;
|
|
31151
|
+
const aa = oklab[1] / 100;
|
|
31152
|
+
const bb = oklab[2] / 100;
|
|
31153
|
+
const l2 = __pow(ll + 0.3963377774 * aa + 0.2158037573 * bb, 3);
|
|
31154
|
+
const m2 = __pow(ll - 0.1055613458 * aa - 0.0638541728 * bb, 3);
|
|
31155
|
+
const s2 = __pow(ll - 0.0894841775 * aa - 1.291485548 * bb, 3);
|
|
31156
|
+
const r2 = srgbNonlinearTransform(4.0767416621 * l2 - 3.3077115913 * m2 + 0.2309699292 * s2);
|
|
31157
|
+
const g2 = srgbNonlinearTransform(-1.2684380046 * l2 + 2.6097574011 * m2 - 0.3413193965 * s2);
|
|
31158
|
+
const b3 = srgbNonlinearTransform(-0.0041960863 * l2 - 0.7034186147 * m2 + 1.707614701 * s2);
|
|
31159
|
+
return [r2 * 255, g2 * 255, b3 * 255];
|
|
31160
|
+
};
|
|
31161
|
+
convert$2.oklch.oklab = function(oklch) {
|
|
31162
|
+
return convert$2.lch.lab(oklch);
|
|
31163
|
+
};
|
|
31164
|
+
convert$2.lab.xyz = function(lab) {
|
|
31165
|
+
const l2 = lab[0];
|
|
31166
|
+
const a2 = lab[1];
|
|
31167
|
+
const b3 = lab[2];
|
|
31168
|
+
let x;
|
|
31169
|
+
let y2;
|
|
31170
|
+
let z2;
|
|
31171
|
+
y2 = (l2 + 16) / 116;
|
|
31172
|
+
x = a2 / 500 + y2;
|
|
31173
|
+
z2 = y2 - b3 / 200;
|
|
31174
|
+
const y22 = __pow(y2, 3);
|
|
31175
|
+
const x2 = __pow(x, 3);
|
|
31176
|
+
const z22 = __pow(z2, 3);
|
|
31177
|
+
y2 = y22 > LAB_FT ? y22 : (y2 - 16 / 116) / 7.787;
|
|
31178
|
+
x = x2 > LAB_FT ? x2 : (x - 16 / 116) / 7.787;
|
|
31179
|
+
z2 = z22 > LAB_FT ? z22 : (z2 - 16 / 116) / 7.787;
|
|
31180
|
+
x *= 95.047;
|
|
31181
|
+
y2 *= 100;
|
|
31182
|
+
z2 *= 108.883;
|
|
31183
|
+
return [x, y2, z2];
|
|
31184
|
+
};
|
|
31185
|
+
convert$2.lab.lch = function(lab) {
|
|
31186
|
+
const l2 = lab[0];
|
|
31187
|
+
const a2 = lab[1];
|
|
31188
|
+
const b3 = lab[2];
|
|
31189
|
+
let h2;
|
|
31190
|
+
const hr = Math.atan2(b3, a2);
|
|
31191
|
+
h2 = hr * 360 / 2 / Math.PI;
|
|
31192
|
+
if (h2 < 0) {
|
|
31193
|
+
h2 += 360;
|
|
31194
|
+
}
|
|
31195
|
+
const c2 = Math.sqrt(a2 * a2 + b3 * b3);
|
|
31196
|
+
return [l2, c2, h2];
|
|
31197
|
+
};
|
|
31198
|
+
convert$2.lch.lab = function(lch) {
|
|
31199
|
+
const l2 = lch[0];
|
|
31200
|
+
const c2 = lch[1];
|
|
31201
|
+
const h2 = lch[2];
|
|
31202
|
+
const hr = h2 / 360 * 2 * Math.PI;
|
|
31203
|
+
const a2 = c2 * Math.cos(hr);
|
|
31204
|
+
const b3 = c2 * Math.sin(hr);
|
|
31205
|
+
return [l2, a2, b3];
|
|
31206
|
+
};
|
|
31207
|
+
convert$2.rgb.ansi16 = function(args, saturation = null) {
|
|
31208
|
+
const [r2, g2, b3] = args;
|
|
31209
|
+
let value = saturation === null ? convert$2.rgb.hsv(args)[2] : saturation;
|
|
31210
|
+
value = Math.round(value / 50);
|
|
31211
|
+
if (value === 0) {
|
|
31212
|
+
return 30;
|
|
31213
|
+
}
|
|
31214
|
+
let ansi = 30 + (Math.round(b3 / 255) << 2 | Math.round(g2 / 255) << 1 | Math.round(r2 / 255));
|
|
31215
|
+
if (value === 2) {
|
|
31216
|
+
ansi += 60;
|
|
31217
|
+
}
|
|
31218
|
+
return ansi;
|
|
31219
|
+
};
|
|
31220
|
+
convert$2.hsv.ansi16 = function(args) {
|
|
31221
|
+
return convert$2.rgb.ansi16(convert$2.hsv.rgb(args), args[2]);
|
|
31222
|
+
};
|
|
31223
|
+
convert$2.rgb.ansi256 = function(args) {
|
|
31224
|
+
const r2 = args[0];
|
|
31225
|
+
const g2 = args[1];
|
|
31226
|
+
const b3 = args[2];
|
|
31227
|
+
if (r2 >> 4 === g2 >> 4 && g2 >> 4 === b3 >> 4) {
|
|
31228
|
+
if (r2 < 8) {
|
|
31229
|
+
return 16;
|
|
31230
|
+
}
|
|
31231
|
+
if (r2 > 248) {
|
|
31232
|
+
return 231;
|
|
31233
|
+
}
|
|
31234
|
+
return Math.round((r2 - 8) / 247 * 24) + 232;
|
|
31235
|
+
}
|
|
31236
|
+
const ansi = 16 + 36 * Math.round(r2 / 255 * 5) + 6 * Math.round(g2 / 255 * 5) + Math.round(b3 / 255 * 5);
|
|
31237
|
+
return ansi;
|
|
31238
|
+
};
|
|
31239
|
+
convert$2.ansi16.rgb = function(args) {
|
|
31240
|
+
args = args[0];
|
|
31241
|
+
let color2 = args % 10;
|
|
31242
|
+
if (color2 === 0 || color2 === 7) {
|
|
31243
|
+
if (args > 50) {
|
|
31244
|
+
color2 += 3.5;
|
|
31245
|
+
}
|
|
31246
|
+
color2 = color2 / 10.5 * 255;
|
|
31247
|
+
return [color2, color2, color2];
|
|
31248
|
+
}
|
|
31249
|
+
const mult = (Math.trunc(args > 50) + 1) * 0.5;
|
|
31250
|
+
const r2 = (color2 & 1) * mult * 255;
|
|
31251
|
+
const g2 = (color2 >> 1 & 1) * mult * 255;
|
|
31252
|
+
const b3 = (color2 >> 2 & 1) * mult * 255;
|
|
31253
|
+
return [r2, g2, b3];
|
|
31254
|
+
};
|
|
31255
|
+
convert$2.ansi256.rgb = function(args) {
|
|
31256
|
+
args = args[0];
|
|
31257
|
+
if (args >= 232) {
|
|
31258
|
+
const c2 = (args - 232) * 10 + 8;
|
|
31259
|
+
return [c2, c2, c2];
|
|
31260
|
+
}
|
|
31261
|
+
args -= 16;
|
|
31262
|
+
let rem;
|
|
31263
|
+
const r2 = Math.floor(args / 36) / 5 * 255;
|
|
31264
|
+
const g2 = Math.floor((rem = args % 36) / 6) / 5 * 255;
|
|
31265
|
+
const b3 = rem % 6 / 5 * 255;
|
|
31266
|
+
return [r2, g2, b3];
|
|
31267
|
+
};
|
|
31268
|
+
convert$2.rgb.hex = function(args) {
|
|
31269
|
+
const integer = ((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255);
|
|
31270
|
+
const string2 = integer.toString(16).toUpperCase();
|
|
31271
|
+
return "000000".slice(string2.length) + string2;
|
|
31272
|
+
};
|
|
31273
|
+
convert$2.hex.rgb = function(args) {
|
|
31274
|
+
const match = args.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);
|
|
31275
|
+
if (!match) {
|
|
31276
|
+
return [0, 0, 0];
|
|
31277
|
+
}
|
|
31278
|
+
let colorString = match[0];
|
|
31279
|
+
if (match[0].length === 3) {
|
|
31280
|
+
colorString = [...colorString].map((char) => char + char).join("");
|
|
31281
|
+
}
|
|
31282
|
+
const integer = Number.parseInt(colorString, 16);
|
|
31283
|
+
const r2 = integer >> 16 & 255;
|
|
31284
|
+
const g2 = integer >> 8 & 255;
|
|
31285
|
+
const b3 = integer & 255;
|
|
31286
|
+
return [r2, g2, b3];
|
|
31287
|
+
};
|
|
31288
|
+
convert$2.rgb.hcg = function(rgb) {
|
|
31289
|
+
const r2 = rgb[0] / 255;
|
|
31290
|
+
const g2 = rgb[1] / 255;
|
|
31291
|
+
const b3 = rgb[2] / 255;
|
|
31292
|
+
const max2 = Math.max(Math.max(r2, g2), b3);
|
|
31293
|
+
const min2 = Math.min(Math.min(r2, g2), b3);
|
|
31294
|
+
const chroma = max2 - min2;
|
|
31295
|
+
let hue;
|
|
31296
|
+
const grayscale = chroma < 1 ? min2 / (1 - chroma) : 0;
|
|
31297
|
+
if (chroma <= 0) {
|
|
31298
|
+
hue = 0;
|
|
31299
|
+
} else if (max2 === r2) {
|
|
31300
|
+
hue = (g2 - b3) / chroma % 6;
|
|
31301
|
+
} else if (max2 === g2) {
|
|
31302
|
+
hue = 2 + (b3 - r2) / chroma;
|
|
31303
|
+
} else {
|
|
31304
|
+
hue = 4 + (r2 - g2) / chroma;
|
|
31305
|
+
}
|
|
31306
|
+
hue /= 6;
|
|
31307
|
+
hue %= 1;
|
|
31308
|
+
return [hue * 360, chroma * 100, grayscale * 100];
|
|
31309
|
+
};
|
|
31310
|
+
convert$2.hsl.hcg = function(hsl) {
|
|
31311
|
+
const s2 = hsl[1] / 100;
|
|
31312
|
+
const l2 = hsl[2] / 100;
|
|
31313
|
+
const c2 = l2 < 0.5 ? 2 * s2 * l2 : 2 * s2 * (1 - l2);
|
|
31314
|
+
let f2 = 0;
|
|
31315
|
+
if (c2 < 1) {
|
|
31316
|
+
f2 = (l2 - 0.5 * c2) / (1 - c2);
|
|
31317
|
+
}
|
|
31318
|
+
return [hsl[0], c2 * 100, f2 * 100];
|
|
31319
|
+
};
|
|
31320
|
+
convert$2.hsv.hcg = function(hsv) {
|
|
31321
|
+
const s2 = hsv[1] / 100;
|
|
31322
|
+
const v2 = hsv[2] / 100;
|
|
31323
|
+
const c2 = s2 * v2;
|
|
31324
|
+
let f2 = 0;
|
|
31325
|
+
if (c2 < 1) {
|
|
31326
|
+
f2 = (v2 - c2) / (1 - c2);
|
|
31327
|
+
}
|
|
31328
|
+
return [hsv[0], c2 * 100, f2 * 100];
|
|
31329
|
+
};
|
|
31330
|
+
convert$2.hcg.rgb = function(hcg) {
|
|
31331
|
+
const h2 = hcg[0] / 360;
|
|
31332
|
+
const c2 = hcg[1] / 100;
|
|
31333
|
+
const g2 = hcg[2] / 100;
|
|
31334
|
+
if (c2 === 0) {
|
|
31335
|
+
return [g2 * 255, g2 * 255, g2 * 255];
|
|
31336
|
+
}
|
|
31337
|
+
const pure2 = [0, 0, 0];
|
|
31338
|
+
const hi = h2 % 1 * 6;
|
|
31339
|
+
const v2 = hi % 1;
|
|
31340
|
+
const w2 = 1 - v2;
|
|
31341
|
+
let mg = 0;
|
|
31342
|
+
switch (Math.floor(hi)) {
|
|
31343
|
+
case 0: {
|
|
31344
|
+
pure2[0] = 1;
|
|
31345
|
+
pure2[1] = v2;
|
|
31346
|
+
pure2[2] = 0;
|
|
31347
|
+
break;
|
|
31348
|
+
}
|
|
31349
|
+
case 1: {
|
|
31350
|
+
pure2[0] = w2;
|
|
31351
|
+
pure2[1] = 1;
|
|
31352
|
+
pure2[2] = 0;
|
|
31353
|
+
break;
|
|
31354
|
+
}
|
|
31355
|
+
case 2: {
|
|
31356
|
+
pure2[0] = 0;
|
|
31357
|
+
pure2[1] = 1;
|
|
31358
|
+
pure2[2] = v2;
|
|
31359
|
+
break;
|
|
31360
|
+
}
|
|
31361
|
+
case 3: {
|
|
31362
|
+
pure2[0] = 0;
|
|
31363
|
+
pure2[1] = w2;
|
|
31364
|
+
pure2[2] = 1;
|
|
31365
|
+
break;
|
|
31366
|
+
}
|
|
31367
|
+
case 4: {
|
|
31368
|
+
pure2[0] = v2;
|
|
31369
|
+
pure2[1] = 0;
|
|
31370
|
+
pure2[2] = 1;
|
|
31371
|
+
break;
|
|
31372
|
+
}
|
|
31373
|
+
default: {
|
|
31374
|
+
pure2[0] = 1;
|
|
31375
|
+
pure2[1] = 0;
|
|
31376
|
+
pure2[2] = w2;
|
|
31671
31377
|
}
|
|
31672
|
-
return graph;
|
|
31673
31378
|
}
|
|
31674
|
-
|
|
31675
|
-
|
|
31676
|
-
|
|
31677
|
-
|
|
31379
|
+
mg = (1 - c2) * g2;
|
|
31380
|
+
return [
|
|
31381
|
+
(c2 * pure2[0] + mg) * 255,
|
|
31382
|
+
(c2 * pure2[1] + mg) * 255,
|
|
31383
|
+
(c2 * pure2[2] + mg) * 255
|
|
31384
|
+
];
|
|
31385
|
+
};
|
|
31386
|
+
convert$2.hcg.hsv = function(hcg) {
|
|
31387
|
+
const c2 = hcg[1] / 100;
|
|
31388
|
+
const g2 = hcg[2] / 100;
|
|
31389
|
+
const v2 = c2 + g2 * (1 - c2);
|
|
31390
|
+
let f2 = 0;
|
|
31391
|
+
if (v2 > 0) {
|
|
31392
|
+
f2 = c2 / v2;
|
|
31393
|
+
}
|
|
31394
|
+
return [hcg[0], f2 * 100, v2 * 100];
|
|
31395
|
+
};
|
|
31396
|
+
convert$2.hcg.hsl = function(hcg) {
|
|
31397
|
+
const c2 = hcg[1] / 100;
|
|
31398
|
+
const g2 = hcg[2] / 100;
|
|
31399
|
+
const l2 = g2 * (1 - c2) + 0.5 * c2;
|
|
31400
|
+
let s2 = 0;
|
|
31401
|
+
if (l2 > 0 && l2 < 0.5) {
|
|
31402
|
+
s2 = c2 / (2 * l2);
|
|
31403
|
+
} else if (l2 >= 0.5 && l2 < 1) {
|
|
31404
|
+
s2 = c2 / (2 * (1 - l2));
|
|
31405
|
+
}
|
|
31406
|
+
return [hcg[0], s2 * 100, l2 * 100];
|
|
31407
|
+
};
|
|
31408
|
+
convert$2.hcg.hwb = function(hcg) {
|
|
31409
|
+
const c2 = hcg[1] / 100;
|
|
31410
|
+
const g2 = hcg[2] / 100;
|
|
31411
|
+
const v2 = c2 + g2 * (1 - c2);
|
|
31412
|
+
return [hcg[0], (v2 - c2) * 100, (1 - v2) * 100];
|
|
31413
|
+
};
|
|
31414
|
+
convert$2.hwb.hcg = function(hwb) {
|
|
31415
|
+
const w2 = hwb[1] / 100;
|
|
31416
|
+
const b3 = hwb[2] / 100;
|
|
31417
|
+
const v2 = 1 - b3;
|
|
31418
|
+
const c2 = v2 - w2;
|
|
31419
|
+
let g2 = 0;
|
|
31420
|
+
if (c2 < 1) {
|
|
31421
|
+
g2 = (v2 - c2) / (1 - c2);
|
|
31422
|
+
}
|
|
31423
|
+
return [hwb[0], c2 * 100, g2 * 100];
|
|
31424
|
+
};
|
|
31425
|
+
convert$2.apple.rgb = function(apple) {
|
|
31426
|
+
return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
|
|
31427
|
+
};
|
|
31428
|
+
convert$2.rgb.apple = function(rgb) {
|
|
31429
|
+
return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];
|
|
31430
|
+
};
|
|
31431
|
+
convert$2.gray.rgb = function(args) {
|
|
31432
|
+
return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
|
|
31433
|
+
};
|
|
31434
|
+
convert$2.gray.hsl = function(args) {
|
|
31435
|
+
return [0, 0, args[0]];
|
|
31436
|
+
};
|
|
31437
|
+
convert$2.gray.hsv = convert$2.gray.hsl;
|
|
31438
|
+
convert$2.gray.hwb = function(gray) {
|
|
31439
|
+
return [0, 100, gray[0]];
|
|
31440
|
+
};
|
|
31441
|
+
convert$2.gray.cmyk = function(gray) {
|
|
31442
|
+
return [0, 0, 0, gray[0]];
|
|
31443
|
+
};
|
|
31444
|
+
convert$2.gray.lab = function(gray) {
|
|
31445
|
+
return [gray[0], 0, 0];
|
|
31446
|
+
};
|
|
31447
|
+
convert$2.gray.hex = function(gray) {
|
|
31448
|
+
const value = Math.round(gray[0] / 100 * 255) & 255;
|
|
31449
|
+
const integer = (value << 16) + (value << 8) + value;
|
|
31450
|
+
const string2 = integer.toString(16).toUpperCase();
|
|
31451
|
+
return "000000".slice(string2.length) + string2;
|
|
31452
|
+
};
|
|
31453
|
+
convert$2.rgb.gray = function(rgb) {
|
|
31454
|
+
const value = (rgb[0] + rgb[1] + rgb[2]) / 3;
|
|
31455
|
+
return [value / 255 * 100];
|
|
31456
|
+
};
|
|
31457
|
+
function buildGraph() {
|
|
31458
|
+
const graph = {};
|
|
31459
|
+
const models2 = Object.keys(convert$2);
|
|
31460
|
+
for (let { length } = models2, i = 0; i < length; i++) {
|
|
31461
|
+
graph[models2[i]] = {
|
|
31462
|
+
// http://jsperf.com/1-vs-infinity
|
|
31463
|
+
// micro-opt, but this is simple.
|
|
31464
|
+
distance: -1,
|
|
31465
|
+
parent: null
|
|
31678
31466
|
};
|
|
31679
31467
|
}
|
|
31680
|
-
|
|
31681
|
-
|
|
31682
|
-
|
|
31683
|
-
|
|
31684
|
-
|
|
31685
|
-
|
|
31686
|
-
|
|
31687
|
-
|
|
31688
|
-
|
|
31689
|
-
|
|
31690
|
-
|
|
31691
|
-
|
|
31468
|
+
return graph;
|
|
31469
|
+
}
|
|
31470
|
+
__name(buildGraph, "buildGraph");
|
|
31471
|
+
function deriveBFS(fromModel) {
|
|
31472
|
+
const graph = buildGraph();
|
|
31473
|
+
const queue = [fromModel];
|
|
31474
|
+
graph[fromModel].distance = 0;
|
|
31475
|
+
while (queue.length > 0) {
|
|
31476
|
+
const current = queue.pop();
|
|
31477
|
+
const adjacents = Object.keys(convert$2[current]);
|
|
31478
|
+
for (let { length } = adjacents, i = 0; i < length; i++) {
|
|
31479
|
+
const adjacent = adjacents[i];
|
|
31480
|
+
const node2 = graph[adjacent];
|
|
31481
|
+
if (node2.distance === -1) {
|
|
31482
|
+
node2.distance = graph[current].distance + 1;
|
|
31483
|
+
node2.parent = current;
|
|
31484
|
+
queue.unshift(adjacent);
|
|
31485
|
+
}
|
|
31486
|
+
}
|
|
31487
|
+
}
|
|
31488
|
+
return graph;
|
|
31489
|
+
}
|
|
31490
|
+
__name(deriveBFS, "deriveBFS");
|
|
31491
|
+
function link$2(from, to) {
|
|
31492
|
+
return function(args) {
|
|
31493
|
+
return to(from(args));
|
|
31494
|
+
};
|
|
31495
|
+
}
|
|
31496
|
+
__name(link$2, "link$2");
|
|
31497
|
+
function wrapConversion(toModel, graph) {
|
|
31498
|
+
const path2 = [graph[toModel].parent, toModel];
|
|
31499
|
+
let fn4 = convert$2[graph[toModel].parent][toModel];
|
|
31500
|
+
let cur = graph[toModel].parent;
|
|
31501
|
+
while (graph[cur].parent) {
|
|
31502
|
+
path2.unshift(graph[cur].parent);
|
|
31503
|
+
fn4 = link$2(convert$2[graph[cur].parent][cur], fn4);
|
|
31504
|
+
cur = graph[cur].parent;
|
|
31505
|
+
}
|
|
31506
|
+
fn4.conversion = path2;
|
|
31507
|
+
return fn4;
|
|
31508
|
+
}
|
|
31509
|
+
__name(wrapConversion, "wrapConversion");
|
|
31510
|
+
function route(fromModel) {
|
|
31511
|
+
const graph = deriveBFS(fromModel);
|
|
31512
|
+
const conversion = {};
|
|
31513
|
+
const models2 = Object.keys(graph);
|
|
31514
|
+
for (let { length } = models2, i = 0; i < length; i++) {
|
|
31515
|
+
const toModel = models2[i];
|
|
31516
|
+
const node2 = graph[toModel];
|
|
31517
|
+
if (node2.parent === null) {
|
|
31518
|
+
continue;
|
|
31519
|
+
}
|
|
31520
|
+
conversion[toModel] = wrapConversion(toModel, graph);
|
|
31692
31521
|
}
|
|
31693
|
-
|
|
31694
|
-
|
|
31695
|
-
|
|
31696
|
-
|
|
31697
|
-
|
|
31698
|
-
|
|
31699
|
-
|
|
31700
|
-
|
|
31701
|
-
|
|
31702
|
-
|
|
31703
|
-
|
|
31704
|
-
|
|
31522
|
+
return conversion;
|
|
31523
|
+
}
|
|
31524
|
+
__name(route, "route");
|
|
31525
|
+
const convert$1 = {};
|
|
31526
|
+
const models = Object.keys(convert$2);
|
|
31527
|
+
function wrapRaw(fn4) {
|
|
31528
|
+
const wrappedFn = /* @__PURE__ */ __name(function(...args) {
|
|
31529
|
+
const arg0 = args[0];
|
|
31530
|
+
if (arg0 === void 0 || arg0 === null) {
|
|
31531
|
+
return arg0;
|
|
31532
|
+
}
|
|
31533
|
+
if (arg0.length > 1) {
|
|
31534
|
+
args = arg0;
|
|
31705
31535
|
}
|
|
31706
|
-
return
|
|
31707
|
-
}, "
|
|
31708
|
-
|
|
31536
|
+
return fn4(args);
|
|
31537
|
+
}, "wrappedFn");
|
|
31538
|
+
if ("conversion" in fn4) {
|
|
31539
|
+
wrappedFn.conversion = fn4.conversion;
|
|
31540
|
+
}
|
|
31541
|
+
return wrappedFn;
|
|
31709
31542
|
}
|
|
31710
|
-
__name(
|
|
31711
|
-
|
|
31712
|
-
|
|
31713
|
-
|
|
31714
|
-
|
|
31715
|
-
|
|
31716
|
-
|
|
31717
|
-
|
|
31718
|
-
|
|
31719
|
-
|
|
31720
|
-
|
|
31721
|
-
|
|
31722
|
-
|
|
31723
|
-
|
|
31724
|
-
}
|
|
31725
|
-
if (arguments.length > 1) {
|
|
31726
|
-
args = Array.prototype.slice.call(arguments);
|
|
31543
|
+
__name(wrapRaw, "wrapRaw");
|
|
31544
|
+
function wrapRounded(fn4) {
|
|
31545
|
+
const wrappedFn = /* @__PURE__ */ __name(function(...args) {
|
|
31546
|
+
const arg0 = args[0];
|
|
31547
|
+
if (arg0 === void 0 || arg0 === null) {
|
|
31548
|
+
return arg0;
|
|
31549
|
+
}
|
|
31550
|
+
if (arg0.length > 1) {
|
|
31551
|
+
args = arg0;
|
|
31552
|
+
}
|
|
31553
|
+
const result = fn4(args);
|
|
31554
|
+
if (typeof result === "object") {
|
|
31555
|
+
for (let { length } = result, i = 0; i < length; i++) {
|
|
31556
|
+
result[i] = Math.round(result[i]);
|
|
31727
31557
|
}
|
|
31728
|
-
return fn4(args);
|
|
31729
|
-
}, "wrappedFn");
|
|
31730
|
-
if ("conversion" in fn4) {
|
|
31731
|
-
wrappedFn.conversion = fn4.conversion;
|
|
31732
31558
|
}
|
|
31733
|
-
return
|
|
31559
|
+
return result;
|
|
31560
|
+
}, "wrappedFn");
|
|
31561
|
+
if ("conversion" in fn4) {
|
|
31562
|
+
wrappedFn.conversion = fn4.conversion;
|
|
31563
|
+
}
|
|
31564
|
+
return wrappedFn;
|
|
31565
|
+
}
|
|
31566
|
+
__name(wrapRounded, "wrapRounded");
|
|
31567
|
+
for (const fromModel of models) {
|
|
31568
|
+
convert$1[fromModel] = {};
|
|
31569
|
+
Object.defineProperty(convert$1[fromModel], "channels", { value: convert$2[fromModel].channels });
|
|
31570
|
+
Object.defineProperty(convert$1[fromModel], "labels", { value: convert$2[fromModel].labels });
|
|
31571
|
+
const routes = route(fromModel);
|
|
31572
|
+
const routeModels = Object.keys(routes);
|
|
31573
|
+
for (const toModel of routeModels) {
|
|
31574
|
+
const fn4 = routes[toModel];
|
|
31575
|
+
convert$1[fromModel][toModel] = wrapRounded(fn4);
|
|
31576
|
+
convert$1[fromModel][toModel].raw = wrapRaw(fn4);
|
|
31577
|
+
}
|
|
31578
|
+
}
|
|
31579
|
+
const skippedModels = [
|
|
31580
|
+
// To be honest, I don't really feel like keyword belongs in color convert, but eh.
|
|
31581
|
+
"keyword",
|
|
31582
|
+
// Gray conflicts with some method names, and has its own method defined.
|
|
31583
|
+
"gray",
|
|
31584
|
+
// Shouldn't really be in color-convert either...
|
|
31585
|
+
"hex"
|
|
31586
|
+
];
|
|
31587
|
+
const hashedModelKeys = {};
|
|
31588
|
+
for (const model of Object.keys(convert$1)) {
|
|
31589
|
+
hashedModelKeys[[...convert$1[model].labels].sort().join("")] = model;
|
|
31590
|
+
}
|
|
31591
|
+
const limiters = {};
|
|
31592
|
+
function Color(object3, model) {
|
|
31593
|
+
if (!(this instanceof Color)) {
|
|
31594
|
+
return new Color(object3, model);
|
|
31734
31595
|
}
|
|
31735
|
-
|
|
31736
|
-
|
|
31737
|
-
|
|
31738
|
-
|
|
31739
|
-
|
|
31740
|
-
|
|
31741
|
-
|
|
31742
|
-
|
|
31743
|
-
|
|
31744
|
-
|
|
31745
|
-
|
|
31746
|
-
|
|
31747
|
-
|
|
31748
|
-
|
|
31749
|
-
|
|
31750
|
-
|
|
31751
|
-
|
|
31752
|
-
|
|
31753
|
-
|
|
31754
|
-
|
|
31755
|
-
|
|
31756
|
-
|
|
31757
|
-
|
|
31758
|
-
|
|
31759
|
-
|
|
31760
|
-
|
|
31761
|
-
|
|
31762
|
-
|
|
31763
|
-
|
|
31764
|
-
|
|
31765
|
-
|
|
31766
|
-
|
|
31767
|
-
|
|
31768
|
-
|
|
31769
|
-
|
|
31770
|
-
|
|
31771
|
-
|
|
31772
|
-
|
|
31773
|
-
|
|
31774
|
-
|
|
31775
|
-
|
|
31776
|
-
|
|
31777
|
-
|
|
31778
|
-
|
|
31779
|
-
|
|
31780
|
-
var convert2 = requireColorConvert();
|
|
31781
|
-
var _slice = [].slice;
|
|
31782
|
-
var skippedModels = [
|
|
31783
|
-
// to be honest, I don't really feel like keyword belongs in color convert, but eh.
|
|
31784
|
-
"keyword",
|
|
31785
|
-
// gray conflicts with some method names, and has its own method defined.
|
|
31786
|
-
"gray",
|
|
31787
|
-
// shouldn't really be in color-convert either...
|
|
31788
|
-
"hex"
|
|
31789
|
-
];
|
|
31790
|
-
var hashedModelKeys = {};
|
|
31791
|
-
Object.keys(convert2).forEach(function(model) {
|
|
31792
|
-
hashedModelKeys[_slice.call(convert2[model].labels).sort().join("")] = model;
|
|
31793
|
-
});
|
|
31794
|
-
var limiters = {};
|
|
31795
|
-
function Color2(obj, model) {
|
|
31796
|
-
if (!(this instanceof Color2)) {
|
|
31797
|
-
return new Color2(obj, model);
|
|
31596
|
+
if (model && model in skippedModels) {
|
|
31597
|
+
model = null;
|
|
31598
|
+
}
|
|
31599
|
+
if (model && !(model in convert$1)) {
|
|
31600
|
+
throw new Error("Unknown model: " + model);
|
|
31601
|
+
}
|
|
31602
|
+
let i;
|
|
31603
|
+
let channels;
|
|
31604
|
+
if (object3 == null) {
|
|
31605
|
+
this.model = "rgb";
|
|
31606
|
+
this.color = [0, 0, 0];
|
|
31607
|
+
this.valpha = 1;
|
|
31608
|
+
} else if (object3 instanceof Color) {
|
|
31609
|
+
this.model = object3.model;
|
|
31610
|
+
this.color = [...object3.color];
|
|
31611
|
+
this.valpha = object3.valpha;
|
|
31612
|
+
} else if (typeof object3 === "string") {
|
|
31613
|
+
const result = cs.get(object3);
|
|
31614
|
+
if (result === null) {
|
|
31615
|
+
throw new Error("Unable to parse color from string: " + object3);
|
|
31616
|
+
}
|
|
31617
|
+
this.model = result.model;
|
|
31618
|
+
channels = convert$1[this.model].channels;
|
|
31619
|
+
this.color = result.value.slice(0, channels);
|
|
31620
|
+
this.valpha = typeof result.value[channels] === "number" ? result.value[channels] : 1;
|
|
31621
|
+
} else if (object3.length > 0) {
|
|
31622
|
+
this.model = model || "rgb";
|
|
31623
|
+
channels = convert$1[this.model].channels;
|
|
31624
|
+
const newArray = Array.prototype.slice.call(object3, 0, channels);
|
|
31625
|
+
this.color = zeroArray(newArray, channels);
|
|
31626
|
+
this.valpha = typeof object3[channels] === "number" ? object3[channels] : 1;
|
|
31627
|
+
} else if (typeof object3 === "number") {
|
|
31628
|
+
this.model = "rgb";
|
|
31629
|
+
this.color = [
|
|
31630
|
+
object3 >> 16 & 255,
|
|
31631
|
+
object3 >> 8 & 255,
|
|
31632
|
+
object3 & 255
|
|
31633
|
+
];
|
|
31634
|
+
this.valpha = 1;
|
|
31635
|
+
} else {
|
|
31636
|
+
this.valpha = 1;
|
|
31637
|
+
const keys3 = Object.keys(object3);
|
|
31638
|
+
if ("alpha" in object3) {
|
|
31639
|
+
keys3.splice(keys3.indexOf("alpha"), 1);
|
|
31640
|
+
this.valpha = typeof object3.alpha === "number" ? object3.alpha : 0;
|
|
31798
31641
|
}
|
|
31799
|
-
|
|
31800
|
-
|
|
31642
|
+
const hashedKeys = keys3.sort().join("");
|
|
31643
|
+
if (!(hashedKeys in hashedModelKeys)) {
|
|
31644
|
+
throw new Error("Unable to parse color from object: " + JSON.stringify(object3));
|
|
31801
31645
|
}
|
|
31802
|
-
|
|
31803
|
-
|
|
31646
|
+
this.model = hashedModelKeys[hashedKeys];
|
|
31647
|
+
const { labels } = convert$1[this.model];
|
|
31648
|
+
const color2 = [];
|
|
31649
|
+
for (i = 0; i < labels.length; i++) {
|
|
31650
|
+
color2.push(object3[labels[i]]);
|
|
31804
31651
|
}
|
|
31805
|
-
|
|
31806
|
-
|
|
31807
|
-
|
|
31808
|
-
|
|
31809
|
-
|
|
31810
|
-
|
|
31811
|
-
|
|
31812
|
-
|
|
31813
|
-
this.color = obj.color.slice();
|
|
31814
|
-
this.valpha = obj.valpha;
|
|
31815
|
-
} else if (typeof obj === "string") {
|
|
31816
|
-
var result = colorString2.get(obj);
|
|
31817
|
-
if (result === null) {
|
|
31818
|
-
throw new Error("Unable to parse color from string: " + obj);
|
|
31819
|
-
}
|
|
31820
|
-
this.model = result.model;
|
|
31821
|
-
channels = convert2[this.model].channels;
|
|
31822
|
-
this.color = result.value.slice(0, channels);
|
|
31823
|
-
this.valpha = typeof result.value[channels] === "number" ? result.value[channels] : 1;
|
|
31824
|
-
} else if (obj.length) {
|
|
31825
|
-
this.model = model || "rgb";
|
|
31826
|
-
channels = convert2[this.model].channels;
|
|
31827
|
-
var newArr = _slice.call(obj, 0, channels);
|
|
31828
|
-
this.color = zeroArray(newArr, channels);
|
|
31829
|
-
this.valpha = typeof obj[channels] === "number" ? obj[channels] : 1;
|
|
31830
|
-
} else if (typeof obj === "number") {
|
|
31831
|
-
obj &= 16777215;
|
|
31832
|
-
this.model = "rgb";
|
|
31833
|
-
this.color = [
|
|
31834
|
-
obj >> 16 & 255,
|
|
31835
|
-
obj >> 8 & 255,
|
|
31836
|
-
obj & 255
|
|
31837
|
-
];
|
|
31838
|
-
this.valpha = 1;
|
|
31839
|
-
} else {
|
|
31840
|
-
this.valpha = 1;
|
|
31841
|
-
var keys3 = Object.keys(obj);
|
|
31842
|
-
if ("alpha" in obj) {
|
|
31843
|
-
keys3.splice(keys3.indexOf("alpha"), 1);
|
|
31844
|
-
this.valpha = typeof obj.alpha === "number" ? obj.alpha : 0;
|
|
31845
|
-
}
|
|
31846
|
-
var hashedKeys = keys3.sort().join("");
|
|
31847
|
-
if (!(hashedKeys in hashedModelKeys)) {
|
|
31848
|
-
throw new Error("Unable to parse color from object: " + JSON.stringify(obj));
|
|
31849
|
-
}
|
|
31850
|
-
this.model = hashedModelKeys[hashedKeys];
|
|
31851
|
-
var labels = convert2[this.model].labels;
|
|
31852
|
-
var color2 = [];
|
|
31853
|
-
for (i = 0; i < labels.length; i++) {
|
|
31854
|
-
color2.push(obj[labels[i]]);
|
|
31855
|
-
}
|
|
31856
|
-
this.color = zeroArray(color2);
|
|
31857
|
-
}
|
|
31858
|
-
if (limiters[this.model]) {
|
|
31859
|
-
channels = convert2[this.model].channels;
|
|
31860
|
-
for (i = 0; i < channels; i++) {
|
|
31861
|
-
var limit = limiters[this.model][i];
|
|
31862
|
-
if (limit) {
|
|
31863
|
-
this.color[i] = limit(this.color[i]);
|
|
31864
|
-
}
|
|
31865
|
-
}
|
|
31866
|
-
}
|
|
31867
|
-
this.valpha = Math.max(0, Math.min(1, this.valpha));
|
|
31868
|
-
if (Object.freeze) {
|
|
31869
|
-
Object.freeze(this);
|
|
31870
|
-
}
|
|
31871
|
-
}
|
|
31872
|
-
__name(Color2, "Color");
|
|
31873
|
-
Color2.prototype = {
|
|
31874
|
-
toString: /* @__PURE__ */ __name(function() {
|
|
31875
|
-
return this.string();
|
|
31876
|
-
}, "toString"),
|
|
31877
|
-
toJSON: /* @__PURE__ */ __name(function() {
|
|
31878
|
-
return this[this.model]();
|
|
31879
|
-
}, "toJSON"),
|
|
31880
|
-
string: /* @__PURE__ */ __name(function(places) {
|
|
31881
|
-
var self2 = this.model in colorString2.to ? this : this.rgb();
|
|
31882
|
-
self2 = self2.round(typeof places === "number" ? places : 1);
|
|
31883
|
-
var args = self2.valpha === 1 ? self2.color : self2.color.concat(this.valpha);
|
|
31884
|
-
return colorString2.to[self2.model](args);
|
|
31885
|
-
}, "string"),
|
|
31886
|
-
percentString: /* @__PURE__ */ __name(function(places) {
|
|
31887
|
-
var self2 = this.rgb().round(typeof places === "number" ? places : 1);
|
|
31888
|
-
var args = self2.valpha === 1 ? self2.color : self2.color.concat(this.valpha);
|
|
31889
|
-
return colorString2.to.rgb.percent(args);
|
|
31890
|
-
}, "percentString"),
|
|
31891
|
-
array: /* @__PURE__ */ __name(function() {
|
|
31892
|
-
return this.valpha === 1 ? this.color.slice() : this.color.concat(this.valpha);
|
|
31893
|
-
}, "array"),
|
|
31894
|
-
object: /* @__PURE__ */ __name(function() {
|
|
31895
|
-
var result = {};
|
|
31896
|
-
var channels = convert2[this.model].channels;
|
|
31897
|
-
var labels = convert2[this.model].labels;
|
|
31898
|
-
for (var i = 0; i < channels; i++) {
|
|
31899
|
-
result[labels[i]] = this.color[i];
|
|
31900
|
-
}
|
|
31901
|
-
if (this.valpha !== 1) {
|
|
31902
|
-
result.alpha = this.valpha;
|
|
31652
|
+
this.color = zeroArray(color2);
|
|
31653
|
+
}
|
|
31654
|
+
if (limiters[this.model]) {
|
|
31655
|
+
channels = convert$1[this.model].channels;
|
|
31656
|
+
for (i = 0; i < channels; i++) {
|
|
31657
|
+
const limit = limiters[this.model][i];
|
|
31658
|
+
if (limit) {
|
|
31659
|
+
this.color[i] = limit(this.color[i]);
|
|
31903
31660
|
}
|
|
31904
|
-
return result;
|
|
31905
|
-
}, "object"),
|
|
31906
|
-
unitArray: /* @__PURE__ */ __name(function() {
|
|
31907
|
-
var rgb = this.rgb().color;
|
|
31908
|
-
rgb[0] /= 255;
|
|
31909
|
-
rgb[1] /= 255;
|
|
31910
|
-
rgb[2] /= 255;
|
|
31911
|
-
if (this.valpha !== 1) {
|
|
31912
|
-
rgb.push(this.valpha);
|
|
31913
|
-
}
|
|
31914
|
-
return rgb;
|
|
31915
|
-
}, "unitArray"),
|
|
31916
|
-
unitObject: /* @__PURE__ */ __name(function() {
|
|
31917
|
-
var rgb = this.rgb().object();
|
|
31918
|
-
rgb.r /= 255;
|
|
31919
|
-
rgb.g /= 255;
|
|
31920
|
-
rgb.b /= 255;
|
|
31921
|
-
if (this.valpha !== 1) {
|
|
31922
|
-
rgb.alpha = this.valpha;
|
|
31923
|
-
}
|
|
31924
|
-
return rgb;
|
|
31925
|
-
}, "unitObject"),
|
|
31926
|
-
round: /* @__PURE__ */ __name(function(places) {
|
|
31927
|
-
places = Math.max(places || 0, 0);
|
|
31928
|
-
return new Color2(this.color.map(roundToPlace(places)).concat(this.valpha), this.model);
|
|
31929
|
-
}, "round"),
|
|
31930
|
-
alpha: /* @__PURE__ */ __name(function(val2) {
|
|
31931
|
-
if (arguments.length) {
|
|
31932
|
-
return new Color2(this.color.concat(Math.max(0, Math.min(1, val2))), this.model);
|
|
31933
|
-
}
|
|
31934
|
-
return this.valpha;
|
|
31935
|
-
}, "alpha"),
|
|
31936
|
-
// rgb
|
|
31937
|
-
red: getset("rgb", 0, maxfn(255)),
|
|
31938
|
-
green: getset("rgb", 1, maxfn(255)),
|
|
31939
|
-
blue: getset("rgb", 2, maxfn(255)),
|
|
31940
|
-
hue: getset(["hsl", "hsv", "hsl", "hwb", "hcg"], 0, function(val2) {
|
|
31941
|
-
return (val2 % 360 + 360) % 360;
|
|
31942
|
-
}),
|
|
31943
|
-
// eslint-disable-line brace-style
|
|
31944
|
-
saturationl: getset("hsl", 1, maxfn(100)),
|
|
31945
|
-
lightness: getset("hsl", 2, maxfn(100)),
|
|
31946
|
-
saturationv: getset("hsv", 1, maxfn(100)),
|
|
31947
|
-
value: getset("hsv", 2, maxfn(100)),
|
|
31948
|
-
chroma: getset("hcg", 1, maxfn(100)),
|
|
31949
|
-
gray: getset("hcg", 2, maxfn(100)),
|
|
31950
|
-
white: getset("hwb", 1, maxfn(100)),
|
|
31951
|
-
wblack: getset("hwb", 2, maxfn(100)),
|
|
31952
|
-
cyan: getset("cmyk", 0, maxfn(100)),
|
|
31953
|
-
magenta: getset("cmyk", 1, maxfn(100)),
|
|
31954
|
-
yellow: getset("cmyk", 2, maxfn(100)),
|
|
31955
|
-
black: getset("cmyk", 3, maxfn(100)),
|
|
31956
|
-
x: getset("xyz", 0, maxfn(100)),
|
|
31957
|
-
y: getset("xyz", 1, maxfn(100)),
|
|
31958
|
-
z: getset("xyz", 2, maxfn(100)),
|
|
31959
|
-
l: getset("lab", 0, maxfn(100)),
|
|
31960
|
-
a: getset("lab", 1),
|
|
31961
|
-
b: getset("lab", 2),
|
|
31962
|
-
keyword: /* @__PURE__ */ __name(function(val2) {
|
|
31963
|
-
if (arguments.length) {
|
|
31964
|
-
return new Color2(val2);
|
|
31965
|
-
}
|
|
31966
|
-
return convert2[this.model].keyword(this.color);
|
|
31967
|
-
}, "keyword"),
|
|
31968
|
-
hex: /* @__PURE__ */ __name(function(val2) {
|
|
31969
|
-
if (arguments.length) {
|
|
31970
|
-
return new Color2(val2);
|
|
31971
|
-
}
|
|
31972
|
-
return colorString2.to.hex(this.rgb().round().color);
|
|
31973
|
-
}, "hex"),
|
|
31974
|
-
rgbNumber: /* @__PURE__ */ __name(function() {
|
|
31975
|
-
var rgb = this.rgb().color;
|
|
31976
|
-
return (rgb[0] & 255) << 16 | (rgb[1] & 255) << 8 | rgb[2] & 255;
|
|
31977
|
-
}, "rgbNumber"),
|
|
31978
|
-
luminosity: /* @__PURE__ */ __name(function() {
|
|
31979
|
-
var rgb = this.rgb().color;
|
|
31980
|
-
var lum = [];
|
|
31981
|
-
for (var i = 0; i < rgb.length; i++) {
|
|
31982
|
-
var chan = rgb[i] / 255;
|
|
31983
|
-
lum[i] = chan <= 0.03928 ? chan / 12.92 : Math.pow((chan + 0.055) / 1.055, 2.4);
|
|
31984
|
-
}
|
|
31985
|
-
return 0.2126 * lum[0] + 0.7152 * lum[1] + 0.0722 * lum[2];
|
|
31986
|
-
}, "luminosity"),
|
|
31987
|
-
contrast: /* @__PURE__ */ __name(function(color2) {
|
|
31988
|
-
var lum1 = this.luminosity();
|
|
31989
|
-
var lum2 = color2.luminosity();
|
|
31990
|
-
if (lum1 > lum2) {
|
|
31991
|
-
return (lum1 + 0.05) / (lum2 + 0.05);
|
|
31992
|
-
}
|
|
31993
|
-
return (lum2 + 0.05) / (lum1 + 0.05);
|
|
31994
|
-
}, "contrast"),
|
|
31995
|
-
level: /* @__PURE__ */ __name(function(color2) {
|
|
31996
|
-
var contrastRatio = this.contrast(color2);
|
|
31997
|
-
if (contrastRatio >= 7.1) {
|
|
31998
|
-
return "AAA";
|
|
31999
|
-
}
|
|
32000
|
-
return contrastRatio >= 4.5 ? "AA" : "";
|
|
32001
|
-
}, "level"),
|
|
32002
|
-
isDark: /* @__PURE__ */ __name(function() {
|
|
32003
|
-
var rgb = this.rgb().color;
|
|
32004
|
-
var yiq = (rgb[0] * 299 + rgb[1] * 587 + rgb[2] * 114) / 1e3;
|
|
32005
|
-
return yiq < 128;
|
|
32006
|
-
}, "isDark"),
|
|
32007
|
-
isLight: /* @__PURE__ */ __name(function() {
|
|
32008
|
-
return !this.isDark();
|
|
32009
|
-
}, "isLight"),
|
|
32010
|
-
negate: /* @__PURE__ */ __name(function() {
|
|
32011
|
-
var rgb = this.rgb();
|
|
32012
|
-
for (var i = 0; i < 3; i++) {
|
|
32013
|
-
rgb.color[i] = 255 - rgb.color[i];
|
|
32014
|
-
}
|
|
32015
|
-
return rgb;
|
|
32016
|
-
}, "negate"),
|
|
32017
|
-
lighten: /* @__PURE__ */ __name(function(ratio) {
|
|
32018
|
-
var hsl = this.hsl();
|
|
32019
|
-
hsl.color[2] += hsl.color[2] * ratio;
|
|
32020
|
-
return hsl;
|
|
32021
|
-
}, "lighten"),
|
|
32022
|
-
darken: /* @__PURE__ */ __name(function(ratio) {
|
|
32023
|
-
var hsl = this.hsl();
|
|
32024
|
-
hsl.color[2] -= hsl.color[2] * ratio;
|
|
32025
|
-
return hsl;
|
|
32026
|
-
}, "darken"),
|
|
32027
|
-
saturate: /* @__PURE__ */ __name(function(ratio) {
|
|
32028
|
-
var hsl = this.hsl();
|
|
32029
|
-
hsl.color[1] += hsl.color[1] * ratio;
|
|
32030
|
-
return hsl;
|
|
32031
|
-
}, "saturate"),
|
|
32032
|
-
desaturate: /* @__PURE__ */ __name(function(ratio) {
|
|
32033
|
-
var hsl = this.hsl();
|
|
32034
|
-
hsl.color[1] -= hsl.color[1] * ratio;
|
|
32035
|
-
return hsl;
|
|
32036
|
-
}, "desaturate"),
|
|
32037
|
-
whiten: /* @__PURE__ */ __name(function(ratio) {
|
|
32038
|
-
var hwb = this.hwb();
|
|
32039
|
-
hwb.color[1] += hwb.color[1] * ratio;
|
|
32040
|
-
return hwb;
|
|
32041
|
-
}, "whiten"),
|
|
32042
|
-
blacken: /* @__PURE__ */ __name(function(ratio) {
|
|
32043
|
-
var hwb = this.hwb();
|
|
32044
|
-
hwb.color[2] += hwb.color[2] * ratio;
|
|
32045
|
-
return hwb;
|
|
32046
|
-
}, "blacken"),
|
|
32047
|
-
grayscale: /* @__PURE__ */ __name(function() {
|
|
32048
|
-
var rgb = this.rgb().color;
|
|
32049
|
-
var val2 = rgb[0] * 0.3 + rgb[1] * 0.59 + rgb[2] * 0.11;
|
|
32050
|
-
return Color2.rgb(val2, val2, val2);
|
|
32051
|
-
}, "grayscale"),
|
|
32052
|
-
fade: /* @__PURE__ */ __name(function(ratio) {
|
|
32053
|
-
return this.alpha(this.valpha - this.valpha * ratio);
|
|
32054
|
-
}, "fade"),
|
|
32055
|
-
opaquer: /* @__PURE__ */ __name(function(ratio) {
|
|
32056
|
-
return this.alpha(this.valpha + this.valpha * ratio);
|
|
32057
|
-
}, "opaquer"),
|
|
32058
|
-
rotate: /* @__PURE__ */ __name(function(degrees) {
|
|
32059
|
-
var hsl = this.hsl();
|
|
32060
|
-
var hue = hsl.color[0];
|
|
32061
|
-
hue = (hue + degrees) % 360;
|
|
32062
|
-
hue = hue < 0 ? 360 + hue : hue;
|
|
32063
|
-
hsl.color[0] = hue;
|
|
32064
|
-
return hsl;
|
|
32065
|
-
}, "rotate"),
|
|
32066
|
-
mix: /* @__PURE__ */ __name(function(mixinColor, weight) {
|
|
32067
|
-
if (!mixinColor || !mixinColor.rgb) {
|
|
32068
|
-
throw new Error('Argument to "mix" was not a Color instance, but rather an instance of ' + typeof mixinColor);
|
|
32069
|
-
}
|
|
32070
|
-
var color1 = mixinColor.rgb();
|
|
32071
|
-
var color2 = this.rgb();
|
|
32072
|
-
var p2 = weight === void 0 ? 0.5 : weight;
|
|
32073
|
-
var w2 = 2 * p2 - 1;
|
|
32074
|
-
var a2 = color1.alpha() - color2.alpha();
|
|
32075
|
-
var w1 = ((w2 * a2 === -1 ? w2 : (w2 + a2) / (1 + w2 * a2)) + 1) / 2;
|
|
32076
|
-
var w22 = 1 - w1;
|
|
32077
|
-
return Color2.rgb(
|
|
32078
|
-
w1 * color1.red() + w22 * color2.red(),
|
|
32079
|
-
w1 * color1.green() + w22 * color2.green(),
|
|
32080
|
-
w1 * color1.blue() + w22 * color2.blue(),
|
|
32081
|
-
color1.alpha() * p2 + color2.alpha() * (1 - p2)
|
|
32082
|
-
);
|
|
32083
|
-
}, "mix")
|
|
32084
|
-
};
|
|
32085
|
-
Object.keys(convert2).forEach(function(model) {
|
|
32086
|
-
if (skippedModels.indexOf(model) !== -1) {
|
|
32087
|
-
return;
|
|
32088
31661
|
}
|
|
32089
|
-
var channels = convert2[model].channels;
|
|
32090
|
-
Color2.prototype[model] = function() {
|
|
32091
|
-
if (this.model === model) {
|
|
32092
|
-
return new Color2(this);
|
|
32093
|
-
}
|
|
32094
|
-
if (arguments.length) {
|
|
32095
|
-
return new Color2(arguments, model);
|
|
32096
|
-
}
|
|
32097
|
-
var newAlpha = typeof arguments[channels] === "number" ? channels : this.valpha;
|
|
32098
|
-
return new Color2(assertArray(convert2[this.model][model].raw(this.color)).concat(newAlpha), model);
|
|
32099
|
-
};
|
|
32100
|
-
Color2[model] = function(color2) {
|
|
32101
|
-
if (typeof color2 === "number") {
|
|
32102
|
-
color2 = zeroArray(_slice.call(arguments), channels);
|
|
32103
|
-
}
|
|
32104
|
-
return new Color2(color2, model);
|
|
32105
|
-
};
|
|
32106
|
-
});
|
|
32107
|
-
function roundTo(num, places) {
|
|
32108
|
-
return Number(num.toFixed(places));
|
|
32109
31662
|
}
|
|
32110
|
-
|
|
32111
|
-
|
|
32112
|
-
|
|
32113
|
-
return roundTo(num, places);
|
|
32114
|
-
};
|
|
31663
|
+
this.valpha = Math.max(0, Math.min(1, this.valpha));
|
|
31664
|
+
if (Object.freeze) {
|
|
31665
|
+
Object.freeze(this);
|
|
32115
31666
|
}
|
|
32116
|
-
|
|
32117
|
-
|
|
32118
|
-
|
|
32119
|
-
|
|
32120
|
-
|
|
32121
|
-
|
|
32122
|
-
|
|
32123
|
-
return
|
|
32124
|
-
|
|
32125
|
-
|
|
32126
|
-
|
|
32127
|
-
|
|
32128
|
-
|
|
32129
|
-
|
|
32130
|
-
|
|
32131
|
-
|
|
32132
|
-
|
|
32133
|
-
|
|
32134
|
-
|
|
32135
|
-
|
|
32136
|
-
|
|
32137
|
-
|
|
32138
|
-
|
|
31667
|
+
}
|
|
31668
|
+
__name(Color, "Color");
|
|
31669
|
+
Color.prototype = {
|
|
31670
|
+
toString() {
|
|
31671
|
+
return this.string();
|
|
31672
|
+
},
|
|
31673
|
+
toJSON() {
|
|
31674
|
+
return this[this.model]();
|
|
31675
|
+
},
|
|
31676
|
+
string(places) {
|
|
31677
|
+
let self2 = this.model in cs.to ? this : this.rgb();
|
|
31678
|
+
self2 = self2.round(typeof places === "number" ? places : 1);
|
|
31679
|
+
const arguments_ = self2.valpha === 1 ? self2.color : [...self2.color, this.valpha];
|
|
31680
|
+
return cs.to[self2.model](...arguments_);
|
|
31681
|
+
},
|
|
31682
|
+
percentString(places) {
|
|
31683
|
+
const self2 = this.rgb().round(typeof places === "number" ? places : 1);
|
|
31684
|
+
const arguments_ = self2.valpha === 1 ? self2.color : [...self2.color, this.valpha];
|
|
31685
|
+
return cs.to.rgb.percent(...arguments_);
|
|
31686
|
+
},
|
|
31687
|
+
array() {
|
|
31688
|
+
return this.valpha === 1 ? [...this.color] : [...this.color, this.valpha];
|
|
31689
|
+
},
|
|
31690
|
+
object() {
|
|
31691
|
+
const result = {};
|
|
31692
|
+
const { channels } = convert$1[this.model];
|
|
31693
|
+
const { labels } = convert$1[this.model];
|
|
31694
|
+
for (let i = 0; i < channels; i++) {
|
|
31695
|
+
result[labels[i]] = this.color[i];
|
|
31696
|
+
}
|
|
31697
|
+
if (this.valpha !== 1) {
|
|
31698
|
+
result.alpha = this.valpha;
|
|
31699
|
+
}
|
|
31700
|
+
return result;
|
|
31701
|
+
},
|
|
31702
|
+
unitArray() {
|
|
31703
|
+
const rgb = this.rgb().color;
|
|
31704
|
+
rgb[0] /= 255;
|
|
31705
|
+
rgb[1] /= 255;
|
|
31706
|
+
rgb[2] /= 255;
|
|
31707
|
+
if (this.valpha !== 1) {
|
|
31708
|
+
rgb.push(this.valpha);
|
|
31709
|
+
}
|
|
31710
|
+
return rgb;
|
|
31711
|
+
},
|
|
31712
|
+
unitObject() {
|
|
31713
|
+
const rgb = this.rgb().object();
|
|
31714
|
+
rgb.r /= 255;
|
|
31715
|
+
rgb.g /= 255;
|
|
31716
|
+
rgb.b /= 255;
|
|
31717
|
+
if (this.valpha !== 1) {
|
|
31718
|
+
rgb.alpha = this.valpha;
|
|
31719
|
+
}
|
|
31720
|
+
return rgb;
|
|
31721
|
+
},
|
|
31722
|
+
round(places) {
|
|
31723
|
+
places = Math.max(places || 0, 0);
|
|
31724
|
+
return new Color([...this.color.map(roundToPlace(places)), this.valpha], this.model);
|
|
31725
|
+
},
|
|
31726
|
+
alpha(value) {
|
|
31727
|
+
if (value !== void 0) {
|
|
31728
|
+
return new Color([...this.color, Math.max(0, Math.min(1, value))], this.model);
|
|
31729
|
+
}
|
|
31730
|
+
return this.valpha;
|
|
31731
|
+
},
|
|
31732
|
+
// Rgb
|
|
31733
|
+
red: getset("rgb", 0, maxfn(255)),
|
|
31734
|
+
green: getset("rgb", 1, maxfn(255)),
|
|
31735
|
+
blue: getset("rgb", 2, maxfn(255)),
|
|
31736
|
+
hue: getset(["hsl", "hsv", "hsl", "hwb", "hcg"], 0, (value) => (value % 360 + 360) % 360),
|
|
31737
|
+
saturationl: getset("hsl", 1, maxfn(100)),
|
|
31738
|
+
lightness: getset("hsl", 2, maxfn(100)),
|
|
31739
|
+
saturationv: getset("hsv", 1, maxfn(100)),
|
|
31740
|
+
value: getset("hsv", 2, maxfn(100)),
|
|
31741
|
+
chroma: getset("hcg", 1, maxfn(100)),
|
|
31742
|
+
gray: getset("hcg", 2, maxfn(100)),
|
|
31743
|
+
white: getset("hwb", 1, maxfn(100)),
|
|
31744
|
+
wblack: getset("hwb", 2, maxfn(100)),
|
|
31745
|
+
cyan: getset("cmyk", 0, maxfn(100)),
|
|
31746
|
+
magenta: getset("cmyk", 1, maxfn(100)),
|
|
31747
|
+
yellow: getset("cmyk", 2, maxfn(100)),
|
|
31748
|
+
black: getset("cmyk", 3, maxfn(100)),
|
|
31749
|
+
x: getset("xyz", 0, maxfn(95.047)),
|
|
31750
|
+
y: getset("xyz", 1, maxfn(100)),
|
|
31751
|
+
z: getset("xyz", 2, maxfn(108.833)),
|
|
31752
|
+
l: getset("lab", 0, maxfn(100)),
|
|
31753
|
+
a: getset("lab", 1),
|
|
31754
|
+
b: getset("lab", 2),
|
|
31755
|
+
keyword(value) {
|
|
31756
|
+
if (value !== void 0) {
|
|
31757
|
+
return new Color(value);
|
|
31758
|
+
}
|
|
31759
|
+
return convert$1[this.model].keyword(this.color);
|
|
31760
|
+
},
|
|
31761
|
+
hex(value) {
|
|
31762
|
+
if (value !== void 0) {
|
|
31763
|
+
return new Color(value);
|
|
31764
|
+
}
|
|
31765
|
+
return cs.to.hex(...this.rgb().round().color);
|
|
31766
|
+
},
|
|
31767
|
+
hexa(value) {
|
|
31768
|
+
if (value !== void 0) {
|
|
31769
|
+
return new Color(value);
|
|
31770
|
+
}
|
|
31771
|
+
const rgbArray = this.rgb().round().color;
|
|
31772
|
+
let alphaHex = Math.round(this.valpha * 255).toString(16).toUpperCase();
|
|
31773
|
+
if (alphaHex.length === 1) {
|
|
31774
|
+
alphaHex = "0" + alphaHex;
|
|
31775
|
+
}
|
|
31776
|
+
return cs.to.hex(...rgbArray) + alphaHex;
|
|
31777
|
+
},
|
|
31778
|
+
rgbNumber() {
|
|
31779
|
+
const rgb = this.rgb().color;
|
|
31780
|
+
return (rgb[0] & 255) << 16 | (rgb[1] & 255) << 8 | rgb[2] & 255;
|
|
31781
|
+
},
|
|
31782
|
+
luminosity() {
|
|
31783
|
+
const rgb = this.rgb().color;
|
|
31784
|
+
const lum = [];
|
|
31785
|
+
for (const [i, element2] of rgb.entries()) {
|
|
31786
|
+
const chan = element2 / 255;
|
|
31787
|
+
lum[i] = chan <= 0.04045 ? chan / 12.92 : __pow((chan + 0.055) / 1.055, 2.4);
|
|
31788
|
+
}
|
|
31789
|
+
return 0.2126 * lum[0] + 0.7152 * lum[1] + 0.0722 * lum[2];
|
|
31790
|
+
},
|
|
31791
|
+
contrast(color2) {
|
|
31792
|
+
const lum1 = this.luminosity();
|
|
31793
|
+
const lum2 = color2.luminosity();
|
|
31794
|
+
if (lum1 > lum2) {
|
|
31795
|
+
return (lum1 + 0.05) / (lum2 + 0.05);
|
|
31796
|
+
}
|
|
31797
|
+
return (lum2 + 0.05) / (lum1 + 0.05);
|
|
31798
|
+
},
|
|
31799
|
+
level(color2) {
|
|
31800
|
+
const contrastRatio = this.contrast(color2);
|
|
31801
|
+
if (contrastRatio >= 7) {
|
|
31802
|
+
return "AAA";
|
|
31803
|
+
}
|
|
31804
|
+
return contrastRatio >= 4.5 ? "AA" : "";
|
|
31805
|
+
},
|
|
31806
|
+
isDark() {
|
|
31807
|
+
const rgb = this.rgb().color;
|
|
31808
|
+
const yiq = (rgb[0] * 2126 + rgb[1] * 7152 + rgb[2] * 722) / 1e4;
|
|
31809
|
+
return yiq < 128;
|
|
31810
|
+
},
|
|
31811
|
+
isLight() {
|
|
31812
|
+
return !this.isDark();
|
|
31813
|
+
},
|
|
31814
|
+
negate() {
|
|
31815
|
+
const rgb = this.rgb();
|
|
31816
|
+
for (let i = 0; i < 3; i++) {
|
|
31817
|
+
rgb.color[i] = 255 - rgb.color[i];
|
|
31818
|
+
}
|
|
31819
|
+
return rgb;
|
|
31820
|
+
},
|
|
31821
|
+
lighten(ratio) {
|
|
31822
|
+
const hsl = this.hsl();
|
|
31823
|
+
hsl.color[2] += hsl.color[2] * ratio;
|
|
31824
|
+
return hsl;
|
|
31825
|
+
},
|
|
31826
|
+
darken(ratio) {
|
|
31827
|
+
const hsl = this.hsl();
|
|
31828
|
+
hsl.color[2] -= hsl.color[2] * ratio;
|
|
31829
|
+
return hsl;
|
|
31830
|
+
},
|
|
31831
|
+
saturate(ratio) {
|
|
31832
|
+
const hsl = this.hsl();
|
|
31833
|
+
hsl.color[1] += hsl.color[1] * ratio;
|
|
31834
|
+
return hsl;
|
|
31835
|
+
},
|
|
31836
|
+
desaturate(ratio) {
|
|
31837
|
+
const hsl = this.hsl();
|
|
31838
|
+
hsl.color[1] -= hsl.color[1] * ratio;
|
|
31839
|
+
return hsl;
|
|
31840
|
+
},
|
|
31841
|
+
whiten(ratio) {
|
|
31842
|
+
const hwb = this.hwb();
|
|
31843
|
+
hwb.color[1] += hwb.color[1] * ratio;
|
|
31844
|
+
return hwb;
|
|
31845
|
+
},
|
|
31846
|
+
blacken(ratio) {
|
|
31847
|
+
const hwb = this.hwb();
|
|
31848
|
+
hwb.color[2] += hwb.color[2] * ratio;
|
|
31849
|
+
return hwb;
|
|
31850
|
+
},
|
|
31851
|
+
grayscale() {
|
|
31852
|
+
const rgb = this.rgb().color;
|
|
31853
|
+
const value = rgb[0] * 0.3 + rgb[1] * 0.59 + rgb[2] * 0.11;
|
|
31854
|
+
return Color.rgb(value, value, value);
|
|
31855
|
+
},
|
|
31856
|
+
fade(ratio) {
|
|
31857
|
+
return this.alpha(this.valpha - this.valpha * ratio);
|
|
31858
|
+
},
|
|
31859
|
+
opaquer(ratio) {
|
|
31860
|
+
return this.alpha(this.valpha + this.valpha * ratio);
|
|
31861
|
+
},
|
|
31862
|
+
rotate(degrees) {
|
|
31863
|
+
const hsl = this.hsl();
|
|
31864
|
+
let hue = hsl.color[0];
|
|
31865
|
+
hue = (hue + degrees) % 360;
|
|
31866
|
+
hue = hue < 0 ? 360 + hue : hue;
|
|
31867
|
+
hsl.color[0] = hue;
|
|
31868
|
+
return hsl;
|
|
31869
|
+
},
|
|
31870
|
+
mix(mixinColor, weight) {
|
|
31871
|
+
if (!mixinColor || !mixinColor.rgb) {
|
|
31872
|
+
throw new Error('Argument to "mix" was not a Color instance, but rather an instance of ' + typeof mixinColor);
|
|
31873
|
+
}
|
|
31874
|
+
const color1 = mixinColor.rgb();
|
|
31875
|
+
const color2 = this.rgb();
|
|
31876
|
+
const p2 = weight === void 0 ? 0.5 : weight;
|
|
31877
|
+
const w2 = 2 * p2 - 1;
|
|
31878
|
+
const a2 = color1.alpha() - color2.alpha();
|
|
31879
|
+
const w1 = ((w2 * a2 === -1 ? w2 : (w2 + a2) / (1 + w2 * a2)) + 1) / 2;
|
|
31880
|
+
const w22 = 1 - w1;
|
|
31881
|
+
return Color.rgb(
|
|
31882
|
+
w1 * color1.red() + w22 * color2.red(),
|
|
31883
|
+
w1 * color1.green() + w22 * color2.green(),
|
|
31884
|
+
w1 * color1.blue() + w22 * color2.blue(),
|
|
31885
|
+
color1.alpha() * p2 + color2.alpha() * (1 - p2)
|
|
31886
|
+
);
|
|
32139
31887
|
}
|
|
32140
|
-
|
|
32141
|
-
|
|
32142
|
-
|
|
32143
|
-
|
|
32144
|
-
};
|
|
31888
|
+
};
|
|
31889
|
+
for (const model of Object.keys(convert$1)) {
|
|
31890
|
+
if (skippedModels.includes(model)) {
|
|
31891
|
+
continue;
|
|
32145
31892
|
}
|
|
32146
|
-
|
|
32147
|
-
function
|
|
32148
|
-
|
|
31893
|
+
const { channels } = convert$1[model];
|
|
31894
|
+
Color.prototype[model] = function(...arguments_) {
|
|
31895
|
+
if (this.model === model) {
|
|
31896
|
+
return new Color(this);
|
|
31897
|
+
}
|
|
31898
|
+
if (arguments_.length > 0) {
|
|
31899
|
+
return new Color(arguments_, model);
|
|
31900
|
+
}
|
|
31901
|
+
return new Color([...assertArray(convert$1[this.model][model].raw(this.color)), this.valpha], model);
|
|
31902
|
+
};
|
|
31903
|
+
Color[model] = function(...arguments_) {
|
|
31904
|
+
let color2 = arguments_[0];
|
|
31905
|
+
if (typeof color2 === "number") {
|
|
31906
|
+
color2 = zeroArray(arguments_, channels);
|
|
31907
|
+
}
|
|
31908
|
+
return new Color(color2, model);
|
|
31909
|
+
};
|
|
31910
|
+
}
|
|
31911
|
+
function roundTo(number2, places) {
|
|
31912
|
+
return Number(number2.toFixed(places));
|
|
31913
|
+
}
|
|
31914
|
+
__name(roundTo, "roundTo");
|
|
31915
|
+
function roundToPlace(places) {
|
|
31916
|
+
return function(number2) {
|
|
31917
|
+
return roundTo(number2, places);
|
|
31918
|
+
};
|
|
31919
|
+
}
|
|
31920
|
+
__name(roundToPlace, "roundToPlace");
|
|
31921
|
+
function getset(model, channel, modifier) {
|
|
31922
|
+
model = Array.isArray(model) ? model : [model];
|
|
31923
|
+
for (const m2 of model) {
|
|
31924
|
+
(limiters[m2] || (limiters[m2] = []))[channel] = modifier;
|
|
32149
31925
|
}
|
|
32150
|
-
|
|
32151
|
-
function
|
|
32152
|
-
|
|
32153
|
-
|
|
32154
|
-
|
|
31926
|
+
model = model[0];
|
|
31927
|
+
return function(value) {
|
|
31928
|
+
let result;
|
|
31929
|
+
if (value !== void 0) {
|
|
31930
|
+
if (modifier) {
|
|
31931
|
+
value = modifier(value);
|
|
32155
31932
|
}
|
|
31933
|
+
result = this[model]();
|
|
31934
|
+
result.color[channel] = value;
|
|
31935
|
+
return result;
|
|
31936
|
+
}
|
|
31937
|
+
result = this[model]().color[channel];
|
|
31938
|
+
if (modifier) {
|
|
31939
|
+
result = modifier(result);
|
|
31940
|
+
}
|
|
31941
|
+
return result;
|
|
31942
|
+
};
|
|
31943
|
+
}
|
|
31944
|
+
__name(getset, "getset");
|
|
31945
|
+
function maxfn(max2) {
|
|
31946
|
+
return function(v2) {
|
|
31947
|
+
return Math.max(0, Math.min(max2, v2));
|
|
31948
|
+
};
|
|
31949
|
+
}
|
|
31950
|
+
__name(maxfn, "maxfn");
|
|
31951
|
+
function assertArray(value) {
|
|
31952
|
+
return Array.isArray(value) ? value : [value];
|
|
31953
|
+
}
|
|
31954
|
+
__name(assertArray, "assertArray");
|
|
31955
|
+
function zeroArray(array2, length) {
|
|
31956
|
+
for (let i = 0; i < length; i++) {
|
|
31957
|
+
if (typeof array2[i] !== "number") {
|
|
31958
|
+
array2[i] = 0;
|
|
32156
31959
|
}
|
|
32157
|
-
return arr;
|
|
32158
31960
|
}
|
|
32159
|
-
|
|
32160
|
-
color$1 = Color2;
|
|
32161
|
-
return color$1;
|
|
31961
|
+
return array2;
|
|
32162
31962
|
}
|
|
32163
|
-
__name(
|
|
32164
|
-
var colorExports = requireColor();
|
|
32165
|
-
const Color = /* @__PURE__ */ getDefaultExportFromCjs(colorExports);
|
|
31963
|
+
__name(zeroArray, "zeroArray");
|
|
32166
31964
|
function determineBlackOrWhiteTextColor(c2) {
|
|
32167
31965
|
try {
|
|
32168
31966
|
return Color(c2).isLight() ? "#000000" : "#FFFFFF";
|
|
@@ -40023,10 +39821,10 @@ function tokenizeCodeFenced(effects, ok2, nok) {
|
|
|
40023
39821
|
effects.enter("chunkString", {
|
|
40024
39822
|
contentType: "string"
|
|
40025
39823
|
});
|
|
40026
|
-
return
|
|
39824
|
+
return meta2(code2);
|
|
40027
39825
|
}
|
|
40028
39826
|
__name(metaBefore, "metaBefore");
|
|
40029
|
-
function
|
|
39827
|
+
function meta2(code2) {
|
|
40030
39828
|
if (code2 === null || markdownLineEnding(code2)) {
|
|
40031
39829
|
effects.exit("chunkString");
|
|
40032
39830
|
effects.exit("codeFencedFenceMeta");
|
|
@@ -40036,9 +39834,9 @@ function tokenizeCodeFenced(effects, ok2, nok) {
|
|
|
40036
39834
|
return nok(code2);
|
|
40037
39835
|
}
|
|
40038
39836
|
effects.consume(code2);
|
|
40039
|
-
return
|
|
39837
|
+
return meta2;
|
|
40040
39838
|
}
|
|
40041
|
-
__name(
|
|
39839
|
+
__name(meta2, "meta");
|
|
40042
39840
|
function atNonLazyBreak(code2) {
|
|
40043
39841
|
return effects.attempt(closeStart, after, contentBefore)(code2);
|
|
40044
39842
|
}
|
|
@@ -55955,6 +55753,34 @@ if (typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__ === "object") {
|
|
|
55955
55753
|
$mobx
|
|
55956
55754
|
});
|
|
55957
55755
|
}
|
|
55756
|
+
const keyCount = {};
|
|
55757
|
+
const timeout = {};
|
|
55758
|
+
const isBeingCalledExcessively = /* @__PURE__ */ __name(({
|
|
55759
|
+
uniqName
|
|
55760
|
+
}) => {
|
|
55761
|
+
if (process.env["NODE_ENV"] !== "development") {
|
|
55762
|
+
return;
|
|
55763
|
+
}
|
|
55764
|
+
if (!uniqName) {
|
|
55765
|
+
throw new Error("uniqName is required");
|
|
55766
|
+
}
|
|
55767
|
+
keyCount[uniqName] = keyCount[uniqName] || 0;
|
|
55768
|
+
keyCount[uniqName]++;
|
|
55769
|
+
if (!timeout[uniqName]) {
|
|
55770
|
+
timeout[uniqName] = setTimeout(() => {
|
|
55771
|
+
keyCount[uniqName] = 0;
|
|
55772
|
+
timeout[uniqName] = null;
|
|
55773
|
+
}, 2e3);
|
|
55774
|
+
}
|
|
55775
|
+
if (keyCount[uniqName] > 20) {
|
|
55776
|
+
keyCount[uniqName] = 0;
|
|
55777
|
+
if (timeout[uniqName]) {
|
|
55778
|
+
clearTimeout(timeout[uniqName]);
|
|
55779
|
+
timeout[uniqName] = null;
|
|
55780
|
+
}
|
|
55781
|
+
throw new Error(`isBeingCalledExcessively: ${uniqName}`);
|
|
55782
|
+
}
|
|
55783
|
+
}, "isBeingCalledExcessively");
|
|
55958
55784
|
T();
|
|
55959
55785
|
const IS_LINUX = window.navigator.platform.toLowerCase().search("linux") > -1;
|
|
55960
55786
|
const itemSizeEstimators = {
|
|
@@ -56303,6 +56129,7 @@ const DataTable = /* @__PURE__ */ __name((_u) => {
|
|
|
56303
56129
|
const entities = useDeepEqualMemo(_entities);
|
|
56304
56130
|
const entitiesAcrossPages = useDeepEqualMemo(_entitiesAcrossPages);
|
|
56305
56131
|
useEffect(() => {
|
|
56132
|
+
!noExcessiveCheck && isBeingCalledExcessively({ uniqName: `dt_entities_${formName}` });
|
|
56306
56133
|
change$1("allOrderedEntities", entitiesAcrossPages);
|
|
56307
56134
|
if (entities.length === 0 || isEmpty$1(reduxFormSelectedEntityIdMap)) return;
|
|
56308
56135
|
changeSelectedEntities({
|
|
@@ -56325,6 +56152,7 @@ const DataTable = /* @__PURE__ */ __name((_u) => {
|
|
|
56325
56152
|
} else {
|
|
56326
56153
|
newTableConfig = getTableConfigFromStorage(formName);
|
|
56327
56154
|
}
|
|
56155
|
+
!noExcessiveCheck && isBeingCalledExcessively({ uniqName: `dt_setTableConfig_${formName}` });
|
|
56328
56156
|
setTableConfig((prev) => {
|
|
56329
56157
|
if (!newTableConfig) {
|
|
56330
56158
|
newTableConfig = {
|
|
@@ -75010,7 +74838,9 @@ function comboToLabel(def, useSymbols = true) {
|
|
|
75010
74838
|
const combo = typeof def === "string" ? def : def.combo;
|
|
75011
74839
|
if (useSymbols) {
|
|
75012
74840
|
let parts2 = combo.replace("++", "+plus").split("+");
|
|
75013
|
-
parts2 = parts2.map(
|
|
74841
|
+
parts2 = parts2.map(
|
|
74842
|
+
(p2) => p2 in symbols ? symbols[p2] : startCase(p2) || p2
|
|
74843
|
+
);
|
|
75014
74844
|
return parts2.join("");
|
|
75015
74845
|
} else {
|
|
75016
74846
|
return combo.split("+").map((p2) => startCase(p2) || p2).join(" + ").replace("Meta", isMac ? "Cmd" : "Ctrl").replace("Mod", isMac ? "Cmd" : "Ctrl").replace("Alt", isMac ? "Option" : "Alt");
|
|
@@ -75020,7 +74850,7 @@ __name(comboToLabel, "comboToLabel");
|
|
|
75020
74850
|
const getHotkeyProps = /* @__PURE__ */ __name((def, id2) => {
|
|
75021
74851
|
let out;
|
|
75022
74852
|
if (typeof def === "string") {
|
|
75023
|
-
out = { combo: def };
|
|
74853
|
+
out = { combo: def, label: def };
|
|
75024
74854
|
} else if (def instanceof Array) {
|
|
75025
74855
|
out = __spreadValues({ combo: def[0], label: def[1] }, def[2] || {});
|
|
75026
74856
|
} else {
|
|
@@ -75055,15 +74885,18 @@ const withHotkeys = /* @__PURE__ */ __name((hotkeys, handlers2) => {
|
|
|
75055
74885
|
React__default.cloneElement(children, newProps)
|
|
75056
74886
|
) : (
|
|
75057
74887
|
//if not, then we'll return a div that can be used
|
|
75058
|
-
/* @__PURE__ */
|
|
74888
|
+
/* @__PURE__ */ jsx("div", __spreadValues({ className: "hotkeyHandler" }, newProps))
|
|
75059
74889
|
);
|
|
75060
74890
|
};
|
|
75061
74891
|
}, "withHotkeys");
|
|
75062
74892
|
const isMac = navigator.userAgent.includes("Mac OS X");
|
|
74893
|
+
const cmd = "⌘";
|
|
74894
|
+
const meta = "⌘";
|
|
74895
|
+
const ctrl = "⌃";
|
|
75063
74896
|
const symbols = {
|
|
75064
|
-
cmd
|
|
75065
|
-
meta
|
|
75066
|
-
ctrl
|
|
74897
|
+
cmd,
|
|
74898
|
+
meta,
|
|
74899
|
+
ctrl,
|
|
75067
74900
|
alt: "⌥",
|
|
75068
74901
|
shift: "⇧",
|
|
75069
74902
|
esc: "␛",
|
|
@@ -75081,9 +74914,9 @@ const symbols = {
|
|
|
75081
74914
|
left: "←",
|
|
75082
74915
|
right: "→",
|
|
75083
74916
|
up: "↑",
|
|
75084
|
-
down: "↓"
|
|
74917
|
+
down: "↓",
|
|
74918
|
+
mod: isMac ? cmd : ctrl
|
|
75085
74919
|
};
|
|
75086
|
-
symbols.mod = symbols[isMac ? "meta" : "ctrl"];
|
|
75087
74920
|
let MenuBar$1 = (_C = class extends React__default.Component {
|
|
75088
74921
|
constructor(props) {
|
|
75089
74922
|
super(props);
|
|
@@ -75971,21 +75804,21 @@ function getCommandHotkeyHandlers(commands) {
|
|
|
75971
75804
|
}
|
|
75972
75805
|
__name(getCommandHotkeyHandlers, "getCommandHotkeyHandlers");
|
|
75973
75806
|
const withCommand = /* @__PURE__ */ __name((mappings) => (WrappedComponent) => (_a2) => {
|
|
75974
|
-
var _b2 = _a2, { cmd, cmdOptions = {} } = _b2, props = __objRest(_b2, ["cmd", "cmdOptions"]);
|
|
75807
|
+
var _b2 = _a2, { cmd: cmd2, cmdOptions = {} } = _b2, props = __objRest(_b2, ["cmd", "cmdOptions"]);
|
|
75975
75808
|
const mappedProps = {};
|
|
75976
75809
|
Object.keys(mappings).forEach((k2) => {
|
|
75977
|
-
mappedProps[k2] = mappings[k2] === "execute" ? (event) =>
|
|
75810
|
+
mappedProps[k2] = mappings[k2] === "execute" ? (event) => cmd2.execute({ event }) : typeof mappings[k2] === "function" ? mappings[k2](cmd2, props) : cmd2[mappings[k2]];
|
|
75978
75811
|
});
|
|
75979
75812
|
let out = /* @__PURE__ */ React__default.createElement(WrappedComponent, __spreadValues(__spreadValues({}, mappedProps), props));
|
|
75980
|
-
const tooltip =
|
|
75813
|
+
const tooltip = cmd2.tooltip || typeof cmd2.isDisabled === "string" && cmd2.isDisabled;
|
|
75981
75814
|
if (tooltip && !cmdOptions.ignoreTooltip) {
|
|
75982
75815
|
out = /* @__PURE__ */ React__default.createElement(Tooltip, { content: tooltip }, out);
|
|
75983
75816
|
}
|
|
75984
|
-
return
|
|
75817
|
+
return cmd2.isHidden && !cmdOptions.ignoreHidden ? null : out;
|
|
75985
75818
|
}, "withCommand");
|
|
75986
75819
|
const CmdCheckbox = withCommand({
|
|
75987
75820
|
onChange: "execute",
|
|
75988
|
-
label: /* @__PURE__ */ __name((
|
|
75821
|
+
label: /* @__PURE__ */ __name((cmd2, props) => props.name || props.prefix && /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, props.prefix, cmd2.name) || cmd2.name, "label"),
|
|
75989
75822
|
disabled: "isDisabled",
|
|
75990
75823
|
checked: "isActive"
|
|
75991
75824
|
})(Checkbox);
|
|
@@ -75994,13 +75827,13 @@ const Div = /* @__PURE__ */ __name(({ onChange, children }) => {
|
|
|
75994
75827
|
}, "Div");
|
|
75995
75828
|
const CmdDiv = withCommand({
|
|
75996
75829
|
onChange: "execute",
|
|
75997
|
-
children: /* @__PURE__ */ __name((
|
|
75830
|
+
children: /* @__PURE__ */ __name((cmd2, props) => props.name || props.prefix && /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, props.prefix, cmd2.name) || cmd2.name, "children"),
|
|
75998
75831
|
disabled: "isDisabled",
|
|
75999
75832
|
checked: "isActive"
|
|
76000
75833
|
})(Div);
|
|
76001
75834
|
const CmdButton = withCommand({
|
|
76002
75835
|
onClick: "execute",
|
|
76003
|
-
text: /* @__PURE__ */ __name((
|
|
75836
|
+
text: /* @__PURE__ */ __name((cmd2) => cmd2.isActive === false && cmd2.inactiveName || cmd2.name, "text"),
|
|
76004
75837
|
icon: "icon",
|
|
76005
75838
|
disabled: "isDisabled"
|
|
76006
75839
|
})(Button);
|
|
@@ -76293,9 +76126,9 @@ const createYourOwnEnzyme$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Obje
|
|
|
76293
76126
|
default: createYourOwnEnzyme
|
|
76294
76127
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
76295
76128
|
function createMetaAction(actionName, payloadHelper) {
|
|
76296
|
-
return createAction(actionName, payloadHelper, function(unused,
|
|
76297
|
-
return __spreadProps(__spreadValues({},
|
|
76298
|
-
editorName:
|
|
76129
|
+
return createAction(actionName, payloadHelper, function(unused, meta2) {
|
|
76130
|
+
return __spreadProps(__spreadValues({}, meta2), {
|
|
76131
|
+
editorName: meta2.editorName
|
|
76299
76132
|
});
|
|
76300
76133
|
});
|
|
76301
76134
|
}
|
|
@@ -78370,303 +78203,6 @@ const getFeatureToColorMap = /* @__PURE__ */ __name(({ includeHidden } = {}) =>
|
|
|
78370
78203
|
const getFeatureTypes = /* @__PURE__ */ __name(({ includeHidden } = {}) => filter(getMergedFeatureMap(), (f2) => includeHidden ? true : !f2.isHidden).map(
|
|
78371
78204
|
(f2) => f2.name
|
|
78372
78205
|
), "getFeatureTypes");
|
|
78373
|
-
var lib$6 = { exports: {} };
|
|
78374
|
-
var randomFromSeed;
|
|
78375
|
-
var hasRequiredRandomFromSeed;
|
|
78376
|
-
function requireRandomFromSeed() {
|
|
78377
|
-
if (hasRequiredRandomFromSeed) return randomFromSeed;
|
|
78378
|
-
hasRequiredRandomFromSeed = 1;
|
|
78379
|
-
var seed = 1;
|
|
78380
|
-
function getNextValue() {
|
|
78381
|
-
seed = (seed * 9301 + 49297) % 233280;
|
|
78382
|
-
return seed / 233280;
|
|
78383
|
-
}
|
|
78384
|
-
__name(getNextValue, "getNextValue");
|
|
78385
|
-
function setSeed(_seed_) {
|
|
78386
|
-
seed = _seed_;
|
|
78387
|
-
}
|
|
78388
|
-
__name(setSeed, "setSeed");
|
|
78389
|
-
randomFromSeed = {
|
|
78390
|
-
nextValue: getNextValue,
|
|
78391
|
-
seed: setSeed
|
|
78392
|
-
};
|
|
78393
|
-
return randomFromSeed;
|
|
78394
|
-
}
|
|
78395
|
-
__name(requireRandomFromSeed, "requireRandomFromSeed");
|
|
78396
|
-
var alphabet_1;
|
|
78397
|
-
var hasRequiredAlphabet;
|
|
78398
|
-
function requireAlphabet() {
|
|
78399
|
-
if (hasRequiredAlphabet) return alphabet_1;
|
|
78400
|
-
hasRequiredAlphabet = 1;
|
|
78401
|
-
var randomFromSeed2 = requireRandomFromSeed();
|
|
78402
|
-
var ORIGINAL = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-";
|
|
78403
|
-
var alphabet;
|
|
78404
|
-
var previousSeed;
|
|
78405
|
-
var shuffled;
|
|
78406
|
-
function reset2() {
|
|
78407
|
-
shuffled = false;
|
|
78408
|
-
}
|
|
78409
|
-
__name(reset2, "reset");
|
|
78410
|
-
function setCharacters(_alphabet_) {
|
|
78411
|
-
if (!_alphabet_) {
|
|
78412
|
-
if (alphabet !== ORIGINAL) {
|
|
78413
|
-
alphabet = ORIGINAL;
|
|
78414
|
-
reset2();
|
|
78415
|
-
}
|
|
78416
|
-
return;
|
|
78417
|
-
}
|
|
78418
|
-
if (_alphabet_ === alphabet) {
|
|
78419
|
-
return;
|
|
78420
|
-
}
|
|
78421
|
-
if (_alphabet_.length !== ORIGINAL.length) {
|
|
78422
|
-
throw new Error("Custom alphabet for shortid must be " + ORIGINAL.length + " unique characters. You submitted " + _alphabet_.length + " characters: " + _alphabet_);
|
|
78423
|
-
}
|
|
78424
|
-
var unique2 = _alphabet_.split("").filter(function(item, ind, arr) {
|
|
78425
|
-
return ind !== arr.lastIndexOf(item);
|
|
78426
|
-
});
|
|
78427
|
-
if (unique2.length) {
|
|
78428
|
-
throw new Error("Custom alphabet for shortid must be " + ORIGINAL.length + " unique characters. These characters were not unique: " + unique2.join(", "));
|
|
78429
|
-
}
|
|
78430
|
-
alphabet = _alphabet_;
|
|
78431
|
-
reset2();
|
|
78432
|
-
}
|
|
78433
|
-
__name(setCharacters, "setCharacters");
|
|
78434
|
-
function characters(_alphabet_) {
|
|
78435
|
-
setCharacters(_alphabet_);
|
|
78436
|
-
return alphabet;
|
|
78437
|
-
}
|
|
78438
|
-
__name(characters, "characters");
|
|
78439
|
-
function setSeed(seed) {
|
|
78440
|
-
randomFromSeed2.seed(seed);
|
|
78441
|
-
if (previousSeed !== seed) {
|
|
78442
|
-
reset2();
|
|
78443
|
-
previousSeed = seed;
|
|
78444
|
-
}
|
|
78445
|
-
}
|
|
78446
|
-
__name(setSeed, "setSeed");
|
|
78447
|
-
function shuffle() {
|
|
78448
|
-
if (!alphabet) {
|
|
78449
|
-
setCharacters(ORIGINAL);
|
|
78450
|
-
}
|
|
78451
|
-
var sourceArray = alphabet.split("");
|
|
78452
|
-
var targetArray = [];
|
|
78453
|
-
var r2 = randomFromSeed2.nextValue();
|
|
78454
|
-
var characterIndex;
|
|
78455
|
-
while (sourceArray.length > 0) {
|
|
78456
|
-
r2 = randomFromSeed2.nextValue();
|
|
78457
|
-
characterIndex = Math.floor(r2 * sourceArray.length);
|
|
78458
|
-
targetArray.push(sourceArray.splice(characterIndex, 1)[0]);
|
|
78459
|
-
}
|
|
78460
|
-
return targetArray.join("");
|
|
78461
|
-
}
|
|
78462
|
-
__name(shuffle, "shuffle");
|
|
78463
|
-
function getShuffled() {
|
|
78464
|
-
if (shuffled) {
|
|
78465
|
-
return shuffled;
|
|
78466
|
-
}
|
|
78467
|
-
shuffled = shuffle();
|
|
78468
|
-
return shuffled;
|
|
78469
|
-
}
|
|
78470
|
-
__name(getShuffled, "getShuffled");
|
|
78471
|
-
function lookup(index2) {
|
|
78472
|
-
var alphabetShuffled = getShuffled();
|
|
78473
|
-
return alphabetShuffled[index2];
|
|
78474
|
-
}
|
|
78475
|
-
__name(lookup, "lookup");
|
|
78476
|
-
function get7() {
|
|
78477
|
-
return alphabet || ORIGINAL;
|
|
78478
|
-
}
|
|
78479
|
-
__name(get7, "get");
|
|
78480
|
-
alphabet_1 = {
|
|
78481
|
-
get: get7,
|
|
78482
|
-
characters,
|
|
78483
|
-
seed: setSeed,
|
|
78484
|
-
lookup,
|
|
78485
|
-
shuffled: getShuffled
|
|
78486
|
-
};
|
|
78487
|
-
return alphabet_1;
|
|
78488
|
-
}
|
|
78489
|
-
__name(requireAlphabet, "requireAlphabet");
|
|
78490
|
-
var randomByteBrowser;
|
|
78491
|
-
var hasRequiredRandomByteBrowser;
|
|
78492
|
-
function requireRandomByteBrowser() {
|
|
78493
|
-
if (hasRequiredRandomByteBrowser) return randomByteBrowser;
|
|
78494
|
-
hasRequiredRandomByteBrowser = 1;
|
|
78495
|
-
var crypto2 = typeof window === "object" && (window.crypto || window.msCrypto);
|
|
78496
|
-
var randomByte;
|
|
78497
|
-
if (!crypto2 || !crypto2.getRandomValues) {
|
|
78498
|
-
randomByte = /* @__PURE__ */ __name(function(size) {
|
|
78499
|
-
var bytes = [];
|
|
78500
|
-
for (var i = 0; i < size; i++) {
|
|
78501
|
-
bytes.push(Math.floor(Math.random() * 256));
|
|
78502
|
-
}
|
|
78503
|
-
return bytes;
|
|
78504
|
-
}, "randomByte");
|
|
78505
|
-
} else {
|
|
78506
|
-
randomByte = /* @__PURE__ */ __name(function(size) {
|
|
78507
|
-
return crypto2.getRandomValues(new Uint8Array(size));
|
|
78508
|
-
}, "randomByte");
|
|
78509
|
-
}
|
|
78510
|
-
randomByteBrowser = randomByte;
|
|
78511
|
-
return randomByteBrowser;
|
|
78512
|
-
}
|
|
78513
|
-
__name(requireRandomByteBrowser, "requireRandomByteBrowser");
|
|
78514
|
-
var format_browser;
|
|
78515
|
-
var hasRequiredFormat_browser;
|
|
78516
|
-
function requireFormat_browser() {
|
|
78517
|
-
if (hasRequiredFormat_browser) return format_browser;
|
|
78518
|
-
hasRequiredFormat_browser = 1;
|
|
78519
|
-
format_browser = /* @__PURE__ */ __name(function(random, alphabet, size) {
|
|
78520
|
-
var mask = (2 << Math.log(alphabet.length - 1) / Math.LN2) - 1;
|
|
78521
|
-
var step = -~(1.6 * mask * size / alphabet.length);
|
|
78522
|
-
var id2 = "";
|
|
78523
|
-
while (true) {
|
|
78524
|
-
var bytes = random(step);
|
|
78525
|
-
var i = step;
|
|
78526
|
-
while (i--) {
|
|
78527
|
-
id2 += alphabet[bytes[i] & mask] || "";
|
|
78528
|
-
if (id2.length === +size) return id2;
|
|
78529
|
-
}
|
|
78530
|
-
}
|
|
78531
|
-
}, "format_browser");
|
|
78532
|
-
return format_browser;
|
|
78533
|
-
}
|
|
78534
|
-
__name(requireFormat_browser, "requireFormat_browser");
|
|
78535
|
-
var generate_1;
|
|
78536
|
-
var hasRequiredGenerate;
|
|
78537
|
-
function requireGenerate() {
|
|
78538
|
-
if (hasRequiredGenerate) return generate_1;
|
|
78539
|
-
hasRequiredGenerate = 1;
|
|
78540
|
-
var alphabet = requireAlphabet();
|
|
78541
|
-
var random = requireRandomByteBrowser();
|
|
78542
|
-
var format2 = /* @__PURE__ */ requireFormat_browser();
|
|
78543
|
-
function generate(number2) {
|
|
78544
|
-
var loopCounter = 0;
|
|
78545
|
-
var done;
|
|
78546
|
-
var str = "";
|
|
78547
|
-
while (!done) {
|
|
78548
|
-
str = str + format2(random, alphabet.get(), 1);
|
|
78549
|
-
done = number2 < Math.pow(16, loopCounter + 1);
|
|
78550
|
-
loopCounter++;
|
|
78551
|
-
}
|
|
78552
|
-
return str;
|
|
78553
|
-
}
|
|
78554
|
-
__name(generate, "generate");
|
|
78555
|
-
generate_1 = generate;
|
|
78556
|
-
return generate_1;
|
|
78557
|
-
}
|
|
78558
|
-
__name(requireGenerate, "requireGenerate");
|
|
78559
|
-
var build_1;
|
|
78560
|
-
var hasRequiredBuild;
|
|
78561
|
-
function requireBuild() {
|
|
78562
|
-
if (hasRequiredBuild) return build_1;
|
|
78563
|
-
hasRequiredBuild = 1;
|
|
78564
|
-
var generate = requireGenerate();
|
|
78565
|
-
requireAlphabet();
|
|
78566
|
-
var REDUCE_TIME = 1567752802062;
|
|
78567
|
-
var version2 = 7;
|
|
78568
|
-
var counter2;
|
|
78569
|
-
var previousSeconds;
|
|
78570
|
-
function build(clusterWorkerId) {
|
|
78571
|
-
var str = "";
|
|
78572
|
-
var seconds = Math.floor((Date.now() - REDUCE_TIME) * 1e-3);
|
|
78573
|
-
if (seconds === previousSeconds) {
|
|
78574
|
-
counter2++;
|
|
78575
|
-
} else {
|
|
78576
|
-
counter2 = 0;
|
|
78577
|
-
previousSeconds = seconds;
|
|
78578
|
-
}
|
|
78579
|
-
str = str + generate(version2);
|
|
78580
|
-
str = str + generate(clusterWorkerId);
|
|
78581
|
-
if (counter2 > 0) {
|
|
78582
|
-
str = str + generate(counter2);
|
|
78583
|
-
}
|
|
78584
|
-
str = str + generate(seconds);
|
|
78585
|
-
return str;
|
|
78586
|
-
}
|
|
78587
|
-
__name(build, "build");
|
|
78588
|
-
build_1 = build;
|
|
78589
|
-
return build_1;
|
|
78590
|
-
}
|
|
78591
|
-
__name(requireBuild, "requireBuild");
|
|
78592
|
-
var isValid2;
|
|
78593
|
-
var hasRequiredIsValid;
|
|
78594
|
-
function requireIsValid() {
|
|
78595
|
-
if (hasRequiredIsValid) return isValid2;
|
|
78596
|
-
hasRequiredIsValid = 1;
|
|
78597
|
-
var alphabet = requireAlphabet();
|
|
78598
|
-
function isShortId(id2) {
|
|
78599
|
-
if (!id2 || typeof id2 !== "string" || id2.length < 6) {
|
|
78600
|
-
return false;
|
|
78601
|
-
}
|
|
78602
|
-
var nonAlphabetic = new RegExp("[^" + alphabet.get().replace(/[|\\{}()[\]^$+*?.-]/g, "\\$&") + "]");
|
|
78603
|
-
return !nonAlphabetic.test(id2);
|
|
78604
|
-
}
|
|
78605
|
-
__name(isShortId, "isShortId");
|
|
78606
|
-
isValid2 = isShortId;
|
|
78607
|
-
return isValid2;
|
|
78608
|
-
}
|
|
78609
|
-
__name(requireIsValid, "requireIsValid");
|
|
78610
|
-
var clusterWorkerIdBrowser;
|
|
78611
|
-
var hasRequiredClusterWorkerIdBrowser;
|
|
78612
|
-
function requireClusterWorkerIdBrowser() {
|
|
78613
|
-
if (hasRequiredClusterWorkerIdBrowser) return clusterWorkerIdBrowser;
|
|
78614
|
-
hasRequiredClusterWorkerIdBrowser = 1;
|
|
78615
|
-
clusterWorkerIdBrowser = 0;
|
|
78616
|
-
return clusterWorkerIdBrowser;
|
|
78617
|
-
}
|
|
78618
|
-
__name(requireClusterWorkerIdBrowser, "requireClusterWorkerIdBrowser");
|
|
78619
|
-
var hasRequiredLib$6;
|
|
78620
|
-
function requireLib$6() {
|
|
78621
|
-
if (hasRequiredLib$6) return lib$6.exports;
|
|
78622
|
-
hasRequiredLib$6 = 1;
|
|
78623
|
-
(function(module2) {
|
|
78624
|
-
var alphabet = requireAlphabet();
|
|
78625
|
-
var build = requireBuild();
|
|
78626
|
-
var isValid3 = requireIsValid();
|
|
78627
|
-
var clusterWorkerId = requireClusterWorkerIdBrowser() || 0;
|
|
78628
|
-
function seed(seedValue) {
|
|
78629
|
-
alphabet.seed(seedValue);
|
|
78630
|
-
return module2.exports;
|
|
78631
|
-
}
|
|
78632
|
-
__name(seed, "seed");
|
|
78633
|
-
function worker(workerId) {
|
|
78634
|
-
clusterWorkerId = workerId;
|
|
78635
|
-
return module2.exports;
|
|
78636
|
-
}
|
|
78637
|
-
__name(worker, "worker");
|
|
78638
|
-
function characters(newCharacters) {
|
|
78639
|
-
if (newCharacters !== void 0) {
|
|
78640
|
-
alphabet.characters(newCharacters);
|
|
78641
|
-
}
|
|
78642
|
-
return alphabet.shuffled();
|
|
78643
|
-
}
|
|
78644
|
-
__name(characters, "characters");
|
|
78645
|
-
function generate() {
|
|
78646
|
-
return build(clusterWorkerId);
|
|
78647
|
-
}
|
|
78648
|
-
__name(generate, "generate");
|
|
78649
|
-
module2.exports = generate;
|
|
78650
|
-
module2.exports.generate = generate;
|
|
78651
|
-
module2.exports.seed = seed;
|
|
78652
|
-
module2.exports.worker = worker;
|
|
78653
|
-
module2.exports.characters = characters;
|
|
78654
|
-
module2.exports.isValid = isValid3;
|
|
78655
|
-
})(lib$6);
|
|
78656
|
-
return lib$6.exports;
|
|
78657
|
-
}
|
|
78658
|
-
__name(requireLib$6, "requireLib$6");
|
|
78659
|
-
var shortid;
|
|
78660
|
-
var hasRequiredShortid;
|
|
78661
|
-
function requireShortid() {
|
|
78662
|
-
if (hasRequiredShortid) return shortid;
|
|
78663
|
-
hasRequiredShortid = 1;
|
|
78664
|
-
shortid = requireLib$6();
|
|
78665
|
-
return shortid;
|
|
78666
|
-
}
|
|
78667
|
-
__name(requireShortid, "requireShortid");
|
|
78668
|
-
var shortidExports = requireShortid();
|
|
78669
|
-
const uuid = /* @__PURE__ */ getDefaultExportFromCjs(shortidExports);
|
|
78670
78206
|
function cutSequenceByRestrictionEnzyme(pSequence, circular2, restrictionEnzyme) {
|
|
78671
78207
|
if (restrictionEnzyme.forwardRegex.length === 0 || restrictionEnzyme.reverseRegex.length === 0) {
|
|
78672
78208
|
const returnArray = [];
|
|
@@ -78874,7 +78410,7 @@ function cutSequence(forwardRegExpPattern, restrictionEnzyme, sequence2, circula
|
|
|
78874
78410
|
}
|
|
78875
78411
|
const overhangBps = getSequenceWithinRange(cutRange, originalSequence);
|
|
78876
78412
|
restrictionCutSite = {
|
|
78877
|
-
id:
|
|
78413
|
+
id: nanoid(),
|
|
78878
78414
|
start: start2,
|
|
78879
78415
|
end: end2,
|
|
78880
78416
|
topSnipPosition,
|
|
@@ -83509,10 +83045,10 @@ function tidyUpAnnotation(_annotation, {
|
|
|
83509
83045
|
annotation.name = "Untitled annotation";
|
|
83510
83046
|
}
|
|
83511
83047
|
if (provideNewIdsForAnnotations) {
|
|
83512
|
-
annotation.id =
|
|
83048
|
+
annotation.id = nanoid();
|
|
83513
83049
|
}
|
|
83514
83050
|
if (!annotation.id && annotation.id !== 0 && !doNotProvideIdsForAnnotations) {
|
|
83515
|
-
annotation.id =
|
|
83051
|
+
annotation.id = nanoid();
|
|
83516
83052
|
messages.push(
|
|
83517
83053
|
"Unable to detect valid ID for annotation, setting ID to " + annotation.id
|
|
83518
83054
|
);
|
|
@@ -83756,7 +83292,7 @@ function tidyUpSequenceData(pSeqData, options = {}) {
|
|
|
83756
83292
|
if (item.id || item.id === 0) {
|
|
83757
83293
|
itemId = item.id;
|
|
83758
83294
|
} else {
|
|
83759
|
-
itemId =
|
|
83295
|
+
itemId = nanoid();
|
|
83760
83296
|
if (!doNotProvideIdsForAnnotations) {
|
|
83761
83297
|
item.id = itemId;
|
|
83762
83298
|
}
|
|
@@ -83819,7 +83355,7 @@ function getVirtualDigest({
|
|
|
83819
83355
|
});
|
|
83820
83356
|
sortedCutsites.forEach((cutsite1, index2) => {
|
|
83821
83357
|
if (computePartialDigest && !computePartialDigestDisabled) {
|
|
83822
|
-
sortedCutsites.forEach((
|
|
83358
|
+
sortedCutsites.forEach((cs2, index22) => {
|
|
83823
83359
|
pairs.push([cutsite1, sortedCutsites[index22]]);
|
|
83824
83360
|
});
|
|
83825
83361
|
}
|
|
@@ -92188,7 +91724,7 @@ function getOrfsFromSequence(options) {
|
|
|
92188
91724
|
forward,
|
|
92189
91725
|
annotationTypePlural: "orfs",
|
|
92190
91726
|
isOrf: true,
|
|
92191
|
-
id:
|
|
91727
|
+
id: nanoid()
|
|
92192
91728
|
});
|
|
92193
91729
|
}
|
|
92194
91730
|
}
|
|
@@ -94318,11 +93854,11 @@ function requireValidator() {
|
|
|
94318
93854
|
if (attrStr[attrStr.length - 1] === "/") {
|
|
94319
93855
|
const attrStrStart = i - attrStr.length;
|
|
94320
93856
|
attrStr = attrStr.substring(0, attrStr.length - 1);
|
|
94321
|
-
const
|
|
94322
|
-
if (
|
|
93857
|
+
const isValid2 = validateAttributeString(attrStr, options);
|
|
93858
|
+
if (isValid2 === true) {
|
|
94323
93859
|
tagFound = true;
|
|
94324
93860
|
} else {
|
|
94325
|
-
return getErrorObject(
|
|
93861
|
+
return getErrorObject(isValid2.err.code, isValid2.err.msg, getLineNumberForPosition(xmlData, attrStrStart + isValid2.err.line));
|
|
94326
93862
|
}
|
|
94327
93863
|
} else if (closingTag) {
|
|
94328
93864
|
if (!result.tagClosed) {
|
|
@@ -94344,9 +93880,9 @@ function requireValidator() {
|
|
|
94344
93880
|
}
|
|
94345
93881
|
}
|
|
94346
93882
|
} else {
|
|
94347
|
-
const
|
|
94348
|
-
if (
|
|
94349
|
-
return getErrorObject(
|
|
93883
|
+
const isValid2 = validateAttributeString(attrStr, options);
|
|
93884
|
+
if (isValid2 !== true) {
|
|
93885
|
+
return getErrorObject(isValid2.err.code, isValid2.err.msg, getLineNumberForPosition(xmlData, i - attrStr.length + isValid2.err.line));
|
|
94350
93886
|
}
|
|
94351
93887
|
if (reachedRoot === true) {
|
|
94352
93888
|
return getErrorObject("InvalidXml", "Multiple possible root nodes found.", getLineNumberForPosition(xmlData, i));
|
|
@@ -103524,7 +103060,7 @@ const alignments = /* @__PURE__ */ __name((state2 = {}, { payload = {}, type: ty
|
|
|
103524
103060
|
if (type2 === "UPSERT_ALIGNMENT_RUN") {
|
|
103525
103061
|
const { id: id2 } = payload;
|
|
103526
103062
|
const payloadToUse = __spreadValues(__spreadValues({
|
|
103527
|
-
stateTrackingId: ((_a2 = state2[id2]) == null ? void 0 : _a2.stateTrackingId) ?
|
|
103063
|
+
stateTrackingId: ((_a2 = state2[id2]) == null ? void 0 : _a2.stateTrackingId) ? nanoid() : "initialLoadId",
|
|
103528
103064
|
alignmentType: (_b2 = state2[id2]) == null ? void 0 : _b2.alignmentType
|
|
103529
103065
|
}, payload), defaultVisibilityTypes.reduce((acc, type22) => {
|
|
103530
103066
|
if (type22.startsWith("pairwise_") && payload.pairwiseAlignments || !type22.startsWith("pairwise_") && !payload.pairwiseAlignments) {
|
|
@@ -103746,10 +103282,10 @@ const flipActiveTabFromLinearOrCircularIfNecessary = createMetaAction(
|
|
|
103746
103282
|
"flipActiveTabFromLinearOrCircularIfNecessary"
|
|
103747
103283
|
);
|
|
103748
103284
|
const expandTabToSplitScreen = createMetaAction("expandTabToSplitScreen");
|
|
103749
|
-
const propertiesViewOpen = /* @__PURE__ */ __name((unused,
|
|
103750
|
-
return setPanelAsActive("properties",
|
|
103285
|
+
const propertiesViewOpen = /* @__PURE__ */ __name((unused, meta2) => {
|
|
103286
|
+
return setPanelAsActive("properties", meta2);
|
|
103751
103287
|
}, "propertiesViewOpen");
|
|
103752
|
-
const createNewDigest = /* @__PURE__ */ __name((unused,
|
|
103288
|
+
const createNewDigest = /* @__PURE__ */ __name((unused, meta2) => {
|
|
103753
103289
|
return (dispatch) => {
|
|
103754
103290
|
dispatch(
|
|
103755
103291
|
addPanelIfItDoesntAlreadyExist(
|
|
@@ -103759,13 +103295,13 @@ const createNewDigest = /* @__PURE__ */ __name((unused, meta) => {
|
|
|
103759
103295
|
active: true,
|
|
103760
103296
|
canClose: true
|
|
103761
103297
|
},
|
|
103762
|
-
|
|
103298
|
+
meta2
|
|
103763
103299
|
)
|
|
103764
103300
|
);
|
|
103765
|
-
dispatch(setPanelAsActive("digestTool",
|
|
103301
|
+
dispatch(setPanelAsActive("digestTool", meta2));
|
|
103766
103302
|
};
|
|
103767
103303
|
}, "createNewDigest");
|
|
103768
|
-
const createNewPCR = /* @__PURE__ */ __name((unused,
|
|
103304
|
+
const createNewPCR = /* @__PURE__ */ __name((unused, meta2) => {
|
|
103769
103305
|
return (dispatch) => {
|
|
103770
103306
|
dispatch(
|
|
103771
103307
|
addPanelIfItDoesntAlreadyExist(
|
|
@@ -103775,13 +103311,13 @@ const createNewPCR = /* @__PURE__ */ __name((unused, meta) => {
|
|
|
103775
103311
|
active: true,
|
|
103776
103312
|
canClose: true
|
|
103777
103313
|
},
|
|
103778
|
-
|
|
103314
|
+
meta2
|
|
103779
103315
|
)
|
|
103780
103316
|
);
|
|
103781
|
-
dispatch(setPanelAsActive("pcrTool",
|
|
103317
|
+
dispatch(setPanelAsActive("pcrTool", meta2));
|
|
103782
103318
|
};
|
|
103783
103319
|
}, "createNewPCR");
|
|
103784
|
-
const createNewAlignment = /* @__PURE__ */ __name((payload,
|
|
103320
|
+
const createNewAlignment = /* @__PURE__ */ __name((payload, meta2) => {
|
|
103785
103321
|
return (dispatch) => {
|
|
103786
103322
|
dispatch(
|
|
103787
103323
|
addPanelIfItDoesntAlreadyExist(
|
|
@@ -103791,13 +103327,13 @@ const createNewAlignment = /* @__PURE__ */ __name((payload, meta) => {
|
|
|
103791
103327
|
active: true,
|
|
103792
103328
|
canClose: true
|
|
103793
103329
|
}, payload),
|
|
103794
|
-
|
|
103330
|
+
meta2
|
|
103795
103331
|
)
|
|
103796
103332
|
);
|
|
103797
|
-
dispatch(setPanelAsActive(payload.id,
|
|
103333
|
+
dispatch(setPanelAsActive(payload.id, meta2));
|
|
103798
103334
|
};
|
|
103799
103335
|
}, "createNewAlignment");
|
|
103800
|
-
const createNewMismatchesList = /* @__PURE__ */ __name((payload,
|
|
103336
|
+
const createNewMismatchesList = /* @__PURE__ */ __name((payload, meta2) => {
|
|
103801
103337
|
return (dispatch) => {
|
|
103802
103338
|
dispatch(
|
|
103803
103339
|
addPanelIfItDoesntAlreadyExist(
|
|
@@ -103807,16 +103343,16 @@ const createNewMismatchesList = /* @__PURE__ */ __name((payload, meta) => {
|
|
|
103807
103343
|
active: true,
|
|
103808
103344
|
canClose: true
|
|
103809
103345
|
}, payload),
|
|
103810
|
-
|
|
103346
|
+
meta2
|
|
103811
103347
|
)
|
|
103812
103348
|
);
|
|
103813
|
-
dispatch(setPanelAsActive(payload.id,
|
|
103349
|
+
dispatch(setPanelAsActive(payload.id, meta2));
|
|
103814
103350
|
};
|
|
103815
103351
|
}, "createNewMismatchesList");
|
|
103816
|
-
const collapseSplitScreen = /* @__PURE__ */ __name((activePanelId,
|
|
103352
|
+
const collapseSplitScreen = /* @__PURE__ */ __name((activePanelId, meta2) => {
|
|
103817
103353
|
return (dispatch) => {
|
|
103818
|
-
dispatch(_collapseSplitScreen(activePanelId,
|
|
103819
|
-
activePanelId && dispatch(setPanelAsActive(activePanelId,
|
|
103354
|
+
dispatch(_collapseSplitScreen(activePanelId, meta2));
|
|
103355
|
+
activePanelId && dispatch(setPanelAsActive(activePanelId, meta2));
|
|
103820
103356
|
};
|
|
103821
103357
|
}, "collapseSplitScreen");
|
|
103822
103358
|
const reducer$1 = createReducer(
|
|
@@ -104353,7 +103889,7 @@ const updateSelectedAnnotation = createMetaAction(
|
|
|
104353
103889
|
);
|
|
104354
103890
|
const annotationDeselect = createMetaAction("VE_ANNOTATION_DESELECT");
|
|
104355
103891
|
const annotationDeselectAll = createMetaAction("VE_ANNOTATION_DESELECT_ALL");
|
|
104356
|
-
function replacementLayerRightClicked({ event, annotation },
|
|
103892
|
+
function replacementLayerRightClicked({ event, annotation }, meta2) {
|
|
104357
103893
|
event.preventDefault();
|
|
104358
103894
|
event.stopPropagation();
|
|
104359
103895
|
return function(dispatch) {
|
|
@@ -104363,7 +103899,7 @@ function replacementLayerRightClicked({ event, annotation }, meta) {
|
|
|
104363
103899
|
onClick: /* @__PURE__ */ __name(function() {
|
|
104364
103900
|
dispatch({
|
|
104365
103901
|
type: "REPLACEMENT_LAYER_DELETE",
|
|
104366
|
-
meta,
|
|
103902
|
+
meta: meta2,
|
|
104367
103903
|
payload: __spreadValues({}, annotation)
|
|
104368
103904
|
});
|
|
104369
103905
|
}, "onClick")
|
|
@@ -105228,7 +104764,7 @@ const deepEqual = /* @__PURE__ */ getDefaultExportFromCjs(deepEqualExports);
|
|
|
105228
104764
|
function upsertDeleteActionGenerator(upsertAction, deleteAction) {
|
|
105229
104765
|
return {
|
|
105230
104766
|
[upsertAction]: (state2, payload) => {
|
|
105231
|
-
const idToUse = payload.id ||
|
|
104767
|
+
const idToUse = payload.id || nanoid();
|
|
105232
104768
|
return __spreadProps(__spreadValues({}, state2), {
|
|
105233
104769
|
[idToUse]: __spreadProps(__spreadValues(__spreadValues({}, state2[idToUse] || {}), payload), { id: idToUse })
|
|
105234
104770
|
});
|
|
@@ -105352,7 +104888,7 @@ function index$1(state2, action2) {
|
|
|
105352
104888
|
return state2;
|
|
105353
104889
|
} else {
|
|
105354
104890
|
return __spreadProps(__spreadValues({}, newState), {
|
|
105355
|
-
stateTrackingId: newState.stateTrackingId ?
|
|
104891
|
+
stateTrackingId: newState.stateTrackingId ? nanoid() : "initialLoadId"
|
|
105356
104892
|
});
|
|
105357
104893
|
}
|
|
105358
104894
|
}
|
|
@@ -105811,11 +105347,11 @@ const _FillWindow = class _FillWindow extends React__default.Component {
|
|
|
105811
105347
|
};
|
|
105812
105348
|
__name(_FillWindow, "FillWindow");
|
|
105813
105349
|
let FillWindow = _FillWindow;
|
|
105814
|
-
function addMetaToActionCreators(actions2,
|
|
105350
|
+
function addMetaToActionCreators(actions2, meta2) {
|
|
105815
105351
|
const metaActions = {};
|
|
105816
105352
|
Object.keys(actions2).forEach(function(actionName) {
|
|
105817
105353
|
metaActions[actionName] = function(firstArg, additionalMeta) {
|
|
105818
|
-
return actions2[actionName](firstArg, __spreadValues(__spreadValues({},
|
|
105354
|
+
return actions2[actionName](firstArg, __spreadValues(__spreadValues({}, meta2), additionalMeta || {}));
|
|
105819
105355
|
};
|
|
105820
105356
|
});
|
|
105821
105357
|
return metaActions;
|
|
@@ -106053,7 +105589,7 @@ function cutsitesSelector(sequence2, circular2, enzymeList, cutsiteLabelColors)
|
|
|
106053
105589
|
const cutsitesForEnzyme = cutsitesByName[enzymeName];
|
|
106054
105590
|
cutsitesForEnzyme.forEach(function(cutsite) {
|
|
106055
105591
|
const numberOfCuts = cutsitesByName[enzymeName].length;
|
|
106056
|
-
const uniqueId =
|
|
105592
|
+
const uniqueId = nanoid();
|
|
106057
105593
|
cutsite.id = uniqueId;
|
|
106058
105594
|
cutsite.numberOfCuts = numberOfCuts;
|
|
106059
105595
|
cutsite.annotationType = "cutsite";
|
|
@@ -106457,7 +105993,7 @@ const cdsFeaturesSelector = createSelector(featuresSelector, cdsFeaturesRawSelec
|
|
|
106457
105993
|
function translationsSelector(isCircular, translationSearchMatches, sequence2, orfs, showOrfTranslations, showOrfs, cdsFeatures, showCdsFeatureTranslations, showFeatures, translations2, frameTranslations2) {
|
|
106458
105994
|
const translationsToPass = __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, translationSearchMatches.reduce((acc, match) => {
|
|
106459
105995
|
if (!match) return acc;
|
|
106460
|
-
const id2 = match.id ||
|
|
105996
|
+
const id2 = match.id || nanoid();
|
|
106461
105997
|
acc[id2] = __spreadProps(__spreadValues({}, match), {
|
|
106462
105998
|
id: id2,
|
|
106463
105999
|
translationType: "AA Search Match",
|
|
@@ -106498,7 +106034,7 @@ function translationsSelector(isCircular, translationSearchMatches, sequence2, o
|
|
|
106498
106034
|
(acc, isActive2, frameName) => {
|
|
106499
106035
|
const frameOffset = Number(frameName);
|
|
106500
106036
|
if (isActive2) {
|
|
106501
|
-
const id2 =
|
|
106037
|
+
const id2 = nanoid();
|
|
106502
106038
|
acc[id2] = {
|
|
106503
106039
|
id: id2,
|
|
106504
106040
|
start: isCircular || frameOffset > 0 ? normalizePositionByRangeLength(
|
|
@@ -107211,7 +106747,7 @@ function requireDomToImage() {
|
|
|
107211
106747
|
return new Promise(function(resolve) {
|
|
107212
106748
|
var request = new XMLHttpRequest();
|
|
107213
106749
|
request.onreadystatechange = done;
|
|
107214
|
-
request.ontimeout =
|
|
106750
|
+
request.ontimeout = timeout2;
|
|
107215
106751
|
request.responseType = "blob";
|
|
107216
106752
|
request.timeout = TIMEOUT;
|
|
107217
106753
|
request.open("GET", url, true);
|
|
@@ -107241,14 +106777,14 @@ function requireDomToImage() {
|
|
|
107241
106777
|
encoder.readAsDataURL(request.response);
|
|
107242
106778
|
}
|
|
107243
106779
|
__name(done, "done");
|
|
107244
|
-
function
|
|
106780
|
+
function timeout2() {
|
|
107245
106781
|
if (placeholder) {
|
|
107246
106782
|
resolve(placeholder);
|
|
107247
106783
|
} else {
|
|
107248
106784
|
fail("timeout of " + TIMEOUT + "ms occured while fetching resource: " + url);
|
|
107249
106785
|
}
|
|
107250
106786
|
}
|
|
107251
|
-
__name(
|
|
106787
|
+
__name(timeout2, "timeout");
|
|
107252
106788
|
function fail(message) {
|
|
107253
106789
|
console.error(message);
|
|
107254
106790
|
resolve("");
|
|
@@ -107510,7 +107046,7 @@ function showDialog({
|
|
|
107510
107046
|
dialogHolder.CustomModalComponent = ModalComponent;
|
|
107511
107047
|
dialogHolder.props = props;
|
|
107512
107048
|
dialogHolder.overrideName = overrideName;
|
|
107513
|
-
dialogHolder.setUniqKeyToForceRerender(
|
|
107049
|
+
dialogHolder.setUniqKeyToForceRerender(nanoid());
|
|
107514
107050
|
}
|
|
107515
107051
|
__name(showDialog, "showDialog");
|
|
107516
107052
|
function hideDialog() {
|
|
@@ -107900,7 +107436,7 @@ const importSequenceFromFile = /* @__PURE__ */ __name((props) => (_0, ..._1) =>
|
|
|
107900
107436
|
seqData = yield onImport(seqData, file, props);
|
|
107901
107437
|
}
|
|
107902
107438
|
if (seqData) {
|
|
107903
|
-
seqData.stateTrackingId =
|
|
107439
|
+
seqData.stateTrackingId = nanoid();
|
|
107904
107440
|
updateEditor(
|
|
107905
107441
|
{
|
|
107906
107442
|
getState: /* @__PURE__ */ __name(() => ({ VectorEditor: { [props.editorName]: props } }), "getState"),
|
|
@@ -108162,7 +107698,7 @@ function mapStateToProps(state2, ownProps) {
|
|
|
108162
107698
|
readOnly: readOnly2
|
|
108163
107699
|
} = ownProps;
|
|
108164
107700
|
const editorState = getEditorState(state2, editorName);
|
|
108165
|
-
const
|
|
107701
|
+
const meta2 = { editorName };
|
|
108166
107702
|
const { VectorEditor } = state2;
|
|
108167
107703
|
const { __allEditorsOptions } = VectorEditor;
|
|
108168
107704
|
const { uppercaseSequenceMapFont: uppercaseSequenceMapFont2 } = __allEditorsOptions;
|
|
@@ -108190,7 +107726,7 @@ function mapStateToProps(state2, ownProps) {
|
|
|
108190
107726
|
}
|
|
108191
107727
|
});
|
|
108192
107728
|
const toReturn = __spreadProps(__spreadValues({}, editorState), {
|
|
108193
|
-
meta,
|
|
107729
|
+
meta: meta2,
|
|
108194
107730
|
annotationToAdd
|
|
108195
107731
|
});
|
|
108196
107732
|
if (sequenceDataFromProps && allowSeqDataOverride) {
|
|
@@ -108224,7 +107760,7 @@ function mapStateToProps(state2, ownProps) {
|
|
|
108224
107760
|
const f2 = getFindTool(findTool2, matchesTotal);
|
|
108225
107761
|
return __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, editorState), {
|
|
108226
107762
|
readOnly: readOnly2 || editorState.readOnly,
|
|
108227
|
-
meta,
|
|
107763
|
+
meta: meta2,
|
|
108228
107764
|
annotationToAdd
|
|
108229
107765
|
}), newSelection && { selectionLayer: newSelection }), {
|
|
108230
107766
|
selectedCutsites,
|
|
@@ -108283,8 +107819,8 @@ function fakeActionOverrides() {
|
|
|
108283
107819
|
}
|
|
108284
107820
|
__name(fakeActionOverrides, "fakeActionOverrides");
|
|
108285
107821
|
function getCombinedActions(editorName, actions2, actionOverrides, dispatch) {
|
|
108286
|
-
const
|
|
108287
|
-
let metaActions = addMetaToActionCreators(actions2,
|
|
107822
|
+
const meta2 = { editorName };
|
|
107823
|
+
let metaActions = addMetaToActionCreators(actions2, meta2);
|
|
108288
107824
|
const overrides = {};
|
|
108289
107825
|
metaActions = __spreadValues(__spreadValues({
|
|
108290
107826
|
undo: /* @__PURE__ */ __name(() => {
|
|
@@ -120246,7 +119782,7 @@ const DrawLabel = withHover(
|
|
|
120246
119782
|
}, hovered && { textDecoration: "underline" }), annotation.annotationTypePlural !== "cutsites" && {
|
|
120247
119783
|
fontStyle: "normal"
|
|
120248
119784
|
}), {
|
|
120249
|
-
left: clamp$
|
|
119785
|
+
left: clamp$4(xStart, 0, Number.MAX_VALUE),
|
|
120250
119786
|
whiteSpace: "nowrap",
|
|
120251
119787
|
color: annotation.annotationTypePlural === "parts" ? "#ac68cc" : annotation.labelColor,
|
|
120252
119788
|
zIndex: 10
|
|
@@ -122350,7 +121886,7 @@ function showFileDialog({ multiple = false, onSelect }) {
|
|
|
122350
121886
|
input.click();
|
|
122351
121887
|
}
|
|
122352
121888
|
__name(showFileDialog, "showFileDialog");
|
|
122353
|
-
const version = "0.7.
|
|
121889
|
+
const version = "0.7.30-beta.1";
|
|
122354
121890
|
const packageJson = {
|
|
122355
121891
|
version
|
|
122356
121892
|
};
|
|
@@ -128283,8 +127819,8 @@ function assignDefault(value, fallback) {
|
|
|
128283
127819
|
__name(assignDefault, "assignDefault");
|
|
128284
127820
|
const BEFORE_LAST_KINEMATICS_DELAY = 32;
|
|
128285
127821
|
const _Engine = class _Engine {
|
|
128286
|
-
constructor(
|
|
128287
|
-
this.ctrl =
|
|
127822
|
+
constructor(ctrl2, args, key) {
|
|
127823
|
+
this.ctrl = ctrl2;
|
|
128288
127824
|
this.args = args;
|
|
128289
127825
|
this.key = key;
|
|
128290
127826
|
if (!this.state) {
|
|
@@ -129087,9 +128623,9 @@ function parse(newConfig, gestureKey, _config = {}) {
|
|
|
129087
128623
|
}
|
|
129088
128624
|
__name(parse, "parse");
|
|
129089
128625
|
const _EventStore = class _EventStore {
|
|
129090
|
-
constructor(
|
|
128626
|
+
constructor(ctrl2, gestureKey) {
|
|
129091
128627
|
_defineProperty(this, "_listeners", /* @__PURE__ */ new Set());
|
|
129092
|
-
this._ctrl =
|
|
128628
|
+
this._ctrl = ctrl2;
|
|
129093
128629
|
this._gestureKey = gestureKey;
|
|
129094
128630
|
}
|
|
129095
128631
|
add(element2, device, action2, handler, options) {
|
|
@@ -129121,11 +128657,11 @@ const _TimeoutStore = class _TimeoutStore {
|
|
|
129121
128657
|
this._timeouts.set(key, window.setTimeout(callback2, ms, ...args));
|
|
129122
128658
|
}
|
|
129123
128659
|
remove(key) {
|
|
129124
|
-
const
|
|
129125
|
-
if (
|
|
128660
|
+
const timeout2 = this._timeouts.get(key);
|
|
128661
|
+
if (timeout2) window.clearTimeout(timeout2);
|
|
129126
128662
|
}
|
|
129127
128663
|
clean() {
|
|
129128
|
-
this._timeouts.forEach((
|
|
128664
|
+
this._timeouts.forEach((timeout2) => void window.clearTimeout(timeout2));
|
|
129129
128665
|
this._timeouts.clear();
|
|
129130
128666
|
}
|
|
129131
128667
|
};
|
|
@@ -129223,19 +128759,19 @@ const _Controller = class _Controller {
|
|
|
129223
128759
|
};
|
|
129224
128760
|
__name(_Controller, "Controller");
|
|
129225
128761
|
let Controller = _Controller;
|
|
129226
|
-
function setupGesture(
|
|
129227
|
-
|
|
129228
|
-
|
|
129229
|
-
|
|
128762
|
+
function setupGesture(ctrl2, gestureKey) {
|
|
128763
|
+
ctrl2.gestures.add(gestureKey);
|
|
128764
|
+
ctrl2.gestureEventStores[gestureKey] = new EventStore(ctrl2, gestureKey);
|
|
128765
|
+
ctrl2.gestureTimeoutStores[gestureKey] = new TimeoutStore();
|
|
129230
128766
|
}
|
|
129231
128767
|
__name(setupGesture, "setupGesture");
|
|
129232
|
-
function resolveGestures(
|
|
129233
|
-
if (internalHandlers.drag) setupGesture(
|
|
129234
|
-
if (internalHandlers.wheel) setupGesture(
|
|
129235
|
-
if (internalHandlers.scroll) setupGesture(
|
|
129236
|
-
if (internalHandlers.move) setupGesture(
|
|
129237
|
-
if (internalHandlers.pinch) setupGesture(
|
|
129238
|
-
if (internalHandlers.hover) setupGesture(
|
|
128768
|
+
function resolveGestures(ctrl2, internalHandlers) {
|
|
128769
|
+
if (internalHandlers.drag) setupGesture(ctrl2, "drag");
|
|
128770
|
+
if (internalHandlers.wheel) setupGesture(ctrl2, "wheel");
|
|
128771
|
+
if (internalHandlers.scroll) setupGesture(ctrl2, "scroll");
|
|
128772
|
+
if (internalHandlers.move) setupGesture(ctrl2, "move");
|
|
128773
|
+
if (internalHandlers.pinch) setupGesture(ctrl2, "pinch");
|
|
128774
|
+
if (internalHandlers.hover) setupGesture(ctrl2, "hover");
|
|
129239
128775
|
}
|
|
129240
128776
|
__name(resolveGestures, "resolveGestures");
|
|
129241
128777
|
const bindToProps = /* @__PURE__ */ __name((props, eventOptions, withPassiveOption) => (device, action2, handler, options = {}, isNative2 = false) => {
|
|
@@ -129248,15 +128784,15 @@ const bindToProps = /* @__PURE__ */ __name((props, eventOptions, withPassiveOpti
|
|
|
129248
128784
|
props[handlerProp].push(handler);
|
|
129249
128785
|
}, "bindToProps");
|
|
129250
128786
|
function useRecognizers(handlers2, config = {}, gestureKey, nativeHandlers) {
|
|
129251
|
-
const
|
|
129252
|
-
|
|
129253
|
-
|
|
129254
|
-
React__default.useEffect(
|
|
128787
|
+
const ctrl2 = React__default.useMemo(() => new Controller(handlers2), []);
|
|
128788
|
+
ctrl2.applyHandlers(handlers2, nativeHandlers);
|
|
128789
|
+
ctrl2.applyConfig(config, gestureKey);
|
|
128790
|
+
React__default.useEffect(ctrl2.effect.bind(ctrl2));
|
|
129255
128791
|
React__default.useEffect(() => {
|
|
129256
|
-
return
|
|
128792
|
+
return ctrl2.clean.bind(ctrl2);
|
|
129257
128793
|
}, []);
|
|
129258
128794
|
if (config.target === void 0) {
|
|
129259
|
-
return
|
|
128795
|
+
return ctrl2.bind.bind(ctrl2);
|
|
129260
128796
|
}
|
|
129261
128797
|
return void 0;
|
|
129262
128798
|
}
|
|
@@ -129415,7 +128951,7 @@ const _UncontrolledSliderWithPlusMinusBtns = class _UncontrolledSliderWithPlusMi
|
|
|
129415
128951
|
return fn4({
|
|
129416
128952
|
value: valToPass,
|
|
129417
128953
|
changeValue: /* @__PURE__ */ __name((newVal2) => {
|
|
129418
|
-
const newnew = clamp$
|
|
128954
|
+
const newnew = clamp$4(newVal2, min2, max2);
|
|
129419
128955
|
this.setState({ value: newnew });
|
|
129420
128956
|
this.props.onChange && this.props.onChange(newnew);
|
|
129421
128957
|
this.props.onRelease && this.props.onRelease(newnew);
|
|
@@ -131945,7 +131481,7 @@ function Labels({
|
|
|
131945
131481
|
const radius = outerRadius;
|
|
131946
131482
|
const outerPointRadius = outerRadius - 20;
|
|
131947
131483
|
const fontWidth = labelSize2 * (textScalingFactor < 1 ? textScalingFactor : 1);
|
|
131948
|
-
const fontHeight = fontWidth * clamp$
|
|
131484
|
+
const fontHeight = fontWidth * clamp$4(fontHeightMultiplier, 1.5, 3.5);
|
|
131949
131485
|
const labelPoints = labels.map(function(label) {
|
|
131950
131486
|
const {
|
|
131951
131487
|
annotationCenterAngle: _annotationCenterAngle,
|
|
@@ -143138,7 +142674,7 @@ const _AlignmentTool = class _AlignmentTool extends React__default.Component {
|
|
|
143138
142674
|
seqsToAlign = addedSequencesToUse;
|
|
143139
142675
|
}
|
|
143140
142676
|
hideModal();
|
|
143141
|
-
const alignmentId =
|
|
142677
|
+
const alignmentId = nanoid();
|
|
143142
142678
|
createNewAlignment2({
|
|
143143
142679
|
id: alignmentId,
|
|
143144
142680
|
name: seqsToAlign[0].name + " Alignment"
|
|
@@ -143457,7 +142993,7 @@ const _MergeFeaturesDialog = class _MergeFeaturesDialog extends React__default.C
|
|
|
143457
142993
|
}
|
|
143458
142994
|
upsertFeature2(
|
|
143459
142995
|
__spreadProps(__spreadValues({}, feat1), {
|
|
143460
|
-
id:
|
|
142996
|
+
id: nanoid(),
|
|
143461
142997
|
start: start2 - 1,
|
|
143462
142998
|
end: end2 - 1,
|
|
143463
142999
|
name: name2
|