From 2b07946b6bc89f89540d0e67159e4a0b19d07574 Mon Sep 17 00:00:00 2001 From: Brett Zamir Date: Tue, 24 Mar 2020 10:04:15 +0800 Subject: [PATCH] - Build: Update per latest Rollup - npm: Update devDeps --- dist/canvg.js | 251 ++++-- dist/extensions/ext-arrows.js | 31 +- dist/extensions/ext-closepath.js | 11 +- dist/extensions/ext-connector.js | 16 +- dist/extensions/ext-eyedropper.js | 2 +- dist/extensions/ext-foreignobject.js | 10 +- dist/extensions/ext-grid.js | 17 +- dist/extensions/ext-helloworld.js | 37 +- dist/extensions/ext-imagelib.js | 37 +- dist/extensions/ext-markers.js | 30 +- dist/extensions/ext-mathjax.js | 13 +- dist/extensions/ext-panning.js | 10 +- dist/extensions/ext-placemark.js | 48 +- dist/extensions/ext-polygon.js | 8 +- dist/extensions/ext-server_moinsave.js | 267 ++++-- dist/extensions/ext-server_opensave.js | 276 ++++-- dist/extensions/ext-shapes.js | 43 +- dist/extensions/ext-star.js | 4 +- dist/extensions/ext-storage.js | 70 +- dist/extensions/ext-webappfind.js | 11 +- dist/extensions/ext-xdomain-messaging.js | 29 +- dist/extensions/imagelib/openclipart.js | 69 +- dist/index-es.js | 663 +++++++------- dist/index-es.min.js | 32 +- dist/index-es.min.js.map | 2 +- dist/index-umd.js | 663 +++++++------- dist/index-umd.min.js | 32 +- dist/index-umd.min.js.map | 2 +- dist/jspdf.plugin.svgToPdf.js | 38 +- dist/redirect-on-lacking-support.js | 106 ++- dist/svgcanvas-iife.js | 358 +++++--- dist/svgcanvas-iife.min.js | 8 +- dist/svgcanvas-iife.min.js.map | 2 +- editor/xdomain-svgedit-config-iife.js | 670 +++++++------- package-lock.json | 1026 ++++++++++++---------- package.json | 26 +- svgedit-config-iife.js | 670 +++++++------- 37 files changed, 3247 insertions(+), 2341 deletions(-) diff --git a/dist/canvg.js b/dist/canvg.js index d68ac120..de0ad515 100644 --- a/dist/canvg.js +++ b/dist/canvg.js @@ -106,7 +106,7 @@ var canvg = (function (exports) { return _setPrototypeOf(o, p); } - function isNativeReflectConstruct() { + function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; @@ -120,7 +120,7 @@ var canvg = (function (exports) { } function _construct(Parent, args, Class) { - if (isNativeReflectConstruct()) { + if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { @@ -152,6 +152,23 @@ var canvg = (function (exports) { return _assertThisInitialized(self); } + function _createSuper(Derived) { + return function () { + var Super = _getPrototypeOf(Derived), + result; + + if (_isNativeReflectConstruct()) { + var NewTarget = _getPrototypeOf(this).constructor; + + result = Reflect.construct(Super, arguments, NewTarget); + } else { + result = Super.apply(this, arguments); + } + + return _possibleConstructorReturn(this, result); + }; + } + function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); @@ -183,19 +200,15 @@ var canvg = (function (exports) { } function _slicedToArray(arr, i) { - return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); + return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _toConsumableArray(arr) { - return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) { - for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; - - return arr2; - } + if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _arrayWithHoles(arr) { @@ -203,14 +216,11 @@ var canvg = (function (exports) { } function _iterableToArray(iter) { - if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); + if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); } function _iterableToArrayLimit(arr, i) { - if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { - return; - } - + if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; @@ -236,12 +246,29 @@ var canvg = (function (exports) { return _arr; } + function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(n); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); + } + + function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; + + return arr2; + } + function _nonIterableSpread() { - throw new TypeError("Invalid attempt to spread non-iterable instance"); + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _nonIterableRest() { - throw new TypeError("Invalid attempt to destructure non-iterable instance"); + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } /** @@ -1658,12 +1685,14 @@ var canvg = (function (exports) { SkewBase: /*#__PURE__*/function (_this$Type$matrix) { _inherits(SkewBase, _this$Type$matrix); + var _super = _createSuper(SkewBase); + function SkewBase(s) { var _this3; _classCallCheck(this, SkewBase); - _this3 = _possibleConstructorReturn(this, _getPrototypeOf(SkewBase).call(this, s)); + _this3 = _super.call(this, s); _this3.angle = new svg.Property('angle', s); return _this3; } @@ -1675,12 +1704,14 @@ var canvg = (function (exports) { skewX: /*#__PURE__*/function (_this$Type$SkewBase) { _inherits(skewX, _this$Type$SkewBase); + var _super2 = _createSuper(skewX); + function skewX(s) { var _this4; _classCallCheck(this, skewX); - _this4 = _possibleConstructorReturn(this, _getPrototypeOf(skewX).call(this, s)); + _this4 = _super2.call(this, s); _this4.m = [1, 0, Math.tan(_this4.angle.toRadians()), 1, 0, 0]; return _this4; } @@ -1690,12 +1721,14 @@ var canvg = (function (exports) { skewY: /*#__PURE__*/function (_this$Type$SkewBase2) { _inherits(skewY, _this$Type$SkewBase2); + var _super3 = _createSuper(skewY); + function skewY(s) { var _this5; _classCallCheck(this, skewY); - _this5 = _possibleConstructorReturn(this, _getPrototypeOf(skewY).call(this, s)); + _this5 = _super3.call(this, s); _this5.m = [1, Math.tan(_this5.angle.toRadians()), 0, 1, 0, 0]; return _this5; } @@ -2029,10 +2062,12 @@ var canvg = (function (exports) { svg.Element.RenderedElementBase = /*#__PURE__*/function (_svg$Element$ElementB) { _inherits(_class5, _svg$Element$ElementB); + var _super4 = _createSuper(_class5); + function _class5() { _classCallCheck(this, _class5); - return _possibleConstructorReturn(this, _getPrototypeOf(_class5).apply(this, arguments)); + return _super4.apply(this, arguments); } _createClass(_class5, [{ @@ -2134,10 +2169,12 @@ var canvg = (function (exports) { svg.Element.PathElementBase = /*#__PURE__*/function (_svg$Element$Rendered) { _inherits(_class6, _svg$Element$Rendered); + var _super5 = _createSuper(_class6); + function _class6() { _classCallCheck(this, _class6); - return _possibleConstructorReturn(this, _getPrototypeOf(_class6).apply(this, arguments)); + return _super5.apply(this, arguments); } _createClass(_class6, [{ @@ -2203,10 +2240,12 @@ var canvg = (function (exports) { svg.Element.svg = /*#__PURE__*/function (_svg$Element$Rendered2) { _inherits(_class7, _svg$Element$Rendered2); + var _super6 = _createSuper(_class7); + function _class7() { _classCallCheck(this, _class7); - return _possibleConstructorReturn(this, _getPrototypeOf(_class7).apply(this, arguments)); + return _super6.apply(this, arguments); } _createClass(_class7, [{ @@ -2284,10 +2323,12 @@ var canvg = (function (exports) { svg.Element.rect = /*#__PURE__*/function (_svg$Element$PathElem) { _inherits(_class8, _svg$Element$PathElem); + var _super7 = _createSuper(_class8); + function _class8() { _classCallCheck(this, _class8); - return _possibleConstructorReturn(this, _getPrototypeOf(_class8).apply(this, arguments)); + return _super7.apply(this, arguments); } _createClass(_class8, [{ @@ -2329,10 +2370,12 @@ var canvg = (function (exports) { svg.Element.circle = /*#__PURE__*/function (_svg$Element$PathElem2) { _inherits(_class9, _svg$Element$PathElem2); + var _super8 = _createSuper(_class9); + function _class9() { _classCallCheck(this, _class9); - return _possibleConstructorReturn(this, _getPrototypeOf(_class9).apply(this, arguments)); + return _super8.apply(this, arguments); } _createClass(_class9, [{ @@ -2361,10 +2404,12 @@ var canvg = (function (exports) { svg.Element.ellipse = /*#__PURE__*/function (_svg$Element$PathElem3) { _inherits(_class10, _svg$Element$PathElem3); + var _super9 = _createSuper(_class10); + function _class10() { _classCallCheck(this, _class10); - return _possibleConstructorReturn(this, _getPrototypeOf(_class10).apply(this, arguments)); + return _super9.apply(this, arguments); } _createClass(_class10, [{ @@ -2396,10 +2441,12 @@ var canvg = (function (exports) { svg.Element.line = /*#__PURE__*/function (_svg$Element$PathElem4) { _inherits(_class11, _svg$Element$PathElem4); + var _super10 = _createSuper(_class11); + function _class11() { _classCallCheck(this, _class11); - return _possibleConstructorReturn(this, _getPrototypeOf(_class11).apply(this, arguments)); + return _super10.apply(this, arguments); } _createClass(_class11, [{ @@ -2436,12 +2483,14 @@ var canvg = (function (exports) { svg.Element.polyline = /*#__PURE__*/function (_svg$Element$PathElem5) { _inherits(_class12, _svg$Element$PathElem5); + var _super11 = _createSuper(_class12); + function _class12(node) { var _this8; _classCallCheck(this, _class12); - _this8 = _possibleConstructorReturn(this, _getPrototypeOf(_class12).call(this, node)); + _this8 = _super11.call(this, node); _this8.points = svg.CreatePath(_this8.attribute('points').value); return _this8; } @@ -2490,10 +2539,12 @@ var canvg = (function (exports) { svg.Element.polygon = /*#__PURE__*/function (_svg$Element$polyline) { _inherits(_class13, _svg$Element$polyline); + var _super12 = _createSuper(_class13); + function _class13() { _classCallCheck(this, _class13); - return _possibleConstructorReturn(this, _getPrototypeOf(_class13).apply(this, arguments)); + return _super12.apply(this, arguments); } _createClass(_class13, [{ @@ -2517,12 +2568,14 @@ var canvg = (function (exports) { svg.Element.path = /*#__PURE__*/function (_svg$Element$PathElem6) { _inherits(_class14, _svg$Element$PathElem6); + var _super13 = _createSuper(_class14); + function _class14(node) { var _this9; _classCallCheck(this, _class14); - _this9 = _possibleConstructorReturn(this, _getPrototypeOf(_class14).call(this, node)); + _this9 = _super13.call(this, node); var d = _this9.attribute('d').value // TODO: convert to real lexer based on https://www.w3.org/TR/SVG11/paths.html#PathDataBNF .replace(/,/gm, ' ') // get rid of all commas @@ -2894,10 +2947,12 @@ var canvg = (function (exports) { svg.Element.pattern = /*#__PURE__*/function (_svg$Element$ElementB2) { _inherits(_class15, _svg$Element$ElementB2); + var _super14 = _createSuper(_class15); + function _class15() { _classCallCheck(this, _class15); - return _possibleConstructorReturn(this, _getPrototypeOf(_class15).apply(this, arguments)); + return _super14.apply(this, arguments); } _createClass(_class15, [{ @@ -2943,10 +2998,12 @@ var canvg = (function (exports) { svg.Element.marker = /*#__PURE__*/function (_svg$Element$ElementB3) { _inherits(_class16, _svg$Element$ElementB3); + var _super15 = _createSuper(_class16); + function _class16() { _classCallCheck(this, _class16); - return _possibleConstructorReturn(this, _getPrototypeOf(_class16).apply(this, arguments)); + return _super15.apply(this, arguments); } _createClass(_class16, [{ @@ -2981,10 +3038,12 @@ var canvg = (function (exports) { svg.Element.defs = /*#__PURE__*/function (_svg$Element$ElementB4) { _inherits(_class17, _svg$Element$ElementB4); + var _super16 = _createSuper(_class17); + function _class17() { _classCallCheck(this, _class17); - return _possibleConstructorReturn(this, _getPrototypeOf(_class17).apply(this, arguments)); + return _super16.apply(this, arguments); } _createClass(_class17, [{ @@ -3000,12 +3059,14 @@ var canvg = (function (exports) { svg.Element.GradientBase = /*#__PURE__*/function (_svg$Element$ElementB5) { _inherits(_class18, _svg$Element$ElementB5); + var _super17 = _createSuper(_class18); + function _class18(node) { var _this10; _classCallCheck(this, _class18); - _this10 = _possibleConstructorReturn(this, _getPrototypeOf(_class18).call(this, node)); + _this10 = _super17.call(this, node); _this10.gradientUnits = _this10.attribute('gradientUnits').valueOrDefault('objectBoundingBox'); _this10.stops = []; @@ -3081,10 +3142,12 @@ var canvg = (function (exports) { svg.Element.linearGradient = /*#__PURE__*/function (_svg$Element$Gradient) { _inherits(_class19, _svg$Element$Gradient); + var _super18 = _createSuper(_class19); + function _class19() { _classCallCheck(this, _class19); - return _possibleConstructorReturn(this, _getPrototypeOf(_class19).apply(this, arguments)); + return _super18.apply(this, arguments); } _createClass(_class19, [{ @@ -3116,10 +3179,12 @@ var canvg = (function (exports) { svg.Element.radialGradient = /*#__PURE__*/function (_svg$Element$Gradient2) { _inherits(_class20, _svg$Element$Gradient2); + var _super19 = _createSuper(_class20); + function _class20() { _classCallCheck(this, _class20); - return _possibleConstructorReturn(this, _getPrototypeOf(_class20).apply(this, arguments)); + return _super19.apply(this, arguments); } _createClass(_class20, [{ @@ -3155,12 +3220,14 @@ var canvg = (function (exports) { svg.Element.stop = /*#__PURE__*/function (_svg$Element$ElementB6) { _inherits(_class21, _svg$Element$ElementB6); + var _super20 = _createSuper(_class21); + function _class21(node) { var _this11; _classCallCheck(this, _class21); - _this11 = _possibleConstructorReturn(this, _getPrototypeOf(_class21).call(this, node)); + _this11 = _super20.call(this, node); _this11.offset = _this11.attribute('offset').numValue(); if (_this11.offset < 0) _this11.offset = 0; if (_this11.offset > 1) _this11.offset = 1; @@ -3182,12 +3249,14 @@ var canvg = (function (exports) { svg.Element.AnimateBase = /*#__PURE__*/function (_svg$Element$ElementB7) { _inherits(_class22, _svg$Element$ElementB7); + var _super21 = _createSuper(_class22); + function _class22(node) { var _this12; _classCallCheck(this, _class22); - _this12 = _possibleConstructorReturn(this, _getPrototypeOf(_class22).call(this, node)); + _this12 = _super21.call(this, node); svg.Animations.push(_assertThisInitialized(_this12)); _this12.duration = 0.0; _this12.begin = _this12.attribute('begin').toMilliseconds(); @@ -3297,10 +3366,12 @@ var canvg = (function (exports) { svg.Element.animate = /*#__PURE__*/function (_svg$Element$AnimateB) { _inherits(_class23, _svg$Element$AnimateB); + var _super22 = _createSuper(_class23); + function _class23() { _classCallCheck(this, _class23); - return _possibleConstructorReturn(this, _getPrototypeOf(_class23).apply(this, arguments)); + return _super22.apply(this, arguments); } _createClass(_class23, [{ @@ -3320,10 +3391,12 @@ var canvg = (function (exports) { svg.Element.animateColor = /*#__PURE__*/function (_svg$Element$AnimateB2) { _inherits(_class24, _svg$Element$AnimateB2); + var _super23 = _createSuper(_class24); + function _class24() { _classCallCheck(this, _class24); - return _possibleConstructorReturn(this, _getPrototypeOf(_class24).apply(this, arguments)); + return _super23.apply(this, arguments); } _createClass(_class24, [{ @@ -3352,10 +3425,12 @@ var canvg = (function (exports) { svg.Element.animateTransform = /*#__PURE__*/function (_svg$Element$animate) { _inherits(_class25, _svg$Element$animate); + var _super24 = _createSuper(_class25); + function _class25() { _classCallCheck(this, _class25); - return _possibleConstructorReturn(this, _getPrototypeOf(_class25).apply(this, arguments)); + return _super24.apply(this, arguments); } _createClass(_class25, [{ @@ -3380,12 +3455,14 @@ var canvg = (function (exports) { svg.Element.font = /*#__PURE__*/function (_svg$Element$ElementB8) { _inherits(_class26, _svg$Element$ElementB8); + var _super25 = _createSuper(_class26); + function _class26(node) { var _this13; _classCallCheck(this, _class26); - _this13 = _possibleConstructorReturn(this, _getPrototypeOf(_class26).call(this, node)); + _this13 = _super25.call(this, node); _this13.horizAdvX = _this13.attribute('horiz-adv-x').numValue(); _this13.isRTL = false; _this13.isArabic = false; @@ -3428,12 +3505,14 @@ var canvg = (function (exports) { svg.Element.fontface = /*#__PURE__*/function (_svg$Element$ElementB9) { _inherits(_class27, _svg$Element$ElementB9); + var _super26 = _createSuper(_class27); + function _class27(node) { var _this14; _classCallCheck(this, _class27); - _this14 = _possibleConstructorReturn(this, _getPrototypeOf(_class27).call(this, node)); + _this14 = _super26.call(this, node); _this14.ascent = _this14.attribute('ascent').value; _this14.descent = _this14.attribute('descent').value; _this14.unitsPerEm = _this14.attribute('units-per-em').numValue(); @@ -3447,12 +3526,14 @@ var canvg = (function (exports) { svg.Element.missingglyph = /*#__PURE__*/function (_svg$Element$path) { _inherits(_class28, _svg$Element$path); + var _super27 = _createSuper(_class28); + function _class28(node) { var _this15; _classCallCheck(this, _class28); - _this15 = _possibleConstructorReturn(this, _getPrototypeOf(_class28).call(this, node)); + _this15 = _super27.call(this, node); _this15.horizAdvX = 0; return _this15; } @@ -3464,12 +3545,14 @@ var canvg = (function (exports) { svg.Element.glyph = /*#__PURE__*/function (_svg$Element$path2) { _inherits(_class29, _svg$Element$path2); + var _super28 = _createSuper(_class29); + function _class29(node) { var _this16; _classCallCheck(this, _class29); - _this16 = _possibleConstructorReturn(this, _getPrototypeOf(_class29).call(this, node)); + _this16 = _super28.call(this, node); _this16.horizAdvX = _this16.attribute('horiz-adv-x').numValue(); _this16.unicode = _this16.attribute('unicode').value; _this16.arabicForm = _this16.attribute('arabic-form').value; @@ -3483,10 +3566,12 @@ var canvg = (function (exports) { svg.Element.text = /*#__PURE__*/function (_svg$Element$Rendered3) { _inherits(_class30, _svg$Element$Rendered3); + var _super29 = _createSuper(_class30); + function _class30(node) { _classCallCheck(this, _class30); - return _possibleConstructorReturn(this, _getPrototypeOf(_class30).call(this, node, true)); + return _super29.call(this, node, true); } _createClass(_class30, [{ @@ -3579,10 +3664,12 @@ var canvg = (function (exports) { svg.Element.TextElementBase = /*#__PURE__*/function (_svg$Element$Rendered4) { _inherits(_class31, _svg$Element$Rendered4); + var _super30 = _createSuper(_class31); + function _class31() { _classCallCheck(this, _class31); - return _possibleConstructorReturn(this, _getPrototypeOf(_class31).apply(this, arguments)); + return _super30.apply(this, arguments); } _createClass(_class31, [{ @@ -3703,12 +3790,14 @@ var canvg = (function (exports) { svg.Element.tspan = /*#__PURE__*/function (_svg$Element$TextElem) { _inherits(_class32, _svg$Element$TextElem); + var _super31 = _createSuper(_class32); + function _class32(node) { var _this18; _classCallCheck(this, _class32); - _this18 = _possibleConstructorReturn(this, _getPrototypeOf(_class32).call(this, node, true)); + _this18 = _super31.call(this, node, true); _this18.text = node.nodeValue || node.text || ''; return _this18; } @@ -3727,10 +3816,12 @@ var canvg = (function (exports) { svg.Element.tref = /*#__PURE__*/function (_svg$Element$TextElem2) { _inherits(_class33, _svg$Element$TextElem2); + var _super32 = _createSuper(_class33); + function _class33() { _classCallCheck(this, _class33); - return _possibleConstructorReturn(this, _getPrototypeOf(_class33).apply(this, arguments)); + return _super32.apply(this, arguments); } _createClass(_class33, [{ @@ -3749,12 +3840,14 @@ var canvg = (function (exports) { svg.Element.a = /*#__PURE__*/function (_svg$Element$TextElem3) { _inherits(_class34, _svg$Element$TextElem3); + var _super33 = _createSuper(_class34); + function _class34(node) { var _this19; _classCallCheck(this, _class34); - _this19 = _possibleConstructorReturn(this, _getPrototypeOf(_class34).call(this, node)); + _this19 = _super33.call(this, node); _this19.hasText = true; _toConsumableArray(node.childNodes).forEach(function (childNode) { @@ -3809,12 +3902,14 @@ var canvg = (function (exports) { svg.Element.image = /*#__PURE__*/function (_svg$Element$Rendered5) { _inherits(_class35, _svg$Element$Rendered5); + var _super34 = _createSuper(_class35); + function _class35(node) { var _this20; _classCallCheck(this, _class35); - _this20 = _possibleConstructorReturn(this, _getPrototypeOf(_class35).call(this, node)); + _this20 = _super34.call(this, node); var href = _this20.getHrefAttribute().value; @@ -3896,10 +3991,12 @@ var canvg = (function (exports) { svg.Element.g = /*#__PURE__*/function (_svg$Element$Rendered6) { _inherits(_class36, _svg$Element$Rendered6); + var _super35 = _createSuper(_class36); + function _class36() { _classCallCheck(this, _class36); - return _possibleConstructorReturn(this, _getPrototypeOf(_class36).apply(this, arguments)); + return _super35.apply(this, arguments); } _createClass(_class36, [{ @@ -3920,10 +4017,12 @@ var canvg = (function (exports) { svg.Element.symbol = /*#__PURE__*/function (_svg$Element$Rendered7) { _inherits(_class37, _svg$Element$Rendered7); + var _super36 = _createSuper(_class37); + function _class37() { _classCallCheck(this, _class37); - return _possibleConstructorReturn(this, _getPrototypeOf(_class37).apply(this, arguments)); + return _super36.apply(this, arguments); } _createClass(_class37, [{ @@ -3939,12 +4038,14 @@ var canvg = (function (exports) { svg.Element.style = /*#__PURE__*/function (_svg$Element$ElementB10) { _inherits(_class38, _svg$Element$ElementB10); + var _super37 = _createSuper(_class38); + function _class38(node) { var _this21; _classCallCheck(this, _class38); - _this21 = _possibleConstructorReturn(this, _getPrototypeOf(_class38).call(this, node)); // text, or spaces then CDATA + _this21 = _super37.call(this, node); // text, or spaces then CDATA var css = ''; @@ -4017,12 +4118,14 @@ var canvg = (function (exports) { svg.Element.use = /*#__PURE__*/function (_svg$Element$Rendered8) { _inherits(_class39, _svg$Element$Rendered8); + var _super38 = _createSuper(_class39); + function _class39(node) { var _this22; _classCallCheck(this, _class39); - _this22 = _possibleConstructorReturn(this, _getPrototypeOf(_class39).call(this, node)); + _this22 = _super38.call(this, node); _this22._el = _this22.getHrefAttribute().getDefinition(); return _this22; } @@ -4087,10 +4190,12 @@ var canvg = (function (exports) { svg.Element.mask = /*#__PURE__*/function (_svg$Element$ElementB11) { _inherits(_class40, _svg$Element$ElementB11); + var _super39 = _createSuper(_class40); + function _class40() { _classCallCheck(this, _class40); - return _possibleConstructorReturn(this, _getPrototypeOf(_class40).apply(this, arguments)); + return _super39.apply(this, arguments); } _createClass(_class40, [{ @@ -4147,10 +4252,12 @@ var canvg = (function (exports) { svg.Element.clipPath = /*#__PURE__*/function (_svg$Element$ElementB12) { _inherits(_class41, _svg$Element$ElementB12); + var _super40 = _createSuper(_class41); + function _class41() { _classCallCheck(this, _class41); - return _possibleConstructorReturn(this, _getPrototypeOf(_class41).apply(this, arguments)); + return _super40.apply(this, arguments); } _createClass(_class41, [{ @@ -4187,10 +4294,12 @@ var canvg = (function (exports) { svg.Element.filter = /*#__PURE__*/function (_svg$Element$ElementB13) { _inherits(_class42, _svg$Element$ElementB13); + var _super41 = _createSuper(_class42); + function _class42() { _classCallCheck(this, _class42); - return _possibleConstructorReturn(this, _getPrototypeOf(_class42).apply(this, arguments)); + return _super41.apply(this, arguments); } _createClass(_class42, [{ @@ -4239,10 +4348,12 @@ var canvg = (function (exports) { svg.Element.feMorphology = /*#__PURE__*/function (_svg$Element$ElementB14) { _inherits(_class43, _svg$Element$ElementB14); + var _super42 = _createSuper(_class43); + function _class43() { _classCallCheck(this, _class43); - return _possibleConstructorReturn(this, _getPrototypeOf(_class43).apply(this, arguments)); + return _super42.apply(this, arguments); } _createClass(_class43, [{ @@ -4257,10 +4368,12 @@ var canvg = (function (exports) { svg.Element.feComposite = /*#__PURE__*/function (_svg$Element$ElementB15) { _inherits(_class44, _svg$Element$ElementB15); + var _super43 = _createSuper(_class44); + function _class44() { _classCallCheck(this, _class44); - return _possibleConstructorReturn(this, _getPrototypeOf(_class44).apply(this, arguments)); + return _super43.apply(this, arguments); } _createClass(_class44, [{ @@ -4304,12 +4417,14 @@ var canvg = (function (exports) { svg.Element.feColorMatrix = /*#__PURE__*/function (_svg$Element$ElementB16) { _inherits(_class45, _svg$Element$ElementB16); + var _super44 = _createSuper(_class45); + function _class45(node) { var _this23; _classCallCheck(this, _class45); - _this23 = _possibleConstructorReturn(this, _getPrototypeOf(_class45).call(this, node)); + _this23 = _super44.call(this, node); var matrix = svg.ToNumberArray(_this23.attribute('values').value); switch (_this23.attribute('type').valueOrDefault('matrix')) { @@ -4379,12 +4494,14 @@ var canvg = (function (exports) { svg.Element.feGaussianBlur = /*#__PURE__*/function (_svg$Element$ElementB17) { _inherits(_class46, _svg$Element$ElementB17); + var _super45 = _createSuper(_class46); + function _class46(node) { var _this24; _classCallCheck(this, _class46); - _this24 = _possibleConstructorReturn(this, _getPrototypeOf(_class46).call(this, node)); + _this24 = _super45.call(this, node); _this24.blurRadius = Math.floor(_this24.attribute('stdDeviation').numValue()); _this24.extraFilterDistance = _this24.blurRadius; return _this24; @@ -4410,10 +4527,12 @@ var canvg = (function (exports) { svg.Element.title = /*#__PURE__*/function (_svg$Element$ElementB18) { _inherits(_class47, _svg$Element$ElementB18); + var _super46 = _createSuper(_class47); + function _class47(node) { _classCallCheck(this, _class47); - return _possibleConstructorReturn(this, _getPrototypeOf(_class47).call(this)); + return _super46.call(this); } return _class47; @@ -4423,10 +4542,12 @@ var canvg = (function (exports) { svg.Element.desc = /*#__PURE__*/function (_svg$Element$ElementB19) { _inherits(_class48, _svg$Element$ElementB19); + var _super47 = _createSuper(_class48); + function _class48(node) { _classCallCheck(this, _class48); - return _possibleConstructorReturn(this, _getPrototypeOf(_class48).call(this)); + return _super47.call(this); } return _class48; @@ -4435,12 +4556,14 @@ var canvg = (function (exports) { svg.Element.MISSING = /*#__PURE__*/function (_svg$Element$ElementB20) { _inherits(_class49, _svg$Element$ElementB20); + var _super48 = _createSuper(_class49); + function _class49(node) { var _this25; _classCallCheck(this, _class49); - _this25 = _possibleConstructorReturn(this, _getPrototypeOf(_class49).call(this)); + _this25 = _super48.call(this); svg.log('ERROR: Element \'' + node.nodeName + '\' not yet implemented.'); return _this25; } diff --git a/dist/extensions/ext-arrows.js b/dist/extensions/ext-arrows.js index c71602d7..df4e65b8 100644 --- a/dist/extensions/ext-arrows.js +++ b/dist/extensions/ext-arrows.js @@ -56,7 +56,7 @@ var svgEditorExtension_arrows = (function () { while (1) { switch (_context2.prev = _context2.next) { case 0: - colorChanged = function _ref10(elem) { + colorChanged = function _colorChanged(elem) { var color = elem.getAttribute('stroke'); var mtypes = ['start', 'mid', 'end']; var defs = svgCanvas.findDefs(); @@ -122,7 +122,7 @@ var svgEditorExtension_arrows = (function () { }); }; - setArrow = function _ref9() { + setArrow = function _setArrow() { resetMarker(); var type = this.value; @@ -150,7 +150,7 @@ var svgEditorExtension_arrows = (function () { svgCanvas.call('changed', selElems); }; - addMarker = function _ref8(dir, type, id) { + addMarker = function _addMarker(dir, type, id) { // TODO: Make marker (or use?) per arrow type, since refX can be different id = id || arrowprefix + dir; var data = pathdata[dir]; @@ -191,14 +191,14 @@ var svgEditorExtension_arrows = (function () { return marker; }; - resetMarker = function _ref7() { + resetMarker = function _resetMarker() { var el = selElems[0]; el.removeAttribute('marker-start'); el.removeAttribute('marker-mid'); el.removeAttribute('marker-end'); }; - showPanel = function _ref6(on) { + showPanel = function _showPanel(on) { $('#arrow_panel').toggle(on); if (on) { @@ -230,7 +230,7 @@ var svgEditorExtension_arrows = (function () { } }; - getLinked = function _ref5(elem, attr) { + getLinked = function _getLinked(elem, attr) { var str = elem.getAttribute(attr); if (!str) { @@ -247,14 +247,14 @@ var svgEditorExtension_arrows = (function () { return svgCanvas.getElem(m[1]); // return svgCanvas.getElem(m.groups.id); }; - unsetArrowNonce = function _ref4(win) { + unsetArrowNonce = function _unsetArrowNonce(win) { randomizeIds = false; arrowprefix = prefix; pathdata.fw.id = arrowprefix + 'fw'; pathdata.bk.id = arrowprefix + 'bk'; }; - setArrowNonce = function _ref3(win, n) { + setArrowNonce = function _setArrowNonce(win, n) { randomizeIds = true; arrowprefix = prefix + n + '_'; pathdata.fw.id = arrowprefix + 'fw'; @@ -325,26 +325,25 @@ var svgEditorExtension_arrows = (function () { $('#arrow_list option')[0].id = 'connector_no_arrow'; }, addLangData: function addLangData(_ref) { - var lang = _ref.lang, - importLocale = _ref.importLocale; return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() { - var _ref2, langList; + var lang, importLocale, _yield$importLocale, langList; return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: - _context.next = 2; + lang = _ref.lang, importLocale = _ref.importLocale; + _context.next = 3; return importLocale(); - case 2: - _ref2 = _context.sent; - langList = _ref2.langList; + case 3: + _yield$importLocale = _context.sent; + langList = _yield$importLocale.langList; return _context.abrupt("return", { data: langList }); - case 5: + case 6: case "end": return _context.stop(); } diff --git a/dist/extensions/ext-closepath.js b/dist/extensions/ext-closepath.js index 81d58af9..c5ab1e17 100644 --- a/dist/extensions/ext-closepath.js +++ b/dist/extensions/ext-closepath.js @@ -52,18 +52,17 @@ var svgEditorExtension_closepath = (function () { init: function init(_ref) { var _this = this; - var importLocale = _ref.importLocale, - $ = _ref.$; return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() { - var strings, svgEditor, selElems, updateButton, showPanel, toggleClosed, buttons; + var importLocale, $, strings, svgEditor, selElems, updateButton, showPanel, toggleClosed, buttons; return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: - _context.next = 2; + importLocale = _ref.importLocale, $ = _ref.$; + _context.next = 3; return importLocale(); - case 2: + case 3: strings = _context.sent; svgEditor = _this; @@ -155,7 +154,7 @@ var svgEditorExtension_closepath = (function () { } }); - case 9: + case 10: case "end": return _context.stop(); } diff --git a/dist/extensions/ext-connector.js b/dist/extensions/ext-connector.js index eeeba231..27df4c92 100644 --- a/dist/extensions/ext-connector.js +++ b/dist/extensions/ext-connector.js @@ -58,7 +58,7 @@ var svgEditorExtension_connector = (function () { while (1) { switch (_context.prev = _context.next) { case 0: - init = function _ref9() { + init = function _init() { // Make sure all connectors have data set $(svgcontent).find('*').each(function () { var conn = this.getAttributeNS(seNs, 'connector'); @@ -74,7 +74,7 @@ var svgEditorExtension_connector = (function () { }); // updateConnectors(); }; - updateConnectors = function _ref8(elems) { + updateConnectors = function _updateConnectors(elems) { // Updates connector lines based on selected elements // Is not used on mousemove, as it runs getStrokedBBox every time, // which isn't necessary there. @@ -126,7 +126,7 @@ var svgEditorExtension_connector = (function () { } }; - findConnectors = function _ref7() { + findConnectors = function _findConnectors() { var elems = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : selElems; var connectors = $(svgcontent).find(connSel); connections = []; // Loop through connectors to see if one is connected to the element @@ -186,7 +186,7 @@ var svgEditorExtension_connector = (function () { }); }; - updateLine = function _ref6(diffX, diffY) { + updateLine = function _updateLine(diffX, diffY) { // Update line with element var i = connections.length; @@ -216,7 +216,7 @@ var svgEditorExtension_connector = (function () { } }; - setPoint = function _ref5(elem, pos, x, y, setMid) { + setPoint = function _setPoint(elem, pos, x, y, setMid) { var pts = elem.points; var pt = svgroot.createSVGPoint(); pt.x = x; @@ -250,7 +250,7 @@ var svgEditorExtension_connector = (function () { } }; - showPanel = function _ref4(on) { + showPanel = function _showPanel(on) { var connRules = $('#connector_rules'); if (!connRules.length) { @@ -261,7 +261,7 @@ var svgEditorExtension_connector = (function () { $('#connector_panel').toggle(on); }; - getOffset = function _ref3(side, line) { + getOffset = function _getOffset(side, line) { var giveOffset = line.getAttribute('marker-' + side); // const giveOffset = $(line).data(side+'_off'); // TODO: Make this number (5) be based on marker width/height @@ -269,7 +269,7 @@ var svgEditorExtension_connector = (function () { return giveOffset ? size : 0; }; - getBBintersect = function _ref2(x, y, bb, offset) { + getBBintersect = function _getBBintersect(x, y, bb, offset) { if (offset) { offset -= 0; bb = $.extend({}, bb); diff --git a/dist/extensions/ext-eyedropper.js b/dist/extensions/ext-eyedropper.js index 68d29013..ec8eb9dc 100644 --- a/dist/extensions/ext-eyedropper.js +++ b/dist/extensions/ext-eyedropper.js @@ -56,7 +56,7 @@ var svgEditorExtension_eyedropper = (function () { while (1) { switch (_context.prev = _context.next) { case 0: - getStyle = function _ref(opts) { + getStyle = function _getStyle(opts) { // if we are in eyedropper mode, we don't want to disable the eye-dropper tool var mode = svgCanvas.getMode(); diff --git a/dist/extensions/ext-foreignobject.js b/dist/extensions/ext-foreignobject.js index 9467085b..e98d6a4c 100644 --- a/dist/extensions/ext-foreignobject.js +++ b/dist/extensions/ext-foreignobject.js @@ -56,12 +56,12 @@ var svgEditorExtension_foreignobject = (function () { while (1) { switch (_context2.prev = _context2.next) { case 0: - setAttr = function _ref6(attr, val) { + setAttr = function _setAttr(attr, val) { svgCanvas.changeSelectedAttribute(attr, val); svgCanvas.call('changed', selElems); }; - showForeignEditor = function _ref5() { + showForeignEditor = function _showForeignEditor() { var elt = selElems[0]; if (!elt || editingforeign) { @@ -78,7 +78,7 @@ var svgEditorExtension_foreignobject = (function () { $('#svg_source_textarea').focus(); }; - setForeignString = function _ref4(xmlString) { + setForeignString = function _setForeignString(xmlString) { var elt = selElems[0]; // The parent `Element` to append to try { @@ -99,12 +99,12 @@ var svgEditorExtension_foreignobject = (function () { return true; }; - toggleSourceButtons = function _ref3(on) { + toggleSourceButtons = function _toggleSourceButtons(on) { $('#tool_source_save, #tool_source_cancel').toggle(!on); $('#foreign_save, #foreign_cancel').toggle(on); }; - showPanel = function _ref2(on) { + showPanel = function _showPanel(on) { var fcRules = $('#fc_rules'); if (!fcRules.length) { diff --git a/dist/extensions/ext-grid.js b/dist/extensions/ext-grid.js index 0e79889c..420ddccb 100644 --- a/dist/extensions/ext-grid.js +++ b/dist/extensions/ext-grid.js @@ -50,17 +50,13 @@ var svgEditorExtension_grid = (function () { init: function init(_ref) { var _this = this; - var $ = _ref.$, - NS = _ref.NS, - getTypeMap = _ref.getTypeMap, - importLocale = _ref.importLocale; return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() { - var strings, svgEditor, svgCanvas, svgdoc, assignAttributes, hcanvas, canvBG, units, intervals, showGrid, canvasGrid, gridDefs, gridPattern, gridimg, gridBox, updateGrid, gridUpdate, buttons; + var $, NS, getTypeMap, importLocale, strings, svgEditor, svgCanvas, svgdoc, assignAttributes, hcanvas, canvBG, units, intervals, showGrid, canvasGrid, gridDefs, gridPattern, gridimg, gridBox, updateGrid, gridUpdate, buttons; return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: - gridUpdate = function _ref3() { + gridUpdate = function _gridUpdate() { if (showGrid) { updateGrid(svgCanvas.getZoom()); } @@ -69,7 +65,7 @@ var svgEditorExtension_grid = (function () { $('#view_grid').toggleClass('push_button_pressed tool_button'); }; - updateGrid = function _ref2(zoom) { + updateGrid = function _updateGrid(zoom) { // TODO: Try this with elements, then compare performance difference var unit = units[svgEditor.curConfig.baseUnit]; // 1 = 1px @@ -117,10 +113,11 @@ var svgEditorExtension_grid = (function () { svgCanvas.setHref(gridimg, datauri); }; - _context.next = 4; + $ = _ref.$, NS = _ref.NS, getTypeMap = _ref.getTypeMap, importLocale = _ref.importLocale; + _context.next = 5; return importLocale(); - case 4: + case 5: strings = _context.sent; svgEditor = _this; svgCanvas = svgEditor.canvas; @@ -210,7 +207,7 @@ var svgEditorExtension_grid = (function () { }) }); - case 26: + case 27: case "end": return _context.stop(); } diff --git a/dist/extensions/ext-helloworld.js b/dist/extensions/ext-helloworld.js index 97fbd820..5cf9a499 100644 --- a/dist/extensions/ext-helloworld.js +++ b/dist/extensions/ext-helloworld.js @@ -38,7 +38,7 @@ var svgEditorExtension_helloworld = (function () { } function _slicedToArray(arr, i) { - return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); + return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _arrayWithHoles(arr) { @@ -46,10 +46,7 @@ var svgEditorExtension_helloworld = (function () { } function _iterableToArrayLimit(arr, i) { - if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { - return; - } - + if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; @@ -75,8 +72,25 @@ var svgEditorExtension_helloworld = (function () { return _arr; } + function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(n); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); + } + + function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; + + return arr2; + } + function _nonIterableRest() { - throw new TypeError("Invalid attempt to destructure non-iterable instance"); + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } /** @@ -98,18 +112,17 @@ var svgEditorExtension_helloworld = (function () { init: function init(_ref) { var _this = this; - var $ = _ref.$, - importLocale = _ref.importLocale; return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() { - var strings, svgEditor, svgCanvas; + var $, importLocale, strings, svgEditor, svgCanvas; return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: - _context.next = 2; + $ = _ref.$, importLocale = _ref.importLocale; + _context.next = 3; return importLocale(); - case 2: + case 3: strings = _context.sent; svgEditor = _this; svgCanvas = svgEditor.canvas; @@ -177,7 +190,7 @@ var svgEditorExtension_helloworld = (function () { } }); - case 6: + case 7: case "end": return _context.stop(); } diff --git a/dist/extensions/ext-imagelib.js b/dist/extensions/ext-imagelib.js index b6e47853..e2832723 100644 --- a/dist/extensions/ext-imagelib.js +++ b/dist/extensions/ext-imagelib.js @@ -66,18 +66,14 @@ var svgEditorExtension_imagelib = (function () { init: function init(_ref) { var _this = this; - var $ = _ref.$, - decode64 = _ref.decode64, - importLocale = _ref.importLocale, - dropXMLInternalSubset = _ref.dropXMLInternalSubset; return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() { - var imagelibStrings, modularVersion, svgEditor, uiStrings, svgCanvas, extIconsPath, allowedImageLibOrigins, closeBrowser, importImage, pending, mode, multiArr, transferStopped, preview, submit, onMessage, _onMessage, toggleMulti, showBrowser, buttons; + var $, decode64, importLocale, dropXMLInternalSubset, imagelibStrings, modularVersion, svgEditor, uiStrings, svgCanvas, extIconsPath, allowedImageLibOrigins, closeBrowser, importImage, pending, mode, multiArr, transferStopped, preview, submit, onMessage, _onMessage, toggleMulti, showBrowser, buttons; return regeneratorRuntime.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: - showBrowser = function _ref11() { + showBrowser = function _showBrowser() { var browser = $('#imgbrowse'); if (!browser.length) { @@ -133,10 +129,10 @@ var svgEditorExtension_imagelib = (function () { }); cancel.prepend($.getSvgIcon('cancel', true)); back.prepend($.getSvgIcon('tool_imagelib', true)); - imagelibStrings.imgLibs.forEach(function (_ref4) { - var name = _ref4.name, - url = _ref4.url, - description = _ref4.description; + imagelibStrings.imgLibs.forEach(function (_ref5) { + var name = _ref5.name, + url = _ref5.url, + description = _ref5.description; $('
  • ').appendTo(libOpts).text(name).on('click touchend', function () { frame.attr('src', url).show(); header.text(name); @@ -149,7 +145,7 @@ var svgEditorExtension_imagelib = (function () { } }; - toggleMulti = function _ref10(show) { + toggleMulti = function _toggleMulti(show) { $('#lib_framewrap, #imglib_opts').css({ right: show ? 200 : 10 }); @@ -191,14 +187,14 @@ var svgEditorExtension_imagelib = (function () { submit.toggle(show); }; - _onMessage = function _ref9() { - _onMessage = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(_ref5) { + _onMessage = function _onMessage3() { + _onMessage = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(_ref4) { var origin, response, id, type, hasName, hasHref, char1, secondpos, entry, curMeta, svgStr, imgStr, name, message, pre, src, title, xml, ok; return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: - origin = _ref5.origin, response = _ref5.data; + origin = _ref4.origin, response = _ref4.data; if (!(!response || !['string', 'object'].includes(_typeof(response)))) { _context.next = 3; @@ -477,11 +473,11 @@ var svgEditorExtension_imagelib = (function () { return _onMessage.apply(this, arguments); }; - onMessage = function _ref8(_x) { + onMessage = function _onMessage2(_x) { return _onMessage.apply(this, arguments); }; - importImage = function _ref7(url) { + importImage = function _importImage(url) { var newImage = svgCanvas.addSVGElementFromJson({ element: 'image', attr: { @@ -498,14 +494,15 @@ var svgEditorExtension_imagelib = (function () { svgCanvas.setImageURL(url); }; - closeBrowser = function _ref6() { + closeBrowser = function _closeBrowser() { $('#imgbrowse_holder').hide(); }; - _context2.next = 8; + $ = _ref.$, decode64 = _ref.decode64, importLocale = _ref.importLocale, dropXMLInternalSubset = _ref.dropXMLInternalSubset; + _context2.next = 9; return importLocale(); - case 8: + case 9: imagelibStrings = _context2.sent; modularVersion = !('svgEditor' in window) || !window.svgEditor || window.svgEditor.modules !== false; svgEditor = _this; @@ -571,7 +568,7 @@ var svgEditorExtension_imagelib = (function () { } }); - case 21: + case 22: case "end": return _context2.stop(); } diff --git a/dist/extensions/ext-markers.js b/dist/extensions/ext-markers.js index 0dd8f79f..203ebc21 100644 --- a/dist/extensions/ext-markers.js +++ b/dist/extensions/ext-markers.js @@ -79,7 +79,7 @@ var svgEditorExtension_markers = (function () { while (1) { switch (_context3.prev = _context3.next) { case 0: - buildButtonList = function _ref16() { + buildButtonList = function _buildButtonList() { var buttons = []; // const i = 0; /* @@ -130,7 +130,7 @@ var svgEditorExtension_markers = (function () { return buttons; }; - getTitle = function _ref15(id) { + getTitle = function _getTitle(id) { var langList = strings.langList; var item = langList.find(function (itm) { return itm.id === id; @@ -138,7 +138,7 @@ var svgEditorExtension_markers = (function () { return item ? item.title : id; }; - _setArrowFromButton = function _ref14() { + _setArrowFromButton = function _setArrowFromButton3() { _setArrowFromButton = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(ev) { var parts, pos, val; return regeneratorRuntime.wrap(function _callee2$(_context2) { @@ -176,11 +176,11 @@ var svgEditorExtension_markers = (function () { return _setArrowFromButton.apply(this, arguments); }; - setArrowFromButton = function _ref13(_x2) { + setArrowFromButton = function _setArrowFromButton2(_x2) { return _setArrowFromButton.apply(this, arguments); }; - _showTextPrompt = function _ref12() { + _showTextPrompt = function _showTextPrompt3() { _showTextPrompt = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(pos) { var def, txt; return regeneratorRuntime.wrap(function _callee$(_context) { @@ -213,18 +213,18 @@ var svgEditorExtension_markers = (function () { return _showTextPrompt.apply(this, arguments); }; - showTextPrompt = function _ref11(_x) { + showTextPrompt = function _showTextPrompt2(_x) { return _showTextPrompt.apply(this, arguments); }; - triggerTextEntry = function _ref10(pos, val) { + triggerTextEntry = function _triggerTextEntry(pos, val) { $('#' + pos + '_marker').val(val); $('#' + pos + '_marker').change(); // const txtbox = $('#'+pos+'_marker'); // if (val.substr(0,1)=='\\') {txtbox.hide();} // else {txtbox.show();} }; - updateReferences = function _ref9(el) { + updateReferences = function _updateReferences(el) { $.each(mtypes, function (i, pos) { var id = markerPrefix + pos + '_' + el.id; var markerName = 'marker-' + pos; @@ -256,7 +256,7 @@ var svgEditorExtension_markers = (function () { }); }; - colorChanged = function _ref8(elem) { + colorChanged = function _colorChanged(elem) { var color = elem.getAttribute('stroke'); $.each(mtypes, function (i, pos) { var marker = getLinked(elem, 'marker-' + pos); @@ -289,7 +289,7 @@ var svgEditorExtension_markers = (function () { }); }; - setMarker = function _ref7() { + setMarker = function _setMarker() { var poslist = { start_marker: 'start', mid_marker: 'mid', @@ -330,7 +330,7 @@ var svgEditorExtension_markers = (function () { setIcon(pos, val); }; - convertline = function _ref6(elem) { + convertline = function _convertline(elem) { // this routine came from the connectors extension // it is needed because midpoint markers don't work with line elements if (elem.tagName !== 'line') { @@ -374,7 +374,7 @@ var svgEditorExtension_markers = (function () { return pline; }; - addMarker = function _ref5(id, val) { + addMarker = function _addMarker(id, val) { var txtBoxBg = '#ffffff'; var txtBoxBorder = 'none'; var txtBoxStrokeWidth = 0; @@ -478,7 +478,7 @@ var svgEditorExtension_markers = (function () { return marker; }; - showPanel = function _ref4(on) { + showPanel = function _showPanel(on) { $('#marker_panel').toggle(on); if (on) { @@ -514,7 +514,7 @@ var svgEditorExtension_markers = (function () { } }; - setIcon = function _ref3(pos, id) { + setIcon = function _setIcon(pos, id) { if (id.substr(0, 1) !== '\\') { id = '\\textmarker'; } @@ -524,7 +524,7 @@ var svgEditorExtension_markers = (function () { $(ci).addClass('current').siblings().removeClass('current'); }; - getLinked = function _ref2(elem, attr) { + getLinked = function _getLinked(elem, attr) { var str = elem.getAttribute(attr); if (!str) { diff --git a/dist/extensions/ext-mathjax.js b/dist/extensions/ext-mathjax.js index 356e2164..3c765d9c 100644 --- a/dist/extensions/ext-mathjax.js +++ b/dist/extensions/ext-mathjax.js @@ -106,15 +106,13 @@ var svgEditorExtension_mathjax = (function () { init: function init(_ref) { var _this = this; - var $ = _ref.$, - importLocale = _ref.importLocale; return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() { - var strings, svgEditor, svgCanvas, mathjaxSrcSecure, uiStrings, math, locationX, locationY, mathjaxLoaded, saveMath, buttons; + var $, importLocale, strings, svgEditor, svgCanvas, mathjaxSrcSecure, uiStrings, math, locationX, locationY, mathjaxLoaded, saveMath, buttons; return regeneratorRuntime.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: - saveMath = function _ref2() { + saveMath = function _saveMath() { var code = $('#mathjax_code_textarea').val(); // displaystyle to force MathJax NOT to use the inline style. Because it is // less fancy! @@ -166,10 +164,11 @@ var svgEditorExtension_mathjax = (function () { }); }; - _context2.next = 3; + $ = _ref.$, importLocale = _ref.importLocale; + _context2.next = 4; return importLocale(); - case 3: + case 4: strings = _context2.sent; svgEditor = _this; svgCanvas = svgEditor.canvas; // Configuration of the MathJax extention. @@ -346,7 +345,7 @@ var svgEditorExtension_mathjax = (function () { } }); - case 11: + case 12: case "end": return _context2.stop(); } diff --git a/dist/extensions/ext-panning.js b/dist/extensions/ext-panning.js index 1d0f3b34..8b675fbe 100644 --- a/dist/extensions/ext-panning.js +++ b/dist/extensions/ext-panning.js @@ -54,17 +54,17 @@ var svgEditorExtension_panning = (function () { init: function init(_ref) { var _this = this; - var importLocale = _ref.importLocale; return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() { - var strings, svgEditor, svgCanvas, buttons; + var importLocale, strings, svgEditor, svgCanvas, buttons; return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: - _context.next = 2; + importLocale = _ref.importLocale; + _context.next = 3; return importLocale(); - case 2: + case 3: strings = _context.sent; svgEditor = _this; svgCanvas = svgEditor.canvas; @@ -107,7 +107,7 @@ var svgEditorExtension_panning = (function () { } }); - case 7: + case 8: case "end": return _context.stop(); } diff --git a/dist/extensions/ext-placemark.js b/dist/extensions/ext-placemark.js index 88b33520..5e26aa8f 100644 --- a/dist/extensions/ext-placemark.js +++ b/dist/extensions/ext-placemark.js @@ -38,7 +38,7 @@ var svgEditorExtension_placemark = (function () { } function _slicedToArray(arr, i) { - return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); + return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _arrayWithHoles(arr) { @@ -46,10 +46,7 @@ var svgEditorExtension_placemark = (function () { } function _iterableToArrayLimit(arr, i) { - if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { - return; - } - + if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; @@ -75,8 +72,25 @@ var svgEditorExtension_placemark = (function () { return _arr; } + function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(n); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); + } + + function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; + + return arr2; + } + function _nonIterableRest() { - throw new TypeError("Invalid attempt to destructure non-iterable instance"); + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } /** @@ -97,7 +111,7 @@ var svgEditorExtension_placemark = (function () { while (1) { switch (_context.prev = _context.next) { case 0: - addMarkerButtons = function _ref11(buttons) { + addMarkerButtons = function _addMarkerButtons(buttons) { Object.keys(markerTypes).forEach(function (id) { var title = getTitle(String(id)); buttons.push({ @@ -117,7 +131,7 @@ var svgEditorExtension_placemark = (function () { return buttons; }; - getTitle = function _ref10(id) { + getTitle = function _getTitle(id) { var langList = strings.langList; var item = langList.find(function (itm) { return itm.id === id; @@ -125,7 +139,7 @@ var svgEditorExtension_placemark = (function () { return item ? item.title : id; }; - setArrowFromButton = function _ref9(ev) { + setArrowFromButton = function _setArrowFromButton(ev) { var parts = this.id.split('_'); var val = parts[2]; @@ -136,7 +150,7 @@ var svgEditorExtension_placemark = (function () { $('#placemark_marker').attr('value', val); }; - updateReferences = function _ref8(el) { + updateReferences = function _updateReferences(el) { var id = 'placemark_marker_' + el.id; var markerName = 'marker-start'; var marker = getLinked(el, markerName); @@ -161,7 +175,7 @@ var svgEditorExtension_placemark = (function () { } }; - colorChanged = function _ref7(el) { + colorChanged = function _colorChanged(el) { var color = el.getAttribute('stroke'); var marker = getLinked(el, 'marker-start'); // console.log(marker); @@ -192,7 +206,7 @@ var svgEditorExtension_placemark = (function () { } }; - setMarker = function _ref6(el, val) { + setMarker = function _setMarker(el, val) { var markerName = 'marker-start'; var marker = getLinked(el, markerName); @@ -214,7 +228,7 @@ var svgEditorExtension_placemark = (function () { svgCanvas.call('changed', [el]); }; - addMarker = function _ref5(id, val) { + addMarker = function _addMarker(id, val) { var marker = svgCanvas.getElem(id); if (marker) { @@ -274,7 +288,7 @@ var svgEditorExtension_placemark = (function () { return marker; }; - updateFont = function _ref4(font) { + updateFont = function _updateFont(font) { font = font.split(' '); var fontSize = parseInt(font.pop()); font = font.join(' '); @@ -296,7 +310,7 @@ var svgEditorExtension_placemark = (function () { }); }; - updateText = function _ref3(txt) { + updateText = function _updateText(txt) { var items = txt.split(';'); selElems.forEach(function (elem) { if (elem && elem.getAttribute('class').includes('placemark')) { @@ -314,7 +328,7 @@ var svgEditorExtension_placemark = (function () { }); }; - getLinked = function _ref2(elem, attr) { + getLinked = function _getLinked(elem, attr) { if (!elem) { return null; } @@ -336,7 +350,7 @@ var svgEditorExtension_placemark = (function () { return svgCanvas.getElem(m[1]); // return svgCanvas.getElem(m.groups.id); }; - showPanel = function _ref(on) { + showPanel = function _showPanel(on) { $('#placemark_panel').toggle(on); }; diff --git a/dist/extensions/ext-polygon.js b/dist/extensions/ext-polygon.js index db055412..37aa3a62 100644 --- a/dist/extensions/ext-polygon.js +++ b/dist/extensions/ext-polygon.js @@ -55,20 +55,20 @@ var svgEditorExtension_polygon = (function () { while (1) { switch (_context.prev = _context.next) { case 0: - sec = function _ref4(n) { + sec = function _sec(n) { return 1 / Math.cos(n); }; - cot = function _ref3(n) { + cot = function _cot(n) { return 1 / Math.tan(n); }; - setAttr = function _ref2(attr, val) { + setAttr = function _setAttr(attr, val) { svgCanvas.changeSelectedAttribute(attr, val); svgCanvas.call('changed', selElems); }; - showPanel = function _ref(on) { + showPanel = function _showPanel(on) { var fcRules = $('#fc_rules'); if (!fcRules.length) { diff --git a/dist/extensions/ext-server_moinsave.js b/dist/extensions/ext-server_moinsave.js index dd9ad5ea..600bfd81 100644 --- a/dist/extensions/ext-server_moinsave.js +++ b/dist/extensions/ext-server_moinsave.js @@ -106,7 +106,7 @@ var svgEditorExtension_server_moinsave = (function () { return _setPrototypeOf(o, p); } - function isNativeReflectConstruct() { + function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; @@ -120,7 +120,7 @@ var svgEditorExtension_server_moinsave = (function () { } function _construct(Parent, args, Class) { - if (isNativeReflectConstruct()) { + if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { @@ -152,6 +152,23 @@ var svgEditorExtension_server_moinsave = (function () { return _assertThisInitialized(self); } + function _createSuper(Derived) { + return function () { + var Super = _getPrototypeOf(Derived), + result; + + if (_isNativeReflectConstruct()) { + var NewTarget = _getPrototypeOf(this).constructor; + + result = Reflect.construct(Super, arguments, NewTarget); + } else { + result = Super.apply(this, arguments); + } + + return _possibleConstructorReturn(this, result); + }; + } + function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); @@ -183,19 +200,15 @@ var svgEditorExtension_server_moinsave = (function () { } function _slicedToArray(arr, i) { - return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); + return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _toConsumableArray(arr) { - return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) { - for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; - - return arr2; - } + if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _arrayWithHoles(arr) { @@ -203,14 +216,11 @@ var svgEditorExtension_server_moinsave = (function () { } function _iterableToArray(iter) { - if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); + if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); } function _iterableToArrayLimit(arr, i) { - if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { - return; - } - + if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; @@ -236,12 +246,29 @@ var svgEditorExtension_server_moinsave = (function () { return _arr; } + function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(n); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); + } + + function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; + + return arr2; + } + function _nonIterableSpread() { - throw new TypeError("Invalid attempt to spread non-iterable instance"); + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _nonIterableRest() { - throw new TypeError("Invalid attempt to destructure non-iterable instance"); + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } /** @@ -1658,12 +1685,14 @@ var svgEditorExtension_server_moinsave = (function () { SkewBase: /*#__PURE__*/function (_this$Type$matrix) { _inherits(SkewBase, _this$Type$matrix); + var _super = _createSuper(SkewBase); + function SkewBase(s) { var _this3; _classCallCheck(this, SkewBase); - _this3 = _possibleConstructorReturn(this, _getPrototypeOf(SkewBase).call(this, s)); + _this3 = _super.call(this, s); _this3.angle = new svg.Property('angle', s); return _this3; } @@ -1675,12 +1704,14 @@ var svgEditorExtension_server_moinsave = (function () { skewX: /*#__PURE__*/function (_this$Type$SkewBase) { _inherits(skewX, _this$Type$SkewBase); + var _super2 = _createSuper(skewX); + function skewX(s) { var _this4; _classCallCheck(this, skewX); - _this4 = _possibleConstructorReturn(this, _getPrototypeOf(skewX).call(this, s)); + _this4 = _super2.call(this, s); _this4.m = [1, 0, Math.tan(_this4.angle.toRadians()), 1, 0, 0]; return _this4; } @@ -1690,12 +1721,14 @@ var svgEditorExtension_server_moinsave = (function () { skewY: /*#__PURE__*/function (_this$Type$SkewBase2) { _inherits(skewY, _this$Type$SkewBase2); + var _super3 = _createSuper(skewY); + function skewY(s) { var _this5; _classCallCheck(this, skewY); - _this5 = _possibleConstructorReturn(this, _getPrototypeOf(skewY).call(this, s)); + _this5 = _super3.call(this, s); _this5.m = [1, Math.tan(_this5.angle.toRadians()), 0, 1, 0, 0]; return _this5; } @@ -2029,10 +2062,12 @@ var svgEditorExtension_server_moinsave = (function () { svg.Element.RenderedElementBase = /*#__PURE__*/function (_svg$Element$ElementB) { _inherits(_class5, _svg$Element$ElementB); + var _super4 = _createSuper(_class5); + function _class5() { _classCallCheck(this, _class5); - return _possibleConstructorReturn(this, _getPrototypeOf(_class5).apply(this, arguments)); + return _super4.apply(this, arguments); } _createClass(_class5, [{ @@ -2134,10 +2169,12 @@ var svgEditorExtension_server_moinsave = (function () { svg.Element.PathElementBase = /*#__PURE__*/function (_svg$Element$Rendered) { _inherits(_class6, _svg$Element$Rendered); + var _super5 = _createSuper(_class6); + function _class6() { _classCallCheck(this, _class6); - return _possibleConstructorReturn(this, _getPrototypeOf(_class6).apply(this, arguments)); + return _super5.apply(this, arguments); } _createClass(_class6, [{ @@ -2203,10 +2240,12 @@ var svgEditorExtension_server_moinsave = (function () { svg.Element.svg = /*#__PURE__*/function (_svg$Element$Rendered2) { _inherits(_class7, _svg$Element$Rendered2); + var _super6 = _createSuper(_class7); + function _class7() { _classCallCheck(this, _class7); - return _possibleConstructorReturn(this, _getPrototypeOf(_class7).apply(this, arguments)); + return _super6.apply(this, arguments); } _createClass(_class7, [{ @@ -2284,10 +2323,12 @@ var svgEditorExtension_server_moinsave = (function () { svg.Element.rect = /*#__PURE__*/function (_svg$Element$PathElem) { _inherits(_class8, _svg$Element$PathElem); + var _super7 = _createSuper(_class8); + function _class8() { _classCallCheck(this, _class8); - return _possibleConstructorReturn(this, _getPrototypeOf(_class8).apply(this, arguments)); + return _super7.apply(this, arguments); } _createClass(_class8, [{ @@ -2329,10 +2370,12 @@ var svgEditorExtension_server_moinsave = (function () { svg.Element.circle = /*#__PURE__*/function (_svg$Element$PathElem2) { _inherits(_class9, _svg$Element$PathElem2); + var _super8 = _createSuper(_class9); + function _class9() { _classCallCheck(this, _class9); - return _possibleConstructorReturn(this, _getPrototypeOf(_class9).apply(this, arguments)); + return _super8.apply(this, arguments); } _createClass(_class9, [{ @@ -2361,10 +2404,12 @@ var svgEditorExtension_server_moinsave = (function () { svg.Element.ellipse = /*#__PURE__*/function (_svg$Element$PathElem3) { _inherits(_class10, _svg$Element$PathElem3); + var _super9 = _createSuper(_class10); + function _class10() { _classCallCheck(this, _class10); - return _possibleConstructorReturn(this, _getPrototypeOf(_class10).apply(this, arguments)); + return _super9.apply(this, arguments); } _createClass(_class10, [{ @@ -2396,10 +2441,12 @@ var svgEditorExtension_server_moinsave = (function () { svg.Element.line = /*#__PURE__*/function (_svg$Element$PathElem4) { _inherits(_class11, _svg$Element$PathElem4); + var _super10 = _createSuper(_class11); + function _class11() { _classCallCheck(this, _class11); - return _possibleConstructorReturn(this, _getPrototypeOf(_class11).apply(this, arguments)); + return _super10.apply(this, arguments); } _createClass(_class11, [{ @@ -2436,12 +2483,14 @@ var svgEditorExtension_server_moinsave = (function () { svg.Element.polyline = /*#__PURE__*/function (_svg$Element$PathElem5) { _inherits(_class12, _svg$Element$PathElem5); + var _super11 = _createSuper(_class12); + function _class12(node) { var _this8; _classCallCheck(this, _class12); - _this8 = _possibleConstructorReturn(this, _getPrototypeOf(_class12).call(this, node)); + _this8 = _super11.call(this, node); _this8.points = svg.CreatePath(_this8.attribute('points').value); return _this8; } @@ -2490,10 +2539,12 @@ var svgEditorExtension_server_moinsave = (function () { svg.Element.polygon = /*#__PURE__*/function (_svg$Element$polyline) { _inherits(_class13, _svg$Element$polyline); + var _super12 = _createSuper(_class13); + function _class13() { _classCallCheck(this, _class13); - return _possibleConstructorReturn(this, _getPrototypeOf(_class13).apply(this, arguments)); + return _super12.apply(this, arguments); } _createClass(_class13, [{ @@ -2517,12 +2568,14 @@ var svgEditorExtension_server_moinsave = (function () { svg.Element.path = /*#__PURE__*/function (_svg$Element$PathElem6) { _inherits(_class14, _svg$Element$PathElem6); + var _super13 = _createSuper(_class14); + function _class14(node) { var _this9; _classCallCheck(this, _class14); - _this9 = _possibleConstructorReturn(this, _getPrototypeOf(_class14).call(this, node)); + _this9 = _super13.call(this, node); var d = _this9.attribute('d').value // TODO: convert to real lexer based on https://www.w3.org/TR/SVG11/paths.html#PathDataBNF .replace(/,/gm, ' ') // get rid of all commas @@ -2894,10 +2947,12 @@ var svgEditorExtension_server_moinsave = (function () { svg.Element.pattern = /*#__PURE__*/function (_svg$Element$ElementB2) { _inherits(_class15, _svg$Element$ElementB2); + var _super14 = _createSuper(_class15); + function _class15() { _classCallCheck(this, _class15); - return _possibleConstructorReturn(this, _getPrototypeOf(_class15).apply(this, arguments)); + return _super14.apply(this, arguments); } _createClass(_class15, [{ @@ -2943,10 +2998,12 @@ var svgEditorExtension_server_moinsave = (function () { svg.Element.marker = /*#__PURE__*/function (_svg$Element$ElementB3) { _inherits(_class16, _svg$Element$ElementB3); + var _super15 = _createSuper(_class16); + function _class16() { _classCallCheck(this, _class16); - return _possibleConstructorReturn(this, _getPrototypeOf(_class16).apply(this, arguments)); + return _super15.apply(this, arguments); } _createClass(_class16, [{ @@ -2981,10 +3038,12 @@ var svgEditorExtension_server_moinsave = (function () { svg.Element.defs = /*#__PURE__*/function (_svg$Element$ElementB4) { _inherits(_class17, _svg$Element$ElementB4); + var _super16 = _createSuper(_class17); + function _class17() { _classCallCheck(this, _class17); - return _possibleConstructorReturn(this, _getPrototypeOf(_class17).apply(this, arguments)); + return _super16.apply(this, arguments); } _createClass(_class17, [{ @@ -3000,12 +3059,14 @@ var svgEditorExtension_server_moinsave = (function () { svg.Element.GradientBase = /*#__PURE__*/function (_svg$Element$ElementB5) { _inherits(_class18, _svg$Element$ElementB5); + var _super17 = _createSuper(_class18); + function _class18(node) { var _this10; _classCallCheck(this, _class18); - _this10 = _possibleConstructorReturn(this, _getPrototypeOf(_class18).call(this, node)); + _this10 = _super17.call(this, node); _this10.gradientUnits = _this10.attribute('gradientUnits').valueOrDefault('objectBoundingBox'); _this10.stops = []; @@ -3081,10 +3142,12 @@ var svgEditorExtension_server_moinsave = (function () { svg.Element.linearGradient = /*#__PURE__*/function (_svg$Element$Gradient) { _inherits(_class19, _svg$Element$Gradient); + var _super18 = _createSuper(_class19); + function _class19() { _classCallCheck(this, _class19); - return _possibleConstructorReturn(this, _getPrototypeOf(_class19).apply(this, arguments)); + return _super18.apply(this, arguments); } _createClass(_class19, [{ @@ -3116,10 +3179,12 @@ var svgEditorExtension_server_moinsave = (function () { svg.Element.radialGradient = /*#__PURE__*/function (_svg$Element$Gradient2) { _inherits(_class20, _svg$Element$Gradient2); + var _super19 = _createSuper(_class20); + function _class20() { _classCallCheck(this, _class20); - return _possibleConstructorReturn(this, _getPrototypeOf(_class20).apply(this, arguments)); + return _super19.apply(this, arguments); } _createClass(_class20, [{ @@ -3155,12 +3220,14 @@ var svgEditorExtension_server_moinsave = (function () { svg.Element.stop = /*#__PURE__*/function (_svg$Element$ElementB6) { _inherits(_class21, _svg$Element$ElementB6); + var _super20 = _createSuper(_class21); + function _class21(node) { var _this11; _classCallCheck(this, _class21); - _this11 = _possibleConstructorReturn(this, _getPrototypeOf(_class21).call(this, node)); + _this11 = _super20.call(this, node); _this11.offset = _this11.attribute('offset').numValue(); if (_this11.offset < 0) _this11.offset = 0; if (_this11.offset > 1) _this11.offset = 1; @@ -3182,12 +3249,14 @@ var svgEditorExtension_server_moinsave = (function () { svg.Element.AnimateBase = /*#__PURE__*/function (_svg$Element$ElementB7) { _inherits(_class22, _svg$Element$ElementB7); + var _super21 = _createSuper(_class22); + function _class22(node) { var _this12; _classCallCheck(this, _class22); - _this12 = _possibleConstructorReturn(this, _getPrototypeOf(_class22).call(this, node)); + _this12 = _super21.call(this, node); svg.Animations.push(_assertThisInitialized(_this12)); _this12.duration = 0.0; _this12.begin = _this12.attribute('begin').toMilliseconds(); @@ -3297,10 +3366,12 @@ var svgEditorExtension_server_moinsave = (function () { svg.Element.animate = /*#__PURE__*/function (_svg$Element$AnimateB) { _inherits(_class23, _svg$Element$AnimateB); + var _super22 = _createSuper(_class23); + function _class23() { _classCallCheck(this, _class23); - return _possibleConstructorReturn(this, _getPrototypeOf(_class23).apply(this, arguments)); + return _super22.apply(this, arguments); } _createClass(_class23, [{ @@ -3320,10 +3391,12 @@ var svgEditorExtension_server_moinsave = (function () { svg.Element.animateColor = /*#__PURE__*/function (_svg$Element$AnimateB2) { _inherits(_class24, _svg$Element$AnimateB2); + var _super23 = _createSuper(_class24); + function _class24() { _classCallCheck(this, _class24); - return _possibleConstructorReturn(this, _getPrototypeOf(_class24).apply(this, arguments)); + return _super23.apply(this, arguments); } _createClass(_class24, [{ @@ -3352,10 +3425,12 @@ var svgEditorExtension_server_moinsave = (function () { svg.Element.animateTransform = /*#__PURE__*/function (_svg$Element$animate) { _inherits(_class25, _svg$Element$animate); + var _super24 = _createSuper(_class25); + function _class25() { _classCallCheck(this, _class25); - return _possibleConstructorReturn(this, _getPrototypeOf(_class25).apply(this, arguments)); + return _super24.apply(this, arguments); } _createClass(_class25, [{ @@ -3380,12 +3455,14 @@ var svgEditorExtension_server_moinsave = (function () { svg.Element.font = /*#__PURE__*/function (_svg$Element$ElementB8) { _inherits(_class26, _svg$Element$ElementB8); + var _super25 = _createSuper(_class26); + function _class26(node) { var _this13; _classCallCheck(this, _class26); - _this13 = _possibleConstructorReturn(this, _getPrototypeOf(_class26).call(this, node)); + _this13 = _super25.call(this, node); _this13.horizAdvX = _this13.attribute('horiz-adv-x').numValue(); _this13.isRTL = false; _this13.isArabic = false; @@ -3428,12 +3505,14 @@ var svgEditorExtension_server_moinsave = (function () { svg.Element.fontface = /*#__PURE__*/function (_svg$Element$ElementB9) { _inherits(_class27, _svg$Element$ElementB9); + var _super26 = _createSuper(_class27); + function _class27(node) { var _this14; _classCallCheck(this, _class27); - _this14 = _possibleConstructorReturn(this, _getPrototypeOf(_class27).call(this, node)); + _this14 = _super26.call(this, node); _this14.ascent = _this14.attribute('ascent').value; _this14.descent = _this14.attribute('descent').value; _this14.unitsPerEm = _this14.attribute('units-per-em').numValue(); @@ -3447,12 +3526,14 @@ var svgEditorExtension_server_moinsave = (function () { svg.Element.missingglyph = /*#__PURE__*/function (_svg$Element$path) { _inherits(_class28, _svg$Element$path); + var _super27 = _createSuper(_class28); + function _class28(node) { var _this15; _classCallCheck(this, _class28); - _this15 = _possibleConstructorReturn(this, _getPrototypeOf(_class28).call(this, node)); + _this15 = _super27.call(this, node); _this15.horizAdvX = 0; return _this15; } @@ -3464,12 +3545,14 @@ var svgEditorExtension_server_moinsave = (function () { svg.Element.glyph = /*#__PURE__*/function (_svg$Element$path2) { _inherits(_class29, _svg$Element$path2); + var _super28 = _createSuper(_class29); + function _class29(node) { var _this16; _classCallCheck(this, _class29); - _this16 = _possibleConstructorReturn(this, _getPrototypeOf(_class29).call(this, node)); + _this16 = _super28.call(this, node); _this16.horizAdvX = _this16.attribute('horiz-adv-x').numValue(); _this16.unicode = _this16.attribute('unicode').value; _this16.arabicForm = _this16.attribute('arabic-form').value; @@ -3483,10 +3566,12 @@ var svgEditorExtension_server_moinsave = (function () { svg.Element.text = /*#__PURE__*/function (_svg$Element$Rendered3) { _inherits(_class30, _svg$Element$Rendered3); + var _super29 = _createSuper(_class30); + function _class30(node) { _classCallCheck(this, _class30); - return _possibleConstructorReturn(this, _getPrototypeOf(_class30).call(this, node, true)); + return _super29.call(this, node, true); } _createClass(_class30, [{ @@ -3579,10 +3664,12 @@ var svgEditorExtension_server_moinsave = (function () { svg.Element.TextElementBase = /*#__PURE__*/function (_svg$Element$Rendered4) { _inherits(_class31, _svg$Element$Rendered4); + var _super30 = _createSuper(_class31); + function _class31() { _classCallCheck(this, _class31); - return _possibleConstructorReturn(this, _getPrototypeOf(_class31).apply(this, arguments)); + return _super30.apply(this, arguments); } _createClass(_class31, [{ @@ -3703,12 +3790,14 @@ var svgEditorExtension_server_moinsave = (function () { svg.Element.tspan = /*#__PURE__*/function (_svg$Element$TextElem) { _inherits(_class32, _svg$Element$TextElem); + var _super31 = _createSuper(_class32); + function _class32(node) { var _this18; _classCallCheck(this, _class32); - _this18 = _possibleConstructorReturn(this, _getPrototypeOf(_class32).call(this, node, true)); + _this18 = _super31.call(this, node, true); _this18.text = node.nodeValue || node.text || ''; return _this18; } @@ -3727,10 +3816,12 @@ var svgEditorExtension_server_moinsave = (function () { svg.Element.tref = /*#__PURE__*/function (_svg$Element$TextElem2) { _inherits(_class33, _svg$Element$TextElem2); + var _super32 = _createSuper(_class33); + function _class33() { _classCallCheck(this, _class33); - return _possibleConstructorReturn(this, _getPrototypeOf(_class33).apply(this, arguments)); + return _super32.apply(this, arguments); } _createClass(_class33, [{ @@ -3749,12 +3840,14 @@ var svgEditorExtension_server_moinsave = (function () { svg.Element.a = /*#__PURE__*/function (_svg$Element$TextElem3) { _inherits(_class34, _svg$Element$TextElem3); + var _super33 = _createSuper(_class34); + function _class34(node) { var _this19; _classCallCheck(this, _class34); - _this19 = _possibleConstructorReturn(this, _getPrototypeOf(_class34).call(this, node)); + _this19 = _super33.call(this, node); _this19.hasText = true; _toConsumableArray(node.childNodes).forEach(function (childNode) { @@ -3809,12 +3902,14 @@ var svgEditorExtension_server_moinsave = (function () { svg.Element.image = /*#__PURE__*/function (_svg$Element$Rendered5) { _inherits(_class35, _svg$Element$Rendered5); + var _super34 = _createSuper(_class35); + function _class35(node) { var _this20; _classCallCheck(this, _class35); - _this20 = _possibleConstructorReturn(this, _getPrototypeOf(_class35).call(this, node)); + _this20 = _super34.call(this, node); var href = _this20.getHrefAttribute().value; @@ -3896,10 +3991,12 @@ var svgEditorExtension_server_moinsave = (function () { svg.Element.g = /*#__PURE__*/function (_svg$Element$Rendered6) { _inherits(_class36, _svg$Element$Rendered6); + var _super35 = _createSuper(_class36); + function _class36() { _classCallCheck(this, _class36); - return _possibleConstructorReturn(this, _getPrototypeOf(_class36).apply(this, arguments)); + return _super35.apply(this, arguments); } _createClass(_class36, [{ @@ -3920,10 +4017,12 @@ var svgEditorExtension_server_moinsave = (function () { svg.Element.symbol = /*#__PURE__*/function (_svg$Element$Rendered7) { _inherits(_class37, _svg$Element$Rendered7); + var _super36 = _createSuper(_class37); + function _class37() { _classCallCheck(this, _class37); - return _possibleConstructorReturn(this, _getPrototypeOf(_class37).apply(this, arguments)); + return _super36.apply(this, arguments); } _createClass(_class37, [{ @@ -3939,12 +4038,14 @@ var svgEditorExtension_server_moinsave = (function () { svg.Element.style = /*#__PURE__*/function (_svg$Element$ElementB10) { _inherits(_class38, _svg$Element$ElementB10); + var _super37 = _createSuper(_class38); + function _class38(node) { var _this21; _classCallCheck(this, _class38); - _this21 = _possibleConstructorReturn(this, _getPrototypeOf(_class38).call(this, node)); // text, or spaces then CDATA + _this21 = _super37.call(this, node); // text, or spaces then CDATA var css = ''; @@ -4017,12 +4118,14 @@ var svgEditorExtension_server_moinsave = (function () { svg.Element.use = /*#__PURE__*/function (_svg$Element$Rendered8) { _inherits(_class39, _svg$Element$Rendered8); + var _super38 = _createSuper(_class39); + function _class39(node) { var _this22; _classCallCheck(this, _class39); - _this22 = _possibleConstructorReturn(this, _getPrototypeOf(_class39).call(this, node)); + _this22 = _super38.call(this, node); _this22._el = _this22.getHrefAttribute().getDefinition(); return _this22; } @@ -4087,10 +4190,12 @@ var svgEditorExtension_server_moinsave = (function () { svg.Element.mask = /*#__PURE__*/function (_svg$Element$ElementB11) { _inherits(_class40, _svg$Element$ElementB11); + var _super39 = _createSuper(_class40); + function _class40() { _classCallCheck(this, _class40); - return _possibleConstructorReturn(this, _getPrototypeOf(_class40).apply(this, arguments)); + return _super39.apply(this, arguments); } _createClass(_class40, [{ @@ -4147,10 +4252,12 @@ var svgEditorExtension_server_moinsave = (function () { svg.Element.clipPath = /*#__PURE__*/function (_svg$Element$ElementB12) { _inherits(_class41, _svg$Element$ElementB12); + var _super40 = _createSuper(_class41); + function _class41() { _classCallCheck(this, _class41); - return _possibleConstructorReturn(this, _getPrototypeOf(_class41).apply(this, arguments)); + return _super40.apply(this, arguments); } _createClass(_class41, [{ @@ -4187,10 +4294,12 @@ var svgEditorExtension_server_moinsave = (function () { svg.Element.filter = /*#__PURE__*/function (_svg$Element$ElementB13) { _inherits(_class42, _svg$Element$ElementB13); + var _super41 = _createSuper(_class42); + function _class42() { _classCallCheck(this, _class42); - return _possibleConstructorReturn(this, _getPrototypeOf(_class42).apply(this, arguments)); + return _super41.apply(this, arguments); } _createClass(_class42, [{ @@ -4239,10 +4348,12 @@ var svgEditorExtension_server_moinsave = (function () { svg.Element.feMorphology = /*#__PURE__*/function (_svg$Element$ElementB14) { _inherits(_class43, _svg$Element$ElementB14); + var _super42 = _createSuper(_class43); + function _class43() { _classCallCheck(this, _class43); - return _possibleConstructorReturn(this, _getPrototypeOf(_class43).apply(this, arguments)); + return _super42.apply(this, arguments); } _createClass(_class43, [{ @@ -4257,10 +4368,12 @@ var svgEditorExtension_server_moinsave = (function () { svg.Element.feComposite = /*#__PURE__*/function (_svg$Element$ElementB15) { _inherits(_class44, _svg$Element$ElementB15); + var _super43 = _createSuper(_class44); + function _class44() { _classCallCheck(this, _class44); - return _possibleConstructorReturn(this, _getPrototypeOf(_class44).apply(this, arguments)); + return _super43.apply(this, arguments); } _createClass(_class44, [{ @@ -4304,12 +4417,14 @@ var svgEditorExtension_server_moinsave = (function () { svg.Element.feColorMatrix = /*#__PURE__*/function (_svg$Element$ElementB16) { _inherits(_class45, _svg$Element$ElementB16); + var _super44 = _createSuper(_class45); + function _class45(node) { var _this23; _classCallCheck(this, _class45); - _this23 = _possibleConstructorReturn(this, _getPrototypeOf(_class45).call(this, node)); + _this23 = _super44.call(this, node); var matrix = svg.ToNumberArray(_this23.attribute('values').value); switch (_this23.attribute('type').valueOrDefault('matrix')) { @@ -4379,12 +4494,14 @@ var svgEditorExtension_server_moinsave = (function () { svg.Element.feGaussianBlur = /*#__PURE__*/function (_svg$Element$ElementB17) { _inherits(_class46, _svg$Element$ElementB17); + var _super45 = _createSuper(_class46); + function _class46(node) { var _this24; _classCallCheck(this, _class46); - _this24 = _possibleConstructorReturn(this, _getPrototypeOf(_class46).call(this, node)); + _this24 = _super45.call(this, node); _this24.blurRadius = Math.floor(_this24.attribute('stdDeviation').numValue()); _this24.extraFilterDistance = _this24.blurRadius; return _this24; @@ -4410,10 +4527,12 @@ var svgEditorExtension_server_moinsave = (function () { svg.Element.title = /*#__PURE__*/function (_svg$Element$ElementB18) { _inherits(_class47, _svg$Element$ElementB18); + var _super46 = _createSuper(_class47); + function _class47(node) { _classCallCheck(this, _class47); - return _possibleConstructorReturn(this, _getPrototypeOf(_class47).call(this)); + return _super46.call(this); } return _class47; @@ -4423,10 +4542,12 @@ var svgEditorExtension_server_moinsave = (function () { svg.Element.desc = /*#__PURE__*/function (_svg$Element$ElementB19) { _inherits(_class48, _svg$Element$ElementB19); + var _super47 = _createSuper(_class48); + function _class48(node) { _classCallCheck(this, _class48); - return _possibleConstructorReturn(this, _getPrototypeOf(_class48).call(this)); + return _super47.call(this); } return _class48; @@ -4435,12 +4556,14 @@ var svgEditorExtension_server_moinsave = (function () { svg.Element.MISSING = /*#__PURE__*/function (_svg$Element$ElementB20) { _inherits(_class49, _svg$Element$ElementB20); + var _super48 = _createSuper(_class49); + function _class49(node) { var _this25; _classCallCheck(this, _class49); - _this25 = _possibleConstructorReturn(this, _getPrototypeOf(_class49).call(this)); + _this25 = _super48.call(this); svg.log('ERROR: Element \'' + node.nodeName + '\' not yet implemented.'); return _this25; } @@ -4773,19 +4896,17 @@ var svgEditorExtension_server_moinsave = (function () { init: function init(_ref) { var _this = this; - var $ = _ref.$, - encode64 = _ref.encode64, - importLocale = _ref.importLocale; return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() { - var strings, svgEditor, svgCanvas, saveSvgAction; + var $, encode64, importLocale, strings, svgEditor, svgCanvas, saveSvgAction; return regeneratorRuntime.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: - _context2.next = 2; + $ = _ref.$, encode64 = _ref.encode64, importLocale = _ref.importLocale; + _context2.next = 3; return importLocale(); - case 2: + case 3: strings = _context2.sent; svgEditor = _this; svgCanvas = svgEditor.canvas; @@ -4799,14 +4920,14 @@ var svgEditorExtension_server_moinsave = (function () { svgEditor.setCustomHandlers({ save: function save(win, data) { return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() { - var svg, _ref2, pathname, name, svgData, c, datauri, pngData; + var svg, _URL, pathname, name, svgData, c, datauri, pngData; return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: svg = '\n' + data; - _ref2 = new URL(location), pathname = _ref2.pathname; + _URL = new URL(location), pathname = _URL.pathname; name = pathname.replace(/\/+get\//, ''); svgData = encode64(svg); @@ -4847,7 +4968,7 @@ var svgEditorExtension_server_moinsave = (function () { } }); - case 8: + case 9: case "end": return _context2.stop(); } diff --git a/dist/extensions/ext-server_opensave.js b/dist/extensions/ext-server_opensave.js index 5f192695..fdcfb801 100644 --- a/dist/extensions/ext-server_opensave.js +++ b/dist/extensions/ext-server_opensave.js @@ -106,7 +106,7 @@ var svgEditorExtension_server_opensave = (function () { return _setPrototypeOf(o, p); } - function isNativeReflectConstruct() { + function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; @@ -120,7 +120,7 @@ var svgEditorExtension_server_opensave = (function () { } function _construct(Parent, args, Class) { - if (isNativeReflectConstruct()) { + if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { @@ -152,6 +152,23 @@ var svgEditorExtension_server_opensave = (function () { return _assertThisInitialized(self); } + function _createSuper(Derived) { + return function () { + var Super = _getPrototypeOf(Derived), + result; + + if (_isNativeReflectConstruct()) { + var NewTarget = _getPrototypeOf(this).constructor; + + result = Reflect.construct(Super, arguments, NewTarget); + } else { + result = Super.apply(this, arguments); + } + + return _possibleConstructorReturn(this, result); + }; + } + function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); @@ -183,19 +200,15 @@ var svgEditorExtension_server_opensave = (function () { } function _slicedToArray(arr, i) { - return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); + return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _toConsumableArray(arr) { - return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) { - for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; - - return arr2; - } + if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _arrayWithHoles(arr) { @@ -203,14 +216,11 @@ var svgEditorExtension_server_opensave = (function () { } function _iterableToArray(iter) { - if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); + if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); } function _iterableToArrayLimit(arr, i) { - if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { - return; - } - + if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; @@ -236,12 +246,29 @@ var svgEditorExtension_server_opensave = (function () { return _arr; } + function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(n); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); + } + + function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; + + return arr2; + } + function _nonIterableSpread() { - throw new TypeError("Invalid attempt to spread non-iterable instance"); + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _nonIterableRest() { - throw new TypeError("Invalid attempt to destructure non-iterable instance"); + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } /** @@ -1658,12 +1685,14 @@ var svgEditorExtension_server_opensave = (function () { SkewBase: /*#__PURE__*/function (_this$Type$matrix) { _inherits(SkewBase, _this$Type$matrix); + var _super = _createSuper(SkewBase); + function SkewBase(s) { var _this3; _classCallCheck(this, SkewBase); - _this3 = _possibleConstructorReturn(this, _getPrototypeOf(SkewBase).call(this, s)); + _this3 = _super.call(this, s); _this3.angle = new svg.Property('angle', s); return _this3; } @@ -1675,12 +1704,14 @@ var svgEditorExtension_server_opensave = (function () { skewX: /*#__PURE__*/function (_this$Type$SkewBase) { _inherits(skewX, _this$Type$SkewBase); + var _super2 = _createSuper(skewX); + function skewX(s) { var _this4; _classCallCheck(this, skewX); - _this4 = _possibleConstructorReturn(this, _getPrototypeOf(skewX).call(this, s)); + _this4 = _super2.call(this, s); _this4.m = [1, 0, Math.tan(_this4.angle.toRadians()), 1, 0, 0]; return _this4; } @@ -1690,12 +1721,14 @@ var svgEditorExtension_server_opensave = (function () { skewY: /*#__PURE__*/function (_this$Type$SkewBase2) { _inherits(skewY, _this$Type$SkewBase2); + var _super3 = _createSuper(skewY); + function skewY(s) { var _this5; _classCallCheck(this, skewY); - _this5 = _possibleConstructorReturn(this, _getPrototypeOf(skewY).call(this, s)); + _this5 = _super3.call(this, s); _this5.m = [1, Math.tan(_this5.angle.toRadians()), 0, 1, 0, 0]; return _this5; } @@ -2029,10 +2062,12 @@ var svgEditorExtension_server_opensave = (function () { svg.Element.RenderedElementBase = /*#__PURE__*/function (_svg$Element$ElementB) { _inherits(_class5, _svg$Element$ElementB); + var _super4 = _createSuper(_class5); + function _class5() { _classCallCheck(this, _class5); - return _possibleConstructorReturn(this, _getPrototypeOf(_class5).apply(this, arguments)); + return _super4.apply(this, arguments); } _createClass(_class5, [{ @@ -2134,10 +2169,12 @@ var svgEditorExtension_server_opensave = (function () { svg.Element.PathElementBase = /*#__PURE__*/function (_svg$Element$Rendered) { _inherits(_class6, _svg$Element$Rendered); + var _super5 = _createSuper(_class6); + function _class6() { _classCallCheck(this, _class6); - return _possibleConstructorReturn(this, _getPrototypeOf(_class6).apply(this, arguments)); + return _super5.apply(this, arguments); } _createClass(_class6, [{ @@ -2203,10 +2240,12 @@ var svgEditorExtension_server_opensave = (function () { svg.Element.svg = /*#__PURE__*/function (_svg$Element$Rendered2) { _inherits(_class7, _svg$Element$Rendered2); + var _super6 = _createSuper(_class7); + function _class7() { _classCallCheck(this, _class7); - return _possibleConstructorReturn(this, _getPrototypeOf(_class7).apply(this, arguments)); + return _super6.apply(this, arguments); } _createClass(_class7, [{ @@ -2284,10 +2323,12 @@ var svgEditorExtension_server_opensave = (function () { svg.Element.rect = /*#__PURE__*/function (_svg$Element$PathElem) { _inherits(_class8, _svg$Element$PathElem); + var _super7 = _createSuper(_class8); + function _class8() { _classCallCheck(this, _class8); - return _possibleConstructorReturn(this, _getPrototypeOf(_class8).apply(this, arguments)); + return _super7.apply(this, arguments); } _createClass(_class8, [{ @@ -2329,10 +2370,12 @@ var svgEditorExtension_server_opensave = (function () { svg.Element.circle = /*#__PURE__*/function (_svg$Element$PathElem2) { _inherits(_class9, _svg$Element$PathElem2); + var _super8 = _createSuper(_class9); + function _class9() { _classCallCheck(this, _class9); - return _possibleConstructorReturn(this, _getPrototypeOf(_class9).apply(this, arguments)); + return _super8.apply(this, arguments); } _createClass(_class9, [{ @@ -2361,10 +2404,12 @@ var svgEditorExtension_server_opensave = (function () { svg.Element.ellipse = /*#__PURE__*/function (_svg$Element$PathElem3) { _inherits(_class10, _svg$Element$PathElem3); + var _super9 = _createSuper(_class10); + function _class10() { _classCallCheck(this, _class10); - return _possibleConstructorReturn(this, _getPrototypeOf(_class10).apply(this, arguments)); + return _super9.apply(this, arguments); } _createClass(_class10, [{ @@ -2396,10 +2441,12 @@ var svgEditorExtension_server_opensave = (function () { svg.Element.line = /*#__PURE__*/function (_svg$Element$PathElem4) { _inherits(_class11, _svg$Element$PathElem4); + var _super10 = _createSuper(_class11); + function _class11() { _classCallCheck(this, _class11); - return _possibleConstructorReturn(this, _getPrototypeOf(_class11).apply(this, arguments)); + return _super10.apply(this, arguments); } _createClass(_class11, [{ @@ -2436,12 +2483,14 @@ var svgEditorExtension_server_opensave = (function () { svg.Element.polyline = /*#__PURE__*/function (_svg$Element$PathElem5) { _inherits(_class12, _svg$Element$PathElem5); + var _super11 = _createSuper(_class12); + function _class12(node) { var _this8; _classCallCheck(this, _class12); - _this8 = _possibleConstructorReturn(this, _getPrototypeOf(_class12).call(this, node)); + _this8 = _super11.call(this, node); _this8.points = svg.CreatePath(_this8.attribute('points').value); return _this8; } @@ -2490,10 +2539,12 @@ var svgEditorExtension_server_opensave = (function () { svg.Element.polygon = /*#__PURE__*/function (_svg$Element$polyline) { _inherits(_class13, _svg$Element$polyline); + var _super12 = _createSuper(_class13); + function _class13() { _classCallCheck(this, _class13); - return _possibleConstructorReturn(this, _getPrototypeOf(_class13).apply(this, arguments)); + return _super12.apply(this, arguments); } _createClass(_class13, [{ @@ -2517,12 +2568,14 @@ var svgEditorExtension_server_opensave = (function () { svg.Element.path = /*#__PURE__*/function (_svg$Element$PathElem6) { _inherits(_class14, _svg$Element$PathElem6); + var _super13 = _createSuper(_class14); + function _class14(node) { var _this9; _classCallCheck(this, _class14); - _this9 = _possibleConstructorReturn(this, _getPrototypeOf(_class14).call(this, node)); + _this9 = _super13.call(this, node); var d = _this9.attribute('d').value // TODO: convert to real lexer based on https://www.w3.org/TR/SVG11/paths.html#PathDataBNF .replace(/,/gm, ' ') // get rid of all commas @@ -2894,10 +2947,12 @@ var svgEditorExtension_server_opensave = (function () { svg.Element.pattern = /*#__PURE__*/function (_svg$Element$ElementB2) { _inherits(_class15, _svg$Element$ElementB2); + var _super14 = _createSuper(_class15); + function _class15() { _classCallCheck(this, _class15); - return _possibleConstructorReturn(this, _getPrototypeOf(_class15).apply(this, arguments)); + return _super14.apply(this, arguments); } _createClass(_class15, [{ @@ -2943,10 +2998,12 @@ var svgEditorExtension_server_opensave = (function () { svg.Element.marker = /*#__PURE__*/function (_svg$Element$ElementB3) { _inherits(_class16, _svg$Element$ElementB3); + var _super15 = _createSuper(_class16); + function _class16() { _classCallCheck(this, _class16); - return _possibleConstructorReturn(this, _getPrototypeOf(_class16).apply(this, arguments)); + return _super15.apply(this, arguments); } _createClass(_class16, [{ @@ -2981,10 +3038,12 @@ var svgEditorExtension_server_opensave = (function () { svg.Element.defs = /*#__PURE__*/function (_svg$Element$ElementB4) { _inherits(_class17, _svg$Element$ElementB4); + var _super16 = _createSuper(_class17); + function _class17() { _classCallCheck(this, _class17); - return _possibleConstructorReturn(this, _getPrototypeOf(_class17).apply(this, arguments)); + return _super16.apply(this, arguments); } _createClass(_class17, [{ @@ -3000,12 +3059,14 @@ var svgEditorExtension_server_opensave = (function () { svg.Element.GradientBase = /*#__PURE__*/function (_svg$Element$ElementB5) { _inherits(_class18, _svg$Element$ElementB5); + var _super17 = _createSuper(_class18); + function _class18(node) { var _this10; _classCallCheck(this, _class18); - _this10 = _possibleConstructorReturn(this, _getPrototypeOf(_class18).call(this, node)); + _this10 = _super17.call(this, node); _this10.gradientUnits = _this10.attribute('gradientUnits').valueOrDefault('objectBoundingBox'); _this10.stops = []; @@ -3081,10 +3142,12 @@ var svgEditorExtension_server_opensave = (function () { svg.Element.linearGradient = /*#__PURE__*/function (_svg$Element$Gradient) { _inherits(_class19, _svg$Element$Gradient); + var _super18 = _createSuper(_class19); + function _class19() { _classCallCheck(this, _class19); - return _possibleConstructorReturn(this, _getPrototypeOf(_class19).apply(this, arguments)); + return _super18.apply(this, arguments); } _createClass(_class19, [{ @@ -3116,10 +3179,12 @@ var svgEditorExtension_server_opensave = (function () { svg.Element.radialGradient = /*#__PURE__*/function (_svg$Element$Gradient2) { _inherits(_class20, _svg$Element$Gradient2); + var _super19 = _createSuper(_class20); + function _class20() { _classCallCheck(this, _class20); - return _possibleConstructorReturn(this, _getPrototypeOf(_class20).apply(this, arguments)); + return _super19.apply(this, arguments); } _createClass(_class20, [{ @@ -3155,12 +3220,14 @@ var svgEditorExtension_server_opensave = (function () { svg.Element.stop = /*#__PURE__*/function (_svg$Element$ElementB6) { _inherits(_class21, _svg$Element$ElementB6); + var _super20 = _createSuper(_class21); + function _class21(node) { var _this11; _classCallCheck(this, _class21); - _this11 = _possibleConstructorReturn(this, _getPrototypeOf(_class21).call(this, node)); + _this11 = _super20.call(this, node); _this11.offset = _this11.attribute('offset').numValue(); if (_this11.offset < 0) _this11.offset = 0; if (_this11.offset > 1) _this11.offset = 1; @@ -3182,12 +3249,14 @@ var svgEditorExtension_server_opensave = (function () { svg.Element.AnimateBase = /*#__PURE__*/function (_svg$Element$ElementB7) { _inherits(_class22, _svg$Element$ElementB7); + var _super21 = _createSuper(_class22); + function _class22(node) { var _this12; _classCallCheck(this, _class22); - _this12 = _possibleConstructorReturn(this, _getPrototypeOf(_class22).call(this, node)); + _this12 = _super21.call(this, node); svg.Animations.push(_assertThisInitialized(_this12)); _this12.duration = 0.0; _this12.begin = _this12.attribute('begin').toMilliseconds(); @@ -3297,10 +3366,12 @@ var svgEditorExtension_server_opensave = (function () { svg.Element.animate = /*#__PURE__*/function (_svg$Element$AnimateB) { _inherits(_class23, _svg$Element$AnimateB); + var _super22 = _createSuper(_class23); + function _class23() { _classCallCheck(this, _class23); - return _possibleConstructorReturn(this, _getPrototypeOf(_class23).apply(this, arguments)); + return _super22.apply(this, arguments); } _createClass(_class23, [{ @@ -3320,10 +3391,12 @@ var svgEditorExtension_server_opensave = (function () { svg.Element.animateColor = /*#__PURE__*/function (_svg$Element$AnimateB2) { _inherits(_class24, _svg$Element$AnimateB2); + var _super23 = _createSuper(_class24); + function _class24() { _classCallCheck(this, _class24); - return _possibleConstructorReturn(this, _getPrototypeOf(_class24).apply(this, arguments)); + return _super23.apply(this, arguments); } _createClass(_class24, [{ @@ -3352,10 +3425,12 @@ var svgEditorExtension_server_opensave = (function () { svg.Element.animateTransform = /*#__PURE__*/function (_svg$Element$animate) { _inherits(_class25, _svg$Element$animate); + var _super24 = _createSuper(_class25); + function _class25() { _classCallCheck(this, _class25); - return _possibleConstructorReturn(this, _getPrototypeOf(_class25).apply(this, arguments)); + return _super24.apply(this, arguments); } _createClass(_class25, [{ @@ -3380,12 +3455,14 @@ var svgEditorExtension_server_opensave = (function () { svg.Element.font = /*#__PURE__*/function (_svg$Element$ElementB8) { _inherits(_class26, _svg$Element$ElementB8); + var _super25 = _createSuper(_class26); + function _class26(node) { var _this13; _classCallCheck(this, _class26); - _this13 = _possibleConstructorReturn(this, _getPrototypeOf(_class26).call(this, node)); + _this13 = _super25.call(this, node); _this13.horizAdvX = _this13.attribute('horiz-adv-x').numValue(); _this13.isRTL = false; _this13.isArabic = false; @@ -3428,12 +3505,14 @@ var svgEditorExtension_server_opensave = (function () { svg.Element.fontface = /*#__PURE__*/function (_svg$Element$ElementB9) { _inherits(_class27, _svg$Element$ElementB9); + var _super26 = _createSuper(_class27); + function _class27(node) { var _this14; _classCallCheck(this, _class27); - _this14 = _possibleConstructorReturn(this, _getPrototypeOf(_class27).call(this, node)); + _this14 = _super26.call(this, node); _this14.ascent = _this14.attribute('ascent').value; _this14.descent = _this14.attribute('descent').value; _this14.unitsPerEm = _this14.attribute('units-per-em').numValue(); @@ -3447,12 +3526,14 @@ var svgEditorExtension_server_opensave = (function () { svg.Element.missingglyph = /*#__PURE__*/function (_svg$Element$path) { _inherits(_class28, _svg$Element$path); + var _super27 = _createSuper(_class28); + function _class28(node) { var _this15; _classCallCheck(this, _class28); - _this15 = _possibleConstructorReturn(this, _getPrototypeOf(_class28).call(this, node)); + _this15 = _super27.call(this, node); _this15.horizAdvX = 0; return _this15; } @@ -3464,12 +3545,14 @@ var svgEditorExtension_server_opensave = (function () { svg.Element.glyph = /*#__PURE__*/function (_svg$Element$path2) { _inherits(_class29, _svg$Element$path2); + var _super28 = _createSuper(_class29); + function _class29(node) { var _this16; _classCallCheck(this, _class29); - _this16 = _possibleConstructorReturn(this, _getPrototypeOf(_class29).call(this, node)); + _this16 = _super28.call(this, node); _this16.horizAdvX = _this16.attribute('horiz-adv-x').numValue(); _this16.unicode = _this16.attribute('unicode').value; _this16.arabicForm = _this16.attribute('arabic-form').value; @@ -3483,10 +3566,12 @@ var svgEditorExtension_server_opensave = (function () { svg.Element.text = /*#__PURE__*/function (_svg$Element$Rendered3) { _inherits(_class30, _svg$Element$Rendered3); + var _super29 = _createSuper(_class30); + function _class30(node) { _classCallCheck(this, _class30); - return _possibleConstructorReturn(this, _getPrototypeOf(_class30).call(this, node, true)); + return _super29.call(this, node, true); } _createClass(_class30, [{ @@ -3579,10 +3664,12 @@ var svgEditorExtension_server_opensave = (function () { svg.Element.TextElementBase = /*#__PURE__*/function (_svg$Element$Rendered4) { _inherits(_class31, _svg$Element$Rendered4); + var _super30 = _createSuper(_class31); + function _class31() { _classCallCheck(this, _class31); - return _possibleConstructorReturn(this, _getPrototypeOf(_class31).apply(this, arguments)); + return _super30.apply(this, arguments); } _createClass(_class31, [{ @@ -3703,12 +3790,14 @@ var svgEditorExtension_server_opensave = (function () { svg.Element.tspan = /*#__PURE__*/function (_svg$Element$TextElem) { _inherits(_class32, _svg$Element$TextElem); + var _super31 = _createSuper(_class32); + function _class32(node) { var _this18; _classCallCheck(this, _class32); - _this18 = _possibleConstructorReturn(this, _getPrototypeOf(_class32).call(this, node, true)); + _this18 = _super31.call(this, node, true); _this18.text = node.nodeValue || node.text || ''; return _this18; } @@ -3727,10 +3816,12 @@ var svgEditorExtension_server_opensave = (function () { svg.Element.tref = /*#__PURE__*/function (_svg$Element$TextElem2) { _inherits(_class33, _svg$Element$TextElem2); + var _super32 = _createSuper(_class33); + function _class33() { _classCallCheck(this, _class33); - return _possibleConstructorReturn(this, _getPrototypeOf(_class33).apply(this, arguments)); + return _super32.apply(this, arguments); } _createClass(_class33, [{ @@ -3749,12 +3840,14 @@ var svgEditorExtension_server_opensave = (function () { svg.Element.a = /*#__PURE__*/function (_svg$Element$TextElem3) { _inherits(_class34, _svg$Element$TextElem3); + var _super33 = _createSuper(_class34); + function _class34(node) { var _this19; _classCallCheck(this, _class34); - _this19 = _possibleConstructorReturn(this, _getPrototypeOf(_class34).call(this, node)); + _this19 = _super33.call(this, node); _this19.hasText = true; _toConsumableArray(node.childNodes).forEach(function (childNode) { @@ -3809,12 +3902,14 @@ var svgEditorExtension_server_opensave = (function () { svg.Element.image = /*#__PURE__*/function (_svg$Element$Rendered5) { _inherits(_class35, _svg$Element$Rendered5); + var _super34 = _createSuper(_class35); + function _class35(node) { var _this20; _classCallCheck(this, _class35); - _this20 = _possibleConstructorReturn(this, _getPrototypeOf(_class35).call(this, node)); + _this20 = _super34.call(this, node); var href = _this20.getHrefAttribute().value; @@ -3896,10 +3991,12 @@ var svgEditorExtension_server_opensave = (function () { svg.Element.g = /*#__PURE__*/function (_svg$Element$Rendered6) { _inherits(_class36, _svg$Element$Rendered6); + var _super35 = _createSuper(_class36); + function _class36() { _classCallCheck(this, _class36); - return _possibleConstructorReturn(this, _getPrototypeOf(_class36).apply(this, arguments)); + return _super35.apply(this, arguments); } _createClass(_class36, [{ @@ -3920,10 +4017,12 @@ var svgEditorExtension_server_opensave = (function () { svg.Element.symbol = /*#__PURE__*/function (_svg$Element$Rendered7) { _inherits(_class37, _svg$Element$Rendered7); + var _super36 = _createSuper(_class37); + function _class37() { _classCallCheck(this, _class37); - return _possibleConstructorReturn(this, _getPrototypeOf(_class37).apply(this, arguments)); + return _super36.apply(this, arguments); } _createClass(_class37, [{ @@ -3939,12 +4038,14 @@ var svgEditorExtension_server_opensave = (function () { svg.Element.style = /*#__PURE__*/function (_svg$Element$ElementB10) { _inherits(_class38, _svg$Element$ElementB10); + var _super37 = _createSuper(_class38); + function _class38(node) { var _this21; _classCallCheck(this, _class38); - _this21 = _possibleConstructorReturn(this, _getPrototypeOf(_class38).call(this, node)); // text, or spaces then CDATA + _this21 = _super37.call(this, node); // text, or spaces then CDATA var css = ''; @@ -4017,12 +4118,14 @@ var svgEditorExtension_server_opensave = (function () { svg.Element.use = /*#__PURE__*/function (_svg$Element$Rendered8) { _inherits(_class39, _svg$Element$Rendered8); + var _super38 = _createSuper(_class39); + function _class39(node) { var _this22; _classCallCheck(this, _class39); - _this22 = _possibleConstructorReturn(this, _getPrototypeOf(_class39).call(this, node)); + _this22 = _super38.call(this, node); _this22._el = _this22.getHrefAttribute().getDefinition(); return _this22; } @@ -4087,10 +4190,12 @@ var svgEditorExtension_server_opensave = (function () { svg.Element.mask = /*#__PURE__*/function (_svg$Element$ElementB11) { _inherits(_class40, _svg$Element$ElementB11); + var _super39 = _createSuper(_class40); + function _class40() { _classCallCheck(this, _class40); - return _possibleConstructorReturn(this, _getPrototypeOf(_class40).apply(this, arguments)); + return _super39.apply(this, arguments); } _createClass(_class40, [{ @@ -4147,10 +4252,12 @@ var svgEditorExtension_server_opensave = (function () { svg.Element.clipPath = /*#__PURE__*/function (_svg$Element$ElementB12) { _inherits(_class41, _svg$Element$ElementB12); + var _super40 = _createSuper(_class41); + function _class41() { _classCallCheck(this, _class41); - return _possibleConstructorReturn(this, _getPrototypeOf(_class41).apply(this, arguments)); + return _super40.apply(this, arguments); } _createClass(_class41, [{ @@ -4187,10 +4294,12 @@ var svgEditorExtension_server_opensave = (function () { svg.Element.filter = /*#__PURE__*/function (_svg$Element$ElementB13) { _inherits(_class42, _svg$Element$ElementB13); + var _super41 = _createSuper(_class42); + function _class42() { _classCallCheck(this, _class42); - return _possibleConstructorReturn(this, _getPrototypeOf(_class42).apply(this, arguments)); + return _super41.apply(this, arguments); } _createClass(_class42, [{ @@ -4239,10 +4348,12 @@ var svgEditorExtension_server_opensave = (function () { svg.Element.feMorphology = /*#__PURE__*/function (_svg$Element$ElementB14) { _inherits(_class43, _svg$Element$ElementB14); + var _super42 = _createSuper(_class43); + function _class43() { _classCallCheck(this, _class43); - return _possibleConstructorReturn(this, _getPrototypeOf(_class43).apply(this, arguments)); + return _super42.apply(this, arguments); } _createClass(_class43, [{ @@ -4257,10 +4368,12 @@ var svgEditorExtension_server_opensave = (function () { svg.Element.feComposite = /*#__PURE__*/function (_svg$Element$ElementB15) { _inherits(_class44, _svg$Element$ElementB15); + var _super43 = _createSuper(_class44); + function _class44() { _classCallCheck(this, _class44); - return _possibleConstructorReturn(this, _getPrototypeOf(_class44).apply(this, arguments)); + return _super43.apply(this, arguments); } _createClass(_class44, [{ @@ -4304,12 +4417,14 @@ var svgEditorExtension_server_opensave = (function () { svg.Element.feColorMatrix = /*#__PURE__*/function (_svg$Element$ElementB16) { _inherits(_class45, _svg$Element$ElementB16); + var _super44 = _createSuper(_class45); + function _class45(node) { var _this23; _classCallCheck(this, _class45); - _this23 = _possibleConstructorReturn(this, _getPrototypeOf(_class45).call(this, node)); + _this23 = _super44.call(this, node); var matrix = svg.ToNumberArray(_this23.attribute('values').value); switch (_this23.attribute('type').valueOrDefault('matrix')) { @@ -4379,12 +4494,14 @@ var svgEditorExtension_server_opensave = (function () { svg.Element.feGaussianBlur = /*#__PURE__*/function (_svg$Element$ElementB17) { _inherits(_class46, _svg$Element$ElementB17); + var _super45 = _createSuper(_class46); + function _class46(node) { var _this24; _classCallCheck(this, _class46); - _this24 = _possibleConstructorReturn(this, _getPrototypeOf(_class46).call(this, node)); + _this24 = _super45.call(this, node); _this24.blurRadius = Math.floor(_this24.attribute('stdDeviation').numValue()); _this24.extraFilterDistance = _this24.blurRadius; return _this24; @@ -4410,10 +4527,12 @@ var svgEditorExtension_server_opensave = (function () { svg.Element.title = /*#__PURE__*/function (_svg$Element$ElementB18) { _inherits(_class47, _svg$Element$ElementB18); + var _super46 = _createSuper(_class47); + function _class47(node) { _classCallCheck(this, _class47); - return _possibleConstructorReturn(this, _getPrototypeOf(_class47).call(this)); + return _super46.call(this); } return _class47; @@ -4423,10 +4542,12 @@ var svgEditorExtension_server_opensave = (function () { svg.Element.desc = /*#__PURE__*/function (_svg$Element$ElementB19) { _inherits(_class48, _svg$Element$ElementB19); + var _super47 = _createSuper(_class48); + function _class48(node) { _classCallCheck(this, _class48); - return _possibleConstructorReturn(this, _getPrototypeOf(_class48).call(this)); + return _super47.call(this); } return _class48; @@ -4435,12 +4556,14 @@ var svgEditorExtension_server_opensave = (function () { svg.Element.MISSING = /*#__PURE__*/function (_svg$Element$ElementB20) { _inherits(_class49, _svg$Element$ElementB20); + var _super48 = _createSuper(_class49); + function _class49(node) { var _this25; _classCallCheck(this, _class49); - _this25 = _possibleConstructorReturn(this, _getPrototypeOf(_class49).call(this)); + _this25 = _super48.call(this); svg.log('ERROR: Element \'' + node.nodeName + '\' not yet implemented.'); return _this25; } @@ -4773,18 +4896,14 @@ var svgEditorExtension_server_opensave = (function () { init: function init(_ref) { var _this = this; - var $ = _ref.$, - decode64 = _ref.decode64, - encode64 = _ref.encode64, - importLocale = _ref.importLocale; return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() { - var strings, svgEditor, _svgEditor$curConfig, extPath, avoidClientSide, avoidClientSideDownload, avoidClientSideOpen, svgCanvas, getFileNameFromTitle, xhtmlEscape, clientDownloadSupport, saveSvgAction, saveImgAction, cancelled, openSvgAction, importSvgAction, importImgAction, openSvgForm, importSvgForm, importImgForm, rebuildInput; + var $, decode64, encode64, importLocale, strings, svgEditor, _svgEditor$curConfig, extPath, avoidClientSide, avoidClientSideDownload, avoidClientSideOpen, svgCanvas, getFileNameFromTitle, xhtmlEscape, clientDownloadSupport, saveSvgAction, saveImgAction, cancelled, openSvgAction, importSvgAction, importImgAction, openSvgForm, importSvgForm, importImgForm, rebuildInput; return regeneratorRuntime.wrap(function _callee5$(_context5) { while (1) { switch (_context5.prev = _context5.next) { case 0: - rebuildInput = function _ref7(form) { + rebuildInput = function _rebuildInput(form) { form.empty(); var inp = $('').appendTo(form); /** @@ -4874,7 +4993,7 @@ var svgEditorExtension_server_opensave = (function () { } }; - clientDownloadSupport = function _ref6(filename, suffix, uri) { + clientDownloadSupport = function _clientDownloadSuppor(filename, suffix, uri) { if (avoidClientSide || avoidClientSideDownload) { return false; } @@ -4894,20 +5013,21 @@ var svgEditorExtension_server_opensave = (function () { return false; }; - xhtmlEscape = function _ref5(str) { + xhtmlEscape = function _xhtmlEscape(str) { return str.replace(/&(?!amp;)/g, '&').replace(/"/g, '"').replace(/|]/g, '_'); }; - _context5.next = 6; + $ = _ref.$, decode64 = _ref.decode64, encode64 = _ref.encode64, importLocale = _ref.importLocale; + _context5.next = 7; return importLocale(); - case 6: + case 7: strings = _context5.sent; svgEditor = _this; _svgEditor$curConfig = svgEditor.curConfig, extPath = _svgEditor$curConfig.extPath, avoidClientSide = _svgEditor$curConfig.avoidClientSide, avoidClientSideDownload = _svgEditor$curConfig.avoidClientSideDownload, avoidClientSideOpen = _svgEditor$curConfig.avoidClientSideOpen, svgCanvas = svgEditor.canvas; @@ -5023,13 +5143,13 @@ var svgEditorExtension_server_opensave = (function () { }); // Do nothing if client support is found if (!(window.FileReader && !avoidClientSideOpen)) { - _context5.next = 15; + _context5.next = 16; break; } return _context5.abrupt("return"); - case 15: + case 16: // Change these to appropriate script file openSvgAction = extPath + 'fileopen.php?type=load_svg'; importSvgAction = extPath + 'fileopen.php?type=import_svg'; @@ -5096,7 +5216,7 @@ var svgEditorExtension_server_opensave = (function () { $('#tool_import').show().prepend(importSvgForm); $('#tool_image').prepend(importImgForm); - case 29: + case 30: case "end": return _context5.stop(); } diff --git a/dist/extensions/ext-shapes.js b/dist/extensions/ext-shapes.js index 4ef51e0f..ece28bfe 100644 --- a/dist/extensions/ext-shapes.js +++ b/dist/extensions/ext-shapes.js @@ -38,7 +38,7 @@ var svgEditorExtension_shapes = (function () { } function _slicedToArray(arr, i) { - return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); + return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _arrayWithHoles(arr) { @@ -46,10 +46,7 @@ var svgEditorExtension_shapes = (function () { } function _iterableToArrayLimit(arr, i) { - if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { - return; - } - + if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; @@ -75,8 +72,25 @@ var svgEditorExtension_shapes = (function () { return _arr; } + function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(n); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); + } + + function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; + + return arr2; + } + function _nonIterableRest() { - throw new TypeError("Invalid attempt to destructure non-iterable instance"); + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } /** @@ -92,15 +106,13 @@ var svgEditorExtension_shapes = (function () { init: function init(_ref) { var _this = this; - var $ = _ref.$, - importLocale = _ref.importLocale; return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() { - var strings, svgEditor, canv, svgroot, lastBBox, categories, library, modeId, startClientPos, currentD, curShapeId, curShape, startX, startY, curLib, loadIcons, makeButtons, loadLibrary, buttons; + var $, importLocale, strings, svgEditor, canv, svgroot, lastBBox, categories, library, modeId, startClientPos, currentD, curShapeId, curShape, startX, startY, curLib, loadIcons, makeButtons, loadLibrary, buttons; return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: - loadLibrary = function _ref8(catId) { + loadLibrary = function _loadLibrary(catId) { var lib = library[catId]; if (!lib) { @@ -126,7 +138,7 @@ var svgEditorExtension_shapes = (function () { loadIcons(); }; - makeButtons = function _ref7(cat, shapes) { + makeButtons = function _makeButtons(cat, shapes) { var size = curLib.size || 300; var fill = curLib.fill || false; var off = size * 0.05; @@ -155,14 +167,15 @@ var svgEditorExtension_shapes = (function () { }); }; - loadIcons = function _ref6() { + loadIcons = function _loadIcons() { $('#shape_buttons').empty().append(curLib.buttons); }; - _context.next = 5; + $ = _ref.$, importLocale = _ref.importLocale; + _context.next = 6; return importLocale(); - case 5: + case 6: strings = _context.sent; svgEditor = _this; canv = svgEditor.canvas; @@ -409,7 +422,7 @@ var svgEditorExtension_shapes = (function () { } }); - case 17: + case 18: case "end": return _context.stop(); } diff --git a/dist/extensions/ext-star.js b/dist/extensions/ext-star.js index bc909636..e1472116 100644 --- a/dist/extensions/ext-star.js +++ b/dist/extensions/ext-star.js @@ -55,12 +55,12 @@ var svgEditorExtension_star = (function () { while (1) { switch (_context.prev = _context.next) { case 0: - setAttr = function _ref2(attr, val) { + setAttr = function _setAttr(attr, val) { svgCanvas.changeSelectedAttribute(attr, val); svgCanvas.call('changed', selElems); }; - showPanel = function _ref(on) { + showPanel = function _showPanel(on) { var fcRules = $('#fc_rules'); if (!fcRules.length) { diff --git a/dist/extensions/ext-storage.js b/dist/extensions/ext-storage.js index a2b1f1c9..9ca66922 100644 --- a/dist/extensions/ext-storage.js +++ b/dist/extensions/ext-storage.js @@ -38,7 +38,7 @@ var svgEditorExtension_storage = (function () { } function _slicedToArray(arr, i) { - return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); + return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _arrayWithHoles(arr) { @@ -46,10 +46,7 @@ var svgEditorExtension_storage = (function () { } function _iterableToArrayLimit(arr, i) { - if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { - return; - } - + if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; @@ -75,8 +72,25 @@ var svgEditorExtension_storage = (function () { return _arr; } + function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(n); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); + } + + function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; + + return arr2; + } + function _nonIterableRest() { - throw new TypeError("Invalid attempt to destructure non-iterable instance"); + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } /** @@ -253,31 +267,31 @@ var svgEditorExtension_storage = (function () { return { name: 'storage', langReady: function langReady(_ref4) { - var importLocale = _ref4.importLocale; return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() { - var storagePrompt, confirmSetStorage, message, storagePrefsAndContent, storagePrefsOnly, storagePrefs, storageNoPrefsOrContent, storageNoPrefs, rememberLabel, rememberTooltip, options, oldContainerWidth, oldContainerMarginLeft, oldContentHeight, oldContainerHeight, _ref5, pref, checked; + var importLocale, storagePrompt, confirmSetStorage, message, storagePrefsAndContent, storagePrefsOnly, storagePrefs, storageNoPrefsOrContent, storageNoPrefs, rememberLabel, rememberTooltip, options, oldContainerWidth, oldContainerMarginLeft, oldContentHeight, oldContainerHeight, _yield$$$select, pref, checked; return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: + importLocale = _ref4.importLocale; storagePrompt = new URL(top.location).searchParams.get('storagePrompt'); - _context.next = 3; + _context.next = 4; return importLocale(); - case 3: + case 4: confirmSetStorage = _context.sent; message = confirmSetStorage.message, storagePrefsAndContent = confirmSetStorage.storagePrefsAndContent, storagePrefsOnly = confirmSetStorage.storagePrefsOnly, storagePrefs = confirmSetStorage.storagePrefs, storageNoPrefsOrContent = confirmSetStorage.storageNoPrefsOrContent, storageNoPrefs = confirmSetStorage.storageNoPrefs, rememberLabel = confirmSetStorage.rememberLabel, rememberTooltip = confirmSetStorage.rememberTooltip; // No need to run this one-time dialog again just because the user // changes the language if (!loaded) { - _context.next = 7; + _context.next = 8; break; } return _context.abrupt("return"); - case 7: + case 8: loaded = true; // Note that the following can load even if "noStorageOnLoad" is // set to false; to avoid any chance of storage, avoid this // extension! (and to avoid using any prior storage, set the @@ -293,7 +307,7 @@ var svgEditorExtension_storage = (function () { storagePrompt !== 'false' && // ...and this user hasn't previously indicated a desire for storage !document.cookie.match(/(?:^|;\s*)svgeditstore=(?:prefsAndContent|prefsOnly)/) // ...then show the storage prompt. ))) { - _context.next = 43; + _context.next = 44; break; } @@ -329,20 +343,20 @@ var svgEditorExtension_storage = (function () { // From svg-editor.js svgEditor.storagePromptState = 'waiting'; - _context.next = 19; + _context.next = 20; return $.select(message, options, null, null, { label: rememberLabel, checked: true, tooltip: rememberTooltip }); - case 19: - _ref5 = _context.sent; - pref = _ref5.response; - checked = _ref5.checked; + case 20: + _yield$$$select = _context.sent; + pref = _yield$$$select.response; + checked = _yield$$$select.checked; if (!(pref && pref !== 'noPrefsOrContent')) { - _context.next = 29; + _context.next = 30; break; } @@ -359,18 +373,18 @@ var svgEditorExtension_storage = (function () { // them instead to a URL which does not always prompt if (!(storagePrompt === 'true' && checked)) { - _context.next = 27; + _context.next = 28; break; } replaceStoragePrompt(); return _context.abrupt("return"); - case 27: - _context.next = 34; + case 28: + _context.next = 35; break; - case 29: + case 30: // The user does not wish storage (or cancelled, which we treat equivalently) removeStoragePrefCookie(); @@ -380,7 +394,7 @@ var svgEditorExtension_storage = (function () { } if (!(pref && checked)) { - _context.next = 34; + _context.next = 35; break; } @@ -388,7 +402,7 @@ var svgEditorExtension_storage = (function () { replaceStoragePrompt('false'); return _context.abrupt("return"); - case 34: + case 35: // Reset width/height of dialog (e.g., for use by Export) $('#dialog_container')[0].style.width = oldContainerWidth; $('#dialog_container')[0].style.marginLeft = oldContainerMarginLeft; @@ -405,15 +419,15 @@ var svgEditorExtension_storage = (function () { setupBeforeUnloadListener(); svgEditor.storagePromptState = 'closed'; updateCanvas(true); - _context.next = 44; + _context.next = 45; break; - case 43: + case 44: if (!noStorageOnLoad || forceStorage) { setupBeforeUnloadListener(); } - case 44: + case 45: case "end": return _context.stop(); } diff --git a/dist/extensions/ext-webappfind.js b/dist/extensions/ext-webappfind.js index d45cd692..b0ba8137 100644 --- a/dist/extensions/ext-webappfind.js +++ b/dist/extensions/ext-webappfind.js @@ -49,18 +49,17 @@ var svgEditorExtension_webappfind = (function () { init: function init(_ref) { var _this = this; - var importLocale = _ref.importLocale, - $ = _ref.$; return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() { - var strings, svgEditor, saveMessage, readMessage, excludedMessages, pathID, buttons; + var importLocale, $, strings, svgEditor, saveMessage, readMessage, excludedMessages, pathID, buttons; return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: - _context.next = 2; + importLocale = _ref.importLocale, $ = _ref.$; + _context.next = 3; return importLocale(); - case 2: + case 3: strings = _context.sent; svgEditor = _this; saveMessage = 'save', readMessage = 'read', excludedMessages = [readMessage, saveMessage]; @@ -162,7 +161,7 @@ var svgEditorExtension_webappfind = (function () { }) }); - case 8: + case 9: case "end": return _context.stop(); } diff --git a/dist/extensions/ext-xdomain-messaging.js b/dist/extensions/ext-xdomain-messaging.js index 7715909a..fa47ff12 100644 --- a/dist/extensions/ext-xdomain-messaging.js +++ b/dist/extensions/ext-xdomain-messaging.js @@ -18,23 +18,36 @@ var svgEditorExtension_xdomain_messaging = (function () { } function _toConsumableArray(arr) { - return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) { - for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; - - return arr2; - } + if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _iterableToArray(iter) { - if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); + if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); + } + + function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(n); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); + } + + function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; + + return arr2; } function _nonIterableSpread() { - throw new TypeError("Invalid attempt to spread non-iterable instance"); + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } /** diff --git a/dist/extensions/imagelib/openclipart.js b/dist/extensions/imagelib/openclipart.js index 7b972cf0..2e3a262d 100644 --- a/dist/extensions/imagelib/openclipart.js +++ b/dist/extensions/imagelib/openclipart.js @@ -108,7 +108,7 @@ return _setPrototypeOf(o, p); } - function isNativeReflectConstruct() { + function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; @@ -122,7 +122,7 @@ } function _construct(Parent, args, Class) { - if (isNativeReflectConstruct()) { + if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { @@ -192,20 +192,33 @@ return _assertThisInitialized(self); } + function _createSuper(Derived) { + return function () { + var Super = _getPrototypeOf(Derived), + result; + + if (_isNativeReflectConstruct()) { + var NewTarget = _getPrototypeOf(this).constructor; + + result = Reflect.construct(Super, arguments, NewTarget); + } else { + result = Super.apply(this, arguments); + } + + return _possibleConstructorReturn(this, result); + }; + } + function _slicedToArray(arr, i) { - return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); + return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _toConsumableArray(arr) { - return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) { - for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; - - return arr2; - } + if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _arrayWithHoles(arr) { @@ -213,14 +226,11 @@ } function _iterableToArray(iter) { - if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); + if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); } function _iterableToArrayLimit(arr, i) { - if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { - return; - } - + if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; @@ -246,12 +256,29 @@ return _arr; } + function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(n); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); + } + + function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; + + return arr2; + } + function _nonIterableSpread() { - throw new TypeError("Invalid attempt to spread non-iterable instance"); + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _nonIterableRest() { - throw new TypeError("Invalid attempt to destructure non-iterable instance"); + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _typeof$1(obj) { @@ -372,7 +399,7 @@ return _setPrototypeOf$1(o, p); } - function isNativeReflectConstruct$1() { + function isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; @@ -386,7 +413,7 @@ } function _construct$1(Parent, args, Class) { - if (isNativeReflectConstruct$1()) { + if (isNativeReflectConstruct()) { _construct$1 = Reflect.construct; } else { _construct$1 = function _construct(Parent, args, Class) { @@ -2628,10 +2655,12 @@ var QueryResult = /*#__PURE__*/function (_Array) { _inherits(QueryResult, _Array); + var _super = _createSuper(QueryResult); + function QueryResult() { _classCallCheck(this, QueryResult); - return _possibleConstructorReturn(this, _getPrototypeOf(QueryResult).apply(this, arguments)); + return _super.apply(this, arguments); } return QueryResult; @@ -3352,7 +3381,7 @@ while (1) { switch (_context3.prev = _context3.next) { case 0: - queryLink = function _ref4(query) { + queryLink = function _queryLink(query) { return ['a', { href: jsVoid, dataset: { diff --git a/dist/index-es.js b/dist/index-es.js index f41e7eb7..a1b3df65 100644 --- a/dist/index-es.js +++ b/dist/index-es.js @@ -121,6 +121,19 @@ function _setPrototypeOf(o, p) { return _setPrototypeOf(o, p); } +function _isNativeReflectConstruct() { + if (typeof Reflect === "undefined" || !Reflect.construct) return false; + if (Reflect.construct.sham) return false; + if (typeof Proxy === "function") return true; + + try { + Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); + return true; + } catch (e) { + return false; + } +} + function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); @@ -137,20 +150,33 @@ function _possibleConstructorReturn(self, call) { return _assertThisInitialized(self); } +function _createSuper(Derived) { + return function () { + var Super = _getPrototypeOf(Derived), + result; + + if (_isNativeReflectConstruct()) { + var NewTarget = _getPrototypeOf(this).constructor; + + result = Reflect.construct(Super, arguments, NewTarget); + } else { + result = Super.apply(this, arguments); + } + + return _possibleConstructorReturn(this, result); + }; +} + function _slicedToArray(arr, i) { - return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); + return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _toConsumableArray(arr) { - return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) { - for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; - - return arr2; - } + if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _arrayWithHoles(arr) { @@ -158,14 +184,11 @@ function _arrayWithHoles(arr) { } function _iterableToArray(iter) { - if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); + if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); } function _iterableToArrayLimit(arr, i) { - if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { - return; - } - + if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; @@ -191,12 +214,84 @@ function _iterableToArrayLimit(arr, i) { return _arr; } +function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(n); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); +} + +function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; + + return arr2; +} + function _nonIterableSpread() { - throw new TypeError("Invalid attempt to spread non-iterable instance"); + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _nonIterableRest() { - throw new TypeError("Invalid attempt to destructure non-iterable instance"); + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); +} + +function _createForOfIteratorHelper(o) { + if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { + if (Array.isArray(o) || (o = _unsupportedIterableToArray(o))) { + var i = 0; + + var F = function () {}; + + return { + s: F, + n: function () { + if (i >= o.length) return { + done: true + }; + return { + done: false, + value: o[i++] + }; + }, + e: function (e) { + throw e; + }, + f: F + }; + } + + throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + + var it, + normalCompletion = true, + didErr = false, + err; + return { + s: function () { + it = o[Symbol.iterator](); + }, + n: function () { + var step = it.next(); + normalCompletion = step.done; + return step; + }, + e: function (e) { + didErr = true; + err = e; + }, + f: function () { + try { + if (!normalCompletion && it.return != null) it.return(); + } finally { + if (didErr) throw err; + } + } + }; } // http://ross.posterous.com/2008/08/19/iphone-touch-events-in-javascript/ @@ -380,10 +475,12 @@ var getReverseNS = function getReverseNS() { var _SVGPathSegClosePath = /*#__PURE__*/function (_SVGPathSeg2) { _inherits(_SVGPathSegClosePath, _SVGPathSeg2); + var _super = _createSuper(_SVGPathSegClosePath); + function _SVGPathSegClosePath(owningPathSegList) { _classCallCheck(this, _SVGPathSegClosePath); - return _possibleConstructorReturn(this, _getPrototypeOf(_SVGPathSegClosePath).call(this, _SVGPathSeg.PATHSEG_CLOSEPATH, 'z', owningPathSegList)); + return _super.call(this, _SVGPathSeg.PATHSEG_CLOSEPATH, 'z', owningPathSegList); } _createClass(_SVGPathSegClosePath, [{ @@ -409,12 +506,14 @@ var getReverseNS = function getReverseNS() { var _SVGPathSegMovetoAbs = /*#__PURE__*/function (_SVGPathSeg3) { _inherits(_SVGPathSegMovetoAbs, _SVGPathSeg3); + var _super2 = _createSuper(_SVGPathSegMovetoAbs); + function _SVGPathSegMovetoAbs(owningPathSegList, x, y) { var _this; _classCallCheck(this, _SVGPathSegMovetoAbs); - _this = _possibleConstructorReturn(this, _getPrototypeOf(_SVGPathSegMovetoAbs).call(this, _SVGPathSeg.PATHSEG_MOVETO_ABS, 'M', owningPathSegList)); + _this = _super2.call(this, _SVGPathSeg.PATHSEG_MOVETO_ABS, 'M', owningPathSegList); _this._x = x; _this._y = y; return _this; @@ -468,12 +567,14 @@ var getReverseNS = function getReverseNS() { var _SVGPathSegMovetoRel = /*#__PURE__*/function (_SVGPathSeg4) { _inherits(_SVGPathSegMovetoRel, _SVGPathSeg4); + var _super3 = _createSuper(_SVGPathSegMovetoRel); + function _SVGPathSegMovetoRel(owningPathSegList, x, y) { var _this2; _classCallCheck(this, _SVGPathSegMovetoRel); - _this2 = _possibleConstructorReturn(this, _getPrototypeOf(_SVGPathSegMovetoRel).call(this, _SVGPathSeg.PATHSEG_MOVETO_REL, 'm', owningPathSegList)); + _this2 = _super3.call(this, _SVGPathSeg.PATHSEG_MOVETO_REL, 'm', owningPathSegList); _this2._x = x; _this2._y = y; return _this2; @@ -527,12 +628,14 @@ var getReverseNS = function getReverseNS() { var _SVGPathSegLinetoAbs = /*#__PURE__*/function (_SVGPathSeg5) { _inherits(_SVGPathSegLinetoAbs, _SVGPathSeg5); + var _super4 = _createSuper(_SVGPathSegLinetoAbs); + function _SVGPathSegLinetoAbs(owningPathSegList, x, y) { var _this3; _classCallCheck(this, _SVGPathSegLinetoAbs); - _this3 = _possibleConstructorReturn(this, _getPrototypeOf(_SVGPathSegLinetoAbs).call(this, _SVGPathSeg.PATHSEG_LINETO_ABS, 'L', owningPathSegList)); + _this3 = _super4.call(this, _SVGPathSeg.PATHSEG_LINETO_ABS, 'L', owningPathSegList); _this3._x = x; _this3._y = y; return _this3; @@ -586,12 +689,14 @@ var getReverseNS = function getReverseNS() { var _SVGPathSegLinetoRel = /*#__PURE__*/function (_SVGPathSeg6) { _inherits(_SVGPathSegLinetoRel, _SVGPathSeg6); + var _super5 = _createSuper(_SVGPathSegLinetoRel); + function _SVGPathSegLinetoRel(owningPathSegList, x, y) { var _this4; _classCallCheck(this, _SVGPathSegLinetoRel); - _this4 = _possibleConstructorReturn(this, _getPrototypeOf(_SVGPathSegLinetoRel).call(this, _SVGPathSeg.PATHSEG_LINETO_REL, 'l', owningPathSegList)); + _this4 = _super5.call(this, _SVGPathSeg.PATHSEG_LINETO_REL, 'l', owningPathSegList); _this4._x = x; _this4._y = y; return _this4; @@ -645,12 +750,14 @@ var getReverseNS = function getReverseNS() { var _SVGPathSegCurvetoCubicAbs = /*#__PURE__*/function (_SVGPathSeg7) { _inherits(_SVGPathSegCurvetoCubicAbs, _SVGPathSeg7); + var _super6 = _createSuper(_SVGPathSegCurvetoCubicAbs); + function _SVGPathSegCurvetoCubicAbs(owningPathSegList, x, y, x1, y1, x2, y2) { var _this5; _classCallCheck(this, _SVGPathSegCurvetoCubicAbs); - _this5 = _possibleConstructorReturn(this, _getPrototypeOf(_SVGPathSegCurvetoCubicAbs).call(this, _SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS, 'C', owningPathSegList)); + _this5 = _super6.call(this, _SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS, 'C', owningPathSegList); _this5._x = x; _this5._y = y; _this5._x1 = x1; @@ -752,12 +859,14 @@ var getReverseNS = function getReverseNS() { var _SVGPathSegCurvetoCubicRel = /*#__PURE__*/function (_SVGPathSeg8) { _inherits(_SVGPathSegCurvetoCubicRel, _SVGPathSeg8); + var _super7 = _createSuper(_SVGPathSegCurvetoCubicRel); + function _SVGPathSegCurvetoCubicRel(owningPathSegList, x, y, x1, y1, x2, y2) { var _this6; _classCallCheck(this, _SVGPathSegCurvetoCubicRel); - _this6 = _possibleConstructorReturn(this, _getPrototypeOf(_SVGPathSegCurvetoCubicRel).call(this, _SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL, 'c', owningPathSegList)); + _this6 = _super7.call(this, _SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL, 'c', owningPathSegList); _this6._x = x; _this6._y = y; _this6._x1 = x1; @@ -859,12 +968,14 @@ var getReverseNS = function getReverseNS() { var _SVGPathSegCurvetoQuadraticAbs = /*#__PURE__*/function (_SVGPathSeg9) { _inherits(_SVGPathSegCurvetoQuadraticAbs, _SVGPathSeg9); + var _super8 = _createSuper(_SVGPathSegCurvetoQuadraticAbs); + function _SVGPathSegCurvetoQuadraticAbs(owningPathSegList, x, y, x1, y1) { var _this7; _classCallCheck(this, _SVGPathSegCurvetoQuadraticAbs); - _this7 = _possibleConstructorReturn(this, _getPrototypeOf(_SVGPathSegCurvetoQuadraticAbs).call(this, _SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS, 'Q', owningPathSegList)); + _this7 = _super8.call(this, _SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS, 'Q', owningPathSegList); _this7._x = x; _this7._y = y; _this7._x1 = x1; @@ -942,12 +1053,14 @@ var getReverseNS = function getReverseNS() { var _SVGPathSegCurvetoQuadraticRel = /*#__PURE__*/function (_SVGPathSeg10) { _inherits(_SVGPathSegCurvetoQuadraticRel, _SVGPathSeg10); + var _super9 = _createSuper(_SVGPathSegCurvetoQuadraticRel); + function _SVGPathSegCurvetoQuadraticRel(owningPathSegList, x, y, x1, y1) { var _this8; _classCallCheck(this, _SVGPathSegCurvetoQuadraticRel); - _this8 = _possibleConstructorReturn(this, _getPrototypeOf(_SVGPathSegCurvetoQuadraticRel).call(this, _SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL, 'q', owningPathSegList)); + _this8 = _super9.call(this, _SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL, 'q', owningPathSegList); _this8._x = x; _this8._y = y; _this8._x1 = x1; @@ -1025,12 +1138,14 @@ var getReverseNS = function getReverseNS() { var _SVGPathSegArcAbs = /*#__PURE__*/function (_SVGPathSeg11) { _inherits(_SVGPathSegArcAbs, _SVGPathSeg11); + var _super10 = _createSuper(_SVGPathSegArcAbs); + function _SVGPathSegArcAbs(owningPathSegList, x, y, r1, r2, angle, largeArcFlag, sweepFlag) { var _this9; _classCallCheck(this, _SVGPathSegArcAbs); - _this9 = _possibleConstructorReturn(this, _getPrototypeOf(_SVGPathSegArcAbs).call(this, _SVGPathSeg.PATHSEG_ARC_ABS, 'A', owningPathSegList)); + _this9 = _super10.call(this, _SVGPathSeg.PATHSEG_ARC_ABS, 'A', owningPathSegList); _this9._x = x; _this9._y = y; _this9._r1 = r1; @@ -1144,12 +1259,14 @@ var getReverseNS = function getReverseNS() { var _SVGPathSegArcRel = /*#__PURE__*/function (_SVGPathSeg12) { _inherits(_SVGPathSegArcRel, _SVGPathSeg12); + var _super11 = _createSuper(_SVGPathSegArcRel); + function _SVGPathSegArcRel(owningPathSegList, x, y, r1, r2, angle, largeArcFlag, sweepFlag) { var _this10; _classCallCheck(this, _SVGPathSegArcRel); - _this10 = _possibleConstructorReturn(this, _getPrototypeOf(_SVGPathSegArcRel).call(this, _SVGPathSeg.PATHSEG_ARC_REL, 'a', owningPathSegList)); + _this10 = _super11.call(this, _SVGPathSeg.PATHSEG_ARC_REL, 'a', owningPathSegList); _this10._x = x; _this10._y = y; _this10._r1 = r1; @@ -1263,12 +1380,14 @@ var getReverseNS = function getReverseNS() { var _SVGPathSegLinetoHorizontalAbs = /*#__PURE__*/function (_SVGPathSeg13) { _inherits(_SVGPathSegLinetoHorizontalAbs, _SVGPathSeg13); + var _super12 = _createSuper(_SVGPathSegLinetoHorizontalAbs); + function _SVGPathSegLinetoHorizontalAbs(owningPathSegList, x) { var _this11; _classCallCheck(this, _SVGPathSegLinetoHorizontalAbs); - _this11 = _possibleConstructorReturn(this, _getPrototypeOf(_SVGPathSegLinetoHorizontalAbs).call(this, _SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS, 'H', owningPathSegList)); + _this11 = _super12.call(this, _SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS, 'H', owningPathSegList); _this11._x = x; return _this11; } @@ -1308,12 +1427,14 @@ var getReverseNS = function getReverseNS() { var _SVGPathSegLinetoHorizontalRel = /*#__PURE__*/function (_SVGPathSeg14) { _inherits(_SVGPathSegLinetoHorizontalRel, _SVGPathSeg14); + var _super13 = _createSuper(_SVGPathSegLinetoHorizontalRel); + function _SVGPathSegLinetoHorizontalRel(owningPathSegList, x) { var _this12; _classCallCheck(this, _SVGPathSegLinetoHorizontalRel); - _this12 = _possibleConstructorReturn(this, _getPrototypeOf(_SVGPathSegLinetoHorizontalRel).call(this, _SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL, 'h', owningPathSegList)); + _this12 = _super13.call(this, _SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL, 'h', owningPathSegList); _this12._x = x; return _this12; } @@ -1353,12 +1474,14 @@ var getReverseNS = function getReverseNS() { var _SVGPathSegLinetoVerticalAbs = /*#__PURE__*/function (_SVGPathSeg15) { _inherits(_SVGPathSegLinetoVerticalAbs, _SVGPathSeg15); + var _super14 = _createSuper(_SVGPathSegLinetoVerticalAbs); + function _SVGPathSegLinetoVerticalAbs(owningPathSegList, y) { var _this13; _classCallCheck(this, _SVGPathSegLinetoVerticalAbs); - _this13 = _possibleConstructorReturn(this, _getPrototypeOf(_SVGPathSegLinetoVerticalAbs).call(this, _SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS, 'V', owningPathSegList)); + _this13 = _super14.call(this, _SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS, 'V', owningPathSegList); _this13._y = y; return _this13; } @@ -1398,12 +1521,14 @@ var getReverseNS = function getReverseNS() { var _SVGPathSegLinetoVerticalRel = /*#__PURE__*/function (_SVGPathSeg16) { _inherits(_SVGPathSegLinetoVerticalRel, _SVGPathSeg16); + var _super15 = _createSuper(_SVGPathSegLinetoVerticalRel); + function _SVGPathSegLinetoVerticalRel(owningPathSegList, y) { var _this14; _classCallCheck(this, _SVGPathSegLinetoVerticalRel); - _this14 = _possibleConstructorReturn(this, _getPrototypeOf(_SVGPathSegLinetoVerticalRel).call(this, _SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL, 'v', owningPathSegList)); + _this14 = _super15.call(this, _SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL, 'v', owningPathSegList); _this14._y = y; return _this14; } @@ -1443,12 +1568,14 @@ var getReverseNS = function getReverseNS() { var _SVGPathSegCurvetoCubicSmoothAbs = /*#__PURE__*/function (_SVGPathSeg17) { _inherits(_SVGPathSegCurvetoCubicSmoothAbs, _SVGPathSeg17); + var _super16 = _createSuper(_SVGPathSegCurvetoCubicSmoothAbs); + function _SVGPathSegCurvetoCubicSmoothAbs(owningPathSegList, x, y, x2, y2) { var _this15; _classCallCheck(this, _SVGPathSegCurvetoCubicSmoothAbs); - _this15 = _possibleConstructorReturn(this, _getPrototypeOf(_SVGPathSegCurvetoCubicSmoothAbs).call(this, _SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS, 'S', owningPathSegList)); + _this15 = _super16.call(this, _SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS, 'S', owningPathSegList); _this15._x = x; _this15._y = y; _this15._x2 = x2; @@ -1526,12 +1653,14 @@ var getReverseNS = function getReverseNS() { var _SVGPathSegCurvetoCubicSmoothRel = /*#__PURE__*/function (_SVGPathSeg18) { _inherits(_SVGPathSegCurvetoCubicSmoothRel, _SVGPathSeg18); + var _super17 = _createSuper(_SVGPathSegCurvetoCubicSmoothRel); + function _SVGPathSegCurvetoCubicSmoothRel(owningPathSegList, x, y, x2, y2) { var _this16; _classCallCheck(this, _SVGPathSegCurvetoCubicSmoothRel); - _this16 = _possibleConstructorReturn(this, _getPrototypeOf(_SVGPathSegCurvetoCubicSmoothRel).call(this, _SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL, 's', owningPathSegList)); + _this16 = _super17.call(this, _SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL, 's', owningPathSegList); _this16._x = x; _this16._y = y; _this16._x2 = x2; @@ -1609,12 +1738,14 @@ var getReverseNS = function getReverseNS() { var _SVGPathSegCurvetoQuadraticSmoothAbs = /*#__PURE__*/function (_SVGPathSeg19) { _inherits(_SVGPathSegCurvetoQuadraticSmoothAbs, _SVGPathSeg19); + var _super18 = _createSuper(_SVGPathSegCurvetoQuadraticSmoothAbs); + function _SVGPathSegCurvetoQuadraticSmoothAbs(owningPathSegList, x, y) { var _this17; _classCallCheck(this, _SVGPathSegCurvetoQuadraticSmoothAbs); - _this17 = _possibleConstructorReturn(this, _getPrototypeOf(_SVGPathSegCurvetoQuadraticSmoothAbs).call(this, _SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS, 'T', owningPathSegList)); + _this17 = _super18.call(this, _SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS, 'T', owningPathSegList); _this17._x = x; _this17._y = y; return _this17; @@ -1668,12 +1799,14 @@ var getReverseNS = function getReverseNS() { var _SVGPathSegCurvetoQuadraticSmoothRel = /*#__PURE__*/function (_SVGPathSeg20) { _inherits(_SVGPathSegCurvetoQuadraticSmoothRel, _SVGPathSeg20); + var _super19 = _createSuper(_SVGPathSegCurvetoQuadraticSmoothRel); + function _SVGPathSegCurvetoQuadraticSmoothRel(owningPathSegList, x, y) { var _this18; _classCallCheck(this, _SVGPathSegCurvetoQuadraticSmoothRel); - _this18 = _possibleConstructorReturn(this, _getPrototypeOf(_SVGPathSegCurvetoQuadraticSmoothRel).call(this, _SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL, 't', owningPathSegList)); + _this18 = _super19.call(this, _SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL, 't', owningPathSegList); _this18._x = x; _this18._y = y; return _this18; @@ -2603,7 +2736,7 @@ var isIE_ = userAgent.includes('MSIE'); var isChrome_ = userAgent.includes('Chrome/'); var isWindows_ = userAgent.includes('Windows'); var isMac_ = userAgent.includes('Macintosh'); -var isTouch_ = 'ontouchstart' in window; +var isTouch_ = ('ontouchstart' in window); var supportsSelectors_ = function () { return Boolean(svg.querySelector); @@ -3820,6 +3953,8 @@ var Command = /*#__PURE__*/function () { var MoveElementCommand = /*#__PURE__*/function (_Command) { _inherits(MoveElementCommand, _Command); + var _super = _createSuper(MoveElementCommand); + /** * @param {Element} elem - The DOM element that was moved * @param {Element} oldNextSibling - The element's next sibling before it was moved @@ -3831,7 +3966,7 @@ var MoveElementCommand = /*#__PURE__*/function (_Command) { _classCallCheck(this, MoveElementCommand); - _this = _possibleConstructorReturn(this, _getPrototypeOf(MoveElementCommand).call(this)); + _this = _super.call(this); _this.elem = elem; _this.text = text ? 'Move ' + elem.tagName + ' to ' + text : 'Move ' + elem.tagName; _this.oldNextSibling = oldNextSibling; @@ -3914,6 +4049,8 @@ MoveElementCommand.type = MoveElementCommand.prototype.type; var InsertElementCommand = /*#__PURE__*/function (_Command2) { _inherits(InsertElementCommand, _Command2); + var _super2 = _createSuper(InsertElementCommand); + /** * @param {Element} elem - The newly added DOM element * @param {string} text - An optional string visible to user related to this change @@ -3923,7 +4060,7 @@ var InsertElementCommand = /*#__PURE__*/function (_Command2) { _classCallCheck(this, InsertElementCommand); - _this2 = _possibleConstructorReturn(this, _getPrototypeOf(InsertElementCommand).call(this)); + _this2 = _super2.call(this); _this2.elem = elem; _this2.text = text || 'Create ' + elem.tagName; _this2.parent = elem.parentNode; @@ -4004,6 +4141,8 @@ InsertElementCommand.type = InsertElementCommand.prototype.type; var RemoveElementCommand = /*#__PURE__*/function (_Command3) { _inherits(RemoveElementCommand, _Command3); + var _super3 = _createSuper(RemoveElementCommand); + /** * @param {Element} elem - The removed DOM element * @param {Node} oldNextSibling - The DOM element's nextSibling when it was in the DOM @@ -4015,7 +4154,7 @@ var RemoveElementCommand = /*#__PURE__*/function (_Command3) { _classCallCheck(this, RemoveElementCommand); - _this3 = _possibleConstructorReturn(this, _getPrototypeOf(RemoveElementCommand).call(this)); + _this3 = _super3.call(this); _this3.elem = elem; _this3.text = text || 'Delete ' + elem.tagName; _this3.nextSibling = oldNextSibling; @@ -4116,6 +4255,8 @@ RemoveElementCommand.type = RemoveElementCommand.prototype.type; var ChangeElementCommand = /*#__PURE__*/function (_Command4) { _inherits(ChangeElementCommand, _Command4); + var _super4 = _createSuper(ChangeElementCommand); + /** * @param {Element} elem - The DOM element that was changed * @param {module:history.CommandAttributes} attrs - Attributes to be changed with the values they had *before* the change @@ -4126,7 +4267,7 @@ var ChangeElementCommand = /*#__PURE__*/function (_Command4) { _classCallCheck(this, ChangeElementCommand); - _this4 = _possibleConstructorReturn(this, _getPrototypeOf(ChangeElementCommand).call(this)); + _this4 = _super4.call(this); _this4.elem = elem; _this4.text = text ? 'Change ' + elem.tagName + ' ' + text : 'Change ' + elem.tagName; _this4.newValues = {}; @@ -4309,6 +4450,8 @@ ChangeElementCommand.type = ChangeElementCommand.prototype.type; // TODO: create var BatchCommand = /*#__PURE__*/function (_Command5) { _inherits(BatchCommand, _Command5); + var _super5 = _createSuper(BatchCommand); + /** * @param {string} [text] - An optional string visible to user related to this change */ @@ -4317,7 +4460,7 @@ var BatchCommand = /*#__PURE__*/function (_Command5) { _classCallCheck(this, BatchCommand); - _this7 = _possibleConstructorReturn(this, _getPrototypeOf(BatchCommand).call(this)); + _this7 = _super5.call(this); _this7.text = text || 'Batch Command'; _this7.stack = []; return _this7; @@ -9426,13 +9569,13 @@ function importSetGlobal(_x, _x2) { */ function _importSetGlobal() { - _importSetGlobal = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(url, _ref2) { + _importSetGlobal = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(url, _ref) { var glob, returnDefault, modularVersion; return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: - glob = _ref2.global, returnDefault = _ref2.returnDefault; + glob = _ref.global, returnDefault = _ref.returnDefault; // Todo: Replace calls to this function with `import()` when supported modularVersion = !('svgEditor' in window) || !window.svgEditor || window.svgEditor.modules !== false; @@ -9522,9 +9665,9 @@ function importScript(url) { function importModule(url) { var atts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, - _ref$returnDefault = _ref.returnDefault, - returnDefault = _ref$returnDefault === void 0 ? false : _ref$returnDefault; + var _ref2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, + _ref2$returnDefault = _ref2.returnDefault, + returnDefault = _ref2$returnDefault === void 0 ? false : _ref2$returnDefault; if (Array.isArray(url)) { return Promise.all(url.map(function (u) { @@ -10030,28 +10173,18 @@ var Layer = /*#__PURE__*/function () { }, { key: "appendChildren", value: function appendChildren(children) { - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; + var _iterator = _createForOfIteratorHelper(children), + _step; try { - for (var _iterator = children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + for (_iterator.s(); !(_step = _iterator.n()).done;) { var child = _step.value; this.group_.append(child); } } catch (err) { - _didIteratorError = true; - _iteratorError = err; + _iterator.e(err); } finally { - try { - if (!_iteratorNormalCompletion && _iterator["return"] != null) { - _iterator["return"](); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } + _iterator.f(); } } /** @@ -14783,13 +14916,13 @@ function SvgCanvas(container, config) { this.addExtension = /*#__PURE__*/function () { - var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(name, extInitFunc, _ref4) { + var _ref4 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(name, extInitFunc, _ref3) { var jq, importLocale, argObj, extObj; return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: - jq = _ref4.$, importLocale = _ref4.importLocale; + jq = _ref3.$, importLocale = _ref3.importLocale; if (!(typeof extInitFunc !== 'function')) { _context.next = 3; @@ -14852,7 +14985,7 @@ function SvgCanvas(container, config) { })); return function (_x, _x2, _x3) { - return _ref3.apply(this, arguments); + return _ref4.apply(this, arguments); }; }(); /** @@ -15531,12 +15664,11 @@ function SvgCanvas(container, config) { if (!rightClick) { // insert a dummy transform so if the element(s) are moved it will have // a transform to use for its translate - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; + var _iterator = _createForOfIteratorHelper(selectedElements), + _step; try { - for (var _iterator = selectedElements[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + for (_iterator.s(); !(_step = _iterator.n()).done;) { var selectedElement = _step.value; if (isNullish(selectedElement)) { @@ -15552,18 +15684,9 @@ function SvgCanvas(container, config) { } } } catch (err) { - _didIteratorError = true; - _iteratorError = err; + _iterator.e(err); } finally { - try { - if (!_iteratorNormalCompletion && _iterator["return"] != null) { - _iterator["return"](); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } + _iterator.f(); } } } else if (!rightClick) { @@ -18005,7 +18128,7 @@ function SvgCanvas(container, config) { issues, issueCodes, svg, - _ref6, + _yield$importSetGloba, c, _args2 = arguments; @@ -18030,8 +18153,8 @@ function SvgCanvas(container, config) { }); case 8: - _ref6 = _context2.sent; - canvg = _ref6.canvg; + _yield$importSetGloba = _context2.sent; + canvg = _yield$importSetGloba.canvg; case 10: if (!$$9('#export_canvas').length) { @@ -18141,7 +18264,7 @@ function SvgCanvas(container, config) { this.exportPDF = /*#__PURE__*/function () { - var _ref7 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(exportWindowName) { + var _ref6 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(exportWindowName) { var outputType, modularVersion, res, @@ -18231,7 +18354,7 @@ function SvgCanvas(container, config) { })); return function (_x7) { - return _ref7.apply(this, arguments); + return _ref6.apply(this, arguments); }; }(); /** @@ -18883,29 +19006,20 @@ function SvgCanvas(container, config) { } var attrs = svg.attributes; - var _iteratorNormalCompletion2 = true; - var _didIteratorError2 = false; - var _iteratorError2 = undefined; + + var _iterator2 = _createForOfIteratorHelper(attrs), + _step2; try { - for (var _iterator2 = attrs[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { var attr = _step2.value; // Ok for `NamedNodeMap` symbol.setAttribute(attr.nodeName, attr.value); } } catch (err) { - _didIteratorError2 = true; - _iteratorError2 = err; + _iterator2.e(err); } finally { - try { - if (!_iteratorNormalCompletion2 && _iterator2["return"] != null) { - _iterator2["return"](); - } - } finally { - if (_didIteratorError2) { - throw _iteratorError2; - } - } + _iterator2.f(); } symbol.id = getNextId(); // Store data @@ -18961,10 +19075,10 @@ function SvgCanvas(container, config) { leaveContext: leaveContext, setContext: setContext }; - Object.entries(dr).forEach(function (_ref8) { - var _ref9 = _slicedToArray(_ref8, 2), - prop = _ref9[0], - propVal = _ref9[1]; + Object.entries(dr).forEach(function (_ref7) { + var _ref8 = _slicedToArray(_ref7, 2), + prop = _ref8[0], + propVal = _ref8[1]; canvas[prop] = propVal; }); @@ -19128,12 +19242,12 @@ function SvgCanvas(container, config) { elem = $$9(elem).data('gsvg') || $$9(elem).data('symbol') || elem; var childs = elem.childNodes; - var _iteratorNormalCompletion3 = true; - var _didIteratorError3 = false; - var _iteratorError3 = undefined; + + var _iterator3 = _createForOfIteratorHelper(childs), + _step3; try { - for (var _iterator3 = childs[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) { var child = _step3.value; if (child.nodeName === 'title') { @@ -19141,18 +19255,9 @@ function SvgCanvas(container, config) { } } } catch (err) { - _didIteratorError3 = true; - _iteratorError3 = err; + _iterator3.e(err); } finally { - try { - if (!_iteratorNormalCompletion3 && _iterator3["return"] != null) { - _iterator3["return"](); - } - } finally { - if (_didIteratorError3) { - throw _iteratorError3; - } - } + _iterator3.f(); } return ''; @@ -19218,12 +19323,12 @@ function SvgCanvas(container, config) { var docTitle = false, oldTitle = ''; var batchCmd = new BatchCommand$1('Change Image Title'); - var _iteratorNormalCompletion4 = true; - var _didIteratorError4 = false; - var _iteratorError4 = undefined; + + var _iterator4 = _createForOfIteratorHelper(childs), + _step4; try { - for (var _iterator4 = childs[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { + for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) { var child = _step4.value; if (child.nodeName === 'title') { @@ -19233,18 +19338,9 @@ function SvgCanvas(container, config) { } } } catch (err) { - _didIteratorError4 = true; - _iteratorError4 = err; + _iterator4.e(err); } finally { - try { - if (!_iteratorNormalCompletion4 && _iterator4["return"] != null) { - _iterator4["return"](); - } - } finally { - if (_didIteratorError4) { - throw _iteratorError4; - } - } + _iterator4.f(); } if (!docTitle) { @@ -24341,24 +24437,6 @@ function jQueryPluginSpinButton($) { return $; } -/** - * @file jQuery Context Menu Plugin - * Cory S.N. LaViska - * A Beautiful Site ({@link https://abeautifulsite.net/}) - * Modified by Alexis Deveria - * - * More info: {@link https://abeautifulsite.net/2008/09/jquery-context-menu-plugin/} - * - * @module jQueryContextMenu - * @todo Update to latest version and adapt (and needs jQuery update as well): {@link https://github.com/swisnl/jQuery-contextMenu} - * @version 1.0.1 - * - * @license (MIT OR GPL-2.0-or-later) - * - * This plugin is dual-licensed under the GNU General Public License - * and the MIT License and is copyright A Beautiful Site, LLC. - * -*/ /** * @callback module:jQueryContextMenu.jQueryContextMenuListener * @param {string} href The `href` value after the first character (for bypassing an initial `#`) @@ -24558,28 +24636,19 @@ function jQueryContextMenu($) { $(this).each(function () { if (o !== undefined) { var d = o.split(','); - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; + + var _iterator = _createForOfIteratorHelper(d), + _step; try { - for (var _iterator = d[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + for (_iterator.s(); !(_step = _iterator.n()).done;) { var href = _step.value; $(this).find('A[href="' + href + '"]').parent().addClass('disabled'); } } catch (err) { - _didIteratorError = true; - _iteratorError = err; + _iterator.e(err); } finally { - try { - if (!_iteratorNormalCompletion && _iterator["return"] != null) { - _iterator["return"](); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } + _iterator.f(); } } }); @@ -24602,28 +24671,19 @@ function jQueryContextMenu($) { $(this).each(function () { if (o !== undefined) { var d = o.split(','); - var _iteratorNormalCompletion2 = true; - var _didIteratorError2 = false; - var _iteratorError2 = undefined; + + var _iterator2 = _createForOfIteratorHelper(d), + _step2; try { - for (var _iterator2 = d[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { var href = _step2.value; $(this).find('A[href="' + href + '"]').parent().removeClass('disabled'); } } catch (err) { - _didIteratorError2 = true; - _iteratorError2 = err; + _iterator2.e(err); } finally { - try { - if (!_iteratorNormalCompletion2 && _iterator2["return"] != null) { - _iterator2["return"](); - } - } finally { - if (_didIteratorError2) { - throw _iteratorError2; - } - } + _iterator2.f(); } } }); @@ -28913,7 +28973,7 @@ function loadSvgString(_x) { function _loadSvgString() { _loadSvgString = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee23(str) { - var _ref49, + var _ref42, noAlert, success, _args23 = arguments; @@ -28922,7 +28982,7 @@ function _loadSvgString() { while (1) { switch (_context23.prev = _context23.next) { case 0: - _ref49 = _args23.length > 1 && _args23[1] !== undefined ? _args23[1] : {}, noAlert = _ref49.noAlert; + _ref42 = _args23.length > 1 && _args23[1] !== undefined ? _args23[1] : {}, noAlert = _ref42.noAlert; success = svgCanvas.setSvgString(str) !== false; if (!success) { @@ -28968,55 +29028,54 @@ function getImportLocale(_ref) { * @param {string} [localeInfo.lang=defaultLang] Defaults to `defaultLang` of {@link module:SVGEditor~getImportLocale} * @returns {Promise} Resolves to {@link module:locale.LocaleStrings} */ - return (/*#__PURE__*/function () { - var _importLocaleDefaulting = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() { - var _ref2, - _ref2$name, - name, - _ref2$lang, - lang, - importLocale, - _args = arguments; + return /*#__PURE__*/function () { + var _importLocaleDefaulting = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() { + var _ref2, + _ref2$name, + name, + _ref2$lang, + lang, + importLocale, + _args = arguments; - return regeneratorRuntime.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - importLocale = function _ref3(language) { - var url = "".concat(curConfig.extPath, "ext-locale/").concat(name, "/").concat(language, ".js"); - return importSetGlobalDefault(url, { - global: "svgEditorExtensionLocale_".concat(name, "_").concat(language.replace(/-/g, '_')) - }); - }; + return regeneratorRuntime.wrap(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + importLocale = function _importLocale(language) { + var url = "".concat(curConfig.extPath, "ext-locale/").concat(name, "/").concat(language, ".js"); + return importSetGlobalDefault(url, { + global: "svgEditorExtensionLocale_".concat(name, "_").concat(language.replace(/-/g, '_')) + }); + }; - _ref2 = _args.length > 0 && _args[0] !== undefined ? _args[0] : {}, _ref2$name = _ref2.name, name = _ref2$name === void 0 ? defaultName : _ref2$name, _ref2$lang = _ref2.lang, lang = _ref2$lang === void 0 ? defaultLang : _ref2$lang; - _context.prev = 2; - _context.next = 5; - return importLocale(lang); + _ref2 = _args.length > 0 && _args[0] !== undefined ? _args[0] : {}, _ref2$name = _ref2.name, name = _ref2$name === void 0 ? defaultName : _ref2$name, _ref2$lang = _ref2.lang, lang = _ref2$lang === void 0 ? defaultLang : _ref2$lang; + _context.prev = 2; + _context.next = 5; + return importLocale(lang); - case 5: - return _context.abrupt("return", _context.sent); + case 5: + return _context.abrupt("return", _context.sent); - case 8: - _context.prev = 8; - _context.t0 = _context["catch"](2); - return _context.abrupt("return", importLocale('en')); + case 8: + _context.prev = 8; + _context.t0 = _context["catch"](2); + return _context.abrupt("return", importLocale('en')); - case 11: - case "end": - return _context.stop(); - } + case 11: + case "end": + return _context.stop(); } - }, _callee, null, [[2, 8]]); - })); + } + }, _callee, null, [[2, 8]]); + })); - function importLocaleDefaulting() { - return _importLocaleDefaulting.apply(this, arguments); - } + function importLocaleDefaulting() { + return _importLocaleDefaulting.apply(this, arguments); + } - return importLocaleDefaulting; - }() - ); + return importLocaleDefaulting; + }(); } /** * EXPORTS. @@ -29154,10 +29213,10 @@ editor.setConfig = function (opts, cfgCfg) { } } - Object.entries(opts).forEach(function (_ref4) { - var _ref5 = _slicedToArray(_ref4, 2), - key = _ref5[0], - val = _ref5[1]; + Object.entries(opts).forEach(function (_ref3) { + var _ref4 = _slicedToArray(_ref3, 2), + key = _ref4[0], + val = _ref4[1]; // Only allow prefs defined in defaultPrefs or... if ({}.hasOwnProperty.call(defaultPrefs, key)) { @@ -29380,9 +29439,9 @@ editor.init = function () { (function () { // Load config/data from URL if given - var _ref6 = new URL(location), - search = _ref6.search, - searchParams = _ref6.searchParams; + var _URL = new URL(location), + search = _URL.search, + searchParams = _URL.searchParams; if (search) { urldata = deparam(searchParams.toString(), true); @@ -29493,8 +29552,8 @@ editor.init = function () { var extAndLocaleFunc = /*#__PURE__*/function () { - var _ref7 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() { - var _ref8, langParam, langData, _uiStrings$common, ok, cancel; + var _ref5 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() { + var _yield$editor$putLoca, langParam, langData, _uiStrings$common, ok, cancel; return regeneratorRuntime.wrap(function _callee3$(_context3) { while (1) { @@ -29504,9 +29563,9 @@ editor.init = function () { return editor.putLocale(editor.pref('lang'), goodLangs, curConfig); case 2: - _ref8 = _context3.sent; - langParam = _ref8.langParam; - langData = _ref8.langData; + _yield$editor$putLoca = _context3.sent; + langParam = _yield$editor$putLoca.langParam; + langData = _yield$editor$putLoca.langData; _context3.next = 7; return setLang(langParam, langData); @@ -29521,7 +29580,7 @@ editor.init = function () { _context3.prev = 10; _context3.next = 13; return Promise.all(curConfig.extensions.map( /*#__PURE__*/function () { - var _ref9 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(extname) { + var _ref6 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(extname) { var extName, url, imported, _imported$name, _name2, init, importLocale; return regeneratorRuntime.wrap(function _callee2$(_context2) { @@ -29587,7 +29646,7 @@ editor.init = function () { })); return function (_x2) { - return _ref9.apply(this, arguments); + return _ref6.apply(this, arguments); }; }())); @@ -29639,7 +29698,7 @@ editor.init = function () { })); return function extAndLocaleFunc() { - return _ref7.apply(this, arguments); + return _ref5.apply(this, arguments); }; }(); @@ -30131,7 +30190,7 @@ editor.init = function () { while (1) { switch (_context4.prev = _context4.next) { case 0: - getStylesheetPriority = function _ref11(stylesheetFile) { + getStylesheetPriority = function _getStylesheetPriorit(stylesheetFile) { switch (stylesheetFile) { case 'jgraduate/css/jPicker.css': return 1; @@ -30206,10 +30265,10 @@ editor.init = function () { _context4.next = 11; return loadStylesheets(stylesheets, { - acceptErrors: function acceptErrors(_ref10) { - var stylesheetURL = _ref10.stylesheetURL, - reject = _ref10.reject, - resolve = _ref10.resolve; + acceptErrors: function acceptErrors(_ref7) { + var stylesheetURL = _ref7.stylesheetURL, + reject = _ref7.reject, + resolve = _ref7.resolve; if ($$b.loadingStylesheets.includes(stylesheetURL)) { reject(new Error("Missing expected stylesheet: ".concat(stylesheetURL))); @@ -30699,8 +30758,8 @@ editor.init = function () { function _promptImgURL() { _promptImgURL = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee18() { - var _ref35, - _ref35$cancelDeletes, + var _ref28, + _ref28$cancelDeletes, cancelDeletes, curhref, url, @@ -30710,7 +30769,7 @@ editor.init = function () { while (1) { switch (_context18.prev = _context18.next) { case 0: - _ref35 = _args18.length > 0 && _args18[0] !== undefined ? _args18[0] : {}, _ref35$cancelDeletes = _ref35.cancelDeletes, cancelDeletes = _ref35$cancelDeletes === void 0 ? false : _ref35$cancelDeletes; + _ref28 = _args18.length > 0 && _args18[0] !== undefined ? _args18[0] : {}, _ref28$cancelDeletes = _ref28.cancelDeletes, cancelDeletes = _ref28$cancelDeletes === void 0 ? false : _ref28$cancelDeletes; curhref = svgCanvas.getHref(selectedElement); curhref = curhref.startsWith('data:') ? '' : curhref; _context18.next = 5; @@ -31718,10 +31777,10 @@ editor.init = function () { // Get this button's options var idSel = '#' + this.getAttribute('id'); - var _Object$entries$find = Object.entries(btnOpts).find(function (_ref12) { - var _ref13 = _slicedToArray(_ref12, 2), - _ = _ref13[0], - sel = _ref13[1].sel; + var _Object$entries$find = Object.entries(btnOpts).find(function (_ref8) { + var _ref9 = _slicedToArray(_ref8, 2), + _ = _ref9[0], + sel = _ref9[1].sel; return sel === idSel; }), @@ -31748,10 +31807,10 @@ editor.init = function () { if (ev.type === 'keydown') { var flyoutIsSelected = $$b(options.parent + '_show').hasClass('tool_button_current'); var currentOperation = $$b(options.parent + '_show').attr('data-curopt'); - Object.entries(holders[opts.parent]).some(function (_ref14) { - var _ref15 = _slicedToArray(_ref14, 2), - j = _ref15[0], - tool = _ref15[1]; + Object.entries(holders[opts.parent]).some(function (_ref10) { + var _ref11 = _slicedToArray(_ref10, 2), + j = _ref11[0], + tool = _ref11[1]; if (tool.sel !== currentOperation) { return false; @@ -31962,13 +32021,13 @@ editor.init = function () { */ var extAdded = /*#__PURE__*/function () { - var _ref16 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(win, ext) { + var _ref12 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(win, ext) { var cbCalled, resizeDone, lang, prepResize, runCallback, btnSelects, svgicons, fallbackObj, altsObj, placementObj, holders; return regeneratorRuntime.wrap(function _callee5$(_context5) { while (1) { switch (_context5.prev = _context5.next) { case 0: - prepResize = function _ref17() { + prepResize = function _prepResize() { if (resizeTimer) { clearTimeout(resizeTimer); resizeTimer = null; @@ -32443,7 +32502,7 @@ editor.init = function () { })); return function extAdded(_x3, _x4) { - return _ref16.apply(this, arguments); + return _ref12.apply(this, arguments); }; }(); /** @@ -32518,9 +32577,9 @@ editor.init = function () { * @listens module:svgcanvas.SvgCanvas#event:updateCanvas * @returns {void} */ - function (win, _ref18) { - var center = _ref18.center, - newCtr = _ref18.newCtr; + function (win, _ref13) { + var center = _ref13.center, + newCtr = _ref13.newCtr; updateCanvas(center, newCtr); }); svgCanvas.bind('contextset', contextChanged); @@ -33397,7 +33456,7 @@ editor.init = function () { var makeHyperlink = /*#__PURE__*/function () { - var _ref20 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7() { + var _ref15 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7() { var url; return regeneratorRuntime.wrap(function _callee7$(_context7) { while (1) { @@ -33427,7 +33486,7 @@ editor.init = function () { })); return function makeHyperlink() { - return _ref20.apply(this, arguments); + return _ref15.apply(this, arguments); }; }(); /** @@ -33548,7 +33607,7 @@ editor.init = function () { var clickClear = /*#__PURE__*/function () { - var _ref21 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee8() { + var _ref16 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee8() { var _curConfig$dimensions, x, y, ok; return regeneratorRuntime.wrap(function _callee8$(_context8) { @@ -33589,7 +33648,7 @@ editor.init = function () { })); return function clickClear() { - return _ref21.apply(this, arguments); + return _ref16.apply(this, arguments); }; }(); /** @@ -33636,13 +33695,13 @@ editor.init = function () { */ var clickExport = /*#__PURE__*/function () { - var _ref22 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee9() { + var _ref17 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee9() { var imgType, exportWindowName, openExportWindow, chrome, quality; return regeneratorRuntime.wrap(function _callee9$(_context9) { while (1) { switch (_context9.prev = _context9.next) { case 0: - openExportWindow = function _ref23() { + openExportWindow = function _openExportWindow() { var loadingImage = uiStrings$1.notification.loadingImage; if (curConfig.exportWindowType === 'new') { @@ -33733,7 +33792,7 @@ editor.init = function () { })); return function clickExport() { - return _ref22.apply(this, arguments); + return _ref17.apply(this, arguments); }; }(); /** @@ -33933,7 +33992,7 @@ editor.init = function () { var saveSourceEditor = /*#__PURE__*/function () { - var _ref24 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee10() { + var _ref18 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee10() { var saveChanges, ok; return regeneratorRuntime.wrap(function _callee10$(_context10) { while (1) { @@ -33991,7 +34050,7 @@ editor.init = function () { })); return function saveSourceEditor() { - return _ref24.apply(this, arguments); + return _ref18.apply(this, arguments); }; }(); /** @@ -34074,7 +34133,7 @@ editor.init = function () { var savePreferences = editor.savePreferences = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee11() { - var color, lang, _ref26, langParam, langData; + var color, lang, _yield$editor$putLoca2, langParam, langData; return regeneratorRuntime.wrap(function _callee11$(_context11) { while (1) { @@ -34095,9 +34154,9 @@ editor.init = function () { return editor.putLocale(lang, goodLangs, curConfig); case 6: - _ref26 = _context11.sent; - langParam = _ref26.langParam; - langData = _ref26.langData; + _yield$editor$putLoca2 = _context11.sent; + langParam = _yield$editor$putLoca2.langParam; + langData = _yield$editor$putLoca2.langData; _context11.next = 11; return setLang(langParam, langData); @@ -34135,7 +34194,7 @@ editor.init = function () { */ var cancelOverlays = /*#__PURE__*/function () { - var _ref27 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee12() { + var _ref20 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee12() { var ok; return regeneratorRuntime.wrap(function _callee12$(_context12) { while (1) { @@ -34204,7 +34263,7 @@ editor.init = function () { })); return function cancelOverlays() { - return _ref27.apply(this, arguments); + return _ref20.apply(this, arguments); }; }(); @@ -35957,8 +36016,8 @@ editor.init = function () { // bitmap handling reader = new FileReader(); - reader.onloadend = function (_ref30) { - var result = _ref30.target.result; + reader.onloadend = function (_ref23) { + var result = _ref23.target.result; /** * Insert the new image until we know its dimensions. @@ -36008,7 +36067,7 @@ editor.init = function () { workarea[0].addEventListener('dragleave', onDragLeave); workarea[0].addEventListener('drop', importImage); var open = $$b('').change( /*#__PURE__*/function () { - var _ref31 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee16(e) { + var _ref24 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee16(e) { var ok, reader; return regeneratorRuntime.wrap(function _callee16$(_context16) { while (1) { @@ -36035,13 +36094,13 @@ editor.init = function () { reader = new FileReader(); reader.onloadend = /*#__PURE__*/function () { - var _ref32 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee15(_ref33) { + var _ref26 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee15(_ref25) { var target; return regeneratorRuntime.wrap(function _callee15$(_context15) { while (1) { switch (_context15.prev = _context15.next) { case 0: - target = _ref33.target; + target = _ref25.target; _context15.next = 3; return loadSvgString(target.result); @@ -36057,7 +36116,7 @@ editor.init = function () { })); return function (_x6) { - return _ref32.apply(this, arguments); + return _ref26.apply(this, arguments); }; }(); @@ -36073,7 +36132,7 @@ editor.init = function () { })); return function (_x5) { - return _ref31.apply(this, arguments); + return _ref24.apply(this, arguments); }; }()); $$b('#tool_open').show(); @@ -36102,7 +36161,7 @@ editor.init = function () { */ var setLang = editor.setLang = /*#__PURE__*/function () { - var _ref34 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee17(lang, allStrings) { + var _ref27 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee17(lang, allStrings) { var oldLayerName, renameLayer, elems; return regeneratorRuntime.wrap(function _callee17$(_context17) { while (1) { @@ -36208,7 +36267,7 @@ editor.init = function () { })); return function (_x7, _x8) { - return _ref34.apply(this, arguments); + return _ref27.apply(this, arguments); }; }(); @@ -36298,9 +36357,9 @@ editor.runCallbacks = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRu case 0: _context20.prev = 0; _context20.next = 3; - return Promise.all(callbacks.map(function (_ref37) { - var _ref38 = _slicedToArray(_ref37, 1), - cb = _ref38[0]; + return Promise.all(callbacks.map(function (_ref30) { + var _ref31 = _slicedToArray(_ref30, 1), + cb = _ref31[0]; return cb(); // eslint-disable-line promise/prefer-await-to-callbacks })); @@ -36312,18 +36371,18 @@ editor.runCallbacks = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRu case 5: _context20.prev = 5; _context20.t0 = _context20["catch"](0); - callbacks.forEach(function (_ref39) { - var _ref40 = _slicedToArray(_ref39, 3), - reject = _ref40[2]; + callbacks.forEach(function (_ref32) { + var _ref33 = _slicedToArray(_ref32, 3), + reject = _ref33[2]; reject(); }); throw _context20.t0; case 9: - callbacks.forEach(function (_ref41) { - var _ref42 = _slicedToArray(_ref41, 2), - resolve = _ref42[1]; + callbacks.forEach(function (_ref34) { + var _ref35 = _slicedToArray(_ref34, 2), + resolve = _ref35[1]; resolve(); }); @@ -36344,8 +36403,8 @@ editor.runCallbacks = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRu */ editor.loadFromString = function (str) { - var _ref43 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, - noAlert = _ref43.noAlert; + var _ref36 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, + noAlert = _ref36.noAlert; return editor.ready( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee21() { return regeneratorRuntime.wrap(function _callee21$(_context21) { @@ -36411,9 +36470,9 @@ editor.disableUI = function (featList) {// $(function () { editor.loadFromURL = function (url) { - var _ref45 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, - cache = _ref45.cache, - noAlert = _ref45.noAlert; + var _ref38 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, + cache = _ref38.cache, + noAlert = _ref38.noAlert; return editor.ready(function () { return new Promise(function (resolve, reject) { @@ -36462,8 +36521,8 @@ editor.loadFromURL = function (url) { editor.loadFromDataURI = function (str) { - var _ref46 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, - noAlert = _ref46.noAlert; + var _ref39 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, + noAlert = _ref39.noAlert; return editor.ready(function () { var base64 = false; @@ -36520,9 +36579,9 @@ var messageQueue = []; * @returns {void} */ -var messageListener = function messageListener(_ref47) { - var data = _ref47.data, - origin = _ref47.origin; +var messageListener = function messageListener(_ref40) { + var data = _ref40.data, + origin = _ref40.origin; // eslint-disable-line no-shadow // console.log('data, origin, extensionsAdded', data, origin, extensionsAdded); var messageObj = { diff --git a/dist/index-es.min.js b/dist/index-es.min.js index 898d8445..13a43d2b 100644 --- a/dist/index-es.min.js +++ b/dist/index-es.min.js @@ -1,22 +1,22 @@ -function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t,n,r,a,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function n(e){return function(){var n=this,r=arguments;return new Promise((function(a,i){var o=e.apply(n,r);function s(e){t(o,a,i,s,l,"next",e)}function l(e){t(o,a,i,s,l,"throw",e)}s(void 0)}))}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,a,i=!0,o=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return i=e.done,e},e:function(e){o=!0,a=e},f:function(){try{i||null==r.return||r.return()}finally{if(o)throw a}}}}function y(e){var t=e.changedTouches,n=t[0],r="";switch(e.type){case"touchstart":r="mousedown";break;case"touchmove":r="mousemove";break;case"touchend":r="mouseup";break;default:return}var a=n.screenX,i=n.screenY,o=n.clientX,s=n.clientY,l=new MouseEvent(r,{bubbles:!0,cancelable:!0,view:window,detail:1,screenX:a,screenY:i,clientX:o,clientY:s,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null});t.length<2&&(n.target.dispatchEvent(l),e.preventDefault())}document.addEventListener("touchstart",y,!0),document.addEventListener("touchmove",y,!0),document.addEventListener("touchend",y,!0),document.addEventListener("touchcancel",y,!0); /** * Namespaces or tools therefor. * @module namespaces * @license MIT */ -var f={HTML:"http://www.w3.org/1999/xhtml",MATH:"http://www.w3.org/1998/Math/MathML",SE:"http://svg-edit.googlecode.com",SVG:"http://www.w3.org/2000/svg",XLINK:"http://www.w3.org/1999/xlink",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"},g=function(){var e={};return Object.entries(f).forEach((function(t){var n=d(t,2),r=n[0],a=n[1];e[a]=r.toLowerCase()})),e};!function(){if(!("SVGPathSeg"in window)){var e=function(){function e(t,n,a){r(this,e),this.pathSegType=t,this.pathSegTypeAsLetter=n,this._owningPathSegList=a}return i(e,[{key:"_segmentChanged",value:function(){this._owningPathSegList&&this._owningPathSegList.segmentChanged(this)}}]),e}();e.prototype.classname="SVGPathSeg",e.PATHSEG_UNKNOWN=0,e.PATHSEG_CLOSEPATH=1,e.PATHSEG_MOVETO_ABS=2,e.PATHSEG_MOVETO_REL=3,e.PATHSEG_LINETO_ABS=4,e.PATHSEG_LINETO_REL=5,e.PATHSEG_CURVETO_CUBIC_ABS=6,e.PATHSEG_CURVETO_CUBIC_REL=7,e.PATHSEG_CURVETO_QUADRATIC_ABS=8,e.PATHSEG_CURVETO_QUADRATIC_REL=9,e.PATHSEG_ARC_ABS=10,e.PATHSEG_ARC_REL=11,e.PATHSEG_LINETO_HORIZONTAL_ABS=12,e.PATHSEG_LINETO_HORIZONTAL_REL=13,e.PATHSEG_LINETO_VERTICAL_ABS=14,e.PATHSEG_LINETO_VERTICAL_REL=15,e.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS=16,e.PATHSEG_CURVETO_CUBIC_SMOOTH_REL=17,e.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS=18,e.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL=19;var t=function(t){function n(t){return r(this,n),u(this,l(n).call(this,e.PATHSEG_CLOSEPATH,"z",t))}return s(n,t),i(n,[{key:"toString",value:function(){return"[object SVGPathSegClosePath]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter}},{key:"clone",value:function(){return new n(void 0)}}]),n}(e),n=function(t){function n(t,a,i){var o;return r(this,n),(o=u(this,l(n).call(this,e.PATHSEG_MOVETO_ABS,"M",t)))._x=a,o._y=i,o}return s(n,t),i(n,[{key:"toString",value:function(){return"[object SVGPathSegMovetoAbs]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y}},{key:"clone",value:function(){return new n(void 0,this._x,this._y)}}]),n}(e);Object.defineProperties(n.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0},y:{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0}});var a=function(t){function n(t,a,i){var o;return r(this,n),(o=u(this,l(n).call(this,e.PATHSEG_MOVETO_REL,"m",t)))._x=a,o._y=i,o}return s(n,t),i(n,[{key:"toString",value:function(){return"[object SVGPathSegMovetoRel]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y}},{key:"clone",value:function(){return new n(void 0,this._x,this._y)}}]),n}(e);Object.defineProperties(a.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0},y:{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0}});var o=function(t){function n(t,a,i){var o;return r(this,n),(o=u(this,l(n).call(this,e.PATHSEG_LINETO_ABS,"L",t)))._x=a,o._y=i,o}return s(n,t),i(n,[{key:"toString",value:function(){return"[object SVGPathSegLinetoAbs]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y}},{key:"clone",value:function(){return new n(void 0,this._x,this._y)}}]),n}(e);Object.defineProperties(o.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0},y:{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0}});var c=function(t){function n(t,a,i){var o;return r(this,n),(o=u(this,l(n).call(this,e.PATHSEG_LINETO_REL,"l",t)))._x=a,o._y=i,o}return s(n,t),i(n,[{key:"toString",value:function(){return"[object SVGPathSegLinetoRel]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y}},{key:"clone",value:function(){return new n(void 0,this._x,this._y)}}]),n}(e);Object.defineProperties(c.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0},y:{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0}});var d=function(t){function n(t,a,i,o,s,c,d){var h;return r(this,n),(h=u(this,l(n).call(this,e.PATHSEG_CURVETO_CUBIC_ABS,"C",t)))._x=a,h._y=i,h._x1=o,h._y1=s,h._x2=c,h._y2=d,h}return s(n,t),i(n,[{key:"toString",value:function(){return"[object SVGPathSegCurvetoCubicAbs]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x2+" "+this._y2+" "+this._x+" "+this._y}},{key:"clone",value:function(){return new n(void 0,this._x,this._y,this._x1,this._y1,this._x2,this._y2)}}]),n}(e);Object.defineProperties(d.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0},y:{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0},x1:{get:function(){return this._x1},set:function(e){this._x1=e,this._segmentChanged()},enumerable:!0},y1:{get:function(){return this._y1},set:function(e){this._y1=e,this._segmentChanged()},enumerable:!0},x2:{get:function(){return this._x2},set:function(e){this._x2=e,this._segmentChanged()},enumerable:!0},y2:{get:function(){return this._y2},set:function(e){this._y2=e,this._segmentChanged()},enumerable:!0}});var h=function(t){function n(t,a,i,o,s,c,d){var h;return r(this,n),(h=u(this,l(n).call(this,e.PATHSEG_CURVETO_CUBIC_REL,"c",t)))._x=a,h._y=i,h._x1=o,h._y1=s,h._x2=c,h._y2=d,h}return s(n,t),i(n,[{key:"toString",value:function(){return"[object SVGPathSegCurvetoCubicRel]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x2+" "+this._y2+" "+this._x+" "+this._y}},{key:"clone",value:function(){return new n(void 0,this._x,this._y,this._x1,this._y1,this._x2,this._y2)}}]),n}(e);Object.defineProperties(h.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0},y:{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0},x1:{get:function(){return this._x1},set:function(e){this._x1=e,this._segmentChanged()},enumerable:!0},y1:{get:function(){return this._y1},set:function(e){this._y1=e,this._segmentChanged()},enumerable:!0},x2:{get:function(){return this._x2},set:function(e){this._x2=e,this._segmentChanged()},enumerable:!0},y2:{get:function(){return this._y2},set:function(e){this._y2=e,this._segmentChanged()},enumerable:!0}});var p=function(t){function n(t,a,i,o,s){var c;return r(this,n),(c=u(this,l(n).call(this,e.PATHSEG_CURVETO_QUADRATIC_ABS,"Q",t)))._x=a,c._y=i,c._x1=o,c._y1=s,c}return s(n,t),i(n,[{key:"toString",value:function(){return"[object SVGPathSegCurvetoQuadraticAbs]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x+" "+this._y}},{key:"clone",value:function(){return new n(void 0,this._x,this._y,this._x1,this._y1)}}]),n}(e);Object.defineProperties(p.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0},y:{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0},x1:{get:function(){return this._x1},set:function(e){this._x1=e,this._segmentChanged()},enumerable:!0},y1:{get:function(){return this._y1},set:function(e){this._y1=e,this._segmentChanged()},enumerable:!0}});var f=function(t){function n(t,a,i,o,s){var c;return r(this,n),(c=u(this,l(n).call(this,e.PATHSEG_CURVETO_QUADRATIC_REL,"q",t)))._x=a,c._y=i,c._x1=o,c._y1=s,c}return s(n,t),i(n,[{key:"toString",value:function(){return"[object SVGPathSegCurvetoQuadraticRel]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x+" "+this._y}},{key:"clone",value:function(){return new n(void 0,this._x,this._y,this._x1,this._y1)}}]),n}(e);Object.defineProperties(f.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0},y:{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0},x1:{get:function(){return this._x1},set:function(e){this._x1=e,this._segmentChanged()},enumerable:!0},y1:{get:function(){return this._y1},set:function(e){this._y1=e,this._segmentChanged()},enumerable:!0}});var g=function(t){function n(t,a,i,o,s,c,d,h){var p;return r(this,n),(p=u(this,l(n).call(this,e.PATHSEG_ARC_ABS,"A",t)))._x=a,p._y=i,p._r1=o,p._r2=s,p._angle=c,p._largeArcFlag=d,p._sweepFlag=h,p}return s(n,t),i(n,[{key:"toString",value:function(){return"[object SVGPathSegArcAbs]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._r1+" "+this._r2+" "+this._angle+" "+(this._largeArcFlag?"1":"0")+" "+(this._sweepFlag?"1":"0")+" "+this._x+" "+this._y}},{key:"clone",value:function(){return new n(void 0,this._x,this._y,this._r1,this._r2,this._angle,this._largeArcFlag,this._sweepFlag)}}]),n}(e);Object.defineProperties(g.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0},y:{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0},r1:{get:function(){return this._r1},set:function(e){this._r1=e,this._segmentChanged()},enumerable:!0},r2:{get:function(){return this._r2},set:function(e){this._r2=e,this._segmentChanged()},enumerable:!0},angle:{get:function(){return this._angle},set:function(e){this._angle=e,this._segmentChanged()},enumerable:!0},largeArcFlag:{get:function(){return this._largeArcFlag},set:function(e){this._largeArcFlag=e,this._segmentChanged()},enumerable:!0},sweepFlag:{get:function(){return this._sweepFlag},set:function(e){this._sweepFlag=e,this._segmentChanged()},enumerable:!0}});var m=function(t){function n(t,a,i,o,s,c,d,h){var p;return r(this,n),(p=u(this,l(n).call(this,e.PATHSEG_ARC_REL,"a",t)))._x=a,p._y=i,p._r1=o,p._r2=s,p._angle=c,p._largeArcFlag=d,p._sweepFlag=h,p}return s(n,t),i(n,[{key:"toString",value:function(){return"[object SVGPathSegArcRel]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._r1+" "+this._r2+" "+this._angle+" "+(this._largeArcFlag?"1":"0")+" "+(this._sweepFlag?"1":"0")+" "+this._x+" "+this._y}},{key:"clone",value:function(){return new n(void 0,this._x,this._y,this._r1,this._r2,this._angle,this._largeArcFlag,this._sweepFlag)}}]),n}(e);Object.defineProperties(m.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0},y:{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0},r1:{get:function(){return this._r1},set:function(e){this._r1=e,this._segmentChanged()},enumerable:!0},r2:{get:function(){return this._r2},set:function(e){this._r2=e,this._segmentChanged()},enumerable:!0},angle:{get:function(){return this._angle},set:function(e){this._angle=e,this._segmentChanged()},enumerable:!0},largeArcFlag:{get:function(){return this._largeArcFlag},set:function(e){this._largeArcFlag=e,this._segmentChanged()},enumerable:!0},sweepFlag:{get:function(){return this._sweepFlag},set:function(e){this._sweepFlag=e,this._segmentChanged()},enumerable:!0}});var v=function(t){function n(t,a){var i;return r(this,n),(i=u(this,l(n).call(this,e.PATHSEG_LINETO_HORIZONTAL_ABS,"H",t)))._x=a,i}return s(n,t),i(n,[{key:"toString",value:function(){return"[object SVGPathSegLinetoHorizontalAbs]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._x}},{key:"clone",value:function(){return new n(void 0,this._x)}}]),n}(e);Object.defineProperty(v.prototype,"x",{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0});var y=function(t){function n(t,a){var i;return r(this,n),(i=u(this,l(n).call(this,e.PATHSEG_LINETO_HORIZONTAL_REL,"h",t)))._x=a,i}return s(n,t),i(n,[{key:"toString",value:function(){return"[object SVGPathSegLinetoHorizontalRel]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._x}},{key:"clone",value:function(){return new n(void 0,this._x)}}]),n}(e);Object.defineProperty(y.prototype,"x",{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0});var _=function(t){function n(t,a){var i;return r(this,n),(i=u(this,l(n).call(this,e.PATHSEG_LINETO_VERTICAL_ABS,"V",t)))._y=a,i}return s(n,t),i(n,[{key:"toString",value:function(){return"[object SVGPathSegLinetoVerticalAbs]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._y}},{key:"clone",value:function(){return new n(void 0,this._y)}}]),n}(e);Object.defineProperty(_.prototype,"y",{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0});var b=function(t){function n(t,a){var i;return r(this,n),(i=u(this,l(n).call(this,e.PATHSEG_LINETO_VERTICAL_REL,"v",t)))._y=a,i}return s(n,t),i(n,[{key:"toString",value:function(){return"[object SVGPathSegLinetoVerticalRel]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._y}},{key:"clone",value:function(){return new n(void 0,this._y)}}]),n}(e);Object.defineProperty(b.prototype,"y",{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0});var x=function(t){function n(t,a,i,o,s){var c;return r(this,n),(c=u(this,l(n).call(this,e.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS,"S",t)))._x=a,c._y=i,c._x2=o,c._y2=s,c}return s(n,t),i(n,[{key:"toString",value:function(){return"[object SVGPathSegCurvetoCubicSmoothAbs]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._x2+" "+this._y2+" "+this._x+" "+this._y}},{key:"clone",value:function(){return new n(void 0,this._x,this._y,this._x2,this._y2)}}]),n}(e);Object.defineProperties(x.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0},y:{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0},x2:{get:function(){return this._x2},set:function(e){this._x2=e,this._segmentChanged()},enumerable:!0},y2:{get:function(){return this._y2},set:function(e){this._y2=e,this._segmentChanged()},enumerable:!0}});var w=function(t){function n(t,a,i,o,s){var c;return r(this,n),(c=u(this,l(n).call(this,e.PATHSEG_CURVETO_CUBIC_SMOOTH_REL,"s",t)))._x=a,c._y=i,c._x2=o,c._y2=s,c}return s(n,t),i(n,[{key:"toString",value:function(){return"[object SVGPathSegCurvetoCubicSmoothRel]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._x2+" "+this._y2+" "+this._x+" "+this._y}},{key:"clone",value:function(){return new n(void 0,this._x,this._y,this._x2,this._y2)}}]),n}(e);Object.defineProperties(w.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0},y:{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0},x2:{get:function(){return this._x2},set:function(e){this._x2=e,this._segmentChanged()},enumerable:!0},y2:{get:function(){return this._y2},set:function(e){this._y2=e,this._segmentChanged()},enumerable:!0}});var S=function(t){function n(t,a,i){var o;return r(this,n),(o=u(this,l(n).call(this,e.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS,"T",t)))._x=a,o._y=i,o}return s(n,t),i(n,[{key:"toString",value:function(){return"[object SVGPathSegCurvetoQuadraticSmoothAbs]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y}},{key:"clone",value:function(){return new n(void 0,this._x,this._y)}}]),n}(e);Object.defineProperties(S.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0},y:{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0}});var k=function(t){function n(t,a,i){var o;return r(this,n),(o=u(this,l(n).call(this,e.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL,"t",t)))._x=a,o._y=i,o}return s(n,t),i(n,[{key:"toString",value:function(){return"[object SVGPathSegCurvetoQuadraticSmoothRel]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y}},{key:"clone",value:function(){return new n(void 0,this._x,this._y)}}]),n}(e);Object.defineProperties(k.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0},y:{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0}}),SVGPathElement.prototype.createSVGPathSegClosePath=function(){return new t(void 0)},SVGPathElement.prototype.createSVGPathSegMovetoAbs=function(e,t){return new n(void 0,e,t)},SVGPathElement.prototype.createSVGPathSegMovetoRel=function(e,t){return new a(void 0,e,t)},SVGPathElement.prototype.createSVGPathSegLinetoAbs=function(e,t){return new o(void 0,e,t)},SVGPathElement.prototype.createSVGPathSegLinetoRel=function(e,t){return new c(void 0,e,t)},SVGPathElement.prototype.createSVGPathSegCurvetoCubicAbs=function(e,t,n,r,a,i){return new d(void 0,e,t,n,r,a,i)},SVGPathElement.prototype.createSVGPathSegCurvetoCubicRel=function(e,t,n,r,a,i){return new h(void 0,e,t,n,r,a,i)},SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticAbs=function(e,t,n,r){return new p(void 0,e,t,n,r)},SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticRel=function(e,t,n,r){return new f(void 0,e,t,n,r)},SVGPathElement.prototype.createSVGPathSegArcAbs=function(e,t,n,r,a,i,o){return new g(void 0,e,t,n,r,a,i,o)},SVGPathElement.prototype.createSVGPathSegArcRel=function(e,t,n,r,a,i,o){return new m(void 0,e,t,n,r,a,i,o)},SVGPathElement.prototype.createSVGPathSegLinetoHorizontalAbs=function(e){return new v(void 0,e)},SVGPathElement.prototype.createSVGPathSegLinetoHorizontalRel=function(e){return new y(void 0,e)},SVGPathElement.prototype.createSVGPathSegLinetoVerticalAbs=function(e){return new _(void 0,e)},SVGPathElement.prototype.createSVGPathSegLinetoVerticalRel=function(e){return new b(void 0,e)},SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothAbs=function(e,t,n,r){return new x(void 0,e,t,n,r)},SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothRel=function(e,t,n,r){return new w(void 0,e,t,n,r)},SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothAbs=function(e,t){return new S(void 0,e,t)},SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothRel=function(e,t){return new k(void 0,e,t)},"getPathSegAtLength"in SVGPathElement.prototype||(SVGPathElement.prototype.getPathSegAtLength=function(e){if(void 0===e||!isFinite(e))throw new Error("Invalid arguments.");var t=document.createElementNS("http://www.w3.org/2000/svg","path");t.setAttribute("d",this.getAttribute("d"));var n=t.pathSegList.numberOfItems-1;if(n<=0)return 0;do{if(t.pathSegList.removeItem(n),e>t.getTotalLength())break;n--}while(n>0);return n}),window.SVGPathSeg=e,window.SVGPathSegClosePath=t,window.SVGPathSegMovetoAbs=n,window.SVGPathSegMovetoRel=a,window.SVGPathSegLinetoAbs=o,window.SVGPathSegLinetoRel=c,window.SVGPathSegCurvetoCubicAbs=d,window.SVGPathSegCurvetoCubicRel=h,window.SVGPathSegCurvetoQuadraticAbs=p,window.SVGPathSegCurvetoQuadraticRel=f,window.SVGPathSegArcAbs=g,window.SVGPathSegArcRel=m,window.SVGPathSegLinetoHorizontalAbs=v,window.SVGPathSegLinetoHorizontalRel=y,window.SVGPathSegLinetoVerticalAbs=_,window.SVGPathSegLinetoVerticalRel=b,window.SVGPathSegCurvetoCubicSmoothAbs=x,window.SVGPathSegCurvetoCubicSmoothRel=w,window.SVGPathSegCurvetoQuadraticSmoothAbs=S,window.SVGPathSegCurvetoQuadraticSmoothRel=k}if(!("SVGPathSegList"in window)||!("appendItem"in window.SVGPathSegList.prototype)){var C=function(){function e(t){r(this,e),this._pathElement=t,this._list=this._parsePath(this._pathElement.getAttribute("d")),this._mutationObserverConfig={attributes:!0,attributeFilter:["d"]},this._pathElementMutationObserver=new MutationObserver(this._updateListFromPathMutations.bind(this)),this._pathElementMutationObserver.observe(this._pathElement,this._mutationObserverConfig)}return i(e,[{key:"_checkPathSynchronizedToList",value:function(){this._updateListFromPathMutations(this._pathElementMutationObserver.takeRecords())}},{key:"_updateListFromPathMutations",value:function(e){if(this._pathElement){var t=!1;e.forEach((function(e){"d"===e.attributeName&&(t=!0)})),t&&(this._list=this._parsePath(this._pathElement.getAttribute("d")))}}},{key:"_writeListToPath",value:function(){this._pathElementMutationObserver.disconnect(),this._pathElement.setAttribute("d",e._pathSegArrayAsString(this._list)),this._pathElementMutationObserver.observe(this._pathElement,this._mutationObserverConfig)}},{key:"segmentChanged",value:function(e){this._writeListToPath()}},{key:"clear",value:function(){this._checkPathSynchronizedToList(),this._list.forEach((function(e){e._owningPathSegList=null})),this._list=[],this._writeListToPath()}},{key:"initialize",value:function(e){return this._checkPathSynchronizedToList(),this._list=[e],e._owningPathSegList=this,this._writeListToPath(),e}},{key:"_checkValidIndex",value:function(e){if(isNaN(e)||e<0||e>=this.numberOfItems)throw new Error("INDEX_SIZE_ERR")}},{key:"getItem",value:function(e){return this._checkPathSynchronizedToList(),this._checkValidIndex(e),this._list[e]}},{key:"insertItemBefore",value:function(e,t){return this._checkPathSynchronizedToList(),t>this.numberOfItems&&(t=this.numberOfItems),e._owningPathSegList&&(e=e.clone()),this._list.splice(t,0,e),e._owningPathSegList=this,this._writeListToPath(),e}},{key:"replaceItem",value:function(e,t){return this._checkPathSynchronizedToList(),e._owningPathSegList&&(e=e.clone()),this._checkValidIndex(t),this._list[t]=e,e._owningPathSegList=this,this._writeListToPath(),e}},{key:"removeItem",value:function(e){this._checkPathSynchronizedToList(),this._checkValidIndex(e);var t=this._list[e];return this._list.splice(e,1),this._writeListToPath(),t}},{key:"appendItem",value:function(e){return this._checkPathSynchronizedToList(),e._owningPathSegList&&(e=e.clone()),this._list.push(e),e._owningPathSegList=this,this._writeListToPath(),e}},{key:"_parsePath",value:function(e){if(!e||!e.length)return[];var t=this,n=function(){function e(){r(this,e),this.pathSegList=[]}return i(e,[{key:"appendSegment",value:function(e){this.pathSegList.push(e)}}]),e}(),a=function(){function e(t){r(this,e),this._string=t,this._currentIndex=0,this._endIndex=this._string.length,this._previousCommand=SVGPathSeg.PATHSEG_UNKNOWN,this._skipOptionalSpaces()}return i(e,[{key:"_isCurrentSpace",value:function(){var e=this._string[this._currentIndex];return e<=" "&&(" "===e||"\n"===e||"\t"===e||"\r"===e||"\f"===e)}},{key:"_skipOptionalSpaces",value:function(){for(;this._currentIndex="0"&&e<="9")&&t!==SVGPathSeg.PATHSEG_CLOSEPATH?t===SVGPathSeg.PATHSEG_MOVETO_ABS?SVGPathSeg.PATHSEG_LINETO_ABS:t===SVGPathSeg.PATHSEG_MOVETO_REL?SVGPathSeg.PATHSEG_LINETO_REL:t:SVGPathSeg.PATHSEG_UNKNOWN}},{key:"initialCommandIsMoveTo",value:function(){if(!this.hasMoreData())return!0;var e=this.peekSegmentType();return e===SVGPathSeg.PATHSEG_MOVETO_ABS||e===SVGPathSeg.PATHSEG_MOVETO_REL}},{key:"_parseNumber",value:function(){var e=0,t=0,n=1,r=0,a=1,i=1,o=this._currentIndex;if(this._skipOptionalSpaces(),this._currentIndex"9")&&"."!==this._string.charAt(this._currentIndex))){for(var s=this._currentIndex;this._currentIndex="0"&&this._string.charAt(this._currentIndex)<="9";)this._currentIndex++;if(this._currentIndex!==s)for(var l=this._currentIndex-1,c=1;l>=s;)t+=c*(this._string.charAt(l--)-"0"),c*=10;if(this._currentIndex=this._endIndex||this._string.charAt(this._currentIndex)<"0"||this._string.charAt(this._currentIndex)>"9")return;for(;this._currentIndex="0"&&this._string.charAt(this._currentIndex)<="9";)n*=10,r+=(this._string.charAt(this._currentIndex)-"0")/n,this._currentIndex+=1}if(this._currentIndex!==o&&this._currentIndex+1=this._endIndex||this._string.charAt(this._currentIndex)<"0"||this._string.charAt(this._currentIndex)>"9")return;for(;this._currentIndex="0"&&this._string.charAt(this._currentIndex)<="9";)e*=10,e+=this._string.charAt(this._currentIndex)-"0",this._currentIndex++}var u=t+r;if(u*=a,e&&(u*=Math.pow(10,i*e)),o!==this._currentIndex)return this._skipOptionalSpacesOrDelimiter(),u}}},{key:"_parseArcFlag",value:function(){if(!(this._currentIndex>=this._endIndex)){var e=!1,t=this._string.charAt(this._currentIndex++);if("0"===t)e=!1;else{if("1"!==t)return;e=!0}return this._skipOptionalSpacesOrDelimiter(),e}}},{key:"parseSegment",value:function(){var e=this._string[this._currentIndex],n=this._pathSegTypeFromChar(e);if(n===SVGPathSeg.PATHSEG_UNKNOWN){if(this._previousCommand===SVGPathSeg.PATHSEG_UNKNOWN)return null;if((n=this._nextCommandHelper(e,this._previousCommand))===SVGPathSeg.PATHSEG_UNKNOWN)return null}else this._currentIndex++;switch(this._previousCommand=n,n){case SVGPathSeg.PATHSEG_MOVETO_REL:return new SVGPathSegMovetoRel(t,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_MOVETO_ABS:return new SVGPathSegMovetoAbs(t,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_REL:return new SVGPathSegLinetoRel(t,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_ABS:return new SVGPathSegLinetoAbs(t,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL:return new SVGPathSegLinetoHorizontalRel(t,this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS:return new SVGPathSegLinetoHorizontalAbs(t,this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL:return new SVGPathSegLinetoVerticalRel(t,this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS:return new SVGPathSegLinetoVerticalAbs(t,this._parseNumber());case SVGPathSeg.PATHSEG_CLOSEPATH:return this._skipOptionalSpaces(),new SVGPathSegClosePath(t);case SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL:var r={x1:this._parseNumber(),y1:this._parseNumber(),x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoCubicRel(t,r.x,r.y,r.x1,r.y1,r.x2,r.y2);case SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS:var a={x1:this._parseNumber(),y1:this._parseNumber(),x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoCubicAbs(t,a.x,a.y,a.x1,a.y1,a.x2,a.y2);case SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL:var i={x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoCubicSmoothRel(t,i.x,i.y,i.x2,i.y2);case SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS:var o={x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoCubicSmoothAbs(t,o.x,o.y,o.x2,o.y2);case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL:var s={x1:this._parseNumber(),y1:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoQuadraticRel(t,s.x,s.y,s.x1,s.y1);case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS:var l={x1:this._parseNumber(),y1:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoQuadraticAbs(t,l.x,l.y,l.x1,l.y1);case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL:return new SVGPathSegCurvetoQuadraticSmoothRel(t,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS:return new SVGPathSegCurvetoQuadraticSmoothAbs(t,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_ARC_REL:var c={x1:this._parseNumber(),y1:this._parseNumber(),arcAngle:this._parseNumber(),arcLarge:this._parseArcFlag(),arcSweep:this._parseArcFlag(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegArcRel(t,c.x,c.y,c.x1,c.y1,c.arcAngle,c.arcLarge,c.arcSweep);case SVGPathSeg.PATHSEG_ARC_ABS:var u={x1:this._parseNumber(),y1:this._parseNumber(),arcAngle:this._parseNumber(),arcLarge:this._parseArcFlag(),arcSweep:this._parseArcFlag(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegArcAbs(t,u.x,u.y,u.x1,u.y1,u.arcAngle,u.arcLarge,u.arcSweep);default:throw new Error("Unknown path seg type.")}}}]),e}(),o=new n,s=new a(e);if(!s.initialCommandIsMoveTo())return[];for(;s.hasMoreData();){var l=s.parseSegment();if(!l)return[];o.appendSegment(l)}return o.pathSegList}}],[{key:"_pathSegArrayAsString",value:function(e){var t="",n=!0;return e.forEach((function(e){n?(n=!1,t+=e._asPathString()):t+=" "+e._asPathString()})),t}}]),e}();C.prototype.classname="SVGPathSegList",Object.defineProperty(C.prototype,"numberOfItems",{get:function(){return this._checkPathSynchronizedToList(),this._list.length},enumerable:!0}),Object.defineProperties(SVGPathElement.prototype,{pathSegList:{get:function(){return this._pathSegList||(this._pathSegList=new C(this)),this._pathSegList},enumerable:!0},normalizedPathSegList:{get:function(){return this.pathSegList},enumerable:!0},animatedPathSegList:{get:function(){return this.pathSegList},enumerable:!0},animatedNormalizedPathSegList:{get:function(){return this.pathSegList},enumerable:!0}}),window.SVGPathSegList=C}}();var m,v=jQuery,y=(Boolean(document.createElementNS&&document.createElementNS(f.SVG,"svg").createSVGRect),navigator.userAgent),_=document.createElementNS(f.SVG,"svg"),b=Boolean(window.opera),x=y.includes("AppleWebKit"),w=y.includes("Gecko/"),S=y.includes("MSIE"),k=y.includes("Chrome/"),C=(y.includes("Windows"),y.includes("Macintosh")),A="ontouchstart"in window,E=Boolean(_.querySelector),G=Boolean(document.evaluate),P=function(){var e=document.createElementNS(f.SVG,"path");e.setAttribute("d","M0,0 10,10");var t=e.pathSegList,n=e.createSVGPathSegLinetoAbs(5,5);try{return t.replaceItem(n,1),!0}catch(e){}return!1}(),I=function(){var e=document.createElementNS(f.SVG,"path");e.setAttribute("d","M0,0 10,10");var t=e.pathSegList,n=e.createSVGPathSegLinetoAbs(5,5);try{return t.insertItemBefore(n,1),!0}catch(e){}return!1}(),N=function(){var e=document.createElementNS(f.SVG,"svg"),t=document.createElementNS(f.SVG,"svg");document.documentElement.append(e),t.setAttribute("x",5),e.append(t);var n=document.createElementNS(f.SVG,"text");n.textContent="a",t.append(n);try{return 0===n.getStartPositionOfChar(0).x}catch(e){return!1}finally{e.remove()}}(),T=function(){var e=document.createElementNS(f.SVG,"svg");document.documentElement.append(e);var t=document.createElementNS(f.SVG,"path");t.setAttribute("d","M0,0 C0,0 10,10 10,0"),e.append(t);var n=t.getBBox();return e.remove(),n.height>4&&n.height<5}(),L=function(){var e=document.createElementNS(f.SVG,"svg");document.documentElement.append(e);var t=document.createElementNS(f.SVG,"path");t.setAttribute("d","M0,0 10,0");var n=document.createElementNS(f.SVG,"path");n.setAttribute("d","M5,0 15,0");var r=document.createElementNS(f.SVG,"g");r.append(t,n),e.append(r);var a=r.getBBox();return e.remove(),15===a.width}(),M=(function(){var e=document.createElementNS(f.SVG,"rect");e.setAttribute("x",.1);var t=!e.cloneNode(!1).getAttribute("x").includes(",");t||v.alert('NOTE: This version of Opera is known to contain bugs in SVG-edit.\nPlease upgrade to the latest version in which the problems have been fixed.')}(),(m=document.createElementNS(f.SVG,"rect")).setAttribute("style","vector-effect:non-scaling-stroke"),"non-scaling-stroke"===m.style.vectorEffect),O=function(){var t=document.createElementNS(f.SVG,"rect").transform.baseVal,n=_.createSVGTransform();t.appendItem(n);var r=t.getItem(0),a=function(t){return t&&"object"===e(t)&&"function"==typeof t.setMatrix&&"angle"in t};return a(r)&&a(n)&&r.type===n.type&&r.angle===n.angle&&r.matrix.a===n.matrix.a&&r.matrix.b===n.matrix.b&&r.matrix.c===n.matrix.c&&r.matrix.d===n.matrix.d&&r.matrix.e===n.matrix.e&&r.matrix.f===n.matrix.f}(),j=function(){return x},V=function(){return w},R=function(){return S},B=function(){return k},U=function(){return C},F=function(){return A},D=function(){return M}; +var _={HTML:"http://www.w3.org/1999/xhtml",MATH:"http://www.w3.org/1998/Math/MathML",SE:"http://svg-edit.googlecode.com",SVG:"http://www.w3.org/2000/svg",XLINK:"http://www.w3.org/1999/xlink",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"},b=function(){var e={};return Object.entries(_).forEach((function(t){var n=f(t,2),r=n[0],a=n[1];e[a]=r.toLowerCase()})),e};!function(){if(!("SVGPathSeg"in window)){var e=function(){function e(t,n,a){r(this,e),this.pathSegType=t,this.pathSegTypeAsLetter=n,this._owningPathSegList=a}return i(e,[{key:"_segmentChanged",value:function(){this._owningPathSegList&&this._owningPathSegList.segmentChanged(this)}}]),e}();e.prototype.classname="SVGPathSeg",e.PATHSEG_UNKNOWN=0,e.PATHSEG_CLOSEPATH=1,e.PATHSEG_MOVETO_ABS=2,e.PATHSEG_MOVETO_REL=3,e.PATHSEG_LINETO_ABS=4,e.PATHSEG_LINETO_REL=5,e.PATHSEG_CURVETO_CUBIC_ABS=6,e.PATHSEG_CURVETO_CUBIC_REL=7,e.PATHSEG_CURVETO_QUADRATIC_ABS=8,e.PATHSEG_CURVETO_QUADRATIC_REL=9,e.PATHSEG_ARC_ABS=10,e.PATHSEG_ARC_REL=11,e.PATHSEG_LINETO_HORIZONTAL_ABS=12,e.PATHSEG_LINETO_HORIZONTAL_REL=13,e.PATHSEG_LINETO_VERTICAL_ABS=14,e.PATHSEG_LINETO_VERTICAL_REL=15,e.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS=16,e.PATHSEG_CURVETO_CUBIC_SMOOTH_REL=17,e.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS=18,e.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL=19;var t=function(t){s(a,t);var n=h(a);function a(t){return r(this,a),n.call(this,e.PATHSEG_CLOSEPATH,"z",t)}return i(a,[{key:"toString",value:function(){return"[object SVGPathSegClosePath]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter}},{key:"clone",value:function(){return new a(void 0)}}]),a}(e),n=function(t){s(a,t);var n=h(a);function a(t,i,o){var s;return r(this,a),(s=n.call(this,e.PATHSEG_MOVETO_ABS,"M",t))._x=i,s._y=o,s}return i(a,[{key:"toString",value:function(){return"[object SVGPathSegMovetoAbs]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y}},{key:"clone",value:function(){return new a(void 0,this._x,this._y)}}]),a}(e);Object.defineProperties(n.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0},y:{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0}});var a=function(t){s(a,t);var n=h(a);function a(t,i,o){var s;return r(this,a),(s=n.call(this,e.PATHSEG_MOVETO_REL,"m",t))._x=i,s._y=o,s}return i(a,[{key:"toString",value:function(){return"[object SVGPathSegMovetoRel]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y}},{key:"clone",value:function(){return new a(void 0,this._x,this._y)}}]),a}(e);Object.defineProperties(a.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0},y:{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0}});var o=function(t){s(a,t);var n=h(a);function a(t,i,o){var s;return r(this,a),(s=n.call(this,e.PATHSEG_LINETO_ABS,"L",t))._x=i,s._y=o,s}return i(a,[{key:"toString",value:function(){return"[object SVGPathSegLinetoAbs]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y}},{key:"clone",value:function(){return new a(void 0,this._x,this._y)}}]),a}(e);Object.defineProperties(o.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0},y:{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0}});var l=function(t){s(a,t);var n=h(a);function a(t,i,o){var s;return r(this,a),(s=n.call(this,e.PATHSEG_LINETO_REL,"l",t))._x=i,s._y=o,s}return i(a,[{key:"toString",value:function(){return"[object SVGPathSegLinetoRel]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y}},{key:"clone",value:function(){return new a(void 0,this._x,this._y)}}]),a}(e);Object.defineProperties(l.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0},y:{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0}});var c=function(t){s(a,t);var n=h(a);function a(t,i,o,s,l,c,u){var d;return r(this,a),(d=n.call(this,e.PATHSEG_CURVETO_CUBIC_ABS,"C",t))._x=i,d._y=o,d._x1=s,d._y1=l,d._x2=c,d._y2=u,d}return i(a,[{key:"toString",value:function(){return"[object SVGPathSegCurvetoCubicAbs]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x2+" "+this._y2+" "+this._x+" "+this._y}},{key:"clone",value:function(){return new a(void 0,this._x,this._y,this._x1,this._y1,this._x2,this._y2)}}]),a}(e);Object.defineProperties(c.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0},y:{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0},x1:{get:function(){return this._x1},set:function(e){this._x1=e,this._segmentChanged()},enumerable:!0},y1:{get:function(){return this._y1},set:function(e){this._y1=e,this._segmentChanged()},enumerable:!0},x2:{get:function(){return this._x2},set:function(e){this._x2=e,this._segmentChanged()},enumerable:!0},y2:{get:function(){return this._y2},set:function(e){this._y2=e,this._segmentChanged()},enumerable:!0}});var u=function(t){s(a,t);var n=h(a);function a(t,i,o,s,l,c,u){var d;return r(this,a),(d=n.call(this,e.PATHSEG_CURVETO_CUBIC_REL,"c",t))._x=i,d._y=o,d._x1=s,d._y1=l,d._x2=c,d._y2=u,d}return i(a,[{key:"toString",value:function(){return"[object SVGPathSegCurvetoCubicRel]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x2+" "+this._y2+" "+this._x+" "+this._y}},{key:"clone",value:function(){return new a(void 0,this._x,this._y,this._x1,this._y1,this._x2,this._y2)}}]),a}(e);Object.defineProperties(u.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0},y:{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0},x1:{get:function(){return this._x1},set:function(e){this._x1=e,this._segmentChanged()},enumerable:!0},y1:{get:function(){return this._y1},set:function(e){this._y1=e,this._segmentChanged()},enumerable:!0},x2:{get:function(){return this._x2},set:function(e){this._x2=e,this._segmentChanged()},enumerable:!0},y2:{get:function(){return this._y2},set:function(e){this._y2=e,this._segmentChanged()},enumerable:!0}});var d=function(t){s(a,t);var n=h(a);function a(t,i,o,s,l){var c;return r(this,a),(c=n.call(this,e.PATHSEG_CURVETO_QUADRATIC_ABS,"Q",t))._x=i,c._y=o,c._x1=s,c._y1=l,c}return i(a,[{key:"toString",value:function(){return"[object SVGPathSegCurvetoQuadraticAbs]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x+" "+this._y}},{key:"clone",value:function(){return new a(void 0,this._x,this._y,this._x1,this._y1)}}]),a}(e);Object.defineProperties(d.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0},y:{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0},x1:{get:function(){return this._x1},set:function(e){this._x1=e,this._segmentChanged()},enumerable:!0},y1:{get:function(){return this._y1},set:function(e){this._y1=e,this._segmentChanged()},enumerable:!0}});var f=function(t){s(a,t);var n=h(a);function a(t,i,o,s,l){var c;return r(this,a),(c=n.call(this,e.PATHSEG_CURVETO_QUADRATIC_REL,"q",t))._x=i,c._y=o,c._x1=s,c._y1=l,c}return i(a,[{key:"toString",value:function(){return"[object SVGPathSegCurvetoQuadraticRel]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x+" "+this._y}},{key:"clone",value:function(){return new a(void 0,this._x,this._y,this._x1,this._y1)}}]),a}(e);Object.defineProperties(f.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0},y:{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0},x1:{get:function(){return this._x1},set:function(e){this._x1=e,this._segmentChanged()},enumerable:!0},y1:{get:function(){return this._y1},set:function(e){this._y1=e,this._segmentChanged()},enumerable:!0}});var p=function(t){s(a,t);var n=h(a);function a(t,i,o,s,l,c,u,d){var h;return r(this,a),(h=n.call(this,e.PATHSEG_ARC_ABS,"A",t))._x=i,h._y=o,h._r1=s,h._r2=l,h._angle=c,h._largeArcFlag=u,h._sweepFlag=d,h}return i(a,[{key:"toString",value:function(){return"[object SVGPathSegArcAbs]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._r1+" "+this._r2+" "+this._angle+" "+(this._largeArcFlag?"1":"0")+" "+(this._sweepFlag?"1":"0")+" "+this._x+" "+this._y}},{key:"clone",value:function(){return new a(void 0,this._x,this._y,this._r1,this._r2,this._angle,this._largeArcFlag,this._sweepFlag)}}]),a}(e);Object.defineProperties(p.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0},y:{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0},r1:{get:function(){return this._r1},set:function(e){this._r1=e,this._segmentChanged()},enumerable:!0},r2:{get:function(){return this._r2},set:function(e){this._r2=e,this._segmentChanged()},enumerable:!0},angle:{get:function(){return this._angle},set:function(e){this._angle=e,this._segmentChanged()},enumerable:!0},largeArcFlag:{get:function(){return this._largeArcFlag},set:function(e){this._largeArcFlag=e,this._segmentChanged()},enumerable:!0},sweepFlag:{get:function(){return this._sweepFlag},set:function(e){this._sweepFlag=e,this._segmentChanged()},enumerable:!0}});var g=function(t){s(a,t);var n=h(a);function a(t,i,o,s,l,c,u,d){var h;return r(this,a),(h=n.call(this,e.PATHSEG_ARC_REL,"a",t))._x=i,h._y=o,h._r1=s,h._r2=l,h._angle=c,h._largeArcFlag=u,h._sweepFlag=d,h}return i(a,[{key:"toString",value:function(){return"[object SVGPathSegArcRel]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._r1+" "+this._r2+" "+this._angle+" "+(this._largeArcFlag?"1":"0")+" "+(this._sweepFlag?"1":"0")+" "+this._x+" "+this._y}},{key:"clone",value:function(){return new a(void 0,this._x,this._y,this._r1,this._r2,this._angle,this._largeArcFlag,this._sweepFlag)}}]),a}(e);Object.defineProperties(g.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0},y:{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0},r1:{get:function(){return this._r1},set:function(e){this._r1=e,this._segmentChanged()},enumerable:!0},r2:{get:function(){return this._r2},set:function(e){this._r2=e,this._segmentChanged()},enumerable:!0},angle:{get:function(){return this._angle},set:function(e){this._angle=e,this._segmentChanged()},enumerable:!0},largeArcFlag:{get:function(){return this._largeArcFlag},set:function(e){this._largeArcFlag=e,this._segmentChanged()},enumerable:!0},sweepFlag:{get:function(){return this._sweepFlag},set:function(e){this._sweepFlag=e,this._segmentChanged()},enumerable:!0}});var m=function(t){s(a,t);var n=h(a);function a(t,i){var o;return r(this,a),(o=n.call(this,e.PATHSEG_LINETO_HORIZONTAL_ABS,"H",t))._x=i,o}return i(a,[{key:"toString",value:function(){return"[object SVGPathSegLinetoHorizontalAbs]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._x}},{key:"clone",value:function(){return new a(void 0,this._x)}}]),a}(e);Object.defineProperty(m.prototype,"x",{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0});var v=function(t){s(a,t);var n=h(a);function a(t,i){var o;return r(this,a),(o=n.call(this,e.PATHSEG_LINETO_HORIZONTAL_REL,"h",t))._x=i,o}return i(a,[{key:"toString",value:function(){return"[object SVGPathSegLinetoHorizontalRel]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._x}},{key:"clone",value:function(){return new a(void 0,this._x)}}]),a}(e);Object.defineProperty(v.prototype,"x",{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0});var y=function(t){s(a,t);var n=h(a);function a(t,i){var o;return r(this,a),(o=n.call(this,e.PATHSEG_LINETO_VERTICAL_ABS,"V",t))._y=i,o}return i(a,[{key:"toString",value:function(){return"[object SVGPathSegLinetoVerticalAbs]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._y}},{key:"clone",value:function(){return new a(void 0,this._y)}}]),a}(e);Object.defineProperty(y.prototype,"y",{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0});var _=function(t){s(a,t);var n=h(a);function a(t,i){var o;return r(this,a),(o=n.call(this,e.PATHSEG_LINETO_VERTICAL_REL,"v",t))._y=i,o}return i(a,[{key:"toString",value:function(){return"[object SVGPathSegLinetoVerticalRel]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._y}},{key:"clone",value:function(){return new a(void 0,this._y)}}]),a}(e);Object.defineProperty(_.prototype,"y",{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0});var b=function(t){s(a,t);var n=h(a);function a(t,i,o,s,l){var c;return r(this,a),(c=n.call(this,e.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS,"S",t))._x=i,c._y=o,c._x2=s,c._y2=l,c}return i(a,[{key:"toString",value:function(){return"[object SVGPathSegCurvetoCubicSmoothAbs]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._x2+" "+this._y2+" "+this._x+" "+this._y}},{key:"clone",value:function(){return new a(void 0,this._x,this._y,this._x2,this._y2)}}]),a}(e);Object.defineProperties(b.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0},y:{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0},x2:{get:function(){return this._x2},set:function(e){this._x2=e,this._segmentChanged()},enumerable:!0},y2:{get:function(){return this._y2},set:function(e){this._y2=e,this._segmentChanged()},enumerable:!0}});var x=function(t){s(a,t);var n=h(a);function a(t,i,o,s,l){var c;return r(this,a),(c=n.call(this,e.PATHSEG_CURVETO_CUBIC_SMOOTH_REL,"s",t))._x=i,c._y=o,c._x2=s,c._y2=l,c}return i(a,[{key:"toString",value:function(){return"[object SVGPathSegCurvetoCubicSmoothRel]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._x2+" "+this._y2+" "+this._x+" "+this._y}},{key:"clone",value:function(){return new a(void 0,this._x,this._y,this._x2,this._y2)}}]),a}(e);Object.defineProperties(x.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0},y:{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0},x2:{get:function(){return this._x2},set:function(e){this._x2=e,this._segmentChanged()},enumerable:!0},y2:{get:function(){return this._y2},set:function(e){this._y2=e,this._segmentChanged()},enumerable:!0}});var w=function(t){s(a,t);var n=h(a);function a(t,i,o){var s;return r(this,a),(s=n.call(this,e.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS,"T",t))._x=i,s._y=o,s}return i(a,[{key:"toString",value:function(){return"[object SVGPathSegCurvetoQuadraticSmoothAbs]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y}},{key:"clone",value:function(){return new a(void 0,this._x,this._y)}}]),a}(e);Object.defineProperties(w.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0},y:{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0}});var S=function(t){s(a,t);var n=h(a);function a(t,i,o){var s;return r(this,a),(s=n.call(this,e.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL,"t",t))._x=i,s._y=o,s}return i(a,[{key:"toString",value:function(){return"[object SVGPathSegCurvetoQuadraticSmoothRel]"}},{key:"_asPathString",value:function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y}},{key:"clone",value:function(){return new a(void 0,this._x,this._y)}}]),a}(e);Object.defineProperties(S.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0},y:{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0}}),SVGPathElement.prototype.createSVGPathSegClosePath=function(){return new t(void 0)},SVGPathElement.prototype.createSVGPathSegMovetoAbs=function(e,t){return new n(void 0,e,t)},SVGPathElement.prototype.createSVGPathSegMovetoRel=function(e,t){return new a(void 0,e,t)},SVGPathElement.prototype.createSVGPathSegLinetoAbs=function(e,t){return new o(void 0,e,t)},SVGPathElement.prototype.createSVGPathSegLinetoRel=function(e,t){return new l(void 0,e,t)},SVGPathElement.prototype.createSVGPathSegCurvetoCubicAbs=function(e,t,n,r,a,i){return new c(void 0,e,t,n,r,a,i)},SVGPathElement.prototype.createSVGPathSegCurvetoCubicRel=function(e,t,n,r,a,i){return new u(void 0,e,t,n,r,a,i)},SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticAbs=function(e,t,n,r){return new d(void 0,e,t,n,r)},SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticRel=function(e,t,n,r){return new f(void 0,e,t,n,r)},SVGPathElement.prototype.createSVGPathSegArcAbs=function(e,t,n,r,a,i,o){return new p(void 0,e,t,n,r,a,i,o)},SVGPathElement.prototype.createSVGPathSegArcRel=function(e,t,n,r,a,i,o){return new g(void 0,e,t,n,r,a,i,o)},SVGPathElement.prototype.createSVGPathSegLinetoHorizontalAbs=function(e){return new m(void 0,e)},SVGPathElement.prototype.createSVGPathSegLinetoHorizontalRel=function(e){return new v(void 0,e)},SVGPathElement.prototype.createSVGPathSegLinetoVerticalAbs=function(e){return new y(void 0,e)},SVGPathElement.prototype.createSVGPathSegLinetoVerticalRel=function(e){return new _(void 0,e)},SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothAbs=function(e,t,n,r){return new b(void 0,e,t,n,r)},SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothRel=function(e,t,n,r){return new x(void 0,e,t,n,r)},SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothAbs=function(e,t){return new w(void 0,e,t)},SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothRel=function(e,t){return new S(void 0,e,t)},"getPathSegAtLength"in SVGPathElement.prototype||(SVGPathElement.prototype.getPathSegAtLength=function(e){if(void 0===e||!isFinite(e))throw new Error("Invalid arguments.");var t=document.createElementNS("http://www.w3.org/2000/svg","path");t.setAttribute("d",this.getAttribute("d"));var n=t.pathSegList.numberOfItems-1;if(n<=0)return 0;do{if(t.pathSegList.removeItem(n),e>t.getTotalLength())break;n--}while(n>0);return n}),window.SVGPathSeg=e,window.SVGPathSegClosePath=t,window.SVGPathSegMovetoAbs=n,window.SVGPathSegMovetoRel=a,window.SVGPathSegLinetoAbs=o,window.SVGPathSegLinetoRel=l,window.SVGPathSegCurvetoCubicAbs=c,window.SVGPathSegCurvetoCubicRel=u,window.SVGPathSegCurvetoQuadraticAbs=d,window.SVGPathSegCurvetoQuadraticRel=f,window.SVGPathSegArcAbs=p,window.SVGPathSegArcRel=g,window.SVGPathSegLinetoHorizontalAbs=m,window.SVGPathSegLinetoHorizontalRel=v,window.SVGPathSegLinetoVerticalAbs=y,window.SVGPathSegLinetoVerticalRel=_,window.SVGPathSegCurvetoCubicSmoothAbs=b,window.SVGPathSegCurvetoCubicSmoothRel=x,window.SVGPathSegCurvetoQuadraticSmoothAbs=w,window.SVGPathSegCurvetoQuadraticSmoothRel=S}if(!("SVGPathSegList"in window)||!("appendItem"in window.SVGPathSegList.prototype)){var k=function(){function e(t){r(this,e),this._pathElement=t,this._list=this._parsePath(this._pathElement.getAttribute("d")),this._mutationObserverConfig={attributes:!0,attributeFilter:["d"]},this._pathElementMutationObserver=new MutationObserver(this._updateListFromPathMutations.bind(this)),this._pathElementMutationObserver.observe(this._pathElement,this._mutationObserverConfig)}return i(e,[{key:"_checkPathSynchronizedToList",value:function(){this._updateListFromPathMutations(this._pathElementMutationObserver.takeRecords())}},{key:"_updateListFromPathMutations",value:function(e){if(this._pathElement){var t=!1;e.forEach((function(e){"d"===e.attributeName&&(t=!0)})),t&&(this._list=this._parsePath(this._pathElement.getAttribute("d")))}}},{key:"_writeListToPath",value:function(){this._pathElementMutationObserver.disconnect(),this._pathElement.setAttribute("d",e._pathSegArrayAsString(this._list)),this._pathElementMutationObserver.observe(this._pathElement,this._mutationObserverConfig)}},{key:"segmentChanged",value:function(e){this._writeListToPath()}},{key:"clear",value:function(){this._checkPathSynchronizedToList(),this._list.forEach((function(e){e._owningPathSegList=null})),this._list=[],this._writeListToPath()}},{key:"initialize",value:function(e){return this._checkPathSynchronizedToList(),this._list=[e],e._owningPathSegList=this,this._writeListToPath(),e}},{key:"_checkValidIndex",value:function(e){if(isNaN(e)||e<0||e>=this.numberOfItems)throw new Error("INDEX_SIZE_ERR")}},{key:"getItem",value:function(e){return this._checkPathSynchronizedToList(),this._checkValidIndex(e),this._list[e]}},{key:"insertItemBefore",value:function(e,t){return this._checkPathSynchronizedToList(),t>this.numberOfItems&&(t=this.numberOfItems),e._owningPathSegList&&(e=e.clone()),this._list.splice(t,0,e),e._owningPathSegList=this,this._writeListToPath(),e}},{key:"replaceItem",value:function(e,t){return this._checkPathSynchronizedToList(),e._owningPathSegList&&(e=e.clone()),this._checkValidIndex(t),this._list[t]=e,e._owningPathSegList=this,this._writeListToPath(),e}},{key:"removeItem",value:function(e){this._checkPathSynchronizedToList(),this._checkValidIndex(e);var t=this._list[e];return this._list.splice(e,1),this._writeListToPath(),t}},{key:"appendItem",value:function(e){return this._checkPathSynchronizedToList(),e._owningPathSegList&&(e=e.clone()),this._list.push(e),e._owningPathSegList=this,this._writeListToPath(),e}},{key:"_parsePath",value:function(e){if(!e||!e.length)return[];var t=this,n=function(){function e(){r(this,e),this.pathSegList=[]}return i(e,[{key:"appendSegment",value:function(e){this.pathSegList.push(e)}}]),e}(),a=function(){function e(t){r(this,e),this._string=t,this._currentIndex=0,this._endIndex=this._string.length,this._previousCommand=SVGPathSeg.PATHSEG_UNKNOWN,this._skipOptionalSpaces()}return i(e,[{key:"_isCurrentSpace",value:function(){var e=this._string[this._currentIndex];return e<=" "&&(" "===e||"\n"===e||"\t"===e||"\r"===e||"\f"===e)}},{key:"_skipOptionalSpaces",value:function(){for(;this._currentIndex="0"&&e<="9")&&t!==SVGPathSeg.PATHSEG_CLOSEPATH?t===SVGPathSeg.PATHSEG_MOVETO_ABS?SVGPathSeg.PATHSEG_LINETO_ABS:t===SVGPathSeg.PATHSEG_MOVETO_REL?SVGPathSeg.PATHSEG_LINETO_REL:t:SVGPathSeg.PATHSEG_UNKNOWN}},{key:"initialCommandIsMoveTo",value:function(){if(!this.hasMoreData())return!0;var e=this.peekSegmentType();return e===SVGPathSeg.PATHSEG_MOVETO_ABS||e===SVGPathSeg.PATHSEG_MOVETO_REL}},{key:"_parseNumber",value:function(){var e=0,t=0,n=1,r=0,a=1,i=1,o=this._currentIndex;if(this._skipOptionalSpaces(),this._currentIndex"9")&&"."!==this._string.charAt(this._currentIndex))){for(var s=this._currentIndex;this._currentIndex="0"&&this._string.charAt(this._currentIndex)<="9";)this._currentIndex++;if(this._currentIndex!==s)for(var l=this._currentIndex-1,c=1;l>=s;)t+=c*(this._string.charAt(l--)-"0"),c*=10;if(this._currentIndex=this._endIndex||this._string.charAt(this._currentIndex)<"0"||this._string.charAt(this._currentIndex)>"9")return;for(;this._currentIndex="0"&&this._string.charAt(this._currentIndex)<="9";)n*=10,r+=(this._string.charAt(this._currentIndex)-"0")/n,this._currentIndex+=1}if(this._currentIndex!==o&&this._currentIndex+1=this._endIndex||this._string.charAt(this._currentIndex)<"0"||this._string.charAt(this._currentIndex)>"9")return;for(;this._currentIndex="0"&&this._string.charAt(this._currentIndex)<="9";)e*=10,e+=this._string.charAt(this._currentIndex)-"0",this._currentIndex++}var u=t+r;if(u*=a,e&&(u*=Math.pow(10,i*e)),o!==this._currentIndex)return this._skipOptionalSpacesOrDelimiter(),u}}},{key:"_parseArcFlag",value:function(){if(!(this._currentIndex>=this._endIndex)){var e=!1,t=this._string.charAt(this._currentIndex++);if("0"===t)e=!1;else{if("1"!==t)return;e=!0}return this._skipOptionalSpacesOrDelimiter(),e}}},{key:"parseSegment",value:function(){var e=this._string[this._currentIndex],n=this._pathSegTypeFromChar(e);if(n===SVGPathSeg.PATHSEG_UNKNOWN){if(this._previousCommand===SVGPathSeg.PATHSEG_UNKNOWN)return null;if((n=this._nextCommandHelper(e,this._previousCommand))===SVGPathSeg.PATHSEG_UNKNOWN)return null}else this._currentIndex++;switch(this._previousCommand=n,n){case SVGPathSeg.PATHSEG_MOVETO_REL:return new SVGPathSegMovetoRel(t,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_MOVETO_ABS:return new SVGPathSegMovetoAbs(t,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_REL:return new SVGPathSegLinetoRel(t,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_ABS:return new SVGPathSegLinetoAbs(t,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL:return new SVGPathSegLinetoHorizontalRel(t,this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS:return new SVGPathSegLinetoHorizontalAbs(t,this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL:return new SVGPathSegLinetoVerticalRel(t,this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS:return new SVGPathSegLinetoVerticalAbs(t,this._parseNumber());case SVGPathSeg.PATHSEG_CLOSEPATH:return this._skipOptionalSpaces(),new SVGPathSegClosePath(t);case SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL:var r={x1:this._parseNumber(),y1:this._parseNumber(),x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoCubicRel(t,r.x,r.y,r.x1,r.y1,r.x2,r.y2);case SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS:var a={x1:this._parseNumber(),y1:this._parseNumber(),x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoCubicAbs(t,a.x,a.y,a.x1,a.y1,a.x2,a.y2);case SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL:var i={x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoCubicSmoothRel(t,i.x,i.y,i.x2,i.y2);case SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS:var o={x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoCubicSmoothAbs(t,o.x,o.y,o.x2,o.y2);case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL:var s={x1:this._parseNumber(),y1:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoQuadraticRel(t,s.x,s.y,s.x1,s.y1);case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS:var l={x1:this._parseNumber(),y1:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoQuadraticAbs(t,l.x,l.y,l.x1,l.y1);case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL:return new SVGPathSegCurvetoQuadraticSmoothRel(t,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS:return new SVGPathSegCurvetoQuadraticSmoothAbs(t,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_ARC_REL:var c={x1:this._parseNumber(),y1:this._parseNumber(),arcAngle:this._parseNumber(),arcLarge:this._parseArcFlag(),arcSweep:this._parseArcFlag(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegArcRel(t,c.x,c.y,c.x1,c.y1,c.arcAngle,c.arcLarge,c.arcSweep);case SVGPathSeg.PATHSEG_ARC_ABS:var u={x1:this._parseNumber(),y1:this._parseNumber(),arcAngle:this._parseNumber(),arcLarge:this._parseArcFlag(),arcSweep:this._parseArcFlag(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegArcAbs(t,u.x,u.y,u.x1,u.y1,u.arcAngle,u.arcLarge,u.arcSweep);default:throw new Error("Unknown path seg type.")}}}]),e}(),o=new n,s=new a(e);if(!s.initialCommandIsMoveTo())return[];for(;s.hasMoreData();){var l=s.parseSegment();if(!l)return[];o.appendSegment(l)}return o.pathSegList}}],[{key:"_pathSegArrayAsString",value:function(e){var t="",n=!0;return e.forEach((function(e){n?(n=!1,t+=e._asPathString()):t+=" "+e._asPathString()})),t}}]),e}();k.prototype.classname="SVGPathSegList",Object.defineProperty(k.prototype,"numberOfItems",{get:function(){return this._checkPathSynchronizedToList(),this._list.length},enumerable:!0}),Object.defineProperties(SVGPathElement.prototype,{pathSegList:{get:function(){return this._pathSegList||(this._pathSegList=new k(this)),this._pathSegList},enumerable:!0},normalizedPathSegList:{get:function(){return this.pathSegList},enumerable:!0},animatedPathSegList:{get:function(){return this.pathSegList},enumerable:!0},animatedNormalizedPathSegList:{get:function(){return this.pathSegList},enumerable:!0}}),window.SVGPathSegList=k}}();var x,w=jQuery,S=(Boolean(document.createElementNS&&document.createElementNS(_.SVG,"svg").createSVGRect),navigator.userAgent),k=document.createElementNS(_.SVG,"svg"),C=Boolean(window.opera),A=S.includes("AppleWebKit"),E=S.includes("Gecko/"),G=S.includes("MSIE"),P=S.includes("Chrome/"),I=(S.includes("Windows"),S.includes("Macintosh")),T="ontouchstart"in window,N=Boolean(k.querySelector),L=Boolean(document.evaluate),M=function(){var e=document.createElementNS(_.SVG,"path");e.setAttribute("d","M0,0 10,10");var t=e.pathSegList,n=e.createSVGPathSegLinetoAbs(5,5);try{return t.replaceItem(n,1),!0}catch(e){}return!1}(),O=function(){var e=document.createElementNS(_.SVG,"path");e.setAttribute("d","M0,0 10,10");var t=e.pathSegList,n=e.createSVGPathSegLinetoAbs(5,5);try{return t.insertItemBefore(n,1),!0}catch(e){}return!1}(),j=function(){var e=document.createElementNS(_.SVG,"svg"),t=document.createElementNS(_.SVG,"svg");document.documentElement.append(e),t.setAttribute("x",5),e.append(t);var n=document.createElementNS(_.SVG,"text");n.textContent="a",t.append(n);try{return 0===n.getStartPositionOfChar(0).x}catch(e){return!1}finally{e.remove()}}(),V=function(){var e=document.createElementNS(_.SVG,"svg");document.documentElement.append(e);var t=document.createElementNS(_.SVG,"path");t.setAttribute("d","M0,0 C0,0 10,10 10,0"),e.append(t);var n=t.getBBox();return e.remove(),n.height>4&&n.height<5}(),R=function(){var e=document.createElementNS(_.SVG,"svg");document.documentElement.append(e);var t=document.createElementNS(_.SVG,"path");t.setAttribute("d","M0,0 10,0");var n=document.createElementNS(_.SVG,"path");n.setAttribute("d","M5,0 15,0");var r=document.createElementNS(_.SVG,"g");r.append(t,n),e.append(r);var a=r.getBBox();return e.remove(),15===a.width}(),B=(function(){var e=document.createElementNS(_.SVG,"rect");e.setAttribute("x",.1);var t=!e.cloneNode(!1).getAttribute("x").includes(",");t||w.alert('NOTE: This version of Opera is known to contain bugs in SVG-edit.\nPlease upgrade to the latest version in which the problems have been fixed.')}(),(x=document.createElementNS(_.SVG,"rect")).setAttribute("style","vector-effect:non-scaling-stroke"),"non-scaling-stroke"===x.style.vectorEffect),U=function(){var t=document.createElementNS(_.SVG,"rect").transform.baseVal,n=k.createSVGTransform();t.appendItem(n);var r=t.getItem(0),a=function(t){return t&&"object"===e(t)&&"function"==typeof t.setMatrix&&"angle"in t};return a(r)&&a(n)&&r.type===n.type&&r.angle===n.angle&&r.matrix.a===n.matrix.a&&r.matrix.b===n.matrix.b&&r.matrix.c===n.matrix.c&&r.matrix.d===n.matrix.d&&r.matrix.e===n.matrix.e&&r.matrix.f===n.matrix.f}(),F=function(){return A},D=function(){return E},H=function(){return G},z=function(){return P},q=function(){return I},Y=function(){return T},W=function(){return B}; /** * A jQuery module to work with SVG attributes. * @module jQueryAttr * @license MIT */ -function H(t){var n=t.fn.attr;return t.fn.attr=function(t,r){var a=this.length;if(!a)return n.call(this,t,r);for(var i=0;i=0)return this._xforms[e];var t=new Error("DOMException with code=INDEX_SIZE_ERR");throw t.code=1,t}},{key:"insertItemBefore",value:function(e,t){var n=null;if(t>=0)if(t=0&&(this._removeFromOtherLists(e),this._xforms[t]=e,n=e,this._list._update()),n}},{key:"removeItem",value:function(e){if(e=0){var t,n=this._xforms[e],r=new Array(this.numberOfItems-1);for(t=0;t=0;t--)this.stack[t].unapply(e);e&&e.handleHistoryEvent(se.AFTER_UNAPPLY,this)}},{key:"elements",value:function(){for(var e=[],t=this.stack.length;t--;)for(var n=this.stack[t].elements(),r=n.length;r--;)e.includes(n[r])||e.push(n[r]);return e}},{key:"addSubCommand",value:function(e){this.stack.push(e)}},{key:"isEmpty",value:function(){return!this.stack.length}}]),t}();pe.type=pe.prototype.type;var fe,ge,me,ve,ye,_e=function(){function e(t){r(this,e),this.handler_=t||null,this.undoStackPointer=0,this.undoStack=[],this.undoChangeStackPointer=-1,this.undoableChangeStack=[]}return i(e,[{key:"resetUndoStack",value:function(){this.undoStack=[],this.undoStackPointer=0}},{key:"getUndoStackSize",value:function(){return this.undoStackPointer}},{key:"getRedoStackSize",value:function(){return this.undoStack.length-this.undoStackPointer}},{key:"getNextUndoCommandText",value:function(){return this.undoStackPointer>0?this.undoStack[this.undoStackPointer-1].getText():""}},{key:"getNextRedoCommandText",value:function(){return this.undoStackPointer0&&this.undoStack[--this.undoStackPointer].unapply(this.handler_)}},{key:"redo",value:function(){this.undoStackPointer0&&this.undoStack[this.undoStackPointer++].apply(this.handler_)}},{key:"addCommandToHistory",value:function(e){this.undoStackPointer0&&(this.undoStack=this.undoStack.splice(0,this.undoStackPointer)),this.undoStack.push(e),this.undoStackPointer=this.undoStack.length}},{key:"beginUndoableChange",value:function(e,t){for(var n=++this.undoChangeStackPointer,r=t.length,a=new Array(r),i=new Array(r);r--;){var o=t[r];nn(o)||(i[r]=o,a[r]=o.getAttribute(e))}this.undoableChangeStack[n]={attrName:e,oldValues:a,elements:i}}},{key:"finishUndoableChange",value:function(){for(var e=this.undoChangeStackPointer--,t=this.undoableChangeStack[e],n=t.attrName,r=new pe("Change "+n),a=t.elements.length;a--;){var i=t.elements[a];if(!nn(i)){var o={};o[n]=t.oldValues[a],o[n]!==i.getAttribute(n)&&r.addSubCommand(new he(i,o,n))}}return this.undoableChangeStack[e]=null,r}}]),e}(),be=Object.freeze({__proto__:null,HistoryEventTypes:se,MoveElementCommand:ce,InsertElementCommand:ue,RemoveElementCommand:de,ChangeElementCommand:he,BatchCommand:pe,UndoManager:_e}),xe=document.createElementNS(f.SVG,"svg"),we=function(e,t,n){return{x:n.a*e+n.c*t+n.e,y:n.b*e+n.d*t+n.f}},Se=function(e){return 1===e.a&&0===e.b&&0===e.c&&1===e.d&&0===e.e&&0===e.f},ke=function(){for(var e=arguments.length,t=new Array(e),n=0;n(n=parseInt(n))){var r=n;n=t,t=r}for(var a=xe.createSVGMatrix(),i=t;i<=n;++i){var o=i>=0&&ie.x&&t.ye.y},Ne=jQuery,Te={2:["x","y"],4:["x","y"],6:["x","y","x1","y1","x2","y2"],8:["x","y","x1","y1"],10:["x","y","r1","r2","angle","largeArcFlag","sweepFlag"],12:["x"],14:["y"],16:["x","y","x2","y2"],18:["x","y"]},Le={},Me=function(e){Object.assign(Le,e.ui)},Oe=[],je=!0,Ve={},Re=null,Be=null,Ue=function(e){Be=e,Oe=[0,"ClosePath"];Ne.each(["Moveto","Lineto","CurvetoCubic","CurvetoQuadratic","Arc","LinetoHorizontal","LinetoVertical","CurvetoCubicSmooth","CurvetoQuadraticSmooth"],(function(e,t){Oe.push(t+"Abs"),Oe.push(t+"Rel")}))},Fe=function(e,t,n){var r=e.pathSegList;if(I)r.insertItemBefore(t,n);else{for(var a=r.numberOfItems,i=[],o=0;o0?(p=g element");this.elem=t,this.segs=[],this.selected_pts=[],Re=this,this.init()}return i(e,[{key:"init",value:function(){Ne(Ye()).find("*").each((function(){Ne(this).attr("display","none")}));var e=this.elem.pathSegList,t=e.numberOfItems;this.segs=[],this.selected_pts=[],this.first_seg=null;for(var n=0;n=t?null:i[s+1],u=s-1<0?null:i[s-1];if(2===l.type){if(u&&1!==u.type){var d=i[o];d.next=i[o+1],d.next.prev=d,d.addGrip()}o=s}else if(c&&1===c.type)l.next=i[o+1],l.next.prev=l,l.mate=i[o],l.addGrip(),nn(this.first_seg)&&(this.first_seg=l);else if(c)1!==l.type&&(l.addGrip(),c&&2!==c.type&&(l.next=c,l.next.prev=l));else if(1!==l.type){var h=i[o];h.next=i[o+1],h.next.prev=h,h.addGrip(),l.addGrip(),this.first_seg||(this.first_seg=i[o])}}return this}},{key:"eachSeg",value:function(e){for(var t=this.segs.length,n=0;n=0&&n.selected_pts.push(e)})),this.selected_pts.sort();var r=this.selected_pts.length,a=[];for(a.length=r;r--;){var i=this.selected_pts[r],o=this.segs[i];o.select(!0),a[r]=o.ptgrip}var s=e.subpathIsClosed(this.selected_pts[0]);Be.addPtsToSelection({grips:a,closedSubpath:s})}}],[{key:"subpathIsClosed",value:function(e){var t=!1;return Re.eachSeg((function(n){return n<=e||2!==this.type&&(1!==this.type||(t=!0,!1))})),t}}]),e}(),tt=function(e){var t=Ve[e.id];return t||(t=Ve[e.id]=new et(e)),t},nt=function(e){e in Ve&&delete Ve[e]},rt=function(e,t){var n=e-me,r=t-ve,a=Math.sqrt(n*n+r*r),i=Math.atan2(r,n)+ye;return n=a*Math.cos(i)+me,r=a*Math.sin(i)+ve,n-=fe,r-=ge,a=Math.sqrt(n*n+r*r),i=Math.atan2(r,n)-ye,{x:a*Math.cos(i)+fe,y:a*Math.sin(i)+ge}},at=function(){var e=Re.elem;if(ye=Qt(e,!0)){var t=Re.oldbbox;me=t.x+t.width/2,ve=t.y+t.height/2;var n=Rt(e);fe=n.x+n.width/2,ge=n.y+n.height/2;var r=fe-me,a=ge-ve,i=Math.sqrt(r*r+a*a),o=Math.atan2(a,r)+ye;fe=i*Math.cos(o)+me,ge=i*Math.sin(o)+ve;for(var s=e.pathSegList,l=s.numberOfItems;l;){l-=1;var c=s.getItem(l),u=c.pathSegType;if(1!==u){var d=rt(c.x,c.y),h=[d.x,d.y];if(!nn(c.x1)&&!nn(c.x2)){var p=rt(c.x1,c.y1),f=rt(c.x2,c.y2);h.splice(h.length,0,p.x,p.y,f.x,f.y)}Ke(u,l,h)}}Rt(e);var g=Be.getSVGRoot().createSVGTransform(),m=K(e);g.setRotate(180*ye/Math.PI,fe,ge),m.replaceItem(g,0)}},it=[0,"z","M","m","L","l","C","c","Q","q","A","a","H","h","V","v","S","s","T","t"],ot=function(e,t){for(var n=e.pathSegList,r=n.numberOfItems,a=0,i=0,o="",s=null,l=0;l=k-x&&p<=k+x&&g>=C-x&&g<=C+x){w=!0;break}}a=Be.getId(),nt(a);var A,E,G=Zt(a),P=_.numberOfItems;if(w){if(b<=1&&P>=2){var I=_.getItem(0).x,N=_.getItem(0).y;A=4===(E=m.pathSegList.getItem(1)).pathSegType?y.createSVGPathSegLinetoAbs(I,N):y.createSVGPathSegCurvetoCubicAbs(I,N,E.x1/u,E.y1/u,I,N);var T=y.createSVGPathSegClosePath();_.appendItem(A),_.appendItem(T)}else if(P<3)return!1;if(Ne(m).remove(),Be.setDrawnPath(null),Be.setStarted(!1),ut){Re.matrix&&Be.remapElement(G,{},Re.matrix.inverse());var L=G.getAttribute("d"),M=Ne(Re.elem).attr("d");return Ne(Re.elem).attr("d",M+L),Ne(G).remove(),Re.matrix&&at(),Ue(),pt.toEditMode(Re.elem),Re.selectPt(),!1}}else{if(!Ne.contains(Be.getContainer(),Be.getMouseTarget(e)))return!1;var O=y.pathSegList.numberOfItems,j=y.pathSegList.getItem(O-1),V=j.x,R=j.y;if(e.shiftKey){var B=Pe(V,R,p,g);p=B.x,g=B.y}A=4===(E=m.pathSegList.getItem(1)).pathSegType?y.createSVGPathSegLinetoAbs(Be.round(p),Be.round(g)):y.createSVGPathSegCurvetoCubicAbs(Be.round(p),Be.round(g),E.x1/u,E.y1/u,E.x2/u,E.y2/u),y.pathSegList.appendItem(A),p*=u,g*=u,m.setAttribute("d",["M",p,g,p,g].join(" ")),v=O,ut&&(v+=Re.segs.length),qe(v,p,g)}}else{var U="M"+p+","+g+" ";Be.setDrawnPath(Be.addSVGElementFromJson({element:"path",curStyles:!0,attr:{d:U,id:Be.getNextId(),opacity:Be.getOpacity()/2}})),m.setAttribute("d",["M",d,h,d,h].join(" ")),v=ut?Re.segs.length:0,qe(v,d,h)}}},mouseMove:function(e,t){var n=Be.getCurrentZoom();ht=!0;var r=Be.getDrawnPath();if("path"!==Be.getCurrentMode())if(Re.dragging){var a=ze({x:Re.dragging[0],y:Re.dragging[1]},Re),i=ze({x:e,y:t},Re),o=i.x-a.x,s=i.y-a.y;Re.dragging=[e,t],Re.dragctrl?Re.moveCtrl(o,s):Re.movePts(o,s)}else Re.selected_pts=[],Re.eachSeg((function(e){if(this.next||this.prev){var t=Be.getRubberBox().getBBox(),n=He(this),r={x:n.x,y:n.y,width:0,height:0},a=Ie(t,r);this.select(a),a&&Re.selected_pts.push(this.index)}}));else{if(!r)return;var l=r.pathSegList,c=l.numberOfItems-1;if(lt){var u=We("1c1"),d=We("0c2");u.setAttribute("cx",e),u.setAttribute("cy",t),u.setAttribute("display","inline");var h=lt[0],p=lt[1],f=h+(h-e/n),g=p+(p-t/n);d.setAttribute("cx",f*n),d.setAttribute("cy",g*n),d.setAttribute("display","inline");var m=Xe(1);if($t(m,{x1:e,y1:t,x2:f*n,y2:g*n,display:"inline"}),0===c)ct=[e,t];else{var v=l.getItem(c-1),y=v.x,_=v.y;6===v.pathSegType?(y+=y-v.x2,_+=_-v.y2):ct&&(y=ct[0]/n,_=ct[1]/n),Ke(6,c,[h,p,y,_,f,g],r)}}else{var b=Zt("path_stretch_line");if(b){var x=l.getItem(c);if(6===x.pathSegType){var w=x.x+(x.x-x.x2),S=x.y+(x.y-x.y2);Ke(6,1,[e,t,w*n,S*n,e,t],b)}else ct?Ke(6,1,[e,t,ct[0],ct[1],e,t],b):Ke(4,1,[e,t],b)}}}},mouseUp:function(e,t,n,r){var a=Be.getDrawnPath();if("path"===Be.getCurrentMode())return lt=null,a||(t=Zt(Be.getId()),Be.setStarted(!1),ct=null),{keep:!0,element:t};var i=Be.getRubberBox();if(Re.dragging){var o=Re.cur_pt;Re.dragging=!1,Re.dragctrl=!1,Re.update(),ht&&Re.endChanges("Move path point(s)"),e.shiftKey||ht||Re.selectPt(o)}else i&&"none"!==i.getAttribute("display")?(i.setAttribute("display","none"),i.getAttribute("width")<=2&&i.getAttribute("height")<=2&&pt.toSelectMode(e.target)):pt.toSelectMode(e.target);ht=!1},toEditMode:function(e){Re=tt(e),Be.setCurrentMode("pathedit"),Be.clearSelection(),Re.show(!0).update(),Re.oldbbox=Rt(Re.elem),ut=!1},toSelectMode:function(e){var t=e===Re.elem;Be.setCurrentMode("select"),Re.show(!1),dt=!1,Be.clearSelection(),Re.matrix&&at(),t&&(Be.call("selected",[e]),Be.addToSelection([e],!0))},addSubPath:function(e){e?(Be.setCurrentMode("path"),ut=!0):(pt.clear(!0),pt.toEditMode(Re.elem))},select:function(e){dt===e?(pt.toEditMode(e),Be.setCurrentMode("pathedit")):dt=e},reorient:function(){var e=Be.getSelectedElements()[0];if(e&&0!==Qt(e)){var t=new pe("Reorient path"),n={d:e.getAttribute("d"),transform:e.getAttribute("transform")};t.addSubCommand(new he(e,n)),Be.clearSelection(),this.resetOrientation(e),Be.addCommandToHistory(t),tt(e).show(!1).matrix=null,this.clear(),Be.addToSelection([e],!0),Be.call("changed",Be.getSelectedElements())}},clear:function(e){var t=Be.getDrawnPath();if(dt=null,t){var n=Zt(Be.getId());Ne(Zt("path_stretch_line")).remove(),Ne(n).remove(),Ne(Zt("pathpointgrip_container")).find("*").attr("display","none"),ct=null,Be.setDrawnPath(null),Be.setStarted(!1)}else"pathedit"===Be.getCurrentMode()&&this.toSelectMode();Re&&Re.init().show(!1)},resetOrientation:function(e){if(nn(e)||"path"!==e.nodeName)return!1;var t=K(e),n=Ee(t).matrix;t.clear(),e.removeAttribute("transform");for(var r=e.pathSegList,a=r.numberOfItems,i=function(t){var a=r.getItem(t),i=a.pathSegType;if(1===i)return"continue";var o=[];Ne.each(["",1,2],(function(e,t){var r=a["x"+t],i=a["y"+t];if(void 0!==r&&void 0!==i){var s=we(r,i,n);o.splice(o.length,0,s.x,s.y)}})),Ke(i,t,o,e)},o=0;o0){var s=t.getItem(n-1).pathSegType;if(2===s){r(n-1,1),e();break}if(1===s&&t.numberOfItems-1===n){r(n,1),e();break}}}return!1}(),Re.elem.pathSegList.numberOfItems<=1)return pt.toSelectMode(Re.elem),void Be.canvas.deleteSelectedElements();if(Re.init(),Re.clearSelection(),window.opera){var r=Ne(Re.elem);r.attr("d",r.attr("d"))}Re.endChanges("Delete path node(s)")}},smoothPolylineIntoPath:function(e){var t,n=e.points,r=n.numberOfItems;if(r>=4){var a=n.getItem(0),i=null,o=[];for(o.push(["M",a.x,",",a.y," C"].join("")),t=1;t<=r-4;t+=3){var s=n.getItem(t),l=n.getItem(t+1),c=n.getItem(t+2);if(i){var u=$e(i,s,a);if(u&&2===u.length){var d=o[o.length-1].split(",");d[2]=u[0].x,d[3]=u[0].y,o[o.length-1]=d.join(","),s=u[1]}}o.push([s.x,s.y,l.x,l.y,c.x,c.y].join(",")),a=c,i=l}for(o.push("L");t)/,"$1$2")},wt=function(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")};function St(e){if(e=At(e),window.btoa)return window.btoa(e);var t=new Array(4*Math.floor((e.length+2)/3)),n=0,r=0;do{var a=e.charCodeAt(n++),i=e.charCodeAt(n++),o=e.charCodeAt(n++),s=a>>2,l=(3&a)<<4|i>>4,c=(15&i)<<2|o>>6,u=63&o;isNaN(i)?(c=64,u=64):isNaN(o)&&(u=64),t[r++]=gt.charAt(s),t[r++]=gt.charAt(l),t[r++]=gt.charAt(c),t[r++]=gt.charAt(u)}while(n>4,l=(15&a)<<4|i>>2,c=(3&i)<<6|o;t+=String.fromCharCode(s),64!==i&&(t+=String.fromCharCode(l)),64!==o&&(t+=String.fromCharCode(c))}while(nSVG-edit "],{type:"text/html"});return Gt(e)}(),It=function(e){var t,n;e.includes("0?t=t[0]:(t=e.ownerDocument.createElementNS(f.SVG,"defs"),e.firstChild?e.insertBefore(t,e.firstChild.nextSibling):e.append(t)),t},jt=function(e){for(var t=e.pathSegList,n=t.numberOfItems,r=[[],[]],a=t.getItem(0),i=[a.x,a.y],o=function(e,t,n,r){return function(a){return 1-Math.pow(a,3)*i[e]+3-Math.pow(a,2)*a*t[e]+3*(1-a)*Math.pow(a,2)*n[e]+Math.pow(a,3)*r[e]}},s=0;s0&&y<1&&r[h].push(p(y));var _=(-f-Math.sqrt(v))/(2*g);_>0&&_<1&&r[h].push(p(_))}}else{if(0===f)continue;var b=-m/f;b>0&&b<1&&r[h].push(p(b))}}i=d}else r[0].push(l.x),r[1].push(l.y)}var x=Math.min.apply(null,r[0]),w=Math.max.apply(null,r[0])-x,S=Math.min.apply(null,r[1]);return{x:x,y:S,width:w,height:Math.max.apply(null,r[1])-S}};function Vt(e){if(L)try{return e.getBBox()}catch(e){}var t,n,r=ft.data(e,"ref"),a=null;r?(n=ft(r).children().clone().attr("visibility","hidden"),ft(bt).append(n),a=n.filter("line, path")):a=ft(e).find("line, path");var i=!1;if(a.length)if(a.each((function(){var e=this.getBBox();e.width&&e.height||(i=!0)})),i){var o=r?n:ft(e).children();t=qt(o)}else t=e.getBBox();else t=e.getBBox();return r&&n.remove(),t}var Rt=function(e){var t=e||vt.geSelectedElements()[0];if(1!==e.nodeType)return null;var n,r=t.nodeName,a=null;switch(r){case"text":""===t.textContent?(t.textContent="a",a=t.getBBox(),t.textContent=""):t.getBBox&&(a=t.getBBox());break;case"path":T?t.getBBox&&(a=t.getBBox()):a=jt(t);break;case"g":case"a":a=Vt(t);break;default:if("use"===r&&(a=Vt(t)),"use"===r||"foreignObject"===r&&j()){if(a||(a=t.getBBox()),!j()){var i=a,o=i.x,s=i.y;a={width:i.width,height:i.height,x:o+parseFloat(t.getAttribute("x")||0),y:s+parseFloat(t.getAttribute("y")||0)}}}else if(mt.includes(r))if(t)try{a=t.getBBox()}catch(e){var l=t.getExtentOfChar(0),c=t.getComputedTextLength();a={x:l.x,y:l.y,width:c,height:l.height}}else{var u=ft(t).closest("foreignObject");u.length&&u[0].getBBox&&(a=u[0].getBBox())}}return a&&(a={x:(n=a).x,y:n.y,width:n.width,height:n.height}),a},Bt=function(e){var t="";return ft.each(e,(function(e,n){var r=d(n,2),a=r[0],i=r[1];t+=a;for(var o=0;o-.001&&n<.001||(n<-89.99||n>89.99))}(i,o)){if(["ellipse","path","line","polyline","polygon"].includes(e.tagName))r=s=Dt(e,t,n);else if("rect"===e.tagName){var l=e.getAttribute("rx"),c=e.getAttribute("ry");(l||c)&&(r=s=Dt(e,t,n))}}if(!s){var u=Ee(a).matrix;r=Ae(r.x,r.y,r.width,r.height,u).aabox}}return r};function zt(e){var t=e.getAttribute("stroke-width");return isNaN(t)||"none"===e.getAttribute("stroke")?0:t/2}var qt=function(e,t,n){if(!e||!e.length)return!1;var r;if(ft.each(e,(function(){r||this.parentNode&&(r=Ht(this,t,n))})),void 0===r)return null;var a=r.x+r.width,i=r.y+r.height,o=r.x,s=r.y;if(1===e.length){var l=zt(e[0]);o-=l,s-=l,a+=l,i+=l}else ft.each(e,(function(e,r){var l=Ht(r,t,n);if(l){var c=zt(r);o=Math.min(o,l.x-c),s=Math.min(s,l.y-c),1===r.nodeType&&(a=Math.max(a,l.x+l.width+c),i=Math.max(i,l.y+l.height+c))}}));return r.x=o,r.y=s,r.width=a-o,r.height=i-s,r},Yt=function(e){e||(e=ft(vt.getSVGContent()).children());var t=[];return ft(e).children().each((function(e,n){n.getBBox&&t.push(n)})),t.reverse()},Wt=function(e){return e||(e=Yt()),qt(e,vt.addSVGElementFromJson,vt.pathActions)},Xt=function(e,t){if(!e)return 0;for(var n=e.numberOfItems,r=0;r");var t=e.shortcut||"";rn("#cmenu_canvas").append("
  • "+e.label+""+t+"
  • ")}(e)}))}; +function X(t){var n=t.fn.attr;return t.fn.attr=function(t,r){var a=this.length;if(!a)return n.call(this,t,r);for(var i=0;i=0)return this._xforms[e];var t=new Error("DOMException with code=INDEX_SIZE_ERR");throw t.code=1,t}},{key:"insertItemBefore",value:function(e,t){var n=null;if(t>=0)if(t=0&&(this._removeFromOtherLists(e),this._xforms[t]=e,n=e,this._list._update()),n}},{key:"removeItem",value:function(e){if(e=0){var t,n=this._xforms[e],r=new Array(this.numberOfItems-1);for(t=0;t=0;t--)this.stack[t].unapply(e);e&&e.handleHistoryEvent(he.AFTER_UNAPPLY,this)}},{key:"elements",value:function(){for(var e=[],t=this.stack.length;t--;)for(var n=this.stack[t].elements(),r=n.length;r--;)e.includes(n[r])||e.push(n[r]);return e}},{key:"addSubCommand",value:function(e){this.stack.push(e)}},{key:"isEmpty",value:function(){return!this.stack.length}}]),n}();ye.type=ye.prototype.type;var _e,be,xe,we,Se,ke=function(){function e(t){r(this,e),this.handler_=t||null,this.undoStackPointer=0,this.undoStack=[],this.undoChangeStackPointer=-1,this.undoableChangeStack=[]}return i(e,[{key:"resetUndoStack",value:function(){this.undoStack=[],this.undoStackPointer=0}},{key:"getUndoStackSize",value:function(){return this.undoStackPointer}},{key:"getRedoStackSize",value:function(){return this.undoStack.length-this.undoStackPointer}},{key:"getNextUndoCommandText",value:function(){return this.undoStackPointer>0?this.undoStack[this.undoStackPointer-1].getText():""}},{key:"getNextRedoCommandText",value:function(){return this.undoStackPointer0&&this.undoStack[--this.undoStackPointer].unapply(this.handler_)}},{key:"redo",value:function(){this.undoStackPointer0&&this.undoStack[this.undoStackPointer++].apply(this.handler_)}},{key:"addCommandToHistory",value:function(e){this.undoStackPointer0&&(this.undoStack=this.undoStack.splice(0,this.undoStackPointer)),this.undoStack.push(e),this.undoStackPointer=this.undoStack.length}},{key:"beginUndoableChange",value:function(e,t){for(var n=++this.undoChangeStackPointer,r=t.length,a=new Array(r),i=new Array(r);r--;){var o=t[r];ln(o)||(i[r]=o,a[r]=o.getAttribute(e))}this.undoableChangeStack[n]={attrName:e,oldValues:a,elements:i}}},{key:"finishUndoableChange",value:function(){for(var e=this.undoChangeStackPointer--,t=this.undoableChangeStack[e],n=t.attrName,r=new ye("Change "+n),a=t.elements.length;a--;){var i=t.elements[a];if(!ln(i)){var o={};o[n]=t.oldValues[a],o[n]!==i.getAttribute(n)&&r.addSubCommand(new ve(i,o,n))}}return this.undoableChangeStack[e]=null,r}}]),e}(),Ce=Object.freeze({__proto__:null,HistoryEventTypes:he,MoveElementCommand:pe,InsertElementCommand:ge,RemoveElementCommand:me,ChangeElementCommand:ve,BatchCommand:ye,UndoManager:ke}),Ae=document.createElementNS(_.SVG,"svg"),Ee=function(e,t,n){return{x:n.a*e+n.c*t+n.e,y:n.b*e+n.d*t+n.f}},Ge=function(e){return 1===e.a&&0===e.b&&0===e.c&&1===e.d&&0===e.e&&0===e.f},Pe=function(){for(var e=arguments.length,t=new Array(e),n=0;n(n=parseInt(n))){var r=n;n=t,t=r}for(var a=Ae.createSVGMatrix(),i=t;i<=n;++i){var o=i>=0&&ie.x&&t.ye.y},je=jQuery,Ve={2:["x","y"],4:["x","y"],6:["x","y","x1","y1","x2","y2"],8:["x","y","x1","y1"],10:["x","y","r1","r2","angle","largeArcFlag","sweepFlag"],12:["x"],14:["y"],16:["x","y","x2","y2"],18:["x","y"]},Re={},Be=function(e){Object.assign(Re,e.ui)},Ue=[],Fe=!0,De={},He=null,ze=null,qe=function(e){ze=e,Ue=[0,"ClosePath"];je.each(["Moveto","Lineto","CurvetoCubic","CurvetoQuadratic","Arc","LinetoHorizontal","LinetoVertical","CurvetoCubicSmooth","CurvetoQuadraticSmooth"],(function(e,t){Ue.push(t+"Abs"),Ue.push(t+"Rel")}))},Ye=function(e,t,n){var r=e.pathSegList;if(O)r.insertItemBefore(t,n);else{for(var a=r.numberOfItems,i=[],o=0;o0?(f=g element");this.elem=t,this.segs=[],this.selected_pts=[],He=this,this.init()}return i(e,[{key:"init",value:function(){je(Ze()).find("*").each((function(){je(this).attr("display","none")}));var e=this.elem.pathSegList,t=e.numberOfItems;this.segs=[],this.selected_pts=[],this.first_seg=null;for(var n=0;n=t?null:i[s+1],u=s-1<0?null:i[s-1];if(2===l.type){if(u&&1!==u.type){var d=i[o];d.next=i[o+1],d.next.prev=d,d.addGrip()}o=s}else if(c&&1===c.type)l.next=i[o+1],l.next.prev=l,l.mate=i[o],l.addGrip(),ln(this.first_seg)&&(this.first_seg=l);else if(c)1!==l.type&&(l.addGrip(),c&&2!==c.type&&(l.next=c,l.next.prev=l));else if(1!==l.type){var h=i[o];h.next=i[o+1],h.next.prev=h,h.addGrip(),l.addGrip(),this.first_seg||(this.first_seg=i[o])}}return this}},{key:"eachSeg",value:function(e){for(var t=this.segs.length,n=0;n=0&&n.selected_pts.push(e)})),this.selected_pts.sort();var r=this.selected_pts.length,a=[];for(a.length=r;r--;){var i=this.selected_pts[r],o=this.segs[i];o.select(!0),a[r]=o.ptgrip}var s=e.subpathIsClosed(this.selected_pts[0]);ze.addPtsToSelection({grips:a,closedSubpath:s})}}],[{key:"subpathIsClosed",value:function(e){var t=!1;return He.eachSeg((function(n){return n<=e||2!==this.type&&(1!==this.type||(t=!0,!1))})),t}}]),e}(),ot=function(e){var t=De[e.id];return t||(t=De[e.id]=new it(e)),t},st=function(e){e in De&&delete De[e]},lt=function(e,t){var n=e-xe,r=t-we,a=Math.sqrt(n*n+r*r),i=Math.atan2(r,n)+Se;return n=a*Math.cos(i)+xe,r=a*Math.sin(i)+we,n-=_e,r-=be,a=Math.sqrt(n*n+r*r),i=Math.atan2(r,n)-Se,{x:a*Math.cos(i)+_e,y:a*Math.sin(i)+be}},ct=function(){var e=He.elem;if(Se=en(e,!0)){var t=He.oldbbox;xe=t.x+t.width/2,we=t.y+t.height/2;var n=Ht(e);_e=n.x+n.width/2,be=n.y+n.height/2;var r=_e-xe,a=be-we,i=Math.sqrt(r*r+a*a),o=Math.atan2(a,r)+Se;_e=i*Math.cos(o)+xe,be=i*Math.sin(o)+we;for(var s=e.pathSegList,l=s.numberOfItems;l;){l-=1;var c=s.getItem(l),u=c.pathSegType;if(1!==u){var d=lt(c.x,c.y),h=[d.x,d.y];if(!ln(c.x1)&&!ln(c.x2)){var f=lt(c.x1,c.y1),p=lt(c.x2,c.y2);h.splice(h.length,0,f.x,f.y,p.x,p.y)}tt(u,l,h)}}Ht(e);var g=ze.getSVGRoot().createSVGTransform(),m=te(e);g.setRotate(180*Se/Math.PI,_e,be),m.replaceItem(g,0)}},ut=[0,"z","M","m","L","l","C","c","Q","q","A","a","H","h","V","v","S","s","T","t"],dt=function(e,t){for(var n=e.pathSegList,r=n.numberOfItems,a=0,i=0,o="",s=null,l=0;l=k-x&&f<=k+x&&p>=C-x&&p<=C+x){w=!0;break}}a=ze.getId(),st(a);var A,E,G=nn(a),P=y.numberOfItems;if(w){if(b<=1&&P>=2){var I=y.getItem(0).x,T=y.getItem(0).y;A=4===(E=g.pathSegList.getItem(1)).pathSegType?v.createSVGPathSegLinetoAbs(I,T):v.createSVGPathSegCurvetoCubicAbs(I,T,E.x1/u,E.y1/u,I,T);var N=v.createSVGPathSegClosePath();y.appendItem(A),y.appendItem(N)}else if(P<3)return!1;if(je(g).remove(),ze.setDrawnPath(null),ze.setStarted(!1),gt){He.matrix&&ze.remapElement(G,{},He.matrix.inverse());var L=G.getAttribute("d"),M=je(He.elem).attr("d");return je(He.elem).attr("d",M+L),je(G).remove(),He.matrix&&ct(),qe(),yt.toEditMode(He.elem),He.selectPt(),!1}}else{if(!je.contains(ze.getContainer(),ze.getMouseTarget(e)))return!1;var O=v.pathSegList.numberOfItems,j=v.pathSegList.getItem(O-1),V=j.x,R=j.y;if(e.shiftKey){var B=Me(V,R,f,p);f=B.x,p=B.y}A=4===(E=g.pathSegList.getItem(1)).pathSegType?v.createSVGPathSegLinetoAbs(ze.round(f),ze.round(p)):v.createSVGPathSegCurvetoCubicAbs(ze.round(f),ze.round(p),E.x1/u,E.y1/u,E.x2/u,E.y2/u),v.pathSegList.appendItem(A),f*=u,p*=u,g.setAttribute("d",["M",f,p,f,p].join(" ")),m=O,gt&&(m+=He.segs.length),Ke(m,f,p)}}else{var U="M"+f+","+p+" ";ze.setDrawnPath(ze.addSVGElementFromJson({element:"path",curStyles:!0,attr:{d:U,id:ze.getNextId(),opacity:ze.getOpacity()/2}})),g.setAttribute("d",["M",d,h,d,h].join(" ")),m=gt?He.segs.length:0,Ke(m,d,h)}}},mouseMove:function(e,t){var n=ze.getCurrentZoom();vt=!0;var r=ze.getDrawnPath();if("path"!==ze.getCurrentMode())if(He.dragging){var a=Qe({x:He.dragging[0],y:He.dragging[1]},He),i=Qe({x:e,y:t},He),o=i.x-a.x,s=i.y-a.y;He.dragging=[e,t],He.dragctrl?He.moveCtrl(o,s):He.movePts(o,s)}else He.selected_pts=[],He.eachSeg((function(e){if(this.next||this.prev){var t=ze.getRubberBox().getBBox(),n=Xe(this),r={x:n.x,y:n.y,width:0,height:0},a=Oe(t,r);this.select(a),a&&He.selected_pts.push(this.index)}}));else{if(!r)return;var l=r.pathSegList,c=l.numberOfItems-1;if(ft){var u=$e("1c1"),d=$e("0c2");u.setAttribute("cx",e),u.setAttribute("cy",t),u.setAttribute("display","inline");var h=ft[0],f=ft[1],p=h+(h-e/n),g=f+(f-t/n);d.setAttribute("cx",p*n),d.setAttribute("cy",g*n),d.setAttribute("display","inline");var m=Je(1);if(rn(m,{x1:e,y1:t,x2:p*n,y2:g*n,display:"inline"}),0===c)pt=[e,t];else{var v=l.getItem(c-1),y=v.x,_=v.y;6===v.pathSegType?(y+=y-v.x2,_+=_-v.y2):pt&&(y=pt[0]/n,_=pt[1]/n),tt(6,c,[h,f,y,_,p,g],r)}}else{var b=nn("path_stretch_line");if(b){var x=l.getItem(c);if(6===x.pathSegType){var w=x.x+(x.x-x.x2),S=x.y+(x.y-x.y2);tt(6,1,[e,t,w*n,S*n,e,t],b)}else pt?tt(6,1,[e,t,pt[0],pt[1],e,t],b):tt(4,1,[e,t],b)}}}},mouseUp:function(e,t,n,r){var a=ze.getDrawnPath();if("path"===ze.getCurrentMode())return ft=null,a||(t=nn(ze.getId()),ze.setStarted(!1),pt=null),{keep:!0,element:t};var i=ze.getRubberBox();if(He.dragging){var o=He.cur_pt;He.dragging=!1,He.dragctrl=!1,He.update(),vt&&He.endChanges("Move path point(s)"),e.shiftKey||vt||He.selectPt(o)}else i&&"none"!==i.getAttribute("display")?(i.setAttribute("display","none"),i.getAttribute("width")<=2&&i.getAttribute("height")<=2&&yt.toSelectMode(e.target)):yt.toSelectMode(e.target);vt=!1},toEditMode:function(e){He=ot(e),ze.setCurrentMode("pathedit"),ze.clearSelection(),He.show(!0).update(),He.oldbbox=Ht(He.elem),gt=!1},toSelectMode:function(e){var t=e===He.elem;ze.setCurrentMode("select"),He.show(!1),mt=!1,ze.clearSelection(),He.matrix&&ct(),t&&(ze.call("selected",[e]),ze.addToSelection([e],!0))},addSubPath:function(e){e?(ze.setCurrentMode("path"),gt=!0):(yt.clear(!0),yt.toEditMode(He.elem))},select:function(e){mt===e?(yt.toEditMode(e),ze.setCurrentMode("pathedit")):mt=e},reorient:function(){var e=ze.getSelectedElements()[0];if(e&&0!==en(e)){var t=new ye("Reorient path"),n={d:e.getAttribute("d"),transform:e.getAttribute("transform")};t.addSubCommand(new ve(e,n)),ze.clearSelection(),this.resetOrientation(e),ze.addCommandToHistory(t),ot(e).show(!1).matrix=null,this.clear(),ze.addToSelection([e],!0),ze.call("changed",ze.getSelectedElements())}},clear:function(e){var t=ze.getDrawnPath();if(mt=null,t){var n=nn(ze.getId());je(nn("path_stretch_line")).remove(),je(n).remove(),je(nn("pathpointgrip_container")).find("*").attr("display","none"),pt=null,ze.setDrawnPath(null),ze.setStarted(!1)}else"pathedit"===ze.getCurrentMode()&&this.toSelectMode();He&&He.init().show(!1)},resetOrientation:function(e){if(ln(e)||"path"!==e.nodeName)return!1;var t=te(e),n=Ne(t).matrix;t.clear(),e.removeAttribute("transform");for(var r=e.pathSegList,a=r.numberOfItems,i=function(t){var a=r.getItem(t),i=a.pathSegType;if(1===i)return"continue";var o=[];je.each(["",1,2],(function(e,t){var r=a["x"+t],i=a["y"+t];if(void 0!==r&&void 0!==i){var s=Ee(r,i,n);o.splice(o.length,0,s.x,s.y)}})),tt(i,t,o,e)},o=0;o0){var s=t.getItem(n-1).pathSegType;if(2===s){r(n-1,1),e();break}if(1===s&&t.numberOfItems-1===n){r(n,1),e();break}}}return!1}(),He.elem.pathSegList.numberOfItems<=1)return yt.toSelectMode(He.elem),void ze.canvas.deleteSelectedElements();if(He.init(),He.clearSelection(),window.opera){var r=je(He.elem);r.attr("d",r.attr("d"))}He.endChanges("Delete path node(s)")}},smoothPolylineIntoPath:function(e){var t,n=e.points,r=n.numberOfItems;if(r>=4){var a=n.getItem(0),i=null,o=[];for(o.push(["M",a.x,",",a.y," C"].join("")),t=1;t<=r-4;t+=3){var s=n.getItem(t),l=n.getItem(t+1),c=n.getItem(t+2);if(i){var u=rt(i,s,a);if(u&&2===u.length){var d=o[o.length-1].split(",");d[2]=u[0].x,d[3]=u[0].y,o[o.length-1]=d.join(","),s=u[1]}}o.push([s.x,s.y,l.x,l.y,c.x,c.y].join(",")),a=c,i=l}for(o.push("L");t)/,"$1$2")},Et=function(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")};function Gt(e){if(e=Tt(e),window.btoa)return window.btoa(e);var t=new Array(4*Math.floor((e.length+2)/3)),n=0,r=0;do{var a=e.charCodeAt(n++),i=e.charCodeAt(n++),o=e.charCodeAt(n++),s=a>>2,l=(3&a)<<4|i>>4,c=(15&i)<<2|o>>6,u=63&o;isNaN(i)?(c=64,u=64):isNaN(o)&&(u=64),t[r++]=bt.charAt(s),t[r++]=bt.charAt(l),t[r++]=bt.charAt(c),t[r++]=bt.charAt(u)}while(n>4,l=(15&a)<<4|i>>2,c=(3&i)<<6|o;t+=String.fromCharCode(s),64!==i&&(t+=String.fromCharCode(l)),64!==o&&(t+=String.fromCharCode(c))}while(nSVG-edit "],{type:"text/html"});return Lt(e)}(),Ot=function(e){var t,n;e.includes("0?t=t[0]:(t=e.ownerDocument.createElementNS(_.SVG,"defs"),e.firstChild?e.insertBefore(t,e.firstChild.nextSibling):e.append(t)),t},Ft=function(e){for(var t=e.pathSegList,n=t.numberOfItems,r=[[],[]],a=t.getItem(0),i=[a.x,a.y],o=function(e,t,n,r){return function(a){return 1-Math.pow(a,3)*i[e]+3-Math.pow(a,2)*a*t[e]+3*(1-a)*Math.pow(a,2)*n[e]+Math.pow(a,3)*r[e]}},s=0;s0&&y<1&&r[h].push(f(y));var _=(-p-Math.sqrt(v))/(2*g);_>0&&_<1&&r[h].push(f(_))}}else{if(0===p)continue;var b=-m/p;b>0&&b<1&&r[h].push(f(b))}}i=d}else r[0].push(l.x),r[1].push(l.y)}var x=Math.min.apply(null,r[0]),w=Math.max.apply(null,r[0])-x,S=Math.min.apply(null,r[1]);return{x:x,y:S,width:w,height:Math.max.apply(null,r[1])-S}};function Dt(e){if(R)try{return e.getBBox()}catch(e){}var t,n,r=_t.data(e,"ref"),a=null;r?(n=_t(r).children().clone().attr("visibility","hidden"),_t(Ct).append(n),a=n.filter("line, path")):a=_t(e).find("line, path");var i=!1;if(a.length)if(a.each((function(){var e=this.getBBox();e.width&&e.height||(i=!0)})),i){var o=r?n:_t(e).children();t=Kt(o)}else t=e.getBBox();else t=e.getBBox();return r&&n.remove(),t}var Ht=function(e){var t=e||wt.geSelectedElements()[0];if(1!==e.nodeType)return null;var n,r=t.nodeName,a=null;switch(r){case"text":""===t.textContent?(t.textContent="a",a=t.getBBox(),t.textContent=""):t.getBBox&&(a=t.getBBox());break;case"path":V?t.getBBox&&(a=t.getBBox()):a=Ft(t);break;case"g":case"a":a=Dt(t);break;default:if("use"===r&&(a=Dt(t)),"use"===r||"foreignObject"===r&&F()){if(a||(a=t.getBBox()),!F()){var i=a,o=i.x,s=i.y;a={width:i.width,height:i.height,x:o+parseFloat(t.getAttribute("x")||0),y:s+parseFloat(t.getAttribute("y")||0)}}}else if(xt.includes(r))if(t)try{a=t.getBBox()}catch(e){var l=t.getExtentOfChar(0),c=t.getComputedTextLength();a={x:l.x,y:l.y,width:c,height:l.height}}else{var u=_t(t).closest("foreignObject");u.length&&u[0].getBBox&&(a=u[0].getBBox())}}return a&&(a={x:(n=a).x,y:n.y,width:n.width,height:n.height}),a},zt=function(e){var t="";return _t.each(e,(function(e,n){var r=f(n,2),a=r[0],i=r[1];t+=a;for(var o=0;o-.001&&n<.001||(n<-89.99||n>89.99))}(i,o)){if(["ellipse","path","line","polyline","polygon"].includes(e.tagName))r=s=Wt(e,t,n);else if("rect"===e.tagName){var l=e.getAttribute("rx"),c=e.getAttribute("ry");(l||c)&&(r=s=Wt(e,t,n))}}if(!s){var u=Ne(a).matrix;r=Te(r.x,r.y,r.width,r.height,u).aabox}}return r};function Qt(e){var t=e.getAttribute("stroke-width");return isNaN(t)||"none"===e.getAttribute("stroke")?0:t/2}var Kt=function(e,t,n){if(!e||!e.length)return!1;var r;if(_t.each(e,(function(){r||this.parentNode&&(r=Xt(this,t,n))})),void 0===r)return null;var a=r.x+r.width,i=r.y+r.height,o=r.x,s=r.y;if(1===e.length){var l=Qt(e[0]);o-=l,s-=l,a+=l,i+=l}else _t.each(e,(function(e,r){var l=Xt(r,t,n);if(l){var c=Qt(r);o=Math.min(o,l.x-c),s=Math.min(s,l.y-c),1===r.nodeType&&(a=Math.max(a,l.x+l.width+c),i=Math.max(i,l.y+l.height+c))}}));return r.x=o,r.y=s,r.width=a-o,r.height=i-s,r},Zt=function(e){e||(e=_t(wt.getSVGContent()).children());var t=[];return _t(e).children().each((function(e,n){n.getBBox&&t.push(n)})),t.reverse()},$t=function(e){return e||(e=Zt()),Kt(e,wt.addSVGElementFromJson,wt.pathActions)},Jt=function(e,t){if(!e)return 0;for(var n=e.numberOfItems,r=0;r");var t=e.shortcut||"";cn("#cmenu_canvas").append("
  • "+e.label+""+t+"
  • ")}(e)}))}; /** * Adapted from {@link https://github.com/uupaa/dynamic-import-polyfill/blob/master/importModule.js}. * @module importModule * @license MIT */ -function sn(e){var t=document.createElement("a");return t.setAttribute("href",e),t.cloneNode(!1).href}function ln(e,t){["id","class","type"].forEach((function(n){n in t&&(e[n]=t[n])}))}function cn(e,t){return un(e,o({},t,{returnDefault:!0}))}function un(e,t){return dn.apply(this,arguments)}function dn(){return(dn=n(regeneratorRuntime.mark((function e(t,n){var r,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.global,a=n.returnDefault,!(!("svgEditor"in window)||!window.svgEditor||!1!==window.svgEditor.modules)){e.next=4;break}return e.abrupt("return",pn(t,void 0,{returnDefault:a}));case 4:return e.next=6,hn(t);case 6:return e.abrupt("return",window[r]);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function hn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Array.isArray(e)?Promise.all(e.map((function(e){return hn(e,t)}))):new Promise((function(n,r){var a=document.createElement("script");function i(){r(new Error("Failed to import: ".concat(e))),s()}function o(){n(),s()}var s=function(){a.removeEventListener("error",i),a.removeEventListener("load",o),a.remove(),a.src=""};a.defer="defer",ln(a,t),a.addEventListener("error",i),a.addEventListener("load",o),a.src=e,document.head.append(a)}))}function pn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.returnDefault,a=void 0!==r&&r;return Array.isArray(e)?Promise.all(e.map((function(e){return pn(e,t)}))):new Promise((function(n,r){var i="$importModule$"+Math.random().toString(32).slice(2),o=document.createElement("script");function s(){r(new Error("Failed to import: ".concat(e))),c()}function l(){n(window[i]),c()}var c=function(){delete window[i],o.removeEventListener("error",s),o.removeEventListener("load",l),o.remove(),URL.revokeObjectURL(o.src),o.src=""};ln(o,t),o.defer="defer",o.type="module",o.addEventListener("error",s),o.addEventListener("load",l);var u=sn(e),d="import * as m from '".concat(u.replace(/'/g,"\\'"),"'; window.").concat(i," = ").concat(a?"m.default || ":"","m;"),h=new Blob([d],{type:"text/javascript"});o.src=URL.createObjectURL(h),document.head.append(o)}))}var fn={true:!0,false:!1,null:null};function gn(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ok:"Ok",cancel:"Cancel"};t("#dialog_container").draggable({cancel:"#dialog_content, #dialog_buttons *",containment:"window"}).css("position","absolute");var r=t("#dialog_box"),a=t("#dialog_buttons"),i=t("#dialog_content");function o(o,s,l,c,u,d){i.html("

    "+s.replace(/\n/g,"

    ")+"

    ").toggleClass("prompt","prompt"===o),a.empty();var h=t('').appendTo(a);return new Promise((function(p,f){var g,m;if("alert"!==o&&t('').appendTo(a).click((function(){r.hide(),p(!1)})),"prompt"===o)(g=t('').prependTo(a)).val(l||""),g.bind("keydown","return",(function(){h.click()}));else if("select"===o){var v=t('
    ');if(g=t('').appendTo(y)).val(d.value),d.tooltip&&y.attr("title",d.tooltip),m.prop("checked",Boolean(d.checked)),v.append(t("
    ").append(y))}t.each(c||[],(function(n,r){"object"===e(r)?g.append(t("