UNPKG

css-to-mat

Version:
954 lines (891 loc) 29.9 kB
/* Copyright (c) 2019 Daybrush name: css-to-mat license: MIT author: Daybrush repository: git+https://github.com/daybrush/css-to-mat.git version: 1.1.0 */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.CssToMatrix = factory()); })(this, (function () { 'use strict'; /****************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ /* global Reflect, Promise */ var __assign = function() { __assign = Object.assign || function __assign(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; /* Copyright (c) 2018 Daybrush @name: @daybrush/utils license: MIT author: Daybrush repository: https://github.com/daybrush/utils @version 1.13.0 */ /** * @namespace * @name Consts */ /** * get string "rgb" * @memberof Color * @example import {RGB} from "@daybrush/utils"; console.log(RGB); // "rgb" */ /** * get string "function" * @memberof Consts * @example import {FUNCTION} from "@daybrush/utils"; console.log(FUNCTION); // "function" */ var FUNCTION = "function"; /** * get string "object" * @memberof Consts * @example import {OBJECT} from "@daybrush/utils"; console.log(OBJECT); // "object" */ var OBJECT = "object"; /** * get string "string" * @memberof Consts * @example import {STRING} from "@daybrush/utils"; console.log(STRING); // "string" */ var STRING = "string"; var OPEN_CLOSED_CHARACTERS = [{ open: "(", close: ")" }, { open: "\"", close: "\"" }, { open: "'", close: "'" }, { open: "\\\"", close: "\\\"" }, { open: "\\'", close: "\\'" }]; var TINY_NUM = 0.0000001; var DEFAULT_UNIT_PRESETS = { "cm": function (pos) { return pos * 96 / 2.54; }, "mm": function (pos) { return pos * 96 / 254; }, "in": function (pos) { return pos * 96; }, "pt": function (pos) { return pos * 96 / 72; }, "pc": function (pos) { return pos * 96 / 6; }, "%": function (pos, size) { return pos * size / 100; }, "vw": function (pos, size) { if (size === void 0) { size = window.innerWidth; } return pos / 100 * size; }, "vh": function (pos, size) { if (size === void 0) { size = window.innerHeight; } return pos / 100 * size; }, "vmax": function (pos, size) { if (size === void 0) { size = Math.max(window.innerWidth, window.innerHeight); } return pos / 100 * size; }, "vmin": function (pos, size) { if (size === void 0) { size = Math.min(window.innerWidth, window.innerHeight); } return pos / 100 * size; } }; /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ function __spreadArrays() { for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j]; return r; } /** * Check the type that the value is object. * @memberof Utils * @param {string} value - Value to check the type * @return {} true if the type is correct, false otherwise * @example import {isObject} from "@daybrush/utils"; console.log(isObject({})); // true console.log(isObject(undefined)); // false console.log(isObject("")); // false console.log(isObject(null)); // false */ function isObject(value) { return value && typeof value === OBJECT; } /** * Check the type that the value is isArray. * @memberof Utils * @param {string} value - Value to check the type * @return {} true if the type is correct, false otherwise * @example import {isArray} from "@daybrush/utils"; console.log(isArray([])); // true console.log(isArray({})); // false console.log(isArray(undefined)); // false console.log(isArray(null)); // false */ function isArray(value) { return Array.isArray(value); } /** * Check the type that the value is string. * @memberof Utils * @param {string} value - Value to check the type * @return {} true if the type is correct, false otherwise * @example import {isString} from "@daybrush/utils"; console.log(isString("1234")); // true console.log(isString(undefined)); // false console.log(isString(1)); // false console.log(isString(null)); // false */ function isString(value) { return typeof value === STRING; } /** * Check the type that the value is function. * @memberof Utils * @param {string} value - Value to check the type * @return {} true if the type is correct, false otherwise * @example import {isFunction} from "@daybrush/utils"; console.log(isFunction(function a() {})); // true console.log(isFunction(() => {})); // true console.log(isFunction("1234")); // false console.log(isFunction(1)); // false console.log(isFunction(null)); // false */ function isFunction(value) { return typeof value === FUNCTION; } function isEqualSeparator(character, separator) { var isCharacterSpace = character === "" || character == " "; var isSeparatorSpace = separator === "" || separator == " "; return isSeparatorSpace && isCharacterSpace || character === separator; } function findOpen(openCharacter, texts, index, length, openCloseCharacters) { var isIgnore = findIgnore(openCharacter, texts, index); if (!isIgnore) { return findClose(openCharacter, texts, index + 1, length, openCloseCharacters); } return index; } function findIgnore(character, texts, index) { if (!character.ignore) { return null; } var otherText = texts.slice(Math.max(index - 3, 0), index + 3).join(""); return new RegExp(character.ignore).exec(otherText); } function findClose(closeCharacter, texts, index, length, openCloseCharacters) { var _loop_1 = function (i) { var character = texts[i].trim(); if (character === closeCharacter.close && !findIgnore(closeCharacter, texts, i)) { return { value: i }; } var nextIndex = i; // re open var openCharacter = find(openCloseCharacters, function (_a) { var open = _a.open; return open === character; }); if (openCharacter) { nextIndex = findOpen(openCharacter, texts, i, length, openCloseCharacters); } if (nextIndex === -1) { return out_i_1 = i, "break"; } i = nextIndex; out_i_1 = i; }; var out_i_1; for (var i = index; i < length; ++i) { var state_1 = _loop_1(i); i = out_i_1; if (typeof state_1 === "object") return state_1.value; if (state_1 === "break") break; } return -1; } function splitText(text, splitOptions) { var _a = isString(splitOptions) ? { separator: splitOptions } : splitOptions, _b = _a.separator, separator = _b === void 0 ? "," : _b, isSeparateFirst = _a.isSeparateFirst, isSeparateOnlyOpenClose = _a.isSeparateOnlyOpenClose, _c = _a.isSeparateOpenClose, isSeparateOpenClose = _c === void 0 ? isSeparateOnlyOpenClose : _c, _d = _a.openCloseCharacters, openCloseCharacters = _d === void 0 ? OPEN_CLOSED_CHARACTERS : _d; var openClosedText = openCloseCharacters.map(function (_a) { var open = _a.open, close = _a.close; if (open === close) { return open; } return open + "|" + close; }).join("|"); var regexText = "(\\s*" + separator + "\\s*|" + openClosedText + "|\\s+)"; var regex = new RegExp(regexText, "g"); var texts = text.split(regex).filter(function (chr) { return chr && chr !== "undefined"; }); var length = texts.length; var values = []; var tempValues = []; function resetTemp() { if (tempValues.length) { values.push(tempValues.join("")); tempValues = []; return true; } return false; } var _loop_2 = function (i) { var character = texts[i].trim(); var nextIndex = i; var openCharacter = find(openCloseCharacters, function (_a) { var open = _a.open; return open === character; }); var closeCharacter = find(openCloseCharacters, function (_a) { var close = _a.close; return close === character; }); if (openCharacter) { nextIndex = findOpen(openCharacter, texts, i, length, openCloseCharacters); if (nextIndex !== -1 && isSeparateOpenClose) { if (resetTemp() && isSeparateFirst) { return out_i_2 = i, "break"; } values.push(texts.slice(i, nextIndex + 1).join("")); i = nextIndex; if (isSeparateFirst) { return out_i_2 = i, "break"; } return out_i_2 = i, "continue"; } } else if (closeCharacter && !findIgnore(closeCharacter, texts, i)) { var nextOpenCloseCharacters = __spreadArrays(openCloseCharacters); nextOpenCloseCharacters.splice(openCloseCharacters.indexOf(closeCharacter), 1); return { value: splitText(text, { separator: separator, isSeparateFirst: isSeparateFirst, isSeparateOnlyOpenClose: isSeparateOnlyOpenClose, isSeparateOpenClose: isSeparateOpenClose, openCloseCharacters: nextOpenCloseCharacters }) }; } else if (isEqualSeparator(character, separator) && !isSeparateOnlyOpenClose) { resetTemp(); if (isSeparateFirst) { return out_i_2 = i, "break"; } return out_i_2 = i, "continue"; } if (nextIndex === -1) { nextIndex = length - 1; } tempValues.push(texts.slice(i, nextIndex + 1).join("")); i = nextIndex; out_i_2 = i; }; var out_i_2; for (var i = 0; i < length; ++i) { var state_2 = _loop_2(i); i = out_i_2; if (typeof state_2 === "object") return state_2.value; if (state_2 === "break") break; } if (tempValues.length) { values.push(tempValues.join("")); } return values; } /** * divide text by space. * @memberof Utils * @param {string} text - text to divide * @return {Array} divided texts * @example import {spliceSpace} from "@daybrush/utils"; console.log(splitSpace("a b c d e f g")); // ["a", "b", "c", "d", "e", "f", "g"] console.log(splitSpace("'a,b' c 'd,e' f g")); // ["'a,b'", "c", "'d,e'", "f", "g"] */ function splitSpace(text) { // divide comma(space) return splitText(text, ""); } /** * divide text by comma. * @memberof Utils * @param {string} text - text to divide * @return {Array} divided texts * @example import {splitComma} from "@daybrush/utils"; console.log(splitComma("a,b,c,d,e,f,g")); // ["a", "b", "c", "d", "e", "f", "g"] console.log(splitComma("'a,b',c,'d,e',f,g")); // ["'a,b'", "c", "'d,e'", "f", "g"] */ function splitComma(text) { // divide comma(,) // "[^"]*"|'[^']*' return splitText(text, ","); } /** * divide text by bracket "(", ")". * @memberof Utils * @param {string} text - text to divide * @return {object} divided texts * @example import {splitBracket} from "@daybrush/utils"; console.log(splitBracket("a(1, 2)")); // {prefix: "a", value: "1, 2", suffix: ""} console.log(splitBracket("a(1, 2)b")); // {prefix: "a", value: "1, 2", suffix: "b"} */ function splitBracket(text) { var matches = /([^(]*)\(([\s\S]*)\)([\s\S]*)/g.exec(text); if (!matches || matches.length < 4) { return {}; } else { return { prefix: matches[1], value: matches[2], suffix: matches[3] }; } } /** * divide text by number and unit. * @memberof Utils * @param {string} text - text to divide * @return {} divided texts * @example import {splitUnit} from "@daybrush/utils"; console.log(splitUnit("10px")); // {prefix: "", value: 10, unit: "px"} console.log(splitUnit("-10px")); // {prefix: "", value: -10, unit: "px"} console.log(splitUnit("a10%")); // {prefix: "a", value: 10, unit: "%"} */ function splitUnit(text) { var matches = /^([^\d|e|\-|\+]*)((?:\d|\.|-|e-|e\+)+)(\S*)$/g.exec(text); if (!matches) { return { prefix: "", unit: "", value: NaN }; } var prefix = matches[1]; var value = matches[2]; var unit = matches[3]; return { prefix: prefix, unit: unit, value: parseFloat(value) }; } /** * Returns the index of the first element in the array that satisfies the provided testing function. * @function * @memberof CrossBrowser * @param - The array `findIndex` was called upon. * @param - A function to execute on each value in the array until the function returns true, indicating that the satisfying element was found. * @param - Returns defaultIndex if not found by the function. * @example import { findIndex } from "@daybrush/utils"; findIndex([{a: 1}, {a: 2}, {a: 3}, {a: 4}], ({ a }) => a === 2); // 1 */ function findIndex(arr, callback, defaultIndex) { if (defaultIndex === void 0) { defaultIndex = -1; } var length = arr.length; for (var i = 0; i < length; ++i) { if (callback(arr[i], i, arr)) { return i; } } return defaultIndex; } /** * Returns the value of the first element in the array that satisfies the provided testing function. * @function * @memberof CrossBrowser * @param - The array `find` was called upon. * @param - A function to execute on each value in the array, * @param - Returns defalutValue if not found by the function. * @example import { find } from "@daybrush/utils"; find([{a: 1}, {a: 2}, {a: 3}, {a: 4}], ({ a }) => a === 2); // {a: 2} */ function find(arr, callback, defalutValue) { var index = findIndex(arr, callback); return index > -1 ? arr[index] : defalutValue; } /** * convert unit size to px size * @function * @memberof Utils */ function convertUnitSize(pos, size) { var _a = splitUnit(pos), value = _a.value, unit = _a.unit; if (isObject(size)) { var sizeFunction = size[unit]; if (sizeFunction) { if (isFunction(sizeFunction)) { return sizeFunction(value); } else if (DEFAULT_UNIT_PRESETS[unit]) { return DEFAULT_UNIT_PRESETS[unit](value, sizeFunction); } } } else if (unit === "%") { return value * size / 100; } if (DEFAULT_UNIT_PRESETS[unit]) { return DEFAULT_UNIT_PRESETS[unit](value); } return value; } /** * throttle number depending on the unit. * @function * @memberof Utils */ function throttle(num, unit) { if (!unit) { return num; } var reverseUnit = 1 / unit; return Math.round(num / unit) / reverseUnit; } /* Copyright (c) 2020 Daybrush name: @scena/matrix license: MIT author: Daybrush repository: git+https://github.com/daybrush/matrix version: 1.1.1 */ function add(matrix, inverseMatrix, startIndex, fromIndex, n, k) { for (var i = 0; i < n; ++i) { var x = startIndex + i * n; var fromX = fromIndex + i * n; matrix[x] += matrix[fromX] * k; inverseMatrix[x] += inverseMatrix[fromX] * k; } } function swap(matrix, inverseMatrix, startIndex, fromIndex, n) { for (var i = 0; i < n; ++i) { var x = startIndex + i * n; var fromX = fromIndex + i * n; var v = matrix[x]; var iv = inverseMatrix[x]; matrix[x] = matrix[fromX]; matrix[fromX] = v; inverseMatrix[x] = inverseMatrix[fromX]; inverseMatrix[fromX] = iv; } } function divide(matrix, inverseMatrix, startIndex, n, k) { for (var i = 0; i < n; ++i) { var x = startIndex + i * n; matrix[x] /= k; inverseMatrix[x] /= k; } } /** * @memberof Matrix */ function invert(matrix, n) { if (n === void 0) { n = Math.sqrt(matrix.length); } var newMatrix = matrix.slice(); var inverseMatrix = createIdentityMatrix(n); for (var i = 0; i < n; ++i) { // diagonal var identityIndex = n * i + i; if (!throttle(newMatrix[identityIndex], TINY_NUM)) { // newMatrix[identityIndex] = 0; for (var j = i + 1; j < n; ++j) { if (newMatrix[n * i + j]) { swap(newMatrix, inverseMatrix, i, j, n); break; } } } if (!throttle(newMatrix[identityIndex], TINY_NUM)) { // no inverse matrix return []; } divide(newMatrix, inverseMatrix, i, n, newMatrix[identityIndex]); for (var j = 0; j < n; ++j) { var targetStartIndex = j; var targetIndex = j + i * n; var target = newMatrix[targetIndex]; if (!throttle(target, TINY_NUM) || i === j) { continue; } add(newMatrix, inverseMatrix, targetStartIndex, i, n, -target); } } return inverseMatrix; } /** * @memberof Matrix */ function multiply(matrix, matrix2, n) { if (n === void 0) { n = Math.sqrt(matrix.length); } var newMatrix = []; // 1 y: n // 1 x: m // 2 x: m // 2 y: k // n * m X m * k var m = matrix.length / n; var k = matrix2.length / m; if (!m) { return matrix2; } else if (!k) { return matrix; } for (var i = 0; i < n; ++i) { for (var j = 0; j < k; ++j) { newMatrix[j * n + i] = 0; for (var l = 0; l < m; ++l) { // m1 x: m(l), y: n(i) // m2 x: k(j): y: m(l) // nw x: n(i), y: k(j) newMatrix[j * n + i] += matrix[l * n + i] * matrix2[j * m + l]; } } } // n * k return newMatrix; } /** * @memberof Matrix */ function calculate(matrix, matrix2, n) { if (n === void 0) { n = matrix2.length; } var result = multiply(matrix, matrix2, n); var k = result[n - 1]; return result.map(function (v) { return v / k; }); } /** * @memberof Matrix */ function rotateX3d(matrix, rad) { return multiply(matrix, [1, 0, 0, 0, 0, Math.cos(rad), Math.sin(rad), 0, 0, -Math.sin(rad), Math.cos(rad), 0, 0, 0, 0, 1], 4); } /** * @memberof Matrix */ function rotateY3d(matrix, rad) { return multiply(matrix, [Math.cos(rad), 0, -Math.sin(rad), 0, 0, 1, 0, 0, Math.sin(rad), 0, Math.cos(rad), 0, 0, 0, 0, 1], 4); } /** * @memberof Matrix */ function rotateZ3d(matrix, rad) { return multiply(matrix, createRotateMatrix(rad, 4)); } /** * @memberof Matrix */ function scale3d(matrix, _a) { var _b = _a[0], sx = _b === void 0 ? 1 : _b, _c = _a[1], sy = _c === void 0 ? 1 : _c, _d = _a[2], sz = _d === void 0 ? 1 : _d; return multiply(matrix, [sx, 0, 0, 0, 0, sy, 0, 0, 0, 0, sz, 0, 0, 0, 0, 1], 4); } /** * @memberof Matrix */ function translate3d(matrix, _a) { var _b = _a[0], tx = _b === void 0 ? 0 : _b, _c = _a[1], ty = _c === void 0 ? 0 : _c, _d = _a[2], tz = _d === void 0 ? 0 : _d; return multiply(matrix, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, tx, ty, tz, 1], 4); } /** * @memberof Matrix */ function matrix3d(matrix1, matrix2) { return multiply(matrix1, matrix2, 4); } /** * @memberof Matrix */ function createRotateMatrix(rad, n) { var cos = Math.cos(rad); var sin = Math.sin(rad); var m = createIdentityMatrix(n); // cos -sin // sin cos m[0] = cos; m[1] = sin; m[n] = -sin; m[n + 1] = cos; return m; } /** * @memberof Matrix */ function createIdentityMatrix(n) { var length = n * n; var matrix = []; for (var i = 0; i < length; ++i) { matrix[i] = i % (n + 1) ? 0 : 1; } return matrix; } function createMatrix() { return [ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, ]; } function parseMat(transform, size) { if (size === void 0) { size = 0; } return toMat(parse(transform, size)); } function getElementMatrix(el) { return parseMat(getComputedStyle(el).transform); } function calculateMatrixDist(matrix, pos) { var res = calculate(matrix, [pos[0], pos[1] || 0, pos[2] || 0, 1], 4); var w = res[3] || 1; return [ res[0] / w, res[1] / w, res[2] / w, ]; } function getDistElementMatrix(el, container) { if (container === void 0) { container = document.body; } var target = el; var matrix = createMatrix(); while (target) { var transform = getComputedStyle(target).transform; matrix = matrix3d(parseMat(transform), matrix); if (target === container) { break; } target = target.parentElement; } matrix = invert(matrix, 4); matrix[12] = 0; matrix[13] = 0; matrix[14] = 0; return matrix; } function toMat(matrixInfos) { var target = createMatrix(); matrixInfos.forEach(function (info) { var matrixFunction = info.matrixFunction, functionValue = info.functionValue; if (!matrixFunction) { return; } target = matrixFunction(target, functionValue); }); return target; } function parse(transform, size) { if (size === void 0) { size = 0; } var transforms = isArray(transform) ? transform : splitSpace(transform); return transforms.map(function (t) { var _a = splitBracket(t), name = _a.prefix, value = _a.value; var matrixFunction = null; var functionName = name; var functionValue = ""; if (name === "translate" || name === "translateX" || name === "translate3d") { var nextSize_1 = isObject(size) ? __assign(__assign({}, size), { "o%": size["%"] }) : { "%": size, "o%": size, }; var _b = splitComma(value).map(function (v, i) { if (i === 0 && "x%" in nextSize_1) { nextSize_1["%"] = size["x%"]; } else if (i === 1 && "y%" in nextSize_1) { nextSize_1["%"] = size["y%"]; } else { nextSize_1["%"] = size["o%"]; } return convertUnitSize(v, nextSize_1); }), posX = _b[0], _c = _b[1], posY = _c === void 0 ? 0 : _c, _d = _b[2], posZ = _d === void 0 ? 0 : _d; matrixFunction = translate3d; functionValue = [posX, posY, posZ]; } else if (name === "translateY") { var nextSize = isObject(size) ? __assign({ "%": size["y%"] }, size) : { "%": size, }; var posY = convertUnitSize(value, nextSize); matrixFunction = translate3d; functionValue = [0, posY, 0]; } else if (name === "translateZ") { var posZ = parseFloat(value); matrixFunction = translate3d; functionValue = [0, 0, posZ]; } else if (name === "scale" || name === "scale3d") { var _e = splitComma(value).map(function (v) { return parseFloat(v); }), sx = _e[0], _f = _e[1], sy = _f === void 0 ? sx : _f, _g = _e[2], sz = _g === void 0 ? 1 : _g; matrixFunction = scale3d; functionValue = [sx, sy, sz]; } else if (name === "scaleX") { var sx = parseFloat(value); matrixFunction = scale3d; functionValue = [sx, 1, 1]; } else if (name === "scaleY") { var sy = parseFloat(value); matrixFunction = scale3d; functionValue = [1, sy, 1]; } else if (name === "scaleZ") { var sz = parseFloat(value); matrixFunction = scale3d; functionValue = [1, 1, sz]; } else if (name === "rotate" || name === "rotateZ" || name === "rotateX" || name === "rotateY") { var _h = splitUnit(value), unit = _h.unit, unitValue = _h.value; var rad = unit === "rad" ? unitValue : unitValue * Math.PI / 180; if (name === "rotate" || name === "rotateZ") { functionName = "rotateZ"; matrixFunction = rotateZ3d; } else if (name === "rotateX") { matrixFunction = rotateX3d; } else if (name === "rotateY") { matrixFunction = rotateY3d; } functionValue = rad; } else if (name === "matrix3d") { matrixFunction = matrix3d; functionValue = splitComma(value).map(function (v) { return parseFloat(v); }); } else if (name === "matrix") { var m = splitComma(value).map(function (v) { return parseFloat(v); }); matrixFunction = matrix3d; functionValue = [ m[0], m[1], 0, 0, m[2], m[3], 0, 0, 0, 0, 1, 0, m[4], m[5], 0, 1, ]; } else { functionName = ""; } return { name: name, functionName: functionName, value: value, matrixFunction: matrixFunction, functionValue: functionValue, }; }); } var others = { __proto__: null, calculateMatrixDist: calculateMatrixDist, createMatrix: createMatrix, getDistElementMatrix: getDistElementMatrix, getElementMatrix: getElementMatrix, parse: parse, parseMat: parseMat, toMat: toMat }; return others; })); //# sourceMappingURL=css-to-mat.js.map